# QI Tech — Documentação completa

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

Índice:
- Atualização uso de TAC (/en/documentation/1bb151c7-735f-4449-bd9a-4780be271da8)
- Troca com Troco SIAPE/EXÉRCITO (/en/documentation/6fabde14-8ce4-42ac-9f93-28246356e45d)
- Abertura de Conta em Duas Etapas (/en/documentation/account_request)
- Manual de Aditamento (/en/documentation/aditamento/manual_aditamento)
- Schedule boleto payment (/en/documentation/agendamentos/agendamento_boleto)
- Schedule Pix Transfer (/en/documentation/agendamentos/agendamento_pix)
- Schedule TED Transfer (/en/documentation/agendamentos/agendamento_ted)
- Cancellation of scheduling (/en/documentation/agendamentos/cancelar_agendamento)
- List of scheduled transactions (/en/documentation/agendamentos/consulta_agendamentos)
- arranjos_e_adquirentes (/en/documentation/arranjos_e_adquirentes/)
- Criar uma renegociação (/en/documentation/arranjos_e_adquirentes/consulta_de_agenda)
- trava_de_domicilio_bancario (/en/documentation/arranjos_e_adquirentes/trava_de_domicilio_bancario)
- emissao_de_divida (/en/documentation/auxilio_brasil/emissao_de_divida)
- webhook_auxilio_brasil (/en/documentation/auxilio_brasil/webhook_auxilio_brasil)
- Confirm Individual Account Opening (/en/documentation/baas/account/2fa_v2/abrir_conta_pf)
- Legal Entity Account Opening (/en/documentation/baas/account/2fa_v2/abrir_conta_pj)
- Confirm Individual Account Opening (/en/documentation/baas/account/abrir_conta_pf)
- Confirm Legal Entity Account Opening (/en/documentation/baas/account/abrir_conta_pj)
- Request account reservation (/en/documentation/baas/account/account_draft_checking)
- Request account reservation (/en/documentation/baas/account/d4bf7f96-69b0-424b-a9d6-0a1bc79629cd)
- Introduction (/en/documentation/baas/account/introducao)
- Request Individual Account Opening (/en/documentation/baas/account/reservar_conta_pf)
- Legal Entity Account Opening (/en/documentation/baas/account/reservar_conta_pj)
- Account opening webhooks (/en/documentation/baas/account/webhooks)
- Error Catalog - Banking-as-a-Service (/en/documentation/baas/catalogo_de_erros_baas)
- Cancel payment scheduling batch (/en/documentation/baas/cobranca/2fa_v2/agendamento/cancelar_agendamento_em_lote_de_pagamento)
- Confirmar Agendamento de Boleto Bancário (/en/documentation/baas/cobranca/2fa_v2/agendamento/confirmar_agendamento_de_boleto_bancario)
- Confirmação de Pagamento de Fatura de Recolhimento (/en/documentation/baas/cobranca/2fa_v2/agendamento/confirmar_agendamento_de_fatura_de_recolhimento)
- Confirm bank slip batch scheduling (/en/documentation/baas/cobranca/2fa_v2/agendamento/confirmar_agendamento_em_lote_de_boleto_bancario)
- Confirm collection slip batch scheduling (/en/documentation/baas/cobranca/2fa_v2/agendamento/confirmar_agendamento_em_lote_de_fatura_de_recolhimento)
- Get payment scheduling batch (/en/documentation/baas/cobranca/2fa_v2/agendamento/consultar_lote_de_agendamento_de_pagamento)
- List payment scheduling batches (/en/documentation/baas/cobranca/2fa_v2/agendamento/listar_lotes_de_agendamento_de_pagamento)
- Reenviar Token Autenticação de Dois Fatores de Agendamento de Boleto Bancário (/en/documentation/baas/cobranca/2fa_v2/agendamento/reenviar_token_de_agendamento_boleto_bancario)
- Reenviar Token Autenticação de Dois Fatores de Agendamento de Fatura de Recolhimento (/en/documentation/baas/cobranca/2fa_v2/agendamento/reenviar_token_de_agendamento_de_fatura_de_recolhimento)
- Resend token for bank slip batch scheduling (/en/documentation/baas/cobranca/2fa_v2/agendamento/reenviar_token_de_agendamento_em_lote_de_boleto_bancario)
- Resend token for collection slip batch scheduling (/en/documentation/baas/cobranca/2fa_v2/agendamento/reenviar_token_de_agendamento_em_lote_de_fatura_de_recolhimento)
- Solicitar Agendamento de Pagamento de Boleto Bancário com Autenticação de Dois Fatores (2FA) (/en/documentation/baas/cobranca/2fa_v2/agendamento/solicitar_agendamento_de_boleto_bancario)
- Solicitar Agendamento de Pagamento de Facutara de Recolhimento com Autenticação de Dois Fatores (2FA) (/en/documentation/baas/cobranca/2fa_v2/agendamento/solicitar_agendamento_de_pagamento_de_fatura_de_recolhimento)
- Request bank slip batch scheduling with 2FA (/en/documentation/baas/cobranca/2fa_v2/agendamento/solicitar_agendamento_em_lote_de_boleto_bancario)
- Request collection slip batch scheduling with 2FA (/en/documentation/baas/cobranca/2fa_v2/agendamento/solicitar_agendamento_em_lote_de_fatura_de_recolhimento)
- Bank slip payment batch confirmation (/en/documentation/baas/cobranca/2fa_v2/confirmacao_de_lote_de_boleto_bancario)
- Collection slip (utility/tax) payment batch confirmation (/en/documentation/baas/cobranca/2fa_v2/confirmacao_de_lote_de_fatura_de_recolhimento)
- Confirm boleto payment (/en/documentation/baas/cobranca/2fa_v2/confirmacao_de_pagamento_de_boleto_bancario)
- Confirm payment of collection invoice (agreement/tribute) (/en/documentation/baas/cobranca/2fa_v2/confirmacao_de_pagamento_de_fatura_de_recolhimento)
- Introduction to Two-Factor Authentication (/en/documentation/baas/cobranca/2fa_v2/introducao_ao_pagamento_2fa)
- Request boleto payment (2FA) (/en/documentation/baas/cobranca/2fa_v2/solicitacao_de_pagamento_de_boleto_bancario)
- Request payment of collection invoice (agreement/tribute) (/en/documentation/baas/cobranca/2fa_v2/solicitacao_de_pagamento_de_fatura_de_recolhimento)
- Resend payment confirmation token for Boleto (/en/documentation/baas/cobranca/2fa_v2/solicitacao_de_reenvio_de_token_de_boleto_bancario)
- Resend Two-Factor Authentication Token for Collection Invoice Payments (/en/documentation/baas/cobranca/2fa_v2/solicitacao_de_reenvio_de_token_de_fatura_de_recolhimento)
- Resend token for bank slip payment batch confirmation (/en/documentation/baas/cobranca/2fa_v2/solicitacao_de_reenvio_de_token_de_lote_de_boleto_bancario)
- Resend token for collection slip payment batch confirmation (utility/tax) (/en/documentation/baas/cobranca/2fa_v2/solicitacao_de_reenvio_de_token_de_lote_de_fatura_de_recolhimento)
- Request bank slip batch payment with two-factor authentication (/en/documentation/baas/cobranca/2fa_v2/solicitar_pagamento_lote_de_boleto_bancario_com_confirmacao_de_lote)
- Solicitar pagamento em lote de boleto bancário com autenticação de dois fatores (/en/documentation/baas/cobranca/2fa_v2/solicitar_pagamento_lote_de_boleto_bancario_sem_confirmacao_de_lote)
- Request collection slip (utility/tax) batch payment with two-factor authentication (/en/documentation/baas/cobranca/2fa_v2/solicitar_pagamento_lote_de_fatura_de_recolhimento_com_confirmacao_de_lote)
- Solicitar pagamento em lote de fatura de recolhimento (convênio/tributo) com autenticação de dois fatores (/en/documentation/baas/cobranca/2fa_v2/solicitar_pagamento_lote_de_fatura_de_recolhimento_sem_confirmacao_de_lote)
- Token validation for bank slip payment batch (/en/documentation/baas/cobranca/2fa_v2/validacao_de_token_de_lote_de_boleto_bancario)
- Token validation for collection slip payment batch (utility/tax) (/en/documentation/baas/cobranca/2fa_v2/validacao_de_token_de_lote_de_fatura_de_recolhimento)
- Schedule Boleto payment (/en/documentation/baas/cobranca/agendamento/agendar_pagamento_de_boleto_bancario)
- Schedule payment of collection invoice (agreement/tribute) (/en/documentation/baas/cobranca/agendamento/agendar_pagamento_de_fatura_de_recolhimento)
- Cancel schedule (/en/documentation/baas/cobranca/agendamento/cancelar_agendamento)
- Check scheduling (/en/documentation/baas/cobranca/agendamento/consultar_agendamento)
- List schedules (/en/documentation/baas/cobranca/agendamento/listar_agendamentos)
- Request batch scheduling of bank slip payments (/en/documentation/baas/cobranca/agendamento/solicitar_agendamento_em_lote_de_boleto_bancario)
- Request batch scheduling of collection slip payments (/en/documentation/baas/cobranca/agendamento/solicitar_agendamento_em_lote_de_fatura_de_recolhimento)
- Confirmação de lote de pagamento de boleto bancário (/en/documentation/baas/cobranca/confirmacao_de_lote_de_boleto_bancario)
- Confirmação de lote de pagamento de fatura de recolhimento (convênio/tributo) (/en/documentation/baas/cobranca/confirmacao_de_lote_de_fatura_de_recolhimento)
- Consult boleto (/en/documentation/baas/cobranca/consultar_boleto_bancario)
- Consult collection invoice (agreement/tribute) (/en/documentation/baas/cobranca/consultar_fatura_de_recolhimento)
- Consultar lote de pagamento (/en/documentation/baas/cobranca/consultar_lote_de_pagamento)
- Listar lotes de pagamento (/en/documentation/baas/cobranca/listar_lotes_de_pagamento)
- List payments (/en/documentation/baas/cobranca/listar_pagamentos)
- Make payment of Boleto (/en/documentation/baas/cobranca/pagar_boleto_bancario)
- Make payment of collection invoice (agreement/tribute) (/en/documentation/baas/cobranca/pagar_fatura_de_recolhimento)
- Scenario Simulation (/en/documentation/baas/cobranca/simulacao_de_cenarios)
- Solicitar Pagamento em Lote de Boleto Bancário (/en/documentation/baas/cobranca/solicitar_pagamento_lote_de_boleto_bancario_com_confirmacao_de_lote)
- Solicitar Pagamento em Lote de Boleto Bancário (/en/documentation/baas/cobranca/solicitar_pagamento_lote_de_boleto_bancario_sem_confirmacao_de_lote)
- Solicitar Pagamento em Lote de Fatura de Recolhimento (convênio/tributo) (/en/documentation/baas/cobranca/solicitar_pagamento_lote_de_fatura_de_recolhimento_com_confirmacao_de_lote)
- Solicitar Pagamento em Lote de Fatura de Recolhimento (convênio/tributo) (/en/documentation/baas/cobranca/solicitar_pagamento_lote_de_fatura_de_recolhimento_sem_confirmacao_de_lote)
- Webhooks (/en/documentation/baas/cobranca/webhooks)
- Query device (/en/documentation/baas/dispositivo/consultar_dispositivo)
- Approve device creation (/en/documentation/baas/dispositivo/create/aprovar_cadastro_dispositivo)
- Request Device Creation (/en/documentation/baas/dispositivo/create/solicitacao_cadastro_dispositivo)
- Request token resend (/en/documentation/baas/dispositivo/create/solicitacao_reenvio_token)
- Disable device (/en/documentation/baas/dispositivo/delete/desativar_dispositivo)
- Introduction (/en/documentation/baas/dispositivo/introducao)
- Confirm Individual Account Opening (/en/documentation/baas/escrow/abrir_conta_pf)
- Confirm Legal Entity Account Opening (/en/documentation/baas/escrow/abrir_conta_pj)
- Individual Account Opening (/en/documentation/baas/escrow/reservar_conta_pf)
- Business Account Opening (/en/documentation/baas/escrow/reservar_conta_pj)
- Account Opening Webhooks (/en/documentation/baas/escrow/webhooks)
- baas_consulta_de_instituicoes_financeiras (/en/documentation/baas/lista_de_instituicoes_financeiras/baas_consulta_de_instituicoes_financeiras)
- baas_configuracao_de_notificacao (/en/documentation/baas/notificacoes/baas_configuracao_de_notificacao)
- baas_configuracao_template (/en/documentation/baas/notificacoes/baas_configuracao_template)
- baas_introducao (/en/documentation/baas/notificacoes/baas_introducao)
- baas_reenvio_de_notificacoes (/en/documentation/baas/notificacoes/baas_reenvio_de_notificacoes)
- baas_template (/en/documentation/baas/notificacoes/baas_template)
- baas_tipos_de_evento (/en/documentation/baas/notificacoes/baas_tipos_de_evento)
- Remittance file upload (CNAB) (/en/documentation/baas/pagamento_em_lote/envio_de_remessa)
- Introduction to CNAB240 Batch Transaction (/en/documentation/baas/pagamento_em_lote/introducao)
- Query Payment Batch Data by Account (/en/documentation/baas/pix_automatico/conciliacao/consultar_lote_por_conta)
- Query Payment Batches by Requester (/en/documentation/baas/pix_automatico/conciliacao/consultar_lote_requester)
- Payment Listing for an Account (/en/documentation/baas/pix_automatico/conciliacao/listar_payment_orders)
- Payment Order Conciliation Batch Creation Webhook (/en/documentation/baas/pix_automatico/conciliacao/webhooks)
- FAQ - Pix Automático (/en/documentation/baas/pix_automatico/faq)
- Introduction to Automatic Pix (/en/documentation/baas/pix_automatico/introducao)
- Accept payment recurrence (/en/documentation/baas/pix_automatico/movimentacoes/aceitar_recorrencia)
- Cancel recurrence (/en/documentation/baas/pix_automatico/movimentacoes/cancelar_recorrencia)
- Query Recurrence (/en/documentation/baas/pix_automatico/movimentacoes/consultar_recorrencia)
- Create payment recurrence (/en/documentation/baas/pix_automatico/movimentacoes/criar_recorrencia)
- Recurrence Listing (/en/documentation/baas/pix_automatico/movimentacoes/listar_recorrencias)
- Scenario simulation (/en/documentation/baas/pix_automatico/movimentacoes/simulacao)
- Webhooks (/en/documentation/baas/pix_automatico/movimentacoes/webhooks)
- Update Payment Order Value (/en/documentation/baas/pix_automatico/pagamentos/atualizar_payment_order)
- Cancel a Payment Order (/en/documentation/baas/pix_automatico/pagamentos/cancelar_payment_order)
- Query Payment Order (/en/documentation/baas/pix_automatico/pagamentos/consultar_payment_order)
- List Payment Orders by Account (/en/documentation/baas/pix_automatico/pagamentos/listar_account_payment_orders)
- Decode QR Code for Automatic PIX (/en/documentation/baas/pix_automatico/qr_code/decodificar_qr_code)
- Cancel payment recurrence (/en/documentation/baas/pix_automatico/recebedor/cancelar_recorrencia)
- Query data of a recurrence by outgoing_recurrence_key (/en/documentation/baas/pix_automatico/recebedor/consultar_recorrencia)
- Query Automatic Pix Recurrence Data by QRCode (/en/documentation/baas/pix_automatico/recebedor/consultar_recorrencia_receiver)
- Payment Reconciliation and Settlement (/en/documentation/baas/pix_automatico/recebedor/introducao)
- Create a Recurrence (Journey 4) (/en/documentation/baas/pix_automatico/recebedor/journey_four)
- Create a Recurrence (Journey 1) (/en/documentation/baas/pix_automatico/recebedor/journey_one)
- Create a Recurrence (Journey 3) (/en/documentation/baas/pix_automatico/recebedor/journey_three)
- Create a Recurrence (Journey 2) (/en/documentation/baas/pix_automatico/recebedor/journey_two)
- Requester Recurrence Listing (/en/documentation/baas/pix_automatico/recebedor/listar_recorrencias_de_um_requester)
- Account Recurrences Listing (/en/documentation/baas/pix_automatico/recebedor/listar_recorrencias_de_uma_conta)
- Scenario Simulation (/en/documentation/baas/pix_automatico/recebedor/simulacao)
- Automatic Pix Webhooks (/en/documentation/baas/pix_automatico/recebedor/webhooks)
- Approve transaction with Two-Factor Authentication (/en/documentation/baas/pix/2fa_v2/aprovar_transacao_pix_2fa)
- Introduction to Two-Factor Authentication (/en/documentation/baas/pix/2fa_v2/introducao_a_transacao_pix_2fa)
- Request the return of a received Pix (/en/documentation/baas/pix/2fa_v2/solicitacao_de_devolucao_pix)
- Request Token Resend for a Transaction (/en/documentation/baas/pix/2fa_v2/solicitacao_de_reenvio_de_token)
- Request transaction with Two-Factor Authentication (/en/documentation/baas/pix/2fa_v2/solicitacao_de_transacao_pix_2fa)
- aprovacao_de_agendamento_2fa (/en/documentation/baas/pix/agendamento/aprovacao_de_agendamento_2fa)
- aprovacao_de_agendamento_em_lote_2fa (/en/documentation/baas/pix/agendamento/batch/aprovacao_de_agendamento_em_lote_2fa)
- Cancel batch Pix transaction scheduling (/en/documentation/baas/pix/agendamento/batch/cancelamento_de_agendamento_em_lote)
- List Schedules of a Batch Schedule (/en/documentation/baas/pix/agendamento/batch/consulta_de_agendamentos_de_um_lote)
- List Scheduled Batches for an Account (/en/documentation/baas/pix/agendamento/batch/consulta_de_agendamentos_em_lote_de_uma_conta)
- Request batch Pix transaction scheduling (/en/documentation/baas/pix/agendamento/batch/solicitacao_de_agendamento_em_lote)
- solicitacao_de_agendamento_em_lote_2fa (/en/documentation/baas/pix/agendamento/batch/solicitacao_de_agendamento_em_lote_2fa)
- solicitacao_de_reenvio_de_token_para_agendamento_em_lote_2fa (/en/documentation/baas/pix/agendamento/batch/solicitacao_de_reenvio_de_token_para_agendamento_em_lote_2fa)
- Cancel Pix transaction scheduling (/en/documentation/baas/pix/agendamento/cancelamento_de_agendamento)
- Pix transaction scheduling inquiry (/en/documentation/baas/pix/agendamento/consulta_de_agendamento)
- Consult Pix transaction scheduling for an account (/en/documentation/baas/pix/agendamento/consulta_de_agendamentos_de_uma_conta)
- Tabela de Erros para Pix Schedule (/en/documentation/baas/pix/agendamento/erros_de_agendamento)
- Introduction (/en/documentation/baas/pix/agendamento/introducao)
- Introduction to Two-Factor Authentication (/en/documentation/baas/pix/agendamento/introducao_a_agendamento_2fa)
- Request Pix transaction scheduling (/en/documentation/baas/pix/agendamento/solicitacao_de_agendamento)
- solicitacao_de_agendamento_2fa (/en/documentation/baas/pix/agendamento/solicitacao_de_agendamento_2fa)
- solicitacao_de_reenvio_de_token_para_agendamento_2fa (/en/documentation/baas/pix/agendamento/solicitacao_de_reenvio_de_token_para_agendamento_2fa)
- Pix Schedule Completion Webhook (/en/documentation/baas/pix/agendamento/webhook_de_conclusao_de_agendamento)
- Approve batch transaction with Two-Factor Authentication (/en/documentation/baas/pix/batch/aprovar_transacao_em_lote_pix_2fa)
- Introduction to Pix Batch Transaction (/en/documentation/baas/pix/batch/introducao_a_transacao_em_lote_pix)
- List Transactions of a Batch in an Account (/en/documentation/baas/pix/batch/listar_transacoes_de_um_lote_de_transacoes_pix)
- List Batch Transactions of an Account (/en/documentation/baas/pix/batch/listar_transacoes_em_lote_pix_de_uma_conta)
- Request token resend for a batch Pix transaction (/en/documentation/baas/pix/batch/solicitacao_de_reenvio_de_token_para_lote)
- Perform Pix Batch Transaction (/en/documentation/baas/pix/batch/solicitacao_de_transacao_em_lote_pix)
- Perform batch Pix transaction with Two-Factor Authentication (/en/documentation/baas/pix/batch/solicitacao_de_transacao_em_lote_pix_2fa)
- Consult Pix Key Data at the Central Bank (/en/documentation/baas/pix/consultar_chave_pix)
- Consult transfers (/en/documentation/baas/pix/consultar_transferencias)
- Error Table for Pix Transfer (/en/documentation/baas/pix/erros_de_pix)
- List Transfers of an Account (/en/documentation/baas/pix/listar_transferencias)
- Perform Pix Transaction (/en/documentation/baas/pix/realizar_transferencia)
- Request a refund for a received Pix (/en/documentation/baas/pix/solicitar_devolucao)
- Webhooks (/en/documentation/baas/pix/webhooks)
- baas_configurando_webhooks (/en/documentation/baas/primeiros_passos/baas_configurando_webhooks)
- Configurar IP de Integração (/en/documentation/baas/primeiros_passos/baas_configurar_ip_de_integracao)
- baas_inicio (/en/documentation/baas/primeiros_passos/baas_inicio)
- baas_troca_de_chaves (/en/documentation/baas/primeiros_passos/baas_troca_de_chaves)
- baas_endpoints_de_teste (/en/documentation/baas/primeiros_passos/teste_de_autenticacao/baas_endpoints_de_teste)
- baas_possiveis_erros (/en/documentation/baas/primeiros_passos/teste_de_autenticacao/baas_possiveis_erros)
- baas_teste_de_autenticacao_completo (/en/documentation/baas/primeiros_passos/teste_de_autenticacao/baas_teste_de_autenticacao_completo)
- baas_teste_de_autenticacao_v2 (/en/documentation/baas/primeiros_passos/teste_de_autenticacao/baas_teste_de_autenticacao_v2)
- baas_webhook_v2 (/en/documentation/baas/primeiros_passos/teste_de_autenticacao/baas_webhook_v2)
- Approve TED with Two-Factor Authentication (/en/documentation/baas/ted/2fa/aprovar_transacao_ted_2fa)
- Perform TED with Two-Factor Authentication (/en/documentation/baas/ted/2fa/realizar_transferencia_2fa)
- Request Token Resend for a Ted Transaction (/en/documentation/baas/ted/2fa/solicitacao_de_reenvio_de_token)
- Approve Batch Transaction with Two-Factor Authentication (/en/documentation/baas/ted/batch_2fa/aprovar_transacao_em_lote_ted_2fa)
- Request Token Resend for a Batch TED Transaction (/en/documentation/baas/ted/batch_2fa/solicitacao_de_reenvio_de_token_para_lote_ted)
- Perform Batch Ted Transaction with Two-Factor Authentication (/en/documentation/baas/ted/batch_2fa/solicitacao_de_transacao_em_lote_ted_2fa)
- Introduction to TED Batch Transactions (/en/documentation/baas/ted/batch/introducao_a_transacao_em_lote_ted)
- List TED Transactions from a Batch of an Account (/en/documentation/baas/ted/batch/listar_transacoes_de_um_lote_de_transacoes_ted)
- List Batch Transactions from an Account (/en/documentation/baas/ted/batch/listar_transacoes_em_lote_ted_de_uma_conta)
- Perform Ted Transaction in Batch (/en/documentation/baas/ted/batch/solicitacao_de_transacao_em_lote_ted)
- Consult TED (/en/documentation/baas/ted/consultar_ted)
- Tabela de Erros para Ted (/en/documentation/baas/ted/erros_ted)
- List TEDs (/en/documentation/baas/ted/listar_teds)
- Perform a TED transfer (/en/documentation/baas/ted/realizar_transferencia)
- Approve TED Transaction Scheduling with Two-Factor Authentication (/en/documentation/baas/ted/schedule_2fa/aprovacao_de_agendamento_2fa)
- Introduction to Two-Factor Authentication (/en/documentation/baas/ted/schedule_2fa/introducao_a_agendamento_2fa)
- Request TED Transaction Scheduling with Two-Factor Authentication (/en/documentation/baas/ted/schedule_2fa/solicitacao_de_agendamento_2fa)
- Request token resend for a schedule (/en/documentation/baas/ted/schedule_2fa/solicitacao_de_reenvio_de_token_para_agendamento_2fa)
- Approve TED Transaction Batch Schedule with Two-Factor Authentication (/en/documentation/baas/ted/schedule_batch_2fa/aprovacao_de_agendamento_em_lote_2fa)
- Request TED Batch Transaction Scheduling (/en/documentation/baas/ted/schedule_batch_2fa/solicitacao_de_agendamento_em_lote_2fa)
- Request Token Resend for a TED Batch Transaction Schedule (/en/documentation/baas/ted/schedule_batch_2fa/solicitacao_de_reenvio_de_token_para_agendamento_em_lote_2fa)
- Cancel TED Batch Schedule Transaction (/en/documentation/baas/ted/schedule_batch/cancelamento_de_agendamento_em_lote)
- List Schedules from a Schedule Batch (/en/documentation/baas/ted/schedule_batch/listar_agendamentos_de_um_lote)
- List Account Schedule Batches (/en/documentation/baas/ted/schedule_batch/listar_agendamentos_em_lote_de_uma_conta)
- Request TED Transaction Batch Scheduling (/en/documentation/baas/ted/schedule_batch/solicitacao_de_agendamento_em_lote)
- Cancel TED Transaction Schedule (/en/documentation/baas/ted/schedule/cancelamento_de_agendamento)
- Query TED Transaction Schedule (/en/documentation/baas/ted/schedule/consulta_de_agendamento)
- Introduction (/en/documentation/baas/ted/schedule/introducao)
- List TED Transaction Schedules for an Account (/en/documentation/baas/ted/schedule/listar_agendamentos_de_uma_conta)
- Request TED Transaction Scheduling (/en/documentation/baas/ted/schedule/solicitacao_de_agendamento)
- TED Schedule Completion Webhook (/en/documentation/baas/ted/schedule/webhook_de_conclusao_de_agendamento)
- Webhook after TED sending completion (/en/documentation/baas/ted/webhooks)
- baas_consulta_documents (/en/documentation/baas/upload_de_documentos/baas_consulta_documents)
- baas_upload_de_documentos (/en/documentation/baas/upload_de_documentos/)
- Approve Boleto Payment (/en/documentation/boletos/2fa/realizar_pagamento_de_um_boleto)
- Request Token for Boleto Payment (/en/documentation/boletos/2fa/solicitar_token_para_pagamento)
- Create Wallet (/en/documentation/boletos/carteira/criar_carteira)
- Edit wallet (/en/documentation/boletos/carteira/editar_carteira)
- List Account Wallets (/en/documentation/boletos/carteira/listar_carteiras)
- Query temporary file (/en/documentation/boletos/cnab/consulta_por_chave)
- Remittance files (CNAB) - Introduction (/en/documentation/boletos/cnab/introducao)
- List temporary remittance files (/en/documentation/boletos/cnab/listar_arquivos_temporarios)
- List temporary occurrences (/en/documentation/boletos/cnab/listar_ocorrencias_temporarias)
- Upload CNAB file (/en/documentation/boletos/cnab/upload_de_arquivo_remessa)
- Query bank slip by key (/en/documentation/boletos/consulta/consulta_por_chave)
- List Bank Slips (/en/documentation/boletos/consulta/listar_boletos)
- Bank slip wallet inquiry (/en/documentation/boletos/consultar_v1/consulta_de_carteira)
- Query return file (/en/documentation/boletos/consultar_v1/consultar_arquivo_retorno)
- Query bank slip (/en/documentation/boletos/consultar_v1/consultar_boleto)
- Issue PDF (/en/documentation/boletos/consultar_v1/emitir_pdf)
- Francesinha (/en/documentation/boletos/consultar_v1/francesinha)
- List bank slips (/en/documentation/boletos/consultar_v1/listar_boletos)
- Daily position report in Excel (/en/documentation/boletos/consultar_v1/posicao_diaria_excel)
- Daily position report in JSON (/en/documentation/boletos/consultar_v1/posicao_diaria_json)
- Return file reconciliation routine (/en/documentation/boletos/consultar_v1/rotina_de_conciliacao_de_arquivo_retorno)
- Solicitar 2ª via de boleto (/en/documentation/boletos/consultar_v1/segunda_via_de_boleto)
- Emissão de boleto único (instantânea) (/en/documentation/boletos/emissao/emissao_boleto_unico_instantanea)
- Emissão de boleto único (padrão) (/en/documentation/boletos/emissao/emissao_boleto_unico_padrao)
- Emissão de boletos em lote (/en/documentation/boletos/emissao/emissao_em_lote)
- Rebate cancellation (/en/documentation/boletos/instrucoes/abatimento/cancelar_abatimento)
- Create Rebate (/en/documentation/boletos/instrucoes/abatimento/criar_abatimento)
- Write-off (/en/documentation/boletos/instrucoes/baixa)
- Discount (/en/documentation/boletos/instrucoes/desconto)
- Edit (/en/documentation/boletos/instrucoes/edicao)
- Extension (/en/documentation/boletos/instrucoes/extensao)
- Interest (/en/documentation/boletos/instrucoes/juros)
- Query instruction batch (/en/documentation/boletos/instrucoes/lote/consultar_lote_de_instrucoes)
- Create instruction batch (/en/documentation/boletos/instrucoes/lote/criar_lote_de_instrucoes)
- List instruction batches (/en/documentation/boletos/instrucoes/lote/listar_lotes_de_instrucoes)
- Fine (/en/documentation/boletos/instrucoes/multa)
- Partial Payment (/en/documentation/boletos/instrucoes/pagamento_parcial)
- Protest instrument query (/en/documentation/boletos/instrucoes/protesto/consulta_instrumento_de_protesto)
- Query protest by key (/en/documentation/boletos/instrucoes/protesto/consulta_por_chave)
- Protest withdrawal (protest stoppage) (/en/documentation/boletos/instrucoes/protesto/desistencia_de_protesto)
- Protest withdrawal (stay) and bank slip write-off (/en/documentation/boletos/instrucoes/protesto/desistencia_de_protesto_e_baixa_do_boleto)
- Introduction (/en/documentation/boletos/instrucoes/protesto/introducao)
- List protests (/en/documentation/boletos/instrucoes/protesto/listar_protestos)
- Protest request (/en/documentation/boletos/instrucoes/protesto/pedido_de_protesto)
- Protest Removal (/en/documentation/boletos/instrucoes/protesto/sustacao_de_protesto)
- Credit Split Update (/en/documentation/boletos/instrucoes/rateio_de_credito)
- Amount (/en/documentation/boletos/instrucoes/valor)
- Introduction (/en/documentation/boletos/introducao)
- List settlement groups (/en/documentation/boletos/liquidacao/listar_grupos_de_liquidacao)
- List Settlements (/en/documentation/boletos/liquidacao/listar_liquidacoes)
- Scenario simulation (/en/documentation/boletos/liquidacao/simulacao_de_cenarios_de_liquidacao)
- Approve Boleto Payment (/en/documentation/boletos/pagamento/aprovar_pagamento)
- Consultar linha digitável de boleto (/en/documentation/boletos/pagamento/consulta_linha_digitavel)
- Realizar pagamento de boleto (/en/documentation/boletos/pagamento/realizar_pagamento)
- Bank Slip Settlement Account Redirection (/en/documentation/boletos/redirecionamento_de_conta_de_liquidacao)
- List discharge files (/en/documentation/boletos/retorno/listar_arquivos_retorno)
- BolePix Issuance (/en/documentation/boletos/v1/emissao/emissao_de_um_bolepix)
- Boleto issuance via CNAB (/en/documentation/boletos/v1/emissao/emissao_via_cnab)
- Bank slip issuance via JSON (/en/documentation/boletos/v1/emissao/emissao_via_json)
- Send bank slip instruction (/en/documentation/boletos/v1/enviar_instrucao_de_boleto)
- Introduction (/en/documentation/boletos/v1/introducao)
- Bank Slip Webhooks (/en/documentation/boletos/webhooks/boleto)
- Bank slip wallet webhooks (/en/documentation/boletos/webhooks/carteira)
- Settlement webhooks (/en/documentation/boletos/webhooks/liquidacao)
- Return file Webhooks (/en/documentation/boletos/webhooks/retorno)
- Authentication (/en/documentation/caas/account_event/authentication)
- Device Validation Object (/en/documentation/caas/account_event/device_validation)
- HTTP Status Codes (/en/documentation/caas/account_event/http_status)
- Introduction (/en/documentation/caas/account_event/introduction)
- Pre-PIX Transaction (/en/documentation/caas/account_event/pre_pix_transaction)
- Retrieve an Account Event (/en/documentation/caas/account_event/query_registration)
- Standards (/en/documentation/caas/account_event/standards)
- Status Dynamics (/en/documentation/caas/account_event/status_dynamics)
- Account Creation (/en/documentation/caas/account_monitoring/account_registration)
- authentication (/en/documentation/caas/account_monitoring/authentication)
- HTTP Status (/en/documentation/caas/account_monitoring/http_status)
- Introduction (/en/documentation/caas/account_monitoring/introduction)
- Person Creation (/en/documentation/caas/account_monitoring/person_registration)
- Standards (/en/documentation/caas/account_monitoring/standards)
- Webhook (/en/documentation/caas/account_monitoring/webhook)
- Session Creation (/en/documentation/caas/auth_session_manager/auth_session)
- Authentication (/en/documentation/caas/auth_session_manager/authentication)
- HTTP Status (/en/documentation/caas/auth_session_manager/http_status)
- Introduction (/en/documentation/caas/auth_session_manager/introduction)
- Session Management (/en/documentation/caas/auth_session_manager/retrieve_session)
- authentication (/en/documentation/caas/banking/authentication)
- Bankslip (/en/documentation/caas/banking/bankslips)
- Bill Payment (/en/documentation/caas/banking/bill_payments)
- Deposits (/en/documentation/caas/banking/deposits/introduction)
- HTTP Status (/en/documentation/caas/banking/http_status)
- Introduction (/en/documentation/caas/banking/introduction)
- Shared Objects (/en/documentation/caas/banking/objects)
- PIX Dict Operation (/en/documentation/caas/banking/pix_dict_operations)
- PIX Infraction Report (/en/documentation/caas/banking/pix_infraction_reports)
- PIX Transaction (/en/documentation/caas/banking/pix_transactions)
- Standards (/en/documentation/caas/banking/standards)
- Webhook (/en/documentation/caas/banking/webhook)
- Wire Transfers (/en/documentation/caas/banking/wire_transfers)
- Withdrawals (/en/documentation/caas/banking/withdrawals)
- Status HTTP (/en/documentation/caas/car_rental/http_status)
- Imagens (/en/documentation/caas/car_rental/image)
- Introdução (/en/documentation/caas/car_rental/introduction)
- Troca de Mensagens (/en/documentation/caas/car_rental/messages)
- Shared Objects (/en/documentation/caas/car_rental/objects)
- Envio de Resultado Quiz (/en/documentation/caas/car_rental/quiz)
- RentalAgreement-v1 (/en/documentation/caas/car_rental/rental_agreement)
- RentalAgreement-v2 (/en/documentation/caas/car_rental/rental_agreement_v2)
- Reservation-v1 (/en/documentation/caas/car_rental/reservation)
- Reservation-v2 (/en/documentation/caas/car_rental/reservation_v2)
- Padrões (/en/documentation/caas/car_rental/standards)
- Webhook (/en/documentation/caas/car_rental/webhook)
- Cardholder Alerts (/en/documentation/caas/card_issuance/alerts)
- Authentication (/en/documentation/caas/card_issuance/authentication)
- HTTP Status Codes (/en/documentation/caas/card_issuance/http_status)
- Introduction (/en/documentation/caas/card_issuance/introduction)
- Standards (/en/documentation/caas/card_issuance/standards)
- Transaction (/en/documentation/caas/card_issuance/transaction)
- authentication (/en/documentation/caas/card_order/authentication)
- Status HTTP (/en/documentation/caas/card_order/http_status)
- Introduction (/en/documentation/caas/card_order/introduction)
- Objetos (/en/documentation/caas/card_order/objects)
- Order (/en/documentation/caas/card_order/order)
- Padrões (/en/documentation/caas/card_order/standards)
- Webhook (/en/documentation/caas/card_order/webhook)
- authentication (/en/documentation/caas/credit_analysis/authentication)
- Challenge Flow (/en/documentation/caas/credit_analysis/challenge_flow)
- Retrieve a Credit Analysis (/en/documentation/caas/credit_analysis/get_credit_analysis)
- HTTP Status Codes (/en/documentation/caas/credit_analysis/http_status)
- Imagens (/en/documentation/caas/credit_analysis/image)
- Introduction (/en/documentation/caas/credit_analysis/introduction)
- Credit Analysis - Legal Entity (/en/documentation/caas/credit_analysis/legal_person)
- Credit Analysis - Natural Person (/en/documentation/caas/credit_analysis/natural_person)
- Shared Objects (/en/documentation/caas/credit_analysis/objects)
- Credit Information System Data (SCR - BACEN) (/en/documentation/caas/credit_analysis/scr)
- Standards (/en/documentation/caas/credit_analysis/standards)
- Status Dynamics (/en/documentation/caas/credit_analysis/status_dynamics)
- Update the Status of a Credit Analysis (/en/documentation/caas/credit_analysis/update_credit_analysis)
- Webhook (/en/documentation/caas/credit_analysis/webhook)
- Account Object (/en/documentation/caas/device_manager/account)
- Authentication (/en/documentation/caas/device_manager/authentication)
- Device Object (/en/documentation/caas/device_manager/device_registration)
- HTTP Status (/en/documentation/caas/device_manager/http_status)
- Introduction (/en/documentation/caas/device_manager/introduction)
- Person Object (/en/documentation/caas/device_manager/person)
- Consult and Deactivate Entities (/en/documentation/caas/device_manager/query_registration)
- Standards (/en/documentation/caas/device_manager/standards)
- Status Dynamics (/en/documentation/caas/device_manager/status_dynamics)
- Library Compatibility (/en/documentation/caas/device_scan/android/compatibility)
- The DeviceScan Object (/en/documentation/caas/device_scan/android/device_scan_object)
- Implementation (/en/documentation/caas/device_scan/android/example)
- Hybrid Solutions (/en/documentation/caas/device_scan/android/hybrid_solutions)
- Information Gathering (/en/documentation/caas/device_scan/android/information_gathering)
- Introduction (/en/documentation/caas/device_scan/android/introduction)
- Native Integration (/en/documentation/caas/device_scan/android/native_java)
- Permissions (/en/documentation/caas/device_scan/android/permissions)
- Authentication (/en/documentation/caas/device_scan/api/authentication)
- Library Compatibility (/en/documentation/caas/device_scan/flutter/compatibility)
- The QitechDeviceScan object (/en/documentation/caas/device_scan/flutter/device_scan_object)
- Implementation (/en/documentation/caas/device_scan/flutter/example)
- Introduction (/en/documentation/caas/device_scan/flutter/introduction)
- Permissions (/en/documentation/caas/device_scan/flutter/permissions)
- The QITechIosDeviceScan object (/en/documentation/caas/device_scan/ios/device_scan_object)
- Implementation (/en/documentation/caas/device_scan/ios/example)
- Hybrid solutions (/en/documentation/caas/device_scan/ios/hybrid_solutions)
- Information gathering (/en/documentation/caas/device_scan/ios/information_gathering)
- Introduction (/en/documentation/caas/device_scan/ios/introduction)
- Native integration (/en/documentation/caas/device_scan/ios/native_swift)
- Permissions (/en/documentation/caas/device_scan/ios/permissions)
- Desktop Device Scan (/en/documentation/caas/device_scan/web/desktop)
- The DeviceScan object (/en/documentation/caas/device_scan/web/device_scan_object)
- Implementation (/en/documentation/caas/device_scan/web/example)
- Importing the library (/en/documentation/caas/device_scan/web/import)
- Collecting the returns (/en/documentation/caas/device_scan/web/information_gathering)
- Introduction (/en/documentation/caas/device_scan/web/introduction)
- Submitting a Document (/en/documentation/caas/document_analysis/document_submission)
- HTTP Status (/en/documentation/caas/document_analysis/http_status)
- Introduction (/en/documentation/caas/document_analysis/introduction)
- Webhook (/en/documentation/caas/document_analysis/webhook)
- builder (/en/documentation/caas/face_recognition/android/builder)
- Handling Responses (/en/documentation/caas/face_recognition/android/collecting_response)
- 1:1 Validation - Face Match (/en/documentation/caas/face_recognition/android/face_match)
- Hybrid Solutions (/en/documentation/caas/face_recognition/android/hybrid_solutions)
- Introduction (/en/documentation/caas/face_recognition/android/introduction)
- Native Integration (/en/documentation/caas/face_recognition/android/native_java)
- using_sdk (/en/documentation/caas/face_recognition/android/using_sdk)
- Authentication (/en/documentation/caas/face_recognition/api/authentication)
- Face Registration (1:1) (/en/documentation/caas/face_recognition/api/face_registration)
- HTTP Status (/en/documentation/caas/face_recognition/api/http_status)
- Image (/en/documentation/caas/face_recognition/api/image)
- Introduction (/en/documentation/caas/face_recognition/api/introduction)
- Registration (/en/documentation/caas/face_recognition/api/registration)
- Standards (/en/documentation/caas/face_recognition/api/standards)
- Validation (/en/documentation/caas/face_recognition/api/validation)
- Collecting SDK Returns (/en/documentation/caas/face_recognition/ios/collecting_response)
- QITechIosFaceRecognitionConfiguration (/en/documentation/caas/face_recognition/ios/configuration)
- Hybrid Solutions (/en/documentation/caas/face_recognition/ios/hybrid_solutions)
- Introduction (/en/documentation/caas/face_recognition/ios/introduction)
- Importing the SDK (/en/documentation/caas/face_recognition/ios/native_swift)
- necessary_permissions (/en/documentation/caas/face_recognition/ios/necessary_permissions)
- using_sdk (/en/documentation/caas/face_recognition/ios/using_sdk)
- Collecting SDK Returns (/en/documentation/caas/face_recognition/web/collecting_response)
- Implementation (/en/documentation/caas/face_recognition/web/example)
- The QITechWebFaceRecon.WebFaceRecon() constructor (/en/documentation/caas/face_recognition/web/example_zaigwebfacerecon)
- Importing the library (/en/documentation/caas/face_recognition/web/import)
- Introduction (/en/documentation/caas/face_recognition/web/introduction)
- Face Registration and 1:1 Validation (/en/documentation/caas/face_recognition/web/registration_and_validation)
- authentication (/en/documentation/caas/limits/authentication)
- HTTP Status (/en/documentation/caas/limits/http_status)
- Introduction (/en/documentation/caas/limits/introduction)
- New Limit Registration (/en/documentation/caas/limits/limit_registration)
- Creating a Recipient List (/en/documentation/caas/limits/recipient_list)
- Standards (/en/documentation/caas/limits/standards)
- Status Dynamics (/en/documentation/caas/limits/status_dynamics)
- Webhook (/en/documentation/caas/limits/webhook)
- builder (/en/documentation/caas/ocr/android/builder)
- Handling Responses (/en/documentation/caas/ocr/android/collecting_response)
- DocumentRecognitionStep (/en/documentation/caas/ocr/android/document_step)
- Hybrid solutions (/en/documentation/caas/ocr/android/hybrid_solutions)
- DocumentDetectorStep (/en/documentation/caas/ocr/android/implementation_demo)
- Introduction (/en/documentation/caas/ocr/android/introduction)
- Native Integration (/en/documentation/caas/ocr/android/native_java)
- using_sdk (/en/documentation/caas/ocr/android/using_sdk)
- authentication (/en/documentation/caas/ocr/api/authentication)
- HTTP Status (/en/documentation/caas/ocr/api/http_status)
- Introduction (/en/documentation/caas/ocr/api/introduction)
- quality (/en/documentation/caas/ocr/api/quality)
- Sending a Document (/en/documentation/caas/ocr/api/send_image)
- Handling Responses (/en/documentation/caas/ocr/ios/collecting_response)
- QITechIosOcrConfiguration (/en/documentation/caas/ocr/ios/configuration)
- Hybrid solutions (/en/documentation/caas/ocr/ios/hybrid_solutions)
- Introduction (/en/documentation/caas/ocr/ios/introduction)
- Importing the SDK (/en/documentation/caas/ocr/ios/native_swift)
- necessary_permissions (/en/documentation/caas/ocr/ios/necessary_permissions)
- Importing the SDK (/en/documentation/caas/ocr/ios/using_sdk)
- Collecting Returns (/en/documentation/caas/ocr/web/collecting_results)
- The QiTechWebOCR.WebOCR() constructor (/en/documentation/caas/ocr/web/constructor_info)
- Implementation (/en/documentation/caas/ocr/web/example)
- Importing the library (/en/documentation/caas/ocr/web/import)
- The initialize() function (/en/documentation/caas/ocr/web/initialize_info)
- Introduction (/en/documentation/caas/ocr/web/introduction)
- Authentication (/en/documentation/caas/onboarding/authentication)
- HTTP Status Codes (/en/documentation/caas/onboarding/http_status)
- Integration (/en/documentation/caas/onboarding/integrations)
- Introduction (/en/documentation/caas/onboarding/introduction)
- Legal Person Object (/en/documentation/caas/onboarding/legal_person)
- Objeto Natural Person (/en/documentation/caas/onboarding/natural_person)
- Shared Objects (/en/documentation/caas/onboarding/objects)
- Retrieve a Registration (/en/documentation/caas/onboarding/query_registration)
- Standards (/en/documentation/caas/onboarding/standards)
- Status Dynamics (/en/documentation/caas/onboarding/status_dynamics)
- Atualizar um Cadastro (/en/documentation/caas/onboarding/update_registration)
- Webhook (/en/documentation/caas/onboarding/webhook)
- Authorization Request (/en/documentation/cards/autorizacao/)
- Transactions in the QI Account (/en/documentation/cards/autorizacao/balance_transaction)
- Simulate authorization (/en/documentation/cards/autorizacao/simular_autorizacao)
- Creating a physical card (/en/documentation/cards/create/gerar_cartao_fisico)
- Creating a virtual card (/en/documentation/cards/create/gerar_cartao_virtual)
- Introduction (/en/documentation/cards/introducao)
- Retrieve Authorization (/en/documentation/cards/search/buscar_autorizacao)
- List Authorizations (/en/documentation/cards/search/buscar_autorizacoes)
- Search card by key (/en/documentation/cards/search/buscar_cartao_by_key)
- Search PCI data (/en/documentation/cards/search/buscar_dados_pci)
- Track card delivery by key (/en/documentation/cards/search/buscar_entrega_by_key)
- Retrieve PCI Password (/en/documentation/cards/search/buscar_senha)
- List Cards (/en/documentation/cards/search/listar_cartoes)
- Activate physical card (/en/documentation/cards/status/ativar_cartao)
- Update status (/en/documentation/cards/status/update_status_cartao)
- Contactless Configuration (/en/documentation/cards/update/contactless_cartao)
- Update password (/en/documentation/cards/update/password_cartao)
- Update delivery address (/en/documentation/cards/update/update_delivery_address)
- Contactless configuration (/en/documentation/cartao_pos_pago/cartao/atualizar/atualizar_contactless)
- Update delivery address (/en/documentation/cartao_pos_pago/cartao/atualizar/atualizar_endereco_entrega)
- Change physical card password (/en/documentation/cartao_pos_pago/cartao/atualizar/atualizar_senha)
- Scenario simulation (/en/documentation/cartao_pos_pago/cartao/atualizar/simulacao_de_cenarios)
- Search card by key (/en/documentation/cartao_pos_pago/cartao/busca/buscar_cartao_por_chave)
- Search delivery by card key (/en/documentation/cartao_pos_pago/cartao/busca/buscar_dados_entrega_por_chave)
- Retrieve PCI data (/en/documentation/cartao_pos_pago/cartao/busca/buscar_dados_pci)
- Fetch PCI Password (/en/documentation/cartao_pos_pago/cartao/busca/buscar_senha)
- Activate physical card (/en/documentation/cartao_pos_pago/cartao/status/ativar_cartao)
- Update status (/en/documentation/cartao_pos_pago/cartao/status/atualizar_status_cartao)
- Wallet Limit Update (/en/documentation/cartao_pos_pago/faturas/carteira/alteracao_de_limite)
- Search Wallet Entry by Key (/en/documentation/cartao_pos_pago/faturas/carteira/consulta_entrada_por_chave)
- Wallet Query by Key (/en/documentation/cartao_pos_pago/faturas/carteira/consulta_por_chave)
- Wallet Creation (/en/documentation/cartao_pos_pago/faturas/carteira/criacao_de_carteira)
- List Wallets (/en/documentation/cartao_pos_pago/faturas/carteira/listar_carteiras)
- List Wallet Entries (/en/documentation/cartao_pos_pago/faturas/carteira/listar_entradas_da_carteira)
- Search Wallet Bank Slip (/en/documentation/cartao_pos_pago/faturas/fatura/boleto_de_pagamento_da_fatura)
- Search Invoice by Key (/en/documentation/cartao_pos_pago/faturas/fatura/consulta_por_chave)
- List Invoices (/en/documentation/cartao_pos_pago/faturas/fatura/listar_faturas)
- Scenario Simulation - Invoice Closing and Expiration (/en/documentation/cartao_pos_pago/faturas/fatura/simulacao_de_cenarios)
- Payment Instrument Limit Change (/en/documentation/cartao_pos_pago/faturas/instrumento_de_pagamento/alteracao_de_limite)
- Payment Instrument Cancellation (/en/documentation/cartao_pos_pago/faturas/instrumento_de_pagamento/cancelamento_de_instrumento_de_pagamento)
- Search Payment Instrument Entry by Key (/en/documentation/cartao_pos_pago/faturas/instrumento_de_pagamento/consulta_entrada_por_chave)
- Payment Instrument Creation (/en/documentation/cartao_pos_pago/faturas/instrumento_de_pagamento/criacao_de_instrumento_de_pagamento)
- List Payment Instrument Entries (/en/documentation/cartao_pos_pago/faturas/instrumento_de_pagamento/listar_entradas_do_instrumento_de_pagamento)
- List Payment Instruments (/en/documentation/cartao_pos_pago/faturas/instrumento_de_pagamento/listar_instrumentos_de_pagamento)
- Scenario simulation (/en/documentation/cartao_pos_pago/faturas/instrumento_de_pagamento/simulacao_de_cenarios)
- Wallet Webhooks (/en/documentation/cartao_pos_pago/faturas/webhooks/carteira)
- Wallet Entry Webhooks (/en/documentation/cartao_pos_pago/faturas/webhooks/entrada_da_carteira)
- Payment Instrument Entry Webhooks (/en/documentation/cartao_pos_pago/faturas/webhooks/entrada_do_instrumento_de_pagamento)
- Invoice Webhooks (/en/documentation/cartao_pos_pago/faturas/webhooks/fatura)
- Invoice Payment Webhooks (/en/documentation/cartao_pos_pago/faturas/webhooks/pagamento_da_fatura)
- Introduction (/en/documentation/cartao_pos_pago/introducao)
- Manual BaaS - Conta Digital (/en/documentation/casos_de_uso/manual_baas)
- Manual BaaS - Serviço (/en/documentation/casos_de_uso/manual_baas_servico)
- Environments (/en/documentation/certifiqi/ambientes)
- ZIP Files (/en/documentation/certifiqi/arquivo_zip)
- Automatic Signature (/en/documentation/certifiqi/assinatura_automatica)
- Access Profile Creation (/en/documentation/certifiqi/cadastro)
- Cancel a Batch Group (/en/documentation/certifiqi/cancelar_batch_group_de_assinatura)
- GET Batch Group (/en/documentation/certifiqi/consultar_evento)
- GET URL (/en/documentation/certifiqi/consultar_url)
- Create Batch Group (/en/documentation/certifiqi/criar_batch_group)
- Create Batch Group to Notify Fromtis (/en/documentation/certifiqi/criar_batch_group_fromtis)
- Send to signature (/en/documentation/certifiqi/enviar_para_assinatura)
- Structure (/en/documentation/certifiqi/estrutura)
- Authentication Method (/en/documentation/certifiqi/forma_de_autenticacao)
- Start (/en/documentation/certifiqi/inicio)
- User Permissions (/en/documentation/certifiqi/permissoes)
- CNAB Document Upload (/en/documentation/certifiqi/upload_documentos_cnab_assincrono)
- PDF Document Upload (/en/documentation/certifiqi/upload_documentos_pdf)
- Webhook (/en/documentation/certifiqi/webhook)
- Assignment Creation (/en/documentation/cessoes/criacao_de_cessao_0eaeffec-ee95-4cb1-a266-bcb52f23237d)
- Abertura de conta escrow PF (/en/documentation/contas/abertura_de_conta_escrow/abertura_de_conta_escrow_pf)
- Abertura de conta escrow PJ (/en/documentation/contas/abertura_de_conta_escrow/abertura_de_conta_escrow_pj)
- Introdução (/en/documentation/contas/abertura_de_conta_escrow/introducao)
- Abertura de conta PF (/en/documentation/contas/abertura_de_conta/abertura_de_conta_pf)
- Abertura de conta PJ (/en/documentation/contas/abertura_de_conta/abertura_de_conta_pj)
- Free Movement Account Draft - Legal Entity (/en/documentation/contas/abertura_de_conta/draft_checking_legal_person)
- fluxo_de_abertura_de_conta (/en/documentation/contas/abertura_de_conta/fluxo_de_abertura_de_conta)
- Introdução (/en/documentation/contas/abertura_de_conta/introducao)
- Account Opening Webhooks (/en/documentation/contas/abertura_de_conta/webhooks_contas)
- Issue Bank Relationship Letter (/en/documentation/contas/carta_bancaria)
- Issue Audit Confirmation Letter (/en/documentation/contas/carta_circularizacao)
- Query fees (/en/documentation/contas/consulta_de_tarifas)
- Query account (/en/documentation/contas/consultar_conta)
- List accounts (/en/documentation/contas/consultar_contas)
- Query account request details (/en/documentation/contas/consultar_detalhes_pedido_conta)
- Close a account (/en/documentation/contas/encerramento_de_conta)
- Fee statement (/en/documentation/contas/extrato_de_tarifas)
- Fee management (/en/documentation/contas/gestao_de_tarifas)
- Income report (/en/documentation/contas/informe_rendimentos)
- Query Account Blocks (/en/documentation/contas/ordens_de_bloqueio)
- Scenario simulation (/en/documentation/contas/simulacao)
- Create destination account for escrow (/en/documentation/d88ff174-100d-4b55-80b7-86e11f508400)
- Register account in DDA (/en/documentation/dda/cadastro_dda)
- Remover DDA account (/en/documentation/dda/cancelamento_dda)
- Consult Account Registered in DDA (/en/documentation/dda/consultar_dados_conta)
- Errors Returned in the API (/en/documentation/dda/erros)
- Introduction (/en/documentation/dda/introducao)
- List Accounts Registered in DDA (/en/documentation/dda/lista_contas_cadastradas)
- List Boletos of Account Registered in DDA (bank slip notification) with filters (/en/documentation/dda/lista_notificacoes_de_boletos)
- Recuperação de termo de aceite e cancelamento de cadastro no DDA (/en/documentation/dda/recuperacao_termo)
- Scenario Simulation of Boleto Registration and Modification (/en/documentation/dda/simulacoes)
- Webhook DDA Bank Slips (/en/documentation/dda/webhooks)
- acg1 (/en/documentation/documentacoes ocultas/agc1/acg1)
- introducao (/en/documentation/documentacoes ocultas/agc1/introducao)
- Permissão (Geral): (/en/documentation/documentacoes ocultas/perfis_de_acesso)
- cancelamento_de_solicitacao.md (/en/documentation/documentacoes ocultas/scr/cancelamento_de_solicitacao.md)
- consultar_solicitacao (/en/documentation/documentacoes ocultas/scr/consultar_solicitacao)
- consultar_solicitacoes (/en/documentation/documentacoes ocultas/scr/consultar_solicitacoes)
- introducao (/en/documentation/documentacoes ocultas/scr/introducao)
- refazer_consulta (/en/documentation/documentacoes ocultas/scr/refazer_consulta)
- solicitacao_de_consulta (/en/documentation/documentacoes ocultas/scr/solicitacao_de_consulta)
- webhook (/en/documentation/documentacoes ocultas/scr/webhook)
- Update credit debt purchaser (/en/documentation/emissao_de_divida/atualizar_cessionario_047911bb-d3fb-48fe-88fd-aebdeb7e11ad)
- Update Related Party Information for the Credit Contract (/en/documentation/emissao_de_divida/atualizar_dados_da_parte_relacionada)
- Authorize disbursement (/en/documentation/emissao_de_divida/autorizar_desembolso)
- Cancel debt before disbursement. (/en/documentation/emissao_de_divida/cancelamento/cancelar_divida_antes_de_desembolsar)
- Cancelar permanentemente (/en/documentation/emissao_de_divida/cancelamento/cancelar_permanentemente)
- Debt cancelation within 7 days of disbursement (/en/documentation/emissao_de_divida/cancelamento/desistencia/cancelamento_de_divida_em_ate_sete_dias_apos_o_desembolso)
- Query reversal pix qr code (/en/documentation/emissao_de_divida/cancelamento/desistencia/consulta_de_pix_qr_code_de_devolucao)
- Introduction (/en/documentation/emissao_de_divida/cancelamento/desistencia/introducao)
- Introduction (/en/documentation/emissao_de_divida/cancelamento/introducao)
- Error Catalog - Lending-as-a-Service (/en/documentation/emissao_de_divida/catalogo_de_erros_laas)
- Set disbursement date (/en/documentation/emissao_de_divida/configurar_data_de_desembolso)
- Debt inquiry (/en/documentation/emissao_de_divida/consulta_de_divida)
- Debt Query by Contract Number (/en/documentation/emissao_de_divida/consulta_por_contract_number)
- Debt Query by Credit Operation Key (/en/documentation/emissao_de_divida/consulta_por_credit_operation_key)
- Debt Inquiry by Requester Identifier Key (/en/documentation/emissao_de_divida/consulta_por_requester_identifier_key)
- Operation Disbursement (/en/documentation/emissao_de_divida/desembolso_da_operacao)
- Personal Debt Issuance (/en/documentation/emissao_de_divida/emissao/emissao_de_divida_pf)
- Issuance of Corporate debt (/en/documentation/emissao_de_divida/emissao/emissao_de_divida_pj)
- Example of disbursement payloads (/en/documentation/emissao_de_divida/emissao/exemplo_payloads_desembolso)
- Alternative Signatures (/en/documentation/emissao_de_divida/formalizacao/assinatura_de_contrato)
- Contract signing with OPT-IN (/en/documentation/emissao_de_divida/formalizacao/assinatura_opt_in)
- Sending the signed PDF (/en/documentation/emissao_de_divida/formalizacao/assinatura_pdf)
- Selfie Signatures (/en/documentation/emissao_de_divida/formalizacao/assinatura_selfie)
- Debt Formalization (/en/documentation/emissao_de_divida/formalizacao/introducao_formalizacao)
- Generate Bank Slip or PIX for an Installment (/en/documentation/emissao_de_divida/gerar_boleto_ou_pix_para_uma_parcela)
- Introduction (/en/documentation/emissao_de_divida/introducao)
- Banking correspondant monitoring (/en/documentation/emissao_de_divida/mcb)
- Metadata (/en/documentation/emissao_de_divida/metadata)
- Do not disturb (/en/documentation/emissao_de_divida/nao_me_perturbe)
- Introduction (/en/documentation/emissao_de_divida/reapresentacao_de_conta_bancaria)
- Resend related party documents for the credit contract (/en/documentation/emissao_de_divida/reenviar_documentos_das_partes_relacionadas)
- Reprocess post-disbursement action (/en/documentation/emissao_de_divida/reprocessar_acao_pos_desembolso)
- Recalculate credit contract (/en/documentation/emissao_de_divida/reprocessar_contrato)
- Editing disbursement bank account (/en/documentation/emissao_de_divida/reprocessar_multiplas_datas/trocar_conta)
- Editing disbursement date (/en/documentation/emissao_de_divida/reprocessar_multiplas_datas/trocar_data)
- Seguro (/en/documentation/emissao_de_divida/seguro)
- Legacy debt simulation (/en/documentation/emissao_de_divida/simulacao_de_divida_antigo)
- New debt simulation (/en/documentation/emissao_de_divida/simulacao_de_divida_novo)
- Error simulation in Sandbox (/en/documentation/emissao_de_divida/simulando_erros)
- Possible debt statuses (/en/documentation/emissao_de_divida/status_de_uma_divida)
- Error Catalog (/en/documentation/erros/catalogo_de_erros)
- Amortização Extraordinária (/en/documentation/escrituracao/amortizacao-extraordinaria/conceito)
- Consultar Amortização Extraordinária (/en/documentation/escrituracao/amortizacao-extraordinaria/endpoints/consultar-amortizacao)
- Criar Amortização Extraordinária (/en/documentation/escrituracao/amortizacao-extraordinaria/endpoints/criar-amortizacao)
- Simulate the Present Value of an Extraordinary Amortization (/en/documentation/escrituracao/amortizacao-extraordinaria/endpoints/simular-valor-presente)
- Exemplos — Amortização Extraordinária (/en/documentation/escrituracao/amortizacao-extraordinaria/exemplos)
- Amortização com Recompra (/en/documentation/escrituracao/amortizacao-extraordinaria/recompra-de-operacao)
- Regras de Negócio — Amortização Extraordinária (/en/documentation/escrituracao/amortizacao-extraordinaria/regras-de-negocio)
- Error Catalog (/en/documentation/escrituracao/catalogo-erros/catalogo-erros)
- Webhook Configuration (/en/documentation/escrituracao/configuracao-webhooks)
- Register Underlying Asset (Lastro) (/en/documentation/escrituracao/emissao-cr/cadastro-lastro)
- Register CR Operation (/en/documentation/escrituracao/emissao-cr/cadastro-operacao)
- Send Document (/en/documentation/escrituracao/emissao-cr/envio-documento)
- Send Operation External Document (/en/documentation/escrituracao/emissao-cr/envio-documento-externo)
- Register Underlying Asset (Lastro) (/en/documentation/escrituracao/emissao-cra/cadastro-lastro)
- Register CRA Operation (/en/documentation/escrituracao/emissao-cra/cadastro-operacao)
- Send Document (/en/documentation/escrituracao/emissao-cra/envio-documento)
- Send Operation External Document (/en/documentation/escrituracao/emissao-cra/envio-documento-externo)
- Register Underlying Asset (Lastro) (/en/documentation/escrituracao/emissao-cri/cadastro-lastro)
- Register CRI Operation (/en/documentation/escrituracao/emissao-cri/cadastro-operacao)
- Send Document (/en/documentation/escrituracao/emissao-cri/envio-documento)
- Send Operation External Document (/en/documentation/escrituracao/emissao-cri/envio-documento-externo)
- Operation disbursement account update. (/en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/atualizar-conta-desembolso)
- Financial Data Update in Operation (/en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/atualizar-dados-financeiros)
- Updating investor data in the Operation (/en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/atualizar-investidores)
- Signature Method Update in Operation (/en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/atualizar-metodo-assinatura)
- Sending Collateral in an Operation (/en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-garantias/cadastro-garantia)
- Collateral Removal from Operation (/en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-garantias/remover-garantia)
- Document Upload (/en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-garantias/upload-documento)
- Operation Metadata Registration and Removal (/en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-metadata-identificacao)
- Related Party Representative Document Upload and Removal (/en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-parte-relacionada/adicionar-documento)
- Related Party Representative Signer Group Upload and Removal (/en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-parte-relacionada/adicionar-grupo-assinantes)
- Specific Document Related Party Registration and Removal (/en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-parte-relacionada/adicionar-parte-relacionada-em-documento)
- Related Party Registration and Removal (/en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-parte-relacionada/cadastrar-parte-relacionada)
- Commercial Paper Operation Registration (/en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/criar-operacao)
- Campos Extras (Extra Fields) (/en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/extra-fields)
- Cancel Operation (/en/documentation/escrituracao/emissao-de-notas/cancelar-operacao)
- Query Signed Contract Link via QI SIGN of the Operation (/en/documentation/escrituracao/emissao-de-notas/consulta-link-assinado-qisign)
- Query Signature Links via QI SIGN for Operation (/en/documentation/escrituracao/emissao-de-notas/consulta-link-assinatura-qisign)
- Operation Query by Key (/en/documentation/escrituracao/emissao-de-notas/consulta/consulta-por-chave)
- Operation Query by Filters (/en/documentation/escrituracao/emissao-de-notas/consulta/consulta-por-filtros)
- Next Issue Number Query by Issuer (/en/documentation/escrituracao/emissao-de-notas/consulta/consulta-proximo-numero-emissao)
- Send Signed Approval Minutes (/en/documentation/escrituracao/emissao-de-notas/envio-ata-aprovacao)
- Send Signed Operation Documents (/en/documentation/escrituracao/emissao-de-notas/envio-contratos-assinados)
- Send Operation for Analysis (/en/documentation/escrituracao/emissao-de-notas/envio-para-analise)
- Send Operation for Signature (/en/documentation/escrituracao/emissao-de-notas/envio-para-assinatura)
- Change Adhesion Term Template (/en/documentation/escrituracao/emissao-de-notas/geracao-minutas/alterar-template-ta)
- Change Commercial Paper Template (/en/documentation/escrituracao/emissao-de-notas/geracao-minutas/alterar-template-tc)
- Available templates query (/en/documentation/escrituracao/emissao-de-notas/geracao-minutas/consulta-minutas-disponiveis)
- Preview Adhesion Term (/en/documentation/escrituracao/emissao-de-notas/geracao-minutas/gerar-minuta-adesao)
- Preview Commercial Paper Term (/en/documentation/escrituracao/emissao-de-notas/geracao-minutas/gerar-minuta-contrato)
- Introduction to Commercial Paper Issuance (/en/documentation/escrituracao/emissao-de-notas/inicio)
- Financial Conditions Simulation (/en/documentation/escrituracao/emissao-de-notas/simulacao)
- Register Debenture Operation (/en/documentation/escrituracao/emissao-debentures/cadastro-operacao)
- Send Document (/en/documentation/escrituracao/emissao-debentures/envio-documento)
- Send Operation External Document (/en/documentation/escrituracao/emissao-debentures/envio-documento-externo)
- Send Operation Collateral (/en/documentation/escrituracao/emissao-debentures/envio-garantia)
- Issuer Registration Update (/en/documentation/escrituracao/homologacao-emissor/alteracao-cadastro/)
- Issuer Signer Groups Registration (/en/documentation/escrituracao/homologacao-emissor/cadastro/assinantes-emissor)
- Issuer Signer Groups Removal (/en/documentation/escrituracao/homologacao-emissor/cadastro/assinantes-emissor-remocao)
- Issuer Registration (/en/documentation/escrituracao/homologacao-emissor/cadastro/cadastro-basico)
- Issuer Bank Account Registration (/en/documentation/escrituracao/homologacao-emissor/cadastro/conta-bancaria-emissor)
- Setting the Issuer's Primary Bank Account (/en/documentation/escrituracao/homologacao-emissor/cadastro/conta-bancaria-emissor-principal)
- Issuer Bank Account Removal (/en/documentation/escrituracao/homologacao-emissor/cadastro/conta-bancaria-emissor-remocao)
- Issuer Documents Submission (/en/documentation/escrituracao/homologacao-emissor/cadastro/documentos-emissor)
- Issuer Documents Removal (/en/documentation/escrituracao/homologacao-emissor/cadastro/documentos-emissor-remocao)
- Issuer Representative Document Upload (/en/documentation/escrituracao/homologacao-emissor/cadastro/documentos-representantes-emissor)
- Issuer Representative Document Removal (/en/documentation/escrituracao/homologacao-emissor/cadastro/documentos-representantes-emissor-remocao)
- Issuer Contact Information Registration (/en/documentation/escrituracao/homologacao-emissor/cadastro/informacao-contato-emissor)
- Setting the Issuer's Primary Contact (/en/documentation/escrituracao/homologacao-emissor/cadastro/informacao-contato-emissor-principal)
- Issuer Contact Information Removal (/en/documentation/escrituracao/homologacao-emissor/cadastro/informacao-contato-emissor-remocao)
- Issuer Representatives Registration (/en/documentation/escrituracao/homologacao-emissor/cadastro/representantes-emissor)
- Issuer Representative Removal (/en/documentation/escrituracao/homologacao-emissor/cadastro/representantes-emissor-remocao)
- Get Issuer (/en/documentation/escrituracao/homologacao-emissor/consulta/consulta-emissor-chave)
- Issuer Query by Filters (/en/documentation/escrituracao/homologacao-emissor/consulta/consulta-emissor-filtro)
- Issuer Analysis Submission (/en/documentation/escrituracao/homologacao-emissor/envio-analise/)
- Introduction (/en/documentation/escrituracao/homologacao-emissor/inicio)
- Issuer Data Access Request (/en/documentation/escrituracao/homologacao-emissor/solicitacao-acesso)
- Investor Registration Update (/en/documentation/escrituracao/homologacao-investidor/alteracao-cadastro/)
- Investor Signer Groups Registration (/en/documentation/escrituracao/homologacao-investidor/cadastro/assinantes-investidor)
- Investor Signer Groups Removal (/en/documentation/escrituracao/homologacao-investidor/cadastro/assinantes-investidor-remocao)
- Investor Registration (/en/documentation/escrituracao/homologacao-investidor/cadastro/cadastro-basico)
- Investor Bank Account Registration (/en/documentation/escrituracao/homologacao-investidor/cadastro/conta-bancaria-investidor)
- Investor Bank Account Removal (/en/documentation/escrituracao/homologacao-investidor/cadastro/conta-bancaria-investidor-remocao)
- Investor Documents Submission (/en/documentation/escrituracao/homologacao-investidor/cadastro/documentos-investidor)
- Investor Documents Removal (/en/documentation/escrituracao/homologacao-investidor/cadastro/documentos-investidor-remocao)
- Investor Representative Documents Submission (/en/documentation/escrituracao/homologacao-investidor/cadastro/documentos-representantes-investidor)
- Investor Representative Documents Removal (/en/documentation/escrituracao/homologacao-investidor/cadastro/documentos-representantes-investidor-remocao)
- Investor Contact Information Registration (/en/documentation/escrituracao/homologacao-investidor/cadastro/informacao-contato-investidor)
- Investor Contact Information Removal (/en/documentation/escrituracao/homologacao-investidor/cadastro/informacao-contato-investidor-remocao)
- Investor Representatives Registration (/en/documentation/escrituracao/homologacao-investidor/cadastro/representantes-investidor)
- Investor Representative Removal (/en/documentation/escrituracao/homologacao-investidor/cadastro/representantes-investidor-remocao)
- Get Investor (/en/documentation/escrituracao/homologacao-investidor/consulta/consulta-investidor-chave)
- Investor Query by Filters (/en/documentation/escrituracao/homologacao-investidor/consulta/consulta-investidor-filtro)
- Investor Analysis Submission (/en/documentation/escrituracao/homologacao-investidor/envio-analise/)
- Introduction (/en/documentation/escrituracao/homologacao-investidor/inicio)
- **Investor Data Access Request** (/en/documentation/escrituracao/homologacao-investidor/solicitacao-acesso)
- Get Transaction Receipt (/en/documentation/escrituracao/integralizacao-cotas/consulta-comprovante-transacao)
- Consulta de Conta de Liquidação (/en/documentation/escrituracao/integralizacao-cotas/consulta-conta-liquidacao)
- Get Integralization by Key (/en/documentation/escrituracao/integralizacao-cotas/consulta-processo-integralizacao)
- Get Integralization Transactions (/en/documentation/escrituracao/integralizacao-cotas/consulta-transacoes-integralizacao)
- Introduction to Shares Integralization (/en/documentation/escrituracao/integralizacao-cotas/inicio)
- Subscription Registration (/en/documentation/escrituracao/integralizacao-cotas/subscricao-cotas/cadastro-subscricao)
- Cancel Subscription (/en/documentation/escrituracao/integralizacao-cotas/subscricao-cotas/cancelar-subscricao)
- Subscription Payment Confirmation or Rejection (/en/documentation/escrituracao/integralizacao-cotas/subscricao-cotas/confirmacao-pagamento)
- Get Subscription (/en/documentation/escrituracao/integralizacao-cotas/subscricao-cotas/consulta-subscricao-cotas)
- Subscription Payment Registration (/en/documentation/escrituracao/integralizacao-cotas/subscricao-cotas/registro-de-pagamento)
- Receiving Webhooks (/en/documentation/escrituracao/introducao/autenticacao_webhooks)
- Commercial Paper Bookkeeping (/en/documentation/escrituracao/introducao/)
- Test endpoints (/en/documentation/escrituracao/introducao/teste-autenticacao/endpoints_de_teste)
- Authentication test (/en/documentation/escrituracao/introducao/teste-autenticacao/teste_de_autenticacao)
- Keys Exchange (/en/documentation/escrituracao/introducao/troca_de_chaves)
- Asset Query (/en/documentation/escrituracao/operacoes-ativas/consulta-security)
- Investor Position (/en/documentation/escrituracao/operacoes-ativas/posicao-investidor)
- Commercial Notes Bookkeeping Integration Guide (/en/documentation/escrituracao/roteiro-integracao/roteiro-integracao-padrao)
- Roteiro de Integração de escrituração de notas comerciais (/en/documentation/escrituracao/roteiro-integracao/roteiro-integracao-padrao-external)
- Roteiro de Integração de escrituração de notas comerciais + Boletos + Sistema de baixas (/en/documentation/escrituracao/roteiro-integracao/roteiro-integracao-securities-baas-dtvm)
- Webhooks (/en/documentation/escrituracao/webhooks-escrituracao)
- Aprovação de Reserva (/en/documentation/garantia_veicular/aprovacao_reserva)
- Cancellation (/en/documentation/garantia_veicular/cancelamento)
- Queries (/en/documentation/garantia_veicular/consultas)
- Status Map and Stages (/en/documentation/garantia_veicular/mapa_de_status)
- Simulation and Issuance (/en/documentation/garantia_veicular/simulacao_e_emissao)
- Mocks (Sandbox) (/en/documentation/garantia_veicular/testes_homologacao)
- Webhooks — Vehicle Collateral (/en/documentation/garantia_veicular/webhooks)
- Person contact change (/en/documentation/gestao_de_usuarios/alteracao_de_contato_de_pessoa)
- Linkage contact change (/en/documentation/gestao_de_usuarios/alteracao_de_contato_de_vinculo)
- Edit a person's data (/en/documentation/gestao_de_usuarios/alteracao_de_dados_pessoais)
- Edit a person's address (/en/documentation/gestao_de_usuarios/alteracao_de_endereco)
- Check parties related to an account (/en/documentation/gestao_de_usuarios/consulta_partes_relacionadas)
- Person creation (/en/documentation/gestao_de_usuarios/criacao_de_pessoa)
- Linkage exclusion (/en/documentation/gestao_de_usuarios/exclusao_de_vinculo)
- Linkage inclusion (/en/documentation/gestao_de_usuarios/inclusao_de_vinculo)
- Introduction (/en/documentation/gestao_de_usuarios/tfa_introducao)
- Consulta Offline de Saldo (/en/documentation/guides/INSS/inquiries/offline-balance-request)
- INSS Payroll Loans (/en/documentation/guides/INSS/intro)
- Mocks (Sandbox) (/en/documentation/guides/INSS/mocks-sandbox)
- Manual INSS - Crédito Novo ou Refinanciamento (/en/documentation/guides/INSS/new-credit-and-refinancing/end-to-end)
- Recalculate Credit Operation (/en/documentation/guides/INSS/new-credit-and-refinancing/recalculate)
- Anuência (pending confirmation) (/en/documentation/guides/INSS/pending_confirmation)
- Alterando o Cessionário (/en/documentation/guides/INSS/portability+refinancing/alterando-cessionario)
- Consultas e Enumeradores (/en/documentation/guides/INSS/portability+refinancing/consultas-e-enumeradores)
- Manual Portabilidade + Refinanciamento do INSS (/en/documentation/guides/INSS/portability+refinancing/end-to-end)
- Máquinas de Status (/en/documentation/guides/INSS/portability+refinancing/maquinas-de-status)
- Recálculo e Reformalização do Refinanciamento (/en/documentation/guides/INSS/portability+refinancing/reformalization)
- Fura-fila (priority request) (/en/documentation/guides/INSS/reservations/priority-request)
- Fila prioritária (/en/documentation/guides/INSS/reservations/priority-reservation)
- Assinatura em grupo (INSS) (/en/documentation/guides/INSS/signatures/batch-group-signature)
- Assinatura em lote (INSS) (/en/documentation/guides/INSS/signatures/batch-signature)
- Document Insertion (/en/documentation/iaas/aditamento_recebiveis/envio_documento)
- Introduction (/en/documentation/iaas/aditamento_recebiveis/inicio)
- Amendment Request Creation (/en/documentation/iaas/aditamento_recebiveis/pedido_aditamento_contrato)
- Public Securities Recorder (/en/documentation/iaas/boletador/boletador_titulos_publicos)
- Public Securities Listing (/en/documentation/iaas/boletador/listagem_titulos_publicos)
- Introduction (/en/documentation/iaas/boletos/inicio)
- Instruções de Boleto (/en/documentation/iaas/boletos/instrucoes_boleto)
- CNAB Files Retrieval (/en/documentation/iaas/boletos/recuperar_arquivo_retorno)
- Recuperação de Boleto e Segunda via (/en/documentation/iaas/boletos/recuperar_boleto)
- Bankslip Retrieval (/en/documentation/iaas/boletos/recuperar_boletos)
- Bankslip Profiles Retrieval (/en/documentation/iaas/boletos/recuperar_carteiras_cobranca)
- Bankslip Configurations Retrieval (/en/documentation/iaas/boletos/recuperar_configuracoes_boleto)
- Webhooks (/en/documentation/iaas/boletos/webhook)
- Portfolio - Approval (/en/documentation/iaas/composicao_carteira/aprovar_carteira)
- Wallet - Download Wallet (/en/documentation/iaas/composicao_carteira/baixar_carteira)
- Introduction (/en/documentation/iaas/composicao_carteira/inicio)
- Portfolio - Portfolio Recovery (/en/documentation/iaas/composicao_carteira/recuperar_carteira)
- Financial Applications Query by Fund Class (/en/documentation/iaas/cotas_de_fundo/consulta_paginada_aplicacoes_financeiras)
- Fund Class Redemption Request Query (/en/documentation/iaas/cotas_de_fundo/consulta_paginada_resgates)
- Issuance Series Query (/en/documentation/iaas/cotas_de_fundo/consulta_paginada_series_de_emissao)
- Introduction (/en/documentation/iaas/cotas_de_fundo/inicio)
- Create Financial Application (/en/documentation/iaas/cotas_de_fundo/operacao_aplicacoes_financeiras)
- Create Redemption Request (/en/documentation/iaas/cotas_de_fundo/operacao_resgates)
- Consulta de despesas consolidadas (/en/documentation/iaas/despesas/despesa_consolidada/consulta_despesas)
- Atualização do Contrato (/en/documentation/iaas/despesas/submissao_despesa/contrato/atualizacao)
- Cancelamento do Contrato (/en/documentation/iaas/despesas/submissao_despesa/contrato/cancelamento)
- Criação do Contrato (/en/documentation/iaas/despesas/submissao_despesa/contrato/criacao)
- Listagem de Contratos (/en/documentation/iaas/despesas/submissao_despesa/contrato/listagem)
- Consulta de Contrato (/en/documentation/iaas/despesas/submissao_despesa/contrato/recuperacao)
- Submissão do Contrato (/en/documentation/iaas/despesas/submissao_despesa/contrato/submissao)
- Atualização da Despesa (/en/documentation/iaas/despesas/submissao_despesa/despesa/atualizacao)
- Cancelamento da Despesa (/en/documentation/iaas/despesas/submissao_despesa/despesa/cancelamento)
- Criação da Despesa (/en/documentation/iaas/despesas/submissao_despesa/despesa/criacao)
- Listagem de Despesas (/en/documentation/iaas/despesas/submissao_despesa/despesa/listagem)
- Consulta de Despesa (/en/documentation/iaas/despesas/submissao_despesa/despesa/recuperacao)
- Submissão da Despesa (/en/documentation/iaas/despesas/submissao_despesa/despesa/submissao)
- Listagem de Documentos (/en/documentation/iaas/despesas/submissao_despesa/documentos/listagem)
- Upload de Documentos (/en/documentation/iaas/despesas/submissao_despesa/documentos/upload)
- Fluxo de submissão de despesas (/en/documentation/iaas/despesas/submissao_despesa/fluxo_despesas)
- Anotações da Análise (/en/documentation/iaas/despesas/submissao_despesa/fornecedor/anotacoes)
- Atualização de Dados da Análise (/en/documentation/iaas/despesas/submissao_despesa/fornecedor/atualizacao)
- Cancelamento da Análise (/en/documentation/iaas/despesas/submissao_despesa/fornecedor/cancelamento)
- Cadastro de Fornecedor (/en/documentation/iaas/despesas/submissao_despesa/fornecedor/criacao)
- Documentos da Análise (/en/documentation/iaas/despesas/submissao_despesa/fornecedor/documentos)
- Consulta de Fornecedores e Análises (/en/documentation/iaas/despesas/submissao_despesa/fornecedor/listagem)
- Submissão para Análise (/en/documentation/iaas/despesas/submissao_despesa/fornecedor/submissao)
- Submissão de Despesas (/en/documentation/iaas/despesas/submissao_despesa/inicio)
- Issuances - Integralization (/en/documentation/iaas/emissoes/cadastrar_boleta)
- Asset Registration - Issuances (/en/documentation/iaas/emissoes/cadastro_ativo)
- Issuance Confirmation (/en/documentation/iaas/emissoes/confirmacao_emissao)
- Introduction (/en/documentation/iaas/emissoes/inicio)
- Apontamentos de Compliance (/en/documentation/iaas/homologacao_cedente/cadastro/apontamentos)
- Atualização de Cadastro (/en/documentation/iaas/homologacao_cedente/cadastro/atualizacao_de_cadastro)
- Definição de Assinantes (/en/documentation/iaas/homologacao_cedente/cadastro/definicao_de_assinantes)
- Envio para Análise (/en/documentation/iaas/homologacao_cedente/cadastro/disparo_da_analise)
- Envio de Cadastro (/en/documentation/iaas/homologacao_cedente/cadastro/envio_de_cadastro)
- Envio de Documentos (/en/documentation/iaas/homologacao_cedente/cadastro/envio_de_documentos)
- Branch Registration (/en/documentation/iaas/homologacao_cedente/cadastro/filiais)
- Assignor Accounts (/en/documentation/iaas/homologacao_cedente/cadastro/manutencao_de_contas)
- Webhooks da Análise (/en/documentation/iaas/homologacao_cedente/cadastro/webhooks_analise)
- Consulta de Análise (/en/documentation/iaas/homologacao_cedente/consulta/consulta_de_analise)
- Consulta de Cedente (/en/documentation/iaas/homologacao_cedente/consulta/consulta_de_cedente)
- Query Documents (/en/documentation/iaas/homologacao_cedente/contrato_de_cessao/consulta_de_documentos)
- Contract Manipulation (/en/documentation/iaas/homologacao_cedente/contrato_de_cessao/manutencao_do_contrato)
- Contrato de Cessão (/en/documentation/iaas/homologacao_cedente/contrato_de_cessao/pedido_de_contrato)
- Recuperação do Contrato (/en/documentation/iaas/homologacao_cedente/contrato_de_cessao/recuperacao_de_contrato)
- Webhooks do Contrato (/en/documentation/iaas/homologacao_cedente/contrato_de_cessao/webhooks_contrato)
- Introdução (/en/documentation/iaas/homologacao_cedente/inicio)
- SFTP Integration (/en/documentation/iaas/integracao_sftp/inicio)
- Recebimento de Webhooks (/en/documentation/iaas/introducao/autenticacao_webhooks)
- Introdução (/en/documentation/iaas/introducao/inicio)
- Endpoints Package (/en/documentation/iaas/introducao/pacote_endpoints)
- Endpoints de teste (/en/documentation/iaas/introducao/teste_de_autenticacao/endpoints_de_teste)
- Teste de autenticação (/en/documentation/iaas/introducao/teste_de_autenticacao/)
- Troca de Chaves (/en/documentation/iaas/introducao/troca_de_chaves)
- Início (/en/documentation/iaas/investidor/cadastro_investidor/inicio)
- atualizacao_cadastral (/en/documentation/iaas/investidor/cadastro/atualizacao_cadastral)
- atualizar_status_grupo_assinantes (/en/documentation/iaas/investidor/cadastro/atualizar_status_grupo_assinantes)
- busca_informacoes_de_uma_analise_cadastral_do_investidor (/en/documentation/iaas/investidor/cadastro/busca_informacoes_de_uma_analise_cadastral_do_investidor)
- busca_informacoes_do_investidor (/en/documentation/iaas/investidor/cadastro/busca_informacoes_do_investidor)
- buscar_documentos_para_assinatura (/en/documentation/iaas/investidor/cadastro/buscar_documentos_para_assinatura)
- Query paginated investor data (/en/documentation/iaas/investidor/cadastro/buscar_investidores_paginado)
- consultar_analise_em_andamento (/en/documentation/iaas/investidor/cadastro/consultar_analise_em_andamento)
- atualizar_status_conta_bancaria (/en/documentation/iaas/investidor/cadastro/contas_bancarias/atualizar_status_conta_bancaria)
- definir_conta_principal (/en/documentation/iaas/investidor/cadastro/contas_bancarias/definir_conta_principal)
- enviar_contas_bancarias (/en/documentation/iaas/investidor/cadastro/contas_bancarias/enviar_contas_bancarias)
- Create investor / investor analysis (/en/documentation/iaas/investidor/cadastro/criar_investidor)
- definir_grupo_assinantes_padrao (/en/documentation/iaas/investidor/cadastro/definir_grupo_assinantes_padrao)
- enviar_cadastro_para_analise (/en/documentation/iaas/investidor/cadastro/enviar_cadastro_para_analise)
- enviar_dados_cadastrais (/en/documentation/iaas/investidor/cadastro/enviar_dados_cadastrais)
- enviar_endereco (/en/documentation/iaas/investidor/cadastro/enviar_endereco)
- enviar_grupos_assinantes (/en/documentation/iaas/investidor/cadastro/enviar_grupos_assinantes)
- enviar_investor_document (/en/documentation/iaas/investidor/cadastro/enviar_investor_document)
- enviar_patrimonio (/en/documentation/iaas/investidor/cadastro/enviar_patrimonio)
- consultar_feedback (/en/documentation/iaas/investidor/cadastro/feedback/consultar_feedback)
- enviar_mensagem_feedback (/en/documentation/iaas/investidor/cadastro/feedback/enviar_mensagem_feedback)
- listar_feedbacks (/en/documentation/iaas/investidor/cadastro/feedback/listar_feedbacks)
- Introdução (/en/documentation/iaas/investidor/cadastro/introducao)
- criar_parte_relacionada (/en/documentation/iaas/investidor/cadastro/related_party/criar_parte_relacionada)
- enviar_documento_parte_relacionada (/en/documentation/iaas/investidor/cadastro/related_party/enviar_documento_parte_relacionada)
- consultar_formulario_suitability (/en/documentation/iaas/investidor/cadastro/suitability/consultar_formulario_suitability)
- enviar_suitability (/en/documentation/iaas/investidor/cadastro/suitability/enviar_suitability)
- atualizacao_cadastral (/en/documentation/iaas/investidor/carteira_administrada/atualizacao_cadastral)
- atualizar_status_grupo_assinantes (/en/documentation/iaas/investidor/carteira_administrada/atualizar_status_grupo_assinantes)
- busca_informacoes_de_uma_analise_cadastral_do_investidor (/en/documentation/iaas/investidor/carteira_administrada/busca_informacoes_de_uma_analise_cadastral_do_investidor)
- busca_informacoes_do_investidor (/en/documentation/iaas/investidor/carteira_administrada/busca_informacoes_do_investidor)
- buscar_documentos_para_assinatura (/en/documentation/iaas/investidor/carteira_administrada/buscar_documentos_para_assinatura)
- consultar_analise_em_andamento (/en/documentation/iaas/investidor/carteira_administrada/consultar_analise_em_andamento)
- atualizar_status_conta_bancaria (/en/documentation/iaas/investidor/carteira_administrada/contas_bancarias/atualizar_status_conta_bancaria)
- definir_conta_principal (/en/documentation/iaas/investidor/carteira_administrada/contas_bancarias/definir_conta_principal)
- enviar_contas_bancarias (/en/documentation/iaas/investidor/carteira_administrada/contas_bancarias/enviar_contas_bancarias)
- Create investor / investor analysis (/en/documentation/iaas/investidor/carteira_administrada/criar_investidor)
- definir_grupo_assinantes_padrao (/en/documentation/iaas/investidor/carteira_administrada/definir_grupo_assinantes_padrao)
- enviar_cadastro_para_analise (/en/documentation/iaas/investidor/carteira_administrada/enviar_cadastro_para_analise)
- enviar_dados_cadastrais (/en/documentation/iaas/investidor/carteira_administrada/enviar_dados_cadastrais)
- enviar_endereco (/en/documentation/iaas/investidor/carteira_administrada/enviar_endereco)
- enviar_grupos_assinantes (/en/documentation/iaas/investidor/carteira_administrada/enviar_grupos_assinantes)
- enviar_investor_document (/en/documentation/iaas/investidor/carteira_administrada/enviar_investor_document)
- enviar_patrimonio (/en/documentation/iaas/investidor/carteira_administrada/enviar_patrimonio)
- consultar_feedback (/en/documentation/iaas/investidor/carteira_administrada/feedback/consultar_feedback)
- enviar_mensagem_feedback (/en/documentation/iaas/investidor/carteira_administrada/feedback/enviar_mensagem_feedback)
- listar_feedbacks (/en/documentation/iaas/investidor/carteira_administrada/feedback/listar_feedbacks)
- Introdução (/en/documentation/iaas/investidor/carteira_administrada/introducao)
- enviar_documento_investor_owner (/en/documentation/iaas/investidor/carteira_administrada/investor_owner/enviar_documento_investor_owner)
- criar_parte_relacionada (/en/documentation/iaas/investidor/carteira_administrada/related_party/criar_parte_relacionada)
- enviar_documento_parte_relacionada (/en/documentation/iaas/investidor/carteira_administrada/related_party/enviar_documento_parte_relacionada)
- consultar_formulario_suitability (/en/documentation/iaas/investidor/carteira_administrada/suitability/consultar_formulario_suitability)
- enviar_suitability (/en/documentation/iaas/investidor/carteira_administrada/suitability/enviar_suitability)
- Assinar Documento (/en/documentation/iaas/investidor/compartilhado/assinar_documento)
- Atualização Cadastral (/en/documentation/iaas/investidor/compartilhado/atualizacao_cadastral)
- Atualizar Status do Grupo de Assinantes (/en/documentation/iaas/investidor/compartilhado/atualizar_status_grupo_assinantes)
- Consulta Informações de uma Análise Cadastral do Investidor (/en/documentation/iaas/investidor/compartilhado/busca_informacoes_de_uma_analise_cadastral_do_investidor)
- Consulta Informações do Investidor (/en/documentation/iaas/investidor/compartilhado/busca_informacoes_do_investidor)
- Buscar Lotes de Documentos para Assinatura (/en/documentation/iaas/investidor/compartilhado/buscar_documentos_para_assinatura)
- Consultar Análise em Andamento (/en/documentation/iaas/investidor/compartilhado/consultar_analise_em_andamento)
- Adicionar Conta Bancária (/en/documentation/iaas/investidor/compartilhado/contas_bancarias/adicionar_contas_bancarias)
- Atualizar Conta Bancária (/en/documentation/iaas/investidor/compartilhado/contas_bancarias/atualizar_conta_bancaria)
- Atualizar Status da Conta Bancária (/en/documentation/iaas/investidor/compartilhado/contas_bancarias/atualizar_status_conta_bancaria)
- Consultar Contas Bancárias (/en/documentation/iaas/investidor/compartilhado/contas_bancarias/buscar_contas_bancarias)
- Definir Conta Bancária Principal (/en/documentation/iaas/investidor/compartilhado/contas_bancarias/definir_conta_principal)
- Enviar Conta Bancária do Investidor (/en/documentation/iaas/investidor/compartilhado/contas_bancarias/enviar_contas_bancarias)
- Criar investidor (/en/documentation/iaas/investidor/compartilhado/criar_investidor)
- Definir Grupo de Assinantes Padrão (/en/documentation/iaas/investidor/compartilhado/definir_grupo_assinantes_padrao)
- Enviar Cadastro do Investidor para Análise (/en/documentation/iaas/investidor/compartilhado/enviar_cadastro_para_analise)
- Enviar Dados Cadastrais do Investidor (/en/documentation/iaas/investidor/compartilhado/enviar_dados_cadastrais)
- Enviar Documento Assinado (/en/documentation/iaas/investidor/compartilhado/enviar_documento_assinado)
- Enviar Endereço do Investidor (/en/documentation/iaas/investidor/compartilhado/enviar_endereco)
- Enviar Grupo de Assinantes (/en/documentation/iaas/investidor/compartilhado/enviar_grupos_assinantes)
- Enviar Documento do Investidor (/en/documentation/iaas/investidor/compartilhado/enviar_investor_document)
- Enviar Patrimônio do Investidor (/en/documentation/iaas/investidor/compartilhado/enviar_patrimonio)
- Consultar Feedback (/en/documentation/iaas/investidor/compartilhado/feedback/consultar_feedback)
- Enviar Mensagem em Feedback (/en/documentation/iaas/investidor/compartilhado/feedback/enviar_mensagem_feedback)
- Listar Feedbacks (/en/documentation/iaas/investidor/compartilhado/feedback/listar_feedbacks)
- Criar Investor Owner (/en/documentation/iaas/investidor/compartilhado/investor_owner/criar_investor_owner)
- Enviar Documento de Investor Owner (/en/documentation/iaas/investidor/compartilhado/investor_owner/enviar_documento_investor_owner)
- Criar Parte Relacionada (/en/documentation/iaas/investidor/compartilhado/related_party/criar_parte_relacionada)
- Enviar Documento da Parte Relacionada (/en/documentation/iaas/investidor/compartilhado/related_party/enviar_documento_parte_relacionada)
- Consultar Formulário Suitability (/en/documentation/iaas/investidor/compartilhado/suitability/consultar_formulario_suitability)
- Enviar Resposta Suitability (/en/documentation/iaas/investidor/compartilhado/suitability/enviar_suitability)
- assinar_documento (/en/documentation/iaas/investidor/distribuicao_externa/assinar_documento)
- atualizacao_cadastral (/en/documentation/iaas/investidor/distribuicao_externa/atualizacao_cadastral)
- atualizar_status_grupo_assinantes (/en/documentation/iaas/investidor/distribuicao_externa/atualizar_status_grupo_assinantes)
- busca_informacoes_de_uma_analise_cadastral_do_investidor (/en/documentation/iaas/investidor/distribuicao_externa/busca_informacoes_de_uma_analise_cadastral_do_investidor)
- busca_informacoes_do_investidor (/en/documentation/iaas/investidor/distribuicao_externa/busca_informacoes_do_investidor)
- buscar_documentos_para_assinatura (/en/documentation/iaas/investidor/distribuicao_externa/buscar_documentos_para_assinatura)
- consultar_analise_em_andamento (/en/documentation/iaas/investidor/distribuicao_externa/consultar_analise_em_andamento)
- atualizar_status_conta_bancaria (/en/documentation/iaas/investidor/distribuicao_externa/contas_bancarias/atualizar_status_conta_bancaria)
- definir_conta_principal (/en/documentation/iaas/investidor/distribuicao_externa/contas_bancarias/definir_conta_principal)
- enviar_contas_bancarias (/en/documentation/iaas/investidor/distribuicao_externa/contas_bancarias/enviar_contas_bancarias)
- Create investor / investor analysis (/en/documentation/iaas/investidor/distribuicao_externa/criar_investidor)
- definir_grupo_assinantes_padrao (/en/documentation/iaas/investidor/distribuicao_externa/definir_grupo_assinantes_padrao)
- enviar_cadastro_para_analise (/en/documentation/iaas/investidor/distribuicao_externa/enviar_cadastro_para_analise)
- Send Investor Registry Data (/en/documentation/iaas/investidor/distribuicao_externa/enviar_dados_cadastrais)
- enviar_documento_assinado (/en/documentation/iaas/investidor/distribuicao_externa/enviar_documento_assinado)
- enviar_endereco (/en/documentation/iaas/investidor/distribuicao_externa/enviar_endereco)
- enviar_grupos_assinantes (/en/documentation/iaas/investidor/distribuicao_externa/enviar_grupos_assinantes)
- Send Investor Document (/en/documentation/iaas/investidor/distribuicao_externa/enviar_investor_document)
- enviar_patrimonio (/en/documentation/iaas/investidor/distribuicao_externa/enviar_patrimonio)
- Enviar Resposta Suitability (/en/documentation/iaas/investidor/distribuicao_externa/enviar_suitability)
- consultar_feedback (/en/documentation/iaas/investidor/distribuicao_externa/feedback/consultar_feedback)
- enviar_mensagem_feedback (/en/documentation/iaas/investidor/distribuicao_externa/feedback/enviar_mensagem_feedback)
- listar_feedbacks (/en/documentation/iaas/investidor/distribuicao_externa/feedback/listar_feedbacks)
- Introdução (/en/documentation/iaas/investidor/distribuicao_externa/introducao)
- criar_investor_owner (/en/documentation/iaas/investidor/distribuicao_externa/investor_owner/criar_investor_owner)
- enviar_documento_investor_owner (/en/documentation/iaas/investidor/distribuicao_externa/investor_owner/enviar_documento_investor_owner)
- criar_parte_relacionada (/en/documentation/iaas/investidor/distribuicao_externa/related_party/criar_parte_relacionada)
- enviar_documento_parte_relacionada (/en/documentation/iaas/investidor/distribuicao_externa/related_party/enviar_documento_parte_relacionada)
- atualizacao_cadastral (/en/documentation/iaas/investidor/fundo_de_investimento/atualizacao_cadastral)
- busca_informacoes_de_uma_analise_cadastral_do_investidor (/en/documentation/iaas/investidor/fundo_de_investimento/busca_informacoes_de_uma_analise_cadastral_do_investidor)
- busca_informacoes_do_investidor (/en/documentation/iaas/investidor/fundo_de_investimento/busca_informacoes_do_investidor)
- buscar_documentos_para_assinatura (/en/documentation/iaas/investidor/fundo_de_investimento/buscar_documentos_para_assinatura)
- atualizar_status_conta_bancaria (/en/documentation/iaas/investidor/fundo_de_investimento/contas_bancarias/atualizar_status_conta_bancaria)
- definir_conta_principal (/en/documentation/iaas/investidor/fundo_de_investimento/contas_bancarias/definir_conta_principal)
- enviar_contas_bancarias (/en/documentation/iaas/investidor/fundo_de_investimento/contas_bancarias/enviar_contas_bancarias)
- Create investor / investor analysis (/en/documentation/iaas/investidor/fundo_de_investimento/criar_investidor)
- enviar_cadastro_para_analise (/en/documentation/iaas/investidor/fundo_de_investimento/enviar_cadastro_para_analise)
- Send Investor Registry Data (/en/documentation/iaas/investidor/fundo_de_investimento/enviar_dados_cadastrais)
- consultar_feedback (/en/documentation/iaas/investidor/fundo_de_investimento/feedback/consultar_feedback)
- enviar_mensagem_feedback (/en/documentation/iaas/investidor/fundo_de_investimento/feedback/enviar_mensagem_feedback)
- listar_feedbacks (/en/documentation/iaas/investidor/fundo_de_investimento/feedback/listar_feedbacks)
- Introdução (/en/documentation/iaas/investidor/fundo_de_investimento/introducao)
- criar_parte_relacionada (/en/documentation/iaas/investidor/fundo_de_investimento/related_party/criar_parte_relacionada)
- enviar_documento_parte_relacionada (/en/documentation/iaas/investidor/fundo_de_investimento/related_party/enviar_documento_parte_relacionada)
- Recuperando Informações da Posição do Investidor (/en/documentation/iaas/investidor/informacoes_posicao_investidor)
- Introduction (/en/documentation/iaas/investidor/inicio)
- Settlement Insertion (/en/documentation/iaas/liquidacao_ativos/ativos/)
- Settlement Removal (/en/documentation/iaas/liquidacao_ativos/ativos/remocao_liquidacoes)
- Settlement Webhooks (/en/documentation/iaas/liquidacao_ativos/ativos/webhook)
- Asset Settlement Flow (/en/documentation/iaas/liquidacao_ativos/fluxo_liquidacao)
- Asset Settlement (/en/documentation/iaas/liquidacao_ativos/inicio)
- Payment Batch Creation (/en/documentation/iaas/liquidacao_ativos/lote_pagamento/criacao)
- Close Payment Batch Insertion (/en/documentation/iaas/liquidacao_ativos/lote_pagamento/fechamento)
- Payment Batch Listing (/en/documentation/iaas/liquidacao_ativos/lote_pagamento/listagem)
- Payment Batch Webhooks (/en/documentation/iaas/liquidacao_ativos/lote_pagamento/webhook)
- Asset Creation — CCB (/en/documentation/iaas/negociacao_recebiveis/asset/criacao_co)
- Criação de Ativo — CTE (/en/documentation/iaas/negociacao_recebiveis/asset/criacao_cte)
- Asset Creation — Discounted Contract (/en/documentation/iaas/negociacao_recebiveis/asset/criacao_discounted_contract)
- Asset Creation — Invoice (Duplicata) (/en/documentation/iaas/negociacao_recebiveis/asset/criacao_duplicata)
- Addition of Assets to be Repurchased (/en/documentation/iaas/negociacao_recebiveis/asset/criacao_repurchased_asset)
- Document Insertion (/en/documentation/iaas/negociacao_recebiveis/asset/documents)
- Asset Query (/en/documentation/iaas/negociacao_recebiveis/asset/recuperar_ativos)
- Asset Removal from Batch (/en/documentation/iaas/negociacao_recebiveis/asset/remocao_ativos)
- Asset Webhooks (/en/documentation/iaas/negociacao_recebiveis/asset/webhooks)
- Manager Approval (/en/documentation/iaas/negociacao_recebiveis/assignment/aprovacao)
- Assignment Batch Creation (/en/documentation/iaas/negociacao_recebiveis/assignment/criacao)
- Assignment Documents (/en/documentation/iaas/negociacao_recebiveis/assignment/documento_da_cessao)
- Close Asset Insertion (/en/documentation/iaas/negociacao_recebiveis/assignment/fechamento)
- Assignment Batch Listing (/en/documentation/iaas/negociacao_recebiveis/assignment/listagem)
- Assignment Batch Retrieval (/en/documentation/iaas/negociacao_recebiveis/assignment/recuperacao)
- How to create an assignment? (/en/documentation/iaas/negociacao_recebiveis/assignment/video_cessao)
- Assignment Batch Webhooks (/en/documentation/iaas/negociacao_recebiveis/assignment/webhooks)
- Assignment Flow (/en/documentation/iaas/negociacao_recebiveis/fluxo_cessao)
- Credit Rights Assignment (/en/documentation/iaas/negociacao_recebiveis/inicio)
- Assignment Configuration Listing (/en/documentation/iaas/negociacao_recebiveis/listagem)
- Credit Rights Assignment Manual (/en/documentation/iaas/negociacao_recebiveis/manual_api)
- Listagem de Solicitações de Amortização (/en/documentation/iaas/passivo/amortizacao/listagem)
- Paginated Financial Application Query (/en/documentation/iaas/passivo/aplicacao_financeira/busca_paginada_aplicacoes_financeiras)
- Paginated Query of Financial Application Closing (/en/documentation/iaas/passivo/aplicacao_financeira/busca_paginada_fechamento_das_aplicacoes_financeiras)
- Query Financial Application by Key (/en/documentation/iaas/passivo/aplicacao_financeira/buscar_aplicacao_financeira_por_chave)
- Create Financial Application (/en/documentation/iaas/passivo/aplicacao_financeira/criar_aplicacao_financeira)
- Manual approval of quota lock (/en/documentation/iaas/passivo/bloqueio_de_cotas/aprovar_bloqueio_pendente_aprovacao)
- Query quota lock (/en/documentation/iaas/passivo/bloqueio_de_cotas/consulta_de_bloqueio_de_cotas)
- Query investor quota locks (/en/documentation/iaas/passivo/bloqueio_de_cotas/consulta_de_bloqueio_de_cotas_de_um_investidor)
- Send Collateral Document (/en/documentation/iaas/passivo/bloqueio_de_cotas/enviar_documento_da_garantia)
- Send Asset Document (/en/documentation/iaas/passivo/bloqueio_de_cotas/enviar_documento_do_ativo)
- Reduce quota lock (/en/documentation/iaas/passivo/bloqueio_de_cotas/reduzir_bloqueio_de_cotas)
- Request quota lock (/en/documentation/iaas/passivo/bloqueio_de_cotas/solicitar_bloqueio_de_cotas)
- Quota lock webhook (/en/documentation/iaas/passivo/bloqueio_de_cotas/webhooks_de_bloqueio_de_cota)
- Consulta paginada de investidores por classe de fundo (/en/documentation/iaas/passivo/consultas/consulta_investidores_classe_fundo)
- Consulta paginada de posições de cotistas por classe de fundo (/en/documentation/iaas/passivo/consultas/consulta_posicoes_cotistas_classe_fundo)
- Paginated Query of Quota Evolution Map (/en/documentation/iaas/passivo/consultas/consultar_mapa_de_evolucao_de_cotas)
- Paginated Query of Issuance Series (/en/documentation/iaas/passivo/consultas/consultar_todas_series_de_emissao)
- Paginated Query for Funds (/en/documentation/iaas/passivo/consultas/consultar_todos_fundos)
- Send Signed Subscription Note (/en/documentation/iaas/passivo/controle_de_oferta/enviar_boletim_de_subscricao_assinado)
- Retrieving Information about Subscription Note (/en/documentation/iaas/passivo/controle_de_oferta/informacoes_boletins_de_subscricao)
- Retrieving Information about Offerings (/en/documentation/iaas/passivo/controle_de_oferta/informacoes_das_ofertas)
- Request Subscription Note (/en/documentation/iaas/passivo/controle_de_oferta/solicitar_boletim_de_subscricao)
- Retrieving Public Quotas (/en/documentation/iaas/passivo/fundos/cotas_publicas)
- Introduction (/en/documentation/iaas/passivo/inicio)
- Query Redemption Request by Key (/en/documentation/iaas/passivo/pedido_de_resgate/buscar_pedido_de_resgate_por_chave)
- Consulta paginada de pedidos de resgate por classe de fundo (/en/documentation/iaas/passivo/pedido_de_resgate/consulta_pedidos_resgate_classe_fundo)
- Consulta paginada de pedidos de resgate por investidor (/en/documentation/iaas/passivo/pedido_de_resgate/consulta_pedidos_resgate_investidor)
- Create Redemption Request (/en/documentation/iaas/passivo/pedido_de_resgate/criar_pedido_de_resgate)
- Send Signed Adhesion Term (/en/documentation/iaas/passivo/termo_de_adesao/enviar_termo_de_adesao_assinado)
- Request Adhesion Term (/en/documentation/iaas/passivo/termo_de_adesao/solicitar_termo_de_adesao)
- Razão Contábil (/en/documentation/iaas/relatorios_dtvm/accounting_ledger)
- Composição de Carteira de Ativos (/en/documentation/iaas/relatorios_dtvm/assets_wallet_composition)
- Composição de Ativos da Cessão (/en/documentation/iaas/relatorios_dtvm/assignment_assets_wallet_composition)
- Lastros da Cessão (/en/documentation/iaas/relatorios_dtvm/assignment_documents)
- Relatório de Balanço (/en/documentation/iaas/relatorios_dtvm/balance_report)
- Demonstrativo de Caixa (/en/documentation/iaas/relatorios_dtvm/cash_account_demonstrative)
- Movimentações de Caixa (/en/documentation/iaas/relatorios_dtvm/cash_account_demonstrative_movements)
- Aquisição Consolidada de Direitos Creditórios (/en/documentation/iaas/relatorios_dtvm/consolidated_credit_rights_acquisition_assets)
- Conciliação Consolidada de Direitos Creditórios (/en/documentation/iaas/relatorios_dtvm/consolidated_credit_rights_conciliation_assets)
- Relatórios DTVM (/en/documentation/iaas/relatorios_dtvm/)
- Cotas MEC (/en/documentation/iaas/relatorios_dtvm/quota_mec)
- Composição da Carteira (/en/documentation/iaas/relatorios_dtvm/wallet_composition)
- XML ANBIMA (tipos 5 e 401) (/en/documentation/iaas/relatorios_dtvm/xml_anbima)
- Criação de um ativo a ser recomprado/vendido (/en/documentation/iaas/venda_ativos/asset/criacao_recompra)
- Aprovação do Gestor (/en/documentation/iaas/venda_ativos/assignment/aprovacao_recompra)
- Criação de um lote de recompra (/en/documentation/iaas/venda_ativos/assignment/criacao_recompra)
- Encerrar Inserção de Ativos (/en/documentation/iaas/venda_ativos/assignment/fechamento_recompra)
- Recompra e Venda de Ativos (/en/documentation/iaas/venda_ativos/inicio)
- Retrieving Account Information (/en/documentation/iaas/visibildade_de_caixa/get_accounts)
- Retrieving Account Transactions (/en/documentation/iaas/visibildade_de_caixa/get_transaction_reversals)
- Retrieving Account Transactions (/en/documentation/iaas/visibildade_de_caixa/get_transactions)
- Introdução (/en/documentation/iaas/visibildade_de_caixa/inicio)
- Transfer Between Fund Accounts (/en/documentation/iaas/visibildade_de_caixa/post_internal_transfer)
- Creating Reversal Request (/en/documentation/iaas/visibildade_de_caixa/post_transaction_reversal)
- Webhooks (/en/documentation/iaas/visibildade_de_caixa/webhook_transaction_reversal)
- Introduction to Documentation (/en/documentation/introducao_api_reference)
- Bem Vindo à Seção de Manuais das API's da QI Tech (/en/documentation/introducao_manuais)
- Bem Vindo à Seção de Manuais das API's da QI Tech (/en/documentation/introducao_operational_guides)
- Consulta de instituições financeiras (/en/documentation/lista_de_instituicoes_financeiras/consulta_de_instituicoes_financeiras)
- Air Force Payroll Manual (/en/documentation/manual_aeronautica/manual_consignado)
- Homologation Roadmap - BNPL (/en/documentation/manual_bnpl_ecommerce/manual_bnpl)
- Homologation Roadmap - BNPL (/en/documentation/manual_bnpl_ecommerce/)
- Inquiry - BNPL Issuance (/en/documentation/manual_bnpl_full/emissao/consulta)
- BNPL Issuance (/en/documentation/manual_bnpl_full/emissao/)
- Simulation - BNPL Issuance (/en/documentation/manual_bnpl_full/emissao/simulacao)
- Webhooks - BNPL Issuance (/en/documentation/manual_bnpl_full/emissao/webhooks)
- BNPL Reversal (/en/documentation/manual_bnpl_full/estorno/)
- Refund via Amortization — equal_amount and full_settle (/en/documentation/manual_bnpl_full/estorno/estorno_amortizacao)
- Webhooks - BNPL Reversal (/en/documentation/manual_bnpl_full/estorno/webhooks)
- Present Value Inquiry - BNPL Refinancing (/en/documentation/manual_bnpl_full/refinanciamento/consulta_valor_presente)
- Creation - BNPL Refinancing (/en/documentation/manual_bnpl_full/refinanciamento/criacao)
- Introduction - BNPL Refinancing (/en/documentation/manual_bnpl_full/refinanciamento/introducao)
- Simulation - BNPL Refinancing (/en/documentation/manual_bnpl_full/refinanciamento/simulacao)
- Scenarios - BNPL Batch Renegotiation (/en/documentation/manual_bnpl_full/renegociacao/cenarios)
- Inquiry - BNPL Batch Renegotiation (/en/documentation/manual_bnpl_full/renegociacao/consulta)
- Renegotiation with IOF Spread and Interest-Only Discount - BNPL (/en/documentation/manual_bnpl_full/renegociacao/iof-spread-e-desconto-juros)
- Batch Renegotiation Proposal - BNPL (/en/documentation/manual_bnpl_full/renegociacao/proposta)
- Simulation - BNPL Batch Renegotiation (/en/documentation/manual_bnpl_full/renegociacao/simulacao)
- Webhooks - BNPL Batch Renegotiation (/en/documentation/manual_bnpl_full/renegociacao/webhooks)
- Integration Scripts - BNPL Full (/en/documentation/manual_bnpl_full/scripts_integracao)
- Payroll Card Manual - Tracking (/en/documentation/manual_cartao_beneficio/manual_cartao_beneficio_acompanhamento)
- Documents and Signature (/en/documentation/manual_cartao_beneficio/manual_cartao_beneficio_documentos)
- Manual Cartão Consignado - Criação (/en/documentation/manual_cartao_beneficio/manual_cartao_beneficio_emissao)
- Address Management (/en/documentation/manual_cartao_beneficio/manual_cartao_beneficio_endereco)
- Payroll Card Manual - Webhook (/en/documentation/manual_cartao_beneficio/manual_cartao_beneficio_webhook)
- Manual CertifiQI (/en/documentation/manual_certifiqi/dc37cf4f-adad-45c5-9251-9c957fb9ce8e)
- Cessão (/en/documentation/manual_cessao/)
- Conciliação (/en/documentation/manual_conciliacao/)
- Private Payroll Loan Manual - External Formalization (/en/documentation/manual_consignado_privado/manual_assinatura_externa)
- Private Payroll Manual - Credit Operation Tracking (/en/documentation/manual_consignado_privado/manual_assinatura_leilao)
- Manual Consignado Privado - Registration and Disbursement (/en/documentation/manual_consignado_privado/manual_averbacao_desembolso)
- Private Payroll Manual - Configuration of Auction Proposal Receipt Filters (/en/documentation/manual_consignado_privado/manual_configuracao_filtros)
- Private Payroll Manual - Bookkeeping Entries Query (/en/documentation/manual_consignado_privado/manual_consultas_conciliacao)
- Private Payroll Manual - Worker Inquiries (/en/documentation/manual_consignado_privado/manual_consultas_trabalhador)
- Private Payroll Manual - Legacy Contracts (/en/documentation/manual_consignado_privado/manual_contratos_legados)
- Manual Consignado Privado - Crédito Novo (/en/documentation/manual_consignado_privado/manual_credito_novo)
- Private Payroll Loan Manual - Active Origination Flow (/en/documentation/manual_consignado_privado/manual_detalhamento_fluxo_ativo)
- Private Payroll Loan Manual - Auction Issuance Flow (/en/documentation/manual_consignado_privado/manual_detalhamento_fluxo_leilao)
- Private Payroll Manual - Internal Auction (/en/documentation/manual_consignado_privado/manual_leilao_interno)
- Manual Consignado Privado - Refinanciamento (/en/documentation/manual_consignado_privado/manual_refinanciamento)
- Insurance (/en/documentation/manual_consignado_privado/manual_seguro)
- Private Payroll Manual - Legacy Rollover (/en/documentation/manual_consignado_privado/manual_tombamento_legado)
- Manual – Private Payroll: Employment Relationships (/en/documentation/manual_consignado_privado/manual_vinculos_empregaticios)
- Manual Consignado Privado - Portabilidade: Consultas Prévias (/en/documentation/manual_consignado_privado/portabilidade/consultas)
- Manual Consignado Privado - Portabilidade: Consultas e Operações Pós-Proposta (/en/documentation/manual_consignado_privado/portabilidade/consultas_pos_proposta)
- Manual Consignado Privado - Portabilidade: Enumeradores (/en/documentation/manual_consignado_privado/portabilidade/enumeradores)
- Manual Consignado Privado - Portabilidade: Formalização (/en/documentation/manual_consignado_privado/portabilidade/formalizacao)
- Manual Consignado Privado - Portabilidade: Acompanhamento da Operação (/en/documentation/manual_consignado_privado/portabilidade/maquina_de_status)
- Manual Consignado Privado - Portabilidade: Mocks e Sandbox (/en/documentation/manual_consignado_privado/portabilidade/mocks_sandbox)
- Manual Consignado Privado - Portabilidade: Digitação da Proposta (/en/documentation/manual_consignado_privado/portabilidade/proposta)
- Manual Consignado Privado - Portabilidade: Simulação (/en/documentation/manual_consignado_privado/portabilidade/simulacao)
- Manual Consignado Privado - Portabilidade + Refinanciamento (/en/documentation/manual_consignado_privado/portabilidade/visao_geral)
- FGTS Authorization Consultation Manual (/en/documentation/manual_consulta_de_autorizacao_FGTS/)
- Consulta - Emissão Crédito Clean (/en/documentation/manual_credito_clean/emissao/consulta)
- Consulta de Cessão (/en/documentation/manual_credito_clean/emissao/consulta_cessao)
- Emissão Crédito Clean (/en/documentation/manual_credito_clean/emissao/)
- Emissão com Assinatura Posterior (/en/documentation/manual_credito_clean/emissao/emissao_dois_passos)
- Issuance with Immediate Signature (/signed_debt) (/en/documentation/manual_credito_clean/emissao/emissao_signed_debt)
- Simulação - Emissão Crédito Clean (/en/documentation/manual_credito_clean/emissao/simulacao)
- Webhooks - Emissão Crédito Clean (/en/documentation/manual_credito_clean/emissao/webhooks)
- Estorno Crédito Clean (/en/documentation/manual_credito_clean/estorno/)
- Webhooks - Estorno Crédito Clean (/en/documentation/manual_credito_clean/estorno/webhooks)
- Notificações - Crédito Clean (/en/documentation/manual_credito_clean/notificacoes)
- Consulta de Valor Presente - Refinanciamento Crédito Clean (/en/documentation/manual_credito_clean/refinanciamento/consulta_valor_presente)
- Criação - Refinanciamento Crédito Clean (/en/documentation/manual_credito_clean/refinanciamento/criacao)
- Introdução - Refinanciamento Crédito Clean (/en/documentation/manual_credito_clean/refinanciamento/introducao)
- Simulação - Refinanciamento Crédito Clean (/en/documentation/manual_credito_clean/refinanciamento/simulacao)
- Cenários - Renegociação em Lote Crédito Clean (/en/documentation/manual_credito_clean/renegociacao/cenarios)
- Consulta - Renegociação em Lote Crédito Clean (/en/documentation/manual_credito_clean/renegociacao/consulta)
- Proposta de Renegociação em Lote - Crédito Clean (/en/documentation/manual_credito_clean/renegociacao/proposta)
- Simulação - Renegociação em Lote Crédito Clean (/en/documentation/manual_credito_clean/renegociacao/simulacao)
- Webhooks - Renegociação em Lote Crédito Clean (/en/documentation/manual_credito_clean/renegociacao/webhooks)
- Scripts de Integração - Crédito Clean (/en/documentation/manual_credito_clean/scripts_integracao)
- Emissão de Dívida PJ com Assinatura Imediata (/en/documentation/manual_emissao_pj_signed_debt/emissao_signed_debt_pj)
- Assinatura em Lote (/en/documentation/manual_exercito/assinatura-em-lote)
- Cancelamento, Desaverbação e Reversal (/en/documentation/manual_exercito/cancelamento)
- Consulta de Margem Consignável (/en/documentation/manual_exercito/consulta-margem)
- Conta Interna para Desembolso (/en/documentation/manual_exercito/conta-interna-desembolso)
- Modelos de Formalização (/en/documentation/manual_exercito/formalizacao)
- Consignado do Exército — Introdução (/en/documentation/manual_exercito/introducao)
- Mapa de Status (/en/documentation/manual_exercito/mapa-de-status)
- Margem Livre (Crédito Novo) (/en/documentation/manual_exercito/margem-livre)
- Mocks (Sandbox) (/en/documentation/manual_exercito/mocks-sandbox)
- Portabilidade + Refinanciamento (/en/documentation/manual_exercito/portabilidade-refin)
- Webhooks (/en/documentation/manual_exercito/webhooks)
- Manual Saque Aniversário - FGTS v2 (/en/documentation/manual_FGTS/)
- Vehicle Collateral Manual (/en/documentation/manual_garantia_veicular/)
- My INSS Proposal Auction Manual (/en/documentation/manual_leilao_meu_inss/)
- Portability Out - Retention Evidence (/en/documentation/manual_portabilidade/evidencias_de_retencao)
- Out Portability (/en/documentation/manual_portabilidade/portabilidade_out)
- QI Cartões - Pré-pago (/en/documentation/manual_pre_pago/casos_uso)
- Private Pension Manual - Collateral Registration and Disbursement (/en/documentation/manual_previdencia_privada/manual_previdencia_privada_averbacao_desembolso)
- Manual Previdência Privada - Consulta (/en/documentation/manual_previdencia_privada/manual_previdencia_privada_consulta)
- Manual Previdência Privada - Crédito Novo (/en/documentation/manual_previdencia_privada/manual_previdencia_privada_credito_novo)
- Card Invoice (/en/documentation/manual_qi_fatura/pix_parcelado)
- Manual QI Sign (/en/documentation/manual_qi_sign/)
- Aprovar transferência (/en/documentation/movimentacao_de_contas/aprovar_transferencia)
- Transaction Receipt (/en/documentation/movimentacao_de_contas/comprovante_de_transferencia)
- Consult Transactions (Statement) (/en/documentation/movimentacao_de_contas/consulta_de_transacoes)
- Query pending transactions (/en/documentation/movimentacao_de_contas/consulta_de_transacoes_pendentes)
- Consulta de extrato (/en/documentation/movimentacao_de_contas/consulta_de_transferencias_realizadas)
- Realizar transferência (/en/documentation/movimentacao_de_contas/realizar_transferencia)
- Test Scenarios (/en/documentation/movimentacao_de_contas/transacao)
- Webhooks (/en/documentation/movimentacao_de_contas/webhook_movimentacoes)
- Notification Configuration (/en/documentation/notificacoes/configuracao_de_notificacao)
- Template Configuration (/en/documentation/notificacoes/configuracao_template)
- Custom Notification Management (/en/documentation/notificacoes/introducao)
- Resending notifications (/en/documentation/notificacoes/reenvio_de_notificacoes)
- Templates (/en/documentation/notificacoes/template)
- Events (/en/documentation/notificacoes/tipos_de_evento)
- Address Object (/en/documentation/objetos_compartilhados/address)
- Borrower Object (/en/documentation/objetos_compartilhados/borrower)
- Disbursement Account Object (/en/documentation/objetos_compartilhados/disbursement_account)
- Financial Institution Object (/en/documentation/objetos_compartilhados/financial_institution)
- Manual Operacional de Boletos (/en/documentation/operational_guide/boletos)
- Realizando uma transação Peer To Peer (/en/documentation/peer_to_peer)
- Creating a PIX key for an Alias (/en/documentation/pix_indireto/chaves_pix/criacao_de_chaves)
- Pix Key deletion for an Alias (/en/documentation/pix_indireto/chaves_pix/deletar_chaves)
- Introduction to PIX key management for an Alias (/en/documentation/pix_indireto/chaves_pix/introducao_chaves_pix)
- Pix Keys listing for an Alias (/en/documentation/pix_indireto/chaves_pix/listar_chaves)
- Cancel Refund Request (/en/documentation/pix_indireto/devolucao/cancelar_devolucao)
- Consult Return Request (/en/documentation/pix_indireto/devolucao/consultar_devolucao)
- Open Refund Request (/en/documentation/pix_indireto/devolucao/criar_devolucao)
- Close Refund Request (/en/documentation/pix_indireto/devolucao/fechar_devolucao)
- List Refund Requests (/en/documentation/pix_indireto/devolucao/listar_solicitacoes)
- Introduction to the Refund Flow (/en/documentation/pix_indireto/devolucao/maquina_estados)
- Scenario Simulation (/en/documentation/pix_indireto/devolucao/simulacao_de_cenarios)
- Receive Refund Request (/en/documentation/pix_indireto/devolucao/webhooks_devolucao)
- Consult an Alias Entity (/en/documentation/pix_indireto/gerenciamento_de_alias/consultar_alias)
- Consult Alias by Request Control Key (/en/documentation/pix_indireto/gerenciamento_de_alias/consultar_request_control_key)
- Creating an Alias Entity (/en/documentation/pix_indireto/gerenciamento_de_alias/criacao_de_alias)
- Deletion of an Alias Entity (/en/documentation/pix_indireto/gerenciamento_de_alias/deletar_alias)
- Introduction to Alias Entity (/en/documentation/pix_indireto/gerenciamento_de_alias/introducao_alias)
- Alias Listing (/en/documentation/pix_indireto/gerenciamento_de_alias/listagem_de_alias)
- Introduction (/en/documentation/pix_indireto/introducao)
- Mocked Pix keys in the sandbox environment (/en/documentation/pix_indireto/movimentacoes/chaves_pix_mockadas)
- Pix Key Lookup (/en/documentation/pix_indireto/movimentacoes/consultar_chave_pix)
- Consult Pix transaction (/en/documentation/pix_indireto/movimentacoes/consultar_pix)
- Pix Refund (/en/documentation/pix_indireto/movimentacoes/devolucao_pix)
- Introduction to PIX Transactions (/en/documentation/pix_indireto/movimentacoes/introducao_movimentacoes)
- Scenario Simulation (/en/documentation/pix_indireto/movimentacoes/simulacao)
- Execute Asynchronous Transfer to Manual Pix (/en/documentation/pix_indireto/movimentacoes/transacao_async/transacao_pix_manual)
- Execute Asynchronous Transfer via Pix Key (/en/documentation/pix_indireto/movimentacoes/transacao_async/transacao_pix_normal)
- Perform Asynchronous Transfer to Pix QR Code (/en/documentation/pix_indireto/movimentacoes/transacao_async/transacao_pix_qr_code)
- Transaction by Pix Key (/en/documentation/pix_indireto/movimentacoes/transacao/transacao_pix_chave_sync)
- Manual Transaction (/en/documentation/pix_indireto/movimentacoes/transacao/transacao_pix_manual_sync)
- Transaction by QR Code (/en/documentation/pix_indireto/movimentacoes/transacao/transacao_pix_qr_code_sync)
- Webhook for Pix Refunds (/en/documentation/pix_indireto/movimentacoes/webhook/webhook_devolucao_outgoing_pix)
- Webhook for Incoming Pix (/en/documentation/pix_indireto/movimentacoes/webhook/webhook_incoming_pix)
- Webhook for Pending Transactions (/en/documentation/pix_indireto/movimentacoes/webhook/webhook_transacao)
- Cancel a Portability Request (/en/documentation/pix_indireto/portabilidade/cancelar_pedido_de_portabilidade)
- Complete a Portability Request (/en/documentation/pix_indireto/portabilidade/completar_pedido_de_portabilidade)
- Confirm a Portability Request (/en/documentation/pix_indireto/portabilidade/confirmar_pedido_de_portabilidade)
- Consult Portability Requests (/en/documentation/pix_indireto/portabilidade/consultar_pedido_de_portabilidade)
- Portability Request creation (/en/documentation/pix_indireto/portabilidade/criar_pedido_de_portabilidade)
- Introduction to Portability Requests (/en/documentation/pix_indireto/portabilidade/introducao_portabilidade)
- Consult Portability Requests for an Alias (/en/documentation/pix_indireto/portabilidade/listar_pedidos_de_portabilidade_de_um_alias)
- Portability Update Webhook (/en/documentation/pix_indireto/portabilidade/webhook/webhook_atualizacao_do_pedido_de_portabilidade)
- Portability Request Received Webhook (/en/documentation/pix_indireto/portabilidade/webhook/webhook_receber_registro_externo_de_portabilidade)
- Consult QR Code (/en/documentation/pix_indireto/qr_code/consultar_qr_code)
- Create Dynamic PIX QR Code with Due Date (/en/documentation/pix_indireto/qr_code/Criar QR Code/criar_qr_code_dinamico_com_vencimento)
- Create Dynamic PIX QR Code for Immediate Payment (/en/documentation/pix_indireto/qr_code/Criar QR Code/criar_qr_code_dinamico_imediato)
- Create Static PIX QR Code (/en/documentation/pix_indireto/qr_code/Criar QR Code/criar_qr_code_estatico)
- List QR Codes of an alias (/en/documentation/pix_indireto/qr_code/decodificar_qr_code)
- Update/Deactivate a PIX QR Code (/en/documentation/pix_indireto/qr_code/desativar_qr_code)
- Introduction to PIX QR Code (/en/documentation/pix_indireto/qr_code/introducao_qr_code)
- List QR Codes of an alias (/en/documentation/pix_indireto/qr_code/listar_alias_qr_codes)
- Webhook for Incoming PIX Payment of QR Code (/en/documentation/pix_indireto/qr_code/webhook_incoming_pix)
- Cancel Infraction Report (/en/documentation/pix_indireto/relato_de_infracao/cancelar_relato_infracao)
- Consult Infraction Report (/en/documentation/pix_indireto/relato_de_infracao/consultar_relato_infracao)
- Open Infraction Report (/en/documentation/pix_indireto/relato_de_infracao/criar_relato_infracao)
- Close Infraction Report (/en/documentation/pix_indireto/relato_de_infracao/fechar_relato_infracao)
- List Infraction Reports (/en/documentation/pix_indireto/relato_de_infracao/listar_relatos)
- Introduction to the Infraction Report Flow (/en/documentation/pix_indireto/relato_de_infracao/maquina_estados)
- Scenario Simulation (/en/documentation/pix_indireto/relato_de_infracao/simulacao_de_cenarios)
- Receive Infraction Report (/en/documentation/pix_indireto/relato_de_infracao/webhooks_relato_infracao)
- Pix (/en/documentation/pix_v2)
- Aprovar transferência (/en/documentation/pix/2fa/aprovar_solicitacao_de_transferencia)
- Solicitar devolução de um Pix (/en/documentation/pix/2fa/solicitar_chargeback_pix)
- Solicitar Token de Aprovação da Transferência (/en/documentation/pix/2fa/solicitar_token_de_aprovacao)
- Solicitar Transferência Pix (/en/documentation/pix/2fa/solicitar_transferencia)
- Aprovar solicitação de transferência (/en/documentation/pix/aprovar_solicitacao_de_transferencia)
- Consulta de Dados de Chave Pix no Banco Central (/en/documentation/pix/baas_v2/consultar_chave_pix)
- Write off dynamic QR Code (/en/documentation/pix/baixar_qr_code_dinamico)
- Search for Pix limit change request (/en/documentation/pix/busca_por_solicitacao_de_limite_pix)
- Search for Pix limit usage (/en/documentation/pix/busca_por_uso_de_limite_pix)
- Sandbox Mock Pix Keys (/en/documentation/pix/chaves_pix_mockadas)
- Transfer receipt (/en/documentation/pix/comprovante_de_transferencia)
- Comprovante de transferência agendada (/en/documentation/pix/comprovante_de_transferencia_agendada)
- Consultar chaves Pix (/en/documentation/pix/consultar_chave)
- Consultar chaves Pix (/en/documentation/pix/consultar_chave_v2)
- Create Pix Key (/en/documentation/pix/criar_chave)
- Create dynamic QR Code (/en/documentation/pix/criar_qr_code_dinamico)
- Create static QR Code (/en/documentation/pix/criar_qr_code_estatico)
- Decode Pix QR Code (/en/documentation/pix/decodificar_qr_code)
- Delete Pix Key (/en/documentation/pix/excluir_chave)
- Introduction (/en/documentation/pix/introducao)
- List Pix Keys of an Account (/en/documentation/pix/listar_chaves_pix)
- MED 2.0 — Querying Funds Recoveries (/en/documentation/pix/med/consultar_recuperacao_de_valores)
- PIX Special Return Mechanism (MED) (/en/documentation/pix/med/introducao)
- Receiving Refund Requests (/en/documentation/pix/med/recebimento_pedidos_de_devolucao)
- MED 2.0 — Receiving a Funds Recovery (/en/documentation/pix/med/recebimento_recuperacao_de_valores)
- Receiving Infraction Reports (/en/documentation/pix/med/recebimento_relatos_de_infracao)
- MED 2.0 — Responding to a Funds Recovery (/en/documentation/pix/med/responder_recuperacao_de_valores)
- Respond to Infraction Reports (/en/documentation/pix/med/resposta_relatos_de_infracao)
- Search for own dynamic Pix QR Code (/en/documentation/pix/pesquisar_por_qr_code_dinamico)
- Pesquisar por transferência Pix de saída (/en/documentation/pix/pesquisar_por_transferencia_pix_de_saida)
- Portability Completion (/en/documentation/pix/portabilidade/conclusao_de_portabilidade)
- Portability Inquiry by Account (/en/documentation/pix/portabilidade/consulta_de_portabilidade_por_conta)
- Creating a Portability Request (/en/documentation/pix/portabilidade/criando_um_pedido_de_portabilidade)
- Deleting a Portability Request (/en/documentation/pix/portabilidade/deletando_um_pedido_de_portabilidade)
- Portability (/en/documentation/pix/portabilidade/recebendo_pedido_de_portabilidade)
- Resending Two-Factor Authentication (/en/documentation/pix/portabilidade/reenviando_a_2fa)
- Portability (/en/documentation/pix/portabilidade/respondendo_pedido_de_portabilidade)
- Simulate portability status change (/en/documentation/pix/portabilidade/simular_alteracao_de_status_de_portabilidade)
- Simulating the Completion of a Portability Request (/en/documentation/pix/portabilidade/simular_webhook_de_conclusao)
- Simulating the Receipt Webhook for a Portability Request (/en/documentation/pix/portabilidade/simular_webhook_recebimento)
- Two-Factor Authentication (/en/documentation/pix/portabilidade/validacao_de_dois_fatores)
- Scenario simulation (/en/documentation/pix/simulacao)
- Request limit change for Pix (/en/documentation/pix/solicitar_alteracao_de_limite_pix)
- Solicitar devolução de um Pix (/en/documentation/pix/solicitar_chargeback_pix)
- solicitar_transferencia (/en/documentation/pix/solicitar_transferencia)
- Webhook for expired dynamic Pix QR Code (/en/documentation/pix/webhook_por_qr_code_expirado)
- Setting Up the Webhook Receiving URL (/en/documentation/primeiros_passos/configurando_webhooks)
- Configuring Integration IP Allowlist (/en/documentation/primeiros_passos/configurar_ip_de_integracao)
- Introduction (/en/documentation/primeiros_passos/inicio)
- Test Endpoints (/en/documentation/primeiros_passos/teste_de_autenticacao/endpoints_de_teste)
- Possible errors: (/en/documentation/primeiros_passos/teste_de_autenticacao/possiveis_erros)
- Authentication test (/en/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_completo)
- Authentication test (/en/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_v2)
- Webhook (/en/documentation/primeiros_passos/teste_de_autenticacao/webhook_v2)
- Key Exchange (/en/documentation/primeiros_passos/troca_de_chaves)
- Consulta de valor presente de uma operação (/en/documentation/refinanciamento/consulta_de_valor_presente_de_uma_operacao)
- introducao (/en/documentation/refinanciamento/introducao)
- Refinancing Simulation (/en/documentation/refinanciamento/simulando_refinanciamento)
- Refinancing Creation (/en/documentation/refinanciamento/solicitando_refinanciamento)
- Atualizar regra de movimentação automática (/en/documentation/regras_de_movimentacao/atualizar_regra_movimentacao)
- Criar regra de movimentação automática (/en/documentation/regras_de_movimentacao/criar_regra_de_movimentacao)
- Regras de movimentação (/en/documentation/regras_de_movimentacao/)
- Cancelar uma renegociação (/en/documentation/renegociacao/cancelar_uma_renegociacao)
- Consult a renegotiation (/en/documentation/renegociacao/consultar_uma_renegociacao)
- Renegotiation Creation (/en/documentation/renegociacao/criacao_de_uma_renegociacao)
- Renegociação internal e external (/en/documentation/renegociacao/criacao_renegociacao_internal)
- List renegotiations (/en/documentation/renegociacao/listar_renegociacoes)
- Renegotiation Payment (/en/documentation/renegociacao/pagamento_renegociacao)
- Batch Renegotiation (/en/documentation/renegociacao/renegociacao_em_lote)
- Simulação com valor por parcela (/en/documentation/renegociacao/simulacao_com_valor_por_parcela)
- Renegotiation simulation (/en/documentation/renegociacao/simulacao_de_uma_renegociacao)
- Update de um pagamento manual (/en/documentation/renegociacao/update_de_um_pagamento_manual)
- Roteiro de Homologação - Circuito de Compras (/en/documentation/roteiros_de_homologacao/circuito_dd46f8d3-f078-41ba-a311-55be848f1c69)
- Homologation Roadmap - BaaS Digital Account (/en/documentation/roteiros_de_homologacao/conta_digital)
- Certification Roadmap - BaaS Digital Account with Two-Factor Authentication (/en/documentation/roteiros_de_homologacao/conta_digital_2fa)
- Homologation Roadmap - BaaS Digital Account with Dual Authentication (/en/documentation/roteiros_de_homologacao/conta_digital_2fa_baas)
- Homologation Roadmap - BaaS Digital Account (/en/documentation/roteiros_de_homologacao/conta_digital_baas)
- Homologation Roadmap - BaaS Digital Escrow Account (/en/documentation/roteiros_de_homologacao/conta_digital_escrow)
- Certification Roadmap - BaaS Escrow Digital Account (/en/documentation/roteiros_de_homologacao/conta_digital_escrow_caas)
- Roteiro de Homologação - BaaS Cobrança (/en/documentation/roteiros_de_homologacao/roteiro_cobranca)
- Roteiro de Homologação - BaaS Conta Digital (/en/documentation/roteiros_de_homologacao/roteiro_conta_digital)
- Roteiro de Homologação - BaaS Conta Digital (/en/documentation/roteiros_de_homologacao/roteiro_conta_digital_d795dc71-05b2-4476-bfbc-07ef247abd90)
- Roteiro de Homologação - Conta Integrada (/en/documentation/roteiros_de_homologacao/roteiro_conta_integrada)
- Roadmap for Backoffice Development (/en/documentation/roteiros_de_homologacao/roteiro_criacao_backoffice_cliente)
- Certification Roadmap - BaaS Conta Payments (/en/documentation/roteiros_de_homologacao/roteiro_payments)
- Roteiro de Homologação - Pix Conta Integrada (/en/documentation/roteiros_de_homologacao/roteiro_pix_conta_integrada)
- Roteiro de Homologação - Pix indireto (/en/documentation/roteiros_de_homologacao/roteiro_pix_indireto)
- Roteiro de Homologação - Emissão de dívida PF com desembolso pagando QR Code (/en/documentation/roteiros_laas/roteiro_00f2a5d3-39c2-4f3d-9234-7d1525daaaf2)
- Homologation Roadmap - Individual Debt Issuance - Precatório Advance (/en/documentation/roteiros_laas/roteiro_5d068423-6094-49e4-b15b-7740038295a8)
- Homologation Roadmap - Credit Pay (/en/documentation/roteiros_laas/roteiro_cecdd0e2-081a-4590-b571-188c376a7c64)
- APP Integration (/en/documentation/roteiros_laas/roteiro_e7030e18-a9c7-452b-8236-1cf8edfb4de9)
- Webhooks INSS (/en/documentation/roteiros_laas/webhooks_inss)
- Consultar saldo disponível (/en/documentation/saque_aniversario_fgts/consultar_saldo_disponivel)
- Criar operação de crédito (/en/documentation/saque_aniversario_fgts/criacao_da_operacao)
- Introdução ao Saque Aniversário FGTS (/en/documentation/saque_aniversario_fgts/introducao)
- roteiro_de_homologacao (/en/documentation/saque_aniversario_fgts/roteiro_de_homologacao)
- Simulação do valor desejado (/en/documentation/saque_aniversario_fgts/simulacao_do_valor_desejado)
- Simulação do valor máximo (/en/documentation/saque_aniversario_fgts/simulacao_do_valor_maximo)
- Webhooks de Consulta de Saldo (/en/documentation/saque_aniversario_fgts/webhooks_de_consulta_de_saldo)
- Assinatura em Lote (/en/documentation/siape/assinatura-em-lote)
- Cancelamento, Desaverbação e Reversal (SIAPE) (/en/documentation/siape/cancelamento)
- Consulta de Margem Consignável (SIAPE) (/en/documentation/siape/consulta-margem)
- Conta Interna para Desembolso (/en/documentation/siape/conta-interna-desembolso)
- Modelos de Formalização (SIAPE) (/en/documentation/siape/formalizacao)
- SIAPE-SIGEPE — Introdução (/en/documentation/siape/introducao)
- Mapa de Status (/en/documentation/siape/mapa-de-status)
- Margem Livre (Crédito Novo) (/en/documentation/siape/margem-livre)
- Mocks (Sandbox) (/en/documentation/siape/mocks-sandbox)
- Portabilidade + Refinanciamento (/en/documentation/siape/portabilidade-refin)
- Webhooks (/en/documentation/siape/webhooks)
- Aprovar Transferência (/en/documentation/ted/2fa/aprovar_transferencia)
- Solicitar Transferência (/en/documentation/ted/2fa/solicitar_transferencia)
- TED (/en/documentation/ted/ted_v2)
- consulta_de_agenda_com_opt_in (/en/documentation/trava_de_domicilio_bancario/consulta_de_agenda_com_opt_in)
- consulta_de_agenda_sem_opt_in (/en/documentation/trava_de_domicilio_bancario/consulta_de_agenda_sem_opt_in)
- emissao_de_divida_com_trava_de_agenda (/en/documentation/trava_de_domicilio_bancario/emissao_de_divida_com_trava_de_agenda)
- introducao (/en/documentation/trava_de_domicilio_bancario/introducao)
- Open bank slip ownership exchange batch (/en/documentation/troca_de_titularidade/abrir_lote)
- Approve Bank Slip Ownership Exchange Batch (/en/documentation/troca_de_titularidade/aprovar_lote)
- Cancel bank slip ownership exchange batch (/en/documentation/troca_de_titularidade/cancelar_lote)
- Create bank slip ownership exchange batch (/en/documentation/troca_de_titularidade/criar_lote_batch)
- Include bank slips in an ownership exchange batch (/en/documentation/troca_de_titularidade/incluir_boletos)
- Introduction (/en/documentation/troca_de_titularidade/introducao)
- List bank slips from an ownership exchange batch (/en/documentation/troca_de_titularidade/listar_boletos_lote)
- List bank slip ownership exchange batches - destination (/en/documentation/troca_de_titularidade/listar_lotes_destino)
- List bank slip ownership exchange batches - source (/en/documentation/troca_de_titularidade/listar_lotes_origem)
- Bank Slip Transfer Webhooks (/en/documentation/troca_de_titularidade/notificacoes_webhooks)
- Remove boletos from an ownership exchange batch (/en/documentation/troca_de_titularidade/remover_boletos)
- Send bank slip ownership exchange batch (/en/documentation/troca_de_titularidade/validar_lote_e_enviar)
- Document inquiry (/en/documentation/upload_de_documentos/consulta_documents)
- Documents upload (/en/documentation/upload_de_documentos/)
- acg1 (/en/documentation/webhooks/acg1)
- agenda_de_recebiveis (/en/documentation/webhooks/agenda_de_recebiveis)
- Boletos webhook (/en/documentation/webhooks/boletos)
- Debt Webhooks (/en/documentation/webhooks/dividas)
- Risk management webhooks (/en/documentation/webhooks/gestao_de_risco)
- Overpayment webhooks (/en/documentation/webhooks/indevidos)
- notificacoes_baas_e_laas (/en/documentation/webhooks/notificacoes_baas_e_laas)
- Installment payment webhooks (/en/documentation/webhooks/pagamento_de_parcela)
- Installment Webhooks (/en/documentation/webhooks/parcelas)

---

# Atualização uso de TAC

URL: /en/documentation/1bb151c7-735f-4449-bd9a-4780be271da8

## Consulta de elegibilidade de CPF

Em posse dos dados de **CPF**, é possível a consulta da elegibilidade do CPF.

### Request

ENDPOINT /debts/borrower/[document_number]/tac_eligibility
MÉTODO GET

### Path Params

| Campo          | Descrição                              | Caracteres |
|---------------|----------------------------------------|------------|
| `document_number`  | Número de CPF do devedor | 11         |

### Response

STATUS 200

Response Body

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

### Descrição
| Campo                        | Tipo   | 
|------------------------------|--------|
| `elegible`            | boleean | 

:::caution Atenção
Para um CPF com o retorno **"eligible": false**, tanto a simulação, quanto a emissão da dívida não serão possíveis com o envio de TAC na lista **rebates**.
:::

 

## Erro de elegibilidade durante a simulação e emissão de dívida
Ao enviar um valor de TAC tanto na simulação quanto na emissão de uma operação, para um CPF não elegível à cobrança de TAC, será retornado um erro síncrono.

STATUS 400

Response Body

```json
{
	"title": "Bad Request",
	"description": "Operation not eligible for tac fee charge. Please do not use this fee type for this borrower.",
	"translation": "Operação não elegível para cobrança de taxa do tipo tac. Por favor, não use esse tipo de fee para esse tomador de crédito.",
	"code": "COP000355"
}
```

## Cancelamento de operações inelegíveis

Em caso de operações simultâneas enviadas com TAC para o mesmo tomador, a primeira a desembolsar forçará o cancelamento das restantes. Dessa forma, será enviado um webhook de cancelamento com o payload abaixo.

Response Body

```json
{
    "webhook_type": "debt",
    "key": "27a099df-4688-43cb-87fa-515b1cf343a5",
    "event_datetime": "2022-09-27 07:03:49",
    "data": {
        "cancel_reason": "Taxa da operação do tipo tac não permitida.",
        "cancel_reason_enumerator": "tac_not_allowed"
    },
    "status": "canceled"
}

```

---

# Troca com Troco SIAPE/EXÉRCITO

URL: /en/documentation/6fabde14-8ce4-42ac-9f93-28246356e45d

## Consulta da lista de contratos

:::caution Atenção
Essa funcionalidade é **exclusiva** para integrações com a API de exército.
:::

Em posse dos dados de **CPF**, **Matrícula do militar** e a **Token**, o parceiro integrador pode realizar a consulta da lista de contratos do militar disponíveis para compra através do seguinte endpoint:

### Request

ENDPOINT /military_payroll/portability_contracts_report
MÉTODO POST

Request Body

```json
{
    "document_number": "45507529710",
    "registration_code": "146254221",
    "token": "abc1234"
}
```

:::info
 O CPF deve ser informado em formato de texto, com no máximo 11 caracteres, sem ".", sem "-" e alinhado com zeros à esquerda.
:::

#### Request Body Params

| Campo                        | Tipo   | Descrição                                 |
|------------------------------|--------|-------------------------------------------|
| `document_number`            | string | CPF do militar.                           |
| `registration_code`          | string | Matrícula do militar.                     |
| `token`                      | string | Senha do militar.                        |

### Response

ENDPOINT /military_payroll/portability_contracts_report
MÉTODO POST
STATUS 201

Response Body

```json
{
	"portability_contracts_report_key": "3e41a8afb-e1b2-4215-8093-c4b5feab529c" ,
	"status": "pending_search"
}
```

Os dados da consulta de margem serão retornados via webhook.

#### Response Body Params

| Campo                              | Tipo   | Descrição                                                                                                              |
|------------------------------------|--------|------------------------------------------------------------------------------------------------------------------------|
| `portability_contracts_report_key` | string | Chave de identificação da consulta da lista de contratos.                                                              |
| `status`                           | enum   | [Enumeradores de status de consulta da lista de contratos.](#enumeradores-de-status-da-consulta-da-lista-de-contratos) |

#### Enumeradores de Status da Consulta da Lista de Contratos

| Enumerador         | Descrição                                                                   |
|--------------------|-----------------------------------------------------------------------------|
| `pending_search`   | Consulta da lista de contratos pendente de resposta do sistema do exército.  |
| `failed`           | Falha na consulta da lista de contratos.                                       |
 | `succeeded`        | Sucesso na consulta da lista de contratos.        |  

### Consulta com sucesso

O webhook de sucesso será retornado da seguinte forma: 

WEBHOOK_TYPE military_payroll.portability_contracts_report
STATUS succeeded

Body

```json
{
	"webhook_type": "military_payroll.portability_contracts_report.status_change",
	"key": "3e41a8afb-e1b2-4215-8093-c4b5feab529c",
	"event_datetime": "2023-05-28T08:43:29Z",
	"status": "succeeded",
	"data": {
		"document_number": "45507529710",
		"contracts" : [
			{
				"econsig_id": "2361529",
				"installment_amount": 10.0,
				"number_of_installments": 5,
				"number_of_paid_installments": 1,
				"consignatory": "BANCO XPTO", 
				"contract_date": "2022-01-03T15:01:57Z",
				"contract_status": 	"accepted"			
			}
		]
		
	}
}
```

### Consulta com falha

O webhook de falha será retornado da seguinte forma: 

WEBHOOK_TYPE military_payroll.portability_contracts_report
STATUS failed

Body

```json
{
	"webhook_type": "military_payroll.portability_contracts_report.status_change",
	"key": "3e41a8afb-e1b2-4215-8093-c4b5feab529c",
	"event_datetime": "2023-05-28T08:43:29Z",
	"status": "failed",
	"data": { 
		"enumerator": "military_not_found" 
	}
}
```

Cada `enumerator` tem uma descrição mais detalhada e, para facilitar a consulta, a tabela abaixo relaciona ambas as coisas para cada caso.

#### Enumeradores failure_reason

| Enumerador                | Descrição                                                     | Código Zetra |
|---------------------------|---------------------------------------------------------------|--------------|
| contracts_not_found       | Nenhum contrato encontrado para os dados informados           | 294          |
| invalid_registration_code | Matrícula informada não é válida                              | 210          |
| military_blocked          | Consulta não pode ser concluída pois o militar está bloqueado | 352          |
| military_not_found        | Nenhum servidor encontrado para os dados informados           | 293          |

## Simulação da Operação de Crédito Pessoal

Primeiramente é preciso calcular o valor da operação de Crédtio Pessoal necessária para quitar a operação de crédito original.

O valor do saldo devedor da dívida original deve ser informado no campo _**disbursed_amount**_.

:::caution Aviso
A operação deve ser simulada com apenas 1 parcela, desembolso em **D0** e a parcela deve ter seu vencimento para **D+5 dias úteis**, contas a partir da data de desembolso (pagamento) da operação.
:::

### Request

ENDPOINT /debt_simulation
MÉTODO POST

```json title='Request Body'
{
	"borrower": {
		"person_type": "natural"
	},
	"financial": {
		"disbursed_amount": 80492.95,
		"monthly_interest_rate": 0.03,
		"credit_operation_type": "ccb",
		"disbursement_date": "2023-03-17",
		"issue_date": "2023-03-17",
		"fine_configuration": {
			"contract_fine_rate": 0,
			"interest_base": "workdays",
			"monthly_rate": 0
		},
		"interest_grace_period": 0,
		"interest_type": "pre_price_days",
		"number_of_installments": 1,
		"principal_grace_period": 0,
		"first_due_date_delay": 5
	}
}
```

---

## Simulação da Operação de Crédito Consignado do SIAPE/ EXÉRCITO 

A simulação da Operação de Crédito Consignado do SIAPE, deverá simular a quitação do contrato original e o calculo do valor do troco liberado para o cliente em função da margem disponível e taxa do contrato.

Nesta simulação os campos informados terão seus valores atribuidos da seguinte forma:

_**installment_face_value**_ = Valor da margem consignável

_**disbursement_date**_ = **D+5 dias úteis** do momento da simulação

_**due_balance**_ = **total_amount** da 1ª parcela retornada na simulação da Operação de Crédito Pessoal

_**original_deadline**_ = Prazo total em dias da Operação de Crédito Pessoal (5 dias)

:::info IOF
O valor de IOF da Operação de Crédito Consignado do SIAPE, uma vez que ela refinancie a Operação de Crédito Pessoal, corresponderá apenas ao valor do troco liberado ao cliente (dinheiro novo). 
:::

### Request

ENDPOINT /debt_simulation
MÉTODO POST

```json title='Request Body'
{
    "borrower": {
        "person_type": "natural"
    },
    "financial": {
        "first_due_date": "2023-06-10",
        "installment_face_value": 100.0,
        "disbursement_date": "2023-03-22",
        "number_of_installments": 96,
        "monthly_interest_rate": 0.0205,
        "interest_type": "pre_price_days",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "principal_grace_period": 0
    },
    "collaterals": [{
        "collateral_type": "federal_payroll/military_payroll"
    }],
    "refinanced_credit_operations": [
        {
            "due_balance": 1250.20,
            "original_deadline": 120
        }
    ]
}
```

O campo _**data.final_disbursement_amount**_ retornado na simulação será o valor do troco pago ao cliente.

---

### Consulta do valor de parcela da operação de Crédito Pessoal

#### Request

ENDPOINT /debt?key=[DEBT-KEY]&eval_present_value=True&calculate_delay=True&calculate_spread=False
MÉTODO GET

:::info Informação
A DEBT-KEY é a chave retornada na resposta da criação da operação (resposta do /debt)
:::

---

## Criação da conta de titularidade do devedor

Antes da digitação das propostas é necessário abrir uma conta para o devedor na QI Tech.

A conta será utilizada para receber o desembolso da Operação de Crédito Pessoal, realizar os pagamentos do saldo devedor da dívida original em outro banco (via Boleto, TED ou Pix).

### Request

ENDPOINT /account
MÉTODO POST

```json title='Request Body'
{
	"is_operation_account": true,
	"account_owner": {
		"address": {
			"city": "São Paulo",
			"complement": "s/c",
			"neighborhood": "Pinheiros",
			"number": "215",
			"postal_code": "12345012",
			"state": "SP",
			"street": "Gilberto Sabino"
		},
		"birth_date": "1961-01-30",
		"document_identification": "261a8fbc-d998-4dd7-8515-ddebb212ae27",
		"is_pep": false,
		"mother_name": "Nome da Mãe do Devedor",
		"nationality": "brasileiro",
		"email": "email@email.com",
		"individual_document_number": "12345678911",
		"name": "Nome do Devedor",
		"phone": {
			"area_code": "11",
			"country_code": "055",
			"number": "900000000"
		},
		"person_type": "natural"
	}
}
```

| Parâmetro                                                    | Descrição                                          |
|--------------------------------------------------------------|----------------------------------------------------|
| **account_owner**                                            | Dados do devedor                                   |
| **is_operation_account**                                     | Indicativo de que a conta é uma conta de operação. |

### Response

ENDPOINT /account
MÉTODO POST

```json title='Response Body'
{
	"data": {
		"account_info": {
			"account_branch": "0001",
			"account_digit": "3",
			"account_number": "1234567",
			"financial_institution_code": "329"
		},
		"account_owner": {
			"document_number": "12345678911",
			"name": "Nome do Devedor"
		}
	},
	"event_datetime": "2023-03-21 12:30:24",
	"key": "8ff1e73f-e87b-4641-99a6-3267030c6034",
	"status": "account_pending_operation",
	"webhook_type": "account"
}
```

:::info
Os dados de conta retornados no /account deverão ser utilizados como conta de desembolso da Operação de Crédito Pessoal
:::

### Erro 5xx ou Timeout 

O fluxo não deve prosseguir enquanto a conta não estiver abertua com sucesso. 
Para os casos de falha, deve ser checado se a conta de fato não foi aberta para o cliente, antes de uma possível retentativa de abertura.

É possível checar se a conta foi aberta para o cliente, listando as conta abertas para um determinado CPF.

#### Request

ENDPOINT /account
MÉTODO POST
PARAMETER owner_document_number, requester_key

| Parâmetro                 | Descrição                          |
|---------------------------|------------------------------------|
| **owner_document_number** | CPF do devedor                     |
| **requester_key**         | É uma chave interna da integração. |

#### Response
STATUS 200

```json title='Response Body'
{
	"data": [{
		...
		"account_branch": "0001",
		...
		"account_digit": "2",
		...
		"account_key": "f600a6a9-0845-454f-b25c-a6d108ea582e",
		"account_name": "Default",
		"account_number": "1467576",
		"account_status": {
			"created_at": "2019-10-11T18:58:31",
			"enumerator": "opened",
			"translation_path": "account.AccountStatus.opened"
		},
		...
		"owner_document_number": "09080702000105",
		"owner_name": "Nome do Devedor",
		...
	}],
	"pagination": {
		"current_page": 1,
		"next_page": null,
		"rows_per_page": 100,
		"total_pages": 1,
		"total_rows": 1
	}
}
```

:::info Informação
No payload de resposta acima, estão listados apenas os campos relevantes para leitura.
:::

---

## Emissão das Operações

A criação das operações de Crédito Pessoal e Crédito Consignado do SIAPE, **deverão ser realizadas no mesmo momento**, tendo cada uma as seguintes configurações

- **Operação de Crédito Pessoal**: Deve ser emitida com desembolso em D0 e com apenas uma parcela com vencimento para **D+5 dias úteis** do desembolso.
- **Operação de Crédito Consignado do SIAPE**: Deve ser emitida com desembolso em **D+0**, mas com opções de desembolso para até **D+15 dias corridos** e com o número de parcelas pretendidas.

:::danger Atenção
Para emissão da Operação de Crédito Pessoal o objeto "_**financial**_", deve ser enviado com exatamente as mesmas informações enviadas na sua simulação.

Para emissão da Operação de Crédito Consignado do SIAPE, o obejeto "_**financial**_" terá as seguintes diferenças:
- O campo _**disbursement_date**_ deve ser substituído pelos campos _**disbursement_start_date**_ e _**disbursement_end_date**_, onde a diferença entre um e outro deve ser de **15 dias corridos**.
- O campo _**refinanced_credit_operations[0].operation_key**_ deve conter a **DEBT-KEY**, retornada no retorno da criação da Operação de Crédito Pessoal. 
:::

:::info Informação
A Operação de Crédito Pessoal, só pode desembolsar em **dias úteis** e nos seguintes horários, à depender do meio de pagamento do saldo devedor da dívida original:
- **TED**: desembolso entre **6:30 e 17:15**
- **Boleto**: desembolso entre **7:00 e 22:00**
- **Pix**: qualquer horário (mas é recomendado o desembolso em horário comercial, pois caso uma operação seja desembolsada de madrugada, por exemplo, a entrada do Pix pode ser rejeitada por suspeitas de fraude)
:::

### Emissão da Operação de Crédito Pessoal

Para emitir a Operação de Crédito Pessoal, é necessário enviar a informação dos Boletos/TEDs/Pix que precisam ser pagos após o desembolso da operação. 

:::caution Atenção
O parceiro deve gerar uma chave interna de identificação da operação e enviá-la na requisição de emissão de dívida no campo "_**requester_identifier_key**_"
:::

#### Exemplos Resquests

ENDPOINT /debt
MÉTODO POST

**Boleto**

```json title='Request Body'
{
	"borrower": {
		"name": "Nome do Devedor",
		"email": "email@email.com",
		"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"
		},
		"role_type": "issuer",
		"birth_date": "1969-05-01",
		"mother_name": "Nome da Mãe do Devedor",
		"person_type": "natural",
		"individual_document_number": "12345678911",
		"gender": "male",
		"nationality": "brasileiro",
		"is_pep": false,
		"marital_status": "married"
	},
	"financial": {
		"disbursed_amount": 80492.95,
		"annual_interest_rate": 0.20983,
		"credit_operation_type": "ccb",
		"disbursement_date": "2023-03-17",
		"issue_date": "2023-03-17",
		"fine_configuration": {
			"contract_fine_rate": 0,
			"interest_base": "workdays",
			"monthly_rate": 0
		},
		"interest_grace_period": 0,
		"interest_type": "pre_price_days",
		"number_of_installments": 1,
		"principal_grace_period": 0,
		"first_due_date_delay": 5
	},
	"simplified": true,
	"additional_data": {
		"debt_payment": [{
			"bank_slip": [{
                "digitable_line": "10495419967200010004900031456924592920008049295",
                "amount": "80492,95",
                "beneficiary": "CAIXA ECONÔMICA FEDERAL",
                "due_date": "2023-03-17"
            }],
			"funds_transfer": [],
			"pix": [],
			"financial_institution_code_number": "623"
		}],
		"issuer_account": {
			"account_digit": "0",
			"account_branch": "1234",
			"account_number": "123456",
			"financial_institution_code_number": "104"
		},
		"total_af_amount": 86186.52
	},
	"requester_identifier_key": "7ac52492-61c0-4dd6-a414-b0bf940fb7ca",
	"disbursement_bank_account": {
		"bank_code": "329",
		"account_digit": "3",
		"branch_number": "0001",
		"account_number": "1234567"
	},
	"after_disbursement_actions": [{
		"action_data": {
			"digitable_line": "10495419967200010004900031456924592920008049295"
		},
		"action_type": "bankslip_payment"
	}],
	"modality": {
        "code": "0203"
    }
}
```

**TED**

```json title='Request Body'
{
	"borrower": {
		"name": "Nome do Devedor",
		"email": "email@email.com",
		"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"
		},
		"role_type": "issuer",
		"birth_date": "1969-05-01",
		"mother_name": "Nome da Mãe do Devedor",
		"person_type": "natural",
		"individual_document_number": "12345678911",
		"gender": "male",
		"nationality": "brasileiro",
		"is_pep": false,
		"marital_status": "married"
	},
	"financial": {
		"disbursed_amount": 80492.95,
		"annual_interest_rate": 0.20983,
		"credit_operation_type": "ccb",
		"disbursement_date": "2023-03-17",
		"issue_date": "2023-03-17",
		"fine_configuration": {
			"contract_fine_rate": 0,
			"interest_base": "workdays",
			"monthly_rate": 0
		},
		"interest_grace_period": 0,
		"interest_type": "pre_price_days",
		"number_of_installments": 1,
		"principal_grace_period": 0,
		"first_due_date_delay": 5
	},
	"simplified": true,
	"additional_data": {
		"debt_payment": [{
			"bank_slip": [],
			"funds_transfer": [{
				"amount": "4736,07",
				"account_digit": "0",
				"account_branch": "0897",
				"account_number": "20001",
				"financial_institution_code_number": "341"
			}],
			"pix": [],
			"financial_institution_code_number": "341"
		}],
		"issuer_account": {
			"account_digit": "0",
			"account_branch": "0491",
			"account_number": "100021100",
			"financial_institution_code_number": "104"
		},
		"total_af_amount": 86186.52
	},
	"requester_identifier_key": "7ac52492-61c0-4dd6-a414-b0bf940fb7ca",
	"disbursement_bank_account": {
		"bank_code": "329",
		"account_digit": "3",
		"branch_number": "0001",
		"account_number": "1234567"
	},
	"after_disbursement_actions": [{
		"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": 4736.07
		},
		"action_type": "funds_transfer"
	}],
	"modality": {
        "code": "0203"
    }
}
```

**Chave Pix**

```json title='Request Body'
{
	"borrower": {
		"name": "Nome do Devedor",
		"email": "email@email.com",
		"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"
		},
		"role_type": "issuer",
		"birth_date": "1969-05-01",
		"mother_name": "Nome da Mãe do Devedor",
		"person_type": "natural",
		"individual_document_number": "12345678911",
		"gender": "male",
		"nationality": "brasileiro",
		"is_pep": false,
		"marital_status": "married"
	},
	"financial": {
		"disbursed_amount": 80492.95,
		"annual_interest_rate": 0.20983,
		"credit_operation_type": "ccb",
		"disbursement_date": "2023-03-17",
		"issue_date": "2023-03-17",
		"fine_configuration": {
			"contract_fine_rate": 0,
			"interest_base": "workdays",
			"monthly_rate": 0
		},
		"interest_grace_period": 0,
		"interest_type": "pre_price_days",
		"number_of_installments": 1,
		"principal_grace_period": 0,
		"first_due_date_delay": 5
	},
	"simplified": true,
	"additional_data": {
		"debt_payment": [{
			"bank_slip": [],
			"funds_transfer": [],
			"pix": [{
				"amount": "4736,07",
				"account_digit": "0",
				"account_branch": "0897",
				"account_number": "20001",
				"financial_institution_code_number": "341",
				"ispb": "60701190"
			}],
			"financial_institution_code_number": "341"
		}],
		"issuer_account": {
			"account_digit": "0",
			"account_branch": "0491",
			"account_number": "100021100",
			"financial_institution_code_number": "104"
		},
		"total_af_amount": 86186.52
	},
	"requester_identifier_key": "7ac52492-61c0-4dd6-a414-b0bf940fb7ca",
	"disbursement_bank_account": {
		"bank_code": "329",
		"account_digit": "3",
		"branch_number": "0001",
		"account_number": "1234567"
	},
	"after_disbursement_actions": [{
		"action_data": {
			"pix_transfer_type": "key",
			"pix_key": "cahvepix@credororiginal.com.br",
			"transaction_amount": 4736.07
		},
		"action_type": "pix"
	}],
	"modality": {
        "code": "0203"
    }
}
```

**Pix Manual**

```json title='Request Body'
{
	"borrower": {
		"name": "Nome do Devedor",
		"email": "email@email.com",
		"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"
		},
		"role_type": "issuer",
		"birth_date": "1969-05-01",
		"mother_name": "Nome da Mãe do Devedor",
		"person_type": "natural",
		"individual_document_number": "12345678911",
		"gender": "male",
		"nationality": "brasileiro",
		"is_pep": false,
		"marital_status": "married"
	},
	"financial": {
		"disbursed_amount": 80492.95,
		"annual_interest_rate": 0.20983,
		"credit_operation_type": "ccb",
		"disbursement_date": "2023-03-17",
		"issue_date": "2023-03-17",
		"fine_configuration": {
			"contract_fine_rate": 0,
			"interest_base": "workdays",
			"monthly_rate": 0
		},
		"interest_grace_period": 0,
		"interest_type": "pre_price_days",
		"number_of_installments": 1,
		"principal_grace_period": 0,
		"first_due_date_delay": 5
	},
	"simplified": true,
	"additional_data": {
		"debt_payment": [{
			"bank_slip": [],
			"funds_transfer": [],
			"pix": [{
				"amount": "4736,07",
				"account_digit": "0",
				"account_branch": "0897",
				"account_number": "20001",
				"financial_institution_code_number": "341",
				"ispb": "60701190"
			}],
			"financial_institution_code_number": "341"
		}],
		"issuer_account": {
			"account_digit": "0",
			"account_branch": "0491",
			"account_number": "100021100",
			"financial_institution_code_number": "104"
		},
		"total_af_amount": 86186.52
	},
	"requester_identifier_key": "7ac52492-61c0-4dd6-a414-b0bf940fb7ca",
	"disbursement_bank_account": {
		"bank_code": "329",
		"account_digit": "3",
		"branch_number": "0001",
		"account_number": "1234567"
	},
	"after_disbursement_actions": [{
		"action_data": {
			"pix_transfer_type": "manual",
			"target_account": {
			    "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
		},
		"action_type": "pix"
	}],
	"modality": {
        "code": "0203"
    }
}
```
  

**QrCode Pix**

```json title='Request Body'
{
    "borrower": {
		"name": "Nome do Devedor",
		"email": "email@email.com",
		"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"
		},
		"role_type": "issuer",
		"birth_date": "1969-05-01",
		"mother_name": "Nome da Mãe do Devedor",
		"person_type": "natural",
		"individual_document_number": "12345678911",
		"gender": "male",
		"nationality": "brasileiro",
		"is_pep": false,
		"marital_status": "married"
	},
	"financial": {
		"disbursed_amount": 80492.95,
		"annual_interest_rate": 0.20983,
		"credit_operation_type": "ccb",
		"disbursement_date": "2023-03-17",
		"issue_date": "2023-03-17",
		"fine_configuration": {
			"contract_fine_rate": 0,
			"interest_base": "workdays",
			"monthly_rate": 0
		},
		"interest_grace_period": 0,
		"interest_type": "pre_price_days",
		"number_of_installments": 1,
		"principal_grace_period": 0,
		"first_due_date_delay": 5
	},
	"simplified": true,
	"additional_data": {
		"debt_payment": [{
			"bank_slip": [],
			"funds_transfer": [],
			"pix": [{
				"amount": "4736,07",
				"account_digit": "0",
				"account_branch": "0897",
				"account_number": "20001",
				"financial_institution_code_number": "341",
				"ispb": "60701190"
			}],
			"financial_institution_code_number": "341"
		}],
		"issuer_account": {
			"account_digit": "0",
			"account_branch": "0491",
			"account_number": "100021100",
			"financial_institution_code_number": "104"
		},
		"total_af_amount": 86186.52
	},
	"requester_identifier_key": "7ac52492-61c0-4dd6-a414-b0bf940fb7ca",
	"disbursement_bank_account": {
		"bank_code": "329",
		"account_digit": "3",
		"branch_number": "0001",
		"account_number": "1234567"
	},
	"after_disbursement_actions": [{
		"action_data": {
			"pix_transfer_type": "qr_code",
			"qr_code": "00020126870014br.gov.bcb.pix2565qrcode.qitech.app/bacen/cobv/4ec760c4-b950-4afd-af10-92c1bb7804015204000053039865802BR5925SECURITIZADORA DE CREDITO6009SAO PAULO61080540700362070503***63042FA4"
		},
		"action_type": "pix"
	}],
	"modality": {
        "code": "0203"
    }
}
```
    

#### Enumeradores Marital Status
| Enumerador   | Descrição     |
|--------------|---------------|
| **single**   | Solteiro(a)   |
| **married**  | Casado(a)     |
| **widower**  | Viúvo(a)      |
| **divorced** | Divorciado(a) |

#### Erro 5xx ou Timeout

Caso seja retornado algum 5xx ou Timeout na requisição, afim de certificar que a operação de fato não foi criada na QI, é recomendado que o parceiro realize uma consulta da operação que teve retorno 5xx ou timeout.

ENDPOINT /debt?requester_identifier_key=34427233-925d-416d-93eb-c7f5084e8359
MÉTODO GET

Caso o retorno do GET seja um 200, o parceiro não deve retentar a criação da operação e seguir o fluxo da operação.
Caso seja retornado um 404 - Not Found, o parceiro deve retentar a criação da operação.

STATUS 200

```json title='Response Body'
{
	"data": {
		"additional_iof": 307.166388,
		"annual_cet": "60,4731%",
		"assignment_amount": 80833.26,
		"base_iof": 33.141637696905995,
		"borrower": {
			"document_number": "12345678911",
			"name": "Nome do Devedor"
		},
		"cet": "4,0200%",
		"collaterals": [],
		"contract": {
			"external_contract_key": "351eada5-a626-404c-a3a3-f91c123270ce",
			"number": "0000000001/NDD",
			"signature_information": [{
				"signature_url": "https://sign.qitech.com.br/s/hNrwjda",
				"signer_document_number": "12345678911",
				"signer_email": "email@email.com",
				"signer_external_key": "56d105f3-a7f6-4442-95e9-71f44d2ae5fc",
				"signer_name": "Nome do Devedor",
				"signer_role": "issuer"
			}],
			"urls": [
				"https://storage.googleapis.com/live-doc-api/documents/45e5b9c0-0f56-40a8-aace-d206f72c164d/QISCD-NOME_DO_DEVEDOR-CCB-0001212121-20230317194512.pdf"
			]
		},
		"contract_fee_amount": 0,
		"contract_fees": [],
		"external_contract_fee_amount": 0,
		"external_contract_fees": [],
		"installments": [{
			"accrual_reference_date": null,
			"additional_costs": [],
			"advanced_paid_amount": 0,
			"bank_slip_key": null,
			"business_due_date": "2023-03-22",
			"calendar_days": 5,
			"digitable_line": null,
			"due_date": "2023-03-22",
			"due_interest": 0,
			"due_principal": 80833.26,
			"fine_amount": null,
			"has_interest": true,
			"installment_history": [],
			"installment_key": "75460851-2e82-4e3d-a805-b3e55b6b31d4",
			"installment_number": 1,
			"installment_payment": [],
			"installment_status": "created",
			"installment_type": "principal",
			"original_due_principal": 80833.26,
			"original_pre_fixed_amount": 183.5073246195304,
			"original_principal_amortization_amount": 80833.26267538047,
			"original_total_amount": 81016.77,
			"paid_amount": 0,
			"paid_at": null,
			"post_fixed_amount": 0,
			"pre_fixed_amount": 183.5073246195304,
			"principal_amortization_amount": 80833.26267538047,
			"qr_code_key": null,
			"qr_code_url": null,
			"renegotiation_proposal_key": null,
			"tax_amount": 33.141637696905995,
			"total_accrual_amount": null,
			"total_amount": 81016.77,
			"total_paid_amount": 0,
			"workdays": 3
		}],
		"iof_charge_method": "financed",
		"issue_amount": 80833.26,
		"net_external_contract_fee_amount": 0,
		"number_of_installments": 1,
		"prefixed_interest_rate": {
			"annual_rate": 0.20983,
			"created_at": "2023-03-17T19:45:11",
			"daily_rate": 0.00075616,
			"interest_base": "workdays",
			"monthly_rate": 0.01599997
		},
		"requester_identifier_key": "34427233-925d-416d-93eb-c7f5084e8359",
		"total_iof": 340.31,
		"total_pre_fixed_amount": 183.5073246195304
	},
	"event_datetime": "2023-03-17 19:45:19",
	"key": "052fe83c-37f6-4339-a831-127b50566745",
	"status": "waiting_signature",
	"webhook_type": "debt"
}
```

:::info Informação
O campo "key" da resposta de criação da operação é a **DEBT-KEY**, que é a chave única da operação dentro da QI.
:::

#### Assinatura

**Mesmo procedimento de assinatura ativo para a operação de SIAPE ML**

#### Autorizar desembolso

Após assinatura da operação, é necessário autorizar a operação para desembolso.

:::danger Atenção
A autorização de desembolso da Operação de Crédito Pessoal, deve ser enviada após o recebimento do webhook de confirmação da digitação da proposta no SIAPE. 
:::

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

```json title='Request Body'
{
	"allow_disbursement": true
}
```

#### Desembolso

Após ser assinada e autorizada para desembolso, a operação seguirá automaticamente para esteira de desembolso.

Após o desembolso ser processado o parceiro receberá o seguinte webhook:

#### Sucesso no desembolso

WEBHOOK_TYPE debt
STATUS Disbursed

```json title='Webhook Body'
{
	"key": "052fe83c-37f6-4339-a831-127b50566745",
	"data": {
		"installments": [{
			"due_date": "2023-03-22",
			"total_amount": 81016.77,
			"installment_key": "75460851-2e82-4e3d-a805-b3e55b6b31d4",
			"pre_fixed_amount": 183.5073246195304,
			"principal_amortization_amount": 80833.26267538047
		}],
		"ted_receipt_list": []
	},
	"status": "disbursed",
	"webhook_type": "debt",
	"event_datetime": "2023-03-17 13:20:40"
}
```

#### Ações pós-desembolso

Após o desembolso da Operação de Crédito Pessoal na conta do devedor criada na QI, serão executados os pagamentos de boleto/TED/Pix referente à quitação do saldo devedor da dívida original do devedor (ações pós-desembolso)

#### Sucesso

WEBHOOK_TYPE after_disbursement_action_update
STATUS Success

**Boleto**

```json title='Webhook Body'
{
	"key": "3bce3113-3644-4491-b87a-fe6551edff70",
	"data": {
		"status": "done",
		"action_key": "d25097e2-09f1-47fc-8b7f-d1988b1a7669",
		"error_data": null,
		"action_data": {
			"digitable_line": "10495419967200010004900031456924592920008049295"
		},
		"action_type": "bankslip_payment",
		"execution_data": {
			"bank_slip": {
				"payer": {
					"name": "Nome do Devedor",
					"document_number": "12345678911",
					"document_number_formatted": "123.456.789-11"
				},
				"beneficiary": {
					"name": "CAIXA ECONÔMICA FEDERAL",
					"document_number": "00360305000104",
					"document_number_formatted": "00.360.305/0001-04"
				},
				"payment_key": "500a496e-4cca-4b12-9dc8-254932ebbcac",
				"payment_date": "2023-03-08",
				"digitable_line": "10495419967200010004900031456924592920008049295",
				"expiration_date": "2023-03-10",
				"payment_date_formatted": "08/03/2023",
				"expiration_date_formatted": "10/03/2023",
				"financial_institution_name": "CAIXA ECONÔMICA FEDERAL",
				"financial_institution_compe_number": "104"
			},
			"origin_key": "dfac205a-bdef-4820-8608-2dc81d9e10d4",
			"transacted_at": "2023-03-08 16:07:58",
			"source_account": {
				"owner_name": "Nome do Devedor",
				"account_digit": "3",
				"account_branch": "0001",
				"account_number": "1234567",
				"owner_document_number": "12345678911",
				"financial_institution_name": "QI SCD S.A.",
				"owner_document_number_formatted": "123.456.789-11",
				"financial_institution_compe_number": 329
			},
			"source_subtype": "bank_slip_payment",
			"transaction_key": "86a4320d-a69d-4c14-8300-9a6f22d35fcb",
			"transacted_at_br": "2023-03-08 13:07:58",
			"pdf_encoded_string": "\<BASE 64 DO PDF DO COMPROVANTE\>",
			"transaction_amount": 3864.95,
			"transacted_at_formatted": "08/03/2023, 16:07:58",
			"transacted_at_br_formatted": "08/03/2023, 13:07:58",
			"transaction_amount_formatted": "R$ 3.864,95",
			"source_subtype_translation_ptbr": "Pagamento de Boleto"
		}
	},
	"webhook_type": "after_disbursement_action_update",
	"event_datetime": "2023-03-08 16:08:02"
}
```

**TED**

```json title='Webhook Body'
{
	"key": "1f13c154-4164-412d-b3f3-00b7af7b18ee",
	"data": {
		"status": "done",
		"action_key": "a7a2c87d-b882-4680-ae58-9a5292d26788",
		"error_data": null,
		"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": 520
		},
		"action_type": "funds_transfer",
		"execution_data": {
			"origin_key": "f786dc97-faaa-40d8-9818-c8dc184bf131",
			"transacted_at": "2023-03-23 16:48:27",
			"source_account": {
				"owner_name": "Nome do Devedor",
				"account_digit": "3",
				"account_branch": "0001",
				"account_number": "1234567",
				"owner_document_number": "12345678911",
				"financial_institution_name": "QI SCD S.A.",
				"owner_document_number_formatted": "123.456.789-11",
				"financial_institution_compe_number": 329
			},
			"source_subtype": "withdrawal",
			"target_account": {	
				"owner_name": "Nome Credor Original",
				"account_type": "checking_account",
				"account_digit": "0",
				"account_branch": "0897",
				"account_number": "20001",
				"account_type_str": "Conta Corrente",
				"owner_document_number": "87163234000138",
				"financial_institution_name": "ITAÚ UNIBANCO S.A.",
				"owner_document_number_formatted": "87.163.234/0001-38",
				"financial_institution_compe_number": "341"
			},
			"transaction_key": "b8993075-9ede-4073-be2d-6130b052f888",
			"transacted_at_br": "2023-03-23 13:48:27",
			"pdf_encoded_string": "\<BASE 64 DO PDF DO COMPROVANTE\>",
			"transaction_amount": 520.0,
			"transacted_at_formatted": "23/03/2023, 16:48:27",
			"transacted_at_br_formatted": "23/03/2023, 13:48:27",
			"transaction_amount_formatted": "R$ 520,00",
			"source_subtype_translation_ptbr": "Transferência"
		}
	},
	"webhook_type": "after_disbursement_action_update",
	"event_datetime": "2023-03-23 16:48:31"
}
```

  

#### Erro na ação pós-desembolso

Em caso de erro no pagamento da ação pós-desembolso, o parceiro será notificado através do seguinte 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"
}
```

#### Estorno da TED da ação pós-desembolso

Caso a TED realizada na ação pós-desembolso seja devolvida pela instituição financeira destinatária, o parceiro será notificado através do seguinte 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"
}
```

#### Retentar ação pós-desembolso com falha

Caso ocorra um erro/estorno no pagamento da ação pós-desembolso, ela pode ser retentada através do seguinte endpoint [/baas/action/**[ACTION-KEY]**](/documentation/emissao_de_divida/reprocessar_acao_pos_desembolso)

### Emissão da Operação de Crédito Consignado do SIAPE

A Operação de Crédito Consignado do SIAPE deve quitar a Operação de Crédito Pessoal e liberar (caso exista) o troco para o cliente

#### Request

ENDPOINT /debt
MÉTODO POST

**Digitação Margem Livre**

```json title='Request Body'
{
    "borrower": {
		"name": "Nome do Devedor",
		"email": "email@email.com",
		"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"
		},
		"role_type": "issuer",
		"birth_date": "1969-05-01",
		"mother_name": "Nome da Mãe do Devedor",
		"person_type": "natural",
		"individual_document_number": "12345678911",
		"gender": "male",
		"nationality": "brasileiro",
		"is_pep": false,
		"marital_status": "married"
	},
    "financial": {
        "first_due_date": "2023-05-07",
        "installment_face_value": 100.0,
        "disbursement_date": "2023-03-22",
        "limit_days_to_disburse": 3,
        "number_of_installments": 96,
        "monthly_interest_rate": 0.0205,
        "interest_type": "pre_price_days",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "principal_grace_period": 0
    },
    "simplified": true,
    "collaterals": [{
        "percentage": 1,
        "collateral_data": {
            "reservation_type": "new_credit",
            "authority_code": "17000",
            "pensioner_registration_code": "",
            "registration_code": "12345678",
			"authority": {
				"description": "teste",
				"authority_document_number": "1234"
			}
        },
        "collateral_type": "federal_payroll"
    }],
    "requester_identifier_key": "13176f51-3cc8-46a3-96e9-df59d7e3960c",
    "disbursement_bank_account": {
		"bank_code": "329",
		"account_digit": "3",
		"branch_number": "0001",
		"account_number": "1234567"
	},
    "purchaser_document_number": "32402502000135",
	"modality": {
        "code": "0202"
    },
    "refinanced_credit_operations": [
        {
            "operation_key": "052fe83c-37f6-4339-a831-127b50566745"
        }
    ]
}
```
**Digitação Portabilidade**

```json title='Request Body'
{
    "borrower": {
		"name": "Nome do Devedor",
		"email": "email@email.com",
		"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"
		},
		"role_type": "issuer",
		"birth_date": "1969-05-01",
		"mother_name": "Nome da Mãe do Devedor",
		"person_type": "natural",
		"individual_document_number": "12345678911",
		"gender": "male",
		"nationality": "brasileiro",
		"is_pep": false,
		"marital_status": "married"
	},
    "financial": {
        "first_due_date": "2023-05-07",
        "installment_face_value": 100.0,
        "disbursement_date": "2023-03-22",
        "limit_days_to_disburse": 3,
        "number_of_installments": 96,
        "monthly_interest_rate": 0.0205,
        "interest_type": "pre_price_days",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "principal_grace_period": 0
    },
    "simplified": true,
    "collaterals": [{
        "percentage": 1,
        "collateral_data": {
	 "reservation_method": "creation",
            "authority": {
		"description": "",
                "authority_document_number": ""
		},
            "reservation_type": "portability",
            "authority_code": "17000",
            "pensioner_registration_code": "",
            "registration_code": "12345678",
            "portability_data": {
                "start_date": "",
                "control_number": "",
                "origin_contract": {
                    "contract_number": "",
                    "financial_institution_document_number": ""
                }
            }
        },
        "collateral_type": "federal_payroll"
    }],
    "requester_identifier_key": "13176f51-3cc8-46a3-96e9-df59d7e3960c",
    "disbursement_bank_account": {
		"bank_code": "329",
		"account_digit": "3",
		"branch_number": "0001",
		"account_number": "1234567"
	},
    "purchaser_document_number": "32402502000135",
	"modality": {
        "code": "0202"
    },
    "refinanced_credit_operations": [
        {
            "operation_key": "052fe83c-37f6-4339-a831-127b50566745"
        }
    ]
}
```

#### Response

STATUS 200

```json title='Response Body'
{
    "data": {
        "borrower": {
            "document_number": "12345678911",
            "name": "Nome do Devedor",
            "related_party_key": "c5584ee3-e077-41dc-a28e-c2ba97390bf1"
        },
        "collaterals": [{
            "absolute_amount": null,
            "collateral_constituted": false,
            "collateral_data": {
                "authority_code": "17000",
                "pensioner_registration_code": null,
                "registration_code": "12345678"
            },
            "collateral_key": "5e40c191-06ae-4da2-9d4b-3c0bf6eeb1a3",
            "collateral_type": "federal_payroll",
            "created_at": "2023-03-17T20:56:09.200482",
            "external_key": "8cda40d8-1593-4a1e-938f-5e1488e734d8",
            "percentage": 1,
            "updated_at": "2023-03-17T20:56:09.200474"
        }],
        "contract": {
            "number": "0000000002/NDD",
            "signature_information": [{
                "signature_url": null,
                "signer_document_number": "12345678911",
                "signer_email": "email@email.com",
                "signer_external_key": null,
                "signer_name": "Nome do Devedor",
                "signer_role": "issuer"
            }],
            "urls": [
                "https://storage.googleapis.com/live-doc-api/documents/45e5b9c0-0f56-40a8-aace-d206f72c164d/QISCD-NOME_DO_DEVEDOR-CCB-0000000002-20230317183044.pdf"
            ]
        },
        "disbursement_options": [{
                "additional_iof": 24.220242,
                "annual_cet": "26.1457%",
                "assignment_amount": 3205.12,
                "base_iof": 176.6603785598479778,
                "cet": "1,9544%",
                "contract_fee_amount": 17.68,
                "contract_fees": [{
                    "amount": 17.68,
                    "amount_type": "absolute",
                    "fee_amount": 17.68,
                    "fee_type": "spread_cip_cost"
                }],
                "disbursement_date": "2023-03-22",
                "external_contract_fee_amount": 0,
                "external_contract_fees": [],
                "first_due_date": "2023-05-07",
                "installments": [{
                        "additional_costs": [],
                        "business_due_date": "2022-05-08",
                        "calendar_days": 34,
                        "due_date": "2023-05-07",
                        "due_interest": 0,
                        "due_principal": 3187.44,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "installment_status": null,
                        "installment_type": null,
                        "post_fixed_amount": 0,
                        "pre_fixed_amount": 64.20069301315790,
                        "principal_amortization_amount": 35.79930698684210,
                        "tax_amount": 0.10014353287723266,
                        "total_amount": 100,
                        "workdays": 23
                    }, 
                    ... 
                    x 96
                ],
                "issue_amount": 3187.44,
                "net_external_contract_fee_amount": 0,
                "total_iof": 100.44,
                "total_pre_fixed_amount": 3225.1656904289435
            },
            ...
            x 15
        ],
        "iof_charge_method": "financed",
        "requester_identifier_key": "13176f51-3cc8-46a3-96e9-df59d7e3960c"
    },
    "event_datetime": "2023-03-17 13:54:58",
    "key": "32f99efe-7654-4e74-a509-c7413341a831",
    "status": "waiting_signature",
    "webhook_type": "debt"
}
```

#### Webhook de Anuência Pendente

WEBHOOK_TYPE credit_operation.collateral
STATUS Pending Consent

Body

```json
{
	"key": "\<DEBT-KEY\>",
	"data": {
        "collateral_data": {
			"reservation_status": "pending_consent"
		},
		"collateral_type": "federal_payroll",
		"collateral_constituted": false
	},
	"event_time": "2022-10-31 15:23:46",
	"webhook_type": "credit_operation.collateral"
}
```

#### Averbação

Após a criação da Operação de Crédito Consignado do SIAPE, a QI iniciará o processo de averbação da operação.

O processo de tentativa de averbação inicia no momento da criação da operação, e será retentado até a última data de opção de desembolso da operação.

Assim que a digitação for concluída  a QI informará o parceiro sobre a pendência de anuência da averbação:

WEBHOOK_TYPE credit_operation.collateral
STATUS Pending Consent

Body

```json
{
	"key": "\<DEBT-KEY\>",
	"data": {
        "collateral_data": {
			"reservation_status": "pending_consent"
		},
		"collateral_type": "federal_payroll",
		"collateral_constituted": false
	},
	"event_time": "2022-10-31 15:23:46",
	"webhook_type": "credit_operation.collateral"
}
```

A após a conclusão da anuência e confirmação da averbação da margem, a QI notificará o parceiro através do seguinte webhook:

WEBHOOK_TYPE credit_operation.collateral
STATUS Success

```json title='Webhook Body'
{
    "key": "32f99efe-7654-4e74-a509-c7413341a831",
    "data": {
        "collateral_type": "federal_payroll",
        "collateral_constituted": true
    },
    "event_time": "2022-03-22 15:23:46",
    "webhook_type": "credit_operation.collateral"
}
```

---

### Emissão da Operação de Crédito Consignado do Exército

A Operação de Crédito Consignado do Exército deve quitar a Operação de Crédito Pessoal e liberar (caso exista) o troco para o cliente

#### Request

ENDPOINT /debt
MÉTODO POST

**Digitação Portabilidade (Deprecada a partir de 30/11/2023)**

```json title='Request Body'
{
    "borrower": {
		"name": "Nome do Devedor",
		"email": "email@email.com",
		"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"
		},
		"role_type": "issuer",
		"birth_date": "1969-05-01",
		"mother_name": "Nome da Mãe do Devedor",
		"person_type": "natural",
		"individual_document_number": "12345678911",
		"gender": "male",
		"nationality": "brasileiro",
		"is_pep": false,
		"marital_status": "married"
	},
    "financial": {
        "first_due_date": "2023-05-07",
        "installment_face_value": 100.0,
        "disbursement_date": "2023-03-22",
        "limit_days_to_disburse": 3,
        "number_of_installments": 72,
        "monthly_interest_rate": 0.017,
        "interest_type": "pre_price_days",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "principal_grace_period": 0
    },
    "simplified": true,
    "collaterals": [{
        "percentage": 1,
        "collateral_data": {
            "reservation_type": "portability",
            "portability_data":{
                "token":"hw342y1h24",
                "origin_econsig_id":"2016587"
            },
            "registration_code": "12345678",
			"reservation_method": "creation"
        },
        "collateral_type": "military_payroll" 
    }],
    "requester_identifier_key": "7e000c2d-d381-470e-b233-416097504866",
    "disbursement_bank_account": {
		"bank_code": "341",
		"account_digit": "3",
		"branch_number": "1234",
		"account_number": "1234567"
	},
    "purchaser_document_number": "32402502000135",
	"modality": {
        "code": "0202"
    },
    "refinanced_credit_operations": [
        {
            "operation_key": "d2fd3f63-3d11-42a8-ab5c-9a84b5c58b6c"
        }
    ]
}
```

**Digitação Portabilidade(s) (Vigente a partir de 21/11/2023)**

```json title='Request Body'
{
    "borrower": {
		"name": "Nome do Devedor",
		"email": "email@email.com",
		"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"
		},
		"role_type": "issuer",
		"birth_date": "1969-05-01",
		"mother_name": "Nome da Mãe do Devedor",
		"person_type": "natural",
		"individual_document_number": "12345678911",
		"gender": "male",
		"nationality": "brasileiro",
		"is_pep": false,
		"marital_status": "married"
	},
    "financial": {
        "first_due_date": "2023-05-07",
        "installment_face_value": 100.0,
        "disbursement_date": "2023-03-22",
        "limit_days_to_disburse": 3,
        "number_of_installments": 72,
        "monthly_interest_rate": 0.017,
        "interest_type": "pre_price_days",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "principal_grace_period": 0
    },
    "simplified": true,
    "collaterals": [{
        "percentage": 1,
        "collateral_data": {
            "reservation_type": "portability",
            "portability_data":{
                "token":"hw342y1h24",
                "origin_econsig_ids": [
					"2016587",
					"2016588",
					"2016589",
				]
            },
            "registration_code": "12345678",
			"reservation_method": "creation"
        },
        "collateral_type": "military_payroll" 
    }],
    "requester_identifier_key": "7e000c2d-d381-470e-b233-416097504866",
    "disbursement_bank_account": {
		"bank_code": "341",
		"account_digit": "3",
		"branch_number": "1234",
		"account_number": "1234567"
	},
    "purchaser_document_number": "32402502000135",
	"modality": {
        "code": "0202"
    },
    "refinanced_credit_operations": [
        {
            "operation_key": "d2fd3f63-3d11-42a8-ab5c-9a84b5c58b6c"
        }
    ]
}
```

**Digitação Margem Livre**

```json title='Request Body'
{
    "borrower": {
		"name": "Nome do Devedor",
		"email": "email@email.com",
		"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"
		},
		"role_type": "issuer",
		"birth_date": "1969-05-01",
		"mother_name": "Nome da Mãe do Devedor",
		"person_type": "natural",
		"individual_document_number": "12345678911",
		"gender": "male",
		"nationality": "brasileiro",
		"is_pep": false,
		"marital_status": "married"
	},
    "financial": {
        "first_due_date": "2023-05-07",
        "installment_face_value": 100.0,
        "disbursement_date": "2023-03-22",
        "limit_days_to_disburse": 3,
        "number_of_installments": 72,
        "monthly_interest_rate": 0.017,
        "interest_type": "pre_price_days",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "principal_grace_period": 0
    },
    "simplified": true,
    "collaterals": [{
        "percentage": 1,
        "collateral_data": {
            "reservation_type": "new_credit",
            "registration_code": "123456789",
			"reservation_method": "creation"
        },
        "collateral_type": "military_payroll"
    }],
    "requester_identifier_key": "7e000c2d-d381-470e-b233-416097504866",
    "disbursement_bank_account": {
		"bank_code": "341",
		"account_digit": "3",
		"branch_number": "1234",
		"account_number": "1234567"
	},
    "purchaser_document_number": "32402502000135",
	"modality": {
        "code": "0202"
    },
    "refinanced_credit_operations": [
        {
            "operation_key": "d2fd3f63-3d11-42a8-ab5c-9a84b5c58b6c"
        }
    ]
}
```

**Digitação Refinanciamento**

```json title='Request Body'
{
    "borrower": {
		"name": "Nome do Devedor",
		"email": "email@email.com",
		"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"
		},
		"role_type": "issuer",
		"birth_date": "1969-05-01",
		"mother_name": "Nome da Mãe do Devedor",
		"person_type": "natural",
		"individual_document_number": "12345678911",
		"gender": "male",
		"nationality": "brasileiro",
		"is_pep": false,
		"marital_status": "married"
	},
    "financial": {
        "first_due_date": "2023-05-07",
        "installment_face_value": 100.0,
        "disbursement_date": "2023-03-22",
        "limit_days_to_disburse": 3,
        "number_of_installments": 72,
        "monthly_interest_rate": 0.017,
        "interest_type": "pre_price_days",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "principal_grace_period": 0
    },
    "simplified": true,
    "collaterals": [{
        "percentage": 1,
        "collateral_data": {
            "reservation_type": "refinancing",
            "registration_code": "123456789",
			"reservation_method": "issuing"
        },
        "collateral_type": "military_payroll"
    }],
    "requester_identifier_key": "7e000c2d-d381-470e-b233-416097504866",
    "disbursement_bank_account": {
		"bank_code": "341",
		"account_digit": "3",
		"branch_number": "1234",
		"account_number": "1234567"
	},
    "purchaser_document_number": "32402502000135",
	"modality": {
        "code": "0202"
    },
    "refinanced_credit_operations": [
        {
            "operation_key": "d2fd3f63-3d11-42a8-ab5c-9a84b5c58b6c"
        }
    ]
}
```

### Detalhamento de campos no objeto collateral_data
| Campo             	| Descrição             						| Valores  												|
|-----------------------|-----------------------------------------------|-------------------------------------------------------|
| reservation_type		| Tipo da reserva								| [Enumeradores](#reservation_type_enumerator)			|
| registration_code		| Matrícula do militar							| 123456789               								|
| reservation_method	| Determina quando deve-se iniciar a tentativa de averbação do consignado, seja no momento da criação da operação de crédito ou no momento da emissão da mesma.	| [Enumeradores](#reservation_method_enumerator)		|
| portability_data  	| Dados de portabilidade						| [Objeto de Portabilidade](#portability_data_object)	|

### Tabela de tipos de reserva {#reservation_type_enumerator}
| Enumerador  | Descrição 		|
|-------------|-----------------|
| new_credit  | Crédito Novo 	|
| portability | Portabilidade 	|
| refinancing | Refinanciamento |

### Tabela de metodos de criação de reserva {#reservation_method_enumerator}

:::caution Atenção
Campo muito importante, pois ele determina diretamente quando o pedido de intensão de reserva na Zetra será feito.
:::

| Enumerator 	| Descrição                                     																		|
|---------------|-----------------------------------------------------------------------------------------------------------------------|
| creation		| A tentativa de averbação começará quando a operação de crédito for criada.											|
| issuing		| A tentativa de averbação começará quando a operação de crédito for emitida, ou seja, após a formalização da mesma.	|

### Detalhamento de campos no objeto portability_data {#portability_data_object}
| Campo             	| Descrição             									| Valores  						|
|-----------------------|-----------------------------------------------------------|-------------------------------|
| token             	| Senha fornecida pelo militar								| 1234abcd  					|
| origin_econsig_id		| Código identificador de contrato da Zetra					| 1234567						|
| origin_econsig_ids	| Lista de códigos identificadores de contratos da Zetra	| [1234567, 1234568, 1234569]	|

#### Response

STATUS 200

```json title='Response Body'
{
    "data": {
        "borrower": {
            "document_number": "12345678911",
            "name": "Nome do Devedor",
            "related_party_key": "1fe936e7-0917-4c3d-9206-87958254fa1d"
        },
        "collaterals": [{
            "absolute_amount": null,
            "collateral_constituted": false,
            "collateral_data": {
                "reservation_type": "new_credit",
                "registration_code": "123456789"
            },
            "collateral_key": "c6006572-d66a-45f6-862d-4ecb5b9b5d2d",
            "collateral_type": "military_payroll",
            "created_at": "2023-03-17T20:56:09.200482",
            "external_key": "1c736cd8-a4c7-43d4-8abd-c00ed0cd6450",
            "percentage": 1,
            "updated_at": "2023-03-17T20:56:09.200474"
        }],
        "contract": {
            "number": "0000000003/NDD",
            "signature_information": [{
                "signature_url": null,
                "signer_document_number": "12345678911",
                "signer_email": "email@email.com",
                "signer_external_key": null,
                "signer_name": "Nome do Devedor",
                "signer_role": "issuer"
            }],
            "urls": [
                "https://storage.googleapis.com/live-doc-api/documents/ae66d0cd-1054-4ff5-b1d6-e03aaaa2ff1b/QISCD-NOME_DO_DEVEDOR-CCB-0000000002-20230317183044.pdf"
            ]
        },
        "disbursement_options": [{
                "additional_iof": 24.220242,
                "annual_cet": "26.1457%",
                "assignment_amount": 3205.12,
                "base_iof": 176.6603785598479778,
                "cet": "1,9544%",
                "contract_fee_amount": 17.68,
                "contract_fees": [{
                    "amount": 17.68,
                    "amount_type": "absolute",
                    "fee_amount": 17.68,
                    "fee_type": "spread_cip_cost"
                }],
                "disbursement_date": "2023-03-22",
                "external_contract_fee_amount": 0,
                "external_contract_fees": [],
                "first_due_date": "2023-05-07",
                "installments": [{
                        "additional_costs": [],
                        "business_due_date": "2022-05-08",
                        "calendar_days": 34,
                        "due_date": "2023-05-07",
                        "due_interest": 0,
                        "due_principal": 3187.44,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "installment_status": null,
                        "installment_type": null,
                        "post_fixed_amount": 0,
                        "pre_fixed_amount": 64.20069301315790,
                        "principal_amortization_amount": 35.79930698684210,
                        "tax_amount": 0.10014353287723266,
                        "total_amount": 100,
                        "workdays": 23
                    }, 
                    ... 
                    x 96
                ],
                "issue_amount": 3187.44,
                "net_external_contract_fee_amount": 0,
                "total_iof": 100.44,
                "total_pre_fixed_amount": 3225.1656904289435
            },
            ...
            x 15
        ],
        "iof_charge_method": "financed",
        "requester_identifier_key": "f7fa079e-e02f-469f-a9ba-7a550f8f665f"
    },
    "event_datetime": "2023-03-17 13:54:58",
    "key": "23c89acf-b11b-4988-b738-a0f5ba238c33",
    "status": "waiting_signature",
    "webhook_type": "debt"
}
```

#### Averbação

Após a criação da Operação de Crédito Consignado do EXÉRCITO, a QI iniciará o processo de averbação da operação.

O processo de tentativa de averbação inicia no momento da criação da operação, e será retentado até a última data de opção de desembolso da operação.

A após a conclusão da averbação da margem consignável do exército, a QI notificará o parceiro através do seguinte webhook:

WEBHOOK_TYPE credit_operation.collateral
STATUS Success

```json title='Webhook Body'
{
    "key": "23c89acf-b11b-4988-b738-a0f5ba238c33",
    "data": {
        "collateral_type": "military_payroll",
        "collateral_constituted": true
    },
    "event_time": "2022-10-31 15:23:46",
    "webhook_type": "credit_operation.collateral"
}
```
Caso o token informado não seja válido, enviaremos o seguinte webhook. Esse webhook também será enviado caso o token informado já tenha sido utilizado e seja necessário um novo.

WEBHOOK_TYPE credit_operation.collateral
STATUS Pending Valid Token

```json title='Webhook Body'
{
    "key": "23c89acf-b11b-4988-b738-a0f5ba238c33",
    "data": {
		"collateral_type": "military_payroll",
		"collateral_data": {
			"reservation_status": "pending_valid_token",
			"cancel_reason": "invalid_token",
		},
		"collateral_constituted": false,
    },
    "event_time": "2022-10-31 15:23:46",
    "webhook_type": "credit_operation.collateral"
}
```

#### Resposta que ocasionam cancelamento automático

Dependendo da resposta da Zetra, a operação será cancelada automaticamente.
Quando isso ocorrer enviaremos um webhook no formato abaixo, o motivo do cancelamento é informado no campo "cancel_reason"

WEBHOOK_TYPE credit_operation.collateral
STATUS Canceled

```json title='Webhook Body'
{
	"data": {
		"cancel_reason": "Contrato de origem não encontrato.",
		"cancel_reason_enumerator": "military_payroll_portability_not_found"
	},
	"event_datetime": "2023-10-10 15:45:21",
	"key": "\<UUID \>",
	"status": "canceled",
	"webhook_type": "debt"

}
```
#### Tabela de enumeradores
| Enumerador                    				| Descrição                             | Código da Zetra  |
|-----------------------------------------------|---------------------------------------|------------------|
| military_payroll_military_not_found			| Militar não encontrado. 				| 293              |
| military_payroll_portability_not_found		| Contrato de origem não encontrato.	| 294              |
| military_payroll_consignable_margin_exceeded	| Margem disponível excedida.			| 359              |

#### Expiração da Portabilidade

Após 10 dias, a Zetra cancela os pedidos de portabilidades que estão aguardando confirmação.

Desta forma, para reiniciar o fluxo de portabilidade, faz-se necessário um novo token válido. Caso exista um novo token válido, a proposta retorna para o passo de intenção de portabilidade (status da reserva: pending_reservation). No entanto, caso não exista um token válido, geralmente porque o token enviado já foi utilizado na intenção de portabilidade anterior, a proposta é atualizada para o status de pending_valid_token, aguardando o envio de um novo token. Com o envio de um novo token válido, a proposta segue normalmente o fluxo de intenção de portabilidade e confirmação.

Para informar a situação será enviado o seguinte webhook:

WEBHOOK_TYPE credit_operation.collateral
STATUS Pending Reservation/Pending Valid Token

```json title='Webhook Body'
{
    "key": "23c89acf-b11b-4988-b738-a0f5ba238c33",
    "data": {
		"collateral_type": "military_payroll",
		"collateral_data": {
			"reservation_status": "pending_reservation" ou "pending_valid_token",
			"cancel_reason": "expired_portability",
		},
    },
    "event_time": "2022-10-31 15:23:46",
    "webhook_type": "credit_operation.collateral"
}
```
## Cancelamento
Para realizar o cancelamento definitivo de uma operação, com a desaverbação da margem consignável, deve ser utilizado o seguinte endpoint:

:::caution Atenção
Vale ressaltar que o processo de desaverbação é assíncrono, ou seja, o cancelamento da operação de crédito, NÃO signifca necessáriamente que a desaverbação foi concluída. Para consultar o status da desaverbação vide [Recuperar resposta da última request](#recuperar_ultima_request)".
:::

:::caution Atenção
O cancelamento definitivo também pode ocorrer de forma automática, isso acontece quando uma operação está no status "canceled" por mais de 7 dias.
:::
### Request

ENDPOINT /debt/[DEBT-KEY]/cancel_permanently
MÉTODO POST

### Cancelamento da operação com sucesso:

Após a conclusão do cancelamento da operação, o parceiro receberá o seguinte webhook:

WEBHOOK_TYPE debt
STATUS Canceled Permanently

Body

```json
{
	"key": "\<DEBT-KEY\>",
	"data": {},
	"status": "canceled_permanently",
	"webhook_type": "debt",
	"event_datetime": "2022-11-01 03:46:31"
}
```

## Envio de novo Token de Portabilidade

O token de portabilidade é de uso único, portanto, é necessário que um novo token seja enviado quando o anterior for utilizado ou no caso de token inválido.

A forma de envio é uma chamada simples:

### Request

ENDPOINT /debt/[DEBT-KEY]/collateral
MÉTODO PATCH

Request Body

```json
    {
        "portability_data": {
            "token": "12345678"
        }
    }
```

### Casos de sucesso
#### Response 204

Response Body

```json
    {}
```

### Caso de erro
:::info
Somente o token deverá ser enviado nessa requisição, caso contrário o processo retornará um erro
:::
#### Response

Response Body

```json
    {
        "title": "Bad Request",
        "description": "Additional properties are not allowed (<campo extra> was unexpected)",
        "translation": "Schema Inválido",
        "code": "QIT000001"
    }
```

## Alteração do tipo de averbação da operação

Alterar, exclusivamente, o tipo de averbação de uma operação de portabilidade para crédito novo.
Após a alteração, a reserva seguirá, automaticamente, o fluxo e regras de averbação de uma reserva do tipo crédito novo.
### Request

ENDPOINT /debt/[DEBT-KEY]/collateral
MÉTODO PATCH

Request Body

```json
    {
        "reservation_type": "new_credit"
    }
```

### Casos de sucesso
#### Response 204

Response Body

```json
    {}
```

### Caso de erro

#### Response

Response Body

```json
    {
        "title": "Bad Request",
        "description": "Additional properties are not allowed (<campo extra> was unexpected)",
        "translation": "Schema Inválido",
        "code": "QIT000001"
    }
```

## Recuperar resposta da última request {#recuperar_ultima_request}

O last response é uma forma de mapear, de forma simples e objetiva, a resposta da comunicação entre a QI e a Zetra, possibilitando saber quando essa requisição foi feita e qual o retorno obtido (através de um enumerador).

Cada enumerador tem uma descrição detalhada. Podemos conferir abaixo, com mais detalhes, como serão apresentados os dados do last response.

### Casos de sucesso

#### Request
ENDPOINT /debt/[DEBT-KEY]/collateral
MÉTODO GET

#### Response

Response Body

```json
  {
    "collateral_constituted": true,
    "collateral_type": "military_payroll",
    "updated_at": "2023-05-24 19:13:02",
    "collateral_data": {
      "status": "reserved",
      "last_response": {
        "success": [
          {
            "enumerator": "succesfully_reserved"
          }
        ]
      },
      "last_response_event_datetime": "2023-05-22T19:13:02Z"
    }
  }
```

Response Body Portability

```json
{
    "collateral_constituted": true,
    "collateral_type": "military_payroll",
    "collateral_data": {
        "status": "reserved",
        "last_response": {
            "success": [
                {
                    "enumerator": "successfully_reserved"
                }
            ]
        },
        "last_response_event_datetime": "2023-08-09T19:25:09Z",
        "portability_data": {
            "origin_econsig_id": "2016587",
            "token": "123456"
        }       
    }
}
```

#### Tabela de enumeradores
| Enumerador                        | Descrição                        | Detalhes                                                           | Status da reserva    |
|-----------------------------------|----------------------------------|--------------------------------------------------------------------| ---------------------|
| successfully_accepted             | Reservation request accepted     | O pedido de averbação foi aceito e está aguardando confirmação     | pending_confirmation |
| successfully_reserved             | Reservation made successfully    | A reserva foi averbada com sucesso                                 | reserved             |
| successfully_deleted              | Reservation successfully deleted | A reserva foi desaverbada com sucesso                              | deleted              |

### Casos de erro

#### Request
ENDPOINT /debt/[DEBT-KEY]/collateral
MÉTODO GET

#### Response

Response Body

```json
  {
    "collateral_constituted": false,
    "collateral_type": "military_payroll",
    "updated_at": "2023-05-24 19:13:02",
    "collateral_data": {
      "status": "pending_reservation",
      "last_response": {
        "errors": [
          {
            "enumerator": "invalid_portability_token"
          }
        ]
      },
      "last_response_event_datetime": "2023-05-22T19:13:02Z"
    }
  }
```

#### Tabela de enumeradores
| Enumerador                  | Descrição                                 | Ação QI | Código correspondente da Zetra  |
|-----------------------------|-------------------------------------------|---------|---------------------------------|
| waiting_confirmation        | Waiting Confirmation on Portability       | retry   |                                 |
| communication_error         | Communication Error with Zetra            | retry   | 241                             |
| consignable_margin_excceded | Exceeded consignable margin               | retry   | 359                             |

## Informe de Saldo Devedor

O informe de saldo devedor acontece no 5º dia útil após o dia da solicitação, e todos os informados são enviados pelo webhook com as seguintes informações:

WEBHOOK_TYPE military_payroll.due_balance.status_change
STATUS processed

Response Body

```json
{
	"webhook_type": "military_payroll.due_balance.status_change",
	"status": "processed",
	"event_datetime": "2024-03-12T19:23:12Z",
	"data": [
		{
			"contract_number": "0000086715/TA",
			"payment_amount": 284.28,
			"balance_limit_date": "2024-03-12"
		},
		{
			"contract_number": "0000086715/BE",
			"payment_amount": 134.00,
			"balance_limit_date": "2024-03-12"
		}
	]
}
```

---

# Abertura de Conta em Duas Etapas

URL: /en/documentation/account_request

## Solicitar Reserva de Conta de Livre Movimentação

### Request

ENDPOINT /account_request/checking
MÉTODO POST

Request Body - Titular PJ

```json
{
    "account_owner": {
        "company_document_number": "64669455000187",
        "email": "marcos.alves@yopmail.com",
        "foundation_date": "2017-09-16",
        "name": "NOME DA EMPRESA"
    }
}
```

Request Body - Titular PF

```json
{
    "account_owner": {
        "document_number": "64669455000187",
        "email": "marcos.alves@yopmail.com",
        "birthdate": "2017-09-16",
        "name": "NOME DA EMPRESA"
    }
}
```

## Solicitar Reserva de Conta Escrow

ENDPOINT /account_request/escrow
MÉTODO POST

Request Body - Titular PJ

```json
{
    "account_owner": {
        "company_document_number": "64669455000187",
        "email": "marcos.alves@yopmail.com",
        "foundation_date": "2017-09-16",
        "name": "NOME DA EMPRESA"
    }
}
```

Request Body - Titular PF

```json
{
    "account_owner": {
        "document_number": "64669455000187",
        "email": "marcos.alves@yopmail.com",
        "birthdate": "2017-09-16",
        "name": "NOME DA EMPRESA"
    }
}
```

### Body Params Titular PJ

| Campo            | Tipo       | Descrição                                      | Caracteres                                                                        |
|------------------|------------|------------------------------------------------|-----------------------------------------------------------------------------------|
| **account_owner**  | object     | Informações simplificadas da pessoa jurídica titular da conta | [Objeto account_owner PJ](#objeto-account_owner-solicitar-reserva-pj) <br/><br/> [Objeto account_owner PF](#objeto-account_owner-solicitar-reserva-pf) |

### Objeto account_owner Solicitar Reserva PJ

| Campo                         | Tipo   | Descrição                                 | Caracteres |
|-------------------------------|--------|-------------------------------------------|------------|
| **company_document_number** * | string | CNPJ do titualar da conta.                | 14         |
| **email** *                   | string | E-mail da empresa titular da contato.     | 200        |
| **foundation_date**           | string | Data de abertura da empresa.              | 10         |
| **name** *                    | string | Razão Social da empresa titular da conta. | 50         |

### Objeto account_owner Solicitar Reserva PF

| Campo                  | Tipo   | Descrição                                 | Caracteres |
|------------------------|--------|-------------------------------------------|------------|
| **document_number** *  | string | CPF do titualar da conta.                 | 14         |
| **email** *            | string | E-mail da empresa titular da contato.     | 200        |
| **birthdate**          | string | Data de nascimento.                       | 10         |
| **name** *             | string | Razão Social da empresa titular da conta. | 50         |

### Response

STATUS 201

Response Body

```json
{
    "account_info": {
        "account_branch": "0001",
        "account_digit": "3",
        "account_number": "1638634"
    },
    "account_request_key": "e48eb139-448e-43b9-9aee-df5f4b51158c",
    "account_request_status": "pending_kyc_analysis"
}
```

### Webhook aprovação KYC

Webhook Body

```json
{
    "data": {
        "account_info": {
            "account_digit": "3",
            "account_branch": "0001",
            "account_number": "1638634"
        },
        "account_request_key": "dc575950-dcce-48e1-99a6-5fb0ada63d86"
    },
    "event_datetime": "2022-09-02 22:39:39",
    "key": "dc575950-dcce-48e1-99a6-5fb0ada63d86",
    "status": "pending_additional_data",
    "webhook_type": "account_request.status_change"
}
```

### Enumeradores account_request_status
| Enum                        | Description                     |
|-----------------------------|---------------------------------|
| **pending_kyc_analysis**    | Pendente aprovação KYC          |
| **pending_additional_data** | Pendente informações adicionais |
| **rejected**                | Abertura rejeitada              |

## Abertura de Conta Livre Movimentação

### Request

ENDPOINT /account_request/ACCOUNT_REQUEST_KEY/checking
MÉTODO PATCH

Request Body - Titular PJ

```json
{
    "account_owner": {
        "address": {
            "city": "Caraguatatuba",
            "complement": "complemento",
            "neighborhood": "Jaraguazinho",
            "number": "924",
            "postal_code": "11675200",
            "state": "SP",
            "street": "Praça Jorge Vitório de Souza"
        },
        "cnae_code": "4721-1/02",
        "company_document_number": "64669455000187",
        "company_statute": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d",
        "company_type": "ltda",
        "email": "marcos.alves@yopmail.com",
        "foundation_date": "2017-09-16",
        "name": "NOME DA EMPRESA",
        "person_type": "legal",
        "phone": {
            "area_code": "19",
            "country_code": "055",
            "number": "988888888"
        },
        "trading_name": "Pães e Doces",
        "company_representatives": [
            {
                "name": "Marcos Felipe Henrique Alves",
                "address": {
                    "city": "Recife",
                    "complement": null,
                    "neighborhood": "Fundão",
                    "number": "137",
                    "postal_code": "52221110",
                    "state": "PE",
                    "street": "Rua Camapuã"
                },
                "email": "marcos.alves@yopmail.com",
                "birth_date": "1972-02-02",
                "individual_document_number": "08531309069",
                "document_identification": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d",
                "document_identification_number": "339122924",
                "is_pep": false,
                "final_beneficiary": true,
                "marital_status": "single",
                "mother_name": "Sueli Isadora Alves",
                "nationality": "Brasileira",
                "person_type": "natural",
                "phone": {
                    "area_code": "88",
                    "country_code": "055",
                    "number": "995924634"
                }
            }
        ]
    },
    "signed_contract": {
        "document_key": "4d7f4e29-4b58-4905-9a69-b1f9215263f5",
        "signatures": [
            {
                "authenticity": {
                    "timestamp": "1970-01-01T00:00:01.080100Z",
                    "facial_recognition_key": "79003de0-2590-455d-9b73-426b8ca284eb",
                    "lang": "-35.8916627",
                    "lat": "-7.2226067",
                    "ip_address": "177.51.1.186",
                    "session_id": "jdifj329842"
                },
                "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"
            }
        ]
    },
    "additional_documents": ["b12c8807-8f3f-4083-9cb1-7cce641f3786"],
    "guarantee_document_key": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d"
}
```

Request Body - Titular PF

```json
{
    "account_owner": {
        "address": {
            "street": "Av. Brigadeiro Faria Lima",
            "state": "SP",
            "city": "São Paulo",
            "neighborhood": "Jardim Paulistano",
            "number": "2391",
            "postal_code": "01452905",
            "complement": "1o. Andar"
        },
        "birth_date": "1990-05-06",
        "document_identification": "3c24579b-9810-4fa6-9b08-fe67d237160a",
        "email": "ivanlima2604@gmail.com",
        "individual_document_number": "34651104630",
        "is_pep": false,
        "mother_name": "Dona Maria Mariane",
        "name": "Nome do Titular da Conta",
        "nationality": "nationality",
        "person_type": "natural",
        "phone": {
            "country_code": "055",
            "area_code": "11",
            "number": "999999999"
        },
        "proof_of_residence": "780456bd-1eec-4e5f-82c0-d8c3921497ea"
    },
    "signed_contract": {
        "document_key": "4d7f4e29-4b58-4905-9a69-b1f9215263f5",
        "signatures": [
            {
                "authenticity": {
                    "timestamp": "1970-01-01T00:00:01.080100Z",
                    "facial_recognition_key": "79003de0-2590-455d-9b73-426b8ca284eb",
                    "lang": "-35.8916627",
                    "lat": "-7.2226067",
                    "ip_address": "177.51.1.186",
                    "session_id": "jdifj329842"
                },
                "signer": {
                    "name": "Nome do Titular da Conta",
                    "email": "ivanlima2604@gmail.com",
                    "phone": {
                        "country_code": "055",
                        "area_code": "11",
                        "number": "999999999"
                    },
                    "document_number": "61766976204"
                },
                "authentication_type": "opt-in"
            }
        ]
    },
    "additional_documents": ["b12c8807-8f3f-4083-9cb1-7cce641f3786"],
    "guarantee_document_key": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d"
}
```

### Response

STATUS 201

Response Body

```json
{
    "account_key": "e48eb139-448e-43b9-9aee-df5f4b51158c"
}
```

:::info ACCOUNT_KEY
A `account_key` será a chave única de identificação da conta. Toda interação com a conta se dará através dela.
:::

## Abertura de Conta Escrow

### Request

ENDPOINT /account_request/ACCOUNT_REQUEST_KEY/escrow
MÉTODO PATCH

Request Body - Titular PJ

```json
{
    "account_owner": {
        "address": {
            "city": "Caraguatatuba",
            "complement": "complemento",
            "neighborhood": "Jaraguazinho",
            "number": "924",
            "postal_code": "11675200",
            "state": "SP",
            "street": "Praça Jorge Vitório de Souza"
        },
        "cnae_code": "4721-1/02",
        "company_document_number": "64669455000187",
        "company_statute": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d",
        "company_type": "ltda",
        "email": "marcos.alves@yopmail.com",
        "foundation_date": "2017-09-16",
        "name": "NOME DA EMPRESA",
        "person_type": "legal",
        "phone": {
            "area_code": "19",
            "country_code": "055",
            "number": "988888888"
        },
        "trading_name": "Pães e Doces",
        "company_representatives": [
            {
                "name": "Marcos Felipe Henrique Alves",
                "address": {
                    "city": "Recife",
                    "complement": null,
                    "neighborhood": "Fundão",
                    "number": "137",
                    "postal_code": "52221110",
                    "state": "PE",
                    "street": "Rua Camapuã"
                },
                "email": "marcos.alves@yopmail.com",
                "birth_date": "1972-02-02",
                "individual_document_number": "08531309069",
                "document_identification": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d",
                "document_identification_number": "339122924",
                "is_pep": false,
                "final_beneficiary": true,
                "marital_status": "single",
                "mother_name": "Sueli Isadora Alves",
                "nationality": "Brasileira",
                "person_type": "natural",
                "phone": {
                    "area_code": "88",
                    "country_code": "055",
                    "number": "995924634"
                }
            }
        ]
    },
    "signed_contract": {
        "document_key": "4d7f4e29-4b58-4905-9a69-b1f9215263f5",
        "signatures": [
            {
                "authenticity": {
                    "timestamp": "1970-01-01T00:00:01.080100Z",
                    "facial_recognition_key": "79003de0-2590-455d-9b73-426b8ca284eb",
                    "lang": "-35.8916627",
                    "lat": "-7.2226067",
                    "ip_address": "177.51.1.186",
                    "session_id": "jdifj329842"
                },
                "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"
            }
        ]
    },
    "destinations": [
        {
            "account_branch": "0001",
            "account_number": "1234567",
            "account_digit": "1",
            "document_number": "04252012000123",
            "name": "Conta do FIDC",
            "ispb_number": "32402502",
            "financial_institution_code_number": "329"
        }
    ],
    "additional_documents": ["b12c8807-8f3f-4083-9cb1-7cce641f3786"],
    "guarantee_document_key": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d"
}
```

Request Body - Titular PF

```json
{
    "account_owner": {
        "address": {
            "street": "Av. Brigadeiro Faria Lima",
            "state": "SP",
            "city": "São Paulo",
            "neighborhood": "Jardim Paulistano",
            "number": "2391",
            "postal_code": "01452905",
            "complement": "1o. Andar"
        },
        "birth_date": "1990-05-06",
        "document_identification": "3c24579b-9810-4fa6-9b08-fe67d237160a",
        "email": "ivanlima2604@gmail.com",
        "individual_document_number": "34651104630",
        "is_pep": false,
        "mother_name": "Dona Maria Mariane",
        "name": "Nome do Titular da Conta",
        "nationality": "nationality",
        "person_type": "natural",
        "phone": {
            "country_code": "055",
            "area_code": "11",
            "number": "999999999"
        },
        "proof_of_residence": "780456bd-1eec-4e5f-82c0-d8c3921497ea"
    },
    "signed_contract": {
        "document_key": "4d7f4e29-4b58-4905-9a69-b1f9215263f5",
        "signatures": [
            {
                "authenticity": {
                    "timestamp": "1970-01-01T00:00:01.080100Z",
                    "facial_recognition_key": "79003de0-2590-455d-9b73-426b8ca284eb",
                    "lang": "-35.8916627",
                    "lat": "-7.2226067",
                    "ip_address": "177.51.1.186",
                    "session_id": "jdifj329842"
                },
                "signer": {
                    "name": "Nome do Titular da Conta",
                    "email": "ivanlima2604@gmail.com",
                    "phone": {
                        "country_code": "055",
                        "area_code": "11",
                        "number": "999999999"
                    },
                    "document_number": "34651104630"
                },
                "authentication_type": "opt-in"
            }
        ]
    },
    "destinations": [
        {
            "account_branch": "0001",
            "account_number": "1234567",
            "account_digit": "1",
            "document_number": "04252012000123",
            "name": "Conta do FIDC",
            "ispb_number": "32402502",
            "financial_institution_code_number": "329"
        }
    ],
    "additional_documents": ["b12c8807-8f3f-4083-9cb1-7cce641f3786"],
    "guarantee_document_key": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d"
}
```

### Response

STATUS 201

Response Body

```json
{
    "account_key": "e48eb139-448e-43b9-9aee-df5f4b51158c"
}
```

:::info ACCOUNT_KEY
A `account_key` será a chave única de identificação da conta. Toda interação com a conta se dará através dela.
:::

### Body Params Abertura de Conta
| Campo                      | Tipo   | Descrição                                                                   | Caracteres                                                                                                                                                     |
|----------------------------|--------|-----------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **account_owner** *        | object | Informações completas do titular da conta                                   | **[Objeto account_owner PJ](#objeto-account_owner-abertura-de-conta-pj)** <br/><br/> **[Objeto account_owner PF](#objeto-account_owner-abertura-de-conta-pf)** |
| **signed_contract** *      | object | Objeto contendo os dados de contrato e dos assinantes do contrato da conta. | **[Objeto signed_contract](#objeto-signed_contract)**                                                                                                          |
| **destinations** **        | list   | Lista de contas destino autorizadas a receber transaferências.              | **[Objeto destinations](#objeto-destinations)**                                                                                                                |
| **additional_documents**   | list   | Lista de id's de documentos extras/opcionais .                              | Array de UUID's                                                                                                                                                |
| **guarantee_document_key** | uuidv4 | DOCUMENT_KEY do PDF do documento de caução/garantia do contrato de conta escrow (enviado previamente). (A DOCUMENT_KEY é retornada na resposta do endpoint de [Upload de documentos](./upload_de_documentos)) | 36                                                                                                                                                             |

`(**) Obrigatório para conta Escrow`

### Objeto account_owner Abertura de Conta PJ
| Campo                         | Tipo       | Descrição                                                                                                       | Caracteres                                                            |
|-------------------------------|------------|-----------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|
| **address** *                 | object     | Objeto endereço do titular da conta                                                                             | **[Objeto address](#objeto-address)**                                 |
| **cnae_code** *               | string     | Classificação Nacional de Atividades Econômicas                                                                 | 9                                                                     |
| **company_document_number** * | string     | CNPJ                                                                                                            | 14                                                                    |
| **company_statute** *         | uuidv4     | DOCUMENT_KEY do PDF do estatuto da empresa (enviado previamente).                                               | 36                                                                    |
| **company_type** *            | enumerator | Tipo da empresa                                                                                                 | **[Enumeradores company_type](#enumeradores-company_type)**           |
| **email** *                   | string     | Email institucional da empresa.                                                                                 | 200                                                                   |
| **foundation_date** *         | string     | Data de abertura da empresa (formato "AAAA-MM-DD").                                                             | 10                                                                    |
| **name** *                    | string     | Razão social do titular da conta.                                                                               | 50                                                                    |
| **person_type** *             | enumerator | Identificador de que o objeto enviado é uma pessoa jurídica. Deve conter SEMPRE o valor "legal" para Objeto PJ. | **[Enumeradores person_type](#enumeradores-person_type)**             |
| **phone** *                   | object     | Telefone do titular da conta.                                                                                   | **[Objeto phone](#objeto-phone)**                                     |
| **trading_name** *            | string     | Nome fantasia.                                                                                                  | 200                                                                   |
| **company_representatives** * | list       | Lista dos representantes legais da empresa                                                                      | **[Objeto company_representatives](#objeto-company_representatives)** |

### Objeto account_owner Abertura de Conta PF
| Campo                            | Tipo    | Descrição                                                                                                         | Caracteres                                                |
|----------------------------------|---------|-------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------| 
| **address**                      | string  | Objeto endereço do titular da conta                                                                               | **[Objeto address](#objeto-address)**                     | 
| **birth_date** *                 | string  | Data de nascimento da pessoa (formato "AAAA-MM-DD")                                                               | -                                                         |
| **document_identification** *    | uuidv4  | DOCUMENT_KEY do PDF do documento de identificação da pessoa com foto (RG ou CNH) (enviado previamente)            | 36                                                        |
| **email** *                      | string  | Email do titular da conta.                                                                                        | 200                                                       |
| **individual_document_number** * | string  | CPF da pessoa (apenas números).                                                                                   | 11                                                        |
| **is_pep** *                     | boolean | Declaração se a pessoa é PEP (http://www.portaldatransparencia.gov.br/download-de-dados/pep).                     | -                                                         |
| **mother_name** *                | string  | Nome da mãe do titular da conta.                                                                                  | -                                                         |
| **name** *                       | string  | Nome do titular da conta.                                                                                         | -                                                         |
| **nationality** *                | string  | Nacionalidade do cliente.                                                                                         | -                                                         |
| **person_type** *                | string  | Identificador de que o objeto enviado é uma pessoa jurídica. Deve conter SEMPRE o valor "natural" para Objeto PF. | **[Enumeradores person_type](#enumeradores-person_type)** |
| **phone**                        | string  | Objeto com dados do telefone do titular da conta                                                                  | 36                                                        |
| **proof_of_residence**           | uuidv4  | DOCUMENT_KEY do PDF do comprovante de endereço do endereço enviado (enviado previamente).                         |                                                           |

### Objeto address
| Campo              | Descrição | Exemplo                                                                                   | Caracteres |
|--------------------|-----------|-------------------------------------------------------------------------------------------|------------|
| **street** *       | string    | Rua do endereço                                                                           | 500        |
| **state** *        | enum      | Estado do endereço (com dois caracteres maiúsculos)                                       | 2          |
| **city** *         | string    | Cidade do endereço                                                                        | 255        |
| **neighborhood** * | string    | Bairro do endereço                                                                        | 500        |
| **number** *       | string    | Número da rua                                                                             | 10         |
| **postal_code** *  | string    | CEP do endereço (http://www.buscacep.correios.com.br/sistemas/buscacep/) (apenas números) | 8          |
| **complement**     | string    | Complemento do endereço (texto livre)                                                     | 500        |

### Objeto phone
| Campo              | Descrição | Exemplo                                               | Caracteres   |
|--------------------|-----------|-------------------------------------------------------|--------------|
| **country_code** * | string    | Código DDI do telefone (https://ddi.guiamais.com.br/) | 3            |
| **area_code** *    | string    | Código DDD do telefone (https://ddd.guiamais.com.br/) | 3            |
| **number** *       | string    | Número de telefone (apenas números)                   | 10           |

### Objeto company_representatives
| Campo                              | Tipo    | Descrição                                                                                              | Caracteres                                                                              |
|------------------------------------|---------|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
| **name** *                         | string  | Nome do representante da empresa                                                                       | 100                                                                                     |
| **address** *                      | object  | Objeto endereço do representante da empresa                                                            | **[Objeto address](#objeto-address)**                                                   |
| **email** *                        | string  | Email do representante da empresa                                                                      | 254                                                                                     |
| **birth_date** *                   | string  | Data de nascimento representante da empresa (formato "AAAA-MM-DD")                                     | 10                                                                                      |
| **individual_document_number** *   | string  | CPF do representante da empresa (apenas números).                                                      | 11                                                                                      |
| **document_identification** *      | uuidv4  | DOCUMENT_KEY do PDF do documento de identificação da pessoa com foto (RG ou CNH) (enviado previamente) | 36                                                                                      |
| **document_identification_number** | string  | Número do documento de identificação com foto da pessoa (RG ou CNH)                                    | 16                                                                                      |
| **document_identification_type**   | enum    | Tipo do documento de identificação com foto da pessoa (RG ou CNH)                                      | [Enumeradores document_identification_type](#enumeradores-document_identification_type) |
| **is_pep** *                       | boolean | Declaração se a pessoa é PEP (http://www.portaldatransparencia.gov.br/download-de-dados/pep).          | -                                                                                       |
| **final_beneficiary**              | boolean | Declaração se o representante é beneficiário final da empresa.                                         | -                                                                                       |
| **marital_status**                 | enum    | Estado civil do representante da empresa                                                               | **[Enumeradores marital status](#enumeradores-marital_status)**                         |
| **mother_name** *                  | string  | Nome da mãe do representante da empresa                                                                | 100                                                                                     |
| **nationality**                    | string  | Nacionalidade do representante da empresa                                                              | 50                                                                                      |
| **person_type** *                  | enum    | Identificador de que o objeto enviado é uma pessoa física                                              | **[Enumeradores person_type](#enumeradores-person_type)**                               |
| **phone** *                        | object  | Objeto com dados do telefone do representante da empresa                                               | **[Objeto phone](#objeto-phone)**                                                       |

### Objeto signed_contract conta livre
| Campo              | Tipo   | Descrição                                                                                                                                                                                                           | Caracteres                              |
|--------------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------|
| **document_key** * | uuidv4 | Chave única de identificação do documento do **Termo de Abertura de Conta** ou **Contrato de Conta Escrow**. (A DOCUMENT_KEY é retornada na resposta do endpoint de [Upload de documentos](./upload_de_documentos)) | 36                                      |
| **signatures** *   | list   | Dados de assinatura do documento enviado. Cada item da lista, corresponde a um assinante do documento.                                                                                                              | [Objeto signatures](#objeto-signatures) |

### Objeto signatures
| Campo              | Tipo       | Descrição                                                                          | Caracteres                                  |
|--------------------|------------|------------------------------------------------------------------------------------|---------------------------------------------|
| **authenticity** * | object     | Conjunto de dados que evidenciam a assinatura eletrônica realizada pelo assinante. | [Objeto authenticity](#objeto-authenticity) |
| **signer** * | object     | Objeto contendo os dados de um dos assinantes do documento.                        | [Objeto signer](#objeto-signer)             |
| **authentication_type** * | enumerator | Tipo de assinatura. Sempre será "**opt-in**"                                       | "**opt-in**"                                |

### Objeto authenticity
| Campo                      | Tipo   | Descrição                                                                                                                                                                  | Caracteres |
|----------------------------|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|
| **timestamp** *            | string | Data e hora do momento da assinatura do documento.                                                                                                                         | 27         |
| **facial_recognition_key** | uuidv4 | Chave única de identificação da foto da selfie do titular da conta. (A DOCUMENT_KEY é retornada na resposta do endpoint de [Upload de documentos](./upload_de_documentos)) | 36         |
| **lang**                   | string | Coordenada de longitude da geolocalização do assinante capturada no momento da assinatura.                                                                                 | -          |
| **lat**                    | string | Coordenada de latitude da geolocalização do assinante capturada no momento da assinatura.                                                                                  | -          |
| **ip_address**             | string | Endereço IP do dispositivo do assinante.                                                                                                                                   | -          |
| **session_id**             | string | ID da seção do assinante no momento da assinatura.                                                                                                                         | -          |

### Objeto signer
| Campo                 | Tipo   | Descrição                                 | Caracteres                        |
|-----------------------|--------|-------------------------------------------|-----------------------------------|
| **name** *            | string | Nome do assinante.                        | -                                 |
| **email** *           | string | Email do assinante.                       | -                                 |
| **phone** *           | object | Objeto com dados do telefone do assinante | **[Objeto phone](#objeto-phone)** |
| **document_number** * | string | CPF do assinante.                         | 11                                |

### Objeto destinations
| Campo                                   | Tipo   | Descrição                                                       | Caracteres |
|-----------------------------------------|--------|-----------------------------------------------------------------|------------|
| **account_branch** *                    | string | Número da Agência da conta destino.                             | 4          |
| **account_number** *                    | string | Número da conta destino.                                        | -          |
| **account_digit** *                     | string | Dígito verificador do número da conta destino.                  | 1          |
| **document_number** *                   | string | CPF/CNPJ do titular da conta destino.                           | -          |
| **name** *                              | string | Nome/Razão Social do titular da conta destino.                  | -          |
| **ispb_number** *                       | string | ISPB (base do CNPJ) da instituição financeira da conta destino. | 8          |
| **financial_institution_code_number** * | string | Código da instituição financeira da conta destino.              | 3          |

### Enumeradores person_type
| Enum        | Description       |
|-------------|-------------------|
| **natural** | Pessoa física     |
| **legal**   | Pessoa jurídica   |

### Enumeradores document_identification_type
| Enum    | Description                            |
|---------|----------------------------------------|
| **rg**  | RG - Registro Geral                    |
| **cnh** | CNH - Carteira Nacional de Habilitação |

### Enumeradores company_type
| Enum                    | 	Description                                                              |
|-------------------------|---------------------------------------------------------------------------|
| **ltda**                | Limitada                                                                  |
| **sa**	                 | Sociedade Anônima                                                         |
| **micro_enterprise**	   | Micro Empresa                                                             |
| **freelancer**          | Freelancer                                                                |
| **sa_opened**           | Sociedade Anônima de Capital Aberto                                       |
| **sa_closed**	          | Sociedade Anônima de Capital Fechado                                      |
| **se_ltda**             | Sociedade Empresária Limitada                                             |
| **se_cn**               | Sociedade Empresária em Nome Coletivo                                     |
| **se_cs**               | Sociedade Empresária em Comandita Simples                                 |
| **se_ca**	              | Sociedade Empresária em Comandita por Ações                               |
| **scp**                 | Sociedade em Conta de Participação                                        |
| **ei**	                 | Empresário Individual                                                     |
| **ese**	                | Estabelecimento, no Brasil, de Sociedade Estrangeira                      |
| **eeab**	               | Estabelecimento, no Brasil, de Empresa Binacional Argentino-Brasileira    |
| **ssp**                 | Sociedade Simples Pura                                                    |
| **ss_ltda**	            | Sociedade Simples Limitada                                                |
| **ss_cn**               | Sociedade Simples em Nome Coletivo                                        |
| **ss_cs**               | Sociedade Simples em Comandita Simples                                    |
| **eireli_ne**           | Empresa Individual de Responsabilidade Limitada (de Natureza Empresária)  |
| **eireli_ns**           | Empresa Individual de Responsabilidade Limitada (de Natureza Simples)     |
| **eireli**              | Empresa de Responsabilidade Individual                                    |
| **mei**                 | Micro Empreendedor Individual                                             |
| **me**	                 | Micro Empresa                                                             |
| **cop**	                | Cooperativa                                                               |
| **private_association** | Sociedade Privada                                                         |
| **association**	        | Associação                                                               |
| **others**              | Outros                                                         |

### Enumeradores marital_status
| Enum         | 	Description  |
|--------------|---------------|
| **single**   | Solteiro(a)   |
| **married**  | Casado(a)    |
| **widower**  | Viúvo(a)     |
| **divorced** | Divorciado(a) |
| **separated** | Separado(a) |

---

# Manual de Aditamento

URL: /en/documentation/aditamento/manual_aditamento

Este manual descreve o passo a passo envolvido no processo de aditamento. Trata-se do postergamento do prazo da dívida, em que ocorre a mudança na data de vencimento das parcelas e se mantém o número de contrato. 

Nesse processo de aditamento, a `final_debt_key` retornada no webhook de desembolso é a nova chave da operação e, após esse processo, novos boletos das parcelas aditadas serão gerados. 

O aditamento só é válido para operações pré-fixadas.

## 1 - Criação da operação de aditamento

O campo `desired_installments` é uma lista de objetos com o atributo `due_date`.

O campo de `calculate_delay` só está disponível no Response Body se for enviado na requisição de POST.

Nesse momento, como ainda não houve desembolso da operação originada do aditamento, os campos relacionados ao boleto, como `bank_slip_key`, `digitable_line`, `qr_code_key` e `qr_code_url`, serão nulos.

**1.1.** Simulação:

        **Request**

ENDPOINT /amendment_simulation
MÉTODO POST

Request Body

```json
{
	"amendment_debt_key": "\<Chave unitária da operação/debt a ser aditada\>",
	"amendment_date": "\<Nova data de referência para a operação originada a partir aditamento\>",
	"financial": {
		"calculate_delay": "\<Booleano para cálculo de juros de atraso em cima da operação a ser adiatada\>",
        "monthly_rate": "\<Valor em decimal do juros do aditamento ao mês\>", 
		"desired_installments" : [
			{
				"due_date": "\<Nova data de vencimento da parcela\>",
			}
		]
	},
	"additional_data": "\<JSON de campos adicionais livre\>",
}

```

        **Response**

Response Body

```json
{
	"amendment_debt_key": "\<Chave unitária da operação/debt a ser aditada enviada no POST\>",
	"amendment_date": "\<Nova data de referência para a operação, originada a partir da data enviada no POST\>",
	"financial":{
		"calculate_delay": "\<Booleano para cálculo de juros de atraso em cima da operação a ser adiatada\>",
        "monthly_rate": "\<Valor em decimal do juros do aditamento ao mês\>",
		"desired_installments" : [
			{
				"due_date": "\<Nova data de vencimento da parcela\>",
				"total_amount": "\<Valor da parcela\>",
			}
		]
	},
	"additional_data": "\<JSON de campos adicionais livre enviada no POST\>",
	"final_debt": {
		"annual_cet": "\<Custo Efetivo Total anual\>",
		"cet": "\<Custo Efetivo Total mensal\>",
		"installments":{
            "bank_slip_key": "\<Chave unitária do boleto relacionado a parcela\>",
            "business_due_date": "\<Data de vencimento da parcela, considerndo dias úteis\>",
            "calendar_days": "\<Dias corridos em relação a data de referência anterior\>",
            "digitable_line": "\<Linha digitável do boleto\>",
            "due_date": "\<Data de vencimento da parcela\>",
            "due_interest": "\<Valor de Juros da parcela\>",
            "due_principal":"\<Valor Principal da parcela\>",
            "installment_key": "\<Chave unitária característica da parcela\>",
            "installment_number": "\<Número da parcela dentro do total de parcelas\>",
            "post_fixed_amount": "\<Valor de Juros pós-fixado da parcela\>",
            "pre_fixed_amount": "\<Valor de Juros pré-fixado da parcela\>",
            "principal_amortization_amount": "\<Valor de amortização de principal da parcela\>",
            "qr_code_key": "\<Chave unitária do QR Code associado ao boleto\>",
            "qr_code_url": "\<URL do QR Code associado ao boleto\>",
            "total_amount": "\<Valor Total da parcela\>",
            "workdays": "\<Dias úteis em relação a data de referência anterior\>",
        },
		"prefixed_interest_rate": {
			"annual_rate": "\<Taxa anual de juros pré-fixado\>",
        	"daily_rate": "\<Taxa diária de juros pré-fixado\>",
        	"interest_base": "\<Base de cálculo de juros\>",
        	"monthly_rate": "\<Taxa mensal de juros pré-fixado\>",
    	},
		"issue_amount": "\<Valor de emissão da operação de aditamento\>",
		"number_of_installments": "\<Número de parcelas\>",
		"total_iof": "\<IOF da operação\>"
	}
}

```

**1.2.** Criação:

        **Request**

ENDPOINT /amendment
MÉTODO POST

Request Body

```json
{
	"amendment_debt_key": "\<Chave unitária da operação/debt a ser aditada\>",
	"amendment_date": "\<Nova data de referência para a operação originada a partir aditamento\>",
	"financial": {
		"calculate_delay": "\<Booleano para cálculo de juros de atraso em cima da operação a ser adiatada\>",
        "monthly_rate": "\<Valor em decimal do juros do aditamento ao mês\>",
		"desired_installments" : [
			{
				"due_date": "\<Nova data de vencimento da parcela\>",
			}
		]
	},
	"additional_data": "\<JSON de campos adicionais livre\>",
}

```

        **Response**

Response Body

```json
{
	"amendment_key": "\<Chave unitária característica do aditamento\>",
	"amendment_debt_key": "\<Chave unitária da operação/debt a ser aditada enviada no POST\>",
	"amendment_date": "\<Nova data de referência para a operação, originada a partir da data enviada no POST\>",
	"financial":{
		"calculate_delay": "\<Booleano para cálculo de juros de atraso em cima da operação a ser adiatada\>",
        "monthly_rate": "\<Valor em decimal do juros do aditamento ao mês\>",
		"desired_installments" : [
			{
				"due_date": "\<Nova data de vencimento da parcela\>",
				"total_amount": "\<Valor da parcela\>",
			}
		]
	},
	"additional_data": "\<JSON de campos adicionais livre enviada no POST\>",
	"amendment_status": "waiting_signature",
	"document_key": "\<Chave unitária do documento/contrato da operação de aditamento\>",
	"document_url": "\<URL do documento/contrato da operação de aditamento\>",
	"final_debt": {
		"annual_cet": "\<Custo Efetivo Total anual\>",
		"cet": "\<Custo Efetivo Total mensal\>",
		"installments":{
            "bank_slip_key": "\<Chave unitária do boleto relacionado a parcela\>",
            "business_due_date": "\<Data de vencimento da parcela, considerndo dias úteis\>",
            "calendar_days": "\<Dias corridos em relação a data de referência anterior\>",
            "digitable_line": "\<Linha digitável do boleto\>",
            "due_date": "\<Data de vencimento da parcela\>",
            "due_interest": "\<Valor de Juros da parcela\>",
            "due_principal":"\<Valor Principal da parcela\>",
            "installment_key": "\<Chave unitária característica da parcela\>",
            "installment_number": "\<Número da parcela dentro do total de parcelas\>",
            "post_fixed_amount": "\<Valor de Juros pós-fixado da parcela\>",
            "pre_fixed_amount": "\<Valor de Juros pré-fixado da parcela\>",
            "principal_amortization_amount": "\<Valor de amortização de principal da parcela\>",
            "qr_code_key": "\<Chave unitária do QR Code associado ao boleto\>",
            "qr_code_url": "\<URL do QR Code associado ao boleto\>",
            "total_amount": "\<Valor Total da parcela\>",
            "workdays": "\<Dias úteis em relação a data de referÊncia anterior\>",
        },
		"prefixed_interest_rate": {
			"annual_rate": "\<Taxa anual de juros pré-fixado\>",
        	"daily_rate": "\<Taxa diária de juros pré-fixado\>",
        	"interest_base": "\<Base de cálculo de juros\>",
        	"monthly_rate": "\<Taxa mensal de juros pré-fixado\>",
    	},
		"issue_amount": "\<Valor de emissão da operação de aditamento\>",
		"number_of_installments": "\<Número de parcelas\>",
		"total_iof": "\<IOF da operação\>"
	}
}

```

Em relação a simulação, o Response Body da criação se diferencia pela presença da `amendment_key`, da `amendment_status`, da `document_key` e da `document_url`.

Na criação do operação de aditamento, sempre se retorna o `amendment_status` como "waiting_signature". 

## 2 - GET da operação de aditamento
        **Request**

ENDPOINT /amendment/[AMENDMENT_KEY]
MÉTODO GET

O `amendment_key` que deve ser enviado para realização do GET é o valor do campo, de mesmo nome, retornado na criação da operação de aditamento e que representa a chave unitária característica do aditamento.

        **Response**

Response Body

```json
{
	"amendment_key": "\<Chave unitária característica do aditamento\>",
	"amendment_debt_key": "\<Chave unitária da operação/debt a ser aditada enviada no POST\>",
	"amendment_date": "\<Nova data de referência para a operação, originada a partir da data enviada no POST\>",
	"financial":{
		"calculate_delay": "\<Booleano para cálculo de juros de atraso em cima da operação a ser adiatada\>",
        "monthly_rate": "\<Valor em decimal do juros do aditamento ao mês\>",
		"desired_installments" : [
			{
				"due_date": "\<Nova data de vencimento da parcela\>",
				"total_amount": "\<Valor da parcela\>",
			}
		]
	},
	"additional_data": "\<JSON de campos adicionais livre enviada no POST\>",
	"amendment_status":  "\<Status do aditamento\>",
	"document_key": "\<Chave unitária do documento/contrato da operação de aditamento\>",
	"document_url": "\<URL do documento/contrato da operação de aditamento\>",
	"final_debt": {
		"annual_cet": "\<Custo Efetivo Total anual\>",
		"cet": "\<Custo Efetivo Total mensal\>",
		"installments":{
            "bank_slip_key": "\<Chave unitária do boleto relacionado a parcela\>",
            "business_due_date": "\<Data de vencimento da parcela, considerndo dias úteis\>",
            "calendar_days": "\<Dias corridos em relação a data de referência anterior\>",
            "digitable_line": "\<Linha digitável do boleto\>",
            "due_date": "\<Data de vencimento da parcela\>",
            "due_interest": "\<Valor de Juros da parcela\>",
            "due_principal":"\<Valor Principal da parcela\>",
            "installment_key": "\<Chave unitária característica da parcela\>",
            "installment_number": "\<Número da parcela dentro do total de parcelas\>",
            "post_fixed_amount": "\<Valor de Juros pós-fixado da parcela\>",
            "pre_fixed_amount": "\<Valor de Juros pré-fixado da parcela\>",
            "principal_amortization_amount": "\<Valor de amortização de principal da parcela\>",
            "qr_code_key": "\<Chave unitária do QR Code associado ao boleto\>",
            "qr_code_url": "\<URL do QR Code associado ao boleto\>",
            "total_amount": "\<Valor Total da parcela\>",
            "workdays": "\<Dias úteis em relação a data de referência anterior\>",
        },
		"prefixed_interest_rate": {
			"annual_rate": "\<Taxa anual de juros pré-fixado\>",
        	"daily_rate": "\<Taxa diária de juros pré-fixado\>",
        	"interest_base": "\<Base de cálculo de juros\>",
        	"monthly_rate": "\<Taxa mensal de juros pré-fixado\>",
    	},
		"issue_amount": "\<Valor de emissão da operação de aditamento\>",
		"number_of_installments": "\<Número de parcelas\>",
		"total_iof": "\<IOF da operação\>"
	}
}

```

        **Response Canceled**

Response Body

```json
{
	"amendment_key": "\<Chave unitária característica do aditamento\>",
	"amendment_debt_key": "\<Chave unitária da operação/debt a ser aditada enviada no POST\>",
	"amendment_date": "\<Nova data de referência para a operação, originada a partir da data enviada no POST\>",
	"financial":{
		"calculate_delay": "\<Booleano para cálculo de juros de atraso em cima da operação a ser adiatada\>",
        "monthly_rate": "\<Valor em decimal do juros do aditamento ao mês\>",
		"desired_installments" : [
			{
				"due_date": "\<Nova data de vencimento da parcela\>",
				"total_amount": "\<Valor da parcela\>",
			}
		]
	},
	"additional_data": "\<JSON de campos adicionais livre enviada no POST\>",
	"amendment_status":  "canceled",
	"cancel_reason": {
		"enumerator": "non_signed_amendment",
		"description": "It wasn't possible to effect the amendment of the operation, because the amended operation hasn't been signed until the sent reference date (2023-09-19).",
		"translation": "Não foi possível efetivar o aditamento da operação, pois a operação de aditamento não foi assinada até a data de referência enviada (2023-09-19)."
	},
	"document_key": "\<Chave unitária do documento/contrato da operação de aditamento\>",
	"document_url": "\<URL do documento/contrato da operação de aditamento\>",
	"final_debt": {
		"annual_cet": "\<Custo Efetivo Total anual\>",
		"cet": "\<Custo Efetivo Total mensal\>",
		"installments":{
            "bank_slip_key": "\<Chave unitária do boleto relacionado a parcela\>",
            "business_due_date": "\<Data de vencimento da parcela, considerndo dias úteis\>",
            "calendar_days": "\<Dias corridos em relação a data de referência anterior\>",
            "digitable_line": "\<Linha digitável do boleto\>",
            "due_date": "\<Data de vencimento da parcela\>",
            "due_interest": "\<Valor de Juros da parcela\>",
            "due_principal":"\<Valor Principal da parcela\>",
            "installment_key": "\<Chave unitária característica da parcela\>",
            "installment_number": "\<Número da parcela dentro do total de parcelas\>",
            "post_fixed_amount": "\<Valor de Juros pós-fixado da parcela\>",
            "pre_fixed_amount": "\<Valor de Juros pré-fixado da parcela\>",
            "principal_amortization_amount": "\<Valor de amortização de principal da parcela\>",
            "qr_code_key": "\<Chave unitária do QR Code associado ao boleto\>",
            "qr_code_url": "\<URL do QR Code associado ao boleto\>",
            "total_amount": "\<Valor Total da parcela\>",
            "workdays": "\<Dias úteis em relação a data de referência anterior\>",
        },
		"prefixed_interest_rate": {
			"annual_rate": "\<Taxa anual de juros pré-fixado\>",
        	"daily_rate": "\<Taxa diária de juros pré-fixado\>",
        	"interest_base": "\<Base de cálculo de juros\>",
        	"monthly_rate": "\<Taxa mensal de juros pré-fixado\>",
    	},
		"issue_amount": "\<Valor de emissão da operação de aditamento\>",
		"number_of_installments": "\<Número de parcelas\>",
		"total_iof": "\<IOF da operação\>"
	}
}

```

## 3 - Cancelamento da operação de aditamento
        **Request**

ENDPOINT /amendment/[AMENDMENT_KEY]
MÉTODO DELETE

O `amendment_key` que deve ser enviado para realização do DELETE é o valor do campo, de mesmo nome, retornado na criação da operação de aditamento e que representa a chave unitária característica do aditamento.

No DELETE do aditamento, não há payload de resposta e o status da operação de aditamento é alterado para "canceled".

## 4 - Webhooks

:::danger Atenção!
Os webhooks da QI Tech não devem ser mapeadas de forma restrita. 
Campos adicionais podem ser incluídos aos payloads dos webhooks retornados em nossas APIs.
:::

:::info Reenvio de Webhooks
Você pode consultar e reenviar webhooks seguindo as instruções detalhadas na documentação: [Reenvio de Webhooks](/documentation/notificacoes/reenvio_de_notificacoes).
:::

Abaixo estão descritos os webhooks que serão enviados nas situações de assinatura, de desembolso e de cancelamento da operação de aditamento. 

**4.1.** Assinatura:

Body

```json
{
    "webhook_type": "amendment",
	"amendment_key": "\<Chave unitária característica do aditamento\>",
    "event_datetime": "\<String de data referente ao momento de assinatura no formato da ISO8601\>",
    "data": {
            "amendment_status": "signed",
            "document_key": "\<Chave unitária do documento/contrato da operação de aditamento\>",
            "signed_document_url": "\<URL do documento/contrato da operação de aditamento assinado\>"
            }
}

```

**4.2.** Desembolso:

Body

```json
{
	"webhook_type": "amendment",
	"amendment_key": "\<Chave unitária característica do aditamento\>",
	"event_datetime": "\<String de data referente ao momento de desembolso no formato da ISO8601\>",
	"data": {
		"amendment_status": "disbursed",
		"final_debt_key": "\<Chave unitária da operação/debt originada do aditamento\>",
		"installments": [
			{
            "bank_slip_key": "\<Chave unitária do boleto relacionado a parcela\>",
            "business_due_date": "\<Data de vencimento da parcela, considerndo dias úteis\>",
            "calendar_days": "\<Dias corridos em relação a data de referência anterior\>",
            "digitable_line": "\<Linha digitável do boleto\>",
            "due_date": "\<Data de vencimento da parcela\>",
            "due_interest": "\<Valor de Juros da parcela\>",
            "due_principal":"\<Valor Principal da parcela\>",
            "installment_key": "\<Chave unitária característica da parcela\>",
            "installment_number": "\<Número da parcela dentro do total de parcelas\>",
            "post_fixed_amount": "\<Valor de Juros pós-fixado da parcela\>",
            "pre_fixed_amount": "\<Valor de Juros pré-fixado da parcela\>",
            "principal_amortization_amount": "\<Valor de amortização de principal da parcela\>",
            "qr_code_key": "\<Chave unitária do QR Code associado ao boleto\>",
            "qr_code_url": "\<URL do QR Code associado ao boleto\>",
            "total_amount": "\<Valor Total da parcela\>",
            "workdays": "\<Dias úteis em relação a data de referência anterior\>"
        }
	]
	}
}

```

**4.3.** Cancelamento:

Body

```json
{
    "webhook_type": "amendment",
	"amendment_key": "\<Chave unitária característica do aditamento\>",
    "event_datetime": "\<String de data referente ao momento de desembolso no formato da ISO8601\>",
    "data": {
		"amendment_status": "canceled",
		"cancel_reason": {
			"enumerator": "\<Enumerador do motivo de cancelamento\>",
			"description": "\<Descrição do motivo de cancelamento em inglês\>",
			"translation": "\<Tradução da descrição do motivo de cancelamento\>"
		}
	}
}

```

A cancel_reason segue os seguintes enumeradores: **[Enumerador Cancel Reason](#enumerador-cancel-reason)**.

## 5 - Informações Gerais

A referência anterior nos campos `calendar_days` ou `workdays` é a data de desembolso na primeira parcela e a data de vencimento da parcela anterior nos demais casos.

O campo installments é uma lista preenchida de objetos. Nesse caso, para cada parcela do aditamento, deve haver um objeto com as respectivas informações.

| Campo | Tipo | Exemplo | Observações |
|---| ---| ---| ---|
| `additional_data` | json | { } | Não é obrigatório seu envio |
| `amendment_key` | string | 5fd3ecc8-1ea5-4d23-835c-37338da96181 | |
| `amendment_date` | string | "2023-06-05" | |
| `amendment_debt_key` | string | 31327efa-a96e-4a17-b703-e9fc39e17902 | |
| `amendment_status` | enumerador | **[Enumerador Amendment Status](#enumerador-amendment-status)** | |
| `annual_cet`	| float | 0.0012 | |
| `annual_rate`	| float | 0.0012 | |
| `bank_slip_key` | string | aea9ab16-d211-4c17-8f46-8a2669154a37 | |
| `business_due_date` | string | "2023-10-05" | |
| `calculate_delay` | bool | True | Não é obrigatório seu envio e é default como Falso |
| `calendar_days` | int | 27 | |
| `cet`	| float | 0.0012 | |
| `daily_rate` | float | 0.0012 | |
| `digitable_line` | string | 32990001031000699925351000000201192690000055231 | |
| `document_key` | string | 7f49d9ff-0878-4d48-8cc3-cb0c3c6769d2 | |
| `document_url` | string | "https://storage.googleapis.com/sandbox-doc-api/documents/7f49d9ff-0878-4d48-8cc3-cb0c3c6769d2/image_166618030043.jpg" | |
| `due_date`	| string | "2023-06-05" | |
| `due_interest`	| float | 0.0 | |
| `due_principal`	| float | 1000.10 | |
| `event_datetime` | string |	"2023-05-05T22:20:10Z" | |
| `final_debt_key` | string | 8779a554-1ec9-40ec-8ff2-cbd52fc776ef | Essa é a nova debt key  |
| `installment_number` | int | 3 | |
| `installment_key` | string | 1b65d775-b5ab-49d5-a833-46980387afb1	| |
| `interest_base` | enumerador | **[Enumerador Interest Base](#enumerador-interest-base)** | |
| `issue_amount` | float | 1000.00 | |
| `monthly_rate` | float | 0.0012 | |
| `number_of_installments` | int | 3 | |
| `post_fixed_amount` | int | 0 | Sempre zero, já que o aditamento só é válido para operações pré-fixadas |
| `pre_fixed_amount` | float | 2.00 | |
| `principal_amortization_amount` | float | 20.00 | |
| `qr_code_key` | string | 003590d0-29f8-4d18-93bb-a7c36f0f1785	| |
| `qr_code_url` | string | "00020126970014br.gov.bcb.pix2575qrcode-h.sandbox.qitech.app/bacen/cobv/cf7d2d2e-003a-4296-9daf-350864d282245204000053039865802BR5925QI SOCIEDADE DE CREDITO D6009Sao Paulo61080145200062070503***63047335"| |
| `signed_document_url` | string | "https://storage.googleapis.com/sandbox-doc-api/documents/7f49d9ff-0878-4d48-8cc3-cb0c3c6769d2/image_166618030043.jpg" | |
| `total_amount` | float | 100.00 |  |
| `total_iof` | float | 11.03 |  |
| `workdays` | int | 10 |  |

### Enumerador _Interest Base_
| Enumerador            | Descrição                                                                 |
|-----------------------|---------------------------------------------------------------------------|
| **workdays**          | Base de cálculo de juros em dias úteis considerando um ano de 252 dias    |
| **calendar_days**     | Base de cálculo de juros em dias corridos considerando um ano de 360 dias |
| **calendar_days_365** | Base de cálculo de juros em dias corridos considerando um ano de 365 dias |

### Enumerador _Amendment Status_
| Enumerador            | Descrição                                                                 |
|-----------------------|---------------------------------------------------------------------------|
| **waiting_signature** | Aguardando assinatura													    |
| **signed**     		| Assinada																    |
| **disbursed** 		| Desembolsada															    |
| **canceled** 			| Cancelada																    |
| **disbursing_error**	| Erro no momento do desembolso											    |

:::caution Atenção!
O status 'disbursing_error' representa um status intermediário, o contrato de aditamento será cancelado ou desembolsado.
:::

### Enumerador _Cancel Reason_
| Enumerador            	| Descrição                                                                    |
|---------------------------|------------------------------------------------------------------------------|
| **delete_amendment** 		| Requisição no endpoint de DELETE											   |
| **non_signed_amendment**  | Operação de aditamento não foi assinada até a data de referência enviada (amendment_date)															    |
| **different_balance_due** | Saldo devedor diferente entre a criação da operação de aditamento e o desembolso															         |
| **different_installments_number** | Número de parcelas em aberto diferente entre a criação da operação de aditamento e o desembolso																	|

---

# Schedule boleto payment

URL: /en/documentation/agendamentos/agendamento_boleto

It follows the same principle as payment in other flows, with the main difference being that you must send the schedule_date, and in this case, you will receive the schedule_key.

## Request

ENDPOINT /bank_slip/payment
METHOD POST

Request Body

```json
{
    "digitable_line": "32990001031000000001708001075103794890000015000",
    "source_account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
    "payment_date": "2023-09-25",
    "transaction_amount": 150.00
}

```

### Body params

| Field | Type | Description | Characters |
|--------------------------|--------|-------------------------------------------------------------------|------------|
| `digitable_line` * | string | Boleto's digitable line. | - |
| `resource_account_key` * | string | Key of the account to be used. | - |
| `payment_date` * | date | Date for payment. If not sent, the date will be today. | - |
| `transaction_amount` | float | Amount to be paid. | - |

:::info Information

To view the accepted payment agreements, [click here](https://storage.googleapis.com/live-doc-api/public_samples/convenios_qi_tech.xlsx).
:::

## Response

STATUS 200

Response Body: Payment through a free movement account

```json
{
    "data": {
        "digitable_line": "09990001029100010009895007444201283400000001000",
        "resource_account_key": "21af482f-b8ac-48dd-8f9a-ea23429d28be"
    },
    "event_datetime": "2020-08-06 19:22:06",
    "key": "e7719f95-a31d-4171-ae83-2d8b3d419dc2",
    "status": "waiting_approval",
    "webhook_type": "bank_slip_payment"
    "schedule_key": "e7719f95-a31d-4171-ae83-2d8b3d419dc2"
}

```

STATUS 200

Response Body: Payment through a escrow account

```json
{
    "data": {
        "digitable_line": "09990001029100010009895007444201283400000001000",
        "resource_account_key": "21af482f-b8ac-48dd-8f9a-ea23429d28be"
    },
    "event_datetime": "2020-08-06 19:22:06",
    "key": "e7719f95-a31d-4171-ae83-2d8b3d419dc2",
    "status": "waiting_approval",
    "webhook_type": "bank_slip_payment",
    "schedule_key": "e7719f95-a31d-4171-ae83-2d8b3d419dc2"
}

```

STATUS 400

Response Body

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

---

# Schedule Pix Transfer

URL: /en/documentation/agendamentos/agendamento_pix

It follows the same principle as Pix transfer, with the main difference being that you must send the schedule_date, and in this case, you will receive the schedule_key.

## Request

ENDPOINT /baas/pix_transfer
METHOD POST

**Manual**
Request Body: Manual transfer

```json
    {
        "pix_transfer_type": "manual",
        "source_account": {
            "account_branch": "0001",
            "account_digit": "2",
            "account_number": "2359934",
            "owner_document_number": "09080702000105"
        },
        "schedule_date": "2023-08-24",
        "target_account": {
              "bank_code": "104",
              "account_branch": "0001",
              "account_digit": "4",
              "account_number": "6717606",
              "owner_document_number": "60744463000190",
              "owner_name": "Qi Tech",
              "account_type": "checking",
              "ispb": "32402502"
         },
        "transaction_amount": 15
    }

```

## Response

STATUS 200
Response Body: Manual transfer

```json

{
  "data": {
      "operation_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "status": "pending",
      "event_datetime": "2021-08-04 20:05:54",
      "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "pix_transaction": {
        "pix_message": "",
        "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
        "transaction_amount": 1891268.97,
        "source_account": {
          "account_branch": "0001",
          "account_digit": "3",
          "account_number": "24339",
          "owner_document_number": "32402502000135",
          "owner_name": "Qi Tech",
          "account_type": "checking"
        },
        "target_account": {
          "target_account": "78340-6",
          "financial_institution_code": "329",
          "owner_document_number": "32402502000135",
          "owner_name": "QI Tech",
          "target_account_type": "checking_account",
          "owner_person_type": "legal",
          "trading_name": "QITech"
        },
        "fee_amount": 0,
        "schedule_date": "2020-08-04"
      }
    }
}

```
**Chave**
Request Body: Key transfer

```json
        {
            "pix_transfer_type": "key",
            "source_account": {
                "account_branch": "0001",
                "account_digit": "2",
                "account_number": "2359934",
                "owner_document_number": "09080702000105"
            },
            "schedule_date": "2023-08-24",
            "end_to_end_id":	"E32402502202308231745g1goFJ577mp",
            "pix_key":"52720072800",
            "target_account": {
                  "bank_code": "104",
                  "account_branch": "0001",
                  "account_digit": "4",
                  "account_number": "6717606",
                  "owner_document_number": "60744463000190",
                  "owner_name": "Qi Tech",
                  "ispb": "32402502"
             },
            "transaction_amount": 15
        }

```

## Response

STATUS 200
Response Body: Key transfer

```json
{
  "data": {
    "end_to_end_id": "E32402502202308231825nkKhXiA9DEA",
    "fee_amount": 1,
    "pix_message": "",
    "pix_transfer_key": "c32ad14a-6bfe-43f4-b5a1-4f335dcdd543",
    "source_account": {
      "account_brach": "0001",
      "account_digit": "2",
      "account_number": "2359934",
      "account_type": "checking",
      "owner_document_number": "09080702000105",
      "owner_name": "VOVO LUCIA CONVENIENCIA LTDA"
    },
    "target_account": {
      "document_number": "***.951.18*-**",
      "financial_institution": "CAIXA ECONOMICA FEDERAL"
    },
    "transaction_amount": 15,
    "transfer_purpose": "transfer"
  },
  "event_datetime": "2023-08-23 15:25:36",
  "operation_key": "b37224f2-9a8c-4816-b446-acb213bfe5f0",
  "schedule_key": "c32ad14a-6bfe-43f4-b5a1-4f335dcdd543",
  "status": "pending_approval"
}

```

### Body Params
| Field | Type | Description | Characters |
|---|---| ---| ---|
| `pix_transfer_type` * | string | Pix has different types of initiation: "manual", where the user must send the destination and source account fields, and "key", where the user must send the Pix key fields of the receiver (destination account) and the source account details. | 10 |
| `source_account` * | Object | Source account. | **[Object source_account](#object-source_account)** |
| `target_account` | Object | Destination account - Should only be sent in transactions of type "manual". | **[Object target_account](#object-target-account)** | 10 |
| `transaction_amount` * | string | Transfer amount. | 10 |
| `schedule_date` | date | Scheduled date of the transaction (if not sent, the transfer is made at the time of approval). | 10 |
| `receiver_conciliation_id` | string | Receiver's conciliation ID. | 10 |
| `is_chargeback` | string | Flag identifying a Pix transaction refund (boolean True or False). | 10 |
| `requester_document_identification` * | string | CPF of the user requesting the transfer. | 10 |
| `pix_transfer_key` | string | Idempotency key of a Pix transaction - should only be sent if the transfer type is "key". | 10 |
| `chargeback_amount` | string | Refund amount - This field should be sent only in case of chargeback and excludes the requirement for the "transaction_amount" field. | 10 |
| `chargeback_other_reason` | string | Refund reason (This field should be sent only in case of chargeback). | 10 |
| `chargeback_message` | string | Field for the user to insert a message during the refund (This field should be sent only in case of chargeback). | 10 |
 
### Object source_account
| Field | Type | Description | Characters |
|---|---| ---| ---|
| `account_branch` * | string | Branch number. | 0 |
| `branch_digit` | string | Branch digit. | 0 |
| `account_digit` * | string | Account digit. | 0 |
| `account_number` * | string | Account number. | 0 |
| `owner_document_number` * | string | CPF or CNPJ (numbers only) of the account holder. | 0 |

### Object target_account

| Field | Type | Description | Characters |
|---|---| ---| ---|
| `account_branch` * | string | Branch. | 10 |
| `account_digit` * | string | Account digit. | 10 |
| `account_number` * | string | Account number. | 10 |
| `owner_document_number` * | string | CPF or CNPJ (numbers only) of the account holder. | 10 |
| `owner_name` * | string | Account holder's name. | 10 |
| `account_type` * | string | CPF or CNPJ (numbers only) of the account holder. | 10 |
| `trading_name` | string | Trade name for legal entities. | 10 |
| `ispb` | string | Eight-digit code that identifies banks in the Central Bank's reserve transfer system. | 10 |

## Response

STATUS 400

Response Body

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

```

---

# Schedule TED Transfer

URL: /en/documentation/agendamentos/agendamento_ted

It follows the same principle as a regular transfer, with the main difference being that you must send the schedule_date, and in this case, you will receive the schedule_key.

## Request

ENDPOINT /wire_transfer
METHOD POST

Request Body

```json
{
    "source_account": {
        "account_branch": "0001",
        "account_number": "9477323",
        "account_digit": "0",
        "owner_document_number": "38299588000107"
    },
    "target_account": {
        "financial_institution_code": "341",
        "account_branch": "0001",
        "account_number": "92796",
        "account_digit": "1",
        "owner_document_number": "23599885000192",
        "owner_name": "plugify"
    },
    "schedule_date": "2023-10-10",
    "transaction_amount": 8.86
}

```

### BODY PARAMS

| Field | Type | Description | Characters |
|---|---| ---| ---|
| `source_account` * | object | Source account. | **[Object source_account](#object-source_account)** |
| `target_account` * | object | Destination account. | **[Object target_account](#object-target_account)** |
| `transaction_amount` * | double | Transfer amount. | 10 |
| `schedule_date` * | date | Scheduled date of the transaction, if not specified the transaction will be made at the time of sending or as soon as approved. | 10 |

### Object source_account
| Field | Type | Description | Characters |
|---|---| ---| ---|
| `account_branch` * | string | Branch. | 10 |
| `account_digit` * | string | Account digit. | 10 |
| `account_number` * | string | Account number. | 10 |
| `owner_document_number` * | string | CPF or CNPJ (numbers only) of the account holder. | 10 |
| `target_account_type` * | string | Destination account type | **[Enumerators](#enumeradores-ted_account_type)** |

### Object target_account

| Field | Type | Description | Characters |
|---|---| ---| ---|
| `account_branch` * | string | Branch. | 10 |
| `account_digit` * | string | Account digit. | 10 |
| `account_number` * | string | Account number. | 10 |
| `owner_document_number` * | string | CPF or CNPJ (numbers only) of the account holder. | 10 |
| `owner_name` * | string | Account holder's name. | 10 |

### Enumerators target_account_type

| Enumerator | Translation |
|---|---|
| checking_account | current account |
| deposit_account | deposit account |
| guaranteed_account | guarantee account |
| investment_account | investment account |
| payment_account | payment account |
| saving_account | savings account |

## Response
### Transfer from a free movement account

STATUS 200

Response Body

```json
{
  "data": {
    "outgoing_ted_key": null,
    "schedule_date": "2023-10-10",
    "schedule_key": "3be3e5ef-5e43-4d04-b987-be80ae983529",
    "source_account": {
      "account_branch": "0001",
      "account_digit": "0",
      "account_number": "9477323",
      "owner_document_number": "38299588000107"
    },
    "target_account": {
      "account_branch": "0001",
      "account_digit": "1",
      "account_number": "92796",
      "financial_institution_code": "341",
      "owner_document_number": "23599885000192",
      "owner_name": "plugify"
    },
    "transaction_amount": 8.86
  },
  "event_datetime": "2023-08-23 19:40:54",
  "key": "2b198f4d-1b1d-4116-8cd6-ec3da64e6b96",
  "status": "success",
  "webhook_type": "wire_transfer"
}

```

### Transferência a partir de uma conta de escrow

STATUS 200

Response Body

```json
{
  "data": {
    "source_account": {
      "account_branch": "0001",
      "account_digit": "3",
      "account_number": "24339",
      "owner_document_number": "32402502000135"
    },
    "target_account": {
      "account_branch": "0001",
      "account_digit": "6",
      "account_number": "78340",
      "financial_institution_code": "329",
      "owner_document_number": "32402502000135",
      "owner_name": "QI Tech"
    },
    "transaction_key": "7986dcc7-4331-478f-af47-adfbdf7f4a36",
    "transaction_amount": 1891268.97
  },
  "event_datetime": "2019-11-28 19:22:04",
  "key": "fa80723e-4f9a-42b1-9410-d5fa3c183fa8",
  "status": "success",
  "webhook_type": "wire_transfer"
}

```

STATUS 400

Response Body

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

```

---

# Cancellation of scheduling

URL: /en/documentation/agendamentos/cancelar_agendamento

## Request

ENDPOINT /account/transaction/schedule/SCHEDULED_TRANSACTION_KEY/cancel
METHOD PATCH

Request Body

```json
{
            "reason": "reason (opcional)"
}

```

### PATH PARAMS

| Field | Type | Description |
|---------------|--------|------------------------------------|
| `SCHEDULED_TRANSACTION_KEY` | string | Key that identifies the scheduling |

Response Body

```json
{}
```

STATUS 400

Response Body

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

```

:::danger General Observations:
Only approved schedules are subject to cancellation when approval is applicable!
:::

---

# List of scheduled transactions

URL: /en/documentation/agendamentos/consulta_agendamentos

## Request

ENDPOINT /account/ACCOUNT_KEY/scheduled_transactions
METHOD GET

### QUERY PARAMS

| Field | Description |
|----------------------|--------------------------------------------|
| `status` | Status of a boleto |
| `date` | Date of the scheduling. |
| `page_number` | Current page being consulted |
| `page_size` | Number of results per page |

### PATH PARAMS
| Field | Description |
|----------------------|--------------------------------------------|
| `ACCOUNT_KEY` | account_key of the source account of the transactions |

## Response

STATUS 200

Response Body

```json
{
  "data": [{
    "outgoing_pix_key": "chave da schedule",
    "outgoing_ted_key": "chave da schedule",
    "schedule_date": "iso date string",
    "source_account_key": "chave da conta de origem da transação",
    "target_account_bank_code": "banco destino (opcional)",
    "target_account_bank_ispb": "ispb destino (opcional)",
    "target_account_branch": "agencia destino",
    "target_account_number": "conta de destino",
    "target_account_digit": "digito conta destino",
    "target_account_type": "tipo de conta destino (opcional)",
    "beneficiary_name": "nomoe do beneficiario",
    "beneficiary_document_number": "documento do beneficiario (cpf/cnpj)",
    "scheduled_amount": "valor agendadp",
    "beneficiary_person_type": "tipo de beneficiario",
    "target_account_key": "chave da conta destino (opcional)",
    "source_subtype": "tipo de transação (enum)",
    "created_at": "data em que o agendamento foi feito",
    "status": "status do agendamento",
    "pix_key": "chave pix destino (opcional)",
    "cancellation_requester": "identificação do requisitor do cancelamento",
    "cancellation_reason": "origem do cancelamento (enum)",
    "updated_at": "data de atualização"
  }],
  "pagination": {
    "current_page": 1,
    "next_page": null,
    "rows_per_page": 10
  }
}
```

:::danger General Observations:
Only approved schedules will be listed when approval is applicable!
:::

---

# arranjos_e_adquirentes

URL: /en/documentation/arranjos_e_adquirentes/

## Arranjos e Adquirentes

### Adquirentes

As adquirentes são empresas como a Stone, a Cielo e a Rede, e seu papel é liquidar as transações financeiras por meio de cartão de crédito e débito. Para isso, elas se comunicam com as bandeiras de cartão e os bancos emissores (como Nubank, Itaú, Santander etc.) para processar as transações.

Lista de adquirentes:

| Nome | CNPJ |
|---|---|
|BRB – BANCO DE BRASÍLIA S.A|208000100|
|CIELO S.A.|1027058000191|
|BANCO COOPERATIVO SICREDI S.A.|1181521000155|
|REDECARD S.A.|1425787000104|
|CREDICARD|1425787003383|
|VERDECARD ADMINISTRADORA DE CARTÕES S.A.|1722480000167|
|WORLDPAY DO BRASIL PROCESSAMENTO DE PAGAMENTOS LTDA|991143000102|
|BANCO COOPERATIVO DO BRASIL S.A.|2038232000164|
|CABAL BRASIL LTDA|3766873000106|
|CRED-SYSTEM|4670195000138|
|FD DO BRASIL SOLUÇÕES DE PAGAMENTO LTDA|4962772000165|
|PAGSEGURO INTERNET S.A.|8561701000101|
|ELO SERVIÇOS S.A|9227084000175|
|GETNET ADQUIRENCIA E SERVIÇOS PARA MEIOS DE PAGAMENTO S.A.|10440482000154|
|MERCADO.COM REPRESENTAÇÕES LTDA|10573521000515|
|ELAVON DO BRASIL SA|12592831000189|
|SAQUE E PAGUE REDE DE AUTOATENDIMENTO|12901364000121|
|HUB PAGAMENTOS S.A.|13884775000119|
|ADYEN DO BRASIL LTDA|14796606000190|
|STONE PAGAMENTOS S.A.|16501555000157|
|BANCO TRIÂNGULO S.A|17351180000159|
|CLOUDWALK MEIOS DE PAGAMENTOS E SERVICOS LTDA|18189547000142|
|BANCO BONSUCESSO S.A. ADQUIRENTE|20520298000178|
|BANCO BONSUCESSO S.A. ADQUIRENTE|20520298000178|
|STRIPE BRASIL SOLUÇÕES DE PAGAMENTO LTDA|22121209000146|
|BMG GRANITO SOLUÇÕES EM PAGAMENTO S.A|22177858000169|
|BOLT CARD CREDENCIADORA DE CARTAO DE CREDITO LTDA|28080769000186|
|BEN BENEFÍCIOS E SERVIÇOS S.A.|30798783000161|
|LISTO INSTITUIÇÃO DE PAGAMENTO LTDA|32971064000126|
|ACQIO ADQUIRÊNCIA S.A|33171211000146|
|BANCO SAFRA S.A.|58160789000128|
|BANCO SMARTBANK S.A.|58497702000102|
|SOROCRED MEIOS DE PAGAMENTO|60114865000100|
|BANCO CREFISA S.A|61033106000186|
|BANCO RENDIMENTO S.A|68900810000138|
|BANRISUL CARTÕES S.A|92934215000106|
|Global Payments - Servicos de Pagamentos S.a.|17887874000105|
|POVIG TECNOLOGIA EM PAGAMENTOS ELETRONICOS LTDA.|35524559000103|

### Arranjos de Pagamentos

Os arranjos de pagamentos são, basicamente, um conjunto de regras, regulamentos e processos que permitem a realização de serviços financeiros, como saques, transferências, emissão de cartão de crédito, débito e outras soluções de pagamento.

Lista de arranjos:

| Código | Descrição |
|---|---|
|ACC|Amex Cartão de Crédito|
|BCC|Banescard Cartão de Crédito|
|BCD|Banescard Cartão de Débito|
|BVV|Banescard Cartão de Débito|
|BVV|Ben Visa Vale|
|CAC|Cielo Amex Crédito|
|CBC|Cabal Crédito|
|CBD|Cabal Débito|
|CBP|Cabal Pré-pago|
|CDC|Cielo Diners Cartão de Crédito|
|CEC|Cielo Elo Cartão de Crédito|
|CED|Cielo Elo Cartão de Débito|
|CHC|Cielo Hipercard Crédito|
|CMC|Cielo Mastercard Crédito|
|CMD|Cielo Mastercard Débito|
|CZC|Credz Crédito|
|DCC|Diners Cartão de Crédito|
|ECC|Elo Cartão de Crédito|
|ECD|Elo Cartão de Débito|
|GCC|Goodcard Crédito|
|GDC|Global Payments Diners Crédito|
|GMC|Global Payments Mastercard Crédito|
|GMD|Global Payments Mastercard Débito|
|GVC|Global Payments Visa Crédito|
|GVD|Global Payments Visa Débito|
|HCC|Hipercard Cartão de Crédito|
|JCC|JCB Cartão de Crédito|
|MAC|Mais Cartão de Crédito|
|MCA|Mastercard Cartão ATM|
|MCC|Mastercard Cartão de Crédito|
|MCD|Mastercard Cartão de Débito|
|MCP|Mastercard Cartão Pré-pago|
|OCD|Ourocard Cartão de Débito|
|SCC|Sorocred Cartão de Crédito|
|SCD|Sorocred Cartão de Débito|
|VCA|Visa Cartão ATM|
|VCC|Visa Cartão de Crédito|
|VCD|Visa Cartão de Débito|
|VCP|Visa Cartão Pré-pago|
|VDC|Verdecard Cartão de Crédito|
|VIC|Visa Internacional Compra Crédito|
|VID|Visa Internacional Compra Débito|
|HCD|Hiper Débito|
|SIC|Sicredi|
|BRS|Banrisul|
|CUP|Cup Crédito|
|FRC|Fortbrasil|
|MXC|Maxifrota|
|SFC|Senff|
|TKC|TicketLog|
|BNC|Banese Card|
|BRC|Brasil Card|
|SPC|Sem Parar|
|CSC|Credi-Shop|
|DAC|Dacasa|
|AGC|Agiplan|
|AUC|Aura|
|RCC|Redesplan|
|AVC|Avista|
|CCD|Calcard|
|DBC|Discover|
|99T|Todas|

---

# Criar uma renegociação

URL: /en/documentation/arranjos_e_adquirentes/consulta_de_agenda

## Request

ENDPOINT /debt
MÉTODO POST

Request Body

```json
{
  "notification_type": "webhook",
  "owner_person_type": "legal",
  "owner_person_name": "John Sample Inc",
  "owner_document_number": "86498542000151",
  "reference_code": "5830c2f9-fd17-4c9c-b30c-68ddd1a92751",
  "signature": {
    "signers": [
      {
        "name": "John Sample",
        "email": "john.sample@yopmail.com",
        "person_type": "natural",
        "document_number": "42889916090"
      }
    ]
  },
  "agenda": {
    "acquirers": [
      "cdc"
    ],
    "card_schemes": [
      "cdc"
    ],
    "end_date": "2021-06-23",
    "start_date": "2021-06-23"
  }
}

```

:::caution Atenção!

O payload ultilizado na emissão de um refinanciamento é o mesmo ultilizado na emissã de uma divida simples, com a adição da lista de operações que serão quitadas em **"refinanced_credit_operations"**.
:::

### Body Params

| Campo                           | Tipo   | Descrição                                                                                                                                                                                                        | Máx. Caract. | 
|---------------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| **notification_type** *                  | enum | tipo de notificação                                                                                                                                    | -            | 
| **owner_person_type** * | enum |Tipo de pessoa (natural ou juridica) objeto da consulta de agenda.                                                                       | -            |
| **owner_person_name** *                 | string | Nome do objeto da consulta de agenda. | -            |
| **owner_document_number** * | string | Numero de documento do objeto da consulta de agenda.                                                                                                                                                    | -            |
| **reference_code** * | object | Identificador único do opt-in.                                                                                                                                                    | -            |
| **signature** * | object | Informações do opt-in.              refinanciadas.                                                                                                                                                           | -            |
| **agenda** * | object | Parâmetros para a consulta de agenda.                                                                                                                                                          | -            |

## Definições

### Objeto agenda
| Campo                           | Tipo   | Descrição                                                                                                                                                                                                        | Máx. Caract. | 
|---------------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| **acquirers** *                  | array | Lista de números de documentos da Credenciadoras.                                                                                                                                     | -            | 
| **card_schemes** * | array | Lista de arranjos de pagamento.                                                                      | -            |
| **end_date** *                 | string | Data de termino da consulta. | -            |
| **start_date** * | string | Data de início da consulta.                                                                                                                                                           | -            |

# Enumeradores

### Enumerador _Person Type_
| Enumerador             | Descrição             |
|------------------------|-----------------------|
| **legal**   | Pessoa juridica        |
| **natural**    | Pesso física    |

### Enumerador _Account Type_
| Enumerador             | Descrição             |
|------------------------|-----------------------|
| **webhook**   | Conta corrente        |

## Response

STATUS 200

Response Body

```json
{}
```

STATUS 400

Response Body

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

---

# trava_de_domicilio_bancario

URL: /en/documentation/arranjos_e_adquirentes/trava_de_domicilio_bancario

Caso o cliente deseje realizar uma operação de crédito com garantia em recebíveis, a QI Tech juntamente com a CERC, está preparada para criar essa operação de maneira muito semelhante ao fluxo de emissão de dívida comum.

# Criar uma renegociação

## Request

ENDPOINT /baas/debt_receivables
MÉTODO POST

Request Body

```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": {
        "amount": 123456,
        "interest_type": "pre_price_days",
        "credit_operation_type": "ccb",
        "annual_interest_rate": 2.32,
        "disbursement_date": "2023-03-01",
        "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",
      "contract": {
    "payment_account": {
      "account_number": "48391",
      "account_branch": "0001",
      "account_digit": "6",
      "owner_document_number": "86498542000151"
    },
    "collaterals": [
      {
        "card_scheme": [
          "abc"
        ],
        "initial_date": "2021-06-28",
        "final_date": "2021-07-06",
        "division_rule": 2,
        "encumbered_amount": 30
      }
    ],
    "collateral_management": {
      "collateral_management_type": "absolute",
      "amount": 2000,
      "maximum_value": 2000,
      "maximum_daily_value": 200,
      "minimum_date": "2021-06-28",
      "contract_payment_type": "partial_payment"
    }
  }
}
```

## Response

STATUS 200

Response Body

```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": [
        {
          "signature_url": "https://sign.qitech.com.br/s/hNrwjda",
          "signer_document_number": "94632180173",
          "signer_email": "pedro.alves@yopmail.com",
          "signer_external_key": "07a1c438-43a4-49a9-85a9-29667507453b",
          "signer_name": "Pedro Felipe Henrique Alves",
          "signer_role": "issuer"
        },
        {
          "signature_url": "https://sign.qitech.com.br/s/EaTajda",
          "signer_document_number": "34651104630",
          "signer_email": "patricia.tereza@yopmail.com",
          "signer_external_key": "61a1ea50-769a-410a-8ef8-09f0ce4611f6",
          "signer_name": "Patrícia Tereza Bernardes",
          "signer_role": "guarantor"
        }
      ],
      "urls": [
        "https://storage.googleapis.com/sandbox-doc-api/documents/abedfeab-dcf8-4e13-897b-da02c222cef4/SALGADINHO_SALETE_LTDA-PARMALAT-CCB-1907258737-20220512165254.pdf"
      ]
    },
    "contract_fee_amount": 50000,
    "contract_fees": [
      {
        "fee_amount": 50000,
        "fee_type": "tac"
      }
    ],
    "external_contract_fee_amount": 0,
    "external_contract_fees": [],
    "installments": [
      {
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2019-08-26",
        "calendar_days": 32,
        "digitable_line": null,
        "due_date": "2019-08-26",
        "due_interest": null,
        "due_principal": 10000000,
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "81e4a732-d300-4e39-b6d5-2d9ac8df429b",
        "installment_number": 1,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 10000000,
        "original_pre_fixed_amount": 1125598.54,
        "original_principal_amortization_amount": 1000000,
        "original_total_amount": null,
        "paid_amount": 0,
        "paid_at": null,
        "payments": [],
        "post_fixed_amount": null,
        "pre_fixed_amount": 1125598.54,
        "principal_amortization_amount": 1000000,
        "tax_amount": 1312,
        "total_amount": null,
        "total_paid_amount": 0,
        "workdays": 22
      },
      {
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2019-09-25",
        "calendar_days": 30,
        "digitable_line": null,
        "due_date": "2019-09-25",
        "due_interest": null,
        "due_principal": 9000000,
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "bac4fe3e-9559-4380-9f4b-bdda3492738e",
        "installment_number": 2,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 9000000,
        "original_pre_fixed_amount": 946509.06,
        "original_principal_amortization_amount": 1000000,
        "original_total_amount": null,
        "paid_amount": 0,
        "paid_at": null,
        "payments": [],
        "post_fixed_amount": null,
        "pre_fixed_amount": 946509.06,
        "principal_amortization_amount": 1000000,
        "tax_amount": 2542,
        "total_amount": null,
        "total_paid_amount": 0,
        "workdays": 22
      },
      {
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2019-10-25",
        "calendar_days": 30,
        "digitable_line": null,
        "due_date": "2019-10-25",
        "due_interest": null,
        "due_principal": 8000000,
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "aaaec4d7-94a0-418d-8a8e-ac7af6787aec",
        "installment_number": 3,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 8000000,
        "original_pre_fixed_amount": 841341.39,
        "original_principal_amortization_amount": 1000000,
        "original_total_amount": null,
        "paid_amount": 0,
        "paid_at": null,
        "payments": [],
        "post_fixed_amount": null,
        "pre_fixed_amount": 841341.39,
        "principal_amortization_amount": 1000000,
        "tax_amount": 3772,
        "total_amount": null,
        "total_paid_amount": 0,
        "workdays": 22
      },
      {
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2019-11-25",
        "calendar_days": 31,
        "digitable_line": null,
        "due_date": "2019-11-25",
        "due_interest": null,
        "due_principal": 7000000,
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "bead5a38-c56e-4cfc-98f9-af6d71ec7d65",
        "installment_number": 4,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 7000000,
        "original_pre_fixed_amount": 762003.23,
        "original_principal_amortization_amount": 1000000,
        "original_total_amount": null,
        "paid_amount": 0,
        "paid_at": null,
        "payments": [],
        "post_fixed_amount": null,
        "pre_fixed_amount": 762003.23,
        "principal_amortization_amount": 1000000,
        "tax_amount": 5043,
        "total_amount": null,
        "total_paid_amount": 0,
        "workdays": 20
      },
      {
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2019-12-26",
        "calendar_days": 31,
        "digitable_line": null,
        "due_date": "2019-12-26",
        "due_interest": null,
        "due_principal": 6000000,
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "350a89e3-58a7-4879-b7ff-5fa0391da39c",
        "installment_number": 5,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 6000000,
        "original_pre_fixed_amount": 653145.63,
        "original_principal_amortization_amount": 1000000,
        "original_total_amount": null,
        "paid_amount": 0,
        "paid_at": null,
        "payments": [],
        "post_fixed_amount": null,
        "pre_fixed_amount": 653145.63,
        "principal_amortization_amount": 1000000,
        "tax_amount": 6314,
        "total_amount": null,
        "total_paid_amount": 0,
        "workdays": 22
      },
      {
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2020-01-27",
        "calendar_days": 32,
        "digitable_line": null,
        "due_date": "2020-01-27",
        "due_interest": null,
        "due_principal": 5000000,
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "bf935dc2-3151-4f66-91c6-35e446b57f2e",
        "installment_number": 6,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 5000000,
        "original_pre_fixed_amount": 562799.27,
        "original_principal_amortization_amount": 1000000,
        "original_total_amount": null,
        "paid_amount": 0,
        "paid_at": null,
        "payments": [],
        "post_fixed_amount": null,
        "pre_fixed_amount": 562799.27,
        "principal_amortization_amount": 1000000,
        "tax_amount": 7626,
        "total_amount": null,
        "total_paid_amount": 0,
        "workdays": 20
      },
      {
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2020-02-26",
        "calendar_days": 30,
        "digitable_line": null,
        "due_date": "2020-02-26",
        "due_interest": null,
        "due_principal": 4000000,
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "76aad8ce-3ee1-464c-90db-d72a2729560e",
        "installment_number": 7,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 4000000,
        "original_pre_fixed_amount": 420670.69,
        "original_principal_amortization_amount": 1000000,
        "original_total_amount": null,
        "paid_amount": 0,
        "paid_at": null,
        "payments": [],
        "post_fixed_amount": null,
        "pre_fixed_amount": 420670.69,
        "principal_amortization_amount": 1000000,
        "tax_amount": 8856,
        "total_amount": null,
        "total_paid_amount": 0,
        "workdays": 20
      },
      {
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2020-03-25",
        "calendar_days": 28,
        "digitable_line": null,
        "due_date": "2020-03-25",
        "due_interest": null,
        "due_principal": 3000000,
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "fc190222-5baf-4023-9e93-95b25774a37e",
        "installment_number": 8,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 3000000,
        "original_pre_fixed_amount": 293473.82,
        "original_principal_amortization_amount": 1000000,
        "original_total_amount": null,
        "paid_amount": 0,
        "paid_at": null,
        "payments": [],
        "post_fixed_amount": null,
        "pre_fixed_amount": 293473.82,
        "principal_amortization_amount": 1000000,
        "tax_amount": 10004,
        "total_amount": null,
        "total_paid_amount": 0,
        "workdays": 20
      },
      {
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2020-04-27",
        "calendar_days": 33,
        "digitable_line": null,
        "due_date": "2020-04-27",
        "due_interest": null,
        "due_principal": 2000000,
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "7c2972a8-def7-4b76-b215-0ade0a5bca13",
        "installment_number": 9,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 2000000,
        "original_pre_fixed_amount": 232548.93,
        "original_principal_amortization_amount": 1000000,
        "original_total_amount": null,
        "paid_amount": 0,
        "paid_at": null,
        "payments": [],
        "post_fixed_amount": null,
        "pre_fixed_amount": 232548.93,
        "principal_amortization_amount": 1000000,
        "tax_amount": 11357,
        "total_amount": null,
        "total_paid_amount": 0,
        "workdays": 21
      },
      {
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2020-05-25",
        "calendar_days": 28,
        "digitable_line": null,
        "due_date": "2020-05-25",
        "due_interest": null,
        "due_principal": 1000000,
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "d848c880-f489-4bc1-a9e4-101f8d664317",
        "installment_number": 10,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 1000000,
        "original_pre_fixed_amount": 97824.6,
        "original_principal_amortization_amount": 1000000,
        "original_total_amount": null,
        "paid_amount": 0,
        "paid_at": null,
        "payments": [],
        "post_fixed_amount": null,
        "pre_fixed_amount": 97824.6,
        "principal_amortization_amount": 1000000,
        "tax_amount": 12505,
        "total_amount": null,
        "total_paid_amount": 0,
        "workdays": 19
      }
    ],
    "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"
}

```

:::caution Atenção!

O payload ultilizado na emissão de um refinanciamento é o mesmo ultilizado na emissã de uma divida simples, com a adição da lista de operações que serão quitadas em **"refinanced_credit_operations"**.
:::

### Body Params

| Campo                           | Tipo   | Descrição                                                                                                                                                                                                        | Máx. Caract. | 
|---------------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| **borrower** *                  | object | **[Objeto Borrower](#objeto-borrower)** - Devedor da operação de crédito.                                                                                                                                         | -            | 
| **disbursement_bank_account** * | object | **[Objeto Disbursement Bank Account](#objeto-disbursement_bank_accounts)** - Dados da conta bancária para desembolso da operação.                                                                                 | -            |
| **financial** *                 | object | **[Objeto Financial](#objeto-financial)** - Dados da conta bancária para desembolso da operaçãoIdentificador de que o objeto enviado é uma pessoa física. Deve conter SEMPRE o  valor "natural" para borrower PF. | -            |
| **purchaser_document_number** * | string | CNPJ do cessionário (comprador) da operação de crédito.                                                                                                                                                           | -            |
| **refinanced_credit_operations** * | array of objects | Lista de **[Objetos Refinanced Credit Operations](#objeto-refinanced_credit_operations)** contendo as operações refinanciadas.                                                                                                                                                           | -            |

## Definições

### Objeto Request Body
| Campo                           | Tipo   | Descrição                                                                                                                                                                                                        | Máx. Caract. | 
|---------------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| **borrower** *                  | object | **[Objeto Borrower](#objeto-borrower)** - Devedor da operação de crédito                                                                                                                                         | -            | 
| **disbursement_bank_account** * | object | **[Objeto Disbursement Bank Account](#objeto-disbursement_bank_accounts)** - Dados da conta bancária para desembolso da operação                                                                                 | -            |
| **financial** *                 | object | **[Objeto Financial](#objeto-financial)** - Dados da conta bancária para desembolso da operaçãoIdentificador de que o objeto enviado é uma pessoa física. Deve conter SEMPRE o  valor "natural" para borrower PF | -            |
| **purchaser_document_number** * | string | CNPJ do cessionário (comprador) da operação de crédito                                                                                                                                                           | -            |
| **contract** * | object | **[Objeto Financial](#objeto-contract)**  com dados da garantia.                                                                                                                                                           | -            |

### Objeto Borrower
| Campo                            | Tipo    | Descrição                                                                             | Máx. Caract. | 
|----------------------------------|---------|---------------------------------------------------------------------------------------|--------------|
| **name** *                       | string  | Nome do devedor                                                                       | 100          |
| **email**                        | string  | Email do devedor                                                                      | 254          |
| **phone**                        | object  | **[Objeto Phone](#objeto-phone)** - Telefone de contato do devedor                    | -            | 
| **is_pep** *                     | boolean | Indicador de PEP (http://www.portaldatransparencia.gov.br/download-de-dados/pep)      | -            |
| **address** *                    | object  | **[Objeto Address](#objeto-address)** - Endereço do devedor                           | -            | 
| **role_type** *                  | enum    | default: _issuer_                                                                     | -            |
| **birth_date** *                 | date    | Data de nascimento do devedor (formato "AAAA-MM-DD")                                  | -            |
| **mother_name** *                | string  | Nome da mãe do devedor                                                                | 100          |
| **nationality**                  | string  | Nacionalidade do devedor                                                              | 50           |
| **person_type** *                | string  | Indicador de pessoa física - default: _natural_                                       | -            |
| **individual_document_number** * | string  | CPF do devedor (apenas números)                                                       | 11           |
| **document_identification**     * | string  | **DOCUMENT_KEY** do PDF do documento de identificação do devedor com foto (RG ou CNH) | -            |
| **document_identification_back** |string | DOCUMENT_KEY do PDF da parte de trás do documento de identificação da pessoa com foto (RG ou CNH) (enviado previamente). | 11 |
| **wedding_certificate** | string | DOCUMENT_KEY do PDF do certificado de casamento da pessoa (enviado previamente). No caso de marital_status ser "single", o valor deste campo deve ser NULL. | 11 |
| **proof_of_residence** * |string | DOCUMENT_KEY do PDF do comprovante de endereço do endereço enviado (enviado previamente). | 11 |

### Objeto Address
| Campo              | Tipo   | Descrição                                                                | Máx. Caract. | 
|--------------------|--------|--------------------------------------------------------------------------|--------------| 
| **city** *         | string | Cidade do endereço                                                       | 100          |
| **state** *        | string | Estado do endereço (com dois caracteres maiúsculos)                      | 2            |
| **number** *       | string | Número do endereço                                                       | 10           |
| **street** *       | string | Rua do endereço                                                          | 100          |
| **complement** *   | string | Complemento do endereço (texto livre)                                    | 100          |
| **postal_code** *  | string | CEP do endereço (http://www.buscacep.correios.com.br/sistemas/buscacep/) | 8            |
| **neighborhood** * | string | Bairro do endereço                                                       | 100          |

### Objeto Phone
| Campo              | Descrição | Exemplo                                               | Máx. Caract. | 
|--------------------|-----------|-------------------------------------------------------|--------------| 
| **number** *       | string    | Número de telefone                                    | 10           |
| **area_code** *    | string    | Código DDD do telefone (https://ddd.guiamais.com.br/) | 2            |
| **country_code** * | string    | Código DDI do telefone (https://ddi.guiamais.com.br/) | 3            |

### Objeto Disbursement Bank Account

Uma emissão de dívida deve conter as informações bancárias para desembolso, por padrão, uma conta de titularidade do devedor.

| Campo                 | Tipo   | Descrição                                                                                          | Máx. Caract. | 
|-----------------------|--------|----------------------------------------------------------------------------------------------------|--------------|
| name                  | string | Nome do titular da conta                                                                           | 50           |
| document_number       | string | CPF do titular da conta                                                                            | 11           |
| bank_code *           | string | Código COMPE da instituição financeira (https://www.bcb.gov.br/pom/spb/estatistica/port/ASTR003.pdf) | 3            |
| branch_number *       | string | Número da agência (não informar o dígito verificador da agência!)                                  | 4            |
| account_number *      | string | Número da conta (sem o dígito verificador da conta!)                                               | 10           |
| account_digit *       | string | Dígito verificador da conta (informar zero no lugar de letras)                                     | 1            |
| account_type          | enum   | [Enumerador Account Type](#enumerador-account-type) Tipo da conta                                  | 1            |

### Objeto Financial

O objeto financial descreve as informações financeiras da operação de crédito.

| Campo                      | Tipo   | Descrição                                                                                                     | Máx. Caract. |
|----------------------------|--------|---------------------------------------------------------------------------------------------------------------|--------------|
| **amout**                  | float  | Valor de emissão/nominal da operação de crédito                                                               | -            |
| **interest_type**          | object | **[Enumerador Interest Type](#enumerador-interest-type)** - Método de amortização e forma de cálculo de juros | -            |
| **credit_operation_type**  | object | **[Enumerador Credit Operation Type](#enumerador-credit-operation-type)** - Tipo do contrato de crédito       | -            |
| **annual_interest_rate**   | float  | Taxa de juros pré-fixada expressa em decimal ao ano                                                           | -            |
| **disbursement_date**      | date   | Data do desembolso da operação                                                                                | -            |
| **interest_grace_period**  | int    | Carência de juros (em meses)                                                                                  | -            |
| **principal_grace_period** | int    | Período carência de principal                                                                                 | -            |
| **number_of_installments** | int    | Número de parcelas da operação de crédito                                                                     | -            |
| **fine_configuration**     | object | **[Objeto Fine Configuration](#objeto-fine-configuration)** - Configuração de juros e multa por atraso        | -            |

### Objeto Fine Configuration

No Objeto Fine Configuration são informados os valor de multa e juros por atraso da operação de crédito. 

| Campo                  | Tipo  | Descrição                                                                            | Máx. Caract. |
|------------------------|-------|--------------------------------------------------------------------------------------|--------------|
| **contract_fine_rate** | float | Percentual de multa por atraso                                                       | -            |
| **interest_base**      | enum  | **[Enumerador Interest Base](#enumerador-interest-base)** - Base de cálculo de juros | -            |
| **monthly_rate**       | float | Percentual de juros de atraso ao mês                                                 | -            |

### Objeto Contract

O objeto financial descreve as informações financeiras da operação de crédito.

| Campo                      | Tipo   | Descrição                                                                                                     | Máx. Caract. |
|----------------------------|--------|---------------------------------------------------------------------------------------------------------------|--------------|
| **payment_account**                  | object  | Conta de pagamentos para os recebíveis.                                                               | -            |
| **collaterals**          | array | Listas de garantias. | -            |
| **collateral_management**  | object | **[Objeto Collateral Management](#objeto-collateral-management)** - Configurações de garantia.       | -            |

### Objeto Collateral Management

O objeto financial descreve as informações financeiras da operação de crédito.

| Campo                      | Tipo   | Descrição                                                                                                     | Máx. Caract. |
|----------------------------|--------|---------------------------------------------------------------------------------------------------------------|--------------|
| **collateral_management_type**                  | enum  |  **[Enumerador Collateral Management Type](#enumerador-collateral-management-type)** - Tipo de gestão a ser utilizada para amortizar a divida.                                                               | -            |
| **amount**          | float | Valor a ser utilizado. | -            |
| **maximum_value**  | float | Valor máximo que será utilizado para pagamento da operação.      | -            |
| **maximum_daily_value**  | float | Valor máximo que será utilizado por dia.       | -            |
| **minimum_date**  | string | Data mínima para começar à utilizar os recebiveis.      | -            |
| **contract_payment_type**  | enum | **[Enumerador Credit Operation Type](#enumerador-credit-operation-type)** - Tipo de pagamento para o contrato       | -            |

# Enumeradores

### Enumerador _Person Type_
| Enumerador             | Descrição             |
|------------------------|-----------------------|
| **legal**   | Pessoa juridica        |
| **natural**    | Pesso física    |

### Enumerador _Account Type_
| Enumerador             | Descrição             |
|------------------------|-----------------------|
| **checking_account**   | Conta corrente        |
| **deposit_account**    | Conta de depósito     |
| **guaranteed_account** | Conta de garantia     |
| **investment_account** | Conta de investimento |
| **payment_account**    | Conta de pagamento    |
| **saving_account**     | Conta poupança        |
| **salary_account**     | Conta salário         |

### Enumerador _Interest Type_
| Enumerador           | Descrição                                                                                                                                                                |
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **pre_price_days**   | Método de amortização Price (parcelas iguais) com cálculo do juros pré-fixado ao dia                                                                                     |
| **pre_price**        | Método de amortização Price (parcelas iguais) com cálculo do juros pré-fixado em períodos fixos (30 dias)                                                                |
| **pre_sac**          | Método de amortização SAC (amortização constante) com cálculo do juros pré-fixado ao dia                                                                                 |
| **post_sac**         | Método de amortização SAC (amortização constante) com cálculo do juros baseado em uma taxa pré-fixada + indexador pós-fixado (cdi, ipca ou igpm) ao dia                  |
| **post_price**       | Método de amortização Price (parcelas iguais) com cálculo do juros baseado em uma taxa pré-fixada + indexador pós-fixado (cdi, ipca ou igpm) em períodos fixos (30 dias) |
| **post_price_days**  | Método de amortização Price (parcelas iguais) com cálculo do juros baseado em uma taxa pré-fixada + indexador pós-fixado (cdi, ipca ou igpm) ao dia                      |

### Enumerador _Credit Operation Type_
| Enumerador    | Descrição                      |
|---------------|--------------------------------|
| **ccb**       | Cédula de Crédito Bancário     |
| **cce**       | Cédula de Crédito à Exportação |
| **cci**       | Cédula de Crédito Imobiliário  |
| **nce**       | Nota de Crédito à Exportação   |

### Enumerador _Interest Base_
| Enumerador            | Descrição                                                                 |
|-----------------------|---------------------------------------------------------------------------|
| **workdays**          | Base de cálculo de juros em dias úteis considerando um ano de 252 dias    |
| **calendar_days**     | Base de cálculo de juros em dias corridos considerando um ano de 360 dias |
| **calendar_days_365** | Base de cálculo de juros em dias corridos considerando um ano de 365 dias |

### Enumerador _Fee Type_
Cada tipo de fee deve ser previamente habilitado e configurado pela QI Tech

| Enumerador            | Descrição                                                                  |
|-----------------------|----------------------------------------------------------------------------|
| **tac**               | Tarifa de abertura de cadastro                                             |
| **spread**            | Ágio cobrado no valor de aquisição da operação de crédito                  |
| **warranty_analysis** | Tarifa de análise de garantias                                             |
| **ted_fee**           | Tarifa de TED                                                              |
| **spread_ted_fee**    | Ágio da tarifa de TED cobrado no valor de aquisição da operação de crédito |

### Enumerador _Collateral Management Type_
| Enumerador             | Descrição             |
|------------------------|-----------------------|
| **absolute**   | Valor absoluto       |
| **percentage**    | Valor percentual    |

### Enumerador _Person Type_
| Enumerador             | Descrição             |
|------------------------|-----------------------|
| **partial_payment**   | Pagamento parcial        |
| **total_payment**    | Pagamento total    |
| **monthly_payment**    | Pagamento mensal    |

## Response

STATUS 200

Response Body

```json
{
  "data": {
    "additional_iof": 469.1328,
    "annual_cet": "283,3821%",
    "assignment_amount": 124690.56,
    "base_iof": 473.6829374063069,
    "borrower": {
      "document_number": "96969879003",
      "name": "Alan Mathison Turing"
    },
    "cet": "11,8500%",
    "collaterals": [],
    "contract": {
      "number": "0000067563/AMT",
      "signature_information": [
        {
          "signature_url": null,
          "signer_document_number": "15627918004",
          "signer_email": "alan.turing@email.com",
          "signer_external_key": null,
          "signer_name": "Alan Mathison Turing",
          "signer_role": "issuer"
        }
      ],
      "urls": [
        "https://storage.googleapis.com/sandbox-doc-api/documents/5af36fcd-8e4c-4421-ad45-7bcba899c0d3/SYNGENTASANDBOX-ALAN_MATHISON_TURING-CCB-0000067563-20230302234816.pdf"
      ]
    },
    "contract_fee_amount": 1234.56,
    "contract_fees": [
      {
        "fee_amount": 1234.56,
        "fee_type": "tac"
      }
    ],
    "external_contract_fee_amount": 1234.56,
    "external_contract_fees": [
      {
        "fee_amount": 1234.56,
        "fee_type": "spread",
        "net_fee_amount": 1120.36,
        "tax_amount": 114.2
      }
    ],
    "installments": [
      {
        "accrual_reference_date": null,
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2023-04-03",
        "calendar_days": 31,
        "digitable_line": null,
        "due_date": "2023-04-02",
        "due_interest": 0,
        "due_principal": 123456,
        "fine_amount": null,
        "has_interest": true,
        "installment_history": [],
        "installment_key": "da264e95-2bbd-47de-876b-bfea7d25e266",
        "installment_number": 1,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 123456,
        "original_pre_fixed_amount": 13245.468714162304,
        "original_principal_amortization_amount": 58473.151285837695,
        "original_total_amount": 71718.62,
        "paid_amount": 0,
        "paid_at": null,
        "post_fixed_amount": 0,
        "pre_fixed_amount": 13245.468714162304,
        "principal_amortization_amount": 58473.151285837695,
        "qr_code_key": null,
        "qr_code_url": null,
        "renegotiation_proposal_key": null,
        "tax_amount": 148.63875056859942,
        "total_accrual_amount": null,
        "total_amount": 71718.62,
        "total_paid_amount": 0,
        "workdays": 21
      },
      {
        "accrual_reference_date": null,
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2023-05-02",
        "calendar_days": 30,
        "digitable_line": null,
        "due_date": "2023-05-02",
        "due_interest": 0,
        "due_principal": 64982.848714162305,
        "fine_amount": null,
        "has_interest": true,
        "installment_history": [],
        "installment_key": "cac7064b-2310-45e1-a91f-5e8f39f0f0ea",
        "installment_number": 2,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 64982.848714162305,
        "original_pre_fixed_amount": 6735.77577015044,
        "original_principal_amortization_amount": 64982.84422984956,
        "original_total_amount": 71718.62,
        "paid_amount": 0,
        "paid_at": null,
        "post_fixed_amount": 0,
        "pre_fixed_amount": 6735.77577015044,
        "principal_amortization_amount": 64982.84422984956,
        "qr_code_key": null,
        "qr_code_url": null,
        "renegotiation_proposal_key": null,
        "tax_amount": 325.0441868377075,
        "total_accrual_amount": null,
        "total_amount": 71718.62,
        "total_paid_amount": 0,
        "workdays": 19
      }
    ],
    "iof_charge_method": "financed",
    "issue_amount": 123456,
    "net_external_contract_fee_amount": 1120.36,
    "number_of_installments": 2,
    "prefixed_interest_rate": {
      "annual_rate": 2.32,
      "created_at": "2023-03-02T23:48:15",
      "daily_rate": 0.00329298,
      "interest_base": "calendar_days_365",
      "monthly_rate": 0.10516767
    },
    "requester_identifier_key": "1c2ca4dc-2a20-4dd4-bd5f-af143fadadf4",
    "total_iof": 942.82,
    "total_pre_fixed_amount": 19981.244484312745
  },
  "event_datetime": "2023-03-02 23:48:20",
  "key": "1c2ca4dc-2a20-4dd4-bd5f-af143fadadf4",
  "status": "waiting_signature",
  "webhook_type": "debt"
}
```

STATUS 400

Response Body

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

---

# emissao_de_divida

URL: /en/documentation/auxilio_brasil/emissao_de_divida

## Emissão de dívida

## Request

- ENDPOINT /debt
- MÉTODO POST
- BODY (antes de ser assinado):

YOUR REQUEST HISTORY

**body.json**

```json
{
    "borrower": {
        "person_type": "natural",
        "name": "Qi Tech Ltda.",
        "mother_name": "Maria Mariane",
        "birth_date": "1990-05-06",
        "profession": "Deputada",
        "nationality": "nationality",
        "marital_status": "married",
        "wedding_certificate": "56ab7849-4d90-490b-b539-96ac3c5a619b",
        "spouse": {
            "person_type": "natural",
            "name": "Qi Tech Ltda.",
            "mother_name": "Maria Mariane",
            "birth_date": "1990-05-06",
            "profession": "Deputada",
            "nationality": "nationality",
            "marital_status": "married",
            "wedding_certificate": "56ab7849-4d90-490b-b539-96ac3c5a619b",
            "is_pep": False,
            "individual_document_number": "34651104630",
            "document_identification": "3c24579b-9810-4fa6-9b08-fe67d237160a",
            "document_identification_back": "2f43456a-3664-4805-82b8-96a2ec72c04c",
            "document_identification_type": "cnh",
            "document_identification_number": "232479719",
            "email": "api@qitech.com.br",
            "phone": {
                "country_code": "055",
                "area_code": "11",
                "number": "999999999"
            },
            "proof_of_residence": "780456bd-1eec-4e5f-82c0-d8c3921497ea",
            "address": {
                "street": "Av. Brigadeiro Faria Lima",
                "state": "SP",
                "city": "São Paulo",
                "neighborhood": "Jardim Paulistano",
                "number": "2391",
                "postal_code": "01452905",
                "complement": "1o. Andar"
            }
        },
        "is_pep": False,
        "individual_document_number": "34651104630",
        "document_identification": "3c24579b-9810-4fa6-9b08-fe67d237160a",
        "document_identification_back": "2f43456a-3664-4805-82b8-96a2ec72c04c",
        "document_identification_type": "cnh",
        "document_identification_number": "232479719",
        "email": "api@qitech.com.br",
        "phone": {
            "country_code": "055",
            "area_code": "11",
            "number": "999999999"
        },
        "proof_of_residence": "780456bd-1eec-4e5f-82c0-d8c3921497ea",
        "address": {
            "street": "Av. Brigadeiro Faria Lima",
            "state": "SP",
            "city": "São Paulo",
            "neighborhood": "Jardim Paulistano",
            "number": "2391",
            "postal_code": "01452905",
            "complement": "1o. Andar"
        }
    },
    "financial": {
        "interest_type": "pre_price_days",
        "disbursement_start_date": "2019-07-25",
        "disbursement_end_date": "2019-07-29",
        "fine_configuration": {
            "contract_fine_rate": 0.02,
            "interest_base": "workdays",
            "monthly_rate": 0.01
        },
        "annual_interest_rate": 0.02,
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "number_of_installments": 10,
        "principal_grace_period": 0
    }
}

```

### Body Params

| Campo | Descrição |
|---|---|
| `borrower` *(obrigatório)* | Dados do mutuário. |
| `guarantors` | Garantidores da operação (que pode ser uma lista de Objeto PF e/ou Objeto PJ e não é um campo obrigatório). |
| `collaterals` *(obrigatório)* | Informações das parcelas de pagamento. |
| `financial` *(obrigatório)* | O objeto financeiro descreve as informações financeiras da emissão. Aqui são definidas a taxa de juros, carência e valor da dívida entre outros. |
| `disbursement_bank_accounts`  | Lista de informações bancárias para o desembolso (Objeto Conta Bancária). |

### BORROWER OBJECT

| Campo | Descrição |
|---|---|
| `person_type` *(obrigatório)* | Identificador de que o objeto enviado é uma pessoa física ou jurídica. |
| `name` *(obrigatório)* | Nome da pessoa. Limitado a 100 caracteres. |
| `mother_name` | mother_name |
| `birth_date` | Data de nascimento da pessoa (formato "AAAA-MM-DD") |
| `profession` | Profissão da pessoa |
| `nationality` | Nacionalidade do cliente. Limitado a 50 caracteres. |
| `marital_status` | Estado civil do cliente. |
| `property_system` | Regime de separação de bens (obrigatório apenas para pessoas com marital_status "married"). |
| `wedding_certificate` | DOCUMENT_KEY do PDF do certificado de casamento da pessoa (enviado previamente). No caso de marital_status ser "single", o valor deste campo deve ser NULL.|
| `spouse` | Objeto PF do esposo/esposa da pessoa (obrigatório apenas quando "compulsory_separation_of_goods" for "total_communion_of_goods", "partial_communion_of_goods", "final_participation_of_acquisitions" ou "compulsory_separation_of_goods"). No caso de marital_status ser "single", o valor deste campo deve ser NULL. |
| `is_pep` *(obrigatório)* | Declaração se a pessoa é PEP (http://www.portaldatransparencia.gov.br/download-de-dados/pep) valor booleano |
| `individual_document_number` | CPF da pessoa (apenas números) |
| `document_identification` *(obrigatório)* | DOCUMENT_KEY do PDF do documento de identificação da pessoa com foto (RG ou CNH) (enviado previamente) |
| `document_identification_back` | DOCUMENT_KEY do PDF da parte de trás do documento de identificação da pessoa com foto (RG ou CNH) (enviado previamente) |
| `document_identification_type` | Tipo do documento de identificação. Valores aceitos: `rg`, `rne`, `cnh`, `ctps`, `class_document`, `passport`, `other`, `cin`. Quando `cin`, o campo `document_identification_number` deve ser igual ao CPF. |
| `document_identification_number` *(obrigatório)* | Número do documento de identificação da pessoa enviado em document_identification. Quando `document_identification_type` for `cin`, deve ser igual ao CPF. |
| `email` | Email da pessoa |
| `phone` | Telefone da pessoa |
| `address` | Endereço da pessoa |
| `proof_of_residence` *(obrigatório)* | DOCUMENT_KEY do PDF do comprovante de endereço do endereço enviado (enviado previamente) |

### GUARANTORS OBJECT

| Campo | Descrição |
|---|---|
| `person_type` *(obrigatório)* | Identificador de que o objeto enviado é uma pessoa física ou jurídica. |
| `name` *(obrigatório)* | Nome da pessoa. Limitado a 100 caracteres. |
| `mother_name` *(obrigatório)* | Nome da mãe do cliente em caso de PF. Limitado a 100 caracteres. |
| `birth_date` *(obrigatório)* | Data de nascimento da pessoa (formato "AAAA-MM-DD") |
| `profession` *(obrigatório)* | Profissão do cliente. Limitado a 64 caracteres. |
| `nationality` *(obrigatório)* | Nacionalidade do cliente. Limitado a 50 caracteres. |
| `marital_status` *(obrigatório)* | Estado civil do cliente. |
| `property_system` | Regime de separação de bens (obrigatório apenas para pessoas com marital_status "married"). |
| `wedding_certificate` *(obrigatório)* | DOCUMENT_KEY do PDF do certificado de casamento da pessoa (enviado previamente). No caso de marital_status ser "single", o valor deste campo deve ser NULL. |
| `spouse` *(obrigatório)* | Objeto PF do esposo/esposa da pessoa (obrigatório apenas quando "compulsory_separation_of_goods" for "total_communion_of_goods", "partial_communion_of_goods", "final_participation_of_acquisitions" ou "compulsory_separation_of_goods"). No caso de marital_status ser "single", o valor deste campo deve ser NULL. |
| `is_pep` *(obrigatório)* | Declaração se a pessoa é PEP (http://www.portaldatransparencia.gov.br/download-de-dados/pep). |
| `individual_document_number` *(obrigatório)* | CPF da pessoa (apenas números). Limitado a 11 caracteres. |
| `document_identification` *(obrigatório)* | DOCUMENT_KEY do PDF do documento de identificação da pessoa com foto (RG ou CNH) (enviado previamente) |
| `document_identification_back` | DOCUMENT_KEY do PDF da parte de trás do documento de identificação da pessoa com foto (RG ou CNH) (enviado previamente) |
| `document_identification_type` | Qual o tipo do documento de identificação enviado. |
| `document_identification_number` *(obrigatório)* | Número do documento de identificação da pessoa enviado em "document_identification". Limitado a 16 caracteres. |
| `email` | Email da pessoa |
| `phone` | Telefone da pessoa |
| `proof_of_residence` *(obrigatório)* | DOCUMENT_KEY do PDF do comprovante de endereço do endereço enviado (enviado previamente) |
| `address` | Endereço da pessoa |

### SPOUSE OBJECT

| Campo | Descrição |
|---|---|
| `person_type` *(obrigatório)* | Identificador de que o objeto enviado é uma pessoa física. Deve conter SEMPRE o valor "natural" para Objeto PF |
| `name` *(obrigatório)* | Nome da pessoa |
| `mother_name` *(obrigatório)* | mother_name |
| `birth_date` *(obrigatório)* | Data de nascimento da pessoa (formato "AAAA-MM-DD") |
| `profession` *(obrigatório)* | Profissão da pessoa |
| `nationality` *(obrigatório)* | Nacionalidade da pessoa |
| `marital_status` *(obrigatório)* | Estado civil da pessoa: "single", "married", "widower" ou "divorced" |
| `property_system` | Regime de separação de bens (obrigatório apenas para pessoas com marital_status "married"): "total_communion_of_goods", "partial_communion_of_goods", "total_separation_of_goods", "final_participation_of_acquisitions" ou "compulsory_separation_of_goods" |
| `wedding_certificate` *(obrigatório)* | DOCUMENT_KEY do PDF do certificado de casamento da pessoa (enviado previamente). No caso de marital_status ser "single", o valor deste campo deve ser null |
| `spouse` *(obrigatório)* | Objeto PF do esposo/esposa da pessoa (obrigatório apenas quando "compulsory_separation_of_goods" for "total_communion_of_goods", "partial_communion_of_goods", "final_participation_of_acquisitions" ou "compulsory_separation_of_goods"). No caso de marital_status ser "single", o valor deste campo deve ser null |
| `is_pep` *(obrigatório)* | Declaração se a pessoa é PEP (http://www.portaldatransparencia.gov.br/download-de-dados/pep) valor booleano |
| `individual_document_number` *(obrigatório)* | CPF da pessoa (apenas números) |
| `document_identification` *(obrigatório)* | DOCUMENT_KEY do PDF do documento de identificação da pessoa com foto (RG ou CNH) (enviado previamente) |
| `document_identification_back` | DOCUMENT_KEY do PDF da parte de trás do documento de identificação da pessoa com foto (RG ou CNH) (enviado previamente) |
| `document_identification_type` | Tipo do documento de identificação. Valores aceitos: `rg`, `rne`, `cnh`, `ctps`, `class_document`, `passport`, `other`, `cin`. Quando `cin`, o campo `document_identification_number` deve ser igual ao CPF. |
| `document_identification_number` *(obrigatório)* | Número do documento de identificação da pessoa enviado em document_identification. Quando `document_identification_type` for `cin`, deve ser igual ao CPF. |
| `email` | Email da pessoa |
| `phone` | Telefone da pessoa |
| `proof_of_residence` *(obrigatório)* | DOCUMENT_KEY do PDF do comprovante de endereço do endereço enviado (enviado previamente) |
| `address` | Endereço da pessoa |

### PHONE OBJECT

| Campo | Descrição |
|---|---|
| `country_code` *(obrigatório)* | Código DDI do telefone (https://ddi.guiamais.com.br/)(deve ter obrigatoriamente 3 dígitos). |
| `area_code` *(obrigatório)* | Código DDD do telefone (https://ddd.guiamais.com.br/).) |
| `number` *(obrigatório)* | Número de telefone (apenas números). |
| `document_number` *(obrigatório)* | Numero de documento do signatário. |

### ADDRESS OBJECT

| Campo | Descrição |
|---|---|
| `street` *(obrigatório)* | Rua do endereço. |
| `state` *(obrigatório)* | Estado do endereço (com dois caracteres maiúsculos). |
| `city` *(obrigatório)* | Cidade do endereço. |
| `neighborhood` *(obrigatório)* | Bairro do endereço. |
| `number` *(obrigatório)* | Número da rua. |
| `postal_code` *(obrigatório)* | CEP do endereço (http://www.buscacep.correios.com.br/sistemas/buscacep/) (apenas números). |
| `complement` *(obrigatório)* | Complemento do endereço (texto livre). |

### OCR OBJECT

| Campo | Descrição |
|---|---|
| `ocr` | Objeto para entrega das chaves geradas pelo SDK de OCR |

### COLLATERALS OBJECT

| Campo | Descrição |
|---|---|
| `collateral_data` | Lista de garantias da operação. |
| `percentage` |  |
| `collateral_type` *(obrigatório)* | Tipo de collateral. No caso do Auxílio Brasil, precisa ser "social_benefit" |

### COLLATERAL DATA OBJECT

| Campo | Descrição |
|---|---|
| `reservation_period` | Período do beneficio bloqueado como garantia. |
| `reservation_amount` | Valor do beneficio bloqueado como garantia. |
| `family_code` | Código da Família do beneficio. |
| `state` | UF da família do beneficio. |
| `financial_education_term` | Respostas do Termo de Educação Financeira exigido pelo Ministério da Cidadania |

### FINANCIAL EDUCATION TERM OBJECT

| Campo | Descrição |
|---|---|
| `questions` |  |

### QUESTIONS OBJECT

| Campo | Descrição |
|---|---|
| `answer` |  |

### FINANCIAL OBJECT

| Campo | Descrição |
|---|---|
| `desired_installments` | Lista de parcelas. |
| `interest_type` *(obrigatório)* | Tipo de juros da operação. |
| `disbursement_start_date` | Data início do período de desembolso (formato "AAAA-MM-DD"). |
| `disbursement_end_date` | Data final do período de desembolso (formato "AAAA-MM-DD"). |
| `annual_interest_rate` *(obrigatório)* | Valor porcentual da parcela prefixada de juros (atenção: 1 = 100%) |
| `credit_operation_type` *(obrigatório)* | Tipo de operação de crédito. |
| `interest_grace_period` | Carência de juros (em meses) |
| `number_of_installments` | Número de parcelas (mensais) |
| `principal_grace_period` | Carência do principal (em meses) |

### DESIRED INSTALLMENTS OBJECT

| Campo | Descrição |
|---|---|
| `due_date` | Data da parcela. |
| `total_amount` | Valor total da parcela |

### REBATES OBJECT

| Campo | Descrição |
|---|---|
| `amount` | Valor do rebate. |
| `fee_type` | Tipo de fee |
| `amount_type` | Tipo do valor inserido (valor absoluto, valor em porcentagem) |
| `rebate_bank_account` | Objeto conta bancária de rebate. |

### FINE CONFIGURATION OBJECT

| Campo | Descrição |
|---|---|
| `contract_fine_rate` *(obrigatório)* | Valor porcentual fixo da multa |
| `interest_base` | Contagem do tempo para multa ("calendar_days" para dias corridos, "workdays" para dias úteis) |
| `monthly_rate` | Valor porcentual mensal da multa |

### DISBURSEMENT BANK ACCOUNT OBJECT

| Campo | Descrição |
|---|---|
| `name`  | Nome do dono da conta para desembolso - Obrigatório apenas se o método de transferência for ted ou pix. e caso haja mais de uma conta para desembolso (Limite de 80 caracteres). |
| `bank_code` | Código COMPE da instituição financeira (https://www.bcb.gov.br/pom/spb/estatistica/port/ASTR003.pdf) com 3 dígitos - Obrigatório apenas se o método de transferência for ted ou pix e se "ispb_number" não for enviado. |
| `branch_number` | Número da agência - Obrigatório apenas se o método de transferência for ted ou pix. |
| `account_number` | Número da conta - Obrigatório apenas se o método de transferência for ted ou pix - Obrigatório apenas se o método de transferência for ted ou pix. |
| `document_number`| CPF ou CNPJ do dono da conta para desembolso - Obrigatório apenas se o método de transferência for ted ou pix. e caso haja mais de uma conta para desembolso. |
| `percentage_receivable` | Valor em porcentagem que a conta receberá no desembolso. Este campo é utilizado para definir a quantidade a ser dividida caso haja mais de uma conta para desembolso (no caso de ser somente uma conta, o valor integral será transferido). Caso a porcentagem não seja enviada (de uma, ou de todas as contas), a porcentagem restante será dividida igualmente entre as contas sem porcentagem definida. Caso todas as porcentagens sejam enviadas, a soma delas não pode passar de 100 - Obrigatório apenas se o método de transferência for ted ou pix. |
| `ispb_number` | Identificador da instituição no Sistema de Pagamentos Brasileiro - Obrigatório apenas se o método de transferência for ted ou pix e se o "bank_code" não for enviado. |
| `qr_code_key` | Chave fornecida no momento da criação de um QR Code PIX - Pode ser enviado como o único parâmetro deste objeto, assim o desembolso acontece como pagamento desse QR code PIX. |
| `digitable_line` | Representação numérica de um código de barras de um boleto - Pode ser enviado como o único parâmetro deste objeto, assim o desembolso acontece como pagamento desse boleto. |
| `transfer_method` | Por padrão as operações são desembolsadas via PIX, então quando existr a necessidade de que uma operação seja desembolsada via TED este campo pode ser enviado. |

---

# webhook_auxilio_brasil

URL: /en/documentation/auxilio_brasil/webhook_auxilio_brasil

## Webhook auxílio brasil

**Criação de uma operação**

Na criação de uma operação do Auxílio Brasil dentro do nosso sistema, são possíveis os seguintes status:

- **success**: Informa o sucesso na consulta do benefício.
- **failure**: Informa que ocorreu um erro na consulta do benefício.

**Exemplos**

Webhook de sucesso na consulta

**body.json**

```json
{
    "callback": {
        "key": "bfbe918d-fe58-55a0-bdaf-5a3733b7a12d",
        "data": {
            "name": "LUIZ ANTONIO DA SILVA",
            "state": "RJ",
            "balance": "111",
            "family_code": 8553463416,
            "reference_date": "2022-08-03",
            "benefit_net_amount": 294,
            "benefit_total_amount": 294,
            "disbursement_bank_account": {
                "bank_code": "103",
                "account_digit": "5",
                "account_branch": "3880",
                "account_number": "000925559475"
            },
            "number_of_active_reservations": 0
        },
        "status": "success",
        "webhook_type": "social_benefit_balance",
        "event_datetime": "2022-08-29T20:47:48"
    }
}

```

Webhook de erro na consulta

**body.json**

```json
{
    "callback": {
        "key": "5d85a8eb-94c1-4fcc-8f66-15b6301f6kfe",
        "data": {
            "enumerator": "not_found_family_member",
            "description": "there is not an active authorization for person"
        },
        "status": "failure",
        "webhook_type": "social_benefit_balance",
        "event_datetime": "2022-10-17T21:54:16"
    }
}

```

| Enumerators | Descrição |
|---|---|
| `dataprev_error`  | erro inesperado no Dataprev |
| `not_found_family_member` | não há uma autorização ativa para pessoa |
| `benefit_deleted`  | benefício foi excluído |

**Cancelamento de uma operação**

Existem alguns processos que cancelam uma operação de crédito, majoritariamente:

1. PIX/TED falhou ou foi estornado;
2. Passamos da data de desembolso;
3. Tentativa de averbação foi rejeitada;

Toda operação que está cancelada em nosso sistema pode voltar ao seu estado anterior através do método de mudança da data de desembolso.
Alguns casos não são possíveis de voltarem ao estado inicial porque nunca será desembolsada, como é o caso 3, cuja tentativa de averbação foi rejeitada.

Para o primeiro caso:

**body.json**

```json
{
    "key": "\<CHAVE DA OPERAÇÃO DE CRÉDITO\>",
    "data": {
        "pix_refusal": {
            "reason": "Número da conta de destino é inexistente ou inválido.",
            "reason_enumerator": "invalid_account"
        },
        "cancel_reason": "pix_refusal"
    },
    "status": "canceled",
    "webhook_type": "debt",
    "event_datetime": "2022-11-01 13:39:44"
}

```

A reason_enumerator pode ser conforme a lista abaixo:

| Enumerators | Descrição |
|---|---|
| `invalid_document_number`  | Documento inválido |
| `invalid_account` | Conta inválida |
| `unsupported_transaction`  | Transação não suportada |
| `blocked_account`  | Conta bloqueada |
| `closed_account`  | Conta fechada |
| `rejected_payment`  | Pagamento rejeitado |
| `amount_too_great`  | Valor monetário muito alto |
| `spi_timeout`  | Timeout do prestador de serviço |
| `receiver_error`  | Erro do receptor |
| `incorrect_account_type`  | Tipo de conta incorreta |
| `duplicity_of_payment_order`  | Ordem de pagamento duplicado |
| `refund_after_unexpected_value`  | Reembolso depois de valor inesperado |
| `refund_after_psp_error`  | Reembolso depois de erros no PSP |
| `refund_after_technical_issues`  | Reembolso depois de problemas técnicos |
| `refund_after_cancellation`  | Reembolso depois de cancelamento |
| `refund_after_fraud`  | Reembolso depois de fraude |
| `refund_after_payee_request`  | Reembolso após solicitação do beneficiário |
| `refund_after_fraud_report`  | Reembolso depois de relatório de fraude |
| `payee_not_in_allowed_list`  | Beneficiário não se encontra na lista permitida |
| `payee_in_blocked_list`  | Beneficiário se encontra na lista bloqueada |
| `unjustified_payment_order`  | Ordem de pagamento não justificado |

O segundo caso, ocorre quando algum processo interno dispara o cancelamento da Operação:

**body.json**

```json
{
    "key": "\<CHAVE DA OPERAÇÃO DE CRÉDITO\>",
    "data": {
        "cancel_reason": "Operacao cancelada manualmente",
        "cancel_reason_enumerator": "manual"
    },
    "status": "canceled",
    "webhook_type": "debt",
    "event_datetime": "2022-11-01 03:46:31"
}

```

Aqui podemos ter os seguintes "cancel_reason_enumerators":

- Cancel Reason Enumerators em rejeição de PAB:

| Enumerators | Descrição |
|---|---|
| `social_benefit_ineligible_benefit`  | Beneficio inelegível |
| `social_benefit_invalid_beneficiary_data` | Dados do beneficiário inválidos |
| `social_benefit_invalid_balance`  | Margem indisponível |
| `social_benefit_contract_limit_exceeded`  | O cliente não pode ter mais contratos |
| `social_benefit_installments_limit_exceeded`  | O cliente não pode ter esse numero de parcelas em um contrato |
| `social_benefit_invalid_disbursement_account`  | Conta divergente com o DataPrev |

- Cancel Reason Enumerators mudança de dia

| Enumerators | Descrição |
|---|---|
| `not_collateral_constituted_social_benefit`  | Mudou de dia e a operação não teve a garantia averbada |
| `waiting_signature` | Mudou de dia e a operação não foi assinada |
| `not_assigned`  | Mudou de dia e a CCB está configurada para desembolsar após a cessão, mas nao foi cedida |
| `disburse_is_not_allowed`  | Mudou de dia e a CCB está configurada com o fluxo de "Liberar o desembolso" mas não foi liberado |
| `manual`  | Mudou de dia e a operação não foi desembolsada. |

Os cancel reason começados com "social_benefit" são permanentes, então a reserva foi de fato rejeitada. Mas em relação aos outros, ainda podem retornar ao estado inicial então deve ser devidamente analisado.

---

# Confirm Individual Account Opening

URL: /en/documentation/baas/account/2fa_v2/abrir_conta_pf

As a second step in individual account opening, [after account reservation](/documentation/baas/account/abrir_conta_pf), the complete registration data of the account holder and evidence of acceptance of the account opening terms must be sent.

## Request
ENDPOINT /account_request/checking
METHOD POST

## Path Params
| Field         | Type   | Description                              | Characters |
|---------------|--------|----------------------------------------|------------|
| `account_request_key` | uuidv4 | Unique identification key for the account reservation request. | 36         |

Request Body

```json
{
    "account_owner": {
        "address": {
            "street": "Av. Brigadeiro Faria Lima",
            "state": "SP",
            "city": "São Paulo",
            "neighborhood": "Jardim Paulistano",
            "number": "2391",
            "postal_code": "01452905",
            "complement": "Complemento"
        },
        "birth_date": "1990-05-06",
        "document_identification": "3884579b-9810-4fa6-9b08-fe67d237160a",
        "email": "teste@gmail.com",
        "individual_document_number": "99999999999",
        "is_pep": false,
        "mother_name": "Dona Maria Mariane",
        "name": "Nome do Titular da Conta",
        "nationality": "nationality",
        "person_type": "natural",
        "phone": {
            "country_code": "055",
            "area_code": "11",
            "number": "999999999"
        },
        "proof_of_residence": "4d7f4e-1eec-4e5f-82c0-d8c3921497ea"
    },
    "signed_contract": {
        "document_key": "48a8f4g9-4b58-4905-9a69-b1f9215263f5",
        "signatures": [
            {
                "authenticity": {
                    "timestamp": "1970-01-01T00:00:01.080100Z",
                    "facial_recognition_key": "79003de0-2590-455d-9b73-426b8ca284eb",
                    "lang": "-35.8916627",
                    "lat": "-7.2226067",
                    "ip_address": "177.51.1.186",
                    "session_id": "jdifj329842"
                },
                "signer": {
                    "name": "Nome do Titular da Conta",
                    "email": "teste@gmail.com",
                    "phone": {
                        "country_code": "055",
                        "area_code": "11",
                        "number": "999999999"
                    },
                    "document_number": "999999999"
                },
                "authentication_type": "opt-in"
            }
        ]
    },
    "additional_documents": ["b12c8807-8f3f-4083-9cb1-7cce641f3786"]
}
```

### Request Body Params

| Field | Type | Description                                                                                  | Characters |
|---|---|--------------------------------------------------------------------------------------------|---|
| `account_owner` * | object  | Object containing the Account Holder information                                         | **[account_owner Object](#account_owner-object)** |
| `signed_contract` * | object  | Object containing evidence of the Holder's acceptance of the account opening terms. | **[signed_contract Object](#signed_contract-object)** |

### account_owner Object

| Field | Type | Description | Characters                            |
|---| ---| ---|---------------------------------------| 
| `address` * | string | Customer address. | **[address Object](#address-object)** |  |
| `birth_date` * | string |  Person's birth date (format "YYYY-MM-DD") |                                       |
| `document_identification` * | string |  DOCUMENT_KEY of the PDF of the person's photo identification document (ID or Driver's License) (previously sent) |                                       |
| `document_identification_type` * | string |  Type of previously sent document (ID or Driver's License) |                                       |
| `email` * | string |  Customer email. |                                       |
| `individual_document_number` | string | Person's SSN (numbers only). Limited to 11 characters. |                                       |
| `is_pep` * | string |  Declaration if the person is PEP (http://www.portaldatransparencia.gov.br/download-de-dados/pep).|                                       |
| `mother_name` * | string |  Customer's mother's name for individual customers. | 100                                   |
| `name` * | string |  Company name for corporate operations or Person's name for individual operations. | 100                                   |
| `nationality` * | string |  Customer nationality. | 50                                    |
| `person_type` * | string | Identifier whether the sent object is an individual or corporate person.|                                       |
| `phone` * | string | Object with phone data | **[phone Object](#phone-object)**     |
| `proof_of_residence` | string |  DOCUMENT_KEY of the PDF proof of address for the sent address (previously sent).|                                       |

### address Object 

This object, present in both individual and corporate objects, is a simple object to represent an address.

| Field | Description | Example |  Max. Characters | 
|---|---|---|---| 
| `street` *| string | Street address  | 100 |
| `state` *| string | State of the address (with two uppercase characters) | 2 |
| `city` *| string | City of the address | 100 |
| `neighborhood` *| string |Neighborhood of the address | 100 |
| `number` *| string | Street number | 10 |
| `postal_code` *| string |ZIP code of the address (http://www.buscacep.correios.com.br/sistemas/buscacep/) (numbers only) |  8 |
| `complement` *| string |Address complement (free text) | 100 |

### signed_contract Object 
| Field | Type   | Description        | Characters    |
|-------|--------|------------------|---------------|
| **document_key** * | uuidv4 | Unique identification key of the **Account Opening Terms** or **Escrow Account Contract** document. (The DOCUMENT_KEY is returned in the response of the [Document upload](./upload_de_documentos) endpoint) | 36            |
| **signatures** *   | list   | Signature data of the sent document. Each item in the list corresponds to a document signer.      | [signatures Object](#signatures-object) |

### signatures Object
| Field | Type       | Description         | Characters        |
|-------|------------|-------------------|-------------------|
| **authenticity** * | object     | Set of data that evidences the electronic signature performed by the signer. | [authenticity Object](#authenticity-object) |
| **signer** * | object     | Object containing the data of one of the document signers.           | [signer Object](#signer-object)|
| **authentication_type** * | enumerator | Signature type. Will always be "**opt-in**"| "**opt-in**"                   |

### authenticity Object
| Field | Type   | Description               | Characters |
|-------|--------|-------------------------|------------|
| **timestamp** *            | string | Date and time of the document signing moment.                | 27         |
| **facial_recognition_key** | uuidv4 | Unique identification key of the account holder's selfie photo. (The DOCUMENT_KEY is returned in the response of the [Document upload](./upload_de_documentos) endpoint) | 36         |
| **lang**                   | string | Longitude coordinate of the signer's geolocation captured at the signing moment.                  | -          |
| **lat**                    | string | Latitude coordinate of the signer's geolocation captured at the signing moment.                   | -          |
| **ip_address**             | string | IP address of the signer's device.     | -          |
| **session_id**             | string | Signer's session ID at the signing moment.                | -          |

### signer Object
| Field                 | Type   | Description                                 | Characters                        |
|-----------------------|--------|-------------------------------------------|-----------------------------------|
| **name** *            | string | Signer's name.                        | -                                 |
| **email** *           | string | Signer's email.                       | -                                 |
| **phone** *           | object | Object with signer's phone data | **[phone Object](#phone-object)** |
| **document_number** * | string | Signer's SSN.                         | 11                                |

### phone Object 

| Field | Description | Example |  Max. Characters | 
| --- | --- | --- | --- | 
|`country_code` *| string | Phone country code (https://ddi.guiamais.com.br/) | 3 | 
| `area_code` *| string | Phone area code (https://ddd.guiamais.com.br/) | 2 |
| `number` *| string |Phone number (numbers only) |  10 |

## Response

STATUS 201

Response Body

```json
{
    "account_info": {
        "account_branch": "0001",
        "account_digit": "0",
        "account_number": "1693580"
    },
    "account_request_key": "f230f1b5-07af-4737-b0e3-8a472304f5e7",
    "account_request_status": "pending_kyc_analysis"
}
```

:::warning Warning
 The `account_request_key` field must be stored and will be used for account opening confirmation.
:::

### Response Body Params

| Field | Type | Description | Characters|
|---|---| ---|---|
| `account_info` * | object  | Object containing the Account Holder information |**[account_info Object](#account_info-object)**  | - |
| `account_request_key` * | string  | Creation request identification key | - | - |
| `account_request_status` * | string  | KYC status | - | - |

### account_info Object
| Field | Type | Description | Characters |
|---|---| ---| --- |
| `account_branch` * | string  | Branch Number | 4 |
| `account_digit` * | string  | Email | 11 |
| `account_number` * | string  | Account Holder Full Name | 50 |

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`  | Description (eng)<br/>`description` | Description(ptbr) <br></br>`translation`|
|---| --- | --- | --- | --- | 
| 400 | QIT000001 | Bad Request | Schema Error | Erro de Schema|
| 404 | QIT000404 | Not Found | Resource could not be found | Recurso não encontrado|

---

# Legal Entity Account Opening

URL: /en/documentation/baas/account/2fa_v2/abrir_conta_pj

Account opening occurs in two mandatory steps. First, a POST request sends preliminary data to reserve the account. Then, a webhook of type `account_request.status_change` with status `pending_additional_data` is triggered. In the second step, a PATCH request finalizes the opening, officializing the account with the complementary information.

## Request
ENDPOINT /account_request/checking
METHOD POST

## Path Params
| Field         | Type   | Description                              | Characters |
|---------------|--------|----------------------------------------|------------|
| `account_request_key` | uuidv4 | Unique identification key for account reservation request. | 36         |

## Free Movement Account Opening

Request Body

```json
{
    "account_owner": {
        "phone": {
            "country_code": "55",
            "area_code": "11",
            "number": "999999999"
        },
        "email": "email@teste.com.br",
        "person_type": "legal",
        "name": "Empresa de Teste",
        "address": {
            "street": "Rua Abrahão Calux",
            "state": "SP",
            "city": "São Paulo",
            "neighborhood": "Vila Teste",
            "number": "116",
            "postal_code": "04286100",
            "complement": "Complemento"
        },
        "trading_name": "Nome fantasia",
        "company_document_number": "99999999000130",
        "cnae_code": "4721102",
        "foundation_date": "1980-07-11",
        "company_statute": "99999999-01c9-4cf5-a0fa-1d2a96f4b34d",
        "company_representatives": [
            {
                "name": "Nome do Socio",
                "individual_document_number": "99999999999",
                "document_identification_number": "999999999",
                "birth_date": "1989-09-01",
                "mother_name": "Maria da Silva",
                "email": "teste@gmail.com",
                "is_pep": false,
                "final_beneficiary": true,
                "person_type": "natural",
                "nationality": "brasileiro(a)",
                "marital_status": "single",
                "document_identification": "88888-0ddf-4932-874f-9231794963da",
                "phone": {
                    "country_code": "055",
                    "area_code": "19",
                    "number": "999999999"
                },
                "address": {
                    "street": "Rua dos Limões",
                    "neighborhood": "Vila Moinho Velho",
                    "city": "São Paulo",
                    "state": "SP",
                    "postal_code": "04286100",
                    "number": "116",
                    "complement": "complemento"
                }
            }
        ],
        "company_type": "ltda"
    },
    "signed_contract": {
        "document_key": "57cda530-d469-4427-a9d4-2523a510dee1",
        "signatures": [
            {
                "authenticity": {
                    "timestamp": "2024-05-10T14:15:03.114895Z",
                    "ip_address": "192168161",
                    "lang": "-35.8916627",
                    "lat": "-7.2226067",
                    "session_id": "54b8e3cf-15de-41e5-9305-0ecf059d6e2a",
                    "facial_recognition_key": "c367a540-2e7e-4373-a167-61bc43c30dc1"
                },
                "signer": {
                    "name": "Nome do assinante",
                    "email": "teste@gmail.com.br",
                    "phone": {
                        "country_code": "55",
                        "area_code": "11",
                        "number": "999999999"
                    },
                    "document_number": "99999999"
                },
                "authentication_type": "opt-in"
            }
        ]
    },
    "additional_documents": [
        "61f2a65e-0ddf-4932-874f-9231794963da"
    ]
}
```

### Request Body Params

| Field                 | Type   | Description                                                                    | Characters                                            |
|-----------------------|--------|------------------------------------------------------------------------------|-------------------------------------------------------|
| **account_owner** *   | object | Account owner object                                                         | **[Object account_owner](#object-account_owner)**     |
| **allowed_user** *    | object | User linked to the account.                                                   | **[Object allowed_user](#object-allowed_user)**       |
| **account_manager**   | object | Data of the integrating partner who will handle account transactions via API.  | **[Object account_manager](#object-account_manager)** |
| `signed_contract` *| object | Object containing contract signature information. | **[Object signed_contract](#object-signed_contract)** |

### Object account_owner

| Field                         | Type   | Description                                                                                                                         | Characters                                                            |
|-------------------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|
| **address** *                 | object | Account holder address object                                                                                               | **[Object address](#object-address)**                                 |
| **cnae_code** *               | string | National Classification of Economic Activities                                                                                   | 9                                                                     |
| **company_document_number** * | string | CNPJ                                                                                                                              | 14                                                                    |
| **company_statute** *         | string | DOCUMENT_KEY of the company statute PDF (sent previously).                                                                 | 36                                                                    |
| **company_type**              | enum   | Company type                                                                                                                   | **[Enumerators company_type](#enumerators-company_type)**           |
| **company_representatives** * | list   | List of company legal representatives                                                                                        | **[Object company_representatives](#object-company_representatives)** |
| **email** *                   | string | Company institutional email.                                                                                                   | 254                                                                   |
| **foundation_date** *         | string | Company establishment date (format "YYYY-MM-DD").                                                                               | 10                                                                    |
| **name** *                    | string | Legal name.                                                                                                                     | 100                                                                   |
| **person_type** *             | enum   | Identifier that the sent object is a legal entity. Must ALWAYS contain the value "legal" for Legal Entity Object.                   | **[Enumerators person_type](#enumerators-person_type)**             |
| **phone** *                   | object | Account holder phone.                                                                                                     | **[Object phone](#object-phone)**                                     | - |
| **trading_name** *            | string | Trade name.                                                                                                                    | 200                                                                   |

### Object company_representatives

| Field                              | Type    | Description                                                                                              | Characters                                                                              |
|------------------------------------|---------|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
| **name** *                         | string  | Company representative name                                                                       | 100                                                                                     |
| **address** *                      | object  | Company representative address object                                                            | **[Object address](#object-address)**                                                   |
| **email** *                        | string  | Company representative email                                                                      | 254                                                                                     |
| **birth_date** *                   | string  | Company representative birth date (format "YYYY-MM-DD")                                     | 10                                                                                      |
| **individual_document_number** *   | string  | Company representative CPF (numbers only).                                                      | 11                                                                                      |
| **document_identification**        | string  | DOCUMENT_KEY of the person's photo identification document PDF (ID or driver's license) (sent previously) | 36                                                                                      |
| **document_identification_number** | string  | Person's photo identification document number (ID or driver's license)                                    | 16                                                                                      |
| **document_identification_type**   | enum    | Person's photo identification document type (ID or driver's license)                                      | [Enumerators document_identification_type](#enumerators-document_identification_type) |
| **is_pep** *                       | boolean | Declaration if the person is PEP (http://www.portaldatransparencia.gov.br/download-de-dados/pep).          | -                                                                                       |
| **final_beneficiary**              | boolean | Declaration if the person is the final beneficiary of the company.                                         | -                                                                                       |
| **marital_status**                 | enum    | Company representative marital status                                                               | **[Enumerators marital status](#enumerators-marital_status)**                         |
| **mother_name** *                  | string  | Company representative mother's name                                                                | 100                                                                                     |
| **nationality**                    | string  | Company representative nationality                                                              | 50                                                                                      |
| **person_type** *                  | enum    | Identifier that the sent object is a natural person                                              | **[Enumerators person_type](#enumerators-person_type)**                               |
| **phone** * | object  | Object with company representative phone data  | **[Object phone](#object-phone)** |

### Object address

This object, present in both the Natural Person and Legal Entity objects, is a simple object to represent an address.

| Field              | Description | Example                                                                                   | Characters |
|--------------------|-----------|-------------------------------------------------------------------------------------------|------------|
| **street** *       | string    | Street address                                                                           | 500        |
| **state** *        | enum      | State address (with two uppercase characters)                                       | 2          |
| **city** *         | string    | City address                                                                        | 255        |
| **neighborhood** * | string    | Neighborhood address                                                                        | 500        |
| **number** *       | string    | Street number                                                                             | 10         |
| **postal_code** *  | string    | ZIP code address (http://www.buscacep.correios.com.br/sistemas/buscacep/) (numbers only) | 8          |
| **complement**     | string    | Address complement (free text)                                                     | 500        |

### Object signed_contract 
| Field | Type   | Description        | Characters    |
|-------|--------|------------------|---------------|
| **document_key** * | uuidv4 | Unique identification key for **Account Opening Agreement** or **Escrow Account Contract** document. (The DOCUMENT_KEY is returned in the [Document upload](./upload_de_documentos) endpoint response) | 36            |
| **signatures** *   | list   | Signature data of the sent document. Each list item corresponds to a document signer.      | [Object signatures](#object-signatures) |

### Object signatures
| Field | Type       | Description         | Characters        |
|-------|------------|-------------------|-------------------|
| **authenticity** * | object     | Set of data evidencing the electronic signature performed by the signer. | [Object authenticity](#object-authenticity) |
| **signer** * | object     | Object containing data of one of the document signers.           | [Object signer](#object-signer)|
| **authentication_type** * | enumerator | Signature type. Will always be "**opt-in**"| "**opt-in**"                   |

### Object authenticity
| Field | Type   | Description               | Characters |
|-------|--------|-------------------------|------------|
| **timestamp** *            | string | Date and time of document signature moment.                | 27         |
| **facial_recognition_key** | uuidv4 | Unique identification key for the account holder's selfie photo. (The DOCUMENT_KEY is returned in the [Document upload](./upload_de_documentos) endpoint response) | 36         |
| **lang**                   | string | Longitude coordinate of signer's geolocation captured at signature moment.                  | -          |
| **lat**                    | string | Latitude coordinate of signer's geolocation captured at signature moment.                   | -          |
| **ip_address**             | string | Signer's device IP address.     | -          |
| **session_id**             | string | Signer's session ID at signature moment.                | -          |

### Object signer
| Field                 | Type   | Description                                 | Characters                        |
|-----------------------|--------|-------------------------------------------|-----------------------------------|
| **name** *            | string | Signer name.                        | -                                 |
| **email** *           | string | Signer email.                       | -                                 |
| **phone** *           | object | Object with signer phone data | **[Object phone](#object-phone)** |
| **document_number** * | string | Signer CPF.                         | 11                                |

### Object phone 

| Field | Description | Example |  Max Characters | 
| --- | --- | --- | --- | 
|`country_code` *| string | Phone country code (https://ddi.guiamais.com.br/) | 3 | 
| `area_code` *| string | Phone area code (https://ddd.guiamais.com.br/) | 2 |
| `number` *| string |Phone number (numbers only) |  10 |

### Enumerators person_type
| Enum        | Description       |
|-------------|-------------------|
| **natural** | Natural person     |
| **legal**   | Legal entity   |

### Enumerators document_identification_type
| Enum    | Description                            |
|---------|----------------------------------------|
| **rg**  | ID - General Registry                    |
| **cnh** | Driver's License |

### Enumerators company_type
| Enum                       | 	Description                                                             |
|----------------------------|--------------------------------------------------------------------------|
| **ltda**                   | Limited Liability Company                                                                |
| **sa**	                    | Corporation                                                        |
| **micro_enterprise**	      | Micro Enterprise                                                            |
| **freelancer**             | Freelancer                                                              |
| **sa_opened**              | Public Corporation                                     |
| **sa_closed**	             | Private Corporation                                     |
| **se_ltda**                | Limited Business Partnership                                           |
| **se_cn**                  | General Partnership                                   |
| **se_cs**                  | Limited Partnership                               |
| **se_ca**	                 | Partnership Limited by Shares                              |
| **scp**                    | Joint Venture                                      |
| **ei**	                    | Individual Entrepreneur                                                    |
| **ese**	                   | Foreign Company Establishment in Brazil                     |
| **eeab**	                  | Argentine-Brazilian Binational Company Establishment in Brazil   |
| **ssp**                    | Pure Simple Partnership                                                  |
| **ss_ltda**	               | Limited Simple Partnership                                               |
| **ss_cn**                  | General Simple Partnership                                      |
| **ss_cs**                  | Simple Limited Partnership                                  |
| **eireli_ne**              | Individual Limited Liability Company (Business Nature) |
| **eireli_ns**              | Individual Limited Liability Company (Simple Nature)   |
| **eireli**                 | Individual Liability Company                                  |
| **mei**                    | Individual Micro Entrepreneur                                            |
| **me**	                    | Micro Enterprise                                                            |
| **cop**	                   | Cooperative                                                              |
| **private_association**	   | Private Association                                                        |

### Enumerators marital_status
| Enum         | 	Description  |
|--------------|---------------|
| **single**   | Single   |
| **married**  | Married    |
| **widower**  | Widowed     |
| **divorced** | Divorced |
| **separated** | Separated |

## Response

STATUS 201

Response Body

```json
{
    "account_info": {
        "account_branch": "0001",
        "account_digit": "0",
        "account_number": "1693580"
    },
    "account_request_key": "f230f1b5-07af-4737-b0e3-8a472304f5e7",
    "account_request_status": "pending_kyc_analysis"
}
```

:::warning Warning
 The `account_request_key` field must be stored and will be used for account opening confirmation.
:::

### Response Body Params

| Field | Type | Description | Characters|
|---|---| ---|---|
| `account_info` * | object  | Object containing Account Holder information |**[Object account_info](#object-account_info)**  | - |
| `account_request_key` * | string  | Creation request identification key | - | - |
| `account_request_status` * | string  | KYC Status | - | - |

### Object account_info
| Field | Type | Description | Characters |
|---|---| ---| --- |
| `account_branch` * | string  | Branch Number | 4 |
| `account_digit` * | string  | Email | 11 |
| `account_number` * | string  | Account Holder Full Name | 50 |

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`  | Description (eng)<br/>`description` | Description(ptbr) <br></br>`translation`|
|---| --- | --- | --- | --- | 
| 400 | QIT000001 | Bad Request | Schema Error | Schema Error|
| 404 | QIT000404 | Not Found | Resource could not be found | Resource not found|

---

# Confirm Individual Account Opening

URL: /en/documentation/baas/account/abrir_conta_pf

As the second step in individual account opening, [after account reservation](/documentation/baas/account/abrir_conta_pf), complete registration data of the account holder and evidence of acceptance of the account opening terms must be submitted.

## Request
ENDPOINT /account_request/ ACCOUNT_REQUEST_KEY /checking
METHOD PATCH

## Path Params
| Field         | Type   | Description                              | Characters |
|---------------|--------|----------------------------------------|------------|
| `account_request_key` | uuidv4 | Unique identification key for account reservation request. | 36         |

Request Body

```json
{
    "account_owner": {
        "address": {
            "street": "Av. Brigadeiro Faria Lima",
            "state": "SP",
            "city": "São Paulo",
            "neighborhood": "Jardim Paulistano",
            "number": "2391",
            "postal_code": "01452905",
            "complement": "Complemento"
        },
        "birth_date": "1990-05-06",
        "document_identification": "3884579b-9810-4fa6-9b08-fe67d237160a",
        "email": "teste@gmail.com",
        "individual_document_number": "99999999999",
        "is_pep": false,
        "mother_name": "Dona Maria Mariane",
        "name": "Nome do Titular da Conta",
        "nationality": "nationality",
        "person_type": "natural",
        "phone": {
            "country_code": "055",
            "area_code": "11",
            "number": "999999999"
        },
        "proof_of_residence": "4d7f4e-1eec-4e5f-82c0-d8c3921497ea",
        "monthly_income": 1000
    },
    "signed_contract": {
        "document_key": "48a8f4g9-4b58-4905-9a69-b1f9215263f5",
        "signatures": [
            {
                "authenticity": {
                    "timestamp": "1970-01-01T00:00:01.080100Z",
                    "facial_recognition_key": "79003de0-2590-455d-9b73-426b8ca284eb",
                    "lang": "-35.8916627",
                    "lat": "-7.2226067",
                    "ip_address": "177.51.1.186",
                    "session_id": "jdifj329842"
                },
                "signer": {
                    "name": "Nome do Titular da Conta",
                    "email": "teste@gmail.com",
                    "phone": {
                        "country_code": "055",
                        "area_code": "11",
                        "number": "999999999"
                    },
                    "document_number": "999999999"
                },
                "authentication_type": "opt-in"
            }
        ]
    },
    "additional_documents": ["b12c8807-8f3f-4083-9cb1-7cce641f3786"]
}
```

### Request Body Params

| Field | Type | Description                                                                                  | Characters |
|---|---|--------------------------------------------------------------------------------------------|---|
| `account_owner` * | object  | Object containing account holder information                                         | **[account_owner Object](#account_owner-object)** |
| `signed_contract` * | object  | Object containing evidence of the holder's acceptance of account opening terms. | **[signed_contract Object](#signed_contract-object)** |

### account_owner Object

| Field | Type | Description | Characters                            |
|---| ---| ---|---------------------------------------| 
| `address` * | string | Customer address. | **[address Object](#address-object)** |  |
| `birth_date` | string |  Person's date of birth (format "YYYY-MM-DD") |                                       |
| `document_identification` * | string |  DOCUMENT_KEY of the PDF of the person's photo identification document (ID or driver's license) (previously uploaded) |                                       |                                   |
| `email` * | string |  Customer email. |                                       |
| `individual_document_number`* | string | Person's CPF (numbers only). Limited to 11 characters. |                                       |
| `is_pep` * | string |  Declaration if the person is PEP (http://www.portaldatransparencia.gov.br/download-de-dados/pep).|                                       |
| `mother_name` | string |  Customer's mother's name for individuals. | 100                                   |
| `name` * | string |  Company name for business operations or Person's name for individual operations. | 100                                   |
| `nationality` * | string |  Customer nationality. | 50                                    |
| `person_type` * | string | Identifier indicating whether the submitted object is an individual or legal entity.|                                       |
| `phone` * | string | Object with phone data | **[phone Object](#phone-object)**     |
| `proof_of_residence` | string |  DOCUMENT_KEY of the PDF proof of address for the submitted address (previously uploaded).|                                       |
|`monthly_income`* | number | Account holder's monthly income | | 

### address Object 

This object, present in both individual and legal entity objects, is a simple object to represent an address.

| Field | Description | Example |  Max Characters | 
|---|---|---|---| 
| `street` *| string | Street address  | 100 |
| `state` *| enum | Address state (two uppercase characters) | 2 |
| `city` *| string | Address city | 100 |
| `neighborhood` *| string |Address neighborhood | 100 |
| `number` *| string | Street number | 10 |
| `postal_code` *| string |Address postal code (http://www.buscacep.correios.com.br/sistemas/buscacep/) (numbers only) |  8 |
| `complement` *| string |Address complement (free text) | 100 |

### signed_contract Object 
| Field | Type   | Description        | Characters                                |
|-------|--------|------------------|-------------------------------------------|
| `document_key` * | uuidv4 | Unique identification key of the **Account Opening Terms** or **Escrow Account Contract** document. (The DOCUMENT_KEY is returned in the response of the [Document upload](./upload_de_documentos) endpoint) | 36                                        |
| `signatures` *   | list   | Signature data for the submitted document. Each list item corresponds to one document signer.      | **[signatures Object](#signatures-object)** |

### signatures Object
| Field | Type       | Description         | Characters                                      |
|-------|------------|-------------------|-------------------------------------------------|
| `authenticity` * | object     | Set of data that evidences the electronic signature performed by the signer. | **[authenticity Object](#authenticity-object)** |
| `signer` * | object     | Object containing data of one of the document signers.           | **[signer Object](#signer-object)**             |
| `authentication_type` * | enumerator | Signature type. Will always be "**opt-in**"| "**opt-in**"                                    |

### authenticity Object
| Field | Type   | Description               | Characters |
|-------|--------|-------------------------|------------|
| `timestamp` *            | string | Date and time when the document was signed.                | 27         |
| `facial_recognition_key`* | uuidv4 | Unique identification key of the account holder's selfie photo. | 36         |
| `lang`                  | string | Longitude coordinate of the signer's geolocation captured at the time of signing.                  | -          |
| `lat`                    | string | Latitude coordinate of the signer's geolocation captured at the time of signing.                   | -          |
| `ip_address`             | string | IP address of the signer's device.     | -          |
| `session_id`  *           | string | Signer's session ID at the time of signing.                | -          |

### signer Object
| Field                 | Type   | Description                                 | Characters                        |
|-----------------------|--------|-------------------------------------------|-----------------------------------|
| `name` *            | string | Signer's name.                        | -                                 |
| `email` *           | string | Signer's email.                       | -                                 |
| `phone` *           | object | Object with signer's phone data | **[phone Object](#phone-object)** |
| `document_number` * | string | Signer's CPF.                         | 11                                |

### phone Object 

| Field | Description | Example |  Max Characters | 
| --- | --- | --- | --- | 
|`country_code` *| string | Phone country code (https://ddi.guiamais.com.br/) | 3 | 
| `area_code` *| string | Phone area code (https://ddd.guiamais.com.br/) | 2 |
| `number` *| string |Phone number (numbers only) |  10 |

## Response

STATUS 201

Response Body

```json
 { "account_key": "78ea0fa6-8ea6-46ff-b66b-d2bc36fc8869" }
```

:::warning Warning
 The `account_request_key` field must be stored and will be used for account opening confirmation.
:::

### Response Body Params

| Field | Type | Description | Characters                                      |
|---|---| ---|-------------------------------------------------|
| `account_key` * | string  | Unique account identification key| -                                               | - |

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`  | Description (eng)<br/>`description` | Description(ptbr) <br></br>`translation`|
|---| --- | --- | --- | --- | 
| 400 | QIT000001 | Bad Request | Schema Error | Erro de Schema|
| 404 | QIT000404 | Not Found | Resource could not be found | Recurso não encontrado|

---

# Confirm Legal Entity Account Opening

URL: /en/documentation/baas/account/abrir_conta_pj

Account opening occurs in two mandatory steps. First, a POST request sends preliminary data to reserve the account. Then, a webhook of type `account_request.status_change` with status `pending_additional_data` is triggered. In the second step, a PATCH request finalizes the opening, officializing the account with complementary information.

## Request
ENDPOINT /account_request/ ACCOUNT_REQUEST_KEY /checking
METHOD PATCH

## Path Params
| Field         | Type   | Description                              | Characters |
|---------------|--------|----------------------------------------|------------|
| `account_request_key` | uuidv4 | Unique identification key for account reservation request. | 36         |

## Free Movement Account Opening

Request Body

```json
{
    "account_owner": {
        "phone": {
            "country_code": "55",
            "area_code": "11",
            "number": "999999999"
        },
        "email": "email@teste.com.br",
        "person_type": "legal",
        "name": "Empresa de Teste",
        "address": {
            "street": "Rua Abrahão Calux",
            "state": "SP",
            "city": "São Paulo",
            "neighborhood": "Vila Teste",
            "number": "116",
            "postal_code": "04286100",
            "complement": "Complemento"
        },
        "trading_name": "Nome fantasia",
        "company_document_number": "99999999000130",
        "cnae_code": "4721102",
        "foundation_date": "1980-07-11",
        "company_statute": "99999999-01c9-4cf5-a0fa-1d2a96f4b34d",
        "monthly_revenue": 100000,
        "company_representatives": [
            {
                "name": "Nome do Socio",
                "individual_document_number": "99999999999",
                "document_identification_number": "999999999",
                "birth_date": "1989-09-01",
                "mother_name": "Maria da Silva",
                "email": "teste@gmail.com",
                "is_pep": false,
                "final_beneficiary": true,
                "person_type": "natural",
                "nationality": "brasileiro(a)",
                "marital_status": "single",
                "document_identification": "88888-0ddf-4932-874f-9231794963da",
                "phone": {
                    "country_code": "055",
                    "area_code": "19",
                    "number": "999999999"
                },
                "address": {
                    "street": "Rua dos Limões",
                    "neighborhood": "Vila Moinho Velho",
                    "city": "São Paulo",
                    "state": "SP",
                    "postal_code": "04286100",
                    "number": "116",
                    "complement": "complemento"
                },
                "representative_relationship": "ceo"
            }
        ],
        "company_type": "ltda"
    },
    "signed_contract": {
        "document_key": "57cda530-d469-4427-a9d4-2523a510dee1",
        "signatures": [
            {
                "authenticity": {
                    "timestamp": "2024-05-10T14:15:03.114895Z",
                    "ip_address": "192168161",
                    "lang": "-35.8916627",
                    "lat": "-7.2226067",
                    "session_id": "54b8e3cf-15de-41e5-9305-0ecf059d6e2a",
                    "facial_recognition_key": "c367a540-2e7e-4373-a167-61bc43c30dc1"
                },
                "signer": {
                    "name": "Nome do assinante",
                    "email": "teste@gmail.com.br",
                    "phone": {
                        "country_code": "55",
                        "area_code": "11",
                        "number": "999999999"
                    },
                    "document_number": "99999999"
                },
                "authentication_type": "opt-in"
            }
        ]
    },
    "additional_documents": [
        "61f2a65e-0ddf-4932-874f-9231794963da"
    ]
}
```

### Request Body Params

| Field                 | Type   | Description                                                                            | Characters                                            |
|-----------------------|--------|--------------------------------------------------------------------------------------|-------------------------------------------------------|
| `account_owner` *   | object | Account holder object                                                              | **[account_owner Object](#account_owner-object)**     |
| `signed_contract` *| object | Object containing information about electronic acceptance of account opening terms. | **[signed_contract Object](#signed_contract-object)** |
| `additional_documents` *| list   | List with `document_key` (uuidv4) of additional documents from the account holder.  | 36 |

### account_owner Object

| Field                         | Type   | Description                                                                                                                         | Characters                                                            |
|-------------------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|
| `address` *                 | object | Account holder address object                                                                                               | **[address Object](#address-object)**                                 |
| `cnae_code`               | string | National Classification of Economic Activities                                                                                   | 9                                                                     |
| `company_document_number` * | string | CNPJ                                                                                                                              | 14                                                                    |
| `company_statute` *         | string | DOCUMENT_KEY of the company statute PDF (sent previously).                                                                 | 36                                                                    |
| `company_type`*              | enum   | Company type                                                                                                                   | **[company_type Enumerators](#company_type-enumerators)**           |
| `company_representatives` * | list   | List of company legal representatives                                                                                        | **[company_representatives Object](#company_representatives-object)** |
| `email` *                   | string | Company institutional email.                                                                                                   | 254                                                                   |
| `foundation_date`         | string | Company establishment date (format "YYYY-MM-DD").                                                                               | 10                                                                    |
| `name` *                    | string | Corporate name.                                                                                                                     | 100                                                                   |
| `person_type` *             | enum   | Identifier that the sent object is a legal entity. Must ALWAYS contain the value "legal" for legal entity object.                   | **[person_type Enumerators](#person_type-enumerators)**             |
| `phone` *                   | object | Account holder phone number.                                                                                                     | **[phone Object](#phone-object)**                                     | - |
| `trading_name` *            | string | Trade name.                                                                                                                    | 200                                                                   |
| `monthly_revenue`* | number | Company monthly revenue | |

### company_representatives Object

| Field                              | Type    | Description                                                                                              | Characters                                                                                  |
|------------------------------------|---------|--------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|
| `name` *                         | string  | Company representative name                                                                       | 100                                                                                         |
| `address` *                      | object  | Company representative address object                                                            | **[address Object](#address-object)**                                                       |
| `email` *                        | string  | Company representative email                                                                      | 254                                                                                         |
| `birth_date`                   | string  | Company representative birth date (format "YYYY-MM-DD")                                     | 10                                                                                          |
| `individual_document_number` *   | string  | Company representative CPF (numbers only).                                                      | 11                                                                                          |
| `document_identification`*        | string  | DOCUMENT_KEY of the PDF of person's photo identification document (ID or Driver's License) (sent previously) | 36                                                                                          |
| `document_identification_number`* | string  | Photo identification document number (ID or Driver's License)                                    | 16                                                                                          |
| `document_identification_type`   | enum    | Photo identification document type (ID or Driver's License)                                      | **[document_identification_type Enumerators](#document_identification_type-enumerators)** |
| `is_pep` *                       | boolean | Declaration if the person is PEP (http://www.portaldatransparencia.gov.br/download-de-dados/pep).          | -                                                                                           |
| `final_beneficiary`              | boolean | Declaration if the person is the final beneficiary of the company.                                     | -                                                                                           |
| `marital_status`                 | enum    | Company representative marital status                                                               | **[marital_status Enumerators](#marital_status-enumerators)**                             |
| `mother_name`                  | string  | Company representative mother's name                                                                | 100                                                                                         |
| `nationality`                    | string  | Company representative nationality                                                              | 50                                                                                          |
| `person_type` *                  | enum    | Identifier that the sent object is a natural person                                              | **[person_type Enumerators](#person_type-enumerators)**                                   |
| `phone` * | object  | Object with company representative phone data  | **[phone Object](#phone-object)**                                                           |
| `representative_relationship` * | enum | Identifier of the relationship between the company and its representative | **[representative_relationship Enumerators](#representative_relationship-enumerators)

### address Object

This object, present in both the natural person and legal entity objects, is a simple object to represent an address.

| Field              | Description | Example                                                                                   | Characters |
|--------------------|-----------|-------------------------------------------------------------------------------------------|------------|
| `street` *       | string    | Street address                                                                           | 500        |
| `state` *        | enum      | Address state (with two uppercase characters)                                       | 2          |
| `city` *         | string    | Address city                                                                        | 255        |
| `neighborhood` * | string    | Address neighborhood                                                                        | 500        |
| `number` *       | string    | Street number                                                                             | 10         |
| `postal_code` *  | string    | Address postal code (http://www.buscacep.correios.com.br/sistemas/buscacep/) (numbers only) | 8          |
| `complement`*     | string    | Address complement (free text)                                                     | 500        |

### signed_contract Object 
| Field | Type   | Description        | Characters    |
|-------|--------|------------------|---------------|
| `document_key` * | uuidv4 | Unique identification key for the **Account Opening Terms** or **Escrow Account Contract** document. (The DOCUMENT_KEY is returned in the response of the [Document upload](./upload_de_documentos) endpoint) | 36            |
| `signatures` *   | list   | Signature data for the sent document. Each list item corresponds to a document signatory.      | [signatures Object](#signatures-object) |

### signatures Object
| Field | Type       | Description         | Characters        |
|-------|------------|-------------------|-------------------|
| `authenticity` * | object     | Set of data that evidences the electronic signature made by the signatory. | [authenticity Object](#authenticity-object) |
| `signer` * | object     | Object containing data of one of the document signatories.           | [signer Object](#signer-object)|
| `authentication_type` * | enumerator | Signature type. Will always be "**opt-in**"| "**opt-in**"                   |

### authenticity Object
| Field | Type   | Description               | Characters |
|-------|--------|-------------------------|------------|
| `timestamp` *            | string | Date and time of document signature moment.                | 27         |
| `facial_recognition_key`* | uuidv4 | Unique identification key for the account holder's selfie photo.  | 36         |
| `lang`                   | string | Longitude coordinate of signatory's geolocation captured at signature moment.                  | -          |
| `lat`                    | string | Latitude coordinate of signatory's geolocation captured at signature moment.                   | -          |
| `ip_address`             | string | Signatory's device IP address.     | -          |
| `session_id`*             | string | Signatory's session ID at signature moment.                | -          |

### signer Object
| Field                 | Type   | Description                                 | Characters                        |
|-----------------------|--------|-------------------------------------------|-----------------------------------|
| `name` *            | string | Signatory name.                        | -                                 |
| `email` *           | string | Signatory email.                       | -                                 |
| `phone` *           | object | Object with signatory phone data | **[phone Object](#phone-object)** |
| `document_number` * | string | Signatory CPF.                         | 11                                |

### phone Object 

| Field | Description | Example |  Max Characters | 
| --- | --- | --- | --- | 
|`country_code` *| string | Phone country code (https://ddi.guiamais.com.br/) | 3 | 
| `area_code` *| string | Phone area code (https://ddd.guiamais.com.br/) | 2 |
| `number` *| string |Phone number (numbers only) |  10 |

### person_type Enumerators
| Enum        | Description       |
|-------------|-------------------|
| `natural` | Natural person     |
| `legal`   | Legal entity   |

### representative_relationship Enumerators
| Enum        | Description       |
|-------------|-------------------|
| `ceo` | Administrator  |
| `partner` | Partner/Shareholder |
| `attorney` | Attorney|

### document_identification_type Enumerators
| Enum    | Description                            |
|---------|----------------------------------------|
| `rg`  | RG - General Registry                    |
| `cnh` | CNH - National Driver's License |

### company_type Enumerators
| Enum                     | 	Description                                                             |
|--------------------------|--------------------------------------------------------------------------|
| `ltda`                  | Limited Liability Company                                                                |
| `sa`	                  | Corporation                                                        |
| `micro_enterprise`	    | Micro Enterprise                                                            |
| `freelancer`            | Freelancer                                                              |
| `sa_opened`             | Publicly Traded Corporation                                     |
| `sa_closed`	           | Closed Corporation                                     |
| `se_ltda`               | Limited Business Partnership                                           |
| `se_cn`                 | General Partnership                                   |
| `se_cs`                 | Limited Partnership                               |
| `se_ca`	               | Partnership Limited by Shares                              |
| `scp`                   | Silent Partnership                                      |
| `ei`	                   | Individual Entrepreneur                                                    |
| `ese`	                 | Brazilian Establishment of Foreign Company                     |
| `eeab`	                | Brazilian Establishment of Argentine-Brazilian Binational Company   |
| `ssp`                  | Simple Partnership                                                  |
| `ss_ltda`	             | Limited Simple Partnership                                               |
| `ss_cn`                | General Simple Partnership                                      |
| `ss_cs`                | Limited Simple Partnership                                  |
| `eireli_ne`            | Individual Limited Liability Company (Business Nature) |
| `eireli_ns`            | Individual Limited Liability Company (Simple Nature)   |
| `eireli`               | Individual Limited Liability Company                                  |
| `mei`                  | Individual Microentrepreneur                                            |
| `me`	                  | Micro Enterprise                                                            |
| `cop`	                 | Cooperative                                                              |
| `private_association`	 | Private Association                                                        |
| `others`	   | Others  |

### marital_status Enumerators
| Enum         | 	Description  |
|--------------|---------------|
| `single`   | Single   |
| `married`  | Married    |
| `widower`  | Widowed     |
| `divorced` | Divorced |
| `separated` | Separated |

## Response

STATUS 201

Response Body

```json
 { "account_key": "78ea0fa6-8ea6-46ff-b66b-d2bc36fc8869" }
```

:::warning Attention
 The `account_request_key` field must be stored and will be used to confirm account opening.
:::

### Response Body Params

| Field | Type | Description | Characters                                      |
|---|---| ---|-------------------------------------------------|
| `account_key` * | string  | Unique account identification key| -                                               | - |

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`  | Description (eng)<br/>`description` | Description(ptbr) <br></br>`translation`|
|---| --- | --- | --- | --- | 
| 400 | QIT000001 | Bad Request | Schema Error | Schema Error|
| 404 | QIT000404 | Not Found | Resource could not be found | Resource not found|

---

# Request account reservation

URL: /en/documentation/baas/account/account_draft_checking

## Request
ENDPOINT /account_request/draft_checking
METHOD POST

## Account Opening 

Request Body

```json
{
   "account_owner":{
      "address":{
         "street":"Av. Brigadeiro Faria Lima",
         "state":"SP",
         "city":"São Paulo",
         "neighborhood":"Jardim Paulistano",
         "number":"2391",
         "postal_code":"01452905",
         "complement":"Complemento"
      },
      "birth_date":"1990-05-06",
      "email":"teste@gmail.com",
      "individual_document_number":"99999999999",
      "is_pep":false,
      "mother_name":"Dona Maria Mariane",
      "name":"Nome do Titular da Conta",
      "nationality":"nationality",
      "person_type":"natural",
      "phone":{
         "country_code":"055",
         "area_code":"11",
         "number":"999999999"
      },
      "monthly_income":1000
   }
}
```

### Account Opening

### Request Body Params

| Field            | Type   | Description                                                                  |
|------------------|--------|----------------------------------------------------------------------------|
| `account_owner`* | object | Account holder details, including address and personal information.   |

### account_owner Object

| Field                         | Type    | Description                                                      |
|-------------------------------|---------|----------------------------------------------------------------|
| `address`*                    | object  | Account holder's address.                                  |
| `birth_date`*                 | string  | Account holder's birth date (format "YYYY-MM-DD").          |
| `email`*                      | string  | Account holder's email.                                     |
| `individual_document_number`* | string  | Account holder's CPF (numbers only).                               |
| `is_pep`*                     | boolean | Declaration if the person is a PEP.                                  |
| `mother_name`*                | string  | Account holder's mother's name.                                        |
| `name`*                       | string  | Account holder's full name.                                      |
| `nationality`                 | string  | Account holder's nationality.                                      |
| `person_type`*                | enum    | Person type, must always be "natural" for natural person.  |
| `phone`*                      | object  | Account holder's phone number.                                           |
| `monthly_income`              | number  | Account holder's monthly income.                                       |

### address Object

| Field           | Type   | Description              | Characters |
|-----------------|--------|------------------------|------------|
| `street`*       | string | Address street        | -        |
| `state`*        | enum   | Address state     | 2          |
| `city`*         | string | Address city     | -        |
| `neighborhood`* | string | Address neighborhood     | -        |
| `number`*       | string | Street number          | -         |
| `postal_code`*  | string | Address ZIP code        | -          |
| `complement`    | string | Address complement| -        |

### phone Object

| Field            | Type   | Description                |
|------------------|--------|--------------------------|
| `country_code`*  | string | Phone country code   |
| `area_code`*     | string | Phone area code   |
| `number`*        | string | Phone number       |

### person_type Enumerators

| Enum    | Description    |
|---------|--------------|
| `natural` | Natural person |
|`legal`| Legal entity |

## Response

STATUS 201

Response Body

```json
{
    "account_number": "1638634",
    "reserved_account_status":"reserved",
    "account_type":  "checking",
    "account_digit": "3",
    "account_key": "b1690f7b-1e82-4f76-a8d3-c326a2b89b67",
    "account_branch": "0001",
    "account_name": "Nome do Proprietário",
    "created_at": "2023-10-07T15:52:24"
}
```

:::warning Attention
 The `account_request_key` field must be stored and will be used to confirm the account opening.
:::

### Response Body Params

| Field | Type | Description | Characters                                      |
|---|---| ---|-------------------------------------------------|
| `account_key` * | string  | Account unique identification key| -                                               | - |

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`  | Description (eng)<br/>`description` | Description(ptbr) <br></br>`translation`|
|---| --- | --- | --- | --- | 
| 400 | QIT000001 | Bad Request | Schema Error | Erro de Schema|
| 404 | QIT000404 | Not Found | Resource could not be found | Recurso não encontrado|

---

# Request account reservation

URL: /en/documentation/baas/account/d4bf7f96-69b0-424b-a9d6-0a1bc79629cd

## Request
ENDPOINT /account_request/draft_checking
METHOD POST

## Account Opening 

Request Body

```json
{
   "account_owner":{
      "address":{
         "street":"Av. Brigadeiro Faria Lima",
         "state":"SP",
         "city":"São Paulo",
         "neighborhood":"Jardim Paulistano",
         "number":"2391",
         "postal_code":"01452905",
         "complement":"Complemento"
      },
      "birth_date":"1990-05-06",
      "email":"teste@gmail.com",
      "individual_document_number":"99999999999",
      "is_pep":false,
      "mother_name":"Dona Maria Mariane",
      "name":"Nome do Titular da Conta",
      "nationality":"nationality",
      "person_type":"natural",
      "phone":{
         "country_code":"055",
         "area_code":"11",
         "number":"999999999"
      },
      "monthly_income":1000
   }
}
```

### Account Opening

### Request Body Params

| Field            | Type   | Description                                                                  |
|------------------|--------|----------------------------------------------------------------------------|
| `account_owner`* | object | Account holder details, including address and personal information.   |

### account_owner Object

| Field                         | Type    | Description                                                      |
|-------------------------------|---------|----------------------------------------------------------------|
| `address`*                    | object  | Account holder's address.                                  |
| `birth_date`*                 | string  | Account holder's date of birth (format "YYYY-MM-DD").          |
| `email`*                      | string  | Account holder's email.                                     |
| `individual_document_number`* | string  | Account holder's CPF (numbers only).                               |
| `is_pep`*                     | boolean | Declaration if the person is a PEP (Politically Exposed Person).                                  |
| `mother_name`*                | string  | Account holder's mother's name.                                        |
| `name`*                       | string  | Account holder's full name.                                      |
| `nationality`                 | string  | Account holder's nationality.                                      |
| `person_type`*                | enum    | Person type, must always be "natural" for individual person.  |
| `phone`*                      | object  | Account holder's phone.                                           |
| `monthly_income`              | number  | Account holder's monthly income.                                       |

### address Object

| Field           | Type   | Description              | Characters |
|-----------------|--------|------------------------|------------|
| `street`*       | string | Street address        | -        |
| `state`*        | enum   | State     | 2          |
| `city`*         | string | City     | -        |
| `neighborhood`* | string | Neighborhood     | -        |
| `number`*       | string | Street number          | -         |
| `postal_code`*  | string | Postal code        | -          |
| `complement`    | string | Address complement| -        |

### phone Object

| Field            | Type   | Description                |
|------------------|--------|--------------------------|
| `country_code`*  | string | Phone country code   |
| `area_code`*     | string | Phone area code   |
| `number`*        | string | Phone number       |

### person_type Enumerators

| Enum    | Description    |
|---------|--------------|
| `natural` | Individual person |
|`legal`| Legal entity |

## Response

STATUS 201

Response Body

```json
{
    "account_number": "1638634",
    "reserved_account_status":"reserved",
    "account_type":  "checking",
    "account_digit": "3",
    "account_key": "b1690f7b-1e82-4f76-a8d3-c326a2b89b67",
    "account_branch": "0001",
    "account_name": "Nome do Proprietário",
    "created_at": "2023-10-07T15:52:24"
}
```

:::warning Attention
 The `account_request_key` field must be stored and will be used to confirm the account opening.
:::

### Response Body Params

| Field | Type | Description | Characters                                      |
|---|---| ---|-------------------------------------------------|
| `account_key` * | string  | Unique account identification key| -                                               | - |

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`  | Description (eng)<br/>`description` | Description(ptbr) <br></br>`translation`|
|---| --- | --- | --- | --- | 
| 400 | QIT000001 | Bad Request | Schema Error | Erro de Schema|
| 404 | QIT000404 | Not Found | Resource could not be found | Recurso não encontrado|

---

# Introduction

URL: /en/documentation/baas/account/introducao

One of the features we can offer in our integration is the possibility to manage accounts and transfers to QI Tech accounts or other financial institutions via API, but that's not all - we provide the possibility to OPEN an account via API. Whether for yourself or for third parties.

Like other APIs, service activation must be done with our team and calls are authenticated.

Account opening occurs in two mandatory stages. In the first stage, a POST request is sent with preliminary data to make the account reservation. After this request, a query is automatically executed to the Central Bank, specifically to the repository linked to the BC Protege+ project. This system allows individuals and legal entities to voluntarily register restrictions indicating at which financial institutions they do not want new accounts to be opened in their names, as a fraud prevention measure.

In this flow, the initial status of the reservation is `pending_bacen_validation`.
If the query is approved, a webhook of type `account_request.status_change` is triggered, updating the status to `pending_kyc_analysis`.

After approval in the KYC analysis, a new webhook `account_request.status_change` is sent, changing the status to `pending_additional_data` — a stage that indicates the completion of the analysis and the need to send complementary information.

In the second stage, a PATCH request must be made containing the additional data necessary to finalize the process and formalize the account opening.

---

# Request Individual Account Opening

URL: /en/documentation/baas/account/reservar_conta_pf

Account opening occurs in two mandatory stages. First, a POST request sends preliminary data to reserve the account. Then, a webhook of type `account_request.status_change` with status `pending_additional_data` is triggered. In the second stage, a PATCH request finalizes the opening, officializing the account with complementary information. 

## Request Account Reservation

## Request
ENDPOINT /account_request/checking
METHOD POST

Request Body

```json
{
    "request_control_key": "5ef0f67a-7672-4d00-8a02-faf847157c4b",
    "account_owner": {
        "document_number": "99999999999",
        "email": "email@teste.com",
        "birthdate": "2017-09-16",
        "name": "Titular da Conta",
        "documents": {
            "rg": {
                "ocr_front_key": "2ef0f67a-7672-4d00-8a02-faf847157b4a",
                "ocr_back_key": "1bd0e0a1-c1fa-4f9c-a230-f7a4163864be"
            },
            "cnh": {
                "ocr_key": "7a73be1a-0b66-4c0a-932a-1d1d02efdc4c"
            }
        },
        "face": "d38dd3c0-6f24-43b9-a37a-425d6700620f"
    }
}
```

:::info CPF/CNPJ Mock
To simulate approval, rejection, and manual analysis situations, you can use the first digit of the account owner's CPF/CNPJ:

0 to 7 -> Manual Analysis

8 -> Automatically rejected in KYC

9 -> Automatic Approval
:::

### Request Body Params

| Field | Type   | Description                                         | Characters                                        |
|---|--------|---------------------------------------------------|---------------------------------------------------|
| `account_owner` * | object | Object containing the Account Holder information | **[account_owner Object](#account_owner-object)** |
| `request_control_key` * | UUID   | Unique identifier per partner request  | 36                                                |

### account_owner Object
| Field | Type | Description | Characters |
|--- | --- | --- | --- |
| `document_number` * | string  | Account Holder CPF | 11 |
| `email` * | string  | Email | 11 |
| `birthdate` | string  | Account Holder birthdate (YYYY-MM-DD format) | 10 |
| `name` * | string  | Account Holder Full Name | 50 |
| `documents`* | object  | Account holder document(s) | **[documents Object](#documents-object)** |
| `face`*      | uuidv4  | Face recognition key from antifraud (`face_recognition_key`) | 36 |

### documents Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `rg`                           | object      | OCR keys from front and back RG upload of the holder | **[rg Object](#rg-object)**   |
| `cnh`                          | object      | OCR key from CNH upload of the holder                              | **[cnh Object](#cnh-object)** |
| `cnh_digital`                     | object      | OCR key from digital CNH upload of the holder                       | **[cnh_digital Object](#cnh_digital-object)** |
| `national_registry_of_foreigners` | object   | OCR keys from front and back RNE upload of the holder| **[national_registry_of_foreigners Object](#national_registry_of_foreigners-object)** |
| `national_migration_registry` | object   | OCR keys from front and back CRNM upload of the holder| **[national_migration_registry Object](#national_migration_registry-object)** |
| `passport`                     | object      | OCR key from passport upload of the holder                       | **[passport Object](#passport-object)** |
| `cin_digital`                     | object      | OCR key from digital National Identity Card upload of the holder                       | **[cin_digital Object](#cin_digital-object)** |

:::info Information
OCR keys (`ocr_key` or `ocr_front_key` and `ocr_back_key`) from document image uploads are provided as responses from image uploads in antifraud. The `face_recognition_key` is returned in the facial recognition response.
:::

### rg Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_front_key` *              | uuidv4      | OCR key from RG front image upload                      | 36                            |
| `ocr_back_key` *               | uuidv4      | OCR key from RG back image upload                       | 36                            |

OR

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key from RG image upload                                | 36                       |

### cnh Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_front_key` *              | uuidv4      | OCR key from CNH front image upload                     | 36                            |
| `ocr_back_key` *               | uuidv4      | OCR key from CNH back image upload                      | 36                            |

OR

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key from CNH image upload                               | 36                            |

### cnh_digital Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key from digital CNH image upload                               | 36                            |

### national_registry_of_foreigners Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_front_key` *              | uuidv4      | OCR key from RNE front image upload                     | 36                            |
| `ocr_back_key` *               | uuidv4      | OCR key from RNE back image upload                      | 36                            |

OR

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key from RNE image upload                               | 36                            |

### national_migration_registry Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_front_key` *              | uuidv4      | OCR key from CRNM front image upload                     | 36                            |
| `ocr_back_key` *               | uuidv4      | OCR key from CRNM back image upload                      | 36                            |

OR

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key from CRNM image upload                               | 36                            |

### passport Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key from passport image upload                               | 36                            |

### cin_digital Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key from digital National Identity Card image upload                               | 36                            |

## Response

STATUS 201

Response Body

```json
{
    "account_info": {
        "account_branch": "0001",
        "account_digit": "0",
        "account_number": "1693580"
    },
    "account_request_key": "f230f1b5-07af-4737-b0e3-8a472304f5e7",
    "account_request_status": "pending_bacen_validation"
}
```

:::info Bacen Protege+ Flow
The proposal starts with status `pending_bacen_validation`. The system performs a preliminary validation with Bacen Protege+ before proceeding with KYC analysis. After Bacen approval, the status will be automatically updated to `pending_kyc_analysis`.
:::

:::warning Warning
 The `account_request_key` field must be stored and will be used for account opening confirmation.
:::

### Response Body Params

| Field | Type | Description | Characters|
|---|---| ---|---|
| `account_info` * | object  | Object containing Account Holder information |**[account_info Object](#account_info-object)**  | - |
| `account_request_key` * | string  | Creation request identification key | - | - |
| `account_request_status` * | string  | KYC Status | - | - |

### account_info Object
| Field | Type | Description | Characters |
|---|---| ---| --- |
| `account_branch` * | string  | Branch Number | 4 |
| `account_digit` * | string  | Account Digit | 11 |
| `account_number` * | string  | Account Number | 50 |

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`  | Description (eng)<br/>`description` | Description(ptbr) <br></br>`translation`|
|---| --- | --- | --- | --- | 
| 400 | QIT000001 | Bad Request | Schema Error | Erro de Schema|
| 404 | QIT000404 | Not Found | Resource could not be found | Recurso não encontrado|

---

# Legal Entity Account Opening

URL: /en/documentation/baas/account/reservar_conta_pj

Account opening occurs in two mandatory stages. First, a POST request sends preliminary data to reserve the account. Then, a webhook of type `account_request.status_change` with the status `pending_additional_data` is triggered. In the second stage, a PATCH request finalizes the opening, making the account official with the complementary information.

## Request Account Reservation

## Request
ENDPOINT /account_request/checking
METHOD POST

Request Body

```json
{
  
    "account_owner": {
        "company_document_number": "99999999000199",
        "email": "teste@email.com",
        "foundation_date": "2017-09-16",
        "name": "NOME DA EMPRESA"
    },
    "legal_representatives": [
        {
            "birthdate": "1963-07-23",
            "name": "Don Corleone",
            "document_number": "03912394323",
            "email": "teste@gmail.com",
            "documents": {
                "national_registry_of_foreigners": {
                    "ocr_front_key": "0aa8a4ca-5873-49bd-851c-1f2c71a1cc28",
                    "ocr_back_key": "29f6e346-7fae-4dcb-9ea1-2a3e4ef593ea"
                }
            },
            "face": "68da08f1-6cf4-4dce-a297-7b2f09311784"
        },
        {
            "birthdate": "1996-03-10",
            "name": "John Doe",
            "document_number": "39113492093",
            "email": "teste@gmail.com",
            "documents": {
                "cnh": {
                    "ocr_key": "beee557e-9240-4c5b-88f1-42812b195168"
                }
            }
        }
    ]
}
```
:::info CPF/CNPJ Mock
To simulate approval, rejection, and manual analysis situations, you can use the first digit of the account owner's CPF/CNPJ:

0 to 6 -> Manual Analysis

7 -> Rejected by bacen protege+

8 -> Automatically rejected in KYC

9 -> Automatic Approval
:::

### Request Body Params

| Field | Type | Description | Characters |
|---|---| ---|---|
| `account_owner` * | object  | Object containing Account Holder information | **[account_owner Object](#account_owner-object)** |
| `legal_representatives`* | object array | List of account representatives and their data | **[legal_representative Object](#legal_representative-object)** |

### account_owner Object
| Field | Type | Description | Characters |
|--- | --- | --- | --- |
| `company_document_number` * | string  | Account Holder CNPJ | 50 |
| `email` * | string  | Email | 11 |
| `foundation_date` | string  | Company foundation date (YYYY-MM-DD format) | 10 |
| `name` * | string  | Account Holder Full Name | 50 |

### legal_representative Object

| Field | Type | Description | Characters |
|--- | --- | --- | --- |
| `document_number` * | string  | Account Holder CPF | 11 |
| `birthdate` | string  | Date of birth (YYYY-MM-DD format) | 10 |
| `name` * | string  | Account Holder Name | 50 |
| `documents` * | object  | Account holder document(s) | **[documents Object](#documents-object)** |
| `face`*      | uuidv4  | Facial recognition key made with antifraud (`face_recognition_key`) | 36 |

### documents Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `rg`                           | object      | OCR keys for front and back upload of holder's RG | **[rg Object](#rg-object)**   |
| `cnh`                          | object      | OCR key for holder's CNH upload                              | **[cnh Object](#cnh-object)** |
| `cnh_digital`                     | object      | OCR key for holder's digital CNH upload                       | **[cnh_digital Object](#cnh_digital-object)** |
| `national_registry_of_foreigners` | object   | OCR keys for front and back upload of holder's RNE| **[national_registry_of_foreigners Object](#national_registry_of_foreigners-object)** |
| `national_migration_registry` | object   | OCR keys for front and back upload of holder's CRNM| **[national_migration_registry Object](#national_migration_registry-object)** |
| `passport`                     | object      | OCR key for holder's passport upload                       | **[passport Object](#passport-object)** |
| `cin_digital`                     | object      | OCR key for holder's digital National Identity Card upload                       | **[cin_digital Object](#cin_digital-object)** |

:::info Information
The OCR keys (`ocr_key` or `ocr_front_key` and `ocr_back_key`) for document image uploads are provided as a response from antifraud image uploads. The `face_recognition_key` is returned in the facial recognition response.
:::

### rg Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_front_key` *              | uuidv4      | OCR key for RG front image upload                      | 36                            |
| `ocr_back_key` *               | uuidv4      | OCR key for RG back image upload                       | 36                            |

OR

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key for RG image upload                                | 36                            |

### cnh Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_front_key` *              | uuidv4      | OCR key for CNH front image upload                     | 36                            |
| `ocr_back_key` *               | uuidv4      | OCR key for CNH back image upload                      | 36                            |

OR

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key for CNH image upload                               | 36                            |

### cnh_digital Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key for digital CNH image upload                               | 36                            |

### national_registry_of_foreigners Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_front_key` *              | uuidv4      | OCR key for RNE front image upload                     | 36                            |
| `ocr_back_key` *               | uuidv4      | OCR key for RNE back image upload                      | 36                            |

OR

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key for RNE image upload                               | 36                            |

### national_migration_registry Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_front_key` *              | uuidv4      | OCR key for CRNM front image upload                     | 36                            |
| `ocr_back_key` *               | uuidv4      | OCR key for CRNM back image upload                      | 36                            |

OR

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key for CRNM image upload                               | 36                            |

### passport Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key for passport image upload                               | 36                            |

### cin_digital Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key for digital National Identity Card image upload                               | 36                            |

## Response

STATUS 201

Response Body

```json
{
    "account_info": {
        "account_branch": "0001",
        "account_digit": "0",
        "account_number": "1693580"
    },
    "account_request_key": "f230f1b5-07af-4737-b0e3-8a472304f5e7",
    "account_request_status": "pending_bacen_validation"
}
```

:::info Bacen Protege+ Flow
The proposal starts with status `pending_bacen_validation`. The system performs a preliminary validation with Bacen Protege+ before proceeding with KYC analysis. After Bacen approval, the status will be automatically updated to `pending_kyc_analysis`.
:::

:::warning Warning
The `account_request_key` field must be stored and will be used for account opening confirmation.
:::

### Response Body Params

| Field | Type | Description | Characters|
|---|---| ---|---|
| `account_info` * | object  | Object containing Account Holder information |**[account_info Object](#account_info-object)**  | - |
| `account_request_key` * | string  | Creation request identification key | - | - |
| `account_request_status` * | string  | KYC Status | - | - |

### account_info Object
| Field | Type | Description | Characters |
|---|---| ---| --- |
| `account_branch` * | string  | Branch Number | 4 |
| `account_digit` * | string  | Email | 11 |
| `account_number` * | string  | Account Holder Full Name | 50 |

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`  | Description (eng)<br/>`description` | Description(ptbr) <br></br>`translation`|
|---| --- | --- | --- | --- | 
| 400 | QIT000001 | Bad Request | Schema Error | Erro de Schema|
| 404 | QIT000404 | Not Found | Resource could not be found | Recurso não encontrado|

---

# Account opening webhooks

URL: /en/documentation/baas/account/webhooks

After the account reservation request, the initial status is `pending_bacen_validation`. If approved, the reservation status is updated to `pending_kyc_analysis`. Then, upon KYC approval, the status becomes `pending_additional_data`.

For the status `pending_kyc_analysis`, `pending_additional_data` and `rejected`, the webhook of type `account_request.status_change` is sent, being this event essential for controlling the next actions necessary for account opening confirmation.

The account number will be reserved at the time of the opening reservation request, however at this moment **the account will not yet be open**. Only after completion of QI Tech's KYC analysis and subsequent confirmation of the request by the partner, the account will be open.

### account_request_status enumerators
| Enum                        | Description                         |
|-----------------------------|-------------------------------------|
| **pending_kyc_analysis**    | Pending KYC approval                |
| **pending_additional_data** | Pending additional information      |
| **rejected**                | Opening rejected                    |

When the status is `rejected`, the webhook includes the `rejection_reason` field in the root of the message. The value of this field is free-form and returned directly from the KYC analysis, and may vary according to the reason identified, whether from KYC analysis or from Bacen Protege+.

### KYC analysis pending webhook

WEBHOOK_TYPE account_request.status_change
STATUS pending_kyc_analysis

Webhook Body

```json
{
    "data": {
        "account_info": {
            "account_digit": "3",
            "account_branch": "0001",
            "account_number": "1638634"
        },
        "account_request_key": "dc575950-dcce-48e1-99a6-5fb0ada63d86",
        "status": "pending_kyc_analysis"
    },
    "event_datetime": "2022-09-02 22:39:39",
    "key": "dc575950-dcce-48e1-99a6-5fb0ada63d86",
    "status": "pending_kyc_analysis",
    "webhook_type": "account_request.status_change"
}
```

### Account confirmation pending webhook

WEBHOOK_TYPE account_request.status_change
STATUS pending_additional_data

Webhook Body

```json
{
    "key": "dc575950-dcce-48e1-99a6-5fb0ada63d86",
    "data": {
        "account_info": {
            "account_digit": "3",
            "account_branch": "0001",
            "account_number": "1638634"
        },
        "account_request_key": "dc575950-dcce-48e1-99a6-5fb0ada63d86"
    },
    "event_datetime": "2022-09-02 22:39:39",
    "status": "pending_additional_data",
    "webhook_type": "account_request.status_change"
}
```

### Rejected account opening webhook (KYC)

WEBHOOK_TYPE account_request.status_change
STATUS rejected

Webhook Body

```json
{
    "data": {
        "account_info": {
            "account_digit": "3",
            "account_branch": "0001",
            "account_number": "1638634"
        },
        "account_request_key": "dc575950-dcce-48e1-99a6-5fb0ada63d86"
    },
    "event_datetime": "2022-09-02T22:39:39",
    "key": "dc575950-dcce-48e1-99a6-5fb0ada63d86",
    "status": "rejected",
    "webhook_type": "account_request.status_change",
    "rejection_reason": "UNSC"
}
```

### Rejected account opening webhook (Bacen Protege+)

WEBHOOK_TYPE account_request.status_change
STATUS rejected

Webhook Body

```json
{
    "data": {
        "account_info": {
            "account_digit": "3",
            "account_branch": "0001",
            "account_number": "1638634"
        },
        "account_request_key": "dc575950-dcce-48e1-99a6-5fb0ada63d86"
    },
    "event_datetime": "2022-09-02T22:39:39",
    "key": "dc575950-dcce-48e1-99a6-5fb0ada63d86",
    "status": "rejected",
    "webhook_type": "account_request.status_change",
    "rejection_reason": "Rejeitado devido ao Bacen Protege+"
}
```

---

# Error Catalog - Banking-as-a-Service

URL: /en/documentation/baas/catalogo_de_erros_baas

Below are all errors that may be returned by Banking-as-a-Service APIs.
Each error code has a unique identifier that can be used as a reference.

:::info
The pix-keys-api service only uses shared errors (QIT) listed in the Common Errors section below.
:::

## Common Errors

Errors shared across all platform APIs.

| Code | HTTP | Message |
|-|-|-|
| <a id="QIT000001"></a>`QIT000001` | 400 | **Schema Validator Error**<br/>{description}<br/><small>Payload Inválido</small> |
| <a id="QIT000002"></a>`QIT000002` | 403 | **Permission Validator Error**<br/>Request must be internal |
| <a id="QIT000003"></a>`QIT000003` | 403 | **Permission Validator Error**<br/>The agent does not have enough roles.<br/><small>O agente não tem funções suficientes.</small> |
| <a id="QIT000004"></a>`QIT000004` | 403 | **Permission Validator Error**<br/>Selected agent and person_key are different<br/><small>Agente selecionado e person_key são diferentes</small> |
| <a id="QIT000005"></a>`QIT000005` | 403 | **Permission Validator Error**<br/>Selected agent do not own this item.<br/><small>O agente selecionado não é dono do item.</small> |
| <a id="QIT000006"></a>`QIT000006` | 403 | **Permission Validator Error**<br/>Selected agent do not own this item and has not enough roles.<br/><small>Agente selecionado não é dono deste item e não tem funções suficientes.</small> |
| <a id="QIT000007"></a>`QIT000007` | - | **External API Error (Rest Connector)**<br/>{description}<br/><small>{translation}</small> |
| <a id="QIT000010"></a>`QIT000010` | 400 | **Search Params Error**<br/>Invalid integer value for page or size querystring parameters<br/><small>Valor inválido para parâmetros página ou tamanho de página</small> |
| <a id="QIT000400"></a>`QIT000400` | 400 | **Bad Request**<br/>The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, size too large, invalid request message framing, or deceptive request routing)<br/><small>O servidor não pode ou não processará a requisição devido a um erro do cliente (por exemplo, corpo da requisição inválido, tamanho muito grande, formatação da mensagem inválida ou rota inválida)</small> |
| <a id="QIT000404"></a>`QIT000404` | 404 | **Not Found**<br/>The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible<br/><small>O resource solicitado não pôde ser encontrado, mas pode estar disponível no futuro. Requests subsequentes do cliente são permitidos</small> |
| <a id="QIT000500"></a>`QIT000500` | 500 | **Internal Error**<br/>An internal error has occurred and its being investigated.<br/><small>Um erro interno aconteceu e está sendo investigado.</small> |
| <a id="QIT000753"></a>`QIT000753` | 500 | **Internal Error**<br/>An internal error has occurred and its being investigated.<br/><small>Um erro interno aconteceu e está sendo investigado.</small> |

## Specific Errors

### ACC — Accounts

224 errors

| Code | HTTP | Message |
|-|-|-|
| <a id="ACC000001"></a>`ACC000001` | 400 | **Bad Request**<br/>Use POST /account |
| <a id="ACC000002"></a>`ACC000002` | 409 | **Reserved Account Error**<br/>Reserved account already created<br/><small>Conta reservada já foi criada</small> |
| <a id="ACC000003"></a>`ACC000003` | 409 | **Reserved Account Error**<br/>Reserved account already released<br/><small>Conta reservada já foi liberada</small> |
| <a id="ACC000004"></a>`ACC000004` | 400 | **Bad Request**<br/>Use PATCH /account/{account_key} |
| <a id="ACC000005"></a>`ACC000005` | 403 | **Unauthorized Agent**<br/>This agent can not perform this action<br/><small>Este agente não pode realizar esta ação</small> |
| <a id="ACC000006"></a>`ACC000006` | 404 | **Not Found**<br/>Account not found for the given key {account_key}<br/><small>Conta não encontrada para a seguinte chave {account_key}</small> |
| <a id="ACC000007"></a>`ACC000007` | 400 | **Bad Request**<br/>A SELECTED_AGENT or person_key must be provided<br/><small>SELECTED_AGENT ou person_key devem ser fornecidos</small> |
| <a id="ACC000008"></a>`ACC000008` | 404 | **Not Found**<br/>Account not found for the given parameters.<br/><small>Conta não encontrada para os parâmetros fornecidos.</small> |
| <a id="ACC000009"></a>`ACC000009` | 423 | **Invalid Account**<br/>Blocked or closed accounts can not perform this action<br/><small>Contas bloqueadas ou fechadas não podem realizar esta ação.</small> |
| <a id="ACC000010"></a>`ACC000010` | 404 | **Owner Person Not Found**<br/>Owner person_key {person_key} not found.<br/><small>Dono não encontrada para a person_key {person_key}.</small> |
| <a id="ACC000011"></a>`ACC000011` | 423 | **Invalid Account**<br/>Closed accounts can not perform this action.<br/><small>Contas fechadas não podem realizar esta ação.</small> |
| <a id="ACC000012"></a>`ACC000012` | 400 | **Bad Request**<br/>Account Key is obligatory<br/><small>Chave da conta (account_key) é obrigatória</small> |
| <a id="ACC000013"></a>`ACC000013` | 400 | **Bad Request**<br/>Use /account/{account_key}/beneficiary |
| <a id="ACC000014"></a>`ACC000014` | 400 | **Bad Request**<br/>Use /account/{account_key}/beneficiary?document_number={document_number} or /account/{account_key}/beneficiary/{beneficiary_key}<br/><small>Use /account/{account_key}/beneficiary?document_number={document_number} ou /account/{account_key}/beneficiary/{beneficiary_key}</small> |
| <a id="ACC000015"></a>`ACC000015` | 400 | **Bad Request**<br/>is_activated is needed in payload<br/><small>Parâmetro is_activated é obrigatório</small> |
| <a id="ACC000016"></a>`ACC000016` | 404 | **Not Found**<br/>Beneficiary accounts not found for the given parameters.<br/><small>Contas do beneficiário não encontradas para os parâmetros fornecidos</small> |
| <a id="ACC000017"></a>`ACC000017` | 404 | **Not Found**<br/>Target account not found for the given key<br/><small>Conta destino não encontrada para os parâmetros fornecidos</small> |
| <a id="ACC000018"></a>`ACC000018` | 402 | **Block Balance Error**<br/>Impossible to block an amount greater than account balance<br/><small>Não é possível blockear uma quantidade maior do que o saldo na conta</small> |
| <a id="ACC000019"></a>`ACC000019` | 402 | **Block Balance Error**<br/>Account blocked balance cannot be negative.<br/><small>Saldo da conta a ser bloqueada não pode ser negativo.</small> |
| <a id="ACC000020"></a>`ACC000020` | 402 | **Block Balance Error**<br/>Account blocked balance cannot be 0 or null.<br/><small>Saldo da conta a ser bloqueada não pode ser 0 ou nulo.</small> |
| <a id="ACC000021"></a>`ACC000021` | 422 | **Account Status Error**<br/>Account status can not perform this action (source_status: {source_account_enumerator}, target_status: {target_account_enumerator})<br/><small>Status da conta não pode realizar esta ação (source_status: {source_account_enumerator}, target_status: {target_account_enumerator})</small> |
| <a id="ACC000022"></a>`ACC000022` | 422 | **Unprocessable Entity**<br/>Transaction already performed<br/><small>Transação já realizada</small> |
| <a id="ACC000023"></a>`ACC000023` | 422 | **Unprocessable Entity**<br/>Transaction cannot be performed before the transaction_date<br/><small>Transação não pode ser realizada antes da data de transação (transaction_date)</small> |
| <a id="ACC000024"></a>`ACC000024` | 404 | **Not Found**<br/>Transaction not found<br/><small>Transação não encontrada</small> |
| <a id="ACC000025"></a>`ACC000025` | 422 | **Invalid Account**<br/>Invalid account.<br/><small>Conta inválida.</small> |
| <a id="ACC000026"></a>`ACC000026` | 422 | **Account Error**<br/>Transaction must be performed using a system account.<br/><small>Transações devem ser realizadas utilizando uma conta do sistema.</small> |
| <a id="ACC000027"></a>`ACC000027` | 402 | **Account Balance Error**<br/>Account balance must not be negative after the transaction.<br/><small>Saldo da conta não pode ser negativo após a transação.</small> |
| <a id="ACC000028"></a>`ACC000028` | 402 | **Account Balance Error**<br/>Transaction cannot be made due to already blocked balance.<br/><small>Transação não pode ser feita pois saldo em conta bloqueado.</small> |
| <a id="ACC000029"></a>`ACC000029` | 400 | **Bad Request**<br/>No body provided<br/><small>Request não possui body.</small> |
| <a id="ACC000030"></a>`ACC000030` | 400 | **Bad Request**<br/>Use POST /reserved_account |
| <a id="ACC000031"></a>`ACC000031` | 400 | **Bad Request**<br/>Use GET /reserved_account/{reserved_account_key} |
| <a id="ACC000032"></a>`ACC000032` | 404 | **Not Found**<br/>Reserved account not found.<br/><small>Conta reservada não encontrada</small> |
| <a id="ACC000033"></a>`ACC000033` | 404 | **Not Found**<br/>There is no transaction for the given key<br/><small>Transação não encontrada para a chave fornecida</small> |
| <a id="ACC000034"></a>`ACC000034` | 422 | **Account Error**<br/>Transaction cannot be performed using a system account.<br/><small>Transações não devem ser realizadas utilizando uma conta do sistema.</small> |
| <a id="ACC000035"></a>`ACC000035` | 400 | **Bad Request**<br/>Status parameter is required<br/><small>É necessário o parâmetro STATUS na request</small> |
| <a id="ACC000036"></a>`ACC000036` | 400 | **Bad Request**<br/>Wrong parameters used on the request<br/><small>Parâmetros incorretos</small> |
| <a id="ACC000037"></a>`ACC000037` | 400 | **Bad Request**<br/>Wrong parameter used on the request: {param}<br/><small>Parâmetro incorreto: {param}</small> |
| <a id="ACC000038"></a>`ACC000038` | 400 | **Transaction Request Error**<br/>Missing transaction request key<br/><small>Necessária a chave da Solicitação de transação</small> |
| <a id="ACC000039"></a>`ACC000039` | 400 | **Transaction Request Error**<br/>Transaction request not found<br/><small>Solicitação de transação não encontrada</small> |
| <a id="ACC000040"></a>`ACC000040` | 400 | **Transaction Request Error**<br/>Transaction request {transaction_request_key} already approved<br/><small>Solicitação de transação {transaction_request_key} já foi aprovada</small> |
| <a id="ACC000041"></a>`ACC000041` | 400 | **Transaction Request Error**<br/>Transaction {transaction_request_key} request already rejected<br/><small>Solicitação de transação {transaction_request_key} já foi recusada</small> |
| <a id="ACC000042"></a>`ACC000042` | 400 | **Transaction Request Error**<br/>User has already approved the {transaction_request_key} request<br/><small>O usuário já aprovou a solicitação {transaction_request_key}</small> |
| <a id="ACC000043"></a>`ACC000043` | 400 | **Transaction Request Error**<br/>User has already rejected the {transaction_request_key} request<br/><small>O usuário já rejeitou a solicitação {transaction_request_key}</small> |
| <a id="ACC000044"></a>`ACC000044` | 423 | **Transaction Request Error**<br/>Closed target can not receive transfer<br/><small>Conta destino fechada não pode receber transferências</small> |
| <a id="ACC000045"></a>`ACC000045` | 400 | **Bad Request**<br/>Missing page or size mandatory parameters on request.<br/><small>Request não possui os parâmetros obrigatórios de tamanho e número de página.</small> |
| <a id="ACC000046"></a>`ACC000046` | 404 | **Not Found**<br/>No match for given schedule_key<br/><small>Nenhum resultado encontrado para a schedule_key fornecida</small> |
| <a id="ACC000047"></a>`ACC000047` | 400 | **Bad Request**<br/>Scheduling time cannot occur for the same day after 17:00, nor be on a weekend, holiday or on a past date.<br/><small>Data de agendamento não pode ser para o mesmo dia após as 17:00, nem ser finais de semana, feriados ou datas passadas.</small> |
| <a id="ACC000048"></a>`ACC000048` | 402 | **Balance Error**<br/>Not enough balance to perform transaction<br/><small>Saldo insuficiente para esta transação</small> |
| <a id="ACC000049"></a>`ACC000049` | 400 | **Credential Error**<br/>This account doesn't have requester credentials<br/><small>Esta conta não possui credenciais de requester</small> |
| <a id="ACC000050"></a>`ACC000050` | 400 | **Bad Request**<br/>Invalid destination, destination account not permitted for this escrow account<br/><small>COnta de destino inválida, conta de destino não cadastrada para essa conta escrow</small> |
| <a id="ACC000051"></a>`ACC000051` | 400 | **Destination Error**<br/>Destination isn't a internal account<br/><small>Destino não é uma conta interna</small> |
| <a id="ACC000052"></a>`ACC000052` | 400 | **Bad Request**<br/>Invalid Transaction Type.<br/><small>Tipo de transação inválido</small> |
| <a id="ACC000053"></a>`ACC000053` | 400 | **Bad Request**<br/>Invalid operation for this account type<br/><small>Tipo de operação inválida para este tipo de conta</small> |
| <a id="ACC000054"></a>`ACC000054` | 400 | **Bad Request**<br/>{rule_enum} was not found among registered rules.<br/><small>{rule_enum} não encontrada dentro das regras registradas.</small> |
| <a id="ACC000055"></a>`ACC000055` | 400 | **Bad Request**<br/>Mismatch between automatic transfer configuration and respective rule template: {message}<br/><small>Incompatibilidade entre a configuração de transferência automática e o modelo da respectiva regra: {message}</small> |
| <a id="ACC000056"></a>`ACC000056` | 422 | **Unprocessable Entity**<br/>Account is empty.<br/><small>A conta está vazia.</small> |
| <a id="ACC000057"></a>`ACC000057` | 400 | **Bad Request**<br/>Movement date cannot be a past date<br/><small>Data de movimentação não pode ser uma data passada</small> |
| <a id="ACC000058"></a>`ACC000058` | 400 | **Bad Request**<br/>Movement date has to be a workday<br/><small>Data de movimentação precisa ser um dia util</small> |
| <a id="ACC000059"></a>`ACC000059` | 400 | **Bad Request**<br/>Movement date has to be today for movement type: {movement_type}<br/><small>Data de movimentação precisa ser hoje para o tipo: {movement_type}</small> |
| <a id="ACC000060"></a>`ACC000060` | 400 | **Bad Request**<br/>Movement date cannot be today for movement type: {movement_type}<br/><small>Data de movimentação não pode ser hoje para o tipo: {movement_type}</small> |
| <a id="ACC000061"></a>`ACC000061` | 423 | **Locked**<br/>Bank slip payment is available from {opening_time} to {closing_time}<br/><small>Pagamento de boleto está disponível entre {opening_time} e {closing_time}</small> |
| <a id="ACC000062"></a>`ACC000062` | 423 | **Locked**<br/>TED is available from {opening_time} to {closing_time}<br/><small>TED está disponível entre {opening_time} e {closing_time}</small> |
| <a id="ACC000063"></a>`ACC000063` | 404 | **Not Found**<br/>Movement schema not found for {movement_type} movement type<br/><small>Schema de movimentação não pode ser encontrado para o tipo: {movement_type}</small> |
| <a id="ACC000064"></a>`ACC000064` | 400 | **Bad Request**<br/>No {product_type} {role_type} found for owner_person_key {person_key}<br/><small>{product_type} {role_type} não encontrado para a person_key {person_key}</small> |
| <a id="ACC000065"></a>`ACC000065` | 400 | **Bad Request**<br/>Approver feedback must be a boolean<br/><small>Feedback do aprovador precisa ser booleano</small> |
| <a id="ACC000066"></a>`ACC000066` | 404 | **Not Found**<br/>Movement requests not found for given keys<br/><small>Pedidos de movimentação não encontrados para as chaves informadas</small> |
| <a id="ACC000067"></a>`ACC000067` | 409 | **Conflict**<br/>A movement request with status {movement_status} already exists for the informed digitable line<br/><small>Um pedido de movimentação com status {movement_status} ja existe para a linha digitavel</small> |
| <a id="ACC000068"></a>`ACC000068` | 403 | **Unauthorized**<br/>Only master users can change account webhook enablement<br/><small>Apenas usuários master podem mudar a habilitação da conta para o webhook</small> |
| <a id="ACC000069"></a>`ACC000069` | 400 | **Bad Request**<br/>Use POST /account/{account_key}/webhook_enabled |
| <a id="ACC000070"></a>`ACC000070` | 400 | **Bad Request**<br/>Use POST /monthly_account_fee |
| <a id="ACC000071"></a>`ACC000071` | 400 | **Bad Request**<br/>Use PATCH /monthly_account_fee/{account_key} |
| <a id="ACC000072"></a>`ACC000072` | 404 | **Not Found**<br/>Transaction Receipt Not Found for key {transaction_key}<br/><small>Recibo de transação não encontrado para key {transaction_key}</small> |
| <a id="ACC000073"></a>`ACC000073` | 400 | **Bad Request**<br/>Remaining balance must not be less than 0<br/><small>Saldo remanescente mínimo não pode ser menor que 0</small> |
| <a id="ACC000074"></a>`ACC000074` | 423 | **Locked**<br/>Bank slip payment greater than or equal to R${amount} is available from {opening_time} to {closing_time}<br/><small>Pagamento de boleto igual ou acima de R${amount} está disponível entre {opening_time} e {closing_time}</small> |
| <a id="ACC000075"></a>`ACC000075` | 403 | **Unauthorized**<br/>User does not have permission to request this transaction<br/><small>Usuário não tem permissão para requisitar essa transação</small> |
| <a id="ACC000076"></a>`ACC000076` | 400 | **Bad Request**<br/>Invalid cron for automatic transfer<br/><small>Cron inválida para cadastro de transferência automática</small> |
| <a id="ACC000077"></a>`ACC000077` | 400 | **Bad Request**<br/>Account number and branch must be integers.<br/><small>Número da conta e da agência devem ser inteiros.</small> |
| <a id="ACC000078"></a>`ACC000078` | 404 | **Not Found**<br/>Destination account internal not found<br/><small>Conta destino interna não encontrada</small> |
| <a id="ACC000079"></a>`ACC000079` | 403 | **Unauthorized**<br/>User does not have permission to approve or reject this movement request<br/><small>Usuário não tem permissão para aprovar ou rejeitar um pedido de transação</small> |
| <a id="ACC000080"></a>`ACC000080` | 403 | **Bad Request**<br/>Setup Fee can not be negative<br/><small>Taxa de configuração não pode ser negativa</small> |
| <a id="ACC000081"></a>`ACC000081` | 404 | **Not Found**<br/>Transaction Schedule not found<br/><small>Transação não encontrada</small> |
| <a id="ACC000082"></a>`ACC000082` | 423 | **Invalid Account**<br/>Closed accounts can not perform this action {account_key}.<br/><small>Contas fechadas não podem realizar esta ação. {account_key}</small> |
| <a id="ACC000083"></a>`ACC000083` | 400 | **Source Account not found**<br/>The source account from CNAB was not found. Source Account number: {account_number}<br/><small>A conta de origem identificada no CNAB não foi encontrada. Conta de origem {account_number}</small> |
| <a id="ACC000084"></a>`ACC000084` | 400 | **Payment date in the past**<br/>It was found a transaction with payment date in the past. Payment date from transaction: {payment_date}<br/><small>Foi encontrada uma transação que está com a data de pagamento no passado. {payment_date}</small> |
| <a id="ACC000085"></a>`ACC000085` | 400 | **Bad Request - CNAB ERROR**<br/>Empty or corrupted file.<br/><small>Arquivo vazio ou corrompido.</small> |
| <a id="ACC000085"></a>`ACC000085` | 400 | **Bad Request - CNAB ERROR**<br/>CNAB version not supported yet.<br/><small>Versão de CNAB não suportada.</small> |
| <a id="ACC000086"></a>`ACC000086` | 400 | **Bad Request - CNAB ERROR**<br/>Could not find the CNAB type.<br/><small>Não foi possível identificar o tipo de arquivo CNAB enviado.</small> |
| <a id="ACC000088"></a>`ACC000088` | 400 | **Bad Request - CNAB ERROR**<br/>Registry line size incorrect.<br/><small>Registro com tamanho incorreto.</small> |
| <a id="ACC000089"></a>`ACC000089` | 400 | **Bad Request - CNAB ERROR**<br/>Could not determine Bank Code.<br/><small>Não foi possível determinar o código do banco operador detalhess: {details_br} cnab_filename: {cnab_filename} cnab_line: {cnab_line} cnab_inline_start_position: {cnab_inline_start_position} cnab_inline_end_position: {cnab_inline_end_position} cnab_inline_field: {cnab_inline_field} cnab_inline_field_type: {cnab_inline_field_type} cnab_inline_field_value: {cnab_inline_field_value}</small> |
| <a id="ACC000090"></a>`ACC000090` | 400 | **Bad Request - CNAB ERROR**<br/>Could not determine CNAB version.<br/><small>Não foi possível determinar a versão do CNAB.</small> |
| <a id="ACC000091"></a>`ACC000091` | 400 | **Bad Request - CNAB ERROR**<br/>Could not determine CNAB type (Remittance / Discharge).<br/><small>Não foi possível determinar o tipo do CNAB (Remessa / Retorno).</small> |
| <a id="ACC000092"></a>`ACC000092` | 400 | **Bad Request - CNAB ERROR**<br/>Could not set the field.<br/><small>Não foi possível ler o campo.</small> |
| <a id="ACC000093"></a>`ACC000093` | 400 | **Bad Request - CNAB ERROR**<br/>Max field size exceeded.<br/><small>Número máximo de dígitos excedido para o campo.</small> |
| <a id="ACC000094"></a>`ACC000094` | 400 | **Bad Request - CNAB ERROR**<br/>Tipo de valor incorreto.<br/><small>Value type incorrect.</small> |
| <a id="ACC000095"></a>`ACC000095` | 400 | **Bad Request - CNAB ERROR**<br/>Wrong number of decimal places.<br/><small>Número de casas decimais incorreto.</small> |
| <a id="ACC000096"></a>`ACC000096` | 400 | **Bad Request - CNAB ERROR**<br/>Wrong header record position in file.<br/><small>Registro Header colocado na posição incorreta.</small> |
| <a id="ACC000097"></a>`ACC000097` | 400 | **Bad Request - CNAB ERROR**<br/>Wrong cnab record sequence.<br/><small>Sequência de registros incorreta no arquivo.</small> |
| <a id="ACC000098"></a>`ACC000098` | 400 | **Bad Request - CNAB ERROR**<br/>Record type not supported.<br/><small>Tipo de registro não suportado.</small> |
| <a id="ACC000099"></a>`ACC000099` | 400 | **Bad Request - CNAB ERROR**<br/>Could not determine bank name.<br/><small>Não foi possível determinar o nome do banco.</small> |
| <a id="ACC000100"></a>`ACC000100` | 400 | **Bad Request**<br/>Unable to read CNAB file. Check file data for special characters at line {line} and position {position}<br/><small>Não foi possível ler o CNAB devido presença de caracteres especiais na linha {line} e posição {position} do arquivo.</small> |
| <a id="ACC000101"></a>`ACC000101` | 422 | **Unprocessable Entity**<br/>The field Identification of the Beneficiary Institution {beneficiary_code} on the registration lines (positions 021 to 037) is different from the beneficiary company identification {company_code} in the header (positions 027 to 046).<br/><small>O campo Identificação da Empresa Beneficiária {beneficiary_code} nas linhas de registro (posições 021 a 037) é diferente da identificação da empresa beneficiária {company_code} no cabeçalho (posições 027 a 046).</small> |
| <a id="ACC000102"></a>`ACC000102` | 400 | **Invalid FileName**<br/>Invalid filename ({cnab_filename}). Please do not use specials characters like '!,@,(,),$' .<br/><small>Nome de arquivo inválido ({cnab_filename}). Favor não utilizar caracteres especiais como '!,@,(,),$' .</small> |
| <a id="ACC000103"></a>`ACC000103` | 404 | **Not Found**<br/>Could not find financial institution with bank code: {code_number}<br/><small>Não foi possível encontrar a instituicao financeira com o codigo bancario {code_number}</small> |
| <a id="ACC000104"></a>`ACC000104` | 400 | **Bad Request**<br/>Total Percentage Split is greater than 100%<br/><small>Porcentagem total da divisão é maior que 100%</small> |
| <a id="ACC000105"></a>`ACC000105` | 400 | **Bad Request**<br/>Errors in batch transactions<br/><small>Erros nas transações em lote</small> |
| <a id="ACC000106"></a>`ACC000106` | 403 | **Forbidden**<br/>Account {account_key} is closed and cannot perform movement request<br/><small>Conta {account_key} está fechada e não pode realizar transação</small> |
| <a id="ACC000107"></a>`ACC000107` | 400 | **Bad Request**<br/>The account webhook to be changed was not informed<br/><small>Não foi informado a conta do webhook a ser alterado</small> |
| <a id="ACC000108"></a>`ACC000108` | 404 | **Not Found**<br/>No match for given schedule_category<br/><small>Nenhum resultado encontrado para a schedule_category informada</small> |
| <a id="ACC000109"></a>`ACC000109` | 400 | **Bad Request**<br/>The chosen scheduled movement date cannot happen outside a limit of 60 days from now.<br/><small>A data de agendamento escolhida não pode estar fora do intervalo de 60 dias futuros a partir de hoje.</small> |
| <a id="ACC000110"></a>`ACC000110` | 400 | **Bad Request**<br/>Requesting a scheduled chargeback is not an allowed operation.<br/><small>Solicitar uma devolução agendada de PIX não é uma operação permitida.</small> |
| <a id="ACC000111"></a>`ACC000111` | 400 | **Bad Request**<br/>Pix field {field} required<br/><small>Campo {field} necessário para o pix</small> |
| <a id="ACC000112"></a>`ACC000112` | 404 | **Not Found**<br/>An automatic_transfer not found for the given parameters<br/><small>A automatic_transfer não foi encontrada com os parâmetros fornecidos</small> |
| <a id="ACC000113"></a>`ACC000113` | 400 | **Bad Request**<br/>Unable to perform a transaction with a null transaction amount<br/><small>Não é possível realizar uma operação com um valor de transação nulo.</small> |
| <a id="ACC000114"></a>`ACC000114` | 400 | **Bad Request**<br/>Unable to perform a transaction with a transaction amount with more than 2 decimal places<br/><small>Não é possível realizar uma operação com um valor que tenha mais de duas casas decimais.</small> |
| <a id="ACC000115"></a>`ACC000115` | 400 | **Bad Request**<br/>Unable to deactivate the last credential from a person.<br/><small>Impossível deletar a ultima permissão de uma pessoa.</small> |
| <a id="ACC000116"></a>`ACC000116` | 404 | **Not Found**<br/>Ted account type not found for type: {type}.<br/><small>Tipo de conta ted não encontrado para tipo: {type}.</small> |
| <a id="ACC000117"></a>`ACC000117` | 409 | **Conflict**<br/>There's already an account destination with the same data.<br/><small>Já existe um destino de conta com os mesmos dados.</small> |
| <a id="ACC000118"></a>`ACC000118` | 404 | **Not Found**<br/>Account destination status not found.<br/><small>Status da conta de destino não foi encontrado.</small> |
| <a id="ACC000119"></a>`ACC000119` | 400 | **Bad Request**<br/>Account destination document number must be the same of the account owner.<br/><small>O número do documento de destino da conta deve ser o mesmo do proprietário da conta.</small> |
| <a id="ACC000120"></a>`ACC000120` | 400 | **Bad Request**<br/>prefixed amount is greater than available amount.<br/><small>valor pré fixado é superior ao valor disponível.</small> |
| <a id="ACC000121"></a>`ACC000121` | 400 | **Bad Request**<br/>Date format is invalid.It must be YYYY-mm-dd<br/><small>Formato da data está invalido. Este deve ser YYYY-mm-dd</small> |
| <a id="ACC000122"></a>`ACC000122` | 400 | **Bad Request**<br/>Name field cannot be longer than 50 characters<br/><small>Campo nome não pode ter mais de 50 caracteres</small> |
| <a id="ACC000123"></a>`ACC000123` | 400 | **Bad Request**<br/>Account balance cannot be greater than 0.<br/><small>Saldo remanescente nao pode ser maior que 0.</small> |
| <a id="ACC000124"></a>`ACC000124` | 400 | **Bad Request**<br/>Can't perform this action. There'are few unpaid fees<br/><small>Não é possível realizar essa ação. Há transações futuras que não foram pagas.</small> |
| <a id="ACC000125"></a>`ACC000125` | 400 | **Bad Request**<br/>Can't perform this action. There'are few unpaid bankslip fees<br/><small>Não é possível realizar essa ação. Há taxas de boleto que não foram pagas.</small> |
| <a id="ACC000126"></a>`ACC000126` | 400 | **Bad Request**<br/>There are accepted, registered or payment notice bank slips yet<br/><small>Ainda há boletos aceitos, registrados ou com aviso de pagamento</small> |
| <a id="ACC000127"></a>`ACC000127` | 500 | **Bad Request**<br/>Failed to create account cancelling term<br/><small>Falha ao criar termo de cancelamento de conta</small> |
| <a id="ACC000128"></a>`ACC000128` | 400 | **Bad Request**<br/>Pix unavailable in this moment. Please use TED.<br/><small>Pix indisponível no momento. Por favor utilizar a TED.</small> |
| <a id="ACC000129"></a>`ACC000129` | 400 | **Bad Request**<br/>{type} is not a valid balance type.<br/><small>{type} não é um tipo válido de extrato.</small> |
| <a id="ACC000130"></a>`ACC000130` | 400 | **Bad Request**<br/>System Account is not allowed to do that transaction<br/><small>Contas de sistema não são habilitadas para executar essa transação.</small> |
| <a id="ACC000131"></a>`ACC000131` | 400 | **Bad Request**<br/>Outgoing transfer must not have a target account<br/><small>Transações de saída não podem possuir uma conta destino</small> |
| <a id="ACC000132"></a>`ACC000132` | 400 | **Bad Request**<br/>Incoming transfer must not have a source account<br/><small>Transações de entrada não podem possuir uma conta origem</small> |
| <a id="ACC000133"></a>`ACC000133` | 401 | **Unauthorized**<br/>Invalid token<br/><small>Token inválido</small> |
| <a id="ACC000134"></a>`ACC000134` | 401 | **Unauthorized**<br/>Expired token<br/><small>Token Expirado</small> |
| <a id="ACC000135"></a>`ACC000135` | 400 | **Bad Request**<br/>Contact does not exist<br/><small>Contato nao existe</small> |
| <a id="ACC000136"></a>`ACC000136` | 400 | **Bad Request**<br/>Target account branch or number must not be 0.<br/><small>Agência ou número da conta de destino não podem ser 0.</small> |
| <a id="ACC000137"></a>`ACC000137` | 400 | **Bad Request**<br/>There is no pending movement correspondent to sent payload<br/><small>Não há nenhum pedido de movimentação correspondente à payload enviada</small> |
| <a id="ACC000138"></a>`ACC000138` | 400 | **Bad Request**<br/>Movement request has null movement type<br/><small>Movement request tem movement type nulo</small> |
| <a id="ACC000139"></a>`ACC000139` | 400 | **Bad Request**<br/>Movement request has invalid movement status: {old_movement_status}<br/><small>Movement request possui movement status inválido: {old_movement_status}</small> |
| <a id="ACC000140"></a>`ACC000140` | 400 | **Bad Request**<br/>Could not find movement approval for agent {selected_agent}<br/><small>Não foi possível encontrar movement approval para o agente {selected_agent}</small> |
| <a id="ACC000141"></a>`ACC000141` | 400 | **Bad Request**<br/>Movement request has already received feedback<br/><small>Movement request já recebeu um feedback</small> |
| <a id="ACC000142"></a>`ACC000142` | 400 | **Bad Request**<br/>Your account has no approver. Please, contact our support.<br/><small>Sua conta não possui aprovador. Por favor, contate nosso suporte.</small> |
| <a id="ACC000143"></a>`ACC000143` | 404 | **Not Found**<br/>Investment not found<br/><small>Investmento não foi encontrado.</small> |
| <a id="ACC000144"></a>`ACC000144` | 400 | **Bad Request**<br/>Accounts do not have proper investment relationship<br/><small>Contas não possuem relacionamento de investimento adequado</small> |
| <a id="ACC000145"></a>`ACC000145` | 400 | **Not Found**<br/>Invalid yield percentage amount<br/><small>Valor de procentagem de rendimento inválido.</small> |
| <a id="ACC000146"></a>`ACC000146` | 422 | **Unprocessable Entity**<br/>Account investment configuration already exists for this account<br/><small>Já existe uma configuração de investimento para esta conta</small> |
| <a id="ACC000147"></a>`ACC000147` | 422 | **Unprocessable Entity**<br/>Account has not a existing investment configuration linked<br/><small>A conta não tem uma configuração de investimento associada.</small> |
| <a id="ACC000148"></a>`ACC000148` | 422 | **Unprocessable Entity**<br/>Cannot setup a investment configuration to a closed account<br/><small>Não pode criar uma configuração de investimento em uma conta fechada</small> |
| <a id="ACC000149"></a>`ACC000149` | 422 | **Unprocessable Entity**<br/>There was a problem performing this withdraw. Please contact our support<br/><small>Houve um problema ao efetuar este saque. Por favor contate nosso suporte</small> |
| <a id="ACC000150"></a>`ACC000150` | 400 | **Bad Request**<br/>International messaging not allowed<br/><small>Envio de mensagens internacionais não permitido</small> |
| <a id="ACC000151"></a>`ACC000151` | 400 | **Bad Request**<br/>Operation not identified<br/><small>Operação não identificada</small> |
| <a id="ACC000152"></a>`ACC000152` | 400 | **Bad Request**<br/>Contact type {contact_type} not allowed<br/><small>Forma de contato por {contact_type} não permitida</small> |
| <a id="ACC000153"></a>`ACC000153` | 400 | **Bad Request**<br/>Incorrect or incomplete mobile number<br/><small>Número de celular incorreto ou incompleto</small> |
| <a id="ACC000154"></a>`ACC000154` | 404 | **Not Found**<br/>Professional Data not found<br/><small>Professional Data não encontrada</small> |
| <a id="ACC000155"></a>`ACC000155` | 400 | **Bad Request**<br/>Transaction {source_subtype} cannot be performed with given accounts<br/><small>Transação {source_subtype} não pode ser realizada com as contas informadas</small> |
| <a id="ACC000156"></a>`ACC000156` | 400 | **Bad Request**<br/>Transaction amount cannot be zero<br/><small>Valor de transação não deve ser zero</small> |
| <a id="ACC000157"></a>`ACC000157` | 404 | **Not Found**<br/>Investment Configuration not found<br/><small>Configuração de Investimento não encontrada</small> |
| <a id="ACC000158"></a>`ACC000158` | 400 | **Bad Request**<br/>Investment available amount not enough to perform withdraw<br/><small>Somatório de investimentos insuficiente para realizar a transação</small> |
| <a id="ACC000159"></a>`ACC000159` | 400 | **Bad Request**<br/>Invalid Investment Movement type<br/><small>Tipo de Movimentação de investimento inválida</small> |
| <a id="ACC000160"></a>`ACC000160` | 400 | **Bad Request**<br/>Account number {account_number} already in use<br/><small>Número de conta {account_number} já em uso</small> |
| <a id="ACC000161"></a>`ACC000161` | 400 | **Bad Request**<br/>Required investment deposit amount greater than allowed<br/><small>Depósito de investimento requerido maior que permitido</small> |
| <a id="ACC000162"></a>`ACC000162` | 400 | **Conflict**<br/>Update of investment_available_balance did not meet expectations. Expected: {expected}. Calculated: {calculated}<br/><small>Update de investment_available_balance não atendeu às espectativas. Esperado: {expected}. Calculado: {calculated}</small> |
| <a id="ACC000163"></a>`ACC000163` | 400 | **Conflict**<br/>Value {value} not allowed for attribute {attribute} in object {object_name}<br/><small>Valor {value} não permitido para atributo {attribute} no objeto {object_name}</small> |
| <a id="ACC000164"></a>`ACC000164` | 400 | **Bad Request**<br/>Date interval (date_from and date_to) must be provided to generate statement<br/><small>Intervalo de datas (date_from and date_to) deve ser fornecido para geração de extrato</small> |
| <a id="ACC000165"></a>`ACC000165` | 400 | **Bad Request**<br/>Date interval greater than allowed of {maximum_days}<br/><small>Intervalo de datas maior que o permitido de {maximum_days}</small> |
| <a id="ACC000166"></a>`ACC000166` | 400 | **Bad Request**<br/>Person_key must be provided<br/><small>Person_key deve ser fornecida</small> |
| <a id="ACC000167"></a>`ACC000167` | 400 | **Conflict**<br/>Discrepancy detected on available yield transfer<br/><small>Discrepância detectada em available yield transfer</small> |
| <a id="ACC000168"></a>`ACC000168` | 400 | **Bad Request**<br/>The agent document number is not linked to the company that owns the account to approve this request.<br/><small>O agent document number enviado não esta vinculado a empresa titular da conta para aprovar esta solicitação.</small> |
| <a id="ACC000169"></a>`ACC000169` | 400 | **Bad Request**<br/>External transactions cannot be reversed<br/><small>Transações externas não podem ser revertidas</small> |
| <a id="ACC000170"></a>`ACC000170` | 400 | **Bad Request**<br/>Reversal transaction already made<br/><small>Reversão de transação já realizada</small> |
| <a id="ACC000171"></a>`ACC000171` | 400 | **Bad Request**<br/>Subtype is not allowed to have transaction reversed<br/><small>Subtipo não pode ter transação revertida</small> |
| <a id="ACC000172"></a>`ACC000172` | 400 | **Bad Request**<br/>Account balance must have a maximum of 2 decimal places<br/><small>Balanço de conta deve ter no máximo 2 casas decimais</small> |
| <a id="ACC000173"></a>`ACC000173` | 400 | **Bad Request**<br/>Transaction account balance must be equal to account balance<br/><small>Balanço de conta da transação deve ser igual ao balanço de conta</small> |
| <a id="ACC000174"></a>`ACC000174` | 400 | **Bad Request**<br/>System accounts must be owned and requested by QITECH<br/><small>Contas de sistema devem ser requeridas e propeietárias da QITECH</small> |
| <a id="ACC000175"></a>`ACC000175` | 400 | **Bad Request**<br/>Account status {account_status} not allowed<br/><small>Status da conta {account_status} não permitido</small> |
| <a id="ACC000176"></a>`ACC000176` | 400 | **Transaction limit exceeded**<br/>The transactions within this date range exceeds the limit, please try again with a smaller date range!<br/><small>As transações nesse intervalo de data excedem o limite, tente novamente com um intervalo de data menor!</small> |
| <a id="ACC000177"></a>`ACC000177` | 400 | **Bad Request**<br/>The date range must be provided!<br/><small>Intervalo de datas deve ser fornecido!</small> |
| <a id="ACC000178"></a>`ACC000178` | 400 | **Bad Request**<br/>Person_key and account_key must be provided<br/><small>Person_key e account_key deve ser fornecida</small> |
| <a id="ACC000179"></a>`ACC000179` | 429 | **Conflict**<br/>The request_control_key {request_control_key} already exists<br/><small>A request_control_jey {request_control_key} já existe</small> |
| <a id="ACC000180"></a>`ACC000180` | 400 | **Bad Request**<br/>The owner_trading_name can only be sent by a legal person type<br/><small>O owner_trading_name só pode ser utilizado por uma pessoa jurídica</small> |
| <a id="ACC000181"></a>`ACC000181` | 404 | **Not found**<br/>Alias {alias_key} not found<br/><small>Alias {alias_key} não encontrado</small> |
| <a id="ACC000182"></a>`ACC000182` | 404 | **Alias Key Not found**<br/>The alias_key {alias_key} was not Found<br/><small>A alias_key {alias_key} não foi encontrada</small> |
| <a id="ACC000183"></a>`ACC000183` | 400 | **Wrong Pagination Query Parameter Set**<br/>If page_number was informed, the page_size should also be informed<br/><small>Se o page_number foi informado, o page_size deve ser informado tambem</small> |
| <a id="ACC000184"></a>`ACC000184` | 400 | **Wrong Datetime**<br/>The datetime contined in the string {datetime_string} is not in datetime-Zulu format<br/><small>A datetime contida na string {datetime_string} não está em formato datetime-Zulu</small> |
| <a id="ACC000185"></a>`ACC000185` | 403 | **Invalid Owner Person Key**<br/>The informed account_key {account_key} is not allowed to access this resource, because the SELECTED-AGENT key is not the same from the informed account<br/><small>A account_key informada {account_key} não tem permissão de acessar esse recurso, pois a SELECTED-AGENT key não é a mesma da account informada</small> |
| <a id="ACC000186"></a>`ACC000186` | 404 | **Request Control Key Not found**<br/>The informed request_control_key {request_control_key} has no original registered entry associated<br/><small>A request_control_key informada {request_control_key} não possui entrada original associada</small> |
| <a id="ACC000187"></a>`ACC000187` | 403 | **Forbidden Selected-Agent**<br/>The informed SELECTED-AGENT {selected_agent_key} is not allowed to access this resource<br/><small>O SELECTED-AGENT informado {selected_agent_key} não tem permissão de acessar esse recurso</small> |
| <a id="ACC000188"></a>`ACC000188` | 400 | **Invalid Indirect Participant Key**<br/>The informed Indirect Participant Key is invalid<br/><small>a Indirect Participant Key é invalida</small> |
| <a id="ACC000189"></a>`ACC000189` | 400 | **Missing Query Parameters**<br/>The necessery parameters for the query are not present<br/><small>Os paramentros necessarios para a query não estão presentes</small> |
| <a id="ACC000190"></a>`ACC000190` | 404 | **Account Key not Found**<br/>The Account key related with the presented parameters was not found<br/><small>A Account Key relacionada com os parametros apresentados não foi encontrada</small> |
| <a id="ACC000191"></a>`ACC000191` | 422 | **Repeated Request Informations**<br/>The same combination of account_number, account_branch and ispb was already previusly done in another Alias creation requisition<br/><small>A mesma combinação de account_number, account_branch e ispb ja foi previamente registrado em outra requisição de criação de Alias</small> |
| <a id="ACC000192"></a>`ACC000192` | 400 | **Bad Request**<br/>Account with floating rebate configuration!<br/><small>Conta com configuração de rebate de floating ativo!</small> |
| <a id="ACC000193"></a>`ACC000193` | 400 | **Bad Request**<br/>There was a problem performing verification in floating rebate configuration<br/><small>Problema durante a verificação de configuração de rebate de floating!</small> |
| <a id="ACC000194"></a>`ACC000194` | 400 | **Bad Request**<br/>Document number {document_number} is not valid<br/><small>Número de documento {document_number} não é válido</small> |
| <a id="ACC000195"></a>`ACC000195` | 400 | **Bad Request**<br/>Document number {document_number} sent does not match the person_type {person_type}<br/><small>Número de documento {document_number} não corresponde ao tipo de pessoa {person_type}</small> |
| <a id="ACC000196"></a>`ACC000196` | 400 | **Bad Request**<br/>The account is bonded in DDA.<br/><small>A conta está vinculada ao DDA.</small> |
| <a id="ACC000197"></a>`ACC000197` | 400 | **Bad Request**<br/>Selected user agent must be provided.<br/><small>Selected user agent deve ser fornecido.</small> |
| <a id="ACC000198"></a>`ACC000198` | 400 | **Bad Request**<br/>Unable to change {contact_info} using contact type {contact_type}<br/><small>Não é possível mudar o contato utilizando o contact type {contact_type}</small> |
| <a id="ACC000199"></a>`ACC000199` | 400 | **Bad Request**<br/>Billing configuration data can not be None<br/><small>Dados de configuração de cobrança não pode ser nula</small> |
| <a id="ACC000200"></a>`ACC000200` | 400 | **Invalid reference year**<br/>Invalid reference year.<br/><small>Ano de referência inválido.</small> |
| <a id="ACC000201"></a>`ACC000201` | 403 | **Invalid Destination**<br/>Target account is not a valid Destination<br/><small>Conta alvo não é um destino válido</small> |
| <a id="ACC000202"></a>`ACC000202` | 400 | **Invalid permission**<br/>Given requester has no permission to the account<br/><small>Requisitante enviado não possui permissão na conta</small> |
| <a id="ACC000203"></a>`ACC000203` | 400 | **Invalid permission**<br/>Given approver has no permission to the account<br/><small>Aprovador enviado não possui permissão na conta</small> |
| <a id="ACC000204"></a>`ACC000204` | 400 | **Mandatory parameters missing**<br/>Query parameters requester_person_key and approver_person_key must be sent<br/><small>Parâmetros de query requester_person_key e approver_person_key são obrigatórios</small> |
| <a id="ACC000205"></a>`ACC000205` | 400 | **Conflicting parameters**<br/>Send only a document_number or a person_key<br/><small>Envie apenas um document_number ou uma person_key</small> |
| <a id="ACC000206"></a>`ACC000206` | 400 | **Bad Request**<br/>Natural person account does not have allowed users.<br/><small>Conta de pessoa física não possui usuários autorizados.</small> |
| <a id="ACC000207"></a>`ACC000207` | 400 | **Bad Request**<br/>Transaction amount must be greater than 0.<br/><small>Valor da transação deve ser maior que 0.</small> |
| <a id="ACC000208"></a>`ACC000208` | 404 | **Account not found**<br/>Account not found.<br/><small>Conta não encontrada.</small> |
| <a id="ACC000209"></a>`ACC000209` | 405 | **Method not allowed**<br/>you are not allowed to call this method.<br/><small>Você não tem permissão para este método.</small> |
| <a id="ACC000210"></a>`ACC000210` | 403 | **Forbidden**<br/>Escrow account are not allowed to call this method.<br/><small>Método não peermitido para contas escrow.</small> |
| <a id="ACC000211"></a>`ACC000211` | 409 | **Conflict**<br/>Duplicated request control key {request_control_key}.<br/><small>Entrada duplicada para request control key {request_control_key}.</small> |
| <a id="ACC000212"></a>`ACC000212` | 400 | **Bad Request**<br/>Agent document number must be provided.<br/><small>Documento do agente deve ser fornecido.</small> |
| <a id="ACC000213"></a>`ACC000213` | 400 | **Bad Request**<br/>Invalid uuid format.<br/><small>UUID no formato inválido.</small> |
| <a id="ACC000214"></a>`ACC000214` | 400 | **Bad Request**<br/>Invalid page size.<br/><small>Tamanho da página inválido.</small> |
| <a id="ACC000215"></a>`ACC000215` | 400 | **Bad Request**<br/>Invalid format for field. It must be a string comprised of only digits<br/><small>Formato inválido para campo. Deve ser uma string compostas por apenas digitos</small> |
| <a id="ACC000216"></a>`ACC000216` | 400 | **Bad Request**<br/>Open Pix Schedules for this account detected<br/><small>Agendamentos de pix em aberto detectados para esta conta</small> |
| <a id="ACC000217"></a>`ACC000217` | 400 | **Bad Request**<br/>Can't perform peer to peer with the same target and source account<br/><small>Não é possível realizar transação de ponta a ponta com mesma origem e destino</small> |
| <a id="ACC000218"></a>`ACC000218` | 400 | **Automatic Transfer External Transaction Error**<br/>An error occurred while performing automatic transfer transaction<br/><small>Um erro ocorreu durante tentativa de realizar transferência automática</small> |
| <a id="ACC000219"></a>`ACC000219` | 403 | **Requester not allowed to perform this action**<br/>Requester not allowed to create destination<br/><small>Requester não autorizado a criar conta destino</small> |
| <a id="ACC000220"></a>`ACC000220` | 400 | **Max attempts for automatic transfer reached**<br/>Maximum number of failed attempts for automatic transfer reached<br/><small>Número máximo de tentativas falhas de transferências atingida</small> |
| <a id="ACC000221"></a>`ACC000221` | 404 | **Not Found**<br/>Financial institution branch not found<br/><small>Filial da instituição financeira não encontrada</small> |
| <a id="ACC000222"></a>`ACC000222` | 400 | **Bad Request**<br/>Automatic transfer to the same account as source<br/><small>Transferência automática para a mesma conta que de origem.</small> |
| <a id="ACC000223"></a>`ACC000223` | 409 | **Conflict**<br/>Account with number {account_number} already exists<br/><small>Conta com número {account_number} já existe</small> |
| <a id="ACC000224"></a>`ACC000224` | 400 | **Bad Request**<br/>Source and target accounts must be different<br/><small>Contas de origem e destino devem ser diferentes</small> |

### ACR — Account Request

47 errors

| Code | HTTP | Message |
|-|-|-|
| <a id="ACR000001"></a>`ACR000001` | 404 | **Account Request Not Found**<br/>Account Request not found for the given parameters<br/><small>Solicitação de conta não encontrada para os parâmetros dados.</small> |
| <a id="ACR000002"></a>`ACR000002` | 404 | **Account Request Not Found**<br/>Account Request not found for the given key {account_request_key}.<br/><small>Solicitação de conta não encontrada para a seguinte chave {account_request_key}.</small> |
| <a id="ACR000003"></a>`ACR000003` | 404 | **Proposal Not Found**<br/>Proposal not found.<br/><small>Proposta não encontrada.</small> |
| <a id="ACR000004"></a>`ACR000004` | 400 | **Bad Request**<br/>This account don't have valid credentials to this proposal.<br/><small>Esta conta não tem credenciais válidas para esta proposta.</small> |
| <a id="ACR000005"></a>`ACR000005` | 400 | **Bad Request**<br/>Use PUT account_request/{account_request_key} |
| <a id="ACR000006"></a>`ACR000006` | 400 | **Account Request Error**<br/>Account Request is not pending master approval<br/><small>Pedido de conta não está pendente de aprovação master</small> |
| <a id="ACR000007"></a>`ACR000007` | 400 | **Bad Request**<br/>Use PATCH /account/{account_key} |
| <a id="ACR000008"></a>`ACR000008` | 403 | **Unauthorized Agent**<br/>This agent can not perform this action<br/><small>Este agente não pode realizar esta ação</small> |
| <a id="ACR000009"></a>`ACR000009` | 400 | **Bad Request**<br/>Requester key needed!<br/><small>Requester key necessária!</small> |
| <a id="ACR000010"></a>`ACR000010` | 400 | **Bad Request**<br/>Related Party Owner needed!<br/><small>Related Party Owner necessário!</small> |
| <a id="ACR000011"></a>`ACR000011` | 400 | **Proposal Error**<br/>Proposal Isn't Pending Administrator Approval!<br/><small>Proposta não está pendente de aprovação do administrador!</small> |
| <a id="ACR000012"></a>`ACR000012` | 400 | **Proposal Update Error**<br/>Update Error<br/><small>Erro no update</small> |
| <a id="ACR000013"></a>`ACR000013` | 400 | **Bad Request**<br/>Invalid Action!<br/><small>Ação inválida!</small> |
| <a id="ACR000014"></a>`ACR000014` | 400 | **Bad Request**<br/>Rejection Reason Needed!<br/><small>Necessário uma razão para a rejeição!</small> |
| <a id="ACR000015"></a>`ACR000015` | 400 | **Fee Error**<br/>Fee value can not be negative!<br/><small>O valor de Fee não pode ser negativo!</small> |
| <a id="ACR000016"></a>`ACR000016` | 400 | **Fee Error**<br/>Ted fixed amount fee value can not be negative!<br/><small>O valor de taxa fixa de TED não pode ser negativo!</small> |
| <a id="ACR000017"></a>`ACR000017` | 400 | **Fee Error**<br/>Ted percentage fee value can not be negative!<br/><small>O valor de taxa percentual de TED não pode ser negativo!</small> |
| <a id="ACR000018"></a>`ACR000018` | 400 | **Proposal Error**<br/>Proposal Isn't Pending Document Signature!<br/><small>A proposta não está com assinatura do documento pendente!</small> |
| <a id="ACR000019"></a>`ACR000019` | 400 | **Proposal Error**<br/>Proposal Isn't Pending User Agreement!<br/><small>A proposta não está com contrato de usuário pendente!</small> |
| <a id="ACR000020"></a>`ACR000020` | 400 | **Proposal Error**<br/>Invalid Proposal Status!<br/><small>Status de proposta inválido!</small> |
| <a id="ACR000021"></a>`ACR000021` | 400 | **Bad Request**<br/>Automatic transfer rule does not follow rule template: {message}<br/><small>A regra de transferência automática não segue o modelo de regra: {message}</small> |
| <a id="ACR000022"></a>`ACR000022` | 422 | **Unprocessable Entity**<br/>Proposal requester has incomplete configuration in billing system<br/><small>Solicitante da proposta possui configuração incompleta no sistema de faturamento</small> |
| <a id="ACR000023"></a>`ACR000023` | 400 | **Bad Request**<br/>Invalid Document Number {document_number} for {name}.<br/><small>Documento inválido {document_number} para {name}.</small> |
| <a id="ACR000024"></a>`ACR000024` | 400 | **Bad Request**<br/>Use POST account_request/{account_request_key}/generate_document |
| <a id="ACR000025"></a>`ACR000025` | 400 | **Bad Request**<br/>Proposal status must be pending to get updated.<br/><small>O status da proposta deve estar pendente para ser atualizado.</small> |
| <a id="ACR000026"></a>`ACR000026` | 400 | **Bad Request**<br/>Could not create destination due inexistent financial code numbers: {codes_list}<br/><small>Não foi possível criar um destino devido a um código de instituição inexistent: {codes_list}</small> |
| <a id="ACR000027"></a>`ACR000027` | 404 | **Not Found**<br/>Requester email not found.<br/><small>Email do solicitante não foi encontrado.</small> |
| <a id="ACR000028"></a>`ACR000028` | 400 | **Bad Request**<br/>An operation reason is required to register fees for bankslip products<br/><small>Motivo da transferência é obrigatório para cadastrar tarifas para operações de boleto.</small> |
| <a id="ACR000029"></a>`ACR000029` | 400 | **Bad Request**<br/>A package value of PIX operations to not be charged fees is required<br/><small>Um valor para o pacote de operações PIX que não serão cobradas tarifas é obrigatório.</small> |
| <a id="ACR000030"></a>`ACR000030` | 400 | **Bad Request**<br/>Unable to process a repeated fee_configuration in the payload<br/><small>Não é possível processar uma configuração de tarifa repetida no payload</small> |
| <a id="ACR000031"></a>`ACR000031` | 400 | **Bad Request**<br/>Account type is not escrow.<br/><small>Tipo de conta não é escrow.</small> |
| <a id="ACR000032"></a>`ACR000032` | 400 | **Bad Request**<br/>Proposal {proposal_key} Account type is not checking.<br/><small>Proposal {proposal_key} Tipo de conta não é checking.</small> |
| <a id="ACR000033"></a>`ACR000033` | 400 | **Bad Request**<br/>Name {name} has invalid characters.<br/><small>O nome {name} contém caractéres inválidos. Aceitos apenas caractéres alfanuméricos e os simbolos: . / & - ’</small> |
| <a id="ACR000034"></a>`ACR000034` | 400 | **Bad Request**<br/>It is not allowed to change account default billing configuration data.<br/><small>Não é permitido alterar as configurações de cobrança de tarifas desta conta.</small> |
| <a id="ACR000035"></a>`ACR000035` | 400 | **Bad Request**<br/>Account maintenance monthly fee value cannot be negative!<br/><small>O valor da tarifa mensal de manutenção de conta não pode ser negativo!</small> |
| <a id="ACR000036"></a>`ACR000036` | 400 | **Bad Request**<br/>At least '1' fee configuration is required for account_maintenance billing configuration data in the payload<br/><small>É necessária ao menos uma configuração de tarifa mensal de conta nos dados de 'billing_configuration_data' no payload</small> |
| <a id="ACR000037"></a>`ACR000037` | 400 | **Bad Request**<br/>'billing_account_key' cannot be null<br/><small>'billing_account_key' não pode ser nula</small> |
| <a id="ACR000038"></a>`ACR000038` | 400 | **Bad Request**<br/>Proposal with status pending operation issue cannot be signed<br/><small>Proposta com status de operação pendente de emissão não pode ser assinada</small> |
| <a id="ACR000039"></a>`ACR000039` | 400 | **Bad Request**<br/>Email is required for billing configurations paid via bank-slip<br/><small>Email É obrigatorio para configurações de tarifas pagas via boleto</small> |
| <a id="ACR000040"></a>`ACR000040` | 403 | **Forbidden**<br/>This user does not have permission to request account<br/><small>Este usuário não tem permissão para requisitar conta</small> |
| <a id="ACR000041"></a>`ACR000041` | 404 | **Account request not found**<br/>Account request not found for {account_request_key}<br/><small>Requisição de abertura de conta não encontrada para {account_request_key}</small> |
| <a id="ACR000042"></a>`ACR000042` | 400 | **Account request in wrong status**<br/>Account request in wrong status for conclusion<br/><small>Requisição de abertura de conta com status inválido para conclusão</small> |
| <a id="ACR000043"></a>`ACR000043` | 400 | **Account request is pending kyc analysis**<br/>Account request is pending kyc analysis<br/><small>Requisição de abertura de conta pendente de análise KYC</small> |
| <a id="ACR000044"></a>`ACR000044` | 400 | **Conflictingly ispb and code number**<br/>Conflictingly ISPB and financial_institution_code<br/><small>ISPB e financial_institution_code conflitantes</small> |
| <a id="ACR000045"></a>`ACR000045` | 404 | **ISPB not found**<br/>ISB not found<br/><small>ISPB não encontrado</small> |
| <a id="ACR000046"></a>`ACR000046` | 404 | **Account Not Found**<br/>Account not found.<br/><small>Conta não encontrada.</small> |
| <a id="ACR000047"></a>`ACR000047` | 403 | **Forbidden**<br/>Person is not requester of this account.<br/><small>Agente não é solicitante da conta.</small> |

### BLP — Bank Slips

191 errors

| Code | HTTP | Message |
|-|-|-|
| <a id="BLP000001"></a>`BLP000001` | 400 | **Bad Request**<br/>Invalid Registration Institution {registration_institution_enumerator}<br/><small>Instituição registradora inválida {registration_institution_enumerator}</small> |
| <a id="BLP000002"></a>`BLP000002` | 404 | **Not Found**<br/>Cannot generate empty file<br/><small>Não é possível gerar arquivo vazio</small> |
| <a id="BLP000003"></a>`BLP000003` | 400 | **Bad Request**<br/>Use POST /cnab/{action_type} |
| <a id="BLP000004"></a>`BLP000004` | 404 | **Not Found**<br/>Bank Slip not found.<br/><small>Boleto não encontrado.</small> |
| <a id="BLP000005"></a>`BLP000005` | 400 | **Bad Request**<br/>Use GET /bank_slip/{bank_slip_key} or /bank_slip/person/{person_key}<br/><small>Use GET /bank_slip/{bank_slip_key} ou /bank_slip/person/{person_key}</small> |
| <a id="BLP000006"></a>`BLP000006` | 400 | **Bad Request**<br/>Request needs one of the following parameters: requester_profile_code, beneficiary_key<br/><small>A request precisa de um dos seguintes parâmetros:  requester_profile_code, beneficiary_key</small> |
| <a id="BLP000007"></a>`BLP000007` | 400 | **Bad Request**<br/>Missing mandatory parameter: content_type<br/><small>Parâmetro obrigatório ausente: content_type</small> |
| <a id="BLP000008"></a>`BLP000008` | 400 | **Bad Request**<br/>Invalid content_type, try one of: {valid_content_types}<br/><small>content_type inválido, tente um dos seguintes: {valid_content_types}</small> |
| <a id="BLP000009"></a>`BLP000009` | 400 | **Bad Request**<br/>Expense already paid<br/><small>Despesa já paga</small> |
| <a id="BLP000010"></a>`BLP000010` | 400 | **Bad Request**<br/>Please set the expense to settle<br/><small>Defina a despesa para liquidar</small> |
| <a id="BLP000011"></a>`BLP000011` | 400 | **Bad Request**<br/>Missing mandatory parameter: beneficiary_key<br/><small>Parâmetro obrigatório ausente: beneficiary_key</small> |
| <a id="BLP000012"></a>`BLP000012` | 400 | **Bad Request**<br/>Missing mandatory parameter: digitable_line<br/><small>Parâmetro obrigatório ausente: digitable_line</small> |
| <a id="BLP000013"></a>`BLP000013` | 400 | **Bad Request**<br/>Please set the subject_account_key to settle<br/><small>Defina subject_account_key para liquidar</small> |
| <a id="BLP000014"></a>`BLP000014` | 400 | **Bad Request**<br/>Impossible to schedule or execute payment: entry already exists in database with {existing_payment_status} status.<br/><small>Já existe um boleto com o status {status_br}.</small> |
| <a id="BLP000015"></a>`BLP000015` | 400 | **Bad Request**<br/>Impossible to schedule payment after expiration date.<br/><small>Impossível agendar pagamento após data de vencimento.</small> |
| <a id="BLP000016"></a>`BLP000016` | 400 | **Bad Request**<br/>Impossible to execute payment after valid time frame.<br/><small>Impossível executar o pagamento para o período desejado.</small> |
| <a id="BLP000017"></a>`BLP000017` | 400 | **Bad Request**<br/>Impossible to execute or schedule payments with a total amount greater than 249,999.99<br/><small>Impossível executar ou agendar pagamentos com um valor total superior a 249.999,99</small> |
| <a id="BLP000018"></a>`BLP000018` | 400 | **Bad Request**<br/>Invalid payment calculation! Calculation model: {calculation_model}; Calculation date: {calculation_date}<br/><small>Cálculo de pagamento inválido! Modelo de cálculo: {calculation_model}; Data do cálculo: {calculation_date}</small> |
| <a id="BLP000019"></a>`BLP000019` | 404 | **Not Found**<br/>Payment entry not found for key {payment_key}.<br/><small>Pagamento não encontrada para a chave {payment_key}.</small> |
| <a id="BLP000020"></a>`BLP000020` | 400 | **Bad Request**<br/>Impossible to execute payment for payment_key {payment_key}. Payment status is not 'scheduled'.<br/><small>Impossível executar o pagamento para a chave de pagamento {payment_key}. Seu status é diferente de 'agendado'.</small> |
| <a id="BLP000021"></a>`BLP000021` | 400 | **Bad Request**<br/>Invalid payment: scheduled payment date is not today for key {payment_key}.<br/><small>Pagamento inválido: a data agendada do pagamento {payment_key} não é hoje.</small> |
| <a id="BLP000022"></a>`BLP000022` | 400 | **Bad Request**<br/>Payment date has to be from today onwards.<br/><small>A data do pagamento deve ser a partir de hoje.</small> |
| <a id="BLP000023"></a>`BLP000023` | 400 | **Bad Request**<br/>Payment date has to be a workday.<br/><small>A data do pagamento deve ser um dia útil.</small> |
| <a id="BLP000024"></a>`BLP000024` | 423 | **Locked**<br/>Operation window closed. System available from {opening_time} to {closing_time}<br/><small>Operação encerrada. Sistema disponível de {opening_time} a {closing_time}</small> |
| <a id="BLP000025"></a>`BLP000025` | 400 | **Bad Request**<br/>Missing mandatory parameter: {param}<br/><small>Parâmetro obrigatório ausente: {param}</small> |
| <a id="BLP000026"></a>`BLP000026` | 400 | **Bad Request**<br/>It's only possible to search for scheduled payments with the following status: {valid_payment_status_set}.<br/><small>Só é possível procurar pagamentos agendados com o seguinte status: {valid_payment_status_set}.</small> |
| <a id="BLP000027"></a>`BLP000027` | 400 | **Bad Request**<br/>It's only possible to change scheduled payment to the following status: {valid_payment_status_set}.<br/><small>Só é possível alterar o pagamento agendado para o seguinte status: {valid_payment_status_set}.</small> |
| <a id="BLP000028"></a>`BLP000028` | 400 | **Bad Request**<br/>Payment is not scheduled. Current payment status: {current_payment_status}.<br/><small>O pagamento não está agendado. Status atual do pagamento: {current_payment_status}.</small> |
| <a id="BLP000029"></a>`BLP000029` | 400 | **Bad Request**<br/>Use GET /bank_slip/{bank_slip_key}/2-way |
| <a id="BLP000030"></a>`BLP000030` | 404 | **Not Found**<br/>Bank Slip beneficiary account not found.<br/><small>Conta do beneficiário do boleto não encontrada.</small> |
| <a id="BLP000031"></a>`BLP000031` | 404 | **Not Found**<br/>Bank Slip beneficiary not found.<br/><small>Beneficiário do boleto não encontrado.</small> |
| <a id="BLP000032"></a>`BLP000032` | 400 | **Bad Request**<br/>This settlement is already paid<br/><small>Este acordo já foi pago</small> |
| <a id="BLP000033"></a>`BLP000033` | 400 | **Bad Request**<br/>Use POST /cnab/{action_type} |
| <a id="BLP000034"></a>`BLP000034` | 400 | **Bad Request**<br/>Invalid CNAB Type<br/><small>Tipo CNAB inválido</small> |
| <a id="BLP000035"></a>`BLP000035` | 400 | **Bad Request**<br/>Use GET /cnab_file/{person_key}/{cnab_type} |
| <a id="BLP000036"></a>`BLP000036` | 404 | **Not Found**<br/>There is no CNAB File with the specified cnab_key.<br/><small>Não há um arquivo CNAB para a cnab_key especificada.</small> |
| <a id="BLP000037"></a>`BLP000037` | 400 | **Bad Request**<br/>Requester Profile Code Needed<br/><small>Código da carteira necessário</small> |
| <a id="BLP000038"></a>`BLP000038` | 404 | **Not Found**<br/>Requester Profile not found for the given requester profile code<br/><small>Carteira não encontrada para o código da carteira fornecido</small> |
| <a id="BLP000039"></a>`BLP000039` | 404 | **Not Found**<br/>Occurrences for submission not found<br/><small>Ocorrências para envio não encontradas</small> |
| <a id="BLP000040"></a>`BLP000040` | 404 | **Not Found**<br/>No Occurrence found for the given key.<br/><small>Ocorrências para envio não encontradas para a chave fornecida</small> |
| <a id="BLP000041"></a>`BLP000041` | 400 | **Bad Request**<br/>Use GET /cnab_temporary/{remittance_key} |
| <a id="BLP000042"></a>`BLP000042` | 400 | **Bad Request**<br/>Action Type not allowed, use edit or submit<br/><small>Tipo de ação não permitido, use editar ou enviar</small> |
| <a id="BLP000043"></a>`BLP000043` | 400 | **Bad Request**<br/>Use PATCH /cnab_temporary/{remittance_key}/{action_type} |
| <a id="BLP000044"></a>`BLP000044` | 423 | **Locked**<br/>Discharge generation can not be performed on holidays<br/><small>A geração de retorno não pode ser realizada nos feriados</small> |
| <a id="BLP000045"></a>`BLP000045` | 423 | **Locked**<br/>Discharge generation not ready to continue<br/><small>Geração de retorno não está pronta para continuar</small> |
| <a id="BLP000046"></a>`BLP000046` | 400 | **Bad Request**<br/>Use PUT /expense_configuration/{beneficiary_account_key} |
| <a id="BLP000047"></a>`BLP000047` | 400 | **Bad Request**<br/>No company_key found<br/><small>Nenhuma company_key encontrada</small> |
| <a id="BLP000048"></a>`BLP000048` | 400 | **Bad Request**<br/>Header selected-agent is needed.<br/><small>O campo selected-agent do cabeçalho é necessário.</small> |
| <a id="BLP000049"></a>`BLP000049` | 400 | **Bad Request**<br/>Header selected-agent is needed.<br/><small>O campo selected-agent do cabeçalho é necessário.</small> |
| <a id="BLP000050"></a>`BLP000050` | 400 | **Bad Request**<br/>Found record without our_number<br/><small>Registro encontrado sem o nosso número</small> |
| <a id="BLP000051"></a>`BLP000051` | 400 | **Bad Request**<br/>Remitter can't be a registration institution in case of REM files.<br/><small>O remetente não pode ser uma instituição de registro no caso de arquivos REM.</small> |
| <a id="BLP000052"></a>`BLP000052` | 404 | **Not Found**<br/>Bank Slip for notary office payment not found<br/><small>Boleto para pagamento em cartório não encontrado</small> |
| <a id="BLP000053"></a>`BLP000053` | 400 | **Bad Request**<br/>File type {file_type} not implemented.<br/><small>Tipo de arquivo {file_type} não implementado.</small> |
| <a id="BLP000055"></a>`BLP000055` | 404 | **Not Found**<br/>Bank SLip for protest not found<br/><small>Nenhum boleto para protesto encontrado</small> |
| <a id="BLP000056"></a>`BLP000056` | 400 | **Bad Request**<br/>Use POST /requester_configuration |
| <a id="BLP000057"></a>`BLP000057` | 404 | **Not Found**<br/>Requester Profile not found.<br/><small>Carteira não encontrada.</small> |
| <a id="BLP000058"></a>`BLP000058` | 400 | **Bad Request**<br/>Missing mandatory parameter: person_key<br/><small>Parâmetro obrigatório ausente: person_key</small> |
| <a id="BLP000059"></a>`BLP000059` | 400 | **Bad Request**<br/>Use POST /requester_profile/{requester_profile_key} |
| <a id="BLP000060"></a>`BLP000060` | 404 | **Not Found**<br/>Account not found for person key {person_key}.<br/><small>Conta não encontrada para a chave {person_key}.</small> |
| <a id="BLP000061"></a>`BLP000061` | 400 | **Bad Request**<br/>Range already used<br/><small>Intervalo já usado</small> |
| <a id="BLP000062"></a>`BLP000062` | 400 | **Bad Request**<br/>Use POST /requester_profile_range |
| <a id="BLP000064"></a>`BLP000064` | 400 | **Bad Request**<br/>Missing Registration Institution config<br/><small>Falta REGISTRATION_INSTITUTION_CONFIG</small> |
| <a id="BLP000065"></a>`BLP000065` | 422 | **Pub Sub Ocurrence Error**<br/>Invalid CNAB file occurrence order.<br/><small>Ordem de ocorrência de arquivo CNAB inválida.</small> |
| <a id="BLP000066"></a>`BLP000066` | 400 | **Bad Request**<br/>Occurrence type {occurrence_type} not supported<br/><small>Tipo de ocorrência {occurrence_type} não suportado</small> |
| <a id="BLP000067"></a>`BLP000067` | 400 | **Bad Request**<br/>Errors found on return CNAB File: {occurrence_sequence}<br/><small>Erros encontrados no arquivo CNAB de retorno: {occurrence_sequence}</small> |
| <a id="BLP000068"></a>`BLP000068` | 400 | **Bad Request**<br/>File: {filename}. Error: {error}<br/><small>Arquivo: {filename}. Erro: {error}</small> |
| <a id="BLP000069"></a>`BLP000069` | 400 | **Bad Request - CNAB ERROR**<br/>Empty or corrupted file.<br/><small>Arquivo vazio ou corrompido.</small> |
| <a id="BLP000070"></a>`BLP000070` | 400 | **Bad Request - CNAB ERROR**<br/>Could not find the CNAB type.<br/><small>Não foi possível identificar o tipo de arquivo CNAB enviado.</small> |
| <a id="BLP000071"></a>`BLP000071` | 400 | **Bad Request - CNAB ERROR**<br/>CNAB version not supported yet.<br/><small>Versão de CNAB não suportada.</small> |
| <a id="BLP000072"></a>`BLP000072` | 400 | **Bad Request - CNAB ERROR**<br/>Registry line size incorrect.<br/><small>Linha de registro com tamanho incorreto.</small> |
| <a id="BLP000073"></a>`BLP000073` | 400 | **Bad Request - CNAB ERROR**<br/>Could not determine Bank Code.<br/><small>Não foi possível determinar o código do banco operador</small> |
| <a id="BLP000074"></a>`BLP000074` | 400 | **Bad Request - CNAB ERROR**<br/>Could not determine CNAB version.<br/><small>Não foi possível determinar a versão do CNAB.</small> |
| <a id="BLP000075"></a>`BLP000075` | 400 | **Bad Request - CNAB ERROR**<br/>Could not determine CNAB type (Remittance / Discharge).<br/><small>Não foi possível determinar o tipo do CNAB (Remessa / Retorno).</small> |
| <a id="BLP000076"></a>`BLP000076` | 400 | **Bad Request - CNAB ERROR**<br/>Invalid CNAB type, must be Remittance(1) or Discharge(2).<br/><small>Tipo de arquivo incorreto, deve ser Remessa(1) ou Retorno(2).</small> |
| <a id="BLP000077"></a>`BLP000077` | 400 | **Bad Request - CNAB ERROR**<br/>CNAB translator not implemented yet for the type sent.<br/><small>Tradutor de CNAB não implementado para o tipo enviado.</small> |
| <a id="BLP000078"></a>`BLP000078` | 400 | **Bad Request - CNAB ERROR**<br/>Could not set the field.<br/><small>Não foi possível ler o campo.</small> |
| <a id="BLP000079"></a>`BLP000079` | 400 | **Bad Request - CNAB ERROR**<br/>Max field size exceeded.<br/><small>Número máximo de dígitos excedido para o campo.</small> |
| <a id="BLP000080"></a>`BLP000080` | 400 | **Bad Request - CNAB ERROR**<br/>Value type incorrect.<br/><small>Tipo de valor incorreto.</small> |
| <a id="BLP000081"></a>`BLP000081` | 400 | **Bad Request - CNAB ERROR**<br/>Wrong number of decimal places.<br/><small>Número de casas decimais incorreto.</small> |
| <a id="BLP000082"></a>`BLP000082` | 400 | **Bad Request - CNAB ERROR**<br/>Wrong header record position in file.<br/><small>Linha de Registro Header colocado na posição incorreta.</small> |
| <a id="BLP000083"></a>`BLP000083` | 400 | **Bad Request - CNAB ERROR**<br/>Wrong cnab record sequence.<br/><small>Sequência de registros incorreta no arquivo.</small> |
| <a id="BLP000084"></a>`BLP000084` | 400 | **Bad Request - CNAB ERROR**<br/>Wrong trailer record position in file.<br/><small>Linha de Registro trailer colocado na posição incorreta.</small> |
| <a id="BLP000085"></a>`BLP000085` | 400 | **Bad Request - CNAB ERROR**<br/>Record type not supported.<br/><small>Tipo de registro não suportado.</small> |
| <a id="BLP000086"></a>`BLP000086` | 400 | **Bad Request - CNAB ERROR**<br/>Asset type not supported.<br/><small>Espécie de Título não suportada.</small> |
| <a id="BLP000087"></a>`BLP000087` | 400 | **Bad Request - CNAB ERROR**<br/>Occurrence not supported.<br/><small>Tipo de ocorrência não suportada.</small> |
| <a id="BLP000088"></a>`BLP000088` | 400 | **Bad Request - CNAB ERROR**<br/>Remittance sequence number invalid or in use.<br/><small>Número sequencial de remessa inválido ou em uso.</small> |
| <a id="BLP000089"></a>`BLP000089` | 400 | **Bad Request - CNAB ERROR**<br/>Invalid Remittance filename.<br/><small>Nome do arquivo de remessa inválido.</small> |
| <a id="BLP000090"></a>`BLP000090` | 400 | **Bad Request - CNAB ERROR**<br/>Invalid record sequence or not sequential.<br/><small>Número sequencial de registro inválido ou não sequencial.</small> |
| <a id="BLP000091"></a>`BLP000091` | 400 | **Bad Request - CNAB ERROR**<br/>Max Number of Discharges reached.<br/><small>Número máximo de retornos gerados alcançado.</small> |
| <a id="BLP000094"></a>`BLP000094` | 400 | **Bad Request - CNAB ERROR**<br/>Duplicated Remittance filename.<br/><small>Nome do arquivo de remessa duplicado.</small> |
| <a id="BLP000097"></a>`BLP000097` | 400 | **Bad Request - CNAB ERROR**<br/>Could not determine bank name.<br/><small>Não foi possível determinar o nome do banco.</small> |
| <a id="BLP000098"></a>`BLP000098` | 400 | **Bad Request - CNAB ERROR**<br/>Requester profile not found: {requester_profiles}. Check CNAB field beneficiary identification (positions 21 to 37)<br/><small>Carteira não encontrada: {requester_profiles}. Verifique o campo Identificação da Empresa Beneficiária (posições 21 a 37)</small> |
| <a id="BLP000099"></a>`BLP000099` | 400 | **Bad Request - CNAB ERROR**<br/>Max Number of Remittances reached.<br/><small>Número máximo de remessas alcançado.</small> |
| <a id="BLP000100"></a>`BLP000100` | 400 | **Bad Request - CNAB ERROR**<br/>Not supported occurrence type.<br/><small>Tipo de ocorrência não suportado.</small> |
| <a id="BLP000102"></a>`BLP000102` | 400 | **Bad Request**<br/>Request needs at least one of the following parameters: barcode, digitable_line<br/><small>A Request precisa de pelo menos um dos seguintes parâmetros: barcode, digitable_line</small> |
| <a id="BLP000103"></a>`BLP000103` | 400 | **Bad Request**<br/>Keys must not be empty<br/><small>Lista de chaves não pode ser vazia</small> |
| <a id="BLP000104"></a>`BLP000104` | 400 | **Bad Request**<br/>CIP registration not valid please try again in a few minutes<br/><small>Registro na CIP inválido, por favor tente novamente daqui alguns minutos</small> |
| <a id="BLP000105"></a>`BLP000105` | 400 | **Bad Request**<br/>A SELECTED_AGENT must be provided<br/><small>SELECTED_AGENT deve ser fornecido</small> |
| <a id="BLP000106"></a>`BLP000106` | 400 | **Bad Request**<br/>Use PATCH /expense_configuration/{requester_profile_key} |
| <a id="BLP000107"></a>`BLP000107` | 400 | **Bad Request**<br/>Invalid bank teller instruction, occurrence {occurrence_sequence}<br/><small>Mensagem para o boleto inválida, ocorrência {occurrence_sequence}</small> |
| <a id="BLP000108"></a>`BLP000108` | 400 | **Bad Request**<br/>Use GET expense?subject_account_key={account_key} |
| <a id="BLP000109"></a>`BLP000109` | 404 | **Not Found**<br/>Cnab not found for the given key {cnab_key}<br/><small>Cnab não encontrado para a chave {cnab_key}.</small> |
| <a id="BLP000110"></a>`BLP000110` | 422 | **Unprocessable Entity**<br/>Duplicate our number {our_number}, occurrence sequence {occurrence_sequence}<br/><small>Nosso número {our_number} duplicado, ordem da ocorrência {occurrence_sequence}</small> |
| <a id="BLP000111"></a>`BLP000111` | 422 | **Unprocessable Entity**<br/>Invalid our number {our_number} for requester profile code {requester_profile_code}, occurrence sequence {occurrence_sequence}<br/><small>Nosso número {our_number} inválido para código de carteira {requester_profile_code}, ordem da ocorrência {occurrence_sequence}</small> |
| <a id="BLP000112"></a>`BLP000112` | 422 | **Unprocessable Entity**<br/>Rejected Remittance<br/><small>Remessa Rejeitada</small> |
| <a id="BLP000113"></a>`BLP000113` | 422 | **Unprocessable Entity**<br/>Bank Code not sent, occurrence sequence {occurrence_sequence}<br/><small>Código do banco não enviado, ordem da ocorrência {occurrence_sequence}</small> |
| <a id="BLP000114"></a>`BLP000114` | 422 | **Unprocessable Entity**<br/>Payment branch not sent, occurrence sequence {occurrence_sequence}<br/><small>Agência não enviada, ordem da ocorrência {occurrence_sequence}</small> |
| <a id="BLP000115"></a>`BLP000115` | 422 | **Unprocessable Entity**<br/>Payment Credit Date not sent, occurrence sequence {occurrence_sequence}<br/><small>Data de Pagamento não enviada, ordem da ocorrência {occurrence_sequence}</small> |
| <a id="BLP000116"></a>`BLP000116` | 422 | **Unprocessable Entity**<br/>Invalid digitable line: {digitable_line}<br/><small>Linha digitável inválida: {digitable_line}</small> |
| <a id="BLP000117"></a>`BLP000117` | 400 | **Bad Request**<br/>This requester profile has {bank_slips_count} open bank slips. You cannot deactivate this profile.<br/><small>A carteira selecionada possui {bank_slips_count} boletos em aberto. Não é possível desativar esta carteira.</small> |
| <a id="BLP000118"></a>`BLP000118` | 422 | **Unprocessable Entity**<br/>Blocked or closed requester profile can not register new bank slips, occurrence sequence {occurrence_sequence}<br/><small>Carteira bloqueada ou fechada não pode registrar novos boletos , ordem da ocorrência {occurrence_sequence}</small> |
| <a id="BLP000119"></a>`BLP000119` | 400 | **Bad Request**<br/>Closed requester profile can not register new occurrences<br/><small>Carteiras fechadas não podem gerar novas ocorrências</small> |
| <a id="BLP000120"></a>`BLP000120` | 400 | **Bad Request**<br/>Unable to read CNAB file. Check file data for special characters at line {line} and position {position}<br/><small>Não foi possível ler o CNAB devido presença de caracteres especiais na linha {line} e posição {position} do arquivo.</small> |
| <a id="BLP000121"></a>`BLP000121` | 404 | **Not Found**<br/>Not Found bank Slip to generate permanency expense<br/><small>Boletos não encontrados para gerar tarifa de permanência</small> |
| <a id="BLP000122"></a>`BLP000122` | 404 | **Not Found**<br/>Not Found bank Slip to generate write off term<br/><small>Boletos não encontrados para gerar baixa por decurso de prazo</small> |
| <a id="BLP000123"></a>`BLP000123` | 400 | **Bad Request**<br/>CNAB file with more than one requester profile (positions 021 a 037).<br/><small>Arquivo CNAB com mais de uma carteira (posições 021 a 037).</small> |
| <a id="BLP000124"></a>`BLP000124` | 400 | **Bad Request**<br/>Missing mandatory parameter: requester_profile_key<br/><small>Parâmetro obrigatório ausente: requester_profile_key</small> |
| <a id="BLP000125"></a>`BLP000125` | 404 | **Not Found**<br/>No bankslips with notifications to be sent found<br/><small>Nenhum boleto com notificações a serem enviadas foi encontrado</small> |
| <a id="BLP000126"></a>`BLP000126` | 400 | **Bad Request**<br/>Invalid file type. Logo upload should be a .png image type<br/><small>Tipo de arquivo inválido. O upload do logo deve ser uma imagem .png</small> |
| <a id="BLP000127"></a>`BLP000127` | 400 | **Bad Request**<br/>Invalid image width. Logo image width should be 300px max.<br/><small>Largura inválida. A largura máxima do logo deve ser 300px.</small> |
| <a id="BLP000128"></a>`BLP000128` | 400 | **Bad Request**<br/>Invalid image height. Logo image height should be 100px max.<br/><small>Altura inválida. A altura máxima do logo deve ser 100px.</small> |
| <a id="BLP000129"></a>`BLP000129` | 400 | **Bad Request**<br/>Invalid image orientation. Logo image orientation should be landscape and not portrait/square<br/><small>Orientação inválida. A orientação do logo deve ser paisagem e não retrato/quadrado</small> |
| <a id="BLP000130"></a>`BLP000130` | 400 | **Bad Request**<br/>Missing file.<br/><small>Falta o arquivo.</small> |
| <a id="BLP000131"></a>`BLP000131` | 400 | **Bad Request**<br/>Request without occurrences.<br/><small>Request sem ocorrências.</small> |
| <a id="BLP000132"></a>`BLP000132` | 403 | **Unauthorized**<br/>Occurrence type is not allowed.<br/><small>Occurrence type não permitida.</small> |
| <a id="BLP000134"></a>`BLP000134` | 422 | **Unprocessable Entity**<br/>Our duplicate number, {our_number}<br/><small>Nosso número duplicado, {our_number}</small> |
| <a id="BLP000135"></a>`BLP000135` | 422 | **Unprocessable Entity**<br/>The field Identification of the Beneficiary Institution {beneficiary_code} on the registration lines (positions 021 to 037) is different from the beneficiary company identification {company_code} in the header (positions 027 to 046).<br/><small>O campo Identificação da Empresa Beneficiária {beneficiary_code} nas linhas de registro (posições 021 a 037) é diferente da identificação da empresa beneficiária {company_code} no cabeçalho (posições 027 a 046).</small> |
| <a id="BLP000136"></a>`BLP000136` | 400 | **Invalid FileName**<br/>Invalid filename ({cnab_filename}). Please do not use specials characters like '!,@,(,),$' .<br/><small>Nome de arquivo inválido ({cnab_filename}). Favor não utilizar caracteres especiais como '!,@,(,),$' .</small> |
| <a id="BLP000137"></a>`BLP000137` | 400 | **Bad Request**<br/>Invalid barcode length ({barcode_length}). Barcode must be 44 digits.<br/><small>Tamanho inválido do código de barras. Código de barras deve possuir 44 dígitos.</small> |
| <a id="BLP000138"></a>`BLP000138` | 404 | **Not Found**<br/>Bank Slip for automatic write-off not found<br/><small>Nenhum boleto para baixa automática encontrado</small> |
| <a id="BLP000139"></a>`BLP000139` | 404 | **Not Found**<br/>Notification configuration not found for the given parameters.<br/><small>Não foi possível encontrar a configuração de notificação para os parâmetros enviados.</small> |
| <a id="BLP000140"></a>`BLP000140` | 400 | **Bad Request**<br/>The given CNAB filename is too long to be saved in our database.<br/><small>O nome do arquivo CNAB é muito longo para ser salvo no nosso Banco de Dados.</small> |
| <a id="BLP000141"></a>`BLP000141` | 400 | **Bad Request**<br/>The given digitable_line must have only numbers.<br/><small>A linha digitável fornecida deve conter somente números.</small> |
| <a id="BLP000142"></a>`BLP000142` | 400 | **Bad Request**<br/>This digitable line is out of minimum or maximum length.<br/><small>Esta linha digitável está fora do comprimento mínimo ou máximo.</small> |
| <a id="BLP000143"></a>`BLP000143` | 404 | **Not Found**<br/>Account not found for key {account_key}.<br/><small>Conta não encontrada para a chave {account_key}.</small> |
| <a id="BLP000144"></a>`BLP000144` | 400 | **Bad Request**<br/>This digitable line is not accepted.<br/><small>Essa linha digitável não é aceita.</small> |
| <a id="BLP000145"></a>`BLP000145` | 400 | **Bad Request**<br/>Cannot generate PDF from a rejected bank slip.<br/><small>Não é possível gerar PDF a partir de um boleto bancário rejeitado.</small> |
| <a id="BLP000146"></a>`BLP000146` | 400 | **Bad Request**<br/>Payment rejected.<br/><small>Pagamento rejeitado.</small> |
| <a id="BLP000147"></a>`BLP000147` | 400 | **Bad Request**<br/>To enable QR Code a valid defaul pix key must be send.<br/><small>Para habilitar o QR Code uma chave pix padrão válida deve ser enviada.</small> |
| <a id="BLP000148"></a>`BLP000148` | 400 | **Bad Request**<br/>Beneficiary account and pix key must match.<br/><small>Conta beneficiária deve ser a mesma da chave pix.</small> |
| <a id="BLP000149"></a>`BLP000149` | 400 | **Bad Request**<br/>Requester Profile {requester_profile_key} must be active.<br/><small>Carteira {requester_profile_key} deve estar ativa.</small> |
| <a id="BLP000150"></a>`BLP000150` | 400 | **Bad Request**<br/>Wrong Date format. Format must be YYYY-MM-DD.<br/><small>Formato de data incorreto, Dever ser do tipo YYYY-MM-DD.</small> |
| <a id="BLP000151"></a>`BLP000151` | 400 | **Bad Request**<br/>Protest expense must be percentage.<br/><small>Custas de cartório deven ser em porcentagem.</small> |
| <a id="BLP000152"></a>`BLP000152` | 400 | **Bad Request**<br/>Requester Profile Code {requester_profile_code} already in use<br/><small>Código de carteira {requester_profile_code}</small> |
| <a id="BLP000153"></a>`BLP000153` | 400 | **Bad Request**<br/>{filter_param} must have min length of {min_length}<br/><small>{filter_param} deve ter tamanho mínimo de {min_length}</small> |
| <a id="BLP000154"></a>`BLP000154` | 422 | **Unprocessable Entity**<br/>Error paying tax collection: {message}<br/><small>Erro ao realizar pagamento de arrecadação: {message}</small> |
| <a id="BLP000155"></a>`BLP000155` | 402 | **Bad Request**<br/>Not enough funds for bank-slip payment<br/><small>Fundos insuficientes para pagamento de boleto</small> |
| <a id="BLP000156"></a>`BLP000156` | 400 | **Bad Request**<br/>Use GET /cnab_file/return/{cnab_type}/{requester_profile_code} |
| <a id="BLP000157"></a>`BLP000157` | 400 | **Bad Request**<br/>Missing mandatory parameter: cnab_type<br/><small>Parâmetro obrigatório ausente: cnab_type</small> |
| <a id="BLP000158"></a>`BLP000158` | 400 | **Bad Request**<br/>Remitter key must be provided. Please send SELECTED-AGENT or make an internal request<br/><small>Chave de emissor de remessa deve ser fornecida. Por favor envie um SELECTED-AGENT ou faça uma requisição interna</small> |
| <a id="BLP000159"></a>`BLP000159` | 412 | **Bad Request**<br/>Error generating {file_type}, user with document {document_number} does not have a registered address!<br/><small>Erro ao gerar {file_type}, usuário com o documento {document_number} não possui endereço cadastrado!</small> |
| <a id="BLP000160"></a>`BLP000160` | 422 | **Unprocessable Entity**<br/>Expiration date cannot be after 2049-10-13<br/><small>Data de vencimento não pode ser depois de 2049-10-13</small> |
| <a id="BLP000161"></a>`BLP000161` | 400 | **Bad Request**<br/>Interest Daily Value must match format 9999999.99<br/><small>Juros diário deve estar no formato 9999999.99</small> |
| <a id="BLP000162"></a>`BLP000162` | 400 | **Bad Request**<br/>Fine Percentage Value must match format 9999999.99<br/><small>Valor multa deve estar no formato 9999999.99</small> |
| <a id="BLP000163"></a>`BLP000163` | 400 | **Bad Request**<br/>Discount Value must match format 9999999.99<br/><small>Valor de Desconto diário deve estar no formato 9999999.99</small> |
| <a id="BLP000164"></a>`BLP000164` | 404 | **Not Found**<br/>Payment entry not found for barcode {barcode}.<br/><small>Pagamento não encontrada para o código de barras {barcode}.</small> |
| <a id="BLP000165"></a>`BLP000165` | 400 | **Bad Request**<br/>Payment is not paid. Current payment status: {current_payment_status}.<br/><small>O pagamento não está pago. Status atual do pagamento: {current_payment_status}.</small> |
| <a id="BLP000166"></a>`BLP000166` | 400 | **Bad Request**<br/>Failed to cancel payment in PCR. Barcode: {barcode}.<br/><small>Falha ao cancelar pagamento no PCR. Código de barras: {barcode}.</small> |
| <a id="BLP000167"></a>`BLP000167` | 400 | **Bad Request**<br/>Requester max_payment_days must be an integer no greater than 360 and must not be 0.<br/><small>A configuração max_payment_days da carteira deve ser um número inteiro igual ou menor a 360 e diferente de 0</small> |
| <a id="BLP000168"></a>`BLP000168` | 400 | **Bad Request**<br/>Bank slip is not does not have a payment notice. Current bank slip status: {bank_slip_status}.<br/><small>O boleto não está com aviso de pagamento. Status atual do boleto: {bank_slip_status}.</small> |
| <a id="BLP000169"></a>`BLP000169` | 400 | **Bad Request**<br/>Bank slip does not have a confirmed payment notice occurrence.<br/><small>O boleto não possui uma ocorrência de aviso de pagamento confirmada.</small> |
| <a id="BLP000170"></a>`BLP000170` | 400 | **Bad Request**<br/>If override_automatic_bankruptcy_protest_settings is true, bankruptcy protest settings must be filled.<br/><small>Se sobreescrever configurações de interesse estiver ativado, as suas configurações devem ser preenchidas.</small> |
| <a id="BLP000171"></a>`BLP000171` | 400 | **Bad Request**<br/>If override_fine_settings is true, bankruptcy protest settings must be filled.<br/><small>Se sobreescrever configurações de multa estiver ativado, as suas configurações devem ser preenchidas.</small> |
| <a id="BLP000172"></a>`BLP000172` | 400 | **Bad Request**<br/>If override_automatic_write_off_settings is true, bankruptcy protest settings must be filled.<br/><small>Se sobreescrever configurações de baixa automática estiver ativado, as suas configurações devem ser preenchidas.</small> |
| <a id="BLP000173"></a>`BLP000173` | 400 | **Bad Request**<br/>If override_automatic_bankruptcy_protest_settings is true, bankruptcy protest settings must be filled.<br/><small>Se sobreescrever configurações de protesto por falência estiver ativado, as suas configurações devem ser preenchidas.</small> |
| <a id="BLP000174"></a>`BLP000174` | 400 | **Bad Request**<br/>If override_automatic_protest_settings is true, protest settings must be filled.<br/><small>Se sobreescrever configurações de protesto estiver ativado, as suas configurações devem ser preenchidas.</small> |
| <a id="BLP000175"></a>`BLP000175` | 400 | **Bad Request**<br/>If override_printing_policy_settings is true, printing policy settings must be filled.<br/><small>Se sobreescrever configurações de política de impressão estiver ativado, as suas configurações devem ser preenchidas.</small> |
| <a id="BLP000176"></a>`BLP000176` | 400 | **Bad Request**<br/>Failed to consult payment in PCR. Barcode: {barcode}.<br/><small>Falha ao consultar pagamento no PCR. Código de barras: {barcode}.</small> |
| <a id="BLP000177"></a>`BLP000177` | 400 | **Bad Request**<br/>Purpose not allowed.<br/><small>Propósito não permitido.</small> |
| <a id="BLP000178"></a>`BLP000178` | 400 | **Bad Request**<br/>It's not possible to schedule payments for tax collection<br/><small>Não é possível agendar pagamentos para arrecadação</small> |
| <a id="BLP000179"></a>`BLP000179` | 400 | **Bad Request**<br/>Payment date can't be before today.<br/><small>Data de pagamento não pode ser anterior a data de hoje.</small> |
| <a id="BLP000180"></a>`BLP000180` | 400 | **Bad Request**<br/>Invalid purpose.<br/><small>Propósito inválido .</small> |
| <a id="BLP000181"></a>`BLP000181` | 400 | **Bad Request**<br/>Invalid guarantor document.<br/><small>Documento inválido.</small> |
| <a id="BLP000182"></a>`BLP000182` | 400 | **Bad Request**<br/>Invalid expiration date.<br/><small>Data de validade inválida.</small> |
| <a id="BLP000183"></a>`BLP000183` | 400 | **Bad Request**<br/>Invalid character in line {line}.<br/><small>Caracter inválido na linha {line}.</small> |
| <a id="BLP000184"></a>`BLP000184` | 501 | **Not Implemented**<br/>Resource only available in sandbox<br/><small>Recurso disponível apenas em sandbox</small> |
| <a id="BLP000185"></a>`BLP000185` | 400 | **Invalid Qr Code Type**<br/>The Qr Code payload given did not provide a proper Qr Code type<br/><small>O payload de QR Code fornecido não contêm um tipo de Qr Code Válido</small> |
| <a id="BLP000186"></a>`BLP000186` | 400 | **Invalid Qr Code Format**<br/>The Qr Code format is invalid<br/><small>O formato do Qr Code é inválido</small> |
| <a id="BLP000187"></a>`BLP000187` | 404 | **Not Found**<br/>Payment entry not found for digitable line {digitable_line}.<br/><small>Pagamento não encontrada para a linha digitável {digitable_line}.</small> |
| <a id="BLP000188"></a>`BLP000188` | 400 | **Bad Request**<br/>It was not possible to consult the bank slip at this time. Please try again in a few minutes.<br/><small>Não foi possível consultar o boleto neste momento. Por favor, tente novamente em alguns minutos.</small> |
| <a id="BLP000189"></a>`BLP000189` | 400 | **Bad Request**<br/>There was a problem processing the payment. Please verify your information and, if necessary, contact us for assistance.<br/><small>Houve um problema ao processar o pagamento. Por favor, verifique suas informações e, se necessário, entre em contato conosco para obter assistência.</small> |
| <a id="BLP000190"></a>`BLP000190` | 400 | **Bad Request**<br/>Settlement cycle not found<br/><small>Ciclo de liquidação não encontrado</small> |
| <a id="BLP000191"></a>`BLP000191` | 400 | **Bad Request**<br/>Temporary unavalilable<br/><small>Temporariamente indisponível</small> |
| <a id="BLP000192"></a>`BLP000192` | 400 | **Bad Request**<br/>Cnab profile output in progress for requester_profile_code<br/><small>Genaração de cnab para a carteira em progresso</small> |
| <a id="BLP000193"></a>`BLP000193` | 422 | **Unprocessable Entity**<br/>Requester profile {requester_profile_code} is locked by other action, please try again later.<br/><small>Carteira {requester_profile_code} está bloqueada por outra ação, por favor tente novamente mais tarde.</small> |
| <a id="BLP000194"></a>`BLP000194` | 400 | **Bad Request**<br/>Field requester_key is required in the request body.<br/><small>O campo requester_key é obrigatório no corpo da requisição.</small> |
| <a id="BLP000195"></a>`BLP000195` | 400 | **Bad Request**<br/>Bank slip settlement type must be informed.<br/><small>O tipo de liquidação do boleto deve ser informado.</small> |
| <a id="BLP000196"></a>`BLP000196` | 400 | **Bad Request**<br/>Invalid guarantor name.<br/><small>Nome do sacador avalista inválido.</small> |
| <a id="BLP000197"></a>`BLP000197` | 400 | **Bad Request**<br/>Beneficiary account is not opened<br/><small>Conta beneficiária não está aberta</small> |
| <a id="BLP000198"></a>`BLP000198` | 400 | **Bad Request**<br/>Multiple payment entries found for barcode {barcode}.<br/><small>Múltiplas entradas de pagamento encontradas para o código de barras {barcode}.</small> |
| <a id="BLP000199"></a>`BLP000199` | 400 | **Bad Request**<br/>Bank slip payment total amount is different from the returned amount.<br/><small>O valor total do pagamento do boleto é diferente do valor retornado.</small> |

### GDF — Platform

28 errors

| Code | HTTP | Message |
|-|-|-|
| <a id="GDF000001"></a>`GDF000001` | 403 | **Permission Validation Error**<br/>Only master user's are allowed<br/><small>Somente usuários master são permitidos</small> |
| <a id="GDF000002"></a>`GDF000002` | 403 | **Permission Validation Error**<br/>A SELECTED-AGENT must be provided<br/><small>Um SELECTED-AGENT deve ser fornecido</small> |
| <a id="GDF000003"></a>`GDF000003` | 400 | **Bad Request**<br/>No API Client Key received<br/><small>Nenhuma chave de API do cliente recebida</small> |
| <a id="GDF000004"></a>`GDF000004` | 400 | **Bad Request**<br/>Empty body received<br/><small>Corpo da request vazio</small> |
| <a id="GDF000005"></a>`GDF000005` | 400 | **Bad Request**<br/>API Client already created for this person_key<br/><small>Cliente da API já criado para esta person_key</small> |
| <a id="GDF000006"></a>`GDF000006` | 400 | **Bad Request**<br/>Duplicated allowed_endpoint provided<br/><small>allowed_endpoint duplicado</small> |
| <a id="GDF000007"></a>`GDF000007` | 404 | **Not Found**<br/>No ClientIntegration found for client_integration_key: {client_integration_key} .<br/><small>Nenhuma ClientIntegration encontrada para client_integration_key: {client_integration_key}.</small> |
| <a id="GDF000008"></a>`GDF000008` | 400 | **Bad Request**<br/>A client_integration_key must be provided<br/><small>Uma client_integration_key deve ser fornecida</small> |
| <a id="GDF000009"></a>`GDF000009` | 400 | **Bad Request**<br/>A action must be provided<br/><small>Uma ação deve ser fornecida</small> |
| <a id="GDF000010"></a>`GDF000010` | 400 | **Bad Request**<br/>Action doesnt exist ({action_name}).<br/><small>Ação não existe ({action_name}).</small> |
| <a id="GDF000011"></a>`GDF000011` | 404 | **Not Found**<br/>No ClientIntegration found for client_integration_key / allowed_endpoint_key: {client_integration_key} / {allowed_endpoint_key}.<br/><small>Nenhuma ClientIntegration encontrada para client_integration_key / allowed_endpoint_key: {client_integration_key} / {allowed_endpoint_key}.</small> |
| <a id="GDF000012"></a>`GDF000012` | 404 | **Not Found**<br/>No AllowedEndpoint found for client_integration_key / allowed_endpoint_key: {client_integration_key} / {allowed_endpoint_key}.<br/><small>Nenhuma AllowedEndpoint encontrada para client_integration_key / allowed_endpoint_key: {client_integration_key} / {allowed_endpoint_key}.</small> |
| <a id="GDF000013"></a>`GDF000013` | 400 | **Bad Request**<br/>A allowed_endpoint_key must be provided<br/><small>Uma chave allowed_endpoint_key deve ser fornecida</small> |
| <a id="GDF000014"></a>`GDF000014` | 401 | **QI Unauthenticated**<br/>Please provide valid credentials as part of the request. (Documentation: https://docs.qitech.com.br) Details: {details}<br/><small>Por favor forneça credenciais válidas como parte da request. (Documentação: https://docs.qitech.com.br) Detalhes: {details_br}</small> |
| <a id="GDF000015"></a>`GDF000015` | 400 | **Bad Request**<br/>Please provide a valid client_public_key<br/><small>Por favor forneça uma chave pública válida</small> |
| <a id="GDF000016"></a>`GDF000016` | 400 | **Bad Request**<br/>Error while decoding request's JSON body. Please verify if body is valid. Details: {json_ex}<br/><small>Erro ao decodificar o JSON do corpo da requisição. Por favor verifique se o corpo é válido. Detalhes: {json_ex}</small> |
| <a id="GDF000017"></a>`GDF000017` | 400 | **Bad Request**<br/>Invalid Value ({info}).<br/><small>Valor inválido ({info}).</small> |
| <a id="GDF000018"></a>`GDF000018` | 404 | **Not Found**<br/>No ClientIntegration found for api_client_key: {api_client_key}.<br/><small>Nenhuma ClientIntegration encontrada para api_client_key: {api_client_key}.</small> |
| <a id="GDF000019"></a>`GDF000019` | 400 | **Bad Request**<br/>Informed request_type: '{request_type}' has not been mapped yet.<br/><small>Mapeamento ainda inexistente para request_type: '{request_type}'.</small> |
| <a id="GDF000020"></a>`GDF000020` | 500 | **Internal Error**<br/>Account Key can't be null when including pix key.<br/><small>Account Key não pode ser nulo quando solicitar uma inclusão de chave.</small> |
| <a id="GDF000021"></a>`GDF000021` | 500 | **Internal Error**<br/>Failed to request SCR authorization.<br/><small>Falha na requisição para autorização de SCR.</small> |
| <a id="GDF000022"></a>`GDF000022` | 400 | **Bad Request**<br/>Informed request_type: '{request_type}' has not been mapped yet.<br/><small>Mapeamento ainda inexistente para request_type: '{request_type}'.</small> |
| <a id="GDF000023"></a>`GDF000023` | 401 | **Unauthorized**<br/>Error na verificação SSL<br/><small>SSL validation error</small> |
| <a id="GDF000024"></a>`GDF000024` | 400 | **Bad Request**<br/>Error no endpoint de webhook do cliente<br/><small>Error at client webhook endpoint</small> |
| <a id="GDF000025"></a>`GDF000025` | 403 | **Permission Validation Error**<br/>Only sandbox and dev environment are allowed to request Mock API<br/><small>Somente os ambientes de desenvolvimento e de sandbox são permitidos para realizar requisições na Mock API.</small> |
| <a id="GDF000026"></a>`GDF000026` | 400 | **Bad Request**<br/>Signature method version not allowed<br/><small>Versão do método de assinatura não permitida</small> |
| <a id="GDF000027"></a>`GDF000027` | 404 | **Not Found**<br/>No ClientIntegration found for person_key: {person_key}.<br/><small>Nenhuma ClientIntegration encontrada para a person_key: {person_key}.</small> |
| <a id="GDF000028"></a>`GDF000028` | 404 | **Not Found**<br/>The request needs a body, even an empty one like: '{}'.<br/><small>A requisição precisa de um body, mesmo que um vazio como: '{}'.</small> |

### OBD — Onboarding

88 errors

| Code | HTTP | Message |
|-|-|-|
| <a id="OBD000001"></a>`OBD000001` | 400 | **Bad Request**<br/>Use DELETE /bank_account/{bank_account_key} with a valid agent<br/><small>Use DELETE /bank_account/{bank_account_key} com um agente válido</small> |
| <a id="OBD000002"></a>`OBD000002` | 404 | **Not Found**<br/>Bank account not found<br/><small>Conta não encontrada</small> |
| <a id="OBD000003"></a>`OBD000003` | 400 | **Bad Request**<br/>Use POST /bank_account/ with a valid agent<br/><small>Use POST /bank_account/ com um agente válido</small> |
| <a id="OBD000004"></a>`OBD000004` | 404 | **Not Found**<br/>There is no person with document number {document_number}<br/><small>Não existe pessoa com número de documento {document_number}</small> |
| <a id="OBD000005"></a>`OBD000005` | 400 | **Bad Request**<br/>Use GET /cnae/{cnae_code} |
| <a id="OBD000006"></a>`OBD000006` | 400 | **Bad Request**<br/>Cnae code must be without special characters and must have 7 digits<br/><small>O código Cnae deve ter 7 dígitos e não conter caracteres especiais</small> |
| <a id="OBD000007"></a>`OBD000007` | 404 | **Not Found**<br/>Cnae was not found.<br/><small>Cnae não encontrado.</small> |
| <a id="OBD000008"></a>`OBD000008` | 404 | **Not Found**<br/>Owner Person not found.<br/><small>Proprietário (owner_person) não encontrado.</small> |
| <a id="OBD000009"></a>`OBD000009` | 404 | **Not Found**<br/>Draft person not found for {name}<br/><small>Draft person não encontrada para {name}</small> |
| <a id="OBD000010"></a>`OBD000010` | 400 | **Bad Request**<br/>Fund already exists, please use PUT /fund/{fund_key}.<br/><small>O fundo já existe, use PUT /fund/{fund_key}.</small> |
| <a id="OBD000011"></a>`OBD000011` | 400 | **Bad Request**<br/>Custodian Person not found.<br/><small>custodian_person não encontrado.</small> |
| <a id="OBD000012"></a>`OBD000012` | 400 | **Bad Request**<br/>Custodian Person sent is not a custodian.<br/><small>custodian_person não é válido.</small> |
| <a id="OBD000013"></a>`OBD000013` | 400 | **Bad Request**<br/>Administrator Person not found.<br/><small>Administrador não encontrado</small> |
| <a id="OBD000014"></a>`OBD000014` | 400 | **Bad Request**<br/>Administrator Person sent is not a administrator.<br/><small>administrador_person não é um administrador.</small> |
| <a id="OBD000015"></a>`OBD000015` | 400 | **Bad Request**<br/>Fund not found.<br/><small>Fundo não encontrado.</small> |
| <a id="OBD000016"></a>`OBD000016` | 400 | **Bad Request**<br/>Fund document_number sent must match an existing fund. Sent: {fund_document_number}.<br/><small>O número do documento do fundo enviado deve corresponder a um fundo existente. Enviado: {fund_document_number}.</small> |
| <a id="OBD000017"></a>`OBD000017` | 400 | **Bad Request**<br/>Fund document_number sent must match existing fund. Sent: {fund_document_number}. Expected: {document_number}.<br/><small>O número do documento do fundo enviado deve corresponder ao fundo existente. Enviado: {fund_document_number}. Experado: {document_number}.</small> |
| <a id="OBD000018"></a>`OBD000018` | 400 | **Bad Request**<br/>Person already has {qualification_enum} qualification.<br/><small>A pessoa já tem qualificação {qualification_enum}.</small> |
| <a id="OBD000019"></a>`OBD000019` | 404 | **Not Found**<br/>Person not found<br/><small>Pessoa não encontrada.</small> |
| <a id="OBD000020"></a>`OBD000020` | 404 | **Not Found**<br/>Company or Agent not found<br/><small>Empresa ou agente não encontrado</small> |
| <a id="OBD000021"></a>`OBD000021` | 400 | **Bad Request**<br/>Use GET /person/(person_document) or /person?document_number?(document_number)<br/><small>Use GET /person/(person_document) ou /person?document_number?(document_number)</small> |
| <a id="OBD000022"></a>`OBD000022` | 400 | **Bad Request**<br/>Duplicated document/email<br/><small>E-mail ou documento duplicado</small> |
| <a id="OBD000023"></a>`OBD000023` | 500 | **Internal Error**<br/>Error creating user:{document_number}. Fail to send welcome email<br/><small>Erro ao criar usuário: {document_number}. Falha ao enviar email de boas-vindas</small> |
| <a id="OBD000024"></a>`OBD000024` | 404 | **Not Found**<br/>POST Agent Not Found<br/><small>Agente não encontrado</small> |
| <a id="OBD000025"></a>`OBD000025` | 400 | **Bad Request**<br/>First document must be CPF or CNPJ<br/><small>Documento deve ser CPF ou CNPJ</small> |
| <a id="OBD000026"></a>`OBD000026` | 400 | **Bad Request**<br/>Use POST /person |
| <a id="OBD000027"></a>`OBD000027` | 400 | **Bad Request**<br/>Conflict with person key and person type<br/><small>Conflito com chave e tipo de pessoa</small> |
| <a id="OBD000028"></a>`OBD000028` | 400 | **Bad Request**<br/>Use PATCH /person/{person_key} |
| <a id="OBD000029"></a>`OBD000029` | 400 | **Bad Request**<br/>Use GET /person_qualification/{qualification} |
| <a id="OBD000030"></a>`OBD000030` | 400 | **Bad Request**<br/>Use PUT /person_qualification |
| <a id="OBD000031"></a>`OBD000031` | 400 | **Bad Request**<br/>Person does not have {qualification_enum} qualification.<br/><small>A pessoa não tem qualificação {qualification_enum}.</small> |
| <a id="OBD000032"></a>`OBD000032` | 400 | **Bad Request**<br/>Use DELETE /person_qualification |
| <a id="OBD000033"></a>`OBD000033` | 400 | **Bad Request**<br/>Natural person not found<br/><small>Pessoa física não encontrada</small> |
| <a id="OBD000034"></a>`OBD000034` | 400 | **Bad Request**<br/>Legal person not found<br/><small>Pessoa jurídica não encontrada</small> |
| <a id="OBD000035"></a>`OBD000035` | 400 | **Bad Request**<br/>Professional data already exists<br/><small>Dados profissionais já existem</small> |
| <a id="OBD000036"></a>`OBD000036` | 400 | **Bad Request**<br/>Professional data not found<br/><small>Dados profissionais não encontrados</small> |
| <a id="OBD000037"></a>`OBD000037` | 400 | **Bad Request**<br/>Use POST /professional_data |
| <a id="OBD000038"></a>`OBD000038` | 400 | **Bad Request**<br/>You cannot remove yourself<br/><small>Você não pode se remover</small> |
| <a id="OBD000039"></a>`OBD000039` | 400 | **Bad Request**<br/>Missing attribute person_key in request body<br/><small>Atributo person_key ausente no corpo da request</small> |
| <a id="OBD000040"></a>`OBD000040` | 400 | **Bad Request**<br/>You must provide a name.<br/><small>Você deve fornecer um nome.</small> |
| <a id="OBD000041"></a>`OBD000041` | 400 | **Bad Request**<br/>You must provide a name and a document number to do the PEP check.<br/><small>Você deve fornecer um nome e um número de documento para fazer a verificação do PEP.</small> |
| <a id="OBD000042"></a>`OBD000042` | 500 | **Internal Error**<br/>KeyCloak did not returned location header<br/><small>KeyCloak não retornou o cabeçalho do local</small> |
| <a id="OBD000043"></a>`OBD000043` | 400 | **Bad Request**<br/>Qualification does not exist<br/><small>Qualificação não existe</small> |
| <a id="OBD000044"></a>`OBD000044` | 400 | **Bad Request**<br/>Could not find either legal nor natural person<br/><small>Pessoa fisica ou juridica nao encontradas.</small> |
| <a id="OBD000045"></a>`OBD000045` | 400 | **Bad Request**<br/>Missing attribute owner_person_key<br/><small>Atributo owner_person_key ausente</small> |
| <a id="OBD000046"></a>`OBD000046` | 400 | **Bad Request**<br/>Professional data is not active<br/><small>Professional data não está ativo</small> |
| <a id="OBD000047"></a>`OBD000047` | 403 | **Unauthorized**<br/>User does not have permission to add or modify users to this person<br/><small>Usuário não tem permissão para adicionar ou modificar usuários</small> |
| <a id="OBD000048"></a>`OBD000048` | 400 | **Bad Request**<br/>Client Key must be provided.<br/><small>A chave de usuário deve ser enviada.</small> |
| <a id="OBD000049"></a>`OBD000049` | 404 | **Bad Request**<br/>Client not found.<br/><small>Client não encontrado</small> |
| <a id="OBD000050"></a>`OBD000050` | 400 | **Bad Request**<br/>Parameter client_key not allowed no POST method<br/><small>Parâmetro client_key não permitido no método POST</small> |
| <a id="OBD000051"></a>`OBD000051` | 400 | **Bad Request**<br/>Person is not active<br/><small>Person não está ativa</small> |
| <a id="OBD000052"></a>`OBD000052` | 400 | **Bad Request**<br/>document_type: {document_type} not allowed for {person_type} person<br/><small>document_type: {document_type} não permitido para person {person_type}</small> |
| <a id="OBD000053"></a>`OBD000053` | 400 | **Bad Request**<br/>Wrong document_type: {document_type} used in document: {document_field_name}<br/><small>document_type: {document_type} incorreto utilizado no documento: {document_field_name}</small> |
| <a id="OBD000054"></a>`OBD000054` | 400 | **Bad Request**<br/>Client already registered for document_number: {document_number}. Use PATCH method to update a client<br/><small>Cliente já registrado para o document_number: {document_number}. use o método PATCH para atualizar um cliente</small> |
| <a id="OBD000055"></a>`OBD000055` | 404 | **Bad Request**<br/>Can not find any result for search parameters<br/><small>Não foi possíel encontrar nenhum resultado com os parâmetros eviados.</small> |
| <a id="OBD000056"></a>`OBD000056` | 403 | **Unauthorized**<br/>User does not have permission to add or modify clients to this person<br/><small>Usuário não tem permissão para adicionar ou modificar clientes</small> |
| <a id="OBD000057"></a>`OBD000057` | 403 | **Bad Request**<br/>Client {document_number} is blocked, please contact support.<br/><small>O cliente {document_number} está bloqueado, favor contactar o suporte.</small> |
| <a id="OBD000058"></a>`OBD000058` | 403 | **Bad Request**<br/>Action not implemented.<br/><small>Ação não implementada.</small> |
| <a id="OBD000059"></a>`OBD000059` | 400 | **Bad Request**<br/>Duplicated document_key on company representative with document_number: {document_number}<br/><small>document_key duplicada no company representative com document_number: {document_number}</small> |
| <a id="OBD000060"></a>`OBD000060` | 400 | **Bad Request**<br/>Duplicated company_representative received<br/><small>company_representative duplicado recebido</small> |
| <a id="OBD000061"></a>`OBD000061` | 400 | **Bad Request**<br/>Duplicated document_key on client's attached_documents<br/><small>document_key duplicada nos attached_documents do client</small> |
| <a id="OBD000062"></a>`OBD000062` | 400 | **Bad Request**<br/>order_by filter must be one of: {order_by_list}<br/><small>filtro order_by permitido para os seguintes valores: {order_by_list}</small> |
| <a id="OBD000063"></a>`OBD000063` | 401 | **Unauthorized**<br/>password reset not authorized out of app<br/><small>reset de senha não autorizado fora do app</small> |
| <a id="OBD000064"></a>`OBD000064` | 400 | **Bad Request**<br/>professional data is already active<br/><small>professional data já está ativo</small> |
| <a id="OBD000065"></a>`OBD000065` | 400 | **Bad Request**<br/>You must provide an email.<br/><small>Você deve fornecer um email.</small> |
| <a id="OBD000066"></a>`OBD000066` | 412 | **Precondition Failed**<br/>OwnerPerson must be in the QI SCD Domain.<br/><small>OwnerPerson deve pertencer ao Domain da QI SCD</small> |
| <a id="OBD000067"></a>`OBD000067` | 400 | **Bad Request**<br/>Domain already exists for owner person.<br/><small>Domínio já existe para OwnerPerson.</small> |
| <a id="OBD000068"></a>`OBD000068` | 404 | **Not Found**<br/>Domain not found<br/><small>Domínio não encontrado.</small> |
| <a id="OBD000069"></a>`OBD000069` | 400 | **Bad Request**<br/>Only legal person may own domains.<br/><small>Apenas pessoas jurídicas podem ter domínios.</small> |
| <a id="OBD000070"></a>`OBD000070` | 400 | **Bad Request**<br/>Wrong type for {variable}. Must be {type}<br/><small>Tipo errado para {variable}. Deve ser {type}</small> |
| <a id="OBD000071"></a>`OBD000071` | 400 | **Bad Request**<br/>You must provide an email or a phone number.<br/><small>Você deve fornecer um email ou um número de telefone.</small> |
| <a id="OBD000072"></a>`OBD000072` | 400 | **Bad Request**<br/>Use either owner_person_key or domain_key in search.<br/><small>Use owner_person_key ou domain_key na busca.</small> |
| <a id="OBD000073"></a>`OBD000073` | 403 | **Unauthorized**<br/>User does not have permission to add or modify persons to this domain<br/><small>Usuário não tem permissão para adicionar ou modificar pessoas a este domínio.</small> |
| <a id="OBD000075"></a>`OBD000075` | 400 | **Bad Request**<br/>Natural and legal person must be in the same domain.<br/><small>Pessoas físicas e jurídicas deves pertencer ao mesmo domínio.</small> |
| <a id="OBD000076"></a>`OBD000076` | 400 | **Bad Request**<br/>A professional_data_key must be provided.<br/><small>Uma professional_data_key deve ser fornecida.</small> |
| <a id="OBD000077"></a>`OBD000077` | 400 | **Bad Request**<br/>Invalid legal person role sent {role}.<br/><small>Permissão inválida para pessoa juurídica, enviado {role}</small> |
| <a id="OBD000078"></a>`OBD000078` | 400 | **Bad Request**<br/>There must always be an account administrator left<br/><small>Sempre deve existir ao menos um administrador de conta</small> |
| <a id="OBD000079"></a>`OBD000079` | 400 | **Bad Request**<br/>Endpoint used for natural person updates only<br/><small>Endpoint utilizado apenas para atualizações de pessoas fisicas</small> |
| <a id="OBD000080"></a>`OBD000080` | 400 | **Bad Request**<br/>Invalid phone number<br/><small>Número de telefone inválido</small> |
| <a id="OBD000081"></a>`OBD000081` | 400 | **Bad Request**<br/>Invalid e-mail<br/><small>E-mail inválido</small> |
| <a id="OBD000082"></a>`OBD000082` | 400 | **Bad Request**<br/>Natural person does not have allowed users.<br/><small>Pessoa física não possui usuários autorizados.</small> |
| <a id="OBD000083"></a>`OBD000083` | 404 | **Not found**<br/>Professional data not found.<br/><small>Dados proficionais não encontrados.</small> |
| <a id="OBD000084"></a>`OBD000084` | 400 | **Bad Request**<br/>The openfinance user is already validated.<br/><small>O usuário open finance já foi validado.</small> |
| <a id="OBD000085"></a>`OBD000085` | 400 | **Bad Request**<br/>Method only allowed for domain users.<br/><small>Método permitido apenas para usuários de domain.</small> |
| <a id="OBD000086"></a>`OBD000086` | 400 | **Bad Request**<br/>Reproved person data.<br/><small>Dados recusados.</small> |
| <a id="OBD000087"></a>`OBD000087` | 400 | **Requester Configuration Already Exists**<br/>Requester Configuration already exists for this requester_key.<br/><small>Requester Configuration já existe para essa requester_key.</small> |
| <a id="OBD000088"></a>`OBD000088` | 400 | **Invalid Requester Configuration Info**<br/>The configuration format sent is not valid.<br/><small>O formato de configuração enviado não é válido.</small> |
| <a id="OBD000089"></a>`OBD000089` | 404 | **Requester Configuration not found**<br/>There is no Requester Configuration attributed to requester_key given<br/><small>Não há Requester Configuration para a requester_key enviada</small> |

### PMB — Pombo

34 errors

| Code | HTTP | Message |
|-|-|-|
| <a id="PMB000001"></a>`PMB000001` | 403 | **Permission Validator Error**<br/>Only master user's are allowed<br/><small>Somente usuários master estão autorizados</small> |
| <a id="PMB000002"></a>`PMB000002` | 403 | **Permission Validator Error**<br/>A SELECTED-AGENT must be provided<br/><small>Um SELECTED-AGENT deve ser fornecido</small> |
| <a id="PMB000003"></a>`PMB000003` | 404 | **Not Found**<br/>No callback found for callback_key: {callback_key} .<br/><small>Nenhum callback encontrado para callback_key: {callback_key}.</small> |
| <a id="PMB000004"></a>`PMB000004` | 400 | **Bad Request**<br/>The requested event_type ({callback_event_name}) does not exists.<br/><small>O event_type solicitado ({callback_event_name}) não existe.</small> |
| <a id="PMB000005"></a>`PMB000005` | 400 | **Bad Request**<br/>Unable to perform retry action with current callback_status ({callback_status_enumerator})<br/><small>Não foi possível executar a ação de nova tentativa com o callback_status atual ({callback_status_enumerator})</small> |
| <a id="PMB000006"></a>`PMB000006` | 400 | **Bad Request**<br/>A NotificationConfiguration already exists for event_type: {event_type} .<br/><small>Já existe uma NotificationConfiguration para event_type: {event_type}.</small> |
| <a id="PMB000007"></a>`PMB000007` | 400 | **Bad Request**<br/>No NotificationConfiguration found for event_type: {event_type} .<br/><small>Nenhuma NotificationConfiguration encontrada para event_type: {event_type}.</small> |
| <a id="PMB000008"></a>`PMB000008` | 404 | **Not Found**<br/>Event not found (event_key = {event_key})<br/><small>Evento não encontrado (event_key = {event_key})</small> |
| <a id="PMB000009"></a>`PMB000009` | 400 | **Bad Request**<br/>Event already exists (event_key: {event_key})<br/><small>Evento já existe (event_key = {event_key})</small> |
| <a id="PMB000010"></a>`PMB000010` | 400 | **Bad Request**<br/>A NotificationConfiguration already exists for person_key: {person_key} / event_type: {event_type} .<br/><small>Já existe uma NotificationConfiguration para person_key: {person_key} / event_type: {event_type} .</small> |
| <a id="PMB000011"></a>`PMB000011` | 400 | **Bad Request**<br/>Origin '{enumerator}' already exists.<br/><small>Origem '{enumerador}' já existe.</small> |
| <a id="PMB000012"></a>`PMB000012` | 400 | **Bad Request**<br/>EventType '{enumerator}' already exists.<br/><small>EventType '{enumerator}' já existe.</small> |
| <a id="PMB000013"></a>`PMB000013` | 400 | **Bad Request**<br/>A person_key must be provided<br/><small>Uma person_key deve ser fornecida</small> |
| <a id="PMB000014"></a>`PMB000014` | 400 | **Bad Request**<br/>A CallbackConfiguration already exists for person_key: {person_key} .<br/><small>Já existe uma CallbackConfiguration para person_key: {person_key}.</small> |
| <a id="PMB000015"></a>`PMB000015` | 404 | **Not Found**<br/>No CallbackConfiguration found for person_key: {person_key} .<br/><small>Nenhuma cCallbackConfiguration encontrada para person_key: {person_key}.</small> |
| <a id="PMB000016"></a>`PMB000016` | 404 | **Not Found**<br/>The CallbackConfiguration URL must be in https.<br/><small>A URL do CallbackConfiguration precisa estar em https.</small> |
| <a id="PMB000017"></a>`PMB000017` | 404 | **Not Found**<br/>The CallbackConfiguration Headers must be a dict or a json object<br/><small>Os Headers do CallbackConfiguration precisa ser um dicionário, ou um objeto JSON.</small> |
| <a id="PMB000018"></a>`PMB000018` | 404 | **Not Found**<br/>SMS Try not found by external key<br/><small>SMS Try não encontrado pela chave externa</small> |
| <a id="PMB000019"></a>`PMB000019` | 400 | **Bad Request**<br/>The requested origin ({origin}) does not exists.<br/><small>A origem solicitada ({origin}) não existe.</small> |
| <a id="PMB000020"></a>`PMB000020` | 400 | **Bad Request**<br/>The {invalid_uuid} sent is not valid<br/><small>A {invalid_uuid} enviada não é válida</small> |
| <a id="PMB000021"></a>`PMB000021` | 400 | **Bad Request**<br/>The template type {enumerator} is not valid<br/><small>O tipo de template {enumerator} enviado não é válida</small> |
| <a id="PMB000022"></a>`PMB000022` | 400 | **Bad Request**<br/>The event type {enumerator} is not valid<br/><small>O tipo de evento {enumerator} enviado não é válida</small> |
| <a id="PMB000023"></a>`PMB000023` | 400 | **Bad Request**<br/>Already exists an template configuration to this person and event type<br/><small>Já existe um template configuration para essa pessoa e event type</small> |
| <a id="PMB000024"></a>`PMB000024` | 404 | **Not found**<br/>Template configuration not found<br/><small>Configuração de template não encontrada</small> |
| <a id="PMB000025"></a>`PMB000025` | 404 | **Not found**<br/>Template not found<br/><small>Template não encontrado</small> |
| <a id="PMB000026"></a>`PMB000026` | 400 | **Invalid notification for event type**<br/>Invalid notification method for event type<br/><small>Método de notificação inválido para tipo de evento</small> |
| <a id="PMB000027"></a>`PMB000027` | 409 | **Conflict**<br/>Notification configuration already exists for this person and event type<br/><small>Configuração de notificação já existe para essa pessoa e tipo de evento</small> |
| <a id="PMB000028"></a>`PMB000028` | 404 | **Not found**<br/>Notification configuration not found<br/><small>Configuração de notificação já não encontrada</small> |
| <a id="PMB000029"></a>`PMB000029` | 403 | **Forbidden**<br/>User does not own this callback<br/><small>Callback não pertence a este usuário</small> |
| <a id="PMB000030"></a>`PMB000030` | 429 | **Too Many Requests**<br/>SMS per second threshold has been reached.<br/><small>O limiar de SMS por segundo foi atingido.</small> |
| <a id="PMB000031"></a>`PMB000031` | 400 | **Bad Request**<br/>A client_integration_key must be provided<br/><small>Uma client_integration_key deve ser fornecida</small> |
| <a id="PMB000032"></a>`PMB000032` | 400 | **Bad Request**<br/>Selected timeframe should have a maximum of 14 days<br/><small>O intervalo de tempo selecionado deve ter no máximo 14 dias</small> |
| <a id="PMB000033"></a>`PMB000033` | 400 | **Bad Request**<br/>'template_id' must be an integer<br/><small>'template_id' deve ser um inteiro</small> |
| <a id="PMB000034"></a>`PMB000034` | 400 | **Bad Request**<br/>This resource is temporary unavailable<br/><small>Este recurso está temporariamente indisponível</small> |

### PXT — Pix

185 errors

| Code | HTTP | Message |
|-|-|-|
| <a id="PXT000002"></a>`PXT000002` | - | **Person is not Account Owner**<br/>Person {person_key} is not account owner<br/><small>A pessoa {person_key} não é dona da conta</small> |
| <a id="PXT000003"></a>`PXT000003` | - | **Account is Closed**<br/>Account {account_key} is closed<br/><small>Conta {account_key} está fechada</small> |
| <a id="PXT000004"></a>`PXT000004` | - | **Account not found**<br/>Account not found for: {account_datum}<br/><small>Conta não encontrada para: {account_datum}</small> |
| <a id="PXT000005"></a>`PXT000005` | - | **Account not found**<br/>Account not found for pix key: {pix_key}<br/><small>Conta não encontrada para chave pix: {pix_key}</small> |
| <a id="PXT000006"></a>`PXT000006` | - | **Account not found**<br/>Account was not provided for this query<br/><small>Chave de identificação da conta não foi fornecida</small> |
| <a id="PXT000008"></a>`PXT000008` | - | **Invalid Permission**<br/>Person {person_key} does not have administration roles for account {account_key}<br/><small>Pessoa {person_key} não tem permissões de administrador para a conta {account_key}</small> |
| <a id="PXT000009"></a>`PXT000009` | - | **Person Not Found**<br/>Person with document number {person_document_number} not found<br/><small>Pessoa com número de documento {person_document_number} não encontrada</small> |
| <a id="PXT000010"></a>`PXT000010` | - | **Account is Blocked**<br/>Account {account_key} is blocked<br/><small>Conta {account_key} está bloqueada</small> |
| <a id="PXT000011"></a>`PXT000011` | - | **Account Type Mismatch**<br/>Given account type does not match one registered<br/><small>O tipo de conta fornecido não condiz com o registrado</small> |
| <a id="PXT000012"></a>`PXT000012` | - | **Invalid Document Number**<br/>Given {document_number} document number is invalid<br/><small>CPF/CNPJ {document_number} fornecido não é valido</small> |
| <a id="PXT0000126"></a>`PXT0000126` | - | **Error on qr code decode**<br/>There was an error on decode qr code<br/><small>Houve um erro ao decodificar o qr code</small> |
| <a id="PXT0000127"></a>`PXT0000127` | - | **Invalid Reversal Reason**<br/>Reversal reason {reversal_reason} is not valid<br/><small>Razão de reversão {reversal_reason} não é válida</small> |
| <a id="PXT000013"></a>`PXT000013` | - | **Account Validation Failure**<br/>Account validation for received end_to_end_id is not valid<br/><small>Validação da conta para o end_to_end_id recebido não é válida</small> |
| <a id="PXT000014"></a>`PXT000014` | - | **Target Account mismatch**<br/>Received target account data doesn<br/><small>Dados da conta de destino recebida não corresponde à conta validada</small> |
| <a id="PXT000015"></a>`PXT000015` | - | **Reversal date expired**<br/>Reversal original transaction is older than 90 days<br/><small>A data de criação da transação original é mais antiga que 90 dias</small> |
| <a id="PXT000016"></a>`PXT000016` | - | **Reversal Account Flow Mismatch**<br/>Reversal account flow does not match original pix transfer<br/><small>O fluxo de contas de destino e de origem não correspondem ao da transação original</small> |
| <a id="PXT000017"></a>`PXT000017` | - | **Reversal Too Great**<br/>Reversal transfers sum amount surpasses that of original pix transfer<br/><small>A soma das transações de devolução ultrapassam o valor da transação pix original</small> |
| <a id="PXT000018"></a>`PXT000018` | - | **Reversal Original Transfer not Found**<br/>Reversal original pix transfer not found<br/><small>Transferência original da devolução não foi encontrada</small> |
| <a id="PXT000019"></a>`PXT000019` | - | **Chargeback Validation Failure**<br/>Previously done validation values do match with incoming chargeback<br/><small>Os valores da atual devolução não correspondem com aqueles das validação</small> |
| <a id="PXT000020"></a>`PXT000020` | - | **Incoming PIX Validation Not Found**<br/>No previously done validation was found for given end to end id<br/><small>Não se encontrou validação anterior para o id ponta-a-ponta provido</small> |
| <a id="PXT000021"></a>`PXT000021` | - | **Incoming Validation Already Done**<br/>There<br/><small>A validação para o id ponta a ponta {end_to_end_id} já foi feita</small> |
| <a id="PXT000022"></a>`PXT000022` | - | **Wrong ISPB**<br/>ISPB is different from 32402502<br/><small>ISPB é diferente de 32402502</small> |
| <a id="PXT000023"></a>`PXT000023` | - | **Outgoing PIX Transfer Not Found**<br/>Pix transfer key {pix_transfer_key} was not found<br/><small>Transferência PIX de saída com chave {pix_transfer_key} não foi encontrada</small> |
| <a id="PXT000024"></a>`PXT000024` | - | **PIX Transfer Not Pending Confirmation**<br/>Pix transfer {pix_transfer_key} is not pending confirmation<br/><small>Transferência PIX {pix_transfer_key} não está aguardando confirmação</small> |
| <a id="PXT000025"></a>`PXT000025` | - | **Invalid pix transfer key**<br/>Pix transfer {pix_transfer_key} is not pending confirmation or does not exist<br/><small>Transferência PIX {pix_transfer_key} não está aguardando confirmação ou não existe</small> |
| <a id="PXT000026"></a>`PXT000026` | - | **Search Params Error**<br/>Invalid integer value for page or size querystring parameters<br/><small>Valor inválido para parâmetros de página ou tamanho de página</small> |
| <a id="PXT000027"></a>`PXT000027` | - | **Invalid Permission**<br/>Selected Person does not have administration roles<br/><small>Pessoa selecionada não tem credencial de administrador</small> |
| <a id="PXT000028"></a>`PXT000028` | - | **Account Key can not be null when search for config fees**<br/>Account key can not be null when search for config fees<br/><small>A chave de conta não pode ser nula quando buscar por configurações de tarifa</small> |
| <a id="PXT000029"></a>`PXT000029` | - | **Invalid Value for Enumerator Type**<br/>Invalid value {value} used for enumerator type {enumerator}<br/><small>Valor inválido {value} para o tipo de enumerador {enumerator}</small> |
| <a id="PXT000030"></a>`PXT000030` | - | **To update or delete a fee configuration must be provided a valid fee ID**<br/>To update or delete a fee configuration must be provided a valid fee ID. ID provided: {identification}<br/><small>Para atualizar ou remover uma configuração de tarifa deve ser fornecido um ID válido. ID fornecido: {identification}</small> |
| <a id="PXT000031"></a>`PXT000031` | - | **Fee configuration already exists**<br/>Fee configuration already exists for {person_owner_type} account with: purpose= {purpose} and {transfer_type}. Please use update<br/><small>Configuração de tarifa já existe para conta {person_owner_type} com: finalidade= {purpose} e {transfer_type}. Por favor utilize o update</small> |
| <a id="PXT000032"></a>`PXT000032` | - | **Unable To Delete Default Configuration**<br/>Unable To Delete Default Configuration. Please use update<br/><small>Não é permitido deletar uma configuração default. Por favor utilize o update</small> |
| <a id="PXT000033"></a>`PXT000033` | - | **Target Account Must Not Be Source Account**<br/>Target Account Must Not Be Source Account<br/><small>A conta de destino não pode ser a conta de origem</small> |
| <a id="PXT000034"></a>`PXT000034` | - | **Account Key Must Not Be Null**<br/>You Need To Define An Account Key To Create A Fee Configuration<br/><small>É necessário definir uma chave de conta para definir uma configuração de tarifa para a mesma</small> |
| <a id="PXT000035"></a>`PXT000035` | - | **Limit configuration already exists**<br/>Limit configuration already exists for {account_key} account for period(s) {existing_limit_periods}. Please use update<br/><small>Configuração de limite já existe para conta {account_key} para o período(s) {existing_limit_periods}. Por favor utilize o update</small> |
| <a id="PXT000036"></a>`PXT000036` | - | **No limit configuration found. Please set default configurations**<br/>No limit configuration found. Please set default configurations for {person_type} person<br/><small>Não foi possível encontrar configurações de limite, favor utilizar configurações padrões para {person_type}</small> |
| <a id="PXT000037"></a>`PXT000037` | - | **Person Not Found**<br/>Person with key {person_key} not found<br/><small>Pessoa com chave {person_key} não encontrada</small> |
| <a id="PXT000038"></a>`PXT000038` | - | **Not enough balance**<br/>Not enough balance to pay for incoming pix fee<br/><small>Saldo insuficiente para pagar por tarifa de pix de entrada</small> |
| <a id="PXT000039"></a>`PXT000039` | - | **Invalid Batch Limit Configuration**<br/>Received {} wrong configuration(s) for accounts: {}. Configurations must be None or positive float<br/><small>Recebido {} configuração(ões) erradas para contas: {}. Configurações devem ser None ou float positivo</small> |
| <a id="PXT000040"></a>`PXT000040` | - | **Bad Request**<br/>Amount limit must be null, positive float or int. Sent {limit}<br/><small>Limite deve ser nulo, positivo inteiro ou decimal. Sent {limit}</small> |
| <a id="PXT000041"></a>`PXT000041` | - | **Not Found**<br/>Qr Code not found<br/><small>Qr Code não encontrado</small> |
| <a id="PXT000042"></a>`PXT000042` | - | **Bad Request**<br/>There is no ISPB number for this Bank Code<br/><small>Não existe código ISPB para esse Bank Code</small> |
| <a id="PXT000043"></a>`PXT000043` | - | **Bad Request**<br/>Invalid decimal amount, sent {number}<br/><small>Valor decimal inválido, enviado {number}</small> |
| <a id="PXT000044"></a>`PXT000044` | - | **Not Found**<br/>Pix Key {pix_key} is not activated<br/><small>Chave PIX {pix_key} não está ativada</small> |
| <a id="PXT000045"></a>`PXT000045` | - | **Not Found**<br/>QR Code Payment is invalid for Receiver Conciliation ID {receiver_conciliation_id}<br/><small>Pagamento via QR Code é inválido para Cliente Recebedor {receiver_conciliation_id}</small> |
| <a id="PXT000046"></a>`PXT000046` | - | **Bad Request**<br/>Invalid value for<br/><small>Valor inválido para o query parameter</small> |
| <a id="PXT000047"></a>`PXT000047` | - | **Bad Request**<br/>{field_name} could not be larger than {max_length} characters<br/><small>{field_name} não pode ser maior que {max_length} caracteres</small> |
| <a id="PXT000048"></a>`PXT000048` | - | **Bad Request**<br/>Emoji not allowed in pix message<br/><small>Emoji não é permitido na mensagem pix</small> |
| <a id="PXT000049"></a>`PXT000049` | - | **Bad Request**<br/>When paying QR Code end_to_end_id could not be none<br/><small>Ao pagar um QR Code o end_to_end_id não pode ser nulo</small> |
| <a id="PXT000050"></a>`PXT000050` | - | **Bad Request**<br/>Could not read QR Code type, please try to read qr_code again<br/><small>Não foi possível ler o tipo de QR Code. Favor tente ler o qr_code outra vez</small> |
| <a id="PXT000051"></a>`PXT000051` | - | **Invalid Requester Configuration Info**<br/>The configuration {configuration} format sent is not valid<br/><small>O formato enviado da configuração {configuration} não é válido</small> |
| <a id="PXT000052"></a>`PXT000052` | - | **Bad Request**<br/>Only Master QI Tech can change default limits configurations<br/><small>Apenas o Master QI Tech pode alterar as configurações de limites padrões</small> |
| <a id="PXT000053"></a>`PXT000053` | - | **Bad Request**<br/>QrCode already paid<br/><small>Qr Code já Pago</small> |
| <a id="PXT000054"></a>`PXT000054` | - | **Bad Request**<br/>Invalid Pix Key, sent {pix_key}<br/><small>Chave pix inválida, enviado {pix_key}</small> |
| <a id="PXT000055"></a>`PXT000055` | - | **Pix error**<br/>Invalid Limit Type Sent<br/><small>Tipo inválido de limite enviado</small> |
| <a id="PXT000056"></a>`PXT000056` | - | **Bad Request**<br/>Only Master QI Tech can handle limit events<br/><small>Apenas o Master QI Tech pode alterar eventos de limites</small> |
| <a id="PXT000057"></a>`PXT000057` | - | **Bad Request**<br/>Invalid request_key or no request found, request_key sent {request_key}<br/><small>requisição inválida ou requisição não encontrado, requisição enviada {request_key}</small> |
| <a id="PXT000058"></a>`PXT000058` | - | **Bad Request**<br/>When limit request is rejected, rejected reason could not be null<br/><small>Quando uma requisição de limite é rejeitada, o motivo não pode ser nulo</small> |
| <a id="PXT000059"></a>`PXT000059` | - | **Bad Request**<br/>Target document number is not account owner document number<br/><small>O documento infomado não é o mesmo da conta de destino</small> |
| <a id="PXT000060"></a>`PXT000060` | - | **Bad Request**<br/>Nonexistent account in destination bank<br/><small>Conta inexistente no banco de destino</small> |
| <a id="PXT000061"></a>`PXT000061` | - | **Conflict**<br/>End to end id invalid. A pix transfer with the end to end id {end_to_end} has already been registered!<br/><small>End to end id inválido. Uma transação pix com o identificador único {end_to_end} já foi registrada!</small> |
| <a id="PXT000062"></a>`PXT000062` | - | **Conflict**<br/>Missing fields detected on jd connector response: {response}<br/><small>Campos faltantes detectados em resposta do JD connector: {response}</small> |
| <a id="PXT000063"></a>`PXT000063` | - | **Conflict**<br/>Unexpected response: {response}<br/><small>Resposta inesperada: {response}</small> |
| <a id="PXT000064"></a>`PXT000064` | - | **Bad Request**<br/>For Manual Pix Transfer Type a target account must be provided<br/><small>Para transação pix do tipo manual, uma conta destino deve ser fornecida</small> |
| <a id="PXT000065"></a>`PXT000065` | - | **Bad Request**<br/>Pix transfer sent was already rejected. Rejection_reason: {error_description}<br/><small>Pix transfer já rejeitada. Motivo da rejeição: {error_description_translated}</small> |
| <a id="PXT000067"></a>`PXT000067` | - | **Pix Key is Unregistered**<br/>Pix key {pix_key} is not currently used<br/><small>A chave pix {pix_key} não está sendo utilizada</small> |
| <a id="PXT000068"></a>`PXT000068` | - | **Pix Key is Unregistered**<br/>Pix key inquiry timeout. Please try again<br/><small>Consulta de chave pix excedeu o tempo limite. Por favor tente novamente</small> |
| <a id="PXT000069"></a>`PXT000069` | - | **Error in Qr Code Payload Request**<br/>An error occurred while requesting the qr code payload to the registry institution<br/><small>Um erro ocorreu durante a requisição do payload do qr code para a instituição de registro</small> |
| <a id="PXT000070"></a>`PXT000070` | - | **Invalid Qr Code Format**<br/>The Qr Code format is invalid, please enter a valid Qr Code<br/><small>O formato do Qr Code é inválido, por favor insira um Qr Code válido</small> |
| <a id="PXT000071"></a>`PXT000071` | - | **Invalid Qr Code Type**<br/>The Qr Code payload given did not provide a propper Qr Code type<br/><small>O payload de QR Code fornecido não contêm um tipo de Qr Code Válido</small> |
| <a id="PXT000072"></a>`PXT000072` | - | **Pending Transfer**<br/>The transaction ({end_to_end_id}) could not be completed and is pending confirmation<br/><small>Não foi possível concluir a transação ({end_to_end_id}) e ela está pendente de confirmação</small> |
| <a id="PXT000073"></a>`PXT000073` | - | **Outgoing PIX Transfer Not Found**<br/>Pix transfer end to end id {end_to_end_id} was not found<br/><small>Transferência PIX de saída com identificador único {end_to_end_id} não foi encontrada</small> |
| <a id="PXT000074"></a>`PXT000074` | - | **Invalid Transaction Status**<br/>Unable to update transaction status. The status {status} is invalid<br/><small>Não foi possível atualizar o status da transação. O status {status} é invalido</small> |
| <a id="PXT000075"></a>`PXT000075` | - | **Pix Transfer Key or End To End Not Provided**<br/>No pix transfer key or end to end id provided<br/><small>Não foram fornecidos uma pix transfer key ou end to end id</small> |
| <a id="PXT000076"></a>`PXT000076` | - | **Incoming PIX Transfer Not Found**<br/>Pix transfer key {pix_transfer_key} was not found<br/><small>Transferência PIX de entrada com chave {pix_transfer_key} não foi encontrada</small> |
| <a id="PXT000077"></a>`PXT000077` | - | **Pix Transfer Receipt not allowed**<br/>Pix Transfer Receipt cannot be generated for rejected transfers<br/><small>Recibo de transação pix não pode ser gerado para transações rejeitadas</small> |
| <a id="PXT000078"></a>`PXT000078` | - | **Pix Transfer Receipt not available**<br/>Receipt not available due to pix transfer currently being processed. Wait a few minutes and try again<br/><small>Comprovante não disponível pois transação Pix está em processamento. Por favor, aguarde alguns minutos e tente novamente</small> |
| <a id="PXT000079"></a>`PXT000079` | - | **Bad Request**<br/>Insufficient billing account balance for fee<br/><small>Saldo de conta de cobrança insuficiente para a taxa</small> |
| <a id="PXT000080"></a>`PXT000080` | - | **Bad Request**<br/>Could not complete the transaction and the transaction was rejected<br/><small>Não foi possível concluir a transação e a transferência foi rejeitada</small> |
| <a id="PXT000081"></a>`PXT000081` | - | **Bad Request**<br/>Pix key not sent<br/><small>Chave PIX não enviada</small> |
| <a id="PXT000082"></a>`PXT000082` | - | **Bad Request**<br/>The sent PIX key {pix_key} does not match the decoded PIX key<br/><small>A chave PIX enviada {pix_key} não coincide com a chave PIX decodificada</small> |
| <a id="PXT000083"></a>`PXT000083` | - | **Bad Request**<br/>Pix rejected.<br/><small>Pix rejeitado.</small> |
| <a id="PXT000084"></a>`PXT000084` | - | **Original Pix Transfer Was Not Found**<br/>Original Pix Transfer Was Not Found<br/><small>A transação PIX original não foi encontrada</small> |
| <a id="PXT000085"></a>`PXT000085` | - | **Invalid Permission**<br/>User do not has sufficient permissions<br/><small>Usuário não tem permissões suficientes</small> |
| <a id="PXT000086"></a>`PXT000086` | - | **Update Default Failed**<br/>To update default requester configuration send default as requester_key in url<br/><small>Para alterar a configuracao de requester padrao, envie default como requester_key na url</small> |
| <a id="PXT000087"></a>`PXT000087` | - | **Amount limit not approved try a lower value**<br/>Amount limit for {person_type} person not approved, please try a lower value<br/><small>Limite total não aprovado para pessoa {person_type}, por favor tente um menor</small> |
| <a id="PXT000088"></a>`PXT000088` | - | **Bad Request**<br/>Invalid account information when translating to account DTO<br/><small>Informações da conta inválidas na tradução do DTO</small> |
| <a id="PXT000089"></a>`PXT000089` | - | **Incoming Pix not pending**<br/>Incoming Pix with pix transfer key {pix_transfer_key} is not pending<br/><small>Transferência de Entrada PIX {pix_transfer_key} não está pendente</small> |
| <a id="PXT000090"></a>`PXT000090` | - | **Service Unavailable**<br/>Pix transfer is not available right now. Please wait or use TED service<br/><small>Transferência Pix não esta disponível no momento. Favor aguardar ou utilizar TED</small> |
| <a id="PXT000091"></a>`PXT000091` | - | **Bad Request**<br/>System account has no limits. Account key {account_key} is system account<br/><small>Contas de sistema não possuem limite. Chave de conta {account_key} é conta de sistema</small> |
| <a id="PXT000092"></a>`PXT000092` | - | **Invalid Account Type**<br/>Pix is not yet implemented for non-checking or non-escrow account types<br/><small>Transações Pix não estão implementadas para conta que não sejam escrow ou livres</small> |
| <a id="PXT000093"></a>`PXT000093` | - | **Bad Request**<br/>Fee must be either fixed_amount or percentage<br/><small>Tarifas fixas e percentuais são multualmente exclusivas</small> |
| <a id="PXT000094"></a>`PXT000094` | - | **Bad Request**<br/>Failed to fetch transactions by origin key<br/><small>Falha ao obter transações por origin key</small> |
| <a id="PXT000095"></a>`PXT000095` | - | **Unforeseen Error Scenario on Reprocess**<br/>Scenario: pix_transfer_key: {pix_transfer_key}, pix_status: {pix_status}, bacen_status: {bacen_status}, internal_tx: {internal_tx}, reverse_tx: {reverse_tx}, external_tx: {external_tx}<br/><small>Cenário: pix_transfer_key: {pix_transfer_key}, pix_status: {pix_status}, bacen_status: {bacen_status}, internal_tx: {internal_tx}, reverse_tx: {reverse_tx}, external_tx: {external_tx}</small> |
| <a id="PXT000096"></a>`PXT000096` | - | **Expectation Failed**<br/>Unexpected error trying to reprocess external transaction for outgoing Pix {pix_transfer_key}<br/><small>Erro inesperado ao tentar refazer transação externa de saída Pix {pix_transfer_key}</small> |
| <a id="PXT000097"></a>`PXT000097` | - | **Expectation Failed**<br/>Unexpected error trying to reprocess reverse transaction for outgoing Pix {pix_transfer_key}<br/><small>Erro inesperado ao tentar refazer transação reversa de saída Pix {pix_transfer_key}</small> |
| <a id="PXT000098"></a>`PXT000098` | - | **Expectation Failed**<br/>Unexpected subtype encountered: {subtype}<br/><small>Subtipo inesperado encontrado: {subtype}</small> |
| <a id="PXT000099"></a>`PXT000099` | - | **Error retrieving account data**<br/>Error while retrieving data for account_key {account_key}<br/><small>Erro ao recolher informações da conta {account_key}</small> |
| <a id="PXT000100"></a>`PXT000100` | - | **Rejected by external analysis**<br/>The transaction was rejected by external analysis<br/><small>A transação foi rejeitada pela análise externa</small> |
| <a id="PXT000101"></a>`PXT000101` | - | **Bad Request**<br/>It is not allowed to set a maximum or a minumum value to a fixed amount fee<br/><small>Não é permitido inserir valores de mínimo e máximo para tarifas de valor fixo</small> |
| <a id="PXT000102"></a>`PXT000102` | - | **Invalid caas_client_key**<br/>There caas_client_key is not valid<br/><small>A caas_client_key enviada não é válida</small> |
| <a id="PXT000103"></a>`PXT000103` | - | {key} was not accepted for not being a valid uuid v4 string<br/><small>{key} não foi aceito por não ser uma palavra uuid v4 válida</small> |
| <a id="PXT000104"></a>`PXT000104` | - | **Invalid Transaction Amount**<br/>Transaction amount of {transaction_amount} is not valid. It must be a positive value with at maximum 2 decimal places<br/><small>O valor de transação {transaction_amount} não é válido. Deve ser um valor positivo com no máximo duas casas decimais</small> |
| <a id="PXT000105"></a>`PXT000105` | - | **Invalid end_to_end_id**<br/>The end_to_end_id sent {end_to_end_id} is not valid<br/><small>O end_to_end_id enviado {end_to_end_id} não é válido</small> |
| <a id="PXT000106"></a>`PXT000106` | - | **Failed to load pix limit used**<br/>Failed to load pix limit used. Please try again. If the problem persists contact our support<br/><small>Falha ao carregar limite pix utilizado. Caso o problema persista, por favor contate nosso suporte</small> |
| <a id="PXT000107"></a>`PXT000107` | - | **Failed to load pix limit configuration**<br/>Failed to load pix limit configuration. Please try again. If the problem persists contact our support<br/><small>Falha ao carregar configuração de limite pix. Caso o problema persista, por favor contate nosso suporte</small> |
| <a id="PXT000108"></a>`PXT000108` | - | **Bad Request**<br/>Billing account closed or blocked<br/><small>Conta de cobrança encerrada ou bloqueada</small> |
| <a id="PXT000109"></a>`PXT000109` | - | **Bad Request**<br/>request_control_key {request_control_key} already in use<br/><small>request_control_key {request_control_key} já utilizada</small> |
| <a id="PXT000110"></a>`PXT000110` | - | **Failed external analysis**<br/>The transaction failed to be validated by external analysis<br/><small>A transação foi rejeitada falhou em ser validada pela análise externa</small> |
| <a id="PXT000111"></a>`PXT000111` | - | **Bad Request**<br/>invalid pix transfer type sent<br/><small>Tipo de transação pix inválida</small> |
| <a id="PXT000112"></a>`PXT000112` | - | **Bad Request**<br/>Receiver Conciliation id sent does not match expected<br/><small>Número de conciliação do recebedor não atende ao esperado</small> |
| <a id="PXT000113"></a>`PXT000113` | - | **Bad Request**<br/>It has been identified by request_control_key or end_to_end_id that this request is already being processed<br/><small>Foi identificado por request_control_key ou end_to_end_id que está requisição está sendo processada</small> |
| <a id="PXT000114"></a>`PXT000114` | - | **Bad Request**<br/>Requester Configuration already exists for {requester_key}<br/><small>Requester Configuration já existe para o {requester_key}</small> |
| <a id="PXT000115"></a>`PXT000115` | - | **Bad Request**<br/>Insufficient account balance for transfer and fee amount<br/><small>Saldo de conta insuficiente para a transação e a taxa</small> |
| <a id="PXT000117"></a>`PXT000117` | - | **Pix Transfer Pending**<br/>An error occurred while sending pix_transfer {pix_transfer.pix_transfer_key} to SPI<br/><small>Um erro ocorreu ao enviar a pix_transfer {pix_transfer.pix_transfer_key} ao SPI</small> |
| <a id="PXT000118"></a>`PXT000118` | - | **Requester is not Pix Participant**<br/>The requester sent an alias key but is not a indirect pix participant<br/><small>O requisitante enviou uma alias key no entanto não é um participante do pix indireto</small> |
| <a id="PXT000119"></a>`PXT000119` | - | **Requester is not account Owner**<br/>The requester is not the owner for the account sent<br/><small>O requisitante não é dono da conta enviada</small> |
| <a id="PXT000120"></a>`PXT000120` | - | **Alias sent not found**<br/>Alias key attached to this account not found<br/><small>Alias key vinculada à conta não encontrada</small> |
| <a id="PXT000121"></a>`PXT000121` | - | **Pix Transfer Direction Invalid**<br/>Pix transfer direction must be either outgoing or incoming<br/><small>Pix transfer direction deve ser outgoing ou incoming</small> |
| <a id="PXT000122"></a>`PXT000122` | - | **Pix Transfer key or Request Control Key needed**<br/>A pix_transfer_key or a request_control_key must be provided<br/><small>Uma pix_transfer_key ou uma request_control_key deve ser fornecida</small> |
| <a id="PXT000123"></a>`PXT000123` | - | **Invalid Timestamp Format sent**<br/>Given parameter is not in the correct format {timestamp_format}<br/><small>Parametro enviado não está no formato correto {timestamp_format}</small> |
| <a id="PXT000124"></a>`PXT000124` | - | **Outgoing Pix Transfer not found**<br/>Given parameters returned no results found<br/><small>Parâmetros enviados não retornaram resultados</small> |
| <a id="PXT000125"></a>`PXT000125` | - | **Incoming Pix Transfer not found**<br/>Given parameters returned no results found<br/><small>Parâmetros enviados não retornaram resultados</small> |
| <a id="PXT000128"></a>`PXT000128` | - | **Bad Request**<br/>Pix key {pix_key} sent does match inquiry pix key. Verify if end_to_end_id sent is correct<br/><small>Chave Pix {pix_key} enviada não condiz com consulta. Verifique se end_to_end_id enviado está correto</small> |
| <a id="PXT000129"></a>`PXT000129` | - | **SPI Error message**<br/>Message rejected by SPI-ICOM<br/><small>Mensagem rejeitada pela SPI-ICOM</small> |
| <a id="PXT000130"></a>`PXT000130` | - | **SPI Timeout Control**<br/>SPI Timeout Control<br/><small>Controle de timeout no SPI</small> |
| <a id="PXT000131"></a>`PXT000131` | - | **Receiver Internal Error**<br/>Cancelled transaction due to receiver<br/><small>Transação interrompida devido a erro no PSP do Recebedor</small> |
| <a id="PXT000132"></a>`PXT000132` | - | **Invalid Target Account Number**<br/>Target account number is invalid<br/><small>Número da conta de destino é inexistente ou inválido</small> |
| <a id="PXT000133"></a>`PXT000133` | - | **Blocked Target Account**<br/>Target account is blocked<br/><small>A conta de destino encontra-se bloqueada</small> |
| <a id="PXT000134"></a>`PXT000134` | - | **Closed Target Account**<br/>Target account is closed<br/><small>A conta de destino encontra-se encerrada</small> |
| <a id="PXT000135"></a>`PXT000135` | - | **Unsupported Transaction**<br/>Unsupported transaction for given target account<br/><small>A conta de destino não suporta este tipo de transação</small> |
| <a id="PXT000136"></a>`PXT000136` | - | **Invalid Participant**<br/>SPI participant is not PSP settler agent of payer nor receiver<br/><small>Participante direto do SPI não é liquidante do PSP do Pagador / Recebedor</small> |
| <a id="PXT000137"></a>`PXT000137` | - | **Zero Value Payment Order**<br/>Zero value payment order<br/><small>Ordem de pagamento com valor zero</small> |
| <a id="PXT000138"></a>`PXT000138` | - | **Insufficient Funds**<br/>Insufficient funds in PI account from payer<br/><small>Saldo insuficiente na conta PI do pagador</small> |
| <a id="PXT000139"></a>`PXT000139` | - | **Return Value Too Great**<br/>Return value greater than corresponding payment order<br/><small>Valor de devolução acima do valor de pagamento correspondente</small> |
| <a id="PXT000140"></a>`PXT000140` | - | **Invalid Transactions Number**<br/>Invalid transactions number<br/><small>Quantidade de transações inválida</small> |
| <a id="PXT000141"></a>`PXT000141` | - | **Unrelated Beneficiary Document Number**<br/>Beneficiary document number is not that of target account owner<br/><small>CPF/CNPJ do usuário recebedor não é compatível com o titular da conta de destino</small> |
| <a id="PXT000142"></a>`PXT000142` | - | **Invalid Beneficiary Document Number**<br/>Invalid beneficiary document number<br/><small>CPF/CNPJ da conta de destino está incorreto</small> |
| <a id="PXT000143"></a>`PXT000143` | - | **Incorrect Message Element**<br/>Incorrect message element<br/><small>Elemento da mensagem incorreto</small> |
| <a id="PXT000144"></a>`PXT000144` | - | **Rejected Payment Order**<br/>Beneficiary<br/><small>Ordem de pagamento foi rejeitada pelo banco recebedor</small> |
| <a id="PXT000145"></a>`PXT000145` | - | **Unauthorized Payer**<br/>Signing participant is unauthorized to make a payment order for paying account<br/><small>Participante que assinou a mensagem não é autorizado a realizar a operação na conta PI</small> |
| <a id="PXT000146"></a>`PXT000146` | - | **Invalid Datetime**<br/>Invalid datetime for message delivery<br/><small>Data e Hora do envio da mensagem inválida</small> |
| <a id="PXT000147"></a>`PXT000147` | - | **Generic Error**<br/>Error while processing payment (generic error)<br/><small>Erro no processamento do pagamento (erro genérico)</small> |
| <a id="PXT000148"></a>`PXT000148` | - | **Bad Format Operation Identifier**<br/>Badly formatted operation<br/><small>Identificador da operação mal formatado</small> |
| <a id="PXT000149"></a>`PXT000149` | - | **Invalid Payer ISPB**<br/>Invalid or non-existent payer<br/><small>Número ISPB do PSP do Pagador é inválido ou inexistente</small> |
| <a id="PXT000150"></a>`PXT000150` | - | **Invalid Beneficiary ISPB**<br/>Invalid or non-existent beneficiary<br/><small>Número ISPB do banco recebedor é inválido ou inexistente</small> |
| <a id="PXT000151"></a>`PXT000151` | - | **Incorrect Type**<br/>Incorrect type for target account<br/><small>Tipo incorreto para a conta transacional especificada</small> |
| <a id="PXT000152"></a>`PXT000152` | - | **SPI Repeated E2E ID**<br/>The end_to_end_id was already used<br/><small>O end_to_end_id já foi utilizado</small> |
| <a id="PXT000153"></a>`PXT000153` | - | **Invalid Target Account Type**<br/>The target account type can not receive PIX transactions<br/><small>O tipo de conta destino não pode receber transações PIX</small> |
| <a id="PXT000154"></a>`PXT000154` | - | **Invalid ISPB**<br/>Invalid or non-existent ISPB number<br/><small>Número ISPB é inválido ou inexistente</small> |
| <a id="PXT000155"></a>`PXT000155` | - | **Amount too Great**<br/>Amount too great for credited account<br/><small>Valor de pagamento/devolução acima do permitido para a conta de destino creditada</small> |
| <a id="PXT000156"></a>`PXT000156` | - | **QR Code Rejected**<br/>QR Code rejected by beneficiary<br/><small>QR Code rejeitado pelo PSP do usuário recebedor</small> |
| <a id="PXT000157"></a>`PXT000157` | - | **Bacen Service Unavailable**<br/>Could not sent the message to ICOM after 3 retries<br/><small>Não pode enviar a mensagem para a ICOM depois de 3 tentativas</small> |
| <a id="PXT000158"></a>`PXT000158` | - | **Invalid Amount**<br/>Paid amount diverges from expected amount of {expected_amount}<br/><small>O valor do pagamento diverge do valor esperado de {expected_amount}</small> |
| <a id="PXT000159"></a>`PXT000159` | - | **QR code inactive**<br/>QR code is not active at the time of payment<br/><small>QR code não está ativo no instante do pagamento</small> |
| <a id="PXT000160"></a>`PXT000160` | - | **QR code inactive**<br/>QR code is not active at the time of payment<br/><small>QR code não está ativo no instante do pagamento</small> |
| <a id="PXT000161"></a>`PXT000161` | - |  |
| <a id="PXT000162"></a>`PXT000162` | - |  |
| <a id="PXT000163"></a>`PXT000163` | - |  |
| <a id="PXT000164"></a>`PXT000164` | - | **Unmapped Rejection Error Code**<br/>Settlement failed, unknown error reason code from receiver PSP<br/><small>Código de recusa desconhecido do PSP recebedor</small> |
| <a id="PXT000165"></a>`PXT000165` | - | **Request Control Key needed**<br/>A request_control_key must be provided<br/><small>Uma request_control_key deve ser fornecida</small> |
| <a id="PXT000166"></a>`PXT000166` | - | **Invalid Target**<br/>Account does not have permission to transfer to the given target account<br/><small>A conta não possui permissão para realizar transferências para a conta enviada</small> |
| <a id="PXT000167"></a>`PXT000167` | - | **Requester not allowed to access this endpoint**<br/>Requester has no permission to perform pix transfers on this endpoint<br/><small>Requester não possui permissão de realizar transações pix através deste endpoint</small> |
| <a id="PXT000168"></a>`PXT000168` | - | **No approver permission**<br/>Given document number does not belong to an approver for this account<br/><small>Número de documento enviado não pertence a um aprovador da conta</small> |
| <a id="PXT000169"></a>`PXT000169` | - | **tfa_info is required**<br/>Client must send object tfa_info<br/><small>Cliente deve enviar objeto tfa_info</small> |
| <a id="PXT000170"></a>`PXT000170` | - | **Error occurred while sending token**<br/>An unexpected error occurred while sending token<br/><small>Um erro inexperado ocorreu ao tentar enviar token</small> |
| <a id="PXT000171"></a>`PXT000171` | - | **Number of token validation attempts exceeded**<br/>The maximum number of failed token validation attempts has been reached<br/><small>Número máximo de tentativas de validação de token atingida</small> |
| <a id="PXT000172"></a>`PXT000172` | - | **Token Expired**<br/>Token has expired. Resend token or recreate transfer<br/><small>Token expirado. Reenvie token ou recrie a transferência</small> |
| <a id="PXT000173"></a>`PXT000173` | - | **Incorrect Token**<br/>Token sent does not match expected<br/><small>Token enviado não condiz com, o esperado</small> |
| <a id="PXT000174"></a>`PXT000174` | - | **Error Sending Token**<br/>An error occurred while sending token and its being investigated<br/><small>Um erro ocorreu ao enviar token e está sendo investigado</small> |
| <a id="PXT000175"></a>`PXT000175` | - | **Invalid Status**<br/>Pix transfer not in pending_2fa_approval status<br/><small>Pix transfer não está pendente de aprovação por autenticação de dois fatores</small> |
| <a id="PXT000176"></a>`PXT000176` | - | **Error Sending Token**<br/>An error occurred while resending token and its being investigated<br/><small>Um erro ocorreu ao reenviar token e está sendo investigado</small> |
| <a id="PXT000177"></a>`PXT000177` | - | **Pix Transfer Batch key needed**<br/>A pix_transfer_batch_key must be provided<br/><small>Uma pix_transfer_batch_key deve ser fornecida</small> |
| <a id="PXT000178"></a>`PXT000178` | - | **Pix Transfer Batch not found**<br/>A pix_transfer_batch not found<br/><small>Uma pix_transfer_batch não encontrada</small> |
| <a id="PXT000179"></a>`PXT000179` | - | **Empty pix-transfer list received**<br/>A list of pix transfers must be provided<br/><small>Uma lista de transferências pix deve ser fornecida</small> |
| <a id="PXT000180"></a>`PXT000180` | - | **Invalid Status**<br/>Pix transfer Batch not in pending_2fa_approval status<br/><small>Pix transfer em lote não está pendente de aprovação por autenticação de dois fatores</small> |
| <a id="PXT000181"></a>`PXT000181` | - | **Target PSP Timeout**<br/>Beneficiary<br/><small>Timeout do participante recebedor da ordem de pagamento</small> |
| <a id="PXT000182"></a>`PXT000182` | - | **Bad Request**<br/>The given Pix transfer is tied to a batch. It cannot be individually approved. Please approve batch<br/><small>A Pix transfer enviada está ligada a um lote. Ela não pode ser individualmente aprovada. Por favor aprove o lote</small> |
| <a id="PXT000183"></a>`PXT000183` | - | **Invalid Person Type**<br/>Natural Person Cannot Pay for a PIX Fee<br/><small>Pessoa Física não pode pagar tarifa de PIX</small> |
| <a id="PXT000184"></a>`PXT000184` | - | **Outgoing PIX Transfer must hold to be reprocessed**<br/>Pix transfer key {pix_transfer_key} must wait to be reprocessed<br/><small>Transferência PIX de saída com chave {pix_transfer_key} deve aguardar para ser reprocessada</small> |
| <a id="PXT000185"></a>`PXT000185` | - | **Invalid Limit Request Status**<br/>Invalid limit request status to perform request<br/><small>Status de requisição de limite pix inválida para realizar operação</small> |
| <a id="PXT000186"></a>`PXT000186` | - | **Invalid pix transfer Status**<br/>Invalid pix transfer status to perform request<br/><small>Status de pix inválido para realizar operação</small> |
| <a id="PXT000187"></a>`PXT000187` | - | **Reprocessing Blocked. Reversal Transaction Detected**<br/>Pix transfer cannot be reprocessed due to reversal being detected<br/><small>Pix transfer não pode ser reprocessda devido a presença de reversal</small> |
| <a id="PXT000188"></a>`PXT000188` | - | **Session ID needed**<br/>A session_id must be provided<br/><small>Uma session_id deve ser fornecida</small> |
| <a id="PXT000189"></a>`PXT000189` | - | **Token Required**<br/>A token is required for SMS or email validation.<br/><small>Um token é necessário para validação via SMS ou email.</small> |

---

# Cancel payment scheduling batch

URL: /en/documentation/baas/cobranca/2fa_v2/agendamento/cancelar_agendamento_em_lote_de_pagamento

This endpoint allows cancelar um batch de scheduling de payments enquanto o batch estiver em status cancelável.

:::info Boleto bancário
É o bank slip convencional (linhas digitáveis não iniciadas com dígito 8). Possui registro na Câmara Interbancária de Pagamento (CIP/Núclea) e pode ser pago em instituições financeiras e de payment autorizadas a funcionar pelo Banco Central.
:::

:::info Fatura de recolhimento
Esse tipo de cobrança é emitido por concessionárias de serviços (account de água, luz, telefone e gás) e órgãos públicos (tributos). Eles não são registrados na Câmara Interbancária de Pagamento (CIP/Núclea), por isso, não retornam as mesmas informações que um Boleto bancário apresenta.
:::

## Request

### Request Endpoint

ENDPOINT /account/ ACCOUNT_KEY /batch_payment_schedule/ BATCH_PAYMENT_SCHEDULE_KEY /cancel
METHOD PATCH

### Request Path Params

| Field                 | Type  | Description                                        | Characters |
|-----------------------|-------|--------------------------------------------------|------------|
| `account_key` *       | uuid4 | Chave única de identificação da account.           | 36         |
| `batch_payment_key` * | uuid4 | Chave única de identificação do batch de scheduling. | 36         |

## Response

### Success Response

STATUS 200

Response Body: Batch de scheduling cancelado

```json
{
  "batch_payment_schedule_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
  "total_amount": 1357.3,
  "batch_payment_schedule_status": "canceled",
  "payment_type": "bank_slip"
}
```

### Response Body Params

| Field                           | Type   | Description |
|--------------------------------|--------|-----------|
| `batch_payment_schedule_key` * | uuid4  | Chave única de identificação do batch de scheduling. |
| `request_control_key` *        | uuid4  | Chave única de identificação da request do cliente (batch). |
| `account_key` *                | uuid4  | Chave da account debitada. |
| `total_amount` *               | number | Soma dos valores dos itens do batch. |
| `batch_payment_schedule_status` * | [enum](#enumeradores-batch_payment_schedule_status) | Status do batch após a solicitação de cancelamento. |
| `payment_type` *               | [enum](#enumeradores-payment_type) | Type do payment. |

### Enumerators batch_payment_schedule_status

| Enumerator             | Description                 |
|------------------------|---------------------------|
| `pending_2fa_approval` | Pendente de aprovação 2FA |
| `scheduled`            | Scheduled                  |
| `rejected`             | Rejected                 |
| `canceled`             | Canceled                 |
| `error`                | Scheduling error           |

### Enumerators payment_type

| Enumerator        | Description              |
|-------------------|------------------------|
| `bank_slip`       | Boleto bancário        |
| `collection_slip` | Fatura de recolhimento |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Description em português",
    "code": "Código"
}
```

| Código HTTP | Código QI | Título      | Description (eng)                              | Description (pt-br)                                      |
|-------------|-----------|-------------|----------------------------------------------|--------------------------------------------------------|
| 403         | BIP000010 | Forbidden   | User is not allowed to do this action        | Usuário não tem autorização para fazer essa ação       |
| 404         | BIP000011 | Not Found   | The source account key was not found.        | A chave da account de origem não foi encontrada.         |
| 404         | BIP000083 | Not Found   | Batch payment not found by batch payment key.| Batch de payments não encontrado pela chave do batch.  |
| 400         | BIP000085 | Bad Request | Batch payment status is not pending approval.| Status do batch de payments não é de aprovação pendente. |

---

# Confirmar Agendamento de Boleto Bancário

URL: /en/documentation/baas/cobranca/2fa_v2/agendamento/confirmar_agendamento_de_boleto_bancario

Este endpoint permite realizar a confirmação do agendamento de pagamento de um boleto bancário.

:::info Boleto bancário
É o boleto bancário convencional (linhas digitáveis não iniciadas com dígito 8). Possui registro na Câmara Interbancária de Pagamento (CIP/Núclea) e pode ser pago em instituições financeiras e de pagamento autorizadas a funcionar pelo Banco Central.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /payment_schedule/ PAYMENT_SCHEDULE_KEY /bank_slip/validate_token
MÉTODO PATCH

### Request Path Params

| Campo               | Tipo    | Descrição                               | Caracteres |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` *     | uuid4   | Chave única de identificação da conta.  | 36         |
| `payment_schedule_key` * | uuid4   | Chave única de identificação do agendamento. | 36         |

Request Body: Confirmação de agendamento de boleto bancário

```json
{
  "token": "329adf"
}
```

### Body Params

| Campo               | Tipo          | Descrição                         |
|---------------------|---------------|-----------------------------------|
| `token` * | string | Código de autenticação enviado ao aprovador de movimentações da conta |

## Response

### Success Response

STATUS 200

Response Body: Agendamento confirmado

```json
{
   "payment_schedule_key":"c4325104-d60b-44f3-aae4-49155564a2ea",
   "request_control_key":"b713b2f6-2f48-4d18-b0c9-7186e4edf189",
   "payer_name":"COOPERATIVA INDUSTRIAL MURILO",
   "payer_document_number":"00037025000160",
   "source_account_key":"6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
   "paid_amount":1050.1,
   "payment_date":"2024-04-03",
   "payment_type":"bank_slip",
   "bank_slip": {
        "bank_slip_key":"95080ffd-3ac5-48d7-b3fe-659e4aaba81a",
        "barcode":"00193967000009910000000003615574000000002417",
        "digitable_line":"00190000090361557400500000024174396700000991000",
        "payer_name":"COOPERATIVA TESTE",
        "payer_document_number":"00037025000160",
        "beneficiary_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_trading_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_document_number":"52069937000117",
        "beneficiary_bank_ispb":"00000000",
        "guarantor_name":null,
        "guarantor_document_number":null,
        "expiration_date":"2024-03-29",
        "max_payment_data": "2026-03-29",
        "partial_payment_indicator":"allowed",
        "registered_payment_amount":9029.0,
        "nominal_amount":9910.0,
        "total_amount":10129.1,
        "rebate_amount":0.0,
        "discount_amount":0.0,
        "fine_amount":0.0,
        "interest_amount":219.1
    },
   "collection_slip":null,
   "payment_schedule_status":"scheduled"
}
```

### Response Body Params

| Campo               | Tipo    | Descrição                                           |
|---------------------|---------|-----------------------------------------------------|
| `payment_key` *               | uuid4 | Chave única de identificação do pagamento.          |
| `request_control_key` *       | uuid4 | Chave única de identificação da request do cliente. |
| `payer_name` *                | string | Nome do pagador efetivo.                            |
| `payer_document_number` *     | string | Número do documento do pagador efetivo (CPF/CNPJ).  |
| `source_account_key` *        | uuid4 | Chave da conta debitada.                            |
| `paid_amount` *               | number | Valor pago efetivamente.                            |
| `payment_date` *              | string | Data do pagamento.                                  |
| `payment_type` *              | [enum](#enumeradores-payment_type) | Tipo do pagamento.                                  |
| `bank_slip`                   | [object](#objeto-bank_slip) | Boleto bancário.                                    |
| `collection_slip`             | object | Fatura de recolhimento.                             |
| `payment_schedule_status` *            | [enum](#enumeradores-payment_schedule_status) | Status do agendamento.                              |

### Enumeradores payment_type
| Enumerador    | Tipo      | Descrição     |
|---------------|-----------|---------------|
| `bank_slip`     | string    | Boleto bancário    |
| `collection_slip` | string  | Fatura de recolhimento |

:::danger Aviso
O enumerador `collection_slip` não se aplica para o fluxo de boletos bancários, assim como o objeto collection_slip que sempre será nulo.
:::

### Enumeradores payment_schedule_status
| Enumerador          | Descrição                                                        |
|---------------------|------------------------------------------------------------------|
| `pending_2fa_approval` | Agendamento pendente de autenticação de dois fatores (2FA)       |
| `scheduled`          | Pagamento agendado com sucesso                                   |
| `executed`          | O agendamento foi executado com sucesso e o pagamento referente ao agendamento gerado |
| `rejected`          | O agendamento foi rejeitado e nenhum pagamento foi gerado             |
| `canceled`         | Agendamento cancelado                                            |
| `error`             | Erro ao realizar o agendamento                                   |

### Objeto bank_slip
| Campo                             | Tipo    | Descrição                         |
|-----------------------------------|---------|-----------------------------------|
| `barcode` *                       | string | Código de barras. |
| `digitable_line` *                | string | Linha digitável. |
| `payer_name` *                    | string | Nome do pagador.|
| `payer_document_number` *         | string | Número do documento do pagador (CPF/CNPJ). |
| `beneficiary_name` *              | string | Nome do beneficiário. |
| `beneficiary_trading_name`        | string | Nome fantasia do beneficiário. |
| `beneficiary_document_number` *   | string | Número do documento do beneficiário  (CPF/CNPJ). |
| `beneficiary_bank_ispb` *         | string | Código ispb do banco do beneficiário. |
| `guarantor_name`                  | string | Nome do sacador avalista. |
| `guarantor_document_number`       | string | Número do documento do sacador avalista (CPF/CNPJ). |
| `expiration_date` *               | string | Data de vencimento. |
| `max_payment_date` * | string  | Data máxima de pagamento. |
| `partial_payment_indicator` *     | [enum](#enumeradores-partial_payment_indicator)   | Indicador de pagamento parcial. |
| `registered_payment_amount`       | string | Valor total de pagamento registrado. |
| `nominal_amount` *                | number | Valor original. |
| `total_amount` *                  | number | Valor total. |
| `rebate_amount` *                 | number | Valor do batimento. |
| `discount_amount` *               | number | Valor do desconto. |
| `fine_amount` *                   | number | Valor da multa. |
| `interest_amount` *               | number | Valor do juros. |

### Enumeradores partial_payment_indicator
| Enumerador    | Tipo      | Descrição     |
|---------------|-----------|---------------|
| `allowed`     | string    | Permitido     |
| `not_allowed` | string    | Não permitido |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Descrição em português",
    "code": "Código"
}
```

| Código HTTP | Código QI | Título | Descrição (eng) | Descrição (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 403         | BIP000010 | Forbidden | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404         | BIP000011 | Not Found | The source account key was not found. | A chave da conta de origem não foi encontrada. |
| 400         | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400         | BIP000013 | Bad Request | The source account is closed. | A conta de origem está fechada. |
| 400         | BIP000014 | Bad Request | The source account is blocked. | A conta de origem está bloqueada. |
| 400         | BIP000022 | Bad Request | Bank slip payment service is closed. | Serviço de pagamento de boleto está fechado. |
| 400         | BIP000023 | Bad Request | The source account has insufficient balance. Payment cannot be made. | A conta de origem possui saldo insuficiente. Pagamento não pode ser realizado. |
| 400         | BIP000025 | Bad Request | It was not possible to pay the bank slip at this time. Please verify your information and, if necessary, contact us for assistance. | Não foi possível pagar o boleto neste momento. Por favor, verifique suas informações e, se necessário, entre em contato conosco para assistência. |
| 400         | BIP000028 | Bad Request | The source account has blocked balance. Payment cannot be made. | A conta de origem possui saldo em conta bloqueado. Pagamento não pode ser realizado. |
| 404         | BIP000056 | Not Found | Payment not found. | Pagamento não encontrado. |
| 400         | BIP000057 | Bad Request | Payment status is not pending approval. | Status de pagamento não é de aprovação pendente. |
| 400         | BIP000058 | Bad Request | Error while validating verification token | Erro ao validar token de verificação |
| 400         | BIP000059 | Bad Request | Number of verification token validation attempts exceeded. | Número de tentativas de validação de token de verificação excedido. |
| 400         | BIP000060 | Bad Request | Verification token expired. | Token de verificação expirado. |
| 400         | BIP000061 | Bad Request | Verification token validation failed. | Falha na validação do token de verificação. |
| 400         | BIP000062 | Bad Request | Payment type is not bank slip. | Tipo de pagamento não é boleto. |
| 400         | BIP000065 | Bad Request | Payment verification time window exceeded. | Janela de tempo de verificação de pagamento excedida. |

---

# Confirmação de Pagamento de Fatura de Recolhimento

URL: /en/documentation/baas/cobranca/2fa_v2/agendamento/confirmar_agendamento_de_fatura_de_recolhimento

Este endpoint permite realizar a confirmação do pagamento de faturas de recolhimento.

:::info Fatura de recolhimento
Esse tipo de cobrança é emitido por concessionárias de serviços (conta de água, luz, telefone e gás) e órgão públicos (tributos). Eles não são registrados na Câmara Interbancária de Pagamento (CIP/Núclea), por isso, não retornam as mesmas informações que um Boleto bancário apresenta.
:::

## Request

### Request Endpoint

ENDPOINT /account/ ACCOUNT_KEY /payment_schedule/ PAYMENT_SCHEDULE_KEY /collection_slip/validate_token
MÉTODO PATCH

### Request Path Params

| Campo               | Tipo    | Descrição                               | Caracteres |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` *     | uuid4   | Chave única de identificação da conta.  | 36         |
| `payment_schedule_key` * | uuid4   | Chave única de identificação do agendamento. | 36         |

Request Body: Confirmação de agendamento de fatura de recolhimento

```json
{
  "token": "329adf"
}
```

### Body Params

| Campo               | Tipo          | Descrição                         |
|---------------------|---------------|-----------------------------------|
| `token` * | string | Código de autenticação enviado ao aprovador de movimentações da conta |

## Response

### Success Response

STATUS 200

Response Body: Agendamento confirmado

```json
{
  "payment_schedule_key": "33860ad0-bcb0-47b7-bbe7-c7e3ec2fc61a",
  "request_control_key": "ae4508df-f2cb-4e28-9f04-a19b7f2758c9",
  "payer_name": "COOPERATIVA INDUSTRIAL MURILO",
  "payer_document_number": "62069937000118",
  "source_account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "paid_amount": 1389.21,
  "payment_date": "2024-04-30",
  "payment_type": "collection_slip",
  "bank_slip": null,
  "collection_slip": {
    "barcode": null,
    "digitable_line": "836200000138892100450006762142420244046000010192",
    "collection_name": "CIA ULTRAGAZ SA-COD",
    "collection_document_number": "00394460005887",
    "expiration_date": "2024-04-15",
    "total_amount": 1389.21
  },
  "payment_status": "scheduled"
}
```

### Response Body Params

| Campo               | Tipo    | Descrição                                           |
|---------------------|---------|-----------------------------------------------------|
| `payment_key` *               | uuid4 | Chave única de identificação do pagamento.          |
| `request_control_key` *       | uuid4 | Chave única de identificação da request do cliente. |
| `payer_name` *                | string | Nome do pagador efetivo.                            |
| `payer_document_number` *     | string | Número do documento do pagador efetivo (CPF/CNPJ).  |
| `source_account_key` *        | uuid4 | Chave da conta debitada.                            |
| `paid_amount` *               | number | Valor pago efetivamente.                            |
| `payment_date` *              | string | Data do pagamento.                                  |
| `payment_type` *              | [enum](#enumeradores-payment_type) | Tipo do pagamento.                                  |
| `bank_slip`                   | object | Boleto bancário.                                    |
| `collection_slip`             | [object](#objeto-collection_slip) | Fatura de recolhimento.                             |
| `payment_schedule_status` *            | [enum](#enumeradores-payment_schedule_status) | Status do agendamento.                              |

### Enumeradores payment_type
| Enumerador    | Tipo      | Descrição     |
|---------------|-----------|---------------|
| `bank_slip`     | string    | Boleto bancário    |
| `collection_slip` | string  | Fatura de recolhimento |

:::danger Aviso
O enumerador `bank_slip` não se aplica para o fluxo de faturas de recolhimento, assim como o objeto bank_slip que sempre será nulo.
:::

### Enumeradores payment_schedule_status
| Enumerador          | Descrição                                                        |
|---------------------|------------------------------------------------------------------|
| `pending_2fa_approval` | Agendamento pendente de autenticação de dois fatores (2FA)       |
| `scheduled`          | Pagamento agendado com sucesso                                   |
| `executed`          | O agendamento foi executado com sucesso e o pagamento referente ao agendamento gerado |
| `rejected`          | O agendamento foi rejeitado e nenhum pagamento foi gerado             |
| `canceled`         | Agendamento cancelado                                            |
| `error`             | Erro ao realizar o agendamento                                   |

### Objeto collection_slip
| Campo                             | Tipo    | Descrição                         |
|-----------------------------------|---------|-----------------------------------|
| `barcode`          | string | Código de barras. |
| `digitable_line`   | string | Linha digitável. |
| `collection_name` *         | string | Nome do convênio.|
| `collection_document_number`   | string | Número de documento do convênio (CPF/CNPJ).|
| `expiration_date` *  | string  | Data de vencimento. |
| `total_amount` *  | number | Valor total. |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Descrição em português",
    "code": "Código"
}
```

| Código HTTP | Código QI | Título | Descrição (eng) | Descrição (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 403         | BIP000010 | Forbidden | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404         | BIP000011 | Not Found | The source account key was not found. | A chave da conta de origem não foi encontrada. |
| 400         | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400         | BIP000013 | Bad Request | The source account is closed. | A conta de origem está fechada. |
| 400         | BIP000014 | Bad Request | The source account is blocked. | A conta de origem está bloqueada. |s
| 400         | BIP000023 | Bad Request | The source account has insufficient balance. Payment cannot be made. | A conta de origem possui saldo insuficiente. Pagamento não pode ser realizado. |
| 400         | BIP000028 | Bad Request | The source account has blocked balance. Payment cannot be made. | A conta de origem possui saldo em conta bloqueado. Pagamento não pode ser realizado. |
| 400         | BIP000036 | Bad Request | Covenant slip overdue. | Fatura de recolhimento vencida. |
| 400         | BIP000038 | Bad Request | Outside of covenant payment hours. | Fora do horário de pagamento do convênio. |
| 400         | BIP000044 | Bad Request | It was not possible to pay the collection slip at this time. Please verify your information and, if necessary, contact us for assistance. | Não foi possível pagar a fatura de recolhimento neste momento. Por favor, verifique suas informações e, se necessário, entre em contato conosco para assistência. |
| 400         | BIP000045 | Bad Request | Collection slip payment service is closed. | Serviço de pagamento de fatura de recolhimento está fechado. |
| 404         | BIP000056 | Not Found | Payment not found. | Pagamento não encontrado. |
| 400         | BIP000057 | Bad Request | Payment status is not pending approval. | Status de pagamento não é de aprovação pendente. |
| 400         | BIP000058 | Bad Request | Error while validating verification token | Erro ao validar token de verificação |
| 400         | BIP000059 | Bad Request | Number of verification token validation attempts exceeded. | Número de tentativas de validação de token de verificação excedido. |
| 400         | BIP000060 | Bad Request | Verification token expired. | Token de verificação expirado. |
| 400         | BIP000061 | Bad Request | Verification token validation failed. | Falha na validação do token de verificação. |
| 400         | BIP000063 | Bad Request | Payment type is not collection slip. | Tipo de pagamento não é fatura de recolhimento. |
| 400         | BIP000065 | Bad Request | Payment verification time window exceeded. | Janela de tempo de verificação de pagamento excedida. |

---

# Confirm bank slip batch scheduling

URL: /en/documentation/baas/cobranca/2fa_v2/agendamento/confirmar_agendamento_em_lote_de_boleto_bancario

This endpoint allows validating the two-factor authentication (2FA) token for a bank slip scheduling batch in `batch_payment_schedule_status` **`pending_2fa_approval`**.

:::info Bank slip
A traditional bank slip (digitable line does not start with 8). It is registered in the Interbank Payment Chamber (CIP/Nuclea) and can be paid through financial and payment institutions authorized by the Central Bank.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/ ACCOUNT_KEY /payment/schedule_bank_slip/ BATCH_PAYMENT_SCHEDULE_KEY /validate_token
METHOD PATCH

### Request Path Params

| Field                 | Type  | Description                                                                                | Characters |
| --------------------- | ----- | ---------------------------------------------------------------------------------------- | ---------- |
| `account_key` *       | uuid4 | Unique account identifier key.                                                   | 36         |
| `batch_payment_schedule_key` * | uuid4 | Unique batch scheduling identifier key. | 36         |

Request Body: Batch scheduling token validation

```json
{
  "token": "329adf"
}
```

### Body Params

| Field   | Type   | Description                                                                                                        | Characters |
| ------- | ------ | ---------------------------------------------------------------------------------------------------------------- | ---------- |
| `token` | string | Authentication code sent to the account transaction approver | 6          |

## Response

### Success Response

STATUS 200

Response Body: Confirmed scheduling batch

```json
{
  "batch_payment_schedule_key": "c4325104-d60b-44f3-aae4-49155564a2ea",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
  "total_amount": 1357.3,
  "batch_payment_schedule_status": "scheduled",
  "payment_type": "bank_slip"
}
```

### Response Body Params

| Field                   | Type   | Description |
| ----------------------- | ------ | --------- |
| `batch_payment_schedule_key` *   | uuid4  | Unique batch scheduling identifier key. |
| `request_control_key` * | uuid4  | Unique client request identifier key (batch). |
| `account_key` *         | uuid4  | Debited account key. |
| `total_amount` *        | number | Sum of item amounts in the batch. |
| `batch_payment_schedule_status` *        | [enum](#enumeradores-batch_payment_schedule_status) | Batch scheduling status after token validation. |
| `payment_type` *        | string | Payment type; for this flow, expected value is `bank_slip`. |

### Enumerators batch_payment_schedule_status

| Enumerator    | Description     |
|---------------|---------------|
| `pending_2fa_approval` | Pending 2FA approval |
| `scheduled`   | Scheduled |
| `rejected`    | Rejected |
| `error`       | Scheduling error |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Title",
    "description": "Description in English",
    "translation": "Description in Portuguese",
    "code": "Code"
}
```

| HTTP Code | QI Code | Title      | Description (eng)                               | Description (pt-br)                                                |
| ----------- | --------- | ----------- | --------------------------------------------- | ---------------------------------------------------------------- |
| 403         | BIP000010 | Forbidden   | User is not allowed to do this action         | User is not allowed to do this action                 |
| 404         | BIP000011 | Not Found   | The source account key was not found.         | The source account key was not found.                   |
| 400         | BIP000058 | Bad Request | Error while validating verification token     | Error while validating verification token                             |
| 400         | BIP000059 | Bad Request | Number of verification token validation attempts exceeded. | Number of verification token validation attempts exceeded. |
| 400         | BIP000060 | Bad Request | Verification token expired.                   | Verification token expired.                                   |
| 400         | BIP000061 | Bad Request | Verification token validation failed.       | Verification token validation failed.                      |
| 400         | BIP000065 | Bad Request | Payment verification time window exceeded.    | Payment verification time window exceeded.            |
| 404         | BIP000083 | Not Found   | Batch payment not found by batch payment key. | Batch payment not found by batch payment key.            |
| 400         | BIP000085 | Bad Request | Batch payment status is not pending approval. | Batch payment status is not pending approval.        |
| 400         | BIP000086 | Bad Request | A token is required for SMS or email validation. | A token is required for SMS or email validation.         |

---

# Confirm collection slip batch scheduling

URL: /en/documentation/baas/cobranca/2fa_v2/agendamento/confirmar_agendamento_em_lote_de_fatura_de_recolhimento

This endpoint allows validar o token de autenticação de dois fatores (2FA) de um batch de scheduling de collection slips em `batch_payment_schedule_status` **`pending_2fa_approval`**.

:::info Fatura de recolhimento
Esse tipo de cobrança é emitido por concessionárias de serviços (account de água, luz, telefone e gás) e órgãos públicos (tributos). Eles não são registrados na Câmara Interbancária de Pagamento (CIP/Núclea), por isso, não retornam as mesmas informações que um Boleto bancário apresenta.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/ ACCOUNT_KEY /payment/schedule_collection_slip/ BATCH_PAYMENT_SCHEDULE_KEY /validate_token
METHOD PATCH

### Request Path Params

| Field                 | Type  | Description                                                                                | Characters |
| --------------------- | ----- | ---------------------------------------------------------------------------------------- | ---------- |
| `account_key` *       | uuid4 | Chave única de identificação da account.                                                   | 36         |
| `batch_payment_schedule_key` * | uuid4 | Chave única de identificação do batch de scheduling. | 36         |

Request Body: Validação de token do batch de scheduling

```json
{
  "token": "329adf"
}
```

### Body Params

| Field   | Type   | Description                                                                                                        | Characters |
| ------- | ------ | ---------------------------------------------------------------------------------------------------------------- | ---------- |
| `token` | string | Código de autenticação enviado ao aprovador de movimentações da account | 6          |

## Response

### Success Response

STATUS 200

Response Body: Batch de scheduling confirmado

```json
{
  "batch_payment_schedule_key": "33860ad0-bcb0-47b7-bbe7-c7e3ec2fc61a",
  "request_control_key": "ae4508df-f2cb-4e28-9f04-a19b7f2758c9",
  "account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "total_amount": 1939.31,
  "batch_payment_schedule_status": "scheduled",
  "payment_type": "collection_slip"
}
```

### Response Body Params

| Field                   | Type   | Description |
| ----------------------- | ------ | --------- |
| `batch_payment_schedule_key` *   | uuid4  | Chave única de identificação do scheduling em batch. |
| `request_control_key` * | uuid4  | Chave única de identificação da request do cliente (batch). |
| `account_key` *         | uuid4  | Chave da account debitada. |
| `total_amount` *        | number | Soma dos valores dos itens do batch. |
| `batch_payment_schedule_status` *        | [enum](#enumeradores-batch_payment_schedule_status) | Status do batch de scheduling após a validação do token. |
| `payment_type` *        | string | Type do payment; para este fluxo, espera-se `collection_slip`. |

### Enumerators batch_payment_schedule_status

| Enumerator    | Description     |
|---------------|---------------|
| `pending_2fa_approval` | Pendente de aprovação 2FA |
| `scheduled`   | Scheduled |
| `rejected`    | Rejected |
| `error`       | Scheduling error |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Description em português",
    "code": "Código"
}
```

| Código HTTP | Código QI | Título      | Description (eng)                               | Description (pt-br)                                                |
| ----------- | --------- | ----------- | --------------------------------------------- | ---------------------------------------------------------------- |
| 403         | BIP000010 | Forbidden   | User is not allowed to do this action         | Usuário não tem autorização para fazer essa ação                 |
| 404         | BIP000011 | Not Found   | The source account key was not found.         | A chave da account de origem não foi encontrada.                   |
| 400         | BIP000058 | Bad Request | Error while validating verification token     | Erro ao validar token de verificação                             |
| 400         | BIP000059 | Bad Request | Number of verification token validation attempts exceeded. | Número de tentativas de validação de token de verificação excedido. |
| 400         | BIP000060 | Bad Request | Verification token expired.                   | Token de verificação expirado.                                   |
| 400         | BIP000061 | Bad Request | Verification token validation failed.       | Falha na validação do token de verificação.                      |
| 400         | BIP000065 | Bad Request | Payment verification time window exceeded.    | Janela de tempo de verificação de payment excedida.            |
| 404         | BIP000083 | Not Found   | Batch payment not found by batch payment key. | Batch de payments não encontrado pela chave do batch.            |
| 400         | BIP000085 | Bad Request | Batch payment status is not pending approval. | Status do batch de payments não é de aprovação pendente.        |
| 400         | BIP000086 | Bad Request | A token is required for SMS or email validation. | Um token é necessário para validação via SMS ou email.         |

---

# Get payment scheduling batch

URL: /en/documentation/baas/cobranca/2fa_v2/agendamento/consultar_lote_de_agendamento_de_pagamento

This endpoint returns o resumo do batch de scheduling e a lista paginada dos schedulings que o compõem (bank slips ou collection slips).

Para localizar `batch_payment_schedule_key`, utilize [List batchs de scheduling de payment](./listar_batchs_de_scheduling_de_payment.md).

:::info Boleto bancário
É o bank slip convencional (linhas digitáveis não iniciadas com dígito 8). Possui registro na Câmara Interbancária de Pagamento (CIP/Núclea) e pode ser pago em instituições financeiras e de payment autorizadas a funcionar pelo Banco Central.
:::

:::info Fatura de recolhimento
Esse tipo de cobrança é emitido por concessionárias de serviços (account de água, luz, telefone e gás) e órgãos públicos (tributos). Eles não são registrados na Câmara Interbancária de Pagamento (CIP/Núclea), por isso, não retornam as mesmas informações que um Boleto bancário apresenta.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/ ACCOUNT_KEY /schedule/ BATCH_PAYMENT_SCHEDULE_KEY
METHOD GET

### Request Path Params

| Field                        | Type  | Description                                          | Characters |
|-----------------------------|-------|----------------------------------------------------|------------|
| `account_key` *             | uuid4 | Chave única de identificação da account.             | 36         |
| `batch_payment_schedule_key` * | uuid4 | Chave única de identificação do batch de scheduling. | 36         |

### Request Query String Params

| Field       | Type   | Description                                                                     |
|-------------|--------|-------------------------------------------------------------------------------|
| `page`      | string | Número da página dos itens em `payment_schedules.data`. 1 por padrão.       |
| `page_size` | string | Tamanho da página dos itens em `payment_schedules.data`. 30 por padrão e valor máximo. |

## Response

### Success Response

STATUS 200

Response Body: Detalhes do batch de scheduling

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "total_scheduled": 10,
  "total_pending": 0,
  "total_error": 0,
  "total_amount": 1357.3,
  "batch_payment_schedule_status": "scheduled",
  "payment_schedules": {
    "pagination": {
      "current_page": 1,
      "rows_per_page": 30
    },
    "date": [
      {
        "payment_schedule_key": "c4325104-d60b-44f3-aae4-49155564a2ea",
        "request_control_key": "b713b2f6-2f48-4d18-b0c9-7186e4edf189",
        "payer_name": "COOPERATIVA INDUSTRIAL MURILO",
        "payer_document_number": "00037025000160",
        "source_account_key": "6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
        "paid_amount": 1050.1,
        "payment_date": "2024-04-03",
        "payment_type": "bank_slip",
        "bank_slip": {
          "bank_slip_key": "95080ffd-3ac5-48d7-b3fe-659e4aaba81a",
          "barcode": "00193967000009910000000003615574000000002417",
          "digitable_line": "00190000090361557400500000024174396700000991000",
          "payer_name": "COOPERATIVA TESTE",
          "payer_document_number": "00037025000160",
          "beneficiary_name": "TESTE EQUIPAMENTOS E SERVICOS LTDA",
          "beneficiary_trading_name": "TESTE EQUIPAMENTOS E SERVICOS LTDA",
          "beneficiary_document_number": "52069937000117",
          "beneficiary_bank_ispb": "00000000",
          "guarantor_name": null,
          "guarantor_document_number": null,
          "expiration_date": "2024-03-29",
          "max_payment_date": "2026-03-29",
          "partial_payment_indicator": "allowed",
          "registered_payment_amount": 9029.0,
          "nominal_amount": 9910.0,
          "total_amount": 10129.1,
          "rebate_amount": 0.0,
          "discount_amount": 0.0,
          "fine_amount": 0.0,
          "interest_amount": 219.1
        },
        "collection_slip": null,
        "payment_schedule_status": "scheduled",
        "error_reason": null
      }
    ]
  }
}
```

### Response Body Params

| Field                           | Type                                     | Description                                                     |
|--------------------------------|------------------------------------------|---------------------------------------------------------------|
| `request_control_key` *        | uuid4                                    | Chave única de identificação da request do cliente (batch). |
| `total_scheduled` *            | int                                      | Quantidade de itens do batch agendados com sucesso.            |
| `total_pending` *              | int                                      | Quantidade de itens ainda pendentes no batch.                  |
| `total_error` *                | int                                      | Quantidade de itens com erro no batch.                         |
| `total_amount` *               | number                                   | Valor total do batch.                                          |
| `batch_payment_schedule_status` * | [enum](#enumeradores-batch_payment_schedule_status) | Status do batch de scheduling.                                |
| `payment_schedules` *          | [object](#objeto-payment_schedules)      | Lista paginada dos schedulings do batch.                      |

### Object payment_schedules

| Field          | Type                         | Description                                                |
|----------------|------------------------------|----------------------------------------------------------|
| `pagination` * | [object](#objeto-pagination) | Paginação da lista de schedulings do batch.             |
| `date` *       | array                        | Itens do batch (schedulings individuais).               |

Cada elemento de `payment_schedules.data` contém:

| Field                     | Type                                 | Description                                                                      |
|--------------------------|--------------------------------------|--------------------------------------------------------------------------------|
| `payment_schedule_key` * | uuid4                                | Chave única de identificação do scheduling.                                   |
| `request_control_key` *  | uuid4                                | Chave única de identificação da request do cliente para o item do batch.     |
| `payer_name` *           | string                               | Nome do pagador efetivo.                                                       |
| `payer_document_number` *| string                               | Número de documento do pagador efetivo (CPF/CNPJ).                             |
| `source_account_key` *   | uuid4                                | Chave da account debitada.                                                       |
| `paid_amount` *          | number                               | Valor agendado para payment.                                                 |
| `payment_date` *         | string                               | Data do scheduling.                                                           |
| `payment_type` *         | [enum](#enumeradores-payment_type)   | Type do payment.                                                             |
| `bank_slip`              | [object](#objeto-bank_slip)          | Boleto bancário. Pode ser `null` quando `payment_type` for `collection_slip`. |
| `collection_slip`        | [object](#objeto-collection_slip)    | Fatura de recolhimento. Pode ser `null` quando `payment_type` for `bank_slip`.|
| `payment_schedule_status` * | [enum](#enumeradores-payment_schedule_status) | Status do scheduling.                                                         |
| `error_reason`           | string                               | Motivo do erro, quando aplicável; caso contrário `null`.                       |

### Object pagination

| Field             | Type | Description                           |
|------------------|------|-------------------------------------|
| `current_page` * | int  | Página atual retornada.             |
| `rows_per_page` *| int  | Quantidade de registros por página. |

### Enumerators payment_type

| Enumerator        | Description              |
|-------------------|------------------------|
| `bank_slip`       | Boleto bancário        |
| `collection_slip` | Fatura de recolhimento |

### Enumerators payment_schedule_status

| Enumerator             | Description                                                        |
|------------------------|------------------------------------------------------------------|
| `pending_2fa_approval` | Scheduling pendente de autenticação de dois fatores (2FA)       |
| `scheduled`            | Pagamento agendado com sucesso                                   |
| `executed`             | O scheduling foi executado com sucesso e o payment foi gerado |
| `rejected`             | O scheduling foi rejeitado e nenhum payment foi gerado        |
| `canceled`             | Scheduling cancelado                                            |
| `error`                | Erro ao realizar o scheduling                                   |

### Enumerators batch_payment_schedule_status

| Enumerator             | Description                 |
|------------------------|---------------------------|
| `pending_2fa_approval` | Pendente de aprovação 2FA |
| `scheduled`            | Scheduled                  |
| `rejected`             | Rejected                 |
| `canceled`             | Canceled                 |
| `error`                | Scheduling error           |

### Object bank_slip

| Field                           | Type                                            | Description                                           |
|--------------------------------|-------------------------------------------------|-----------------------------------------------------|
| `bank_slip_key` *              | uuid4                                           | Chave única de identificação do bank slip.    |
| `barcode` *                    | string                                          | Código de barras.                                   |
| `digitable_line` *             | string                                          | Linha digitável.                                    |
| `payer_name` *                 | string                                          | Nome do pagador.                                    |
| `payer_document_number` *      | string                                          | Número de documento do pagador (CPF/CNPJ).          |
| `beneficiary_name` *           | string                                          | Nome do beneficiário.                               |
| `beneficiary_trading_name`     | string                                          | Nome fantasia do beneficiário.                      |
| `beneficiary_document_number` *| string                                          | Número de documento do beneficiário (CPF/CNPJ).     |
| `beneficiary_bank_ispb` *      | string                                          | Código ispb do banco do beneficiário.               |
| `guarantor_name`               | string                                          | Nome do sacador avalista.                           |
| `guarantor_document_number`    | string                                          | Número de documento do sacador avalista (CPF/CNPJ). |
| `expiration_date` *            | string                                          | Data de vencimento.                                 |
| `max_payment_date` *           | string                                          | Data máxima de payment.                           |
| `partial_payment_indicator` *  | [enum](#enumeradores-partial_payment_indicator) | Indicador de payment parcial.                     |
| `registered_payment_amount`    | number                                          | Valor total de payment registrado.                |
| `nominal_amount` *             | number                                          | Valor original.                                     |
| `total_amount` *               | number                                          | Valor total.                                        |
| `rebate_amount` *              | number                                          | Valor do abatimento.                                |
| `discount_amount` *            | number                                          | Valor do desconto.                                  |
| `fine_amount` *                | number                                          | Valor da multa.                                     |
| `interest_amount` *            | number                                          | Valor dos juros.                                    |

### Enumerators partial_payment_indicator

| Enumerator    | Description     |
|---------------|---------------|
| `allowed`     | Permitido     |
| `not_allowed` | Não permitido |

### Object collection_slip

| Field                          | Type   | Description                                   |
|--------------------------------|--------|---------------------------------------------|
| `barcode` *                    | string | Código de barras.                           |
| `digitable_line` *             | string | Linha digitável.                            |
| `collection_name` *            | string | Nome do convênio.                           |
| `collection_document_number` * | string | Número de documento do convênio (CPF/CNPJ). |
| `expiration_date` *            | string | Data de vencimento.                         |
| `total_amount` *               | number | Valor total.                                |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Description em português",
    "code": "Código"
}
```

| Código HTTP | Código QI | Título      | Description (eng)                                                 | Description (pt-br)                                              |
|-------------|-----------|-------------|-----------------------------------------------------------------|----------------------------------------------------------------|
| 400         | BIP000027 | Bad Request | Invalid integer value for page or size query string parameters. | Valor inválido para parâmetros de página ou tamanho de página. |
| 404         | BIP000083 | Not Found   | Batch payment not found by batch payment key.                   | Batch de payments não encontrado pela chave do batch.          |

---

# List payment scheduling batches

URL: /en/documentation/baas/cobranca/2fa_v2/agendamento/listar_lotes_de_agendamento_de_pagamento

This endpoint returns os batchs de scheduling de payments de bank slips e collection slips associados à account, com suporte a filtros e paginação.

:::info Boleto bancário
É o bank slip convencional (linhas digitáveis não iniciadas com dígito 8). Possui registro na Câmara Interbancária de Pagamento (CIP/Núclea) e pode ser pago em instituições financeiras e de payment autorizadas a funcionar pelo Banco Central.
:::

:::info Fatura de recolhimento
Esse tipo de cobrança é emitido por concessionárias de serviços (account de água, luz, telefone e gás) e órgãos públicos (tributos). Eles não são registrados na Câmara Interbancária de Pagamento (CIP/Núclea), por isso, não retornam as mesmas informações que um Boleto bancário apresenta.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/ ACCOUNT_KEY /schedules
METHOD GET

### Request Path Params

| Field               | Type    | Description                               | Characters |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` *     | uuid4   | Chave única de identificação da account.  | 36         |

### Request Query String Params

| Field                          | Type        | Description                         |
|--------------------------------|-------------|-----------------------------------|
| `request_control_key`          | uuid4       | Chave única de identificação da request do cliente (batch). |
| `batch_payment_schedule_key`   | uuid4       | Chave única de identificação do batch de scheduling. |
| `payment_type`                 | [enum](#enumeradores-payment_type) | Type do payment do batch. |
| `batch_payment_schedule_status`| [enum](#enumeradores-batch_payment_schedule_status) | Status do batch de scheduling. |
| `date_from`                    | string      | Data inicial. Formato `YYYY-MM-DD`. |
| `date_to`                      | string      | Data final. Formato `YYYY-MM-DD`. |
| `page`                         | string      | Número da página requisitada. 1 por padrão. |
| `page_size`                    | string      | Tamanho da página requisitada na consulta. 30 por padrão e valor máximo. |

### Enumerators payment_type

| Enumerator        | Type   | Description              |
|-------------------|--------|------------------------|
| `bank_slip`       | string | Boleto bancário        |
| `collection_slip` | string | Fatura de recolhimento |

### Enumerators batch_payment_schedule_status

| Enumerator             | Description                          |
|------------------------|------------------------------------|
| `pending_2fa_approval` | Pendente de aprovação 2FA          |
| `scheduled`            | Scheduled                           |
| `rejected`             | Rejected                          |
| `canceled`             | Canceled                          |
| `error`                | Scheduling error                    |

## Response

### Success Response

STATUS 200

Response Body: Listagem de batchs de scheduling

```json
{
  "pagination": {
    "current_page": 1,
    "rows_per_page": 30
  },
  "date": [
    {
      "batch_payment_schedule_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "batch_payment_schedule_status": "scheduled",
      "payment_type": "bank_slip",
      "total_scheduled": 10,
      "total_pending": 0,
      "total_error": 0,
      "total_amount": 1357.3
    }
  ]
}
```

### Response Body Params

| Field               | Type    | Description                         |
|---------------------|---------|-----------------------------------|
| `pagination` *      | [object](#objeto-pagination) | Informações de paginação da consulta. |
| `date` *            | array   | Lista de batchs encontrados. |

Cada elemento de `date` contém:

| Field                           | Type    | Description                         |
|---------------------------------|---------|-----------------------------------|
| `batch_payment_schedule_key` *  | uuid4   | Chave única de identificação do batch de scheduling. |
| `request_control_key` *         | uuid4   | Chave única de identificação da request do cliente (batch). |
| `batch_payment_schedule_status` * | [enum](#enumeradores-batch_payment_schedule_status-1) | Status atual do batch de scheduling. |
| `payment_type` *                | [enum](#enumeradores-payment_type-1) | Type do payment do batch. |
| `total_scheduled` *             | int     | Quantidade de itens do batch agendados com sucesso. |
| `total_pending` *               | int     | Quantidade de itens ainda pendentes no batch. |
| `total_error` *                 | int     | Quantidade de itens com erro no batch. |
| `total_amount` *                | number  | Valor total do batch. |

### Object pagination

| Field               | Type    | Description                         |
|---------------------|---------|-----------------------------------|
| `current_page` *    | int     | Página atual retornada. |
| `rows_per_page` *   | int     | Quantidade de registros por página. |

### Enumerators payment_type

| Enumerator        | Description              |
|-------------------|------------------------|
| `bank_slip`       | Boleto bancário        |
| `collection_slip` | Fatura de recolhimento |

### Enumerators batch_payment_schedule_status

| Enumerator             | Description                 |
|------------------------|---------------------------|
| `pending_2fa_approval` | Pendente de aprovação 2FA |
| `scheduled`            | Scheduled                  |
| `rejected`             | Rejected                 |
| `canceled`             | Canceled                 |
| `error`                | Scheduling error           |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Description em português",
    "code": "Código"
}
```

| Código HTTP | Código QI | Título | Description (eng) | Description (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 400         | BIP000026 | Bad Request | Invalid payment date format. The correct format is YYYY-MM-DD. | Formato de date de payment inválido. O formato correto é YYYY-MM-DD. |
| 400         | BIP000027 | Bad Request | Invalid integer value for page or size query string parameters. | Valor inválido para parâmetros de página ou tamanho de página. |
| 400         | BIP000047 | Bad Request | Invalid payment type. | Type de payment inválido. |

---

# Reenviar Token Autenticação de Dois Fatores de Agendamento de Boleto Bancário

URL: /en/documentation/baas/cobranca/2fa_v2/agendamento/reenviar_token_de_agendamento_boleto_bancario

Este endpoint permite realizar o reenvio do token de autenticação de agendamento de Boletos Bancários.

:::info Boleto bancário
É o boleto bancário convencional (linhas digitáveis não iniciadas com dígito 8). Possui registro na Câmara Interbancária de Pagamento (CIP/Núclea) e pode ser pago em instituições financeiras e de pagamento autorizadas a funcionar pelo Banco Central.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /payment_schedule/ PAYMENT_SCHEDULE_KEY /bank_slip/resend_token
MÉTODO PATCH

### Request Path Params

| Campo               | Tipo    | Descrição                               | Caracteres |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` *     | uuid4   | Chave única de identificação da conta.  | 36         |
| `payment_schedule_key` * | uuid4   | Chave única de identificação do agendamento. | 36         |

## Response

### Success Response

STATUS 200

Response Body: Token reenviado com sucesso

```json
{
   "payment_key":"c4325104-d60b-44f3-aae4-49155564a2ea",
   "request_control_key":"b713b2f6-2f48-4d18-b0c9-7186e4edf189",
   "payer_name":"COOPERATIVA INDUSTRIAL MURILO",
   "payer_document_number":"00037025000160",
   "source_account_key":"6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
   "paid_amount":1050.1,
   "payment_date":"2024-04-03",
   "payment_type":"bank_slip",
   "bank_slip": {
        "bank_slip_key":"95080ffd-3ac5-48d7-b3fe-659e4aaba81a",
        "barcode":"00193967000009910000000003615574000000002417",
        "digitable_line":"00190000090361557400500000024174396700000991000",
        "payer_name":"COOPERATIVA TESTE",
        "payer_document_number":"00037025000160",
        "beneficiary_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_trading_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_document_number":"52069937000117",
        "beneficiary_bank_ispb":"00000000",
        "guarantor_name":null,
        "guarantor_document_number":null,
        "expiration_date":"2024-03-29",
        "max_payment_data": "2026-03-29",
        "partial_payment_indicator":"allowed",
        "registered_payment_amount":9029.0,
        "nominal_amount":9910.0,
        "total_amount":10129.1,
        "rebate_amount":0.0,
        "discount_amount":0.0,
        "fine_amount":0.0,
        "interest_amount":219.1
    },
   "collection_slip":null,
   "payment_schedule_status":"pending_2fa_approval"
}
```

### Response Body Params

| Campo               | Tipo    | Descrição                                           |
|---------------------|---------|-----------------------------------------------------|
| `payment_key` *               | uuid4 | Chave única de identificação do pagamento.          |
| `request_control_key` *       | uuid4 | Chave única de identificação da request do cliente. |
| `payer_name` *                | string | Nome do pagador efetivo.                            |
| `payer_document_number` *     | string | Número documento do pagador efetivo (CPF/CNPJ).     |
| `source_account_key` *        | uuid4 | Chave da conta debitada.                            |
| `transaction_key` *           | uuid4 | Chave da transação do pagamento.                    |
| `transaction_revert_key`      | uuid4 | Chave da transação de reversão do pagamento.        |
| `paid_amount` *               | number | Valor pago efetivamente.                            |
| `payment_date` *              | string | Data do pagamento.                                  |
| `payment_type` *              | [enum](#enumeradores-payment_type) | Tipo do pagamento.                                  |
| `bank_slip`                   | [object](#object-bank_slip) | Boleto bancário.                                    |
| `collection_slip`             | object | Fatura de recolhimento.                             |
| `payment_schedule_status` *            | [enum](#enumeradores-payment_schedule_status) | Status do agendamento.                              |

### Enumeradores payment_type
| Enumerador    | Tipo      | Descrição     |
|---------------|-----------|---------------|
| `bank_slip`     | string    | Boleto bancário    |
| `collection_slip` | string  | Fatura de recolhimento |

:::danger Aviso
O enumerador `collection_slip` não se aplica para o fluxo de boletos bancários, assim como o objeto collection_slip que sempre será nulo.
:::

### Enumeradores payment_schedule_status
| Enumerador    | Tipo      | Descrição     |
|---------------|-----------|---------------|
| `pending_2fa_approval`    | string  | pendente de aprovação de dois fatores |

### Object bank_slip
| Campo                             | Tipo    | Descrição                         |
|-----------------------------------|---------|-----------------------------------|
| `barcode` *                       | string | Código de barras. |
| `digitable_line` *                | string | Linha digitável. |
| `payer_name` *                    | string | Nome do pagador.|
| `payer_document_number` *         | string | Número de documento do pagador (CPF/CNPJ). |
| `beneficiary_name` *              | string | Nome do beneficiário. |
| `beneficiary_trading_name`        | string | Nome fantasia do beneficiário. |
| `beneficiary_document_number` *   | string | Número de documento do beneficiário (CPF/CNPJ). |
| `beneficiary_bank_ispb` *         | string | Código ispb do banco do beneficiário. |
| `guarantor_name`                  | string | Nome do sacador avalista. |
| `guarantor_document_number`       | string | Número de documento do sacador avalista (CPF/CNPJ). |
| `expiration_date` *               | string | Data de vencimento. |
| `max_payment_date` * | string  | Data máxima de pagamento. |
| `partial_payment_indicator` *     | [enum](#enumeradores-partial_payment_indicator)   | Indicador de pagamento parcial. |
| `registered_payment_amount`       | string | Valor total de pagamento registrado. |
| `nominal_amount` *                | number | Valor original. |
| `total_amount` *                  | number | Valor total. |
| `rebate_amount` *                 | number | Valor do abatimento. |
| `discount_amount` *               | number | Valor do desconto. |
| `fine_amount` *                   | number | Valor da multa. |
| `interest_amount` *               | number | Valor do juros. |

### Enumeradores partial_payment_indicator
| Enumerador    | Tipo      | Descrição     |
|---------------|-----------|---------------|
| `allowed`     | string    | Permitido     |
| `not_allowed` | string    | Não permitido |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Descrição em português",
    "code": "Código"
}
```

| Código HTTP | Código QI | Título | Descrição (eng) | Descrição (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 403         | BIP000010 | Forbidden | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404         | BIP000011 | Not Found | The source account key was not found. | A chave da conta de origem não foi encontrada. |
| 400         | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400         | BIP000013 | Bad Request | The source account is closed. | A conta de origem está fechada. |
| 400         | BIP000014 | Bad Request | The source account is blocked. | A conta de origem está bloqueada. |
| 404         | BIP000056 | Not Found | Payment not found. | Pagamento não encontrado. |
| 400         | BIP000057 | Bad Request | Payment status is not pending approval. | Status de pagamento não é de aprovação pendente. |
| 400         | BIP000062 | Bad Request | Payment type is not bank slip. | Tipo de pagamento não é boleto. |
| 400         | BIP000064 | Bad Request | Error resending verification token | Erro ao reenviar token de verificação |
| 400         | BIP000065 | Bad Request | Payment verification time window exceeded. | Janela de tempo de verificação de pagamento excedida. |

---

# Reenviar Token Autenticação de Dois Fatores de Agendamento de Fatura de Recolhimento

URL: /en/documentation/baas/cobranca/2fa_v2/agendamento/reenviar_token_de_agendamento_de_fatura_de_recolhimento

Este endpoint permite realizar o reenvio do token de autenticação de agendamento de Faturas de Recolhimento.

:::info Fatura de recolhimento
Esse tipo de cobrança é emitido por concessionárias de serviços (conta de água, luz, telefone e gás) e órgão públicos (tributos). Eles não são registrados na Câmara Interbancária de Pagamento (CIP/Núclea), por isso, não retornam as mesmas informações que um Boleto bancário apresenta.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /payment_schedule/ PAYMENT_SCHEDULE_KEY /collection_slip/resend_token
MÉTODO PATCH

### Request Path Params

| Campo               | Tipo    | Descrição                               | Caracteres |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` *     | uuid4   | Chave única de identificação da conta.  | 36         |
| `payment_schedule_key` * | uuid4   | Chave única de identificação do agendamento. | 36         |

## Response

### Success Response

STATUS 200

Response Body: Token reenviado com sucesso

```json
{
  "payment_schedule_key": "33860ad0-bcb0-47b7-bbe7-c7e3ec2fc61a",
  "request_control_key": "ae4508df-f2cb-4e28-9f04-a19b7f2758c9",
  "payer_name": "COOPERATIVA INDUSTRIAL MURILO",
  "payer_document_number": "62069937000118",
  "source_account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "paid_amount": 1389.21,
  "payment_date": "2024-04-30",
  "payment_type": "collection_slip",
  "bank_slip": null,
  "collection_slip": {
    "barcode": null,
    "digitable_line": "836200000138892100450006762142420244046000010192",
    "collection_name": "CIA ULTRAGAZ SA-COD",
    "collection_document_number": "00394460005887",
    "expiration_date": "2024-04-15",
    "total_amount": 1389.21
  },
  "payment_schedule_status": "pending_2fa_approval"
}
```

### Response Body Params

| Campo               | Tipo    | Descrição                         |
|---------------------|---------|-----------------------------------|
| `payment_key` *               | uuid4 | Chave única de identificação do pagamento. |
| `request_control_key` *       | uuid4 | Chave única de identificação da request do cliente. |
| `payer_name` *                | string | Nome do pagador efetivo.|
| `payer_document_number` *     | string | Número de documento do pagador efetivo (CPF/CNPJ). |
| `source_account_key` *        | uuid4 | Chave da conta debitada. |
| `transaction_key` *           | uuid4 | Chave da transação do pagamento. |
| `transaction_revert_key`      | uuid4 | Chave da transação de reversão do pagamento. |
| `paid_amount` *               | number | Valor pago efetivamente. |
| `payment_date` *              | string | Data do pagamento. |
| `payment_type` *              | [enum](#enumeradores-payment_type) | Tipo do pagamento. |
| `bank_slip`                   | object | Boleto bancário. |
| `collection_slip`             | [object](#objeto-collection_slip) | Fatura de recolhimento. |
| `payment_schedule_status` *            | [enum](#enumeradores-payment_schedule_status) | Status do pagamento. |

### Enumeradores payment_type
| Enumerador    | Tipo      | Descrição     |
|---------------|-----------|---------------|
| `bank_slip`     | string    | Boleto bancário    |
| `collection_slip` | string  | Fatura de recolhimento |

:::danger Aviso
O enumerador `bank_slip` não se aplica para o fluxo de faturas de recolhimento, assim como o objeto bank_slip que sempre será nulo.
:::

### Enumeradores payment_schedule_status
| Enumerador    | Tipo      | Descrição     |
|---------------|-----------|---------------|
| `pending_2fa_approval`    | string  | pendente de aprovação de dois fatores |

### Objeto collection_slip
| Campo                             | Tipo    | Descrição                         |
|-----------------------------------|---------|-----------------------------------|
| `barcode`          | string | Código de barras. |
| `digitable_line`   | string | Linha digitável. |
| `collection_name` *         | string | Nome do convênio.|
| `collection_document_number`   | string | Número de documento do convênio (CPF/CNPJ).|
| `expiration_date` *  | string  | Data de vencimento. |
| `total_amount` *  | number | Valor total. |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Descrição em português",
    "code": "Código"
}
```

| Código HTTP | Código QI | Título | Descrição (eng) | Descrição (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 403         | BIP000010 | Forbidden | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404         | BIP000011 | Not Found | The source account key was not found. | A chave da conta de origem não foi encontrada. |
| 400         | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400         | BIP000013 | Bad Request | The source account is closed. | A conta de origem está fechada. |
| 400         | BIP000014 | Bad Request | The source account is blocked. | A conta de origem está bloqueada. |
| 404         | BIP000056 | Not Found | Payment not found. | Pagamento não encontrado. |
| 400         | BIP000057 | Bad Request | Payment status is not pending approval. | Status de pagamento não é de aprovação pendente. |
| 400         | BIP000063 | Bad Request | Payment type is not collection slip. | Tipo de pagamento não é fatura de recolhimento. |
| 400         | BIP000064 | Bad Request | Error resending verification token | Erro ao reenviar token de verificação |
| 400         | BIP000065 | Bad Request | Payment verification time window exceeded. | Janela de tempo de verificação de pagamento excedida. |

---

# Resend token for bank slip batch scheduling

URL: /en/documentation/baas/cobranca/2fa_v2/agendamento/reenviar_token_de_agendamento_em_lote_de_boleto_bancario

This endpoint allows resending the two-factor authentication (2FA) token for a bank slip scheduling batch currently in `batch_payment_schedule_status` **`pending_2fa_approval`**.

:::info Bank slip
A traditional bank slip (digitable line does not start with 8). It is registered in the Interbank Payment Chamber (CIP/Nuclea) and can be paid through financial and payment institutions authorized by the Central Bank.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/ ACCOUNT_KEY /payment/schedule_bank_slip/ BATCH_PAYMENT_SCHEDULE_KEY /resend_token
METHOD PATCH

### Request Path Params

| Field                 | Type  | Description                                                                                | Characters |
| --------------------- | ----- | ---------------------------------------------------------------------------------------- | ---------- |
| `account_key` *       | uuid4 | Unique account identifier key.                                                   | 36         |
| `batch_payment_schedule_key` * | uuid4 | Unique batch scheduling identifier key. | 36         |

### Request Body

Request Body (optional)

```json
{
  "contact_type": "sms"
}
```

### Body Params

| Field          | Type       | Description                               | Characters                                              |
| -------------- | ---------- | --------------------------------------- | ------------------------------------------------------- |
| `contact_type` | enumerator | Authentication token delivery channel | **[Enumerator contact_type](#enumerador-contact_type)** |

:::info Information
If `contact_type` is not sent, the token will be delivered using the channel originally requested in the batch scheduling (`tfa_info.contact_type`).
:::

### Enumerator contact_type

| Enumerator | Description                                         |
| ---------- | ------------------------------------------------- |
| **sms**    | Send token via SMS |
| **email**  | Send token via email                      |

## Response

### Success Response

STATUS 200

Response Body: Token resent successfully

```json
{
  "batch_payment_schedule_key": "c4325104-d60b-44f3-aae4-49155564a2ea",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
  "total_amount": 1357.3,
  "batch_payment_schedule_status": "pending_2fa_approval",
  "payment_type": "bank_slip"
}
```

### Response Body Params

| Field                   | Type   | Description |
| ----------------------- | ------ | --------- |
| `batch_payment_schedule_key` *   | uuid4  | Unique batch scheduling identifier key. |
| `request_control_key` * | uuid4  | Unique client request identifier key (batch). |
| `account_key` *         | uuid4  | Debited account key. |
| `total_amount` *        | number | Sum of item amounts in the batch. |
| `batch_payment_schedule_status` *        | string | After resend, the batch remains waiting for token validation (`pending_2fa_approval`). |
| `payment_type` *        | string | Payment type; for this flow, expected value is `bank_slip`. |

Then use [Confirm bank slip batch scheduling](./confirmar_agendamento_em_lote_de_boleto_bancario.md) to complete 2FA.

### Error Response

STATUS 4XX

Response Body

```json
{
  "title": "Title",
  "description": "Description in English",
  "translation": "Description in Portuguese",
  "code": "Code"
}
```

| HTTP Code | QI Code | Title      | Description (eng)                                                                                    | Description (pt-br)                                                                                         |
| ----------- | --------- | ----------- | -------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| 403         | BIP000010 | Forbidden   | User is not allowed to do this action                                                              | User is not allowed to do this action                                                          |
| 404         | BIP000011 | Not Found   | The source account key was not found.                                                              | The source account key was not found.                                                            |
| 400         | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | It was not possible to consult the source account at this time. Please try again in a few minutes. |
| 400         | BIP000059 | Bad Request | Number of verification token validation attempts exceeded.                                         | Number of verification token validation attempts exceeded.                                       |
| 400         | BIP000064 | Bad Request | Error resending verification token                                                                 | Error resending verification token                                                                     |
| 400         | BIP000065 | Bad Request | Payment verification time window exceeded.                                                         | Payment verification time window exceeded.                                                     |
| 404         | BIP000083 | Not Found   | Batch payment not found by batch payment key.                                                      | Batch payment not found by batch payment key.                                                     |
| 400         | BIP000085 | Bad Request | Batch payment status is not pending approval.                                                      | Batch payment status is not pending approval.                                                 |

---

# Resend token for collection slip batch scheduling

URL: /en/documentation/baas/cobranca/2fa_v2/agendamento/reenviar_token_de_agendamento_em_lote_de_fatura_de_recolhimento

This endpoint allows **reenviar** o token de autenticação de dois fatores (2FA) para um batch de scheduling de collection slips que esteja em `batch_payment_schedule_status` **`pending_2fa_approval`**.

:::info Fatura de recolhimento
Esse tipo de cobrança é emitido por concessionárias de serviços (account de água, luz, telefone e gás) e órgãos públicos (tributos). Eles não são registrados na Câmara Interbancária de Pagamento (CIP/Núclea), por isso, não retornam as mesmas informações que um Boleto bancário apresenta.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/ ACCOUNT_KEY /payment/schedule_collection_slip/ BATCH_PAYMENT_SCHEDULE_KEY /resend_token
METHOD PATCH

### Request Path Params

| Field                 | Type  | Description                                                                                | Characters |
| --------------------- | ----- | ---------------------------------------------------------------------------------------- | ---------- |
| `account_key` *       | uuid4 | Chave única de identificação da account.                                                   | 36         |
| `batch_payment_schedule_key` * | uuid4 | Chave única de identificação do batch de scheduling. | 36         |

### Request Body

Request Body (opcional)

```json
{
  "contact_type": "sms"
}
```

### Body Params

| Field          | Type       | Description                               | Characters                                              |
| -------------- | ---------- | --------------------------------------- | ------------------------------------------------------- |
| `contact_type` | enumerator | Forma de envio do token de autenticação | **[Enumerator contact_type](#enumerador-contact_type)** |

:::info Information
Caso não seja enviado um `contact_type`, o token será enviado da forma solicitada originalmente no scheduling do batch (`tfa_info.contact_type`).
:::

### Enumerator contact_type

| Enumerator | Description                                         |
| ---------- | ------------------------------------------------- |
| **sms**    | Envio por mensagem de texto para telefone celular |
| **email**  | Envio por correio eletrônico                      |

## Response

### Success Response

STATUS 200

Response Body: Token resent successfully

```json
{
  "batch_payment_schedule_key": "33860ad0-bcb0-47b7-bbe7-c7e3ec2fc61a",
  "request_control_key": "ae4508df-f2cb-4e28-9f04-a19b7f2758c9",
  "account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "total_amount": 1939.31,
  "batch_payment_schedule_status": "pending_2fa_approval",
  "payment_type": "collection_slip"
}
```

### Response Body Params

| Field                   | Type   | Description |
| ----------------------- | ------ | --------- |
| `batch_payment_schedule_key` *   | uuid4  | Chave única de identificação do scheduling em batch. |
| `request_control_key` * | uuid4  | Chave única de identificação da request do cliente (batch). |
| `account_key` *         | uuid4  | Chave da account debitada. |
| `total_amount` *        | number | Soma dos valores dos itens do batch. |
| `batch_payment_schedule_status` *        | string | Após o reenvio, o batch permanece aguardando validação do token (`pending_2fa_approval`). |
| `payment_type` *        | string | Type do payment; para este fluxo, espera-se `collection_slip`. |

In sequence, use [Confirm scheduling em batch de collection slip](./confirmar_scheduling_em_batch_de_fatura_de_recolhimento.md) para concluir o 2FA.

### Error Response

STATUS 4XX

Response Body

```json
{
  "title": "Título",
  "description": "Description in english",
  "translation": "Description em português",
  "code": "Código"
}
```

| Código HTTP | Código QI | Título      | Description (eng)                                                                                    | Description (pt-br)                                                                                         |
| ----------- | --------- | ----------- | -------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| 403         | BIP000010 | Forbidden   | User is not allowed to do this action                                                              | Usuário não tem autorização para fazer essa ação                                                          |
| 404         | BIP000011 | Not Found   | The source account key was not found.                                                              | A chave da account de origem não foi encontrada.                                                            |
| 400         | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a account de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400         | BIP000059 | Bad Request | Number of verification token validation attempts exceeded.                                         | Número de tentativas de validação de token de verificação excedido.                                       |
| 400         | BIP000064 | Bad Request | Error resending verification token                                                                 | Erro ao reenviar token de verificação                                                                     |
| 400         | BIP000065 | Bad Request | Payment verification time window exceeded.                                                         | Janela de tempo de verificação de payment excedida.                                                     |
| 404         | BIP000083 | Not Found   | Batch payment not found by batch payment key.                                                      | Batch de payments não encontrado pela chave do batch.                                                     |
| 400         | BIP000085 | Bad Request | Batch payment status is not pending approval.                                                      | Status do batch de payments não é de aprovação pendente.                                                 |

---

# Solicitar Agendamento de Pagamento de Boleto Bancário com Autenticação de Dois Fatores (2FA)

URL: /en/documentation/baas/cobranca/2fa_v2/agendamento/solicitar_agendamento_de_boleto_bancario

Este endpoint permite realizar a solicitação de agendamento de pagamento de boletos bancários. 
A solicitação deve ser realizado após a consulta, utilizando as informações retornadas 
para garantir o funcionamento correto do fluxo, evitando falhas durante o processo.

:::info Boleto bancário
É o boleto bancário convencional (linhas digitáveis não iniciadas com dígito 8). 
Possui registro na Câmara Interbancária de Pagamento (CIP/Núclea) e pode ser pago em instituições financeiras e de 
pagamento autorizadas a funcionar pelo Banco Central.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /payment_schedule/bank_slip
MÉTODO POST

### Request Path Params

| Campo               | Tipo    | Descrição                               | Caracteres |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` *     | uuid4   | Chave única de identificação da conta.  | 36         |

Request Body: Solicitação de agendamento com linha digitável

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "digitable_line": "00190000090361557400500000024174396700000991000",
  "payment_amount": 1156.8,
  "payment_date": "2024-03-30",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  }
}
```
Request Body: Solicitação de agendamento com código de barras

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "barcode": "00190000090361557400500000024174396700000991000",
  "payment_amount": 1156.8,
  "payment_date": "2024-03-30",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  }
}
```

### Body Params

| Campo               | Tipo          | Descrição                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Chave única de identificação da request do cliente. |    
| `barcode`               | string    | Código de barras. |
| `digitable_line`        | string    | Linha digitável. |
| `payment_amount` *      | number    | Valor a ser pago. |
| `payment_date` *        | string | Data do agendamento.                                |
| `tfa_info` *            | [object](#object-tfa_info)    | Objeto contendo o documento da pessoa aprovadora da conta e a forma de contato. | 

:::danger Aviso
O `payment_amount` deve sempre igual ao `total_amount` retornado na consulta do boleto bancário caso o pagamento parcial não seja permitido para o boleto bancário. Para títulos em que o pagamento parcial é permitido, o cliente pode escolher o `payment_amount`, desde que a soma do mesmo com o `registered_payment_amount` do boleto bancário não seja superior que o `total_amount`.
:::

### Object tfa_info
| Campo                             | Tipo    | Descrição                         |
|-----------------------------------|---------|-----------------------------------|
| `approver_document_number`* | string | Número de documento da pessoa aprovadora da conta. | 
| `contact_type`*             | string | Forma de contato com a pessoa aprovadora da conta, podendo ser **sms** ou **email** |

## Response

### Success Response

STATUS 201

Response Body: Agendamento pendente de aprovação de dois fatores

```json
{
   "payment_key":"c4325104-d60b-44f3-aae4-49155564a2ea",
   "request_control_key":"b713b2f6-2f48-4d18-b0c9-7186e4edf189",
   "payer_name":"COOPERATIVA INDUSTRIAL MURILO",
   "payer_document_number":"00037025000160",
   "source_account_key":"6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
   "paid_amount":1050.1,
   "payment_date":"2024-04-03",
   "payment_type":"bank_slip",
   "bank_slip": {
        "bank_slip_key":"95080ffd-3ac5-48d7-b3fe-659e4aaba81a",
        "barcode":"00193967000009910000000003615574000000002417",
        "digitable_line":"00190000090361557400500000024174396700000991000",
        "payer_name":"COOPERATIVA TESTE",
        "payer_document_number":"00037025000160",
        "beneficiary_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_trading_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_document_number":"52069937000117",
        "beneficiary_bank_ispb":"00000000",
        "guarantor_name":null,
        "guarantor_document_number":null,
        "expiration_date":"2024-03-29",
        "max_payment_data": "2026-03-29",
        "partial_payment_indicator":"allowed",
        "registered_payment_amount":9029.0,
        "nominal_amount":9910.0,
        "total_amount":10129.1,
        "rebate_amount":0.0,
        "discount_amount":0.0,
        "fine_amount":0.0,
        "interest_amount":219.1
    },
   "collection_slip":null,
   "payment_schedule_status":"pending_2fa_approval"
}
```

### Response Body Params

| Campo               | Tipo    | Descrição                                           |
|---------------------|---------|-----------------------------------------------------|
| `payment_key` *               | uuid4 | Chave única de identificação do pagamento.          |
| `request_control_key` *       | uuid4 | Chave única de identificação da request do cliente. |
| `payer_name` *                | string | Nome do pagador efetivo.                            |
| `payer_document_number` *     | string | Número do documento do pagador efetivo  (CPF/CNPJ). |
| `source_account_key` *        | uuid4 | Chave da conta debitada.                            |
| `transaction_key` *           | uuid4 | Chave da transação do pagamento.                    |
| `transaction_revert_key`      | uuid4 | Chave da transação de reversão do pagamento.        |
| `paid_amount` *               | number | Valor pago efetivamente.                            |
| `payment_date` *              | string | Data do agendamento.                                |
| `payment_type` *              | [enum](#enumeradores-payment_type) | Tipo do pagamento.                                  |
| `bank_slip`                   | [object](#object-bank_slip) | Boleto bancário.                                    |
| `collection_slip`             | object | Fatura de recolhimento.                             |
| `payment_schedule_status` *            | [enum](#enumeradores-payment_schedule_status) | Status do agendamento.                              |

### Enumeradores payment_type
| Enumerador    | Tipo      | Descrição     |
|---------------|-----------|---------------|
| `bank_slip`     | string    | Boleto bancário    |
| `collection_slip` | string  | Fatura de recolhimento |

:::danger Aviso
O enumerador `collection_slip` não se aplica para o fluxo de boletos bancários, assim como o objeto collection_slip que sempre será nulo.
:::

### Enumeradores payment_schedule_status
| Enumerador    | Tipo      | Descrição     |
|---------------|-----------|---------------|
| `pending_2fa_approval`    | string  | pendente de aprovação de dois fatores |

### Object bank_slip
| Campo                             | Tipo    | Descrição                         |
|-----------------------------------|---------|-----------------------------------|
| `barcode` *                       | string | Código de barras. |
| `digitable_line` *                | string | Linha digitável. |
| `payer_name` *                    | string | Nome do pagador.|
| `payer_document_number` *         | string | Número do documento do pagador (CPF/CNPJ). |
| `beneficiary_name` *              | string | Nome do beneficiário. |
| `beneficiary_trading_name`        | string | Nome fantasia do beneficiário. |
| `beneficiary_document_number` *   | string | Número do documento do beneficiário (CPF/CNPJ). |
| `beneficiary_bank_ispb` *         | string | Código ispb do banco do beneficiário. |
| `guarantor_name`                  | string | Nome do sacador avalista. |
| `guarantor_document_number`       | string | Número do documento do sacador avalista (CPF/CNPJ). |
| `expiration_date` *               | string | Data de vencimento. |
| `max_payment_date` * | string  | Data máxima de pagamento. |
| `partial_payment_indicator` *     | [enum](#enumeradores-partial_payment_indicator)   | Indicador de pagamento parcial. |
| `registered_payment_amount`       | string | Valor total de pagamento registrado. |
| `nominal_amount` *                | number | Valor original. |
| `total_amount` *                  | number | Valor total. |
| `rebate_amount` *                 | number | Valor do abatimento. |
| `discount_amount` *               | number | Valor do desconto. |
| `fine_amount` *                   | number | Valor da multa. |
| `interest_amount` *               | number | Valor do juros. |

### Enumeradores partial_payment_indicator
| Enumerador    | Tipo      | Descrição     |
|---------------|-----------|---------------|
| `allowed`     | string    | Permitido     |
| `not_allowed` | string    | Não permitido |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Descrição em português",
    "code": "Código"
}
```

| Código HTTP | Código QI | Título | Descrição (eng) | Descrição (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 400         | BIP000001 | Bad Request | The barcode or digitable line must have 44 or 47 characters. | O código de barras ou linha digitável deve ter 44 ou 47 caracteres. |
| 400         | BIP000002 | Bad Request | The bill sent does not correspond to a bank slip. | A conta enviado não corresponde a um boleto bancário. |
| 400         | BIP000003 | Bad Request | The digitable line sent is invalid. | A linha digitável enviada é inválida. |
| 404         | BIP000004 | Not Found | The bank slip was not found. | O boleto não foi encontrado. |
| 400         | BIP000005 | Bad Request | It was not possible to consult the bank slip at this time. Please try again in a few minutes. | Não foi possível consultar o boleto neste momento. Por favor, tente novamente em alguns minutos. |
| 400         | BIP000006 | Bad Request | Bank slip already written off | Boleto já baixado |
| 400         | BIP000007 | Bad Request | Bank slip blocked for payment | Boleto bloqueado para pagamento |
| 400         | BIP000008 | Bad Request | Bank slip already paid | Boleto já pago |
| 400         | BIP000009 | Bad Request | Invalid bank slip. Please consult issuing bank | Boleto inválido. Favor consultar banco emissor |
| 403         | BIP000010 | Forbidden | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404         | BIP000011 | Not Found | The source account key was not found. | A chave da conta de origem não foi encontrada. |
| 400         | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400         | BIP000013 | Bad Request | The source account is closed. | A conta de origem está fechada. |
| 400         | BIP000014 | Bad Request | The source account is blocked. | A conta de origem está bloqueada. |
| 400         | BIP000015 | Bad Request | Payment date is greater than the maximum payment date. | A data de pagamento é maior que a data máxima de pagamento. |
| 400         | BIP000016 | Bad Request | Payment date is smaller than the calculation date. | A data de pagamento é menor que a data de cálculo. |
| 400         | BIP000017 | Bad Request | Invalid payment amount. | Valor de pagamento inválido. |
| 400         | BIP000018 | Bad Request | Partial payment is not allowed. | Pagamento parcial não é permitido. |
| 400         | BIP000019 | Bad Request | The payment amount is greater than the available amount. | O valor do pagamento é maior que o valor disponível. |
| 400         | BIP000020 | Bad Request | All partial payments for this bank slip have already been made. | Todos os pagamentos parciais deste boleto já foram realizados. |
| 400         | BIP000024 | Bad Request | Request control key already exists. | Chave de controle da requisição já existe. |
| 403         | BIP000052 | Forbidden | Given document number does not belong to an approver for this account | Número de documento enviado não pertence a um aprovador da conta |
| 400         | BIP000053 | Bad Request | Error getting approver data | Erro ao obter dados do aprovador |
| 400         | BIP000054 | Bad Request | TFA info required | Informações de TFA necessárias |
| 400         | BIP000055 | Bad Request | Error sending verification token | Erro ao enviar token de verificação |
| 400         | BIP000065 | Bad Request | Payment verification time window exceeded. | Janela de tempo de verificação de pagamento excedida. |

## Ambiente de Sandbox

Em nosso ambiente de sandbox, disponibilizamos linhas digitáveis mockadas para a simulação de pagamentos bem-sucedidos e testes de cenários de erro.

| Linha digitável |
|-----------------|
| 00190000090361557400500000024174396700000991000 |
| 00190000090282802601919212747174596760001294161 |
| 23793390014000000455277000249001596900000103995 |
| 75691434020137513680900001040013196770002417240 |
| 21390001171200000570700168167484796770000148206 |
| 34191090083273252027893634770007296690012513600 |
| 42297048060005815702500130494123896770000239491 |
| 07090010287045349010776686070590896770001160123 |
| 74891123702849020818918378871083196690000050000 |
| 23792374119000209350986000372408496610000122810 |

---

# Solicitar Agendamento de Pagamento de Facutara de Recolhimento com Autenticação de Dois Fatores (2FA)

URL: /en/documentation/baas/cobranca/2fa_v2/agendamento/solicitar_agendamento_de_pagamento_de_fatura_de_recolhimento

Este endpoint permite realizar a solicitação de agendamento de pagamento de faturas de recolhimento com autenticação de dois fatores. 
A solicitação deve ser realizado após a consulta, utilizando as informações retornadas para garantir o funcionamento correto do fluxo,
evitando falhas durante o processo.

:::info Fatura de recolhimento
Esse tipo de cobrança é emitido por concessionárias de serviços (conta de água, luz, telefone e gás) e órgão públicos (tributos). Eles não são registrados na Câmara Interbancária de Pagamento (CIP/Núclea), por isso, não retornam as mesmas informações que um Boleto bancário apresenta.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /payment_schedule/collection_slip
MÉTODO POST

### Request Path Params

| Campo               | Tipo    | Descrição                               | Caracteres |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` *     | uuid4   | Chave única de identificação da conta.  | 36         |

Request Body: Solicitação de com linha digitável

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "digitable_line": "00190000090361557400500000024174396700000991000",
  "payment_amount": 1156.8,
  "payment_date": "2024-03-30",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  }
}
```
Request Body: Solicitação de agendamento com código de barras

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "barcode": "00190000090361557400500000024174396700000991000",
  "payment_amount": 1156.8,
  "payment_date": "2024-03-30",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  }
}
```

### Body Params

| Campo               | Tipo          | Descrição                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Chave única de identificação da request do cliente. |    
| `barcode`               | string    | Código de barras. |
| `digitable_line`        | string    | Linha digitável. |
| `payment_amount` *      | number    | Valor a ser pago. |
| `tfa_info` *            | [object](#object-tfa_info)    | Objeto contendo o documento da pessoa aprovadora da conta e a forma de contato. | 

:::danger Aviso
O `payment_amount` deve sempre igual ao `total_amount` retornado na consulta do boleto bancário.
:::

### Object tfa_info
| Campo                             | Tipo    | Descrição                         |
|-----------------------------------|---------|-----------------------------------|
| `approver_document_number`* | string | Número de documento da pessoa aprovadora da conta (CPF/CNPJ). | 
| `contact_type`*             | string | Forma de contato com a pessoa aprovadora da conta, podendo ser **sms** ou **email** |

## Response

### Success Response

STATUS 201

Response Body: Agendamento pendente de aprovação de dois fatores

```json
{
  "payment_key": "33860ad0-bcb0-47b7-bbe7-c7e3ec2fc61a",
  "request_control_key": "ae4508df-f2cb-4e28-9f04-a19b7f2758c9",
  "payer_name": "COOPERATIVA INDUSTRIAL MURILO",
  "payer_document_number": "62069937000118",
  "source_account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "paid_amount": 1389.21,
  "payment_date": "2024-04-30",
  "payment_type": "collection_slip",
  "bank_slip": null,
  "collection_slip": {
    "barcode": null,
    "digitable_line": "836200000138892100450006762142420244046000010192",
    "collection_name": "CIA ULTRAGAZ SA-COD",
    "collection_document_number": "00394460005887",
    "expiration_date": "2024-04-15",
    "total_amount": 1389.21
  },
  "payment_schedule_status": "pending_2fa_approval"
}
```

### Response Body Params

| Campo               | Tipo    | Descrição                                           |
|---------------------|---------|-----------------------------------------------------|
| `payment_key` *               | uuid4 | Chave única de identificação do pagamento.          |
| `request_control_key` *       | uuid4 | Chave única de identificação da request do cliente. |
| `payer_name` *                | string | Nome do pagador efetivo.                            |
| `payer_document_number` *     | string | Documento do pagador efetivo (CPF/CNPJ).            |
| `source_account_key` *        | uuid4 | Chave da conta debitada.                            |
| `transaction_key` *           | uuid4 | Chave da transação do pagamento.                    |
| `transaction_revert_key`      | uuid4 | Chave da transação de reversão do pagamento.        |
| `paid_amount` *               | number | Valor pago efetivamente.                            |
| `payment_date` *              | string | Data do agendamento.                                |
| `payment_type` *              | [enum](#enumeradores-payment_type) | Tipo do pagamento.                                  |
| `bank_slip`                   | object | Boleto bancário.                                    |
| `collection_slip`             | [object](#object-collection_slip) | Fatura de recolhimento.                             |
| `payment_schedule_status` *            | [enum](#enumeradores-payment_schedule_status) | Status do agendamento.                              |

### Enumeradores payment_type
| Enumerador    | Tipo      | Descrição     |
|---------------|-----------|---------------|
| `bank_slip`     | string    | Boleto bancário    |
| `collection_slip` | string  | Fatura de recolhimento |

:::danger Aviso
O enumerador `bank_slip` não se aplica para o fluxo de faturas de recolhimento, assim como o objeto bank_slip que sempre será nulo.
:::

### Enumeradores payment_schedule_status
| Enumerador    | Tipo      | Descrição     |
|---------------|-----------|---------------|
| `pending_2fa_approval`    | string  | pendente de aprovação de dois fatores |

### Object collection_slip
| Campo                             | Tipo    | Descrição                         |
|-----------------------------------|---------|-----------------------------------|
| `barcode`          | string | Código de barras. |
| `digitable_line`   | string | Linha digitável. |
| `collection_name` *         | string | Nome do convênio.|
| `collection_document_number`   | string | Número de documento do convênio (CPF/CNPJ).|
| `expiration_date` *  | string  | Data de vencimento. |
| `total_amount` *  | number | Valor total. |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Descrição em português",
    "code": "Código"
}
```

| Código HTTP | Código QI | Título | Descrição (eng) | Descrição (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 400         | BIP000032 | Bad Request | The bill sent does not correspond to a collection slip. | A conta enviada não corresponde a uma fatura de recolhimento. |
| 400         | BIP000033 | Bad Request | The barcode or digitable line of the collection slip must have 44 or 48 characters. | O código de barras ou linha digitável da fatura de recolhimento deve ter 44 ou 48 caracteres. |
| 403         | BIP000010 | Forbidden | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404         | BIP000011 | Not Found | The source account key was not found. | A chave da conta de origem não foi encontrada. |
| 400         | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400         | BIP000013 | Bad Request | The source account is closed. | A conta de origem está fechada. |
| 400         | BIP000014 | Bad Request | The source account is blocked. | A conta de origem está bloqueada. |
| 400         | BIP000024 | Bad Request | Request control key already exists. | Chave de controle da requisição já existe. |
| 400         | BIP000028 | Bad Request | The source account has blocked balance. Payment cannot be made. | A conta de origem possui saldo em conta bloqueado. Pagamento não pode ser realizado. |
| 400         | BIP000034 | Bad Request | Collection slip already paid. | Fatura de recolhimento já paga. |
| 400         | BIP000035 | Bad Request | Covenant slip invalid barcode. | Código de barras da fatura de recolhimento inválido. |
| 400         | BIP000036 | Bad Request | Covenant slip overdue. | Fatura de recolhimento vencida. |
| 400         | BIP000037 | Bad Request | Error in collection slip consultation. | Erro na consulta da fatura de recolhimento. |
| 400         | BIP000038 | Bad Request | Outside of covenant payment hours. | Fora do horário de pagamento do convênio. |
| 400         | BIP000039 | Bad Request | Collection slip not accepted. | Fatura de recolhimento não aceita. |
| 400         | BIP000040 | Bad Request | Minimum advance not reached. | Mínimo de dias de adiantamento não atingido. |
| 400         | BIP000041 | Bad Request | Max payment amount exceeded. | Valor máximo de pagamento excedido. |
| 400         | BIP000044 | Bad Request | It was not possible to pay the collection slip at this time. Please verify your information and, if necessary, contact us for assistance. | Não foi possível pagar a fatura de recolhimento neste momento. Por favor, verifique suas informações e, se necessário, entre em contato conosco para assistência. |
| 403         | BIP000052 | Forbidden | Given document number does not belong to an approver for this account | Número de documento enviado não pertence a um aprovador da conta |
| 400         | BIP000053 | Bad Request | Error getting approver data | Erro ao obter dados do aprovador |
| 400         | BIP000054 | Bad Request | TFA info required | Informações de TFA necessárias |
| 400         | BIP000055 | Bad Request | Error sending verification token | Erro ao enviar token de verificação |
| 400         | BIP000065 | Bad Request | Payment verification time window exceeded. | Janela de tempo de verificação de pagamento excedida. |

## Ambiente de Sandbox

Em nosso ambiente de sandbox, disponibilizamos linhas digitáveis mockadas para a simulação de pagamentos bem-sucedidos e testes de cenários de erro.

| Linha digitável |
|---|
| 828300000007411100972013905080001546763201900028 |
| 838000000009235700481007241345219112001474229880 |
| 848000000006308600802021201071261517689002201070 |
| 858200000015000000643025703477209504800448091020 |
| 858500000037350000643217212883260006147448091022 |

---

# Request bank slip batch scheduling with 2FA

URL: /en/documentation/baas/cobranca/2fa_v2/agendamento/solicitar_agendamento_em_lote_de_boleto_bancario

This endpoint allows requesting **batch scheduling** for bank slips in a single request, with two-factor authentication when applicable.

:::info Bank slip
A traditional bank slip (digitable line does not start with 8). It is registered in the Interbank Payment Chamber (CIP/Nuclea) and can be paid through financial and payment institutions authorized by the Central Bank.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/ ACCOUNT_KEY /payments_schedule/batch_bank_slip
METHOD POST

### Request Path Params

| Field               | Type    | Description                               | Characters |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` *     | uuid4   | Unique account identifier key.  | 36         |

Request Body: Bank slip batch scheduling

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "bank_slip_payment_schedules": [
    {
      "request_control_key": "c7915a43-212f-5813-9adc-d3ed5d3d3bfd",
      "digitable_line": "00190000090361557400500000024174396700000991000",
      "payment_amount": 1156.8,
      "payment_date": "2026-04-10"
    },
    {
      "request_control_key": "d8a26b54-323a-4924-0aed-e4fe6e4e4c0e",
      "barcode": "00190000090361557400500000024174396700000991000",
      "payment_amount": 200.5,
      "payment_date": "2026-04-15"
    }
  ],
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  }
}
```

### Body Params

| Field               | Type          | Description                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Unique client request identifier key (batch). |
| `bank_slip_payment_schedules` * | array     | List of bank slip schedules. Limit of **1000** items per request. |
| `tfa_info` *            | [object](#objeto-tfa_info)    | Object containing the approver document and token delivery channel. |

Each element in `bank_slip_payment_schedules` must contain:

| Field               | Type          | Description                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Unique client request identifier key for that batch item. |
| `barcode`               | string    | Barcode. |
| `digitable_line`        | string    | Digitable line. |
| `payment_amount` *      | number    | Amount to be paid. |
| `payment_date` *        | string    | Scheduled execution date for the item. |

:::danger Warning
For each item, `payment_amount` must follow the bank slip rules returned by the lookup. If partial payment is not allowed, the amount must match the updated total amount.
:::

### Object tfa_info

| Field                       | Type    | Description                         |
|-----------------------------|---------|-----------------------------------|
| `approver_document_number`* | string | Approver document number (CPF/CNPJ). |
| `contact_type`*             | enumerator | Authentication token delivery channel | **[Enumerator contact_type](#enumerador-contact_type)** |

| Enumerator | Description                                         |
|------------|---------------------------------------------------|
| **sms**    | Send token via SMS |
| **email**  | Send token via email                      |

## Response

### Success Response

STATUS 202

Response Body: Scheduling batch pending two-factor approval

```json
{
  "batch_payment_schedule_key": "c4325104-d60b-44f3-aae4-49155564a2ea",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
  "total_amount": 1357.3,
  "batch_payment_schedule_status": "pending_2fa_approval",
  "payment_type": "bank_slip"
}
```

### Response Body Params

| Field               | Type    | Description                         |
|---------------------|---------|-----------------------------------|
| `batch_payment_schedule_key` *       | uuid4 | Unique batch scheduling identifier key. |
| `request_control_key` *     | uuid4 | Unique client request identifier key (batch). |
| `account_key` *             | uuid4 | Debited account key. |
| `total_amount` *            | number | Sum of (`payment_amount`) values for batch items. |
| `batch_payment_schedule_status` *         | [enum](#enumeradores-batch_payment_schedule_status) | Batch scheduling status after request. |
| `payment_type` *            | [enum](#enumeradores-payment_type) | Payment type. |

### Enumerators batch_payment_schedule_status

| Enumerator    | Description     |
|---------------|---------------|
| `pending_2fa_approval` | Pending 2FA approval |
| `scheduled`   | Scheduled |
| `rejected`    | Rejected |
| `error`       | Scheduling error |

### Enumerators payment_type

| Enumerator    | Type      | Description     |
|---------------|-----------|---------------|
| `bank_slip`     | string    | Bank slip    |
| `collection_slip` | string  | Collection slip |

:::danger Warning
The `collection_slip` enumerator does not apply to the bank slip batch scheduling flow for this endpoint; expected `payment_type` value is `bank_slip`.
:::

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Title",
    "description": "Description in English",
    "translation": "Description in Portuguese",
    "code": "Code"
}
```

| HTTP Code | QI Code | Title | Description (eng) | Description (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 403         | BIP000010 | Forbidden | User is not allowed to do this action | User is not allowed to do this action |
| 404         | BIP000011 | Not Found | The source account key was not found. | The source account key was not found. |
| 400         | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | It was not possible to consult the source account at this time. Please try again in a few minutes. |
| 400         | BIP000024 | Bad Request | Request control key already exists. | Request control key already exists. |
| 400         | BIP000052 | Bad Request | Given document number does not belong to an approver for this account | Given document number does not belong to an approver for this account |
| 400         | BIP000053 | Bad Request | Error getting approver date | Error getting approver date |
| 400         | BIP000054 | Bad Request | TFA info required | TFA info required |
| 400         | BIP000055 | Bad Request | Error sending verification token | Error sending verification token |
| 400         | BIP000065 | Bad Request | Payment verification time window exceeded. | Payment verification time window exceeded. |

---

# Request collection slip batch scheduling with 2FA

URL: /en/documentation/baas/cobranca/2fa_v2/agendamento/solicitar_agendamento_em_lote_de_fatura_de_recolhimento

This endpoint allows solicitar o **scheduling em batch** de collection slips (convênio/tributo) em uma única request, com autenticação de dois fatores quando aplicável.

:::info Fatura de recolhimento
Esse tipo de cobrança é emitido por concessionárias de serviços (account de água, luz, telefone e gás) e órgãos públicos (tributos). Eles não são registrados na Câmara Interbancária de Pagamento (CIP/Núclea), por isso, não retornam as mesmas informações que um Boleto bancário apresenta.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/ ACCOUNT_KEY /payments_schedule/batch_collection_slip
METHOD POST

### Request Path Params

| Field               | Type    | Description                               | Characters |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` *     | uuid4   | Chave única de identificação da account.  | 36         |

Request Body: Scheduling em batch de collection slips

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "collection_slip_payment_schedules": [
    {
      "request_control_key": "c7915a43-212f-5813-9adc-d3ed5d3d3bfd",
      "digitable_line": "836200000138892100450006762142420244046000010192",
      "payment_amount": 1389.21,
      "payment_date": "2026-04-10"
    },
    {
      "request_control_key": "d8a26b54-323a-4924-0aed-e4fe6e4e4c0e",
      "barcode": "836200000138892100450006762142420244046000010192",
      "payment_amount": 550.10,
      "payment_date": "2026-04-15"
    }
  ],
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  }
}
```

### Body Params

| Field               | Type          | Description                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Chave única de identificação da request do cliente (batch). |
| `collection_slip_payment_schedules` * | array     | Lista de schedulings de collection slip. Limite de **1000** itens por request. |
| `tfa_info` *            | [object](#objeto-tfa_info)    | Object contendo o documento da pessoa aprovadora da account e a forma de accountto. |

Cada elemento de `collection_slip_payment_schedules` deve conter:

| Field               | Type          | Description                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Chave única de identificação da request do cliente para aquele item do batch. |
| `barcode`               | string    | Código de barras. |
| `digitable_line`        | string    | Linha digitável. |
| `payment_amount` *      | number    | Valor a ser pago. |
| `payment_date` *        | string    | Data do scheduling do item. |

### Object tfa_info

| Field                       | Type    | Description                         |
|-----------------------------|---------|-----------------------------------|
| `approver_document_number`* | string | Número de documento da pessoa aprovadora da account (CPF/CNPJ). |
| `contact_type`*             | enumerator | Forma de envio do token de autenticação | **[Enumerator contact_type](#enumerador-contact_type)** |

| Enumerator | Description                                         |
|------------|---------------------------------------------------|
| **sms**    | Envio por mensagem de texto para telefone celular |
| **email**  | Envio por correio eletrônico                      |

## Response

### Success Response

STATUS 202

Response Body: Batch de scheduling pendente de aprovação de dois fatores

```json
{
  "batch_payment_schedule_key": "33860ad0-bcb0-47b7-bbe7-c7e3ec2fc61a",
  "request_control_key": "ae4508df-f2cb-4e28-9f04-a19b7f2758c9",
  "account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "total_amount": 1939.31,
  "batch_payment_schedule_status": "pending_2fa_approval",
  "payment_type": "collection_slip"
}
```

### Response Body Params

| Field               | Type    | Description                         |
|---------------------|---------|-----------------------------------|
| `batch_payment_schedule_key` *       | uuid4 | Chave única de identificação do scheduling em batch. |
| `request_control_key` *     | uuid4 | Chave única de identificação da request do cliente (batch). |
| `account_key` *             | uuid4 | Chave da account debitada. |
| `total_amount` *            | number | Soma dos valores (`payment_amount`) dos itens do batch. |
| `batch_payment_schedule_status` *         | [enum](#enumeradores-batch_payment_schedule_status) | Batch scheduling status after request. |
| `payment_type` *            | [enum](#enumeradores-payment_type) | Type do payment. |

### Enumerators batch_payment_schedule_status

| Enumerator    | Description     |
|---------------|---------------|
| `pending_2fa_approval` | Pendente de aprovação 2FA |
| `scheduled`   | Scheduled |
| `rejected`    | Rejected |
| `error`       | Scheduling error |

### Enumerators payment_type

| Enumerator    | Type      | Description     |
|---------------|-----------|---------------|
| `bank_slip`     | string    | Boleto bancário    |
| `collection_slip` | string  | Fatura de recolhimento |

:::danger Warning
O enumerador `bank_slip` não se aplica ao fluxo de scheduling em batch de collection slips deste endpoint; para este caso, espera-se `payment_type` com valor `collection_slip`.
:::

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Description em português",
    "code": "Código"
}
```

| Código HTTP | Código QI | Título | Description (eng) | Description (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 400         | BIP000032 | Bad Request | The bill sent does not correspond to a collection slip. | A account enviada não corresponde a uma collection slip. |
| 400         | BIP000033 | Bad Request | The barcode or digitable line of the collection slip must have 44 or 48 characters. | O código de barras ou linha digitável da collection slip deve ter 44 ou 48 caracteres. |
| 403         | BIP000010 | Forbidden | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404         | BIP000011 | Not Found | The source account key was not found. | A chave da account de origem não foi encontrada. |
| 400         | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a account de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400         | BIP000024 | Bad Request | Request control key already exists. | Chave de controle da request já existe. |
| 403         | BIP000052 | Forbidden | Given document number does not belong to an approver for this account | Número de documento enviado não pertence a um aprovador da account |
| 400         | BIP000053 | Bad Request | Error getting approver date | Erro ao obter dados do aprovador |
| 400         | BIP000054 | Bad Request | TFA info required | Informações de TFA necessárias |
| 400         | BIP000055 | Bad Request | Error sending verification token | Erro ao enviar token de verificação |
| 400         | BIP000065 | Bad Request | Payment verification time window exceeded. | Janela de tempo de verificação de payment excedida. |

---

# Bank slip payment batch confirmation

URL: /en/documentation/baas/cobranca/2fa_v2/confirmacao_de_lote_de_boleto_bancario

This document describes the **same route** as [Bank slip payment batch confirmation](../confirmacao_de_lote_de_boleto_bancario.md) when the operation requires **two-factor authentication (2FA)** at the confirmation step: the request body must include **`tfa_info`** together with `batch_status: approved` or `batch_status: rejected`. Then, the batch may remain in `pending_2fa_approval` (approval) or `pending_2fa_rejection` (rejection) until **token validation**.

:::info Bank slip
A traditional bank slip (digitable line not starting with digit 8). It is registered in the Interbank Payment Chamber (CIP/Núclea) and can be paid at financial and payment institutions authorized by the Central Bank.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/**ACCOUNT_KEY**/payment/batch_bank_slip/**PAYMENT_BATCH_KEY**/confirmation
METHOD PATCH

### Request Path Params

| Field                 | Type  | Description                                                                                | Characters |
| --------------------- | ----- | ---------------------------------------------------------------------------------------- | ---------- |
| `account_key` *       | uuid4 | Unique account identifier.                                                   | 36         |
| `payment_batch_key` * | uuid4 | Unique batch identifier (`batch_payment_key` returned at batch creation). | 36         |

### Request Body

**Request Body: Batch rejection (with `tfa_info`)**

```json
{
  "batch_status": "rejected",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  }
}
```

**Request Body: Batch approval (with `tfa_info`)**

```json
{
  "batch_status": "approved",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  }
}
```

### Body Params

| Field            | Type   | Description                                                                                                                                                                                                                                                                                                                                              |
| ---------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `batch_status` * | string | Batch decision. Values: `approved` (continue processing) or `rejected` (cancel the batch). See [batch_confirmation_status enumerator](#enumerador-batch_confirmation_status).                                                                                                                                                     |
| `tfa_info`       | object | Required in this flow with `batch_status: approved` or `batch_status: rejected`; provide approver information and token delivery channel in [tfa_info object](#object-tfa_info). |

### Enumerator batch_confirmation_status

| Value      | Description                                                     |
| ---------- | ------------------------------------------------------------- |
| `approved` | Approve the batch and continue the processing flow.          |
| `rejected` | Reject the batch; there is no asynchronous processing of bank slips. |

### Object tfa_info

| Field                        | Type   | Description                                                                                                                                          |
| ---------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `approver_document_number` * | string | Approver person's document number (CPF) that will receive the token. Required when `tfa_info` is provided.                                                |
| `contact_type` *             | string | Channel used to send the token (for example, `sms` or `email`), according to operation and registration rules. Required when `tfa_info` is provided. |

## Response

The HTTP status and the `batch_status` field in the response depend on the submitted decision and whether the flow requires token validation after this call.

### Response: rejected batch — pending token validation (2FA)

STATUS 202

When `batch_status` in the request body is `rejected` and the request includes `tfa_info`, the API responds with **202**. The batch waits for token validation, and the body returns `batch_status` as `pending_2fa_rejection`. After token validation, the rejection decision is applied.

**Response Body: Batch waiting for token validation (rejection decision)**

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
  "total_amount": 1357.3,
  "batch_status": "pending_2fa_approval",
  "payment_type": "bank_slip"
}
```

### Response: approved batch — pending token validation (2FA)

STATUS 202

When `batch_status` in the body is `approved` and the request includes `tfa_info`, the API responds with **202**. The batch waits for token validation, and the body returns `batch_status` as `pending_2fa_approval`. Next steps (code delivery, validation, and resend) are documented in [Batch bank slip token validation](./validacao_de_token_de_lote_de_boleto_bancario.md) and [Resend batch bank slip token](./solicitacao_de_reenvio_de_token_de_lote_de_boleto_bancario.md).

**Response Body: Batch waiting for token validation**

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
  "total_amount": 1357.3,
  "batch_status": "pending_2fa_rejection",
  "payment_type": "bank_slip"
}
```

### Response Body Params

| Field                   | Type   | Description                                                                                                                                                                                                                                                                     |
| ----------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `batch_payment_key` *   | uuid4  | Unique batch payment identifier.                                                                                                                                                                                                                            |
| `request_control_key` * | uuid4  | Unique client request identifier (batch).                                                                                                                                                                                                                 |
| `account_key` *         | uuid4  | Debited account key.                                                                                                                                                                                                                                                      |
| `total_amount` *        | number | Sum of the amounts of all batch items.                                                                                                                                                                                                                                           |
| `batch_status` *        | string | In this call, the batch remains in `pending_2fa_approval` (approval) or `pending_2fa_rejection` (rejection) until token validation. After validation, the final status reflects the decision sent in confirmation (`approved` or `rejected`). |
| `payment_type` *        | string | Payment type; for this flow, expected value is `bank_slip`.                                                                                                                                                                                                                    |

### Error Response

STATUS 4XX

**Response Body**

```json
{
    "title": "Title",
    "description": "Description in english",
    "translation": "Description em português",
    "code": "Code"
}
```

| HTTP code | QI code | Title      | Description (eng)                               | Description (pt-br)                                     |
| ----------- | --------- | ----------- | --------------------------------------------- | ----------------------------------------------------- |
| 400         | BIP000013 | Bad Request | The source account is closed.                 | The source account is closed.                       |
| 400         | BIP000050 | Bad Request | Requester configuration does not exist        | Requester configuration does not exist.                 |
| 400         | BIP000054 | Bad Request | TFA info required.                            | TFA info required.                       |
| 404         | BIP000083 | Not Found   | Batch payment not found by batch payment key. | Batch payment not found by batch payment key. |
| 400         | BIP000084 | Bad Request | Batch payment status is not pending.          | Batch payment status is not pending.     |

---

# Collection slip (utility/tax) payment batch confirmation

URL: /en/documentation/baas/cobranca/2fa_v2/confirmacao_de_lote_de_fatura_de_recolhimento

This document describes the **same route** as [Collection slip payment batch confirmation (utility/tax)](../confirmacao_de_lote_de_fatura_de_recolhimento.md) when the operation requires **two-factor authentication (2FA)** at the confirmation step: the request body must include **`tfa_info`** together with `batch_status: approved` or `batch_status: rejected`. Then, the batch may remain in `pending_2fa_approval` (approval) or `pending_2fa_rejection` (rejection) until **token validation**.

:::info Collection slip (utility/tax bill)
This charge type is issued by utility companies (water, electricity, phone, and gas) and public agencies (taxes). It is not registered in the Interbank Payment Chamber (CIP/Núclea), so it does not return the same information as a bank slip.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/**ACCOUNT_KEY**/payment/batch_collection_slip/**PAYMENT_BATCH_KEY**/confirmation
METHOD PATCH

### Request Path Params

| Field                 | Type  | Description                                                                                | Characters |
| --------------------- | ----- | ---------------------------------------------------------------------------------------- | ---------- |
| `account_key` *       | uuid4 | Unique account identifier.                                                   | 36         |
| `payment_batch_key` * | uuid4 | Unique batch identifier (`batch_payment_key` returned at batch creation). | 36         |

### Request Body

**Request Body: Batch rejection (with `tfa_info`)**

```json
{
  "batch_status": "rejected",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  }
}
```

**Request Body: Batch approval (with `tfa_info`)**

```json
{
  "batch_status": "approved",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  }
}
```

### Body Params

| Field            | Type   | Description                                                                                                                                                                                                                                                                                                                                              |
| ---------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `batch_status` * | string | Batch decision. Values: `approved` (continue processing) or `rejected` (cancel the batch). See [batch_confirmation_status enumerator](#enumerador-batch_confirmation_status).                                                                                                                                                     |
| `tfa_info`       | object | Required in this flow with `batch_status: approved` or `batch_status: rejected`; provide approver information and token delivery channel in [tfa_info object](#object-tfa_info). |

### Enumerator batch_confirmation_status

Accepted values in the request body for `batch_status`:

| Value      | Description                                                                     |
| ---------- | ----------------------------------------------------------------------------- |
| `approved` | Approve the batch and continue the processing flow.                          |
| `rejected` | Reject the batch; there is no asynchronous processing of collection slips. |

### Object tfa_info

| Field                        | Type   | Description                                                                                                                                          |
| ---------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `approver_document_number` * | string | Approver person's document number (CPF) that will receive the token. Required when `tfa_info` is provided.                                                |
| `contact_type` *             | string | Channel used to send the token (for example, `sms` or `email`), according to operation and registration rules. Required when `tfa_info` is provided. |

## Response

The HTTP status and the `batch_status` field in the response depend on the submitted decision and whether the flow requires token validation after this call.

### Response: rejected batch — pending token validation (2FA)

STATUS 202

When `batch_status` in the request body is `rejected` and the request includes `tfa_info`, the API responds with **202**. The batch waits for token validation, and the body returns `batch_status` as `pending_2fa_rejection`. After token validation, the rejection decision is applied.

**Response Body: Batch waiting for token validation (rejection decision)**

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "total_amount": 2778.42,
  "batch_status": "pending_2fa_rejection",
  "payment_type": "collection_slip"
}
```

### Response: approved batch — pending token validation (2FA)

STATUS 202

When `batch_status` in the body is `approved` and the request includes `tfa_info`, the API responds with **202**. The batch waits for token validation, and the body returns `batch_status` as `pending_2fa_approval`. Next steps are documented in [Batch collection slip token validation](./validacao_de_token_de_lote_de_fatura_de_recolhimento.md) and [Resend batch collection slip token](./solicitacao_de_reenvio_de_token_de_lote_de_fatura_de_recolhimento.md).

**Response Body: Batch waiting for token validation**

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "total_amount": 2778.42,
  "batch_status": "pending_2fa_rejection",
  "payment_type": "collection_slip"
}
```

### Response Body Params

| Field                   | Type   | Description                                                                                                                                                                                                                                                                                    |
| ----------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `batch_payment_key` *   | uuid4  | Unique batch payment identifier.                                                                                                                                                                                                                                           |
| `request_control_key` * | uuid4  | Unique client request identifier (batch).                                                                                                                                                                                                                                |
| `account_key` *         | uuid4  | Debited account key.                                                                                                                                                                                                                                                                     |
| `total_amount` *        | number | Sum of the amounts of all batch items.                                                                                                                                                                                                                                                          |
| `batch_status` *        | string | In this call, the batch remains in `pending_2fa_approval` (approval) or `pending_2fa_rejection` (rejection) until token validation. After validation, the final status reflects the decision sent in confirmation (`approved` or `rejected`). |
| `payment_type` *        | string | Payment type; for this flow, expected value is `collection_slip`.                                                                                                                                                                                                                             |

### Error Response

STATUS 4XX

**Response Body**

```json
{
    "title": "Title",
    "description": "Description in english",
    "translation": "Description em português",
    "code": "Code"
}
```

| HTTP code | QI code | Title      | Description (eng)                               | Description (pt-br)                                     |
| ----------- | --------- | ----------- | --------------------------------------------- | ----------------------------------------------------- |
| 400         | BIP000013 | Bad Request | The source account is closed.                 | The source account is closed.                       |
| 400         | BIP000050 | Bad Request | Requester configuration does not exist        | Requester configuration does not exist.                 |
| 400         | BIP000054 | Bad Request | TFA info required.                            | TFA info required.                       |
| 404         | BIP000083 | Not Found   | Batch payment not found by batch payment key. | Batch payment not found by batch payment key. |
| 400         | BIP000084 | Bad Request | Batch payment status is not pending.          | Batch payment status is not pending.     |

---

# Confirm boleto payment

URL: /en/documentation/baas/cobranca/2fa_v2/confirmacao_de_pagamento_de_boleto_bancario

This endpoint allows the confirmation of boleto payment.
:::info Boleto
This is the conventional boleto (with digitable lines not starting with the digit 8). It is registered with the Interbank Payment Clearinghouse (CIP/Núclea) and can be paid at financial institutions and payment institutions authorized to operate by the Central Bank.
:::

## Request

### Request Endpoint

ENDPOINT /account/ ACCOUNT_KEY /payment/ PAYMENT_KEY /bank_slip/validate_token
MÉTODO PATCH

### Request Path Params
| Field | Type | Description | Characters |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` * | uuid4 | Unique account identification key. | 36 |
| `payment_key` * | uuid4 | Unique payment identification key. | 36 |
Request Body: Boleto payment confirmation

```json
{
  "token": "329adf"
}
```

### Body Params

| Field | Type | Description |
|---------------------|---------------|-----------------------------------|
| `token` * | string | Authentication code sent to the account's transaction approver |

## Response

### Success Response

STATUS 200

Response Body: Payment executed

```json
{
   "payment_key":"c4325104-d60b-44f3-aae4-49155564a2ea",
   "request_control_key":"b713b2f6-2f48-4d18-b0c9-7186e4edf189",
   "payer_name":"COOPERATIVA INDUSTRIAL MURILO",
   "payer_document_number":"00037025000160",
   "source_account_key":"6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
   "transaction_key":"4e80070a-a0bb-4be2-8178-55fbd73a3704",
   "transaction_revert_key":null,
   "paid_amount":1050.1,
   "payment_date":"2024-04-03",
   "payment_type":"bank_slip",
   "bank_slip": {
        "bank_slip_key":"95080ffd-3ac5-48d7-b3fe-659e4aaba81a",
        "barcode":"00193967000009910000000003615574000000002417",
        "digitable_line":"00190000090361557400500000024174396700000991000",
        "payer_name":"COOPERATIVA TESTE",
        "payer_document_number":"00037025000160",
        "beneficiary_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_trading_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_document_number":"52069937000117",
        "beneficiary_bank_ispb":"00000000",
        "guarantor_name":null,
        "guarantor_document_number":null,
        "expiration_date":"2024-03-29",
        "max_payment_data": "2026-03-29",
        "partial_payment_indicator":"allowed",
        "registered_payment_amount":9029.0,
        "nominal_amount":9910.0,
        "total_amount":10129.1,
        "rebate_amount":0.0,
        "discount_amount":0.0,
        "fine_amount":0.0,
        "interest_amount":219.1
    },
   "collection_slip":null,
   "payment_status":"executed"
}
```

STATUS 202

Response Body: Payment pending execution

```json
{
   "payment_key":"c4325104-d60b-44f3-aae4-49155564a2ea",
   "request_control_key":"b713b2f6-2f48-4d18-b0c9-7186e4edf189",
   "payer_name":"COOPERATIVA INDUSTRIAL MURILO",
   "payer_document_number":"00037025000160",
   "source_account_key":"6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
   "transaction_key":"4e80070a-a0bb-4be2-8178-55fbd73a3704",
   "transaction_revert_key":null,
   "paid_amount":1050.1,
   "payment_date":"2024-04-03",
   "payment_type":"bank_slip",
   "bank_slip": {
        "bank_slip_key":"95080ffd-3ac5-48d7-b3fe-659e4aaba81a",
        "barcode":"00193967000009910000000003615574000000002417",
        "digitable_line":"00190000090361557400500000024174396700000991000",
        "payer_name":"COOPERATIVA TESTE",
        "payer_document_number":"00037025000160",
        "beneficiary_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_trading_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_document_number":"52069937000117",
        "beneficiary_bank_ispb":"00000000",
        "guarantor_name":null,
        "guarantor_document_number":null,
        "expiration_date":"2024-03-29",
        "max_payment_data": "2026-03-29",
        "partial_payment_indicator":"allowed",
        "registered_payment_amount":9029.0,
        "nominal_amount":9910.0,
        "total_amount":10129.1,
        "rebate_amount":0.0,
        "discount_amount":0.0,
        "fine_amount":0.0,
        "interest_amount":219.1
    },
   "collection_slip":null,
   "payment_status": "pending_execution"
}
```
:::info Information
If **HTTP Status 202** is returned with the field `payment_status` having the value **pending_execution**, the payment should not be retried.
This payment will be processed asynchronously. It is necessary to check the transfer status through the payment query, or wait for the pending payment webhook described on the [webhooks page](/documentation/baas_v2/cobranca/webhooks).
:::
### Response Body Params
| Field | Type | Description |
|---------------------|---------|-----------------------------------|
| `payment_key` * | uuid4 | Unique payment identification key. |
| `request_control_key` * | uuid4 | Unique identification key for the client's request. |
| `payer_name` * | string | Name of the effective payer. |
| `payer_document_number` * | string | Document number of the effective payer (CPF/CNPJ). |
| `source_account_key` * | uuid4 | Key of the debited account. |
| `transaction_key` * | uuid4 | Payment transaction key. |
| `transaction_revert_key` | uuid4 | Payment reversal transaction key. |
| `paid_amount` * | number | Amount effectively paid. |
| `payment_date` * | string | Payment date. |
| `payment_type` * | [enum](#enumerators-payment_type) | Payment type. |
| `bank_slip` | [object](#object-bank_slip) | Boleto. |
| `collection_slip` | object | Collection invoice. |
| `payment_status` * | [enum](#enumerators-payment_status) | Payment status. |
### Enumerators payment_type
| Enumerator | Type | Description |
|---------------|-----------|---------------|
| `bank_slip` | string | Boleto |
| `collection_slip` | string | Collection invoice |
:::danger Warning
The enumerator `collection_slip` does not apply to the boleto flow, and the collection_slip object will always be null.
:::
### Enumerators payment_status
| Enumerator | Description |
|---------------|---------------|
| `pending_execution` | Pending execution |
| `executed` | Executed |
| `reverted` | Reverted |
| `rejected` | Rejected |
| `error` | Error |
:::danger Warning
For payments where QI does not receive a response from CIP within two minutes, the payment will be returned with the status `pending_execution`. After QI receives the response from CIP, the pending payment webhook described on the [webhooks page](/documentation/baas_v2/cobranca/webhooks) will be sent to the client.
:::

### Object bank_slip
| Field | Type | Description |
|-----------------------------------|---------|-----------------------------------|
| `barcode` * | string | Barcode. |
| `digitable_line` * | string | Digitable line. |
| `payer_name` * | string | Payer's name. |
| `payer_document_number` * | string | Payer's document number (CPF/CNPJ). |
| `beneficiary_name` * | string | Beneficiary's name. |
| `beneficiary_trading_name` | string | Beneficiary's trade name. |
| `beneficiary_document_number` * | string | Beneficiary's document number (CPF/CNPJ). |
| `beneficiary_bank_ispb` * | string | ISPB code of the beneficiary's bank. |
| `guarantor_name` | string | Name of the guarantor. |
| `guarantor_document_number` | string | Guarantor's document number (CPF/CNPJ). |
| `expiration_date` * | string | Due date. |
| `max_payment_date` * | string | Maximum payment date. |
| `partial_payment_indicator` * | [enum](#enumerators-partial_payment_indicator) | Partial payment indicator. |
| `registered_payment_amount` | string | Total registered payment amount. |
| `nominal_amount` * | number | Original amount. |
| `total_amount` * | number | Total amount. |
| `rebate_amount` * | number | Rebate amount. |
| `discount_amount` * | number | Discount amount. |
| `fine_amount` * | number | Fine amount. |
| `interest_amount` * | number | Interest amount. |
### Enumerators partial_payment_indicator
| Enumerator | Type | Description |
|---------------|-----------|---------------|
| `allowed` | string | Allowed |
| `not_allowed` | string | Not allowed |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Description in portuguese",
    "code": "Código"
}
```
| HTTP Code | QI Code | Title | Description (eng) | Description (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 403 | BIP000010 | Forbidden | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404 | BIP000011 | Not Found | The source account key was not found. | A chave da conta de origem não foi encontrada. |
| 400 | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400 | BIP000013 | Bad Request | The source account is closed. | A conta de origem está fechada. |
| 400 | BIP000014 | Bad Request | The source account is blocked. | A conta de origem está bloqueada. |
| 400 | BIP000022 | Bad Request | Bank slip payment service is closed. | Serviço de pagamento de boleto está fechado. |
| 400 | BIP000023 | Bad Request | The source account has insufficient balance. Payment cannot be made. | A conta de origem possui saldo insuficiente. Pagamento não pode ser realizado. |
| 400 | BIP000025 | Bad Request | It was not possible to pay the bank slip at this time. Please verify your information and, if necessary, contact us for assistance. | Não foi possível pagar o boleto neste momento. Por favor, verifique suas informações e, se necessário, entre em contato conosco para assistência. |
| 400 | BIP000028 | Bad Request | The source account has blocked balance. Payment cannot be made. | A conta de origem possui saldo em conta bloqueado. Pagamento não pode ser realizado. |
| 404 | BIP000056 | Not Found | Payment not found. | Pagamento não encontrado. |
| 400 | BIP000057 | Bad Request | Payment status is not pending approval. | Status de pagamento não é de aprovação pendente. |
| 400 | BIP000058 | Bad Request | Error while validating verification token | Erro ao validar token de verificação |
| 400 | BIP000059 | Bad Request | Number of verification token validation attempts exceeded. | Número de tentativas de validação de token de verificação excedido. |
| 400 | BIP000060 | Bad Request | Verification token expired. | Token de verificação expirado. |
| 400 | BIP000061 | Bad Request | Verification token validation failed. | Falha na validação do token de verificação. |
| 400 | BIP000062 | Bad Request | Payment type is not bank slip. | Tipo de pagamento não é boleto. |
| 400 | BIP000065 | Bad Request | Payment verification time window exceeded. | Janela de tempo de verificação de pagamento excedida. |

---

# Confirm payment of collection invoice (agreement/tribute)

URL: /en/documentation/baas/cobranca/2fa_v2/confirmacao_de_pagamento_de_fatura_de_recolhimento

This endpoint allows the confirmation of collection invoice payments.
:::info Collection Invoice
This type of charge is issued by utility companies (water, electricity, telephone, and gas bills) and public entities (taxes). They are not registered with the Interbank Payment Clearinghouse (CIP/Núclea) and, therefore, do not return the same information as a boleto.
:::

## Request

### Request Endpoint

ENDPOINT /account/ ACCOUNT_KEY /payment/ PAYMENT_KEY /collection_slip/validate_token
MÉTODO PATCH

### Request Path Params

| Field | Type | Description | Characters |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` * | uuid4 | Unique account identification key. | 36 |
| `payment_key` * | uuid4 | Unique payment identification key. | 36 |

Request Body: Collection invoice payment confirmation

```json
{
  "token": "329adf"
}
```

### Body Params

| Field | Type | Description |
|---------------------|---------------|-----------------------------------|
| `token` * | string | Authentication code sent to the account's transaction approver |

## Response

### Success Response

STATUS 200

Response Body: Payment executed

```json
{
  "payment_key": "33860ad0-bcb0-47b7-bbe7-c7e3ec2fc61a",
  "request_control_key": "ae4508df-f2cb-4e28-9f04-a19b7f2758c9",
  "payer_name": "COOPERATIVA INDUSTRIAL MURILO",
  "payer_document_number": "62069937000118",
  "source_account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "transaction_key": "fc9ccfd0-2f21-4207-9772-69238be74152",
  "transaction_revert_key": null,
  "paid_amount": 1389.21,
  "payment_date": "2024-04-30",
  "payment_type": "collection_slip",
  "bank_slip": null,
  "collection_slip": {
    "barcode": null,
    "digitable_line": "836200000138892100450006762142420244046000010192",
    "collection_name": "CIA ULTRAGAZ SA-COD",
    "collection_document_number": "00394460005887",
    "expiration_date": "2024-04-15",
    "total_amount": 1389.21
  },
  "payment_status": "executed"
}
```

### Response Body Params
| Field | Type | Description |
|---------------------|---------|-----------------------------------|
| `payment_key` * | uuid4 | Unique payment identification key. |
| `request_control_key` * | uuid4 | Unique identification key for the client's request. |
| `payer_name` * | string | Name of the effective payer. |
| `payer_document_number` * | string | Document number of the effective payer (CPF/CNPJ). |
| `source_account_key` * | uuid4 | Key of the debited account. |
| `transaction_key` * | uuid4 | Payment transaction key. |
| `transaction_revert_key` | uuid4 | Payment reversal transaction key. |
| `paid_amount` * | number | Amount effectively paid. |
| `payment_date` * | string | Payment date. |
| `payment_type` * | [enum](#enumerators-payment_type) | Payment type. |
| `bank_slip` | object | Boleto bancário. |
| `collection_slip` | [object](#object-collection_slip) | Collection invoice. |
| `payment_status` * | [enum](#enumerators-payment_status) | Payment status. |

### Enumerators payment_type

| Enumerator | Type | Description |
|---------------|-----------|---------------|
| `bank_slip` | string | Boleto bancário |
| `collection_slip` | string | Collection invoice |

:::danger Warning
The enumerator `bank_slip` does not apply to the collection invoice flow, and the bank_slip object will always be null.
:::

### Enumerators payment_status

| Enumerator | Description |
|---------------|---------------|
| `executed` | Executed |
| `reverted` | Reverted |
| `rejected` | Rejected |
| `error` | Error |

### Object collection_slip

| Field | Type | Description |
|-----------------------------------|---------|-----------------------------------|
| `barcode` | string | Barcode. |
| `digitable_line` | string | Digitable line. |
| `collection_name` * | string | Name of the agreement. |
| `collection_document_number` | string | Document number of the agreement (CPF/CNPJ). |
| `expiration_date` * | string | Due date. |
| `total_amount` * | number | Total amount. |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Description in portuguese",
    "code": "Código"
}
```
| HTTP Code | QI Code | Title | Description (eng) | Description (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 403 | BIP000010 | Forbidden | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404 | BIP000011 | Not Found | The source account key was not found. | A chave da conta de origem não foi encontrada. |
| 400 | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400 | BIP000013 | Bad Request | The source account is closed. | A conta de origem está fechada. |
| 400 | BIP000014 | Bad Request | The source account is blocked. | A conta de origem está bloqueada. |
| 400 | BIP000023 | Bad Request | The source account has insufficient balance. Payment cannot be made. | A conta de origem possui saldo insuficiente. Pagamento não pode ser realizado. |
| 400 | BIP000028 | Bad Request | The source account has blocked balance. Payment cannot be made. | A conta de origem possui saldo em conta bloqueado. Pagamento não pode ser realizado. |
| 400 | BIP000036 | Bad Request | Covenant slip overdue. | Fatura de recolhimento vencida. |
| 400 | BIP000038 | Bad Request | Outside of covenant payment hours. | Fora do horário de pagamento do convênio. |
| 400 | BIP000044 | Bad Request | It was not possible to pay the collection slip at this time. Please verify your information and, if necessary, contact us for assistance. | Não foi possível pagar a fatura de recolhimento neste momento. Por favor, verifique suas informações e, se necessário, entre em contato conosco para assistência. |
| 400 | BIP000045 | Bad Request | Collection slip payment service is closed. | Serviço de pagamento de fatura de recolhimento está fechado. |
| 404 | BIP000056 | Not Found | Payment not found. | Pagamento não encontrado. |
| 400 | BIP000057 | Bad Request | Payment status is not pending approval. | Status de pagamento não é de aprovação pendente. |
| 400 | BIP000058 | Bad Request | Error while validating verification token | Erro ao validar token de verificação |
| 400 | BIP000059 | Bad Request | Number of verification token validation attempts exceeded. | Número de tentativas de validação de token de verificação excedido. |
| 400 | BIP000060 | Bad Request | Verification token expired. | Token de verificação expirado. |
| 400 | BIP000061 | Bad Request | Verification token validation failed. | Falha na validação do token de verificação. |
| 400 | BIP000063 | Bad Request | Payment type is not collection slip. | Tipo de pagamento não é fatura de recolhimento. |
| 400 | BIP000065 | Bad Request | Payment verification time window exceeded. | Janela de tempo de verificação de pagamento excedida. |

---

# Introduction to Two-Factor Authentication

URL: /en/documentation/baas/cobranca/2fa_v2/introducao_ao_pagamento_2fa

In this type of payment, payment confirmation via token sent to the person with approval powers for transactions on the payer's account is required.
The payment request by integrator partners configured to use two-factor authentication is performed similarly to what is described in [boleto payment](/documentation/baas/cobranca/pagar_boleto_bancario) and [collection invoice payment](/documentation/baas/cobranca/pagar_fatura_de_recolhimento). The difference is the addition of the `tfa_info` object in the request, containing information about the transfer approver and the means of contact, and the status of the request in the response. The status of the request will always be returned as **pending_2fa_approval**.
## Flow for a Payment with Authorization
The successful payment will follow the following process flow:
- Perform the [boleto payment request](/documentation/baas/cobranca/2fa_v2/solicitacao_de_pagamento_de_boleto_bancario) or [collection invoice payment request](/documentation/baas_v2/cobranca/2fa_v2/solicitacao_de_pagamento_de_fatura_de_recolhimento) and receive a synchronous response with status **pending_2fa_approval** and the `payment_key`.
- The indicated approver will receive a 6-digit `token` consisting of letters and digits.
- The requester performs the [boleto payment confirmation](/documentation/baas/cobranca/2fa_v2/confirmacao_de_pagamento_de_boleto_bancario) or [collection invoice payment confirmation](/documentation/baas/cobranca/2fa_v2/confirmacao_de_pagamento_de_fatura_de_recolhimento) with the `payment_key` and the `token`.
- The payment will be completed synchronously.
## Observations
- Each payment has a maximum limit of 5 validation attempts for the `token`. When this limit is reached, the payment will be automatically set to rejected (**rejected**) status.
- Each `token` has a maximum duration of 5 minutes.
- A payment can have its `token` renewed and resent to the account approver. This process resets the 5-minute time but does not reset the invalid attempt counter. The previous `token` becomes invalid.
- Once the payment is approved, it will be completed synchronously.
- The notification event for sending the `token` to the approver is **baas.token_validation.bill_payment.payment.single**. It is possible to [customize](/documentation/notificacoes/template) the sent message.
- The implemented `contact_type` for sending tokens are **sms** and **email**.

---

# Request boleto payment (2FA)

URL: /en/documentation/baas/cobranca/2fa_v2/solicitacao_de_pagamento_de_boleto_bancario

This endpoint allows the payment request for boletos. The request should be made after a consultation, using the returned information to ensure the correct flow and avoid failures during the process.
:::info Boleto
This is the conventional boleto (with digitable lines not starting with the digit 8). It is registered with the Interbank Payment Clearinghouse (CIP/Núclea) and can be paid at financial institutions and payment institutions authorized to operate by the Central Bank.
:::

## Request

### Request Endpoint

ENDPOINT /account/ ACCOUNT_KEY /payment/bank_slip
MÉTODO POST

### Request Path Params

| Field | Type | Description | Characters |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` * | uuid4 | Unique account identification key. | 36 |

Request Body: Boleto request with digitable line

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "digitable_line": "00190000090361557400500000024174396700000991000",
  "payment_amount": 1156.8,
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  }
}
```
Request Body: Boleto request with barcode

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "barcode": "00190000090361557400500000024174396700000991000",
  "payment_amount": 1156.8,
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  }
}
```

### Body Params
| Field | Type | Description |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4 | Unique identification key for the client's request. |
| `barcode` | string | Barcode. |
| `digitable_line` | string | Digitable line. |
| `payment_amount` * | number | Amount to be paid. |
| `tfa_info` * | [object](#object-tfa_info) | Object containing the document of the account approver and the means of contact. |
:::danger Warning
The `payment_amount` must always be equal to the `total_amount` returned in the boleto query if partial payment is not allowed for the boleto. For titles where partial payment is allowed, the client may choose the `payment_amount`, as long as its sum with the boleto's `registered_payment_amount` does not exceed the `total_amount`.
:::

### Object tfa_info
| Field | Type | Description |
|-----------------------------------|---------|-----------------------------------|
| `approver_document_number`* | string | Document number of the account approver. |
| `contact_type`* | string | Means of contact with the account approver, can be **sms** or **email** |
## Response

### Success Response

STATUS 201

Response Body: Payment pending two-factor approval

```json
{
   "payment_key":"c4325104-d60b-44f3-aae4-49155564a2ea",
   "request_control_key":"b713b2f6-2f48-4d18-b0c9-7186e4edf189",
   "payer_name":"COOPERATIVA INDUSTRIAL MURILO",
   "payer_document_number":"00037025000160",
   "source_account_key":"6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
   "transaction_key":"4e80070a-a0bb-4be2-8178-55fbd73a3704",
   "transaction_revert_key":null,
   "paid_amount":1050.1,
   "payment_date":"2024-04-03",
   "payment_type":"bank_slip",
   "bank_slip": {
        "bank_slip_key":"95080ffd-3ac5-48d7-b3fe-659e4aaba81a",
        "barcode":"00193967000009910000000003615574000000002417",
        "digitable_line":"00190000090361557400500000024174396700000991000",
        "payer_name":"COOPERATIVA TESTE",
        "payer_document_number":"00037025000160",
        "beneficiary_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_trading_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_document_number":"52069937000117",
        "beneficiary_bank_ispb":"00000000",
        "guarantor_name":null,
        "guarantor_document_number":null,
        "expiration_date":"2024-03-29",
        "max_payment_data": "2026-03-29",
        "partial_payment_indicator":"allowed",
        "registered_payment_amount":9029.0,
        "nominal_amount":9910.0,
        "total_amount":10129.1,
        "rebate_amount":0.0,
        "discount_amount":0.0,
        "fine_amount":0.0,
        "interest_amount":219.1
    },
   "collection_slip":null,
   "payment_status":"pending_2fa_approval"
}
```

### Response Body Params

| Field | Type | Description |
|---------------------|---------|-----------------------------------|
| `payment_key` * | uuid4 | Unique payment identification key. |
| `request_control_key` * | uuid4 | Unique identification key for the client's request. |
| `payer_name` * | string | Name of the effective payer.|
| `payer_document_number` * | string | Document number of the effective payer (CPF/CNPJ). |
| `source_account_key` * | uuid4 | Key of the debited account. |
| `transaction_key` * | uuid4 | Payment transaction key. |
| `transaction_revert_key` | uuid4 | Payment reversal transaction key. |
| `paid_amount` * | number | Amount effectively paid. |
| `payment_date` * | string | Payment date. |
| `payment_type` * | [enum](#enumerators-payment_type) | Payment type. |
| `bank_slip` | [object](#object-bank_slip) | Boleto. |
| `collection_slip` | object | Collection invoice. |
| `payment_status` * | [enum](#enumerators-payment_status) | Payment status. |
### Enumerators payment_type
| Enumerator | Type | Description |
|---------------|-----------|---------------|
| `bank_slip` | string | Boleto |
| `collection_slip` | string | Collection invoice |
:::danger Warning
The enumerator `collection_slip` does not apply to the boleto flow, and the collection_slip object will always be null.
:::
### Enumerators payment_status
| Enumerator | Description |
|---------------|---------------|
| `pending_2fa_approval` | pending two-factor approval |
### Object bank_slip
| Field | Type | Description |
|-----------------------------------|---------|-----------------------------------|
| `barcode` * | string | Barcode. |
| `digitable_line` * | string | Digitable line. |
| `payer_name` * | string | Payer's name.|
| `payer_document_number` * | string | Payer's document number (CPF/CNPJ). |
| `beneficiary_name` * | string | Beneficiary's name. |
| `beneficiary_trading_name` | string | Beneficiary's trade name. |
| `beneficiary_document_number` * | string | Beneficiary's document number (CPF/CNPJ). |
| `beneficiary_bank_ispb` * | string | ISPB code of the beneficiary's bank. |
| `guarantor_name` | string | Name of the guarantor. |
| `guarantor_document_number` | string | Guarantor's document number (CPF/CNPJ). |
| `expiration_date` * | string | Due date. |
| `max_payment_date` * | string | Maximum payment date. |
| `partial_payment_indicator` * | [enum](#enumerators-partial_payment_indicator) | Partial payment indicator. |
| `registered_payment_amount` | string | Total registered payment amount. |
| `nominal_amount` * | number | Original amount. |
| `total_amount` * | number | Total amount. |
| `rebate_amount` * | number | Rebate amount. |
| `discount_amount` * | number | Discount amount. |
| `fine_amount` * | number | Fine amount. |
| `interest_amount` * | number | Interest amount. |
### Enumerators partial_payment_indicator
| Enumerator | Type | Description |
|---------------|-----------|---------------|
| `allowed` | string | Allowed |
| `not_allowed` | string | Not allowed |
### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Description in portuguese",
    "code": "Código"
}
```

| HTTP Code | QI Code | Title | Description (eng) | Description (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 400         | BIP000001 | Bad Request | The barcode or digitable line must have 44 or 47 characters. | O código de barras ou linha digitável deve ter 44 ou 47 caracteres. |
| 400         | BIP000002 | Bad Request | The bill sent does not correspond to a bank slip. | A conta enviado não corresponde a um boleto bancário. |
| 400         | BIP000003 | Bad Request | The digitable line sent is invalid. | A linha digitável enviada é inválida. |
| 404         | BIP000004 | Not Found | The bank slip was not found. | O boleto não foi encontrado. |
| 400         | BIP000005 | Bad Request | It was not possible to consult the bank slip at this time. Please try again in a few minutes. | Não foi possível consultar o boleto neste momento. Por favor, tente novamente em alguns minutos. |
| 400         | BIP000006 | Bad Request | Bank slip already written off | Boleto já baixado |
| 400         | BIP000007 | Bad Request | Bank slip blocked for payment | Boleto bloqueado para pagamento |
| 400         | BIP000008 | Bad Request | Bank slip already paid | Boleto já pago |
| 400         | BIP000009 | Bad Request | Invalid bank slip. Please consult issuing bank | Boleto inválido. Favor consultar banco emissor |
| 403         | BIP000010 | Forbidden | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404         | BIP000011 | Not Found | The source account key was not found. | A chave da conta de origem não foi encontrada. |
| 400         | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400         | BIP000013 | Bad Request | The source account is closed. | A conta de origem está fechada. |
| 400         | BIP000014 | Bad Request | The source account is blocked. | A conta de origem está bloqueada. |
| 400         | BIP000015 | Bad Request | Payment date is greater than the maximum payment date. | A data de pagamento é maior que a data máxima de pagamento. |
| 400         | BIP000016 | Bad Request | Payment date is smaller than the calculation date. | A data de pagamento é menor que a data de cálculo. |
| 400         | BIP000017 | Bad Request | Invalid payment amount. | Valor de pagamento inválido. |
| 400         | BIP000018 | Bad Request | Partial payment is not allowed. | Pagamento parcial não é permitido. |
| 400         | BIP000019 | Bad Request | The payment amount is greater than the available amount. | O valor do pagamento é maior que o valor disponível. |
| 400         | BIP000020 | Bad Request | All partial payments for this bank slip have already been made. | Todos os pagamentos parciais deste boleto já foram realizados. |
| 400         | BIP000024 | Bad Request | Request control key already exists. | Chave de controle da requisição já existe. |
| 403         | BIP000052 | Forbidden | Given document number does not belong to an approver for this account | Número de documento enviado não pertence a um aprovador da conta |
| 400         | BIP000053 | Bad Request | Error getting approver data | Erro ao obter dados do aprovador |
| 400         | BIP000054 | Bad Request | TFA info required | Informações de TFA necessárias |
| 400         | BIP000055 | Bad Request | Error sending verification token | Erro ao enviar token de verificação |
| 400         | BIP000065 | Bad Request | Payment verification time window exceeded. | Janela de tempo de verificação de pagamento excedida. |

## Sandbox environment

In our sandbox environment, we provide mocked digitable lines for simulating successful payments and testing error scenarios.

| Digitable line |
|-----------------|
| 00190000090361557400500000024174396700000991000 |
| 00190000090282802601919212747174596760001294161 |
| 23793390014000000455277000249001596900000103995 |
| 75691434020137513680900001040013196770002417240 |
| 21390001171200000570700168167484796770000148206 |
| 34191090083273252027893634770007296690012513600 |
| 42297048060005815702500130494123896770000239491 |
| 07090010287045349010776686070590896770001160123 |
| 74891123702849020818918378871083196690000050000 |
| 23792374119000209350986000372408496610000122810 |

---

# Request payment of collection invoice (agreement/tribute)

URL: /en/documentation/baas/cobranca/2fa_v2/solicitacao_de_pagamento_de_fatura_de_recolhimento

This endpoint allows the payment request for collection invoices with two-factor authentication. The request should be made after a consultation, using the returned information to ensure the correct flow and avoid failures during the process.
:::info Collection Invoice
This type of charge is issued by utility companies (water, electricity, telephone, and gas bills) and public entities (taxes). They are not registered with the Interbank Payment Clearinghouse (CIP/Núclea) and, therefore, do not return the same information as a boleto.
:::

## Request

### Request Endpoint

ENDPOINT /account/ ACCOUNT_KEY /payment/collection_slip
MÉTODO POST

### Request Path Params

| Field | Type | Description | Characters |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` * | uuid4 | Unique account identification key. | 36 |

Request Body: Collection invoice request with digitable line

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "digitable_line": "00190000090361557400500000024174396700000991000",
  "payment_amount": 1156.8,
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  }
}
```
Request Body: Collection invoice request with barcode

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "barcode": "00190000090361557400500000024174396700000991000",
  "payment_amount": 1156.8,
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  }
}
```

### Body Params
| Field | Type | Description |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4 | Unique identification key for the client's request. |
| `barcode` | string | Barcode. |
| `digitable_line` | string | Digitable line. |
| `payment_amount` * | number | Amount to be paid. |
| `tfa_info` * | [object](#object-tfa_info) | Object containing the document of the account approver and the means of contact. |
:::danger Warning
The `payment_amount` must always be equal to the `total_amount` returned in the boleto query.
:::
### Object tfa_info
| Field | Type | Description |
|-----------------------------------|---------|-----------------------------------|
| `approver_document_number`* | string | Document number of the account approver (CPF/CNPJ). |
| `contact_type`* | string | Means of contact with the account approver, can be **sms** or **email** |
## Response

### Success Response

STATUS 201

Response Body: Payment pending two-factor approval

```json
{
  "payment_key": "33860ad0-bcb0-47b7-bbe7-c7e3ec2fc61a",
  "request_control_key": "ae4508df-f2cb-4e28-9f04-a19b7f2758c9",
  "payer_name": "COOPERATIVA INDUSTRIAL MURILO",
  "payer_document_number": "62069937000118",
  "source_account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "transaction_key": "fc9ccfd0-2f21-4207-9772-69238be74152",
  "transaction_revert_key": null,
  "paid_amount": 1389.21,
  "payment_date": "2024-04-30",
  "payment_type": "collection_slip",
  "bank_slip": null,
  "collection_slip": {
    "barcode": null,
    "digitable_line": "836200000138892100450006762142420244046000010192",
    "collection_name": "CIA ULTRAGAZ SA-COD",
    "collection_document_number": "00394460005887",
    "expiration_date": "2024-04-15",
    "total_amount": 1389.21
  },
  "payment_status": "pending_2fa_approval"
}
```

### Response Body Params
| Field | Type | Description |
|---------------------|---------|-----------------------------------|
| `payment_key` * | uuid4 | Unique payment identification key. |
| `request_control_key` * | uuid4 | Unique identification key for the client's request. |
| `payer_name` * | string | Name of the effective payer. |
| `payer_document_number` * | string | Document of the effective payer (CPF/CNPJ). |
| `source_account_key` * | uuid4 | Key of the debited account. |
| `transaction_key` * | uuid4 | Payment transaction key. |
| `transaction_revert_key` | uuid4 | Payment reversal transaction key. |
| `paid_amount` * | number | Amount effectively paid. |
| `payment_date` * | string | Payment date. |
| `payment_type` * | [enum](#enumerators-payment_type) | Payment type. |
| `bank_slip` | object | Boleto bancário. |
| `collection_slip` | [object](#object-collection_slip) | Collection invoice. |
| `payment_status` * | [enum](#enumerators-payment_status) | Payment status. |
### Enumerators payment_type
| Enumerator | Type | Description |
|---------------|-----------|---------------|
| `bank_slip` | string | Boleto bancário |
| `collection_slip` | string | Collection invoice |
:::danger Warning
The enumerator `bank_slip` does not apply to the collection invoice flow, and the bank_slip object will always be null.
:::
### Enumerators payment_status
| Enumerator | Description |
|---------------|---------------|
| `pending_2fa_approval` | pending two-factor approval |
### Object collection_slip
| Field | Type | Description |
|-----------------------------------|---------|-----------------------------------|
| `barcode` | string | Barcode. |
| `digitable_line` | string | Digitable line. |
| `collection_name` * | string | Name of the agreement. |
| `collection_document_number` | string | Document number of the agreement (CPF/CNPJ).|
| `expiration_date` * | string | Due date. |
| `total_amount` * | number | Total amount. |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Description in portuguese",
    "code": "Código"
}
```
| HTTP Code | QI Code | Title | Description (eng) | Description (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 400 | BIP000032 | Bad Request | The bill sent does not correspond to a collection slip. | A conta enviada não corresponde a uma fatura de recolhimento. |
| 400 | BIP000033 | Bad Request | The barcode or digitable line of the collection slip must have 44 or 48 characters. | O código de barras ou linha digitável da fatura de recolhimento deve ter 44 ou 48 caracteres. |
| 403 | BIP000010 | Forbidden | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404 | BIP000011 | Not Found | The source account key was not found. | A chave da conta de origem não foi encontrada. |
| 400 | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400 | BIP000013 | Bad Request | The source account is closed. | A conta de origem está fechada. |
| 400 | BIP000014 | Bad Request | The source account is blocked. | A conta de origem está bloqueada. |
| 400 | BIP000024 | Bad Request | Request control key already exists. | Chave de controle da requisição já existe. |
| 400 | BIP000028 | Bad Request | The source account has blocked balance. Payment cannot be made. | A conta de origem possui saldo em conta bloqueado. Pagamento não pode ser realizado. |
| 400 | BIP000034 | Bad Request | Collection slip already paid. | Fatura de recolhimento já paga. |
| 400 | BIP000035 | Bad Request | Covenant slip invalid barcode. | Código de barras da fatura de recolhimento inválido. |
| 400 | BIP000036 | Bad Request | Covenant slip overdue. | Fatura de recolhimento vencida. |
| 400 | BIP000037 | Bad Request | Error in collection slip consultation. | Erro na consulta da fatura de recolhimento. |
| 400 | BIP000038 | Bad Request | Outside of covenant payment hours. | Fora do horário de pagamento do convênio. |
| 400 | BIP000039 | Bad Request | Collection slip not accepted. | Fatura de recolhimento não aceita. |
| 400 | BIP000040 | Bad Request | Minimum advance not reached. | Mínimo de dias de adiantamento não atingido. |
| 400 | BIP000041 | Bad Request | Max payment amount exceeded. | Valor máximo de pagamento excedido. |
| 400 | BIP000044 | Bad Request | It was not possible to pay the collection slip at this time. Please verify your information and, if necessary, contact us for assistance. | Não foi possível pagar a fatura de recolhimento neste momento. Por favor, verifique suas informações e, se necessário, entre em contato conosco para assistência. |
| 403 | BIP000052 | Forbidden | Given document number does not belong to an approver for this account | Número de documento enviado não pertence a um aprovador da conta |
| 400 | BIP000053 | Bad Request | Error getting approver data | Erro ao obter dados do aprovador |
| 400 | BIP000054 | Bad Request | TFA info required | Informações de TFA necessárias |
| 400 | BIP000055 | Bad Request | Error sending verification token | Erro ao enviar token de verificação |
| 400 | BIP000065 | Bad Request | Payment verification time window exceeded. | Janela de tempo de verificação de pagamento excedida. |

## Sandbox Environment
In our sandbox environment, we provide mocked digitable lines for simulating successful payments and testing error scenarios.
| Digitable Line |
|---|
| 828300000007411100972013905080001546763201900028 |
| 838000000009235700481007241345219112001474229880 |
| 848000000006308600802021201071261517689002201070 |
| 858200000015000000643025703477209504800448091020 |
| 858500000037350000643217212883260006147448091022 |

---

# Resend payment confirmation token for Boleto

URL: /en/documentation/baas/cobranca/2fa_v2/solicitacao_de_reenvio_de_token_de_boleto_bancario

This endpoint allows the resending of the authentication token for Boleto payments.
:::info Boleto
This is the conventional boleto (with digitable lines not starting with the digit 8). It is registered with the Interbank Payment Clearinghouse (CIP/Núclea) and can be paid at financial institutions and payment institutions authorized to operate by the Central Bank.
:::

## Request

### Request Endpoint

ENDPOINT /account/ ACCOUNT_KEY /payment/ PAYMENT_KEY /bank_slip/resend_token
MÉTODO PATCH

### Request Path Params

| Field | Type | Description | Characters |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` * | uuid4 | Unique account identification key. | 36 |
| `payment_key` * | uuid4 | Unique payment identification key. | 36 |

## Response

### Success Response

STATUS 200

Response Body: Token successfully resent

```json
{
   "payment_key":"c4325104-d60b-44f3-aae4-49155564a2ea",
   "request_control_key":"b713b2f6-2f48-4d18-b0c9-7186e4edf189",
   "payer_name":"COOPERATIVA INDUSTRIAL MURILO",
   "payer_document_number":"00037025000160",
   "source_account_key":"6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
   "transaction_key":"4e80070a-a0bb-4be2-8178-55fbd73a3704",
   "transaction_revert_key":null,
   "paid_amount":1050.1,
   "payment_date":"2024-04-03",
   "payment_type":"bank_slip",
   "bank_slip": {
        "bank_slip_key":"95080ffd-3ac5-48d7-b3fe-659e4aaba81a",
        "barcode":"00193967000009910000000003615574000000002417",
        "digitable_line":"00190000090361557400500000024174396700000991000",
        "payer_name":"COOPERATIVA TESTE",
        "payer_document_number":"00037025000160",
        "beneficiary_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_trading_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_document_number":"52069937000117",
        "beneficiary_bank_ispb":"00000000",
        "guarantor_name":null,
        "guarantor_document_number":null,
        "expiration_date":"2024-03-29",
        "max_payment_data": "2026-03-29",
        "partial_payment_indicator":"allowed",
        "registered_payment_amount":9029.0,
        "nominal_amount":9910.0,
        "total_amount":10129.1,
        "rebate_amount":0.0,
        "discount_amount":0.0,
        "fine_amount":0.0,
        "interest_amount":219.1
    },
   "collection_slip":null,
   "payment_status":"pending_2fa_approval"
}
```

### Response Body Params
| Field | Type | Description |
|---------------------|---------|-----------------------------------|
| `payment_key` * | uuid4 | Unique payment identification key. |
| `request_control_key` * | uuid4 | Unique identification key for the client's request. |
| `payer_name` * | string | Name of the effective payer. |
| `payer_document_number` * | string | Document number of the effective payer (CPF/CNPJ). |
| `source_account_key` * | uuid4 | Key of the debited account. |
| `transaction_key` * | uuid4 | Payment transaction key. |
| `transaction_revert_key` | uuid4 | Payment reversal transaction key. |
| `paid_amount` * | number | Amount effectively paid. |
| `payment_date` * | string | Payment date. |
| `payment_type` * | [enum](#enumerators-payment_type) | Payment type. |
| `bank_slip` | [object](#object-bank_slip) | Boleto. |
| `collection_slip` | object | Collection invoice. |
| `payment_status` * | [enum](#enumerators-payment_status) | Payment status. |
### Enumerators payment_type
| Enumerator | Type | Description |
|---------------|-----------|---------------|
| `bank_slip` | string | Boleto |
| `collection_slip` | string | Collection invoice |
:::danger Warning
The enumerator `collection_slip` does not apply to the boleto flow, and the collection_slip object will always be null.
:::
### Enumerators payment_status
| Enumerator | Description |
|---------------|---------------|
| `pending_2fa_approval` | pending two-factor approval |
### Object bank_slip
| Field | Type | Description |
|-----------------------------------|---------|-----------------------------------|
| `barcode` * | string | Barcode. |
| `digitable_line` * | string | Digitable line. |
| `payer_name` * | string | Payer's name. |
| `payer_document_number` * | string | Payer's document number (CPF/CNPJ). |
| `beneficiary_name` * | string | Beneficiary's name. |
| `beneficiary_trading_name` | string | Beneficiary's trade name. |
| `beneficiary_document_number` * | string | Beneficiary's document number (CPF/CNPJ). |
| `beneficiary_bank_ispb` * | string | ISPB code of the beneficiary's bank. |
| `guarantor_name` | string | Name of the guarantor. |
| `guarantor_document_number` | string | Guarantor's document number (CPF/CNPJ). |
| `expiration_date` * | string | Due date. |
| `max_payment_date` * | string | Maximum payment date. |
| `partial_payment_indicator` * | [enum](#enumerators-partial_payment_indicator) | Partial payment indicator. |
| `registered_payment_amount` | string | Total registered payment amount. |
| `nominal_amount` * | number | Original amount. |
| `total_amount` * | number | Total amount. |
| `rebate_amount` * | number | Rebate amount. |
| `discount_amount` * | number | Discount amount. |
| `fine_amount` * | number | Fine amount. |
| `interest_amount` * | number | Interest amount. |
### Enumerators partial_payment_indicator
| Enumerator | Type | Description |
|---------------|-----------|---------------|
| `allowed` | string | Allowed |
| `not_allowed` | string | Not allowed |
### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Descrição em português",
    "code": "Código"
}
```

| HTTP Code | QI Code | Title | Description (eng) | Description (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 403 | BIP000010 | Forbidden | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404 | BIP000011 | Not Found | The source account key was not found. | A chave da conta de origem não foi encontrada. |
| 400 | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400 | BIP000013 | Bad Request | The source account is closed. | A conta de origem está fechada. |
| 400 | BIP000014 | Bad Request | The source account is blocked. | A conta de origem está bloqueada. |
| 404 | BIP000056 | Not Found | Payment not found. | Pagamento não encontrado. |
| 400 | BIP000057 | Bad Request | Payment status is not pending approval. | Status de pagamento não é de aprovação pendente. |
| 400 | BIP000062 | Bad Request | Payment type is not bank slip. | Tipo de pagamento não é boleto. |
| 400 | BIP000064 | Bad Request | Error resending verification token | Erro ao reenviar token de verificação |
| 400 | BIP000065 | Bad Request | Payment verification time window exceeded. | Janela de tempo de verificação de pagamento excedida. |

---

# Resend Two-Factor Authentication Token for Collection Invoice Payments

URL: /en/documentation/baas/cobranca/2fa_v2/solicitacao_de_reenvio_de_token_de_fatura_de_recolhimento

This endpoint allows the resending of the authentication token for collection invoice payments.
:::info Collection Invoice
This type of charge is issued by utility companies (water, electricity, telephone, and gas bills) and public entities (taxes). They are not registered with the Interbank Payment Clearinghouse (CIP/Núclea) and, therefore, do not return the same information as a boleto.
:::
## Request

### Request Endpoint

ENDPOINT /account/ ACCOUNT_KEY /payment/ PAYMENT_KEY /collection_slip/resend_token
MÉTODO PATCH

### Request Path Params

| Field | Type | Description | Characters |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` * | uuid4 | Unique account identification key. | 36 |
| `payment_key` * | uuid4 | Unique payment identification key. | 36 |
## Response

### Success Response

STATUS 200

Response Body: Token successfully resent

```json
{
  "payment_key": "33860ad0-bcb0-47b7-bbe7-c7e3ec2fc61a",
  "request_control_key": "ae4508df-f2cb-4e28-9f04-a19b7f2758c9",
  "payer_name": "COOPERATIVA INDUSTRIAL MURILO",
  "payer_document_number": "62069937000118",
  "source_account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "transaction_key": "fc9ccfd0-2f21-4207-9772-69238be74152",
  "transaction_revert_key": null,
  "paid_amount": 1389.21,
  "payment_date": "2024-04-30",
  "payment_type": "collection_slip",
  "bank_slip": null,
  "collection_slip": {
    "barcode": null,
    "digitable_line": "836200000138892100450006762142420244046000010192",
    "collection_name": "CIA ULTRAGAZ SA-COD",
    "collection_document_number": "00394460005887",
    "expiration_date": "2024-04-15",
    "total_amount": 1389.21
  },
  "payment_status": "pending_2fa_approval"
}
```

### Response Body Params
| Field | Type | Description |
|---------------------|---------|-----------------------------------|
| `payment_key` * | uuid4 | Unique payment identification key. |
| `request_control_key` * | uuid4 | Unique identification key for the client's request. |
| `payer_name` * | string | Name of the effective payer. |
| `payer_document_number` * | string | Document number of the effective payer (CPF/CNPJ). |
| `source_account_key` * | uuid4 | Key of the debited account. |
| `transaction_key` * | uuid4 | Payment transaction key. |
| `transaction_revert_key` | uuid4 | Payment reversal transaction key. |
| `paid_amount` * | number | Amount effectively paid. |
| `payment_date` * | string | Payment date. |
| `payment_type` * | [enum](#enumerators-payment_type) | Payment type. |
| `bank_slip` | object | Boleto. |
| `collection_slip` | [object](#object-collection_slip) | Collection invoice. |
| `payment_status` * | [enum](#enumerators-payment_status) | Payment status. |
### Enumerators payment_type
| Enumerator | Type | Description |
|---------------|-----------|---------------|
| `bank_slip` | string | Boleto bancário |
| `collection_slip` | string | Collection invoice |
:::danger Warning
The enumerator `bank_slip` does not apply to the collection invoice flow, and the bank_slip object will always be null.
:::
### Enumerators payment_status
| Enumerator | Description |
|---------------|---------------|
| `pending_2fa_approval` | pending two-factor approval |
### Object collection_slip
| Field | Type | Description |
|-----------------------------------|---------|-----------------------------------|
| `barcode` | string | Barcode. |
| `digitable_line` | string | Digitable line. |
| `collection_name` * | string | Name of the agreement.|
| `collection_document_number` | string | Document number of the agreement (CPF/CNPJ).|
| `expiration_date` * | string | Due date. |
| `total_amount` * | number | Total amount. |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Descrição em português",
    "code": "Código"
}
```
| HTTP Code | QI Code | Title | Description (eng) | Description (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 403 | BIP000010 | Forbidden | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404 | BIP000011 | Not Found | The source account key was not found. | A chave da conta de origem não foi encontrada. |
| 400 | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400 | BIP000013 | Bad Request | The source account is closed. | A conta de origem está fechada. |
| 400 | BIP000014 | Bad Request | The source account is blocked. | A conta de origem está bloqueada. |
| 404 | BIP000056 | Not Found | Payment not found. | Pagamento não encontrado. |
| 400 | BIP000057 | Bad Request | Payment status is not pending approval. | Status de pagamento não é de aprovação pendente. |
| 400 | BIP000063 | Bad Request | Payment type is not collection slip. | Tipo de pagamento não é fatura de recolhimento. |
| 400 | BIP000064 | Bad Request | Error resending verification token | Erro ao reenviar token de verificação |
| 400 | BIP000065 | Bad Request | Payment verification time window exceeded. | Janela de tempo de verificação de pagamento excedida. |

---

# Resend token for bank slip payment batch confirmation

URL: /en/documentation/baas/cobranca/2fa_v2/solicitacao_de_reenvio_de_token_de_lote_de_boleto_bancario

This endpoint allows **resending** the two-factor authentication (2FA) token for a bank slip batch that is waiting for token validation. A new token is generated and sent to the approver. If the token validation attempt limit has been exceeded, resending may not be allowed.

:::info Bank slip
A traditional bank slip (digitable line not starting with digit 8). It is registered in the Interbank Payment Chamber (CIP/Núclea) and can be paid at financial and payment institutions authorized by the Central Bank.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/**ACCOUNT_KEY**/payment/batch_bank_slip/**PAYMENT_BATCH_KEY**/resend_token
METHOD PATCH

### Request Path Params

| Field                 | Type  | Description                                                                                | Characters |
| --------------------- | ----- | ---------------------------------------------------------------------------------------- | ---------- |
| `account_key` *       | uuid4 | Unique account identifier.                                                   | 36         |
| `payment_batch_key` * | uuid4 | Unique batch identifier (`batch_payment_key` returned at batch creation). | 36         |

### Request Body

Request Body (opcional)

```json
{
  "contact_type": "sms"
}
```

### Body Params

| Field          | Type       | Description                               | Characters                                              |
| -------------- | ---------- | --------------------------------------- | ------------------------------------------------------- |
| `contact_type` | enumerator | Authentication token delivery method | **[Enumerador contact_type](#enumerador-contact_type)** |

:::info Information
If `contact_type` is not sent, the token will be sent using the originally requested method (`tfa_info.contact_type`).
:::

### Enumerator contact_type

| Enumerador | Description                                         |
| ---------- | ------------------------------------------------- |
| **sms**    | Send via SMS to mobile phone |
| **email**  | Send via email                      |

## Response

### Success Response

STATUS 200

Response Body: Token resent successfully

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
  "total_amount": 1357.3,
  "batch_status": "pending_2fa_approval",
  "payment_type": "bank_slip"
}
```

### Response Body Params

| Field                   | Type   | Description                                                                                                                                                                                                                                                                                    |
| ----------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `batch_payment_key` *   | uuid4  | Unique batch payment identifier.                                                                                                                                                                                                                                           |
| `request_control_key` * | uuid4  | Unique client request identifier (batch).                                                                                                                                                                                                                                |
| `account_key` *         | uuid4  | Debited account key.                                                                                                                                                                                                                                                                     |
| `total_amount` *        | number | Sum of the amounts of all batch items.                                                                                                                                                                                                                                                          |
| `batch_status` *        | string | After resend, the batch remains waiting for token validation. The `batch_status` cycle follows the batch payment request documentation available for your operation (enumerator `batch_payment_status`). |
| `payment_type` *        | string | Payment type; for this flow, expected value is `bank_slip`.                                                                                                                                                                                                                                   |

Then use [Batch bank slip token validation](./validacao_de_token_de_lote_de_boleto_bancario.md) to complete 2FA.

### Error Response

STATUS 4XX

Response Body

```json
{
  "title": "Title",
  "description": "Description in english",
  "translation": "Description em português",
  "code": "Code"
}
```

| HTTP code | QI code | Title      | Description (eng)                                                                                    | Description (pt-br)                                                                                         |
| ----------- | --------- | ----------- | -------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| 403         | BIP000010 | Forbidden   | User is not allowed to do this action                                                              | User is not allowed to do this action                                                          |
| 404         | BIP000011 | Not Found   | The source account key was not found.                                                              | The source account key was not found.                                                            |
| 400         | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | It was not possible to consult the source account at this time. Please try again in a few minutes. |
| 400         | BIP000013 | Bad Request | The source account is closed.                                                                      | The source account is closed.                                                                           |
| 400         | BIP000014 | Bad Request | The source account is blocked.                                                                     | The source account is blocked.                                                                         |
| 400         | BIP000059 | Bad Request | Number of verification token validation attempts exceeded.                                         | Number of verification token validation attempts exceeded.                                       |
| 400         | BIP000064 | Bad Request | Error resending verification token                                                                 | Error resending verification token                                                                     |
| 400         | BIP000065 | Bad Request | Payment verification time window exceeded.                                                         | Payment verification time window exceeded.                                                     |
| 404         | BIP000083 | Not Found   | Batch payment not found by batch payment key.                                                      | Batch payment not found by batch payment key.                                                     |
| 400         | BIP000085 | Bad Request | Batch payment status is not pending approval.                                                      | Batch payment status is not pending approval.                                                 |
| 400         | BIP000086 | Bad Request | A token is required for SMS or email validation.                    | A token is required for SMS or email validation.             |

---

# Resend token for collection slip payment batch confirmation (utility/tax)

URL: /en/documentation/baas/cobranca/2fa_v2/solicitacao_de_reenvio_de_token_de_lote_de_fatura_de_recolhimento

This endpoint allows **resending** the two-factor authentication (2FA) token for a collection slip batch that is waiting for token validation. A new token is generated and sent to the approver. If the token validation attempt limit has been exceeded, resending may not be allowed.

:::info Collection slip (utility/tax bill)
This charge type is issued by utility companies (water, electricity, phone, and gas) and public agencies (taxes). It is not registered in the Interbank Payment Chamber (CIP/Núclea), so it does not return the same information as a bank slip.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/**ACCOUNT_KEY**/payment/batch_collection_slip/**PAYMENT_BATCH_KEY**/resend_token
METHOD PATCH

### Request Path Params

| Field                 | Type  | Description                                                                                | Characters |
| --------------------- | ----- | ---------------------------------------------------------------------------------------- | ---------- |
| `account_key` *       | uuid4 | Unique account identifier.                                                   | 36         |
| `payment_batch_key` * | uuid4 | Unique batch identifier (`batch_payment_key` returned at batch creation). | 36         |

### Request Body

Request Body (opcional)

```json
{
  "contact_type": "sms"
}
```

### Body Params

| Field          | Type       | Description                               | Characters                                              |
| -------------- | ---------- | --------------------------------------- | ------------------------------------------------------- |
| `contact_type` | enumerator | Authentication token delivery method | **[Enumerador contact_type](#enumerador-contact_type)** |

:::info Information
If `contact_type` is not sent, the token will be sent using the originally requested method (`tfa_info.contact_type`).
:::

### Enumerator contact_type

| Enumerador | Description                                         |
| ---------- | ------------------------------------------------- |
| **sms**    | Send via SMS to mobile phone |
| **email**  | Send via email                      |

## Response

### Success Response

STATUS 200

Response Body: Token resent successfully

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "total_amount": 2778.42,
  "batch_status": "pending_2fa_approval",
  "payment_type": "collection_slip"
}
```

### Response Body Params

| Field                   | Type   | Description                                                                                                                                                                                                                                                                                                      |
| ----------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `batch_payment_key` *   | uuid4  | Unique batch payment identifier.                                                                                                                                                                                                                                                             |
| `request_control_key` * | uuid4  | Unique client request identifier (batch).                                                                                                                                                                                                                                                  |
| `account_key` *         | uuid4  | Debited account key.                                                                                                                                                                                                                                                                                       |
| `total_amount` *        | number | Sum of the amounts of all batch items.                                                                                                                                                                                                                                                                            |
| `batch_status` *        | string | After resend, the batch remains waiting for token validation. The `batch_status` cycle follows the batch payment request documentation available for your operation (enumerator `batch_payment_status`). |
| `payment_type` *        | string | Payment type; for this flow, expected value is `collection_slip`.                                                                                                                                                                                                                                               |

Then use [Batch collection slip token validation](./validacao_de_token_de_lote_de_fatura_de_recolhimento.md) to complete 2FA.

### Error Response

STATUS 4XX

Response Body

```json
{
  "title": "Title",
  "description": "Description in english",
  "translation": "Description em português",
  "code": "Code"
}
```

| HTTP code | QI code | Title      | Description (eng)                                                                                    | Description (pt-br)                                                                                         |
| ----------- | --------- | ----------- | -------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| 403         | BIP000010 | Forbidden   | User is not allowed to do this action                                                              | User is not allowed to do this action                                                          |
| 404         | BIP000011 | Not Found   | The source account key was not found.                                                              | The source account key was not found.                                                            |
| 400         | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | It was not possible to consult the source account at this time. Please try again in a few minutes. |
| 400         | BIP000013 | Bad Request | The source account is closed.                                                                      | The source account is closed.                                                                           |
| 400         | BIP000014 | Bad Request | The source account is blocked.                                                                     | The source account is blocked.                                                                         |                                                |
| 400         | BIP000059 | Bad Request | Number of verification token validation attempts exceeded.                                         | Number of verification token validation attempts exceeded.                                       |
| 400         | BIP000064 | Bad Request | Error resending verification token                                                                 | Error resending verification token                                                                     |
| 400         | BIP000065 | Bad Request | Payment verification time window exceeded.                                                         | Payment verification time window exceeded.                                                     |
| 404         | BIP000083 | Not Found   | Batch payment not found by batch payment key.                                                      | Batch payment not found by batch payment key.                                                     |
| 400         | BIP000085 | Bad Request | Batch payment status is not pending approval.                                                      | Batch payment status is not pending approval.
| 400         | BIP000086 | Bad Request | A token is required for SMS or email validation.                    | A token is required for SMS or email validation.             |

---

# Request bank slip batch payment with two-factor authentication

URL: /en/documentation/baas/cobranca/2fa_v2/solicitar_pagamento_lote_de_boleto_bancario_com_confirmacao_de_lote

This endpoint allows requesting payment of multiple bank slips in a single request, with **`tfa_info`** when the operation requires two-factor authentication **at this request step**.

:::info Bank slip
A traditional bank slip (digitable line not starting with digit 8). It is registered in the Interbank Payment Chamber (CIP/Núclea) and can be paid at financial and payment institutions authorized by the Central Bank.
:::

:::info Flow after the request
After the request, the batch may remain waiting for [batch confirmation with two-factor authentication](./confirmacao_de_lote_de_boleto_bancario.md), according to operation rules. In this confirmation step, follow the flow with `tfa_info` described in that document.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/ ACCOUNT_KEY /payments/batch_bank_slip
METHOD POST

### Request Path Params

| Field               | Type    | Description                               | Characters |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` *     | uuid4   | Unique account identifier.  | 36         |

Request Body: Batch bank slip payment (without TFA at this step)

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "bank_slip_payments": [
    {
      "request_control_key": "c7915a43-212f-5813-9adc-d3ed5d3d3bfd",
      "digitable_line": "00190000090361557400500000024174396700000991000",
      "payment_amount": 1156.8
    },
    {
      "request_control_key": "d8a26b54-323a-4924-0aed-e4fe6e4e4c0e",
      "barcode": "00190000090361557400500000024174396700000991000",
      "payment_amount": 200.5
    }
  ]
}
```

### Body Params

| Field               | Type          | Description                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Unique client request identifier (batch). |
| `bank_slip_payments` * | array     | List of bank slip payments. Limit of **1000** items per request. |

Each item in `bank_slip_payments` must include:

| Field               | Type          | Description                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Unique client request identifier for that batch item. |
| `barcode`               | string    | Barcode. |
| `digitable_line`        | string    | Digitable line. |
| `payment_amount` *      | number    | Value a ser pago. |

:::danger Warning
For each item, the submitted `payment_amount` must be compatible with the internal bank slip lookup: if partial payment is **not** allowed, the amount must match the updated total; if allowed, `payment_amount` may follow title rules (including, when applicable, values above nominal), as in the single bank slip payment flow.
:::

### Object tfa_info

| Field                        | Type   | Description                                                                                                                                          |
| ---------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `approver_document_number` * | string | Document number (CPF/CNPJ) of the approver who will receive the token or approve via device. Required when `tfa_info` is provided.                |
| `session_id`                 | string | Unique device session identifier in UUID v4 format (**required** for device-based TFA).                               |
| `contact_type` *             | string | Channel for token delivery or validation: **[contact_type enumerator](#enumerador-contact_type)**. Required when `tfa_info` is provided. |

#### Enumerator contact_type

| Enumerador | Description                                         |
|------------|---------------------------------------------------|
| **sms**    | Send via SMS to mobile phone |
| **email**  | Send via email                      |
| **device** | Validation via device token                |

## Response

### Success Response

STATUS 202

Response Body: Batch accepted for processing

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
  "total_amount": 1357.3,
  "batch_status": "pending",
  "payment_type": "bank_slip"
}
```

Response Body: exemplo ilustrativo (`batch_status` aprovado)

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
  "total_amount": 1357.3,
  "batch_status": "approved",
  "payment_type": "bank_slip"
}
```

:::info Batch processing
The `batch_status` field in the response indicates the **immediate state** of the batch after this request (for example, pending confirmation, pending 2FA approval, or already routed to processing), according to the applicable flow. When there is a [batch confirmation](./confirmacao_de_lote_de_boleto_bancario.md) step, follow that documentation to approve or reject the batch with two-factor authentication. Possible `batch_status` values are listed in [batch_payment_status](#enumeradores-batch_payment_status).
:::

### Response Body Params

| Field               | Type    | Description                         |
|---------------------|---------|-----------------------------------|
| `batch_payment_key` *       | uuid4 | Unique batch payment identifier. |
| `request_control_key` *     | uuid4 | Unique client request identifier (batch). |
| `account_key` *             | uuid4 | Debited account key. |
| `total_amount` *            | number | Sum of `payment_amount` across all batch items. |
| `batch_status` *         | [enum](#enumeradores-batch_payment_status) | Batch status right after request; depends on the flow (confirmation, 2FA, and immediate processing). |
| `payment_type` *            | [enum](#enumeradores-payment_type) | Payment type. |

### Enumeratores batch_payment_status

| Enumerador    | Description     |
|---------------|---------------|
| `pending`     | Pendente de processamento |
| `pending_2fa_approval` | Pending 2FA approval |
| `rejected`    | Rejeitado |
| `approved`    | Aprovado |
| `processed`   | Processado |

### Enumeratores payment_type

| Enumerador    | Type      | Description     |
|---------------|-----------|---------------|
| `bank_slip`     | string    | Bank slip    |
| `collection_slip` | string  | Collection slip (utility/tax bill) |

:::danger Warning
The `collection_slip` enumerator does not apply to this bank slip batch endpoint; in this flow, `payment_type` must be `bank_slip`.
:::

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Title",
    "description": "Description in english",
    "translation": "Description em português",
    "code": "Code"
}
```

| HTTP code | QI code | Title | Description (eng) | Description (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 403         | BIP000010 | Forbidden | User is not allowed to do this action | User is not allowed to do this action |
| 404         | BIP000011 | Not Found | The source account key was not found. | The source account key was not found. |
| 400         | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | It was not possible to consult the source account at this time. Please try again in a few minutes. |
| 400         | BIP000024 | Bad Request | Request control key already exists. | Request control key already exists. |
| 400         | BIP000050 | Bad Request | Requester configuration does not exist. | Requester configuration does not exist. |
| 400         | BIP000052 | Bad Request | Given document number does not belong to an approver for this account | Provided document number does not belong to an account approver |
| 400         | BIP000053 | Bad Request | Error getting approver data | Error getting approver data |
| 400         | BIP000054 | Bad Request | TFA info required | TFA info required |
| 400         | BIP000055 | Bad Request | Error sending verification token | Error sending verification token |
| 400         | BIP000065 | Bad Request | Payment verification time window exceeded. | Payment verification time window exceeded. |
| 400         | BIP000079 | Bad Request | A session_id must be provided token | A session_id must be provided |
| 400         | BIP000080 | Bad Request | Beneficiary bank code of this bank slip is not allowed. | Beneficiary bank code of this bank slip is not allowed. |
| 400         | BIP000081 | Bad Request | A list of bank slip payments must be provided. | A list of bank slip payments must be provided. |

---

# Solicitar pagamento em lote de boleto bancário com autenticação de dois fatores

URL: /en/documentation/baas/cobranca/2fa_v2/solicitar_pagamento_lote_de_boleto_bancario_sem_confirmacao_de_lote

Este endpoint permite solicitar o pagamento de múltiplos boletos bancários em uma única requisição, com **`tfa_info`** quando a operação exigir autenticação de dois fatores **nesta solicitação**.

:::info Boleto bancário
É o boleto bancário convencional (linhas digitáveis não iniciadas com dígito 8). Possui registro na Câmara Interbancária de Pagamento (CIP/Núclea) e pode ser pago em instituições financeiras e de pagamento autorizadas a funcionar pelo Banco Central.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/ ACCOUNT_KEY /payments/batch_bank_slip
MÉTODO POST

### Request Path Params

| Campo               | Tipo    | Descrição                               | Caracteres |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` *     | uuid4   | Chave única de identificação da conta.  | 36         |

## Autenticação via email e SMS

Request Body: lote com linha digitável e TFA por SMS ou email

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  },
  "bank_slip_payments": [
    {
      "request_control_key": "c7915a43-212f-5813-9adc-d3ed5d3d3bfd",
      "digitable_line": "00190000090361557400500000024174396700000991000",
      "payment_amount": 1156.8
    }
  ]
}
```

Request Body: lote com código de barras e TFA por SMS ou email

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  },
  "bank_slip_payments": [
    {
      "request_control_key": "c7915a43-212f-5813-9adc-d3ed5d3d3bfd",
      "barcode": "00190000090361557400500000024174396700000991000",
      "payment_amount": 1156.8
    }
  ]
}
```

## Autenticação via dispositivo

Além das formas já existentes de autenticação via **sms** e **email**, é possível autenticar a transação utilizando um dispositivo [previamente cadastrado](/documentation/baas/dispositivo/create/solicitacao_cadastro_dispositivo). Nesse caso, o `session_id` deve ser obtido na **Device Scan** e enviado no `tfa_info`.

Request Body: lote com linha digitável e TFA por dispositivo

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "session_id": "b2f18d3a-67c2-4a7f-98e5-1d3f5c6b8a72",
    "contact_type": "device"
  },
  "bank_slip_payments": [
    {
      "request_control_key": "c7915a43-212f-5813-9adc-d3ed5d3d3bfd",
      "digitable_line": "00190000090361557400500000024174396700000991000",
      "payment_amount": 1156.8
    }
  ]
}
```

Request Body: lote com código de barras e TFA por dispositivo

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "session_id": "b2f18d3a-67c2-4a7f-98e5-1d3f5c6b8a72",
    "contact_type": "device"
  },
  "bank_slip_payments": [
    {
      "request_control_key": "c7915a43-212f-5813-9adc-d3ed5d3d3bfd",
      "barcode": "00190000090361557400500000024174396700000991000",
      "payment_amount": 1156.8
    }
  ]
}
```

### Body Params

| Campo               | Tipo          | Descrição                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Chave única de identificação da requisição do cliente (lote). |
| `tfa_info`       | object | Quando o 2FA for exigido **nesta etapa** (solicitação do lote), envie aprovador e canal de envio do token no [objeto `tfa_info`](#objeto-tfa_info). Caso o fluxo não exija 2FA na solicitação, omita o campo. |
| `bank_slip_payments` * | array     | Lista de pagamentos de boleto bancário. Limite de **1000** itens por requisição. |

Cada elemento de `bank_slip_payments` deve conter:

| Campo               | Tipo          | Descrição                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Chave única de identificação da requisição do cliente para aquele item do lote. |
| `barcode`               | string    | Código de barras. |
| `digitable_line`        | string    | Linha digitável. |
| `payment_amount` *      | number    | Valor a ser pago. |

:::danger Aviso
Para cada item, o `payment_amount` enviado deve ser compatível com o que a consulta interna do boleto determinar: se o pagamento parcial **não** for permitido para aquele título, o valor deve corresponder ao total atualizado; se for permitido, o `payment_amount` pode seguir as regras do título (incluindo, quando aplicável, valores acima do nominal), como no fluxo de pagamento unitário de boleto bancário.
:::

### Objeto tfa_info

| Campo                        | Tipo   | Descrição                                                                                                                                          |
| ---------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `approver_document_number` * | string | Documento (CPF/CNPJ) da pessoa aprovadora que receberá o token ou aprovará via dispositivo. Obrigatório quando `tfa_info` é enviado.                |
| `session_id`                 | string | Chave única de identificação da sessão do dispositivo no formato UUID v4 (**obrigatório** para TFA via dispositivo).                               |
| `contact_type` *             | string | Canal para envio ou validação do token: **[Enumerador contact_type](#enumerador-contact_type)**. Obrigatório quando `tfa_info` é enviado. |

#### Enumerador contact_type

| Enumerador | Descrição                                         |
|------------|---------------------------------------------------|
| **sms**    | Envio por mensagem de texto para telefone celular |
| **email**  | Envio por correio eletrônico                      |
| **device** | Validação por token do dispositivo                |

## Response

### Success Response

STATUS 201

Response Body: Lote pendente de aprovação de dois fatores

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
  "total_amount": 1357.3,
  "batch_status": "pending_2fa_approval",
  "payment_type": "bank_slip"
}
```

:::info Processamento do lote
O campo `batch_status` na resposta indica o **estado imediato** do lote após esta solicitação (por exemplo, pendente de aprovação 2FA ou já encaminhado ao processamento), conforme o fluxo aplicável. O 2FA pode integrar esta solicitação (`tfa_info`) ou outras etapas do fluxo, conforme a operação. Os valores possíveis de `batch_status` estão em [batch_payment_status](#enumeradores-batch_payment_status).
:::

### Response Body Params

| Campo               | Tipo    | Descrição                         |
|---------------------|---------|-----------------------------------|
| `batch_payment_key` *       | uuid4 | Chave única de identificação do pagamento em lote. |
| `request_control_key` *     | uuid4 | Chave única de identificação da requisição do cliente (lote). |
| `account_key` *             | uuid4 | Chave da conta debitada. |
| `total_amount` *            | number | Soma dos valores (`payment_amount`) dos itens do lote. |
| `batch_status` *         | [enum](#enumeradores-batch_payment_status) | Status do lote logo após a solicitação; depende do fluxo (2FA e processamento imediato). |
| `payment_type` *            | [enum](#enumeradores-payment_type) | Tipo do pagamento. |

### Enumeradores batch_payment_status

| Enumerador    | Descrição     |
|---------------|---------------|
| `pending`     | Pendente de processamento |
| `pending_2fa_approval` | Lote pendente de 2FA para aprovação |
| `pending_2fa_rejection` | Lote pendente de 2FA para rejeição |
| `rejected`    | Rejeitado |
| `approved`    | Aprovado |
| `processed`   | Processado |

### Enumeradores payment_type

| Enumerador    | Tipo      | Descrição     |
|---------------|-----------|---------------|
| `bank_slip`     | string    | Boleto bancário    |
| `collection_slip` | string  | Fatura de recolhimento |

:::danger Aviso
O enumerador `collection_slip` não se aplica ao fluxo de lote de boletos bancários deste endpoint; para este caso, espera-se `payment_type` com valor `bank_slip`.
:::

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Descrição em português",
    "code": "Código"
}
```

| Código HTTP | Código QI | Título | Descrição (eng) | Descrição (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 403         | BIP000010 | Forbidden | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404         | BIP000011 | Not Found | The source account key was not found. | A chave da conta de origem não foi encontrada. |
| 400         | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400         | BIP000024 | Bad Request | Request control key already exists. | Chave de controle da requisição já existe. |
| 400         | BIP000050 | Bad Request | Requester configuration does not exist. | Configuração do requester não existe. |
| 400         | BIP000052 | Bad Request | Given document number does not belong to an approver for this account | Número de documento enviado não pertence a um aprovador da conta |
| 400         | BIP000053 | Bad Request | Error getting approver data | Erro ao obter dados do aprovador |
| 400         | BIP000054 | Bad Request | TFA info required | Informações de TFA necessárias |
| 400         | BIP000055 | Bad Request | Error sending verification token | Erro ao enviar token de verificação |
| 400         | BIP000065 | Bad Request | Payment verification time window exceeded. | Janela de tempo de verificação de pagamento excedida. |
| 400         | BIP000079 | Bad Request | A session_id must be provided token | Uma session_id deve ser fornecida |
| 400         | BIP000080 | Bad Request | Beneficiary bank code of this bank slip is not allowed. | Banco beneficiário desse boleto não é permitido. |
| 400         | BIP000081 | Bad Request | A list of bank slip payments must be provided. | Uma lista de boletos bancários deve ser fornecida. |

---

# Request collection slip (utility/tax) batch payment with two-factor authentication

URL: /en/documentation/baas/cobranca/2fa_v2/solicitar_pagamento_lote_de_fatura_de_recolhimento_com_confirmacao_de_lote

This endpoint allows requesting payment of multiple collection slips in a single request, with **`tfa_info`** when the operation requires two-factor authentication **at this request step**.

:::info Collection slip (utility/tax bill)
This charge type is issued by utility companies (water, electricity, phone, and gas) and public agencies (taxes). It is not registered in the Interbank Payment Chamber (CIP/Núclea), so it does not return the same information as a bank slip.
:::

:::info Flow after the request
After the request, the batch may remain waiting for [batch confirmation with two-factor authentication](./confirmacao_de_lote_de_fatura_de_recolhimento.md), according to operation rules. When 2FA is required at this request step, include **`tfa_info`** as shown below and in the [tfa_info object](#object-tfa_info). In the batch confirmation step for this flow, follow the documentation with `tfa_info`.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/ ACCOUNT_KEY /payments/batch_collection_slip
METHOD POST

### Request Path Params

| Field               | Type    | Description                               | Characters |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` *     | uuid4   | Unique account identifier.  | 36         |

Request Body: Batch collection slip payment (without TFA at this step)

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "collection_slip_payments": [
    {
      "request_control_key": "c7915a43-212f-5813-9adc-d3ed5d3d3bfd",
      "digitable_line": "836200000138892100450006762142420244046000010192",
      "payment_amount": 1389.21
    },
    {
      "request_control_key": "d8a26b54-323a-4924-0aed-e4fe6e4e4c0e",
      "barcode": "83620000001388921004500067621424202440460000101",
      "payment_amount": 1389.21
    }
  ]
}
```

## Authentication via Email and SMS

Request Body: batch with digitable line and TFA via SMS or email

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  },
  "collection_slip_payments": [
    {
      "request_control_key": "c7915a43-212f-5813-9adc-d3ed5d3d3bfd",
      "digitable_line": "836200000138892100450006762142420244046000010192",
      "payment_amount": 1389.21
    }
  ]
}
```

Request Body: batch with barcode and TFA via SMS or email

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  },
  "collection_slip_payments": [
    {
      "request_control_key": "c7915a43-212f-5813-9adc-d3ed5d3d3bfd",
      "barcode": "83620000001388921004500067621424202440460000101",
      "payment_amount": 1389.21
    }
  ]
}
```

## Authentication via Device

Besides existing authentication methods via **sms** and **email**, you can authenticate the transaction using a [previously registered device](/documentation/baas/dispositivo/create/solicitacao_cadastro_dispositivo). In this case, `session_id` must be obtained in **Device Scan** and sent in `tfa_info`.

Request Body: batch with digitable line and device TFA

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "session_id": "b2f18d3a-67c2-4a7f-98e5-1d3f5c6b8a72",
    "contact_type": "device"
  },
  "collection_slip_payments": [
    {
      "request_control_key": "c7915a43-212f-5813-9adc-d3ed5d3d3bfd",
      "digitable_line": "836200000138892100450006762142420244046000010192",
      "payment_amount": 1389.21
    }
  ]
}
```

Request Body: batch with barcode and device TFA

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "session_id": "b2f18d3a-67c2-4a7f-98e5-1d3f5c6b8a72",
    "contact_type": "device"
  },
  "collection_slip_payments": [
    {
      "request_control_key": "c7915a43-212f-5813-9adc-d3ed5d3d3bfd",
      "barcode": "83620000001388921004500067621424202440460000101",
      "payment_amount": 1389.21
    }
  ]
}
```

### Body Params

| Field               | Type          | Description                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Unique client request identifier (batch). |
| `tfa_info`       | object | When 2FA is required **at this step** (batch request), send approver and token channel fields in the [tfa_info object](#object-tfa_info). If this flow does not require 2FA at request time, omit this field. |
| `collection_slip_payments` * | array     | List of collection slip payments. Limit of **1000** items per request. |

Each item in `collection_slip_payments` must include:

| Field               | Type          | Description                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Unique client request identifier for that batch item. |
| `barcode`               | string    | Barcode. |
| `digitable_line`        | string    | Digitable line. |
| `payment_amount` *      | number    | Value a ser pago. |

:::danger Warning
For each item, `payment_amount` must be compatible with the internal collection slip lookup (for example, aligned with `total_amount` and utility/tax rules), under the same conditions as the single collection slip payment flow.
:::

### Object tfa_info

| Field                        | Type   | Description                                                                                                                                          |
| ---------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `approver_document_number` * | string | Document number (CPF/CNPJ) of the approver who will receive the token or approve via device. Required when `tfa_info` is provided.                |
| `session_id`                 | string | Unique device session identifier in UUID v4 format (**required** for device-based TFA).                               |
| `contact_type` *             | string | Channel for token delivery or validation: **[contact_type enumerator](#enumerador-contact_type)**. Required when `tfa_info` is provided. |

#### Enumerator contact_type

| Enumerador | Description                                         |
|------------|---------------------------------------------------|
| **sms**    | Send via SMS to mobile phone |
| **email**  | Send via email                      |
| **device** | Validation via device token                |

## Response

### Success Response

STATUS 202

Response Body: Batch accepted for processing

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "total_amount": 2778.42,
  "batch_status": "pending",
  "payment_type": "collection_slip"
}
```

Response Body: exemplo ilustrativo (`batch_status` aprovado)

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "total_amount": 2778.42,
  "batch_status": "approved",
  "payment_type": "collection_slip"
}
```

:::info Batch processing
The `batch_status` field in the response indicates the **immediate state** of the batch after this request (for example, pending confirmation, pending 2FA approval, or already routed to processing), according to the applicable flow. When there is a [batch confirmation](./confirmacao_de_lote_de_fatura_de_recolhimento.md) step, follow that documentation to approve or reject the batch with two-factor authentication. Possible `batch_status` values are listed in [batch_payment_status](#enumeradores-batch_payment_status).
:::

### Response Body Params

| Field               | Type    | Description                         |
|---------------------|---------|-----------------------------------|
| `batch_payment_key` *       | uuid4 | Unique batch payment identifier. |
| `request_control_key` *     | uuid4 | Unique client request identifier (batch). |
| `account_key` *             | uuid4 | Debited account key. |
| `total_amount` *            | number | Sum of `payment_amount` across all batch items. |
| `batch_status` *         | [enum](#enumeradores-batch_payment_status) | Batch status right after request; depends on the flow (confirmation, 2FA, and immediate processing). |
| `payment_type` *            | [enum](#enumeradores-payment_type) | Payment type. |

### Enumeratores batch_payment_status

| Enumerador    | Description     |
|---------------|---------------|
| `pending`     | Pendente de processamento |
| `pending_2fa_approval` | Pending 2FA approval |
| `rejected`    | Rejeitado |
| `approved`    | Aprovado |
| `processed`   | Processado |

### Enumeratores payment_type

| Enumerador    | Type      | Description     |
|---------------|-----------|---------------|
| `bank_slip`     | string    | Bank slip    |
| `collection_slip` | string  | Collection slip (utility/tax bill) |

:::danger Warning
The `bank_slip` enumerator does not apply to this collection slip batch endpoint; in this flow, `payment_type` must be `collection_slip`.
:::

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Title",
    "description": "Description in english",
    "translation": "Description em português",
    "code": "Code"
}
```

| HTTP code | QI code | Title | Description (eng) | Description (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 400         | BIP000024 | Bad Request | Request control key already exists. | Request control key already exists. |
| 400         | BIP000050 | Bad Request | Requester configuration does not exist. | Requester configuration does not exist. |
| 400         | BIP000052 | Bad Request | Given document number does not belong to an approver for this account | Provided document number does not belong to an account approver |
| 400         | BIP000053 | Bad Request | Error getting approver data | Error getting approver data |
| 400         | BIP000054 | Bad Request | TFA info required | TFA info required |
| 400         | BIP000055 | Bad Request | Error sending verification token | Error sending verification token |
| 400         | BIP000065 | Bad Request | Payment verification time window exceeded. | Payment verification time window exceeded. |
| 400         | BIP000079 | Bad Request | A session_id must be provided token | A session_id must be provided |
| 400         | BIP000082 | Bad Request | A list of collection slip payments must be provided. | A list of collection slip payments must be provided. |

---

# Solicitar pagamento em lote de fatura de recolhimento (convênio/tributo) com autenticação de dois fatores

URL: /en/documentation/baas/cobranca/2fa_v2/solicitar_pagamento_lote_de_fatura_de_recolhimento_sem_confirmacao_de_lote

Este endpoint permite solicitar o pagamento de múltiplas faturas de recolhimento em uma única requisição, com **`tfa_info`** quando a operação exigir autenticação de dois fatores **nesta solicitação**.

:::info Fatura de recolhimento
Esse tipo de cobrança é emitido por concessionárias de serviços (conta de água, luz, telefone e gás) e órgãos públicos (tributos). Eles não são registrados na Câmara Interbancária de Pagamento (CIP/Núclea), por isso, não retornam as mesmas informações que um boleto bancário apresenta.
:::

:::info Fluxo após a solicitação
A **autenticação de dois fatores (2FA)** é exigida **nesta solicitação**; o corpo deve incluir **`tfa_info`** conforme as seções abaixo e o [objeto `tfa_info`](#objeto-tfa_info).
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/ ACCOUNT_KEY /payments/batch_collection_slip
MÉTODO POST

### Request Path Params

| Campo               | Tipo    | Descrição                               | Caracteres |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` *     | uuid4   | Chave única de identificação da conta.  | 36         |

## Autenticação via email e SMS

Request Body: lote com linha digitável e TFA por SMS ou email

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  },
  "collection_slip_payments": [
    {
      "request_control_key": "c7915a43-212f-5813-9adc-d3ed5d3d3bfd",
      "digitable_line": "836200000138892100450006762142420244046000010192",
      "payment_amount": 1389.21
    }
  ]
}
```

Request Body: lote com código de barras e TFA por SMS ou email

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  },
  "collection_slip_payments": [
    {
      "request_control_key": "c7915a43-212f-5813-9adc-d3ed5d3d3bfd",
      "barcode": "83620000001388921004500067621424202440460000101",
      "payment_amount": 1389.21
    }
  ]
}
```

## Autenticação via dispositivo

Além das formas já existentes de autenticação via **sms** e **email**, é possível autenticar a transação utilizando um dispositivo [previamente cadastrado](/documentation/baas/dispositivo/create/solicitacao_cadastro_dispositivo). Nesse caso, o `session_id` deve ser obtido na **Device Scan** e enviado no `tfa_info`.

Request Body: lote com linha digitável e TFA por dispositivo

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "session_id": "b2f18d3a-67c2-4a7f-98e5-1d3f5c6b8a72",
    "contact_type": "device"
  },
  "collection_slip_payments": [
    {
      "request_control_key": "c7915a43-212f-5813-9adc-d3ed5d3d3bfd",
      "digitable_line": "836200000138892100450006762142420244046000010192",
      "payment_amount": 1389.21
    }
  ]
}
```

Request Body: lote com código de barras e TFA por dispositivo

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "session_id": "b2f18d3a-67c2-4a7f-98e5-1d3f5c6b8a72",
    "contact_type": "device"
  },
  "collection_slip_payments": [
    {
      "request_control_key": "c7915a43-212f-5813-9adc-d3ed5d3d3bfd",
      "barcode": "83620000001388921004500067621424202440460000101",
      "payment_amount": 1389.21
    }
  ]
}
```

### Body Params

| Campo               | Tipo          | Descrição                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Chave única de identificação da requisição do cliente (lote). |
| `tfa_info`       | object | Quando o 2FA for exigido **nesta etapa** (solicitação do lote), envie aprovador e canal de envio do token no [objeto `tfa_info`](#objeto-tfa_info). Caso o fluxo não exija 2FA na solicitação, omita o campo. |
| `collection_slip_payments` * | array     | Lista de pagamentos de fatura de recolhimento. Limite de **1000** itens por requisição. |

Cada elemento de `collection_slip_payments` deve conter:

| Campo               | Tipo          | Descrição                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Chave única de identificação da requisição do cliente para aquele item do lote. |
| `barcode`               | string    | Código de barras. |
| `digitable_line`        | string    | Linha digitável. |
| `payment_amount` *      | number    | Valor a ser pago. |

:::danger Aviso
Para cada item, o `payment_amount` enviado deve ser compatível com o que a consulta interna da fatura de recolhimento determinar (por exemplo, alinhado ao `total_amount` e às regras do convênio/tributo), nas mesmas condições do fluxo de pagamento unitário de fatura de recolhimento.
:::

### Objeto tfa_info

Os campos seguem o mesmo formato da [solicitação de pagamento de fatura de recolhimento](./solicitacao_de_pagamento_de_fatura_de_recolhimento.md#objeto-tfa_info).

| Campo                        | Tipo   | Descrição                                                                                                                                          |
| ---------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `approver_document_number` * | string | Documento (CPF/CNPJ) da pessoa aprovadora que receberá o token ou aprovará via dispositivo. Obrigatório quando `tfa_info` é enviado.                |
| `session_id`                 | string | Chave única de identificação da sessão do dispositivo no formato UUID v4 (**obrigatório** para TFA via dispositivo).                               |
| `contact_type` *             | string | Canal para envio ou validação do token: **[Enumerador contact_type](#enumerador-contact_type)**. Obrigatório quando `tfa_info` é enviado. |

#### Enumerador contact_type

| Enumerador | Descrição                                         |
|------------|---------------------------------------------------|
| **sms**    | Envio por mensagem de texto para telefone celular |
| **email**  | Envio por correio eletrônico                      |
| **device** | Validação por token do dispositivo                |

## Response

### Success Response

STATUS 202

Response Body: Lote aceito para processamento

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "total_amount": 2778.42,
  "batch_status": "pending",
  "payment_type": "collection_slip"
}
```

Response Body: exemplo ilustrativo com `batch_status` aprovado

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "total_amount": 2778.42,
  "batch_status": "approved",
  "payment_type": "collection_slip"
}
```

:::info Processamento do lote
O campo `batch_status` na resposta indica o **estado imediato** do lote após esta solicitação (por exemplo, pendente de aprovação 2FA ou já encaminhado ao processamento), conforme o fluxo aplicável. O 2FA pode integrar esta solicitação (`tfa_info`) ou outras etapas do fluxo, conforme a operação. Os valores possíveis de `batch_status` estão em [batch_payment_status](#enumeradores-batch_payment_status).
:::

### Response Body Params

| Campo               | Tipo    | Descrição                         |
|---------------------|---------|-----------------------------------|
| `batch_payment_key` *       | uuid4 | Chave única de identificação do pagamento em lote. |
| `request_control_key` *     | uuid4 | Chave única de identificação da requisição do cliente (lote). |
| `account_key` *             | uuid4 | Chave da conta debitada. |
| `total_amount` *            | number | Soma dos valores (`payment_amount`) dos itens do lote. |
| `batch_status` *         | [enum](#enumeradores-batch_payment_status) | Status do lote logo após a solicitação; depende do fluxo (2FA e processamento imediato). |
| `payment_type` *            | [enum](#enumeradores-payment_type) | Tipo do pagamento. |

### Enumeradores batch_payment_status

| Enumerador    | Descrição     |
|---------------|---------------|
| `pending`     | Pendente de processamento |
| `pending_2fa_approval` | Pendente de aprovação 2FA |
| `rejected`    | Rejeitado |
| `approved`    | Aprovado |
| `processed`   | Processado |

### Enumeradores payment_type

| Enumerador    | Tipo      | Descrição     |
|---------------|-----------|---------------|
| `bank_slip`     | string    | Boleto bancário    |
| `collection_slip` | string  | Fatura de recolhimento |

:::danger Aviso
O enumerador `bank_slip` não se aplica ao fluxo de lote de faturas de recolhimento deste endpoint; para este caso, espera-se `payment_type` com valor `collection_slip`.
:::

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Descrição em português",
    "code": "Código"
}
```

| Código HTTP | Código QI | Título | Descrição (eng) | Descrição (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 400         | BIP000024 | Bad Request | Request control key already exists. | Chave de controle da requisição já existe. |
| 400         | BIP000050 | Bad Request | Requester configuration does not exist. | Configuração do requester não existe. |
| 400         | BIP000052 | Bad Request | Given document number does not belong to an approver for this account | Número de documento enviado não pertence a um aprovador da conta |
| 400         | BIP000053 | Bad Request | Error getting approver data | Erro ao obter dados do aprovador |
| 400         | BIP000054 | Bad Request | TFA info required | Informações de TFA necessárias |
| 400         | BIP000055 | Bad Request | Error sending verification token | Erro ao enviar token de verificação |
| 400         | BIP000065 | Bad Request | Payment verification time window exceeded. | Janela de tempo de verificação de pagamento excedida. |
| 400         | BIP000079 | Bad Request | A session_id must be provided token | Uma session_id deve ser fornecida |
| 400         | BIP000082 | Bad Request | A list of collection slip payments must be provided. | Uma lista de faturas de recolhimento deve ser fornecida. |

---

# Token validation for bank slip payment batch

URL: /en/documentation/baas/cobranca/2fa_v2/validacao_de_token_de_lote_de_boleto_bancario

This endpoint completes the **two-factor authentication (2FA)** step for a bank slip batch that, after [batch confirmation with `tfa_info`](../confirmacao_de_lote_de_boleto_bancario_autenticacao_dois_fatores.md), is in `batch_status` **`pending_2fa_approval`** (approval) or **`pending_2fa_rejection`** (rejection). After token validation, the batch proceeds to **asynchronous payment processing**, and the final status reflects the decision recorded at confirmation (`approved` or `rejected`). To request a new token while the batch is in **pending_2fa_approval** (approval) or **pending_2fa_rejection** (rejection), use [Resend token for bank slip payment batch confirmation](./solicitacao_de_reenvio_de_token_de_lote_de_boleto_bancario.md).

:::info Bank slip
A traditional bank slip (digitable line not starting with digit 8). It is registered in the Interbank Payment Chamber (CIP/Núclea) and can be paid at financial and payment institutions authorized by the Central Bank.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/**ACCOUNT_KEY**/payment/batch_bank_slip/**PAYMENT_BATCH_KEY**/validate_token
METHOD PATCH

### Request Path Params

| Field                 | Type  | Description                                                                                | Characters |
| --------------------- | ----- | ---------------------------------------------------------------------------------------- | ---------- |
| `account_key` *       | uuid4 | Unique account identifier.                                                   | 36         |
| `payment_batch_key` * | uuid4 | Unique batch identifier (`batch_payment_key` returned at batch creation). | 36         |

### Authentication via Email and SMS

Request Body: Batch token validation

```json
{
  "token": "329adf"
}
```

### Authentication via Device

To complete device authentication, the request must be sent with an empty payload. Validation is performed internally, with no additional request body information required. This endpoint should only be used after the batch enters **`pending_2fa_approval`** (approval) or **`pending_2fa_rejection`** (rejection) at [batch confirmation with `tfa_info`](../confirmacao_de_lote_de_boleto_bancario_autenticacao_dois_fatores.md).

Request Body: Batch token validation

```json
{

}
```

### Body Params

| Field   | Type   | Description                                                                                                        | Characters |
| ------- | ------ | ---------------------------------------------------------------------------------------------------------------- | ---------- |
| `token` | string | Authentication code sent to the account transaction approver **required for TFA via SMS or email** | 6          |

## Response

### Success Response

After successful validation, the API responds with **202** and the batch is processed asynchronously. The final status follows the decision registered in confirmation (`approved` or `rejected`).

STATUS 202

Response Body: Batch after token validation (example with `approved` decision)

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
  "total_amount": 1357.3,
  "batch_status": "approved",
  "payment_type": "bank_slip"
}
```

### Response Body Params

| Field                   | Type   | Description                                                                                                                                                                                                                                                                    |
| ----------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `batch_payment_key` *   | uuid4  | Unique batch payment identifier.                                                                                                                                                                                                                           |
| `request_control_key` * | uuid4  | Unique client request identifier (batch).                                                                                                                                                                                                                |
| `account_key` *         | uuid4  | Debited account key.                                                                                                                                                                                                                                                     |
| `total_amount` *        | number | Sum of the amounts of all batch items.                                                                                                                                                                                                                                          |
| `batch_status` *        | string | After token validation, the final status reflects the decision registered during confirmation (`approved` or `rejected`). The `batch_status` cycle follows the batch payment request documentation available for your operation (enumerator `batch_payment_status`). |
| `payment_type` *        | string | Payment type; for this flow, expected value is `bank_slip`.                                                                                                                                                                                                                     |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Title",
    "description": "Description in english",
    "translation": "Description em português",
    "code": "Code"
}
```

| HTTP code | QI code | Title      | Description (eng)                               | Description (pt-br)                                                |
| ----------- | --------- | ----------- | --------------------------------------------- | ---------------------------------------------------------------- |
| 403         | BIP000010 | Forbidden   | User is not allowed to do this action         | User is not allowed to do this action                 |
| 404         | BIP000011 | Not Found   | The source account key was not found.         | The source account key was not found.                   |
| 400         | BIP000013 | Bad Request | The source account is closed.                 | The source account is closed.                                 |
| 400         | BIP000050 | Bad Request | Requester configuration does not exist        | Requester configuration does not exist.                            |
| 400         | BIP000058 | Bad Request | Error while validating verification token     | Error while validating verification token                             |
| 400         | BIP000059 | Bad Request | Number of verification token validation attempts exceeded. | Number of verification token validation attempts exceeded. |
| 400         | BIP000060 | Bad Request | Verification token expired.                   | Verification token expired.                                   |
| 400         | BIP000061 | Bad Request | Verification token validation failed.       | Verification token validation failed.                      |
| 400         | BIP000065 | Bad Request | Payment verification time window exceeded.    | Payment verification time window exceeded.            |
| 404         | BIP000083 | Not Found   | Batch payment not found by batch payment key. | Batch payment not found by batch payment key.            |
| 400         | BIP000085 | Bad Request | Batch payment status is not pending approval. | Batch payment status is not pending approval.        |
| 400         | BIP000086 | Bad Request | A token is required for SMS or email validation.                    | A token is required for SMS or email validation.             |

---

# Token validation for collection slip payment batch (utility/tax)

URL: /en/documentation/baas/cobranca/2fa_v2/validacao_de_token_de_lote_de_fatura_de_recolhimento

This endpoint completes the **two-factor authentication (2FA)** step for a collection slip batch that, after [batch confirmation with `tfa_info`](../confirmacao_de_lote_de_fatura_de_recolhimento_autenticacao_dois_fatores.md), is in `batch_status` **`pending_2fa_approval`** (approval) or **`pending_2fa_rejection`** (rejection). After token validation, the batch proceeds to **asynchronous payment processing**, and the final status reflects the decision recorded at confirmation (`approved` or `rejected`). To request a new token while the batch is in **pending_2fa_approval** (approval) or **pending_2fa_rejection** (rejection), use [Resend token for collection slip payment batch confirmation (utility/tax)](./solicitacao_de_reenvio_de_token_de_lote_de_fatura_de_recolhimento.md).

:::info Collection slip (utility/tax bill)
This charge type is issued by utility companies (water, electricity, phone, and gas) and public agencies (taxes). It is not registered in the Interbank Payment Chamber (CIP/Núclea), so it does not return the same information as a bank slip.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/**ACCOUNT_KEY**/payment/batch_collection_slip/**PAYMENT_BATCH_KEY**/validate_token
METHOD PATCH

### Request Path Params

| Field                 | Type  | Description                                                                                | Characters |
| --------------------- | ----- | ---------------------------------------------------------------------------------------- | ---------- |
| `account_key` *       | uuid4 | Unique account identifier.                                                   | 36         |
| `payment_batch_key` * | uuid4 | Unique batch identifier (`batch_payment_key` returned at batch creation). | 36         |

### Authentication via Email and SMS

Request Body: Batch token validation

```json
{
  "token": "329adf"
}
```

### Authentication via Device

To complete device authentication, the request must be sent with an empty payload. Validation is performed internally, with no additional request body information required. This endpoint should only be used after the batch enters **`pending_2fa_approval`** (approval) or **`pending_2fa_rejection`** (rejection) at [batch confirmation with `tfa_info`](../confirmacao_de_lote_de_fatura_de_recolhimento_autenticacao_dois_fatores.md).

Request Body: Batch token validation

```json
{

}
```

### Body Params

| Field   | Type   | Description                                                                                                        | Characters |
| ------- | ------ | ---------------------------------------------------------------------------------------------------------------- | ---------- |
| `token` | string | Authentication code sent to the account transaction approver **required for TFA via SMS or email** | 6          |

## Response

### Success Response

After successful validation, the API responds with **202** and the batch is processed asynchronously. The final status follows the decision registered in confirmation (`approved` or `rejected`).

STATUS 202

Response Body: Batch after token validation (example with `approved` decision)

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "total_amount": 2778.42,
  "batch_status": "approved",
  "payment_type": "collection_slip"
}
```

### Response Body Params

| Field                   | Type   | Description                                                                                                                                                                                                                                                                                         |
| ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `batch_payment_key` *   | uuid4  | Unique batch payment identifier.                                                                                                                                                                                                                                                |
| `request_control_key` * | uuid4  | Unique client request identifier (batch).                                                                                                                                                                                                                                       |
| `account_key` *         | uuid4  | Debited account key.                                                                                                                                                                                                                                                                          |
| `total_amount` *        | number | Sum of the amounts of all batch items.                                                                                                                                                                                                                                                               |
| `batch_status` *        | string | After token validation, the final status reflects the decision registered during confirmation (`approved` or `rejected`). The `batch_status` cycle follows the batch payment request documentation available for your operation (enumerator `batch_payment_status`). |
| `payment_type` *        | string | Payment type; for this flow, expected value is `collection_slip`.                                                                                                                                                                                                                                   |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Title",
    "description": "Description in english",
    "translation": "Description em português",
    "code": "Code"
}
```

| HTTP code | QI code | Title      | Description (eng)                               | Description (pt-br)                                                |
| ----------- | --------- | ----------- | --------------------------------------------- | ---------------------------------------------------------------- |
| 403         | BIP000010 | Forbidden   | User is not allowed to do this action         | User is not allowed to do this action                 |
| 404         | BIP000011 | Not Found   | The source account key was not found.         | The source account key was not found.                   |
| 400         | BIP000013 | Bad Request | The source account is closed.                 | The source account is closed.                                 |
| 400         | BIP000050 | Bad Request | Requester configuration does not exist        | Requester configuration does not exist.                            |
| 400         | BIP000058 | Bad Request | Error while validating verification token     | Error while validating verification token                             |
| 400         | BIP000059 | Bad Request | Number of verification token validation attempts exceeded. | Number of verification token validation attempts exceeded. |
| 400         | BIP000060 | Bad Request | Verification token expired.                   | Verification token expired.                                   |
| 400         | BIP000061 | Bad Request | Verification token validation failed.       | Verification token validation failed.                      |
| 400         | BIP000065 | Bad Request | Payment verification time window exceeded.    | Payment verification time window exceeded.            |
| 404         | BIP000083 | Not Found   | Batch payment not found by batch payment key. | Batch payment not found by batch payment key.            |
| 400         | BIP000085 | Bad Request | Batch payment status is not pending approval.         | Batch payment status is not pending approval.              |
| 400         | BIP000086 | Bad Request | A token is required for SMS or email validation.                    | A token is required for SMS or email validation.             |

---

# Schedule Boleto payment

URL: /en/documentation/baas/cobranca/agendamento/agendar_pagamento_de_boleto_bancario

This endpoint allows scheduling the payment of boletos. The scheduling should be made after consulting the boleto, using the returned information to ensure the correct flow and avoid failures during the payment process.

:::info Boleto
This is the conventional boleto (with digitable lines not starting with the digit 8). It is registered with the Interbank Payment Clearinghouse (CIP/Núclea) and can be paid at financial institutions and payment institutions authorized to operate by the Central Bank.
:::
## Request

ENDPOINT /account/ ACCOUNT_KEY /payment_schedule/bank_slip
METHOD POST

### Request Path Params

| Field          | Type   | Description                               | Characters |
|----------------|--------|-------------------------------------------|------------|
| `account_key` *| uuidv4 | Unique account identification key.        | 36         |

Request Body: Payment of boleto with digitable line

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "digitable_line": "00190000090361557400500000024174396700000991000",
  "payment_amount": 1156.8,
  "payment_date": "2024-03-30"
}
```
Request Body: Payment of boleto with barcode

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "barcode": "00190000090361557400500000024174396700000991000",
  "payment_amount": 1156.8,
  "payment_date": "2024-03-30"
}
```

### Body Params
| Field                 | Type   | Description                                            |
|-----------------------|--------|--------------------------------------------------------|
| `request_control_key` * | uuid4 | Unique identification key for the client's request.     |
| `barcode`             | string | Barcode.                                                |
| `digitable_line`      | string | Digitable line.                                         |
| `payment_amount` *    | number | Amount to be paid.                                      |
| `payment_date` *      | string | Scheduling date.                                        |
:::danger Warning
The `payment_amount` must always be equal to the `total_amount` returned in the boleto query if partial payment is not allowed for the boleto. For titles where partial payment is allowed, the client may choose the `payment_amount`, as long as its sum with the boleto's `registered_payment_amount` does not exceed the `total_amount`.
:::

## Response

### Success Response

STATUS 201

Response Body: Schedule confirmed

```json
{
   "payment_key":"c4325104-d60b-44f3-aae4-49155564a2ea",
   "request_control_key":"b713b2f6-2f48-4d18-b0c9-7186e4edf189",
   "payer_name":"COOPERATIVA INDUSTRIAL MURILO",
   "payer_document_number":"00037025000160",
   "source_account_key":"6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
   "paid_amount":1050.1,
   "payment_date":"2024-04-03",
   "payment_type":"bank_slip",
   "bank_slip": {
        "bank_slip_key":"95080ffd-3ac5-48d7-b3fe-659e4aaba81a",
        "barcode":"00193967000009910000000003615574000000002417",
        "digitable_line":"00190000090361557400500000024174396700000991000",
        "payer_name":"COOPERATIVA TESTE",
        "payer_document_number":"00037025000160",
        "beneficiary_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_trading_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_document_number":"52069937000117",
        "beneficiary_bank_ispb":"00000000",
        "guarantor_name":null,
        "guarantor_document_number":null,
        "expiration_date":"2024-03-29",
        "max_payment_data": "2026-03-29",
        "partial_payment_indicator":"allowed",
        "registered_payment_amount":9029.0,
        "nominal_amount":9910.0,
        "total_amount":10129.1,
        "rebate_amount":0.0,
        "discount_amount":0.0,
        "fine_amount":0.0,
        "interest_amount":219.1
    },
   "collection_slip":null,
   "payment_schedule_status":"scheduled"
}
```

### Response Body Params

| Field                | Type   | Description                                                       |
|----------------------|--------|-------------------------------------------------------------------|
| `payment_key` *      | uuid4  | Unique payment identification key.                                 |
| `request_control_key` * | uuid4| Unique identification key for the client's request.                |
| `payer_name` *       | string | Name of the effective payer.                                        |
| `payer_document_number` * | string| Document number of the effective payer (CPF/CNPJ).               |
| `source_account_key` * | uuid4 | Key of the debited account.                                        |
| `paid_amount` *      | number | Amount effectively paid.                                           |
| `payment_date` *     | string | Payment date.                                                      |
| `payment_type` *     | [enum](#enumeradores-payment_type) | Payment type.                                      |
| `bank_slip`          | [object](#object-bank_slip)  | Boleto.                                                  |
| `collection_slip`    | object  | Collection invoice.                                               |
| `payment_schedule_status` * | [enum](#enumeradores-payment_schedule_status) | Payment status.                    |

### Enumeradores payment_type
| Enumerator          | Description               |
|---------------------|---------------------------|
| `bank_slip`         | Boleto                    |
| `collection_slip`   | Collection invoice        |
:::danger Warning
The enumerator `collection_slip` does not apply to the boleto flow, and the collection_slip object will always be null.
:::

### Enumeradores payment_schedule_status
| Enumerator                | Description                                                                                    |
|---------------------------|------------------------------------------------------------------------------------------------|
| `pending_2fa_approval`    | Schedule pending two-factor authentication (2FA)                                               |
| `scheduled`               | Payment successfully scheduled                                                                 |
| `executed`                | The payment related to the schedule was successfully executed                                  |
| `rejected`                | The payment related to the schedule was rejected                                               |
| `canceled`                | Schedule canceled                                                                              |
| `error`                   | Error during scheduling                                                                         |

:::danger Warning
For payments where QI does not receive a response from CIP within two minutes, the payment will be returned with the status `pending_execution`. After QI receives the response from CIP, the pending payment webhook described on the [webhooks page](/documentation/baas_v2/cobranca/webhooks) will be sent to the client.
:::

### Object bank_slip
| Field                   | Type      | Description                                                                 |
|-------------------------|-----------|-----------------------------------------------------------------------------|
| `barcode` *             | string    | Barcode.                                                                    |
| `digitable_line` *      | string    | Digitable line.                                                             |
| `payer_name` *          | string    | Payer's name.                                                               |
| `payer_document_number` * | string | Payer's document number (CPF/CNPJ).                                         |
| `beneficiary_name` *    | string    | Beneficiary's name.                                                         |
| `beneficiary_trading_name` | string | Beneficiary's trade name.                                                   |
| `beneficiary_document_number` * | string | Beneficiary's document number (CPF/CNPJ).                                   |
| `beneficiary_bank_ispb` * | string  | ISPB code of the beneficiary's bank.                                        |
| `guarantor_name`        | string    | Name of the guarantor.                                                      |
| `guarantor_document_number` | string | Guarantor's document number (CPF/CNPJ).                                     |
| `expiration_date` *     | string    | Due date.                                                                   |
| `max_payment_date` *    | string    | Maximum payment date.                                                       |
| `partial_payment_indicator` * | [enum](#enumeradores-partial_payment_indicator) | Partial payment indicator.          |
| `registered_payment_amount` | string| Total registered payment amount.                                            |
| `nominal_amount` *      | number    | Original amount.                                                            |
| `total_amount` *        | number    | Total amount.                                                               |
| `rebate_amount` *       | number    | Rebate amount.                                                              |
| `discount_amount` *     | number    | Discount amount.                                                            |
| `fine_amount` *         | number    | Fine amount.                                                                |
| `interest_amount` *     | number    | Interest amount.                                                            |

### Enumeradores partial_payment_indicator
| Enumerator     | Description           |
|--------------- |-----------------------|
| `allowed`      | Allowed               |
| `not_allowed`  | Not allowed           |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Description in portuguese",
    "code": "Código"
}
```

| HTTP Code | QI Code | Title | Description (eng) | Description (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 400         | BIP000001 | Bad Request | The barcode or digitable line must have 44 or 47 characters. | O código de barras ou linha digitável deve ter 44 ou 47 caracteres. |
| 400         | BIP000002 | Bad Request | The bill sent does not correspond to a bank slip. | A conta enviado não corresponde a um boleto bancário. |
| 400         | BIP000003 | Bad Request | The digitable line sent is invalid. | A linha digitável enviada é inválida. |
| 404         | BIP000004 | Not Found | The bank slip was not found. | O boleto não foi encontrado. |
| 400         | BIP000005 | Bad Request | It was not possible to consult the bank slip at this time. Please try again in a few minutes. | Não foi possível consultar o boleto neste momento. Por favor, tente novamente em alguns minutos. |
| 400         | BIP000006 | Bad Request | Bank slip already written off | Boleto já baixado |
| 400         | BIP000007 | Bad Request | Bank slip blocked for payment | Boleto bloqueado para pagamento |
| 400         | BIP000008 | Bad Request | Bank slip already paid | Boleto já pago |
| 400         | BIP000009 | Bad Request | Invalid bank slip. Please consult issuing bank | Boleto inválido. Favor consultar banco emissor |
| 403         | BIP000010 | Forbidden | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404         | BIP000011 | Not Found | The source account key was not found. | A chave da conta de origem não foi encontrada. |
| 400         | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400         | BIP000013 | Bad Request | The source account is closed. | A conta de origem está fechada. |
| 400         | BIP000014 | Bad Request | The source account is blocked. | A conta de origem está bloqueada. |
| 400         | BIP000015 | Bad Request | Payment date is greater than the maximum payment date. | A data de pagamento é maior que a data máxima de pagamento. |
| 400         | BIP000016 | Bad Request | Payment date is smaller than the calculation date. | A data de pagamento é menor que a data de cálculo. |
| 400         | BIP000017 | Bad Request | Invalid payment amount. | Valor de pagamento inválido. |
| 400         | BIP000018 | Bad Request | Partial payment is not allowed. | Pagamento parcial não é permitido. |
| 400         | BIP000019 | Bad Request | The payment amount is greater than the available amount. | O valor do pagamento é maior que o valor disponível. |
| 400         | BIP000020 | Bad Request | All partial payments for this bank slip have already been made. | Todos os pagamentos parciais deste boleto já foram realizados. |
| 400         | BIP000022 | Bad Request | Bank slip payment service is closed. | Serviço de pagamento de boleto está fechado. |
| 400         | BIP000023 | Bad Request | The source account has insufficient balance. Payment cannot be made. | A conta de origem possui saldo insuficiente. Pagamento não pode ser realizado. |
| 400         | BIP000024 | Bad Request | Request control key already exists. | Chave de controle da requisição já existe. |
| 400         | BIP000025 | Bad Request | It was not possible to pay the bank slip at this time. Please verify your information and, if necessary, contact us for assistance. | Não foi possível pagar o boleto neste momento. Por favor, verifique suas informações e, se necessário, entre em contato conosco para assistência. |
| 400         | BIP000028 | Bad Request | The source account has blocked balance. Payment cannot be made. | A conta de origem possui saldo em conta bloqueado. Pagamento não pode ser realizado. |

## Ambiente de Sandbox

Para realizar os testes em ambiente de sandbox, devem ser usadas as linhas digitáveis listadas na [Seção de pagamento de boleto bancário](/documentation/baas/cobranca/pagar_boleto_bancario).

---

# Schedule payment of collection invoice (agreement/tribute)

URL: /en/documentation/baas/cobranca/agendamento/agendar_pagamento_de_fatura_de_recolhimento

This endpoint allows scheduling the payment of collection invoices.
The scheduling should be made after consulting the Collection Invoice, using the returned information to ensure the correct flow and avoid failures during the payment process.
:::info Collection Invoice
This type of charge is issued by utility companies (water, electricity, telephone, and gas bills) and public entities (taxes). They are not registered with the Interbank Payment Clearinghouse (CIP/Núclea) and, therefore, do not return the same information as a boleto.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /payment_schedule/collection_slip
METHOD POST

### Request Path Params

| Field          | Type   | Description                               | Characters |
|----------------|--------|-------------------------------------------|------------|
| `account_key` *| uuidv4 | Unique account identification key.        | 36         |

Request Body: Scheduling of collection invoice with digitable line

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "digitable_line": "00190000090361557400500000024174396700000991000",
  "payment_amount": 1156.8,
  "payment_date": "2024-03-30"
}
```
Request Body: Scheduling of collection invoice with barcode

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "barcode": "00190000090361557400500000024174396700000991000",
  "payment_amount": 1156.8,
  "payment_date": "2024-03-30"
}
```

### Body Params
| Field                | Type    | Description                                |
|----------------------|---------|--------------------------------------------|
| `request_control_key` *| uuid4 | Unique identification key for the client's request. |
| `barcode`            | string  | Barcode.                                    |
| `digitable_line`     | string  | Digitable line.                             |
| `payment_amount` *   | number  | Amount to be paid.                          |
| `payment_date` *     | string  | Scheduling date.                            |
:::danger Warning
The `payment_amount` must always be equal to the `total_amount` returned in the boleto query.
:::

## Response

### Success Response

STATUS 201

Response Body: Schedule confirmed

```json
{
  "payment_key": "33860ad0-bcb0-47b7-bbe7-c7e3ec2fc61a",
  "request_control_key": "ae4508df-f2cb-4e28-9f04-a19b7f2758c9",
  "payer_name": "COOPERATIVA INDUSTRIAL MURILO",
  "payer_document_number": "62069937000118",
  "source_account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "paid_amount": 1389.21,
  "payment_date": "2024-04-30",
  "payment_type": "collection_slip",
  "bank_slip": null,
  "collection_slip": {
    "barcode": null,
    "digitable_line": "836200000138892100450006762142420244046000010192",
    "collection_name": "CIA ULTRAGAZ SA-COD",
    "collection_document_number": "00394460005887",
    "expiration_date": "2024-04-15",
    "total_amount": 1389.21
  },
  "payment_schedule_status": "scheduled"
}
```

### Response Body Params
| Field                | Type   | Description                                       |
|----------------------|--------|---------------------------------------------------|
| `payment_key` *      | uuid4  | Unique payment identification key.                 |
| `request_control_key` *| uuid4 | Unique identification key for the client's request.|
| `payer_name` *       | string | Name of the effective payer.                       |
| `payer_document_number` *| string | Document number of the effective payer (CPF/CNPJ).|
| `source_account_key` *| uuid4 | Key of the debited account.                        |
| `transaction_key` *  | uuid4  | Payment transaction key.                           |
| `transaction_revert_key` | uuid4 | Payment reversal transaction key.                |
| `paid_amount` *      | number | Amount effectively paid.                          |
| `payment_date` *     | string | Payment date.                                     |
| `payment_type` *     | [enum](#enumeradores-payment_type) | Payment type.     |
| `bank_slip`          | object  | Boleto.                                           |
| `collection_slip`    | [object](#object-collection_slip) | Collection invoice.            |
| `payment_schedule_status` * | [enum](#enumeradores-payment_schedule_status) | Schedule status.    |

### Enumeradores payment_type
| Enumerator          | Description               |
|---------------------|---------------------------|
| `bank_slip`         | Boleto                    |
| `collection_slip`   | Collection invoice        |
:::danger Warning
The enumerator `bank_slip` does not apply to the collection invoice flow, and the bank_slip object will always be null.
:::

### Enumeradores payment_schedule_status
| Enumerator                | Description                                                                                    |
|---------------------------|------------------------------------------------------------------------------------------------|
| `pending_2fa_approval`    | Schedule pending two-factor authentication (2FA)                                               |
| `scheduled`               | Payment successfully scheduled                                                                 |
| `executed`                | The payment related to the schedule was successfully executed                                  |
| `rejected`                | The payment related to the schedule was rejected                                               |
| `canceled`                | Schedule canceled                                                                              |
| `error`                   | Error during scheduling                                                                         |

### Object collection_slip
| Field                     | Type      | Description                                                                       |
|---------------------------|-----------|-----------------------------------------------------------------------------------|
| `barcode`                 | string    | Barcode.                                                                          |
| `digitable_line`          | string    | Digitable line.                                                                   |
| `collection_name` *       | string    | Name of the agreement.                                                            |
| `collection_document_number` | string | Document number of the agreement (CPF/CNPJ).                                      |
| `expiration_date` *       | string    | Due date.                                                                         |
| `total_amount` *          | number    | Total amount.                                                                     |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Description em portuguese",
    "code": "Código"
}
```

| HTTP Code | QI Code | Title | Description (eng) | Description (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 400         | BIP000032 | Bad Request | The bill sent does not correspond to a collection slip. | A conta enviada não corresponde a uma fatura de recolhimento. |
| 400         | BIP000033 | Bad Request | The barcode or digitable line of the collection slip must have 44 or 48 characters. | O código de barras ou linha digitável da fatura de recolhimento deve ter 44 ou 48 caracteres. |
| 403         | BIP000010 | Forbidden | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404         | BIP000011 | Not Found | The source account key was not found. | A chave da conta de origem não foi encontrada. |
| 400         | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400         | BIP000013 | Bad Request | The source account is closed. | A conta de origem está fechada. |
| 400         | BIP000014 | Bad Request | The source account is blocked. | A conta de origem está bloqueada. |
| 400         | BIP000023 | Bad Request | The source account has insufficient balance. Payment cannot be made. | A conta de origem possui saldo insuficiente. Pagamento não pode ser realizado. |
| 400         | BIP000024 | Bad Request | Request control key already exists. | Chave de controle da requisição já existe. |
| 400         | BIP000028 | Bad Request | The source account has blocked balance. Payment cannot be made. | A conta de origem possui saldo em conta bloqueado. Pagamento não pode ser realizado. |
| 400         | BIP000034 | Bad Request | Collection slip already paid. | Fatura de recolhimento já paga. |
| 400         | BIP000035 | Bad Request | Covenant slip invalid barcode. | Código de barras da fatura de recolhimento inválido. |
| 400         | BIP000036 | Bad Request | Covenant slip overdue. | Fatura de recolhimento vencida. |
| 400         | BIP000037 | Bad Request | Error in collection slip consultation. | Erro na consulta da fatura de recolhimento. |
| 400         | BIP000038 | Bad Request | Outside of covenant payment hours. | Fora do horário de pagamento do convênio. |
| 400         | BIP000039 | Bad Request | Collection slip not accepted. | Fatura de recolhimento não aceita. |
| 400         | BIP000040 | Bad Request | Minimum advance not reached. | Mínimo de dias de adiantamento não atingido. |
| 400         | BIP000041 | Bad Request | Max payment amount exceeded. | Valor máximo de pagamento excedido. |
| 400         | BIP000044 | Bad Request | It was not possible to pay the collection slip at this time. Please verify your information and, if necessary, contact us for assistance. | Não foi possível pagar a fatura de recolhimento neste momento. Por favor, verifique suas informações e, se necessário, entre em contato conosco para assistência. |
| 400         | BIP000045 | Bad Request | Collection slip payment service is closed. | Serviço de pagamento de fatura de recolhimento está fechado. |

## Sandbox Environment

In our sandbox environment, we provide mocked digitable lines for simulating successful payments and testing error scenarios.

### Success scenarios

| Digitable line |
|---|
| 828300000007411100972013905080001546763201900028 |
| 838000000009235700481007241345219112001474229880 |
| 848000000006308600802021201071261517689002201070 |
| 858200000015000000643025703477209504800448091020 |

### Error Scenarios

| Digitable line | Error code0 |
|---|---|
| 858500000037350000643217212883260006147448091022 | BIP000035 |

---

# Cancel schedule

URL: /en/documentation/baas/cobranca/agendamento/cancelar_agendamento

This endpoint is used to cancel a scheduled payment of a Boleto or Collection Invoice.
:::info Boleto
This is the conventional boleto (with digitable lines not starting with the digit 8). It is registered with the Interbank Payment Clearinghouse (CIP/Núclea) and can be paid at financial institutions and payment institutions authorized to operate by the Central Bank.
:::
:::info Collection Invoice
This type of charge is issued by utility companies (water, electricity, telephone, and gas bills) and public entities (taxes). They are not registered with the Interbank Payment Clearinghouse (CIP/Núclea) and, therefore, do not return the same information as a boleto.
:::
## Request

ENDPOINT /account/ ACCOUNT_KEY /payment_schedule/ PAYMENT_SCHEDULE_KEY /cancel
METHOD PATCH

### Request Path Params

| Field                   | Type   | Description                                   | Characters |
|-------------------------|--------|-----------------------------------------------|------------|
| `account_key` *         | uuidv4 | Unique account identification key.            | 36         |
| `payment_schedule_key` *| uuidv4 | Unique schedule identification key.           | 36         |

## Response

### Success Response

STATUS 200

Response Body: Scheduled payment of boleto cancelled

```json
{
   "payment_key":"c4325104-d60b-44f3-aae4-49155564a2ea",
   "request_control_key":"b713b2f6-2f48-4d18-b0c9-7186e4edf189",
   "payer_name":"COOPERATIVA INDUSTRIAL MURILO",
   "payer_document_number":"00037025000160",
   "source_account_key":"6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
   "paid_amount":1050.1,
   "payment_date":"2024-04-03",
   "payment_type":"bank_slip",
   "bank_slip": {
        "bank_slip_key":"95080ffd-3ac5-48d7-b3fe-659e4aaba81a",
        "barcode":"00193967000009910000000003615574000000002417",
        "digitable_line":"00190000090361557400500000024174396700000991000",
        "payer_name":"COOPERATIVA TESTE",
        "payer_document_number":"00037025000160",
        "beneficiary_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_trading_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_document_number":"52069937000117",
        "beneficiary_bank_ispb":"00000000",
        "guarantor_name":null,
        "guarantor_document_number":null,
        "expiration_date":"2024-03-29",
        "max_payment_data": "2026-03-29",
        "partial_payment_indicator":"allowed",
        "registered_payment_amount":9029.0,
        "nominal_amount":9910.0,
        "total_amount":10129.1,
        "rebate_amount":0.0,
        "discount_amount":0.0,
        "fine_amount":0.0,
        "interest_amount":219.1
    },
   "collection_slip":null,
   "payment_schedule_status":"canceled"
}
```

Response Body: Scheduled payment of collection invoice cancelled

```json
{
  "payment_key": "33860ad0-bcb0-47b7-bbe7-c7e3ec2fc61a",
  "request_control_key": "ae4508df-f2cb-4e28-9f04-a19b7f2758c9",
  "payer_name": "COOPERATIVA INDUSTRIAL MURILO",
  "payer_document_number": "62069937000118",
  "source_account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "paid_amount": 1389.21,
  "payment_date": "2024-04-30",
  "payment_type": "collection_slip",
  "bank_slip": null,
  "collection_slip": {
    "barcode": null,
    "digitable_line": "836200000138892100450006762142420244046000010192",
    "collection_name": "CIA ULTRAGAZ SA-COD",
    "collection_document_number": "00394460005887",
    "expiration_date": "2024-04-15",
    "total_amount": 1389.21
  },
  "payment_schedule_status": "canceled"
}
```

### Response Body Params
| Field                     | Type   | Description                                                    |
|---------------------------|--------|----------------------------------------------------------------|
| `payment_key` *           | uuid4  | Unique payment identification key.                             |
| `request_control_key` *   | uuid4  | Unique identification key for the client's request.            |
| `payer_name` *            | string | Name of the effective payer.                                    |
| `payer_document_number` * | string | Document number of the effective payer (CPF/CNPJ).              |
| `source_account_key` *    | uuid4  | Key of the debited account.                                     |
| `paid_amount` *           | number | Amount effectively paid.                                        |
| `payment_date` *          | string | Scheduling date.                                                |
| `payment_type` *          | [enum](#enumeradores-payment_type) | Payment type.                                |
| `bank_slip`               | [object](#object-bank_slip)  | Boleto.                                        |
| `collection_slip`         | object | Collection invoice.                                             |
| `payment_schedule_status` * | [enum](#enumeradores-payment_schedule_status) | Schedule status.             |

### Enumerators payment_type
| Enumerator        | Type   | Description               |
|-------------------|--------|---------------------------|
| `bank_slip`       | string | Boleto                    |
| `collection_slip` | string | Collection invoice        |

### Enumerators payment_schedule_status
| Enumerator        | Description               |
|-------------------|---------------------------|
| `canceled`        | Schedule canceled         |

### Object bank_slip
| Field                          | Type      | Description                                                               |
|--------------------------------|-----------|---------------------------------------------------------------------------|
| `barcode` *                    | string    | Barcode.                                                                  |
| `digitable_line` *             | string    | Digitable line.                                                           |
| `payer_name` *                 | string    | Payer's name.                                                             |
| `payer_document_number` *      | string    | Payer's document number (CPF/CNPJ).                                       |
| `beneficiary_name` *           | string    | Beneficiary's name.                                                       |
| `beneficiary_trading_name`     | string    | Beneficiary's trade name.                                                 |
| `beneficiary_document_number` * | string   | Beneficiary's document number (CPF/CNPJ).                                 |
| `beneficiary_bank_ispb` *      | string    | ISPB code of the beneficiary's bank.                                      |
| `guarantor_name`               | string    | Name of the guarantor.                                                    |
| `guarantor_document_number`    | string    | Guarantor's document number (CPF/CNPJ).                                   |
| `expiration_date` *            | string    | Due date.                                                                 |
| `max_payment_date` *           | string    | Maximum payment date.                                                     |
| `partial_payment_indicator` *  | [enum](#enumeradores-partial_payment_indicator) | Partial payment indicator.      |
| `registered_payment_amount`    | string    | Total registered payment amount.                                          |
| `nominal_amount` *             | number    | Original amount.                                                          |
| `total_amount` *               | number    | Total amount.                                                             |
| `rebate_amount` *              | number    | Rebate amount.                                                            |
| `discount_amount` *            | number    | Discount amount.                                                          |
| `fine_amount` *                | number    | Fine amount.                                                              |
| `interest_amount` *            | number    | Interest amount.                                                          |

### Enumerators partial_payment_indicator
| Enumerator     | Description               |
|----------------|---------------------------|
| `allowed`      | Allowed                   |
| `not_allowed`  | Not allowed               |

### Object collection_slip
| Field                          | Type      | Description                                                               |
|--------------------------------|-----------|---------------------------------------------------------------------------|
| `barcode`                      | string    | Barcode.                                                                  |
| `digitable_line`               | string    | Digitable line.                                                           |
| `collection_name` *            | string    | Name of the agreement.                                                    |
| `collection_document_number` * | string    | Document number of the agreement (CPF/CNPJ).                              |
| `expiration_date` *            | string    | Due date.                                                                 |
| `total_amount` *               | number    | Total amount.                                                             |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Description em português",
    "code": "Código"
}
```

| HTTP Code | QI Code | Title | Description (eng) | Description (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 400         | BIP000001 | Bad Request | The barcode or digitable line must have 44 or 47 characters. | O código de barras ou linha digitável deve ter 44 ou 47 caracteres. |
| 400         | BIP000002 | Bad Request | The bill sent does not correspond to a bank slip. | A conta enviado não corresponde a um boleto bancário. |
| 400         | BIP000003 | Bad Request | The digitable line sent is invalid. | A linha digitável enviada é inválida. |
| 404         | BIP000004 | Not Found | The bank slip was not found. | O boleto não foi encontrado. |
| 400         | BIP000005 | Bad Request | It was not possible to consult the bank slip at this time. Please try again in a few minutes. | Não foi possível consultar o boleto neste momento. Por favor, tente novamente em alguns minutos. |
| 400         | BIP000006 | Bad Request | Bank slip already written off | Boleto já baixado |
| 400         | BIP000007 | Bad Request | Bank slip blocked for payment | Boleto bloqueado para pagamento |
| 400         | BIP000008 | Bad Request | Bank slip already paid | Boleto já pago |
| 400         | BIP000009 | Bad Request | Invalid bank slip. Please consult issuing bank | Boleto inválido. Favor consultar banco emissor |

---

# Check scheduling

URL: /en/documentation/baas/cobranca/agendamento/consultar_agendamento

This endpoint is used to query information about a scheduled payment of a Boleto or Collection Invoice.
:::info Boleto
This is the conventional boleto (with digitable lines not starting with the digit 8). It is registered with the Interbank Payment Clearinghouse (CIP/Núclea) and can be paid at financial institutions and payment institutions authorized to operate by the Central Bank.
:::
:::info Collection Invoice
This type of charge is issued by utility companies (water, electricity, telephone, and gas bills) and public entities (taxes). They are not registered with the Interbank Payment Clearinghouse (CIP/Núclea) and, therefore, do not return the same information as a boleto.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /payment_schedule/ PAYMENT_SCHEDULE_KEY
METHOD GET

### Request Path Params

| Field                   | Type   | Description                                   | Characters |
|-------------------------|--------|-----------------------------------------------|------------|
| `account_key` *         | uuidv4 | Unique account identification key.            | 36         |
| `payment_schedule_key` *| uuidv4 | Unique schedule identification key.           | 36         |

## Response

### Success Response

STATUS 200

Response Body: Scheduled payment of boleto

```json
{
   "payment_key":"c4325104-d60b-44f3-aae4-49155564a2ea",
   "request_control_key":"b713b2f6-2f48-4d18-b0c9-7186e4edf189",
   "payer_name":"COOPERATIVA INDUSTRIAL MURILO",
   "payer_document_number":"00037025000160",
   "source_account_key":"6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
   "paid_amount":1050.1,
   "payment_date":"2024-04-03",
   "payment_type":"bank_slip",
   "bank_slip": {
        "bank_slip_key":"95080ffd-3ac5-48d7-b3fe-659e4aaba81a",
        "barcode":"00193967000009910000000003615574000000002417",
        "digitable_line":"00190000090361557400500000024174396700000991000",
        "payer_name":"COOPERATIVA TESTE",
        "payer_document_number":"00037025000160",
        "beneficiary_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_trading_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_document_number":"52069937000117",
        "beneficiary_bank_ispb":"00000000",
        "guarantor_name":null,
        "guarantor_document_number":null,
        "expiration_date":"2024-03-29",
        "max_payment_data": "2026-03-29",
        "partial_payment_indicator":"allowed",
        "registered_payment_amount":9029.0,
        "nominal_amount":9910.0,
        "total_amount":10129.1,
        "rebate_amount":0.0,
        "discount_amount":0.0,
        "fine_amount":0.0,
        "interest_amount":219.1
    },
   "collection_slip":null,
   "payment_schedule_status":"scheduled"
}
```

Response Body: Scheduled payment of collection invoice

```json
{
  "payment_key": "33860ad0-bcb0-47b7-bbe7-c7e3ec2fc61a",
  "request_control_key": "ae4508df-f2cb-4e28-9f04-a19b7f2758c9",
  "payer_name": "COOPERATIVA INDUSTRIAL MURILO",
  "payer_document_number": "62069937000118",
  "source_account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "paid_amount": 1389.21,
  "payment_date": "2024-04-30",
  "payment_type": "collection_slip",
  "bank_slip": null,
  "collection_slip": {
    "barcode": null,
    "digitable_line": "836200000138892100450006762142420244046000010192",
    "collection_name": "CIA ULTRAGAZ SA-COD",
    "collection_document_number": "00394460005887",
    "expiration_date": "2024-04-15",
    "total_amount": 1389.21
  },
  "payment_schedule_status": "scheduled"
}
```

### Response Body Params
| Field                | Type   | Description                                       |
|----------------------|--------|---------------------------------------------------|
| `payment_key` *      | uuid4  | Unique payment identification key.                 |
| `request_control_key` *| uuid4 | Unique identification key for the client's request.|
| `payer_name` *       | string | Name of the effective payer.                       |
| `payer_document_number` *| string | Document number of the effective payer (CPF/CNPJ).|
| `source_account_key` *| uuid4 | Key of the debited account.                        |
| `transaction_key` *  | uuid4  | Payment transaction key.                           |
| `transaction_revert_key` | uuid4 | Payment reversal transaction key.                |
| `paid_amount` *      | number | Amount effectively paid.                          |
| `payment_date` *     | string | Scheduling date.                                  |
| `payment_type` *     | [enum](#enumerators-payment_type) | Payment type.     |
| `bank_slip`          | [object](#object-bank_slip)  | Boleto.                                           |
| `collection_slip`    | object  | Collection invoice.                               |
| `payment_schedule_status` * | [enum](#enumerators-payment_schedule_status) | Schedule status.    |

### Enumerators payment_type
| Enumerator          | Type   | Description               |
|---------------------|--------|---------------------------|
| `bank_slip`         | string | Boleto                    |
| `collection_slip`   | string | Collection invoice        |

### Enumerators payment_schedule_status
| Enumerator              | Description                                                                               |
|-------------------------|-------------------------------------------------------------------------------------------|
| `pending_2fa_approval`  | Schedule pending two-factor authentication (2FA)                                          |
| `scheduled`             | Payment successfully scheduled                                                            |
| `executed`              | The payment related to the schedule was successfully executed                             |
| `rejected`              | The payment related to the schedule was rejected                                          |
| `canceled`              | Schedule canceled                                                                         |
| `error`                 | Error during scheduling                                                                   |

### Object bank_slip
| Field                          | Type      | Description                                                                 |
|--------------------------------|-----------|-----------------------------------------------------------------------------|
| `barcode` *                    | string    | Barcode.                                                                    |
| `digitable_line` *             | string    | Digitable line.                                                             |
| `payer_name` *                 | string    | Payer's name.                                                               |
| `payer_document_number` *      | string    | Payer's document number (CPF/CNPJ).                                         |
| `beneficiary_name` *           | string    | Beneficiary's name.                                                         |
| `beneficiary_trading_name`     | string    | Beneficiary's trade name.                                                   |
| `beneficiary_document_number` * | string   | Beneficiary's document number (CPF/CNPJ).                                   |
| `beneficiary_bank_ispb` *      | string    | ISPB code of the beneficiary's bank.                                        |
| `guarantor_name`               | string    | Name of the guarantor.                                                      |
| `guarantor_document_number`    | string    | Guarantor's document number (CPF/CNPJ).                                     |
| `expiration_date` *            | string    | Due date.                                                                   |
| `max_payment_date` *           | string    | Maximum payment date.                                                       |
| `partial_payment_indicator` *  | [enum](#enumerators-partial_payment_indicator) | Partial payment indicator.              |
| `registered_payment_amount`    | string    | Total registered payment amount.                                            |
| `nominal_amount` *             | number    | Original amount.                                                            |
| `total_amount` *               | number    | Total amount.                                                               |
| `rebate_amount` *              | number    | Rebate amount.                                                              |
| `discount_amount` *            | number    | Discount amount.                                                            |
| `fine_amount` *                | number    | Fine amount.                                                                |
| `interest_amount` *            | number    | Interest amount.                                                            |

### Enumerators partial_payment_indicator
| Enumerator     | Description           |
|--------------- |-----------------------|
| `allowed`      | Allowed               |
| `not_allowed`  | Not allowed           |

### Object collection_slip
| Field                          | Type      | Description                                                                 |
|--------------------------------|-----------|-----------------------------------------------------------------------------|
| `barcode`                      | string    | Barcode.                                                                    |
| `digitable_line`               | string    | Digitable line.                                                             |
| `collection_name` *            | string    | Name of the agreement.                                                      |
| `collection_document_number`   | string    | Document number of the agreement (CPF/CNPJ).                                |
| `expiration_date` *            | string    | Due date.                                                                   |
| `total_amount` *               | number    | Total amount.                                                               |
### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Description em português",
    "code": "Código"
}
```

| HTTP Code | QI Code | Title | Description (eng) | Description (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 400         | BIP000001 | Bad Request | The barcode or digitable line must have 44 or 47 characters. | O código de barras ou linha digitável deve ter 44 ou 47 caracteres. |
| 400         | BIP000002 | Bad Request | The bill sent does not correspond to a bank slip. | A conta enviado não corresponde a um boleto bancário. |
| 400         | BIP000003 | Bad Request | The digitable line sent is invalid. | A linha digitável enviada é inválida. |
| 404         | BIP000004 | Not Found | The bank slip was not found. | O boleto não foi encontrado. |
| 400         | BIP000005 | Bad Request | It was not possible to consult the bank slip at this time. Please try again in a few minutes. | Não foi possível consultar o boleto neste momento. Por favor, tente novamente em alguns minutos. |
| 400         | BIP000006 | Bad Request | Bank slip already written off | Boleto já baixado |
| 400         | BIP000007 | Bad Request | Bank slip blocked for payment | Boleto bloqueado para pagamento |
| 400         | BIP000008 | Bad Request | Bank slip already paid | Boleto já pago |
| 400         | BIP000009 | Bad Request | Invalid bank slip. Please consult issuing bank | Boleto inválido. Favor consultar banco emissor |

---

# List schedules

URL: /en/documentation/baas/cobranca/agendamento/listar_agendamentos

This endpoint aims to provide details of all schedules made by the integration partner, including boletos and collection invoices.

:::info Boleto
This is the conventional boleto (with digitable lines not starting with the digit 8). It is registered with the Interbank Payment Clearinghouse (CIP/Núclea) and can be paid at financial institutions and payment institutions authorized to operate by the Central Bank.
:::

:::info Collection Invoice
This type of charge is issued by utility companies (water, electricity, telephone, and gas bills) and public entities (taxes). They are not registered with the Interbank Payment Clearinghouse (CIP/Núclea) and, therefore, do not return the same information as a boleto.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /payment_schedules
MÉTODO GET

### Request Path Params
| Field          | Type   | Description                               | Characters |
|----------------|--------|-------------------------------------------|------------|
| `account_key` *| uuidv4 | Unique account identification key.        | 36         |

### Request Query String Params
| Field                  | Type      | Description                                                        |
|------------------------|-----------|--------------------------------------------------------------------|
| `request_control_key`  | uuidv4    | Unique identification key for the client's request.                 |
| `payment_schedule_key` | uuidv4    | Unique schedule identification key.                                 |
| `payment_type`         | [enum](#enumerators-payment_type) | Payment type.                                             |
| `date_from`            | string    | Start date. Format "YYYY-MM-DD".                                    |
| `date_to`              | string    | End date. Format "YYYY-MM-DD".                                      |
| `page`                 | string    | Requested page number. 1 by default.                                |
| `page_size`            | string    | Requested page size in the query. 30 by default and maximum value.  |

### Enumerators payment_type
| Enumerator        | Type   | Description               |
|-------------------|--------|---------------------------|
| `bank_slip`       | string | Boleto                    |
| `collection_slip` | string | Collection invoice        |
## Response

### Success Response

STATUS 200

Response Body: Payment query

```json
{
  "data": [
    {
       "payment_key":"c4325104-d60b-44f3-aae4-49155564a2ea",
       "request_control_key":"b713b2f6-2f48-4d18-b0c9-7186e4edf189",
       "payer_name":"COOPERATIVA INDUSTRIAL MURILO",
       "payer_document_number":"00037025000160",
       "source_account_key":"6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
       "paid_amount":1050.1,
       "payment_date":"2024-04-03",
       "payment_type":"bank_slip",
       "bank_slip": {
            "bank_slip_key":"95080ffd-3ac5-48d7-b3fe-659e4aaba81a",
            "barcode":"00193967000009910000000003615574000000002417",
            "digitable_line":"00190000090361557400500000024174396700000991000",
            "payer_name":"COOPERATIVA TESTE",
            "payer_document_number":"00037025000160",
            "beneficiary_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
            "beneficiary_trading_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
            "beneficiary_document_number":"52069937000117",
            "beneficiary_bank_ispb":"00000000",
            "guarantor_name":null,
            "guarantor_document_number":null,
            "expiration_date":"2024-03-29",
            "max_payment_data": "2026-03-29",
            "partial_payment_indicator":"allowed",
            "registered_payment_amount":9029.0,
            "nominal_amount":9910.0,
            "total_amount":10129.1,
            "rebate_amount":0.0,
            "discount_amount":0.0,
            "fine_amount":0.0,
            "interest_amount":219.1
        },
       "collection_slip":null,
       "payment_schedule_status":"scheduled"
    },
    {
      "payment_key": "33860ad0-bcb0-47b7-bbe7-c7e3ec2fc61a",
      "request_control_key": "ae4508df-f2cb-4e28-9f04-a19b7f2758c9",
      "payer_name": "COOPERATIVA INDUSTRIAL MURILO",
      "payer_document_number": "62069937000118",
      "source_account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
      "paid_amount": 1389.21,
      "payment_date": "2024-04-30",
      "payment_type": "collection_slip",
      "bank_slip": null,
      "collection_slip": {
        "barcode": null,
        "digitable_line": "836200000138892100450006762142420244046000010192",
        "collection_name": "CIA ULTRAGAZ SA-COD",
        "collection_document_number": "00394460005887",
        "expiration_date": "2024-04-15",
        "total_amount": 1389.21
      },
      "payment_schedule_status": "scheduled"
    }
  ],
  "pagination": {
    "current_page": 1,
    "rows_per_page": 30
  }
}
```

### Response Body Params
| Field                | Type   | Description                                       |
|----------------------|--------|---------------------------------------------------|
| `payment_key` *      | uuid4  | Unique payment identification key.                |
| `request_control_key` *| uuid4 | Unique identification key for the client's request.|
| `payer_name` *       | string | Name of the effective payer.                       |
| `payer_document_number` *| string | Document number of the effective payer (CPF/CNPJ).|
| `source_account_key` *| uuid4 | Key of the debited account.                        |
| `paid_amount` *      | number | Amount effectively paid.                           |
| `payment_date` *     | string | Payment date.                                      |
| `payment_type` *     | [enum](#enumerators-payment_type-1) | Payment type.              |
| `bank_slip`          | [object](#object-bank_slip)  | Boleto.                                 |
| `collection_slip`    | [object](#object-collection_slip) | Collection invoice.         |
| `payment_schedule_status` * | [enum](#enumerators-payment_schedule_status) | Schedule status.          |

### Enumerators payment_type
| Enumerator          | Type   | Description                   |
|---------------------|--------|-------------------------------|
| `bank_slip`         | string | Boleto                        |
| `collection_slip`   | string | Collection invoice            |

### Enumerators payment_schedule_status
| Enumerator              | Description                                                            |
|-------------------------|------------------------------------------------------------------------|
| `pending_2fa_approval`  | Schedule pending two-factor authentication (2FA)                      |
| `scheduled`             | Payment successfully scheduled                                         |
| `executed`              | The payment related to the schedule was successfully executed          |
| `rejected`              | The payment related to the schedule was rejected                       |
| `canceled`              | Schedule canceled                                                     |
| `error`                 | Error during scheduling                                               |

### Object bank_slip
| Field                          | Type      | Description                                                                 |
|--------------------------------|-----------|-----------------------------------------------------------------------------|
| `barcode` *                    | string    | Barcode.                                                                    |
| `digitable_line` *             | string    | Digitable line.                                                             |
| `payer_name` *                 | string    | Payer's name.                                                               |
| `payer_document_number` *      | string    | Payer's document number (CPF/CNPJ).                                         |
| `beneficiary_name` *           | string    | Beneficiary's name.                                                         |
| `beneficiary_trading_name`     | string    | Beneficiary's trade name.                                                   |
| `beneficiary_document_number` * | string   | Beneficiary's document number (CPF/CNPJ).                                   |
| `beneficiary_bank_ispb` *      | string    | ISPB code of the beneficiary's bank.                                        |
| `guarantor_name`               | string    | Name of the guarantor.                                                      |
| `guarantor_document_number`    | string    | Guarantor's document number (CPF/CNPJ).                                     |
| `expiration_date` *            | string    | Due date.                                                                   |
| `max_payment_date` *           | string    | Maximum payment date.                                                       |
| `partial_payment_indicator` *  | [enum](#enumerators-partial_payment_indicator) | Partial payment indicator.              |
| `registered_payment_amount`    | string    | Total registered payment amount.                                            |
| `nominal_amount` *             | number    | Original amount.                                                            |
| `total_amount` *               | number    | Total amount.                                                               |
| `rebate_amount` *              | number    | Rebate amount.                                                              |
| `discount_amount` *            | number    | Discount amount.                                                            |
| `fine_amount` *                | number    | Fine amount.                                                                |
| `interest_amount` *            | number    | Interest amount.                                                            |

### Enumerators partial_payment_indicator
| Enumerator     | Type   | Description               |
|----------------|--------|---------------------------|
| `allowed`      | string | Allowed                   |
| `not_allowed`  | string | Not allowed               |

### Object collection_slip
| Field                          | Type      | Description                        |
|--------------------------------|-----------|------------------------------------|
| `barcode` *                    | string    | Barcode.                           |
| `digitable_line` *             | string    | Digitable line.                    |
| `collection_name` *            | string    | Name of the agreement.             |
| `collection_document_number` * | string    | Document number of the agreement (CPF/CNPJ). |
| `expiration_date` *            | string    | Due date.                          |
| `total_amount` *               | number    | Total amount.                      |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Description in portuguese",
    "code": "Código"
}
```

| HTTP Code| QI Code | Title | Description (eng) | Description (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 400         | BIP000026 | Bad Request | Invalid payment date format. The correct format is YYYY-MM-DD. | Formato de data de pagamento inválido. O formato correto é YYYY-MM-DD. |
| 400         | BIP000027 | Bad Request | Invalid integer value for page or size query string parameters. | Valor inválido para parâmetros de página ou tamanho de página. |
| 400         | BIP000047 | Bad Request | Invalid payment type. | Tipo de pagamento inválido. |

---

# Request batch scheduling of bank slip payments

URL: /en/documentation/baas/cobranca/agendamento/solicitar_agendamento_em_lote_de_boleto_bancario

This endpoint allows you to **schedule multiple bank slips in a single request**.

:::info Bank slip
This is the conventional bank slip (digitable lines not starting with the digit 8). It is registered with the Interbank Payment Clearinghouse (CIP/Núclea) and can be paid at financial institutions and payment institutions authorized to operate by the Central Bank.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/ ACCOUNT_KEY /payments_schedule/batch_bank_slip
METHOD POST

### Request Path Params

| Field               | Type    | Description                               | Characters |
|---------------------|---------|-------------------------------------------|------------|
| `account_key` *     | uuid4   | Unique account identification key.        | 36         |

Request Body: Batch scheduling of bank slips

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "bank_slip_payment_schedules": [
    {
      "request_control_key": "c7915a43-212f-5813-9adc-d3ed5d3d3bfd",
      "digitable_line": "00190000090361557400500000024174396700000991000",
      "payment_amount": 1156.8,
      "payment_date": "2026-04-10"
    },
    {
      "request_control_key": "d8a26b54-323a-4924-0aed-e4fe6e4e4c0e",
      "barcode": "00190000090361557400500000024174396700000991000",
      "payment_amount": 200.5,
      "payment_date": "2026-04-15"
    }
  ]
}
```

### Body Params

| Field               | Type          | Description                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Unique client request key (batch). |
| `bank_slip_payment_schedules` * | array     | List of bank slip schedules. **1000** items maximum per request. |

Each element of `bank_slip_payment_schedules` must contain:

| Field               | Type          | Description                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Unique client request key for that batch item. |
| `barcode`               | string    | Barcode. |
| `digitable_line`        | string    | Digitable line. |
| `payment_amount` *      | number    | Amount to pay. |
| `payment_date` *        | string    | Scheduled payment date for the item. |

:::danger Warning
For each item, `payment_amount` must follow the rules for the title returned in the bank slip inquiry. If partial payment is not allowed, the amount must match the updated total of the title.
:::

## Response

### Success Response

STATUS 202

Response Body: Batch schedule created

```json
{
  "batch_payment_schedule_key": "c4325104-d60b-44f3-aae4-49155564a2ea",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
  "total_amount": 1357.3,
  "batch_payment_schedule_status": "scheduled",
  "payment_type": "bank_slip"
}
```

### Response Body Params

| Field               | Type    | Description                         |
|---------------------|---------|-----------------------------------|
| `batch_payment_schedule_key` *       | uuid4 | Unique batch schedule key. |
| `request_control_key` *     | uuid4 | Unique client request key (batch). |
| `account_key` *             | uuid4 | Debited account key. |
| `total_amount` *            | number | Sum of item `payment_amount` values in the batch. |
| `batch_payment_schedule_status` *         | [enum](#enumeradores-batch_payment_schedule_status) | Batch schedule status after the request. |
| `payment_type` *            | [enum](#enumeradores-payment_type) | Payment type. |

### Enumeradores batch_payment_schedule_status

| Value    | Description     |
|---------------|---------------|
| `pending_2fa_approval` | Pending 2FA approval |
| `scheduled`   | Scheduled |
| `rejected`    | Rejected |
| `error`       | Scheduling error |

### Enumeradores payment_type

| Value    | Type      | Description     |
|---------------|-----------|---------------|
| `bank_slip`     | string    | Bank slip    |
| `collection_slip` | string  | Collection slip |

:::danger Warning
The `collection_slip` value does not apply to this bank slip batch scheduling endpoint; for this flow, `payment_type` must be `bank_slip`.
:::

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Title",
    "description": "Description in english",
    "translation": "Portuguese description",
    "code": "Code"
}
```

| HTTP code | QI code | Title | Description (eng) | Description (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 403         | BIP000010 | Forbidden | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404         | BIP000011 | Not Found | The source account key was not found. | A chave da conta de origem não foi encontrada. |
| 400         | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400         | BIP000024 | Bad Request | Request control key already exists. | Chave de controle da requisição já existe. |
| 400         | BIP000065 | Bad Request | Payment verification time window exceeded. | Janela de tempo de verificação de pagamento excedida. |

---

# Request batch scheduling of collection slip payments

URL: /en/documentation/baas/cobranca/agendamento/solicitar_agendamento_em_lote_de_fatura_de_recolhimento

This endpoint allows you to **schedule multiple collection slips (utility/tax) in a single request**.

:::info Collection slip
This charge type is issued by utility companies (water, electricity, phone, gas) and public agencies (taxes). They are not registered with the Interbank Payment Clearinghouse (CIP/Núclea), so they do not return the same information as a bank slip.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/ ACCOUNT_KEY /payments_schedule/batch_collection_slip
METHOD POST

### Request Path Params

| Field               | Type    | Description                               | Characters |
|---------------------|---------|-------------------------------------------|------------|
| `account_key` *     | uuid4   | Unique account identification key.        | 36         |

Request Body: Batch scheduling of collection slips

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "collection_slip_payment_schedules": [
    {
      "request_control_key": "c7915a43-212f-5813-9adc-d3ed5d3d3bfd",
      "digitable_line": "836200000138892100450006762142420244046000010192",
      "payment_amount": 1389.21,
      "payment_date": "2026-04-10"
    },
    {
      "request_control_key": "d8a26b54-323a-4924-0aed-e4fe6e4e4c0e",
      "barcode": "836200000138892100450006762142420244046000010192",
      "payment_amount": 550.10,
      "payment_date": "2026-04-15"
    }
  ]
}
```

### Body Params

| Field               | Type          | Description                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Unique client request key (batch). |
| `collection_slip_payment_schedules` * | array     | List of collection slip schedules. **1000** items maximum per request. |

Each element of `collection_slip_payment_schedules` must contain:

| Field               | Type          | Description                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Unique client request key for that batch item. |
| `barcode`               | string    | Barcode. |
| `digitable_line`        | string    | Digitable line. |
| `payment_amount` *      | number    | Amount to pay. |
| `payment_date` *        | string    | Scheduled payment date for the item. |

## Response

### Success Response

STATUS 202

Response Body: Batch schedule created

```json
{
  "batch_payment_schedule_key": "33860ad0-bcb0-47b7-bbe7-c7e3ec2fc61a",
  "request_control_key": "ae4508df-f2cb-4e28-9f04-a19b7f2758c9",
  "account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "total_amount": 1939.31,
  "batch_payment_schedule_status": "scheduled",
  "payment_type": "collection_slip"
}
```

### Response Body Params

| Field               | Type    | Description                         |
|---------------------|---------|-----------------------------------|
| `batch_payment_schedule_key` *       | uuid4 | Unique batch schedule key. |
| `request_control_key` *     | uuid4 | Unique client request key (batch). |
| `account_key` *             | uuid4 | Debited account key. |
| `total_amount` *            | number | Sum of item `payment_amount` values in the batch. |
| `batch_payment_schedule_status` *         | [enum](#enumeradores-batch_payment_schedule_status) | Batch schedule status after the request. |
| `payment_type` *            | [enum](#enumeradores-payment_type) | Payment type. |

### Enumeradores batch_payment_schedule_status

| Value    | Description     |
|---------------|---------------|
| `pending_2fa_approval` | Pending 2FA approval |
| `scheduled`   | Scheduled |
| `rejected`    | Rejected |
| `error`       | Scheduling error |

### Enumeradores payment_type

| Value    | Type      | Description     |
|---------------|-----------|---------------|
| `bank_slip`     | string    | Bank slip    |
| `collection_slip` | string  | Collection slip |

:::danger Warning
The `bank_slip` value does not apply to this collection slip batch scheduling endpoint; for this flow, `payment_type` must be `collection_slip`.
:::

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Title",
    "description": "Description in english",
    "translation": "Portuguese description",
    "code": "Code"
}
```

| HTTP code | QI code | Title | Description (eng) | Description (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 400         | BIP000032 | Bad Request | The bill sent does not correspond to a collection slip. | A conta enviada não corresponde a uma fatura de recolhimento. |
| 400         | BIP000033 | Bad Request | The barcode or digitable line of the collection slip must have 44 or 48 characters. | O código de barras ou linha digitável da fatura de recolhimento deve ter 44 ou 48 caracteres. |
| 403         | BIP000010 | Forbidden | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404         | BIP000011 | Not Found | The source account key was not found. | A chave da conta de origem não foi encontrada. |
| 400         | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400         | BIP000024 | Bad Request | Request control key already exists. | Chave de controle da requisição já existe. |
| 400         | BIP000065 | Bad Request | Payment verification time window exceeded. | Janela de tempo de verificação de pagamento excedida. |

---

# Confirmação de lote de pagamento de boleto bancário

URL: /en/documentation/baas/cobranca/confirmacao_de_lote_de_boleto_bancario

Este endpoint permite **confirmar ou rejeitar** um lote de pagamento de boletos bancários previamente criado com [Solicitar pagamento em lote de boleto bancário](./solicitar_pagamento_lote_de_boleto_bancario_com_confirmacao_de_lote.md). A confirmação é a etapa que define se o processamento do lote segue (aprovação) ou é encerrado sem débito dos títulos (rejeição).

:::info Boleto bancário
É o boleto bancário convencional (linhas digitáveis não iniciadas com dígito 8). Possui registro na Câmara Interbancária de Pagamento (CIP/Núclea) e pode ser pago em instituições financeiras e de pagamento autorizadas a funcionar pelo Banco Central.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/**ACCOUNT_KEY**/payment/batch_bank_slip/**PAYMENT_BATCH_KEY**/confirmation
MÉTODO PATCH

### Request Path Params

| Campo                 | Tipo  | Descrição                                                                                | Caracteres |
| --------------------- | ----- | ---------------------------------------------------------------------------------------- | ---------- |
| `account_key` *       | uuid4 | Chave única de identificação da conta.                                                   | 36         |
| `payment_batch_key` * | uuid4 | Chave única de identificação do lote (`batch_payment_key` retornado na criação do lote). | 36         |

### Request Body

**Request Body: Rejeição do lote**

```json
{
  "batch_status": "rejected"
}
```

**Request Body: Aprovação do lote**

```json
{
  "batch_status": "approved"
}
```

### Body Params

| Campo            | Tipo   | Descrição                                                                                                                                                     |
| ---------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `batch_status` * | string | Decisão sobre o lote. Valores: `approved` (seguir com o processamento) ou `rejected` (cancelar o lote). Ver [enumerador batch_confirmation_status](#enumerador-batch_confirmation_status). |

### Enumerador batch_confirmation_status

Valores aceitos no corpo da requisição para `batch_status`:

| Valor      | Descrição                                                     |
| ---------- | ------------------------------------------------------------- |
| `approved` | Aprovar o lote e continuar o fluxo de processamento.          |
| `rejected` | Rejeitar o lote; não há processamento assíncrono dos boletos. |

## Response

### Resposta: lote rejeitado

STATUS 200

Quando `batch_status` no corpo da requisição é `rejected`, a API responde com **200**. O lote fica encerrado como rejeitado; não há fila assíncrona de pagamento dos boletos.

**Response Body: Lote rejeitado**

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
  "total_amount": 1357.3,
  "batch_status": "rejected",
  "payment_type": "bank_slip"
}
```

### Resposta: lote aprovado — processamento assíncrono

STATUS 202

Quando `batch_status` no corpo é `approved`, a API responde com **202** e o lote segue para **processamento assíncrono** dos boletos. O corpo retorna `batch_status` como `approved`.

**Response Body: Lote aprovado para processamento assíncrono**

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
  "total_amount": 1357.3,
  "batch_status": "approved",
  "payment_type": "bank_slip"
}
```

### Response Body Params

| Campo                   | Tipo   | Descrição                                                                                                                                                                                                                                                                     |
| ----------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `batch_payment_key` *   | uuid4  | Chave única de identificação do pagamento em lote.                                                                                                                                                                                                                            |
| `request_control_key` * | uuid4  | Chave única de identificação da requisição do cliente (lote).                                                                                                                                                                                                                 |
| `account_key` *         | uuid4  | Chave da conta debitada.                                                                                                                                                                                                                                                      |
| `total_amount` *        | number | Soma dos valores dos itens do lote.                                                                                                                                                                                                                                           |
| `batch_status` *        | string | Status do lote após esta chamada (`rejected` ou `approved` para o fluxo descrito nesta página). Alinhado ao ciclo de vida em [Solicitar pagamento em lote de boleto bancário — batch_payment_status](./solicitar_pagamento_lote_de_boleto_bancario_com_confirmacao_de_lote.md#enumeradores-batch_payment_status). |
| `payment_type` *        | string | Tipo do pagamento; para este fluxo, espera-se `bank_slip`.                                                                                                                                                                                                                    |

### Error Response

STATUS 4XX

**Response Body**

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Descrição em português",
    "code": "Código"
}
```

| Código HTTP | Código QI | Título      | Descrição (eng)                               | Descrição (pt-br)                                     |
| ----------- | --------- | ----------- | --------------------------------------------- | ----------------------------------------------------- |
| 400         | BIP000013 | Bad Request | The source account is closed.                 | A conta de origem está fechada.                       |
| 400         | BIP000050 | Bad Request | Requester configuration does not exist        | Configuração do requester não existe.                 |
| 404         | BIP000083 | Not Found   | Batch payment not found by batch payment key. | Lote de pagamentos não encontrado pela chave do lote. |
| 400         | BIP000084 | Bad Request | Batch payment status is not pending.          | O status do lote de pagamentos não está pendente.     |

---

# Confirmação de lote de pagamento de fatura de recolhimento (convênio/tributo)

URL: /en/documentation/baas/cobranca/confirmacao_de_lote_de_fatura_de_recolhimento

Este endpoint permite **confirmar ou rejeitar** um lote de pagamento de faturas de recolhimento previamente criado com [Solicitar pagamento em lote de fatura de recolhimento (convênio/tributo)](./solicitar_pagamento_lote_de_fatura_de_recolhimento_com_confirmacao_de_lote.md). A confirmação é a etapa que define se o processamento do lote segue (aprovação) ou é encerrado sem débito dos títulos (rejeição).

:::info Fatura de recolhimento
Esse tipo de cobrança é emitido por concessionárias de serviços (conta de água, luz, telefone e gás) e órgãos públicos (tributos). Eles não são registrados na Câmara Interbancária de Pagamento (CIP/Núclea), por isso, não retornam as mesmas informações que um boleto bancário apresenta.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/**ACCOUNT_KEY**/payment/batch_collection_slip/**PAYMENT_BATCH_KEY**/confirmation
MÉTODO PATCH

### Request Path Params

| Campo                 | Tipo  | Descrição                                                                                | Caracteres |
| --------------------- | ----- | ---------------------------------------------------------------------------------------- | ---------- |
| `account_key` *       | uuid4 | Chave única de identificação da conta.                                                   | 36         |
| `payment_batch_key` * | uuid4 | Chave única de identificação do lote (`batch_payment_key` retornado na criação do lote). | 36         |

### Request Body

**Request Body: Rejeição do lote**

```json
{
  "batch_status": "rejected"
}
```

**Request Body: Aprovação do lote**

```json
{
  "batch_status": "approved"
}
```

### Body Params

| Campo            | Tipo   | Descrição                                                                                                                                                     |
| ---------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `batch_status` * | string | Decisão sobre o lote. Valores: `approved` (seguir com o processamento) ou `rejected` (cancelar o lote). Ver [enumerador batch_confirmation_status](#enumerador-batch_confirmation_status). |

### Enumerador batch_confirmation_status

Valores aceitos no corpo da requisição para `batch_status`:

| Valor      | Descrição                                                                     |
| ---------- | ----------------------------------------------------------------------------- |
| `approved` | Aprovar o lote e continuar o fluxo de processamento.                          |
| `rejected` | Rejeitar o lote; não há processamento assíncrono das faturas de recolhimento. |

## Response

### Resposta: lote rejeitado

STATUS 200

Quando `batch_status` no corpo da requisição é `rejected`, a API responde com **200**. O lote fica encerrado como rejeitado; não há fila assíncrona de pagamento das faturas de recolhimento.

**Response Body: Lote rejeitado**

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "total_amount": 2778.42,
  "batch_status": "rejected",
  "payment_type": "collection_slip"
}
```

### Resposta: lote aprovado — processamento assíncrono

STATUS 202

Quando `batch_status` no corpo é `approved`, a API responde com **202** e o lote segue para **processamento assíncrono** das faturas de recolhimento. O corpo retorna `batch_status` como `approved`.

**Response Body: Lote aprovado para processamento assíncrono**

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "total_amount": 2778.42,
  "batch_status": "approved",
  "payment_type": "collection_slip"
}
```

### Response Body Params

| Campo                   | Tipo   | Descrição                                                                                                                                                                                                                                                                                    |
| ----------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `batch_payment_key` *   | uuid4  | Chave única de identificação do pagamento em lote.                                                                                                                                                                                                                                           |
| `request_control_key` * | uuid4  | Chave única de identificação da requisição do cliente (lote).                                                                                                                                                                                                                                |
| `account_key` *         | uuid4  | Chave da conta debitada.                                                                                                                                                                                                                                                                     |
| `total_amount` *        | number | Soma dos valores dos itens do lote.                                                                                                                                                                                                                                                          |
| `batch_status` *        | string | Status do lote após esta chamada (`rejected` ou `approved` para o fluxo descrito nesta página). Alinhado ao ciclo de vida em [Solicitar pagamento em lote de fatura de recolhimento — batch_payment_status](./solicitar_pagamento_lote_de_fatura_de_recolhimento_com_confirmacao_de_lote.md#enumeradores-batch_payment_status). |
| `payment_type` *        | string | Tipo do pagamento; para este fluxo, espera-se `collection_slip`.                                                                                                                                                                                                                             |

### Error Response

STATUS 4XX

**Response Body**

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Descrição em português",
    "code": "Código"
}
```

| Código HTTP | Código QI | Título      | Descrição (eng)                               | Descrição (pt-br)                                     |
| ----------- | --------- | ----------- | --------------------------------------------- | ----------------------------------------------------- |
| 400         | BIP000013 | Bad Request | The source account is closed.                 | A conta de origem está fechada.                       |
| 400         | BIP000050 | Bad Request | Requester configuration does not exist        | Configuração do requester não existe.                 |
| 404         | BIP000083 | Not Found   | Batch payment not found by batch payment key. | Lote de pagamentos não encontrado pela chave do lote. |
| 400         | BIP000084 | Bad Request | Batch payment status is not pending.          | O status do lote de pagamentos não está pendente.     |

---

# Consult boleto

URL: /en/documentation/baas/cobranca/consultar_boleto_bancario

This endpoint is used to query information about a boleto.
:::info Boleto
This is the conventional boleto (with digitable lines not starting with the digit 8). It is registered with the Interbank Payment Clearinghouse (CIP/Núclea) and can be paid at financial institutions and payment institutions authorized to operate by the Central Bank.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/bank_slip/ DIGITABLE_LINE or BARCODE
MÉTODO GET

### Request Path Params

| Field | Type | Description | Characters |
|---------------------|---------|-----------------------------------|------------|
| `digitable_line` | string | Digitable line to be queried. | 47 |
| `barcode` | string | Barcode to be queried. | 44 |

## Response

### Success Response

STATUS 200

Response Body: Boleto available for payment

```json
{
   "barcode":"00193967000009910000000003615574000000002417",
   "digitable_line":"00190000090361557400500000024174396700000991000",
   "payer_name":"COOPERATIVA AGRO.INDUSTRIAL TEST",
   "payer_document_number":"21063663000125",
   "beneficiary_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA.",
   "beneficiary_trading_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
   "beneficiary_document_number":"30639204000138",
   "beneficiary_bank_ispb":"00000000",
   "guarantor_name":null,
   "guarantor_document_number":null,
   "expiration_date":"2024-03-29",
   "max_payment_data": "2026-03-29",
   "partial_payment_indicator":"not_allowed",
   "registered_payment_amount":null,
   "nominal_amount":9910.0,
   "total_amount":10129.1,
   "rebate_amount":0.0,
   "discount_amount":0.0,
   "fine_amount":0.0,
   "interest_amount":219.1
}
```

### Response Body Params
| Field | Type | Description |
|---------------------|---------|-----------------------------------|
| `barcode` * | string | Barcode. |
| `digitable_line` * | string | Digitable line. |
| `payer_name` * | string | Payer's name.|
| `payer_document_number` * | string | Payer's document number (CPF/CNPJ). |
| `beneficiary_name` * | string | Beneficiary's name. |
| `beneficiary_trading_name` | string | Beneficiary's trade name. |
| `beneficiary_document_number` * | string | Beneficiary's document number (CPF/CNPJ). |
| `beneficiary_bank_ispb` * | string | ISPB code of the beneficiary's bank. |
| `guarantor_name` | string | Name of the guarantor. |
| `guarantor_document_number` | string | Guarantor's document number (CPF/CNPJ). |
| `expiration_date` * | string | Due date. |
| `max_payment_date` * | string | Maximum payment date. |
| `partial_payment_indicator` * | [enum](#enumerators-partial_payment_indicator) | Partial payment indicator |
| `registered_payment_amount` | string | Total registered payment amount. |
| `nominal_amount` * | number | Original amount. |
| `total_amount` * | number | Total amount. |
| `rebate_amount` * | number | Rebate amount. |
| `discount_amount` * | number | Discount amount. |
| `fine_amount` * | number | Fine amount. |
| `interest_amount` * | number | Interest amount. |
### Enumerators partial_payment_indicator
| Enumerator | Type | Description |
|---------------|-----------|---------------|
| `allowed` | string | Allowed |
| `not_allowed` | string | Not allowed |
### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Description in portuguese",
    "code": "Código"
}
```
| HTTP Code | QI Code | Title | Description (eng) | Description (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 400 | BIP000001 | Bad Request | The barcode or digitable line must have 44 or 47 characters. | O código de barras ou linha digitável deve ter 44 ou 47 caracteres. |
| 400 | BIP000002 | Bad Request | The bill sent does not correspond to a bank slip. | A conta enviado não corresponde a um boleto bancário. |
| 400 | BIP000003 | Bad Request | The digitable line sent is invalid. | A linha digitável enviada é inválida. |
| 404 | BIP000004 | Not Found | The boleto was not found. | O boleto não foi encontrado. |
| 400 | BIP000005 | Bad Request | It was not possible to consult the boleto at this time. Please try again in a few minutes. | Não foi possível consultar o boleto neste momento. Por favor, tente novamente em alguns minutos. |
| 400 | BIP000006 | Bad Request | Boleto already written off | Boleto já baixado |
| 400 | BIP000007 | Bad Request | Boleto blocked for payment | Boleto bloqueado para pagamento |
| 400 | BIP000008 | Bad Request | Boleto already paid | Boleto já pago |
| 400 | BIP000009 | Bad Request | Invalid boleto. Please consult issuing bank | Boleto inválido. Favor consultar banco emissor |
## Sandbox Environment
In our sandbox environment, we provide mocked digitable lines for simulating successful payments and testing error scenarios.
### Success Scenarios
| Digitable Line |
|---|
| 00190000090361557400500000024174396700000991000 |
| 00190000090282802601919212747174596760001294161 |
| 23793390014000000455277000249001596900000103995 |
| 75691434020137513680900001040013196770002417240 |
| 21390001171200000570700168167484796770000148206 |
### Error Scenarios
| Digitable Line | Error Code |
|---|---|
| 34191090083273252027893634770007296690012513600 | BIP000007 |
| 07090010287045349010776686070590896770001160123 | BIP000007 |
| 42297048060005815702500130494123896770000239491 | BIP000006 |
| 74891123702849020818918378871083196690000050000 | BIP000009 |
| 23792374119000209350986000372408496610000122810 | BIP000008 |

---

# Consult collection invoice (agreement/tribute)

URL: /en/documentation/baas/cobranca/consultar_fatura_de_recolhimento

This endpoint is used to query information about a collection invoice.
:::info Collection Invoice
This type of charge is issued by utility companies (water, electricity, telephone, and gas bills) and public entities (taxes). They are not registered with the Interbank Payment Clearinghouse (CIP/Núclea) and, therefore, do not return the same information as a boleto.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/collection_slip/ DIGITABLE_LINE or BARCODE
MÉTODO GET

### Request Path Params

| Field | Type | Description | Characters |
|---------------------|---------|-----------------------------------|------------|
| `digitable_line` | string | Digitable line to be queried. | 48 |
| `barcode` | string | Barcode to be queried. | 44 |

## Response

### Success Response

STATUS 200

Response Body: Collection invoice available for payment

```json
{
  "barcode": null,
  "digitable_line": "836200000138892100450006762142420244046000010192",
  "collection_name": "CIA ULTRAGAZ SA-COD",
  "expiration_date": "2024-04-15",
  "total_amount": 1389.21
}
```

### Response Body Params

| Field | Type | Description |
|---------------------|---------|-----------------------------------|
| `barcode` | string | Barcode. |
| `digitable_line` | string | Digitable line. |
| `collection_name` * | string | Name of the agreement. |
| `expiration_date` * | string | Due date. |
| `total_amount` * | number | Total amount. |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Description in portuguese",
    "code": "Código"
}
```
| HTTP Code | QI Code | Title | Description (eng) | Description (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 400 | BIP000032 | Bad Request | The bill sent does not correspond to a collection slip. | A conta enviada não corresponde a uma fatura de recolhimento. |
| 400 | BIP000033 | Bad Request | The barcode or digitable line of the collection slip must have 44 or 48 characters. | O código de barras ou linha digitável da fatura de recolhimento deve ter 44 ou 48 caracteres. |
| 400 | BIP000034 | Bad Request | Collection slip already paid. | Fatura de recolhimento já paga. |
| 400 | BIP000035 | Bad Request | Covenant slip invalid barcode. | Código de barras da fatura de recolhimento inválido. |
| 400 | BIP000036 | Bad Request | Covenant slip overdue. | Fatura de recolhimento vencida. |
| 400 | BIP000037 | Bad Request | Error in collection slip consultation. | Erro na consulta da fatura de recolhimento. |
| 400 | BIP000038 | Bad Request | Outside of covenant payment hours. | Fora do horário de pagamento do convênio. |
| 400 | BIP000039 | Bad Request | Collection slip not accepted. | Fatura de recolhimento não aceita. |
| 400 | BIP000040 | Bad Request | Minimum advance not reached. | Mínimo de dias de adiantamento não atingido. |
| 400 | BIP000041 | Bad Request | Max payment amount exceeded. | Valor máximo de pagamento excedido. |
## Sandbox Environment
In our sandbox environment, we provide mocked digitable lines for simulating successful payments and testing error scenarios.
### Success Scenarios
| Digitable Line |
|---|
| 828300000007411100972013905080001546763201900028 |
| 838000000009235700481007241345219112001474229880 |
| 848000000006308600802021201071261517689002201070 |
| 858200000015000000643025703477209504800448091020 |
### Error Scenarios
| Digitable Line | Error Code |
|---|---|
| 858500000037350000643217212883260006147448091022 | BIP000035 |

---

# Consultar lote de pagamento

URL: /en/documentation/baas/cobranca/consultar_lote_de_pagamento

Este endpoint retorna o resumo do lote e a lista paginada dos pagamentos que o compõem (boletos bancários ou faturas de recolhimento).

Para localizar `batch_payment_key`, utilize [Listar lotes de pagamento](./listar_lotes_de_pagamento.md).

:::info Boleto bancário
É o boleto bancário convencional (linhas digitáveis não iniciadas com dígito 8). Possui registro na Câmara Interbancária de Pagamento (CIP/Núclea) e pode ser pago em instituições financeiras e de pagamento autorizadas a funcionar pelo Banco Central.
:::

:::info Fatura de recolhimento
Esse tipo de cobrança é emitido por concessionárias de serviços (conta de água, luz, telefone e gás) e órgão públicos (tributos). Eles não são registrados na Câmara Interbancária de Pagamento (CIP/Núclea), por isso, não retornam as mesmas informações que um Boleto bancário apresenta.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/**ACCOUNT_KEY**/batch/**BATCH_PAYMENT_KEY**
MÉTODO GET

### Request Path Params

| Campo                 | Tipo  | Descrição                                          | Caracteres |
| --------------------- | ----- | -------------------------------------------------- | ---------- |
| `account_key` *       | uuid4 | Chave única de identificação da conta.             | 36         |
| `batch_payment_key` * | uuid4 | Chave única de identificação do pagamento em lote. | 36         |

### Request Query String Params

| Campo       | Tipo   | Descrição                                                                     |
| ----------- | ------ | ----------------------------------------------------------------------------- |
| `page`      | string | Número da página dos itens em `payments.data`. 1 por padrão.                  |
| `page_size` | string | Tamanho da página dos itens em `payments.data`. 30 por padrão e valor máximo. |

## Response

### Success Response

STATUS

 200

**Response Body: Detalhes do lote de pagamento**

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "total_paid": 10,
  "total_pending": 0,
  "total_error": 0,
  "total_amount": 1357.3,
  "payments": {
    "pagination": {
      "current_page": 1,
      "rows_per_page": 30
    },
    "data": [
      {
        "payment_key": "c4325104-d60b-44f3-aae4-49155564a2ea",
        "payer_name": "COOPERATIVA INDUSTRIAL MURILO",
        "payer_document_number": "00037025000160",
        "source_account_key": "6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
        "transaction_key": "4e80070a-a0bb-4be2-8178-55fbd73a3704",
        "transaction_revert_key": null,
        "paid_amount": 1050.1,
        "payment_date": "2024-04-03",
        "payment_type": "bank_slip",
        "bank_slip": {
          "bank_slip_key": "95080ffd-3ac5-48d7-b3fe-659e4aaba81a",
          "barcode": "00193967000009910000000003615574000000002417",
          "digitable_line": "00190000090361557400500000024174396700000991000",
          "payer_name": "COOPERATIVA TESTE",
          "payer_document_number": "00037025000160",
          "beneficiary_name": "TESTE EQUIPAMENTOS E SERVICOS LTDA",
          "beneficiary_trading_name": "TESTE EQUIPAMENTOS E SERVICOS LTDA",
          "beneficiary_document_number": "52069937000117",
          "beneficiary_bank_ispb": "00000000",
          "guarantor_name": null,
          "guarantor_document_number": null,
          "expiration_date": "2024-03-29",
          "max_payment_date": "2026-03-29",
          "partial_payment_indicator": "allowed",
          "registered_payment_amount": 9029.0,
          "nominal_amount": 9910.0,
          "total_amount": 10129.1,
          "rebate_amount": 0.0,
          "discount_amount": 0.0,
          "fine_amount": 0.0,
          "interest_amount": 219.1
        },
        "collection_slip": null,
        "payment_status": "executed",
        "error_reason": null
      }
    ]
  }
}
```

### Response Body Params

| Campo                   | Tipo                       | Descrição                                                     |
| ----------------------- | -------------------------- | ------------------------------------------------------------- |
| `request_control_key` * | uuid4                      | Chave única de identificação da requisição do cliente (lote). |
| `total_paid` *          | int                        | Quantidade de itens do lote pagos com sucesso.                |
| `total_pending` *       | int                        | Quantidade de itens ainda pendentes no lote.                  |
| `total_error` *         | int                        | Quantidade de itens com erro no lote.                         |
| `total_amount` *        | number                     | Valor total do lote.                                          |
| `payments` *            | [object](#objeto-payments) | Lista paginada dos pagamentos do lote.                        |

### Objeto payments

| Campo          | Tipo                         | Descrição                                                                                                                                     |
| -------------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `pagination` * | [object](#objeto-pagination) | Paginação da lista de pagamentos do lote.                                                                                                     |
| `data` *       | array                        | Itens do lote (estrutura equivalente a cada elemento de `data` em [Listar pagamentos](./listar_pagamentos.md), com campos adicionais abaixo). |

Cada elemento de `payments.data` contém:

| Campo                     | Tipo                                 | Descrição                                                                      |
| ------------------------- | ------------------------------------ | ------------------------------------------------------------------------------ |
| `payment_key` *           | uuid4                                | Chave única de identificação do pagamento.                                     |
| `payer_name` *            | string                               | Nome do pagador efetivo.                                                       |
| `payer_document_number` * | string                               | Número de documento do pagador efetivo (CPF/CNPJ).                             |
| `source_account_key` *    | uuid4                                | Chave da conta debitada.                                                       |
| `transaction_key` *       | uuid4                                | Chave da transação do pagamento.                                               |
| `transaction_revert_key`  | uuid4                                | Chave da transação de reversão do pagamento.                                   |
| `paid_amount` *           | number                               | Valor pago efetivamente.                                                       |
| `payment_date` *          | string                               | Data do pagamento.                                                             |
| `payment_type` *          | [enum](#enumeradores-payment_type)   | Tipo do pagamento.                                                             |
| `bank_slip`               | [object](#objeto-bank_slip)          | Boleto bancário. Pode ser `null` quando `payment_type` for `collection_slip`.  |
| `collection_slip`         | [object](#objeto-collection_slip)    | Fatura de recolhimento. Pode ser `null` quando `payment_type` for `bank_slip`. |
| `payment_status` *        | [enum](#enumeradores-payment_status) | Status do pagamento.                                                           |
| `error_reason`            | string                               | Motivo do erro, quando aplicável; caso contrário `null`.                       |

### Objeto pagination

| Campo             | Tipo | Descrição                           |
| ----------------- | ---- | ----------------------------------- |
| `current_page` *  | int  | Página atual retornada.             |
| `rows_per_page` * | int  | Quantidade de registros por página. |

### Enumeradores payment_type

| Enumerador        | Descrição              |
| ----------------- | ---------------------- |
| `bank_slip`       | Boleto bancário        |
| `collection_slip` | Fatura de recolhimento |

### Enumeradores payment_status

| Enumerador          | Descrição            |
| ------------------- | -------------------- |
| `pending_execution` | Pendente de execução |
| `executed`          | Executado            |
| `reverted`          | Revertido            |
| `rejected`          | Rejeitado            |
| `error`             | Erro                 |

### Objeto bank_slip

| Campo                           | Tipo                                            | Descrição                                           |
| ------------------------------- | ----------------------------------------------- | --------------------------------------------------- |
| `bank_slip_key` *               | uuid4                                           | Chave única de identificação do boleto bancário.    |
| `barcode` *                     | string                                          | Código de barras.                                   |
| `digitable_line` *              | string                                          | Linha digitável.                                    |
| `payer_name` *                  | string                                          | Nome do pagador.                                    |
| `payer_document_number` *       | string                                          | Número de documento do pagador (CPF/CNPJ).          |
| `beneficiary_name` *            | string                                          | Nome do beneficiário.                               |
| `beneficiary_trading_name`      | string                                          | Nome fantasia do beneficiário.                      |
| `beneficiary_document_number` * | string                                          | Número de documento do beneficiário (CPF/CNPJ).     |
| `beneficiary_bank_ispb` *       | string                                          | Código ispb do banco do beneficiário.               |
| `guarantor_name`                | string                                          | Nome do sacador avalista.                           |
| `guarantor_document_number`     | string                                          | Número de documento do sacador avalista (CPF/CNPJ). |
| `expiration_date` *             | string                                          | Data de vencimento.                                 |
| `max_payment_date` *            | string                                          | Data máxima de pagamento.                           |
| `partial_payment_indicator` *   | [enum](#enumeradores-partial_payment_indicator) | Indicador de pagamento parcial.                     |
| `registered_payment_amount`     | number                                          | Valor total de pagamento registrado.                |
| `nominal_amount` *              | number                                          | Valor original.                                     |
| `total_amount` *                | number                                          | Valor total.                                        |
| `rebate_amount` *               | number                                          | Valor do abatimento.                                |
| `discount_amount` *             | number                                          | Valor do desconto.                                  |
| `fine_amount` *                 | number                                          | Valor da multa.                                     |
| `interest_amount` *             | number                                          | Valor dos juros.                                    |

### Enumeradores partial_payment_indicator

| Enumerador    | Descrição     |
| ------------- | ------------- |
| `allowed`     | Permitido     |
| `not_allowed` | Não permitido |

### Objeto collection_slip

| Campo                          | Tipo   | Descrição                                   |
| ------------------------------ | ------ | ------------------------------------------- |
| `barcode` *                    | string | Código de barras.                           |
| `digitable_line` *             | string | Linha digitável.                            |
| `collection_name` *            | string | Nome do pagador.                            |
| `collection_document_number` * | string | Número de documento do convênio (CPF/CNPJ). |
| `expiration_date` *            | string | Data de vencimento.                         |
| `total_amount` *               | number | Valor total.                                |

### Error Response

STATUS

 4XX

**Response Body**

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Descrição em português",
    "code": "Código"
}
```

| Código HTTP | Código QI | Título      | Descrição (eng)                                                 | Descrição (pt-br)                                              |
| ----------- | --------- | ----------- | --------------------------------------------------------------- | -------------------------------------------------------------- |
| 400         | BIP000027 | Bad Request | Invalid integer value for page or size query string parameters. | Valor inválido para parâmetros de página ou tamanho de página. |

---

# Listar lotes de pagamento

URL: /en/documentation/baas/cobranca/listar_lotes_de_pagamento

Este endpoint retorna os lotes de pagamento de boletos bancários e faturas de recolhimento associados à conta, com suporte a filtros e paginação.

:::info Boleto bancário
É o boleto bancário convencional (linhas digitáveis não iniciadas com dígito 8). Possui registro na Câmara Interbancária de Pagamento (CIP/Núclea) e pode ser pago em instituições financeiras e de pagamento autorizadas a funcionar pelo Banco Central.
:::

:::info Fatura de recolhimento
Esse tipo de cobrança é emitido por concessionárias de serviços (conta de água, luz, telefone e gás) e órgão públicos (tributos). Eles não são registrados na Câmara Interbancária de Pagamento (CIP/Núclea), por isso, não retornam as mesmas informações que um Boleto bancário apresenta.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/ ACCOUNT_KEY /batches
MÉTODO GET

### Request Path Params

| Campo               | Tipo    | Descrição                               | Caracteres |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` *     | uuid4   | Chave única de identificação da conta.  | 36         |

### Request Query String Params

| Campo               | Tipo        | Descrição                         |
|---------------------|-------------|-----------------------------------|
| `request_control_key` | uuid4     | Chave única de identificação da requisição do cliente (lote). |
| `batch_payment_key`   | uuid4     | Chave única de identificação do pagamento em lote. |
| `payment_type`        | [enum](#enumeradores-payment_type)      | Tipo do pagamento do lote. |
| `batch_payment_status` | [enum](#enumeradores-batch_payment_status) | Status do lote. |
| `date_from`           | string    | Data inicial. Formato "YYYY-MM-DD". |
| `date_to`             | string    | Data final. Formato "YYYY-MM-DD". |
| `page`                | string    | Número da página requisitada. 1 por padrão. |
| `page_size`           | string    | Tamanho da página requisitada na consulta. 30 por padrão e valor máximo. |

### Enumeradores payment_type

| Enumerador    | Tipo      | Descrição     |
|---------------|-----------|---------------|
| `bank_slip`     | string    | Boleto bancário    |
| `collection_slip` | string  | Fatura de recolhimento |

### Enumeradores batch_payment_status

| Enumerador    | Descrição     |
|---------------|---------------|
| `pending`     | Pendente de processamento |
| `pending_2fa_approval` | Pendente de aprovação 2FA |
| `rejected`    | Rejeitado |
| `approved`    | Aprovado |
| `processed`   | Processado |

## Response

### Success Response

STATUS 200

Response Body: Listagem de lotes de pagamento

```json
{
  "pagination": {
    "current_page": 1,
    "rows_per_page": 30
  },
  "data": [
    {
      "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "batch_status": "processed",
      "payment_type": "bank_slip",
      "total_paid": 10,
      "total_pending": 0,
      "total_error": 0,
      "total_amount": 1357.3
    }
  ]
}
```

### Response Body Params

| Campo               | Tipo    | Descrição                         |
|---------------------|---------|-----------------------------------|
| `pagination` *      | [object](#objeto-pagination) | Informações de paginação da consulta. |
| `data` *            | array   | Lista de lotes encontrados. |

Cada elemento de `data` contém:

| Campo               | Tipo    | Descrição                         |
|---------------------|---------|-----------------------------------|
| `batch_payment_key` * | uuid4 | Chave única de identificação do pagamento em lote. |
| `request_control_key` * | uuid4 | Chave única de identificação da requisição do cliente (lote). |
| `batch_status` *    | [enum](#enumeradores-batch_payment_status-1) | Status atual do lote. |
| `payment_type` *    | [enum](#enumeradores-payment_type-1) | Tipo do pagamento do lote. |
| `total_paid` *      | int     | Quantidade de itens do lote pagos com sucesso. |
| `total_pending` *   | int     | Quantidade de itens ainda pendentes no lote. |
| `total_error` *     | int     | Quantidade de itens com erro no lote. |
| `total_amount` *    | number  | Valor total do lote. |

### Objeto pagination

| Campo               | Tipo    | Descrição                         |
|---------------------|---------|-----------------------------------|
| `current_page` *    | int     | Página atual retornada. |
| `rows_per_page` *   | int     | Quantidade de registros por página. |

### Enumeradores payment_type

| Enumerador    | Descrição     |
|---------------|---------------|
| `bank_slip`     | Boleto bancário    |
| `collection_slip` | Fatura de recolhimento |

### Enumeradores batch_payment_status

| Enumerador    | Descrição     |
|---------------|---------------|
| `pending`     | Pendente de processamento |
| `pending_2fa_approval` | Pendente de aprovação 2FA |
| `rejected`    | Rejeitado |
| `approved`    | Aprovado |
| `processed`   | Processado |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Descrição em português",
    "code": "Código"
}
```

| Código HTTP | Código QI | Título | Descrição (eng) | Descrição (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 400         | BIP000026 | Bad Request | Invalid payment date format. The correct format is YYYY-MM-DD. | Formato de data de pagamento inválido. O formato correto é YYYY-MM-DD. |
| 400         | BIP000027 | Bad Request | Invalid integer value for page or size query string parameters. | Valor inválido para parâmetros de página ou tamanho de página. |
| 400         | BIP000047 | Bad Request | Invalid payment type. | Tipo de pagamento inválido. |

---

# List payments

URL: /en/documentation/baas/cobranca/listar_pagamentos

This endpoint aims to provide details of all charges paid by the client, including boletos and collection invoices.
:::info Boleto
This is the conventional boleto (with digitable lines not starting with the digit 8). It is registered with the Interbank Payment Clearinghouse (CIP/Núclea) and can be paid at financial institutions and payment institutions authorized to operate by the Central Bank.
:::
:::info Collection Invoice
This type of charge is issued by utility companies (water, electricity, telephone, and gas bills) and public entities (taxes). They are not registered with the Interbank Payment Clearinghouse (CIP/Núclea) and, therefore, do not return the same information as a boleto.
:::
## Request

### Request Endpoint

ENDPOINT /account/ ACCOUNT_KEY /payments
MÉTODO GET

### Request Path Params

| Campo               | Tipo    | Descrição                               | Caracteres |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` *     | uuid4   | Chave única de identificação da conta.  | 36         |### Request Query String Params
| Field | Type | Description |
|---------------------|-------------|-----------------------------------|
| `request_control_key` | uuid4 | Unique identification key for the client's request. |
| `payment_key` | uuid4 | Unique payment identification key. |
| `payment_type` | [enum](#enumerators-payment_type) | Payment type. |
| `date_from` | string | Start date. Format "YYYY-MM-DD". |
| `date_to` | string | End date. Format "YYYY-MM-DD". |
| `page` | string | Requested page number. 1 by default. |
| `page_size` | string | Requested page size in the query. 30 by default and maximum value. |
### Enumerators payment_type
| Enumerator | Type | Description |
|---------------|-----------|---------------|
| `bank_slip` | string | Boleto |
| `collection_slip` | string | Collection invoice |

## Response

### Success Response

STATUS 200

Response Body: Payment query

```json
{
  "data": [
    {
        "payment_key":"c4325104-d60b-44f3-aae4-49155564a2ea",
        "request_control_key":"b713b2f6-2f48-4d18-b0c9-7186e4edf189",
        "payer_name":"COOPERATIVA INDUSTRIAL MURILO",
        "payer_document_number":"00037025000160",
        "source_account_key":"6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
        "transaction_key":"4e80070a-a0bb-4be2-8178-55fbd73a3704",
        "transaction_revert_key":null,
        "paid_amount":1050.1,
        "payment_date":"2024-04-03",
        "payment_type":"bank_slip",
        "bank_slip": {
                "bank_slip_key":"95080ffd-3ac5-48d7-b3fe-659e4aaba81a",
                "barcode":"00193967000009910000000003615574000000002417",
                "digitable_line":"00190000090361557400500000024174396700000991000",
                "payer_name":"COOPERATIVA TESTE",
                "payer_document_number":"00037025000160",
                "beneficiary_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
                "beneficiary_trading_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
                "beneficiary_document_number":"52069937000117",
                "beneficiary_bank_ispb":"00000000",
                "guarantor_name":null,
                "guarantor_document_number":null,
                "expiration_date":"2024-03-29",
                "max_payment_data": "2026-03-29",
                "partial_payment_indicator":"allowed",
                "registered_payment_amount":9029.0,
                "nominal_amount":9910.0,
                "total_amount":10129.1,
                "rebate_amount":0.0,
                "discount_amount":0.0,
                "fine_amount":0.0,
                "interest_amount":219.1
            },
        "collection_slip":null,
        "payment_status":"executed"
    }
  ],
  "pagination": {
    "current_page": 1,
    "rows_per_page": 30
  }
}
```

### Response Body Params
| Field | Type | Description |
|---------------------|---------|-----------------------------------|
| `payment_key` * | uuid4 | Unique payment identification key. |
| `request_control_key` * | uuid4 | Unique identification key for the client's request. |
| `payer_name` * | string | Name of the effective payer.|
| `payer_document_number` * | string | Document number of the effective payer (CPF/CNPJ). |
| `source_account_key` * | uuid4 | Key of the debited account. |
| `transaction_key` * | uuid4 | Payment transaction key. |
| `transaction_revert_key` | uuid4 | Payment reversal transaction key. |
| `paid_amount` * | number | Amount effectively paid. |
| `payment_date` * | string | Payment date. |
| `payment_type` * | [enum](#enumerators-payment_type-1) | Payment type. |
| `bank_slip` | [object](#object-bank_slip) | Boleto. |
| `collection_slip` | [object](#object-collection_slip) | Collection invoice. |
| `payment_status` * | [enum](#enumerators-payment_status) | Payment status. |
### Enumerators payment_type
| Enumerator | Description |
|---------------|---------------|
| `bank_slip` | Boleto |
| `collection_slip` | Collection invoice |
### Enumerators payment_status
| Enumerator | Description |
|---------------|---------------|
| `pending_execution` | Pending execution |
| `executed` | Executed |
| `reverted` | Reverted |
| `rejected` | Rejected |
| `error` | Error |
### Object bank_slip
| Field | Type | Description |
|-----------------------------------|---------|-----------------------------------|
| `barcode` * | string | Barcode. |
| `digitable_line` * | string | Digitable line. |
| `payer_name` * | string | Payer's name.|
| `payer_document_number` * | string | Payer's document number (CPF/CNPJ). |
| `beneficiary_name` * | string | Beneficiary's name. |
| `beneficiary_trading_name` | string | Beneficiary's trade name. |
| `beneficiary_document_number` * | string | Beneficiary's document number (CPF/CNPJ). |
| `beneficiary_bank_ispb` * | string | ISPB code of the beneficiary's bank. |
| `guarantor_name` | string | Name of the guarantor. |
| `guarantor_document_number` | string | Guarantor's document number (CPF/CNPJ). |
| `expiration_date` * | string | Due date. |
| `max_payment_date` * | string | Maximum payment date. |
| `partial_payment_indicator` * | [enum](#enumerators-partial_payment_indicator) | Partial payment indicator. |
| `registered_payment_amount` | string | Total registered payment amount. |
| `nominal_amount` * | number | Original amount. |
| `total_amount` * | number | Total amount. |
| `rebate_amount` * | number | Rebate amount. |
| `discount_amount` * | number | Discount amount. |
| `fine_amount` * | number | Fine amount. |
| `interest_amount` * | number | Interest amount. |
### Enumerators partial_payment_indicator
| Enumerator | Description |
|---------------|---------------|
| `allowed` | Allowed |
| `not_allowed` | Not allowed |
### Object collection_slip
| Field | Type | Description |
|-----------------------------------|---------|-----------------------------------|
| `barcode` * | string | Barcode. |
| `digitable_line` * | string | Digitable line. |
| `collection_name` * | string | Name of the agreement.|
| `collection_document_number` * | string | Document number of the agreement (CPF/CNPJ). |
| `expiration_date` * | string | Due date. |
| `total_amount` * | number | Total amount. |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Description in portuguese",
    "code": "Código"
}
```
| HTTP Code | QI Code | Title | Description (eng) | Description (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 400 | BIP000026 | Bad Request | Invalid payment date format. The correct format is YYYY-MM-DD. | Formato de data de pagamento inválido. O formato correto é YYYY-MM-DD. |
| 400 | BIP000027 | Bad Request | Invalid integer value for page or size query string parameters. | Valor inválido para parâmetros de página ou tamanho de página. |
| 400 | BIP000047 | Bad Request | Invalid payment type. | Tipo de pagamento inválido. |

---

# Make payment of Boleto

URL: /en/documentation/baas/cobranca/pagar_boleto_bancario

This endpoint allows the payment of bank slips (boletos). The payment should be made after a consultation, using the returned information to ensure the correct flow, avoiding failures during the payment process.
:::info Bank Slip
This is the conventional bank slip (with digitable lines not starting with the digit 8). It is registered with the Interbank Payment Clearinghouse (CIP/Núclea) and can be paid at financial institutions and payment institutions authorized to operate by the Central Bank.
:::

## Request

### Request Endpoint

ENDPOINT /account/ ACCOUNT_KEY /payment/bank_slip
MÉTODO POST

### Request Path Params

| Field | Type | Description | Characters |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` * | uuid4 | Unique account identification key. | 36 |

Request Body: Payment of boleto with digitable line

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "digitable_line": "00190000090361557400500000024174396700000991000",
  "payment_amount": 1156.8
}
```
Request Body: Payment of boleto with barcode

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "barcode": "00190000090361557400500000024174396700000991000",
  "payment_amount": 1156.8
}
```

### Body Params

| Field | Type | Description |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4 | Unique identification key for the client's request. |
| `barcode` | string | Barcode. |
| `digitable_line` | string | Digitable line. |
| `payment_amount` * | number | Amount to be paid. |
:::danger Warning
The `payment_amount` must always be equal to the `total_amount` returned in the bank slip query if partial payment is not allowed for the bank slip. For titles where partial payment is allowed, the client can choose the `payment_amount`, as long as its sum with the bank slip's `registered_payment_amount` does not exceed the `total_amount`.
:::

## Response

### Success Response

STATUS 201

Response Body: Payment executed

```json
{
   "payment_key":"c4325104-d60b-44f3-aae4-49155564a2ea",
   "request_control_key":"b713b2f6-2f48-4d18-b0c9-7186e4edf189",
   "payer_name":"COOPERATIVA INDUSTRIAL MURILO",
   "payer_document_number":"00037025000160",
   "source_account_key":"6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
   "transaction_key":"4e80070a-a0bb-4be2-8178-55fbd73a3704",
   "transaction_revert_key":null,
   "paid_amount":1050.1,
   "payment_date":"2024-04-03",
   "payment_type":"bank_slip",
   "bank_slip": {
        "bank_slip_key":"95080ffd-3ac5-48d7-b3fe-659e4aaba81a",
        "barcode":"00193967000009910000000003615574000000002417",
        "digitable_line":"00190000090361557400500000024174396700000991000",
        "payer_name":"COOPERATIVA TESTE",
        "payer_document_number":"00037025000160",
        "beneficiary_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_trading_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_document_number":"52069937000117",
        "beneficiary_bank_ispb":"00000000",
        "guarantor_name":null,
        "guarantor_document_number":null,
        "expiration_date":"2024-03-29",
        "max_payment_data": "2026-03-29",
        "partial_payment_indicator":"allowed",
        "registered_payment_amount":9029.0,
        "nominal_amount":9910.0,
        "total_amount":10129.1,
        "rebate_amount":0.0,
        "discount_amount":0.0,
        "fine_amount":0.0,
        "interest_amount":219.1
    },
   "collection_slip":null,
   "payment_status":"executed"
}
```

STATUS 202

Response Body: Payment pending execution

```json
{
   "payment_key":"c4325104-d60b-44f3-aae4-49155564a2ea",
   "request_control_key":"b713b2f6-2f48-4d18-b0c9-7186e4edf189",
   "payer_name":"COOPERATIVA INDUSTRIAL MURILO",
   "payer_document_number":"00037025000160",
   "source_account_key":"6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
   "transaction_key":"4e80070a-a0bb-4be2-8178-55fbd73a3704",
   "transaction_revert_key":null,
   "paid_amount":1050.1,
   "payment_date":"2024-04-03",
   "payment_type":"bank_slip",
   "bank_slip": {
        "bank_slip_key":"95080ffd-3ac5-48d7-b3fe-659e4aaba81a",
        "barcode":"00193967000009910000000003615574000000002417",
        "digitable_line":"00190000090361557400500000024174396700000991000",
        "payer_name":"COOPERATIVA TESTE",
        "payer_document_number":"00037025000160",
        "beneficiary_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_trading_name":"TESTE EQUIPAMENTOS E SERVICOS LTDA",
        "beneficiary_document_number":"52069937000117",
        "beneficiary_bank_ispb":"00000000",
        "guarantor_name":null,
        "guarantor_document_number":null,
        "expiration_date":"2024-03-29",
        "max_payment_data": "2026-03-29",
        "partial_payment_indicator":"allowed",
        "registered_payment_amount":9029.0,
        "nominal_amount":9910.0,
        "total_amount":10129.1,
        "rebate_amount":0.0,
        "discount_amount":0.0,
        "fine_amount":0.0,
        "interest_amount":219.1
    },
   "collection_slip":null,
   "payment_status": "pending_execution"
}
```
:::info Information
If **HTTP Status 202** is returned with the field `payment_status` having the value **pending_execution**, the payment should not be retried.
This payment will be processed asynchronously. It is necessary to check the transfer status through the payment query, or wait for the pending payment webhook described on the [webhooks page](/documentation/baas_v2/cobranca/webhooks).
:::
### Response Body Params
| Field | Type | Description |
|---------------------|---------|-----------------------------------|
| `payment_key` * | uuid4 | Unique payment identification key. |
| `request_control_key` * | uuid4 | Unique identification key for the client's request. |
| `payer_name` * | string | Name of the effective payer. |
| `payer_document_number` * | string | Document number of the effective payer (CPF/CNPJ). |
| `source_account_key` * | uuid4 | Key of the debited account. |
| `transaction_key` * | uuid4 | Payment transaction key. |
| `transaction_revert_key` | uuid4 | Payment reversal transaction key. |
| `paid_amount` * | number | Amount effectively paid. |
| `payment_date` * | string | Payment date. |
| `payment_type` * | [enum](#enumerators-payment_type) | Payment type. |
| `bank_slip` | [object](#object-bank_slip) | Bank slip. |
| `collection_slip` | object | Collection invoice. |
| `payment_status` * | [enum](#enumerators-payment_status) | Payment status. |
### Enumerators payment_type
| Enumerator | Type | Description |
|---------------|-----------|---------------|
| `bank_slip` | string | Bank slip |
| `collection_slip` | string | Collection invoice |
:::danger Warning
The enumerator `collection_slip` does not apply to the bank slip flow, and the collection_slip object will always be null.
:::

### Enumerators payment_status
| Enumerator | Description |
|---------------|---------------|
| `pending_execution` | Pending execution |
| `executed` | Executed |
| `reverted` | Reverted |
| `rejected` | Rejected |
| `error` | Error |
:::danger Warning
For payments where QI does not receive a response from CIP within two minutes, the payment will be returned with the status `pending_execution`. After QI receives the response from CIP, the pending payment webhook described on the [webhooks page](/documentation/baas_v2/cobranca/webhooks) will be sent to the client.
:::

### Object bank_slip
| Field | Type | Description |
|-----------------------------------|---------|-----------------------------------|
| `barcode` * | string | Barcode. |
| `digitable_line` * | string | Digitable line. |
| `payer_name` * | string | Payer's name.|
| `payer_document_number` * | string | Payer's document number (CPF/CNPJ). |
| `beneficiary_name` * | string | Beneficiary's name. |
| `beneficiary_trading_name` | string | Beneficiary's trade name. |
| `beneficiary_document_number` * | string | Beneficiary's document number (CPF/CNPJ). |
| `beneficiary_bank_ispb` * | string | ISPB code of the beneficiary's bank. |
| `guarantor_name` | string | Name of the guarantor. |
| `guarantor_document_number` | string | Guarantor's document number (CPF/CNPJ). |
| `expiration_date` * | string | Due date. |
| `max_payment_date` * | string | Maximum payment date. |
| `partial_payment_indicator` * | [enum](#enumerators-partial_payment_indicator) | Partial payment indicator. |
| `registered_payment_amount` | string | Total registered payment amount. |
| `nominal_amount` * | number | Original amount. |
| `total_amount` * | number | Total amount. |
| `rebate_amount` * | number | Rebate amount. |
| `discount_amount` * | number | Discount amount. |
| `fine_amount` * | number | Fine amount. |
| `interest_amount` * | number | Interest amount. |
### Enumerators partial_payment_indicator
| Enumerator | Type | Description |
|---------------|-----------|---------------|
| `allowed` | string | Allowed |
| `not_allowed` | string | Not allowed |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Description in portuguese",
    "code": "Código"
}
```

| HTTP Code | QI Code | Title | Description (eng) | Description (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 400 | BIP000001 | Bad Request | The barcode or digitable line must have 44 or 47 characters. | O código de barras ou linha digitável deve ter 44 ou 47 caracteres. |
| 400 | BIP000002 | Bad Request | The bill sent does not correspond to a bank slip. | A conta enviado não corresponde a um boleto bancário. |
| 400 | BIP000003 | Bad Request | The digitable line sent is invalid. | A linha digitável enviada é inválida. |
| 404 | BIP000004 | Not Found | The bank slip was not found. | O boleto não foi encontrado. |
| 400 | BIP000005 | Bad Request | It was not possible to consult the bank slip at this time. Please try again in a few minutes. | Não foi possível consultar o boleto neste momento. Por favor, tente novamente em alguns minutos. |
| 400 | BIP000006 | Bad Request | Bank slip already written off | Boleto já baixado |
| 400 | BIP000007 | Bad Request | Bank slip blocked for payment | Boleto bloqueado para pagamento |
| 400 | BIP000008 | Bad Request | Bank slip already paid | Boleto já pago |
| 400 | BIP000009 | Bad Request | Invalid bank slip. Please consult issuing bank | Boleto inválido. Favor consultar banco emissor |
| 403 | BIP000010 | Forbidden | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404 | BIP000011 | Not Found | The source account key was not found. | A chave da conta de origem não foi encontrada. |
| 400 | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400 | BIP000013 | Bad Request | The source account is closed. | A conta de origem está fechada. |
| 400 | BIP000014 | Bad Request | The source account is blocked. | A conta de origem está bloqueada. |
| 400 | BIP000015 | Bad Request | Payment date is greater than the maximum payment date. | A data de pagamento é maior que a data máxima de pagamento. |
| 400 | BIP000016 | Bad Request | Payment date is smaller than the calculation date. | A data de pagamento é menor que a data de cálculo. |
| 400 | BIP000017 | Bad Request | Invalid payment amount. | Valor de pagamento inválido. |
| 400 | BIP000018 | Bad Request | Partial payment is not allowed. | Pagamento parcial não é permitido. |
| 400 | BIP000019 | Bad Request | The payment amount is greater than the available amount. | O valor do pagamento é maior que o valor disponível. |
| 400 | BIP000020 | Bad Request | All partial payments for this bank slip have already been made. | Todos os pagamentos parciais deste boleto já foram realizados. |
| 400 | BIP000022 | Bad Request | Bank slip payment service is closed. | Serviço de pagamento de boleto está fechado. |
| 400 | BIP000023 | Bad Request | The source account has insufficient balance. Payment cannot be made. | A conta de origem possui saldo insuficiente. Pagamento não pode ser realizado. |
| 400 | BIP000024 | Bad Request | Request control key already exists. | Chave de controle da requisição já existe. |
| 400 | BIP000025 | Bad Request | It was not possible to pay the bank slip at this time. Please verify your information and, if necessary, contact us for assistance. | Não foi possível pagar o boleto neste momento. Por favor, verifique suas informações e, se necessário, entre em contato conosco para assistência. |
| 400 | BIP000028 | Bad Request | The source account has blocked balance. Payment cannot be made. | A conta de origem possui saldo em conta bloqueado. Pagamento não pode ser realizado. |
## Sandbox Environment
In our sandbox environment, we provide mocked digitable lines for simulating successful payments and testing error scenarios.
### Success scenarios

| Digitable line |
|---|
| 00190000090361557400500000024174396700000991000 |
| 00190000090282802601919212747174596760001294161 |
| 23793390014000000455277000249001596900000103995 |
| 75691434020137513680900001040013196770002417240 |
| 21390001171200000570700168167484796770000148206 |

### `pending_execution` scenarios

The simulation of this scenario is better described on the [simulation page](/documentation/baas_v2/cobranca/simulacao).

| Digitable line |
|---|
| 75691333790100505390300569460017397220000306867 |

### Error scenarios

| Digitable line | Error code |
|---|---|
| 34191090083273252027893634770007296690012513600 | BIP000007 |
| 07090010287045349010776686070590896770001160123 | BIP000007 |
| 42297048060005815702500130494123896770000239491 | BIP000006 |
| 74891123702849020818918378871083196690000050000 | BIP000009 |
| 23792374119000209350986000372408496610000122810 | BIP000008 |

---

# Make payment of collection invoice (agreement/tribute)

URL: /en/documentation/baas/cobranca/pagar_fatura_de_recolhimento

This endpoint allows the payment of collection invoices. The payment should be made after a consultation, using the information returned in it, to ensure the correct flow and avoid failures during the payment process.
:::info Collection Invoice
This type of charge is issued by utility companies (water, electricity, telephone, and gas bills) and public entities (taxes). They are not registered with the Interbank Payment Clearinghouse (CIP/Núclea), and thus, do not return the same information as a bank slip.
:::

## Request

### Request Endpoint

ENDPOINT /account/ ACCOUNT_KEY /payment/collection_slip
MÉTODO POST

### Request Path Params

| Field | Type | Description | Characters |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` * | uuid4 | Unique account identification key. | 36 |

Request Body: Payment of collection invoice with digitable line

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "digitable_line": "00190000090361557400500000024174396700000991000",
  "payment_amount": 1156.8
}
```
Request Body: Payment of collection invoice with barcode

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "barcode": "00190000090361557400500000024174396700000991000",
  "payment_amount": 1156.8
}
```

### Body Params

| Field | Type | Description |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4 | Unique identification key for the client's request. |
| `barcode` | string | Barcode. |
| `digitable_line` | string | Digitable line. |
| `payment_amount` * | number | Amount to be paid. |
:::danger Warning
The `payment_amount` must always be equal to the `total_amount` returned in the bank slip query.
:::
## Response

### Success Response

STATUS 201

Response Body: Payment executed

```json
{
  "payment_key": "33860ad0-bcb0-47b7-bbe7-c7e3ec2fc61a",
  "request_control_key": "ae4508df-f2cb-4e28-9f04-a19b7f2758c9",
  "payer_name": "COOPERATIVA INDUSTRIAL MURILO",
  "payer_document_number": "62069937000118",
  "source_account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "transaction_key": "fc9ccfd0-2f21-4207-9772-69238be74152",
  "transaction_revert_key": null,
  "paid_amount": 1389.21,
  "payment_date": "2024-04-30",
  "payment_type": "collection_slip",
  "bank_slip": null,
  "collection_slip": {
    "barcode": null,
    "digitable_line": "836200000138892100450006762142420244046000010192",
    "collection_name": "CIA ULTRAGAZ SA-COD",
    "collection_document_number": "00394460005887",
    "expiration_date": "2024-04-15",
    "total_amount": 1389.21
  },
  "payment_status": "executed"
}
```

STATUS 202

:::info Webhook
When the payment returns status `202`, processing is still in progress. **Do not retry the payment** until you receive the final status update via webhook.
:::

Response Body: Pending payment

```json
{
  "payment_key": "33860ad0-bcb0-47b7-bbe7-c7e3ec2fc61a",
  "request_control_key": "ae4508df-f2cb-4e28-9f04-a19b7f2758c9",
  "payer_name": "COOPERATIVA INDUSTRIAL MURILO",
  "payer_document_number": "62069937000118",
  "source_account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "transaction_key": "fc9ccfd0-2f21-4207-9772-69238be74152",
  "transaction_revert_key": null,
  "paid_amount": 1389.21,
  "payment_date": "2024-04-30",
  "payment_type": "collection_slip",
  "bank_slip": null,
  "collection_slip": {
    "barcode": null,
    "digitable_line": "836200000138892100450006762142420244046000010192",
    "collection_name": "CIA ULTRAGAZ SA-COD",
    "collection_document_number": "00394460005887",
    "expiration_date": "2024-04-15",
    "total_amount": 1389.21
  },
  "payment_status": "pending"
}
```

### Response Body Params
| Field | Type | Description |
|---------------------|---------|-----------------------------------|
| `payment_key` * | uuid4 | Unique payment identification key. |
| `request_control_key` * | uuid4 | Unique identification key for the client's request. |
| `payer_name` * | string | Name of the effective payer.|
| `payer_document_number` * | string | Document number of the effective payer (CPF/CNPJ). |
| `source_account_key` * | uuid4 | Key of the debited account. |
| `transaction_key` * | uuid4 | Payment transaction key. |
| `transaction_revert_key` | uuid4 | Payment reversal transaction key. |
| `paid_amount` * | number | Amount effectively paid. |
| `payment_date` * | string | Payment date. |
| `payment_type` * | [enum](#enumerators-payment_type) | Payment type. |
| `bank_slip` | object | Bank slip. |
| `collection_slip` | [object](#object-collection_slip) | Collection invoice. |
| `payment_status` * | [enum](#enumerators-payment_status) | Payment status. |
### Enumerators payment_type
| Enumerator | Type | Description |
|---------------|-----------|---------------|
| `bank_slip` | string | Bank slip |
| `collection_slip` | string | Collection invoice |
:::danger Warning
The enumerator `bank_slip` does not apply to the collection invoice flow, and the bank_slip object will always be null.
:::
### Enumerators payment_status
| Enumerator | Description |
|---------------|---------------|
| `pending`  | Pending   |
| `executed` | Executed |
| `reverted` | Reverted |
| `rejected` | Rejected |
| `error` | Error |
### Object collection_slip
| Field | Type | Description |
|-----------------------------------|---------|-----------------------------------|
| `barcode` | string | Barcode. |
| `digitable_line` | string | Digitable line. |
| `collection_name` * | string | Name of the agreement.|
| `collection_document_number` | string | Document number of the agreement (CPF/CNPJ).|
| `expiration_date` * | string | Due date. |
| `total_amount` * | number | Total amount. |

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Descrição em português",
    "code": "Código"
}
```
| HTTP Code | QI Code | Title | Description (eng) | Description (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 400 | BIP000032 | Bad Request | The bill sent does not correspond to a collection slip. | A conta enviada não corresponde a uma fatura de recolhimento. |
| 400 | BIP000033 | Bad Request | The barcode or digitable line of the collection slip must have 44 or 48 characters. | O código de barras ou linha digitável da fatura de recolhimento deve ter 44 ou 48 caracteres. |
| 403 | BIP000010 | Forbidden | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404 | BIP000011 | Not Found | The source account key was not found. | A chave da conta de origem não foi encontrada. |
| 400 | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400 | BIP000013 | Bad Request | The source account is closed. | A conta de origem está fechada. |
| 400 | BIP000014 | Bad Request | The source account is blocked. | A conta de origem está bloqueada. |
| 400 | BIP000023 | Bad Request | The source account has insufficient balance. Payment cannot be made. | A conta de origem possui saldo insuficiente. Pagamento não pode ser realizado. |
| 400 | BIP000024 | Bad Request | Request control key already exists. | Chave de controle da requisição já existe. |
| 400 | BIP000028 | Bad Request | The source account has blocked balance. Payment cannot be made. | A conta de origem possui saldo em conta bloqueado. Pagamento não pode ser realizado. |
| 400 | BIP000034 | Bad Request | Collection slip already paid. | Fatura de recolhimento já paga. |
| 400 | BIP000035 | Bad Request | Covenant slip invalid barcode. | Código de barras da fatura de recolhimento inválido. |
| 400 | BIP000036 | Bad Request | Covenant slip overdue. | Fatura de recolhimento vencida. |
| 400 | BIP000037 | Bad Request | Error in collection slip consultation. | Erro na consulta da fatura de recolhimento. |
| 400 | BIP000038 | Bad Request | Outside of covenant payment hours. | Fora do horário de pagamento do convênio. |
| 400 | BIP000039 | Bad Request | Collection slip not accepted. | Fatura de recolhimento não aceita. |
| 400 | BIP000040 | Bad Request | Minimum advance not reached. | Mínimo de dias de adiantamento não atingido. |
| 400 | BIP000041 | Bad Request | Max payment amount exceeded. | Valor máximo de pagamento excedido. |
| 400 | BIP000044 | Bad Request | It was not possible to pay the collection slip at this time. Please verify your information and, if necessary, contact us for assistance. | Não foi possível pagar a fatura de recolhimento neste momento. Por favor, verifique suas informações e, se necessário, entre em contato conosco para assistência. |
| 400 | BIP000045 | Bad Request | Collection slip payment service is closed. | Serviço de pagamento de fatura de recolhimento está fechado. |
## Sandbox Environment
In our sandbox environment, we provide mocked digitable lines for simulating successful payments and testing error scenarios.
### Success Scenarios
| Digitable Line |
|---|
| 828300000007411100972013905080001546763201900028 |
| 838000000009235700481007241345219112001474229880 |
| 848000000006308600802021201071261517689002201070 |
| 858200000015000000643025703477209504800448091020 |
### Error Scenarios
| Digitable Line | Error Code |
|---|---|
| 858500000037350000643217212883260006147448091022 | BIP000035 |

---

# Scenario Simulation

URL: /en/documentation/baas/cobranca/simulacao_de_cenarios

## 1 - Simulating Payment in Pending Execution State
For payments where QI does not receive a response from CIP within two minutes, the payment will be returned with the status `pending_execution`. After QI receives the response from CIP, the pending payment webhook described on the [webhooks page](/documentation/baas/cobranca/webhooks) will be sent to the client. To simulate this scenario, make a payment with the digitable line `"digitable_line": "75691333790100505390300569460017397220000306867"`.
To update the payment status, make the request below with `payment_status` as **approved** to approve the payment, or **rejected** to reject it.
## Request

### Request Endpoint

ENDPOINT /mock/account/ ACCOUNT_KEY /payment/ PAYMENT_KEY /bank_slip/confirmation
MÉTODO PATCH

### Request Path Params

| Field | Type | Description | Characters |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` * | uuid4 | Unique account identification key. | 36 |
| `payment_key` * | uuid4 | Unique payment identification key. | 36 |

Request Body: Simulating payment confirmation

```json
{
  "payment_status": "approved",
}
```

### Body Parameters
| Field | Type | Description |
|-----------------------------|--------|-----------------------------------------------------------------------|
| `payment_status` * | [enum](#enumerators-payment_status) | Payment status |

### Enumerators payment_status
| Enumerator | Description |
|--------------|-----------|
| `approved` | Approve and complete the payment |
| `rejected` | Reject and revert the payment |

## Response

### Success Response

STATUS 204

Response Body: Simulation completed

```json
{}
```

---

# Solicitar Pagamento em Lote de Boleto Bancário

URL: /en/documentation/baas/cobranca/solicitar_pagamento_lote_de_boleto_bancario_com_confirmacao_de_lote

Este endpoint permite solicitar o pagamento de múltiplos boletos bancários em uma única requisição.

:::info Boleto bancário
É o boleto bancário convencional (linhas digitáveis não iniciadas com dígito 8). Possui registro na Câmara Interbancária de Pagamento (CIP/Núclea) e pode ser pago em instituições financeiras e de pagamento autorizadas a funcionar pelo Banco Central.
:::

:::info Fluxo após a solicitação
Após a solicitação, o lote pode permanecer aguardando a [confirmação do lote](./confirmacao_de_lote_de_boleto_bancario.md), conforme as regras da operação.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/ ACCOUNT_KEY /payments/batch_bank_slip
MÉTODO POST

### Request Path Params

| Campo               | Tipo    | Descrição                               | Caracteres |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` *     | uuid4   | Chave única de identificação da conta.  | 36         |

Request Body: Pagamento em lote de boletos bancários

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "bank_slip_payments": [
    {
      "request_control_key": "c7915a43-212f-5813-9adc-d3ed5d3d3bfd",
      "digitable_line": "00190000090361557400500000024174396700000991000",
      "payment_amount": 1156.8
    },
    {
      "request_control_key": "d8a26b54-323a-4924-0aed-e4fe6e4e4c0e",
      "barcode": "00190000090361557400500000024174396700000991000",
      "payment_amount": 200.5
    }
  ]
}
```

### Body Params

| Campo               | Tipo          | Descrição                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Chave única de identificação da requisição do cliente (lote). |
| `bank_slip_payments` * | array     | Lista de pagamentos de boleto bancário. Limite de **1000** itens por requisição. |

Cada elemento de `bank_slip_payments` deve conter:

| Campo               | Tipo          | Descrição                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Chave única de identificação da requisição do cliente para aquele item do lote. |
| `barcode`               | string    | Código de barras. |
| `digitable_line`        | string    | Linha digitável. |
| `payment_amount` *      | number    | Valor a ser pago. |

:::danger Aviso
Para cada item, o `payment_amount` enviado deve ser compatível com o que a consulta interna do boleto determinar: se o pagamento parcial **não** for permitido para aquele título, o valor deve corresponder ao total atualizado; se for permitido, o `payment_amount` pode seguir as regras do título (incluindo, quando aplicável, valores acima do nominal), como no fluxo de pagamento unitário de boleto bancário.
:::

## Response

### Success Response

STATUS 202

Response Body: Lote aceito para processamento

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
  "total_amount": 1357.3,
  "batch_status": "pending",
  "payment_type": "bank_slip"
}
```

Response Body: exemplo ilustrativo (`batch_status` aprovado)

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
  "total_amount": 1357.3,
  "batch_status": "approved",
  "payment_type": "bank_slip"
}
```

:::info Processamento do lote
O campo `batch_status` na resposta indica o **estado imediato** do lote após esta solicitação (por exemplo, pendente de confirmação ou já encaminhado ao processamento), conforme o fluxo aplicável. Quando houver etapa de [confirmação do lote](./confirmacao_de_lote_de_boleto_bancario.md), utilize essa chamada para aprovar ou rejeitar o lote antes do débito dos títulos. Os valores possíveis de `batch_status` estão em [batch_payment_status](#enumeradores-batch_payment_status).
:::

### Response Body Params

| Campo               | Tipo    | Descrição                         |
|---------------------|---------|-----------------------------------|
| `batch_payment_key` *       | uuid4 | Chave única de identificação do pagamento em lote. |
| `request_control_key` *     | uuid4 | Chave única de identificação da requisição do cliente (lote). |
| `account_key` *             | uuid4 | Chave da conta debitada. |
| `total_amount` *            | number | Soma dos valores (`payment_amount`) dos itens do lote. |
| `batch_status` *         | [enum](#enumeradores-batch_payment_status) | Status do lote logo após a solicitação; depende do fluxo (confirmação e processamento imediato). |
| `payment_type` *            | [enum](#enumeradores-payment_type) | Tipo do pagamento. |

### Enumeradores batch_payment_status

| Enumerador    | Descrição     |
|---------------|---------------|
| `pending`     | Pendente de processamento |
| `pending_2fa_approval` | Pendente de aprovação 2FA |
| `rejected`    | Rejeitado |
| `approved`    | Aprovado |
| `processed`   | Processado |

### Enumeradores payment_type

| Enumerador    | Tipo      | Descrição     |
|---------------|-----------|---------------|
| `bank_slip`     | string    | Boleto bancário    |
| `collection_slip` | string  | Fatura de recolhimento |

:::danger Aviso
O enumerador `collection_slip` não se aplica ao fluxo de lote de boletos bancários deste endpoint; para este caso, espera-se `payment_type` com valor `bank_slip`.
:::

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Descrição em português",
    "code": "Código"
}
```

| Código HTTP | Código QI | Título | Descrição (eng) | Descrição (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 403         | BIP000010 | Forbidden | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404         | BIP000011 | Not Found | The source account key was not found. | A chave da conta de origem não foi encontrada. |
| 400         | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400         | BIP000024 | Bad Request | Request control key already exists. | Chave de controle da requisição já existe. |
| 400         | BIP000050 | Bad Request | Requester configuration does not exist. | Configuração do requester não existe. |
| 400         | BIP000080 | Bad Request | Beneficiary bank code of this bank slip is not allowed. | Banco beneficiário desse boleto não é permitido. |
| 400         | BIP000081 | Bad Request | A list of bank slip payments must be provided. | Uma lista de boletos bancários deve ser fornecida. |

---

# Solicitar Pagamento em Lote de Boleto Bancário

URL: /en/documentation/baas/cobranca/solicitar_pagamento_lote_de_boleto_bancario_sem_confirmacao_de_lote

Este endpoint permite solicitar o pagamento de múltiplos boletos bancários em uma única requisição.

:::info Boleto bancário
É o boleto bancário convencional (linhas digitáveis não iniciadas com dígito 8). Possui registro na Câmara Interbancária de Pagamento (CIP/Núclea) e pode ser pago em instituições financeiras e de pagamento autorizadas a funcionar pelo Banco Central.
:::

:::info Fluxo após a solicitação
Após a solicitação, o lote é encaminhado conforme o processamento definido para a operação. O campo `batch_status` reflete o estado imediato (por exemplo, pendente de processamento ou já em fila de débito). Os valores possíveis estão em [batch_payment_status](#enumeradores-batch_payment_status).
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/ ACCOUNT_KEY /payments/batch_bank_slip
MÉTODO POST

### Request Path Params

| Campo               | Tipo    | Descrição                               | Caracteres |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` *     | uuid4   | Chave única de identificação da conta.  | 36         |

Request Body: Pagamento em lote de boletos bancários

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "bank_slip_payments": [
    {
      "request_control_key": "c7915a43-212f-5813-9adc-d3ed5d3d3bfd",
      "digitable_line": "00190000090361557400500000024174396700000991000",
      "payment_amount": 1156.8
    },
    {
      "request_control_key": "d8a26b54-323a-4924-0aed-e4fe6e4e4c0e",
      "barcode": "00190000090361557400500000024174396700000991000",
      "payment_amount": 200.5
    }
  ]
}
```

### Body Params

| Campo               | Tipo          | Descrição                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Chave única de identificação da requisição do cliente (lote). |
| `bank_slip_payments` * | array     | Lista de pagamentos de boleto bancário. Limite de **1000** itens por requisição. |

Cada elemento de `bank_slip_payments` deve conter:

| Campo               | Tipo          | Descrição                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Chave única de identificação da requisição do cliente para aquele item do lote. |
| `barcode`               | string    | Código de barras. |
| `digitable_line`        | string    | Linha digitável. |
| `payment_amount` *      | number    | Valor a ser pago. |

:::danger Aviso
Para cada item, o `payment_amount` enviado deve ser compatível com o que a consulta interna do boleto determinar: se o pagamento parcial **não** for permitido para aquele título, o valor deve corresponder ao total atualizado; se for permitido, o `payment_amount` pode seguir as regras do título (incluindo, quando aplicável, valores acima do nominal), como no fluxo de pagamento unitário de boleto bancário.
:::

## Response

### Success Response

STATUS 202

Response Body: Lote aceito para processamento

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
  "total_amount": 1357.3,
  "batch_status": "pending",
  "payment_type": "bank_slip"
}
```

Response Body: exemplo ilustrativo com `batch_status` aprovado

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "6dc89d57-fac7-4643-b151-cd2ca0a7f68f",
  "total_amount": 1357.3,
  "batch_status": "approved",
  "payment_type": "bank_slip"
}
```

:::info Processamento do lote
O campo `batch_status` na resposta indica o **estado imediato** do lote após esta solicitação (por exemplo, pendente de processamento ou já encaminhado ao processamento dos títulos), conforme o fluxo aplicável. Os valores possíveis de `batch_status` estão em [batch_payment_status](#enumeradores-batch_payment_status).
:::

### Response Body Params

| Campo               | Tipo    | Descrição                         |
|---------------------|---------|-----------------------------------|
| `batch_payment_key` *       | uuid4 | Chave única de identificação do pagamento em lote. |
| `request_control_key` *     | uuid4 | Chave única de identificação da requisição do cliente (lote). |
| `account_key` *             | uuid4 | Chave da conta debitada. |
| `total_amount` *            | number | Soma dos valores (`payment_amount`) dos itens do lote. |
| `batch_status` *         | [enum](#enumeradores-batch_payment_status) | Status do lote logo após a solicitação; depende do processamento imediato e das regras da operação. |
| `payment_type` *            | [enum](#enumeradores-payment_type) | Tipo do pagamento. |

### Enumeradores batch_payment_status

| Enumerador    | Descrição     |
|---------------|---------------|
| `pending`     | Pendente de processamento |
| `pending_2fa_approval` | Pendente de aprovação 2FA |
| `rejected`    | Rejeitado |
| `approved`    | Aprovado |
| `processed`   | Processado |

### Enumeradores payment_type

| Enumerador    | Tipo      | Descrição     |
|---------------|-----------|---------------|
| `bank_slip`     | string    | Boleto bancário    |
| `collection_slip` | string  | Fatura de recolhimento |

:::danger Aviso
O enumerador `collection_slip` não se aplica ao fluxo de lote de boletos bancários deste endpoint; para este caso, espera-se `payment_type` com valor `bank_slip`.
:::

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Descrição em português",
    "code": "Código"
}
```

| Código HTTP | Código QI | Título | Descrição (eng) | Descrição (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 403         | BIP000010 | Forbidden | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404         | BIP000011 | Not Found | The source account key was not found. | A chave da conta de origem não foi encontrada. |
| 400         | BIP000012 | Bad Request | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400         | BIP000024 | Bad Request | Request control key already exists. | Chave de controle da requisição já existe. |
| 400         | BIP000050 | Bad Request | Requester configuration does not exist. | Configuração do requester não existe. |
| 400         | BIP000080 | Bad Request | Beneficiary bank code of this bank slip is not allowed. | Banco beneficiário desse boleto não é permitido. |
| 400         | BIP000081 | Bad Request | A list of bank slip payments must be provided. | Uma lista de boletos bancários deve ser fornecida. |

---

# Solicitar Pagamento em Lote de Fatura de Recolhimento (convênio/tributo)

URL: /en/documentation/baas/cobranca/solicitar_pagamento_lote_de_fatura_de_recolhimento_com_confirmacao_de_lote

Este endpoint permite solicitar o pagamento de múltiplas faturas de recolhimento em uma única requisição.

:::info Fatura de recolhimento
Esse tipo de cobrança é emitido por concessionárias de serviços (conta de água, luz, telefone e gás) e órgãos públicos (tributos). Eles não são registrados na Câmara Interbancária de Pagamento (CIP/Núclea), por isso, não retornam as mesmas informações que um boleto bancário apresenta.
:::

:::info Fluxo após a solicitação
Após a solicitação, o lote pode permanecer aguardando a [confirmação do lote](./confirmacao_de_lote_de_fatura_de_recolhimento.md), conforme as regras da operação.
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/ ACCOUNT_KEY /payments/batch_collection_slip
MÉTODO POST

### Request Path Params

| Campo               | Tipo    | Descrição                               | Caracteres |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` *     | uuid4   | Chave única de identificação da conta.  | 36         |

Request Body: Pagamento em lote de faturas de recolhimento

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "collection_slip_payments": [
    {
      "request_control_key": "c7915a43-212f-5813-9adc-d3ed5d3d3bfd",
      "digitable_line": "836200000138892100450006762142420244046000010192",
      "payment_amount": 1389.21
    },
    {
      "request_control_key": "d8a26b54-323a-4924-0aed-e4fe6e4e4c0e",
      "barcode": "83620000001388921004500067621424202440460000101",
      "payment_amount": 1389.21
    }
  ]
}
```

### Body Params

| Campo               | Tipo          | Descrição                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Chave única de identificação da requisição do cliente (lote). |
| `collection_slip_payments` * | array     | Lista de pagamentos de fatura de recolhimento. Limite de **1000** itens por requisição. |

Cada elemento de `collection_slip_payments` deve conter:

| Campo               | Tipo          | Descrição                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Chave única de identificação da requisição do cliente para aquele item do lote. |
| `barcode`               | string    | Código de barras. |
| `digitable_line`        | string    | Linha digitável. |
| `payment_amount` *      | number    | Valor a ser pago. |

:::danger Aviso
Para cada item, o `payment_amount` enviado deve ser compatível com o que a consulta interna da fatura de recolhimento determinar (por exemplo, alinhado ao `total_amount` e às regras do convênio/tributo), nas mesmas condições do fluxo de pagamento unitário de fatura de recolhimento.
:::

## Response

### Success Response

STATUS 202

Response Body: Lote aceito para processamento

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "total_amount": 2778.42,
  "batch_status": "pending",
  "payment_type": "collection_slip"
}
```

Response Body: exemplo ilustrativo (`batch_status` aprovado)

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "total_amount": 2778.42,
  "batch_status": "approved",
  "payment_type": "collection_slip"
}
```

:::info Processamento do lote
O campo `batch_status` na resposta indica o **estado imediato** do lote após esta solicitação (por exemplo, pendente de confirmação ou já encaminhado ao processamento), conforme o fluxo aplicável. Quando houver etapa de [confirmação do lote](./confirmacao_de_lote_de_fatura_de_recolhimento.md), utilize essa chamada para aprovar ou rejeitar o lote antes do débito dos títulos. Os valores possíveis de `batch_status` estão em [batch_payment_status](#enumeradores-batch_payment_status).
:::

### Response Body Params

| Campo               | Tipo    | Descrição                         |
|---------------------|---------|-----------------------------------|
| `batch_payment_key` *       | uuid4 | Chave única de identificação do pagamento em lote. |
| `request_control_key` *     | uuid4 | Chave única de identificação da requisição do cliente (lote). |
| `account_key` *             | uuid4 | Chave da conta debitada. |
| `total_amount` *            | number | Soma dos valores (`payment_amount`) dos itens do lote. |
| `batch_status` *         | [enum](#enumeradores-batch_payment_status) | Status do lote logo após a solicitação; depende do fluxo (confirmação e processamento imediato). |
| `payment_type` *            | [enum](#enumeradores-payment_type) | Tipo do pagamento. |

### Enumeradores batch_payment_status

| Enumerador    | Descrição     |
|---------------|---------------|
| `pending`     | Pendente de processamento |
| `pending_2fa_approval` | Pendente de aprovação 2FA |
| `rejected`    | Rejeitado |
| `approved`    | Aprovado |
| `processed`   | Processado |

### Enumeradores payment_type

| Enumerador    | Tipo      | Descrição     |
|---------------|-----------|---------------|
| `bank_slip`     | string    | Boleto bancário    |
| `collection_slip` | string  | Fatura de recolhimento |

:::danger Aviso
O enumerador `bank_slip` não se aplica ao fluxo de lote de faturas de recolhimento deste endpoint; para este caso, espera-se `payment_type` com valor `collection_slip`.
:::

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Descrição em português",
    "code": "Código"
}
```

| Código HTTP | Código QI | Título | Descrição (eng) | Descrição (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 400         | BIP000024 | Bad Request | Request control key already exists. | Chave de controle da requisição já existe. |
| 400         | BIP000050 | Bad Request | Requester configuration does not exist. | Configuração do requester não existe. |
| 400         | BIP000082 | Bad Request | A list of collection slip payments must be provided. | Uma lista de faturas de recolhimento deve ser fornecida. |

---

# Solicitar Pagamento em Lote de Fatura de Recolhimento (convênio/tributo)

URL: /en/documentation/baas/cobranca/solicitar_pagamento_lote_de_fatura_de_recolhimento_sem_confirmacao_de_lote

Este endpoint permite solicitar o pagamento de múltiplas faturas de recolhimento em uma única requisição.

:::info Fatura de recolhimento
Esse tipo de cobrança é emitido por concessionárias de serviços (conta de água, luz, telefone e gás) e órgãos públicos (tributos). Eles não são registrados na Câmara Interbancária de Pagamento (CIP/Núclea), por isso, não retornam as mesmas informações que um boleto bancário apresenta.
:::

:::info Fluxo após a solicitação
Após a solicitação, o lote é encaminhado conforme o processamento definido para a operação. O campo `batch_status` reflete o estado imediato (por exemplo, pendente de processamento ou já em fila de débito). Os valores possíveis estão em [batch_payment_status](#enumeradores-batch_payment_status).
:::

## Request

### Request Endpoint

ENDPOINT /bill_payment/account/ ACCOUNT_KEY /payments/batch_collection_slip
MÉTODO POST

### Request Path Params

| Campo               | Tipo    | Descrição                               | Caracteres |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` *     | uuid4   | Chave única de identificação da conta.  | 36         |

Request Body: Pagamento em lote de faturas de recolhimento

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "collection_slip_payments": [
    {
      "request_control_key": "c7915a43-212f-5813-9adc-d3ed5d3d3bfd",
      "digitable_line": "836200000138892100450006762142420244046000010192",
      "payment_amount": 1389.21
    },
    {
      "request_control_key": "d8a26b54-323a-4924-0aed-e4fe6e4e4c0e",
      "barcode": "83620000001388921004500067621424202440460000101",
      "payment_amount": 1389.21
    }
  ]
}
```

### Body Params

| Campo               | Tipo          | Descrição                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Chave única de identificação da requisição do cliente (lote). |
| `collection_slip_payments` * | array     | Lista de pagamentos de fatura de recolhimento. Limite de **1000** itens por requisição. |

Cada elemento de `collection_slip_payments` deve conter:

| Campo               | Tipo          | Descrição                         |
|---------------------|---------------|-----------------------------------|
| `request_control_key` * | uuid4     | Chave única de identificação da requisição do cliente para aquele item do lote. |
| `barcode`               | string    | Código de barras. |
| `digitable_line`        | string    | Linha digitável. |
| `payment_amount` *      | number    | Valor a ser pago. |

:::danger Aviso
Para cada item, o `payment_amount` enviado deve ser compatível com o que a consulta interna da fatura de recolhimento determinar (por exemplo, alinhado ao `total_amount` e às regras do convênio/tributo), nas mesmas condições do fluxo de pagamento unitário de fatura de recolhimento.
:::

## Response

### Success Response

STATUS 202

Response Body: Lote aceito para processamento

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "total_amount": 2778.42,
  "batch_status": "pending",
  "payment_type": "collection_slip"
}
```

Response Body: exemplo ilustrativo com `batch_status` aprovado

```json
{
  "batch_payment_key": "a3214093-e51c-55e2-b5d3-60244475b3fb",
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "account_key": "daae79e6-ee8b-449f-aa1e-96959d5d5a72",
  "total_amount": 2778.42,
  "batch_status": "approved",
  "payment_type": "collection_slip"
}
```

:::info Processamento do lote
O campo `batch_status` na resposta indica o **estado imediato** do lote após esta solicitação (por exemplo, pendente de processamento ou já encaminhado ao processamento dos títulos), conforme o fluxo aplicável. Os valores possíveis de `batch_status` estão em [batch_payment_status](#enumeradores-batch_payment_status).
:::

### Response Body Params

| Campo               | Tipo    | Descrição                         |
|---------------------|---------|-----------------------------------|
| `batch_payment_key` *       | uuid4 | Chave única de identificação do pagamento em lote. |
| `request_control_key` *     | uuid4 | Chave única de identificação da requisição do cliente (lote). |
| `account_key` *             | uuid4 | Chave da conta debitada. |
| `total_amount` *            | number | Soma dos valores (`payment_amount`) dos itens do lote. |
| `batch_status` *         | [enum](#enumeradores-batch_payment_status) | Status do lote logo após a solicitação; depende do processamento imediato e das regras da operação. |
| `payment_type` *            | [enum](#enumeradores-payment_type) | Tipo do pagamento. |

### Enumeradores batch_payment_status

| Enumerador    | Descrição     |
|---------------|---------------|
| `pending`     | Pendente de processamento |
| `pending_2fa_approval` | Pendente de aprovação 2FA |
| `rejected`    | Rejeitado |
| `approved`    | Aprovado |
| `processed`   | Processado |

### Enumeradores payment_type

| Enumerador    | Tipo      | Descrição     |
|---------------|-----------|---------------|
| `bank_slip`     | string    | Boleto bancário    |
| `collection_slip` | string  | Fatura de recolhimento |

:::danger Aviso
O enumerador `bank_slip` não se aplica ao fluxo de lote de faturas de recolhimento deste endpoint; para este caso, espera-se `payment_type` com valor `collection_slip`.
:::

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Descrição em português",
    "code": "Código"
}
```

| Código HTTP | Código QI | Título | Descrição (eng) | Descrição (pt-br) |
|-------------|-----------|--------|------------------|------------------|
| 400         | BIP000024 | Bad Request | Request control key already exists. | Chave de controle da requisição já existe. |
| 400         | BIP000050 | Bad Request | Requester configuration does not exist. | Configuração do requester não existe. |
| 400         | BIP000082 | Bad Request | A list of collection slip payments must be provided. | Uma lista de faturas de recolhimento deve ser fornecida. |

---

# Webhooks

URL: /en/documentation/baas/cobranca/webhooks

:::danger Warning!
QI Tech webhooks should not be mapped in a restrictive manner.
Additional fields may be included in the payloads of the webhooks returned by our APIs.
:::
## Webhook for Pending Payments
Webhook intended to update the status of payments that were pending (status 202) when making a boleto payment.

### Webhook Request Body

Request Body: Payment executed

```json
{
  "webhook_type": "baas.bill_payment.payment",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
    "payment_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
    "barcode":"00193967000009910000000003615574000000002417",
    "digitable_line":"00190000090361557400500000024174396700000991000",
    "payment_status": "executed",
    "payment_type":"bank_slip"
  }
}
```

Request Body: Payment reverted

```json
{
  "webhook_type": "baas.bill_payment.payment",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
    "payment_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
    "barcode":"81620000000000336592028110120200020214942099",
    "digitable_line":"816200000007000336592027811012020004202149420996",
    "payment_status": "reverted",
    "payment_type":"collection_slip"
  }
}
```

### Webhook Body Params
| Field | Type | Description |
|-----------------------|--------|-----------------------------------------------------------|
| `webhook_type` | string | An enumerator that defines the type of event being reported. |
| `webhook_datetime` | string | Date and time the webhook was sent. |
| `request_control_key` | uuid4 | Unique identification key for the client's request. |
| `payment_key` * | uuid4 | Unique payment identification key. |
| `barcode` * | string | Barcode. |
| `digitable_line` * | string | Digitable line. |
| `payment_type` * | [enum](#enumerators-payment_type) | Payment type. |
| `payment_status` * | [enum](#enumerators-payment_status) | Payment status. |
### Enumerators payment_type
| Enumerator | Type | Description |
|---------------|-----------|---------------|
| `bank_slip` | string | Boleto |
| `collection_slip` | string | Collection invoice |
### Enumerators payment_status
| Enumerator | Type | Description |
|---------------|-----------|---------------|
| `executed` | string | Executed |
| `reverted` | string | Reverted |

---

# Query device

URL: /en/documentation/baas/dispositivo/consultar_dispositivo

## Request

ENDPOINT /account/ ACCOUNT_KEY /device/ DEVICE_KEY
METHOD GET

### Path Params

| Field         | Type   | Description                              | Characters |
|---------------|--------|----------------------------------------|------------|
| `account_key` | uuidv4 | Unique account identification key. | 36         |
| `device_key` | uuidv4 | Unique device identification key. | 36         |

## Response

STATUS 200

Response Body: Device found

```json
{
  "device_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "session_id": "05894BAD-C94E-4A61-B2A8-57EDAE868A0F",
  "analysis_status": "automatically_approved",
  "status": "registered",
  "device_registration_data": {
    "device_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
    "session_id": "05894BAD-C94E-4A61-B2A8-57EDAE868A0F",
    "document_number": "438.858.048-16",
    "registration_date": "2025-06-30T14:52:13-03:00",
    "face_recognition_key": "367195fc-de24-46b0-9ddb-79231dc7eeff"
  },
  "analysis_status_events": [
    {
      "new_analisys_status": "automatically_approved",
      "reason": null,
      "reason_description": null,
      "event_date": "2025-06-30T14:52:13Z"
    }
  ],
  "status_events": [
    {
      "new_status": "registered",
      "event_date": "2025-06-30T14:52:13Z"
    }
  ],
  "registration_date": "2025-06-30T14:52:14Z",
  "created_at": "2025-06-30T14:52:13Z"
}
```

### Response Body Params

| Field                   | Type   | Description                                                                           | Characters |
|-------------------------|--------|-------------------------------------------------------------------------------------|------------|
| `device_key` *          | uuidv4 | Unique device identification key in uuid v4 format                     | 36         |
| `session_id` *          | uuidv4 | Session identifier obtained via device_scan                                      | 36         |
| `analysis_status` *      | string | Fraud engine analysis status                                                | **[analysis_status Enumerators](#analysis_status-enumerators)** |
| `status` *               | string | Device status                                                               | **[status Enumerators](#status-enumerators)** |
| `device_registration_data` * | object | Device registration data                                            | **[device_registration_data Object](#device_registration_data-object)** |
| `analysis_status_events` * | array | History of analysis status change events                               | -          |
| `status_events` *       | array  | History of device status change events                           | -          |
| `registration_date` *    | string | Device registration date in ISO format (UTC - "YYYY-MM-DDTHH:MM:SSZ")       | 20         |
| `created_at` *           | string | Device creation date in ISO format (UTC - "YYYY-MM-DDTHH:MM:SSZ")       | 20         |

### device_registration_data Object

| Field                   | Type   | Description                                                                           | Characters |
|-------------------------|--------|-------------------------------------------------------------------------------------|------------|
| `device_key` *          | uuidv4 | Unique device identification key in uuid v4 format                     | 36         |
| `session_id` *          | uuidv4 | Session identifier obtained via device_scan                                      | 36         |
| `document_number`       | string | User's document number (CPF/CNPJ)                                          | 14         |
| `registration_date` *   | string | Registration date in ISO format with timezone                                   | 25         |
| `face_recognition_key`  | uuidv4 | Face recognition key (when applicable)                                  | 36         |

### analysis_status_event Object

| Field                   | Type   | Description                                                                           | Characters |
|-------------------------|--------|-------------------------------------------------------------------------------------|------------|
| `new_analisys_status` * | string | New analysis status                                                              | **[analysis_status Enumerators](#analysis_status-enumerators)** |
| `reason`                | string | Reason for status change (when applicable)                                       | -          |
| `reason_description`    | string | Description of the reason for status change (when applicable)                          | -          |
| `event_date` *          | string | Event date in ISO format (UTC - "YYYY-MM-DDTHH:MM:SSZ")                        | 20         |

### status_event Object

| Field                   | Type   | Description                                                                           | Characters |
|-------------------------|--------|-------------------------------------------------------------------------------------|------------|
| `new_status` *          | string | New device status                                                          | **[status Enumerators](#status-enumerators)** |
| `event_date` *          | string | Event date in ISO format (UTC - "YYYY-MM-DDTHH:MM:SSZ")                        | 20         |

### analysis_status Enumerators

| Enumerator              | Description                               |
|-------------------------|-----------------------------------------|
| automatically_approved  | Automatically approved by fraud engine |
| automatically_reproved | Automatically rejected by fraud engine |
| pending                 | Pending analysis                     |

### status Enumerators

| Enumerator         | Description                               |
|--------------------|-----------------------------------------|
| registered         | Registered device                  |
| disabled           | Disabled device                 |
| pending            | Device pending approval       |

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (ptbr)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Erro de Schema                                                                                                         |
| 404                      | OBD000002            | Not Found                             | Bank account not found                                                   | Conta não encontrada                                                       |
| 404                      | OBD000100            | Device not found                                 | No device is associated with the provided device_key.                                                                                     | Nenhum dispositivo está associado à device_key fornecida.                                             |

---

# Approve device creation

URL: /en/documentation/baas/dispositivo/create/aprovar_cadastro_dispositivo

## Request

ENDPOINT /account/ ACCOUNT_KEY /device/ DEVICE_KEY /validate
METHOD PUT

### Path Params

| Field         | Type   | Description                              | Characters |
|---------------|--------|----------------------------------------|------------|
| `account_key` | uuidv4 | Unique account identification key. | 36         |
| `device_key` | uuidv4 | Unique device identification key. | 36         |

Request Body

```json
{
  "token": "329adf"
}
```

### Body Params

| Field     | Type   | Description                                                             | Characters |
|-----------|--------|-----------------------------------------------------------------------|------------|
| `token` * | string | Authentication code sent to the account transaction approver | 6          | 

## Response

STATUS 201

Response Body: Device Created

```json
{
  "device_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "device_status": "created",
  "created_at": "2024-12-22T20:30:23.459Z"
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (ptbr)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Erro de Schema                                                                                                         |
| 404                      | OBD000002            | Not Found                             | Bank account not found                                                   | Conta não encontrada                                                       |
| 400                      | OBD000088            | Bad Request                               | Account blocked or closed can not perform this action                                                                                        | A conta bloqueada ou fechada não pode executar esta ação                                                                                    |
| 400                      | OBD000089            | Bad Request                               | Hub account can not perform this action                                                                                 | A conta hub não pode executar esta ação                                                                                    |
| 400                      | OBD000099            | Number of token validation attempts exceeded                                 | The maximum number of failed token validation attempts has been reached                                                                                     | Número máximo de tentativas de validação de token atingida                                                    |
| 404                      | OBD000100            | Device not found                                 | No device is associated with the provided device_key.                                                                                     | Nenhum dispositivo está associado à device_key fornecida.                                             |
| 400                      | OBD0000100            | Incorrect Token                                | Token sent does not match expected                             | Token enviado não condiz com, o esperado                                                                |

---

# Request Device Creation

URL: /en/documentation/baas/dispositivo/create/solicitacao_cadastro_dispositivo

## Request

ENDPOINT /account/ ACCOUNT_KEY /device
METHOD POST

### Path Params

| Field         | Type   | Description                              | Characters |
|---------------|--------|----------------------------------------|------------|
| `account_key` | uuidv4 | Unique account identification key. | 36         |

**SMS**

Request Body: SMS Authentication

```json
{
    "device_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
    "session_id": "fae3cb6c-9012-4b1c-9d61-7e8b2a6a5ed2",
    "tfa_info": {
        "approver_document_number": "98765432100",
        "contact_type": "sms",
    },
}
```

### Body Params

| Field                   | Type       | Description                                                                                                                                                                                                                                        | Characters                              |
|-------------------------|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------|
| `device_key` * | uuidv4     | Unique device identification key in uuid v4 format, obtained through **device_scan** (created at this moment by the integrating client).                                                                                                                                                               | 36                                      | 
| `session_id` * | uuidv4     | Unique session identification key in uuid v4 format, obtained through **device_scan** (created at this moment by the integrating client).                                                                                                                                                               | 36                                      | 
| `tfa_info`*             | Object     | Object containing the approver's document number and contact method or `image_key`.                                                                                                                                                                  | **[tfa_info Object](#tfa_info-object)** |

### tfa_info Object

| Field                       | Type   | Description                                                                           | Characters |
|-----------------------------|--------|-------------------------------------------------------------------------------------|------------|
| `approver_document_number`* | string | Document number of the account approver.                                  | 11         | 
| `contact_type`*             | string | Indicates the contact method with the person responsible for account approval. Possible values are **sms**, **email**, or **liveness** (when authentication is performed using image_key).|            |

## Response

STATUS 202

Response Body: Transaction Requested

```json
{
  "device_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "device_status": "pending_2fa_approval",
  "created_at": "2024-12-22T20:30:23.459Z"
}
```

**Email**
Request Body: Email Authentication

```json
{
    "device_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
    "session_id": "fae3cb6c-9012-4b1c-9d61-7e8b2a6a5ed2",
    "tfa_info": {
        "approver_document_number": "98765432100",
        "contact_type": "email",
    },
}
```

### Body Params

| Field                   | Type       | Description                                                                                         | Characters                                          |
|-------------------------|------------|---------------------------------------------------------------------------------------------------|-----------------------------------------------------|
| `device_key` * | uuidv4     | Unique device identification key in uuid v4 format, obtained through **device_scan** (created at this moment by the integrating client).                                                                                                                                                               | 36                                      | 
| `session_id` * | uuidv4     | Unique session identification key in uuid v4 format, obtained through **device_scan** (created at this moment by the integrating client).                                                                                                                                                               | 36                                      | 
| `tfa_info`*             | Object     | Object containing the approver's document number and contact method or `image_key`.                                                                                                                                                                  | **[tfa_info Object](#tfa_info-object)** |

### tfa_info Object

| Field                       | Type   | Description                                                                           | Characters |
|-----------------------------|--------|-------------------------------------------------------------------------------------|------------|
| `approver_document_number`* | string | Document number of the account approver.                                  | 11         | 
| `contact_type`*             | string | Indicates the contact method with the person responsible for account approval. Possible values are **sms**, **email**, or **liveness** (when authentication is performed using image_key).|            |

## Response

STATUS 202

Response Body: Transaction Requested

```json
{
  "device_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "device_status": "pending_2fa_approval",
  "created_at": "2024-12-22T20:30:23.459Z"
}
```

**Image Key**

Request Body: Image Key Authentication

```json
{
    "device_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
    "session_id": "fae3cb6c-9012-4b1c-9d61-7e8b2a6a5ed2",
    "tfa_info": {
        "approver_document_number": "98765432100",
        "contact_type": "liveness",
        "image_key": "367195fc-de24-46b0-9ddb-79231dc7eeff",
    },
}
```

### Body Params

| Field                      | Type       | Description                                                                                                                                                                                                                                         | Characters                                |
|----------------------------|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------|
| `device_key` * | uuidv4     | Unique device identification key in uuid v4 format, obtained through **device_scan** (created at this moment by the integrating client).                                                                                                                                                               | 36                                      | 
| `session_id` * | uuidv4     | Unique session identification key in uuid v4 format, obtained through **device_scan** (created at this moment by the integrating client).                                                                                                                                                               | 36                                      | 
| `tfa_info`*             | Object     | Object containing the approver's document number and contact method or `image_key`.                                                                                                                                                                  | **[tfa_info Object](#tfa_info-object)** |

### tfa_info Object

| Field                       | Type   | Description                                                                           | Characters |
|-----------------------------|--------|-------------------------------------------------------------------------------------|------------|
| `approver_document_number`* | string | Document number of the account approver.                                  | 11         | 
| `contact_type`*             | string | Indicates the contact method with the person responsible for account approval. Possible values are **sms**, **email**, or **liveness** (when authentication is performed using image_key).|            |
| `image_key` * | uuidv4     | Unique identification key of the image used for facial recognition, in UUID v4 format, obtained through the **liveness** process.                                                                                                                                                               | 36                                      | 

## Response

STATUS 202

Response Body: Device Created

```json
{
  "device_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "device_status": "created",
  "created_at": "2024-12-22T20:30:23.459Z"
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (ptbr)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Erro de Schema                                                                                                         |
| 404                      | OBD000002            | Not Found                             | Bank account not found                                                   | Conta não encontrada                                                       |
| 400                      | OBD000088            | Bad Request                               | Account blocked or closed can not perform this action                                                                                        | A conta bloqueada ou fechada não pode executar esta ação                                                                                    |
| 400                      | OBD000089            | Bad Request                               | Hub account can not perform this action                                                                                 | A conta hub não pode executar esta ação                                                                                    |
| 403                      | OBD000090            | No approver permission | Given document number does not belong to an approver for this account string                                               | Número de documento enviado não pertence a um aprovador da conta                                              |
| 400                      | OBD000091            | tfa_info is required                                        | Client must send object tfa_info                                                                                       | Cliente deve enviar objeto tfa_info.                                                                                 |
| 400                      | OBD000092            | Invalid device info                         | Session ID and Device Key must be a valid UUID4 | A Session ID e o Device Key devem ser um UUID4 válidos |
| 404                      | OBD000093            | Requester Configuration not found                                  | There is no Requester Configuration attributed to requester_key | Não há Requester Configuration para a requester_key enviada                                                                           |
| 403                      | OBD000094            | Requester not allowed to create a device                                  | Requester has no permission to create a device                                               | Requester não possui permissão para criar um dispositivo                                                                           |
| 400                      | OBD000097            | Error occurred while sending token                                 | An unexpected error occurred while sending token                                                                                     | Um erro inexperado ocorreu ao tentar enviar token                                                                                    |

---

# Request token resend

URL: /en/documentation/baas/dispositivo/create/solicitacao_reenvio_token

A new token will be generated and sent to the approver responsible for creating the device (only for email or SMS contact cases). If the token validation attempt limit is exceeded, resending will not be allowed.

## Request

ENDPOINT /account/ ACCOUNT_KEY /device/ DEVICE_KEY /resend_token
METHOD PATCH

### Path Params

| Field         | Type   | Description                              | Characters |
|---------------|--------|----------------------------------------|------------|
| `account_key` | uuidv4 | Unique account identification key. | 36         |
| `device_key` | uuidv4 | Unique device identification key. | 36         |

### Body Params
| Field         | Type   | Description                              | Characters |
|---------------|--------|----------------------------------------|------------|
| `contact_type`*             | string | Indicates the contact method with the person responsible for account approval. Possible values are **sms**, **email**| **[contact_type Enumerator](#contact_type-enumerator)**  |

:::info Information
If no `contact_type` is sent, the token will be sent in the originally requested format.
:::

| Enumerator | Description                                         |
|------------|---------------------------------------------------|
| **sms**    | Send via Text Message to mobile phone |
| **email**  | Send via electronic mail                      |

## Response

STATUS 202

Response Body: Resend Requested

```json
{
  "device_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "device_status": "pending_2fa_approval",
  "created_at": "2024-12-22T20:30:23.459Z"
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (ptbr)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Erro de Schema                                                                                                         |
| 404                      | OBD000002            | Not Found                             | Bank account not found                                                   | Conta não encontrada                                                       |
| 400                      | OBD000088            | Bad Request                               | Account blocked or closed can not perform this action                                                                                        | A conta bloqueada ou fechada não pode executar esta ação                                                                                    |
| 400                      | OBD000089            | Bad Request                               | Hub account can not perform this action                                                                                 | A conta hub não pode executar esta ação                                                                                    |
| 400                      | OBD000097            | Error occurred while sending token                                 | An unexpected error occurred while sending token                                                                                     | Um erro inexperado ocorreu ao tentar enviar token                                                                                    |
| 400                      | OBD000099            | Number of token validation attempts exceeded                                 | The maximum number of failed token validation attempts has been reached                                                                                     | Número máximo de tentativas de validação de token atingida                                                    |
| 404                      | OBD000100            | Device not found                                 | No device is associated with the provided device_key.                                                                                     | Nenhum dispositivo está associado à device_key fornecida.                                             |

---

# Disable device

URL: /en/documentation/baas/dispositivo/delete/desativar_dispositivo

## Request

ENDPOINT /account/ ACCOUNT_KEY /device/ DEVICE_KEY /disable
METHOD DELETE

### Path Params

| Field         | Type   | Description                              | Characters |
|---------------|--------|----------------------------------------|------------|
| `account_key` | uuidv4 | Unique account identification key. | 36         |
| `device_key` | uuidv4 | Unique device identification key. | 36         |

## Response

STATUS 200

Response Body: Device disabled

```json
{
  "device_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "device_status": "disabled",
  "created_at": "2024-12-22T20:30:23.459Z"
}
```

### Response Body Params

| Field                   | Type   | Description                                                                           | Characters |
|-------------------------|--------|-------------------------------------------------------------------------------------|------------|
| `device_key` *          | uuidv4 | Unique device identification key in uuid v4 format                     | 36         |
| `device_status` *       | string | Device status                                                               | **[device_status Enumerators](#device_status-enumerators)** |
| `created_at` *          | string | Device creation date in ISO format (UTC - "YYYY-MM-DDTHH:MM:SSZ")        | 20         |

### device_status Enumerators

| Enumerator         | Description                               |
|--------------------|-----------------------------------------|
| active             | Device active and available for use |
| disabled           | Device disabled                 |
| pending            | Device pending approval       |

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (ptbr)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Erro de Schema                                                                                                         |
| 404                      | OBD000002            | Not Found                             | Bank account not found                                                   | Conta não encontrada                                                       |
| 400                      | OBD000088            | Bad Request                               | Account blocked or closed can not perform this action                                                                                        | A conta bloqueada ou fechada não pode executar esta ação                                                                                    |
| 400                      | OBD000089            | Bad Request                               | Hub account can not perform this action                                                                                 | A conta hub não pode executar esta ação                                                                                    |
| 404                      | OBD000100            | Device not found                                 | No device is associated with the provided device_key.                                                                                     | Nenhum dispositivo está associado à device_key fornecida.                                             |

---

# Introduction

URL: /en/documentation/baas/dispositivo/introducao

The Onboarding API offers Device Management functionality, allowing partners to register specific devices to users linked to an account. With this functionality, it is possible to reinforce transaction security, ensuring that only authorized devices can perform transactions, which will be validated through the **device token**.

### Device Registration

The registration of a new device for transaction validation is performed through a flow divided into three steps:

---

**I. Registration Request (POST)**  
In this step, a `POST` request is sent containing:  
- Device data obtained via `device_scan`  
- Information required for two-factor authentication (2FA)

Upon completing the request, a 2FA token is generated and sent to the user (by email or SMS). This token ensures that the registration is being performed by the person effectively authorized to link the device.

:::info Note
If authentication is performed through facial recognition, the **image_key** acquired through [liveness](/documentation/caas/face_recognition/api/introduction) must be sent in the 2FA field.
In this case, it will not be necessary to go through the next validation steps.
:::

---

**II. 2FA Token Validation (PUT/PATCH)**  
After receiving the 2FA token, the user must validate it using a `PUT` request. If the code needs to be resent (due to loss, non-receipt, or expiration), a `PATCH` request is used to request a new token.  
Once the token is successfully validated, the device will be effectively registered in the system.

---

**III. Authentication with Device Token in Future Transactions**  
With the device properly registered, it can be used for validation of future transactions. Transactions will be authenticated using the device token, making the process more secure and reliable.

---

### Query a Device

It is possible to query information about a specific device through a `GET` request, providing the `account_key` and `device_key`. This operation returns device details, including its current status, creation date, and last update.

---

### Deactivate a Device

When necessary, a device can be deactivated through a `DELETE` request. Once deactivated, the device can no longer be used for transaction validation, ensuring greater control over operation security.

---

# Confirm Individual Account Opening

URL: /en/documentation/baas/escrow/abrir_conta_pf

Account opening occurs in two mandatory steps. First, a POST request sends preliminary data to reserve the account. Then, a webhook of type `account_request.status_change` with status `pending_additional_data` is triggered. In the second step, a PATCH request finalizes the opening, officially creating the account with the complementary information.

## Request
ENDPOINT /account_request/ ACCOUNT_REQUEST_KEY /escrow
METHOD PATCH

## Path Params
| Field         | Type   | Description                              | Characters |
|---------------|--------|----------------------------------------|------------|
| `account_request_key` | uuidv4 | Unique identification key for account reservation request. | 36         |

## Escrow account opening

Request Body

```json
{
    "account_owner": {
        "address": {
            "street": "Av. Brigadeiro Faria Lima",
            "state": "SP",
            "city": "São Paulo",
            "neighborhood": "Jardim Paulistano",
            "number": "2391",
            "postal_code": "01452905",
            "complement": "Complemento"
        },
        "birth_date": "1990-05-06",
        "document_identification": "3884579b-9810-4fa6-9b08-fe67d237160a",
        "email": "teste@gmail.com",
        "individual_document_number": "99999999999",
        "is_pep": false,
        "mother_name": "Dona Maria Mariane",
        "name": "Nome do Titular da Conta",
        "nationality": "nationality",
        "person_type": "natural",
        "phone": {
            "country_code": "055",
            "area_code": "11",
            "number": "999999999"
        },
        "proof_of_residence": "4d7f4e-1eec-4e5f-82c0-d8c3921497ea",
        "monthly_income": 1000
    },
    "signed_contract": {
        "document_key": "48a8f4g9-4b58-4905-9a69-b1f9215263f5",
        "signatures": [
            {
                "authenticity": {
                    "timestamp": "1970-01-01T00:00:01.080100Z",
                    "facial_recognition_key":"79003de0-2590-455d-9b73-426b8ca284eb",
                    "lang": "-35.8916627",
                    "lat": "-7.2226067",
                    "ip_address": "177.51.1.186",
                    "session_id": "jdifj329842"
                },
                "signer": {
                    "name": "Nome do Titular da Conta",
                    "email": "teste@gmail.com",
                    "phone": {
                        "country_code": "055",
                        "area_code": "11",
                        "number": "999999999"
                    },
                    "document_number": "999999999"
                },
                "authentication_type": "opt-in"
            }
        ]
    },
    "destinations": [
        {
            "account_branch": "0001",
            "account_number": "1234567",
            "account_digit": "1",
            "document_number": "04252012000123",
            "name": "Conta do FIDC",
            "ispb_number": "32402502",
            "financial_institution_code_number": "329"
        }
    ],
    "additional_documents": ["b12c8807-8f3f-4083-9cb1-7cce641f3786"]
}
```

### Request Body Params

| Field | Type | Description | Characters |
|---|---| ---|---|
| `account_owner` * | object  | Object containing the Account Holder information | **[account_owner Object](#account_owner-object)** |
| `signed_contract` * | object  | Object containing the Account Holder information | **[signed_contract Object](#signed_contract-object)** |
| `destinations ` * | list  | List of destination accounts authorized to receive transfers. | **[destinations Object](#destinations-object)** |
| `additional_documents`  | list  | List of additional/optional document IDs. | Array of UUIDs |

### account_owner Object

| Field | Type | Description | Characters |
|---| ---| ---| ---| 
| `address` * | object | Address of the account holder. | **[address Object](#address-object)** |  |
| `birth_date` | string |  Birth date of the account holder (format "YYYY-MM-DD"). | - |
| `document_identification` * | uuidv4 |  DOCUMENT_KEY of the PDF of the account holder's identification document with photo (ID or Driver's License) (previously uploaded) | 36 |
| `email` * | string |  Email of the account holder. | 200 |
| `individual_document_number` | string | CPF of the account holder (numbers only). Limited to 11 characters. | 11 |
| `is_pep` * | string |  Declaration if the person is a PEP (http://www.portaldatransparencia.gov.br/download-de-dados/pep).| - |
| `mother_name` | string |  Mother's name of the client in case of individual. | - |
| `name` * | string | Name of the account holder. | - |
| `nationality` * | string |  Nationality of the client. | - |
| `person_type` * | enumerator | Identifier that the sent object is an individual or legal entity.| **[person_type Enumerators](#person_type-enumerators)**|
| `phone` * | string | Object with phone data | **[phone Object](#phone-object)**|
| `proof_of_residence` | string |  DOCUMENT_KEY of the PDF of the address proof for the sent address (previously uploaded).| - |
| `monthly_income`* | number | Monthly income of the account holder | | 

### address Object 

This object, present in both individual and legal entity objects, is a simple object to represent an address.

| Field | Type | Description |  Characters | 
|---|---|---|---| 
| `street` *| string | Street of the address  | 500 |
| `state` *| string | State of the address (with two uppercase characters) | 2 |
| `city` *| string | City of the address | 255 |
| `neighborhood` *| string | Neighborhood of the address | 500 |
| `number` *| string | Street number | 10 |
| `postal_code` *| string | Postal code of the address (http://www.buscacep.correios.com.br/sistemas/buscacep/) (numbers only) |  8 |
| `complement` *| string | Address complement (free text) | 500 |

### destinations Object

| Field | Type | Description | Characters |
|---| ---| ---| ---| 
| `account_branch` * | string | Branch number of the destination account. | 4 | 
| `account_number` * | string |  Destination account number. | - |
| `account_digit` * | string |  Check digit of the destination account number. | 1 |
| `document_number` * | string |  CPF/CNPJ of the destination account holder. | - |
| `name ` | string | Name/Corporate Name of the destination account holder. | - |
| `ispb_number` * | string |  ISPB (CNPJ base) of the destination account's financial institution.| 8 |
| `financial_institution_code_number ` * | string |  Code of the destination account's financial institution. | 3 |

### signed_contract Object 
| Field | Type   | Description        | Characters    |
|-------|--------|------------------|---------------|
| **document_key** * | uuidv4 | Unique identification key of the **Account Opening Agreement** or **Escrow Account Contract** document. (The DOCUMENT_KEY is returned in the response of the [Document upload](./upload_de_documentos) endpoint) | 36            |
| **signatures** *   | list   | Signature data of the sent document. Each item in the list corresponds to a document signer.      | [signatures Object](#signatures-object) |

### signatures Object
| Field | Type       | Description         | Characters        |
|-------|------------|-------------------|-------------------|
| **authenticity** * | object     | Set of data that evidences the electronic signature performed by the signer. | [authenticity Object](#authenticity-object) |
| **signer** * | object     | Object containing the data of one of the document signers.           | [signer Object](#signer-object)|
| **authentication_type** * | enumerator | Signature type. Will always be "**opt-in**"| "**opt-in**"                   |

### person_type Enumerators
| Enum | Description         | 
|-------|-------------------|
| **natural** * | Individual     |
| **legal** * | Legal Entity     |    

### authenticity Object
| Field | Type   | Description               | Characters |
|-------|--------|-------------------------|------------|
| **timestamp** *            | string | Date and time of the document signing moment.                | 27         |
| **facial_recognition_key** *| uuidv4 | Unique identification key of the account holder's selfie photo.  | 36         |
| **lang**                   | string | Longitude coordinate of the signer's geolocation captured at the time of signature.                  | -          |
| **lat**                    | string | Latitude coordinate of the signer's geolocation captured at the time of signature.                   | -          |
| **ip_address**             | string | IP address of the signer's device.     | -          |
| **session_id**     *        | string | Session ID of the signer at the time of signature.                | -          |

### signer Object
| Field                 | Type   | Description                                 | Characters                        |
|-----------------------|--------|-------------------------------------------|-----------------------------------|
| **name** *            | string | Signer's name.                        | -                                 |
| **email** *           | string | Signer's email.                       | -                                 |
| **phone** *           | object | Object with signer's phone data | **[phone Object](#phone-object)** |
| **document_number** * | string | Signer's CPF.                         | 11                                |

### phone Object 

| Field | Description | Example |  Max. Characters | 
| --- | --- | --- | --- | 
|`country_code` *| string | Country code of the phone (https://ddi.guiamais.com.br/) | 3 | 
| `area_code` *| string | Area code of the phone (https://ddd.guiamais.com.br/) | 3 |
| `number` *| string | Phone number (numbers only) |  10 |

## Response

STATUS 201

Response Body

```json
{
    
    "account_key": "e48eb139-448e-43b9-9aee-df5f4b51158c"
}
```

:::warning Attention
 The `account_key` field will be the unique identification key of the account. All interaction with the account will be done through it.
:::

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`  | Description (eng)<br/>`description` | Description(ptbr) <br></br>`translation`|
|---| --- | --- | --- | --- | 
| 400 | QIT000001 | Bad Request | Schema Error | Schema Error|
| 404 | QIT000404 | Not Found | Resource could not be found | Resource not found|

---

# Confirm Legal Entity Account Opening

URL: /en/documentation/baas/escrow/abrir_conta_pj

Account opening occurs in two mandatory steps. First, a POST request sends preliminary data to reserve the account. Then, a webhook of type `account_request.status_change` with status `pending_additional_data` is triggered. In the second step, a PATCH request finalizes the opening, officially creating the account with the complementary information.

## Request
ENDPOINT /account_request/ ACCOUNT_REQUEST_KEY /escrow
METHOD PATCH

## Path Params
| Field         | Type   | Description                              | Characters |
|---------------|--------|----------------------------------------|------------|
| `account_request_key` | uuidv4 | Unique identification key for the account reservation request. | 36         |

## Escrow Account Opening

Request Body

```json
{
    "account_owner": {
        "address": {
            "city": "Caraguatatuba",
            "complement": "complemento",
            "neighborhood": "Jaraguazinho",
            "number": "924",
            "postal_code": "11675200",
            "state": "SP",
            "street": "Praça Jorge Vitório de Souza"
        },
        "cnae_code": "4721-1/02",
        "company_document_number": "64669455000187",
        "company_statute": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d",
        "company_type": "ltda",
        "email": "marcos.alves@yopmail.com",
        "foundation_date": "2017-09-16",
        "name": "NOME DA EMPRESA",
        "person_type": "legal",
        "phone": {
            "area_code": "19",
            "country_code": "055",
            "number": "988888888"
        },
        "trading_name": "Pães e Doces",
        "monthly_revenue": 100000,
        "company_representatives": [
            {
                "name": "Marcos Felipe Henrique Alves",
                "address": {
                    "city": "Recife",
                    "complement": null,
                    "neighborhood": "Fundão",
                    "number": "137",
                    "postal_code": "52221110",
                    "state": "PE",
                    "street": "Rua Camapuã"
                },
                "email": "marcos.alves@yopmail.com",
                "birth_date": "1972-02-02",
                "individual_document_number": "08531309069",
                "document_identification": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d",
                "document_identification_number": "339122924",
                "is_pep": false,
                "final_beneficiary": true,
                "marital_status": "single",
                "mother_name": "Sueli Isadora Alves",
                "nationality": "Brasileira",
                "person_type": "natural",
                "phone": {
                    "area_code": "88",
                    "country_code": "055",
                    "number": "995924634"
                }
            }
        ]
    },
    "signed_contract": {
        "document_key": "4d7f4e29-4b58-4905-9a69-b1f9215263f5",
        "signatures": [
            {
                "authenticity": {
                    "timestamp": "1970-01-01T00:00:01.080100Z",
                    "facial_recognition_key": "79003de0-2590-455d-9b73-426b8ca284eb",
                    "lang": "-35.8916627",
                    "lat": "-7.2226067",
                    "ip_address": "177.51.1.186",
                    "session_id": "jdifj329842"
                },
                "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"
            }
        ]
    },
    "destinations": [
        {
            "account_branch": "0001",
            "account_number": "1234567",
            "account_digit": "1",
            "document_number": "04252012000123",
            "name": "Conta do FIDC",
            "ispb_number": "32402502",
            "financial_institution_code_number": "329"
        }
    ],
    "additional_documents": ["b12c8807-8f3f-4083-9cb1-7cce641f3786"]
}
```

### Request Body Params

| Field | Type | Description | Characters |
|---|---| ---|---|
| `account_owner` * | object  | Object containing Account Holder information | **[account_owner Object](#account_owner-object)** |
 `signed_contract` * | object  | Object containing Account Holder information | **[signed_contract Object](#signed_contract-object)** |
| `destinations ` * | list  | List of destination accounts authorized to receive transfers. | **[destinations Object](#destinations-object)** |
| `additional_documents` | list | List of additional/optional document IDs. | Array of UUIDs |

### account_owner Object

| Field | Type | Description | Characters |
|---| ---| ---| ---| 
| `address` * | object | Account holder address. | **[address Object](#address-object)** |  |
| `cnae_code` | string | National Classification of Economic Activities | 9 |
| `company_document_number ` * | string |  CNPJ | 14 |
| `company_statute ` | uuidv4 | DOCUMENT_KEY of the company statute PDF (previously uploaded). | 36 |
| `company_type` * | enumerator	 |  Company type|   **[company_type Enumerators](#company_type-enumerators)**    |
| `email` * | string |  Account holder email. | 200 |
| `foundation_date` | string |  Company founding date (format "YYYY-MM-DD"). | 10 |
| `name` * | string | Account holder company name. | 50 |
| `person_type` * | enumerator | Identifier indicating whether the submitted object is a natural person or legal entity.| **[person_type Enumerators](#person_type-enumerators)**|
| `phone` * | object | Object with phone data | **[phone Object](#phone-object)**|
| `trading_name ` * | string | Trade name. | 200 |
| `company_representatives` | list | List of the company's legal representatives | **[company_representatives Object](#company_representatives-object)** |
| `monthly_revenue`* | number | Company monthly revenue | |

### signed_contract Object 
| Field | Type   | Description        | Characters    |
|-------|--------|------------------|---------------|
| ` document_key` * | uuidv4 | Unique identification key for the **Account Opening Agreement** or **Escrow Account Contract** document. (The DOCUMENT_KEY is returned in the response from the [Document upload](./upload_de_documentos) endpoint) | 36            |
|` signatures` *   | list   | Signature data for the submitted document. Each item in the list corresponds to a document signer.      | [signatures Object](#signatures-object) |

### destinations Object

| Field | Type | Description | Characters |
|---| ---| ---| ---| 
| `account_branch` * | string | Destination account branch number. | 4 | 
| `account_number` * | string |  Destination account number. | - |
| `account_digit` * | string |  Destination account number check digit. | 1 |
| `document_number` * | string |  CPF/CNPJ of the destination account holder. | - |
| `name ` | string | Name/Company Name of the destination account holder. | - |
| `ispb_number` * | string |  ISPB (CNPJ base) of the destination account financial institution.| 8 |
| `financial_institution_code_number ` * | string |  Destination account financial institution code. | 3 |

### company_representatives Object

| Field                              | Type    | Description                                                                                              | Characters                                                                              |
|------------------------------------|---------|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
| **name** *                         | string  | Company representative name                                                                       | 100                                                                                     |
| **address** *                      | object  | Company representative address object                                                            | **[address Object](#address-object)**                                                   |
| **email** *                        | string  | Company representative email                                                                      | 254                                                                                     |
| **birth_date**                   | string  | Company representative birth date (format "YYYY-MM-DD")                                     | 10                                                                                      |
| **individual_document_number** *   | string  | Company representative CPF (numbers only).                                                      | 11                                                                                      |
| **document_identification**        | string  | DOCUMENT_KEY of the person's photo identification document PDF (ID or Driver's License) (previously uploaded) | 36                                                                                      |
| **document_identification_number** | string  | Person's photo identification document number (ID or Driver's License)                                    | 16                                                                                      |
| **document_identification_type**   | enum    | Person's photo identification document type (ID or Driver's License)                                      | [document_identification_type Enumerators](#document_identification_type-enumerators) |
| **is_pep** *                       | boolean | Declaration whether the person is PEP (http://www.portaldatransparencia.gov.br/download-de-dados/pep).          | -                                                                                       |
| **final_beneficiary**              | boolean | Declaration if the person is the final beneficiary of the company.                                         | -                                                                                       |
| **marital_status**                 | enum    | Company representative marital status                                                               | **[marital_status Enumerators](#marital_status-enumerators)**                         |
| **mother_name**                  | string  | Company representative mother's name                                                                | 100                                                                                     |
| **nationality**                    | string  | Company representative nationality                                                              | 50                                                                                      |
| **person_type** *                  | enum    | Identifier indicating that the submitted object is a natural person                                              | **[person_type Enumerators](#person_type-enumerators)**                               |
| **phone** * | object  | Object with company representative phone data  | **[phone Object](#phone-object)** |

### address Object

This object, present in both natural person and legal entity objects, is a simple object to represent an address.

| Field              | Description | Example                                                                                   | Characters |
|--------------------|-----------|-------------------------------------------------------------------------------------------|------------|
| **street** *       | string    | Address street                                                                           | 500        |
| **state** *        | enum      | Address state (with two uppercase characters)                                       | 2          |
| **city** *         | string    | Address city                                                                        | 255        |
| **neighborhood** * | string    | Address neighborhood                                                                        | 500        |
| **number** *       | string    | Street number                                                                             | 10         |
| **postal_code** *  | string    | Address ZIP code (http://www.buscacep.correios.com.br/sistemas/buscacep/) (numbers only) | 8          |
| **complement**     | string    | Address complement (free text)                                                     | 500        |

### signed_contract Object 
| Field | Type   | Description        | Characters    |
|-------|--------|------------------|---------------|
| **document_key** * | uuidv4 | Unique identification key for the **Account Opening Agreement** or **Escrow Account Contract** document. (The DOCUMENT_KEY is returned in the response from the [Document upload](./upload_de_documentos) endpoint) | 36            |
| **signatures** *   | list   | Signature data for the submitted document. Each item in the list corresponds to a document signer.      | [signatures Object](#signatures-object) |

### signatures Object
| Field | Type       | Description         | Characters        |
|-------|------------|-------------------|-------------------|
| **authenticity** * | object     | Set of data that evidence the electronic signature performed by the signer. | [authenticity Object](#authenticity-object) |
| **signer** * | object     | Object containing data of one of the document signers.           | [signer Object](#signer-object)|
| **authentication_type** * | enumerator | Signature type. Will always be "**opt-in**"| "**opt-in**"                   |

### authenticity Object
| Field | Type   | Description               | Characters |
|-------|--------|-------------------------|------------|
| **timestamp** *            | string | Date and time of the document signing moment.                | 27         |
| **facial_recognition_key** *| uuidv4 | Unique identification key for the account holder's selfie photo.| 36         |
| **lang**                   | string | Longitude coordinate of the signer's geolocation captured at the signing moment.                  | -          |
| **lat**                    | string | Latitude coordinate of the signer's geolocation captured at the signing moment.                   | -          |
| **ip_address**             | string | Signer's device IP address.     | -          |
| **session_id**  *           | string | Signer's session ID at the signing moment.                | -          |

### signer Object
| Field                 | Type   | Description                                 | Characters                        |
|-----------------------|--------|-------------------------------------------|-----------------------------------|
| **name** *            | string | Signer name.                        | -                                 |
| **email** *           | string | Signer email.                       | -                                 |
| **phone** *           | object | Object with signer phone data | **[phone Object](#phone-object)** |
| **document_number** * | string | Signer CPF.                         | 11                                |

### phone Object 

| Field | Description | Example |  Max Characters | 
| --- | --- | --- | --- | 
|`country_code` *| string | Phone country code (https://ddi.guiamais.com.br/) | 3 | 
| `area_code` *| string | Phone area code (https://ddd.guiamais.com.br/) | 2 |
| `number` *| string |Phone number (numbers only) |  10 |

### person_type Enumerators
| Enum        | Description       |
|-------------|-------------------|
| **natural** | Natural person     |
| **legal**   | Legal entity   |

### document_identification_type Enumerators
| Enum    | Description                            |
|---------|----------------------------------------|
| **rg**  | RG - General Registry                    |
| **cnh** | CNH - National Driver's License |

### company_type Enumerators
| Enum                       | 	Description                                                             |
|----------------------------|--------------------------------------------------------------------------|
| **ltda**                   | Limited Liability Company                                                                |
| **sa**	                    | Corporation                                                        |
| **micro_enterprise**	      | Micro Enterprise                                                            |
| **freelancer**             | Freelancer                                                              |
| **sa_opened**              | Publicly Traded Corporation                                     |
| **sa_closed**	             | Privately Held Corporation                                     |
| **se_ltda**                | Limited Business Partnership                                           |
| **se_cn**                  | General Partnership                                   |
| **se_cs**                  | Limited Partnership                               |
| **se_ca**	                 | Partnership Limited by Shares                              |
| **scp**                    | Silent Partnership                                      |
| **ei**	                    | Individual Entrepreneur                                                    |
| **ese**	                   | Branch Office in Brazil of Foreign Company                     |
| **eeab**	                  | Branch Office in Brazil of Argentine-Brazilian Binational Company   |
| **ssp**                    | Simple Partnership                                                  |
| **ss_ltda**	               | Limited Simple Partnership                                               |
| **ss_cn**                  | Simple General Partnership                                      |
| **ss_cs**                  | Simple Limited Partnership                                  |
| **eireli_ne**              | Individual Limited Liability Company (Business Nature) |
| **eireli_ns**              | Individual Limited Liability Company (Simple Nature)   |
| **eireli**                 | Individual Limited Liability Company                                  |
| **mei**                    | Individual Microentrepreneur                                            |
| **me**	                    | Micro Enterprise                                                            |
| **cop**	                   | Cooperative                                                              |
| **private_association**	   | Private Association        
| **association**	   | Association                                                   |
| **others**	   | Others  |

### marital_status Enumerators
| Enum         | 	Description  |
|--------------|---------------|
| **single**   | Single   |
| **married**  | Married    |
| **widower**  | Widowed     |
| **divorced** | Divorced |
| **separated** | Separated |

## Response

STATUS 201

Response Body

```json
{
    "account_key": "e48eb139-448e-43b9-9aee-df5f4b51158c"
}
```

:::warning Attention
 The `account_key` will be the account's unique identification key. All account interactions will be performed through it.

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`  | Description (eng)<br/>`description` | Description(ptbr) <br></br>`translation`|
|---| --- | --- | --- | --- | 
| 400 | QIT000001 | Bad Request | Schema Error | Schema Error|
| 404 | QIT000404 | Not Found | Resource could not be found | Resource not found|

---

# Individual Account Opening

URL: /en/documentation/baas/escrow/reservar_conta_pf

Account opening occurs in two mandatory stages. First, a POST request sends preliminary data to reserve the account. Then, a webhook of type `account_request.status_change` with status `pending_additional_data` is triggered. In the second stage, a PATCH request finalizes the opening, making the account official with the complementary information.

## Request Account Reservation

## Request 
ENDPOINT /account_request/escrow
METHOD POST

Request Body

```json
{
    "account_owner": {
        "document_number": "64669455000187",
        "email": "marcos.alves@yopmail.com",
        "birthdate": "2017-09-16",
        "name": "NOME",
        "documents": {
            "rg": {
                "ocr_front_key": "9d6fefc0-77c9-4acc-8526-53523ff155b9",
                "ocr_back_key": "30157d15-3b93-46ad-9c94-cd8bd533f9ed"
            },
            "cnh": {
                "ocr_key": "f30cea56-dd66-415b-9a28-746f7330b708"
            }
        },
        "face": "dbdaf3c9-cdf6-4737-8551-92910b213b7e"
    }
}
```

:::info CPF/CNPJ Mock
To simulate approval, rejection, and manual review situations, the first digit of the account owner's CPF/CNPJ can be used:

0 to 6 -> Manual Review

7 -> Rejected by bacen protege+

8 -> Automatically rejected in KYC

9 -> Automatic Approval
:::

### Request Body Params

| Field | Type | Description | Characters |
|---|---| ---|---|
| `account_owner` * | object  | Object containing Account Holder information | **[account_owner object](#account_owner-object)** |

### account_owner object
| Field | Type | Description | Characters |
|--- | --- | --- | --- |
| `document_number` * | string  | Account Holder's CPF | 11 |
| `email` * | string  | Account Holder's Email | 200 |
| `birthdate` | string  | 	Date of birth. (YYYY-MM-DD format) | 10 |
| `name` * | string  | Account Holder's Name | 50 |
| `documents` *| object  | Account holder's document(s) | **[documents object](#documents-object)** |
| `face` *     | uuidv4  | Facial recognition key from antifraud (`face_recognition_key`) | 36 |

### documents object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `rg`                           | object      | OCR keys for front and back upload of holder's RG | **[rg object](#rg-object)**   |
| `cnh`                          | object      | OCR key for holder's CNH upload                              | **[cnh object](#cnh-object)** |
| `cnh_digital`                     | object      | OCR key for holder's digital CNH upload                       | **[cnh_digital object](#cnh_digital-object)** |
| `national_registry_of_foreigners` | object   | OCR keys for front and back upload of holder's RNE| **[national_registry_of_foreigners object](#national_registry_of_foreigners-object)** |
| `national_migration_registry` | object   | OCR keys for front and back upload of holder's CRNM| **[national_migration_registry object](#national_migration_registry-object)** |
| `passport`                     | object      | OCR key for holder's passport upload                       | **[passport object](#passport-object)** |
| `cin_digital`                     | object      | OCR key for holder's digital National Identity Card upload                       | **[cin_digital object](#cin_digital-object)** |

:::info Information
The OCR keys (`ocr_key` or `ocr_front_key` and `ocr_back_key`) for document image uploads are provided as a response from the image upload in antifraud. The `face_recognition_key` is returned in the facial recognition response.
:::

### rg object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_front_key` *              | uuidv4      | OCR key for RG front image upload                      | 36                            |
| `ocr_back_key` *               | uuidv4      | OCR key for RG back image upload                       | 36                            |

OR

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key for RG image upload                                | 36                       |

### cnh object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_front_key` *              | uuidv4      | OCR key for CNH front image upload                     | 36                            |
| `ocr_back_key` *               | uuidv4      | OCR key for CNH back image upload                      | 36                            |

OR

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key for CNH image upload                               | 36                            |

### cnh_digital object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key for digital CNH image upload                               | 36                            |

### national_registry_of_foreigners object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_front_key` *              | uuidv4      | OCR key for RNE front image upload                     | 36                            |
| `ocr_back_key` *               | uuidv4      | OCR key for RNE back image upload                      | 36                            |

OR

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key for RNE image upload                               | 36                            |

### national_migration_registry object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_front_key` *              | uuidv4      | OCR key for CRNM front image upload                     | 36                            |
| `ocr_back_key` *               | uuidv4      | OCR key for CRNM back image upload                      | 36                            |

OR

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key for CRNM image upload                               | 36                            |

### passport object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key for passport image upload                               | 36                            |

### cin_digital object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key for digital National Identity Card image upload                               | 36                            |

## Response

STATUS 201

Response Body

```json
{
    "account_info": {
        "account_branch": "0001",
        "account_digit": "0",
        "account_number": "1693580"
    },
    "account_request_key": "f230f1b5-07af-4737-b0e3-8a472304f5e7",
    "account_request_status": "pending_bacen_validation"
}
```

:::info Bacen Protege+ Flow
The proposal starts with status `pending_bacen_validation`. The system performs a preliminary validation with Bacen Protege+ before proceeding with KYC analysis. After Bacen approval, the status will be automatically updated to `pending_kyc_analysis`.
:::

:::warning Warning
 The `account_request_key` field must be stored and will be used for account opening confirmation.
:::

### Response Body Params

| Field | Type | Description | Characters|
|---|---| ---|---|
| `account_info` * | object  | Object containing Account Holder information |**[account_info object](#account_info-object)**  | - |
| `account_request_key` * | string  | Creation request identification key | - | - |
| `account_request_status` * | string  | KYC Status | - | - |

### account_info object
| Field | Type | Description | Characters |
|---|---| ---| --- |
| `account_branch` * | string  | Branch Number | 4 |
| `account_digit` * | string  | Account Digit | 11 |
| `account_number` * | string  | Account Number | 50 |

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`  | Description (eng)<br/>`description` | Description(ptbr) <br></br>`translation`|
|---| --- | --- | --- | --- | 
| 400 | QIT000001 | Bad Request | Schema Error | Erro de Schema|
| 404 | QIT000404 | Not Found | Resource could not be found | Recurso não encontrado|

---

# Business Account Opening

URL: /en/documentation/baas/escrow/reservar_conta_pj

Business account opening occurs in two mandatory steps. First, a POST request sends preliminary data to reserve the account. Then, a webhook of type `account_request.status_change` with the status `pending_additional_data` is triggered. In the second step, a PATCH request finalizes the opening, officially establishing the account with the complementary information.

## Request Account Reservation

## Request
ENDPOINT /account_request/escrow
METHOD POST

Request Body

```json
{
    "account_owner": {
        "company_document_number": "99999999999",
        "email": "email@teste.com",
        "foundation_date": "2017-09-16",
        "name": "Nome da Empresa"
    },
    "legal_representatives": [
        {
            "birthdate": "1963-07-23",
            "name": "Don Corleone",
            "document_number": "03912394323",
            "documents": {
                "national_registry_of_foreigners": {
                    "ocr_front_key": "0aa8a4ca-5873-49bd-851c-1f2c71a1cc28",
                    "ocr_back_key": "29f6e346-7fae-4dcb-9ea1-2a3e4ef593ea"
                }
            },
            "face": "68da08f1-6cf4-4dce-a297-7b2f09311784"
        },
        {
            "birthdate": "1996-03-10",
            "name": "John Doe",
            "document_number": "39113492093",
            "documents": {
                "cnh": {
                    "ocr_key": "beee557e-9240-4c5b-88f1-42812b195168"
                }
            }
        }
    ]
}
```

:::info CPF/CNPJ Mock
To simulate approval, rejection, and manual analysis situations, the first digit of the account owner's CPF/CNPJ can be used:

0 to 6 -> Manual Analysis

7 -> Rejected by bacen protege+

8 -> Automatically rejected in KYC

9 -> Automatic Approval
:::

### Request Body Params

| Field | Type | Description | Characters |
|---|---| ---|---|
| `account_owner` * | object  | Object containing the Account Holder's information | **[account_owner Object](#account_owner-object)** |
| `legal_representatives` | object array | List of account representatives and their data | **[legal_representative Object](#legal_representative-object)** |

### account_owner Object
| Field | Type | Description | Characters |
|--- | --- | --- | --- |
| `"company_document_number"` * | string  | Account Holder's CNPJ | 14 |
| `email` * | string  | Contract holder company's email | 200 |
| `foundation_date` | string  | Company opening date (YYYY-MM-DD format) | 10 |
| `name` * | string  | Company Name | 50 |

### legal_representative Object

| Field | Type | Description | Characters |
|--- | --- | --- | --- |
| `document_number` * | string  | Account Holder's CPF | 11 |
| `birthdate` | string  | 	Birth date. (YYYY-MM-DD format) | 10 |
| `name` * | string  | Account Holder's Name | 50 |
| `documents` * | object  | Account holder's document(s) | **[documents Object](#documents-object)** |
| `face`      | uuidv4  | Face recognition key made with antifraud (`face_recognition_key`) | 36 |

### documents Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `rg`                           | object      | OCR keys for front and back RG upload of the holder | **[rg Object](#rg-object)**   |
| `cnh`                          | object      | OCR key for holder's CNH upload                              | **[cnh Object](#cnh-object)** |
| `cnh_digital`                     | object      | OCR key for holder's digital CNH upload                       | **[cnh_digital Object](#cnh_digital-object)** |
| `national_registry_of_foreigners` | object   | OCR keys for front and back RNE upload of the holder| **[national_registry_of_foreigners Object](#national_registry_of_foreigners-object)** |
| `national_migration_registry` | object   | OCR keys for front and back CRNM upload of the holder| **[national_migration_registry Object](#national_migration_registry-object)** |
| `passport`                     | object      | OCR key for holder's passport upload                       | **[passport Object](#passport-object)** |
| `cin_digital`                     | object      | OCR key for holder's digital National Identity Card upload                       | **[cin_digital Object](#cin_digital-object)** |

:::info Information
The OCR keys (`ocr_key` or `ocr_front_key` and `ocr_back_key`) for document image uploads are provided as a response from uploading images to antifraud. The `face_recognition_key` is returned in the face recognition response.
:::

### rg Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_front_key` *              | uuidv4      | OCR key for RG front image upload                      | 36                            |
| `ocr_back_key` *               | uuidv4      | OCR key for RG back image upload                       | 36                            |

OR

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key for RG image upload                                | 36                       |

### cnh Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_front_key` *              | uuidv4      | OCR key for CNH front image upload                     | 36                            |
| `ocr_back_key` *               | uuidv4      | OCR key for CNH back image upload                      | 36                            |

OR

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key for CNH image upload                               | 36                            |

### cnh_digital Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key for digital CNH image upload                               | 36                            |

### national_registry_of_foreigners Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_front_key` *              | uuidv4      | OCR key for RNE front image upload                     | 36                            |
| `ocr_back_key` *               | uuidv4      | OCR key for RNE back image upload                      | 36                            |

OR

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key for RNE image upload                               | 36                            |

### national_migration_registry Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_front_key` *              | uuidv4      | OCR key for CRNM front image upload                     | 36                            |
| `ocr_back_key` *               | uuidv4      | OCR key for CRNM back image upload                      | 36                            |

OR

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key for CRNM image upload                               | 36                            |

### passport Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key for passport image upload                               | 36                            |

### cin_digital Object

| Field                          | Type        | Description                                                          | Characters                    |
|--------------------------------|-------------|--------------------------------------------------------------------|-------------------------------|
| `ocr_key` *                    | uuidv4      | OCR key for digital National Identity Card image upload                               | 36                            |

## Response

STATUS 201

Response Body

```json
{
    "account_info": {
        "account_branch": "0001",
        "account_digit": "0",
        "account_number": "1693580"
    },
    "account_request_key": "f230f1b5-07af-4737-b0e3-8a472304f5e7",
    "account_request_status": "pending_bacen_validation"
}
```

:::info Bacen Protege+ Flow
The proposal starts with status `pending_bacen_validation`. The system performs a preliminary validation with Bacen Protege+ before proceeding with KYC analysis. After Bacen approval, the status will be automatically updated to `pending_kyc_analysis`.
:::

:::warning Attention
 The `account_request_key` field must be stored and will be used for account opening confirmation.
:::

### Response Body Params

| Field | Type | Description | Characters|
|---|---| ---|---|
| `account_info` * | object  | Object containing the Account Holder's information |**[account_info Object](#account_info-object)**  | - |
| `account_request_key` * | string  | Creation request identification key | - | - |
| `account_request_status` * | string  | KYC Status | - | - |

### account_info Object
| Field | Type | Description | Characters |
|---|---| ---| --- |
| `account_branch` * | string  | Branch Number | 4 |
| `account_digit` * | string  | Account Digit | 11 |
| `account_number` * | string  | Account Number | 50 |

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`  | Description (eng)<br/>`description` | Description(ptbr) <br></br>`translation`|
|---| --- | --- | --- | --- | 
| 400 | QIT000001 | Bad Request | Schema Error | Erro de Schema|
| 404 | QIT000404 | Not Found | Resource could not be found | Recurso não encontrado|

---

# Account Opening Webhooks

URL: /en/documentation/baas/escrow/webhooks

After the account reservation request call, a webhook of type account_request.status_change is sent with the status pending_additional_data. This event serves as the trigger for sending the request to confirm account opening.

The account opening request response may return the status "pending_kyc_analysis" depending on the partner's integration configuration.

In this case, the response regarding account opening approval or rejection will be returned asynchronously via webhook.

The account number will be reserved at the moment of the opening request, however at this moment **the account will not yet be open**. Only after completion of QI Tech's KYC analysis will the account be open.

## Webhook Pending KYC Analysis

After Bacen Protege+ approval, the account opening request status is updated to `pending_kyc_analysis` and a webhook is sent to notify the partner.

WEBHOOK_TYPE account_request.status_change
STATUS pending_kyc_analysis

Webhook Body

```json
{
    "data": {
        "account_info": {
            "account_digit": "3",
            "account_branch": "0001",
            "account_number": "1638634"
        },
        "account_request_key": "dc575950-dcce-48e1-99a6-5fb0ada63d86",
        "status": "pending_kyc_analysis"
    },
    "event_datetime": "2022-09-02 22:39:39",
    "key": "dc575950-dcce-48e1-99a6-5fb0ada63d86",
    "status": "pending_kyc_analysis",
    "webhook_type": "account_request.status_change"
}
```

## KYC Approval Webhook

Webhook Body

```json
{
    "data": {
        "account_info": {
            "account_digit": "3",
            "account_branch": "0001",
            "account_number": "1638634"
        },
        "account_request_key": "dc575950-dcce-48e1-99a6-5fb0ada63d86"
    },
    "event_datetime": "2022-09-02 22:39:39",
    "key": "dc575950-dcce-48e1-99a6-5fb0ada63d86",
    "status": "pending_additional_data",
    "webhook_type": "account_request.status_change"
}
```

### Account Request Status Enumerators
| Enum                        | Description                    |
|-----------------------------|--------------------------------|
| **pending_kyc_analysis**    | Pending KYC approval           |
| **pending_additional_data** | Pending additional information |
| **rejected**                | Opening rejected               |

## Legal Entity Accounts

# Account Rejected

WEBHOOK_TYPE account
STATUS account_rejected

Webhook Body

```json
{
	"data": {
		"account_info": {
			"account_digit": "2",
			"account_branch": "0001",
			"account_number": "2359934",
			"financial_institution_code": "329"
		},
		"allowed_user": {
			"name": "Juliana Tereza Bernardes",
			"document_number": "97564480084"
		},
		"account_owner": {
			"name": "VOVO LUCIA CONVENIENCIA LTDA",
			"document_number": "09080702000105"
		}
	},
	"event_datetime": "2022-09-02 22:39:39",
	"key": "dc575950-dcce-48e1-99a6-5fb0ada63d86",
	"status": "account_rejected",
	"webhook_type": "account"
}
```

## Individual Accounts

# Account Rejected

WEBHOOK_TYPE account
STATUS account_rejected

Webhook Body

```json
{
    "key":"84864614-2860-4b78-bd44-77b961354014",
  	"data":{
        "account_info":{
            "account_key":"1435dbavf-2860-4b78-bd44-77b961354014",
            "account_digit":"5",
            "account_branch":"0001",
            "account_number":"3998360",
            "financial_institution_code":"329"
        },
        "account_owner":{
            "name":"Pedro Pinho",
            "document_number":"97634408077"
        }
      },
    "status":"account_rejected",
    "webhook_type":"account",
    "event_datetime":"2024-01-09 14:35:46"
}
```

---

# baas_consulta_de_instituicoes_financeiras

URL: /en/documentation/baas/lista_de_instituicoes_financeiras/baas_consulta_de_instituicoes_financeiras



---

# baas_configuracao_de_notificacao

URL: /en/documentation/baas/notificacoes/baas_configuracao_de_notificacao



---

# baas_configuracao_template

URL: /en/documentation/baas/notificacoes/baas_configuracao_template



---

# baas_introducao

URL: /en/documentation/baas/notificacoes/baas_introducao



---

# baas_reenvio_de_notificacoes

URL: /en/documentation/baas/notificacoes/baas_reenvio_de_notificacoes



---

# baas_template

URL: /en/documentation/baas/notificacoes/baas_template



---

# baas_tipos_de_evento

URL: /en/documentation/baas/notificacoes/baas_tipos_de_evento



---

# Remittance file upload (CNAB)

URL: /en/documentation/baas/pagamento_em_lote/envio_de_remessa

:::caution Attention!
The call must be authenticated following the standard described in the [**Document upload**](/documentation/upload_de_documentos) section.
:::

## Request

ENDPOINT /payments/account/ ACCOUNT_KEY /remittance
METHOD POST

### Path parameters

| Field                   | Type   | Description                                                  | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format        | 36         |

## Request Body Params

The following data must be sent as form-data in the request body:

| Field                   | Type   | Description                                                  | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `file` *                | file   | CNAB file in the standard stipulated by QI Tech             | -          |

## Response

STATUS 202

Response Body
```json
{
  "cnab_remittance_key": "f14e9bac-94ed-4eb1-87b4-7fd7b7a2d280",
  "cnab_remittance_status": "accepted"
}
```

### Response Body Params

| Field                          | Type    | Description                                                     | Characters                 |
|--------------------------------|---------|-----------------------------------------------------------------|----------------------------|
| `cnab_remittance_key` *    | uuidv4  | Unique CNAB file identification key in uuid v4 format          | 36                         |
| `cnab_remittance_status` * | string  | CNAB file status | **[cnab_remittance_status enumerators](#enumeradores-cnab_file_status)** |

### cnab_remittance_status enumerators

| Enumerator | Description                                                               |
|------------|---------------------------------------------------------------------------|
| uploaded   | Upload successful, but file hasn't started processing yet                |
| processing | File being read                                                           |
| accepted   | File read and accepted                                                    |
| rejected   | File read and rejected (all file occurrences are rejected)               |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                  | Description (eng)<br/>`description`                                                                                     | Description (ptbr)<br/>`translation`                                                                                  |
|------------------------|--------------------|----------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|
| 400                    | QIT000001          | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                        |
| 409                    | PAP000002          | Conflict                                           | CNAB file alredy received                                                                                               | Arquivo CNAB já recebido                                                                                              |
| 400                    | PAP000003          | Bad Request                                        | Invalid file name '`<file_name>`' . Please do not use specials characters like '!', '@', '(', ')', '$'.              | Nome de arquivo invalido '`<file_name>`'. Favor não utilizar caracteres especiais como '!', '@', '(', ')', '$'."    |
| 403                    | PAP000004          | Forbidden                                          | Usuario não tem autorização para fazer essa ação                                                                       | User is not allowed to do this action                                                                                 |
| 404                    | PAP000005          | Not Found                                          | The source account key was not found                                                                                    | A chave da conta de origem não foi encontrada                                                                         |

---

# Introduction to CNAB240 Batch Transaction

URL: /en/documentation/baas/pagamento_em_lote/introducao

QI Tech, through the Payments API, enables payments using the CNAB240 format, supporting different types of transactions, such as boletos, PIX and TED, in a single call. This system enables batch payment execution, ensuring greater efficiency for high-volume financial processes.

Payments are processed asynchronously, with rigorous validations during CNAB240 file submission. If the initial request results in an HTTP status 4xx, no payment will be processed.

After submission, the file can be approved or rejected. If rejected, the API will return a detailed list of errors related to file formatting, allowing the integrator to make necessary corrections before attempting to send again. The file will be rejected if any syntactic error is found. However, it is read in its entirety, or until a limit of 100 errors is found, so that all errors can be returned and corrected in a more practical and efficient manner.

While the file is being read, occurrences are added to a queue, but will only be processed if it is accepted. That is, if the file is rejected (status rejected), all its occurrences will also be discarded. On the other hand, the moment the file is completely read and accepted (status accepted), processing of these occurrences begins, ensuring continuity of transactions based on the provided data.

---

# Query Payment Batch Data by Account

URL: /en/documentation/baas/pix_automatico/conciliacao/consultar_lote_por_conta

## Request

ENDPOINT /account/ ACCOUNT_KEY /payment_order_conciliation_batch/ PAYMENT_ORDER_CONCILIATION_BATCH_KEY
METHOD GET

### Path Params

| Field                    | Type   | Description                                       | Characters |
|--------------------------|--------|---------------------------------------------------|------------|
| **`ACCOUNT_KEY`** *          | uuidv4 | Unique account identification key.                | 36         |
| **`PAYMENT_ORDER_CONCILIATION_BATCH_KEY`***| uuidv4 | Unique batch identification key.            | 36         |

## Response

STATUS 200

Response Body

```json
{
  "payment_order_conciliation_batch_status": "open",
  "payment_order_conciliation_batch_type": "fixed_amount",
  "total_amount": 1000.00,
  "conciliated_amount": 500.00,
  "total_payment_orders": 10,
  "conciliated_payment_orders": 5,
  "reference_date": "2025-06-13",
  "created_at": "2025-06-10T20:30:23.459Z"
}
```

### Response Body Params

| Field                                    | Type       | Description                                                    | Characters |
|------------------------------------------|------------|----------------------------------------------------------------|------------|
| `payment_order_conciliation_batch_status`| enumerator | Payment order conciliation batch status.                       | [payment_order_conciliation_batch_status Enumerators](#payment_order_conciliation_batch_status-enumerators) |
| `payment_order_conciliation_batch_type`  | enumerator | Payment order conciliation batch type.                        | [payment_order_conciliation_batch_type Enumerators](#payment_order_conciliation_batch_type-enumerators) |
| `total_amount`                           | number     | Total value of the conciliation batch in reais (R$).           | -          |
| `conciliated_amount`                     | number     | Already conciliated value of the batch in reais (R$).          | -          |
| `total_payment_orders`                   | integer    | Total number of payment orders in the batch.                   | -          |
| `conciliated_payment_orders`             | integer    | Number of payment orders already conciliated in the batch.     | -          |
| `reference_date`                         | string     | Batch reference date (ISO 8601 format, e.g., "2025-06-13").   | 10         |
| `created_at`                             | string     | Batch creation date and time (ISO 8601 format).                | -          |

### payment_order_conciliation_batch_status Enumerators

| Enumerator   | Description                                 |
|--------------|---------------------------------------------|
| `open`       | Open conciliation batch                    |
| `closed`     | Closed conciliation batch                  |
| `processing` | Conciliation batch in processing           |
| `completed`  | Completed conciliation batch               |
| `cancelled`  | Cancelled conciliation batch               |

### payment_order_conciliation_batch_type Enumerators

| Enumerator        | Description                                 |
|-------------------|---------------------------------------------|
| `fixed_amount`    | Fixed amount conciliation batch            |
| `variable_amount` | Variable amount conciliation batch         |

STATUS 4XX

Response Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em português",
  "code": "codigo"
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`                | Description (eng)<br/>`description`                                          | Description (ptbr)<br/>`translation`                                 |
|-------------|----------------------|-----------------------------------|----------------------------------------------------------------------------|--------------------------------------------------------------------|
| 400         | QIT000002            | Bad Request                       | Invalid request schema.                                                    | Erro no esquema da requisição.                                     |
| 404         | APX000003            | Conciliation Batch Not Found      | Conciliation batch \{conciliation_batch_key\} not found.                   | Lote de conciliação \{conciliation_batch_key\} não encontrado.      |

---

# Query Payment Batches by Requester

URL: /en/documentation/baas/pix_automatico/conciliacao/consultar_lote_requester

## Request

ENDPOINT /payment_order_conciliation_batches
METHOD GET

### Query Params

| Field                                    | Type       | Description                                                    | Required |
|------------------------------------------|------------|----------------------------------------------------------------|----------|
| `payment_order_conciliation_batch_status`| enumerator | Filter by conciliation batch status.                          | No       |
| `payment_order_conciliation_batch_type`  | enumerator | Filter by conciliation batch type.                            | No       |
| `page`                                   | integer    | Page number for pagination (default: 1).                      | No       |
| `page_size`                              | integer    | Page size for pagination (default: 25).                       | No       |
| `from_date`                              | string     | Start date for filter (ISO 8601 format, e.g., "2025-06-01"). | No       |
| `to_date`                                | string     | End date for filter (ISO 8601 format, e.g., "2025-06-30").   | No       |

## Response

STATUS 200

Response Body

```json
{
    "payment_order_conciliation_batches": [
        {
            "payment_order_conciliation_batch_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
            "payment_order_conciliation_batch_status": "closed",
            "payment_order_conciliation_batch_type": "fixed_amount",
            "account_key": "9b9ae7b0-7292-4b0d-9131-0167525ab067",
            "total_amount": 1200,
            "conciliated_amount": 1200,
            "total_payment_orders": 12,
            "conciliated_payment_orders": 12,
            "reference_date": "2025-06-13",
            "created_at": "2025-06-10T20:30:23.459Z"
        },
        {
            "payment_order_conciliation_batch_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
            "payment_order_conciliation_batch_status": "closed",
            "payment_order_conciliation_batch_type": "variable_amount",
            "account_key": "9b9ae7b0-7292-4b0d-9131-0167525ab067",
            "total_amount": 700,
            "conciliated_amount": 600,
            "total_payment_orders": 7,
            "conciliated_payment_orders": 6,
            "reference_date": "2025-06-13",
            "created_at": "2025-06-10T20:30:23.459Z"
        },
        {
            "payment_order_conciliation_batch_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
            "payment_order_conciliation_batch_status": "open",
            "payment_order_conciliation_batch_type": "variable_amount",
            "account_key": "9b9ae7b0-7292-4b0d-9131-0167525ab067",
            "total_amount": 900,
            "conciliated_amount": 700,
            "total_payment_orders": 9,
            "conciliated_payment_orders": 7,
            "reference_date": "2025-06-17",
            "created_at": "2025-06-10T20:30:23.459Z"
        },
        {
            "payment_order_conciliation_batch_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
            "payment_order_conciliation_batch_status": "closed",
            "payment_order_conciliation_batch_type": "fixed_amount",
            "account_key": "c24a0ac4-792c-494e-b887-6185e07a33a3",
            "total_amount": 800,
            "conciliated_amount": 800,
            "total_payment_orders": 8,
            "conciliated_payment_orders": 8,
            "reference_date": "2025-06-13",
            "created_at": "2025-06-10T20:30:23.459Z"
        },
        {
            "payment_order_conciliation_batch_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
            "payment_order_conciliation_batch_status": "open",
            "payment_order_conciliation_batch_type": "variable_amount",
            "account_key": "c24a0ac4-792c-494e-b887-6185e07a33a3",
            "total_amount": 1000,
            "conciliated_amount": 500,
            "total_payment_orders": 10,
            "conciliated_payment_orders": 5,
            "reference_date": "2025-06-17",
            "created_at": "2025-06-10T20:30:23.459Z"
        }
    ],
    "pagination": {
        "page": 1,
        "page_size": 25,
        "number_of_pages": 1
    }
}
```

### Response Body Params

| Field                                | Type  | Description                                                  | Characters |
|--------------------------------------|-------|--------------------------------------------------------------|------------|
| `payment_order_conciliation_batches` | array | List of payment order conciliation batches.                 | [Array payment_order_conciliation_batches](#array-payment_order_conciliation_batches) |
| `pagination`                         | object| Query pagination information.                                | [Object pagination](#objeto-pagination) |

### Array payment_order_conciliation_batches

| Field                                    | Type       | Description                                                    | Characters |
|------------------------------------------|------------|----------------------------------------------------------------|------------|
| `payment_order_conciliation_batch_key`   | uuidv4     | Unique identifier of the conciliation batch.                  | 36         |
| `payment_order_conciliation_batch_status`| enumerator | Status of the payment order conciliation batch.                | [Enumerators payment_order_conciliation_batch_status](#enumeradores-payment_order_conciliation_batch_status) |
| `payment_order_conciliation_batch_type`  | enumerator | Type of the payment order conciliation batch.                 | [Enumerators payment_order_conciliation_batch_type](#enumeradores-payment_order_conciliation_batch_type) |
| `account_key`                            | uuidv4     | Unique account identification key.                             | 36         |
| `total_amount`                           | number     | Total amount of the conciliation batch in Brazilian reais (R$). | -          |
| `conciliated_amount`                     | number     | Already conciliated amount of the batch in Brazilian reais (R$). | -          |
| `total_payment_orders`                   | integer    | Total number of payment orders in the batch.                   | -          |
| `conciliated_payment_orders`             | integer    | Number of payment orders already conciliated in the batch.     | -          |
| `reference_date`                         | string     | Reference date of the batch (ISO 8601 format, e.g., "2025-06-13"). | 10         |
| `created_at`                             | string     | Batch creation date and time (ISO 8601 format).                | -          |

### Object pagination

| Field             | Type    | Description                                        | Characters |
|-------------------|---------|-----------------------------------------------------|------------|
| `page`            | integer | Current page of the query.                         | -          |
| `page_size`       | integer | Page size (number of items per page).             | -          |
| `number_of_pages` | integer | Total number of available pages.                   | -          |

### Enumerators payment_order_conciliation_batch_status

| Enumerator   | Description                                     |
|--------------|-------------------------------------------------|
| `open`       | Open conciliation batch                         |
| `closed`     | Closed conciliation batch                       |
| `processing` | Conciliation batch in processing               |
| `completed`  | Completed conciliation batch                   |
| `cancelled`  | Cancelled conciliation batch                   |

### Enumerators payment_order_conciliation_batch_type

| Enumerator        | Description                                     |
|-------------------|-------------------------------------------------|
| `fixed_amount`    | Fixed amount conciliation batch                 |
| `variable_amount` | Variable amount conciliation batch              |

STATUS 4XX

Response Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em português",
  "code": "codigo"
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`                | Description (eng)<br/>`description`                                          | Description (ptbr)<br/>`translation`                                 |
|-----------|--------------------|---------------------------------|----------------------------------------------------------------------------|--------------------------------------------------------------------|
| 400       | QIT000002          | Bad Request                     | Invalid request schema.                                                    | Erro no esquema da requisição.                                     |
| 404       | APX000003          | Conciliation Batch Not Found    | Conciliation batch not found.                                              | Lote de conciliação não encontrado.                                |

---

# Payment Listing for an Account

URL: /en/documentation/baas/pix_automatico/conciliacao/listar_payment_orders

## Request

ENDPOINT /account/ ACCOUNT_KEY /payment_order_conciliation_batch/ PAYMENT_ORDER_CONCILIATION_BATCH_KEY /payment_orders
METHOD GET

### Query Params

| Field                  | Type       | Description                                                                    | Characters |
|------------------------|------------|--------------------------------------------------------------------------------|------------|
| `payment_order_status` | enumerator | Filters payments by status (e.g., `processed`, `pending`, `failed`).          | 30         |
| `page`                 | integer    | Page number to be returned (pagination).                                      | -          |
| `page_size`            | integer    | Number of items per page (pagination).                                        | -          |

## Response

STATUS 200

Response Body

```json
{
  "payment_orders": [
    {
      "payment_order_key": "a1b2c3d4-e5f6-7890-ghij-1234567890kl",
      "payment_order_status": "processed",
      "amount": 150.75,
      "currency": "BRL",
      "transaction_date": "2023-10-05",
      "recipient_data": {
        "name": "Maria Silva",
        "document_number": "12345678900",
        "bank_account": {
          "account_number": "987654",
          "account_digit": "2",
          "account_branch": "1234",
          "ispb": "12345678"
        }
      },
      "pix_key": "maria@example.com",
      "pix_message": "Pagamento ref. Fatura 123",
      "conciliation_id": "uuid-conciliation"
    }
  ],
  "pagination": {
    "page": 1,
    "page_size": 25,
    "number_of_pages": 3
  }
}
```

## Response Body Params

| Field           | Type   | Description                                             | Characters |
|-----------------|--------|---------------------------------------------------------|------------|
| `payment_orders`| array  | List of payment order objects.                         | [Array payment_orders](#array-payment_orders) |
| `pagination`    | object | Pagination object containing results information.       | [Object pagination](#object-pagination)         |

---

### Array payment_orders

| Field                 | Type       | Description                                                             | Characters |
|-----------------------|------------|-------------------------------------------------------------------------|------------|
| `payment_order_key`   | uuidv4     | Unique identifier of the payment order.                                | 36         |
| `payment_order_status`| string     | Payment order status (`processed`, `pending`, `failed`, etc.).         | 30         |
| `amount`              | number     | Payment order amount in reais (R$).                                    | -          |
| `currency`            | string     | Payment currency.                                                       | 3          |
| `transaction_date`    | string     | Transaction date (ISO 8601 format, e.g., `2023-10-05`).                | 10         |
| `recipient_data`      | object     | Payment recipient data.                                                 | [Object recipient_data](#object-recipient_data) |
| `pix_key`             | string     | Recipient's Pix key.                                                    | 77         |
| `pix_message`         | string     | Message sent with the Pix transaction.                                  | 140        |
| `conciliation_id`     | string     | Payment conciliation identifier.                                        | 36         |

---

### Object recipient_data

| Field             | Type   | Description                 | Characters |
|-------------------|--------|-----------------------------|------------|
| `name`            | string | Recipient's name.           | 50         |
| `document_number` | string | Recipient's CPF or CNPJ.    | 14         |
| `bank_account`    | object | Recipient's bank account data. | [Object bank_account](#object-bank_account) |

---

### Object bank_account

| Field           | Type   | Description                      | Characters |
|-----------------|--------|----------------------------------|------------|
| `account_number`| string | Account number.                  | -          |
| `account_digit` | string | Account digit.                   | -          |
| `account_branch`| string | Branch.                          | -          |
| `ispb`          | string | Financial institution ISPB.      | -          |

### Object pagination

| Field            | Type    | Description                         | Characters |
|------------------|---------|-------------------------------------|------------|
| `page`           | integer | Returned page number.               | -          |
| `page_size`      | integer | Number of items per page.           | -          |
| `number_of_pages`| integer | Total available pages.              | -          |

### Enumerators payment_order_status

| Enumerator            | Description                                        |
|-----------------------|----------------------------------------------------|
| `pending_conciliation`| Awaiting conciliation.                            |
| `pending`             | Pending and not yet processed.                    |
| `accepted`            | Accepted and awaiting payment.                     |
| `paid`                | Successfully paid.                                 |
| `rejected`            | Rejected and will not be processed.               |
| `cancelled`           | Cancelled before payment.                         |

STATUS 4XX

Response Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em português",
  "code": "codigo"
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`                | Description (eng)<br/>`description`                                        | Description (ptbr)<br/>`translation`                               |
|-----------|--------------------|---------------------------------|----------------------------------------------------------------------------|--------------------------------------------------------------------|
| 400       | QIT000002          | Bad Request                     | Invalid request schema.                                                    | Erro no esquema da requisição.                                     |
| 404       | APX000002          | Payment Order Not Found         | Payment order \{payment_order_key\} not found.                             | Pedido de pagamento \{payment_order_key\} não encontrado.           |

---

# Payment Order Conciliation Batch Creation Webhook

URL: /en/documentation/baas/pix_automatico/conciliacao/webhooks

Webhook notifications are essential for processing events about payment conciliation in Automatic Pix. This webhook informs about the creation of payment order conciliation batches.

## Conciliation Batch Creation Webhook

This webhook is issued when a new payment order conciliation batch is created.

:::danger Attention!
QI Tech webhooks should not be mapped in a restrictive way.
Additional fields may be included in the webhook payloads returned by our APIs.
:::

### Webhook Request Body

Request Body: Journey 1

```json
{
    "webhook_type": "baas.automatic_pix.payment_order_conciliation_batch.creation",
    "webhook_datetime": "2021-10-22T20:30:23.459Z",
    "data": {
        "payment_order_conciliation_batches": [
            {
                "payment_order_conciliation_batch_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
                "payment_order_conciliation_batch_status": "open",
                "payment_order_conciliation_batch_type": "fixed_amount",
                "account_key": "uuid",
                "total_amount": 0,
                "conciliated_amount": 0,
                "total_payment_orders": 0,
                "conciliated_payment_orders": 0,
                "reference_date": "2025-06-13",
                "created_at": "2025-06-10T20:30:23.459Z"
            },
            {
                "payment_order_conciliation_batch_key": "99fc62fd-b0a0-4604-9bea-475e91a9dc82",
                "payment_order_conciliation_batch_status": "open",
                "payment_order_conciliation_batch_type": "variable_amount",
                "account_key": "uuid",
                "total_amount": 0,
                "conciliated_amount": 0,
                "total_payment_orders": 0,
                "conciliated_payment_orders": 0,
                "reference_date": "2025-06-13",
                "created_at": "2025-06-10T20:30:23.459Z"
            }
        ]
    }
}
```

### Webhook Body Params

| Field             | Type    | Description                                                                                   | Characters |
|-------------------|---------|-----------------------------------------------------------------------------------------------|------------|
| `webhook_type` *  | string  | Webhook event type (`baas.automatic_pix.payment_order_conciliation_batch.creation`).         | 100        |
| `webhook_datetime` * | string | Date and time when the webhook was generated (ISO 8601 format).                              | -          |
| `data` *          | Object  | Object containing conciliation batch details.                                                | [data Object](#data-object)                          |

---

### data Object

| Field                                 | Type  | Description                                                                       | Characters |
|---------------------------------------|-------|-----------------------------------------------------------------------------------|------------|
| `payment_order_conciliation_batches` * | array | List of created conciliation batches.                                            | [payment_order_conciliation_batches Array](#payment_order_conciliation_batches-array) |

### payment_order_conciliation_batches Array

| Field                                  | Type    | Description                                                              | Characters |
|----------------------------------------|---------|--------------------------------------------------------------------------|------------|
| `payment_order_conciliation_batch_key` | string  | Unique key of the conciliation batch.                                   | 36         |
| `payment_order_conciliation_batch_status` | string | Status of the conciliation batch (`open`).                              | -          |
| `payment_order_conciliation_batch_type` | string | Type of conciliation batch (`fixed_amount`, `variable_amount`).         | -          |
| `account_key`                          | uuidv4  | Identification key of the account associated with the batch.             | 36         |
| `total_amount`                         | number  | Total amount of the conciliation batch.                                 | -          |
| `conciliated_amount`                   | number  | Total conciliated amount in the batch.                                  | -          |
| `total_payment_orders`                 | number  | Total number of payment orders in the batch.                            | -          |
| `conciliated_payment_orders`           | number  | Number of conciliated payment orders in the batch.                      | -          |
| `reference_date`                       | string  | Reference date of the batch (YYYY-MM-DD format).                        | 10         |
| `created_at`                           | string  | Creation date of the batch (ISO 8601 format).                           | -          |

---

# FAQ - Pix Automático

URL: /en/documentation/baas/pix_automatico/faq

{`
.faq-container {
  margin: 30px 0;
}

.faq-section {
  margin-bottom: 40px;
}

.faq-section-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e5e7eb;
}

.faq-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.faq-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid #1e40af;
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.faq-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, rgb(40, 85, 232), #0f172a);
  transition: width 0.3s ease;
}

.faq-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-color: #1e3a8a;
}

.faq-card:hover::before {
  width: 6px;
}

.faq-question {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.4;
}

.faq-question::before {
  content: '';
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.faq-answer {
  font-size: 14px;
  line-height: 1.7;
  color: #475569;
  margin: 0;
}

.faq-answer ul {
  margin: 12px 0;
  padding-left: 20px;
}

.faq-answer li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.faq-answer strong {
  color: #0f172a;
  font-weight: 700;
}

@media (max-width: 768px) {
  .faq-grid {
    grid-template-columns: 1fr;
  }
}
`}

Questions about Recurrences
  
Does a recurrence need to have pre-defined validity or number of payments?
The recurrence validity is a parameter defined in the relationship between the receiver and the payer. Authorization can be granted for an indefinite period , or alternatively have pre-defined number of charges or final validity date .

Can the date chosen for the debit be any date within the cycle?
Yes, as long as the minimum 2-day advance between the scheduling date and the expected settlement date is respected, which must be before the start date of the next cycle .

Questions about Authorization Journeys
  
What is the main difference between journeys with QR Code?
The main difference lies in the user experience and the timing of recurrence authorization. Journey 2 only authorizes the future recurrence without processing payment immediately. Journey 3 allows the first immediate payment together with the recurrence authorization - the payment made is what activates the recurrence. Journey 4 works differently: the user reads a QR Code as if it were a normal PIX, and after making the payment or scheduling, the system offers the automatic pix option. Journey 4 is the only one that supports variable amount recurrences and offers more flexibility in user experience.

If, through journey 3, settlement succeeds and authorization fails, will payment cancellation be necessary, since the flow expects both to succeed?
It's at the receiver user's discretion . They may return the settled Pix and enable a new journey 3 or may offer another authorization journey for Pix Automático with the exclusive purpose of enabling authorization for subsequent payments.

Frequently Asked Questions about Reconciliation Batches
  
What are reconciliation batches?
Reconciliation batches are payment groupings that are automatically created by the system to facilitate reconciliation and control of Pix Automático payments. They serve as a way to organize and track payments by settlement date and recurrence type.

How are payments grouped into batches?
Payments are automatically grouped into batches based on criteria such as:
Expected settlement date for the payment
Recurrence type: fixed_amount or variable_amount
Specific account
Specific requester

When is a batch created?
Batches are automatically created by the system when there are payment orders that need to be processed for a specific payment date. The system groups these orders that have settlement on the same day into batches , to facilitate processing, visualization, and reconciliation.

When is a batch closed?
A batch is closed always three days before the payment reference date of that batch, because payment orders need to be sent at most two days in advance relative to the payment date of that cycle. That is, when its closing date arrives.
The system automatically calculates this date based on the payment settlement date minus 3 days, ensuring that payment instructions are sent within the regulatory deadline established by the Central Bank.

Can I query payments from closed batches?
Yes, you can query payments from closed batches through the batch query endpoints and listing payments from a specific batch.

Questions about Payment Orders and Attempts
  
What's the difference between payment order and payment attempt?
Payment Order: It's the instruction created by the system to make a specific payment on a determined date.
Payment Attempt: It's each individual execution of this payment order, and there can be multiple attempts if the first one fails.

How many payment attempts are made?
The system makes up to 4 payment attempts per payment order. If all attempts fail, the payment order is marked as rejected.

What happens when all attempts fail?
When all 4 payment attempts fail, the payment order has its status changed to "rejected" and no more attempts will be made for the payment of that cycle.

How do retries work?
Retries are automatically executed by the system according to the retry days configured by the receiver when creating the recurrence. Each attempt that fails generates a webhook notification so you can track the status of this payment.

Questions about Cancellations
  
Can I cancel a specific payment order?
Yes, you can cancel a specific payment order through the payment order cancellation endpoint, as long as it hasn't been settled yet.

What's the difference between canceling a recurrence and canceling a payment order?
Cancel Recurrence: Cancels the entire recurrence and all future payment orders associated with it.
Cancel Payment Order: Cancels only the specific payment order for that cycle, without affecting the recurrence or other orders.

Questions about Simulation
  
What are simulation scenarios for?
Simulation scenarios serve to test the complete Pix Automático flow in the sandbox environment, simulating the responses and interactions of the PSP Pagador (Payment Service Provider).

How to properly use simulation scenarios?
Scenarios should be executed in sequence to simulate the complete flow:
Create a recurrence
Process payment orders
Update execution dates (sandbox)
Process payment attempts
Simulate incoming PIX
Simulate rejected attempts (if necessary)

Questions about Webhooks
  
Which webhooks are sent by Pix Automático?
The system sends webhooks for various events, including:
Recurrence status changes
Payment order status changes
Payment attempt status changes
Creation and closing of reconciliation batches

Questions about Benefits and Comparisons
  
What are the main benefits for receivers adopting Pix Automático compared to other existing payment methods?
Pix Automático offers a new option to receiver users for receiving and managing periodic recurring charges, using the Pix infrastructure. Among the advantages, the following stand out: increased customer base , lower operational cost for not needing to establish agreements with more than one institution, diversification of payment methods , offering Pix as an alternative to customers who use card or bank slip, in addition to reducing delinquency and more agility in managing their receivables.

What's the main difference between traditional automatic account debit and Pix Automático?
Focusing on the experience of both receiver and payer users, Pix Automático presents new functionalities for managing authorizations and recurring schedules . Furthermore, any Pix participant can offer the product to their customers, expanding access for citizens and companies that today are not served by the automatic debit service, offered more restrictively only between banking institutions.

---

# Introduction to Automatic Pix

URL: /en/documentation/baas/pix_automatico/introducao

**Automatic Pix** is an innovative solution that automates recurring payments in a simplified, efficient, and secure manner. Ideal for businesses that work with subscriptions, monthly fees, or recurring bill charges, Automatic Pix evolves from traditional methods by eliminating the need for manual interaction, reducing defaults, and facilitating financial management, serving both companies and consumers.

{`
.hero-section {
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  margin: 24px 0 32px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.hero-item {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
}

.hero-item strong {
  display: block;
  color: #1e40af;
  font-size: 14px;
  margin-bottom: 6px;
}

.hero-item p {
  margin: 0;
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
}

.flow-section {
  margin: 32px 0;
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.flow-step-card {
  border-radius: 12px;
  padding: 18px;
  color: #ffffff;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flow-step-card h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.flow-step-card p {
  margin: 0;
  font-size: 13px;
  opacity: 0.95;
  line-height: 1.5;
}
`}

How does it work in practice?
  
For whom?
Ideal for companies that offer subscriptions, recurring services, school tuition, health plans and similar services.
    
What do I need to do?
The receiver creates a recurrence and the payer authorizes it only once. Then, payments happen automatically in each cycle.
    
Main advantages
Reduces delays, eliminates the need to remember payment dates and simplifies financial management for both parties.

### Flow in 4 simple steps

1. Create Recurrence
The receiver defines the recurring charge characteristics (amount, frequency, start date).
    
2. Authorize
The payer authorizes only once in the bank app, choosing one of the 4 available journeys.
    
3. Schedule
Each cycle, the receiver sends the payment instruction and the payer's bank automatically schedules it.
    
4. Settle
On the scheduled date, debit and credit are automatically processed in each party's account.

---

## Automatic Pix API Features

QI Tech, through its **Automatic Pix API**, enables the integration of automatic payments using Pix, based on prior payer-to-receiver authorizations. The system covers the following responsibilities:

{`
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.feature-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, #3b82f6, #1e40af);
  transition: width 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-color: #3b82f6;
}

.feature-card:hover::before {
  width: 6px;
}

.feature-title {
  font-size: 16px;
  font-weight: 700;
  color: #1e40af;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.feature-icon {
  font-size: 20px;
}

.feature-description {
  font-size: 14px;
  line-height: 1.6;
  color: #475569;
  margin: 0;
}

.recurrence-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin: 30px 0;
}

.recurrence-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 28px;
  border: 2px solid;
  position: relative;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.recurrence-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.recurrence-card.fixed {
  border-color:rgb(11, 63, 250);
  background: linear-gradient(135deg, #ffffff 0%,rgb(235, 240, 255) 100%);
}

.recurrence-card.variable {
  border-color:rgb(11, 63, 250);
  background: linear-gradient(135deg, #ffffff 0%,rgb(235, 240, 255) 100%);
}

.recurrence-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.recurrence-badge {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recurrence-card.fixed .recurrence-badge {
  background:rgb(16, 64, 185);
  color: #ffffff;
}

.recurrence-card.variable .recurrence-badge {
  background:rgb(16, 64, 185);
  color: #ffffff;
}

.recurrence-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.recurrence-description {
  font-size: 15px;
  line-height: 1.7;
  color: #475569;
  margin-bottom: 16px;
}

.recurrence-detail {
  background: rgba(255, 255, 255, 0.7);
  border-left: 3px solid;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: #64748b;
}

.recurrence-card.fixed .recurrence-detail {
  border-left-color:rgb(203, 15, 68);
}

.recurrence-card.variable .recurrence-detail {
  border-left-color:rgb(203, 15, 68);
}

.periodicity-container {
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 28px;
  margin: 30px 0;
}

.periodicity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.periodicity-item {
  background: #ffffff;
  padding: 16px;
  border-radius: 10px;
  text-align: center;
  border: 2px solid #e5e7eb;
  transition: all 0.3s ease;
}

.periodicity-item:hover {
  border-color: #3b82f6;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.15);
}

.periodicity-label {
  font-size: 14px;
  font-weight: 600;
  color: #1e40af;
  margin: 0;
}

.journeys-container {
  margin: 30px 0;
}

.journey-card {
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
  border-left: 5px solid;
}

.journey-card:hover {
  transform: translateX(5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.journey-card.journey-1 {
  border-left-color: #3b82f6;
}

.journey-card.journey-2 {
  border-left-color: #10b981;
}

.journey-card.journey-3 {
  border-left-color: #f59e0b;
}

.journey-card.journey-4 {
  border-left-color: #ec4899;
}

.journey-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.journey-number {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.journey-card.journey-1 .journey-number {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
}

.journey-card.journey-2 .journey-number {
  background: linear-gradient(135deg, #059669, #10b981);
}

.journey-card.journey-3 .journey-number {
  background: linear-gradient(135deg, #d97706, #f59e0b);
}

.journey-card.journey-4 .journey-number {
  background: linear-gradient(135deg, #db2777, #ec4899);
}

.journey-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.journey-description {
  font-size: 14px;
  line-height: 1.7;
  color: #475569;
  margin: 0;
  padding-left: 48px;
}

.cancellation-info {
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 28px;
  margin: 30px 0;
}

.cancellation-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0 0;
}

.cancellation-item {
  background: #ffffff;
  padding: 16px 20px;
  border-radius: 10px;
  margin-bottom: 12px;
  border-left: 4px solid #3b82f6;
  display: flex;
  gap: 12px;
}

.cancellation-item:last-child {
  margin-bottom: 0;
}

.cancellation-label {
  font-weight: 700;
  color: #1e40af;
  min-width: 180px;
}

.cancellation-text {
  color: #475569;
  flex: 1;
  margin: 0;
}

.advantages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.advantage-card {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  border: 2px solid #d1fae5;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
}

.advantage-card:hover {
  transform: translateY(-4px);
  border-color: #10b981;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.15);
}

.advantage-text {
  font-size: 14px;
  line-height: 1.7;
  color: #475569;
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.advantage-icon {
  color: #10b981;
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

@media (max-width: 768px) {
  .features-grid,
  .recurrence-types,
  .advantages-grid {
    grid-template-columns: 1fr;
  }

  .periodicity-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .journey-description {
    padding-left: 0;
    margin-top: 12px;
  }
}
`}

Creation and Management
Facilitates the creation, management, and cancellation of recurrences in a simplified and efficient way.

Authorization Orchestration
Ensures that Automatic Pix recurring payments are properly authorized by the payer.

Scheduling and Settlement
Completely automates payment cycles, from scheduling to settlement.

Logs and Audits
Maintains complete records of all operations for compliance with Bacen rules.

---

## Recurrence Types

Fixed Value
Fixed Value Recurrence
      In the fixed value mode, the payer authorizes recurring payments of fixed amounts, previously established when creating the recurrence.
Ideal for: Monthly subscriptions, school tuition, service plans with fixed values.

Variable Value
Variable Value Recurrence
      In the variable value mode, the payer and receiver agree on a range of allowed amounts for each recurring charge. The receiver defines the minimum value and the payer defines the maximum value.
Important: The receiver must reconcile the payment order with the amount to be charged within 10 to 3 days before the charge date.
Ideal for: Consumption-based models, variable service bills, payments adjustable over time.

---

## Recurrence Frequency

Currently, it is possible to create recurrences with the following frequencies:

Available Frequencies
Weekly
Monthly
Quarterly
Semi-annual
Annual

---

## Automatic Pix Authorization Journeys

Automatic Pix supports various authorization journeys to meet different business scenarios:

1
Journey 1: Push Notification
      App notification for recurrence confirmation, without need for QR Code. The payer receives a notification and authorizes directly in the app.

2
Journey 2: QR Code - Recurrence
      Authorization with QR Code containing only recurrence data. The payer scans the QR Code and authorizes only the future recurrence.

3
Journey 3: QR Code + First Payment
      QR Code allowing immediate first payment and recurrence setup simultaneously. Ideal for cases where you want to receive the first payment and create the recurrence in the same transaction.

4
Journey 4: Complete QR Code
      QR Code including data for immediate payment/scheduling and automatic pix offer for that charge, after payment or scheduling. Allows payment (or scheduling) and automatic pix offer in a single operation.

:::info Journey Documentation
For complete details on how to implement each journey, see:
- [Journey 1 - Push Notification](./recebedor/journey_one.md)
- [Journey 2 - QR Code (recurrence only)](./recebedor/journey_two.md)
- [Journey 3 - QR Code (with first payment)](./recebedor/journey_three.md)
- [Journey 4 - QR Code (with first payment and variable values)](./recebedor/journey_four.md)
:::

---

## Recurrence Cancellation

Cancellation Rules
  
Cancellation Request
Can be made by both the payer and receiver user unilaterally, without need for mutual approval.
Cancellation Impact
Authorization and recurrence are cancelled simultaneously, automatically blocking new payment instructions.
Cancellation Process
The payer user updates and communicates the cancellation status to the receiver user, who must be informed immediately.
Immediate Effects
Automatically cancels all associated schedules, except those scheduled for settlement on the cancellation day itself.
Receiver Initiative
The receiver can cancel the recurrence by their own decision or upon payer request through the API.

---

## Advantages and Potential

Automatic Pix offers various advantages, such as centralization of authorizations and payments, incentive to financial digitization, and efficiency in automatic debit solutions, filling gaps in traditional payment methods.

✓
Reduction of delay risk and the need to remember due dates, with elimination of manual steps

✓
Centralization of authorization and payment control in a single platform

✓
Incentive to digitization of financial processes and modernization of customer relationships

✓
Simplification of operations for merchants and end customers

✓
Efficiency in automatic debit solutions with Pix technology

✓
Filling existing gaps in traditional payment instruments

---

## Scenario Simulation

During the development and testing of integration with Automatic Pix, it is essential to validate all flows before using the production environment. **Scenario Simulation** provides a complete sandbox environment that allows testing the entire lifecycle of a recurrence, from creation to payment settlement.

### What is Scenario Simulation?

Scenario Simulation is a tool that allows **testing the complete Automatic Pix flow** in the sandbox environment, simulating SPI (Instant Payment System) responses without performing real transactions. It covers:

- **Creation and approval of recurrences** using the 4 available journeys
- **Processing of payment orders** and creation of reconciliation batches
- **Simulation of payment attempts** with different results (success or rejection)
- **Testing of cancellation flows** and recurrence management

### When to use?

Simulation is recommended for:

- **Integration validation**: Test if your application is correctly integrated with the API
- **Development**: Develop and debug your implementation without costs
- **Flow testing**: Validate different scenarios (successful payments, rejections, cancellations)
- **Training**: Familiarize your team with Automatic Pix flows before going to production

### How to use?

The simulation process follows a sequence of steps that replicates the real flow:

1. **Create a recurrence** using one of the authorization journeys
2. **Approve the recurrence** via mock, simulating payer confirmation
3. **Process payment orders** that automatically create reconciliation batches
4. **Query and reconcile** orders (mandatory for variable values)
5. **Update execution date** to accelerate tests in sandbox
6. **Process attempts** of payment
7. **Simulate the result**: Incoming Pix (success) or rejection

:::tip Complete Documentation
For a detailed step-by-step guide on how to use scenario simulation, including all available endpoints and request examples, see:

**[📋 Scenario Simulation Guide](./recebedor/simulacao.md)**
:::

### Simulation Benefits

✓
Testing without costs or risks, in controlled and isolated environment

✓
Complete validation of all flows before production

✓
Acceleration of dates and processes for faster testing

✓
Simulation of different scenarios (successes, failures, cancellations)

---

# Accept payment recurrence

URL: /en/documentation/baas/pix_automatico/movimentacoes/aceitar_recorrencia

## Request

ENDPOINT /account/ ACCOUNT_KEY /incoming_recurrence/ INCOMING_RECURRENCE_KEY /approve
METHOD PATCH

### Request Path Params

| Field       | Type   | Description                      | Characters |
|-------------|--------|--------------------------------|------------|
| `account_key` * | uuid4  | Unique account identification key. | 36 |
| `incoming_recurrence_key` * | uuid4  | Unique authorization identification key                                    | 36 |

### Request Body

Request Body: Approve fixed amount recurrence

```json
{
  "incoming_recurrence_status": "active"
}
```

Request Body: Approve variable amount recurrence with maximum limit

```json
{
  "incoming_recurrence_status": "active",
  "maximum_transaction_amount": 500.00
}
```

### Body Params

| Field                   | Type       | Description                                                                                                                                                                                                                                        | Characters |
|-------------------------|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|
| `incoming_recurrence_status` *           | string     | PIX recurrence status identifier. Must be "active" to activate the recurrence                                                                                                                                                                                                | 20        |
| `maximum_transaction_amount`           | number     | Maximum amount the user accepts to pay per transaction (optional, only for variable amount recurrences)                                                                                                                                                                                                | 10        |

:::info Maximum Amount for Variable Recurrences
The `maximum_transaction_amount` field is **optional** and should be used only for **variable amount recurrences**. It allows the payer to define the maximum amount they accept to pay per transaction within the authorized recurrence.
:::
## Response

STATUS 200

Response Body: Recurrence activated

```json
{
  "incoming_recurrence_key": "cfa32109-a6dd-4304-94db-03a7b6d92a47",
  "incoming_recurrence_status": "active",
  "created_at": "2025-05-22T20:30:23.459Z",
  "updated_at": "2025-05-22T20:39:23.459Z"
}
```

STATUS 4XX

Response Body

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo"
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`           | Description (eng)<br/>`Description`                                   | Description (ptbr)<br/>`translation`                                |
|-------------|----------------------|------------------------------|---------------------------------------------------------------------|-------------------------------------------------------------------|
| 400         | QIT000001            | Bad Request	            | Schema Error                                      | Erro de Schema                       |
 403         | APX000025            | User is not allowed to do this transaction        | User is not allowed to do this transaction | Usuário não tem autorização para fazer essa transação |
| 403         | APX000017            | Requester not allowed to access this endpoint        | Requester has no permission to perform pix transfers on this endpoint | Requester não possui permissão de realizar transações pix através deste endpoint |
| 404         | APX000020            | Account not Found             | Account was not found | Conta \{account_key\} não foi encontrada. |
| 404         | APX000001            | Recurrence not Found        | Recurrence was not found | Recorrência \{incoming_recurrence_key\} não foi encontrada |

---

# Cancel recurrence

URL: /en/documentation/baas/pix_automatico/movimentacoes/cancelar_recorrencia

## Request

ENDPOINT /account/ ACCOUNT_KEY /incoming_recurrence/ INCOMING_RECURRENCE_KEY /cancel
METHOD PATCH

### Request Path Params

| Field       | Type   | Description                      | Characters |
|-------------|--------|--------------------------------|------------|
| `account_key` * | uuid4  | Unique account identification key. | 36 |
| `incoming_recurrence_key` * | uuid4  | Unique authorization identification key                                    | 36 |

### Request Body

Request Body: Cancel a recurrence

```json
{
  "incoming_recurrence_status": "cancelled",
}
```

### Body Params

| Field                   | Type       | Description                                                                                                                                                                                                                                        | Characters |
|-------------------------|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|
| `incoming_recurrence_status` *           | string     | Pix recurrence status identifier.                                                                                                                                                                                                | cancelled        |
## Response

STATUS 200

Response Body: Recurrence cancelled

```json
{
  "incoming_recurrence_key": "cfa32109-a6dd-4304-94db-03a7b6d92a47",
  "incoming_recurrence_status": "cancelled",
  "created_at": "2025-05-22T20:30:23.459Z",
  "updated_at": "2025-05-22T20:39:23.459Z"
}
```

STATUS 4XX

Response Body

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo"
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`           | Description (eng)<br/>`Description`                                   | Description (ptbr)<br/>`translation`                                |
|-------------|----------------------|------------------------------|---------------------------------------------------------------------|-------------------------------------------------------------------|
| 400         | QIT000001            | Bad Request	            | Schema Error                                      | Erro de Schema                       |
 403         | APX000025            | User is not allowed to do this transaction        | User is not allowed to do this transaction | Usuário não tem autorização para fazer essa transação |
| 403         | APX000017            | Requester not allowed to access this endpoint        | Requester has no permission to perform pix transfers on this endpoint | Requester não possui permissão de realizar transações pix através deste endpoint |
| 404         | APX000020            | Account not Found             | Account was not found | Conta \{account_key\} não foi encontrada. |
| 404         | APX000001            | Recurrence not Found        | Recurrence was not found | Recorrência \{incoming_recurrence_key\} não foi encontrada |

---

# Query Recurrence

URL: /en/documentation/baas/pix_automatico/movimentacoes/consultar_recorrencia

## Query Pix recurrence by incoming_recurrency_key

### Request

ENDPOINT /account/ ACCOUNT_KEY /incoming_recurrence/ INCOMING_RECURRENCE_KEY
METHOD GET

### Path Params

| Field                      | Type       | Description                                             | Characters                                                                  |
|----------------------------|------------|-------------------------------------------------------|-----------------------------------------------------------------------------|
| `account_key` *            | uuid4     | QI account unique identification key.             | 36                                                                          |
| `incoming_recurrency_key` *       | uuid4     | Automatic Pix recurrence unique identification key.    | 36                                                                          |

### Response

STATUS 200

Response Body: Recurrence query

```json
{
  "incoming_recurrence_key": "c2f3eefa-1b8e-4d5f-9b9d-123456789abc",
  "incoming_recurrence_status": "pending_confirmation",
  "request_control_key": "e04197f6-433e-48d2-8a8e-9258a70aba0b",
  "transaction_amount": "150.00",
  "periodicity": "monthly",
  "journey_type": "journey_one",
  "pix_transfer_type": "key",
  "end_to_end_id": "E1234567890123456789012",
  "start_date": "2025-06-01",
  "end_date": "2026-06-01",
  "next_execution_date": "2025-07-01",
  "receiver_conciliation_id": "rec-conc-789",
  "target_pix_key": "receiver@bank.com.br",
  "payer_document_number": "12345678900",
  "pix_message": "Pagamento mensal de serviço",
  "created_at": "2025-05-22T10:00:00Z",
  "updated_at": "2025-05-22T12:00:00Z",
}

```

| Field                          | Type    | Description                                                                                                                                                                                                                                                                                     | Max. Characters                                                   |
|--------------------------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| `incoming_recurrence_key`  | uuid4    | Authorization unique identification key                                                                                                                                                              | 36         | 
| `incoming_recurrence_status`               | string  |Recurrence status identifier                                                                                                                                         | [Enumerator incoming_recurrence_status](#enumerator-incoming_recurrence_status)                                                           |
| `request_control_key`  | uuid4     | Request unique identification key used by the client                                                                                                                                                              | 36         | 
| `transaction_amount`   | number     | Transfer amount for fixed value occurrence.                                                                                                                                                                                                                         | 10         |
| `minimum_transaction_amount`   | number     | Minimum transfer amount for variable value occurrence.                                                                                                                                                                                                                         | 10         |
| `maximum_transaction_amount`   | number     | Maximum transfer amount for variable value occurrence.                                                                                                                                                                                                                         | 10         |
| `periodicity`    | enumerator | Periodicity type associated with the payment                                                                                                                                           | [Enumerators periodicity](#enumerators-periodicity)     |
| `journey_type`    | enumerator | Request journey type                                                                                                                                                    | [Enumerators journey_type](#enumerators-journey_type)     |
| `pix_transfer_type`    | enumerator | Type of pix to be performed                                                                                                                                                   | [Enumerators pix_transfer_type](#enumerators-pix_transfer_type)     |
| `end_to_end_id`        | string     | Idempotency key of a Pix transaction within SPI (Instant Payment System). This key is returned in the Pix key query. | 32 |
| `start_date`    | string | Recurrence start date                                                                                                                                                         | -      |
| `end_date`   | string | Recurrence end date, for indefinite time cases, send as null                                                                                                                        
| `next_execution_date`    | string | Next recurrence transaction execution date                                                                                                                                                      | -      |
| `receiver_conciliation_id` | string     | Receiver conciliation identification. | 35                                        |
| `target_pix_key`       | string     | Transaction account pix key.                                                                                                                                                                                                    | 100        |
| `payer_document_number`       | string     | Transaction payer document number.                                                                                                                                                                                                    | 14        |
| `pix_message`           | string     | Message to be sent along with the Pix transfer.                                                                                                                                                                                                | 140        |
| `created_at`              | string  | Recurrence request creation time                                                                                                                                       | -          
| `updated_at`              | string  | Recurrence request update time                                                                                                                                       | -                                  

### Enumerator incoming_recurrence_status

| Enumerator           | Description           |
|----------------------|---------------------|
| `pending_confirmation` | Recurrence pending confirmation      |
| `active`   | Active recurrence       |
| `cancelled`   | Cancelled recurrence      |
| `suspended`  | Suspended recurrence |
| `expired`  | Expired recurrence |

### Enumerators periodicity
| Enumerator       | Description          |
|------------------|--------------------|
| `weekly` | Weekly recurrence |
| `monthly` | Monthly recurrence  |
| `quarterly` | Quarterly recurrence     |
| `semiannual` | Semiannual recurrence     |
| `annual` | Annual recurrence      |

### Enumerators journey_type
| Enumerator       | Description          |
|------------------|--------------------|
| `journey_one` | Authorization request via app notification |
| `jouney_two` | Authorization request via QR Code reading  |
| `journey_three` | Recurrence authorization through immediate pix via QR Code reading     |
| `journey_four` | Payment or scheduling of a pix with a recurrence authorization request in sequence      |

### Enumerators pix_transfer_type

| Enumerator          | Description                                |
|---------------------|------------------------------------------|
| `manual`          | Pix using destination account data |
| `key`             | Pix using a pix key             |
| `static_qr_code`  | Pix using a static QR code       |
| `dynamic_qr_code` | Pix using a dynamic QR code       |

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`                          | Description (eng)<br/>`Description`                   | Description (ptbr)<br/>`translation`                                            |
|-------------|----------------------|---------------------------------------------|-----------------------------------------------------|-------------------------------------------------------------------------------|
 403         | APX000025            | User is not allowed to do this transaction        | User is not allowed to do this transaction | Usuário não tem autorização para fazer essa transação |
| 403         | APX000017            | Requester not allowed to access this endpoint        | Requester has no permission to perform pix transfers on this endpoint | Requester não possui permissão de realizar transações pix através deste endpoint |
| 404         | APX000020            | Account not Found             | Account was not found | Conta \{account_key\} não foi encontrada. |
| 404         | APX000001            | Recurrence not Found        | Recurrence was not found | Recorrência \{incoming_recurrence_key\} não foi encontrada |

---

# Create payment recurrence

URL: /en/documentation/baas/pix_automatico/movimentacoes/criar_recorrencia

## Request

ENDPOINT /account/ ACCOUNT_KEY /incoming_recurrence
METHOD POST

### Request Path Params

| Field       | Type   | Description                      | Characters |
|-------------|--------|--------------------------------|------------|
| `account_key` * | uuid4  | Unique account identification key. | 36 |

### Request Body

Request Body: Create fixed amount recurrence

```json
{
  "request_control_key": "01585acf-b0c3-4389-baf3-a58abbe92d58",
  "end_to_end_id": "E73856642202309201429bZKfklNlbwu",
  "periodicity": "monthly",
  "journey_type": "journey_one",
  "start_date": "2025-04-01",
  "end_date": "2027-04-01",
  "target_pix_key": "pix_key@test.bcb.com",
  "pix_message": "Informação do pagamento",
  "is_retry_allowed": true,
  "transaction_amount": 150.04
}
```

Request Body: Create variable amount recurrence

```json
{
  "request_control_key": "12385acf-b0c3-4389-baf3-a58abbe92d58",
  "end_to_end_id": "E73856642202309201429bZKfklNlbwu",
  "periodicity": "monthly",
  "journey_type": "journey_one",
  "start_date": "2025-07-01",
  "end_date": null,
  "target_pix_key": "pix_key@test.bcb.com",
  "pix_message": "Pagamento da conta de energia elétrica",
  "is_retry_allowed": true,
  "minimum_transaction_amount": 50.00,
  "maximum_transaction_amount": 300.00
}
```

### Body Params

| Field                   | Type       | Description                                                                                                                                                                                                                                        | Characters |
|-------------------------|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|
| `request_control_key` * | uuid     | Unique request identification key used by the client in uuid4 format.                                                                                                                                                               | 36         | 
| `periodicity` *   | enumerator | Type of periodicity associated with payment                                                                                                                                           | [periodicity enumerators](#periodicity-enumerators)     |
| `journey_type` *   | enumerator | Type of request journey                                                                                                                                                    | [journey_type enumerators](#journey_type-enumerators)     |
| `start_date` *   | string | Recurrence start date                                                                                                                                                         | -      |
| `end_to_end_id` *       | string     | Idempotency key for a Pix transaction within SPI (Instant Payment System). This key is returned in the Pix key query. | 32 |
| `target_pix_key`       | string     | Pix key of the account to which the transaction will be sent.                                                                                                                                                                                                    | 100        |
| `target_account`       | Object     | Target account - Should only be sent for manual transfers. | [target_account object](#target_account-object) | 10 |
| `transaction_amount`   | number     | Transfer amount for fixed value occurrence.                                                                                                                                                                                                                         | 10         |
| `minimum_transaction_amount`   | number     | Minimum transfer amount for variable value occurrence.                                                                                                                                                                                                                         | 10         |
| `maximum_transaction_amount`   | number     | Maximum transfer amount for variable value occurrence.                                                                                                                                                                                                                         | 10         |
| `end_date`   | string | Recurrence end date, for indefinite time cases, send as null                                                                                                                                                        | -      |
| `pix_message`           | string     | Message to be sent with the Pix transfer.                                                                                                                                                                                                | 140        |
| `is_retry_allowed`           | boolean     | Permission for Pix transaction retry.                                                                                                                                                                                                | -        |

### periodicity enumerators
| Enumerator       | Description          |
|------------------|--------------------|
| `weekly` | Weekly recurrence |
| `monthly` | Monthly recurrence  |
| `quarterly` | Quarterly recurrence     |
| `semiannual` | Semi-annual recurrence     |
| `annual` | Annual recurrence      |

### journey_type enumerators
| Enumerator       | Description          |
|------------------|--------------------|
| `journey_one` | Authorization request through an app notification |
| `journey_two` | Authorization request through QR Code reading  |
| `journey_three` | Recurrence authorization through an immediate pix via QR Code reading     |
| `journey_four` | Payment or scheduling of a pix with a recurrence authorization request in sequence      |

### target_account object

| Field                     | Type       | Description                                           | Characters                                              |
|---------------------------|------------|-----------------------------------------------------|---------------------------------------------------------|
| `account_branch`         | string     | Account branch.                                   | 6                                                       |
| `account_digit`          | string     | Account digit.                                    | 1                                                       |
| `account_number`         | string     | Account number.                                    | 20                                                      |
| `owner_document_number`  | string     | CPF or CNPJ (numbers only) of the account holder.   | 14                                                      |
| `owner_name`             | string     | Account holder's name.                           | 150                                                     |
| `account_type`          | enumerator | Account type.                                      | [account_type enumerator](#account_type-enumerator) |
| `ispb`                   | string     | Based on the financial institution's CNPJ (8 digits). | 8                                                       |

:::info
Different enumerators may mean the same account type due to information returned by different
institutions.
:::
### account_type enumerator

| Enumerator           | Description           |
|----------------------|---------------------|
| `checking_account` | Checking Account      |
| `salary_account`   | Salary Account       |
| `saving_account`   | Savings Account      |
| `payment_account`  | Payment Account |

## Response

STATUS 200

Response Body: Recurrence created

```json
{
  "incoming_recurrence_key": "cfa32109-a6dd-4304-94db-03a7b6d92a47",
  "incoming_recurrence_status": "pending_confirmation",
  "created_at": "2025-05-22T20:30:23.459Z",
}
```

| Field                          | Type    | Description                                                                                                                                                                                                                                                                                     | Max. Characters                                                   |
|--------------------------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| `incoming_recurrence_key`  | uuid     | Unique authorization identification key                                                                                                                                                              | 36         | 
| `incoming_recurrence_status`               | string  |Recurrence status identifier                                                                                                                                         | [incoming_recurrence_status enumerator](#incoming_recurrence_status-enumerator)                                                           |
| `created_at`              | string  | Recurrence request creation time                                                                                                                                       | -                                                                

### incoming_recurrence_status enumerator

| Enumerator           | Description           |
|----------------------|---------------------|
| **pending_confirmation** | Recurrence pending confirmation      |
| **active**   | Active recurrence       |
| **cancelled**   | Cancelled recurrence      |
| **suspended**  | Suspended recurrence |
| **expired**  | Expired recurrence |

STATUS 4XX

Response Body

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo"
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`           | Description (eng)<br/>`Description`                                   | Description (ptbr)<br/>`translation`                                |
|-------------|----------------------|------------------------------|---------------------------------------------------------------------|-------------------------------------------------------------------|
| 400         | QIT000001            | Bad Request	            | Schema Error                                      | Erro de Schema                       |
| 403         | APX000025            | User is not allowed to do this transaction        | User is not allowed to do this transaction | Usuário não tem autorização para fazer essa transação |
| 403         | APX000017            | Requester not allowed to access this endpoint        | Requester has no permission to perform pix transfers on this endpoint | Requester não possui permissão de realizar transações pix através deste endpoint |
| 404         | APX000020            | Account not Found             | Account was not found | Conta \{account_key\} não foi encontrada. |
| 406         | APX000026            | Invalid end_to_end_id            | The end_to_end_id sent \{end_to_end_id\} is not valid.                                      | O end_to_end_id enviado  \{end_to_end_id\} não é válido                       |
| 406         | APX000005            | Invalid Transaction Amount            | Transaction amount of \{transaction_amount\} is not valid. It must be a positive value with at maximum 2 decimal places                                     | O valor de transação \{transaction_amount\} não é válido. Deve ser um valor positivo com no máximo duas casas decimais                      |
| 409         | APX000013            | Request Control Key Reuse Error            | The request_control_key \{request_control_key\} already in use                                      | A request_control_key \{request_control_key\} já utilizada                       |

---

# Recurrence Listing

URL: /en/documentation/baas/pix_automatico/movimentacoes/listar_recorrencias

## Pix recurrence listing for an account

### Request

ENDPOINT /account/ ACCOUNT_KEY /incoming_recurrences
METHOD GET

### Path Params

| Field                      | Type       | Description                                             | Characters                                                                  |
|----------------------------|------------|-------------------------------------------------------|-----------------------------------------------------------------------------|
| `account_key` *            | uuid4     | Unique identification key of the QI account.             | 36                                                                          |

### Query Params

| Field                    | Type       | Description                                                                                                  | Characters                                                                  |
|--------------------------|------------|------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| `request_control_key`    | uuid4     | Unique identification key of the request used by the client.                                            | 36                                                                          |
| `status`          | string     | Pix recurrence status identifier                                                                | [Status enumerator](#status-enumerator)                                                                          |
| `date_from`              | string     | Start date for listing filter.   | Format "YYYY-MM-DD" |
| `date_to`                | string     | End date for listing filter. | Format "YYYY-MM-DD" | 
| `page`                   | integer    | Requested page number. |  Default 1  |
| `page_size`              | integer    | Requested page size for the query.                                     | Default and maximum value of 30                                 

### Status enumerator

| Enumerator           | Description           |
|----------------------|---------------------|
| `pending_confirmation` | Recurrence pending confirmation      |
| `active`   | Active recurrence       |
| `cancelled`   | Cancelled recurrence      |
| `suspended`  | Suspended recurrence |
| `expired`  | Expired recurrence |

### Response

STATUS 200

Response Body: Recurrence listing

```json

{
    "data": [
        {
            "incoming_recurrence_key": "c2f3eefa-1b8e-4d5f-9b9d-123456789abc",
            "incoming_recurrence_status": "pending_confirmation",
            "request_control_key": "e04197f6-433e-48d2-8a8e-9258a70aba0b",
            "transaction_amount": "150.00",
            "periodicity": "monthly",
            "journey_type": "journey_one",
            "pix_transfer_type": "key",
            "end_to_end_id": "E1234567890123456789012",
            "start_date": "2025-06-01",
            "end_date": "2026-06-01",
            "next_execution_date": "2025-07-01",
            "receiver_conciliation_id": "rec-conc-789",
            "target_pix_key": "receiver@bank.com.br",
            "payer_document_number": "12345678900",
            "pix_message": "Pagamento mensal de serviço",
            "created_at": "2025-05-22T10:00:00Z",
            "updated_at": "2025-05-22T12:00:00Z"
        }
    ],
    "pagination": {
        "current_page": 1,
        "rows_per_page": 30
    }
}

```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`                          | Description (eng)<br/>`Description`                   | Description (ptbr)<br/>`translation`                                            |
|-------------|----------------------|---------------------------------------------|-----------------------------------------------------|-------------------------------------------------------------------------------|
 403         | APX000025            | User is not allowed to do this transaction        | User is not allowed to do this transaction | Usuário não tem autorização para fazer essa transação |
| 403         | APX000017            | Requester not allowed to access this endpoint        | Requester has no permission to perform pix transfers on this endpoint | Requester não possui permissão de realizar transações pix através deste endpoint |
| 404         | APX000020            | Account not Found             | Account was not found | Conta \{account_key\} não foi encontrada. |

---

# Scenario simulation

URL: /en/documentation/baas/pix_automatico/movimentacoes/simulacao

Step-by-step guide to simulate the creation of recurrences and automatic payments within the scope of PIX Automático. These simulations include creating recurrences and creating scheduled payments.

## 1 - Recurrence creation simulation

### Request

ENDPOINT /mock/incoming_recurrence
METHOD POST

Request Body: Fixed amount recurrence

```json
{
  "request_control_key": "01585acf-b0c3-4389-baf3-a58abbe92d58",
  "recurrence_type": "fixed_amount",
  "transaction_amount": 100.50,
  "periodicity": "monthly",
  "journey_type": "journey_one",
  "start_date": "2025-07-01",
  "is_retry_allowed": true,
  "payer_account_information": {
    "owner_name": "John Doe",
    "document_number": "06975239000136",
    "ispb": "32402502",
    "account_digit": "7",
    "account_branch": "3",
    "account_number": "9552432"
}
```

Request Body: Variable amount recurrence

```json
{
  "request_control_key": "01585acf-b0c3-4389-baf3-a58abbe92d58",
  "recurrence_type": "variable_amount",
  "minimum_transaction_amount": 50.00,
  "periodicity": "monthly",
  "journey_type": "journey_one",
  "start_date": "2025-07-01",
  "is_retry_allowed": true,
  "payer_account_information": {
    "owner_name": "John Doe",
    "document_number": "06975239000136",
    "ispb": "32402502",
    "account_digit": "7",
    "account_branch": "3",
    "account_number": "9552432"}
```

### Request Body Object

| Field                           | Type           | Description                                                  | Max. Char.   |
|--------------------------------|----------------|--------------------------------------------------------------|--------------|
| **request_control_key***       | string         | Unique request identification key in uuid4 format          | 36           |
| **recurrence_type***           | string         | Recurrence type (fixed_amount or variable_amount)           | 20           |
| **transaction_amount**         | number, null   | Transaction amount for fixed amount recurrence (fixed_amount) | 10           |
| **minimum_transaction_amount** | number, null   | Minimum transaction amount for variable amount recurrence (variable_amount) | 10           |
| **periodicity***               | string         | Recurrence periodicity                                       | 20           |
| **journey_type***              | string         | Authorization journey type                                   | 50           |
| **start_date***                | string         | Recurrence start date (YYYY-MM-DD format)                   | 10           |
| **end_date**                   | string, null   | Recurrence end date (YYYY-MM-DD format)                     | 10           |
| **is_retry_allowed***          | boolean        | Transaction retry permission                                 | -            |
| **payer_account_information*** | object         | Payer account data                                          | -            |
| **pix_message**                | string, null   | PIX message associated with the transaction                  | 140          |

:::caution Note
At least one of the fields `transaction_amount` or `minimum_transaction_amount` must be provided with a non-null value. Both fields cannot be null simultaneously.
:::

### payer_account_information Object

| Field                      | Type   | Description                                         | Max. Char.   |
|----------------------------|--------|-----------------------------------------------------|--------------|
| **owner_name***            | string | Account holder name                                 | 150          |
| **document_number***       | string | Account holder CPF or CNPJ (numbers only)          | 14           |
| **ispb***                  | string | Financial institution ISPB code                     | 8            |
| **account_digit***         | string | Account digit                                       | 1            |
| **account_branch***        | string | Account branch                                      | 6            |
| **account_number***        | string | Account number                                      | 20           |

:::info Recurrence Types
- **Fixed amount recurrence (fixed_amount)**: Use the `transaction_amount` field and do not send `minimum_transaction_amount`
- **Variable amount recurrence (variable_amount)**: Use the `minimum_transaction_amount` field and do not send `transaction_amount`
:::

## Response

STATUS 200

Response Body

```json
{
    "incoming_recurrence_key": "e13c5986-f4d1-4d07-a56b-eda90862630a",
    "incoming_recurrence_spi_id": "RR32402502202507170197A5B7CB9",
    "incoming_recurrence_status": "pending_confirmation",
    "created_at": "2025-07-17T14:44:38Z",
    "account_key": "ba685cfd-3aee-4992-b6bf-58f8038faa6b"
}
```

### Response Body

| Field                         | Type       | Description                                                  | Characters   |
|-------------------------------|------------|--------------------------------------------------------------|------------|
| `incoming_recurrence_key`     | uuid       | Unique incoming recurrence identification key               | 36         |
| `incoming_recurrence_spi_id`  | string     | Incoming recurrence SPI identifier                          | 29         |
| `incoming_recurrence_status`  | enumerator | Current incoming recurrence status                          | [incoming_recurrence_status Enumerators](#incoming_recurrence_status-enumerators) |
| `created_at`                  | string     | Recurrence creation date and time (ISO 8601 format)        | -          |
| `account_key`                 | uuid       | Unique account identification key                           | 36         |

### incoming_recurrence_status Enumerators

| Enumerator              | Description                        |
|-------------------------|------------------------------------|
| `pending_confirmation`  | Recurrence pending confirmation    |
| `active`                | Active recurrence                  |
| `cancelled`             | Cancelled recurrence               |
| `suspended`             | Suspended recurrence               |
| `expired`               | Expired recurrence                 |

## 2 - Payment creation simulation

### Request

ENDPOINT /mock/incoming_recurrence/ INCOMING_RECURRENCE_SPI_ID /outgoing_payment
METHOD POST

Request Body

```json
{
  "transaction_amount": 100.50,
  "target_account_data": {
    "owner_name": "John Doe",
    "owner_document_number": "06975239000136",
    "ispb": "32402502",
    "account_digit": "7",
    "account_branch": "3",
    "account_type": "checking_account",
    "account_number": "9552432"
  },
  "receiver_conciliation_id": "3d7d6a2bf72f44z7bb2079a2b94dff56452",
  "outgoing_payment_spi_id": "7d2d1b6cd72f44z7bb2079a2b94dff52673",
  "end_to_end_id": "E60701190202110191604DY5LHIZ9O66",
  "next_execution_datetime": "2023-06-01"
}
```

### Request Body Object

| Field                         | Type   | Description                                                  | Max. Char.   |
|-------------------------------|--------|--------------------------------------------------------------|--------------|
| **transaction_amount***       | number | Transaction amount                                           | 10           |
| **target_account_data**       | object | Target account data                                          | -            |
| **receiver_conciliation_id*** | string | Receiver conciliation identification                         | 35           |
| **outgoing_payment_spi_id***  | string | Payment SPI identifier                                       | 20           |
| **end_to_end_id***            | string | PIX transaction idempotency key in SPI                       | 32           |
| **next_execution_datetime**   | string | Next execution date and time (YYYY-MM-DD format)            | 10           |

### target_account_data Object

| Field                      | Type   | Description                                         | Max. Char.   |
|----------------------------|--------|-----------------------------------------------------|--------------|
| **owner_name***            | string | Account holder name                                 | 150          |
| **owner_document_number*** | string | Account holder CPF or CNPJ (numbers only)          | 14           |
| **ispb_number***                  | string | Financial institution ISPB code                     | 8            |
| **account_digit***         | string | Account digit                                       | 1            |
| **account_branch***        | string | Account branch                                      | 6            |
| **account_type***          | string | Account type                                        | 20           |
| **account_number***        | string | Account number                                      | 20           |

### account_type Enumerator

| Enumerator           | Description         |
|----------------------|---------------------|
| **checking_account** | Checking Account    |
| **salary_account**   | Salary Account      |
| **saving_account**   | Savings Account     |
| **payment_account**  | Payment Account     |

### periodicity Enumerators

| Enumerator    | Description           |
|---------------|-----------------------|
| **weekly**    | Weekly recurrence     |
| **monthly**   | Monthly recurrence    |
| **quarterly** | Quarterly recurrence  |
| **semiannual**| Semiannual recurrence |
| **annual**    | Annual recurrence     |

### journey_type Enumerators

| Enumerator                     | Description                                                                  |
|--------------------------------|------------------------------------------------------------------------------|
| **journey_one**                | Authorization request via app notification                                   |
| **journey_two**                | Authorization request via QR Code reading                                   |
| **journey_three**              | Recurrence authorization through an immediate pix via QR Code reading       |
| **journey_four**               | Payment or scheduling of a pix with a recurrence authorization request in sequence |

---

# Webhooks

URL: /en/documentation/baas/pix_automatico/movimentacoes/webhooks

Once transfers occur asynchronously, proper mapping and handling of sent webhooks is of utmost importance.

:::danger Attention!
QI Tech webhooks should not be mapped in a restrictive manner.
Additional fields may be included in webhook payloads returned by our APIs.
:::

## Webhook for Automatic PIX recurrence creation  

Webhook intended with information about customer recurrence creation

### Webhook Request Body

Request Body: Recurrence creation

```json
{
    "webhook_type": "baas.automatic_pix.incoming_recurrence",
    "webhook_datetime": "2025-10-22T20:30:23.459Z",
    "data": {
        "account_key": "13385acf-b0c3-4389-baf3-a58abbe92d58",
        "incoming_recurrence_key": "12385acf-b0c3-4389-baf3-a58abbe92d58",
        "incoming_recurrence_status": "pending_confirmation",
        "transaction_amount": "150.00",
        "periodicity": "monthly",
        "journey_type": "journey_one",
        "pix_transfer_type": "key",
        "end_to_end_id": "E1234567890123456789012",
        "start_date": "2025-06-01",
        "end_date": "2026-06-01",
        "receiver_conciliation_id": "rec-conc-789",
        "target_pix_key": "receiver@bank.com.br",
        "payer_document_number": "12345678900",
        "pix_message": "Pagamento mensal de serviço",
        "created_at": "2025-05-22T10:00:00Z",
        "updated_at": "2025-05-22T12:00:00Z"
    }
}
```

### Webhook Body Param
| Field                        | Type      | Description                                                                                              | Max. Characters |
|------------------------------|-----------|----------------------------------------------------------------------------------------------------------|-----------------|
| `webhook_type`               | string    | An enumerator that defines the type of event being reported                                              | 23              |
| `webhook_datetime`           | string    | Date and time of webhook sending                                                                         | 20              |
| `account_key`                | uuid4     | Unique account identification key.                                                                       | 36              |
| `incoming_recurrence_key`    | uuid4     | Unique authorization identification key                                                                  | 36              |
| `incoming_recurrence_status` | string    | PIX recurrence status identifier.                                                                        | [incoming_recurrence_status enumerators](#incoming_recurrence_status-enumerators) |
| `transaction_amount`         | number    | Transfer amount for fixed value occurrence.                                                              | 10              |
| `minimum_transaction_amount` | number    | Minimum transfer amount for variable value occurrence.                                                   | 10              |
| `maximum_transaction_amount` | number    | Maximum transfer amount for variable value occurrence.                                                   | 10              |
| `periodicity`                | enum      | Type of periodicity associated with the payment                                                          | [periodicity enumerators](#periodicity-enumerators) |
| `journey_type`               | enum      | Type of request journey                                                                                  | [journey_type enumerators](#journey_type-enumerators) |
| `pix_transfer_type`          | enum      | Type of PIX to be performed                                                                              | [pix_transfer_type enumerators](#pix_transfer_type-enumerators) |
| `end_to_end_id`              | string    | Idempotency key of a PIX transaction within SPI.                                                        | 32              |
| `start_date`                 | string    | Recurrence start date                                                                                    | -               |
| `end_date`                   | string    | Recurrence end date, for indefinite time cases, send as null                                            | -               |
| `receiver_conciliation_id`   | string    | Receiver conciliation identification.                                                                    | 35              |
| `target_pix_key`             | string    | PIX key of the transaction account.                                                                      | 100             |
| `payer_document_number`      | string    | Transaction payer's document number                                                                      | 14              |
| `pix_message`                | string    | Message to be sent along with the PIX transfer.                                                         | 140             |
| `created_at`                 | string    | Recurrence request creation time                                                                         | -               |
| `updated_at`                 | string    | Recurrence request update time                                                                           | -               |

### incoming_recurrence_status Enumerators

| Enumerator           | Description           |
|----------------------|---------------------|
| `pending_confirmation` | Recurrence pending confirmation      |
| `active`   | Active recurrence       |
| `cancelled`   | Cancelled recurrence      |
| `suspended`  | Suspended recurrence |
| `expired`  | Expired recurrence |

### periodicity Enumerators
| Enumerator       | Description          |
|------------------|--------------------|
| `weekly` | Weekly recurrence |
| `monthly` | Monthly recurrence  |
| `quarterly` | Quarterly recurrence     |
| `semiannual` | Semiannual recurrence     |
| `annual` | Annual recurrence      |

### journey_type Enumerators
| Enumerator       | Description          |
|------------------|--------------------|
| `journey_one` | Authorization request through an app notification |
| `journey_two` | Authorization request through QR Code reading  |
| `journey_three` | Recurrence authorization through an immediate PIX via QR Code reading     |
| `journey_four` | Payment or scheduling of a PIX with a recurrence authorization request in sequence      |

### pix_transfer_type Enumerators

| Enumerator          | Description                                |
|---------------------|------------------------------------------|
| `manual`          | PIX using destination account data |
| `key`             | PIX using a PIX key             |
| `static_qr_code`  | PIX using a static QR code       |
| `dynamic_qr_code` | PIX using a dynamic QR code       |

[//]: # (Break here for new page -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------)

---

# Update Payment Order Value

URL: /en/documentation/baas/pix_automatico/pagamentos/atualizar_payment_order

## Request

ENDPOINT /account/ ACCOUNT_KEY /outgoing_recurrence/ OUTGOING_RECURRENCE_KEY /payment_order/ PAYMENT_ORDER_KEY
METHOD PATCH

### Path Params

| Field                    | Type   | Description                                        | Characters |
|--------------------------|--------|----------------------------------------------------|------------|
| `ACCOUNT_KEY`            | uuidv4 | Unique account identification key.                 | 36         |
| `OUTGOING_RECURRENCE_KEY`| uuidv4 | Unique key of the recurrence to be updated.       | 36         |
| `PAYMENT_ORDER_KEY`      | uuidv4 | Unique key of the payment order to be updated.    | 36         |

### Request Body

Update Payment Order

```json
{
    "transaction_amount": 100
}
```

### Request Body Params

| Field                | Type     | Description                        | Characters |
|----------------------|----------|------------------------------------|------------|
| `transaction_amount` | floating | Transaction amount to be updated.  | -          |

## Response

STATUS 200

Response Body

```json
{}
```

STATUS 4XX

Response Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em português",
  "code": "codigo"
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`                | Description (eng)<br/>`description`                                          | Description (ptbr)<br/>`translation`                                 |
|-------------|----------------------|-----------------------------------|----------------------------------------------------------------------------|--------------------------------------------------------------------|
| 400         | QIT000002            | Bad Request                       | Invalid request schema.                                                    | Erro no esquema da requisição.                                     |
| 404         | APX000404            | Payment Order Not Found      | Payment Order \{payment_order_key\} not found.                   | Lote de conciliação \{payment_order_key\} não encontrado.      |

---

# Cancel a Payment Order

URL: /en/documentation/baas/pix_automatico/pagamentos/cancelar_payment_order

This endpoint allows canceling a specific payment order associated with an automatic Pix recurrence.

:::warning
It is only possible to cancel a payment order that has pending_conciliation or pending status, until 10 PM on the day before the reference_date.
:::

## Request

ENDPOINT /automatic_pix/account/ ACCOUNT_KEY /outgoing_recurrence/ OUTGOING_RECURRENCE_KEY /payment_order/ PAYMENT_ORDER_KEY /cancel
METHOD PATCH

### Path Params

| Field                    | Type   | Description                                        | Characters |
|--------------------------|--------|----------------------------------------------------|------------|
| `ACCOUNT_KEY`            | uuidv4 | Unique account identification key.                 | 36         |
| `OUTGOING_RECURRENCE_KEY`| uuidv4 | Unique recurrence key.                             | 36         |
| `PAYMENT_ORDER_KEY`      | uuidv4 | Unique key of the payment order to be canceled.   | 36         |

### Request Body

Cancel Payment Order

```json
{}
```

## Response

STATUS 200

Response Body

```json
{
    "payment_order_key": "10fc62fd-b0a0-4604-9bea-475e91a9dc82",
    "payment_order_conciliation_batch_key": "11fc62fd-b0a0-4604-9bea-475e91a9dc82",
    "payment_order_status": "cancelled"
}
```

### Response Body Params

| Field                                  | Type   | Description                                        | Characters |
|----------------------------------------|--------|----------------------------------------------------|------------|
| `payment_order_key`                    | string | Unique key of the payment order.                   | 36         |
| `payment_order_conciliation_batch_key` | string | Key of the payment order conciliation batch.       | 36         |
| `payment_order_status`                 | string | Current status of the payment order.               | -          |

### payment_order_status Enumerators

| Enumerator            | Description                                        |
|-----------------------|----------------------------------------------------|
| `pending_conciliation`| Awaiting conciliation.                             |
| `pending`             | Pending and not yet processed.                     |
| `accepted`            | Accepted and awaiting payment.                      |
| `paid`                | Successfully paid.                                  |
| `rejected`            | Rejected and will not be processed.                |
| `cancelled`           | Canceled before payment.                           |

STATUS 4XX

Response Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em português",
  "code": "codigo"
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`                | Description (eng)<br/>`description`                                          | Description (ptbr)<br/>`translation`                                 |
|-------------|----------------------|-----------------------------------|----------------------------------------------------------------------------|--------------------------------------------------------------------|
| 400         | QIT000002            | Bad Request                       | Invalid request schema.                                                    | Erro no esquema da requisição.                                     |
| 404         | APX000404            | Payment Order Not Found      | Payment Order \{payment_order_key\} not found.                   | Lote de conciliação \{payment_order_key\} não encontrado.      |

---

# Query Payment Order

URL: /en/documentation/baas/pix_automatico/pagamentos/consultar_payment_order

## Request

This endpoint allows querying the details of a specific payment order associated with an automatic Pix recurrence.

ENDPOINT /account/ ACCOUNT_KEY /outgoing_recurrence/ OUTGOING_RECURRENCE_KEY /payment_order/ PAYMENT_ORDER_KEY
METHOD GET

### Path Params

| Field                    | Type   | Description                                       | Characters |
|--------------------------|--------|---------------------------------------------------|------------|
| `account_key`            | uuidv4 | Unique account identification key.                | 36         |
| `outgoing_recurrence_key`| uuidv4 | Unique key of the recurrence to be queried.       | 36         |
| `payment_order_key`      | uuidv4 | Unique key of the payment order to be queried.    | 36         |

## Response Body

STATUS 200

Response Body

```json
{
    "outgoing_recurrence_spi_id": "RR2222222220240429njua7shf40k",
    "payment_order_status": "paid",
    "reference_date": "2025-06-30",
    "payment_order_conciliation_batch_key": "21fc62fd-b0a0-4604-9bea-475e91a9dc82",
    "receiver_conciliation_id": "cac0b5f7-4ee2-40f1-b2ad-16902506503d",
    "transaction_amount": 125.53,
    "transaction_key": "21fc62fd-b0a0-4604-9bea-475e91a9dc56",
    "incoming_pix_transfer_key": "21fc62fd-b0a0-4604-9bea-475e91a9dc56",
    "debtor_account_data": {
        "account_number": "897465",
        "account_digit": "1",
        "account_branch": "0123",
        "ispb": "323243"
    },
    "created_at": "2021-10-22T20:30:23.459Z",
    "paid_at": "2023-10-22T20:30:23.459Z",
    "payment_order_attempts": [
        {
            "payment_order_attempt_key": "uuid",
            "end_to_end_id": "id",
            "payment_order_attempt_status": "sent",
            "payment_order_attempt_error": {
                "code": "code",
                "description": "description do error",
                "translation": "translation"
            },
            "created_at": "2021-10-22T20:30:23.459Z"
        }
    ]
}
```

### Response Body Params

| Field                              | Type     | Description                                                               | Characters |
|------------------------------------|----------|---------------------------------------------------------------------------|------------|
| `outgoing_recurrence_spi_id`       | string   | SPI ID of the automatic recurrence.                                       | 36         |
| `payment_order_status`             | string   | Current status of the payment order.                                       |[payment_order_status Enumerators](#payment_order_status)        |
| `reference_date`                   | string   | Reference date of the charge.                                             | 10         |
| `payment_order_conciliation_batch_key`| uuidv4 | Conciliation batch key of the payment order.                             | 36         |
| `receiver_conciliation_id`         | uuidv4   | Receiver conciliation ID.                                                 | 36         |
| `transaction_amount`               | number   | Transaction amount.                                                       | -          |
| `transaction_key`                  | uuidv4   | Unique transaction key.                                                   | 36         |
| `incoming_pix_transfer_key`        | uuidv4   | Incoming Pix transfer key.                                                | 36         |
| `debtor_account_data`              | object   | Debtor account data.                                                      | [debtor_account_data Object](#debtor_account_data-object) |
| `created_at`                       | string   | Order creation date/time.                                                 | -          |
| `paid_at`                          | string   | Payment completion date/time.                                             | -          |
| `payment_order_attempts`           | array    | Payment attempts for the order.                                          | [payment_order_attempts Array](#payment_order_attempts-array) |

### debtor_account_data Object

| Field            | Type   | Description                | Characters |
|------------------|--------|----------------------------|------------|
| `account_number` | string | Account number             | -          |
| `account_digit`  | string | Account digit              | -          |
| `account_branch` | string | Branch                     | -          |
| `ispb`           | string | Financial institution ISPB | -          |

### payment_order_attempts Array

| Field                        | Type     | Description                                                    | Characters |
|------------------------------|----------|----------------------------------------------------------------|------------|
| `payment_order_attempt_key`  | string   | Unique key of the payment attempt.                             | 36         |
| `end_to_end_id`              | string   | End-to-end identifier of the attempt.                          | 36         |
| `payment_order_attempt_status`| string  | Status of the payment attempt.                                 | -          |
| `payment_order_attempt_error`| object   | Error associated with the payment attempt.                     | [payment_order_attempt_error Object](#payment_order_attempt_error-object) |
| `created_at`                 | string   | Attempt creation date/time.                                    | -          |

### payment_order_attempt_error Object

| Field       | Type   | Description           | Characters |
|-------------|--------|-----------------------|------------|
| `code`      | string | Error code.           | -          |
| `description`| string | Error description.    | -          |
| `translation`| string | Description translation. | -          |

### payment_order_status Enumerators

| Enumerator            | Description                                        |
|-----------------------|----------------------------------------------------|
| `pending_conciliation`| Awaiting conciliation.                            |
| `pending`             | Pending and not yet processed.                    |
| `accepted`            | Accepted and awaiting payment.                     |
| `paid`                | Successfully paid.                                 |
| `rejected`            | Rejected and will not be processed.               |
| `cancelled`           | Cancelled before payment.                         |

STATUS 4XX

Response Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em português",
  "code": "codigo"
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`                | Description (eng)<br/>`description`                                          | Description (ptbr)<br/>`translation`                                 |
|-------------|----------------------|-----------------------------------|----------------------------------------------------------------------------|--------------------------------------------------------------------|
| 400         | QIT000002            | Bad Request                       | Invalid request schema.                                                    | Erro no esquema da requisição.                                     |
| 404         | APX000002            | Payment Order Not Found           | Payment order \{payment_order_key\} not found.                             | Ordem de pagamento \{payment_order_key\} não encontrada.            |

---

# List Payment Orders by Account

URL: /en/documentation/baas/pix_automatico/pagamentos/listar_account_payment_orders

This endpoint allows listing payment orders associated with a specific account.

ENDPOINT /account/ ACCOUNT_KEY /payment_orders
METHOD GET

### Path Params

| Field        | Type   | Description                                        | Characters |
|--------------|--------|----------------------------------------------------|------------|
| `account_key`| uuidv4 | Unique account identification key.                 | 36         |

### Query Params

| Field                | Type   | Description                                      | Characters |
|----------------------|--------|--------------------------------------------------|------------|
| `payment_order_status`| string | Filters orders by status (e.g., `paid`).        | -          |
| `start_date`         | string | Start date to filter orders (YYYY-MM-DD format). | 10         |
| `end_date`           | string | End date to filter orders (YYYY-MM-DD format).   | 10         |

## Response Body

STATUS 200

Response Body

```json
{
    "payment_orders": [
        {
            "payment_order_key": "a1b2c3d4-e5f6-4789-a123-456789abcdef",
            "payment_order_spi_id": "1a2b3c4d5e6f7890abcdef1234567890",
            "outgoing_recurrence_key": "b2c3d4e5-f6a7-4890-b234-567890abcdef",
            "outgoing_recurrence_spi_id": "RR3240250220251025A1B2C3D4E5F",
            "payment_order_conciliation_batch_key": "c3d4e5f6-a7b8-4901-c345-678901abcdef",
            "payment_order_status": "pending_conciliation",
            "reference_date": "2025-11-15",
            "receiver_conciliation_id": "2b3c4d5e6f7890abcdef1234567890ab",
            "transaction_amount": null,
            "account_key": "d4e5f6a7-b8c9-4012-d456-789012abcdef",
            "transaction_key": null,
            "incoming_pix_transfer_key": null,
            "debtor_account_data": {
                "ispb": "31872495",
                "account_digit": "7",
                "account_branch": "0001",
                "account_number": "123456"
            },
            "created_at": "2025-10-15T03:00:12Z",
            "paid_at": null,
            "payment_order_attempts": []
        },
        {
            "payment_order_key": "e5f6a7b8-c9d0-4123-e567-890123abcdef",
            "payment_order_spi_id": "3c4d5e6f7890abcdef1234567890abcd",
            "outgoing_recurrence_key": "f6a7b8c9-d0e1-4234-f678-901234abcdef",
            "outgoing_recurrence_spi_id": "RR3240250220251025B2C3D4E5F6A",
            "payment_order_conciliation_batch_key": "c3d4e5f6-a7b8-4901-c345-678901abcdef",
            "payment_order_status": "pending",
            "reference_date": "2025-11-15",
            "receiver_conciliation_id": "4d5e6f7890abcdef1234567890abcdef",
            "transaction_amount": 220.00,
            "account_key": "d4e5f6a7-b8c9-4012-d456-789012abcdef",
            "transaction_key": null,
            "incoming_pix_transfer_key": null,
            "debtor_account_data": {
                "ispb": "31872495",
                "account_digit": "7",
                "account_branch": "0001",
                "account_number": "123456"
            },
            "created_at": "2025-10-15T03:00:10Z",
            "paid_at": null,
            "payment_order_attempts": []
        }
    ],
    "pagination": {
        "page": 1,
        "page_size": 25,
        "number_of_pages": 9
    }
}
```

### Response Body Params

| Field                                  | Type     | Description                                                         | Characters |
|----------------------------------------|----------|---------------------------------------------------------------------|------------|
| `payment_order_key`                    | uuidv4   | Unique payment order key.                                           | 36         |
| `payment_order_spi_id`                 | string   | Payment order SPI ID.                                               | 32         |
| `outgoing_recurrence_key`              | uuidv4   | Unique outgoing recurrence key.                                     | 36         |
| `outgoing_recurrence_spi_id`           | string   | Automatic recurrence SPI ID.                                        | 27         |
| `payment_order_conciliation_batch_key` | uuidv4   | Payment order conciliation batch key.                              | 36         |
| `payment_order_status`                 | string   | Current payment order status.                                       | -          |
| `reference_date`                       | string   | Charge reference date.                                              | 10         |
| `receiver_conciliation_id`             | string   | Receiver conciliation ID.                                           | 32         |
| `transaction_amount`                   | number   | Transaction amount (can be null).                                   | -          |
| `account_key`                          | uuidv4   | Unique account key.                                                 | 36         |
| `transaction_key`                      | uuidv4   | Unique transaction key (can be null).                              | 36         |
| `incoming_pix_transfer_key`            | uuidv4   | Incoming PIX transfer key (can be null).                           | 36         |
| `debtor_account_data`                  | object   | Debtor account data.                                                | [debtor_account_data Object](#debtor_account_data-object) |
| `created_at`                           | string   | Order creation date/time (ISO 8601 format).                        | -          |
| `paid_at`                              | string   | Payment completion date/time (ISO 8601 format, can be null).       | -          |
| `payment_order_attempts`               | array    | Payment order attempts.                                             | [payment_order_attempts Array](#payment_order_attempts-array) |

### debtor_account_data Object

| Field            | Type   | Description                    | Characters |
|------------------|--------|--------------------------------|------------|
| `account_number` | string | Account number                 | -          |
| `account_digit`  | string | Account digit                  | -          |
| `account_branch` | string | Branch                         | -          |
| `ispb`           | string | Financial institution ISPB     | -          |

### payment_order_attempts Array

| Field                        | Type     | Description                                                    | Characters |
|------------------------------|----------|----------------------------------------------------------------|------------|
| `payment_order_attempt_key`  | string   | Unique payment attempt key.                                    | 36         |
| `end_to_end_id`              | string   | End-to-end identifier for the attempt.                        | 32         |
| `due_date`                   | string   | Attempt due date (YYYY-MM-DD format, can be null).           | 10         |
| `payment_order_attempt_status`| string  | Payment attempt status.                                        | -          |
| `payment_order_attempt_error`| object   | Error associated with the payment attempt (can be null).      | [payment_order_attempt_error Object](#payment_order_attempt_error-object) |
| `sent_at`                    | string   | Attempt send date/time (ISO 8601 format, can be null).        | -          |
| `created_at`                 | string   | Attempt creation date/time (ISO 8601 format).                 | -          |

### payment_order_attempt_error Object

| Field       | Type   | Description              | Characters |
|-------------|--------|--------------------------|------------|
| `code`      | string | Error code.              | -          |
| `description`| string | Error description.       | -          |
| `translation`| string | Description translation. | -          |

### payment_order_status Enumerators

| Enumerator              | Description                                        |
|-------------------------|----------------------------------------------------|
| `pending_conciliation`  | Payment order is pending conciliation             |
| `pending`               | Payment order is pending                           |
| `accepted`              | Payment order has been accepted                    |
| `paid`                  | Payment order has been paid                        |
| `rejected`              | Payment order has been rejected                    |
| `cancelled`             | Payment order has been cancelled                   |

STATUS 4XX

Response Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em português",
  "code": "codigo"
}
```

| HTTP Code   | QI Code<br/>`code`   | Title<br/>`title`                 | Description (eng)<br/>`description`                                        | Description (ptbr)<br/>`translation`                               |
|-------------|----------------------|-----------------------------------|----------------------------------------------------------------------------|--------------------------------------------------------------------|
| 400         | QIT000002            | Bad Request                       | Invalid request schema.                                                    | Erro no esquema da requisição.                                     |
| 404         | APX000002            | Payment Order Not Found           | Payment order \{payment_order_key\} not found.                             | Ordem de pagamento \{payment_order_key\} não encontrada.            |

---

# Decode QR Code for Automatic PIX

URL: /en/documentation/baas/pix_automatico/qr_code/decodificar_qr_code

## Request

ENDPOINT /account/ ACCOUNT_KEY /qrcode/decode
METHOD POST

### Request Path Params

| Field       | Type   | Description                      | Characters |
|-------------|--------|--------------------------------|------------|
| `account_key` * | uuid4  | Unique account identification key. | 36 |

### Request Body

Request Body: Decode QR Code

```json
{
    "qr_code_payload": "00020101021226840014br.gov.bcb.pix2562invoice.starkbank.com/v2/cobv/8b434df48c30482a81f7c936ae35cc87080400005303986540555.595802BR5925Stark Bank S.A.6015Sao Caetano do Sul62070503***80740014br.gov.bcb.pix2552pix.example.com/rec/2353c790eefb11eaadc10242ac120002630411FC"
}
```

### Body Params

| Field                   | Type       | Description                                                                                                                                                                                                                                        | Characters |
|-------------------------|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|
| `qr_code_payload` *           | string     | PIX Copy and Paste URL                                                                                                                                                                                | -        |

## Response

STATUS 200

Response Body: Decoded QR

```json
{
    "end_to_end_id": "E32402502202303101532yCipbxgUnUj",
    "qr_code_payload": "00020101021226840014br.gov.bcb.pix2562invoice.starkbank.com/v2/cobv/8b434df48c30482a81f7c936ae35cc87080400005303986540555.595802BR5925Stark Bank S.A.6015Sao Caetano do Sul62070503***80740014br.gov.bcb.pix2552pix.example.com/rec/2353c790eefb11eaadc10242ac120002630411FC",
    "qr_code_key": "8c2c19bd-f260-4714-955c-956f3eaa30ca",
    "qr_code_type": "dynamic_composed",
    "qr_code_data": {
        "incoming_recurrence": {
            "incoming_recurrence_key": "67abc123-4567-89ab-cdef-1234567890ab",
            "journey_type": "j2_recurrence_only_qrcode",
            "incoming_recurrence_type": "variable_amount",
            "incoming_recurrence_status": "pending_confirmation",
            "start_date": "2024-08-01",
            "end_date": null,
            "periodicity": "weekly",
            "target_pix_key": "teste.recorrencia@email.com.br",
            "minimum_transaction_amount": "100.00",
            "maximum_transaction_amount": "500.00",
            "transaction_amount": null,
            "is_retry_allowed": true,
            "created_at": "2024-07-23T14:30:45.123Z",
            "payer_document_number": "12345678901",
            "payer_name": "João da Silva",
            "payer_account_key": "a5d7e60f-1c9b-4b8a-9de7-6f3b919cc45d",
            "request_control_key": "c7d7e60f-1c9b-4b8a-9de7-6f3b919cc45f",
            "receiver_conciliation_id": "RRAUTOTESTE001",
            "pix_message": "Autorização de débito mensal"
        },
        "payment_data": {
            "request_control_key": "c7d7e60f-1c9b-4b8a-9de7-6f3b919cc45f",
            "transaction_amount": "150.75",
            "target_pix_key": "teste.recorrencia@email.com.br",
            "target_account": null,
            "receiver_conciliation_id": "fgnb4NTt7pOUBGfrcporERwVVqr0f8PWRfK",
            "pix_message": "Assinatura mensal do serviço"
        }
    }
}
```

| Field                          | Type    | Description                                                                                                                                                                                                                                                                                     | Max. Characters                                                   |
|--------------------------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| `end_to_end_id`        | string     | Idempotency key for a PIX transaction within the SPI (Instant Payment System). This key is returned when querying PIX keys. | 32 |
| `qr_code_payload`          | string     | PIX Copy and Paste URL  |  |
| `qr_code_key`  | uuid4    | Unique QR code identification key                                                                                                                                                              | 36         |         
 `qr_code_data`       | Object     | QR code data | [qr_code_data Object](#qr_code_data-object) | 10 |

### qr_code_data Object

| Field                     | Type       | Description                                           | Characters                                              |
|---------------------------|------------|-----------------------------------------------------|---------------------------------------------------------|
| `incoming_recurrence`         | object     | Recurrence identification object |   [incoming_recurrence Object](#incoming_recurrence-object)                                                     |
| `payment_data`          | object     | Object with payment information for journey_types: *j3_payment_and_recurrence_qrcode*, *j4_recurrence_offer_post_payment* | [payment_data Object](#payment_data-object)  

### incoming_recurrence Object

| Field                     | Type       | Description                                           | Characters                                              |
|---------------------------|------------|-----------------------------------------------------|---------------------------------------------------------|
| `incoming_recurrence_key`  | uuid4    | Unique authorization identification key                                                                                                                                                              | 36         | 
| `incoming_recurrence_status`               | string  |Recurrence status identifier                                                                                                                                         | [incoming_recurrence_status Enumerator](#incoming_recurrence_status-enumerator)                                                           |
| `request_control_key`  | uuid4     | Unique request identification key used by the client                                                                                                                                                              | 36         | 
| `transaction_amount`   | number     | Transfer amount for fixed value occurrence.                                                                                                                                                                                                                         | 10         |
| `minimum_transaction_amount`   | number     | Minimum transfer amount for variable value occurrence.                                                                                                                                                                                                                         | 10         |
| `maximum_transaction_amount`   | number     | Maximum transfer amount for variable value occurrence.                                                                                                                                                                                                                         | 10         |
| `periodicity`    | enumerator | Type of periodicity associated with the payment                                                                                                                                           | [periodicity Enumerators](#periodicity-enumerators)     |
| `journey_type`    | enumerator | Type of request journey                                                                                                                                                    | [journey_type Enumerators](#journey_type-enumerators)     |
| `end_to_end_id`        | string     | Idempotency key for a PIX transaction within the SPI (Instant Payment System). This key is returned when querying PIX keys. | 32 |
| `start_date`    | string | Recurrence start date                                                                                                                                                         | -      |
| `end_date`   | string | Recurrence end date, for indefinite time cases, send as null                                                                                                                        
| `next_execution_date`    | string | Execution date for the next recurrence transaction                                                                                                                                                      | -      |
| `receiver_conciliation_id` | string     | Receiver reconciliation identification. | 35                                        |
| `target_pix_key`       | string     | PIX key for the transaction account.                                                                                                                                                                                                    | 100        |
| `is_retry_allowed`           | boolean     | Permission for PIX transaction retry.                                                                                                                                                                                                | -        |
| `payer_document_number`       | string     | Transaction payer document number.                                                                                                                                                                                                    | 14        |
| `payer_name`       | string     | Transaction payer name.                                                                                                                                                                                                    | -        |
| `payer_account_key`       | string     | Transaction payer account identifier.                                                                                                                                                                                                    | -        |
| `pix_message`           | string     | Message to be sent along with the PIX transfer.                                                                                                                                                                                                | 140        |
| `created_at`              | string  | Recurrence request creation time                                                                                                                                       | -          

### payment_data Object

| Field                     | Type       | Description                                           | Characters                                              |
|---------------------------|------------|-----------------------------------------------------|---------------------------------------------------------|
| `request_control_key`  | uuid4     | Unique request identification key used by the client                                                                                                                                                              | 36         |
| `transaction_amount`   | number     | Transfer amount for fixed value occurrence.                                                                                                                                                                                                                         | 10         |
| `target_pix_key`       | string     | PIX key for the transaction account.                                                                                                                                                                                                    | 100        |
| `target_account`       | Object     | Destination account for manual transfers. | [target_account Object](#target_account-object) | 10 |
| `receiver_conciliation_id` | string     | Receiver reconciliation identification. | 35                                        |
| `pix_message`           | string     | Message to be sent along with the PIX transfer.                                                                                                                                                                                                | 140        |

### target_account Object

| Field                     | Type       | Description                                           | Characters                                              |
|---------------------------|------------|-----------------------------------------------------|---------------------------------------------------------|
| `account_branch`         | string     | Account branch.                                   | 6                                                       |
| `account_digit`          | string     | Account digit.                                    | 1                                                       |
| `account_number`         | string     | Account number.                                    | 20                                                      |
| `owner_document_number`  | string     | CPF or CNPJ (numbers only) of the account holder.   | 14                                                      |
| `owner_name`             | string     | Account holder name.                           | 150                                                     |
| `account_type`          | enumerator | Account type.                                      | [account_type Enumerator](#account_type-enumerator) |
| `ispb`                   | string     | Based on the financial institution's CNPJ (8 digits). | 8                                                       |

:::info
Different enumerators may represent the same account type due to information returned by different
institutions.
:::
### account_type Enumerator

| Enumerator           | Description           |
|----------------------|---------------------|
| `checking_account`| Checking Account      |
| `salary_account`   | Salary Account       |
| `saving_account`   | Savings Account      |
| `payment_account`  | Payment Account |

### incoming_recurrence_status Enumerator

| Enumerator           | Description           |
|----------------------|---------------------|
| **pending_confirmation** | Recurrence pending confirmation      |
| **active**   | Active recurrence       |
| **cancelled**   | Cancelled recurrence      |
| **suspended**  | Suspended recurrence |
| **expired**  | Expired recurrence |

### periodicity Enumerators
| Enumerator       | Description          |
|------------------|--------------------|
| `weekly` | Weekly recurrence |
| `monthly` | Monthly recurrence  |
| `quarterly` | Quarterly recurrence     |
| `semiannual` | Semiannual recurrence     |
| `annual` | Annual recurrence      |

### journey_type Enumerators
| Enumerator       | Description          |
|------------------|--------------------|
| `j1_in_app_only_recurrence` | Authorization request through an in-app notification |
| `j2_recurrence_only_qrcode` | Authorization request through QR Code reading  |
| `j3_payment_and_recurrence_qrcode` | Recurrence authorization through an immediate PIX by reading a QR Code     |
| `j4_recurrence_offer_post_payment` | PIX payment or scheduling with a subsequent recurrence authorization request      |

### pix_transfer_type Enumerators

| Enumerator          | Description                                |
|---------------------|------------------------------------------|
| `manual`          | PIX using destination account data |
| `key`             | PIX using a PIX key             |
| `static_qr_code`  | PIX using a static QR code       |
| `dynamic_qr_code` | PIX using a dynamic QR code       |

STATUS 4XX

Response Body

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo"
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`           | Description (eng)<br/>`Description`                                   | Description (ptbr)<br/>`translation`                                |
|-------------|----------------------|------------------------------|---------------------------------------------------------------------|-------------------------------------------------------------------|
| 400         | QIT000001            | Bad Request	            | Schema Error                                      | Erro de Schema                       |
 403         | APX000025            | User is not allowed to do this transaction        | User is not allowed to do this transaction | Usuário não tem autorização para fazer essa transação |
| 403         | APX000017            | Requester not allowed to access this endpoint        | Requester has no permission to perform pix transfers on this endpoint | Requester não possui permissão de realizar transações pix através deste endpoint |
| 404         | APX000020            | Account not Found             | Account was not found | Conta \{account_key\} não foi encontrada. |

---

# Cancel payment recurrence

URL: /en/documentation/baas/pix_automatico/recebedor/cancelar_recorrencia

## Request

ENDPOINT /account/ ACCOUNT_KEY /outgoing_recurrence/ OUTGOING_RECURRENCE_KEY /cancel
METHOD PATCH

### Request Path Params

| Field       | Type   | Description                      | Characters |
|-------------|--------|--------------------------------|------------|
| `account_key` * | uuid4  | Unique account identification key. | 36 |
| `outgoing_recurrence_key` * | uuid4  | Unique authorization identification key                                    | 36 |

### Request Body

Request Body: Cancel a recurrence

```json
{
  "outgoing_recurrence_status": "cancelled",
}
```

### Body Params

| Field                   | Type       | Description                                                                                                                                                                                                                                        | Characters |
|-------------------------|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|
| `outgoing_recurrence_status` *           | string     | Pix recurrence status identifier.                                                                                                                                                                                                | cancelled        |
## Response

STATUS 200

Response Body: Recurrence cancelled

```json
{
  "outgoing_recurrence_key": "cfa32109-a6dd-4304-94db-03a7b6d92a47",
  "outgoing_recurrence_status": "cancelled",
  "created_at": "2025-05-22T20:30:23.459Z",
  "updated_at": "2025-05-22T20:39:23.459Z"
}
```

STATUS 4XX

Response Body

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo"
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`           | Description (eng)<br/>`Description`                                   | Description (ptbr)<br/>`translation`                                |
|-------------|----------------------|------------------------------|---------------------------------------------------------------------|-------------------------------------------------------------------|
| 400         | QIT000001            | Bad Request	            | Schema Error                                      | Erro de Schema                       |
 403         | APX000025            | User is not allowed to do this transaction        | User is not allowed to do this transaction | Usuário não tem autorização para fazer essa transação |
| 403         | APX000017            | Requester not allowed to access this endpoint        | Requester has no permission to perform pix transfers on this endpoint | Requester não possui permissão de realizar transações pix através deste endpoint |
| 404         | APX000020            | Account not Found             | Account was not found | Conta \{account_key\} não foi encontrada. |
| 404         | APX000001            | Recurrence not Found        | Recurrence was not found | Recorrência \{outgoing_recurrence_key\} não foi encontrada |

---

# Query data of a recurrence by outgoing_recurrence_key

URL: /en/documentation/baas/pix_automatico/recebedor/consultar_recorrencia

## Request

ENDPOINT /account/ ACCOUNT_KEY /outgoing_recurrence/ OUTGOING_RECURRENCE_KEY
METHOD GET

### Path Params

| Field                    | Type   | Description                                       | Characters |
|--------------------------|--------|---------------------------------------------------|------------|
| `account_key` *          | uuidv4 | Unique account identification key.                | 36         |
| `outgoing_recurrence_key`*| uuidv4 | Unique key of the recurrence to be queried.      | 36         |

## Response

STATUS 200

Response Body

```json
{
   "request_control_key":"98fc62fd-b0a0-4604-9bea-475e91a9dc82",
   "outgoing_recurrence_key":"8cb70dea-9fb0-4a68-9572-99a72849c8d6",
   "outgoing_recurrence_status":"approved",
   "periodicity":"monthly",
   "journey_type":"journey_four",
   "start_date":"2025-06-10",
   "end_date":"2027-06-10",
   "outgoing_recurrence_data":{
      "minimum_recurrence_amount":123.45,
      "recurrence_amount":null,
      "retry_configuration":{
         "retry_allowed":true,
         "retry_rule":{
            "first_retry":{
               "day":"1",
               "time":"14:00"
            },
            "second_retry":{
               "day":"3",
               "time":"12:00"
            },
            "third_retry":{
               "day":"4",
               "time":"15:32"
            }
         }
      },
      "debtor_data":{
         "name":"Sebastião",
         "email":"sebastiao@test.com",
         "document_number":"05431134850",
         "address":{
            "city":"São Paulo",
            "postal_code":"123456-789",
            "uf":"SP",
            "street":"Av Paulista 123"
         },
         "account_data":{
            "account_number":"123456",
            "account_digit":"7",
            "account_branch":"0001",
            "ispb":"31872495"
         }
      },
      "qr_code_data":{
         "qr_code_key":"0f45cc3d-9bd1-4d68-a865-4cf477b5da45",
         "qr_code_url":"urlqrcode.url",
         "qr_code_image":"image_base64"
      },
      "initial_payment_data":{
         "amount":22.34,
         "pix_key":"3d7d6a2b-f72f-44z7-bb20-79a94dff5645",
         "qr_code_type":"dynamic_term",
         "additional_data":[
            {
               "key_name":"Juros e Multa",
               "value":"Juros 2 ao mes e multa de 1%"
            }
         ],
         "fine_amount":3,
         "interest_amount":2,
         "expiration_date":"2023-03-25",
         "max_payment_days":128,
         "rebate_amount":1,
         "discounts":[],
         "receiver_conciliation_id":"3d7d6a2bf72f44z7bb2079a94dff5645",
         "transaction_data":{
            "transaction_key":"4d7d6a2b-f72f-44z7-bb20-79a94dff5645",
            "pix_transfer_key":"5d7d6a2b-f72f-44z7-bb20-79a94dff5645",
            "end_to_end_id":"E32402502202303141907qlBAF1evdJ2"
         }
      },
      "pix_message":"Conta de Luz Residencial nº123",
      "settlement_date_type":"calendar_days"
      },
      "payment_orders":[
         {
            "payment_order_key":"10fc62fd-b0a0-4604-9bea-475e91a9dc82",
            "payment_order_status":"paid",
            "reference_date":"2025-06-30",
            "receiver_conciliation_id":"cac0b5f74ee240f1b2ad16902506503d",
            "transaction_amount":125.53,
            "transaction_key":"21fc62fd-b0a0-4604-9bea-475e91a9dc56",
            "incoming_pix_transfer_key":"21fc62fd-b0a0-4604-9bea-475e91a9dc56",
            "created_at":"2021-10-22T20:30:23.459Z",
            "paid_at":"2023-10-22T20:30:23.459Z"
         }
      ],
      "outgoing_recurrence_events":[
         {
            "outgoing_recurrence_event_key":"20fc62fd-b0a0-4604-9bea-475e91a9dc82",
            "outgoing_recurrence_status":"created",
            "created_at":"2021-10-22T20:30:23.459Z"
         }
      ]
}
```

### Response Body Params

| Field                        | Type       | Description                                                                                   | Characters |
|------------------------------|------------|---------------------------------------------------------------------------------------------|------------|
| `request_control_key`        | uuidv4     | Unique key for request control.                                                    | 36         |
| `outgoing_recurrence_key`    | uuidv4     | Identifier of the automatic recurrence.                                                    | 36         |
| `outgoing_recurrence_status` | string     | Current status of the recurrence (`approved`, `pending`, `rejected`, etc.).                      | 30         |
| `periodicity`                | enumerator | Recurrence periodicity.                                                               | [periodicity Enumerators](#periodicity-enumerators)      |
| `journey_type`               | enumerator | Automatic recurrence journey.                                                          | [journey_type Enumerators](#journey_type-enumerators)    |
| `start_date`                 | string     | Recurrence start date (ISO 8601 format, e.g., `2025-06-10`).                      | 10         |
| `end_date`                   | string     | Recurrence end date (ISO 8601 format) or null if indefinite.                | 10 or null |
| `outgoing_recurrence_data`   | object     | Object grouping subscription parameters and additional data.                           | [outgoing_recurrence_data Object](#outgoing_recurrence_data-object) |
| `payment_orders`             | array      | Object grouping subscription parameters and additional data.                           | [payment_orders Object](#payment_orders-object) |
| `outgoing_recurrence_events` | array      | Object grouping recurrence event parameters                                      | [outgoing_recurrence_events Object](#outgoing_recurrence_events-object) |

### outgoing_recurrence_data Object

| Field                       | Type     | Description                                                          | Characters |
|-----------------------------|----------|--------------------------------------------------------------------|------------|
| `minimum_recurrence_amount` | number   | Minimum expected amount in variable amount recurrences           | -          |
| `recurrence_amount`         | number   | Recurrence amount (for fixed amount; null if variable)           | -          |
| `retry_configuration`       | object   | Retry configuration for incomplete recurrences         | [retry_configuration Object](#retry_configuration-object)   |
| `debtor_data`               | object   | Debtor (subscriber) data                                       | [debtor_data Object](#debtor_data-object)                  |
| `qr_code_data`              | object   | QR Code data generated for payment (if any)                | [qr_code_data Object](#qr_code_data-object)                |
| `initial_payment_data`      | object   | Initial charge data                                          | [initial_payment_data Object](#initial_payment_data-object) |
| `pix_message`               | string   | Message sent along with the PIX transaction                             | 140        |
| `settlement_date_type`      | enumerator| Settlement date adjustment type                               | [settlement_date_type Enumerators](#settlement_date_type-enumerators) |

---

### retry_configuration Object

| Field           | Type    | Description                                   | Characters |
|-----------------|---------|---------------------------------------------|------------|
| `retry_allowed` | boolean | Indicates if retries are enabled    | -          |
| `retry_rule`    | object  | Detailed retry rules          | [retry_rule Object](#retry_rule-object) |

---

### retry_rule Object

| Field         | Type   | Description                         | Characters |
|---------------|--------|-----------------------------------|------------|
| `first_retry` | object | Configuration for 1st retry  | [retry_detail Object](#retry_detail-object) |
| `second_retry`| object | Configuration for 2nd retry  | [retry_detail Object](#retry_detail-object) |
| `third_retry` | object | Configuration for 3rd retry  | [retry_detail Object](#retry_detail-object) |

---

### retry_detail Object

| Field | Type   | Description               | Characters |
|-------|--------|-------------------------|------------|
| `day` | string | Retry day.     | -          |
| `time`| string | Retry time. | -          |

---

### debtor_data Object

| Field             | Type   | Description              | Characters |
|-------------------|--------|------------------------|------------|
| `name`            | string | Subscriber name.     | 50         |
| `email`           | string | Subscriber email.   | 100        |
| `document_number` | string | CPF or CNPJ.           | 14         |
| `address`         | object | Subscriber address. | [address Object](#address-object) |
| `account_data`    | object | Bank account data.       | [account_data Object](#account_data-object) |

---

### address Object

| Field         | Type   | Description         | Characters |
|---------------|--------|-------------------|------------|
| `city`        | string | City.           | -          |
| `postal_code` | string | ZIP code.              | -          |
| `uf`          | string | State (abbreviation).   | -          |
| `street`      | string | Street address.       | -          |

---

### account_data Object

| Field           | Type   | Description                    | Characters |
|-----------------|--------|------------------------------|------------|
| `account_number`| string | Account number              | -          |
| `account_digit` | string | Account digit              | -          |
| `account_branch`| string | Branch                      | -          |
| `ispb`          | string | Financial institution ISPB| -         |

---

### qr_code_data Object

| Field            | Type   | Description                                   | Characters |
|------------------|--------|---------------------------------------------|------------|
| `qr_code_key`    | string | Generated QR Code identifier             | -          |
| `qr_code_url`    | string | URL for QR Code viewing            | -          |
| `qr_code_image`  | string | QR Code image (Base64 encoded)               | -          |

---

### initial_payment_data Object

| Field                     | Type     | Description                                                                | Characters |
|---------------------------|----------|--------------------------------------------------------------------------|------------|
| `amount`                  | number   | Principal amount of the initial charge in reais (R$)                        | -          |
| `pix_key`                 | string   | Destination PIX key for initial payment                            | 77         |
| `qr_code_type`            | enum     | QR Code type for initial charge.                                   | [qr_code_type Enumerators](#qr_code_type-enumerators) |
| `additional_data`         | array    | List of additional information related to the charge                   | [additional_data Array](#additional_data-array) |
| `fine_amount`             | number   | Fine amount in case of late payment                          | -          |
| `interest_amount`         | number   | Interest amount in case of late payment                         | -          |
| `expiration_date`         | string   | Initial charge expiration date (ISO 8601 format)                 | 10         |
| `max_payment_days`        | integer  | Maximum number of acceptance days after expiration                           | -          |
| `rebate_amount`           | number   | Discount amount for early payment                              | -          |
| `discounts`               | array    | List of additional discounts                                            | -          |
| `receiver_conciliation_id`| string   | Payment conciliation identifier by the receiver                 | 35         |
| `transaction_data`        | object   | Transaction details related to the initial charge                     | [transaction_data Object](#transaction_data-object) |

---

### additional_data Array

| Field        | Type    | Description                                                       | Characters |
|--------------|---------|-----------------------------------------------------------------|------------|
| `key_name`   | string  | Additional information name (e.g., "Interest and Fine")              | 140        |
| `value`      | string  | Additional information value or description                      | 140        |

---

### transaction_data Object

| Field               | Type   | Description                              | Characters |
|---------------------|--------|----------------------------------------|------------|
| `transaction_key`   | string | Unique transaction key               | 36         |
| `pix_transfer_key`  | string | PIX transfer identifier     | 36         |
| `end_to_end_id`     | string | PIX end-to-end identifier        | 32         |

---

### payment_orders Object

| Field                       | Type    | Description                                               | Characters |
|-----------------------------|---------|---------------------------------------------------------|------------|
| `payment_order_key`         | string  | Unique payment order identifier key        | 32         |
| `payment_order_status`      | string  | Payment order status                            | -          |
| `reference_date`            | string  | Charge reference date                          | -          |
| `receiver_conciliation_id`  | uuidv4  | Receiver conciliation ID                          | 35         |
| `transaction_amount`        | number  | Transaction monetary amount                            | -          |
| `transaction_key`           | uuidv4  | Unique transaction key                                | 36         |
| `incoming_pix_transfer_key` | uuidv4  | Received PIX transfer key                     | 36         |
| `created_at`                | string  | Order creation date/time (ISO 8601 format)        | -          |
| `paid_at`                   | string  | Payment execution date/time (ISO 8601 format)      | -          |

### outgoing_recurrence_events Object

| Field                       | Type    | Description                                               | Characters |
|-----------------------------|---------|---------------------------------------------------------|------------|
| `outgoing_recurrence_event_key`         | string  | Unique recurrence event identifier key        | 36         |
| `outgoing_recurrence_status`      | string  | Recurrence status                            | -          |
| `created_at`                | string  | Order creation date/time (ISO 8601 format)        | -          |

### periodicity Enumerators

| Enumerator   | Description             |
|--------------|----------------------|
| `weekly`     | Weekly recurrence   |
| `monthly`    | Monthly recurrence    |
| `quarterly`  | Quarterly recurrence|
| `semiannual` | Semiannual recurrence |
| `annual`     | Annual recurrence     |

---

### journey_type Enumerators

| Enumerator      | Description                                     |
|-----------------|-----------------------------------------------|
| `journey_one`   | Direct notification in the banking app     |
| `journey_two`   | QR Code experience for recurring charge  |
| `journey_three` | Instant payment + QR Code recurrence   |
| `journey_four`  | Recurring opt-in from PIX operation    |

---

### settlement_date_type Enumerators

| Enumerator      | Description             |
|-----------------|----------------------|
| `workdays`      | Working days           |
| `calendar_days` | Calendar days         |

---

### qr_code_type Enumerators

| Enumerator        | Description                                                   |
|-------------------|------------------------------------------------------------|
| `dynamic_instant` | Dynamic QR Code for instant payment                 |
| `dynamic_term`    | Dynamic QR Code for payment with future due date       |

STATUS 4XX

Response Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em português",
  "code": "codigo"
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`                | Description (eng)<br/>`description`                                          | Description (ptbr)<br/>`translation`                                 |
|-------------|----------------------|-----------------------------------|----------------------------------------------------------------------------|--------------------------------------------------------------------|
| 400         | QIT000002            | Bad Request                       | Invalid request schema.                                                    | Erro no esquema da requisição.                                     |
| 404         | APX000002            | Recurrence Not Found              | Recurrence \{recurrence_key\} not found.                                   | Recorrência \{recurrence_key\} não encontrada.                      |

---

# Query Automatic Pix Recurrence Data by QRCode

URL: /en/documentation/baas/pix_automatico/recebedor/consultar_recorrencia_receiver

## Request

ENDPOINT /account/ ACCOUNT_KEY /outgoing_recurrence/qr_code_initial_payment/ RECEIVER_CONCILIATION_ID
METHOD GET

### Path Params

| Field                    | Type   | Description                                         | Characters |
|--------------------------|--------|-----------------------------------------------------|------------|
| `account_key` *          | uuidv4 | Unique account identification key.                  | 36         |
| `receiver_conciliation_id`*| string | Conciliation ID of the qr_code associated with the recurrence | 32         |

## Response

STATUS 200

Response Body

```json
{
  "request_control_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
  "outgoing_recurrence_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "outgoing_recurrence_status": "approved",
  "periodicity": "monthly",
  "journey_type": "journey_four",
  "start_date": "2025-06-10",
  "end_date": "2027-06-10",
  "outgoing_recurrence_data": {
    "minimum_recurrence_amount": 123.45,
    "recurrence_amount": null,
    "retry_configuration": {
      "retry_allowed": true,
      "retry_rule": {
        "first_retry": {
          "day": "1"
        },
        "second_retry": {
          "day": "3"
        },
        "third_retry": {
          "day": "4"
        }
      }
    },
    "debtor_data": {
      "name": "Sebastião",
      "email": "sebastiao@test.com",
      "document_number": "05431134850",
      "address": {
        "city": "São Paulo",
        "postal_code": "123456-789",
        "uf": "SP",
        "street": "Av Paulista 123"
      },
      "account_data": {
        "account_number": "123456",
        "account_digit": "7",
        "account_branch": "0001",
        "ispb": "31872495"
      }
    },
    "qr_code_data": {
      "qr_code_key": "0f45cc3d-9bd1-4d68-a865-4cf477b5da45",
      "qr_code_url": "urlqrcode.url",
      "qr_code_image": "image_base64"
    },
    "initial_payment_data": {
      "amount": 22.34,
      "pix_key": "3d7d6a2b-f72f-44z7-bb20-79a94dff5645",
      "qr_code_type": "dynamic_term",
      "additional_data": [
        {
          "key_name": "Juros e Multa",
          "value": "Juros 2 ao mes e multa de 1%"
        }
      ],
      "fine_amount": 3,
      "interest_amount": 2,
      "expiration_date": "2023-03-25",
      "max_payment_days": 128,
      "rebate_amount": 1,
      "discounts": [],
      "receiver_conciliation_id":"3d7d6a2bf72f44z7bb2079a94dff5645",
      "transaction_data":{
        "transaction_key":"4d7d6a2b-f72f-44z7-bb20-79a94dff5645",
        "pix_transfer_key":"5d7d6a2b-f72f-44z7-bb20-79a94dff5645",
        "end_to_end_id":"E32402502202303141907qlBAF1evdJ2"
      }
    },
    "pix_message": "Conta de Luz Residencial nº123",
    "settlement_date_type": "calendar_days"
  }
}
```

### Response Body Params

| Field                        | Type       | Description                                                                              | Characters |
|------------------------------|------------|------------------------------------------------------------------------------------------|------------|
| `request_control_key`        | uuidv4     | Unique key for request control.                                                          | 36         |
| `outgoing_recurrence_key`    | uuidv4     | Automatic recurrence identifier.                                                         | 36         |
| `outgoing_recurrence_status` | string     | Current recurrence status (`approved`, `pending`, `rejected`, etc.).                     | 30         |
| `periodicity`                | enumerator | Recurrence periodicity.                                                                  | [periodicity Enumerators](#enumerators-periodicity)      |
| `journey_type`               | enumerator | Automatic recurrence journey.                                                            | [journey_type Enumerators](#enumerators-journey_type)    |
| `start_date`                 | string     | Recurrence start date (ISO 8601 format, e.g., `2025-06-10`).                           | 10         |
| `end_date`                   | string     | Recurrence end date (ISO 8601 format) or null, if indefinite.                           | 10 or null |
| `outgoing_recurrence_data`   | object     | Object grouping subscription parameters and complementary data.                          | [outgoing_recurrence_data Object](#outgoing_recurrence_data-object) |

---

### outgoing_recurrence_data Object

| Field                       | Type     | Description                                                          | Characters |
|-----------------------------|----------|----------------------------------------------------------------------|------------|
| `minimum_recurrence_amount` | number   | Minimum expected amount for variable amount recurrences              | -          |
| `recurrence_amount`         | number   | Recurrence amount (for fixed amount; null if variable)              | -          |
| `retry_configuration`       | object   | Configuration for attempts on uncompleted recurrences               | [retry_configuration Object](#retry_configuration-object)   |
| `debtor_data`               | object   | Debtor (subscriber) data                                             | [debtor_data Object](#debtor_data-object)                  |
| `qr_code_data`              | object   | QR Code data generated for payment (if any)                         | [qr_code_data Object](#qr_code_data-object)                |
| `initial_payment_data`      | object   | Initial charge data                                                  | [initial_payment_data Object](#initial_payment_data-object) |
| `pix_message`               | string   | Message sent with the Pix transaction                                | 140        |
| `settlement_date_type`      | enumerator| Settlement date adjustment type                                      | [settlement_date_type Enumerators](#enumerators-settlement_date_type) |

---

### retry_configuration Object

| Field           | Type    | Description                           | Characters |
|-----------------|---------|---------------------------------------|------------|
| `retry_allowed` | boolean | Indicates if retries are enabled      | -          |
| `retry_rule`    | object  | Detailed retry rules                  | [retry_rule Object](#retry_rule-object) |

---

### retry_rule Object

| Field         | Type   | Description                     | Characters |
|---------------|--------|---------------------------------|------------|
| `first_retry` | object | Configuration for 1st retry    | [retry_detail Object](#retry_detail-object) |
| `second_retry`| object | Configuration for 2nd retry    | [retry_detail Object](#retry_detail-object) |
| `third_retry` | object | Configuration for 3rd retry    | [retry_detail Object](#retry_detail-object) |

---

### retry_detail Object

| Field | Type   | Description       | Characters |
|-------|--------|-------------------|------------|
| `day` | string | Retry day.        | -          |
| `time`| string | Retry time.       | -          |

---

### debtor_data Object

| Field             | Type   | Description           | Characters |
|-------------------|--------|-----------------------|------------|
| `name`            | string | Subscriber name.      | 50         |
| `email`           | string | Subscriber email.     | 100        |
| `document_number` | string | CPF or CNPJ.          | 14         |
| `address`         | object | Subscriber address.   | [address Object](#address-object) |
| `account_data`    | object | Bank account data.    | [account_data Object](#account_data-object) |

---

### address Object

| Field         | Type   | Description         | Characters |
|---------------|--------|---------------------|------------|
| `city`        | string | City.               | -          |
| `postal_code` | string | Postal code.        | -          |
| `uf`          | string | State (abbreviation).| -         |
| `street`      | string | Street address.     | -          |

---

### account_data Object

| Field           | Type   | Description                      | Characters |
|-----------------|--------|----------------------------------|------------|
| `account_number`| string | Account number                   | -          |
| `account_digit` | string | Account digit                    | -          |
| `account_branch`| string | Branch                           | -          |
| `ispb`          | string | Financial institution ISPB       | -          |

---

### qr_code_data Object

| Field            | Type   | Description                            | Characters |
|------------------|--------|----------------------------------------|------------|
| `qr_code_key`    | string | Generated QR Code identifier           | -          |
| `qr_code_url`    | string | URL for QR Code visualization          | -          |
| `qr_code_image`  | string | QR Code image (in Base64)              | -          |

---

### initial_payment_data Object

| Field                     | Type     | Description                                                           | Characters |
|---------------------------|----------|-----------------------------------------------------------------------|------------|
| `amount`                  | number   | Principal amount of the initial charge in reais (R$)                 | -          |
| `pix_key`                 | string   | Destination Pix key for initial payment                              | 77         |
| `qr_code_type`            | enum     | QR Code type for initial charge.                                     | [qr_code_type Enumerators](#enumerators-qr_code_type) |
| `additional_data`         | array    | List of additional information related to the charge                  | [additional_data Array of objects](#additional_data-array) |
| `fine_amount`             | number   | Fine amount, in case of payment delay                                 | -          |
| `interest_amount`         | number   | Interest amount, in case of payment delay                             | -          |
| `expiration_date`         | string   | Initial charge expiration date (ISO 8601 format)                     | 10         |
| `max_payment_days`        | integer  | Maximum number of acceptance days after expiration                   | -          |
| `rebate_amount`           | number   | Discount amount for early payment                                     | -          |
| `discounts`               | array    | List of additional discounts                                          | -          |
| `receiver_conciliation_id`| string   | Payment conciliation identifier by the receiver                       | 35         |
| `transaction_data`        | object   | Transaction details related to the initial charge                     | [transaction_data Object](#transaction_data-object) |

---

### additional_data Array

| Field        | Type    | Description                                                | Characters |
|--------------|---------|-------------------------------------------------------------|------------|
| `key_name`   | string  | Additional information name (e.g.: "Interest and Fine")     | 140        |
| `value`      | string  | Value or description of the additional information          | 140        |

---

### transaction_data Object

| Field               | Type   | Description                        | Characters |
|---------------------|--------|------------------------------------|------------|
| `transaction_key`   | string | Unique transaction key             | 36         |
| `pix_transfer_key`  | string | Pix transfer identifier            | 36         |
| `end_to_end_id`     | string | Pix end-to-end identifier          | 32         |

---

### Enumerators periodicity

| Enumerator   | Description          |
|--------------|----------------------|
| `weekly`     | Weekly recurrence    |
| `monthly`    | Monthly recurrence   |
| `quarterly`  | Quarterly recurrence |
| `semiannual` | Semiannual recurrence|
| `annual`     | Annual recurrence    |

---

### Enumerators journey_type

| Enumerator      | Description                                    |
|-----------------|------------------------------------------------|
| `journey_one`   | Direct notification in banking app             |
| `journey_two`   | QR Code experience for recurring charge        |
| `journey_three` | Instant payment + recurring QR Code            |
| `journey_four`  | Recurring opt-in from Pix operation            |

---

### Enumerators settlement_date_type

| Enumerator      | Description      |
|-----------------|------------------|
| `workdays`      | Business days    |
| `calendar_days` | Calendar days    |

---

### Enumerators qr_code_type

| Enumerator        | Description                                            |
|-------------------|--------------------------------------------------------|
| `dynamic_instant` | Dynamic QR Code for instant payment                    |
| `dynamic_term`    | Dynamic QR Code for payment with future due date      |

STATUS 4XX

Response Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em português",
  "code": "codigo"
}
```

| HTTP Code | QI Code<br/>`code`   | Title<br/>`title`                 | Description (eng)<br/>`description`                                        | Description (ptbr)<br/>`translation`                               |
|-----------|----------------------|-----------------------------------|-----------------------------------------------------------------------------|---------------------------------------------------------------------|
| 400       | QIT000002            | Bad Request                       | Invalid request schema.                                                     | Erro no esquema da requisição.                                     |
| 404       | APX000002            | Recurrence Not Found              | Recurrence \{recurrence_key\} not found.                                   | Recorrência \{recurrence_key\} não encontrada.                     |

---

# Payment Reconciliation and Settlement

URL: /en/documentation/baas/pix_automatico/recebedor/introducao

## Business Overview

The automatic Pix payment system offers an efficient solution to automate recurring debits, providing greater convenience for both the payer and the receiver. By ensuring automation and notification of those involved, the risk of default is minimized and companies' cash flow is optimized.

## Automatic Pix Payment Processing

On the scheduled date for an Automatic Pix debit payment, the payer's bank must issue the payment order between midnight and 8 AM. After payment confirmation, the paying user will receive a notification. If the debit is canceled by the payer or receiver before this step, the transaction will not be processed.

## Variable Value Recurrences

For recurrences with variable values, the receiving user will define the minimum value, while the payer will determine the maximum allowed value. The specific amount to be charged must be sent by the receiver between 10 to 2 days before the payment date.

:::warning
If not sent, the charge will not be processed. This step does not apply to fixed value recurrences.
:::

### Business Context

Variable value recurrences are particularly useful in sectors where chargeable amounts may fluctuate, such as utility provision or usage-based subscriptions, allowing flexibility in payments.

## Payment Reconciliation Batches

A set of recurrences with payments to be received will be called a settlement group (`conciliation_batch`).

- Reconciliation batch creation occurs 10 days before the payment date.
- Batches are closed 2 days before the payment date.
- After creating a batch, a webhook will be sent with the `conciliation_batch_key`. Associated recurrences can be obtained through the specific endpoint.

### Business Impact

Reconciliation batches facilitate large-scale receivables management, providing transparency and control over scheduled financial flows, essential for strategic and financial planning of any organization.

## Receipt Retries

The receiving user can define receipt retries during recurrence creation, respecting the following conditions:

- Retries can occur up to 7 days after the original due date.
- A maximum of three attempts can be made, as defined during creation.
- The value must be the same as the original payment.

### Business Considerations

Receipt retries are a crucial functionality for maximizing receivables, ensuring additional opportunities to settle payments that, for any reason, failed on the original date. This reduces losses from default and improves customer experience by providing additional flexibility.

---

# Create a Recurrence (Journey 4)

URL: /en/documentation/baas/pix_automatico/recebedor/journey_four

> Journey 4 — QR Code + Payment or scheduling + Automatic Pix offer

{`
.hero-section { background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%); border: 1px solid #e5e7eb; border-radius: 16px; padding: 24px; margin: 24px 0 32px 0; }
.hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 20px; }
.hero-item { background: #ffffff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; }
.hero-item > strong { display: block; color: #1e40af; font-size: 14px; margin-bottom: 6px; font-weight: 700; }
.hero-item p { margin: 0; font-size: 13px; color: #475569; line-height: 1.5; }

.endpoint-card { background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); border: 2px solid #e5e7eb; border-radius: 12px; padding: 24px; position: relative; overflow: hidden; }
.endpoint-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: linear-gradient(to bottom, #3b82f6, #1e40af); }
.endpoint-list { display: grid; gap: 12px; font-size: 13px; color: #334155; }
.endpoint__item { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 12px; background: #ffffff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px 14px; }
.badge { font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 6px; color: #fff; text-transform: uppercase; letter-spacing: .4px; background: #1e40af; }

.details-container { background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); border: 1px solid #e5e7eb; border-radius: 10px; padding: 8px 12px; margin: 20px 0; }
.details-container summary { font-weight: 700; color: #1e40af; cursor: pointer; font-size: 14px; padding: 10px 0 10px 28px; display: flex; align-items: center; position: relative; }
.details-container summary::-webkit-details-marker { display: none; }
.details-container summary::before { content: ''; position: absolute; left: 10px; width: 0; height: 0; border-left: 7px solid #1e40af; border-top: 6px solid transparent; border-bottom: 6px solid transparent; transition: transform .2s ease; }
.details-container[open] summary::before { transform: rotate(90deg); }
.code-block { margin-top: 12px; border-radius: 8px; overflow: hidden; }

.table-container { overflow: auto; border: 0; border-radius: 0; margin: 20px 0; background: transparent; }
.table-container table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-container th, .table-container td { border-top: 1px solid #e5e7eb; padding: 12px 16px; text-align: left; }
.table-container thead th { background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%); font-weight: 700; color: #0f172a; font-size: 13px; }
`}

Overview
What it is The customer makes a payment or schedules a QR Code and then receives an offer to activate the Automatic Pix recurrence.
When to use Recommended for invoices, bills or accounts with a recurrence adhesion proposal, but only after the initial payment or scheduling.
How it works Payer reads the QR Code → pays or schedules the payment → upon completion, receives an invitation to activate the Automatic Pix for that charge (optional).
Benefits Flexible: the decision about recurrence occurs after payment/scheduling, allowing voluntary and spontaneous adhesion by the payer.
Key considerations The recurrence offer is made only after payment/scheduling — it can be declined by the customer. If not available for that case, proceed only with the payment, without offering recurrence.

## Request

{`
.endpoint-card { background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); border: 2px solid #e5e7eb; border-radius: 12px; padding: 24px; position: relative; overflow: hidden; }
.endpoint-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: linear-gradient(to bottom, #3b82f6, #1e40af); }
.endpoint-list { display: grid; gap: 12px; font-size: 13px; color: #334155; }
.endpoint__item { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 12px; background: #ffffff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px 14px; }
.badge { font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 6px; color: #fff; text-transform: uppercase; letter-spacing: .4px; background: #1e40af; }
.details-container { background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); border: 1px solid #e5e7eb; border-radius: 10px; padding: 8px 12px; margin: 20px 0; }
.details-container summary { font-weight: 700; color: #1e40af; cursor: pointer; font-size: 14px; padding: 10px 0 10px 28px; display: flex; align-items: center; position: relative; }
.details-container summary::-webkit-details-marker { display: none; }
.details-container summary::before { content: ''; position: absolute; left: 10px; width: 0; height: 0; border-left: 7px solid #1e40af; border-top: 6px solid transparent; border-bottom: 6px solid transparent; transition: transform .2s ease; }
.details-container[open] summary::before { transform: rotate(90deg); }
.code-block { margin-top: 12px; border-radius: 8px; overflow: hidden; }
`}

ENDPOINT /account/ account_key /outgoing_recurrence/journey_four
METHOD POST

### Request Path Params

| Field         | Type  | Description                                    | Characters |
|---------------|-------|------------------------------------------------|------------|
| `account_key`*| uuid4 | Unique account identification key.             | 36         |

### Request Body

**Request Body: Create Recurrence (Journey 4)**

```json
{
    "request_control_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
    "periodicity": "monthly",
    "minimum_recurrence_amount": 125,
    "start_date": "2025-06-10",
    "end_date": "2027-06-10",
    "pix_message": "Conta de Luz Residencial nº123",
    "recurrence_type": "variable_amount",
    "debtor_data": {
        "name": "Sebastião",
        "email": "sebastiao@test.com",
        "document_number": "05431134850",
        "contract_id": "12345",
        "address": {
            "street": "Av. Brigadeiro Faria Lima",
            "state": "SP",
            "city": "São Paulo",
            "neighborhood": "Jardim Paulistano",
            "number": "2391",
            "postal_code": "01452905",
            "complement": "Complemento"
        }
    },
    "initial_payment_data": {
        "amount": 22.34,
        "pix_key": "3d7d6a2b-f72f-44z7-bb20-79a94dff5645",
        "qr_code_type": "dynamic_term",
        "additional_data": [
            {
                "key_name": "Juros e Multa",
                "value": "Juros 2 ao mes e multa de 1%"
            }	
        ],
        "fine_amount": 3,
        "interest_amount": 2,
        "expiration_date": "2023-03-25",
        "max_payment_days": 128,
        "rebate_amount": 1,
        "discounts": [],
        "receiver_conciliation_id": "3d7d6a2bf72f44z7bb2079a94dff5645"		
    },
    "retry_configuration": {
        "retry_allowed": true,
        "retry_rule": {
            "first_retry": {
                "day": "1"
            },
            "second_retry": {
                "day": "3"
            },
            "third_retry": {
                "day": "4"
            }
        }
    },
    "settlement_date_type": "workdays"
}
```

### Body Params

| Field                            | Type        | Description                                                                                                       | Characters |
|-----------------------------------|-------------|-------------------------------------------------------------------------------------------------------------------|------------|
| `request_control_key` *           | uuid        | Unique request identification key used by the client in uuid4 format.                                            | 36         |
| `periodicity` *                   | enumerator  | Periodicity type associated with the subscription recurrence.                                                     | [periodicity Enumerators](#periodicity-enumerators) |
| `minimum_recurrence_amount`       | float      | Minimum transaction amount for variable amount recurrences                                       | -          |
| `start_date` *                    | string      | Recurrence start date (ISO 8601 format, e.g., "2025-07-01").                                                     | -          |
| `end_date`                        | string      | Recurrence end date; for indefinite time, send as null.                                                          | -          |
| `pix_message` *                   | string      | Message to be sent with the Pix transaction.                                                                     | 140        |
| `debtor_data` *                   | Object      | Debtor (subscriber) data.                                                                                         | [debtor_data Object](#debtor_data-object) |
| `retry_configuration` *           | Object      | Retry configuration for incomplete transactions.                                                                  | [retry_configuration Object](#retry_configuration-object) |
| `settlement_date_type` *          | enumerator  | Settlement date adjustment type                                                                                   | [settlement_date_type Enumerators](#settlement_date_type-enumerators) |
| `recurrence_type` *               | enumerator  | Recurrence type                                                                                                   | [recurrence_type Enumerators](#recurrence_type-enumerators) |
| `initial_payment_data` *            | Object      | Object with initial charge information to be performed when creating the subscription.                            | [initial_payment_data Object](#initial_payment_data-object) |

:::caution Attention
The `minimum_recurrence_amount` field is optional and should only be informed for variable amount recurrence. If the recurrence is fixed amount, the `recurrence_amount` field should be sent with the recurrence value. The same applies to the `recurrence_type` enumerator, which should correspond to the recurrence type (Fixed or variable amount).
:::

### periodicity Enumerators

| Enumerator   | Description           |
|--------------|-----------------------|
| `weekly`     | Weekly recurrence     |
| `monthly`    | Monthly recurrence    |
| `quarterly`  | Quarterly recurrence  |
| `semiannual` | Semiannual recurrence |
| `annual`     | Annual recurrence     |

### settlement_date_type Enumerators

| Enumerator   | Description           |
|--------------|-----------------------|
| `workdays`     | Workdays   |
| `calendar_days`     | Calendar days   |

### recurrence_type Enumerators

| Enumerator   | Description           |
|--------------|-----------------------|
| `fixed_amount`     | Fixed Amount Recurrence   |
| `variable_amount`     | Variable Amount Recurrence   |

### debtor_data Object

| Field               | Type   | Description           | Characters |
|---------------------|--------|-----------------------|------------|
| `name` *            | string | Subscriber name.      | 50         |
| `email` *           | string | Subscriber email.     | 100        |
| `document_number` * | string | Subscriber CPF or CNPJ. | 14      |
| `contract_id`       | string | Subscriber contract identifier. | 100      |
| `address` *         | Object | Subscriber address.   | [address Object](#address-object) |

### address Object

| Field         | Type   | Description       | Characters |
|---------------|--------|-------------------|------------|
| `street`      | string | Street.           | -          |
| `state`       | string | State.            | -          |
| `city`        | string | City.             | -          |
| `neighborhood`| string | Neighborhood.     | -          |
| `number`      | string | Number.           | -          |
| `postal_code` | string | Postal code.      | -          |
| `complement`  | string | Complement.       | -          |

### retry_configuration Object

| Field         | Type    | Description               | Characters |
|---------------|---------|---------------------------|------------|
| `retry_allowed`| boolean | Indicates if retries are allowed. | -     |
| `retry_rule`  | Object  | Retry rules.              | [retry_rule Object](#retry_rule-object) |

### retry_rule Object

| Field         | Type   | Description               | Characters |
|---------------|--------|---------------------------|------------|
| `first_retry` | Object | First retry configuration. | [retry_detail Object](#retry_detail-object) |
| `second_retry`| Object | Second retry configuration.  | [retry_detail Object](#retry_detail-object) |
| `third_retry` | Object | Third retry configuration. | [retry_detail Object](#retry_detail-object) |

### retry_detail Object

| Field | Type   | Description               | Characters |
|-------|--------|---------------------------|------------|
| `day` | string | Retry day.                | -          |

### initial_payment_data Object

| Field                      | Type       | Description                                                                              | Characters |
|----------------------------|------------|------------------------------------------------------------------------------------------|------------|
| `amount` *                 | number     | Main amount of the initial charge in Brazilian Reais (R$).                              | -          |
| `pix_key` *                | string     | Destination Pix key for the payment.                                                    | 77         |
| `qr_code_type`*             | enumerator | QR Code type for the initial charge.                                                    | [qr_code_type Enumerators](#qr_code_type-enumerators) |
| `additional_data`*          | array      | List of objects with additional information related to the charge (e.g., interest, fine). | [additional_data Objects](#additional_data-object) |
| `fine_amount`              | number     | Fine amount in case of late payment.                                                     | -          |
| `interest_amount`          | number     | Interest amount in case of late payment.                                                 | -          |
| `expiration_date` *        | string     | Initial charge expiration date (ISO 8601 format, e.g., "2023-03-25").                  | -          |
| `max_payment_days`         | integer    | Maximum number of days from the expiration date in which payment can be accepted.       | -          |
| `rebate_amount`            | number     | Discount amount for early payment.                                                       | -          |
| `discounts`                | array      | List of additional applicable discounts (if any).                                       | -          |
| `receiver_conciliation_id` | string     | Unique identifier for payment reconciliation by the receiver.                            | 32         |

### qr_code_type Enumerators

| Value              | Description                                                               |
|--------------------|---------------------------------------------------------------------------|
| `dynamic_instant`  | Generates a dynamic QR Code for instant payment, with immediate expiration.        |
| `dynamic_term`     | Generates a dynamic QR Code with defined payment term (future expiration).         |

### additional_data Object

| Field        | Type    | Description                                                     | Characters |
|--------------|---------|-----------------------------------------------------------------|------------|
| `key_name`   | string  | Additional information field name (example: "Interest and Fine").| -        |
| `value`      | string  | Value or description of the additional information.              | -        |

## Response

STATUS 200

:::caution Attention
When the payer user receives the notification, they can choose to schedule the Pix or make the transfer at that moment. If the payer makes the payment instantly, the webhook of type `baas.automatic_pix.outgoing_recurrence.status_change` will be sent with the information filled in; in case of scheduling, the values will be `null`.
:::

**Response Body**

```json
{
    "request_control_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
    "outgoing_recurrence_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "outgoing_recurrence_status": "pending_confirmation",
    "qr_code_data": {
	    "qr_code_url": "url",
	    "qr_code_key": "6f270b64-1b7a-4269-91f8-3f9cf30ba0bb",
	    "qr_code_image": "imageb64" 
    },
     "initial_payment_data": {
			"receiver_conciliation_id": "6f270b64-1b7a-4269-91f8-3f9cf30ba0bb"			  
		},
    "created_at": "2021-10-22T20:30:23.459Z"
}
```

### Response Body

| Field                 | Type       | Description                                                               | Characters |
|-----------------------|------------|---------------------------------------------------------------------------|------------|
| `request_control_key` | uuid       | Request control key sent by the client.                                   | 36         |
| `recurrence_key`      | uuid       | Unique subscription recurrence identification key.                         | 36         |
| `recurrence_status`   | enumerator | Current recurrence status.                                                 | [recurrence_status Enumerators](#recurrence_status-enumerators) |
| `qr_code_data`        | enumerator | QR Code data                                                              | [qr_code_data Object](#qr_code_data-enumerators) |
| `initial_payment_data`| enumerator | Initiated payment information                                             | [qr_code_data Object](#qr_code_data-enumerators) |
| `created_at`          | string     | Recurrence creation date and time (ISO 8601 format).                      | -          |

### qr_code_data Object

| Field | Type   | Description               | Characters |
|-------|--------|-------------------------|------------|
| `qr_code_url` | string | QR code copy and paste URL     | -          |
| `qr_code_key`| uuuid | QR code unique identification key. | 36          |
| `qr_code_image`| string | QR code image base64 | -         |

### initial_payment_data Object

| Field | Type   | Description               | Characters |
|-------|--------|-------------------------|------------|
| `receiver_conciliation_id` | string     | Unique identifier for payment reconciliation by the receiver.                        | 32         |

### recurrence_status Enumerators

| Enumerator           | Description                       |
|----------------------|-----------------------------------|
| `pending_confirmation` | Recurrence pending confirmation |
| `active`              | Active recurrence                |
| `cancelled`           | Cancelled recurrence             |
| `suspended`           | Suspended recurrence             |
| `expired`             | Expired recurrence               |

STATUS 4XX

**Response Error**

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em português",
  "code": "codigo"
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`                | Description (eng)<br/>`description`                                          | Description (ptbr)<br/>`translation`                                 |
|-------------|----------------------|-----------------------------------|----------------------------------------------------------------------------|--------------------------------------------------------------------|
| 400         | QIT000002            | Bad Request                       | Invalid request schema.                                                    | Erro no esquema da requisição.                                     |
| 403         | APX000030            | Unauthorized Transaction          | User is not authorized to create this recurrence.                          | Usuário não autorizado a criar esta recorrência.                   |
| 403         | APX000018            | Endpoint Access Denied            | Requester lacks permission to access this endpoint.                        | Requester não possui permissão para acessar este endpoint.          |
| 404         | APX000021            | Subscription Not Found            | Subscription \{subscription_key\} not found.                               | Assinatura \{subscription_key\} não encontrada.                     |
| 404         | APX000002            | Recurrence Not Found              | Recurrence \{recurrence_key\} not found.                                   | Recorrência \{recurrence_key\} não encontrada.                      |
| 406         | APX000027            | Invalid Transaction Amount        | Transaction amount \{minimum_transaction_amount\} is invalid.              | Valor da transação \{minimum_transaction_amount\} é inválido.        |
| 409         | APX000014            | Request Control Key Conflict      | The request_control_key \{request_control_key\} is already in use.         | A request_control_key \{request_control_key\} já está em uso.        |

---

# Create a Recurrence (Journey 1)

URL: /en/documentation/baas/pix_automatico/recebedor/journey_one

> Journey 1 — Without QR Code (app notification)

{`
.hero-section { background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%); border: 1px solid #e5e7eb; border-radius: 16px; padding: 24px; margin: 24px 0 32px 0; }
.hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 20px; }
.hero-item { background: #ffffff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; }
.hero-item > strong { display: block; color: #1e40af; font-size: 14px; margin-bottom: 6px; font-weight: 700; }
.hero-item p { margin: 0; font-size: 13px; color: #475569; line-height: 1.5; }

.endpoint-card { background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); border: 2px solid #e5e7eb; border-radius: 12px; padding: 24px; position: relative; overflow: hidden; }
.endpoint-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: linear-gradient(to bottom, #3b82f6, #1e40af); }
.endpoint-list { display: grid; gap: 12px; font-size: 13px; color: #334155; }
.endpoint__item { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 12px; background: #ffffff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px 14px; }
.badge { font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 6px; color: #fff; text-transform: uppercase; letter-spacing: .4px; background: #1e40af; }

.details-container { background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); border: 1px solid #e5e7eb; border-radius: 10px; padding: 8px 12px; margin: 20px 0; }
.details-container summary { font-weight: 700; color: #1e40af; cursor: pointer; font-size: 14px; padding: 10px 0 10px 28px; display: flex; align-items: center; position: relative; }
.details-container summary::-webkit-details-marker { display: none; }
.details-container summary::before { content: ''; position: absolute; left: 10px; width: 0; height: 0; border-left: 7px solid #1e40af; border-top: 6px solid transparent; border-bottom: 6px solid transparent; transition: transform .2s ease; }
.details-container[open] summary::before { transform: rotate(90deg); }
.code-block { margin-top: 12px; border-radius: 8px; overflow: hidden; }

.table-container { overflow: auto; border: 0; border-radius: 0; margin: 20px 0; background: transparent; }
.table-container table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-container th, .table-container td { border-top: 1px solid #e5e7eb; padding: 12px 16px; text-align: left; }
.table-container thead th { background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%); font-weight: 700; color: #0f172a; font-size: 13px; }
`}

Overview
What it is Authorization requested from the payer directly in the bank app, without QR Code reading.
When to use Active contact (phone, chat, in-person) or existing relationship with the customer.
How it works Receiver creates the recurrence with payer's account data → the payer receives a notification in the app → approves the recurrence → future charges can be scheduled.
Benefits Simple and direct experience; doesn't require QR Code display.

## Request

ENDPOINT /account/ account_key /outgoing_recurrence/journey_one
METHOD POST

### Request Path Params

| Field         | Type  | Description                                      | Characters |
|---------------|-------|------------------------------------------------|------------|
| `account_key`*| uuid4 | Unique account identification key.          | 36         |

### Request Body

**Request Body: Create Recurrence (Journey 1)**

```json
{
    "request_control_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
    "periodicity": "monthly",
    "minimum_recurrence_amount": 125,
    "start_date": "2025-06-10",
    "end_date": "2027-06-10",
    "pix_message": "Conta de Luz Residencial nº123",
    "recurrence_type": "variable_amount",
    "debtor_data": {
        "name": "Sebastião",
        "email": "sebastiao@test.com",
        "document_number": "05431134850",
        "contract_id": "Contrato de pagamento recorrente",
        "address": {
            "street": "Av. Brigadeiro Faria Lima",
            "state": "SP",
            "city": "São Paulo",
            "neighborhood": "Jardim Paulistano",
            "number": "2391",
            "postal_code": "01452905",
            "complement": "Complemento"
        },
        "account_data": {
            "account_number": "123456",
            "account_digit": "7",
            "account_branch": "0001",
            "ispb": "31872495"
        }
    },
    "retry_configuration": {
        "retry_allowed": true,
        "retry_rule": {
            "first_retry": {
                "day": "1",
            },
            "second_retry": {
                "day": "3",
            },
            "third_retry": {
                "day": "4",
            }
        }
    },
    "settlement_date_type": "workdays"
}
```

### Body Params

| Field                          | Type       | Description                                                                                                  | Characters |
|--------------------------------|------------|------------------------------------------------------------------------------------------------------------|------------|
| `request_control_key` *        | uuid       | Unique request identification key used by the client in uuid4 format.                        | 36         |
| `periodicity` *                | enumerator | Type of periodicity associated with the subscription recurrence.                                               | [periodicity Enumerators](#periodicity-enumerators) |
| `minimum_recurrence_amount`   | number     | Minimum transaction amount for variable amount recurrences (in cents).                               | -          |
| `start_date` *                 | string     | Recurrence start date (ISO 8601 format, e.g., "2025-07-01").                                      | -          |
| `end_date`                     | string     | Recurrence end date; for indefinite duration, send as null.                                | -          |
| `pix_message` *                | string     | Message to be sent along with the Pix transaction.                                                              | 140        |
| `debtor_data` *                | Object     | Debtor (subscriber) data.                                                                              | [debtor_data Object](#debtor_data-object) |
| `retry_configuration` *        | Object     | Retry configuration for incomplete transactions.                                               | [retry_configuration Object](#retry_configuration-object) |
| `settlement_date_type` *       | enumerator | Type of settlement date adjustment                                                                       | [settlement_date_type Enumerators](#settlement_date_type-enumerators) |
| `recurrence_type` *       | enumerator | Type of recurrence                                                                                             | [recurrence_type Enumerators](#recurrence_type-enumerators) |

:::caution Attention
The `minimum_recurrence_amount` field is optional and should only be provided for variable amount recurrences. If the recurrence is fixed amount, the `recurrence_amount` field must be sent, with the recurrence value. As well as the `recurrence_type` enumerator, which should correspond to the type of recurrence (Fixed amount or variable).
:::

### periodicity Enumerators

| Enumerator   | Description             |
|--------------|-----------------------|
| `weekly`     | Weekly recurrence   |
| `monthly`    | Monthly recurrence    |
| `quarterly`  | Quarterly recurrence|
| `semiannual` | Semiannual recurrence |
| `annual`     | Annual recurrence     |

### settlement_date_type Enumerators

| Enumerator   | Description             |
|--------------|-----------------------|
| `workdays`     | Business days   |
| `calendar_days`     | Calendar days   |

### recurrence_type Enumerators

| Enumerator   | Description             |
|--------------|-----------------------|
| `fixed_amount`     | Fixed Amount Recurrence   |
| `variable_amount`     | Variable Amount Recurrence   |

### debtor_data Object

| Field               | Type   | Description             | Characters |
|---------------------|--------|-----------------------|------------|
| `name` *            | string | Subscriber name.    | 50         |
| `email` *           | string | Subscriber email.  | 100        |
| `document_number` * | string | Subscriber CPF or CNPJ. | 14      |
| `contract_id`       | string | Subscriber contract identifier. | 100      |
| `address` *         | Object | Subscriber address.| [address Object](#address-object) |
| `account_data` *    | Object | Subscriber banking data. | [account_data Object](#account_data-object) |

### address Object

| Field         | Type   | Description         | Characters |
|---------------|--------|-------------------|------------|
| `street`      | string | Street.              | -          |
| `state`       | string | State.           | -          |
| `city`        | string | City.           | -          |
| `neighborhood`| string | Neighborhood.           | -          |
| `number`      | string | Number.           | -          |
| `postal_code` | string | Postal code.              | -          |
| `complement`  | string | Complement.      | -          |

### account_data Object

| Field           | Type   | Description                    | Characters |
|-----------------|--------|------------------------------|------------|
| `account_number`| string | Account number.             | -          |
| `account_digit` | string | Account digit.             | -          |
| `account_branch`| string | Account branch.            | -          |
| `ispb`          | string | Financial institution ISPB. | -       |

### retry_configuration Object

| Field         | Type    | Description               | Characters |
|---------------|---------|-------------------------|------------|
| `retry_allowed`| boolean | Indicates if retries are allowed. | -     |
| `retry_rule`  | Object  | Retry rules.  | [retry_rule Object](#retry_rule-object) |

### retry_rule Object

| Field         | Type   | Description               | Characters |
|---------------|--------|-------------------------|------------|
| `first_retry` | Object | First retry configuration. | [retry_detail Object](#retry_detail-object) |
| `second_retry`| Object | Second retry configuration.  | [retry_detail Object](#retry_detail-object) |
| `third_retry` | Object | Third retry configuration. | [retry_detail Object](#retry_detail-object) |

### retry_detail Object

| Field | Type   | Description               | Characters |
|-------|--------|-------------------------|------------|
| `day` | string | Retry day.     | -          |

## Response

STATUS 200

**Response Body**

```json
{
    "request_control_key": "a7b9e3c1-f2d4-4a8b-9c7e-123456789abc",
    "recurrence_key": "b2c3d4e5-f6g7-4h8i-9j0k-l1m2n3o4p5q6",
    "recurrence_status": "pending_confirmation",
    "created_at": "2025-06-16T23:52:00.000Z"
}
```

### Response Body

| Field                 | Type       | Description                                                                 | Characters |
|-----------------------|------------|---------------------------------------------------------------------------|------------|
| `request_control_key` | uuid       | Request control key sent by the client.                     | 36         |
| `recurrence_key`      | uuid       | Unique subscription recurrence identification key.                | 36         |
| `recurrence_status`   | enumerator | Current recurrence status.                                              | [recurrence_status Enumerators](#recurrence_status-enumerators) |
| `created_at`          | string     | Recurrence creation date and time (ISO 8601 format).                 | -          |

### recurrence_status Enumerators

| Enumerator           | Description                         |
|----------------------|-----------------------------------|
| `pending_confirmation` | Recurrence pending confirmation |
| `active`              | Active recurrence                 |
| `cancelled`           | Cancelled recurrence             |
| `suspended`           | Suspended recurrence              |
| `expired`             | Expired recurrence              |

STATUS 4XX

Response Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em português",
  "code": "codigo"
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`                | Description (eng)<br/>`description`                                          | Description (ptbr)<br/>`translation`                                 |
|-------------|----------------------|-----------------------------------|----------------------------------------------------------------------------|--------------------------------------------------------------------|
| 400         | QIT000002            | Bad Request                       | Invalid request schema.                                                    | Erro no esquema da requisição.                                     |
| 403         | APX000030            | Unauthorized Transaction          | User is not authorized to create this recurrence.                          | Usuário não autorizado a criar esta recorrência.                   |
| 403         | APX000018            | Endpoint Access Denied            | Requester lacks permission to access this endpoint.                        | Requester não possui permissão para acessar este endpoint.          |
| 404         | APX000021            | Subscription Not Found            | Subscription \{subscription_key\} not found.                               | Assinatura \{subscription_key\} não encontrada.                     |
| 404         | APX000002            | Recurrence Not Found              | Recurrence \{recurrence_key\} not found.                                   | Recorrência \{recurrence_key\} não encontrada.                      |
| 406         | APX000027            | Invalid Transaction Amount        | Transaction amount \{minimum_transaction_amount\} is invalid.              | Valor da transação \{minimum_transaction_amount\} é inválido.        |
| 409         | APX000014            | Request Control Key Conflict      | The request_control_key \{request_control_key\} is already in use.         | A request_control_key \{request_control_key\} já está em uso.        |

---

# Create a Recurrence (Journey 3)

URL: /en/documentation/baas/pix_automatico/recebedor/journey_three

> Journey 3 — QR Code + First Payment (immediate recurrence activation)

{`
.hero-section {
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  margin: 24px 0 32px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.hero-item {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  transition: all 0.3s ease;
}

.hero-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #3b82f6;
}

/* FIX: título em bloco, destaques inline dentro do parágrafo */
.j3-card > strong,
.hero-item > strong {
  display: block;
  color: #1e40af;
  font-size: 14px;
  margin-bottom: 6px;
  font-weight: 700;
}
.j3-card p strong,
.hero-item p strong {
  display: inline;
  color: #1e40af;
  font-weight: 700;
}

.hero-item p {
  margin: 0;
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
}

.flow-section {
  margin: 32px 0;
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.flow-step-card {
  border-radius: 12px;
  padding: 18px;
  color: #ffffff;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flow-step-card h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.flow-step-card p {
  margin: 0;
  font-size: 13px;
  opacity: 0.95;
  line-height: 1.5;
}

.endpoint-section {
  margin: 32px 0;
}

.endpoint-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.endpoint-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, #3b82f6, #1e40af);
  transition: width 0.3s ease;
}

.endpoint-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-color: #3b82f6;
}

.endpoint-card:hover::before {
  width: 6px;
}

.endpoint-list {
  display: grid;
  gap: 12px;
  font-size: 13px;
  color: #334155;
}

.endpoint-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 14px;
}

.badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: #1e40af;
}

.info-note {
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
  border-left: 4px solid #3b82f6;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 13px;
  color: #1e40af;
  margin: 20px 0;
  line-height: 1.6;
}

.warn-note {
  background: linear-gradient(135deg, #fef3c7 0%, #ffffff 100%);
  border-left: 4px solid #f59e0b;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 13px;
  color: #0f172a;
  margin: 20px 0;
  line-height: 1.6;
}

.table-container {
  overflow: auto;
  border: 0;
  border-radius: 0;
  margin: 20px 0;
  background: transparent;
}

.table-container table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table-container th,
.table-container td {
  border-top: 1px solid #e5e7eb;
  padding: 12px 16px;
  text-align: left;
}

.table-container thead th {
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  font-weight: 700;
  color: #0f172a;
  font-size: 13px;
}

.table-container tbody tr:hover {
  background: #f8fafc;
}

.details-container {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 8px 12px;
  margin: 20px 0;
}

.details-container summary {
  font-weight: 700;
  color: #1e40af;
  cursor: pointer;
  font-size: 14px;
  padding: 10px 0 10px 28px;
  display: flex;
  align-items: center;
  position: relative;
}
.details-container summary::-webkit-details-marker { display: none; }
.details-container summary::before {
  content: '';
  position: absolute;
  left: 10px;
  width: 0; height: 0;
  border-left: 7px solid #1e40af;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  transition: transform .2s ease;
}
.details-container[open] summary::before { transform: rotate(90deg); }

.code-block {
  margin-top: 12px;
  border-radius: 8px;
  overflow: hidden;
}

.tips-section {
  margin: 32px 0;
}

.tip-card {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  border: 2px solid #d1fae5;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
}

.tip-card:hover {
  transform: translateY(-2px);
  border-color: #10b981;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.15);
}

.tip-text {
  font-size: 14px;
  line-height: 1.7;
  color: #475569;
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.tip-icon {
  color: #10b981;
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  font-weight: 700;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 32px 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid #e5e7eb;
}

@media (max-width: 768px) {
  .hero-grid,
  .flow-grid {
    grid-template-columns: 1fr;
  }
  .endpoint-item {
    grid-template-columns: 100px 1fr;
    font-size: 12px;
  }
  .endpoint-item code {
    font-size: 11px;
  }
}
`}

Overview
What it is
A single QR Code that allows pay now and activate recurrence in the same flow.
When to use
Cases with mandatory initial charge (e.g., registration, enrollment, first payment).
How it works
The payer scans the QR → makes the first payment → authorizes recurrence immediately.
Benefits
Immediate revenue + configured recurrence, reducing friction and delinquency.

### Journey 3 Flow

1. Read QR Code
The user scans the dynamic QR generated for the initial charge.
2. Pay Now
The immediate payment is processed, recording the initial charge.
3. Authorize Recurrence
In the same experience, the user confirms the recurrence authorization.
4. Active Recurrence
Next cycles are automated; you only need to reconcile amounts when necessary.

---

## Request

ENDPOINT
/account/ account_key /outgoing_recurrence/journey_three
METHOD
POST

### Path Params

Field Type Description Characters
account_key &#42; uuid4 Unique account identification key. 36

### Request Body

**Request Body: Create Recurrence (Journey 3)**

```json
{
  "request_control_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
  "periodicity": "monthly",
  "minimum_recurrence_amount": 125,
  "start_date": "2025-06-10",
  "end_date": "2027-06-10",
  "pix_message": "Conta de Luz Residencial nº123",
  "recurrence_type": "variable_amount",
  "debtor_data": {
    "name": "Sebastião",
    "email": "sebastiao@test.com",
    "document_number": "05431134850",
    "contract_id": "12345",
    "address": {
      "street": "Av. Brigadeiro Faria Lima",
      "state": "SP",
      "city": "São Paulo",
      "neighborhood": "Jardim Paulistano",
      "number": "2391",
      "postal_code": "01452905",
      "complement": "Complemento"
    }
  },
  "initial_payment_data": {
    "amount": 22.34,
    "pix_key": "3d7d6a2b-f72f-44z7-bb20-79a94dff5645",
    "qr_code_type": "dynamic_term",
    "additional_data": [
      {
        "key_name": "Juros e Multa",
        "value": "Juros 2 ao mes e multa de 1%"
      }
    ],
    "fine_amount": 3,
    "interest_amount": 2,
    "expiration_date": "2023-03-25",
    "max_payment_days": 128,
    "rebate_amount": 1,
    "discounts": [],
    "receiver_conciliation_id": "3d7d6a2bf72f44z7bb2079a94dff5645"
  },
  "retry_configuration": {
    "retry_allowed": true,
    "retry_rule": {
      "first_retry": {
        "day": "1"
      },
      "second_retry": {
        "day": "3"
      },
      "third_retry": {
        "day": "4"
      }
    }
  },
  "settlement_date_type": "workdays"
}
```

### Body Params

Field Type Description Characters
request_control_key &#42; uuid Unique request key (uuid4). 36
periodicity &#42; enumerator Recurrence periodicity. Periodicity enumerators
minimum_recurrence_amount float Minimum amount per transaction (variable recurrences). -
start_date &#42; string Start date (ISO 8601). -
end_date string End date or null for indefinite. -
pix_message &#42; string Message displayed in Pix transaction. 140
debtor_data &#42; Object Subscriber data. debtor_data object
retry_configuration &#42; Object Retry rules. retry_configuration object
settlement_date_type &#42; enumerator Settlement date adjustment. settlement_date_type enumerators
recurrence_type &#42; enumerator Type of recurrence. recurrence_type enumerators
initial_payment_data &#42; Object Initial charge data. initial_payment_data object

Attention: for variable amount recurrence, provide minimum_recurrence_amount . For fixed amount, send recurrence_amount and adjust the recurrence_type enumerator accordingly.

#### Periodicity enumerators

Enumerator Description
weekly Weekly recurrence
monthly Monthly recurrence
quarterly Quarterly recurrence
semiannual Semiannual recurrence
annual Annual recurrence

#### Settlement_date_type enumerators

Enumerator Description
workdays Business days
calendar_days Calendar days

#### Recurrence_type enumerators

Enumerator Description
fixed_amount Fixed Amount Recurrence
variable_amount Variable Amount Recurrence

#### debtor_data object

Field Type Description Characters
name &#42; string Subscriber name. 50
email &#42; string Subscriber email. 100
document_number &#42; string Subscriber CPF/CNPJ. 14
contract_id string Contract identifier. 100
address &#42; Object Subscriber address. address object

#### address object

Field Type Description
street string Street
state string State
city string City
neighborhood string Neighborhood
number string Number
postal_code string ZIP Code
complement string Complement

#### retry_configuration object

Field Type Description
retry_allowed boolean Enable retries
retry_rule Object Retry rules

#### retry_rule object

Field Type Description
first_retry Object First retry
second_retry Object Second retry
third_retry Object Third retry

#### retry_detail object

Field Type Description
day string Retry day

#### initial_payment_data object

Field Type Description Characters
amount &#42; number Initial charge amount (R$). -
pix_key &#42; string Destination Pix key. 77
qr_code_type &#42; enumerator Type of QR Code for initial charge. qr_code_type enumerators
additional_data &#42; array List of additional data (e.g., interest/fine). additional_data objects
fine_amount number Late fee. -
interest_amount number Interest for late payment. -
expiration_date &#42; string Expiration date (ISO 8601). -
max_payment_days integer Maximum days after expiration to accept payment. -
rebate_amount number Early payment discount. -
discounts array Additional discounts. -
receiver_conciliation_id string Identifier for receiver reconciliation. 32

#### qr_code_type enumerators

Value Description
dynamic_instant Dynamic QR for immediate payment
dynamic_term Dynamic QR with term (future due date)

#### additional_data objects

Field Type Description
key_name string Information label (e.g., Interest and Fine)
value string Value/description

---

## Response

STATUS
200

**Response Body (example)**

```json
{
  "request_control_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
  "outgoing_recurrence_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "outgoing_recurrence_status": "pending_confirmation",
  "qr_code_data": {
    "qr_code_url": "url",
    "qr_code_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc85",
    "qr_code_image": "imageb64"
  },
  "initial_payment_data": {
    "receiver_conciliation_id": "6f270b64-1b7a-4269-91f8-3f9cf30ba0bb"
  },
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

### Response Fields

Field Type Description Characters
request_control_key uuid Control key sent by client 36
recurrence_key uuid Subscription recurrence identification 36
recurrence_status enumerator Recurrence status recurrence_status enumerators
qr_code_data Object QR generated data for the first payment qr_code_data object
initial_payment_data Object Initial payment information initial_payment_data object
created_at string Creation date/time (ISO 8601) -

#### qr_code_data object

Field Type Description Characters
qr_code_url string Copy and paste URL -
qr_code_key uuid QR identifier 36
qr_code_image string Image (Base64) -

#### initial_payment_data object

Field Type Description Characters
receiver_conciliation_id string Payment reconciliation ID 32

#### recurrence_status enumerators

Enumerator Description
pending_confirmation Pending confirmation
active Active
cancelled Cancelled
suspended Suspended
expired Expired

---

## Tips and Best Practices

✓
Reconciliation in variable recurrence: for variable_amount , reconcile the amount 10 to 3 days before the charge date.
✓
Pix messages: use pix_message with up to 140 characters to clearly explain the initial charge.
⚠
Security: validate documents/accounts and handle network and external integration errors with idempotent retries.

---

# Create a Recurrence (Journey 2)

URL: /en/documentation/baas/pix_automatico/recebedor/journey_two

> Journey 2 — QR Code with recurrence data only

{`
.hero-section { background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%); border: 1px solid #e5e7eb; border-radius: 16px; padding: 24px; margin: 24px 0 32px 0; }
.hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 20px; }
.hero-item { background: #ffffff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; }
.hero-item > strong { display: block; color: #1e40af; font-size: 14px; margin-bottom: 6px; font-weight: 700; }
.hero-item p { margin: 0; font-size: 13px; color: #475569; line-height: 1.5; }

.endpoint-card { background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); border: 2px solid #e5e7eb; border-radius: 12px; padding: 24px; position: relative; overflow: hidden; }
.endpoint-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: linear-gradient(to bottom, #3b82f6, #1e40af); }
.endpoint-list { display: grid; gap: 12px; font-size: 13px; color: #334155; }
.endpoint__item { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 12px; background: #ffffff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px 14px; }
.badge { font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 6px; color: #fff; text-transform: uppercase; letter-spacing: .4px; background: #1e40af; }

.details-container { background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); border: 1px solid #e5e7eb; border-radius: 10px; padding: 8px 12px; margin: 20px 0; }
.details-container summary { font-weight: 700; color: #1e40af; cursor: pointer; font-size: 14px; padding: 10px 0 10px 28px; display: flex; align-items: center; position: relative; }
.details-container summary::-webkit-details-marker { display: none; }
.details-container summary::before { content: ''; position: absolute; left: 10px; width: 0; height: 0; border-left: 7px solid #1e40af; border-top: 6px solid transparent; border-bottom: 6px solid transparent; transition: transform .2s ease; }
.details-container[open] summary::before { transform: rotate(90deg); }
.code-block { margin-top: 12px; border-radius: 8px; overflow: hidden; }

.table-container { overflow: auto; border: 0; border-radius: 0; margin: 20px 0; background: transparent; }
.table-container table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-container th, .table-container td { border-top: 1px solid #e5e7eb; padding: 12px 16px; text-align: left; }
.table-container thead th { background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%); font-weight: 700; color: #0f172a; font-size: 13px; }
`}

Overview
What is it QR Code that presents only the recurrence data for the payer to authorize, without immediate charge.
When to use Onboarding without initial charge; use at points of sale, counters, screens or printed materials.
How it works Payer reads QR → views recurrence data in app → authorizes → future charges can be scheduled.
Benefits Agile enablement via QR; allows mass customer acquisition with low friction and QR can be reused for new recurrences.

## Request

{`
.endpoint-card { background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); border: 2px solid #e5e7eb; border-radius: 12px; padding: 24px; position: relative; overflow: hidden; }
.endpoint-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: linear-gradient(to bottom, #3b82f6, #1e40af); }
.endpoint-list { display: grid; gap: 12px; font-size: 13px; color: #334155; }
.endpoint__item { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 12px; background: #ffffff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px 14px; }
.badge { font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 6px; color: #fff; text-transform: uppercase; letter-spacing: .4px; background: #1e40af; }
.details-container { background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); border: 1px solid #e5e7eb; border-radius: 10px; padding: 8px 12px; margin: 20px 0; }
.details-container summary { font-weight: 700; color: #1e40af; cursor: pointer; font-size: 14px; padding: 10px 0 10px 28px; display: flex; align-items: center; position: relative; }
.details-container summary::-webkit-details-marker { display: none; }
.details-container summary::before { content: ''; position: absolute; left: 10px; width: 0; height: 0; border-left: 7px solid #1e40af; border-top: 6px solid transparent; border-bottom: 6px solid transparent; transition: transform .2s ease; }
.details-container[open] summary::before { transform: rotate(90deg); }
.code-block { margin-top: 12px; border-radius: 8px; overflow: hidden; }
`}

ENDPOINT /account/ account_key /outgoing_recurrence/journey_two
METHOD POST

### Request Path Params

| Field         | Type  | Description                                      | Characters |
|---------------|-------|------------------------------------------------|------------|
| `account_key`*| uuid4 | Unique identifier key for the account.          | 36         |

### Request Body

**Request Body: Create Recurrence (Journey 2)**

```json
{
    "request_control_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
    "periodicity": "monthly",
    "minimum_recurrence_amount": 125,
    "start_date": "2025-06-10",
    "end_date": "2027-06-10",
    "pix_message": "Conta de Luz Residencial nº123",
    "recurrence_type": "variable_amount",
    "debtor_data": {
        "name": "Sebastião",
        "email": "sebastiao@test.com",
        "document_number": "05431134850",
        "contract_id": "124587624",
        "address": {
            "street": "Av. Brigadeiro Faria Lima",
            "state": "SP",
            "city": "São Paulo",
            "neighborhood": "Jardim Paulistano",
            "number": "2391",
            "postal_code": "01452905",
            "complement": "Complemento"
        }
    },
    "retry_configuration": {
        "retry_allowed": true,
        "retry_rule": {
            "first_retry": {
                "day": "1"
            },
            "second_retry": {
                "day": "3"
            },
            "third_retry": {
                "day": "4"
            }
        }
    },
    "settlement_date_type": "workdays"
}
```

### Body Params

| Field                          | Type       | Description                                                                                                  | Characters |
|--------------------------------|------------|------------------------------------------------------------------------------------------------------------|------------|
| `request_control_key` *        | uuid       | Unique request identifier key used by the client in uuid4 format.                                        | 36         |
| `periodicity` *                | enumerator | Type of periodicity associated with the subscription recurrence.                                               | [periodicity Enumerators](#periodicity-enumerators) |
| `minimum_recurrence_amount`   | number     | Minimum transaction amount for variable amount recurrences (in cents).                               | -          |
| `start_date` *                 | string     | Recurrence start date (ISO 8601 format, e.g., "2025-07-01").                                      | -          |
| `end_date`                     | string     | Recurrence end date; for indefinite period, send as null.                                | -          |
| `pix_message` *                | string     | Message to be sent with the PIX transaction.                                                              | 140        |
| `debtor_data` *                | Object     | Debtor (subscriber) data.                                                                              | [debtor_data Object](#debtor_data-object) |
| `retry_configuration` *        | Object     | Retry configuration for incomplete transactions.                                               | [retry_configuration Object](#retry_configuration-object) |
| `settlement_date_type` *       | enumerator | Type of settlement date adjustment                                                                       | [settlement_date_type Enumerators](#settlement_date_type-enumerators) |
| `recurrence_type` *       | enumerator | Type of recurrence                                                                                             | [recurrence_type Enumerators](#recurrence_type-enumerators) |

:::caution Attention
The field `minimum_recurrence_amount` is optional and should only be informed for variable amount recurrence. If the recurrence is fixed amount, the field `recurrence_amount` should be sent with the recurrence amount. As well as the `recurrence_type` enumerator, which should correspond to the recurrence type (Fixed amount or variable).
:::

### periodicity Enumerators

| Enumerator   | Description             |
|--------------|-----------------------|
| `weekly`     | Weekly recurrence   |
| `monthly`    | Monthly recurrence    |
| `quarterly`  | Quarterly recurrence|
| `semiannual` | Semiannual recurrence |
| `annual`     | Annual recurrence     |

### settlement_date_type Enumerators

| Enumerator   | Description             |
|--------------|-----------------------|
| `workdays`     | Business days   |
| `calendar_days`     | Calendar days   |

### recurrence_type Enumerators

| Enumerator   | Description             |
|--------------|-----------------------|
| `fixed_amount`     | Fixed Amount Recurrence   |
| `variable_amount`     | Variable Amount Recurrence   |

### debtor_data Object

| Field               | Type   | Description             | Characters |
|---------------------|--------|-----------------------|------------|
| `name` *            | string | Subscriber name.    | 50         |
| `email` *           | string | Subscriber email.  | 100        |
| `document_number` * | string | Subscriber CPF or CNPJ. | 14      |
| `contract_id`       | string | Subscriber contract identifier. | 100      |
| `address` *         | Object | Subscriber address.| [address Object](#address-object) |

### address Object

| Field         | Type   | Description         | Characters |
|---------------|--------|-------------------|------------|
| `street`      | string | Street.              | -          |
| `state`       | string | State.           | -          |
| `city`        | string | City.           | -          |
| `neighborhood`| string | Neighborhood.           | -          |
| `number`      | string | Number.           | -          |
| `postal_code` | string | Postal code.              | -          |
| `complement`  | string | Complement.      | -          |

### retry_configuration Object

| Field         | Type    | Description               | Characters |
|---------------|---------|-------------------------|------------|
| `retry_allowed`| boolean | Indicates whether retries are allowed. | -     |
| `retry_rule`  | Object  | Retry rules.  | [retry_rule Object](#retry_rule-object) |

### retry_rule Object

| Field         | Type   | Description               | Characters |
|---------------|--------|-------------------------|------------|
| `first_retry` | Object | First retry configuration. | [retry_detail Object](#retry_detail-object) |
| `second_retry`| Object | Second retry configuration.  | [retry_detail Object](#retry_detail-object) |
| `third_retry` | Object | Third retry configuration. | [retry_detail Object](#retry_detail-object) |

### retry_detail Object

| Field | Type   | Description               | Characters |
|-------|--------|-------------------------|------------|
| `day` | string | Retry day.     | -          |

## Response

STATUS 200

**Response Body**

```json
{
    "request_control_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
    "outgoing_recurrence_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "outgoing_recurrence_status": "pending_confirmation",
    "qr_code_data": {
	    "qr_code_url": "url",
	    "qr_code_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc85",
	    "qr_code_image": "imageb64"  
    },
    "created_at": "2021-10-22T20:30:23.459Z"
}
```

### Response Body

| Field                 | Type       | Description                                                                 | Characters |
|-----------------------|------------|---------------------------------------------------------------------------|------------|
| `request_control_key` | uuid       | Request control key sent by the client.                     | 36         |
| `recurrence_key`      | uuid       | Unique identifier key for the subscription recurrence.                | 36         |
| `recurrence_status`   | enumerator | Current recurrence status.                                              | [recurrence_status Enumerators](#recurrence_status-enumerators) |
| `qr_code_data`   | enumerator | Current recurrence status.                                              | [qr_code_data Object](#qr_code_data-enumerators) |
| `created_at`          | string     | Recurrence creation date and time (ISO 8601 format).                 | -          |

### qr_code_data Object

| Field | Type   | Description               | Characters |
|-------|--------|-------------------------|------------|
| `qr_code_url` | string | URL of the QR code copy and paste     | -          |
| `qr_code_key`| uuuid | Unique identifier key for the QR code. | 36          |
| `qr_code_image`| string | Base64 of the QR code image | -         |

### recurrence_status Enumerators

| Enumerator           | Description                         |
|----------------------|-----------------------------------|
| `pending_confirmation` | Recurrence pending confirmation |
| `active`              | Active recurrence                 |
| `cancelled`           | Cancelled recurrence             |
| `suspended`           | Suspended recurrence              |
| `expired`             | Expired recurrence              |

STATUS 4XX

**Response Error**

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em português",
  "code": "codigo"
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`                | Description (eng)<br/>`description`                                          | Description (ptbr)<br/>`translation`                                 |
|-------------|----------------------|-----------------------------------|----------------------------------------------------------------------------|--------------------------------------------------------------------|
| 400         | QIT000002            | Bad Request                       | Invalid request schema.                                                    | Erro no esquema da requisição.                                     |
| 403         | APX000030            | Unauthorized Transaction          | User is not authorized to create this recurrence.                          | Usuário não autorizado a criar esta recorrência.                   |
| 403         | APX000018            | Endpoint Access Denied            | Requester lacks permission to access this endpoint.                        | Requester não possui permissão para acessar este endpoint.          |
| 404         | APX000021            | Subscription Not Found            | Subscription \{subscription_key\} not found.                               | Assinatura \{subscription_key\} não encontrada.                     |
| 404         | APX000002            | Recurrence Not Found              | Recurrence \{recurrence_key\} not found.                                   | Recorrência \{recurrence_key\} não encontrada.                      |
| 406         | APX000027            | Invalid Transaction Amount        | Transaction amount \{minimum_transaction_amount\} is invalid.              | Valor da transação \{minimum_transaction_amount\} é inválido.        |
| 409         | APX000014            | Request Control Key Conflict      | The request_control_key \{request_control_key\} is already in use.         | A request_control_key \{request_control_key\} já está em uso.        |

---

# Requester Recurrence Listing

URL: /en/documentation/baas/pix_automatico/recebedor/listar_recorrencias_de_um_requester

## Request

ENDPOINT /outgoing_recurrences
METHOD GET

### Query Params

| Field                       | Type        | Description                                                                | Characters |
|-----------------------------|-------------|----------------------------------------------------------------------------|------------|
| `outgoing_recurrence_status`| enumerator      | Filters recurrences by status (`approved`, `pending`, `rejected`, `pending_confirmation`) | 30         |
| `page`                      | integer     | Page number to be returned (pagination).                                   | -          |
| `page_size`                 | integer     | Number of items per page (pagination).                                     | -          |

---

## Response

STATUS 200

Response Body

```json
{
  "outgoing_recurrences": [
    {
      "request_control_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
      "outgoing_recurrence_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "outgoing_recurrence_status": "approved",
      "periodicity": "monthly",
      "journey_type": "journey_four",
      "start_date": "2025-06-10",
      "end_date": "2027-06-10",
      "account_key": "uuuid",
      "outgoing_recurrence_data": {
        "minimum_recurrence_amount": 123.45,
        "recurrence_amount": null,
        "retry_configuration": {
          "retry_allowed": true,
          "retry_rule": {
            "first_retry": {
              "day": "1",
              "time": "14:00"
            },
            "second_retry": {
              "day": "3",
              "time": "12:00"
            },
            "third_retry": {
              "day": "4",
              "time": "15:32"
            }
          }
        },
        "debtor_data": {
          "name": "Sebastião",
          "email": "sebastiao@test.com",
          "document_number": "05431134850",
          "address": {
            "city": "São Paulo",
            "postal_code": "123456-789",
            "uf": "SP",
            "street": "Av Paulista 123"
          },
          "account_data": {
            "account_number": "123456",
            "account_digit": "7",
            "account_branch": "0001",
            "ispb": "31872495"
          }
        },
        "qr_code_data": {
          "qr_code_key": "0f45cc3d-9bd1-4d68-a865-4cf477b5da45",
          "qr_code_url": "urlqrcode.url",
          "qr_code_image": "image_base64"
        },
        "initial_payment_data": {
          "amount": 22.34,
          "pix_key": "3d7d6a2b-f72f-44z7-bb20-79a94dff5645",
          "qr_code_type": "dynamic_term",
          "additional_data": [
            {
              "key_name": "Juros e Multa",
              "value": "Juros 2 ao mes e multa de 1%"
            }
          ],
          "fine_amount": 3,
          "interest_amount": 2,
          "expiration_date": "2023-03-25",
          "max_payment_days": 128,
          "rebate_amount": 1,
          "discounts": [],
          "receiver_conciliation_id":"3d7d6a2bf72f44z7bb2079a94dff5645",
          "transaction_data":{
            "transaction_key":"4d7d6a2b-f72f-44z7-bb20-79a94dff5645",
            "pix_transfer_key":"5d7d6a2b-f72f-44z7-bb20-79a94dff5645",
            "end_to_end_id":"E32402502202303141907qlBAF1evdJ2"
         }
        },
        "pix_message": "Conta de Luz Residencial nº123",
        "settlement_date_type": "calendar_days"
      }
    }
  ],
  "pagination": {
    "page": 1,
    "page_size": 25,
    "number_of_pages": 4
  }
}
```

### Response Body Params

| Field                  | Type   | Description                                                                             | Characters |
|------------------------|--------|-----------------------------------------------------------------------------------------|------------|
| `outgoing_recurrences` | array  | List of automatic recurrence objects.                                                   | [Array outgoing_recurrences](#array-outgoing_recurrences) |
| `pagination`           | object | Pagination object containing information about result pages.                             | [Object pagination](#object-pagination)                   |

---

### Array outgoing_recurrences

| Field                        | Type       | Description                                                                             | Characters |
|------------------------------|------------|-----------------------------------------------------------------------------------------|------------|
| `request_control_key`        | uuidv4     | Unique key for request control.                                                         | 36         |
| `outgoing_recurrence_key`    | uuidv4     | Automatic recurrence identifier.                                                        | 36         |
| `account_key`                | uuidv4     | Unique account identification key                                                       | 36         |
| `outgoing_recurrence_status` | string     | Current recurrence status (`approved`, `pending`, `rejected`, etc.).                    | 30         |
| `periodicity`                | enumerator | Recurrence periodicity.                                                                 | [Enumerators periodicity](#enumerators-periodicity)      |
| `journey_type`               | enumerator | Automatic recurrence journey.                                                           | [Enumerators journey_type](#enumerators-journey_type)    |
| `start_date`                 | string     | Recurrence start date (ISO 8601 format, e.g., `2025-06-10`).                          | 10         |
| `end_date`                   | string     | Recurrence end date (ISO 8601 format) or null if indeterminate.                        | 10 or null |
| `outgoing_recurrence_data`   | object     | Object grouping subscription parameters and complementary data.                         | [Object outgoing_recurrence_data](#object-outgoing_recurrence_data) |

---

### Object outgoing_recurrence_data

| Field                       | Type     | Description                                                    | Characters |
|-----------------------------|----------|----------------------------------------------------------------|------------|
| `minimum_recurrence_amount` | number   | Expected minimum value for variable amount recurrences          | -          |
| `recurrence_amount`         | number   | Recurrence amount (for fixed value; null if variable)          | -          |
| `retry_configuration`       | object   | Retry configuration for incomplete recurrences                  | [Object retry_configuration](#object-retry_configuration) |
| `debtor_data`               | object   | Debtor (subscriber) data                                        | [Object debtor_data](#object-debtor_data)                |
| `qr_code_data`              | object   | QR Code data generated for payment (if any)                    | [Object qr_code_data](#object-qr_code_data)              |
| `initial_payment_data`      | object   | Initial charge data                                             | [Object initial_payment_data](#object-initial_payment_data) |
| `pix_message`               | string   | Message sent along with the PIX transaction                     | 140        |
| `settlement_date_type`      | enumerator| Settlement date adjustment type                                 | [Enumerators settlement_date_type](#enumerators-settlement_date_type) |

---

### Object retry_configuration

| Field           | Type    | Description                                     | Characters |
|-----------------|---------|------------------------------------------------|------------|
| `retry_allowed` | boolean | Indicates if retries are enabled               | -          |
| `retry_rule`    | object  | Detailed retry rules                           | [Object retry_rule](#object-retry_rule) |

---

### Object retry_rule

| Field         | Type   | Description                       | Characters |
|---------------|--------|-----------------------------------|------------|
| `first_retry` | object | Configuration for 1st retry       | [Object retry_detail](#object-retry_detail) |
| `second_retry`| object | Configuration for 2nd retry       | [Object retry_detail](#object-retry_detail) |
| `third_retry` | object | Configuration for 3rd retry       | [Object retry_detail](#object-retry_detail) |

---

### Object retry_detail

| Field | Type   | Description               | Characters |
|-------|--------|---------------------------|------------|
| `day` | string | Retry day.                | -          |
| `time`| string | Retry time.               | -          |

---

### Object debtor_data

| Field             | Type   | Description                | Characters |
|-------------------|--------|----------------------------|------------|
| `name`            | string | Subscriber name.           | 50         |
| `email`           | string | Subscriber email.          | 100        |
| `document_number` | string | CPF or CNPJ.               | 14         |
| `address`         | object | Subscriber address.        | [Object address](#object-address) |
| `account_data`    | object | Bank account data.         | [Object account_data](#object-account_data) |

---

### Object address

| Field         | Type   | Description         | Characters |
|---------------|--------|---------------------|------------|
| `city`        | string | City.               | -          |
| `postal_code` | string | Postal code.        | -          |
| `uf`          | string | State (abbreviation).| -          |
| `street`      | string | Street address.     | -          |

---

### Object account_data

| Field           | Type   | Description                      | Characters |
|-----------------|--------|----------------------------------|------------|
| `account_number`| string | Account number                   | -          |
| `account_digit` | string | Account digit                    | -          |
| `account_branch`| string | Branch                           | -          |
| `ispb`          | string | Financial institution ISPB       | -         |

---

### Object qr_code_data

| Field            | Type   | Description                                     | Characters |
|------------------|--------|-------------------------------------------------|------------|
| `qr_code_key`    | string | Generated QR Code identifier                    | -          |
| `qr_code_url`    | string | URL for QR Code visualization                   | -          |
| `qr_code_image`  | string | QR Code image (in Base64)                       | -          |

---

### Object initial_payment_data

| Field                     | Type     | Description                                                                  | Characters |
|---------------------------|----------|------------------------------------------------------------------------------|------------|
| `amount`                  | number   | Main amount of the initial charge in reais (R$)                              | -          |
| `pix_key`                 | string   | Destination PIX key for initial payment                                      | 77         |
| `qr_code_type`            | enum     | QR Code type for initial charge.                                             | [Enumerators qr_code_type](#enumerators-qr_code_type) |
| `additional_data`         | array    | List of additional information related to the charge                         | [Array of objects additional_data](#array-additional_data) |
| `fine_amount`             | number   | Fine amount in case of payment delay                                         | -          |
| `interest_amount`         | number   | Interest amount in case of payment delay                                     | -          |
| `expiration_date`         | string   | Initial charge expiration date (ISO 8601 format)                             | 10         |
| `max_payment_days`        | integer  | Maximum number of acceptance days after expiration                          | -          |
| `rebate_amount`           | number   | Discount amount for early payment                                            | -          |
| `discounts`               | array    | List of additional discounts                                                 | -          |
| `receiver_conciliation_id`| string   | Payment conciliation identifier by the receiver                              | 35         |
| `transaction_data`        | object   | Transaction details related to the initial charge                            | [Object transaction_data](#object-transaction_data) |

---

### Array additional_data

| Field        | Type    | Description                                                   | Characters |
|--------------|---------|---------------------------------------------------------------|------------|
| `key_name`   | string  | Additional information name (e.g., "Interest and Fine")       | 140        |
| `value`      | string  | Additional information value or description                   | 140        |

---

### Object transaction_data

| Field               | Type   | Description                            | Characters |
|---------------------|--------|----------------------------------------|------------|
| `transaction_key`   | string | Unique transaction key                 | 36         |
| `pix_transfer_key`  | string | PIX transfer identifier                | 36         |
| `end_to_end_id`     | string | PIX end-to-end identifier              | 32         |

---

### Object pagination

| Field            | Type    | Description                         | Characters |
|------------------|---------|-------------------------------------|------------|
| `page`           | integer | Returned page number.               | -          |
| `page_size`      | integer | Number of items per page.           | -          |
| `number_of_pages`| integer | Total number of available pages.    | -          |

---

### Enumerators periodicity

| Enumerator   | Description           |
|--------------|-----------------------|
| `weekly`     | Weekly recurrence     |
| `monthly`    | Monthly recurrence    |
| `quarterly`  | Quarterly recurrence  |
| `semiannual` | Semiannual recurrence |
| `annual`     | Annual recurrence     |

---

### Enumerators journey_type

| Enumerator      | Description                                        |
|-----------------|---------------------------------------------------|
| `journey_one`   | Direct notification in banking app                 |
| `journey_two`   | QR Code experience for recurrent billing          |
| `journey_three` | Instant payment + QR Code recurrence              |
| `journey_four`  | Recurrent opt-in from PIX operation               |

---

### Enumerators settlement_date_type

| Enumerator      | Description       |
|-----------------|-------------------|
| `workdays`      | Business days     |
| `calendar_days` | Calendar days     |

---

### Enumerators qr_code_type

| Enumerator        | Description                                            |
|-------------------|-------------------------------------------------------|
| `dynamic_instant` | Dynamic QR Code for instant payment                    |
| `dynamic_term`    | Dynamic QR Code for payment with future due date     |

STATUS 4XX

Response Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em português",
  "code": "codigo"
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`                | Description (eng)<br/>`description`                                          | Description (ptbr)<br/>`translation`                                 |
|-------------|----------------------|-----------------------------------|----------------------------------------------------------------------------|-------------------------------------------------------------------|
| 400         | QIT000002            | Bad Request                       | Invalid request schema.                                                    | Erro no esquema da requisição.                                     |
| 404         | APX000002            | Recurrence Not Found              | Recurrence \{recurrence_key\} not found.                                   | Recorrência \{recurrence_key\} não encontrada.                      |

---

# Account Recurrences Listing

URL: /en/documentation/baas/pix_automatico/recebedor/listar_recorrencias_de_uma_conta

## Request

ENDPOINT /account/ ACCOUNT_KEY /outgoing_recurrences
METHOD GET

### Query Params

| Field                       | Type        | Description                                                            | Characters |
|-----------------------------|-------------|------------------------------------------------------------------------|------------|
| `outgoing_recurrence_status`| enumerator      | Filters recurrences by status (`approved`, `pending`, `rejected`, `pending_confirmation`) | 30         |
| `page`                      | integer     | Page number to be returned (pagination).                          | -          |
| `page_size`                 | integer     | Number of items per page (pagination).                                | -          |

---

## Response

STATUS 200

Response Body

```json
{
  "outgoing_recurrences": [
    {
      "request_control_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
      "outgoing_recurrence_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "outgoing_recurrence_status": "approved",
      "periodicity": "monthly",
      "journey_type": "journey_four",
      "start_date": "2025-06-10",
      "end_date": "2027-06-10",
      "outgoing_recurrence_data": {
        "minimum_recurrence_amount": 123.45,
        "recurrence_amount": null,
        "retry_configuration": {
          "retry_allowed": true,
          "retry_rule": {
            "first_retry": {
              "day": "1",
              "time": "14:00"
            },
            "second_retry": {
              "day": "3",
              "time": "12:00"
            },
            "third_retry": {
              "day": "4",
              "time": "15:32"
            }
          }
        },
        "debtor_data": {
          "name": "Sebastião",
          "email": "sebastiao@test.com",
          "document_number": "05431134850",
          "address": {
            "city": "São Paulo",
            "postal_code": "123456-789",
            "uf": "SP",
            "street": "Av Paulista 123"
          },
          "account_data": {
            "account_number": "123456",
            "account_digit": "7",
            "account_branch": "0001",
            "ispb": "31872495"
          }
        },
        "qr_code_data": {
          "qr_code_key": "0f45cc3d-9bd1-4d68-a865-4cf477b5da45",
          "qr_code_url": "urlqrcode.url",
          "qr_code_image": "image_base64"
        },
        "initial_payment_data": {
          "amount": 22.34,
          "pix_key": "3d7d6a2b-f72f-44z7-bb20-79a94dff5645",
          "qr_code_type": "dynamic_term",
          "additional_data": [
            {
              "key_name": "Juros e Multa",
              "value": "Juros 2 ao mes e multa de 1%"
            }
          ],
          "fine_amount": 3,
          "interest_amount": 2,
          "expiration_date": "2023-03-25",
          "max_payment_days": 128,
          "rebate_amount": 1,
          "discounts": [],
          "receiver_conciliation_id":"3d7d6a2bf72f44z7bb2079a94dff5645",
          "transaction_data":{
            "transaction_key":"4d7d6a2b-f72f-44z7-bb20-79a94dff5645",
            "pix_transfer_key":"5d7d6a2b-f72f-44z7-bb20-79a94dff5645",
            "end_to_end_id":"E32402502202303141907qlBAF1evdJ2"
          }
        },
        "pix_message": "Conta de Luz Residencial nº123",
        "settlement_date_type": "calendar_days"
      }
    }
  ],
  "pagination": {
    "page": 1,
    "page_size": 25,
    "number_of_pages": 4
  }
}
```

### Response Body Params

| Field                  | Type   | Description                                                                               | Characters |
|------------------------|--------|-----------------------------------------------------------------------------------------|------------|
| `outgoing_recurrences` | array  | List of automatic recurrence objects.                                           | [Array outgoing_recurrences](#array-outgoing_recurrences) |
| `pagination`           | object | Pagination object containing information about result pages.               | [Object pagination](#object-pagination)                   |

---

### Array outgoing_recurrences

| Field                        | Type       | Description                                                                               | Characters |
|------------------------------|------------|-----------------------------------------------------------------------------------------|------------|
| `request_control_key`        | uuidv4     | Unique key for request control.                                                | 36         |
| `outgoing_recurrence_key`    | uuidv4     | Automatic recurrence identifier.                                                | 36         |
| `outgoing_recurrence_status` | string     | Current status of the recurrence (`approved`, `pending`, `rejected`, etc.).                  | 30         |
| `periodicity`                | enumerator | Recurrence periodicity.                                                           | [Enumerators periodicity](#enumerators-periodicity)      |
| `journey_type`               | enumerator | Automatic recurrence journey.                                                      | [Enumerators journey_type](#enumerators-journey_type)    |
| `start_date`                 | string     | Recurrence start date (ISO 8601 format, e.g., `2025-06-10`).                  | 10         |
| `end_date`                   | string     | Recurrence end date (ISO 8601 format) or null, if indeterminate.            | 10 or null |
| `outgoing_recurrence_data`   | object     | Object grouping subscription parameters and complementary data.                       | [Object outgoing_recurrence_data](#object-outgoing_recurrence_data) |

---

### Object outgoing_recurrence_data

| Field                       | Type     | Description                                                      | Characters |
|-----------------------------|----------|----------------------------------------------------------------|------------|
| `minimum_recurrence_amount` | number   | Minimum expected amount for variable amount recurrences        | -          |
| `recurrence_amount`         | number   | Recurrence amount (for fixed amount; null if variable)        | -          |
| `retry_configuration`       | object   | Configuration for attempts on incomplete recurrences      | [Object retry_configuration](#object-retry_configuration) |
| `debtor_data`               | object   | Debtor (subscriber) data                                    | [Object debtor_data](#object-debtor_data)                |
| `qr_code_data`              | object   | QR Code data generated for payment (if any)            | [Object qr_code_data](#object-qr_code_data)              |
| `initial_payment_data`      | object   | Initial charge data                                       | [Object initial_payment_data](#object-initial_payment_data) |
| `pix_message`               | string   | Message sent along with the PIX transaction                          | 140        |
| `settlement_date_type`      | enumerator| Settlement date adjustment type                            | [Enumerators settlement_date_type](#enumerators-settlement_date_type) |

---

### Object retry_configuration

| Field           | Type    | Description                                   | Characters |
|-----------------|---------|---------------------------------------------|------------|
| `retry_allowed` | boolean | Indicates if retries are enabled    | -          |
| `retry_rule`    | object  | Detailed retry rules          | [Object retry_rule](#object-retry_rule) |

---

### Object retry_rule

| Field         | Type   | Description                         | Characters |
|---------------|--------|-----------------------------------|------------|
| `first_retry` | object | Configuration for 1st retry  | [Object retry_detail](#object-retry_detail) |
| `second_retry`| object | Configuration for 2nd retry  | [Object retry_detail](#object-retry_detail) |
| `third_retry` | object | Configuration for 3rd retry  | [Object retry_detail](#object-retry_detail) |

---

### Object retry_detail

| Field | Type   | Description               | Characters |
|-------|--------|-------------------------|------------|
| `day` | string | Retry day.     | -          |
| `time`| string | Retry time. | -          |

---

### Object debtor_data

| Field             | Type   | Description              | Characters |
|-------------------|--------|------------------------|------------|
| `name`            | string | Subscriber name.     | 50         |
| `email`           | string | Subscriber email.   | 100        |
| `document_number` | string | CPF or CNPJ.           | 14         |
| `address`         | object | Subscriber address. | [Object address](#object-address) |
| `account_data`    | object | Bank account data.       | [Object account_data](#object-account_data) |

---

### Object address

| Field         | Type   | Description         | Characters |
|---------------|--------|-------------------|------------|
| `city`        | string | City.           | -          |
| `postal_code` | string | ZIP code.              | -          |
| `uf`          | string | State (abbreviation).   | -          |
| `street`      | string | Street address.       | -          |

---

### Object account_data

| Field           | Type   | Description                    | Characters |
|-----------------|--------|------------------------------|------------|
| `account_number`| string | Account number              | -          |
| `account_digit` | string | Account digit              | -          |
| `account_branch`| string | Branch              | -          |
| `ispb`          | string | Financial institution ISPB| -         |

---

### Object qr_code_data

| Field            | Type   | Description                                   | Characters |
|------------------|--------|---------------------------------------------|------------|
| `qr_code_key`    | string | Generated QR Code identifier             | -          |
| `qr_code_url`    | string | URL for QR Code visualization            | -          |
| `qr_code_image`  | string | QR Code image (in Base64)               | -          |

---

### Object initial_payment_data

| Field                     | Type     | Description                                                                | Characters |
|---------------------------|----------|--------------------------------------------------------------------------|------------|
| `amount`                  | number   | Main amount of the initial charge in reais (R$)                        | -          |
| `pix_key`                 | string   | Destination PIX key for initial payment                            | 77         |
| `qr_code_type`            | enum     | QR Code type for initial charge.                                   | [Enumerators qr_code_type](#enumerators-qr_code_type) |
| `additional_data`         | array    | List of additional information related to the charge                   | [Array of objects additional_data](#array-additional_data) |
| `fine_amount`             | number   | Fine amount, if payment delay occurs                          | -          |
| `interest_amount`         | number   | Interest amount, if payment delay occurs                         | -          |
| `expiration_date`         | string   | Initial charge expiration date (ISO 8601 format)                 | 10         |
| `max_payment_days`        | integer  | Maximum number of acceptance days after expiration                           | -          |
| `rebate_amount`           | number   | Discount amount for early payment                              | -          |
| `discounts`               | array    | List of additional discounts                                            | -          |
| `receiver_conciliation_id`| string   | Payment conciliation identifier by receiver                 | 35        |
| `transaction_data`        | object   | Transaction details related to the initial charge                     | [Object transaction_data](#object-transaction_data) |

---

### Array additional_data

| Field        | Type    | Description                                                 | Characters |
|--------------|---------|-----------------------------------------------------------|------------|
| `key_name`   | string  | Additional information name (e.g., "Juros e Multa")        | 140        |
| `value`      | string  | Additional information value or description                | 140        |

---

### Object transaction_data

| Field               | Type   | Description                              | Characters |
|---------------------|--------|----------------------------------------|------------|
| `transaction_key`   | string | Unique transaction key               | 36         |
| `pix_transfer_key`  | string | PIX transfer identifier     | 36         |
| `end_to_end_id`     | string | PIX end-to-end identifier        | 32         |

---

### Object pagination

| Field            | Type    | Description                           | Characters |
|------------------|---------|-------------------------------------|------------|
| `page`           | integer | Returned page number.         | -          |
| `page_size`      | integer | Number of items per page.     | -          |
| `number_of_pages`| integer | Total available pages.       | -          |

---

### Enumerators periodicity

| Enumerator   | Description              |
|--------------|-----------------------|
| `weekly`     | Weekly recurrence   |
| `monthly`    | Monthly recurrence    |
| `quarterly`  | Quarterly recurrence|
| `semiannual` | Semiannual recurrence |
| `annual`     | Annual recurrence     |

---

### Enumerators journey_type

| Enumerator      | Description                                    |
|-----------------|----------------------------------------------|
| `journey_one`   | Direct notification in banking app     |
| `journey_two`   | QR Code experience for recurring charge  |
| `journey_three` | Instant payment + recurring QR Code   |
| `journey_four`  | Recurring opt-in from PIX operation    |

---

### Enumerators settlement_date_type

| Enumerator      | Description         |
|-----------------|------------------|
| `workdays`      | Business days        |
| `calendar_days` | Calendar days     |

---

### Enumerators qr_code_type

| Enumerator        | Description                                          |
|-------------------|---------------------------------------------------|
| `dynamic_instant` | Dynamic QR Code for instant payment        |
| `dynamic_term`    | Dynamic QR Code for payment with future due date |

STATUS 4XX

Response Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em português",
  "code": "codigo"
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`                | Description (eng)<br/>`description`                                          | Description (ptbr)<br/>`translation`                                 |
|-------------|----------------------|-----------------------------------|----------------------------------------------------------------------------|--------------------------------------------------------------------|
| 400         | QIT000002            | Bad Request                       | Invalid request schema.                                                    | Erro no esquema da requisição.                                     |
| 404         | APX000002            | Recurrence Not Found              | Recurrence \{recurrence_key\} not found.                                   | Recorrência \{recurrence_key\} não encontrada.                      |

---

# Scenario Simulation

URL: /en/documentation/baas/pix_automatico/recebedor/simulacao

Complete guide to simulate the receiver flow of the automatic-pix-api in sandbox environment. This guide includes both mock endpoints and real endpoints necessary for the complete test flow.

:::caution Important Prerequisites
Before executing any mock simulation, you **must** create a recurrence using one of the available authorization journeys. Mocks only simulate SPI responses, but the recurrence needs to exist in the system.

**Check the creation journeys:**
- [Journey 1 - Push Notification](./journey_one.md)
- [Journey 2 - QR Code (recurrence only)](./journey_two.md)
- [Journey 3 - QR Code (with first payment)](./journey_three.md)
- [Journey 4 - QR Code (with first payment and variable amounts)](./journey_four.md)
:::

{`
.pix-flow-container {
  width: 100%;
  max-width: 800px;
  margin: 40px auto;
  background-color: #f8fafc;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 30px;
  position: relative;
  border: 1px solid #e5e7eb;
}

.pix-flow-header {
  text-align: center;
  margin-bottom: 30px;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 20px;
  position: relative;
}

.pix-flow-header h3 {
  font-size: 24px;
  font-weight: 700;
  color: #1e40af;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.pix-flow-header p {
  font-size: 14px;
  color: #64748b;
}

.status-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
}

.status-light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #10b981;
  animation: pulse-status 2s infinite;
}

@keyframes pulse-status {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  50% { opacity: 0.8; box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

.pix-flowchart {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 800px;
  overflow-y: auto;
  padding-right: 10px;
}

.pix-flowchart::-webkit-scrollbar {
  width: 8px;
}

.pix-flowchart::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}

.pix-flowchart::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 10px;
}

.pix-flowchart::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}

.pix-step {
  background-color: #ffffff;
  border-radius: 12px;
  padding: 18px;
  position: relative;
  border-left: 5px solid;
  transition: all 0.3s ease;
  cursor: pointer;
  opacity: 0;
  transform: translateX(-20px);
  animation: fadeInStep 0.5s forwards;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: inherit;
}

.pix-step:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-left-width: 6px;
}

.pix-step:visited {
  color: inherit;
}

.pix-step.step-create { border-left-color: #3b82f6; }
.pix-step.step-approve { border-left-color: #1e293b; }
.pix-step.step-process { border-left-color: #1e40af; }
.pix-step.step-conciliate { border-left-color: #0f172a; }
.pix-step.step-update { border-left-color: #ec4899; }
.pix-step.step-attempts { border-left-color: #3b82f6; }

.pix-step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.pix-step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #f1f5f9;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.pix-step:hover .pix-step-number {
  transform: scale(1.15);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.pix-step.step-create .pix-step-number { background-color: #3b82f6; color: #ffffff; }
.pix-step.step-approve .pix-step-number { background-color: #1e293b; color: #ffffff; }
.pix-step.step-process .pix-step-number { background-color: #1e40af; color: #ffffff; }
.pix-step.step-conciliate .pix-step-number { background-color: #0f172a; color: #ffffff; }
.pix-step.step-update .pix-step-number { background-color: #ec4899; color: #ffffff; }
.pix-step.step-attempts .pix-step-number { background-color: #3b82f6; color: #ffffff; }

.pix-step-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  flex-grow: 1;
  margin-left: 12px;
}

.pix-step-type {
  font-size: 11px;
  background-color: #f1f5f9;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pix-step-type.mock { background-color: #dbeafe; color: #1e40af; }
.pix-step-type.real { background-color: #dcfce7; color: #16a34a; }
.pix-step-type.optional { background-color: #fef3c7; color: #d97706; }

.pix-step-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  margin-top: 8px;
}

.pix-step.active .pix-step-content {
  max-height: 500px;
}

.pix-step-description {
  font-size: 14px;
  line-height: 1.6;
  color: #475569;
}

.pix-step-info {
  background-color: #eff6ff;
  border-left: 3px solid #3b82f6;
  padding: 10px 14px;
  font-size: 13px;
  color: #1e40af;
  border-radius: 6px;
}

.pix-step-warning {
  background-color: #fef3c7;
  border-left: 3px solid #f59e0b;
  padding: 10px 14px;
  font-size: 13px;
  color: #92400e;
  border-radius: 6px;
}

.pix-connector {
  height: 24px;
  width: 3px;
  background: linear-gradient(to bottom, #cbd5e1, #94a3b8);
  margin: -12px auto;
  position: relative;
  z-index: 1;
  border-radius: 2px;
}

.pix-connector::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #94a3b8;
}

.pix-branch-container {
  margin-top: 30px;
  padding-top: 0px;
}

.pix-branch-title {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 24px;
}
.pix-branch-container {
  position: relative;
}

.pix-branch-connectors {
  position: absolute;
  top: -25px;
  left: 0;
  right: 0;
  height: 40px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 0;
}

.pix-branch-arrow {
  width: 3px;
  height: 105px;
  position: relative;
  opacity: 0.9;
}

.pix-branch-arrow::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 10px solid;
}

.pix-branch-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.pix-branch-option {
  background-color: #ffffff;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.pix-branch-option:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.branch-title-payment {
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 14px;
  color: #1e40af;
}

.branch-title-rejection {
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 14px;
  color: #ec4899;
}

.pix-branch-button {
  padding: 14px 20px 5px 20px; 
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
  border: none;
  cursor: pointer;
  width: 100%;
  margin-top: 8px;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  align-items: center;
  justify-content: center;
}

.pix-branch-button:hover {
  transform: scale(1.02);
}

.branch-button-payment {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #60a5fa 100%);
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.branch-button-rejection {
  background: linear-gradient(135deg, #9f1239 0%, #ec4899 50%, #f472b6 100%);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

@keyframes fadeInStep {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 768px) {
  .pix-flow-container {
    padding: 20px;
  }

  .pix-flow-header h3 {
    font-size: 20px;
  }

  .pix-step {
    padding: 14px;
  }

  .pix-step-title {
    font-size: 14px;
  }

  .pix-step-number {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .pix-branch-options {
    grid-template-columns: 1fr;
  }

  .status-indicator {
    top: 5px;
    right: 5px;
    font-size: 10px;
  }
}
`}

Complete Simulation Flow
End-to-end testing of Automatic PIX - Sandbox Environment
SANDBOX

1
Create Recurrence
REAL
Mandatory step before any simulation. Choose one of the four available journeys (Journey 1: Push Notification, Journeys 2-4: QR Code with different configurations). After creating, save the returned outgoing_recurrence_spi_id .
Available journeys: Journey 1 (Push), Journey 2 (QR Code - recurrence), Journey 3 (QR Code + first payment), Journey 4 (QR Code + payment + variable amounts)

2
Approve Recurrence
MOCK
Simulates the recurrence status updates that SPI will send to automatic-pix-api. Use the /mock/outgoing_recurrence/OUTGOING_RECURRENCE_SPI_ID endpoint to update status to pending_confirmation and then to approved .
Attention: In journeys 2, 3 and 4, you must also send account data ( account_data ) in the approval. In journeys 3 and 4, also include first payment information.

3
Process Payment Orders
MOCK
Simulates processing of payment orders through the /mock/process_payment_orders endpoint. This step automatically creates conciliation batches and sends the batch creation webhook to your configured URL.
What happens: Orders are created automatically, conciliation batches are created or updated based on reference_date and recurrence type, and creation webhook is triggered.

4
Query and Reconcile Orders
REAL
Real step (not a mock): Query the created conciliation batch and obtain the receiver_conciliation_id and payment_order_key . For variable_amount recurrences, you must update the payment order with the specific amount.
Important: This step is mandatory for variable_amount recurrences. Without the amount update, the order will not be processed. For fixed_amount , this step is not necessary.

5
Update Execution Date
MOCK
Updates the next_retry_execution_datetime of a payment order to the current date, allowing attempts processing to occur immediately. Use the /mock/payment_order/PAYMENT_ORDER_KEY/update_next_retry_execution_datetime endpoint.
Sandbox only. This step is necessary to advance the flow and allow immediate processing of payment attempts.

6
Process Payment Attempts
MOCK
Simulates processing of payment attempts through the /mock/process_payment_order_attempts endpoint. Creates necessary attempts for the automatic PIX flow, preparing the system to receive incoming PIX simulation or rejection.
Sandbox only. After this step, you can simulate PIX receipt (Step 7) or rejection (Step 8).

Result Simulations
  
Payment
        7. Simulate Incoming PIX
        Simulates successful payment receipt via PIX
    
Rejections
        7. Simulate Rejection
        Simulates rejection of a payment attempt

{`
if (typeof document !== 'undefined') {
  document.addEventListener('DOMContentLoaded', function() {
    const steps = document.querySelectorAll('.pix-step');
    
    steps.forEach((step, index) => {
      step.style.animationDelay = \`\${index * 0.15}s\`;
      
      step.addEventListener('click', function(e) {
        e.preventDefault();
        const targetId = this.getAttribute('href');
        
        // Toggle active state
        const wasActive = this.classList.contains('active');
        
        // Close all steps
        steps.forEach(s => s.classList.remove('active'));
        
        // If wasn't active, open it
        if (!wasActive) {
          this.classList.add('active');
          
          // Scroll to section
          if (targetId) {
            const targetElement = document.querySelector(targetId);
            if (targetElement) {
              setTimeout(() => {
                targetElement.scrollIntoView({ behavior: 'smooth', block: 'start' });
              }, 300);
            }
          }
        } else {
          // If was active and clicked again, navigate to section
          if (targetId) {
            const targetElement = document.querySelector(targetId);
            if (targetElement) {
              targetElement.scrollIntoView({ behavior: 'smooth', block: 'start' });
            }
          }
        }
      });
    });
    
    // Auto-open first step after animation
    setTimeout(() => {
      if (steps.length > 0) {
        steps[0].classList.add('active');
      }
    }, steps.length * 150 + 200);
  });
}
`}

---
## Prerequisite: Create Recurrence

:::danger Mandatory
**This step is mandatory** before any mock simulation. Choose one of the recurrence creation journeys according to your needs.
:::

### Choose Your Journey

| Journey | Description | Link |
|---------|-------------|------|
| **Journey 1** | Push Notification - Authorization via notification | [Create Recurrence: Journey 1](./journey_one.md) |
| **Journey 2** | QR Code - Recurrence authorization only | [Create Recurrence: Journey 2](./journey_two.md) |
| **Journey 3** | QR Code - Recurrence + first payment | [Create Recurrence: Journey 3](./journey_three.md) |
| **Journey 4** | QR Code - Recurrence + first payment + variable amounts | [Create Recurrence: Journey 4](./journey_four.md) |

:::info Important Information
After creating the recurrence, save the returned `outgoing_recurrence_spi_id`. It will be needed for mock simulations.
:::

---

## Step 1: Recurrence Update Simulation

:::caution Prerequisites
**Before this step**, you must have:
1. Created a recurrence using one of the [creation journeys](#prerequisite-create-recurrence)
2. Obtained the `outgoing_recurrence_spi_id` from the created recurrence
:::

This endpoint simulates the recurrence status updates that SPI will send to automatic-pix-api during different receiver flow journeys.

### Request

ENDPOINT /mock/outgoing_recurrence/ OUTGOING_RECURRENCE_SPI_ID
METHOD PATCH

Request Body: Journey 1 - Request received by Payer PSP

```json
{
  "outgoing_recurrence_status": "pending_confirmation"
}
```

Request Body: Journey 1 - Request confirmation received by Payer PSP

```json
{
  "outgoing_recurrence_status": "approved"
}
```

Request Body: Journeys 2, 3 and 4 - Request received by Payer PSP

```json
{
  "outgoing_recurrence_status": "pending_confirmation"
}
```

Request Body: Journey 2 - Request confirmation received by Payer PSP

```json
{
  "outgoing_recurrence_status": "approved",
  "account_data": {
    "account_number": "123456",
    "account_digit": "7",
    "account_branch": "0001",
    "ispb": "31872495"
  }
}
```

Request Body: Journeys 3 and 4 - Request confirmation received by Payer PSP

```json
{
  "outgoing_recurrence_status": "approved",
  "account_data": {
    "account_number": "123456",
    "account_digit": "7",
    "account_branch": "0001",
    "ispb": "31872495"
  },
  "receiver_conciliation_id": "064b6563329047c59db6902725b8d31e",
  "target_account_key": "23a4a1c8-9d82-4ebe-a90d-44fe8d839ec0",
  "transaction_amount": 250
}
```

### Path Parameters

| Field                          | Type   | Description                                    | Max Char. |
|--------------------------------|--------|------------------------------------------------|-----------|
| **outgoing_recurrence_spi_id*** | string | SPI identifier of the outgoing recurrence      | 50        |

### Request Body Object

| Field                         | Type   | Description                                     | Max Char. |
|-------------------------------|--------|-------------------------------------------------|-----------|
| **outgoing_recurrence_status*** | string | Status of the outgoing recurrence               | 50        |
| **account_data**              | object | Account data (journeys 2, 3 and 4 only)       | -         |

### account_data Object

| Field               | Type   | Description                              | Max Char. |
|---------------------|--------|------------------------------------------|-----------|
| **account_number*** | string | Account number                           | 20        |
| **account_digit***  | string | Account digit                            | 1         |
| **account_branch*** | string | Account branch                           | 6         |
| **ispb***           | string | ISPB code of the financial institution  | 8         |

### outgoing_recurrence_status Enumerator

| Enumerator              | Description                   |
|-------------------------|-------------------------------|
| **pending_confirmation** | Pending confirmation          |
| **approved**            | Approved                      |

:::info Journey Flows
- **Journey 1**: Status update only, no account data
- **Journey 2**: First status only, then status + account data (recurrence approval only)
- **Journeys 3 and 4**: First status only, then status + account data + first payment data
:::

:::tip Next Step
After approving the recurrence, proceed to [Step 3: Process Payment Orders](#step-3-process-payment-orders-simulation)
:::

---

## Step 2: Recurrence Cancellation Simulation (Optional)

:::caution Prerequisites
**Before this step**, you must have:
1. Created a recurrence
2. Approved the recurrence ([Step 1](#step-1-recurrence-update-simulation))
:::

This endpoint simulates the cancellation of an outgoing recurrence triggered by SPI.

### Request

ENDPOINT /mock/outgoing_recurrence/ OUTGOING_RECURRENCE_SPI_ID /cancel
METHOD PATCH

:::info No Payload
This endpoint has no request body (payload). Only the path parameter is required.
:::

### Path Parameters

| Field                          | Type   | Description                                    | Max Char. |
|--------------------------------|--------|------------------------------------------------|-----------|
| **outgoing_recurrence_spi_id*** | string | SPI identifier of the outgoing recurrence      | 50        |

---

## Step 3: Process Payment Orders (Simulation)

:::caution Prerequisites
**Before this step**, you must have:
1. Created a recurrence
2. Approved the recurrence ([Step 1](#step-1-recurrence-update-simulation))
:::

This endpoint simulates the processing of payment orders which will consequently create conciliation batches and send the creation webhook for these batches.

### Request

ENDPOINT /mock/process_payment_orders
METHOD PATCH

:::info No Payload
This endpoint has no request body (payload). The simulation is executed automatically.
:::

:::info What happens in this step?
1. **Payment orders are created** automatically by the system
2. **Conciliation batch is created or updated** (`payment_order_conciliation_batch`)
   - If an open batch already exists for the `reference_date` and for the recurrence type ('fixed_amount' or 'variable_amount'), the order is included in

---

# Automatic Pix Webhooks

URL: /en/documentation/baas/pix_automatico/recebedor/webhooks

Webhook notifications are essential for the proper processing of asynchronous events related to Automatic Pix, especially including authorizations and executions of recurring payments in different journeys.

:::danger Attention!
QI Tech webhooks should not be mapped in a restrictive manner.
Additional fields may be included in the webhook payloads returned by our APIs.
:::

## Recurrence Status Webhook

This webhook is intended to report status changes of authorizations and recurrence cycles of Automatic Pix, differentiating the types of journeys involved.

### Webhook Request Body

### Journey 1 – journey_one

Request Body: Journey 1

```json
{
  "event_type": "baas.automatic_pix.outgoing_recurrence.status_change",
  "origin_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "data": {
    "request_control_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
    "outgoing_recurrence_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "outgoing_recurrence_status": "approved",
    "journey_type": "journey_one",
    "outgoing_recurrence_data": {
      "minimum_recurrence_amount": 123.45,
      "recurrence_amount": null
    },
    "payment_conciliation_batch_key": "uuid"
  }
}
```

### Journey 2 – journey_two

Request Body: Journey 2

```json
{
    "event_type": "baas.automatic_pix.outgoing_recurrence.status_change",
    "origin_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "data": {
        "request_control_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
        "outgoing_recurrence_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
        "outgoing_recurrence_status": "approved",
        "journey_type": "journey_two",
        "outgoing_recurrence_data": {
            "minimum_recurrence_amount": 123.45,
            "recurrence_amount": null
        },
        "payment_conciliation_batch_key": "uuid" or null
    }
}
```

### Journey 3 – journey_three

Request Body: Journey 3

```json
{
    "event_type": "baas.automatic_pix.outgoing_recurrence.status_change",
    "origin_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "data": {
        "request_control_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
        "outgoing_recurrence_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
        "outgoing_recurrence_status": "approved",
        "journey_type": "journey_three",
        "outgoing_recurrence_data": {
            "minimum_recurrence_amount": 123.45,
            "recurrence_amount": null,
            "qr_code_initial_payment_data": {
                "receiver_conciliation_id": "id",
                "transaction_data": {
                    "transaction_key": "uuid",
                    "pix_transfer_key": "uuid",
                    "end_to_end_id": "end_to_end"
                }
            },
            "payment_conciliation_batch_key": "uuid" or null
        }
    }
}
```

### Journey 4 – journey_four

Request Body: Journey 4

```json
{
    "event_type": "baas.automatic_pix.outgoing_recurrence.status_change",
    "origin_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "data": {
        "request_control_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
        "outgoing_recurrence_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
        "outgoing_recurrence_status": "approved",
        "journey_type": "journey_four",
        "outgoing_recurrence_data": {
            "minimum_recurrence_amount": 123.45,
            "recurrence_amount": null
        },
        "qr_code_initial_payment_data": {
            "receiver_conciliation_id": "id",
            "transaction_data": {
                "transaction_key": "uuid" or null,
                "pix_transfer_key": "uuid" or null,
                "end_to_end_id": "end_to_end" or null
            }
        },
        "payment_conciliation_batch_key": "uuid" or null
    }
}
```

:::caution Attention
When the payer user receives the notification, they can choose to schedule the Pix or make the transfer at that moment. If the payer makes the payment instantly, the `baas.automatic_pix.outgoing_recurrence.status_change` webhook will be sent with the information filled in, in case of scheduling the values will be `null`.
:::

### Webhook Body Params

| Field                                | Type       | Description                                                                                                               | Characters |
|-------------------------------------- |------------|---------------------------------------------------------------------------------------------------------------------------|------------|
| `event_type` *                       | string     | Type of reported event (example: `baas.automatic_pix.outgoing_recurrence.status_change`).                               | 100        |
| `origin_key` *                       | string     | Unique identifier of the event origin (UUID).                                                                            | 36         |
| `data` *                             | Object     | Main object containing the automatic recurrence details.                                                                 | [Data Object](#data-object)                                    |

---

### Data Object

| Field                                | Type       | Description                                                                                         | Characters |
|-------------------------------------- |------------|-----------------------------------------------------------------------------------------------------|------------|
| `request_control_key` *               | string     | Unique request control key (UUID4).                                                                 | 36         |
| `outgoing_recurrence_key` *           | string     | Unique identifier of the automatic recurrence (UUID).                                               | 36         |
| `outgoing_recurrence_status` *        | string     | Status of the recurrence in question (ex: `approved`, `pending`, `rejected`, etc.)                  | 30         |
| `journey_type` *                      | enumerator | Journey corresponding to the Automatic Pix authorization (`journey_one`, `journey_two`, etc.).      | [journey_type Enumerators](#journey_type-enumerators) |
| `outgoing_recurrence_data` *           | Object     | Object containing specific recurrence and journey information.                                       | [outgoing_recurrence_data Object](#outgoing_recurrence_data-object) |
| `payment_conciliation_batch_key`       | string     | Grouping identifier for payment conciliation. May be null.                                          | 36 or null |
| `qr_code_initial_payment_data`         | Object     | (Journey 3 and 4) Details of initial QR Code payment data, if any.                                  | [qr_code_initial_payment_data Object](#qr_code_initial_payment_data-object) |

---

### outgoing_recurrence_data Object

| Field                           | Type    | Description                                                                                      | Characters |
|----------------------------------|---------|------------------------------------------------------------------------------------------------- |------------|
| `minimum_recurrence_amount`      | number  | Minimum amount of the authorized recurrence.                                                     | -          |
| `recurrence_amount`              | number  | Total amount of the recurrence (may be null if not applicable).                                  | -          |
| `qr_code_initial_payment_data`   | Object  | (Journey 3) Detailed data of the initial payment if QR Code is used.                            | [qr_code_initial_payment_data Object](#qr_code_initial_payment_data-object) |
| `payment_conciliation_batch_key` | string  | Payment batch/conciliation identifier.                                                          | 36         |

---

### qr_code_initial_payment_data Object

| Field                     | Type    | Description                                               | Characters |
|---------------------------|---------|---------------------------------------------------------|------------|
| `receiver_conciliation_id`| string  | Unique identifier of the receiver's conciliation.        | -          |
| `transaction_data`        | Object  | Transaction details associated with the initial QR code. | [transaction_data Object](#transaction_data-object) |

---

### transaction_data Object

| Field               | Type   | Description                                   | Characters |
|---------------------|--------|---------------------------------------------|------------|
| `transaction_key`   | string | Unique transaction key.                      | 36         |
| `pix_transfer_key`  | string | Associated Pix transfer identifier.          | 36         |
| `end_to_end_id`     | string | Pix end-to-end identifier.                  | 32         |

---

### journey_type Enumerators

| Enumerator      | Description                                  |
|-----------------|----------------------------------------------|
| `journey_one`   | Direct notification in banking app          |
| `journey_two`   | QR Code experience for recurring billing    |
| `journey_three` | Instant payment + QR Code recurrence        |
| `journey_four`  | Recurring opt-in from Pix operation          |

## Payment Order Status Webhook

This webhook is intended to report status changes of Automatic Pix payment orders, informing about cancellations, completed payments, and rejections.

### Webhook Request Body

### Status: Cancelled (cancelled)

Request Body: Cancelled Payment Order

```json
{
  "event_type": "baas.automatic_pix.payment_order.status_change",
  "origin_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "data": {
    "payment_order_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "payment_order_spi_id": "RR2222222220240429njua7shf40k",
    "outgoing_recurrence_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
    "payment_order_status": "cancelled",
    "receiver_conciliation_id": "cac0b5f7-4ee2-40f1-b2ad-16902506503d",
    "transaction_amount": 125.53,
    "payment_order_conciliation_batch_key": "21fc62fd-b0a0-4604-9bea-475e91a9dc82",
    "transaction_key": "21fc62fd-b0a0-4604-9bea-475e91a9dc56",
    "incoming_pix_transfer_key": "21fc62fd-b0a0-4604-9bea-475e91a9dc56"
  }
}
```

### Status: Paid (paid)

Request Body: Paid Payment Order

```json
{
  "event_type": "baas.automatic_pix.payment_order.status_change",
  "origin_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "data": {
    "payment_order_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "payment_order_spi_id": "RR2222222220240429njua7shf40k",
    "outgoing_recurrence_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
    "payment_order_status": "paid",
    "receiver_conciliation_id": "cac0b5f7-4ee2-40f1-b2ad-16902506503d",
    "transaction_amount": 125.53,
    "payment_order_conciliation_batch_key": "21fc62fd-b0a0-4604-9bea-475e91a9dc82",
    "transaction_key": "21fc62fd-b0a0-4604-9bea-475e91a9dc56",
    "incoming_pix_transfer_key": "21fc62fd-b0a0-4604-9bea-475e91a9dc56",
    "paid_at": "2021-10-22T20:30:23.459Z"
  }
}
```

### Status: Rejected (rejected)

Request Body: Rejected Payment Order

```json
{
  "event_type": "baas.automatic_pix.payment_order.status_change",
  "origin_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "data": {
    "payment_order_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "payment_order_spi_id": "RR2222222220240429njua7shf40k",
    "outgoing_recurrence_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
    "payment_order_status": "rejected",
    "receiver_conciliation_id": "cac0b5f7-4ee2-40f1-b2ad-16902506503d",
    "transaction_amount": 125.53,
    "payment_order_conciliation_batch_key": "21fc62fd-b0a0-4604-9bea-475e91a9dc82"
  }
}
```

:::info Information
Rejected payment orders are sent after the maximum number of attempts has been exhausted (if the recurrence allows retries). In this case, the `transaction_key` and `incoming_pix_transfer_key` fields are not included in the payload.
:::

### Webhook Body Params - Payment Order

| Field                                | Type       | Description                                                                                                               | Characters |
|-------------------------------------- |------------|---------------------------------------------------------------------------------------------------------------------------|------------|
| `event_type` *                       | string     | Type of reported event (`baas.automatic_pix.payment_order.status_change`).                                               | 100        |
| `origin_key` *                       | string     | Unique identifier of the event origin (UUID of the payment order).                                                       | 36         |
| `data` *                             | Object     | Main object containing the payment order details.                                                                        | [Data Object](#data-object-payment-order)                                    |

---

### Data Object (Payment Order)

| Field                                | Type       | Description                                                                                         | Characters |
|-------------------------------------- |------------|-----------------------------------------------------------------------------------------------------|------------|
| `payment_order_key` *                 | string     | Unique payment order key (UUID).                                                                    | 36         |
| `payment_order_spi_id` *              | string     | SPI identifier of the payment order.                                                                | 29         |
| `outgoing_recurrence_key` *           | string     | Unique identifier of the associated automatic recurrence (UUID).                                    | 36         |
| `payment_order_status` *              | string     | Payment order status (`cancelled`, `paid`, `rejected`).                                            | 30         |
| `receiver_conciliation_id` *          | string     | Receiver conciliation identifier (UUID).                                                           | 36         |
| `transaction_amount` *                | number     | Payment order transaction amount.                                                                   | -          |
| `payment_order_conciliation_batch_key` * | string  | Associated conciliation batch identifier (UUID).                                                   | 36         |
| `transaction_key`                     | string     | Unique transaction key (present only in `cancelled` and `paid` status).                            | 36         |
| `incoming_pix_transfer_key`           | string     | Incoming PIX transfer identifier (present only in `cancelled` and `paid` status).                   | 36         |
| `paid_at`                             | string     | Payment date and time (present only in `paid` status, ISO 8601 format).                           | -          |

---

### payment_order_status Enumerators

| Enumerator      | Description                                                       |
|-----------------|-------------------------------------------------------------------|
| `cancelled`     | Payment order cancelled by payer or receiver                     |
| `paid`          | Payment order successfully executed                               |
| `rejected`      | Payment order rejected after exhausting retry attempts           |

## Payment Order Attempt Status Webhook

This webhook is intended to report status changes of payment order execution attempts for Automatic Pix, especially informing about rejected attempts and rejection reasons.

### Webhook Request Body

### Status: Rejected (rejected)

Request Body: Rejected Payment Order Attempt

```json
{
  "event_type": "baas.automatic_pix.payment_order_attempt.status_change",
  "origin_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "data": {
    "request_control_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "payment_order_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "payment_order_attempt_key": "21fc62fd-b0a0-4604-9bea-475e91a9dc82",
    "payment_order_status": "pending",
    "payment_order_attempt_status": "rejected",
    "transaction_amount": 125.53,
    "reason": "Conta de destino inexistente",
    "outgoing_recurrence_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82"
  }
}
```

:::info Information
This webhook is sent whenever a payment order execution attempt is rejected by the SPI. The payment order may have new attempts depending on the recurrence configuration and the rejection reason. The `reason` field contains the description of the rejection reason based on the Bacen error code.
:::

### Webhook Body Params - Payment Order Attempt

| Field                                | Type       | Description                                                                                                               | Characters |
|-------------------------------------- |------------|---------------------------------------------------------------------------------------------------------------------------|------------|
| `event_type` *                       | string     | Type of reported event (`baas.automatic_pix.payment_order_attempt.status_change`).                                       | 100        |
| `origin_key` *                       | string     | Unique identifier of the event origin (UUID of the payment order).                                                       | 36         |
| `data` *                             | Object     | Main object containing the payment order attempt details.                                                                | [Data Object](#data-object-payment-order-attempt)                                    |

---

### Data Object (Payment Order Attempt)

| Field                                | Type       | Description                                                                                         | Characters |
|-------------------------------------- |------------|-----------------------------------------------------------------------------------------------------|------------|
| `request_control_key` *               | string     | Unique request control key (UUID of the payment order).                                             | 36         |
| `payment_order_key` *                 | string     | Unique key of the associated payment order (UUID).                                                  | 36         |
| `payment_order_attempt_key` *         | string     | Unique key of the payment attempt (UUID).                                                          | 36         |
| `payment_order_status` *              | string     | Current status of the payment order (`pending`, `accepted`, `cancelled`, etc.).                    | 30         |
| `payment_order_attempt_status` *      | string     | Payment attempt status (`rejected`).                                                               | 30         |
| `transaction_amount` *                | number     | Payment attempt transaction amount.                                                                 | -          |
| `reason` *                            | string     | Reason for attempt rejection (error description based on Bacen code).                              | 200        |
| `outgoing_recurrence_key` *           | string     | Unique identifier of the associated automatic recurrence (UUID).                                    | 36         |

---

### payment_order_attempt_status Enumerators

| Enumerator      | Description                                                         |
|-----------------|---------------------------------------------------------------------|
| `rejected`      | Payment attempt rejected by SPI due to specific error              |

## Webhook for non-liquidated payment order attempt

Webhook intended to notify when a payment order attempt was accepted but was not liquidated within the expected timeframe.

### Webhook Request Body

Request Body: Non-liquidated payment order attempt

```json
{
    "webhook_type": "baas.automatic_pix.payment_order_attempt.not_liquidated",
    "webhook_datetime": "2025-10-22T21:15:00.000Z",
    "data": {
        "payment_order_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
        "payment_order_spi_id": "RR2222222220240429njua7shf40k",
        "outgoing_recurrence_key": "98fc62fd-b0a0-4604-9bea-475e91a9dc82",
        "payment_order_status": "pending",
        "receiver_conciliation_id": "cac0b5f7-4ee2-40f1-b2ad-16902506503d",
        "transaction_amount": "125.53",
        "payment_order_conciliation_batch_key": "21fc62fd-b0a0-4604-9bea-475e91a9dc82",
        "payment_order_attempt_key": "21fc62fd-b0a0-4604-9bea-475e91a9dc83",
        "payment_order_attempt_status": "not_liquidated",
        "due_date": "2025-10-22",
        "end_to_end_id": "E1234567890123456789012"
    }
}
```

### Webhook Body Params

| Field                                | Type      | Description                                                                                                | Max. Characters |
|--------------------------------------|-----------|----------------------------------------------------------------------------------------------------------|-----------------|
| `webhook_type`                       | string    | An enumerator that defines the type of event being reported                                             | 100             |
| `webhook_datetime`                   | string    | Date and time of webhook sending                                                                         | 20              |
| `payment_order_key`                  | uuid4     | Unique identifier of the payment order.                                                                  | 36              |
| `payment_order_spi_id`               | string    | Payment order identifier in the SPI.                                                                     | 50              |
| `outgoing_recurrence_key`            | uuid4     | Unique identifier of the associated outgoing recurrence.                                                  | 36              |
| `payment_order_status`               | string    | Current status of the payment order.                                                                      | [payment_order_status Enumerators](#payment_order_status-enumerators) |
| `receiver_conciliation_id`           | string    | Receiver conciliation identification.                                                                     | 36              |
| `transaction_amount`                 | number    | Payment order transaction amount.                                                                         | -               |
| `payment_order_conciliation_batch_key` | uuid4   | Unique identifier of the associated conciliation batch.                                                   | 36              |
| `payment_order_attempt_key`          | uuid4     | Unique identifier of the payment order attempt.                                                          | 36              |
| `payment_order_attempt_status`       | string    | Status of the payment order attempt.                                                                      | [payment_order_attempt_status Enumerators](#payment_order_attempt_status-enumerators) |
| `due_date`                           | string    | Due date of the payment order attempt (YYYY-MM-DD format).                                               | 10              |
| `end_to_end_id`                      | string    | Idempotency key of a Pix transaction within the SPI.                                                     | 32              |

### payment_order_status Enumerators

| Enumerator            | Description                                        |
|-----------------------|----------------------------------------------------|
| `pending_conciliation`| Awaiting conciliation.                             |
| `pending`             | Pending and awaiting payment.                      |
| `paid`                | Successfully paid.                                 |
| `rejected`            | Rejected and will not be processed.                |
| `cancelled`           | Cancelled before payment.                          |

### payment_order_attempt_status Enumerators

| Enumerator      | Description                                                         |
|-----------------|---------------------------------------------------------------------|
| `sent`          | Payment attempt sent                                                |
| `accepted`      | Payment attempt accepted                                            |
| `rejected`      | Payment attempt rejected by SPI due to specific error              |
| `not_liquidated`| Payment attempt accepted but not liquidated within expected timeframe |

---

# Approve transaction with Two-Factor Authentication

URL: /en/documentation/baas/pix/2fa_v2/aprovar_transacao_pix_2fa

## Request

ENDPOINT /account/ ACCOUNT_KEY /pix_transfer/ PIX_TRANSFER_KEY /validate_token
METHOD PUT

### Path Params

| Field             | Type   | Description                                | Characters |
|-------------------|--------|--------------------------------------------|------------|
| `account_key`     | uuidv4 | Unique account identification key.         | 36         |
| `pix_transfer_key`| uuidv4 | Unique identification key for the pix transaction. | 36         |

Request Body

```json
{
  "token": "329adf"
}
```

### Body Params
| Field    | Type   | Description                                            | Characters |
|----------|--------|--------------------------------------------------------|------------|
| `token` *| string | Authentication code sent to the account's transaction approver | 6          |

## Response

STATUS 201

Response Body: Transfer sent

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "end_to_end_id": "E32402502202405081755SxyT2DDcVwc",
  "pix_transfer_status": "sent",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

STATUS 202

Response Body: Transfer pending

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "end_to_end_id": "E32402502202405081755SxyT2DDcVwc",
  "pix_transfer_status": "pending",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

STATUS 4xx

Response Body: Transfer rejected

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in portuguese",
  "code": "codigo",
  "extra_fields": {
    "pix_transfer_data": {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "end_to_end_id": "E32402502202405081755SxyT2DDcVwc",
      "pix_transfer_status": "rejected",
      "created_at": "2021-10-22T20:30:23.459Z"
    }
  }
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in portuguese",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (ptbr)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Erro de Schema                                                                                                         |
| 404                      | PXT000023            | Outgoing PIX Transfer Not Found                    | Pix transfer key \{pix_transfer_key\} was not found                                                                     | Transferência PIX de saída com chave \{pix_transfer_key\} não foi encontrada                                           |
| 400                      | PXT000175            | Invalid Status                                     | Pix transfer not in pending_2fa_approval status                                                                         | Pix transfer não está pendente de aprovação por two factor authentication                                              |
| 400                      | PXT000182            | Bad Request                                        | The given Pix transfer is tied to a batch. It cannot be individually approved. Please approve batch                     | A Pix transfer enviada está ligada a um lote. Ela não pode ser individualmente aprovada. Por favor aprove o lote       |
| 400                      | PXT000174            | Error Sending Token                                | An error occurred while sending token and its being investigated                                                        | Um erro ocorreu ao enviar token e está sendo investigado                                                               |
| 400                      | PXT000173            | Incorrect Token                                    | Token sent does not match expected                                                                                      | Token enviado não condiz com, o esperado                                                                               |
| 400                      | PXT000172            | Token Expired                                      | Token has expired. Resend token or recreate transfer                                                                    | Token expirado. Reenvie token ou recrie a transferência                                                                | 
| 400                      | PXT000171            | Number of token validation attempts exceeded       | The maximum number of failed token validation attempts has been reached                                                 | Número máximo de tentativas de validação de token atingida                                                             |
| 406                      | PXT000103            | request_control_key must be a valid uuid v4 string | request_control_key was not accepted for not being a valid uuid v4 string                                               | request_control_key não foi aceito por não ser uma palavra uuid v4 válida                                              |
| 400                      | PXT000048            | Bad Request                                        | Emoji not allowed in pix message.                                                                                       | Emoji não é permitido na mensagem pix.                                                                                 |
| 400                      | PXT000104            | Invalid Transaction Amount                         | Transaction amount of \{transaction_amount\} is not valid. It must be a positive value with at maximum 2 decimal places | O valor de transação \{transaction_amount\} não é válido. Deve ser um valor positivo com no máximo duas casas decimais |
| 404                      | PXT000004            | Account not found                                  | Account not found for: \{account_datum\}                                                                                | Conta não encontrada para: \{account_datum\}                                                                           |
| 400                      | PXT000003            | Account is Closed                                  | Account \{account_key\} is closed.                                                                                      | Conta \{account_key\} está fechada.                                                                                    |
| 422                      | PXT000092            | Invalid Account Type                               | Pix is not yet implemented for non-checking or non-escrow account types                                                 | Transações Pix não estão implementadas para conta que não sejam escrow ou livres                                       |
| 403                      | PIT000001            | User is not allowed to do this transaction         |                                                                                                                         | Usuário não tem autorização para fazer essa transação                                                                  |
| 400                      | PXT000010            | Account is Blocked                                 | Account \{account_key\} is blocked.                                                                                     | Conta \{account_key\} está bloqueada.                                                                                  |
| 400                      | PXT000003            | Account is Closed                                  | Account \{account_key\} is closed.                                                                                      | Conta \{account_key\} está fechada.                                                                                    |
| 400                      | PIT000003            | Bad Request                                        | Insufficient account balance for transfer and fee amount.                                                               | Saldo de conta insuficiente para a transferência e a taxa.                                                             |
| 400                      | PXT000118            | Requester is not Pix Participant                   | The requester sent an alias key but is not a indirect pix participant                                                   | O requisitante enviou uma alias key no entanto não é um participante do pix indireto                                   |
| 404                      | PXT000120            | Alias sent not found                               | Alias key attached to this account not found                                                                            | Alias key vinculada à conta não encontrada                                                                             |
| 406                      | PXT000105            | Invalid end_to_end_id                              | The end_to_end_id sent \{end_to_end_id\} is not valid.                                                                  | O end_to_end_id enviado \{end_to_end_id\} não é válido.                                                                |
| 400                      | PXT000108            | Bad Request                                        | Billing account closed or blocked                                                                                       | Conta de cobrança encerrada ou bloqueada                                                                               |
| 400                      | PXT000079            | Bad Request                                        | Insufficient billing account balance for fee.                                                                           | Saldo de conta de cobrança insuficiente para a taxa.                                                                   |
| 400                      | PIT000004            | Bad Request                                        | Transaction amount is over limit.                                                                                       | O total da transferência é superior ao limite.                                                                         |
| 404                      | PIX000056            | Not Found                                          | Pix key inquiry not found                                                                                               | Consulta de chave pix não encontrada                                                                                   |
| 404                      | PXT000041            | Not Found                                          | Qr Code not found                                                                                                       | Qr Code não encontrado                                                                                                 |
| 400                      | PXT000053            | Bad Request                                        | QrCode already paid                                                                                                     | Qr Code já Pago                                                                                                        |
| 400                      | PXT000118            | Requester is not Pix Participant                   | The requester sent an alias key but is not a indirect pix participant                                                   | O requisitante enviou uma alias key no entanto não é um participante do pix indireto                                   |
| 404                      | PXT000120            | Alias sent not found                               | Alias key attached to this account not found                                                                            | Alias key vinculada à conta não encontrada                                                                             |
| 400                      | PXT000115            | Bad Request                                        | Insufficient account balance for transfer and fee amount.                                                               | Saldo de conta insuficiente para a transferência e a taxa                                                              |
| 400                      | PXT000128            | Bad Request                                        | Pix key \{pix_key\} sent does match inquiry pix key. Verify if end_to_end_id sent is correct                            | Chave Pix \{pix_key\} enviada não condiz com consulta. Verifique se end_to_end_id enviado está correto                 |
| 400                      | PXT000109            | Bad Request                                        | request_control_key \{request_control_key\} already in use                                                              | request_control_key \{request_control_key\} já utilizada                                                               |
| 400                      | PXT000061            | Bad Request                                        | End to end id invalid. A pix transfer with the end to end id \{end_to_end\} has already been registered!                | End to end id inválido. Uma transação pix com o identificador único \{end_to_end\} já foi registrada!                  |
| 400                      | PXT000129            | SPI Error message                                  | Message rejected by SPI-ICOM                                                                                            | Mensagem rejeitada pela SPI-ICOM                                                                                       |
| 408                      | PXT000130            | SPI Timeout Control                                | SPI Timeout Control                                                                                                     | Controle de timeout no SPI                                                                                             |
| 400                      | PXT000131            | Receiver Internal Error                            | Cancelled transaction due to receiver's internal error                                                                  | Transação interrompida devido a erro no PSP do Recebedor                                                               |
| 400                      | PXT000132            | Invalid Target Account Number                      | Target account number is invalid                                                                                        | Número da conta de destino é inexistente ou inválido                                                                   |
| 400                      | PXT000133            | Blocked Target Account                             | Target account is blocked.                                                                                              | A conta de destino encontra-se bloqueada.                                                                              |
| 400                      | PXT000134            | Closed Target Account                              | Target account is closed.                                                                                               | A conta de destino encontra-se encerrada.                                                                              |
| 400                      | PXT000135            | Unsupported Transaction                            | Unsupported transaction for given target account.                                                                       | A conta de destino não suporta este tipo de transação.                                                                 |
| 400                      | PXT000136            | Invalid Participant                                | SPI participant is not PSP settler agent of payer nor receiver.                                                         | Participante direto do SPI não é liquidante do PSP do Pagador / Recebedor.                                             |
| 400                      | PXT000137            | Zero Value Payment Order                           | Zero value payment order.                                                                                               | Ordem de pagamento com valor zero.                                                                                     |
| 400                      | PXT000138            | Insufficient Funds                                 | Insufficient funds in PI account from payer.                                                                            | Saldo insuficiente na conta PI do pagador.                                                                             |
| 400                      | PXT000139            | Return Value Too Great                             | Return value greater than corresponding payment order.                                                                  | Valor de devolução acima do valor de pagamento correspondente.                                                         |
| 400                      | PXT000140            | Invalid Transactions Number                        | Invalid transactions number.                                                                                            | Quantidade de transações inválida.                                                                                     |
| 400                      | PXT000141            | Unrelated Beneficiary Document Number              | Beneficiary document number is not that of target account owner.                                                        | CPF/CNPJ do usuário recebedor não é compatível com o titular da conta de destino.                                      |
| 400                      | PXT000142            | Invalid Beneficiary Document Number                | Invalid beneficiary document number                                                                                     | CPF/CNPJ da conta de destino está incorreto.                                                                           |
| 400                      | PXT000143            | Incorrect Message Element                          | Incorrect message element.                                                                                              | Elemento da mensagem incorreto.                                                                                        |
| 403                      | PXT000144            | Rejected Payment Order                             | Beneficiary's PSP has rejected payment order.                                                                           | Ordem de pagamento foi rejeitada pelo banco recebedor.                                                                 |
| 403                      | PXT000145            | Unauthorized Payer                                 | Signing participant is unauthorized to make a payment order for paying account.                                         | Participante que assinou a mensagem não é autorizado a realizar a operação na conta PI debitada.                       |
| 400                      | PXT000146            | Invalid Datetime                                   | Invalid datetime for message delivery.                                                                                  | Data e Hora do envio da mensagem inválida.                                                                             |
| 400                      | PXT000147            | Generic Error                                      | Error while processing payment (generic error).                                                                         | Erro no processamento do pagamento (erro genérico).                                                                    |
| 400                      | PXT000148            | Bad Format Operation Identifier                    | Badly formatted operation's identifier.                                                                                 | Identificador da operação mal formatado.                                                                               |
| 400                      | PXT000149            | Invalid Payer ISPB                                 | Invalid or non-existent payer's PSP ISPB number.                                                                        | Número ISPB do PSP do Pagador é inválido ou inexistente.                                                               |
| 400                      | PXT000150            | Invalid Beneficiary ISPB                           | Invalid or non-existent beneficiary's PSP ISPB number.                                                                  | Número ISPB do banco recebedor é inválido ou inexistente.                                                              |
| 400                      | PXT000151            | Incorrect Type                                     | Incorrect type for target account.                                                                                      | Tipo incorreto para a conta transacional especificada.                                                                 |
| 400                      | PXT000152            | Repeated End-to-End ID Error                       | The end_to_end_id was already used                                                                                      | O end_to_end_id já foi utilizado                                                                                       |
| 400                      | PXT000153            | Invalid Target Account Type                        | The target account type cannot receive PIX transactions                                                                 | O tipo de conta destino não pode receber transações PIX                                                                |
| 400                      | PXT000154            | Invalid ISPB                                       | Invalid or non-existent ISPB number.                                                                                    | Número ISPB é inválido ou inexistente.                                                                                 |
| 400                      | PXT000155            | Amount too Great                                   | Amount too great for credited account.                                                                                  | Valor de pagamento/devolução acima do permitido para a conta de destino creditada.                                     |
| 400                      | PXT000156            | QR Code Rejected                                   | QR Code rejected by beneficiary's PSP.                                                                                  | QR Code rejeitado pelo PSP do usuário recebedor.                                                                       |
| 503                      | PXT000157            | Bacen Service Unavailable Error                    | Could not send the message to ICOM after 3 retries                                                                      | Não pode enviar a mensagem para a ICOM depois de 3 tentativas                                                          |
| 400                      | PXT000158            | Invalid Amount                                     | Paid amount diverges from expected amount of \{expected_amount\}                                                        | O valor do pagamento diverge do valor esperado de \{expected_amount\}                                                  |
| 400                      | PXT000159            | QR code inactive                                   | QR code is not active at the time of payment                                                                            | QR code não está ativo no instante do pagamento                                                                        |

---

# Introduction to Two-Factor Authentication

URL: /en/documentation/baas/pix/2fa_v2/introducao_a_transacao_pix_2fa

In this type of transaction, payment confirmation via a token sent to the person with approval powers for movements in the creditor account is required.
The request for a Pix transaction by integrator partners configured to use two-factor authentication is made similarly to what is described in [perform a Pix transaction](/documentation/baas_v2/pix/realizar_transferencia). The difference is the addition of the `tfa_info` object, containing information about the transfer approver and the means of contact, and the status of a successful request, which will always be **pending_2fa_approval**. The same applies to batch Pix transactions described in [perform batch Pix transaction](/documentation/baas_v2/pix/batch/solicitacao_de_transacao_em_lote_pix).

## Flow for a Pix Transaction with Authorization
A successful Pix transaction will follow the following process flow:
Perform the [Pix transaction request](/documentation/baas_v2/pix/2fa_v2/solicitacao_de_transacao_pix_2fa) and receive a synchronous response with status **pending_2fa_approval** and value of `pix_transfer_key`.
The indicated approver will receive a 6-digit `token` consisting of letters and digits.
The requester performs the [Pix transaction confirmation](/documentation/baas_v2/pix/2fa_v2/aprovar_transacao_pix_2fa) with the `pix_transfer_key` and the `token`.
The transfer will be completed synchronously or asynchronously, depending on the integrator partner's configuration.

## Observations
Each transaction has a maximum limit of 5 validation attempts for the `token`. When this limit is reached, the transaction will be automatically set to rejected (**rejected**) status.
Each `token` has a maximum duration of 5 minutes.
A transaction can have its `token` renewed and resent to the transfer approver. This process resets the 5-minute time but does not reset the invalid attempt counter. The previous `token` becomes invalid.
Once the transaction is approved, it will be completed in synchronous or asynchronous mode, depending on the integrator partner's configuration.
The notification event for sending the `token` to the approver is **baas.token_validation.pix_transfer.single**. It is possible to [customize](/documentation/notificacoes/template) the sent message.
The implemented `contact_type` for sending tokens are **sms** and **email**.

---

# Request the return of a received Pix

URL: /en/documentation/baas/pix/2fa_v2/solicitacao_de_devolucao_pix

A Pix refund can be made up to 90 days from its receipt.

## Request

ENDPOINT /account/ ACCOUNT_KEY /pix_transfer/ PIX_TRANSFER_KEY /reversal
METHOD POST

### Path Params
| Field                | Type   | Description                                                        | Characters |
|----------------------|--------|--------------------------------------------------------------------|------------|
| `account_key` *      | uuidv4 | Unique account identification key.                                 | 36         |
| `pix_transfer_key` * | uuidv4 | Unique identification key for the Pix transfer in the QI system.   | 36         |

Request Body

```json
{
  "request_control_key": "303393bf-8f2e-4ff0-b326-ee7ad612e8ca",
  "reversal_amount": 147,
  "reversal_reason": "client_request",
  "reversal_message": "Mensagem Pix da Devolução",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  }
}
```

### Request Params
| Field                 | Type   | Description                                                       | Characters                                 |
|-----------------------|--------|-------------------------------------------------------------------|--------------------------------------------|
| `request_control_key` * | uuidv4   | Uniqueness key for the request.                                    | 36                                         |
| `reversal_amount` *   | number | Refund amount.                                                    | 11                                         |
| `reversal_reason` *   | string | Reason for the refund.                                            | **[Enumerator reversal_reason](#enumerator-reversal_reason)** |
| `reversal_message`    | string | Refund message.                                                   | 140                                        |
| `tfa_info` *          | Object | Object containing the document of the account approver and the means of contact.   | **[Object tfa_info](#object-tfa_info)**    |

### Enumerator reversal_reason
| Enumerator        | Description                                          |
|-------------------|------------------------------------------------------|
| **client_request**| If requested by the account owner.                  |
| **reconciliation**| For reconciliation due to operational error.        |

### Object tfa_info
| Field                      | Type   | Description                                                                    | Characters |
|----------------------------|--------|--------------------------------------------------------------------------------|------------|
| `approver_document_number` * | string | Document number of the account approver.                                        | 11         |
| `contact_type` *           | string | Means of contact with the account approver, can be **sms** or **email**         |            |

## Response

STATUS 202

Response Body: Reversal Requested

```json
{
  "reversal_status": "pending_2fa_approval",
  "end_to_end_id": "E32402502202405081755SxyT2DDcVwc",
  "pix_transfer_key": "cdcf0d25-08a1-46e3-902a-6d7ca75e6c48",
  "request_control_key": "7c5a1425-73eb-420e-b4fb-0ce3386c7d0c",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

### Response Body
| Field                | Type      | Description                                               | Characters                               |
|----------------------|-----------|-----------------------------------------------------------|------------------------------------------|
| `reversal_status`    | enumerator| Enumerator for the reversal transaction status.            | [Enumerator reversal_status](#enumerator-reversal_status) |
| `transfer_amount`    | number    | Amount of the reversal transfer.                           | 11                                       |
| `pix_transfer_key`   | uuidv4    | Key of the executed pix transaction for the reversal.      | 36                                       |
| `request_control_key`| uuidv4    | Unique identification key for the request used by the client. | 36                                       |
| `created_at`         | string    | Date and time of the reversal.                             | 10                                       |

### Enumerator reversal_status
| Enumerator                   | Description                                            |
|------------------------------|--------------------------------------------------------|
| **sent**                     | Pix transfer successfully executed.                    |
| **pending**                  | Pix transfer pending.                                  |
| **pending_2fa_approval**     | Pix transfer pending two-factor approval.              |
| **rejected**                 | Pix transfer rejected.                                 |

STATUS 4xx

Response Body: Reversão Rejeitada

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in portuguese",
  "code": "codigo",
  "extra_fields": {
    "pix_transfer_data": {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "end_to_end_id": "E32402502202405081755SxyT2DDcVwc",
      "pix_transfer_status": "rejected",
      "created_at": "2021-10-22T20:30:23.459Z"
    }
  }
}
```

:::info Information
In addition to the errors previously listed for [Pix transfer](/documentation/baas_v2/pix/realizar_transferencia), a Pix refund can also return the errors listed below.
:::

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                   | Description (eng)<br/>`description`                                      | Description (ptbr)<br/>`translation`                                                        |
|--------------------------|----------------------|--------------------------------------|------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                          | Schema Error                                                           | Erro de Schema                                                                            |
| 404                      | PXT000018            | Reversal Original Transfer not Found | Reversal original pix transfer not found.                              | Transferência original da devolução não foi encontrada.                                   |
| 400                      | PXT000017            | Reversal Too Great                   | Reversal transfers sum amount surpasses that of original pix transfer. | A soma das transferências de devolução ultrapassam o valor da transferência pix original. |
| 400                      | PXT000015            | Reversal date expired                | Reversal original transaction is older than 90 days                    | A data de criação da transação original é mais antiga que 90 dias                         |
| 400                      | PXT0000127           | Invalid Reversal Reason              | Reversal reason \{reversal_reason\} is not valid                       | Razão de reversão \{reversal_reason\} não é válida                                        |

---

# Request Token Resend for a Transaction

URL: /en/documentation/baas/pix/2fa_v2/solicitacao_de_reenvio_de_token

A new token will be generated and sent to the pix transaction approver. If the limit number of token validation attempts has been exceeded, the resend will not be allowed.

## Request

ENDPOINT /account/ ACCOUNT_KEY /pix_transfer/ PIX_TRANSFER_KEY /resend_token
METHOD PATCH

### Path Params

| Field                | Type   | Description                                                        | Characters |
|----------------------|--------|--------------------------------------------------------------------|------------|
| `account_key` *      | uuidv4 | Unique account identification key.                                 | 36         |
| `pix_transfer_key` * | uuidv4 | Unique identification key for the Pix transfer in the QI system.   | 36         |

## Response

STATUS 202

Response Body: Transaction Requested

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "end_to_end_id": "E32402502202405081755SxyT2DDcVwc",
  "pix_transfer_status": "pending_2fa_approval",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

STATUS 4xx

Response Body: Transfer rejected

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {
    "pix_transfer_data": {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "pix_transfer_status": "rejected",
      "created_at": "2021-10-22T20:30:23.459Z"
    }
  }
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                           | Description (eng)<br/>`description`                                       | Description (ptbr)<br/>`translation`                                           |
|--------------------------|----------------------|----------------------------------------------|-------------------------------------------------------------------------|------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                  | Schema Error                                                            | Erro de Schema                                                               |
| 404                      | PXT000004            | Account not found                            | Account not found for: \{account_datum\}                                | Conta não encontrada para: \{account_datum\}                                 |
| 404                      | PXT000023            | Outgoing PIX Transfer Not Found              | Pix transfer key \{pix_transfer_key\} was not found                     | Transferência PIX de saída com chave \{pix_transfer_key\} não foi encontrada |
| 400                      | PXT000171            | Number of token validation attempts exceeded | The maximum number of failed token validation attempts has been reached | Número máximo de tentativas de validação de token atingida                   |
| 400                      | PXT000175            | Invalid Status                               | Pix transfer not in pending_2fa_approval status                         | Pix transfer não está pendente de aprovação por two factor authentication    |
| 400                      | PXT000176            | Error Sending Token                          | An error occurred while resending token and its being investigated      | Um erro ocorreu ao reenviar token e está sendo investigado                   |

---

# Request transaction with Two-Factor Authentication

URL: /en/documentation/baas/pix/2fa_v2/solicitacao_de_transacao_pix_2fa

## Request

ENDPOINT /account/ ACCOUNT_KEY /pix_transfer
METHOD POST

### Path Params
| Field          | Type   | Description                               | Characters |
|----------------|--------|-------------------------------------------|------------|
| `account_key`  | uuidv4 | Unique account identification key.        | 36         |

**Key**

Request Body: Pix Key Transfer

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_type": "key",
  "target_pix_key": "target_pix_key@email.com",
  "transaction_amount": 500.65,
  "end_to_end_id": "E73856642202309201429bZKfklNlbwu",
  "pix_message": "Ola Mundo",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  }
}
```

### Body Params
| Field                 | Type      | Description                                                                                                             | Characters                                 |
|-----------------------|-----------|-------------------------------------------------------------------------------------------------------------------------|--------------------------------------------|
| `request_control_key` * | uuidv4   | Unique identification key for the request used by the client in uuid v4 format.                                          | 36                                         |
| `pix_transfer_type` * | enumerator| Type of the pix to be performed. For key transfer, it should be **key**.                                                 | **key**                                    |
| `target_pix_key` *    | string    | Pix key of the account to which the transaction will be sent.                                                            | 100                                        |
| `transaction_amount` *| number    | Transfer amount.                                                                                                         | 10                                         |
| `end_to_end_id` *     | string    | Idempotency key for a Pix transaction within the SPI (Instant Payment System). This key is returned in Pix key queries. Should only be sent if `pix_transfer_type` is **key**, **static_qr_code**, or **dynamic_qr_code**. | 32                                         |
| `pix_message`         | string    | Message to be sent along with the Pix transfer.                                                                          | 140                                        |
| `tfa_info` *          | Object    | Object containing the document of the account approver and the means of contact.                                         | **[Object tfa_info](#object-tfa_info)**    |

**Manual**
Request Body: Manual transfer

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_type": "manual",
  "target_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "12345678",
    "owner_document_number": "32402502000135",
    "owner_name": "Qi Tech",
    "account_type": "checking_account",
    "ispb": "32402502"
  },
  "transaction_amount": 500.65,
  "pix_message": "Ola Mundo",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  }
}
```

### Body Params
| Field                 | Type      | Description                                                                                                             | Characters                                 |
|-----------------------|-----------|-------------------------------------------------------------------------------------------------------------------------|--------------------------------------------|
| `request_control_key` * | uuidv4   | Unique identification key for the request used by the client in uuid v4 format.                                          | 36                                         |
| `pix_transfer_type` * | enumerator| Type of Pix transfer.                                                                                                    | **manual**                                 |
| `target_account` *    | Object    | Destination account - Should only be sent for transfers with `pix_transfer_type` of type **manual**.                        | **[Object target_account](#object-target_account)** |
| `transaction_amount` *| number    | Transfer amount.                                                                                                         | 10                                         |
| `pix_message`         | string    | Message to be sent along with the Pix transfer.                                                                          | 140                                        |
| `tfa_info` *          | Object    | Object containing the document of the account approver and the means of contact.                                         | **[Object tfa_info](#object-tfa_info)**    |

### Object target_account
| Field                   | Type      | Description                                                                                                             | Characters                                 |
|-------------------------|-----------|-------------------------------------------------------------------------------------------------------------------------|--------------------------------------------|
| `account_branch` *      | string    | Account branch.                                                                                                          | 6                                          |
| `account_digit` *       | string    | Account digit.                                                                                                           | 1                                          |
| `account_number` *      | string    | Account number.                                                                                                          | 20                                         |
| `owner_document_number` * | string | CPF or CNPJ (numbers only) of the account holder.                                                                        | 14                                         |
| `owner_name` *          | string    | Name of the account holder.                                                                                              | 150                                        |
| `account_type` *        | enumerator| Account type.                                                                                                            | **[Enumerator account_type](#enumerator-account_type)** |
| `ispb` *                | string    | Based on the CNPJ of the financial institution (8 digits).                                                             | 8                                          |

### Enumerator account_type
| Enumerator             | Description               |
|-----------------------|----------------------------|
| **checking_account**  | Checking Account           |
| **salary_account**    | Salary Account             |
| **saving_account**    | Savings Account            |
| **payment_account**   | Payment Account            |

**Qr Code**

Request Body: QR Code transfer

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_type": "static_qr_code",
  "transaction_amount": 500.65,
  "end_to_end_id": "E73856642202309201429bZKfklNlbwu",
  "receiver_conciliation_id": "REC00000000000000000000009459463343",
  "target_pix_key": "target_pix_key@email.com",
  "pix_message": "Ola Mundo",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  }
}
```

### Body Params
| Field                    | Type      | Description                                                                                                             | Characters                                   |
|--------------------------|-----------|-------------------------------------------------------------------------------------------------------------------------|----------------------------------------------|
| `request_control_key` *  | uuidv4    | Unique identification key for the request used by the client in uuid v4 format.                                          | 36                                           |
| `pix_transfer_type` *    | enumerator| Type of Pix transfer.                                                                                                    | **static_qr_code** or **dynamic_qr_code**    |
| `target_pix_key` *       | string    | Pix key of the account to which the transaction will be sent.                                                            | 100                                          |
| `receiver_conciliation_id` | string  | Reconciliation ID of the receiver.                                                                                       | 35                                           |
| `transaction_amount` *   | number    | Transfer amount.                                                                                                         | 10                                           |
| `end_to_end_id` *        | string    | Idempotency key for a Pix transaction within the SPI (Instant Payment System). This key is returned in Pix key queries. Should only be sent if `pix_transfer_type` is **key**, **static_qr_code**, or **dynamic_qr_code**. | 32                                           |
| `pix_message`            | string    | Message to be sent along with the Pix transfer.                                                                          | 140                                          |
| `tfa_info` *             | Object    | Object containing the document of the account approver and the means of contact.                                         | **[Object tfa_info](#object-tfa_info)**      |

:::info Warning
The `end_to_end_id` is returned when [decoding the Pix QR Code](/documentation/pix/decodificar_qr_code), using the Pix Copy and Paste URI.
:::

### Object tfa_info
| Field                      | Type   | Description                                                                    | Characters |
|----------------------------|--------|--------------------------------------------------------------------------------|------------|
| `approver_document_number` * | string | Document number of the account approver.                                        | 11         |
| `contact_type` *           | string | Means of contact with the account approver, can be **sms** or **email**         |            |

:::danger Warning
The `end_to_end_id` from the query must have been made in the name of the account that will request the transaction!
:::
:::danger Warning
An `end_to_end_id` can only be used for a single transfer, regardless of whether the transfer was successful or not.
:::

## Response

STATUS 202

Response Body: Transaction Requested

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "end_to_end_id": "E32402502202405081755SxyT2DDcVwc",
  "pix_transfer_status": "pending_2fa_approval",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

STATUS 4xx

Response Body: Transfer Rejected

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in portuguese",
  "code": "codigo",
  "extra_fields": {
    "pix_transfer_data": {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "end_to_end_id": "E32402502202405081755SxyT2DDcVwc",
      "pix_transfer_status": "rejected",
      "created_at": "2021-10-22T20:30:23.459Z"
    }
  }
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in portuguese",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (ptbr)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Erro de Schema                                                                                                         |
| 400                      | PXT000168            | No approver permission                             | Given document number does not belong to an approver for this account                                                   | Número de documento enviado não pertence a um aprovador da conta                                                       |
| 400                      | PXT000169            | tfa_info is required                               | Client must send object tfa_info                                                                                        | Cliente deve enviar objeto tfa_info                                                                                    |
| 400                      | PXT000170            | Error occurred while sending token                 | An unexpected error occurred while sending token                                                                        | Um erro inexperado ocorreu ao tentar enviar token                                                                      |
| 406                      | PXT000103            | request_control_key must be a valid uuid v4 string | request_control_key was not accepted for not being a valid uuid v4 string                                               | request_control_key não foi aceito por não ser uma palavra uuid v4 válida                                              |
| 400                      | PXT000048            | Bad Request                                        | Emoji not allowed in pix message.                                                                                       | Emoji não é permitido na mensagem pix.                                                                                 |
| 400                      | PXT000104            | Invalid Transaction Amount                         | Transaction amount of \{transaction_amount\} is not valid. It must be a positive value with at maximum 2 decimal places | O valor de transação \{transaction_amount\} não é válido. Deve ser um valor positivo com no máximo duas casas decimais |
| 404                      | PXT000004            | Account not found                                  | Account not found for: \{account_datum\}                                                                                | Conta não encontrada para: \{account_datum\}                                                                           |
| 400                      | PXT000003            | Account is Closed                                  | Account \{account_key\} is closed.                                                                                      | Conta \{account_key\} está fechada.                                                                                    |
| 422                      | PXT000092            | Invalid Account Type                               | Pix is not yet implemented for non-checking or non-escrow account types                                                 | Transações Pix não estão implementadas para conta que não sejam escrow ou livres                                       |
| 403                      | PIT000001            | User is not allowed to do this transaction         |                                                                                                                         | Usuário não tem autorização para fazer essa transação                                                                  |
| 400                      | PXT000010            | Account is Blocked                                 | Account \{account_key\} is blocked.                                                                                     | Conta \{account_key\} está bloqueada.                                                                                  |
| 400                      | PXT000003            | Account is Closed                                  | Account \{account_key\} is closed.                                                                                      | Conta \{account_key\} está fechada.                                                                                    |
| 400                      | PIT000003            | Bad Request                                        | Insufficient account balance for transfer and fee amount.                                                               | Saldo de conta insuficiente para a transferência e a taxa.                                                             |
| 400                      | PXT000118            | Requester is not Pix Participant                   | The requester sent an alias key but is not a indirect pix participant                                                   | O requisitante enviou uma alias key no entanto não é um participante do pix indireto                                   |
| 404                      | PXT000120            | Alias sent not found                               | Alias key attached to this account not found                                                                            | Alias key vinculada à conta não encontrada                                                                             |
| 406                      | PXT000105            | Invalid end_to_end_id                              | The end_to_end_id sent \{end_to_end_id\} is not valid.                                                                  | O end_to_end_id enviado \{end_to_end_id\} não é válido.                                                                |
| 400                      | PXT000108            | Bad Request                                        | Billing account closed or blocked                                                                                       | Conta de cobrança encerrada ou bloqueada                                                                               |
| 400                      | PXT000079            | Bad Request                                        | Insufficient billing account balance for fee.                                                                           | Saldo de conta de cobrança insuficiente para a taxa.                                                                   |
| 400                      | PIT000004            | Bad Request                                        | Transaction amount is over limit.                                                                                       | O total da transferência é superior ao limite.                                                                         |
| 404                      | PIX000056            | Not Found                                          | Pix key inquiry not found                                                                                               | Consulta de chave pix não encontrada                                                                                   |
| 404                      | PXT000041            | Not Found                                          | Qr Code not found                                                                                                       | Qr Code não encontrado                                                                                                 |
| 400                      | PXT000053            | Bad Request                                        | QrCode already paid                                                                                                     | Qr Code já Pago                                                                                                        |
| 400                      | PXT000118            | Requester is not Pix Participant                   | The requester sent an alias key but is not a indirect pix participant                                                   | O requisitante enviou uma alias key no entanto não é um participante do pix indireto                                   |
| 404                      | PXT000120            | Alias sent not found                               | Alias key attached to this account not found                                                                            | Alias key vinculada à conta não encontrada                                                                             |
| 400                      | PXT000115            | Bad Request                                        | Insufficient account balance for transfer and fee amount.                                                               | Saldo de conta insuficiente para a transferência e a taxa                                                              |
| 400                      | PXT000128            | Bad Request                                        | Pix key \{pix_key\} sent does match inquiry pix key. Verify if end_to_end_id sent is correct                            | Chave Pix \{pix_key\} enviada não condiz com consulta. Verifique se end_to_end_id enviado está correto                 |
| 400                      | PXT000109            | Bad Request                                        | request_control_key \{request_control_key\} already in use                                                              | request_control_key \{request_control_key\} já utilizada                                                               |
| 400                      | PXT000061            | Bad Request                                        | End to end id invalid. A pix transfer with the end to end id \{end_to_end\} has already been registered!                | End to end id inválido. Uma transação pix com o identificador único \{end_to_end\} já foi registrada!                  |
| 400                      | PXT000129            | SPI Error message                                  | Message rejected by SPI-ICOM                                                                                            | Mensagem rejeitada pela SPI-ICOM                                                                                       |
| 408                      | PXT000130            | SPI Timeout Control                                | SPI Timeout Control                                                                                                     | Controle de timeout no SPI                                                                                             |
| 400                      | PXT000131            | Receiver Internal Error                            | Cancelled transaction due to receiver's internal error                                                                  | Transação interrompida devido a erro no PSP do Recebedor                                                               |
| 400                      | PXT000132            | Invalid Target Account Number                      | Target account number is invalid                                                                                        | Número da conta de destino é inexistente ou inválido                                                                   |
| 400                      | PXT000133            | Blocked Target Account                             | Target account is blocked.                                                                                              | A conta de destino encontra-se bloqueada.                                                                              |
| 400                      | PXT000134            | Closed Target Account                              | Target account is closed.                                                                                               | A conta de destino encontra-se encerrada.                                                                              |
| 400                      | PXT000135            | Unsupported Transaction                            | Unsupported transaction for given target account.                                                                       | A conta de destino não suporta este tipo de transação.                                                                 |
| 400                      | PXT000136            | Invalid Participant                                | SPI participant is not PSP settler agent of payer nor receiver.                                                         | Participante direto do SPI não é liquidante do PSP do Pagador / Recebedor.                                             |
| 400                      | PXT000137            | Zero Value Payment Order                           | Zero value payment order.                                                                                               | Ordem de pagamento com valor zero.                                                                                     |
| 400                      | PXT000138            | Insufficient Funds                                 | Insufficient funds in PI account from payer.                                                                            | Saldo insuficiente na conta PI do pagador.                                                                             |
| 400                      | PXT000139            | Return Value Too Great                             | Return value greater than corresponding payment order.                                                                  | Valor de devolução acima do valor de pagamento correspondente.                                                         |
| 400                      | PXT000140            | Invalid Transactions Number                        | Invalid transactions number.                                                                                            | Quantidade de transações inválida.                                                                                     |
| 400                      | PXT000141            | Unrelated Beneficiary Document Number              | Beneficiary document number is not that of target account owner.                                                        | CPF/CNPJ do usuário recebedor não é compatível com o titular da conta de destino.                                      |
| 400                      | PXT000142            | Invalid Beneficiary Document Number                | Invalid beneficiary document number                                                                                     | CPF/CNPJ da conta de destino está incorreto.                                                                           |
| 400                      | PXT000143            | Incorrect Message Element                          | Incorrect message element.                                                                                              | Elemento da mensagem incorreto.                                                                                        |
| 403                      | PXT000144            | Rejected Payment Order                             | Beneficiary's PSP has rejected payment order.                                                                           | Ordem de pagamento foi rejeitada pelo banco recebedor.                                                                 |
| 403                      | PXT000145            | Unauthorized Payer                                 | Signing participant is unauthorized to make a payment order for paying account.                                         | Participante que assinou a mensagem não é autorizado a realizar a operação na conta PI debitada.                       |
| 400                      | PXT000146            | Invalid Datetime                                   | Invalid datetime for message delivery.                                                                                  | Data e Hora do envio da mensagem inválida.                                                                             |
| 400                      | PXT000147            | Generic Error                                      | Error while processing payment (generic error).                                                                         | Erro no processamento do pagamento (erro genérico).                                                                    |
| 400                      | PXT000148            | Bad Format Operation Identifier                    | Badly formatted operation's identifier.                                                                                 | Identificador da operação mal formatado.                                                                               |
| 400                      | PXT000149            | Invalid Payer ISPB                                 | Invalid or non-existent payer's PSP ISPB number.                                                                        | Número ISPB do PSP do Pagador é inválido ou inexistente.                                                               |
| 400                      | PXT000150            | Invalid Beneficiary ISPB                           | Invalid or non-existent beneficiary's PSP ISPB number.                                                                  | Número ISPB do banco recebedor é inválido ou inexistente.                                                              |
| 400                      | PXT000151            | Incorrect Type                                     | Incorrect type for target account.                                                                                      | Tipo incorreto para a conta transacional especificada.                                                                 |
| 400                      | PXT000152            | Repeated End-to-End ID Error                       | The end_to_end_id was already used                                                                                      | O end_to_end_id já foi utilizado                                                                                       |
| 400                      | PXT000153            | Invalid Target Account Type                        | The target account type cannot receive PIX transactions                                                                 | O tipo de conta destino não pode receber transações PIX                                                                |
| 400                      | PXT000154            | Invalid ISPB                                       | Invalid or non-existent ISPB number.                                                                                    | Número ISPB é inválido ou inexistente.                                                                                 |
| 400                      | PXT000155            | Amount too Great                                   | Amount too great for credited account.                                                                                  | Valor de pagamento/devolução acima do permitido para a conta de destino creditada.                                     |
| 400                      | PXT000156            | QR Code Rejected                                   | QR Code rejected by beneficiary's PSP.                                                                                  | QR Code rejeitado pelo PSP do usuário recebedor.                                                                       |
| 503                      | PXT000157            | Bacen Service Unavailable Error                    | Could not send the message to ICOM after 3 retries                                                                      | Não pode enviar a mensagem para a ICOM depois de 3 tentativas                                                          |
| 400                      | PXT000158            | Invalid Amount                                     | Paid amount diverges from expected amount of \{expected_amount\}                                                        | O valor do pagamento diverge do valor esperado de \{expected_amount\}                                                  |
| 400                      | PXT000159            | QR code inactive                                   | QR code is not active at the time of payment                                                                            | QR code não está ativo no instante do pagamento                                                                        |

---

# aprovacao_de_agendamento_2fa

URL: /en/documentation/baas/pix/agendamento/aprovacao_de_agendamento_2fa



---

# aprovacao_de_agendamento_em_lote_2fa

URL: /en/documentation/baas/pix/agendamento/batch/aprovacao_de_agendamento_em_lote_2fa



---

# Cancel batch Pix transaction scheduling

URL: /en/documentation/baas/pix/agendamento/batch/cancelamento_de_agendamento_em_lote

## Request

ENDPOINT /account/ ACCOUNT_KEY /pix_schedule_batch/ SCHEDULE_BATCH_KEY /cancel
METHOD PATCH

### Path Params

| Field                | Type   | Description                                         | Characters |
|----------------------|--------|-----------------------------------------------------|------------|
| `account_key`        | uuidv4 | Unique account identification key.                  | 36         |
| `schedule_batch_key` | uuidv4 | Unique batch schedule identification key.           | 36         |

### Response

STATUS 200

Response Body: Schedule Cancelled

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "schedule_batch_key": "f64b3fa7-d09d-4927-ad4f-b966df9fb153",
  "schedule_batch_status": "cancelled",
  "created_at": "2023-03-13T19:00:28.440Z"
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in portuguese",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                  | Description (eng)<br/>`description`                                                                                                    | Description (ptbr)<br/>`translation`                                                                                                          |
|--------------------------|----------------------|-----------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                         | schema error description                                                                                                             | Schema Inválido                                                                                                                             |
| 404                      | PSC000001            | Account not Found                                   | Account was not found                                                                                                                | Conta não encontrada                                                                                                                        |
| 403                      | PSC000012            | User is not allowed to do this transaction          | User is not allowed to do this transaction                                                                                           | Usuário não tem autorização para fazer essa transação                                                                                       |
| 404                      | PSC000025            | PixSchedule not Found                               | PixSchedule was not found                                                                                                            | PixSchedule não encontrada                                                                                                                  |
| 400                      | PSC000027            | Bad Request                                         | Action cannot be taken place as there is currently a pending transfer in progress                                                    | A ação não pôde ser completada como há uma transferência pendente                                                                           |
| 404                      | PSC000042            | Schedule Batch not Found                            | ScheduleBatch was not found                                                                                                          | ScheduleBatch não encontrada                                                                                                                |
| 400                      | PSC000043            | Schedule Batch could not be canceled                | ScheduleBatch could not be canceled due to current date being equal or after earliest schedule date. Cancel pix_schedules one by one | ScheduleBatch não pode ser cancelada devido a data atual ser superior ou igual à menor schedule_date. Cancele pix_schedules individualmente |
| 400                      | PSC000044            | Bad Request                                         | Schedule Batch cannot be cancelled in current status                                                                                 | Agendamento pix não pode ser cancelado no status atual                                                                                      |

---

# List Schedules of a Batch Schedule

URL: /en/documentation/baas/pix/agendamento/batch/consulta_de_agendamentos_de_um_lote

## Request

ENDPOINT /account/ ACCOUNT_KEY /pix_schedule_batch/ SCHEDULE_BATCH_KEY /pix_schedules
METHOD GET

### Path Params
| Field              | Type   | Description                                            | Characters |
|--------------------|--------|--------------------------------------------------------|------------|
| `account_key`      | uuidv4 | Unique account identification key.                     | 36         |
| `schedule_batch_key` | uuidv4 | Unique batch schedule identification key.              | 36         |

### Query Params
| Field                | Type    | Description                                                         | Characters                   |
|----------------------|---------|---------------------------------------------------------------------|------------------------------|
| `request_control_key`| uuidv4  | Unique identification key for the request used by the client.        | 36                           |
| `schedule_status`    | string  | Schedule status. Can be sent as a list.                              | **[Enumerator schedule_status](#enumerator-schedule_status)** |
| `page`               | integer | Requested page number. 1 by default.                                 |                              |
| `page_size`          | integer | Size of the requested page in the query. 30 by default and max value | Maximum value of 30          |

### Enumerator schedule_status
| Enumerator                 | Description                                                                                        |
|----------------------------|----------------------------------------------------------------------------------------------------|
| **scheduled**              | Scheduled transaction                                                                              |
| **sent**                   | Schedule completed and successfully sent. Final status.                                            |
| **rejected**               | Schedule rejected during creation or execution. Final status.                                      |
| **cancelled**              | Schedule canceled by customer request. Final status.                                               |
| **pending_2fa_approval**   | Pending two-factor authentication approval.                                                        |
| **pending_creation**       | Schedule in the process of creation (Transitional state for batch scheduling).                     |
| **waiting_batch_approval** | Schedule created and linked to a batch awaiting two-factor authentication approval.               |

### Response

STATUS 200

Response Body

```json
{
  "data": [
    {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "schedule_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "schedule_status": "scheduled",
      "schedule_date": "2024-12-31",
      "created_at": "2023-03-13T19:00:28.440Z"
    },
    {
      "request_control_key": "bf6b0a4b-c7a5-446b-9dad-1ae10b25342a",
      "schedule_key": "2479a5cd-079e-4d72-bf4e-16a695bda45e",
      "schedule_status": "cancelled",
      "schedule_date": "2024-12-31",
      "created_at": "2023-03-13T19:00:28.440Z"
    },
    {
      "request_control_key": "9d36c03e-2db7-4c90-87ed-6c9ddb3c03c7",
      "schedule_key": "5d6b14b9-053f-408c-bcd7-61ecf9224f2c",
      "schedule_status": "rejected",
      "schedule_date": "2024-12-31",
      "created_at": "2023-03-13T19:00:28.440Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "next_page": null,
    "rows_per_page": 30
  }
}

```

---

# List Scheduled Batches for an Account

URL: /en/documentation/baas/pix/agendamento/batch/consulta_de_agendamentos_em_lote_de_uma_conta

## Request

ENDPOINT /account/ ACCOUNT_KEY /pix_schedule_batches
MÉTODO GET

### Path Params
| Field          | Type   | Description                                   | Characters |
|--------------- |--------|-----------------------------------------------|------------|
| `account_key`  | uuidv4 | Unique account identification key.            | 36         |

### Query Params
| Field                | Type    | Description                                                         | Characters      |
|----------------------|---------|---------------------------------------------------------------------|-----------------|
| `request_control_key`| uuidv4  | Unique identification key for the request used by the client.        | 36              |
| `schedule_batch_status` | string | Schedule batch status. Can be sent as a list.                        | 20              |
| `page`               | integer | Requested page number. 1 by default.                                 |                 |
| `page_size`          | integer | Size of the requested page in the query. 30 by default and max value | Maximum value of 30 |

### Response

STATUS 200

Response Body

```json
{
  "data": [
    {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "schedule_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "schedule_batch_status": "approved",
      "created_at": "2021-10-22T20:30:23.459Z"
    },
    {
      "request_control_key": "bf6b0a4b-c7a5-446b-9dad-1ae10b25342a",
      "schedule_batch_key": "2479a5cd-079e-4d72-bf4e-16a695bda45e",
      "schedule_batch_status": "cancelled",
      "created_at": "2021-10-22T20:30:23.459Z"
    },
    {
      "request_control_key": "9d36c03e-2db7-4c90-87ed-6c9ddb3c03c7",
      "schedule_batch_key": "5d6b14b9-053f-408c-bcd7-61ecf9224f2c",
      "schedule_batch_status": "rejected",
      "created_at": "2021-10-22T20:30:23.459Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "next_page": null,
    "rows_per_page": 30
  }
}

```

# Query Scheduled Batch for an Account

## Request

ENDPOINT /account/ ACCOUNT_KEY /pix_schedule_batch/ SCHEDULE_BATCH_KEY
MÉTODO GET

### Path Params
| Field              | Type   | Description                                            | Characters |
|------------------- |--------|--------------------------------------------------------|------------|
| `account_key`      | uuidv4 | Unique account identification key.                     | 36         |
| `schedule_batch_key` | uuidv4 | Unique batch schedule identification key.              | 36         |
### Response

STATUS 200

Response Body

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "schedule_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "schedule_batch_status": "approved",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

---

# Request batch Pix transaction scheduling

URL: /en/documentation/baas/pix/agendamento/batch/solicitacao_de_agendamento_em_lote

QI Tech offers the possibility to perform multiple scheduled pix transactions with a single call. In this system, schedules are made asynchronously. If a **http status 4xx** is returned on the initial call, none of the schedules will be executed. After the request, the integrator partner will receive a webhook for each **pix_schedule** rejected at the time of creation.

## Request

ENDPOINT /account/ ACCOUNT_KEY /pix_schedule_batch
METHOD POST

```json
{
  "request_control_key": "6e4fc980-f8a1-4462-b6e2-d8a49f0ac055",
  "pix_schedules": [
    {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "pix_transfer_type": "key",
      "target_pix_key": "target_pix_key@email.com",
      "transaction_amount": 500.65,
      "end_to_end_id": "E73856642202309201429bZKfklNlbwu",
      "pix_message": "Ola Mundo",
      "schedule_date": "2024-12-01"
    },
    {
      "request_control_key": "c6804f35-101e-4702-8fbc-c2dbc4c2caea",
      "pix_transfer_type": "manual",
      "target_account": {
        "account_branch": "0001",
        "account_digit": "3",
        "account_number": "12345678",
        "owner_document_number": "32402502000135",
        "owner_name": "Qi Tech",
        "account_type": "checking_account",
        "ispb": "32402502"
      },
      "transaction_amount": 500.65,
      "pix_message": "Ola Mundo",
      "schedule_date": "2024-12-01"
    },
    {
      "request_control_key": "a6804f42-101e-4702-8fbc-c2dbc4c2caed",
      "pix_transfer_type": "static_qr_code",
      "transaction_amount": 500.65,
      "end_to_end_id": "E73856642202309201429bZKfklNlbwu",
      "receiver_conciliation_id": "REC00000000000000000000009459463343",
      "target_pix_key": "target_pix_key@email.com",
      "pix_message": "Ola Mundo"
    }
  ]
}
```

## Path Params
| Field          | Type   | Description                                   | Characters |
|--------------- |--------|-----------------------------------------------|------------|
| `account_key`  | uuidv4 | Unique account identification key.            | 36         |

### Body Params
| Field                | Type   | Description                                                                           | Characters                                |
|----------------------|--------|---------------------------------------------------------------------------------------|-------------------------------------------|
| `request_control_key` * | uuidv4 | Unique identification key for the request used by the client in uuid v4 format.      | 36                                        |
| `pix_schedules` *    | array  | List of pix_schedule objects linked to the batch.                                      | list of **[Object pix_schedule](#object-pix_schedule)** |

### Object pix_schedule
| Field                | Type      | Description                                                                                                             | Characters                                 |
|----------------------|-----------|-------------------------------------------------------------------------------------------------------------------------|--------------------------------------------|
| `request_control_key` * | uuidv4    | Unique identification key for the request used by the client in uuid v4 format.                                           | 36                                         |
| `pix_transfer_type` * | enumerator| Type of Pix transfer.                                                                                                    | **[Enumerator pix_transfer_type](#enumerator-pix_transfer_type)** |
| `target_pix_key`     | string    | Pix key of the account to which the transaction will be sent.                                                            | 100                                        |
| `receiver_conciliation_id` | string | Reconciliation ID of the receiver.                                                                                       | 35                                         |
| `target_account` *   | Object    | Destination account - Should only be sent for transfers with `pix_transfer_type` of type **manual**.                        | **[Object target_account](#object-target_account)** |
| `transaction_amount` *| number   | Transfer amount.                                                                                                         | 10                                         |
| `end_to_end_id`      | string    | Idempotency key for a Pix transaction within the SPI (Instant Payment System). This key is returned in Pix key queries. Should only be sent if `pix_transfer_type` is **key**, **static_qr_code**, or **dynamic_qr_code**. | 32                                         |
| `pix_message`        | string    | Message to be sent along with the Pix transfer.                                                                          | 140                                        |

### Object target_account
| Field                   | Type      | Description                                                                                                             | Characters                                 |
|-------------------------|-----------|-------------------------------------------------------------------------------------------------------------------------|--------------------------------------------|
| `account_branch` *      | string    | Account branch.                                                                                                        | 6                                          |
| `account_digit` *       | string    | Account digit.                                                                                                         | 1                                          |
| `account_number` *      | string    | Account number.                                                                                                        | 20                                         |
| `owner_document_number` * | string | CPF or CNPJ (numbers only) of the account holder.                                                                      | 14                                         |
| `owner_name` *          | string    | Name of the account holder.                                                                                            | 150                                        |
| `account_type` *        | enumerator| Account type.                                                                                                          | **[Enumerator account_type](#enumerator-account_type)** |
| `ispb` *                | string    | Based on the CNPJ of the financial institution (8 digits).                                                             | 8                                          |

### Enumerator account_type
| Enumerator             | Description               |
|-----------------------|----------------------------|
| **checking_account**  | Checking Account           |
| **salary_account**    | Salary Account             |
| **saving_account**    | Savings Account            |
| **payment_account**   | Payment Account            |

### Enumerator pix_transfer_type
| Enumerator             | Description                                                                          |
|------------------------|--------------------------------------------------------------------------------------|
| **manual**             | Pix using destination account details. Must send `target_account`.                    |
| **key**                | Pix using a pix key. Must send `target_pix_key`. Recommended to send `end_to_end_id` from the [pix key query](/documentation/pix_indireto/movimentacoes/consultar_chave_pix) if previously performed |
| **static_qr_code**     | Pix using a static QR code. Must send the `end_to_end_id` returned in the [QR code decode](/documentation/pix/decodificar_qr_code) |
| **dynamic_qr_code**    | Pix using a dynamic QR code. Must send the `end_to_end_id` returned in the [QR code decode](/documentation/pix/decodificar_qr_code) |

## Response

STATUS 201

Response Body: Batch Schedule Approved

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "schedule_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "schedule_batch_status": "approved",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

### Enumerador schedule_batch_status
| Enumerator             | Description                                                                |
|------------------------|----------------------------------------------------------------------------|
| **created**            | Batch schedule created                                                     |
| **approved**           | Batch schedule approved                                                    |
| **rejected**           | Batch schedule rejected                                                    |
| **pending_2fa_approval**| Batch schedule pending two-factor authentication approval                  |

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in portuguese",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                  | Description (eng)<br/>`description`                                                                                         | Description (ptbr)<br/>`translation`                                                                                                |
|--------------------------|----------------------|-----------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                         | schema error description                                                                                                  | Schema Inválido                                                                                                                   |
| 404                      | PSC000001            | Account not Found                                   | Account was not found                                                                                                     | Conta não encontrada                                                                                                              |
| 406                      | PSC000002            | Invalid Uuid                                        | key was not accepted for not being a valid uuid v4 string                                                                 | key não foi aceito por não ser uma palavra uuid v4 válida                                                                         |
| 400                      | PSC000003            | Bad Request                                         | pix_message can not be longer than 140 characters                                                                         | pix_message não pode ser maior que 140 caracteres                                                                                 |
| 400                      | PSC000004            | Bad Request                                         | Emoji not allowed in pix message                                                                                          | Emoji não é permitido na mensagem pix                                                                                             |
| 406                      | PSC000005            | Invalid Transaction Amount                          | Transaction amount of transaction_amount is not valid. It must be a positive value with at maximum 2 decimal places       | O valor de transação transaction_amount não é válido. Deve ser um valor positivo com no máximo duas casas decimais                |
| 406                      | PSC000006            | Invalid end_to_end_id                               | The end_to_end_id sent end_to_end_id is not valid                                                                         | O end_to_end_id enviado end_to_end_id não é válido                                                                                |
| 400                      | PSC000007            | Invalid date format                                 | Dates must be sent using format YYYY-MM-DD                                                                                | Datas devem ser enviadas no formato YYYY-MM-DD                                                                                    |
| 400                      | PSC000008            | Invalid Schedule Date                               | Schedule date must be after current date for UTC-3                                                                        | Data de agendamento deve ser após a data atual em UTC-3                                                                           |
| 400                      | PSC000009            | Account is Closed                                   | Account is closed                                                                                                         | Conta está fechada                                                                                                                |
| 400                      | PSC000010            | Account is Blocked                                  | Account is blocked                                                                                                        | Conta está bloqueada                                                                                                              |
| 422                      | PSC000011            | Invalid Account Type                                | Pix is not yet implemented for non-checking or non-escrow account types                                                   | Transações Pix não estão implementadas para conta que não sejam escrow ou livres                                                  |
| 403                      | PSC000012            | User is not allowed to do this transaction          | User is not allowed to do this transaction                                                                                | Usuário não tem autorização para fazer essa transação                                                                             |
| 400                      | PSC000013            | Bad Request                                         | For Manual Pix Transfer Type a target account must be provided                                                            | Para transação pix do tipo manual, uma conta destino deve ser fornecida                                                           |
| 404                      | PSC000014            | Inquiry Not Found                                   | Pix key inquiry was not found                                                                                             | Pesquisa de chave pix não encontrada                                                                                              |
| 400                      | PSC000015            | Bad Request                                         | Pix key sent does match inquiry pix key. Verify if end_to_end_id sent is correct                                          | Chave Pix enviada não condiz com consulta. Verifique se end_to_end_id enviado está correto                                        |
| 404                      | PSC000016            | Account not found                                   | Nonexistent account in destination financial institution                                                                  | Conta inexistente na instituição financeira de destino                                                                            |
| 400                      | PSC000017            | Target Account and Source Account must be different | Target Account must not be the same as Source Account                                                                     | A conta de destino não pode ser a mesma da conta de origem                                                                        |
| 409                      | PSC000018            | Bad Request                                         | request_control_key request_control_key already in use                                                                    | request_control_key request_control_key já utilizada                                                                              |
| 400                      | PSC000019            | Invalid Target                                      | Account does not have permission to transfer to the given target account                                                  | A conta não possui permissão para realizar transferências para a conta enviada                                                    |
| 404                      | PSC000020            | Decode Inquiry Not Found                            | QR Code decode inquiry not found                                                                                          | Pesquisa e decodificação de QR code não encontrada                                                                                |
| 400                      | PSC000021            | Bad Request                                         | Receiver Conciliation Id sent does match decode inquiry receiver_conciliation_id. Verify if end_to_end_id sent is correct | Identificador de transação enviado não condiz com consulta. Verifique se end_to_end_id enviado está correto                       |
| 400                      | PSC000022            | Bad Request                                         | Dynamic Instant QR codes cannot be scheduled for payment                                                                  | Pagamentos de vencimento instantâneo não podem ter pagamento agendado                                                             |
| 400                      | PSC000023            | Bad Request                                         | Schedule Date sent is after max payment date for target qr code                                                           | Data de agendamento enviada é após a data máxima de pagamento para o qr code enviado                                              |
| 400                      | PSC000024            | Bad Request                                         | Pix transfer type sent does match decode inquiry qr code type. Verify if end_to_end_id sent is correct                    | Tipo de transação pix enviado enviado não condiz com tipo de qr code da consulta. Verifique se end_to_end_id enviado está correto |
| 400                      | PSC000040            | Empty pix-schedule list received                    | A list of pix schedules must be provided                                                                                  | Uma lista de agendamentos pix deve ser fornecida                                                                                  |
| 409                      | PSC000041            | Bad Request                                         | One or more request_control_key already in use                                                                            | Uma ou mais request_control_key já está sendo utilizada                                                                           |
| 403                      | PSC000045            | Requester not allowed to access this endpoint       | Requester has no permission to perform pix transfers on this endpoint                                                     | Requester não possui permissão de realizar transações pix através deste endpoint                                                  |

---

# solicitacao_de_agendamento_em_lote_2fa

URL: /en/documentation/baas/pix/agendamento/batch/solicitacao_de_agendamento_em_lote_2fa



---

# solicitacao_de_reenvio_de_token_para_agendamento_em_lote_2fa

URL: /en/documentation/baas/pix/agendamento/batch/solicitacao_de_reenvio_de_token_para_agendamento_em_lote_2fa



---

# Cancel Pix transaction scheduling

URL: /en/documentation/baas/pix/agendamento/cancelamento_de_agendamento

## Request

ENDPOINT /account/ ACCOUNT_KEY /pix_schedule/ SCHEDULE_KEY /cancel
MÉTODO PATCH

### Path Params

| Field          | Type   | Description                                   | Characters |
|----------------|--------|-----------------------------------------------|------------|
| `account_key`  | uuidv4 | Unique account identification key.            | 36         |
| `schedule_key` | uuidv4 | Unique schedule identification key.           | 36         |

### Response

STATUS 200

Response Body: Schedule Cancelled

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "schedule_key": "f64b3fa7-d09d-4927-ad4f-b966df9fb153",
  "schedule_status": "cancelled",
  "schedule_date": "2024-12-31",
  "created_at": "2023-03-13T19:00:28.440Z"
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in portuguese",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title` | Description (eng)<br/>`description` | Description (ptbr)<br/>`translation` |
|--------------------------|----------------------|--------------------------------------------|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|
| 400 | QIT000001 | Bad Request | schema error description | Schema Inválido |
| 404 | PSC000001 | Account not Found | Account was not found | Conta não encontrada |
| 403 | PSC000012 | User is not allowed to do this transaction | User is not allowed to do this transaction | Usuário não tem autorização para fazer essa transação |
| 404 | PSC000025 | PixSchedule not Found | PixSchedule was not found | PixSchedule não encontrada |
| 400 | PSC000027 | Bad Request | Action cannot be taken place as there is currently a pending transfer in progress | A ação não pôde ser completada como há uma transferência pendente |
| 400 | PSC000028 | Bad Request | Pix Schedule cannot be cancelled in current status | Agendamento pix não pode ser cancelado no status atual |
| 400 | PSC000029 | Bad Request | The given Pix Schedule is tied to a batch. It cannot be individually cancelled | O agendamento pix enviado está ligado a um lote. Ela não pode ser individualmente cancelada |

---

# Pix transaction scheduling inquiry

URL: /en/documentation/baas/pix/agendamento/consulta_de_agendamento

## Request

ENDPOINT /account/ ACCOUNT_KEY /pix_schedule/ SCHEDULE_KEY
MÉTODO GET

### Path Params

| Field          | Type   | Description                                   | Characters |
|----------------|--------|-----------------------------------------------|------------|
| `account_key`  | uuidv4 | Unique account identification key.            | 36         |
| `schedule_key` | uuidv4 | Unique schedule identification key.           | 36         |

### Response

STATUS 200

Response Body

```json
{
    "created_at": "2024-07-10T16:17:28Z",
    "pix_message": null,
    "rejection_info": null,
    "rejection_reason": null,
    "request_control_key": "b8eb663e-10fe-4729-9db5-8f8c93de5001",
    "schedule_date": "2024-07-10",
    "schedule_key": "0c9091ab-079b-4a43-8b3d-d4ba36a23883",
    "schedule_status": "sent",
    "schedule_transfers": [
        {
            "created_at": "2024-07-10T16:19:33Z",
            "end_to_end_id": "E3240250220240710161922sSHNf8BjI",
            "pix_transfer_key": "427b70cd-73b0-45d1-bb4a-97f50f605022",
            "pix_transfer_status": "sent"
        }
    ],
    "target_account": {
        "account_branch": "0001",
        "account_digit": "8",
        "account_number": "1234567",
        "account_type": "checking_account",
        "ispb": "99999004",
        "owner_document_number": "***91111***",
        "owner_name": "Conta manual geral",
        "owner_person_type": "natural",
        "pix_key": null,
        "receiver_conciliation_id": null
    },
    "transaction_amount": 2.0,
    "updated_at": "2024-07-10T16:19:38Z"
}

```

---

# Consult Pix transaction scheduling for an account

URL: /en/documentation/baas/pix/agendamento/consulta_de_agendamentos_de_uma_conta

## Request

ENDPOINT /account/ ACCOUNT_KEY /pix_schedules
MÉTODO GET

### Path Params

| Field          | Type   | Description                                   | Characters |
|----------------|--------|-----------------------------------------------|------------|
| `account_key`  | uuidv4 | Unique account identification key.            | 36         |

### Query Params
| Field                | Type    | Description                                                         | Characters                   |
|----------------------|---------|---------------------------------------------------------------------|------------------------------|
| `request_control_key`| uuidv4  | Unique identification key for the request used by the client.        | 36                           |
| `schedule_status`    | string  | Schedule status. Can be sent as a list.                              | **[Enumerator schedule_status](#enumerator-schedule_status)** |
| `page`               | integer | Requested page number. 1 by default.                                 |                              |
| `page_size`          | integer | Size of the requested page in the query. 30 by default and max value | Maximum value of 30          |

### Enumerator schedule_status
| Enumerator                 | Description                                                                                        |
|----------------------------|----------------------------------------------------------------------------------------------------|
| **scheduled**              | Scheduled transaction                                                                              |
| **sent**                   | Schedule completed and successfully sent. Final status.                                            |
| **rejected**               | Schedule rejected during creation or execution. Final status.                                      |
| **cancelled**              | Schedule canceled by customer request. Final status.                                               |
| **pending_2fa_approval**   | Pending two-factor authentication approval.                                                        |
| **pending_creation**       | Schedule in the process of creation (Transitional state for batch scheduling).                     |
| **waiting_batch_approval** | Schedule created and linked to a batch awaiting two-factor authentication approval.               |

### Response

STATUS 200

Response Body

```json
{
  "data": [
    {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "schedule_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "schedule_status": "scheduled",
      "schedule_date": "2024-12-31",
      "created_at": "2023-03-13T19:00:28.440Z"
    },
    {
      "request_control_key": "bf6b0a4b-c7a5-446b-9dad-1ae10b25342a",
      "schedule_key": "2479a5cd-079e-4d72-bf4e-16a695bda45e",
      "schedule_status": "cancelled",
      "schedule_date": "2024-12-31",
      "created_at": "2023-03-13T19:00:28.440Z"
    },
    {
      "request_control_key": "9d36c03e-2db7-4c90-87ed-6c9ddb3c03c7",
      "schedule_key": "5d6b14b9-053f-408c-bcd7-61ecf9224f2c",
      "schedule_status": "rejected",
      "schedule_date": "2024-12-31",
      "created_at": "2023-03-13T19:00:28.440Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "next_page": null,
    "rows_per_page": 30
  }
}

```

---

# Tabela de Erros para Pix Schedule

URL: /en/documentation/baas/pix/agendamento/erros_de_agendamento

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| Código HTTP<br/>`status` | Código QI<br/>`code` | Título<br/>`title`                                  | Descrição (eng)<br/>`description`                                                                                                    | Descrição (ptbr)<br/>`translation`                                                                                                          |
|--------------------------|----------------------|-----------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                         | schema error description                                                                                                             | Schema Inválido                                                                                                                             |
| 404                      | PSC000001            | Account not Found                                   | Account was not found                                                                                                                | Conta não encontrada                                                                                                                        |
| 406                      | PSC000002            | Invalid Uuid                                        | key was not accepted for not being a valid uuid v4 string                                                                            | key não foi aceito por não ser uma palavra uuid v4 válida                                                                                   |
| 400                      | PSC000003            | Bad Request                                         | pix_message can not be longer than 140 characters                                                                                    | pix_message não pode ser maior que 140 caracteres                                                                                           |
| 400                      | PSC000004            | Bad Request                                         | Emoji not allowed in pix message                                                                                                     | Emoji não é permitido na mensagem pix                                                                                                       |
| 406                      | PSC000005            | Invalid Transaction Amount                          | Transaction amount of transaction_amount is not valid. It must be a positive value with at maximum 2 decimal places                  | O valor de transação transaction_amount não é válido. Deve ser um valor positivo com no máximo duas casas decimais                          |
| 406                      | PSC000006            | Invalid end_to_end_id                               | The end_to_end_id sent end_to_end_id is not valid                                                                                    | O end_to_end_id enviado end_to_end_id não é válido                                                                                          |
| 400                      | PSC000007            | Invalid date format                                 | Dates must be sent using format YYYY-MM-DD                                                                                           | Datas devem ser enviadas no formato YYYY-MM-DD                                                                                              |
| 400                      | PSC000008            | Invalid Schedule Date                               | Schedule date must be after current date for UTC-3                                                                                   | Data de agendamento deve ser após a data atual em UTC-3                                                                                     |
| 400                      | PSC000009            | Account is Closed                                   | Account is closed                                                                                                                    | Conta está fechada                                                                                                                          |
| 400                      | PSC000010            | Account is Blocked                                  | Account is blocked                                                                                                                   | Conta está bloqueada                                                                                                                        |
| 422                      | PSC000011            | Invalid Account Type                                | Pix is not yet implemented for non-checking or non-escrow account types                                                              | Transações Pix não estão implementadas para conta que não sejam escrow ou livres                                                            |
| 403                      | PSC000012            | User is not allowed to do this transaction          | User is not allowed to do this transaction                                                                                           | Usuário não tem autorização para fazer essa transação                                                                                       |
| 400                      | PSC000013            | Bad Request                                         | For Manual Pix Transfer Type a target account must be provided                                                                       | Para transação pix do tipo manual, uma conta destino deve ser fornecida                                                                     |
| 404                      | PSC000014            | Inquiry Not Found                                   | Pix key inquiry was not found                                                                                                        | Pesquisa de chave pix não encontrada                                                                                                        |
| 400                      | PSC000015            | Bad Request                                         | Pix key sent does match inquiry pix key. Verify if end_to_end_id sent is correct                                                     | Chave Pix enviada não condiz com consulta. Verifique se end_to_end_id enviado está correto                                                  |
| 404                      | PSC000016            | Account not found                                   | Nonexistent account in destination financial institution                                                                             | Conta inexistente na instituição financeira de destino                                                                                      |
| 400                      | PSC000017            | Target Account and Source Account must be different | Target Account must not be the same as Source Account                                                                                | A conta de destino não pode ser a mesma da conta de origem                                                                                  |
| 409                      | PSC000018            | Bad Request                                         | request_control_key request_control_key already in use                                                                               | request_control_key request_control_key já utilizada                                                                                        |
| 400                      | PSC000019            | Invalid Target                                      | Account does not have permission to transfer to the given target account                                                             | A conta não possui permissão para realizar transferências para a conta enviada                                                              |
| 404                      | PSC000020            | Decode Inquiry Not Found                            | QR Code decode inquiry not found                                                                                                     | Pesquisa e decodificação de QR code não encontrada                                                                                          |
| 400                      | PSC000021            | Bad Request                                         | Receiver Conciliation Id sent does match decode inquiry receiver_conciliation_id. Verify if end_to_end_id sent is correct            | Identificador de transação enviado não condiz com consulta. Verifique se end_to_end_id enviado está correto                                 |
| 400                      | PSC000022            | Bad Request                                         | Dynamic Instant QR codes cannot be scheduled for payment                                                                             | Pagamentos de vencimento instantâneo não podem ter pagamento agendado                                                                       |
| 400                      | PSC000023            | Bad Request                                         | Schedule Date sent is after max payment date for target qr code                                                                      | Data de agendamento enviada é após a data máxima de pagamento para o qr code enviado                                                        |
| 400                      | PSC000024            | Bad Request                                         | Pix transfer type sent does match decode inquiry qr code type. Verify if end_to_end_id sent is correct                               | Tipo de transação pix enviado enviado não condiz com tipo de qr code da consulta. Verifique se end_to_end_id enviado está correto           |
| 404                      | PSC000025            | PixSchedule not Found                               | PixSchedule was not found                                                                                                            | PixSchedule não encontrada                                                                                                                  |
| 400                      | PSC000026            | Search Params Error                                 | Invalid integer value for page or size querystring parameters                                                                        | Valor inválido para parâmetros de página ou tamanho de página                                                                               |
| 400                      | PSC000027            | Bad Request                                         | Action cannot be taken place as there is currently a pending transfer in progress                                                    | A ação não pôde ser completada como há uma transferência pendente                                                                           |
| 400                      | PSC000028            | Bad Request                                         | Pix Schedule cannot be cancelled in current status                                                                                   | Agendamento pix não pode ser cancelado no status atual                                                                                      |
| 400                      | PSC000029            | Bad Request                                         | The given Pix Schedule is tied to a batch. It cannot be individually cancelled                                                       | O agendamento pix enviado está ligado a um lote. Ela não pode ser individualmente cancelada                                                 |
| 400                      | PSC000030            | Bad Request                                         | The maximum amount of pix transfer attempts has been reached                                                                         | A máxima quantidade de retentativas de transação pix foi atingida                                                                           |
| 400                      | PSC000031            | Bad Request                                         | An error occurred while attempting to run pix transfer                                                                               | Um erro ocorreu ao tentar realizar a transação pix                                                                                          |
| 404                      | PSC000032            | Pix Key Not Found                                   | Pix key was not found                                                                                                                | Chave pix não encontrada                                                                                                                    |
| 404                      | PSC000033            | Account Missmatch                                   | Target Account changed from schedule creation                                                                                        | A conta alvo foi alterada desde a criação do agendamento                                                                                    |
| 400                      | PSC000034            | Pix Schedule Conciliation Error                     | The referenced PixSchedule could not be updated                                                                                      | O PixSchedule referenciado não pode ser atualizado                                                                                          |
| 400                      | PSC000035            | Pix Schedule Transfer Conciliation Error            | The referenced PixScheduleTransfer could not be updated                                                                              | O PixScheduleTransfer referenciado não pode ser atualizado                                                                                  |
| 404                      | PSC000036            | Person Not Found                                    | Person not found                                                                                                                     | Pessoa não encontrada                                                                                                                       |
| 400                      | PSC000040            | Empty pix-schedule list received                    | A list of pix schedules must be provided                                                                                             | Uma lista de agendamentos pix deve ser fornecida                                                                                            |
| 409                      | PSC000041            | Bad Request                                         | One or more request_control_key already in use                                                                                       | Uma ou mais request_control_key já está sendo utilizada                                                                                     |
| 404                      | PSC000042            | Schedule Batch not Found                            | ScheduleBatch was not found                                                                                                          | ScheduleBatch não encontrada                                                                                                                |
| 400                      | PSC000043            | Schedule Batch could not be canceled                | ScheduleBatch could not be canceled due to current date being equal or after earliest schedule date. Cancel pix_schedules one by one | ScheduleBatch não pode ser cancelada devido a data atual ser superior ou igual à menor schedule_date. Cancele pix_schedules individualmente |
| 400                      | PSC000044            | Bad Request                                         | Schedule Batch cannot be cancelled in current status                                                                                 | Agendamento pix não pode ser cancelado no status atual                                                                                      |
| 403                      | PSC000045            | Requester not allowed to access this endpoint       | Requester has no permission to perform pix transfers on this endpoint                                                                | Requester não possui permissão de realizar transações pix através deste endpoint                                                            |
| 400                      | PSC000046            | tfa_info is required                                | Client must send object tfa_info                                                                                                     | Cliente deve enviar objeto tfa_info                                                                                                         |
| 403                      | PSC000047            | No approver permission                              | Given document number does not belong to an approver for this account                                                                | Número de documento enviado não pertence a um aprovador da conta                                                                            |
| 400                      | PSC000048            | Error occurred while sending token                  | An unexpected error occurred while sending token                                                                                     | Um erro inesperado ocorreu ao tentar enviar token                                                                                           |
| 400                      | PSC000049            | Number of token validation attempts exceeded        | The maximum number of failed token validation attempts has been reached                                                              | Número máximo de tentativas de validação de token atingida                                                                                  |
| 400                      | PSC000050            | Token Expired                                       | Token has expired. Resend token or recreate schedule                                                                                 | Token expirado. Reenvie token ou recrie a agendamento                                                                                       |
| 400                      | PSC000051            | Error Sending Token                                 | An error occurred while sending token and its being investigated                                                                     | Um erro ocorreu ao enviar token e está sendo investigado                                                                                    |
| 400                      | PSC000052            | Incorrect Token                                     | Token sent does not match expected                                                                                                   | Token enviado não condiz com o esperado                                                                                                     |
| 400                      | PSC000053            | Error Sending Token                                 | An error occurred while resending token and its being investigated                                                                   | Um erro ocorreu ao reenviar token e está sendo investigado                                                                                  |
| 400                      | PSC000054            | Invalid Schedule Date                               | Schedule must be approved before the scheduled date                                                                                  | Agendamento deve ser aprovado em data anterior à programada para transação                                                                  |
| 400                      | PSC000055            | Bad Request                                         | Schedule cannot be approved in current status                                                                                        | Agendamento pix não pode ser aprovado no status atual                                                                                       |

---

# Introduction

URL: /en/documentation/baas/pix/agendamento/introducao

Through the endpoints presented in this section, the integrator partner can schedule pix-type transactions. This feature allows you to create, list, and cancel schedules for a specific account.

## Notes
- The scheduling date follows Brasília time (BRT or UTC/GMT -03:00).
- Transactions will be attempted starting at 8 AM BRT.
- Transactions that fail due to insufficient balance will be retried in 1 hour, with a limit of 3 attempts.
- For **key**, **static_qr_code**, and **dynamic_qr_code** transactions, the Pix key will be re-verified before the transaction is completed to ensure that the destination account has not changed. If any discrepancy is detected, the schedule will be rejected (**rejected**).
- A webhook will be sent to the integrator partner informing the success or rejection of a schedule.
- It's not possible to schedule an instant **dynamic_qr_code**.
- Scheduled transfers consume your Pix transaction limit.

## Pix Schedule Status
| Enumerator                 | Description                                                                                        |
|----------------------------|----------------------------------------------------------------------------------------------------|
| **scheduled**              | Scheduled transaction                                                                              |
| **sent**                   | Schedule completed and successfully sent. Final status.                                            |
| **rejected**               | Schedule rejected during creation or execution. Final status.                                      |
| **cancelled**              | Schedule canceled by customer request. Final status.                                               |
| **pending_2fa_approval**   | Pending two-factor authentication approval.                                                        |
| **pending_creation**       | Schedule in the process of creation (Transitional state for batch scheduling).                      |
| **waiting_batch_approval** | Schedule created and linked to a batch awaiting two-factor authentication approval.               |

## Schedule Transfers
On the scheduled day, after verifying the consistency of the target account, the pix transaction will be attempted. At this point, a **pix_transfer** is generated and added to the `schedule_transfers` list. A maximum of 3 pix transactions will be attempted.

### Schedule Transfer Object
| Field                | Type   | Description                                                                                   | Characters                                  |
|----------------------|--------|-----------------------------------------------------------------------------------------------|---------------------------------------------|
| `pix_transfer_key`   | uuidv4 | Unique key for identifying the Pix transfer in the QI system.                                  | 36                                          |
| `end_to_end_id` *    | string | Idempotency key for a Pix transaction within the SPI (Instant Payment System).                 | 32                                          |
| `pix_transfer_status`| string | Transaction status.                                                                           | [Enumerators pix_transfer_status](#enumerator-pix-transfer-status) |
| `created_at`         | string | Timestamp of when the transaction was created.                                                | 20                                          |

### Enumerator Pix Transfer Status
| Enumerator | Description                          |
|------------|--------------------------------------|
| **sent**   | Transaction successfully sent. Final status. |
| **rejected**| Transaction rejected during execution. Final status. |
| **pending**| Transaction pending conclusion. Transitional state. |

---

# Introduction to Two-Factor Authentication

URL: /en/documentation/baas/pix/agendamento/introducao_a_agendamento_2fa

In this type of scheduling, confirmation of payment programming is required via token sent to the person with powers to approve transactions in the debtor account.

The PIX scheduling request by integrator partners configured to use two-factor authentication is performed similarly to what is described in [request PIX transaction scheduling](/documentation/baas/pix/agendamento/solicitacao_de_agendamento). The difference occurs in adding the `tfa_info` object, containing information about the transfer approver and the contact method, and the status of a successful request that will always be **pending_2fa_approval**.

The same applies to PIX batch transactions described in [perform PIX batch transaction](/documentation/baas/pix/batch/solicitacao_de_transacao_em_lote_pix).

## Flow for a PIX scheduling with authorization

The successful PIX scheduling will follow the following process flow:
Performing the [PIX transaction request](/documentation/baas/pix/agendamento/solicitacao_de_agendamento_2fa) and receiving a synchronous response with status **pending_2fa_approval** and `schedule_key` value.
The indicated approver will receive a 6-digit `token` composed of numbers.
The requester performs the [PIX transaction confirmation](/documentation/baas/pix/agendamento/aprovacao_de_agendamento_2fa) with the `schedule_key` and the `token`.
The scheduling will then be updated to status **scheduled**.
## Observations
Each scheduling has a maximum limit of 5 `token` validation attempts. When this limit is reached, the scheduling will be automatically set to rejected status (**rejected**).
Each `token` has a maximum duration of 5 minutes.
A scheduling can have its `token` renewed and resent to the transfer approver. This process restarts the 5-minute timer and does not restart the invalid attempts counter. The previous `token` becomes invalid.
The notification event for sending `token` to the approver is **baas.token_validation.pix_transfer.schedule.single**. It is possible to [customize](/documentation/notificacoes/template) the sent message.
The implemented token sending methods (`contact_type`) are via **sms** and **email**.

---

# Request Pix transaction scheduling

URL: /en/documentation/baas/pix/agendamento/solicitacao_de_agendamento

## Request

ENDPOINT /account/ ACCOUNT_KEY /pix_schedule
MÉTODO POST

### Path Params

| Field          | Type   | Description                               | Characters |
|----------------|--------|-------------------------------------------|------------|
| `account_key`  | uuidv4 | Unique account identification key.        | 36         |

**Key**

Request Body: Pix Key Scheduling

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_type": "key",
  "target_pix_key": "target_pix_key@email.com",
  "transaction_amount": 500.65,
  "end_to_end_id": "E73856642202309201429bZKfklNlbwu",
  "pix_message": "Ola Mundo",
  "schedule_date": "2024-12-01"
}
```

### Body Params
| Field                 | Type      | Description                                                                                                                                                                                                 | Characters |
|-----------------------|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|
| `request_control_key` * | uuidv4   | Unique identification key for the request used by the client in uuid v4 format.                                                                                                                             | 36         |
| `pix_transfer_type` * | enumerator| Type of the pix to be performed. For key transfer, it should be **key**.                                                                                                                                    | **key**    |
| `target_pix_key` *    | string    | Pix key of the account to which the transaction will be sent.                                                                                                                                               | 100        |
| `transaction_amount` *| number    | Transfer amount.                                                                                                                                                                                            | 10         |
| `end_to_end_id` *     | string    | Idempotency key for a Pix transaction within the SPI (Instant Payment System). This key is returned in Pix key queries. Should only be sent if `pix_transfer_type` is **key**, **static_qr_code**, or **dynamic_qr_code**. | 32         |
| `pix_message`         | string    | Message to be sent along with the Pix transfer.                                                                                                                                                             | 140        |
| `schedule_date` *     | string    | Date when the transaction is to be performed.                                                                                                                                                               | 10         |

**Manual**
Request Body: Manual Transfer

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_type": "manual",
  "target_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "12345678",
    "owner_document_number": "32402502000135",
    "owner_name": "Qi Tech",
    "account_type": "checking_account",
    "ispb": "32402502"
  },
  "transaction_amount": 500.65,
  "pix_message": "Ola Mundo",
  "schedule_date": "2024-12-01"
}
```

### Body Params
| Field                 | Type      | Description                                                                                      | Characters                                             |
|-----------------------|-----------|--------------------------------------------------------------------------------------------------|--------------------------------------------------------|
| `request_control_key` * | uuidv4   | Unique identification key for the request used by the client in uuid v4 format.                  | 36                                                     |
| `pix_transfer_type` * | enumerator| Type of Pix transfer.                                                                            | **manual**                                             |
| `target_account` *    | Object    | Destination account - Should only be sent for transfers with `pix_transfer_type` of type **manual**. | **[Object target_account](#object-target_account)**    |
| `transaction_amount` *| number    | Transfer amount.                                                                                 | 10                                                     |
| `pix_message`         | string    | Message to be sent along with the Pix transfer.                                                  | 140                                                    |
| `schedule_date` *     | string    | Date when the transaction is to be performed.                                                    | 10                                                     |

### Object target_account
| Field                   | Type      | Description                                                                                  | Characters                                             |
|-------------------------|-----------|----------------------------------------------------------------------------------------------|--------------------------------------------------------|
| `account_branch` *      | string    | Account branch.                                                                              | 6                                                      |
| `account_digit` *       | string    | Account digit.                                                                               | 1                                                      |
| `account_number` *      | string    | Account number.                                                                              | 20                                                     |
| `owner_document_number` * | string | CPF or CNPJ (numbers only) of the account holder.                                            | 14                                                     |
| `owner_name` *          | string    | Name of the account holder.                                                                  | 150                                                    |
| `account_type` *        | enumerator| Account type.                                                                                | **[Enumerator account_type](#enumerator-account_type)** |
| `ispb` *                | string    | Based on the CNPJ of the financial institution (8 digits).                                   | 8                                                      |

### Enumerator account_type
| Enumerator             | Description               |
|-----------------------|----------------------------|
| **checking_account**  | Checking Account           |
| **salary_account**    | Salary Account             |
| **saving_account**    | Savings Account            |
| **payment_account**   | Payment Account            |

**Qr Code**

Request Body: QR Code Transfer

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_type": "static_qr_code",
  "transaction_amount": 500.65,
  "end_to_end_id": "E73856642202309201429bZKfklNlbwu",
  "receiver_conciliation_id": "REC00000000000000000000009459463343",
  "target_pix_key": "target_pix_key@email.com",
  "pix_message": "Ola Mundo",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  }
}
```

### Body Params
| Field                    | Type      | Description                                                                                                             | Characters                                   |
|--------------------------|-----------|-------------------------------------------------------------------------------------------------------------------------|----------------------------------------------|
| `request_control_key` *  | uuidv4    | Unique identification key for the request used by the client in uuid v4 format.                                           | 36                                           |
| `pix_transfer_type` *    | enumerator| Type of Pix transfer.                                                                                                    | **static_qr_code** or **dynamic_qr_code**    |
| `target_pix_key` *       | string    | Pix key of the account to which the transaction will be sent.                                                            | 100                                          |
| `receiver_conciliation_id` | string  | Reconciliation ID of the receiver.                                                                                       | 35                                           |
| `transaction_amount` *   | number    | Transfer amount.                                                                                                         | 10                                           |
| `end_to_end_id` *        | string    | Idempotency key for a Pix transaction within the SPI (Instant Payment System). This key is returned in Pix key queries. Should only be sent if `pix_transfer_type` is **key**, **static_qr_code**, or **dynamic_qr_code**. | 32                                           |
| `pix_message`            | string    | Message to be sent along with the Pix transfer.                                                                          | 140                                          |
| `tfa_info` *             | Object    | Object containing the document of the account approver and the means of contact.                                         | **[Object tfa_info](#object-tfa_info)**      |

:::info Warning
The `end_to_end_id` is returned when [decoding the Pix QR Code](/documentation/pix/decodificar_qr_code), using the Pix Copy and Paste URI.
:::

:::danger Warning
The `end_to_end_id` from the query must have been made in the name of the account that will request the transaction!
:::

:::danger Warning
An `end_to_end_id` can only be used for a single transfer, regardless of whether the transfer was successful or not.
:::

## Response

STATUS 201

Response Body: Schedule Created

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "schedule_key": "f64b3fa7-d09d-4927-ad4f-b966df9fb153",
  "schedule_status": "scheduled",
  "schedule_date": "2024-12-31",
  "created_at": "2023-03-13T19:00:28.440Z"
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in portuguese",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title` | Description (eng)<br/>`description` | Description (ptbr)<br/>`translation` |
|--------------------------|----------------------|-----------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| 400 | QIT000001 | Bad Request | schema error description | Schema Inválido |
| 404 | PSC000001 | Account not Found | Account was not found | Conta não encontrada |
| 406 | PSC000002 | Invalid Uuid | key was not accepted for not being a valid uuid v4 string | key não foi aceito por não ser uma string uuid v4 válida |
| 400 | PSC000003 | Bad Request | pix_message can not be longer than 140 characters | pix_message não pode ter mais de 140 caracteres |
| 400 | PSC000004 | Bad Request | Emoji not allowed in pix message | Emoji não é permitido na mensagem pix |
| 406 | PSC000005 | Invalid Transaction Amount | Transaction amount of transaction_amount is not valid. It must be a positive value with at maximum 2 decimal places | O valor de transação transaction_amount não é válido. Deve ser um valor positivo com no máximo duas casas decimais |
| 406 | PSC000006 | Invalid end_to_end_id | The end_to_end_id sent end_to_end_id is not valid | O end_to_end_id enviado end_to_end_id não é válido |
| 400 | PSC000007 | Invalid date format | Dates must be sent using format YYYY-MM-DD | Datas devem ser enviadas no formato YYYY-MM-DD |
| 400 | PSC000008 | Invalid Schedule Date | Schedule date must be after current date for UTC-3 | Data de agendamento deve ser após a data atual em UTC-3 |
| 400 | PSC000009 | Account is Closed | Account is closed | Conta está fechada |
| 400 | PSC000010 | Account is Blocked | Account is blocked | Conta está bloqueada |
| 422 | PSC000011 | Invalid Account Type | Pix is not yet implemented for non-checking or non-escrow account types | Transações Pix não estão implementadas para conta que não sejam escrow ou livres |
| 403 | PSC000012 | User is not allowed to do this transaction | User is not allowed to do this transaction | Usuário não tem autorização para fazer essa transação |
| 400 | PSC000013 | Bad Request | For Manual Pix Transfer Type a target account must be provided | Para transação pix do tipo manual, uma conta destino deve ser fornecida |
| 404 | PSC000014 | Inquiry Not Found | Pix key inquiry was not found | Pesquisa de chave pix não encontrada |
| 400 | PSC000015 | Bad Request | Pix key sent does match inquiry pix key. Verify if end_to_end_id sent is correct | Chave Pix enviada não condiz com consulta. Verifique se end_to_end_id enviado está correto |
| 404 | PSC000016 | Account not found | Nonexistent account in destination financial institution | Conta inexistente na instituição financeira de destino |
| 400 | PSC000017 | Target Account and Source Account must be different | Target Account must not be the same as Source Account | A conta de destino não pode ser a mesma da conta de origem |
| 409 | PSC000018 | Bad Request | request_control_key request_control_key already in use | request_control_key request_control_key já utilizada |
| 400 | PSC000019 | Invalid Target | Account does not have permission to transfer to the given target account | A conta não possui permissão para realizar transferências para a conta enviada |
| 404 | PSC000020 | Decode Inquiry Not Found | QR Code decode inquiry not found | Pesquisa e decodificação de QR code não encontrada |
| 400 | PSC000021 | Bad Request | Receiver Conciliation Id sent does match decode inquiry receiver_conciliation_id. Verify if end_to_end_id sent is correct | Identificador de transação enviado não condiz com consulta. Verifique se end_to_end_id enviado está correto |
| 400 | PSC000022 | Bad Request | Dynamic Instant QR codes cannot be scheduled for payment | Pagamentos de vencimento instantâneo não podem ter pagamento agendado |
| 400 | PSC000023 | Bad Request | Schedule Date sent is after max payment date for target qr code | Data de agendamento enviada é após a data máxima de pagamento para o qr code enviado |
| 400 | PSC000024 | Bad Request | Pix transfer type sent does match decode inquiry qr code type. Verify if end_to_end_id sent is correct | Tipo de transação pix enviado não condiz com o tipo de qr code da consulta. Verifique se end_to_end_id enviado está correto |

---

# solicitacao_de_agendamento_2fa

URL: /en/documentation/baas/pix/agendamento/solicitacao_de_agendamento_2fa



---

# solicitacao_de_reenvio_de_token_para_agendamento_2fa

URL: /en/documentation/baas/pix/agendamento/solicitacao_de_reenvio_de_token_para_agendamento_2fa



---

# Pix Schedule Completion Webhook

URL: /en/documentation/baas/pix/agendamento/webhook_de_conclusao_de_agendamento

After a Pix schedule is completed, a webhook will be sent to the integration partner with the result.

:::danger Warning!
QI Tech webhooks should not be mapped in a restrictive way. Additional fields may be included in the webhook payloads returned by our APIs.
:::

### Webhook Request Body

Request Body: Schedule Completed and Sent

```json
{
  "webhook_type": "baas.pix_schedule.completed",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
    "created_at": "2024-07-10T16:17:28Z",
    "pix_message": null,
    "rejection_info": null,
    "rejection_reason": null,
    "request_control_key": "b8eb663e-10fe-4729-9db5-8f8c93de5001",
    "schedule_date": "2024-07-10",
    "schedule_key": "0c9091ab-079b-4a43-8b3d-d4ba36a23883",
    "schedule_status": "sent",
    "schedule_transfers": [
      {
        "created_at": "2024-07-10T16:19:33Z",
        "end_to_end_id": "E3240250220240710161922sSHNf8BjI",
        "pix_transfer_key": "427b70cd-73b0-45d1-bb4a-97f50f605022",
        "pix_transfer_status": "sent"
      }
    ],
    "target_account": {
      "account_branch": "0001",
      "account_digit": "8",
      "account_number": "1234567",
      "account_type": "checking_account",
      "ispb": "99999004",
      "owner_document_number": "***91111***",
      "owner_name": "Conta manual geral",
      "owner_person_type": "natural",
      "pix_key": null,
      "receiver_conciliation_id": null
    },
    "transaction_amount": 2.0,
    "updated_at": "2024-07-10T16:19:38Z"
  }
}
```

Request Body: Schedule Completed and Rejected

```json
{
  "created_at": "2024-07-11T16:03:54Z",
  "pix_message": null,
  "rejection_info": {
    "error_code": "PSC000030",
    "error_description": "The maximum amount of pix transfer attempts has been reached",
    "error_translation": "A maxima quantidade de retentativas de transacao pix foi atingida",
    "rejection_reason": "max_tries_exceeded"
  },
  "rejection_reason": null,
  "request_control_key": "b8eb663e-10fe-4729-9db5-8f8c93de0008",
  "schedule_date": "2024-07-11",
  "schedule_key": "8b262d82-3fc6-40f0-bfe5-bf18556ededb",
  "schedule_status": "rejected",
  "schedule_transfers": [
    {
      "created_at": "2024-07-11T16:04:21Z",
      "end_to_end_id": "E32402502202407111604ffoPVrGebI0",
      "pix_transfer_key": "c2c4e064-e684-450b-add5-07fb1efe8991",
      "pix_transfer_status": "rejected"
    },
    {
      "created_at": "2024-07-11T16:08:33Z",
      "end_to_end_id": "E32402502202407111608TQ3C4vRPRPk",
      "pix_transfer_key": "c30254db-86b2-4d8a-be01-29fa0d93ae92",
      "pix_transfer_status": "rejected"
    },
    {
      "created_at": "2024-07-11T16:09:20Z",
      "end_to_end_id": "E32402502202407111609zSUQQOvmMV6",
      "pix_transfer_key": "1a329248-fc39-4b49-9b95-8f1c1bb10c8b",
      "pix_transfer_status": "rejected"
    }
  ],
  "target_account": {
    "account_branch": "0001",
    "account_digit": "8",
    "account_number": "1234567",
    "account_type": "checking_account",
    "ispb": "99999004",
    "owner_document_number": "***91111***",
    "owner_name": "Conta manual geral",
    "owner_person_type": "natural",
    "pix_key": null,
    "receiver_conciliation_id": null
  },
  "transaction_amount": 2.0,
  "updated_at": "2024-07-11T16:09:21Z"
}
```

### Webhook Body Param

| Field                 | Type   | Description                                                                        | Max. Characters                                                    |
|-----------------------|--------|------------------------------------------------------------------------------------|--------------------------------------------------------------------|
| `webhook_type`        | string | An enumerator that defines the type of event being reported                        | 23                                                                 |
| `webhook_datetime`    | string | Date and time of webhook dispatch                                                  | 20                                                                 |
| `transaction_amount`  | number | Transfer amount                                                                    | 10                                                                 |
| `target_account`      | object | Schedule destination account                                                       | **[target_account object](#objeto-target_account)**                |
| `schedule_transfers`  | array  | List of transfer attempts performed by the schedule                                | list of **[schedule_transfer object](#schedule-transfer-object)** |
| `schedule_status`     | string | Schedule status                                                                    | **[schedule_status enumerator](#pix-schedule-status)**             |
| `schedule_key`        | string | Unique schedule identification key                                                 | 36                                                                 |
| `schedule_date`       | string | Date on which the transaction will be performed                                     | 10                                                                 |
| `request_control_key` | uuidv4 | Unique request identification key used by the client in uuid v4 format             | 36                                                                 |                                                                  |
| `rejection_info`      | object | Object with information about the rejection event                                  |                                                                    |
| `rejection_reason`    | string | Reason for rejection                                                               | **[rejection_reason enumerators](#enumeradores-rejection_reason)** |
| `pix_message`         | string | Message to be sent along with the Pix transfer                                     | 140                                                                |
| `updated_at`          | string | Date and time of the last schedule update                                         | 20                                                                 |
| `created_at`          | string | Schedule creation date and time                                                    | 20                                                                 |

## Pix Schedule Status

| Enumerator                 | Description                                                                                    |
|----------------------------|------------------------------------------------------------------------------------------------|
| **scheduled**              | Scheduled transaction                                                                          |
| **sent**                   | Schedule completed and sent successfully. Final state                                          |
| **rejected**               | Schedule rejected during creation or execution. Final state                                    |
| **cancelled**              | Schedule cancelled by client request. Final state                                             |
| **pending_2fa_approval**   | Pending approval by two-factor authentication                                                  |
| **pending_creation**       | Schedule in creation process (Transitional state for batch scheduling)                        |
| **waiting_batch_approval** | Schedule created and linked to a batch awaiting approval by two-factor authentication         |

### Schedule Transfer Object

| Field                 | Type   | Description                                                                                     | Characters                                                          |
|-----------------------|--------|-------------------------------------------------------------------------------------------------|---------------------------------------------------------------------|
| `pix_transfer_key`    | uuidv4 | Unique identification key of the Pix transfer in the QI system                                  | 36                                                                  |
| `end_to_end_id` *     | string | Idempotency key of a Pix transaction within SPI (Instant Payment System)                       | 32                                                                  |
| `pix_transfer_status` | string | Transaction status                                                                              | [pix_transfer_status enumerators](#enumerador-pix-transfer-status) |         |
| `created_at`          | string | Transaction creation date and time                                                               | 20                                                                  |

### Pix Transfer Status Enumerator

| Enumerator   | Description                                          |
|--------------|------------------------------------------------------|
| **sent**     | Transaction sent successfully. Final state          |
| **rejected** | Transaction rejected during execution. Final state  |
| **pending**  | Transaction pending completion. Transitional state  |

### target_account Object

| Field                   | Type       | Description                                                                                     | Characters                                                        |
|-------------------------|------------|-------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| `account_branch`        | string     | Account branch                                                                                  | 6                                                                 |
| `account_digit`         | string     | Account digit                                                                                   | 1                                                                 |
| `account_number`        | string     | Account number                                                                                  | 20                                                                |
| `owner_document_number` | string     | CPF or CNPJ (numbers only) of the account holder                                               | 14                                                                |
| `owner_name`            | string     | Account holder name                                                                             | 150                                                               |
| `owner_person_type`     | enumerator | Identifier indicating whether the account owner is a natural or legal person                    | **[owner_person_type enumerator](#enumerador-owner_person_type)** |                                                    |
| `owner_name`            | string     | Account holder name                                                                             | 150                                                               |
| `account_type`          | enumerator | Account type                                                                                    | **[account_type enumerator](#enumerador-account_type)**           |
| `ispb`                  | string     | Eight-digit code that identifies banks in the Central Bank reserve transfer system             | 8                                                                 |
| `pix_key`               | string     | Schedule target pix key                                                                         | 100                                                               |

### owner_person_type Enumerator

| Enum        | Description  |
|-------------|--------------|
| **natural** | Natural person   |
| **legal**   | Legal person |

### account_type Enumerator

| Enumerator           | Description         |
|----------------------|---------------------|
| **checking_account** | Checking Account    |
| **salary_account**   | Salary Account      |
| **saving_account**   | Savings Account     |
| **payment_account**  | Payment Account     |

### rejection_reason Enumerators

| Enumerator                                          | Description                                                               |
|-----------------------------------------------------|---------------------------------------------------------------------------|
| `target_creation_error`                             | Error in schedule creation                                                |
| `limit_date_for_approval_surpassed`                 | Approval deadline surpassed                                              |
| `limit_date_for_batch_approval_surpassed`           | Batch approval deadline surpassed                                        |
| `max_tries_exceeded`                                | Maximum number of attempts exceeded                                       |
| `rejection_by_transfer`                             | Rejection by transfer                                                     |
| `target_change`                                     | Change in destination account                                             |
| `invalid_pix_key`                                   | Invalid Pix key                                                          |
| `max_token_validation_attempts_exceeded`            | Maximum number of token validation attempts exceeded                      |
| `error_sending_token`                               | Error sending token                                                      |
| `max_token_validation_attempts_exceeded_for_batch`  | Maximum number of token validation attempts for batch exceeded           |

---

# Approve batch transaction with Two-Factor Authentication

URL: /en/documentation/baas/pix/batch/aprovar_transacao_em_lote_pix_2fa

## Request

ENDPOINT /account/ ACCOUNT_KEY /pix_transfer_batch/ PIX_TRANSFER_BATCH_KEY /validate_token
METHOD PUT

### Path Params

| Field                     | Type   | Description                                                   | Characters |
|---------------------------|--------|---------------------------------------------------------------|------------|
| `account_key`             | uuidv4 | Unique account identification key.                            | 36         |
| `pix_transfer_batch_key`  | uuidv4 | Unique identification key for the pix batch transfer.         | 36         |
## Authentication via Email and SMS

Request Body

```json
{
  "token": "329adf"
}
```

## Authentication via Device

To approve and finalize device authentication, the request must be sent with an empty payload. Validation occurs internally, with no additional information required in the request body. Note that this endpoint should only be used after the [batch transaction request](./solicitacao_de_transacao_em_lote_pix_2fa.md) has been initiated.

Request Body

```json
{

}
```

### Body Params

| Field    | Type   | Description                                                                                      | Characters |
|----------|--------|--------------------------------------------------------------------------------------------------|------------|
| `token`  | string | Authentication code sent to the account's transaction approver **required for TFA via SMS or email** | 6          |

## Response

STATUS 201

Response Body: Transfer sent

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "pix_transfer_batch_status": "approved"
}
```

STATUS 4xx

Response Body: Transfer rejected

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in portuguese",
  "code": "codigo",
  "extra_fields": {
    "pix_transfer_batch_data": {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "pix_transfer_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "pix_transfer_batch_status": "rejected"
    }
  }
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in portuguese",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                           | Description (eng)<br/>`description`                                                                        | Description (ptbr)<br/>`translation`                                                   |
|--------------------------|----------------------|----------------------------------------------|----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
| 404                      | PXT000178            | Pix Transfer Batch not found                 | A pix_transfer_batch not found                                                                           | Uma pix_transfer_batch não encontrada                                                |
| 400                      | PXT000180            | Invalid Status                               | Pix transfer Batch not in pending_2fa_approval status                                                    | Pix transfer em lote não está pendente de aprovação por autenticação de dois fatores |
| 400                      | PXT000171            | Number of token validation attempts exceeded | The maximum number of failed token validation attempts has been reached                                  | Número máximo de tentativas de validação de token atingida                           |
| 400                      | PXT000172            | Token Expired                                | Token has expired. Resend token or recreate transferToken has expired. Resend token or recreate transfer | Token expirado. Reenvie token ou recrie a transferência                              |
| 400                      | PXT000173            | Incorrect Token                              | Token sent does not match expected                                                                       | Token enviado não condiz com, o esperado                                             |
| 400                      | PXT000189            | Token Required                               | A token is required for SMS or email validation.                                                         | Um token é necessário para validação via SMS ou email.                               |

---

# Introduction to Pix Batch Transaction

URL: /en/documentation/baas/pix/batch/introducao_a_transacao_em_lote_pix

QI Tech offers the possibility of performing multiple Pix transactions with a single call. In this system, transactions are carried out asynchronously. If an **http status 4xx** is returned in the initial call, none of the transactions will be executed. After the request, the integrator partner will receive a webhook for each transaction informing the final status of the attempt, which can be **rejected** or **sent**.

## Two-Factor Authentication

As with Pix transactions, integrator partners with two-factor authentication configuration must send the `tfa_info` object with contact information and token delivery details.

---

# List Transactions of a Batch in an Account

URL: /en/documentation/baas/pix/batch/listar_transacoes_de_um_lote_de_transacoes_pix

## Request

ENDPOINT /account/ ACCOUNT_KEY /pix_transfer_batch/ PIX_TRANSFER_BATCH_KEY /pix_transfers
METHOD GET

### Path Params

| Field                   | Type   | Description                                       | Characters |
|-------------------------|--------|---------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique identification key of the account.         | 36         |
| `pix_transfer_batch_key`| uuidv4 | Unique identification key of the batch transaction. | 36       |

### Query Params

| Field                   | Type    | Description                                                             | Characters                                          |
|-------------------------|---------|-------------------------------------------------------------------------|----------------------------------------------------|
| `request_control_key`   | uuidv4  | Unique request identification key used by the client.                   | 36                                                 |
| `pix_transfer_batch_status` | string | Status of the Pix transaction.                                          | [Enumerator pix_transfer_status](#enumerator-pix_transfer_status) |
| `page`                  | integer | Requested page number. Default is 1                                     |                                                    |
| `page_size`             | integer | Requested page size in the query. Default and maximum value is 30       | Maximum value of 30                                 |
### Enumerator pix_transfer_status

| Enumerator                | Description                                             |
|---------------------------|---------------------------------------------------------|
| **sent**                  | Pix transfer successfully completed.                    |
| **pending**               | Pix transfer pending.                                   |
| **pending_2fa_approval**  | Pix transfer pending two-factor approval                |
| **rejected**              | Pix transfer rejected.                                  |
### Response

STATUS 200

Response Body

```json
{
  "data": [
    {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "end_to_end_id": "E32402502202405081755SxyT2DDcVwc",
      "pix_transfer_status": "sent",
      "created_at": "2021-10-22T20:30:23.459Z"
    },
    {
      "request_control_key": "697c07c3-5398-48d2-a418-853323f85f97",
      "pix_transfer_key": "e95eabdb-4520-4c3d-a76f-99cb5b64724b",
      "end_to_end_id": "E32402502202405081755SxyT14Dtvwa",
      "pix_transfer_status": "sent",
      "created_at": "2021-10-22T20:30:23.459Z"
    },
    {
      "request_control_key": "ca35c526-b5a0-40d7-8c56-8566c77a34f4",
      "pix_transfer_key": "58d2fa9e-42ec-4779-b2fc-14ec98cbdca8",
      "end_to_end_id": "E32402502202405081755SsbT7DDcVwb",
      "pix_transfer_status": "rejected",
      "created_at": "2021-10-22T20:30:23.459Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "rows_per_page": 30
  }
}

```

---

# List Batch Transactions of an Account

URL: /en/documentation/baas/pix/batch/listar_transacoes_em_lote_pix_de_uma_conta

## Request

ENDPOINT /account/ ACCOUNT_KEY /pix_transfer_batches
METHOD GET

### Path Params

| Field         | Type   | Description                              | Characters |
|---------------|--------|----------------------------------------|------------|
| `account_key` | uuidv4 | Unique identification key of the account. | 36         |

### Query Params

| Field                 | Type   | Description                                                             | Characters               |
|-----------------------|--------|-------------------------------------------------------------------------|--------------------------|
| `request_control_key` | uuidv4 | Unique request identification key used by the client.                    | 36                       |
| `date_from`           | string | Start date. Format "YYYY-MM-DD"                                         |                          |
| `date_to`             | string | End date. Format "YYYY-MM-DD"                                           |                          |
| `page`                | integer| Requested page number. Default is 1                                     |                          |
| `page_size`           | integer| Requested page size in the query. Default and maximum value is 30       | Maximum value of 30      |

### Response

STATUS 200

Response Body

```json
{
  "data": [
    {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "pix_transfer_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "pix_transfer_batch_status": "approved"
    },
    {
      "request_control_key": "939d1503-aa5a-49a6-ae3b-ff84122a6dd3",
      "pix_transfer_batch_key": "03cf9181-0eb9-480e-8bb4-66a5a9a6410e",
      "pix_transfer_batch_status": "rejected"
    },
    {
      "request_control_key": "43a14f3a-b2af-4a0e-8a74-70af2fca74a9",
      "pix_transfer_batch_key": "94ab9fad-9c65-4117-b9c3-a47b1269508f",
      "pix_transfer_batch_status": "approved"
    }
  ],
  "pagination": {
    "current_page": 1,
    "rows_per_page": 30
  }
}

```

# Consult Batch Transaction

## Request

ENDPOINT /account/ ACCOUNT_KEY /pix_transfer_batch/ PIX_TRANSFER_BATCH_KEY
METHOD GET

### Path Params

| Field                   | Type   | Description                                       | Characters |
|-------------------------|--------|---------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique identification key of the account.         | 36         |
| `pix_transfer_batch_key`| uuidv4 | Unique identification key of the batch transaction. | 36       |

### Response

STATUS 200

Response Body

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "pix_transfer_batch_status": "approved"
}
```

---

# Request token resend for a batch Pix transaction

URL: /en/documentation/baas/pix/batch/solicitacao_de_reenvio_de_token_para_lote

A new token will be generated and sent to the account's transaction approver. If the limit number of token validation attempts has been exceeded, the resend will not be allowed.

## Request

ENDPOINT /account/ ACCOUNT_KEY /pix_transfer/ PIX_TRANSFER_KEY /resend_token
METHOD PATCH

### Path Params

| Field                     | Type   | Description                                | Characters |
|---------------------------|--------|--------------------------------------------|------------|
| `account_key` *           | uuidv4 | Unique account identification key.         | 36         |
| `pix_transfer_batch_key` *| uuidv4 | Unique identification key for the batch transfer. | 36         |

## Response

STATUS 202

Response Body: Transaction Requested

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "pix_transfer_status": "pending_2fa_approval"
}
```

STATUS 4xx

Response Body: Transfer rejected

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in portuguese",
  "code": "codigo",
  "extra_fields": {
    "pix_transfer_data": {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "pix_transfer_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "pix_transfer_status": "rejected"
    }
  }
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                           | Description (eng)<br/>`description`                                                                        | Description (ptbr)<br/>`translation`                                                   |
|--------------------------|----------------------|----------------------------------------------|----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                  | Schema Error                                                                                             | Erro de Schema                                                                       |
| 404                      | PXT000004            | Account not found                            | Account not found for: \{account_datum\}                                                                 | Conta não encontrada para: \{account_datum\}                                         |
| 400                      | PXT000176            | Error Sending Token                          | An error occurred while resending token and its being investigated                                       | Um erro ocorreu ao reenviar token e está sendo investigado                           |
| 404                      | PXT000178            | Pix Transfer Batch not found                 | A pix_transfer_batch not found                                                                           | Uma pix_transfer_batch não encontrada                                                |
| 400                      | PXT000180            | Invalid Status                               | Pix transfer Batch not in pending_2fa_approval status                                                    | Pix transfer em lote não está pendente de aprovação por autenticação de dois fatores |
| 400                      | PXT000171            | Number of token validation attempts exceeded | The maximum number of failed token validation attempts has been reached                                  | Número máximo de tentativas de validação de token atingida                           |
| 400                      | PXT000172            | Token Expired                                | Token has expired. Resend token or recreate transferToken has expired. Resend token or recreate transfer | Token expirado. Reenvie token ou recrie a transferência                              |
| 400                      | PXT000173            | Incorrect Token                              | Token sent does not match expected                                                                       | Token enviado não condiz com, o esperado                                             |

---

# Perform Pix Batch Transaction

URL: /en/documentation/baas/pix/batch/solicitacao_de_transacao_em_lote_pix

QI Tech offers the possibility of performing multiple Pix transactions with a single call. In this system, transactions are carried out asynchronously. If an **http status 4xx** is returned in the initial call, none of the transactions will be executed. After the request, the integrator partner will receive a webhook for each transaction informing the final status of the attempt, which can be **rejected** or **sent**.

## Request

ENDPOINT /account/ ACCOUNT_KEY /pix_transfer_batch
METHOD POST

```json
{
  "request_control_key": "6e4fc980-f8a1-4462-b6e2-d8a49f0ac055",
  "pix_transfers": [
    {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "pix_transfer_type": "key",
      "target_pix_key": "target_pix_key@email.com",
      "transaction_amount": 500.65,
      "end_to_end_id": "E73856642202309201429bZKfklNlbwu",
      "pix_message": "Hello World!"
    },
    {
      "request_control_key": "5fb20e2e-78e3-4ca7-bb36-515640ec2e78",
      "pix_transfer_type": "manual",
      "target_account": {
        "account_branch": "0001",
        "account_digit": "3",
        "account_number": "12345678",
        "owner_document_number": "32402502000135",
        "owner_name": "Qi Tech",
        "account_type": "checking_account",
        "ispb": "32402502"
      },
      "transaction_amount": 500.65,
      "pix_message": "Hello World!"
    },
    {
      "request_control_key": "10ad6e08-1a4c-403c-8122-178b0acf1dfa",
      "pix_transfer_type": "static_qr_code",
      "transaction_amount": 500.65,
      "end_to_end_id": "E73856642202309201429bZKfklNlbrb",
      "receiver_conciliation_id": "REC00000000000000000000009459463343",
      "target_pix_key": "target_pix_key@email.com",
      "pix_message": "Hello World!"
    }
  ]
}
```

## Path Params

| Field         | Type   | Description                              | Characters |
|---------------|--------|----------------------------------------|------------|
| `account_key` | uuidv4 | Unique identification key of the account. | 36         |

### Body Params

| Field                   | Type   | Description                                                                                           | Characters                                  |
|-------------------------|--------|-----------------------------------------------------------------------------------------------------|---------------------------------------------|
| `request_control_key` * | uuidv4 | Unique request identification key used by the client in uuid v4 format.                               | 36                                          |
| `pix_transfers` *       | array  | List of pix_transfer objects linked to the batch.                                                    | list of **[Object pix_transfer](#object-pix_transfer)** |

### Object pix_transfer

| Field                     | Type       | Description                                                                                                                      | Characters                                  |
|---------------------------|------------|----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------|
| `request_control_key` *   | uuidv4     | Unique request identification key used by the client in uuid v4 format.                                                          | 36                                          |
| `pix_transfer_type` *     | enumerator | Type of pix to be performed.                                                                                                     | **[Enumerator pix_transfer_type](#enumerator-pix_transfer_type)** |
| `target_pix_key`          | string     | Pix key of the account to which the transaction will be sent.                                                                    | 100                                         |
| `target_account`          | Object     | Destination account - Should only be sent in transfers with `pix_transfer_type` of type **manual**.                               | **[Object target_account](#object-target_account)**               |
| `receiver_conciliation_id`| string     | Receiver's conciliation identification.                                                                                          | 35                                          |
| `transaction_amount` *    | number     | Transfer amount.                                                                                                                 | 10                                          |
| `end_to_end_id`           | string     | Idempotency key of a Pix transaction within the SPI (Instant Payment System). This key is returned in the Pix key query. Should only be sent if the `pix_transfer_type` is **key**, **static_qr_code**, or **dynamic_qr_code** | 32   |
| `pix_message`             | string     | Message to be sent along with the Pix transfer.                                                                                  | 140                                         |

### Object target_account

| Field                      | Type       | Description                                                       | Characters                                  |
|----------------------------|------------|-------------------------------------------------------------------|---------------------------------------------|
| `account_branch` *         | string     | Branch of the account.                                            | 6                                           |
| `account_digit` *          | string     | Account digit.                                                    | 1                                           |
| `account_number` *         | string     | Account number.                                                   | 20                                          |
| `owner_document_number` *  | string     | CPF or CNPJ (numbers only) of the account holder.                 | 14                                          |
| `owner_name` *             | string     | Name of the account holder.                                       | 150                                         |
| `account_type` *           | enumerator | Type of account.                                                  | **[Enumerator account_type](#enumerator-account_type)** |
| `ispb` *                   | string     | Based on the financial institution's CNPJ (8 digits).             | 8                                           |

### Enumerator account_type

| Enumerator            | Description        |
|-----------------------|---------------------|
| **checking_account**  | Conta Corrente     |
| **salary_account**    | Conta Salário      |
| **saving_account**    | Conta Poupança     |
| **payment_account**   | Conta de Pagamentos|

### Enumerator pix_transfer_type

| Enumerator            | Description |
|-----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **manual**            | Pix using the destination account details. Required to send `target_account` |
| **key**               | Pix using a pix key. Required to send `target_pix_key`. Recommended to send `end_to_end_id` from the [Pix key query](/documentation/pix_indireto/movimentacoes/consultar_chave_pix) if it has been performed |
| **static_qr_code**    | Pix using a static QR code. Required to send the `end_to_end_id` returned in the [QR code decoding](/documentation/pix/decodificar_qr_code) |
| **dynamic_qr_code**   | Pix using a dynamic QR code. Required to send the `end_to_end_id` returned in the [QR code decoding](/documentation/pix/decodificar_qr_code) |

## Response

STATUS 201

Response Body: Batch Transfer Approved

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "pix_transfer_batch_status": "approved"
}
```

### Enumerator pix_transfer_batch_status

| Enumerator                | Description                                                              |
|---------------------------|--------------------------------------------------------------------------|
| **approved**              | Batch transfer approved and transactions in execution process.           |
| **rejected**              | Batch transfer rejected                                                  |
| **pending_2fa_approval**  | Batch transfer pending manual approval                                   |

STATUS 4xx

Response Body: Transfer Rejected

```json
{
  "title": "title",
  "description": "description in English",
  "translation": "description in Portuguese",
  "code": "code",
  "extra_fields": {
    "pix_transfer_batch_data": {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "pix_transfer_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "pix_transfer_batch_status": "rejected"
    }
  }
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "title",
  "description": "description in English",
  "translation": "description em Portuguese",
  "code": "code",
  "extra_fields": {}
}
```

:::info Information
The errors previously listed for [Pix transfer](/documentation/baas_v2/pix/realizar_transferencia) may be returned by this endpoint.
:::

---

# Perform batch Pix transaction with Two-Factor Authentication

URL: /en/documentation/baas/pix/batch/solicitacao_de_transacao_em_lote_pix_2fa

QI Tech offers the possibility to perform multiple Pix transactions with a single call. In this system, transactions are performed asynchronously. If a **http status 4xx** is returned on the initial call, none of the transactions will be executed. After the request, the integration partner will receive a webhook for each transaction informing the final status of the attempt, which can be **rejected** or **sent**.
In this type of transaction, payment confirmation via a token sent to the person with approval powers for movements in the creditor account is required.

The request for a Pix transaction by integration partners configured to use two-factor authentication is made similarly to what is described in [perform batch Pix transaction](/documentation/baas_v2/pix/batch/solicitacao_de_transacao_em_lote_pix). 
The difference is the addition of the `tfa_info` object, containing information about the transfer approver and the means of contact, and the status of a successful request, which will always be **pending_2fa_approval**.

The notification event for sending the `token` to the approver is **baas.token_validation.pix_transfer.batch**. It is possible to [customize](/documentation/notificacoes/template) the sent message.
## Request

ENDPOINT /account/ ACCOUNT_KEY /pix_transfer_batch
METHOD POST

## Authentication via Email and SMS

Request Body: Batch Transfer with TFA via SMS or Email

```json
{
  "request_control_key": "6e4fc980-f8a1-4462-b6e2-d8a49f0ac055",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  },
  "pix_transfers": [
    {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "pix_transfer_type": "key",
      "target_pix_key": "target_pix_key@email.com",
      "transaction_amount": 500.65,
      "end_to_end_id": "E73856642202309201429bZKfklNlbwu",
      "pix_message": "Ola Mundo"
    },
    {
      "request_control_key": "5fb20e2e-78e3-4ca7-bb36-515640ec2e78",
      "pix_transfer_type": "manual",
      "target_account": {
        "account_branch": "0001",
        "account_digit": "3",
        "account_number": "12345678",
        "owner_document_number": "32402502000135",
        "owner_name": "Qi Tech",
        "account_type": "checking_account",
        "ispb": "32402502"
      },
      "transaction_amount": 500.65,
      "pix_message": "Ola Mundo"
    },
    {
      "request_control_key": "10ad6e08-1a4c-403c-8122-178b0acf1dfa",
      "pix_transfer_type": "static_qr_code",
      "transaction_amount": 500.65,
      "end_to_end_id": "E73856642202309201429bZKfklNlbrb",
      "receiver_conciliation_id": "REC00000000000000000000009459463343",
      "target_pix_key": "target_pix_key@email.com",
      "pix_message": "Ola Mundo"
    }
  ]
}
```

## Authentication via Device

In addition to the existing authentication methods via **sms** and **email**, it is possible to authenticate the transaction using a previously [registered device](/documentation/baas/dispositivo/create/solicitacao_cadastro_dispositivo). In this case, the `session_id` must be obtained in the **Device Scan** and sent in `tfa_info`.

Request Body: Batch Transfer with TFA via Device

```json
{
  "request_control_key": "6e4fc980-f8a1-4462-b6e2-d8a49f0ac055",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "session_id": "b2f18d3a-67c2-4a7f-98e5-1d3f5c6b8a72",
    "contact_type": "device"
  },
  "pix_transfers": [
    {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "pix_transfer_type": "key",
      "target_pix_key": "target_pix_key@email.com",
      "transaction_amount": 500.65,
      "end_to_end_id": "E73856642202309201429bZKfklNlbwu",
      "pix_message": "Ola Mundo"
    },
    {
      "request_control_key": "5fb20e2e-78e3-4ca7-bb36-515640ec2e78",
      "pix_transfer_type": "manual",
      "target_account": {
        "account_branch": "0001",
        "account_digit": "3",
        "account_number": "12345678",
        "owner_document_number": "32402502000135",
        "owner_name": "Qi Tech",
        "account_type": "checking_account",
        "ispb": "32402502"
      },
      "transaction_amount": 500.65,
      "pix_message": "Ola Mundo"
    },
    {
      "request_control_key": "10ad6e08-1a4c-403c-8122-178b0acf1dfa",
      "pix_transfer_type": "static_qr_code",
      "transaction_amount": 500.65,
      "end_to_end_id": "E73856642202309201429bZKfklNlbrb",
      "receiver_conciliation_id": "REC00000000000000000000009459463343",
      "target_pix_key": "target_pix_key@email.com",
      "pix_message": "Ola Mundo"
    }
  ]
}
```

## Path Params
| Field          | Type   | Description                               | Characters |
|--------------- |--------|-------------------------------------------|------------|
| `account_key`  | uuidv4 | Unique account identification key.        | 36         |

### Body Params
| Field                | Type   | Description                                                                           | Characters                                |
|----------------------|--------|---------------------------------------------------------------------------------------|-------------------------------------------|
| `request_control_key` * | uuidv4 | Unique identification key for the request used by the client in uuid v4 format.      | 36                                        |
| `pix_transfers` *    | array  | List of pix_transfer objects linked to the batch.                                      | list of **[Object pix_transfer](#object-pix_transfer)** |
| `tfa_info` *         | Object | Object containing the document of the account approver and the means of contact.       | **[Object tfa_info](#object-tfa_info)**   |

### Object tfa_info
| Field                        | Type   | Description                                                                                   | Characters |
|------------------------------|--------|-----------------------------------------------------------------------------------------------|------------|
| `approver_document_number` * | string | Document number of the account approver.                                                      | 11         |
| `session_id`                 | string | Unique device session identification key in UUID v4 format (required for device TFA).         | 36         |
| `contact_type` *             | string | Means of contact with the account approver, can be **sms**, **email** or **device**           |            |

### Object pix_transfer
| Field                | Type      | Description                                                                                                            | Characters                                 |
|----------------------|-----------|------------------------------------------------------------------------------------------------------------------------|--------------------------------------------|
| `request_control_key` * | uuidv4    | Unique identification key for the request used by the client in uuid v4 format.                                          | 36                                         |
| `pix_transfer_type` * | enumerator| Type of the pix to be performed.                                                                                        | **[Enumerator pix_transfer_type](#enumerator-pix_transfer_type)** |
| `target_pix_key`     | string    | Pix key of the account to which the transaction will be sent.                                                           | 100                                        |
| `target_account`     | Object    | Destination account - Should only be sent for transfers with `pix_transfer_type` of type **manual**.                       | **[Object target_account](#object-target_account)** |
| `receiver_conciliation_id` | string | Reconciliation ID of the receiver.                                                                                      | 35                                         |
| `transaction_amount` *| number   | Transfer amount.                                                                                                        | 10                                         |
| `end_to_end_id`      | string    | Idempotency key for a Pix transaction within the SPI (Instant Payment System). This key is returned in Pix key queries. Should only be sent if `pix_transfer_type` is **key**, **static_qr_code**, or **dynamic_qr_code**. | 32                                         |
| `pix_message`        | string    | Message to be sent along with the Pix transfer.                                                                         | 140                                        |

### Object target_account
| Field                   | Type      | Description                                                                                                             | Characters                                 |
|-------------------------|-----------|-------------------------------------------------------------------------------------------------------------------------|--------------------------------------------|
| `account_branch` *      | string    | Account branch.                                                                                                          | 6                                          |
| `account_digit` *       | string    | Account digit.                                                                                                           | 1                                          |
| `account_number` *      | string    | Account number.                                                                                                          | 20                                         |
| `owner_document_number` * | string | CPF or CNPJ (numbers only) of the account holder.                                                                        | 14                                         |
| `owner_name` *          | string    | Name of the account holder.                                                                                              | 150                                        |
| `account_type` *        | enumerator| Account type.                                                                                                            | **[Enumerator account_type](#enumerator-account_type)** |
| `ispb` *                | string    | Based on the CNPJ of the financial institution (8 digits).                                                             | 8                                          |

### Enumerator account_type
| Enumerator             | Description               |
|-----------------------|----------------------------|
| **checking_account**  | Checking Account           |
| **salary_account**    | Salary Account             |
| **saving_account**    | Savings Account            |
| **payment_account**   | Payment Account            |

### Enumerator pix_transfer_type
| Enumerator             | Description                                                                          |
|------------------------|--------------------------------------------------------------------------------------|
| **manual**             | Pix using destination account details. Must send `target_account`.                    |
| **key**                | Pix using a pix key. Must send `target_pix_key`. Recommended to send `end_to_end_id` from the [pix key query](/documentation/pix_indireto/movimentacoes/consultar_chave_pix) if previously performed |
| **static_qr_code**     | Pix using a static QR code. Must send the `end_to_end_id` returned in the [QR code decode](/documentation/pix/decodificar_qr_code) |
| **dynamic_qr_code**    | Pix using a dynamic QR code. Must send the `end_to_end_id` returned in the [QR code decode](/documentation/pix/decodificar_qr_code) |
## Response

STATUS 201

Response Body: Batch Transfer Requested

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "pix_transfer_batch_status": "pending_2fa_approval"
}
```

### Enumerador pix_transfer_batch_status
| Enumerator               | Description                                                       |
|--------------------------|-------------------------------------------------------------------|
| **approved**             | Batch transfer approved and transactions in the process of execution. |
| **rejected**             | Batch transfer rejected                                          |
| **pending_2fa_approval** | Batch transfer pending manual approval                           |

STATUS 4xx

Response Body: Transfer rejected

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in portuguese",
  "code": "codigo",
  "extra_fields": {
    "pix_transfer_batch_data": {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "pix_transfer_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "pix_transfer_batch_status": "rejected"
    }
  }
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

:::info Informação
Os erros anteriormente listados para [transferência Pix](/documentation/baas_v2/pix/realizar_transferencia) são
passiveis de serem retornados por este endpoint além dos erros listados abaixo.
:::

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                 | Description (eng)<br/>`description`                                     | Description (ptbr)<br/>`translation`                               |
|--------------------------|----------------------|------------------------------------|-----------------------------------------------------------------------|------------------------------------------------------------------|
| 400                      | PXT000168            | No approver permission             | Given document number does not belong to an approver for this account | Número de documento enviado não pertence a um aprovador da conta |
| 400                      | PXT000169            | tfa_info is required               | Client must send object tfa_info                                      | Cliente deve enviar objeto tfa_info                              |
| 400                      | PXT000170            | Error occurred while sending token | An unexpected error occurred while sending token                      | Um erro inexperado ocorreu ao tentar enviar token                |

---

# Consult Pix Key Data at the Central Bank

URL: /en/documentation/baas/pix/consultar_chave_pix

## Request

ENDPOINT /pix_key/ PIX_KEY
METHOD GET

### Request Path Params

| Field       | Type   | Description                    | Characters |
|-------------|--------|--------------------------------|------------|
| `pix_key` * | string | Pix Key to be queried.         | 77         |

:::info Types of Pix Key
The “pix_key” can be a CPF, CNPJ, Email, Mobile Number, or a Random Key (UUID), following these formats:
**CPF**: Integer number with 11 digits.
**CNPJ**: Integer number with 14 digits.
**Email**: Text containing at least one “@”.
**Mobile Number**: Text containing the following values: “+55” + “Cell Phone Area Code“ + “Cell Phone Number with a minimum of 8 and a maximum of 9 digits”. Example: “+5511987654321“.
**Random Key**: UUID4.
:::

### Request Query Params

| Field              | Type   | Description                                                                                                                                  | Characters |
|--------------------|--------|----------------------------------------------------------------------------------------------------------------------------------------------|------------|
| `account_key` *    | uuidv4 | Unique identification key of the account.                                                                                                    | 36         |
| `document_number`  | string | CPF/CNPJ of the Pix Key holder. By passing this parameter, the field `is_pix_key_owner` will be returned with a boolean value indicating whether the CPF/CNPJ provided matches the Pix Key holder's. | 14 or 11   |

:::info Usage of Query Tokens
To charge the Pix key query token from the account holder, it is mandatory to send the `account_key`.
If the account_key is not sent, the token will be charged from the document number of the integrator partner.
:::

## Response

STATUS 200

Response Body: Active Key

```json
{
  "account_branch": "452",
  "account_created_at": "2021-10-22T20:30.459Z",
  "account_digit": "1",
  "account_number": "370158",
  "account_type": "checking_account",
  "bank_code": "237",
  "end_to_end_id": "E3240250220230404185631R0kjZnC6G",
  "financial_institution": "BCO BRADESCO S.A.",
  "is_pix_key_owner": false,
  "ispb": "60746948",
  "owner_masked_document_number": "***.141.857-**",
  "owner_name": "Teste teste",
  "owner_person_type": "legal",
  "owner_trading_name": "Teste LTDA.",
  "pix_key": "teste@gmail.com"
}
```

| Field                         | Type    | Description                                                                                                                                                              | Max. Characters |
|-------------------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------|
| `account_branch`              | string  | Account branch linked to the Pix Key, without the check digit.                                                                                                            | 4               |
| `account_created_at`          | string  | Account opening date linked to the Pix Key, provided by the custodian institution of the account.                                                                         | 21              |
| `account_digit`               | string  | Check digit of the account linked to the Pix Key.                                                                                                                         | 1               |
| `account_number`              | string  | Account number linked to the Pix Key without the check digit.                                                                                                             | 20              |
| `account_type`                | enum    | Definition of the account type of the Pix Key.                                                                                                                            | [Enumerators Account Type](#enumerators-account_type) |
| `bank_code`                   | string  | Bank code of the Pix Key registrar. May be null for institutions that do not have a bank code.                                                                            | 3               |
| `end_to_end_id`               | string  | Unique identifier of the Pix key query at Bacen. Must be sent in the Pix transfer so that the token consumed in the query can be recovered.                                | 32              |
| `financial_institution`       | string  | Name of the financial institution registering the Pix Key.                                                                                                                | 200             |
| `is_pix_key_owner`            | boolean | A boolean value will be returned if the `document_number` parameter is passed in the request. This field indicates whether the CPF/CNPJ provided in the `document_number` parameter matches the Pix Key holder. It will return null if the `document_number` parameter is not provided. | -               |
| `ispb`                        | string  | ISPB of the Participant holding the Pix Key.                                                                                                                              | 8               |
| `owner_masked_document_number`| string  | Masked CPF number or CNPJ of the Pix Key holder.                                                                                                                          | 14              |
| `owner_name`                  | string  | Name of the Pix Key holder.                                                                                                                                               | 120             |
| `owner_person_type`           | enum    | Legal nature of the Pix Key holder.                                                                                                                                       | [Enumerators Owner Person Type](#enumerators-owner_person_type) |
| `owner_trading_name`          | string  | Trade name of the Pix Key holder (only for `owner_person_type=legal`).                                                                                                    | 100             |
| `pix_key`                     | string  | Pix Key.                                                                                                                                                                  | -               |

### Enumerators account_type

| Enumerator          | Description         |
|---------------------|---------------------|
| `payment`           | Conta de pagamento  |
| `checking`          | Conta de corrente   |
| `savings`           | Conta poupança      |
| `saving`            | Conta poupança      |
| `salary`            | Conta salário       |
| `saving_account`    | Conta poupança      |
| `payment_account`   | Conta de pagamento  |
| `checking_account`  | Conta de corrente   |
| `salary_account`    | Conta salário       |
| `escrow`            | Conta Vinculada     |

:::info
Different enumerators can mean the same type of account due to the information returned by different institutions.
:::

### Enumerators owner_person_type

| Enumerator | Description |
|------------|-----------|
| `natural`  | string    |
| `legal`    | string    |

STATUS 4XX

Response Body

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in Portuguese",
  "code": "code"
}
```

| HTTP Code   | QI Code<br/>`code`   | Title<br/>`title`                | Description (eng)<br/>`Description`                                     | Description (ptbr)<br/>`translation`                                   |
|-------------|----------------------|----------------------------------|------------------------------------------------------------------------|--------------------------------------------------------------------------|
| 404         | PIX000017            | Pix Key Not Found                | Pix key \{pix_key\} not found.                                         | A chave pix \{pix_key\} não foi encontrada.                             |
| 403         | PIX000080            | Not enough permission            | The selected agent doesn't have permission to access this resource.    | O agente selecionado não tem permissão para acessar este recurso.       |
| 429         | PIX000081            | Rate Limit Exceeded              | Rate Limit Exceeded                                                    | Limite de requisições excedido                                          |
| 404         | PIX000083            | Pix Key not found                | Pix Key \{pix_key\} not found for Alias \{alias_key\}                  | Chave Pix \{pix_key\} não encontrada para o Alias \{alias_key\}         |
| 400         | PIX000084            | Only one query param allowed     | Only one query param allowed                                           | Somente um parâmetro de consulta é permitido                            |

---

# Consult transfers

URL: /en/documentation/baas/pix/consultar_transferencias

## Consult Pix Transaction by pix_transfer_key

### Request

ENDPOINT /account/ ACCOUNT_KEY /pix_transfer/ PIX_TRANSFER_KEY / PIX_TRANSFER_DIRECTION
METHOD GET

### Path Params

| Field                      | Type       | Description                                                  | Characters                                                           |
|----------------------------|------------|--------------------------------------------------------------|----------------------------------------------------------------------|
| `pix_transfer_direction` * | enumerator | Indicator of the transaction direction (inbound or outbound).| [Enumerators pix_transfer_direction](#enumerators-pix_transfer_direction) |
| `account_key` *            | uuidv4     | Unique identification key of the QI account.                 | 36                                                                   |
| `pix_transfer_key` *       | uuidv4     | Unique identification key of the Pix transfer.               | 36                                                                   |

### Enumerators pix_transfer_direction

| Enumerator   | Description                    |
|--------------|--------------------------------|
| **incoming** | Inbound Pix transfer           |
| **outgoing** | Outbound Pix transfer          |

### Response

STATUS 201

Response Body: Transfer Sent (outgoing)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_message": "Good sunshine!",
  "pix_transfer_type": "manual",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "updated_at": "2021-10-22T20:30:23.459Z",
  "created_at": "2021-10-22T20:30:23.459Z",
  "target_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "12345678",
    "owner_document_number": "***02502000***",
    "owner_person_type": "legal",
    "owner_name": "Qi Tech",
    "account_type": "checking_account",
    "ispb": "32402502",
    "financial_institution_name": "QI SCD",
    "pix_key": null
  },
  "receiver_conciliation_id": null,
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "end_to_end_id": "E3240250220211022203051750897529",
  "pix_transfer_status": "sent",
  "transfer_amount": 126.97,
  "fee_amount": 0.0,
  "rejection_reason": null,
  "reversals": [
    {
      "end_to_end_id": "D35713491202309182058jlqdBkkHSWU",
      "transfer_amount": 0.01,
      "reversal_reason": "client_request",
      "pix_transfer_status": "received",
      "pix_transfer_key": "423866cd-0f3f-4cdd-904b-0d2e33273afd",
      "request_control_key": "7c5a1425-73eb-420e-b4fb-0ce3386c7d0a",
      "created_at": "2021-10-23T20:30.459Z"
    }
  ]
}

```

Response Body: Transfer Rejected (outgoing)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_message": "Good morning!",
  "pix_transfer_type": "manual",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "updated_at": "2021-10-22T20:30:23.459Z",
  "created_at": "2021-10-22T20:30:23.459Z",
  "target_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "12345678",
    "owner_document_number": "***02502000***",
    "owner_person_type": "legal",
    "owner_name": "Qi Tech",
    "account_type": "checking_account",
    "ispb": "32402502",
    "pix_key": null
  },
  "receiver_conciliation_id": null,
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "end_to_end_id": "E3240250220211022203051750897529",
  "pix_transfer_status": "rejected",
  "transfer_amount": 126.97,
  "fee_amount": 0.0,
  "error_code": "PXT000132",
  "error_description": "Target account number is invalid.",
  "error_translation": "Número da conta de destino é inexistente ou inválido.",
  "reversals": []
}

```

Response Body: Refund Sent (outgoing)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_message": "Good morning",
  "pix_transfer_type": "reversal",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "updated_at": "2021-10-22T20:30:23.459Z",
  "created_at": "2021-10-22T20:30:23.459Z",
  "target_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "12345678",
    "owner_document_number": "***02502000***",
    "owner_person_type": "legal",
    "owner_name": "Qi Tech",
    "account_type": "checking_account",
    "ispb": "32402502",
    "pix_key": null
  },
  "receiver_conciliation_id": null,
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "end_to_end_id": "E3240250220211022203051750897529",
  "pix_transfer_status": "sent",
  "transfer_amount": 126.97,
  "fee_amount": 0.0,
  "rejection_reason": null,
  "reversals": [],
  "original_incoming_pix_transfer": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3"
}

```

Response Body: Transfer Received (incoming)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "end_to_end_id": "E18236120202308111235s14fddf2801",
  "pix_transfer_status": "received",
  "receiver_conciliation_id": "745c28c780bc4822bbade86dd875d10b",
  "transfer_amount": 126.97,
  "fee_amount": 0.0,
  "source_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "12345678",
    "owner_document_number": "***02502000***",
    "owner_person_type": "legal",
    "owner_name": "Qi Tech",
    "account_type": "checking_account",
    "ispb": "32402502"
  },
  "pix_transfer_type": "dynamic_qr_code",
  "reversals": []
}
```

Response Body: Refund Received (incoming)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "end_to_end_id": "E18236120202308111235s14fddf2801",
  "pix_transfer_status": "received",
  "receiver_conciliation_id": "745c28c780bc4822bbade86dd875d10b",
  "transfer_amount": 126.97,
  "fee_amount": 0.0,
  "source_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "12345678",
    "owner_document_number": "***02502000***",
    "owner_person_type": "legal",
    "owner_name": "Qi Tech",
    "account_type": "checking_account",
    "ispb": "32402502"
  },
  "pix_transfer_type": "reversal",
  "reversals": [],
  "original_outgoing_pix_transfer": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3"
}
```

Response Body: Transfer Rejected (incoming)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "end_to_end_id": "E18236120202308111235s14fddf2801",
  "pix_transfer_status": "rejected",
  "receiver_conciliation_id": "745c28c780bc4822bbade86dd875d10b",
  "transfer_amount": 126.97,
  "fee_amount": 0.0,
  "source_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "12345678",
    "owner_document_number": "***02502000***",
    "owner_person_type": "legal",
    "owner_name": "Qi Tech",
    "account_type": "checking_account",
    "ispb": "32402502"
  },
  "pix_transfer_type": "dynamic_qr_code",
  "reversals": []
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "title",
  "description": "description in English",
  "translation": "description in Portuguese",
  "code": "code",
  "extra_fields": {}
}
```

| HTTP Code   | QI Code<br/>`code`              | Title<br/>`title`                          | Description (eng)<br/>`Description`                    | Description (ptbr)<br/>`translation`                                  |
|-------------|--------------------------------|-------------------------------------------|-----------------------------------------------------|--------------------------------------------------------------------------|
| 400         | PXT000075                      | Pix Transfer Key or End To End Not Provided | No pix transfer key or end to end id provided.        | Não foram fornecidos uma pix transfer key ou end to end id.              |
| 404         | PXT000023                      | Outgoing PIX Transfer Not Found           | Pix transfer key \{pix_transfer_key\} was not found  | Transferência PIX de saída com chave \{pix_transfer_key\} não foi encontrada. |
| 403         | PIT000001                      | User is not allowed to do this transaction | User is not allowed to do this transaction           | Usuário não tem autorização para fazer essa transação                  |

---

# Error Table for Pix Transfer

URL: /en/documentation/baas/pix/erros_de_pix

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Status Code | Error Code | Title                                                                   | Description                                                                                                                                                                                          | Translation                                                                                                                                                                                                                                 |
|------------------|------------|-------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 500              | QIT000500  | Internal Error                                                          | An internal error has occurred and its being investigated                                                                                                                                            | Um erro interno aconteceu e está sendo investigado                                                                                                                                                                                          |
| 404              | QIT000404  | Bad Request                                                             | The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible                                                                      | O recurso solicitado não pôde ser encontrado, mas pode estar disponível no futuro. Requests subsequentes do cliente são permitidos                                                                                                          |
| 400              | QIT000400  | Bad Request                                                             | The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, size too large, invalid request message framing, or deceptive request routing)    | O servidor não pode ou não processará a requisição devido a um erro do cliente (por exemplo, sintaxe de requisição malformada, tamanho muito grande, enquadramento de mensagem de requisição inválida ou roteamento de requisição enganoso) |
| 753              | QIT000753  | Syntax Error                                                            | Malformed JSON. Could not decode the request body. The JSON was incorrect, empty or not encoded as UTF-8                                                                                             | JSON malformado. Não foi possível decodificar o corpo da requisição. O JSON estava incorreto, vazio ou não foi codificado como UTF-8                                                                                                        |
| 400              | QIT000001  | Bad Request                                                             | (custom)                                                                                                                                                                                             | Payload Inválido                                                                                                                                                                                                                            |
| 403              | QIT000002  | Permission Validator Error                                              | Request must be internal                                                                                                                                                                             | Request deve ser interna                                                                                                                                                                                                                    |
| 403              | QIT000003  | Permission Validator Error                                              | Request must be from a master user                                                                                                                                                                   | Request deve ser de usuário master                                                                                                                                                                                                          |
| 403              | PIT000001  | User is not allowed to do this transaction                              | User is not allowed to do this transaction                                                                                                                                                           | Usuário não tem autorização para fazer essa transação                                                                                                                                                                                       |
| 400              | PIT000003  | Bad Request                                                             | Insufficient account balance for transfer and fee amount                                                                                                                                             | Saldo de conta insuficiente para a transação e a taxa                                                                                                                                                                                       |
| 400              | PIT000004  | Bad Request                                                             | Transaction amount is over limit                                                                                                                                                                     | O total da transação é superior ao limite                                                                                                                                                                                                   |
| 404              | PIX000056  | Not Found                                                               | Pix key inquiry not found                                                                                                                                                                            | Consulta de chave pix não encontrada                                                                                                                                                                                                        |
| 400              | PXT000002  | Person is not Account Owner                                             | Person \{person_key\} is not account owner                                                                                                                                                           | A pessoa \{person_key\} não é dona da conta                                                                                                                                                                                                 |
| 400              | PXT000003  | Account is Closed                                                       | Account \{account_key\} is closed                                                                                                                                                                    | Conta \{account_key\} está fechada                                                                                                                                                                                                          |
| 404              | PXT000004  | Account not found                                                       | Account not found for: \{account_datum\}                                                                                                                                                             | Conta não encontrada para: \{account_datum\}                                                                                                                                                                                                |
| 404              | PXT000005  | Account not found                                                       | Account not found for pix key: \{pix_key\}                                                                                                                                                           | Conta não encontrada para chave pix: \{pix_key\}                                                                                                                                                                                            |
| 400              | PXT000006  | Account not found                                                       | Account was not provided for this query                                                                                                                                                              | Chave de identificação da conta não foi fornecida                                                                                                                                                                                           |
| 403              | PXT000008  | Invalid Permission                                                      | Person \{person_key\} does not have administration roles for account \{account_key\}                                                                                                                 | Pessoa \{person_key\} não tem permissões de administrador para a conta \{account_key\}                                                                                                                                                      |
| 404              | PXT000009  | Person Not Found                                                        | Person with document number \{person_document_number\} not found                                                                                                                                     | Pessoa com número de documento \{person_document_number\} não encontrada                                                                                                                                                                    |
| 400              | PXT000010  | Account is Blocked                                                      | Account \{account_key\} is blocked                                                                                                                                                                   | Conta \{account_key\} está bloqueada                                                                                                                                                                                                        |
| 400              | PXT000011  | Account Type Mismatch                                                   | Given account type does not match one registered                                                                                                                                                     | O tipo de conta fornecido não condiz com o registrado                                                                                                                                                                                       |
| 400              | PXT000012  | Invalid Document Number                                                 | Given \{document_number\} document number is invalid                                                                                                                                                 | CPF/CNPJ \{document_number\} fornecido não é válido                                                                                                                                                                                         |
| 400              | PXT000013  | Account Validation Failure                                              | Account validation for received end_to_end_id is not valid                                                                                                                                           | Validação da conta para o end_to_end_id recebido não é válida                                                                                                                                                                               |
| 400              | PXT000014  | Target Account mismatch                                                 | Received target account data doesn't match validated account                                                                                                                                         | Dados da conta de destino recebida não corresponde à conta validada                                                                                                                                                                         |
| 400              | PXT000015  | Reversal date expired                                                   | Reversal original transaction is older than 90 days                                                                                                                                                  | A data de criação da transação original é mais antiga que 90 dias                                                                                                                                                                           |
| 400              | PXT000016  | Reversal Account Flow Mismatch                                          | Reversal account flow does not match original pix transfer's                                                                                                                                         | O fluxo de contas de destino e de origem não correspondem ao da transação original                                                                                                                                                          |
| 400              | PXT000017  | Reversal Too Great                                                      | Reversal transfers sum amount surpasses that of original pix transfer                                                                                                                                | A soma das transações de devolução ultrapassam o valor da transação pix original                                                                                                                                                            |
| 404              | PXT000018  | Reversal Original Transfer not Found                                    | Reversal original pix transfer not found                                                                                                                                                             | Transferência original da devolução não foi encontrada                                                                                                                                                                                      |
| 400              | PXT000019  | Chargeback Validation Failure                                           | Previously done validation values do match with incoming chargeback                                                                                                                                  | Os valores da atual devolução não correspondem com aqueles das validação                                                                                                                                                                    |
| 404              | PXT000020  | Incoming PIX Validation Not Found                                       | No previously done validation was found for given end to end id                                                                                                                                      | Não se encontrou validação anterior para o id ponta-a-ponta provido                                                                                                                                                                         |
| 400              | PXT000021  | Incoming Validation Already Done                                        | There's an existing validation for end to end id \{end_to_end_id\}                                                                                                                                   | A validação para o id ponta a ponta \{end_to_end_id\} já foi feita                                                                                                                                                                          |
| 400              | PXT000022  | Wrong ISPB                                                              | ISPB is different from 32402502                                                                                                                                                                      | ISPB é diferente de 32402502                                                                                                                                                                                                                |
| 404              | PXT000023  | Outgoing PIX Transfer Not Found                                         | Pix transfer key \{pix_transfer_key\} was not found                                                                                                                                                  | Transferência PIX de saída com chave \{pix_transfer_key\} não foi encontrada                                                                                                                                                                |
| 400              | PXT000024  | PIX Transfer Not Pending Confirmation                                   | Pix transfer \{pix_transfer_key\} is not pending confirmation                                                                                                                                        | Transferência PIX \{pix_transfer_key\} não está aguardando confirmação                                                                                                                                                                      |
| 400              | PXT000025  | Invalid pix transfer key                                                | Pix transfer \{pix_transfer_key\} is not pending confirmation or does not exist                                                                                                                      | Transferência PIX \{pix_transfer_key\} não está aguardando confirmação ou não existe                                                                                                                                                        |
| 400              | PXT000025  | Outgoing PIX Transfer Beyond of Transaction Limit                       | Pix transfer value R$ \{transfer_amount\} beyond of transaction limit R$ \{transaction_limit\}                                                                                                       | Transferência PIX valor R$ \{transfer_amount\} além do limite R$ \{transaction_limit\}                                                                                                                                                      |
| 400              | PXT000026  | Search Params Error                                                     | Invalid integer value for page or size querystring parameters                                                                                                                                        | Valor inválido para parâmetros de página ou tamanho de página                                                                                                                                                                               |
| 403              | PXT000027  | Invalid Permission                                                      | Selected Person does not have administration roles                                                                                                                                                   | Pessoa selecionada não tem credencial de administrador                                                                                                                                                                                      |
| 400              | PXT000028  | Account Key can not be null when search for config fees                 | Account key can not be null when search for config fees                                                                                                                                              | A chave de conta não pode ser nula quando buscar por configurações de tarifa                                                                                                                                                                |
| 400              | PXT000029  | Invalid Value for Enumerator Type                                       | Invalid value \{value\} used for enumerator type \{enumerator\}                                                                                                                                      | Valor inválido \{value\} para o tipo de enumerador \{enumerator\}                                                                                                                                                                           |
| 400              | PXT000030  | To update or delete a fee configuration must be provided a valid fee ID | To update or delete a fee configuration must be provided a valid fee ID. ID provided: \{identification\}                                                                                             | Para atualizar ou remover uma configuração de tarifa deve ser fornecido um ID válido. ID fornecido: \{identification\}                                                                                                                      |
| 400              | PXT000031  | Fee configuration already exists                                        | Fee configuration already exists for \{person_owner_type\} account with: purpose= \{purpose\} and \{transfer_type\}. Please use update                                                               | Configuração de tarifa já existe para conta \{person_owner_type\} com: finalidade= \{purpose\} e \{transfer_type\}. Por favor utilize o update                                                                                              |
| 400              | PXT000032  | Unable To Delete Default Configuration                                  | Unable To Delete Default Configuration. Please use update                                                                                                                                            | Não é permitido deletar uma configuração default. Por favor utilize o update                                                                                                                                                                |
| 400              | PXT000033  | Target Account Must Not Be Source Account                               | Target Account Must Not Be Source Account                                                                                                                                                            | A conta de destino não pode ser a conta de origem                                                                                                                                                                                           |
| 400              | PXT000034  | Account Key Must Not Be Null                                            | You Need To Define An Account Key To Create A Fee Configuration                                                                                                                                      | É necessário definir uma chave de conta para definir uma configuração de tarifa para a mesma                                                                                                                                                |
| 400              | PXT000035  | Limit configuration already exists                                      | Limit configuration already exists for \{account_key\} account for period(s) \{existing_limit_periods\}. Please use update                                                                           | Configuração de limite já existe para conta \{account_key\} para o período(s) \{existing_limit_periods\}. Por favor utilize o update                                                                                                        |
| 400              | PXT000036  | No limit configuration found. Please set default configurations         | No limit configuration found. Please set default configurations for \{person_type\} person                                                                                                           | Não foi possível encontrar configurações de limite, favor utilizar configurações padrões para \{person_type\}                                                                                                                               |
| 404              | PXT000037  | Person Not Found                                                        | Person with key \{person_key\} not found                                                                                                                                                             | Pessoa com chave \{person_key\} não encontrada                                                                                                                                                                                              |
| 400              | PXT000038  | Not enough balance                                                      | Not enough balance to pay for incoming pix fee                                                                                                                                                       | Saldo insuficiente para pagar por tarifa de pix de entrada                                                                                                                                                                                  |
| 400              | PXT000039  | Invalid Batch Limit Configuration                                       | Received \{counter_config\} wrong configuration(s) for accounts: \{account_keys\}. Configurations must be None or positive float                                                                     | Recebido \{counter_config\} configuração(ões) erradas para contas: \{account_keys\}. Configurações devem ser None ou float positivo                                                                                                         |
| 400              | PXT000040  | Bad Request                                                             | Amount limit must be null, positive float or int. Sent \{limit\}                                                                                                                                     | Limite deve ser nulo, positivo inteiro ou decimal. Sent \{limit\}                                                                                                                                                                           |
| 404              | PXT000041  | Not Found                                                               | Qr Code not found                                                                                                                                                                                    | Qr Code não encontrado                                                                                                                                                                                                                      |
| 400              | PXT000042  | Bad Request                                                             | There is no ISPB number for this Bank Code                                                                                                                                                           | Não existe código ISPB para esse Bank Code                                                                                                                                                                                                  |
| 400              | PXT000043  | Bad Request                                                             | Invalid decimal amount, sent \{number\}                                                                                                                                                              | Valor decimal inválido, enviado \{number\}                                                                                                                                                                                                  |
| 404              | PXT000044  | Not Found                                                               | Pix Key \{pix_key\} is not activated                                                                                                                                                                 | Chave PIX \{pix_key\} não está ativada                                                                                                                                                                                                      |
| 404              | PXT000045  | Not Found                                                               | QR Code Payment is invalid for Receiver Conciliation ID \{receiver_conciliation_id\}                                                                                                                 | Pagamento via QR Code é inválido para Cliente Recebedor \{receiver_conciliation_id\}                                                                                                                                                        |
| 403              | PXT000046  | Invalid Permission                                                      | Only Master can change resource configuration                                                                                                                                                        | Apenas o Administrador pode alterar as configurações do recurso                                                                                                                                                                             |
| 400              | PXT000047  | Bad Request                                                             | \{field_name\} could not be larger than \{max_length\} characters                                                                                                                                    | \{field_name\} não pode ser maior que \{max_length\} caracteres                                                                                                                                                                             |
| 400              | PXT000048  | Bad Request                                                             | Emoji not allowed in pix message                                                                                                                                                                     | Emoji não é permitido na mensagem pix                                                                                                                                                                                                       |
| 400              | PXT000049  | Bad Request                                                             | When paying QR Code end_to_end_id could not be none                                                                                                                                                  | Ao pagar um QR Code o end_to_end_id não pode ser nulo                                                                                                                                                                                       |
| 400              | PXT000050  | Bad Request                                                             | Could not read QR Code type, please try to read qr_code again                                                                                                                                        | Não foi possível ler o tipo de QR Code. Favor tente ler o qr_code outra vez                                                                                                                                                                 |
| 400              | PXT000051  | Invalid Requester Configuration Info                                    | The configuration \{configuration\} format sent is not valid                                                                                                                                         | O formato enviado da configuração \{configuration\} não é válido                                                                                                                                                                            |
| 400              | PXT000052  | Bad Request                                                             | Only Master QI Tech can change default limits configurations                                                                                                                                         | Apenas o Master QI Tech pode alterar as configurações de limites padrões                                                                                                                                                                    |
| 400              | PXT000053  | Bad Request                                                             | QrCode already paid                                                                                                                                                                                  | Qr Code já Pago                                                                                                                                                                                                                             |
| 400              | PXT000054  | Bad Request                                                             | Invalid Pix Key, sent \{pix_key\}                                                                                                                                                                    | Chave pix inválida, enviado \{pix_key\}                                                                                                                                                                                                     |
| 400              | PXT000055  | Pix error                                                               | Invalid Limit Type Sent                                                                                                                                                                              | Tipo inválido de limite enviado                                                                                                                                                                                                             |
| 400              | PXT000056  | Bad Request                                                             | Only Master QI Tech can handle limit events                                                                                                                                                          | Apenas o Master QI Tech pode alterar eventos de limites                                                                                                                                                                                     |
| 400              | PXT000057  | Bad Request                                                             | Invalid request_key or no request found, request_key sent \{request_key\}                                                                                                                            | Requisição inválida ou requisição não encontrada, requisição enviada \{request_key\}                                                                                                                                                        |
| 400              | PXT000058  | Bad Request                                                             | When limit request is rejected, rejected reason could not be null                                                                                                                                    | Quando uma requisição de limite é rejeitada, o motivo não pode ser nulo                                                                                                                                                                     |
| 400              | PXT000059  | Bad Request                                                             | Target document number is not account owner document number                                                                                                                                          | O documento informado não é o mesmo da conta de destino                                                                                                                                                                                     |
| 400              | PXT000060  | Bad Request                                                             | Nonexistent account in destination bank                                                                                                                                                              | Conta inexistente no banco de destino                                                                                                                                                                                                       |
| 409              | PXT000061  | Conflict                                                                | End to end id invalid. A pix transfer with the end to end id \{end_to_end\} has already been registered!                                                                                             | End to end id inválido. Uma transação pix com o identificador único \{end_to_end\} já foi registrada!                                                                                                                                       |
| 409              | PXT000062  | Conflict                                                                | Missing fields detected on jd connector response: \{response\}                                                                                                                                       | Campos faltantes detectados em resposta do JD connector: \{response\}                                                                                                                                                                       |
| 409              | PXT000063  | Conflict                                                                | Unexpected response: \{response\}                                                                                                                                                                    | Resposta inesperada: \{response\}                                                                                                                                                                                                           |
| 400              | PXT000064  | Bad Request                                                             | For Manual Pix Transfer Type a target account must be provided                                                                                                                                       | Para transação pix do tipo manual, uma conta destino deve ser fornecida                                                                                                                                                                     |
| 400              | PXT000065  | Bad Request                                                             | Pix transfer sent was already rejected. Rejection_reason: \{error_description\}                                                                                                                      | Pix transfer já rejeitada. Motivo da rejeição: \{error_description_translated\}                                                                                                                                                             |
| 404              | PXT000067  | Pix Key is Unregistered                                                 | Pix key \{pix_key\} is not currently used                                                                                                                                                            | A chave pix \{pix_key\} não está sendo utilizada                                                                                                                                                                                            |
| 422              | PXT000068  | Pix Key is Unregistered                                                 | Pix key inquiry timeout. Please try again                                                                                                                                                            | Consulta de chave pix excedeu o tempo limite. Por favor tente novamente                                                                                                                                                                     |
| 400              | PXT000069  | Error in Qr Code Payload Request                                        | An error occurred while requesting the qr code payload to the registry institution                                                                                                                   | Um erro ocorreu durante a requisição do payload do qr code para a instituição de registro                                                                                                                                                   |
| 400              | PXT000070  | Invalid Qr Code Format                                                  | The Qr Code format is invalid, please enter a valid Qr Code                                                                                                                                          | O formato do Qr Code é inválido, por favor insira um Qr Code válido                                                                                                                                                                         |
| 400              | PXT000071  | Invalid Qr Code Type                                                    | The Qr Code payload given did not provide a proper Qr Code type                                                                                                                                      | O payload de QR Code fornecido não contêm um tipo de Qr Code Válido                                                                                                                                                                         |
| 422              | PXT000072  | Pending Transfer                                                        | The transaction (\{end_to_end_id\}) could not be completed and is pending confirmation                                                                                                               | Não foi possível concluir a transação (\{end_to_end_id\}) e ela está pendente de confirmação                                                                                                                                                |
| 404              | PXT000073  | Outgoing PIX Transfer Not Found                                         | Pix transfer end to end id \{end_to_end_id\} was not found                                                                                                                                           | Transferência PIX de saída com identificador único \{end_to_end_id\} não foi encontrada                                                                                                                                                     |
| 400              | PXT000074  | Invalid Transaction Status                                              | Unable to update transaction status. The status \{status\} is invalid                                                                                                                                | Não foi possível atualizar o status da transação. O status \{status\} é invalido                                                                                                                                                            |
| 400              | PXT000075  | Pix Transfer Key or End To End Not Provided                             | No pix transfer key or end to end id provided                                                                                                                                                        | Não foram fornecidos uma pix transfer key ou end to end id                                                                                                                                                                                  |
| 404              | PXT000076  | Incoming PIX Transfer Not Found                                         | Pix transfer key \{pix_transfer_key\} was not found                                                                                                                                                  | Transferência PIX de entrada com chave \{pix_transfer_key\} não foi encontrada                                                                                                                                                              |
| 400              | PXT000077  | Pix Transfer Receipt not allowed                                        | Pix Transfer Receipt cannot be generated for rejected transfers                                                                                                                                      | Recibo de transação pix não pode ser gerado para transações rejeitadas                                                                                                                                                                      |
| 400              | PXT000078  | Pix Transfer Receipt not available                                      | Receipt not available due to pix transfer currently being processed. Wait a few minutes and try again                                                                                                | Comprovante não disponível pois transação Pix está em processamento. Por favor, aguarde alguns minutos e tente novamente                                                                                                                    |
| 400              | PXT000079  | Bad Request                                                             | Insufficient billing account balance for fee                                                                                                                                                         | Saldo de conta de cobrança insuficiente para a taxa                                                                                                                                                                                         |
| 400              | PXT000080  | Bad Request                                                             | Could not complete the transaction and the transaction was rejected                                                                                                                                  | Não foi possível concluir a transação e a transferência foi rejeitada                                                                                                                                                                       |
| 400              | PXT000081  | Bad Request                                                             | Pix key not sent                                                                                                                                                                                     | Chave PIX não enviada                                                                                                                                                                                                                       |
| 400              | PXT000082  | Bad Request                                                             | The sent PIX key \{pix_key\} does not match the decoded PIX key                                                                                                                                      | A chave PIX enviada \{pix_key\} não coincide com a chave PIX decodificada                                                                                                                                                                   |
| 400              | PXT000083  | Bad Request                                                             | Pix rejected.                                                                                                                                                                                        | Pix rejeitado.                                                                                                                                                                                                                              |
| 404              | PXT000084  | Original Pix Transfer Was Not Found                                     | Original Pix Transfer Was Not Found                                                                                                                                                                  | A transação PIX original não foi encontrada                                                                                                                                                                                                 |
| 403              | PXT000085  | Invalid Permission                                                      | User do not has sufficient permissions                                                                                                                                                               | Usuário não tem permissões suficientes                                                                                                                                                                                                      |
| 400              | PXT000086  | Update Default Failed                                                   | To update default requester configuration send default as requester_key in url                                                                                                                       | Para alterar a configuracao de requester padrao, envie default como requester_key na url                                                                                                                                                    |
| 400              | PXT000087  | Amount limit not approved try a lower value                             | Amount limit for \{person_type\} person not approved, please try a lower value                                                                                                                       | Limite total não aprovado para pessoa \{person_type\}, por favor tente um menor                                                                                                                                                             |
| 400              | PXT000088  | Bad Request                                                             | Invalid account information when translating to account DTO                                                                                                                                          | Informações da conta inválidas na tradução do DTO                                                                                                                                                                                           |
| 409              | PXT000089  | Incoming Pix not pending                                                | Incoming Pix with pix transfer key \{pix_transfer_key\} is not pending                                                                                                                               | Transferência de Entrada PIX \{pix_transfer_key\} não está pendente                                                                                                                                                                         |
| 503              | PXT000090  | Service Unavailable                                                     | Pix transfer is not available right now. Please wait or use TED service                                                                                                                              | Transferência Pix não esta disponível no momento. Favor aguardar ou utilizar TED                                                                                                                                                            |
| 400              | PXT000091  | Bad Request                                                             | System account has no limits. Account key \{account_key\} is system account                                                                                                                          | Contas de sistema não possuem limite. Chave de conta \{account_key\} é conta de sistema                                                                                                                                                     |
| 422              | PXT000092  | Invalid Account Type                                                    | Pix is not yet implemented for non-checking or non-escrow account types                                                                                                                              | Transações Pix não estão implementadas para conta que não sejam escrow ou livres                                                                                                                                                            |
| 400              | PXT000093  | Bad Request                                                             | Fee must be either fixed_amount or percentage                                                                                                                                                        | Tarifas fixas e percentuais são mutuamente exclusivas                                                                                                                                                                                       |
| 400              | PXT000094  | Bad Request                                                             | Failed to fetch transactions by origin key                                                                                                                                                           | Falha ao obter transações por origin key                                                                                                                                                                                                    |
| 400              | PXT000095  | Unforeseen Error Scenario on Reprocess                                  | Scenario: pix_transfer_key: \{pix_transfer_key\}, pix_status: \{pix_status\}, bacen_status: \{bacen_status\}, internal_tx: \{internal_tx\}, reverse_tx

---

# List Transfers of an Account

URL: /en/documentation/baas/pix/listar_transferencias

## Request

ENDPOINT /account/ ACCOUNT_KEY /pix_transfers
METHOD GET

### Path Params

| Field           | Type   | Description                              | Characters |
|-----------------|--------|------------------------------------------|------------|
| `account_key` * | uuidv4 | Unique identification key of the QI account. | 36       |

### Query Params

| Field                     | Type       | Description                                                                                                    | Characters                                                           |
|-------------------------- |------------|--------------------------------------------------------------------------------------------------------------- |----------------------------------------------------------------------|
| `pix_transfer_direction`  | enumerator | Indicator of the transaction direction (inbound or outbound). If not sent, **outgoing** will be considered      | [Enumerators pix_transfer_direction](#enumeradores-pix_transfer_direction) |
| `request_control_key`     | uuidv4     | Unique request identification key used by the client.                                                           | 36                                                                   |
| `end_to_end_id`           | string     | Idempotency key of a Pix transaction                                                                           | 32                                                                   |
| `transaction_key`         | uuidv4     | Identification key of the account movement                                                                     | 36                                                                   |
| `date_from`               | string     | Start date. Format "YYYY-MM-DD"                                                                                 |                                                                      |
| `date_to`                 | string     | End date. Format "YYYY-MM-DD"                                                                                   |                                                                      |
| `page`                    | integer    | Requested page number. Default is 1                                                                            |                                                                      |
| `page_size`               | integer    | Requested page size in the query. Default and maximum value is 30                                              | Maximum value of 30                                                  |

### Enumerators pix_transfer_direction

| Enumerator   | Description                    |
|--------------|--------------------------------|
| **incoming** | Inbound Pix transfer           |
| **outgoing** | Outbound Pix transfer          |

## Response

STATUS 201

Response Body

```json
{
  "data": [
    {
      "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
      "pix_message": "Guten tag!",
      "pix_transfer_type": "manual",
      "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
      "updated_at": "2021-10-22T20:30:23.459Z",
      "created_at": "2021-10-22T20:30:23.459Z",
      "target_account": {
        "account_branch": "0001",
        "account_digit": "3",
        "account_number": "12345678",
        "owner_document_number": "***02502000***",
        "owner_person_type": "legal",
        "owner_name": "Qi Tech",
        "account_type": "checking_account",
        "ispb": "32402502",
        "financial_institution_name": "QI SCD",
        "pix_key": null
      },
      "receiver_conciliation_id": null,
      "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "end_to_end_id": "E3240250220211022203051750897529",
      "pix_transfer_status": "sent",
      "transfer_amount": 126.97,
      "fee_amount": 0.0,
      "rejection_reason": null,
      "reversals": [
        {
          "end_to_end_id": "D35713491202309182058jlqdBkkHSWU",
          "transfer_amount": 0.01,
          "reversal_reason": "client_request",
          "pix_transfer_status": "received",
          "pix_transfer_key": "423866cd-0f3f-4cdd-904b-0d2e33273afd",
          "request_control_key": "7c5a1425-73eb-420e-b4fb-0ce3386c7d0a",
          "created_at": "2021-10-23T20:30.459Z"
        }
      ]
    }
  ],
  "pagination": {
    "current_page": 1,
    "rows_per_page": 30
  }
}

```

Response Body: Error

```json
{
  "title": "title",
  "description": "description in English",
  "translation": "description in Portuguese",
  "code": "code",
  "extra_fields": {}
}
```

| HTTP Code   | QI Code<br/>`code`              | Title<br/>`title`                          | Description (eng)<br/>`Description`                    | Description (ptbr)<br/>`translation`                                  |
|-------------|----------------------|-------------------------------------------|-----------------------------------------------------|--------------------------------------------------------------------------|
| 400         | PXT000075            | Pix Transfer Key or End To End Not Provided | No pix transfer key or end to end id provided.        | Não foram fornecidos uma pix transfer key ou end to end id.              |
| 404         | PXT000023            | Outgoing PIX Transfer Not Found           | Pix transfer key \{pix_transfer_key\} was not found  | Transferência PIX de saída com chave \{pix_transfer_key\} não foi encontrada. |
| 403         | PIT000001            | User is not allowed to do this transaction | User is not allowed to do this transaction           | Usuário não tem autorização para fazer essa transação                  |

---

# Perform Pix Transaction

URL: /en/documentation/baas/pix/realizar_transferencia

## Request

ENDPOINT /account/ ACCOUNT_KEY /pix_transfer
METHOD POST

## Path Params

| Field         | Type   | Description                       | Characters |
|---------------|--------|-----------------------------------|------------|
| `account_key` | uuidv4 | Unique account identification key | 36         |

## Key Pix Transaction

Request Body: Transaction by Key Pix

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_type": "key",
  "target_pix_key": "target_pix_key@email.com",
  "transaction_amount": 500.65,
  "end_to_end_id": "E73856642202309201429bZKfklNlbwu",
  "pix_message": "Hello World"
}
```

### Body Params

| Field                   | Type       | Description                                                                                                                                                                                                                      | Characters |
|-------------------------|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|
| `request_control_key` * | uuidv4     | Unique identification key for the client request in uuid v4 format.                                                                                                                                                              | 36         | 
| `pix_transfer_type` *   | enumerator | Pix transfer type of the transaction to be performed. In case of a key transfer the value must be **key**.                                                                                                                       | "key"      |
| `target_pix_key` *      | string     | Pix key of the target account.                                                                                                                                                                                                   | 100        |
| `transaction_amount` *  | number     | Transaction amount.                                                                                                                                                                                                              | 10         |
| `end_to_end_id` *       | string     | Idempotency key used by the SPI (Instantaneous Payment System). This must be the same as the one returned by pix key inquiry request. It is mandatory for `pix_transfer_type` **key**, **static_qr_code** or **dynamic_qr_code** | 32         |
| `pix_message`           | string     | Message sent with the Pix transaction.                                                                                                                                                                                           | 140        |

## Manual Pix Transaction

Request Body: Manual Pix Transaction

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_type": "manual",
  "target_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "12345678",
    "owner_document_number": "32402502000135",
    "owner_name": "Qi Tech",
    "account_type": "checking_account",
    "ispb": "32402502"
  },
  "transaction_amount": 500.65,
  "pix_message": "Hello World"
}
```

### Body Params

| Field                   | Type       | Description                                                         | Characters                                          |
|-------------------------|------------|---------------------------------------------------------------------|-----------------------------------------------------|
| `request_control_key` * | uuidv4     | Unique identification key for the client request in uuid v4 format. | 36                                                  | 
| `pix_transfer_type` *   | enumerator | Pix transfer type of the transaction to be performed.               | **manual**                                          |
| `target_account` *      | Object     | Must only be sent if `pix_transfer_type` is **manual**.             | **[Object target_account](#objeto-target_account)** | 10 |
| `transaction_amount` *  | number     | Transaction amount.                                                 | 10                                                  |
| `pix_message`           | string     | Message sent with the Pix transaction.                              | 140                                                 |

### Object target_account

| Field                     | Type       | Description                                    | Characters                                              |
|---------------------------|------------|------------------------------------------------|---------------------------------------------------------|
| `account_branch` *        | string     | Account agency number.                         | 6                                                       |
| `account_digit` *         | string     | Account digit.                                 | 1                                                       |
| `account_number` *        | string     | Account number.                                | 20                                                      |
| `owner_document_number` * | string     | CPF or CNPJ (only numbers) from account owner. | 14                                                      |
| `owner_name` *            | string     | Account owner name.                            | 150                                                     |
| `account_type`*           | enumerator | Account Type.                                  | **[Enumerator account_type](#enumerador-account_type)** |
| `ispb` *                  | string     | Financial institution identification code      | 8                                                       |

### Enumerator account_type

| Enumerador           | Description      |
|----------------------|------------------|
| **checking_account** | Checking Account |
| **salary_account**   | Salary Account   |
| **saving_account**   | Saving Account   |
| **payment_account**  | Payment account  |

## QR Code Pix Transaction

The data used to perform a payment transaction with a Pix QR Code must be obtained through
the [decoding of the Pix QR Code](/documentation/pix/decodificar_qr_code), using the Pix Copy and Paste URI.

The `end_to_end_id` field must be the same value returned from the decoding of the Dynamic QR Code.
Insert to the `transaction_amount` field the same value returned in the `qr_code_data.amount` field from the
decoding of the Dynamic QR Code.
Change the `pix_transfer_type` field to **dynamic_term** for the payment request.
The `receiver_conciliation_id` field must be the same value returned from the decoding of the Dynamic QR Code.

Request Body: Qr Code Pix Transaction

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_type": "static_qr_code",
  "transaction_amount": 500.65,
  "end_to_end_id": "E73856642202309201429bZKfklNlbwu",
  "receiver_conciliation_id": "REC00000000000000000000009459463343",
  "target_pix_key": "target_pix_key@email.com",
  "pix_message": "Hello World"
}
```

### Body Params

| Field                      | Type       | Description                                                                                                                                                                                                                                                            | Characters                                |
|----------------------------|------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------|
| `request_control_key` *    | uuidv4     | Unique identification key for the client request in uuid v4 format.                                                                                                                                                                                                    | 36                                        | 
| `pix_transfer_type` *      | enumerator | Pix transfer type of the transaction to be performed.                                                                                                                                                                                                                  | **static_qr_code** ou **dynamic_qr_code** |
| `target_pix_key` *         | string     | Targets pix key.                                                                                                                                                                                                                                                       | 100                                       |
| `receiver_conciliation_id` | string     | Conciliation Identification code for receiver.                                                                                                                                                                                                                         | 35                                        |
| `transaction_amount` *     | number     | Transaction amount.                                                                                                                                                                                                                                                    | 10                                        |
| `end_to_end_id` *          | string     | Idempotency key used by the SPI (Instantaneous Payment System). This must be the same as the one returned by [pix key inquiry request](/documentation/pix/consultar_chave). It is mandatory for `pix_transfer_type` **key**, **static_qr_code** or **dynamic_qr_code** | 32                                        |
| `pix_message`              | string     | Message sent with the Pix transaction.                                                                                                                                                                                                                                 | 140                                       |

:::danger Aviso
The `end_to_end_id` must be from an inquiry which has been done by the account to execute the transfer!
:::

:::danger Aviso
The `end_to_end_id` can only be used for a single transfer, whether successful or not.
:::

## Response

STATUS 201

Response Body: Transfer Sent

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "pix_transfer_status": "sent",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

STATUS 202

Response Body: Transfer Pending

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "pix_transfer_status": "pending",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

:::info Information
If **HTTP Status 202** is returned with **pending** as the value for the field `pix_transfer_status`, the Pix
Transaction must not be attempted again. A Webhook will be sent as soon as the transaction reaches its final status.

Alternatively, it is possible to verify the transfer status using [Pix Transaction Inquiry](#consultar-transação-pix).
:::

STATUS 4xx

Response Body: Transfer Rejected

```json
{
  "title": "title",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "code",
  "extra_fields": {
    "pix_transfer_data": {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "pix_transfer_status": "rejected",
      "created_at": "2021-10-22T20:30:23.459Z"
    }
  }
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Status<br/>`status` | Code QI<br/>`code` | Tittle<br/>`title`                                 | Description (eng)<br/>`description`                                                                                     | Description (ptbr)<br/>`translation`                                                                                   |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Erro de Schema                                                                                                         |
| 406                      | PXT000103            | request_control_key must be a valid uuid v4 string | request_control_key was not accepted for not being a valid uuid v4 string                                               | request_control_key não foi aceito por não ser uma palavra uuid v4 válida                                              |
| 400                      | PXT000048            | Bad Request                                        | Emoji not allowed in pix message.                                                                                       | Emoji não é permitido na mensagem pix.                                                                                 |
| 400                      | PXT000104            | Invalid Transaction Amount                         | Transaction amount of \{transaction_amount\} is not valid. It must be a positive value with at maximum 2 decimal places | O valor de transação \{transaction_amount\} não é válido. Deve ser um valor positivo com no máximo duas casas decimais |
| 404                      | PXT000004            | Account not found                                  | Account not found for: \{account_datum\}                                                                                | Conta não encontrada para: \{account_datum\}                                                                           |
| 400                      | PXT000003            | Account is Closed                                  | Account \{account_key\} is closed.                                                                                      | Conta \{account_key\} está fechada.                                                                                    |
| 422                      | PXT000092            | Invalid Account Type                               | Pix is not yet implemented for non-checking or non-escrow account types                                                 | Transações Pix não estão implementadas para conta que não sejam escrow ou livres                                       |
| 403                      | PIT000001            | User is not allowed to do this transaction         |                                                                                                                         | Usuário não tem autorização para fazer essa transação                                                                  |
| 400                      | PXT000010            | Account is Blocked                                 | Account \{account_key\} is blocked.                                                                                     | Conta \{account_key\} está bloqueada.                                                                                  |
| 400                      | PXT000003            | Account is Closed                                  | Account \{account_key\} is closed.                                                                                      | Conta \{account_key\} está fechada.                                                                                    |
| 400                      | PIT000003            | Bad Request                                        | Insufficient account balance for transfer and fee amount.                                                               | Saldo de conta insuficiente para a transferência e a taxa.                                                             |
| 400                      | PXT000118            | Requester is not Pix Participant                   | The requester sent an alias key but is not a indirect pix participant                                                   | O requisitante enviou uma alias key no entanto não é um participante do pix indireto                                   |
| 404                      | PXT000120            | Alias sent not found                               | Alias key attached to this account not found                                                                            | Alias key vinculada à conta não encontrada                                                                             |
| 406                      | PXT000105            | Invalid end_to_end_id                              | The end_to_end_id sent \{end_to_end_id\} is not valid.                                                                  | O end_to_end_id enviado \{end_to_end_id\} não é válido.                                                                |
| 400                      | PXT000108            | Bad Request                                        | Billing account closed or blocked                                                                                       | Conta de cobrança encerrada ou bloqueada                                                                               |
| 400                      | PXT000079            | Bad Request                                        | Insufficient billing account balance for fee.                                                                           | Saldo de conta de cobrança insuficiente para a taxa.                                                                   |
| 400                      | PIT000004            | Bad Request                                        | Transaction amount is over limit.                                                                                       | O total da transferência é superior ao limite.                                                                         |
| 404                      | PIX000056            | Not Found                                          | Pix key inquiry not found                                                                                               | Consulta de chave pix não encontrada                                                                                   |
| 404                      | PXT000041            | Not Found                                          | Qr Code not found                                                                                                       | Qr Code não encontrado                                                                                                 |
| 400                      | PXT000053            | Bad Request                                        | QrCode already paid                                                                                                     | Qr Code já Pago                                                                                                        |
| 400                      | PXT000118            | Requester is not Pix Participant                   | The requester sent an alias key but is not a indirect pix participant                                                   | O requisitante enviou uma alias key no entanto não é um participante do pix indireto                                   |
| 404                      | PXT000120            | Alias sent not found                               | Alias key attached to this account not found                                                                            | Alias key vinculada à conta não encontrada                                                                             |
| 400                      | PXT000115            | Bad Request                                        | Insufficient account balance for transfer and fee amount.                                                               | Saldo de conta insuficiente para a transferência e a taxa                                                              |
| 400                      | PXT000128            | Bad Request                                        | Pix key \{pix_key\} sent does match inquiry pix key. Verify if end_to_end_id sent is correct                            | Chave Pix \{pix_key\} enviada não condiz com consulta. Verifique se end_to_end_id enviado está correto                 |
| 400                      | PXT000109            | Bad Request                                        | request_control_key \{request_control_key\} already in use                                                              | request_control_key \{request_control_key\} já utilizada                                                               |
| 400                      | PXT000061            | Bad Request                                        | End to end id invalid. A pix transfer with the end to end id \{end_to_end\} has already been registered!                | End to end id inválido. Uma transação pix com o identificador único \{end_to_end\} já foi registrada!                  |
| 400                      | PXT000129            | SPI Error message                                  | Message rejected by SPI-ICOM                                                                                            | Mensagem rejeitada pela SPI-ICOM                                                                                       |
| 408                      | PXT000130            | SPI Timeout Control                                | SPI Timeout Control                                                                                                     | Controle de timeout no SPI                                                                                             |
| 400                      | PXT000131            | Receiver Internal Error                            | Cancelled transaction due to receiver's internal error                                                                  | Transação interrompida devido a erro no PSP do Recebedor                                                               |
| 400                      | PXT000132            | Invalid Target Account Number                      | Target account number is invalid                                                                                        | Número da conta de destino é inexistente ou inválido                                                                   |
| 400                      | PXT000133            | Blocked Target Account                             | Target account is blocked.                                                                                              | A conta de destino encontra-se bloqueada.                                                                              |
| 400                      | PXT000134            | Closed Target Account                              | Target account is closed.                                                                                               | A conta de destino encontra-se encerrada.                                                                              |
| 400                      | PXT000135            | Unsupported Transaction                            | Unsupported transaction for given target account.                                                                       | A conta de destino não suporta este tipo de transação.                                                                 |
| 400                      | PXT000136            | Invalid Participant                                | SPI participant is not PSP settler agent of payer nor receiver.                                                         | Participante direto do SPI não é liquidante do PSP do Pagador / Recebedor.                                             |
| 400                      | PXT000137            | Zero Value Payment Order                           | Zero value payment order.                                                                                               | Ordem de pagamento com valor zero.                                                                                     |
| 400                      | PXT000138            | Insufficient Funds                                 | Insufficient funds in PI account from payer.                                                                            | Saldo insuficiente na conta PI do pagador.                                                                             |
| 400                      | PXT000139            | Return Value Too Great                             | Return value greater than corresponding payment order.                                                                  | Valor de devolução acima do valor de pagamento correspondente.                                                         |
| 400                      | PXT000140            | Invalid Transactions Number                        | Invalid transactions number.                                                                                            | Quantidade de transações inválida.                                                                                     |
| 400                      | PXT000141            | Unrelated Beneficiary Document Number              | Beneficiary document number is not that of target account owner.                                                        | CPF/CNPJ do usuário recebedor não é compatível com o titular da conta de destino.                                      |
| 400                      | PXT000142            | Invalid Beneficiary Document Number                | Invalid beneficiary document number                                                                                     | CPF/CNPJ da conta de destino está incorreto.                                                                           |
| 400                      | PXT000143            | Incorrect Message Element                          | Incorrect message element.                                                                                              | Elemento da mensagem incorreto.                                                                                        |
| 403                      | PXT000144            | Rejected Payment Order                             | Beneficiary's PSP has rejected payment order.                                                                           | Ordem de pagamento foi rejeitada pelo banco recebedor.                                                                 |
| 403                      | PXT000145            | Unauthorized Payer                                 | Signing participant is unauthorized to make a payment order for paying account.                                         | Participante que assinou a mensagem não é autorizado a realizar a operação na conta PI debitada.                       |
| 400                      | PXT000146            | Invalid Datetime                                   | Invalid datetime for message delivery.                                                                                  | Data e Hora do envio da mensagem inválida.                                                                             |
| 400                      | PXT000147            | Generic Error                                      | Error while processing payment (generic error).                                                                         | Erro no processamento do pagamento (erro genérico).                                                                    |
| 400                      | PXT000148            | Bad Format Operation Identifier                    | Badly formatted operation's identifier.                                                                                 | Identificador da operação mal formatado.                                                                               |
| 400                      | PXT000149            | Invalid Payer ISPB                                 | Invalid or non-existent payer's PSP ISPB number.                                                                        | Número ISPB do PSP do Pagador é inválido ou inexistente.                                                               |
| 400                      | PXT000150            | Invalid Beneficiary ISPB                           | Invalid or non-existent beneficiary's PSP ISPB number.                                                                  | Número ISPB do banco recebedor é inválido ou inexistente.                                                              |
| 400                      | PXT000151            | Incorrect Type                                     | Incorrect type for target account.                                                                                      | Type incorreto para a conta transacional especificada.                                                                 |
| 400                      | PXT000152            | Repeated End-to-End ID Error                       | The end_to_end_id was already used                                                                                      | O end_to_end_id já foi utilizado                                                                                       |
| 400                      | PXT000153            | Invalid Target Account Type                        | The target account type cannot receive PIX transactions                                                                 | O tipo de conta destino não pode receber transações PIX                                                                |
| 400                      | PXT000154            | Invalid ISPB                                       | Invalid or non-existent ISPB number.                                                                                    | Número ISPB é inválido ou inexistente.                                                                                 |
| 400                      | PXT000155            | Amount too Great                                   | Amount too great for credited account.                                                                                  | Valor de pagamento/devolução acima do permitido para a conta de destino creditada.                                     |
| 400                      | PXT000156            | QR Code Rejected                                   | QR Code rejected by beneficiary's PSP.                                                                                  | QR Code rejeitado pelo PSP do usuário recebedor.                                                                       |
| 503                      | PXT000157            | Bacen Service Unavailable Error                    | Could not send the message to ICOM after 3 retries                                                                      | Não pode enviar a mensagem para a ICOM depois de 3 tentativas                                                          |
| 400                      | PXT000158            | Invalid Amount                                     | Paid amount diverges from expected amount of \{expected_amount\}                                                        | O valor do pagamento diverge do valor esperado de \{expected_amount\}                                                  |
| 400                      | PXT000159            | QR code inactive                                   | QR code is not active at the time of payment                                                                            | QR code não está ativo no instante do pagamento|

---

# Request a refund for a received Pix

URL: /en/documentation/baas/pix/solicitar_devolucao

A refund for a Pix can be processed up to 90 days from its receipt.

## Request

ENDPOINT /account/ ACCOUNT_KEY /pix_transfer/ PIX_TRANSFER_KEY /reversal
METHOD POST

### Path Params

| Field             | Type   | Description                                             | Characters |
|-------------------|--------|---------------------------------------------------------|------------|
| `account_key` *   | uuidv4 | Unique identification key of the account.               | 36         |
| `pix_transfer_key` * | uuidv4 | Unique identification key of the Pix transfer in the QI system. | 36         |

Request Body

```json
{
  "request_control_key": "303393bf-8f2e-4ff0-b326-ee7ad612e8ca",
  "reversal_amount": 147,
  "reversal_reason": "client_request",
  "reversal_message": "Refund Pix message"
}
```

### Request Body

| Field                   | Type   | Description                        | Characters                                      |
|-------------------------|--------|------------------------------------|-------------------------------------------------|
| `request_control_key` * | uuidv4 | Uniqueness key for the request.    | 36                                              |
| `reversal_amount` *     | number | Refund amount.                     | 11                                              |
| `reversal_reason` *     | string | Reason for the refund.             | **[Enumerator reversal_reason](#enumerator-reversal_reason)** |
| `reversal_message`      | string | Refund message.                    | 140                                             |

### Enumerator reversal_reason

| Enumerator          | Description                                     |
|---------------------|-------------------------------------------------|
| **client_request**  | When requested by the account owner.            |
| **reconciliation**  | For reconciliation due to operational error.    |

## Response

STATUS 201

Response Body: Refund Sent

```json
{
  "reversal_status": "sent",
  "transaction_amount": 147,
  "pix_transfer_key": "cdcf0d25-08a1-46e3-902a-6d7ca75e6c48",
  "end_to_end_id": "E32402502202405081755SxyT2DDcVwc",
  "request_control_key": "7c5a1425-73eb-420e-b4fb-0ce3386c7d0c",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

STATUS 202

Response Body: Refund Pending

```json
{
  "reversal_status": "pending",
  "transaction_amount": 147,
  "pix_transfer_key": "cdcf0d25-08a1-46e3-902a-6d7ca75e6c48",
  "end_to_end_id": "E32402502202407112211Id9JbxoaiTf",
  "request_control_key": "7c5a1425-73eb-420e-b4fb-0ce3386c7d0c",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

:::info Information
If **HTTP Status 202** is returned with the `pix_transfer_status` field having the value **pending**, the Pix request should not be retried.

This transfer will be reprocessed. The transfer status needs to be checked through the [Pix Transfer Status Query](#consultar-transacao-pix).
:::

### Response Body

| Field                | Type       | Description                                                  | Characters                                      |
|----------------------|------------|--------------------------------------------------------------|-------------------------------------------------|
| `reversal_status`    | enumerator | Enumerator of the refund transaction status.                 | [Enumerator reversal_status](#enumerator-reversal_status) |
| `transfer_amount`    | number     | Refund transfer amount.                                      | 11                                              |
| `pix_transfer_key`   | uuidv4     | Key of the executed Pix refund transaction.                  | 36                                              |
| `end_to_end_id`      | string     | Idempotency key of a Pix transaction within the SPI (Instant Payment System) | 32                                              |
| `request_control_key`| uuidv4     | Unique identification key of the request used by the client. | 36                                              |
| `created_at`         | string     | Date and time of the refund.                                 | 10                                              |

### Enumerator reversal_status

| Enumerator   | Description                                   |
|--------------|----------------------------------------------|
| **sent**     | Pix transfer successfully completed.         |
| **pending**  | Pix transfer pending.                        |
| **rejected** | Pix transfer rejected.                       |

STATUS 4xx

Response Body: Refund Rejected

```json
{
  "title": "title",
  "description": "description in English",
  "translation": "description in Portuguese",
  "code": "code",
  "extra_fields": {
    "pix_transfer_data": {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "end_to_end_id": "E32402502202407112211Id9JbxoaiTf",
      "pix_transfer_status": "rejected",
      "created_at": "2021-10-22T20:30:23.459Z"
    }
  }
}
```

:::info Information
In addition to the errors previously listed for [Pix transfer](/documentation/baas_v2/pix/realizar_transferencia), the refund of a Pix can also return the errors listed below.
:::

| HTTP Code<br/>`status`   | QI Code<br/>`code`                   | Title<br/>`title`                          | Description (eng)<br/>`description`                                   | Description (ptbr)<br/>`translation`                                                                                       |
|--------------------------|----------------------                |--------------------------------------      |------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|
| 400                      | QIT000001                             | Bad Request                               | Schema Error                                                            | Erro de Schema                                                                                                           |
| 404                      | PXT000018                             | Reversal Original Transfer not Found      | Reversal original pix transfer not found.                                | Transferência original da devolução não foi encontrada.                                                                  |
| 400                      | PXT000017                             | Reversal Too Great                        | Reversal transfers sum amount surpasses that of original pix transfer.   | A soma das transferências de devolução ultrapassam o valor da transferência pix original.                                    |
| 400                      | PXT000015                             | Reversal date expired                     | Reversal original transaction is older than 90 days                      | A data de criação da transação original é mais antiga que 90 dias                                                                 |
| 400                      | PXT0000127                            | Invalid Reversal Reason                   | Reversal reason \{reversal_reason\} is not valid                          | Razão de reversão \{reversal_reason\} não é válida                                                                        |

---

# Webhooks

URL: /en/documentation/baas/pix/webhooks

Since transfers occur asynchronously, it is highly important to correctly map and handle the webhooks sent.
:::danger Attention!
QI Tech webhooks should not be mapped restrictively.
Additional fields may be included in the webhook payloads returned from our APIs.
:::

## Webhook for Pending Transactions

Webhook intended to update the status of transfers that remained pending (status 202) in the [Pix transfer request](/documentation/baas_v2/pix/realizar_transferencia).

### Webhook Request Body

Request Body: Transaction Sent

```json
{
  "webhook_type": "baas.pix_transfer.outgoing_pix",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
    "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
    "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "pix_transfer_status": "sent",
    "created_at": "2021-10-22T20:30:23.459Z"
  }
}
```

Request Body: Transaction Rejected

```json
{
  "webhook_type": "baas.pix_transfer.outgoing_pix",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
    "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
    "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "pix_transfer_status": "rejected",
    "created_at": "2021-10-22T20:30:23.459Z",
    "error_code": "PXT000132",
    "error_description": "Target account number is invalid.",
    "error_translation": "Número da conta de destino é inexistente ou inválido.",
    "error_short_description": null
  }
}
```

### Webhook Body Param
| Field                 | Type   | Description                                             | Max. Characters |
|-----------------------|--------|---------------------------------------------------------|-----------------|
| `webhook_type`        | string | An enumerator that defines the type of event being reported | 23              |
| `webhook_datetime`    | string | Date and time the webhook was sent                      | 20              |
| `request_control_key` | string | UUID4 for query purposes about the request made.        | 36              |
| `pix_transfer_key`    | string | Identification key of the Pix transfer in the QI system | 36              |
| `pix_transfer_status` | string | Transaction status                                      | 200             |
| `created_at`          | string | Date and time the transaction was created               | 20              |

[//]: # (Break here for new page -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------)

## Webhook for incoming Pix

A webhook that will notify about Pix transactions that have arrived in an account.

### Webhook Request Body

Request Body: Pix Received

```json
{
  "webhook_type": "baas.pix_transfer.incoming_pix",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
    "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "end_to_end_id": "E18236120202308111235s14fddf2801",
    "pix_transfer_status": "received",
    "account_key": "7c5a1425-73eb-420e-b4fb-0ce3386c7d0c",
    "receiver_conciliation_id": "745c28c780bc4822bbade86dd875d10b",
    "transfer_amount": 126.97,
    "fee_amount": 0.0,
    "source_account": {
      "account_branch": "0001",
      "account_digit": "3",
      "account_number": "12345678",
      "owner_document_number": "***02502000***",
      "owner_person_type": "legal",
      "owner_name": "Qi Tech",
      "account_type": "checking_account",
      "ispb": "32402502"
    },
    "pix_transfer_type": "dynamic_qr_code",
    "pix_message": "pix message received",
    "created_at": "2021-10-22T20:30:23.459Z",
    "reversals": []
  }
}
```

### Webhook Body Param

| Field                     | Type       | Description                                                                 | Max. Characters                             |
|---------------------------|------------|-----------------------------------------------------------------------------|--------------------------------------------|
| `webhook_type`            | string     | An enumerator that defines the type of event being reported                 | 23                                         |
| `webhook_datetime`        | string     | Date and time the webhook was sent                                          | 20                                         |
| `pix_transfer_type`       | enumerator | Type of pix performed                                                       | **[Enumerator pix_transfer_type](#enumerator-pix_transfer_type)** |
| `target_pix_key`          | string     | Pix key of the account to which the transaction will be sent                | 100                                        |
| `source_account`          | Object     | Destination account - Should only be sent in transactions of type "manual"  | **[Object source_account](#object-source_account)** |
| `transfer_amount`         | number     | Transfer amount                                                             | 10                                         |
| `receiver_conciliation_id`| string     | Receiver's conciliation identification                                      | 35                                         |
| `end_to_end_id`           | string     | Idempotency key of a Pix transaction - should only be sent if the transfer type is "key" | 32                       |
| `pix_message`             | string     | Message to be sent along with the Pix transfer                              | 140                                        |
| `fee_amount`              | number     | Transfer amount                                                             | 10                                         |
| `pix_transfer_status`     | string     | Pix transaction status                                                      | 10                                         |
| `account_key`             | string     | Unique identification key of the QI account                                 | 36                                         |
| `pix_transfer_key`        | string     | Unique identification key of the Pix transfer                               | 36                                         |

### Enumerator pix_transfer_type

| Enumerator           | Description                                 |
|----------------------|---------------------------------------------|
| **manual**           | Pix using the destination account details   |
| **key**              | Pix using a pix key                         |
| **static_qr_code**   | Pix using a static QR code                  |
| **dynamic_qr_code**  | Pix using a dynamic QR code                 |
| **reversal**         | Pix refund                                  |

### Object source_account

| Field                    | Type       | Description                                                       | Characters                                  |
|--------------------------|------------|-------------------------------------------------------------------|---------------------------------------------|
| `account_branch` *       | string     | Branch of the account                                             | 6                                           |
| `account_digit` *        | string     | Account digit                                                     | 1                                           |
| `account_number` *       | string     | Account number                                                    | 20                                          |
| `owner_document_number` *| string     | CPF or CNPJ (numbers only) of the account holder                  | 14                                          |
| `owner_name`             | string     | Name of the account holder                                        | 150                                         |
| `account_type` *         | enumerator | Type of account                                                   | **[Enumerator account_type](#enumerator-account_type)** |
| `ispb` *                 | string     | Eight-digit code that identifies banks in the Central Bank's reserve transfer system | 8         |

### Enumerator account_type

| Enumerator            | Description        |
|-----------------------|---------------------|
| **checking_account**  | Conta Corrente     |
| **salary_account**    | Conta Salário      |
| **saving_account**    | Conta Poupança     |
| **payment_account**   | Conta de Pagamentos|

[//]: # (Break here for new page -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------)

## Webhook for Pix Refunds

A webhook that will notify about Pix refunds that have arrived in an account.

### Webhook Request Body

Request Body: Pix Received

```json
{
  "webhook_type": "baas.pix_transfer.incoming_pix",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
    "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "end_to_end_id": "E18236120202308111235s14fddf2801",
    "pix_transfer_status": "received",
    "account_key": "7c5a1425-73eb-420e-b4fb-0ce3386c7d0c",
    "receiver_conciliation_id": "745c28c780bc4822bbade86dd875d10b",
    "transfer_amount": 126.97,
    "fee_amount": 0.0,
    "source_account": {
      "account_branch": "0001",
      "account_digit": "3",
      "account_number": "12345678",
      "owner_document_number": "***02502000***",
      "owner_person_type": "legal",
      "owner_name": "Qi Tech",
      "account_type": "checking_account",
      "ispb": "32402502"
    },
    "pix_transfer_type": "reversal",
    "pix_message": "pix message received",
    "created_at": "2021-10-22T20:30:23.459Z",
    "reversals": [],
    "original_outgoing_pix_transfer": "b56862c4-2b20-4057-8063-b8809866e494"
  }
}
```

### Webhook Body Param

| Field                          | Type       | Description                                                                          | Max. Characters                             |
|--------------------------------|------------|------------------------------------------------------------------------------------- |--------------------------------------------|
| `webhook_type`                 | string     | An enumerator that defines the type of event being reported                           | 23                                         |
| `webhook_datetime`             | string     | Date and time the webhook was sent                                                    | 20                                         |
| `pix_transfer_type`            | enumerator | Type of pix performed                                                                 | **[Enumerator pix_transfer_type](#enumerator-pix_transfer_type)** |
| `target_pix_key`               | string     | Pix key of the account to which the transaction will be sent                          | 100                                        |
| `source_account`               | Object     | Destination account - Should only be sent in transactions of type "manual"            | **[Object source_account](#object-source_account)** |
| `transfer_amount`              | number     | Transfer amount                                                                       | 10                                         |
| `receiver_conciliation_id`     | string     | Receiver's conciliation identification                                                | 35                                         |
| `end_to_end_id`                | string     | Idempotency key of a Pix transaction - should only be sent if the transfer type is "key" | 32                                      |
| `pix_message`                  | string     | Message to be sent along with the Pix transfer                                        | 140                                        |
| `fee_amount`                   | number     | Transfer amount                                                                       | 10                                         |
| `pix_transfer_status`          | string     | Pix transaction status                                                                | 10                                         |
| `account_key`                  | string     | Unique identification key of the QI account                                           | 36                                         |
| `pix_transfer_key`             | string     | Unique identification key of the Pix transfer                                         | 36                                         |
| `original_outgoing_pix_transfer` | string     | Unique identification key of the original outbound Pix transfer                        | 36                                     |

### Enumerator pix_transfer_type

| Enumerator           | Description                                 |
|----------------------|---------------------------------------------|
| **manual**           | Pix using the destination account details   |
| **key**              | Pix using a pix key                         |
| **static_qr_code**   | Pix using a static QR code                  |
| **dynamic_qr_code**  | Pix using a dynamic QR code                 |
| **reversal**         | Pix refund                                  |

### Object source_account
| Field                    | Type       | Description                                                    | Characters                                  |
|--------------------------|------------|----------------------------------------------------------------|---------------------------------------------|
| `account_branch`         | string     | Branch of the account                                           | 6                                           |
| `account_digit`          | string     | Account digit                                                   | 1                                           |
| `account_number`         | string     | Account number                                                  | 20                                          |
| `owner_document_number`  | string     | CPF or CNPJ (numbers only) of the account holder                | 14                                          |
| `owner_name`             | string     | Name of the account holder                                      | 150                                         |
| `account_type`           | enumerator | Type of account                                                 | **[Enumerator account_type](#enumerator-account_type)** |
| `ispb`                   | string     | Eight-digit code that identifies banks in the Central Bank's reserve transfer system | 8         |

### Enumerator account_type

| Enumerator            | Description        |
|-----------------------|---------------------|
| **checking_account**  | Conta Corrente     |
| **salary_account**    | Conta Salário      |
| **saving_account**    | Conta Poupança     |
| **payment_account**   | Conta de Pagamentos|

---

# baas_configurando_webhooks

URL: /en/documentation/baas/primeiros_passos/baas_configurando_webhooks



---

# Configurar IP de Integração

URL: /en/documentation/baas/primeiros_passos/baas_configurar_ip_de_integracao



---

# baas_inicio

URL: /en/documentation/baas/primeiros_passos/baas_inicio



---

# baas_troca_de_chaves

URL: /en/documentation/baas/primeiros_passos/baas_troca_de_chaves



---

# baas_endpoints_de_teste

URL: /en/documentation/baas/primeiros_passos/teste_de_autenticacao/baas_endpoints_de_teste



---

# baas_possiveis_erros

URL: /en/documentation/baas/primeiros_passos/teste_de_autenticacao/baas_possiveis_erros



---

# baas_teste_de_autenticacao_completo

URL: /en/documentation/baas/primeiros_passos/teste_de_autenticacao/baas_teste_de_autenticacao_completo



---

# baas_teste_de_autenticacao_v2

URL: /en/documentation/baas/primeiros_passos/teste_de_autenticacao/baas_teste_de_autenticacao_v2



---

# baas_webhook_v2

URL: /en/documentation/baas/primeiros_passos/teste_de_autenticacao/baas_webhook_v2



---

# Approve TED with Two-Factor Authentication

URL: /en/documentation/baas/ted/2fa/aprovar_transacao_ted_2fa

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted/ TED_KEY /validate_token
METHOD PUT

### Path Params

| Field         | Type   | Description                                   | Characters |
|---------------|--------|-----------------------------------------------|------------|
| `account_key` | uuidv4 | Unique account identification key.            | 36         |
| `ted_key`     | uuidv4 | Unique TED transfer identification key        | 36         |

## Email and SMS Authentication

Request Body

```json
{
  "token": "329123"
}
```

## Device Authentication

To approve and finalize device authentication, the request must be sent with an empty payload. Validation occurs internally, without the need for additional information in the request body. It's important to note that this endpoint should only be used after the [transaction request](./realizar_transferencia_2fa.md) has been initiated.

Request Body

```json
{

}
```

## Body Params

| Field     | Type   | Description                                                           | Characters |
|-----------|--------|-----------------------------------------------------------------------|------------|
| `token`   | string | Authentication code sent to the account movement approver **mandatory for TFA via SMS or email**| 6          | 

## Response

STATUS 201

Response Body: Transfer Sent

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "transaction_key": "46804f32-101e-4702-8fbc-c2dbc4c2caec",
  "ted_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "transaction_amount": 202.01,
  "fee_amount": 10,
  "ted_status": "sent",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

STATUS 202

Response Body: Pending Transfer

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "ted_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "transaction_amount": 202.01,
  "fee_amount": 10,
  "ted_status": "pending",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

STATUS 4xx

Response Body: Transfer Rejected

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {
    "ted_data": {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "ted_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "transaction_amount": 202.01,
      "fee_amount": 10,
      "ted_status": "rejected",
      "created_at": "2021-10-22T20:30:23.459Z"
    }
  }
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

:::info Information
The errors previously listed for [perform TED](/documentation/baas/ted/realizar_transferencia) are
subject to being returned by this endpoint in addition to the errors listed below.
:::

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                           | Description (eng)<br/>`description`                                       | Description (ptbr)<br/>`translation`                                  |
|--------------------------|----------------------|----------------------------------------------|-------------------------------------------------------------------------|---------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                  | Schema Error                                                            | Erro de Schema                                                      |
| 404                      | TED000020            | Not Found                                    | Ted was not found for the given parameters.                             | Ted não encontrada para os parâmetros fornecidos.                   |
| 404                      | TED000086            | Invalid Status                               | Ted not in pending_2fa_approval status                                  | Ted não está pendente de aprovação por autenticação de dois fatores |
| 400                      | TED000082            | Number of token validation attempts exceeded | The maximum number of failed token validation attempts has been reached | Número máximo de tentativas de validação de token atingida          |
| 400                      | TED000084            | Incorrect Token                              | Token sent does not match expected                                      | Token enviado não condiz com, o esperado                            |
| 400                      | TED000083            | Token Expired                                | Token has expired. Resend token or recreate transfer                    | Token expirado. Reenvie token ou recrie a transferência             |
| 400                      | TED000110            | Token Required                                | A token is required for SMS or email validation.                    | Um token é necessário para validação via SMS ou email.             |

---

# Perform TED with Two-Factor Authentication

URL: /en/documentation/baas/ted/2fa/realizar_transferencia_2fa

In this type of transaction, payment confirmation is required via token sent to the person with powers to approve account movements.

TED transaction requests by integrating partners configured to use two-factor authentication are performed similarly to what is described in [perform TED](/documentation/baas/ted/realizar_transferencia). The difference occurs in the addition of the `tfa_info` object, containing information about the transfer approver and the contact method, and the status of a successful request which will always be **pending_2fa_approval**.

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted
METHOD POST

## Authentication via Email and SMS

Request Body

```json
{
  "request_control_key": "0c3d2a3e-c121-464e-b5a4-8e69e0c17bbd",
  "target_account": {
    "account_branch": "0001",
    "account_number": "92796",
    "account_digit": "1",
    "owner_document_number": "23599885000192",
    "owner_name": "Titular da Conta",
    "ispb": "12345678",
    "account_type": "checking_account"
  },
  "transaction_amount": 8.86,
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  }
}
```

## Device Authentication

In addition to the existing authentication methods via **sms** and **email**, it is possible to authenticate the transaction using a [previously registered device](/documentation/baas/dispositivo/create/solicitacao_cadastro_dispositivo). In this case, the `session_id` must be obtained from the **Device Scan** and sent in the `tfa_info`.

Request Body

```json
{
  "request_control_key": "0c3d2a3e-c121-464e-b5a4-8e69e0c17bbd",
  "target_account": {
    "account_branch": "0001",
    "account_number": "92796",
    "account_digit": "1",
    "owner_document_number": "23599885000192",
    "owner_name": "Titular da Conta",
    "ispb": "12345678",
    "account_type": "checking_account"
  },
  "transaction_amount": 8.86,
  "tfa_info": {
    "approver_document_number": "98765432100",
    "session_id": "b2f18d3a-67c2-4a7f-98e5-1d3f5c6b8a72",
    "contact_type": "device"
  }
}
```

## Body Params

| Field                   | Type   | Description                                                                          | Characters                                          |
|-------------------------|--------|--------------------------------------------------------------------------------------|-----------------------------------------------------|
| `request_control_key` * | string | Unique request identification key used by the client in uuid v4 format. | 36                                                  |
| `target_account` *      | object | Destination account                                                                   | **[target_account Object](#target_account-object)** | 
| `transaction_amount` *  | float  | Transfer amount                                                             | 10                                                  |
| `tfa_info`*             | object | Object containing the account approver's document and contact method.    | **[tfa_info Object](#tfa_info-object)**             |

## target_account Object

| Field                     | Type   | Description                                           | Characters                                                |
|---------------------------|--------|-------------------------------------------------------|-----------------------------------------------------------|
| `account_branch` *        | string | Branch.                                            | 4                                                         |
| `account_digit` *         | string | Account digit                                     | 1                                                         |
| `account_number` *        | string | Account number.                                    | 20                                                        |
| `owner_document_number` * | string | CPF or CNPJ (numbers only) of the account holder.   | 14                                                        |
| `owner_name` *            | string | Account holder name.                           | 50                                                        |
| `account_type`*           | string | Account type.                                      | **[account_type Enumerator](#account_type-enumerator)** |
| `ispb` *                  | string | Based on the financial institution's CNPJ (8 digits). | 8                                                         |

## tfa_info Object

| Field                       | Type   | Description                                                                           | Characters |
|-----------------------------|--------|---------------------------------------------------------------------------------------|------------|
| `approver_document_number`* | string | Account approver's document number.                                  | 11         | 
| `session_id`| string | Unique device session identification key in UUID v4 format (required for TFA via device). |   36         |
| `contact_type`*             | string | Contact method with the account approver, can be **sms**, **email** or **device** |            |

## account_type Enumerator

| Enumerator             | Translation              |
|------------------------|-----------------------|
| **checking_account**   | checking account        |
| **deposit_account**    | deposit account        |
| **guaranteed_account** | guaranteed account     |
| **investment_account** | investment account |
| **payment_account**    | payment account    |
| **saving_account**     | savings account        |

## Response

STATUS 202

Response Body

```json
{
  "request_control_key": "0c3d2a3e-c121-464e-b5a4-8e69e0c17bbd",
  "ted_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "created_at": "2021-10-22T20:30:23.459Z",
  "ted_status": "pending_2fa_approval",
  "transaction_amount": 126.97,
  "fee_amount": 0.0
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

:::info Information
The errors previously listed for [perform TED](/documentation/baas/ted/realizar_transferencia) are
subject to being returned by this endpoint in addition to the errors listed below.
:::

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                 | Description (eng)<br/>`description`                                     | Description (ptbr)<br/>`translation`                               |
|--------------------------|----------------------|------------------------------------|-----------------------------------------------------------------------|------------------------------------------------------------------|
| 400                      | TED000079            | No approver permission             | Given document number does not belong to an approver for this account | Número de documento enviado não pertence a um aprovador da conta |
| 400                      | TED000080            | tfa_info is required               | Client must send object tfa_info                                      | Cliente deve enviar objeto tfa_info                              |
| 400                      | TED000081            | Error occurred while sending token | An unexpected error occurred while sending token                      | Um erro inexperado ocorreu ao tentar enviar token                |
| 400                      | TED0000109           | Session ID needed | A session_id must be provided token | Uma session_id deve ser fornecida |

---

# Request Token Resend for a Ted Transaction

URL: /en/documentation/baas/ted/2fa/solicitacao_de_reenvio_de_token

A new token will be generated and sent to the Ted transaction approver. If the token validation attempt limit has been exceeded, resending will not be allowed.

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted/ TED_KEY /resend_token
METHOD PATCH

### Path Params

| Field           | Type   | Description                                       | Characters |
|-----------------|--------|---------------------------------------------------|------------|
| `account_key` * | uuidv4 | Unique account identification key.                | 36         |
| `ted_key` *     | uuidv4 | Unique TED transfer identification key            | 36         |

## Body Params

| Field          | Type   | Description                                                                               | Characters |
|----------------|--------|-------------------------------------------------------------------------------------------|------------|
| `contact_type` | enumerator | Authentication token delivery method | **[contact_type enumerator](#contact_type-enumerator)** |

:::info Information
If no `contact_type` is sent, the token will be sent using the originally requested method.
:::

### contact_type Enumerator

| Enumerator | Description                                       |
|------------|---------------------------------------------------|
| **sms**    | Delivery via Text Message to mobile phone        |
| **email**  | Delivery via electronic mail                     |

## Response

STATUS 202

Response Body: Requested Transaction

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "ted_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "transaction_amount": 202.01,
  "fee_amount": 10,
  "ted_status": "pending_2fa_approval",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

STATUS 4xx

Response Body: Rejected Transfer

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {
    "ted_data": {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "ted_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "transaction_amount": 202.01,
      "fee_amount": 10,
      "ted_status": "rejected",
      "created_at": "2021-10-22T20:30:23.459Z"
    }
  }
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                            | Description (eng)<br/>`description`                                     | Description (ptbr)<br/>`translation`                                     |
|------------------------|--------------------|----------------------------------------------|-------------------------------------------------------------------------|---------------------------------------------------------------------------|
| 400                    | QIT000001          | Bad Request                                  | Schema Error                                                            | Erro de Schema                                                            |
| 404                    | TED000009          | Account not found                            | Account not found for the given key: \{account_key\}                    | Conta não encontrada para a chave fornecida: \{account_ke\}               |
| 404                    | TED000020          | Not Found                                    | Ted was not found for the given parameters.                             | Ted não encontrada para os parâmetros fornecidos.                         |
| 404                    | TED000086          | Invalid Status                               | Ted not in pending_2fa_approval status                                  | Ted não está pendente de aprovação por autenticação de dois fatores |
| 400                    | TED000082          | Number of token validation attempts exceeded | The maximum number of failed token validation attempts has been reached | Número máximo de tentativas de validação de token atingida                |
| 400                    | TED000087          | Error Sending Token                          | An error occurred while resending token and its being investigated      | Um erro ocorreu ao reenviar token e está sendo investigado                |

---

# Approve Batch Transaction with Two-Factor Authentication

URL: /en/documentation/baas/ted/batch_2fa/aprovar_transacao_em_lote_ted_2fa

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted_batch/ TED_BATCH_KEY /validate_token
METHOD PUT

### Path Params

| Field           | Type   | Description                                              | Characters |
|-----------------|--------|----------------------------------------------------------|------------|
| `account_key`   | uuidv4 | Unique account identification key.                       | 36         |
| `ted_batch_key` | uuidv4 | Unique identification key for the TED batch transaction. | 36         |

## Authentication via Email and SMS

Request Body

```json
{
  "token": "329123"
}
```

## Authentication via Device

To approve and finalize device authentication, the request must be sent with an empty payload. Validation occurs internally, with no additional information required in the request body. Note that this endpoint should only be used after the [batch transaction request](./solicitacao_de_transacao_em_lote_ted_2fa.md) has been initiated.

Request Body

```json
{

}
```

## Body Params

| Field    | Type   | Description                                                                                        | Characters |
|----------|--------|----------------------------------------------------------------------------------------------------|------------|
| `token`  | string | Authentication code sent to the account movement approver **required for TFA via SMS or email**   | 6          |

## Response

STATUS 201

Response Body: Approved Batch

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "ted_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "ted_batch_status": "approved"
}
```

STATUS 4xx

Response Body: Rejected Batch

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {
    "ted_batch_data": {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "ted_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "ted_batch_status": "rejected"
    }
  }
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                            | Description (eng)<br/>`description`                                                                     | Description (ptbr)<br/>`translation`                                        |
|------------------------|--------------------|----------------------------------------------|----------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| 400                    | TED000082          | Number of token validation attempts exceeded | The maximum number of failed token validation attempts has been reached                                  | Número máximo de tentativas de validação de token atingida                  |
| 400                    | TED000083          | Token Expired                                | Token has expired. Resend token or recreate transferToken has expired. Resend token or recreate transfer | Token expirado. Reenvie token ou recrie a transferência                     |
| 400                    | TED000084          | Incorrect Token                              | Token sent does not match expected                                                                       | Token enviado não condiz com, o esperado                                    |
| 404                    | TED000101          | TedBatch not Found                           | Ted Batch was not found                                                                                  | TedBatch não encontrada                                                     |
| 400                    | TED000102          | Invalid Status                               | Ted Batch not in pending_2fa_approval status                                                             | Lote de Ted não está pendente de aprovação por autenticação de dois fatores || 400                    | TED000110          | Token Required                               | A token is required for SMS or email validation.                                                         | Um token é necessário para validação via SMS ou email.                                                     |

---

# Request Token Resend for a Batch TED Transaction

URL: /en/documentation/baas/ted/batch_2fa/solicitacao_de_reenvio_de_token_para_lote_ted

A new token will be generated and sent to the account movement approver. If the token validation attempt limit has been exceeded, resending will not be allowed.

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted_batch/ TED_BATCH_KEY /resend_token
METHOD PATCH

### Path Params

| Field             | Type   | Description                               | Characters |
|-------------------|--------|-------------------------------------------|------------|
| `account_key` *   | uuidv4 | Unique account identification key.        | 36         |
| `ted_batch_key` * | uuidv4 | Unique batch transaction identification key. | 36         |

Request Body

```json
{
  "contact_type": "sms"
}
```

## Body Params

| Field          | Type       | Description                              | Characters                                              |
|----------------|------------|------------------------------------------|---------------------------------------------------------|
| `contact_type` | enumerator | Authentication token delivery method    | **[contact_type Enumerator](#contact_type-enumerator)** |

:::info Information
If no `contact_type` is sent, the token will be sent in the originally requested format.
:::

### contact_type Enumerator

| Enumerator | Description                              |
|------------|------------------------------------------|
| **sms**    | Sent via Text Message to mobile phone   |
| **email**  | Sent via electronic mail                |

## Response

STATUS 202

Response Body: Requested Transaction

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "ted_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "ted_status": "pending_2fa_approval"
}
```

STATUS 4xx

Response Body: Transfer Rejected

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {
    "ted_data": {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "ted_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "ted_status": "rejected"
    }
  }
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                            | Description (eng)<br/>`description`                                     | Description (ptbr)<br/>`translation`                                       |
|------------------------|--------------------|----------------------------------------------|-------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| 400                    | QIT000001          | Bad Request                                  | Schema Error                                                            | Erro de Schema                                                              |
| 404                    | TED000009          | Account not found                            | Account not found for the given key: \{account_key\}                    | Conta não encontrada para a chave fornecida: \{account_ke\}                 |
| 404                    | TED000020          | Not Found                                    | Ted was not found for the given parameters.                             | Ted não encontrada para os parâmetros fornecidos.                           |
| 400                    | TED000082          | Number of token validation attempts exceeded | The maximum number of failed token validation attempts has been reached | Número máximo de tentativas de validação de token atingida                  |
| 400                    | TED000083          | Token Expired                                | Token has expired. Resend token or recreate transfer                    | Token expirado. Reenvie token ou recrie a transferência                     |
| 400                    | TED000084          | Incorrect Token                              | Token sent does not match expected                                      | Token enviado não condiz com, o esperado                                    |
| 404                    | TED000086          | Invalid Status                               | Ted not in pending_2fa_approval status                                  | Ted não está pendente de aprovação por autenticação de dois fatores         |
| 400                    | TED000087          | Error Sending Token                          | An error occurred while resending token and its being investigated      | Um erro ocorreu ao reenviar token e está sendo investigado                  |
| 404                    | TED000101          | TedBatch not Found                           | Ted Batch was not found                                                 | TedBatch não encontrada                                                     |
| 400                    | TED000102          | Invalid Status                               | Ted Batch not in pending_2fa_approval status                            | Lote de Ted não está pendente de aprovação por autenticação de dois fatores |

---

# Perform Batch Ted Transaction with Two-Factor Authentication

URL: /en/documentation/baas/ted/batch_2fa/solicitacao_de_transacao_em_lote_ted_2fa

QI Tech offers the possibility to perform multiple ted transactions with a single call. In this system, transactions
are performed asynchronously. If the initial call returns an **http status 4xx**, none of the
transactions will be performed. After the request, the integrating partner will receive a webhook for each transaction informing
the final status of the attempt, which can be **rejected** or **sent**.

In this type of transaction, payment confirmation is required via token sent to the person with authorization powers for
account movement in the crediting account.

The Ted transaction request by integrating partners configured to use two-factor authentication
is performed similarly to what is described
in [perform batch ted transaction](/documentation/baas/ted/batch/solicitacao_de_transacao_em_lote_ted). The difference
occurs in the addition of the `tfa_info` object, containing information about the transfer approver and the contact method, and the
status of a successful request which will always be **pending_2fa_approval**.

The notification event for sending the `token` to the approver is **baas.token_validation.ted.batch**. It is
possible to [customize](/documentation/notificacoes/template) the sent message.

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted_batch
METHOD POST

## Authentication via Email and SMS

Request Body: Batch Transfer with TFA via SMS or Email

```json
{
  "request_control_key": "6e4fc980-f8a1-4462-b6e2-d8a49f0ac055",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  },
  "teds": [
    {
      "request_control_key": "0c3d2a3e-c121-464e-b5a4-8e69e0c17bbd",
      "target_account": {
        "account_branch": "0001",
        "account_number": "92796",
        "account_digit": "1",
        "owner_document_number": "23599885000192",
        "owner_name": "Titular da Conta",
        "ispb": "12345678",
        "account_type": "checking_account"
      },
      "transaction_amount": 8.86
    },
    {
      "request_control_key": "ff9f2a48-918c-4911-9371-a496e37dccfc",
      "target_account": {
        "account_branch": "0001",
        "account_number": "92797",
        "account_digit": "2",
        "owner_document_number": "23599885000192",
        "owner_name": "Titular da Conta",
        "ispb": "12345678",
        "account_type": "checking_account"
      },
      "transaction_amount": 10.00
    }
  ]
}
```

## Authentication via Device

In addition to the existing authentication methods via **sms** and **email**, it is possible to authenticate the transaction using a previously [registered device](/documentation/baas/dispositivo/create/solicitacao_cadastro_dispositivo). In this case, the `session_id` must be obtained in the **Device Scan** and sent in `tfa_info`.

Request Body: Batch Transfer with TFA via Device

```json
{
  "request_control_key": "6e4fc980-f8a1-4462-b6e2-d8a49f0ac055",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "session_id": "b2f18d3a-67c2-4a7f-98e5-1d3f5c6b8a72",
    "contact_type": "device"
  },
  "teds": [
    {
      "request_control_key": "0c3d2a3e-c121-464e-b5a4-8e69e0c17bbd",
      "target_account": {
        "account_branch": "0001",
        "account_number": "92796",
        "account_digit": "1",
        "owner_document_number": "23599885000192",
        "owner_name": "Titular da Conta",
        "ispb": "12345678",
        "account_type": "checking_account"
      },
      "transaction_amount": 8.86
    },
    {
      "request_control_key": "ff9f2a48-918c-4911-9371-a496e37dccfc",
      "target_account": {
        "account_branch": "0001",
        "account_number": "92797",
        "account_digit": "2",
        "owner_document_number": "23599885000192",
        "owner_name": "Titular da Conta",
        "ispb": "12345678",
        "account_type": "checking_account"
      },
      "transaction_amount": 10.00
    }
  ]
}
```

## Path Params

| Field         | Type   | Description                            | Characters |
|---------------|--------|----------------------------------------|------------|
| `account_key` | uuidv4 | Unique account identification key. | 36         |

## Body Params

| Field                   | Type   | Description                                                                          | Characters                              |
|-------------------------|--------|------------------------------------------------------------------------------------|-----------------------------------------|
| `request_control_key` * | uuidv4 | Unique request identification key used by the client in uuid v4 format. | 36                                      | 
| `teds` *                | array  | List of ted objects linked to the batch.                                           | list of **[Ted Object](#ted-object)**  |
| `tfa_info`*             | Object | Object containing the document of the account approver and the contact method.    | **[tfa_info Object](#tfa_info-object)** |

## tfa_info Object

| Field                        | Type   | Description                                                                                   | Characters |
|------------------------------|--------|-----------------------------------------------------------------------------------------------|------------|
| `approver_document_number` * | string | Document number of the account approver.                                                      | 11         |
| `session_id`                 | string | Unique device session identification key in UUID v4 format (required for device TFA).         | 36         |
| `contact_type` *             | string | Contact method with the account approver, which can be **sms**, **email** or **device**       |            |

## Ted Object

| Field                   | Type   | Description                                                                          | Characters                                          |
|-------------------------|--------|------------------------------------------------------------------------------------|-----------------------------------------------------|
| `request_control_key` * | string | Unique request identification key used by the client in uuid v4 format. | 36                                                  |
| `target_account` *      | object | Target account                                                                   | **[target_account Object](#target_account-object)** | 
| `transaction_amount` *  | float  | Transfer amount                                                             | 10                                                  |

## target_account Object

| Field                     | Type   | Description                                           | Characters                                              |
|---------------------------|--------|-----------------------------------------------------|---------------------------------------------------------|
| `account_branch` *        | string | Branch.                                            | 4                                                       |
| `account_digit` *         | string | Account digit                                     | 1                                                       |
| `account_number` *        | string | Account number.                                    | 20                                                      |
| `owner_document_number` * | string | CPF or CNPJ (numbers only) of the account holder.   | 14                                                      |
| `owner_name` *            | string | Name of the account holder.                           | 50                                                      |
| `account_type`*           | string | Account type.                                      | **[account_type Enum](#account_type-enum)** |
| `ispb` *                  | string | Based on the financial institution's CNPJ (8 digits). | 8                                                       |

## account_type Enum

| Enum             | Translation              |
|------------------------|-----------------------|
| **checking_account**   | checking account        |
| **deposit_account**    | deposit account        |
| **guaranteed_account** | guaranteed account     |
| **investment_account** | investment account |
| **payment_account**    | payment account    |
| **saving_account**     | savings account        |

## Response

STATUS 202

Response Body: Batch Transfer Requested

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "ted_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "ted_batch_status": "pending_2fa_approval"
}
```

### ted_batch_status Enum

| Enum               | Description                                                                  |
|--------------------------|----------------------------------------------------------------------------|
| **approved**             | Batch transfer approved and transactions in execution process.       |
| **rejected**             | Batch transfer rejected                                            |
| **pending_2fa_approval** | Batch scheduling pending approval by two-factor authentication |
| **cancelled**            | Batch transfer cancelled                                            |

STATUS 4xx

Response Body: Transfer Rejected

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {
    "ted_batch_data": {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "ted_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "ted_batch_status": "rejected"
    }
  }
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

:::info Information
The errors previously listed for [Ted transfer](/documentation/baas/ted/solicitacao_de_transacao_em_lote_ted)
are
subject to being returned by this endpoint in addition to the errors listed below.
:::

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                 | Description (eng)<br/>`description`                                     | Description (ptbr)<br/>`translation`                               |
|--------------------------|----------------------|------------------------------------|-----------------------------------------------------------------------|------------------------------------------------------------------|
| 400                      | TED000079            | No approver permission             | Given document number does not belong to an approver for this account | Número de documento enviado não pertence a um aprovador da conta |
| 400                      | TED000080            | tfa_info is required               | Client must send object tfa_info                                      | Cliente deve enviar objeto tfa_info                              |
| 400                      | TED000081            | Error occurred while sending token | An unexpected error occurred while sending token                      | Um erro inexperado ocorreu ao tentar enviar token                |

---

# Introduction to TED Batch Transactions

URL: /en/documentation/baas/ted/batch/introducao_a_transacao_em_lote_ted

QI Tech offers the possibility to perform multiple TED transactions with a single call. In this system, transactions
are performed asynchronously. If a **4xx http status** is returned in the initial call, none of the
transactions will be performed. After the request, the integrator partner will receive a webhook for each transaction informing
the final status of the attempt, which can be **rejected** or **sent**.

## Two-Factor Authentication

Just like in TED transactions, integrator partners with two-factor authentication configuration must send the
`tfa_info` object with contact information and token sending details.

---

# List TED Transactions from a Batch of an Account

URL: /en/documentation/baas/ted/batch/listar_transacoes_de_um_lote_de_transacoes_ted

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted_batch/ TED_BATCH_KEY /teds
METHOD GET

### Path Params

| Field           | Type   | Description                                       | Characters |
|-----------------|--------|---------------------------------------------------|------------|
| `account_key`   | uuidv4 | Unique account identification key.                | 36         |
| `ted_batch_key` | uuidv4 | Unique batch transaction identification key.      | 36         |

### Query Params

| Field                 | Type    | Description                                                             | Characters                                          |
|-----------------------|---------|-------------------------------------------------------------------------|-----------------------------------------------------|
| `request_control_key` | uuidv4  | Unique request identification key used by the client.                   | 36                                                  |
| `ted_status`          | string  | TED transaction status. Can be sent as a list.                         | **[ted_status Enumerator](#enumerador-ted_status)** |
| `date_from`           | string  | Start date. Format "YYYY-MM-DD"                                        | 10                                                  |
| `date_to`             | string  | End date. Format "YYYY-MM-DD"                                          | 10                                                  |
| `page`                | integer | Requested page number. 1 by default                                    |                                                     |
| `page_size`           | integer | Requested page size in the query. 30 by default and maximum value      | Maximum value of 30                                 |

## ted_status Enumerator

| Enumerator   | Description                             |
|--------------|-----------------------------------------|
| **sent**     | TED transfer completed successfully.    |
| **pending**  | TED transfer pending.                   |
| **rejected** | TED transfer rejected.                  |
| **returned** | TED transfer returned.                  |

### Response

STATUS 200

Response Body

```json
{
  "data": [
    {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "ted_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "ted_status": "sent"
    },
    {
      "request_control_key": "697c07c3-5398-48d2-a418-853323f85f97",
      "ted_key": "e95eabdb-4520-4c3d-a76f-99cb5b64724b",
      "ted_status": "sent"
    },
    {
      "request_control_key": "ca35c526-b5a0-40d7-8c56-8566c77a34f4",
      "ted_key": "58d2fa9e-42ec-4779-b2fc-14ec98cbdca8",
      "ted_status": "rejected"
    }
  ],
  "pagination": {
    "current_page": 1,
    "rows_per_page": 30
  }
}

```

---

# List Batch Transactions from an Account

URL: /en/documentation/baas/ted/batch/listar_transacoes_em_lote_ted_de_uma_conta

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted_batches
METHOD GET

### Path Params

| Field         | Type   | Description                              | Characters |
|---------------|--------|------------------------------------------|------------|
| `account_key` | uuidv4 | Unique account identification key.       | 36         |

### Query Params

| Field                 | Type    | Description                                                              | Characters                                                      |
|-----------------------|---------|--------------------------------------------------------------------------|-----------------------------------------------------------------|
| `request_control_key` | uuidv4  | Unique request identification key used by the client.                   | 36                                                              |
| `ted_batch_status`    | uuidv4  | TED batch transactions status. Can be sent as a list.                   | **[ted_batch_status Enumerator](#enumerator-ted_batch_status)** |
| `date_from`           | string  | Start date. Format "YYYY-MM-DD"                                         | 10                                                              |
| `date_to`             | string  | End date. Format "YYYY-MM-DD"                                           | 10                                                              |
| `page`                | integer | Requested page number. Default is 1                                     |                                                                 |
| `page_size`           | integer | Requested page size for the query. Default is 30 and maximum value     | Maximum value of 30                                             |

### Enumerator ted_batch_status

| Enumerator               | Description                                                                        |
|--------------------------|------------------------------------------------------------------------------------|
| **approved**             | Batch transfer approved and transactions in execution process.                     |
| **rejected**             | Batch transfer rejected                                                            |
| **pending_2fa_approval** | Batch scheduling pending approval by two-factor authentication                     |
| **cancelled**            | Batch transfer cancelled                                                           |

### Response

STATUS 200

Response Body

```json
{
  "data": [
    {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "ted_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "ted_batch_status": "approved"
    },
    {
      "request_control_key": "939d1503-aa5a-49a6-ae3b-ff84122a6dd3",
      "ted_batch_key": "03cf9181-0eb9-480e-8bb4-66a5a9a6410e",
      "ted_batch_status": "rejected"
    },
    {
      "request_control_key": "43a14f3a-b2af-4a0e-8a74-70af2fca74a9",
      "ted_batch_key": "94ab9fad-9c65-4117-b9c3-a47b1269508f",
      "ted_batch_status": "approved"
    }
  ],
  "pagination": {
    "current_page": 1,
    "next_page": null,
    "rows_per_page": 30
  }
}

```

---

# Perform Ted Transaction in Batch

URL: /en/documentation/baas/ted/batch/solicitacao_de_transacao_em_lote_ted

QI Tech offers the possibility to perform multiple ted transactions with a single call. In this system, transactions
are performed asynchronously. If an **http status 4xx** is returned in the initial call, none of the
transactions will be performed. After the request, the integrating partner will receive a webhook for each transaction informing
the final status of the attempt, which can be **rejected** or **sent**.

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted_batch
METHOD POST

```json
{
  "request_control_key": "6e4fc980-f8a1-4462-b6e2-d8a49f0ac055",
  "teds": [
    {
      "request_control_key": "0c3d2a3e-c121-464e-b5a4-8e69e0c17bbd",
      "target_account": {
        "account_branch": "0001",
        "account_number": "92796",
        "account_digit": "1",
        "owner_document_number": "23599885000192",
        "owner_name": "Titular da Conta",
        "ispb": "12345678",
        "account_type": "checking_account"
      },
      "transaction_amount": 8.86
    }
  ]
}
```

## Path Params

| Field         | Type   | Description                                     | Characters |
|---------------|--------|-------------------------------------------------|------------|
| `account_key` | uuidv4 | Unique account identification key.              | 36         |

## Body Params

| Field                   | Type   | Description                                                                              | Characters                       |
|-------------------------|--------|------------------------------------------------------------------------------------------|----------------------------------|
| `request_control_key` * | uuidv4 | Unique request identification key used by the client in uuid v4 format.                 | 36                               | 
| `teds` *                | array  | List of ted objects linked to the batch.                                                | list of **[Ted object](#objeto-ted)** |

## Ted object

| Field                   | Type   | Description                                                                              | Characters                                    |
|-------------------------|--------|------------------------------------------------------------------------------------------|-----------------------------------------------|
| `request_control_key` * | string | Unique request identification key used by the client in uuid v4 format.                 | 36                                            |
| `target_account` *      | object | Destination account                                                                      | **[target_account object](#objeto-target_account)** | 
| `transaction_amount` *  | float  | Transfer amount                                                                          | 10                                            |

## target_account object

| Field                     | Type   | Description                                         | Characters                                        |
|---------------------------|--------|-----------------------------------------------------|---------------------------------------------------|
| `account_branch` *        | string | Branch.                                             | 4                                                 |
| `account_digit` *         | string | Account digit                                       | 1                                                 |
| `account_number` *        | string | Account number.                                     | 20                                                |
| `owner_document_number` * | string | CPF or CNPJ (numbers only) of the account holder.  | 14                                                |
| `owner_name` *            | string | Account holder name.                                | 50                                                |
| `account_type`*           | string | Account type.                                       | **[account_type enumerator](#enumerador-account_type)** |
| `ispb` *                  | string | Based on financial institution CNPJ (8 digits).    | 8                                                 |

## account_type enumerator

| Enumerator             | Translation           |
|------------------------|-----------------------|
| **checking_account**   | checking account      |
| **deposit_account**    | deposit account       |
| **guaranteed_account** | guaranteed account    |
| **investment_account** | investment account    |
| **payment_account**    | payment account       |
| **saving_account**     | savings account       |

## Response

STATUS 201

Response Body: Batch Transfer Approved

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "ted_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "ted_batch_status": "approved"
}
```

### ted_batch_status enumerator

| Enumerator               | Description                                                                 |
|--------------------------|-----------------------------------------------------------------------------|
| **approved**             | Batch transfer approved and transactions in execution process.              |
| **rejected**             | Batch transfer rejected                                                     |
| **pending_2fa_approval** | Batch scheduling pending approval by two-factor authentication             |
| **cancelled**            | Batch transfer cancelled                                                    |

STATUS 4xx

Response Body: Batch Rejected

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {
    "ted_batch_data": {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "ted_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "ted_batch_status": "rejected"
    }
  }
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

:::info Information
The errors previously listed for [Ted transfer](/documentation/baas/ted/realizar_transferencia) are
liable to be returned by this endpoint.
:::

---

# Consult TED

URL: /en/documentation/baas/ted/consultar_ted

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted/ TED_KEY / TED_DIRECTION
METHOD GET

## Request Path Params

| Field             | Type   | Description                                                  | Characters                                      |
|-------------------|--------|--------------------------------------------------------------|-------------------------------------------------|
| `ted_direction` * | string | Filter to indicate whether a transaction is inbound or outbound. | **[Enum ted_direction](#enums-ted_direction)** |
| `account_key` *   | uuidv4 | Unique identification key of the QI account.                 | 36                                              |
| `ted_key` *       | uuidv4 | Unique identification key of the TED transfer.               | 36                                              |

## Enumerators ted_direction

| Enumerator | Translation |
|------------|----------|
| incoming   | entrada  |
| outgoing   | saída    |

:::caution Attention
Viewing a transfer will only be permitted if the requester has permissions on the outgoing account for transactions with a ted_direction of outgoing, or has permissions on the incoming account for transactions with a ted_direction of incoming. Otherwise, a not found error will be returned.
:::

## Response

STATUS 200

Response Body: Rejected Transfer (outgoing)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "ted_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "created_at": "2021-10-22T20:30:23.459Z",
  "ted_status": "rejected",
  "transaction_amount": 126.97,
  "fee_amount": 0.0,
  "target_account": {
    "account_branch": "0001",
    "account_digit": "6",
    "account_number": "78340",
    "ispb": "12345678",
    "owner_document_number": "32402502000135",
    "owner_name": "QI Tech"
  },
  "refusal_reason": {
    "refusal_code": 1,
    "enumerator": "conta_destinatario_encerrada",
    "description": "Conta Destinatária do Crédito Encerrada"
  }
}
```

Response Body: Transfer Sent (outgoing)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "ted_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "created_at": "2021-10-22T20:30:23.459Z",
  "ted_status": "sent",
  "transaction_amount": 126.97,
  "fee_amount": 0.0,
  "target_account": {
    "account_branch": "0001",
    "account_digit": "6",
    "account_number": "78340",
    "ispb": "12345678",
    "owner_document_number": "32402502000135",
    "owner_name": "QI Tech"
  },
  "refusal_reason": {}
}
```

Response Body: Transfer Received (incoming)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "ted_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "created_at": "2021-10-22T20:30:23.459Z",
  "ted_status": "received",
  "transaction_amount": 126.97,
  "fee_amount": 0.0,
  "source_account": {
    "account_branch": "0001",
    "account_digit": "6",
    "account_number": "78340",
    "ispb": "12345678",
    "owner_document_number": "32402502000135",
    "owner_name": "QI Tech"
  },
  "refusal_reason": {}
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in Portuguese",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code`     | Title<br/>`title`         | Description (eng)<br/>`description`                          | Description (ptbr)<br/>`translation`                                             |
|------------------------|------------------------|--------------------------|-----------------------------------|------------------------------------------------------------------------|
| 404                    | TED000XXX              | Outgoing TED Not Found   | Ted key \{ted_key\} was not found | Transferência Ted de saída com chave \{ted_key\} não foi encontrada.                  |
| 404                    | TED000XXX              | Incoming TED Not Found   | Ted key \{ted_key\} was not found | Transferência Ted de entrada com chave \{ted_key\} não foi encontrada.                |

---

# Tabela de Erros para Ted

URL: /en/documentation/baas/ted/erros_ted

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| Código HTTP<br/>`status` | Código QI<br/>`code` | Título<br/>`title`                                  | Descrição (eng)<br/>`description`                                                                                                                                                                                        | Descrição (ptbr)<br/>`translation`                                                                                                                                                                                    |
|--------------------------|----------------------|-----------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                         | schema error description                                                                                                                                                                                                 | Schema Inválido                                                                                                                                                                                                       |
| 500                      | QIT000500            | Internal Error                                      | An internal error has occurred and its being investigated.                                                                                                                                                               | Um erro interno aconteceu e está sendo investigado                                                                                                                                                                    |
| 400                      | TED000001            | Bad Request                                         | Account already have a fee created                                                                                                                                                                                       | A conta já tem uma taxa criada                                                                                                                                                                                        |
| 400                      | TED000002            | Bad Request                                         | Fee not already created                                                                                                                                                                                                  | Taxa ainda não criada                                                                                                                                                                                                 |
| 403                      | TED000003            | Unauthorized                                        | This agent can not add a financial institution.                                                                                                                                                                          | Este agente não pode adicionar uma instituição financeira.                                                                                                                                                            |
| 400                      | TED000004            | Bad Request                                         | The cockpit_key must be unique (error raised on commit: \{msg\})                                                                                                                                                         | A cockpit_key deve ser exclusiva (erro gerado no commit: \{msg\})                                                                                                                                                     |
| 400                      | TED000005            | Bad Request                                         | Event for the provided transaction_code not implemented                                                                                                                                                                  | Evento para a transaction_code fornecida não implementado                                                                                                                                                             |
| 404                      | TED000006            | Target account Not Found                            | Target account was not found for given parameters                                                                                                                                                                        | Conta destino não encontrada para os parâmetros informados                                                                                                                                                            |
| 400                      | TED000007            | Bad Request                                         | A related_account_key must be provided                                                                                                                                                                                   | Uma chave related_account_key deve ser fornecida                                                                                                                                                                      |
| 404                      | TED000008            | Not Found                                           | No related_account found                                                                                                                                                                                                 | Nenhuma conta relacionada encontrada                                                                                                                                                                                  |
| 404                      | TED000009            | Not Found                                           | Account not found for the given key: \{account_key\}                                                                                                                                                                     | Conta não encontrada para a chave fornecida: \{account_key\}                                                                                                                                                          |
| 400                      | TED000010            | Bad Request                                         | Account already registered                                                                                                                                                                                               | Conta já registrada                                                                                                                                                                                                   |
| 400                      | TED000011            | Bad Request                                         | Wrong day/time for TED                                                                                                                                                                                                   | Dia/hora incorretos para a TED                                                                                                                                                                                        |
| 400                      | TED000012            | Bad Request                                         | The target's length of the account + account_digit cannot be larger than 21                                                                                                                                              | O número de digitos na conta de destino + digito não pode ser maior que 21                                                                                                                                            |
| 400                      | TED000013            | Bad Request                                         | Unable to find source_account_key's account                                                                                                                                                                              | Não foi possível encontrar a conta com source_account_key fornecido                                                                                                                                                   |
| 403                      | TED000014            | Invalid target account                              | Invalid target account                                                                                                                                                                                                   | Conta destino inválida                                                                                                                                                                                                |
| 400                      | TED000015            | Bad Request                                         | Account blocked or closed can not perform this action                                                                                                                                                                    | A conta bloqueada ou fechada não pode executar esta ação                                                                                                                                                              |
| 400                      | TED000016            | Bad Request                                         | Hub account can not perform this action                                                                                                                                                                                  | A conta hub não pode executar esta ação                                                                                                                                                                               |
| 403                      | TED000017            | Unauthorized                                        | Provided account does not have approval credential for the given person                                                                                                                                                  | A conta fornecida não possui credencial de aprovação para a pessoa especificada                                                                                                                                       |
| 403                      | TED000018            | Unauthorized                                        | Provided account not owned by SELECTED_AGENT                                                                                                                                                                             | Conta fornecida não pertencente ao SELECTED_AGENT                                                                                                                                                                     |
| 400                      | TED000019            | Bad Request                                         | Scheduling not implemented yet                                                                                                                                                                                           | Agendamento ainda não implementado                                                                                                                                                                                    |
| 404                      | TED000020            | Not Found                                           | Ted was not found for the given parameters.                                                                                                                                                                              | Ted não encontrada para os parâmetros fornecidos.                                                                                                                                                                     |
| 400                      | TED000021            | Bad Request                                         | A ted_type must be provided                                                                                                                                                                                              | Um tipo de ted deve ser fornecido                                                                                                                                                                                     |
| 400                      | TED000022            | Bad Request                                         | Ted not found for the given IF Control Number                                                                                                                                                                            | Ted não encontrada para o número de controle da IF fornecida                                                                                                                                                          |
| 422                      | TED000023            | Bad Request                                         | Unable to process message due to the current status (\{current_status\}). Messages of the type \{bacen_message_code\} are allowed to happen on teds with status \{allowed_status\}. [ted_type = \{type\}, key = \{key\}] | Não foi possível processar a mensagem devido ao status atual (\{current_status\}). Mensagens do tipo \{bacen_message_code\} podem ocorrer em teds com status \{allowed_status\}. [Ted_type = \{type\}, key = \{key\}] |
| 403                      | TED000024            | Unauthorized                                        | This agent can not add rules.                                                                                                                                                                                            | Este agente não pode adicionar regras.                                                                                                                                                                                |
| 403                      | TED000025            | Unauthorized                                        | This agent can not add rules types.                                                                                                                                                                                      | Este agente não pode adicionar tipos de regras.                                                                                                                                                                       |
| 400                      | TED000026            | Bad Request                                         | \{ted_rule_type_enum\} was not found among registered rules.                                                                                                                                                             | \{ted_rule_type_enum\} não encontrada dentro das regras registradas.                                                                                                                                                  |
| 400                      | TED000027            | Bad Request                                         | Mismatch between rule data and rule schema: \{message\}                                                                                                                                                                  | Incompatibilidade entre os dados da regra e o esquema de regra: \{message\}                                                                                                                                           |
| 400                      | TED000028            | Bad Request                                         | Both source_account_key and source_document_number are not null. At least one of them should be null.                                                                                                                    | Tanto a source_account_key quanto o source_document_number estão preenchidos. Pelo menos um dos dois deve ser nulo.                                                                                                   |
| 422                      | TED000029            | Unprocessable Entity                                | \{object_name\} has invalid type \{object_type\}                                                                                                                                                                         | \{object_name\} possui tipo inválido \{object_type\}                                                                                                                                                                  |
| 400                      | TED000030            | Empty ted list received                             | A list of teds must be provided                                                                                                                                                                                          | Uma lista de transferências ted deve ser fornecida                                                                                                                                                                    |
| 400                      | TED000031            | Bad Request                                         | ISPB number \{ispb\} does not exist or is inactive                                                                                                                                                                       | ISPB \{ispb\} não existe ou está inativo                                                                                                                                                                              |
| 404                      | TED000032            | Not Found                                           | Account limit request with key \{account_limit_request_key\} was not found.                                                                                                                                              | Pedido de limite com chave \{account_limit_request_key\} não encontrado.                                                                                                                                              |
| 400                      | TED000033            | Bad Request                                         | An account limit request with status \{status\} does not allow this operation.                                                                                                                                           | Pedido de limite com chave \{status\} não permite essa operação                                                                                                                                                       |
| 400                      | TED000034            | Bad Request                                         | Account limit request \{account_limit_request_key\} is not approved then cannot be executed.                                                                                                                             | Pedido de limite \{account_limit_request_key\} não foi aprovado portanto não pode ser executado                                                                                                                       |
| 406                      | TED000035            | Not Acceptable                                      | It is not possible to request changes in limits for different accounts.                                                                                                                                                  | Não é possível realziar pedidos de mudanças de limites para contas diferentes.                                                                                                                                        |
| 400                      | TED000036            | Bad Request                                         | Transfer rejected by the system                                                                                                                                                                                          | A transferência foi recusada pelo sistema                                                                                                                                                                             |
| 400                      | TED000037            | Bad Request                                         | The account \{account_key\} already has a pending request for limit type \{account_limit_type\}.                                                                                                                         | A conta \{account_key\} ja possui um pedido do tipo \{account_limit_type\} pendente.                                                                                                                                  |
| 409                      | TED000038            | Conflict                                            | Ted \{outgoing_ted_key\} is not pending analysis therefore cannot be updated.                                                                                                                                            | Ted \{outgoing_ted_key\} não está pendente de análise portanto não pode ser atualizada.                                                                                                                               |
| 400                      | TED000039            | Bad Request                                         | Your centralized billing account is closed, please contact support.                                                                                                                                                      | Sua conta de tarifas centralizadas está fechada, favor entrar em contato com o suporte.                                                                                                                               |
| 400                      | TED000040            | Bad Request                                         | Your centralized billing account has insufficient funds, please contact support.                                                                                                                                         | Sua conta de tarifas centralizadas não possui saldo sufciente, favor entrar em contato com o suporte.                                                                                                                 |
| 400                      | TED000041            | Bad Request                                         | Pending fraud analysis return                                                                                                                                                                                            | Retorno pendente da análise de fraude                                                                                                                                                                                 |
| 400                      | TED000042            | Ted Direction Invalid                               | Ted Direction must be either outgoing or incoming                                                                                                                                                                        | Ted Direction deve ser outgoing ou incoming                                                                                                                                                                           |
| 400                      | TED000043            | Ted Key needed                                      | A ted_key must be provided                                                                                                                                                                                               | Uma ted_key deve ser fornecida                                                                                                                                                                                        |
| 400                      | TED000044            | Invalid Timestamp Format sent                       | Given parameter is not in the correct format \{timestamp_format\}                                                                                                                                                        | Parametro enviado não está no formato correto \{timestamp_format\}                                                                                                                                                    |
| 400                      | TED000045            | Search Params Error                                 | Invalid integer value for page or size querystring parameters                                                                                                                                                            | Valor inválido para parâmetros de página ou tamanho de página                                                                                                                                                         |
| 400                      | TED000046            | Invalid uuid v4 string sent                         | \{key\} was not accepted for not being a valid uuid v4 string                                                                                                                                                            | \{key\} não foi aceito por não ser uma palavra uuid v4 válida                                                                                                                                                         |
| 404                      | TED000047            | Not found                                           | Incoming Ted with key \{incoming_ted_key\} was not found.                                                                                                                                                                | Ted de entrada com chave \{incoming_ted_key\} não foi encontrado.                                                                                                                                                     |
| 400                      | TED000048            | Bad Request                                         | The status of the incoming ted is not approved.                                                                                                                                                                          | O status do ted de entrada não é aprovado.                                                                                                                                                                            |
| 400                      | TED000049            | Bad Request                                         | Invalid message type: \{message_type\}                                                                                                                                                                                   | Tipo de mensagem inválido: \{message_type\}                                                                                                                                                                           |
| 400                      | TED000050            | Bad Request                                         | Refusal reason \{refusal_reason_enumerator\} not found                                                                                                                                                                   | Motivo de recusa \{refusal_reason_enumerator\} não encontrado                                                                                                                                                         |
| 400                      | TED000051            | Barcode payment Not implemented for this endpoint   | Barcode payment Not implemented for this endpoint                                                                                                                                                                        | Pagamento de código de barras não implementado para este endpoint                                                                                                                                                     |
| 400                      | TED000052            | Invalid Source Subtype                              | Source Subtype \{source_subtype\} is invalid                                                                                                                                                                             | Source Subtype \{source_subtype\} é inválido                                                                                                                                                                          |
| 400                      | TED000053            | Invalid Target Account Type                         | Target Account Type \{account_type\} is invalid                                                                                                                                                                          | Tipo de conta destino \{account_type\} é inválido                                                                                                                                                                     |
| 400                      | TED000054            | Invalid Transaction Amount                          | Transaction Amount \{transaction_amount\} is invalid                                                                                                                                                                     | Valor de transação \{transaction_amount\} é inválido                                                                                                                                                                  |
| 400                      | TED000055            | Invalid Observation                                 | Observation sent is invalid                                                                                                                                                                                              | Observação enviada é inválida                                                                                                                                                                                         |
| 400                      | TED000057            | Invalid Document Number                             | Given \{document_number\} document number is invalid                                                                                                                                                                     | CPF/CNPJ \{document_number\} fornecido não é valido                                                                                                                                                                   |
| 400                      | TED000058            | Bad Request                                         | Insufficient account balance for transfer and fee amount                                                                                                                                                                 | Saldo de conta insuficiente para a transação e a taxa                                                                                                                                                                 |
| 400                      | TED000059            | Bad Request                                         | Unmapped transaction error received                                                                                                                                                                                      | Erro transacional não mapeado recebido                                                                                                                                                                                |
| 400                      | TED000060            | Bad Request                                         | Billing Account is closed                                                                                                                                                                                                | Conta centralizadora de pagamentos de tarifa fechada                                                                                                                                                                  |
| 400                      | TED000061            | Bad Request                                         | Billing Account without necessary funds                                                                                                                                                                                  | Conta centralizadora de pagamentos sem saldo necessário                                                                                                                                                               |
| 400                      | TED000062            | Bad Request                                         | Error while performing outgoing ted refusal transfer                                                                                                                                                                     | Erro ao realizar transferência ted de rejeição                                                                                                                                                                        |
| 400                      | TED000063            | Internal Error                                      | Error while sending outgoing ted str. Ted_key: \{outgoing_ted_key\}                                                                                                                                                      | Erro ao enviar str de ted de saída. Ted_key: \{outgoing_ted_key\}                                                                                                                                                     |
| 409                      | TED000064            | Bad Request                                         | request_control_key \{request_control_key\} already in use                                                                                                                                                               | request_control_key \{request_control_key\} já utilizada                                                                                                                                                              |
| 400                      | TED000065            | Bad Request                                         | It has been identified by request_control_key that this request is already being processed                                                                                                                               | Foi identificado por request_control_key que está requisição está sendo processada                                                                                                                                    |
| 400                      | TED000067            | Error loading fees                                  | Failed to load fees for account \{account_key\}                                                                                                                                                                          | Falha ao carregar tarifas para conta \{account_key\}                                                                                                                                                                  |
| 400                      | TED000068            | Bad Request                                         | Transfer rejected by th system                                                                                                                                                                                           | A transferência foi recusada pelo sistema                                                                                                                                                                             |
| 404                      | TED000069            | Account Not Found                                   | Account was not found for given parameters                                                                                                                                                                               | Conta não encontrada para os parâmetros informados                                                                                                                                                                    |
| 400                      | TED000070            | Bad Request                                         | Insufficient account balance fee amount in billing account                                                                                                                                                               | Saldo de conta centralizadora insuficiente para taxa                                                                                                                                                                  |
| 400                      | TED000071            | Bad Request                                         | Transaction cannot be made due to already blocked balance                                                                                                                                                                | Transação não pode ser feita pois saldo em conta bloqueado                                                                                                                                                            |
| 400                      | TED000072            | Invalid target ispb                                 | Target ispb must be external                                                                                                                                                                                             | ISPB de destino deve ser externo                                                                                                                                                                                      |
| 404                      | TED000073            | Person Not Found                                    | Person with key \{person_key\} not found                                                                                                                                                                                 | Pessoa com chave \{person_key\} não encontrada                                                                                                                                                                        |
| 400                      | TED000074            | Invalid caas_client_key                             | There caas_client_key is not valid                                                                                                                                                                                       | A caas_client_key enviada não é válida                                                                                                                                                                                |
| 400                      | TED000075            | Invalid Requester Configuration Info                | The configuration \{configuration\} format sent is not valid                                                                                                                                                             | O formato enviado da configuração \{configuration\} não é válido                                                                                                                                                      |
| 404                      | TED000076            | Requester Configuration not found                   | There is no Requester Configuration attributed to requester_key given                                                                                                                                                    | Não há Requester Configuration para a requester_key enviada                                                                                                                                                           |
| 400                      | TED000077            | Bad Request                                         | Requester Configuration already exists for \{requester_key\}                                                                                                                                                             | Requester Configuration já existe para o \{requester_key\}                                                                                                                                                            |
| 403                      | TED000078            | Requester not allowed to access this endpoint       | Requester has no permission to perform ted transfers on this endpoint                                                                                                                                                    | Requester não possui permissão de realizar transações ted através deste endpoint                                                                                                                                      |
| 403                      | TED000079            | No approver permission                              | Given document number does not belong to an approver for this account                                                                                                                                                    | Número de documento enviado não pertence a um aprovador da conta                                                                                                                                                      |
| 400                      | TED000080            | tfa_info is required                                | Client must send object tfa_info                                                                                                                                                                                         | Cliente deve enviar objeto tfa_info                                                                                                                                                                                   |
| 400                      | TED000081            | Error occurred while sending token                  | An unexpected error occurred while sending token                                                                                                                                                                         | Um erro inexperado ocorreu ao tentar enviar token                                                                                                                                                                     |
| 400                      | TED000082            | Number of token validation attempts exceeded        | The maximum number of failed token validation attempts has been reached                                                                                                                                                  | Número máximo de tentativas de validação de token atingida                                                                                                                                                            |
| 400                      | TED000083            | Token Expired                                       | Token has expired. Resend token or recreate transfer                                                                                                                                                                     | Token expirado. Reenvie token ou recrie a transferência                                                                                                                                                               |
| 400                      | TED000084            | Incorrect Token                                     | Token sent does not match expected                                                                                                                                                                                       | Token enviado não condiz com, o esperado                                                                                                                                                                              |
| 400                      | TED000085            | Error Validating Token                              | An error occurred while validating token and it is being investigated                                                                                                                                                    | Um erro ocorreu ao validar token e está sendo investigado                                                                                                                                                             |
| 400                      | TED000086            | Invalid Status                                      | Ted not in pending_2fa_approval status                                                                                                                                                                                   | Ted não está pendente de aprovação por autenticação de dois fatores                                                                                                                                                   |
| 400                      | TED000087            | Error Sending Token                                 | An error occurred while resending token and its being investigated                                                                                                                                                       | Um erro ocorreu ao reenviar token e está sendo investigado                                                                                                                                                            |
| 403                      | TED000088            | Bad Request                                         | Could not complete the transaction and the transaction was rejected. Try again                                                                                                                                           | Não foi possível concluir a transação e a transferência foi rejeitada. Tente novamente                                                                                                                                |
| 400                      | TED000089            | Invalid Schedule Date                               | Schedule date must be after current date for UTC-3                                                                                                                                                                       | Data de agendamento deve ser após a data atual em UTC-3                                                                                                                                                               |
| 400                      | TED000090            | Invalid Schedule Date                               | Schedule date must be a workday                                                                                                                                                                                          | Data de agendamento deve ser um dia útil                                                                                                                                                                              |
| 400                      | TED000091            | Target Account and Source Account must be different | Target Account must not be the same as Source Account                                                                                                                                                                    | A conta de destino não pode ser a mesma da conta de origem                                                                                                                                                            |
| 400                      | TED000092            | Invalid reason code                                 | Invalid reason code                                                                                                                                                                                                      | Motivo inválido                                                                                                                                                                                                       |
| 404                      | TED000093            | TedSchedule not Found                               | TedSchedule was not found                                                                                                                                                                                                | TedSchedule não encontrada                                                                                                                                                                                            |
| 400                      | TED000094            | Bad Request                                         | Ted Schedule cannot be cancelled in current status                                                                                                                                                                       | Agendamento Ted não pode ser cancelado no status atual                                                                                                                                                                |
| 400                      | TED000095            | Bad Request                                         | The given Ted Schedule is tied to a batch. It cannot be individually cancelled                                                                                                                                           | O agendamento Ted enviado está ligado a um lote. Ela não pode ser individualmente cancelada                                                                                                                           |
| 400                      | TED000096            | Bad Request                                         | Action cannot be taken place as there is currently a pending transfer in progress                                                                                                                                        | A ação não pôde ser completada como há uma transferência pendente                                                                                                                                                     |
| 400                      | TED000098            | Bad Request                                         | The outgoing ted was returned                                                                                                                                                                                            | A transferência ted de saída foi devolvida                                                                                                                                                                            |
| 400                      | TED000099            | Invalid Status                                      | Ted Schedule not in pending_2fa_approval status                                                                                                                                                                          | Agendamento Ted não está pendente de aprovação por autenticação de dois fatores                                                                                                                                       |
| 400                      | TED000100            | Invalid Schedule Date                               | Schedule must be approved before the scheduled date                                                                                                                                                                      | Agendamento deve ser aprovado em data anterior à programada para transação                                                                                                                                            |
| 404                      | TED000101            | TedBatch not Found                                  | TedBatch was not found                                                                                                                                                                                                   | TedBatch não encontrada                                                                                                                                                                                               |
| 400                      | TED000102            | Invalid Status                                      | Ted Batch not in pending_2fa_approval status                                                                                                                                                                             | Lote de Ted não está pendente de aprovação por autenticação de dois fatores                                                                                                                                           |
| 404                      | TED000103            | ScheduleBatch not Found                             | Ted Schedule Batch was not found                                                                                                                                                                                         | Agendamento de Ted em lote não encontrado                                                                                                                                                                             |
| 400                      | TED000104            | Invalid Status                                      | Schedule Batch cannot be cancelled in current status                                                                                                                                                                     | Lote de agendamento não pode ser cancelado no status atual                                                                                                                                                            |
| 400                      | TED000105            | Schedule Batch could not be cancelled               | ScheduleBatch could not be cancelled due to current date being equal or after earliest schedule date. Cancel schedules one by one                                                                                        | ScheduleBatch não pode ser cancelada devido a data atual ser superior ou igual à menor schedule_date. Cancele agendamentos individualmente                                                                            |
| 400                      | TED000106            | Invalid Status                                      | ScheduleBatch not in pending_2fa_approval status                                                                                                                                                                         | Lote Agendamentos de Ted não está pendente de aprovação por autenticação de dois fatores                                                                                                                              |
| 400                      | TED000107            | Schedule Batch could not be approved                | ScheduleBatch could not be approved due to current date being equal or after earliest schedule date. Rejecting batch                                                                                                     | ScheduleBatch não pode ser aprovada devido a data atual ser superior ou igual à menor schedule_date. Rejeitando lote                                                                                                  |
| 400                      | TED000108            | Number of transfer attempts exceeded                | The maximum number of failed transfer attempts has been reached                                                                                                                                                          | Número máximo de tentativas de transferência foi atingida                                                                                                                                                             |

---

# List TEDs

URL: /en/documentation/baas/ted/listar_teds

## Request

ENDPOINT /account/ ACCOUNT_KEY /teds
METHOD GET

## Path Params

| Field           | Type   | Description                              | Characters |
|-----------------|--------|------------------------------------------|------------|
| `account_key` * | uuidv4 | Unique identification key of the QI account. | 36         |

## Query Params

| Field                 | Type       | Description                                                                                                    | Characters                                                               |
|-----------------------|------------|----------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|
| `ted_direction`       | enumerator | Indicator of the transaction direction (inbound or outbound). If not sent, **outgoing** will be considered      | [Enums ted_transfer_direction](#enumerators-ted_transfer_direction)            |
| `request_control_key` | uuidv4     | Unique request identification key used by the client.                                                          | 36                                                                       |
| `date_from`           | string     | Start date. Format "YYYY-MM-DD"                                                                                |                                                                          |
| `date_to`             | string     | End date. Format "YYYY-MM-DD"                                                                                  |                                                                          |
| `page`                | integer    | Requested page number. Default is 1                                                                            |                                                                          |
| `page_size`           | integer    | Requested page size in the query. Default and maximum value is 30                                              | Maximum value of 30                                                      |

## Enumerators ted_transfer_direction

| Enumerator   | Description                   |
|--------------|------------------------------|
| **incoming** | Inbound TED transfer          |
| **outgoing** | Outbound TED transfer         |

## Response

STATUS 201

Response Body

```json
{
  "data": [
    {
      "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
      "ted_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
      "created_at": "2021-10-22T20:30:23.459Z",
      "ted_status": "sent",
      "transaction_amount": 126.97,
      "fee_amount": 0.0,
      "target_account": {
        "account_branch": "0001",
        "account_digit": "6",
        "account_number": "78340",
        "ispb": "12345678",
        "owner_document_number": "32402502000135",
        "owner_name": "QI Tech"
      },
      "refusal_reason": {}
    }
  ],
  "pagination": {
    "current_page": 1,
    "rows_per_page": 30
  }
}

```

---

# Perform a TED transfer

URL: /en/documentation/baas/ted/realizar_transferencia

Receiving a TED transaction is not instantaneous in the national financial system. When performing a TED transaction in the QI system, an immediate response will be returned indicating error, rejection, or acceptance of the transfer. Even if a transfer has been marked as `sent`, the Receiving Financial Institution may refuse the incoming funds and return the amount. In this case, a new webhook with the status `rejected` will be sent, and the reason for the rejection will be returned in the `refusal_reason` field.

Debits in the source account of the transaction will be made immediately. This does not mean that the amount has been credited to the destination account due to the principles of TED transactions described above. If the sent transaction is rejected, the transaction amount will be credited back to the source account.

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted
METHOD POST

Request Body

```json
{
  "request_control_key": "0c3d2a3e-c121-464e-b5a4-8e69e0c17bbd",
  "target_account": {
    "account_branch": "0001",
    "account_number": "92796",
    "account_digit": "1",
    "owner_document_number": "23599885000192",
    "owner_name": "Account owner name",
    "ispb": "12345678",
    "account_type": "checking_account"
  },
  "transaction_amount": 8.86
}
```

## BODY PARAMS

| Field                   | Type   | Description                                                                          | Characters                                          |
|-------------------------|--------|------------------------------------------------------------------------------------|-----------------------------------------------------|
| `request_control_key` * | string | Unique request identification key used by the client in uuid v4 format. | 36                                                  |
| `target_account` *      | object | Target account.                                                                   | **[Object target_account](#object-target_account)** | 
| `transaction_amount` *  | float  | Transaction amount.                                                             | 10                                                  |

## Object target_account

| Field                     | Type   | Description                                           | Characters                                                |
|---------------------------|--------|-----------------------------------------------------|-----------------------------------------------------------|
| `account_branch` *        | string | Agency.                                            | 4                                                         |
| `account_digit` *         | string | Account digit.                                     | 1                                                         |
| `account_number` *        | string | Account number.                                    | 20                                                        |
| `owner_document_number` * | string | CPF or CNPJ (numbers only) of account owner.   | 14                                                        |
| `owner_name` *            | string | Account owner name.                           | 50                                                        |
| `account_type`*           | string | Account type.                                      | **[Enumerador account_type](#enumerador-account_type)** |
| `ispb` *                  | string | Based on the financial institution's CNPJ (8 digits). | 8                                                         |

## Enumerator account_type

| Enumerator             | Translation (PT-BR)              |
|------------------------|-----------------------|
| **checking_account**   | conta corrente        |
| **deposit_account**    | conta depósito        |
| **guaranteed_account** | conta de garantia     |
| **investment_account** | conta de investimento |
| **payment_account**    | conta de pagamento    |
| **saving_account**     | conta poupança        |

## Response

STATUS 201

Response Body

```json
{
  "request_control_key": "0c3d2a3e-c121-464e-b5a4-8e69e0c17bbd",
  "ted_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "created_at": "2021-10-22T20:30:23.459Z",
  "ted_status": "sent",
  "transaction_amount": 126.97,
  "fee_amount": 0.0
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "Error title",
  "description": "description in English",
  "translation": "description in Portuguese",
  "code": "Code",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`          | Description (en)<br/>`description`                                                                                       | Description in Portuguese<br/>`translation`                                                                                     |
|--------------------------|----------------------|-----------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                 | Schema Error                                                                                                            | Erro de Schema                                                                                                         |
| 400                      | TED000066            | InvalidUuid                 | request_control_key was not accepted for not being a valid uuid v4 string                                               | request_control_key não foi aceito por não ser uma palavra uuid v4 válida                                              |
| 400                      | TED000011            | InvalidUuid                 | Wrong day/time for TED                                                                                                  | Dia/hora incorretos para a TED                                                                                         |
| 400                      | TED000055            | Invalid Observation         | Observation sent is invalid                                                                                             | Observação enviada é inválida                                                                                          |
| 400                      | TED000054            | Invalid Transaction Amount  | Transaction amount of \{transaction_amount\} is not valid. It must be a positive value with at maximum 2 decimal places | O valor de transação \{transaction_amount\} não é válido. Deve ser um valor positivo com no máximo duas casas decimais |
| 400                      | TED000012            | Bad Request                 | The target's length of the account + account_digit cannot be larger than 21                                             | O número de digitos na conta de destino + digito não pode ser maior que 21                                             |
| 400                      | TED000053            | Invalid Target Account Type | Target Account Type \{account_type\} is invalid                                                                         | Tipo de conta destino \{account_type\} é inválido                                                                      |
| 400                      | TED000031            | Bad Request                 | ISPB number \{ispb\} does not exist or is inactive                                                                      | ISPB \{ispb\} não existe ou está inativo                                                                               |
| 400                      | TED000065            | Bad Request                 | It has been identified by request_control_key that this request is already being processed                              | Foi identificado por request_control_key que está requisição está sendo processada                                     |
| 403                      | TED000071            | Invalid target account      | Invalid target account                                                                                                  | Conta destino inválida                                                                                                 |
| 400                      | TED000058            | Bad Request                 | Insufficient account balance for transfer and fee amount                                                                | Saldo de conta insuficiente para a transação e a taxa                                                                  |
| 400                      | TED000070            | Bad Request                 | Insufficient account balance fee amount in billing account                                                              | Saldo de conta centralizadora insuficiente para taxa                                                                   |
| 400                      | TED000071            | Bad Request                 | Transaction cannot be made due to already blocked balance                                                               | Transação não pode ser feita pois saldo em conta bloqueado                                                             |
| 400                      | TED000068            | Bad Request                 | Transfer rejected by the system                                                                                         | transferêancia foi recusada pelo sistema                                                                               |
| 404                      | TED000013            | Bad Request                 | Unable to find source_account_key's account                                                                             | Não foi possível encontrar a conta com source_account_key fornecido                                                    |
| 400                      | TED000015            | Bad Request                 | Account blocked or closed can not perform this action                                                                   | A conta bloqueada ou fechada não pode executar esta ação                                                               |
| 400                      | TED000016            | Bad Request                 | Hub account can not perform this action                                                                                 | A conta hub não pode executar esta ação                                                                                |
| 403                      | TED000017            | Unauthorized                | Provided account does not have approval credential for the given person                                                 | A conta fornecida não possui credencial de aprovação para a pessoa especificada                                        |
| 403                      | TED000018            | Unauthorized                | Provided account not owned by SELECTED_AGENT                                                                            | Conta fornecida não pertencente ao SELECTED_AGENT                                                                      |
| 400                      | TED000060            | Bad Request                 | Billing Account is closed                                                                                               | Conta centralizadora de pagamentos de tarifa fechada                                                                   |
| 400                      | TED000061            | Bad Request                 | Billing Account without necessary funds                                                                                 | Conta centralizadora de pagamentos sem saldo necessário                                                                |
| 409                      | TED000064            | Bad Request                 | request_control_key \{request_control_key\} already in use                                                              | request_control_key \{request_control_key\} já utilizada                                                               |

---

# Approve TED Transaction Scheduling with Two-Factor Authentication

URL: /en/documentation/baas/ted/schedule_2fa/aprovacao_de_agendamento_2fa

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted_schedule/ SCHEDULE_KEY /validate_token
METHOD PUT

### Path Params

| Field          | Type   | Description                                 | Characters |
|----------------|--------|---------------------------------------------|------------|
| `account_key`  | uuidv4 | Unique account identification key.          | 36         |
| `schedule_key` | uuidv4 | Unique scheduling identification key.       | 36         |

## Authentication via Email and SMS

Request Body

```json
{
  "token": "329123"
}
```

## Authentication via Device

To approve and finalize device authentication, the request must be sent with an empty payload. Validation occurs internally, with no additional information required in the request body. Note that this endpoint should only be used after the [scheduling request](./solicitacao_de_agendamento_2fa.md) has been initiated.

Request Body

```json
{

}
```

## Body Params

| Field    | Type   | Description                                                                                          | Characters |
|----------|--------|------------------------------------------------------------------------------------------------------|------------|
| `token`  | string | Authentication code sent to the account's transaction approver **required for TFA via SMS or email** | 6          |

## Response

STATUS 201

Response Body: Scheduling Approved

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "schedule_key": "f64b3fa7-d09d-4927-ad4f-b966df9fb153",
  "schedule_status": "scheduled",
  "schedule_date": "2024-12-31"
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                           | Description (eng)<br/>`description`                                                 | Description (ptbr)<br/>`translation`                                              |
|--------------------------|----------------------|----------------------------------------------|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                  | schema error description                                                          | Schema Inválido                                                                 |
| 404                      | TED000009            | Not Found                                    | Account not found for the given key: \{account_key\}                              | Conta não encontrada para a chave fornecida: \{account_key\}                    |
| 403                      | TED000018            | Unauthorized                                 | Provided account not owned by SELECTED_AGENT                                      | Conta fornecida não pertencente ao SELECTED_AGENT                               |
| 400                      | TED000082            | Number of token validation attempts exceeded | The maximum number of failed token validation attempts has been reached           | Número máximo de tentativas de validação de token atingida                      |
| 400                      | TED000083            | Token Expired                                | Token has expired. Resend token or recreate transfer                              | Token expirado. Reenvie token ou recrie a transferência                         |
| 400                      | TED000084            | Incorrect Token                              | Token sent does not match expected                                                | Token enviado não condiz com, o esperado                                        |
| 400                      | TED000085            | Error Validating Token                       | An error occurred while validating token and it is being investigated             | Um erro ocorreu ao validar token e está sendo investigado                       |
| 400                      | TED000086            | Invalid Status                               | Ted not in pending_2fa_approval status                                            | Ted não está pendente de aprovação por autenticação de dois fatores             |
| 404                      | TED000093            | TedSchedule not Found                        | TedSchedule was not found                                                         | TedSchedule não encontrada                                                      |
| 400                      | TED000096            | Bad Request                                  | Action cannot be taken place as there is currently a pending transfer in progress | A ação não pôde ser completada como há uma transferência pendente               |
| 400                      | TED000099            | Invalid Status                               | Ted Schedule not in pending_2fa_approval status                                   | Agendamento Ted não está pendente de aprovação por autenticação de dois fatores |
| 400                      | TED000100            | Invalid Schedule Date                        | Schedule must be approved before the scheduled date                               | Agendamento deve ser aprovado em data anterior à programada para transação      || 400                      | TED000110            | Token Required                               | A token is required for SMS or email validation.                                                         | Um token é necessário para validação via SMS ou email.                                                     |

---

# Introduction to Two-Factor Authentication

URL: /en/documentation/baas/ted/schedule_2fa/introducao_a_agendamento_2fa

In this type of scheduling, it is necessary to confirm the payment programming via token sent to the person with powers to approve account movements in the crediting account.

The TED scheduling request by integrating partners configured to use two-factor authentication is performed similarly to what is described in [request TED transaction scheduling](/documentation/baas/ted/schedule/solicitacao_de_agendamento). The difference occurs in the addition of the `tfa_info` object, containing information about the transfer approver and the contact method, and the status of a successful request which will always be **pending_2fa_approval**.

The same applies to TED batch scheduling described in [request TED transaction scheduling in batch](/documentation/baas/ted/schedule_batch/solicitacao_de_agendamento_em_lote).

## Flow for a TED scheduling with authorization

The successful TED scheduling will follow the following process flow:
Execution of the [TED transaction request](/documentation/baas/ted/schedule/solicitacao_de_agendamento_2fa) and receiving a synchronous response with **pending_2fa_approval** status and `schedule_key` value.
The indicated approver will receive a 6-digit `token` composed of numbers.
The requester performs the [TED transaction confirmation](/documentation/baas/ted/schedule/aprovacao_de_agendamento_2fa) with the `schedule_key` and the `token`.
The scheduling will then be updated to **scheduled** status.
## Observations
Each scheduling has a maximum limit of 5 `token` validation attempts. When this limit is reached, the scheduling will be automatically set to rejected status (**rejected**).
Each `token` has a maximum duration of 5 minutes.
A scheduling can have its `token` renewed and resent to the transfer approver. This process restarts the 5-minute timer and does not restart the invalid attempts counter. The previous `token` becomes invalid.
The notification event for sending the `token` to the approver is **baas.token_validation.ted.schedule.single**. It is possible to [customize](/documentation/notificacoes/template) the message sent.
The implemented token sending methods (`contact_type`) are by **sms** and **email**.

---

# Request TED Transaction Scheduling with Two-Factor Authentication

URL: /en/documentation/baas/ted/schedule_2fa/solicitacao_de_agendamento_2fa

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted_schedule
METHOD POST

## Authentication via Email and SMS

Request Body: Scheduling with TFA via SMS or Email

```json
{
  "request_control_key": "0c3d2a3e-c121-464e-b5a4-8e69e0c17bbd",
  "target_account": {
    "account_branch": "0001",
    "account_number": "92796",
    "account_digit": "1",
    "owner_document_number": "23599885000192",
    "owner_name": "Titular da Conta",
    "ispb": "12345678",
    "account_type": "checking_account"
  },
  "transaction_amount": 8.86,
  "schedule_date": "2024-12-01",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  }
}
```

## Authentication via Device

In addition to the existing authentication methods via **sms** and **email**, it is possible to authenticate the transaction using a previously [registered device](/documentation/baas/dispositivo/create/solicitacao_cadastro_dispositivo). In this case, the `session_id` must be obtained in the **Device Scan** and sent in `tfa_info`.

Request Body: Scheduling with TFA via Device

```json
{
  "request_control_key": "0c3d2a3e-c121-464e-b5a4-8e69e0c17bbd",
  "target_account": {
    "account_branch": "0001",
    "account_number": "92796",
    "account_digit": "1",
    "owner_document_number": "23599885000192",
    "owner_name": "Titular da Conta",
    "ispb": "12345678",
    "account_type": "checking_account"
  },
  "transaction_amount": 8.86,
  "schedule_date": "2024-12-01",
  "tfa_info": {
    "approver_document_number": "98765432100",
    "session_id": "b2f18d3a-67c2-4a7f-98e5-1d3f5c6b8a72",
    "contact_type": "device"
  }
}
```

## Body Params

| Field                   | Type   | Description                                                                        | Characters                                          |
|-------------------------|--------|------------------------------------------------------------------------------------|-----------------------------------------------------|
| `request_control_key` * | string | Unique request identification key used by the client in uuid v4 format. | 36                                                  |
| `target_account` *      | object | Target account                                                                   | **[target_account Object](#target_account-object)** | 
| `transaction_amount` *  | float  | Transfer amount                                                             | 10                                                  |
| `schedule_date`*        | string | Date when the transaction will be executed.                                                  | 10                                                  |
| `tfa_info`*             | Object | Object containing the account approver's document and contact method.    | **[tfa_info Object](#tfa_info-object)**             |

## tfa_info Object

| Field                        | Type   | Description                                                                                   | Characters |
|------------------------------|--------|-----------------------------------------------------------------------------------------------|------------|
| `approver_document_number` * | string | Account approver's document number.                                                           | 11         |
| `session_id`                 | string | Unique device session identification key in UUID v4 format (required for device TFA).         | 36         |
| `contact_type` *             | string | Contact method for the account approver, can be **sms**, **email** or **device**              |            |

## target_account Object

| Field                     | Type   | Description                                           | Characters                                              |
|---------------------------|--------|-----------------------------------------------------|---------------------------------------------------------|
| `account_branch` *        | string | Branch.                                            | 4                                                       |
| `account_digit` *         | string | Account digit                                     | 1                                                       |
| `account_number` *        | string | Account number.                                    | 20                                                      |
| `owner_document_number` * | string | CPF or CNPJ (numbers only) of the account holder.   | 14                                                      |
| `owner_name` *            | string | Account holder's name.                           | 50                                                      |
| `account_type`*           | string | Account type.                                      | **[account_type Enumerator](#account_type-enumerator)** |
| `ispb` *                  | string | Based on the financial institution's CNPJ (8 digits). | 8                                                       |

## account_type Enumerator

| Enumerator             | Translation              |
|------------------------|-----------------------|
| **checking_account**   | checking account        |
| **deposit_account**    | deposit account        |
| **guaranteed_account** | guaranteed account     |
| **investment_account** | investment account |
| **payment_account**    | payment account    |
| **saving_account**     | savings account        |

## Response

STATUS 202

Response Body: Schedule Created

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "schedule_key": "f64b3fa7-d09d-4927-ad4f-b966df9fb153",
  "schedule_status": "pending_2fa_approval",
  "schedule_date": "2024-12-31"
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                  | Description (eng)<br/>`description`                                                          | Description (ptbr)<br/>`translation`                                                 |
|--------------------------|----------------------|-----------------------------------------------------|--------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                         | schema error description                                                                   | Schema Inválido                                                                    |
| 404                      | TED000006            | Target account Not Found                            | Target account was not found for given parameters                                          | Conta destino não encontrada para os parâmetros informados                         |
| 404                      | TED000009            | Not Found                                           | Account not found for the given key: \{account_key\}                                       | Conta não encontrada para a chave fornecida: \{account_key\}                       |
| 403                      | TED000014            | Invalid target account                              | Invalid target account                                                                     | Conta destino inválida                                                             |
| 400                      | TED000015            | Bad Request                                         | Account blocked or closed can not perform this action                                      | A conta bloqueada ou fechada não pode executar esta ação                           |
| 400                      | TED000016            | Bad Request                                         | Hub account can not perform this action                                                    | A conta hub não pode executar esta ação                                            |
| 403                      | TED000018            | Unauthorized                                        | Provided account not owned by SELECTED_AGENT                                               | Conta fornecida não pertencente ao SELECTED_AGENT                                  |
| 400                      | TED000031            | Bad Request                                         | ISPB number \{ispb\} does not exist or is inactive                                         | ISPB \{ispb\} não existe ou está inativo                                           |
| 400                      | TED000044            | Invalid Timestamp Format sent                       | Given parameter is not in the correct format \{timestamp_format\}                          | Parametro enviado não está no formato correto \{timestamp_format\}                 |
| 400                      | TED000046            | Invalid uuid v4 string sent                         | \{key\} was not accepted for not being a valid uuid v4 string                              | \{key\} não foi aceito por não ser uma palavra uuid v4 válida                      |
| 400                      | TED000054            | Invalid Transaction Amount                          | Transaction Amount \{transaction_amount\} is invalid                                       | Valor de transação \{transaction_amount\} é inválido                               |
| 400                      | TED000057            | Invalid Document Number                             | Given \{document_number\} document number is invalid                                       | CPF/CNPJ \{document_number\} fornecido não é valido                                |
| 409                      | TED000064            | Bad Request                                         | request_control_key \{request_control_key\} already in use                                 | request_control_key \{request_control_key\} já utilizada                           |
| 400                      | TED000065            | Bad Request                                         | It has been identified by request_control_key that this request is already being processed | Foi identificado por request_control_key que está requisição está sendo processada |
| 403                      | TED000079            | No approver permission                              | Given document number does not belong to an approver for this account                      | Número de documento enviado não pertence a um aprovador da conta                   |
| 400                      | TED000080            | tfa_info is required                                | Client must send object tfa_info                                                           | Cliente deve enviar objeto tfa_info                                                |
| 400                      | TED000081            | Error occurred while sending token                  | An unexpected error occurred while sending token                                           | Um erro inexperado ocorreu ao tentar enviar token                                  |
| 400                      | TED000089            | Invalid Schedule Date                               | Schedule date must be after current date for UTC-3                                         | Data de agendamento deve ser após a data atual em UTC-3                            |
| 400                      | TED000090            | Invalid Schedule Date                               | Schedule date must be a workday                                                            | Data de agendamento deve ser um dia útil                                           |
| 400                      | TED000091            | Target Account and Source Account must be different | Target Account must not be the same as Source Account                                      | A conta de destino não pode ser a mesma da conta de origem                         |

---

# Request token resend for a schedule

URL: /en/documentation/baas/ted/schedule_2fa/solicitacao_de_reenvio_de_token_para_agendamento_2fa

A new token will be generated and sent to the ted schedule approver. If the maximum number of token validation attempts
has been exceeded, resending will not be allowed.

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted_schedule/ SCHEDULE_KEY /resend_token
METHOD PATCH

### Path Params

| Field          | Type   | Description                                  | Characters |
|----------------|--------|----------------------------------------------|------------|
| `account_key`  | uuidv4 | Unique account identification key.           | 36         |
| `schedule_key` | uuidv4 | Unique schedule identification key.          | 36         |

## Body Params

| Field          | Type       | Description                                 | Characters                                              |
|----------------|------------|---------------------------------------------|---------------------------------------------------------|
| `contact_type` | enumerator | Authentication token delivery method        | **[Enumerator contact_type](#enumerator-contact_type)** |

:::info Information
If no `contact_type` is sent, the token will be sent using the originally requested method.
:::

### Enumerator contact_type

| Enumerator | Description                                   |
|------------|-----------------------------------------------|
| **sms**    | Sent via Text Message to mobile phone        |
| **email**  | Sent via email                                |

## Response

STATUS 202

Response Body: Transaction Requested

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "schedule_key": "f64b3fa7-d09d-4927-ad4f-b966df9fb153",
  "schedule_status": "pending_2fa_approval",
  "schedule_date": "2024-12-31"
}
```

STATUS 4xx

Response Body: Transfer Rejected

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                           | Description (eng)<br/>`description`                                                 | Description (ptbr)<br/>`translation`                                              |
|--------------------------|----------------------|----------------------------------------------|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                  | schema error description                                                          | Schema Inválido                                                                 |
| 404                      | TED000009            | Not Found                                    | Account not found for the given key: \{account_key\}                              | Conta não encontrada para a chave fornecida: \{account_key\}                    |
| 403                      | TED000018            | Unauthorized                                 | Provided account not owned by SELECTED_AGENT                                      | Conta fornecida não pertencente ao SELECTED_AGENT                               |
| 400                      | TED000082            | Number of token validation attempts exceeded | The maximum number of failed token validation attempts has been reached           | Número máximo de tentativas de validação de token atingida                      |
| 400                      | TED000086            | Invalid Status                               | Ted not in pending_2fa_approval status                                            | Ted não está pendente de aprovação por autenticação de dois fatores             |
| 400                      | TED000087            | Error Sending Token                          | An error occurred while resending token and its being investigated                | Um erro ocorreu ao reenviar token e está sendo investigado                      |
| 404                      | TED000093            | TedSchedule not Found                        | TedSchedule was not found                                                         | TedSchedule não encontrada                                                      |
| 400                      | TED000096            | Bad Request                                  | Action cannot be taken place as there is currently a pending transfer in progress | A ação não pôde ser completada como há uma transferência pendente               |
| 400                      | TED000099            | Invalid Status                               | Ted Schedule not in pending_2fa_approval status                                   | Agendamento Ted não está pendente de aprovação por autenticação de dois fatores |
| 400                      | TED000100            | Invalid Schedule Date                        | Schedule must be approved before the scheduled date                               | Agendamento deve ser aprovado em data anterior à programada para transação      |

---

# Approve TED Transaction Batch Schedule with Two-Factor Authentication

URL: /en/documentation/baas/ted/schedule_batch_2fa/aprovacao_de_agendamento_em_lote_2fa

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted_schedule_batch/ SCHEDULE_BATCH_KEY /validate_token
METHOD PUT

### Path Params

| Field                | Type   | Description                                          | Characters |
|----------------------|--------|------------------------------------------------------|------------|
| `account_key`        | uuidv4 | Unique account identification key.                   | 36         |
| `schedule_batch_key` | uuidv4 | Unique batch schedule identification key.            | 36         |

## Authentication via Email and SMS

Request Body

```json
{
  "token": "329123"
}
```

## Authentication via Device

To approve and finalize device authentication, the request must be sent with an empty payload. Validation occurs internally, with no additional information required in the request body. Note that this endpoint should only be used after the [batch scheduling request](./solicitacao_de_agendamento_em_lote_2fa.md) has been initiated.

Request Body

```json
{

}
```

## Body Params

| Field    | Type   | Description                                                                                          | Characters |
|----------|--------|------------------------------------------------------------------------------------------------------|------------|
| `token`  | string | Authentication code sent to the account transaction approver **required for TFA via SMS or email**  | 6          |

## Response

STATUS 201

Response Body: Approved Batch Schedule

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "schedule_batch_key": "f64b3fa7-d09d-4927-ad4f-b966df9fb153",
  "schedule_batch_status": "approved",
  "created_at": "2023-03-13T19:00:28.440Z"
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                            | Description (eng)<br/>`description`                                                                                 | Description (ptbr)<br/>`translation`                                                                                 |
|------------------------|--------------------|----------------------------------------------|----------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|
| 400                    | QIT000001          | Bad Request                                  | schema error description                                                                                             | Schema Inválido                                                                                                      |
| 404                    | TED000009          | Not Found                                    | Account not found for the given key: \{account_key\}                                                                 | Conta não encontrada para a chave fornecida: \{account_key\}                                                         |
| 403                    | TED000018          | Unauthorized                                 | Provided account not owned by SELECTED_AGENT                                                                         | Conta fornecida não pertencente ao SELECTED_AGENT                                                                    |
| 400                    | TED000082          | Number of token validation attempts exceeded | The maximum number of failed token validation attempts has been reached                                              | Número máximo de tentativas de validação de token atingida                                                           |
| 400                    | TED000083          | Token Expired                                | Token has expired. Resend token or recreate transfer                                                                 | Token expirado. Reenvie token ou recrie a transferência                                                              |
| 400                    | TED000084          | Incorrect Token                              | Token sent does not match expected                                                                                   | Token enviado não condiz com, o esperado                                                                             |
| 400                    | TED000085          | Error Validating Token                       | An error occurred while validating token and it is being investigated                                                | Um erro ocorreu ao validar token e está sendo investigado                                                            |
| 400                    | TED000102          | Invalid Status                               | Ted Batch not in pending_2fa_approval status                                                                         | Lote de Ted não está pendente de aprovação por autenticação de dois fatores                                          |
| 404                    | TED000103          | ScheduleBatch not Found                      | Ted Schedule Batch was not found                                                                                     | Agendamento de Ted em lote não encontrado                                                                            |
| 400                    | TED000106          | Invalid Status                               | ScheduleBatch not in pending_2fa_approval status                                                                     | Lote Agendamentos de Ted não está pendente de aprovação por autenticação de dois fatores                             |
| 400                    | TED000107          | Schedule Batch could not be approved         | ScheduleBatch could not be approved due to current date being equal or after earliest schedule date. Rejecting batch | ScheduleBatch não pode ser aprovada devido a data atual ser superior ou igual à menor schedule_date. Rejeitando lote || 400                    | TED000110          | Token Required                               | A token is required for SMS or email validation.                                                         | Um token é necessário para validação via SMS ou email.                                                     |

---

# Request TED Batch Transaction Scheduling

URL: /en/documentation/baas/ted/schedule_batch_2fa/solicitacao_de_agendamento_em_lote_2fa

QI Tech offers the possibility to perform multiple scheduled TED transactions with a single call. If the initial call returns an HTTP status 4xx, none of the schedules will be performed.

In this type of scheduling, it is necessary to confirm the payment scheduling via token sent to the person with powers to approve account movements in the creditor account.

The request for batch TED scheduling by integrating partners configured to use two-factor authentication is performed similarly to what is described in [request batch TED transaction scheduling](/documentation/baas/ted/schedule/solicitacao_de_agendamento_em_lote).
The difference occurs in adding the `tfa_info` object, containing information about the transfer approver and the contact method, and the status of a successful request which will always be **pending_2fa_approval**.

The notification event for sending the `token` to the approver is **baas.token_validation.ted.schedule.batch**. It is possible to [customize](/documentation/notificacoes/template) the message sent.

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted_schedule_batch
METHOD POST

## Authentication via Email and SMS

Request Body: Batch Scheduling with TFA via SMS or Email

```json
{
  "request_control_key": "6e4fc980-f8a1-4462-b6e2-d8a49f0ac055",
  "ted_schedules": [
    {
      "request_control_key": "0c3d2a3e-c121-464e-b5a4-8e69e0c17bbd",
      "target_account": {
        "account_branch": "0001",
        "account_number": "92796",
        "account_digit": "1",
        "owner_document_number": "23599885000192",
        "owner_name": "Titular da Conta",
        "ispb": "12345678",
        "account_type": "checking_account"
      },
      "transaction_amount": 8.86,
      "schedule_date": "2024-12-01"
    }
  ],
  "tfa_info": {
    "approver_document_number": "98765432100",
    "contact_type": "email"
  }
}
```

## Authentication via Device

In addition to the existing authentication methods via **sms** and **email**, it is possible to authenticate the transaction using a previously [registered device](/documentation/baas/dispositivo/create/solicitacao_cadastro_dispositivo). In this case, the `session_id` must be obtained in the **Device Scan** and sent in `tfa_info`.

Request Body: Batch Scheduling with TFA via Device

```json
{
  "request_control_key": "6e4fc980-f8a1-4462-b6e2-d8a49f0ac055",
  "ted_schedules": [
    {
      "request_control_key": "0c3d2a3e-c121-464e-b5a4-8e69e0c17bbd",
      "target_account": {
        "account_branch": "0001",
        "account_number": "92796",
        "account_digit": "1",
        "owner_document_number": "23599885000192",
        "owner_name": "Titular da Conta",
        "ispb": "12345678",
        "account_type": "checking_account"
      },
      "transaction_amount": 8.86,
      "schedule_date": "2024-12-01"
    }
  ],
  "tfa_info": {
    "approver_document_number": "98765432100",
    "session_id": "b2f18d3a-67c2-4a7f-98e5-1d3f5c6b8a72",
    "contact_type": "device"
  }
}
```

## Path Params

| Field         | Type   | Description                            | Characters |
|---------------|--------|----------------------------------------|------------|
| `account_key` | uuidv4 | Unique account identification key.     | 36         |

## Body Params

| Field                   | Type   | Description                                                                       | Characters                                               |
|-------------------------|--------|-----------------------------------------------------------------------------------|----------------------------------------------------------|
| `request_control_key` * | uuidv4 | Unique request identification key used by the client in uuid v4 format.         | 36                                                       | 
| `ted_schedules` *       | array  | List of ted_schedule objects linked to the batch.                                | list of **[ted_schedule Object](#ted_schedule-object)**  |
| `tfa_info`*             | Object | Object containing the account approver's document and contact method.            | **[tfa_info Object](#tfa_info-object)**                  |

## tfa_info Object

| Field                        | Type   | Description                                                                                   | Characters |
|------------------------------|--------|-----------------------------------------------------------------------------------------------|------------|
| `approver_document_number` * | string | Account approver's document number.                                                           | 11         |
| `session_id`                 | string | Unique device session identification key in UUID v4 format (required for device TFA).         | 36         |
| `contact_type` *             | string | Contact method with the account approver, can be **sms**, **email** or **device**             |            |

## ted_schedule Object

| Field                   | Type   | Description                                                                       | Characters                                              |
|-------------------------|--------|-----------------------------------------------------------------------------------|---------------------------------------------------------|
| `request_control_key` * | string | Unique request identification key used by the client in uuid v4 format.         | 36                                                      |
| `target_account` *      | object | Target account                                                                   | **[target_account Object](#target_account-object)**     | 
| `transaction_amount` *  | float  | Transfer amount                                                                  | 10                                                      |
| `schedule_date`*        | string | Date when the transaction should be performed.                                   | 10                                                      |

## target_account Object

| Field                     | Type   | Description                                         | Characters                                              |
|---------------------------|--------|-----------------------------------------------------|---------------------------------------------------------|
| `account_branch` *        | string | Branch.                                            | 4                                                       |
| `account_digit` *         | string | Account digit                                      | 1                                                       |
| `account_number` *        | string | Account number.                                    | 20                                                      |
| `owner_document_number` * | string | CPF or CNPJ (numbers only) of the account holder. | 14                                                      |
| `owner_name` *            | string | Account holder's name.                             | 50                                                      |
| `account_type`*           | string | Account type.                                      | **[account_type Enumerator](#account_type-enumerator)** |
| `ispb` *                  | string | Based on financial institution's CNPJ (8 digits). | 8                                                       |

## account_type Enumerator

| Enumerator             | Translation           |
|------------------------|-----------------------|
| **checking_account**   | checking account      |
| **deposit_account**    | deposit account       |
| **guaranteed_account** | guaranteed account    |
| **investment_account** | investment account    |
| **payment_account**    | payment account       |
| **saving_account**     | savings account       |

## Response

STATUS 202

Response Body: Batch Scheduling Requested

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "schedule_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "schedule_batch_status": "pending_2fa_approval",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

### schedule_batch_status Enumerator

| Enumerator               | Description                                              |
|--------------------------|----------------------------------------------------------|
| **created**              | Batch scheduling created                                 |
| **approved**             | Batch scheduling approved                                |
| **rejected**             | Batch scheduling rejected                                |
| **pending_2fa_approval** | Batch scheduling pending two-factor authentication approval |

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                  | Description (eng)<br/>`description`                                                          | Description (ptbr)<br/>`translation`                                                 |
|--------------------------|----------------------|-----------------------------------------------------|--------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                         | schema error description                                                                   | Schema Inválido                                                                    |
| 404                      | TED000006            | Target account Not Found                            | Target account was not found for given parameters                                          | Conta destino não encontrada para os parâmetros informados                         |
| 404                      | TED000009            | Not Found                                           | Account not found for the given key: \{account_key\}                                       | Conta não encontrada para a chave fornecida: \{account_key\}                       |
| 403                      | TED000014            | Invalid target account                              | Invalid target account                                                                     | Conta destino inválida                                                             |
| 400                      | TED000015            | Bad Request                                         | Account blocked or closed can not perform this action                                      | A conta bloqueada ou fechada não pode executar esta ação                           |
| 400                      | TED000016            | Bad Request                                         | Hub account can not perform this action                                                    | A conta hub não pode executar esta ação                                            |
| 403                      | TED000018            | Unauthorized                                        | Provided account not owned by SELECTED_AGENT                                               | Conta fornecida não pertencente ao SELECTED_AGENT                                  |
| 400                      | TED000031            | Bad Request                                         | ISPB number \{ispb\} does not exist or is inactive                                         | ISPB \{ispb\} não existe ou está inativo                                           |
| 400                      | TED000044            | Invalid Timestamp Format sent                       | Given parameter is not in the correct format \{timestamp_format\}                          | Parametro enviado não está no formato correto \{timestamp_format\}                 |
| 400                      | TED000045            | Search Params Error                                 | Invalid integer value for page or size querystring parameters                              | Valor inválido para parâmetros de página ou tamanho de página                      |
| 400                      | TED000046            | Invalid uuid v4 string sent                         | \{key\} was not accepted for not being a valid uuid v4 string                              | \{key\} não foi aceito por não ser uma palavra uuid v4 válida                      |
| 400                      | TED000054            | Invalid Transaction Amount                          | Transaction Amount \{transaction_amount\} is invalid                                       | Valor de transação \{transaction_amount\} é inválido                               |
| 400                      | TED000057            | Invalid Document Number                             | Given \{document_number\} document number is invalid                                       | CPF/CNPJ \{document_number\} fornecido não é valido                                |
| 409                      | TED000064            | Bad Request                                         | request_control_key \{request_control_key\} already in use                                 | request_control_key \{request_control_key\} já utilizada                           |
| 400                      | TED000065            | Bad Request                                         | It has been identified by request_control_key that this request is already being processed | Foi identificado por request_control_key que está requisição está sendo processada |
| 403                      | TED000079            | No approver permission                              | Given document number does not belong to an approver for this account                      | Número de documento enviado não pertence a um aprovador da conta                   |
| 400                      | TED000080            | tfa_info is required                                | Client must send object tfa_info                                                           | Cliente deve enviar objeto tfa_info                                                |
| 400                      | TED000081            | Error occurred while sending token                  | An unexpected error occurred while sending token                                           | Um erro inexperado ocorreu ao tentar enviar token                                  |
| 400                      | TED000089            | Invalid Schedule Date                               | Schedule date must be after current date for UTC-3                                         | Data de agendamento deve ser após a data atual em UTC-3                            |
| 400                      | TED000090            | Invalid Schedule Date                               | Schedule date must be a workday                                                            | Data de agendamento deve ser um dia útil                                           |
| 400                      | TED000091            | Target Account and Source Account must be different | Target Account must not be the same as Source Account                                      | A conta de destino não pode ser a mesma da conta de origem                         |

---

# Request Token Resend for a TED Batch Transaction Schedule

URL: /en/documentation/baas/ted/schedule_batch_2fa/solicitacao_de_reenvio_de_token_para_agendamento_em_lote_2fa

A new token will be generated and sent to the TED schedule approver. If the token validation attempt limit has been exceeded, resending will not be allowed.

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted_schedule_batch/ SCHEDULE_BATCH_KEY /resend_token
METHOD PATCH

### Path Params

| Field                | Type   | Description                                      | Characters |
|----------------------|--------|--------------------------------------------------|------------|
| `account_key`        | uuidv4 | Unique account identification key.               | 36         |
| `schedule_batch_key` | uuidv4 | Unique batch schedule identification key.        | 36         |

## Body Params

| Field          | Type       | Description                              | Characters                                              |
|----------------|------------|------------------------------------------|---------------------------------------------------------|
| `contact_type` | enumerator | Authentication token sending method      | **[Enumerator contact_type](#enumerador-contact_type)** |

:::info Information
If no `contact_type` is sent, the token will be sent using the originally requested method.
:::

### Enumerator contact_type

| Enumerator | Description                                       |
|------------|---------------------------------------------------|
| **sms**    | Sending via Text Message to mobile phone         |
| **email**  | Sending via electronic mail                      |

## Response

STATUS 202

Response Body: Batch Schedule Requested

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "schedule_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "schedule_batch_status": "pending_2fa_approval",
  "created_at": "2021-10-22T20:30:23.459Z"
} 
```

STATUS 4xx

Response Body: Transfer Rejected

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                    | Description (eng)<br/>`description`                                                                                  | Description (ptbr)<br/>`translation`                                                                                 |
|------------------------|--------------------|------------------------------------- |----------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|
| 400                    | QIT000001          | Bad Request                          | schema error description                                                                                             | Schema Inválido                                                                                                      |
| 404                    | TED000009          | Not Found                            | Account not found for the given key: \{account_key\}                                                                 | Conta não encontrada para a chave fornecida: \{account_key\}                                                         |
| 403                    | TED000018          | Unauthorized                         | Provided account not owned by SELECTED_AGENT                                                                         | Conta fornecida não pertencente ao SELECTED_AGENT                                                                    |
| 400                    | TED000087          | Error Sending Token                  | An error occurred while resending token and its being investigated                                                   | Um erro ocorreu ao reenviar token e está sendo investigado                                                           |
| 404                    | TED000103          | ScheduleBatch not Found              | Ted Schedule Batch was not found                                                                                     | Agendamento de Ted em lote não encontrado                                                                            |
| 400                    | TED000106          | Invalid Status                       | ScheduleBatch not in pending_2fa_approval status                                                                     | Lote Agendamentos de Ted não está pendente de aprovação por autenticação de dois fatores                             |
| 400                    | TED000107          | Schedule Batch could not be approved | ScheduleBatch could not be approved due to current date being equal or after earliest schedule date. Rejecting batch | ScheduleBatch não pode ser aprovada devido a data atual ser superior ou igual à menor schedule_date. Rejeitando lote |

---

# Cancel TED Batch Schedule Transaction

URL: /en/documentation/baas/ted/schedule_batch/cancelamento_de_agendamento_em_lote

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted_schedule_batch/ SCHEDULE_BATCH_KEY /cancel
METHOD PATCH

### Path Params

| Field                | Type   | Description                                    | Characters |
|----------------------|--------|------------------------------------------------|------------|
| `account_key`        | uuidv4 | Unique account identification key.             | 36         |
| `schedule_batch_key` | uuidv4 | Unique schedule batch identification key       | 36         |

### Response

STATUS 200

Response Body: Cancelled Schedule

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "schedule_batch_key": "f64b3fa7-d09d-4927-ad4f-b966df9fb153",
  "schedule_batch_status": "cancelled",
  "created_at": "2023-03-13T19:00:28.440Z"
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                     | Description (eng)<br/>`description`                                                                                               | Description (ptbr)<br/>`translation`                                                                                                       |
|------------------------|--------------------|---------------------------------------|------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| 400                    | QIT000001          | Bad Request                           | schema error description                                                                                                           | Schema Inválido                                                                                                                             |
| 404                    | TED000009          | Not Found                             | Account not found for the given key: \{account_key\}                                                                              | Conta não encontrada para a chave fornecida: \{account_key\}                                                                               |
| 403                    | TED000018          | Unauthorized                          | Provided account not owned by SELECTED_AGENT                                                                                      | Conta fornecida não pertencente ao SELECTED_AGENT                                                                                          |
| 400                    | TED000096          | Bad Request                           | Action cannot be taken place as there is currently a pending transfer in progress                                                 | A ação não pôde ser completada como há uma transferência pendente                                                                          |
| 404                    | TED000101          | TedBatch not Found                    | TedBatch was not found                                                                                                             | TedBatch não encontrada                                                                                                                     |
| 404                    | TED000103          | ScheduleBatch not Found               | Ted Schedule Batch was not found                                                                                                   | Agendamento de Ted em lote não encontrado                                                                                                  |
| 400                    | TED000104          | Invalid Status                        | Schedule Batch cannot be cancelled in current status                                                                              | Lote de agendamento não pode ser cancelado no status atual                                                                                 |
| 400                    | TED000105          | Schedule Batch could not be cancelled | ScheduleBatch could not be cancelled due to current date being equal or after earliest schedule date. Cancel schedules one by one | ScheduleBatch não pode ser cancelada devido a data atual ser superior ou igual à menor schedule_date. Cancele agendamentos individualmente |

---

# List Schedules from a Schedule Batch

URL: /en/documentation/baas/ted/schedule_batch/listar_agendamentos_de_um_lote

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted_schedule_batch/ SCHEDULE_BATCH_KEY /ted_schedules
METHOD GET

### Path Params

| Field                | Type   | Description                                           | Characters |
|----------------------|--------|-------------------------------------------------------|------------|
| `account_key`        | uuidv4 | Unique identifier key of the account.                 | 36         |
| `schedule_batch_key` | uuidv4 | Unique identifier key of the schedule batch.         | 36         |

### Query Params

| Field                 | Type    | Description                                                             | Characters                                                    |
|-----------------------|---------|-------------------------------------------------------------------------|---------------------------------------------------------------|
| `request_control_key` | uuidv4  | Unique identifier key of the request used by the client.                | 36                                                            |
| `schedule_status`     | string  | Status of the schedule. Can be sent as a list.                          | **[Enumerator schedule_status](#enumerador-schedule_status)** |
| `start_date`          | string  | Start date of the query                                                 | 10                                                            |
| `end_date`            | string  | End date of the query                                                   | 10                                                            |
| `page`                | integer | Number of the requested page. 1 by default                              |                                                               |
| `page_size`           | integer | Size of the requested page in the query. 30 by default and maximum value | Maximum value of 30                                            |

### Enumerator schedule_status

| Enumerator                 | Description                                                                                    |
|----------------------------|------------------------------------------------------------------------------------------------|
| **scheduled**              | Transaction scheduled                                                                          |
| **sent**                   | Schedule completed and sent successfully. Final state                                          |
| **rejected**               | Schedule rejected during creation or execution. Final state                                    |
| **cancelled**              | Schedule cancelled by client request. Final state                                             |
| **pending_2fa_approval**   | Pending approval by two-factor authentication                                                  |
| **pending_creation**       | Schedule in creation process (Transitory state for batch scheduling)                          |
| **waiting_batch_approval** | Schedule created and linked to a batch awaiting approval by two-factor authentication         |

### Response

STATUS 200

Response Body

```json
{
  "data": [
    {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "schedule_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "schedule_status": "scheduled",
      "schedule_date": "2024-12-31",
      "created_at": "2023-03-13T19:00:28.440Z"
    },
    {
      "request_control_key": "bf6b0a4b-c7a5-446b-9dad-1ae10b25342a",
      "schedule_key": "2479a5cd-079e-4d72-bf4e-16a695bda45e",
      "schedule_status": "cancelled",
      "schedule_date": "2024-12-31",
      "created_at": "2023-03-13T19:00:28.440Z"
    },
    {
      "request_control_key": "9d36c03e-2db7-4c90-87ed-6c9ddb3c03c7",
      "schedule_key": "5d6b14b9-053f-408c-bcd7-61ecf9224f2c",
      "schedule_status": "rejected",
      "schedule_date": "2024-12-31",
      "created_at": "2023-03-13T19:00:28.440Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "next_page": null,
    "rows_per_page": 30
  }
}

```

---

# List Account Schedule Batches

URL: /en/documentation/baas/ted/schedule_batch/listar_agendamentos_em_lote_de_uma_conta

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted_schedule_batches
METHOD GET

### Path Params

| Field         | Type   | Description                              | Characters |
|---------------|--------|------------------------------------------|------------|
| `account_key` | uuidv4 | Unique account identification key.       | 36         |

### Query Params

| Field                   | Type    | Description                                                             | Characters                                                                |
|-------------------------|---------|-------------------------------------------------------------------------|---------------------------------------------------------------------------|
| `request_control_key`   | uuidv4  | Unique request identification key used by the client.                   | 36                                                                        |
| `schedule_batch_status` | string  | Schedule batch status. Can be sent as a list.                          | **[schedule_batch_status Enumerator](#enumerator-schedule_batch_status)** |
| `page`                  | integer | Requested page number. 1 by default                                    |                                                                           |
| `page_size`             | integer | Size of the requested page in the query. 30 by default and maximum value | Maximum value of 30                                                       |

### Enumerator schedule_batch_status

| Enumerator               | Description                                                                |
|--------------------------|----------------------------------------------------------------------------|
| **created**              | Schedule batch created                                                     |
| **approved**             | Schedule batch approved                                                    |
| **rejected**             | Schedule batch rejected                                                    |
| **pending_2fa_approval** | Schedule batch pending approval by two-factor authentication              |

### Response

STATUS 200

Response Body

```json
{
  "data": [
    {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "schedule_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "schedule_batch_status": "approved",
      "created_at": "2021-10-22T20:30:23.459Z"
    },
    {
      "request_control_key": "bf6b0a4b-c7a5-446b-9dad-1ae10b25342a",
      "schedule_batch_key": "2479a5cd-079e-4d72-bf4e-16a695bda45e",
      "schedule_batch_status": "cancelled",
      "created_at": "2021-10-22T20:30:23.459Z"
    },
    {
      "request_control_key": "9d36c03e-2db7-4c90-87ed-6c9ddb3c03c7",
      "schedule_batch_key": "5d6b14b9-053f-408c-bcd7-61ecf9224f2c",
      "schedule_batch_status": "rejected",
      "created_at": "2021-10-22T20:30:23.459Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "next_page": null,
    "rows_per_page": 30
  }
}

```

---

# Request TED Transaction Batch Scheduling

URL: /en/documentation/baas/ted/schedule_batch/solicitacao_de_agendamento_em_lote

QI Tech offers the possibility to perform multiple scheduled TED transactions with a single call. If the initial call returns an **http status 4xx**, none of the schedules will be executed.

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted_schedule_batch
METHOD POST

```json
{
  "request_control_key": "6e4fc980-f8a1-4462-b6e2-d8a49f0ac055",
  "ted_schedules": [
    {
      "request_control_key": "0c3d2a3e-c121-464e-b5a4-8e69e0c17bbd",
      "target_account": {
        "account_branch": "0001",
        "account_number": "92796",
        "account_digit": "1",
        "owner_document_number": "23599885000192",
        "owner_name": "Titular da Conta",
        "ispb": "12345678",
        "account_type": "checking_account"
      },
      "transaction_amount": 8.86,
      "schedule_date": "2024-12-01"
    }
  ]
}
```

## Path Params

| Field         | Type   | Description                          | Characters |
|---------------|--------|--------------------------------------|------------|
| `account_key` | uuidv4 | Unique account identification key.   | 36         |

## Body Params

| Field                   | Type   | Description                                                                        | Characters                                               |
|-------------------------|--------|------------------------------------------------------------------------------------|----------------------------------------------------------|
| `request_control_key` * | uuidv4 | Unique request identification key used by the client in uuid v4 format.           | 36                                                       | 
| `ted_schedules` *       | array  | List of ted_schedule objects linked to the batch.                                 | list of **[ted_schedule Object](#ted_schedule-object)** |

## ted_schedule Object

| Field                   | Type   | Description                                                                        | Characters                                          |
|-------------------------|--------|------------------------------------------------------------------------------------|-----------------------------------------------------|
| `request_control_key` * | string | Unique request identification key used by the client in uuid v4 format.           | 36                                                  |
| `target_account` *      | object | Target account                                                                     | **[target_account Object](#target_account-object)** | 
| `transaction_amount` *  | float  | Transfer amount                                                                    | 10                                                  |
| `schedule_date`*        | string | Date when the transaction will be executed.                                       | 10                                                  |

## target_account Object

| Field                     | Type   | Description                                         | Characters                                              |
|---------------------------|--------|-----------------------------------------------------|---------------------------------------------------------|
| `account_branch` *        | string | Branch.                                             | 4                                                       |
| `account_digit` *         | string | Account digit                                       | 1                                                       |
| `account_number` *        | string | Account number.                                     | 20                                                      |
| `owner_document_number` * | string | CPF or CNPJ (numbers only) of the account holder.  | 14                                                      |
| `owner_name` *            | string | Account holder's name.                              | 50                                                      |
| `account_type`*           | string | Account type.                                       | **[account_type Enumerator](#account_type-enumerator)** |
| `ispb` *                  | string | Based on the financial institution's CNPJ (8 digits). | 8                                                       |

## account_type Enumerator

| Enumerator             | Translation           |
|------------------------|-----------------------|
| **checking_account**   | checking account      |
| **deposit_account**    | deposit account       |
| **guaranteed_account** | guaranteed account    |
| **investment_account** | investment account    |
| **payment_account**    | payment account       |
| **saving_account**     | savings account       |

## Response

STATUS 201

Response Body: Approved Batch Scheduling

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "schedule_batch_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "schedule_batch_status": "approved",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

### schedule_batch_status Enumerator

| Enumerator               | Description                                                |
|--------------------------|------------------------------------------------------------|
| **created**              | Batch scheduling created                                   |
| **approved**             | Batch scheduling approved                                  |
| **rejected**             | Batch scheduling rejected                                  |
| **pending_2fa_approval** | Batch scheduling pending two-factor authentication approval |

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                   | Description (eng)<br/>`description`                                                       | Description (ptbr)<br/>`translation`                                               |
|------------------------|--------------------|-----------------------------------------------------|--------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| 400                    | QIT000001          | Bad Request                                         | schema error description                                                                   | Schema Inválido                                                                    |
| 404                    | TED000006          | Target account Not Found                            | Target account was not found for given parameters                                          | Conta destino não encontrada para os parâmetros informados                         |
| 404                    | TED000009          | Not Found                                           | Account not found for the given key: \{account_key\}                                       | Conta não encontrada para a chave fornecida: \{account_key\}                       |
| 403                    | TED000014          | Invalid target account                              | Invalid target account                                                                     | Conta destino inválida                                                             |
| 400                    | TED000015          | Bad Request                                         | Account blocked or closed can not perform this action                                      | A conta bloqueada ou fechada não pode executar esta ação                           |
| 400                    | TED000016          | Bad Request                                         | Hub account can not perform this action                                                    | A conta hub não pode executar esta ação                                            |
| 403                    | TED000018          | Unauthorized                                        | Provided account not owned by SELECTED_AGENT                                               | Conta fornecida não pertencente ao SELECTED_AGENT                                  |
| 400                    | TED000031          | Bad Request                                         | ISPB number \{ispb\} does not exist or is inactive                                         | ISPB \{ispb\} não existe ou está inativo                                           |
| 400                    | TED000044          | Invalid Timestamp Format sent                       | Given parameter is not in the correct format \{timestamp_format\}                          | Parametro enviado não está no formato correto \{timestamp_format\}                 |
| 400                    | TED000045          | Search Params Error                                 | Invalid integer value for page or size querystring parameters                              | Valor inválido para parâmetros de página ou tamanho de página                      |
| 400                    | TED000046          | Invalid uuid v4 string sent                         | \{key\} was not accepted for not being a valid uuid v4 string                              | \{key\} não foi aceito por não ser uma palavra uuid v4 válida                      |
| 400                    | TED000054          | Invalid Transaction Amount                          | Transaction Amount \{transaction_amount\} is invalid                                       | Valor de transação \{transaction_amount\} é inválido                               |
| 400                    | TED000057          | Invalid Document Number                             | Given \{document_number\} document number is invalid                                       | CPF/CNPJ \{document_number\} fornecido não é valido                                |
| 409                    | TED000064          | Bad Request                                         | request_control_key \{request_control_key\} already in use                                 | request_control_key \{request_control_key\} já utilizada                           |
| 400                    | TED000065          | Bad Request                                         | It has been identified by request_control_key that this request is already being processed | Foi identificado por request_control_key que está requisição está sendo processada |
| 400                    | TED000089          | Invalid Schedule Date                               | Schedule date must be after current date for UTC-3                                         | Data de agendamento deve ser após a data atual em UTC-3                            |
| 400                    | TED000090          | Invalid Schedule Date                               | Schedule date must be a workday                                                            | Data de agendamento deve ser um dia útil                                           |
| 400                    | TED000091          | Target Account and Source Account must be different | Target Account must not be the same as Source Account                                      | A conta de destino não pode ser a mesma da conta de origem                         |

---

# Cancel TED Transaction Schedule

URL: /en/documentation/baas/ted/schedule/cancelamento_de_agendamento

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted_schedule/ SCHEDULE_KEY /cancel
METHOD PATCH

### Path Params

| Field          | Type   | Description                                | Characters |
|----------------|--------|--------------------------------------------|------------|
| `account_key`  | uuidv4 | Unique account identification key.         | 36         |
| `schedule_key` | uuidv4 | Unique schedule identification key         | 36         |

### Response

STATUS 200

Response Body: Schedule Cancelled

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "schedule_key": "f64b3fa7-d09d-4927-ad4f-b966df9fb153",
  "schedule_status": "cancelled",
  "schedule_date": "2024-12-31"
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                   | Description (eng)<br/>`description`                                                 | Description (ptbr)<br/>`translation`                                                          |
|--------------------------|----------------------|--------------------------------------|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                          | schema error description                                                          | Schema Inválido                                                                             |
| 404                      | TED000009            | Not Found                            | Account not found for the given key: \{account_key\}                              | Conta não encontrada para a chave fornecida: \{account_key\}                                |
| 403                      | TED000018            | Unauthorized                         | Provided account not owned by SELECTED_AGENT                                      | Conta fornecida não pertencente ao SELECTED_AGENT                                           |
| 400                      | TED000044            | Invalid Timestamp Format sent        | Given parameter is not in the correct format \{timestamp_format\}                 | Parametro enviado não está no formato correto \{timestamp_format\}                          |
| 400                      | TED000045            | Search Params Error                  | Invalid integer value for page or size querystring parameters                     | Valor inválido para parâmetros de página ou tamanho de página                               |
| 400                      | TED000046            | Invalid uuid v4 string sent          | \{key\} was not accepted for not being a valid uuid v4 string                     | \{key\} não foi aceito por não ser uma palavra uuid v4 válida                               |
| 404                      | TED000093            | TedSchedule not Found                | TedSchedule was not found                                                         | TedSchedule não encontrada                                                                  |
| 400                      | TED000094            | Bad Request                          | Ted Schedule cannot be cancelled in current status                                | Agendamento Ted não pode ser cancelado no status atual                                      |
| 400                      | TED000095            | Bad Request                          | The given Ted Schedule is tied to a batch. It cannot be individually cancelled    | O agendamento Ted enviado está ligado a um lote. Ela não pode ser individualmente cancelada |
| 400                      | TED000096            | Bad Request                          | Action cannot be taken place as there is currently a pending transfer in progress | A ação não pôde ser completada como há uma transferência pendente                           |
| 400                      | TED000108            | Number of transfer attempts exceeded | The maximum number of failed transfer attempts has been reached                   | Número máximo de tentativas de transferência foi atingida                                   |

---

# Query TED Transaction Schedule

URL: /en/documentation/baas/ted/schedule/consulta_de_agendamento

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted_schedule/ SCHEDULE_KEY
METHOD GET

### Path Params

| Field          | Type   | Description                                 | Characters |
|----------------|--------|---------------------------------------------|------------|
| `account_key`  | uuidv4 | Unique account identification key.          | 36         |
| `schedule_key` | uuidv4 | Unique schedule identification key          | 36         |

### Response

STATUS 200

Response Body

```json
{
  "request_control_key": "b8eb663e-10fe-4729-9db5-8f8c93de5001",
  "schedule_key": "0c9091ab-079b-4a43-8b3d-d4ba36a23883",
  "schedule_batch_key": null,
  "schedule_status": "sent",
  "target_account": {
    "account_branch": "0001",
    "account_digit": "8",
    "account_number": "1234567",
    "owner_document_number": "***91111***",
    "owner_person_type": "natural",
    "owner_name": "Conta manual geral",
    "account_type": "checking_account",
    "ispb": "99999004"
  },
  "transaction_amount": 2.0,
  "rejection_info": null,
  "schedule_date": "2024-07-10",
  "updated_at": "2024-07-10T16:19:38Z",
  "created_at": "2024-06-10T11:17:28Z",
  "schedule_transfers": [
    {
      "request_control_key": "12723821-41d5-496b-b66c-fb7188f50fc1",
      "ted_key": "91028dfa-43a2-4665-adf2-0bd4571f6f0d",
      "created_at": "2024-07-10T16:19:38Z",
      "ted_status": "sent",
      "fee_amount": 2.00
    }
  ]
}
```

---

# Introduction

URL: /en/documentation/baas/ted/schedule/introducao

Through the endpoints presented in this section, the integration partner can request the scheduling of ted type transactions. With this functionality it will be possible to create, list and cancel schedules for a specific account.

## Observations

- The scheduling date takes into account Brasília time (BRT or UTC/GMT -03:00)
- Transactions will be attempted starting at 8am BRT
- Transactions cannot be scheduled for holidays or weekends
- Transactions that have failed due to insufficient balance will be retried in 1 hour with a limit of 3 attempts
- A webhook will be sent to the integration partner informing the success or rejection of a schedule

## Ted Schedule Status

| Enumerator                 | Description                                                                                     |
|----------------------------|------------------------------------------------------------------------------------------------|
| **scheduled**              | Scheduled transaction                                                                          |
| **sent**                   | Schedule completed and sent successfully. Final state                                          |
| **rejected**               | Schedule rejected during creation or execution. Final state                                    |
| **cancelled**              | Schedule cancelled by client request. Final state                                             |
| **pending_2fa_approval**   | Pending approval by two-factor authentication                                                  |
| **waiting_batch_approval** | Schedule created and linked to a batch awaiting approval by two-factor authentication         |

## Schedule Transfers

On the scheduling date, the ted transaction will be attempted. At this moment a **ted** is generated and it will be added to the `schedule_transfers` list. A maximum of 3 ted transactions will be attempted.

---

# List TED Transaction Schedules for an Account

URL: /en/documentation/baas/ted/schedule/listar_agendamentos_de_uma_conta

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted_schedules
METHOD GET

### Path Params

| Field         | Type   | Description                            | Characters |
|---------------|--------|----------------------------------------|------------|
| `account_key` | uuidv4 | Unique account identification key.     | 36         |

### Query Params

| Field                 | Type    | Description                                                             | Characters                                                    |
|-----------------------|---------|-------------------------------------------------------------------------|---------------------------------------------------------------|
| `request_control_key` | uuidv4  | Unique request identification key used by the client.                  | 36                                                            |
| `schedule_status`     | string  | Schedule status. Can be sent as a list.                                | **[schedule_status Enumerator](#schedule_status-enumerator)** |
| `page`                | integer | Requested page number. Default is 1                                    |                                                               |
| `page_size`           | integer | Size of the requested page in the query. Default is 30 and maximum     | Maximum value of 30                                           |

### schedule_status Enumerator

| Enumerator                 | Description                                                                                    |
|----------------------------|------------------------------------------------------------------------------------------------|
| **scheduled**              | Scheduled transaction                                                                          |
| **sent**                   | Schedule completed and sent successfully. Final state                                          |
| **rejected**               | Schedule rejected during creation or execution. Final state                                    |
| **cancelled**              | Schedule cancelled by client request. Final state                                              |
| **pending_2fa_approval**   | Pending approval by two-factor authentication                                                  |
| **pending_creation**       | Schedule in creation process (Transitional state for batch scheduling)                        |
| **waiting_batch_approval** | Schedule created and linked to a batch awaiting approval by two-factor authentication         |

### Response

STATUS 200

Response Body

```json
{
  "data": [
    {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "schedule_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "schedule_status": "scheduled",
      "schedule_date": "2024-12-31",
      "created_at": "2023-03-13T19:00:28.440Z"
    },
    {
      "request_control_key": "bf6b0a4b-c7a5-446b-9dad-1ae10b25342a",
      "schedule_key": "2479a5cd-079e-4d72-bf4e-16a695bda45e",
      "schedule_status": "cancelled",
      "schedule_date": "2024-12-31",
      "created_at": "2023-03-13T19:00:28.440Z"
    },
    {
      "request_control_key": "9d36c03e-2db7-4c90-87ed-6c9ddb3c03c7",
      "schedule_key": "5d6b14b9-053f-408c-bcd7-61ecf9224f2c",
      "schedule_status": "rejected",
      "schedule_date": "2024-12-31",
      "created_at": "2023-03-13T19:00:28.440Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "next_page": null,
    "rows_per_page": 30
  }
}

```

---

# Request TED Transaction Scheduling

URL: /en/documentation/baas/ted/schedule/solicitacao_de_agendamento

## Request

ENDPOINT /account/ ACCOUNT_KEY /ted_schedule
METHOD POST

Request Body

```json
{
  "request_control_key": "0c3d2a3e-c121-464e-b5a4-8e69e0c17bbd",
  "target_account": {
    "account_branch": "0001",
    "account_number": "92796",
    "account_digit": "1",
    "owner_document_number": "23599885000192",
    "owner_name": "Titular da Conta",
    "ispb": "12345678",
    "account_type": "checking_account"
  },
  "transaction_amount": 8.86,
  "schedule_date": "2024-12-01"
}
```

### Path Params

| Field         | Type   | Description                                     | Characters |
|---------------|--------|-------------------------------------------------|------------|
| `account_key` | uuidv4 | Unique account identification key.              | 36         |

## Body Params

| Field                   | Type   | Description                                                                          | Characters                                           |
|-------------------------|--------|--------------------------------------------------------------------------------------|------------------------------------------------------|
| `request_control_key` * | string | Unique request identification key used by the client in uuid v4 format.             | 36                                                   |
| `target_account` *      | object | Target account                                                                       | **[target_account Object](#target_account-object)** | 
| `transaction_amount` *  | float  | Transfer amount                                                                      | 10                                                   |
| `schedule_date`*        | string | Date when the transaction should be executed.                                        | 10                                                   |

## target_account Object

| Field                     | Type   | Description                                      | Characters                                               |
|---------------------------|--------|--------------------------------------------------|----------------------------------------------------------|
| `account_branch` *        | string | Branch.                                          | 4                                                        |
| `account_digit` *         | string | Account digit                                    | 1                                                        |
| `account_number` *        | string | Account number.                                  | 20                                                       |
| `owner_document_number` * | string | CPF or CNPJ (numbers only) of the account holder. | 14                                                       |
| `owner_name` *            | string | Account holder name.                             | 50                                                       |
| `account_type`*           | string | Account type.                                    | **[account_type Enumerator](#account_type-enumerator)** |
| `ispb` *                  | string | Based on financial institution CNPJ (8 digits). | 8                                                        |

## account_type Enumerator

| Enumerator             | Translation           |
|------------------------|-----------------------|
| **checking_account**   | checking account      |
| **deposit_account**    | deposit account       |
| **guaranteed_account** | guaranteed account    |
| **investment_account** | investment account    |
| **payment_account**    | payment account       |
| **saving_account**     | savings account       |

## Response

STATUS 201

Response Body: Schedule Created

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "schedule_key": "f64b3fa7-d09d-4927-ad4f-b966df9fb153",
  "schedule_status": "scheduled",
  "schedule_date": "2024-12-31"
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                   | Description (eng)<br/>`description`                                                        | Description (ptbr)<br/>`translation`                                               |
|------------------------|--------------------|----------------------------------------------------|---------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|
| 400                    | QIT000001          | Bad Request                                        | schema error description                                                                    | Schema Inválido                                                                     |
| 404                    | TED000006          | Target account Not Found                           | Target account was not found for given parameters                                           | Conta destino não encontrada para os parâmetros informados                         |
| 404                    | TED000009          | Not Found                                          | Account not found for the given key: \{account_key\}                                        | Conta não encontrada para a chave fornecida: \{account_key\}                       |
| 403                    | TED000014          | Invalid target account                             | Invalid target account                                                                      | Conta destino inválida                                                              |
| 400                    | TED000015          | Bad Request                                        | Account blocked or closed can not perform this action                                       | A conta bloqueada ou fechada não pode executar esta ação                           |
| 400                    | TED000016          | Bad Request                                        | Hub account can not perform this action                                                     | A conta hub não pode executar esta ação                                            |
| 403                    | TED000018          | Unauthorized                                       | Provided account not owned by SELECTED_AGENT                                                | Conta fornecida não pertencente ao SELECTED_AGENT                                  |
| 400                    | TED000031          | Bad Request                                        | ISPB number \{ispb\} does not exist or is inactive                                          | ISPB \{ispb\} não existe ou está inativo                                           |
| 400                    | TED000044          | Invalid Timestamp Format sent                      | Given parameter is not in the correct format \{timestamp_format\}                           | Parametro enviado não está no formato correto \{timestamp_format\}                 |
| 400                    | TED000046          | Invalid uuid v4 string sent                        | \{key\} was not accepted for not being a valid uuid v4 string                               | \{key\} não foi aceito por não ser uma palavra uuid v4 válida                      |
| 400                    | TED000054          | Invalid Transaction Amount                         | Transaction Amount \{transaction_amount\} is invalid                                        | Valor de transação \{transaction_amount\} é inválido                               |
| 400                    | TED000057          | Invalid Document Number                            | Given \{document_number\} document number is invalid                                        | CPF/CNPJ \{document_number\} fornecido não é valido                                |
| 409                    | TED000064          | Bad Request                                        | request_control_key \{request_control_key\} already in use                                  | request_control_key \{request_control_key\} já utilizada                           |
| 400                    | TED000065          | Bad Request                                        | It has been identified by request_control_key that this request is already being processed | Foi identificado por request_control_key que está requisição está sendo processada |
| 400                    | TED000089          | Invalid Schedule Date                              | Schedule date must be after current date for UTC-3                                          | Data de agendamento deve ser após a data atual em UTC-3                            |
| 400                    | TED000090          | Invalid Schedule Date                              | Schedule date must be a workday                                                             | Data de agendamento deve ser um dia útil                                           |
| 400                    | TED000091          | Target Account and Source Account must be different | Target Account must not be the same as Source Account                                       | A conta de destino não pode ser a mesma da conta de origem                         |

---

# TED Schedule Completion Webhook

URL: /en/documentation/baas/ted/schedule/webhook_de_conclusao_de_agendamento

After completing a TED schedule, a webhook will be sent to the integrating partner with the result.

:::danger Attention!
QI Tech webhooks should not be mapped in a restrictive way. Additional fields may be included in the webhook payloads returned by our APIs.
:::

### Webhook Request Body

Request Body: Schedule Completed and Sent

```json
{
  "webhook_type": "baas.ted.ted_schedule.completed",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
    "request_control_key": "b8eb663e-10fe-4729-9db5-8f8c93de5001",
    "schedule_key": "0c9091ab-079b-4a43-8b3d-d4ba36a23883",
    "schedule_batch_key": null,
    "schedule_status": "sent",
    "target_account": {
      "account_branch": "0001",
      "account_digit": "8",
      "account_number": "1234567",
      "owner_document_number": "***91111***",
      "owner_person_type": "natural",
      "owner_name": "Conta manual geral",
      "account_type": "checking_account",
      "ispb": "99999004"
    },
    "transaction_amount": 2.0,
    "rejection_info": null,
    "schedule_date": "2024-07-10",
    "updated_at": "2024-07-10T16:19:38Z",
    "created_at": "2024-06-10T11:17:28Z",
    "schedule_transfers": [
      {
        "request_control_key": "12723821-41d5-496b-b66c-fb7188f50fc1",
        "ted_key": "91028dfa-43a2-4665-adf2-0bd4571f6f0d",
        "created_at": "2024-07-10T16:19:38Z",
        "ted_status": "sent",
        "fee_amount": 2.00
      }
    ]
  }
}
```

Request Body: Schedule Completed and Rejected

```json
{
  "webhook_type": "baas.ted.ted_schedule.completed",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
    "request_control_key": "b8eb663e-10fe-4729-9db5-8f8c93de5001",
    "schedule_key": "0c9091ab-079b-4a43-8b3d-d4ba36a23883",
    "schedule_batch_key": null,
    "schedule_status": "sent",
    "target_account": {
      "account_branch": "0001",
      "account_digit": "8",
      "account_number": "1234567",
      "owner_document_number": "***91111***",
      "owner_person_type": "natural",
      "owner_name": "Conta manual geral",
      "account_type": "checking_account",
      "ispb": "99999004"
    },
    "transaction_amount": 2.0,
    "rejection_info": {
      "error_code": "TED000103",
      "error_description": "The maximum number of failed transfer attempts has been reached",
      "error_translation": "Número máximo de tentativas de transferência foi atingida",
      "rejection_reason": "max_tries_exceeded"
    },
    "schedule_date": "2024-07-10",
    "updated_at": "2024-07-10T16:19:38Z",
    "created_at": "2024-06-10T11:17:28Z",
    "schedule_transfers": [
      {
        "ted_key": "907e38c5-5700-492f-a181-8f651317458b",
        "created_at": "2024-07-10T16:19:38Z",
        "ted_status": "rejected",
        "fee_amount": 2.00
      },
      {
        "ted_key": "356f8855-8f8d-4aaa-8e8c-1287e363d143",
        "created_at": "2024-07-10T17:19:38Z",
        "ted_status": "rejected",
        "fee_amount": 2.00
      },
      {
        "ted_key": "c51cc7ee-d966-4bbb-8405-4850b90b43f8",
        "created_at": "2024-07-10T18:19:38Z",
        "ted_status": "rejected",
        "fee_amount": 2.00
      }
    ]
  }
}
```

### Webhook Body Param

| Field                 | Type   | Description                                                                | Max. Characters                                                    |
|-----------------------|--------|----------------------------------------------------------------------------|--------------------------------------------------------------------|
| `webhook_type`        | string | An enumerator that defines the type of event being reported               | 23                                                                 |
| `webhook_datetime`    | string | Date and time of the webhook sending                                       | 20                                                                 |
| `request_control_key` | uuidv4 | Unique identification key for the request used by the client in uuid v4 format. | 36                                                                 |                                                                  |
| `schedule_key`        | string | Unique identification key for the schedule                                 | 36                                                                 |
| `schedule_batch_key`  | string | Unique identification key for the schedule batch                           | 36                                                                 |
| `schedule_status`     | string | Status of the schedule                                                     | **[Enumerator schedule_status](#ted-schedule-status)**             |
| `target_account`      | object | Target account for the schedule                                            | **[Object target_account](#target_account-object)**                |
| `transaction_amount`  | number | Transfer amount                                                            | 10                                                                 |
| `schedule_transfers`  | array  | List of transfer attempts made by the schedule                             | list of **[Object schedule_transfer](#schedule-transfer-object)** |
| `schedule_date`       | string | Date when the transaction will be executed.                               | 10                                                                 |
| `rejection_info`      | object | Object with information about the rejection event                          |                                                                    |
| `updated_at`          | string | Date and time of the last schedule update.                                | 20                                                                 |
| `created_at`          | string | Date and time of schedule creation.                                        | 20                                                                 |

## Ted Schedule Status

| Enumerator                 | Description                                                                    |
|----------------------------|--------------------------------------------------------------------------------|
| **scheduled**              | Transaction scheduled                                                          |
| **sent**                   | Schedule completed and sent successfully. Final state                          |
| **rejected**               | Schedule rejected during creation or execution. Final state                    |
| **cancelled**              | Schedule cancelled by client request. Final state                              |
| **pending_2fa_approval**   | Pending approval by two-factor authentication                                  |
| **waiting_batch_approval** | Schedule created and linked to a batch waiting for two-factor authentication approval |

### Schedule Transfer Object

| Field        | Type   | Description                                                 | Characters                                     |
|--------------|--------|-------------------------------------------------------------|------------------------------------------------|
| `ted_key`    | uuidv4 | Unique identification key for the TED transfer in QI system. | 36                                             |
| `ted_status` | string | Transaction status.                                         | [Enumerator ted_status](#ted-status-enumerator) |
| `fee_amount` | number | Transfer amount                                             | 10                                             |
| `created_at` | string | Date and time of transaction creation                       | 20                                             |

### Ted Status Enumerator

| Enumerator   | Description                                       |
|--------------|---------------------------------------------------|
| **sent**     | Transaction sent successfully. Final state       |
| **rejected** | Transaction rejected during execution. Final state |
| **pending**  | Transaction pending completion. Transitory state |

### target_account Object

| Field                   | Type       | Description                                                                                          | Characters                                                        |
|-------------------------|------------|------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| `account_branch`        | string     | Account branch                                                                                       | 6                                                                 |
| `account_digit`         | string     | Account digit                                                                                        | 1                                                                 |
| `account_number`        | string     | Account number                                                                                       | 20                                                                |
| `owner_document_number` | string     | CPF or CNPJ (numbers only) of the account holder                                                    | 14                                                                |
| `owner_name`            | string     | Name of the account holder                                                                           | 150                                                               |
| `owner_person_type`     | enumerator | Identifier whether the owner of the sent account is a natural or legal person                       | **[Enumerator owner_person_type](#owner_person_type-enumerator)** |                                                    |
| `owner_name`            | string     | Name of the account holder                                                                           | 150                                                               |
| `account_type`          | enumerator | Type of account                                                                                      | **[Enumerator account_type](#account_type-enumerator)**           |
| `ispb`                  | string     | Eight-digit code that identifies banks in the Central Bank's reserve transfer system               | 8                                                                 |

### owner_person_type Enumerator

| Enum        | Description  |
|-------------|--------------|
| **natural** | Natural person   |
| **legal**   | Legal person |

## account_type Enumerator

| Enumerator             | Translation           |
|------------------------|-----------------------|
| **checking_account**   | checking account        |
| **deposit_account**    | deposit account        |
| **guaranteed_account** | guarantee account     |
| **investment_account** | investment account |
| **payment_account**    | payment account    |
| **saving_account**     | savings account        |

---

# Webhook after TED sending completion

URL: /en/documentation/baas/ted/webhooks

The webhook will notify if a TED transaction has been returned.

## Webhook Request Body

**Webhook Body: TED Rejected**

```json
{
  "webhook_type": "baas.ted.outgoing_ted",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
    "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
    "ted_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
    "created_at": "2021-10-22T20:30:23.459Z",
    "ted_status": "sent",
    "transaction_amount": 126.97,
    "fee_amount": 0.0,
    "target_account": {
      "account_branch": "0001",
      "account_digit": "6",
      "account_number": "78340",
      "ispb": "12345678",
      "owner_document_number": "32402502000135",
      "owner_name": "QI Tech"
    },
    "refusal_reason": {
      "refusal_code": 1,
      "enumerator": "conta_destinatario_encerrada",
      "description": "Conta Destinatária do Crédito Encerrada"
    }
  }
}
```

**Webhook Body: TED Confirmed**

```json
{
  "webhook_type": "baas.ted.outgoing_ted",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
    "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
    "ted_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
    "created_at": "2021-10-22T20:30:23.459Z",
    "ted_status": "confirmed",
    "transaction_amount": 126.97,
    "fee_amount": 0.0,
    "target_account": {
      "account_branch": "0001",
      "account_digit": "6",
      "account_number": "78340",
      "ispb": "12345678",
      "owner_document_number": "32402502000135",
      "owner_name": "QI Tech"
    },
    "refusal_reason": null
  }
}
```

## Webhook Body Param
| Field                | Type   | Description                                                                 | Max. Characters                                      |
|----------------------|--------|-----------------------------------------------------------------------------|-----------------------------------------------------|
| `webhook_type`       | string | An enumerator that defines the type of event being reported                 | 23                                                  |
| `webhook_datetime`   | string | Date and time the webhook was sent                                           | 20                                                  |
| `request_control_key`| string | Unique request identification key used by the client in uuid v4 format       | 36                                                  |
| `ted_key`            | string | Unique identification key of the TED transfer                               | 36                                                  |
| `created_at`         | string | Date and time the transaction was created                                    | 24                                                  |
| `ted_status`         | string | Status of the TED transaction                                                | **[Enumerator ted_status](#enumerator-ted_status)**             |
| `transaction_amount` | number | Transfer amount                                                             | 10                                                  |
| `fee_amount`         | number | Fee amount charged by the transfer                                           | 35                                                  |
| `target_account`     | Object | Destination account - Should only be sent in transactions of type "manual"   | **[Object target_account](#object-target_account)** |
| `refusal_reason`     | Object | Reason for refusal according to the Central Bank standard                    | **[Object refusal_reason](#object-refusal_reason)** |

## Enumerator ted_status

| Enumerator    | Description                                   |
|---------------|-----------------------------------------------|
| **sent**      | TED transfer successfully sent.               |
| **confirmed** | TED transfer successfully completed.          |
| **pending**   | TED transfer pending.                         |
| **rejected**  | TED transfer rejected.                        |
| **returned**  | TED transfer returned.                        |

## Object target_account

| Field                    | Type   | Description                                        | Characters                                      |
|--------------------------|--------|----------------------------------------------------|-------------------------------------------------|
| `account_branch` *       | string | Branch.                                            | 4                                               |
| `account_digit` *        | string | Account digit                                      | 1                                               |
| `account_number` *       | string | Account number.                                    | 20                                              |
| `owner_document_number` *| string | CPF or CNPJ (numbers only) of the account holder.  | 14                                              |
| `owner_name` *           | string | Name of the account holder.                        | 50                                              |
| `account_type` *         | string | Account type.                                      | **[Enumerator account_type](#enumerator-account_type)**     |
| `ispb` *                 | string | Based on the financial institution's CNPJ (8 digits). | 8                                               |

## Object refusal_reason

| Field         | Type   | Description               | Characters |
|---------------|--------|---------------------------|------------|
| `bacen_code` *| string | Bacen refusal code         | 3          |
| `enumerator` *| string | Bacen refusal enumerator   | 100        |
| `description` *| string | Bacen refusal description  | 100        |

## Enumerator account_type

| Enumerator         | Translation              |
|--------------------|-----------------------|
| checking_account   | conta corrente        |
| deposit_account    | conta depósito        |
| guaranteed_account | conta de garantia     |
| investment_account | conta de investimento |
| payment_account    | conta de pagamento    |
| saving_account     | conta poupança        |

## Webhook after TED reception

The webhook will inform about the final status of the TED transaction.

## Webhook Request Body

**Request Body: TED Received**

```json
{
  "webhook_type": "baas.ted.incoming_ted",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
    "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
    "ted_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
    "created_at": "2021-10-22T20:30:23.459Z",
    "ted_status": "received",
    "transaction_amount": 126.97,
    "fee_amount": 0.0,
    "source_account": {
      "account_branch": "0001",
      "account_digit": "6",
      "account_number": "78340",
      "ispb": "12345678",
      "owner_document_number": "32402502000135",
      "owner_name": "QI Tech"
    },
    "refusal_reason": {}
  }
}
```

## Webhook Body Param

| Field                | Type   | Description                                                                 | Max. Characters                                      |
|----------------------|--------|-----------------------------------------------------------------------------|-----------------------------------------------------|
| `webhook_type`       | string | A enumerator that defines the type of event being reported                  | 23                                                  |
| `webhook_datetime`   | string | Date and time the webhook was sent                                           | 20                                                  |
| `ted_key`            | string | Unique identification key of the TED transfer                               | 36                                                  |
| `created_at`         | string | Date and time the transaction was created                                    | 100                                                 |
| `ted_status`         | string | Status of the TED transaction                                                | **[Enumerator ted_status](#enumerator-ted_status)** |
| `transaction_amount` | number | Transfer amount                                                             | 10                                                  |
| `fee_amount`         | number | Fee amount charged by the transfer                                           | 35                                                  |
| `target_account`     | Object | Destination account - Should only be sent in transactions of type "manual"   | **[Object target_account](#object-target_account)** |
| `refusal_reason`     | Object | Reason for refusal according to the Central Bank standard                    | **[Object refusal_reason](#object-refusal_reason)** |

## Enumerator ted_status

| Enumerator   | Description                                   |
|--------------|----------------------------------------------|
| **received** | TED transfer successfully received.          |
| **pending**  | TED transfer pending.                        |
| **rejected** | TED transfer rejected.                       |

## Object target_account

| Field                    | Type   | Description                                        | Characters                                      |
|--------------------------|--------|--------------------------------------------------  |-------------------------------------------------|
| `account_branch` *       | string | Branch.                                            | 10                                              |
| `account_digit` *        | string | Account digit                                      | 10                                              |
| `account_number` *       | string | Account number.                                    | 10                                              |
| `owner_document_number` *| string | CPF or CNPJ (numbers only) of the account holder.  | 14                                              |
| `owner_name` *           | string | Name of the account holder.                        | 50                                              |
| `account_type`*          | string | Account type.                                      | **[Enumerator account_type](#enumerator-account_type)**     |
| `ispb` *                 | string | Based on the financial institution's CNPJ (8 digits). | 8                                           |

## Object refusal_reason

| Field           | Type   | Description               | Characters |
|-----------------|--------|---------------------------|------------|
| `bacen_code` *  | string | Bacen refusal code         | 3          |
| `enumerator` *  | string | Bacen refusal enumerator   | 100        |
| `description` * | string | Bacen refusal description  | 100        |

## Enumerator account_type

| Enumerator         | Translation              |
|--------------------|-----------------------|
| checking_account   | conta corrente        |
| deposit_account    | conta depósito        |
| guaranteed_account | conta de garantia     |
| investment_account | conta de investimento |
| payment_account    | conta de pagamento    |
| saving_account     | conta poupança        |

---

# baas_consulta_documents

URL: /en/documentation/baas/upload_de_documentos/baas_consulta_documents



---

# baas_upload_de_documentos

URL: /en/documentation/baas/upload_de_documentos/



---

# Approve Boleto Payment

URL: /en/documentation/boletos/2fa/realizar_pagamento_de_um_boleto

To make a Boleto payment, two calls are required:

1. Transfer validation token request: /baas/token_request

2. Transfer approval: /baas/movement_validation

:::info
The sent Token must be provided at the time of boleto payment approval, and the "***movement_payload***" must be the same as provided when the token was requested.
:::

## Request

METHOD POST
ENDPOINT /baas/movement_validation

Request Body

```json
{
    "token": "358192",
    "movement_payload": {
        "resource_account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
        "digitable_line": "32990001031000699926165000000201993810000003500"
    }
}

```

## Body Params
| Field | Type | Description | Characters |
|---|---| ---| ---|
| `token` * | string | Authentication token | 6 |
| `agent_document_number` * | string | CPF of the user who will receive the token. (Numbers only) | 11 |
| `movement_payload` | Object | Payload containing transfer information | **[Object movement_payload](#object-movement_payload)** |

### Object movement_payload

| Field | Type | Description | Characters |
|---|---| ---| ---|
| `resource_account_key` * | uuidv4 | Unique identification key of the account that will make the payment | 36 |
| `digitable_line` * | string | Boleto digitable line | 47 |

## Response

STATUS 200

Response Body

```json
{
    "movement_info": {
        "origin": {
            "account": "42863",
            "branch": "0001",
            "digit": "0",
            "document": "73685224000239",
            "name": "Empresa de Teste",
            "financialInstitution": "QI Sociedade de Crédito Direto S.A."
        },
          "faceValue": "2185.0",
          "amount": "2185.0",
          "dueDate": "2024-04-18T03:00:00.000Z",
          "type": "bank_slip_payment",
          "digitableLine": "32990001031000699926165000000201993810000003500",
          "barCode": "00191969000002185000000001120035240112154117",
          "destination": {
            "document": "05626796000106",
            "guarantorName": null,
            "name": "Beneficiário do Boleto",
            "guarantorDocument": null,
            "bank": "QI Sociedade de Crédito Direto S.A."
          }
        },
        "account_key": "0000000-0000-0000-0000-000000000000",
        "transaction_key": "0000000-0000-0000-0000-000000000000",
        "movement_status": "approved",
        "schedule_key": null,
        "movement_amount": 2185,
        "origin_key": null,
        "transacted_at_br": "2024-04-18 09:50:38-03:00",
        "requester_user_key": "0000000-0000-0000-0000-000000000000",
        "requester_key": "0000000-0000-0000-0000-000000000000",
        "movement_request_key": "0000000-0000-0000-0000-000000000000",
        "movement_date": "2024-04-18",
        "approval_feedback": true,
        "movement_type": "bank_slip_payment",
        "movement_data": {
          "transaction_key":  "0000000-0000-0000-0000-000000000000",
          "resource_account_key": "0000000-0000-0000-0000-000000000000",
          "digitable_line": "32990001031000699926165000000201993810000003500"
        },
        "transacted_at": "2024-04-18 12:50:38"
    }
```

---

# Request Token for Boleto Payment

URL: /en/documentation/boletos/2fa/solicitar_token_para_pagamento

To make a Boleto payment, two calls are required:

1. Transfer validation token request: /baas/token_request

2. Transfer approval: /baas/movement_validation

## Request

- METHOD POST
- ENDPOINT /baas/token_request

Request Body

```json
{
    "contact_type": "email",
    "agent_document_number": "97564480084",
    "movement_payload": {
        "resource_account_key": "6d3089b1-cb90-4ceb-b1ea-5bd600cdf3c8",
        "digitable_line": "32990001031000699926165000000201993810000003500"
    }
}
```

## Body Params
| Field | Type | Description | Characters |
|---|---| ---| ---|
| `contact_type` * | string | Authentication token delivery method, can be via Email ("email") or SMS ("sms") | 10 |
| `agent_document_number` * | string | CPF of the user who will receive the token. (Numbers only) | 11 |
| `movement_payload` | Object | Payload containing transfer information | **[Object movement_payload](#object-movement_payload)** |

### Object movement_payload

| Field | Type | Description | Characters |
|---|---| ---| ---|
| `resource_account_key` * | uuidv4 | Unique identification key of the account that will make the payment | 36 |
| `digitable_line` * | string | Boleto digitable line | 47 |

## Response

STATUS 200

Response Body
```json
{}
```

---

# Create Wallet

URL: /en/documentation/boletos/carteira/criar_carteira

:::danger Important
To register bolePix, it is necessary that an active random Pix key exists in the account where the boletos will be registered.
:::

Boleto wallets have a unique identification code (`requester_profile_code`) and specific default configurations for payment, discharge, protest, etc. of the boleto. The same account can have multiple boleto wallets, which allows the user to create multiple wallets with different default configurations. This dynamic facilitates the generation of boletos, with different configurations, in a more agile and automatic manner.

:::info Information
For all accounts, a boleto wallet is created with the client's default configurations. This default configuration pattern can be changed by contacting our support (suporte.baas@qitech.com.br). After account creation, it is also possible to change the account fees using the [**fee configuration endpoint**](/documentation/contas/consulta_de_tarifas).
:::

:::caution Attention!
The creation of boleto wallets is an asynchronous flow. After approval/rejection of wallet creation by CIP/Nuclea, the requester will be notified via [**webhook**](/documentation/boletos/v2/webhooks/carteira) about the result of such request.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile
METHOD POST

### Path parameters

| Field                   | Type   | Description                                                    | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format    | 36         |

Request Body

```json
{
  "request_control_key": "0868a24b-4a69-4138-ac4d-ecaeddf0005f",
  "configuration_data": {
    "max_payment_days": 1,
    "protest_settings": {
      "days_to_protest": 0
    },
    "bankruptcy_protest_settings": {
      "days_to_bankruptcy_protest": 0
    },
    "write_off_settings": {
      "days_to_write_off": 0
    },
    "fine_settings": {
      "fine_type": "absolute",
      "fine_amount": 10,
      "days_to_fine": 0
    },
    "interest_settings": {
      "interest_type": "workdays_daily_amount",
      "interest_amount": 10,
      "days_to_interest": 0
    },
    "qr_code_settings": {
      "pix_key": "5df7a433-bd61-4f98-9515-df9aedc2980c",
      "qr_code_on_discharge_enabled": false
    },
    "cnab_settings": {
      "default_bank": "qi_scd",
      "preferred_layout": "400"
    }
  }
}
```

### Request Body Params

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|------------|
| `request_control_key` *    | uuidv4  | Unique request identification key used by the client in uuid v4 format  | 36         |
| `configuration_data` *     | object  | Wallet default configurations  | **[configuration_data Object](#configuration_data-object)** |

### configuration_data Object

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|------------|
| `max_payment_days` *      | integer | Maximum calendar days the boleto will remain available for payment after due date (can be at most 365) | -          |
| `write_off_settings`       | object  | Default discharge configuration      | **[write_off_settings Object](#write_off_settings-object)** |
| `protest_settings`         | object  | Default protest configuration       | **[protest_settings Object](#protest_settings-object)** |
| `bankruptcy_protest_settings` | object  | Default bankruptcy protest configuration | **[bankruptcy_protest_settings Object](#bankruptcy_protest_settings-object)** |
| `fine_settings`            | object  | Default fine configuration                 | **[fine_settings Object](#fine_settings-object)** |
| `interest_settings`        | object  | Default interest configuration        | **[interest_settings Object](#interest_settings-object)** |
| `qr_code_settings`         | object  | Default PIX QR Code configuration (for bolePix) | **[qr_code_settings Object](#qr_code_settings-object)** |
| `cnab_settings`            | object  | Default CNAB files configuration | **[cnab_settings Object](#cnab_settings-object)** |

### write_off_settings Object

| Field                     | Type    | Description                                                                   | Characters |
|---------------------------|---------|-----------------------------------------------------------------------------|------------|
| `days_to_write_off` *     | integer | Days after due date for the boleto to be automatically discharged     | -          |

### protest_settings Object
| Field                     | Type    | Description                                                                   | Characters |
|---------------------------|---------|-----------------------------------------------------------------------------|------------|
| `days_to_protest` *       | integer | Days after due date for the boleto to be automatically protested  | -          |

### bankruptcy_protest_settings Object

| Field                          | Type    | Description                                                                   | Characters  |
|--------------------------------|---------|-----------------------------------------------------------------------------|-------------|
| `days_to_bankruptcy_protest` * | integer | Days after due date for a bankruptcy protest process to be automatically initiated  | -           |

### fine_settings Object

Option 1: absolute amount fine (`fine_type=absolute`)

| Field                     | Type    | Description                                               | Characters                |
|---------------------------|---------|---------------------------------------------------------|-------------------------------------------------------------------------|
| `fine_type` *             | string  | Type of fine                                                       | **[fine_type Enumerators](#fine_type-enumerators)**                                              |
| `fine_amount` *           | float   | Absolute amount of the fine                                             | -                                                                        |
| `days_to_fine` *          | integer | Days after due date for the fine to be charged              | -                                                                        |

Option 2: percentage fine (`fine_type=percentage`)

| Field                     | Type    | Description                                                 | Characters                             |
|---------------------------|---------|-----------------------------------------------------------|---------------------------------------|
| `fine_type` *             | string  | Type of fine                                             | **[fine_type Enumerators](#fine_type-enumerators)** |
| `fine_percentage` *       | integer | Percentage amount of the fine, from 1 to 100                     | -                                      |
| `days_to_fine` *          | integer | Days after due date for the fine to be charged    | -                                      |

### fine_type Enumerators

| Enumerator         | Description             |
|--------------------|-----------------------|
| absolute           | absolute amount        |
| percentage         | percentage amount      |

### interest_settings Object

Option 1: interest using absolute amounts (`interest_type=calendar_days_daily_amount` or `interest_type=workdays_daily_amount`)

| Field                     | Type    | Description                                                                     | Characters                                                                                      |
|---------------------------|---------|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| `interest_type` *         | string  | Type of interest       | **[interest_type Enumerators](#interest_type-enumerators)** |
| `interest_amount` *       | float   | Amount to be charged per determined time unit (business days or calendar days) | -                                                                                               |
| `days_to_interest` *      | integer | Days after due date to start charging interest                    | -                                                                                               |

Option 2: interest using percentage amounts (`interest_type=calendar_days_monthly_percentage`)

| Field                    | Type    | Description                                                                             | Characters                                                                                          |
|--------------------------|---------|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| `interest_type` *        | string  | Type of interest       | **[interest_type Enumerators](#interest_type-enumerators)** |
| `interest_percentage` *  | integer | Percentage to be charged per determined time unit (business days or calendar days)                                                                      | -                                                                           |
| `days_to_interest` *     | integer | Days after due date to start charging interest                             | -                                                                                                   |

### interest_type Enumerators

| Enumerator                       | Description                                                            |
|----------------------------------|----------------------------------------------------------------------|
| calendar_days_daily_amount       | Daily amount over calendar days                                     |
| workdays_daily_amount            | Daily amount over business days                                        |
| calendar_days_monthly_percentage | Interest percentage charged monthly, based on calendar days |

### qr_code_settings Object

| Field                            | Type    | Description                                                                   | Characters  |
|----------------------------------|---------|-----------------------------------------------------------------------------|-------------|
| `pix_key` *                      | uuidv4  | Random type Pix key                                                 | 36          |
| `qr_code_on_discharge_enabled` * | boolean | Determines if QR Code information will appear in the return file (CNAB)  | -           |

:::info Information
The PIX copy and paste will be returned in the CNAB file at position 029 to 105.
:::

:::caution Attention!
If the `qr_code_settings` object is sent in the request, this wallet will have bolePix generation as its default configuration . BolePix are boletos whose payment is linked to a PIX QR Code. Therefore, the payer can make payment of the boletos either using their readable lines, or by reading the linked PIX QR Codes. If payment is made via QR Code, financial settlement happens instantly. Regarding notifications, two webhooks are sent: one upon PIX transfer (payment notice, boleto goes to `payment_notice` status); and another a few seconds or minutes later, after confirmation of discharge at CIP/Nuclea (paid, boleto goes to `paid` status).
:::

### cnab_settings Object

| Field                            | Type    | Description                                                                   | Characters  |
|----------------------------------|---------|-----------------------------------------------------------------------------|-------------|
| `default_bank`                   | string  | Default bank layout for CNAB file processing                            | **[default_bank Enumerators](#default_bank-enumerators)** |
| `preferred_layout`               | string  | Preferred layout for CNAB files                                         | **[preferred_layout Enumerators](#preferred_layout-enumerators)** |

### default_bank Enumerators

| Enumerator         | Description             |
|--------------------|-----------------------|
| santander          | Santander Bank       |
| itau               | Itaú Bank            |
| bradesco           | Bradesco Bank        |
| qi_scd             | QI SCD                |

### preferred_layout Enumerators

| Enumerator         | Description             |
|--------------------|-----------------------|
| 400                | CNAB 400 Layout       |
| 240                | CNAB 240 Layout       |

## Response

STATUS 202

Response Body

```json
{
  "requester_profile_key": "fd86d9b1-2a5e-4e03-9a59-a043c7632c97",
  "requester_profile_code": "329-04-2338-2625918",
  "request_control_key": "0868a24b-4a69-4138-ac4d-ecaeddf0005f",
  "account_key": "0494902f-b21c-4ae6-b37e-854cfe883402",
  "requester_profile_status": "pending",
  "configuration_data": {
    "max_payment_days": 1,
    "protest_settings": {
      "days_to_protest": 0
    },
    "bankruptcy_protest_settings": {
      "days_to_bankruptcy_protest": 0
    },
    "write_off_settings": {
      "days_to_write_off": 0
    },
    "fine_settings": {
      "fine_type": "absolute",
      "fine_amount": 10,
      "days_to_fine": 0
    },
    "interest_settings": {
      "interest_type": "workdays_daily_amount",
      "interest_amount": 10,
      "days_to_interest": 0
    },
    "qr_code_settings": {
      "pix_key": "5df7a433-bd61-4f98-9515-df9aedc2980c",
      "qr_code_on_discharge_enabled": false
    },
    "cnab_settings": {
      "default_bank": "qi_scd",
      "preferred_layout": "400"
    }
  }
}

```

### Response Body Params

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------------------|
| `requester_profile_key` *  | uuidv4  | Unique wallet identification key in uuid v4 format  | 36      |
| `requester_profile_code` * | string  | Unique wallet identification code                    | 19      |
| `request_control_key` *    | uuidv4  | Unique request identification key used by the client in uuid v4 format | 36 |
| `account_key` *            | uuidv4  | Unique account identification key in uuid v4 format | 36 |
| `requester_profile_status` * | string | Wallet status | **[requester_profile_status Enumerators](#requester_profile_status-enumerators)** |
| `configuration_data` * | object | Wallet default configurations | **[configuration_data Object](#configuration_data-object)** |

### profile_status Enumerators

| Enumerator                       | Description                                                            |
|----------------------------------|----------------------------------------------------------------------|
| pending                          | Wallet accepted and pending confirmation                            |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000001            | Not Found | Person not found with key: {`person_key`}`                                               | Pessoa não encontrada com a chave: {`person_key`}`                                               |
| 404                      | BKS000004            | Not Found | Pix key not found: `{pix_key}`                                               | Chave pix não encontrada: `{pix_key}`                                               |
| 403                      | BKS000005            | Forbidden                         | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 403                      | BKS000010            | Forbidden                                 | The pix key owner does not match the account owner.                                                                                     | O proprietário da chave pix não corresponde ao proprietário da conta.                                                             |
| 409                      | BKS000014            | Conflict           | Request control key already sent or duplicated sent: `{request_control_key}`                                                              | Chave de controle da requisição já utilizada ou enviada duplicada: `{request_control_key}`                                                                        |
| 400                      | BKS000047            | Bad Request             | It was not possible to consult the sent pix key at this time. Please try again in a few minutes.          | Não foi possível consultar a chave pix enviada no momento. Por favor, tente novamente em alguns minutos.                                                           |

---

# Edit wallet

URL: /en/documentation/boletos/carteira/editar_carteira

Wallet editing overrides the default settings (`configuration_data`) of the bill wallet and all its child objects.

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY
METHOD PUT

### Path parameters

| Field                   | Type   | Description                                                  | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key in uuid v4 format         | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key in uuid v4 format          | 36         |

Request Body

```json
{
  "max_payment_days": 1,
  "protest_settings": {
    "days_to_protest": 0
  },
  "bankruptcy_protest_settings": {
    "days_to_bankruptcy_protest": 0
  },
  "write_off_settings": {
    "days_to_write_off": 0
  },
  "fine_settings": {
    "fine_type": "absolute",
    "fine_amount": 10,
    "days_to_fine": 0
  },
  "interest_settings": {
    "interest_type": "workdays_daily_amount",
    "interest_amount": 10,
    "days_to_interest": 0
  },
  "qr_code_settings": {
    "pix_key": "248ebea3-9bdd-44b3-a8b9-7f2bd34cd7bf",
    "qr_code_on_discharge_enabled": false
  },
  "cnab_settings": {
    "default_bank": "qi_scd",
    "preferred_layout": "400"
  }
}
```

### Request Body Params

| Field                      | Type    | Description                                                                        | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|------------|
| `max_payment_days` *      | integer | Maximum calendar days the bill will remain available for payment after due date (can be at most 365) | -          |
| `write_off_settings`       | object  | Default write-off configuration      | **[write_off_settings object](#write_off_settings-object)** |
| `protest_settings`         | object  | Default protest configuration       | **[protest_settings object](#protest_settings-object)** |
| `bankruptcy_protest_settings` | object  | Default bankruptcy protest configuration | **[bankruptcy_protest_settings object](#bankruptcy_protest_settings-object)** |
| `fine_settings`            | object  | Default fine configuration                 | **[fine_settings object](#fine_settings-object)** |
| `interest_settings`        | object  | Default interest configuration        | **[interest_settings object](#interest_settings-object)** |
| `qr_code_settings`         | object  | Default PIX QR Code configuration (for bolePix) | **[qr_code_settings object](#qr_code_settings-object)** |
| `cnab_settings`            | object  | Default CNAB file configuration | **[cnab_settings object](#cnab_settings-object)** |

### write_off_settings object

| Field                     | Type    | Description                                                                 | Characters |
|---------------------------|---------|-----------------------------------------------------------------------------|------------|
| `days_to_write_off` *     | integer | Days after due date for the bill to be automatically written off           | -          |

### protest_settings object
| Field                     | Type    | Description                                                                 | Characters |
|---------------------------|---------|-----------------------------------------------------------------------------|------------|
| `days_to_protest` *       | integer | Days after due date for the bill to be automatically protested             | -          |

### bankruptcy_protest_settings object

| Field                          | Type    | Description                                                                 | Characters  |
|--------------------------------|---------|-----------------------------------------------------------------------------|-------------|
| `days_to_bankruptcy_protest` * | integer | Days after due date for a bankruptcy protest process to be automatically started  | -           |

### fine_settings object

Option 1: absolute value fine (`fine_type=absolute`)

| Field                     | Type    | Description                                               | Characters                |
|---------------------------|---------|---------------------------------------------------------|-------------------------------------------------------------------------|
| `fine_type` *             | string  | Fine type                                                       | **[fine_type enumerators](#fine_type-enumerators)**                                              |
| `fine_amount` *           | float   | Fine absolute value                                             | -                                                                        |
| `days_to_fine` *          | integer | Days after due date for the fine to be charged              | -                                                                        |

Option 2: percentage value fine (`fine_type=percentage`)

| Field                     | Type    | Description                                                 | Characters                             |
|---------------------------|---------|-----------------------------------------------------------|---------------------------------------|
| `fine_type` *             | string  | Fine type                                             | **[fine_type enumerators](#fine_type-enumerators)** |
| `fine_percentage` *       | integer | Fine percentage value, from 1 to 100                     | -                                      |
| `days_to_fine` *          | integer | Days after due date for the fine to be charged    | -                                      |

### fine_type enumerators

| Enumerator         | Description           |
|--------------------|-----------------------|
| absolute           | absolute value        |
| percentage         | percentage value      |

### interest_settings object

Option 1: interest using absolute values (`interest_type=calendar_days_daily_amount` or `interest_type=workdays_daily_amount`)

| Field                     | Type    | Description                                                                     | Characters                                                                                      |
|---------------------------|---------|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| `interest_type` *         | string  | Interest type       | **[interest_type enumerators](#interest_type-enumerators)** |
| `interest_amount` *       | float   | Amount to be charged per determined time unit (business days or calendar days) | -                                                                                               |
| `days_to_interest` *      | integer | Days after due date to start charging interest                    | -                                                                                               |

Option 2: interest using percentage values (`interest_type=calendar_days_monthly_percentage`)

| Field                    | Type    | Description                                                                             | Characters                                                                                          |
|--------------------------|---------|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| `interest_type` *        | string  | Interest type       | **[interest_type enumerators](#interest_type-enumerators)** |
| `interest_percentage` *  | integer | Percentage to be charged per determined time unit (business days or calendar days)                                                                      | -                                                                           |
| `days_to_interest` *     | integer | Days after due date to start charging interest                             | -                                                                                                   |

### interest_type enumerators

| Enumerator                       | Description                                                      |
|----------------------------------|------------------------------------------------------------------|
| calendar_days_daily_amount       | Daily amount on calendar days                                    |
| workdays_daily_amount            | Daily amount on business days                                    |
| calendar_days_monthly_percentage | Monthly interest percentage charged based on calendar days      |

### qr_code_settings object

| Field                            | Type    | Description                                                                 | Characters  |
|----------------------------------|---------|-----------------------------------------------------------------------------|-------------|
| `pix_key` *                      | uuidv4  | Random type Pix key                                                         | 36          |
| `qr_code_on_discharge_enabled` * | boolean | Determines if QR Code information will appear in the return file (CNAB)    | -           |

:::info Information
The PIX copy and paste will be returned in the CNAB file at positions 029 to 105.
:::

:::caution Attention!
If the `qr_code_settings` object is sent in the request, this wallet will have bolePix generation as its default configuration . BolePix are bills whose payment is linked to a Pix QR Code. Therefore, the payer can make bill payments both using the bill's digital lines and by reading the linked Pix QR Codes. If payment is made via QR Code, financial settlement occurs instantly. Regarding notifications, two webhooks are sent: one at the time of the PIX transfer (payment notice, bill goes to `payment_notice` status); and another a few seconds or minutes later, after confirmation of discharge at CIP/Nuclea (paid, bill goes to `paid` status).
:::

### cnab_settings object

| Field                            | Type    | Description                                                                 | Characters  |
|----------------------------------|---------|-----------------------------------------------------------------------------|-------------|
| `default_bank`                   | string  | Default bank layout for CNAB file processing                            | **[default_bank enumerators](#default_bank-enumerators)** |
| `preferred_layout`               | string  | Preferred layout for CNAB files                                         | **[preferred_layout enumerators](#preferred_layout-enumerators)** |

### default_bank enumerators

| Enumerator         | Description           |
|--------------------|-----------------------|
| santander          | Banco Santander       |
| itau               | Banco Itaú            |
| bradesco           | Banco Bradesco        |
| qi_scd             | QI SCD                |

### preferred_layout enumerators

| Enumerator         | Description           |
|--------------------|-----------------------|
| 400                | CNAB 400 Layout       |
| 240                | CNAB 240 Layout       |

## Response

STATUS 200

Response Body

```json
{
  "requester_profile_key": "c92e8666-e310-4a72-b15e-753525684ae2",
  "requester_profile_code": "329-48-2628-2625918",
  "request_control_key": "727a5f00-1f86-4a7a-9aa5-c45cf8a2394c",
  "account_key": "e0089187-ab08-42c0-82f2-259d40726117",
  "requester_profile_status": "pending",
  "configuration_data": {
    "max_payment_days": 1,
    "protest_settings": {
      "days_to_protest": 0
    },
    "bankruptcy_protest_settings": {
      "days_to_bankruptcy_protest": 0
    },
    "write_off_settings": {
      "days_to_write_off": 0
    },
    "fine_settings": {
      "fine_type": "absolute",
      "fine_amount": 10,
      "days_to_fine": 0
    },
    "interest_settings": {
      "interest_type": "workdays_daily_amount",
      "interest_amount": 10,
      "days_to_interest": 0
    },
    "qr_code_settings": {
      "pix_key": "248ebea3-9bdd-44b3-a8b9-7f2bd34cd7bf",
      "qr_code_on_discharge_enabled": false
    },
    "cnab_settings": {
      "default_bank": "qi_scd",
      "preferred_layout": "400"
    }
  }
}
```

### Response Body Params

| Field                      | Type    | Description                                                                        | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------------------|
| `requester_profile_key` *  | uuidv4  | Unique wallet identification key in uuid v4 format  | 36      |
| `requester_profile_code` * | string  | Unique wallet identification code                    | 19      |
| `request_control_key` *    | uuidv4  | Unique request identification key used by the client in uuid v4 format | 36 |
| `account_key` *            | uuidv4  | Unique account identification key in uuid v4 format | 36 |
| `requester_profile_status` * | string | Wallet status | **[requester_profile_status enumerators](#requester_profile_status-enumerators)** |
| `configuration_data` * | object | Default wallet configurations | **[configuration_data object](#configuration_data-object)** |

### profile_status enumerators

| Enumerator                       | Description                                                      |
|----------------------------------|------------------------------------------------------------------|
| pending                          | Wallet accepted and pending confirmation                         |
| opened                           | Wallet opened                                                    |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Status<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000001            | Not Found | Person not found with key: {`person_key`}`                                               | Pessoa não encontrada com a chave: {`person_key`}`                                               |
| 404                      | BKS000004            | Not Found | Pix key not found: `{pix_key}`                                               | Chave pix não encontrada: `{pix_key}`                                               |
| 403                      | BKS000005            | Forbidden                         | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 403                      | BKS000010            | Forbidden                                 | The pix key owner does not match the account owner.                                                                                     | O proprietário da chave pix não corresponde ao proprietário da conta.                                                             |
| 409                      | BKS000014            | Conflict           | Request control key already sent or duplicated sent: `{request_control_key}`                                                              | Chave de controle da requisição já utilizada ou enviada duplicada: `{request_control_key}`                                                                        |
| 400                      | BKS000047            | Bad Request             | It was not possible to consult the sent pix key at this time. Please try again in a few minutes.          | Não foi possível consultar a chave pix enviada no momento. Por favor, tente novamente em alguns minutos.                                                           |

---

# List Account Wallets

URL: /en/documentation/boletos/carteira/listar_carteiras

The wallet listing will return all bank slip wallets for the account that match the query parameters sent in the request.

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profiles
METHOD GET

### Path parameters

| Field                   | Type   | Description                                                  | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format        | 36         |

### Query parameters

| Field                    | Type   | Description                                                                 | Characters |
|--------------------------|--------|---------------------------------------------------------------------------|------------|
| `request_control_key`    | uuidv4 | Unique request identification key, in uuid v4 format                      | 36         |
| `requester_profile_key`  | uuidv4 | Unique bank slip wallet identification key, in uuid v4 format             | 36         |
| `requester_profile_code` | string | Unique wallet identification code                                         | 19         |
| `page`                   | integer| Page number                                                               | -          |
| `page_size`              | integer| Page size                                                                 | -          |

## Response

STATUS 200

Response Body

```json
{
  "data": [
    {
      "requester_profile_key": "fd86d9b1-2a5e-4e03-9a59-a043c7632c97",
      "requester_profile_code": "329-04-2338-2625918",
      "request_control_key": "0868a24b-4a69-4138-ac4d-ecaeddf0005f",
      "account_key": "0494902f-b21c-4ae6-b37e-854cfe883402",
      "requester_profile_status": "pending",
      "configuration_data": {
        "max_payment_days": 1,
        "protest_settings": {
          "days_to_protest": 0
        },
        "bankruptcy_protest_settings": {
          "days_to_bankruptcy_protest": 0
        },
        "write_off_settings": {
          "days_to_write_off": 0
        },
        "fine_settings": {
          "fine_type": "absolute",
          "fine_amount": 10,
          "days_to_fine": 0
        },
        "interest_settings": {
          "interest_type": "workdays_daily_amount",
          "interest_amount": 10,
          "days_to_interest": 0
        },
        "qr_code_settings": {
          "pix_key": "5df7a433-bd61-4f98-9515-df9aedc2980c",
          "qr_code_on_discharge_enabled": false
        },
        "cnab_settings": {
          "default_bank": "qi_scd",
          "preferred_layout": "400"
        }
      }
    }
  ],
  "pagination": {
    "current_page": 1,
    "rows_per_page": 100
  }
}
```

### Response Body Parameters

| Field          | Type         | Description                       | Characters                                                |
|----------------|--------------|-----------------------------------|-----------------------------------------------------------|
| `data` *       | object array | Bank slip wallets                 | **[requester_profile Object](#requester_profile-object)** |
| `pagination` * | object       | Pagination information            | **[pagination Object](#pagination-object)**               |

### requester_profile Object

| Field                      | Type    | Description                                                                        | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------------------|
| `requester_profile_key` *  | uuidv4  | Unique wallet identification key in uuid v4 format                               | 36      |
| `requester_profile_code` * | string  | Unique wallet identification code                                                 | 19      |
| `request_control_key` *    | uuidv4  | Unique request identification key used by the client in uuid v4 format           | 36 |
| `account_key` *            | uuidv4  | Unique account identification key in uuid v4 format                              | 36 |
| `requester_profile_status` * | string | Wallet status                                                                    | **[requester_profile_status Enumerators](#requester_profile_status-enumerators)** |
| `configuration_data` * | object | Wallet default settings                                                           | **[configuration_data Object](#configuration_data-object)** |

### requester_profile_status Enumerators

| Enumerator                       | Description                                                      |
|----------------------------------|------------------------------------------------------------------|
| pending                          | Accepted wallet pending confirmation                             |
| opened                           | Open wallet                                                      |

### pagination Object

| Field                      | Type    | Description                                                  | Characters |
|----------------------------|---------|--------------------------------------------------------------|------------|
| `current_page` *           | integer | Current page                                                 | -          |
| `rows_per_page` *          | integer | Items per page                                               | -          |

### configuration_data Object

| Field                      | Type    | Description                                                                        | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|------------|
| `max_payment_days` *      | integer | Maximum calendar days the bank slip will be available for payment after due date (maximum 365) | -          |
| `write_off_settings`       | object  | Default write-off configuration                                                    | **[write_off_settings Object](#write_off_settings-object)** |
| `protest_settings`         | object  | Default protest configuration                                                      | **[protest_settings Object](#protest_settings-object)** |
| `bankruptcy_protest_settings` | object  | Default bankruptcy protest configuration                                        | **[bankruptcy_protest_settings Object](#bankruptcy_protest_settings-object)** |
| `fine_settings`            | object  | Default fine configuration                                                         | **[fine_setings Object](#fine_settings-object)** |
| `interest_settings`        | object  | Default interest configuration                                                     | **[interest_settings Object](#interest_settings-object)** |
| `qr_code_settings`         | object  | Default PIX QR Code configuration (for bolePix)                                   | **[qr_code_settings Object](#qr_code_settings-object)** |
| `cnab_settings`            | object  | Default CNAB file configuration                                                    | **[cnab_settings Object](#cnab_settings-object)** |

### write_off_settings Object

| Field                     | Type    | Description                                                                 | Characters |
|---------------------------|---------|-----------------------------------------------------------------------------|------------|
| `days_to_write_off` *     | integer | Days after due date for the bank slip to be automatically written off     | -          |

### protest_settings Object
| Field                     | Type    | Description                                                                 | Characters |
|---------------------------|---------|-----------------------------------------------------------------------------|------------|
| `days_to_protest` *       | integer | Days after due date for the bank slip to be automatically protested       | -          |

### bankruptcy_protest_settings Object

| Field                          | Type    | Description                                                                 | Characters  |
|--------------------------------|---------|-----------------------------------------------------------------------------|-------------|
| `days_to_bankruptcy_protest` * | integer | Days after due date to automatically start a bankruptcy protest process    | -           |

### fine_settings Object

Option 1: absolute value fine (`fine_type=absolute`)

| Field                     | Type    | Description                                             | Characters                |
|---------------------------|---------|---------------------------------------------------------|-------------------------------------------------------------------------|
| `fine_type` *             | string  | Fine type                                                                   | **[fine_type Enumerators](#fine_type-enumerators)**                                              |
| `fine_amount` *           | float   | Absolute value of the fine                                                  | -                                                                        |
| `days_to_fine` *          | integer | Days after due date for the fine to be charged                             | -                                                                        |

Option 2: percentage value fine (`fine_type=percentage`)

| Field                     | Type    | Description                                               | Characters                             |
|---------------------------|---------|-----------------------------------------------------------|---------------------------------------|
| `fine_type` *             | string  | Fine type                                                 | **[fine_type Enumerators](#fine_type-enumerators)** |
| `fine_percentage` *       | integer | Percentage value of the fine, from 1 to 100             | -                                      |
| `days_to_fine` *          | integer | Days after due date for the fine to be charged          | -                                      |

### fine_type Enumerators

| Enumerator         | Description           |
|--------------------|-----------------------|
| absolute           | absolute value        |
| percentage         | percentage value      |

### interest_settings Object

Option 1: interest using absolute values (`interest_type=calendar_days_daily_amount` or `interest_type=workdays_daily_amount`)

| Field                     | Type    | Description                                                                     | Characters                                                                                      |
|---------------------------|---------|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| `interest_type` *         | string  | Interest type                                                                       | **[interest_type Enumerators](#interest_type-enumerators)** |
| `interest_amount` *       | float   | Amount to be charged per time unit (business or calendar days)                     | -                                                                                               |
| `days_to_interest` *      | integer | Days after due date to start charging interest                                     | -                                                                                               |

Option 2: interest using percentage values (`interest_type=calendar_days_monthly_percentage`)

| Field                    | Type    | Description                                                                             | Characters                                                                                          |
|--------------------------|---------|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| `interest_type` *        | string  | Interest type                                                                           | **[interest_type Enumerators](#interest_type-enumerators)** |
| `interest_percentage` *  | integer | Percentage to be charged per time unit (business or calendar days)                     | -                                                                           |
| `days_to_interest` *     | integer | Days after due date to start charging interest                                         | -                                                                                                   |

### interest_type Enumerators

| Enumerator                       | Description                                                      |
|----------------------------------|------------------------------------------------------------------|
| calendar_days_daily_amount       | Daily amount over calendar days                                  |
| workdays_daily_amount            | Daily amount over business days                                  |
| calendar_days_monthly_percentage | Monthly interest percentage charged based on calendar days      |

### qr_code_settings Object

| Field                            | Type    | Description                                                                 | Characters  |
|----------------------------------|---------|-----------------------------------------------------------------------------|-------------|
| `pix_key` *                      | uuidv4  | Random type PIX key                                                         | 36          |
| `qr_code_on_discharge_enabled` * | boolean | Determines if QR Code information will appear in the return file (CNAB)    | -           |

### cnab_settings Object

| Field                            | Type    | Description                                                                 | Characters  |
|----------------------------------|---------|-----------------------------------------------------------------------------|-------------|
| `default_bank`                   | string  | Default bank layout for CNAB file processing                               | **[default_bank Enumerators](#default_bank-enumerators)** |
| `preferred_layout`               | string  | Preferred layout for CNAB files                                            | **[preferred_layout Enumerators](#preferred_layout-enumerators)** |

### default_bank Enumerators

| Enumerator         | Description           |
|--------------------|-----------------------|
| santander          | Santander Bank        |
| itau               | Itaú Bank             |
| bradesco           | Bradesco Bank         |
| qi_scd             | QI SCD                |

### preferred_layout Enumerators

| Enumerator         | Description           |
|--------------------|-----------------------|
| 400                | CNAB 400 Layout       |
| 240                | CNAB 240 Layout       |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (ptbr)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 400                      | BKS000012            | Bad Request | Invalid integer value for page or size query string parameters. | Valor inválido para parâmetros de página ou tamanho de página. |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 400                      | BKS000025            | Bad Request | Invalid bank slip status.      | Status de boleto inválido.                          |

---

# Query temporary file

URL: /en/documentation/boletos/cnab/consulta_por_chave

Querying a temporary CNAB file using its key returns detailed information about it, such as the number of occurrences that have already been processed and possible errors found in the file.

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /temporary_cnab_file/ TEMPORARY_CNAB_FILE_KEY
METHOD GET

### Path parameters

| Field                   | Type   | Description                                                    | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key in uuid v4 format    | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key in uuid v4 format | 36         |
| `temporary_cnab_file_key` | uuidv4 | Unique temporary CNAB file identification key in uuid v4 format | 36         |

## Response

STATUS 200

Response Body: Accepted file (no errors)

```json
{
  "temporary_cnab_file_key": "fa4f094d-8475-4828-9105-99756914e14f",
  "temporary_cnab_file_name": "240827463_t.REM",
  "temporary_cnab_file_status": "read",
  "occurrence_quantity": 6,
  "total_processed_occurrences": 6,
  "created_at": "2024-08-28T15:09:30Z"
}
```

Response Body: Rejected file (with errors)

```json
{
  "temporary_cnab_file_key": "c16baa13-0969-46a7-a85f-6f975d266d9f",
  "temporary_cnab_file_name": "240905623.REM",
  "temporary_cnab_file_status": "rejected",
  "occurrence_quantity": 0,
  "total_processed_occurrences": 0,
  "created_at": "2024-09-10T15:59:25Z",
  "error_data": [
    {
      "code": "BKS000063",
      "title": "Bad Request",
      "description": "Invalid file code.",
      "translation": "Codigo de arquivo invalido.",
      "extra_fields": {
        "details": "Invalid file code. Expected: '1'. Got: '0'.",
        "file_line": 1,
        "details_pt_br": "Código de arquivo inválido. Esperado: '1'. Recebido: '0'.",
        "cnab_file_name": "240905623.REM",
        "cnab_inline_end_position": 2,
        "cnab_inline_start_position": 2
      }
    },
    {
      "code": "BKS000069",
      "title": "Bad Request",
      "description": "Invalid beneficiary account: beneficiary account is not the one that the requester profiles belongs to.",
      "translation": "Conta do beneficiario invalida: a conta do beneficiario nao e aquela a qual a carteira de boletos pertence.",
      "extra_fields": {
        "details": "Invalid beneficiary account header on header. Expected: '1927400'. Got: '3;53179'.",
        "file_line": 1,
        "details_pt_br": "Conta do beneficiário inválida no header. Esperado: '1927400'. Recebido: '3;53179'.",
        "cnab_file_name": "240905623.REM",
        "cnab_inline_end_position": 46,
        "cnab_inline_start_position": 40
      }
    },
    {
      "code": "BKS000064",
      "title": "Bad Request",
      "description": "Invalid bank code (014).",
      "translation": "Codigo do banco invalido (014).",
      "extra_fields": {
        "details": "Invalid bank code. Expected: '329'. Got: '014'",
        "bank_code": "014",
        "details_pt_br": "Código do banco inválido. Esperado: '329'. Recebido: '014'",
        "cnab_file_name": "240905623.REM"
      }
    },
    {
      "code": "BKS000056",
      "title": "Bad Request",
      "description": "Invalid record sequence.",
      "translation": "Sequencia invalida de registros.",
      "extra_fields": {
        "cnab_line": 1,
        "cnab_file_name": "240905623.REM"
      }
    },
    {
      "code": "BKS000056",
      "title": "Bad Request",
      "description": "Invalid record sequence.",
      "translation": "Sequencia invalida de registros.",
      "extra_fields": {
        "cnab_line": 2,
        "cnab_file_name": "240905623.REM"
      }
    },
    {
      "code": "BKS000086",
      "title": "Bad Request",
      "description": "File missing trailler record.",
      "translation": "Arquivo sem registro trailler.",
      "extra_fields": {
        "file_line": 3,
        "cnab_file_name": "240905623.REM"
      }
    }
  ]
}
```

### Response Body Params

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------|
| `temporary_cnab_file_key` *| uuidv4  | Unique temporary CNAB file identification key in uuid v4 format         | 36                                                |
| `temporary_cnab_file_name` *| uuidv4  | File name                                                                   | 100                                               |
| `temporary_cnab_file_status` *| string | Temporary CNAB file status | **[temporary_cnab_file_status Enumerators](#enumeradores-temporary_cnab_file_status)** |
| `occurrence_quantity` *        | integer  | Number of occurrences in the file                                          | -                                                 |
| `total_processed_occurrences` *| integer  | Number of occurrences already processed                                      | -                                                 |
| `error_data`                   | object array | Error objects found in the file, in JSON format, following the same pattern returned by the APIs | **[error_data Object](#objeto-error_data)**                                                |
| `created_at` *                 | string   | Timestamp of when the file was created in the database, in ISO Zulu format | 20                                         |

### Enumeradores temporary_cnab_file_status

| Enumerator                   | Description                                                                    |
|------------------------------|------------------------------------------------------------------------------|
| uploaded                     | upload successful, but file has not yet started being processed     |
| processing                   | file being read                                                           |
| read                         | file read and accepted                                                        |
| rejected                     | file read and rejected due to syntactic error                                  |

### Objeto error_data

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------|
| `code` *         | string  | Error code         | 9                                                |
| `title` *        | string  | Error title                                                                   | 100                                               |
| `description` *  | string  | Error description in English | 100 |
| `translation` *  | integer | Translation of error description                                          | 100                                               |
| `extra_fields`                 | object   | Additional information about the error | -                                         |

:::danger Important
The fields returned in the `extra_fields` object serve to provide additional information about the error and may vary. Therefore, they should not be mapped in a restrictive manner.
:::

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (ptbr)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 404                      | BKS000054            | Not Found | Remittance not found with key: `{temporary_cnab_file_key}`        |               Remessa não encontrada com a chave: `{temporary_cnab_file_key}`                                                                 |

---

# Remittance files (CNAB) - Introduction

URL: /en/documentation/boletos/cnab/introducao

:::info
The file transmitted in this call must follow the QI Tech Collection File Layout standard with 400 positions.
Here is the link to download the manual: [Layout de Cobrança - QI Tech versão 2.1.](https://storage.googleapis.com/live-doc-api/public_samples/Layout%20de%20Cobran%C3%A7a%20-%20QI%20Tech%20v2.1.pdf)
:::

Remittance files (CNAB) offer the possibility to send multiple boleto record instructions, along with other types of instructions (extension, discount, cancellation, etc.), for different boletos, in a single file. When sending instructions such as those mentioned (extension, discount, etc.) for existing boletos, the boleto is identified by the portfolio code (`requester_profile_code`) and by our number (`our_number`).

When uploading a CNAB file, if the request is successful (response code `202`), a temporary CNAB file (`TemporaryCNABFile`) will be created. It is possible to check the file processing status --- as well as possible errors, both in the file itself and in its occurrences ---, using the endpoints for [**temporary CNAB file query**](/documentation/boletos/cnab/consulta_por_chave) and [**its occurrences**](/documentation/boletos/cnab/listar_ocorrencias_temporarias).

The file will be rejected if any syntactic error is found. However, it is read entirely, or until a limit of 100 errors is reached, so that all errors can be returned and corrected in a more practical and efficient manner.

While the file is being read, temporary occurrences are created, which will only be processed if it is accepted. That is, if the file is rejected (status `rejected`), all its occurrences will also be . Furthermore, if the file is rejected, no more temporary occurrences are created for it. Therefore, it is common for rejected file entries to have fewer occurrences than the number of occurrences sent in the file.

On the other hand, when the file is completely read and accepted (status `read`), the creation of definitive occurrences begins, which will be the instructions that will actually take effect. If a temporary occurrence shows the status `rejected`, it means that some semantic error was found in it --- that is, some error in its content. In this case, there will be an `error_data` object along with it, which provides details about the reason for rejection. In contrast, if it shows the status `processed`, it means that the definitive occurrence has already been created and sent to CIP/Nuclea. More details about each of these entities are provided in the subsequent pages for querying files and temporary occurrences.

:::tip Credit Split via CNAB
To inform [**credit split**](/documentation/boletos/instrucoes/rateio_de_credito) (split payment) in CNAB files:

- **QI SCD (CNAB400 - QI Tech v2.1 layout):** detail record with `identificacao_registro = 3`. Full details in the **[Layout de Cobrança - QI Tech v2.1](https://storage.googleapis.com/live-doc-api/public_samples/Layout%20de%20Cobran%C3%A7a%20-%20QI%20Tech%20v2.1.pdf)**.
- **Bradesco (CNAB400 and CNAB240):** detail record type `3`.
- **Itaú (CNAB400 and CNAB240):** detail record type `4`.
- **Santander:** does not support credit split via CNAB. Use the REST endpoint [**Credit Split Update**](/documentation/boletos/instrucoes/rateio_de_credito) or include `split_payment_data` in the issuance via API.

**How to map N recipients:** Each split record fits up to **3 additional accounts** (account number + check digit + percentage). For more than 3 recipients, add **multiple split records in sequence** after the bank slip's main record — they are accumulated in the same occurrence. Example: 7 accounts = 3 records (3 + 3 + 1).

**Restrictions (all banks):**
- Only **percentage**-based calculation is supported (`calculation code = 2`).
- The sum of percentages (beneficiary + splits) must be exactly **100**.
- Total recipient limit follows the same as the REST API (up to 10 additional accounts).
- The `beneficiary_max_amount` field (split with maximum beneficiary amount and surplus directed to the first rule) is **REST API exclusive**. It is not supported via CNAB. For this scenario, use the REST endpoint for [**issuance**](/documentation/boletos/emissao/emissao_boleto_unico_padrao) or for [**credit split update**](/documentation/boletos/instrucoes/rateio_de_credito).
:::

---

# List temporary remittance files

URL: /en/documentation/boletos/cnab/listar_arquivos_temporarios

The listing of temporary CNAB files will return all temporary CNAB files from the wallet that match the query parameters sent in the request.

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /temporary_cnab_file
METHOD GET

### Path parameters

| Field                   | Type   | Description                                                  | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format        | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key, in uuid v4 format         | 36         |

### Query parameters

| Field                   | Type   | Description                                                  | Characters              |
|-------------------------|--------|--------------------------------------------------------------|-------------------------|
| `temporary_cnab_file_status` | string | Status of the temporary CNAB file | **[temporary_cnab_file_status enumerators](#temporary_cnab_file_status-enumerators)** |
| `page`                  | integer| Page number                                                  | -                       |
| `page_size`             | integer| Page size                                                    | -                       |

### temporary_cnab_file_status enumerators

| Enumerator               | Description                                                                      |
|------------------------------|------------------------------------------------------------------------------|
| uploaded                     | upload completed successfully, but file processing has not started yet         |
| processing                   | file being read                                                              |
| read                         | file read and accepted                                                       |
| rejected                     | file read and rejected due to syntactic error                               |

## Response

STATUS 200

Response Body

```json
{
  "data": [
    {
      "temporary_cnab_file_key": "a6db5f8b-1ed7-4d13-9cbf-f3c4275e3ca3",
      "temporary_cnab_file_name": "240903573.REM",
      "temporary_cnab_file_status": "processing",
      "occurrence_quantity": null,
      "created_at": "2024-09-07T15:44:01Z"
    },
    {
      "temporary_cnab_file_key": "2351c4ae-9a01-4675-86e4-099a30dafa42",
      "temporary_cnab_file_name": "240904603.REM",
      "temporary_cnab_file_status": "rejected",
      "occurrence_quantity": 0,
      "created_at": "2024-09-06T12:35:50Z"
    },
    {
      "temporary_cnab_file_key": "fa4f094d-8475-4828-9105-99756914e14f",
      "temporary_cnab_file_name": "240827463_t.REM",
      "temporary_cnab_file_status": "read",
      "occurrence_quantity": 10424,
      "created_at": "2024-08-28T15:09:30Z"
    },
    {
      "temporary_cnab_file_key": "e99cea6d-0d1c-4ec3-a2c6-bc603aede7c6",
      "temporary_cnab_file_name": "240827443_t.REM",
      "temporary_cnab_file_status": "read",
      "occurrence_quantity": 542,
      "created_at": "2024-08-27T20:07:11Z"
    },
    {
      "temporary_cnab_file_key": "2351c4ae-9a01-4675-86e4-099a30dafa42",
      "temporary_cnab_file_name": "240812604.REM",
      "temporary_cnab_file_status": "rejected",
      "occurrence_quantity": 0,
      "created_at": "2024-08-12T12:52:13Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "rows_per_page": 100
  }
}
```

### Response Body Params

| Field            | Type         | Description                           | Characters                                  |
|------------------|--------------|---------------------------------------|---------------------------------------------|
| `data` *         | object array | Temporary CNAB files                  | **[temporary_cnab_file object](#temporary_cnab_file-object)**   |
| `pagination` *   | object       | Pagination information                | **[pagination object](#pagination-object)** |

### temporary_cnab_file object

| Field                      | Type    | Description                                                                        | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------|
| `temporary_cnab_file_key` *| uuidv4  | Unique identification key for the temporary CNAB file in uuid v4 format           | 36                                                |
| `temporary_cnab_file_name` *| uuidv4  | File name                                                                         | 100                                               |
| `temporary_cnab_file_status` *| string | Status of the temporary CNAB file | **[temporary_cnab_file_status enumerators](#temporary_cnab_file_status-enumerators)** |
| `occurrence_quantity` *        | integer  | Number of occurrences in the file                                                | -                                                 |
| `created_at` *                 | string   | Timestamp of file creation time in the database, in ISO Zulu format              | 20                                         |

### pagination object

| Field                      | Type    | Description                                                                        | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------------------|
| `current_page` *           | integer | Current page                                                                      | -      |
| `rows_per_page` *          | integer | Items per page                                                                    | -      |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 403                      | BKS000005            | Forbidden                         | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 400                      | BKS000012            | Bad Request | Invalid integer value for page or size query string parameters. | Valor inválido para parâmetros de página ou tamanho de página. |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |

---

# List temporary occurrences

URL: /en/documentation/boletos/cnab/listar_ocorrencias_temporarias

The listing of temporary occurrences will return all temporary occurrences from a given CNAB file.

:::info
When a CNAB file is rejected due to syntactic error, temporary occurrences related to it are no longer created, since they would all be rejected because the file was rejected. Therefore, when the file is rejected, it is possible that the number of temporary occurrences related to the file is less than the number of occurrences sent in it.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /temporary_cnab_file / TEMPORARY_CNAB_FILE_KEY /occurrences
METHOD GET

### Path parameters

| Field                   | Type   | Description                                                    | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format    | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key, in uuid v4 format | 36         |

### Query parameters

| Field                   | Type   | Description                                                    | Characters              |
|-------------------------|--------|--------------------------------------------------------------|-------------------------|
| `occurrence_status`     | string | Temporary occurrence status                              | **[occurrence_status enumerators](#enumeradores-temporary_cnab_file_status)** |
| `occurrence_type`       | string | Temporary occurrence type                                | **[occurrence_type enumerators](#enumeradores-temporary_cnab_file_type)** |
| `page`                  | integer| Page number                                             | -                       |
| `page_size`             | integer| Page size                                            | -                       |

### occurrence_status enumerators

| Enumerator                   | Description                                                                    |
|------------------------------|------------------------------------------------------------------------------|
| pending                      | occurrence has not been processed yet                                          |
| processed                    | occurrence processed successfully                                            |
| rejected                     | occurrence processed and rejected due to semantic error                         |

### occurrence_type enumerators

| Enumerator                           | Description                                                                    |
|--------------------------------------|------------------------------------------------------------------------------|
| registration                         | bank slip registration                                                           |
| write_off                            | bank slip write-off                                                              |
| rebate                               | bank slip amount rebate                                                |
| cancel_rebate                        | rebate cancellation                                                   |
| extension                            | payment date extension                                             |
| protest_request                      | protest request                                                           |
| bankruptcy_protest_request           | bankruptcy protest request                                                |
| protest_cancel_and_write_off_request | protest request cancellation and bank slip write-off                         |
| protest_cancel_request               | protest request cancellation                                           |
| bank_slip_edit                       | edit other bank slip data                                             |

## Response

STATUS 200

Response Body

```json
{
    "data": [
        {
            "occurrence_key": "191f2220-1465-47d7-8c81-67d8f59f5af2",
            "occurrence_status": "rejected",
            "occurrence_type": "registration",
            "occurrence_our_number": 12455,
            "error_data": {
                "code": "BKS000069",
                "title": "Bad Request",
                "description": "Invalid beneficiary account: beneficiary account is not the one that the requester profiles belongs to.",
                "translation": "Conta do beneficiario invalida: a conta do beneficiario nao e aquela a qual a carteira de boletos pertence.",
                "extra_fields": {
                    "account_digit": "4",
                    "account_branch": "0001",
                    "account_number": "1927400"
                }
            }
        },
        {
            "occurrence_key": "adc0ce54-9e69-45ec-9220-fbfe0e3ba103",
            "occurrence_status": "rejected",
            "occurrence_type": "registration",
            "occurrence_our_number": 12453,
            "error_data": {
                "code": "BKS000069",
                "title": "Bad Request",
                "description": "Invalid beneficiary account: beneficiary account is not the one that the requester profiles belongs to.",
                "translation": "Conta do beneficiario invalida: a conta do beneficiario nao e aquela a qual a carteira de boletos pertence.",
                "extra_fields": {
                    "account_digit": "4",
                    "account_branch": "0001",
                    "account_number": "1927400"
                }
            }
        },
        {
            "occurrence_key": "0521c4db-b243-4599-af2f-c288a299948a",
            "occurrence_status": "rejected",
            "occurrence_type": "registration",
            "occurrence_our_number": 12452,
            "error_data": {
                "code": "BKS000069",
                "title": "Bad Request",
                "description": "Invalid beneficiary account: beneficiary account is not the one that the requester profiles belongs to.",
                "translation": "Conta do beneficiario invalida: a conta do beneficiario nao e aquela a qual a carteira de boletos pertence.",
                "extra_fields": {
                    "account_digit": "4",
                    "account_branch": "0001",
                    "account_number": "1927400"
                }
            }
        },
        {
            "occurrence_key": "f0875275-dea0-4e93-a665-a24e921d0a95",
            "occurrence_status": "rejected",
            "occurrence_type": "registration",
            "occurrence_our_number": 12451,
            "error_data": {
                "code": "BKS000069",
                "title": "Bad Request",
                "description": "Invalid beneficiary account: beneficiary account is not the one that the requester profiles belongs to.",
                "translation": "Conta do beneficiario invalida: a conta do beneficiario nao e aquela a qual a carteira de boletos pertence.",
                "extra_fields": {
                    "account_digit": "4",
                    "account_branch": "0001",
                    "account_number": "1927400"
                }
            }
        },
        {
            "occurrence_key": "98ac54d9-0b3c-45a6-86e1-4b79d25f6364",
            "occurrence_status": "rejected",
            "occurrence_type": "registration",
            "occurrence_our_number": 12450,
            "error_data": {
                "code": "BKS000069",
                "title": "Bad Request",
                "description": "Invalid beneficiary account: beneficiary account is not the one that the requester profiles belongs to.",
                "translation": "Conta do beneficiario invalida: a conta do beneficiario nao e aquela a qual a carteira de boletos pertence.",
                "extra_fields": {
                    "account_digit": "4",
                    "account_branch": "0001",
                    "account_number": "1927400"
                }
            }
        },
        {
            "occurrence_key": "dd2c8d76-d663-4dbb-9c8b-84a627156147",
            "occurrence_status": "rejected",
            "occurrence_type": "registration",
            "occurrence_our_number": 12449,
            "error_data": {
                "code": "BKS000069",
                "title": "Bad Request",
                "description": "Invalid beneficiary account: beneficiary account is not the one that the requester profiles belongs to.",
                "translation": "Conta do beneficiario invalida: a conta do beneficiario nao e aquela a qual a carteira de boletos pertence.",
                "extra_fields": {
                    "account_digit": "4",
                    "account_branch": "0001",
                    "account_number": "1927400"
                }
            }
        }
    ],
    "pagination": {
        "current_page": 1,
        "rows_per_page": 100
    }
}
```

### Response Body Params

| Field            | Type         | Description                             | Characters                                  |
|------------------|--------------|---------------------------------------|---------------------------------------------|
| `data` *         | object array | Temporary occurrences               | **[temporary_occurrence object](#objeto-temporary_occurrence)**   |
| `pagination` *   | object       | Pagination information              | **[pagination object](#objeto-pagination)** |

### temporary_cnab_file object

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------|
| `occurrence_key` *| uuidv4  | Unique temporary occurrence identification key in uuid v4 format         | 36                                                |
| `occurrence_status` * | string  | Temporary occurrence status                                                                   | **[temporary_occurrence_status enumerators](#enumeradores-temporary_occurrence_status)** |
| `occurrence_type` *   | string  | Temporary occurrence type | **[occurrence_type enumerators](#enumeradores-occurrence_type)** |
| `occurrence_our_number` *       | integer  | Number of occurrences in the file                                          | -                                                 |
| `error_data`                   | object | Error objects found in the file, in JSON format, in the same pattern returned by the APIs | **[error_data object](#objeto-error_data)**                                                |

### pagination object

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------------------|
| `current_page` *           | integer | Current page                                                 | -      |
| `rows_per_page` *          | integer | Items per page                                             | -      |

### error_data object

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------|
| `code` *         | string  | Error code         | 9                                                |
| `title` *        | string  | Error title                                                                   | 100                                               |
| `description` *  | string  | Error description, in English | 100 |
| `translation` *  | integer | Error description translation                                          | 100                                               |
| `extra_fields`                 | object   | Additional information about the error | -                                         |

:::danger Important
The fields returned in the `extra_fields` object serve to provide additional information about the error and may vary. Therefore, they should not be mapped in a restrictive manner.
:::

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 403                      | BKS000005            | Forbidden                         | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 400                      | BKS000012            | Bad Request | Invalid integer value for page or size query string parameters. | Valor inválido para parâmetros de página ou tamanho de página. |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 404                      | BKS000054            | Not Found | Remittance not found with key: `{temporary_cnab_file_key}`        |               Remessa não encontrada com a chave: `{temporary_cnab_file_key}`                                                                 |

---

# Upload CNAB file

URL: /en/documentation/boletos/cnab/upload_de_arquivo_remessa

:::caution Attention!
The call must be authenticated following the standard described in the [**Document upload**](/documentation/upload_de_documentos) section.
:::

CNAB files offer the possibility of sending multiple boleto record instructions, along with other types of instructions (extension, discount, cancellation, etc.), for different boletos, in a single file. When sending instructions like those mentioned (extension, discount, etc.) for existing boletos, the boleto is identified by the requester profile code (`requester_profile_code`) and our number (`our_number`).

:::info
When uploading a CNAB file, if the request is successful (response code `202`), a temporary CNAB file (`TemporaryCNABFile`) will be created. It is possible to check the file processing status --- as well as possible errors, both in the file itself and in its occurrences ---, using the [**temporary CNAB file query**](/documentation/boletos/cnab/consulta_por_chave) and [**its occurrences**](/documentation/boletos/cnab/listar_ocorrencias_temporarias) endpoints.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /cnab_file
METHOD POST

### Path parameters

| Field                   | Type   | Description                                                  | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format        | 36         |
| `requester_profile_key` | uuidv4 | Unique requester profile identification key, in uuid v4 format | 36         |

## Request Body Params

The following data should be sent as form-data in the request body:

| Field                   | Type   | Description                                                  | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `file` *                | file   | CNAB file following the standard established by QI Tech     | -          |

## Response

STATUS 202

Response Body

```json
{
  "temporary_cnab_file_key": "f14e9bac-94ed-4eb1-87b4-7fd7b7a2d280",
  "temporary_cnab_file_status": "accepted"
}
```

### Response Body Params

| Field                          | Type    | Description                                                     | Characters                 |
|--------------------------------|---------|-----------------------------------------------------------------|----------------------------|
| `temporary_cnab_file_key` *    | uuidv4  | Unique CNAB file identification key in uuid v4 format          | 36                         |
| `temporary_cnab_file_status` * | string  | CNAB file status | **[temporary_cnab_file_status Enumerators](#enumeradores-cnab_file_status)** |

### temporary_cnab_file_status Enumerators

| Enumerator | Description                                                               |
|------------|---------------------------------------------------------------------------|
| uploaded   | Upload successful, but file has not yet started being processed          |
| processing | File being read                                                           |
| read       | File read and accepted                                                    |
| rejected   | File read and rejected (all file occurrences are rejected)               |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                  | Description (eng)<br/>`description`                                                                                       | Description (ptbr)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 400                      | BKS000022            | Bad Request                                        | Requester profile is not opened.                                                              | Carteira não está aberta.                          |
| 409                      | BKS000053            | Conflict                                           | CNAB file already received: '`<file_name>`'                                                   | Arquivo CNAB já recebido: '`<file_name>`'                          |

---

# Query bank slip by key

URL: /en/documentation/boletos/consulta/consulta_por_chave

Querying a bank slip using its key returns detailed information about it, such as all the instructions related to that bank slip.

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip/ BANK_SLIP_KEY
METHOD GET

### Path parameters

| Field                   | Type   | Description                                                  | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format         | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key, in uuid v4 format          | 36         |
| `bank_slip_key`         | uuidv4 | Unique bank slip identification key, in uuid v4 format       | 36         |

## Response

STATUS 200

Response Body

```json
{
  "bank_slip_key": "4c2fa514-a44d-40f2-8d57-c0caf1b9165a",
  "request_control_key": "0dcb3182-4d7e-4526-8f92-c15cdbc51bad",
  "our_number": 26652176735,
  "document_number": "DOC4561237",
  "amount": "5000.00",
  "rebate_amount": "0.00",
  "expiration": "2024-07-12",
  "barcode": "32994978900005000000001546128483498231955340",
  "digitable_line": "32990001524612848349582319553408497890000500000",
  "bank_teller_instructions": "Confirm payment",
  "protest_data": {
    "days_to_protest": 7
  },
  "bankruptcy_protest_data": {
    "days_to_bankruptcy_protest": 14
  },
  "max_payment_days": 45,
  "fine_data": {
    "fine_type": "absolute",
    "fine_amount": 100.0,
    "days_to_fine": 10
  },
  "interest_data": {
    "interest_type": "workdays_daily_amount",
    "interest_amount": 10.0,
    "days_to_interest": 2
  },
  "discounts_data": [
    {
      "discount_type": "absolute",
      "discount_amount": 50.0,
      "discount_number": 1,
      "discount_limit_date": "2024-07-12"
    }
  ],
  "payer_data": {
    "name": "Global Tech",
    "address": {
      "city": "Innovation City",
      "state": "SP",
      "number": "202",
      "street": "101 High St.",
      "complement": "Building A",
      "postal_code": "57099999",
      "neighborhood": "Tech Park"
    },
    "person_type": "legal",
    "document_number": "12345678000195"
  },
  "guarantor_data": {
    "name": "Jane Doe",
    "address": {
      "city": "Peaceful Town",
      "state": "RJ",
      "number": "303",
      "street": "202 Elm St.",
      "complement": "House 1",
      "postal_code": "57099999",
      "neighborhood": "Quiet Neighborhood"
    },
    "person_type": "natural",
    "document_number": "23456789012"
  },
  "qr_code_data": {
    "qr_code_key": "58bd3558-f214-4e83-9c88-1ac4c93db214",
    "pix_key": "f9b05a58-9dcf-49cb-bc7f-99c5b3f1fdcb",
    "receiver_conciliation_id": "a3861b53f5414b0ba6c9f800d7374474",
    "url": "00020126890014br.gov.bcb.pix2567qrcode-h.dev.qitech.app/bacen/cobv/a3861b53f5414b0ba6c9f800d73744745204000053039865802BR5922BeatrizCoutodeCarvalho6012SAOJOSEDORIO61081501410062070503***6304ED95",
    "image": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/wAALCAD0APQBAREA/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/9oACAEBAAA/APf6KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK+QPhl8Mv+Fjf2p/xN/wCz/sHlf8u3m79+/wD21xjZ79a7/wD4Zl/6m7/ym/8A22j/AIZl/wCpu/8AKb/9to/Zl/5mn/t0/wDa1H7TX/Mrf9vf/tGj9mX/AJmn/t0/9rVwHwy+Jv8Awrn+1P8AiUf2h9v8r/l58rZs3/7DZzv9ule//DL4Zf8ACuf7U/4m/wDaH2/yv+Xbytmzf/ttnO/26V5//wAMy/8AU3f+U3/7bR+01/zK3/b3/wC0a9A+JvxN/wCFc/2X/wASj+0Pt/m/8vPlbNmz/YbOd/t0o+JvxN/4Vz/Zf/Eo/tD7f5v/AC8+Vs2bP9hs53+3SvAPhl8Mv+Fjf2p/xN/7P+weV/y7ebv37/8AbXGNnv1r3/4m/E3/AIVz/Zf/ABKP7Q+3+b/y8+Vs2bP9hs53+3Sj4m/DL/hY39l/8Tf+z/sHm/8ALt5u/fs/21xjZ79a8A+Jvwy/4Vz/AGX/AMTf+0Pt/m/8u3lbNmz/AG2znf7dK+v6+QPib8Tf+Fjf2X/xKP7P+web/wAvPm79+z/YXGNnv1rv/wBpr/mVv+3v/wBo16B8Tfhl/wALG/sv/ib/ANn/AGDzf+Xbzd+/Z/trjGz3615//wAm5/8AUw/27/26eR5H/fzdu872xt7544D4ZfE3/hXP9qf8Sj+0Pt/lf8vPlbNm/wD2Gznf7dK+v6+QPhl8Mv8AhY39qf8AE3/s/wCweV/y7ebv37/9tcY2e/Wu/wD+GZf+pu/8pv8A9to/4Zl/6m7/AMpv/wBto/Zl/wCZp/7dP/a1fQFFFFfP/wCzL/zNP/bp/wC1q8Ar3/8AZl/5mn/t0/8Aa1H7Mv8AzNP/AG6f+1q4D4ZfDL/hY39qf8Tf+z/sHlf8u3m79+//AG1xjZ79a9/+GXxN/wCFjf2p/wASj+z/ALB5X/Lz5u/fv/2FxjZ79a8A+GXwy/4WN/an/E3/ALP+weV/y7ebv37/APbXGNnv1r6/rz/4ZfE3/hY39qf8Sj+z/sHlf8vPm79+/wD2FxjZ79a8A+Jvwy/4Vz/Zf/E3/tD7f5v/AC7eVs2bP9ts53+3Svf/AIZfE3/hY39qf8Sj+z/sHlf8vPm79+//AGFxjZ79a9Arz/4ZfDL/AIVz/an/ABN/7Q+3+V/y7eVs2b/9ts53+3SvP/2mv+ZW/wC3v/2jXAfE34m/8LG/sv8A4lH9n/YPN/5efN379n+wuMbPfrX1/XyB8Tfhl/wrn+y/+Jv/AGh9v83/AJdvK2bNn+22c7/bpX1/Xn/xN+GX/Cxv7L/4m/8AZ/2Dzf8Al283fv2f7a4xs9+tHxN+Jv8Awrn+y/8AiUf2h9v83/l58rZs2f7DZzv9uleAfDL4m/8ACuf7U/4lH9ofb/K/5efK2bN/+w2c7/bpXf8A/Jxn/Uvf2F/29+f5/wD3727fJ987u2OfQPhl8Tf+Fjf2p/xKP7P+weV/y8+bv37/APYXGNnv1rz/APZl/wCZp/7dP/a1eAV7/wDsy/8AM0/9un/taj9mX/maf+3T/wBrV9AUUUV8/wD7Mv8AzNP/AG6f+1qP+GZf+pu/8pv/ANtr0D4ZfDL/AIVz/an/ABN/7Q+3+V/y7eVs2b/9ts53+3SvP/2Zf+Zp/wC3T/2tXAfDL4Zf8LG/tT/ib/2f9g8r/l283fv3/wC2uMbPfrXf/sy/8zT/ANun/taj/hmX/qbv/Kb/APbaP2Zf+Zp/7dP/AGtR/wAm5/8AUw/27/26eR5H/fzdu872xt754P8Ak3P/AKmH+3f+3TyPI/7+bt3ne2NvfPB/w01/1KP/AJUv/tVH/Juf/Uw/27/26eR5H/fzdu872xt7544D4ZfDL/hY39qf8Tf+z/sHlf8ALt5u/fv/ANtcY2e/Wu//AOGZf+pu/wDKb/8Aba8Ar6/+GXxN/wCFjf2p/wASj+z/ALB5X/Lz5u/fv/2FxjZ79a8A+Jvwy/4Vz/Zf/E3/ALQ+3+b/AMu3lbNmz/bbOd/t0r3/AOGXxN/4WN/an/Eo/s/7B5X/AC8+bv37/wDYXGNnv1rz/wD4Zl/6m7/ym/8A22vQPhl8Tf8AhY39qf8AEo/s/wCweV/y8+bv37/9hcY2e/WvP/8AhmX/AKm7/wApv/22j9mX/maf+3T/ANrV9AV8/wD7Mv8AzNP/AG6f+1qP+GZf+pu/8pv/ANtr0D4ZfDL/AIVz/an/ABN/7Q+3+V/y7eVs2b/9ts53+3SvP/2Zf+Zp/wC3T/2tX0BRRRXz/wD8My/9Td/5Tf8A7bR/wzL/ANTd/wCU3/7bR/wzL/1N3/lN/wDttegfDL4Zf8K5/tT/AIm/9ofb/K/5dvK2bN/+22c7/bpXgHwy+Jv/AArn+1P+JR/aH2/yv+Xnytmzf/sNnO/26V7/APDL4Zf8K5/tT/ib/wBofb/K/wCXbytmzf8A7bZzv9ulHwy+GX/Cuf7U/wCJv/aH2/yv+Xbytmzf/ttnO/26UfDL4Zf8K5/tT/ib/wBofb/K/wCXbytmzf8A7bZzv9ulef8A/Juf/Uw/27/26eR5H/fzdu872xt7549A+GXwy/4Vz/an/E3/ALQ+3+V/y7eVs2b/APbbOd/t0o+GXwy/4Vz/AGp/xN/7Q+3+V/y7eVs2b/8AbbOd/t0rz/8AZl/5mn/t0/8Aa1H7Mv8AzNP/AG6f+1q9A+GXwy/4Vz/an/E3/tD7f5X/AC7eVs2b/wDbbOd/t0rwD4ZfE3/hXP8Aan/Eo/tD7f5X/Lz5WzZv/wBhs53+3Sj4ZfE3/hXP9qf8Sj+0Pt/lf8vPlbNm/wD2Gznf7dK7/wD5Nz/6mH+3f+3TyPI/7+bt3ne2NvfPHoHwy+GX/Cuf7U/4m/8AaH2/yv8Al28rZs3/AO22c7/bpR8Mvhl/wrn+1P8Aib/2h9v8r/l28rZs3/7bZzv9ulef/wDJuf8A1MP9u/8Abp5Hkf8Afzdu872xt754P2Zf+Zp/7dP/AGtXoHwy+GX/AArn+1P+Jv8A2h9v8r/l28rZs3/7bZzv9ulHwy+GX/Cuf7U/4m/9ofb/ACv+Xbytmzf/ALbZzv8AbpXn/wDwzL/1N3/lN/8AttH/AAzL/wBTd/5Tf/ttH/DMv/U3f+U3/wC216B8Mvhl/wAK5/tT/ib/ANofb/K/5dvK2bN/+22c7/bpXoFFFFfIHwy+Jv8Awrn+1P8AiUf2h9v8r/l58rZs3/7DZzv9ulHxN+GX/Cuf7L/4m/8AaH2/zf8Al28rZs2f7bZzv9ulef19f/DL4Zf8K5/tT/ib/wBofb/K/wCXbytmzf8A7bZzv9ulef8A7TX/ADK3/b3/AO0a+gK+QPib8Mv+Fc/2X/xN/wC0Pt/m/wDLt5WzZs/22znf7dK8/r6/+GXxN/4WN/an/Eo/s/7B5X/Lz5u/fv8A9hcY2e/Wj4m/E3/hXP8AZf8AxKP7Q+3+b/y8+Vs2bP8AYbOd/t0rwD4ZfDL/AIWN/an/ABN/7P8AsHlf8u3m79+//bXGNnv1r3/4ZfE3/hY39qf8Sj+z/sHlf8vPm79+/wD2FxjZ79a8A+GXwy/4WN/an/E3/s/7B5X/AC7ebv37/wDbXGNnv1o+Jvwy/wCFc/2X/wATf+0Pt/m/8u3lbNmz/bbOd/t0r3/4ZfDL/hXP9qf8Tf8AtD7f5X/Lt5WzZv8A9ts53+3SvP8A/k4z/qXv7C/7e/P8/wD797dvk++d3bHJ/wAMy/8AU3f+U3/7bX0BXz/+01/zK3/b3/7Ro/5Nz/6mH+3f+3TyPI/7+bt3ne2NvfPHoHwy+Jv/AAsb+1P+JR/Z/wBg8r/l583fv3/7C4xs9+teAfDL4Zf8LG/tT/ib/wBn/YPK/wCXbzd+/f8A7a4xs9+td/8A8m5/9TD/AG7/ANunkeR/383bvO9sbe+eD/hmX/qbv/Kb/wDba8Ar6/8Ahl8Mv+Fc/wBqf8Tf+0Pt/lf8u3lbNm//AG2znf7dKPhl8Tf+Fjf2p/xKP7P+weV/y8+bv37/APYXGNnv1r0CiiivP/hl8Mv+Fc/2p/xN/wC0Pt/lf8u3lbNm/wD22znf7dK8/wD+Gmv+pR/8qX/2qj/hmX/qbv8Aym//AG2j/hmX/qbv/Kb/APba9A+JvxN/4Vz/AGX/AMSj+0Pt/m/8vPlbNmz/AGGznf7dK8//AOGZf+pu/wDKb/8Aba9A+Jvwy/4WN/Zf/E3/ALP+web/AMu3m79+z/bXGNnv1o+Jvwy/4WN/Zf8AxN/7P+web/y7ebv37P8AbXGNnv1rz/8A4aa/6lH/AMqX/wBqr6Ar4Ar3/wD5OM/6l7+wv+3vz/P/AO/e3b5Pvnd2xyfsy/8AM0/9un/tauA+Jvwy/wCFc/2X/wATf+0Pt/m/8u3lbNmz/bbOd/t0rv8A/hmX/qbv/Kb/APbaP+Gmv+pR/wDKl/8Aaq4D4m/E3/hY39l/8Sj+z/sHm/8ALz5u/fs/2FxjZ79a7/8A5Nz/AOph/t3/ALdPI8j/AL+bt3ne2NvfPHoHwy+GX/Cuf7U/4m/9ofb/ACv+Xbytmzf/ALbZzv8AbpXn/wDybn/1MP8Abv8A26eR5H/fzdu872xt7544D4m/E3/hY39l/wDEo/s/7B5v/Lz5u/fs/wBhcY2e/Wvr+vn/APZl/wCZp/7dP/a1H7Mv/M0/9un/ALWo/wCTc/8AqYf7d/7dPI8j/v5u3ed7Y2988H7TX/Mrf9vf/tGvoCiiiivn/wDaa/5lb/t7/wDaNH/DTX/Uo/8AlS/+1V6B8Tfib/wrn+y/+JR/aH2/zf8Al58rZs2f7DZzv9ulef8A/DMv/U3f+U3/AO21wHxN+Jv/AAsb+y/+JR/Z/wBg83/l583fv2f7C4xs9+tef17/APsy/wDM0/8Abp/7WrgPhl8Mv+Fjf2p/xN/7P+weV/y7ebv37/8AbXGNnv1rv/2Zf+Zp/wC3T/2tR+01/wAyt/29/wDtGj/k4z/qXv7C/wC3vz/P/wC/e3b5Pvnd2xz9AV8//wDDMv8A1N3/AJTf/ttcB8Tfhl/wrn+y/wDib/2h9v8AN/5dvK2bNn+22c7/AG6V3/8AycZ/1L39hf8Ab35/n/8Afvbt8n3zu7Y5P2Zf+Zp/7dP/AGtR/wAm5/8AUw/27/26eR5H/fzdu872xt7549A+GXxN/wCFjf2p/wASj+z/ALB5X/Lz5u/fv/2FxjZ79a8A+GXwy/4WN/an/E3/ALP+weV/y7ebv37/APbXGNnv1r3/AOGXwy/4Vz/an/E3/tD7f5X/AC7eVs2b/wDbbOd/t0o+JvxN/wCFc/2X/wASj+0Pt/m/8vPlbNmz/YbOd/t0rz//AIaa/wCpR/8AKl/9qo/4Zl/6m7/ym/8A22vQPhl8Mv8AhXP9qf8AE3/tD7f5X/Lt5WzZv/22znf7dKPhl8Tf+Fjf2p/xKP7P+weV/wAvPm79+/8A2FxjZ79a8A+Jvwy/4Vz/AGX/AMTf+0Pt/m/8u3lbNmz/AG2znf7dK9/+GXxN/wCFjf2p/wASj+z/ALB5X/Lz5u/fv/2FxjZ79a9Aooor5/8A+Gmv+pR/8qX/ANqr6Ar5A+GXxN/4Vz/an/Eo/tD7f5X/AC8+Vs2b/wDYbOd/t0rv/wDk3P8A6mH+3f8At08jyP8Av5u3ed7Y2988H/Juf/Uw/wBu/wDbp5Hkf9/N27zvbG3vng/4aa/6lH/ypf8A2quA+JvxN/4WN/Zf/Eo/s/7B5v8Ay8+bv37P9hcY2e/Wvf8A4ZfDL/hXP9qf8Tf+0Pt/lf8ALt5WzZv/ANts53+3SvP/ANmX/maf+3T/ANrUf8My/wDU3f8AlN/+216B8Mvib/wsb+1P+JR/Z/2Dyv8Al583fv3/AOwuMbPfrXn/APycZ/1L39hf9vfn+f8A9+9u3yffO7tjk/4aa/6lH/ypf/aq9A+GXwy/4Vz/AGp/xN/7Q+3+V/y7eVs2b/8AbbOd/t0rwD4m/E3/AIWN/Zf/ABKP7P8AsHm/8vPm79+z/YXGNnv1r3/4ZfDL/hXP9qf8Tf8AtD7f5X/Lt5WzZv8A9ts53+3SvP8A/hpr/qUf/Kl/9qrgPhl8Tf8AhXP9qf8AEo/tD7f5X/Lz5WzZv/2Gznf7dK7/AP4Zl/6m7/ym/wD22j9mX/maf+3T/wBrUf8AJxn/AFL39hf9vfn+f/3727fJ987u2OT/AIaa/wCpR/8AKl/9qr0D4m/DL/hY39l/8Tf+z/sHm/8ALt5u/fs/21xjZ79a8/8A+GZf+pu/8pv/ANtr0D4ZfDL/AIVz/an/ABN/7Q+3+V/y7eVs2b/9ts53+3SvAPib8Mv+Fc/2X/xN/wC0Pt/m/wDLt5WzZs/22znf7dK7/wDZl/5mn/t0/wDa1fQFFFFef/DL4m/8LG/tT/iUf2f9g8r/AJefN379/wDsLjGz3614B8Tfhl/wrn+y/wDib/2h9v8AN/5dvK2bNn+22c7/AG6UfDL4m/8ACuf7U/4lH9ofb/K/5efK2bN/+w2c7/bpXf8A/DMv/U3f+U3/AO20f8nGf9S9/YX/AG9+f5//AH727fJ987u2OeA+GXwy/wCFjf2p/wATf+z/ALB5X/Lt5u/fv/21xjZ79a7/AP4aa/6lH/ypf/aq4D4m/DL/AIVz/Zf/ABN/7Q+3+b/y7eVs2bP9ts53+3Su/wD2Zf8Amaf+3T/2tXAfDL4Zf8LG/tT/AIm/9n/YPK/5dvN379/+2uMbPfrR8Tfib/wsb+y/+JR/Z/2Dzf8Al583fv2f7C4xs9+tHwy+GX/Cxv7U/wCJv/Z/2Dyv+Xbzd+/f/trjGz3615/X1/8ADL4Zf8K5/tT/AIm/9ofb/K/5dvK2bN/+22c7/bpXgHwy+Jv/AArn+1P+JR/aH2/yv+Xnytmzf/sNnO/26UfE34m/8LG/sv8A4lH9n/YPN/5efN379n+wuMbPfrXf/tNf8yt/29/+0aP+TjP+pe/sL/t78/z/APv3t2+T753dscn7Mv8AzNP/AG6f+1q4D4ZfDL/hY39qf8Tf+z/sHlf8u3m79+//AG1xjZ79a+v68/8Ahl8Tf+Fjf2p/xKP7P+weV/y8+bv37/8AYXGNnv1rz/8A5Nz/AOph/t3/ALdPI8j/AL+bt3ne2NvfPHoHxN+Jv/Cuf7L/AOJR/aH2/wA3/l58rZs2f7DZzv8AbpXgHwy+GX/Cxv7U/wCJv/Z/2Dyv+Xbzd+/f/trjGz360fDL4Zf8LG/tT/ib/wBn/YPK/wCXbzd+/f8A7a4xs9+tfX9FFFFfIHxN+GX/AArn+y/+Jv8A2h9v83/l28rZs2f7bZzv9uld/wD8m5/9TD/bv/bp5Hkf9/N27zvbG3vnjgPhl8Tf+Fc/2p/xKP7Q+3+V/wAvPlbNm/8A2Gznf7dKPib8Mv8AhXP9l/8AE3/tD7f5v/Lt5WzZs/22znf7dK7/AP5OM/6l7+wv+3vz/P8A+/e3b5Pvnd2xz6B8Mvib/wALG/tT/iUf2f8AYPK/5efN379/+wuMbPfrXyBX1/8AE34m/wDCuf7L/wCJR/aH2/zf+XnytmzZ/sNnO/26UfDL4m/8LG/tT/iUf2f9g8r/AJefN379/wDsLjGz3615/wDsy/8AM0/9un/taj/k3P8A6mH+3f8At08jyP8Av5u3ed7Y2988eAV9f/DL4m/8LG/tT/iUf2f9g8r/AJefN379/wDsLjGz3614B8Tfib/wsb+y/wDiUf2f9g83/l583fv2f7C4xs9+td/+01/zK3/b3/7Rr6Ar5/8A+TjP+pe/sL/t78/z/wDv3t2+T753dsc+gfDL4Zf8K5/tT/ib/wBofb/K/wCXbytmzf8A7bZzv9ulef8A/DMv/U3f+U3/AO21wHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrXf8A/Jxn/Uvf2F/29+f5/wD3727fJ987u2OfQPib8Tf+Fc/2X/xKP7Q+3+b/AMvPlbNmz/YbOd/t0rz/AP5Nz/6mH+3f+3TyPI/7+bt3ne2NvfPB/wAm5/8AUw/27/26eR5H/fzdu872xt754+gK+QPhl8Mv+Fjf2p/xN/7P+weV/wAu3m79+/8A21xjZ79a+v6KKKK8/wDib8Tf+Fc/2X/xKP7Q+3+b/wAvPlbNmz/YbOd/t0rz/wDaa/5lb/t7/wDaNH7Mv/M0/wDbp/7Wo/5Nz/6mH+3f+3TyPI/7+bt3ne2NvfPB/wAMy/8AU3f+U3/7bXoHwy+GX/Cuf7U/4m/9ofb/ACv+Xbytmzf/ALbZzv8AbpR8Mvib/wALG/tT/iUf2f8AYPK/5efN379/+wuMbPfrXn//AA01/wBSj/5Uv/tVH/DMv/U3f+U3/wC21wHxN+Jv/Cxv7L/4lH9n/YPN/wCXnzd+/Z/sLjGz360fDL4m/wDCuf7U/wCJR/aH2/yv+Xnytmzf/sNnO/26UfE34Zf8K5/sv/ib/wBofb/N/wCXbytmzZ/ttnO/26V3/wDycZ/1L39hf9vfn+f/AN+9u3yffO7tjk/5OM/6l7+wv+3vz/P/AO/e3b5Pvnd2xz6B8Mvhl/wrn+1P+Jv/AGh9v8r/AJdvK2bN/wDttnO/26V4B8Tfib/wsb+y/wDiUf2f9g83/l583fv2f7C4xs9+tHxN+Jv/AAsb+y/+JR/Z/wBg83/l583fv2f7C4xs9+tHxN+GX/Cuf7L/AOJv/aH2/wA3/l28rZs2f7bZzv8AbpXv/wAMvhl/wrn+1P8Aib/2h9v8r/l28rZs3/7bZzv9ulHxN+GX/Cxv7L/4m/8AZ/2Dzf8Al283fv2f7a4xs9+tHxN+GX/Cxv7L/wCJv/Z/2Dzf+Xbzd+/Z/trjGz3614B8Mvhl/wALG/tT/ib/ANn/AGDyv+Xbzd+/f/trjGz3613/APybn/1MP9u/9unkeR/383bvO9sbe+ePoCvn/wD4Zl/6m7/ym/8A22j9pr/mVv8At7/9o0fsy/8AM0/9un/tavoCiiivn/8A4Zl/6m7/AMpv/wBtr6Ar5/8A2Zf+Zp/7dP8A2tR/wzL/ANTd/wCU3/7bR/ycZ/1L39hf9vfn+f8A9+9u3yffO7tjk/Zl/wCZp/7dP/a1H/Juf/Uw/wBu/wDbp5Hkf9/N27zvbG3vng/5Nz/6mH+3f+3TyPI/7+bt3ne2NvfPHoHxN+GX/Cxv7L/4m/8AZ/2Dzf8Al283fv2f7a4xs9+teAfE34Zf8K5/sv8A4m/9ofb/ADf+XbytmzZ/ttnO/wBulHxN+Jv/AAsb+y/+JR/Z/wBg83/l583fv2f7C4xs9+td/wD8NNf9Sj/5Uv8A7VXoHwy+GX/Cuf7U/wCJv/aH2/yv+Xbytmzf/ttnO/26V5//AMNNf9Sj/wCVL/7VR/ybn/1MP9u/9unkeR/383bvO9sbe+ePoCvn/wD5OM/6l7+wv+3vz/P/AO/e3b5Pvnd2xzwHwy+GX/Cxv7U/4m/9n/YPK/5dvN379/8AtrjGz3617/8ADL4Zf8K5/tT/AIm/9ofb/K/5dvK2bN/+22c7/bpXn/8AwzL/ANTd/wCU3/7bXgFe/wD/AA01/wBSj/5Uv/tVegfDL4Zf8K5/tT/ib/2h9v8AK/5dvK2bN/8AttnO/wBulef/APDMv/U3f+U3/wC216B8Mvhl/wAK5/tT/ib/ANofb/K/5dvK2bN/+22c7/bpR8Mvhl/wrn+1P+Jv/aH2/wAr/l28rZs3/wC22c7/AG6V6BRRRRXyB8Tfib/wsb+y/wDiUf2f9g83/l583fv2f7C4xs9+tHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrR8Mvhl/wsb+1P+Jv/Z/2Dyv+Xbzd+/f/ALa4xs9+td//AMMy/wDU3f8AlN/+21wHwy+GX/Cxv7U/4m/9n/YPK/5dvN379/8AtrjGz3617/8ADL4Zf8K5/tT/AIm/9ofb/K/5dvK2bN/+22c7/bpXgHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrR8Tfib/wsb+y/wDiUf2f9g83/l583fv2f7C4xs9+td//AMNNf9Sj/wCVL/7VR/ybn/1MP9u/9unkeR/383bvO9sbe+eD/hpr/qUf/Kl/9qo/4aa/6lH/AMqX/wBqrgPhl8Mv+Fjf2p/xN/7P+weV/wAu3m79+/8A21xjZ79a7/8A4Zl/6m7/AMpv/wBtrgPhl8Tf+Fc/2p/xKP7Q+3+V/wAvPlbNm/8A2Gznf7dK8/r6/wDhl8Tf+Fjf2p/xKP7P+weV/wAvPm79+/8A2FxjZ79aPhl8Mv8AhXP9qf8AE3/tD7f5X/Lt5WzZv/22znf7dK8//wCGmv8AqUf/ACpf/aqP+GZf+pu/8pv/ANtrgPib8Mv+Fc/2X/xN/wC0Pt/m/wDLt5WzZs/22znf7dKPib8Mv+Fc/wBl/wDE3/tD7f5v/Lt5WzZs/wBts53+3Sj4ZfDL/hY39qf8Tf8As/7B5X/Lt5u/fv8A9tcY2e/Wu/8A+GZf+pu/8pv/ANto/Zl/5mn/ALdP/a1cB8Tfhl/wrn+y/wDib/2h9v8AN/5dvK2bNn+22c7/AG6V7/8ADL4m/wDCxv7U/wCJR/Z/2Dyv+Xnzd+/f/sLjGz3616BRRRXyB8Tfhl/wrn+y/wDib/2h9v8AN/5dvK2bNn+22c7/AG6V7/8ADL4Zf8K5/tT/AIm/9ofb/K/5dvK2bN/+22c7/bpXn/7Mv/M0/wDbp/7Wr0D4ZfDL/hXP9qf8Tf8AtD7f5X/Lt5WzZv8A9ts53+3SvAPhl8Mv+Fjf2p/xN/7P+weV/wAu3m79+/8A21xjZ79a7/8Aaa/5lb/t7/8AaNH/AA01/wBSj/5Uv/tVcB8Mvib/AMK5/tT/AIlH9ofb/K/5efK2bN/+w2c7/bpXv/xN+Jv/AArn+y/+JR/aH2/zf+XnytmzZ/sNnO/26V4B8Tfib/wsb+y/+JR/Z/2Dzf8Al583fv2f7C4xs9+td/8AtNf8yt/29/8AtGuA+Jvwy/4Vz/Zf/E3/ALQ+3+b/AMu3lbNmz/bbOd/t0rv/ANmX/maf+3T/ANrV6B8Mvhl/wrn+1P8Aib/2h9v8r/l28rZs3/7bZzv9uleAfDL4m/8ACuf7U/4lH9ofb/K/5efK2bN/+w2c7/bpXf8A7Mv/ADNP/bp/7Wr0D4m/DL/hY39l/wDE3/s/7B5v/Lt5u/fs/wBtcY2e/WvAPib8Mv8AhXP9l/8AE3/tD7f5v/Lt5WzZs/22znf7dK9/+Jvwy/4WN/Zf/E3/ALP+web/AMu3m79+z/bXGNnv1rwD4ZfDL/hY39qf8Tf+z/sHlf8ALt5u/fv/ANtcY2e/Wvf/AIZfE3/hY39qf8Sj+z/sHlf8vPm79+//AGFxjZ79a9Ar5/8A2Zf+Zp/7dP8A2tXoHwy+GX/Cuf7U/wCJv/aH2/yv+Xbytmzf/ttnO/26V5/+zL/zNP8A26f+1q+gK8/+GXxN/wCFjf2p/wASj+z/ALB5X/Lz5u/fv/2FxjZ79a9Aooor5/8A+Gmv+pR/8qX/ANqo/wCTc/8AqYf7d/7dPI8j/v5u3ed7Y2988cB8Mvhl/wALG/tT/ib/ANn/AGDyv+Xbzd+/f/trjGz3613/APwzL/1N3/lN/wDttcB8Tfhl/wAK5/sv/ib/ANofb/N/5dvK2bNn+22c7/bpR8Tfhl/wrn+y/wDib/2h9v8AN/5dvK2bNn+22c7/AG6UfDL4m/8ACuf7U/4lH9ofb/K/5efK2bN/+w2c7/bpXf8A7Mv/ADNP/bp/7Wo/Zl/5mn/t0/8Aa1H/AAzL/wBTd/5Tf/ttH/DMv/U3f+U3/wC20f8ADTX/AFKP/lS/+1V4BXv/APwzL/1N3/lN/wDttegfDL4Zf8K5/tT/AIm/9ofb/K/5dvK2bN/+22c7/bpXgHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrR8Tfhl/wrn+y/wDib/2h9v8AN/5dvK2bNn+22c7/AG6V9f15/wDDL4Zf8K5/tT/ib/2h9v8AK/5dvK2bN/8AttnO/wBulHxN+GX/AAsb+y/+Jv8A2f8AYPN/5dvN379n+2uMbPfrR8Tfhl/wsb+y/wDib/2f9g83/l283fv2f7a4xs9+teAfDL4Zf8LG/tT/AIm/9n/YPK/5dvN379/+2uMbPfrXf/8ADMv/AFN3/lN/+21wHwy+GX/Cxv7U/wCJv/Z/2Dyv+Xbzd+/f/trjGz3615/X1/8ADL4Zf8K5/tT/AIm/9ofb/K/5dvK2bN/+22c7/bpXn/7Mv/M0/wDbp/7Wr6Aooor5/wD+Gmv+pR/8qX/2quA+GXwy/wCFjf2p/wATf+z/ALB5X/Lt5u/fv/21xjZ79aPhl8Mv+Fjf2p/xN/7P+weV/wAu3m79+/8A21xjZ79a7/8A5Nz/AOph/t3/ALdPI8j/AL+bt3ne2NvfPB/w01/1KP8A5Uv/ALVXoHxN+Jv/AArn+y/+JR/aH2/zf+XnytmzZ/sNnO/26V5//wANNf8AUo/+VL/7VR/w01/1KP8A5Uv/ALVR/wAm5/8AUw/27/26eR5H/fzdu872xt7549A+Jvwy/wCFjf2X/wATf+z/ALB5v/Lt5u/fs/21xjZ79a8//wCGmv8AqUf/ACpf/aqP+TjP+pe/sL/t78/z/wDv3t2+T753dscn/Jxn/Uvf2F/29+f5/wD3727fJ987u2OeA+GXxN/4Vz/an/Eo/tD7f5X/AC8+Vs2b/wDYbOd/t0rv/wBpr/mVv+3v/wBo1wHxN+Jv/Cxv7L/4lH9n/YPN/wCXnzd+/Z/sLjGz360fDL4m/wDCuf7U/wCJR/aH2/yv+Xnytmzf/sNnO/26V7/8Tfib/wAK5/sv/iUf2h9v83/l58rZs2f7DZzv9ulHwy+GX/Cuf7U/4m/9ofb/ACv+Xbytmzf/ALbZzv8AbpXyBXv/APycZ/1L39hf9vfn+f8A9+9u3yffO7tjngPib8Tf+Fjf2X/xKP7P+web/wAvPm79+z/YXGNnv1o+Jvwy/wCFc/2X/wATf+0Pt/m/8u3lbNmz/bbOd/t0r3/4ZfDL/hXP9qf8Tf8AtD7f5X/Lt5WzZv8A9ts53+3SvP8A/hmX/qbv/Kb/APbaP2mv+ZW/7e//AGjX0BRRRRXz/wDsy/8AM0/9un/tavQPib8Mv+Fjf2X/AMTf+z/sHm/8u3m79+z/AG1xjZ79a8//AGmv+ZW/7e//AGjXAfE34Zf8K5/sv/ib/wBofb/N/wCXbytmzZ/ttnO/26V9f18//tNf8yt/29/+0a+gK8/+GXwy/wCFc/2p/wATf+0Pt/lf8u3lbNm//bbOd/t0rwD4m/DL/hXP9l/8Tf8AtD7f5v8Ay7eVs2bP9ts53+3Sj4ZfDL/hY39qf8Tf+z/sHlf8u3m79+//AG1xjZ79a8/r3/8A5OM/6l7+wv8At78/z/8Av3t2+T753dscn/DMv/U3f+U3/wC20f8AJuf/AFMP9u/9unkeR/383bvO9sbe+eOA+GXwy/4WN/an/E3/ALP+weV/y7ebv37/APbXGNnv1o+GXxN/4Vz/AGp/xKP7Q+3+V/y8+Vs2b/8AYbOd/t0o+JvxN/4WN/Zf/Eo/s/7B5v8Ay8+bv37P9hcY2e/Wvf8A4ZfE3/hY39qf8Sj+z/sHlf8ALz5u/fv/ANhcY2e/WvkCvr/4m/E3/hXP9l/8Sj+0Pt/m/wDLz5WzZs/2Gznf7dK8/wD2mv8AmVv+3v8A9o1wHwy+GX/Cxv7U/wCJv/Z/2Dyv+Xbzd+/f/trjGz3617/8Tfhl/wALG/sv/ib/ANn/AGDzf+Xbzd+/Z/trjGz360fE34Zf8LG/sv8A4m/9n/YPN/5dvN379n+2uMbPfrXn/wDw01/1KP8A5Uv/ALVR/wAm5/8AUw/27/26eR5H/fzdu872xt754P2Zf+Zp/wC3T/2tX0BRRRXwBXoHxN+GX/Cuf7L/AOJv/aH2/wA3/l28rZs2f7bZzv8AbpR8Mvib/wAK5/tT/iUf2h9v8r/l58rZs3/7DZzv9ule/wDwy+GX/Cuf7U/4m/8AaH2/yv8Al28rZs3/AO22c7/bpXn/AO01/wAyt/29/wDtGuA+JvxN/wCFjf2X/wASj+z/ALB5v/Lz5u/fs/2FxjZ79aPib8Tf+Fjf2X/xKP7P+web/wAvPm79+z/YXGNnv1o+JvxN/wCFjf2X/wASj+z/ALB5v/Lz5u/fs/2FxjZ79aPhl8Mv+Fjf2p/xN/7P+weV/wAu3m79+/8A21xjZ79a9/8Aib8Mv+Fjf2X/AMTf+z/sHm/8u3m79+z/AG1xjZ79a9Arz/4m/E3/AIVz/Zf/ABKP7Q+3+b/y8+Vs2bP9hs53+3SvkCvf/wBpr/mVv+3v/wBo16B8Tfhl/wALG/sv/ib/ANn/AGDzf+Xbzd+/Z/trjGz3615/+zL/AMzT/wBun/tauA+GXxN/4Vz/AGp/xKP7Q+3+V/y8+Vs2b/8AYbOd/t0o+GXxN/4Vz/an/Eo/tD7f5X/Lz5WzZv8A9hs53+3Svr+vn/8AZl/5mn/t0/8Aa1egfDL4m/8ACxv7U/4lH9n/AGDyv+Xnzd+/f/sLjGz3615//wANNf8AUo/+VL/7VR/wzL/1N3/lN/8AttegfDL4m/8ACxv7U/4lH9n/AGDyv+Xnzd+/f/sLjGz3615//wAnGf8AUvf2F/29+f5//fvbt8n3zu7Y59A+Jvwy/wCFjf2X/wATf+z/ALB5v/Lt5u/fs/21xjZ79aPhl8Mv+Fc/2p/xN/7Q+3+V/wAu3lbNm/8A22znf7dK9Aooorz/AOJvwy/4WN/Zf/E3/s/7B5v/AC7ebv37P9tcY2e/Wj4ZfE3/AIWN/an/ABKP7P8AsHlf8vPm79+//YXGNnv1r0CvkD4m/DL/AIVz/Zf/ABN/7Q+3+b/y7eVs2bP9ts53+3SvP6+v/hl8Tf8AhY39qf8AEo/s/wCweV/y8+bv37/9hcY2e/WvAPib8Mv+Fc/2X/xN/wC0Pt/m/wDLt5WzZs/22znf7dK7/wDaa/5lb/t7/wDaNH7TX/Mrf9vf/tGj/k4z/qXv7C/7e/P8/wD797dvk++d3bHJ+01/zK3/AG9/+0a4D4m/E3/hY39l/wDEo/s/7B5v/Lz5u/fs/wBhcY2e/Wu//wCTc/8AqYf7d/7dPI8j/v5u3ed7Y2988cB8Tfib/wALG/sv/iUf2f8AYPN/5efN379n+wuMbPfrXv8A8Tfib/wrn+y/+JR/aH2/zf8Al58rZs2f7DZzv9uleAfDL4Zf8LG/tT/ib/2f9g8r/l283fv3/wC2uMbPfrR8Mvhl/wALG/tT/ib/ANn/AGDyv+Xbzd+/f/trjGz360fE34m/8LG/sv8A4lH9n/YPN/5efN379n+wuMbPfrXf/sy/8zT/ANun/tauA+Jvwy/4Vz/Zf/E3/tD7f5v/AC7eVs2bP9ts53+3Svf/AIm/E3/hXP8AZf8AxKP7Q+3+b/y8+Vs2bP8AYbOd/t0rz/8AZl/5mn/t0/8Aa1H/ACbn/wBTD/bv/bp5Hkf9/N27zvbG3vnj6Ar5A+JvxN/4WN/Zf/Eo/s/7B5v/AC8+bv37P9hcY2e/WvP69/8A2Zf+Zp/7dP8A2tX0BRRRXwBXoHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrXn9e/wD/AAzL/wBTd/5Tf/ttH/DTX/Uo/wDlS/8AtVH7TX/Mrf8Ab3/7RrgPhl8Mv+Fjf2p/xN/7P+weV/y7ebv37/8AbXGNnv1rv/8Ak4z/AKl7+wv+3vz/AD/+/e3b5Pvnd2xz6B8Tfib/AMK5/sv/AIlH9ofb/N/5efK2bNn+w2c7/bpXn/8Aybn/ANTD/bv/AG6eR5H/AH83bvO9sbe+ePQPib8Mv+Fjf2X/AMTf+z/sHm/8u3m79+z/AG1xjZ79aPib8Tf+Fc/2X/xKP7Q+3+b/AMvPlbNmz/YbOd/t0o+Jvwy/4WN/Zf8AxN/7P+web/y7ebv37P8AbXGNnv1rz/8A5OM/6l7+wv8At78/z/8Av3t2+T753dscn/Juf/Uw/wBu/wDbp5Hkf9/N27zvbG3vnj6Ar5//AGZf+Zp/7dP/AGtXoHwy+Jv/AAsb+1P+JR/Z/wBg8r/l583fv3/7C4xs9+tef/8ADMv/AFN3/lN/+21wHxN+GX/Cuf7L/wCJv/aH2/zf+XbytmzZ/ttnO/26V7/8Tfib/wAK5/sv/iUf2h9v83/l58rZs2f7DZzv9ulef/8ADTX/AFKP/lS/+1VwHwy+Jv8Awrn+1P8AiUf2h9v8r/l58rZs3/7DZzv9uld//wAnGf8AUvf2F/29+f5//fvbt8n3zu7Y59A+GXwy/wCFc/2p/wATf+0Pt/lf8u3lbNm//bbOd/t0rz//AJOM/wCpe/sL/t78/wA//v3t2+T753dsc/QFFFFFef8Awy+Jv/Cxv7U/4lH9n/YPK/5efN379/8AsLjGz3615/8AtNf8yt/29/8AtGuA+GXxN/4Vz/an/Eo/tD7f5X/Lz5WzZv8A9hs53+3Su/8A+Tc/+ph/t3/t08jyP+/m7d53tjb3zwf8m5/9TD/bv/bp5Hkf9/N27zvbG3vng/4Zl/6m7/ym/wD22j9mX/maf+3T/wBrUf8AJxn/AFL39hf9vfn+f/3727fJ987u2OfoCvn/AP5OM/6l7+wv+3vz/P8A+/e3b5Pvnd2xyf8ADMv/AFN3/lN/+20ftNf8yt/29/8AtGvQPhl8Tf8AhY39qf8AEo/s/wCweV/y8+bv37/9hcY2e/WvP/8Ahpr/AKlH/wAqX/2quA+Jvwy/4Vz/AGX/AMTf+0Pt/m/8u3lbNmz/AG2znf7dKPib8Tf+Fjf2X/xKP7P+web/AMvPm79+z/YXGNnv1r3/AOJvwy/4WN/Zf/E3/s/7B5v/AC7ebv37P9tcY2e/WvP/APhmX/qbv/Kb/wDbaP8Ak3P/AKmH+3f+3TyPI/7+bt3ne2NvfPB/w01/1KP/AJUv/tVegfDL4Zf8K5/tT/ib/wBofb/K/wCXbytmzf8A7bZzv9ulHwy+GX/Cuf7U/wCJv/aH2/yv+Xbytmzf/ttnO/26V4B8Mvib/wAK5/tT/iUf2h9v8r/l58rZs3/7DZzv9ule/wDxN+GX/Cxv7L/4m/8AZ/2Dzf8Al283fv2f7a4xs9+tfIFfX/xN+GX/AAsb+y/+Jv8A2f8AYPN/5dvN379n+2uMbPfrR8Mvib/wsb+1P+JR/Z/2Dyv+Xnzd+/f/ALC4xs9+tegUUUV8gfE34Zf8K5/sv/ib/wBofb/N/wCXbytmzZ/ttnO/26V3/wDycZ/1L39hf9vfn+f/AN+9u3yffO7tjk/4Zl/6m7/ym/8A22j/AIZl/wCpu/8AKb/9trgPib8Mv+Fc/wBl/wDE3/tD7f5v/Lt5WzZs/wBts53+3Sj4ZfDL/hY39qf8Tf8As/7B5X/Lt5u/fv8A9tcY2e/Wu/8A+GZf+pu/8pv/ANtr0D4ZfE3/AIWN/an/ABKP7P8AsHlf8vPm79+//YXGNnv1r5Ar3/8A5OM/6l7+wv8At78/z/8Av3t2+T753dsc+gfDL4Zf8K5/tT/ib/2h9v8AK/5dvK2bN/8AttnO/wBulef/APDTX/Uo/wDlS/8AtVegfDL4Zf8ACuf7U/4m/wDaH2/yv+Xbytmzf/ttnO/26UfDL4Zf8K5/tT/ib/2h9v8AK/5dvK2bN/8AttnO/wBulHwy+GX/AArn+1P+Jv8A2h9v8r/l28rZs3/7bZzv9ulHwy+Jv/Cxv7U/4lH9n/YPK/5efN379/8AsLjGz3614B8Tfib/AMLG/sv/AIlH9n/YPN/5efN379n+wuMbPfrXf/8ADMv/AFN3/lN/+216B8Tfhl/wsb+y/wDib/2f9g83/l283fv2f7a4xs9+tef/ALTX/Mrf9vf/ALRo/wCTjP8AqXv7C/7e/P8AP/797dvk++d3bHJ/w01/1KP/AJUv/tVH/DMv/U3f+U3/AO20f8nGf9S9/YX/AG9+f5//AH727fJ987u2OT/hmX/qbv8Aym//AG2vAK+v/hl8Tf8AhY39qf8AEo/s/wCweV/y8+bv37/9hcY2e/WvQKKKKK8/+Jvwy/4WN/Zf/E3/ALP+web/AMu3m79+z/bXGNnv1r0Cvn//AIZl/wCpu/8AKb/9to/Zl/5mn/t0/wDa1fQFfIHxN+GX/Cuf7L/4m/8AaH2/zf8Al28rZs2f7bZzv9ule/8Awy+GX/Cuf7U/4m/9ofb/ACv+Xbytmzf/ALbZzv8AbpR8Mvib/wALG/tT/iUf2f8AYPK/5efN379/+wuMbPfrXgHxN+Jv/Cxv7L/4lH9n/YPN/wCXnzd+/Z/sLjGz3613/wC01/zK3/b3/wC0a4D4ZfE3/hXP9qf8Sj+0Pt/lf8vPlbNm/wD2Gznf7dKPhl8Mv+Fjf2p/xN/7P+weV/y7ebv37/8AbXGNnv1rv/8AhmX/AKm7/wApv/22j9mX/maf+3T/ANrUf8My/wDU3f8AlN/+20f8nGf9S9/YX/b35/n/APfvbt8n3zu7Y59A+GXwy/4Vz/an/E3/ALQ+3+V/y7eVs2b/APbbOd/t0rz/APZl/wCZp/7dP/a1H/DMv/U3f+U3/wC216B8Tfib/wAK5/sv/iUf2h9v83/l58rZs2f7DZzv9ulef/sy/wDM0/8Abp/7WrgPhl8Mv+Fjf2p/xN/7P+weV/y7ebv37/8AbXGNnv1rv/8AhmX/AKm7/wApv/22j9mX/maf+3T/ANrUf8m5/wDUw/27/wBunkeR/wB/N27zvbG3vnj0D4ZfE3/hY39qf8Sj+z/sHlf8vPm79+//AGFxjZ79a9Aooor5A+GXwy/4WN/an/E3/s/7B5X/AC7ebv37/wDbXGNnv1rv/wDhmX/qbv8Aym//AG2j/hmX/qbv/Kb/APbaP2Zf+Zp/7dP/AGtR/wANNf8AUo/+VL/7VXoHwy+GX/Cuf7U/4m/9ofb/ACv+Xbytmzf/ALbZzv8AbpXgHwy+GX/Cxv7U/wCJv/Z/2Dyv+Xbzd+/f/trjGz3613//ACbn/wBTD/bv/bp5Hkf9/N27zvbG3vnjwCvr/wCJvxN/4Vz/AGX/AMSj+0Pt/m/8vPlbNmz/AGGznf7dK8//AOTc/wDqYf7d/wC3TyPI/wC/m7d53tjb3zwfsy/8zT/26f8Ataj9mX/maf8At0/9rV6B8Mvhl/wrn+1P+Jv/AGh9v8r/AJdvK2bN/wDttnO/26V4B8Mvib/wrn+1P+JR/aH2/wAr/l58rZs3/wCw2c7/AG6V7/8ADL4m/wDCxv7U/wCJR/Z/2Dyv+Xnzd+/f/sLjGz3615/+01/zK3/b3/7Ro/5Nz/6mH+3f+3TyPI/7+bt3ne2NvfPB/wAm5/8AUw/27/26eR5H/fzdu872xt7544D4ZfE3/hXP9qf8Sj+0Pt/lf8vPlbNm/wD2Gznf7dKPhl8Mv+Fjf2p/xN/7P+weV/y7ebv37/8AbXGNnv1rv/8Ak4z/AKl7+wv+3vz/AD/+/e3b5Pvnd2xyfsy/8zT/ANun/tavQPhl8Mv+Fc/2p/xN/wC0Pt/lf8u3lbNm/wD22znf7dK8/wD2Zf8Amaf+3T/2tX0BXn/wy+Jv/Cxv7U/4lH9n/YPK/wCXnzd+/f8A7C4xs9+tegUUUV8//sy/8zT/ANun/tavAK9//Zl/5mn/ALdP/a1H7Mv/ADNP/bp/7WrgPhl8Tf8AhXP9qf8AEo/tD7f5X/Lz5WzZv/2Gznf7dK9/+JvxN/4Vz/Zf/Eo/tD7f5v8Ay8+Vs2bP9hs53+3Sj4ZfDL/hXP8Aan/E3/tD7f5X/Lt5WzZv/wBts53+3Sj4m/E3/hXP9l/8Sj+0Pt/m/wDLz5WzZs/2Gznf7dK8/wD+Tc/+ph/t3/t08jyP+/m7d53tjb3zx9AV8/8A/Juf/Uw/27/26eR5H/fzdu872xt754P+Tc/+ph/t3/t08jyP+/m7d53tjb3zx4BXoHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrXf8A/DMv/U3f+U3/AO216B8Tfhl/wsb+y/8Aib/2f9g83/l283fv2f7a4xs9+tef/wDDMv8A1N3/AJTf/ttegfE34m/8K5/sv/iUf2h9v83/AJefK2bNn+w2c7/bpR8Tfib/AMK5/sv/AIlH9ofb/N/5efK2bNn+w2c7/bpXn/8Aybn/ANTD/bv/AG6eR5H/AH83bvO9sbe+ePQPhl8Tf+Fjf2p/xKP7P+weV/y8+bv37/8AYXGNnv1rz/8AZl/5mn/t0/8Aa1eAV7//AMMy/wDU3f8AlN/+21wHxN+GX/Cuf7L/AOJv/aH2/wA3/l28rZs2f7bZzv8AbpR8Mvhl/wALG/tT/ib/ANn/AGDyv+Xbzd+/f/trjGz3619f0UUUV8//ALMv/M0/9un/ALWo/wCGZf8Aqbv/ACm//ba9A+GXwy/4Vz/an/E3/tD7f5X/AC7eVs2b/wDbbOd/t0rz/wDZl/5mn/t0/wDa1H/Juf8A1MP9u/8Abp5Hkf8Afzdu872xt7549A+Jvwy/4WN/Zf8AxN/7P+web/y7ebv37P8AbXGNnv1o+JvxN/4Vz/Zf/Eo/tD7f5v8Ay8+Vs2bP9hs53+3SvAPhl8Tf+Fc/2p/xKP7Q+3+V/wAvPlbNm/8A2Gznf7dKPhl8Mv8AhY39qf8AE3/s/wCweV/y7ebv37/9tcY2e/Wj4ZfDL/hY39qf8Tf+z/sHlf8ALt5u/fv/ANtcY2e/WvP6+v8A4ZfDL/hXP9qf8Tf+0Pt/lf8ALt5WzZv/ANts53+3Sj4ZfDL/AIVz/an/ABN/7Q+3+V/y7eVs2b/9ts53+3SvkCvQPhl8Mv8AhY39qf8AE3/s/wCweV/y7ebv37/9tcY2e/Wj4ZfE3/hXP9qf8Sj+0Pt/lf8ALz5WzZv/ANhs53+3SvP6K9//AOTc/wDqYf7d/wC3TyPI/wC/m7d53tjb3zwf8My/9Td/5Tf/ALbR/wAnGf8AUvf2F/29+f5//fvbt8n3zu7Y5+gK+f8A9pr/AJlb/t7/APaNeAV6B8Tfhl/wrn+y/wDib/2h9v8AN/5dvK2bNn+22c7/AG6V7/8AE34m/wDCuf7L/wCJR/aH2/zf+XnytmzZ/sNnO/26V6BRRRRXz/8A8My/9Td/5Tf/ALbR/wAMy/8AU3f+U3/7bR/wzL/1N3/lN/8AttegfDL4Zf8ACuf7U/4m/wDaH2/yv+Xbytmzf/ttnO/26V5//wAMy/8AU3f+U3/7bXoHxN+GX/Cxv7L/AOJv/Z/2Dzf+Xbzd+/Z/trjGz360fE34Zf8ACxv7L/4m/wDZ/wBg83/l283fv2f7a4xs9+tegV8//wDDMv8A1N3/AJTf/ttfQFfP/wDwzL/1N3/lN/8AttfQFfP/APwzL/1N3/lN/wDttfQFef8Awy+GX/Cuf7U/4m/9ofb/ACv+Xbytmzf/ALbZzv8AbpR8Mvhl/wAK5/tT/ib/ANofb/K/5dvK2bN/+22c7/bpXoFFef8Awy+GX/Cuf7U/4m/9ofb/ACv+Xbytmzf/ALbZzv8AbpR8Mvhl/wAK5/tT/ib/ANofb/K/5dvK2bN/+22c7/bpR8Tfhl/wsb+y/wDib/2f9g83/l283fv2f7a4xs9+tHwy+GX/AArn+1P+Jv8A2h9v8r/l28rZs3/7bZzv9ulHwy+GX/Cuf7U/4m/9ofb/ACv+Xbytmzf/ALbZzv8AbpR8Mvhl/wAK5/tT/ib/ANofb/K/5dvK2bN/+22c7/bpR8Mvhl/wrn+1P+Jv/aH2/wAr/l28rZs3/wC22c7/AG6UfDL4Zf8ACuf7U/4m/wDaH2/yv+Xbytmzf/ttnO/26V6BRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRX//Z"
  },
  "payment_notice_data": {
    "payment_method": "account_debit",
    "payment_origin": "internet",
    "payment_notice_date": "2024-07-01"
  },
  "payment_data": {
    "paid_amount": 850.0,
    "paid_rebate_amount": 200.0,
    "paid_discount_amount": 0.0,
    "paid_fine_amount": 0.0,
    "paid_interest_amount": 50.0,
    "payment_method": "account_debit",
    "payment_origin": "internet",
    "payment_credit_date": "2024-07-02",
    "payment_date": "2024-07-01",
    "payment_bank": {
      "code": "341",
      "ispb": 60701190,
      "name": "ITAU UNIBANCO S.A."
    },
    "payment_branch": "0216"
  },
  "bank_slip_status": "registered",
  "occurrences": [
    {
      "request_control_key": "0dcb3182-4d7e-4526-8f92-c15cdbc51bad",
      "occurrence_key": "ec67408c-a149-418a-b89b-b9c9d3b6c403",
      "occurrence_type": "registration",
      "occurrence_status": "confirmed",
      "created_at": "2024-06-23T09:15:32Z"
    },
    {
      "request_control_key": "9618c632-7f4d-490b-8817-2bb72ec1e84a",
      "occurrence_key": "70d3e632-644d-499f-baac-f65f21fb8574",
      "occurrence_type": "rebate",
      "occurrence_status": "confirmed",
      "created_at": "2024-06-26T12:36:04Z"
    },
    {
      "request_control_key": "c2b2ba59-9c37-488d-823d-2c3bfc1e9108",
      "occurrence_key": "dbdd513c-e918-4d17-b194-b5ae3d979988",
      "occurrence_type": "cancel_rebate",
      "occurrence_status": "confirmed",
      "created_at": "2024-06-26T12:53:47Z"
    }
  ]
}
```

### Response Body Params

| Field                      | Type    | Description                                                                        | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------|
| `bank_slip_key      ` *    | uuidv4  | Unique bank slip identification key, in uuid v4 format                             | 36                                                |
| `request_control_key` *    | uuidv4  | Unique identification key of the request used by the client, in uuid v4 format    | 36                                                |
| `our_number` *             | integer | Unique bank slip identification number within the wallet                           | 11                                                |
| `bank_slip_status` *       | string | Bank slip status                                                                    | **[bank_slip_status Enumerators](#enumeradores-bank_slip_status)** |
| `protest_status` *         | string | Notary office protest status of the bank slip                                       | **[protest_status Enumerators](#enumeradores-protest_status)** |
| `document_number` *        | string  | Bank slip identification number                                                    | 10                                                |
| `amount` *                 | float   | Base amount of the bank slip                                                       | -                                                 |
| `expiration` *             | string  | Due date                                                                           | 10                                                |
| `barcode` *               | string  | Bank slip barcode                                                                  | 44                                                |
| `digitable_line` *         | string  | Bank slip digitable line                                                           | 47                                                |
| `bank_teller_instructions` | string  | Additional registration instructions that will appear on the bank slip PDF         | 320                                               |
| `rebate_amount`            | float   | Bank slip rebate amount, which will be applied on top of the base amount           | -                                                 |
| `max_payment_days` *      | integer | Maximum number of calendar days the bank slip will remain available for payment, after the due date (max 365) | -          |
| `write_off_data`       | object  | Write-off settings      | **[write_off_data Object](#objeto-write_off_settings)** |
| `protest_data`         | object  | Protest settings       | **[protest_data Object](#objeto-protest_settings)** |
| `bankruptcy_protest_data` | object  | Bankruptcy protest settings | **[bankruptcy_protest_data Object](#objeto-bankruptcy_protest_settings)** |
| `fine_data`            | object  | Fine settings                 | **[fine_data Object](#objeto-fine_settings)** |
| `interest_data`        | object  | Interest settings        | **[interest_data Object](#objeto-interest_settings)** |
| `discounts_data`           | object array | Discounts           | **[discount Object](#objeto-discounts_data)** |
| `payer_data` *             | object  | Payer data                                                                         | **[payer_data Object](#objetos-payer_data-e-guarantor_data)** |
| `guarantor_data` *         | object  | Guarantor data                                                                     | **[guarantor_data Object](#objetos-payer_data-e-guarantor_data)** |
| `qr_code_data`             | object  | QR Code data                                                            | **[qr_code_data Object](#objeto-qr_code_data)** |
| `payment_notice_data`             | object or array  | Payment notice data                                                       | **[payment_notice_data Object or array](#objeto-ou-array-payment_notice_data)** |
| `payment_data`             | object or array  | Payment data                                                              | **[payment_data Object or array](#objeto-ou-array-payment_data)** |
| `guarantor_data`           | object  | Guarantor data                                                                     | **[guarantor_data Object](#objetos-payer_data-e-guarantor_data)** |
| `occurrences`              | object array | Instructions related to the bank slip                                         | **[bank_slip_occurrence Object](#objeto-bank_slip_occurrence)** |

:::info Information
The `amount` field is the base amount of the bank slip, i.e., it does not include the fine, interest, rebate, or discounts.
:::

### bank_slip_status Enumerators {#enumeradores-bank_slip_status}

| Enumerator                   | Description                                                                    |
|------------------------------|--------------------------------------------------------------------------------|
| accepted                     | Accepted and sent to Nuclea/CIP for analysis                                   |
| rejected                     | Registration rejected by Nuclea/CIP                                            |
| payment_notice               | Payment notice (bank slip paid but payment not yet settled)                    |
| notary_office_payment_notice | Notary office payment notice (bank slip paid but payment not yet settled)      |
| registered                   | Registration confirmed by Nuclea/CIP                                           |
| payment_blocked              | Blocked for payment (in protest flow)                                          |
| paid                         | Paid                                                                           |
| written_off                  | Written off                                                                    |

### protest_status Enumerators {#enumeradores-protest_status}

| Enumerator                   | Description                                                                    |
|------------------------------|--------------------------------------------------------------------------------|
| not_protested                | Bank slip with no protest flow initiated                                       |
| protest_requested            | Notary office protest requested                                                |
| notary_office_entry          | Bank slip at the notary office, in the three-day grace period                  |
| protest_cancel_requested     | Protest withdrawal requested                                                   |
| notary_office_exit           | Bank slip left the notary office                                               |
| protested                    | Bank slip protested                                                            |
| paid_at_notary_office        | Paid at the notary office                                                      |
| judicially_suspended         | Protest judicially suspended                                                   |
| protest_remove_requested     | Protest removal requested                                                      |

### write_off_data Object {#objeto-write_off_settings}

| Field                     | Type    | Description                                                                 | Characters |
|---------------------------|---------|-----------------------------------------------------------------------------|------------|
| `days_to_write_off` *     | integer | Days, after the due date, for the bank slip to be automatically written off | -          |

### protest_data Object {#objeto-protest_settings}

| Field                     | Type    | Description                                                                 | Characters |
|---------------------------|---------|-----------------------------------------------------------------------------|------------|
| `days_to_protest` *       | integer | Days, after the due date, for the bank slip to be automatically protested   | -          |

### bankruptcy_protest_data Object {#objeto-bankruptcy_protest_settings}

| Field                          | Type    | Description                                                                 | Characters  |
|--------------------------------|---------|-----------------------------------------------------------------------------|------------|
| `days_to_bankruptcy_protest` * | integer | Days, after the due date, for the bank slip to be automatically protested   | -           |

### fine_data Object {#objeto-fine_settings}

Option 1: fine as an absolute amount (`fine_type=absolute`)

| Field                     | Type    | Description                                             | Characters                |
|---------------------------|---------|---------------------------------------------------------|-------------------------------------------------------------------------|
| `fine_type` *             | string  | Fine type                                                           | **[fine_type Enumerators](#enumeradores-fine_type)**                                              |
| `fine_amount` *           | float   | Absolute fine amount                                                | -                                                                        |
| `days_to_fine` *          | integer | Days, after the due date, for the fine to be charged                | -                                                                        |

Option 2: fine as a percentage (`fine_type=percentage`)

| Field                     | Type    | Description                                               | Characters                             |
|---------------------------|---------|-----------------------------------------------------------|---------------------------------------|
| `fine_type` *             | string  | Fine type                                                | **[fine_type Enumerators](#enumeradores-fine_type)** |
| `fine_percentage` *       | integer | Fine percentage, from 1 to 100                           | -                                      |
| `days_to_fine` *          | integer | Days, after the due date, for the fine to be charged     | -                                      |

### fine_type Enumerators {#enumeradores-fine_type}

| Enumerator         | Description           |
|--------------------|-----------------------|
| absolute           | absolute amount       |
| percentage         | percentage            |

### interest_data Object {#objeto-interest_settings}

Option 1: interest using absolute amounts (`interest_type=calendar_days_daily_amount` or `interest_type=workdays_daily_amount`)

| Field                     | Type    | Description                                                                   | Characters                                                                                      |
|---------------------------|---------|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| `interest_type` *         | string  | Interest type       | **[interest_type Enumerators](#enumeradores-interest_type)** |
| `interest_amount` *       | float   | Amount to be charged per defined unit of time (workdays or calendar days)     | -                                                                                               |
| `days_to_interest` *      | integer | Days, after the due date, for interest to start being charged                 | -                                                                                               |

Option 2: interest using percentages (`interest_type=calendar_days_monthly_percentage`)

| Field                    | Type    | Description                                                                            | Characters                                                                                          |
|--------------------------|---------|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| `interest_type` *        | string  | Interest type       | **[interest_type Enumerators](#enumeradores-interest_type)** |
| `interest_percentage` *  | integer | Percentage to be charged per defined unit of time (workdays or calendar days)                                                                      | -                                                                           |
| `days_to_interest` *     | integer | Days, after the due date, for interest to start being charged                          | -                                                                                                   |

### interest_type Enumerators {#enumeradores-interest_type}

| Enumerator                       | Description                                                          |
|----------------------------------|----------------------------------------------------------------------|
| calendar_days_daily_amount       | Daily amount over calendar days                                      |
| workdays_daily_amount            | Daily amount over workdays                                           |
| calendar_days_monthly_percentage | Interest percentage charged monthly, based on calendar days          |

### discount Object {#objeto-discounts_data}

Option 1: discounts using absolute amounts (`discount_type in ["absolute", "anticipation_calendar_days_daily_amount", "anticipation_workdays_daily_amount"]`)

| Field                     | Type    | Description                                         | Characters                                                |
|---------------------------|---------|-----------------------------------------------------|-----------------------------------------------------------|
| `discount_amount` *       | float   | Absolute discount amount per unit of time                                                  | -                                                          |
| `discount_number` *       | integer | Discount number                                        | -                                                         |
| `discount_type` *         | string  | Discount settings using absolute amounts                                         | **[discount_type Enumerator](#enumeradores-discount_type)** |                                                       |
| `discount_limit_date` *   | string  | Deadline date for applying the discount   | 10                                                        |

Option 2: discounts using percentages (`discount_type in ["percentage", "anticipation_calendar_days_daily_percentage", "anticipation_workdays_daily_percentage"]`)

| Field                     | Type    | Description                                         | Characters                                                |
|---------------------------|---------|-----------------------------------------------------|-----------------------------------------------------------|
| `discount_percentage` *   | float   | Discount percentage per unit of time                                                  | -                                                          |
| `discount_number` *       | integer | Discount number                                        | -                                                         |
| `discount_type` *         | string  | Discount settings using percentages                                         | **[discount_type Enumerator](#enumeradores-discount_type)** |                                                       |
| `discount_limit_date` *   | string  | Deadline date for applying the discount   | 10                                                        |

:::caution Warning!
A bank slip can have up to three discounts, and all discounts must be of the same type , i.e., they must have the same `discount_type`. Discounts must be numbered from 1 to 3, in ascending order and necessarily starting at 1. That is, if two discounts are sent in the request, they must necessarily be numbered 1 and 2.
:::

### discount_type Enumerators {#enumeradores-discount_type}

| Enumerator                                  | Description                                                              |
|---------------------------------------------|--------------------------------------------------------------------------|
| absolute                                    | Fixed amount                                                            |
| anticipation_calendar_days_daily_amount     | Daily early-payment discount amount, over calendar days                 |
| anticipation_workdays_daily_amount          | Daily early-payment discount amount, over workdays                      |
| percentage                                  | Fixed percentage                                                        |
| anticipation_calendar_days_daily_percentage | Monthly early-payment discount percentage, based on calendar days       |
| anticipation_workdays_daily_percentage      | Annual early-payment discount percentage, based on workdays             |

### payer_data and guarantor_data Objects {#objetos-payer_data-e-guarantor_data}

| Field                     | Type   | Description                                                | Characters|
|---------------------------|--------|-------------------------------------|-----------------------------------------------------------|
| `name` *                  | string | Full name                           | 100                                                       |
| `document_number` *       | string | Document number (CPF/CNPJ)          | 11 or 14                                                  |
| `person_type` *           | string | Person type (natural or legal)      | **[person_type Enumerators](#enumeradores-person_type)** |
| `contact`                 | object | Contact information                 | **[contact Object](#objeto-contact)**                     |
| `address`                 | object | Address                             | **[address Object](#objeto-address)**                     |

### person_type Enumerators {#enumeradores-person_type}

| Enumerator         | Description           |
|--------------------|-----------------------|
| natural            | natural person        |
| legal              | legal entity          |

### contact Object {#objeto-contact}

| Field                     | Type   | Description                       | Characters                         |
|---------------------------|--------|-----------------------------------|------------------------------------|
| `email`                   | string | Contact email                     | 320                                |
| `phone`                   | object | Contact phone                     | **[phone Object](#objeto-phone)**  |

### phone Object {#objeto-phone}

| Field                           | Type   | Description                                  | Characters |
|---------------------------------|--------|----------------------------------------------|------------|
| `international_dial_code` *     | string | International dialing code (DDI)             | 3          |
| `area_code` *                   | string | Area code (DDD)                              | 2          |
| `number` *                      | string | Phone number                                 | 9          |

### address Object {#objeto-address}

| Field                     | Type   | Description                                  | Characters |
|---------------------------|--------|----------------------------------------------|------------|
| `street` *                | string | Street                                       | 500        |
| `number` *                | string | Number                                       | 6          |
| `complement`              | string | Complement                                   | 500        |
| `neighborhood` *          | string | Neighborhood                                 | 100        |
| `postal_code` *           | string | Postal code                                  | 8          |
| `city` *                  | string | City                                         | 100        |
| `state` *                 | string | State (UF) | **[state Enumerator](#enumeradores-state)** |

### state Enumerators {#enumeradores-state}

| Enumerator         | Description           |
|--------------------|-----------------------|
| AC                 | Acre                  |
| AL                 | Alagoas               |
| AM                 | Amazonas              |
| AP                 | Amapá                 |
| BA                 | Bahia                 |
| CE                 | Ceará                 |
| DF                 | Federal District      |
| ES                 | Espírito Santo        |
| GO                 | Goiás                 |
| MA                 | Maranhão              |
| MG                 | Minas Gerais          |
| MS                 | Mato Grosso do Sul    |
| MT                 | Mato Grosso           |
| PA                 | Pará                  |
| PB                 | Paraíba               |
| PE                 | Pernambuco            |
| PI                 | Piauí                 |
| PR                 | Paraná                |
| RJ                 | Rio de Janeiro        |
| RN                 | Rio Grande do Norte   |
| RO                 | Rondônia              |
| RR                 | Roraima               |
| RS                 | Rio Grande do Sul     |
| SC                 | Santa Catarina        |
| SE                 | Sergipe               |
| SP                 | São Paulo             |
| TO                 | Tocantins             |
| EX                 | Exception             |

### qr_code_data Object {#objeto-qr_code_data}
| Field                      | Type   | Description                                           | Characters              |
|----------------------------|--------|-------------------------------------------------------|-------------------------|
| `qr_code_key`              | uuidv4 | Unique QR Code identification key                     | 36                      |
| `pix_key`                  | uuidv4 | PIX key linked to the QR Code                         | 36                      |
| `receiver_conciliation_id` | uuidv4 | QR Code conciliation identifier                       | 36                      |
| `url`                      | string | QR Code URL (Pix Copy and Paste)                      | -                       |
| `image`                    | string | base64 of the QR Code URL (Pix Copy and Paste)        | -                       |

### payment_notice_data Object or array {#objeto-ou-array-payment_notice_data}

:::caution Warning!
The `payment_notice_data` field is returned as an **object** for bank slips without partial payment settings. For bank slips with partial payment settings, it is returned as an **array of objects**, since there may be multiple payments.
In addition, if the bank slip is paid via **QR Code**, this field will not be returned, since settlement occurs on the payment day.
:::

| Field                     | Type    | Description                                                                   | Characters                                                                                      |
|---------------------------|---------|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| `payment_method`      | string  | Payment method  | **[payment_method Enumerators](#enumeradores-payment_method)** |
| `payment_origin`      | string  | Payment origin       | **[payment_origin Enumerators](#enumeradores-payment_origin)** |
| `payment_notice_date`      | string | Payment notice date | 10

### payment_data Object or array {#objeto-ou-array-payment_data}

:::caution Warning!
The `payment_data` field is returned as an **object** for bank slips without partial payment settings. For bank slips with partial payment settings, it is returned as an **array of objects**, since there may be multiple payments.
:::

| Field                     | Type    | Description                                                                   | Characters                                                                                      |
|---------------------------|---------|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| `paid_amount`         | float  | Payment amount       | - |
| `paid_rebate_amount`       | float   | Paid rebate amount | -                                                                                               |
| `paid_discount_amount`      | float | Paid discount amount                    | -                                                                                               |
| `paid_fine_amount`      | float | Paid fine amount                    | -
| `paid_interest_amount`      | float | Paid interest amount                    | -
| `payment_method`      | string  | Payment method  | **[payment_method Enumerators](#enumeradores-payment_method)** |
| `payment_origin`      | string  | Payment origin       | **[payment_origin Enumerators](#enumeradores-payment_origin)** |
| `payment_credit_date`      | string | Payment credit date | 10
| `payment_bank`      | object | Bank where the bank slip was paid. Returned only after the bank slip is paid | **[payment_bank Object](#objeto-payment_bank)** |
| `payment_branch`      | string | Branch where the bank slip was paid. Returned only after the bank slip is paid | -

:::info Information
The `payment_bank` and `payment_branch` fields are only returned once the bank slip has been paid, i.e., when a confirmed payment occurrence exists. While the bank slip is unpaid, these fields will not be present in the response.
:::

### payment_bank Object {#objeto-payment_bank}

| Field  | Type    | Description                                | Characters |
|--------|---------|--------------------------------------------|------------|
| `code` | string  | Bank clearing code (3 digits)              | 3          |
| `ispb` | integer | Bank ISPB                                  | 8          |
| `name` | string  | Bank name                                  | -          |

### payment_method Enumerators {#enumeradores-payment_method}

| Enumerator         | Description                             |
|--------------------|-----------------------------------------|
| cash       | Cash                  |
| account_debit             | Account debit                |
| credit_card      | Credit card |
| check          | Check                  |

### payment_origin Enumerators

| Enumerator         | Description                             |
|--------------------|-----------------------------------------|
| cash       | Cash                  |
| account_debit             | Account debit                |
| credit_card      | Credit card |
| check          | Check                  |

### payment_origin Enumerators {#enumeradores-payment_origin}

| Enumerator           | Description                              |
|----------------------|------------------------------------------|
| phisical_cashier     | Branches - traditional locations         |
| taa                  | Self-service terminal                    |
| internet             | Internet (home/office bank)              |
| corban               | Banking correspondent                    |
| call_center          | Call center                              |
| eletronic_file       | Electronic file                          |
| dda                  | DDA                                      |
| digital_correspondent| Digital correspondent                    |
| qr_code              | Payment via Pix QR Code                  |

### bank_slip_occurrence Object {#objeto-bank_slip_occurrence}

| Field                   | Type   | Description                                                                       | Characters |
|-------------------------|--------|-----------------------------------------------------------------------------------|------------|
| `request_control_key` * | uuidv4 | Unique identification key of the request used by the client, in uuid v4 format    | 36         |
| `occurrence_key` *      | uuidv4 | Unique bank slip identification key, in uuid v4 format                            | 36         |
| `occurrence_type` *     | string | Occurrence type                                                                       | **[occurrence_type Enumerator](#enumeradores-occurrence_type)** |
| `occurrence_status` *   | string | Occurrence status                                                                     | **[occurrence_status Enumerator](#enumeradores-occurrence_status)** |
| `created_at` *          | string | Date, in ISO format (UTC - "YYYY-MM-DDTHH:MM:SSZ"), the occurrence was created     | 20         |

### occurrence_type Enumerators {#enumeradores-occurrence_type}

| Enumerator         | Description                             |
|--------------------|-----------------------------------------|
| registration       | Registration occurrence                 |
| write_off          | Write-off request occurrence            |
| rebate             | Rebate addition occurrence              |
| cancel_rebate      | Rebate cancellation occurrence          |
| discount           | Discount change occurrence              |
| fine               | Fine change occurrence                  |
| interest           | Interest change occurrence              |
| extension          | Extension occurrence                    |
| bank_slip_edit     | Occurrence of changes to other bank slip data |
| payment_notice     | Payment notice occurrence               |
| payment            | Payment settlement occurrence           |
| protest_request    | Protest request occurrence              |
| protest_request    | Bankruptcy protest request occurrence   |

### occurrence_status Enumerators {#enumeradores-occurrence_status}

| Enumerator         | Description                             |
|--------------------|-----------------------------------------|
| pending            | Sent to Nuclea/CIP for analysis         |
| rejected           | Rejected                                |
| confirmed          | Confirmed                               |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP code<br/>`status` | QI code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (ptbr)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 400                      | BKS000022            | Bad Request                                        | Requester profile is not opened.                                                              | Carteira não está aberta.                          |
| 404                      | BKS000029            | Not Found                                        | Bank slip not found for the given key (`{bank_slip_key}`).                                                              | Boleto não encontrado para a chave fornecida (`{bank_slip_key}`).                          |

---

# List Bank Slips

URL: /en/documentation/boletos/consulta/listar_boletos

The bank slip listing will return all bank slips from the wallet that fit the query parameters sent in the request.

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slips
METHOD GET

### Path parameters

| Field                   | Type   | Description                                                    | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format    | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key, in uuid v4 format | 36         |

### Query parameters

| Field                   | Type   | Description                                                    | Characters              |
|-------------------------|--------|--------------------------------------------------------------|-------------------------|
| `request_control_key`   | uuidv4 | Unique request identification key, in uuid v4 format  | 36                      |
| `bank_slip_key`         | uuidv4 | Unique bank slip identification key, in uuid v4 format   | 36                      |
| `bank_slip_status`      | string | Bank slip status | **[bank_slip_status Enumerators](#enumeradores-bank_slip_status)** |
| `page`                  | integer| Page number                                             | -                       |
| `page_size`             | integer| Page size                                            | -                       |
| `from_date`             | string | Initial registration date (format "YYYY-MM-DD")              | 10                      |
| `to_date`               | string | Final registration date (format "YYYY-MM-DD")                | 10                      |

### Enumeradores bank_slip_status

| Enumerator                   | Description                                                                      |
|------------------------------|--------------------------------------------------------------------------------|
| accepted                     | Accepted and sent to Nuclea/CIP for analysis                                |
| rejected                     | Registration rejected by Nuclea/CIP                                             |
| payment_notice               | Payment notice (bank slip paid but payment not yet settled)             |
| notary_office_payment_notice | Notary office payment notice (bank slip paid but payment not yet settled) |
| registered                   | Registration confirmed by Nuclea/CIP                                            |
| payment_blocked              | Blocked for payment (in protest flow)                                |
| paid                         | Paid                                                                           |
| written_off                  | Written off                                                                        |

## Response

STATUS 200

Response Body

```json
{
  "data": [
    {
      "bank_slip_key": "b58ce415-5428-45c4-8e33-b2df0d3ab6e8",
      "request_control_key": "53529224-330d-44b5-9f4d-59d55bc3cb8c",
      "our_number": 24384760943,
      "document_number": "DOC4561237",
      "amount": "8000.00",
      "rebate_amount": "200.00",
      "expiration": "2024-07-13",
      "barcode": "32994978900005000000001594438621284040114400",
      "digitable_line": "32990001529443862128940401144007497890000500000",
      "bank_teller_instructions": "Confirm payment",
      "protest_data": {
        "days_to_protest": 7
      },
      "bankruptcy_protest_data": {
        "days_to_bankruptcy_protest": 14
      },
      "max_payment_days": 45,
      "fine_data": {
        "fine_type": "absolute",
        "fine_amount": 100.0,
        "days_to_fine": 10
      },
      "interest_data": {
        "interest_type": "workdays_daily_amount",
        "interest_amount": 5.0,
        "days_to_interest": 10
      },
      "discounts_data": [
        {
          "discount_type": "anticipation_workdays_daily_percentage",
          "discount_number": 1,
          "discount_limit_date": "2024-07-13",
          "discount_percentage": 10
        }
      ],
      "payer_data": {
        "name": "Country Tech",
        "address": {
          "city": "Innovation City",
          "state": "RS",
          "number": "202",
          "street": "101 High St.",
          "complement": "Building A",
          "postal_code": "57099999",
          "neighborhood": "Tech Park"
        },
        "person_type": "legal",
        "document_number": "12345678000195"
      },
      "guarantor_data": {
        "name": "Jamie Doe",
        "address": {
          "city": "Peaceful Town",
          "state": "MG",
          "number": "303",
          "street": "202 Elm St.",
          "complement": "House 1",
          "postal_code": "57099999",
          "neighborhood": "Quiet Neighborhood"
        },
        "person_type": "natural",
        "document_number": "98765432100"
      },
      "bank_slip_status": "paid",
      "payment_data": {
        "paid_amount": 8000.0,
        "payment_credit_date": "2024-07-15",
        "payment_date": "2024-07-14"
      }
    }
  ],
  "pagination": {
    "current_page": 1,
    "rows_per_page": 100
  }
}
```

### Response Body Params

| Field            | Type         | Description                             | Characters                                  |
|------------------|--------------|---------------------------------------|---------------------------------------------|
| `data` *         | object array | Bank slips                               | **[bank_slip Object](#objeto-bank_slip)**   |
| `pagination` *   | object       | Pagination information              | **[pagination Object](#objeto-pagination)** |

### Objeto bank_slip

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------|
| `bank_slip_key      ` *    | uuidv4  | Unique bank slip identification key in uuid v4 format                          | 36                                                |
| `request_control_key` *    | uuidv4  | Unique request identification key used by the client in uuid v4 format  | 36                                                |
| `our_number` *             | integer | Unique identification number of the bank slip within the wallet                           | 11                                                |
| `bank_slip_status` *       | string | Bank slip status                                                                    | **[bank_slip_status Enumerators](#enumeradores-bank_slip_status)** |
| `protest_status` *         | string | Bank slip protest status at notary office                                          | **[protest_status Enumerators](#enumeradores-protest_status)** |
| `document_number` *        | string  | Bank slip identification number                                                  | 10                                                |
| `amount` *                 | float   | Bank slip base amount                                                               | -                                                 |
| `expiration` *             | string  | Due date                                                                 | 10                                                |
| `barcode` *               | string  | Bank slip barcode                                                         | 44                                                |
| `digitable_line` *         | string  | Bank slip digitable line                                                          | 47                                                |
| `bank_teller_instructions` | string  | Additional registration instructions, which will appear on the bank slip PDF                  | 320                                               |
| `rebate_amount`            | float   | Bank slip rebate amount, which will be applied on top of the base amount             | -                                                 |
| `max_payment_days` *      | integer | Maximum calendar days the bank slip will remain available for payment after due date (can be at most 365) | -          |
| `write_off_data`       | object  | Write-off configuration      | **[write_off_data Object](#objeto-write_off_settings)** |
| `protest_data`         | object  | Protest configuration       | **[protest_data Object](#objeto-protest_settings)** |
| `bankruptcy_protest_data` | object  | Bankruptcy protest configuration | **[bankruptcy_protest_data Object](#objeto-bankruptcy_protest_settings)** |
| `fine_data`            | object  | Fine configuration                 | **[fine_data Object](#objeto-fine_settings)** |
| `interest_data`        | object  | Interest configuration        | **[interest_data Object](#objeto-interest_settings)** |
| `discounts_data`           | object array | Discounts           | **[discount Object](#objeto-discounts_data)** |
| `payer_data` *             | object  | Payer data                                                                   | **[payer_data Object](#objetos-payer_data-e-guarantor_data)** |
| `guarantor_data` *         | object  | Guarantor data                                                          | **[guarantor_data Object](#objetos-payer_data-e-guarantor_data)** |

### Objeto pagination

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------------------|
| `current_page` *           | integer | Current page                                                 | -      |
| `rows_per_page` *          | integer | Items per page                                             | -      |

### Enumeradores protest_status

| Enumerator                   | Description                                                                      |
|------------------------------|--------------------------------------------------------------------------------|
| not_protested                | Bank slip without protest flow initiated                                          |
| protest_requested            | Notary office protest requested                                                |
| notary_office_entry          | Bank slip at notary office, in three-day period                                       |
| protest_cancel_requested     | Protest withdrawal requested                                             |
| notary_office_exit           | Bank slip left notary office                                                        |
| protested                    | Bank slip protested                                                              |
| paid_at_notary_office        | Paid at notary office                                                               |
| judicially_suspended         | Protest judicially suspended                                                |
| protest_remove_requested     | Protest removal requested                                                 |

### Objeto write_off_data

| Field                     | Type    | Description                                                                   | Characters |
|---------------------------|---------|-----------------------------------------------------------------------------|------------|
| `days_to_write_off` *     | integer | Days after due date for the bank slip to be automatically written off     | -          |

### Objeto protest_data

| Field                     | Type    | Description                                                                   | Characters |
|---------------------------|---------|-----------------------------------------------------------------------------|------------|
| `days_to_protest` *       | integer | Days after due date for the bank slip to be automatically protested  | -          |

### Objeto bankruptcy_protest_data

| Field                          | Type    | Description                                                                   | Characters  |
|--------------------------------|---------|-----------------------------------------------------------------------------|------------|
| `days_to_bankruptcy_protest` * | integer | Days after due date for the bank slip to be automatically protested  | -           |

### Objeto fine_data

Option 1: fine in absolute value (`fine_type=absolute`)

| Field                     | Type    | Description                                               | Characters                |
|---------------------------|---------|---------------------------------------------------------|-------------------------------------------------------------------------|
| `fine_type` *             | string  | Fine type                                                       | **[fine_type Enumerators](#enumeradores-fine_type)**                                              |
| `fine_amount` *           | float   | Fine absolute value                                             | -                                                                        |
| `days_to_fine` *          | integer | Days after due date for the fine to be charged              | -                                                                        |

Option 2: fine in percentage value (`fine_type=percentage`)

| Field                     | Type    | Description                                                 | Characters                             |
|---------------------------|---------|-----------------------------------------------------------|---------------------------------------|
| `fine_type` *             | string  | Fine type                                             | **[fine_type Enumerators](#enumeradores-fine_type)** |
| `fine_percentage` *       | integer | Fine percentage value, from 1 to 100                     | -                                      |
| `days_to_fine` *          | integer | Days after due date for the fine to be charged    | -                                      |

### Enumeradores fine_type

| Enumerator         | Description             |
|--------------------|-----------------------|
| absolute           | absolute value        |
| percentage         | percentage value      |

### Objeto interest_data

Option 1: interest using absolute values (`interest_type=calendar_days_daily_amount` or `interest_type=workdays_daily_amount`)

| Field                     | Type    | Description                                                                     | Characters                                                                                      |
|---------------------------|---------|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| `interest_type` *         | string  | Interest type       | **[interest_type Enumerators](#enumeradores-interest_type)** |
| `interest_amount` *       | float   | Amount to be charged per determined time unit (workdays or calendar days) | -                                                                                               |
| `days_to_interest` *      | integer | Days after due date to start charging interest                    | -                                                                                               |

Option 2: interest using percentage values (`interest_type=calendar_days_monthly_percentage`)

| Field                    | Type    | Description                                                                             | Characters                                                                                          |
|--------------------------|---------|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| `interest_type` *        | string  | Interest type       | **[interest_type Enumerators](#enumeradores-interest_type)** |
| `interest_percentage` *  | integer | Percentage to be charged per determined time unit (workdays or calendar days)                                                                      | -                                                                           |
| `days_to_interest` *     | integer | Days after due date to start charging interest                             | -                                                                                                   |

### Enumeradores interest_type

| Enumerator                       | Description                                                            |
|----------------------------------|----------------------------------------------------------------------|
| calendar_days_daily_amount       | Daily amount on calendar days                                     |
| workdays_daily_amount            | Daily amount on workdays                                        |
| calendar_days_monthly_percentage | Monthly interest percentage charged, based on calendar days |

### Objeto discount

Option 1: discounts using absolute values (`discount_type in ["absolute", "anticipation_calendar_days_daily_amount", "anticipation_workdays_daily_amount"]`)

| Field                     | Type    | Description                                           | Characters                                                |
|---------------------------|---------|-----------------------------------------------------|-----------------------------------------------------------|
| `discount_amount` *       | float   | Absolute discount value per time unit                                            | -                                                          |
| `discount_number` *       | integer | Discount number                                     | -                                                         |
| `discount_type` *         | string  | Discount configuration in absolute values                                    | **[discount_type Enumerator](#enumeradores-discount_type)** |                                                       |
| `discount_limit_date` *   | string  | Limit date for discount application   | 10                                                        |

Option 2: discounts using percentage values (`discount_type in ["percentage", "anticipation_calendar_days_daily_percentage", "anticipation_workdays_daily_percentage"]`)

| Field                     | Type    | Description                                           | Characters                                                |
|---------------------------|---------|-----------------------------------------------------|-----------------------------------------------------------|
| `discount_percentage` *   | float   | Percentage discount value per time unit                                            | -                                                          |
| `discount_number` *       | integer | Discount number                                     | -                                                         |
| `discount_type` *         | string  | Discount configuration in percentage values                                    | **[discount_type Enumerator](#enumeradores-discount_type)** |                                                       |
| `discount_limit_date` *   | string  | Limit date for discount application   | 10                                                        |

:::caution Attention!
The bank slip can have up to three discounts, and all discounts must be of the same type , that is, they must have the same `discount_type`. Discounts must be numbered from 1 to 3, incrementally and starting necessarily at 1. That is, if two discounts are sent in the request, they must necessarily be numbered 1 and 2.
:::

### Enumeradores discount_type

| Enumerator                                  | Description                                                                |
|---------------------------------------------|--------------------------------------------------------------------------|
| absolute                                    | Fixed value                                                               |
| anticipation_calendar_days_daily_amount     | Daily anticipation discount value, on calendar days             |
| anticipation_workdays_daily_amount          | Daily anticipation discount value, on workdays                |
| percentage                                  | Fixed percentage                                                         |
| anticipation_calendar_days_daily_percentage | Monthly anticipation discount percentage, based on calendar days |
| anticipation_workdays_daily_percentage      | Annual anticipation discount percentage, based on workdays     |

### Objetos payer_data e guarantor_data

| Field                     | Type   | Description                                                  | Characters|
|---------------------------|--------|-------------------------------------|-----------------------------------------------------------|
| `name` *                  | string | Full name                       | 100                                                       |
| `document_number` *       | string | Document number (CPF/CNPJ)      | 11 or 14                                                  |
| `person_type` *           | string | Person type (natural or legal) | **[person_type Enumerators](#enumeradores-person_type)** |
| `contact`                 | object | Contact information              | **[contact Object](#objeto-contact)**                     |
| `address`                 | object | Address                            | **[address Object](#objeto-address)**                     |

### Enumeradores person_type

| Enumerator         | Description             |
|--------------------|-----------------------|
| natural            | natural person         |
| legal              | legal person       |

### Objeto contact

| Field                     | Type   | Description                         | Characters                         |
|---------------------------|--------|-----------------------------------|------------------------------------|
| `email`                   | string | Contact email                 | 320                                |
| `phone`                   | object | Contact phone               | **[phone Object](#objeto-phone)**  |

### Objeto phone

| Field                           | Type   | Description                                    | Characters |
|---------------------------------|--------|----------------------------------------------|------------|
| `international_dial_code` *     | string | International dialing code   | 3          |
| `area_code` *                   | string | Area code     | 2          |
| `number` *                      | string | Number                                  | 9          |

### Objeto address

| Field                     | Type   | Description                                    | Characters |
|---------------------------|--------|----------------------------------------------|------------|
| `street` *                | string | Street                                   | 500        |
| `number` *                | string | Number                                       | 6          |
| `complement`              | string | Complement                                  | 500        |
| `neighborhood` *          | string | Neighborhood                                       | 100        |
| `postal_code` *           | string | Postal code                                          | 8          |
| `city` *                  | string | City                                       | 100        |
| `state` *                 | string | State | **[state Enumerator](#enumeradores-state)** |

### Enumeradores state

| Enumerator         | Description             |
|--------------------|-----------------------|
| AC                 | Acre                  |
| AL                 | Alagoas               |
| AM                 | Amazonas              |
| AP                 | Amapá                 |
| BA                 | Bahia                 |
| CE                 | Ceará                 |
| DF                 | Distrito federal      |
| ES                 | Espírito Santo        |
| GO                 | Goiás                 |
| MA                 | Maranhão              |
| MG                 | Minas Gerais          |
| MS                 | Mato Grosso do Sul    |
| MT                 | Mato Grosso           |
| PA                 | Pará                  |
| PB                 | Paraíba               |
| PE                 | Pernambuco            |
| PI                 | Piauí                 |
| PR                 | Paraná                |
| RJ                 | Rio de Janeiro        |
| RN                 | Rio Grande do Norte   |
| RO                 | Rondônia              |
| RR                 | Roraima               |
| RS                 | Rio Grande do Sul     |
| SC                 | Santa Catarina        |
| SE                 | Sergipe               |
| SP                 | São Paulo             |
| TO                 | Tocantins             |
| EX                 | Exception               |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 403                      | BKS000005            | Forbidden                         | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 400                      | BKS000012            | Bad Request | Invalid integer value for page or size query string parameters. | Valor inválido para parâmetros de página ou tamanho de página. |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |

---

# Bank slip wallet inquiry

URL: /en/documentation/boletos/consultar_v1/consulta_de_carteira

## Request

ENDPOINT /bank_slip/requester_profiles
METHOD GET

## Response

STATUS 200

Response Body

```json
{
    "requester_profile_codes": [
        "329-09-0001-1467576",
        "329-09-0001-5747500",
        "329-09-0001-2730579",
        "329-09-0001-2359934"
    ]
}
```

---

# Query return file

URL: /en/documentation/boletos/consultar_v1/consultar_arquivo_retorno

:::info Warning
To ensure that the return file for the current day has updated information, verify that the day's information has been reconciled through polling as shown in [Return file reconciliation routine](/documentation/boletos/consultar/rotina_de_conciliacao_de_arquivo_retorno)
:::

## Request

ENDPOINT /bank_slip/requester_profile/ REQUESTER_PROFILE_CODE /cnab_files
METHOD GET

### Path params

| Field                      | Type   | Description                     | Characters |
|----------------------------|--------|---------------------------------|------------|
| `requester_profile_code` * | string | Collection portfolio code.      | 10         |

### Query params

| Field         | Type   | Description                        | Characters                                  |
|---------------|--------|------------------------------------|---------------------------------------------|
| `cnab_type` * | enum   | File Type                          | **[Enumerators](#enumerators-cnab_type)**  |
| `from` *      | string | Start of the period to be analyzed.| 10                                          |
| `to` *        | string | End of the period to be analyzed.  | 10                                          |

### Enumerators cnab_type

| Field               | Description    | 
|---------------------|----------------|
| requester_discharge | Return file    | 

## Response

STATUS 200

Response Body

```json
{
  "data": [
    {
      "cnab_key": "47361262-0853-4c51-9c2a-5284e0d8a5e1",
      "company_code": null,
      "created_at": "2020-05-06T11:04:25",
      "downloads": [],
      "file_size": "None",
      "filename": "CNAB.RET",
      "line_length": "400",
      "remitter_key": "ab871cc8-8369-4b72-95f1-b074b30c7208",
      "requester_profile_code": "329-01-0001-0000002",
      "type": {
        "created_at": "2019-03-12T12:59:32",
        "enumerator": "requester_discharge",
        "translation_path": "bank_slip.CNABFileType.requester_discharge"
      },
      "url": "https://linkparadownload.com/CNAB.RET",
      "version": "11"
    }
  ],
  "pagination": {
    "current_page": 1,
    "next_page": null,
    "rows_per_page": 100,
    "total_pages": 1,
    "total_rows": 1
  }
}

```

STATUS 400

Response Body

```json

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

```

---

# Query bank slip

URL: /en/documentation/boletos/consultar_v1/consultar_boleto

## Request

ENDPOINT /bank_slip/ BANK_SLIP_KEY
METHOD GET

### Path params

| Field | Type | Description | Characters |
|---|---|---|---|
| `bank_slip_key` *| string | Bank slip identification key | uuid key |

## Response

STATUS 200

Response Body

```json
{
    "amount": 3,
    "asset_type": {
        "created_at": "2019-02-01T16:44:11",
        "enumerator": "invoice",
        "translation_path": "bank_slip.AssetType.invoice"
    },
    "automatic_bankruptcy_protest": true,
    "automatic_protest": false,
    "automatic_write_off": false,
    "bank_slip_file": [],
    "bank_slip_key": "96b32f1a-c2bd-41a4-b4b1-a169235be68b",
    "bank_slip_status": {
        "created_at": "2019-02-01T16:44:07",
        "enumerator": "registered",
        "translation_path": "bank_slip.BankSlipStatus.registered"
    },
    "bank_teller_instructions": "Não aceitar após vencimento",
    "barcode": "32991918600000900000001090000000000457475000",
    "beneficiary_account_branch": "0001",
    "beneficiary_account_digit": "5",
    "beneficiary_account_key": "7cc3b1f7-8015-4073-8471-a3ba57e34975",
    "beneficiary_account_number": "5747500",
    "beneficiary_document_number": "12345678905",
    "beneficiary_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
    "beneficiary_name": "Greg Brown",
    "billing_account_key": "7cc3b1f7-8015-4073-8471-a3ba57e34975",
    "business_date_expiration": "2020-06-01",
    "created_at": "2020-05-15T21:00:25",
    "days_before_fine": null,
    "days_before_interest": null,
    "days_to_bankruptcy_protest": 1,
    "days_to_protest": null,
    "days_to_write_off": null,
    "digitable_line": "32990001039000000000104574750008191860000090000",
    "discount_limit_date": null,
    "discount_value": null,
    "discounts": [],
    "document_number": "123456/01",
    "expenses": [
        {
            "amount": 3.9,
            "created_at": "2022-11-19T10:42:47",
            "expense_key": "6f21f308-f6c6-4198-a8bc-bc0e853bb8b5",
            "paid": true,
            "reason": {
                "created_at": "2019-02-14T17:30:50",
                "reason_code": "Tarifa de registro",
                "translation_en_us": "Registration Fee",
                "translation_pt_br": "Tarifa de registro"
            },
            "subject": {
                "created_at": "2019-02-14T17:30:43",
                "enumerator": "requester",
                "translation_path": "bank_slip.AssetType.requester"
            },
            "subject_account_key": "9223d7ae-320a-411c-8ff4-861e054da4d4",
            "updated_at": "2022-11-19T10:46:31"
        }
    ],
    "expiration": "2020-06-01",
    "fine_percentage": 0.1,
    "guarantor_address": null,
    "guarantor_city": null,
    "guarantor_document": null,
    "guarantor_name": null,
    "guarantor_person_type": null,
    "guarantor_postal_code": "00000000",
    "guarantor_state": null,
    "has_protest_pending_feedback": false,
    "historical_our_number": 2,
    "institution_registration_date": null,
    "interest_daily_value": 0.34,
    "lock_origin_type": null,
    "max_payment_days": 180,
    "nfe_key": null,
    "nfe_url": null,
    "notary_office_number": null,
    "notary_office_protocol": null,
    "notification": [],
    "occurrences": [
        {
            "agent_type": "integration",
            "automatic_bankruptcy_protest": null,
            "automatic_protest": null,
            "automatic_write_off": null,
            "created_at": "2020-05-15T21:00:25",
            "discount_amount": null,
            "discounts": [],
            "fine_percentage": 2,
            "interest_daily_value": 0.34,
            "iof_amount": null,
            "new_bank_slip_status": {
                "created_at": "2019-02-14T17:30:39",
                "enumerator": "registered",
                "translation_path": "bank_slip.BankSlipStatus.registered"
            },
            "new_due_date": "2020-06-01",
            "new_protest_status": {
                "created_at": "2019-02-01T16:44:08",
                "enumerator": "not_protested",
                "translation_path": "bank_slip.ProtestStatus.not_protested"
            },
            "notary_office_number": null,
            "notary_office_protocol": null,
            "notification": [],
            "occurrence_expenses": null,
            "occurrence_feedback": {
                "created_at": "2019-02-14T17:30:46",
                "enumerator": "confirmed",
                "translation_path": "bank_slip.OccurrenceFeedback.confirmed"
            },
            "occurrence_key": "c3ab3e01-f198-4e7e-9e01-7a8091b8bd72",
            "occurrence_reasons": [],
            "occurrence_type": {
                "created_at": "2019-02-01T16:44:14",
                "enumerator": "registration",
                "translation_path": "bank_slip.OccurrenceType.registration"
            },
            "old_bank_slip_status": {
                "created_at": "2019-02-01T16:44:07",
                "enumerator": "accepted",
                "translation_path": "bank_slip.BankSlipStatus.accepted"
            },
            "old_due_date": null,
            "old_protest_status": null,
            "paid_amount": null,
            "paid_fine_amount": null,
            "paid_interest_amount": null,
            "payer_address": null,
            "payer_postal_code": null,
            "payment_bank": null,
            "payment_branch": null,
            "payment_credit_date": null,
            "payment_method": null,
            "payment_origin": null,
            "protest_confirmation": null,
            "protest_distribution_cost": null,
            "protest_electronic_cost": null,
            "protest_emolument": null,
            "protest_expenses": null,
            "protest_other_expenses": null,
            "protocol_date": null,
            "protocol_region": null,
            "rebate_amount": null,
            "registration_institution_occurrence_date": "2020-05-15",
            "registration_institution_occurrence_event": [
                {
                    "cnab_file": {
                        "cnab_key": "abfc9fba-28fb-4e75-afcb-f4647d7031bc",
                        "company_code": null,
                        "created_at": "2020-05-15T21:00:22",
                        "downloads": [],
                        "file_size": "None",
                        "filename": null,
                        "line_length": null,
                        "remitter_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
                        "requester_profile_code": null,
                        "type": {
                            "created_at": "2019-02-01T16:44:17",
                            "enumerator": "api_instruction",
                            "translation_path": "bank_slip.CNABFileType.api_instruction"
                        },
                        "url": null,
                        "version": null
                    },
                    "cnab_file_occurrence_order": 1,
                    "created_at": "2020-05-15T21:00:25",
                    "new_status": {
                        "created_at": "2019-02-01T16:44:15",
                        "enumerator": "waiting_submission",
                        "translation_path": "bank_slip.RegistrationInstitutionOccurrenceStatus.waiting_submission"
                    },
                    "old_status": null
                }
            ],
            "registration_institution_occurrence_status": {
                "created_at": "2019-02-01T16:44:15",
                "enumerator": "waiting_submission",
                "translation_path": "bank_slip.RegistrationInstitutionOccurrenceStatus.waiting_submission"
            },
            "requester_occurrence_event": [
                {
                    "cnab_file": {
                        "cnab_key": "abfc9fba-28fb-4e75-afcb-f4647d7031bc",
                        "company_code": null,
                        "created_at": "2020-05-15T21:00:22",
                        "downloads": [],
                        "file_size": "None",
                        "filename": null,
                        "line_length": null,
                        "remitter_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
                        "requester_profile_code": null,
                        "type": {
                            "created_at": "2019-02-01T16:44:17",
                            "enumerator": "api_instruction",
                            "translation_path": "bank_slip.CNABFileType.api_instruction"
                        },
                        "url": null,
                        "version": null
                    },
                    "cnab_file_occurrence_order": 1,
                    "created_at": "2020-05-15T21:00:25",
                    "new_status": {
                        "created_at": "2019-02-01T16:44:16",
                        "enumerator": "confirmed",
                        "translation_path": "bank_slip.RequesterOccurrenceStatus.confirmed"
                    },
                    "old_status": {
                        "created_at": "2019-02-01T16:44:16",
                        "enumerator": "accepted",
                        "translation_path": "bank_slip.RequesterOccurrenceStatus.accepted"
                    }
                }
            ],
            "requester_occurrence_status": {
                "created_at": "2019-02-01T16:44:16",
                "enumerator": "confirmed",
                "translation_path": "bank_slip.RequesterOccurrenceStatus.confirmed"
            },
            "selected_user_agent": null
        }
    ],
    "original_expiration": "2022-12-01",
    "our_number": 2,
    "paid_amount": null,
    "paid_fine_amount": null,
    "paid_interest_amount": null,
    "participant_control_number": null,
    "payer_account_digit": null,
    "payer_account_number": null,
    "payer_account_type": null,
    "payer_address": "Rua Carlos Tampaio, 112",
    "payer_bank": null,
    "payer_branch_digit": null,
    "payer_branch_number": null,
    "payer_document": "45508922008",
    "payer_name": "John Nobody",
    "payer_person_type": {
        "created_at": "2019-02-01T16:44:09",
        "enumerator": "natural",
        "translation_path": "bank_slip.PersonType.natural"
    },
    "payer_postal_code": "00000000",
    "payment_date": null,
    "printing_policy": {
        "created_at": "2019-02-01T16:44:10",
        "enumerator": "no_printing",
        "translation_path": "bank_slip.PrintingPolicy.no_printing"
    },
    "protest_status": {
        "created_at": "2019-02-01T16:44:08",
        "enumerator": "not_protested",
        "translation_path": "bank_slip.ProtestStatus.not_protested"
    },
    "protocol_date": null,
    "protocol_region": null,
    "qr_code": null,
    "rebate_amount": null,
    "reference_requester_profile_code": null,
    "registration_institution": {
        "created_at": "2020-03-26T19:36:16",
        "enumerator": "qi_scd",
        "febraban_code": "329",
        "remittance_sequence": 72,
        "settlement_resource_account_key": "3e46d266-4fdb-4fd2-b87a-3e3de366afd4"
    },
    "requester_profile": 1,
    "requester_profile_code": "329-01-0001-0067049",
    "requester_registration_date": "2020-05-15",
    "settlement_account_key": "9223d7ae-320a-411c-8ff4-861e054da4d4",
    "settlements": [],
    "tags": null
}
```

STATUS 400

Response Body

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

---

# Issue PDF

URL: /en/documentation/boletos/consultar_v1/emitir_pdf

## Request

ENDPOINT /bank_slip/2-way/ BANK_SLIP_KEY
METHOD GET

### Path params

| Field | Type | Description | Characters |
|---|---|---|---|
| `BANK_SLIP_KEY` *|  string | Bank slip identification key. | 10 |

## Response

STATUS 200

Response Body

```json
[
  {
    "barcode": "32998827300000003000001010000000000200670490",
    "created_at": "2020-05-19T18:46:41",
    "digitable_line": "32990001031000000000902006704908882730000000300",
    "url": "https://linkparadownload.com/arquivo.pdf"
  }
]
```

STATUS 400

Response Body

```json

    { }
    

```

---

# Francesinha

URL: /en/documentation/boletos/consultar_v1/francesinha

## Request

- ENDPOINT /bank_slip/little_french
- METHOD GET

### Body params

| Field | Type | Description | Characters |
|---|---|---|---|
| `requester_profile_code` *| string |  Wallet code. | 10 | 
| `date` | date |  Date for report generation, if null, the report date will be TODAY (Format YYYY-MM-DD). |  10 | 

## Response

status: 200

Body.json

    The francesinha response body will be an excel file encoded in base64.

status: 400

Body.json

```json

    { }
    

```

---

# List bank slips

URL: /en/documentation/boletos/consultar_v1/listar_boletos

## Request

ENDPOINT /bank_slip/person/ BENEFICIARY_KEY
METHOD GET

:::caution **Warning**

Note that in both examples the bank_slip_file list is empty. This means there is no pdf file for this bank slip. If the client wants a PDF copy of the bank slip, we will explain how to do it in the next steps.
:::

### Path params

| Field | Type | Description | Characters |
|---|---|---|---|
| `beneficiary_key` *| string | Beneficiary identification key | uuid key |

### Query params

| Field | Type | Description | Characters |
|---|---|---|---|
| `payer_document` | string | Payer document number | - |
| `bank_slip_status` | enum | Bank slip status. | **[Enumerators](#enumerators-bank_slip_status)** | 
| `requester_profile` | string | Bank slip portfolio number| - |
| `protest_status` | enum | Protest status. | **[Enumerators](#enumerators-protest_status)** |
| `from` | date | Bank slip creation start date. | 10 |
| `to` |  date | Bank slip creation end date. | 10 |
| `number_search` | string | Our number (our_number) or document number (document_number). | - |
| `page` | integer | Page to be queried >= 1. | - |
| `page_size` | integer | Maximum number of returned records \<\= 100. | - |

### Enumerators bank_slip_status
| Field | Description | 
|---|---|
| accepted | Bank slip in queue for registration | 
| rejected | Bank slip rejected | 
| registered | Bank slip registered (available for payment) | 
| payment_notice | Bank slip paid - but without financial settlement | 
| notary_office_payment_notice | rejected | 
| paid | Bank slip paid - written off with financial settlement. | 
| written_off | Bank slip written off without financial settlement. | 

### Enumerators protest_status
| Field | Description | 
|---|---|
| accepted | Bank slip in queue for registration | 

## Response

STATUS 200

Response Body

```json

{
  "data": [
    {
      "amount": 3,
      "asset_type": {
        "created_at": "2019-02-01T16:44:11",
        "enumerator": "invoice",
        "translation_path": "bank_slip.AssetType.invoice"
      },
      "automatic_bankruptcy_protest": true,
      "automatic_protest": false,
      "automatic_write_off": false,
      "bank_slip_file": [],
      "bank_slip_key": "96b32f1a-c2bd-41a4-b4b1-a169235be68b",
      "bank_slip_status": {
        "created_at": "2019-02-01T16:44:07",
        "enumerator": "accepted",
        "translation_path": "bank_slip.BankSlipStatus.accepted"
      },
      "bank_teller_instructions": "Não aceitar após vencimento",
      "beneficiary_account_branch": "0001",
      "beneficiary_account_key": "7cc3b1f7-8015-4073-8471-a3ba57e34975",
      "beneficiary_account_number": "67049",
      "beneficiary_document_number": "12345678905",
      "beneficiary_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
      "beneficiary_name": "Greg Brown",
      "billing_account_key": "7cc3b1f7-8015-4073-8471-a3ba57e34975",
      "business_date_expiration": "2020-06-01",
      "created_at": "2020-05-15T21:00:25",
      "days_before_fine": null,
      "days_before_interest": null,
      "days_to_bankruptcy_protest": 1,
      "days_to_protest": null,
      "days_to_write_off": null,
      "discount_limit_date": null,
      "discount_value": null,
      "document_number": "123456/01",
      "expenses": [],
      "expiration": "2020-06-01",
      "fine_percentage": 0.1,
      "guarantor_address": null,
      "guarantor_city": null,
      "guarantor_document": null,
      "guarantor_name": null,
      "guarantor_person_type": null,
      "guarantor_postal_code": "00000000",
      "guarantor_state": null,
      "historical_our_number": 2,
      "institution_registration_date": null,
      "interest_daily_value": 0.34,
      "lock_origin_type": null,
      "nfe_key": null,
      "nfe_url": null,
      "occurrences": [
        {
          "created_at": "2020-05-15T21:00:25",
          "discount_amount": null,
          "discount_limit_date": null,
          "iof_amount": null,
          "new_bank_slip_status": null,
          "new_due_date": "2020-06-01",
          "new_protest_status": {
            "created_at": "2019-02-01T16:44:08",
            "enumerator": "not_protested",
            "translation_path": "bank_slip.ProtestStatus.not_protested"
          },
          "notary_office_number": null,
          "notary_office_protocol": null,
          "occurrence_expenses": null,
          "occurrence_feedback": null,
          "occurrence_key": "c3ab3e01-f198-4e7e-9e01-7a8091b8bd72",
          "occurrence_reasons": [],
          "occurrence_type": {
            "created_at": "2019-02-01T16:44:14",
            "enumerator": "registration",
            "translation_path": "bank_slip.OccurrenceType.registration"
          },
          "old_bank_slip_status": {
            "created_at": "2019-02-01T16:44:07",
            "enumerator": "accepted",
            "translation_path": "bank_slip.BankSlipStatus.accepted"
          },
          "old_due_date": null,
          "old_protest_status": null,
          "paid_amount": null,
          "paid_fine_amount": null,
          "paid_interest_amount": null,
          "payment_bank": null,
          "payment_branch": null,
          "payment_credit_date": null,
          "payment_method": null,
          "payment_origin": null,
          "protest_confirmation": null,
          "protest_expenses": null,
          "rebate_amount": null,
          "registration_institution_occurrence_date": "2020-05-15",
          "registration_institution_occurrence_event": [
            {
              "cnab_file": {
                "cnab_key": "abfc9fba-28fb-4e75-afcb-f4647d7031bc",
                "company_code": null,
                "created_at": "2020-05-15T21:00:22",
                "downloads": [],
                "file_size": "None",
                "filename": null,
                "line_length": null,
                "remitter_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
                "requester_profile_code": null,
                "type": {
                  "created_at": "2019-02-01T16:44:17",
                  "enumerator": "api_instruction",
                  "translation_path": "bank_slip.CNABFileType.api_instruction"
                },
                "url": null,
                "version": null
              },
              "cnab_file_occurrence_order": 1,
              "created_at": "2020-05-15T21:00:25",
              "new_status": {
                "created_at": "2019-02-01T16:44:15",
                "enumerator": "waiting_submission",
                "translation_path": "bank_slip.RegistrationInstitutionOccurrenceStatus.waiting_submission"
              },
              "old_status": null
            }
          ],
          "registration_institution_occurrence_status": {
            "created_at": "2019-02-01T16:44:15",
            "enumerator": "waiting_submission",
            "translation_path": "bank_slip.RegistrationInstitutionOccurrenceStatus.waiting_submission"
          },
          "requester_occurrence_event": [
            {
              "cnab_file": {
                "cnab_key": "abfc9fba-28fb-4e75-afcb-f4647d7031bc",
                "company_code": null,
                "created_at": "2020-05-15T21:00:22",
                "downloads": [],
                "file_size": "None",
                "filename": null,
                "line_length": null,
                "remitter_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
                "requester_profile_code": null,
                "type": {
                  "created_at": "2019-02-01T16:44:17",
                  "enumerator": "api_instruction",
                  "translation_path": "bank_slip.CNABFileType.api_instruction"
                },
                "url": null,
                "version": null
              },
              "cnab_file_occurrence_order": 1,
              "created_at": "2020-05-15T21:00:25",
              "new_status": {
                "created_at": "2019-02-01T16:44:16",
                "enumerator": "accepted",
                "translation_path": "bank_slip.RequesterOccurrenceStatus.accepted"
              },
              "old_status": null
            }
          ],
          "requester_occurrence_status": {
            "created_at": "2019-02-01T16:44:16",
            "enumerator": "accepted",
            "translation_path": "bank_slip.RequesterOccurrenceStatus.accepted"
          }
        }
      ],
      "our_number": 2,
      "paid_amount": null,
      "paid_fine_amount": null,
      "paid_interest_amount": null,
      "participant_control_number": null,
      "payer_account_digit": null,
      "payer_account_number": null,
      "payer_account_type": null,
      "payer_address": "Rua Carlos Tampaio, 112",
      "payer_bank": null,
      "payer_branch_digit": null,
      "payer_branch_number": null,
      "payer_document": "45508922008",
      "payer_name": "John Nobody",
      "payer_person_type": {
        "created_at": "2019-02-01T16:44:09",
        "enumerator": "natural",
        "translation_path": "bank_slip.PersonType.natural"
      },
      "payer_postal_code": "00000000",
      "payment_date": null,
      "printing_policy": {
        "created_at": "2019-02-01T16:44:10",
        "enumerator": "no_printing",
        "translation_path": "bank_slip.PrintingPolicy.no_printing"
      },
      "protest_status": {
        "created_at": "2019-02-01T16:44:08",
        "enumerator": "not_protested",
        "translation_path": "bank_slip.ProtestStatus.not_protested"
      },
      "rebate_amount": null,
      "registration_institution": {
        "created_at": "2020-03-26T19:36:16",
        "enumerator": "qi_scd",
        "febraban_code": "329",
        "remittance_sequence": 72,
        "settlement_resource_account_key": "3e46d266-4fdb-4fd2-b87a-3e3de366afd4"
      },
      "requester_profile": 1,
      "requester_profile_code": "329-01-0001-0067049",
      "requester_registration_date": "2020-05-15"
    }
  ],
  "pagination": {
    "current_page": 1,
    "next_page": null,
    "rows_per_page": 100,
  },
  "totals": {
    "delayed_bank_slip_amount": 0,
    "delayed_bank_slip_number": 0,
    "due_bank_slip_amount": 3,
    "due_bank_slip_number": 2,
    "paid_bank_slip_amount": 0,
    "paid_bank_slip_number": 0,
    "total_bank_slip_amount": 3,
    "total_bank_slip_number": 1,
    "written_off_bank_slip_amount": 0,
    "written_off_bank_slip_number": 0
  }
}
```

STATUS 400

Response Body

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

:::danger General Observations:
- The maximum page size (page_size) is 100.
- If the number of records returned on the current page is less than page_size, the next_page attribute will be null.
:::

---

# Daily position report in Excel

URL: /en/documentation/boletos/consultar_v1/posicao_diaria_excel

## Request

ENDPOINT /bank_slip/duplicates_balance_excel
METHOD GET

:::caution Attention
The response body of this request will be an Excel file encoded in base64.
:::

### Query params

| Field | Type | Description | Characters |
|---|---|---|---|
| `beneficiary_key` | string | Beneficiary identification key (required if there is no requester_profile_code). | uuid key | 
| `requester_profile_code` | string | Wallet code (required if there is no beneficiary_key). | 10 | 
| `expiration_date` | date | Maximum expiration date (Format YYYY-MM-DD). | 10 | 

## Response

STATUS 200

Response Body

```json

O body de resposta desta request será um arquivo excel encodado em base64.

```

STATUS 400

Response Body

```json

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

---

# Daily position report in JSON

URL: /en/documentation/boletos/consultar_v1/posicao_diaria_json

## Request

ENDPOINT /bank_slip/duplicates_balance
METHOD GET

### Query params

| Field | Type | Description | Characters |
|---|---|---|---|
| `beneficiary_key` | string | Beneficiary identification key (required if there is no requester_profile_code). | 10 | 
| `requester_profile_code` | string | Wallet code (required if there is no beneficiary_key). | 10 | 
| `expiration_date` | date | Maximum expiration date (Format YYYY-MM-DD). | 10 | 

## Response

STATUS 200

Response Body

```json

{
  "expire_after_90_days": 0,
  "expire_between_31_and_60_days": 0,
  "expire_between_61_and_90_days": 0,
  "expire_in_30_days": 0,
  "expired": 3,
  "expired_in_notary_office": 0,
  "expired_not_in_notary_office": 0,
  "paid": 0,
  "paid_after_due_date": 2,
  "paid_before_due_date": 0,
  "paid_on_due_date": 0,
  "to_expire": 0,
  "unpaid": 0
}
    

```

STATUS 400

Response Body

```json

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

```

---

# Return file reconciliation routine

URL: /en/documentation/boletos/consultar_v1/rotina_de_conciliacao_de_arquivo_retorno

Daily reconciliation of returns occurs for bank slips. To ensure that the day's data is updated,
use the endpoint specified on this page to verify if the return files are available for
consultation. We recommend that polling be done at a frequency no greater than one request every 2 minutes.

## Request

ENDPOINT /bank_slip/cnab_discharge_status
METHOD GET

## Response

STATUS 200

Response Body: Routine completed

```json
{
  "discharge_ready": true
}
```

Response Body: Routine pending

```json
{
  "discharge_ready": false
}
```

---

# Solicitar 2ª via de boleto

URL: /en/documentation/boletos/consultar_v1/segunda_via_de_boleto

## Request

ENDPOINT /bank_slip/2-way/ BANK_SLIP_KEY
MÉTODO POST

### Path parameters

| Campo                   | Tipo   | Descrição                                                    | Caracteres |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `bank_slip_key`         | uuidv4 | Chave única de identificação do boleto, no formato uuid v4   | 36         |

## Response

STATUS 200

Response Body

```json
{
  "amount": 3,
  "asset_type": {
    "created_at": "2019-02-01T16:44:11",
    "enumerator": "invoice",
    "translation_path": "bank_slip.AssetType.invoice"
  },
  "automatic_bankruptcy_protest": true,
  "automatic_protest": false,
  "automatic_write_off": false,
  "bank_slip_file": [
    {
      "barcode": "32998827300000003000001010000000000200670490",
      "created_at": "2020-05-19T18:46:41",
      "digitable_line": "32990001031000000000902006704908882730000000300",
      "url": "https://linkparadownload.com/arquivo.pdf"
    }
  ],
  "bank_slip_key": "96b32f1a-c2bd-41a4-b4b1-a169235be68b",
  "bank_slip_status": {
    "created_at": "2019-02-01T16:44:07",
    "enumerator": "accepted",
    "translation_path": "bank_slip.BankSlipStatus.accepted"
  },
  "bank_teller_instructions": "Boleto Teste",
  "beneficiary_account_branch": "0001",
  "beneficiary_account_key": "7cc3b1f7-8015-4073-8471-a3ba57e34975",
  "beneficiary_account_number": "67049",
  "beneficiary_document_number": "12345678905",
  "beneficiary_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
  "beneficiary_name": "Greg Brown",
  "billing_account_key": "7cc3b1f7-8015-4073-8471-a3ba57e34975",
  "business_date_expiration": "2020-06-01",
  "created_at": "2020-05-15T21:00:25",
  "days_before_fine": null,
  "days_before_interest": null,
  "days_to_bankruptcy_protest": 1,
  "days_to_protest": null,
  "days_to_write_off": null,
  "discount_limit_date": null,
  "discount_value": null,
  "document_number": "Parcela 1",
  "expenses": [],
  "expiration": "2020-06-01",
  "fine_percentage": 0.1,
  "guarantor_address": null,
  "guarantor_city": null,
  "guarantor_document": null,
  "guarantor_name": null,
  "guarantor_person_type": null,
  "guarantor_postal_code": "00000000",
  "guarantor_state": null,
  "historical_our_number": 2,
  "institution_registration_date": null,
  "interest_daily_value": 0.34,
  "lock_origin_type": null,
  "nfe_key": null,
  "nfe_url": null,
  "occurrences": [
    {
      "created_at": "2020-05-15T21:00:25",
      "discount_amount": null,
      "discount_limit_date": null,
      "iof_amount": null,
      "new_bank_slip_status": null,
      "new_due_date": "2020-06-01",
      "new_protest_status": {
        "created_at": "2019-02-01T16:44:08",
        "enumerator": "not_protested",
        "translation_path": "bank_slip.ProtestStatus.not_protested"
      },
      "notary_office_number": null,
      "notary_office_protocol": null,
      "occurrence_expenses": null,
      "occurrence_feedback": null,
      "occurrence_key": "c3ab3e01-f198-4e7e-9e01-7a8091b8bd72",
      "occurrence_reasons": [],
      "occurrence_type": {
        "created_at": "2019-02-01T16:44:14",
        "enumerator": "registration",
        "translation_path": "bank_slip.OccurrenceType.registration"
      },
      "old_bank_slip_status": {
        "created_at": "2019-02-01T16:44:07",
        "enumerator": "accepted",
        "translation_path": "bank_slip.BankSlipStatus.accepted"
      },
      "old_due_date": null,
      "old_protest_status": null,
      "paid_amount": null,
      "paid_fine_amount": null,
      "paid_interest_amount": null,
      "payment_bank": null,
      "payment_branch": null,
      "payment_credit_date": null,
      "payment_method": null,
      "payment_origin": null,
      "protest_confirmation": null,
      "protest_expenses": null,
      "rebate_amount": null,
      "registration_institution_occurrence_date": "2020-05-15",
      "registration_institution_occurrence_event": [
        {
          "cnab_file": {
            "cnab_key": "abfc9fba-28fb-4e75-afcb-f4647d7031bc",
            "company_code": null,
            "created_at": "2020-05-15T21:00:22",
            "downloads": [],
            "file_size": "None",
            "filename": null,
            "line_length": null,
            "remitter_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
            "requester_profile_code": null,
            "type": {
              "created_at": "2019-02-01T16:44:17",
              "enumerator": "api_instruction",
              "translation_path": "bank_slip.CNABFileType.api_instruction"
            },
            "url": null,
            "version": null
          },
          "cnab_file_occurrence_order": 1,
          "created_at": "2020-05-15T21:00:25",
          "new_status": {
            "created_at": "2019-02-01T16:44:15",
            "enumerator": "waiting_submission",
            "translation_path": "bank_slip.RegistrationInstitutionOccurrenceStatus.waiting_submission"
          },
          "old_status": null
        }
      ],
      "registration_institution_occurrence_status": {
        "created_at": "2019-02-01T16:44:15",
        "enumerator": "waiting_submission",
        "translation_path": "bank_slip.RegistrationInstitutionOccurrenceStatus.waiting_submission"
      },
      "requester_occurrence_event": [
        {
          "cnab_file": {
            "cnab_key": "abfc9fba-28fb-4e75-afcb-f4647d7031bc",
            "company_code": null,
            "created_at": "2020-05-15T21:00:22",
            "downloads": [],
            "file_size": "None",
            "filename": null,
            "line_length": null,
            "remitter_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
            "requester_profile_code": null,
            "type": {
              "created_at": "2019-02-01T16:44:17",
              "enumerator": "api_instruction",
              "translation_path": "bank_slip.CNABFileType.api_instruction"
            },
            "url": null,
            "version": null
          },
          "cnab_file_occurrence_order": 1,
          "created_at": "2020-05-15T21:00:25",
          "new_status": {
            "created_at": "2019-02-01T16:44:16",
            "enumerator": "accepted",
            "translation_path": "bank_slip.RequesterOccurrenceStatus.accepted"
          },
          "old_status": null
        }
      ],
      "requester_occurrence_status": {
        "created_at": "2019-02-01T16:44:16",
        "enumerator": "accepted",
        "translation_path": "bank_slip.RequesterOccurrenceStatus.accepted"
      }
    }
  ],
  "our_number": 2,
  "paid_amount": null,
  "paid_fine_amount": null,
  "paid_interest_amount": null,
  "participant_control_number": null,
  "payer_account_digit": null,
  "payer_account_number": null,
  "payer_account_type": null,
  "payer_address": "Rua Carlos tampaio, 204",
  "payer_bank": null,
  "payer_branch_digit": null,
  "payer_branch_number": null,
  "payer_document": "41651732825",
  "payer_name": "Beatriz Couto",
  "payer_person_type": {
    "created_at": "2019-02-01T16:44:09",
    "enumerator": "natural",
    "translation_path": "bank_slip.PersonType.natural"
  },
  "payer_postal_code": "00000000",
  "payment_date": null,
  "printing_policy": {
    "created_at": "2019-02-01T16:44:10",
    "enumerator": "no_printing",
    "translation_path": "bank_slip.PrintingPolicy.no_printing"
  },
  "protest_status": {
    "created_at": "2019-02-01T16:44:08",
    "enumerator": "not_protested",
    "translation_path": "bank_slip.ProtestStatus.not_protested"
  },
  "rebate_amount": null,
  "registration_institution": {
    "created_at": "2020-03-26T19:36:16",
    "enumerator": "qi_scd",
    "febraban_code": "329",
    "remittance_sequence": 72,
    "settlement_resource_account_key": "3e46d266-4fdb-4fd2-b87a-3e3de366afd4"
  },
  "requester_profile": 1,
  "requester_profile_code": "329-01-0001-0067049",
  "requester_registration_date": "2020-05-15"
}{
  "amount": 3,
  "asset_type": {
    "created_at": "2019-02-01T16:44:11",
    "enumerator": "invoice",
    "translation_path": "bank_slip.AssetType.invoice"
  },
  "automatic_bankruptcy_protest": true,
  "automatic_protest": false,
  "automatic_write_off": false,
  "bank_slip_file": [
    {
      "barcode": "32998827300000003000001010000000000200670490",
      "created_at": "2020-05-19T18:46:41",
      "digitable_line": "32990001031000000000902006704908882730000000300",
      "url": "https://linkparadownload.com/arquivo.pdf"
    }
  ],
  "bank_slip_key": "96b32f1a-c2bd-41a4-b4b1-a169235be68b",
  "bank_slip_status": {
    "created_at": "2019-02-01T16:44:07",
    "enumerator": "accepted",
    "translation_path": "bank_slip.BankSlipStatus.accepted"
  },
  "bank_teller_instructions": "Boleto Teste",
  "beneficiary_account_branch": "0001",
  "beneficiary_account_key": "7cc3b1f7-8015-4073-8471-a3ba57e34975",
  "beneficiary_account_number": "67049",
  "beneficiary_document_number": "12345678905",
  "beneficiary_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
  "beneficiary_name": "Greg Brown",
  "billing_account_key": "7cc3b1f7-8015-4073-8471-a3ba57e34975",
  "business_date_expiration": "2020-06-01",
  "created_at": "2020-05-15T21:00:25",
  "days_before_fine": null,
  "days_before_interest": null,
  "days_to_bankruptcy_protest": 1,
  "days_to_protest": null,
  "days_to_write_off": null,
  "discount_limit_date": null,
  "discount_value": null,
  "document_number": "Parcela 1",
  "expenses": [],
  "expiration": "2020-06-01",
  "fine_percentage": 0.1,
  "guarantor_address": null,
  "guarantor_city": null,
  "guarantor_document": null,
  "guarantor_name": null,
  "guarantor_person_type": null,
  "guarantor_postal_code": "00000000",
  "guarantor_state": null,
  "historical_our_number": 2,
  "institution_registration_date": null,
  "interest_daily_value": 0.34,
  "lock_origin_type": null,
  "nfe_key": null,
  "nfe_url": null,
  "occurrences": [
    {
      "created_at": "2020-05-15T21:00:25",
      "discount_amount": null,
      "discount_limit_date": null,
      "iof_amount": null,
      "new_bank_slip_status": null,
      "new_due_date": "2020-06-01",
      "new_protest_status": {
        "created_at": "2019-02-01T16:44:08",
        "enumerator": "not_protested",
        "translation_path": "bank_slip.ProtestStatus.not_protested"
      },
      "notary_office_number": null,
      "notary_office_protocol": null,
      "occurrence_expenses": null,
      "occurrence_feedback": null,
      "occurrence_key": "c3ab3e01-f198-4e7e-9e01-7a8091b8bd72",
      "occurrence_reasons": [],
      "occurrence_type": {
        "created_at": "2019-02-01T16:44:14",
        "enumerator": "registration",
        "translation_path": "bank_slip.OccurrenceType.registration"
      },
      "old_bank_slip_status": {
        "created_at": "2019-02-01T16:44:07",
        "enumerator": "accepted",
        "translation_path": "bank_slip.BankSlipStatus.accepted"
      },
      "old_due_date": null,
      "old_protest_status": null,
      "paid_amount": null,
      "paid_fine_amount": null,
      "paid_interest_amount": null,
      "payment_bank": null,
      "payment_branch": null,
      "payment_credit_date": null,
      "payment_method": null,
      "payment_origin": null,
      "protest_confirmation": null,
      "protest_expenses": null,
      "rebate_amount": null,
      "registration_institution_occurrence_date": "2020-05-15",
      "registration_institution_occurrence_event": [
        {
          "cnab_file": {
            "cnab_key": "abfc9fba-28fb-4e75-afcb-f4647d7031bc",
            "company_code": null,
            "created_at": "2020-05-15T21:00:22",
            "downloads": [],
            "file_size": "None",
            "filename": null,
            "line_length": null,
            "remitter_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
            "requester_profile_code": null,
            "type": {
              "created_at": "2019-02-01T16:44:17",
              "enumerator": "api_instruction",
              "translation_path": "bank_slip.CNABFileType.api_instruction"
            },
            "url": null,
            "version": null
          },
          "cnab_file_occurrence_order": 1,
          "created_at": "2020-05-15T21:00:25",
          "new_status": {
            "created_at": "2019-02-01T16:44:15",
            "enumerator": "waiting_submission",
            "translation_path": "bank_slip.RegistrationInstitutionOccurrenceStatus.waiting_submission"
          },
          "old_status": null
        }
      ],
      "registration_institution_occurrence_status": {
        "created_at": "2019-02-01T16:44:15",
        "enumerator": "waiting_submission",
        "translation_path": "bank_slip.RegistrationInstitutionOccurrenceStatus.waiting_submission"
      },
      "requester_occurrence_event": [
        {
          "cnab_file": {
            "cnab_key": "abfc9fba-28fb-4e75-afcb-f4647d7031bc",
            "company_code": null,
            "created_at": "2020-05-15T21:00:22",
            "downloads": [],
            "file_size": "None",
            "filename": null,
            "line_length": null,
            "remitter_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
            "requester_profile_code": null,
            "type": {
              "created_at": "2019-02-01T16:44:17",
              "enumerator": "api_instruction",
              "translation_path": "bank_slip.CNABFileType.api_instruction"
            },
            "url": null,
            "version": null
          },
          "cnab_file_occurrence_order": 1,
          "created_at": "2020-05-15T21:00:25",
          "new_status": {
            "created_at": "2019-02-01T16:44:16",
            "enumerator": "accepted",
            "translation_path": "bank_slip.RequesterOccurrenceStatus.accepted"
          },
          "old_status": null
        }
      ],
      "requester_occurrence_status": {
        "created_at": "2019-02-01T16:44:16",
        "enumerator": "accepted",
        "translation_path": "bank_slip.RequesterOccurrenceStatus.accepted"
      }
    }
  ],
  "our_number": 2,
  "paid_amount": null,
  "paid_fine_amount": null,
  "paid_interest_amount": null,
  "participant_control_number": null,
  "payer_account_digit": null,
  "payer_account_number": null,
  "payer_account_type": null,
  "payer_address": "Rua Carlos tampaio, 204",
  "payer_bank": null,
  "payer_branch_digit": null,
  "payer_branch_number": null,
  "payer_document": "41651732825",
  "payer_name": "Beatriz Couto",
  "payer_person_type": {
    "created_at": "2019-02-01T16:44:09",
    "enumerator": "natural",
    "translation_path": "bank_slip.PersonType.natural"
  },
  "payer_postal_code": "00000000",
  "payment_date": null,
  "printing_policy": {
    "created_at": "2019-02-01T16:44:10",
    "enumerator": "no_printing",
    "translation_path": "bank_slip.PrintingPolicy.no_printing"
  },
  "protest_status": {
    "created_at": "2019-02-01T16:44:08",
    "enumerator": "not_protested",
    "translation_path": "bank_slip.ProtestStatus.not_protested"
  },
  "rebate_amount": null,
  "registration_institution": {
    "created_at": "2020-03-26T19:36:16",
    "enumerator": "qi_scd",
    "febraban_code": "329",
    "remittance_sequence": 72,
    "settlement_resource_account_key": "3e46d266-4fdb-4fd2-b87a-3e3de366afd4"
  },
  "requester_profile": 1,
  "requester_profile_code": "329-01-0001-0067049",
  "requester_registration_date": "2020-05-15"
}{
  "amount": 3,
  "asset_type": {
    "created_at": "2019-02-01T16:44:11",
    "enumerator": "invoice",
    "translation_path": "bank_slip.AssetType.invoice"
  },
  "automatic_bankruptcy_protest": true,
  "automatic_protest": false,
  "automatic_write_off": false,
  "bank_slip_file": [
    {
      "barcode": "32998827300000003000001010000000000200670490",
      "created_at": "2020-05-19T18:46:41",
      "digitable_line": "32990001031000000000902006704908882730000000300",
      "url": "https://linkparadownload.com/arquivo.pdf"
    }
  ],
  "bank_slip_key": "96b32f1a-c2bd-41a4-b4b1-a169235be68b",
  "bank_slip_status": {
    "created_at": "2019-02-01T16:44:07",
    "enumerator": "accepted",
    "translation_path": "bank_slip.BankSlipStatus.accepted"
  },
  "bank_teller_instructions": "Boleto Teste",
  "beneficiary_account_branch": "0001",
  "beneficiary_account_key": "7cc3b1f7-8015-4073-8471-a3ba57e34975",
  "beneficiary_account_number": "67049",
  "beneficiary_document_number": "12345678905",
  "beneficiary_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
  "beneficiary_name": "Greg Brown",
  "billing_account_key": "7cc3b1f7-8015-4073-8471-a3ba57e34975",
  "business_date_expiration": "2020-06-01",
  "created_at": "2020-05-15T21:00:25",
  "days_before_fine": null,
  "days_before_interest": null,
  "days_to_bankruptcy_protest": 1,
  "days_to_protest": null,
  "days_to_write_off": null,
  "discount_limit_date": null,
  "discount_value": null,
  "document_number": "Parcela 1",
  "expenses": [],
  "expiration": "2020-06-01",
  "fine_percentage": 0.1,
  "guarantor_address": null,
  "guarantor_city": null,
  "guarantor_document": null,
  "guarantor_name": null,
  "guarantor_person_type": null,
  "guarantor_postal_code": "00000000",
  "guarantor_state": null,
  "historical_our_number": 2,
  "institution_registration_date": null,
  "interest_daily_value": 0.34,
  "lock_origin_type": null,
  "nfe_key": null,
  "nfe_url": null,
  "occurrences": [
    {
      "created_at": "2020-05-15T21:00:25",
      "discount_amount": null,
      "discount_limit_date": null,
      "iof_amount": null,
      "new_bank_slip_status": null,
      "new_due_date": "2020-06-01",
      "new_protest_status": {
        "created_at": "2019-02-01T16:44:08",
        "enumerator": "not_protested",
        "translation_path": "bank_slip.ProtestStatus.not_protested"
      },
      "notary_office_number": null,
      "notary_office_protocol": null,
      "occurrence_expenses": null,
      "occurrence_feedback": null,
      "occurrence_key": "c3ab3e01-f198-4e7e-9e01-7a8091b8bd72",
      "occurrence_reasons": [],
      "occurrence_type": {
        "created_at": "2019-02-01T16:44:14",
        "enumerator": "registration",
        "translation_path": "bank_slip.OccurrenceType.registration"
      },
      "old_bank_slip_status": {
        "created_at": "2019-02-01T16:44:07",
        "enumerator": "accepted",
        "translation_path": "bank_slip.BankSlipStatus.accepted"
      },
      "old_due_date": null,
      "old_protest_status": null,
      "paid_amount": null,
      "paid_fine_amount": null,
      "paid_interest_amount": null,
      "payment_bank": null,
      "payment_branch": null,
      "payment_credit_date": null,
      "payment_method": null,
      "payment_origin": null,
      "protest_confirmation": null,
      "protest_expenses": null,
      "rebate_amount": null,
      "registration_institution_occurrence_date": "2020-05-15",
      "registration_institution_occurrence_event": [
        {
          "cnab_file": {
            "cnab_key": "abfc9fba-28fb-4e75-afcb-f4647d7031bc",
            "company_code": null,
            "created_at": "2020-05-15T21:00:22",
            "downloads": [],
            "file_size": "None",
            "filename": null,
            "line_length": null,
            "remitter_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
            "requester_profile_code": null,
            "type": {
              "created_at": "2019-02-01T16:44:17",
              "enumerator": "api_instruction",
              "translation_path": "bank_slip.CNABFileType.api_instruction"
            },
            "url": null,
            "version": null
          },
          "cnab_file_occurrence_order": 1,
          "created_at": "2020-05-15T21:00:25",
          "new_status": {
            "created_at": "2019-02-01T16:44:15",
            "enumerator": "waiting_submission",
            "translation_path": "bank_slip.RegistrationInstitutionOccurrenceStatus.waiting_submission"
          },
          "old_status": null
        }
      ],
      "registration_institution_occurrence_status": {
        "created_at": "2019-02-01T16:44:15",
        "enumerator": "waiting_submission",
        "translation_path": "bank_slip.RegistrationInstitutionOccurrenceStatus.waiting_submission"
      },
      "requester_occurrence_event": [
        {
          "cnab_file": {
            "cnab_key": "abfc9fba-28fb-4e75-afcb-f4647d7031bc",
            "company_code": null,
            "created_at": "2020-05-15T21:00:22",
            "downloads": [],
            "file_size": "None",
            "filename": null,
            "line_length": null,
            "remitter_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
            "requester_profile_code": null,
            "type": {
              "created_at": "2019-02-01T16:44:17",
              "enumerator": "api_instruction",
              "translation_path": "bank_slip.CNABFileType.api_instruction"
            },
            "url": null,
            "version": null
          },
          "cnab_file_occurrence_order": 1,
          "created_at": "2020-05-15T21:00:25",
          "new_status": {
            "created_at": "2019-02-01T16:44:16",
            "enumerator": "accepted",
            "translation_path": "bank_slip.RequesterOccurrenceStatus.accepted"
          },
          "old_status": null
        }
      ],
      "requester_occurrence_status": {
        "created_at": "2019-02-01T16:44:16",
        "enumerator": "accepted",
        "translation_path": "bank_slip.RequesterOccurrenceStatus.accepted"
      }
    }
  ],
  "our_number": 2,
  "paid_amount": null,
  "paid_fine_amount": null,
  "paid_interest_amount": null,
  "participant_control_number": null,
  "payer_account_digit": null,
  "payer_account_number": null,
  "payer_account_type": null,
  "payer_address": "Rua Carlos tampaio, 204",
  "payer_bank": null,
  "payer_branch_digit": null,
  "payer_branch_number": null,
  "payer_document": "41651732825",
  "payer_name": "Beatriz Couto",
  "payer_person_type": {
    "created_at": "2019-02-01T16:44:09",
    "enumerator": "natural",
    "translation_path": "bank_slip.PersonType.natural"
  },
  "payer_postal_code": "00000000",
  "payment_date": null,
  "printing_policy": {
    "created_at": "2019-02-01T16:44:10",
    "enumerator": "no_printing",
    "translation_path": "bank_slip.PrintingPolicy.no_printing"
  },
  "protest_status": {
    "created_at": "2019-02-01T16:44:08",
    "enumerator": "not_protested",
    "translation_path": "bank_slip.ProtestStatus.not_protested"
  },
  "rebate_amount": null,
  "registration_institution": {
    "created_at": "2020-03-26T19:36:16",
    "enumerator": "qi_scd",
    "febraban_code": "329",
    "remittance_sequence": 72,
    "settlement_resource_account_key": "3e46d266-4fdb-4fd2-b87a-3e3de366afd4"
  },
  "requester_profile": 1,
  "requester_profile_code": "329-01-0001-0067049",
  "requester_registration_date": "2020-05-15"
}{
  "amount": 3,
  "asset_type": {
    "created_at": "2019-02-01T16:44:11",
    "enumerator": "invoice",
    "translation_path": "bank_slip.AssetType.invoice"
  },
  "automatic_bankruptcy_protest": true,
  "automatic_protest": false,
  "automatic_write_off": false,
  "bank_slip_file": [
    {
      "barcode": "32998827300000003000001010000000000200670490",
      "created_at": "2020-05-19T18:46:41",
      "digitable_line": "32990001031000000000902006704908882730000000300",
      "url": "https://linkparadownload.com/arquivo.pdf"
    }
  ],
  "bank_slip_key": "96b32f1a-c2bd-41a4-b4b1-a169235be68b",
  "bank_slip_status": {
    "created_at": "2019-02-01T16:44:07",
    "enumerator": "accepted",
    "translation_path": "bank_slip.BankSlipStatus.accepted"
  },
  "bank_teller_instructions": "Boleto Teste",
  "beneficiary_account_branch": "0001",
  "beneficiary_account_key": "7cc3b1f7-8015-4073-8471-a3ba57e34975",
  "beneficiary_account_number": "67049",
  "beneficiary_document_number": "12345678905",
  "beneficiary_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
  "beneficiary_name": "Greg Brown",
  "billing_account_key": "7cc3b1f7-8015-4073-8471-a3ba57e34975",
  "business_date_expiration": "2020-06-01",
  "created_at": "2020-05-15T21:00:25",
  "days_before_fine": null,
  "days_before_interest": null,
  "days_to_bankruptcy_protest": 1,
  "days_to_protest": null,
  "days_to_write_off": null,
  "discount_limit_date": null,
  "discount_value": null,
  "document_number": "Parcela 1",
  "expenses": [],
  "expiration": "2020-06-01",
  "fine_percentage": 0.1,
  "guarantor_address": null,
  "guarantor_city": null,
  "guarantor_document": null,
  "guarantor_name": null,
  "guarantor_person_type": null,
  "guarantor_postal_code": "00000000",
  "guarantor_state": null,
  "historical_our_number": 2,
  "institution_registration_date": null,
  "interest_daily_value": 0.34,
  "lock_origin_type": null,
  "nfe_key": null,
  "nfe_url": null,
  "occurrences": [
    {
      "created_at": "2020-05-15T21:00:25",
      "discount_amount": null,
      "discount_limit_date": null,
      "iof_amount": null,
      "new_bank_slip_status": null,
      "new_due_date": "2020-06-01",
      "new_protest_status": {
        "created_at": "2019-02-01T16:44:08",
        "enumerator": "not_protested",
        "translation_path": "bank_slip.ProtestStatus.not_protested"
      },
      "notary_office_number": null,
      "notary_office_protocol": null,
      "occurrence_expenses": null,
      "occurrence_feedback": null,
      "occurrence_key": "c3ab3e01-f198-4e7e-9e01-7a8091b8bd72",
      "occurrence_reasons": [],
      "occurrence_type": {
        "created_at": "2019-02-01T16:44:14",
        "enumerator": "registration",
        "translation_path": "bank_slip.OccurrenceType.registration"
      },
      "old_bank_slip_status": {
        "created_at": "2019-02-01T16:44:07",
        "enumerator": "accepted",
        "translation_path": "bank_slip.BankSlipStatus.accepted"
      },
      "old_due_date": null,
      "old_protest_status": null,
      "paid_amount": null,
      "paid_fine_amount": null,
      "paid_interest_amount": null,
      "payment_bank": null,
      "payment_branch": null,
      "payment_credit_date": null,
      "payment_method": null,
      "payment_origin": null,
      "protest_confirmation": null,
      "protest_expenses": null,
      "rebate_amount": null,
      "registration_institution_occurrence_date": "2020-05-15",
      "registration_institution_occurrence_event": [
        {
          "cnab_file": {
            "cnab_key": "abfc9fba-28fb-4e75-afcb-f4647d7031bc",
            "company_code": null,
            "created_at": "2020-05-15T21:00:22",
            "downloads": [],
            "file_size": "None",
            "filename": null,
            "line_length": null,
            "remitter_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
            "requester_profile_code": null,
            "type": {
              "created_at": "2019-02-01T16:44:17",
              "enumerator": "api_instruction",
              "translation_path": "bank_slip.CNABFileType.api_instruction"
            },
            "url": null,
            "version": null
          },
          "cnab_file_occurrence_order": 1,
          "created_at": "2020-05-15T21:00:25",
          "new_status": {
            "created_at": "2019-02-01T16:44:15",
            "enumerator": "waiting_submission",
            "translation_path": "bank_slip.RegistrationInstitutionOccurrenceStatus.waiting_submission"
          },
          "old_status": null
        }
      ],
      "registration_institution_occurrence_status": {
        "created_at": "2019-02-01T16:44:15",
        "enumerator": "waiting_submission",
        "translation_path": "bank_slip.RegistrationInstitutionOccurrenceStatus.waiting_submission"
      },
      "requester_occurrence_event": [
        {
          "cnab_file": {
            "cnab_key": "abfc9fba-28fb-4e75-afcb-f4647d7031bc",
            "company_code": null,
            "created_at": "2020-05-15T21:00:22",
            "downloads": [],
            "file_size": "None",
            "filename": null,
            "line_length": null,
            "remitter_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
            "requester_profile_code": null,
            "type": {
              "created_at": "2019-02-01T16:44:17",
              "enumerator": "api_instruction",
              "translation_path": "bank_slip.CNABFileType.api_instruction"
            },
            "url": null,
            "version": null
          },
          "cnab_file_occurrence_order": 1,
          "created_at": "2020-05-15T21:00:25",
          "new_status": {
            "created_at": "2019-02-01T16:44:16",
            "enumerator": "accepted",
            "translation_path": "bank_slip.RequesterOccurrenceStatus.accepted"
          },
          "old_status": null
        }
      ],
      "requester_occurrence_status": {
        "created_at": "2019-02-01T16:44:16",
        "enumerator": "accepted",
        "translation_path": "bank_slip.RequesterOccurrenceStatus.accepted"
      }
    }
  ],
  "our_number": 2,
  "paid_amount": null,
  "paid_fine_amount": null,
  "paid_interest_amount": null,
  "participant_control_number": null,
  "payer_account_digit": null,
  "payer_account_number": null,
  "payer_account_type": null,
  "payer_address": "Rua Carlos tampaio, 204",
  "payer_bank": null,
  "payer_branch_digit": null,
  "payer_branch_number": null,
  "payer_document": "41651732825",
  "payer_name": "Beatriz Couto",
  "payer_person_type": {
    "created_at": "2019-02-01T16:44:09",
    "enumerator": "natural",
    "translation_path": "bank_slip.PersonType.natural"
  },
  "payer_postal_code": "00000000",
  "payment_date": null,
  "printing_policy": {
    "created_at": "2019-02-01T16:44:10",
    "enumerator": "no_printing",
    "translation_path": "bank_slip.PrintingPolicy.no_printing"
  },
  "protest_status": {
    "created_at": "2019-02-01T16:44:08",
    "enumerator": "not_protested",
    "translation_path": "bank_slip.ProtestStatus.not_protested"
  },
  "rebate_amount": null,
  "registration_institution": {
    "created_at": "2020-03-26T19:36:16",
    "enumerator": "qi_scd",
    "febraban_code": "329",
    "remittance_sequence": 72,
    "settlement_resource_account_key": "3e46d266-4fdb-4fd2-b87a-3e3de366afd4"
  },
  "requester_profile": 1,
  "requester_profile_code": "329-01-0001-0067049",
  "requester_registration_date": "2020-05-15"
}{
  "amount": 3,
  "asset_type": {
    "created_at": "2019-02-01T16:44:11",
    "enumerator": "invoice",
    "translation_path": "bank_slip.AssetType.invoice"
  },
  "automatic_bankruptcy_protest": true,
  "automatic_protest": false,
  "automatic_write_off": false,
  "bank_slip_file": [
    {
      "barcode": "32998827300000003000001010000000000200670490",
      "created_at": "2020-05-19T18:46:41",
      "digitable_line": "32990001031000000000902006704908882730000000300",
      "url": "https://linkparadownload.com/arquivo.pdf"
    }
  ],
  "bank_slip_key": "96b32f1a-c2bd-41a4-b4b1-a169235be68b",
  "bank_slip_status": {
    "created_at": "2019-02-01T16:44:07",
    "enumerator": "accepted",
    "translation_path": "bank_slip.BankSlipStatus.accepted"
  },
  "bank_teller_instructions": "Boleto Teste",
  "beneficiary_account_branch": "0001",
  "beneficiary_account_key": "7cc3b1f7-8015-4073-8471-a3ba57e34975",
  "beneficiary_account_number": "67049",
  "beneficiary_document_number": "12345678905",
  "beneficiary_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
  "beneficiary_name": "Greg Brown",
  "billing_account_key": "7cc3b1f7-8015-4073-8471-a3ba57e34975",
  "business_date_expiration": "2020-06-01",
  "created_at": "2020-05-15T21:00:25",
  "days_before_fine": null,
  "days_before_interest": null,
  "days_to_bankruptcy_protest": 1,
  "days_to_protest": null,
  "days_to_write_off": null,
  "discount_limit_date": null,
  "discount_value": null,
  "document_number": "Parcela 1",
  "expenses": [],
  "expiration": "2020-06-01",
  "fine_percentage": 0.1,
  "guarantor_address": null,
  "guarantor_city": null,
  "guarantor_document": null,
  "guarantor_name": null,
  "guarantor_person_type": null,
  "guarantor_postal_code": "00000000",
  "guarantor_state": null,
  "historical_our_number": 2,
  "institution_registration_date": null,
  "interest_daily_value": 0.34,
  "lock_origin_type": null,
  "nfe_key": null,
  "nfe_url": null,
  "occurrences": [
    {
      "created_at": "2020-05-15T21:00:25",
      "discount_amount": null,
      "discount_limit_date": null,
      "iof_amount": null,
      "new_bank_slip_status": null,
      "new_due_date": "2020-06-01",
      "new_protest_status": {
        "created_at": "2019-02-01T16:44:08",
        "enumerator": "not_protested",
        "translation_path": "bank_slip.ProtestStatus.not_protested"
      },
      "notary_office_number": null,
      "notary_office_protocol": null,
      "occurrence_expenses": null,
      "occurrence_feedback": null,
      "occurrence_key": "c3ab3e01-f198-4e7e-9e01-7a8091b8bd72",
      "occurrence_reasons": [],
      "occurrence_type": {
        "created_at": "2019-02-01T16:44:14",
        "enumerator": "registration",
        "translation_path": "bank_slip.OccurrenceType.registration"
      },
      "old_bank_slip_status": {
        "created_at": "2019-02-01T16:44:07",
        "enumerator": "accepted",
        "translation_path": "bank_slip.BankSlipStatus.accepted"
      },
      "old_due_date": null,
      "old_protest_status": null,
      "paid_amount": null,
      "paid_fine_amount": null,
      "paid_interest_amount": null,
      "payment_bank": null,
      "payment_branch": null,
      "payment_credit_date": null,
      "payment_method": null,
      "payment_origin": null,
      "protest_confirmation": null,
      "protest_expenses": null,
      "rebate_amount": null,
      "registration_institution_occurrence_date": "2020-05-15",
      "registration_institution_occurrence_event": [
        {
          "cnab_file": {
            "cnab_key": "abfc9fba-28fb-4e75-afcb-f4647d7031bc",
            "company_code": null,
            "created_at": "2020-05-15T21:00:22",
            "downloads": [],
            "file_size": "None",
            "filename": null,
            "line_length": null,
            "remitter_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
            "requester_profile_code": null,
            "type": {
              "created_at": "2019-02-01T16:44:17",
              "enumerator": "api_instruction",
              "translation_path": "bank_slip.CNABFileType.api_instruction"
            },
            "url": null,
            "version": null
          },
          "cnab_file_occurrence_order": 1,
          "created_at": "2020-05-15T21:00:25",
          "new_status": {
            "created_at": "2019-02-01T16:44:15",
            "enumerator": "waiting_submission",
            "translation_path": "bank_slip.RegistrationInstitutionOccurrenceStatus.waiting_submission"
          },
          "old_status": null
        }
      ],
      "registration_institution_occurrence_status": {
        "created_at": "2019-02-01T16:44:15",
        "enumerator": "waiting_submission",
        "translation_path": "bank_slip.RegistrationInstitutionOccurrenceStatus.waiting_submission"
      },
      "requester_occurrence_event": [
        {
          "cnab_file": {
            "cnab_key": "abfc9fba-28fb-4e75-afcb-f4647d7031bc",
            "company_code": null,
            "created_at": "2020-05-15T21:00:22",
            "downloads": [],
            "file_size": "None",
            "filename": null,
            "line_length": null,
            "remitter_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
            "requester_profile_code": null,
            "type": {
              "created_at": "2019-02-01T16:44:17",
              "enumerator": "api_instruction",
              "translation_path": "bank_slip.CNABFileType.api_instruction"
            },
            "url": null,
            "version": null
          },
          "cnab_file_occurrence_order": 1,
          "created_at": "2020-05-15T21:00:25",
          "new_status": {
            "created_at": "2019-02-01T16:44:16",
            "enumerator": "accepted",
            "translation_path": "bank_slip.RequesterOccurrenceStatus.accepted"
          },
          "old_status": null
        }
      ],
      "requester_occurrence_status": {
        "created_at": "2019-02-01T16:44:16",
        "enumerator": "accepted",
        "translation_path": "bank_slip.RequesterOccurrenceStatus.accepted"
      }
    }
  ],
  "our_number": 2,
  "paid_amount": null,
  "paid_fine_amount": null,
  "paid_interest_amount": null,
  "participant_control_number": null,
  "payer_account_digit": null,
  "payer_account_number": null,
  "payer_account_type": null,
  "payer_address": "Rua Carlos tampaio, 204",
  "payer_bank": null,
  "payer_branch_digit": null,
  "payer_branch_number": null,
  "payer_document": "41651732825",
  "payer_name": "Beatriz Couto",
  "payer_person_type": {
    "created_at": "2019-02-01T16:44:09",
    "enumerator": "natural",
    "translation_path": "bank_slip.PersonType.natural"
  },
  "payer_postal_code": "00000000",
  "payment_date": null,
  "printing_policy": {
    "created_at": "2019-02-01T16:44:10",
    "enumerator": "no_printing",
    "translation_path": "bank_slip.PrintingPolicy.no_printing"
  },
  "protest_status": {
    "created_at": "2019-02-01T16:44:08",
    "enumerator": "not_protested",
    "translation_path": "bank_slip.ProtestStatus.not_protested"
  },
  "rebate_amount": null,
  "registration_institution": {
    "created_at": "2020-03-26T19:36:16",
    "enumerator": "qi_scd",
    "febraban_code": "329",
    "remittance_sequence": 72,
    "settlement_resource_account_key": "3e46d266-4fdb-4fd2-b87a-3e3de366afd4"
  },
  "requester_profile": 1,
  "requester_profile_code": "329-01-0001-0067049",
  "requester_registration_date": "2020-05-15"
}{
  "amount": 3,
  "asset_type": {
    "created_at": "2019-02-01T16:44:11",
    "enumerator": "invoice",
    "translation_path": "bank_slip.AssetType.invoice"
  },
  "automatic_bankruptcy_protest": true,
  "automatic_protest": false,
  "automatic_write_off": false,
  "bank_slip_file": [
    {
      "barcode": "32998827300000003000001010000000000200670490",
      "created_at": "2020-05-19T18:46:41",
      "digitable_line": "32990001031000000000902006704908882730000000300",
      "url": "https://linkparadownload.com/arquivo.pdf"
    }
  ],
  "bank_slip_key": "96b32f1a-c2bd-41a4-b4b1-a169235be68b",
  "bank_slip_status": {
    "created_at": "2019-02-01T16:44:07",
    "enumerator": "accepted",
    "translation_path": "bank_slip.BankSlipStatus.accepted"
  },
  "bank_teller_instructions": "Boleto Teste",
  "beneficiary_account_branch": "0001",
  "beneficiary_account_key": "7cc3b1f7-8015-4073-8471-a3ba57e34975",
  "beneficiary_account_number": "67049",
  "beneficiary_document_number": "12345678905",
  "beneficiary_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
  "beneficiary_name": "Greg Brown",
  "billing_account_key": "7cc3b1f7-8015-4073-8471-a3ba57e34975",
  "business_date_expiration": "2020-06-01",
  "created_at": "2020-05-15T21:00:25",
  "days_before_fine": null,
  "days_before_interest": null,
  "days_to_bankruptcy_protest": 1,
  "days_to_protest": null,
  "days_to_write_off": null,
  "discount_limit_date": null,
  "discount_value": null,
  "document_number": "Parcela 1",
  "expenses": [],
  "expiration": "2020-06-01",
  "fine_percentage": 0.1,
  "guarantor_address": null,
  "guarantor_city": null,
  "guarantor_document": null,
  "guarantor_name": null,
  "guarantor_person_type": null,
  "guarantor_postal_code": "00000000",
  "guarantor_state": null,
  "historical_our_number": 2,
  "institution_registration_date": null,
  "interest_daily_value": 0.34,
  "lock_origin_type": null,
  "nfe_key": null,
  "nfe_url": null,
  "occurrences": [
    {
      "created_at": "2020-05-15T21:00:25",
      "discount_amount": null,
      "discount_limit_date": null,
      "iof_amount": null,
      "new_bank_slip_status": null,
      "new_due_date": "2020-06-01",
      "new_protest_status": {
        "created_at": "2019-02-01T16:44:08",
        "enumerator": "not_protested",
        "translation_path": "bank_slip.ProtestStatus.not_protested"
      },
      "notary_office_number": null,
      "notary_office_protocol": null,
      "occurrence_expenses": null,
      "occurrence_feedback": null,
      "occurrence_key": "c3ab3e01-f198-4e7e-9e01-7a8091b8bd72",
      "occurrence_reasons": [],
      "occurrence_type": {
        "created_at": "2019-02-01T16:44:14",
        "enumerator": "registration",
        "translation_path": "bank_slip.OccurrenceType.registration"
      },
      "old_bank_slip_status": {
        "created_at": "2019-02-01T16:44:07",
        "enumerator": "accepted",
        "translation_path": "bank_slip.BankSlipStatus.accepted"
      },
      "old_due_date": null,
      "old_protest_status": null,
      "paid_amount": null,
      "paid_fine_amount": null,
      "paid_interest_amount": null,
      "payment_bank": null,
      "payment_branch": null,
      "payment_credit_date": null,
      "payment_method": null,
      "payment_origin": null,
      "protest_confirmation": null,
      "protest_expenses": null,
      "rebate_amount": null,
      "registration_institution_occurrence_date": "2020-05-15",
      "registration_institution_occurrence_event": [
        {
          "cnab_file": {
            "cnab_key": "abfc9fba-28fb-4e75-afcb-f4647d7031bc",
            "company_code": null,
            "created_at": "2020-05-15T21:00:22",
            "downloads": [],
            "file_size": "None",
            "filename": null,
            "line_length": null,
            "remitter_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
            "requester_profile_code": null,
            "type": {
              "created_at": "2019-02-01T16:44:17",
              "enumerator": "api_instruction",
              "translation_path": "bank_slip.CNABFileType.api_instruction"
            },
            "url": null,
            "version": null
          },
          "cnab_file_occurrence_order": 1,
          "created_at": "2020-05-15T21:00:25",
          "new_status": {
            "created_at": "2019-02-01T16:44:15",
            "enumerator": "waiting_submission",
            "translation_path": "bank_slip.RegistrationInstitutionOccurrenceStatus.waiting_submission"
          },
          "old_status": null
        }
      ],
      "registration_institution_occurrence_status": {
        "created_at": "2019-02-01T16:44:15",
        "enumerator": "waiting_submission",
        "translation_path": "bank_slip.RegistrationInstitutionOccurrenceStatus.waiting_submission"
      },
      "requester_occurrence_event": [
        {
          "cnab_file": {
            "cnab_key": "abfc9fba-28fb-4e75-afcb-f4647d7031bc",
            "company_code": null,
            "created_at": "2020-05-15T21:00:22",
            "downloads": [],
            "file_size": "None",
            "filename": null,
            "line_length": null,
            "remitter_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
            "requester_profile_code": null,
            "type": {
              "created_at": "2019-02-01T16:44:17",
              "enumerator": "api_instruction",
              "translation_path": "bank_slip.CNABFileType.api_instruction"
            },
            "url": null,
            "version": null
          },
          "cnab_file_occurrence_order": 1,
          "created_at": "2020-05-15T21:00:25",
          "new_status": {
            "created_at": "2019-02-01T16:44:16",
            "enumerator": "accepted",
            "translation_path": "bank_slip.RequesterOccurrenceStatus.accepted"
          },
          "old_status": null
        }
      ],
      "requester_occurrence_status": {
        "created_at": "2019-02-01T16:44:16",
        "enumerator": "accepted",
        "translation_path": "bank_slip.RequesterOccurrenceStatus.accepted"
      }
    }
  ],
  "our_number": 2,
  "paid_amount": null,
  "paid_fine_amount": null,
  "paid_interest_amount": null,
  "participant_control_number": null,
  "payer_account_digit": null,
  "payer_account_number": null,
  "payer_account_type": null,
  "payer_address": "Rua Carlos tampaio, 204",
  "payer_bank": null,
  "payer_branch_digit": null,
  "payer_branch_number": null,
  "payer_document": "41651732825",
  "payer_name": "Beatriz Couto",
  "payer_person_type": {
    "created_at": "2019-02-01T16:44:09",
    "enumerator": "natural",
    "translation_path": "bank_slip.PersonType.natural"
  },
  "payer_postal_code": "00000000",
  "payment_date": null,
  "printing_policy": {
    "created_at": "2019-02-01T16:44:10",
    "enumerator": "no_printing",
    "translation_path": "bank_slip.PrintingPolicy.no_printing"
  },
  "protest_status": {
    "created_at": "2019-02-01T16:44:08",
    "enumerator": "not_protested",
    "translation_path": "bank_slip.ProtestStatus.not_protested"
  },
  "rebate_amount": null,
  "registration_institution": {
    "created_at": "2020-03-26T19:36:16",
    "enumerator": "qi_scd",
    "febraban_code": "329",
    "remittance_sequence": 72,
    "settlement_resource_account_key": "3e46d266-4fdb-4fd2-b87a-3e3de366afd4"
  },
  "requester_profile": 1,
  "requester_profile_code": "329-01-0001-0067049",
  "requester_registration_date": "2020-05-15"
}{
  "amount": 3,
  "asset_type": {
    "created_at": "2019-02-01T16:44:11",
    "enumerator": "invoice",
    "translation_path": "bank_slip.AssetType.invoice"
  },
  "automatic_bankruptcy_protest": true,
  "automatic_protest": false,
  "automatic_write_off": false,
  "bank_slip_file": [
    {
      "barcode": "32998827300000003000001010000000000200670490",
      "created_at": "2020-05-19T18:46:41",
      "digitable_line": "32990001031000000000902006704908882730000000300",
      "url": "https://linkparadownload.com/arquivo.pdf"
    }
  ],
  "bank_slip_key": "96b32f1a-c2bd-41a4-b4b1-a169235be68b",
  "bank_slip_status": {
    "created_at": "2019-02-01T16:44:07",
    "enumerator": "accepted",
    "translation_path": "bank_slip.BankSlipStatus.accepted"
  },
  "bank_teller_instructions": "Boleto Teste",
  "beneficiary_account_branch": "0001",
  "beneficiary_account_key": "7cc3b1f7-8015-4073-8471-a3ba57e34975",
  "beneficiary_account_number": "67049",
  "beneficiary_document_number": "12345678905",
  "beneficiary_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
  "beneficiary_name": "Greg Brown",
  "billing_account_key": "7cc3b1f7-8015-4073-8471-a3ba57e34975",
  "business_date_expiration": "2020-06-01",
  "created_at": "2020-05-15T21:00:25",
  "days_before_fine": null,
  "days_before_interest": null,
  "days_to_bankruptcy_protest": 1,
  "days_to_protest": null,
  "days_to_write_off": null,
  "discount_limit_date": null,
  "discount_value": null,
  "document_number": "Parcela 1",
  "expenses": [],
  "expiration": "2020-06-01",
  "fine_percentage": 0.1,
  "guarantor_address": null,
  "guarantor_city": null,
  "guarantor_document": null,
  "guarantor_name": null,
  "guarantor_person_type": null,
  "guarantor_postal_code": "00000000",
  "guarantor_state": null,
  "historical_our_number": 2,
  "institution_registration_date": null,
  "interest_daily_value": 0.34,
  "lock_origin_type": null,
  "nfe_key": null,
  "nfe_url": null,
  "occurrences": [
    {
      "created_at": "2020-05-15T21:00:25",
      "discount_amount": null,
      "discount_limit_date": null,
      "iof_amount": null,
      "new_bank_slip_status": null,
      "new_due_date": "2020-06-01",
      "new_protest_status": {
        "created_at": "2019-02-01T16:44:08",
        "enumerator": "not_protested",
        "translation_path": "bank_slip.ProtestStatus.not_protested"
      },
      "notary_office_number": null,
      "notary_office_protocol": null,
      "occurrence_expenses": null,
      "occurrence_feedback": null,
      "occurrence_key": "c3ab3e01-f198-4e7e-9e01-7a8091b8bd72",
      "occurrence_reasons": [],
      "occurrence_type": {
        "created_at": "2019-02-01T16:44:14",
        "enumerator": "registration",
        "translation_path": "bank_slip.OccurrenceType.registration"
      },
      "old_bank_slip_status": {
        "created_at": "2019-02-01T16:44:07",
        "enumerator": "accepted",
        "translation_path": "bank_slip.BankSlipStatus.accepted"
      },
      "old_due_date": null,
      "old_protest_status": null,
      "paid_amount": null,
      "paid_fine_amount": null,
      "paid_interest_amount": null,
      "payment_bank": null,
      "payment_branch": null,
      "payment_credit_date": null,
      "payment_method": null,
      "payment_origin": null,
      "protest_confirmation": null,
      "protest_expenses": null,
      "rebate_amount": null,
      "registration_institution_occurrence_date": "2020-05-15",
      "registration_institution_occurrence_event": [
        {
          "cnab_file": {
            "cnab_key": "abfc9fba-28fb-4e75-afcb-f4647d7031bc",
            "company_code": null,
            "created_at": "2020-05-15T21:00:22",
            "downloads": [],
            "file_size": "None",
            "filename": null,
            "line_length": null,
            "remitter_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
            "requester_profile_code": null,
            "type": {
              "created_at": "2019-02-01T16:44:17",
              "enumerator": "api_instruction",
              "translation_path": "bank_slip.CNABFileType.api_instruction"
            },
            "url": null,
            "version": null
          },
          "cnab_file_occurrence_order": 1,
          "created_at": "2020-05-15T21:00:25",
          "new_status": {
            "created_at": "2019-02-01T16:44:15",
            "enumerator": "waiting_submission",
            "translation_path": "bank_slip.RegistrationInstitutionOccurrenceStatus.waiting_submission"
          },
          "old_status": null
        }
      ],
      "registration_institution_occurrence_status": {
        "created_at": "2019-02-01T16:44:15",
        "enumerator": "waiting_submission",
        "translation_path": "bank_slip.RegistrationInstitutionOccurrenceStatus.waiting_submission"
      },
      "requester_occurrence_event": [
        {
          "cnab_file": {
            "cnab_key": "abfc9fba-28fb-4e75-afcb-f4647d7031bc",
            "company_code": null,
            "created_at": "2020-05-15T21:00:22",
            "downloads": [],
            "file_size": "None",
            "filename": null,
            "line_length": null,
            "remitter_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
            "requester_profile_code": null,
            "type": {
              "created_at": "2019-02-01T16:44:17",
              "enumerator": "api_instruction",
              "translation_path": "bank_slip.CNABFileType.api_instruction"
            },
            "url": null,
            "version": null
          },
          "cnab_file_occurrence_order": 1,
          "created_at": "2020-05-15T21:00:25",
          "new_status": {
            "created_at": "2019-02-01T16:44:16",
            "enumerator": "accepted",
            "translation_path": "bank_slip.RequesterOccurrenceStatus.accepted"
          },
          "old_status": null
        }
      ],
      "requester_occurrence_status": {
        "created_at": "2019-02-01T16:44:16",
        "enumerator": "accepted",
        "translation_path": "bank_slip.RequesterOccurrenceStatus.accepted"
      }
    }
  ],
  "our_number": 2,
  "paid_amount": null,
  "paid_fine_amount": null,
  "paid_interest_amount": null,
  "participant_control_number": null,
  "payer_account_digit": null,
  "payer_account_number": null,
  "payer_account_type": null,
  "payer_address": "Rua Carlos tampaio, 204",
  "payer_bank": null,
  "payer_branch_digit": null,
  "payer_branch_number": null,
  "payer_document": "41651732825",
  "payer_name": "Beatriz Couto",
  "payer_person_type": {
    "created_at": "2019-02-01T16:44:09",
    "enumerator": "natural",
    "translation_path": "bank_slip.PersonType.natural"
  },
  "payer_postal_code": "00000000",
  "payment_date": null,
  "printing_policy": {
    "created_at": "2019-02-01T16:44:10",
    "enumerator": "no_printing",
    "translation_path": "bank_slip.PrintingPolicy.no_printing"
  },
  "protest_status": {
    "created_at": "2019-02-01T16:44:08",
    "enumerator": "not_protested",
    "translation_path": "bank_slip.ProtestStatus.not_protested"
  },
  "rebate_amount": null,
  "registration_institution": {
    "created_at": "2020-03-26T19:36:16",
    "enumerator": "qi_scd",
    "febraban_code": "329",
    "remittance_sequence": 72,
    "settlement_resource_account_key": "3e46d266-4fdb-4fd2-b87a-3e3de366afd4"
  },
  "requester_profile": 1,
  "requester_profile_code": "329-01-0001-0067049",
  "requester_registration_date": "2020-05-15"
}{
  "amount": 3,
  "asset_type": {
    "created_at": "2019-02-01T16:44:11",
    "enumerator": "invoice",
    "translation_path": "bank_slip.AssetType.invoice"
  },
  "automatic_bankruptcy_protest": true,
  "automatic_protest": false,
  "automatic_write_off": false,
  "bank_slip_file": [
    {
      "barcode": "32998827300000003000001010000000000200670490",
      "created_at": "2020-05-19T18:46:41",
      "digitable_line": "32990001031000000000902006704908882730000000300",
      "url": "https://linkparadownload.com/arquivo.pdf"
    }
  ],
  "bank_slip_key": "96b32f1a-c2bd-41a4-b4b1-a169235be68b",
  "bank_slip_status": {
    "created_at": "2019-02-01T16:44:07",
    "enumerator": "accepted",
    "translation_path": "bank_slip.BankSlipStatus.accepted"
  },
  "bank_teller_instructions": "Boleto Teste",
  "beneficiary_account_branch": "0001",
  "beneficiary_account_key": "7cc3b1f7-8015-4073-8471-a3ba57e34975",
  "beneficiary_account_number": "67049",
  "beneficiary_document_number": "12345678905",
  "beneficiary_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
  "beneficiary_name": "Greg Brown",
  "billing_account_key": "7cc3b1f7-8015-4073-8471-a3ba57e34975",
  "business_date_expiration": "2020-06-01",
  "created_at": "2020-05-15T21:00:25",
  "days_before_fine": null,
  "days_before_interest": null,
  "days_to_bankruptcy_protest": 1,
  "days_to_protest": null,
  "days_to_write_off": null,
  "discount_limit_date": null,
  "discount_value": null,
  "document_number": "Parcela 1",
  "expenses": [],
  "expiration": "2020-06-01",
  "fine_percentage": 0.1,
  "guarantor_address": null,
  "guarantor_city": null,
  "guarantor_document": null,
  "guarantor_name": null,
  "guarantor_person_type": null,
  "guarantor_postal_code": "00000000",
  "guarantor_state": null,
  "historical_our_number": 2,
  "institution_registration_date": null,
  "interest_daily_value": 0.34,
  "lock_origin_type": null,
  "nfe_key": null,
  "nfe_url": null,
  "occurrences": [
    {
      "created_at": "2020-05-15T21:00:25",
      "discount_amount": null,
      "discount_limit_date": null,
      "iof_amount": null,
      "new_bank_slip_status": null,
      "new_due_date": "2020-06-01",
      "new_protest_status": {
        "created_at": "2019-02-01T16:44:08",
        "enumerator": "not_protested",
        "translation_path": "bank_slip.ProtestStatus.not_protested"
      },
      "notary_office_number": null,
      "notary_office_protocol": null,
      "occurrence_expenses": null,
      "occurrence_feedback": null,
      "occurrence_key": "c3ab3e01-f198-4e7e-9e01-7a8091b8bd72",
      "occurrence_reasons": [],
      "occurrence_type": {
        "created_at": "2019-02-01T16:44:14",
        "enumerator": "registration",
        "translation_path": "bank_slip.OccurrenceType.registration"
      },
      "old_bank_slip_status": {
        "created_at": "2019-02-01T16:44:07",
        "enumerator": "accepted",
        "translation_path": "bank_slip.BankSlipStatus.accepted"
      },
      "old_due_date": null,
      "old_protest_status": null,
      "paid_amount": null,
      "paid_fine_amount": null,
      "paid_interest_amount": null,
      "payment_bank": null,
      "payment_branch": null,
      "payment_credit_date": null,
      "payment_method": null,
      "payment_origin": null,
      "protest_confirmation": null,
      "protest_expenses": null,
      "rebate_amount": null,
      "registration_institution_occurrence_date": "2020-05-15",
      "registration_institution_occurrence_event": [
        {
          "cnab_file": {
            "cnab_key": "abfc9fba-28fb-4e75-afcb-f4647d7031bc",
            "company_code": null,
            "created_at": "2020-05-15T21:00:22",
            "downloads": [],
            "file_size": "None",
            "filename": null,
            "line_length": null,
            "remitter_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
            "requester_profile_code": null,
            "type": {
              "created_at": "2019-02-01T16:44:17",
              "enumerator": "api_instruction",
              "translation_path": "bank_slip.CNABFileType.api_instruction"
            },
            "url": null,
            "version": null
          },
          "cnab_file_occurrence_order": 1,
          "created_at": "2020-05-15T21:00:25",
          "new_status": {
            "created_at": "2019-02-01T16:44:15",
            "enumerator": "waiting_submission",
            "translation_path": "bank_slip.RegistrationInstitutionOccurrenceStatus.waiting_submission"
          },
          "old_status": null
        }
      ],
      "registration_institution_occurrence_status": {
        "created_at": "2019-02-01T16:44:15",
        "enumerator": "waiting_submission",
        "translation_path": "bank_slip.RegistrationInstitutionOccurrenceStatus.waiting_submission"
      },
      "requester_occurrence_event": [
        {
          "cnab_file": {
            "cnab_key": "abfc9fba-28fb-4e75-afcb-f4647d7031bc",
            "company_code": null,
            "created_at": "2020-05-15T21:00:22",
            "downloads": [],
            "file_size": "None",
            "filename": null,
            "line_length": null,
            "remitter_key": "b91195e3-0cf4-4fed-90cf-7f5bef29c2f0",
            "requester_profile_code": null,
            "type": {
              "created_at": "2019-02-01T16:44:17",
              "enumerator": "api_instruction",
              "translation_path": "bank_slip.CNABFileType.api_instruction"
            },
            "url": null,
            "version": null
          },
          "cnab_file_occurrence_order": 1,
          "created_at": "2020-05-15T21:00:25",
          "new_status": {
            "created_at": "2019-02-01T16:44:16",
            "enumerator": "accepted",
            "translation_path": "bank_slip.RequesterOccurrenceStatus.accepted"
          },
          "old_status": null
        }
      ],
      "requester_occurrence_status": {
        "created_at": "2019-02-01T16:44:16",
        "enumerator": "accepted",
        "translation_path": "bank_slip.RequesterOccurrenceStatus.accepted"
      }
    }
  ],
  "our_number": 2,
  "paid_amount": null,
  "paid_fine_amount": null,
  "paid_interest_amount": null,
  "participant_control_number": null,
  "payer_account_digit": null,
  "payer_account_number": null,
  "payer_account_type": null,
  "payer_address": "Rua Carlos tampaio, 204",
  "payer_bank": null,
  "payer_branch_digit": null,
  "payer_branch_number": null,
  "payer_document": "41651732825",
  "payer_name": "Beatriz Couto",
  "payer_person_type": {
    "created_at": "2019-02-01T16:44:09",
    "enumerator": "natural",
    "translation_path": "bank_slip.PersonType.natural"
  },
  "payer_postal_code": "00000000",
  "payment_date": null,
  "printing_policy": {
    "created_at": "2019-02-01T16:44:10",
    "enumerator": "no_printing",
    "translation_path": "bank_slip.PrintingPolicy.no_printing"
  },
  "protest_status": {
    "created_at": "2019-02-01T16:44:08",
    "enumerator": "not_protested",
    "translation_path": "bank_slip.ProtestStatus.not_protested"
  },
  "rebate_amount": null,
  "registration_institution": {
    "created_at": "2020-03-26T19:36:16",
    "enumerator": "qi_scd",
    "febraban_code": "329",
    "remittance_sequence": 72,
    "settlement_resource_account_key": "3e46d266-4fdb-4fd2-b87a-3e3de366afd4"
  },
  "requester_profile": 1,
  "requester_profile_code": "329-01-0001-0067049",
  "requester_registration_date": "2020-05-15"
}
```

STATUS 400

Response Body

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

---

# Emissão de boleto único (instantânea)

URL: /en/documentation/boletos/emissao/emissao_boleto_unico_instantanea

:::danger Importante
Para registrar bolePix, é necessário que exista uma chave Pix aleatória ativa na conta em que os boletos serão registrados.
:::

No caso do registro de boleto único de forma instantânea, a resposta da requisição de criação (resposta síncrona) já retorna o boleto registrado (ou não, para casos de rejeição). O tempo de confirmação/rejeição da Nuclea/CIP, a respeito do registro do boleto, está incluso no tempo de resposta desse endpoint.

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip/instant
MÉTODO POST

### Path parameters

| Campo                   | Tipo   | Descrição                                                    | Caracteres |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Chave única de identificação da conta, no formato uuid v4    | 36         |
| `requester_profile_key` | uuidv4 | Chave única de identificação da carteira, no formato uuid v4 | 36         |

Request Body

```json
{
  "request_control_key": "0d496b4d-01f6-48cd-8ec9-9ead1e43f156",
  "our_number": 123456789,
  "document_number": "DOC4561237",
  "amount": 5000.00,
  "expiration": "2025-01-01",
  "bank_teller_instructions": "Confirm payment",
  "protest_data": {"days_to_protest": 7},
  "bankruptcy_protest_data": {"days_to_bankruptcy_protest": 14},
  "max_payment_days": 45,
  "fine_data": {"fine_type": "absolute", "fine_amount": 100.00, "days_to_fine": 10},
  "interest_data": {
    "interest_type": "workdays_daily_amount",
    "interest_amount": 10.00,
    "days_to_interest": 2,
  },
  "financial_instrument_type": "digital_commercial_invoice",
  "write_off_data": {"days_to_write_off": 365},
  "rebate_amount": 200.00,
  "discounts_data": [
    {
      "discount_amount": 50.00,
      "discount_number": 1,
      "discount_type": "absolute",
      "discount_limit_date": "2024-12-01",
    }
  ],
  "payer_data": {
    "name": "Global Tech",
    "contact": {
      "email": "finance@globaltech.com",
      "phone": {"country_code": "055", "area_code": "11", "number": "987654321"},
    },
    "address": {
      "street": "101 High St.",
      "neighborhood": "Tech Park",
      "number": "202",
      "postal_code": "01001000",
      "city": "Innovation City",
      "state": "SP",
      "complement": "Building A",
    },
    "document_number": "12345678000195",
    "person_type": "legal",
  },
  "guarantor_data": {
    "name": "Jane Doe",
    "contact": {
      "email": "jane.doe@qitech.com.br",
      "phone": {"country_code": "055", "area_code": "11", "number": "999999999"},
    },
    "address": {
      "street": "202 Elm St.",
      "neighborhood": "Quiet Neighborhood",
      "number": "303",
      "postal_code": "01001000",
      "city": "Peaceful Town",
      "state": "RJ",
      "complement": "House 1",
    },
    "document_number": "23456789012",
    "person_type": "natural",
  },
  "pix_key": "06797774-e050-419e-a91a-c64c919b52c7",
  "notification": {
    "document_number": "12345678000195",
    "name": "Global Tech",
    "email": "finance@globaltech.com",
    "phone": {"country_code": "055", "area_code": "11", "number": "987654321"},
    "send_2_way": true,
    "send_before_due_date": false,
    "send_after_due_date": false,
    "send_on_protest": false
  }
}
```

 
### Request Body Params

| Campo                      | Tipo    | Descrição                                                                          | Caracteres |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------|
| `request_control_key` *    | uuidv4  | Chave única de identificação da request utilizada pelo cliente no formato uuid v4  | 36                                                |
| `our_number`              | integer | Número único de identificação do boleto junto à carteira. Pode ser enviado pelo cliente e, caso não seja, a QI Tech irá gerar um                           | 11                                                |
| `document_number`          | string  | Número de identificação do boleto. Pode ser o número da nota fiscal eletrônica     | 10                                                |
| `participant_control_number` | string | Nº Controle do Participante                                                       |
25                                                |
| `amount` *                 | float   | Valor base do boleto                                                               | -                                                 |
| `expiration` *             | string  | Data de vencimento                                                                 | 10                                                |
| `bank_teller_instructions` | string  | Observações ao pagador do boleto. Aceita no máximo 320 caracteres, distribuídos em até 7 linhas. Cada linha pode conter no máximo 90 caracteres. Caso uma linha ultrapasse 90 caracteres, o texto será automaticamente quebrado em uma nova linha | 320                                               |
| `rebate_amount`            | float   | Valor de abatimento do boleto, que será aplicado em cima do valor base             | -                                                 |
| `max_payment_days`         | integer | Máximo de dias corridos que o boleto ficará disponível para pagamento, após o vencimento (pode ser no máximo 365) | -          |
| `financial_instrument_type`   | string  | Tipo de espécie do boleto | **[Enumeradores financial_instrument_type](#enumeradores-financial_instrument_type)** |
| `partial_payment_data`    | object  | Configurações de pagamento parcial                      | **[Objeto partial_payment_data](#objeto-partial_payment_data)** |
| `write_off_data`       | object  | Configuração de baixa      | **[Objeto write_off_data](#objeto-write_off_settings)** |
| `protest_data`         | object  | Configuração de protesto       | **[Objeto protest_data](#objeto-protest_settings)** |
| `bankruptcy_protest_data` | object  | Configuração de protesto falimentar | **[Objeto bankruptcy_protest_data](#objeto-bankruptcy_protest_settings)** |
| `fine_data`            | object  | Configuração de multa                 | **[Objeto fine_data](#objeto-fine_settings)** |
| `interest_data`        | object  | Configuração de juros        | **[Objeto interest_data](#objeto-interest_settings)** |
| `discounts_data`           | object array | Descontos           | **[Objeto discount](#objeto-discounts_data)** |
| `payer_data` *             | object  | Dados do pagador                                                                   | **[Objeto payer_data](#objetos-payer_data-e-guarantor_data)** |
| `guarantor_data`           | object  | Dados do sacador avalista                                                          | **[Objeto guarantor_data](#objetos-payer_data-e-guarantor_data)** |
| `pix_key`                  | uuidv4  | Chave pix do tipo aleatória                                                        | 36                                                |

:::info BolePix
Caso o parâmetro `pix_key`, opcional, seja enviado na request, será gerado um bolePix. BolePix é um boleto cujo pagamento é vinculado a um QR Code Pix. Sendo assim, o pagador pode realizar o pagamento do boleto tanto utilizando a linha digitável do mesmo, quanto através da leitura do QR Code Pix vinculado. Caso o pagamento seja feito via QR Code, a liquidação financeira se dá instantaneamente, enquanto os retornos bancários e webhooks envolvidos na liquidação serão gerados assim como é feito para um boleto comum.

Importante: para registrar um bolePix, é necessário que exista uma chave Pix aleatória ativa na conta em que boleto será registrado.
:::

:::tip Configurações Padrão da Carteira
Caso cada um dos campos `max_payment_days`, `write_off_data`, `protest_data`, `bankruptcy_protest_data`, `fine_data`, `interest_data` e `pix_key` não sejam enviados na request e a carteira possua configurações padrão (i.e. `max_payment_days`, `write_off_settings`, `protest_settings`, `bankruptcy_protest_settings`, `fine_settings`, `interest_settings` e `qr_code_settings`, respectivamente, no `configuration_data` do `requester_profile`), serão utilizadas tais configurações padrão para a emissão do título.
:::

:::caution Limitações e Restrições
- **Boletos de Pagamento Parcial:** Não é permitido o pagamento via QR Code Pix. Portanto, não é permitido enviar a `pix_key` no registro, nem ter uma configuração padrão de geração de bolePix para a carteira.

- **Boletos de Cartão de Crédito:** Não é necessário nem permitido enviar informações rebate, desconto, multa e juros. Isso se deve ao padrão do mercado, onde muitas Instituições Financeiras não aceitam o pagamento de boletos de cartão de crédito que contenham essas informações. A carteira também não pode ter essas configurações definidas como padrão. Sendo assim boletos desse tipo podem ser pagos parcialmente mesmo após o vencimento, sem incidência de juros, multas, descontos ou abatimentos na fatura corrente. Para aplicar esses valores é necessário incluí-los na próxima fatura, seja através da [ocorrência de edição de valor](/documentation/boletos/instrucoes/valor) do boleto ou emitindo um novo boleto que inclua esses valores. É possível enviar `amount = 0` para boletos deste tipo.

**Importante:** Boletos do tipo `credit_card` são obrigatoriamente de pagamento parcial, sendo assim é necessário fornecer as informações de `partial_payment_data` ou ter essa configuração padrão na carteira. Caso o campo `financial_instrument_type` não seja enviado, o valor padrão será `digital_commercial_invoice`.
:::

:::tip Recomendações de Carteiras
- **Carteira para Boletos Padrão:** Mantenha as configurações padrão para multas, juros e protesto
- **Carteira para Boletos de Pagamento Parcial:** Sem configuração de Pix e com regras específicas para pagamento parcial
- **Carteira para Boletos de Cartão de Crédito:** Sem configurações de multa, juros, desconto ou rebate

Criar carteiras específicas garante que as configurações padrão sejam adequadas para cada tipo de boleto e evita conflitos nas regras de negócio.
:::

:::info Máquina de Estados
A máquina de status para boletos de pagamento parcial possui algumas diferenças. Para mais detalhes, consulte a [introdução](/documentation/boletos/introducao) , onde há uma explicação sobre como aplicar a incidência de juros e multas no boleto seguindo as boas práticas do mercado.
:::

### Enumeradores financial_instrument_type

| Enumerador  | Descrição                        |
|-------------|----------------------------------|
| digital_commercial_invoice | DMI Duplicata Mercantil Indicação |
| credit_card | Cartão de Crédito |
| check | CH Cheque |
| digital_commercial | DM Duplicata Mercantil |
| digital_service_invoice | Duplicata de Serviço |
| digital_service_invoice_indication | DSI Duplicata de Serviço Indicação |
| digital_rural_invoice | DR Duplicata Rural |
| bill_of_exchange | LC Letra de Câmbio |
| commercial_credit_note | NCC Nota de Crédito Comercial |
| export_credit_note | NCE Nota de Crédito Exportação |
| industrial_credit_note | NCI Nota de Crédito Industrial |
| rural_credit_note | NCR Nota de Crédito Rural |
| promissory_note | NP Nota Promissória |
| rural_promissory_note | NPR Nota Promissória Rural |
| mercantile_triplicate | TM Triplicata Mercantil |
| service_triplicate | TS Triplicata de Serviço |
| insurance_note | NS Nota de Seguro |
| receipt | RC Recibo |
| printed_bank_slip | FAT Bloqueto |
| debit_note | ND Nota de Débito |
| insurance_policy | AP Apólice de Seguro |
| school_monthly_fee | ME Mensalidade Escolar |
| consortium_installment | PC Parcela de Consórcio |
| invoice | NF Nota Fiscal |
| debt_document | DD Documento de Dívida |
| rural_product_certificate | Cédula de Produto Rural |
| warrant | Warrant |
| state_active_debt | Dívida Ativa de Estado |
| municipal_active_debt | Dívida Ativa de Município |
| federal_active_debt | Dívida Ativa da União |
| condominium_charges | Encargos condominiais |
| proposal_bank_slip | Boleto proposta |
| deposit_and_contribution_bank_slip | Boleto de Depósito e Aporte |
| others | Outros |

### Objeto partial_payment_data

| Campo                             | Tipo    | Descrição                                                                 | Caracteres |
|-----------------------------------|---------|---------------------------------------------------------------------------|------------|
| `partial_payment_minimum_type` *  | string  | Tipo de valor mínimo para pagamento parcial                               | **[Enumeradores partial_payment_type](#enumeradores-partial_payment_type)** |
| `partial_payment_minimum_percentage` | float | Percentual mínimo permitido para o pagamento parcial                      | -          |
| `partial_payment_minimum_amount`  | float  | Valor mínimo permitido para o pagamento parcial                           | -          |
| `partial_payment_maximum_type`    | string  | Tipo de valor máximo para pagamento parcial                               | **[Enumeradores partial_payment_type](#enumeradores-partial_payment_type)** |
| `partial_payment_maximum_percentage` | float | Percentual máximo permitido para o pagamento parcial                      | -          |
| `partial_payment_maximum_amount`  | float  | Valor máximo permitido para o pagamento parcial                           | -          |
| `partial_payment_quantity` *      | integer | Quantidade de pagamentos parciais permitidos                              | -          |

:::caution Atenção!
De acordo com o valor enviado nos campos `partial_payment_minimum_type` e `partial_payment_maximum_type`, é necessário enviar o `partial_payment_minimum_amount` ou `partial_payment_minimum_percentage`, e o `partial_payment_maximum_amount` ou `partial_payment_maximum_percentage` correspondente.
:::

### Enumeradores partial_payment_type

| Enumerador  | Descrição                        |
|-------------|----------------------------------|
| absolute    | Valor absoluto                   |
| percentage  | Percentual                       |

### Objeto write_off_data

| Campo                     | Tipo    | Descrição                                                                   | Caracteres |
|---------------------------|---------|-----------------------------------------------------------------------------|------------|
| `days_to_write_off` *     | integer | Dias, após o vencimento, para que o boleto seja baixado automaticamente     | -          |

### Objeto protest_data

| Campo                     | Tipo    | Descrição                                                                   | Caracteres |
|---------------------------|---------|-----------------------------------------------------------------------------|------------|
| `days_to_protest` *       | integer | Dias, após o vencimento, para que o boleto seja protestado automaticamente  | -          |

### Objeto bankruptcy_protest_data

| Campo                          | Tipo    | Descrição                                                                   | Caracteres  |
|--------------------------------|---------|-----------------------------------------------------------------------------|------------|
| `days_to_bankruptcy_protest` * | integer | Dias, após o vencimento, para que o boleto seja protestado automaticamente  | -           |

### Objeto fine_data

Opção 1: multa em valor absoluto (`fine_type=absolute`)

| Campo                     | Tipo    | Descrição                                               | Caracteres                |
|---------------------------|---------|---------------------------------------------------------|-------------------------------------------------------------------------|
| `fine_type` *             | string  | Tipo da multa                                                       | **[Enumeradores fine_type](#enumeradores-fine_type)**                                              |
| `fine_amount` *           | float   | Valor absoluto da multa                                             | -                                                                        |
| `days_to_fine` *          | integer | Dias, após o vencimento, para que a multa seja cobrada              | -                                                                        |

Opção 2: multa em valor percentual (`fine_type=percentage`)

| Campo                     | Tipo    | Descrição                                                 | Caracteres                             |
|---------------------------|---------|-----------------------------------------------------------|---------------------------------------|
| `fine_type` *             | string  | Tipo da multa                                             | **[Enumeradores fine_type](#enumeradores-fine_type)** |
| `fine_percentage` *       | integer | Valor percentual da multa, de 1 a 100                     | -                                      |
| `days_to_fine` *          | integer | Dias, após o vencimento, para que a multa seja cobrada    | -                                      |

### Enumeradores fine_type

| Enumerador         | Descrição             |
|--------------------|-----------------------|
| absolute           | valor absoluto        |
| percentage         | valor percentual      |

### Objeto interest_data

Opção 1: juros utilizando valores absolutos (`interest_type=calendar_days_daily_amount` ou `interest_type=workdays_daily_amount`)

| Campo                     | Tipo    | Descrição                                                                     | Caracteres                                                                                      |
|---------------------------|---------|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| `interest_type` *         | string  | Tipo de juros       | **[Enumeradores interest_type](#enumeradores-interest_type)** |
| `interest_amount` *       | float   | Valor a ser cobrado por unidade de tempo determinada (dias úteis ou corridos) | -                                                                                               |
| `days_to_interest` *      | integer | Dias, após o vencimento, para que comece a cobrar os juros                    | -                                                                                               |

Opção 2: juros utilizando valores percentuais (`interest_type=calendar_days_monthly_percentage`)

| Campo                    | Tipo    | Descrição                                                                             | Caracteres                                                                                          |
|--------------------------|---------|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| `interest_type` *        | string  | Tipo de juros       | **[Enumeradores interest_type](#enumeradores-interest_type)** |
| `interest_percentage` *  | integer | Porcentagem a ser cobrada por unidade de tempo determinada (dias úteis ou corridos)                                                                      | -                                                                           |
| `days_to_interest` *     | integer | Dias, após o vencimento, para que comece a cobrar os juros                             | -                                                                                                   |

### Enumeradores interest_type

| Enumerador                       | Descrição                                                            |
|----------------------------------|----------------------------------------------------------------------|
| calendar_days_daily_amount       | Valor diário sobre dias corridos                                     |
| workdays_daily_amount            | Valor diário sobre dias úteis                                        |
| calendar_days_monthly_percentage | Porcentagem de juros cobrados mensalmente, com base em dias corridos |

### Objeto discount

Opção 1: descontos utilizando valores absolutos (`discount_type in ["absolute", "anticipation_calendar_days_daily_amount", "anticipation_workdays_daily_amount"]`)

| Campo                     | Tipo    | Descrição                                           | Caracteres                                                |
|---------------------------|---------|-----------------------------------------------------|-----------------------------------------------------------|
| `discount_amount` *       | float   | Valor absoluto de desconto por unidade de tempo                                            | -                                                          |
| `discount_number` *       | integer | Número do desconto                                     | -                                                         |
| `discount_type` *         | string  | Configuração do desconto em valores absolutos                                    | **[Enumerador discount_type](#enumeradores-discount_type)** |                                                       |
| `discount_limit_date` *   | string  | Data limite para aplicação do desconto   | 10                                                        |

Opção 2: descontos utilizando valores percentuais (`discount_type in ["percentage", "anticipation_calendar_days_daily_percentage", "anticipation_workdays_daily_percentage"]`)

| Campo                     | Tipo    | Descrição                                           | Caracteres                                                |
|---------------------------|---------|-----------------------------------------------------|-----------------------------------------------------------|
| `discount_percentage` *   | float   | Valor percentual de desconto por unidade de tempo                                            | -                                                          |
| `discount_number` *       | integer | Número do desconto                                     | -                                                         |
| `discount_type` *         | string  | Configuração do desconto em valores percentuais                                    | **[Enumerador discount_type](#enumeradores-discount_type)** |                                                       |
| `discount_limit_date` *   | string  | Data limite para aplicação do desconto   | 10                                                        |

:::caution Atenção!
O boleto pode ter até três descontos, sendo que os descontos devem ser todos do mesmo tipo , isto é, devem ter o mesmo `discount_type`. Os descontos devem ser numerados de 1 a 3, de maneira crescente e começando necessariamente em 1. Ou seja, caso sejam enviados dois descontos na requisição, devem necessariamente ser numerados com 1 e 2.
:::

### Enumeradores discount_type

| Enumerador                                  | Descrição                                                                |
|---------------------------------------------|--------------------------------------------------------------------------|
| absolute                                    | Valor fixo                                                               |
| anticipation_calendar_days_daily_amount     | Valor diário de desconto de antecipação, sobre dias corridos             |
| anticipation_workdays_daily_amount          | Valor diário de desconto de antecipação, sobre dias úteis                |
| percentage                                  | Porcentagem fixa                                                         |
| anticipation_calendar_days_daily_percentage | Porcentagem mensal de desconto de antecipação, com base em dias corridos |
| anticipation_workdays_daily_percentage      | Porcentagem anual de desconto de antecipação, com base em dias úteis     |

### Objetos payer_data e guarantor_data

| Campo                     | Tipo   | Descrição                                                  | Caracteres|
|---------------------------|--------|-------------------------------------|-----------------------------------------------------------|
| `name` *                  | string | Nome completo                       | 100                                                       |
| `document_number` *       | string | Número do documento (CPF/CNPJ)      | 11 ou 14                                                  |
| `person_type` *           | string | Tipo da pessoa (física ou jurídica) | **[Enumeradores person_type](#enumeradores-person_type)** |
| `contact`                 | object | Informações de contato              | **[Objeto contact](#objeto-contact)**                     |
| `address`                 | object | Endereço                            | **[Objeto address](#objeto-address)**                     |

### Enumeradores person_type

| Enumerador         | Descrição             |
|--------------------|-----------------------|
| natural            | pessoa física         |
| legal              | pessoa jurídica       |

### Objeto contact

| Campo                     | Tipo   | Descrição                         | Caracteres                         |
|---------------------------|--------|-----------------------------------|------------------------------------|
| `email`                   | string | E-mail de contato                 | 320                                |
| `phone`                   | object | Telefone de contato               | **[Objeto phone](#objeto-phone)**  |

### Objeto phone

| Campo                           | Tipo   | Descrição                                    | Caracteres |
|---------------------------------|--------|----------------------------------------------|------------|
| `country_code` *     | string | Código DDI (Discagem Direta Internacional)   | 3          |
| `area_code` *                   | string | Código DDD (Discagem Direta à Distância)     | 2          |
| `number` *                      | string | Complemento                                  | 9          |

### Objeto address

| Campo                     | Tipo   | Descrição                                    | Caracteres |
|---------------------------|--------|----------------------------------------------|------------|
| `street` *                | string | Logradouro                                   | 500        |
| `number` *                | string | Número                                       | 6          |
| `complement`              | string | Complemento                                  | 500        |
| `neighborhood` *          | string | Bairro                                       | 100        |
| `postal_code` *           | string | CEP                                          | 8          |
| `city` *                  | string | Cidade                                       | 100        |
| `state` *                 | string | Estado (UF) | **[Enumerador state](#enumeradores-state)** |

### Enumeradores state

| Enumerador         | Descrição             |
|--------------------|-----------------------|
| AC                 | Acre                  |
| AL                 | Alagoas               |
| AM                 | Amazonas              |
| AP                 | Amapá                 |
| BA                 | Bahia                 |
| CE                 | Ceará                 |
| DF                 | Distrito federal      |
| ES                 | Espírito Santo        |
| GO                 | Goiás                 |
| MA                 | Maranhão              |
| MG                 | Minas Gerais          |
| MS                 | Mato Grosso do Sul    |
| MT                 | Mato Grosso           |
| PA                 | Pará                  |
| PB                 | Paraíba               |
| PE                 | Pernambuco            |
| PI                 | Piauí                 |
| PR                 | Paraná                |
| RJ                 | Rio de Janeiro        |
| RN                 | Rio Grande do Norte   |
| RO                 | Rondônia              |
| RR                 | Roraima               |
| RS                 | Rio Grande do Sul     |
| SC                 | Santa Catarina        |
| SE                 | Sergipe               |
| SP                 | São Paulo             |
| TO                 | Tocantins             |
| EX                 | Exceção               |

### Objeto notification

| Campo                     | Tipo    | Descrição                                                                               | Caracteres |
|---------------------------|---------|-----------------------------------------------------------------------------------------|------------|
| `document_number` *       | string  | Número do documento de quem receberá as notificações (CPF/CNPJ)                         | 11 ou 14   |
| `name` *                  | string  | Nome de quem receberá as notificações                                                   | 100        |
| `email`                   | string  | E-mail para o qual serão enviadas as notificações                                       | 320        |
| `phone`                   | object  | Telefone de contato para o qual serão enviadas as notificações | **[Objeto phone](#objeto-phone)**   |
| `send_2_way` *            | boolean | Enviar segunda via                                                                      | -          |
| `send_before_due_date` *  | boolean | Enviar notificação ao pagador antes da data de vencimento                               | -          |
| `send_after_due_date` *   | boolean | Enviar notificação ao pagador quando o boleto vencer                                    | -          |
| `send_on_protest` *       | boolean | Enviar notificação ao entrar em fluxo de protesto                                       | -          |

## Response

STATUS 201

Response Body: Boleto registrado

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "bank_slip_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "bank_slip_status": "registered",
  "our_number": 92580722204,
  "barcode": "32998995900000892812147469258072220406456140",
  "digitable_line": "32992147466925807222704064561402899590000089281",
  "qr_code_data": {
    "qr_code_key": "bc5cb30c-8f98-4273-b405-3546da1d8d7a",
    "pix_key": "06797774-e050-419e-a91a-c64c919b52c7",
    "receiver_conciliation_id": "01GVGV9NXBCY287Z6CJ4S0ENW9",
    "url": "00020126830014br.gov.bcb.pix2561qrcode.qitech.app/bacen/cobv/58fd5103a8e64bbbab2fd49b0bd580145204000053039865802BR5925GONNFUNDODEINVESTIMENTOEM6012RiodeJaneiro6107226401262070503***6304EA0D",
    "image": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/wAALCAD0APQBAREA/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/9oACAEBAAA/APf6KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK+QPhl8Mv+Fjf2p/xN/wCz/sHlf8u3m79+/wD21xjZ79a7/wD4Zl/6m7/ym/8A22j/AIZl/wCpu/8AKb/9to/Zl/5mn/t0/wDa1egfE34Zf8LG/sv/AIm/9n/YPN/5dvN379n+2uMbPfrXgHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrR8Tfib/wsb+y/wDiUf2f9g83/l583fv2f7C4xs9+td//AMm5/wDUw/27/wBunkeR/wB/N27zvbG3vnjwCvr/AOJvxN/4Vz/Zf/Eo/tD7f5v/AC8+Vs2bP9hs53+3SvkCvf8A9mX/AJmn/t0/9rUf8m5/9TD/AG7/ANunkeR/383bvO9sbe+ePQPhl8Mv+Fc/2p/xN/7Q+3+V/wAu3lbNm/8A22znf7dK8A+GXxN/4Vz/AGp/xKP7Q+3+V/y8+Vs2b/8AYbOd/t0o+GXxN/4Vz/an/Eo/tD7f5X/Lz5WzZv8A9hs53+3Svf8A4m/DL/hY39l/8Tf+z/sHm/8ALt5u/fs/21xjZ79a8/8A+GZf+pu/8pv/ANtr0D4ZfE3/AIWN/an/ABKP7P8AsHlf8vPm79+//YXGNnv1rwD4ZfE3/hXP9qf8Sj+0Pt/lf8vPlbNm/wD2Gznf7dK7/wD4aa/6lH/ypf8A2quA+GXxN/4Vz/an/Eo/tD7f5X/Lz5WzZv8A9hs53+3Svr+vkD4ZfDL/AIWN/an/ABN/7P8AsHlf8u3m79+//bXGNnv1rv8A/hmX/qbv/Kb/APbaP+GZf+pu/wDKb/8AbaP2Zf8Amaf+3T/2tX0BRRRXz/8Asy/8zT/26f8AtavAK9//AGZf+Zp/7dP/AGtR+zL/AMzT/wBun/tavQPib8Mv+Fjf2X/xN/7P+web/wAu3m79+z/bXGNnv1rz/wDZl/5mn/t0/wDa1cB8Mvib/wAK5/tT/iUf2h9v8r/l58rZs3/7DZzv9ule/wDwy+Jv/Cxv7U/4lH9n/YPK/wCXnzd+/f8A7C4xs9+teAfE34Zf8K5/sv8A4m/9ofb/ADf+XbytmzZ/ttnO/wBule//ABN+Jv8Awrn+y/8AiUf2h9v83/l58rZs2f7DZzv9uleAfDL4Zf8ACxv7U/4m/wDZ/wBg8r/l283fv3/7a4xs9+tHxN+GX/Cuf7L/AOJv/aH2/wA3/l28rZs2f7bZzv8AbpXv/wAMvhl/wrn+1P8Aib/2h9v8r/l28rZs3/7bZzv9ulef/tNf8yt/29/+0a9A+GXxN/4WN/an/Eo/s/7B5X/Lz5u/fv8A9hcY2e/WvP8A/k3P/qYf7d/7dPI8j/v5u3ed7Y2988cB8Tfhl/wrn+y/+Jv/AGh9v83/AJdvK2bNn+22c7/bpXf/APDTX/Uo/wDlS/8AtVcB8Tfhl/wrn+y/+Jv/AGh9v83/AJdvK2bNn+22c7/bpX1/Xz//AMm5/wDUw/27/wBunkeR/wB/N27zvbG3vng/5OM/6l7+wv8At78/z/8Av3t2+T753dsc+gfDL4m/8LG/tT/iUf2f9g8r/l583fv3/wCwuMbPfrXn/wCzL/zNP/bp/wC1q8Ar3/8AZl/5mn/t0/8Aa1H7Mv8AzNP/AG6f+1q+gKKKK+f/ANmX/maf+3T/ANrUf8My/wDU3f8AlN/+216B8Mvhl/wrn+1P+Jv/AGh9v8r/AJdvK2bN/wDttnO/26V5/wDsy/8AM0/9un/taj/k4z/qXv7C/wC3vz/P/wC/e3b5Pvnd2xyf8nGf9S9/YX/b35/n/wDfvbt8n3zu7Y5P2mv+ZW/7e/8A2jR+zL/zNP8A26f+1qP+Tc/+ph/t3/t08jyP+/m7d53tjb3zx4BXv/7TX/Mrf9vf/tGj/k3P/qYf7d/7dPI8j/v5u3ed7Y2988cB8Mvhl/wsb+1P+Jv/AGf9g8r/AJdvN379/wDtrjGz3613/wDwzL/1N3/lN/8AttH7Mv8AzNP/AG6f+1q4D4m/DL/hXP8AZf8AxN/7Q+3+b/y7eVs2bP8AbbOd/t0rv/8Ahpr/AKlH/wAqX/2qj/k4z/qXv7C/7e/P8/8A797dvk++d3bHJ/ybn/1MP9u/9unkeR/383bvO9sbe+ePQPhl8Mv+Fc/2p/xN/wC0Pt/lf8u3lbNm/wD22znf7dKPib8Mv+Fjf2X/AMTf+z/sHm/8u3m79+z/AG1xjZ79a8//AGZf+Zp/7dP/AGtX0BXz/wDsy/8AM0/9un/taj/hmX/qbv8Aym//AG2vQPhl8Mv+Fc/2p/xN/wC0Pt/lf8u3lbNm/wD22znf7dK8/wD2Zf8Amaf+3T/2tX0BRRRXz/8A8My/9Td/5Tf/ALbR/wAMy/8AU3f+U3/7bR/wzL/1N3/lN/8AttegfDL4Zf8ACuf7U/4m/wDaH2/yv+Xbytmzf/ttnO/26V5//wAm5/8AUw/27/26eR5H/fzdu872xt7549A+GXwy/wCFc/2p/wATf+0Pt/lf8u3lbNm//bbOd/t0rz/9mX/maf8At0/9rVwHwy+Jv/Cuf7U/4lH9ofb/ACv+Xnytmzf/ALDZzv8AbpR8Mvib/wAK5/tT/iUf2h9v8r/l58rZs3/7DZzv9ulHwy+Jv/Cuf7U/4lH9ofb/ACv+Xnytmzf/ALDZzv8AbpXf/sy/8zT/ANun/tavQPhl8Mv+Fc/2p/xN/wC0Pt/lf8u3lbNm/wD22znf7dK8/wD2Zf8Amaf+3T/2tXoHwy+GX/Cuf7U/4m/9ofb/ACv+Xbytmzf/ALbZzv8AbpXgHwy+Jv8Awrn+1P8AiUf2h9v8r/l58rZs3/7DZzv9uld/+zL/AMzT/wBun/tavQPhl8Mv+Fc/2p/xN/7Q+3+V/wAu3lbNm/8A22znf7dK8A+GXxN/4Vz/AGp/xKP7Q+3+V/y8+Vs2b/8AYbOd/t0o+GXxN/4Vz/an/Eo/tD7f5X/Lz5WzZv8A9hs53+3Su/8A2Zf+Zp/7dP8A2tR/ybn/ANTD/bv/AG6eR5H/AH83bvO9sbe+eD9mX/maf+3T/wBrUfsy/wDM0/8Abp/7Wo/4Zl/6m7/ym/8A22j/AIZl/wCpu/8AKb/9to/4Zl/6m7/ym/8A22vQPhl8Mv8AhXP9qf8AE3/tD7f5X/Lt5WzZv/22znf7dK9Aooor5/8A2Zf+Zp/7dP8A2tXAfE34m/8ACxv7L/4lH9n/AGDzf+Xnzd+/Z/sLjGz360fE34m/8LG/sv8A4lH9n/YPN/5efN379n+wuMbPfrXv/wAMvhl/wrn+1P8Aib/2h9v8r/l28rZs3/7bZzv9ulfIFFegfDL4m/8ACuf7U/4lH9ofb/K/5efK2bN/+w2c7/bpXf8A7TX/ADK3/b3/AO0a9A+GXxN/4WN/an/Eo/s/7B5X/Lz5u/fv/wBhcY2e/WvAPib8Mv8AhXP9l/8AE3/tD7f5v/Lt5WzZs/22znf7dKPib8Mv+Fc/2X/xN/7Q+3+b/wAu3lbNmz/bbOd/t0rv/wBmX/maf+3T/wBrVwHxN+GX/Cuf7L/4m/8AaH2/zf8Al28rZs2f7bZzv9ulHxN+GX/Cuf7L/wCJv/aH2/zf+XbytmzZ/ttnO/26V3//AAzL/wBTd/5Tf/ttH7TX/Mrf9vf/ALRrgPhl8Tf+Fc/2p/xKP7Q+3+V/y8+Vs2b/APYbOd/t0o+Jvwy/4Vz/AGX/AMTf+0Pt/m/8u3lbNmz/AG2znf7dK7//AJOM/wCpe/sL/t78/wA//v3t2+T753dscn/Juf8A1MP9u/8Abp5Hkf8Afzdu872xt7548Ar3/wD5Nz/6mH+3f+3TyPI/7+bt3ne2NvfPHAfE34Zf8K5/sv8A4m/9ofb/ADf+XbytmzZ/ttnO/wBuld/+01/zK3/b3/7Rr6Aorz/4ZfE3/hY39qf8Sj+z/sHlf8vPm79+/wD2FxjZ79a9Aooor5A+Jvwy/wCFc/2X/wATf+0Pt/m/8u3lbNmz/bbOd/t0o+JvxN/4WN/Zf/Eo/s/7B5v/AC8+bv37P9hcY2e/Wu//AGmv+ZW/7e//AGjXoHwy+GX/AArn+1P+Jv8A2h9v8r/l28rZs3/7bZzv9ulHwy+Jv/Cxv7U/4lH9n/YPK/5efN379/8AsLjGz3615/8A8nGf9S9/YX/b35/n/wDfvbt8n3zu7Y5+gK+QPib8Tf8AhY39l/8AEo/s/wCweb/y8+bv37P9hcY2e/Wvf/hl8Tf+Fjf2p/xKP7P+weV/y8+bv37/APYXGNnv1rz/AP4aa/6lH/ypf/aq9A+Jvwy/4WN/Zf8AxN/7P+web/y7ebv37P8AbXGNnv1r0CvkD4m/DL/hXP8AZf8AxN/7Q+3+b/y7eVs2bP8AbbOd/t0rv/8Ahpr/AKlH/wAqX/2qj/hmX/qbv/Kb/wDbaP8Ak3P/AKmH+3f+3TyPI/7+bt3ne2NvfPHoHxN+Jv8Awrn+y/8AiUf2h9v83/l58rZs2f7DZzv9ulHwy+GX/Cuf7U/4m/8AaH2/yv8Al28rZs3/AO22c7/bpXn/AO01/wAyt/29/wDtGj/hpr/qUf8Aypf/AGqj/k4z/qXv7C/7e/P8/wD797dvk++d3bHJ/wANNf8AUo/+VL/7VXAfE34Zf8K5/sv/AIm/9ofb/N/5dvK2bNn+22c7/bpR8Mvib/wrn+1P+JR/aH2/yv8Al58rZs3/AOw2c7/bpR8Mvhl/wsb+1P8Aib/2f9g8r/l283fv3/7a4xs9+tHwy+Jv/Cuf7U/4lH9ofb/K/wCXnytmzf8A7DZzv9ulfX9FFFFfP/8AwzL/ANTd/wCU3/7bXoHwy+GX/Cuf7U/4m/8AaH2/yv8Al28rZs3/AO22c7/bpXgHwy+GX/Cxv7U/4m/9n/YPK/5dvN379/8AtrjGz3613/8AwzL/ANTd/wCU3/7bR/w01/1KP/lS/wDtVegfDL4Zf8K5/tT/AIm/9ofb/K/5dvK2bN/+22c7/bpR8Mvib/wsb+1P+JR/Z/2Dyv8Al583fv3/AOwuMbPfrR8Mvhl/wrn+1P8Aib/2h9v8r/l28rZs3/7bZzv9uleAfE34Zf8ACuf7L/4m/wDaH2/zf+XbytmzZ/ttnO/26V3/AO01/wAyt/29/wDtGuA+GXwy/wCFjf2p/wATf+z/ALB5X/Lt5u/fv/21xjZ79a9/+Jvwy/4WN/Zf/E3/ALP+web/AMu3m79+z/bXGNnv1rwD4m/DL/hXP9l/8Tf+0Pt/m/8ALt5WzZs/22znf7dK9/8Aib8Tf+Fc/wBl/wDEo/tD7f5v/Lz5WzZs/wBhs53+3SvP/wBpr/mVv+3v/wBo0f8AJuf/AFMP9u/9unkeR/383bvO9sbe+eD9mX/maf8At0/9rV4BXoHwy+Jv/Cuf7U/4lH9ofb/K/wCXnytmzf8A7DZzv9uld/8A8m5/9TD/AG7/ANunkeR/383bvO9sbe+eOA+GXxN/4Vz/AGp/xKP7Q+3+V/y8+Vs2b/8AYbOd/t0rv/8Ak3P/AKmH+3f+3TyPI/7+bt3ne2NvfPHoHxN+GX/Cxv7L/wCJv/Z/2Dzf+Xbzd+/Z/trjGz3614B8Mvib/wAK5/tT/iUf2h9v8r/l58rZs3/7DZzv9ule/wDxN+Jv/Cuf7L/4lH9ofb/N/wCXnytmzZ/sNnO/26UfE34m/wDCuf7L/wCJR/aH2/zf+XnytmzZ/sNnO/26V5/+zL/zNP8A26f+1q+gKKKK+f8A/k3P/qYf7d/7dPI8j/v5u3ed7Y2988H/ACbn/wBTD/bv/bp5Hkf9/N27zvbG3vnjgPib8Mv+Fc/2X/xN/wC0Pt/m/wDLt5WzZs/22znf7dK9/wDhl8Mv+Fc/2p/xN/7Q+3+V/wAu3lbNm/8A22znf7dKPib8Mv8AhY39l/8AE3/s/wCweb/y7ebv37P9tcY2e/WvAPib8Mv+Fc/2X/xN/wC0Pt/m/wDLt5WzZs/22znf7dK8/r3/APaa/wCZW/7e/wD2jXAfDL4m/wDCuf7U/wCJR/aH2/yv+Xnytmzf/sNnO/26V7/8Mvhl/wAK5/tT/ib/ANofb/K/5dvK2bN/+22c7/bpXn//AA01/wBSj/5Uv/tVegfE34m/8K5/sv8A4lH9ofb/ADf+XnytmzZ/sNnO/wBulHxN+Jv/AArn+y/+JR/aH2/zf+XnytmzZ/sNnO/26V5/+01/zK3/AG9/+0aP2Zf+Zp/7dP8A2tR+zL/zNP8A26f+1qP+TjP+pe/sL/t78/z/APv3t2+T753dsc+AV7/+zL/zNP8A26f+1q9A+GXwy/4Vz/an/E3/ALQ+3+V/y7eVs2b/APbbOd/t0rwD4ZfDL/hY39qf8Tf+z/sHlf8ALt5u/fv/ANtcY2e/Wvf/AIm/E3/hXP8AZf8AxKP7Q+3+b/y8+Vs2bP8AYbOd/t0rwD4m/DL/AIVz/Zf/ABN/7Q+3+b/y7eVs2bP9ts53+3Su/wD2mv8AmVv+3v8A9o1wHwy+Jv8Awrn+1P8AiUf2h9v8r/l58rZs3/7DZzv9ulHxN+GX/Cuf7L/4m/8AaH2/zf8Al28rZs2f7bZzv9ule/8Awy+GX/Cuf7U/4m/9ofb/ACv+Xbytmzf/ALbZzv8AbpXoFFFFfIHwy+GX/Cxv7U/4m/8AZ/2Dyv8Al283fv3/AO2uMbPfrXf/APDMv/U3f+U3/wC20f8AJxn/AFL39hf9vfn+f/3727fJ987u2OfQPhl8Mv8AhXP9qf8AE3/tD7f5X/Lt5WzZv/22znf7dK8//wCGmv8AqUf/ACpf/aq8Ar3/AP4aa/6lH/ypf/aq9A+GXwy/4Vz/AGp/xN/7Q+3+V/y7eVs2b/8AbbOd/t0rwD4m/DL/AIVz/Zf/ABN/7Q+3+b/y7eVs2bP9ts53+3Svf/ib8Mv+Fjf2X/xN/wCz/sHm/wDLt5u/fs/21xjZ79a8/wD+TjP+pe/sL/t78/z/APv3t2+T753dsc+gfDL4m/8ACxv7U/4lH9n/AGDyv+Xnzd+/f/sLjGz360fDL4Zf8K5/tT/ib/2h9v8AK/5dvK2bN/8AttnO/wBulef/APJxn/Uvf2F/29+f5/8A3727fJ987u2OT/hpr/qUf/Kl/wDaqP2mv+ZW/wC3v/2jR+zL/wAzT/26f+1q8Ar3/wD4Zl/6m7/ym/8A22vQPhl8Tf8AhY39qf8AEo/s/wCweV/y8+bv37/9hcY2e/Wj4m/E3/hXP9l/8Sj+0Pt/m/8ALz5WzZs/2Gznf7dKPib8Mv8AhY39l/8AE3/s/wCweb/y7ebv37P9tcY2e/Wj4ZfE3/hY39qf8Sj+z/sHlf8ALz5u/fv/ANhcY2e/Wj4ZfDL/AIVz/an/ABN/7Q+3+V/y7eVs2b/9ts53+3SvQK+f/wDk4z/qXv7C/wC3vz/P/wC/e3b5Pvnd2xz9AUUUUV5/8Mvhl/wrn+1P+Jv/AGh9v8r/AJdvK2bN/wDttnO/26V5/wD8m5/9TD/bv/bp5Hkf9/N27zvbG3vnjwCvQPib8Mv+Fc/2X/xN/wC0Pt/m/wDLt5WzZs/22znf7dK7/wD5Nz/6mH+3f+3TyPI/7+bt3ne2NvfPHAfDL4m/8K5/tT/iUf2h9v8AK/5efK2bN/8AsNnO/wBulHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrXf8A7TX/ADK3/b3/AO0a4D4m/DL/AIVz/Zf/ABN/7Q+3+b/y7eVs2bP9ts53+3Sj4ZfDL/hY39qf8Tf+z/sHlf8ALt5u/fv/ANtcY2e/Wu//AGmv+ZW/7e//AGjXoHxN+GX/AAsb+y/+Jv8A2f8AYPN/5dvN379n+2uMbPfrXoFfIHwy+Jv/AArn+1P+JR/aH2/yv+Xnytmzf/sNnO/26UfDL4Zf8LG/tT/ib/2f9g8r/l283fv3/wC2uMbPfrXf/wDDTX/Uo/8AlS/+1Ufsy/8AM0/9un/tavAK9A+GXwy/4WN/an/E3/s/7B5X/Lt5u/fv/wBtcY2e/Wu//wCGmv8AqUf/ACpf/aq4D4ZfE3/hXP8Aan/Eo/tD7f5X/Lz5WzZv/wBhs53+3Su//wCTjP8AqXv7C/7e/P8AP/797dvk++d3bHPoHxN+Jv8Awrn+y/8AiUf2h9v83/l58rZs2f7DZzv9ulHxN+Jv/Cuf7L/4lH9ofb/N/wCXnytmzZ/sNnO/26UfDL4m/wDCxv7U/wCJR/Z/2Dyv+Xnzd+/f/sLjGz360fE34m/8K5/sv/iUf2h9v83/AJefK2bNn+w2c7/bpR8Mvib/AMLG/tT/AIlH9n/YPK/5efN379/+wuMbPfrXoFFFFfIHwy+Jv/Cuf7U/4lH9ofb/ACv+Xnytmzf/ALDZzv8AbpX1/XwBXoHxN+GX/Cuf7L/4m/8AaH2/zf8Al28rZs2f7bZzv9ule/8Awy+Jv/Cxv7U/4lH9n/YPK/5efN379/8AsLjGz360fE34m/8ACuf7L/4lH9ofb/N/5efK2bNn+w2c7/bpR8Mvhl/wrn+1P+Jv/aH2/wAr/l28rZs3/wC22c7/AG6V5/8Asy/8zT/26f8AtauA+JvxN/4WN/Zf/Eo/s/7B5v8Ay8+bv37P9hcY2e/Wvf8A4m/E3/hXP9l/8Sj+0Pt/m/8ALz5WzZs/2Gznf7dK8A+JvxN/4WN/Zf8AxKP7P+web/y8+bv37P8AYXGNnv1r3/4m/E3/AIVz/Zf/ABKP7Q+3+b/y8+Vs2bP9hs53+3SvP/8Ak3P/AKmH+3f+3TyPI/7+bt3ne2NvfPB/w01/1KP/AJUv/tVegfE34m/8K5/sv/iUf2h9v83/AJefK2bNn+w2c7/bpXn/AO01/wAyt/29/wDtGj/hpr/qUf8Aypf/AGqvoCvkD4ZfE3/hXP8Aan/Eo/tD7f5X/Lz5WzZv/wBhs53+3Svf/ib8Tf8AhXP9l/8AEo/tD7f5v/Lz5WzZs/2Gznf7dK8//wCGZf8Aqbv/ACm//baP2mv+ZW/7e/8A2jR/ybn/ANTD/bv/AG6eR5H/AH83bvO9sbe+ePQPib8Tf+Fc/wBl/wDEo/tD7f5v/Lz5WzZs/wBhs53+3SvAPhl8Tf8AhXP9qf8AEo/tD7f5X/Lz5WzZv/2Gznf7dK9/+GXxN/4WN/an/Eo/s/7B5X/Lz5u/fv8A9hcY2e/Wj4ZfE3/hY39qf8Sj+z/sHlf8vPm79+//AGFxjZ79a9Aoooor5/8A2Zf+Zp/7dP8A2tR/wzL/ANTd/wCU3/7bR/ybn/1MP9u/9unkeR/383bvO9sbe+ePQPib8Tf+Fc/2X/xKP7Q+3+b/AMvPlbNmz/YbOd/t0o+JvxN/4Vz/AGX/AMSj+0Pt/m/8vPlbNmz/AGGznf7dK8A+Jvwy/wCFc/2X/wATf+0Pt/m/8u3lbNmz/bbOd/t0r3/4m/DL/hY39l/8Tf8As/7B5v8Ay7ebv37P9tcY2e/Wj4m/E3/hXP8AZf8AxKP7Q+3+b/y8+Vs2bP8AYbOd/t0r5Ar0D4ZfE3/hXP8Aan/Eo/tD7f5X/Lz5WzZv/wBhs53+3Su//wCGmv8AqUf/ACpf/aq4D4ZfE3/hXP8Aan/Eo/tD7f5X/Lz5WzZv/wBhs53+3Su//aa/5lb/ALe//aNcB8Mvhl/wsb+1P+Jv/Z/2Dyv+Xbzd+/f/ALa4xs9+tHxN+Jv/AAsb+y/+JR/Z/wBg83/l583fv2f7C4xs9+te/wDwy+GX/Cuf7U/4m/8AaH2/yv8Al28rZs3/AO22c7/bpXgHwy+GX/Cxv7U/4m/9n/YPK/5dvN379/8AtrjGz360fE34Zf8ACuf7L/4m/wDaH2/zf+XbytmzZ/ttnO/26V5/Xv8A+01/zK3/AG9/+0a4D4ZfDL/hY39qf8Tf+z/sHlf8u3m79+//AG1xjZ79a9/+GXxN/wCFjf2p/wASj+z/ALB5X/Lz5u/fv/2FxjZ79aPhl8Mv+Fc/2p/xN/7Q+3+V/wAu3lbNm/8A22znf7dK+QK9/wD2Zf8Amaf+3T/2tX0BRRRRXyB8Tfhl/wAK5/sv/ib/ANofb/N/5dvK2bNn+22c7/bpXf8A/DTX/Uo/+VL/AO1VwHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrXf8A/DMv/U3f+U3/AO21wHwy+Jv/AArn+1P+JR/aH2/yv+Xnytmzf/sNnO/26UfDL4m/8K5/tT/iUf2h9v8AK/5efK2bN/8AsNnO/wBule//ABN+Jv8Awrn+y/8AiUf2h9v83/l58rZs2f7DZzv9uleAfE34m/8ACxv7L/4lH9n/AGDzf+Xnzd+/Z/sLjGz3615/XoHxN+Jv/Cxv7L/4lH9n/YPN/wCXnzd+/Z/sLjGz3613/wC01/zK3/b3/wC0a9A+GXwy/wCFc/2p/wATf+0Pt/lf8u3lbNm//bbOd/t0rwD4ZfDL/hY39qf8Tf8As/7B5X/Lt5u/fv8A9tcY2e/Wu/8A+GZf+pu/8pv/ANtrgPhl8Mv+Fjf2p/xN/wCz/sHlf8u3m79+/wD21xjZ79a8/r0D4ZfDL/hY39qf8Tf+z/sHlf8ALt5u/fv/ANtcY2e/Wj4m/E3/AIWN/Zf/ABKP7P8AsHm/8vPm79+z/YXGNnv1rv8A/hpr/qUf/Kl/9qr0D4m/DL/hY39l/wDE3/s/7B5v/Lt5u/fs/wBtcY2e/WvP/wBmX/maf+3T/wBrV6B8Mvib/wALG/tT/iUf2f8AYPK/5efN379/+wuMbPfrXgHwy+GX/Cxv7U/4m/8AZ/2Dyv8Al283fv3/AO2uMbPfrXf/APDMv/U3f+U3/wC20fsy/wDM0/8Abp/7WrgPib8Mv+Fc/wBl/wDE3/tD7f5v/Lt5WzZs/wBts53+3Svf/hl8Mv8AhXP9qf8AE3/tD7f5X/Lt5WzZv/22znf7dK9Aooorz/4m/DL/AIWN/Zf/ABN/7P8AsHm/8u3m79+z/bXGNnv1rwD4ZfE3/hXP9qf8Sj+0Pt/lf8vPlbNm/wD2Gznf7dK7/wDZl/5mn/t0/wDa1egfDL4Zf8K5/tT/AIm/9ofb/K/5dvK2bN/+22c7/bpXgHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrR8Tfhl/wrn+y/wDib/2h9v8AN/5dvK2bNn+22c7/AG6V3/7TX/Mrf9vf/tGuA+GXxN/4Vz/an/Eo/tD7f5X/AC8+Vs2b/wDYbOd/t0o+Jvwy/wCFc/2X/wATf+0Pt/m/8u3lbNmz/bbOd/t0r6/rz/4ZfDL/AIVz/an/ABN/7Q+3+V/y7eVs2b/9ts53+3Sj4ZfDL/hXP9qf8Tf+0Pt/lf8ALt5WzZv/ANts53+3SvP/ANmX/maf+3T/ANrV6B8Mvhl/wrn+1P8Aib/2h9v8r/l28rZs3/7bZzv9uleAfDL4m/8ACuf7U/4lH9ofb/K/5efK2bN/+w2c7/bpX1/RRXyB8Tfib/wsb+y/+JR/Z/2Dzf8Al583fv2f7C4xs9+td/8A8m5/9TD/AG7/ANunkeR/383bvO9sbe+ePAK+v/ib8Tf+Fc/2X/xKP7Q+3+b/AMvPlbNmz/YbOd/t0rz/APZl/wCZp/7dP/a1egfDL4Zf8K5/tT/ib/2h9v8AK/5dvK2bN/8AttnO/wBuleAfDL4m/wDCuf7U/wCJR/aH2/yv+Xnytmzf/sNnO/26V7/8Tfhl/wALG/sv/ib/ANn/AGDzf+Xbzd+/Z/trjGz3615/+zL/AMzT/wBun/tavoCiiivP/ib8Tf8AhXP9l/8AEo/tD7f5v/Lz5WzZs/2Gznf7dK8//wCTc/8AqYf7d/7dPI8j/v5u3ed7Y2988H/DMv8A1N3/AJTf/ttH/DMv/U3f+U3/AO214BXv/wDwzL/1N3/lN/8AttH/AA01/wBSj/5Uv/tVH/DMv/U3f+U3/wC214BXoHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrXf8A7Mv/ADNP/bp/7Wr0D4ZfE3/hY39qf8Sj+z/sHlf8vPm79+//AGFxjZ79a8//AOGZf+pu/wDKb/8Aba4D4ZfDL/hY39qf8Tf+z/sHlf8ALt5u/fv/ANtcY2e/Wj4ZfDL/AIWN/an/ABN/7P8AsHlf8u3m79+//bXGNnv1r3/4m/DL/hY39l/8Tf8As/7B5v8Ay7ebv37P9tcY2e/WvP8A9mX/AJmn/t0/9rV9AV8//wDDMv8A1N3/AJTf/ttH/Jxn/Uvf2F/29+f5/wD3727fJ987u2OfQPib8Mv+Fjf2X/xN/wCz/sHm/wDLt5u/fs/21xjZ79a9Ar5A+Jvwy/4Vz/Zf/E3/ALQ+3+b/AMu3lbNmz/bbOd/t0o+Jvwy/4Vz/AGX/AMTf+0Pt/m/8u3lbNmz/AG2znf7dK9/+GXwy/wCFc/2p/wATf+0Pt/lf8u3lbNm//bbOd/t0rz//AJOM/wCpe/sL/t78/wA//v3t2+T753dscn7Mv/M0/wDbp/7Wr6Aooorz/wCGXwy/4Vz/AGp/xN/7Q+3+V/y7eVs2b/8AbbOd/t0rz/8A4Zl/6m7/AMpv/wBto/Zl/wCZp/7dP/a1H/Juf/Uw/wBu/wDbp5Hkf9/N27zvbG3vng/Zl/5mn/t0/wDa1H/Juf8A1MP9u/8Abp5Hkf8Afzdu872xt7544D4ZfDL/AIWN/an/ABN/7P8AsHlf8u3m79+//bXGNnv1o+GXwy/4WN/an/E3/s/7B5X/AC7ebv37/wDbXGNnv1o+JvxN/wCFjf2X/wASj+z/ALB5v/Lz5u/fs/2FxjZ79aPhl8Mv+Fjf2p/xN/7P+weV/wAu3m79+/8A21xjZ79a7/8A5OM/6l7+wv8At78/z/8Av3t2+T753dsc8B8Mvib/AMK5/tT/AIlH9ofb/K/5efK2bN/+w2c7/bpXv/xN+GX/AAsb+y/+Jv8A2f8AYPN/5dvN379n+2uMbPfrXn//AA01/wBSj/5Uv/tVegfDL4m/8LG/tT/iUf2f9g8r/l583fv3/wCwuMbPfrXn/wCzL/zNP/bp/wC1q4D4ZfE3/hXP9qf8Sj+0Pt/lf8vPlbNm/wD2Gznf7dKPib8Mv+Fc/wBl/wDE3/tD7f5v/Lt5WzZs/wBts53+3Su//Zl/5mn/ALdP/a1fQFef/E34Zf8ACxv7L/4m/wDZ/wBg83/l283fv2f7a4xs9+tef/8ADTX/AFKP/lS/+1VwHxN+GX/Cuf7L/wCJv/aH2/zf+XbytmzZ/ttnO/26V5/Xv/8AwzL/ANTd/wCU3/7bR/ybn/1MP9u/9unkeR/383bvO9sbe+eD9mX/AJmn/t0/9rV9AUUUV8AUV7//AMnGf9S9/YX/AG9+f5//AH727fJ987u2OfQPhl8Mv+Fc/wBqf8Tf+0Pt/lf8u3lbNm//AG2znf7dK8A+Jvwy/wCFc/2X/wATf+0Pt/m/8u3lbNmz/bbOd/t0rv8A9pr/AJlb/t7/APaNH/DMv/U3f+U3/wC20f8ADMv/AFN3/lN/+216B8Mvhl/wrn+1P+Jv/aH2/wAr/l28rZs3/wC22c7/AG6V5/8A8nGf9S9/YX/b35/n/wDfvbt8n3zu7Y59A+Jvwy/4WN/Zf/E3/s/7B5v/AC7ebv37P9tcY2e/WvQK+QPib8Tf+Fjf2X/xKP7P+web/wAvPm79+z/YXGNnv1o+Jvwy/wCFc/2X/wATf+0Pt/m/8u3lbNmz/bbOd/t0r3/4m/DL/hY39l/8Tf8As/7B5v8Ay7ebv37P9tcY2e/Wj4ZfE3/hY39qf8Sj+z/sHlf8vPm79+//AGFxjZ79a8//AOTjP+pe/sL/ALe/P8//AL97dvk++d3bHPoHxN+Jv/Cuf7L/AOJR/aH2/wA3/l58rZs2f7DZzv8AbpR8Mvhl/wAK5/tT/ib/ANofb/K/5dvK2bN/+22c7/bpXgHxN+GX/Cuf7L/4m/8AaH2/zf8Al28rZs2f7bZzv9uld/8A8My/9Td/5Tf/ALbXoHxN+Jv/AArn+y/+JR/aH2/zf+XnytmzZ/sNnO/26V5/+zL/AMzT/wBun/taj/k3P/qYf7d/7dPI8j/v5u3ed7Y2988fQFfP/wDybn/1MP8Abv8A26eR5H/fzdu872xt754+gKKKKK+AK+v/AIZfE3/hY39qf8Sj+z/sHlf8vPm79+//AGFxjZ79aPhl8Tf+Fjf2p/xKP7P+weV/y8+bv37/APYXGNnv1rwD4m/DL/hXP9l/8Tf+0Pt/m/8ALt5WzZs/22znf7dK9/8Ahl8Mv+Fc/wBqf8Tf+0Pt/lf8u3lbNm//AG2znf7dK8//AOGZf+pu/wDKb/8Aba8Ar6/+Jvwy/wCFjf2X/wATf+z/ALB5v/Lt5u/fs/21xjZ79aPib8Mv+Fjf2X/xN/7P+web/wAu3m79+z/bXGNnv1rz/wD4Zl/6m7/ym/8A22j/AJNz/wCph/t3/t08jyP+/m7d53tjb3zx6B8Mvhl/wrn+1P8Aib/2h9v8r/l28rZs3/7bZzv9ulHwy+GX/Cuf7U/4m/8AaH2/yv8Al28rZs3/AO22c7/bpXgHwy+Jv/Cuf7U/4lH9ofb/ACv+Xnytmzf/ALDZzv8AbpXv/wAMvib/AMLG/tT/AIlH9n/YPK/5efN379/+wuMbPfrXgHxN+GX/AArn+y/+Jv8A2h9v83/l28rZs2f7bZzv9uld/wD8NNf9Sj/5Uv8A7VX0BXyB8Mvhl/wsb+1P+Jv/AGf9g8r/AJdvN379/wDtrjGz3619f18//wDDTX/Uo/8AlS/+1V6B8Tfhl/wsb+y/+Jv/AGf9g83/AJdvN379n+2uMbPfrR8Mvib/AMLG/tT/AIlH9n/YPK/5efN379/+wuMbPfrR8Mvib/wsb+1P+JR/Z/2Dyv8Al583fv3/AOwuMbPfrR8Tfhl/wsb+y/8Aib/2f9g83/l283fv2f7a4xs9+tef/sy/8zT/ANun/taj9mX/AJmn/t0/9rV9AUUUV8//ALTX/Mrf9vf/ALRo/wCGZf8Aqbv/ACm//ba+gK+f/wDk3P8A6mH+3f8At08jyP8Av5u3ed7Y2988eAUV7/8A8NNf9Sj/AOVL/wC1Uf8AJuf/AFMP9u/9unkeR/383bvO9sbe+ePQPib8Mv8AhY39l/8AE3/s/wCweb/y7ebv37P9tcY2e/WvP/8Ak4z/AKl7+wv+3vz/AD/+/e3b5Pvnd2xzwHwy+Jv/AArn+1P+JR/aH2/yv+Xnytmzf/sNnO/26UfDL4Zf8LG/tT/ib/2f9g8r/l283fv3/wC2uMbPfrXv/wATfib/AMK5/sv/AIlH9ofb/N/5efK2bNn+w2c7/bpXn/7Mv/M0/wDbp/7Wr0D4ZfDL/hXP9qf8Tf8AtD7f5X/Lt5WzZv8A9ts53+3Sj4ZfDL/hXP8Aan/E3/tD7f5X/Lt5WzZv/wBts53+3SvAPib8Mv8AhXP9l/8AE3/tD7f5v/Lt5WzZs/22znf7dKPhl8Mv+Fjf2p/xN/7P+weV/wAu3m79+/8A21xjZ79a7/8AZl/5mn/t0/8Aa1cB8Mvib/wrn+1P+JR/aH2/yv8Al58rZs3/AOw2c7/bpR8Mvib/AMK5/tT/AIlH9ofb/K/5efK2bN/+w2c7/bpXf/8AJuf/AFMP9u/9unkeR/383bvO9sbe+eOA+Jvwy/4Vz/Zf/E3/ALQ+3+b/AMu3lbNmz/bbOd/t0o+GXxN/4Vz/AGp/xKP7Q+3+V/y8+Vs2b/8AYbOd/t0rv/8Ak3P/AKmH+3f+3TyPI/7+bt3ne2NvfPB/w01/1KP/AJUv/tVegfDL4m/8LG/tT/iUf2f9g8r/AJefN379/wDsLjGz3616BRRRRXyB8Tfhl/wrn+y/+Jv/AGh9v83/AJdvK2bNn+22c7/bpR8Mvib/AMK5/tT/AIlH9ofb/K/5efK2bN/+w2c7/bpXv/wy+GX/AArn+1P+Jv8A2h9v8r/l28rZs3/7bZzv9ulHxN+GX/Cxv7L/AOJv/Z/2Dzf+Xbzd+/Z/trjGz3615/8A8My/9Td/5Tf/ALbXoHxN+Jv/AArn+y/+JR/aH2/zf+XnytmzZ/sNnO/26V4B8Mvhl/wsb+1P+Jv/AGf9g8r/AJdvN379/wDtrjGz3617/wDDL4m/8LG/tT/iUf2f9g8r/l583fv3/wCwuMbPfrXgHxN+Jv8Awsb+y/8AiUf2f9g83/l583fv2f7C4xs9+te//DL4m/8ACxv7U/4lH9n/AGDyv+Xnzd+/f/sLjGz3614B8Tfhl/wrn+y/+Jv/AGh9v83/AJdvK2bNn+22c7/bpXv/AMTfhl/wsb+y/wDib/2f9g83/l283fv2f7a4xs9+tegV5/8AE34Zf8LG/sv/AIm/9n/YPN/5dvN379n+2uMbPfrR8Tfib/wrn+y/+JR/aH2/zf8Al58rZs2f7DZzv9ulef8A/Jxn/Uvf2F/29+f5/wD3727fJ987u2OfAK9A+GXxN/4Vz/an/Eo/tD7f5X/Lz5WzZv8A9hs53+3Svf8A4m/E3/hXP9l/8Sj+0Pt/m/8ALz5WzZs/2Gznf7dKPhl8Mv8AhXP9qf8AE3/tD7f5X/Lt5WzZv/22znf7dK9Ar5A+JvxN/wCFjf2X/wASj+z/ALB5v/Lz5u/fs/2FxjZ79aPhl8Mv+Fjf2p/xN/7P+weV/wAu3m79+/8A21xjZ79a9/8Aib8Tf+Fc/wBl/wDEo/tD7f5v/Lz5WzZs/wBhs53+3SvQK8/+GXwy/wCFc/2p/wATf+0Pt/lf8u3lbNm//bbOd/t0r0CiiivkD4ZfE3/hXP8Aan/Eo/tD7f5X/Lz5WzZv/wBhs53+3Su//wCGZf8Aqbv/ACm//ba+gK8/+GXwy/4Vz/an/E3/ALQ+3+V/y7eVs2b/APbbOd/t0rz/AP4Zl/6m7/ym/wD22vQPib8Tf+Fc/wBl/wDEo/tD7f5v/Lz5WzZs/wBhs53+3SvQK8/+Jvwy/wCFjf2X/wATf+z/ALB5v/Lt5u/fs/21xjZ79a8//Zl/5mn/ALdP/a1cB8Tfib/wsb+y/wDiUf2f9g83/l583fv2f7C4xs9+te//AAy+GX/Cuf7U/wCJv/aH2/yv+Xbytmzf/ttnO/26UfE34m/8K5/sv/iUf2h9v83/AJefK2bNn+w2c7/bpR8Tfhl/wsb+y/8Aib/2f9g83/l283fv2f7a4xs9+tef/wDJuf8A1MP9u/8Abp5Hkf8Afzdu872xt754P+TjP+pe/sL/ALe/P8//AL97dvk++d3bHPoHwy+GX/Cuf7U/4m/9ofb/ACv+Xbytmzf/ALbZzv8AbpR8Mvhl/wAK5/tT/ib/ANofb/K/5dvK2bN/+22c7/bpXn//AAzL/wBTd/5Tf/tteAUV9f8AxN+Jv/Cuf7L/AOJR/aH2/wA3/l58rZs2f7DZzv8AbpXgHxN+Jv8Awsb+y/8AiUf2f9g83/l583fv2f7C4xs9+tfX9FfIHwy+Jv8Awrn+1P8AiUf2h9v8r/l58rZs3/7DZzv9ulHwy+Jv/Cuf7U/4lH9ofb/K/wCXnytmzf8A7DZzv9ule/8Awy+Jv/Cxv7U/4lH9n/YPK/5efN379/8AsLjGz3616BRRRXyB8Tfhl/wrn+y/+Jv/AGh9v83/AJdvK2bNn+22c7/bpXf/APJxn/Uvf2F/29+f5/8A3727fJ987u2OT/hmX/qbv/Kb/wDbaP8Ak3P/AKmH+3f+3TyPI/7+bt3ne2NvfPB/wzL/ANTd/wCU3/7bR+01/wAyt/29/wDtGj9mX/maf+3T/wBrV6B8Mvhl/wAK5/tT/ib/ANofb/K/5dvK2bN/+22c7/bpXn//AAzL/wBTd/5Tf/ttH/Juf/Uw/wBu/wDbp5Hkf9/N27zvbG3vnjgPhl8Mv+Fjf2p/xN/7P+weV/y7ebv37/8AbXGNnv1r3/4ZfDL/AIVz/an/ABN/7Q+3+V/y7eVs2b/9ts53+3SvP/2Zf+Zp/wC3T/2tXoHxN+GX/Cxv7L/4m/8AZ/2Dzf8Al283fv2f7a4xs9+tef8A/Jxn/Uvf2F/29+f5/wD3727fJ987u2OfQPib8Mv+Fjf2X/xN/wCz/sHm/wDLt5u/fs/21xjZ79a8/wD+Gmv+pR/8qX/2quA+JvxN/wCFjf2X/wASj+z/ALB5v/Lz5u/fs/2FxjZ79a9/+Jvwy/4WN/Zf/E3/ALP+web/AMu3m79+z/bXGNnv1rwD4m/DL/hXP9l/8Tf+0Pt/m/8ALt5WzZs/22znf7dKPib8Mv8AhXP9l/8AE3/tD7f5v/Lt5WzZs/22znf7dK9/+JvxN/4Vz/Zf/Eo/tD7f5v8Ay8+Vs2bP9hs53+3SvP8A9pr/AJlb/t7/APaNH/Juf/Uw/wBu/wDbp5Hkf9/N27zvbG3vng/Zl/5mn/t0/wDa1eAV7/8Asy/8zT/26f8AtavoCiiiivP/AIm/DL/hY39l/wDE3/s/7B5v/Lt5u/fs/wBtcY2e/WvQK8/+GXwy/wCFc/2p/wATf+0Pt/lf8u3lbNm//bbOd/t0o+GXxN/4WN/an/Eo/s/7B5X/AC8+bv37/wDYXGNnv1o+Jvwy/wCFjf2X/wATf+z/ALB5v/Lt5u/fs/21xjZ79a8//aa/5lb/ALe//aNH/Jxn/Uvf2F/29+f5/wD3727fJ987u2OfAK9//wCTjP8AqXv7C/7e/P8AP/797dvk++d3bHJ/w01/1KP/AJUv/tVH/DMv/U3f+U3/AO21wHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrXf8A/DMv/U3f+U3/AO214BXv/wC01/zK3/b3/wC0aP8Ak4z/AKl7+wv+3vz/AD/+/e3b5Pvnd2xyftNf8yt/29/+0a4D4ZfE3/hXP9qf8Sj+0Pt/lf8ALz5WzZv/ANhs53+3Svf/AIZfDL/hXP8Aan/E3/tD7f5X/Lt5WzZv/wBts53+3SvAPhl8Mv8AhY39qf8AE3/s/wCweV/y7ebv37/9tcY2e/Wu/wD+Tc/+ph/t3/t08jyP+/m7d53tjb3zxwHwy+GX/Cxv7U/4m/8AZ/2Dyv8Al283fv3/AO2uMbPfrXf/APDMv/U3f+U3/wC21wHwy+Jv/Cuf7U/4lH9ofb/K/wCXnytmzf8A7DZzv9ule/8AxN+Jv/Cuf7L/AOJR/aH2/wA3/l58rZs2f7DZzv8AbpR8Mvib/wALG/tT/iUf2f8AYPK/5efN379/+wuMbPfrXoFFFFfIHwy+GX/Cxv7U/wCJv/Z/2Dyv+Xbzd+/f/trjGz3613//AAzL/wBTd/5Tf/ttH/DMv/U3f+U3/wC20fsy/wDM0/8Abp/7Wo/5OM/6l7+wv+3vz/P/AO/e3b5Pvnd2xyf8NNf9Sj/5Uv8A7VXAfDL4m/8ACuf7U/4lH9ofb/K/5efK2bN/+w2c7/bpR8Mvhl/wsb+1P+Jv/Z/2Dyv+Xbzd+/f/ALa4xs9+td//AMNNf9Sj/wCVL/7VR/ybn/1MP9u/9unkeR/383bvO9sbe+ePAK9//Zl/5mn/ALdP/a1H7Mv/ADNP/bp/7Wr0D4ZfDL/hXP8Aan/E3/tD7f5X/Lt5WzZv/wBts53+3SvAPhl8Mv8AhY39qf8AE3/s/wCweV/y7ebv37/9tcY2e/WvP69//Zl/5mn/ALdP/a1H7Mv/ADNP/bp/7Wo/aa/5lb/t7/8AaNegfDL4m/8ACxv7U/4lH9n/AGDyv+Xnzd+/f/sLjGz3615/+zL/AMzT/wBun/taj/k3P/qYf7d/7dPI8j/v5u3ed7Y2988H7Mv/ADNP/bp/7Wr0D4ZfDL/hXP8Aan/E3/tD7f5X/Lt5WzZv/wBts53+3SvkCvQPhl8Mv+Fjf2p/xN/7P+weV/y7ebv37/8AbXGNnv1r3/4ZfE3/AIWN/an/ABKP7P8AsHlf8vPm79+//YXGNnv1r0Ciiivn/wDZl/5mn/t0/wDa1eAV7/8Asy/8zT/26f8Ataj9mX/maf8At0/9rUf8nGf9S9/YX/b35/n/APfvbt8n3zu7Y59A+GXxN/4WN/an/Eo/s/7B5X/Lz5u/fv8A9hcY2e/WvP8A/hpr/qUf/Kl/9qrgPhl8Mv8AhY39qf8AE3/s/wCweV/y7ebv37/9tcY2e/WvP6+v/hl8Mv8AhXP9qf8AE3/tD7f5X/Lt5WzZv/22znf7dK8//aa/5lb/ALe//aNegfDL4m/8LG/tT/iUf2f9g8r/AJefN379/wDsLjGz3615/wD8My/9Td/5Tf8A7bR/wzL/ANTd/wCU3/7bXAfDL4Zf8LG/tT/ib/2f9g8r/l283fv3/wC2uMbPfrXv/wATfhl/wsb+y/8Aib/2f9g83/l283fv2f7a4xs9+tHwy+Jv/Cxv7U/4lH9n/YPK/wCXnzd+/f8A7C4xs9+tef8A/Juf/Uw/27/26eR5H/fzdu872xt7544D4m/DL/hXP9l/8Tf+0Pt/m/8ALt5WzZs/22znf7dK7/8A5Nz/AOph/t3/ALdPI8j/AL+bt3ne2NvfPHAfDL4m/wDCuf7U/wCJR/aH2/yv+Xnytmzf/sNnO/26V7/8Mvhl/wAK5/tT/ib/ANofb/K/5dvK2bN/+22c7/bpXgHxN+GX/Cuf7L/4m/8AaH2/zf8Al28rZs2f7bZzv9ulef0V9f8Awy+Jv/Cxv7U/4lH9n/YPK/5efN379/8AsLjGz3615/8Asy/8zT/26f8AtavoCiiivn/9mX/maf8At0/9rUf8My/9Td/5Tf8A7bXoHwy+GX/Cuf7U/wCJv/aH2/yv+Xbytmzf/ttnO/26V5/+zL/zNP8A26f+1q9A+Jvwy/4WN/Zf/E3/ALP+web/AMu3m79+z/bXGNnv1r0CvgCvr/4m/DL/AIWN/Zf/ABN/7P8AsHm/8u3m79+z/bXGNnv1o+JvxN/4Vz/Zf/Eo/tD7f5v/AC8+Vs2bP9hs53+3Sj4ZfDL/AIVz/an/ABN/7Q+3+V/y7eVs2b/9ts53+3SvP/2mv+ZW/wC3v/2jR/wzL/1N3/lN/wDttcB8Mvib/wAK5/tT/iUf2h9v8r/l58rZs3/7DZzv9ule/wDwy+GX/Cuf7U/4m/8AaH2/yv8Al28rZs3/AO22c7/bpR8Tfib/AMK5/sv/AIlH9ofb/N/5efK2bNn+w2c7/bpR8Tfhl/wsb+y/+Jv/AGf9g83/AJdvN379n+2uMbPfrXgHwy+Jv/Cuf7U/4lH9ofb/ACv+Xnytmzf/ALDZzv8AbpR8Mvhl/wALG/tT/ib/ANn/AGDyv+Xbzd+/f/trjGz3617/APDL4Zf8K5/tT/ib/wBofb/K/wCXbytmzf8A7bZzv9ulef8A/DMv/U3f+U3/AO21wHwy+Jv/AArn+1P+JR/aH2/yv+Xnytmzf/sNnO/26V3/AO01/wAyt/29/wDtGuA+GXxN/wCFc/2p/wASj+0Pt/lf8vPlbNm//YbOd/t0r3/4m/E3/hXP9l/8Sj+0Pt/m/wDLz5WzZs/2Gznf7dK8/wD2Zf8Amaf+3T/2tXAfE34Zf8K5/sv/AIm/9ofb/N/5dvK2bNn+22c7/bpXv/wy+GX/AArn+1P+Jv8A2h9v8r/l28rZs3/7bZzv9ulegUUUV8//APDMv/U3f+U3/wC20f8ADMv/AFN3/lN/+20f8My/9Td/5Tf/ALbXoHwy+GX/AArn+1P+Jv8A2h9v8r/l28rZs3/7bZzv9ulef/8ADMv/AFN3/lN/+20f8My/9Td/5Tf/ALbR/wAMy/8AU3f+U3/7bX0BXn/xN+GX/Cxv7L/4m/8AZ/2Dzf8Al283fv2f7a4xs9+tef8A/DMv/U3f+U3/AO216B8Mvhl/wrn+1P8Aib/2h9v8r/l28rZs3/7bZzv9ulHxN+GX/Cxv7L/4m/8AZ/2Dzf8Al283fv2f7a4xs9+tHwy+GX/Cuf7U/wCJv/aH2/yv+Xbytmzf/ttnO/26V6BXn/xN+GX/AAsb+y/+Jv8A2f8AYPN/5dvN379n+2uMbPfrR8Mvhl/wrn+1P+Jv/aH2/wAr/l28rZs3/wC22c7/AG6V5/8A8My/9Td/5Tf/ALbXoHwy+GX/AArn+1P+Jv8A2h9v8r/l28rZs3/7bZzv9ulef/8ADMv/AFN3/lN/+20f8My/9Td/5Tf/ALbXoHxN+GX/AAsb+y/+Jv8A2f8AYPN/5dvN379n+2uMbPfrR8Mvhl/wrn+1P+Jv/aH2/wAr/l28rZs3/wC22c7/AG6UfE34Zf8ACxv7L/4m/wDZ/wBg83/l283fv2f7a4xs9+tegV5/8Mvhl/wrn+1P+Jv/AGh9v8r/AJdvK2bN/wDttnO/26UfE34Zf8LG/sv/AIm/9n/YPN/5dvN379n+2uMbPfrXoFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFf/2Q=="
  }
}
```

STATUS 202

Response Body: Boleto pendente de registro

```json
{
  "request_control_key": "f14e9bac-94ed-4eb1-87b4-7fd7b7a2d280",
  "bank_slip_key": "e8599844-5cad-40b4-8716-cb4770d415b4",
  "bank_slip_status": "accepted"
}
```

:::info Informação
Caso seja retornado **HTTP Status 202** com o campo `bank_slip_status` com valor `accepted`, a emissão não deve ser retentada.

Esta emissão será processada assincronamente. É necessário verificar o status do boleto por meio
da consulta de boleto, ou aguardar o recebimento do webhook de confirmação descrito na [página de webhooks](/documentation/boletos/v2/webhooks/boleto).
:::

### Response Body Params

| Campo                   | Tipo   | Descrição                                                                         | Caracteres |
|-------------------------|--------|-----------------------------------------------------------------------------------|------------|
| `request_control_key` * | uuidv4 | Chave única de identificação da request utilizada pelo cliente no formato uuid v4 | 36         |
| `bank_slip_key` *       | uuidv4 | Chave única de identificação do boleto no formato uuid v4                         | 36         |
| `bank_slip_status` *    | string | Status do boleto       | **[Enumeradores bank_slip_status](#enumeradores-bank_slip_status)**   |
| `our_number` *          | integer| Número único de identificação do boleto junto à carteira                          | 11         |
| `barcode` *             | string | Código de barras do boleto                                                        | 44         |
| `digitable_line` *      | string | Linha digitável do boleto                                                         | 47         |
| `qr_code_data`          | object | Dados do QR Code                             | **[Objeto qr_code_data](#objeto-qr_code_data)** |
| `created_at` *          | string | Data, no formato ISO (UTC - "YYYY-MM-DDTHH:MM:SSZ"), da criação da ocorrência     | 20         |

### Enumeradores bank_slip_status

| Enumerador         | Descrição                               |
|--------------------|-----------------------------------------|
| accepted           | Boleto aceito mas ainda não registrado  |
| registered         | Boleto registrado                       |

### Objeto qr_code_data
| Campo                      | Tipo   | Descrição                                             | Caracteres              |
|----------------------------|--------|-------------------------------------------------------|-------------------------|
| `qr_code_key`              | uuidv4 | Chave única de identificação do QR Code               | 36                      |
| `pix_key`                  | uuidv4 | Chave PIX vinculada ao QR Code                        | 36                      |
| `receiver_conciliation_id` | uuidv4 | Identificador de conciliação do QR Code               | 36                      |
| `url`                      | string | URL (Pix Copia e Cola) do QR Code                     | -                       |
| `image`                    | string | base64 da URL (Pix Copia e Cola) do QR Code           | -                       |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| Código HTTP<br/>`status` | Código QI<br/>`code` | Título<br/>`title`                                 | Descrição (eng)<br/>`description`                                                                                       | Descrição (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000004            | Not Found | Pix key not found: `{pix_key}`                                               | Chave pix não encontrada: `{pix_key}`                                               |
| 403                      | BKS000005            | Forbidden                         | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 403                      | BKS000010            | Forbidden                                 | The pix key owner does not match the account owner.                                                                                     | O proprietário da chave pix não corresponde ao proprietário da conta.                                                             |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 409                      | BKS000014            | Conflict           | Request control key already sent or duplicated sent: `{request_control_key}`                                                              | Chave de controle da requisição já utilizada ou enviada duplicada: `{request_control_key}`                                                                        |
| 400                      | BKS000016            | Bad Request                                        | Expiration date must be greater than the current date and have a maximum of 3650 days from the current date.                                    | A data de vencimento deve ser maior que a data atual e possuir no máximo 3650 dias corridos a partir da data atual.                                     |
| 409                      | BKS000017            | Conflict                                        | Our number already used or duplicated sent: `{our_number}`                                                                                       | Nosso número já utilizado ou enviado duplicado: `{our_number}`                                                                               |
| 400                      | BKS000018            | Bad Request                                        | The discount dates must be less than the expiration date and increasing.                                                      | A data dos descontos devem ser menores que a de expiração e crescentes.                                               |
| 400                      | BKS000019            | Bad Request                                        | Payer address is required for protest.                                                                                       | Endereço do pagador é obrigatório para protesto.                                                                         |
| 500                      | BKS000021            | Internal Server Error                                  | Error while trying to generate QR Code.                                                               | Erro ao tentar gerar QR Code de pagamento.                                                           |
| 400                      | BKS000022            | Bad Request                                        | Requester profile is not opened.                                                              | Carteira não está aberta.                          |
| 400                      | BKS000023            | Bad Request             | The amount must be greater than zero.          | O valor deve ser maior que zero.                                                           |
| 400                      | BKS000024            | Bad Request             | Error while registering bank slip.          | Erro ao registrar boleto.                                                           |
| 400                      | BKS000026            | Bad Request                      | Guarantor address is required for protest.                                                                                        | Endereço do sacador é obrigatório para protesto.                                                                   |
| 404                      | BKS000028            | Not Found             | Notary office attended region not found for postal code: `{postal_code}`                                                          | Região de cartório não encontrada para o CEP: `{postal_code}`                                                                                 |
| 400                      | BKS000043            | Bad Request             | Invalid discount numbering. Discounts must be numbered in ascending order and start on 1.          | Numeração dos descontos inválida. Os descontos devem ser numerados em ordem crescente e começar em 1.                                                           |
| 400                      | BKS000045            | Bad Request                                        | Rebate amount can not be equal or greater than the bank slip amount.                                                              | O valor do rebate não pode ser igual ou maior do que o valor do boleto.                          |
| 400                      | BKS000047            | Bad Request             | It was not possible to consult the sent pix key at this time. Please try again in a few minutes.          | Não foi possível consultar a chave pix enviada no momento. Por favor, tente novamente em alguns minutos.                                                           |
| 400                      | BKS000125            | Bad Request             | Partial payment data is required for this bank slip species type.          | Os dados de pagamento parcial são obrigatórios para o tipo de boleto fornecido.                                                           |
| 400                      | BKS000128            | Bad Request             | QR code payment is not allowed for partial payment.          | Pagamento via QR code não é permitido para pagamento parcial.                                                           |
| 400                      | BKS000128            | Bad Request             | QR code payment is not allowed for partial payment.          | Pagamento via QR code não é permitido para pagamento parcial.                                                           |
| 400                      | BKS000131            | Bad Request             | Rebate amount is not allowed for this bank slip species type.          | O valor de abatimento não é permitido para o tipo de boleto fornecido.                                                           |
| 400                      | BKS000132            | Bad Request             | Discount data is not allowed for this bank slip species type.          | Os dados de desconto não são permitidos para o tipo de boleto fornecido.                                                           |
| 400                      | BKS000133            | Bad Request             | Fine data is not allowed for this bank slip species type.          | Os dados de multa não são permitidos para o tipo de boleto fornecido.                                                           |
| 400                      | BKS000134            | Bad Request             | Interest data is not allowed for this bank slip species type.          | Os dados de juros não são permitidos para o tipo de boleto fornecido.                                                           |
| 400                      | BKS000136            | Bad Request             | Only credit card financial instrument type can have zero amount.          | Apenas o tipo de instrumento financeiro cartão de crédito pode ter valor zero.                                                           |

---

# Emissão de boleto único (padrão)

URL: /en/documentation/boletos/emissao/emissao_boleto_unico_padrao

:::danger Importante
Para registrar bolePix, é necessário que exista uma chave Pix aleatória ativa na conta em que os boletos serão registrados.
:::

No fluxo padrão de registro de boleto, caso a requisição seja bem sucedida, a resposta retorna um boleto com o status `accepted` (o boleto foi aceito pela QI Tech). Após a confirmação/rejeição da Nuclea/CIP, o boleto passa para o status `registered` ou `rejected`.

:::caution Atenção!
Como trata-se de um registro assíncrono, o solicitante é notificado via [**webhook**](/documentation/boletos/v2/webhooks/boleto) assim que o boleto mudar de status de `accepted` para `registered` ou `rejected`.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip
MÉTODO POST

### Path parameters

| Campo                   | Tipo   | Descrição                                                    | Caracteres |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Chave única de identificação da conta, no formato uuid v4    | 36         |
| `requester_profile_key` | uuidv4 | Chave única de identificação da carteira, no formato uuid v4 | 36         |

Request Body

```json
{
  "request_control_key": "0d496b4d-01f6-48cd-8ec9-9ead1e43f156",
  "our_number": 123456789,
  "document_number": "DOC4561237",
  "amount": 5000.00,
  "expiration": "2025-01-01",
  "bank_teller_instructions": "Confirm payment",
  "protest_data": {"days_to_protest": 7},
  "bankruptcy_protest_data": {"days_to_bankruptcy_protest": 14},
  "max_payment_days": 45,
  "fine_data": {"fine_type": "absolute", "fine_amount": 100.00, "days_to_fine": 10},
  "interest_data": {
    "interest_type": "workdays_daily_amount",
    "interest_amount": 10.00,
    "days_to_interest": 2,
  },
  "financial_instrument_type": "digital_commercial_invoice",
  "write_off_data": {"days_to_write_off": 365},
  "rebate_amount": 200.00,
  "discounts_data": [
    {
      "discount_amount": 50.00,
      "discount_number": 1,
      "discount_type": "absolute",
      "discount_limit_date": "2024-12-01",
    }
  ],
  "payer_data": {
    "name": "Global Tech",
    "contact": {
      "email": "finance@globaltech.com",
      "phone": {"country_code": "055", "area_code": "11", "number": "987654321"},
    },
    "address": {
      "street": "101 High St.",
      "neighborhood": "Tech Park",
      "number": "202",
      "postal_code": "01001000",
      "city": "Innovation City",
      "state": "SP",
      "complement": "Building A",
    },
    "document_number": "12345678000195",
    "person_type": "legal",
  },
  "guarantor_data": {
    "name": "Jane Doe",
    "contact": {
      "email": "jane.doe@qitech.com.br",
      "phone": {"country_code": "055", "area_code": "11", "number": "999999999"},
    },
    "address": {
      "street": "202 Elm St.",
      "neighborhood": "Quiet Neighborhood",
      "number": "303",
      "postal_code": "01001000",
      "city": "Peaceful Town",
      "state": "RJ",
      "complement": "House 1",
    },
    "document_number": "23456789012",
    "person_type": "natural",
  },
  "pix_key": "4d25d8fc-0074-42bb-b0a4-dd12b1cd0e98",
  "notification": {
    "document_number": "12345678000195",
    "name": "Global Tech",
    "email": "finance@globaltech.com",
    "phone": {"country_code": "055", "area_code": "11", "number": "987654321"},
    "send_2_way": true,
    "send_before_due_date": false,
    "send_after_due_date": false,
    "send_on_protest": false
  },
  "split_payment_data": {
    "beneficiary_settlement_percentage": 70,
    "split_payment_rules": [
      {
        "percentage": 20,
        "document_number": "12345678901",
        "account_owner_name": "John Smith",
        "account_number": "1234567",
        "account_digit": "8"
      },
      {
        "percentage": 10,
        "document_number": "10987654321",
        "account_owner_name": "Mary Johnson",
        "account_number": "7654321",
        "account_digit": "0"
      }
    ]
  }
}
```

### Request Body

| Campo                      | Tipo    | Descrição                                                                          | Caracteres |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------|
| `request_control_key` *    | uuidv4  | Chave única de identificação da request utilizada pelo cliente no formato uuid v4  | 36                                                |
| `our_number`               | integer | Número único de identificação do boleto junto à carteira. Pode ser enviado pelo cliente e, caso não seja, a QI Tech irá gerar um                           | 11                                                |
| `document_number`          | string  | Número de identificação do boleto. Pode ser o número da nota fiscal eletrônica     | 10                                                |
| `participant_control_number` | string | Nº Controle do Participante                                                       |25                                                |
| `amount` *                 | float   | Valor base do boleto                                                               | -                                                 |
| `expiration` *             | string  | Data de vencimento                                                                 | 10                                                |
| `bank_teller_instructions` | string  | Observações ao pagador do boleto. Aceita no máximo 320 caracteres, distribuídos em até 7 linhas. Cada linha pode conter no máximo 90 caracteres. Caso uma linha ultrapasse 90 caracteres, o texto será automaticamente quebrado em uma nova linha | 320                                               |
| `rebate_amount`            | float   | Valor de abatimento do boleto, que será aplicado em cima do valor base             | -                                                 |
| `max_payment_days`         | integer | Máximo de dias corridos que o boleto ficará disponível para pagamento, após o vencimento (pode ser no máximo 365) | -          |
| `financial_instrument_type`   | string  | Tipo de espécie do boleto | **[Enumeradores financial_instrument_type](#enumeradores-financial_instrument_type)** |
| `partial_payment_data`    | object  | Configurações de pagamento parcial                      | **[Objeto partial_payment_data](#objeto-partial_payment_data)** |
| `write_off_data`       | object  | Configuração de baixa      | **[Objeto write_off_data](#objeto-write_off_settings)** |
| `protest_data`         | object  | Configuração de protesto       | **[Objeto protest_data](#objeto-protest_settings)** |
| `bankruptcy_protest_data` | object  | Configuração de protesto falimentar | **[Objeto bankruptcy_protest_data](#objeto-bankruptcy_protest_settings)** |
| `fine_data`            | object  | Configuração de multa                 | **[Objeto fine_data](#objeto-fine_settings)** |
| `interest_data`        | object  | Configuração de juros        | **[Objeto interest_data](#objeto-interest_settings)** |
| `discounts_data`           | object array | Descontos           | **[Objeto discount](#objeto-discounts_data)** |
| `payer_data` *             | object  | Dados do pagador                                                                   | **[Objeto payer_data](#objetos-payer_data-e-guarantor_data)** |
| `guarantor_data`           | object  | Dados do sacador avalista                                                          | **[Objeto guarantor_data](#objetos-payer_data-e-guarantor_data)** |
| `pix_key`                  | uuidv4  | Chave pix do tipo aleatória                                                        | 36                                                |
| `notification`             | object | Configurações de notificação do pagador                                             | **[Objeto notification](#objeto-notification)** |
| `split_payment_data`       | object | Credit split (split payment) settings of the bank slip                              | **[split_payment_data Object](#objeto-split_payment_data)** |

:::info BolePix
Caso o parâmetro `pix_key`, opcional, seja enviado na request, será gerado um bolePix. BolePix é um boleto cujo pagamento é vinculado a um QR Code Pix. Sendo assim, o pagador pode realizar o pagamento do boleto tanto utilizando a linha digitável do mesmo, quanto através da leitura do QR Code Pix vinculado. Caso o pagamento seja feito via QR Code, a liquidação financeira se dá instantaneamente, enquanto os retornos bancários e webhooks envolvidos na liquidação serão gerados assim como é feito para um boleto comum.

Importante: para registrar um bolePix, é necessário que exista uma chave Pix aleatória ativa na conta em que boleto será registrado.
:::

:::tip Configurações Padrão da Carteira
Caso cada um dos campos `max_payment_days`, `write_off_data`, `protest_data`, `bankruptcy_protest_data`, `fine_data`, `interest_data` e `pix_key` não sejam enviados na request e a carteira possua configurações padrão (i.e. `max_payment_days`, `write_off_settings`, `protest_settings`, `bankruptcy_protest_settings`, `fine_settings`, `interest_settings` e `qr_code_settings`, respectivamente, no `configuration_data` do `requester_profile`), serão utilizadas tais configurações padrão para a emissão do título.
:::

:::caution Limitações e Restrições
- **Boletos de Pagamento Parcial:** Não é permitido o pagamento via QR Code Pix. Portanto, não é permitido enviar a `pix_key` no registro, nem ter uma configuração padrão de geração de bolePix para a carteira.

- **Boletos de Cartão de Crédito:** Não é necessário nem permitido enviar informações rebate, desconto, multa e juros. Isso se deve ao padrão do mercado, onde muitas Instituições Financeiras não aceitam o pagamento de boletos de cartão de crédito que contenham essas informações. A carteira também não pode ter essas configurações definidas como padrão. Sendo assim boletos desse tipo podem ser pagos parcialmente mesmo após o vencimento, sem incidência de juros, multas, descontos ou abatimentos na fatura corrente. Para aplicar esses valores é necessário incluí-los na próxima fatura, seja através da [ocorrência de edição de valor](/documentation/boletos/instrucoes/valor) do boleto ou emitindo um novo boleto que inclua esses valores. É possível enviar `amount = 0` para boletos deste tipo.

**Importante:** Boletos do tipo `credit_card` são obrigatoriamente de pagamento parcial, sendo assim é necessário fornecer as informações de `partial_payment_data` ou ter essa configuração padrão na carteira. Caso o campo `financial_instrument_type` não seja enviado, o valor padrão será `digital_commercial_invoice`.
:::

:::tip Recomendações de Carteiras
- **Carteira para Boletos Padrão:** Mantenha as configurações padrão para multas, juros e protesto
- **Carteira para Boletos de Pagamento Parcial:** Sem configuração de Pix e com regras específicas para pagamento parcial
- **Carteira para Boletos de Cartão de Crédito:** Sem configurações de multa, juros, desconto ou rebate

Criar carteiras específicas garante que as configurações padrão sejam adequadas para cada tipo de boleto e evita conflitos nas regras de negócio.
:::

:::info Máquina de Estados
A máquina de status para boletos de pagamento parcial possui algumas diferenças. Para mais detalhes, consulte a [introdução](/documentation/boletos/introducao) , onde há uma explicação sobre como aplicar a incidência de juros e multas no boleto seguindo as boas práticas do mercado.
:::

### Enumeradores financial_instrument_type

| Enumerador  | Descrição                        |
|-------------|----------------------------------|
| digital_commercial_invoice | DMI Duplicata Mercantil Indicação |
| credit_card | Cartão de Crédito |
| check | CH Cheque |
| digital_commercial | DM Duplicata Mercantil |
| digital_service_invoice | Duplicata de Serviço |
| digital_service_invoice_indication | DSI Duplicata de Serviço Indicação |
| digital_rural_invoice | DR Duplicata Rural |
| bill_of_exchange | LC Letra de Câmbio |
| commercial_credit_note | NCC Nota de Crédito Comercial |
| export_credit_note | NCE Nota de Crédito Exportação |
| industrial_credit_note | NCI Nota de Crédito Industrial |
| rural_credit_note | NCR Nota de Crédito Rural |
| promissory_note | NP Nota Promissória |
| rural_promissory_note | NPR Nota Promissória Rural |
| mercantile_triplicate | TM Triplicata Mercantil |
| service_triplicate | TS Triplicata de Serviço |
| insurance_note | NS Nota de Seguro |
| receipt | RC Recibo |
| printed_bank_slip | FAT Bloqueto |
| debit_note | ND Nota de Débito |
| insurance_policy | AP Apólice de Seguro |
| school_monthly_fee | ME Mensalidade Escolar |
| consortium_installment | PC Parcela de Consórcio |
| invoice | NF Nota Fiscal |
| debt_document | DD Documento de Dívida |
| rural_product_certificate | Cédula de Produto Rural |
| warrant | Warrant |
| state_active_debt | Dívida Ativa de Estado |
| municipal_active_debt | Dívida Ativa de Município |
| federal_active_debt | Dívida Ativa da União |
| condominium_charges | Encargos condominiais |
| proposal_bank_slip | Boleto proposta |
| deposit_and_contribution_bank_slip | Boleto de Depósito e Aporte |
| others | Outros |

### Objeto split_payment_data

Allows configuring the **credit split** (split payment) of the bank slip, distributing the settled amount between the bank slip's beneficiary and up to 10 additional accounts. The destination accounts must be open and registered with QI Tech, and the sum of percentages (beneficiary + rules) must be exactly 100.

| Field                                  | Type         | Description                                                                                              | Characters |
|----------------------------------------|--------------|----------------------------------------------------------------------------------------------------------|------------|
| `beneficiary_settlement_percentage` *  | float        | Percentage of the settled amount allocated to the bank slip's beneficiary. Accepts values from 0 to 100. | -          |
| `beneficiary_max_amount`               | float        | Maximum amount the beneficiary receives at settlement. When the paid amount exceeds this limit, the surplus is fully directed to the first rule of the `split_payment_rules` array. Accepts values greater than 0 and less than or equal to the bank slip amount. | - |
| `split_payment_rules` *                | object array | List of split rules. Minimum 1, maximum 10 rules.                                                        | **[split_payment_rule Object](#objeto-split_payment_rule)** |

#### Objeto split_payment_rule

| Field                  | Type    | Description                                                                                          | Characters |
|------------------------|---------|------------------------------------------------------------------------------------------------------|------------|
| `percentage` *         | float   | Percentage of the settled amount allocated to this account. Accepts values from 0 to 100. Use `0` when this rule is meant exclusively to receive the surplus from `beneficiary_max_amount`. | - |
| `document_number` *    | string  | CPF/CNPJ of the destination account holder.                                                          | 11 or 14   |
| `account_owner_name` * | string  | Name of the destination account holder.                                                              | 100        |
| `account_number` *     | string  | Destination account number.                                                                          | 20         |
| `account_digit` *      | string  | Destination account check digit.                                                                     | 2          |

:::caution Attention!
- The sum of `beneficiary_settlement_percentage` and the percentages in each item of `split_payment_rules` must be exactly **100**.
- The `document_number` must be unique across rules and different from the beneficiary.
- The split applies to all settlement flows of the bank slip (SILOC, STR, notary office and Pix QR Code).
- `beneficiary_max_amount`, when provided, must be greater than 0 and less than or equal to the bank slip amount. It is required whenever any rule has `percentage = 0`.
- Only **one** rule per bank slip may have `percentage = 0` (the surplus recipient).
- After issuance, you can update the split via the [**credit split update endpoint**](/documentation/boletos/instrucoes/rateio_de_credito), as long as the bank slip is in `registered` status and has not yet been paid.
:::

:::tip Use case: directing late fees and interest to a separate account
To have the beneficiary always receive the bank slip's face value while a different account receives the interest/late fees on overdue payments, configure `beneficiary_settlement_percentage = 100` + `beneficiary_max_amount = ` + a single rule with `percentage = 0` pointing to the surplus recipient account. See the full walkthrough in [**Credit Split Update**](/documentation/boletos/instrucoes/rateio_de_credito#use-case-directing-late-fees-and-interest-to-a-separate-account).
:::

### Objeto partial_payment_data

| Campo                             | Tipo    | Descrição                                                                 | Caracteres |
|-----------------------------------|---------|---------------------------------------------------------------------------|------------|
| `partial_payment_minimum_type` *  | string  | Tipo de valor mínimo para pagamento parcial                               | **[Enumeradores partial_payment_type](#enumeradores-partial_payment_type)** |
| `partial_payment_minimum_percentage` | float | Percentual mínimo permitido para o pagamento parcial                      | -          |
| `partial_payment_minimum_amount`  | float  | Valor mínimo permitido para o pagamento parcial                           | -          |
| `partial_payment_maximum_type`    | string  | Tipo de valor máximo para pagamento parcial                               | **[Enumeradores partial_payment_type](#enumeradores-partial_payment_type)** |
| `partial_payment_maximum_percentage` | float | Percentual máximo permitido para o pagamento parcial                      | -          |
| `partial_payment_maximum_amount`  | float  | Valor máximo permitido para o pagamento parcial                           | -          |
| `partial_payment_quantity` *      | integer | Quantidade de pagamentos parciais permitidos                              | -          |

:::caution Atenção!
De acordo com o valor enviado nos campos `partial_payment_minimum_type` e `partial_payment_maximum_type`, é necessário enviar o `partial_payment_minimum_amount` ou `partial_payment_minimum_percentage`, e o `partial_payment_maximum_amount` ou `partial_payment_maximum_percentage` correspondente.
:::

### Enumeradores partial_payment_type

| Enumerador  | Descrição                        |
|-------------|----------------------------------|
| absolute    | Valor absoluto                   |
| percentage  | Percentual                       |

### Objeto write_off_data

| Campo                     | Tipo    | Descrição                                                                   | Caracteres |
|---------------------------|---------|-----------------------------------------------------------------------------|------------|
| `days_to_write_off` *     | integer | Dias, após o vencimento, para que o boleto seja baixado automaticamente     | -          |

### Objeto protest_data

| Campo                     | Tipo    | Descrição                                                                   | Caracteres |
|---------------------------|---------|-----------------------------------------------------------------------------|------------|
| `days_to_protest` *       | integer | Dias, após o vencimento, para que o boleto seja protestado automaticamente  | -          |

### Objeto bankruptcy_protest_data

| Campo                          | Tipo    | Descrição                                                                   | Caracteres  |
|--------------------------------|---------|-----------------------------------------------------------------------------|------------|
| `days_to_bankruptcy_protest` * | integer | Dias, após o vencimento, para que o boleto seja protestado automaticamente  | -           |

### Objeto fine_data

Opção 1: multa em valor absoluto (`fine_type=absolute`)

| Campo                     | Tipo    | Descrição                                               | Caracteres                |
|---------------------------|---------|---------------------------------------------------------|-------------------------------------------------------------------------|
| `fine_type` *             | string  | Tipo da multa                                                       | **[Enumeradores fine_type](#enumeradores-fine_type)**                                              |
| `fine_amount` *           | float   | Valor absoluto da multa                                             | -                                                                        |
| `days_to_fine` *          | integer | Dias, após o vencimento, para que a multa seja cobrada              | -                                                                        |

Opção 2: multa em valor percentual (`fine_type=percentage`)

| Campo                     | Tipo    | Descrição                                                 | Caracteres                             |
|---------------------------|---------|-----------------------------------------------------------|---------------------------------------|
| `fine_type` *             | string  | Tipo da multa                                             | **[Enumeradores fine_type](#enumeradores-fine_type)** |
| `fine_percentage` *       | integer | Valor percentual da multa, de 1 a 100                     | -                                      |
| `days_to_fine` *          | integer | Dias, após o vencimento, para que a multa seja cobrada    | -                                      |

### Enumeradores fine_type

| Enumerador         | Descrição             |
|--------------------|-----------------------|
| absolute           | valor absoluto        |
| percentage         | valor percentual      |

### Objeto interest_data

Opção 1: juros utilizando valores absolutos (`interest_type=calendar_days_daily_amount` ou `interest_type=workdays_daily_amount`)

| Campo                     | Tipo    | Descrição                                                                     | Caracteres                                                                                      |
|---------------------------|---------|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| `interest_type` *         | string  | Tipo de juros       | **[Enumeradores interest_type](#enumeradores-interest_type)** |
| `interest_amount` *       | float   | Valor a ser cobrado por unidade de tempo determinada (dias úteis ou corridos) | -                                                                                               |
| `days_to_interest` *      | integer | Dias, após o vencimento, para que comece a cobrar os juros                    | -                                                                                               |

Opção 2: juros utilizando valores percentuais (`interest_type=calendar_days_monthly_percentage`)

| Campo                    | Tipo    | Descrição                                                                             | Caracteres                                                                                          |
|--------------------------|---------|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| `interest_type` *        | string  | Tipo de juros       | **[Enumeradores interest_type](#enumeradores-interest_type)** |
| `interest_percentage` *  | integer | Porcentagem a ser cobrada por unidade de tempo determinada (dias úteis ou corridos)                                                                      | -                                                                           |
| `days_to_interest` *     | integer | Dias, após o vencimento, para que comece a cobrar os juros                             | -                                                                                                   |

### Enumeradores interest_type

| Enumerador                       | Descrição                                                            |
|----------------------------------|----------------------------------------------------------------------|
| calendar_days_daily_amount       | Valor diário sobre dias corridos                                     |
| workdays_daily_amount            | Valor diário sobre dias úteis                                        |
| calendar_days_monthly_percentage | Porcentagem de juros cobrados mensalmente, com base em dias corridos |

### Objeto discount

Opção 1: descontos utilizando valores absolutos (`discount_type in ["absolute", "anticipation_calendar_days_daily_amount", "anticipation_workdays_daily_amount"]`)

| Campo                     | Tipo    | Descrição                                           | Caracteres                                                |
|---------------------------|---------|-----------------------------------------------------|-----------------------------------------------------------|
| `discount_amount` *       | float   | Valor absoluto de desconto por unidade de tempo                                            | -                                                          |
| `discount_number` *       | integer | Número do desconto                                     | -                                                         |
| `discount_type` *         | string  | Configuração do desconto em valores absolutos                                    | **[Enumerador discount_type](#enumeradores-discount_type)** |                                                       |
| `discount_limit_date` *   | string  | Data limite para aplicação do desconto   | 10                                                        |

Opção 2: descontos utilizando valores percentuais (`discount_type in ["percentage", "anticipation_calendar_days_daily_percentage", "anticipation_workdays_daily_percentage"]`)

| Campo                     | Tipo    | Descrição                                           | Caracteres                                                |
|---------------------------|---------|-----------------------------------------------------|-----------------------------------------------------------|
| `discount_percentage` *   | float   | Valor percentual de desconto por unidade de tempo                                            | -                                                          |
| `discount_number` *       | integer | Número do desconto                                     | -                                                         |
| `discount_type` *         | string  | Configuração do desconto em valores percentuais                                    | **[Enumerador discount_type](#enumeradores-discount_type)** |                                                       |
| `discount_limit_date` *   | string  | Data limite para aplicação do desconto   | 10                                                        |

:::caution Atenção!
O boleto pode ter até três descontos, sendo que os descontos devem ser todos do mesmo tipo , isto é, devem ter o mesmo `discount_type`. Os descontos devem ser numerados de 1 a 3, de maneira crescente e começando necessariamente em 1. Ou seja, caso sejam enviados dois descontos na requisição, devem necessariamente ser numerados com 1 e 2.
:::

### Enumeradores discount_type

| Enumerador                                  | Descrição                                                                |
|---------------------------------------------|--------------------------------------------------------------------------|
| absolute                                    | Valor fixo                                                               |
| anticipation_calendar_days_daily_amount     | Valor diário de desconto de antecipação, sobre dias corridos             |
| anticipation_workdays_daily_amount          | Valor diário de desconto de antecipação, sobre dias úteis                |
| percentage                                  | Porcentagem fixa                                                         |
| anticipation_calendar_days_daily_percentage | Porcentagem mensal de desconto de antecipação, com base em dias corridos |
| anticipation_workdays_daily_percentage      | Porcentagem anual de desconto de antecipação, com base em dias úteis     |

### Objetos payer_data e guarantor_data

| Campo                     | Tipo   | Descrição                                                  | Caracteres|
|---------------------------|--------|-------------------------------------|-----------------------------------------------------------|
| `name` *                  | string | Nome completo                       | 100                                                       |
| `document_number` *       | string | Número do documento (CPF/CNPJ)      | 11 ou 14                                                  |
| `person_type` *           | string | Tipo da pessoa (física ou jurídica) | **[Enumeradores person_type](#enumeradores-person_type)** |
| `contact`                 | object | Informações de contato              | **[Objeto contact](#objeto-contact)**                     |
| `address`                 | object | Endereço                            | **[Objeto address](#objeto-address)**                     |

### Enumeradores person_type

| Enumerador         | Descrição             |
|--------------------|-----------------------|
| natural            | pessoa física         |
| legal              | pessoa jurídica       |

### Objeto contact

| Campo                     | Tipo   | Descrição                         | Caracteres                         |
|---------------------------|--------|-----------------------------------|------------------------------------|
| `email`                   | string | E-mail de contato                 | 320                                |
| `phone`                   | object | Telefone de contato               | **[Objeto phone](#objeto-phone)**  |

### Objeto phone

| Campo                           | Tipo   | Descrição                                    | Caracteres |
|---------------------------------|--------|----------------------------------------------|------------|
| `country_code` *     | string | Código DDI (Discagem Direta Internacional)   | 3          |
| `area_code` *                   | string | Código DDD (Discagem Direta à Distância)     | 2          |
| `number` *                      | string | Complemento                                  | 9          |

### Objeto address

| Campo                     | Tipo   | Descrição                                    | Caracteres |
|---------------------------|--------|----------------------------------------------|------------|
| `street` *                | string | Logradouro                                   | 500        |
| `number` *                | string | Número                                       | 6          |
| `complement`              | string | Complemento                                  | 500        |
| `neighborhood` *          | string | Bairro                                       | 100        |
| `postal_code` *           | string | CEP                                          | 8          |
| `city` *                  | string | Cidade                                       | 100        |
| `state` *                 | string | Estado (UF) | **[Enumerador state](#enumeradores-state)** |

### Enumeradores state

| Enumerador         | Descrição             |
|--------------------|-----------------------|
| AC                 | Acre                  |
| AL                 | Alagoas               |
| AM                 | Amazonas              |
| AP                 | Amapá                 |
| BA                 | Bahia                 |
| CE                 | Ceará                 |
| DF                 | Distrito federal      |
| ES                 | Espírito Santo        |
| GO                 | Goiás                 |
| MA                 | Maranhão              |
| MG                 | Minas Gerais          |
| MS                 | Mato Grosso do Sul    |
| MT                 | Mato Grosso           |
| PA                 | Pará                  |
| PB                 | Paraíba               |
| PE                 | Pernambuco            |
| PI                 | Piauí                 |
| PR                 | Paraná                |
| RJ                 | Rio de Janeiro        |
| RN                 | Rio Grande do Norte   |
| RO                 | Rondônia              |
| RR                 | Roraima               |
| RS                 | Rio Grande do Sul     |
| SC                 | Santa Catarina        |
| SE                 | Sergipe               |
| SP                 | São Paulo             |
| TO                 | Tocantins             |
| EX                 | Exceção               |

### Objeto notification

| Campo                     | Tipo    | Descrição                                                                               | Caracteres |
|---------------------------|---------|-----------------------------------------------------------------------------------------|------------|
| `document_number` *       | string  | Número do documento de quem receberá as notificações (CPF/CNPJ)                         | 11 ou 14   |
| `name` *                  | string  | Nome de quem receberá as notificações                                                   | 100        |
| `email`                   | string  | E-mail para o qual serão enviadas as notificações                                       | 320        |
| `phone`                   | object  | Telefone de contato para o qual serão enviadas as notificações | **[Objeto phone](#objeto-phone)**   |
| `send_2_way` *            | boolean | Enviar segunda via                                                                      | -          |
| `send_before_due_date` *  | boolean | Enviar notificação ao pagador antes da data de vencimento                               | -          |
| `send_after_due_date` *   | boolean | Enviar notificação ao pagador quando o boleto vencer                                    | -          |
| `send_on_protest` *       | boolean | Enviar notificação ao entrar em fluxo de protesto                                       | -          |

## Response

STATUS 202

Response Body

```json
{
  "request_control_key": "0d496b4d-01f6-48cd-8ec9-9ead1e43f156",
  "bank_slip_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "bank_slip_status": "accepted",
  "our_number": 67215548222,
  "barcode": "32995995900000892811606496721554822228569790",
  "digitable_line": "32991606429672155482022285697904599590000089281",
  "qr_code_data": {
    "qr_code_key": "a92b180a-4aa5-47c2-8a71-4e7bbb074410",
    "pix_key": "4d25d8fc-0074-42bb-b0a4-dd12b1cd0e98",
    "receiver_conciliation_id": "01GVGV9NXBCY287Z6CJ4S0ENW9",
    "url": "00020126830014br.gov.bcb.pix2561qrcode.qitech.app/bacen/cobv/58fd5103a8e64bbbab2fd49b0bd580145204000053039865802BR5925GONNFUNDODEINVESTIMENTOEM6012RiodeJaneiro6107226401262070503***6304EA0D",
    "image": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/wAALCAD0APQBAREA/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/9oACAEBAAA/APf6KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK+QPhl8Mv+Fjf2p/xN/wCz/sHlf8u3m79+/wD21xjZ79a7/wD4Zl/6m7/ym/8A22j/AIZl/wCpu/8AKb/9to/Zl/5mn/t0/wDa1egfE34Zf8LG/sv/AIm/9n/YPN/5dvN379n+2uMbPfrXgHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrR8Tfib/wsb+y/wDiUf2f9g83/l583fv2f7C4xs9+td//AMm5/wDUw/27/wBunkeR/wB/N27zvbG3vnjwCvr/AOJvxN/4Vz/Zf/Eo/tD7f5v/AC8+Vs2bP9hs53+3SvkCvf8A9mX/AJmn/t0/9rUf8m5/9TD/AG7/ANunkeR/383bvO9sbe+ePQPhl8Mv+Fc/2p/xN/7Q+3+V/wAu3lbNm/8A22znf7dK8A+GXxN/4Vz/AGp/xKP7Q+3+V/y8+Vs2b/8AYbOd/t0o+GXxN/4Vz/an/Eo/tD7f5X/Lz5WzZv8A9hs53+3Svf8A4m/DL/hY39l/8Tf+z/sHm/8ALt5u/fs/21xjZ79a8/8A+GZf+pu/8pv/ANtr0D4ZfE3/AIWN/an/ABKP7P8AsHlf8vPm79+//YXGNnv1rwD4ZfE3/hXP9qf8Sj+0Pt/lf8vPlbNm/wD2Gznf7dK7/wD4aa/6lH/ypf8A2quA+GXxN/4Vz/an/Eo/tD7f5X/Lz5WzZv8A9hs53+3Svr+vkD4ZfDL/AIWN/an/ABN/7P8AsHlf8u3m79+//bXGNnv1rv8A/hmX/qbv/Kb/APbaP+GZf+pu/wDKb/8AbaP2Zf8Amaf+3T/2tX0BRRRXz/8Asy/8zT/26f8AtavAK9//AGZf+Zp/7dP/AGtR+zL/AMzT/wBun/tavQPib8Mv+Fjf2X/xN/7P+web/wAu3m79+z/bXGNnv1rz/wDZl/5mn/t0/wDa1cB8Mvib/wAK5/tT/iUf2h9v8r/l58rZs3/7DZzv9ule/wDwy+Jv/Cxv7U/4lH9n/YPK/wCXnzd+/f8A7C4xs9+teAfE34Zf8K5/sv8A4m/9ofb/ADf+XbytmzZ/ttnO/wBule//ABN+Jv8Awrn+y/8AiUf2h9v83/l58rZs2f7DZzv9uleAfDL4Zf8ACxv7U/4m/wDZ/wBg8r/l283fv3/7a4xs9+tHxN+GX/Cuf7L/AOJv/aH2/wA3/l28rZs2f7bZzv8AbpXv/wAMvhl/wrn+1P8Aib/2h9v8r/l28rZs3/7bZzv9ulef/tNf8yt/29/+0a9A+GXxN/4WN/an/Eo/s/7B5X/Lz5u/fv8A9hcY2e/WvP8A/k3P/qYf7d/7dPI8j/v5u3ed7Y2988cB8Tfhl/wrn+y/+Jv/AGh9v83/AJdvK2bNn+22c7/bpXf/APDTX/Uo/wDlS/8AtVcB8Tfhl/wrn+y/+Jv/AGh9v83/AJdvK2bNn+22c7/bpX1/Xz//AMm5/wDUw/27/wBunkeR/wB/N27zvbG3vng/5OM/6l7+wv8At78/z/8Av3t2+T753dsc+gfDL4m/8LG/tT/iUf2f9g8r/l583fv3/wCwuMbPfrXn/wCzL/zNP/bp/wC1q8Ar3/8AZl/5mn/t0/8Aa1H7Mv8AzNP/AG6f+1q+gKKKK+f/ANmX/maf+3T/ANrUf8My/wDU3f8AlN/+216B8Mvhl/wrn+1P+Jv/AGh9v8r/AJdvK2bN/wDttnO/26V5/wDsy/8AM0/9un/taj/k4z/qXv7C/wC3vz/P/wC/e3b5Pvnd2xyf8nGf9S9/YX/b35/n/wDfvbt8n3zu7Y5P2mv+ZW/7e/8A2jR+zL/zNP8A26f+1qP+Tc/+ph/t3/t08jyP+/m7d53tjb3zx4BXv/7TX/Mrf9vf/tGj/k3P/qYf7d/7dPI8j/v5u3ed7Y2988cB8Mvhl/wsb+1P+Jv/AGf9g8r/AJdvN379/wDtrjGz3613/wDwzL/1N3/lN/8AttH7Mv8AzNP/AG6f+1q4D4m/DL/hXP8AZf8AxN/7Q+3+b/y7eVs2bP8AbbOd/t0rv/8Ahpr/AKlH/wAqX/2qj/k4z/qXv7C/7e/P8/8A797dvk++d3bHJ/ybn/1MP9u/9unkeR/383bvO9sbe+ePQPhl8Mv+Fc/2p/xN/wC0Pt/lf8u3lbNm/wD22znf7dKPib8Mv+Fjf2X/AMTf+z/sHm/8u3m79+z/AG1xjZ79a8//AGZf+Zp/7dP/AGtX0BXz/wDsy/8AM0/9un/taj/hmX/qbv8Aym//AG2vQPhl8Mv+Fc/2p/xN/wC0Pt/lf8u3lbNm/wD22znf7dK8/wD2Zf8Amaf+3T/2tX0BRRRXz/8A8My/9Td/5Tf/ALbR/wAMy/8AU3f+U3/7bR/wzL/1N3/lN/8AttegfDL4Zf8ACuf7U/4m/wDaH2/yv+Xbytmzf/ttnO/26V5//wAm5/8AUw/27/26eR5H/fzdu872xt7549A+GXwy/wCFc/2p/wATf+0Pt/lf8u3lbNm//bbOd/t0rz/9mX/maf8At0/9rVwHwy+Jv/Cuf7U/4lH9ofb/ACv+Xnytmzf/ALDZzv8AbpR8Mvib/wAK5/tT/iUf2h9v8r/l58rZs3/7DZzv9ulHwy+Jv/Cuf7U/4lH9ofb/ACv+Xnytmzf/ALDZzv8AbpXf/sy/8zT/ANun/tavQPhl8Mv+Fc/2p/xN/wC0Pt/lf8u3lbNm/wD22znf7dK8/wD2Zf8Amaf+3T/2tXoHwy+GX/Cuf7U/4m/9ofb/ACv+Xbytmzf/ALbZzv8AbpXgHwy+Jv8Awrn+1P8AiUf2h9v8r/l58rZs3/7DZzv9uld/+zL/AMzT/wBun/tavQPhl8Mv+Fc/2p/xN/7Q+3+V/wAu3lbNm/8A22znf7dK8A+GXxN/4Vz/AGp/xKP7Q+3+V/y8+Vs2b/8AYbOd/t0o+GXxN/4Vz/an/Eo/tD7f5X/Lz5WzZv8A9hs53+3Su/8A2Zf+Zp/7dP8A2tR/ybn/ANTD/bv/AG6eR5H/AH83bvO9sbe+eD9mX/maf+3T/wBrUfsy/wDM0/8Abp/7Wo/4Zl/6m7/ym/8A22j/AIZl/wCpu/8AKb/9to/4Zl/6m7/ym/8A22vQPhl8Mv8AhXP9qf8AE3/tD7f5X/Lt5WzZv/22znf7dK9Aooor5/8A2Zf+Zp/7dP8A2tXAfE34m/8ACxv7L/4lH9n/AGDzf+Xnzd+/Z/sLjGz360fE34m/8LG/sv8A4lH9n/YPN/5efN379n+wuMbPfrXv/wAMvhl/wrn+1P8Aib/2h9v8r/l28rZs3/7bZzv9ulfIFFegfDL4m/8ACuf7U/4lH9ofb/K/5efK2bN/+w2c7/bpXf8A7TX/ADK3/b3/AO0a9A+GXxN/4WN/an/Eo/s/7B5X/Lz5u/fv/wBhcY2e/WvAPib8Mv8AhXP9l/8AE3/tD7f5v/Lt5WzZs/22znf7dKPib8Mv+Fc/2X/xN/7Q+3+b/wAu3lbNmz/bbOd/t0rv/wBmX/maf+3T/wBrVwHxN+GX/Cuf7L/4m/8AaH2/zf8Al28rZs2f7bZzv9ulHxN+GX/Cuf7L/wCJv/aH2/zf+XbytmzZ/ttnO/26V3//AAzL/wBTd/5Tf/ttH7TX/Mrf9vf/ALRrgPhl8Tf+Fc/2p/xKP7Q+3+V/y8+Vs2b/APYbOd/t0o+Jvwy/4Vz/AGX/AMTf+0Pt/m/8u3lbNmz/AG2znf7dK7//AJOM/wCpe/sL/t78/wA//v3t2+T753dscn/Juf8A1MP9u/8Abp5Hkf8Afzdu872xt7548Ar3/wD5Nz/6mH+3f+3TyPI/7+bt3ne2NvfPHAfE34Zf8K5/sv8A4m/9ofb/ADf+XbytmzZ/ttnO/wBuld/+01/zK3/b3/7Rr6Aorz/4ZfE3/hY39qf8Sj+z/sHlf8vPm79+/wD2FxjZ79a9Aooor5A+Jvwy/wCFc/2X/wATf+0Pt/m/8u3lbNmz/bbOd/t0o+JvxN/4WN/Zf/Eo/s/7B5v/AC8+bv37P9hcY2e/Wu//AGmv+ZW/7e//AGjXoHwy+GX/AArn+1P+Jv8A2h9v8r/l28rZs3/7bZzv9ulHwy+Jv/Cxv7U/4lH9n/YPK/5efN379/8AsLjGz3615/8A8nGf9S9/YX/b35/n/wDfvbt8n3zu7Y5+gK+QPib8Tf8AhY39l/8AEo/s/wCweb/y8+bv37P9hcY2e/Wvf/hl8Tf+Fjf2p/xKP7P+weV/y8+bv37/APYXGNnv1rz/AP4aa/6lH/ypf/aq9A+Jvwy/4WN/Zf8AxN/7P+web/y7ebv37P8AbXGNnv1r0CvkD4m/DL/hXP8AZf8AxN/7Q+3+b/y7eVs2bP8AbbOd/t0rv/8Ahpr/AKlH/wAqX/2qj/hmX/qbv/Kb/wDbaP8Ak3P/AKmH+3f+3TyPI/7+bt3ne2NvfPHoHxN+Jv8Awrn+y/8AiUf2h9v83/l58rZs2f7DZzv9ulHwy+GX/Cuf7U/4m/8AaH2/yv8Al28rZs3/AO22c7/bpXn/AO01/wAyt/29/wDtGj/hpr/qUf8Aypf/AGqj/k4z/qXv7C/7e/P8/wD797dvk++d3bHJ/wANNf8AUo/+VL/7VXAfE34Zf8K5/sv/AIm/9ofb/N/5dvK2bNn+22c7/bpR8Mvib/wrn+1P+JR/aH2/yv8Al58rZs3/AOw2c7/bpR8Mvhl/wsb+1P8Aib/2f9g8r/l283fv3/7a4xs9+tHwy+Jv/Cuf7U/4lH9ofb/K/wCXnytmzf8A7DZzv9ulfX9FFFFfP/8AwzL/ANTd/wCU3/7bXoHwy+GX/Cuf7U/4m/8AaH2/yv8Al28rZs3/AO22c7/bpXgHwy+GX/Cxv7U/4m/9n/YPK/5dvN379/8AtrjGz3613/8AwzL/ANTd/wCU3/7bR/w01/1KP/lS/wDtVegfDL4Zf8K5/tT/AIm/9ofb/K/5dvK2bN/+22c7/bpR8Mvib/wsb+1P+JR/Z/2Dyv8Al583fv3/AOwuMbPfrR8Mvhl/wrn+1P8Aib/2h9v8r/l28rZs3/7bZzv9uleAfE34Zf8ACuf7L/4m/wDaH2/zf+XbytmzZ/ttnO/26V3/AO01/wAyt/29/wDtGuA+GXwy/wCFjf2p/wATf+z/ALB5X/Lt5u/fv/21xjZ79a9/+Jvwy/4WN/Zf/E3/ALP+web/AMu3m79+z/bXGNnv1rwD4m/DL/hXP9l/8Tf+0Pt/m/8ALt5WzZs/22znf7dK9/8Aib8Tf+Fc/wBl/wDEo/tD7f5v/Lz5WzZs/wBhs53+3SvP/wBpr/mVv+3v/wBo0f8AJuf/AFMP9u/9unkeR/383bvO9sbe+eD9mX/maf8At0/9rV4BXoHwy+Jv/Cuf7U/4lH9ofb/K/wCXnytmzf8A7DZzv9uld/8A8m5/9TD/AG7/ANunkeR/383bvO9sbe+eOA+GXxN/4Vz/AGp/xKP7Q+3+V/y8+Vs2b/8AYbOd/t0rv/8Ak3P/AKmH+3f+3TyPI/7+bt3ne2NvfPHoHxN+GX/Cxv7L/wCJv/Z/2Dzf+Xbzd+/Z/trjGz3614B8Mvib/wAK5/tT/iUf2h9v8r/l58rZs3/7DZzv9ule/wDxN+Jv/Cuf7L/4lH9ofb/N/wCXnytmzZ/sNnO/26UfE34m/wDCuf7L/wCJR/aH2/zf+XnytmzZ/sNnO/26V5/+zL/zNP8A26f+1q+gKKKK+f8A/k3P/qYf7d/7dPI8j/v5u3ed7Y2988H/ACbn/wBTD/bv/bp5Hkf9/N27zvbG3vnjgPib8Mv+Fc/2X/xN/wC0Pt/m/wDLt5WzZs/22znf7dK9/wDhl8Mv+Fc/2p/xN/7Q+3+V/wAu3lbNm/8A22znf7dKPib8Mv8AhY39l/8AE3/s/wCweb/y7ebv37P9tcY2e/WvAPib8Mv+Fc/2X/xN/wC0Pt/m/wDLt5WzZs/22znf7dK8/r3/APaa/wCZW/7e/wD2jXAfDL4m/wDCuf7U/wCJR/aH2/yv+Xnytmzf/sNnO/26V7/8Mvhl/wAK5/tT/ib/ANofb/K/5dvK2bN/+22c7/bpXn//AA01/wBSj/5Uv/tVegfE34m/8K5/sv8A4lH9ofb/ADf+XnytmzZ/sNnO/wBulHxN+Jv/AArn+y/+JR/aH2/zf+XnytmzZ/sNnO/26V5/+01/zK3/AG9/+0aP2Zf+Zp/7dP8A2tR+zL/zNP8A26f+1qP+TjP+pe/sL/t78/z/APv3t2+T753dsc+AV7/+zL/zNP8A26f+1q9A+GXwy/4Vz/an/E3/ALQ+3+V/y7eVs2b/APbbOd/t0rwD4ZfDL/hY39qf8Tf+z/sHlf8ALt5u/fv/ANtcY2e/Wvf/AIm/E3/hXP8AZf8AxKP7Q+3+b/y8+Vs2bP8AYbOd/t0rwD4m/DL/AIVz/Zf/ABN/7Q+3+b/y7eVs2bP9ts53+3Su/wD2mv8AmVv+3v8A9o1wHwy+Jv8Awrn+1P8AiUf2h9v8r/l58rZs3/7DZzv9ulHxN+GX/Cuf7L/4m/8AaH2/zf8Al28rZs2f7bZzv9ule/8Awy+GX/Cuf7U/4m/9ofb/ACv+Xbytmzf/ALbZzv8AbpXoFFFFfIHwy+GX/Cxv7U/4m/8AZ/2Dyv8Al283fv3/AO2uMbPfrXf/APDMv/U3f+U3/wC20f8AJxn/AFL39hf9vfn+f/3727fJ987u2OfQPhl8Mv8AhXP9qf8AE3/tD7f5X/Lt5WzZv/22znf7dK8//wCGmv8AqUf/ACpf/aq8Ar3/AP4aa/6lH/ypf/aq9A+GXwy/4Vz/AGp/xN/7Q+3+V/y7eVs2b/8AbbOd/t0rwD4m/DL/AIVz/Zf/ABN/7Q+3+b/y7eVs2bP9ts53+3Svf/ib8Mv+Fjf2X/xN/wCz/sHm/wDLt5u/fs/21xjZ79a8/wD+TjP+pe/sL/t78/z/APv3t2+T753dsc+gfDL4m/8ACxv7U/4lH9n/AGDyv+Xnzd+/f/sLjGz360fDL4Zf8K5/tT/ib/2h9v8AK/5dvK2bN/8AttnO/wBulef/APJxn/Uvf2F/29+f5/8A3727fJ987u2OT/hpr/qUf/Kl/wDaqP2mv+ZW/wC3v/2jR+zL/wAzT/26f+1q8Ar3/wD4Zl/6m7/ym/8A22vQPhl8Tf8AhY39qf8AEo/s/wCweV/y8+bv37/9hcY2e/Wj4m/E3/hXP9l/8Sj+0Pt/m/8ALz5WzZs/2Gznf7dKPib8Mv8AhY39l/8AE3/s/wCweb/y7ebv37P9tcY2e/Wj4ZfE3/hY39qf8Sj+z/sHlf8ALz5u/fv/ANhcY2e/Wj4ZfDL/AIVz/an/ABN/7Q+3+V/y7eVs2b/9ts53+3SvQK+f/wDk4z/qXv7C/wC3vz/P/wC/e3b5Pvnd2xz9AUUUUV5/8Mvhl/wrn+1P+Jv/AGh9v8r/AJdvK2bN/wDttnO/26V5/wD8m5/9TD/bv/bp5Hkf9/N27zvbG3vnjwCvQPib8Mv+Fc/2X/xN/wC0Pt/m/wDLt5WzZs/22znf7dK7/wD5Nz/6mH+3f+3TyPI/7+bt3ne2NvfPHAfDL4m/8K5/tT/iUf2h9v8AK/5efK2bN/8AsNnO/wBulHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrXf8A7TX/ADK3/b3/AO0a4D4m/DL/AIVz/Zf/ABN/7Q+3+b/y7eVs2bP9ts53+3Sj4ZfDL/hY39qf8Tf+z/sHlf8ALt5u/fv/ANtcY2e/Wu//AGmv+ZW/7e//AGjXoHxN+GX/AAsb+y/+Jv8A2f8AYPN/5dvN379n+2uMbPfrXoFfIHwy+Jv/AArn+1P+JR/aH2/yv+Xnytmzf/sNnO/26UfDL4Zf8LG/tT/ib/2f9g8r/l283fv3/wC2uMbPfrXf/wDDTX/Uo/8AlS/+1Ufsy/8AM0/9un/tavAK9A+GXwy/4WN/an/E3/s/7B5X/Lt5u/fv/wBtcY2e/Wu//wCGmv8AqUf/ACpf/aq4D4ZfE3/hXP8Aan/Eo/tD7f5X/Lz5WzZv/wBhs53+3Su//wCTjP8AqXv7C/7e/P8AP/797dvk++d3bHPoHxN+Jv8Awrn+y/8AiUf2h9v83/l58rZs2f7DZzv9ulHxN+Jv/Cuf7L/4lH9ofb/N/wCXnytmzZ/sNnO/26UfDL4m/wDCxv7U/wCJR/Z/2Dyv+Xnzd+/f/sLjGz360fE34m/8K5/sv/iUf2h9v83/AJefK2bNn+w2c7/bpR8Mvib/AMLG/tT/AIlH9n/YPK/5efN379/+wuMbPfrXoFFFFfIHwy+Jv/Cuf7U/4lH9ofb/ACv+Xnytmzf/ALDZzv8AbpX1/XwBXoHxN+GX/Cuf7L/4m/8AaH2/zf8Al28rZs2f7bZzv9ule/8Awy+Jv/Cxv7U/4lH9n/YPK/5efN379/8AsLjGz360fE34m/8ACuf7L/4lH9ofb/N/5efK2bNn+w2c7/bpR8Mvhl/wrn+1P+Jv/aH2/wAr/l28rZs3/wC22c7/AG6V5/8Asy/8zT/26f8AtauA+JvxN/4WN/Zf/Eo/s/7B5v8Ay8+bv37P9hcY2e/Wvf8A4m/E3/hXP9l/8Sj+0Pt/m/8ALz5WzZs/2Gznf7dK8A+JvxN/4WN/Zf8AxKP7P+web/y8+bv37P8AYXGNnv1r3/4m/E3/AIVz/Zf/ABKP7Q+3+b/y8+Vs2bP9hs53+3SvP/8Ak3P/AKmH+3f+3TyPI/7+bt3ne2NvfPB/w01/1KP/AJUv/tVegfE34m/8K5/sv/iUf2h9v83/AJefK2bNn+w2c7/bpXn/AO01/wAyt/29/wDtGj/hpr/qUf8Aypf/AGqvoCvkD4ZfE3/hXP8Aan/Eo/tD7f5X/Lz5WzZv/wBhs53+3Svf/ib8Tf8AhXP9l/8AEo/tD7f5v/Lz5WzZs/2Gznf7dK8//wCGZf8Aqbv/ACm//baP2mv+ZW/7e/8A2jR/ybn/ANTD/bv/AG6eR5H/AH83bvO9sbe+ePQPib8Tf+Fc/wBl/wDEo/tD7f5v/Lz5WzZs/wBhs53+3SvAPhl8Tf8AhXP9qf8AEo/tD7f5X/Lz5WzZv/2Gznf7dK9/+GXxN/4WN/an/Eo/s/7B5X/Lz5u/fv8A9hcY2e/Wj4ZfE3/hY39qf8Sj+z/sHlf8vPm79+//AGFxjZ79a9Aoooor5/8A2Zf+Zp/7dP8A2tR/wzL/ANTd/wCU3/7bR/ybn/1MP9u/9unkeR/383bvO9sbe+ePQPib8Tf+Fc/2X/xKP7Q+3+b/AMvPlbNmz/YbOd/t0o+JvxN/4Vz/AGX/AMSj+0Pt/m/8vPlbNmz/AGGznf7dK8A+Jvwy/wCFc/2X/wATf+0Pt/m/8u3lbNmz/bbOd/t0r3/4m/DL/hY39l/8Tf8As/7B5v8Ay7ebv37P9tcY2e/Wj4m/E3/hXP8AZf8AxKP7Q+3+b/y8+Vs2bP8AYbOd/t0r5Ar0D4ZfE3/hXP8Aan/Eo/tD7f5X/Lz5WzZv/wBhs53+3Su//wCGmv8AqUf/ACpf/aq4D4ZfE3/hXP8Aan/Eo/tD7f5X/Lz5WzZv/wBhs53+3Su//aa/5lb/ALe//aNcB8Mvhl/wsb+1P+Jv/Z/2Dyv+Xbzd+/f/ALa4xs9+tHxN+Jv/AAsb+y/+JR/Z/wBg83/l583fv2f7C4xs9+te/wDwy+GX/Cuf7U/4m/8AaH2/yv8Al28rZs3/AO22c7/bpXgHwy+GX/Cxv7U/4m/9n/YPK/5dvN379/8AtrjGz360fE34Zf8ACuf7L/4m/wDaH2/zf+XbytmzZ/ttnO/26V5/Xv8A+01/zK3/AG9/+0a4D4ZfDL/hY39qf8Tf+z/sHlf8u3m79+//AG1xjZ79a9/+GXxN/wCFjf2p/wASj+z/ALB5X/Lz5u/fv/2FxjZ79aPhl8Mv+Fc/2p/xN/7Q+3+V/wAu3lbNm/8A22znf7dK+QK9/wD2Zf8Amaf+3T/2tX0BRRRRXyB8Tfhl/wAK5/sv/ib/ANofb/N/5dvK2bNn+22c7/bpXf8A/DTX/Uo/+VL/AO1VwHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrXf8A/DMv/U3f+U3/AO21wHwy+Jv/AArn+1P+JR/aH2/yv+Xnytmzf/sNnO/26UfDL4m/8K5/tT/iUf2h9v8AK/5efK2bN/8AsNnO/wBule//ABN+Jv8Awrn+y/8AiUf2h9v83/l58rZs2f7DZzv9uleAfE34m/8ACxv7L/4lH9n/AGDzf+Xnzd+/Z/sLjGz3615/XoHxN+Jv/Cxv7L/4lH9n/YPN/wCXnzd+/Z/sLjGz3613/wC01/zK3/b3/wC0a9A+GXwy/wCFc/2p/wATf+0Pt/lf8u3lbNm//bbOd/t0rwD4ZfDL/hY39qf8Tf8As/7B5X/Lt5u/fv8A9tcY2e/Wu/8A+GZf+pu/8pv/ANtrgPhl8Mv+Fjf2p/xN/wCz/sHlf8u3m79+/wD21xjZ79a8/r0D4ZfDL/hY39qf8Tf+z/sHlf8ALt5u/fv/ANtcY2e/Wj4m/E3/AIWN/Zf/ABKP7P8AsHm/8vPm79+z/YXGNnv1rv8A/hpr/qUf/Kl/9qr0D4m/DL/hY39l/wDE3/s/7B5v/Lt5u/fs/wBtcY2e/WvP/wBmX/maf+3T/wBrV6B8Mvib/wALG/tT/iUf2f8AYPK/5efN379/+wuMbPfrXgHwy+GX/Cxv7U/4m/8AZ/2Dyv8Al283fv3/AO2uMbPfrXf/APDMv/U3f+U3/wC20fsy/wDM0/8Abp/7WrgPib8Mv+Fc/wBl/wDE3/tD7f5v/Lt5WzZs/wBts53+3Svf/hl8Mv8AhXP9qf8AE3/tD7f5X/Lt5WzZv/22znf7dK9Aooorz/4m/DL/AIWN/Zf/ABN/7P8AsHm/8u3m79+z/bXGNnv1rwD4ZfE3/hXP9qf8Sj+0Pt/lf8vPlbNm/wD2Gznf7dK7/wDZl/5mn/t0/wDa1egfDL4Zf8K5/tT/AIm/9ofb/K/5dvK2bN/+22c7/bpXgHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrR8Tfhl/wrn+y/wDib/2h9v8AN/5dvK2bNn+22c7/AG6V3/7TX/Mrf9vf/tGuA+GXxN/4Vz/an/Eo/tD7f5X/AC8+Vs2b/wDYbOd/t0o+Jvwy/wCFc/2X/wATf+0Pt/m/8u3lbNmz/bbOd/t0r6/rz/4ZfDL/AIVz/an/ABN/7Q+3+V/y7eVs2b/9ts53+3Sj4ZfDL/hXP9qf8Tf+0Pt/lf8ALt5WzZv/ANts53+3SvP/ANmX/maf+3T/ANrV6B8Mvhl/wrn+1P8Aib/2h9v8r/l28rZs3/7bZzv9uleAfDL4m/8ACuf7U/4lH9ofb/K/5efK2bN/+w2c7/bpX1/RRXyB8Tfib/wsb+y/+JR/Z/2Dzf8Al583fv2f7C4xs9+td/8A8m5/9TD/AG7/ANunkeR/383bvO9sbe+ePAK+v/ib8Tf+Fc/2X/xKP7Q+3+b/AMvPlbNmz/YbOd/t0rz/APZl/wCZp/7dP/a1egfDL4Zf8K5/tT/ib/2h9v8AK/5dvK2bN/8AttnO/wBuleAfDL4m/wDCuf7U/wCJR/aH2/yv+Xnytmzf/sNnO/26V7/8Tfhl/wALG/sv/ib/ANn/AGDzf+Xbzd+/Z/trjGz3615/+zL/AMzT/wBun/tavoCiiivP/ib8Tf8AhXP9l/8AEo/tD7f5v/Lz5WzZs/2Gznf7dK8//wCTc/8AqYf7d/7dPI8j/v5u3ed7Y2988H/DMv8A1N3/AJTf/ttH/DMv/U3f+U3/AO214BXv/wDwzL/1N3/lN/8AttH/AA01/wBSj/5Uv/tVH/DMv/U3f+U3/wC214BXoHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrXf8A7Mv/ADNP/bp/7Wr0D4ZfE3/hY39qf8Sj+z/sHlf8vPm79+//AGFxjZ79a8//AOGZf+pu/wDKb/8Aba4D4ZfDL/hY39qf8Tf+z/sHlf8ALt5u/fv/ANtcY2e/Wj4ZfDL/AIWN/an/ABN/7P8AsHlf8u3m79+//bXGNnv1r3/4m/DL/hY39l/8Tf8As/7B5v8Ay7ebv37P9tcY2e/WvP8A9mX/AJmn/t0/9rV9AV8//wDDMv8A1N3/AJTf/ttH/Jxn/Uvf2F/29+f5/wD3727fJ987u2OfQPib8Mv+Fjf2X/xN/wCz/sHm/wDLt5u/fs/21xjZ79a9Ar5A+Jvwy/4Vz/Zf/E3/ALQ+3+b/AMu3lbNmz/bbOd/t0o+Jvwy/4Vz/AGX/AMTf+0Pt/m/8u3lbNmz/AG2znf7dK9/+GXwy/wCFc/2p/wATf+0Pt/lf8u3lbNm//bbOd/t0rz//AJOM/wCpe/sL/t78/wA//v3t2+T753dscn7Mv/M0/wDbp/7Wr6Aooorz/wCGXwy/4Vz/AGp/xN/7Q+3+V/y7eVs2b/8AbbOd/t0rz/8A4Zl/6m7/AMpv/wBto/Zl/wCZp/7dP/a1H/Juf/Uw/wBu/wDbp5Hkf9/N27zvbG3vng/Zl/5mn/t0/wDa1H/Juf8A1MP9u/8Abp5Hkf8Afzdu872xt7544D4ZfDL/AIWN/an/ABN/7P8AsHlf8u3m79+//bXGNnv1o+GXwy/4WN/an/E3/s/7B5X/AC7ebv37/wDbXGNnv1o+JvxN/wCFjf2X/wASj+z/ALB5v/Lz5u/fs/2FxjZ79aPhl8Mv+Fjf2p/xN/7P+weV/wAu3m79+/8A21xjZ79a7/8A5OM/6l7+wv8At78/z/8Av3t2+T753dsc8B8Mvib/AMK5/tT/AIlH9ofb/K/5efK2bN/+w2c7/bpXv/xN+GX/AAsb+y/+Jv8A2f8AYPN/5dvN379n+2uMbPfrXn//AA01/wBSj/5Uv/tVegfDL4m/8LG/tT/iUf2f9g8r/l583fv3/wCwuMbPfrXn/wCzL/zNP/bp/wC1q4D4ZfE3/hXP9qf8Sj+0Pt/lf8vPlbNm/wD2Gznf7dKPib8Mv+Fc/wBl/wDE3/tD7f5v/Lt5WzZs/wBts53+3Su//Zl/5mn/ALdP/a1fQFef/E34Zf8ACxv7L/4m/wDZ/wBg83/l283fv2f7a4xs9+tef/8ADTX/AFKP/lS/+1VwHxN+GX/Cuf7L/wCJv/aH2/zf+XbytmzZ/ttnO/26V5/Xv/8AwzL/ANTd/wCU3/7bR/ybn/1MP9u/9unkeR/383bvO9sbe+eD9mX/AJmn/t0/9rV9AUUUV8AUV7//AMnGf9S9/YX/AG9+f5//AH727fJ987u2OfQPhl8Mv+Fc/wBqf8Tf+0Pt/lf8u3lbNm//AG2znf7dK8A+Jvwy/wCFc/2X/wATf+0Pt/m/8u3lbNmz/bbOd/t0rv8A9pr/AJlb/t7/APaNH/DMv/U3f+U3/wC20f8ADMv/AFN3/lN/+216B8Mvhl/wrn+1P+Jv/aH2/wAr/l28rZs3/wC22c7/AG6V5/8A8nGf9S9/YX/b35/n/wDfvbt8n3zu7Y59A+Jvwy/4WN/Zf/E3/s/7B5v/AC7ebv37P9tcY2e/WvQK+QPib8Tf+Fjf2X/xKP7P+web/wAvPm79+z/YXGNnv1o+Jvwy/wCFc/2X/wATf+0Pt/m/8u3lbNmz/bbOd/t0r3/4m/DL/hY39l/8Tf8As/7B5v8Ay7ebv37P9tcY2e/Wj4ZfE3/hY39qf8Sj+z/sHlf8vPm79+//AGFxjZ79a8//AOTjP+pe/sL/ALe/P8//AL97dvk++d3bHPoHxN+Jv/Cuf7L/AOJR/aH2/wA3/l58rZs2f7DZzv8AbpR8Mvhl/wAK5/tT/ib/ANofb/K/5dvK2bN/+22c7/bpXgHxN+GX/Cuf7L/4m/8AaH2/zf8Al28rZs2f7bZzv9uld/8A8My/9Td/5Tf/ALbXoHxN+Jv/AArn+y/+JR/aH2/zf+XnytmzZ/sNnO/26V5/+zL/AMzT/wBun/taj/k3P/qYf7d/7dPI8j/v5u3ed7Y2988fQFfP/wDybn/1MP8Abv8A26eR5H/fzdu872xt754+gKKKKK+AK+v/AIZfE3/hY39qf8Sj+z/sHlf8vPm79+//AGFxjZ79aPhl8Tf+Fjf2p/xKP7P+weV/y8+bv37/APYXGNnv1rwD4m/DL/hXP9l/8Tf+0Pt/m/8ALt5WzZs/22znf7dK9/8Ahl8Mv+Fc/wBqf8Tf+0Pt/lf8u3lbNm//AG2znf7dK8//AOGZf+pu/wDKb/8Aba8Ar6/+Jvwy/wCFjf2X/wATf+z/ALB5v/Lt5u/fs/21xjZ79aPib8Mv+Fjf2X/xN/7P+web/wAu3m79+z/bXGNnv1rz/wD4Zl/6m7/ym/8A22j/AJNz/wCph/t3/t08jyP+/m7d53tjb3zx6B8Mvhl/wrn+1P8Aib/2h9v8r/l28rZs3/7bZzv9ulHwy+GX/Cuf7U/4m/8AaH2/yv8Al28rZs3/AO22c7/bpXgHwy+Jv/Cuf7U/4lH9ofb/ACv+Xnytmzf/ALDZzv8AbpXv/wAMvib/AMLG/tT/AIlH9n/YPK/5efN379/+wuMbPfrXgHxN+GX/AArn+y/+Jv8A2h9v83/l28rZs2f7bZzv9uld/wD8NNf9Sj/5Uv8A7VX0BXyB8Mvhl/wsb+1P+Jv/AGf9g8r/AJdvN379/wDtrjGz3619f18//wDDTX/Uo/8AlS/+1V6B8Tfhl/wsb+y/+Jv/AGf9g83/AJdvN379n+2uMbPfrR8Mvib/AMLG/tT/AIlH9n/YPK/5efN379/+wuMbPfrR8Mvib/wsb+1P+JR/Z/2Dyv8Al583fv3/AOwuMbPfrR8Tfhl/wsb+y/8Aib/2f9g83/l283fv2f7a4xs9+tef/sy/8zT/ANun/taj9mX/AJmn/t0/9rV9AUUUV8//ALTX/Mrf9vf/ALRo/wCGZf8Aqbv/ACm//ba+gK+f/wDk3P8A6mH+3f8At08jyP8Av5u3ed7Y2988eAUV7/8A8NNf9Sj/AOVL/wC1Uf8AJuf/AFMP9u/9unkeR/383bvO9sbe+ePQPib8Mv8AhY39l/8AE3/s/wCweb/y7ebv37P9tcY2e/WvP/8Ak4z/AKl7+wv+3vz/AD/+/e3b5Pvnd2xzwHwy+Jv/AArn+1P+JR/aH2/yv+Xnytmzf/sNnO/26UfDL4Zf8LG/tT/ib/2f9g8r/l283fv3/wC2uMbPfrXv/wATfib/AMK5/sv/AIlH9ofb/N/5efK2bNn+w2c7/bpXn/7Mv/M0/wDbp/7Wr0D4ZfDL/hXP9qf8Tf8AtD7f5X/Lt5WzZv8A9ts53+3Sj4ZfDL/hXP8Aan/E3/tD7f5X/Lt5WzZv/wBts53+3SvAPib8Mv8AhXP9l/8AE3/tD7f5v/Lt5WzZs/22znf7dKPhl8Mv+Fjf2p/xN/7P+weV/wAu3m79+/8A21xjZ79a7/8AZl/5mn/t0/8Aa1cB8Mvib/wrn+1P+JR/aH2/yv8Al58rZs3/AOw2c7/bpR8Mvib/AMK5/tT/AIlH9ofb/K/5efK2bN/+w2c7/bpXf/8AJuf/AFMP9u/9unkeR/383bvO9sbe+eOA+Jvwy/4Vz/Zf/E3/ALQ+3+b/AMu3lbNmz/bbOd/t0o+GXxN/4Vz/AGp/xKP7Q+3+V/y8+Vs2b/8AYbOd/t0rv/8Ak3P/AKmH+3f+3TyPI/7+bt3ne2NvfPB/w01/1KP/AJUv/tVegfDL4m/8LG/tT/iUf2f9g8r/AJefN379/wDsLjGz3616BRRRRXyB8Tfhl/wrn+y/+Jv/AGh9v83/AJdvK2bNn+22c7/bpR8Mvib/AMK5/tT/AIlH9ofb/K/5efK2bN/+w2c7/bpXv/wy+GX/AArn+1P+Jv8A2h9v8r/l28rZs3/7bZzv9ulHxN+GX/Cxv7L/AOJv/Z/2Dzf+Xbzd+/Z/trjGz3615/8A8My/9Td/5Tf/ALbXoHxN+Jv/AArn+y/+JR/aH2/zf+XnytmzZ/sNnO/26V4B8Mvhl/wsb+1P+Jv/AGf9g8r/AJdvN379/wDtrjGz3617/wDDL4m/8LG/tT/iUf2f9g8r/l583fv3/wCwuMbPfrXgHxN+Jv8Awsb+y/8AiUf2f9g83/l583fv2f7C4xs9+te//DL4m/8ACxv7U/4lH9n/AGDyv+Xnzd+/f/sLjGz3614B8Tfhl/wrn+y/+Jv/AGh9v83/AJdvK2bNn+22c7/bpXv/AMTfhl/wsb+y/wDib/2f9g83/l283fv2f7a4xs9+tegV5/8AE34Zf8LG/sv/AIm/9n/YPN/5dvN379n+2uMbPfrR8Tfib/wrn+y/+JR/aH2/zf8Al58rZs2f7DZzv9ulef8A/Jxn/Uvf2F/29+f5/wD3727fJ987u2OfAK9A+GXxN/4Vz/an/Eo/tD7f5X/Lz5WzZv8A9hs53+3Svf8A4m/E3/hXP9l/8Sj+0Pt/m/8ALz5WzZs/2Gznf7dKPhl8Mv8AhXP9qf8AE3/tD7f5X/Lt5WzZv/22znf7dK9Ar5A+JvxN/wCFjf2X/wASj+z/ALB5v/Lz5u/fs/2FxjZ79aPhl8Mv+Fjf2p/xN/7P+weV/wAu3m79+/8A21xjZ79a9/8Aib8Tf+Fc/wBl/wDEo/tD7f5v/Lz5WzZs/wBhs53+3SvQK8/+GXwy/wCFc/2p/wATf+0Pt/lf8u3lbNm//bbOd/t0r0CiiivkD4ZfE3/hXP8Aan/Eo/tD7f5X/Lz5WzZv/wBhs53+3Su//wCGZf8Aqbv/ACm//ba+gK8/+GXwy/4Vz/an/E3/ALQ+3+V/y7eVs2b/APbbOd/t0rz/AP4Zl/6m7/ym/wD22vQPib8Tf+Fc/wBl/wDEo/tD7f5v/Lz5WzZs/wBhs53+3SvQK8/+Jvwy/wCFjf2X/wATf+z/ALB5v/Lt5u/fs/21xjZ79a8//Zl/5mn/ALdP/a1cB8Tfib/wsb+y/wDiUf2f9g83/l583fv2f7C4xs9+te//AAy+GX/Cuf7U/wCJv/aH2/yv+Xbytmzf/ttnO/26UfE34m/8K5/sv/iUf2h9v83/AJefK2bNn+w2c7/bpR8Tfhl/wsb+y/8Aib/2f9g83/l283fv2f7a4xs9+tef/wDJuf8A1MP9u/8Abp5Hkf8Afzdu872xt754P+TjP+pe/sL/ALe/P8//AL97dvk++d3bHPoHwy+GX/Cuf7U/4m/9ofb/ACv+Xbytmzf/ALbZzv8AbpR8Mvhl/wAK5/tT/ib/ANofb/K/5dvK2bN/+22c7/bpXn//AAzL/wBTd/5Tf/tteAUV9f8AxN+Jv/Cuf7L/AOJR/aH2/wA3/l58rZs2f7DZzv8AbpXgHxN+Jv8Awsb+y/8AiUf2f9g83/l583fv2f7C4xs9+tfX9FfIHwy+Jv8Awrn+1P8AiUf2h9v8r/l58rZs3/7DZzv9ulHwy+Jv/Cuf7U/4lH9ofb/K/wCXnytmzf8A7DZzv9ule/8Awy+Jv/Cxv7U/4lH9n/YPK/5efN379/8AsLjGz3616BRRRXyB8Tfhl/wrn+y/+Jv/AGh9v83/AJdvK2bNn+22c7/bpXf/APJxn/Uvf2F/29+f5/8A3727fJ987u2OT/hmX/qbv/Kb/wDbaP8Ak3P/AKmH+3f+3TyPI/7+bt3ne2NvfPB/wzL/ANTd/wCU3/7bR+01/wAyt/29/wDtGj9mX/maf+3T/wBrV6B8Mvhl/wAK5/tT/ib/ANofb/K/5dvK2bN/+22c7/bpXn//AAzL/wBTd/5Tf/ttH/Juf/Uw/wBu/wDbp5Hkf9/N27zvbG3vnjgPhl8Mv+Fjf2p/xN/7P+weV/y7ebv37/8AbXGNnv1r3/4ZfDL/AIVz/an/ABN/7Q+3+V/y7eVs2b/9ts53+3SvP/2Zf+Zp/wC3T/2tXoHxN+GX/Cxv7L/4m/8AZ/2Dzf8Al283fv2f7a4xs9+tef8A/Jxn/Uvf2F/29+f5/wD3727fJ987u2OfQPib8Mv+Fjf2X/xN/wCz/sHm/wDLt5u/fs/21xjZ79a8/wD+Gmv+pR/8qX/2quA+JvxN/wCFjf2X/wASj+z/ALB5v/Lz5u/fs/2FxjZ79a9/+Jvwy/4WN/Zf/E3/ALP+web/AMu3m79+z/bXGNnv1rwD4m/DL/hXP9l/8Tf+0Pt/m/8ALt5WzZs/22znf7dKPib8Mv8AhXP9l/8AE3/tD7f5v/Lt5WzZs/22znf7dK9/+JvxN/4Vz/Zf/Eo/tD7f5v8Ay8+Vs2bP9hs53+3SvP8A9pr/AJlb/t7/APaNH/Juf/Uw/wBu/wDbp5Hkf9/N27zvbG3vng/Zl/5mn/t0/wDa1eAV7/8Asy/8zT/26f8AtavoCiiiivP/AIm/DL/hY39l/wDE3/s/7B5v/Lt5u/fs/wBtcY2e/WvQK8/+GXwy/wCFc/2p/wATf+0Pt/lf8u3lbNm//bbOd/t0o+GXxN/4WN/an/Eo/s/7B5X/AC8+bv37/wDYXGNnv1o+Jvwy/wCFjf2X/wATf+z/ALB5v/Lt5u/fs/21xjZ79a8//aa/5lb/ALe//aNH/Jxn/Uvf2F/29+f5/wD3727fJ987u2OfAK9//wCTjP8AqXv7C/7e/P8AP/797dvk++d3bHJ/w01/1KP/AJUv/tVH/DMv/U3f+U3/AO21wHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrXf8A/DMv/U3f+U3/AO214BXv/wC01/zK3/b3/wC0aP8Ak4z/AKl7+wv+3vz/AD/+/e3b5Pvnd2xyftNf8yt/29/+0a4D4ZfE3/hXP9qf8Sj+0Pt/lf8ALz5WzZv/ANhs53+3Svf/AIZfDL/hXP8Aan/E3/tD7f5X/Lt5WzZv/wBts53+3SvAPhl8Mv8AhY39qf8AE3/s/wCweV/y7ebv37/9tcY2e/Wu/wD+Tc/+ph/t3/t08jyP+/m7d53tjb3zxwHwy+GX/Cxv7U/4m/8AZ/2Dyv8Al283fv3/AO2uMbPfrXf/APDMv/U3f+U3/wC21wHwy+Jv/Cuf7U/4lH9ofb/K/wCXnytmzf8A7DZzv9ule/8AxN+Jv/Cuf7L/AOJR/aH2/wA3/l58rZs2f7DZzv8AbpR8Mvib/wALG/tT/iUf2f8AYPK/5efN379/+wuMbPfrXoFFFFfIHwy+GX/Cxv7U/wCJv/Z/2Dyv+Xbzd+/f/trjGz3613//AAzL/wBTd/5Tf/ttH/DMv/U3f+U3/wC20fsy/wDM0/8Abp/7Wo/5OM/6l7+wv+3vz/P/AO/e3b5Pvnd2xyf8NNf9Sj/5Uv8A7VXAfDL4m/8ACuf7U/4lH9ofb/K/5efK2bN/+w2c7/bpR8Mvhl/wsb+1P+Jv/Z/2Dyv+Xbzd+/f/ALa4xs9+td//AMNNf9Sj/wCVL/7VR/ybn/1MP9u/9unkeR/383bvO9sbe+ePAK9//Zl/5mn/ALdP/a1H7Mv/ADNP/bp/7Wr0D4ZfDL/hXP8Aan/E3/tD7f5X/Lt5WzZv/wBts53+3SvAPhl8Mv8AhY39qf8AE3/s/wCweV/y7ebv37/9tcY2e/WvP69//Zl/5mn/ALdP/a1H7Mv/ADNP/bp/7Wo/aa/5lb/t7/8AaNegfDL4m/8ACxv7U/4lH9n/AGDyv+Xnzd+/f/sLjGz3615/+zL/AMzT/wBun/taj/k3P/qYf7d/7dPI8j/v5u3ed7Y2988H7Mv/ADNP/bp/7Wr0D4ZfDL/hXP8Aan/E3/tD7f5X/Lt5WzZv/wBts53+3SvkCvQPhl8Mv+Fjf2p/xN/7P+weV/y7ebv37/8AbXGNnv1r3/4ZfE3/AIWN/an/ABKP7P8AsHlf8vPm79+//YXGNnv1r0Ciiivn/wDZl/5mn/t0/wDa1eAV7/8Asy/8zT/26f8Ataj9mX/maf8At0/9rUf8nGf9S9/YX/b35/n/APfvbt8n3zu7Y59A+GXxN/4WN/an/Eo/s/7B5X/Lz5u/fv8A9hcY2e/WvP8A/hpr/qUf/Kl/9qrgPhl8Mv8AhY39qf8AE3/s/wCweV/y7ebv37/9tcY2e/WvP6+v/hl8Mv8AhXP9qf8AE3/tD7f5X/Lt5WzZv/22znf7dK8//aa/5lb/ALe//aNegfDL4m/8LG/tT/iUf2f9g8r/AJefN379/wDsLjGz3615/wD8My/9Td/5Tf8A7bR/wzL/ANTd/wCU3/7bXAfDL4Zf8LG/tT/ib/2f9g8r/l283fv3/wC2uMbPfrXv/wATfhl/wsb+y/8Aib/2f9g83/l283fv2f7a4xs9+tHwy+Jv/Cxv7U/4lH9n/YPK/wCXnzd+/f8A7C4xs9+tef8A/Juf/Uw/27/26eR5H/fzdu872xt7544D4m/DL/hXP9l/8Tf+0Pt/m/8ALt5WzZs/22znf7dK7/8A5Nz/AOph/t3/ALdPI8j/AL+bt3ne2NvfPHAfDL4m/wDCuf7U/wCJR/aH2/yv+Xnytmzf/sNnO/26V7/8Mvhl/wAK5/tT/ib/ANofb/K/5dvK2bN/+22c7/bpXgHxN+GX/Cuf7L/4m/8AaH2/zf8Al28rZs2f7bZzv9ulef0V9f8Awy+Jv/Cxv7U/4lH9n/YPK/5efN379/8AsLjGz3615/8Asy/8zT/26f8AtavoCiiivn/9mX/maf8At0/9rUf8My/9Td/5Tf8A7bXoHwy+GX/Cuf7U/wCJv/aH2/yv+Xbytmzf/ttnO/26V5/+zL/zNP8A26f+1q9A+Jvwy/4WN/Zf/E3/ALP+web/AMu3m79+z/bXGNnv1r0CvgCvr/4m/DL/AIWN/Zf/ABN/7P8AsHm/8u3m79+z/bXGNnv1o+JvxN/4Vz/Zf/Eo/tD7f5v/AC8+Vs2bP9hs53+3Sj4ZfDL/AIVz/an/ABN/7Q+3+V/y7eVs2b/9ts53+3SvP/2mv+ZW/wC3v/2jR/wzL/1N3/lN/wDttcB8Mvib/wAK5/tT/iUf2h9v8r/l58rZs3/7DZzv9ule/wDwy+GX/Cuf7U/4m/8AaH2/yv8Al28rZs3/AO22c7/bpR8Tfib/AMK5/sv/AIlH9ofb/N/5efK2bNn+w2c7/bpR8Tfhl/wsb+y/+Jv/AGf9g83/AJdvN379n+2uMbPfrXgHwy+Jv/Cuf7U/4lH9ofb/ACv+Xnytmzf/ALDZzv8AbpR8Mvhl/wALG/tT/ib/ANn/AGDyv+Xbzd+/f/trjGz3617/APDL4Zf8K5/tT/ib/wBofb/K/wCXbytmzf8A7bZzv9ulef8A/DMv/U3f+U3/AO21wHwy+Jv/AArn+1P+JR/aH2/yv+Xnytmzf/sNnO/26V3/AO01/wAyt/29/wDtGuA+GXxN/wCFc/2p/wASj+0Pt/lf8vPlbNm//YbOd/t0r3/4m/E3/hXP9l/8Sj+0Pt/m/wDLz5WzZs/2Gznf7dK8/wD2Zf8Amaf+3T/2tXAfE34Zf8K5/sv/AIm/9ofb/N/5dvK2bNn+22c7/bpXv/wy+GX/AArn+1P+Jv8A2h9v8r/l28rZs3/7bZzv9ulegUUUV8//APDMv/U3f+U3/wC20f8ADMv/AFN3/lN/+20f8My/9Td/5Tf/ALbXoHwy+GX/AArn+1P+Jv8A2h9v8r/l28rZs3/7bZzv9ulef/8ADMv/AFN3/lN/+20f8My/9Td/5Tf/ALbR/wAMy/8AU3f+U3/7bX0BXn/xN+GX/Cxv7L/4m/8AZ/2Dzf8Al283fv2f7a4xs9+tef8A/DMv/U3f+U3/AO216B8Mvhl/wrn+1P8Aib/2h9v8r/l28rZs3/7bZzv9ulHxN+GX/Cxv7L/4m/8AZ/2Dzf8Al283fv2f7a4xs9+tHwy+GX/Cuf7U/wCJv/aH2/yv+Xbytmzf/ttnO/26V6BXn/xN+GX/AAsb+y/+Jv8A2f8AYPN/5dvN379n+2uMbPfrR8Mvhl/wrn+1P+Jv/aH2/wAr/l28rZs3/wC22c7/AG6V5/8A8My/9Td/5Tf/ALbXoHwy+GX/AArn+1P+Jv8A2h9v8r/l28rZs3/7bZzv9ulef/8ADMv/AFN3/lN/+20f8My/9Td/5Tf/ALbXoHxN+GX/AAsb+y/+Jv8A2f8AYPN/5dvN379n+2uMbPfrR8Mvhl/wrn+1P+Jv/aH2/wAr/l28rZs3/wC22c7/AG6UfE34Zf8ACxv7L/4m/wDZ/wBg83/l283fv2f7a4xs9+tegV5/8Mvhl/wrn+1P+Jv/AGh9v8r/AJdvK2bN/wDttnO/26UfE34Zf8LG/sv/AIm/9n/YPN/5dvN379n+2uMbPfrXoFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFf/2Q=="
  }
}
```

### Response Body Params

| Campo                   | Tipo   | Descrição                                                                         | Caracteres |
|-------------------------|--------|-----------------------------------------------------------------------------------|------------|
| `request_control_key` * | uuidv4 | Chave única de identificação da request utilizada pelo cliente no formato uuid v4 | 36         |
| `bank_slip_key` *       | uuidv4 | Chave única de identificação do boleto no formato uuid v4                         | 36         |
| `bank_slip_status` *    | string | Status do boleto       | **[Enumeradores bank_slip_status](#enumeradores-bank_slip_status)**   |
| `our_number` *          | integer| Número único de identificação do boleto junto à carteira                          | 11         |
| `barcode` *             | string | Código de barras do boleto                                                        | 44         |
| `digitable_line` *      | string | Linha digitável do boleto                                                         | 47         |
| `qr_code_data`          | object | Dados do QR Code                             | **[Objeto qr_code_data](#objeto-qr_code_data)** |
| `created_at` *          | string | Data, no formato ISO (UTC - "YYYY-MM-DDTHH:MM:SSZ"), da criação da ocorrência     | 20         |

### Enumeradores bank_slip_status

| Enumerador         | Descrição                               |
|--------------------|-----------------------------------------|
| accepted           | Boleto aceito mas ainda não registrado  |

### Objeto qr_code_data
| Campo                      | Tipo   | Descrição                                             | Caracteres              |
|----------------------------|--------|-------------------------------------------------------|-------------------------|
| `qr_code_key`              | uuidv4 | Chave única de identificação do QR Code               | 36                      |
| `pix_key`                  | uuidv4 | Chave PIX vinculada ao QR Code                        | 36                      |
| `receiver_conciliation_id` | uuidv4 | Identificador de conciliação do QR Code               | 36                      |
| `url`                      | string | URL (Pix Copia e Cola) do QR Code                     | -                       |
| `image`                    | string | base64 da URL (Pix Copia e Cola) do QR Code           | -                       |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| Código HTTP<br/>`status` | Código QI<br/>`code` | Título<br/>`title`                                 | Descrição (eng)<br/>`description`                                                                                       | Descrição (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000004            | Not Found | Pix key not found: `{pix_key}`                                               | Chave pix não encontrada: `{pix_key}`                                               |
| 403                      | BKS000005            | Forbidden                         | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 403                      | BKS000010            | Forbidden                                 | The pix key owner does not match the account owner.                                                                                     | O proprietário da chave pix não corresponde ao proprietário da conta.                                                             |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 409                      | BKS000014            | Conflict           | Request control key already sent or duplicated sent: `{request_control_key}`                                                              | Chave de controle da requisição já utilizada ou enviada duplicada: `{request_control_key}`                                                                        |
| 400                      | BKS000016            | Bad Request                                        | Expiration date must be greater than the current date and have a maximum of 3650 days from the current date.                                    | A data de vencimento deve ser maior que a data atual e possuir no máximo 3650 dias corridos a partir da data atual.                                     |
| 409                      | BKS000017            | Conflict                                        | Our number already used or duplicated sent: `{our_number}`                                                                                       | Nosso número já utilizado ou enviado duplicado: `{our_number}`                                                                               |
| 400                      | BKS000018            | Bad Request                                        | The discount dates must be less than the expiration date and increasing.                                                      | A data dos descontos devem ser menores que a de expiração e crescentes.                                               |
| 400                      | BKS000019            | Bad Request                                        | Payer address is required for protest.                                                                                       | Endereço do pagador é obrigatório para protesto.                                                                         |
| 500                      | BKS000021            | Internal Server Error                                  | Error while trying to generate QR Code.                                                               | Erro ao tentar gerar QR Code de pagamento.                                                           |
| 400                      | BKS000022            | Bad Request                                        | Requester profile is not opened.                                                              | Carteira não está aberta.                          |
| 400                      | BKS000026            | Bad Request                      | Guarantor address is required for protest.                                                                                        | Endereço do sacador é obrigatório para protesto.                                                                   |
| 404                      | BKS000028            | Not Found             | Notary office attended region not found for postal code: `{postal_code}`                                                          | Região de cartório não encontrada para o CEP: `{postal_code}`                                                                                 |
| 400                      | BKS000043            | Bad Request             | Invalid discount numbering. Discounts must be numbered in ascending order and start on 1.          | Numeração dos descontos inválida. Os descontos devem ser numerados em ordem crescente e começar em 1.                                                           |
| 400                      | BKS000045            | Bad Request                                        | Rebate amount can not be equal or greater than the bank slip amount.                                                              | O valor do rebate não pode ser igual ou maior do que o valor do boleto.                          |
| 400                      | BKS000047            | Bad Request             | It was not possible to consult the sent pix key at this time. Please try again in a few minutes.          | Não foi possível consultar a chave pix enviada no momento. Por favor, tente novamente em alguns minutos.                                                           |
| 400                      | BKS000125            | Bad Request             | Partial payment data is required for this bank slip species type.          | Os dados de pagamento parcial são obrigatórios para o tipo de boleto fornecido.                                                           |
| 400                      | BKS000128            | Bad Request             | QR code payment is not allowed for partial payment.          | Pagamento via QR code não é permitido para pagamento parcial.                                                           |
| 400                      | BKS000128            | Bad Request             | QR code payment is not allowed for partial payment.          | Pagamento via QR code não é permitido para pagamento parcial.                                                           |
| 400                      | BKS000131            | Bad Request             | Rebate amount is not allowed for this bank slip species type.          | O valor de abatimento não é permitido para o tipo de boleto fornecido.                                                           |
| 400                      | BKS000132            | Bad Request             | Discount data is not allowed for this bank slip species type.          | Os dados de desconto não são permitidos para o tipo de boleto fornecido.                                                           |
| 400                      | BKS000133            | Bad Request             | Fine data is not allowed for this bank slip species type.          | Os dados de multa não são permitidos para o tipo de boleto fornecido.                                                           |
| 400                      | BKS000134            | Bad Request             | Interest data is not allowed for this bank slip species type.          | Os dados de juros não são permitidos para o tipo de boleto fornecido.                                                           |
| 400                      | BKS000136            | Bad Request             | Only credit card financial instrument type can have zero amount.          | Apenas o tipo de instrumento financeiro cartão de crédito pode ter valor zero.                                                           |

---

# Emissão de boletos em lote

URL: /en/documentation/boletos/emissao/emissao_em_lote

:::danger Importante
Para registrar bolePix, é necessário que exista uma chave Pix aleatória ativa na conta em que os boletos serão registrados.
:::

A emissão de boletos em lote é feita somente de maneira assíncrona. Caso um dos boletos falhe na validação das informações fornecidas, nenhum dos boletos será registrado nessa mesma requisição.

:::caution Atenção!
Como tratam-se de um registros assíncronos, o solicitante é notificado via [**webhook**](/documentation/boletos/v2/webhooks/boleto) assim que cada um dos boletos mudar de status de `accepted` para `registered` ou `rejected`.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip/batch
MÉTODO POST

### Path parameters

| Campo                   | Tipo   | Descrição                                                    | Caracteres |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Chave única de identificação da conta, no formato uuid v4    | 36         |
| `requester_profile_key` | uuidv4 | Chave única de identificação da carteira, no formato uuid v4 | 36         |

Request Body

```json
{
  "bank_slips": [
    {
      "request_control_key": "c86d8902-a5ae-4d1f-8872-e6fea1268aab",
      "our_number": 123456789,
      "document_number": "DOC4561237",
      "amount": 5000.00,
      "expiration": "2025-01-01",
      "bank_teller_instructions": "Confirm payment",
      "protest_data": {"days_to_protest": 7},
      "bankruptcy_protest_data": {"days_to_bankruptcy_protest": 14},
      "max_payment_days": 45,
      "fine_data": {"fine_type": "absolute", "fine_amount": 100.00, "days_to_fine": 10},
      "interest_data": {
        "interest_type": "workdays_daily_amount",
        "interest_amount": 10.00,
        "days_to_interest": 2,
      },
      "financial_instrument_type": "digital_commercial_invoice",
      "write_off_data": {"days_to_write_off": 365},
      "rebate_amount": 200.00,
      "discounts_data": [
        {
          "discount_amount": 50.00,
          "discount_number": 1,
          "discount_type": "absolute",
          "discount_limit_date": "2025-01-01",
        }
      ],
      "payer_data": {
        "name": "Global Tech",
        "contact": {
          "email": "finance@globaltech.com",
          "phone": {"country_code": "055", "area_code": "11", "number": "987654321"},
        },
        "address": {
          "street": "101 High St.",
          "neighborhood": "Tech Park",
          "number": "202",
          "postal_code": "49069234",
          "city": "Innovation City",
          "state": "SP",
          "complement": "Building A",
        },
        "document_number": "12345678000195",
        "person_type": "legal",
      },
      "guarantor_data": {
        "name": "Jane Doe",
        "contact": {
          "email": "jane.doe@qitech.com.br",
          "phone": {"country_code": "055", "area_code": "11", "number": "999999999"},
        },
        "address": {
          "street": "202 Elm St.",
          "neighborhood": "Quiet Neighborhood",
          "number": "303",
          "postal_code": "35700854",
          "city": "Peaceful Town",
          "state": "RJ",
          "complement": "House 1",
        },
        "document_number": "23456789012",
        "person_type": "natural",
      },
      "pix_key": "78252991-d26d-4d6b-8c50-be3233ffabf7",
      "notification": {
        "document_number": "12345678000195",
        "name": "Global Tech",
        "email": "finance@globaltech.com",
        "phone": {"country_code": "055", "area_code": "11", "number": "987654321"},
        "send_2_way": true,
        "send_before_due_date": true,
        "send_after_due_date": true,
        "send_on_protest": true
      }
    },
    {
      "request_control_key": "b3a428fd-58ee-4d6f-8872-633874ebf5e2",
      "our_number": 987654321,
      "document_number": "DOC4561237",
      "amount": 5000.00,
      "expiration": "2025-01-01",
      "bank_teller_instructions": "Confirm payment",
      "protest_data": {"days_to_protest": 7},
      "bankruptcy_protest_data": {"days_to_bankruptcy_protest": 14},
      "max_payment_days": 45,
      "fine_data": {"fine_type": "absolute", "fine_amount": 100.00, "days_to_fine": 10},
      "interest_data": {
        "interest_type": "workdays_daily_amount",
        "interest_amount": 10.00,
        "days_to_interest": 2
      },
      "financial_instrument_type": "digital_commercial_invoice",
      "write_off_data": {"days_to_write_off": 365},
      "rebate_amount": 200.00,
      "discounts_data": [
        {
          "discount_amount": 50.00,
          "discount_number": 1,
          "discount_type": "absolute",
          "discount_limit_date": "2025-01-01"
        }
      ],
      "payer_data": {
        "name": "Global Tech",
        "contact": {
          "email": "finance@globaltech.com",
          "phone": {"country_code": "055", "area_code": "11", "number": "987654321"},
        },
        "address": {
          "street": "101 High St.",
          "neighborhood": "Tech Park",
          "number": "202",
          "postal_code": "79071231",
          "city": "Innovation City",
          "state": "SP",
          "complement": "Building A"
        },
        "document_number": "12345678000195",
        "person_type": "legal"
      },
      "guarantor_data": {
        "name": "Jane Doe",
        "contact": {
          "email": "jane.doe@qitech.com.br",
          "phone": {"country_code": "055", "area_code": "11", "number": "999999999"},
        },
        "address": {
          "street": "202 Elm St.",
          "neighborhood": "Quiet Neighborhood",
          "number": "303",
          "postal_code": "65066380",
          "city": "Peaceful Town",
          "state": "RJ",
          "complement": "House 1"
        },
        "document_number": "23456789012",
        "person_type": "natural"
      }
    }
  ]
}
```

### Request Body Params

| Campo            | Tipo          | Descrição                             | Caracteres                                |
|------------------|---------------|---------------------------------------|-------------------------------------------|
| `bank_slips` *   | Array de **[Objeto bank_slip](#objeto-bank_slip)**  | Lista de boletos a serem registrados  | - |

### Objeto bank_slip

| Campo                      | Tipo    | Descrição                                                                          | Caracteres |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------|
| `request_control_key` *    | uuidv4  | Chave única de identificação da request utilizada pelo cliente no formato uuid v4  | 36                                                |
| `our_number`               | integer | Número único de identificação do boleto junto à carteira. Pode ser enviado pelo cliente e, caso não seja, a QI Tech irá gerar um                           | 11                                                |
| `document_number`          | string  | Número de identificação do boleto                                                  | 10                                                |
| `participant_control_number` | string | Nº Controle do Participante                                                       |
25                                                |
| `amount` *                 | float   | Valor base do boleto                                                               | -                                                 |
| `expiration` *             | string  | Data de vencimento                                                                 | 10                                                |
| `bank_teller_instructions` | string  | Instruções adicionais de registro, que constarão no PDF do boleto. Aceita no máximo 320 caracteres, distribuídos em até 7 linhas. Cada linha pode conter no máximo 90 caracteres. Caso uma linha ultrapasse 90 caracteres, o texto será automaticamente quebrado em uma nova linha | 320                                               |
| `rebate_amount`            | float   | Valor de abatimento do boleto, que será aplicado em cima do valor base             | -                                                 |
| `max_payment_days`         | integer | Máximo de dias corridos que o boleto ficará disponível para pagamento, após o vencimento (pode ser no máximo 365) | -          |
| `financial_instrument_type`   | string  | Tipo de espécie do boleto | **[Enumeradores financial_instrument_type](#enumeradores-financial_instrument_type)** |
| `partial_payment_data`    | object  | Configurações de pagamento parcial                      | **[Objeto partial_payment_data](#objeto-partial_payment_data)** |
| `write_off_data`       | object  | Configuração de baixa      | **[Objeto write_off_data](#objeto-write_off_settings)** |
| `protest_data`         | object  | Configuração de protesto       | **[Objeto protest_data](#objeto-protest_settings)** |
| `bankruptcy_protest_data` | object  | Configuração de protesto falimentar | **[Objeto bankruptcy_protest_data](#objeto-bankruptcy_protest_settings)** |
| `fine_data`            | object  | Configuração de multa                 | **[Objeto fine_data](#objeto-fine_settings)** |
| `interest_data`        | object  | Configuração de juros        | **[Objeto interest_data](#objeto-interest_settings)** |
| `discounts_data`           | object array | Descontos           | **[Objeto discount](#objeto-discounts_data)** |
| `payer_data` *             | object  | Dados do pagador                                                                   | **[Objeto payer_data](#objetos-payer_data-e-guarantor_data)** |
| `guarantor_data`           | object  | Dados do sacador avalista                                                          | **[Objeto guarantor_data](#objetos-payer_data-e-guarantor_data)** |
| `pix_key`                  | uuidv4  | Chave pix do tipo aleatória                                                        | 36                                                |

:::info BolePix
Caso o parâmetro `pix_key`, opcional, seja enviado na request, será gerado um bolePix. BolePix é um boleto cujo pagamento é vinculado a um QR Code Pix. Sendo assim, o pagador pode realizar o pagamento do boleto tanto utilizando a linha digitável do mesmo, quanto através da leitura do QR Code Pix vinculado. Caso o pagamento seja feito via QR Code, a liquidação financeira se dá instantaneamente, enquanto os retornos bancários e webhooks envolvidos na liquidação serão gerados assim como é feito para um boleto comum.

Importante: para registrar um bolePix, é necessário que exista uma chave Pix aleatória ativa na conta em que boleto será registrado.
:::

:::tip Configurações Padrão da Carteira
Caso cada um dos campos `max_payment_days`, `write_off_data`, `protest_data`, `bankruptcy_protest_data`, `fine_data`, `interest_data` e `pix_key` não sejam enviados na request e a carteira possua configurações padrão (i.e. `max_payment_days`, `write_off_settings`, `protest_settings`, `bankruptcy_protest_settings`, `fine_settings`, `interest_settings` e `qr_code_settings`, respectivamente, no `configuration_data` do `requester_profile`), serão utilizadas tais configurações padrão para a emissão do título.
:::

:::caution Limitações e Restrições
- **Boletos de Pagamento Parcial:** Não é permitido o pagamento via QR Code Pix. Portanto, não é permitido enviar a `pix_key` no registro, nem ter uma configuração padrão de geração de bolePix para a carteira.

- **Boletos de Cartão de Crédito:** Não é necessário nem permitido enviar informações rebate, desconto, multa e juros. Isso se deve ao padrão do mercado, onde muitas Instituições Financeiras não aceitam o pagamento de boletos de cartão de crédito que contenham essas informações. A carteira também não pode ter essas configurações definidas como padrão. Sendo assim boletos desse tipo podem ser pagos parcialmente mesmo após o vencimento, sem incidência de juros, multas, descontos ou abatimentos na fatura corrente. Para aplicar esses valores é necessário incluí-los na próxima fatura, seja através da [ocorrência de edição de valor](/documentation/boletos/instrucoes/valor) do boleto ou emitindo um novo boleto que inclua esses valores. É possível enviar `amount = 0` para boletos deste tipo.

**Importante:** Boletos do tipo `credit_card` são obrigatoriamente de pagamento parcial, sendo assim é necessário fornecer as informações de `partial_payment_data` ou ter essa configuração padrão na carteira. Caso o campo `financial_instrument_type` não seja enviado, o valor padrão será `digital_commercial_invoice`.
:::

:::tip Recomendações de Carteiras
- **Carteira para Boletos Padrão:** Mantenha as configurações padrão para multas, juros e protesto
- **Carteira para Boletos de Pagamento Parcial:** Sem configuração de Pix e com regras específicas para pagamento parcial
- **Carteira para Boletos de Cartão de Crédito:** Sem configurações de multa, juros, desconto ou rebate

Criar carteiras específicas garante que as configurações padrão sejam adequadas para cada tipo de boleto e evita conflitos nas regras de negócio.
:::

:::info Máquina de Estados
A máquina de status para boletos de pagamento parcial possui algumas diferenças. Para mais detalhes, consulte a [introdução](/documentation/boletos/introducao) , onde há uma explicação sobre como aplicar a incidência de juros e multas no boleto seguindo as boas práticas do mercado.
:::

### Enumeradores financial_instrument_type

| Enumerador  | Descrição                        |
|-------------|----------------------------------|
| digital_commercial_invoice | DMI Duplicata Mercantil Indicação |
| credit_card | Cartão de Crédito |
| check | CH Cheque |
| digital_commercial | DM Duplicata Mercantil |
| digital_service_invoice | Duplicata de Serviço |
| digital_service_invoice_indication | DSI Duplicata de Serviço Indicação |
| digital_rural_invoice | DR Duplicata Rural |
| bill_of_exchange | LC Letra de Câmbio |
| commercial_credit_note | NCC Nota de Crédito Comercial |
| export_credit_note | NCE Nota de Crédito Exportação |
| industrial_credit_note | NCI Nota de Crédito Industrial |
| rural_credit_note | NCR Nota de Crédito Rural |
| promissory_note | NP Nota Promissória |
| rural_promissory_note | NPR Nota Promissória Rural |
| mercantile_triplicate | TM Triplicata Mercantil |
| service_triplicate | TS Triplicata de Serviço |
| insurance_note | NS Nota de Seguro |
| receipt | RC Recibo |
| printed_bank_slip | FAT Bloqueto |
| debit_note | ND Nota de Débito |
| insurance_policy | AP Apólice de Seguro |
| school_monthly_fee | ME Mensalidade Escolar |
| consortium_installment | PC Parcela de Consórcio |
| invoice | NF Nota Fiscal |
| debt_document | DD Documento de Dívida |
| rural_product_certificate | Cédula de Produto Rural |
| warrant | Warrant |
| state_active_debt | Dívida Ativa de Estado |
| municipal_active_debt | Dívida Ativa de Município |
| federal_active_debt | Dívida Ativa da União |
| condominium_charges | Encargos condominiais |
| proposal_bank_slip | Boleto proposta |
| deposit_and_contribution_bank_slip | Boleto de Depósito e Aporte |
| others | Outros |

### Objeto partial_payment_data

| Campo                             | Tipo    | Descrição                                                                 | Caracteres |
|-----------------------------------|---------|---------------------------------------------------------------------------|------------|
| `partial_payment_minimum_type` *  | string  | Tipo de valor mínimo para pagamento parcial                               | **[Enumeradores partial_payment_type](#enumeradores-partial_payment_type)** |
| `partial_payment_minimum_percentage` | float | Percentual mínimo permitido para o pagamento parcial                      | -          |
| `partial_payment_minimum_amount`  | float  | Valor mínimo permitido para o pagamento parcial                           | -          |
| `partial_payment_maximum_type`    | string  | Tipo de valor máximo para pagamento parcial                               | **[Enumeradores partial_payment_type](#enumeradores-partial_payment_type)** |
| `partial_payment_maximum_percentage` | float | Percentual máximo permitido para o pagamento parcial                      | -          |
| `partial_payment_maximum_amount`  | float  | Valor máximo permitido para o pagamento parcial                           | -          |
| `partial_payment_quantity` *      | integer | Quantidade de pagamentos parciais permitidos                              | -          |

:::caution Atenção!
De acordo com o valor enviado nos campos `partial_payment_minimum_type` e `partial_payment_maximum_type`, é necessário enviar o `partial_payment_minimum_amount` ou `partial_payment_minimum_percentage`, e o `partial_payment_maximum_amount` ou `partial_payment_maximum_percentage` correspondente.
:::

### Enumeradores partial_payment_type

| Enumerador  | Descrição                        |
|-------------|----------------------------------|
| absolute    | Valor absoluto                   |
| percentage  | Percentual                       |

### Objeto write_off_data

| Campo                     | Tipo    | Descrição                                                                   | Caracteres |
|---------------------------|---------|-----------------------------------------------------------------------------|------------|
| `days_to_write_off` *     | integer | Dias, após o vencimento, para que o boleto seja baixado automaticamente     | -          |

### Objeto protest_data

| Campo                     | Tipo    | Descrição                                                                   | Caracteres |
|---------------------------|---------|-----------------------------------------------------------------------------|------------|
| `days_to_protest` *       | integer | Dias, após o vencimento, para que o boleto seja protestado automaticamente  | -          |

### Objeto bankruptcy_protest_data

| Campo                          | Tipo    | Descrição                                                                   | Caracteres  |
|--------------------------------|---------|-----------------------------------------------------------------------------|------------|
| `days_to_bankruptcy_protest` * | integer | Dias, após o vencimento, para que o boleto seja protestado automaticamente  | -           |

### Objeto fine_data

Opção 1: multa em valor absoluto (`fine_type=absolute`)

| Campo                     | Tipo    | Descrição                                               | Caracteres                |
|---------------------------|---------|---------------------------------------------------------|-------------------------------------------------------------------------|
| `fine_type` *             | string  | Tipo da multa                                                       | **[Enumeradores fine_type](#enumeradores-fine_type)**                                              |
| `fine_amount` *           | float   | Valor absoluto da multa                                             | -                                                                        |
| `days_to_fine` *          | integer | Dias, após o vencimento, para que a multa seja cobrada              | -                                                                        |

Opção 2: multa em valor percentual (`fine_type=percentage`)

| Campo                     | Tipo    | Descrição                                                 | Caracteres                             |
|---------------------------|---------|-----------------------------------------------------------|---------------------------------------|
| `fine_type` *             | string  | Tipo da multa                                             | **[Enumeradores fine_type](#enumeradores-fine_type)** |
| `fine_percentage` *       | integer | Valor percentual da multa, de 1 a 100                     | -                                      |
| `days_to_fine` *          | integer | Dias, após o vencimento, para que a multa seja cobrada    | -                                      |

### Enumeradores fine_type

| Enumerador         | Descrição             |
|--------------------|-----------------------|
| absolute           | valor absoluto        |
| percentage         | valor percentual      |

### Objeto interest_data

Opção 1: juros utilizando valores absolutos (`interest_type=calendar_days_daily_amount` ou `interest_type=workdays_daily_amount`)

| Campo                     | Tipo    | Descrição                                                                     | Caracteres                                                                                      |
|---------------------------|---------|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| `interest_type` *         | string  | Tipo de juros       | **[Enumeradores interest_type](#enumeradores-interest_type)** |
| `interest_amount` *       | float   | Valor a ser cobrado por unidade de tempo determinada (dias úteis ou corridos) | -                                                                                               |
| `days_to_interest` *      | integer | Dias, após o vencimento, para que comece a cobrar os juros                    | -                                                                                               |

Opção 2: juros utilizando valores percentuais (`interest_type=calendar_days_monthly_percentage`)

| Campo                    | Tipo    | Descrição                                                                             | Caracteres                                                                                          |
|--------------------------|---------|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| `interest_type` *        | string  | Tipo de juros       | **[Enumeradores interest_type](#enumeradores-interest_type)** |
| `interest_percentage` *  | integer | Porcentagem a ser cobrada por unidade de tempo determinada (dias úteis ou corridos)                                                                      | -                                                                           |
| `days_to_interest` *     | integer | Dias, após o vencimento, para que comece a cobrar os juros                             | -                                                                                                   |

### Enumeradores interest_type

| Enumerador                       | Descrição                                                            |
|----------------------------------|----------------------------------------------------------------------|
| calendar_days_daily_amount       | Valor diário sobre dias corridos                                     |
| workdays_daily_amount            | Valor diário sobre dias úteis                                        |
| calendar_days_monthly_percentage | Porcentagem de juros cobrados mensalmente, com base em dias corridos |

### Objeto discount

Opção 1: descontos utilizando valores absolutos (`discount_type in ["absolute", "anticipation_calendar_days_daily_amount", "anticipation_workdays_daily_amount"]`)

| Campo                     | Tipo    | Descrição                                           | Caracteres                                                |
|---------------------------|---------|-----------------------------------------------------|-----------------------------------------------------------|
| `discount_amount` *       | float   | Valor absoluto de desconto por unidade de tempo                                            | -                                                          |
| `discount_number` *       | integer | Número do desconto                                     | -                                                         |
| `discount_type` *         | string  | Configuração do desconto em valores absolutos                                    | **[Enumerador discount_type](#enumeradores-discount_type)** |                                                       |
| `discount_limit_date` *   | string  | Data limite para aplicação do desconto   | 10                                                        |

Opção 2: descontos utilizando valores percentuais (`discount_type in ["percentage", "anticipation_calendar_days_daily_percentage", "anticipation_workdays_daily_percentage"]`)

| Campo                     | Tipo    | Descrição                                           | Caracteres                                                |
|---------------------------|---------|-----------------------------------------------------|-----------------------------------------------------------|
| `discount_percentage` *   | float   | Valor percentual de desconto por unidade de tempo                                            | -                                                          |
| `discount_number` *       | integer | Número do desconto                                     | -                                                         |
| `discount_type` *         | string  | Configuração do desconto em valores percentuais                                    | **[Enumerador discount_type](#enumeradores-discount_type)** |                                                       |
| `discount_limit_date` *   | string  | Data limite para aplicação do desconto   | 10                                                        |

:::caution Atenção!
O boleto pode ter até três descontos, sendo que os descontos devem ser todos do mesmo tipo , isto é, devem ter o mesmo `discount_type`. Os descontos devem ser numerados de 1 a 3, de maneira crescente e começando necessariamente em 1. Ou seja, caso sejam enviados dois descontos na requisição, devem necessariamente ser numerados com 1 e 2.
:::

### Enumeradores discount_type

| Enumerador                                  | Descrição                                                                |
|---------------------------------------------|--------------------------------------------------------------------------|
| absolute                                    | Valor fixo                                                               |
| anticipation_calendar_days_daily_amount     | Valor diário de desconto de antecipação, sobre dias corridos             |
| anticipation_workdays_daily_amount          | Valor diário de desconto de antecipação, sobre dias úteis                |
| percentage                                  | Porcentagem fixa                                                         |
| anticipation_calendar_days_daily_percentage | Porcentagem mensal de desconto de antecipação, com base em dias corridos |
| anticipation_workdays_daily_percentage      | Porcentagem anual de desconto de antecipação, com base em dias úteis     |

### Objetos payer_data e guarantor_data

| Campo                     | Tipo   | Descrição                                                  | Caracteres|
|---------------------------|--------|-------------------------------------|-----------------------------------------------------------|
| `name` *                  | string | Nome completo                       | 100                                                       |
| `document_number` *       | string | Número do documento (CPF/CNPJ)      | 11 ou 14                                                  |
| `person_type` *           | string | Tipo da pessoa (física ou jurídica) | **[Enumeradores person_type](#enumeradores-person_type)** |
| `contact`                 | object | Informações de contato              | **[Objeto contact](#objeto-contact)**                     |
| `address`                 | object | Endereço                            | **[Objeto address](#objeto-address)**                     |

### Enumeradores person_type

| Enumerador         | Descrição             |
|--------------------|-----------------------|
| natural            | pessoa física         |
| legal              | pessoa jurídica       |

### Objeto contact

| Campo                     | Tipo   | Descrição                         | Caracteres                         |
|---------------------------|--------|-----------------------------------|------------------------------------|
| `email`                   | string | E-mail de contato                 | 320                                |
| `phone`                   | object | Telefone de contato               | **[Objeto phone](#objeto-phone)**  |

### Objeto phone

| Campo                           | Tipo   | Descrição                                    | Caracteres |
|---------------------------------|--------|----------------------------------------------|------------|
| `country_code` *     | string | Código DDI (Discagem Direta Internacional)   | 3          |
| `area_code` *                   | string | Código DDD (Discagem Direta à Distância)     | 2          |
| `number` *                      | string | Complemento                                  | 9          |

### Objeto address

| Campo                     | Tipo   | Descrição                                    | Caracteres |
|---------------------------|--------|----------------------------------------------|------------|
| `street` *                | string | Logradouro                                   | 500        |
| `number` *                | string | Número                                       | 6          |
| `complement`              | string | Complemento                                  | 500        |
| `neighborhood` *          | string | Bairro                                       | 100        |
| `postal_code` *           | string | CEP                                          | 8          |
| `city` *                  | string | Cidade                                       | 100        |
| `state` *                 | string | Estado (UF) | **[Enumerador state](#enumeradores-state)** |

### Enumeradores state

| Enumerador         | Descrição             |
|--------------------|-----------------------|
| AC                 | Acre                  |
| AL                 | Alagoas               |
| AM                 | Amazonas              |
| AP                 | Amapá                 |
| BA                 | Bahia                 |
| CE                 | Ceará                 |
| DF                 | Distrito federal      |
| ES                 | Espírito Santo        |
| GO                 | Goiás                 |
| MA                 | Maranhão              |
| MG                 | Minas Gerais          |
| MS                 | Mato Grosso do Sul    |
| MT                 | Mato Grosso           |
| PA                 | Pará                  |
| PB                 | Paraíba               |
| PE                 | Pernambuco            |
| PI                 | Piauí                 |
| PR                 | Paraná                |
| RJ                 | Rio de Janeiro        |
| RN                 | Rio Grande do Norte   |
| RO                 | Rondônia              |
| RR                 | Roraima               |
| RS                 | Rio Grande do Sul     |
| SC                 | Santa Catarina        |
| SE                 | Sergipe               |
| SP                 | São Paulo             |
| TO                 | Tocantins             |
| EX                 | Exceção               |

### Objeto notification

| Campo                     | Tipo    | Descrição                                                                               | Caracteres |
|---------------------------|---------|-----------------------------------------------------------------------------------------|------------|
| `document_number` *       | string  | Número do documento de quem receberá as notificações (CPF/CNPJ)                         | 11 ou 14   |
| `name` *                  | string  | Nome de quem receberá as notificações                                                   | 100        |
| `email`                   | string  | E-mail para o qual serão enviadas as notificações                                       | 320        |
| `phone`                   | object  | Telefone de contato para o qual serão enviadas as notificações | **[Objeto phone](#objeto-phone)**   |
| `send_2_way` *            | boolean | Enviar segunda via                                                                      | -          |
| `send_before_due_date` *  | boolean | Enviar notificação ao pagador antes da data de vencimento                               | -          |
| `send_after_due_date` *   | boolean | Enviar notificação ao pagador quando o boleto vencer                                    | -          |
| `send_on_protest` *       | boolean | Enviar notificação ao entrar em fluxo de protesto                                       | -          |

## Response

STATUS 202

Response Body

```json
{
  "bank_slips": [
    {
      "request_control_key": "c86d8902-a5ae-4d1f-8872-e6fea1268aab",
      "bank_slip_key": "053c7074-c55c-49aa-b94d-629e8d2424cf",
      "bank_slip_status": "accepted",
      "our_number": 123456789,
      "barcode": "32992995900000892814549111682910713279164650",
      "digitable_line": "32994549121168291071332791646501299590000089281",
      "qr_code_data": {
        "qr_code_key": "0a6ffa83-63ec-438f-95be-76e1ab8329e5",
        "pix_key": "78252991-d26d-4d6b-8c50-be3233ffabf7",
        "receiver_conciliation_id": "01GVGV9NXBCY287Z6CJ4S0ENW9",
        "url": "00020126830014br.gov.bcb.pix2561qrcode.qitech.app/bacen/cobv/58fd5103a8e64bbbab2fd49b0bd580145204000053039865802BR5925GONNFUNDODEINVESTIMENTOEM6012RiodeJaneiro6107226401262070503***6304EA0D",
        "image": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/wAALCAD0APQBAREA/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/9oACAEBAAA/APf6KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK+QPhl8Mv+Fjf2p/xN/wCz/sHlf8u3m79+/wD21xjZ79a7/wD4Zl/6m7/ym/8A22j/AIZl/wCpu/8AKb/9to/Zl/5mn/t0/wDa1egfE34Zf8LG/sv/AIm/9n/YPN/5dvN379n+2uMbPfrXgHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrR8Tfib/wsb+y/wDiUf2f9g83/l583fv2f7C4xs9+td//AMm5/wDUw/27/wBunkeR/wB/N27zvbG3vnjwCvr/AOJvxN/4Vz/Zf/Eo/tD7f5v/AC8+Vs2bP9hs53+3SvkCvf8A9mX/AJmn/t0/9rUf8m5/9TD/AG7/ANunkeR/383bvO9sbe+ePQPhl8Mv+Fc/2p/xN/7Q+3+V/wAu3lbNm/8A22znf7dK8A+GXxN/4Vz/AGp/xKP7Q+3+V/y8+Vs2b/8AYbOd/t0o+GXxN/4Vz/an/Eo/tD7f5X/Lz5WzZv8A9hs53+3Svf8A4m/DL/hY39l/8Tf+z/sHm/8ALt5u/fs/21xjZ79a8/8A+GZf+pu/8pv/ANtr0D4ZfE3/AIWN/an/ABKP7P8AsHlf8vPm79+//YXGNnv1rwD4ZfE3/hXP9qf8Sj+0Pt/lf8vPlbNm/wD2Gznf7dK7/wD4aa/6lH/ypf8A2quA+GXxN/4Vz/an/Eo/tD7f5X/Lz5WzZv8A9hs53+3Svr+vkD4ZfDL/AIWN/an/ABN/7P8AsHlf8u3m79+//bXGNnv1rv8A/hmX/qbv/Kb/APbaP+GZf+pu/wDKb/8AbaP2Zf8Amaf+3T/2tX0BRRRXz/8Asy/8zT/26f8AtavAK9//AGZf+Zp/7dP/AGtR+zL/AMzT/wBun/tavQPib8Mv+Fjf2X/xN/7P+web/wAu3m79+z/bXGNnv1rz/wDZl/5mn/t0/wDa1cB8Mvib/wAK5/tT/iUf2h9v8r/l58rZs3/7DZzv9ule/wDwy+Jv/Cxv7U/4lH9n/YPK/wCXnzd+/f8A7C4xs9+teAfE34Zf8K5/sv8A4m/9ofb/ADf+XbytmzZ/ttnO/wBule//ABN+Jv8Awrn+y/8AiUf2h9v83/l58rZs2f7DZzv9uleAfDL4Zf8ACxv7U/4m/wDZ/wBg8r/l283fv3/7a4xs9+tHxN+GX/Cuf7L/AOJv/aH2/wA3/l28rZs2f7bZzv8AbpXv/wAMvhl/wrn+1P8Aib/2h9v8r/l28rZs3/7bZzv9ulef/tNf8yt/29/+0a9A+GXxN/4WN/an/Eo/s/7B5X/Lz5u/fv8A9hcY2e/WvP8A/k3P/qYf7d/7dPI8j/v5u3ed7Y2988cB8Tfhl/wrn+y/+Jv/AGh9v83/AJdvK2bNn+22c7/bpXf/APDTX/Uo/wDlS/8AtVcB8Tfhl/wrn+y/+Jv/AGh9v83/AJdvK2bNn+22c7/bpX1/Xz//AMm5/wDUw/27/wBunkeR/wB/N27zvbG3vng/5OM/6l7+wv8At78/z/8Av3t2+T753dsc+gfDL4m/8LG/tT/iUf2f9g8r/l583fv3/wCwuMbPfrXn/wCzL/zNP/bp/wC1q8Ar3/8AZl/5mn/t0/8Aa1H7Mv8AzNP/AG6f+1q+gKKKK+f/ANmX/maf+3T/ANrUf8My/wDU3f8AlN/+216B8Mvhl/wrn+1P+Jv/AGh9v8r/AJdvK2bN/wDttnO/26V5/wDsy/8AM0/9un/taj/k4z/qXv7C/wC3vz/P/wC/e3b5Pvnd2xyf8nGf9S9/YX/b35/n/wDfvbt8n3zu7Y5P2mv+ZW/7e/8A2jR+zL/zNP8A26f+1qP+Tc/+ph/t3/t08jyP+/m7d53tjb3zx4BXv/7TX/Mrf9vf/tGj/k3P/qYf7d/7dPI8j/v5u3ed7Y2988cB8Mvhl/wsb+1P+Jv/AGf9g8r/AJdvN379/wDtrjGz3613/wDwzL/1N3/lN/8AttH7Mv8AzNP/AG6f+1q4D4m/DL/hXP8AZf8AxN/7Q+3+b/y7eVs2bP8AbbOd/t0rv/8Ahpr/AKlH/wAqX/2qj/k4z/qXv7C/7e/P8/8A797dvk++d3bHJ/ybn/1MP9u/9unkeR/383bvO9sbe+ePQPhl8Mv+Fc/2p/xN/wC0Pt/lf8u3lbNm/wD22znf7dKPib8Mv+Fjf2X/AMTf+z/sHm/8u3m79+z/AG1xjZ79a8//AGZf+Zp/7dP/AGtX0BXz/wDsy/8AM0/9un/taj/hmX/qbv8Aym//AG2vQPhl8Mv+Fc/2p/xN/wC0Pt/lf8u3lbNm/wD22znf7dK8/wD2Zf8Amaf+3T/2tX0BRRRXz/8A8My/9Td/5Tf/ALbR/wAMy/8AU3f+U3/7bR/wzL/1N3/lN/8AttegfDL4Zf8ACuf7U/4m/wDaH2/yv+Xbytmzf/ttnO/26V5//wAm5/8AUw/27/26eR5H/fzdu872xt7549A+GXwy/wCFc/2p/wATf+0Pt/lf8u3lbNm//bbOd/t0rz/9mX/maf8At0/9rVwHwy+Jv/Cuf7U/4lH9ofb/ACv+Xnytmzf/ALDZzv8AbpR8Mvib/wAK5/tT/iUf2h9v8r/l58rZs3/7DZzv9ulHwy+Jv/Cuf7U/4lH9ofb/ACv+Xnytmzf/ALDZzv8AbpXf/sy/8zT/ANun/tavQPhl8Mv+Fc/2p/xN/wC0Pt/lf8u3lbNm/wD22znf7dK8/wD2Zf8Amaf+3T/2tXoHwy+GX/Cuf7U/4m/9ofb/ACv+Xbytmzf/ALbZzv8AbpXgHwy+Jv8Awrn+1P8AiUf2h9v8r/l58rZs3/7DZzv9uld/+zL/AMzT/wBun/tavQPhl8Mv+Fc/2p/xN/7Q+3+V/wAu3lbNm/8A22znf7dK8A+GXxN/4Vz/AGp/xKP7Q+3+V/y8+Vs2b/8AYbOd/t0o+GXxN/4Vz/an/Eo/tD7f5X/Lz5WzZv8A9hs53+3Su/8A2Zf+Zp/7dP8A2tR/ybn/ANTD/bv/AG6eR5H/AH83bvO9sbe+eD9mX/maf+3T/wBrUfsy/wDM0/8Abp/7Wo/4Zl/6m7/ym/8A22j/AIZl/wCpu/8AKb/9to/4Zl/6m7/ym/8A22vQPhl8Mv8AhXP9qf8AE3/tD7f5X/Lt5WzZv/22znf7dK9Aooor5/8A2Zf+Zp/7dP8A2tXAfE34m/8ACxv7L/4lH9n/AGDzf+Xnzd+/Z/sLjGz360fE34m/8LG/sv8A4lH9n/YPN/5efN379n+wuMbPfrXv/wAMvhl/wrn+1P8Aib/2h9v8r/l28rZs3/7bZzv9ulfIFFegfDL4m/8ACuf7U/4lH9ofb/K/5efK2bN/+w2c7/bpXf8A7TX/ADK3/b3/AO0a9A+GXxN/4WN/an/Eo/s/7B5X/Lz5u/fv/wBhcY2e/WvAPib8Mv8AhXP9l/8AE3/tD7f5v/Lt5WzZs/22znf7dKPib8Mv+Fc/2X/xN/7Q+3+b/wAu3lbNmz/bbOd/t0rv/wBmX/maf+3T/wBrVwHxN+GX/Cuf7L/4m/8AaH2/zf8Al28rZs2f7bZzv9ulHxN+GX/Cuf7L/wCJv/aH2/zf+XbytmzZ/ttnO/26V3//AAzL/wBTd/5Tf/ttH7TX/Mrf9vf/ALRrgPhl8Tf+Fc/2p/xKP7Q+3+V/y8+Vs2b/APYbOd/t0o+Jvwy/4Vz/AGX/AMTf+0Pt/m/8u3lbNmz/AG2znf7dK7//AJOM/wCpe/sL/t78/wA//v3t2+T753dscn/Juf8A1MP9u/8Abp5Hkf8Afzdu872xt7548Ar3/wD5Nz/6mH+3f+3TyPI/7+bt3ne2NvfPHAfE34Zf8K5/sv8A4m/9ofb/ADf+XbytmzZ/ttnO/wBuld/+01/zK3/b3/7Rr6Aorz/4ZfE3/hY39qf8Sj+z/sHlf8vPm79+/wD2FxjZ79a9Aooor5A+Jvwy/wCFc/2X/wATf+0Pt/m/8u3lbNmz/bbOd/t0o+JvxN/4WN/Zf/Eo/s/7B5v/AC8+bv37P9hcY2e/Wu//AGmv+ZW/7e//AGjXoHwy+GX/AArn+1P+Jv8A2h9v8r/l28rZs3/7bZzv9ulHwy+Jv/Cxv7U/4lH9n/YPK/5efN379/8AsLjGz3615/8A8nGf9S9/YX/b35/n/wDfvbt8n3zu7Y5+gK+QPib8Tf8AhY39l/8AEo/s/wCweb/y8+bv37P9hcY2e/Wvf/hl8Tf+Fjf2p/xKP7P+weV/y8+bv37/APYXGNnv1rz/AP4aa/6lH/ypf/aq9A+Jvwy/4WN/Zf8AxN/7P+web/y7ebv37P8AbXGNnv1r0CvkD4m/DL/hXP8AZf8AxN/7Q+3+b/y7eVs2bP8AbbOd/t0rv/8Ahpr/AKlH/wAqX/2qj/hmX/qbv/Kb/wDbaP8Ak3P/AKmH+3f+3TyPI/7+bt3ne2NvfPHoHxN+Jv8Awrn+y/8AiUf2h9v83/l58rZs2f7DZzv9ulHwy+GX/Cuf7U/4m/8AaH2/yv8Al28rZs3/AO22c7/bpXn/AO01/wAyt/29/wDtGj/hpr/qUf8Aypf/AGqj/k4z/qXv7C/7e/P8/wD797dvk++d3bHJ/wANNf8AUo/+VL/7VXAfE34Zf8K5/sv/AIm/9ofb/N/5dvK2bNn+22c7/bpR8Mvib/wrn+1P+JR/aH2/yv8Al58rZs3/AOw2c7/bpR8Mvhl/wsb+1P8Aib/2f9g8r/l283fv3/7a4xs9+tHwy+Jv/Cuf7U/4lH9ofb/K/wCXnytmzf8A7DZzv9ulfX9FFFFfP/8AwzL/ANTd/wCU3/7bXoHwy+GX/Cuf7U/4m/8AaH2/yv8Al28rZs3/AO22c7/bpXgHwy+GX/Cxv7U/4m/9n/YPK/5dvN379/8AtrjGz3613/8AwzL/ANTd/wCU3/7bR/w01/1KP/lS/wDtVegfDL4Zf8K5/tT/AIm/9ofb/K/5dvK2bN/+22c7/bpR8Mvib/wsb+1P+JR/Z/2Dyv8Al583fv3/AOwuMbPfrR8Mvhl/wrn+1P8Aib/2h9v8r/l28rZs3/7bZzv9uleAfE34Zf8ACuf7L/4m/wDaH2/zf+XbytmzZ/ttnO/26V3/AO01/wAyt/29/wDtGuA+GXwy/wCFjf2p/wATf+z/ALB5X/Lt5u/fv/21xjZ79a9/+Jvwy/4WN/Zf/E3/ALP+web/AMu3m79+z/bXGNnv1rwD4m/DL/hXP9l/8Tf+0Pt/m/8ALt5WzZs/22znf7dK9/8Aib8Tf+Fc/wBl/wDEo/tD7f5v/Lz5WzZs/wBhs53+3SvP/wBpr/mVv+3v/wBo0f8AJuf/AFMP9u/9unkeR/383bvO9sbe+eD9mX/maf8At0/9rV4BXoHwy+Jv/Cuf7U/4lH9ofb/K/wCXnytmzf8A7DZzv9uld/8A8m5/9TD/AG7/ANunkeR/383bvO9sbe+eOA+GXxN/4Vz/AGp/xKP7Q+3+V/y8+Vs2b/8AYbOd/t0rv/8Ak3P/AKmH+3f+3TyPI/7+bt3ne2NvfPHoHxN+GX/Cxv7L/wCJv/Z/2Dzf+Xbzd+/Z/trjGz3614B8Mvib/wAK5/tT/iUf2h9v8r/l58rZs3/7DZzv9ule/wDxN+Jv/Cuf7L/4lH9ofb/N/wCXnytmzZ/sNnO/26UfE34m/wDCuf7L/wCJR/aH2/zf+XnytmzZ/sNnO/26V5/+zL/zNP8A26f+1q+gKKKK+f8A/k3P/qYf7d/7dPI8j/v5u3ed7Y2988H/ACbn/wBTD/bv/bp5Hkf9/N27zvbG3vnjgPib8Mv+Fc/2X/xN/wC0Pt/m/wDLt5WzZs/22znf7dK9/wDhl8Mv+Fc/2p/xN/7Q+3+V/wAu3lbNm/8A22znf7dKPib8Mv8AhY39l/8AE3/s/wCweb/y7ebv37P9tcY2e/WvAPib8Mv+Fc/2X/xN/wC0Pt/m/wDLt5WzZs/22znf7dK8/r3/APaa/wCZW/7e/wD2jXAfDL4m/wDCuf7U/wCJR/aH2/yv+Xnytmzf/sNnO/26V7/8Mvhl/wAK5/tT/ib/ANofb/K/5dvK2bN/+22c7/bpXn//AA01/wBSj/5Uv/tVegfE34m/8K5/sv8A4lH9ofb/ADf+XnytmzZ/sNnO/wBulHxN+Jv/AArn+y/+JR/aH2/zf+XnytmzZ/sNnO/26V5/+01/zK3/AG9/+0aP2Zf+Zp/7dP8A2tR+zL/zNP8A26f+1qP+TjP+pe/sL/t78/z/APv3t2+T753dsc+AV7/+zL/zNP8A26f+1q9A+GXwy/4Vz/an/E3/ALQ+3+V/y7eVs2b/APbbOd/t0rwD4ZfDL/hY39qf8Tf+z/sHlf8ALt5u/fv/ANtcY2e/Wvf/AIm/E3/hXP8AZf8AxKP7Q+3+b/y8+Vs2bP8AYbOd/t0rwD4m/DL/AIVz/Zf/ABN/7Q+3+b/y7eVs2bP9ts53+3Su/wD2mv8AmVv+3v8A9o1wHwy+Jv8Awrn+1P8AiUf2h9v8r/l58rZs3/7DZzv9ulHxN+GX/Cuf7L/4m/8AaH2/zf8Al28rZs2f7bZzv9ule/8Awy+GX/Cuf7U/4m/9ofb/ACv+Xbytmzf/ALbZzv8AbpXoFFFFfIHwy+GX/Cxv7U/4m/8AZ/2Dyv8Al283fv3/AO2uMbPfrXf/APDMv/U3f+U3/wC20f8AJxn/AFL39hf9vfn+f/3727fJ987u2OfQPhl8Mv8AhXP9qf8AE3/tD7f5X/Lt5WzZv/22znf7dK8//wCGmv8AqUf/ACpf/aq8Ar3/AP4aa/6lH/ypf/aq9A+GXwy/4Vz/AGp/xN/7Q+3+V/y7eVs2b/8AbbOd/t0rwD4m/DL/AIVz/Zf/ABN/7Q+3+b/y7eVs2bP9ts53+3Svf/ib8Mv+Fjf2X/xN/wCz/sHm/wDLt5u/fs/21xjZ79a8/wD+TjP+pe/sL/t78/z/APv3t2+T753dsc+gfDL4m/8ACxv7U/4lH9n/AGDyv+Xnzd+/f/sLjGz360fDL4Zf8K5/tT/ib/2h9v8AK/5dvK2bN/8AttnO/wBulef/APJxn/Uvf2F/29+f5/8A3727fJ987u2OT/hpr/qUf/Kl/wDaqP2mv+ZW/wC3v/2jR+zL/wAzT/26f+1q8Ar3/wD4Zl/6m7/ym/8A22vQPhl8Tf8AhY39qf8AEo/s/wCweV/y8+bv37/9hcY2e/Wj4m/E3/hXP9l/8Sj+0Pt/m/8ALz5WzZs/2Gznf7dKPib8Mv8AhY39l/8AE3/s/wCweb/y7ebv37P9tcY2e/Wj4ZfE3/hY39qf8Sj+z/sHlf8ALz5u/fv/ANhcY2e/Wj4ZfDL/AIVz/an/ABN/7Q+3+V/y7eVs2b/9ts53+3SvQK+f/wDk4z/qXv7C/wC3vz/P/wC/e3b5Pvnd2xz9AUUUUV5/8Mvhl/wrn+1P+Jv/AGh9v8r/AJdvK2bN/wDttnO/26V5/wD8m5/9TD/bv/bp5Hkf9/N27zvbG3vnjwCvQPib8Mv+Fc/2X/xN/wC0Pt/m/wDLt5WzZs/22znf7dK7/wD5Nz/6mH+3f+3TyPI/7+bt3ne2NvfPHAfDL4m/8K5/tT/iUf2h9v8AK/5efK2bN/8AsNnO/wBulHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrXf8A7TX/ADK3/b3/AO0a4D4m/DL/AIVz/Zf/ABN/7Q+3+b/y7eVs2bP9ts53+3Sj4ZfDL/hY39qf8Tf+z/sHlf8ALt5u/fv/ANtcY2e/Wu//AGmv+ZW/7e//AGjXoHxN+GX/AAsb+y/+Jv8A2f8AYPN/5dvN379n+2uMbPfrXoFfIHwy+Jv/AArn+1P+JR/aH2/yv+Xnytmzf/sNnO/26UfDL4Zf8LG/tT/ib/2f9g8r/l283fv3/wC2uMbPfrXf/wDDTX/Uo/8AlS/+1Ufsy/8AM0/9un/tavAK9A+GXwy/4WN/an/E3/s/7B5X/Lt5u/fv/wBtcY2e/Wu//wCGmv8AqUf/ACpf/aq4D4ZfE3/hXP8Aan/Eo/tD7f5X/Lz5WzZv/wBhs53+3Su//wCTjP8AqXv7C/7e/P8AP/797dvk++d3bHPoHxN+Jv8Awrn+y/8AiUf2h9v83/l58rZs2f7DZzv9ulHxN+Jv/Cuf7L/4lH9ofb/N/wCXnytmzZ/sNnO/26UfDL4m/wDCxv7U/wCJR/Z/2Dyv+Xnzd+/f/sLjGz360fE34m/8K5/sv/iUf2h9v83/AJefK2bNn+w2c7/bpR8Mvib/AMLG/tT/AIlH9n/YPK/5efN379/+wuMbPfrXoFFFFfIHwy+Jv/Cuf7U/4lH9ofb/ACv+Xnytmzf/ALDZzv8AbpX1/XwBXoHxN+GX/Cuf7L/4m/8AaH2/zf8Al28rZs2f7bZzv9ule/8Awy+Jv/Cxv7U/4lH9n/YPK/5efN379/8AsLjGz360fE34m/8ACuf7L/4lH9ofb/N/5efK2bNn+w2c7/bpR8Mvhl/wrn+1P+Jv/aH2/wAr/l28rZs3/wC22c7/AG6V5/8Asy/8zT/26f8AtauA+JvxN/4WN/Zf/Eo/s/7B5v8Ay8+bv37P9hcY2e/Wvf8A4m/E3/hXP9l/8Sj+0Pt/m/8ALz5WzZs/2Gznf7dK8A+JvxN/4WN/Zf8AxKP7P+web/y8+bv37P8AYXGNnv1r3/4m/E3/AIVz/Zf/ABKP7Q+3+b/y8+Vs2bP9hs53+3SvP/8Ak3P/AKmH+3f+3TyPI/7+bt3ne2NvfPB/w01/1KP/AJUv/tVegfE34m/8K5/sv/iUf2h9v83/AJefK2bNn+w2c7/bpXn/AO01/wAyt/29/wDtGj/hpr/qUf8Aypf/AGqvoCvkD4ZfE3/hXP8Aan/Eo/tD7f5X/Lz5WzZv/wBhs53+3Svf/ib8Tf8AhXP9l/8AEo/tD7f5v/Lz5WzZs/2Gznf7dK8//wCGZf8Aqbv/ACm//baP2mv+ZW/7e/8A2jR/ybn/ANTD/bv/AG6eR5H/AH83bvO9sbe+ePQPib8Tf+Fc/wBl/wDEo/tD7f5v/Lz5WzZs/wBhs53+3SvAPhl8Tf8AhXP9qf8AEo/tD7f5X/Lz5WzZv/2Gznf7dK9/+GXxN/4WN/an/Eo/s/7B5X/Lz5u/fv8A9hcY2e/Wj4ZfE3/hY39qf8Sj+z/sHlf8vPm79+//AGFxjZ79a9Aoooor5/8A2Zf+Zp/7dP8A2tR/wzL/ANTd/wCU3/7bR/ybn/1MP9u/9unkeR/383bvO9sbe+ePQPib8Tf+Fc/2X/xKP7Q+3+b/AMvPlbNmz/YbOd/t0o+JvxN/4Vz/AGX/AMSj+0Pt/m/8vPlbNmz/AGGznf7dK8A+Jvwy/wCFc/2X/wATf+0Pt/m/8u3lbNmz/bbOd/t0r3/4m/DL/hY39l/8Tf8As/7B5v8Ay7ebv37P9tcY2e/Wj4m/E3/hXP8AZf8AxKP7Q+3+b/y8+Vs2bP8AYbOd/t0r5Ar0D4ZfE3/hXP8Aan/Eo/tD7f5X/Lz5WzZv/wBhs53+3Su//wCGmv8AqUf/ACpf/aq4D4ZfE3/hXP8Aan/Eo/tD7f5X/Lz5WzZv/wBhs53+3Su//aa/5lb/ALe//aNcB8Mvhl/wsb+1P+Jv/Z/2Dyv+Xbzd+/f/ALa4xs9+tHxN+Jv/AAsb+y/+JR/Z/wBg83/l583fv2f7C4xs9+te/wDwy+GX/Cuf7U/4m/8AaH2/yv8Al28rZs3/AO22c7/bpXgHwy+GX/Cxv7U/4m/9n/YPK/5dvN379/8AtrjGz360fE34Zf8ACuf7L/4m/wDaH2/zf+XbytmzZ/ttnO/26V5/Xv8A+01/zK3/AG9/+0a4D4ZfDL/hY39qf8Tf+z/sHlf8u3m79+//AG1xjZ79a9/+GXxN/wCFjf2p/wASj+z/ALB5X/Lz5u/fv/2FxjZ79aPhl8Mv+Fc/2p/xN/7Q+3+V/wAu3lbNm/8A22znf7dK+QK9/wD2Zf8Amaf+3T/2tX0BRRRRXyB8Tfhl/wAK5/sv/ib/ANofb/N/5dvK2bNn+22c7/bpXf8A/DTX/Uo/+VL/AO1VwHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrXf8A/DMv/U3f+U3/AO21wHwy+Jv/AArn+1P+JR/aH2/yv+Xnytmzf/sNnO/26UfDL4m/8K5/tT/iUf2h9v8AK/5efK2bN/8AsNnO/wBule//ABN+Jv8Awrn+y/8AiUf2h9v83/l58rZs2f7DZzv9uleAfE34m/8ACxv7L/4lH9n/AGDzf+Xnzd+/Z/sLjGz3615/XoHxN+Jv/Cxv7L/4lH9n/YPN/wCXnzd+/Z/sLjGz3613/wC01/zK3/b3/wC0a9A+GXwy/wCFc/2p/wATf+0Pt/lf8u3lbNm//bbOd/t0rwD4ZfDL/hY39qf8Tf8As/7B5X/Lt5u/fv8A9tcY2e/Wu/8A+GZf+pu/8pv/ANtrgPhl8Mv+Fjf2p/xN/wCz/sHlf8u3m79+/wD21xjZ79a8/r0D4ZfDL/hY39qf8Tf+z/sHlf8ALt5u/fv/ANtcY2e/Wj4m/E3/AIWN/Zf/ABKP7P8AsHm/8vPm79+z/YXGNnv1rv8A/hpr/qUf/Kl/9qr0D4m/DL/hY39l/wDE3/s/7B5v/Lt5u/fs/wBtcY2e/WvP/wBmX/maf+3T/wBrV6B8Mvib/wALG/tT/iUf2f8AYPK/5efN379/+wuMbPfrXgHwy+GX/Cxv7U/4m/8AZ/2Dyv8Al283fv3/AO2uMbPfrXf/APDMv/U3f+U3/wC20fsy/wDM0/8Abp/7WrgPib8Mv+Fc/wBl/wDE3/tD7f5v/Lt5WzZs/wBts53+3Svf/hl8Mv8AhXP9qf8AE3/tD7f5X/Lt5WzZv/22znf7dK9Aooorz/4m/DL/AIWN/Zf/ABN/7P8AsHm/8u3m79+z/bXGNnv1rwD4ZfE3/hXP9qf8Sj+0Pt/lf8vPlbNm/wD2Gznf7dK7/wDZl/5mn/t0/wDa1egfDL4Zf8K5/tT/AIm/9ofb/K/5dvK2bN/+22c7/bpXgHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrR8Tfhl/wrn+y/wDib/2h9v8AN/5dvK2bNn+22c7/AG6V3/7TX/Mrf9vf/tGuA+GXxN/4Vz/an/Eo/tD7f5X/AC8+Vs2b/wDYbOd/t0o+Jvwy/wCFc/2X/wATf+0Pt/m/8u3lbNmz/bbOd/t0r6/rz/4ZfDL/AIVz/an/ABN/7Q+3+V/y7eVs2b/9ts53+3Sj4ZfDL/hXP9qf8Tf+0Pt/lf8ALt5WzZv/ANts53+3SvP/ANmX/maf+3T/ANrV6B8Mvhl/wrn+1P8Aib/2h9v8r/l28rZs3/7bZzv9uleAfDL4m/8ACuf7U/4lH9ofb/K/5efK2bN/+w2c7/bpX1/RRXyB8Tfib/wsb+y/+JR/Z/2Dzf8Al583fv2f7C4xs9+td/8A8m5/9TD/AG7/ANunkeR/383bvO9sbe+ePAK+v/ib8Tf+Fc/2X/xKP7Q+3+b/AMvPlbNmz/YbOd/t0rz/APZl/wCZp/7dP/a1egfDL4Zf8K5/tT/ib/2h9v8AK/5dvK2bN/8AttnO/wBuleAfDL4m/wDCuf7U/wCJR/aH2/yv+Xnytmzf/sNnO/26V7/8Tfhl/wALG/sv/ib/ANn/AGDzf+Xbzd+/Z/trjGz3615/+zL/AMzT/wBun/tavoCiiivP/ib8Tf8AhXP9l/8AEo/tD7f5v/Lz5WzZs/2Gznf7dK8//wCTc/8AqYf7d/7dPI8j/v5u3ed7Y2988H/DMv8A1N3/AJTf/ttH/DMv/U3f+U3/AO214BXv/wDwzL/1N3/lN/8AttH/AA01/wBSj/5Uv/tVH/DMv/U3f+U3/wC214BXoHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrXf8A7Mv/ADNP/bp/7Wr0D4ZfE3/hY39qf8Sj+z/sHlf8vPm79+//AGFxjZ79a8//AOGZf+pu/wDKb/8Aba4D4ZfDL/hY39qf8Tf+z/sHlf8ALt5u/fv/ANtcY2e/Wj4ZfDL/AIWN/an/ABN/7P8AsHlf8u3m79+//bXGNnv1r3/4m/DL/hY39l/8Tf8As/7B5v8Ay7ebv37P9tcY2e/WvP8A9mX/AJmn/t0/9rV9AV8//wDDMv8A1N3/AJTf/ttH/Jxn/Uvf2F/29+f5/wD3727fJ987u2OfQPib8Mv+Fjf2X/xN/wCz/sHm/wDLt5u/fs/21xjZ79a9Ar5A+Jvwy/4Vz/Zf/E3/ALQ+3+b/AMu3lbNmz/bbOd/t0o+Jvwy/4Vz/AGX/AMTf+0Pt/m/8u3lbNmz/AG2znf7dK9/+GXwy/wCFc/2p/wATf+0Pt/lf8u3lbNm//bbOd/t0rz//AJOM/wCpe/sL/t78/wA//v3t2+T753dscn7Mv/M0/wDbp/7Wr6Aooorz/wCGXwy/4Vz/AGp/xN/7Q+3+V/y7eVs2b/8AbbOd/t0rz/8A4Zl/6m7/AMpv/wBto/Zl/wCZp/7dP/a1H/Juf/Uw/wBu/wDbp5Hkf9/N27zvbG3vng/Zl/5mn/t0/wDa1H/Juf8A1MP9u/8Abp5Hkf8Afzdu872xt7544D4ZfDL/AIWN/an/ABN/7P8AsHlf8u3m79+//bXGNnv1o+GXwy/4WN/an/E3/s/7B5X/AC7ebv37/wDbXGNnv1o+JvxN/wCFjf2X/wASj+z/ALB5v/Lz5u/fs/2FxjZ79aPhl8Mv+Fjf2p/xN/7P+weV/wAu3m79+/8A21xjZ79a7/8A5OM/6l7+wv8At78/z/8Av3t2+T753dsc8B8Mvib/AMK5/tT/AIlH9ofb/K/5efK2bN/+w2c7/bpXv/xN+GX/AAsb+y/+Jv8A2f8AYPN/5dvN379n+2uMbPfrXn//AA01/wBSj/5Uv/tVegfDL4m/8LG/tT/iUf2f9g8r/l583fv3/wCwuMbPfrXn/wCzL/zNP/bp/wC1q4D4ZfE3/hXP9qf8Sj+0Pt/lf8vPlbNm/wD2Gznf7dKPib8Mv+Fc/wBl/wDE3/tD7f5v/Lt5WzZs/wBts53+3Su//Zl/5mn/ALdP/a1fQFef/E34Zf8ACxv7L/4m/wDZ/wBg83/l283fv2f7a4xs9+tef/8ADTX/AFKP/lS/+1VwHxN+GX/Cuf7L/wCJv/aH2/zf+XbytmzZ/ttnO/26V5/Xv/8AwzL/ANTd/wCU3/7bR/ybn/1MP9u/9unkeR/383bvO9sbe+eD9mX/AJmn/t0/9rV9AUUUV8AUV7//AMnGf9S9/YX/AG9+f5//AH727fJ987u2OfQPhl8Mv+Fc/wBqf8Tf+0Pt/lf8u3lbNm//AG2znf7dK8A+Jvwy/wCFc/2X/wATf+0Pt/m/8u3lbNmz/bbOd/t0rv8A9pr/AJlb/t7/APaNH/DMv/U3f+U3/wC20f8ADMv/AFN3/lN/+216B8Mvhl/wrn+1P+Jv/aH2/wAr/l28rZs3/wC22c7/AG6V5/8A8nGf9S9/YX/b35/n/wDfvbt8n3zu7Y59A+Jvwy/4WN/Zf/E3/s/7B5v/AC7ebv37P9tcY2e/WvQK+QPib8Tf+Fjf2X/xKP7P+web/wAvPm79+z/YXGNnv1o+Jvwy/wCFc/2X/wATf+0Pt/m/8u3lbNmz/bbOd/t0r3/4m/DL/hY39l/8Tf8As/7B5v8Ay7ebv37P9tcY2e/Wj4ZfE3/hY39qf8Sj+z/sHlf8vPm79+//AGFxjZ79a8//AOTjP+pe/sL/ALe/P8//AL97dvk++d3bHPoHxN+Jv/Cuf7L/AOJR/aH2/wA3/l58rZs2f7DZzv8AbpR8Mvhl/wAK5/tT/ib/ANofb/K/5dvK2bN/+22c7/bpXgHxN+GX/Cuf7L/4m/8AaH2/zf8Al28rZs2f7bZzv9uld/8A8My/9Td/5Tf/ALbXoHxN+Jv/AArn+y/+JR/aH2/zf+XnytmzZ/sNnO/26V5/+zL/AMzT/wBun/taj/k3P/qYf7d/7dPI8j/v5u3ed7Y2988fQFfP/wDybn/1MP8Abv8A26eR5H/fzdu872xt754+gKKKKK+AK+v/AIZfE3/hY39qf8Sj+z/sHlf8vPm79+//AGFxjZ79aPhl8Tf+Fjf2p/xKP7P+weV/y8+bv37/APYXGNnv1rwD4m/DL/hXP9l/8Tf+0Pt/m/8ALt5WzZs/22znf7dK9/8Ahl8Mv+Fc/wBqf8Tf+0Pt/lf8u3lbNm//AG2znf7dK8//AOGZf+pu/wDKb/8Aba8Ar6/+Jvwy/wCFjf2X/wATf+z/ALB5v/Lt5u/fs/21xjZ79aPib8Mv+Fjf2X/xN/7P+web/wAu3m79+z/bXGNnv1rz/wD4Zl/6m7/ym/8A22j/AJNz/wCph/t3/t08jyP+/m7d53tjb3zx6B8Mvhl/wrn+1P8Aib/2h9v8r/l28rZs3/7bZzv9ulHwy+GX/Cuf7U/4m/8AaH2/yv8Al28rZs3/AO22c7/bpXgHwy+Jv/Cuf7U/4lH9ofb/ACv+Xnytmzf/ALDZzv8AbpXv/wAMvib/AMLG/tT/AIlH9n/YPK/5efN379/+wuMbPfrXgHxN+GX/AArn+y/+Jv8A2h9v83/l28rZs2f7bZzv9uld/wD8NNf9Sj/5Uv8A7VX0BXyB8Mvhl/wsb+1P+Jv/AGf9g8r/AJdvN379/wDtrjGz3619f18//wDDTX/Uo/8AlS/+1V6B8Tfhl/wsb+y/+Jv/AGf9g83/AJdvN379n+2uMbPfrR8Mvib/AMLG/tT/AIlH9n/YPK/5efN379/+wuMbPfrR8Mvib/wsb+1P+JR/Z/2Dyv8Al583fv3/AOwuMbPfrR8Tfhl/wsb+y/8Aib/2f9g83/l283fv2f7a4xs9+tef/sy/8zT/ANun/taj9mX/AJmn/t0/9rV9AUUUV8//ALTX/Mrf9vf/ALRo/wCGZf8Aqbv/ACm//ba+gK+f/wDk3P8A6mH+3f8At08jyP8Av5u3ed7Y2988eAUV7/8A8NNf9Sj/AOVL/wC1Uf8AJuf/AFMP9u/9unkeR/383bvO9sbe+ePQPib8Mv8AhY39l/8AE3/s/wCweb/y7ebv37P9tcY2e/WvP/8Ak4z/AKl7+wv+3vz/AD/+/e3b5Pvnd2xzwHwy+Jv/AArn+1P+JR/aH2/yv+Xnytmzf/sNnO/26UfDL4Zf8LG/tT/ib/2f9g8r/l283fv3/wC2uMbPfrXv/wATfib/AMK5/sv/AIlH9ofb/N/5efK2bNn+w2c7/bpXn/7Mv/M0/wDbp/7Wr0D4ZfDL/hXP9qf8Tf8AtD7f5X/Lt5WzZv8A9ts53+3Sj4ZfDL/hXP8Aan/E3/tD7f5X/Lt5WzZv/wBts53+3SvAPib8Mv8AhXP9l/8AE3/tD7f5v/Lt5WzZs/22znf7dKPhl8Mv+Fjf2p/xN/7P+weV/wAu3m79+/8A21xjZ79a7/8AZl/5mn/t0/8Aa1cB8Mvib/wrn+1P+JR/aH2/yv8Al58rZs3/AOw2c7/bpR8Mvib/AMK5/tT/AIlH9ofb/K/5efK2bN/+w2c7/bpXf/8AJuf/AFMP9u/9unkeR/383bvO9sbe+eOA+Jvwy/4Vz/Zf/E3/ALQ+3+b/AMu3lbNmz/bbOd/t0o+GXxN/4Vz/AGp/xKP7Q+3+V/y8+Vs2b/8AYbOd/t0rv/8Ak3P/AKmH+3f+3TyPI/7+bt3ne2NvfPB/w01/1KP/AJUv/tVegfDL4m/8LG/tT/iUf2f9g8r/AJefN379/wDsLjGz3616BRRRRXyB8Tfhl/wrn+y/+Jv/AGh9v83/AJdvK2bNn+22c7/bpR8Mvib/AMK5/tT/AIlH9ofb/K/5efK2bN/+w2c7/bpXv/wy+GX/AArn+1P+Jv8A2h9v8r/l28rZs3/7bZzv9ulHxN+GX/Cxv7L/AOJv/Z/2Dzf+Xbzd+/Z/trjGz3615/8A8My/9Td/5Tf/ALbXoHxN+Jv/AArn+y/+JR/aH2/zf+XnytmzZ/sNnO/26V4B8Mvhl/wsb+1P+Jv/AGf9g8r/AJdvN379/wDtrjGz3617/wDDL4m/8LG/tT/iUf2f9g8r/l583fv3/wCwuMbPfrXgHxN+Jv8Awsb+y/8AiUf2f9g83/l583fv2f7C4xs9+te//DL4m/8ACxv7U/4lH9n/AGDyv+Xnzd+/f/sLjGz3614B8Tfhl/wrn+y/+Jv/AGh9v83/AJdvK2bNn+22c7/bpXv/AMTfhl/wsb+y/wDib/2f9g83/l283fv2f7a4xs9+tegV5/8AE34Zf8LG/sv/AIm/9n/YPN/5dvN379n+2uMbPfrR8Tfib/wrn+y/+JR/aH2/zf8Al58rZs2f7DZzv9ulef8A/Jxn/Uvf2F/29+f5/wD3727fJ987u2OfAK9A+GXxN/4Vz/an/Eo/tD7f5X/Lz5WzZv8A9hs53+3Svf8A4m/E3/hXP9l/8Sj+0Pt/m/8ALz5WzZs/2Gznf7dKPhl8Mv8AhXP9qf8AE3/tD7f5X/Lt5WzZv/22znf7dK9Ar5A+JvxN/wCFjf2X/wASj+z/ALB5v/Lz5u/fs/2FxjZ79aPhl8Mv+Fjf2p/xN/7P+weV/wAu3m79+/8A21xjZ79a9/8Aib8Tf+Fc/wBl/wDEo/tD7f5v/Lz5WzZs/wBhs53+3SvQK8/+GXwy/wCFc/2p/wATf+0Pt/lf8u3lbNm//bbOd/t0r0CiiivkD4ZfE3/hXP8Aan/Eo/tD7f5X/Lz5WzZv/wBhs53+3Su//wCGZf8Aqbv/ACm//ba+gK8/+GXwy/4Vz/an/E3/ALQ+3+V/y7eVs2b/APbbOd/t0rz/AP4Zl/6m7/ym/wD22vQPib8Tf+Fc/wBl/wDEo/tD7f5v/Lz5WzZs/wBhs53+3SvQK8/+Jvwy/wCFjf2X/wATf+z/ALB5v/Lt5u/fs/21xjZ79a8//Zl/5mn/ALdP/a1cB8Tfib/wsb+y/wDiUf2f9g83/l583fv2f7C4xs9+te//AAy+GX/Cuf7U/wCJv/aH2/yv+Xbytmzf/ttnO/26UfE34m/8K5/sv/iUf2h9v83/AJefK2bNn+w2c7/bpR8Tfhl/wsb+y/8Aib/2f9g83/l283fv2f7a4xs9+tef/wDJuf8A1MP9u/8Abp5Hkf8Afzdu872xt754P+TjP+pe/sL/ALe/P8//AL97dvk++d3bHPoHwy+GX/Cuf7U/4m/9ofb/ACv+Xbytmzf/ALbZzv8AbpR8Mvhl/wAK5/tT/ib/ANofb/K/5dvK2bN/+22c7/bpXn//AAzL/wBTd/5Tf/tteAUV9f8AxN+Jv/Cuf7L/AOJR/aH2/wA3/l58rZs2f7DZzv8AbpXgHxN+Jv8Awsb+y/8AiUf2f9g83/l583fv2f7C4xs9+tfX9FfIHwy+Jv8Awrn+1P8AiUf2h9v8r/l58rZs3/7DZzv9ulHwy+Jv/Cuf7U/4lH9ofb/K/wCXnytmzf8A7DZzv9ule/8Awy+Jv/Cxv7U/4lH9n/YPK/5efN379/8AsLjGz3616BRRRXyB8Tfhl/wrn+y/+Jv/AGh9v83/AJdvK2bNn+22c7/bpXf/APJxn/Uvf2F/29+f5/8A3727fJ987u2OT/hmX/qbv/Kb/wDbaP8Ak3P/AKmH+3f+3TyPI/7+bt3ne2NvfPB/wzL/ANTd/wCU3/7bR+01/wAyt/29/wDtGj9mX/maf+3T/wBrV6B8Mvhl/wAK5/tT/ib/ANofb/K/5dvK2bN/+22c7/bpXn//AAzL/wBTd/5Tf/ttH/Juf/Uw/wBu/wDbp5Hkf9/N27zvbG3vnjgPhl8Mv+Fjf2p/xN/7P+weV/y7ebv37/8AbXGNnv1r3/4ZfDL/AIVz/an/ABN/7Q+3+V/y7eVs2b/9ts53+3SvP/2Zf+Zp/wC3T/2tXoHxN+GX/Cxv7L/4m/8AZ/2Dzf8Al283fv2f7a4xs9+tef8A/Jxn/Uvf2F/29+f5/wD3727fJ987u2OfQPib8Mv+Fjf2X/xN/wCz/sHm/wDLt5u/fs/21xjZ79a8/wD+Gmv+pR/8qX/2quA+JvxN/wCFjf2X/wASj+z/ALB5v/Lz5u/fs/2FxjZ79a9/+Jvwy/4WN/Zf/E3/ALP+web/AMu3m79+z/bXGNnv1rwD4m/DL/hXP9l/8Tf+0Pt/m/8ALt5WzZs/22znf7dKPib8Mv8AhXP9l/8AE3/tD7f5v/Lt5WzZs/22znf7dK9/+JvxN/4Vz/Zf/Eo/tD7f5v8Ay8+Vs2bP9hs53+3SvP8A9pr/AJlb/t7/APaNH/Juf/Uw/wBu/wDbp5Hkf9/N27zvbG3vng/Zl/5mn/t0/wDa1eAV7/8Asy/8zT/26f8AtavoCiiiivP/AIm/DL/hY39l/wDE3/s/7B5v/Lt5u/fs/wBtcY2e/WvQK8/+GXwy/wCFc/2p/wATf+0Pt/lf8u3lbNm//bbOd/t0o+GXxN/4WN/an/Eo/s/7B5X/AC8+bv37/wDYXGNnv1o+Jvwy/wCFjf2X/wATf+z/ALB5v/Lt5u/fs/21xjZ79a8//aa/5lb/ALe//aNH/Jxn/Uvf2F/29+f5/wD3727fJ987u2OfAK9//wCTjP8AqXv7C/7e/P8AP/797dvk++d3bHJ/w01/1KP/AJUv/tVH/DMv/U3f+U3/AO21wHwy+GX/AAsb+1P+Jv8A2f8AYPK/5dvN379/+2uMbPfrXf8A/DMv/U3f+U3/AO214BXv/wC01/zK3/b3/wC0aP8Ak4z/AKl7+wv+3vz/AD/+/e3b5Pvnd2xyftNf8yt/29/+0a4D4ZfE3/hXP9qf8Sj+0Pt/lf8ALz5WzZv/ANhs53+3Svf/AIZfDL/hXP8Aan/E3/tD7f5X/Lt5WzZv/wBts53+3SvAPhl8Mv8AhY39qf8AE3/s/wCweV/y7ebv37/9tcY2e/Wu/wD+Tc/+ph/t3/t08jyP+/m7d53tjb3zxwHwy+GX/Cxv7U/4m/8AZ/2Dyv8Al283fv3/AO2uMbPfrXf/APDMv/U3f+U3/wC21wHwy+Jv/Cuf7U/4lH9ofb/K/wCXnytmzf8A7DZzv9ule/8AxN+Jv/Cuf7L/AOJR/aH2/wA3/l58rZs2f7DZzv8AbpR8Mvib/wALG/tT/iUf2f8AYPK/5efN379/+wuMbPfrXoFFFFfIHwy+GX/Cxv7U/wCJv/Z/2Dyv+Xbzd+/f/trjGz3613//AAzL/wBTd/5Tf/ttH/DMv/U3f+U3/wC20fsy/wDM0/8Abp/7Wo/5OM/6l7+wv+3vz/P/AO/e3b5Pvnd2xyf8NNf9Sj/5Uv8A7VXAfDL4m/8ACuf7U/4lH9ofb/K/5efK2bN/+w2c7/bpR8Mvhl/wsb+1P+Jv/Z/2Dyv+Xbzd+/f/ALa4xs9+td//AMNNf9Sj/wCVL/7VR/ybn/1MP9u/9unkeR/383bvO9sbe+ePAK9//Zl/5mn/ALdP/a1H7Mv/ADNP/bp/7Wr0D4ZfDL/hXP8Aan/E3/tD7f5X/Lt5WzZv/wBts53+3SvAPhl8Mv8AhY39qf8AE3/s/wCweV/y7ebv37/9tcY2e/WvP69//Zl/5mn/ALdP/a1H7Mv/ADNP/bp/7Wo/aa/5lb/t7/8AaNegfDL4m/8ACxv7U/4lH9n/AGDyv+Xnzd+/f/sLjGz3615/+zL/AMzT/wBun/taj/k3P/qYf7d/7dPI8j/v5u3ed7Y2988H7Mv/ADNP/bp/7Wr0D4ZfDL/hXP8Aan/E3/tD7f5X/Lt5WzZv/wBts53+3SvkCvQPhl8Mv+Fjf2p/xN/7P+weV/y7ebv37/8AbXGNnv1r3/4ZfE3/AIWN/an/ABKP7P8AsHlf8vPm79+//YXGNnv1r0Ciiivn/wDZl/5mn/t0/wDa1eAV7/8Asy/8zT/26f8Ataj9mX/maf8At0/9rUf8nGf9S9/YX/b35/n/APfvbt8n3zu7Y59A+GXxN/4WN/an/Eo/s/7B5X/Lz5u/fv8A9hcY2e/WvP8A/hpr/qUf/Kl/9qrgPhl8Mv8AhY39qf8AE3/s/wCweV/y7ebv37/9tcY2e/WvP6+v/hl8Mv8AhXP9qf8AE3/tD7f5X/Lt5WzZv/22znf7dK8//aa/5lb/ALe//aNegfDL4m/8LG/tT/iUf2f9g8r/AJefN379/wDsLjGz3615/wD8My/9Td/5Tf8A7bR/wzL/ANTd/wCU3/7bXAfDL4Zf8LG/tT/ib/2f9g8r/l283fv3/wC2uMbPfrXv/wATfhl/wsb+y/8Aib/2f9g83/l283fv2f7a4xs9+tHwy+Jv/Cxv7U/4lH9n/YPK/wCXnzd+/f8A7C4xs9+tef8A/Juf/Uw/27/26eR5H/fzdu872xt7544D4m/DL/hXP9l/8Tf+0Pt/m/8ALt5WzZs/22znf7dK7/8A5Nz/AOph/t3/ALdPI8j/AL+bt3ne2NvfPHAfDL4m/wDCuf7U/wCJR/aH2/yv+Xnytmzf/sNnO/26V7/8Mvhl/wAK5/tT/ib/ANofb/K/5dvK2bN/+22c7/bpXgHxN+GX/Cuf7L/4m/8AaH2/zf8Al28rZs2f7bZzv9ulef0V9f8Awy+Jv/Cxv7U/4lH9n/YPK/5efN379/8AsLjGz3615/8Asy/8zT/26f8AtavoCiiivn/9mX/maf8At0/9rUf8My/9Td/5Tf8A7bXoHwy+GX/Cuf7U/wCJv/aH2/yv+Xbytmzf/ttnO/26V5/+zL/zNP8A26f+1q9A+Jvwy/4WN/Zf/E3/ALP+web/AMu3m79+z/bXGNnv1r0CvgCvr/4m/DL/AIWN/Zf/ABN/7P8AsHm/8u3m79+z/bXGNnv1o+JvxN/4Vz/Zf/Eo/tD7f5v/AC8+Vs2bP9hs53+3Sj4ZfDL/AIVz/an/ABN/7Q+3+V/y7eVs2b/9ts53+3SvP/2mv+ZW/wC3v/2jR/wzL/1N3/lN/wDttcB8Mvib/wAK5/tT/iUf2h9v8r/l58rZs3/7DZzv9ule/wDwy+GX/Cuf7U/4m/8AaH2/yv8Al28rZs3/AO22c7/bpR8Tfib/AMK5/sv/AIlH9ofb/N/5efK2bNn+w2c7/bpR8Tfhl/wsb+y/+Jv/AGf9g83/AJdvN379n+2uMbPfrXgHwy+Jv/Cuf7U/4lH9ofb/ACv+Xnytmzf/ALDZzv8AbpR8Mvhl/wALG/tT/ib/ANn/AGDyv+Xbzd+/f/trjGz3617/APDL4Zf8K5/tT/ib/wBofb/K/wCXbytmzf8A7bZzv9ulef8A/DMv/U3f+U3/AO21wHwy+Jv/AArn+1P+JR/aH2/yv+Xnytmzf/sNnO/26V3/AO01/wAyt/29/wDtGuA+GXxN/wCFc/2p/wASj+0Pt/lf8vPlbNm//YbOd/t0r3/4m/E3/hXP9l/8Sj+0Pt/m/wDLz5WzZs/2Gznf7dK8/wD2Zf8Amaf+3T/2tXAfE34Zf8K5/sv/AIm/9ofb/N/5dvK2bNn+22c7/bpXv/wy+GX/AArn+1P+Jv8A2h9v8r/l28rZs3/7bZzv9ulegUUUV8//APDMv/U3f+U3/wC20f8ADMv/AFN3/lN/+20f8My/9Td/5Tf/ALbXoHwy+GX/AArn+1P+Jv8A2h9v8r/l28rZs3/7bZzv9ulef/8ADMv/AFN3/lN/+20f8My/9Td/5Tf/ALbR/wAMy/8AU3f+U3/7bX0BXn/xN+GX/Cxv7L/4m/8AZ/2Dzf8Al283fv2f7a4xs9+tef8A/DMv/U3f+U3/AO216B8Mvhl/wrn+1P8Aib/2h9v8r/l28rZs3/7bZzv9ulHxN+GX/Cxv7L/4m/8AZ/2Dzf8Al283fv2f7a4xs9+tHwy+GX/Cuf7U/wCJv/aH2/yv+Xbytmzf/ttnO/26V6BXn/xN+GX/AAsb+y/+Jv8A2f8AYPN/5dvN379n+2uMbPfrR8Mvhl/wrn+1P+Jv/aH2/wAr/l28rZs3/wC22c7/AG6V5/8A8My/9Td/5Tf/ALbXoHwy+GX/AArn+1P+Jv8A2h9v8r/l28rZs3/7bZzv9ulef/8ADMv/AFN3/lN/+20f8My/9Td/5Tf/ALbXoHxN+GX/AAsb+y/+Jv8A2f8AYPN/5dvN379n+2uMbPfrR8Mvhl/wrn+1P+Jv/aH2/wAr/l28rZs3/wC22c7/AG6UfE34Zf8ACxv7L/4m/wDZ/wBg83/l283fv2f7a4xs9+tegV5/8Mvhl/wrn+1P+Jv/AGh9v8r/AJdvK2bN/wDttnO/26UfE34Zf8LG/sv/AIm/9n/YPN/5dvN379n+2uMbPfrXoFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFf/2Q=="
      }
    },
    {
      "request_control_key": "b3a428fd-58ee-4d6f-8872-633874ebf5e2",
      "bank_slip_key": "4056f1f1-a6ea-4162-8bac-b1ce2546a9bf",
      "bank_slip_status": "accepted",
      "our_number": 987654321,
      "barcode": "",
      "digitable_line":
    }
  ]
}
```

STATUS 4xx

### Response Body Params

| Campo                      | Tipo    | Descrição                                                                          | Caracteres |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------|
| `bank_slips`               | Array de **[Objeto bank_slip_response](#objeto-bank_slip_response)** | Descontos                                                                          | - |

### Objeto bank_slip_response

| Campo                   | Tipo   | Descrição                                                                         | Caracteres |
|-------------------------|--------|-----------------------------------------------------------------------------------|------------|
| `request_control_key` * | uuidv4 | Chave única de identificação da request utilizada pelo cliente no formato uuid v4 | 36         |
| `bank_slip_key` *       | uuidv4 | Chave única de identificação do boleto no formato uuid v4                         | 36         |
| `bank_slip_status` *    | string | Status do boleto       | **[Enumeradores bank_slip_status](#enumeradores-bank_slip_status)**   |
| `our_number` *          | integer| Número único de identificação do boleto junto à carteira                          | 11         |
| `barcode` *             | string | Código de barras do boleto                                                        | 44         |
| `digitable_line` *      | string | Linha digitável do boleto                                                         | 47         |
| `qr_code_data`          | object | Dados do QR Code                             | **[Objeto qr_code_data](#objeto-qr_code_data)** |
| `created_at` *          | string | Data, no formato ISO (UTC - "YYYY-MM-DDTHH:MM:SSZ"), da criação da ocorrência     | 20         |

### Enumeradores bank_slip_status

| Enumerador         | Descrição                               |
|--------------------|-----------------------------------------|
| accepted           | Boleto aceito mas ainda não registrado  |

### Objeto qr_code_data
| Campo                      | Tipo   | Descrição                                             | Caracteres              |
|----------------------------|--------|-------------------------------------------------------|-------------------------|
| `qr_code_key`              | uuidv4 | Chave única de identificação do QR Code               | 36                      |
| `pix_key`                  | uuidv4 | Chave PIX vinculada ao QR Code                        | 36                      |
| `receiver_conciliation_id` | uuidv4 | Identificador de conciliação do QR Code               | 36                      |
| `url`                      | string | URL (Pix Copia e Cola) do QR Code                     | -                       |
| `image`                    | string | base64 da URL (Pix Copia e Cola) do QR Code           | -                       |

## Error Response

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| Código HTTP<br/>`status` | Código QI<br/>`code` | Título<br/>`title`                                 | Descrição (eng)<br/>`description`                                                                                       | Descrição (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000004            | Not Found | Pix key not found: `{pix_key}`                                               | Chave pix não encontrada: `{pix_key}`                                               |
| 403                      | BKS000005            | Forbidden                         | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 403                      | BKS000010            | Forbidden                                 | The pix key owner does not match the account owner.                                                                                     | O proprietário da chave pix não corresponde ao proprietário da conta.                                                             |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 409                      | BKS000014            | Conflict           | Request control key already sent or duplicated sent: `{request_control_key}`                                                              | Chave de controle da requisição já utilizada ou enviada duplicada: `{request_control_key}`                                                                        |
| 400                      | BKS000016            | Bad Request                                        | Expiration date must be greater than the current date and have a maximum of 3650 days from the current date.                                    | A data de vencimento deve ser maior que a data atual e possuir no máximo 3650 dias corridos a partir da data atual.                                     |
| 409                      | BKS000017            | Conflict                                        | Our number already used or duplicated sent: `{our_number}`                                                                                       | Nosso número já utilizado ou enviado duplicado: `{our_number}`                                                                               |
| 400                      | BKS000018            | Bad Request                                        | The discount dates must be less than the expiration date and increasing.                                                      | A data dos descontos devem ser menores que a de expiração e crescentes.                                               |
| 400                      | BKS000019            | Bad Request                                        | Payer address is required for protest.                                                                                       | Endereço do pagador é obrigatório para protesto.                                                                         |
| 500                      | BKS000021            | Internal Server Error                                  | Error while trying to generate QR Code.                                                               | Erro ao tentar gerar QR Code de pagamento.                                                           |
| 400                      | BKS000022            | Bad Request                                        | Requester profile is not opened.                                                              | Carteira não está aberta.                          |
| 400                      | BKS000026            | Bad Request                      | Guarantor address is required for protest.                                                                                        | Endereço do sacador é obrigatório para protesto.                                                                   |
| 404                      | BKS000028            | Not Found             | Notary office attended region not found for postal code: `{postal_code}`                                                          | Região de cartório não encontrada para o CEP: `{postal_code}`                                                                                 |
| 400                      | BKS000043            | Bad Request             | Invalid discount numbering. Discounts must be numbered in ascending order and start on 1.          | Numeração dos descontos inválida. Os descontos devem ser numerados em ordem crescente e começar em 1.                                                           |
| 400                      | BKS000045            | Bad Request                                        | Rebate amount can not be equal or greater than the bank slip amount.                                                              | O valor do rebate não pode ser igual ou maior do que o valor do boleto.                          |
| 400                      | BKS000047            | Bad Request             | It was not possible to consult the sent pix key at this time. Please try again in a few minutes.          | Não foi possível consultar a chave pix enviada no momento. Por favor, tente novamente em alguns minutos.                                                           |
| 400                      | BKS000125            | Bad Request             | Partial payment data is required for this bank slip species type.          | Os dados de pagamento parcial são obrigatórios para o tipo de boleto fornecido.                                                           |
| 400                      | BKS000128            | Bad Request             | QR code payment is not allowed for partial payment.          | Pagamento via QR code não é permitido para pagamento parcial.                                                           |
| 400                      | BKS000128            | Bad Request             | QR code payment is not allowed for partial payment.          | Pagamento via QR code não é permitido para pagamento parcial.                                                           |
| 400                      | BKS000131            | Bad Request             | Rebate amount is not allowed for this bank slip species type.          | O valor de abatimento não é permitido para o tipo de boleto fornecido.                                                           |
| 400                      | BKS000132            | Bad Request             | Discount data is not allowed for this bank slip species type.          | Os dados de desconto não são permitidos para o tipo de boleto fornecido.                                                           |
| 400                      | BKS000133            | Bad Request             | Fine data is not allowed for this bank slip species type.          | Os dados de multa não são permitidos para o tipo de boleto fornecido.                                                           |
| 400                      | BKS000134            | Bad Request             | Interest data is not allowed for this bank slip species type.          | Os dados de juros não são permitidos para o tipo de boleto fornecido.                                                           |
| 400                      | BKS000136            | Bad Request             | Only credit card financial instrument type can have zero amount.          | Apenas o tipo de instrumento financeiro cartão de crédito pode ter valor zero.                                                           |

---

# Rebate cancellation

URL: /en/documentation/boletos/instrucoes/abatimento/cancelar_abatimento

Canceling a rebate means canceling the existing rebate for the bank slip. The cancellation must be performed if there is interest in removing the rebate or creating a new one.

:::caution Attention!
If there is any pending rebate cancellation request awaiting confirmation, or there is no active rebate, it is not possible to request the cancellation of a rebate.

Note: the rebate amount (`rebate_amount`) sent in the bank slip registration counts as an active rebate (if it is greater than R$0.00).
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip/ BANK_SLIP_KEY /cancel_rebate
METHOD POST

### Path parameters

| Field                   | Type   | Description                                                  | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format        | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key, in uuid v4 format         | 36         |
| `bank_slip_key`         | uuidv4 | Unique bank slip identification key, in uuid v4 format      | 36         |

Request Body

```json
{
  "request_control_key": "86864aec-a6c8-462e-8460-b05ef5a1eb62"
}
```

### Request Body Params

| Field                      | Type    | Description                                                                        | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|------------|
| `request_control_key` *    | uuidv4  | Unique request identification key used by the client in uuid v4 format            | 36         |

## Response

STATUS 202

Response Body

```json
{
  "occurrence_key": "539cefc8-382e-4fef-80e1-978a3a178a5c",
  "bank_slip_key": "d402e91a-32ac-4428-8357-d71824b113b5"
}
```

### Response Body Params

| Field              | Type   | Description                                                                       | Characters |
|--------------------|--------|-----------------------------------------------------------------------------------|------------|
| `occurrence_key` * | uuidv4 | Unique occurrence (instruction) identification key in uuid v4 format             | 36         |
| `bank_slip_key` *  | uuidv4 | Unique bank slip identification key in uuid v4 format                            | 36         |

### Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 409                      | BKS000014            | Conflict | Request control key already sent or duplicated sent: `<request_control_key>` | Chave de controle da requisição já utilizada ou enviada duplicada: `<request_control_key>` |
| 400                      | BKS000022            | Bad Request                                        | Requester profile is not opened.                                                              | Carteira não está aberta.                          |
| 404                      | BKS000029            | Not Found                                        | Bank slip not found for the given key (`{bank_slip_key}`).                                                              | Boleto não encontrado para a chave fornecida (`{bank_slip_key}`).                          |
| 400                      | BKS000031            | Bad Request                                        | Bank slip must have an active rebate.                                                              | O boleto deve possuir um rebate ativo.                          |
| 400                      | BKS000032            | Bad Request                                        | Bank slip must be in 'registered' status.                                                              | O boleto deve possuir o status 'registered'.                          |
| 409                      | BKS000034            | Bad Request                                        | There is already a pending cancel rebate occurrence for this bank slip.                                                              | Já existe uma ocorrência de cancelamento de rebate pendente para este boleto.                          |

---

# Create Rebate

URL: /en/documentation/boletos/instrucoes/abatimento/criar_abatimento

Creating a rebate for the bank slip means reducing part of the base value of the title to decrease the final amount.

:::caution Attention!
If there is any pending rebate request waiting for confirmation, or any active rebate, creating a new rebate is not allowed. If there is an active rebate and you want to change it, a rebate cancellation request must be sent first. Once it is confirmed, it is possible to create another rebate.

Note: the rebate amount (`rebate_amount`) sent in the bank slip registration does not count as a pending rebate request, but counts as an active rebate request.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip/ BANK_SLIP_KEY /rebate
METHOD POST

### Path parameters

| Field                   | Type   | Description                                                  | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format        | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key, in uuid v4 format         | 36         |
| `bank_slip_key`         | uuidv4 | Unique bank slip identification key, in uuid v4 format      | 36         |

Request Body

```json
{
  "request_control_key": "d66b807a-25fa-4e21-b198-9beb221a29ce",
  "rebate_amount": 150.00
}
```

### Request Body Params

| Field                     | Type    | Description                                                                        | Characters |
|---------------------------|---------|------------------------------------------------------------------------------------|------------|
| `request_control_key` *   | uuidv4  | Unique request identification key used by the client in uuid v4 format            | 36         |
| `rebate_amount` *         | float   | Absolute rebate amount                                                             | -          |

## Response

STATUS 202

Response Body

```json
{
  "occurrence_key": "7f01165b-fdd0-4f59-b231-42170ea90131",
  "bank_slip_key": "dad779c1-5e1c-422e-9f36-c704916a87cf"
}
```

### Response Body Params

| Field             | Type   | Description                                                                       | Characters |
|-------------------|--------|-----------------------------------------------------------------------------------|------------|
| `occurrence_key` *| uuidv4 | Unique occurrence (instruction) identification key in uuid v4 format             | 36         |
| `bank_slip_key` * | uuidv4 | Unique bank slip identification key in uuid v4 format                            | 36         |

### Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 409                      | BKS000014            | Conflict | Request control key already sent or duplicated sent: `<request_control_key>` | Chave de controle da requisição já utilizada ou enviada duplicada: `<request_control_key>` |
| 400                      | BKS000022            | Bad Request                                        | Requester profile is not opened.                                                              | Carteira não está aberta.                          |
| 404                      | BKS000029            | Not Found                                        | Bank slip not found for the given key (`{bank_slip_key}`).                                                              | Boleto não encontrado para a chave fornecida (`{bank_slip_key}`).                          |
| 409                      | BKS000030            | Conflict                                        | There is already a pending rebate occurrence for this bank slip.                                                              | Já existe uma ocorrência de rebate pendente para este boleto.                          |
| 400                      | BKS000032            | Bad Request                                        | Bank slip must be in 'registered' status.                                                              | O boleto deve possuir o status 'registered'.                          |
| 409                      | BKS000033            | Conflict                                        | This bank slip already has an active rebate. You must send a 'cancel_rebate' occurrence before trying to create another one. one.                                                              | Este boleto já possui um rebate ativo. Você deve mandar uma ocorrência do tipo 'cancel_rebate' antes de tentar criar outro.                          |
| 400                      | BKS000045            | Bad Request                                        | Rebate amount can not be equal or greater than the bank slip amount.                                                              | O valor do rebate não pode ser igual ou maior do que o valor do boleto.                          |

---

# Write-off

URL: /en/documentation/boletos/instrucoes/baixa

When a bank slip is written off, it becomes unavailable for payment. In other words, the bank slip is "canceled".

:::caution Attention!
If there is any write-off request pending confirmation, creating a new request is not allowed.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip/ BANK_SLIP_KEY /write_off
METHOD POST

### Path parameters

| Field                   | Type   | Description                                                    | Characters |
|-------------------------|--------|----------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format          | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key, in uuid v4 format           | 36         |
| `bank_slip_key`         | uuidv4 | Unique bank slip identification key, in uuid v4 format        | 36         |

Request Body

```json
{
  "request_control_key": "614a451d-3b82-460e-bcc0-2caf3dde711f"
}
```

### Request Body Params

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|--------------------------------------------------------------------------------------|------------|
| `request_control_key` *    | uuidv4  | Unique request identification key used by the client in uuid v4 format              | 36         |

## Response

STATUS 202

Response Body

```json
{
  "occurrence_key": "2552bd64-950b-437e-a53a-a133ffea03d7",
  "bank_slip_key": "960f78d4-4426-4762-98da-3ce3713ae0a5"
}
```

### Response Body Params

| Field              | Type   | Description                                                                         | Characters |
|--------------------|--------|-------------------------------------------------------------------------------------|------------|
| `occurrence_key` * | uuidv4 | Unique occurrence (instruction) identification key in uuid v4 format               | 36         |
| `bank_slip_key` *  | uuidv4 | Unique bank slip identification key in uuid v4 format                              | 36         |

### Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 409                      | BKS000014            | Conflict | Request control key already sent or duplicated sent: `<request_control_key>` | Chave de controle da requisição já utilizada ou enviada duplicada: `<request_control_key>` |
| 400                      | BKS000022            | Bad Request                                        | Requester profile is not opened.                                                              | Carteira não está aberta.                          |
| 404                      | BKS000029            | Not Found                                        | Bank slip not found for the given key (`{bank_slip_key}`).                                                              | Boleto não encontrado para a chave fornecida (`{bank_slip_key}`).                          |
| 400                      | BKS000032            | Bad Request                                        | Bank slip must be in 'registered' status.                                                              | O boleto deve possuir o status 'registered'.                          |
| 409                      | BKS000049            | Conflict                                        | There is already a pending write off occurrence for this bank slip. Please, wait for the confirmation of this occurrence before sending another one. one.                                                              | Já existe uma ocorrência de baixa pendente para este boleto. Por favor, aguarde a confirmação dessa ocorrência antes de enviar outra.                          |

---

# Discount

URL: /en/documentation/boletos/instrucoes/desconto

The discount instruction is used to apply discounts with various calculation rule possibilities. If discounts already exist for the bank slip in question, and a discount instruction is accepted, the previously existing discounts will be overwritten.

:::caution Attention!
If there is any pending discount addition request awaiting confirmation, creating a new request is not allowed.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip/ BANK_SLIP_KEY /discount
METHOD POST

### Path parameters

| Field                   | Type   | Description                                              | Characters |
|-------------------------|--------|----------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format    | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key, in uuid v4 format     | 36         |
| `bank_slip_key`         | uuidv4 | Unique bank slip identification key, in uuid v4 format  | 36         |

Request Body

```json
{
    "request_control_key": "2e2f0053-a988-40c7-ad17-41c4c4da861e",
    "discounts_data": [
        {
            "discount_type": "anticipation_workdays_daily_percentage",
            "discount_percentage": 2,
            "discount_number": 1,
            "discount_limit_date": "2024-12-01"
        },
        {
            "discount_type": "anticipation_workdays_daily_percentage",
            "discount_percentage": 1,
            "discount_number": 2,
            "discount_limit_date": "2025-01-02"
        }
    ]
}
```

### Request Body Params

| Field                      | Type    | Description                                                                        | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|------------|
| `request_control_key` *    | uuidv4  | Unique request identification key used by the client in uuid v4 format            | 36         |
| `discounts_data`           | object array | Discounts                                  | **[discount object](#discount-object)** |

### discount object

Option 1: discounts using absolute values (`discount_type in ["absolute", "anticipation_calendar_days_daily_amount", "anticipation_workdays_daily_amount"]`)

| Field                     | Type    | Description                                         | Characters                                                |
|---------------------------|---------|-----------------------------------------------------|-----------------------------------------------------------|
| `discount_amount` *       | float   | Absolute discount value per time unit              | -                                                         |
| `discount_number` *       | integer | Discount number                                     | -                                                         |
| `discount_type` *         | string  | Discount configuration in absolute values           | **[discount_type enumerator](#discount_type-enumerators)** |
| `discount_limit_date` *   | string  | Discount application limit date                     | 10                                                        |

Option 2: discounts using percentage values (`discount_type in ["percentage", "anticipation_calendar_days_daily_percentage", "anticipation_workdays_daily_percentage"]`)

| Field                     | Type    | Description                                         | Characters                                                |
|---------------------------|---------|-----------------------------------------------------|-----------------------------------------------------------|
| `discount_percentage` *   | float   | Percentage discount value per time unit             | -                                                         |
| `discount_number` *       | integer | Discount number                                     | -                                                         |
| `discount_type` *         | string  | Discount configuration in percentage values         | **[discount_type enumerator](#discount_type-enumerators)** |
| `discount_limit_date` *   | string  | Discount application limit date                     | 10                                                        |

:::caution Attention!
The bank slip can have up to three discounts, and all discounts must be of the same type , that is, they must have the same `discount_type`. Discounts must be numbered from 1 to 3, in ascending order and necessarily starting at 1. That is, if two discounts are sent in the request, they must necessarily be numbered 1 and 2.
:::

### discount_type enumerators

| Enumerator                                  | Description                                                          |
|---------------------------------------------|----------------------------------------------------------------------|
| absolute                                    | Fixed value                                                          |
| anticipation_calendar_days_daily_amount     | Daily anticipation discount amount, over calendar days               |
| anticipation_workdays_daily_amount          | Daily anticipation discount amount, over business days               |
| percentage                                  | Fixed percentage                                                     |
| anticipation_calendar_days_daily_percentage | Monthly anticipation discount percentage, based on calendar days     |
| anticipation_workdays_daily_percentage      | Annual anticipation discount percentage, based on business days      |

## Response

STATUS 202

Response Body

```json
{
  "occurrence_key": "aaf64135-6bd8-4d49-be6f-e8f884b20ee7",
  "bank_slip_key": "470cfcae-159b-4de4-ad22-2d3b2dd717f7"
}
```

### Response Body Params

| Field              | Type   | Description                                                               | Characters |
|--------------------|--------|---------------------------------------------------------------------------|------------|
| `occurrence_key` * | uuidv4 | Unique occurrence (instruction) identification key in uuid v4 format     | 36         |
| `bank_slip_key` *  | uuidv4 | Unique bank slip identification key in uuid v4 format                    | 36         |

### Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 409                      | BKS000014            | Conflict | Request control key already sent or duplicated sent: `<request_control_key>` | Chave de controle da requisição já utilizada ou enviada duplicada: `<request_control_key>` |
| 400                      | BKS000018            | Bad Request                                        | The discount dates must be less than the expiration date and increasing.                                                              | A data dos descontos devem ser menores que a de expiração e crescentes.                         |
| 400                      | BKS000022            | Bad Request                                        | Requester profile is not opened.                                                              | Carteira não está aberta.                          |
| 404                      | BKS000029            | Not Found                                        | Bank slip not found for the given key (`{bank_slip_key}`).                                                              | Boleto não encontrado para a chave fornecida (`{bank_slip_key}`).                          |
| 400                      | BKS000032            | Bad Request                                        | Bank slip must be in 'registered' status.                                                              | O boleto deve possuir o status 'registered'.                          |
| 400                      | BKS000043            | Bad Request                                        | Invalid discount numbering. Discounts must be numbered in ascending order and start on 1.                                                              | Numeração dos descontos inválida. Os descontos devem ser numerados em ordem crescente e começar em 1.                          |
| 400                      | BKS000046            | Bad Request                                        | Invalid discount type. All types in the discount list must be the same.                                                              | Tipo de desconto inválido. Todos os tipos da lista de descontos devem ser iguais.                          |
| 409                      | BKS000048            | Conflict                                        | There is already a pending discount occurrence for this bank slip. Please, wait for the confirmation of this occurrence before sending another one.                                                              | Já existe uma ocorrência de desconto pendente para este boleto. Por favor, aguarde a confirmação dessa ocorrência antes de enviar outra.                          |

---

# Edit

URL: /en/documentation/boletos/instrucoes/edicao

The edit instruction serves to modify configurable data of the bank slip after its issuance, such as automatic write-off settings, protest, bankruptcy protest, and payer data. This instruction allows updating multiple aspects of the bank slip in a single request.

:::caution Attention!
The bank slip must be in 'registered' status for it to be editable. At least one of the data fields (`write_off_data`, `protest_data`, `bankruptcy_protest_data` or `payer_data`) must be provided along with the `request_control_key`.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip/ BANK_SLIP_KEY /bank_slip_edit
METHOD POST

### Path parameters

| Field                   | Type   | Description                                                   | Characters |
|-------------------------|--------|---------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format         | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key, in uuid v4 format          | 36         |
| `bank_slip_key`         | uuidv4 | Unique bank slip identification key, in uuid v4 format       | 36         |

Request Body

```json
{
  "request_control_key": "c4dd443a-6e2f-4261-8f28-adfa4c0d4c5b",
  "write_off_data": {"days_to_write_off": 365},
  "protest_data": {"days_to_protest": 7},
  "bankruptcy_protest_data": {"days_to_bankruptcy_protest": 14},
  "payer_data": {
    "contact": {
      "email": "finance@globaltech.com",
      "phone": {"international_dial_code": "055", "area_code": "11", "number": "987654321"},
    },
    "address": {
      "street": "101 High St.",
      "neighborhood": "Tech Park",
      "number": "202",
      "postal_code": "01001000",
      "city": "Innovation City",
      "state": "SP",
      "complement": "Building A",
    },
  },
}
```

### Request Body Params

| Field                      | Type    | Description                                                                        | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|------------|
| `request_control_key` *    | uuidv4  | Unique request identification key used by the client in uuid v4 format            | 36         |
| `write_off_data`           | object  | Automatic write-off settings (null to remove)                                     | **[write_off_data Object](#write_off_data-object)** |
| `protest_data`             | object  | Protest settings (null to remove)                                                 | **[protest_data Object](#protest_data-object)** |
| `bankruptcy_protest_data`  | object  | Bankruptcy protest settings (null to remove)                                      | **[bankruptcy_protest_data Object](#bankruptcy_protest_data-object)** |
| `payer_data`               | object  | Payer data (`address` null or `contact` null to remove)                          | **[payer_data Object](#payer_data-object)** |

:::info Note
At least one of the data fields (`write_off_data`, `protest_data`, `bankruptcy_protest_data` or `payer_data`) must be provided in the request.
:::

### write_off_data Object

| Field                     | Type    | Description                                                                     | Characters |
|---------------------------|---------|---------------------------------------------------------------------------------|------------|
| `days_to_write_off` *     | integer | Days, after due date, for the bank slip to be automatically written off       | -          |

### protest_data Object

| Field                     | Type    | Description                                                                     | Characters |
|---------------------------|---------|---------------------------------------------------------------------------------|------------|
| `days_to_protest` *       | integer | Days, after due date, for the bank slip to be automatically protested         | -          |

### bankruptcy_protest_data Object

| Field                          | Type    | Description                                                                     | Characters  |
|--------------------------------|---------|---------------------------------------------------------------------------------|-------------|
| `days_to_bankruptcy_protest` * | integer | Days, after due date, for the bank slip to be automatically protested         | -           |

### payer_data Object

| Field                     | Type   | Description                                                    | Characters|
|---------------------------|--------|----------------------------------------------------------------|-----------|
| `contact`                 | object | Contact information                                            | **[contact Object](#contact-object)**                     |
| `address`                 | object | Address                                                        | **[address Object](#address-object)**                     |

### contact Object

| Field                     | Type   | Description                       | Characters                         |
|---------------------------|--------|-----------------------------------|------------------------------------|
| `email`                   | string | Contact email                     | 320                                |
| `phone`                   | object | Contact phone                     | **[phone Object](#phone-object)**  |

### phone Object

| Field                           | Type   | Description                                      | Characters |
|---------------------------------|--------|--------------------------------------------------|------------|
| `international_dial_code` *     | string | International Direct Dialing Code               | 3          |
| `area_code` *                   | string | Area Code                                        | 2          |
| `number` *                      | string | Number                                           | 9          |

### address Object

| Field                     | Type   | Description                                      | Characters |
|---------------------------|--------|--------------------------------------------------|------------|
| `street` *                | string | Street                                           | 500        |
| `number` *                | string | Number                                           | 6          |
| `complement`              | string | Complement                                       | 500        |
| `neighborhood` *          | string | Neighborhood                                     | 100        |
| `postal_code` *           | string | Postal Code                                      | 8          |
| `city` *                  | string | City                                             | 100        |
| `state` *                 | string | State | **[state Enumerator](#state-enumerators)** |

### state Enumerators

| Enumerator         | Description           |
|--------------------|-----------------------|
| AC                 | Acre                  |
| AL                 | Alagoas               |
| AM                 | Amazonas              |
| AP                 | Amapá                 |
| BA                 | Bahia                 |
| CE                 | Ceará                 |
| DF                 | Distrito federal      |
| ES                 | Espírito Santo        |
| GO                 | Goiás                 |
| MA                 | Maranhão              |
| MG                 | Minas Gerais          |
| MS                 | Mato Grosso do Sul    |
| MT                 | Mato Grosso           |
| PA                 | Pará                  |
| PB                 | Paraíba               |
| PE                 | Pernambuco            |
| PI                 | Piauí                 |
| PR                 | Paraná                |
| RJ                 | Rio de Janeiro        |
| RN                 | Rio Grande do Norte   |
| RO                 | Rondônia              |
| RR                 | Roraima               |
| RS                 | Rio Grande do Sul     |
| SC                 | Santa Catarina        |
| SE                 | Sergipe               |
| SP                 | São Paulo             |
| TO                 | Tocantins             |
| EX                 | Exception             |

## Response

STATUS 200

Response Body

```json
{
  "occurrence_key": "5a745b65-9a2c-44eb-b43e-c80ef5429d94",
  "bank_slip_key": "fdafdffa-cbd4-4f3c-8e3d-990428305161"
}
```

### Response Body Params

| Field              | Type   | Description                                                                       | Characters |
|--------------------|--------|-----------------------------------------------------------------------------------|------------|
| `occurrence_key` * | uuidv4 | Unique occurrence (instruction) identification key in uuid v4 format             | 36         |
| `bank_slip_key` *  | uuidv4 | Unique bank slip identification key in uuid v4 format                            | 36         |

### Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                  | Description (eng)<br/>`description`                                                                                     | Description (pt-br)<br/>`translation`                                                                                     |
|------------------------|--------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                    | QIT000001          | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                    | BKS000006          | Not Found                                          | The source account key was not found.                                                                                  | A chave da conta de origem não foi encontrada.                                                                           |
| 400                    | BKS000007          | Bad Request                                        | It was not possible to consult the source account at this time. Please try again in a few minutes.                     | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                |
| 400                    | BKS000008          | Bad Request                                        | The source account is closed.                                                                                          | A conta de origem está fechada.                                                                                         |
| 400                    | BKS000009          | Bad Request                                        | The source account is blocked.                                                                                         | A conta de origem está bloqueada.                                                                                       |
| 404                    | BKS000013          | Not Found                                          | Requester profile not found                                                                                            | Carteira não encontrada                                                                                                 |
| 409                    | BKS000014          | Conflict                                           | Request control key already sent or duplicated sent: `<request_control_key>`                                           | Chave de controle da requisição já utilizada ou enviada duplicada: `<request_control_key>`                             |
| 400                    | BKS000022          | Bad Request                                        | Requester profile is not opened.                                                                                       | Carteira não está aberta.                                                                                              |
| 404                    | BKS000029          | Not Found                                          | Bank slip not found for the given key (`{bank_slip_key}`).                                                             | Boleto não encontrado para a chave fornecida (`{bank_slip_key}`).                                                      |
| 400                    | BKS000032          | Bad Request                                        | Bank slip must be in 'registered' status.                                                                              | O boleto deve possuir o status 'registered'.                                                                           |

---

# Extension

URL: /en/documentation/boletos/instrucoes/extensao

The extension request serves to extend the due date of the bank slip.

:::caution Attention!
If there is any extension request pending confirmation, creating a new request is not allowed.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip/ BANK_SLIP_KEY /extension
METHOD POST

### Path parameters

| Field                   | Type   | Description                                                  | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format        | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key, in uuid v4 format         | 36         |
| `bank_slip_key`         | uuidv4 | Unique bank slip identification key, in uuid v4 format      | 36         |

Request Body

```json
{
  "request_control_key": "2e2f0053-a988-40c7-ad17-41c4c4da861e",
  "new_expiration_date": "2025-01-01"
}
```

### Request Body Params

| Field                      | Type    | Description                                                                        | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|------------|
| `request_control_key` *    | uuidv4  | Unique request identification key used by the client in uuid v4 format            | 36         |
| `new_expiration_date` *    | string  | New expiration date, in "YYYY-MM-DD" format                                       | 10         |

## Response

STATUS 202

Response Body

```json
{
  "occurrence_key": "6f2eb385-898f-4fa3-96df-80a76a30ad01",
  "bank_slip_key": "0d462dda-7412-444f-ace9-375e4ab43c2f"
}
```

### Response Body Params

| Field              | Type   | Description                                                                       | Characters |
|--------------------|--------|-----------------------------------------------------------------------------------|------------|
| `occurrence_key` * | uuidv4 | Unique occurrence (instruction) identification key in uuid v4 format             | 36         |
| `bank_slip_key` *  | uuidv4 | Unique bank slip identification key in uuid v4 format                            | 36         |

### Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 409                      | BKS000014            | Conflict | Request control key already sent or duplicated sent: `<request_control_key>` | Chave de controle da requisição já utilizada ou enviada duplicada: `<request_control_key>` |
| 400                      | BKS000022            | Bad Request                                        | Requester profile is not opened.                                                              | Carteira não está aberta.                          |
| 404                      | BKS000029            | Not Found                                        | Bank slip not found for the given key (`{bank_slip_key}`).                                                              | Boleto não encontrado para a chave fornecida (`{bank_slip_key}`).                          |
| 400                      | BKS000032            | Bad Request                                        | Bank slip must be in 'registered' status.                                                              | O boleto deve possuir o status 'registered'.                          |
| 400                      | BKS000041            | Bad Request                                        | The new expiration date must be greater than the current expiration date.                                                              | A nova data de expiração deve ser posterior à data de expiração atual.                          |
| 409                      | BKS000042            | Conflict                                        | There is already a pending extension occurrence for this bank slip. Please, wait for the confirmation of this occurrence before sending another one.                                                              | Já existe uma ocorrência de extensão pendente para este boleto. Por favor, aguarde a confirmação dessa ocorrência antes de enviar outra.                          |

---

# Interest

URL: /en/documentation/boletos/instrucoes/juros

The interest instruction is used to configure the interest that will be applied if the bank slip is paid after the due date. If there is already an interest configuration for the bank slip in question, and an interest instruction is accepted, the previously existing configuration will be overwritten.

:::caution Attention!
If there is any pending interest instruction awaiting confirmation, sending a new instruction is not allowed.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip/ BANK_SLIP_KEY /interest
METHOD POST

### Path parameters

| Field                   | Type   | Description                                                    | Characters |
|-------------------------|--------|----------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key in uuid v4 format           | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key in uuid v4 format            | 36         |
| `bank_slip_key`         | uuidv4 | Unique bank slip identification key in uuid v4 format         | 36         |

Request Body

```json
{
  "request_control_key": "c4dd443a-6e2f-4261-8f28-adfa4c0d4c5b",
  "interest_data": {
    "interest_type": "calendar_days_daily_amount",
    "interest_amount": 50.00,
    "days_to_interest": 5
  }
}
```

### Request Body Params

| Field                      | Type    | Description                                                                       | Characters |
|----------------------------|---------|-----------------------------------------------------------------------------------|------------|
| `request_control_key` *    | uuidv4  | Unique request identification key used by the client in uuid v4 format           | 36         |
| `interest_data`            | object  | Interest configurations                      | **[interest_data Object](#interest_data-object)** |

### interest_data Object

Option 1: interest using absolute values (`interest_type=calendar_days_daily_amount` or `interest_type=workdays_daily_amount`)

| Field                     | Type    | Description                                                                       | Characters                                                                                      |
|---------------------------|---------|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| `interest_type` *         | string  | Interest type       | **[interest_type Enumerators](#interest_type-enumerators)** |
| `interest_amount` *       | float   | Amount to be charged per determined time unit (working days or calendar days)     | -                                                                                               |
| `days_to_interest` *      | integer | Days after due date for interest to start being charged                           | -                                                                                               |

Option 2: interest using percentage values (`interest_type=calendar_days_monthly_percentage`)

| Field                    | Type    | Description                                                                             | Characters                                                                                          |
|--------------------------|---------|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| `interest_type` *        | string  | Interest type       | **[interest_type Enumerators](#interest_type-enumerators)** |
| `interest_percentage` *  | integer | Percentage to be charged per determined time unit (working days or calendar days)      | -                                                                           |
| `days_to_interest` *     | integer | Days after due date for interest to start being charged                                | -                                                                                                   |

### interest_type Enumerators

| Enumerator                       | Description                                                      |
|----------------------------------|------------------------------------------------------------------|
| calendar_days_daily_amount       | Daily amount on calendar days                                    |
| workdays_daily_amount            | Daily amount on working days                                     |
| calendar_days_monthly_percentage | Monthly interest percentage charged based on calendar days       |

## Response

STATUS 202

Response Body

```json
{
  "occurrence_key": "5a745b65-9a2c-44eb-b43e-c80ef5429d94",
  "bank_slip_key": "fdafdffa-cbd4-4f3c-8e3d-990428305161"
}
```

### Response Body Params

| Field              | Type   | Description                                                                       | Characters |
|--------------------|--------|-----------------------------------------------------------------------------------|------------|
| `occurrence_key` * | uuidv4 | Unique occurrence (instruction) identification key in uuid v4 format             | 36         |
| `bank_slip_key` *  | uuidv4 | Unique bank slip identification key in uuid v4 format                            | 36         |

### Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Status<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 409                      | BKS000014            | Conflict | Request control key already sent or duplicated sent: `<request_control_key>` | Chave de controle da requisição já utilizada ou enviada duplicada: `<request_control_key>` |
| 400                      | BKS000018            | Bad Request                                        | The discount dates must be less than the expiration date and increasing.                                                              | A data dos descontos devem ser menores que a de expiração e crescentes.                         |
| 400                      | BKS000022            | Bad Request                                        | Requester profile is not opened.                                                              | Carteira não está aberta.                          |
| 404                      | BKS000029            | Not Found                                        | Bank slip not found for the given key (`{bank_slip_key}`).                                                              | Boleto não encontrado para a chave fornecida (`{bank_slip_key}`).                          |
| 400                      | BKS000032            | Bad Request                                        | Bank slip must be in 'registered' status.                                                              | O boleto deve possuir o status 'registered'.                          |
| 409                      | BKS000051            | Conflict                                        | There is already a pending interest occurrence for this bank slip. Please, wait for the confirmation of this occurrence before sending another one.                                                              | Já existe uma ocorrência de juros pendente para este boleto. Por favor, aguarde a confirmação dessa ocorrência antes de enviar outra.                          |

---

# Query instruction batch

URL: /en/documentation/boletos/instrucoes/lote/consultar_lote_de_instrucoes

Returns the detail of a previously created batch, with the list of generated occurrences and the individual status of each one, along with basic data of the related bank slip.

## Request

ENDPOINT /v2/bank_slip/account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /occurrence_batches/ BATCH_KEY /results
METHOD GET

### Path parameters

| Field                   | Type   | Description                                                | Characters |
|-------------------------|--------|------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format        | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key, in uuid v4 format         | 36         |
| `batch_key`             | uuidv4 | Batch key (returned by the create POST)                     | 36         |

## Response

STATUS 200

Response Body

```json
{
  "batch_key": "f2d3e1b9-4a5c-46e7-8f12-9a8b7c6d5e4f",
  "requester_profile_key": "8217da98-3e26-4ca5-8b86-698bfa50b0df",
  "occurrence_type": "extension",
  "occurrence_quantity": 2,
  "accepted_quantity": 2,
  "created_at": "2026-06-09T17:08:33Z",
  "items": [
    {
      "bank_slip_key": "960f78d4-4426-4762-98da-3ce3713ae0a5",
      "occurrence_key": "2552bd64-950b-437e-a53a-a133ffea03d7",
      "request_control_key": "c86d8902-a5ae-4d1f-8872-e6fea1268aab",
      "occurrence_type": "extension",
      "payer_name": "Global Tech",
      "payer_document": "12345678000195",
      "amount": 5000.00,
      "our_number": "123456789",
      "requester_occurrence_status": "accepted",
      "registration_institution_occurrence_status": "submitted",
      "created_at": "2026-06-09T17:08:33Z"
    }
  ]
}
```

### Response Body Params

| Field                     | Type    | Description                                                                              |
|---------------------------|---------|------------------------------------------------------------------------------------------|
| `batch_key` *             | uuidv4  | Batch key                                                                                |
| `requester_profile_key` * | uuidv4  | Key of the wallet that owns the batch                                                    |
| `occurrence_type` *       | string  | Instruction type of the batch                                                            |
| `occurrence_quantity` *   | integer | Total number of items sent in the batch                                                  |
| `accepted_quantity` *     | integer | Number of items accepted in the batch                                                    |
| `created_at` *            | string  | UTC creation date/time of the batch (ISO 8601 with `Z` suffix)                           |
| `items` *                 | array   | List of occurrences generated by the batch. See **[item object](#item-object)**          |

### item object

| Field                                          | Type    | Description                                                                              |
|------------------------------------------------|---------|------------------------------------------------------------------------------------------|
| `bank_slip_key` *                              | uuidv4  | Bank slip key of the occurrence                                                          |
| `occurrence_key` *                             | uuidv4  | Unique key of the created occurrence                                                     |
| `request_control_key` *                        | string  | Item's client-provided control key                                                       |
| `occurrence_type` *                            | string  | Instruction type                                                                         |
| `payer_name`                                   | string  | Bank slip payer name                                                                     |
| `payer_document`                               | string  | Payer document                                                                           |
| `amount`                                       | float   | Bank slip base amount                                                                    |
| `our_number`                                   | string  | Bank slip "our number"                                                                   |
| `requester_occurrence_status`                  | string  | Occurrence status from the requester's perspective (e.g. `accepted`, `rejected`)         |
| `registration_institution_occurrence_status`   | string  | Occurrence status at the registration institution (e.g. `submitted`, `confirmed`)        |
| `created_at` *                                 | string  | UTC creation date/time of the occurrence (ISO 8601 with `Z` suffix)                      |

### Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "title",
  "description": "description in English",
  "translation": "descrição em português",
  "code": "code",
  "extra_fields": {}
}
```

| HTTP code<br/>`status` | QI code<br/>`code` | Title<br/>`title` | Description (eng)<br/>`description`                              | Description (pt-br)<br/>`translation`                              |
|------------------------|--------------------|--------------------|------------------------------------------------------------------|--------------------------------------------------------------------|
| 404                    | BKS000013          | Not Found          | Requester profile not found                                      | Carteira não encontrada                                            |

:::caution Attention!
When the `batch_key` does not exist or does not belong to the informed `requester_profile_key`, the API returns the same `BKS000013` ("Requester profile not found"). Check whether the `batch_key` was created under the wallet used in the query.
:::

---

# Create instruction batch

URL: /en/documentation/boletos/instrucoes/lote/criar_lote_de_instrucoes

Allows sending, in a single request, multiple instructions of the same type (write-off, rebate, extension, protest, etc.) over distinct bank slips. QI Tech validates the whole batch and either accepts every item or processes none.

- If **any** item fails semantic validation, **no** items in the batch are processed. The error response details, per rejected item, the reason for rejection.
- If every item passes, the occurrences are created and processed individually, asynchronously. The requester is notified via [**webhook**](/documentation/boletos/v2/webhooks/boleto) as each occurrence changes status.

:::info Idempotency
The batch-level `request_control_key` guarantees idempotency: resending the same key returns the batch already created, without duplication.

Each item also has its own `request_control_key` and is individually idempotent. Resending an item with a `request_control_key` already used makes the entire batch be rejected.
:::

:::caution Attention!
This operation is only available for wallets registered with the **QI SCD** registration institution.
:::

## Request

ENDPOINT /v2/bank_slip/account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /occurrence_batches
METHOD POST

### Path parameters

| Field                   | Type   | Description                                                | Characters |
|-------------------------|--------|------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format        | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key, in uuid v4 format         | 36         |

Request Body

```json
{
  "request_control_key": "614a451d-3b82-460e-bcc0-2caf3dde711f",
  "occurrence_type": "extension",
  "items": [
    {
      "bank_slip_key": "960f78d4-4426-4762-98da-3ce3713ae0a5",
      "request_control_key": "c86d8902-a5ae-4d1f-8872-e6fea1268aab",
      "new_due_date": "2026-08-15"
    },
    {
      "bank_slip_key": "5e3a1b2c-7d9f-4e88-9012-3a4b5c6d7e8f",
      "request_control_key": "b3a428fd-58ee-4d6f-8872-633874ebf5e2",
      "new_due_date": "2026-08-20"
    }
  ]
}
```

### Request Body Params

| Field                   | Type                                          | Description                                                                       | Characters |
|-------------------------|-----------------------------------------------|-----------------------------------------------------------------------------------|------------|
| `request_control_key` * | string                                        | Unique batch key, defined by the client. Ensures batch idempotency                 | 1–64       |
| `occurrence_type` *     | string                                        | Instruction type applied to every item. See **[occurrence_type enumerators](#occurrence_type-enumerators)** | -          |
| `items` *               | Array of **[item object](#item-object)**      | List of instructions (minimum 1, maximum 10000)                                    | -          |

### occurrence_type enumerators

| Enumerator               | Description                                                       |
|--------------------------|-------------------------------------------------------------------|
| `extension`              | Due-date extension — requires `new_due_date` on each item          |
| `rebate`                 | Apply rebate — requires `rebate_amount` on each item               |
| `cancel_rebate`          | Cancel a previously applied rebate                                 |
| `write_off`              | Write off the bank slip                                            |
| `protest_request`        | Protest request                                                    |
| `protest_cancel_request` | Withdraw a pending protest request                                 |
| `protest_remove_request` | Remove (cancel) a registered protest                               |

### item object

| Field                   | Type     | Description                                                                       | Characters |
|-------------------------|----------|-----------------------------------------------------------------------------------|------------|
| `bank_slip_key` *       | uuidv4   | Key of the bank slip the instruction will be applied to                            | 36         |
| `request_control_key` * | string   | Unique item key, defined by the client. Ensures per-item idempotency               | 1–64       |
| `new_due_date`          | string   | New due date (`YYYY-MM-DD`). Required when `occurrence_type=extension`             | 10         |
| `rebate_amount`         | float    | Rebate amount. Required when `occurrence_type=rebate`                              | -          |

## Response

STATUS 201

Response Body

```json
{
  "batch_key": "f2d3e1b9-4a5c-46e7-8f12-9a8b7c6d5e4f",
  "occurrence_quantity": 2,
  "accepted_quantity": 2,
  "semantic_errors": []
}
```

### Response Body Params

| Field                   | Type    | Description                                                                                 | Characters |
|-------------------------|---------|---------------------------------------------------------------------------------------------|------------|
| `batch_key` *           | uuidv4  | Unique batch key. Use it to query the batch detail                                          | 36         |
| `occurrence_quantity` * | integer | Total number of items sent in the batch                                                     | -          |
| `accepted_quantity` *   | integer | Number of items accepted in the batch                                                       | -          |
| `semantic_errors` *     | array   | Empty array on success. On semantic rejection, see **[Error Response](#error-response)**    | -          |

### Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "title",
  "description": "description in English",
  "translation": "descrição em português",
  "code": "code",
  "extra_fields": {}
}
```

On semantic rejection (`BLP000112`), the `reasons` field of the response details every rejected item:

Response Body: Semantic rejection

```json
{
  "title": "Unprocessable Entity",
  "description": "Rejected Remittance",
  "translation": "Remessa Rejeitada",
  "code": "BLP000112",
  "reasons": [
    {
      "occurrence_sequence": "0",
      "bank_slip_key": "960f78d4-4426-4762-98da-3ce3713ae0a5",
      "request_control_key": "c86d8902-a5ae-4d1f-8872-e6fea1268aab",
      "errors": [
        {
          "reason_code": "15",
          "translation_pt_br": "Boleto não encontrado",
          "translation_en_us": "Bank slip not found",
          "created_at": "2026-06-09T17:08:33"
        }
      ]
    }
  ]
}
```

### `reasons[]` object fields

| Field                       | Type    | Description                                                                          |
|-----------------------------|---------|--------------------------------------------------------------------------------------|
| `occurrence_sequence` *     | string  | Item position in the request's `items` array (starting at `"0"`)                     |
| `bank_slip_key` *           | uuidv4  | Bank slip key of the rejected item                                                   |
| `request_control_key` *     | string  | Item's client-provided control key                                                   |
| `errors` *                  | array   | List of rejection reasons (an item may have multiple)                                |
| `errors[].reason_code` *    | string  | Rejection reason code (Febraban standard)                                            |
| `errors[].translation_pt_br`| string  | Portuguese description of the reason                                                 |
| `errors[].translation_en_us`| string  | English description of the reason                                                    |
| `errors[].created_at`       | string  | Catalog registration date of the reason                                              |

### Error codes

| HTTP code<br/>`status` | QI code<br/>`code` | Title<br/>`title`    | Description (eng)<br/>`description`                                                         | Description (pt-br)<br/>`translation`                                                        |
|------------------------|--------------------|----------------------|---------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
| 400                    | QIT000001          | Bad Request          | Schema Error                                                                                | Schema Inválido                                                                              |
| 400                    | BKS000141          | Bad Request          | Bank slip registration is restricted to QI SCD.                                             | Registro de boleto permitido apenas para QI SCD.                                             |
| 404                    | BKS000013          | Not Found            | Requester profile not found                                                                 | Carteira não encontrada                                                                      |
| 409                    | BKS000014          | Conflict             | Request control key already sent or duplicated sent: `<request_control_key>`                | Chave de controle da requisição já utilizada ou enviada duplicada: `<request_control_key>`   |
| 422                    | BLP000112          | Unprocessable Entity | Rejected Remittance                                                                         | Remessa Rejeitada                                                                            |

---

# List instruction batches

URL: /en/documentation/boletos/instrucoes/lote/listar_lotes_de_instrucoes

Lists, with pagination, the instruction batches created for a wallet, with optional filters by instruction type and date range.

## Request

ENDPOINT /v2/bank_slip/account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /occurrence_batches
METHOD GET

### Path parameters

| Field                   | Type   | Description                                                | Characters |
|-------------------------|--------|------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format        | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key, in uuid v4 format         | 36         |

### Query Parameters

| Field             | Type    | Description                                                                                  |
|-------------------|---------|----------------------------------------------------------------------------------------------|
| `page`            | integer | Query page (default `1`)                                                                     |
| `page_size`       | integer | Number of batches per page (default `20`, max `100`)                                         |
| `occurrence_type` | string  | Filter by instruction type. Accepts the same enumerators as the create POST                  |
| `from_date`       | string  | Start date, inclusive, in `YYYY-MM-DD` format. Filters over the batch's `created_at`         |
| `to_date`         | string  | End date, inclusive, in `YYYY-MM-DD` format. Filters over the batch's `created_at`           |

## Response

STATUS 200

Response Body

```json
{
  "data": [
    {
      "batch_key": "f2d3e1b9-4a5c-46e7-8f12-9a8b7c6d5e4f",
      "request_control_key": "614a451d-3b82-460e-bcc0-2caf3dde711f",
      "requester_profile_key": "8217da98-3e26-4ca5-8b86-698bfa50b0df",
      "occurrence_type": "extension",
      "occurrence_quantity": 14,
      "accepted_quantity": 14,
      "created_at": "2026-06-09T17:08:33Z"
    }
  ],
  "pagination": {
    "page": 1,
    "page_size": 20,
    "total": 1
  }
}
```

### Response Body Params

| Field                            | Type    | Description                                                              |
|----------------------------------|---------|--------------------------------------------------------------------------|
| `data` *                         | array   | List of batches on the current page                                      |
| `data[].batch_key` *             | uuidv4  | Batch key                                                                |
| `data[].request_control_key` *   | string  | Client-provided control key from batch creation                          |
| `data[].requester_profile_key` * | uuidv4  | Key of the wallet that owns the batch                                    |
| `data[].occurrence_type` *       | string  | Instruction type of the batch                                            |
| `data[].occurrence_quantity` *   | integer | Total number of items sent in the batch                                  |
| `data[].accepted_quantity` *     | integer | Number of items accepted in the batch                                    |
| `data[].created_at` *            | string  | UTC creation date/time of the batch (ISO 8601 with `Z` suffix)           |
| `pagination` *                   | object  | Pagination metadata                                                      |
| `pagination.page` *              | integer | Current page                                                             |
| `pagination.page_size` *         | integer | Page size                                                                |
| `pagination.total` *             | integer | Total number of batches matching the filters                             |

### Error Response

STATUS 4xx

| HTTP code<br/>`status` | QI code<br/>`code` | Title<br/>`title` | Description (eng)<br/>`description` | Description (pt-br)<br/>`translation` |
|------------------------|--------------------|--------------------|-------------------------------------|---------------------------------------|
| 400                    | QIT000001          | Bad Request        | Schema Error                        | Schema Inválido                       |
| 404                    | BKS000013          | Not Found          | Requester profile not found         | Carteira não encontrada               |

---

# Fine

URL: /en/documentation/boletos/instrucoes/multa

The fine instruction is used to configure the fine that will be applied if the bank slip is paid after the due date. If a fine configuration already exists for the bank slip in question, and a fine instruction is accepted, the previously existing configuration will be overwritten.

:::caution Attention!
If there is any fine instruction pending confirmation, sending a new instruction is not allowed.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip/ BANK_SLIP_KEY /fine
MÉTODO POST

### Path parameters

| Field                   | Type   | Description                                                  | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format        | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key, in uuid v4 format         | 36         |
| `bank_slip_key`         | uuidv4 | Unique bank slip identification key, in uuid v4 format      | 36         |

Request Body

```json
{
  "request_control_key": "c4dd443a-6e2f-4261-8f28-adfa4c0d4c5b",
  "fine_data": {
    "fine_type": "absolute",
    "fine_amount": 50.00,
    "days_to_fine": 5
  }
}
```

### Request Body Params

| Field                      | Type    | Description                                                                        | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|------------|
| `request_control_key` *    | uuidv4  | Unique request identification key used by the client in uuid v4 format            | 36         |
| `interest_data`            | object  | Fine configurations                                                                | **[fine_data Object](#fine_data-object)** |

### fine_data Object

Option 1: absolute value fine (`fine_type=absolute`)

| Field                     | Type    | Description                                               | Characters                |
|---------------------------|---------|---------------------------------------------------------|-------------------------------------------------------------------------|
| `fine_type` *             | string  | Fine type                                                       | **[fine_type Enumerators](#fine_type-enumerators)**                                              |
| `fine_amount` *           | float   | Absolute fine amount                                             | -                                                                        |
| `days_to_fine` *          | integer | Days after due date for the fine to be charged              | -                                                                        |

Option 2: percentage value fine (`fine_type=percentage`)

| Field                     | Type    | Description                                                 | Characters                             |
|---------------------------|---------|-----------------------------------------------------------|---------------------------------------|
| `fine_type` *             | string  | Fine type                                             | **[fine_type Enumerators](#fine_type-enumerators)** |
| `fine_percentage` *       | integer | Percentage fine amount, from 1 to 100                     | -                                      |
| `days_to_fine` *          | integer | Days after due date for the fine to be charged    | -                                      |

### fine_type Enumerators

| Enumerator         | Description           |
|--------------------|-----------------------|
| absolute           | absolute value        |
| percentage         | percentage value      |

## Response

STATUS 202

Response Body

```json
{
  "occurrence_key": "aaf64135-6bd8-4d49-be6f-e8f884b20ee7",
  "bank_slip_key": "470cfcae-159b-4de4-ad22-2d3b2dd717f7"
}
```

### Response Body Params

| Field              | Type   | Description                                                                       | Characters |
|--------------------|--------|-----------------------------------------------------------------------------------|------------|
| `occurrence_key` * | uuidv4 | Unique occurrence (instruction) identification key in uuid v4 format             | 36         |
| `bank_slip_key` *  | uuidv4 | Unique bank slip identification key in uuid v4 format                            | 36         |

### Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 409                      | BKS000014            | Conflict | Request control key already sent or duplicated sent: `<request_control_key>` | Chave de controle da requisição já utilizada ou enviada duplicada: `<request_control_key>` |
| 400                      | BKS000018            | Bad Request                                        | The discount dates must be less than the expiration date and increasing.                                                              | A data dos descontos devem ser menores que a de expiração e crescentes.                         |
| 400                      | BKS000022            | Bad Request                                        | Requester profile is not opened.                                                              | Carteira não está aberta.                          |
| 404                      | BKS000029            | Not Found                                        | Bank slip not found for the given key (`{bank_slip_key}`).                                                              | Boleto não encontrado para a chave fornecida (`{bank_slip_key}`).                          |
| 400                      | BKS000032            | Bad Request                                        | Bank slip must be in 'registered' status.                                                              | O boleto deve possuir o status 'registered'.                          |
| 409                      | BKS000050            | Conflict                                        | There is already a pending fine occurrence for this bank slip. Please, wait for the confirmation of this occurrence before sending another one.                                                              | Já existe uma ocorrência de multa pendente para este boleto. Por favor, aguarde a confirmação dessa ocorrência antes de enviar outra.                          |

---

# Partial Payment

URL: /en/documentation/boletos/instrucoes/pagamento_parcial

The partial payment instruction allows editing partial payment configurations for a bank slip, as long as the bank slip has already been registered with partial payment active. If there is already a partial payment configuration for the bank slip in question, and a new instruction is accepted, the previously existing configuration will be overwritten.

:::caution Attention!
If there is any partial payment instruction pending confirmation, it is not allowed to send a new instruction.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip/ BANK_SLIP_KEY /partial_payment
METHOD POST

### Path parameters

| Field                   | Type   | Description                                                    | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format    | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key, in uuid v4 format | 36         |
| `bank_slip_key`         | uuidv4 | Unique bank slip identification key, in uuid v4 format   | 36         |

Request Body

```json
{
    "request_control_key": "01234567-89ab-cdef-0123-456789abcdef",
    "partial_payment_data": {
        "partial_payment_minimum_type": "absolute",
        "partial_payment_minimum_amount": 50.00,
        "partial_payment_maximum_type": "absolute",
        "partial_payment_maximum_amount": 1000.00,
        "partial_payment_quantity": 3
    }
}
```

### Request Body Params

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|------------|
| `request_control_key` *    | uuidv4  | Unique request identification key used by the client in uuid v4 format  | 36         |
| `partial_payment_data` *    | object  | Partial payment configurations                      | **[partial_payment_data Object](#partial_payment_data-object)** |

### partial_payment_data Object

| Field                             | Type    | Description                                                                 | Characters |
|-----------------------------------|---------|---------------------------------------------------------------------------|------------|
| `partial_payment_minimum_type` *  | string  | Minimum value type for partial payment                               | **[partial_payment_type Enumerators](#partial_payment_type-enumerators)** |
| `partial_payment_minimum_percentage` | float | Minimum percentage allowed for partial payment                      | -          |
| `partial_payment_minimum_amount`  | float  | Minimum amount allowed for partial payment                           | -          |
| `partial_payment_maximum_type`    | string  | Maximum value type for partial payment                               | **[partial_payment_type Enumerators](#partial_payment_type-enumerators)** |
| `partial_payment_maximum_percentage` | float | Maximum percentage allowed for partial payment                      | -          |
| `partial_payment_maximum_amount`  | float  | Maximum amount allowed for partial payment                           | -          |
| `partial_payment_quantity` *      | integer | Number of partial payments allowed                              | -          |

:::caution Attention!
According to the value sent in the `partial_payment_minimum_type` and `partial_payment_maximum_type` fields, it is necessary to send the corresponding `partial_payment_minimum_amount` or `partial_payment_minimum_percentage`, and the `partial_payment_maximum_amount` or `partial_payment_maximum_percentage`.
:::

### partial_payment_type Enumerators

| Enumerator  | Description                        |
|-------------|----------------------------------|
| absolute    | Absolute value                   |
| percentage  | Percentage                       |

## Response

STATUS 202

Response Body

```json
{
  "occurrence_key": "5a745b65-9a2c-44eb-b43e-c80ef5429d94",
  "bank_slip_key": "fdafdffa-cbd4-4f3c-8e3d-990428305161"
}
```

### Response Body Params

| Field              | Type   | Description                                                                         | Characters |
|--------------------|--------|-----------------------------------------------------------------------------------|------------|
| `occurrence_key` * | uuidv4 | Unique occurrence (instruction) identification key in uuid v4 format         | 36         |
| `bank_slip_key` *  | uuidv4 | Unique bank slip identification key in uuid v4 format                         | 36         |

### Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 409                      | BKS000014            | Conflict | Request control key already sent or duplicated sent: `<request_control_key>` | Chave de controle da requisição já utilizada ou enviada duplicada: `<request_control_key>` |
| 400                      | BKS000022            | Bad Request                                        | Requester profile is not opened.                                                              | Carteira não está aberta.                          |
| 404                      | BKS000029            | Not Found                                        | Bank slip not found for the given key (`{bank_slip_key}`).                                                              | Boleto não encontrado para a chave fornecida (`{bank_slip_key}`).                          |
| 400                      | BKS000032            | Bad Request                                        | Bank slip must be in 'registered' status.                                                              | O boleto deve possuir o status 'registered'.                          |
| 409                      | BKS000126            | Conflict                                        | There is already a pending partial payment occurrence for this bank slip. Please, wait for the confirmation of this occurrence before sending another one.                                                              | Já existe uma ocorrência de pagamento parcial pendente para este boleto. Por favor, aguarde a confirmação dessa ocorrência antes de enviar outra.                          |
| 400                      | BKS000127            | Bad Request                                        | Partial payment data is not set for this bank slip.                                                              | Os dados de pagamento parcial não estão configurados para este boleto.                          |

---

# Protest instrument query

URL: /en/documentation/boletos/instrucoes/protesto/consulta_instrumento_de_protesto

The protest instrument is an official document issued by the protest registry office, which proves the execution of the collection process. It is issued after the protest is registered, if the debtor has not paid the debt after being notified.

:::caution Attention!
It is only possible to query the protest instrument of the title after it has been effectively protested (`protest_status` has the value `protested`).
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip/ BANK_SLIP_KEY /protest_instrument
METHOD GET

### Path parameters

| Field                   | Type   | Description                                                  | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format        | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key, in uuid v4 format         | 36         |
| `bank_slip_key`         | uuidv4 | Unique bank slip identification key, in uuid v4 format      | 36         |

## Response

STATUS 200

Response Body

```json
{
  "bank_slip_key": "bc34e9b1-42e4-4f17-bfc0-c88f29d5230e",
  "file_url": "https://storage.googleapis.com/live-bank-slip-api/protest_instrument/bc34e9b1-42e4-4f17-bfc0-c88f29d5230e.pdf"
}
```

### Response Body Params

| Field                      | Type    | Description                                                                        | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------|
| `bank_slip_key` *          | uuidv4  | Unique bank slip identification key in uuid v4 format                             | 36                                                |
| `file_url` *               | string  | File URL, in PDF format, containing the protest instrument document               | -                                                 |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (ptbr)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 404                      | BKS000029            | Not Found                                        | Bank slip not found for the given key (`{bank_slip_key}`).                                                              | Boleto não encontrado para a chave fornecida (`{bank_slip_key}`).                          |
| 400                      | BKS000081            | Bad Request | The protest instrument will be available only after bank slip's protest confirmation. | O instrumento de protesto só estará disponível após a confirmação do protesto do título. |
| 500                      | BKS000105            | Internal Server Error | Could not fetch protest instrument for the given 'bank_slip_key' at this moment. Please, try again later. | Não foi possível recuperar o instrumento de protesto para a chave ('bank_slip_key') fornecida. Por favor, tente novamente mais tarde. |
| 404                      | BKS000106            | Not Found | No protest found for the given bank slip. | Nenhum protesto foi encontrado para o boleto fornecido. |

---

# Query protest by key

URL: /en/documentation/boletos/instrucoes/protesto/consulta_por_chave

Querying a protest using its key returns detailed information about it.

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /protest/ BANK_SLIP_KEY
METHOD GET

### Path parameters

| Field                   | Type   | Description                                                    | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key in uuid v4 format    | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key in uuid v4 format | 36         |
| `bank_slip_key`         | uuidv4 | Unique bank slip identification key in uuid v4 format   | 36         |

## Response

STATUS 200

Response Body

```json
{
  "protest_key": "bc34e9b1-42e4-4f17-bfc0-c88f29d5230e",
  "request_control_key": "59515878-50e9-466b-b40d-1aac3939c3fd",
  "protest_status": "protested",
  "bank_slip_key": "7d3d262b-9b55-44cd-8355-2f00d5b1d142",
  "requester_profile_code": "329-09-0001-1467576",
  "protest_type": "protest",
  "protocol_number": "0000672016",
  "protocol_date": "2012-12-16",
  "notary_office": {
    "city": "VITORIA",
    "uf": "ES"
  }
}
```

### Response Body Params

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------|
| `protest_key      ` *      | uuidv4  | Unique protest identification key in uuid v4 format                        | 36                                                |
| `request_control_key` *    | uuidv4  | Unique identification key of the request used by the client in uuid v4 format  | 36                                                |
| `protest_status` *         | string  | Protest status                                                                 | **[protest_status Enumerators](#protest_status-enumerators)**   |
| `bank_slip_key` *          | uuidv4  | Unique bank slip identification key in uuid v4 format                          | 36                                                |
| `requester_profile_code` * | string  | Unique wallet identification code                                          | 10                                                |
| `protest_type` *           | string  | Protest type                                                                   | **[protest_type Enumerators](#protest_type-enumerators)**       |
| `protocol_number`          | string  | Protocol number                                                                | 10                                                |
| `protocol_date`            | string  | Protocol date (format "YYYY-MM-DD")                                           | 10                                                |
| `notary_office`            | object  | Protest notary office data                                                      | **[notary_office Object](#notary_office-object)**                         |

### protest_status Enumerators

| Enumerator                   | Description                                                                      |
|------------------------------|--------------------------------------------------------------------------------|
| accepted                     | Accepted but not yet sent to the protest notary offices         |
| submitted                    | Sent to the notary office                                                        |
| cancellation_requested       | Protest suspension requested                                                |
| cancelled                    | Submission cancelled or protest suspended                                           |
| rejected                     | Protest request rejected                                                   |
| at_notary_office             | At the protest notary office, in the three-day period                                  |
| paid_at_notary_office        | Title paid at the notary office                                                        |
| protested                    | Title protested and settled                                                    |
| removal_requested            | Title already protested, with cancellation requested                              |
| removed                      | Protest cancelled                                                             |

### protest_type Enumerators

| Enumerator                   | Description                                                                      |
|------------------------------|--------------------------------------------------------------------------------|
| protest                      | Common protest                                                                 |
| bankruptcy_protest           | Bankruptcy protest                                                            |

### notary_office Object

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------|
| `city` *                   | string  | Protest notary office city                                                     |  -                                                 |
| `uf` *                     | string  | Protest notary office state (UF)                                                | 2                                                 |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (ptbr)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 404                      | BKS000029            | Not Found                                        | Bank slip not found for the given key (`{bank_slip_key}`).                                                              | Boleto não encontrado para a chave fornecida (`{bank_slip_key}`).                          |
| 404                      | BKS000106            | Not Found | No protest found for the given bank slip. | Nenhum protesto foi encontrado para o boleto fornecido. |

---

# Protest withdrawal (protest stoppage)

URL: /en/documentation/boletos/instrucoes/protesto/desistencia_de_protesto

It is possible to withdraw a protest request by sending a `protest_cancel_request` instruction.

:::caution Attention!
The `protest_cancel_request` occurrence, by itself, does not cancel the bank slip. If the exit from the notary office is caused by a `protest_cancel_request` occurrence, another `notary_office_exit` occurrence is created, which is sent to CIP/Nuclea to unblock the bank slip for payment. Once it is confirmed, the bank slip can be paid again via the typeable line. If it is desired that the bank slip be canceled after the protest withdrawal, the ideal is to send a [**protest withdrawal and bank slip cancellation**](/documentation/boletos/instrucoes/protesto/desistencia_de_protesto_e_baixa_do_boleto) instruction.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip/ BANK_SLIP_KEY /protest_cancel_request
METHOD POST

### Path parameters

| Field                   | Type   | Description                                                  | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format        | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key, in uuid v4 format         | 36         |
| `bank_slip_key`         | uuidv4 | Unique bank slip identification key, in uuid v4 format      | 36         |

Request Body

```json
{
  "request_control_key": "614a451d-3b82-460e-bcc0-2caf3dde711f"
}
```

### Request Body Params

| Field                      | Type    | Description                                                                        | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|------------|
| `request_control_key` *    | uuidv4  | Unique request identification key used by the client in uuid v4 format            | 36         |

## Response

STATUS 202

Response Body

```json
{
  "occurrence_key": "2552bd64-950b-437e-a53a-a133ffea03d7",
  "bank_slip_key": "960f78d4-4426-4762-98da-3ce3713ae0a5"
}
```

### Response Body Params

| Field              | Type   | Description                                                                       | Characters |
|--------------------|--------|-----------------------------------------------------------------------------------|------------|
| `occurrence_key` * | uuidv4 | Unique occurrence (instruction) identification key in uuid v4 format             | 36         |
| `bank_slip_key` *  | uuidv4 | Unique bank slip identification key in uuid v4 format                            | 36         |

### Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 409                      | BKS000014            | Conflict | Request control key already sent or duplicated sent: `<request_control_key>` | Chave de controle da requisição já utilizada ou enviada duplicada: `<request_control_key>` |
| 400                      | BKS000019            | Bad Request | Payer address is required for protest. | Endereço do pagador é obrigatório para protesto. |
| 400                      | BKS000022            | Bad Request                                        | Requester profile is not opened.                                                              | Carteira não está aberta.                          |
| 404                      | BKS000029            | Not Found                                        | Bank slip not found for the given key (`{bank_slip_key}`).                                                              | Boleto não encontrado para a chave fornecida (`{bank_slip_key}`).                          |
| 400                      | BKS000032            | Bad Request                                        | Bank slip must be in 'registered' status.                                                              | O boleto deve possuir o status 'registered'.                          |
| 400                      | BKS000076            | Bad Request | Bank slip must have an ongoing protest request. | O boleto deve ter um pedido de protesto em vigência. |
| 400                      | BKS000077            | Bad Request | Invalid bank slip protest status to cancel protest request. | Status de protesto do boleto inválido para desistir do pedido de protesto. |

---

# Protest withdrawal (stay) and bank slip write-off

URL: /en/documentation/boletos/instrucoes/protesto/desistencia_de_protesto_e_baixa_do_boleto

Another way to withdraw a protest request is by sending a `protest_cancel_and_write_off_request` instruction.

:::caution Warning!
The `protest_cancel_and_write_off_request` instruction also writes off the bank slip in CIP/Nuclea. As soon as it is confirmed, a `write_off` occurrence is automatically created and sent to Nuclea.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip/ BANK_SLIP_KEY /protest_cancel_and_write_off_request
METHOD POST

### Path parameters

| Field                   | Type   | Description                                                    | Characters |
|-------------------------|--------|----------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format          | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key, in uuid v4 format           | 36         |
| `bank_slip_key`         | uuidv4 | Unique bank slip identification key, in uuid v4 format        | 36         |

Request Body

```json
{
  "request_control_key": "614a451d-3b82-460e-bcc0-2caf3dde711f"
}
```

### Request Body Params

| Field                      | Type    | Description                                                                        | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|------------|
| `request_control_key` *    | uuidv4  | Unique request identification key used by the client in uuid v4 format            | 36         |

## Response

STATUS 202

Response Body

```json
{
  "occurrence_key": "2552bd64-950b-437e-a53a-a133ffea03d7",
  "bank_slip_key": "960f78d4-4426-4762-98da-3ce3713ae0a5"
}
```

### Response Body Params

| Field              | Type   | Description                                                                       | Characters |
|--------------------|--------|-----------------------------------------------------------------------------------|------------|
| `occurrence_key` * | uuidv4 | Unique occurrence (instruction) identification key in uuid v4 format             | 36         |
| `bank_slip_key` *  | uuidv4 | Unique bank slip identification key in uuid v4 format                            | 36         |

### Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 409                      | BKS000014            | Conflict | Request control key already sent or duplicated sent: `<request_control_key>` | Chave de controle da requisição já utilizada ou enviada duplicada: `<request_control_key>` |
| 400                      | BKS000019            | Bad Request | Payer address is required for protest. | Endereço do pagador é obrigatório para protesto. |
| 400                      | BKS000022            | Bad Request                                        | Requester profile is not opened.                                                              | Carteira não está aberta.                          |
| 404                      | BKS000029            | Not Found                                        | Bank slip not found for the given key (`{bank_slip_key}`).                                                              | Boleto não encontrado para a chave fornecida (`{bank_slip_key}`).                          |
| 400                      | BKS000032            | Bad Request                                        | Bank slip must be in 'registered' status.                                                              | O boleto deve possuir o status 'registered'.                          |
| 400                      | BKS000076            | Bad Request | Bank slip must have an ongoing protest request. | O boleto deve ter um pedido de protesto em vigência. |
| 400                      | BKS000077            | Bad Request | Invalid bank slip protest status to cancel protest request. | Status de protesto do boleto inválido para desistir do pedido de protesto. |

---

# Introduction

URL: /en/documentation/boletos/instrucoes/protesto/introducao

## Notary office protest

A notary office protest request can be made after the boleto's due date, and serves to have the payer notified to pay the bill at the notary office. If they fail to do so, a public record of default is made in their name, in addition to having their name included in credit protection agencies, such as Serasa.

## Protest flow

### Protest request

The protest flow for a boleto is initiated with a protest request : an instruction of type `protest_request`. From the moment the protest request is accepted by CIP/Nuclea (the `protest_request` instruction is confirmed), the boleto becomes blocked for payment, which means the payer can only pay it at the notary office. Additionally, a `notary_office_entry` occurrence is also created, which refers to sending the protest request to the notary office. Protest request remittances are sent daily to notary offices at 9 AM, therefore, if protest request instructions are received after this time, they are only sent to notary offices the following day.

On subsequent days, the notary office must confirm the entry of the bill into the notary office (the `notary_office_entry` occurrence is confirmed) and, with this, the triduum period begins. The triduum is the 3 business day period for the payer to pay the boleto at the notary office, and if they fail to do so, the bill will be protested. If the bill is paid at the notary office, a `notary_office_payment_notice` type occurrence is created for the boleto in question and it is settled the following day. In this latter case, a `payment_write_off` instruction is also automatically generated, so that the boleto is written off with CIP/Nuclea.

If the triduum period ends and the boleto is not paid and there is no withdrawal from the protest, the boleto is protested. At this moment, a `protest_write_off` instruction is generated to write off the boleto at CIP/Nuclea, and the bill's life cycle ends.

### Withdrawal (suspension) of protest request

If issues regarding the bill are resolved directly between the payer and the drawer guarantor, until the boleto is actually protested (that is, until the last day of the triduum), it is possible to send a `protest_cancel_request` instruction, which withdraws the protest request; or a `protest_cancel_and_write_off_request` instruction, which withdraws the protest request and also writes off the boleto at CIP/Nuclea. It's worth noting that the `protest_cancel_request` occurrence, by itself, does not write off the boleto. If the exit from the notary office is caused by a `protest_cancel_request` type occurrence, another `notary_office_exit` occurrence is created, which is sent to CIP/Nuclea to unblock the boleto for payment. As soon as it is confirmed, the boleto can again be paid via the typed line. On the other hand, if the exit from the notary office is caused by a `protest_cancel_and_write_off_request` type occurrence, a `write_off` occurrence is automatically created, which writes off the boleto at CIP/Nuclea.

### Removal (cancellation) of protest request

If the pending issue between the payer and drawer guarantor is resolved after the boleto has already been protested, it is possible to send a `protest_remove_request` type instruction, which removes the public default record and any record, linked to this boleto, that has tarnished the payer's name. If the occurrence is confirmed (accepted by the notary office), the protest is removed and no more instructions are created for this boleto, since it is already written off at CIP/Nuclea.

---

# List protests

URL: /en/documentation/boletos/instrucoes/protesto/listar_protestos

The protest listing will return all protests in notary offices for bank slips from the wallet that match the query parameters sent in the request.

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /protests
METHOD GET

### Path parameters

| Field                   | Type   | Description                                                    | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format    | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key, in uuid v4 format | 36         |

### Query parameters

| Field                   | Type   | Description                                                    | Characters              |
|-------------------------|--------|--------------------------------------------------------------|-------------------------|
| `protest_key`           | uuidv4 | Unique protest identification key, in uuid v4 format | 36                      |
| `request_control_key`   | uuidv4 | Unique request identification key, in uuid v4 format  | 36                      |
| `protest_status`        | string | Protest status | **[protest_status enumerators](#enumeradores-protest_status)**   |
| `bank_slip_key`         | uuidv4 | Unique bank slip identification key, in uuid v4 format   | 36                      |
| `protocol_number`       | string | Protocol number                                          | 36                      |
| `protocol_date`         | string | Protocol date (format "YYYY-MM-DD")                     | 10                      |
| `page_size`             | integer| Page size                                            | -                       |
| `from_date`             | string | Start date (format "YYYY-MM-DD")                          | 10                      |
| `to_date`               | string | End date (format "YYYY-MM-DD")                            | 10                      |

### protest_status enumerators

| Enumerator                   | Description                                                                      |
|------------------------------|--------------------------------------------------------------------------------|
| accepted                     | Accepted, but not yet sent to the protest notary offices         |
| submitted                    | Sent to notary office                                                        |
| cancellation_requested       | Protest suspension requested                                                |
| cancelled                    | Sending cancelled, or protest suspended                                           |
| rejected                     | Protest request rejected                                                   |
| at_notary_office             | At protest notary office, in triduum period                                  |
| paid_at_notary_office        | Title paid at notary office                                                        |
| protested                    | Title protested and settled                                                    |
| removal_requested            | Title already protested, with cancellation requested                              |
| removed                      | Protest cancelled                                                             |

## Response

STATUS 200

Response Body

```json
{
    "data": [
        {
            "protest_key": "ad44278d-7cf1-4ac7-9545-410649a47dde",
            "request_control_key": "7e40ebab-f00c-4dbf-88be-ff34434ab358",
            "protest_status": "protested",
            "bank_slip_key": "7bf086ac-f520-4498-abd4-5a7d2173fd1c",
            "requester_profile_code": "329-09-0001-1467576",
            "protest_type": "protest",
            "protocol_number": "0000000004",
            "protocol_date": "2024-11-27",
            "notary_office": {
                "city": "SAO PAULO",
                "uf": "SP"
            }
        },
        {
            "protest_key": "0087f425-5e54-4b4c-ab17-a57bc80f223a",
            "request_control_key": "c413cedc-78ac-4deb-ace8-d94d4e98197c",
            "protest_status": "at_notary_office",
            "bank_slip_key": "e345c0b3-012b-4a4b-9d6b-6981f40b1a7c",
            "requester_profile_code": "329-09-0001-1467576",
            "protest_type": "protest",
            "protocol_number": "0000000016",
            "protocol_date": "2024-12-10",
            "notary_office": {
                "city": "RIO DE JANEIRO",
                "uf": "RJ"
            }
        },
        {
            "protest_key": "bc34e9b1-42e4-4f17-bfc0-c88f29d5230e",
            "request_control_key": "59515878-50e9-466b-b40d-1aac3939c3fd",
            "protest_status": "accepted",
            "bank_slip_key": "7d3d262b-9b55-44cd-8355-2f00d5b1d142",
            "requester_profile_code": "329-09-0001-1467576",
            "protest_type": "protest"
        }
    ],
    "pagination": {
        "current_page": 1,
        "rows_per_page": 100
    }
}
```

### Response Body Params

| Field            | Type         | Description                             | Characters                                  |
|------------------|--------------|---------------------------------------|---------------------------------------------|
| `data` *         | object array | Protests                             | **[protest object](#objeto-protest)**       |
| `pagination` *   | object       | Pagination information              | **[pagination object](#objeto-pagination)** |

### protest object

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------|
| `protest_key      ` *      | uuidv4  | Unique protest identification key in uuid v4 format                        | 36                                                |
| `request_control_key` *    | uuidv4  | Unique request identification key used by the client in uuid v4 format  | 36                                                |
| `protest_status` *         | string  | Protest status                                                                 | **[protest_status enumerators](#enumeradores-protest_status)**   |
| `bank_slip_key` *          | uuidv4  | Unique bank slip identification key in uuid v4 format                          | 36                                                |
| `requester_profile_code` * | string  | Unique wallet identification code                                          | 10                                                |
| `protest_type` *           | string  | Protest type                                                                   | **[protest_type enumerators](#enumeradores-protest_type)**       |
| `protocol_number`          | string  | Protocol number                                                                | 10                                                |
| `protocol_date`            | string  | Protocol date (format "YYYY-MM-DD")                                           | 10                                                |
| `notary_office`            | object  | Protest notary office data                                                      | **[notary_office object](#objeto-notary_office)**                         |

### pagination object

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------------------|
| `current_page` *           | integer | Current page                                                 | -      |
| `rows_per_page` *          | integer | Items per page                                             | -      |

### protest_type enumerators

| Enumerator                   | Description                                                                      |
|------------------------------|--------------------------------------------------------------------------------|
| protest                      | Common protest                                                                 |
| bankruptcy_protest           | Bankruptcy protest                                                            |

### protest_status enumerators

| Enumerator                   | Description                                                                      |
|------------------------------|--------------------------------------------------------------------------------|
| accepted                     | Accepted, but not yet sent to the protest notary offices         |
| submitted                    | Sent to notary office                                                        |
| cancellation_requested       | Protest suspension requested                                                |
| cancelled                    | Sending cancelled, or protest suspended                                           |
| rejected                     | Protest request rejected                                                   |
| at_notary_office             | At protest notary office, in triduum period                                  |
| paid_at_notary_office        | Title paid at notary office                                                        |
| protested                    | Title protested and settled                                                    |
| removal_requested            | Title already protested, with cancellation requested                              |
| removed                      | Protest cancelled                                                             |

### notary_office object

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------|
| `city` *                   | string  | Protest notary office city                                                     |  -                                                 |
| `uf` *                     | string  | Protest notary office state (UF)                                                | 2                                                 |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 403                      | BKS000005            | Forbidden                         | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 400                      | BKS000012            | Bad Request | Invalid integer value for page or size query string parameters. | Valor inválido para parâmetros de página ou tamanho de página. |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |

---

# Protest request

URL: /en/documentation/boletos/instrucoes/protesto/pedido_de_protesto

A protest request at a notary office can be made after the due date of the bank slip, and serves to have the payer notified to pay the instrument at the notary office. If they do not do so, a public record is made in their name of the default, in addition to having their name included in credit protection agencies, such as Serasa.

:::caution Attention!
To send a protest request, it is mandatory that the payer's address is present on the bank slip. If it is not, it is possible to send an instruction to edit the bank slip. Furthermore, if a bank slip is in the protest flow, sending a new request is not permitted.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip/ BANK_SLIP_KEY /protest_request
METHOD POST

### Path parameters

| Field                   | Type   | Description                                                  | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format        | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key, in uuid v4 format         | 36         |
| `bank_slip_key`         | uuidv4 | Unique bank slip identification key, in uuid v4 format      | 36         |

Request Body

```json
{
  "request_control_key": "614a451d-3b82-460e-bcc0-2caf3dde711f",
  "protest_type": "protest"
}
```

### Request Body Params

| Field                      | Type    | Description                                                                        | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|------------|
| `request_control_key` *    | uuidv4  | Unique request identification key used by the client in uuid v4 format            | 36         |
| `protest_type` *           | string  | Type of protest (common or bankruptcy)                                             | **[Enumerators protest_type](#enumerators-protest_type)** |

### Enumerators protest_type

| Enumerator                                  | Description                                                              |
|---------------------------------------------|--------------------------------------------------------------------------|
| protest                                     | Common protest                                                           |
| bankruptcy_protest                          | Bankruptcy protest                                                       |

## Response

STATUS 202

Response Body

```json
{
  "occurrence_key": "2552bd64-950b-437e-a53a-a133ffea03d7",
  "bank_slip_key": "960f78d4-4426-4762-98da-3ce3713ae0a5"
}
```

### Response Body Params

| Field              | Type   | Description                                                                       | Characters |
|--------------------|--------|-----------------------------------------------------------------------------------|------------|
| `occurrence_key` * | uuidv4 | Unique occurrence (instruction) identification key in uuid v4 format             | 36         |
| `bank_slip_key` *  | uuidv4 | Unique bank slip identification key in uuid v4 format                            | 36         |

### Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 409                      | BKS000014            | Conflict | Request control key already sent or duplicated sent: `<request_control_key>` | Chave de controle da requisição já utilizada ou enviada duplicada: `<request_control_key>` |
| 400                      | BKS000019            | Bad Request | Payer address is required for protest. | Endereço do pagador é obrigatório para protesto. |
| 400                      | BKS000022            | Bad Request                                        | Requester profile is not opened.                                                              | Carteira não está aberta.                          |
| 404                      | BKS000028            | Not Found | Notary office attended region not found for postal code: `<postal_code>` | Região de cartório não encontrada para o CEP: `<postal_code>` |
| 404                      | BKS000029            | Not Found                                        | Bank slip not found for the given key (`{bank_slip_key}`).                                                              | Boleto não encontrado para a chave fornecida (`{bank_slip_key}`).                          |
| 400                      | BKS000032            | Bad Request                                        | Bank slip must be in 'registered' status.                                                              | O boleto deve possuir o status 'registered'.                          |
| 409                      | BKS000075            | Conflict                                        | An open protest request already exists for the given 'bank_slip_key'.                                                              | Já existe um pedido de protesto em aberto para a 'bank_slip_key' fornecida.                          |
| 400                      | BKS000080            | Bad Request                                        | A protest request can only be sent after bank slip's business expiration date.                                                              | Um pedido de protesto só pode ser enviado após o dia útil de expiração do boleto.                          |

---

# Protest Removal

URL: /en/documentation/boletos/instrucoes/protesto/sustacao_de_protesto

If the dispute between the payer and drawer guarantor is resolved after the bank slip has already been protested, it is possible to send an instruction of type `protest_remove_request`, which removes the public record of default and any record, linked to this bank slip, that has tainted the payer's name.

:::caution Attention!
If the occurrence is confirmed (accepted by the notary office), the protest is removed and no further instructions are created for this bank slip, since it is already settled in CIP/Nuclea.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip/ BANK_SLIP_KEY /protest_remove_request
METHOD POST

### Path parameters

| Field                   | Type   | Description                                                    | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format    | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key, in uuid v4 format | 36         |
| `bank_slip_key`         | uuidv4 | Unique bank slip identification key, in uuid v4 format   | 36         |

Request Body

```json
{
  "request_control_key": "614a451d-3b82-460e-bcc0-2caf3dde711f"
}
```

### Request Body Params

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|------------|
| `request_control_key` *    | uuidv4  | Unique request identification key used by the client in uuid v4 format  | 36         |

## Response

STATUS 202

Response Body

```json
{
  "occurrence_key": "2552bd64-950b-437e-a53a-a133ffea03d7",
  "bank_slip_key": "960f78d4-4426-4762-98da-3ce3713ae0a5"
}
```

### Response Body Params

| Field              | Type   | Description                                                                         | Characters |
|--------------------|--------|-----------------------------------------------------------------------------------|------------|
| `occurrence_key` * | uuidv4 | Unique occurrence (instruction) identification key in uuid v4 format         | 36         |
| `bank_slip_key` *  | uuidv4 | Unique bank slip identification key in uuid v4 format                         | 36         |

### Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 409                      | BKS000014            | Conflict | Request control key already sent or duplicated sent: `<request_control_key>` | Chave de controle da requisição já utilizada ou enviada duplicada: `<request_control_key>` |
| 400                      | BKS000019            | Bad Request | Payer address is required for protest. | Endereço do pagador é obrigatório para protesto. |
| 400                      | BKS000022            | Bad Request                                        | Requester profile is not opened.                                                              | Carteira não está aberta.                          |
| 404                      | BKS000029            | Not Found                                        | Bank slip not found for the given key (`{bank_slip_key}`).                                                              | Boleto não encontrado para a chave fornecida (`{bank_slip_key}`).                          |
| 400                      | BKS000032            | Bad Request                                        | Bank slip must be in 'registered' status.                                                              | O boleto deve possuir o status 'registered'.                          |
| 400                      | BKS000076            | Bad Request | Bank slip must have an ongoing protest request. | O boleto deve ter um pedido de protesto em vigência. |
| 400                      | BKS000078            | Bad Request | Bank slip's protest_status must be 'protested' to send a protest remove request. | Status de protesto (protest_status) do boleto deve ser 'protested' para enviar um pedido de remoção de protesto. |

---

# Credit Split Update

URL: /en/documentation/boletos/instrucoes/rateio_de_credito

This endpoint allows updating the **credit split** (split payment) of a previously issued bank slip. The new rules fully replace the existing ones and apply to the next settlement of the bank slip.

:::caution Attention!
- The bank slip must be in `registered` status and not yet paid.
- The sum of `beneficiary_settlement_percentage` and the percentages in each item of `split_payment_rules` must be exactly **100**.
- The payload **replaces** all existing split rules (it is not incremental).
- The split applies to all settlement flows of the bank slip (SILOC, STR, notary office and Pix QR Code), including bank slips with QR Code already issued — in this case, the rules are also automatically updated on the QR Code.
- The accounts in the split rules must be open and registered with QI Tech (QI Tech will look them up by the `document_number`, `account_number` and `account_digit` provided).
:::

## Request

ENDPOINT /v2/bank_slip/account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip/ BANK_SLIP_KEY /split_payment
METHOD PUT

### Path parameters

| Field                   | Type   | Description                                                            | Characters |
|-------------------------|--------|------------------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique identification key of the account in which the bank slip was issued | 36         |
| `requester_profile_key` | uuidv4 | Unique identification key of the wallet                                | 36         |
| `bank_slip_key`         | uuidv4 | Unique identification key of the bank slip                             | 36         |

Request Body

```json
{
  "beneficiary_settlement_percentage": 70,
  "split_payment_rules": [
    {
      "percentage": 20,
      "document_number": "12345678901",
      "account_owner_name": "John Smith",
      "account_number": "1234567",
      "account_digit": "8"
    },
    {
      "percentage": 10,
      "document_number": "10987654321",
      "account_owner_name": "Mary Johnson",
      "account_number": "7654321",
      "account_digit": "0"
    }
  ]
}
```

### Request Body Params

| Field                                  | Type         | Description                                                                                              | Characters |
|----------------------------------------|--------------|----------------------------------------------------------------------------------------------------------|------------|
| `beneficiary_settlement_percentage` *  | float        | Percentage of the settled amount allocated to the bank slip's beneficiary. Accepts values from 0 to 100. | -          |
| `beneficiary_max_amount`               | float        | Maximum amount the beneficiary receives at settlement. When the paid amount exceeds this limit, the surplus is fully directed to the first rule of the `split_payment_rules` array. Accepts values greater than 0 and less than or equal to the bank slip amount. | - |
| `split_payment_rules` *                | object array | List of split rules. Minimum 1, maximum 10 rules.                                                        | **[split_payment_rule Object](#objeto-split_payment_rule)** |

### Objeto split_payment_rule

| Field                  | Type    | Description                                                                                          | Characters |
|------------------------|---------|------------------------------------------------------------------------------------------------------|------------|
| `percentage` *         | float   | Percentage of the settled amount allocated to this account. Accepts values from 0 to 100. Use `0` when this rule is meant exclusively to receive the surplus from `beneficiary_max_amount`. | - |
| `document_number` *    | string  | CPF/CNPJ of the destination account holder.                                                          | 11 or 14   |
| `account_owner_name` * | string  | Name of the destination account holder.                                                              | 100        |
| `account_number` *     | string  | Destination account number.                                                                          | 20         |
| `account_digit` *      | string  | Destination account check digit.                                                                     | 2          |

## Use case: directing late fees and interest to a separate account

> **How can I configure the split so that interest and late fees that exceed the bank slip's face value are directed to a different account?**

This scenario is common for platforms that issue bank slips on behalf of third parties (schools, condominiums, marketplaces), where the bank slip's owner should always receive the face value and the platform receives the additional interest/late fee in case of overdue payment.

It is configured by combining `beneficiary_max_amount` with a split rule with `percentage = 0`:

```json
{
  "beneficiary_settlement_percentage": 100,
  "beneficiary_max_amount": 1000.00,
  "split_payment_rules": [
    {
      "percentage": 0,
      "document_number": "12345678000199",
      "account_owner_name": "Billing Platform",
      "account_number": "1234567",
      "account_digit": "8"
    }
  ]
}
```

**How the calculation works** considering a bank slip of R$ 1,000.00:

| Scenario | Paid amount | Beneficiary receives | Platform receives |
|---|---|---|---|
| Paid on time | R$ 1,000.00 | R$ 1,000.00 | R$ 0.00 (no settlement generated) |
| Paid late (with R$ 100.00 interest/fee) | R$ 1,100.00 | R$ 1,000.00 | R$ 100.00 |
| Partial late payment | R$ 950.00 | R$ 950.00 | R$ 0.00 |

The rule is: the beneficiary receives **at most** `beneficiary_max_amount`; any amount paid above this is fully directed to the **first** rule in `split_payment_rules`.

:::caution Attention!
- `beneficiary_max_amount` must be greater than 0 and less than or equal to the bank slip amount (`amount`).
- When any rule has `percentage = 0`, the `beneficiary_max_amount` field is required.
- Only **one** rule in `split_payment_rules` may have `percentage = 0` per bank slip (the surplus recipient).
:::

## Response

STATUS 204

Response Body

```json
{}
```

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "title",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "code",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`         | Description (eng)<br/>`description`                                                          | Description (pt-br)<br/>`translation`                                                                     |
|------------------------|--------------------|---------------------------|----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|
| 400                    | QIT000001          | Bad Request               | Schema Error                                                                                 | Schema Inválido                                                                                           |
| 404                    | BKS000029          | Not Found                 | Bank slip not found for the given key (`{bank_slip_key}`).                                   | Boleto não encontrado para a chave fornecida (`{bank_slip_key}`).                                         |
| 400                    | BKS000032          | Bad Request               | Bank slip must be in 'registered' status.                                                    | O boleto deve possuir o status 'registered'.                                                              |
| 422                    | BKS000157          | Unprocessable Entity      | Could not find an account matching the provided split payment account data.                 | Não foi possível encontrar uma conta com os dados informados na regra de split payment.                   |
| 400                    | BKS000158          | Bad Request               | The beneficiary_max_amount must be greater than 0 and not greater than the bank slip amount. | O beneficiary_max_amount deve ser maior que 0 e não pode ser maior que o valor do boleto.                 |
| 400                    | BKS000159          | Bad Request               | Split payment rules with percentage equal to 0 require beneficiary_max_amount to be set.     | Regras de split payment com percentual igual a 0 exigem o campo beneficiary_max_amount preenchido.        |
| 400                    | BKS000160          | Bad Request               | Only one split payment rule with percentage equal to 0 is allowed.                           | É permitido apenas uma regra de split payment com percentual igual a 0.                                   |

---

# Amount

URL: /en/documentation/boletos/instrucoes/valor

The amount instruction allows changing the value of a bank slip, provided the bank slip has already been registered. If there is already a pending amount instruction awaiting confirmation for the bank slip in question, sending a new instruction is not allowed.

:::caution Attention!
If there is any amount instruction pending confirmation, sending a new instruction is not allowed.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip/ BANK_SLIP_KEY /amount
METHOD POST

### Path parameters

| Field                   | Type   | Description                                                    | Characters |
|-------------------------|--------|----------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format          | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key, in uuid v4 format           | 36         |
| `bank_slip_key`         | uuidv4 | Unique bank slip identification key, in uuid v4 format        | 36         |

Request Body

```json
{
    "request_control_key": "01234567-89ab-cdef-0123-456789abcdef",
    "amount": 150.50
}
```

### Request Body Params

| Field                      | Type    | Description                                                                        | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|------------|
| `request_control_key` *    | uuidv4  | Unique request identification key used by the client in uuid v4 format            | 36         |
| `amount` *                 | number  | New bank slip amount (must be different from the current amount)                  | -          |

:::caution Attention!
The amount must be different from the current bank slip amount and must have at most 2 decimal places.
:::

## Response

STATUS 202

Response Body

```json
{
  "occurrence_key": "5a745b65-9a2c-44eb-b43e-c80ef5429d94",
  "bank_slip_key": "fdafdffa-cbd4-4f3c-8e3d-990428305161"
}
```

### Response Body Params

| Field              | Type   | Description                                                                       | Characters |
|--------------------|--------|-----------------------------------------------------------------------------------|------------|
| `occurrence_key` * | uuidv4 | Unique occurrence (instruction) identification key in uuid v4 format             | 36         |
| `bank_slip_key` *  | uuidv4 | Unique bank slip identification key in uuid v4 format                            | 36         |

### Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 409                      | BKS000014            | Conflict | Request control key already sent or duplicated sent: `<request_control_key>` | Chave de controle da requisição já utilizada ou enviada duplicada: `<request_control_key>` |
| 400                      | BKS000022            | Bad Request                                        | Requester profile is not opened.                                                              | Carteira não está aberta.                          |
| 404                      | BKS000029            | Not Found                                        | Bank slip not found for the given key (`{bank_slip_key}`).                                                              | Boleto não encontrado para a chave fornecida (`{bank_slip_key}`).                          |
| 400                      | BKS000032            | Bad Request                                        | Bank slip must be in 'registered' status.                                                              | O boleto deve possuir o status 'registered'.                          |
| 409                      | BKS000135            | Conflict                                        | An amount occurrence already exists for this bank slip.                                                              | Já existe uma ocorrência de valor para este boleto.                          |
| 400                      | BKS000136            | Bad Request                                        | Only credit card financial instrument type can have zero amount.                                                              | Apenas o tipo de instrumento financeiro cartão de crédito pode ter valor zero.                          |
| 400                      | BKS000137            | Bad Request                                        | Amount must be different from bank slip amount.                                                              | O valor deve ser diferente do valor do boleto.                          |

---

# Introduction

URL: /en/documentation/boletos/introducao

The billing wallet is the service that allows the issuance of bank slips. There are various types of wallets, and each one defines how slips will be generated, the costs, settlement fees, credited account, and various configurations that will enable the bank to perform the correct billing. During the account opening at QI Tech, a wallet within QI and a wallet at Bradesco, with QI Tech's global billing configurations, are automatically available to the client.
Moreover, if the client is interested in the registration or modification of a wallet with different configurations from the global configuration, they can request the service from our team.

## How does slip issuance work?
QI Tech's APIs allow the abstraction of the life cycle of a slip through a state machine, where we have the following statuses:

### Registration Request
- accepted: Slip issuance request has entered the registration queue;
- rejected: Slip issuance request rejected, when the registration request contains a semantic error that prevents registration.

### Registration Completed
- registered: Slip registered and available for payment.

### Payment Notification
- payment_notice: Slip payment notice, this notification is sent when the slip is paid, but financial settlement has not yet occurred.
- notary_office_payment_notice: Slip payment notice, this notification is sent when the slip is paid at a notary office, but financial settlement has not yet occurred.

### Settlement
- paid: Slip paid - settled with financial settlement.
- written_off: Slip written off without financial settlement.

---

# List settlement groups

URL: /en/documentation/boletos/liquidacao/listar_grupos_de_liquidacao

:::info Information
In our system, settlement groups are a way to reconcile transactions with settled bank slips. This process (settlement) describes the transfer of a paid bank slip amount to the account that should receive this payment. In summary, whenever QI receives information that a bank slip has been paid by another bank or, in the case of protested bank slips, by the notary office, a settlement is created for that specific bank slip. Subsequently, **settlement groups** are created, which represent batches of settlements grouped by type.

At a later moment, the payment transaction for this settlement group is made to the client's account. The **transaction_key** of this transaction is then saved for reconciliation purposes, so you can see all the bank slips that were settled in a specific transaction. For example, if you have five R$ 5.00 bank slips each, where one was paid via notary office, one was paid via QR Code PIX and the other three were paid using the typed line or barcode by another bank, five settlements will be created for these bank slips. Then, these settlements will be grouped into three settlement groups: one of R$ 15.00 with the three bank slips paid using the typed line or barcode, for which a single transaction will be made, another of R$ 5.00 for the bank slip paid via QR Code PIX and the last one also of R$ 5.00 with the bank slip paid via notary office.
:::

The settlement groups listing will return all settlement groups of the account that fit the query parameters sent in the request.

## Request

ENDPOINT /account/ ACCOUNT_KEY /bank_slip_settlement_groups
METHOD GET

### Path parameters

| Field                   | Type   | Description                                                    | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key    | 36         |

### Query parameters

| Field                   | Type   | Description                                                    | Characters              |
|-------------------------|--------|--------------------------------------------------------------|-------------------------|
| `bank_slip_settlement_group_key`         | uuidv4 | Unique settlement group identification key   | 36                      |
| `transaction_key`             | uuidv4 | Unique settlement group transaction identification key                           | 36                                                |
| `bank_slip_settlement_group_status`      | string | Settlement group status | **[Enumerators bank_slip_settlement_group_status](#enumerators-bank_slip_settlement_group_status)** |
| `date_from`            | string    | Start date. Format "YYYY-MM-DD".                                      |
| `date_to`              | string    | End date. Format "YYYY-MM-DD".                                        |
| `page`                  | integer| Page number                                             | -                       |
| `page_size`             | integer| Page size                                            | -                       |

## Response

STATUS 200

Response Body

```json
{
    "data": [
        {
            "bank_slip_settlement_group_key": "5ba0b0cf-ac4a-4c91-819d-d6c46d70e3ab",
            "account_key": "96015228-4905-42fc-bda6-e70e0e552b6b",
            "transaction_key": "6704d927-9e0d-411d-8c44-c377c0c56637",
            "amount": 1069.24,
            "bank_slip_settlement_group_type": "notary_office",
            "bank_slip_settlement_group_status": "settled",
            "bank_slip_settlement_quantity": 1
        },
        {
            "bank_slip_settlement_group_key": "feda6069-c0cf-4148-b881-a475737330ab",
            "account_key": "96015228-4905-42fc-bda6-e70e0e552b6b",
            "transaction_key": "00d557de-78ca-4871-b254-2852499660e2",
            "amount": 2400.0,
            "bank_slip_settlement_group_type": "siloc",
            "bank_slip_settlement_group_status": "settled",
            "bank_slip_settlement_quantity": 303
        },
        {
            "bank_slip_settlement_group_key": "5493030c-ba1c-44de-9e85-5aaee0afe46d",
            "account_key": "96015228-4905-42fc-bda6-e70e0e552b6b",
            "transaction_key": "b42c4d0a-8060-41d7-bd00-17889cc76485",
            "amount": 250.0,
            "bank_slip_settlement_group_type": "siloc",
            "bank_slip_settlement_group_status": "settled",
            "bank_slip_settlement_quantity": 50
        },
        {
            "bank_slip_settlement_group_key": "f33c087d-cbae-47a9-bd5a-e6a8ecc04ed2",
            "account_key": "96015228-4905-42fc-bda6-e70e0e552b6b",
            "transaction_key": "6ee57aea-b589-4dff-9555-200c34380154",
            "amount": 4024800.0,
            "bank_slip_settlement_group_type": "str",
            "bank_slip_settlement_group_status": "settled",
            "bank_slip_settlement_quantity": 16
        },
        {
            "bank_slip_settlement_group_key": "27b9b2b7-549e-406e-9f41-c71e0cb08b00",
            "account_key": "96015228-4905-42fc-bda6-e70e0e552b6b",
            "transaction_key": "36aa7a00-6741-41d5-99e9-ce620fed5823",
            "amount": 300.0,
            "bank_slip_settlement_group_type": "split_payment",
            "bank_slip_settlement_group_status": "settled",
            "bank_slip_settlement_quantity": 1,
            "settlement_date": "2026-04-23"
        }
    ],
    "pagination": {
        "current_page": 1,
        "rows_per_page": 100
    }
}
```

### Response Body Params

| Field            | Type         | Description                             | Characters                                  |
|------------------|--------------|---------------------------------------|---------------------------------------------|
| `data`          | object array | Bank slips                               | **[Object bank_slip_settlement_group](#object-bank_slip_settlement_group)**   |
| `pagination`    | object       | Pagination information              | **[Object pagination](#object-pagination)** |

### Object bank_slip_settlement_group

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------|
| `bank_slip_settlement_group_key      `     | uuidv4  | Unique bank slip identification key in uuid v4 format                          | 36                                                |
| `account_key`     | uuidv4  | Unique account identification key | 36                                                |
| `transaction_key`             | uuidv4 | Unique settlement group transaction identification key                           | 36                                                |
| `amount`                  | float   | Total settled amount                                                               | -
| `bank_slip_settlement_group_type`      | string | Settlement group type | **[Enumerators bank_slip_settlement_group_type](#enumerators-bank_slip_settlement_group_type)** |
| `bank_slip_settlement_group_status`      | string | Settlement group status | **[Enumerators bank_slip_settlement_group_status](#enumerators-bank_slip_settlement_group_status)** |
| `bank_slip_settlement_quantity`              | integer  |  Number of settlements in the group  | - |

### Object pagination

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------------------|
| `current_page`            | integer | Current page                                                 | -      |
| `rows_per_page`           | integer | Items per page                                             | -      |

### Enumerators bank_slip_settlement_group_type

| Enumerator                   | Description                                                                    |
|------------------------------|------------------------------------------------------------------------------|
| siloc                        | for payment of securities (security value less than R$ 250,000)                          |
| qr_code                      | for payment of securities made via QR Code |
| str                          | for payment of VR securities (security value greater than R$ 250,000) |
| notary_office                | for payment of securities made via notary office             |
| split_payment                | settlement group destined to a recipient account from the bank slip's [**credit split**](/documentation/boletos/instrucoes/rateio_de_credito) |

:::tip Bank slips with credit split
When a bank slip has a [**credit split**](/documentation/boletos/instrucoes/rateio_de_credito) configured, payment generates one settlement group per recipient:
- The group for the **bank slip's beneficiary** keeps the original settlement flow type (`siloc`, `qr_code`, `str` or `notary_office`).
- The groups for the **split recipient accounts** are created with the `split_payment` type.

Each account involved (beneficiary and recipients) can list its own settlement group by calling this endpoint with its own `account_key` — this way, recipients can reconcile exactly how much they received from each bank slip.
:::

### Enumerators bank_slip_settlement_group_status

| Enumerator                   | Description                                                                    |
|------------------------------|------------------------------------------------------------------------------|
| pending                      | settlement group created but transaction not performed  |
| settled                      | settlement group created and transaction performed |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 400                      | BKS000095            | Bad Request | Invalid bank slip settlement group status.         |               Status de grupo de liquidação de boleto inválido. |

---

# List Settlements

URL: /en/documentation/boletos/liquidacao/listar_liquidacoes

:::info Information
In our system, **settlements** describe the transfer of value from a paid bank slip to the account that should receive that payment. In summary, whenever QI receives information that a bank slip has been paid by another bank or, in the case of protested bank slips, by the notary office, a settlement is created for that specific bank slip. Subsequently, settlement groups are created to which they will always be linked, representing batches of settlements grouped by type.

At a later moment, a payment transaction is performed for this settlement group to the client's account. The **transaction_key** of this transaction is then saved for reconciliation purposes, so you can see all bank slips that were settled in a specific transaction. For example, if you have five bank slips of R$ 5.00 each, where one was paid via notary office, one was paid via PIX QR Code, and the other three were paid using the barcode or typed line by another bank, five settlements will be created for these bank slips. Then, these settlements will be grouped into three settlement groups: one of R$ 15.00 with the three bank slips paid using the barcode or typed line, for which a single transaction will be performed, another of R$ 5.00 for the bank slip paid via PIX QR Code, and the last one also of R$ 5.00 with the bank slip paid via notary office.
:::

The settlement listing will return all settlements from the settlement group sent in the request.

## Request

ENDPOINT /account/ ACCOUNT_KEY /bank_slip_settlement_group/ BANK_SLIP_SETTLEMENT_GROUP_KEY /bank_slip_settlements
METHOD GET

### Path parameters

| Field                   | Type   | Description                                                    | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key    | 36         |
| `bank_slip_settlement_group_key`         | uuidv4 | Unique settlement group identification key   | 

## Response

STATUS 200

Response Body

```json
{
    "data": [
        {
            "settlement_key": "388eac3a-4138-421c-86af-f6fe3d1a9419",
            "amount": 4800.0,
            "account_key": "96015228-4905-42fc-bda6-e70e0e552b6b",
            "bank_slip_key": "d39e243b-8532-4006-9ffd-17607d5d1620",
            "barcode": "32991981000275000002269450000000043200779790"
        },
        {
            "settlement_key": "c3d7c62e-73fa-473f-b5a2-82e9b8a7f9bb",
            "amount": 1.0,
            "account_key": "96015228-4905-42fc-bda6-e70e0e552b6b",
            "bank_slip_key": "3088ffdd-dec0-4fa3-8643-995d6809a2e6",
            "barcode": "32999980300000001000001370000000000100828480"
        }
    ],
    "pagination": {
        "current_page": 1,
        "rows_per_page": 100
    }
}
```

### Response Body Params

| Field            | Type         | Description                             | Characters                                  |
|------------------|--------------|---------------------------------------|---------------------------------------------|
| `data`          | object array | Bank slips                               | **[bank_slip_settlement object](#bank_slip_settlement-object)**   |
| `pagination`    | object       | Pagination information              | **[pagination object](#pagination-object)** |

### bank_slip_settlement object

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------|
| `settlement_key      `     | uuidv4  | Unique settlement identification key                          | 36                                                |
| `account_key`     | uuidv4  | Unique account identification key | 36                                                |
| `amount`                  | float   | Settled amount                                                               | -
| `bank_slip_key      `     | uuidv4  | Unique bank slip identification key in uuid v4 format                          |
| `barcode`              | string  | Bank slip barcode                                                         |

### pagination object

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------------------|
| `current_page`            | integer | Current page                                                 | -      |
| `rows_per_page`           | integer | Items per page                                             | -      |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000008            | Bad Request | The source account is closed.         |               A conta de origem está fechada.                                                                 |
| 400                      | BKS000009            | Bad Request | The source account is blocked.         |               A conta de origem está bloqueada.                                                                 |
| 400                      | BKS000012            | Bad Request | Invalid integer value for page or size query string parameters. | Valor inválido para parâmetros de página ou tamanho de página. |
| 404                      | BKS000093            | Bad Request | Settlement group not found for the given key.         |   Grupo de liquidação não encontrado para a chave fornecida. |

---

# Scenario simulation

URL: /en/documentation/boletos/liquidacao/simulacao_de_cenarios_de_liquidacao

This page describes how to simulate the execution of actions performed by external agents to test the bank slip settlement flow. These simulations are useful for homologation and integration testing.

:::info Information
There is no return payload (response body) in these requests. They simulate external actions and return only the HTTP status.
:::

## 1 - Payment notice simulation

Simulates a bank slip payment notice, changing its status to `payment_notice`.

ENDPOINT /mock/bank_slip/payment_notice
METHOD POST

Request Body

```json
{
    "bank_slip_key": "0d00b0e2-af11-472f-11f0-11f3330bae33",
    "paid_amount": 12.0,
    "payment_method": "cash",
    "payment_type": "full_interbank"
}
```

### Request Body Object

| Field                            | Type    | Description                                                          | Max. Chars.  |
|----------------------------------|---------|----------------------------------------------------------------------|--------------|
| **bank_slip_key***               | string  | Bank slip unique key                                                 | 36           |
| **paid_amount**                  | float   | Payment amount. If not provided, uses the original bank slip value  | -            |
| **payment_method**               | string  | Payment method used                                                  | -            |
| **payment_type**                 | string  | Interbank payment type                                              | -            |

### payment_method Enumerators

| Enumerator      | Description                  |
|-----------------|------------------------------|
| `cash`          | Cash                         |
| `account_debit` | Account debit                |
| `credit_card`   | Credit card                  |
| `check`         | Check                        |

### payment_type Enumerators

| Enumerator              | Description                  |
|-------------------------|------------------------------|
| `full_interbank`        | Full interbank payment       |
| `partial_interbank`     | Partial interbank payment    |

:::tip Behavior
- If `paid_amount` is not provided, the original bank slip value will be used
- If `payment_type` is not provided, it will be considered as full payment (`full_interbank`)
- The simulation creates a payment notice occurrence
- The bank slip will be moved to `payment_notice` status after simulation
- **Important**: For `partial_interbank`, the bank slip status is not changed. This option is used to simulate cases of partial payment bank slips, as explained in the [introduction](/documentation/boletos/introducao)
:::

## 2 - Bank slip settlement simulation

Simulates payment and financial settlement of a bank slip, changing its status to `paid`.

ENDPOINT /mock/bank_slip/settlement
METHOD POST

Request Body

```json
{
    "bank_slip_key": "0d00b0e2-af11-472f-11f0-11f3330bae33",
    "paid_amount": 12.0,
    "payment_method": "cash"
}
```

### Request Body Object

| Field                            | Type    | Description                                                          | Max. Chars.  |
|----------------------------------|---------|----------------------------------------------------------------------|--------------|
| **bank_slip_key***               | string  | Bank slip unique key                                                 | 36           |
| **paid_amount**                  | float   | Settlement payment amount. If not provided, uses the original bank slip value | -            |
| **payment_method**               | string  | Payment method used                                                  | -            |

### payment_method Enumerators

| Enumerator      | Description                  |
|-----------------|------------------------------|
| `cash`          | Cash                         |
| `account_debit` | Account debit                |
| `credit_card`   | Credit card                  |
| `check`         | Check                        |

:::tip Behavior
- If `paid_amount` is not provided, the original bank slip value will be used
- The simulation creates a payment occurrence with code 65 (payment) by default
- The bank slip will be moved to `paid` status after simulation
:::

---

# Approve Boleto Payment

URL: /en/documentation/boletos/pagamento/aprovar_pagamento

## Request

ENDPOINT /bank_slip/payment_approval
METHOD POST

**body.json**

```json
{
    "operation_key": "0e241203-8c6b-4e0a-ac42-e0d2a2fc2d37",
    "feedback": True
}

```

### Body params

| Field | Type | Description | Characters |
|---|---|---|---|
| `operation_key` *| string  | Key delivered when the payment was created (key parameter from the response). | uuid  |
| `feedback` | string  | Boolean for transfer approval or rejection: "true" or "false". | -  |

## Response

STATUS 200

Response Body

```json
{
    "data": {
        "error_list": [],
        "successful_feedback_list": [
            {
                "account_key": "21af482f-b8ac-48dd-8f9a-ea23429d28be",
                "approval_feedback": true,
                "movement_amount": 10.0,
                "movement_data": {
                    "digitable_line": "09990001029100010009895007444201283400000001000",
                    "resource_account_key": "21af482f-b8ac-48dd-8f9a-ea23429d28be"
                },
                "movement_date": "2020-08-06",
                "movement_info": null,
                "movement_request_key": "c154b5bf-66ac-4b37-b365-a4c05e68785b",
                "movement_status": "approved",
                "movement_type": "bank_slip_payment",
                "requester_key": "ba99b7f1-3db6-4a63-a386-ba2c7f31e784"
            }
        ]
    },
    "event_datetime": "2020-08-06 19:23:00",
    "key": "9a1eedb3-da45-418c-89e9-28459d4c51ed",
    "status": "ok",
    "webhook_type": "bank_slip_payment_approval"
}

```

STATUS 400

Response Body

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

---

# Consultar linha digitável de boleto

URL: /en/documentation/boletos/pagamento/consulta_linha_digitavel

## Request

ENDPOINT /bank_slip/payment
MÉTODO GET

### Query params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `digitable_line` *| string |  Linha digitável do boleto. | 48 | 

## Response

STATUS 200

Response Body

```json
{
  "barcode": "31893833500000835480005050500512130021164946",
  "beneficiary_bank_code": "318",
  "beneficiary_document_number": "61902722000126",
  "beneficiary_legal_name": "Sport Club Corinthians Paulista",
  "beneficiary_person_type": "legal",
  "calculated_internally": true,
  "calculation_date": "2020-08-05",
  "calculation_model": 1,
  "digitable_line": "31890005025050051213700211649462383350000083548",
  "discount_amount": "0",
  "expiration_date": "2020-08-02",
  "expired_as_of_payment_date": true,
  "expired_as_of_today": true,
  "factual_expiration_date": "2020-08-03",
  "fine_amount": "16.71",
  "guarantor_document": null,
  "guarantor_name": null,
  "interest_amount": "0",
  "max_payment_date": "2020-08-08",
  "nominal_amount": "835.48",
  "payer_document_number": "15676407883",
  "payer_legal_name": "LUCIANO RENATO MOREIRA",
  "payer_person_type": "natural",
  "payment_date": "2020-08-05",
  "rebate_amount": "0.0",
  "total_amount": "852.19",
  "valid_payment_amount": true,
  "valid_payment_calculation": true,
  "valid_payment_time_frame": true
}

```

STATUS 400

Response Body

```json
{
  "code": "BLP000142",
  "title": "Bad Request",
  "description": "This digitable line is out of minimum or maximum length.", 
  "translation": "Esta linha digitável está fora do comprimento mínimo ou máximo.",
  "extra_fields": {}
}
```

STATUS 400

Response Body

```json
{
  "code": "BLP000141",
  "title": "Bad Request",
  "http_status": 400,
  "description": "The given digitable_line must have only numbers.",
  "translation": "A linha digit\u00e1vel fornecida deve conter somente n\u00fameros.",
  "extra_fields": {}
}
```

STATUS 400

Response Body

```json
{
  "code": "BLP000012",
  "title": "Bad Request",
  "http_status": 400,
  "description": "Missing mandatory parameter: digitable_line",
  "translation": "Par\u00e2metro obrigat\u00f3rio ausente: digitable_line",
  "extra_fields": {}
}
```

STATUS 422

Response Body

```json
{
  "code": "IPP000014",
  "title": "Invalid Barcode",
  "http_status": 422,
  "description": "Invalid barcode",
  "translation": "O Código de barras é inválido",
  "extra_fields": {}
}
```

STATUS 422

Response Body

```json
{
  "code": "IPP000022",
  "title": "Unprocessable Entity",
  "http_status": 422,
  "description": "Covenant not accepted",
  "translation": "Convênio não aceito",
  "extra_fields": {}
}
```

STATUS 422

Response Body

```json
{
  "code": "IPP000023",
  "title": "Unprocessable Entity",
  "http_status": 422,
  "description": "Max retries exceeded, while trying to complete payment.",
  "translation": "Número máximo de tentativas excedido, ao tentar concluir o pagamento.",
  "extra_fields": {}
}
```

STATUS 422

Response Body

```json
{
  "code": "IPP000017",
  "title": "Unprocessable Entity",
  "http_status": 422,
  "description": "The tax collection is overdue",
  "translation": "A arrecadação está vencida",
  "extra_fields": {} 
}
```

### Response Params
| Campo | Tipo | Descrição                                 | Caracteres |
| --- | -- |--------------------------------------------------------------------| --- |
|`barcode`| string | Código de barras do boleto. | 44 |
|`beneficiary_bank_code`| string | Código de bancário do banco que registrou o boleto. | 3 |
|`beneficiary_document_number`| string | CPF/CNPJ do beneficiário (recebedor) do boleto. Também é o CPF/CNPJ do titular da conta onde o boleto foi registrado. | 14 |
|`beneficiary_legal_name`| string | Nome do beneficiário (recebedor) do boleto. Também é o nome do titular da conta onde o boleto foi registrado. | - |
|`beneficiary_person_type`| enum | Natureza Jurídica do beneficiário (recebedor) do boleto. Também é a natureza jurídica do titular da conta onde o boleto foi registrado. | [Enumerador person_type](#enumeradores-person_type) |
|`calculated_internally`| boolean | Indica se o calculo foi realizado pela QI Tech ou não. | - |
|`calculation_date`| string | Data de referência do calculo de multa e juros do boleto. | 10 |
|`calculation_model`| int | Modelo de calculo utilizado no calculo de multa e juros do boleto. Este campo é informado pelo banco que registrou o boleto. | [Códigos calculation_model](#codigos-calculation_model) |
|`digitable_line`| uuid | Linha digitável do boleto. | 47 |
|`discount_amount`| string | Valor do desconto de pontualidade do boleto. | - |
|`expiration_date`| string | Data de vencimento do boleto. | 10 |
|`expired_as_of_payment_date`| boolean | Informa se o boleto estará vencido na data de agendamento do pagamento (Campo pode ser ignorado). | 10 |
|`expired_as_of_today`| string | Informa se o boleto esta vencido na data de hoje. | 10 | 
|`factual_expiration_date`| string | Data de vencimento do boleto em dia útil. Por exemplo, se o boleto tiver vencimento em `2023-12-16` este campo terá o valor informado `2023-12-18`. | 10 |
|`fine_amount`| string | Valor calculado de multa do boleto. | - |
|`guarantor_document`| string | CPF/CNPJ do sacador avalista do boleto. | 14 |
|`guarantor_name`| string | Nome do sacador avalista do boleto. | - |
|`interest_amount`| string | Valor de juros calculado após o vencimento do boleto. | - |
|`max_payment_date`| string | Data limite de pagamento do boleto. | 10 |
|`nominal_amount`| string | Valor original do boleto. | - |
|`payer_document_number`| string | CPF/CNPJ do pagador do boleto. | 14 |
|`payer_legal_name`| string | Nome do pagador do boleto. | 14 |
|`payer_person_type`| enum | Natureza jurídcia do pagador do boleto. | [Enumerador person_type](#enumeradores-person_type) |
|`payment_date`| string | Data do pagamento do boleto. | 10 |
|`rebate_amount`| string | Valor de abatimento no boleto. | - |
|`total_amount`| string | Valor do total do boleto (com juros, multa, abatimento e desconto). | - |
|`valid_payment_amount`| boolean | Informa se o valor de pagamento é válido (será sempre `true`). | - |
|`valid_payment_calculation` | boolean | Informa se o valor calculado pelo banco registrador do boleto é válido (quando o `calculation_model` for `2` ou `3`). | - |
|`valid_payment_time_frame` | boolean | Informa se a data de agendamento do pagamento é menor que a data máxima para pagamento do boleto. | - |

### Enumeradores person_type 
| Enumerador | Descrição |
| --- | -- |
| `natural` | Pessoa física |
| `legal` | Pessoa jurídica |

### Códigos calculation_model
| Enumerador | Descrição |
| --- | -- |
| 1 | Instituição pagadora do boleto calcula os valores de juros e multa do boleto (Caso seja informado no boleto consultado, o campo `calculated_internally` será retornado como `true`). |
| 2 | Instituição que registrou o boleto calcula os valores de juros e multa. Após a data de vencimento do boleto, a instituição atualiza os valores diariamente na base centralizada de boleto. |
| 3 | Instituição que registrou o boleto calcula o valor do boleto. A instituição atualiza o valor do boleto diariamente na base centralizada de boleto. |

## Ambiente de Sandbox

### Boletos de convênio/tributos

Os boletos de convênio/tributos são emitidos por órgãos governamentais, como prefeituras, governos estaduais ou federais, para a cobrança de impostos, taxas, contribuições sociais, multas, e outros valores devidos ao governo.

Em nosso ambiente de sandbox, disponibilizamos linhas digitáveis mockadas para a simulação de pagamentos bem-sucedidos e testes de cenários de erro.

### Cenários de sucesso

| Linha digitável |
|---|
| 828300000007411100972013905080001546763201900028 |
| 838000000009235700481007241345219112001474229880 |
| 848000000006308600802021201071261517689002201070 |
| 858200000015000000643025703477209504800448091020 |

### Cenários de erro

| Linha digitável | Código de erro |
|---|---|
| 858500000037350000643217212883260006147448091022 | IPP000014 |

### Boleto bancário

Um boleto bancário, também conhecido como boleto ou bloqueto, é um documento muito usado no Brasil para pagar por produtos ou serviços. Com um boleto, a pessoa ou empresa que o emite pode receber o dinheiro que está sendo cobrado do pagador.

Em nosso ambiente de sandbox, disponibilizamos linhas digitáveis mockadas para a simulação de pagamentos bem-sucedidos.

### Cenários de sucesso

| Linha digitável |
|---|
| 32990001039000210987502864982109595090000063958 |
| 32990001039000000006836762871105695090000010000 |
| 32990001031000699960099000000200195070000025527 |
| 32990001039000000000103194237800895060001000000 |
| 32990001031000699960095000000208497790000030990 |

---

# Realizar pagamento de boleto

URL: /en/documentation/boletos/pagamento/realizar_pagamento

### Request

ENDPOINT /bank_slip/payment
METHOD POST

Request Body

```json
{
    "digitable_line": "42297034020000453753620034706323183380000005000",
    "resource_account_key": "21af482f-b8ac-48dd-8f9a-ea23429d28be",
    "payment_date": "2020-08-05"
}

```

#### Body params

| Field | Type | Description | Characters |
|---|---|---|---|
| `digitable_line` *| string  | Boleto digitable line. | 10 |
| `resource_account_key` *| string | Key of the account to be used. | 10 |
| `payment_date` | date | Date for payment execution. If not sent, the date will be today. | 10 |

:::info Information

To view accepted payment covenants, [click here](https://storage.googleapis.com/live-doc-api/public_samples/active_covenants.xlsx).

:::

### Response

STATUS 200

Response Body: Payment through a free account

```json
{
    "data": {
        "digitable_line": "09990001029100010009895007444201283400000001000",
        "resource_account_key": "21af482f-b8ac-48dd-8f9a-ea23429d28be"
    },
    "event_datetime": "2020-08-06 19:22:06",
    "key": "e7719f95-a31d-4171-ae83-2d8b3d419dc2",
    "status": "success",
    "webhook_type": "bank_slip_payment"
}
```

STATUS 200

Response Body: Payment through an escrow account

```json
{
    "data": {
        "digitable_line": "09990001029100010009895007444201283400000001000",
        "resource_account_key": "21af482f-b8ac-48dd-8f9a-ea23429d28be"
    },
    "event_datetime": "2020-08-06 19:22:06",
    "key": "e7719f95-a31d-4171-ae83-2d8b3d419dc2",
    "status": "waiting_approval",
    "webhook_type": "bank_slip_payment"
}

```

STATUS 400

Response Body

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

STATUS 423 - Payment outside operating hours

Response Body

```json
{
	"code": "BLP000024",
	"title": "Locked",
	"http_status": 423,
    "description": "Operation window closed. System available from {OPENING_TIME} to {CLOSING_TIME}",
    "translation": "Opera\u00e7\u00e3o encerrada. Sistema dispon\u00edvel de {OPENING_TIME} a {CLOSING_TIME}",
	"extra_fields": {
		"next_available_datetime": "2023-08-13T18:00:00.000Z"
	}
}
```

STATUS 400

Response Body

```json
{
  "code": "IPP000015",
  "title": "Bad Request",
  "http_status": 400,
  "description": "Invalid amount",
  "translation": "O valor inserido é inválido",
  "extra_fields": {} 
}
```

STATUS 422

Response Body

```json
{
  "code": "IPP000013",
  "title": "Incompatible Payment Value",
  "http_status": 422,
  "description": "The input amount does not match tax collection value",
  "translation": "O valor do pagamento é diferente da arrecadação",
  "extra_fields": {} 
}
```

STATUS 422

Response Body

```json
{
  "code": "IPP000012",
  "title": "Tax Collection Already Paid",
  "http_status": 422,
  "description": "This tax collection is already paid",
  "translation": "A arrecadação já foi paga",
  "extra_fields": {} 
}
```

STATUS 422

Response Body

```json
{
  "code": "IPP000017",
  "title": "Unprocessable Entity",
  "http_status": 422,
  "description": "The tax collection is overdue",
  "translation": "A arrecadação está vencida",
  "extra_fields": {} 
}
```

STATUS 422

Response Body

```json
{
  "code": "IPP000023",
  "title": "Unprocessable Entity",
  "http_status": 422,
  "description": "Max retries exceeded, while trying to complete payment.",
  "translation": "Número máximo de tentativas excedido, ao tentar concluir o pagamento.",
  "extra_fields": {}
}
```

STATUS 422

Response Body

```json
{
  "code": "IPP000024",
  "title": "Unprocessable Entity",
  "http_status": 422,
  "description": "Error while processing payment output. Try again.",
  "translation": "Erro ao processar a saída do pagamento. Tente novamente.",
  "extra_fields": {}
}
```

STATUS 422

Response Body

```json
{
  "code": "IPP000025",
  "title": "Unprocessable Entity",
  "http_status": 422,
  "description": "Outside of covenant payment hours.",
  "translation": "Fora do horário de pagamento do convênio.",
  "extra_fields": {}
}
```

## Sandbox Environment

### Covenant/Tax Boletos

Covenant/tax boletos are issued by government agencies, such as city halls, state or federal governments, to collect taxes, fees, social contributions, fines, and other amounts owed to the government.

In our sandbox environment, we provide mocked digitable lines for simulating successful payments and error scenario testing.

#### Success Scenarios

| Digitable line |
|---|
| 828300000007411100972013905080001546763201900028 |
| 838000000009235700481007241345219112001474229880 |
| 848000000006308600802021201071261517689002201070 |
| 858200000015000000643025703477209504800448091020 |

#### Error Scenarios

| Digitable line | Error code |
|---|---|
| 858900000034050002701002700011434710592720230733 | IPP000015 |
| 858400000000750002701007700011434710592720230733 | IPP000013 |
| 858800000040450004322322120716192390688090088931 | IPP000012 |
| 858900000000350004322326120716192390688090083760 | IPP000014 |

### Bank Slip (Boleto bancário)

A bank slip (boleto bancário), also known as boleto or bloqueto, is a document widely used in Brazil to pay for products or services. With a boleto, the issuer or company can receive the amount owed from the payer.

In our sandbox environment, we provide mocked digitable lines for simulating successful payments.

#### Success Scenarios

| Digitable line |
|---|
| 32990001039000210987502864982109595090000063958 |
| 32990001039000000006836762871105695090000010000 |
| 32990001031000699960099000000200195070000025527 |
| 32990001039000000000103194237800895060001000000 |
| 32990001031000699960095000000208497790000030990 |

---

# Bank Slip Settlement Account Redirection

URL: /en/documentation/boletos/redirecionamento_de_conta_de_liquidacao

This endpoint will be used to change the settlement account of a bank slip registered in QI Tech.

:::caution Attention! 
  - The bank slip remains registered in the original account, which must remain open while there are bank slips registered in it;
  - Webhooks will continue to be sent to the integrating partner of the original account;
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip/ BANK_SLIP_KEY /settlement_account
METHOD PATCH

### Path parameters

| Field                   | Type   | Description                                                    | Characters |
|-------------------------|--------|----------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique identification key of the account in which the bank slip was issued | 36 |
| `requester_profile_key` | uuidv4 | Unique identification key of the wallet| 36 |
| `bank_slip_key`         | uuidv4 | Unique identification key of the bank slip | 36 |

Request Body

```json
{
  "settlement_account_key": "614a451d-3b82-460e-bcc0-2caf3dde711f"
}
```

### Request Body Params

| Field                        | Type    | Description                                             | Characters |
|------------------------------|---------|--------------------------------------------------------|------------|
| `settlement_account_key` *   | uuidv4  | Unique key that identifies the new settlement account | 36         |

## Response

STATUS 204

Response Body

```json
{}
```

### Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title` | Description (eng)<br/>`description`                                                                  | Description (pt-br)<br/>`translation`                                                                       |
|--------------------------|----------------------|--------------------|----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request        | Schema Error                                                                                       | Schema Inválido                                                                                           |
| 404                      | BKS000025            | Not Found          | The source account key was not found.                                                              | A chave da conta de origem não foi encontrada.                                                            |
| 400                      | BKS000007            | Bad Request        | It was not possible to consult the source account at this time. Please try again in a few minutes. | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos. |
| 400                      | BKS000008            | Bad Request        | The source account is closed.                                                                      | A conta de origem está fechada.                                                                           |
| 400                      | BKS000009            | Bad Request        | The source account is blocked.                                                                     | A conta de origem está bloqueada.                                                                         |
| 404                      | BKS000013            | Not Found          | Requester profile not found                                                                        | Carteira não encontrada                                                                                   |
| 400                      | BKS000022            | Bad Request        | Requester profile is not opened.                                                                   | Carteira não está aberta.                                                                                 |
| 404                      | BKS000029            | Not Found          | Bank slip not found for the given key (`{bank_slip_key}`).                                         | Boleto não encontrado para a chave fornecida (`{bank_slip_key}`).                                         |                           |
| 400                      | BKS000032            | Bad Request        | Bank slip must be in 'registered' status.                                                          | O boleto deve possuir o status 'registered'.                                                              |
| 400                      | BKS000052            | Bad Request        | Invalid account status.                                                                            | Status da conta inválido.                                                                                 |

---

# List discharge files

URL: /en/documentation/boletos/retorno/listar_arquivos_retorno

:::info
The files provided in the URLs returned by this endpoint follow the QI Tech Return File Layout standard with 400 positions.
Download the manual here: [Layout de Cobrança - QI Tech versão 2.1.](https://storage.googleapis.com/live-doc-api/public_samples/Layout%20de%20Cobran%C3%A7a%20-%20QI%20Tech%20v2.1.pdf)
:::

Discharge files are used for reconciliation. Each Transaction Record line (Type 1) refers to an instruction (whether for issuance, extension, discount, etc.) that was confirmed or rejected by CIP/Nuclea on the previous day.

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /discharge_files
METHOD GET

### Path parameters

| Field                   | Type   | Description                                                    | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key    | 36         |
| `requester_profile_key` | uuidv4 | Unique wallet identification key, in uuid v4 format | 36         |

### Query parameters

| Field                   | Type   | Description                                                    | Characters              |
|-------------------------|--------|--------------------------------------------------------------|-------------------------|
| `discharge_file_key`         | uuidv4 | Unique discharge file identification key, in uuid v4 format   | 36                      |
| `page`                  | integer| Page number                                             | -                       |
| `page_size`             | integer| Page size                                            | -                       |
| `from_date`             | string| Start date (format "YYYY-MM-DD")                           | 10                      |
| `to_date`               | string| End date (format "YYYY-MM-DD")                             | 10                      |

## Response

STATUS 200

Response Body

```json
{
    "data": [
        {
            "discharge_file_key": "f1a8fe59-29cd-49e5-8d18-55194869b45c",
            "discharge_file_name": "CB15102401.RET",
            "discharge_file_url": "https://storage.googleapis.com/local-bank-slip-api/2024/61a746ca-05bf-429d-99c3-3fba0f9fbea7/329-20-7336-3073959/discharge/CB15102401.RET",
            "reference_date": "2024-10-15"
        }
    ],
    "pagination": {
        "current_page": 1,
        "rows_per_page": 100
    }
}
```

### Response Body Params

| Field            | Type         | Description                             | Characters                                  |
|------------------|--------------|---------------------------------------|---------------------------------------------|
| `data`          | object array | Discharge files                               | **[discharge_file object](#discharge_file-object)**   |
| `pagination`    | object       | Pagination information              | **[pagination object](#pagination-object)** |

### discharge_file object

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------|
| `discharge_file_key      `     | uuidv4  | Unique discharge file identification key in uuid v4 format                          | 36                                                |
| `discharge_file_name`     | string  | Discharge file name | -                                                |
| `discharge_file_url`             | string | Discharge file URL                           | -                                                |
| `reference_date`                  | string   | Discharge file reference date in YYYY-MM-DD format                                                               | 10 |

### pagination object

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------------------|
| `current_page`            | integer | Current page                                                 | -      |
| `rows_per_page`           | integer | Items per page                                             | -      |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 403                      | BKS000005            | Forbidden                         | User is not allowed to do this action | Usuário não tem autorização para fazer essa ação |
| 404                      | BKS000006            | Not Found                                  | The source account key was not found.                                                                                | A chave da conta de origem não foi encontrada.                                                                           |
| 400                      | BKS000007            | Bad Request                                  | It was not possible to consult the source account at this time. Please try again in a few minutes.                                                                                      | Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.                                                                                    |
| 400                      | BKS000012            | Bad Request | Invalid integer value for page or size query string parameters. | Valor inválido para parâmetros de página ou tamanho de página. |
| 404                      | BKS000013            | Not Found | Requester profile not found         |               Carteira não encontrada                                                                 |
| 400                      | BKS000052            | Bad Request        | Invalid account status.                                                                            | Status da conta inválido.                                                                                 |

---

# BolePix Issuance

URL: /en/documentation/boletos/v1/emissao/emissao_de_um_bolepix

:::caution Attention
Before registering a bolePix, it is necessary that an active Random Pix Key exists in the account where the bank slip will be registered.
:::

At QI Tech, it is possible to issue a bank slip linked to a Pix QR Code.

This way, the payer can make the payment of the bank slip through the typable line of the registered bank slip or through reading the Pix QR Code linked to this bank slip.

In cases where the payer makes the payment through reading the Pix QR Code, the financial settlement of the payment will be instantaneous, with bank returns as well as webhooks regarding the settlement of this bank slip being generated in the same way as a common bank slip.

## Request

ENDPOINT /multibank_instruction
METHOD POST

Request Body

```json
{
	"occurrences": [{
		"amount": 1000,
		"automatic_bankruptcy_protest": false,
		"bank_teller_instructions": "Não pagar após vencimento.",
		"beneficiary_account_key": "8a35e639-8420-4f6c-9647-c2515e5381ef",
		"beneficiary_key": "3c866e34-23fe-46c2-a8b0-e39ca4348923",
		"days_to_bankruptcy_protest": 0,
		"document_number": "123456/01",
		"expiration": "2020-06-01",
		"fine_percentage": "3",
		"interest_daily_value": "0.34",
		"occurrence_type": "registration",
		"payer_address": "Rua Carlos Sampaio, 123",
		"payer_document": "41184562067",
		"payer_name": "João Ninguem",
		"payer_person_type": "natural",
		"payer_postal_code_root": "15800",
		"payer_postal_code_suffix": "020",
		"printing_policy": "no_printing",
		"registration_institution_enumerator": "qi_scd",
		"requester_profile": "09",
		"requester_profile_code": "329-09-0001-0000002",
        "pix_key": "1684629c-d52a-4941-92f5-410907316129" 
	}]
}
```

### Query params

| Field | Type | Description                                                                                                                                                                                                                                                                                           | Characters |
|---|---|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|
| `use_multi_process` | boolean | Indicates whether the processing of registration occurrences will be sent for queue processing or if they will be processed sequentially. If this parameter is set to `true`, it is mandatory to send our bank number `our_number` in the registration occurrence payload. | -          | 

### Body params

| Field | Type | Description | Characters |
|---|---|---|---|
| `occurrences` * | array of objects | List of occurrences to be processed. | **[Occurrences object](#occurrences-object)** |

### Occurrences object

| Field                                | Type             | Description                                                                                                                                               | Characters                                      |
|--------------------------------------|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------|
| `amount` *                           | double           | Bank slip amount.                                                                                                                                        | -                                               |
| `automatic_bankruptcy_protest`       | boolean          | Automatic protest configuration.                                                                                                                    | -                                               |
| `bank_teller_instructions`           | string           | Teller instructions (Bank slip message/observations).                                                                                                   | -                                               |
| `beneficiary_account_key`            | string           | Beneficiary account key.                                                                                                                         | -                                               |
| `beneficiary_key`                    | string           | Beneficiary key.                                                                                                                                  | -                                               |
| `days_to_bankruptcy_protest`         | int              | Number of days for automatic bankruptcy protest submission.                                                                                            | -                                               |
| `document_number`                    | string           | Document number.                                                                                                                                    | -                                               |
| `expiration` *                       | string           | Due date.                                                                                                                                     | -                                               |
| `fine_percentage`                    | string           | Fine percentage                                                                                                                                    | -                                               |
| `interest_daily_value`               | string           | Daily interest value in reais                                                                                                                         | -                                               |
| `occurrence_type` *                  | string           | Occurrence type.                                                                                                                                     | -                                               |
| `payer_address`                      | string           | Payer address.                                                                                                                                    | -                                               |
| `payer_document` *                   | string           | Payer document (CPF or CNPJ).                                                                                                                     | -                                               |
| `payer_name` *                       | string           | Payer name.                                                                                                                                        | -                                               |
| `payer_person_type` *                | string           | Payer person type.                                                                                                                                 | -                                               |
| `payer_postal_code_root`             | string           | The first five digits of the ZIP code.                                                                                                                      | -                                               |
| `payer_postal_code_suffix`           | string           | The last three digits of the ZIP code.                                                                                                                  | -                                               |
| `printing_policy`                    | string           | Bank slip printing policy                                                                                                                         | -                                               |
| `registration_institution_enumerator` * | string           | Will always be `qi_scd`.                                                                                                        | `qi_scd`                                               |
| `requester_profile` *                | string           | Portfolio number.                                                                                                                                     | 02                                              |
| `requester_profile_code` *           | string           | Portfolio code composed as follows: "329-portfolio-agency-7_digit_account". NOTE: QI Tech's default collection portfolio is number "09". | -                                               |
| `notification`                       | object           | Portfolio number.                                                                                                                                     | **[Notification object](#notification-object)** |  
| `discounts`                          | object | List of objects with discount information.                                                                                                           | **[Discounts object](#discounts-object)**       |  
| `guarantor_name`                     | string           | Guarantor name.                                                                                                                               | -                                               |
| `guarantor_document_root`            | string           | Guarantor CNPJ base.                                                                                                                       | -                                               |
| `guarantor_document_subsidiary`      | string           | Parent or subsidiary CNPJ information.                                                                                                                 | -                                               |
| `guarantor_document_digit`           | string           | CNPJ verification digit.                                                                                                                             | -                                               |
| `pix_key` * | string           | Pix key where the Pix QR Code linked to the bolePix will be registered.                                                                                      | 100                                             |

:::info "***pix_key***" Field
The "***pix_key***" can be a **CPF**, **CNPJ**, **Email**, **Phone** or a **Random Key** (UUID), following these formats:

**CPF:** Integer number with 11 digits.

**CNPJ:** Integer number with 14 digits.

**Email:** Text containing at least one "@".

**Phone:** Text containing the following values: "+55" + "Phone area code" + "Integer phone number with minimum 8 and maximum 9 digits". Ex: "+5511987654321".

**Random Key:** UUID.
:::

### Notification object
| Field | Type | Description | Characters |
|---|---|---|---|
| `document_number` * | string | Document number of the user who will receive the notification. | - |
| `email` * | string | Email of the user who will receive the notification. | - |
| `name` * | string | Name of the user who will receive the notification.| - |
| `phone` * | object | Object containing phone information of the user who will receive the notification. |  **[Phone object](#phone-object)** |  
| `send_2_way` * | boolean | Send duplicate copy issuance notifications. | true/false |  
| `send_after_due_date` * | boolean | Send notifications after the bank slip due date. | true/false |
| `send_before_due_date` * | boolean | Send notifications before the bank slip due date. | true/false |
| `send_on_protest` * | boolean | Send protest notifications. | true/false|

### Phone object 

| Field | Description | Example |  Max Characters | 
| --- | --- | --- | --- | 
|`country_code` | string | Phone DDI code (https://ddi.guiamais.com.br/) | 3 | 
| `area_code` | string | Phone DDD code (https://ddd.guiamais.com.br/) | 2 |
| `number` | string |Phone number (numbers only) |  10 |

### Discounts object 
| Field | Description | Example |  Max Characters | 
| --- | --- | --- | --- | 
|`discount_value` | float | Discount value.| 3 | 
| `discount_number` | int32 | Order in which the discount should be applied. | 2 |
| `discount_limit_date` | date | Discount limit date. |  10 |

## Response

STATUS 200

Response Body

```json
{
  "bank_slips": [
    {
      "amount": "649.73",
      "bank_slip_key": "4bc636d0-1e41-4ce6-801c-475814bf4dcf",
      "bank_slip_status": "accepted",
      "barcode": "32991916500000649730001090000699935200347340",
      "beneficiary_account_key": "1c977186-9167-4ef1-b27d-08483429f74c",
      "beneficiary_key": "f01d4877-b1cc-4f4a-a8f9-952c2cef9ca8",
      "digitable_line": "32990001039000069993552003473403191650000064973",
      "expiration": "2022-11-10",
      "nfe_key": null,
      "nfe_url": null,
      "our_number": 6999352,
      "participant_control_number": null,
      "payer_postal_code": "38050000",
      "protest_status": "not_protested",
      "qr_code": {
        "pix_key": "9de04466-0b02-4263-9c28-9cdc0fb638bb",
        "qr_code_key": "881979cb-1c15-4dea-a05e-316caae22f5e",
        "qr_code_url": "00020126970014br.gov.bcb.pix2575qrcode-h.sandbox.qitech.app/bacen/cobv/881979cb-1c15-4dea-a05e-316caae22f5e5204000053039865802BR5925LOTEAMENTO RESIDENCIAL PO6014PORTO NACIONAL61087750000062070503***630414B8"
      }
    }
  ],
  "file_info": {
    "beneficiary_code": null,
    "beneficiary_name": null,
    "file_sequence_id": null,
    "file_type_identifier": null,
    "file_type_literal": null,
    "service_code": null,
    "service_literal": null,
    "wrote_at": null
  },
  "occurrence_stats": {
    "bank_slip_edit": 0,
    "bankruptcy_protest_request": 0,
    "cancel_rebate": 0,
    "extension": 0,
    "notary_office_entry": 0,
    "notary_office_exit": 0,
    "notary_office_payment": 0,
    "notification": 0,
    "payment": 0,
    "payment_notice": 0,
    "payment_write_off": 0,
    "protest_cancel_and_write_off_request": 0,
    "protest_cancel_request": 0,
    "protest_remove_request": 0,
    "protest_request": 0,
    "rebate": 0,
    "registration": 1,
    "write_off": 0
  },
  "semantic_errors": []
}

```

STATUS 400

Response Body

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

### Response Params
| Field | Type | Description                                 | Characters |
| --- | -- |--------------------------------------------------------------------| --- |
|`bank_slips` | list | List with information of registered bank slips if the `use_multi_process` parameter is set to `false`. | [Bank Slip Object](#bank_slip-object) | 
| `file_info` | list | File information.                            | [File Info Object](#file-info-object) |
| `occurrence_stats` | object | File information.                            | [File Info Object](#file-info-object) |
| `semantic_errors` | list | List of errors in processing each bank slip. Will be returned if there is any processing error and if the `use_multi_process` parameter is set to `false`. | [Semantic Error Object](#semantic-error-object) |

### Bank_slip object
| Field | Type | Description                                 | Characters |
| --- | -- |--------------------------------------------------------------------| --- |
|`amount` | float | Bank slip amount. | - |
|`bank_slip_key` | uuid | Unique identification key of the bank slip at QI Tech. | 36 |
|`bank_slip_status` | enum | Unique identification key of the bank slip at QI Tech. | [Bank_slip_status Enumerators](#bank_slip_status-enumerators) |
|`barcode` | string | Bank slip barcode. | 44 |
|`beneficiary_account_key` | uuid | Unique identification key of the account where the bank slip was registered. | 36 |
|`beneficiary_key` | uuid | Unique identification key of the account holder where the bank slip was registered. | 36 |
|`digitable_line` | uuid | Bank slip typable line. | 47 |
|`expiration` | string | Bank slip due date. | 10 |
|`nfe_key` | string | Unique identification key of the electronic invoice. | - |
|`nfe_url` | string | Electronic invoice URL. | - |
|`our_number` | int | Our bank number. It is a sequential identification number of this bank slip in relation to the account (collection portfolio) where it was registered. Its value can be provided in the bank slip registration request. If not provided, QI Tech will generate a value for this field (being an incremental value, ex: 1st bank slip registered in the account will have an `our_number` value of 1, the 16th bank slip registered in the account will have an `our_number` value of 16). | - 
|`participant_control_number` | string | Participant control number. | 10 |
|`payer_postal_code` | string | Bank slip payer ZIP code. | 8 |
|`protest_status` | string | Bank slip protest status, if protest has been requested. | [Protest_status Enumerators](#protest_status-enumerators) |
|`qr_code` | object | Object with information of the Pix QR Code linked to the bank slip. | [Qr_code object](#qr_code-object) |

### Qr_code object
| Field | Type | Description                                 | Characters |
| --- | -- |--------------------------------------------------------------------| --- |
|`pix_key` | string | Pix key where the Pix QR Code linked to the bank slip was registered. | 100 |
|`qr_code_key` | uuid | Unique identification key of the Pix QR Code linked to the bank slip. | 36 |
|`qr_code_url` | uuid | Copy and Paste Pix URL of the Pix QR Code linked to the bank slip. | 36 |

### Bank_slip_status enumerators
| Enumerator | Description |
| --- | -- |
| `accepted` | Bank slip accepted for processing |
| `registered` | Bank slip registration completed in the bank slip registration chamber |
| `paid` | Bank slip payment amount was credited to the beneficiary's account |
| `written_off` | Bank slip written off (bank slip is no longer payable) |
| `rejected` | Bank slip registration rejected by the bank slip registration chamber  |
| `payment_notice` | Notice that bank slip payment was processed at the paying bank (but settlement to the beneficiary's account has not yet occurred) |
| `notary_office_payment_notice` | Notice that payment of a protested bank slip was processed at the paying bank (but the notary office has not yet transferred the payment and settlement to the beneficiary's account has not yet occurred) |

### Protest_status enumerators
| Enumerator | Description |
| --- | -- |
| `not_protested` | Bank slip has no protest request. |
| `protest_requested` | Bank slip with protest request being processed by QI Tech. |
| `notary_office_entry` | Bank slip protest request was accepted by the notary office. |
| `protest_cancel_requested` | Protest cancellation request being processed by QI Tech. |
| `notary_office_exit` | Bank slip protest was withdrawn from the notary office. |
| `protested` | Protest was confirmed by the notary office and the bank slip is protested. |
| `paid_at_notary_office` | Notary office identified the bank slip protest payment and is processing the payment transfer to QI Tech. |
| `judicially_suspended` | Judicially suspended protest. |
| `protest_remove_requested` | Protest removal request was accepted by the notary office. |

---

# Boleto issuance via CNAB

URL: /en/documentation/boletos/v1/emissao/emissao_via_cnab

## Request

ENDPOINT /multibank_cnab
METHOD POST

:::caution Attention!
The call must be authenticated following the standard described in the AUTHENTICATION AND SECURITY section. With the following considerations:

**1 -** The ContentMD5 variable value must be the MD5 Hash of the binary file to be sent;

**2 -** The file binary must be sent in the request body as FormData using the string "file" as key and the file to be sent as value. (This content is not encrypted);
:::

:::info
The file transmitted in this call must follow the QI Tech Collection File Layout standard with 400 positions.
Link to download the manual: [Collection Layout - QI Tech version 2.1.](https://storage.googleapis.com/live-doc-api/public_samples/Layout%20de%20Cobran%C3%A7a%20-%20QI%20Tech%20v2.1.pdf)
:::

STATUS 200

Response Body

```json
{
    "cnab_file": {
        "cnab_key": "52ff2ea1-a17f-4476-8eb8-617ddd16a81e",
        "company_code": null,
        "created_at": "2020-04-17T21:41:09",
        "downloads": [
            {
                "cnab_file_id": 0,
                "created_at": "2020-04-17T21:41:09",
                "document_number": "41184562067",
                "name": "João Ninguem",
                "person_key": "string"
            }
        ],
        "file_size": "None",
        "filename": "1905200807.REM",
        "line_length": 400,
        "remitter_key": "329",
        "requester_profile_code": "329-01-0001-0000002",
        "type": "requester_remittance",
        "url": "https://google.com",
        "version": "1"
    },
    "file_info": {
        "bank_warning_number": 244,
        "beneficiary_code": "1234567",
        "beneficiary_name": "QI SOCIEDADE DE CREDITO DIRETO",
        "credit_date": 190520,
        "file_type_identifier": 1,
        "file_type_literal": "REMESSA",
        "service_code": 1,
        "service_literal": "COBRANCA",
        "wrote_at": 180520
    },
    "occurrence_list": [
        {
            "amount": "1399.67",
            "asset_type": "invoice",
            "automatic_bankruptcy_protest": true,
            "automatic_protest": false,
            "automatic_write_off": false,
            "bank_teller_instructions": "SOMAR OS ENCARGOS PERTINENTES",
            "beneficiary_account_branch": 1,
            "beneficiary_account_number": 1273,
            "beneficiary_account_number_digit": "1",
            "cnab_file_occurrence_order": 1,
            "days_before_fine": 0,
            "days_before_interest": 0,
            "days_to_bankruptcy_protest": 10,
            "days_to_protest": 0,
            "days_to_write_off": 0,
            "discount_limit_date": "2020-05-14 00:00:00",
            "discount_value": "0.00",
            "document_number": "0198874/01",
            "expiration": "2020-06-18 00:00:00",
            "fine_percentage": "2.00",
            "guarantor_address": "AVENIDA DAS AMERICAS, 1321",
            "guarantor_city": "FAZENDA RIO GRANDE",
            "guarantor_document_digit": 86,
            "guarantor_document_root": 80550452,
            "guarantor_document_subsidiary": 1,
            "guarantor_name": "PLASTILIT PRODUTOS PLASTICOS DO PARANA S.A.",
            "guarantor_postal_code_root": 83820,
            "guarantor_postal_code_suffix": 23,
            "guarantor_state": "PR",
            "interest_daily_value": "4.67",
            "messages": [
                {"SOMAR OS ENCARGOS PERTINENTES"}
            ]
            "occurrence_cnab_line": 2,
            "occurrence_feedback": null,
            "occurrence_sequence": "0",
            "occurrence_type": "registration",
            "origin_type": "remittance",
            "our_number": 109001065,
            "our_number_digit": "1",
            "participant_control_number": "700000004167313",
            "payer_address": "AVENIDA 7 DE SETEMBRO, N. 1043",
            "payer_document": "77900454000143",
            "payer_name": "ARLINDO RAGAZZON ME",
            "payer_person_type": "legal",
            "payer_postal_code_root": 89874,
            "payer_postal_code_suffix": 0,
            "printing_policy": "no_printing",
            "rebate_amount": "0.00",
            "registration_institution_enumerator": "bradesco",
            "registration_institution_febraban_code": "237",
            "requester_key": "64d3bafa-2205-43ca-b6a7-2827aefe3ebc",
            "requester_profile": 19,
            "requester_profile_code": "237-19-0001-0001273",
            "requester_registration_date": "2020-05-18 00:00:00",
            }
        ]
}
```

STATUS 400

Response Body

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

```

---

# Bank slip issuance via JSON

URL: /en/documentation/boletos/v1/emissao/emissao_via_json

## Request

ENDPOINT /multibank_instruction
METHOD POST

Request Body

```json
{
    "occurrences": [
        {
            "amount": 1000,
            "automatic_bankruptcy_protest": false,
            "bank_teller_instructions": "Não pagar após vencimento.",
            "beneficiary_account_key": "8a35e639-8420-4f6c-9647-c2515e5381ef",
            "beneficiary_key": "3c866e34-23fe-46c2-a8b0-e39ca4348923",
            "days_to_bankruptcy_protest": 0,
            "document_number": "123456/01",
            "expiration": "2020-06-01",
            "fine_percentage": "3",
            "interest_daily_value": "0.34",
            "occurrence_type": "registration",
            "payer_address": "Rua Carlos Sampaio, 123",
            "payer_document": "41184562067",
            "payer_name": "João Ninguem",
            "payer_person_type": "natural",
            "payer_postal_code_root": "15800",
            "payer_postal_code_suffix": "020",
            "printing_policy": "no_printing",
            "registration_institution_enumerator": "qi_scd",
            "requester_profile": "09",
            "requester_profile_code": "329-09-0001-0000002"
        }
    ]
}
```

:::danger Warning!
If the payer's address information for the bank slip is not provided, it will not be possible to protest the bank slip in case of non-payment.
:::

### Query params

| Field | Type | Description                                                                                 | Characters    |
|---|---|-------------------------------------------------------------------------------------------|---------------|
| `use_multi_process` | boolean | Indicates whether the registration occurrence processing will be sent to queue processing or will be processed sequentially. If this parameter is set to `true`, it is mandatory to send our banking number `our_number` in the registration occurrence payload. | -          | 

### Body params

| Field | Type | Description | Characters |
|---|---|---|---|
| `occurrences` * | array of objects | List of occurrences to be processed. | **[Occurrences object](#occurrences-object)** |

### Occurrences object

| Field                                | Type             | Description                                                                                                                                               | Characters                                      |
|--------------------------------------|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------|
| `amount` *                           | double           | Bank slip amount.                                                                                                                                        | -                                               |
| `automatic_bankruptcy_protest`       | boolean          | Automatic protest configuration.                                                                                                                    | -                                               |
| `bank_teller_instructions`           | string           | Teller instructions (Bank slip message/observations).                                                                                                   | -                                               |
| `beneficiary_account_key`            | string           | Beneficiary account key.                                                                                                                         | -                                               |
| `beneficiary_key`                    | string           | Beneficiary key.                                                                                                                                  | -                                               |
| `days_to_bankruptcy_protest`         | int              | Number of days for automatic bankruptcy protest submission.                                                                                            | -                                               |
| `document_number`                    | string           | Document number.                                                                                                                                    | -                                               |
| `expiration` *                       | string           | Due date.                                                                                                                                     | -                                               |
| `fine_percentage`                    | string           | Fine percentage                                                                                                                                    | -                                               |
| `interest_daily_value`               | string           | Daily interest value in reais                                                                                                                         | -                                               |
| `occurrence_type` *                  | string           | Occurrence type.                                                                                                                                     | -                                               |
| `payer_address`                      | string           | Payer address.                                                                                                                                    | -                                               |
| `payer_document` *                   | string           | Payer document (CPF or CNPJ).                                                                                                                     | -                                               |
| `payer_name` *                       | string           | Payer name.                                                                                                                                        | -                                               |
| `payer_person_type` *                | string           | Payer person type.                                                                                                                                 | -                                               |
| `payer_postal_code_root`             | string           | The first five digits of the postal code.                                                                                                                      | -                                               |
| `payer_postal_code_suffix`           | string           | The last three digits of the postal code.                                                                                                                         | -                                               |
| `printing_policy`                    | string           | Bank slip printing policy                                                                                                                         | -                                               |
| `registration_institution_enumerator` * | string           | Will always be `qi_scd`.                                                                                                                                   | `qi_scd`                                          |
| `requester_profile` *                | string           | Portfolio number.                                                                                                                                     | 02                                              |
| `requester_profile_code` *           | string           | Portfolio code composed as follows: "329-portfolio-agency-account_with_7_digits". NOTE: QI Tech's default collection portfolio is number "09". | -                                               |
| `notification`                       | object           | Portfolio number.                                                                                                                                     | **[Notification object](#notification-object)** |  
| `discounts`                          | object | List of objects with discount information.                                                                                                           | **[Discounts object](#discounts-object)**       |  
| `guarantor_name`                     | string           | Guarantor name.                                                                                                                               | -                                               |
| `guarantor_document_root`            | string           | Guarantor CNPJ base.                                                                                                                       | -                                               |
| `guarantor_document_subsidiary`      | string           | Head office or branch CNPJ information.                                                                                                                 | -                                               |
| `guarantor_document_digit`           | string           | CNPJ check digit.                                                                                                                             | -                                               |

### Notification object
| Field | Type | Description | Characters |
|---|---|---|---|
| `document_number` * | string | Document number of the user who will receive the notification. | - |
| `email` * | string | Email of the user who will receive the notification. | - |
| `name` * | string | Name of the user who will receive the notification.| - |
| `phone` * | object | Object containing phone information of the user who will receive the notification. |  **[Phone object](#phone-object)** |  
| `send_2_way` * | boolean | Send second copy issuance notifications. | true/false |  
| `send_after_due_date` * | boolean | Send notifications after bank slip due date. | true/false |
| `send_before_due_date` * | boolean | Send notifications before bank slip due date. | true/false |
| `send_on_protest` * | boolean | Send protest notifications. | true/false|

### Phone object 

| Field | Type | Description |  Characters | 
| --- | --- | --- | --- | 
|`country_code` | string | Phone country code (https://ddi.guiamais.com.br/) | 3 | 
| `area_code` | string | Phone area code (https://ddd.guiamais.com.br/) | 2 |
| `number` | string |Phone number (numbers only) |  10 |

### Discounts object 
| Field | Type | Description                                 | Characters | 
| --- | --- |-----------------------------------------|------------| 
|`discount_value` | float | Discount value.                      | -          | 
| `discount_number` | int | Order in which the discount should be applied. | -          |
| `discount_limit_date` | date | Discount application limit date.   | 10         |

## Response

STATUS 200

Response Body

```json
{
  "bank_slips": [
    {
      "amount": "649.73",
      "bank_slip_key": "4bc636d0-1e41-4ce6-801c-475814bf4dcf",
      "bank_slip_status": "accepted",
      "barcode": "32991916500000649730001090000699935200347340",
      "beneficiary_account_key": "1c977186-9167-4ef1-b27d-08483429f74c",
      "beneficiary_key": "f01d4877-b1cc-4f4a-a8f9-952c2cef9ca8",
      "digitable_line": "32990001039000069993552003473403191650000064973",
      "expiration": "2022-11-10",
      "nfe_key": null,
      "nfe_url": null,
      "our_number": 6999352,
      "participant_control_number": null,
      "payer_postal_code": "38050000",
      "protest_status": "not_protested"
    }
  ],
  "file_info": {
    "beneficiary_code": null,
    "beneficiary_name": null,
    "file_sequence_id": null,
    "file_type_identifier": null,
    "file_type_literal": null,
    "service_code": null,
    "service_literal": null,
    "wrote_at": null
  },
  "occurrence_stats": {
    "bank_slip_edit": 0,
    "bankruptcy_protest_request": 0,
    "cancel_rebate": 0,
    "extension": 0,
    "notary_office_entry": 0,
    "notary_office_exit": 0,
    "notary_office_payment": 0,
    "notification": 0,
    "payment": 0,
    "payment_notice": 0,
    "payment_write_off": 0,
    "protest_cancel_and_write_off_request": 0,
    "protest_cancel_request": 0,
    "protest_remove_request": 0,
    "protest_request": 0,
    "rebate": 0,
    "registration": 1,
    "write_off": 0
  },
  "semantic_errors": []
}

```

STATUS 400

Response Body

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

### Response Params
| Field | Type | Description                                 | Characters |
| --- | -- |--------------------------------------------------------------------| --- |
|`bank_slips` | list | List with information of registered bank slips when the `use_multi_process` parameter is set to `false`. | [Bank Slip Object](#bank_slip-object) | 
| `file_info` | list | File information.                            | [File Info Object](#file-info-object) |
| `occurrence_stats` | object | File information.                            | [File Info Object](#file-info-object) |
| `semantic_errors` | list | List of errors in processing each bank slip. Will be returned if there are any processing errors and when the `use_multi_process` parameter is set to `false`. | [Semantic Error Object](#semantic-error-object) |

### bank_slip object
| Field | Type | Description                                 | Characters |
| --- | -- |--------------------------------------------------------------------| --- |
|`amount` | float | Bank slip amount. | - |
|`bank_slip_key` | uuid | Unique identification key for the bank slip at QI Tech. | 36 |
|`bank_slip_status` | enum | Unique identification key for the bank slip at QI Tech. | [bank_slip_status enumerators](#bank_slip_status-enumerators) |
|`barcode` | string | Bank slip barcode. | 44 |
|`beneficiary_account_key` | uuid | Unique identification key for the account where the bank slip was registered. | 36 |
|`beneficiary_key` | uuid | Unique identification key for the account holder where the bank slip was registered. | 36 |
|`digitable_line` | uuid | Bank slip digitable line. | 47 |
|`expiration` | string | Bank slip due date. | 10 |
|`nfe_key` | string | Electronic invoice unique identification key. | - |
|`nfe_url` | string | Electronic invoice URL. | - |
|`our_number` | int | Our banking number. It is a sequential identification number for this bank slip in relation to the account (collection portfolio) where it was registered. Its value can be provided in the bank slip registration request. If not provided, QI Tech will generate a value for this field (being an incremental value, e.g.: 1st bank slip registered in the account will have `our_number` value of 1, the 16th bank slip registered in the account will have `our_number` value of 16). | - 
|`participant_control_number` | string | Participant control number. | 10 |
|`payer_postal_code` | string | Bank slip payer postal code. | 8 |
|`protest_status` | string | Bank slip protest status, if protest was requested. | [protest_status enumerators](#protest_status-enumerators) |

### bank_slip_status enumerators
| Enumerator | Description |
| --- | -- |
| `accepted` | Bank slip accepted for processing |
| `registered` | Bank slip registration was completed in the bank slip registration chamber |
| `paid` | Bank slip payment amount was credited to the beneficiary's account |
| `written_off` | Bank slip written off (bank slip is no longer payable) |
| `rejected` | Bank slip registration rejected by the bank slip registration chamber  |
| `payment_notice` | Notice that bank slip payment was processed at the paying bank (but settlement to the beneficiary's account has not yet occurred) |
| `notary_office_payment_notice` | Notice that payment of a protested bank slip was processed at the paying bank (but the notary office has not yet transferred the payment and settlement to the beneficiary's account has not yet occurred) |

### protest_status enumerators
| Enumerator | Description |
| --- | -- |
| `not_protested` | Bank slip has no protest request. |
| `protest_requested` | Bank slip with protest request being processed by QI Tech. |
| `notary_office_entry` | Bank slip protest request was accepted by the notary office. |
| `protest_cancel_requested` | Protest cancellation request being processed by QI Tech. |
| `notary_office_exit` | Bank slip protest was removed from the notary office. |
| `protested` | Protest was confirmed by the notary office and the bank slip is protested. |
| `paid_at_notary_office` | Notary office identified the protest payment and is processing the payment transfer to QI Tech. |
| `judicially_suspended` | Judicially suspended protest. |
| `protest_remove_requested` | Protest removal request was accepted by the notary office. |

---

# Send bank slip instruction

URL: /en/documentation/boletos/v1/enviar_instrucao_de_boleto

## Send Bank Slip Instruction

To request a bank slip instruction, simply make the issuance request with the "occurrence_type" as follows:

| Value | Description |
|---|---|
| `registration` | Register a new bank slip. |
| `bank_slip_edit` | Edit payer information of an existing bank slip. |
| `extension` | Extension of the due date of an existing bank slip. |
| `write_off` | Write-off without financial impact of a bank slip. |
| `rebate` | Payment rebate. |
| `cancel_rebate` | Cancel payment rebate. |
| `bank_slip_edit` | Edit an existing bank slip (Discount, Address, Fine/interest). |
| `protest_request` | Protest bank slip. |
| `bankruptcy_protest_request` | Bankruptcy Protest. |
| `protest_remove_request` | Cancel Protest. |
| `protest_cancel_request` | Suspend Protest without Write-off. |
| `protest_cancel_and_write_off_request` | Suspend Protest with Write-off. |

**Request examples**

### Extension

To request this instruction, the bank slip must be registered and must be payable.

Request Body

```json
{
  "occurrences": [
    {
      "occurrence_type": "extension",
      "requester_profile_code": "329-01-0001-0000001",
      "our_number": 1000000,
      "expiration": "2022-06-15"
    }
  ]
}

```

### Write-off

To request this instruction, the bank slip must be registered.

Request Body

```json
{
  "occurrences": [
    {
      "occurrence_type": "write_off",
      "requester_profile_code": "329-01-0001-0000001",
      "our_number": 1000000
    }
  ]
}

```

### Rebate

To request this instruction, the bank slip cannot be overdue.

Request Body

```json
{
  "occurrences": [
    {
      "occurrence_type": "rebate",
      "our_number": 1000000,
      "rebate_amount": 10,
      "requester_profile_code": "329-01-0001-0000001"
    }
  ]
}

```

### Cancel rebate

To request this instruction, the bank slip must have an active rebate and cannot be overdue.

Request Body

```json
{
  "occurrences": [
    {
      "our_number": 1000000008,
      "occurrence_type": "cancel_rebate",
      "requester_profile_code": "329-01-0001-0000001",
      "bank_slip_key": "ce9b6834-4c6c-423a-a337-b9815a462ae5"
    }
  ]
}

```

### Discount

To request this instruction, the bank slip cannot be overdue/written off.

Request Body

```json
{
  "occurrences": [
    {
      "our_number": 1000000008,
      "occurrence_type": "bank_slip_edit",
      "requester_profile_code": "329-01-0001-0000001",
      "registration_institution_enumerator": "qi_scd",
      "discounts": [
        {
          "discount_number": 1,
          "discount_limit_date": "2022-06-14",
          "discount_value": 10
        }
      ]
    }
  ]
}

```

### Add/Edit Address

To request this instruction, the bank slip must be registered and be payable.

Request Body

```json
{
  "occurrences": [
    {
      "our_number": 1000000008,
      "occurrence_type": "bank_slip_edit",
      "requester_profile_code": "329-01-0001-0000001",
      "payer_address": "Rua dos Alfeneiros, 4, Little Whinging - Surrey, City, SP",
      "payer_postal_code_root": "17057",
      "payer_postal_code_suffix": "770"
    }
  ]
}

```

### Edit Fine/Interest

To request this instruction, the bank slip must be registered and be payable.

Request Body

```json
{
  "occurrences": [
    {
      "our_number": 1000000008,
      "occurrence_type": "bank_slip_edit",
      "requester_profile_code": "329-01-0001-0000001",
      "fine_percentage": 1,
      "interest_daily_value": 0.33
    }
  ]
}

```

### Protest

To request this instruction, the bank slip must be overdue and must have the payer's address data.

Request Body

```json
{
  "occurrences": [
    {
      "our_number": 1000000002,
      "occurrence_type": "protest_request",
      "requester_profile_code": "329-01-0001-0000001"
    }
  ]
}

```

### Bankruptcy Protest

To request this instruction, the bank slip must be overdue and must have the payer's address data.

Request Body

```json
{
  "occurrences": [
    {
      "our_number": 1000000002,
      "occurrence_type": "bankruptcy_protest_request",
      "requester_profile_code": "329-01-0001-0000001"
    }
  ]
}

```

### Cancel protest

To request this instruction, the bank slip must be protested.

Request Body

```json
{
  "occurrences": [
    {
      "our_number": 1000000002,
      "occurrence_type": "protest_remove_request",
      "requester_profile_code": "329-01-0001-0000001"
    }
  ]
}

```

### Cancel automatic protest

To request this instruction, the bank slip must be registered with this option active.

Request Body

```json
{
  "occurrences": [
    {
      "our_number": 1000000002,
      "occurrence_type": "bank_slip_edit",
      "requester_profile_code": "329-01-0001-0000001",
      "automatic_bankruptcy_protest": false,
      "automatic_protest": false
    }
  ]
}

```

### Suspend protest without write-off

To request this instruction, the bank slip must be protested.

Request Body

```json
{
  "occurrences": [
    {
      "our_number": 1000000002,
      "occurrence_type": "protest_cancel_request",
      "requester_profile_code": "329-01-0001-0000001"
    }
  ]
}

```

### Cancel automatic protest

To request this instruction, the bank slip must be protested.

Request Body

```json
{
  "occurrences": [
    {
      "our_number": 1000000002,
      "occurrence_type": "protest_cancel_and_write_off_request",
      "requester_profile_code": "329-01-0001-0000001"
    }
  ]
}

```

## Response example

The response varies for each type of instruction, usually resulting in changes to the occurrence_stats fields, in the key of each instruction.

In the semantic_errors field, a list is returned with objects of each occurrence with their respective errors (example below).

Request Body

```json
{
  "file_info": {
    "beneficiary_code": null,
    "beneficiary_name": null,
    "file_sequence_id": null,
    "file_type_identifier": null,
    "file_type_literal": null,
    "service_code": null,
    "service_literal": null,
    "wrote_at": null
  },
  "occurrence_stats": {
    "bank_slip_edit": 0,
    "bankruptcy_protest_request": 0,
    "cancel_rebate": 0,
    "extension": 0,
    "notary_office_entry": 0,
    "notary_office_exit": 0,
    "notary_office_payment": 0,
    "notification": 0,
    "payment": 0,
    "payment_notice": 0,
    "payment_write_off": 0,
    "protest_cancel_and_write_off_request": 0,
    "protest_cancel_request": 0,
    "protest_remove_request": 0,
    "protest_request": 0,
    "rebate": 0,
    "registration": 0,
    "write_off": 1
  },
  "semantic_errors": [
    {
      "0": {
        "errors": [
          {
            "created_at": "2019-03-12T12:59:32",
            "reason_code": "CEP Inválido",
            "translation_en_us": "Invalid Postal Code",
            "translation_pt_br": "CEP Inválido"
          }
        ],
        "our_number": 1000000000,
        "participant_control_number": null
      }
    }
  ]
}

```

---

# Introduction

URL: /en/documentation/boletos/v1/introducao

Payment slip portfolio is a service that allows the issuance of bank payment slips. There are several types of portfolios and each one defines how their payment slips will be generated, the costs, settlement rate, account to be credited, and various configurations that will allow the bank to make the correct charge. During account opening at QI Tech, a portfolio within QI and a portfolio at Bradesco are automatically made available to the client, with QI Tech's global payment collection configurations.

Additionally, if the client is interested in registering or modifying a portfolio with configurations different from the global configuration, they can request the service from our team.

## How does payment slip issuance work?

QI Tech's APIs allow abstraction of a payment slip's lifecycle through a state machine, where we have the following statuses:

## Registration request
    - accepted: Payment slip issuance request entered the registration queue;
    - rejected: Payment slip issuance request rejected, when the payment slip registration request contains a semantic error that prevents registration.

## Registration completed
    registered: Payment slip registered and available for payment.

## Payment notification
    - payment_notice: Payment slip payment notice, this notification is sent when the payment slip is paid, but financial settlement does not yet exist.
    - notary_office_payment_notice: Payment slip payment notice, this notification is sent when the payment slip is paid at a notary office, but financial settlement does not yet exist.

## Settlement
    - paid: Payment slip paid - cleared with financial settlement.
    - written_off: Payment slip cleared without financial settlement.

---

# Bank Slip Webhooks

URL: /en/documentation/boletos/webhooks/boleto

:::danger Warning!
QI Tech webhooks should not be mapped in a restrictive way. 
Additional fields may be included in the webhook payloads returned in our APIs.
:::

:::info Webhook Resending
You can query and resend webhooks following the detailed instructions in the documentation: [Webhook Resending](/documentation/notificacoes/reenvio_de_notificacoes).
:::

## Introduction

Throughout the bank slip lifecycle within our system, webhooks will be sent with the following bank slip status (`bank_slip_status`):

| Enumerator                    | Translation                    | Description                                                       |
|-------------------------------|--------------------------------|------------------------------------------------------------------------------------------------|
|  registered                   | registered                     | Bank slip registered and available for payment |
|  rejected                     | rejected                      | Bank slip issuance request rejected due to validation errors                               |
|  payment_notice               | payment notice             | Bank slip payment notice (bank slip paid but payment not yet settled)                    |
|  notary_office_payment_notice | notary office payment notice | Notary office bank slip payment notice (bank slip paid but payment not yet settled)                    |
|  paid                         | paid                           | Bank slip paid and financially settled                         |
|  written_off                  | written off                        | Bank slip written off (can no longer be paid) and without financial settlement                              |
|  payment_blocked              | payment blocked       | Payment blocked due to protest flow                    |

And webhooks are sent whenever occurrences of the following types are confirmed (`occurrence_type`):

| Enumerator                    | Translation                    | Description                                                                    |
|-------------------------------|--------------------------------|------------------------------------------------------------------------------|
|  registration                 | registration                       | Bank slip registration                                                           |
|  rebate                       | rebate                     | Rebate of part of the title base value                                  |
|  cancel_rebate                | rebate cancellation     | Cancellation of existing rebate                                         |
|  extension                    | extension                       | Extension of title expiration date                                      |
|  write_off                    | write off                          | Bank slip write off                                                              |
|  protest_write_off            | protest write off             | Bank slip write off due to notary office protest                                     |
|  payment_write_off            | payment write off            | Bank slip write off due to payment                                                |
|  discount                     | discount                       | Discount changes                                                      |
|  fine                         | fine                          | Fine changes                                                           |
|  interest                     | interest                          | Interest changes                                                         |
|  protest_request              | protest request             | Notary office protest request                                               |
|  bankruptcy_protest_request   | bankruptcy protest request  | Notary office bankruptcy protest request                                    |
|  notary_office_entry          | notary office entry            | Title entry into notary office occurrence                                  |
|  protest_cancel_request       | protest request withdrawal | Current protest request withdrawal                                |
|  protest_remove_request       | protest suspension           | Title protest suspension                                               |
|  notary_office_exit           | notary office exit              | Title exit from notary office occurrence                                    |
|  payment_notice               | payment notice             | Bank slip payment notice (bank slip paid but payment not yet settled) |
|  notary_office_payment_notice | notary office payment notice | Notary office bank slip payment notice (bank slip paid but payment not yet settled)  |
|  payment                      | payment                      | Notification that the bank slip was paid and written off                               |

:::info Information
The timeout for our webhook response is 10 seconds.
:::

## Examples
----

### Registration

Webhook Body: accepted occurrence

```json
{
	"webhook_type": "baas.bank_slip.occurrence",
	"webhook_datetime": "2024-08-13T21:35:55.679Z",
	"data": {
		"bank_slip_key": "11b13b2c-4204-41b3-8596-2ee7ecbde38c",
		"bank_slip_status": "registered",
		"occurrence_key": "9077cc0b-5bbd-4432-888e-6bf6384c250a",
		"occurrence_type": "registration",
		"occurrence_status": "confirmed"
	}
}
```

Webhook Body: rejected occurrence

```json
{
	"webhook_type": "baas.bank_slip.occurrence",
	"webhook_datetime": "2024-08-13T21:35:55.679Z",
	"data": {
		"bank_slip_key": "ae783ed7-b892-4e48-8480-b045e3b492f5",
		"bank_slip_status": "rejected",
		"occurrence_key": "db04719d-4370-4f3f-82b7-d72d3db2f39e",
		"occurrence_type": "registration",
		"occurrence_status": "rejected"
	}
}
```

### Rebate/rebate cancellation

Webhook Body: rebate

```json
{
	"webhook_type": "baas.bank_slip.occurrence",
	"webhook_datetime": "2024-08-13T21:35:55.679Z",
	"data": {
		"bank_slip_key": "11b13b2c-4204-41b3-8596-2ee7ecbde38c",
		"bank_slip_status": "registered",
		"occurrence_key": "db04719d-4370-4f3f-82b7-d72d3db2f39e",
		"occurrence_type": "rebate",
		"occurrence_status": "confirmed"
	}
}
```

Webhook Body: rebate cancellation

```json
{
	"webhook_type": "baas.bank_slip.occurrence",
	"webhook_datetime": "2024-08-13T21:35:55.679Z",
	"data": {
		"bank_slip_key": "11b13b2c-4204-41b3-8596-2ee7ecbde38c",
		"bank_slip_status": "registered",
		"occurrence_key": "db04719d-4370-4f3f-82b7-d72d3db2f39e",
		"occurrence_type": "cancel_rebate",
		"occurrence_status": "confirmed"
	}
}
```

### Extension

Webhook Body

```json
{
	"webhook_type": "baas.bank_slip.occurrence",
	"webhook_datetime": "2024-08-13T21:35:55.679Z",
	"data": {
		"bank_slip_key": "11b13b2c-4204-41b3-8596-2ee7ecbde38c",
		"bank_slip_status": "registered",
		"occurrence_key": "db04719d-4370-4f3f-82b7-d72d3db2f39e",
		"occurrence_type": "extension",
		"occurrence_status": "confirmed"
	}
}
```

### Discount

Webhook Body

```json
{
	"webhook_type": "baas.bank_slip.occurrence",
	"webhook_datetime": "2024-08-13T21:35:55.679Z",
	"data": {
		"bank_slip_key": "a8df1c2e-77ff-49ea-9e7a-8fd536a6e357",
		"bank_slip_status": "registered",
		"occurrence_key": "db04719d-4370-4f3f-82b7-d72d3db2f39e",
		"occurrence_type": "discount",
		"occurrence_status": "confirmed"
	}
}
```

### Interest

Webhook Body

```json
{
	"webhook_type": "baas.bank_slip.occurrence",
	"webhook_datetime": "2024-08-13T21:35:55.679Z",
	"data": {
		"bank_slip_key": "69f3f345-07c5-4c80-a8dd-51054afdad01",
		"bank_slip_status": "registered",
		"occurrence_key": "8550e47a-7554-455c-bdd8-cf0c048a277c",
		"occurrence_type": "interest",
		"occurrence_status": "confirmed"
	}
}
```

### Fine

Webhook Body

```json
{
	"webhook_type": "baas.bank_slip.occurrence",
	"webhook_datetime": "2024-08-13T21:35:55.679Z",
	"data": {
		"bank_slip_key": "97e6edab-b793-4eb6-a1a7-0a27e1d5c73e",
		"bank_slip_status": "registered",
		"occurrence_key": "47b06bdb-c006-47a7-81f2-7aac7fff823b",
		"occurrence_type": "fine",
		"occurrence_status": "confirmed"
	}
}
```

### Write Off

The `occurrence_reason` field is optional and is sent when the bank provides the reason for the write-off. It contains the reason code and name provided by the financial institution.

Webhook Body: without reason

```json
{
	"webhook_type": "baas.bank_slip.occurrence",
	"webhook_datetime": "2024-08-13T21:35:55.679Z",
	"data": {
		"bank_slip_key": "45c21054-57fd-4d28-8d5a-0cdc5cb29670",
		"bank_slip_status": "written_off",
		"occurrence_key": "0b92bd47-fae5-46c0-8c40-e5aebc9ecd28",
		"occurrence_type": "write_off",
		"occurrence_status": "confirmed"
	}
}
```

Webhook Body: with reason

```json
{
	"webhook_type": "baas.bank_slip.occurrence",
	"webhook_datetime": "2026-05-04T21:12:07.877Z",
	"data": {
		"bank_slip_key": "25add0b0-cb2d-4be4-8f22-4305a4dd9793",
		"bank_slip_status": "written_off",
		"occurrence_key": "ca71f446-be05-47cc-b470-234e4806344c",
		"occurrence_type": "write_off",
		"occurrence_status": "confirmed",
		"occurrence_reason": {
			"bank_reason_code": "16",
			"bank_reason_name": "Título Baixado pelo Banco por decurso de Prazo"
		}
	}
}
```

### Protest Write Off

Webhook Body

```json
{
	"webhook_type": "baas.bank_slip.occurrence",
	"webhook_datetime": "2024-10-25T18:05:01.395Z",
	"data": {
		"bank_slip_key": "7182639f-dea5-46c6-99c6-af0d94d772cb",
		"bank_slip_status": "written_off",
		"occurrence_key": "93380917-beee-4f3e-af01-6c24e140d53d",
		"occurrence_type": "protest_write_off",
		"occurrence_status": "confirmed"
	}
}
```

### Payment Write Off

Webhook Body

```json
{
	"webhook_type": "baas.bank_slip.occurrence",
	"webhook_datetime": "2024-10-18T18:02:15.152Z",
	"data": {
		"bank_slip_key": "40d6a1bc-cfed-4444-a901-e02ecc169ce5",
		"bank_slip_status": "written_off",
		"occurrence_key": "78221daa-945f-485b-b39c-97ef0e251afe",
		"occurrence_type": "payment_write_off",
		"occurrence_status": "confirmed"
	}
}
```

### Protest Request

Webhook Body

```json
{
	"webhook_type": "baas.bank_slip.occurrence",
	"webhook_datetime": "2024-10-16T20:54:13.013Z",
	"data": {
		"bank_slip_key": "f03c5fec-b31c-402a-b832-80da8a493653",
		"bank_slip_status": "payment_blocked",
		"occurrence_key": "304958f6-cdf2-4fb1-b8f3-5482030bf0eb",
		"occurrence_type": "protest_request",
		"occurrence_status": "confirmed"
	}
}
```

### Bankruptcy Protest Request

Webhook Body

```json
{
	"webhook_type": "baas.bank_slip.occurrence",
	"webhook_datetime": "2024-10-16T20:54:13.013Z",
	"data": {
		"bank_slip_key": "21aeefb4-4fa1-4e32-b2bb-32a7486128f0",
		"bank_slip_status": "payment_blocked",
		"occurrence_key": "11a7e9e8-4667-471b-bc3f-2f65f77e22e9",
		"occurrence_type": "bankruptcy_protest_request",
		"occurrence_status": "confirmed"
	}
}
```

### Notary Office Entry

Webhook Body

```json
{
	"webhook_type": "baas.bank_slip.occurrence",
	"webhook_datetime": "2024-10-17T18:00:48.341Z",
	"data": {
		"bank_slip_key": "5bc4c1d4-d51b-4b0b-b308-81850d04e523",
		"bank_slip_status": "payment_blocked",
		"occurrence_key": "159e6e3f-fce5-4362-829e-1595fc14d66c",
		"occurrence_type": "notary_office_entry",
		"occurrence_status": "confirmed"
	}
}
```

### Protest Cancellation

Webhook Body

```json
{
	"webhook_type": "baas.bank_slip.occurrence",
	"webhook_datetime": "2024-10-23T18:00:52.374Z",
	"data": {
		"bank_slip_key": "96d2a896-f2da-484c-8d40-20fabbde15ee",
		"bank_slip_status": "registered",
		"occurrence_key": "2505fedf-0061-478b-b45e-8420b755ebbb",
		"occurrence_type": "protest_cancel_request",
		"occurrence_status": "confirmed"
	}
}
```

### Protest Suspension

Webhook Body

```json
{
	"webhook_type": "baas.bank_slip.occurrence",
	"webhook_datetime": "2024-10-30T18:01:00.452Z",
	"data": {
		"bank_slip_key": "878d462e-be4e-40bd-b797-b831fef87f48",
		"bank_slip_status": "written_off",
		"occurrence_key": "cb08785d-0a4d-41f4-a64c-bafe730b175b",
		"occurrence_type": "protest_remove_request",
		"occurrence_status": "confirmed"
	}
}
```

### Notary Office Exit

Webhook Body

```json
{
	"webhook_type": "baas.bank_slip.occurrence",
	"webhook_datetime": "2024-11-01T18:01:01.949Z",
	"data": {
		"bank_slip_key": "79d07a3d-3953-4195-a2e2-bbbf10635f27",
		"bank_slip_status": "registered",
		"occurrence_key": "c703b04c-7334-40fe-bf8d-b43bd991dbab",
		"occurrence_type": "notary_office_exit",
		"occurrence_status": "confirmed"
	}
}
```

### Payment Notice

First webhook: bank slip was paid, but not yet settled

Webhook Body

```json
{
	"webhook_type": "baas.bank_slip.payment_notice",
	"webhook_datetime": "2024-08-13T21:35:55.679Z",
	"data": {
		"bank_slip_key": "db04719d-4370-4f3f-82b7-d72d3db2f39e",
		"bank_slip_status": "payment_notice",
		"occurrence_key": "d0341ad7-aa87-4dad-929b-38c8c9218f23",
		"occurrence_type": "payment_notice",
		"occurrence_status": "confirmed"
	}
}
```

### Notary Office Payment Notice

First webhook: bank slip was paid at notary office, but not yet settled

Webhook Body

```json
{
	"webhook_type": "baas.bank_slip.notary_office_payment_notice",
	"webhook_datetime": "2024-10-16T18:00:43.621Z",
	"data": {
		"bank_slip_key": "05f2b81b-b241-4e72-9b2c-7312257a0284",
		"bank_slip_status": "notary_office_payment_notice",
		"occurrence_key": "3ecab7b1-c991-4d91-8d71-08a34eec1d7d",
		"occurrence_type": "notary_office_payment_notice",
		"occurrence_status": "confirmed"
	}
}
```

### Payment

Webhook Body

```json
{
	"webhook_type": "baas.bank_slip.payment",
	"webhook_datetime": "2024-08-13T21:35:55.679Z",
	"data": {
		"bank_slip_key": "db04719d-4370-4f3f-82b7-d72d3db2f39e",
		"bank_slip_status": "paid",
		"occurrence_key": "db04719d-4370-4f3f-82b7-d72d3db2f39e",
		"occurrence_type": "payment",
		"occurrence_status": "confirmed",
		"paid_amount": 850.0,
		"paid_rebate_amount": 200.0,
		"paid_discount_amount": 0.0,
		"paid_fine_amount": 0.0,
		"paid_interest_amount": 50.0,
		"payment_method": "account_debit",
		"payment_origin": "qr_code",
		"payment_credit_date": "2024-07-02",
		"payment_bank": {
			"code": "341",
			"ispb": 60701190,
			"name": "ITAU UNIBANCO S.A."
		},
		"payment_branch": "0216"
	}
}
```

:::info Information
The `payment_bank` and `payment_branch` fields indicate the bank and branch where the bank slip was paid. They are only populated when this information is received upon payment settlement; if the paying bank is not identified, `payment_bank` is returned as `null`.
:::

### payment_method Enumerators

| Enumerator         | Description                               |
|--------------------|-----------------------------------------|
| cash       | Cash                  |
| account_debit             | Account debit                |
| credit_card      | Credit card |
| check          | Check                  |

### payment_origin Enumerators

| Enumerator           | Description                                |
|----------------------|------------------------------------------|
| phisical_cashier     | Branches - Traditional posts           |
| taa                  | Self-service terminal             |
| internet             | Internet (home/office bank)              |
| corban               | Banking correspondent                  |
| call_center          | Call center     |
| eletronic_file       | Electronic file                       |
| dda                  | DDA                                       |
| digital_correspondent| Digital correspondent                   |
| qr_code              | Pix QR Code payment                |

---

# Bank slip wallet webhooks

URL: /en/documentation/boletos/webhooks/carteira

:::danger Warning!
QI Tech webhooks should not be mapped in a restrictive manner. 
Additional fields may be included in the webhook payloads returned by our APIs.
:::

:::info Webhook Resending
You can check and resend webhooks following the detailed instructions in the documentation: [Webhook Resending](/documentation/notificacoes/reenvio_de_notificacoes).
:::

## Introduction

After creating a wallet (`requester_profile`) within our system, webhooks will be sent with the following status:

| Enumerator                    | Translation            | Description                                                |
|-------------------------------|------------------------|------------------------------------------------------------|
|  opened                       | open                   | Bank slip wallet opened and ready to register bank slips  |

:::info Information
The timeout for our webhook responses is 10 seconds.
:::

## Examples
----

### Opening confirmation

Webhook Body

```json
{
	"webhook_type": "baas.bank_slip.requester_profile",
	"webhook_datetime": "2024-08-13T21:35:55.679Z",
	"data": {
		"requester_profile_key": "fd86d9b1-2a5e-4e03-9a59-a043c7632c97",
		"request_control_key": "0868a24b-4a69-4138-ac4d-ecaeddf0005f",
		"requester_profile_code": "329-04-2338-2625918",
		"requester_profile_status": "opened"
	}
}
```

---

# Settlement webhooks

URL: /en/documentation/boletos/webhooks/liquidacao

:::danger Attention!
QI Tech webhooks should not be mapped in a restrictive manner. 
Additional fields may be included in the webhook payloads returned by our APIs.
:::

:::info Webhook Resending
You can check and resend webhooks following the detailed instructions in the documentation: [Webhook Resending](/documentation/notificacoes/reenvio_de_notificacoes).
:::

## Introduction

In our system, settlement groups are a way to reconcile transactions with settled bank slips. This process (settlement) describes the transfer of value from a paid bank slip to the account that should receive this payment. In summary, whenever QI receives information that a bank slip has been paid by another bank or, in the case of protested bank slips, by the notary office, a settlement is created for that specific bank slip. Subsequently, **settlement groups** are created, which represent batches of settlements grouped by type.

At a later time, the payment transaction for this settlement group is made to the client's account. The **transaction_key** of this transaction is then saved for reconciliation purposes, so you can see all the bank slips that were settled in a specific transaction. For example, if you have five bank slips of R$ 5.00 each, where one was paid via notary office, one was paid via QR Code PIX and the other three were paid using the payment line or barcode by another bank, five settlements will be created for these bank slips. Then, these settlements will be grouped into three settlement groups: one of R$ 15.00 with the three bank slips paid using the payment line or barcode, for which a single transaction will be made, another of R$ 5.00 for the bank slip paid via QR Code PIX and the last one also of R$ 5.00 with the bank slip paid via notary office.

:::info Information
The timeout for response from our webhooks is 10 seconds.
:::

## Examples
----

### Settlement group

Webhook Body

```json
{
    "webhook_type": "baas.bank_slip.bank_slip_settlement_group",
    "webhook_datetime": "2024-08-13T21:35:55.679Z",
    "data": {
        "bank_slip_settlement_group_key": "87e6687b-d02b-45dc-b5b8-b51e16ec0a03",
        "amount": 1,
        "bank_slip_settlement_group_type": "siloc",
        "bank_slip_settlement_group_status": "settled",
        "transaction_key": "fc60a57e-c6ac-4e39-a3cf-2dc3c491dac6"
    }
}
```

### bank_slip_settlement_group_type enumerators

| Enumerator                   | Description                                                                    |
|------------------------------|------------------------------------------------------------------------------|
| siloc                        | for payment of securities (security value less than R$ 250,000)                          |
| qr_code                      | for payment of securities made via QR Code |
| str                          | for payment of VR securities (security value greater than R$ 250,000) |
| notary_office                | for payment of securities made via notary office             |

### bank_slip_settlement_group_status enumerators

| Enumerator                   | Description                                                                    |
|------------------------------|------------------------------------------------------------------------------|
| pending                      | settlement group created but transaction was not executed  |
| settled                      | settlement group created and transaction executed |

---

# Return file Webhooks

URL: /en/documentation/boletos/webhooks/retorno

Return files are used for reconciliation. In them, each Transaction Record line (Type 1) refers to an instruction (whether issuance, extension, discount, etc.) that was confirmed or rejected by CIP/Nuclea on the previous day.

:::danger Attention!
QI Tech webhooks should not be mapped in a restrictive manner. 
Additional fields may be included in the webhook payloads returned in our APIs.
:::

:::info Webhook Resending
You can consult and resend webhooks by following the detailed instructions in the documentation: [Webhook Resending](/documentation/notificacoes/reenvio_de_notificacoes).
:::

:::info Information
The timeout for our webhook response is 10 seconds.
:::

## Examples
----

### Return file

Webhook Body

```json
{
    "webhook_type": "baas.bank_slip.discharge_file",
    "webhook_datetime": "2024-08-13T21:35:55.679Z",
    "data": {
        "discharge_file_key": "f1a8fe59-29cd-49e5-8d18-55194869b45c",
        "reference_date": "2024-10-15",
        "requester_profile_key": "fc60a57e-c6ac-4e39-a3cf-2dc3c491dac6",
        "discharge_file_url": "https://storage.googleapis.com/local-bank-slip-api/2024/61a746ca-05bf-429d-99c3-3fba0f9fbea7/329-20-7336-3073959/discharge/CB15102401.RET",
        "cnab_bank": "qi_scd",
        "cnab_layout": "400",
    }
}
```

:::info Supported Banks
Currently, the return file webhook supports the following banks:
- Bradesco (bradesco)
- Itaú (itau)
- QI SCD (qi_scd)
- Santander (santander)
:::

:::info Supported Layouts
Currently, the return file webhook supports the following CNAB layouts:
- CNAB 400 (400)
:::

---

# Authentication

URL: /en/documentation/caas/account_event/authentication

> To authenticate a call, use the following code:

```shell
# No shell, você somente precisa adicionar o header adequado em cada requisição.
curl "api_endpoint_here"
  -H "Authorization: EXAMPLE-OF-API-KEY"
```

> Replace the API Key 'EXAMPLE-OF-API-KEY' with your own key, which can be obtained through our support team..

We use an API Key to grant access to our API. It has likely already been sent to you via email. If you haven't received your key yet, please send an email to suporte.caas@qitech.com.br .

Our API expects to receive the API Key in every request sent to our server within a header as shown below:

`Authorization: EXAMPLE-OF-API-KEY`

:::info **Attention**

You must replace EXAMPLE-OF-API-KEY with your actual key, which must be obtained through our support team.

:::

---

# Device Validation Object

URL: /en/documentation/caas/account_event/device_validation

Device validation via unique identification must be performed through the Device Validation Event Type endpoint. The data sent must be the information generated in the Device Registration API, along with a Device Scan session ID. In other words, to perform a device validation, the application must use the SDK to generate a unique identifier, and the device must be registered so it can be identified later

### Status Dynamics - **analysis_status**

The **analysis_status** field indicates the decision status of the fraud engine and follows a very simple state machine:

* automatically_approved
* automatically_reproved
* in_manual_analysis
* manually_approved
* manually_reproved
* pending

## Device Validation Object Definition

Request Body

```json
{
  "id": "12345678",
  "account_id": "12345678",
  "person_id": "12345678",
  "session_id": "12345678",
  "event_date": "2019-12-11T11:37:15.12-03:00"
}
```

All information exchanges for a validation use the following definition for this object. In some cases, to simplify implementation and reduce data flow between parties, certain information may be omitted.

Name | Type | Description
:----: | :----: | ---------
id | string | Event identifier. **It is essential that this number is unique for each request** *(required)*
account_id | string | Identifier of the account registered in the device registration system. To perform more than one analysis for the same registration, simply use the same account_id across different analyses. *(required)* 
person_id | string | Identifier of the user associated with the account registered in the device registration system. To perform more than one analysis for the same registration, simply use the same person_id across different analyses. *(required)*
session_id | string | Identifier of the Device Scan analysis session. *(required)*
face_recognition_key | string | Identifier of the image generated in the SDK for facial identification.
event_date | datetime | Event date and time *(required)*

## Submit a Device Validation

Request Body

```json
  {
    "id": "12345",
    ...
  }
```

Response Body

```json
  {
    "id": "12345",
    "analysis_status": "automatically_approved",
    "reason": "rule_decision_enum"
  }
```

To perform a Device validation, simply send a Device Validation type object to the following endpoint:

`POST https://api.caas.qitech.app/account_event/event_type/device_validation/event`

---

# HTTP Status Codes

URL: /en/documentation/caas/account_event/http_status

All QI Tech APIs follow the standard HTTP return status codes as defined in RFC 7231 :

Status HTTP | Meaning | Description
---------- | ------- | ---------------------------------
400 | Bad Request | The request sent contains formatting errors. Typically, we provide an explanation of the error within the message body.
401 | Unauthorized | There was an authentication issue. Verify if the API Key is correct and placed in the proper header, as described in the authentication section .
403 | Forbidden | The accessed endpoint is for internal use and is not available for this API Key.
404 | Not Found | The requested data was not found using the provided key. This status is also returned when an invalid endpoint is requested.
405 | Method Not Allowed | The HTTP method used is not applicable to the specified endpoint.
406 | Not Acceptable | The data sent in the request body is invalid. Generally, this means the submitted data is not a valid JSON.
409 | Conflict | The request ID corresponds to an ID that has already been processed. This status is returned in the case of duplicate requests sent to the server.
500 | Internal Server Error | We encountered a problem processing this request. When this error occurs, our specialists are automatically notified and begin analysis and resolution immediately.
503 | Service Unavailable | You have encountered an infrastructure unavailability, whether planned or unplanned, on our servers.

---

# Introduction

URL: /en/documentation/caas/account_event/introduction

Welcome to QI Tech's Account Event API! This API provides access to monitoring services and event rules within your platform's accounts.

While this API can be used for device validation alongside the Device Scan and Device Registration APIs, it is also versatile enough for other validations such as:

* Logins.
* Screen access.
* Password changes.
* Registration data updates.
* Pre-transaction validations.
* Liveness Validation.

You can use our API to access endpoints for evaluating the following event types:

* **Device Validation** - Used for validating a device's unique identification.
* **Pre Pix Transaction** - Used for the pre-validation of Pix transactions.
* **Registration Data Validation** - Used for validating registration data.

Different event types can be implemented depending on your system's specific needs.

On the side, you can view the API implementation using curl. These examples serve as a guide for you to adapt the code to your preferred programming language.

## Having trouble?

Having Trouble?
We aren't a company that hides behind an API! Get in touch with our support team and we will respond as quickly as possible. Feel free to call us if you need an immediate answer!

### We Love Feedback

Even if you have already solved your problem or if it was something simple (like a typo or a minor organizational issue), please send us an email. This helps us make our documentation more practical so the next person doesn't have to face the same hurdles you did!

## Environments

We provide two environments for our clients. The base URLs for the APIs are:

* Production - `https://api.caas.qitech.app/account_event/`
* Sandbox - `https://api.sandbox.caas.qitech.app/account_event/`

:::danger Important Notice!
Real personal or corporate data must not be used in QI Tech's Sandbox environments.
:::

In the Sandbox environment, submitted analyses are not billed and are responded to according to the rules configured for the event.

## HTTPS Only

For security reasons, all communication with QI Tech APIs must be performed via HTTPS. To prevent accidental HTTP calls, our server only makes port 443 available with TLS 1.2 communication. Calls made using other protocols will be automatically denied.

---

# Pre-PIX Transaction

URL: /en/documentation/caas/account_event/pre_pix_transaction

The moment a payer intends to initiate a payment, the transaction data can be previously evaluated by our server. This allows for a preliminary risk analysis based on that specific dataset.

## Pre-Pix Transaction Object Definition

Request Body

```json
{
    "id": "082373263",
    "transaction_direction": "received",
    "client": {
        "id": "123456",
        "document_number": "056.966.649-03",
        "name": "Francisco Oliveira Benedetti",
        "type": "natural_person",
        "address": {
            "street": "Avenida 13",
            "number": "704",
            "neighbourhood": "Centro",
            "city": "Ituiutaba",
            "uf": "MG",
            "complement": "Apt 1101",
            "postal_code": "38300-140"
        },
        "phone": {
            "international_dial_code": "55",
            "area_code": "16",
            "number": "981610077",
            "type": "mobile"
        },
        "sales_channel": "inbound_sales",
        "segment": "Personalité"
    },
    "amount": 13725,
    "dict_key": {
        "key_type": "cpf",
        "key_value": "09991222669",
        "assignment_date": "2020-01-15T18:00:00-03:00"
    },
    "face_recognition_key": "ef39e206-13d5-48de-b368-6c3bbc6f0222",
    "source_account": {
        "participant": "17315359",
        "branch": "0000",
        "account_number": "10442",
        "account_digit": "6",
        "owner": {
            "type": "legal_person",
            "document_number": "07.487.735/0001-69",
            "name": "Gioconda Pizzaria e Rotisseria LTDA."
        },
        "account_type": "CACC",
        "opening_date": "2020-01-15T18:00:00-03:00"
    },
    "destination_account": {
        "participant": "60701190",
        "branch": "3675",
        "account_number": "10442",
        "account_digit": "6",
        "owner": {
            "type": "natural_person",
            "document_number": "056.966.649-03",
            "name": "Francisco Oliveira Benedetti"
        },
        "account_type": "SLRY",
        "opening_date": "2020-01-15T18:00:00-03:00"
    },
    "destination_statistics": {
        "person":{
            "settlements":{
                "d90":4,
                "m12":67,
                "m60":618
            },
            "application_frauds":{
                "d90":0,
                "m12":4,
                "m60":9
            },
            "mule_accounts":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "scammer_accounts":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "other_frauds":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "unknown_frauds":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "total_frauds_transaction_amount":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "distinct_fraud_reporters":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "open_reports":0,
            "open_reports_distinct_reporters":0,
            "rejected_reports":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "registered_accounts":0
        },
        "owner":{
            "settlements":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "application_frauds":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "mule_accounts":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "scammer_accounts":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "other_frauds":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "unknown_frauds":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "total_frauds_transaction_amount":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "distinct_fraud_reporters":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "open_reports":0,
            "open_reports_distinct_reporters":0,
            "registered_accounts":0
        },
        "key":{
            "settlements":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "application_frauds":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "mule_accounts":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "scammer_accounts":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "other_frauds":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "unknown_frauds":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "total_frauds_transaction_amount":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "distinct_fraud_reporters":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "open_reports":0,
            "open_reports_distinct_reporters":0,
            "rejected_reports":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "distinct_accounts":{
                "d90":0,
                "m12":0,
                "m60":0
            }
        }
    },
    "source": {
        "channel": "internet_banking",
        "platform": "android",
        "ip": "198.185.065.098",
        "session_id": "7839jdqd9a8wd9"
    },
    "event_date": "2019-12-11T11:37:15.12-03:00"
}
```

A transaction must be sent to the API before being forwarded to the processing system in order to perform a preliminary fraud validation.

The transaction status represents the decision returned by the model for that transaction. The following statuses are used in the **analysis_status** flag:

* `automatically_approved`
* `automatically_reproved`
* `automatically_challenged`
* `pending`

The meanings of each decision returned in the analysis_status flag are listed below:

status | description
:----: | ---------
automatically_approved      | It is recommended that this transaction be approved.
automatically_reproved      | It is recommended that this transaction be rejected.
automatically_challenged    | QI Tech's algorithms recommend that this transaction be challenged.
pending                     | The transaction is currently being processed.

name | type | description
:----:  | :----:  | ---------
id | string | Payment identifier in the client's system. **It is essential that this number is unique for each payment process** *(required)*
transaction_direction   | enumerador  | Type of registered transaction. Defines whether the client is receiving or sending money. *(required)*
client                  | *client* | Object representing client data, whether they are the payer or the receiver. *(required)*
amount                  | inteiro  | The payment amount in cents — as described in the "Standards" section. *(required)*
pix_modality            | string   | Type of registered transaction. Indicates if it represents a transfer, change, or withdrawal.
dict_key                | *dict_key*                | Object representing the DICT link key data used by the client in the transaction.
face_recognition_key    | string                    | Facial recognition key, if facial recognition was performed via our API.
source_account          | *source_account* | Object representing the data of the debited account. *(required)*
destination_account     | *destination_account* | Object representing the data of the credited account. *(required)*
destination_statistics  | *destination_statistics*  | Object representing the transaction and fraud history of the credited account from the Central Bank's (BACEN) DICT API.
source                  | *source* | Source object describing information from the application used to send the payment.
event_date              | datetime | The start date and time of the transaction, including timezone. *(required)*

The following enumerators are available for *transaction_direction*: `sent` and `received`.

The following enumerators are available for *pix_modality*: `transacation`, `change` and `withdraw`.

## Submit a Pre-Transaction

Request Body

```json
  {
    "id": "12345",
    ...
  }
```

Response Body

```json
  {
    "id": "12345",
    "analysis_status": "automatically_approved",
    "reason": "rule_decision_enum",
    "reason_desciption": "description da regra"
  }
```

To perform a pre-transaction evaluation, simply send a Transaction type object to the following endpoint:

`POST https://api.caas.qitech.app/account_event/event_type/pre_pix_transaction`

## Challenge Flow

After the analysis is executed, it is possible for the decision to be a "challenge," requiring the user to perform a new action on your platform. This flow can be used, for example, to request 2FA, such as facial analysis, from the user.

## Execution Flow Step-by-Step

**1.** The event is submitted for analysis and will return the status *automatically_challenged*.

Request Body

```json
{
    "id": "082373263",
    ...
    "event_date": "2019-12-11T11:37:15.12-03:00"
}
```

Response Body

```json
{
  "id": "082373263",
  "analysis_status": "automatically_challenge"
  ...
}
```

**2.** After the initial analysis request returns a challenge *analysis_status*, a new request can be sent with the result of the client's process once finalized. This request must use the same event_id as the previous request, and the current status must be *automatically_challenged*. The possible statuses for this update are:

* `approved_by_client`
* `reproved_by_client`

`PATCH https://api.caas.qitech.app/account_event/event_type/pre_pix_transaction/{event_id}`

Request Body: Submission with additional information

```json
{
    "analysis_status": "approved_by_client"
}
````

Response Body

```json
{
  "id": "082373263",
  "analysis_status": "approved_by_client"
  ...
}
```

Make sure to use the same event_id used in your first analysis.

---

# Retrieve an Account Event

URL: /en/documentation/caas/account_event/query_registration

To retrieve a specific account event, simply perform a GET request. The response will return the most up-to-date JSON for the event in question. If the identifier is not associated with any object, an HTTP Status 404 is returned.

## Possible events:
- device_validation
- pre_pix_transaction
- registration_data_validation

`GET https://api.caas.qitech.app/event_type/{event_name}/event/{event_id}`

```shell
curl "https://api.caas.qitech.app/event_type/device_validation/event/12345678"
  -H "Authorization: EXAMPLE-OF-API-KEY"
```

---

# Standards

URL: /en/documentation/caas/account_event/standards

To facilitate integration and ensure information integrity, a set of standards has been defined and is followed throughout the API.

## Monetary Values
> Examples:

```
10000
12345
98741
1223
1
0
```

The APIs assume that all monetary values sent are in Brazilian Reais (BRL). Values must be sent as integers in cents.

## Date and Time with Timezone
> Examples:

```
2019-10-15T22:35:12.232-03:00
2018-05-01T13:32:11.297+00:00
2019-05-01T00:00:00.000+00:00
```

Represented according to ISO 8601. In this case, the timezone is placed immediately after the time and should represent the offset of the location where that data is valid.

The mask used for validation is as follows:

`YYYY-MM-ddThh:mm:ss.sss±hh:mm`

## Date and Time without Timezone
> Examples:

```
2019-10-15T22:35:12
2018-05-01T13:32:11
2019-05-01T00:00:00
```

Represented according to ISO 8601. Data that is independent of a timezone should be sent without it, always in UTC, with the letter "Z" indicating that the data is in UTC. Therefore, the following format will be validated:

`YYYY-MM-ddThh:mm:ss.sssZ`

## Data
> Alguns exemplos

```
2019-10-15
2019-01-01
2017-03-20
```

For fields that receive only the date without any time information, it must be sent in the following format:

`YYYY-MM-dd`

## Documents
Since document numbers vary significantly and many contain non-numeric characters, all document numbers are defined as strings. Another reason to define them as strings is to prevent leading zeros from disappearing. Documents specified on this page have a well-defined mask and are subject to validation. Other documents, such as RG (Identity Card), will not be validated due to their lack of standardization.

## CPF

> Examples of valid CPFs against the defined mask:

```
123.456.789-12
321.987.543-23
111.283.333-00
```

> Examples of invalid CPFs against the defined mask:

```
8.577.477-8
08.104.627/0001-23
123.456.789-1
23.456.789-01
```

The CPF is always defined as a string and will be validated against the mask:

`###.###.###-##`

## CNPJ

> Examples of invalid CNPJs against the defined mask:

```
08.104.627/0001-02
01.079.210/0114-67
32.402.502/0001-35
```

> Examples of invalid CNPJs against the defined mask:

```
8.577.477-8
123.456.789-12
321.987.543-23
32.402.502/0001-3
032.402.502/0001-3
```

The CNPJ is always defined as a string and will be validated against the mask:

`##.###.###/####-##`

## IP Address

> Examples of valid IPs against the defined mask:

```
201.81.161.86
201.081.161.86
201.81.161.086
201.81.0.1
```

> Examples of invalid IPs:

```
201.81..86
358.81.161.86
201.81.161
```

IP addresses must always be sent in IPv4 format. Leading zeros are optional and must follow this mask:

`###.###.###.###`

---

# Status Dynamics

URL: /en/documentation/caas/account_event/status_dynamics

The analysis process consists of sending an event (such as Device Validation) to the appropriate endpoint and waiting for a response.

Once QI Tech completes the event analysis, it will return a response containing a status for that analysis. The **analysis_status** field represents the outcome of the event analysis performed by QI Tech.

### **analysis_status**

As previously described, QI Tech has eight **analysis_status** values that indicate the decision-making status of the account event engine. It follows a straightforward state machine:

| analysis_status | Description |
| :---: | --- |
| **automatically_approved** | QI Tech's algorithms recommend that this event be approved. |
| **automatically_reproved** | QI Tech's algorithms recommend that this event be rejected. |
| **automatically_challenge** | QI Tech's algorithms recommend that the user take an action to provide more information for the analysis. |
| **in_manual_analysis** | QI Tech's algorithms have flagged this event for manual review. |
| **manually_approved** | After manual review, the analyst decided to approve the event. |
| **manually_reproved** | After manual review, the analyst decided to reject the event. |
| **in_queue** | The event is being processed asynchronously. The outcome will be sent via Webhook. |
| **pending** | Queries are taking longer than expected; this event has entered an automated analysis queue and will be answered via Webhook. |
| **not_analysed** | The event was sent with the analysis flag set to false, meaning our systems will not provide a recommendation. |

---

# Account Creation

URL: /en/documentation/caas/account_monitoring/account_registration

The Account Monitoring Product is divided into Individual Accounts (Natural Person) and Corporate Accounts (Legal Person). An Individual Account may contain only natural persons, while a Corporate Account may contain both legal entities and natural persons. To create an account, simply send an object of type _Account_ to one of the following endpoints:

- Individual Account (Natural Person)

`POST https://api.caas.qitech.app/account_monitoring/natural_person_account`

> Example

```json
{
    "account_id": "5ce7fab5-8165-44a5-9b89-bb2d6d61e4f4",
    "registration_date": "2019-12-20T15:23:12"
}
```

- Corporate Account (Legal Person)

`POST https://api.caas.qitech.app/account_monitoring/legal_person_account`

> Example

```json
{
    "account_id": "5ce7fab5-8165-44a5-9b89-bb2d6d61e4f4",
    "registration_date": "2019-12-20T15:23:12"
}
```

All information exchanges related to an account registration use the following object definition. In some cases, to simplify the implementation and reduce data flow between parties, some information may be omitted.

name | type | description
:----: | :----: | ---------
account_id | string | Unique account identifier. **This value must be unique for each request**
registration_date | string (ISO 8601) | Account registration date and time.

## Account Deactivation and Reactivation

To deactivate an account within the Account Monitoring product, send a request to the following endpoint with the payload below, setting the `new_account_status` field to `deactivated`:

- Individual Account (Natural Person)

`PATCH https://api.caas.qitech.app/account_monitoring/natural_person_account/{account_id}`

> Example

```json
{
    "new_account_status": "deactivated"
}
```

- Corporate Account (Legal Person)

`PATCH https://api.caas.qitech.app/account_monitoring/legal_person_account/{account_id}`

> Example

```json
{
    "new_account_status": "deactivated"
}
```

This will deactivate the account and interrupt its monitoring. To reactivate an account — and consequently resume its monitoring — send a request to the same endpoint, now setting `new_account_status` to `active`:

- Individual Account (Natural Person)

`PATCH https://api.caas.qitech.app/account_monitoring/natural_person_account/{account_id}`

> Example

```json
{
    "new_account_status": "active"
}
```

- Corporate Account (Legal Person)

`PATCH https://api.caas.qitech.app/account_monitoring/legal_person_account/{account_id}`

> Example

```json
{
    "new_account_status": "active"
}
```

When an account is reactivated, the monitoring intervals for all account topics are reset. For example, if all topics are monitored every 24 hours, after reactivation the updates will occur 24 hours after the account is reactivated.

---

# authentication

URL: /en/documentation/caas/account_monitoring/authentication

## Authentication

> To authenticate a request, use the following code:

```shell
# In the shell, you only need to add the appropriate header to each request
curl "api_endpoint_here"
  -H "Authorization: EXAMPLE_API_KEY"
```

> Replace the API key `EXAMPLE_API_KEY` with the key provided by our support team.

We use an API Key to allow access to our API. It was most likely already sent to you by email. If you have not yet received your key, please send an email to suporte.caas@qitech.com.br .

Our API expects the API Key to be sent in all requests to our server using a header like the one below:

`Authorization: EXAMPLE_API_KEY`

:::info **Attention**

You must replace EXAMPLE_API_KEY with the API Key provided by the support team.
:::

---

# HTTP Status

URL: /en/documentation/caas/account_monitoring/http_status

All QI Tech APIs use the following standardization for HTTP response status codes, in accordance with RFC 7231 :

HTTP Status | Meaning | Description
---------- | ------- | ---------------------------------
400 | Bad Request | The request sent contains a formatting error. In most cases, we return an explanation in the response body indicating where the error is.
401 | Unauthorized | There was an authentication issue. Please verify that the API Key is correct and sent in the proper header, according to the Authentication section.
403 | Forbidden | The accessed endpoint is for internal use and is not available for this API Key.
404 | Not Found | The requested data was not found using the provided key. This status is also returned when an invalid endpoint is requested.
405 | Method Not Allowed | The HTTP method used does not apply to the accessed endpoint.
406 | Not Acceptable | The data sent in the request body is invalid. In general, this means the payload is not a valid JSON.
409 | Conflict | The request ID corresponds to an ID that has already been processed. This status is returned in the case of duplicate requests sent to the server.
500 | Internal Server Error | We encountered an issue while processing this request. When this error occurs, our specialists are automatically notified and immediately begin analysis and resolution.
503 | Service Unavailable | You have encountered a planned or unplanned infrastructure outage of our servers.

---

# Introduction

URL: /en/documentation/caas/account_monitoring/introduction

Welcome to the QI Tech Account Monitoring API! You can use our API to monitor accounts and individuals across several monitoring topics, respecting fully customizable monitoring intervals according to the client’s demands and needs. Today, the product supports the following monitoring topics:

- For Individuals (Natural Persons);
  - OFAC List – Sanctions List from the Office of Foreign Assets Control
  - UNSC List – Sanctions List from the United Nations Security Council
  - IBAMA List – Environmental Penalties List from the Brazilian Institute of Environment and Renewable Natural Resources
  - PEP List – Politically Exposed Persons List
  - Federal Revenue Status – Registration status with the Brazilian Federal Revenue Service

- For Legal Entities (Companies);
  - OFAC List – Sanctions List from the Office of Foreign Assets Control
  - UNSC List – Sanctions List from the United Nations Security Council
  - IBAMA List – Environmental Penalties List from the Brazilian Institute of Environment and Renewable Natural Resources
  - CEIS List – Registry of Ineligible and Suspended Companies
  - CNEP List – National Registry of Punished Companies
  - Federal Revenue Status – Registration status with the Brazilian Federal Revenue Service

Please note that monitoring intervals are defined per monitoring topic and per type of monitored entity. For example, the OFAC List can be monitored every 10 days for Individuals and every 30 days for Legal Entities.

The monitoring interval for each topic follows the ISO 8601 standard and can be any of the intervals listed below, or a combination of them:

### Days, Weeks, Months, and Years

| Notation | Meaning |
|----------|---------|
| `"P1D"`  | 1 day   |
| `"P7D"`  | 7 days  |
| `"P1W"`  | 1 week  |
| `"P1M"`  | 1 month |
| `"P1Y"`  | 1 year  |

---

### Hours, Minutes, and Seconds

| Notation        | Meaning                          |
|-----------------|----------------------------------|
| `"PT1H"`        | 1 hour                           |
| `"PT30M"`       | 30 minutes                       |
| `"PT45S"`       | 45 seconds                       |
| `"PT2H30M"`     | 2 hours and 30 minutes           |
| `"PT1H15M10S"`  | 1 hour, 15 minutes, and 10 seconds |

---

### Custom Examples

| Notation            | Meaning                                     |
|---------------------|---------------------------------------------|
| `"P1DT12H"`         | 1 day and 12 hours                          |
| `"P2W3DT4H30M"`     | 2 weeks, 3 days, 4 hours, and 30 minutes    |

Below, you can see an example implementation of the API using curl. These examples can be adapted to the programming language of your choice.

## Problems?

We are not a company that hides behind an API! Contact our support team and we will respond as quickly as possible. Feel free to call us if you need a faster response!

### We Love Feedback

Even if you have already solved your issue or if it is very simple (even a typo or a formatting issue that you already understood), send us an email. This helps us make the documentation more practical so the next person doesn’t have to go through the same pain you did!

## Environments

We provide two environments for our clients. The base URLs for the APIs are:

* Production – `https://api.caas.qitech.app/account_monitoring/`
* Sandbox – `https://api.sandbox.caas.qitech.app/account_monitoring/`

In the Sandbox environment, submitted analyses are not charged and are answered according to predefined rules.

## HTTPS Only

For security reasons, all communication with QI Tech APIs must be performed using HTTPS. To prevent HTTP calls due to inattention or other reasons, this server only exposes port 443 with TLS 1.2 communication. Requests made using other protocols will be automatically denied.

## Authentication

> To authenticate a request, use the following code:

```shell
curl "api_endpoint_here" \
  -H "Authorization: EXAMPLE_API_KEY"

---

# Person Creation

URL: /en/documentation/caas/account_monitoring/person_registration

To create people for their respective accounts, segregation between the
natural_person_account and legal_person_account endpoints must be maintained.

To request the creation of a person for an account, simply send a Person object to one of the
following endpoints, respecting the segregation defined during account creation.

## Individual Account (Natural Person)

### Natural Person Creation

`POST https://api.caas.qitech.app/account_monitoring/natural_person_account/{account_id}/natural_person`

> Example

```json
{
    "id": "cc2f97ba-08c8-4a91-8d0d-49313a6c1245",
    "registration_date": "2024-11-04T13:37:00Z",
    "data": {
        "name": "John Doe",
        "document_number": "123.456.789-09",
        "birthdate": "2000-07-13"
    }
}
```
### Legal Person Account

- Natural Person Creation

`POST https://api.caas.qitech.app/account_monitoring/legal_person_account/{account_id}/natural_person`

> Example

```json
{
    "id": "cc2f97ba-08c8-4a91-8d0d-49313a6c1245",
    "registration_date": "2024-11-04T13:37:00Z",
    "data": {
        "name": "John Doe",
        "document_number": "123.456.789-09",
        "birthdate": "2000-07-13"
    }
}
```
The birthdate field is mandatory only for accounts that have status monitoring
with the Brazilian Federal Revenue Service. It is required to query individuals
under 18 years old.

- Legal Person Creation

`POST https://api.caas.qitech.app/account_monitoring/legal_person_account/{account_id}/legal_person`

> Example

```json
{
    "id": "cc2f97ba-08c8-4a91-8d0d-49313a6c1245",
    "registration_date": "2024-11-04T13:37:00Z",
    "data": {
        "name": "Empresa das Tampas",
        "document_number": "12.482.243/0001-34"
    }
}
```

## Person Deactivation and Reactivation

The deactivation and reactivation of people follows the same logic used for accounts, using the endpoints below.

### Natural Person Account

- Natural Person

`PATCH https://api.caas.qitech.app/account_monitoring/natural_person_account/{account_id}/natural_person`

> Example

```json
{
    "new_person_status" : "deactivated"
}
```
### Legal Person Account

- Natural Person

`PATCH https://api.caas.qitech.app/account_monitoring/legal_person_account/{account_id}/natural_person`

> Example

```json
{
    "new_person_status" : "deactivated"
}
```

- Legal Person

`PATCH https://api.caas.qitech.app/account_monitoring/legal_person_account/{account_id}/legal_person`

> Example

```json
{
    "new_person_status" : "deactivated"
}
```

To reactivate previously deactivated people, the operation is the same as the one used to deactivate people, but sending new_person_status as active to the following endpoints:

### Natural Person Account

- Natural Person

`PATCH https://api.caas.qitech.app/account_monitoring/natural_person_account/{account_id}/natural_person`

> Example

```json
{
    "new_person_status" : "active"
}
```
### Legal Person Account

- Natural Person

`PATCH https://api.caas.qitech.app/account_monitoring/legal_person_account/{account_id}/natural_person`

> Example

```json
{
    "new_person_status" : "active"
}
```

- Legal Person

`PATCH https://api.caas.qitech.app/account_monitoring/legal_person_account/{account_id}/legal_person`

> Example

```json
{
    "new_person_status" : "active"
}
```

---

# Standards

URL: /en/documentation/caas/account_monitoring/standards

To facilitate integration and ensure data integrity, some standards have been defined and are followed throughout the entire API.

## Date and Time with Time Zone
> Some examples:

```
2019-10-15T22:35:12-03:00
2018-05-01T13:32:11+00:00
2019-05-01T00:00:00+00:00
```

It is represented according to ISO 8601. In this case, the time zone is placed right after the time and must represent the time zone of the location where that data is valid. For example, if a rental is scheduled to start at 09:30 at Brasília airport, the time sent must be represented as 09:30-03:00. If the rental is scheduled to start at 09:30 in Manaus, it must be represented as 09:30-04:00.

The validation mask used is the following:

`YYYY-MM-ddThh:mm:ss±hh:mm`

## Date and Time without Time Zone
> Some examples:

```
2019-10-15T22:35:12Z
2018-05-01T13:32:11Z
2019-05-01T00:00:00Z
```

It is represented according to ISO 8601. Data that does not depend on a time zone must be sent without it, always in UTC, with the letter `Z` indicating that the data is in UTC. Therefore, the following format will be validated:

`YYYY-MM-ddThh:mm:ssZ`

## Date
> Some examples:

``` 
2019-10-15
2019-01-01
2017-03-20
```

For fields that accept only a date, such as a birthdate, only the date should be sent, without any time, using the following format:

`YYYY-MM-dd`

## Documents

Since document numbers can vary greatly and many of them contain non-numeric characters, all document numbers are defined as strings. Another important reason to define them as strings is to prevent leading zeros from being lost. Documents listed on this page have a well-defined mask and will be subject to validation. Other documents, such as RG, due to their lack of standardization, will not be validated.

## CPF

> Examples of CPFs valid against the defined mask:

```
123.456.789-12
321.987.543-23
111.283.333-00
```

> Examples of CPFs invalid against the defined mask:

```
8.577.477-8
08.104.627/0001-23
123.456.789-1
23.456.789-01
```

The CPF is always defined as a string and will be validated against the mask:

`###.###.###-##`

## CNPJ

> Examples of CNPJs valid against the defined mask:

```
08.104.627/0001-02
01.079.210/0114-67
32.402.502/0001-35
```

> Examples of CNPJs invalid against the defined mask:

```
8.577.477-8
123.456.789-12
321.987.543-23
32.402.502/0001-3
032.402.502/0001-3
```

The CNPJ is always defined as a string and will be validated against the mask:

`##.###.###/####-##`

---

# Webhook

URL: /en/documentation/caas/account_monitoring/webhook

Updates to monitoring topics will be notified through webhook deliveries. To enable this, it is necessary to configure—through the [support](mailto:suporte.caas@qitech.com.br) team—an endpoint address where we will send update notifications, as well as a *signature_key* that will be used to sign the request. It is important to note that all webhook deliveries will be sent to a single endpoint.

:::info **Attention**

For security reasons, all Webhook requests will only be made to endpoints served over HTTPS.
:::

## Signature

> Example of signature calculation in Python

```python
hmac_obj = hmac.new(
    signature_key.encode('utf-8'),
    (url + method + payload).encode('utf-8'),
    hashlib.sha1
)
return hmac_obj.hexdigest()
```

To ensure that the request received at the webhook endpoint originates from our servers, an HMAC signature is sent in the *Signature* header, similarly to the authentication process.

After calculating the expected signature value on the server side, it is necessary to compare the calculated signature with the one received. If the signatures match, it means that the request originated from our servers and can be trusted.

## Event Update Webhook

Request Body

```json
{
    "person_type" : "natural_person",
    "account_type" : "natural_person_account",
    "person_id" : "22f5d028-0ce7-46f7-9b63-e7e38171b485",
    "account_id" : "e49ac344-f941-4668-9afb-a52ce4e5754a",
    "monitoring_topic" : "OFAC",
    "event" : "entered"
}
```

Below is the meaning of each field:

| Name              | Type   | Description                                                                 |
|:-----------------:|:------:|-----------------------------------------------------------------------------|
| person_type       | string | Person type (`natural_person` or `legal_person`).                           |
| account_type      | string | Account type (`natural_person_account` or `legal_person_account`).          |
| person_id         | string | Unique identifier of the person, provided in the creation request.          |
| account_id        | string | Unique identifier of the account, provided in the creation request.         |
| monitoring_topic  | string | Monitoring topic in which the change occurred.                              |
| event             | string | Type of event that occurred, such as `"entered"` or `"exited"` for restrictive list topics. |

The monitoring topic update request follows the format above and notifies a change in the status of one of the monitoring topics within the account. The HTTP method used is PUT, and the endpoint URL may also contain the event ID, depending on the client's needs. It is important to note that the request body is sent as UTF-8 encoded text.

## Retries

The notification is considered successfully delivered when an HTTP 200 status is returned. If delivery fails, up to 7 retry attempts will be made with the following intervals, until a 200 response is received or all attempts are exhausted:

* 10 seconds
* 40 seconds
* 160 seconds
* 640 seconds
* 2560 seconds
* 10240 seconds
* 40960 seconds

---

# Session Creation

URL: /en/documentation/caas/auth_session_manager/auth_session

The authentication session object is an entity that represents the user's authentication flow. Through this element, you can manage the registration information collection process.

## Authentication Session Object Definition

Request Body

```json
{
  "id": "12345678",
  "document_number": "111.111.111-11",
  "settings": {
    "steps": [
      {
        "step": "device_scan"
      },
      {
        "step":"face_recognition",
      },
      {
        "step":"personal_document",
        "show_success_screen": true,
        "show_introduction_screen": true,
        "document_templates":[
            "rg",
            "cnh",
            "cnh_digital"
        ]
      }
    ],
    "session_expiration_time_in_minutes": 120,
    "token_expiration_seconds": 3600,
    "open_mode": "iframe"
  }
}
```

All information exchanges for a session use the following definition for this object:

name | type | description
:----: | :----: | ---------
id | string | Session identifier. **It is essential that this number be unique for each session** *(required)*
document_number | string | CPF of the individual being registered, with dots and hyphens, according to the standard. *(required)*
settings | object | Object with the custom settings for the authentication session. If not sent, the company's default configuration will be used.

## settings object

The settings object contains the `steps` field which defines the sequence of authentication steps and their respective configurations. The accepted steps are:

* device_scan
* face_recognition
* personal_document

The following fields are also accepted:

name | type | description
:----: | :----: | ---------
session_expiration_time_in_minutes | integer | Session expiration date. After this date, the session will not be valid.
token_expiration_seconds | integer | Session token expiration time in seconds. (must be between 1 and 172800, maximum 48 hours. Default value is 1800)
open_mode | string | Defines the session opening mode, for the message and buttons of the completion flow. (must be: "iframe" or "link").

### device_scan

The device_scan step indicates the execution of device information collection. **Has no additional configurations**

### face_recognition

The face_recognition step indicates the execution of the liveness proof flow collection through facial biometrics. **Has no additional configurations**

### personal_document

The personal_document step indicates the execution of the OCR flow collection for document reading.

name | type | description
:----: | :----: | ---------
document_templates | array | List of documents that can be collected in the registration flow. *(required)*
show_success_screen | boolean | Defines whether the success screen is shown in the document capture flow. Default value `true`.
show_introduction_screen | boolean | Defines whether the introduction screen is shown in the document capture flow. Default value `true`.

Accepted `document_templates` values:

Name | Type | Description
---- | ---- | ---------
cnh | string | Capture of physical driver's license (CNH) FRONT and BACK (**closed**), in two steps
rg | string | Capture of physical ID card (RG) FRONT and BACK (**closed**), in two steps
cnh_digital | string | Submission of **digital** driver's license (pdf)
passport | string | Submission of Passport FRONT and BACK (**closed**), in two steps.
rne | string | Submission of National Registry of Foreigners FRONT and BACK (**closed**), in two steps.
crnm | string | Submission of National Migration Registry Card FRONT and BACK (**closed**), in two steps.
ctps | string | Submission of Work and Social Security Card FRONT and BACK (**closed**), in two steps.
others | string | Submission of any document **exempt from validation** FRONT and BACK (**closed**), in two steps.

## Submit an Auth Session

Request Body

```json
  {
    "id": "12345",
    ...
  }
```

Response Body

```json
  {
    "id": "12345678",
    "status": "pending",
    "expiration_date": "2025-12-11T11:37:15.12-03:00",
    "settings": {
      ...
    },
    "auth_session_hash": "1cFL1vM",
    "step": "device_scan",
    "auth_session_url": "https://auth-session.production.caas.qitech.app/s/1cFL1vM/t/fc0bae39-1c41-4bc2-a5a1-39a7ca01121b",
    "token": "fc0bae39-1c41-4bc2-a5a1-39a7ca01121b",
    "token_expiration_date": "2025-12-10T11:37:15.12-03:00",
  }
```

To create a session, simply send an Auth Session object to the following endpoint:

`POST https://api.caas.qitech.app/auth_session_manager/auth_session`

---

# Authentication

URL: /en/documentation/caas/auth_session_manager/authentication

> To authenticate a call, use the following code:

```shell
# In the shell, you only need to add the appropriate header to each request
curl "api_endpoint_here"
  -H "Authorization: EXAMPLE-OF-API-KEY"
```

> Replace the API Key 'EXAMPLE-OF-API-KEY' with your key, which should be obtained from our support team.

We use an API Key to allow access to our API. It has probably already been sent to you by email. If you have not yet received your key, send an email to suporte.caas@qitech.com.br .

Our API expects to receive the API Key in all requests to our server in a header like the one below:

`Authorization: EXAMPLE-OF-API-KEY`

:::info **Attention**

You must replace EXAMPLE-OF-API-KEY with your key, which should be obtained from our support team.
:::

---

# HTTP Status

URL: /en/documentation/caas/auth_session_manager/http_status

All QI Tech APIs use the following standardization for HTTP response status codes, in accordance with RFC 7231 :

Status HTTP | Meaning | Description
---------- | ------- | ---------------------------------
400 | Bad Request | The request sent has a formatting error. In most cases, we return an explanation in the response body indicating where the error is.
401 | Unauthorized | There was an authentication problem; verify that the API Key is correct and in the correct header, as described in the Authentication section.
403 | Forbidden | The endpoint accessed is for internal use and is not available for this API Key.
404 | Not Found | The requested data was not found using the key provided. This status is also returned when an invalid endpoint is requested.
405 | Method Not Allowed | The HTTP method used does not apply to the endpoint used.
406 | Not Acceptable | The data sent in the request body is invalid. In general, this means the data sent is not valid JSON.
409 | Conflict | The request id matches an id that was already processed previously. This status is returned in the case of duplicate requests sent to the server.
500 | Internal Server Error | We had a problem processing this request; when we encounter this error our specialists are automatically notified and begin analysis and resolution immediately.
503 | Service Unavailable | You have encountered an outage, planned or not, of our server infrastructure.

---

# Introduction

URL: /en/documentation/caas/auth_session_manager/introduction

Welcome to the QI Tech Authentication Session Management API! This API was designed to control the complete user KYC flow!

This service organizes the authentication process, enabling the creation of KYC registration sessions with customized flows and use of other QI Tech authentication services:

* Device Scan
* Face Recognition
* OCR

This way, it is possible to start the registration information collection flow through the link returned by the API. Once started, the web page will be responsible for guiding the user through the KYC steps defined in that session.

Furthermore, by being directly integrated with the other services described above, it is able to collect the information necessary to complete the authentication flow. With this information, it will be possible to perform the desired analysis on other QI Tech services, such as individual registration or a pre-transactional analysis, for example.

## Problems?

We are not a company that hides behind an API! Contact our support and we will respond as quickly as possible. Feel free to call us if you want a quick response!

### We Love Feedback

Even if you have already resolved your issue or if it is very simple (even a typo or inadequate organization that you have noticed), send us an email so we can make the documentation increasingly more practical and the next person won't have to suffer the same pains you did!

## Environments

We have two environments for our clients. The base URLs for the APIs are:

* Production - `https://api.caas.qitech.app/auth_session_manager/`
* Sandbox - `https://api.sandbox.caas.qitech.app/auth_session_manager/`

:::danger Important Notice!
Real data from individuals and/or legal entities must not be used in QI Tech's Sandbox environments.
:::

In the Sandbox environment, submitted analyses are not charged and are responded to according to the rule configured for the event.

## HTTPS Only

For security reasons, all communication with QI Tech APIs must be carried out using HTTPS. To ensure that, due to inattention or any other reason, no HTTP calls occur, this server only makes port 443 available with TLS 1.2 communication. Calls made using other protocols will be automatically denied.

---

# Session Management

URL: /en/documentation/caas/auth_session_manager/retrieve_session

When creating an authentication session, simply use the generated link to start the user registration flow. This can be done by sending the link or using it directly on your website, with tools such as `iframe`.

## Response object

The response object from creating and retrieving an `auth_session` contains the following information:

Response Body

```json
  {
    "id": "12345678",
    "status": "pending",
    "expiration_date": "2025-12-11T11:37:15.12-03:00",
    "step_data": {
      "face_recognition": {
        "image_key": "65441d8d-015a-4a0f-97b6-b7d4fc5619b7",
        "event_date": "2025-12-11T11:37:15.12-03:00"
      },
      "personal_document": {
          "document_template": "rg",
          "ocr_keys": [
            "e13c71d0-ae0e-48e2-8c42-26f997412039",
            "3991b716-0980-409f-8e33-e3a8dd9a671c"
          ],
          "event_date": "2025-12-11T11:37:15.12-03:00"
      },
      "device_scan": {
          "session_id":  "4d450227-c77c-4487-830b-42dcd127798a",
          "event_date": "2025-12-11T11:37:15.12-03:00"
      }
    },
    "settings": {
      ...
    },
    "auth_session_hash": "1cFL1vM",
    "step": "device_scan",
    "auth_session_url": "https://auth-session.production.caas.qitech.app/s/1cFL1vM/t/fc0bae39-1c41-4bc2-a5a1-39a7ca01121b",
    "token": "fc0aaa39-1c21-1bc1-a5a1-39a7ca01121b",
    "token_expiration_date": "2025-12-10T11:37:15.12-03:00",
  }
```

This object is returned by the session retrieval endpoint:

`GET https://api.caas.qitech.app/auth_session_manager/auth_session/{id}`

Response fields description:

name | type | description
:----: | :----: | ---------
id | string | Session ID.
status | string | Session status.
expiration_date | date | Session expiration date. After this date, the session is invalidated.
step_data | object | Object containing the session event results.
settings | object | Session configuration object.
auth_session_hash | string | Session identification hash.
step | string | User's current step.
auth_session_url | string | URL used to collect registration information.
token | string | Session authentication token.
token_expiration_date | date | Expiration date of the temporary authentication token. Default set to 2 hours after session creation.

### Status

Possible status values:

* pending
* completed
* expired

### step_data object

Object containing the data collected from each step.

:::info Information
If the step is not listed in the session settings, it will not be present as a field in the `step_data` object
:::

`face_recognition`

Name | Type | Description
---- | ---- | ---------
image_key | string | Identification key for the face_recognition step.
event_date | date | Step completion date.

`personal_document`

Name | Type | Description
---- | ---- | ---------
document_template | string | Template selected by the user at document collection time.
ocr_keys | list | List of identification keys for each collected document.
event_date | date | Step completion date.

`device_scan`

Name | Type | Description
---- | ---- | ---------
session_id | string | Identification key for the device scan step.
event_date | date | Step completion date.

## Web flow authentication

To ensure greater security for the application, we return a temporary token for the web page. You can retrieve the token or generate a new one through the endpoint:

`POST https://api.caas.qitech.app/auth_session_manager/auth_session/{id}/token`

Request Body

```json
  {
    "token_expiration_seconds": 3600
  }
```

The token object has only one optional field:

Name | Type | Description
---- | ---- | ---------
token_expiration_seconds | integer | Session token expiration time in seconds. (must be between 1 and 172800, maximum 48 hours. Default value is 1800)

Response Body

```json
  {
    "id": "12345678",
    "token": "e7e99a40-0b26-4bb9-a068-9fa4886eeef3",
    "token_expiration_date": "2025-12-10T13:37:15.12-03:00",
  }
```

Thus, if the token has expired, you can continue with the authentication session by generating a new token.

# Webhook

Session completion will be notified via webhook. To do so, it is necessary to configure, through the [support](mailto:suporte.caas@qitech.com.br) team, an endpoint address where we will send the notifications and also a *signature_key* that will be used to sign the request. It is worth noting that all webhook deliveries will be sent to a single endpoint.

:::info **Attention**

For security reasons, all Webhook requests will only be made to endpoints served over HTTPS.
:::

## Communication with the web page

The web page can be integrated through a tool called `iframe`. In the following way:

```html
<iframe id="iframe" src="" href="{auth_session_url}" allow="camera; microphone" referrerPolicy="no-referrer"></iframe>
```

> ⚠️ **Required Configuration**
>
> For the iframe to work correctly in **production** (`auth-session.caas.qitech.app`) and **sandbox** (`auth-session.sandbox.caas.qitech.app`), it is necessary to configure the following Permissions-Policy header:
>
> **Configuration with specific URLs (recommended):**
> ```json
> {
>   "key": "Permissions-Policy",
>   "value": "geolocation=(self \"https://auth-session.caas.qitech.app\" \"https://auth-session.sandbox.caas.qitech.app\"), microphone=(self \"https://auth-session.caas.qitech.app\" \"https://auth-session.sandbox.caas.qitech.app\"), camera=(self \"https://auth-session.caas.qitech.app\" \"https://auth-session.sandbox.caas.qitech.app\"), fullscreen=(self \"https://auth-session.caas.qitech.app\" \"https://auth-session.sandbox.caas.qitech.app\")"
> }
> ```
>
> **Alternative configuration (less restrictive):**
> ```json
> {
>   "key": "Permissions-Policy",
>   "value": "geolocation=*, microphone=*, camera=*, fullscreen=()"
> }
> ```
>
> This configuration must be applied on the server that hosts the page containing the iframe to ensure that the necessary permissions are granted.

If the link is called in this way, the web page will send return messages to the page that requested it. The possible return messages are:

* success
* canceled
* invalid_token
* expired

Which can be accessed in the following way:

```javascript
window.addEventListener("message", (event) => {
            if (event.data === "canceled") {
              //close iframe
            }
            if (event.data === "invalid_token") {
              //close iframe
            }
            if (event.data === "success") {
              //close iframe
            }  
            if (event.data === "expired") {
              //close iframe
            }
        });
```

## Flow completion

This service will manage the authentication data collection flow, which can be used in other services. For more information on how to use the returned keys in other products, see the individual registration analysis example [Registration Analysis](https://docs.qitech.com.br/documentation/caas/onboarding/query_registration)

---

# authentication

URL: /en/documentation/caas/banking/authentication

## Authentication

> To authenticate a call, use the following code:

```shell
# In the shell, you only need to add the appropriate header to each request
curl "api_endpoint_here"
  -H "Authorization: EXAMPLE_API_KEY"
```

> Replace the API key 'EXAMPLE_API_KEY' with the key acquired from our support.

We use an API Key to allow access to our API. It has likely already been sent to you by email. If you have not yet received your key, send an email to suporte.caas@qitech.com.br .

Our API expects to receive the API Key in all requests to our server in a header like the one below:

`Authorization: EXAMPLE_API_KEY`

:::info **Attention**

You must replace EXAMPLE_API_KEY with the API Key received from support.
:::

---

# Bankslip

URL: /en/documentation/caas/banking/bankslips

At the moment a user makes or receives a bankslip payment, the payment data must be sent to QI Tech. In this way, it will be possible to perform an analysis of the risk involved in that operation using the data.

## Bankslip Object Definition

Request Body

```json
{
    "id": "082373263",
    "bankslip_direction": "received",
    "document_amount": 13725,
    "discount_amount": 1000,
    "other_deduction_amount": 0,
    "interest_amount": 254,
    "amount": 12979,
    "bankslip_payment_date": "2020-10-07T15:06:25-03:00",
    "bankslip_due_date": "2020-10-07",
    "bankslip_issuing_date": "2020-10-07",
    "description": "BOLETO PARA PAGAMENTO DA MENSALIDADE DE SETEMBRO",
    "face_recognition_key": "ef39e206-13d5-48de-b368-6c3bbc6f0222",
    "validation_key": "69a59de3-0198-4a26-933a-c1de624c147d",
    "payer": {
        "id": "182373263",
        "type": "legal_person",
        "document_number": "07.487.735/0001-69",
        "name": "Gioconda Pizzaria e Rotisseria LTDA.",
        "address": {
            "street": "Avenida 13",
            "number": "704",
            "neighbourhood": "Centro",
            "city": "Ituiutaba",
            "uf": "MG",
            "complement": "Apt 1101",
            "postal_code": "38300-140"
        },
        "phone": {
            "international_dial_code": "55",
            "area_code": "16",
            "number": "981610077",
            "type": "mobile"
        },
        "email": "mailto@qitech.com.br",
        "account": {
            "participant": "60701190",
            "branch": "3675",
            "account_number": "13212",
            "account_digit": "5",
            "account_type": "CACC"
        },
        "sales_channel": "inbound_sales",
        "segment": "Personalité"
    },
    "recipient": {
        "id": "282373263",
        "type": "legal_person",
        "document_number": "056.966.649-03",
        "name": "Francisco Oliveira Benedetti",
        "address": {
            "street": "Avenida 13",
            "number": "704",
            "neighbourhood": "Centro",
            "city": "Ituiutaba",
            "uf": "MG",
            "complement": "Apt 1101",
            "postal_code": "38300-140"
        },
        "phone": {
            "international_dial_code": "55",
            "area_code": "16",
            "number": "981610077",
            "type": "mobile"
        },
        "account": {
            "participant": "60701190",
            "branch": "3675",
            "account_number": "10552",
            "account_digit": "6",
            "account_type": "CACC"
        }
    },
    "final_recipient": {
        "id": "382373263",
        "type": "legal_person",
        "document_number": "056.966.649-03",
        "name": "Francisco Oliveira Benedetti",
        "address": {
            "street": "Avenida 13",
            "number": "704",
            "neighbourhood": "Centro",
            "city": "Ituiutaba",
            "uf": "MG",
            "complement": "Apt 1101",
            "postal_code": "38300-140"
        },
        "phone": {
            "international_dial_code": "55",
            "area_code": "16",
            "number": "981610077",
            "type": "mobile"
        },
        "account": {
            "participant": "60701190",
            "branch": "3675",
            "account_number": "10442",
            "account_digit": "6",
            "account_type": "CACC"
        }
    },
    "source": {
        "channel": "internet_banking",
        "platform": "android",
        "ip": "198.185.056.098",
        "session_id": "7839jdqd9a8wd9"
    }
}
```

A bankslip payment must be sent to the API before being forwarded to the processing system in order to perform a prior fraud validation.

The payment status represents the decision returned by the model regarding that bankslip. The following statuses are used in the **analysis_status** flag:

* `automatically_approved`
* `automatically_reproved`
* `in_manual_analysis`
* `pending`

Below are the meanings of each decision returned in the analysis_status flag:

status | description
:----: | ---------
automatically_approved      | It is recommended that this bankslip payment be approved.
automatically_reproved      | It is recommended that this bankslip payment be reproved.
in_manual_analysis          | It is recommended that this bankslip payment be analyzed manually.
pending                     | The bankslip payment is being processed.

name | type | description
:----:  | :----:  | ---------
id | string | Transaction identifier in the client's system. **It is essential that this number is unique for each bankslip payment**
bankslip_direction        | enumerator                | Bankslip payment modality. Defines whether the client is payer or the receiver of the bankslip operation
document_amount         | integer                   | Document amount in cents - as described in the "Standards" section.
discount_amount          | integer                   | Discount or abatement amount applied to the document value in cents - as described in the "Standards" section.
other_deduction_amount  | integer                   | Value of other deductions applied to the document value in cents - as described in the "Standards" section.
interest_amount         | integer                   | Value of fines, late fees, or interest applied to the document value in cents - as described in the "Standards" section.
amount                  | integer                   | Final amount paid on the bankslip - as described in the "Standards" section.
bankslip_payment_date     | datetime                  | The date and time of the bankslip payment, with time zone.
bankslip_due_date         | date                      | Bankslip due date according to standardization.
bankslip_issuing_date     | date                      | Bankslip issuance date according to standardization.
description             | string                    | Description or remarks field of the bankslip.
face_recognition_key    | string                    | Facial recognition key, if facial recognition was performed by our facial recognition API.
validation_key          | string                    | Validation key, if any client validation test was performed in our validation API.
payer                   | *bankslip_payer* | Object representing the individual (natural person) or legal entity that paid the bankslip.
recipient               | *bankslip_recipient* | Object representing the individual (natural person) or legal entity beneficiary of the bankslip.
final_recipient         | *bankslip_recipient* | Object representing the individual (natural person) or legal entity final beneficiary of the bankslip.
source                  | *source* | Source type object describing information coming from the application used for the bankslip payment.

The following enumerators exist for *bankslip_direction*: `payed` and `received`.

## Send a BankSlip Payment

Request Body

```json
  {
    "id": "12345",
    ...
  }
```

Response Body

```json
  {
    "bankslip_key": "13d680ef-4b72-4cb2-a63d-cf3d790abaaf",
    "status": "automatically_approved",
    "reason": "rule_decision_enum"
  }
```

To perform the evaluation of a bankslip payment, simply send a BankSlip object to the following endpoint:

`POST https://api.caas.qitech.app/bankslip/bankslip`

## Retrieve a BankSlip Payment

Response Body

```json
  {
    "id": "082373263",
    "bankslip_direction": "received",
    ...
  }
```

To retrieve data from a bankslip payment, simply send a request to the following endpoint:

`GET https://api.caas.qitech.app/bankslip/bankslip/{bankslip_id}`

Where *bankslip_id* is the transaction identifier in the client's system used when sending the bankslip.

## Update a BankSlip Payment

Request Body

```json
  {
    "bankslip_status": "completed",
    "event_date": "2020-10-07T15:06:25-03:00"
  }
```

Response Body

```json
  {
    "bankslip_key": "13d680ef-4b72-4cb2-a63d-cf3d790abaaf",
    "bankslip_status": "completed"
  }
```

After a bankslip payment is created and analyzed, it will be sent to the clearing house to be processed. Thus, it is necessary to report the payment status updates when it is sent, via the endpoint:

`PUT https://api.caas.qitech.app/bankslip/bankslip/{bankslip_id}`

In this way, it is guaranteed that our database is updated and we are able to identify bankslip payments that are actually susceptible to fraud.

---

# Bill Payment

URL: /en/documentation/caas/banking/bill_payments

When a user performs a bill payment, the payment details must be sent to QI Tech. This enables a risk analysis of the operation using the provided data.

## Bill Payment Object Definition

Request Body

```json
{
    "id": "082373263",
    "amount": 12979,
    "bill_payment_date": "2020-10-07T15:06:25-03:00",
    "bill_due_date": "2020-10-07",
    "bill_issuing_date": "2020-10-07",
    "service_description": "CONTA DE ELETRICIDADE ENEL",
    "face_recognition_key": "ef39e206-13d5-48de-b368-6c3bbc6f0222",
    "validation_key": "69a59de3-0198-4a26-933a-c1de624c147d",
    "company": {
        "id": "451673263",
        "provided_service": "eletricity", 
        "name" : "Enel",
        "legal_name": "Eletropaulo Metropolitana Eletricidade de São Paulo S.A.",
        "document_number": "61.695.227/0001-93",
        "address": {
            "street": "Av. Dr. Marcos Penteado de Ulhôa Rodrigues",
            "number": "939",
            "neighbourhood": "Sítio Tamboré",
            "city": "Barueri",
            "uf": "SP",
            "complement": "Loja 1 e 2",
            "postal_code": "06460-040"
        }
    },
    "payer": {
        "id": "182373263",
        "type": "legal_person",
        "document_number": "07.487.735/0001-69",
        "name": "Gioconda Pizzaria e Rotisseria LTDA.",
        "email": "gioconda_pizza@bol.com.br",
        "address": {
            "street": "Avenida 13",
            "number": "704",
            "neighbourhood": "Centro",
            "city": "Ituiutaba",
            "uf": "MG",
            "complement": "Apt 1101",
            "postal_code": "38300-140"
        },
        "phone": {
            "international_dial_code": "55",
            "area_code": "16",
            "number": "981610077",
            "type": "mobile"
        },
        "account": {
            "participant": "60701190",
            "branch": "3675",
            "account_number": "13212",
            "account_digit": "5",
            "account_type": "CACC"
        },
        "sales_channel": "inbound_sales",
        "segment": "Personalité"
    },
    "source": {
        "channel": "internet_banking",
        "platform": "android",
        "ip": "198.185.105.098",
        "session_id": "7839jdqd9a8wd9"
    }
}
```

A bill payment must be submitted to the API for preliminary fraud validation before being forwarded to the processing system.

The payment status represents the decision returned by the model regarding that bill. The following statuses are used in the **analysis_status** flag:

* `automatically_approved`
* `automatically_reproved`
* `in_manual_analysis`
* `pending`

Below are the meanings of each decision returned in the analysis_status flag:

status | description
:----: | ---------
automatically_approved      | It is recommended that this bill payment be approved.
automatically_reproved      | It is recommended that this bill payment be reproved.
in_manual_analysis          | It is recommended that this bill payment be analyzed manually.
pending                     | The bill payment is being processed.

name | type | description
:----:  | :----:  | ---------
id | string | Transaction identifier in the client's system. **It is essential that this number is unique for each bill payment**
document_amount         | integer                   | Document amount in cents - as described in the "Standards" section.
other_deduction_amount  | integer                   | Value of other deductions applied to the document value in cents - as described in the "Standards" section.
interest_amount         | integer                   | Value of fines, late fees, or interest applied to the document value in cents - as described in the "Standards" section.
amount                  | integer                   | Final amount paid on the bill - as described in the "Standards" section.
bill_payment_date     | datetime                  | The date and time of the bill payment, with time zone.
bill_due_date         | date                      | Bill due date according to standardization.
description             | string                    | Description or remarks field of the bill.
face_recognition_key    | string                    | Facial recognition key, if facial recognition was performed by our facial recognition API.
validation_key          | string                    | Validation key, if any client validation test was performed in our validation API.
client                  | *client* | Object representing the client's data, whether they are paying or receiving the payment.
company                 | *company* | Object representing the utility company or service provider related to that bill.
payer                   | *bill_payer* | Object representing the individual (natural person) or legal entity that paid the bill.
recipient               | *bill_client* | Object representing the individual (natural person) or legal entity for whom the bill was issued.
source                  | *source* | Source type object describing information coming from the application used for the bill payment.

## Send a Bill Payment

Request Body

```json
  {
    "id": "12345",
    ...
  }
```

Response Body

```json
  {
    "bill_payment_key": "13d680ef-4b72-4cb2-a63d-cf3d790abaaf",
    "status": "automatically_approved",
    "reason": "rule_decision_enum"
  }
```

To perform the evaluation of a bill payment, simply send a BillPayment object to the following endpoint:

`POST https://api.caas.qitech.app/bill_payment/bill_payment`

## Retrieve a Bill Payment

Response Body

```json
  {
    "id": "082373263",
    "amount": 12979,
    ...
  }
```

To retrieve data from a bill payment, simply send a request to the following endpoint:

`GET https://api.caas.qitech.app/bill_payment/bill_payment/{bill_payment_id}`

Where *bill_payment_id* is the transaction identifier in the client's system used when sending the bill payment.

## Update a Bill Payment

Request Body

```json
  {
    "bill_payment_status": "completed",
    "event_date": "2020-10-07T15:06:25-03:00"
  }
```

Response Body

```json
  {
    "bill_payment_key": "13d680ef-4b72-4cb2-a63d-cf3d790abaaf",
    "bill_payment_status": "completed"
  }
```

After a bill payment is created and analyzed, it is sent to the clearing house for processing. Therefore, you must report payment status updates via the endpoint:

`PUT https://api.caas.qitech.app/bill_payment/bill_payment/{bill_payment_id}`

This ensures that our database remains updated, allowing us to accurately identify payments that are genuinely susceptible to fraud.

---

# Deposits

URL: /en/documentation/caas/banking/deposits/introduction

At the moment a user performs a deposit, the deposit data must be sent to QI Tech. This enables a fraud risk and Anti-Money Laundering analysis of the operation based on that dataset.

## Deposit Object Definition

Request Body

```json
{
    "id": "082373263",
    "amount": 12979,
    "deposit_date": "2020-10-07T15:06:25-03:00",
    "client": {
        "id": "182373263",
        "type": "natural_person",
        "document_number": "123.456.789-10",
        "name": "Benedito Calixto de Jesus",
        "email": "benedito@test.com",
        "address": {
            "street": "Rua José Wasth Rodrigues",
            "number": "243",
            "neighbourhood": "Vila Maria",
            "city": "São Paulo",
            "uf": "SP",
            "complement": "Apartamento 14B",
            "postal_code": "02121-010"
        },
        "phone": {
            "international_dial_code": "55",
            "area_code": "11",
            "number": "998861708",
            "type": "mobile"
        },
        "sales_channel": "inbound_sales",
        "segment": "Personalité"
    },
    "destination_account": {
        "participant": "17315359",
        "branch": "0000",
        "account_number": "10442",
        "account_digit": "6",
        "account_type": "CACC",
        "opening_date": "2020-01-15T18:00:00-03:00"
    },
    "terminal": {
        "id": "1234566",
        "latitude": -45.2753548,
        "longitude": -15.24587,
        "address": { 
            "street": "Av. Eng. Luis Carlos Berrini",
            "number": "105",
            "neighbourhood": "Brooklin",
            "city": "São Paulo",
            "uf": "SP",
            "complement": "Cj 303",
            "postal_code": "04501-140"
        },
        "type": "atm"
    },
    "authentication": {
        "used_password": true,
        "used_card": true,
        "used_fingerprint": true,
        "typed_account_number": false
    }
}
```

A deposit must be sent to the API for preliminary fraud validation before being forwarded to the processing system.

The deposit status represents the decision returned by the model regarding that account. The following statuses are used in the **analysis_status** flag:

* `automatically_approved`
* `automatically_reproved`

Below are the meanings of each decision returned in the analysis_status flag:

status | description
:----: | ---------
automatically_approved      | It is recommended that this deposit be approved.
automatically_reproved      | It is recommended that this deposit be reproved.

name | type | description
:----:  | :----:  | ---------
id | string | Deposit identifier in the client's system. **It is essential that this number is unique for each deposit**
amount                      | integer                   | Deposit amount in cents - as described in the "Standards" section.
deposit_date                | datetime                  | Date and time of the deposit execution - as described in the "Standards" section.
client                      | *client* | Object containing the data of the client holding the source account.
destination_account         | *account* | Object determining the destination account of the funds to be deposited.
terminal                    | *terminal* | Object containing the data of the terminal where the deposit is being performed.
authentication              | *authentication* | Object containing the authentication information.

## Deposit Objects

### Terminal Object

Request Body

```json
{
    "id": "1234566",
    "latitude": -45.2753548,
    "longitude": -15.24587,
    "address": { 
        "street": "Av. Eng. Luis Carlos Berrini",
        "number": "105",
        "neighbourhood": "Brooklin",
        "city": "São Paulo",
        "uf": "SP",
        "complement": "Cj 303",
        "postal_code": "04501-140"
    },
    "type": "atm"
}
```

Object representing the terminal that was used for the deposit.

name | type | description
:----:  | :----:  | ---------
id                          | string                    | Terminal identifier in the client's system.
latitude                    | number                    | Latitude, in degrees, of the terminal's location.
longitude                   | number                    | Longitude, in degrees, of the terminal's location.
address                     | *address* | Terminal address.
type                        | enum                      | Terminal type, possible values: "atm", "counter".

### Authentication Object

Request Body

```json
{
    "used_password": true,
    "used_card": true,
    "used_fingerprint": true,
    "typed_account_number": false
}
```

Object defining the authentication parameters used at the time of deposit.

name | type | description
:----: | :----: | -----------
used_password               | boolean                           | Determines if the user used a password.
used_card                   | boolean                           | Determines if the user has the card present during authentication.
used_card_chip_and_pin      | boolean                           | Determines if the user used the card's chip and PIN.
used_card_magnetic_stripe   | boolean                           | Determines if the user used the card's magnetic stripe.
used_fingerprint            | boolean                           | Determines if the user used a fingerprint.
typed_account_number        | boolean                           | Determines if the user typed the account data.

## Send a Deposit

Request Body

```json
  {
    "id": "12345",
    ...
  }
```

Response Body

```json
  {
    "id": "082373263",
    "analysis_status": "automatically_approved",
    "reason": "2019-10-01T10:37:25-03:00"
  }
```

To perform the evaluation of a deposit, simply send a deposit object to the following endpoint:

`POST https://api.caas.qitech.app/deposit/deposit`

## Retrieve a Deposit

Response Body

```json
  {
    "id": "082373263",
    "analysis_status": "automatically_approved",
    "reason": "2019-10-01T10:37:25-03:00"
  }
```

To retrieve data from a deposit, simply send a request to the following endpoint:

`GET https://api.caas.qitech.app/deposit/deposit/{deposit_id}`

Where *deposit_id* is the transaction identifier in the client's system used when sending the deposit.

## Update a Deposit

Request Body

```json
  {
    "deposit_status": "completed",
    "event_date": "2020-10-07T15:06:25-03:00"
  }
```

Response Body

```json
  {
    "id": "082373263",
    "deposit_status": "completed"
  }
```

After a deposit is created and analyzed, the money will be made available to the user. This process may be interrupted by some other business rule. Thus, it is necessary to report deposit status updates when it is finalized, via the endpoint:

`PUT https://api.caas.qitech.app/deposit/deposit/{deposit_id}`

This ensures that our database remains updated, allowing us to accurately identify deposits that are genuinely susceptible to fraud.

---

# HTTP Status

URL: /en/documentation/caas/banking/http_status

All QI Tech APIs use the following standardization for HTTP return statuses, complying with RFC 7231 :

HTTP Status | Meaning | Description
---------- | ------- | ---------------------------------
400 | Bad Request | The sent request contains a formatting error. In most cases, we return an explanation of the error in the message body.
401 | Unauthorized | There was an authentication problem; check if the API Key is correct and in the correct header, according to the Authentication section.
403 | Forbidden | The accessed endpoint is for internal use and is not available for this API Key.
404 | Not Found | The requested data was not found using the provided key. This status is also returned when an invalid endpoint is requested.
405 | Method Not Allowed | The HTTP method used does not apply to the endpoint used.
406 | Not Acceptable | The data sent in the request body is invalid. In general, this means the data sent is not valid JSON.
409 | Conflict | The request ID corresponds to an ID already processed. This status is returned in the case of duplicate requests sent to the server.
500 | Internal Server Error | We had a problem processing this request; when this error is encountered, our specialists are automatically notified and start to work on a solution immediately.
503 | Service Unavailable | You have encountered an unavailability, whether planned or unplanned, of our server infrastructure.

---

# Introduction

URL: /en/documentation/caas/banking/introduction

Welcome to the QI Tech Banking API! This API grants access to fraud prevention functionality for bank operations and digital accounts, such as analyzing transfers, bill payments, and bankslip (boleto) payments.

Below, you can see the API implementation using cUrl. This provides examples that you can adapt to your preferred programming language.

## Problems?

We are not a company that hides behind an API! Contact our support team, and we will respond as quickly as possible. Feel free to call us if you need a quick answer!

### We Love Feedback

Even if you have already solved your problem or if it is very simple (even a typo or improper organization you noticed), send us an email. This helps us make the documentation increasingly practical so the next person won't have to go through the same struggles you did!

## Environments

We have two environments for our clients. The base URLs for the APIs are:

* Production - `https://api.caas.qitech.app/`
* Sandbox - `https://api.sandbox.caas.qitech.app/`

:::danger Important Warning!
Real data of individuals (natural persons) and/or legal entities must not be used in the QI Tech Sandbox environments.
:::

## Sandbox Environment Analysis

In the Sandbox environment, analyses are not charged and are responded to according to simplified rules.
In the case of *wire_transfers*, *bankslips*, *bill_payments*, and *pix*, the response provided will be based on the operation value (*amount*) sent in the request:

minimum | maximum | decision
------- | ------- | -------
16000 | - | Automatically Contested*
10000 | 15999 | Automatically Approved
6000 | 9999 | Forwarded for Manual Analysis
0 | 5999 | Automatically Reproved

\* Automatically Contested is available only for the *pix* service.

In the case of *withdrawal* and *deposit*, the response provided will be based on the operation value (*amount*) sent in the request:

minimum | maximum | decision
------- | ------- | -------
10000 | - | Automatically Approved
0 | 9999 | Automatically Reproved

In the case of DICT operations, the response provided will be based on the DICT link key (*dict_key*) sent in the request:

Key in Dict | decision
:----------: | -------
"Approve_dict_key"      | Automatically Approved
Any other string        | Forwarded for Manual Analysis
"Reprove_dict_key"      | Automatically Reproved

## HTTPS Only

For security reasons, all communication with QI Tech APIs must be performed using HTTPS communication. To prevent HTTP calls from being made due to inattention or other reasons, this server only makes port 443 available with TLS 1.2 communication. Calls made using other protocols will be automatically denied.

## Workflows - Transfers

The transfer analysis flow is initiated in two situations:

- A transfer is being made by the PSP user
- A transfer is being received by the PSP user

In both cases, a call to the *wire_transfer* endpoint must be made, and the possible resulting statuses are:

enumerator | description
:--------: | ---------
automatically_approved | Automatically Approved
automatically_reproved | Automatically Reproved
in_manual_analysis     | Forwarded for Manual Analysis
pending                | The bank transfer object is being processed.

If the transfer is forwarded for manual analysis, an analyst must approve or reject the transfer. At this moment, a Webhook can be generated to notify the PSP of the status change, or the PSP may track the transfer via Polling. In both cases, the following statuses may be returned:

enumerator | description
:--------: | ---------
manually_approved | Manually Approved
manually_reproved | Manually Reproved

## Workflows - Bankslips

The Bankslip analysis flow is initiated in two situations:

- A bankslip payment is being made by the PSP user
- A bankslip payment is being received by the PSP user

In both cases, a call to the *bankslip* endpoint must be made, and the possible resulting statuses are:

enumerator | description
:--------: | ---------
automatically_approved | Automatically Approved
automatically_reproved | Automatically Reproved
in_manual_analysis     | Forwarded for Manual Analysis
pending                | The bankslip object is being processed.

If the bankslip payment is forwarded for manual analysis, an analyst must approve or reject the payment. At this moment, a Webhook may be generated to notify the PSP of the status change, or the PSP may track the payment via Polling. In both cases, the following statuses may be returned:

enumerator | description
:--------: | ---------
manually_approved | Manually Approved
manually_reproved | Manually Reproved

## Workflows - Bill Payments

The Bill Payment analysis flow is initiated when:

- A bill payment is being made by the PSP user

In this case, a call to the *bill_payment* endpoint must be made, and the possible resulting statuses are:

enumerator | description
:--------: | ---------
automatically_approved | Automatically Approved
automatically_reproved | Automatically Reproved
in_manual_analysis     | Forwarded for Manual Analysis
pending                | The bill payment object is being processed.

If the bill payment is forwarded for manual analysis, an analyst must approve or reject the payment. At this moment, a Webhook may be generated to notify the PSP of the status change, or the PSP may track the payment via Polling. In both cases, the following statuses may be returned:

enumerator | description
:--------: | ---------
manually_approved | Manually Approved
manually_reproved | Manually Reproved

## Workflows - Withdrawals

The Withdrawal analysis flow is initiated in the following situation:

- A withdrawal is being made by the PSP user

In this case, a call to the *withdrawal* endpoint must be made, and the possible resulting statuses are:

enumerator | description
:--------: | ---------
automatically_approved | Automatically Approved
automatically_reproved | Automatically Reproved

If the withdrawal is forwarded for manual analysis, an analyst must approve or reject the withdrawal. At this moment, a Webhook may be generated to notify the PSP of the status change, or the PSP may track the payment via Polling. In both cases, the following statuses may be returned:

enumerator | description
:--------: | ---------
manually_approved | Manually Approved
manually_reproved | Manually Reproved

## Workflows - PIX Transaction

The PIX payment flow is initiated in two situations:

- A payment being made by the PSP user integrated with QI Tech
- A payment being received from another PSP

In both cases, a call to the payment endpoint must be made, and the possible resulting statuses are:

enumerator | description
:--------: | ---------
automatically_approved | Automatically Approved
automatically_reproved | Automatically Reproved
in_manual_analysis     | Forwarded for Manual Analysis

If the payment is forwarded for manual analysis, an analyst must approve or reject the payment. At this moment, a Webhook may be generated to notify the PSP of the status change, or the PSP may track the payment via Polling. In both cases, the following statuses may be returned:

enumerator | description
:--------: | ---------
manually_approved | Manually Approved
manually_reproved | Manually Reproved

## Workflows - DICT Changes

The DICT alteration flow is initiated in two situations:

- The PSP user integrated with QI Tech requests a registration/change/portability/claim to the PSP integrated with QI Tech
- A portability/claim is received by the PSP integrated with QI Tech

For registrations initiated by the PSP user, the key validation flow must be executed before the alteration in DICT, using QI Tech's validation APIs. If the validation is performed by the PSP itself, this information can also be sent in the request to QI Tech.

To start the process in these two moments, the PSP integrated with QI Tech must make a call to the appropriate endpoint, which will respond with one of the following statuses:

enumerator | description
:--------: | ---------
automatically_approved | Automatically Approved
automatically_reproved | Automatically Reproved
in_manual_analysis     | Forwarded for Manual Analysis

If the alteration is forwarded for manual analysis, an analyst must approve or reject the alteration. At this moment, a Webhook may be generated to notify the PSP of the status change, or the PSP may track the alteration via Polling. In both cases, the following statuses may be returned:

enumerator | description
:--------: | ---------
manually_approved | Manually Approved
manually_reproved | Manually Reproved

## Authentication

> To authenticate a call, use the following code:

```shell
# In the shell, you only need to add the appropriate header to each request
curl "api_endpoint_here"
  -H "Authorization: EXAMPLE_API_KEY"
```

> Replace the API key 'EXAMPLE_API_KEY' with the key acquired from our support.

We use an API Key to allow access to our API. It has likely already been sent to you by email. If you have not yet received your key, send an email to suporte.caas@qitech.com.br .

Our API expects to receive the API Key in all requests to our server in a header like the one below:

`Authorization: EXAMPLE_API_KEY`

:::info **Attention**

You must replace EXAMPLE_API_KEY with the API Key received from support.
:::

---

# Shared Objects

URL: /en/documentation/caas/banking/objects

A significant portion of data is shared among different account events. The definitions of these objects can be easily located below.

## Client Object

Request Body

```json
{
    "id": "123456",
    "type": "natural_person",
    "document_number": "023.456.789-01",
    "name": "John Payer",
    "email": "john@payer.com",
    "address": {
        "street": "Av. Eng. Luis Carlos Berrini",
        "number": "105",
        "neighbourhood": "Brooklin",
        "city": "São Paulo",
        "uf": "SP",
        "complement": "Cj 303",
        "postal_code": "04501-140"
    },
    "phone": {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "998861708",
        "type": "mobile"
    },
    "sales_channel": "inbound_sales",
    "segment": "Personalité"
}
```

Object representing the account holder's data.

name | type | description
:----:  | :----:  | ---------
type                        | enum *(mandatory)* | Client type: "natural_person" or "legal_person"
document_number             | string *(mandatory)* | Document number, in accordance with the standardization section.
name                        | string *(mandatory)* | Client name.
email                       | string                    | Client email.
address                     | *address* | Client address data.
phone                       | *phone* | Client phone data.
sales_channel               | enum *(mandatory)*| Channel through which the client registered.
segment                     | string *(mandatory)*| Client segment within the institution (e.g., premium, gold).

The following enumerators exist for phone type: `inbound_sales`, `app`, `website`, `call_center`, and `branch`.

## Address Object

Request Body

```json
{
  "street": "Rua do Teste",
  "number": "111",
  "neighbourhood": "Bairro do Exemplo",
  "city": "Aparecida de Goiânia",
  "uf": "GO",
  "complement": "Térreo",
  "postal_code": "00000-000",
  "country": "BRA"
}
```

The *address* object is used to represent addresses throughout the API. Addresses within Brazilian territory are represented as follows:

name | type | description
---- | :----: | ---------
street | string *(mandatory)* | Street name, including the public place type, avoiding abbreviations if possible.
number | string  *(mandatory)* | Property number, including letters if applicable.
neighbourhood | string *(mandatory)*| Neighborhood, without abbreviations. **e.g.: Santa Felicidade**
city | string *(mandatory)*| Full city name, without abbreviations.
uf | string *(mandatory)* | The federative unit (state), with two uppercase letters. **e.g.: SP**
complement | string | Any supplements to locate the property. **e.g.: Apartamento 101, Conjunto 12**
postal_code  | string *(mandatory)* | The locality's postal code, including the hyphen.
country | string *(mandatory)* | ISO 3166-1 alpha-3 code of the address country.

For addresses where the country is not Brazil ("BRA"), the postal_code and federative unit may be filled in freely.

## Phone Object

Request Body

```json
{
  "international_dial_code": "1",
  "area_code": "11",
  "number": "999999999",
  "type": "mobile"
}
```

A *phone* object represents a telephone number, inside or outside Brazil, and its classification. For this, the fields are:

name | type | description
---- | :----: | ---------
international_dial_code | string *(mandatory)* | International dialing code, without zero or +, numbers only.
area_code | string *(mandatory)* | Area code, without zero, numbers only.
number | string  *(mandatory)* | Phone number, without the hyphen.
type | enum  *(mandatory)* | Number type: mobile, residential, commercial, etc.

The following enumerators exist for phone type: `residential`, `commercial`, and `mobile`.

## Account Object

Request Body

```json
{
    "participant": "17315359",
    "branch": "0000",
    "account_number": "10442",
    "account_digit": "6",
    "account_type": "CACC",
    "opening_date": "2020-01-15T18:00:00-03:00"
}
```

Object representing an account's data.

name | type | description
:----:  | :----:  | ---------
participant                 | string *(mandatory)* | ISPB of the institution holding the account.
branch                      | string *(mandatory)* | Account Branch.
account_number              | string *(mandatory)* | Account Number without the digit.
account_digit               | string *(mandatory)* | Account digit.
account_type                | enum *(mandatory)* | Source account type, possible values: "CACC", "SLRY", and "SVGS".
opening_date                | datetime | Account opening date.

## Source Object

Request Body

```json

{
    "channel": "app",
    "platform": "android",
    "ip":"255.201.26.1",
    "session_id": "54b8e3cf-15de-41e5-9305-0ecf059d6e2a"
}

```

The source object represents the set of information regarding the platform used by the user to perform the operation. The fields are:

name | type | description
:----: | :----: | ---------
channel     | string | Channel used by the user to perform the operation, e.g., internet banking, app.
platform    | string | Platform used by the application.
ip          | string | IP collected from the device.
session_id  | string | Unique session identifier, used to cross-reference the Device Scan with the event in question.

## Dict Key Object

Request Body

```json
  {
    "key_type": "cpf",
    "key_value": "09991222669",
    "assignment_date": "2020-01-15T18:00:00-03:00"
  }
```

The **dict_key** object is used to represent the client's DICT link key data, whether they are the receiver or the payer of the transaction. The fields of this object are:

name | type | description
:----: | :----: | ---------
key_type        | string *(mandatory)* | Enumerator containing the DICT link key type.
key_value       | string | Contains the link key registered in DICT.
assignment_date | datetime  | Date the link key was registered in DICT.

The enumerators for the *key_type* field are the same as those defined in the DICT API: `cpf`, `cnpj`, `email`, `phone`, and `evp`.

## Destination Statistics Object

Request Body

```json
{
  "account":{
      "settlements":{
          "d3":4,
          "d30":67,
          "m6":618
      },
      "rejected":{
          "d3":4,
          "d30":67,
          "m6":618
      },
      "reported_frauds":{
          "d3":0,
          "d30":0,
          "m6":0
      },
      "reported_aml_cft":{
          "d3":0,
          "d30":0,
          "m6":0
      },
      "confirmed_frauds":{
          "d3":0,
          "d30":0,
          "m6":0
      },
      "confirmed_aml_cft":{
          "d3":0,
          "d30":0,
          "m6":0
      }
  },
  "owner":{
      "settlements":{
          "d3":6,
          "d30":88,
          "m6":996
      },
      "rejected":{
          "d3":4,
          "d30":67,
          "m6":618
      },
      "reported_frauds":{
          "d3":0,
          "d30":0,
          "m6":0
      },
      "reported_aml_cft":{
          "d3":0,
          "d30":0,
          "m6":0
      },
      "confirmed_frauds":{
          "d3":0,
          "d30":0,
          "m6":0
      },
      "confirmed_aml_cft":{
          "d3":0,
          "d30":0,
          "m6":0
      }
  },
  "key":{
      "settlements":{
          "d3":3,
          "d30":51,
          "m6":312
      },
      "rejected":{
          "d3":4,
          "d30":67,
          "m6":618
      },
      "reported_frauds":{
          "d3":0,
          "d30":0,
          "m6":0
      },
      "reported_aml_cft":{
          "d3":0,
          "d30":0,
          "m6":0
      },
      "confirmed_frauds":{
          "d3":0,
          "d30":0,
          "m6":0
      },
      "confirmed_aml_cft":{
          "d3":0,
          "d30":0,
          "m6":0
      }
  }
}
```

To evaluate the fraud risk of a transaction with greater precision, it is necessary to provide the transactional and fraud history of the payee via the *Destination Statistics* object. Such data can be obtained by querying the payee's link key in the DICT database. The Central Bank of Brazil (BACEN) requires that this data be used in the transaction fraud evaluation.

name | type | description
:----: | :----: | ---------
account | *account* *(mandatory)* | Object containing the transactional and fraud history of the payee's account.
owner   | *owner* *(mandatory)* | Object containing the transactional and fraud history associated with the payee's document.
key     | *key* *(mandatory)* | Object containing the transactional and fraud history associated with the key provided by the payee.

Where each of the objects defined above possesses the same fields:

name | type | description
:----: | :----: | ---------
settlements       | *settlements* *(mandatory)* | Object containing the transactional history.
rejected          | *rejected* *(optional)* | Object containing the history of rejected operations.
reported_frauds   | *reported_frauds* *(mandatory)* | Object containing the history of fraud reports.
reported_aml_cft  | *reported_aml_cft* *(optional)* | Object containing the history of AML/CFT reports.
confirmed_frauds  | *confirmed_frauds* *(mandatory)* | Object containing the history of confirmed fraud reports.
confirmed_aml_cft | *confirmed_aml_cft* *(optional)* | Object containing the history of confirmed AML/CFT reports.

Where each of these objects contains the fields **d3**, **d30**, and **m6**, containing the number of occurrences in the last 3 days, 30 days, and 6 months, which are mandatory fields, respectively. Just as defined by the BCB DICT API.

---

# PIX Dict Operation

URL: /en/documentation/caas/banking/pix_dict_operations

At the moment a user initiates a change in DICT, the data must be sent to our server so that we can perform an analysis of the risk involved in that dataset.

## Dict Operation Object Definition

Request Body

```json
{
  "id": "f58e8a19-429d-4e36-a010-ed00a323c2c5",
  "dict_key": {
      "key_type": "phone",
      "key_value": "16981610077",
      "assignment_date": "2020-01-15T18:00:00-03:00"
  },
  "dict_operation_direction": "claimer",
  "dict_operation_reason": "user_requested",
  "dict_operation_creation_date": "2020-10-14T18:00:00-03:00",
  "dict_operation_type": "claim_portability",
  "client": {
      "id": "123456",
      "document_number": "099.912.226-69",
      "name": "João Jorge da Silva",
      "type": "natural_person",
      "address": {
          "street": "Avenida 13",
          "number": "704",
          "neighbourhood": "Centro",
          "city": "Ituiutaba",
          "uf": "MG",
          "complement": "Apt 1101",
          "postal_code": "38300-140"
      },
      "phone": {
          "international_dial_code": "55",
          "area_code": "65",
          "number": "988961210",
          "type": "mobile"
      },
      "sales_channel": "inbound_sales",
      "segment": "Personalité"
  },
  "source_account": {
      "participant": "04184779",
      "branch": "0001",
      "account_number": "1122",
      "account_digit": "6",
      "owner": {
          "type": "legal_person",
          "document_number": "94.948.708/0001-12",
          "name": "Irmão Soares Ferragista LTDA."
      },
      "account_type": "CACC",
      "opening_date": "2020-01-15T18:00:00-03:00"
  },
  "destination_account": {
      "participant": "00000000",
      "branch": "3675",
      "account_number": "10442",
      "account_digit": "6",
      "owner": {
          "type": "natural_person",
          "document_number": "099.912.226-69",
          "name": "João Jorge da Silva"
      },
      "account_type": "SLRY",
      "opening_date": "2020-01-15T18:00:00-03:00"
  },
  "destination_statistics": {
      "account":{
          "settlements":{
              "d3":12,
              "d30":65,
              "m6":344
          },
          "rejected":{
              "d3":4,
              "d30":67,
              "m6":618
          },
          "reported_frauds":{
              "d3":0,
              "d30":0,
              "m6":0
          },
          "reported_aml_cft":{
              "d3":0,
              "d30":0,
              "m6":0
          },
          "confirmed_frauds":{
              "d3":0,
              "d30":0,
              "m6":0
          },
          "confirmed_aml_cft":{
              "d3":0,
              "d30":0,
              "m6":0
          }
      },
      "owner":{
          "settlements":{
              "d3":4,
              "d30":12,
              "m6":88
          },
          "rejected":{
              "d3":4,
              "d30":67,
              "m6":618
          },
          "reported_frauds":{
              "d3":0,
              "d30":0,
              "m6":0
          },
          "reported_aml_cft":{
              "d3":0,
              "d30":0,
              "m6":0
          },
          "confirmed_frauds":{
              "d3":0,
              "d30":0,
              "m6":0
          },
          "confirmed_aml_cft":{
              "d3":0,
              "d30":0,
              "m6":0
          }
      },
      "key":{
          "settlements":{
              "d3":1,
              "d30":6,
              "m6":12
          },
          "rejected":{
              "d3":4,
              "d30":67,
              "m6":618
          },
          "reported_frauds":{
              "d3":0,
              "d30":0,
              "m6":0
          },
          "reported_aml_cft":{
              "d3":0,
              "d30":0,
              "m6":0
          },
          "confirmed_frauds":{
              "d3":0,
              "d30":0,
              "m6":0
          },
          "confirmed_aml_cft":{
              "d3":0,
              "d30":0,
              "m6":0
          }
      }
  },
  "source": {
      "channel": "internet_banking",
      "platform": "android",
      "ip": "198.185.065-98",
      "session_id": "7839jdqd9a8wd9"
  }
}
```

A Dict Operation must be submitted to the API for preliminary registration fraud validation before being forwarded to the BCB processing system.

The analysis status of the Dict Operation represents the decision returned by the model regarding that operation. The following statuses are used in the **analysis_status** flag:

* `automatically_approved`
* `automatically_reproved`
* `in_manual_analysis`
* `pending`

Below are the meanings of each decision returned in the analysis_status flag:

status | description
:----: | ---------
automatically_approved      | It is recommended that this operation be approved.
automatically_reproved      | It is recommended that this operation be reproved.
in_manual_analysis          | It is recommended that the operation be analyzed manually by an analyst.
pending                     | The operation is being processed.

name | type | description
:----:  | :----:  | ---------
id | string | Operation identifier in the client's system. **It is essential that this number is unique for each authorization process**
client                  | *client* | Object representing the client's data, whether they are the donor or the claimer.
transaction_date        | datetime                  | The transaction start date and time, with time zone.
dict_key                | *dict_key* | Object representing the DICT link key data used by the client in the transaction.
dict_key_type           | enumerator                | DICT link key type.
dict_operation_direction| enumerator                | Operation direction in DICT, i.e., whether a key is being donated or claimed.
dict_operation_reason   | enumerador                | The reason why the Dict Operation is being performed.
dict_operation_creation_date     | datetime                  | Date of the operation in DICT.
dict_operation_type     | enumerador                | Type of operation in DICT.
source_account          | *source_account* | Object representing the data of the account that is donating the link key.
destination_account     | *destination_account* | Object representing the data of the account that is receiving the link key.
destination_statistics  | *destination_statistics* | Object representing the transaction and fraud history of the account receiving the link key.
source                  | *source* | Source type object describing the information coming from the application used to send the registration.

The *dict_key_type* field accepts the same enumerators defined in the DICT API: `cpf`, `cnpj`, `email`, `phone`, and `evp`.

The *dict_operation_direction* field accepts the enumerators: `donor` and `claimer`.

The *dict_operation_type* field accepts the enumerators `registration`, `claim_ownership`, and `claim_portability`.
These being all types of DICT operations defined by the BCB.

## Send a Dict Operation

Request Body

```json
  {
    "id": "f58e8a19-429d-4e36-a010-ed00a323c2c5",
    ...
  }
```

Response Body

```json
  {
    "dict_operation_key": "7f85e162-5a7d-41fa-a578-69df6f3df958",
    "status": "automatically_approved"
  }
```

To perform the evaluation of an operation, simply send a Dict Operation object to the following endpoint:

`POST https://api.caas.qitech.app/pix/dict_operation`

## Retrieve a Dict Operation

Response Body

```json
  {
    "id": "f58e8a19-429d-4e36-a010-ed00a323c2c5",
    ...
  }
```

To retrieve a Dict Operation, simply send a request to the following endpoint:

`GET https://api.caas.qitech.app/pix/dict_operation/{dict_operation_id}`

Where *dict_operation_id* is the operation identifier sent to us at the time of its registration, in the "id" field.

The Dict Operation object associated with the provided key will then be returned.

## Update a Dict Operation

Request Body

```json
  {
    "dict_operation_status": "cancelled_by_client",
    "reason": "user_requested",
    "event_date": "2020-10-07T15:06:25-03:00"
  }
```

A Dict Operation goes through several phases with the BCB before completion. Thus, it is necessary to report all operation status updates via the endpoint:

`PUT https://api.caas.qitech.app/pix/dict_operation/{dict_operation_id}`

This ensures that our database is updated and always consistent with the BCB database.

Some operations in DICT require that the reason for the operation be submitted along with the data. For these cases, it is necessary to provide the *reason* field in the submission object, containing the same enumerator provided to the BCB system.
These are:

enumerator | description
:--------: | ---------
user_requested    | The operation was requested by the client.
account_closure   | The operation was initiated due to the client's account closure.
branch_transfer   | The operation was requested due to the client's branch change.
entry_inactivity  | The operation was requested due to inactivity in the client's account.
reconciliation    | The operation was requested following a reconciliation process.
default_operation | The operation was requested by a default action of the participant.
fraud             | The operation was requested due to fraud linked to the client's account.

The phases of a DICT operation accepted by the *dict_operation_status* field are:

enumerator | description
:--------: | ---------
created                   | The dict_operation was created but has not yet been analyzed.
reproved                  | The dict_operation was reproved in the analysis and will not be sent to the BCB.
waiting_resolution        | The dict_operation was sent to the BCB and is awaiting resolution.
cancelled_by_client       | The dict_operation was cancelled by the client.
cancelled_by_counterpart  | The dict_operation was cancelled by the other party of the operation.
confirmed                 | The dict_operation was confirmed by the other party of the operation.
completed                 | The dict_operation was completed and added to the BCB database.

---

# PIX Infraction Report

URL: /en/documentation/caas/banking/pix_infraction_reports

## Infraction Report Object Definition

Request Body

```json
{
    "infraction_report_type": "compliance",
    "infraction_report_details": "Cliente realizou várias compras de valor alto em estabelecimentos comerciais cuja atividade econômica é de alto risco de lavagem de dinheiro. Após uma investigação minuciosa, decidiu-se realizar o report ao COAF e bloquear o saldo em conta até que a origem do dinheiro seja esclarecida. ",
    "infraction_report_creator": "external",
    "infraction_report_date": "2020-10-14T00:25:42-03:00",
    "infraction_report_status": "received",
    "infraction_report_events": [               
        {
            "new_status": "received",
            "event_date": "2020-10-14T00:25:42-03:00"
        }
    ]
}
```

If suspicious behavior is detected by either party in a transaction, an Infraction Report can be created to report the suspicion. This report is then analyzed by the counterparty and may be confirmed or rejected. Following the standard established by the BCB, an Infraction Report must contain the following fields:

name | type | description
:----: | :----: | ---------
infraction_report_type      | enumerator | Enumerator defining the type of suspicious activity present in the transaction.
infraction_report_details   | string     | Details regarding the circumstances that led the creator of the Infraction Report to believe there might be an infraction associated with the transaction.
infraction_report_creator   | enumerator | Enumerator defining who created the Infraction Report.
infraction_report_date      | datetime   | Date of the incident.

The *infraction_report_type* field may contain the enumerators: `fraud` and `compliance`.

The *infraction_report_creator* field may contain the enumerators: `client` and `external`.

## Send an Infraction Report

Request Body

```json
{
    "infraction_report_type": "compliance",
    "infraction_report_details": "Cliente realizou várias compras de valor alto em estabelecimentos comerciais cuja atividade econômica é de alto risco de lavagem de dinheiro. Após uma investigação minuciosa, decidiu-se realizar o report ao COAF e bloquear o saldo em conta até que a origem do dinheiro seja esclarecida. ",
    "infraction_report_creator": "external",
    "infraction_report_date": "2020-10-14T00:25:42-03:00"
}
```

Response Body

```json
  {
    "infraction_report_key": "7f85e162-5a7d-41fa-a578-69df6f3df958",
    "infraction_report_status": "received"
  }
```

To send an Infraction Report, simply send a request to the endpoint:

`POST https://api.caas.qitech.app/pix/transaction/{transaction_id}/infraction_report`

Where *transaction_id* is the transaction identifier sent to us at the time of its registration, in the "id" field.

## Retrieve an Infraction Report

Response Body

```json
  {
      "infraction_report_type": "compliance",
      "infraction_report_details": "Cliente realizou várias compras de valor alto em estabelecimentos comerciais cuja atividade econômica é de alto risco de lavagem de dinheiro. Após uma investigação minuciosa, decidiu-se realizar o report ao COAF e bloquear o saldo em conta até que a origem do dinheiro seja esclarecida. ",
      "infraction_report_creator": "external",
      "infraction_report_date": "2020-10-14T00:25:42-03:00",
      "infraction_report_status": "received",
      "infraction_report_events": [               
          {
              "new_status": "received",
              "event_date": "2020-10-14T00:25:42-03:00"
          }
      ],
      "transaction_data": {
        "transaction_direction": "received",
        "id": "082373263",
        ...
      }
  }
```

To retrieve an Infraction Report, simply send a request to the following endpoint:

`GET https://api.caas.qitech.app/pix/transaction/{transaction_id}/infraction_report/{infraction_report_key}`

The Infraction Report object associated with the provided *transaction_id* and matching the *infraction_report_key* will then be returned.

## Update an Infraction Report

Request Body

```json
  {
    "infraction_report_status": "acknowledged",
    "event_date": "2020-10-07T15:06:25-03:00"
  }
```

An Infraction Report goes through several phases with the BCB before completion. Therefore, all Infraction Report status updates must be reported via the endpoint:

`PUT https://api.caas.qitech.app/pix/transaction/{transaction_id}/infraction_report/{infraction_report_key}`

---

# PIX Transaction

URL: /en/documentation/caas/banking/pix_transactions

At the moment a payer initiates or receives a payment, the transaction data must be sent to our server. This enables a risk analysis of the transaction based on that dataset.

## PIX Transaction Object Definition

Request Body

```json
{
    "transaction_direction": "received",
    "id": "082373263",
    "client": {
        "id": "123456",
        "document_number": "056.966.649-03",
        "name": "Francisco Oliveira Benedetti",
        "type": "natural_person",
        "address": {
            "street": "Avenida 13",
            "number": "704",
            "neighbourhood": "Centro",
            "city": "Ituiutaba",
            "uf": "MG",
            "complement": "Apt 1101",
            "postal_code": "38300-140"
        },
        "email": "mailto@qitech.com.br",
        "phone": {
            "international_dial_code": "55",
            "area_code": "16",
            "number": "981610077",
            "type": "mobile"
        },
        "sales_channel": "inbound_sales",
        "segment": "Personalité"
    },
    "amount": 13725,
    "transaction_date": "2020-10-07T15:06:25-03:00",
    "dict_key": {
        "key_type": "cpf",
        "key_value": "09991222669",
        "assignment_date": "2020-01-15T18:00:00-03:00"
    },
    "capture_method": "static_qr_code",
    "face_recognition_key": "ef39e206-13d5-48de-b368-6c3bbc6f0222",
    "validation_key": "69a59de3-0198-4a26-933a-c1de624c147d",
    "source_account": {
        "participant": "17315359",
        "branch": "0000",
        "account_number": "10442",
        "account_digit": "6",
        "owner": {
            "type": "legal_person",
            "document_number": "07.487.735/0001-69",
            "name": "Gioconda Pizzaria e Rotisseria LTDA."
        },
        "account_type": "CACC",
        "opening_date": "2020-01-15T18:00:00-03:00"
    },
    "destination_account": {
        "participant": "60701190",
        "branch": "3675",
        "account_number": "10442",
        "account_digit": "6",
        "owner": {
            "type": "natural_person",
            "document_number": "056.966.649-03",
            "name": "Francisco Oliveira Benedetti"
        },
        "account_type": "SLRY",
        "opening_date": "2020-01-15T18:00:00-03:00"
    },
    "destination_statistics": {
        "person":{
            "settlements":{
                "d90":4,
                "m12":67,
                "m60":618
            },
            "application_frauds":{
                "d90":0,
                "m12":4,
                "m60":9
            },
            "mule_accounts":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "scammer_accounts":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "other_frauds":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "unknown_frauds":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "total_frauds_transaction_amount":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "distinct_fraud_reporters":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "open_reports":0,
            "open_reports_distinct_reporters":0,
            "rejected_reports":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "registered_accounts":0         
        },
        "owner":{
            "settlements":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "application_frauds":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "mule_accounts":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "scammer_accounts":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "other_frauds":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "unknown_frauds":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "total_frauds_transaction_amount":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "distinct_fraud_reporters":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "open_reports":0,
            "open_reports_distinct_reporters":0,
            "registered_accounts":0     
        },
        "key":{
            "settlements":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "application_frauds":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "mule_accounts":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "scammer_accounts":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "other_frauds":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "unknown_frauds":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "total_frauds_transaction_amount":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "distinct_fraud_reporters":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "open_reports":0,
            "open_reports_distinct_reporters":0,
            "rejected_reports":{
                "d90":0,
                "m12":0,
                "m60":0
            },
            "distinct_accounts":{
                "d90":0,
                "m12":0,
                "m60":0
            }
        }
    },
    "source": {
        "channel": "internet_banking",
        "platform": "android",
        "ip": "198.185.065.098",
        "session_id": "7839jdqd9a8wd9"
    }
}
```

A transaction must be sent to the API for prior fraud validation before being forwarded to the processing system.

The transaction status represents the decision returned by the model regarding that transaction. The following statuses are used in the **analysis_status** flag:

* `automatically_approved`
* `automatically_reproved`
* `in_manual_analysis`
* `pending`

Below are the meanings of each decision returned in the analysis_status flag:

status | description
:----: | ---------
automatically_approved      | It is recommended that this transaction be approved.
automatically_reproved      | It is recommended that this transaction be reproved.
approved_by_time            | The transaction was approved due to manual analysis time expiration.
reproved_by_time            | The transaction was reproved due to manual analysis time expiration.
in_manual_analysis          | It is recommended that the transaction be analyzed manually by an analyst.
pending                     | The transaction is being processed.

name | type | description
:----:  | :----:  | ---------
transaction_direction   | enumerator  | Registered transaction type. Defines whether the client is receiving or sending money. *(mandatory)*
id | string | Payment identifier in the client's system. **It is essential that this number is unique for each payment process** *(mandatory)*
client                  | *client* | Object representing the client's data, whether they are the payer or the receiver. *(mandatory)*
amount                  | integer  | The payment amount in cents - as described in the "Standards" section. *(mandatory)*
pix_modality            | string   | Registered transaction type. Indicates if it represents a transfer, change (troco), or withdrawal.
transaction_date        | datetime | The transaction start date and time, with time zone. *(mandatory)*
dict_key                | *dict_key* | Object representing the DICT link key data used by the client in the transaction.
capture_method          | enumerator | Method used for payment initiation, whether via static or dynamic QR Code, data entry, or DICT key. *(mandatory)*
face_recognition_key    | string                    | Facial recognition key, if facial recognition was performed by our facial recognition API.
validation_key          | string                    | Validation key, if any client validation test was performed in our validation API.
source_account          | *source_account* | Object representing the debited account data. *(mandatory)*
destination_account     | *destination_account* | Object representing the credited account data. *(mandatory)*
destination_statistics  | *destination_statistics* | Object representing the transaction and fraud history of the credited account originating from the BACEN DICT API. *(mandatory)*
source                  | *source* | Source type object describing information coming from the application used for sending the payment.

The following enumerators exist for *transaction_direction*: `sent` and `received`.

The following enumerators exist for *pix_modality*: `transaction`, `change`, and `withdraw`.

The following enumerators exist for *capture_method*: `static_qr_code`, `dynamic_qr_code`, `offline_qr_code`, `typed`.

## Send a Transaction

Request Body

```json
  {
    "id": "12345",
    ...
  }
```

Response Body

```json
  {
    "transaction_key": "13d680ef-4b72-4cb2-a63d-cf3d790abaaf",
    "analysis_status": "automatically_approved",
    "reason": "rule_decision_enum"
  }
```

To perform the evaluation of a transaction, simply send a Transaction object to the following endpoint:

`POST https://api.caas.qitech.app/pix/transaction`

## Retrieve a Transaction

Response Body

```json
  {
    "transaction_direction": "received",
    "id": "082373263",
    ...
  }
```

To retrieve data from a transaction, simply send a request to the following endpoint:

`GET https://api.caas.qitech.app/pix/transaction/{transaction_id}`

Where *transaction_id* is the transaction identifier sent to us at the time of its registration, in the "id" field.

## Update a Transaction

Request Body

```json
  {
    "transaction_status": "sent",
    "event_date": "2020-10-07T15:06:25-03:00"
  }
```

After a transaction is created and analyzed, it must be sent to the BCB (Central Bank) for processing. Therefore, it is necessary to report transaction status updates when it is sent to the BCB via the endpoint:

`PUT https://api.caas.qitech.app/pix/transaction/{transaction_id}`

This ensures that our database is updated and always consistent with the BCB database.

## Unsuccessful Transaction

Request Body

```json
  {
    "transaction_status": "cancelled",
    "reason": "refused_by_counterpart",
    "event_date": "2020-10-07T15:06:25-03:00"
  }
```

If a transaction, for any reason, has not been completed (i.e., balance debited from the source account and credited to the destination account), the transaction can be updated to the `cancelled` status, with the cancellation reason, so that it is possible to identify fraud profiles related to incomplete transactions. The cancelled status can only be used on transactions that still have the `created` status, since the `sent` status is used in cases where the transaction was completed.

`PUT https://api.caas.qitech.app/pix/transaction/{transaction_id}`

The following reasons are currently accepted by the API. If you see the need to frame the cancellation reason in another reason, please contact suporte.caas@qitech.com.br.

reason | description
:----:  | ---------
insufficient_balance | The client does not have sufficient account balance to perform the transaction.
fraud_prevention | The transaction was cancelled because it was not approved in the antifraud system.
system_block | A system block prevented transaction execution, for example, cancelled/inactive account or limit reached.
invalid_destination | The counterparty institution did not accept the transaction because the destination account does not exist.
refused_by_counterpart | The counterparty institution rejected the transaction.
system_error | The transaction was cancelled because there was an error in the institution's own system.
invalid_authentication | The transaction was cancelled because the client failed an authentication flow.

---

# Standards

URL: /en/documentation/caas/banking/standards

To facilitate integration and ensure information integrity, some standards have been defined that are followed throughout the API.

## Monetary Values
> Examples:

```
10000
12345
98741
1223
1
0
```

Values must be sent as integers in cents.

## Date and Time with Time Zone
> Some examples:

```
2019-10-15T22:35:12-03:00
2018-05-01T13:32:11+00:00
2019-05-01T00:00:00+00:00
```

It is represented according to ISO 8601. In this case, the time zone is placed immediately after the time and must represent the time zone of the location where that data will be valid. For example, if a rental is scheduled to start at 09:30 at Brasília airport, the time sent must be represented as 09:30-03:00; if the rental is scheduled to start at 09:30 in Manaus, it must be represented as 09:30-04:00.

The mask used for validation is as follows:

`YYYY-MM-ddThh:mm:ss±hh:mm`

## Date and Time without Time Zone
> Some examples:

```
2019-10-15T22:35:12Z
2018-05-01T13:32:11Z
2019-05-01T00:00:00Z
```

It is represented according to ISO 8601. Data that is independent of time zones must be sent without it, always in UTC, with the letter Z indicating that this data is in UTC. The following format, therefore, will be validated:

`YYYY-MM-ddThh:mm:ssZ`

## Date
> Some examples:

```
2019-10-15
2019-01-01
2017-03-20
```

In the case of fields that receive only a date, a date of birth for example, only the date, without any time, must be sent in the following format:

`YYYY-MM-dd`

---

# Webhook

URL: /en/documentation/caas/banking/webhook

Updates in fraud status (for events that are forwarded for manual analysis or responded to as Pending) are notified via Webhook. To do so, it is necessary, through the [support](mailto:suporte.caas@qitech.com.br) team, to configure an endpoint address where we will notify updates, as well as a *signature_key* that will be used to sign the request.

The client may also use the [polling](https://en.wikipedia.org/wiki/Polling_(computer_science)) technique. In this case, simply do not configure the webhook endpoint and use the retrieval endpoints to proceed with polling.

:::info **Attention**

For security reasons, all Webhook requests will only be performed on endpoints served via HTTPS.
:::

## Signature

> Example of signature calculation in Python

```python
    hmac_obj = hmac.new(signature_key.encode('utf-8'), (url + method + payload).encode('utf-8'), hashlib.sha1)
    return hmac_obj.hexdigest()
```

To ensure that the request received at the webhook endpoint originates from our servers, an HMAC signature is sent in the *Signature* Header, similar to the authentication process.

After calculating the expected signature value on the server side, it is necessary to compare the calculated signature with the sent one. If the signatures match, this means the request originated from our servers and is trustworthy.

## Event Update Webhook

Request Body

```json
    {
        "id": "123456",
        "analysis_status": "automatically_approved",
        "event_date": "2019-10-01T10:37:25-03:00"
    }
```

The event analysis status update request has the format above and notifies of changes in fraud status. The method used is PUT, and the endpoint address may also contain the event ID, according to the client's needs. It is important to highlight that the request body is sent as UTF-8 encoded text.

Examples of event update endpoints:

* https://clientapi.com.br/\{event\}
* https://clientapi.com.br/admin/\{event\}/123456

The \{event\} field, located in the request URL, can assume the following values, depending on the event being notified:
* bill_payment
* bankslip
* wire_transfer
* withdrawal
* pix

The event_date field indicates the date and time the notification was created and may be in the past if previous notification attempts failed.

## Retries

The notification is considered completed when it receives an HTTP Status 200 response. If notifications fail, 7 retries will be made, with the following intervals, until a 200 is returned or the attempts are exhausted:

* 10 seconds
* 40 seconds
* 160 seconds
* 640 seconds
* 2560 seconds
* 10240 seconds
* 40960 seconds

---

# Wire Transfers

URL: /en/documentation/caas/banking/wire_transfers

At the moment a user makes or receives a wire transfer, the wire transfer data must be sent to QI Tech. This enables a risk analysis of the transaction based on that dataset.

## Wire Transfer Object Definition

Request Body

```json
{
    "id": "082373263",
    "wire_transfer_direction": "received",
    "wire_transfer_type": "ted",
    "amount": 13725,
    "wire_transfer_date": "2020-10-07T15:06:25-03:00",
    "face_recognition_key": "ef39e206-13d5-48de-b368-6c3bbc6f0222",
    "validation_key": "69a59de3-0198-4a26-933a-c1de624c147d",
    "client": {
        "type": "natural_person",
        "id": "123456",
        "document_number": "056.966.649-03",
        "name": "Francisco Oliveira Benedetti",
        "address": {
            "street": "Avenida 13",
            "number": "704",
            "neighbourhood": "Centro",
            "city": "Ituiutaba",
            "uf": "MG",
            "complement": "Apt 1101",
            "postal_code": "38300-140"
        },
        "phone": {
            "international_dial_code": "55",
            "area_code": "16",
            "number": "981610077",
            "type": "mobile"
        },
        "email": "mailto@qitech.com.br",
        "sales_channel": "inbound_sales",
        "segment": "Personalité"
    },
    "source_account": {
        "participant": "17315359",
        "branch": "0000",
        "account_number": "10442",
        "account_digit": "6",
        "owner": {
            "type": "legal_person",
            "document_number": "07.487.735/0001-69",
            "name": "Gioconda Pizzaria e Rotisseria LTDA."
        },
        "account_type": "CACC",
        "opening_date": "2020-01-15T18:00:00-03:00"
    },
    "destination_account": {
        "participant": "60701190",
        "branch": "3675",
        "account_number": "10442",
        "account_digit": "6",
        "owner": {
            "type": "natural_person",
            "document_number": "056.966.649-03",
            "name": "Francisco Oliveira Benedetti"
        },
        "account_type": "SLRY",
        "opening_date": "2020-01-15T18:00:00-03:00"
    },
    "source": {
        "channel": "internet_banking",
        "platform": "android",
        "ip": "198.185.065.098",
        "session_id": "7839jdqd9a8wd9"
    }
}
```

A wire transfer must be sent to the API for preliminary fraud validation before being forwarded to the processing system.

The wire transfer status represents the decision returned by the model regarding that wire transfer. The following statuses are used in the **analysis_status** flag:

* `automatically_approved`
* `automatically_reproved`
* `in_manual_analysis`
* `pending`

Below are the meanings of each decision returned in the analysis_status flag:

status | description
:----: | ---------
automatically_approved      | It is recommended that this wire transfer be approved.
automatically_reproved      | It is recommended that this wire transfer be reproved.
in_manual_analysis          | It is recommended that the wire transfer be analyzed manually by an analyst.
pending                     | The wire transfer is being processed.

name | type | description
:----:  | :----:  | ---------
id | string | Transaction identifier in the client's system. **It is essential that this number is unique for each wire transfer**
wire_transfer_direction | enumerator                | Registered wire transfer modality. Defines whether the client is receiving or sending money.
wire_transfer_type      | enumerator                | Type of wire transfer performed, which can be a TED, a DOC, or an internal transfer between accounts of the same institution.
amount                  | integer                   | The wire transfer amount in cents - as described in the "Standards" section.
wire_transfer_date      | datetime                  | The wire transfer start date and time, with time zone.
face_recognition_key    | string                    | Facial recognition key, if facial recognition was performed by our facial recognition API.
validation_key          | string                    | Validation key, if any client validation test was performed in our validation API.
client                  | *client* | Object representing the client's data, whether they are the client making the wire transfer or the receiver.
source_account          | *source_account* | Object representing the debited account data.
destination_account     | *destination_account* | Object representing the credited account data.
source                  | *source* | Source type object describing information coming from the application used for sending the wire transfer.

The following enumerators exist for *wire_transfer_direction*: `sent` and `received`.

The following enumerators exist for *wire_transfer_type*: `ted`, `doc`, `internal_transfer`.

## Send a Wire Transfer

Request Body

```json
  {
    "id": "12345",
    ...
  }
```

Response Body

```json
  {
    "wire_transfer_key": "13d680ef-4b72-4cb2-a63d-cf3d790abaaf",
    "status": "automatically_approved",
    "reason": "rule_decision_enum"
  }
```

To perform the evaluation of a wire transfer, simply send a Wire Transfer object to the following endpoint:

`POST https://api.caas.qitech.app/wire_transfer/wire_transfer`

## Retrieve a Wire Transfer

Response Body

```json
  {
    "id": "082373263",
    "wire_transfer_direction": "received",
    ...
  }
```

To retrieve data from a wire transfer, simply send a request to the following endpoint:

`GET https://api.caas.qitech.app/wire_transfer/wire_transfer/{wire_transfer_id}`

Where *wire_transfer_id* is the transaction identifier in the client's system used when sending the wire transfer.

## Update a Wire Transfer

Request Body

```json
  {
    "wire_transfer_status": "completed",
    "event_date": "2020-10-07T15:06:25-03:00"
  }
```

Response Body

```json
  {
    "wire_transfer_key": "13d680ef-4b72-4cb2-a63d-cf3d790abaaf",
    "wire_transfer_status": "completed"
  }
```

After a wire transfer is created and analyzed, it is sent to the clearing house for processing. Thus, it is necessary to report wire transfer status updates when it is sent, via the endpoint:

`PUT https://api.caas.qitech.app/wire_transfer/wire_transfer/{wire_transfer_id}`

This ensures that our database remains updated, allowing us to accurately identify wire transfers that are genuinely susceptible to fraud.

---

# Withdrawals

URL: /en/documentation/caas/banking/withdrawals

At the moment a user performs a withdrawal, the withdrawal data must be sent to QI Tech. This enables a risk analysis of the operation based on that dataset.

## Withdrawal Object Definition

Request Body

```json
{
    "id": "082373263",
    "amount": 12979,
    "withdrawal_date": "2020-10-07T15:06:25-03:00",
    "service_description": "SAQUE EM CAIXA 24H",
    "source_account": {
        "participant": "17315359",
        "branch": "0000",
        "account_number": "10442",
        "account_digit": "6",
        "account_type": "CACC",
        "opening_date": "2020-01-15T18:00:00-03:00"
    },
    "client": {
        "id": "182373263",
        "type": "natural_person",
        "document_number": "023.456.789-01",
        "name": "John Payer",
        "email": "john@payer.com",
        "address": {
            "street": "Av. Eng. Luis Carlos Berrini",
            "number": "105",
            "neighbourhood": "Brooklin",
            "city": "São Paulo",
            "uf": "SP",
            "complement": "Cj 303",
            "postal_code": "04501-140"
        },
        "phone": {
            "international_dial_code": "55",
            "area_code": "11",
            "number": "998861708",
            "type": "mobile"
        },
        "sales_channel": "inbound_sales",
        "segment": "Personalité"
    },
    "terminal": {
        "id": "1234566",
        "latitude": -45.2753548,
        "longitude": -15.24587,
        "address": { 
            "street": "Av. Eng. Luis Carlos Berrini",
            "number": "105",
            "neighbourhood": "Brooklin",
            "city": "São Paulo",
            "uf": "SP",
            "complement": "Cj 303",
            "postal_code": "04501-140"
        },
        "type": "atm"
    },
    "authentication": {
        "used_password": true,
        "used_card": true,
        "used_fingerprint": true,
        "typed_account_number": false
    }
}
```

A withdrawal must be sent to the API for preliminary fraud validation before being forwarded to the processing system.

The withdrawal status represents the decision returned by the model regarding that account. The following statuses are used in the **analysis_status** flag:

* `automatically_approved`
* `automatically_reproved`

Below are the meanings of each decision returned in the analysis_status flag:

status | description
:----: | ---------
automatically_approved      | It is recommended that this withdrawal be approved.
automatically_reproved      | It is recommended that this withdrawal be reproved.

name | type | description
:----:  | :----:  | ---------
id | string | Withdrawal identifier in the client's system. **It is essential that this number is unique for each withdrawal**
amount                      | integer                   | Withdrawal amount in cents - as described in the "Standards" section.
withdrawal_date             | datetime                  | Date and time of the withdrawal execution - as described in the "Standards" section.
source_account              | *account* | Object determining the source account of the funds to be withdrawn.
client                      | *client* | Object containing the data of the client holding the source account.
terminal                    | *terminal* | Object containing the data of the terminal where the withdrawal is being performed.
authentication              | *authentication* | Object containing the authentication information.

## Withdrawal Objects

### Terminal Object

Request Body

```json
{
    "id": "1234566",
    "latitude": -45.2753548,
    "longitude": -15.24587,
    "address": { 
        "street": "Av. Eng. Luis Carlos Berrini",
        "number": "105",
        "neighbourhood": "Brooklin",
        "city": "São Paulo",
        "uf": "SP",
        "complement": "Cj 303",
        "postal_code": "04501-140"
    },
    "type": "atm"
}
```

Object representing the terminal that was used for the withdrawal.

name | type | description
:----:  | :----:  | ---------
id                          | string                    | Terminal identifier in the client's system.
latitude                    | number                    | Latitude, in degrees, of the terminal's location.
longitude                   | number                    | Longitude, in degrees, of the terminal's location.
address                     | *address* | Terminal address.
type                        | enum                      | Terminal type, possible values: "atm", "counter".

### Authentication Object

Request Body

```json
{
    "used_password": true,
    "used_card": true,
    "used_fingerprint": true,
    "typed_account_number": false
}
```

Object defining the authentication parameters used at the time of withdrawal.

name | type | description
:----: | :----: | -----------
used_password               | boolean                           | Determines if the user used a password.
used_card                   | boolean                           | Determines if the user has the card present during authentication.
used_card_chip_and_pin      | boolean                           | Determines if the user used the card's chip and PIN.
used_card_magnetic_stripe   | boolean                           | Determines if the user used the card's magnetic stripe.
used_fingerprint            | boolean                           | Determines if the user used a fingerprint.
typed_account_number        | boolean                           | Determines if the user typed the account data.

## Send a Withdrawal

Request Body

```json
  {
    "id": "12345",
    ...
  }
```

Response Body

```json
  {
    "withdrawal_key": "13d680ef-4b72-4cb2-a63d-cf3d790abaaf",
    "status": "automatically_approved",
    "reason": "rule_decision_enum"
  }
```

To perform the evaluation of a withdrawal, simply send a withdrawal object to the following endpoint:

`POST https://api.caas.qitech.app/withdrawal/withdrawal`

## Retrieve a Withdrawal

Request Body

```json
  {
    "id": "082373263",
    "amount": 12979,
    ...
  }
```

To retrieve data from a withdrawal, simply send a request to the following endpoint:

`GET https://api.caas.qitech.app/withdrawal/withdrawal/{withdrawal_id}`

Where *withdrawal_id* is the transaction identifier in the client's system used when sending the withdrawal.

## Update a Withdrawal

Request Body

```json
  {
    "withdrawal_status": "completed",
    "event_date": "2020-10-07T15:06:25-03:00"
  }
```

Response Body

```json
  {
    "withdrawal_key": "13d680ef-4b72-4cb2-a63d-cf3d790abaaf",
    "withdrawal_status": "completed"
  }
```

After a withdrawal is created and analyzed, the money will be made available to the user. This process may be interrupted by some other business rule. Thus, it is necessary to report withdrawal status updates when it is finalized, via the endpoint:

`PUT https://api.caas.qitech.app/withdrawal/withdrawal/{withdrawal_id}`

This ensures that our database remains updated, allowing us to accurately identify withdrawals that are genuinely susceptible to fraud.

---

# Status HTTP

URL: /en/documentation/caas/car_rental/http_status

Todas as APIs da QI Tech utilizam a seguinte padronização nos status HTTP de retorno, de acordo com o [RFC 7231](https://tools.ietf.org/html/rfc7231):

| Status HTTP | Significado | Descrição |
| ---------- | ------- | --------------------------------- |
| 400 | Bad Request | A requisição enviada possui algum erro de formatação. Na maioria dos casos, retornamos no corpo da mensagem uma explicação de onde está o erro. |
| 401 | Unauthorized | Houve algum problema na autenticação, verifique se a API Key está correta e no header correto, de acordo com a seção Autenticação. |
| 403 | Forbidden | O endpoint acessado é de uso interno e não está disponível para esta API Key. |
| 404 | Not Found | O dado requisitado não foi encontrado usando a chave utilizada. Este status também é retornado quando um endpoint inválido é requisitado. |
| 405 | Method Not Allowed | O método HTTP utilizado não se aplica ao endpoint utilizado. |
| 406 | Not Acceptable | Os dados enviados no corpo da requisição são inválidos. Em geral, isso significa que os dados enviados não são um JSON válido. |
| 409 | Conflict | O id da requisição corresponde a um id já processado anteriormente. Este status é retornado no caso de requisições duplicadas enviadas ao servidor. |
| 500 | Internal Server Error | Tivemos um problema para processar esta requisição, ao encontrarmos esse erro nossos especialistas são automaticamente notificados e iniciam a análise e solução imediatamente. |
| 503 | Service Unavailable | Você se deparou com uma indisponibilidade, planejada ou não, de infraestrutura dos nossos servidores. |

---

# Imagens

URL: /en/documentation/caas/car_rental/image

Em várias situações é necessário enviar imagens para a nossa API, a fim de realizar operações de OCR, FaceMatch e validação de documentos. Para tanto, é preciso inicialmente realizar o upload da imagem para depois enviá-la para análise.

Ao enviar uma imagem utilizando o endpoint /image uma GUID (Globally Unique Identifier) é retornada. Este valor deverá ser utilizado nas chamadas subsequentes para referenciar esta imagem.

:::warning
O tamanho máximo de uma imagem aceita é de 10MB.
:::

:::warning
Neste momento, somente imagens com formato jpg são aceitas.
:::

## Envio

Exemplo de envio utilizando o cUrl:

```shell
curl -F "data=@path/to/local/file" \
     -H "Authorization: TESTETESTETESTE" \
     -H "DocumentNumber: 000.000.000-00" \
     "https://api.caas.qitech.app/car_rental/image?type=face"
```

Exemplo de retorno:

```json
{
  "image_key": "f1c0d2e1-f950-4360-896d-36588e443fc9",
  "file_name": "05696664903.jpg",
  "file_size": 47407,
  "width_px": 0,
  "height_px": 0,
  "type": "face",
  "created_at": "2020-07-29T18:40:57Z"
}
```

Para enviar uma imagem, basta realizar o envio da imagem no formato .jpg em `multipart/form-data` com uma requisição POST no endpoint:

`POST https://api.caas.qitech.app/car_rental/image?type=$type`

Onde $type é a classificação da imagem e deve ser enviado conforme um dos seguintes enumeradores (Caso a imagem sendo enviada não se enquadre em nenhuma das classificações, entrar em contato com o [suporte](mailto:suporte.caas@qitech.com.br) para que providenciem a adição):

- `face`
- `driver_license`
- `id`
- `contract`

Após o envio, será retornado um objeto JSON com a GUID que aponta para a imagem que foi enviada.

## Análise da Imagem para App

Ao utilizar a api_key do App, o resultado contará com um valor adicional, chamado de `result` que pode receber os seguintes valores:

- `registration_approved`
- `registration_reproved`

Que indica se o cadastro da foto foi aprovado ou reprovado.

Neste momento, a qualidade da foto também é avaliada, podendo receber um resultado 400, conforme descrito no próximo item.

Exemplo de retorno para o App:

```json
{
  "image_key": "f1c0d2e1-f950-4360-896d-36588e443fc9",
  "file_name": "05696664903.jpg",
  "file_size": 47407,
  "width_px": 0,
  "height_px": 0,
  "type": "face",
  "result": "registration_approved",
  "created_at": "2020-07-29T18:40:57Z"
}
```

## Validação de qualidade da imagem

Exemplo de retorno em caso de imagem inválida:

```json
{
  "title": "image_quality",
  "description": "A imagem enviada não possui uma face"
}
```

Ao realizar um post no endpoint de imagem, caso a imagem não seja suficiente para validação, um HTTP Status Code 400 será retornado, como pode ser visto no exemplo acima.

O valor do campo description é a mensagem que explica o motivo da imagem ser inválida.

:::info
Existem outros motivos pelos quais retornaremos 400 (Todos relacionados a dados inválidos). Somente os retornos com title "image_quality" são resultantes da validação de qualidade da imagem e portanto devem ser repassados ao usuário.
:::

## Recuperação dos Arquivos

Leitura de imagem:

```shell
curl "https://api.caas.qitech.app/car_rental/image/{image_key}/file" \
     -H "Authorization: TESTETESTETESTE"
```

Após o envio de uma imagem para a API, é possível recuperá-la por meio de uma requisição GET adequadamente autenticada no endpoint:

`GET https://api.caas.qitech.app/car_rental/image/{image_key}/file`

Onde image_key é o valor retornado durante o envio da imagem.

## Recuperação dos meta-dados do arquivo

Leitura de meta dados:

```shell
curl "https://api.caas.qitech.app/car_rental/image/{image_key}" \
     -H "Authorization: TESTETESTETESTE"
```

Após o envio de uma imagem para a API, é possível recuperar os meta-dados da imagem utilizando o endpoint:

`GET https://api.caas.qitech.app/car_rental/image/{image_key}`

Onde image_key é o valor retornado durante o envio da imagem.

---

# Introdução

URL: /en/documentation/caas/car_rental/introduction

Bem vindo à API de Prevenção a Fraudes em aluguel de veículos da QI Tech! Você pode utilizar a nossa API para acessar os endpoints, a fim de receber a resposta de um contrato de aluguel, além de utilizar para atualizar a situação de um contrato.

## Problemas?

Nós não somos uma companhia que se esconde atrás de uma API! Entre em contato com o nosso [suporte](mailto:suporte.caas@qitech.com.br) e nós responderemos o mais rápido possível. Fique à vontade para nos ligar caso deseje uma resposta rápida!

### Adoramos Feedback

Mesmo que você já tenha resolvido o seu problema ou que ele seja muito simples (Até mesmo um typo ou uma organização inadequada que você já entendeu), envie-nos um e-mail, assim nós tornamos a documentação cada vez mais prática e a próxima pessoa não vai precisar sofrer as dores que você sofreu!

## Ambientes

Possuímos dois ambientes para os nossos clientes. A URL base das APIs são:

- Produção - `https://api.caas.qitech.app/car_rental/`
- Sandbox - `https://api.sandbox.caas.qitech.app/car_rental/`

No ambiente de Sandbox, as análises enviadas não são cobradas e são respondidas de acordo com a seguinte regra **baseada no valor total do aluguel**:

| Mínimo | Máximo | Decisão |
| ------ | ------ | ------- |
| 10000 | -- | Pendente (Em análise Manual) - Sem Decisão da Mesa |
| 8000 | 9999 | Aprovado Automaticamente |
| 6000 | 7999 | Reprovado Automaticamente |
| 5000 | 5999 | Derivado para Análise Manual - Com aprovação posterior |
| 4000 | 4999 | Derivado para Análise Manual - Com reprovação posterior |
| 3000 | 3999 | Derivado para Análise Manual - Com Desafio Manual |
| 0 | 2999 | Pendente (Em análise Manual) - Sem Decisão da Mesa |

As análises de upgrade em ambiente de Sandbox seguirão as decisões de análise abaixo:

| Grupos | upgrade_status |
| ------ | -------------- |
| ('C', 'CX', 'SV', 'SU') | 'automatically_approved' |
| ('IE', 'J', 'SG') | 'automatically_reproved' |

## Somente HTTPS

Por questão de segurança, toda a comunicação com as APIs da QI Tech devem ser realizadas utilizando a comunicação HTTPS. Para garantir que, por desatenção ou qualquer outro motivo, não ocorram chamadas HTTP, este servidor somente disponibiliza a porta 443 com comunicação TLS 1.2. Chamadas realizadas utilizando outros protocolos serão automaticamente negadas.

## Autenticação

```shell
# No shell, você somente precisa adicionar o header adequado em cada requisição
curl "api_endpoint_here"
  -H "Authorization: API-KEY-EXAMPLE"
```

:::info
Substitua a API key `API-KEY-EXAMPLE` com a sua chave adquirida com o nosso suporte.
:::

Utilizamos uma API Key para permitir acesso a nossa API. Ela provavelmente já foi enviada por e-mail para você. Caso você ainda não tenha recebido a sua chave, envie um e-mail para [suporte.caas@qitech.com.br](mailto:suporte.caas@qitech.com.br).

Nossa API espera receber a API Key em todas as requisições ao nosso servidor em um header como o abaixo:

`Authorization: API-KEY-EXAMPLE`

:::note
Você deve substituir `API-KEY-EXAMPLE` com a API Key recebida do suporte.
:::

---

# Troca de Mensagens

URL: /en/documentation/caas/car_rental/messages

Para a troca de mensagens entre a mesa de análise manual e o atendente da loja, são disponibilizados dois endpoints:

- `POST https://api.caas.qitech.app/car_rental/rental_agreement/{rental_agreement_id}/message`
- `GET https://api.caas.qitech.app/car_rental/rental_agreement/{rental_agreement_id}/messages`

Todas as mensagens são vinculadas a uma análise, utilizando o id enviado no momento do envio da análise.

## Envio de Mensagem

Para que seja realizado o envio de uma mensagem, é necessário realizar a requisição utilizando o método POST no endpoint message, com uma payload que possui os seguintes campos:

| nome | tipo | descrição |
| ---- | :----: | --------- |
| author_document_number | string | CPF formatado de quem está enviando a mensagem |
| author_name | string | Nome de quem está enviando a mensagem |
| message | string | Mensagem sendo enviada |

Exemplo de payload para envio de uma mensagem:

```json
{
  "author_name": "John Sample",
  "author_document_number": "000.000.000-00",
  "message": "Alerta de fraude"
}
```

## Recebimento de Mensagens

Para que as mensagens possam ser exibidas para o atendente, basta realizar a recuperação das mensagens trocadas por meio do endpoint de GET. O endpoint pode receber um query parameter chamado `only_messages_to_show`, que ao receber o valor `true` retorna somente as mensagens que devem ser exibidas na tela do atendente.

Os dados do autor somente são devolvidos quando a mensagem foi produzida por um ser humano.

Retorno no endpoint de recuperação de mensagens:

```json
[
  {
    "author_name": "John Sample",
    "author_document_number": "000.000.000-00",
    "source": "analysis_screen",
    "message": "Análise finalizada",
    "message_date": "2019-11-05T13:34:12-03:00"
  },
  {...}
]
```

---

# Shared Objects

URL: /en/documentation/caas/car_rental/objects

A good part of the data is shared between Reservation and RentalAgreement. Below you can easily find the definitions of these objects.

## *reservation* Object

```json
{
  "id": "0",
  "channel": "reservation_central",
  "reservation_date": "2020-03-31T08:15:00-03:00",
  "sales_channel" : "PARCERIA TELEFONICA"
}
```

The *reservation* object is used in the *rental_agreement* endpoint to represent the reservation that originated the rental to be analyzed. This field is required so that a rental_agreement can be linked to the reservation. It is represented as follows:

| name | type | description |
| ---- | :----: | --------- |
| id | integer | Identifier of the reservation that originated the rental. |
| channel | enum | Channel through which the reservation for this rental was made. |
| reservation_date | DateTime | Date and time, with time zone, when the reservation for this rental was made. |
| sales_channel | string | Sales channel through which the reservation was made (e.g.: PARCERIA MASTERCARD). |

The following enumerators exist for the *channel* field: `walkin`, `reservation_central`, `app`, `website_mobile`, `website_desktop`, `partnerships` and `third_parties`.

## *car* Object

```json
{
  "model_group": "C",
  "upgrade_model_group": "SV",
  "group_description": "Sedan Médio 1.4",
  "rental_daily_price": 48496
}
```

The *car* object represents a vehicle that is being reserved (*reservation* endpoint) or picked up (*rental_agreement* endpoint). The data sent is:

| name | type | description |
| ---- | :----: | --------- |
| **model_group** | string | The vehicle group, in uppercase letters. *(required)* |
| upgrade_model_group | string | The vehicle group of the upgrade, in uppercase letters. |
| group_description | string | A description of the vehicle group. |
| rental_daily_price | integer | The daily rate charged. |

## *client* Object

The *client* object represents the data of the customer who is making the reservation or picking up the vehicle.

### *client (v1)* Object

The "v1" example represents the sample payload **before the migration of the main scoring to the reservation**. For both reservations and rental_agreements.

```json
{
  "type": "natural_person",
  "document_number": "123.456.789-00",
  "name": "John Sample",
  "gender": "female",
  "birthdate": "2001-01-15",
  "mother_name": "Mary Sample",
  "email": "john.sample@sample.com.br",
  "allowed_information_on_email": true,
  "face_picture": "c77d1925-0e72-4634-8393-395dbbce498d",
  "additional_pictures": [
    "718b8caa-8ef5-446c-b101-2dbf6c7e401f",
    "9c67f365-1427-4889-b963-d3729d437ff3",
    "8006f82c-3a80-4371-914e-e88c91507711",
    "42c6909e-51aa-4b6d-972f-f4684a047993",
    "b7a88947-96bd-4557-81e9-a69a3c84f428"
  ],
  "total_rents": 6,
  "fidelity_points": 1200,
  "documents": {
    "rg": {
      "document_number": "00000000",
      "issuer": "SSP"
    },
    "cnh": {
      "document_number": "000000000",
      "security_code": "00000",
      "first_issuance": "2015-07-20",
      "expiration_date": "2030-07-26",
      "state": "SP"
    }
  },
  "residential_address": {
    "street": "Av Brigadeiro Faria Lima",
    "number": "2391",
    "neighborhood": "Jardins",
    "city": "SÃO PAULO",
    "uf": "SP",
    "complement": "",
    "postal_code": "00000-000"
  },
  "commercial_address": {
    "street": "Av Brigadeiro Faria Lima",
    "number": "2391",
    "neighborhood": "Jardins",
    "city": "SÃO PAULO",
    "uf": "SP",
    "complement": "",
    "postal_code": "00000-000"
  },
  "phones": [
    {
      "international_dial_code": "55",
      "area_code": "11",
      "number": "00000-0000",
      "type": "mobile"
    },
    {
      "international_dial_code": "55",
      "area_code": "11",
      "number": "00000-0000",
      "type": "residential"
    }
  ]
}
```

| name | type | description |
| ---- | :----: | --------- |
| **type** | enum | Enumerator that defines the client type. *(required)* |
| **document_number** | string | The client's CPF or Passport. *(required)* |
| **name** | string | The client's full name. *(required)* |
| **gender** | enum | The client's gender. *(required)* |
| birthdate | date | The client's date of birth. |
| mother_name | string | The full name of the client's mother. |
| **email** | string | The email provided by the client. *(required)* |
| **allowed_information_on_email** | boolean | Flag indicating whether the client allowed marketing emails to be sent at registration. *(required)* |
| face_picture | GUID | GUID of the previously uploaded image whose content is a picture of the client's face. |
| additional_pictures | List of GUIDs | List of GUIDs of the additional images uploaded of the clients' faces and documents. |
| total_rents | integer | Total number of rentals of the client. |
| fidelity_points | integer | Number of loyalty points of the client. |
| **documents** | *documents* | Object containing the details of the client's documents. *(required)* |
| residential_address | *address* | The client's residential address. |
| commercial_address | *address* | The client's commercial address. |
| **phones** | List of *phone* | List of the client's phone numbers. *(required)* |

The following enumerators exist for the *type* field: `natural_person`, `legal_person`, `replacement`, `fleet`, `uber`, `enterprise` and `agencia`.

The following enumerators exist for the *gender* field: `male`, `female` and `undefined`.

### *client (v2)* Object

This section concerns the information required for the fraud analysis flow primarily on the reservation.

The "client (v2)" object example represents the sample payload **after the migration of the main scoring to the reservation**. For both reservations and rental_agreements.

```json
{
  "type": "natural_person",
  "document_number": "123.456.789-00",
  "name": "John Sample",
  "gender": "female",
  "birthdate": "2001-01-15",
  "mother_name": "Mary Sample",
  "email": "john.sample@sample.com.br",
  "allowed_information_on_email": true,
  "face_picture": "c77d1925-0e72-4634-8393-395dbbce498d",
  "additional_pictures": [
    "718b8caa-8ef5-446c-b101-2dbf6c7e401f",
    "9c67f365-1427-4889-b963-d3729d437ff3",
    "8006f82c-3a80-4371-914e-e88c91507711",
    "42c6909e-51aa-4b6d-972f-f4684a047993",
    "b7a88947-96bd-4557-81e9-a69a3c84f428"
  ],
  "total_rents": 6,
  "fidelity_points": 1200,
  "documents": {
    "rg": {
      "document_number": "00000000",
      "issuer": "SSP"
    },
    "cnh": {
      "document_number": "000000000",
      "security_code": "00000",
      "first_issuance": "2015-07-20",
      "expiration_date": "2030-07-26",
      "state": "SP"
    }
  },
  "residential_address": {
    "street": "Av Brigadeiro Faria Lima",
    "number": "2391",
    "neighborhood": "Jardins",
    "city": "SÃO PAULO",
    "uf": "SP",
    "complement": "",
    "postal_code": "00000-000"
  },
  "commercial_address": {
    "street": "Av Brigadeiro Faria Lima",
    "number": "2391",
    "neighborhood": "Jardins",
    "city": "SÃO PAULO",
    "uf": "SP",
    "complement": "",
    "postal_code": "00000-000"
  },
  "phones": [
    {
      "international_dial_code": "55",
      "area_code": "11",
      "number": "00000-0000",
      "type": "mobile"
    },
    {
      "international_dial_code": "55",
      "area_code": "11",
      "number": "00000-0000",
      "type": "residential"
    }
  ]
}
```

| name | type | description |
| ---- | :----: | --------- |
| **type** | enum | Enumerator that defines the client type. - expected types: "natural_person", "legal_person", "replacement", "fleet", "uber", "agencia", "uber_semanal" *(required)* |
| **document_number** | string | The client's CPF or Passport. *(required)* |
| name | string | The client's full name. |
| **gender** | enum | The client's gender. *(required)* |
| birthdate | date | The client's date of birth. |
| mother_name | string | The full name of the client's mother. |
| email | string | The email provided by the client. |
| allowed_information_on_email | boolean | Flag indicating whether the client allowed marketing emails to be sent at registration. *(required)* |
| face_picture | GUID | GUID of the previously uploaded image whose content is a picture of the client's face. |
| additional_pictures | List of GUIDs | List of GUIDs of the additional images uploaded of the clients' faces and documents. |
| total_rents | integer | Total number of rentals of the client. |
| fidelity_points | integer | Number of loyalty points of the client. |
| **documents** | *documents* | Object containing the details of the client's documents. *(required)* |
| residential_address | *address* | The client's residential address. |
| commercial_address | *address* | The client's commercial address. |
| **phones** | List of *phone* | List of the client's phone numbers. *(required)* |

The following enumerators exist for the *type* field: `natural_person`, `legal_person`, `replacement`, `fleet`, `uber`, `enterprise` and `agencia`.

The following enumerators exist for the *gender* field: `male`, `female` and `undefined`.

## *participant* Object

The *participant* object represents a person involved in the rental who is not the main renter, that is, an **additional driver** or the **financial manager**. It is the definition used both in the `additional_drivers` list and in the `financial_manager` field of a RentalAgreement.

Its structure is the same as the *client* object, so the same serialization implementation can be reused.

:::note
Every participant sent goes through the same fraud analysis applied to the main renter, but the result of these analyses **does not change the fraud_status** of the RentalAgreement.
:::

```json
{
  "type": "natural_person",
  "segment": "ota",
  "document_number": "987.654.321-00",
  "name": "Jane Sample",
  "gender": "female",
  "birthdate": "1998-05-22",
  "mother_name": "Mary Sample",
  "email": "jane.sample@sample.com.br",
  "allowed_information_on_email": true,
  "face_picture": "e3b0c442-98fc-1c14-9afb-f4c8996fb924",
  "additional_pictures": [
    "718b8caa-8ef5-446c-b101-2dbf6c7e401f"
  ],
  "total_rents": 2,
  "fidelity_points": 0,
  "documents": {
    "rg": {
      "document_number": "00000000",
      "issuer": "SSP"
    },
    "cnh": {
      "document_number": "000000000",
      "security_code": "00000",
      "first_issuance": "2018-03-10",
      "expiration_date": "2028-03-10",
      "state": "SP"
    }
  },
  "residential_address": {
    "street": "Av Brigadeiro Faria Lima",
    "number": "2391",
    "neighborhood": "Jardins",
    "city": "SÃO PAULO",
    "uf": "SP",
    "complement": "",
    "postal_code": "00000-000",
    "country": "BRA"
  },
  "phones": [
    {
      "international_dial_code": "55",
      "area_code": "11",
      "number": "00000-0000",
      "type": "mobile"
    }
  ]
}
```

| name | type | description |
| ---- | :----: | --------- |
| **type** | enum | Enumerator that defines the participant type. *(required)* |
| segment | string | Segment the participant belongs to. |
| **document_number** | string | The participant's CPF, CNPJ or Passport. *(required)* |
| **name** | string | The participant's full name. *(required)* |
| **gender** | enum | The participant's gender. *(required)* |
| birthdate | date | The participant's date of birth. |
| mother_name | string | The full name of the participant's mother. |
| **email** | string | The email provided by the participant. *(required)* |
| **allowed_information_on_email** | boolean | Flag indicating whether the participant allowed marketing emails to be sent at registration. *(required)* |
| face_picture | GUID | GUID of the previously uploaded image whose content is a picture of the participant's face. |
| additional_pictures | List of GUIDs | List of GUIDs of the additional images uploaded of the participant's face and documents. |
| total_rents | integer | Total number of rentals of the participant. |
| fidelity_points | integer | Number of loyalty points of the participant. |
| **documents** | *documents* | Object containing the details of the participant's documents. *(required)* |
| residential_address | *address* | The participant's residential address. |
| commercial_address | *address* | The participant's commercial address. |
| **phones** | List of *phone* | List of the participant's phone numbers. *(required)* |

The following enumerators exist for the *type* field: `natural_person`, `legal_person`, `replacement`, `fleet`, `uber`, `enterprise`, `agencia` and `uber_semanal`.

The following enumerators exist for the *gender* field: `male`, `female` and `undefined`.

## *billing* Object

```json
{
  "name": "Agência AAA",
  "document_number": "00.000.000/0001-00",
  "voucher_type":"ABCD75",
  "voucher_description": "Pagamento pela Agência"
}
```

The *billing* object is used to represent who is responsible for paying the rental, and it is represented as follows:

| name | type | description |
| ---- | :----: | --------- |
| name | string | Name of the person or company responsible for paying the rental. |
| document_number | string | CPF, CNPJ or Passport of the person or company responsible for paying the rental. |
| voucher_type | string | Alphanumeric code that represents the type of voucher used. |
| voucher_description | string | Description of the type of voucher used. |

## *address* Object

```json
{
  "street": "Rua do Exemplo",
  "number": "111",
  "neighborhood": "Bairro do Teste",
  "city": "Aparecida de Goiânia",
  "uf": "GO",
  "complement": "",
  "postal_code": "00000-000"
}
```

The *address* object is used to represent addresses across the entire API. Addresses within Brazilian territory are represented as follows:

| name | type | description |
| ---- | :----: | --------- |
| street | string | Street of the address, including the street type, avoiding abbreviations whenever possible. |
| number | string | Number of the property, including letters if it has any. |
| neighborhood | string | Neighborhood, without abbreviations. **e.g.: Santa Felicidade** |
| city | string | Full name of the city, without abbreviations. |
| uf | string | The federative unit, with two uppercase letters. **e.g.: SP** |
| complement | string | Any complements that help locate the property. **e.g.: Apartamento 101, Conjunto 12** |
| postal_code | string | The postal code of the location, including the hyphen. |
| country | string | ISO 3166-1 alpha-3 code of the address country. |

For addresses whose country is not Brazil ("BRA"), the postal_code and the federative unit may be filled in freely.

## *documents* Object

The *documents* object is used to represent the details of the document data provided by the client. The object is represented as follows:

| name | type | description |
| ---- | :----: | --------- |
| rg | *rg* | Object describing the information of the client's RG (Brazilian ID card). |
| cnh | *cnh* | Object describing the information of the client's CNH (Brazilian driver's license). |
| foreign_document | *foreign_document* | Object describing the information of the client's foreign document. |

## *rg* Object

The *rg* object is used to represent the details of the RG data provided by the client. The object is represented as follows:

| name | type | description |
| ---- | :----: | --------- |
| document_number | string | Number of the client's RG. |
| issuer | string | Issuing authority and state of issuance of the client's RG. |

## *cnh* Object

The *cnh* object is used to represent the details of the driver's license data provided by the client. The object is represented as follows:

| name | type | description |
| ---- | :----: | --------- |
| document_number | string | Registration number of the client's driver's license. |
| security_code | string | Security code of the client's driver's license. |
| first_issuance | date | Date of the first issuance of the client's driver's license. |
| expiration_date | string | Expiration date of the client's driver's license. |
| state | string | State of issuance of the client's driver's license. |

## *foreign_document* Object

The *foreign_document* object is used to represent the foreign document provided by the client. The object is represented as follows:

| name | type | description |
| ---- | :----: | --------- |
| document_number | string | Number of the client's foreign document. |
| document_type | enum | Type of the foreign document. Accepts the values `passport` and `other`. |
| issuer_country | string | ISO 3166-1 alpha-3 code of the country that issued the document. |

## *phone* Object

```json
{
  "international_dial_code": "1",
  "area_code": "11",
  "number": "99999-9999",
  "type": "mobile"
}
```

A phone object represents a phone number, inside or outside Brazil, and its classification. Its fields are:

| name | type | description |
| ---- | :----: | --------- |
| **international_dial_code** | string | International dialing code, without zero or +, digits only. *(required)* |
| **area_code** | string | Area code, without zero, digits only. *(required)* |
| **number** | string | Phone number, without the hyphen. *(required)* |
| **type** | enum | Type of number: mobile, residential, commercial, etc. *(required)* |

The following enumerators exist for the phone type: `residential`, `commercial`, `mobile`.

## *coverage* Object

```json
{
  "description": "S/ PROTEÇÃO AMERICAN PLATINUM",
  "price": 0
}
```

A coverage object is related to a coverage purchased by the renter.

| name | type | description |
| :----: | :----: | --------- |
| **description** | string | Description of the purchased coverage. *(required)* |
| **price** | integer | Daily price of the coverage. *(required)* |

---

# Envio de Resultado Quiz

URL: /en/documentation/caas/car_rental/quiz

Para o envio do resultado Quiz, para que apareça na interface gráfica, o seguinte endpoint deve ser utilizado:

`POST https://api.caas.qitech.app/car_rental/rental_agreement/{rental_agreement_id}/quiz_result`

O resultado do quiz é vinculado a uma análise, utilizando o id enviado no momento do envio da análise.

## Envio do Quiz

Para que seja enviado o resultado do Quiz, é necessário realizar a requisição utilizando o método POST no endpoint quiz_result, com uma payload que possui os seguintes campos:

| nome | tipo | descrição |
| ---- | :----: | --------- |
| score | number | Valor numérico do score do Quiz |
| result_enum | string | Enumerador do resultado do quiz: `low_risk`, `medium_risk`, `high_risk` |
| result_description | string | Descrição do resultado do quiz: "Baixo Risco", "Médio Risco", "Alto Risco" e outros |

Exemplo de payload para envio do resultado do Quiz:

```json
{
  "score": 950,
  "result_enum": "low_risk",
  "result_description": "Baixo Risco"
}
```

---

# RentalAgreement-v1

URL: /en/documentation/caas/car_rental/rental_agreement

When picking up a vehicle at the store, the renter starts their anti-fraud process. The data sent must be the final data, which will not be changed. This is important to guarantee two things:

- Consistency of the data in the Anti-fraud database
- A realistic risk assessment

The analysis process consists of sending a RentalAgreement to the appropriate endpoint and waiting for the response. There are eight possible results, returned in the **fraud_status** flag:

| Result | Description |
| :---------: | --------- |
| Automatically Approved | We recommend that this rental be approved |
| Automatically Denied | We recommend that this rental be rejected |
| Sent to manual analysis | Our rules or models are not confident about the decision and decided to send this rental to manual analysis. |
| Manually Approved | After manual analysis, the analyst chose to approve the rental |
| Manually Rejected | After manual analysis, the analyst chose to reject the rental |
| Manually Challenged | After manual analysis, the analyst informs the store that the driver's license and/or the selfie are incorrect and/or of low quality |
| Pending | The queries are taking longer than expected, this rental entered an automatic analysis queue and will be answered through a Webhook |
| Not analyzed | The request was sent with the analysis flag set to false, which means our systems must not return a decision |

### Status Dynamics

When retrieving a RentalAgreement object, the statuses are available. In addition to the statuses, a history of changes is also returned so that it can be consulted in the future. These changes are called events and carry, besides the new status, the modification dates.

### Status Dynamics - **car_status**

The **car_status** status related to a RentalAgreement indicates the situation of the car related to this rental, that is, whether the car was returned or not. The following enumerators exist for this status:

- `rented`
- `returned`
- `recovered`
- `written_off`

### Status Dynamics - **fraud_status**

The **fraud_status** status indicates the status of the fraud engine's decision and has a fairly simple state machine:

- `created`
- `automatically_approved`
- `automatically_reproved`
- `in_manual_analysis`
- `manually_approved`
- `manually_reproved`
- `manually_challenged`
- `pending`
- `not_analyzed`

In addition, upgrade_status has the same enumerators.

### Additional drivers and financial manager

Besides the main renter, sent in `client`, a RentalAgreement may carry other people involved in the rental:

- **Additional drivers** (`additional_drivers`): list of people authorized to drive the vehicle besides the main renter.
- **Financial manager** (`financial_manager`): individual or company designated as responsible for paying the rental. There is at most one financial manager per rental.

Both fields use the *participant* object definition, whose structure is identical to the *client* object.

Every participant sent goes through the **same anti-fraud queries and analyses** applied to the main renter, so this data also feeds the Anti-fraud database. The individual result of each participant is returned in the analysis response, as described in [Send a RentalAgreement](#send-a-rentalagreement). However, this result **does not change the fraud_status of the RentalAgreement**, which is still determined by the assessment of the main renter.

Both fields are optional and may be omitted when there are no participants besides the main renter.

## Object Definition

```json
{
  "id": "bca6268e-918a-4658-9161-a10b00a631ab",
  "rental_agreement_code" : "12345678",
  "rental_agreement_date": "2020-03-31T10:30:00-03:00",
  "car_rental_estimated_final_date":  "2020-04-01T10:28:00-03:00",
  "reservation": {
    "id": "0",
    "channel": "reservation_central",
    "reservation_date": "2020-03-31T08:15:00-03:00",
    "sales_channel" : "PARCERIA TELEFONICA"
  },
  "rental_store": "SAOP",
  "rental_store_group": "GSP",
  "rental_store_type": "LOJA DE RUA",
  "devolution_store": "SAOP",
  "risky_antecedence": true,
  "car": {
    "model_group": "AM",
    "upgrade_model_group": "SV",
    "rental_daily_price" : 48496,
    "risky_model_group": true,
    "risky_upgrade_model_group": true
  },
  "client": {
    "type": "natural_person",
    "segment": "ota",
    "document_number": "123.456.789-00",
    "name": "John Sample",
    "gender": "female",
    "birthdate": "2001-01-15",
    "mother_name": "Mary Sample",
    "email": "john.sample@sample.com.br",
    "allowed_information_on_email": true,
    "face_picture": "c77d1925-0e72-4634-8393-395dbbce498d",
    "additional_pictures": [
      "718b8caa-8ef5-446c-b101-2dbf6c7e401f",
      "9c67f365-1427-4889-b963-d3729d437ff3",
      "8006f82c-3a80-4371-914e-e88c91507711",
      "42c6909e-51aa-4b6d-972f-f4684a047993",
      "b7a88947-96bd-4557-81e9-a69a3c84f428"
    ],
    "total_rents": 6,
    "fidelity_points": 1200,
    "documents": {
      "rg": {
        "document_number": "00000000",
        "issuer": "SSP"
      },
      "cnh": {
        "document_number": "000000000",
        "security_code": "00000",
        "first_issuance": "2015-07-20",
        "expiration_date": "2030-07-26",
        "state": "SP"
      }
    },
    "residential_address": {
      "street": "Av Brigadeiro Faria Lima",
      "number": "2391",
      "neighborhood": "Jardins",
      "city": "SÃO PAULO",
      "uf": "SP",
      "complement": "",
      "postal_code": "00000-000"
    },
    "commercial_address": {
      "street": "Av Brigadeiro Faria Lima",
      "number": "2391",
      "neighborhood": "Jardins",
      "city": "SÃO PAULO",
      "uf": "SP",
      "complement": "",
      "postal_code": "00000-000"
    },
    "phones": [
      {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "00000-0000",
        "type": "mobile"
      },
      {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "00000-0000",
        "type": "residential"
      }
    ]
  },
  "additional_drivers": [
    {
      "type": "natural_person",
      "document_number": "987.654.321-00",
      "name": "Jane Sample",
      "gender": "female",
      "email": "jane.sample@sample.com.br",
      "allowed_information_on_email": true,
      "face_picture": "e3b0c442-98fc-1c14-9afb-f4c8996fb924",
      "documents": {
        "cnh": {
          "document_number": "000000000",
          "security_code": "00000",
          "first_issuance": "2018-03-10",
          "expiration_date": "2028-03-10",
          "state": "SP"
        }
      },
      "phones": [
        {
          "international_dial_code": "55",
          "area_code": "11",
          "number": "00000-0000",
          "type": "mobile"
        }
      ]
    }
  ],
  "financial_manager": {
    "type": "legal_person",
    "document_number": "00.000.000/0001-00",
    "name": "Empresa Sample LTDA",
    "gender": "undefined",
    "email": "financeiro@sample.com.br",
    "allowed_information_on_email": false,
    "documents": {},
    "phones": [
      {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "00000-0000",
        "type": "commercial"
      }
    ]
  },
  "coverages": [
    {
      "description": "S/ PROTEÇÃO AMERICAN PLATINUM",
      "price": 0
    },
    {
      "description": "PROTEÇÃO OCUPANTES E TERCEIROS",
      "price": 1668
    }
  ],
  "billing": {
    "name": "Agência AAA",
    "document_number": "00.000.000/0001-00",
    "voucher_type": "ABCD75",
    "voucher_description": "Pagamento pela agência"
  },
  "fare_name": "Mensal",
  "rental_price": 43300,
  "extra_hours": 0,
  "extra_hours_price": 0,
  "discount": 0,
  "prepayment_discount": 100,
  "extra_kms": 0,
  "extra_kms_price": 0,
  "third_party_coverage_price": 1490,
  "coverage_price": 0,
  "additional_driver_price": 1000,
  "driver_service_price": 1000,
  "additional_expenses": 1000,
  "devolution_fee": 0,
  "administration_fee": 5374,
  "discount_partial_coverage": 50,
  "free_day_discount": 20000,
  "final_price": 50165,
  "pre_authorization_amount": 0,
  "coverage_deductible_amount": 0,
  "upgrade_reason": "granted"
}
```

All information exchanges of a RentalAgreement use the following definition for this object. In some cases, to make the implementation easier and reduce the data flow between the parties, some information may be omitted.

| name | type | description |
| :----: | :----: | --------- |
| **id** | string | Identifier of the analysis request in the client's system. **It is essential that this number be unique for each rental.** *(required)* |
| **rental_agreement_code** | string | Identifier of the RentalAgreement in the client's system. *(required)* |
| **rental_agreement_date** | DateTime | Date and time, with time zone, of the vehicle pickup for the rental that is taking place. *(required)* |
| **car_rental_estimated_final_date** | DateTime | Date and time, with time zone, of when the car is expected to be returned. *(required)* |
| **reservation** | *reservation* | Object that carries the properties of the reservation that originated this rental. *(required)* |
| **rental_store** | *store* | Store where the car is being picked up. *(required)* |
| rental_store_group | *store* | Branch of the store where the car is being picked up. |
| rental_store_type | *store* | Type of the store where the car will be picked up. |
| **devolution_store** | *store* | Store where the car will be returned; it may or may not be the same pickup store. *(required)* |
| **car** | *car* | Car that is being picked up - it is important that this value be, in fact, the car being picked up. *(required)* |
| **client** | *client* | Object that carries the information of the client who is picking up the vehicle. *(required)* |
| additional_drivers | List of *participant* | List of the additional drivers authorized to drive the vehicle in this rental. |
| financial_manager | *participant* | Individual or company designated as the financial manager of this rental. |
| **coverages** | List of *coverage* | List of coverage objects describing the insurance coverages purchased by the client. *(required)* |
| **billing** | *billing* | Object describing the details of the person or company responsible for paying the rental. *(required)* |
| **rental_price** | integer | Rental price, in cents. *(required)* |
| **extra_hours** | integer | Number of extra hours purchased. *(required)* |
| **extra_hours_price** | integer | Price of the extra hours purchased, in cents. *(required)* |
| **discount** | integer | Discount granted for any reason, in cents. *(required)* |
| **prepayment_discount** | integer | Discount for advance payment. |
| **extra_kms** | integer | Number of extra kilometers purchased. *(required)* |
| **extra_kms_price** | integer | Price of the extra kilometers purchased, in cents. *(required)* |
| **third_party_coverage_price** | integer | Price of the third-party insurance, in cents. *(required)* |
| **coverage_price** | integer | Price of the insurance purchased, in cents. *(required)* |
| additional_driver_price | integer | Total price of the additional driver(s) purchased, in cents. |
| driver_service_price | integer | Total price of the driver service purchased, in cents. |
| additional_expenses | integer | Additional expenses, in cents. |
| **devolution_fee** | integer | Price of the return fee, in cents. *(required)* |
| **administration_fee** | integer | Price of the administration fee, in cents. *(required)* |
| **discount_partial_coverage** | integer | Partial protection discount, in cents. |
| **free_day_discount** | integer | Free Day discount, in cents. |
| **final_price** | integer | Final price of the rental, in cents. *(required)* |
| pre_authorization_amount | integer | Pre-authorization amount, in cents. |
| **coverage_deductible_amount** | integer | Deductible amount of the coverage, in cents. *(required)* |
| upgrade_reason | enum | Type of upgrade (Granted or Bought) - Accepts the values `granted` and `bought` respectively. |

## Send a RentalAgreement

Request example:

```json
{
  "id": "bca6268e-918a-4658-9161-a10b00a631ab",
  ...
}
```

Response example:

```json
{
  "id": "bca6268e-918a-4658-9161-a10b00a631ab",
  "fraud_status": "automatically_approved",
  "financial_manager": {
    "fraud_status": "automatically_approved"
  },
  "additional_drivers": [
    {
      "id": "1111111",
      "fraud_status": "automatically_approved"
    }
  ],
  "pre_authorization_amount": 100000,
  "block_document_number": true,
  "upgrade_status": "automatically_approved",
  "highest_allowed_car_group": "SV",
  "score": 870
}
```

If the rental was sent with additional drivers and/or a financial manager, the individual analysis result of each of them is also returned:

| name | type | description |
| ---- | :----: | --------- |
| financial_manager.fraud_status | enum | Result of the anti-fraud analysis of the financial manager. Uses the same enumerators as the RentalAgreement **fraud_status**. |
| additional_drivers[].id | string | Identifier of the additional driver analyzed. |
| additional_drivers[].fraud_status | enum | Result of the anti-fraud analysis of that additional driver. Uses the same enumerators as the RentalAgreement **fraud_status**. |

:::note
These statuses are informative and independent: a rejected additional driver or financial manager **does not change** the RentalAgreement **fraud_status**. It is up to the rental company to decide what to do with the rejected participant, such as refusing to include that driver in the rental.
:::

To assess a rental, simply send a RentalAgreement object to the following endpoint with the flag set appropriately:

`POST https://api.caas.qitech.app/car_rental/rental_agreement?analyze=true`

Besides the status of the response, the desired pre-authorization amount is also returned, if there is one. If no pre-authorization increase is identified, the returned value is null and must not be used.

The highest group that can be provided in that RA is made available in the `highest_allowed_car_group` variable. This value is configured in the RA assessment rule.

The *analyze* parameter exists to prevent transactions that do not need to be analyzed from going through the fraud engines, polluting the database. The default value of this parameter is **true**, so that only rentals explicitly removed from the analysis will not be analyzed.

## Update the status of a RentalAgreement

Request body - When a car rental is effected:

```json
{
  "car_status": "rented",
  "event_date": "2019-11-05T13:34:12-03:00"
}
```

Request body - On the return of a car without incidents:

```json
{
  "car_status": "returned",
  "event_date": "2019-11-05T13:34:12-03:00"
}
```

Request body - On the return of a car recovered after a theft:

```json
{
  "car_status": "recovered",
  "incident": "theft",
  "event_date": "2019-11-05T13:34:12-03:00"
}
```

Request body - Write-off with confirmed fraud:

```json
{
  "car_status": "written_off",
  "incident": "misappropriation",
  "event_date": "2019-11-05T13:34:12-03:00"
}
```

To guarantee the feedback loop of the rules and of the implemented artificial intelligence model, it is necessary to inform the system when cars are rented, returned, or written off due to fraud. To do so, requests with the PUT method must be used, passing as a reference the id sent when creating the *rental_agreement*, authenticated as usual:

`PUT https://api.caas.qitech.app/car_rental/rental_agreement/{rental_agreement_id}`

If the new status is *written_off*, the following values can be used in the **incident** field, sent in the request body, which indicates the type of incident of the rental:

| Enumerator | Description |
| --------- | ----------- |
| theft | RAs that suffered a theft |
| misappropriation | RAs that were classified as misappropriation |

## Update the vehicle of a RentalAgreement

Request body - Updating a vehicle in the rental:

```json
{
  "car_plate": "ABC1B34",
  "car_model": "Chevrolet Onix",
  "model_group": "B",
  "event_date": "2020-10-15T13:34:12-03:00"
}
```

To guarantee the consistency between fraud occurrences and rentals and to guarantee the retraining of the score model, it is necessary to inform the system of the data of each car when it is linked to the rental. To do so, requests with the POST method must be used, passing as a reference the id sent when creating the *rental_agreement*, authenticated as usual:

`POST https://api.caas.qitech.app/car_rental/rental_agreement/{rental_agreement_id}/car`

The data of the vehicle being linked to that rental must be sent in the request body:

| name | type | description |
| ---- | :----: | --------- |
| car_plate | string | License plate of the vehicle. |
| car_model | string | Model of the vehicle, including its make and model (e.g.: Jeep Renegade). |
| model_group | string | The group of the vehicle, in uppercase letters. |
| event_date | DateTime | Date and time, with time zone, of the moment when the car was associated with the rental. |

## Retrieve a RentalAgreement

In order to retrieve a specific RentalAgreement, simply make a GET request. The returned result is the most up-to-date json of the RentalAgreement in question. If this identifier is not related to any object, HTTP Status 404 is returned.

`GET https://api.caas.qitech.app/car_rental/rental_agreements/{rental_agreement_id}`

```shell
curl "https://api.caas.qitech.app/car_rental/rental_agreements/{rental_agreement_id}"
  -H "Authorization: TESTETESTETESTE"
```

## Search RentalAgreements

Response - a list of RentalAgreement objects:

```json
[
  {
    "id": "bca6268e-918a-4658-9161-a10b00a631ab",
    ...
  },
  {
    "id": "13a91409-9793-49b6-8583-9ba575075831",
    ...
  }
]
```

If it is necessary to search for a RentalAgreement, a GET with query parameters can be used. The returned result is a JSON representing a list of RentalAgreements. If no object is found with the parameters sent, HTTP Status 200 is returned with an empty list in the response body.

`GET https://api.caas.qitech.app/car_rental/rental_agreements?initial_date=2019-10-01&final_date=2019-10-05&page_number=2&page_rows=20`

The following parameters can be used to search for RentalAgreement objects:

| Parameter | Default | Description |
| --------- | ----------- | -------------- |
| initial_date | null | First date that must be returned based on the rental_agreement_date field |
| final_date | null | Last date that must be returned based on the rental_agreement_date field |
| store_code | null | Code of the store from which the results must be returned |
| page_number | 1 | Number of the desired results page |
| page_rows | 50 | Maximum number of objects to be returned in a query |

---

# RentalAgreement-v2

URL: /en/documentation/caas/car_rental/rental_agreement_v2

Esta seção diz respeito ao fluxo de análise de fraude com a scoragem principal ocorrendo na reserva.

Ao realizar a retirada de um veículo na loja, o locatário dá início ao seu processo de anti-fraude. Os dados enviados deverão ser os dados finais, que não serão alterados. Isto é importante para garantir dois pontos:

- Consistência dos dados na base de dados do Antifraude
- Avaliação realista do risco

O processo de análise consiste em enviar um RentalAgreement no endpoint adequado e esperar a resposta. Existem oito resultados possíveis, devolvido na flag **fraud_status**:

| Resultado | Descrição |
| :---------: | --------- |
| Aprovado Automaticamente | Recomenda-se que este aluguel seja aprovado |
| Negado Automaticamente | Recomenda-se que este aluguel seja reprovado |
| Derivado para análise manual | Nossas regras ou modelos não estão confiantes da decisão e decidiram enviar este aluguel para a análise manual. |
| Aprovado Manualmente | Após análise manual, o analista escolheu aprovar o aluguel |
| Reprovado Manualmente | Após análise manual, o analista escolheu reprovar o aluguel |
| Desafiado Manualmente | Após análise manual, o analista retorna para a loja que a CNH e/ou Selfie estão incorretas e/ou com baixa qualidade |
| Pendente | As consultas estão demorando mais do que o esperado, este aluguel entrou em uma fila de análise automática e será respondido por meio de Webhook |
| Não analisado | A consulta foi enviada com a flag de análise falsa, o que significa que nossos sistemas não deverão retornar parecer |

### Dinâmica dos Status

Ao recuperar um objeto do tipo RentalAgreement os status estão disponíveis. Além dos status, um histórico de modificações também são retornados para que possa ser consultado no futuro. Estas modificações são entituladas events e possuem, além do novo status, as datas de modificação.

### Dinâmica dos Status - **car_status**

O status **car_status** relacionado a um RentalAgreement indica a situação do carro relacionado a este aluguel, isto é, se o carro foi devolvido ou não. Os seguintes enumeradores existem para este status:

- `rented`
- `returned`
- `recovered`
- `written_off`

### Dinâmica dos Status - **fraud_status**

O status **fraud_status** indica o status da decisão do motor de fraude e possui uma máquina de estados bastante simples:

- `created`
- `automatically_approved`
- `automatically_reproved`
- `in_manual_analysis`
- `manually_approved`
- `manually_reproved`
- `manually_challenged`
- `pending`
- `not_analyzed`

Além disso, o upgrade_status também possui os mesmos enumeradores.

## Definição do Objeto

```json
{
  "id": "bca6268e-918a-4658-9161-a10b00a631ab",
  "rental_agreement_code" : "12345678",
  "rental_agreement_date": "2020-03-31T10:30:00-03:00",
  "car_rental_estimated_final_date":  "2020-04-01T10:28:00-03:00",
  "reservation": {
    "id": "0",
    "channel": "reservation_central",
    "reservation_date": "2020-03-31T08:15:00-03:00",
    "sales_channel" : "PARCERIA TELEFONICA"
  },
  "rental_store": "SAOP",
  "rental_store_group": "GSP",
  "rental_store_type": "LOJA DE RUA",
  "devolution_store": "SAOP",
  "risky_antecedence": true,
  "car": {
    "model_group": "AM",
    "upgrade_model_group": "SV",
    "rental_daily_price" : 48496,
    "risky_model_group": true,
    "risky_upgrade_model_group": true
  },
  "client": {
    "type": "natural_person",
    "segment": "ota",
    "document_number": "123.456.789-00",
    "name": "John Sample",
    "gender": "female",
    "birthdate": "2001-01-15",
    "mother_name": "Mary Sample",
    "email": "john.sample@sample.com.br",
    "allowed_information_on_email": true,
    "face_picture": "c77d1925-0e72-4634-8393-395dbbce498d",
    "additional_pictures": [
      "718b8caa-8ef5-446c-b101-2dbf6c7e401f",
      "9c67f365-1427-4889-b963-d3729d437ff3",
      "8006f82c-3a80-4371-914e-e88c91507711",
      "42c6909e-51aa-4b6d-972f-f4684a047993",
      "b7a88947-96bd-4557-81e9-a69a3c84f428"
    ],
    "total_rents": 6,
    "fidelity_points": 1200,
    "documents": {
      "rg": {
        "document_number": "00000000",
        "issuer": "SSP"
      },
      "cnh": {
        "document_number": "000000000",
        "security_code": "00000",
        "first_issuance": "2015-07-20",
        "expiration_date": "2030-07-26",
        "state": "SP"
      }
    },
    "residential_address": {
      "street": "Av Brigadeiro Faria Lima",
      "number": "2391",
      "neighborhood": "Jardins",
      "city": "SÃO PAULO",
      "uf": "SP",
      "complement": "",
      "postal_code": "00000-000"
    },
    "commercial_address": {
      "street": "Av Brigadeiro Faria Lima",
      "number": "2391",
      "neighborhood": "Jardins",
      "city": "SÃO PAULO",
      "uf": "SP",
      "complement": "",
      "postal_code": "00000-000"
    },
    "phones": [
      {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "00000-0000",
        "type": "mobile"
      },
      {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "00000-0000",
        "type": "residential"
      }
    ]
  },
  "coverages": [
    {
      "description": "S/ PROTEÇÃO AMERICAN PLATINUM",
      "price": 0
    },
    {
      "description": "PROTEÇÃO OCUPANTES E TERCEIROS",
      "price": 1668
    }
  ],
  "billing": {
    "name": "Agência AAA",
    "document_number": "00.000.000/0001-00",
    "voucher_type": "ABCD75",
    "voucher_description": "Pagamento pela agência"
  },
  "fare_name": "Mensal",
  "rental_price": 43300,
  "extra_hours": 0,
  "extra_hours_price": 0,
  "discount": 0,
  "prepayment_discount": 100,
  "extra_kms": 0,
  "extra_kms_price": 0,
  "third_party_coverage_price": 1490,
  "coverage_price": 0,
  "additional_driver_price": 1000,
  "driver_service_price": 1000,
  "additional_expenses": 1000,
  "devolution_fee": 0,
  "administration_fee": 5374,
  "discount_partial_coverage": 50,
  "free_day_discount": 20000,
  "final_price": 50165,
  "pre_authorization_amount": 0,
  "coverage_deductible_amount": 0,
  "upgrade_reason": "granted"
}
```

Todas as trocas de informação de um RentalAgreement utilizam a seguinte definição para este objeto. Em alguns casos, para facilitar a implementação e diminuir o fluxo de dados entre as partes, algumas informações poderão ser omitidas.

| nome | tipo | descrição |
| :----: | :----: | --------- |
| **id** | string | Identificador da requisição de análise no sistema do cliente. **É essencial que este número seja único para cada aluguel.** *(obrigatório)* |
| **rental_agreement_code** | string | Identificador do RentalAgreement no sistema do cliente. *(obrigatório)* |
| **rental_agreement_date** | DateTime | Data e Hora com fuso-horário da retirada do veículo do aluguel que está ocorrendo. *(obrigatório)* |
| **car_rental_estimated_final_date** | DateTime | Data e Hora com fuso-horário de quando o carro deve ser resolvido. *(obrigatório)* |
| **reservation** | *reservation* | Objeto que carrega as propriedades da reserva que deu origem a esse aluguel. *(obrigatório)* |
| **rental_store** | *store* | Loja onde o carro está sendo retirado. *(obrigatório)* |
| rental_store_group | *store* | Filial da loja onde o carro está sendo retirado |
| rental_store_type | *store* | Tipo da loja onde o carro será retirado |
| **devolution_store** | *store* | Loja onde o carro será devolvido, pode ou não ser a mesma loja de retirada. *(obrigatório)* |
| **car** | *car* | Carro que está sendo retirado - é importante que este valor seja, de fato, o carro sendo retirado. *(obrigatório)* |
| **client** | *client* | Objeto que carrega as informações do cliente que está retirando o veículo. *(obrigatório)* |
| **coverages** | List of *coverage* | Lista de objetos coverage que descrevem as coberturas de seguro contratadas pelo cliente. *(obrigatório)* |
| **billing** | *billing* | Objeto que descreve os detalhes da pessoa ou empresa responsável pelo pagamento do aluguel. *(obrigatório)* |
| **rental_price** | integer | Preço do aluguel, em centavos. *(obrigatório)* |
| **extra_hours** | integer | Quantidade de horas extras contratadas. *(obrigatório)* |
| **extra_hours_price** | integer | Preço das horas extras contratadas, em centavos. *(obrigatório)* |
| **discount** | inteiro | Desconto concedido por quaisquer motivos, em centavos. *(obrigatório)* |
| **prepayment_discount** | inteiro | Desconto por pagamento antecipado. |
| **extra_kms** | integer | Quantidade de kilômetros extras contratados. *(obrigatório)* |
| **extra_kms_price** | integer | Preço de kilômetros extras contratados, em centavos. *(obrigatório)* |
| **third_party_coverage_price** | integer | Preço do seguro de terceiros, em centavos. *(obrigatório)* |
| **coverage_price** | integer | Preço do seguro contratado, em centavos. *(obrigatório)* |
| additional_driver_price | integer | Preço total do(s) motoristas adicionais contratados, em centavos. |
| driver_service_price | integer | Preço total do serviço de motorista contratado, em centavos. |
| additional_expenses | integer | Despesas adicionais, em centavos |
| **devolution_fee** | integer | Preço da taxa de devolução, em centavos. *(obrigatório)* |
| **administration_fee** | integer | Preço da taxa de administração, em centavos. *(obrigatório)* |
| **discount_partial_coverage** | integer | Desconto de proteção parcial, em centavos. |
| **free_day_discount** | integer | Desconto de Free Day, em centavos. |
| **final_price** | integer | Preço final do aluguel, em centavos. *(obrigatório)* |
| pre_authorization_amount | integer | Valor da pré-autorização, em centavos. |
| **coverage_deductible_amount** | integer | Valor dedutível da cobertura, em centavos. *(obrigatório)* |
| upgrade_reason | enum | Tipo de upgrade (Concedido ou Comprado) - Aceita os valores `granted` e `bought` respectivamente |

## Enviar um RentalAgreement

Exemplo de Request:

```json
{
  "id": "bca6268e-918a-4658-9161-a10b00a631ab",
  ...
}
```

Exemplo de Retorno:

```json
{
  "id": "bca6268e-918a-4658-9161-a10b00a631ab",
  "fraud_status": "automatically_approved",
  "pre_authorization_amount": 100000,
  "block_document_number": true,
  "upgrade_status": "automatically_approved",
  "highest_allowed_car_group": "SV",
  "score": 870
}
```

Para realizar a avaliação de um aluguel, basta enviar um objeto do tipo RentalAgreement ao seguinte endpoint com a flag setada adequadamente:

`POST https://api.caas.qitech.app/car_rental/rental_agreement?analyze=true`

Além do status do retorno, também é retornado, caso haja, o valor da pré autorização desejada. Caso nenhuma majoração de pré autorização seja identificada, o valor retornado é nulo e não deve ser utilizado.

O grupo máximo que pode ser fornecido naquele RA é disponibilizado na variável `highest_allowed_car_group`. Este valor é configurado na regra de avaliação do RA.

O parâmetro *analyze* existe para evitar que transações que não precisam ser analisadas passem pelos motores de fraude, sujando a base de dados. O valor padrão deste parâmetro é **true**, de maneira que somente alugueis que forem explícitamente retirados da análise não serão analisados.

## Atualizar o status de um RentalAgreement

Corpo da requisição - Na efetivação de um aluguel de um carro:

```json
{
  "car_status": "rented",
  "event_date": "2019-11-05T13:34:12-03:00"
}
```

Corpo da requisição - Na devolução sem incidentes de um carro:

```json
{
  "car_status": "returned",
  "event_date": "2019-11-05T13:34:12-03:00"
}
```

Corpo da requisição - Na devolução mediante recuperação por roubo:

```json
{
  "car_status": "recovered",
  "incident": "theft",
  "event_date": "2019-11-05T13:34:12-03:00"
}
```

Corpo da requisição - Write-off com fraude confirmada:

```json
{
  "car_status": "written_off",
  "incident": "misappropriation",
  "event_date": "2019-11-05T13:34:12-03:00"
}
```

Para garantir a retroalimentação das regras e do modelo de inteligência artificial implementado, é necessário informar ao sistema quando os carros são alugados, devolvidos, ou quando são jogados a perda por fraude. Para isso, requisições com o método PUT devem ser utilizadas, passando-se como referência o id enviado na criação do *rental_agreement*, autenticadas normalmente:

`PUT https://api.caas.qitech.app/car_rental/rental_agreement/{rental_agreement_id}`

Caso o novo status seja *written_off*, os seguintes valores podem ser utilizados no campo **incident**, enviado no body da requisição, que indica o tipo de incidente do aluguel:

| Enumerador | Descrição |
| --------- | ----------- |
| theft | RAs que sofreram um roubo |
| misappropriation | RAs que foram classificados como apropriação indébita |

## Atualizar o veículo de um RentalAgreement

Corpo da requisição - Atualização de um veículo no aluguel:

```json
{
  "car_plate": "ABC1B34",
  "car_model": "Chevrolet Onix",
  "model_group": "B",
  "event_date": "2020-10-15T13:34:12-03:00"
}
```

Para garantir a consistência entre as ocorrências de fraude e os aluguéis e garantir o retreinamento do modelo de score, é necessário informar ao sistema os dados de cada carro quando ele é atrelado ao aluguel. Para isso, requisições com o método POST devem ser utilizadas, passando-se como referência o id enviado na criação do *rental_agreement*, autenticadas normalmente:

`POST https://api.caas.qitech.app/car_rental/rental_agreement/{rental_agreement_id}/car`

No body da requisição devem ser enviados os dados do veículo que está sendo atrelado àquele aluguel:

| nome | tipo | descrição |
| ---- | :----: | --------- |
| car_plate | string | Placa do veículo. |
| car_model | string | Modelo do veículo, incluindo sua marca e modelo (ex.: Jeep Renegade). |
| model_group | string | O grupo do veículo, em letras maiúsculas. |
| event_date | DateTime | Data e Hora com fuso-horário do momento em que ocorreu a associação do carro ao aluguel. |

## Recuperar um RentalAgreement

A fim de recuperar um RentalAgreement específico, basta realizar uma requisição GET. O resultado retornado é o json mais atualizado do RentalAgreement em questão. Caso este identificador não esteja relacionado a nenhum objeto, o HTTP Status 404 é retornado.

`GET https://api.caas.qitech.app/car_rental/rental_agreements/{rental_agreement_id}`

```shell
curl "https://api.caas.qitech.app/car_rental/rental_agreements/{rental_agreement_id}"
  -H "Authorization: TESTETESTETESTE"
```

## Buscar RentalAgreements

Retorno - uma lista de objetos RentalAgreement:

```json
[
  {
    "id": "bca6268e-918a-4658-9161-a10b00a631ab",
    ...
  },
  {
    "id": "13a91409-9793-49b6-8583-9ba575075831",
    ...
  }
]
```

Caso seja necessário buscar um RentalAgreement, um GET com parâmetros de query poderá ser utilizado. O resultado retornado é um JSON que representa uma lista de RentalAgreements. Caso nenhum objeto seja encontrado com os parâmetros enviados, o HTTP Status 200 é retornado com uma lista vazia no corpo da resposta.

`GET https://api.caas.qitech.app/car_rental/rental_agreements?initial_date=2019-10-01&final_date=2019-10-05&page_number=2&page_rows=20`

Os seguintes parâmetros podem ser utilizados para buscar objetos de RentalAgreement:

| Parâmetro | Padrão | Descrição |
| --------- | ----------- | -------------- |
| initial_date | null | Primeira data que deve ser retornada a partir do campo rental_agreement_date |
| final_date | null | Última data que deve ser retornada a partir do campo rental_agreement_date |
| store_code | null | Código da loja de onde os resultados devem ser retornados |
| page_number | 1 | Número da página de resultados desejada |
| page_rows | 50 | Número de objetos máximo a ser retornados em uma consulta |

---

# Reservation-v1

URL: /en/documentation/caas/car_rental/reservation

Ao realizar a reserva de um veículo, o locatário dá início ao seu processo de anti-fraude. Os dados enviados deverão ser os dados finais da reserva, que não serão alterados. Isto é importante para garantir dois pontos:

- Consistência dos dados na base de dados do Antifraude
- Avaliação realista do risco

O processo de análise consiste em enviar uma Reservation no endpoint adequado e esperar a resposta. Existem oito resultados possíveis, devolvido na flag **fraud_status**:

| Resultado | Descrição |
| :---------: | --------- |
| Aprovado Automaticamente | Recomenda-se que este aluguel seja aprovado |
| Negado Automaticamente | Recomenda-se que este aluguel seja reprovado |
| Derivado para análise manual | Nossas regras ou modelos não estão confiantes da decisão e decidiram enviar este aluguel para a análise manual. |
| Aprovado Manualmente | Após análise manual, o analista escolheu aprovar o aluguel |
| Reprovado Manualmente | Após análise manual, o analista escolheu reprovar o aluguel |
| Desafiado Manualmente | Após análise manual, o analista retorna para a loja que a CNH e/ou Selfie estão incorretas e/ou com baixa qualidade |
| Pendente | As consultas estão demorando mais do que o esperado, este aluguel entrou em uma fila de análise automática e será respondido por meio de Webhook |
| Não analisado | A consulta foi enviada com a flag de análise falsa, o que significa que nossos sistemas não deverão retornar parecer |

### Dinâmica dos Status

Ao recuperar um objeto do tipo Reservation os status estão disponíveis. Além dos status, um histórico de modificações também são retornados para que possa ser consultado no futuro. Estas modificações são entituladas events e possuem, além do novo status, as datas de modificação.

### Dinâmica dos Status - **fraud_status**

O status **fraud_status** indica o status da decisão do motor de fraude e possui uma máquina de estados bastante simples:

- `created`
- `automatically_approved`
- `automatically_reproved`
- `in_manual_analysis`
- `manually_approved`
- `manually_reproved`
- `pending`
- `not_analyzed`

## Definição do Objeto

```json
{
  "id": "bca6268e-918a-4658-9161-a10b00a631ab",
  "reservation_code": "211034324",
  "reservation_date": "2020-03-31T08:15:00-03:00",
  "rental_agreement_date": "2020-03-31T10:30:00-03:00",
  "car_rental_estimated_final_date":  "2020-04-01T10:28:00-03:00",
  "channel": "reservation_central",
  "sales_channel" : "PARCERIA TELEFONICA",
  "rental_store": "SAOP",
  "rental_store_group": "GSP",
  "rental_store_type": "LOJA DE RUA",
  "devolution_store": "SAOP",
  "car": {
    "model_group": "SV",
    "rental_daily_price" : 48496
  },
  "client": {
    "type": "natural_person",
    "segment": "ota",
    "document_number": "123.456.789-00",
    "name": "John Sample",
    "gender": "female",
    "birthdate": "2001-01-15",
    "mother_name": "Mary Sample",
    "email": "john.sample@sample.com.br",
    "allowed_information_on_email": true,
    "face_picture": "c77d1925-0e72-4634-8393-395dbbce498d",
    "additional_pictures": [
      "718b8caa-8ef5-446c-b101-2dbf6c7e401f",
      "9c67f365-1427-4889-b963-d3729d437ff3",
      "8006f82c-3a80-4371-914e-e88c91507711",
      "42c6909e-51aa-4b6d-972f-f4684a047993",
      "b7a88947-96bd-4557-81e9-a69a3c84f428"
    ],
    "documents": {
      "rg": {
        "document_number": "00000000",
        "issuer": "SSP"
      },
      "cnh": {
        "document_number": "000000000",
        "security_code": "00000",
        "first_issuance": "2015-07-20",
        "expiration_date": "2030-07-26",
        "state": "SP"
      }
    },
    "residential_address": {
      "street": "Av Brigadeiro Faria Lima",
      "number": "2391",
      "neighborhood": "Jardins",
      "city": "SÃO PAULO",
      "uf": "SP",
      "complement": "",
      "postal_code": "00000-000"
    },
    "commercial_address": {
      "street": "Av Brigadeiro Faria Lima",
      "number": "2391",
      "neighborhood": "Jardins",
      "city": "SÃO PAULO",
      "uf": "SP",
      "complement": "",
      "postal_code": "00000-000"
    },
    "phones": [
      {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "00000-0000",
        "type": "mobile"
      },
      {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "00000-0000",
        "type": "residential"
      }
    ]
  },
  "coverages": [
    {
      "description": "S/ PROTEÇÃO AMERICAN PLATINUM",
      "price": 0
    },
    {
      "description": "PROTEÇÃO OCUPANTES E TERCEIROS",
      "price": 1668
    }
  ],
  "billing": {
    "name": "Agência AAA",
    "document_number": "00.000.000/0001-00",
    "voucher_type": "ABCD75",
    "voucher_description": "Pagamento pela agência"
  },
  "rental_price": 43300,
  "extra_hours": 0,
  "extra_hours_price": 0,
  "discount": 0,
  "prepayment_discount": 100,
  "extra_kms": 0,
  "extra_kms_price": 0,
  "third_party_coverage_price": 1490,
  "coverage_price": 0,
  "additional_driver_price": 1000,
  "driver_service_price": 1000,
  "additional_expenses": 1000,
  "devolution_fee": 0,
  "administration_fee": 5374,
  "discount_partial_coverage": 50,
  "final_price": 50165,
  "pre_authorization_amount": 0,
  "coverage_deductible_amount": 0
}
```

Todas as trocas de informação de uma Reservation utilizam a seguinte definição para este objeto. Em alguns casos, para facilitar a implementação e diminuir o fluxo de dados entre as partes, algumas informações poderão ser omitidas.

| nome | tipo | descrição |
| :----: | :----: | --------- |
| **id** | string | Identificador da requisição de análise no sistema do cliente. **É essencial que este número seja único para cada análise.** *(obrigatório)* |
| reservation_code | string | Identificador da Reserva no sistema do cliente. - Este campo é opcional e pode ser definido utilizando o método PUT |
| **reservation_date** | DateTime | Data e Hora com fuso-horário do momento em que ocorreu a reserva para este aluguel. *(obrigatório)* |
| **rental_agreement_date** | DateTime | Data e Hora com fuso-horário da retirada do veículo do aluguel. *(obrigatório)* |
| **car_rental_estimated_final_date** | DateTime | Data e Hora com fuso-horário de quando o carro deve ser resolvido. *(obrigatório)* |
| **rental_store** | *store* | Loja onde o carro será retirado. *(obrigatório)* |
| rental_store_group | *store* | Filial da loja onde o carro será retirado |
| rental_store_type | *store* | Tipo da loja onde o carro será retirado |
| **devolution_store** | *store* | Loja onde o carro será devolvido, pode ou não ser a mesma loja de retirada. *(obrigatório)* |
| reservation_channel | string | Canal pelo qual foi feito a reserva para este aluguel. |
| **sales_channel** | string | Canal de vendas pelo qual a reserva foi realizada (ex.: PARCERIA MASTERCARD). *(obrigatório)* |
| **car** | *car* | Carro que será retirado. *(obrigatório)* |
| **client** | *client* | Objeto que carrega as informações do cliente que fará a retirada do veículo. *(obrigatório)* |
| **coverages** | List of *coverage* | Lista de objetos coverage que descrevem as coberturas de seguro contratadas pelo cliente. *(obrigatório)* |
| billing | *billing* | Objeto que descreve os detalhes da pessoa ou empresa responsável pelo pagamento do aluguel. |
| **rental_price** | integer | Preço do aluguel, em centavos. *(obrigatório)* |
| **extra_hours** | integer | Quantidade de horas extras contratadas. *(obrigatório)* |
| **extra_hours_price** | integer | Preço das horas extras contratadas, em centavos. *(obrigatório)* |
| **discount** | inteiro | Desconto concedido por quaisquer motivos, em centavos. *(obrigatório)* |
| **prepayment_discount** | inteiro | Desconto por pagamento antecipado. *(obrigatório)* |
| **extra_kms** | integer | Quantidade de kilômetros extras contratados. *(obrigatório)* |
| **extra_kms_price** | integer | Preço de kilômetros extras contratados, em centavos. *(obrigatório)* |
| **third_party_coverage_price** | integer | Preço do seguro de terceiros, em centavos. *(obrigatório)* |
| coverage_price | integer | Preço do seguro contratado, em centavos. |
| **additional_driver_price** | integer | Preço total do(s) motoristas adicionais contratados, em centavos. *(obrigatório)* |
| **driver_service_price** | integer | Preço total do serviço de motorista contratado, em centavos. *(obrigatório)* |
| **additional_expenses** | integer | Despesas adicionais, em centavos. *(obrigatório)* |
| **devolution_fee** | integer | Preço da taxa de devolução, em centavos. *(obrigatório)* |
| **administration_fee** | integer | Preço da taxa de administração, em centavos. *(obrigatório)* |
| **discount_partial_coverage** | integer | Desconto de proteção parcial, em centavos. *(obrigatório)* |
| **final_price** | integer | Preço final do aluguel, em centavos. *(obrigatório)* |
| **pre_authorization_amount** | integer | Valor da pré-autorização, em centavos. *(obrigatório)* |
| **coverage_deductible_amount** | integer | Valor dedutível da cobertura, em centavos. *(obrigatório)* |

## Enviar uma Reserva

Exemplo de Request:

```json
{
  "id": "bca6268e-918a-4658-9161-a10b00a631ab",
  ...
}
```

Exemplo de Retorno:

```json
{
  "reservation_key": "bca6268e-918a-4658-9161-a10b00a631ab",
  "fraud_status": "automatically_approved",
  "pre_authorization_amount": 10000
}
```

Para realizar a avaliação de uma reserva, basta enviar um objeto do tipo Reservation ao seguinte endpoint:

`POST https://api.caas.qitech.app/car_rental/reservation`

Além do status do retorno, também é retornado, caso haja, o valor da pré autorização desejada. Caso nenhuma majoração de pré autorização seja identificada, o valor retornado é nulo e não deve ser utilizado.

## Definir o código de uma Reserva

A QI Tech possibilita a definição do código da reserva após a análise inicial. Isto é útil em alguns fluxos operacionais. Nestes casos, basta realizar um PUT no endpoint a seguir, com o código da reserva definido no corpo:

`PUT https://api.caas.qitech.app/car_rental/reservation/{reservation_id}`

:::note
Caso o código da reserva tenha sido definido anteriormente, na requisição de POST ou utilizando um PUT, não é possível redefinir o código da reserva. Neste caso, a API retornará 409 - Conflito.
:::

```json
{
  "reservation_code": "123456789"
}
```

## Recuperar uma Reserva

A fim de recuperar uma Reserva específica, basta realizar uma requisição GET. O resultado retornado é o json mais atualizado da Reserva em questão. Caso este identificador não esteja relacionado a nenhum objeto, o HTTP Status 404 é retornado.

`GET https://api.caas.qitech.app/car_rental/reservation/{reservation_id}`

```shell
curl "https://api.caas.qitech.app/car_rental/reservation/{reservation_id}"
  -H "Authorization: TESTETESTETESTE"
```

---

# Reservation-v2

URL: /en/documentation/caas/car_rental/reservation_v2

Esta seção diz respeito às informações necessárias para o fluxo de análise de fraude primariamente na reserva.

Ao realizar a reserva de um veículo, o locatário dá início ao seu processo de anti-fraude. Os dados enviados deverão ser os dados finais da reserva, que não serão alterados. Isto é importante para garantir dois pontos:

- Consistência dos dados na base de dados do Antifraude
- Avaliação realista do risco

O processo de análise consiste em enviar uma Reservation no endpoint adequado e esperar a resposta. Existem oito resultados possíveis, devolvido na flag **fraud_status**:

| Resultado | Descrição |
| :---------: | --------- |
| Aprovado Automaticamente | Recomenda-se que este aluguel seja aprovado |
| Negado Automaticamente | Recomenda-se que este aluguel seja reprovado |
| Derivado para análise manual | Nossas regras ou modelos não estão confiantes da decisão e decidiram enviar este aluguel para a análise manual. |
| Aprovado Manualmente | Após análise manual, o analista escolheu aprovar o aluguel |
| Reprovado Manualmente | Após análise manual, o analista escolheu reprovar o aluguel |
| Desafiado Manualmente | Após análise manual, o analista retorna para a loja que a CNH e/ou Selfie estão incorretas e/ou com baixa qualidade |
| Pendente | As consultas estão demorando mais do que o esperado, este aluguel entrou em uma fila de análise automática e será respondido por meio de Webhook |
| Não analisado | A consulta foi enviada com a flag de análise falsa, o que significa que nossos sistemas não deverão retornar parecer |

### Dinâmica dos Status

Ao recuperar um objeto do tipo Reservation os status estão disponíveis. Além dos status, um histórico de modificações também são retornados para que possa ser consultado no futuro. Estas modificações são entituladas events e possuem, além do novo status, as datas de modificação.

### Dinâmica dos Status - **fraud_status**

O status **fraud_status** indica o status da decisão do motor de fraude e possui uma máquina de estados bastante simples:

- `created`
- `automatically_approved`
- `automatically_reproved`
- `in_manual_analysis`
- `manually_approved`
- `manually_reproved`
- `pending`
- `not_analyzed`

## Definição do Objeto

```json
{
  "id": "bca6268e-918a-4658-9161-a10b00a631ab",
  "reservation_code": "211034324",
  "reservation_date": "2024-03-19T10:30:00-03:00",
  "rental_agreement_date": "2024-03-25T10:30:00-03:00",
  "car_rental_estimated_final_date":  "2024-03-30T10:28:00-03:00",
  "channel": "reservation_central",
  "sales_channel" : "PARCERIA TELEFONICA",
  "rental_store": "SAOP",
  "rental_store_group": "GSP",
  "rental_store_type": "LOJA DE RUA",
  "devolution_store": "SAOP",
  "risky_antecedence": true,
  "car": {
    "model_group": "SV",
    "rental_daily_price" : 48496
  },
  "client": {
    "type": "natural_person",
    "segment": "ota",
    "document_number": "123.456.789-00",
    "name": "John Sample",
    "gender": "female",
    "birthdate": "2001-01-15",
    "mother_name": "Mary Sample",
    "email": "john.sample@sample.com.br",
    "allowed_information_on_email": true,
    "face_picture": "c77d1925-0e72-4634-8393-395dbbce498d",
    "additional_pictures": [
      "718b8caa-8ef5-446c-b101-2dbf6c7e401f",
      "9c67f365-1427-4889-b963-d3729d437ff3",
      "8006f82c-3a80-4371-914e-e88c91507711",
      "42c6909e-51aa-4b6d-972f-f4684a047993",
      "b7a88947-96bd-4557-81e9-a69a3c84f428"
    ],
    "total_rents": 6,
    "fidelity_points": 1200,
    "documents": {
      "rg": {
        "document_number": "00000000",
        "issuer": "SSP"
      },
      "cnh": {
        "document_number": "000000000",
        "security_code": "00000",
        "first_issuance": "2015-07-20",
        "expiration_date": "2030-07-26",
        "state": "SP"
      }
    },
    "residential_address": {
      "street": "Av Brigadeiro Faria Lima",
      "number": "2391",
      "neighborhood": "Jardins",
      "city": "SÃO PAULO",
      "uf": "SP",
      "complement": "",
      "postal_code": "00000-000"
    },
    "commercial_address": {
      "street": "Av Brigadeiro Faria Lima",
      "number": "2391",
      "neighborhood": "Jardins",
      "city": "SÃO PAULO",
      "uf": "SP",
      "complement": "",
      "postal_code": "00000-000"
    },
    "phones": [
      {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "00000-0000",
        "type": "mobile"
      },
      {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "00000-0000",
        "type": "residential"
      }
    ]
  },
  "coverages": [
    {
      "description": "S/ PROTEÇÃO AMERICAN PLATINUM",
      "price": 0
    },
    {
      "description": "PROTEÇÃO OCUPANTES E TERCEIROS",
      "price": 1668
    }
  ],
  "billing": {
    "name": "Agência AAA",
    "document_number": "00.000.000/0001-00",
    "voucher_type": "ABCD75",
    "voucher_description": "Pagamento pela agência"
  },
  "fare_name": "MENSAL - 2000KM - PRÓ-RATA",
  "rental_price": 43300,
  "extra_hours": 0,
  "extra_hours_price": 0,
  "discount": 0,
  "prepayment_discount": 100,
  "extra_kms": 0,
  "extra_kms_price": 0,
  "third_party_coverage_price": 1490,
  "coverage_price": 0,
  "additional_driver_price": 1000,
  "driver_service_price": 1000,
  "additional_expenses": 1000,
  "devolution_fee": 0,
  "administration_fee": 5374,
  "discount_partial_coverage": 50,
  "final_price": 50165,
  "pre_authorization_amount": 0,
  "coverage_deductible_amount": 0
}
```

Todas as trocas de informação de uma Reservation utilizam a seguinte definição para este objeto. Em alguns casos, para facilitar a implementação e diminuir o fluxo de dados entre as partes, algumas informações poderão ser omitidas.

| nome | tipo | descrição |
| :----: | :----: | --------- |
| **id** | string | Identificador da requisição de análise no sistema do cliente. **É essencial que este número seja único para cada análise.** *(obrigatório)* |
| reservation_code | string | Identificador da Reserva no sistema do cliente. - Este campo é opcional e pode ser definido utilizando o método PUT. |
| **reservation_date** | DateTime | Data e Hora com fuso-horário do momento em que ocorreu a reserva para este aluguel. *(obrigatório)* |
| **car_rental_estimated_final_date** | DateTime | Data e Hora com fuso-horário de quando o carro deve ser resolvido. *(obrigatório)* |
| **rental_store** | *store* | Loja onde o carro será retirado. *(obrigatório)* |
| rental_store_group | *store* | Filial da loja onde o carro será retirado |
| rental_store_type | *store* | Tipo da loja onde o carro será retirado |
| **devolution_store** | *store* | Loja onde o carro será devolvido, pode ou não ser a mesma loja de retirada. *(obrigatório)* |
| reservation_channel | string | Canal pelo qual foi feito a reserva para este aluguel. |
| **sales_channel** | string | Canal de vendas pelo qual a reserva foi realizada (ex.: PARCERIA MASTERCARD). *(obrigatório)* |
| **car** | *car* | Objeto que carrega as informações do veículo sendo reservado. *(obrigatório)* |
| **client** | *client* | Objeto que carrega as informações do cliente que fará a retirada do veículo. *(obrigatório)* |
| **coverages** | List of *coverage* | Lista de objetos coverage que descrevem as coberturas de seguro contratadas pelo cliente. *(obrigatório)* |
| **billing** | *billing* | Objeto que descreve os detalhes da pessoa ou empresa responsável pelo pagamento do aluguel. *(obrigatório)* |
| **rental_price** | integer | Preço do aluguel, em centavos. *(obrigatório)* |
| **extra_hours** | integer | Quantidade de horas extras contratadas. *(obrigatório)* |
| **extra_hours_price** | integer | Preço das horas extras contratadas, em centavos. *(obrigatório)* |
| **discount** | inteiro | Desconto concedido por quaisquer motivos, em centavos. *(obrigatório)* |
| **prepayment_discount** | inteiro | Desconto por pagamento antecipado. *(obrigatório)* |
| **extra_kms** | integer | Quantidade de kilômetros extras contratados. *(obrigatório)* |
| **extra_kms_price** | integer | Preço de kilômetros extras contratados, em centavos. *(obrigatório)* |
| **third_party_coverage_price** | integer | Preço do seguro de terceiros, em centavos. *(obrigatório)* |
| coverage_price | integer | Preço do seguro contratado, em centavos. |
| **additional_driver_price** | integer | Preço total do(s) motoristas adicionais contratados, em centavos. *(obrigatório)* |
| **driver_service_price** | integer | Preço total do serviço de motorista contratado, em centavos. *(obrigatório)* |
| **additional_expenses** | integer | Despesas adicionais, em centavos. *(obrigatório)* |
| **devolution_fee** | integer | Preço da taxa de devolução, em centavos. *(obrigatório)* |
| **administration_fee** | integer | Preço da taxa de administração, em centavos. *(obrigatório)* |
| **discount_partial_coverage** | integer | Desconto de proteção parcial, em centavos. *(obrigatório)* |
| **final_price** | integer | Preço final do aluguel, em centavos. *(obrigatório)* |
| **pre_authorization_amount** | integer | Valor da pré-autorização, em centavos. *(obrigatório)* |
| **coverage_deductible_amount** | integer | Valor dedutível da cobertura, em centavos. *(obrigatório)* |

## Enviar uma Reserva

Exemplo de Request:

```json
{
  "id": "bca6268e-918a-4658-9161-a10b00a631ab",
  "reservation_code": "211034324",
  ...
}
```

Exemplo de Retorno:

```json
{
  "reservation_key": "bca6268e-918a-4658-9161-a10b00a631ab",
  "fraud_status": "automatically_approved",
  "pre_authorization_amount": 10000
}
```

Para realizar a avaliação de uma reserva, basta enviar um objeto do tipo Reservation ao seguinte endpoint:

`POST https://api.caas.qitech.app/car_rental/reservation`

Além do status do retorno, também é retornado, caso haja, o valor da pré autorização desejada. Caso nenhuma majoração de pré autorização seja identificada, o valor retornado é nulo e não deve ser utilizado.

## Definir o código de uma Reserva

A QI Tech possibilita a definição do código da reserva após a análise inicial. Isto é útil em alguns fluxos operacionais. Nestes casos, basta realizar um PUT no endpoint a seguir, com o código da reserva definido no corpo:

`PUT https://api.caas.qitech.app/car_rental/reservation/{reservation_id}`

:::note
Caso o código da reserva tenha sido definido anteriormente, na requisição de POST ou utilizando um PUT, não é possível redefinir o código da reserva. Neste caso, a API retornará 409 - Conflito.
:::

```json
{
  "reservation_code": "123456789"
}
```

## Recuperar uma Reserva

A fim de recuperar uma Reserva específica, basta realizar uma requisição GET. O resultado retornado é o json mais atualizado da Reserva em questão. Caso este identificador não esteja relacionado a nenhum objeto, o HTTP Status 404 é retornado.

`GET https://api.caas.qitech.app/car_rental/reservation/{reservation_id}`

```shell
curl "https://api.caas.qitech.app/car_rental/reservation/{reservation_id}"
  -H "Authorization: TESTETESTETESTE"
```

---

# Padrões

URL: /en/documentation/caas/car_rental/standards

Para facilitar a integração e garantir a integridade da informação, foram definidos alguns padrões que são seguidos em toda a API.

## Valores Monetários

Exemplos:

```
10000
12345
98741
1223
1
0
```

As APIs assumem que todos os valores monetários enviados são em Reais Brasileiros. Os valores devem ser enviados como inteiro em centavos.

## Data e Hora com Fuso Horário

Alguns exemplos:

```
2019-10-15T22:35:12-03:00
2018-05-01T13:32:11+00:00
2019-05-01T00:00:00+00:00
```

É representada conforme a ISO 8601. Neste caso, o fuso-horário é colocado logo após o horário e deve representar o fuso do local onde aquele dado será válido. Por exemplo, se um aluguel estiver marcado para começar às 09:30 no aeroporto de Brasília, o horário enviado deverá ser representado por 09:30-03:00, se o aluguel estiver marcado para começar às 09:30 em Manaus, deverá ser representado por 09:30-04:00.

A máscara utilizada para validação é a seguinte:

`YYYY-MM-ddThh:mm:ss±hh:mm`

## Data e Hora sem Fuso Horário

Alguns exemplos:

```
2019-10-15T22:35:12Z
2018-05-01T13:32:11Z
2019-05-01T00:00:00Z
```

É representada conforme a ISO 8601. Dados que independem de fuso-horário deverão ser enviados sem ele, sempre em UTC, com a letra Z indicando que este dado está em UTC. O seguinte formato, portanto, será validado:

`YYYY-MM-ddThh:mm:ssZ`

## Data

Alguns exemplos:

```
2019-10-15
2019-01-01
2017-03-20
```

No caso de campos que recebem somente data, uma data de nascimento, por exemplo, somente a data, sem nenhum horário deve ser enviada com o seguinte formato:

`YYYY-MM-dd`

## Documentos

Uma vez que os números de documento são bastante variados e muitos deles possuem caracteres que não se enquadram como numéricos, definem-se todos os números de documento como string. Outro bom motivo para defini-los como string é evitar que os zeros à esquerda desapareçam. Documentos previstos nesta página possuem uma máscara bem definida e estarão sujeitos a validação. O restante dos documentos, como RG, dada sua falta de padronização, não serão validados.

## CPF

Exemplos de CPFs válidos contra a máscara definida:

```
123.456.789-12
321.987.543-23
111.283.333-00
```

Exemplos de CPFs inválidos contra a máscara definida:

```
8.577.477-8
08.104.627/0001-23
123.456.789-1
23.456.789-01
```

O CPF é sempre definido como uma string e será validado contra a máscara:

`###.###.###-##`

## CNPJ

Exemplos de CNPJs válidos contra a máscara definida:

```
08.104.627/0001-02
01.079.210/0114-67
32.402.502/0001-35
```

Exemplos de CNPJs inválidos contra a máscara definida:

```
8.577.477-8
123.456.789-12
321.987.543-23
32.402.502/0001-3
032.402.502/0001-3
```

O CNPJ é sempre definido como uma string e será validado contra a máscara:

`##.###.###/####-##`

---

# Webhook

URL: /en/documentation/caas/car_rental/webhook

Atualizações no status de fraude (Para RentalAgreements que sejam derivados para análise manual ou que sejam respondidos como Pendente), são notificados por meio de Webhook. Para tanto, é necessário, por meio da equipe do [suporte](mailto:suporte.caas@qitech.com.br), configurar um endereço do endpoint por onde vamos notificar as atualizações e também um *secret_token* que será utilizado para assinar a requisição.

O cliente pode, apesar de não recomendável, também utilizar a técnica de [polling](https://en.wikipedia.org/wiki/Polling_(computer_science)). Neste caso, basta não configurar o endpoint de webhook e utilizar os endpoints de recuperação de RentalAgreement para proceder com o polling.

## Assinatura

Exemplo de cálculo de assinatura em Python:

```python
hmac_obj = hmac.new(
    signature_key.encode('utf-8'),
    (endpoint + method + payload).encode('utf-8'),
    hashlib.sha1
)
return hmac_obj.hexdigest()
```

Para garantir que a requisição recebida no endpoint do webhook parte dos nossos servidores, uma assinatura HMAC é enviada no Header Signature, semelhante ao processo de autenticação.

Após realizar o cálculo do valor esperado da assinatura do lado do servidor, é necessário comparar a assinatura calculada com a enviada. Caso as assinaturas sejam compatíveis, isso significa que a requisição partiu dos nossos servidores e que é confiável.

## Requisição

Exemplo de requisição:

```json
{
  "rental_agreement_id": "123456",
  "fraud_status": "automatically_approved",
  "upgrade_status": "automatically_approved",
  "event_date": "2019-10-01T10:37:25-03:00"
}
```

A requisição possui o formato acima e notifica a mudança no status de fraude.

## Retentativas

A notificação é considerada realizada quando recebe como resposta um HTTP Status 200. Caso as notificações falhem, serão feitas retentativas, com os seguintes intervalos, até que um 200 seja retornado ou as tentativas terminem:

- 10 segundos
- 30 segundos
- 60 segundos
- 120 segundos
- 120 segundos
- 3600 segundos
- 7200 segundos
- 36000 segundos

---

# Cardholder Alerts

URL: /en/documentation/caas/card_issuance/alerts

Alerts generated by the antifraud tool are notified via Webhook. To do so, it is necessary to configure an endpoint address through which we will send the notifications, as well as a *secret_token* that will be used to sign the request. This configuration must be done through our [support team](mailto:suporte.caas@qitech.com.br).

In this notification we will send information about the generated alerts, as well as which cardholder they refer to, so that the client can take action—for example, sending a *push notification* to the cardholder.

## Request

Request Body

```json
    {
        "alert_key": "123456",
        "cardholder_id": "ef47bc3f-61ac-4b85-ad67-0cfa3a422201",
        "company_name": "Cliente 1",
        "irregularity_type" : "fraud",
        "risk_level": "critical"
    }
```

The request has the format above and notifies the opening of a new alert for a Cardholder — identified by *cardholder_id*.

## Webhook Signature

> Example of signature calculation in Python

```python
    hmac_obj = hmac.new(signature_key.encode('utf-8'), (endpoint + method + payload).encode('utf-8'), hashlib.sha1)
    return hmac_obj.hexdigest()
```

To ensure that the request received at the webhook endpoint comes from our servers, an HMAC signature is sent in the Signature header, similar to the authentication process.

After calculating the expected signature value on the server side, you must compare the calculated signature with the one sent. If the signatures match, this means that the request came from our servers and is trustworthy.

## Retries

The notification is considered successful when it receives an HTTP Status 200 as response. If the notifications fail, 5 retries will be made with the following intervals until a 200 is returned or the attempts are exhausted:

* 30 seconds
* 60 seconds
* 120 seconds
* 240 seconds
* 360 seconds

---

# Authentication

URL: /en/documentation/caas/card_issuance/authentication

> To authenticate a request, use the following code:

```shell
# In the shell, you only need to add the appropriate header to each request
curl "api_endpoint_here"
  -H "Authorization: EXAMPLE-OF-API-KEY"
```

> Replace the API Key 'EXAMPLE-OF-API-KEY' with your own key, which should be obtained from our support team.

We use an API Key to grant access to our API. It was likely sent to you by email. If you haven't received your key yet, please send an email to suporte.caas@qitech.com.br .

Our API expects to receive the API Key in all requests to our server in a header like the one below:

`Authorization: EXAMPLE-OF-API-KEY`

:::info **Attention**

You must replace EXAMPLE-OF-API-KEY with your own key, which should be obtained from our support team.
:::

---

# HTTP Status Codes

URL: /en/documentation/caas/card_issuance/http_status

All QI Tech APIs follow the standard HTTP status codes as defined in the [RFC 7231](https://tools.ietf.org/html/rfc7231):

HTTP Status | Meaning | Description
----------- | ------- | ---------------------------------
400 | Bad Request | The request sent contains a formatting error. In most cases, we return a message body explaining where the error is.
401 | Unauthorized | There was a problem with authentication. Check if the API Key is correct and placed in the proper header, as explained in the [Authentication](https://docs.qitech.com.br/en/documentation/caas/card_issuance/authentication/index.html) section.
403 | Forbidden | The accessed endpoint is for internal use and not available for this API Key.
404 | Not Found | The requested data could not be found using the provided key. This status is also returned when an invalid endpoint is requested.
405 | Method Not Allowed | The HTTP method used is not supported by the requested endpoint.
406 | Not Acceptable | The data sent in the request body is invalid. Usually, this means the payload is not valid JSON.
409 | Conflict | The request ID corresponds to an ID that has already been processed. This status is returned in case of duplicate requests.
500 | Internal Server Error | We encountered an issue while processing the request. When this happens, our specialists are automatically notified and begin investigating immediately.
503 | Service Unavailable | You encountered an infrastructure outage, whether planned or unplanned, on our servers.

---

# Introduction

URL: /en/documentation/caas/card_issuance/introduction

Welcome to QI Tech's Card Issuance Fraud Prevention API! You can use our API to access the endpoints to receive the response of a transaction, as well as to update the status of a transaction.

:::info **Attention**

Please note that this API is intended for card issuers — that is, companies that issue the card to the cardholder so they can transact. Its purpose is to perform all security analysis on your client's transactions, preventing fraud and other types of incidents (such as transactions resulting from robberies).
:::

Below, you can see the API implementation using cURL. This gives you examples that you can adapt to the programming language of your choice.

## Issues?

We're not a company that hides behind an API! Reach out to our support team and we'll get back to you as soon as possible. Feel free to give us a call if you want a quicker answer!

### We love feedbacks

Even if you've already solved your issue or it is something simple (like a typo or a small organizational detail), feel free to send us an email. That way, we can keep improving our documentation and help the next person avoid the same difficulties you faced!

## Environments

We provide two environments for our clients. The base URLs for the APIs are:

* Production - `https://api.caas.qitech.app/card_issuance/`
* Sandbox - `https://api.sandbox.caas.qitech.app/card_issuance/`

:::danger Important Warning!
Real personal or company data must not be used in QI Tech's Sandbox environments.  
:::

In the Sandbox environment, submitted analyses are not charged and are responded to according to predefined rules.

For transaction analysis, the following rule is applied based on the transaction amount:

Minimum | Maximum | Decision
------ | ------ | -------
10000 | - | automatically_approved
0 | 9999 | automatically_declined

## Only HTTPS

For security reasons, all communication with QI Tech's APIs must be conducted over HTTPS. To ensure that no HTTP calls are made, whether by oversight or any other reason, this server only makes port 443 available with TLS 1.2 communication. Requests using other protocols will be automatically rejected.

## Authentication

> To authenticate a request, use the following code:

```shell
# In the shell, you only need to add the appropriate header to each request
curl "api_endpoint_here"
  -H "Authorization: EXAMPLE-OF-API-KEY"
```

> Replace the API Key 'EXAMPLE-OF-API-KEY' with your own key, which should be obtained from our support team.

We use an API Key to grant access to our API. It was likely sent to you by email. If you haven't received your key yet, please send an email to suporte.caas@qitech.com.br .

Our API expects to receive the API Key in all requests to our server in a header like the one below:

`Authorization: EXAMPLE-OF-API-KEY`

:::info **Attention**

You must replace EXAMPLE-OF-API-KEY with your own key, which should be obtained from our support team.
:::

---

# Standards

URL: /en/documentation/caas/card_issuance/standards

To simplify integration and ensure data integrity, some standards have been defined and are followed throughout the API.

## Monetary Values

> Examples:

```
10000
12345
98741
1223
1
0
```
Values must be sent as integers in cents.

## Date and Time with Timezone

> Some examples:

```
2019-10-15T22:35:12-03:00
2018-05-01T13:32:11+00:00
2019-05-01T00:00:00+00:00
```

It is represented according to the ISO 8601 standard. In this case, the timezone is placed immediately after the time and should represent the timezone of the location where that data will be valid. For example, if a rental is scheduled to start at 09:30 at Brasília airport, the time sent should be represented as 09:30-03:00; if the rental is scheduled to start at 09:30 in Manaus, it should be represented as 09:30-04:00.

The validation mask is as follows:

`YYYY-MM-ddThh:mm:ss±hh:mm`

## Date and Time without Timezone

> Some examples:

```
2019-10-15T22:35:12Z
2018-05-01T13:32:11Z
2019-05-01T00:00:00Z
```

It is represented according to the ISO 8601 standard. Data that is independent of timezones should be sent without one, always in UTC, using the letter Z to indicate that the data is in UTC. Therefore, the following format will be validated:

`YYYY-MM-ddThh:mm:ssZ`

## Date

> Some examples:

``` 
2019-10-15
2019-01-01
2017-03-20
```

For fields that only receive a date—such as a birthdate—only the date, without any time, should be sent in the following format:

`YYYY-MM-dd`

---

# Transaction

URL: /en/documentation/caas/card_issuance/transaction

When the cardholder initiates a transaction, the data must be sent to our server so that we can perform a risk analysis on that set of data.

## Object Definition

Request Body

```json
{
  "id": "678",
  "cardholder_id": "b812da2e-e6be-4712-8e57-6f3f2791625b",
  "group_id" : "8507884b-c30f-4b45-951c-f0bf366926fc",
  "amount": 13725,
  "currency": "BRL",
  "brl_converted_amount": 13725,
  "installments": 6,
  "authorization_date": "2019-11-10T13:25:42.123-03:00",
  "authorization_type": "authorization",
  "transaction_type": "credit",
  "pan_entry_mode": "chip",
  "pin_sent": true,
  "source_account": "saving_account",
  "location": {
    "latitude": -45.2753548,
    "longitude": -15.24587
  },
  "terminal": {
    "id": "123456",
    "country_code": "BRA",
    "terminal_type": "2",
    "pin_entry_capability": true,
    "magnetic_stripe_capability": true,
    "contactless_capability": false,
    "chip_capability": true
  },
  "merchant": {
    "acquirer_id": "250",
    "merchant_id": "123456",
    "name": "VASP LINHAS AEREAS",
    "street" : "RUA CMDTE X, 127",
    "city" : "SAO PAULO, SP",
    "region": "BRA",
    "postal_code": "04570-140",
    "mcc": "3036"
  },
  "card": {
    "brand": "visa",
    "category": "black",
    "issuing_date": "2019-10-08T07:13:12.333-03:00",
    "unblock_date": "2019-10-12T07:13:12.333-03:00",
    "expiration_date": "2019-12-31",
    "bin": "498406",
    "last4": "1234",
    "total_credit_limit": 2500000,
    "used_credit_limit": 732625,
    "issuer_country_code": "BRA"
  },
  "transaction_status" : "authorized",
  "response_code": "05"
}
```

A transaction must be sent to the API before the transaction is authorized and can be used to make the decision to generate (or not) an authorization code. The data sent can also be used to generate alerts based on the cardholder's transaction history, so that if there is behavior different from expected, the alert triggers an appropriate action to mitigate the impact of the transactions.

The fraud statuses (**fraud_status** and **transaction_status**) represent, respectively, the decision returned by the model for that transaction and whether the transaction was completed, cancelled, or became a dispute.

The following statuses are used in **transaction_status**:

* `not_authorized`
* `authorized`
* `cleared`
* `cancelled`
* `partially_cancelled`
* `chargeback`
* `partial_chargeback`

The following statuses are used in **fraud_status**:

* `automatically_approved`
* `automatically_declined`
* `not_analyzed`

Below are the meanings of each decision returned in the **fraud_status** field:

Result | Description
:---------: | ---------
automatically_approved | This transaction is recommended to be approved
automatically_declined | This transaction is recommended to be declined
not_analyzed | The request was sent with the analysis flag set to false, meaning our systems should not return a decision

name | type | description | 
:----: | :----: | ---------
id | string | *(required)* Transaction identifier in the client's system. **It is essential that this number be unique for each authorization process**
cardholder_id | string | *(required)* Cardholder identifier in the client's system — as registered in the Onboarding API
group_id | string | *(optional)* Identifier of which group or category that user belongs to within the client's system
amount | integer | *(required)* The transaction amount — as described in the "Standards" section
currency | string | *(required)* The currency used in the transaction — ISO 4217 and ApplicationCurrencyCode from 8583
brl_converted_amount | integer | *(required)* The transaction amount converted to Brazilian Reais — as described in the "Standards" section
installments | integer | *(required)* The number of installments used in the transaction
authorization_date | datetime | *(required)* The date and time when the transaction started, with timezone
authorization_type | enumerator | *(required)* Authorization or pre-authorization transaction?
transaction_type | enumerator | *(required)* Credit, Debit or Voucher
pan_entry_mode | enumerator | *(required)* PAN entry mode — Chip, Keyed, Magnetic Stripe, Fallback, Contactless—Field from ISO 8583 (DE 22 - Sub Field 1)
pin_sent | boolean | *(required)* Was a PIN entered at the terminal? — Field from entry_mode in ISO 8583
source_account | enumerator | *(optional)* Whether the transaction amount should be taken from the bill, checking account or savings—Field from Processing Code in ISO 8583
location.latitude | number | *(optional)* The latitude where the transaction occurred—if there is a linked mobile device or another means of capturing the location
location.longitude | number | *(optional)* The longitude where the transaction occurred
terminal.id | string | *(optional)* The terminal identifier sent by the acquirer in the authentication messaging
terminal.country_code | string | *(required)* The country code of the terminal, sent in the authorization message per ISO 3166-1 alpha-3, field from Terminal Country Code in ISO 8583
terminal.terminal_type | string | *(required)* The terminal type as received in the authorization messaging — Field from TerminalType in ISO 8583
terminal.pin_entry_capability | boolean | *(required)* Is it possible to enter the card PIN at the terminal? — Field from TerminalPINEntryCapability in ISO 8583
terminal.magnetic_stripe_capability | boolean | *(optional)* Can the terminal read magnetic stripe? — Field TerminalPANEntryCapability (DE 123) in ISO 8583
terminal.contactless_capability | boolean | *(optional)* Can the terminal initiate contactless transactions? — Field TerminalPANEntryCapability (DE 123) in ISO 8583
terminal.chip_capability | boolean |*(required)* Can the terminal initiate transactions using the EMV chip? — Field TerminalPANEntryCapability (DE 123) in ISO 8583
merchant.acquirer_id | string | *(required)* The acquirer identifier as per authorization messaging — Field Acquirer Identifier (DE 32) in ISO 8583
merchant.merchant_id | string | *(required)* The merchant identifier at the acquirer as per authorization messaging — Field Merchant Identifier in ISO 8583
merchant.name | string | *(optional)* The merchant name according to authorization messaging—Field Merchant Name in ISO 8583
merchant.street | string | *(optional)* The street address of the merchant — Field Card Acceptor Street Address
merchant.city | string | *(optional)* The city of the merchant's address — Field Card Acceptor City
merchant.region | string | *(optional)* The region of the merchant's address — Field Card Acceptor Region Code
merchant.postal_code | string | *(optional)* The postal code of the merchant's address — Field Card Acceptor Postal Code
merchant.mcc | string | *(required)* Merchant Category Code, according to ISO 18245 and ISO 8583
card.brand | enumerator | *(required)* The card brand (visa, mastercard, elo...)
card.category | enumerator | *(required)* The card category (classic, gold, platinum, black, infinite, corporate)
card.issuing_date | datetime | *(required)* The date and time when the card was issued, with timezone
card.unblock_date | datetime | *(optional)* The date and time when the card was unblocked by the cardholder, with timezone
card.expiration_date | date | *(required)* The card expiration date (last day of the month)
card.bin | string | *(required)* The BIN of the card being used
card.last4 | string | *(required)* The last four digits of the card, used to identify the card within the issuer
card.total_credit_limit | number | *(optional)* The total credit limit granted to the cardholder. If the card is prepaid, the existing credit balance on the card
card.used_credit_limit | number | *(optional)* The amount of limit already used (before the transaction in question)
card.issuer_country_code | string | *(required)* The issuer country per ISO 3166-1 alpha-3
transaction_status | enumerator | *(optional)* The transaction status, when sent with ***analyze=false*** flag and authorization decision has already been made.
response_code | enumerator | *(optional)* The transaction response code per the Response Code field in ISO 8583, when sent with ***analyze=false*** flag and authorization decision has already been made.

## Enumerators

The enumerators of the card transaction object are authorization_type, transaction_type, pan_entry_mode, source_account, brand and category. The possible values for each can be seen below:

## authorization_type

enumerator | meaning
---------- | -----------
authorization | A purchase authorization — MTI x1xx (DMS) and x2xx (SMS)
pre_authorization | A pre-authorization to reserve limit on the card (Hotel, Vehicle Rental, Equipment Rental, Fuel Machines) — MTI x1xx (DMS) and Transaction Type (first 2 digits of Processing Code) "60"
reversal | A cancellation authorization (to release limit on the card and subsequently proceed with Clearing/BASE II) — MTI x4xx

## transaction_type

enumerator | meaning
---------- | ----------
credit | A transaction made on the credit function
debit | A transaction made on the debit function
prepaid | A transaction made on the prepaid function

## pan_entry_mode

enumerator | ISO 8583 | meaning
---------- | -------- | -----------
unknown | 00 | PAN entry mode unknown.
typed | 01 | PAN entered manually (keyed).
bar_code | 03 | PAN entered by barcode reader
ocr | 04 | PAN entered by OCR (Optical Character Recognition)
chip | 05 | PAN entered by card with integrated circuit (Chip)
track_1 | 06 | PAN entered by Track 1 of the magnetic stripe card
contactless | 07 | PAN entered by Contactless EMV
fallback_typed | 79 | An attempt was made to use the card or stripe reader on the device and the card but the transaction could not be processed with that information (possibly a device or card issue), so the PAN was keyed. In some cases the acquirer is not certified to use CHIP or stripe and sends this code.
fallback_magnetic_stripe | 80 | An attempt was made to use the device's card reader and the card but the transaction could not be processed with that information (possibly a device or card issue), so the card's magnetic stripe was used.
ecommerce | 81 | E-commerce / card-not-present transaction
magnetic_stripe | 90 | Magnetic stripe transaction (Card has no chip or device has no reader/is not certified)

Other PAN_ENTRY_MODE values exist; however, they are generally not used.

## source_account

enumerator | ISO 8583 | meaning
---------- | -------- | -----------
default | 00 | Default or unspecified
saving_account | 10 | Savings account
checking_account | 20 | Checking account
credit_facility | 30 | Bill
universal_account | 40 | Universal Account
investment_account | 50 | Investment account
electronic_purse | 60 | Balance stored on the card chip (Electronic Purse)

## brand

enumerator | meaning
---------- | -----------
visa | Visa
mastercard | MasterCard
diners_club | Diners Club
elo | Elo
american_express | American Express

## category

enumerator | meaning
---------- | -----------
classic | Classic
gold | Gold
platinum | Platinum
black | Black/Infinite
travel | Travel
corporate | Corporate/Business
prepaid | Prepaid

## terminal_type

enumerator | meaning
---------- | -----------
0 | Unknown
1 | No terminal used
2 | Magnetic stripe reader
3 | Bar code (reserved for future use)
4 | Optical Character Recognition (reserved for future use)
5 | Magnetic stripe reader and EMV specification compatible integrated circuit card (ICC) reader
6 | Key entry only
7 | Magnetic stripe reader and key entry
8 | Magnetic stripe reader and key entry and EMV-compatible ICC reader
9 | EMV compatible ICC reader

## Send a Transaction

Request Body

```json
  {
    "id": "12345",
    ...
  }
```

Response Body

```json
  {
    "id": "12345",
    "fraud_status": "automatically_approved"
  }
```

To evaluate a transaction, simply send a Transaction object to the following endpoint with the flag set appropriately:

`POST https://api.caas.qitech.app/card_issuance/transaction?analyze=true`

The *analyze* parameter exists to prevent transactions that do not need to be analyzed from going through the fraud engines and polluting the database. The default value of this parameter is **true**, so only transactions explicitly marked will not be analyzed.

## Update the status of a Transaction

Request Body: When authorizing a transaction

```json
{
  "transaction_status": "authorized",
  "response_code": "05"
}
```

Request Body: When partially cancelling a transaction

```json
{
  "transaction_status": "partially_cancelled",
  "partial_amount" : 3000,
  "response_code": "05"
}
```

To ensure feedback to the rules and the implemented artificial intelligence model, it is necessary to inform the system when transactions are cancelled. For this, requests with the PUT method must be used, authenticated as usual:

`PUT https://api.caas.qitech.app/card_issuance/transaction/123456`

## Retrieve a Transaction

To retrieve a specific Transaction, simply make a GET request. The result returned is the most up-to-date JSON of the Transaction in question. If this identifier is not linked to any object, HTTP Status 404 is returned.

`GET https://api.caas.qitech.app/card_issuance/transaction/12345678`

```shell
curl "https://api.caas.qitech.app/card_issuance/transaction/12345678"
  -H "Authorization: EXAMPLE-OF-API-KEY"
```

> The command above returns the JSON that represents a Transaction object.

## Search Transactions

Response Body: List of Transaction objects.

```json
[
  {
    "id": "12345",
    ...
  },
  {
    "id": "12345",
    ...
  }
]
```

If you need to search for Transactions, a GET with query parameters can be used. The result returned is a JSON representing a list of Transactions. If no object is found with the parameters sent, HTTP Status 200 is returned with an empty list in the response body.

`GET https://api.caas.qitech.app/card_issuance/transactions?initial_date=2019-10-01&final_date=2019-10-05&page_number=2&page_rows=20`

The following parameters can be used for the search:

Parameter | Default | Description
--------- | ----------- | --------------
initial_date | null | First date to be returned from the transaction_date field
final_date | null | Last date to be returned from the transaction_date field
cardholder_id | null | Cardholder identifier at the issuer
page_number | 0 | Page number of desired results, starting at zero
page_rows | 50 | Maximum number of objects to be returned in a query

---

# authentication

URL: /en/documentation/caas/card_order/authentication

## Autenticação

> Para autenticar uma chamada, utilize o código seguinte:

```shell
# No shell, você somente precisa adicionar o header adequado em cada requisição
curl "api_endpoint_here"
  -H "Authorization: EXAMPLE_API_KEY"
```

> Substitua a API key 'EXAMPLE_API_KEY' com a sua chave adquirida com o nosso suporte.

Utilizamos uma API Key para permitir acesso a nossa API. Ela provavelmente já foi enviada por e-mail para você. Caso você ainda não tenha recebido a sua chave, envie um e-mail para suporte.caas@qitech.com.br .

Nossa API espera receber a API Key em todas as requisições ao nosso servidor em um header como o abaixo:

`Authorization: EXAMPLE_API_KEY`

:::info **Atenção**

Você deve substituir EXAMPLE_API_KEY com a API Key recebida do suporte.
:::

---

# Status HTTP

URL: /en/documentation/caas/card_order/http_status

Todas as APIs da QI Tech utilizam a seguinte padronização nos status HTTP de retorno, de acordo com o RFC 7231 :

Status HTTP | Significado | Descrição
---------- | ------- | ---------------------------------
400 | Bad Request | A requisição enviada possui algum erro de formatação. Na maioria dos casos, retornamos no corpo da mensagem uma explicação de onde está o erro.
401 | Unauthorized | Houve algum problema na autenticação, verifique se a API Key está correta e no header correto, de acordo com a seção Autenticação .
403 | Forbidden | O endpoint acessado é de uso interno e não está disponível para esta API Key.
404 | Not Found | O dado requisitado não foi encontrado usando a chave utilizada. Este status também é retornado quando um endpoint inválido é requisitado.
405 | Method Not Allowed | O método HTTP utilizado não se aplica ao endpoint utilizado.
406 | Not Acceptable | Os dados enviados no corpo da requisição são inválidos. Em geral, isso significa que os dados enviados não são um JSON válido.
409 | Conflict | O id da requisição corresponde a um id já processado anteriormente. Este status é retornado no caso de requisições duplicadas enviadas ao servidor.
500 | Internal Server Error | Tivemos um problema para processar esta requisição, ao encontrarmos esse erro nossos especialistas são automaticamente notificados e iniciam a análise e solução imediatamente.
503 | Service Unavailable | Você se deparou com uma indisponibilidade, planejada ou não, de infraestrutura dos nossos servidores.

---

# Introduction

URL: /en/documentation/caas/card_order/introduction

Welcome to QI Tech’s Card Transaction Fraud Prevention API! You can use our API to access the endpoints in order to receive the response of a transaction, and send transactions to QI Tech so that it can generate alerts for fraudulent users or fraudulent sellers, as well as use it to update the status of a transaction.

:::info **Attention**

Attention, this API is intended for merchants that receive card-not-present transactions, which are subject to fraud chargebacks, meaning companies that sell through applications or websites and receive payments via credit or debit card
:::

Below, you can see the API implementation using cURL. This provides examples that you can properly adapt to the programming language of your choice.

## Issues?

We’re not a company that hides behind an API! Reach out to our suport team and we’ll get back to you as soon as possible. Feel free to give us a call if you want a quicker answer!

### We love feedbacks

Even if you’ve already solved your issue or it is something simple (like a typo or a small organizational detail), feel free to send us an email. That way, we can keep improving our documentation and help the next person avoid the same difficulties you faced!

## Environments

We provide two environments for our clients. The base URLs for the APIs are:

* Production - `https://api.caas.qitech.app/card_order/`
* Sandbox - `https://api.sandbox.caas.qitech.app/card_order/`

In the Sandbox environment, analyses are not charged and return predefined responses.

For transaction analysis in the Sandbox environment, the decision is based on the transaction amount:

Minimum | Maximum | Decision
------ | ------ | -------
0 | 1000 | Automatically Approved
1001 | 2000 | Referred for Manual Review - Later Approved
2001 | 3000 | Referred for Manual Review - Later Rejected 
3001 | 4000 | Automatically Rejected
4001 | 5000 | Not Analyzed
5001 | - | Pending

## Only HTTPS

For security reasons, all communication with QI Tech's APIs must be conducted over HTTPS. To ensure that no HTTP calls are made, whether by oversight or any other reason, this server only makes port 443 available with TLS 1.2 communication. Requests using other protocols will be automatically rejected.

## Authentication

> To authenticate a request, use the following code:

```shell
# In the shell, you only need to add the appropriate header to each request
curl "api_endpoint_here"
  -H "Authorization: EXAMPLE_API_KEY"
```

> Replace the API key 'EXAMPLE-OF-API-KEY' with your key acquired from our support team.

We use an API Key to allow access to our API. It has probably already been sent to you by email. If you have not yet received your key, please send an email to suporte.caas@qitech.com.br .

Our API expects to receive the API Key in all requests to our server in a header like the one below:

`Authorization: EXAMPLE_API_KEY`

:::info **Attention**

You must replace EXAMPLE_API_KEY with the API Key received from support.
:::

---

# Objetos

URL: /en/documentation/caas/card_order/objects

## Objeto *address*

Request Body

```json
{
  "street": "Rua do Exemplo, 111",
  "neighborhood": "Bairro do Teste",
  "city": "Aparecida de Goiânia",
  "uf": "GO",
  "complement": "",
  "postal_code": "00000-000",
  "country": "BRA"
}
```

O objeto *address* é utilizado para representar endereços em toda a API, endereços no território brasileiro são representados da seguinte maneira:

nome | tipo | descrição
---- | :----: | ---------
street | string | *(obrigatório)* Rua do endereço, incluindo o logradouro, evitando, se possível, abreviações.
number | string | Número do imóvel, incluindo letras caso possua.
neighborhood | string | *(obrigatório)* Bairro, sem abreviações. **e.g.: Santa Felicidade**
city | string | *(obrigatório)* Nome completo da cidade, sem abreviações
uf | string | *(obrigatório)* A unidade federativa, com duas letras maiúsculas. **e.g.: SP**
complement | string | Quaisquer complementos para localizar o imóvel. **e.g.: Apartamento 101, Conjunto 12**
postal_code | string | *(obrigatório)* O código postal da localidade, contendo o hífen.
country | string | *(obrigatório)* Código ISO 3166-1 alfa-3 do país do endereço.

No caso dos endereços cujo país não seja Brasil ("BRA"), o postal_code e a unidade federativa poderão ser preenchidos livremente.

## Objeto *payment*

Request Body

```json
{
  "total_amount": 10000,
  "shipping_amount": 500,
  "currency": "BRL",
  "is_recurrence": false,
  "transactions": [ . . . ]
}
```

Um pagamento é representado pelo objeto *payment*, que possui os seguintes campos:

nome | tipo | descrição
---- | :----: | ---------
total_amount | inteiro | *(obrigatório)* Valor monetário total pago
shipping_amount | inteiro | Valor do frete cobrado para entrega
currency | Enumerador | *(obrigatório)* Moeda de pagamento de acordo com a ISO 4217
is_recurrence | boolean | *(obrigatório)* Caso este seja um pagamento de recorrência, indicar true nesta flag
transactions | Array de Transaction | *(obrigatório)* Lista de transações que foram realizadas para o pagamento do pedido (Pagamento com múltiplos cartões)

## Objeto *transaction* - Cartão de Crédito

Request Body

```json
{
  "id": "124234",
  "amount": 10000,
  "bin": "123456",
  "last_4": "1234",
  "cardholder_name": "JOHN SAMPLE",
  "card_fingerprint": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
  "expiration_date": "2020-11",
  "installments": 6,
  "processor": "stone",
  "payment_type": "credit"
}
```

Uma transação é representada pelo objeto *transaction*, que possui os seguintes campos:

nome | tipo | descrição
---- | :----: | ---------
id | string | *(obrigatório)* Um identificador no sistema do cliente da transação, deve ser único por pedido
amount | integer | *(obrigatório)* Valor monetário que representa o valor pago
bin | string | *(obrigatório)* BIN do cartão utilizado no pagamento
last4 | string | *(obrigatório)* Quatro últimos dígitos do cartão utilizado no pagamento
cardholder_name | string | *(obrigatório)* Nome do portador, como está escrito no cartão
card_fingerprint | string | *(obrigatório)* Identificador do cartão no sistema do cliente ("Token")
expiration_date | string | Data de vencimento definida pelo cartão (YYYY-DD)
installments | integer | *(obrigatório)* Número de parcelas do pagamento
processor | enumerador | *(obrigatório)* Adquirente ou subadquirente responsável pelo processamento da transação
payment_type | enumerador | *(obrigatório)* Tipo de meio de pagamento
status | enumerador | Opcional - Último status da transação no momento do envio para a QI Tech - Útil para envio de transações não autorizadas

Enumeradores disponíveis para processor:
* cielo
* rede
* stone
* getnet
* adyen
* global_payments
* pagseguro

## Objeto *transaction* - PIX

Request Body

```json
{
  "id": "124234",
  "amount": 10000,
  "payment_type": "pix"
}
```

Uma transação é representada pelo objeto *transaction*, que possui os seguintes campos:

nome | tipo | descrição
---- | :----: | ---------
id | string | *(obrigatório)* Um identificador no sistema do cliente da transação, deve ser único por pedido
amount | integer | *(obrigatório)* Valor monetário que representa o valor pago
payment_type | enumerador | *(obrigatório)* Tipo de meio de pagamento

## Objeto *dict_key*

Request Body

```json
  {
    "key_type": "cpf",
    "key_value": "09991222669"
  }
```

O objeto **dict_key**  é utilizado para representar os dados da chave de vínculo no DICT do cliente, seja ele o recebedor ou o pagador da transação. Os campos desse objeto são:

nome | tipo | descrição
:----: | :----: | ---------
key_type        | string | Enumerador que contém o tipo da chave de vinculo no DICT.
key_value       | string | Contém a chave de vínculo cadastrada no DICT.

Os enumeradores para o campo *key_type* são os mesmos definidos na API do DICT: `cpf`,`cnpj`,`email`,`phone` e `evp`.

## Objeto *account*

Request Body

```json
{
    "participant": "17315359",
    "branch": "0000",
    "account_number": "10442",
    "account_digit": "6",
    "account_type": "CACC"
}
```

Objeto que representa os dados de uma conta.

nome | tipo | descrição
:----:  | :----:  | ---------
participant                 | string | ISPB da instituição detentora da conta
branch                      | string | Agência da Conta
account_number              | string | Número da Conta sem o dígito
account_digit               | string | Dígito da conta
account_type                | enum | Tipo da conta de origem, possíveis valores: "CACC", "SLRY" e "SVGS"

## Objeto *phone*

Request Body

```json
{
  "international_dial_code": "1",
  "area_code": "11",
  "number": "999999999",
  "type": "mobile",
  "validated": false
}
```

Um objeto phone representa um número telefônico, dentro ou fora do Brasil e sua classificação. Para isso, os campos são:

nome | tipo | descrição
---- | :----: | ---------
international_dial_code | string | *(obrigatório)* Código de discagem internacional, sem zero ou +, somente números
area_code | string | *(obrigatório)* Código de área, sem zero, somente números
number | string | *(obrigatório)* Número do telefone, sem o hífen
type | enum | *(obrigatório)* Tipo de número: celular, residencial, comercial, etc.
validated | booleano | Caso o número de telefone tenha sido validado (SMS ou Ligação), enviar true neste campo

Existem os seguintes enumeradores para tipo de telefone: `residential`, `commercial`, `mobile`

## Objeto *seller*

Request Body

```json
{
  "id": "COD",
  "name": "Restaurante do Aeroporto de Congonhas",
  "type": "legal_person",
  "document_number": "00.000.000/0001-00",
  "email": "seller@gmail.com",
  "registration_date": "2019-12-20T15:23:12-03:00",
  "url": "https://www.qitech.com.br",
  "phone": {
      "international_dial_code": "1",
      "area_code": "11",
      "number": "999999999",
      "type": "mobile"
  },
  "address": {
    "street": "Rua do Exemplo",
    "neighborhood": "Bairro do Teste",
    "city": "Aparecida de Goiânia",
    "number": "1000",
    "uf": "GO",
    "complement": "Térreo",
    "postal_code": "00000-000"
  }
}
```

O objeto *seller* representa uma loja ou vendedor que realiza a venda ou entrega do pedido. Os dados a serem enviados podem ser vistos abaixo:

nome | tipo | descrição
---- | :----: | ---------
id | string | *(obrigatório)* O código identificador da loja (Ou vendedor em MarketPlace) no cliente
name | string | *(obrigatório)* O nome da loja (Ou vendedor em MarketPlace)
type | enum | Enumerador que representa se o seller é uma pessoa física ou pessoa jurídica
document_number | string | *(obrigatório)* O CNPJ ou CPF do seller
url | string | Endereço para a página do seller na plataforma
email | string | O e-mail do seller
registration_date | date | *(obrigatório)* A data de cadastro do seller
phone | *phone* | O telefone do seller
address | *address* | *(obrigatório)* O endereço da loja, caso seja uma loja física

Enumeradores de type:

* `natural_person`
* `legal_person`

## Objeto *customer*

Request Body

```json
{
  "id": "5ce7fab5-8165-44a5-9b89-bb2d6d61e4f4",
  "name": "Mary Sample",
  "gender": "female",
  "document_number": "000.000.000-00",
  "registration_date": "2019-12-20T15:23:12Z",
  "email": "test@sample.com",
  "birthdate": "1990-01-02",
  "address": { . . . },
  "phone": { . . . }
}
```

O objeto customer representa os dados de quem realizou a compra do pedido, com o próprio cartão de crédito. Ele é composto por:

nome | tipo | descrição
---- | :----: | ---------
id | string | *(obrigatório)* Um identificador único do comprador ou usuário
name | string | *(obrigatório)* Nome completo
gender | enum | O gênero do customer, de acordo com a lista de enumeradores.
document_number | string | *(obrigatório)* O CPF, formatado adequadamente
registration_date | date | A data quando o usuário se cadastrou no sistema do cliente
email | string | *(obrigatório)* O e-mail do usuário
birthdate | date | A data de nascimento do customer
address | *address* | *(obrigatório)* O endereço residencial do comprador/usuário
phone | *phone* | *(obrigatório)* O telefone colhidos do comprador/usuário

Enumeradores de gênero:

* `male`
* `female`

## Objeto *device*

Request Body

```json
{
  "session_id": "595c46c1-b8c2-449d-8a86-6aeba2e5b0da",
  "platform": "android",
  "browser": "chrome",
  "ip": "243.178.100.37"
}
```

O objeto device descreve dados do dispositivo usado para realizar a compra. Os seguintes dados são passados:

nome | tipo | descrição
---- | :----: | ---------
session_id | string | *(obrigatório)* O identificador da sessão, repassada também no device scan
platform | enumerador | Enumerador do sistema operacional em uso
browser | enumerador | Enumerador do browser em uso (Ou aplicativo)
ip | string | O ip de origem da compra, de acordo com a padronização desta documentação. **Atenção, IPs iniciados em 10.* , 172.16.* e 192.168.* em geral são internos e portanto não são aplicáveis para prevenção a fraudes**

Enumeradores de plataforma:
* `android`
* `ios`
* `windows`
* `linux`

Enumeradores de browser:
* `firefox`
* `chrome`
* `safari`
* `app`

---

# Order

URL: /en/documentation/caas/card_order/order

Antes de realizar a entrega/envio de um produto ou a liberação de créditos para o seu cliente ou seller, você deve enviar os dados do pedido para a nossa API para que possamos lhe responder a nossa recomendação com relação a fraude. É muito importante que os dados enviados sejam os dados finais, que não serão alterados. Isto é muito importante para garantir dois pontos:

* Consistência dos dados na base de dados do Antifraude
* Avaliação realista do risco

O processo de análise consiste em enviar uma Order no endpoint adequado e esperar a resposta. Existem quatro resultados possíveis, devolvido na flag **analysis_status**:

Resultado | Descrição
:---------: | ---------
Aprovado Automaticamente | Recomenda-se que este pedido seja aprovado
Negado Automaticamente | Recomenda-se que este pedido seja reprovado
Derivado para análise manual | Nossas regras ou modelos não estão confiantes da decisão e decidiram enviar este pedido para a análise manual.
Aprovado Manualmente | Após análise manual, o analista escolheu aprovar o pedido
Reprovado Manualmente | Após análise manual, o analista escolheu reprovar o pedido
Pendente | As consultas estão demorando mais do que o esperado, este pedido entrou em uma fila de análise automática e será respondido por meio de Webhook
Não analisado | A consulta foi enviada com a flag de análise falsa, ou trata-se de uma análise exclusivamente para geração de alertas, o que significa que nossos sistemas não deverão retornar recomendação na resposta da Order

:::info **Atenção**
Caso o seu modelo de negócio demande, o motor da QI Tech pode ser configurado para que nenhum pedido seja derivado para análise manual, e nem para o estado Pendente. Assim, o seu usuário poderá receber imediatamente a confirmação da transação.
:::

### Dinâmica dos Status

Ao recuperar um objeto do tipo Order os status estão disponíveis. Além dos status, um histórico de modificações também são retornados para que possa ser consultado no futuro. Estas modificações são entituladas events e possuem, além do novo status, as datas de modificação.

### Dinâmica dos Status - **payment_status**

O status **payment_status** relacionado a um Pedido indica a situação do pagamento relacionado a este pedido, isto é, se a transação foi efetivamente aprovada, se foi cancelada ou se recebeu um chargeback de fraude. Os seguintes status de pagamento estão disponíveis:

* open
* not_authorized
* authorized
* captured
* cancelled
* chargeback

:::info **Atenção**

É de suma importância que o status de pagamento seja enviado para a QI Tech pois ele é utilizado como base para treinamento dos nossos modelos. No caso de chargeback, é muito importante que o reason_code seja enviado corretamente, como será explicado em seguida.
:::

### Dinâmica dos Status - **analysis_status**

O status **analysis_status** indica o status da decisão do motor de fraude e possui uma máquina de estados bastante simples:

* created
* automatically_approved
* automatically_reproved
* in_manual_analysis
* manually_approved
* manually_reproved
* pending
* not_analyzed

## Definição do Objeto

Request Body

```json
{
	"id": "12345678",
	"is_one_dollar_auth": false,
	"seller": {
		"id": "COD",
		"name": "Restaurante do Aeroporto de Congonhas",
		"type": "legal_person",
		"document_number": "00.000.000/0001-00",
		"email": "seller@gmail.com",
		"registration_date": "2019-12-20T15:23:12-03:00",
		"url": "https://www.qitech.com.br",
		"phone": {
			"international_dial_code": "1",
			"area_code": "11",
			"number": "999999999",
			"type": "mobile",
			"validated": true
		},
		"address": {
			"street": "Rua do Exemplo",
			"neighborhood": "Bairro do Teste",
			"city": "Aparecida de Goiânia",
			"number": "1000",
			"uf": "GO",
			"complement": "Térreo",
			"postal_code": "00000-000",
			"country": "BRA"
		}
	},
	"payment": {
		"total_amount": 10000,
		"shipping_amount": 500,
		"currency": "BRL",
		"is_recurrence": false,
		"transactions": [{
			"id": "124234",
			"amount": 8000,
			"bin": "123456",
			"last_4": "1234",
			"cardholder_name": "JOHN SAMPLE",
			"card_fingerprint": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
			"expiration_date": "2020-11",
			"installments": 6,
			"processor": "stone",
			"payment_type": "credit",
			"status": "not_authorized"
		}]
	},
	"shipping": {
		"name": "Mary Sample",
		"gender": "female",
		"document_number": "000.000.000-00",
		"birthdate": "1990-01-02",
		"email": "test@sample.com",
		"address": {
			"street": "Rua do Exemplo, 123",
			"neighborhood": "Bairro do Teste",
			"city": "Aparecida de Goiânia",
			"number": "1000",
			"uf": "GO",
			"complement": "",
			"postal_code": "00000-000",
			"country": "BRA"
		},
		"phone": {
			"international_dial_code": "1",
			"area_code": "11",
			"number": "999999999",
			"type": "mobile",
			"validated": true
		},
		"scheduled_date": "2020-01-10",
		"shipping_method": "regular"
	},
	"customer": {
		"id": "5ce7fab5-8165-44a5-9b89-bb2d6d61e4f4",
		"name": "Mary Sample",
		"gender": "female",
		"document_number": "000.000.000-00",
		"registration_date": "2019-12-20T15:23:12-03:00",
		"email": "test@sample.com",
		"birthdate": "1990-01-02",
		"address": {
			"street": "Rua do Exemplo, 123",
			"neighborhood": "Bairro do Teste",
			"city": "Aparecida de Goiânia",
			"number": "1000",
			"uf": "GO",
			"complement": "",
			"postal_code": "00000-000",
			"country": "BRA"
		},
		"phone": {
			"international_dial_code": "1",
			"area_code": "11",
			"number": "999999999",
			"type": "mobile",
			"validated": true
		}
	},
	"device": {
		"session_id": "595c46c1-b8c2-449d-8a86-6aeba2e5b0da",
		"platform": "android",
		"browser": "chrome",
		"ip": "243.178.100.37"
	},
	"products": [{
		"product_code": "latte-machiatto-30",
		"name": "Latte Machiatto 30cl",
		"description": "Latte Machiatto 30cl para levar, leite integral",
		"sku": "1234",
		"quantity": 2,
		"unit_cost": 5000
	}],
	"order_date": "2020-01-03T15:35:12.454-03:00"
}
```

Todas as trocas de informação de um pedido utilizam a seguinte definição para este objeto. Em alguns casos, para facilitar a implementação e diminuir o fluxo de dados entre as partes, algumas informações poderão ser omitidas.

nome |                  tipo                  | descrição
:----: |:--------------------------------------:| ---------
id | string | Identificador do pedido no sistema do cliente. **É essencial que este valor seja único para cada pedido** (Obrigatório)
is_one_dollar_auth |                booleano                | Se esta for uma transação somente para validação do cartão, enviar com essa flag true (Obrigatório)
seller |             Objeto Seller              | Os dados da loja onde a venda está sendo realizada. No caso de um market place, são os dados do vendedor. No caso de um aplicativo, são os dados da loja de retirada (Obrigatório)
payment |             Objeto Payment             | Dados do pagamento do pedido (Obrigatório)
customer |            Objeto Customer             | Dados do cliente/usuário (Obrigatório)
shipping |            Objeto Shipping             | Dados da entrega do pedido - Deve ser preenchido em casos de produtos de entrega física 
device |             Objeto Device              | Dados do aparelho/navegador onde o pedido é realizado
products |            Array de Product            | Os produtos sendo comprados (Obrigatório)
order_date |          Data Hora            | Data e hora de realização do pedido (Obrigatório)

## Enviar um Pedido

Request Body

```json
  {
    "id": "12345",
    ...
  }
```

Response Body

```json
  {
    "id": "12345",
    "analysis_status": "automatically_approved"
  }
```

Para realizar a avaliação de um pedido, basta enviar um objeto do tipo Order ao seguinte endpoint:

`POST https://api.caas.qitech.app/card_order/order`

## Atualizar o status de um Pedido

Request Body

```json
{
  "transaction_status": "chargeback"
}
```

Para garantir a retroalimentação das regras e do modelo de inteligência artificial implementado, é necessário informar ao sistema quando as transações são autorizadas, capturadas, canceladas ou recebem chargeback. Para isso, requisições com o método PUT devem ser utilizadas, autenticadas normalmente:

`PUT https://api.caas.qitech.app/card_order/order/12345678/transaction/124234`

Existem os seguintes enumeradores para *transaction_status*: `open`, `not_authorized`, `authorized`, `captured`, `cancelled`, `chargeback`

## Recuperar um Pedido

A fim de recuperar um Pedido específico, basta realizar uma requisição GET. O resultado retornado é o json mais atualizado do Pedido em questão. Caso este identificador não esteja relacionado a nenhum objeto, o HTTP Status 404 é retornado.

`GET https://api.caas.qitech.app/card_order/order/12345678`

```shell
curl "https://api.caas.qitech.app/card_order/order/12345678"
  -H "Authorization: EXAMPLE_API_KEY"
```

> O comando acima retorna o JSON que representa um objeto de CardOrder.

## Buscar CardOrders

Response Body

```json
[
  {
    "id": "12345",
    ...
  },
  {
    "id": "12345",
    ...
  }
]
```

> Retorna um JSON que representa uma lista de objetos CardOrder.

Caso seja necessário buscar um CardOrder, um GET com parâmetros de query poderá ser utilizado. O resultado retornado é um JSON que representa uma lista de CardOrders. Caso nenhum objeto seja encontrado com os parâmetros enviados, o HTTP Status 200 é retornado com uma lista vazia no corpo da resposta.

`GET https://api.caas.qitech.app/card_order/order?initial_date=2019-10-01&final_date=2019-10-05&page_number=2&page_rows=20`

Os seguintes parâmetros podem ser utilizados para buscar objetos de CardOrder:

Parâmetro | Padrão | Descrição
--------- | ----------- | --------------
initial_date | null | Primeira data que deve ser retornada a partir do campo order_date
final_date | null | Última data que deve ser retornada a partir do campo order_date
page_number | 1 | Número da página de resultados desejada
page_rows | 50 | Número de objetos máximo a ser retornados em uma consulta

---

# Padrões

URL: /en/documentation/caas/card_order/standards

Para facilitar a integração e garantir a integridade da informação, foram definidos alguns padrões que são seguidos em toda a API.

## Valores Monetários
> Exemplos:

```
10000
12345
98741
1223
1
0
```

As APIs assumem que todos os valores monetários enviados são em Reais Brasileiros. Os valores devem ser enviados como inteiro em centavos.

## Data e Hora com Fuso Horário
> Alguns exemplos:

```
2019-10-15T22:35:12-03:00
2018-05-01T13:32:11+00:00
2019-05-01T00:00:00+00:00
```

É representada conforme a ISO 8601. Neste caso, o fuso-horário é colocado logo após o horário e deve representar o fuso do local onde aquele dado será valido. Por exemplo, se um aluguel estiver marcado para começar às 09:30 no aeroporto de Brasília, o horário enviado deverá ser representado por 09:30-03:00, se o aluguel estiver marcado para começar às 09:30 em Manaus, deverá ser representado por 09:30-04:00.

A máscara utilizada para validação é a seguinte:

`YYYY-MM-ddThh:mm:ss±hh:mm`

## Data e Hora sem Fuso Horario
> Alguns exemplos:

```
2019-10-15T22:35:12Z
2018-05-01T13:32:11Z
2019-05-01T00:00:00Z
```

É representada conforme a ISO 8601. Dados que independem de fuso-horário deverão ser enviados sem ele, sempre em UTC, com a letra Z indicando que este dado está em UTC. O seguinte formato, portanto, será validado:

`YYYY-MM-ddThh:mm:ssZ`

## Data
> Alguns exemplos

``` 
2019-10-15
2019-01-01
2017-03-20
```

No caso de campos que recebem somente data, uma data de nascimento, por exemplo, somente a data, sem nenhum horário deve ser enviada com o seguinte formato:

`YYYY-MM-dd`
 

## Documentos
Uma vez que os números de documento são bastante variados e muitos deles possuem caracteres que não se enquadram como numéricos, definem-se todos os números de documento como string. Outro bom motivo para definí-los como string é evitar que os zeros à esquerda desapareçam. Documentos previstos nesta página possuem uma máscara bem definida e estarão sujeitos a validação. O restante dos documentos, como RG, dada sua falta de padronização, não serão validados.

## CPF

> Exemplos de CPFs válidos contra a máscara definida:

```
123.456.789-12
321.987.543-23
111.283.333-00
```

> Exemplos de CPFs inválidos contra a máscara definida:

```
8.577.477-8
08.104.627/0001-23
123.456.789-1
23.456.789-01
```

O CPF é sempre definido como uma string e será validado conta a máscara:

`###.###.###-##`

## CNPJ

> Exemplos de CNPJs válidos contra a máscara definida:

```
08.104.627/0001-02
01.079.210/0114-67
32.402.502/0001-35
```

> Exemplos de CNPJs inválidos contra a máscara definida:

```
8.577.477-8
123.456.789-12
321.987.543-23
32.402.502/0001-3
032.402.502/0001-3
```

O CNPJ é sempre definido como uma string e será validado conta a máscara:

`##.###.###/####-##`

## IP

> Exemplos de IPs válidos contra a máscara definida:

```
201.81.161.86
201.081.161.86
201.81.161.086
201.81.0.1
```

> Exemplos de IPs inválidos:

```
201.81..86
358.81.161.86
201.81.161
```

IPs deverão ser enviados sempre em IPv4, zeros à esquerda poderão ou não ser enviados, respeitando a seguinte máscara:

`###.###.###.###`

---

# Webhook

URL: /en/documentation/caas/card_order/webhook

Atualizações no status de fraude (Para Orders que sejam derivados para análise manual ou que sejam respondidos como Pendente) e para Sellers bloqueados, são notificados por meio de Webhook. Para tanto, é necessário, por meio da equipe do [suporte](mailto:suporte.caas@qitech.com.br), configurar um endereço do endpoint por onde vamos notificar as atualizações e também uma *signature_key* que será utilizada para assinar a requisição.

No caso da atualização do status do pedido, o cliente pode também utilizar a técnica de [polling](https://en.wikipedia.org/wiki/Polling_(computer_science)). Neste caso, basta não configurar o endpoint de webhook e utilizar os endpoints de recuperação de Order para proceder com o polling.

:::info **Atenção**

Por questões de segurança, todas as requisições de Webhook serão somente realizadas em endpoints servidos por HTTPS.
:::

## Assinatura

> Exemplo de cálculo de assinatura em Python

```python
    hmac_obj = hmac.new(signature_key.encode('utf-8'), (url + method + payload).encode('utf-8'), hashlib.sha1)
    return hmac_obj.hexdigest()
```

Para garantir que a requisição recebida no endpoint do webhook parte dos nossos servidores, uma assinatura HMAC é enviada no Header *Signature*, de maneira semelhante ao processo de autenticação.

Após realizar o cálculo do valor esperado da assinatura do lado do servidor, é necessário comparar a assinatura calculada com a enviada. Caso as assinaturas sejam compatíveis, isso significa que a requisição partiu dos nossos servidores e que é confiável.

## Webhook de Atualização de Order

Request Body

```json
    {
        "order_id": "123456",
        "fraud_status": "automatically_approved",
        "event_date": "2019-10-01T10:37:25-03:00"
    }
```

A requisição de atualização do status de análise de uma order possui o formato acima e notifica a mudança no status de fraude. O método utilizado é um PUT e o endereço do endpoint pode conter também o id do pedido, de acordo com a necessidade do cliente. É importante ressaltar que o corpo da requisição é enviado como texto codificado em UTF-8.

Exemplos de endpoints para atualização de pedido:

* https://apidocliente.com.br/order
* https://apidocliente.com.br/admin/order/1214

O campo event_date indica a data e hora em que a notificação foi criada e pode estar no passado caso envios de notificação anteriores tenham falhado.

## Webhook de Atualização de Seller

> Exemplo de requisição de bloqueio de liquidação

Request Body

```json
    {
        "document_number": "000.000.000-00",
        "settlement_status": "blocked",
        "event_date": "2019-10-01T10:37:25-03:00"
    }
```

> Exemplo de requisição de bloqueio transacional

Request Body

```json
    {
        "document_number": "000.000.000-00",
        "transactional_status": "blocked",
        "event_date": "2019-10-01T10:37:25-03:00"
    }
```

Caso o bloqueio ou desbloqueio de um seller seja necessário, o sistema da QI Tech realizará uma requisição com o formato acima. O método utilizado é um PUT realizado em um endpoint configurável e pode conter, a critério do cliente, o número do documento no endereço do endpoint.

:::info **Atenção**

É a presença do campo settlement_status ou do campo transactional_status que determina o tipo de bloqueio ou desbloqueio que deve ser realizado no seller.
:::

Exemplos de endpoints para atualização de seller:

* https://apidocliente.com.br/seller
* https://apidocliente.com.br/admin/seller/000.000.000-00

Os seguintes status de liquidação podem ser notificados:

enumerador | descrição
---- | ---------:
blocked | A liquidação do seller deve ser bloqueada
unblocked | A liquidação do seller deve ser liberada

O campo event_date indica a data e hora em que a notificação foi criada e pode estar no passado caso envios de notificação anteriores tenham falhado.

## Retentativas

A notificação é considerada realizada quando recebe como resposta um HTTP Status 200. Caso as notificações falhem, serão feitas 7 retentativas, com os seguintes intervalos, até que um 200 seja retornado ou as tentativas terminem:

* 10 segundos
* 40 segundos
* 160 segundos
* 640 segundos
* 2560 segundos
* 10240 segundos
* 40960 segundos

---

# authentication

URL: /en/documentation/caas/credit_analysis/authentication

## Autenticação

> Para autenticar uma chamada, utilize o código seguinte:

```shell
# No shell, você somente precisa adicionar o header adequado em cada requisição
curl "api_endpoint_here"
  -H "Authorization: EXAMPLE-OF-API-KEY"
```

> Substitua a API key 'EXAMPLE-OF-API-KEY' com a sua chave adquirida com o nosso suporte.

Utilizamos uma API Key para permitir acesso a nossa API. Ela provavelmente já foi enviada por e-mail para você. Caso você ainda não tenha recebido a sua chave, envie um e-mail para suporte.caas@qitech.com.br .

Nossa API espera receber a API Key em todas as requisições ao nosso servidor em um header como o abaixo:

`Authorization: EXAMPLE-OF-API-KEY`

:::info **Atenção**

Você deve substituir EXAMPLE-OF-API-KEY com a API Key recebida do suporte.
:::

---

# Challenge Flow

URL: /en/documentation/caas/credit_analysis/challenge_flow

After executing a credit analysis, it's possible that the decision challenges the user to perform a new action on your platform. This flow can be used, for example, to request proof of income from a user whose approval or denial is not yet certain.

With this flow, you can configure a rule in which the decision challenges your customer to submit additional information to the system, such as a payslip photo or any other relevant data, and once collected, use this additional information to run a new rule for re-evaluating the user.

There are two ways to use this flow: one is automated, and the other is the result of a manual decision by an analyst. For the first, the returned *analysis_status* will be *automatically_challenged*, and for the second, it will be *manually_challenged*. The flow is described below.

## Step-by-step of the Flow Execution

**1.** A proposal is submitted for analysis (see section Credit Analysis - Natural Person or Credit Analysis - Legal Person ), and it will return the status *automatically_challenged* or *in_manual_analysis*.

Request Body

```json
{
  "id": "12345",
  "registration_id":"12345",
  "credit_request_date": "2021-03-31T10:30:00-03:00",
  "credit_type": "clean",
  "name": "Victor Silva Barbosa",
  "document_number": "199.208.915-92",
  ...
}
```

Response Body

```json
{
  "id": "12345",
  "analysis_status": "automatically_challenge"
}
```

If the request returns the status *in_manual_analysis* in the response, the analyst can, through the dashboard, challenge the user. In this case, the status sent in the webhook request will be *manually_challenged*.

Response Body

```json
{
  "id": "12345",
  "analysis_status": "manually_challenged"
}
```

**2.** After the first analysis request has returned one of the two challenge *analysis_status* values, a new request must be sent with the additional information collected from the customer, such as a new uploaded document image. This request must contain the same *registration_id* as the previous request, since this field will be used by the platform to identify that both requests refer to the same user, as well as to link the additional information collected from the customer.

Request Body: Submission with additional information

```json
{
  "id": "67890",
  "registration_id":"12345",
  "credit_request_date": "2021-03-31T10:30:00-03:00",
  "credit_type": "clean",
  "name": "Victor Silva Barbosa",
  "document_number": "199.208.915-92",
  "documents": {    
    "cnh": {
      "ocr_key":"a5cf9c8f-2f66-4490-a7db-8a5bc70c1b76"
    }
  }
  ...
}
```

Response Body

```json
{
  "id": "12345",
  "analysis_status": "automatically_approved"
}
```

Ensure that you use the same registration_id used in your first analysis.

---

# Retrieve a Credit Analysis

URL: /en/documentation/caas/credit_analysis/get_credit_analysis

To retrieve a specific Credit Analysis, simply make a GET request. The response will return the most up-to-date JSON of the analysis in question. If the identifier is not linked to any object, an HTTP 404 Status will be returned.

* **Natural Person:**

`GET https://api.caas.qitech.app/credit_analysis/natural_person/12345678`

* **Legal Person:**

`GET https://api.caas.qitech.app/credit_analysis/legal_person/12345678`

```shell
curl "https://api.caas.qitech.app/credit_analysis/natural_person/12345678"
  -H "Authorization: EXAMPLE-OF-API-KEY"
```

> The curl above returns the JSON that represents a Natural Person object.

```shell
curl "https://api.caas.qitech.app/credit_analysis/legal_person/12345678"
  -H "Authorization: EXAMPLE-OF-API-KEY"
```

> The curl above returns the JSON that represents Legal Person object.

---

# HTTP Status Codes

URL: /en/documentation/caas/credit_analysis/http_status

All QI Tech APIs follow the standard HTTP status codes as defined in the [RFC 7231](https://tools.ietf.org/html/rfc7231):

HTTP Status | Meaning | Description
----------- | ------- | ---------------------------------
400 | Bad Request | The request sent contains a formatting error. In most cases, we return a message body explaining where the error is.
401 | Unauthorized | There was a problem with authentication. Check if the API Key is correct and placed in the proper header, as explained in the [Authentication](#authentication) section.
403 | Forbidden | The accessed endpoint is for internal use and not available for this API Key.
404 | Not Found | The requested data could not be found using the provided key. This status is also returned when an invalid endpoint is requested.
405 | Method Not Allowed | The HTTP method used is not supported by the requested endpoint.
406 | Not Acceptable | The data sent in the request body is invalid. Usually, this means the payload is not valid JSON.
409 | Conflict | The request ID corresponds to an ID that has already been processed. This status is returned in case of duplicate requests.
500 | Internal Server Error | We encountered an issue while processing the request. When this happens, our specialists are automatically notified and begin investigating immediately.
503 | Service Unavailable | You encountered an infrastructure outage, whether planned or unplanned, on our servers.

---

# Imagens

URL: /en/documentation/caas/credit_analysis/image

Em várias situações é necessário enviar imagens para a nossa API, a fim de realizar operações de OCR, FaceMatch e validação de documentos. Para tanto, é preciso inicialmente realizar o upload da imagem para depois enviá-la para análise.

Ao enviar uma imagem utilizando o endpoint /image uma GUID (Globally Unique Identifier) é retornada. Este valor deverá ser utilizado nas chamadas subsequentes para referenciar esta imagem.

O tamanho máximo de uma imagem aceita é de 10MB.

Neste momento, somente imagens com formato jpeg são aceitas.

## Envio

> Exemplo de envio utilizando o cUrl

```shell
    curl    -F "data=@path/to/local/file" \
            -H "Authorization: EXAMPLE-OF-API-KEY" \
            "https://api.caas.qitech.app/image?type=face"

```

Response Body

```json
    {
        "image_id": "f4b5337a-7b50-406e-8c8e-7d0e77b5aa02",
        "image_size": "134232",
        "image_dimensions": "630x230"
    }
```

Para enviar uma imagem, basta realizar o envio da imagem no formato .jpeg em `multipart/form-data` com uma requisição POST no endpoint:

`https://api.caas.qitech.app/api/image?type=$type`

Onde $type é a classificação da imagem e deve ser enviado conforme um dos seguintes enumeradores (Caso a imagem sendo enviada não se enquadre em nenhuma das classificações, entrar em contato com o [suporte](mailto:suporte.caas@qitech.com.br) para que providenciem a adição):

* face
* driver_license
* id
* contract

Após o envio, será retornado um objeto JSON com a GUID que aponta para a imagem que foi enviada.

## Recuperação dos Arquivos

> Leitura de imagem

```shell
    curl "https://api.caas.qitech.app/api/image/f4b5337a-7b50-406e-8c8e-7d0e77b5aa02/file" \
         -H "Authorization: EXAMPLE-OF-API-KEY"
```

Após o envio de uma imagem para a API, é possível recuperá-la por meio de uma requisição GET adequadamente autenticada no endpoint:

`https://api.caas.qitech.app/api/image/{image_key}/file`

Onde image_key é o valor retornado durante o envio da imagem.

## Recuperação dos meta-dados do arquivo

> Leitura de meta dados

```shell
    curl "https://api.caas.qitech.app/api/image/f4b5337a-7b50-406e-8c8e-7d0e77b5aa02" \
         -H "Authorization: EXAMPLE-OF-API-KEY"
```

Após o envio de uma imagem para a API, é possível recuperar os meta-dados da imagem utilizando o endpoint:

`https://api.caas.qitech.app/api/image/{image_key}`

Onde image_key é o valor retornado durante o envio da imagem.

---

# Introduction

URL: /en/documentation/caas/credit_analysis/introduction

Welcome to QI Tech's Credit Analysis API! You can use our API to access endpoints in order to perform a credit analysis, as well as update the status of a granted credit.

:::info **Attention**
Please note that this API is intended for companies that offer credit to individuals (Natural Persons) and small businesses (Legal Persons). Its purpose is to conduct a full credit assessment of your client's operations, based on the data you provide, data from bureaus and external sources, and QI Tech's datalake, in order to make the risk-return profile of each operation clear.

This API is designed for individuals and small businesses. It is not suited for assessing the credit risk of large corporations, which require deeper knowledge of their operations and the markets in which they operate.
:::

## Issues?

We’re not a company that hides behind an API! Reach out to our support team and we’ll get back to you as soon as possible. Feel free to give us a call if you want a quicker answer!

### We love feedbacks

Even if you’ve already solved your issue or it is something simple (like a typo or a small organizational detail), feel free to send us an email. That way, we can keep improving our documentation and help the next person avoid the same difficulties you faced!

## Environments

We provide two environments for our clients. The base URLs for our APIs are:

* Production – `https://api.caas.qitech.app/credit_analysis/`
* Sandbox – `https://api.sandbox.caas.qitech.app/credit_analysis/`

In the Sandbox environment, analyses are not charged and return predefined responses with fictitious data. Its sole purpose is to simulate the production environment and support clients during integration.

For credit analysis in the Sandbox environment, the decision is based on the total credit amount (`financial.amount`) according to the table below:

Minimum | Maximum | Decision  
--------|---------|---------  
10001 | - | Rejected  
8001 | 10000 | Manual Analysis – A manual rejection webhook is sent after 1 minute  
6001 | 8000 | Manual Analysis – A manual approval webhook is sent after 1 minute  
4001 | 6000 | Awaiting Data – An automatic approval webhook is sent after 1 minute  
2001 | 4000 | Pending  
0 | 2000 | Approved  

## HTTPS Only

For security reasons, all communication with QI Tech's APIs must be conducted using HTTPS. To ensure that no HTTP calls are made by mistake or for any other reason, this server only makes port 443 available with TLS 1.2 communication. Requests made using other protocols will be automatically denied.

## Authentication

> To authenticate a request, use the following code:

```shell
# In the shell, you only need to add the appropriate header to each request
curl "api_endpoint_here"
  -H "Authorization: EXAMPLE-OF-API-KEY"
```

> Replace the API key 'EXAMPLE-OF-API-KEY' with your key acquired from our support team.

We use an API Key to allow access to our API. It has probably already been sent to you by email. If you have not yet received your key, please send an email to suporte.caas@qitech.com.br .

Our API expects to receive the API Key in all requests to our server in a header like the one below:

`Authorization: EXAMPLE-OF-API-KEY`

:::info Attention

You must replace EXAMPLE-OF-API-KEY with the API Key received from support.
:::

---

# Credit Analysis - Legal Entity

URL: /en/documentation/caas/credit_analysis/legal_person

To perform the credit analysis of a legal entity, use the Legal Person endpoint.

At the time a legal entity credit analysis is performed, the following data must be sent to our server.

## Legal Person Object Definition

Request Body

```json
{
  "id": "12345678",
  "credit_request_date": "2021-03-31T10:30:00-03:00",
  "credit_type": "student_loan",
  "legal_name": "QI Tech Tecnologia LTDA",
  "trading_name": "QI Tech",
  "document_number": "35.472.523/0001-15",
  "constitution_date": "2019-11-11",
  "constitution_type": "llc",
  "email": "suporte.caas@qitech.com.br",
  "monthly_revenue": 50000000,
  "client_category": "Premium User",
  "client_since": "2021-02-11",
  "address": {
    "country": "BRA",
    "street": "Av. Brigadeiro Faria Lima",
    "number": "2391",
    "neighborhood": "Jardim Paulistano",
    "city": "São Paulo",
    "uf": "SP",
    "postal_code": "01452-905"
  },
  "phones": [
    {
      "international_dial_code": "55",
      "area_code": "11",
      "number": "32234611",
      "type": "residential"
    }
  ],
  "shareholders": [
    {
      "name": "Anna Pinto Azevedo",
      "document_number": "261.026.462-31",
      "birthdate": "1972-08-22",
      "email": "annapintoazevedo@sample.com",
      "nationality": "BRA",
      "mother_name": "Beatrice Rodrigues Pinto",
      "father_name": "Luís Azevedo",
      "monthly_income": 800000,
      "declared_assets": 18600000,
      "occupation": "law",
      "gender": "female",
      "address": {
        "country": "BRA",
        "street": "Rua Derviche Djouki",
        "number": "598",
        "complement": "Ap 857",
        "neighborhood": "Chora Menino",
        "city": "São Paulo",
        "uf": "SP",
        "postal_code": "02463-080"
      },
      "phones": [
        {
          "international_dial_code": "55",
          "area_code": "11",
          "number": "55988644",
          "type": "mobile"
        }
      ]
    }
  ],
  "guarantors": [
    {
      "name": "Melissa Lima Melo",
      "document_number": "677.498.846-61",
      "birthdate": "1960-11-21",
      "email": "exemplo2@sample.com",
      "nationality": "BRA",
      "mother_name": "Raíssa Lima",
      "father_name": "Ronaldo Melo",
      "monthly_income": 800000,
      "declared_assets": 18600000,
      "occupation": "law",
      "gender": "female",
      "address": {
        "country": "BRA",
        "street": "Rua Castro Alves",
        "number": "100",
        "complement": "Ap 202",
        "neighborhood": "Parque Estrela Dalva I",
        "city": "Luziânia",
        "uf": "GO",
        "postal_code": "72804-050"
      },
      "phones": [
        {
          "international_dial_code": "55",
          "area_code": "11",
          "number": "21158745",
          "type": "residential"
        }
      ]
    }
  ],
  "financial": {
    "amount": 100000,
    "currency": "BRL",
    "interest_type": "cdi_plus",
    "annual_interest_rate": 2.32,
    "cdi_percentage": 100,
    "number_of_installments": 4
  },
  "warrants": [
    {
      "warrant_type": "real_estate",
      "address": {
        "country": "BRA",
        "street": "Rua Curitiba",
        "number": "150",
        "complement": "Bl 3 apt 122",
        "neighborhood": "Paraíso",
        "city": "São Paulo",
        "uf": "SP",
        "postal_code": "04005-030"
      },
      "property_type": "house",
      "estimated_value": 100000000,
      "forced_selling_value": 60000000
    }
  ],
  "source": {
    "channel": "website",
    "ip": "132.23.161.75",
    "session_id": "2bb684f9-6c00-4993-bcd7-18b9eccd7c9d"
  },
  "scr_parameters" : {
    ...
  }
}
```

A credit analysis must be submitted to the API before disbursement and can be used to decide whether or not to grant credit. The submitted data may also, upon agreement with the client, be used for fraud prevention.

The objects used in the composition of the **CreditProposal** object and not defined in this section are available in the [Shared Objects](#objects) section.

|                   name                   |      type      | description                                                                                                                                                                      |
| :--------------------------------------: | :------------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                    id                    |    string      | Identifier of the credit proposal in your system. <br /> **It is essential that this number is unique for each credit analysis process**                                        |
| registration_id                          |    string      | Identifier of the registration in the client’s system. Used to perform more than one analysis related to the same registration                                                  |
|           credit_request_date            |   datetime     | The date and time when the credit was requested by the applicant                                                                                                                |
|               credit_type                |     enum       | Type of credit being granted. Currently supported: **clean**, **student_loan**, **credit_card_limit**                                                                          |
| legal_name                               |    string      | Company’s legal name                                                                                                                                                             |
| trading_name                             |    string      | Company’s trade name                                                                                                                                                             |
| document_number                          |    string      | The CNPJ, formatted according to the pattern established in this documentation                                                                                                   |
| monthly_revenue                          |    integer     | Gross monthly revenue in cents                                                                                                                                                   |
| client_category                          |    string      | Customer category according to your platform’s classification or loyalty program                                                                                                 |
| client_since                             |     date       | Service start date for this customer                                                                                                                                             |
| constitution_date                        |     date       | The company's incorporation date, according to the commercial registry                                                                                                           |
| constitution_type                        |     enum       | Company’s incorporation type: **LLC**, **corp**                                                                                                                                  |
| email                                    |    string      | The company representative’s email                                                                                                                                               |
| address                                  |   _Address_    | Company headquarters address                                                                                                                                                     |
| phones                                   | list of _Phones_ | Collected phone numbers of the company                                                                                                                                          |
| shareholders                             | list of _NaturalPerson_ | Company shareholders, in natural person model (**NaturalPerson** object)                                                                                                  |
| guarantors                               | list of _Person_ | Operation guarantors, either natural (**NaturalPerson**) or legal (**LegalPerson**)                                                                                             |
| financial.amount                         |    integer     | Total amount being requested by the applicant, which will be disbursed in case of approval                                                                                       |
| financial.currency                       |     enum       | Currency unit for the total amount: **BRL**, **USD**, **EUR**                                                                                                                    |
| interest_type                            |     enum       | Debt indexer to be used: **cdi_plus**, **cdi_percentage**, **price**, **pre_fixed**                                                                                              |
| annual_interest_rate                     |    number      | The fixed part of the interest rate, expressed annually as a percentage                                                                                                          |
| cdi_percentage                           |    number      | The CDI (post-fixed) percentage to be charged                                                                                                                                    |
| number_of_installments                   |    integer     | Number of installments                                                                                                                                                           |
| warrants                                 |   _Warrant_    | Real guarantee data offered in the operation. Must be agreed upon before going live. Currently accepted types: **real_estate**                                                  |
| source                                   |   _Source_     | Credit sales channel. Currently accepted values: **website** and **app**                                                                                                         |
| scr_parameters                           | _ScrParameters_ | Object with the necessary information to use SCR data in credit analysis                                                                                                       |

## Submit a Credit Proposal - Legal Person

Request Body

```json
  {
    "id": "12345678",
    ...
  }
```

Response Body

```json
{
  "id": "12345678",
  "analysis_status": "automatically_approved",
  "reason": "rule_decision_enum"
}
```

To evaluate a credit proposal, simply send an object of type **LegalPerson** to the following endpoint:

`POST https://api.caas.qitech.app/credit_analysis/legal_person`

---

# Credit Analysis - Natural Person

URL: /en/documentation/caas/credit_analysis/natural_person

To perform a credit analysis for a natural person, use the NaturalPerson endpoint.

When a natural person credit analysis is done, the following data must be sent to our server.

## Natural Person Object Definition

Request Body

```json
{
  "id": "12345678",
  "registration_id":"444",
  "credit_request_date": "2021-03-31T10:30:00-03:00",
  "credit_type": "student_loan",
  "name": "Victor Silva Barbosa",
  "document_number": "199.208.915-92",
  "birthdate": "1990-01-01",
  "email": "exemplo@sample.com",
  "nationality": "BRA",
  "gender": "male",
  "mother_name": "Ana Barbosa",
  "father_name": "João Silva",
  "monthly_income": 30000,
  "declared_assets": 7500000,
  "occupation": "pedagogy",
  "address": {
    "country": "BRA",
    "street": "Rua Curitiba",
    "number": "150",
    "complement": "Bl 3 apt 122",
    "neighborhood": "Paraíso",
    "city": "São Paulo",
    "uf": "SP",
    "postal_code": "04005-030"
  },
  "phones": [
    {
      "international_dial_code": "55",
      "area_code": "11",
      "number": "32234611",
      "type": "residential"
    }
  ],
  "guarantors": [
    {
      "name": "Melissa Lima Melo",
      "document_number": "677.498.846-61",
      "birthdate": "1960-11-21",
      "email": "exemplo2@sample.com",
      "nationality": "BRA",
      "mother_name": "Raíssa Lima",
      "father_name": "Ronaldo Melo",
      "monthly_income": 800000,
      "declared_assets": 18600000,
      "occupation": "law",
      "gender": "female",
      "address": {
        "country": "BRA",
        "street": "Rua Castro Alves",
        "number": "100",
        "complement": "Ap 202",
        "neighborhood": "Parque Estrela Dalva I",
        "city": "Luziânia",
        "uf": "GO",
        "postal_code": "72804-050"
      },
      "phones": [
        {
          "international_dial_code": "55",
          "area_code": "11",
          "number": "21158745",
          "type": "residential"
        }
      ]
    }
  ],
  "financial": {
    "amount": 100000,
    "currency": "BRL",
    "interest_type": "cdi_plus",
    "annual_interest_rate": 2.32,
    "cdi_percentage": 100,
    "number_of_installments": 4
  },
  "warrants": [
    {
      "warrant_type": "real_estate",
      "address": {
        "country": "BRA",
        "street": "Rua Curitiba",
        "number": "150",
        "complement": "Bl 3 apt 122",
        "neighborhood": "Paraíso",
        "city": "São Paulo",
        "uf": "SP",
        "postal_code": "04005-030"
      },
      "property_type": "house",
      "estimated_value": 100000000,
      "forced_selling_value": 60000000
    }
  ],
  "source": {
    "channel": "website",
    "ip": "145.25.145.32",
    "session_id": "bec256b3-5265-4dcb-bc55-2e4fb43983e0"
  },
  "scr_parameters" : {
    ...
  }
}
```

A credit analysis must be submitted to the API before disbursement and can be used to decide whether or not to grant credit. The submitted data can also, by agreement with the client, be used for fraud prevention purposes.

The objects used in the composition of the **CreditProposal** object and not defined in this section are available in the [Shared Objects](#objects) section.

|                   name                   |      type      | description                                                                                                                                                                      |
| :--------------------------------------: | :------------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                    id                    |    string     | Credit proposal identifier in your system. <br /> **This number must be unique for each credit analysis process** *(required)*                                                  |
| registration_id                          |    string     | Identifier of the registration in the client’s system. Use the same registration_id for multiple analyses referring to the same registration                                     |
|           credit_request_date            |    datetime    | The date and time when the credit was requested by the applicant *(required)*                                                                                                   |
|               credit_type                |     enum       | Type of credit being granted. Currently supported: **clean**, **student_loan**, **credit_card_limit**                                                                           |
| name                                     |    string      | Full name of the individual being registered                                                                                                                                      |
| document_number                          |    string      | CPF of the individual being registered, with dots and hyphens, according to formatting standards *(required)*                                                                   |
| birthdate                                |     date       | Date of birth of the individual according to the formatting standard                                                                                                              |
| gender                                   |     enum       | Gender of the individual: 'male', 'female' or 'undefined'                                                                                                                        |
| nationality                              |    string      | Nationality of the individual, in ISO 3166-1 alpha-3 format                                                                                                                       |
| mother_name                              |    string      | Full name of the mother                                                                                                                                                           |
| father_name                              |    string      | Full name of the father                                                                                                                                                           |
| monthly_income                           |    integer     | Gross monthly income in cents                                                                                                                                                     |
| declared_assets                          |    integer     | Declared assets in cents                                                                                                                                                          |
| client_category                          |    string      | Client category according to your platform classification or loyalty program                                                                                                     |
| client_since                             |     date       | Service start date for this client                                                                                                                                                |
| occupation                               |    string      | Profession of the individual being registered                                                                                                                                     |
| email                                    |    string      | The person's email address                                                                                                                                                        |
| documents                                |   Document     | Objects of type CNH and RG                                                                                                                                                        |
| address                                  |   _Address_    | Object of type Address describing the individual’s residence                                                                                                                     |
| phones                                   | List of _Phones_ | List of Phone objects containing the individual’s phone numbers                                                                                                                  |
| guarantors                               | List of _Person_ | Guarantors of the operation, either individuals (**NaturalPerson**) or legal entities (**LegalPerson**)                                                                          |
| financial.amount                         |    integer     | Total amount requested by the applicant, which will be disbursed upon approval, in cents                                                                                         |
| financial.currency                       |     enum       | Currency unit of the total amount: **BRL**, **USD**, **EUR**                                                                                                                      |
| interest_type                            |     enum       | Debt index to be used: **cdi_plus**, **cdi_percentage**, **price**, **pre_fixed**                                                                                                 |
| annual_interest_rate                     |     number     | Pre-fixed interest rate percentage per year                                                                                                                                       |
| cdi_percentage                           |     number     | CDI percentage (post-fixed) of the interest to be charged                                                                                                                        |
| number_of_installments                   |    integer     | Number of installments                                                                                                                                                            |
| warrants                                 |   _Warrant_    | Real guarantees offered in the operation. Must be agreed upon before going live. Currently accepted types: **real_estate**                                                      |
| source                                   |   _Source_     | Credit sales channel. Currently accepted: **website** and **app**                                                                                                                |
| scr_parameters                           | _ScrParameters_ | Object with the necessary information for using SCR data in the credit analysis                                                         

:::info **Attention**
The scr_parameters property is only required if the client has contracted and wishes to use the SCR consultation in the credit analysis.
:::

## Submit a Credit Proposal – Natural Person

Request Body

```json
  {
    "id": "12345678",
    ...
  }
```

Response Body

```json
{
  "id": "12345678",
  "analysis_status": "automatically_approved",
  "reason": "rule_decision_enum"
}
```

To perform the evaluation of a credit proposal, simply send an object of type **NaturalPerson** to the following endpoint:

`POST https://api.caas.qitech.app/credit_analysis/natural_person`

---

# Shared Objects

URL: /en/documentation/caas/credit_analysis/objects

Below are the definitions of other objects used throughout the documentation.

## _Address_ Object

Request Body

```json
{
  "street": "Rua do Exemplo",
  "number": "111" ,
  "neighborhood": "Bairro do Teste",
  "city": "Aparecida de Goiânia",
  "uf": "GO",
  "complement": "Apt 903",
  "postal_code": "00000-000"
}
```

The `_Address_` object is used to represent addresses throughout the API. Addresses located within Brazilian territory are represented as follows:

|     name      |  type   | description                                                                                      |
| ------------- | :-----: | ------------------------------------------------------------------------------------------------ |
| street        | string  | Street name, including full address line, avoiding abbreviations if possible *(required)*.      |
| number        | string  | Property number, including letters if applicable *(required)*.                                  |
| neighborhood  | string  | Neighborhood, without abbreviations *(required)*. <br />**e.g.: Santa Felicidade**              |
| city          | string  | Full city name, without abbreviations *(required)*.                                              |
| uf            | string  | Federal unit, two uppercase letters *(required)*. <br />**e.g.: SP**                             |
| complement    | string  | Any additional details to help locate the property. <br />**e.g.: Apartment 101, Unit 12**      |
| postal_code   | string  | Postal code including hyphen *(required)*.                                                       |
| country       | string  | ISO 3166-1 alpha-3 country code *(required)*.                                                    |

For addresses where the country is not Brazil ("BRA"), the `postal_code` and `uf` fields may be filled in freely.

## _Phone_ Object

Request Body

```json
{
  "international_dial_code": "1",
  "area_code": "11",
  "number": "999999999",
  "type": "mobile"
}
```

A _Phone_ object represents a telephone number, either inside or outside Brazil, along with its classification. The fields are as follows:

| name                   |  type   | description                                                                 |
|------------------------|:-------:|-----------------------------------------------------------------------------|
| international_dial_code | string | International dialing code, without zero or +, numbers only *(required)*.   |
| area_code              | string | Area code, without leading zero, numbers only *(required)*.                 |
| number                 | string | Phone number, without hyphen *(required)*.                                  |
| type                   |  enum  | Type of number: mobile, residential, commercial, etc.                       |

The following enumerators are available for phone type: `residential`, `commercial`, `mobile`

## _cnh_ Object

Request Body

```json
{
  "register_number": "05163811694",
  "issuer_state": "PR",
  "first_issuance_date":"2011-03-21",
  "issuance_date":"2016-06-29",
  "expiration_date":"2021-06-25",
  "category": "AB",
  "validation_type":"zaig_sdk",
  "ocr_key":"a5cf9c8f-2f66-4490-a7db-8a5bc70c1b76"
}
```

The *cnh* object is used to represent driver’s licenses (CNHs) throughout the API, including information on whether any validation method was used. They are represented as follows:

name | type | description
---- | :----: | ----------
register_number | string | Registration number of the registered CNH.
issuer_state | enum | Enumerator for the state where the CNH was issued.
first_issuance_date | date | Date of first issuance.
issuance_date | date | Date of issuance.
expiration_date | date | Expiration date.
category | enum | CNH category in uppercase letters.
validation_type | enum | Type of validation used during the document registration.
ocr_key | guid | ID returned by QI Tech’s document validation API.

The following enumerators exist for *validation_type*: `zaig_api` and `zaig_sdk`.

## *rg* Object

Request Body

```json
{
  "number": "4.366.477-8",
  "issuer": "II",
  "issuer_state": "PR",
  "issuance_date":"2002-01-12",
  "validation_type":"zaig_sdk",
  "ocr_front_key":"a5cf9c8f-2f66-4490-a7db-8a5bc70c1b76",
  "ocr_back_key":"a5cf9c8f-2f66-4490-a7db-8a5bc70c1b76"
}
```

The *rg* object is used to represent identity documents (RGs) throughout the API, including information on whether any validation method was used. They are represented as follows:

name | type | description
---- | :----: | ----------
number | string | Registered document number, including formatting (dots, hyphens, slashes, etc.).
issuer | string | Issuing authority of the document (abbreviation, e.g.: II, SESP...).
issuer_state | enum | State (UF) where the document was issued.
issuance_date | date | Date the document was issued.
validation_type | enum | Type of validation used during the document registration.
ocr_key | guid | ID returned by QI Tech’s document validation API.

The following enumerators exist for *validation_type*: `zaig_api` and `zaig_sdk`.

##  _NaturalPerson_ Object

Request Body

```json
{
  "name": "Melissa Lima Melo",
  "document_number": "677.498.846-61",
  "birthdate": "1960-11-21",
  "email": "exemplo2@sample.com",
  "nationality": "BRA",
  "gender": "female",
  "mother_name": "Raíssa Lima",
  "father_name": "Ronaldo Melo",
  "monthly_income": 800000,
  "declared_assets": 18600000,
  "occupation": "law",
  "address": {
    "country": "BRA",
    "street": "Rua Castro Alves",
    "number": "100",
    "complement": "Ap 202",
    "neighborhood": "Parque Estrela Dalva I",
    "city": "Luziânia",
    "state": "GO",
    "postal_code": "72804-050"
  },
  "phones": [
    {
      "international_dial_code": "55",
      "area_code": "11",
      "number": "21158745",
      "type": "residential"
    }
  ]
}
```

The _NaturalPerson_ object represents the data of an individual who may be the borrower, a guarantor, or a shareholder of a borrowing company. It consists of:

| name             |       type       | description                                                                                      |
| ---------------- | :--------------: | ------------------------------------------------------------------------------------------------ |
| name             |      string      | Full name *(required)*.                                                                          |
| document_number  |      string      | CPF, properly formatted *(required)*.                                                            |
| birthdate        |       date       | Person's date of birth.                                                                          |
| email            |      string      | Person's email.                                                                                  |
| gender           |       enum       | Person's gender, according to the enumerated values.                                             |
| address          |    _Address_     | Person's residential address.                                                                    |
| phones           | list of _Phone_ | Person's phone numbers.                                                                          |

Gender enumerators:

- `male`
- `female`
- `undefined`

## _LegalPerson_ Object

Request Body

```json
{
  "legal_name": "QI Tech Tecnologia LTDA",
  "trading_name": "QI Tech",
  "document_number": "35.472.523/0001-15",
  "constitution_date": "1990-01-01",
  "constitution_type": "llc",
  "email": "exemplo@sample.com",
  "address": { ... },
  "phones": [ { ... } ],
  "shareholders": [ { ... }]
}
```

The _LegalPerson_ object represents the data of a company that is either taking out credit or acting as a guarantor. It consists of:

| name              |          type           | description                                                                      |
| ----------------- | :---------------------: | -------------------------------------------------------------------------------- |
| legal_name        |         string          | Company’s legal name *(required)*.                                               |
| trading_name      |         string          | Trade name                                                                       |
| document_number   |         string          | CNPJ, formatted according to the pattern defined in this documentation *(required)*. |
| constitution_date |          date           | Company’s incorporation date, as per the Board of Trade                         |
| constitution_type |       enumerator        | Type of company incorporation: **LLC**, **corp**                                 |
| email             |         string          | Email of the company's representative                                            |
| address           |        _Address_        | Company’s headquarters address                                                   |
| phones            |    list of _Phone_      | List of phone numbers collected from the company                                |
| shareholders      | list of _NaturalPerson_ | Company's shareholders, modeled as individuals (**NaturalPerson** object)       |

## _Source_ Object

Request Body: Credit requests made through the company's own website

```json
{
  "channel": "website",
  "ip": "201.81.161.86",
  "session_id": "b8da64db-e8f8-47fc-8d8e-11ce26da499f"
}
```

Request Body: Credit requests made through the company's own mobile app

```json
{
  "channel": "app",
  "platform": "android",
  "ip": "201.81.161.86",
  "session_id": "b8da64db-e8f8-47fc-8d8e-11ce26da499f"
}
```

The `source` object represents the channel where the credit request was made.

**Attention:** If the desired sales channel does not fit into any of these categories, please contact the support team .

##  _Warrant_ Object

> For credit analyses that include any type of collateral, the `warrant` object can be used to inform our API. Currently, only real estate guarantees are accepted. If another type of guarantee is required, please contact our support team .

Request Body

```json
  {
    "warrant_type": "real_estate",
    "address": { ... },
    "property_type": "house",
    "estimated_value": 100000000,
    "forced_selling_value": 60000000
  }
```

For the **real_estate** guarantee type, the object consists of the following fields:

| name                 |   type   | description                                                                                                                |
| -------------------- | :------: | -------------------------------------------------------------------------------------------------------------------------- |
| warrant_type         |   enum   | Defines the type of guarantee. Currently, only **real_estate** is supported.                                               |
| address              | _Address_ | Address object representing the property used as collateral                                                               |
| property_type        |   enum   | Type of property. Currently supported: **house**, **commercial_building**, **office**, **apartment**                      |
| estimated_value      | integer  | Estimated market value of the property                                                                                     |
| forced_selling_value | integer  | Estimated forced sale value of the property                                                                                |

Warning: If the desired guarantee does not fall into any of these categories, please contact the support team .

##  _ScrParameters_ Object

Request Body

```json
  {
    "scr_parameters": {
      "signers": [
        {
          "document_number": "111.222.333-44",
          "name": "Felipe Marques da Silva",
          "email": "felipe.silva@qitech.com.br",
          "phone": {
            "number": "991722315",
            "area_code": "16",
            "international_dial_code": "55"
          }
        }
      ],
      "signature_evidence": {
        "ip_address": "179.104.42.245",
        "session_id": "ddb1d063-4fdf-4330-af9c-3316e9142ff3",
        "access_token":         "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQSflKxwRJSMeKKF2QT4fwpMeJf36PO6yJV_adQssw5d",
        "additional_data": {
          ...
        },
        "signed_term": {
          "raw_text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas elementum erat et tempus dapibus. Donec eu sapien tortor. Pellentesque 
            et tortor eget erat pulvinar mattis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin ornare diam arcu, sit amet auctor lorem varius quis. Ut pretium venenatis magna sed ultrices. Donec quis tortor odi."
        }
      }
    }
  }
```

| name                 |   type   | description                                                                                                                 |
| -------------------- | :------: | --------------------------------------------------------------------------------------------------------------------------- |
| signers              | List of _Signer_ | List of individuals who will or have signed the consent authorization for SCR consultation. This object should only be sent in the case of credit analyses for legal entities. |
| signature_evidence   | _SignatureEvidence_  | Object for sending the information collected at the time of consent authorization when the authorization is requested on the client's platform. |

##  *Signer* Object

Request Body

```json
  {
    "document_number": "111.222.333-44",
    "name": "Felipe Marques da Silva",
    "email": "felipe.silva@qitech.com.br",
    "phone": {
      "number": "991722315",
      "area_code": "16",
      "international_dial_code": "55"
    }
  }
```

| name               |  type   | description                        |
| ------------------ | :-----: | ---------------------------------- |
| document_number    | string  | Signer's document number.          |
| name               | string  | Signer's full name.                |
| email              | string  | Signer's email address.            |
| phone              | _Phone_ | Signer's phone number.             |

##  *Signature_Evidence* Object

Request Body

```json
  {
    "signature_evidence": {
      "ip_address": "179.104.42.245",
      "session_id": "ddb1d063-4fdf-4330-af9c-3316e9142ff3",
      "access_token":         "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQSflKxwRJSMeKKF2QT4fwpMeJf36PO6yJV_adQssw5d",
      "additional_data": {
        ...
      },
      "signed_term": {
        "raw_text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas elementum erat et tempus dapibus. Donec eu sapien tortor. Pellentesque 
          et tortor eget erat pulvinar mattis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin ornare diam arcu, sit amet auctor lorem varius quis. Ut pretium venenatis magna sed ultrices. Donec quis tortor odi."
      }
    }
  }
```

| name             |  type   | description                                                                                                                                  |
| ---------------- | :-----: | -------------------------------------------------------------------------------------------------------------------------------------------- |
| ip_address       | string  | Signer's IP address.                                                                                                                         |
| session_id       | string  | User session identifier on your platform; must allow audit of the Opt-In performed using this identifier.                                   |
| access_token     | string  | Identifier of the user logged into your platform; should support auditing of the user's registration based on this identifier.              |
| additional_data  | object  | Configurable JSON object to include any extra data the partner considers relevant to enhance credibility/authenticity of the signature.    |
| signed_term      | _SignedTerm_ | Object containing information about the consent term being used.                                                                            |

##  *SignedTerm* Object

Request Body

```json
  {
    "raw_text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas elementum erat et tempus dapibus. Donec eu sapien tortor. Pellentesque et tortor eget erat pulvinar mattis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin ornare diam arcu, sit amet auctor lorem varius quis. Ut pretium venenatis magna sed ultrices. Donec quis tortor odi."
  }
```

| name     |  type  | description                              |
| -------- | :----: | ---------------------------------------- |
| raw_text | string | Plain text of the term being signed.     |

---

# Credit Information System Data (SCR - BACEN)

URL: /en/documentation/caas/credit_analysis/scr

If contracted by the client, it's possible to use the data available from the SCR (Brazilian Central Bank’s Credit Information System) for individuals or legal entities during the credit analysis process. To use SCR data, it is essential that the consulted party's consent is collected. This consent can either be collected by QI Tech or by the client, and this affects both the consent flow and the required data to be sent to the API, as described below:

**1. Consent collected by QI Tech** – If you choose to have QI Tech collect consent, a link for electronic signature will be sent directly to the consulted party via email. Once the user signs and completes the process, SCR data automatically becomes available for use. To use this flow, the integration must include the personal data of the end-user who will sign the consent.

**2. Consent collected by the client** – You may collect the signed consent term within your own environment or credit pipeline (this may be done via signed document or an opt-in checkbox). To use this method, the consent term must be approved by QI Tech's legal team, and it's necessary to send information that audibly proves consent for accessing SCR data through the *scr_parameters* object.

> **Attention:** All configurations for accessing SCR data—including which flow will be used—must be agreed upon during product onboarding for this feature to be available.

## Consent Collection via QI Tech – Natural Person

In the case of a natural person, to have QI Tech send the consent request, simply include the consulted individual's personal information in the CreditProposal object. QI Tech will then send the consent request via email, and once authorization is complete, the consultation will be performed automatically and the results made available for credit analysis.

> **Important:** The following fields are **required** for SCR consent collection by QI Tech for natural persons: document_number , name , email , and the phone object.

## Consent Collection via QI Tech – Legal Person

Request Body

```json

  {
    "id": "32199d0s",
    "legal_name": "QI CAAS LTDA",
    "trading_name": "QI Tech",
    ...
    "scr_parameters": {
      "signers": [
        {
          "document_number": "372.989.950-30",
          "name": "Felipe Marques da Silva",
          "email": "felipe.silva@qitech.com.br",
          "phone": {
            "number": "991722315",
            "area_code": "16",
            "international_dial_code": "55"
          }
        },
        {
          "document_number": "440.896.050-08",
          "name": "Claudio Mattos",
          "email": "claudiomattos@sample.com",
          "phone": {
            "number": "991722315",
            "area_code": "16",
            "international_dial_code": "55"
          }
        }
      ]
    }
  }
```

In the case of a legal entity, for QI Tech to send the consent request, it is necessary to include the additional scr_parameters object in the credit analysis request. Within this object, you must provide a list of the company's legal representatives to whom the electronic signature requests will be sent via email. This list should be included under the signers property. After all legal representatives have signed, QI Tech will perform the consultation and make the results available for credit analysis. Above is an example of the scr_parameters object for the described case.

## Consent Collection by the Client – Natural Person

Request Body

```json
  {
    "id": "678",
    "credit_request_date": "2021-03-31T10:30:00-03:00",
    "credit_type": "student_loan",
    "name": "Victor Silva Barbosa",
    "document_number": "199.208.915-92",
    ...
    "scr_parameters": {
      "signature_evidence": {
        "ip_address": "179.104.42.245",
        "session_id": "ddb1d063-4fdf-4330-af9c-3316e9142ff3",
        "access_token":         "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQSflKxwRJSMeKKF2QT4fwpMeJf36PO6yJV_adQssw5d",
        "additional_data": {
          ...
        },
        "signed_term": {
          "raw_text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas elementum erat et tempus dapibus. Donec eu sapien tortor. Pellentesque et tortor eget erat pulvinar mattis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin ornare diam arcu, sit amet auctor lorem varius quis. Ut pretium venenatis magna sed ultrices. Donec quis tortor odi."
        }
      }
    }
  }
```

In the case of a natural person, when consent is collected by the client, it is necessary to include the additional scr_parameters object in the analysis request. Within this object, it is necessary to add information to prove that the individual being analyzed authorized the consultation. This information must be provided in the signature_evidence property. Above is an example of the scr_parameters object for the described case.

## Consent Collection by the Client – Legal Entity

Request Body

```json
  {
    "id": "678",
    "credit_request_date": "2021-03-31T10:30:00-03:00",
    "credit_type": "student_loan",
    "name": "Victor Silva Barbosa",
    "document_number": "199.208.915-92",
    ...
    "scr_parameters": {
      "signers": [
        {
          "document_number": "372.989.950-30",
          "name": "Felipe Marques da Silva",
          "email": "felipe.silva@qitech.com.br",
          "phone": {
            "number": "991722315",
            "area_code": "16",
            "international_dial_code": "55"
          }
        },
        {
          "document_number": "440.896.050-08",
          "name": "Claudio Mattos",
          "email": "claudiomattos@sample.com",
          "phone": {
            "number": "991722315",
            "area_code": "16",
            "international_dial_code": "55"
          }
        }
      ],
      "signature_evidence": {
        "ip_address": "179.104.42.245",
        "session_id": "ddb1d063-4fdf-4330-af9c-3316e9142ff3",
        "access_token":         "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQSflKxwRJSMeKKF2QT4fwpMeJf36PO6yJV_adQssw5d",
        "additional_data": {
          ...
        },
        "signed_term": {
          "raw_text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas elementum erat et tempus dapibus. Donec eu sapien tortor. Pellentesque et tortor eget erat pulvinar mattis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin ornare diam arcu, sit amet auctor lorem varius quis. Ut pretium venenatis magna sed ultrices. Donec quis tortor odi."
        }
      }
    }
  }
```

In the case of a legal entity, when consent is collected by the client, it is necessary to include the additional scr_parameters object in the analysis request. Within this object, it is necessary to add information to prove that the analyzed entity authorized the consultation, as well as include the list of legal representatives of the company who authorized the consultation. The authorization details must be provided in the signature_evidence property, and the list of individuals who authorized the consultation must be provided in the signers property. Above is an example of the scr_parameters object for the described case.

---

# Standards

URL: /en/documentation/caas/credit_analysis/standards

To simplify integration and ensure data integrity, some standards have been defined and are followed throughout the API.

## Monetary Values

> Examples:

```
10000
12345
98741
1223
1
0
```
The APIs assume that all monetary values sent are in Brazilian Reais. Values must be sent as integers in cents.

## Date and Time with Timezone

> Some examples:

```
2019-10-15T22:35:12.232-03:00
2018-05-01T13:32:11.297+00:00
2019-05-01T00:00:00.000+00:00
```

It is represented according to the ISO 8601 standard. In this case, the timezone is placed immediately after the time and should represent the timezone of the location where that data will be valid.

The validation mask is as follows:

`YYYY-MM-ddThh:mm:ss.sss±hh:mm`

## Date and Time without Timezone

> Some examples:

```
2019-10-15T22:35:12
2018-05-01T13:32:11
2019-05-01T00:00:00
```

It is represented according to the ISO 8601 standard. Data that is independent of timezones should be sent without one, always in UTC, using the letter Z to indicate that the data is in UTC. Therefore, the following format will be validated:

`YYYY-MM-ddThh:mm:ss.sssZ`

## Date
> Some examples:

``` 
2019-10-15
2019-01-01
2017-03-20
```

For fields that only receive a date—such as a birthdate—only the date, without any time, should be sent in the following format:

`YYYY-MM-dd`
 

## Documents

Since document numbers vary widely and many include non-numeric characters, all document numbers are defined as strings. Another important reason to treat them as strings is to preserve leading zeros. Documents mentioned on this page follow a strict mask and will be validated accordingly. Other documents, like RG, due to their lack of standardization, will not be validated.

## CPF

> Examples of valid CPFs based on the defined mask:

```
123.456.789-12
321.987.543-23
111.283.333-00
```

> Examples of invalid CPFs based on the defined mask:

```
8.577.477-8
08.104.627/0001-23
123.456.789-1
23.456.789-01
```

CPF is always defined as a string and will be validated against the following mask:

`###.###.###-##`

## CNPJ

> Examples of valid CNPJs based on the defined mask:

```
08.104.627/0001-02
01.079.210/0114-67
32.402.502/0001-35
```

> Examples of invalid CNPJs based on the defined mask:

```
8.577.477-8
123.456.789-12
321.987.543-23
32.402.502/0001-3
032.402.502/0001-3
```

CNPJ is always defined as a string and will be validated against the following mask:

`##.###.###/####-##`

## IP

> Examples of valid IPs based on the defined mask:

```
201.81.161.86
201.081.161.86
201.81.161.086
201.81.0.1
```

> Examples of invalid IPs:

```
201.81..86
358.81.161.86
201.81.161
```

IPs must always be sent in IPv4 format. Leading zeros are optional, as long as the following mask is respected:

`###.###.###.###`

---

# Status Dynamics

URL: /en/documentation/caas/credit_analysis/status_dynamics

The credit analysis process consists of sending a request, either for a **NaturalPerson** or a **LegalPerson**, to the appropriate endpoint and waiting the response.

After QI Tech completes the credit analysis, it returns a response containing a status related to the evaluation. This status is called **analysis_status**, which represents the outcome of the credit analysis performed by QI Tech.

In addition to **analysis_status**, QI Tech also provides **credit_proposal_status**, which represents the current status of the credit being analyzed throughout its lifecycle on your platform.

## **analysis_status**

As mentioned before, QI Tech defines seven **analysis_status** values that indicate the decision status of the credit evaluation. These follow a relatively simple state machine:

analysis_status | Description  
:---------: | ---------  
automatically_approved | QI Tech's algorithms recommend that this registration be approved  
automatically_reproved | QI Tech's algorithms recommend that this registration be rejected  
in_manual_analysis | QI Tech's algorithms sent this registration for manual analysis  
manually_approved | After manual analysis, the analyst decided to approve the registration  
manually_reproved | After manual analysis, the analyst decided to reject the registration  
waiting_for_data | The credit analysis is waiting for a response from a bureau or data provider and will be returned via Webhook  
automatically_challenged | QI Tech's algorithms recommend that this registration be challenged  
manually_challenged | After manual analysis, the analyst decided to challenge the registration  
pending | The credit analysis is taking longer than expected; this registration has entered an automatic analysis queue and will be returned via Webhook  

:::info **Attention**

You must replace EXAMPLE-OF-API-KEY with the API Key received from support.
:::

## **credit_proposal_status**

The **credit_proposal_status** indicates the status of the customer's credit operation, that is, the status of the credit proposal in your company or platform. The following enumerators exist for this status:

credit_proposal_status | Description  
:---------: | ---------  
created | The credit proposal was created in your platform  
disbursed | The credit proposal was disbursed in your platform  
paid | The customer has fully paid the credit  
defaulted | The customer is in default on your platform

---

# Update the Status of a Credit Analysis

URL: /en/documentation/caas/credit_analysis/update_credit_analysis

Request Body: To mark the credit as disbursed

```json
{
  "credit_proposal_status": "disbursed",
  "event_date": "2021-11-05T13:34:12-03:00"
}
```

To ensure feedback for the rules and the implemented AI model, it is necessary to inform the system when operations are carried out. For this, PUT requests should be used and authenticated:

* **Natural Person:**

`PUT https://api.caas.qitech.app/credit_analysis/natural_person/12345678`

* **Legal Person:**

`PUT https://api.caas.qitech.app/credit_analysis/legal_person/12345678`

---

# Webhook

URL: /en/documentation/caas/credit_analysis/webhook

Status updates (for registrations that are sent for manual analysis or returned as Pending) are notified via Webhook. To enable this, you must configure an endpoint URL through the [support team](mailto:suporte.caas@qitech.com.br), where we will send update notifications, as well as a *secret_token* used to sign the request.

Although not recommended, the client may alternatively use the [polling](https://en.wikipedia.org/wiki/Polling_(computer_science)) technique. In this case, simply do not configure the webhook endpoint and use the record retrieval endpoints to proceed with polling.

## Signature

> Example of signature calculation in Python

```python
    hmac_obj = hmac.new(signature_key.encode('utf-8'), (endpoint + method + payload).encode('utf-8'), hashlib.sha1)
    return hmac_obj.hexdigest()
```

To ensure that the request received on the webhook endpoint originates from our servers, an HMAC signature is sent in the Header Signature, similar to the authentication process.

After calculating the expected signature value on your server, you must compare the calculated signature with the one sent. If the signatures match, it means the request came from our servers and is trustworthy.

## Request
 
```bash
curl --location 'YOUR-ENDPOINT-HERE' \
--header 'Signature: CALCULATED-HASH-HMAC' \
--data '{"natural_person_id": "538509",  "analysis_status": "manually_approved", "event_date": "2024-11-13T17:52:50Z", "reason": "manually_approved"}'
```

The request follows the format above and notifies the status change. It is important to note that the request uses the HTTP POST method and the request body is sent as UTF-8 encoded string.

## Retry Attempts

A notification is considered successfully delivered when it receives an HTTP Status 200 as a response. If the notification fails, 5 retry attempts will be made with the following intervals, until a 200 is returned or all attempts are exhausted:

* 30 seconds  
* 60 seconds  
* 120 seconds  
* 240 seconds  
* 360 seconds

---

# Account Object

URL: /en/documentation/caas/device_manager/account

The account is an organizational entity that allows for device registration. This API was designed to comply with [BACEN Regulation 491](https://www.bcb.gov.br/estabilidadefinanceira/exibenormativo?tipo=Instru%C3%A7%C3%A3o%20Normativa%20BCB&numero=491); therefore, account data must follow a standard regarding information defined by the Central Bank, but any other necessary fields may be added to the account data.

## Account Object Definition

Request Body

```json
{
  "account_id": "12345678",
  "account_type": "natural_person",
  "registration_date": "2019-12-11T11:37:15.12-03:00",
  "account_data": {
    "account_number": "12345678",
    "agency_number": "1234"
    ...
  }
}
</details>

All information exchanges regarding an account use the following definition for this object. In some cases, to facilitate implementation and reduce data flow between parties, some information may be omitted.

name | type | description
:----: | :----: | ---------
account_id | string | Account identifier. <br /> It is essential that this number be unique for each account. *(mandatory)*
account_type | string | Identifier of the account type registered in the device registration system. Accounts can be of the natural person type `natural_person` or legal person type `legal_person` .*(mandatory)*
registration_date | datetime | Date and time of the account registration, with timezone. *(mandatory)*
account_data | object | object that may contain any account data, but if it contains the account number `account_number` and agency `agency_number`, both must be of the string type.

## Send an Account

<details>
<summary>
<strong>Request Body</strong>
</summary>
<div></div>

```json
  {
    "account_id": "12345",
    ...
  }
```
</details>

<details>
<summary>
<strong>Response Body</strong>
</summary>
<div></div>

```json
  {
    "account_id": "12345678",
    "account_type": "natural_person",
    "registration_date": "2019-12-11T11:37:15.12-03:00",
    "account_data": {
      "account_number": "12345678",
      "agency_number": "1234"
      ...
    }
  }
```
</details>

To create an account, simply send an Account type object to the following endpoint:

`POST https://api.caas.qitech.app/device_manager/account`

---

# Authentication

URL: /en/documentation/caas/device_manager/authentication

> To authenticate a request, use the following code:

```shell
# Add the authorization header to the request
curl "api_endpoint_here"
  -H "Authorization: EXAMPLE-OF-API-KEY"
```

> Note: Replace 'EXAMPLE-OF-API-KEY' with your access key.

Access to the API is controlled via an API Key. If you have not received your key yet, please request it by sending an email to suporte.caas@qitech.com.br .

The API Key must be included in the header of all requests to the server, following the pattern below:

`Authorization: EXAMPLE-OF-API-KEY`

:::info **Attention**

Remember to replace EXAMPLE-OF-API-KEY with the actual key obtained from our support team.
:::

---

# Device Object

URL: /en/documentation/caas/device_manager/device_registration

Device registration with unique identification must be performed via the Device endpoint. For the registration to be effective, the use of **Device Scan** is required so that the device identification is recorded for future recognition.

### Status Dynamics - **status**

The **status** field indicates the current situation of the device. The following statuses are available:

* registered
* not_registered
* deactivated

### Status Dynamics - **analysis_status**

The **analysis_status** field indicates the decision status of the fraud engine and follows this state flow:

* automatically_approved
* automatically_reproved
* pending

## Device Object Definition

Request Body

```json
{
  "device_id": "12345678",
  "session_id": "12345678",
  "face_recognition_key": "12345678",
  "document_number": "111.111.111-11",
  "mfa_status": "approved",
  "registration_date": "2019-12-11T11:37:15.12-03:00"
}
```

All information exchanges regarding a registration use the following definition for this object. In some cases, to facilitate implementation and reduce data flow between parties, some information may be omitted.

name | type | description
:----: | :----: | ---------
device_id | string | Device identifier. **It is essential that this number be unique for each device** *(mandatory)*
session_id | string | Session identifier in Device Scan. *(mandatory)*
face_recognition_key | string | Image identifier for facial biometrics if the product is contracted as registration 2FA.
document_number | string | User document for face validation. It should only be sent if not informed during the *Person object* registration.
mfa_status | string | Registration MFA status, which can be one of the following values: *approved* *reproved*
registration_date | datetime | The start date and time of the registration, with timezone. *(mandatory)*

:::warning Attention
The `document_number` field is necessary for face validation in the database; therefore, if it was not provided during user registration, it is mandatory. It must never differ from the one registered in the Person object.
:::

## Register a Device

Request Body

```json
  {
    "device_id": "12345",
    ...
  }
```

Response Body

```json
  {
    "device_id": "12345",
    "status": "registered",
    "analysis_status": "automatically_approved",
    "reason": "rule_decision_enum",
    "reason_description": "Descrição da regra"
  }
```

To register a Device, simply send a Device type object to the following endpoint:

`POST https://api.caas.qitech.app/device_manager/account/{account_id}/person/{person_id}/device`

---

# HTTP Status

URL: /en/documentation/caas/device_manager/http_status

All QI Tech APIs use the following standardization for HTTP return status codes, in accordance with RFC 7231 :

HTTP Status | Meaning | Description
---------- | ------- | ---------------------------------
400 | Bad Request | The request sent contains a formatting error. Usually, we return an explanation of the error in the message body.
401 | Unauthorized | There was an authentication problem. Check if the API Key is correct and in the correct header, as per the Authentication section.
403 | Forbidden | The accessed endpoint is for internal use and is not available for this API Key.
404 | Not Found | The requested data was not found using the provided key. This status is also returned when an invalid endpoint is requested.
405 | Method Not Allowed | The HTTP method used is not supported by this endpoint.
406 | Not Acceptable | The data sent in the request body is invalid. In general, this means the data sent is not valid JSON.
409 | Conflict | The request ID corresponds to an ID that has already been processed. This status is returned in the case of duplicate requests sent to the server.
500 | Internal Server Error | We encountered a problem processing this request. When this error occurs, our specialists are automatically notified and begin analysis and resolution immediately.
503 | Service Unavailable | Indicates an infrastructure unavailability, whether planned or unplanned, on our servers.

---

# Introduction

URL: /en/documentation/caas/device_manager/introduction

Welcome to the QI Tech Device Registration API! This API was designed to comply with [BACEN Regulation 491](https://www.bcb.gov.br/estabilidadefinanceira/exibenormativo?tipo=Instru%C3%A7%C3%A3o%20Normativa%20BCB&numero=491). Together with Device Scan, it is capable of generating a unique identification for each device.

This API manages the device identification process, enabling future validation of the same device. This flow is structured through the following entities:

* Account
* Person
* Device

You can use our API to create and retrieve device registrations using the following service:

* **Device Registration** - used to associate a device with a person. Through this registration, it will be possible to perform device validations for future access by this same person.

## Environments

We have two environments for our clients. The base URLs for the APIs are:

* Production - `https://api.caas.qitech.app/device_manager/`
* Sandbox - `https://api.sandbox.caas.qitech.app/device_manager/`

:::danger Important Notice!
Real data of natural and/or legal persons must not be used in QI Tech Sandbox environments.
:::

In the Sandbox environment, submitted analyses are not charged and are responded to according to the rule configured for the event.

## HTTPS Only

For security reasons, all communication with QI Tech APIs must be performed using the HTTPS protocol. To ensure data security, this server only makes port 443 available with TLS 1.2 communication. Calls made using other protocols will be automatically denied.

## Need Help?

We value close contact with our partners. Contact our support and we will respond as quickly as possible.

### We Love Feedback

Your feedback is essential for the evolution of our documentation. If you find any inconsistency, typo, or have suggestions for improvement, send us an email. This way, we make integration increasingly practical for all developers.

---

# Person Object

URL: /en/documentation/caas/device_manager/person

An account may have more than one user accessing it; therefore, each user must have their own registration to segregate actions in joint accounts. The information cited below must follow the established standards, but any fields may be added to the account data if necessary.

## Person Object Definition

Request Body

```json
{
  "person_id": "12345678",
  "document_number": "111.111.111-11",
  "registration_date": "2019-12-11T11:37:15.12-03:00",
  "person_data": {
    "name": "Joao da Silva",
    "email": "person@email.com",
    "phone": {
      "number": "999999999",
      "international_dial_code": "55",
      "area_code": "11"
    }
  }
}
```

All information exchanges regarding a person use the following definition for this object. In some cases, to facilitate implementation and reduce data flow between parties, some information may be omitted.

nome | tipo | descrição
:----: | :----: | ---------
person_id | string | Person identifier. **It is essential that this number be unique for each person** *(mandatory)*
document_number | string | Document number, which can be CPF or CNPJ with punctuation.
registration_date | datetime | Date and time of the person's registration associated with the account, with timezone. *(mandatory)*
person_data | object | Object that may contain any data regarding the person. However, if it contains the name `name`, email `email`, and phone `phone` (with phone being an object containing `number`, `international_dial_code`, and `area_code`), all cited objects must be of the string type.

## Create a Person

Request Body

```json
  {
    "person_id": "12345678",
    ...
  }
```

Response Body

```json
  {
    "person_id": "12345678",
    "document_number": "111.111.111-11",
    "registration_date": "2019-12-11T11:37:15.12-03:00",
    "person_data": {
      "name": "Joao da Silva",
      "email": "person@email.com",
      "phone": {
        "number": "999999999",
        "international_dial_code": "55",
        "area_code": "11"
      }
    }
  }
```

To create a person, simply send a Person type object to the following endpoint:

`POST https://api.caas.qitech.app/device_manager/account/{account_id}/person`

---

# Consult and Deactivate Entities

URL: /en/documentation/caas/device_manager/query_registration

## Retrieve specific Device

To retrieve a specific Device, simply perform a GET request. The returned result is the most up-to-date JSON of the Device in question. If this identifier is not related to any object, HTTP Status 404 is returned.

`GET https://api.caas.qitech.app/device_manager/account/{account_id}/person/{person_id}/device/{device_id}`

```shell
curl "[https://api.caas.qitech.app/device_manager/account/](https://api.caas.qitech.app/device_manager/account/){account_id}/person/{person_id}/device/{device_id}"
  -H "Authorization: EXAMPLE-OF-API-KEY"
```

## List Devices

To retrieve multiple devices, simply perform a GET request. The returned result is a JSON with a list of basic information for all of a user's devices.

`GET https://api.caas.qitech.app/device_manager/account/{account_id}/person/{person_id}/devices`

```shell
curl "https://api.caas.qitech.app/device_manager/account/{account_id}/person/{person_id}/devices"
  -H "Authorization: EXAMPLE-OF-API-KEY"
```

## Deactivate specific Device

To deactivate a specific Device, simply perform a DELETE request. If this identifier is not related to any object, HTTP Status 404 is returned. Once a device is deactivated, it can no longer be validated.

`DELETE https://api.caas.qitech.app/device_manager/account/{account_id}/person/{person_id}/device/{device_id}`

```shell
curl -X DELETE "https://api.caas.qitech.app/device_manager/account/{account_id}/person/{person_id}/device/{device_id}" \
  -H "Authorization: EXAMPLE-OF-API-KEY"
```

## Retrieve specific Account

Allows retrieving data for an account by its identifier. Returns the account details, or 404 if it does not exist.

`GET https://api.caas.qitech.app/device_manager/account/{account_id}`

```shell
curl "https://api.caas.qitech.app/device_manager/account/{account_id}" \
  -H "Authorization: EXAMPLE-OF-API-KEY"
```

## Retrieve specific Person

Allows retrieving data for a specific person within an account. Returns the updated person data, or 404 if it does not exist.

`GET https://api.caas.qitech.app/device_manager/account/{account_id}/person/{person_id}`

```shell
curl "https://api.caas.qitech.app/device_manager/account/{account_id}/person/{person_id}" \
  -H "Authorization: EXAMPLE-OF-API-KEY"
```

---

## Deactivate Account

Performs the deactivation of an account. Once deactivated, the account can no longer be used for registering or validating devices.

`DELETE https://api.caas.qitech.app/device_manager/account/{account_id}`

```shell
curl -X DELETE "https://api.caas.qitech.app/device_manager/account/{account_id}" \
  -H "Authorization: EXAMPLE-OF-API-KEY"
```

## Deactivate Person

Performs the deactivation of a person within an account. Once deactivated, the person can no longer register or validate devices.

`DELETE https://api.caas.qitech.app/device_manager/account/{account_id}/person/{person_id}`

```shell
curl -X DELETE "https://api.caas.qitech.app/device_manager/account/{account_id}/person/{person_id}" \
  -H "Authorization: EXAMPLE-OF-API-KEY"
```

---

# Standards

URL: /en/documentation/caas/device_manager/standards

To facilitate integration and ensure information integrity, several standards have been defined and are followed throughout the API.

## Monetary Values
> Examples:

```
10000
12345
98741
1223
1
0
```

The APIs assume that all monetary values sent are in Brazilian Reais. Values must be sent as integers representing cents.

## Date and Time with Timezone
> Some examples:

```
2019-10-15T22:35:12.232-03:00
2018-05-01T13:32:11.297+00:00
2019-05-01T00:00:00.000+00:00
```

It is represented according to ISO 8601. In this case, the timezone is placed immediately after the time and must represent the timezone of the location where that data will be valid.

The mask used for validation is as follows:

`YYYY-MM-ddThh:mm:ss.sss±hh:mm`

## Date and Time without Timezone
> Some examples:

```
2019-10-15T22:35:12
2018-05-01T13:32:11
2019-05-01T00:00:00
```

It is represented according to ISO 8601. Data that is independent of timezone must be sent with a Z at the end, indicating UTC. The following format will be validated:

`YYYY-MM-ddThh:mm:ss.sssZ`

## Date
> Some examples:

```
2019-10-15
2019-01-01
2017-03-20
```

In the case of fields that receive only the date, without any time, it must be sent in the following format:

`YYYY-MM-dd`

## Documents
Since document numbers are quite varied and many of them contain characters that do not qualify as numeric, all document numbers are defined as strings. Another good reason to define them as strings is to prevent leading zeros from disappearing. Documents provided on this page have a well-defined mask and will be subject to validation. The remaining documents, such as RG (General Registration), given their lack of standardization, will not be validated.

## CPF

> Examples of valid CPFs against the defined mask:

```
123.456.789-12
321.987.543-23
111.283.333-00
```

> Examples of invalid CPFs against the defined mask:

```
8.577.477-8
08.104.627/0001-23
123.456.789-1
23.456.789-01
```

The CPF is always defined as a string and will be validated against the mask:

`###.###.###-##`

## CNPJ

> Examples of valid CNPJs against the defined mask:

```
08.104.627/0001-02
01.079.210/0114-67
32.402.502/0001-35
```

> Examples of invalid CNPJs against the defined mask:

```
8.577.477-8
123.456.789-12
321.987.543-23
32.402.502/0001-3
032.402.502/0001-3
```

The CNPJ is always defined as a string and will be validated against the mask:

`##.###.###/####-##`

## IP

> Examples of valid IPs against the defined mask:

```
201.81.161.86
201.081.161.86
201.81.161.086
201.81.0.1
```

> Examples of invalid IPs:

```
201.81..86
358.81.161.86
201.81.161
```

IPs must always be sent in IPv4; leading zeros may or may not be sent, respecting the following mask:

`###.###.###.###`

---

# Status Dynamics

URL: /en/documentation/caas/device_manager/status_dynamics

The analysis process consists of sending an event, such as Device Validation, to the appropriate endpoint and waiting for the response.

After QI Tech performs the event analysis, it will return a response with a status referring to the analysis. The **analysis_status** field represents the result of the event analysis performed by QI Tech.

### **analysis_status**

As previously described, QI Tech has three **analysis_status** values that indicate the decision status of the analysis engine and operates according to the following state machine:

analysis_status | Description
:---------: | ---------
automatically_approved | QI Tech algorithms recommend that this event be approved.
automatically_reproved | QI Tech algorithms recommend that this event be rejected.
pending | Queries are taking longer than expected. This event has been queued for automatic analysis and will be processed as soon as possible.

---

# Library Compatibility

URL: /en/documentation/caas/device_scan/android/compatibility

| Setting | Minimum Version |
|------------|--------------|
|minSdkVersion|21|

---

# The DeviceScan Object

URL: /en/documentation/caas/device_scan/android/device_scan_object

To use DeviceScanSDK, you must instantiate the DeviceScan class. This instance receives currentContext and can be configured with token/session, environment, and an optional callback (notifier).

:::danger Important Reminder!
Starting from version 5.0.0, the authentication system was updated to use a temporary **token** instead of **mobileToken**.
:::

## Versão 5.0.0+

| Parameter | Purpose | Required |
|------------|--------------|--------------|
|currentContext|The application context, used to access required data. |Yes.|
|token (via .setToken(this.token))| Temporary authentication token that identifies that the collected data comes from your application. The token is obtained by making a request to the Device Scan API. |Yes.|
|sessionId (via .setSessionId(this.sessionId))|Session identifier from which the collected data originates. |Yes.|
|notifier (via .setNotifier(this.deviceScanNotifier))|An instance of `DeviceScanNotifier`. Works as a callback, returning the delivery status (success or failure). |No.|
|sandbox (via .setSandboxEnvironment())|Configures the library to send data to the `sandbox` environment. If not set, requests are sent to `production`. |No.|

 **Default environment**: if `setSandboxEnvironment()` is not called, requests are sent to `production`. 

## Earlier Versions (up to 4.x)

| Parameter | Purpose | Required |
|------------|--------------|--------------|
|currentContext|The application context, used to access required data. |Yes.|
|mobileToken (via .setMobileToken(this.mobileToken))|Customer key that identifies that the collected data comes from your application. If you have not yet received your **mobile-token**, contact support at: <a href='mailto:suporte.caas@qitech.com.br'>suporte.caas@qitech.com.br</a>.|Yes.|
|sessionId (via .setSessionId(this.sessionId))|Session identifier from which the collected data originates. |Yes.|
|notifier (via .setNotifier(this.deviceScanNotifier))|An instance of `DeviceScanNotifier`. Works as a callback, returning the delivery status (success or failure).|No.|
|sandbox (via .setSandboxEnvironment())|Configures the library to send data to the `sandbox` environment. If not set, requests are sent to `production. |No.|

## Quick Summary (Migration)
- 5.0.0+: use a temporary `token` (`setToken(this.token)`)
- < 5.0.0: use `mobileToken` (`setMobileToken(this.mobileToken)`)
- In both: `currentContext` and `sessionId` are required. `notifier` and `sandbox` are optional.

---

# Implementation

URL: /en/documentation/caas/device_scan/android/example

:::danger Aviso Importante!
Starting from version 5.0.0, the authentication system has been updated to use a dynamic **token** instead of **mobileToken**. Before configuring the SDK, you must generate a temporary **token** through a server-to-server request to our Device Scan API.
:::

```java
package com.example.zaig_device_scan_sdk_test_app;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.View;

import com.qitech.android.devicescan.DeviceScan;
import com.qitech.android.devicescan.DeviceScanNotifier;

import java.util.ArrayList;

public class MainActivity extends AppCompatActivity {
    private DeviceScan deviceScan;
    private DeviceScanNotifier deviceScanNotifier;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        deviceScanNotifier = new DeviceScanNotifier(this);
    }

    public void sendDeviceScan(View view) {
        try{
            deviceScan = new DeviceScan.Builder(this.getApplicationContext())
                .setToken(this.token)
                .setSessionId(this.sessionId)
                .setNotifier(this.deviceScanNotifier)
                .setSandboxEnvironment()
                .build();
        }catch (Exception ex) {
            Log.e("DeviceScan Error", "There was an error collecting DeviceScan data: " + ex.toString());
        }
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults){
        try{
            deviceScan.collectData(this.documentNumber,
                    this.eventId,
                    this.eventType);
        }catch (Exception ex) {
            Log.e("DeviceScan Error", "There was an error collecting DeviceScan data: " + ex.toString());
        }
    }

    private class ScanNotifier implements DeviceScanNotifier {
        AppCompatActivity activity;
        public ScanNotifier (AppCompatActivity myActivity){
            // This method is customizable and can be used to store the Activity, which is used to operate the UI
            this.activity = myActivity;
        }

        public void onSuccess(){
            Log.i("DeviceScan", "DeviceScan successfully submitted");
            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    // Add here any UI changes that are required after the device scan is sent successfully
                }
            });
        }

        public void onError(){
            Log.i("DeviceScan", "DeviceScan submission failed");
            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    // Add here any UI changes that are required after the device scan is sent successfully
                }
            });
        }
    }
}

```

To use the Android device scan SDK, the following steps are required: 

* Add the required permissions to the application's manifest;
* Import the library into the application project;
* When starting the application, instantiate the library, passing the appropriate parameters in its constructor, including the Notifier, responsible for providing the operation callback with the result;
* Use the Activity’s `onRequestPermissionsResult` function to be notified of whether the required permissions were approved or not;
* Request permissions from the user. Internet access permission is mandatory for the library to work;
* Once you are notified of whether permissions were approved or not, collect and send the data using the `collectData` method.

---

# Hybrid Solutions

URL: /en/documentation/caas/device_scan/android/hybrid_solutions

In addition to offering native integration in Java, our SDKs are also compatible with several cross-platform frameworks. This is made possible through the integration of native plugins tailored to each framework. By leveraging each solution’s native layer, it is possible to incorporate our native Android SDK.

Some of the most widely used cross-platform technologies include React Native ([Native Modules](https://reactnative.dev/docs/turbo-native-modules-introduction)), Cordova ([Plugin Development Guide](https://cordova.apache.org/docs/en/latest/guide/hybrid/plugins/index.html)), Ionic ([Native](https://ionicframework.com/docs/v3/native/)), Unity ([Native Plug-in para Android](https://docs.unity3d.com/Manual/PluginsForAndroid.html)), Xamarin ([Native Libraries](https://learn.microsoft.com/en-us/xamarin/android/platform/native-libraries)), Appcelerator, Phonegap and Node.

To simplify the integration process with our native solutions, we provide plugins for the React Native and Flutter frameworks. If you’re interested, we can provide the documentation and an integration example in our private repositories. For the other cross-platform technologies, we also have a few examples showing how to implement this bridge with the native code. Feel free to contact our support suporte.caas@qitech.com.br to request access.

---

# Information Gathering

URL: /en/documentation/caas/device_scan/android/information_gathering

To trigger data collection and submission, you must (after obtaining the user’s permissions) call the `collectData`. method. In addition to capturing device information, this method is intended to map the customer journey within the application. For this reason, it also accepts the `eventId` and `eventType` fields. The method takes the following parameters:

name | type | definition
---- | ---- | ---------
documentNumber | String | The user’s document number, if available (CPF/CNPJ without dots, dashes, or slashes)
eventId | String | An identifier for the event being reported
eventType | String | An enumerated value that defines the type of event being reported. Take care to ensure that very similar events are reported with the same enum value, so that intelligence can be built on top of this data.

After the data collection call, one of the two methods on the `DeviceScanNotifier` instance passed into the `DeviceScan` constructor will be called: `onSuccess` if all goes as expected, or `onError` if an error occurs.

---

# Introduction

URL: /en/documentation/caas/device_scan/android/introduction

Welcome to the QI Tech Android Device Scan integration manual! You should use our SDK to collect device information and user behavior data in your application and, in doing so, improve the accuracy of decision-making.

## Having Issues?

We’re not a company that hides behind an API. Get in touch with our [support](mailto:suporte.caas@qitech.com.br) and we’ll respond as quickly as possible. Feel free to call us if you need a faster response!

### We love Feedback

Even if you’ve already solved your issue, or if it’s very simple (even a typo or a poorly organized section), please send us an email. This helps us make the documentation more and more practical, so the next person won’t have to go through the same pain.

## Environments

We provide two environments for our customers. The selection is made through an enum passed into the SDK constructor. Currently, the following environments are available:

* Produção - `production`
* Sandbox - `sandbox`

:::danger Important Note!
Real personal and/or business data must not be used in QI Tech’s Sandbox environments.
:::

---

# Native Integration

URL: /en/documentation/caas/device_scan/android/native_java

To import our SDKs, you must make changes to the project and app build.gradle files.

## Adding it to the Project

Add the URL of our Maven repository to the project’s build.gradle (in Android Studio, this file appears as “Project: \{project_name\}”), as shown below:

```java
buildscript {
    ...
}

allprojects {
    repositories {
        ...
        maven { url 'https://sdks.qitech.com.br/' }
    }
}
```

## Adding it to the App
Next, add the library you want to import to the app’s build.gradle (in Android Studio, this file appears as **“Module: \{project_name\}.app”**), including the dependency below:

```java
dependencies {
    ...
    implementation 'com.qitech.android:devicescan:v6.0.0'
}
```

:::warning
Since **April 2025**, new Google Play policies require **Android API Level 35** for apps to be published or updated on the Google Play Store. Therefore, we strongly recommend using **targetSdkVersion 35** at minimum.
:::

:::info
Using **targetSdkVersion 35** implies using **compileSdkVersion 35**, which in turn triggers some minimum **requirements** for Android ecosystem tools:
* compileSdkVersion 35 --> AGP 8.6.0
* AGP 8.6.0 --> Gradle 8.7
* AGP 8.6.0 --> Java 17 (JDK 17)
* AGP 8.6.0 --> Kotlin 2+
:::

## Manifest File

To use the SDK, you must add the following configuration to your application’s AndroidManifest.xml:

```java
<meta-data
            android:name="com.google.android.gms.ads.AD_MANAGER_APP"
            android:value="true"/>
```

You must also add at least the Internet permission, which is used to send the collected data to QI Tech’s servers:

` `

The list of permissions must be adjusted according to your needs.

---

# Permissions

URL: /en/documentation/caas/device_scan/android/permissions

The SDK collects device data according to the permissions available at the time of collection: the more permissions your app requests and the user grants, the more information can be collected.

:::info **Atenção**

The INTERNET permission is required so the SDK can send information to QI Tech’s servers.
:::

## Permissions used by the SDK

Na versão atual do SDK, as permissões abaixo podem ser utilizadas, caso estejam disponíveis:

| Permissão | Função | Obrigatória |
|------------|--------------|--------------|
|INTERNET|Sends information to QI Tech’s servers.| Yes. |
|BLUETOOTH|Collects information about Bluetooth hardware.| No. |
|BLUETOOTH_CONNECT|Collects Bluetooth connection information.| No. |
|READ_CONTACTS|Reads the contacts list.| No. |
|ACCESS_COARSE_LOCATION|Accesses network information (cell tower, carrier, etc.) and derives location through it (less accurate).| No. |
|ACCESS_FINE_LOCATION|Accesses GPS location (more accurate).| No. |
|READ_PHONE_STATE|Network, SIM, IMEI, and other telephony-related information.| No. |
|QUERY_ALL_PACKAGES|Information about installed apps on the device (required for devices running Android 11 or higher).| No. |

:::info **Important**

Our SDK does not request the permissions listed above. Therefore, to ensure a more complete device scan, we recommend requesting and obtaining these permissions before calling the device scan.
:::

:::info **Attention**

The QUERY_ALL_PACKAGES permission may cause friction with Google Play during app release. To address this, you can provide a justification for requesting this permission.
:::

---

# Authentication

URL: /en/documentation/caas/device_scan/api/authentication

:::danger Aviso Importante!
Starting from version 5.0.0 of the iOS and Android SDKs, the authentication system has been updated to use a temporary token instead of mobileToken.
:::

We use an API Key to allow access to our API. It was likely sent to you by email. If you haven’t received your key yet, email suporte.caas@qitech.com.br .

## Temporary authentication token

Before configuring the SDK, you must generate a temporary token by making a server-to-server request to our API.

### Generate token

```bash
curl -X POST "https://d.viewpkg.com/device_scan/token" \
     -H "Authorization: EXAMPLE_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{ "session_id": "unique_session_identifier" }'
```

**Endpoints**

| Environment | URL |
|----------|-----|
| Sandbox | https://d.sandbox.viewpkg.com/device_scan/token |
| Produção | https://d.viewpkg.com/device_scan/token |

**Request Details**

| Field | Type | Required | Description|
|-------|------|------------|---------|
| session_id | string | Yes | Unique session identifier generated by your system (e.g., UUID). |

**Request Body**
```json
{
  "session_id": "unique_session_identifier" (Obrigatório)
}
```

**Response Body**

A successful response will include the `token` field.
```json
{
  "token": "eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6..."
}
```

:::info Attention
You must replace EXAMPLE_API_KEY with the API Key provided by support.
:::

---

# Library Compatibility

URL: /en/documentation/caas/device_scan/flutter/compatibility

| Setting | Minimum version |
|------------|--------------|
|Flutter|3.3.0|
|Dart SDK|3.2.3|
|iOS|15.5|
|minSdkVersion (Android)|23|

---

# The QitechDeviceScan object

URL: /en/documentation/caas/device_scan/flutter/device_scan_object

:::danger Important Note!
As of version 1.0.0, the authentication system has been updated to use a temporary **token** instead of **mobileToken**. The token is obtained by making a server-to-server request to the Device Scan API.
:::

## Request

To use the Device Scan plugin, you must call the `startDeviceScan` method, which has the following parameters:

## Version 1.0.0+

| Parameter | Type | Purpose | Required |
|------------|--------------|--------------|--------------|
|token|String|Temporary authentication token obtained by making a request to the Device Scan API. Must be generated using the same `sessionId` passed to this method.|Yes.|
|environment|CaaSEnvironment|Enum used to configure the runtime environment as `sandbox` or `production`.|Yes.|
|sessionId|String|Key that identifies the session from which the collected data originates. **Must be sent in lowercase.**|Yes.|
|eventType|String|An enum that defines the type of event being reported — care is requested so that very similar events are reported with the same enum, so that intelligence can be built on top of this data.|Yes.|
|eventId|String|An identifier of the event being reported.|Yes.|
|documentNumber|String?|The user's document number, if available. (CPF/CNPJ without dots, dashes, and slash). Can be omitted.|No.|

## Previous Versions (up to 0.x)

| Parameter | Type | Purpose | Required |
|------------|--------------|--------------|--------------|
|mobileToken|String|Customer key that identifies that the collected data comes from your application. If you have not yet received your mobile-token, contact <a href='mailto:suporte.caas@qitech.com.br'>support</a>.|Yes.|
|environment|CaaSEnvironment|Enum used to configure the runtime environment as `sandbox` or `production`.|Yes.|
|sessionId|String|Key that identifies the session from which the collected data originates. **Must be sent in lowercase.**|Yes.|
|eventType|String|An enum that defines the type of event being reported — care is requested so that very similar events are reported with the same enum, so that intelligence can be built on top of this data.|Yes.|
|eventId|String|An identifier of the event being reported.|Yes.|
|documentNumber|String?|The user's document number, if available. (CPF/CNPJ without dots, dashes, and slash). Can be omitted.|No.|

## Quick Reference (Migration)
- 1.0.0+: use temporary `token` obtained via API (`token: token`)
- '`)
- In both: `environment`, `sessionId`, `eventType`, and `eventId` are required. `documentNumber` is optional.

## Return value

The method returns a String to indicate success or failure during information collection:

### Success

```javascript
Success collecting device scan data
```

### Error

```javascript
Device Scan fail. Check token, environment and permissions
```

---

# Implementation

URL: /en/documentation/caas/device_scan/flutter/example

## Prerequisite for startDeviceScan

The `startDeviceScan` method requires a `token`. This token is temporary and must be generated on your backend by making a server-to-server request to our API before you call the SDK method.

**Endpoint Details:**

- **Method:** POST
- **Path:** `/device_scan/token`
- **Sandbox URL:** `https://d.sandbox.viewpkg.com/device_scan/token`
- **Production URL:** `https://d.viewpkg.com/device_scan/token`

**Headers:**

```json
{
  "Authorization": "YOUR_DEVICE_SCAN_API_KEY"
}
```

**Body:**

```json
{
  "session_id": "unique_session_id"
}
```

The successful response from this API will contain the `token` that you must pass to the `startDeviceScan` method.

:::note
The device scan method can be executed asynchronously. Therefore, there is no need to block the main thread to wait for this method to resolve. The user can interact normally with the app while the device scan is being processed in the background.
:::

:::note
We recommend that the device scan method is executed as early as possible. Since it may need more time to collect all data, this early call is recommended so that the most complete device information is extracted.
:::

---

```dart

import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart' as http;
import 'package:qitech_device_scan/qitech_device_scan.dart';

final _qitechDeviceScanPlugin = QitechDeviceScan();

// Step 1: Generate the temporary token via a server-to-server request
Future<String?> fetchDeviceScanToken(String sessionId) async {
  final response = await http.post(
    Uri.parse('<DEVICE_SCAN_API_URL>'),
    headers: {
      HttpHeaders.authorizationHeader: '<API_KEY>',
      HttpHeaders.contentTypeHeader: 'application/json',
    },
    body: jsonEncode({'session_id': sessionId}),
  );

  if (response.statusCode == 200) {
    final data = jsonDecode(response.body);
    return data['token'] as String?;
  }
  return null;
}

// Step 2: Initialize the SDK with the obtained token
final sessionId = '<SESSION_ID>';
final token = await fetchDeviceScanToken(sessionId);

if (token == null) {
  print('Failed to fetch device scan token');
  return;
}

final result = await _qitechDeviceScanPlugin.startDeviceScan(
    token: token,
    environment: CaaSEnvironment.sandbox,
    sessionId: sessionId,
    eventType: '<EVENT_TYPE>',
    eventId: '<EVENT_ID>',
);

print('Device Scan result: $result');

```

## Flutter Setup

To use the device scan plugin, the following steps are required:

### Installation

First, run the following command to install the plugin:

```bash
flutter pub add qitech_device_scan
```

The command should install the latest version, which can be checked in your `pubspec.yaml` file:

```yaml
dependencies:
  qitech_device_scan: ^1.0.0
  http: ^1.0.0
```

### Import

Now, just import the package to start using it:

```dart
import 'package:qitech_device_scan/qitech_device_scan.dart';
```

## Android Setup

Add the Qi Tech Android repository reference in your `build.gradle` file:

```gradle
allprojects {
    repositories {
        maven { url 'https://sdks.qitech.com.br/' }
        ...
    }
}
```

Initialize the AdMob service by adding the following code to your `AndroidManifest.xml`:

```xml
<meta-data
    android:name="com.google.android.gms.ads.APPLICATION_ID"
    android:value="<ADMOB_APP_ID>"/>
```

If you do not have an ADMOB_APP_ID, contact suporte.caas@qitech.com.br .

## iOS Setup

Add the Qi Tech iOS repository reference in your `Podfile`:

```ruby
source 'https://cdn.cocoapods.org/'
source 'https://github.com/QITechSDKs/iOS.git'
```

Install dependencies directly via CocoaPods:

```bash
cd ios
pod install
```

or via Flutter:

```bash
flutter build ios
```

---

# Introduction

URL: /en/documentation/caas/device_scan/flutter/introduction

Welcome to the QI Tech Device Scan integration manual for Flutter! You should use our Plugin to collect information from the phone and user behavior in your application, thus improving the accuracy of decisions.

## Having issues?

We are not a company that hides behind an API! Contact our [support](mailto:suporte.caas@qitech.com.br) and we will respond as quickly as possible. Feel free to call us if you want a quick response!

## We love feedback

Even if you have already solved your problem or if it is very simple (even a typo or poor organization that you already understood), send us an email—this way we make the documentation more and more practical and the next person won’t have to suffer the pains you suffered!

## Environments

We have two environments for our customers. The selection is made through an enum passed as a parameter in the plugin call. At the moment, the following environments are available:

* Production - `production`
* Sandbox - `sandbox`

:::danger Important Note!
Real personal and/or business data must not be used in QI Tech’s Sandbox environments.
:::

---

# Permissions

URL: /en/documentation/caas/device_scan/flutter/permissions

The plugin collects the user’s device data according to the permissions available at the time of collection: the more permissions your application requires and the user grants, the more information is collected from the user’s device.

:::info **Attention**

The INTERNET permission is required so the SDK can send information to QI Tech’s servers.
:::

## Permissions used by the plugin

:::info **Important**

Our plugin does not request the permissions described. Therefore, to ensure a more complete device scan, we recommend obtaining these permissions before calling the device scan.
:::

### Android

For the Android platform, the following permissions are used if available:

| Permission             | Purpose                                                                                             | Required |
| ---------------------- | --------------------------------------------------------------------------------------------------- | -------- |
| INTERNET               | Required to send information to QI Tech’s servers.                                                  | Yes.     |
| BLUETOOTH              | Captures Bluetooth hardware information.                                                            | No.      |
| BLUETOOTH_CONNECT      | Captures Bluetooth connection information.                                                          | No.      |
| READ_CONTACTS          | Reads the contacts list.                                                                            | No.      |
| ACCESS_COARSE_LOCATION | Accesses network information (cell tower, carrier...) and location via this method (less accurate). | No.      |
| ACCESS_FINE_LOCATION   | Accesses location via GPS (more accurate).                                                          | No.      |
| READ_PHONE_STATE       | Network, SIM, IMEI, and other telephony-related information.                                        | No.      |
| QUERY_ALL_PACKAGES     | Information about installed apps on the device. Required for Android 11+ devices.                   | No.      |

:::info **Attention**

The QUERY_ALL_PACKAGES permission may cause friction with Google Play during app release. To address this, you can describe the reason for requesting the permission.
:::

### iOS

For the iOS platform, the following permissions are used if available:

* location - Captures device geolocation data

#### Info.plist file

The first step to enable permissions for the plugin is to configure the permission in the app’s Info.plist file, using the following line of code for each desired permission:

* location - Captures device geolocation data:

` NSLocationWhenInUseUsageDescription `
` Add the message you want to show the user when iOS requests permission to access geolocation `

:::info **Attention**

To improve the user experience when requesting permissions, you should customize the message shown in the permission request pop-up as described above.
:::

---

# The QITechIosDeviceScan object

URL: /en/documentation/caas/device_scan/ios/device_scan_object

To use QI Tech’s iOS DeviceScan, you must import the QITechIosDeviceScan framework and then instantiate the QITechIosDeviceScan class, which has the following constructor parameters:

:::danger Important Note!
Starting from version 5.0.0, the authentication system was updated to use a temporary **token**instead of **mobileToken**.
:::

## Version 5.0.0+

| name        | type   | description |
| ----------- | ------ | ---- |
| environment | String | An environment enum where the application is running — `sandbox` or `production`. If a different value is sent, an exception will be thrown. **required**|
| token| String | Authentication token that identifies that the collected data comes from your application. Obtained through a request to the Device Scan API. **required**|
| sessionId   | String | Session identifier (**must be the same used to generate the token**) which will also be sent at the moment of the event evaluation (Transaction, Onboarding, for example), to correlate the device scan data with the event to be evaluated. **required** |

## Previous versions

| name        | type   | description |
| ----------- | ------ | --- |
| environment | String | An environment enum where the application is running — `sandbox` or `production`. If a different value is sent, an exception will be thrown. **required** |
| mobileToken | String | Customer key sent by QI Tech support that identifies that the collected data comes from your application. For security reasons, if this key is incorrect, QI Tech servers will receive the call but will not process it. **required** |
| sessionId   | String | Session identifier, which will also be sent at the moment of the event evaluation (Transaction, Onboarding, for example), to correlate the device scan data with the event to be evaluated. **required**|

---

# Implementation

URL: /en/documentation/caas/device_scan/ios/example

:::danger Important Note!
Starting from version 5.0.0, the authentication system was updated to use a dynamic **token** instead of **mobileToken**. Before configuring the SDK, you must generate a temporary **token** through a server-to-server request to our Device Scan API.
:::

```swift
import UIKit
import QITechIosDeviceScan

class ViewController: UIViewController {

    var qitechDeviceScan : QITechIosDeviceScan?

    override func viewDidLoad() {
        super.viewDidLoad()
        self.setupDeviceScan()
    }

    func setupDeviceScan() -> Void
    {
        // The environment can be 'sandbox' ou 'production'
        let environment = "sandbox"

        // MobileToken is the key sent to you by QI Tech. Each environment requires a different MobileToken.
        let token = "TEMPORARY_TOKEN_FROM_DEVICE_SCAN_API"

        // You must send the same session id in the moment of using the device scan and event analysis. It must be a key that uniquely identifies each user session in the app
        let sessionId = "62715840-068a-4ded-a4e2-a1ec83f857d4"

        do{
            self.qitechDeviceScan = try QITechIosDeviceScan(environment: environment, token: token, sessionId: sessionId)
        }
        catch{
            print ("Error found when instantiating QITech's DeviceScan")
        }

        let permissions = ["location"]

        do{
            try self.qitechDeviceScan?.requestPermissions(permissions: permissions)
        }
        catch{
            print ("Error found when requesting QITech's DeviceScan's permissions")
        }
    }

    func onSuccess()
    {
        // Do something if QI Tech DeviceScan's collectData method succesfully collected device data
    }

    func onError()
    {
        // Do something if QI Tech DeviceScan's collectData method found any error when collecting device data
    }

    func collectQITechDeviceScanData()
    {
        // If you have your customer's document number (CPF or CNPJ without dots, hyphen or slash), you must sent it to QI Tech
        let documentNumber = "12345678900"

        // EventType must represent with type of interation the user had with your app on the moment that collectData method was called
        let eventType = "login"

        // EventId is your code that identifies the event sent to QI Tech
        let eventId = "7038632032"

        do{
            try self.qitechDeviceScan?.collectData(documentNumber: documentNumber, eventId: eventId, eventType: eventType, onSuccessHandler: self.onSuccess, onErrorHandler: self.onError)
        }
        catch{
            print("Error found when collecting QITech's DeviceScan data")
        }
    }
}
```

To use the iOS Device Scan SDK, the following steps are required:

* Add the required permissions to the Info.plist file
* Add the framework to the app project
* When the app starts, instantiate the library with the appropriate parameters
* If your app has not yet requested the permissions from the user, request them through the `requestPermissions` function of the previously instantiated object
* Collect and send the data using the `collectData` method

---

# Hybrid solutions

URL: /en/documentation/caas/device_scan/ios/hybrid_solutions

In addition to offering native integration in Swift, our SDKs are also compatible with several hybrid frameworks. This is possible through the integration of native plugins specific to each of these frameworks. By leveraging each solution’s native system, it is possible to incorporate our native SDK in the iOS environment.

Some of the most widely used hybrid technologies include React Native ([Native Modules](https://reactnative.dev/docs/turbo-native-modules-introduction)), Cordova ([Plugin Development Guide](https://cordova.apache.org/docs/en/latest/guide/hybrid/plugins/index.html)), Ionic ([Native](https://ionicframework.com/docs/v3/native/)), Unity ([Native Plug-in para Android](https://docs.unity3d.com/Manual/PluginsForAndroid.html)), Xamarin ([Native Libraries](https://learn.microsoft.com/en-us/xamarin/android/platform/native-libraries)), Appcelerator, Phonegap and Node.

To simplify the integration process with our native solutions, we provide plugins for the React Native and Flutter frameworks. If you’re interested, we provide the documentation and an integration example in our private repositories. For the other hybrid technologies, we have a few examples of how to implement this bridge to the native code. Feel free to contact our support to request access.

---

# Information gathering

URL: /en/documentation/caas/device_scan/ios/information_gathering

To trigger data collection and submission, you must call the `collectData` method. In addition to capturing device information, the method aims to map the customer journey within the application. For this reason, the method also accepts the `eventId` and `eventType` fields. Another important point is that the method sends the information to QI Tech’s server via an asynchronous HTTP request, and therefore the success or error notification for the request is handled through Completion Handlers. The method has the following parameters:

| name             | type           | description |
| ---------------- | -------------- | ----------- |
| documentNumber   | String         | The user’s document number, if available. (CPF/CNPJ without dots, dashes, and slash)|
| eventId          | String         | An identifier of the event being reported|
| eventType        | String         | An enum that defines the type of event being reported (Example: 'login') — Take care to ensure that very similar events are reported with the same enum, so that intelligence can be built on top of this data |
| onSuccessHandler | func() ‑> Void | Function that will be called if the data is successfully sent to QI Tech’s server **required**|
| onErrorHandler   | func() ‑> Void | Function that will be called if there is an error sending the data to QI Tech’s server **required**|

---

# Introduction

URL: /en/documentation/caas/device_scan/ios/introduction

Welcome to the QI Tech iOS Device Scan integration manual! You should use our SDK to collect device information and user behavior data in your application and, in doing so, improve the accuracy of decision-making.

## Having Issues?

We’re not a company that hides behind an API. Get in touch with our [support](mailto:suporte.caas@qitech.com.br) and we’ll respond as quickly as possible. Feel free to call us if you need a faster response!

### We love Feedback

Even if you’ve already solved your issue, or if it’s very simple (even a typo or a poorly organized section), please send us an email. This helps us make the documentation more and more practical, so the next person won’t have to go through the same pain.

## Environments

We provide two environments for our customers. The selection is made through an enum passed into the SDK constructor. Currently, the following environments are available:

* Produção - `production`
* Sandbox - `sandbox`

:::danger Important Note!
Real personal and/or business data must not be used in QI Tech’s Sandbox environments.
:::

---

# Native integration

URL: /en/documentation/caas/device_scan/ios/native_swift

## Remotely

> Starting the installation

```shell
  pod init
```

Our SDK can be imported using CocoaPods.

SDK | Current version
---- | -----
QITechIosDeviceScan | `pod 'QITechIosDeviceScan', '~> 6.0.0'`

:::info iOS Minimum Deployment Target
15.5
:::

To start the installation, run the command shown above in the root folder of your project.

> Adding the source to the Podfile

```ruby
   source 'https://github.com/QITechSDKs/iOS.git'
```

The next step is to add QI Tech’s source to the `Podfile`.

> Adding the pod to the Podfile

```ruby
  pod 'QITechIosDeviceScan', '~> <version>'
```
Finally, add the `pod` name following the format above.

:::danger Attention: 
Architecture change (v5.0.0+) Starting from version 5.0.0, the SDK started being distributed exclusively in static form. In your Podfile, you must use the configuration :linkage => :static.
:::

> Podfile example (Version 5.0.0 or higher)

```ruby
  source 'https://github.com/QITechSDKs/iOS.git'
  target 'ExampleApp' do
    use_frameworks! :linkage => :static
    pod 'QITechIosDeviceScan', '~> 6.0.0'
  end

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if ['DatadogCore', 'DatadogInternal', 'DatadogCrashReporting', 'DatadogLogs'].include?(target.name)
        target.build_configurations.each do |config|
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.5'
          config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
        end
      end
    end
  end
```

> Podfile example (Previous versions)

```ruby
  source 'https://github.com/QITechSDKs/iOS.git'
  target 'ExampleApp' do
    use_frameworks!
    pod 'QITechIosDeviceScan', '~> 2.0.0'
  end

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if ['DatadogCore', 'DatadogInternal', 'DatadogCrashReporting', 'DatadogLogs'].include?(target.name)
        target.build_configurations.each do |config|
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.5'
          config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
        end
      end
    end
  end
```

:::info **Attention**

You must enable module stability for the Datadog monitoring dependency to avoid potential compilation issues across different Swift versions. Therefore, add the block described in the post_install section of your Podfile (or include it in the existing post_install block if you already have one).
:::

:::warning Attention
When integrating dependencies on iOS, you may need to use static linkage for some libraries and dynamic linkage for others. This setup is relevant to ensure compatibility, avoid build errors, and optimize project performance.
:::

### Hybrid linkage of dependencies (if needed)

The need for hybrid linkage arises because some libraries have specific requirements: some need static linkage to avoid internal conflicts and symbol duplication, while other dependencies may need dynamic linkage because they are designed for modularity and sharing across projects.

Differences between static and dynamic linkage
* Static (static_framework): The library code is embedded directly into the final binary, reducing runtime loading time and eliminating external dependencies at execution time.
* Dynamic (dynamic_framework): The library is loaded at runtime as a separate file. This reduces the final binary size and makes independent updates/modifications easier.

> Configuring hybrid linkage in the Podfile

```ruby
...

use_frameworks! :linkage => :dynamic # SETTING THE DEFAULT LINKAGE MODE TO DYNAMIC

...

static_frameworks = ['framework_1', 'framework_2', ...] # INCLUDE ALL DEPENDENCIES THAT MUST BE LINKED STATICALY
pre_install do |installer|
  installer.pod_targets.each do |pod|
    if static_frameworks.include?(pod.name)
      def pod.static_framework?;
        true
      end
      def pod.build_type;
        Pod::BuildType.static_framework
      end
    end
  end
end
```

> Installing dependencies

```shell
  pod install
```

Finally, run `pod install` to download and install the dependencies.

---

# Permissions

URL: /en/documentation/caas/device_scan/ios/permissions

The SDK collects device data and, according to how the iOS operating system works, it requires specific permissions for each piece of data to be collected. In order to provide a customized experience for users of an application that has the SDK embedded, we implemented a mechanism that uses the parameters passed by the developer to request permissions from the user, following this flow:

* The permissions sent as parameters to the `requestPermissions` method, as Strings, are requested from the user — unless they have already been requested previously.

* The user, through a dialog provided by the operating system itself, is asked about the permissions considered necessary by the framework.

* The permissions are then granted or denied and, when the `collectData` method is called, it will collect only the data for which permission was granted.

:::info **Attention**

If your app has already requested the required permissions, you do not need to call `requestPermissions` again; the SDK will inherit the permissions requested by the app.
:::

## Permissions used by the SDK

In the current SDK version, the following permissions are used if available:

* location - Captures device geolocation data

## Info.plist file

The first step to enable permissions for the SDK is to configure the permission in the app’s Info.plist file, using the following line of code for each desired permission:

* location - Captures device geolocation data:

` NSLocationWhenInUseUsageDescription `
` Add the message you want to display to the user when iOS requests permission to access geolocation `

:::info **Attention**

To improve the user experience when requesting permissions, you should customize the message shown in the permission request pop-up as described above.
:::

---

# Desktop Device Scan

URL: /en/documentation/caas/device_scan/web/desktop

This is the **Desktop Device Scan**, our complementary *white-label* module for the **Web Device Scan**. You can use our program to collect deep device information and also detect the presence of malicious software.

This software was developed to comply with [BCB Normative Instruction No. 491](https://www.bcb.gov.br/estabilidadefinanceira/exibenormativo?tipo=Instru%C3%A7%C3%A3o%20Normativa%20BCB&numero=491). ogether with Web Device Scan, it is able to generate a unique and reliable identification for each device.

:::warning Attention
Our application is *White Label*! You can use your own logos in the installer, as well as customize the executable name and the displayed messages, making the experience friendlier for your user.
:::

## Usage

In this step-by-step guide, you will find details on how to use the program together with the library, as well as a JavaScript implementation example. This will give you the tools you need to adapt the solution to your use case.

```html
<html>
<head>
    <script src="https://ds.viewpkg.com/device-scan-2-1-1.js"></script>
</head>

<script>
    var deviceScan = new vPkg.DeviceScan('web_token', 'session_id')
    deviceScan.setSandbox()
    deviceScan.setDesktop(true)
    deviceScan.info('event_type', 'event_id')
        .then((res) => console.log(res))
        .catch((error) => console.log(error))
</script>
</html>
```

When using the `deviceScan.setDesktop(true)` flag, the Web SDK will try to detect whether the installed application is present. If it is not installed or if it has issues, you may receive one of the following errors:

| Error                       | Description                                                                                                                                                                                  |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Timeout in Secure App**   | The application is present but is not responding correctly. Reinstall the application to fix the issue.                                                                                      |
| **Invalid desktop data**    | The application was modified or corrupted. Reinstall the application to restore integrity.                                                                                                   |
| **Desktop App Not Present** | The application is not installed. Provide the download link supplied by QI Tech to the user.                                                                                                 |
| **Unexpected App Error**    | An unexpected error occurred while communicating with the application. If the problem persists after reinstalling, contact support: <a href='mailto:suporte.caas@qitech.com.br'>support</a>. |

## Supported Operating Systems

**Desktop Device Scan** is available for the main modern operating systems, offering native compatibility and optimized performance on each platform.

Windows 10/11 x64
macOS Intel (x86_64)
macOS Apple Silicon (M1/M2/M3)

---

# The DeviceScan object

URL: /en/documentation/caas/device_scan/web/device_scan_object

To use the device scan service, you must instantiate the DeviceScan class, which has the following constructor parameters:

| Parameter               | Purpose | Required |
| ----------------------- | ------------------------------------ | -------- |
| `.setSandbox()`         | If this parameter is used in the constructor, the library will be configured to send data to the `sandbox` environment. If omitted, requests are sent to the `production` environment. | No.      |
| `.setGeoLocation(true)` | If this parameter is set to `true`, the library will request permission to collect GPS data. If omitted or set to `false`, geolocation information will not be extracted.              | No.      |

:::info **Attention**
If the user denies access to location data, the library will run normally, but without collecting that information.
:::

## The deviceScan.info() function

To run the user data analysis function, you must send the following parameters to the library. They will identify your company and the user session to which the information belongs. In addition, the event_id and event_type arguments, although optional, help us identify the user’s navigation pattern on your page and therefore prevent fraud even more effectively.

Below are the details for each argument:

| Name       | Type   | Description|
| ---------- | ------ | ----------------------------------- |
| web_token  | String | Customer key that identifies that the collected data comes from your application. If you have not yet received your web-token, contact <a href='mailto:suporte.caas@qitech.com.br'>support</a>. **required** |
| session_id | String | Key that identifies the session from which the collected data originates. **required**|
| event_id   | String | An identifier for the event being reported|
| event_type | String | An enum that defines the type of event being reported — Care is requested so that very similar events are reported with the same enum, so that intelligence can be built on top of this data.|

## Implementation example
A simple implementation example is shown below:

```html
   html>
    <head>
        <script src="https://ds.viewpkg.com/device-scan-2-1-1.js"></script>
    </head>

    <script>
        var deviceScan = new vPkg.DeviceScan('web_token', 'session_id')
        deviceScan.setSandbox()
        deviceScan.setGeoLocation(true)
        async function callDeviceScan(eventType, eventId) {
            await deviceScan.info(eventType, eventId)
            .then((res) => console.log(res))
            .catch((error) => console.log(error))
        }
    </script>

    <body>
        <input id="login" type="button" value="login" onclick="callDeviceScan('login', '1');" />
        <input id="buy" type="button" value="buy" onclick="callDeviceScan('buy', '2');" />
    </body> 
</html>
```

In the example above, a helper function called **callDeviceScan** was created to associate Device Scan usage with a button click. The data collection function can be called twice:

* First, when the user presses the login button, the user’s characteristics and behavior up to that event will be sent to QI Tech’s servers with the identifiers web_token, session_id, event_type ("login"), and event_id ("1").

* Second, when the user presses the buy button, collecting the user’s behavior using the same identifiers web_token (your company) and session_id (your user’s session) but a different event_type ("buy") and event_id ("2"), indicating that a different event has occurred. This maps the entire user journey throughout your website.

---

# Implementation

URL: /en/documentation/caas/device_scan/web/example

```html
   <html>
    <head>
        <script src="https://ds.viewpkg.com/device-scan-2-1-1.js"></script>
    </head>

    <script>
        var deviceScan = new vPkg.DeviceScan('web_token', 'session_id')
        deviceScan.setSandbox()
        deviceScan.setGeoLocation(true)
        deviceScan.info('event_type', 'event_id')
            .then((res) => console.log(res))
            .catch((error) => console.log(error))
    </script>
   </html>
```

The library performs a user analysis through a call to the **.info()** function, which belongs to the **DeviceScan** class, contained in our **vPkg** library, as shown in the example above. The variables web_token, session_id, event_type (**optional**) and event_id (**optional**) must be replaced with **their actual real values**. On success, the library will return a String indicating successful collection; on failure, it will return a String indicating the error type.

---

# Importing the library

URL: /en/documentation/caas/device_scan/web/import

To import our library, add the URL in a **src** tag in your website’s HTML:

```html
    <script src = "https://ds.viewpkg.com/device-scan-2-1-1.js"></script>
```

---

# Collecting the returns

URL: /en/documentation/caas/device_scan/web/information_gathering

The Web Device Scan SDK returns a _Promise_, which will return a **String** indicating the completion of the flow in success cases.
In error cases, it will return a **String** describing the error. Below is an example of how to map each of these cases and retrieve the results:

```html
    <script>
        var deviceScan = new vPkg.DeviceScan('web_token', 'session_id')
        deviceScan.setSandbox()
        deviceScan.setGeoLocation(true)
        deviceScan.info('event_type', 'event_id')
            .then((res) => console.log(res))
            .catch((error) => console.log(error))
    </script>
```

### Success return

| Return                        | Description                                                                                         |
| ----------------------------- | --------------------------------------------------------------------------------------------------- |
| Device Scan Successfully Sent | The device scan was performed successfully, as well as the submission of the extracted information. |

### Error return

| Error                 | Description |
| --------------------- | ----------- |
| Web Token Error       | The web token used is invalid. If you are sure you are using the Web Token provided by QI Tech correctly, contact our support ([suporte.caas@qitech.com.br](mailto:suporte.caas@qitech.com.br)) immediately. |
| Invalid Request       | Device information was not collected correctly.|
| Internal Server Error | An unexpected error occurred; check your internet connection.|

---

# Introduction

URL: /en/documentation/caas/device_scan/web/introduction

Welcome to the QI Tech Web Device Scan integration manual! You should use our SDK to collect device information and user behavior data in your application and, in doing so, improve the accuracy of decision-making.

## Having Issues?

We’re not a company that hides behind an API. Get in touch with our [support](mailto:suporte.caas@qitech.com.br) and we’ll respond as quickly as possible. Feel free to call us if you need a faster response!

### We love Feedback

Even if you’ve already solved your issue, or if it’s very simple (even a typo or a poorly organized section), please send us an email. This helps us make the documentation more and more practical, so the next person won’t have to go through the same pain.

## Environments

We provide two environments for our customers. The selection is made through an enum passed into the SDK constructor. Currently, the following environments are available:

* Produção - `production`
* Sandbox - `sandbox`

:::danger Important Note!
Real personal and/or business data must not be used in QI Tech’s Sandbox environments.
:::

---

# Submitting a Document

URL: /en/documentation/caas/document_analysis/document_submission

## **Submitting a Document for Standard Analysis**

To start document analysis, send a POST request to the `/document` endpoint using the `multipart/form-data` format.

Endpoint: `https://api.caas.qitech.app/document_analysis/document`

**Request Format**

The request must be sent as `multipart/form-data` and include data fields and a file field. The required fields for an analysis are `id`, `document_analysis_type`, and `document_bytes`.

Request example:

``` bash
curl -X POST "https://api.caas.qitech.app/document_analysis/document" \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "id=request-abc-12345" \
-F "document_analysis_type=proof_of_address" \
-F "document_bytes=@/path/to/your/proof.pdf"
```

## **Submission Attributes Description**

| **Attribute** | **Description** |
| --- | --- |
| id (required) | A unique identifier for the request, provided by you. This ID can be used later to retrieve the analysis results. |
| document_analysis_type (required) | A string that specifies the type of analysis to be performed on the document. See the table below for supported types. |
| document_bytes (required) | The document file to be analyzed. Must be sent as a file in the multipart request body. Note: Do not send this field as a base64-encoded string. |
| async (optional, default=false) | A boolean (true or false) that defines the processing mode. <br/>- false (synchronous): The API will attempt to process the document and return the result in the same request. <br/>- true (asynchronous): The API will acknowledge receipt and process in the background. The result will be sent via webhook to a previously configured URL (see more in the webhooks section). |

:::info **Attention**

The async field must be used to indicate an asynchronous request. Synchronous requests should only be used for small documents and quick analyses where an immediate response is critical. If a request takes longer than 30 seconds it will be automatically redirected to a queue, the return status will be `202 Accepted`, and the analysis result will be sent to the previously configured webhook URL (see more in the webhooks section).
:::

## **Supported Analysis Types**

The `document_analysis_type` field determines which data extraction model will be applied to your document. Below are the types currently supported.

| **Analysis Type** | Document Type | **Description** |
| --- | --- | --- |
| company_statute_default | Contract/Articles of Association | Performs basic extraction and validation of articles of association. Extracts general company and partner information. |
| company_statute_credit_assignment | Contract/Articles of Association | Performs advanced extraction of articles of association, including validation of signing authority for credit assignment agreements. |
| proof_of_address_default | Proof of Address (utility bills, gas, internet, government letters, declarations, among others) | Extracts and validates proof of address information, such as postal code, full address, name and date. |
| invoice | Invoices, DANFEs | Extracts key information from invoices, including supplier/customer details, totals and line items. |
| bankslip | Bank Slips | Extracts information from bank slips, such as payee, amount and due date. |
| ccb_default | Bank Credit Notes (CCBs) | Extracts data from Bank Credit Notes. |

For analysis types not listed here, contact our support team at `suporte.caas@qitech.com.br` to inquire about custom implementations.

## **Responses**

### Success Response (`200 OK`)

If the document in a synchronous analysis is processed successfully, the API will return an `HTTP 200 OK` status and a JSON object containing the extracted data. The structure of this JSON object will vary depending on the requested `document_analysis_type`. If the request times out, the API will return an `HTTP 202 Accepted` status and the request will be processed asynchronously. After a short time you can retrieve the document analysis using a GET request, as described below .

### Accepted Response (`202 Accepted`)

If the document is processed asynchronously, the API will return an `HTTP 202 Accepted` status and the request will be processed asynchronously. After a short time you can retrieve the document analysis using a GET request, as described below .

## **Error Response (`4xx`)**

If there is a problem with the request or the document, the API will return a `4xx` status code with a JSON body describing the error.

## Error Code Reference

The following tables list all possible error codes returned by the API. You can use these codes to implement robust error handling in your application.

### **Category 1: Request Errors (DOC001xx)**

| Code | Title | Description |
| --- | --- | --- |
| `DOC00100` | Missing required field | The request does not contain a required field in the `multipart/form-data` body. |
| `DOC00101` | Invalid field length | The length of a value in a `form-data` field is invalid. |
| `DOC00102` | Invalid content type at request | The request `Content-Type` header is not `multipart/form-data`. |
| `DOC00103` | Invalid field at request | The request contains an unexpected or invalid field in the `form-data` body. |

### **Category 2: File Processing Errors (DOC002xx)**

These errors occur when the file itself has issues that prevent its processing.

| Code | Title | Description |
| --- | --- | --- |
| `DOC00200` | Invalid Document Analysis Type | The `document_analysis_type` is not valid for the document sent. (e.g. a `company_statute_default` analysis from a utility bill.) |
| `DOC00201` | Invalid File Size | The size of the document sent exceeds the maximum allowed limit. |
| `DOC00202` | Invalid File Type | The file could not be processed due to inconsistencies in its type or format (e.g. a `.jpg` file was sent with type `application/pdf`). |
| `DOC00203` | PDF exceeds page limit | The provided PDF file contains more pages than the maximum limit allowed for processing (the current limit is 200 pages). |

### **Category 3: Document Analysis Errors (DOC003xx)**

These errors occur during the data extraction and analysis phase, after the file has been successfully opened.

| Code | Title | Description |
| --- | --- | --- |
| `DOC00300` | Missing Information | The document does not contain the essential information required for the analysis to be completed. |
| `DOC00301` | Bad Quality | The document quality (e.g. resolution, legibility, sharpness) is too low to be analyzed accurately. |
| `DOC00302` | Invalid Data | The document contains inconsistent or invalid data (e.g. incorrect checksums, contradictory fields). |
| `DOC00303` | Incorrect Document Type | The document content does not match the expected document type for the selected `document_analysis_type`. |
| `DOC00304` | Invalid PDF File | The provided file is not a valid or well-formed PDF and could not be opened. |
| `DOC00305` | Password Protected PDF | The submitted PDF is encrypted with a password and cannot be processed. |
| `DOC00306` | Parsing Error | The document analysis could not be processed. |

# **Retrieve a Document Analysis**

You can retrieve the results of a previously submitted document analysis at any time using its unique `id`.

`https://api.caas.qitech.app/document_analysis/document/{document_id}`

Replace document_id with the same value you used for the `POST` request.

---

# HTTP Status

URL: /en/documentation/caas/document_analysis/http_status

All QI Tech APIs use the following standardization for HTTP response status codes, in accordance with RFC 7231 :

Status HTTP | Meaning | Description
---------- | ------- | ---------------------------------
400 | Bad Request | The request sent has a formatting error. In most cases, we return an explanation in the response body indicating where the error is. In this API we implement a set of specific error codes to help you understand what may be wrong.
401 | Unauthorized | There was an authentication problem; verify that the API Key is correct and in the correct header, as described in the Authentication section.
403 | Forbidden | The endpoint accessed is for internal use and is not available for this API Key.
404 | Not Found | The requested data was not found using the key provided. This status is also returned when an invalid endpoint is requested.
405 | Method Not Allowed | The HTTP method used (POST, GET, PUT, ...) does not apply to the endpoint used.
406 | Not Acceptable | The data sent in the request body is invalid. In general, this means the data sent is not valid JSON.
409 | Conflict | The document id sent matches an id that was already processed previously. This status is returned in the case of duplicate requests sent to the server, or requests for two documents with the same id.
500 | Internal Server Error | We had a problem processing this request. When this error occurs our team is automatically notified and begins analysis and resolution immediately.
503 | Service Unavailable | You have encountered an outage, planned or not, of our server infrastructure.

---

# Introduction

URL: /en/documentation/caas/document_analysis/introduction

Welcome to the QI Tech Document Analysis API. This API was specially designed to analyze complex documents that do not follow a standard format, such as proof of address, contracts, invoices, CCBs, bank slips, and others.

## **Support and Feedback**

If you encounter any technical issues or need assistance, please contact our support team at suporte.caas@qitech.com.br. We are committed to providing a timely response.

## **We Love Feedback**

We greatly value our clients' feedback! If you identify any inaccuracies, unclear sections, or have suggestions for improvement, we encourage you to share them with our team. Your contribution helps us improve the experience for all users!

## **Environments**

The API is available in two distinct environments for client use. The base URLs for the APIs are as follows:

- Production - `https://api.caas.qitech.app/document_analysis/`
- Sandbox - `https://api.sandbox.caas.qitech.app/document_analysis/`

**Important Notice!**

The use of real data from individuals and/or legal entities is strictly prohibited in the QI Tech Sandbox environment.

## **HTTPS Only**

For security reasons, all communication with QI Tech APIs must be carried out using HTTPS. To ensure compliance and prevent insecure data transmission, the server is configured to accept only connections on port 443 with the TLS 1.2 protocol. Calls made using other protocols will be automatically rejected.

## **Authentication**

Access to the API is granted through the use of an API Key. Your access key has been or will be sent to your email. If you have not yet received it, please contact our support team at suporte.caas@qitech.com.br.

The API expects the key to be included in the `Authorization` header of each request sent to the server.

**Request Example:**

```bash
# The -H flag adds the required authorization header to the request.
curl "api_endpoint_here" \
  -H "Authorization: EXAMPLE_API_KEY"
```

:::info **Attention**

You must replace EXAMPLE-OF-API-KEY with the API Key received from support.
:::

---

# Webhook

URL: /en/documentation/caas/document_analysis/webhook

When an asynchronous analysis is completed, a webhook is sent with the analysis result. To do so, it is necessary to configure an address where we will send the notifications and also a *signature_key* that will be used to sign the request. If you do not yet have a webhook configured, contact the [support](mailto:suporte.caas@qitech.com.br) team.

## Signature

To ensure that the request received at the webhook endpoint comes from our servers, an HMAC signature is sent along with the webhook. You can use this signature to verify that the webhook originated from our servers.

> Signature calculation example in Python
```python
    hmac_obj = hmac.new(signature_key.encode('utf-8'), (endpoint + method + payload).encode('utf-8'), hashlib.sha1)
    return hmac_obj.hexdigest()
```

## Request

The request has the format below and notifies that the analysis has been completed. The request uses the HTTP POST method and the request body is sent as UTF-8 encoded text.

### Success Webhook

```bash
curl --location 'YOUR-ENDPOINT-HERE' \
--header 'Signature: CALCULATED-HASH-HMAC' \
--data '{"id": "e314ffci-14f3-41a1-ad5d-c9c18782jhfe", "document": {"analysis_result": {...},  "validation_status": "valid"}, "status": "successful", "status_reason": "", "status_description": "Sucessfull Analysis"}'
```

### Error Webhook
```bash
curl --location 'YOUR-ENDPOINT-HERE' \
--header 'Signature: CALCULATED-HASH-HMAC' \
--data '{"id": "e314ffci-14f3-41a1-ad5d-c9c18782jhfe", "status": "bad_request", "status_reason": "missing_information
", "status_description": "The document is missing required information."}'
```

---

# builder

URL: /en/documentation/caas/face_recognition/android/builder

## FaceRecognition.Builder

| Parameter                                                                                                                                     | Function                                                                                                                                                                                                                                                                                                                                                                    | Required                                                                                                                                                                                                  |
| --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---- |
| mobileToken                                                                                                                                   | Client key that identifies that the collected data comes from your application. If you have not yet received your mobile-token, contact <a href='mailto:suporte.caas@qitech.com.br'>support</a>.                                                                                                                                              | Yes.                                                                                                                                                                                                         |
| .setSandboxEnvironment()                                                                                                                      | If this parameter is used in the constructor, the library will be configured to send data to the sandbox environment. If absent, requests are sent to the production environment.                                                                                                                                                                        | No.                                                                                                                                                                                                         |
| .showIntroductionScreens(Boolean showIntroductionScreens)                                                                                     | When "false" disables the introduction screens for photo capture that appear to the user.                                                                                                                                                                                                                                                                              | No. Default is "true".                                                                                                                                                                                      |
| .setShowSuccessScreen(Boolean showSuccessScreen)                                                                                              | When "false" disables the success screen after photo capture.                                                                                                                                                                                                                                                                                                          | No. Default is "true".                                                                                                                                                                                      |
| .setBackgroundColor(String backgroundColor)                                                                                                   | Allows configuration of the background color of the SDK activities.                                                                                                                                                                                                                                                                                                        | No. Default is "#ffffff".                                                                                                                                                                                   |
| .setFontColor(String fontColor)                                                                                                               | Allows configuration of the font and icon color of the SDK activities.                                                                                                                                                                                                                                                                                                | No. Default is "#000000".                                                                                                                                                                                   |
| .setFontFamily(FontFamily fontFamily)                                                                                                         | Allows configuration of the font of the SDK activities.                                                                                                                                                                                                                                                                                                                    | No. If not specified, the default is FontFamily.open_sans. Available fonts: FontFamily.open_sans, FontFamily.futura, FontFamily.verdana, FontFamily.roboto, FontFamily.poppins and FontFamily.helvetica. | No. |
| .activeFaceLiveness(Boolean activeFaceLiveness)                                                                                               | Indicates whether the SDK should perform a user selfie capture procedure or active proof of life.                                                                                                                                                                                                                                                                  | No. Default is _false_.                                                                                                                                                                                     |
| .audioConfiguration(AudioConfiguration audioConfiguration)                                                                                    | Indicates whether the SDK should or should not execute indication audios for the user. Accepted configurations are _AudioConfiguration.enable_ which executes indication audios, _AudioConfiguration.disable_ which does not execute these audios and _AudioConfiguration.accessibility_ which executes audios if the user's device has accessibility settings enabled. | No. Default is _AudioConfiguration.disable_.                                                                                                                                                                |
| .setVisualConfiguration([VisualConfiguration](https://docs.zaig.com.br/android_facerecon/#o-objeto-visualconfiguration). visualConfiguration) | Used to customize the images shown to the user throughout the SDK execution.                                                                                                                                                                                                                                                                                | No.                                                                                                                                                                                                         |
| .setTextConfiguration([TextConfiguration](https://docs.zaig.com.br/android_facerecon/#o-objeto-textconfiguration). textConfiguration)         | Used to customize the introductory onboarding screen texts shown to the user throughout the SDK execution.                                                                                                                                                                                                                                              | No.                                                                                                                                                                                                         |
| .setSessionId(String sessionId)                                                                                                               | Used to define the key that identifies the session started in the SDK. It is used to track the entire flow taken by the user in the FaceRecon execution through logs. This field accepts up to 255 characters.                                                                                                                                                          | No.                                                                                                                                                                                                         |
| .setLogLevel(FaceRecognition.LogLevel logLevel)                                                                                               | Used to customize the verbosity level of the SDK logs. Available levels: LogLevel.debug, LogLevel.info, LogLevel.warn, LogLevel.error and LogLevel.trace. Default is LogLevel.debug.                                                                                                                                                                           | No.                                                                                                                                                                                                         |
| .setDocumentNumber(String documentNumber)                                                                                                     | Used to define the user's document number. This field accepts 14 characters of CPF formatted as follows 000.000.000-00                                                                                                                                                                                                                              | Yes in all calls if using 1:1 validation at some point.                                                                                                                                          |
| .setValidation(Boolean validation)                                                                                                            | Used to define whether the SDK should or should not perform 1:1 validation with the user's selfie. In the user's first session this flag must be, **mandatorily false**. This function requires the setDocumentNumber method to be filled.                                                                                                                      | No. Default is _false_.                                                                                                                                                                                     |

## The VisualConfiguration Object

| Parameter                                                             | Function                                                                                                                                                                                                                                        | Required             |
| --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
| .setOnboardingDrawable(int onboarding_drawable, int onboarding_width) | Used to configure the image shown to the user on the SDK onboarding screen. The _onboarding_drawable_ parameter should reference the id of the image to be shown and _onboarding_width_ is the desired display size of this image. | No.                    |
| .setButtonBorderSize(int border_size)                                 | Used to configure the border width of the SDK buttons.                                                                                                                                                                               | No. Default is _1_.    |
| .setButtonShadow(boolean button_shadow)                               | When set to _false_ removes the shadow effect, default on android, used by the SDK buttons.                                                                                                                                       | No. Default is _true_. |

## The TextConfiguration Object

| Parameter                                      | Function                                                                                    | Required |
| ---------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------- |
| .setCustomText(CustomLabel label, String text) | Used to configure the texts shown to the user on the SDK onboarding screen | No.        |

```

```

---

# Handling Responses

URL: /en/documentation/caas/face_recognition/android/collecting_response

To obtain the **FaceReconResponse** object, which contains the results of captures obtained by the SDK, including the identifiers of images sent to the QI Tech system, override the *onActivityResult* method in the same activity where you started **FaceReconActivity**:

```java
@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == REQUEST_CODE) {
            if (resultCode == RESULT_OK && data != null) {
                faceReconResponse = data.getParcelableExtra("FaceReconResponse");
                image_key = faceReconResponse.image_key;
                device_scan_session_id = faceReconResponse.device_scan_session_id;
                Log.i(TAG_LIVENESS, "FACE RECON RESPONSE: " + faceReconResponse.image_key);
            }
            else if (resultCode == RESULT_CANCELED && data != null) {
                faceReconResponse = data.getParcelableExtra("FaceReconResponse");
                Log.i(TAG_LIVENESS, "FACE RECON RESPONSE: " + faceReconResponse.status_code + " - " + faceReconResponse.reason + " - " + faceReconResponse.description);
            }
        }
    }
```

## Description of FaceReconResponse Object Attributes

:::info Warning: 
Device Scan Integration Starting from version 5.2.0, the Face Recognition service will automatically perform an internal call to Device Scan. With this, the success response will include the `device_scan_session_id` field. This key identifies the device scan session performed internally and can be used in an integrated manner in other QI Tech ecosystem services. 
:::

Attribute | Description | Result | Versions
--------- | --------- | --------- | ---------
image_key | Identification key of the provided image that can be used in any other QI Tech system service. | **RESULT_OK** | **All**
device_scan_session_id | Identification key of the device scan session performed internally that can be used in any other QI Tech system service. | **RESULT_OK** |  **5.2.0+**
status_code | Request status code. | **RESULT_CANCELED** | **5.0.0+**
reason | Error identifier | **RESULT_CANCELED** | **5.0.0+**
description | Error description. | **RESULT_CANCELED** | **5.0.0+**

## Error Structure (SDK 5.0.0+)

:::danger Important Warning! 
Starting from version **5.0.0**, the error structure has been reformulated to provide more detailed and diagnostic information.
:::

### Example: InvalidToken

```java
{
   status_code = 401
    reason = "INVALID_TOKEN"
    description = "Authentication token expired or invalid"
}
```
### Example: UserCanceled

```java
{
    status_code = 0
    reason = "USER_CANCELED"
    description = "User pressed the back button."
}
```

## Previous Versions

```java
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        FaceRecognition.RequestResponseObject result;
        if (requestCode == REQUEST_CODE){
            if (resultCode == RESULT_OK && data != null){
                faceReconResponse = data.getParcelableExtra("FaceReconResponse");
            }
        }
    }
```

---

# 1:1 Validation - Face Match

URL: /en/documentation/caas/face_recognition/android/face_match

To use the 1:1 Validation (Face Match) functionality, the _validation_ parameter must be set to _true_ in the SDK constructor, which can be done by calling the `setValidation()` method. In addition, the _documentNumber_ parameter must be filled with the user's CPF. As shown in the example below:

```java
FaceRecognition faceRecognition = new FaceRecognition.Builder("YOUR_MOBILE_TOKEN_SENT_BY_QITECH")
    // ... Other configurations
    .setDocumentNumber("000.000.000-00")
    .setValidation(true)
    // ...
    .build();
```

> **ATTENTION:** 1:1 validation can only be used from the user's second session onwards, that is, after the first session, when the _documentNumber_ parameter is filled with the user's CPF and the _validation_ parameter is set to `false`, having a record to be validated.

---

# Hybrid Solutions

URL: /en/documentation/caas/face_recognition/android/hybrid_solutions

In addition to offering native Java integration, our SDKs are also compatible with various hybrid frameworks. This is possible through the integration of native plugins specific to each of these frameworks. Using the native system of each solution, it is feasible to incorporate our native SDK in the Android environment.

Some of the most commonly used hybrid technologies are React Native ([Native Modules](https://reactnative.dev/docs/turbo-native-modules-introduction)), Cordova ([Plugin Development Guide](https://cordova.apache.org/docs/en/latest/guide/hybrid/plugins/index.html)), Ionic ([Native](https://ionicframework.com/docs/v3/native/)), Unity ([Native Plug-in for Android](https://docs.unity3d.com/Manual/PluginsForAndroid.html)), Xamarin ([Native Libraries](https://learn.microsoft.com/en-us/xamarin/android/platform/native-libraries)), Appcelerator, Phonegap and Node.

To facilitate the integration process with our native solutions, we provide plugins for React Native and Flutter frameworks. If you are interested, we provide documentation and an integration example in our private repositories. For other hybrid technologies, we have some examples of implementation of this bridge to native code. Feel free to contact our support to gain access.

---

# Introduction

URL: /en/documentation/caas/face_recognition/android/introduction

Welcome to QI Tech's Android Face Recognition SDK. This SDK performs face capture and sends it to the QI Tech Face Recognition API . You can use it to capture a customer's face image through your application and reference it by a key in other QI Tech system products.

## Problems?

We are not a company that hides behind an API! Contact our [support](mailto:suporte.caas@qitech.com.br) and we will respond as quickly as possible. Feel free to call us if you want a quick response!

### We Love Feedback

Even if you have already solved your problem or it is very simple (Even a typo or inadequate organization that you already understood), send us an email, so we make the documentation increasingly practical and the next person won't have to suffer the pains you suffered!

:::danger Important Warning!
Real data from individuals and/or legal entities should not be used in QI Tech's Sandbox environments.  
:::

---

# Native Integration

URL: /en/documentation/caas/face_recognition/android/native_java

To import our SDKs, it is necessary to make changes to the Project and Application _build.gradle_.

## Adding to Project

Add our maven repository address to the project's _build.gradle_ (in Android Studio this file appears as: **"Project: \{project_name\}"**), as shown in the example below.

```java
maven { url 'https://sdks.qitech.com.br/' }
```

## Adding to Application

After that, add the library you want to import to your app's build.gradle (in Android Studio this file appears as: **"Module: \{project_name\}.app"**), including the dependency shown below.

```java
dependencies {
    implementation 'com.qitech.android:facerecon:v7.0.0'
}
```

:::warning
Since **April 2025**, new Google Play policies require **Android API Level 35** for applications to be published
or updated on the Google Play Store. Therefore, we strongly recommend using **targetSdkVersion version 35** at least.
:::

:::info
Using **targetSdkVersion 35** implies using **compileSdkVersion 35**, which triggers some **minimum requirements** for tools
in the Android ecosystem:
* compileSdkVersion 35 --> AGP 8.6.0
* AGP 8.6.0 --> Gradle 8.7
* AGP 8.6.0 --> Java 17 (JDK 17)
* AGP 8.6.0 --> Kotlin 2+
:::

## Starting the SDK

:::danger Important Warning!
As of version 5.0.0, the authentication system was updated to use **clientSessionKey** instead of **mobileToken**. In addition, new configuration options were added for feedback screens.
:::

### Obtaining the Client Session Key

Before configuring the SDK, you must generate a temporary **clientSessionKey** through a server-to-server request to our face recognition API.

### Endpoint

| Environment | URL |
|----------|-----|
| **Sandbox** | `https://api.sandbox.zaig.com.br/face_recognition/client_session` |
| **Production** | `https://api.zaig.com.br/face_recognition/client_session` |

### Request

**Method:** `POST`

**Headers:**
```json
{
  "Authorization": "YOUR_FACE_RECON_API_KEY"
}
```

**Body (Optional, but recommended):**
```json
{
  "user_id": "unique_user_identifier" // If available, use the user's CPF!
}
```

> **Important:** The `user_id` field is **highly recommended** for security and anti-fraud measures. Use a unique identifier for your application's user.

### Response

The successful response will contain the `client_session_key` that should be passed to the SDK configuration.

```json
{
  "client_session_key": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
```

To incorporate the SDK into your application, you must configure your custom capture application through a Builder component and submit it as a parameter via Intent Extra to FaceReconActivity.

### SDK initialization example
```java
  Intent intent = new Intent(getApplicationContext(), FaceReconActivity.class);

  var onboardingTextConfiguration = new OnboardingTextConfiguration(
        "Relevant tips",
        "Keep your face visible",
        "Fit your face in the oval",
        "Remove accessories that cover your face"
  );

  FaceRecognition mFaceRecognition = new FaceRecognition.Builder(clientSessionKey)
        .setSessionId("SESSION_ID")
        .setDocumentNumber("111.111.111-11")
        .setFontColor("#FFFFFF")
        .setBackgroundColor("#000000")
        .setFontFamily(FaceRecognition.FontFamily.futura)
        .showIntroductionScreens(true)
        .setShowSuccessScreen(true)
        .setShowInvalidTokenScreen(false)
        .setOnboardingTextConfiguration(onboardingTextConfiguration)
        .audioConfiguration(AudioConfiguration.enable)
        .setLogLevel(FaceRecognition.LogLevel.debug)
        .build();

  intent.putExtra("settings", mFaceRecognition);
  startActivityForResult(intent, REQUEST_CODE);
```

**Versions prior to v6.0.0**
```java
  Intent intent = new Intent(getApplicationContext(), FaceReconActivity.class);

  VisualConfiguration visualConfiguration = new VisualConfiguration()
          .setOnboardingDrawable(R.drawable.introscreen,500);

  TextConfiguration textConfiguration = new TextConfiguration()
          .setCustomText(TextConfiguration.CustomLabel.onboardingTitle, "To take a good photo:")
          .setCustomText(TextConfiguration.CustomLabel.onboardingFirstLabel, "- Go to a well-lit place")
          .setCustomText(TextConfiguration.CustomLabel.onboardingSecondLabel, "- Remove accessories and show your face clearly")
          .setCustomText(TextConfiguration.CustomLabel.onboardingThirdLabel, "- Insert your face into the frame, waiting for it to turn green to capture");

  FaceRecognition mFaceRecognition = new FaceRecognition.Builder(clientSessionKey)
          .showIntroductionScreens(true)
          .setVisualConfiguration(visualConfiguration)
          .setTextConfiguration(textConfiguration)
          .setBackgroundColor("#000000")
          .setFontColor("#FFFFFF")
          .setFontFamily(FaceRecognition.FontFamily.futura)
          .setSessionId("SESSION_ID")
          .setLogLevel(FaceRecognition.LogLevel.debug)
          .setShowSuccessScreen(false)
          .build();
  intent.putExtra("settings", mFaceRecognition);
  startActivityForResult(intent, REQUEST_CODE);
```

## FaceRecognition.Builder
| Parameter | Function | Required |
|------------|--------------|--------------|
|clientSessionKey |Client key that identifies that the collected data comes from your application. Obtained through a request to the Face Recognition API|Yes.|
|.setSandboxEnvironment()|If this parameter is used in the constructor, the library will be configured to send data to the sandbox environment. If absent, requests are sent to the production environment.|No.|
|.showIntroductionScreens(Boolean showIntroductionScreens)|When "false" disables the introduction screens for photo capture that appear to the user.|No. Default is "true".|
|.setShowSuccessScreen(Boolean showSuccessScreen)|When "false" disables the success screen after photo capture.|No. Default is "true".|
|.setShowInvalidTokenScreen(Boolean showSuccessScreen)|When "false" disables the authentication failure screen.|No. Default is "true".|
|.setBackgroundColor(String backgroundColor)|Allows configuration of the background color of the SDK activities.|No. Default is "#ffffff".|
|.setFontColor(String fontColor)|Allows configuration of the font and icon color of the SDK activities.|No. Default is "#000000".|
| .setFontFamily(FontFamily fontFamily)| Allows configuration of the font of the SDK activities.| No. If not specified, the default is FontFamily.open_sans. Available fonts: FontFamily.open_sans, FontFamily.futura, FontFamily.verdana, FontFamily.roboto, FontFamily.poppins and FontFamily.helvetica.|No.|
|.setOnboardingTextConfiguration(OnboardingTextConfiguration onboardingTextConfiguration) | Allows customization of the instructions on the introduction screen. | No. |
|.audioConfiguration(AudioConfiguration audioConfiguration)|Indicates whether the SDK should or should not execute indication audios for the user. Accepted configurations are  _AudioConfiguration.enable_ which executes indication audios, _AudioConfiguration.disable_ which does not execute these audios and _AudioConfiguration.accessibility_ which executes audios if the user's device has accessibility settings enabled.|No. Default is _AudioConfiguration.disable_.|
|.setSessionId(String sessionId)| Used to define the key that identifies the session started in the SDK. It is used to track the entire flow taken by the user in the FaceRecon execution through logs. This field accepts up to 255 characters. |No.|
|.setLogLevel(FaceRecognition.LogLevel logLevel)| Used to customize the verbosity level of the SDK logs. Available levels: LogLevel.debug, LogLevel.info, LogLevel.warn, LogLevel.error and LogLevel.trace. Default is LogLevel.debug. |No.|
|.setDocumentNumber(String documentNumber)| Used to define the user's document number. This field accepts 14 characters. | For identification used internally for anti-fraud and security. |

**Versions prior to v6.0.0**
| Parameter | Function | Required |
|------------|--------------|--------------|
|clientSessionKey |Client key that identifies that the collected data comes from your application. Obtained through a request to the Face Recognition API|Yes.|
|.setSandboxEnvironment()|If this parameter is used in the constructor, the library will be configured to send data to the sandbox environment. If absent, requests are sent to the production environment.|No.|
|.showIntroductionScreens(Boolean showIntroductionScreens)|When "false" disables the introduction screens for photo capture that appear to the user.|No. Default is "true".|
|.setShowSuccessScreen(Boolean showSuccessScreen)|When "false" disables the success screen after photo capture.|No. Default is "true".|
|.setShowInvalidTokenScreen(Boolean showSuccessScreen)|When "false" disables the authentication failure screen.|No. Default is "true".|
|.setBackgroundColor(String backgroundColor)|Allows configuration of the background color of the SDK activities.|No. Default is "#ffffff".|
|.setFontColor(String fontColor)|Allows configuration of the font and icon color of the SDK activities.|No. Default is "#000000".|
| .setFontFamily(FontFamily fontFamily)| Allows configuration of the font of the SDK activities.| No. If not specified, the default is FontFamily.open_sans. Available fonts: FontFamily.open_sans, FontFamily.futura, FontFamily.verdana, FontFamily.roboto, FontFamily.poppins and FontFamily.helvetica.|No.|
|.activeFaceLiveness(Boolean activeFaceLiveness)|Indicates whether the SDK should perform a user selfie capture procedure or active proof of life. |No. Default is *false*.|
|.audioConfiguration(AudioConfiguration audioConfiguration)|Indicates whether the SDK should or should not execute indication audios for the user. Accepted configurations are  _AudioConfiguration.enable_ which executes indication audios, _AudioConfiguration.disable_ which does not execute these audios and _AudioConfiguration.accessibility_ which executes audios if the user's device has accessibility settings enabled.|No. Default is _AudioConfiguration.disable_.|
|.setVisualConfiguration(VisualConfiguration visualConfiguration)|Used to customize the images shown to the user throughout the SDK execution.|No.|
|.setTextConfiguration(TextConfiguration textConfiguration)|Used to customize the introductory onboarding screen texts shown to the user throughout the SDK execution.|No.|
|.setSessionId(String sessionId)| Used to define the key that identifies the session started in the SDK. It is used to track the entire flow taken by the user in the FaceRecon execution through logs. This field accepts up to 255 characters. |No.|
|.setLogLevel(FaceRecognition.LogLevel logLevel)| Used to customize the verbosity level of the SDK logs. Available levels: LogLevel.debug, LogLevel.info, LogLevel.warn, LogLevel.error and LogLevel.trace. Default is LogLevel.debug. |No.|
|.setDocumentNumber(String documentNumber)| Used to define the user's document number. This field accepts 14 characters. |Only for calls that use 1:1 validation at some point. |
|.setValidation(Boolean validation)| Used to define whether the SDK should or should not perform 1:1 validation with the user's selfie. In the user's first session this flag must be, **mandatorily**, false. This function requires the setDocumentNumber method to be filled.  |No. Default is *false*.|

## The VisualConfiguration Object
:::warning
__DEPRECATED__ AS OF **v6.0.0**!
:::

| Parameter                                                             | Function                                                                                                                                                                                                                                        | Required             |
| --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
| .setOnboardingDrawable(int onboarding_drawable, int onboarding_width) | Used to configure the image shown to the user on the SDK onboarding screen. The _onboarding_drawable_ parameter should reference the id of the image to be shown and _onboarding_width_ is the desired display size of this image. | No.                    |
| .setButtonBorderSize(int border_size)                                 | Used to configure the border width of the SDK buttons.                                                                                                                                                                               | No. Default is _1_.    |
| .setButtonShadow(boolean button_shadow)                               | When set to _false_ removes the shadow effect, default on android, used by the SDK buttons.                                                                                                                                       | No. Default is _true_. |

## The TextConfiguration Object
:::warning
__DEPRECATED__ AS OF **v6.0.0**!
:::

| Parameter                                      | Function                                                                                    | Required |
| ---------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------- |
| .setCustomText(CustomLabel label, String text) | Used to configure the texts shown to the user on the SDK onboarding screen | No.        |

---

# using_sdk

URL: /en/documentation/caas/face_recognition/android/using_sdk

## Starting the SDK

To incorporate the SDK into your application, you must configure your custom capture application through a Builder component and submit it as a parameter via Intent Extra to FaceReconActivity.

```java
  Intent intent = new Intent(getApplicationContext(), FaceReconActivity.class);

  VisualConfiguration visualConfiguration = new VisualConfiguration()
          .setOnboardingDrawable(R.drawable.introscreen,500);

  TextConfiguration textConfiguration = new TextConfiguration()
          .setCustomText(TextConfiguration.CustomLabel.onboardingTitle, "To take a good photo:")
          .setCustomText(TextConfiguration.CustomLabel.onboardingFirstLabel, "- Go to a well-lit place")
          .setCustomText(TextConfiguration.CustomLabel.onboardingSecondLabel, "- Remove accessories and show your face clearly")
          .setCustomText(TextConfiguration.CustomLabel.onboardingThirdLabel, "- Insert your face into the frame, waiting for it to turn green to capture");

  FaceRecognition mFaceRecognition = new FaceRecognition.Builder("YOUR_MOBILE_TOKEN_SENT_BY_QITECH")
          .showIntroductionScreens(true)
          .setVisualConfiguration(visualConfiguration)
          .setTextConfiguration(textConfiguration)
          .setBackgroundColor("#000000")
          .setFontColor("#FFFFFF")
          .setFontFamily(FaceRecognition.FontFamily.futura)
          .setSessionId("SESSION_ID")
          .setLogLevel(FaceRecognition.LogLevel.debug)
          .setShowSuccessScreen(false)
          .build();
  intent.putExtra("settings", mFaceRecognition);
  startActivityForResult(intent, REQUEST_CODE);
```

We use a Mobile Token to allow authenticated access from your application to our API. It has probably already been sent to you by email. If you have not yet received your token, send an email to suporte.caas@qitech.com.br .

Our API expects to receive the Mobile Token in all requests to our server from the SDK, therefore, it must be included as a configuration parameter through the method mentioned above.

:::info **Attention**

You must replace "YOUR_MOBILE_TOKEN_SENT_BY_QITECH" with the Mobile Token received from support.
:::

---

# Authentication

URL: /en/documentation/caas/face_recognition/api/authentication

:::danger Important Warning!
Starting from version 5.0.0 of iOS and Android SDKs and version 3.0.0 of the Web SDK, the authentication system was updated to use clientSessionKey instead of mobileToken.
:::

We use an API Key to allow access to our API. It has probably already been sent to you by email. If you have not yet received your key, send an email to suporte.caas@qitech.com.br .

## Client Session Key

Before configuring the SDK, you must generate a temporary clientSessionKey through a server-to-server request to our API.

### Generate Client Session Key

```bash
curl -X POST "https://api.zaig.com.br/face_recognition/client_session" \
     -H "Authorization: EXAMPLE_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{ "user_id": "unique_user_identifier" }'
```

**Endpoints**

| Environment | URL |
|----------|-----|
| Sandbox | https://api.sandbox.zaig.com.br/face_recognition/client_session |
| Production | https://api.zaig.com.br/face_recognition/client_session |

**Request Details**

| Field | Type | Required | Description|
|----------|----------|----------|----------|
| user_id | string | No | Unique identifier of your application's user (e.g.: CPF, RG, etc) |

The `user_id` field in the request body is highly recommended for security and anti-fraud measures.

**Request Body**
```json
{
  "user_id": "unique_user_identifier"
}
```

**Response Body**

The successful response will contain the `client_session_key`.
```json
{
  "client_session_key": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
```

:::info Attention
You must replace `EXAMPLE_API_KEY` with the API Key received from support.
:::

---

# Face Registration (1:1)

URL: /en/documentation/caas/face_recognition/api/face_registration

To perform **face registration** (for subsequent 1:1 validation), you must use the **specific endpoints** of the Face Recognition API described on this page.

## Available endpoints

Face registration resources are exposed at the following routes:

| Method | Endpoint | Description |
|--------|----------|-------------|
| POST | `/face_recognition/registration` | Creates a new face registration |
| GET | `/face_recognition/registration/{registration_key}` | Retrieves registration by key |
| GET | `/face_recognition/registration/document_number/{document_number}` | Retrieves registration by document number |

**Base URL (production):** `https://api.caas.qitech.app`  
**Base URL (sandbox):** `https://api.sandbox.caas.qitech.app`

---

## Creating a registration (POST)

To register a client's face, send a **POST** request to:

`https://api.caas.qitech.app/face_recognition/registration`

The request body must contain the **document number** and the face image in one of the two formats below.

### Option 1: image via `image_key` (from the SDK)

Use the **image_key** returned by the SDK after face capture.

Request Body – image_key

```json
{
    "document_number": "DOCUMENT_NUMBER",
    "image_key": "<IMAGE_KEY_FROM_SDK>"
}
```

### Option 2: image as Base64

Send the image directly as Base64 (no headers or additional metadata).

Request Body – image (Base64)

```json
{
    "document_number": "DOCUMENT_NUMBER",
    "image": "<IMAGE_BASE64>"
}
```

### Request fields

name | type | description
:----: | :----: | ---------
document_number | string | Client's document number (e.g. CPF)
image_key | string | Image key returned by the SDK (UUID). Use **either** `image_key` **or** `image`
image | string | Face image in Base64. Use **either** `image` **or** `image_key`

:::info
You must send **only one** of the image fields: `image_key` **or** `image`. Do not send both in the same request.
:::

On success, the API returns only the face registration key:

Response Body

```json
{
    "registration_key": "face_registration_key"
}
```

---

## Retrieving registration by key (GET)

To get the registration key by its unique key:

`https://api.caas.qitech.app/face_recognition/registration/{registration_key}`

Replace `{registration_key}` with the identifier returned when creating the registration.

**Response Body:**

```json
{
    "registration_key": "face_registration_key"
}
```

---

## Retrieving registration by document (GET)

To get the registration key by document number:

`https://api.caas.qitech.app/face_recognition/registration/document_number/{document_number}`

Replace `{document_number}` with the client's document number (e.g. CPF).

**Response Body:**

```json
{
    "registration_key": "face_registration_key"
}
```

---

---

# HTTP Status

URL: /en/documentation/caas/face_recognition/api/http_status

All QI Tech APIs use the following standardization in HTTP return statuses, according to RFC 7231 :

HTTP Status | Meaning | Description
---------- | ------- | ---------------------------------
400 | Bad Request | The request sent has some formatting error. In most cases, we return in the message body an explanation of where the error is.
401 | Unauthorized | There was a problem with authentication, check if the API Key is correct and in the correct header, according to the Authentication section.
403 | Forbidden | The accessed endpoint is for internal use and is not available for this API Key.
404 | Not Found | The requested data was not found using the key used. This status is also returned when an invalid endpoint is requested.
405 | Method Not Allowed | The HTTP method used does not apply to the endpoint used.
406 | Not Acceptable | The data sent in the request body is invalid. In general, this means that the data sent is not valid JSON.
409 | Conflict | The request id corresponds to an id already processed previously. This status is returned in case of duplicate requests sent to the server.
500 | Internal Server Error | We had a problem processing this request, when we encounter this error our specialists are automatically notified and start analysis and resolution immediately.
503 | Service Unavailable | You encountered a planned or unplanned unavailability of our server infrastructure.

---

# Image

URL: /en/documentation/caas/face_recognition/api/image

Sending a face photo is mandatory for using our facial recognition API. To ensure greater reliability of the analyses performed, it is necessary for the client to follow some rules when taking the photo:

* The photo must contain only one face;
* The entire face must be visible in the photo;
* The face must occupy at least 15% of the photo area;
* The face must be facing the camera and parallel to it;
* The face must have open eyes;
* The face must have a closed mouth;
* The face must have a neutral expression and no smiles;
* The face must not be covered by any type of accessory (hats, glasses or masks).

In addition, only .jpeg and .png images with a maximum size of 3MB will be accepted.

## File submission

Request Body

```json
{
    "image": "base64_image_code"
}
```

Response Body

```json
{ 
    "image_key": "f4b5337a-7b50-406e-8c8e-7d0e77b5aa02",
    "file_size": 47407,
    "width_px": 0,
    "height_px": 0,
    "created_at": "2020-07-29T18:40:57Z"
}
```

In cases where it is necessary to send an image without immediately executing facial registration or validation routines, a JSON object containing the image Base64 must be sent. 
For this, a **POST** request must be sent to the endpoint:

`https://api.caas.qitech.app/face_recognition/image`

Once sent, the image will be submitted to quality tests and, if approved, a JSON containing the image access key will be returned. This key should be used to reference the photo during registration or facial validation.

:::info **Attention**

Only the Base64 code corresponding to the image should be sent.
:::

## Image quality validation

Response Body: Invalid image case

```json
{
    "title": "image_quality",
    "description": "This image was not approved in quality assessment. The face is too close to image edges.",
    "image_status": "not_center"
}
```

When making a POST to the image endpoint, if the image is not sufficient for validation, an HTTP Status Code 400 will be returned.

The value of the *description* field is the message that explains why the image is invalid.

In addition, we return an enumerator *image_status* so that the reason why the image is invalid can be mapped. Below we have the listing of possible *image_status*:

image_status |  description
:----: | :---------:
no_faces | No face identified.
multiple_faces | More than one face identified.
close_face | Face too close to camera.
distant_face | Face too far from camera.
not_centered | Face is not centered enough.
inclined_face | Face is inclined.
wearing_acessories | Person is using accessories that cover part of the face.
facial_expression | The person has an open mouth, is smiling or has closed eyes.
brightness_problem | The image does not have adequate lighting.
sharpness_problem | The image is not sharp enough.

**Attention -** There are other reasons why we will return 400 (All related to invalid data). Only returns with title "image_quality" are the result of image quality validation and therefore should be passed on to the user.

## File recovery
> Image recovery

```shell
    curl "https://api.caas.qitech.app/face_recognition/image/f4b5337a-7b50-406e-8c8e-7d0e77b5aa02/file" \
         -H "Authorization: EXAMPLE_API_KEY"
```

At any time it is possible to recover the sent images. For this, simply send a properly authenticated **GET** request to the endpoint:

`https://api.caas.qitech.app/face_recognition/image/{image_key}/file`

Where image_key is the value returned during image submission.

## Processed file recovery
> Processed image recovery

```shell
    curl "https://api.caas.qitech.app/face_recognition/image/f4b5337a-7b50-406e-8c8e-7d0e77b5aa02/cropped_file" \
         -H "Authorization: EXAMPLE_API_KEY"
```
After associating an image with a registration or validation, that image will be processed and a new image containing only the face used in facial recognition routines will be generated.

This image is available to be recovered through a properly authenticated **GET** request to the endpoint:

`https://api.caas.qitech.app/face_recognition/image/{image_key}/cropped_file`

Where image_key is the value returned during base image submission.

## File metadata recovery
> Metadata recovery

```shell
    curl "https://api.caas.qitech.app/face_recognition/image/f4b5337a-7b50-406e-8c8e-7d0e77b5aa02" \
         -H "Authorization: EXAMPLE_API_KEY"
```

After sending an image to the API, it is possible to recover the image metadata using the endpoint:

`https://api.caas.qitech.app/face_recognition/image/{image_key}`

Where image_key is the value returned during image submission.

---

# Introduction

URL: /en/documentation/caas/face_recognition/api/introduction

Welcome to QI Tech's Facial Recognition API! You can use our API to access endpoints, register customer photos and perform facial recognition before executing transactions.

## Problems?

We are not a company that hides behind an API! Contact our support and we will respond as quickly as possible. Feel free to call us if you want a quick response!

### We Love Feedback

Even if you have already solved your problem or it is very simple (Even a typo or inadequate organization that you already understood), send us an email, so we make the documentation increasingly practical and the next person won't need to suffer the pains you suffered!

## Environments

We have two environments for our clients. The base URLs of the APIs are:

* Production - `https://api.caas.qitech.app/face_recognition/`
* Sandbox - `https://api.sandbox.caas.qitech.app/face_recognition/`

:::danger Important Warning!
Real data from individuals and/or legal entities should not be used in QI Tech's Sandbox environments.  
:::

## HTTPS Only

For security reasons, all communication with QI Tech APIs must be performed using HTTPS communication. To prevent HTTP calls from being made due to inattention or other reasons, this server only provides port 443 with TLS 1.2 communication. Calls made using other protocols will be automatically denied.

---

# Registration

URL: /en/documentation/caas/face_recognition/api/registration

Before using the Facial Validation API feature, it is necessary to register the client. This action will generate an initial entry in the database that will provide an image to be used as a base during validation.

## Object Definition

Request Body

```json
{        
    "registration_key": "ee37510e-4dfe-4b9c-b1f4-667288de2190",
    "document_number": "123.456.789-00",
    "image": {
        "image_key": "f1c0d2e1-f950-4360-896d-36588e443fc9",
        "file_size": 47407,
        "width_px": 0,
        "height_px": 0,
        "created_at": "2020-07-29T18:40:57Z",
    },
    "status": "indeterminate",
    "registration_status_events": [],
    "registration_date": "2020-07-29T18:40:57Z"
} 
```

When registering a client, our API will generate a JSON object containing all information related to this registration. This object will be used as a reference when performing facial recognition of this client before a transaction.

name | type | description
:----: | :----: | ---------
registration_key | string | Registration object key
document_number | string | Client's CPF
image | image | Object that carries the properties of the image sent in registration
status | string | Client registration status
registration_status_events | registration_status_events | Object that carries the registration status modification history
registration_date | datetime | Registration date in UTC

## Status Dynamics - **status**
Once a client is registered, the status of this registration will be returned under the **status** flag. The possible results are:

Result | Description
--------- | ---------
authentic | This registration has a history of successfully completed transactions
undefined | This registration has no fraud history nor history of successfully completed transactions
fraud | This registration has associated fraud history

## Creating a Registration

Request Body: Simultaneous image submission (Base64)

```json
{
    "document_number": "123.456.789-00",
    "image": "base_64_image_code",
}
```

Request Body: Prior image submission

```json
{
    "document_number": "123.456.789-00",
    "image_key": "f1c0d2e1-f950-4360-896d-36588e443fc9",
}
```

To register a client, simply send a registration JSON object with a **POST** request to the endpoint:

`https://api.caas.qitech.app/face_recognition/registration`

Two types of registration JSON objects are supported. One in case of prior image submission through the `/image` endpoint, and another in case of simultaneous image submission with the registration request.

name | type | description
:----: | :----: | ---------
document_number | String | Client's CPF
image | String | Image Base64 without headers or additional information
image_key | String | UUID4 returned during image submission by the /image endpoint

After submission, a Registration object containing the user registration data will be returned.

**Attention -** When performing simultaneous image submission with registration, it will be submitted to the same quality tests executed when the image is sent through the `/image` endpoint. Thus, the sent image is subject to the same rules described in the **Image** section of this documentation.

## Status Update - **status**

Request Body

```json
{
    "registration_status": "fraud",
    "incident": "misappropriation",
    "event_date": "2029-08-25T13:34:12-03:00"                  
}
```

To ensure feedback to the fraud database, it is necessary to inform the system if a client commits any type of fraud or if the client completes their first transaction successfully.

For this, updating a client's registration status as a fraudster should be sent as a **PUT** request to the endpoint:

`https://api.caas.qitech.app/face_recognition/registration/{registration_key}/status`

The following values can be used in the **incident** field, which indicates the type of fraud committed by the client:

Enumerator | Description
--------- | ---------
misappropriation | Individual performed misappropriation of some product
misrepresentation | Individual registered under false or third-party documents
successfull_transaction | Individual completed a transaction successfully
status_restoration | Enumerator used in cases where it is desired to restore the status to **undefined**

## Object recovery

Response Body

```json
{        
    "registration_key": "ee37510e-4dfe-4b9c-b1f4-667288de2190",
    "document_number": "123.456.789-00",
    "image": {
        "image_key": "f1c0d2e1-f950-4360-896d-36588e443fc9",
        "file_size": 47407,
        "width_px": 0,
        "height_px": 0,
        "created_at": "2020-07-29T18:40:57Z",
    },
    "status": "fraud",
    "registration_status_events": [
        {
        "registration_status": "fraud",
        "incident": "misappropriation",
        "event_date": "2020-08-25T13:34:12Z"        
        }
    ],
    "registration_date": "2020-07-29T18:40:57Z"
}   
```

At any time, a client's registration data can be recovered through a **GET** request to the endpoint:

`https://api.caas.qitech.app/face_recognition/registration/{registration_key}`

---

# Standards

URL: /en/documentation/caas/face_recognition/api/standards

To facilitate integration and ensure information integrity, some standards have been defined that are followed throughout the API.

## Date and Time with Time Zone
> Some examples:

```
2019-10-15T22:35:12-03:00
2018-05-01T13:32:11+00:00
2019-05-01T00:00:00+00:00
```

It is represented according to ISO 8601. In this case, the time zone is placed right after the time and must represent the time zone of the location where that data will be valid. For example, if a rental is scheduled to start at 09:30 at Brasília airport, the sent time should be represented by 09:30-03:00, if the rental is scheduled to start at 09:30 in Manaus, it should be represented by 09:30-04:00.

The mask used for validation is as follows:

`YYYY-MM-ddThh:mm:ss±hh:mm`

## Date and Time without Time Zone
> Some examples:

```
2019-10-15T22:35:12Z
2018-05-01T13:32:11Z
2019-05-01T00:00:00Z
```

It is represented according to ISO 8601. Data that is independent of time zone should be sent without it, always in UTC, with the letter Z indicating that this data is in UTC. The following format, therefore, will be validated:

`YYYY-MM-ddThh:mm:ssZ`

## Date
> Some examples

``` 
2019-10-15
2019-01-01
2017-03-20
```

In the case of fields that receive only date, a birth date, for example, only the date, without any time, should be sent in the following format:

`YYYY-MM-dd`
 

## Documents
Since document numbers are quite varied and many of them have characters that do not fit as numeric, all document numbers are defined as string. Another good reason to define them as string is to prevent leading zeros from disappearing. Documents provided for on this page have a well-defined mask and will be subject to validation. The rest of the documents, such as RG, given their lack of standardization, will not be validated.

## CPF

> Examples of valid CPFs against the defined mask:

```
123.456.789-12
321.987.543-23
111.283.333-00
```

> Examples of invalid CPFs against the defined mask:

```
8.577.477-8
08.104.627/0001-23
123.456.789-1
23.456.789-01
```

CPF is always defined as a string and will be validated against the mask:

`###.###.###-##`

---

# Validation

URL: /en/documentation/caas/face_recognition/api/validation

To execute facial recognition validation of a client, it is necessary to send a face photo along with the CPF of a registered client. 

From there, that user's registration will be searched in the system to then perform a 1:1 validation between a client photo stored in the database and the sent image.

## Object Definition

Request Body

```json
{
    "validation_key": "ee37510e-4dfe-4b9c-b1f4-667288de2190",
    "document_number": "123.456.789-00",
    "image": {
        "image_key": "f1c0d2e1-f950-4360-896d-36588e443fc9",
        "file_size": 47407,
        "width_px": 0,
        "height_px": 0,
        "created_at": "2020-07-29T18:40:57Z",
    },
    "registration": {
        "registration_key": "903dcb34-2970-4ddf-add5-87463ba51d99",
        "registration_status": "authentic",
        "registration_date": "2020-07-29T18:40:57Z"
        },
    "similarity_ratio": "99",
    "validation_result": "pass",
    "validation_date": "2020-07-29T18:40:57Z"
}   
```

All client validations through facial recognition will generate a Validation object. If desired, this object can be recovered later through the appropriate endpoint.

name | type | description
:----: | :----: | ---------
validation_key | string | Validation object key
document_number | string | Client's CPF
image | image | Object that carries the properties of the image sent in validation
registration | registration | Object that carries the properties of the registration being used as a reference in validation
similarity_ratio | integer | Similarity ratio between the registered image and the sent image
validation_result | string | Result of the 1:1 analysis performed
validation_date | datetime | Facial recognition validation date in UTC

## Creating a Validation

Request Body: Simultaneous image submission (Base64)

```json
{
    "document_number": "123.456.789-00",
    "image": "base_64_image_code",
}
```

Request Body: Prior image submission

```json
{
    "document_number": "123.456.789-00",
    "image_key": "f1c0d2e1-f950-4360-896d-36588e443fc9",
}
```

Just like in registration, two JSON formats are also accepted, one containing the image Base64 and another containing the **image_key** received at the time of image submission through the `/image` endpoint.

`https://api.caas.qitech.app/face_recognition/validation`

After submission, a JSON object containing the analysis result along with the UUID pointing to the sent image will be returned.

**Attention -** When performing simultaneous image submission with facial recognition validation, it will be submitted to the same quality tests executed when the image is sent through the `/image` endpoint. Thus, the sent image is subject to the same rules described in the **Image** section of this documentation.

## Status Dynamics - **validation_result**
After the analysis is executed, the analysis result will be sent under the **validation_result** flag. The possible results are:

Result | Description
--------- | ---------
match | Sent photo corresponds to the registered user
mismatch | Sent photo does not correspond to the registered user

## Object recovery

Response Body

```json
{
    "validation_key": "ee37510e-4dfe-4b9c-b1f4-667288de2190",
    "document_number": "123.456.789-00",
    "validation_image": {
        "image_key": "f1c0d2e1-f950-4360-896d-36588e443fc9",
        "file_size": 47407,
        "width_px": 0,
        "height_px": 0,
        "created_at": "2020-07-29T18:40:57Z",
    },
    "registration": {
        "registration_key": "903dcb34-2970-4ddf-add5-87463ba51d99",
        "registration_status": "authentic",
        "registration_date": "2020-07-29T18:40:57Z"
        },
    "similarity_ratio": "99",
    "validation_result": "pass",
    "validation_date": "2020-07-29T18:40:57Z"
}   
```

At any time, validation data can be recovered through a **GET** request to the endpoint:

`https://api.caas.qitech.app/face_recognition/validation/{validation_key}`

---

# Collecting SDK Returns

URL: /en/documentation/caas/face_recognition/ios/collecting_response

To obtain SDK responses, you must implement the **QITechIosFaceRecognitionControllerDelegate** delegate in your controller, as shown in the example on the side.

```swift
class ViewController: UIViewController, QITechIosFaceRecognitionControllerDelegate {
    
    // Do something if QI Tech FaceRecognition's SDK succesfully collected document picture
    func qitechIosFaceRecognitionController(_ faceRecognitionViewController: QITechIosFaceRecognitionController, didFinishWithResults response: QITechIosFaceRecognitionControllerResponse) {
    
    }
    
    // Do something if QI Tech FaceRecognition's SDK found any error when collecting document picture
    func qitechIosFaceRecognitionController(_ faceRecognitionViewController: QITechIosFaceRecognitionController, didFailWithError error: QITechIosFaceRecognitionControllerError) {
        
    }
    
    // Do something if the user canceled the picture collection on any steps
    func qitechIosFaceRecognitionControllerDidCancel(_ faceRecognitionViewController: QITechIosFaceRecognitionController) {

    }
}
```

## QITechIosFaceRecognitionControllerResponse

The **QITechIosFaceRecognitionControllerResponse** class is used so you can receive the response from QI Tech's SDK.

In the table below you will find the details of all properties of this class:

### Properties

:::info Warning: 
Device Scan Integration Starting from version 6.1.0, the Face Recognition service will automatically perform an internal call to Device Scan. With this, the success response will include the `DeviceScanSessionId` field. This key identifies the device scan session performed internally and can be used in an integrated manner in other QI Tech ecosystem services. 
:::

| Name | Type | Description |
|------|------|-----------|
| `FaceRecognitionKey` | `String` | Unique identifier of the face photo stored in QI Tech. **Important:** Store this value to send in validation APIs (e.g.: Onboarding API). |
| `DeviceScanSessionId` | `String` | Unique identifier of the device scan session performed internally. |

## QITechIosFaceRecognitionControllerError

The **QITechIosFaceRecognitionControllerError** class is triggered when an error occurs that leads to SDK termination.

:::danger Important Warning! 
Starting from version **5.0.0**, the error structure has been reformulated to provide more detailed and diagnostic information.
:::
#### Main changes:

1. **New error types**: `InvalidToken` (replaces `InvalidMobileToken`)
2. **New available properties**:
   - `status_code`: HTTP error code
   - `reason`: Error reason identifier
   - `description`: Detailed error description

### Error Structure (SDK 5.0.0+)

#### Example: InvalidToken

```swift
{
    status_code: 401,
    reason: "INVALID_TOKEN",
    description: "Authentication token expired or invalid"
}
```

## Error Types

### SDK 5.0.0 and later

| Error | Status Code | Description |
|------|-------------|-----------|
| `InvalidToken` | 401 | Authentication token expired or invalid (replaces `InvalidMobileToken`) |

### Versions prior to 5.0.0

| Error Class | Description |
|----------------|-----------|
| `InvalidMobileToken` | MobileToken sent in configurations is invalid *(replaced by `InvalidToken` in v5.0.0+)* |
| `MissingPermission` | One of the necessary permissions was not granted |
| `NetworkFailure` | Loss of internet connection during validation |
| `ServerFailure` | Error response from QI Tech server |
| `MissingStorage` | Insufficient storage space |
| `LowImageQuality` | Image quality insufficient for validation |

---

# QITechIosFaceRecognitionConfiguration

URL: /en/documentation/caas/face_recognition/ios/configuration

## SDK 7.0.0 and later
```swift
let onboardingTextConfiguration = OnboardingTextConfiguration(
        onboardingTitle: "Relevant tips",
        onboardingFirstLabel: "Keep your face visible",
        onboardingSecondlabel: "Fit your face in the oval",
        onboardingThirdLabel: "Remove accessories that cover your face"
)

let faceRecognitionConfig = QITechIosFaceRecognitionConfiguration(
        environment: QITechIosFaceRecognitionEnvironment.sandbox,
        clientSessionKey: clientSessionKey,
        sessionId: "7d8c6f9a-f222-450d-9501-a07c68eb2388",
        documentNumber: "123.456.789-00",
        fontColor: "#337DFF",
        backgroundColor: "#C9CCD3",
        fontFamily: .open_sans,
        showIntroductionScreens: true,
        showSuccessScreen: true,
        showInvalidTokenScreen: false,
        audioConfiguration: AudioConfiguration.enable,
        onboardingTextConfiguration: onboardingTextConfiguration,
        logLevel: .debug
)
```

**Versions prior to v7.0.0**
```swift
let visualConfiguration = VisualConfiguration()
        visualConfiguration.setOnboarding(onboardingFilePath: Bundle.main.path(forResource: "onboarding", ofType: "png")!, onboardingWidth: 200)

let textConfiguration = TextConfiguration()
        textConfiguration.setCustomText(on: .onboardingTitle, text: "To take a good photo:")
        textConfiguration.setCustomText(on: .onboardingFirstLabel, text: "- Go to a well-lit place")
        textConfiguration.setCustomText(on: .onboardingSecondLabel, text: "- Remove accessories and show your face clearly")
        textConfiguration.setCustomText(on: .onboardingThirdLabel, text: "- Insert your face into the frame, waiting for it to turn green to capture")

let faceRecognitionConfig = QITechIosFaceRecognitionConfiguration(environment: QITechIosFaceRecognitionEnvironment.Sandbox,
                                            clientSessionKey: clientSessionKey,
                                            sessionId: "7d8c6f9a-f222-450d-9501-a07c68eb2388",
                                            backgroundColor: "#C9CCD3",
                                            fontColor: "#337DFF",
                                            fontFamily: .open_sans,
                                            showIntroductionScreens: true,
                                            showSuccessScreen: false,
                                            showInvalidTokenScreen: true,
                                            activeFaceLiveness: true,
                                            audioConfiguration: AudioConfiguration.Enable,
                                            logLevel: .debug
                                            )

faceRecognitionConfig.setVisualConfiguration(visualConfiguration: visualConfiguration)
faceRecognitionConfig.setTextConfiguration(textConfiguration: textConfiguration)
```

The **QITechIosFaceRecognitionConfiguration** class is used so you can configure environment, credentials, visual and textual aspects, that is, all the necessary configurations for SDK personalization and operation.

In the table below you will find the details of all arguments that should be used in its instantiation:

| name                    |               type                | description                                                                                                                                                                                                                                                                                                                                   |
| ----------------------- | :-------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| environment             | QITechIosFaceRecognitionEnvironment | _(required)_ Enumerator that describes the environment.                                                                                                                                                                                                                                                                                         |
| clientSessionKey        |              string               | _(required)_ Token sent by the face recognition API for SDK authentication.                                                                                                                                                                                                                                                                        |
| sessionId               |              string               | _(optional)_ Unique ID used to track the entire flow taken by the user in FaceRecon execution through logs. This field accepts up to 255 characters.                                                                                                                                                                                |
| documentNumber          |              string               | _(optional)_ Used for user identification for anti-fraud and internal security |
| fontColor               |              string               | _(optional)_ Hexadecimal of the font color. If not specified, the default is #1C49A5.                                                                                                                                                                                                                                                       |
| backgroundColor         |              string               | _(optional)_ Hexadecimal of the screen background color. If not specified, the default is #FCFCFC.                                                                                                                                                                                                                                             |
| fontFamily              |            FontFamily             | _(optional)_ Font family. If not specified, the default is .open_sans. Available fonts: .open_sans, .futura, .verdana, .trebuchetms, .tamilsangammn and .system_font.                                                                                                                                                               |
| showIntroductionScreens |             boolean              | _(optional)_ Flag that indicates whether the introduction screens, with instructions on how the photo should be captured, should be shown. If not specified, the default is _true_.                                                                                                                                                                   |
| showSuccessScreen       |             boolean              | _(optional)_ Flag that indicates whether the success screen, with the success message on capture, should be shown. If not specified, the default is _true_.                                                                                                                                                                                      |
| showInvalidTokenScreen  |             boolean              | _(optional)_ Flag that indicates whether the authentication failure screen, with the token expiration message, should be shown. If not specified, the default is _true_. |
| audioConfiguration      |        AudioConfiguration         | _(optional)_ Indicates whether the SDK should or should not execute indication audios for the user. Accepted configurations are: _Enable_ which will always execute indication audios, _Disable_ which will never execute these audios and _Accessibility_ which executes audios if the user's device has accessibility settings enabled. |
| onboardingTextConfiguration | OnboardingTextConfiguration | _(optional)_ Allows configuring the instruction screen texts |
| logLevel                |             LogLevel              | _(optional)_ Used to customize the verbosity level of the SDK logs. Available levels: LogLevel.debug, LogLevel.info, LogLevel.warn, LogLevel.error and LogLevel.trace. If not specified, the default is LogLevel.debug. |

In the table below you will find all methods accepted by the instance for configuration:
:::warning
__DEPRECATED__ AS OF **v7.0.0**!
:::

| method                 |                                                                                                                     arguments                                                                                                                     | description                                                                                     |
| ---------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | --------------------------------------------------------------------------------------------- |
| setVisualConfiguration |                                                                 visualConfiguration : VisualConfiguration                                                             | _(optional)_ Class that allows modification of images displayed during SDK execution; |
| setTextConfiguration   |                                                                                                       textConfiguration : TextConfiguration                                                                                                        | _(optional)_ Class that allows modification of texts displayed during SDK execution;  |
| setDocumentNumber      |                                                    Used to define the user's document number. This field accepts 14 characters of CPF formatted as follows 000.000.000-00                                                    | Yes in all calls if using 1:1 validation at some point.                                                                                         |
| setValidation          | Used to define whether the SDK should or should not perform 1:1 validation with the user's selfie. In the user's first session this flag must be **mandatorily false**. This function requires the setDocumentNumber method to be filled. | No. Default is _false_.                                                                      |

---

# Hybrid Solutions

URL: /en/documentation/caas/face_recognition/ios/hybrid_solutions

In addition to offering native Swift integration, our SDKs are also compatible with various hybrid frameworks. This is possible through the integration of native plugins specific to each of these frameworks. Using the native system of each solution, it is feasible to incorporate our native SDK in the iOS environment.

Some of the most commonly used hybrid technologies are Xamarin ([Native Libraries](https://learn.microsoft.com/en-us/xamarin/android/platform/native-libraries)), React Native ([Native Modules](https://reactnative.dev/docs/native-modules-intro)), Cordova ([Plugin Development Guide](https://cordova.apache.org/docs/en/10.x/guide/hybrid/plugins/)), Ionic ([Native](https://ionicframework.com/docs/v3/native/)), Flutter ([Platform-Specific Code](https://docs.flutter.dev/platform-integration/platform-channels)), Unity ([Native Plug-in for iOS](https://docs.unity3d.com/Manual/PluginsForIOS.html)), Appcelerator, Phonegap and Node.

To facilitate the integration process with our native solutions, we provide plugins for React Native and Flutter frameworks. If you are interested, we provide documentation and an integration example in our private repositories. For other hybrid technologies, we have some examples of implementation of this bridge to native code. Feel free to contact our support to gain access.

---

# Introduction

URL: /en/documentation/caas/face_recognition/ios/introduction

Welcome to QI Tech's iOS Face Recognition SDK. This SDK performs face capture and sends it to the QI Tech Face Recognition API . You can use it to capture a customer's face image through your application and reference it by a key in other QI Tech system products.

## Problems?

We are not a company that hides behind an API! Contact our [support](mailto:suporte.caas@qitech.com.br) and we will respond as quickly as possible. Feel free to call us if you want a quick response!

### We Love Feedback

Even if you have already solved your problem or it is very simple (Even a typo or inadequate organization that you already understood), send us an email, so we make the documentation increasingly practical and the next person won't have to suffer the pains you suffered!

:::danger Important Warning!
Real data from individuals and/or legal entities should not be used in QI Tech's Sandbox environments.  
:::

---

# Importing the SDK

URL: /en/documentation/caas/face_recognition/ios/native_swift

## Remotely

> Starting the installation

```shell
  pod init
```

Our SDK can be imported using CocoaPods.

| SDK              | Current version                         |
| ---------------- | ------------------------------------ |
| QITechIosFaceRecon | `pod 'QITechIosFaceRecon', '~> 8.0.0'` |

:::info iOS Minimum Deployment Target
15.5
:::

:::danger Using simulators on MacBooks with arm64 chip
Currently, our FaceRecon SDK for iOS unfortunately does not support being compiled for simulators running
on a MacBook with **arm64 architecture chip** (M1/M2/M3/M4), **unless Rosetta is used**, which translates
the x86_64 architecture to arm64.
:::

To start the installation, run the command on the side in your project's root folder.

> Adding the source to podfile

```ruby
   source 'https://github.com/QITechSDKs/iOS.git'
   source 'https://cdn.cocoapods.org/'
```

The next step is to add the QI Tech source to the `podfile` file.

> Adding the pod to podfile

```ruby
  pod 'QITechIosFaceRecon', '~> <version>'
```

Finally, just add the `pod` name according to the format on the side.

:::danger Attention: 
Architecture Change (v6.0.0+) Starting from version 6.0.0, the SDK is distributed exclusively in static form. In your Podfile, you must use the :linkage => :static configuration. 
:::

> Podfile example (Version 6.0.0 or higher)

```ruby
  source 'https://github.com/QITechSDKs/iOS.git'
  source 'https://cdn.cocoapods.org/'
  target 'ExampleApp' do
    use_frameworks! :linkage => :static
    pod 'QITechIosFaceRecon', '~> 8.0.0'
  end

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if ['DatadogCore', 'DatadogInternal', 'DatadogCrashReporting', 'DatadogLogs'].include?(target.name)
        target.build_configurations.each do |config|
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.5'
          config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
        end
      end
    end
  end
```

> Podfile example (Previous Versions) 

```ruby
  source 'https://github.com/QITechSDKs/iOS.git'
  source 'https://cdn.cocoapods.org/'
  target 'ExampleApp' do
    use_frameworks!
    pod 'QITechIosFaceRecon', '~> 5.0.0'
  end

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if ['DatadogCore', 'DatadogInternal', 'DatadogCrashReporting', 'DatadogLogs'].include?(target.name)
        target.build_configurations.each do |config|
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.5'
          config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
        end
      end
    end
  end
```

:::warning Attention
When integrating dependencies on iOS, the need may arise to use static linking for some libraries and dynamic for others. This configuration is relevant to ensure compatibility, avoid build errors and optimize project performance. 
:::

### Hybrid Dependency Linking (if necessary)
The need for hybrid linking arises because some libraries have specific requirements, with some needing static linking to avoid internal conflicts and symbol duplication, and other dependencies may need dynamic linking, as they are designed for modularity and sharing between projects.

Differences Between Static and Dynamic Linking
* Static (static_framework): The library code is directly incorporated into the final binary, reducing runtime load time and eliminating external dependencies during execution.
* Dynamic (dynamic_framework): The library is loaded at runtime as a separate file. This reduces the final binary size and facilitates independent updates/modifications.

> Configuring hybrid linking in Podfile

```ruby
...

use_frameworks! :linkage => :dynamic # CONFIGURING THE DEFAULT LINKING MODE TO DYNAMIC

...

static_frameworks = ['framework_1', 'framework_2', ...] # INCLUDE ALL DEPENDENCIES THAT NEED TO BE LINKED STATICALLY
pre_install do |installer|
  installer.pod_targets.each do |pod|
    if static_frameworks.include?(pod.name)
      def pod.static_framework?;
        true
      end
      def pod.build_type;
        Pod::BuildType.static_framework
      end
    end
  end
end
```

> Installing dependencies

```shell
  pod install
```

Finally, run the `pod install` command to download and install the dependencies.

## Necessary Permissions

For the SDK to access device resources to collect the user's selfie, it is necessary to request permissions from the user.

In the **info.plist** file, add the permissions below:

| Permission                          | Reason                                             |
| ---------------------------------- | -------------------------------------------------- |
| Privacy - Camera Usage Description | Access to the camera to capture the user's selfie. |

## Starting the SDK

:::danger Important Warning!
Starting from version 5.0.0, the authentication system has been updated to use **clientSessionKey** instead of **mobileToken**. In addition, new configuration options have been added for feedback screens.
:::

### Obtaining the Client Session Key

Before configuring the SDK, you must generate a temporary **clientSessionKey** through a server-to-server request to our face recognition API.

### Endpoint

| Environment | URL |
|----------|-----|
| **Sandbox** | `https://api.sandbox.zaig.com.br/face_recognition/client_session` |
| **Production** | `https://api.zaig.com.br/face_recognition/client_session` |

### Request

**Method:** `POST`

**Headers:**
```json
{
  "Authorization": "YOUR_FACE_RECON_API_KEY"
}
```

**Body (Optional, but recommended):**
```json
{
  "user_id": "unique_user_identifier"
}
```

> **Important:** The `user_id` field is **highly recommended** for security and anti-fraud measures. Use a unique identifier for your application's user.

### Response

The successful response will contain the `client_session_key` that should be passed to the SDK configuration.

```json
{
  "client_session_key": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
```

### SDK initialization example

```swift

import QITechIosFaceRecognition

class ViewController: UIViewController, QITechIosFaceRecognitionControllerDelegate {

    var qitechFaceRecognitionConfiguration : QITechIosFaceRecognitionConfiguration?

    override func viewDidLoad() {
        super.viewDidLoad()
        self.setupFaceRecognition()
    }

    func setupFaceRecognition() -> Void {
      let clientSessionKey = try await fetchClientSessionKey()
                    
      let onboardingTextConfiguration = OnboardingTextConfiguration(
          onboardingTitle: "Relevant tips",                          // Title
          onboardingFirstLabel: "Keep your face visible",            // First instruction
          onboardingSecondlabel: "Fit your face in the oval",        // Second instruction
          onboardingThirdLabel: "Remove accessories that cover your face" // Third instruction
      )

      self.faceRecognitionConfig = QITechIosFaceRecognitionConfiguration(
          environment: QITechIosFaceRecognitionEnvironment.sandbox,
          clientSessionKey: clientSessionKey,
          sessionId: "test_session_id",
          documentNumber: "123.456.789-00",
          fontColor: "#AB9FF2",
          backgroundColor: "#FFFDF8",
          fontFamily: .futura,
          showIntroductionScreens: true,
          showSuccessScreen: true,
          showInvalidTokenScreen: false,
          audioConfiguration: AudioConfiguration.enable,
          onboardingTextConfiguration: onboardingTextConfiguration,
          logLevel: .debug 
      )
    }

    // Event where you intend to call QI Tech FaceRecognition View Controller - on this example, when the user press 'next' button

    @IBAction func pressNext(_ sender: Any) {
        let qitechFaceRecognitionController = QITechIosFaceRecognitionController(faceRecognitionConfiguration: self.faceRecognitionConfig)
        qitechFaceRecognitionViewController.delegate = self
        let qitechFaceRecognitionViewController =  qitechFaceRecognitionController.getViewController()
        present(qitechFaceRecognitionViewController, animated: true, completion: nil)
    }

    // Do something if QI Tech FaceRecognition's SDK successfully collected picture
    func qitechIosFaceRecognitionController(_ faceRecognitionViewController: QITechIosFaceRecognitionController, didFinishWithResults results: QITechIosFaceRecognitionControllerResponse) {

    }

    // Do something if QI Tech FaceRecognition's SDK found any error when collecting  picture
    func qitechIosFaceRecognitionController(_ faceRecognitionViewController: QITechIosFaceRecognitionController, didFailWithError error: QITechIosFaceRecognitionControllerError) {

    }

    // Do something if the user canceled the picture collection on any steps
    func qitechIosFaceRecognitionControllerDidCancel(_ faceRecognitionViewController: QITechIosFaceRecognitionController) {

    }
}
```

**Versions prior to v7.0.0**
```swift

import QITechIosFaceRecognition

class ViewController: UIViewController, QITechIosFaceRecognitionControllerDelegate {

    var qitechFaceRecognitionConfiguration : QITechIosFaceRecognitionConfiguration?

    override func viewDidLoad() {
        super.viewDidLoad()
        self.setupFaceRecognition()
    }

    func setupFaceRecognition() -> Void {
        // The environment can be 'Sandbox' or 'Production'
        let environment = QITechIosFaceRecognitionEnvironment.Sandbox

        // ClientSessionKey is the key you got via Face Recognition request. Each environment requires a different API_KEY.
        let clientSessionKey = fetchClientSessionKey()

        self.faceRecognitionConfig = QITechIosFaceRecognitionConfiguration(environment: environment,
                                            clientSessionKey: clientSessionKey,
                                            sessionId: "UNIQUE_SESSION_ID",
                                            backgroundColor: "#000000",
                                            fontColor: "#FFFFFF",
                                            fontFamily: .open_sans,
                                            showIntroductionScreens: true,
                                            showSuccessScreen: false,
                                            showInvalidTokenScreen: true,
                                            activeFaceLiveness: true,
                                            audioConfiguration: AudioConfiguration.Enable,
                                            logLevel: .debug
                                            )
    }

    // Event where you intend to call QI Tech FaceRecognition View Controller - on this example, when the user press 'next' button

    @IBAction func pressNext(_ sender: Any) {
        let qitechFaceRecognitionController = QITechIosFaceRecognitionController(faceRecognitionConfiguration: self.faceRecognitionConfig)
        qitechFaceRecognitionViewController.delegate = self
        let qitechFaceRecognitionViewController =  qitechFaceRecognitionController.getViewController()
        present(qitechFaceRecognitionViewController, animated: true, completion: nil)
    }

    // Do something if QI Tech FaceRecognition's SDK successfully collected picture
    func qitechIosFaceRecognitionController(_ faceRecognitionViewController: QITechIosFaceRecognitionController, didFinishWithResults results: QITechIosFaceRecognitionControllerResponse) {

    }

    // Do something if QI Tech FaceRecognition's SDK found any error when collecting  picture
    func qitechIosFaceRecognitionController(_ faceRecognitionViewController: QITechIosFaceRecognitionController, didFailWithError error: QITechIosFaceRecognitionControllerError) {

    }

    // Do something if the user canceled the picture collection on any steps
    func qitechIosFaceRecognitionControllerDidCancel(_ faceRecognitionViewController: QITechIosFaceRecognitionController) {

    }
}
```

To incorporate the SDK into your application, you must configure your custom capture application through the **QITechIosFaceRecognitionConfiguration** class and then instantiate the **ViewController QITechIosFaceRecognitionController** passing the custom configurations as an argument.

To start the face analysis process, simply call the _present_ function to call the QI Tech ViewController that will perform the selfie capture.

It is important to implement the _Delegate_ responsible for receiving returns in case of success, error or if the user interrupts the journey at any stage of validation.

Above we have a complete implementation example.

---

# necessary_permissions

URL: /en/documentation/caas/face_recognition/ios/necessary_permissions

## Necessary Permissions

For the SDK to access device resources to collect the user's selfie, it is necessary to request permissions from the user.

In the **info.plist** file, add the permissions below:

| Permission                          | Reason                                             |
| ---------------------------------- | -------------------------------------------------- |
| Privacy - Camera Usage Description | Access to the camera to capture the user's selfie. |

---

# using_sdk

URL: /en/documentation/caas/face_recognition/ios/using_sdk

## Starting the SDK

```swift

import QITechIosFaceRecognition

class ViewController: UIViewController, QITechIosFaceRecognitionControllerDelegate {

    var qitechFaceRecognitionConfiguration : QITechIosFaceRecognitionConfiguration?

    override func viewDidLoad() {
        super.viewDidLoad()
        self.setupFaceRecognition()
    }

    func setupFaceRecognition() -> Void {
        // The environment can be 'Sandbox' or 'Production'
        let environment = QITechIosFaceRecognitionEnvironment.Sandbox

        // MobileToken is the key sent to you by QI Tech. Each environment requires a different MobileToken.
        let mobileToken = "YOUR_MOBILE_TOKEN_SENT_BY_QITECH"

        self.faceRecognitionConfig = QITechIosFaceRecognitionConfiguration(environment: environment,
                                            mobileToken: mobileToken,
                                            sessionId: "UNIQUE_SESSION_ID",
                                            backgroundColor: "#000000",
                                            fontColor: "#FFFFFF",
                                            fontFamily: .open_sans,
                                            showIntroductionScreens: true,
                                            activeFaceLiveness: true,
                                            audioConfiguration: AudioConfiguration.Enable,
                                            logLevel: .debug
                                            )
    }

    // Event where you intend to call QI Tech FaceRecognition View Controller - on this example, when the user press 'next' button

    @IBAction func pressNext(_ sender: Any) {
        let qitechFaceRecognitionController = QITechIosFaceRecognitionController(faceRecognitionConfiguration: self.faceRecognitionConfig)
        qitechFaceRecognitionViewController.delegate = self
        let qitechFaceRecognitionViewController =  qitechFaceRecognitionController.getViewController()
        present(qitechFaceRecognitionViewController, animated: true, completion: nil)
    }

    // Do something if QI Tech FaceRecognition's SDK successfully collected document picture
    func qitechIosFaceRecognitionController(_ faceRecognitionViewController: QITechIosFaceRecognitionController, didFinishWithResults results: QITechIosFaceRecognitionControllerResponse) {

    }

    // Do something if QI Tech FaceRecognition's SDK found any error when collecting document picture
    func qitechIosFaceRecognitionController(_ faceRecognitionViewController: QITechIosFaceRecognitionController, didFailWithError error: QITechIosFaceRecognitionControllerError) {

    }

    // Do something if the user canceled the picture collection on any steps
    func qitechIosFaceRecognitionControllerDidCancel(_ faceRecognitionViewController: QITechIosFaceRecognitionController) {

    }
}
```

To incorporate the SDK into your application, you must configure your custom capture application through the **QITechIosFaceRecognitionConfiguration** class and then instantiate the **ViewController QITechIosFaceRecognitionController** passing the custom configurations as an argument.

To start the face analysis process, simply call the _present_ function to call the QI Tech ViewController that will perform the selfie capture.

It is important to implement the _Delegate_ responsible for receiving returns in case of success, error or if the user interrupts the journey at any stage of validation.

On the side we have a complete example of the implementation.

## Mobile Token

We use a Mobile Token to allow authenticated access from your application to our API. It has probably already been sent to you by email. If you have not yet received your token, send an email to suporte.caas@qitech.com.br .

Our API expects to receive the Mobile Token in all requests to our server from the SDK, therefore, it must be included as a configuration parameter through the method mentioned above.

:::info **Attention**

You must replace "YOUR_MOBILE_TOKEN_SENT_BY_QITECH" with the Mobile Token received from support.
:::

---

# Collecting SDK Returns

URL: /en/documentation/caas/face_recognition/web/collecting_response

## The .initialize() method

The `.initialize()` method is responsible for initializing the facial recognition and liveness proof component. Upon execution, the SDK loads the face detection model and validates device/browser conditions.

**Promise resolution:**

```javascript
{
  status: "SUCCESS",
  data: null
}
```

**Rejection Scenarios:**

- **Unsupported Browser:**

```javascript
{
  status: "FAILURE",
  reason: "UNSUPPORTED_BROWSER",
  description: "User browser is not supported."
}
```

- **Not Mobile Device:**

```javascript
{
  status: "FAILURE",
  reason: "NOT_MOBILE_DEVICE",
  description: "User device is not mobile."
}
```

- **Initialization Error:**

```javascript
{
  status: "FAILURE",
  reason: "INITIALIZATION_ERROR",
  description: "..."
}
```

## The .open() method

This method receives the `clientSessionKey` (obtained via server-to-server call) and starts the interaction with the user to collect the liveness proof. It returns a _Promise_ resolved with the captured image key once the flow is complete.

**Promise resolution:**

```javascript
{
  status: "SUCCESS",
  data: string // image_key that identifies the image on the server
}
```

Example:

```javascript
{
  status: "SUCCESS",
  data: "d8a3b1c4-9e2f-47a5-8c3d-1b2e5..."
}
```

**Promise rejection:**

```javascript
{
  status: string;
  reason: string;
  description: string;
}
```

**Rejection Scenarios:**

- **User Canceled:**

```javascript
{
  status: "FAILURE",
  reason: "USER_CANCELED",
  description: "User pressed the back button."
}
```

- **Invalid Token:** (occurs when the `clientSessionKey` is invalid or expired)

```javascript
{
  status: "FAILURE",
  reason: "INVALID_TOKEN",
  description: "Authentication token expired or invalid"
}
```

- **Session Superseded:** (occurs when `.open()` is called again on an already open instance)

```javascript
{
  status: "FAILURE",
  reason: "SESSION_SUPERSEDED",
  description: "A new session has been started before the previous one was completed."
}
```

---

# Implementation

URL: /en/documentation/caas/face_recognition/web/example

:::info New in version 4.0.0
Starting from version **4.0.0**, the `WebFaceRecon` constructor no longer receives `hostComponent` — the SDK manages its own DOM node. The `client_session_key` remains required and must be passed to the `.open()` method.
:::

The implementation is done by instantiating `QITechWebFaceRecon.WebFaceRecon()`, chaining configuration options and calling `.build()`. Initialization happens in `.initialize()`, and liveness capture is started with `.open(clientSessionKey)`.

## Obtaining the Client Session Key

Before calling `.open()`, you must generate a temporary **clientSessionKey** via a server-to-server request to our face recognition API.

### Endpoint

| Environment | URL |
|----------|-----|
| **Sandbox** | `https://api.sandbox.zaig.com.br/face_recognition/client_session` |
| **Production** | `https://api.zaig.com.br/face_recognition/client_session` |

### Request

**Method:** `POST`

**Headers:**
```json
{
  "Authorization": "YOUR_FACE_RECON_API_KEY"
}
```

**Body (Optional, but recommended):**
```json
{
  "user_id": "unique_user_identifier"
}
```

> **Important:** The `user_id` field is **highly recommended** for security and anti-fraud measures. Use a unique identifier for your application's user.

### Response

```json
{
  "client_session_key": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
```

## Complete example

```html
<script src="https://facerecon.caas.qitech.app/face-recognition-4-2-1.js"></script>

<script>
  async function startFaceRecognition() {
    // 1. Obtain the clientSessionKey via server-to-server call
    const clientSessionKey = await fetchClientSessionKey();

    // 2. Configure and instantiate the SDK
    const webFaceRecon = new QITechWebFaceRecon.WebFaceRecon()
      .setThemeConfiguration({
        primaryColor:  "#2848A8",
        tertiaryColor: "#57D9FF",
        fontFamily:    "Verdana"
      })
      .setSandboxEnvironment()
      .setSessionId("UNIQUE_SESSION_ID")
      .build();

    // 3. Initialize (validates browser/device and loads model)
    await webFaceRecon.initialize();

    // 4. Start liveness capture
    const response = await webFaceRecon.open(clientSessionKey);
    console.log(`Status: ${response.status}, Key: ${response.data}`);
  }
</script>
```

## Previous versions

:::danger Important Warning!
Versions prior to **4.0.0** receive the `hostComponent` as the first constructor argument. Starting from **3.0.0**, the `web_token` was removed from the constructor and the `client_session_key` flow was introduced.
:::

```html
<script>
  // Versions 3.x
  var hostComponent = document.getElementById('webfacerecon');
  var webFaceRecon = new QITechWebFaceRecon.WebFaceRecon(hostComponent)
    .setThemeConfiguration({
      "buttonColor": "#2848A8",
      "fontColor": "#FFFFFF",
      "backgroundColor": "#FFFFFF"
    })
    .setSandboxEnvironment()
    .setSessionId('UNIQUE_SESSION_ID')
    .build();

  webFaceRecon.initialize()
    .then(() => fetchClientSessionKey())
    .then(clientSessionKey => webFaceRecon.open(clientSessionKey))
    .then(response => console.log(`Status: ${response.status}, Key: ${response.data}`))
    .catch(error => {
      console.error(error);
      alert(error.reason || error);
    });
</script>
```

---

# The QITechWebFaceRecon.WebFaceRecon() constructor

URL: /en/documentation/caas/face_recognition/web/example_zaigwebfacerecon

The `.WebFaceRecon()` method is responsible for configuring the instance of your facial recognition component. Starting from version **4.0.0**, the constructor takes no parameters — rendering is managed internally by the SDK. Use the chained methods below to customize its behavior:

| Name | Description | Required |
|----------|----------|----------|
| `.setSandboxEnvironment()` | Configures the environment to Sandbox mode. | No |
| `.setShowInvalidTokenScreen(Boolean)` | Defines whether the authentication failure screen should be displayed. Default: `false`. | No |
| `.setShowBackButton(Boolean)` | Defines whether the back button should be displayed (when pressed, ends the flow). Default: `true`. | No |
| `.setSessionId(String)` | Defines the key that identifies the session started in the SDK — used to track the user's flow through logs. Accepts up to 255 characters. | No |
| `.setThemeConfiguration(object)` | Customizes the visual identity of the SDK. | No |
| `.setLogLevel(String)` | Verbosity level of logs. Options: `"info"`, `"debug"`, `"warn"`, `"error"`. Default: `"info"`. | No |
| `.setCameraNotAllowedErrorDescription(String)` | Custom message displayed when the user denies camera permission. | No |

The `.setThemeConfiguration` method must receive an object with the following fields:

| Name | Type | Description |
| -------- | -------- | -------- |
| primaryColor | String | Hexadecimal of the SDK's primary color (background, header). Default: `#285BB8`. |
| tertiaryColor | String | Hexadecimal of the action button color. Default: `#57D9FF`. |
| fontFamily | String | _Font Family_ to be applied to SDK text. If not provided, the system default font will be used. |

## Previous Versions

:::danger Important Warning!
Starting from version **4.0.0**, the `hostComponent` parameter and `web_token` in the constructor were removed. The SDK manages its own DOM node internally.
:::

In versions prior to **4.0.0**, the constructor received the following positional parameters:

| Name | Description | Required |
|----------|----------|----------|
| hostComponent | Parent HTML component that housed the SDK HTML. | Yes |
| web_token | Client key sent by QI Tech. | Yes (versions < 3.0.0) |

---

# Importing the library

URL: /en/documentation/caas/face_recognition/web/import

To import our library, add our library address to a **src** TAG in your website's HTML:

```html
<script src="https://facerecon.caas.qitech.app/face-recognition-4-2-1.js"></script>
```

---

# Introduction

URL: /en/documentation/caas/face_recognition/web/introduction

Welcome to QI Tech's Web Face Recognition integration manual! This library performs face capture and sends it to the QI Tech Face Recognition API . You can use this library to capture a client's face image through your website and reference it through a key in other QI Tech system products.

In this step-by-step guide you will find library details as well as a javascript implementation example. With this, you have the necessary tools to adapt to your application's use case.

## Problems?

We are not a company that hides behind an API! Contact our support and we will respond as quickly as possible. Feel free to call us if you want a quick response!

### We Love Feedback

Even if you have already solved your problem or it is very simple (Even a typo or inadequate organization that you already understood), send us an email, so we make the documentation increasingly practical and the next person won't need to suffer the pains you suffered!

## Environments

We have two environments for our clients. 

* Production
* Sandbox

:::danger Important Warning!
Real data from individuals and/or legal entities should not be used in QI Tech's Sandbox environments.  
:::

The selection is performed through the `.setSandboxEnvironment()` method during SDK configuration, which will change the environment to Sandbox. If the method is not called, the production environment will be used.

---

# Face Registration and 1:1 Validation

URL: /en/documentation/caas/face_recognition/web/registration_and_validation

:::danger Deprecated Feature
The `.setDocumentNumber()` and `.setValidation()` methods have been discontinued and removed from the Web Face Recognition SDK. The face registration and 1:1 validation flow via Web SDK is no longer supported in any version.

To perform face registration and validation, use the [Face Recognition API](https://docs.qitech.com.br/documentation/caas/face_recognition/api/face_registration) directly.
:::

---

# authentication

URL: /en/documentation/caas/limits/authentication

## Authentication

> To authenticate a request, use the following code:

```shell
# In the shell, you only need to add the appropriate header to each request
curl "api_endpoint_here"
  -H "Authorization: EXAMPLE_API_KEY"
```

> Replace the API key `EXAMPLE_API_KEY` with the key provided by our support team.

We use an API Key to allow access to our API. It was most likely already sent to you by email. If you have not yet received your key, please send an email to suporte.caas@qitech.com.br .

Our API expects the API Key to be sent in all requests to our server using a header like the one below:

`Authorization: EXAMPLE_API_KEY`

:::info **Attention**

You must replace EXAMPLE_API_KEY with the API Key provided by the support team.
:::

---

# HTTP Status

URL: /en/documentation/caas/limits/http_status

All QI Tech APIs use the following standardization for HTTP response status codes, in accordance with RFC 7231 :

HTTP Status | Meaning | Description
---------- | ------- | ---------------------------------
400 | Bad Request | The request sent contains a formatting error. In most cases, we return an explanation in the response body indicating where the error is.
401 | Unauthorized | There was an authentication issue. Please verify that the API Key is correct and sent in the proper header, according to the Authentication section.
403 | Forbidden | The accessed endpoint is for internal use and is not available for this API Key.
404 | Not Found | The requested data was not found using the provided key. This status is also returned when an invalid endpoint is requested.
405 | Method Not Allowed | The HTTP method used does not apply to the accessed endpoint.
406 | Not Acceptable | The data sent in the request body is invalid. In general, this means the payload is not a valid JSON.
409 | Conflict | The request ID corresponds to an ID that has already been processed. This status is returned in the case of duplicate requests sent to the server.
500 | Internal Server Error | We encountered an issue while processing this request. When this error occurs, our specialists are automatically notified and immediately begin analysis and resolution.
503 | Service Unavailable | You have encountered a planned or unplanned infrastructure outage of our servers.

---

# Introduction

URL: /en/documentation/caas/limits/introduction

Welcome to the QI Tech Pix Limits API! You can use our API to manage your pix limits:
- Register new pix limits;
- Modify pre-existing pix limits;
- Retrieve pre-existing pix limits.

Below, you can see the API implementation using cUrl. This provides you with examples that you can adapt to the programming language of your choice.

## Problems?

We are not a company that hides behind an API! Contact our support and we will respond as quickly as possible. Feel free to call us if you need a quick response!

### We Love Feedback

Even if you have already solved your problem or it is very simple (even a typo or inadequate organization that you already understood), send us an email, so we can make the documentation increasingly practical and the next person won't have to suffer the pains you suffered!

## Environments

We have two environments for our clients. The base API URLs are:

* Production - `https://api.caas.qitech.app/limits/`
* Sandbox - `https://api.sandbox.caas.qitech.app/limits/`

In the Sandbox environment, submitted analyses are not charged and are responded to according to pre-established rules.

For transaction analysis, the following rule is applied based on the transaction value:

Minimum | Maximum | Decision
------- | ------- | --------
0 | 1000 | Automatically Approved
1001 | 2000 | Referred to manual analysis - Subsequently approved
2001 | 3000 | Referred to manual analysis - Subsequently rejected
3001 | 4000 | Automatically Rejected
4001 | 5000 | Not analyzed
5001 | - | Pending

## HTTPS Only

For security reasons, all communication with QI Tech APIs must be done using HTTPS communication. To prevent HTTP calls from being made due to inattention or other reasons, this server only provides port 443 with TLS 1.2 communication. Calls made using other protocols will be automatically denied.

## Authentication

> To authenticate a call, use the following code:

```shell
# In the shell, you only need to add the appropriate header to each request
curl "api_endpoint_here"
  -H "Authorization: EXAMPLE_API_KEY"
```

> Replace the API key 'EXAMPLE_API_KEY' with your key obtained from our support.

We use an API Key to allow access to our API. It has probably already been sent to you by email. If you have not yet received your key, send an email to suporte.caas@qitech.com.br .

Our API expects to receive the API Key in all requests to our server in a header like the one below:

`Authorization: EXAMPLE_API_KEY`

:::info **Attention**

You must replace EXAMPLE_API_KEY with the API Key received from support.
:::

---

# New Limit Registration

URL: /en/documentation/caas/limits/limit_registration

To register a new limit, simply send an _Account_ type object to the following endpoint:

`POST https://api.caas.qitech.app/limits/account`

<!-- At the end of registering an individual on your platform, it is necessary to perform fraud and KYC evaluation of this customer, which should be done through the Natural Person endpoint. The data sent must be final data, which will not be changed under any circumstances, that is, there should be no possibility of making changes to basic registration data such as CPF, Name, Date of Birth and others after this process. This is very important to ensure two points:

* Data consistency in the Anti-fraud database
* Realistic risk assessment, avoiding fraud at later stages of the operation -->

> Example

```json
{
    "account_id": "5ce7fab5-8165-44a5-9b89-bb2d6d61e4f4",
    "registration_date": "2019-12-20T15:23:12",
    "limit": {
        "pix": {
            "withdraw": [
                {
                    "start_time": "06:00:00-03:00",
                    "amount": 500000
                },
                {
                    "start_time": "20:00:00-03:00",
                    "amount": 300000
                }
            ],
            "change": [
                {
                    "start_time": "06:00:00-03:00",
                    "amount": 500000
                },
                {
                    "start_time": "20:00:00-03:00",
                    "amount": 300000
                }
            ],
            "transaction_natural_person": [
                {
                    "start_time": "06:00:00-03:00",
                    "amount": 500000
                },
                {
                    "start_time": "20:00:00-03:00",
                    "amount": 300000
                }
            ],
            "transaction_legal_person": [
                {
                    "start_time": "06:00:00-03:00",
                    "amount": 500000
                },
                {
                    "start_time": "20:00:00-03:00",
                    "amount": 300000
                }
            ]
        }
    }
}
```

All information exchanges for a registration use the following definition for this object. In some cases, to facilitate implementation and reduce data flow between parties, some information may be omitted.

name | type | description
:----: | :----: | ---------
account_id | string | Unique account identifier. **It is essential that this number is unique for each request**
registration_date |	string (ISO 8601) | Registration date and time.
limit |	limit | 	_limit_ type object.

## Limit Object

```json
{
    "pix": {
        "withdraw": [
            {
                "start_time": "06:00:00-03:00",
                "amount": 500000
            },
            {
                "start_time": "20:00:00-03:00",
                "amount": 300000
            }
        ],
        "change": [
            {
                "start_time": "06:00:00-03:00",
                "amount": 500000
            },
            {
                "start_time": "20:00:00-03:00",
                "amount": 300000
            }
        ],
        "transaction": [
            {
                "start_time": "06:00:00-03:00",
                "amount": 500000
            },
            {
                "start_time": "20:00:00-03:00",
                "amount": 300000
            }
        ]
    }
}
```

This object represents the value limits applicable to different types of transactions at different times of the day, taking into account the division between daytime and nighttime periods.

The object is organized into three main categories (or limit types): "withdraw" (referring to PIX Withdrawal mode), "change" (referring to PIX Change mode), and "transaction" (referring to transactional PIX mode). Each category can contain a list of up to two dictionaries, each representing - respectively - the daytime and nighttime limit periods, describing the start time and the respective value limits to be applied for the mode.

Limit Window Structure:

name |	type |	description
:----: | :----: | ---------
start_time |	string (ISO 8601) |	Indicates the moment when the value limits for PIX transactions are applied. Pay attention to the correct configuration of the Limit Window start according to the time zone you intend to use.
amount |	integer |	Maximum limit value allowed for the mode in the period specified by "start_time" in cents of Brazilian reais.

Since, according to Central Bank guidelines, daytime PIX limit windows must start at 6AM, only the value "06:00:00-03:00" will currently be accepted for configuring the start_time of these windows.

Similarly, since nighttime PIX limit windows must start at 8PM or 10PM, only the values "20:00:00-03:00" and "22:00:00-03:00", respectively, will be accepted for configuring the start_time of these windows.

*Usage Example:*
Let's assume the user is making a PIX transaction at 12:00:00-03:00. When consulting the object, we locate the "transaction" category (PIX Transaction). In this category, we find two dictionaries: the first starts at "06:00:00-03:00" and the second starts at "20:00:00-03:00". If the PIX transaction is made between these times, the maximum allowed value limit is 5,000.00 (five thousand) Brazilian reais, as specified in the first limit window.

However, if the transaction occurs after "20:00:00-03:00" and before the next start time (in this example, at 06:00 the next day), the maximum allowed value limit will be 3,000.00 (three thousand) Brazilian reais, as indicated in the second (nighttime) limit window.

# Creating a Limit Modification Proposal

To request a limit modification, simply send a Limit type object to the following endpoint:

`POST https://api.caas.qitech.app/limits/account/{account_id}/limit_update_request`

> Example

```json
{
    "pix": {
        "withdraw": [
            {
                "start_time": "06:00:00-03:00",
                "amount": 500000
            },
            {
                "start_time": "20:00:00-03:00",
                "amount": 300000
            }
        ],
        "change": [
            {
                "start_time": "06:00:00-03:00",
                "amount": 500000
            },
            {
                "start_time": "20:00:00-03:00",
                "amount": 300000
            }
        ],
        "transaction_natural_person": [
            {
                "start_time": "06:00:00-03:00",
                "amount": 500000
            },
            {
                "start_time": "20:00:00-03:00",
                "amount": 300000
            }
        ]
    }
}
```

Which will return the following response:

```json
{
    "limit_update_request_id": "5ce7fab5-8165-44a5-9b89-bb2d6d61e4f4",
    "analysis_status": "automatically_approved",
    "client_notification_status": "not_applicable",
    "limit_update_request_status": "applied",
    "event_date": "2019-10-01T10:37:25-03:00"
}
```

name |	type |	description
:----: | :----: | ---------
limit_update_request_id |	string |	Unique identifier for the Limit Modification Proposal
analysis_status |	string |	Enumerator for the proposal's analysis_status
client_notification_status |	string |	Enumerator for the proposal's client_notification_status
limit_update_request_status |	string |	Enumerator for the proposal's limit_update_request_status
event_date |	string (ISO 8601) |	Date and time of the Limit Modification Proposal creation

---

# Creating a Recipient List

URL: /en/documentation/caas/limits/recipient_list

According to the Central Bank's PIX limits regulation, it is possible to create a recipient list that will use the same
differentiated limit.

To request the creation of a recipient list for an account, simply send a Limit type object to the following endpoint:

`POST https://api.caas.qitech.app/limits/account/{account_id}/recipient_list`

```json
{
    "limit": {
        "pix": {
            "transaction": [
                {
                    "start_time": "06:00:00-03:00",
                    "amount": 60000
                },
                {
                    "start_time": "20:00:00-03:00",
                    "amount": 60000
                }
            ]
        }
    }
}
```

Which will return the following response:

```json
{
    "event_date": "2019-10-01T10:37:25-03:00"
}
```

name |	type |	description
:----: | :----: | ---------
event_date |	string (ISO 8601) |	Date and time of the Recipient List creation

# Adding a New Recipient to the Recipient List

To add a new recipient to a previously created recipient list, simply make the following request:

`POST https://api.caas.qitech.app/limits/account/{account_id}/recipient_list/recipient`

```json
{
    "document_number": "123.456.789-10"
}
```

Which will return the following response:

```json
{
    "recipient_id": "c7a79970-b558-4425-998a-5cd6747c1c90",
    "analysis_status": "automatically_approved",
    "client_notification_status": "awaiting_notification_period",
    "recipient_status": "created",
    "event_date": "2019-10-01T10:37:25-03:00"
}
```

name |	type |	description
:----: | :----: | ---------
recipient_id |	string |	Unique identifier of the Recipient for this Limit Modification Proposal
analysis_status |	string |	Enumerator of the proposal's analysis_status
client_notification_status |	string |	Enumerator of the proposal's client_notification_status
recipient_status |	string |	Enumerator of the proposal's recipient_status
event_date |	string (ISO 8601) |	Date and time of the Limit Modification Proposal creation

For a better understanding of the return statuses, access status dynamics .

# Removing a Recipient

To remove a specific recipient from an account, simply send a DELETE request to the following address:

`DELETE https://api.caas.qitech.app/limits/account/{account_id}/recipient_list/recipient/{recipient_id}`

# Editing the Limits of a Recipient List

To request the modification of the recipient limits for a given account, simply send the following request:

`POST https://api.caas.qitech.app/limits/account/{account_id}/recipient_list/limit_update_request`

```json
{
    "pix": {
        "transaction": [
            {
                "start_time": "06:00:00-03:00",
                "amount": 600000
            },
            {
                "start_time": "20:00:00-03:00",
                "amount": 300000
            }
        ]
    }
}
```

Which will return the following response:
```json
{
    "limit_update_request_id": "c7a79970-b558-4425-998a-5cd6747c1c90",
    "analysis_status": "automatically_approved",
    "client_notification_status": "awaiting_notification_period",
    "recipient_status": "created",
    "event_date": "2019-10-01T10:37:25-03:00"
}
```

name |	type |	description
:----: | :----: | ---------
recipient_id |	string |	Unique identifier of the Recipient for this Limit Modification Proposal
analysis_status |	string |	Enumerator of the proposal's analysis_status
client_notification_status |	string |	Enumerator of the proposal's client_notification_status
recipient_status |	string |	Enumerator of the proposal's recipient_status
event_date |	string (ISO 8601) |	Date and time of the Limit Modification Proposal creation

---

# Standards

URL: /en/documentation/caas/limits/standards

To facilitate integration and ensure data integrity, some standards have been defined and are followed throughout the entire API.

## Date and Time with Time Zone
> Some examples:

```
2019-10-15T22:35:12-03:00
2018-05-01T13:32:11+00:00
2019-05-01T00:00:00+00:00
```

It is represented according to ISO 8601. In this case, the time zone is placed right after the time and must represent the time zone of the location where that data is valid. For example, if a rental is scheduled to start at 09:30 at Brasília airport, the time sent must be represented as 09:30-03:00. If the rental is scheduled to start at 09:30 in Manaus, it must be represented as 09:30-04:00.

The validation mask used is the following:

`YYYY-MM-ddThh:mm:ss±hh:mm`

## Date and Time without Time Zone
> Some examples:

```
2019-10-15T22:35:12Z
2018-05-01T13:32:11Z
2019-05-01T00:00:00Z
```

It is represented according to ISO 8601. Data that does not depend on a time zone must be sent without it, always in UTC, with the letter `Z` indicating that the data is in UTC. Therefore, the following format will be validated:

`YYYY-MM-ddThh:mm:ssZ`

## Date
> Some examples:

``` 
2019-10-15
2019-01-01
2017-03-20
```

For fields that accept only a date, such as a birthdate, only the date should be sent, without any time, using the following format:

`YYYY-MM-dd`

## Documents

Since document numbers can vary greatly and many of them contain non-numeric characters, all document numbers are defined as strings. Another important reason to define them as strings is to prevent leading zeros from being lost. Documents listed on this page have a well-defined mask and will be subject to validation. Other documents, such as RG, due to their lack of standardization, will not be validated.

## CPF

> Examples of CPFs valid against the defined mask:

```
123.456.789-12
321.987.543-23
111.283.333-00
```

> Examples of CPFs invalid against the defined mask:

```
8.577.477-8
08.104.627/0001-23
123.456.789-1
23.456.789-01
```

The CPF is always defined as a string and will be validated against the mask:

`###.###.###-##`

## CNPJ

> Examples of CNPJs valid against the defined mask:

```
08.104.627/0001-02
01.079.210/0114-67
32.402.502/0001-35
```

> Examples of CNPJs invalid against the defined mask:

```
8.577.477-8
123.456.789-12
321.987.543-23
32.402.502/0001-3
032.402.502/0001-3
```

The CNPJ is always defined as a string and will be validated against the mask:

`##.###.###/####-##`

---

# Status Dynamics

URL: /en/documentation/caas/limits/status_dynamics

## Analysis Status (analysis_status)

The "analysis_status" indicates the status of the Limit Policy decision.

The possible values for "analysis_status" are as follows:

analysis_status | Description
:---------: | ---------
automatically_approved | the Limit Policy automatically approved this limit modification request.
automatically_reproved | the Limit Policy automatically rejected this limit modification request.
in_manual_analysis | the Limit Policy delegated this limit modification request for manual desk analysis.
manually_approved | After manual analysis, the analyst decided to approve the limit modification.
manually_reproved | After manual analysis, the analyst decided to reject the limit modification.
reproved_by_time | The request was rejected because the analysis time expired.
pending | The request is pending to be processed.

## Client Notification Status (client_notification_status)

The "client_notification_status" is related to the period during which the client must be notified about the progress of the limit modification request.

client_notification_status | Description
:---------: | ---------
awaiting_notification_period | Indicates that the time window for client notification has not yet started.
in_notification_period | Indicates that we are in the time window for client notification.
notification_period_expired | Indicates that the time window for client notification has already expired.

## Limit Update Request Status (limit_update_request_status)

The "limit_update_request_status" is related to the status of the limit modification request.

limit_update_request_status | Description
:---------: | ---------
created | Indicates that the limit change request was created.
applied | Indicates that the limit change request was applied.
canceled | Indicates that the limit change request was canceled.

## Recipient List Change Status (recipient_list_append_request_status)

The "recipient_list_append_request_status" is related to the status of the recipient list modification request.

recipient_list_append_request_status | Description
:---------: | ---------
created | Indicates that the recipient list change request was created.
applied | Indicates that the recipient list change request was applied.
canceled | Indicates that the recipient list change request was canceled.

---

# Webhook

URL: /en/documentation/caas/limits/webhook

Updates to monitoring topics will be notified through webhook deliveries. To enable this, it is necessary to configure—through the [support](mailto:suporte.caas@qitech.com.br) team—an endpoint address where we will send update notifications, as well as a *signature_key* that will be used to sign the request. It is important to note that all webhook deliveries will be sent to a single endpoint.

:::info **Attention**

For security reasons, all Webhook requests will only be made to endpoints served over HTTPS.
:::

## Signature

> Example of signature calculation in Python

```python
    hmac_obj = hmac.new(signature_key.encode('utf-8'), (url + method + payload).encode('utf-8'), hashlib.sha1)
    return hmac_obj.hexdigest()
```

To ensure that the request received at the webhook endpoint originates from our servers, an HMAC signature is sent in the *Signature* header, similarly to the authentication process.

After calculating the expected signature value on the server side, it is necessary to compare the calculated signature with the one received. If the signatures match, it means that the request originated from our servers and can be trusted.

## Retries

The notification is considered successfully delivered when an HTTP 200 status is returned. If delivery fails, up to 7 retry attempts will be made with the following intervals, until a 200 response is received or all attempts are exhausted:

* 10 seconds
* 40 seconds
* 160 seconds
* 640 seconds
* 2560 seconds
* 10240 seconds
* 40960 seconds

---

# builder

URL: /en/documentation/caas/ocr/android/builder

## DocumentRecognition.Builder

| Parameter | Function | Required |
|------------|--------------|--------------|
|mobileToken |Client key that identifies that the collected data comes from your application. If you have not yet received your mobile-token, contact <a href='mailto:suporte.caas@qitech.com.br'>support</a>.|Yes.|
|.setDocumentSteps(DocumentRecognitionStep[] documentSteps)|Defines the document capture flow performed by the user. More information [here](https://docs.zaig.com.br/android_ocr/#documentdetectorstep)|Yes.|
|.setSandboxEnvironment()|If this parameter is used in the constructor, the library will be configured to send data to the sandbox environment. If absent, requests are sent to the production environment.|No.|
|.showIntroductionScreens(Boolean showIntroductionScreens)|When "false" disables the document photo collection introduction screens that appear to the user.|No. Default is "true".|
|.setShowSuccessScreen(Boolean showSuccessScreen)|When "false" disables the success screen after photo collection.|No. Default is "true".|
|.setBackgroundColor(String backgroundColor)|Allows configuration of the background color of the SDK activities.|No. Default is "#ffffff".|
|.setFontColor(String fontColor)|Allows configuration of the font color and icons of the SDK activities.|No. Default is "#000000".|
| .setFontFamily(FontFamily fontFamily)| Allows configuration of the font of the SDK activities.| No. If not provided, the default is FontFamily.open_sans. Available fonts: FontFamily.open_sans, FontFamily.futura, FontFamily.verdana, FontFamily.roboto, FontFamily.poppins and FontFamily.helvetica.|No.|
|.setVisualConfiguration([VisualConfiguration](https://docs.zaig.com.br/android_ocr/#o-objeto-visualconfiguration). visualConfiguration)| Used to customize the images shown to the user throughout the SDK execution.|No.|
|.setTextConfiguration([TextConfiguration](https://docs.zaig.com.br/android_ocr/#o-objeto-textconfiguration). textConfiguration) | Used to customize the onboarding introductory screen texts shown to the user throughout the SDK execution.|No.|
|.setSessionId(String sessionId)| Used to define the key that identifies the session started in the SDK. It is used to track the entire flow traversed by the user in the FaceRecon execution through logs. This field accepts up to 255 characters. |No.|
|.setLogLevel(DocumentRecognition.LogLevel logLevel)| Used to customize the verbosity level of the SDK logs. Available levels: LogLevel.debug, LogLevel.info, LogLevel.warn, LogLevel.error and LogLevel.trace. Default is LogLevel.debug. |No.|

## The VisualConfiguration Object

| Parameter                                                                      | Function                                                                                                                                                                                                                                                              | Required             |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
| .setOnboardingDrawable(int onboarding_drawable, int onboarding_width)          | Used to configure the image shown to the user on the SDK onboarding screen. The _onboarding_drawable_ parameter should reference the id of the image to be shown and _onboarding_width_ is the desired display size of this image.                       | No.                    |
| .setDocumentFullDrawable(int documentfull_drawable, int documentfull_width)    | Used to configure the image shown to the user on the SDK full CNH capture screen. The _documentfull_drawable_ parameter should reference the id of the image to be shown and _documentfull_width_ is the desired display size of this image.       | No.                    |
| .setDocumentFrontDrawable(int documentfront_drawable, int documentfront_width) | Used to configure the image shown to the user on the SDK CNH and RG front capture screen. The _documentfront_drawable_ parameter should reference the id of the image to be shown and _documentfront_width_ is the desired display size of this image. | No.                    |
| .setDocumentBackDrawable(int documentback_drawable, int documentback_width)    | Used to configure the image shown to the user on the SDK CNH and RG back capture screen. The _documentback_drawable_ parameter should reference the id of the image to be shown and _documentback_width_ is the desired display size of this image.    | No.                    |
| .setButtonBorderSize(int border_size)                                          | Used to configure the border width of the SDK buttons.                                                                                                                                                                                                     | No. Default is _1_.    |
| .setButtonShadow(boolean button_shadow)                                        | When set to _false_ removes the shadow effect, default on android, used by the SDK buttons.                                                                                                                                                             | No. Default is _true_. |

## The TextConfiguration Object

| Parameter                                                                      | Function                                                                                                                                                                                                                                                              | Required             |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
| .setCustomText(CustomLabel label, String text) | Used to configure the texts shown to the user on the SDK onboarding screen| No.|

---

# Handling Responses

URL: /en/documentation/caas/ocr/android/collecting_response

To obtain the **RequestResponseObject** object, which contains the captures obtained by the SDK, override the *onActivityResult* method in the same *activity* where you started the **DocumentRecognitionActivity**:

```java
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        DocumentRecognition.RequestResponseObject result;
        if (requestCode == REQUEST_CODE){
            if (resultCode == RESULT_OK && data != null){
                DocumentRecognition.RequestResponseObject mRequestResponseObject = data.ParcelableExtra("result");
            }
        }
    }
```

### RequestResponseObject Attributes Description

Attribute | Description
--------- | ---------
ocr_key | Identification key of the provided image that can be used in any other QI Tech system service.
template | Identifies which photo that OCR Key refers to.

---

# DocumentRecognitionStep

URL: /en/documentation/caas/ocr/android/document_step

The document capture flow that the user will be subjected to is defined through an array of objects of type **DocumentRecognitionStep** (available in the SDK), where each element is one of the capture steps performed by the user. 

```java
DocumentSteps = new DocumentRecognitionStep[]{
        new DocumentRecognitionStep(Document.cnh_front),
        new DocumentRecognitionStep(Document.cnh_back)
};
```

Above, a flow is implemented that will collect from the user first the front of their CNH (cnh_front) and, after validating the collection of a quality photo, the back of the CNH.

The DocumentRecognitionStep object can assume the following values:

```java
public enum Document {
    cnh, // Complete Brazilian Driver's License
    cnh_front, // Brazilian Driver's License front (Photo side)
    cnh_back, // Brazilian Driver's License back (Signature side)
    cnh_digital, // PDF of Brazilian digital Driver's License
    rg_front, // Brazilian Identity Card front (Photo side)
    rg_back, // Brazilian Identity Card back (Data side)
    proof_of_address, // Proof of Address
    other // Other identification documents
}
```

---

# Hybrid solutions

URL: /en/documentation/caas/ocr/android/hybrid_solutions

In addition to offering native integration in Java, our SDKs are also compatible with various hybrid frameworks. This is possible through the integration of native plugins specific to each of these frameworks. Using the native system of each solution, it is feasible to incorporate our native SDK in the Android environment.

Some of the most used hybrid technologies are React Native ([Native Modules](https://reactnative.dev/docs/turbo-native-modules-introduction)), Cordova ([Plugin Development Guide](https://cordova.apache.org/docs/en/latest/guide/hybrid/plugins/index.html)), Ionic ([Native](https://ionicframework.com/docs/v3/native/)), Unity ([Native Plug-in for Android](https://docs.unity3d.com/Manual/PluginsForAndroid.html)), Xamarin ([Native Libraries](https://learn.microsoft.com/en-us/xamarin/android/platform/native-libraries)), Appcelerator, Phonegap and Node.

To facilitate the integration process with our native solutions, we provide plugins for React Native and Flutter frameworks. If you are interested, we provide documentation and an integration example in our private repositories. For other hybrid technologies, we have some examples of implementation of this bridge to native code. Feel free to contact our support to gain access.

---

# DocumentDetectorStep

URL: /en/documentation/caas/ocr/android/implementation_demo

The following code is a reference example for the correct implementation of the SDK in an _activity_:

```java

import com.qitech.documentrecognition.Document;
import com.qitech.documentrecognition.DocumentRecognition;
import com.qitech.documentrecognition.DocumentRecognitionResponse;
import com.qitech.documentrecognition.DocumentRecognitionStep;
import com.qitech.documentrecognition.DocumentRecognitionActivity;

import java.util.ArrayList;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    ConstraintLayout constraintLayout;
    ImageView backVector, iconVector;
    TextView textViewBack, textViewTitle, textViewDescription;
    Button buttonCNHfull, buttonCNH, buttonRG;
    DocumentRecognitionStep[] DocumentSteps;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_onboarding1);
        constraintLayout = findViewById(R.id.constraintLayout);
        backVector = findViewById(R.id.backVector);
        iconVector = findViewById(R.id.iconVector);
        textViewBack = findViewById(R.id.textViewBack);
        textViewTitle = findViewById(R.id.textViewTitle);
        textViewDescription = findViewById(R.id.textViewDescription);
        buttonCNH = findViewById(R.id.buttonCNH);
        buttonRG = findViewById(R.id.buttonRG);
        buttonCNHfull = findViewById(R.id.buttonCNHfull);

        constraintLayout.setBackgroundColor(Color.parseColor("#000000"));
        backVector.setColorFilter(Color.parseColor("#FFFFFF"));
        iconVector.setColorFilter(Color.parseColor("#FFFFFF"));
        textViewBack.setTextColor(Color.parseColor("#FFFFFF"));
        textViewTitle.setTextColor(Color.parseColor("#FFFFFF"));
        textViewDescription.setTextColor(Color.parseColor("#FFFFFF"));

        backVector.setOnClickListener(this);
        textViewBack.setOnClickListener(this);
        buttonCNH.setOnClickListener(this);
        buttonRG.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        if (view.getId() == R.id.textViewBack || view.getId() == R.id.backVector) {
            finish();
        }
        else if (view.getId() == R.id.buttonCNH) {
            Log.i("OnboardingActivity1Tag", "CNH document was chosen");
            DocumentSteps = new DocumentRecognitionStep[]{
                    new DocumentRecognitionStep(Document.cnh_front),
                    new DocumentRecognitionStep(Document.cnh_back)};
        } else if (view.getId() == R.id.buttonRG) {
            Log.i("OnboardingActivity1Tag", "RG document was chosen");
            DocumentSteps = new DocumentRecognitionStep[]{
                    new DocumentRecognitionStep(Document.rg_front),
                    new DocumentRecognitionStep(Document.rg_back)};
        } else if (view.getId() == R.id.buttonCNHfull) {
            Log.i("OnboardingActivity1Tag", "CNH full document was chosen");
            DocumentSteps = new DocumentRecognitionStep[]{
                    new DocumentRecognitionStep(Document.cnh)};
        }

        Intent intent = new Intent(getApplicationContext(), DocumentRecognitionActivity.class);
        DocumentRecognition mDocumentRecognition = new DocumentRecognition.Builder("d782a5be-2f96-452b-bf21-4d1bbfd0d710")
                .setDocumentSteps(DocumentSteps)
                .setBackgroundColor("#000000")
                .setFontColor("#FFFFFF")
                .setFontFamily(DocumentRecognition.FontFamily.open_sans)
                .setSessionId(String.valueOf(UUID.randomUUID()))
                .setLogLevel(FaceRecognition.LogLevel.debug)
                .build();
        intent.putExtra("settings", mDocumentRecognition);
        startActivityForResult(intent, 1);
        }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode == 1){
            if (resultCode == RESULT_OK && data != null){
                Intent resultIntent = new Intent();
                setResult(RESULT_OK, resultIntent);
                ArrayList<DocumentRecognitionResponse> mDocumentRecognitionResponse = data.getParcelableArrayListExtra("DocumentRecognitionResponse");
                resultIntent.putParcelableArrayListExtra("DocumentRecognitionResponse", mDocumentRecognitionResponse);
                finish();
            } else {
                // the user closed the activity
            }
        }
        super.onActivityResult(requestCode, resultCode, data);
    }
}

```

---

# Introduction

URL: /en/documentation/caas/ocr/android/introduction

Welcome to QI Tech's Android OCR SDK (Optical Character Recognition) for document reading. This SDK performs document capture and sends it to the QI Tech OCR API . You can use it to capture an image of a document from your client to be recognized through your application, such as a Driver's License or Identity Card, and reference it through a key in other QI Tech system products.

## Problems?

We are not a company that hides behind an API! Contact our [support](mailto:suporte.caas@qitech.com.br) and we will respond as quickly as possible. Feel free to call us if you want a quick response!

### We Love Feedback

Even if you have already solved your problem or it is very simple (Even a typo or inadequate organization that you already understood), send us an email, so we make the documentation increasingly practical and the next person won't need to suffer the pains you suffered!

:::danger Important Warning!
Real data from individuals and/or legal entities should not be used in QI Tech's Sandbox environments.  
:::

---

# Native Integration

URL: /en/documentation/caas/ocr/android/native_java

To import our SDKs, it is necessary to make changes to the Project and Application _build.gradle_.

## Adding to Project

Add our maven repository address to the project's _build.gradle_ (in Android Studio this file appears as: **"Project: \{project_name\}"**), as shown in the example below.

```java
maven { url 'https://sdks.qitech.com.br/' }
```

## Adding to Application

After that, add the library you want to import to your app's build.gradle (in Android Studio this file appears as: **"Module: \{project_name\}.app"**), including the dependency shown below.

```java
dependencies {
    implementation 'com.qitech.android:documentrecognition:v5.0.0'
}
```

:::warning
Since **April 2025**, new Google Play policies require **Android API Level 35** for applications to be published
or updated on the Google Play Store. Therefore, we strongly recommend using **targetSdkVersion version 35** at least.
:::

:::info
Using **targetSdkVersion 35** implies using **compileSdkVersion 35**, which triggers some **minimum requirements** for tools
in the Android ecosystem:
* compileSdkVersion 35 --> AGP 8.6.0
* AGP 8.6.0 --> Gradle 8.7
* AGP 8.6.0 --> Java 17 (JDK 17)
* AGP 8.6.0 --> Kotlin 2+
:::

## Starting the SDK

To incorporate the SDK into your application, you must configure your custom capture application through a Builder component and submit it as a parameter via Intent Extra to DocumentRecognitionActivity.

```java
Intent intent = new Intent(context, DocumentRecognitionActivity.class);

var onboardingTextConfiguration = new OnboardingTextConfiguration(
    "Relevant tips",                           // Title
    "Keep the document visible",               // First instruction
    "Fit your document in the marks",          // Second instruction
    "Remove the plastic covering the document" // Third instruction
);

DocumentRecognition mDocumentRecognition = new DocumentRecognition.Builder(sand_mobile_token)
    .setDocumentSteps(DocumentSteps)
    .setSandboxEnvironment()
    .setSessionId("SESSION_ID")
    .setFontColor("#000000")
    .setBackgroundColor("#FFFFFF")
    .setFontFamily(DocumentRecognition.FontFamily.open_sans)
    .setShowIntroductionScreens(true)
    .setShowSuccessScreen(true)
    .setOnboardingTextConfiguration(onboardingTextConfiguration)
    .setLogLevel(DocumentRecognition.LogLevel.debug)
    .build();

intent.putExtra("settings", mDocumentRecognition);
startActivityForResult(intent, REQUEST_CODE);
```

**Versions prior to v4.0.0**
    ```java
    Intent intent = new Intent(context, DocumentRecognitionActivity.class);

    VisualConfiguration visualConfiguration = new VisualConfiguration()
            .setOnboardingDrawable(R.drawable.introscreen,500)
            .setDocumentFrontDrawable(R.drawable.documentfront, 500)
            .setDocumentBackDrawable(R.drawable.documentback, 500);

    TextConfiguration textConfiguration = new TextConfiguration()
            .setCustomText(TextConfiguration.CustomLabel.onboardingTitle, "Let's get started!")
            .setCustomText(TextConfiguration.CustomLabel.onboardingFirstLabel, "- Go to a well-lit place")
            .setCustomText(TextConfiguration.CustomLabel.onboardingSecondLabel, "- Remove the document from the plastic")
            .setCustomText(TextConfiguration.CustomLabel.onboardingThirdLabel, "- Insert your document in the frame, waiting for it to turn green to capture.");

    DocumentRecognition mDocumentRecognition = new DocumentRecognition.Builder("YOUR_MOBILE_TOKEN_SENT_BY_QITECH")
            .setDocumentSteps(DocumentSteps)
            .setVisualConfiguration(visualConfiguration)
            .setTextConfiguration(textConfiguration)
            .showIntroductionScreens(true)
            .setShowSuccessScreen(false)
            .setBackgroundColor("#000000")
            .setFontColor("#FFFFFF")
            .setFontFamily(DocumentRecognition.FontFamily.open_sans)
            .setSessionId("SESSION_ID")
            .setLogLevel(DocumentRecognition.LogLevel.debug)
            .build();
    intent.putExtra("settings", mDocumentRecognition);
    startActivityForResult(intent, REQUEST_CODE);
    ```

We use a Mobile Token to allow authenticated access from your application to our API. It has probably already been sent to you by email. If you have not yet received your token, send an email to suporte.caas@qitech.com.br .

Our API expects to receive the Mobile Token in all requests to our server from the SDK, therefore, it must be included as a configuration parameter through the method mentioned above.

:::info **Attention**

You must replace "YOUR_MOBILE_TOKEN_SENT_BY_QITECH" with the Mobile Token received from support.
:::

## DocumentRecognition.Builder

| Parameter | Function | Required |
|------------|--------------|--------------|
|mobileToken |Client key that identifies that the collected data comes from your application. If you have not yet received your mobile-token, contact suporte.caas@qitech.com.br.|Yes.|
|.setDocumentSteps(DocumentRecognitionStep[] documentSteps)|Defines the document capture flow performed by the user. More information [here](/documentation/caas/ocr/android/document_step)|Yes.|
|.setSandboxEnvironment()|If this parameter is used in the constructor, the library will be configured to send data to the sandbox environment. If absent, requests are sent to the production environment.|No.|
|.setSessionId(String sessionId)| Used to define the key that identifies the session started in the SDK. It is used to track the entire flow taken by the user in the OCR execution through logs. This field accepts up to 255 characters. |No.|
|.setFontColor(String fontColor)|Allows configuration of the font and icon color of the SDK activities.|No. Default is "#1C49A5".|
|.setBackgroundColor(String backgroundColor)|Allows configuration of the background color of the SDK activities.|No. Default is "#FCFCFC".|
|.setFontFamily(FontFamily fontFamily)| Allows configuration of the font of the SDK activities.| No. If not specified, the default is FontFamily.open_sans. Available fonts: FontFamily.open_sans, FontFamily.futura, FontFamily.verdana, FontFamily.roboto, FontFamily.poppins and FontFamily.helvetica.|No.|
|.showIntroductionScreens(Boolean showIntroductionScreens)|When "false" disables the document photo collection introduction screens that appear to the user.|No. Default is "true".|
|.setShowSuccessScreen(Boolean showSuccessScreen)|When "false" disables the success screen after photo capture.|No. Default is "true".|
|.setOnboardingTextConfiguration(OnboardingTextConfiguration onboardingTextConfiguration) |Allows customization of the instructions on the introduction screen. | No.|
|.setLogLevel(DocumentRecognition.LogLevel logLevel)| Used to customize the verbosity level of the SDK logs. Available levels: LogLevel.debug, LogLevel.info, LogLevel.warn, LogLevel.error and LogLevel.trace. Default is LogLevel.debug. |No.|

**Versions prior to v4.0.0**
    | Parameter | Function | Required |
    |------------|--------------|--------------|
    |mobileToken |Client key that identifies that the collected data comes from your application. If you have not yet received your mobile-token, contact suporte.caas@qitech.com.br.|Yes.|
    |.setDocumentSteps(DocumentRecognitionStep[] documentSteps)|Defines the document capture flow performed by the user. More information [here](/documentation/caas/ocr/android/document_step)|Yes.|
    |.setSandboxEnvironment()|If this parameter is used in the constructor, the library will be configured to send data to the sandbox environment. If absent, requests are sent to the production environment.|No.|
    |.showIntroductionScreens(Boolean showIntroductionScreens)|When "false" disables the document photo collection introduction screens that appear to the user.|No. Default is "true".|
    |.setShowSuccessScreen(Boolean showSuccessScreen)|When "false" disables the success screen after photo capture.|No. Default is "true".|
    |.setBackgroundColor(String backgroundColor)|Allows configuration of the background color of the SDK activities.|No. Default is "#ffffff".|
    |.setFontColor(String fontColor)|Allows configuration of the font and icon color of the SDK activities.|No. Default is "#000000".|
    | .setFontFamily(FontFamily fontFamily)| Allows configuration of the font of the SDK activities.| No. If not specified, the default is FontFamily.open_sans. Available fonts: FontFamily.open_sans, FontFamily.futura, FontFamily.verdana, FontFamily.roboto, FontFamily.poppins and FontFamily.helvetica.|No.|
    |.setVisualConfiguration(VisualConfiguration visualConfiguration)| Used to customize the images shown to the user throughout the SDK execution.|No.|
    |.setTextConfiguration(TextConfiguration textConfiguration) | Used to customize the introductory onboarding screen texts shown to the user throughout the SDK execution.|No.|
    |.setSessionId(String sessionId)| Used to define the key that identifies the session started in the SDK. It is used to track the entire flow taken by the user in the OCR execution through logs. This field accepts up to 255 characters. |No.|
    |.setLogLevel(DocumentRecognition.LogLevel logLevel)| Used to customize the verbosity level of the SDK logs. Available levels: LogLevel.debug, LogLevel.info, LogLevel.warn, LogLevel.error and LogLevel.trace. Default is LogLevel.debug. |No.|

## The VisualConfiguration Object
:::warning
__DEPRECATED__ AS OF **v4.0.0**!
:::

| Parameter                                                                      | Function                                                                                                                                                                                                                                                              | Required             |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
| .setOnboardingDrawable(int onboarding_drawable, int onboarding_width)          | Used to configure the image shown to the user on the SDK onboarding screen. The _onboarding_drawable_ parameter should reference the id of the image to be shown and _onboarding_width_ is the desired display size of this image.                       | No.                    |
| .setDocumentFullDrawable(int documentfull_drawable, int documentfull_width)    | Used to configure the image shown to the user on the full CNH capture screen of the SDK. The _documentfull_drawable_ parameter should reference the id of the image to be shown and _documentfull_width_ is the desired display size of this image.       | No.                    |
| .setDocumentFrontDrawable(int documentfront_drawable, int documentfront_width) | Used to configure the image shown to the user on the SDK CNH and RG front capture screen. The _documentfront_drawable_ parameter should reference the id of the image to be shown and _documentfront_width_ is the desired display size of this image. | No.                    |
| .setDocumentBackDrawable(int documentback_drawable, int documentback_width)    | Used to configure the image shown to the user on the SDK CNH and RG back capture screen. The _documentback_drawable_ parameter should reference the id of the image to be shown and _documentback_width_ is the desired display size of this image.    | No.                    |
| .setButtonBorderSize(int border_size)                                          | Used to configure the border width of the SDK buttons.                                                                                                                                                                                                     | No. Default is _1_.    |
| .setButtonShadow(boolean button_shadow)                                        | When set to _false_ removes the shadow effect, default on android, used by the SDK buttons.                                                                                                                                                             | No. Default is _true_. |

## The TextConfiguration Object
:::warning
__DEPRECATED__ AS OF **v4.0.0**!
:::

| Parameter                                      | Function                                                                                    | Required |
| ---------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------- |
| .setCustomText(CustomLabel label, String text) | Used to configure the texts shown to the user on the SDK onboarding screen | No.        |

---

# using_sdk

URL: /en/documentation/caas/ocr/android/using_sdk

## Starting the SDK

To incorporate the SDK into your application, you must configure your custom capture application through a Builder component and submit it as a parameter via Intent Extra to DocumentRecognitionActivity.

```java
  Intent intent = new Intent(context, DocumentRecognitionActivity.class);

  VisualConfiguration visualConfiguration = new VisualConfiguration()
          .setOnboardingDrawable(R.drawable.introscreen,500)
          .setDocumentFrontDrawable(R.drawable.documentfront, 500)
          .setDocumentBackDrawable(R.drawable.documentback, 500);

  TextConfiguration textConfiguration = new TextConfiguration()
           .setCustomText(TextConfiguration.CustomLabel.onboardingTitle, "Let's get started!")
           .setCustomText(TextConfiguration.CustomLabel.onboardingFirstLabel, "- Go to a well-lit location")
           .setCustomText(TextConfiguration.CustomLabel.onboardingSecondLabel, "- Remove the document from the plastic")
           .setCustomText(TextConfiguration.CustomLabel.onboardingThirdLabel, "- Insert your document in the frame, waiting for it to turn green to perform the capture.");

  DocumentRecognition mDocumentRecognition = new DocumentRecognition.Builder("YOUR_MOBILE_TOKEN_SENT_BY_QITECH")
          .setDocumentSteps(DocumentSteps)
          .setVisualConfiguration(visualConfiguration)
          .setTextConfiguration(textConfiguration)
          .showIntroductionScreens(true)
          .setShowSuccessScreen(false)
          .setBackgroundColor("#000000")
          .setFontColor("#FFFFFF")
          .setFontFamily(DocumentRecognition.FontFamily.open_sans)
          .setSessionId("SESSION_ID")
          .setLogLevel(FaceRecognition.LogLevel.debug)
          .build();
  intent.putExtra("settings", mDocumentRecognition);
  startActivityForResult(intent, REQUEST_CODE);
```

We use a Mobile Token to allow authenticated access from your application to our API. It has probably already been sent to you by email. If you have not yet received your token, send an email to suporte.caas@qitech.com.br .

Our API expects to receive the Mobile Token in all requests to our server coming from the SDK, therefore, it must be included as a configuration parameter through the method mentioned above.

:::info **Attention**

You must replace "YOUR_MOBILE_TOKEN_SENT_BY_QITECH" with the Mobile Token received from support.
:::

---

# authentication

URL: /en/documentation/caas/ocr/api/authentication

## Authentication
> To authenticate a call, use the following code:

```shell
# In the shell, you only need to add the appropriate header in each request
curl "api_endpoint_here"
  -H "Authorization: EXAMPLE_API_KEY"
```

> Replace the API key 'EXAMPLE_API_KEY' with your key acquired from our support.

We use an API Key to allow access to our API. It has probably already been sent to you by email. If you have not yet received your key, send an email to suporte.caas@qitech.com.br .

Our API expects to receive the API Key in all requests to our server in a header like the one below:

`Authorization: EXAMPLE_API_KEY`

:::info **Attention**

You must replace EXAMPLE_API_KEY with the API Key received from support.
:::

---

# HTTP Status

URL: /en/documentation/caas/ocr/api/http_status

All QI Tech APIs use the following standardization in HTTP return statuses, according to RFC 7231 :

HTTP Status | Meaning | Description
---------- | ------- | ---------------------------------
400 | Bad Request | The request sent has some formatting error. In most cases, we return in the message body an explanation of where the error is.
401 | Unauthorized | There was a problem with authentication, check if the API Key is correct and in the correct header, according to the Authentication section.
403 | Forbidden | The accessed endpoint is for internal use and is not available for this API Key.
404 | Not Found | The requested data was not found using the key used. This status is also returned when an invalid endpoint is requested.
405 | Method Not Allowed | The HTTP method used does not apply to the endpoint used.
406 | Not Acceptable | The data sent in the request body is invalid. In general, this means that the data sent is not valid JSON.
409 | Conflict | The request id corresponds to an id already processed previously. This status is returned in case of duplicate requests sent to the server.
500 | Internal Server Error | We had a problem processing this request, when we encounter this error our specialists are automatically notified and start analysis and resolution immediately.
503 | Service Unavailable | You encountered a planned or unplanned unavailability of our server infrastructure.

---

# Introduction

URL: /en/documentation/caas/ocr/api/introduction

Welcome to QI Tech's OCR API (Optical Character Recognition) for document reading. You can use this API to send an image of a document to be recognized, such as a Driver's License or Identity Card, and reference it through a key in other QI Tech system products.

## Problems?

We are not a company that hides behind an API! Contact our support and we will respond as quickly as possible. Feel free to call us if you want a quick response!

### We Love Feedback

Even if you have already solved your problem or it is very simple (Even a typo or inadequate organization that you already understood), send us an email, so we make the documentation increasingly practical and the next person won't need to suffer the pains you suffered!

## Environments

We have two environments for our clients. The base URLs of the APIs are:

* Production - `https://api.caas.qitech.app/ocr/`
* Sandbox - `https://api.sandbox.caas.qitech.app/ocr/`

:::danger Important Warning!
Real data from individuals and/or legal entities should not be used in QI Tech's Sandbox environments.  
:::

## HTTPS Only

For security reasons, all communication with QI Tech APIs must be performed using HTTPS communication. To prevent HTTP calls from being made due to inattention or other reasons, this server only provides port 443 with TLS 1.2 communication. Calls made using other protocols will be automatically denied.

## Authentication
> To authenticate a call, use the following code:

```shell
# In the shell, you only need to add the appropriate header in each request
curl "api_endpoint_here"
  -H "Authorization: EXAMPLE_API_KEY"
```

> Replace the API key 'EXAMPLE_API_KEY' with your key acquired from our support.

We use an API Key to allow access to our API. It has probably already been sent to you by email. If you have not yet received your key, send an email to suporte.caas@qitech.com.br .

Our API expects to receive the API Key in all requests to our server in a header like the one below:

`Authorization: EXAMPLE_API_KEY`

:::info **Attention**

You must replace EXAMPLE_API_KEY with the API Key received from support.
:::

---

# quality

URL: /en/documentation/caas/ocr/api/quality

## Image quality validation

Request Body: Invalid image case

```json
    {
        "title": "document_quality",
        "description": "A imagem enviada não pode ser processada com êxito."
    }
```

When making a POST to the image endpoint, if the image is not sufficient for validation, an HTTP Status Code 400 will be returned, as can be seen in the example above. Status Code 400 is also returned when the document does not meet the image requirements mentioned above.

**Attention -** There are other reasons why we return 400 (All related to invalid data). Only returns with the title "document_quality" are the result of poor image quality validation and therefore should be passed on to the user.

---

# Sending a Document

URL: /en/documentation/caas/ocr/api/send_image

Send a document using the `/image` endpoint as indicated below. This endpoint will return a GUID (Globally Unique Identifier) for the document, which can then be referenced in other QI Tech system services.

## Submission
To send a document, simply perform a POST method sending the base64 code of the image in json format to the following address:

`https://api.caas.qitech.app/ocr/image`

Request Body

```json
  {
    "document_b64": "\<BASE64_IMAGE\>",
    "template": "cnh",
    "file_type": "jpeg"
  }
```

Replace the base64 code of your document in place of the placeholder.

### Request Attributes Description

Attribute | Description
--------- | ---------
document_b64 | Required field. Document image to be analyzed in base64 format.
template | Required field. Declares the template that should be applied for image analysis.
file_type | Optional field. Identifies the format of the sent file, `jpeg` or `pdf`. If not sent, the value `jpeg` is assumed.

### Available templates
At this time, QI Tech presents the following templates available for OCR analysis. If your required document is not included in this list, send an email to suporte.caas@qitech.com.br and inquire about the details regarding the implementation of this feature.

Template | Description
--------- | ---------
cnh | Complete Brazilian Driver's License.
cnh_front | Brazilian Driver's License front (Photo side).
cnh_back | Brazilian Driver's License back (Signature side).
cnh_digital | PDF of Brazilian digital Driver's License.
rg_front | Brazilian Identity Card front (Photo side).
rg_back | Brazilian Identity Card back (Data side).
danfe | Auxiliary Document of Electronic Invoice (NF-e).
proof_of_address | Proof of address.
letter_of_attorney | Power of attorney that grants powers regarding a company.
company_statute | Articles of incorporation or company statute.

## Image
To ensure greater reliability of the analyses performed, it is necessary for the client to follow some rules when taking the photo:

* Remove the document from the plastic;
* Ensure that the document is centered in the photo;
* Ensure that the document is well-lit;
* Ensure that all document data is clear, visible and legible;
* Ensure that the photo is visible and clear.

## Image Requirements
For the API to function properly, pay attention to the following parameters.

* The image must be in JPEG or PDF format;
* The image must have at least 500 pixels in height and 500 pixels in width;
* The API does not support reading handwritten documents;
* The maximum image size varies according to the chosen format, following the limits below:

Format | Maximum supported size
--------- | ---------
.JPEG | 3MB
.PNG | 10MB
.PDF | 30MB

## Response
If your document reading request is processed successfully, an HTTP status 200 and a JSON object with the identifier pointing to the document that was sent will be returned.

Response Body

```json
    {
        "ocr_key": "f1c0d2e1-f950-4360-896d-36588e443fc9"
    }   
```

### Response Attributes Description

Attribute | Description
--------- | ---------
ocr_key | Identification key of the provided image that can be used in any other QI Tech system service.

## Document recovery
> Image recovery

```shell
    curl "https://api.caas.qitech.app/ocr/image/f4b5337a-7b50-406e-8c8e-7d0e77b5aa02/file" \
         -H "Authorization: EXAMPLE_API_KEY"
```

At any time it is possible to recover the sent images. For this, simply send a properly authenticated **GET** request to the endpoint:

`https://api.caas.qitech.app/ocr/image/{image_key}/file`

Where image_key is the value returned during image submission.

## Image quality validation

Response Body: Invalid image case

```json
    {
        "title": "document_quality",
        "description": "A imagem enviada não pode ser processada com êxito."
    }
```

When making a POST to the image endpoint, if the image is not sufficient for validation, an HTTP Status Code 400 will be returned, as can be seen in the example above. Status Code 400 is also returned when the document does not meet the image requirements mentioned above.

**Attention -** There are other reasons why we return 400 (All related to invalid data). Only returns with the title "document_quality" are the result of poor image quality validation and therefore should be passed on to the user.

## Face quality validation

Image quality validation is applied **exclusively to documents that contain faces**, such as RG, CNH and passports. When an image is sent to the system, if it is identified as one of the types below, a **face analysis is automatically performed**:

- `national_migration_registry_front`
- `passport_front`
- `ctps_front`
- `regional_nursing_council_registry_front`
- `regional_nursing_council_registry`
- `national_registry_of_foreigners_back`
- `passport`
- `national_migration_registry`
- `national_registry_of_foreigners`
- `cnh_digital`
- `rg_front`
- `rg`
- `cnh_front`
- `cnh`

During this analysis, the system checks if there is **a visible face in the image** and evaluates aspects such as:

- Adequate lighting (brightness);
- Presence of accessories such as sunglasses;
- Excessive proximity or distance from the face;
- Complete absence of faces in the image.

If any of these criteria indicate that the image is not adequate, an error will be returned with `title: "face_validation"` and the respective `description`, as detailed below.

```json
{
    "title": "face_validation",
    "description": "<error_code>"
}
```

### Return example:

**No face detected**

```json
{
    "title": "face_validation",
    "description": "no_faces"
}
```

---

### Message translation table for user display

| Error code (`description`) | Friendly message |
|-------------------------------|-------------------|
| `close_face`                  | The image was captured too close to the face. Reposition the document. |
| `distant_face`                | The image was captured too far from the face. Reposition the document. |
| `wearing_acessories`          | The person in the image is wearing sunglasses or accessories that cover the eyes. |
| `brightness_problem`          | The image is too dark. Resend with more lighting. |
| `no_faces`                    | It was not possible to detect a face in the image. Check if the face is visible. |

---

# Handling Responses

URL: /en/documentation/caas/ocr/ios/collecting_response

```swift
class ViewController: UIViewController, QITechIosOcrControllerDelegate {
    
    // Do something if QI Tech OCR's SDK succesfully collected document picture
    func qitechIosOcrController(_ ocrViewController: QITechIosOcrController, didFinishWithResults response: QITechIosOcrControllerResponse) {
    
    }
    
    // Do something if QI Tech OCR's SDK found any error when collecting document picture
    func qitechIosOcrController(_ ocrViewController: QITechIosOcrController, didFailWithError error: QITechIosOcrControllerError) {
        
    }
    
    // Do something if the user canceled the picture collection on any steps
    func qitechIosOcrControllerDidCancel(_ ocrViewController: QITechIosOcrController) {

    }
}
```
To obtain the SDK responses, you must implement the **QITechIosOcrControllerDelegate** delegate in your controller, as shown in the example above.

## QITechIosOcrControllerResponse

The **QITechIosOcrControllerResponse** class is used so you can receive the response from QI Tech's SDK.

In the table below you will find the detail of all properties of this class:

name | type | description 
---- | :----: | --------- 
OcrResponses | List of OcrResponse | Identifies

## OcrResponse Object

name | type | description 
---- | :----: | --------- 
OcrKey | string | Unique identifier of the image in QI Tech. You must store this identifier to send to the QI Tech API that will perform the validation (e.g.: Onboarding API)
DocumentTemplate | QITechIosOcrDocumentTemplate | Enumerator that identifies which photo that OCR Key refers to.

The possible values of the **QITechIosOcrDocumentTemplate** enumerator can be:

* `QITechIosOcrDocumentTemplate.CnhFull` - Identifies the result of the complete CNH validation.
* `QITechIosOcrDocumentTemplate.CnhFront` - Identifies the result of the CNH front validation.
* `QITechIosOcrDocumentTemplate.CnhBack` - Identifies the result of the CNH back validation.
* `QITechIosOcrDocumentTemplate.RgFront` - Identifies the result of the RG front validation.
* `QITechIosOcrDocumentTemplate.RgBack` - Identifies the result of the RG back validation.
* `QITechIosOcrDocumentTemplate.NationalRegistryOfForeignersFront` - Identifies the result of the National Registry of Foreigners front validation.
* `QITechIosOcrDocumentTemplate.NationalRegistryOfForeignersBack` - Identifies the result of the National Registry of Foreigners back validation.

## QITechIosOcrControllerError

The **QITechIosOcrControllerError** class is triggered in case of any error that leads to the SDK shutdown. When this occurs, QI Tech will return a subclass that will have a name corresponding to the error that led to the SDK shutdown, as shown in the table below:

class | description 
---- | --------- 
InvalidMobileToken | MobileToken sent in the settings is invalid.
MissingPermission | One of the permissions necessary for validation was not sufficient.
NetworkFailure | The user lost internet connection during validation.
ServerFailure | QI Tech's server returned some error response to the SDK.
MissingStorage | There is not enough storage space on the user's device for the image collection to be performed.
LowImageQuality | For some reason the quality of the collected image was not sufficient for validation to be performed.

To map which subclass, and therefore, what the error reason is, use Swift's *isKindOfClass()* method.

---

# QITechIosOcrConfiguration

URL: /en/documentation/caas/ocr/ios/configuration

```swift
let onboardingTextConfiguration = OnboardingTextConfiguration(
        onboardingTitle: "Relevant tips",
        onboardingFirstLabel: "Be in a well-lit place",
        onboardingSecondLabel: "Remove the document from the envelope",
        onboardingThirdLabel: "Frame the document in the marks"
)

let ocrConfig = QITechIosOcrConfiguration(
        environment: QITechIosOcrEnvironment.sandbox,
        mobileToken: "41fb4755-9bcf-4ae3-b981-b6009e51ce4a",
        sessionId: "288eb399-4936-4133-ab2c-5611d6e5bb7a",
        documentSteps: documentSteps,
        fontColor: "#337DFF",
        backgroundColor: "#C9CCD3",
        fontFamily: .open_sans,
        showIntroductionScreens: true,
        showSuccessScreen: false,
        onboardingTextConfiguration: onboardingTextConfiguration,
        logLevel: .debug
)
```

**Versions prior to v7.0.0**
```swift

let visualConfiguration = VisualConfiguration()
        visualConfiguration.setOnboarding(onboardingFilePath: Bundle.main.path(forResource: "onboarding", ofType: "png")!, onboardingWidth: 200)

let textConfiguration = TextConfiguration()
        textConfiguration.setCustomText(on: .onboardingTitle, text: "Let's get started!")
        textConfiguration.setCustomText(on: .onboardingFirstLabel, text: "- Go to a location with good lighting")
        textConfiguration.setCustomText(on: .onboardingSecondLabel, text: "- Remove the document from the plastic")

let ocrConfig = QITechIosOcrConfiguration(environment: QITechIosOcrEnvironment.Sandbox,
                                            mobileToken: "41fb4755-9bcf-4ae3-b981-b6009e51ce4a",
                                            sessionId: "288eb399-4936-4133-ab2c-5611d6e5bb7a",
                                            documentSteps: documentSteps,
                                            backgroundColor: "#C9CCD3",
                                            fontColor: "#337DFF",
                                            fontFamily: .open_sans,
                                            showIntroductionScreens: true,
                                            showSuccessScreen: false,
                                            logLevel: .debug
                                            )

ocrConfig.setVisualConfiguration(visualConfiguration: visualConfiguration)
ocrConfig.setTextConfiguration(textConfiguration: textConfiguration)

```

The **QITechIosOcrConfiguration** class is used so you can configure environment, credentials, visual and textual aspects, and the document image collection flow, that is, all the necessary settings for SDK customization and operation.

In the table below you will find the details of all arguments that must be used in its instantiation:

| name                    |          type          | description                                                                                                                                                                                                                              |
| ----------------------- | :--------------------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| environment             | QITechIosOcrEnvironment  | _(required)_ Enumerator that describes the environment.                                                                                                                                                                                    |
| mobileToken             |         string         | _(required)_ Token sent by QI Tech for SDK authentication.                                                                                                                                                                      |
| sessionId               |         string         | _(optional)_ Unique ID used to track the entire flow taken by the user in the OCR execution through logs. This field accepts up to 255 characters.                                                                                 |
| documentSteps           | QITechIosOcrDocumentFlow | _(required)_ Enumerator that describes which validation flow will be followed, defining which document and which image capture order will be performed.                                                                               |
| fontColor               |         string         | _(optional)_ Hexadecimal of the font color. If not specified, the default is #1C49A5.                                                                                                                                              |
| backgroundColor         |         string         | _(optional)_ Hexadecimal of the screen background color. If not specified, the default is #FCFCFC.                                                                                                                                        |
| fontFamily              |       FontFamily       | _(optional)_ Font family. If not specified, the default is .open_sans. Available fonts: .open_sans, .futura, .verdana, .trebuchetms, .tamilsangammn and .system_font.                                                          |
| showIntroductionScreens |        boolean        | _(optional)_ Flag that indicates whether the introduction screens, with instructions on how the photo should be captured, should be shown. If not specified, the default is _true_.                                                              |
| showSuccessScreen |             boolean              | _(optional)_ Flag that indicates whether the success screen, with the success message on capture, should be shown. If not specified, the default is _true_.                                                                                                                                                                   |
| onboardingTextConfiguration | OnboardingTextConfiguration | _(optional)_ Allows configuring the instruction screen texts |
| logLevel                |        LogLevel        | _(optional)_ Used to customize the verbosity level of the SDK logs. Available levels: LogLevel.debug, LogLevel.info, LogLevel.warn, LogLevel.error and LogLevel.trace. If not specified, the default is LogLevel.debug. |

In the table below you will find all methods accepted by the instance for configuration:
:::warning
__DEPRECATED__ AS OF **v7.0.0**!
:::

| method                 |                                                 arguments                                                  | description                                                                                     |
| ---------------------- | :---------------------------------------------------------------------------------------------------------: | --------------------------------------------------------------------------------------------- |
| setVisualConfiguration | visualConfiguration : VisualConfiguration | _(optional)_ Class that allows modification of images displayed during SDK execution; |
| setTextConfiguration   |                                    textConfiguration : TextConfiguration                                    | _(optional)_ Class that allows modification of texts displayed during SDK execution;  |

---

# Hybrid solutions

URL: /en/documentation/caas/ocr/ios/hybrid_solutions

In addition to offering native integration in Swift, our SDKs are also compatible with various hybrid frameworks. This is possible through the integration of native plugins specific to each of these frameworks. Using the native system of each solution, it is feasible to incorporate our native SDK in the iOS environment.

Some of the most used hybrid technologies are React Native ([Native Modules](https://reactnative.dev/docs/turbo-native-modules-introduction)), Cordova ([Plugin Development Guide](https://cordova.apache.org/docs/en/latest/guide/hybrid/plugins/index.html)), Ionic ([Native](https://ionicframework.com/docs/v3/native/)), Unity ([Native Plug-in for iOS](https://docs.unity3d.com/Manual/PluginsForIOS.html)), Xamarin ([Native Libraries](https://learn.microsoft.com/en-us/xamarin/ios/platform/native-libraries)), Appcelerator, Phonegap and Node.

To facilitate the integration process with our native solutions, we provide plugins for React Native and Flutter frameworks. If you are interested, we provide documentation and an integration example in our private repositories. For other hybrid technologies, we have some examples of implementation of this bridge to native code. Feel free to contact our support to gain access.

---

# Introduction

URL: /en/documentation/caas/ocr/ios/introduction

Welcome to QI Tech's iOS OCR SDK (Optical Character Recognition) for document reading. This SDK performs document capture and sends it to the QI Tech OCR API . You can use it to capture an image of a document from your client to be recognized through your application, such as a Driver's License or Identity Card, and reference it through a key in other QI Tech system products.

## Problems?

We are not a company that hides behind an API! Contact our [support](mailto:suporte.caas@qitech.com.br) and we will respond as quickly as possible. Feel free to call us if you want a quick response!

### We Love Feedback

Even if you have already solved your problem or it is very simple (Even a typo or inadequate organization that you already understood), send us an email, so we make the documentation increasingly practical and the next person won't need to suffer the pains you suffered!

:::danger Important Warning!
Real data from individuals and/or legal entities should not be used in QI Tech's Sandbox environments.  
:::

---

# Importing the SDK

URL: /en/documentation/caas/ocr/ios/native_swift

## Remotely

> Starting installation

```shell
  pod init
```

Our SDK can be imported using CocoaPods.

| SDK        | Current version                |
| ---------- | ------------------------------ |
| QITechIosOCR | `pod 'QITechIosOCR', '~> 8.0.0'` |

:::info iOS Minimum Deployment Target
15.5
:::

:::danger Using simulators on MacBooks with arm64 chip
Currently, our OCR SDK for iOS unfortunately does not support being compiled for simulators running
on a MacBook with **arm64 architecture chip** (M1/M2/M3/M4), **unless Rosetta is used**, which translates
the x86_64 architecture to arm64.
:::

To start installation, run the command above in your project's root folder.

> Adding the source to the podfile

```ruby
   source 'https://github.com/QITechSDKs/iOS.git'
```

The next step is to add QI Tech's source to the `podfile` file.

> Adding the pod to the podfile

```ruby
  pod 'QITechIosOCR', '~> <version>'
```

Finally, just add the `pod` name according to the format above.

:::danger Attention: 
Architecture Change (v6.0.0+) Starting from version 6.0.0, the SDK is distributed exclusively in static form. In your Podfile, you must use the configuration :linkage => :static. 
:::

> Podfile example (Version 6.0.0 or higher)

```ruby
  source 'https://github.com/QITechSDKs/iOS.git'
  source 'https://cdn.cocoapods.org/'
  target 'ExampleApp' do
    use_frameworks! :linkage => :static
    pod 'QITechIosOCR', '~> 8.0.0'
  end

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if ['DatadogCore', 'DatadogInternal', 'DatadogCrashReporting', 'DatadogLogs'].include?(target.name)
        target.build_configurations.each do |config|
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.5'
          config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
        end
      end
    end
  end
```

> Podfile example (Previous Versions)

```ruby
  source 'https://github.com/QITechSDKs/iOS.git'
  source 'https://cdn.cocoapods.org/'
  target 'ExampleApp' do
    use_frameworks! 
    pod 'QITechIosOCR', '~> 4.0.0'
  end

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if ['DatadogCore', 'DatadogInternal', 'DatadogCrashReporting', 'DatadogLogs'].include?(target.name)
        target.build_configurations.each do |config|
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.5'
          config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
        end
      end
    end
  end
```

:::warning Attention
When integrating dependencies in iOS, the need may arise to use static linking for some libraries and dynamic for others. This configuration is relevant to ensure compatibility, avoid build errors and optimize project performance. 
:::

### Hybrid Dependency Linking (if necessary)
The need for hybrid linking arises because some libraries have specific requirements, with some needing static linking to avoid internal conflicts and symbol duplication and other dependencies may need dynamic linking, as they are designed for modularity and sharing between projects.

Differences Between Static and Dynamic Linking
* Static (static_framework): The library code is directly incorporated into the final binary, reducing runtime loading time and eliminating external dependencies during execution.
* Dynamic (dynamic_framework): The library is loaded at runtime as a separate file. This reduces the final binary size and facilitates independent updates/modifications.

> Configuring hybrid linking in Podfile

```ruby
...

use_frameworks! :linkage => :dynamic # CONFIGURANDO O MODO PADRÃO DE LINKAGEM PARA DINÂMICO

...

static_frameworks = ['framework_1', 'framework_2', ...] # INCLUIR TODAS AS DEPENDÊNCIAS QUE PRECISAM SER LINKADAS DE MODO ESTÁTICO
pre_install do |installer|
  installer.pod_targets.each do |pod|
    if static_frameworks.include?(pod.name)
      def pod.static_framework?;
        true
      end
      def pod.build_type;
        Pod::BuildType.static_framework
      end
    end
  end
end
```

> Installing dependencies

```shell
  pod install
```

Finally, run the `pod install` command to download and install the dependencies.

## Required Permissions

For the SDK to access device resources to collect the photo, it is necessary to request permissions from the user.

In the **info.plist** file, add the permissions below:

| Permission                          | Reason                                               |
| ---------------------------------- | ---------------------------------------------------- |
| Privacy - Camera Usage Description | Camera access to capture document photos. |

## Starting the SDK

```swift

import QITechIosOcr

class ViewController: UIViewController, QITechIosOcrControllerDelegate {

    var qitechOcrConfiguration : QITechIosOcrConfiguration?

    override func viewDidLoad() {
        super.viewDidLoad()
        self.setupOcr()
    }

    func setupOcr() -> Void
    {
        let onboardingTextConfiguration = OnboardingTextConfiguration(
          onboardingTitle: "Relevant tips",                     // Title
          onboardingFirstLabel: "Be in a well-lit place",       // First instruction
          onboardingSecondLabel: "Remove the document from the envelope",  // Second instruction
          onboardingThirdLabel: "Frame the document in the marks" // Third instruction
        )

        // The environment can be 'sandbox' or 'production'
        let environment: QITechIosOcrEnvironment = .sandbox

        // MobileToken is the key sent to you by QI Tech. Each environment requires a different MobileToken.
        let mobileToken: String = "YOUR_MOBILE_TOKEN"

        // The documentFlow can be 'CnhFull' , 'CnhFrontAndBack' or 'RgFrontAndBack'
        let documentFlow = QITechIosOcrDocumentFlow.CnhFrontAndBack

        let sessionId: String = "SESSION_ID"
        let fontColor: String = "#ED6C2D"
        let backgroundColor: String = "#EEEEEE"
        let fontFamily: FontFamily? = .verdana
        let showIntroductionScreens: Bool = true
        let showSuccessScreen: Bool = true
        let logLevel: QITechIosOCR.LogLevel = .debug

        self.ocrConfig = QITechIosOcrConfiguration(
          environment: environment,
          mobileToken: mobileToken,
          documentSteps: documentFlow,
          sessionId: sessionId,
          fontColor: fontColor,
          backgroundColor: backgroundColor,
          fontFamily: fontFamily,
          showIntroductionScreens: showIntroductionScreens,
          showSuccessScreen: showSuccessScreen,
          onboardingTextConfiguration: onboardingTextConfiguration,
          logLevel: logLevel
        )
    }

    // Event where you intend to call QI Tech OCR View Controller - on this example, when the user press 'next' button

    @IBAction func pressNext(_ sender: Any) {
        let qitechOcrController =  QITechIosOcrController(ocrConfiguration: self.ocrConfig)
        qitechOcrViewController.delegate = self
        let qitechOcrViewController = qitechOcrController.getViewController()
        present(qitechOcrViewController, animated: true, completion: nil)
    }

    // Do something if QI Tech OCR's SDK succesfully collected document picture
    func qitechIosOcrController(_ ocrViewController: QITechIosOcrController, didFinishWithResults results: QITechIosOcrControllerResponse) {

    }

    // Do something if QI Tech OCR's SDK found any error when collecting document picture
    func qitechIosOcrController(_ ocrViewController: QITechIosOcrController, didFailWithError error: QITechIosOcrControllerError) {

    }

    // Do something if the user canceled the picture collection on any steps
    func qitechIosOcrControllerDidCancel(_ ocrViewController: QITechIosOcrController) {

    }
}
```

**Versions prior to v7.0.0**
  ```swift
    import QITechIosOcr

    class ViewController: UIViewController, QITechIosOcrControllerDelegate {

        var qitechOcrConfiguration : QITechIosOcrConfiguration?

        override func viewDidLoad() {
            super.viewDidLoad()
            self.setupOcr()
        }

        func setupOcr() -> Void
        {
            // The environment can be 'Sandbox' or 'Production'
            let environment = QITechIosOcrEnvironment.Sandbox

            // MobileToken is the key sent to you by QI Tech. Each environment requires a different MobileToken.
            let mobileToken = "YOUR_MOBILE_TOKEN_SENT_BY_QITECH"

            // The documentFlow can be 'CnhFull' , 'CnhFrontAndBack' or 'RgFrontAndBack'
            let documentFlow = QITechIosOcrDocumentFlow.CnhFrontAndBack

            self.ocrConfig = QITechIosOcrConfiguration(environment: environment,
                                                mobileToken: mobileToken,
                                                sessionId: "UNIQUE_SESSION_ID",
                                                documentFlow: documentFlow,
                                                backgroundColor: "#000000",
                                                fontColor: "#FFFFFF",
                                                fontFamily: .open_sans,
                                                showIntroductionScreens: true,
                                                logLevel: .debug
                                                )
        }

        // Event where you intend to call QI Tech OCR View Controller - on this example, when the user press 'next' button

        @IBAction func pressNext(_ sender: Any) {
            let qitechOcrController =  QITechIosOcrController(ocrConfiguration: self.ocrConfig)
            qitechOcrViewController.delegate = self
            let qitechOcrViewController = qitechOcrController.getViewController()
            present(qitechOcrViewController, animated: true, completion: nil)
        }

        // Do something if QI Tech OCR's SDK succesfully collected document picture
        func qitechIosOcrController(_ ocrViewController: QITechIosOcrController, didFinishWithResults results: QITechIosOcrControllerResponse) {

        }

        // Do something if QI Tech OCR's SDK found any error when collecting document picture
        func qitechIosOcrController(_ ocrViewController: QITechIosOcrController, didFailWithError error: QITechIosOcrControllerError) {

        }

        // Do something if the user canceled the picture collection on any steps
        func qitechIosOcrControllerDidCancel(_ ocrViewController: QITechIosOcrController) {

        }
    }
  ```

To incorporate the SDK into your application, you must configure your custom capture application through the **QITechIosOcrConfiguration** class and then instantiate the **QITechIosOcrController ViewController** passing the custom configurations as an argument.

To start the document analysis process, simply call the _present_ function to call QI Tech's ViewController that will perform the image collection.

It is important to implement the _Delegate_ responsible for receiving returns in case of success, error or if the user interrupts the journey at any stage of validation.

Above we have a complete implementation example.

:::info **Attention**

Enable support for _Portrait_ and _Landscape Right_ orientations in your application for correct SDK operation.
:::

## Mobile Token

We use a Mobile Token to allow authenticated access from your application to our API. It has probably already been sent to you by email. If you have not yet received your token, send an email to suporte.caas@qitech.com.br .

Our API expects to receive the Mobile Token in all requests to our server coming from the SDK, therefore, it must be included as a configuration parameter through the method mentioned above.

:::info **Attention**

You must replace "YOUR_MOBILE_TOKEN_SENT_BY_QITECH" with the Mobile Token received from support.
:::

---

# necessary_permissions

URL: /en/documentation/caas/ocr/ios/necessary_permissions

## Required Permissions

For the SDK to access device resources to collect the photo, it is necessary to request permissions from the user.

In the **info.plist** file, add the permissions below:

| Permission                          | Reason                                               |
| ---------------------------------- | ---------------------------------------------------- |
| Privacy - Camera Usage Description | Camera access to capture document photos. |

---

# Importing the SDK

URL: /en/documentation/caas/ocr/ios/using_sdk

## Remotely

> Starting installation

```shell
  pod init
```

Our SDK can be imported using CocoaPods.

| SDK        | Current version                   |
| ---------- | ------------------------------ |
| QITechIosOCR | `pod 'QITechIosOCR', '~> 8.0.0'` |

To start installation, run the command above in your project's root folder.

> Adding the source to the podfile

```ruby
   source 'https://github.com/QITechSDKs/iOS.git'
```

The next step is to add QI Tech's source to the `podfile` file.

> Adding the pod to the podfile

```ruby
  pod 'QITechIosOCR', '~> <version>'
```

Finally, just add the `pod` name according to the format above.

> Podfile example

```ruby
  source 'https://github.com/QITechSDKs/iOS.git'
  source 'https://cdn.cocoapods.org/'
  target 'ExampleApp' do
    use_frameworks!
    pod 'QITechIosOCR', '~> 8.0.0'
  end

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if ['DatadogCore', 'DatadogInternal', 'DatadogCrashReporting', 'DatadogLogs'].include?(target.name)
        target.build_configurations.each do |config|
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
          config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
        end
      end
    end
  end
```

:::warning Attention
When integrating dependencies in iOS, the need may arise to use static linking for some libraries and dynamic for others. This configuration is relevant to ensure compatibility, avoid build errors and optimize project performance. 
:::

### Hybrid Dependency Linking (if necessary)
The need for hybrid linking arises because some libraries have specific requirements, with some needing static linking to avoid internal conflicts and symbol duplication and other dependencies may need dynamic linking, as they are designed for modularity and sharing between projects.

Differences Between Static and Dynamic Linking
* Static (static_framework): The library code is directly incorporated into the final binary, reducing runtime loading time and eliminating external dependencies during execution.
* Dynamic (dynamic_framework): The library is loaded at runtime as a separate file. This reduces the final binary size and facilitates independent updates/modifications.

> Configuring hybrid linking in Podfile

```ruby
...

use_frameworks! :linkage => :dynamic # CONFIGURANDO O MODO PADRÃO DE LINKAGEM PARA DINÂMICO

...

static_frameworks = ['framework_1', 'framework_2', ...] # INCLUIR TODAS AS DEPENDÊNCIAS QUE PRECISAM SER LINKADAS DE MODO ESTÁTICO
pre_install do |installer|
  installer.pod_targets.each do |pod|
    if static_frameworks.include?(pod.name)
      def pod.static_framework?;
        true
      end
      def pod.build_type;
        Pod::BuildType.static_framework
      end
    end
  end
end
```

> Installing dependencies

```shell
  pod install
```

Finally, run the `pod install` command to download and install the dependencies.

## Required Permissions

For the SDK to access device resources to collect the photo, it is necessary to request permissions from the user.

In the **info.plist** file, add the permissions below:

| Permission                          | Reason                                               |
| ---------------------------------- | ---------------------------------------------------- |
| Privacy - Camera Usage Description | Camera access to capture document photos. |

## Starting the SDK

```swift

import QITechIosOcr

class ViewController: UIViewController, QITechIosOcrControllerDelegate {

    var qitechOcrConfiguration : QITechIosOcrConfiguration?

    override func viewDidLoad() {
        super.viewDidLoad()
        self.setupOcr()
    }

    func setupOcr() -> Void
    {
        // The environment can be 'Sandbox' ou 'Production'
        let environment = QITechIosOcrEnvironment.Sandbox

        // MobileToken is the key sent to you by QI Tech. Each environment requires a different MobileToken.
        let mobileToken = "YOUR_MOBILE_TOKEN_SENT_BY_QITECH"

        // The documentFlow can be 'CnhFull' , 'CnhFrontAndBack' ou 'RgFrontAndBack'
        let documentFlow = QITechIosOcrDocumentFlow.CnhFrontAndBack

        self.ocrConfig = QITechIosOcrConfiguration(environment: environment,
                                            mobileToken: mobileToken,
                                            sessionId: "UNIQUE_SESSION_ID",
                                            documentFlow: documentFlow,
                                            backgroundColor: "#000000",
                                            fontColor: "#FFFFFF",
                                            fontFamily: .open_sans,
                                            showIntroductionScreens: true,
                                            logLevel: .debug
                                            )
    }

    // Event where you intend to call QI Tech OCR View Controller - on this example, when the user press 'next' button

    @IBAction func pressNext(_ sender: Any) {
        let qitechOcrController =  QITechIosOcrController(ocrConfiguration: self.ocrConfig)
        qitechOcrViewController.delegate = self
        let qitechOcrViewController = qitechOcrController.getViewController()
        present(qitechOcrViewController, animated: true, completion: nil)
    }

    // Do something if QI Tech OCR's SDK succesfully collected document picture
    func qitechIosOcrController(_ ocrViewController: QITechIosOcrController, didFinishWithResults results: QITechIosOcrControllerResponse) {

    }

    // Do something if QI Tech OCR's SDK found any error when collecting document picture
    func qitechIosOcrController(_ ocrViewController: QITechIosOcrController, didFailWithError error: QITechIosOcrControllerError) {

    }

    // Do something if the user canceled the picture collection on any steps
    func qitechIosOcrControllerDidCancel(_ ocrViewController: QITechIosOcrController) {

    }
}
```

To incorporate the SDK into your application, you must configure your custom capture application through the **QITechIosOcrConfiguration** class and then instantiate the **QITechIosOcrController ViewController** passing the custom configurations as an argument.

To start the document analysis process, simply call the _present_ function to call QI Tech's ViewController that will perform the image collection.

It is important to implement the _Delegate_ responsible for receiving returns in case of success, error or if the user interrupts the journey at any stage of validation.

Above we have a complete implementation example.

:::info **Attention**

Enable support for _Portrait_ and _Landscape Right_ orientations in your application for correct SDK operation.
:::

## Mobile Token

We use a Mobile Token to allow authenticated access from your application to our API. It has probably already been sent to you by email. If you have not yet received your token, send an email to suporte.caas@qitech.com.br .

Our API expects to receive the Mobile Token in all requests to our server coming from the SDK, therefore, it must be included as a configuration parameter through the method mentioned above.

:::info **Attention**

You must replace "YOUR_MOBILE_TOKEN_SENT_BY_QITECH" with the Mobile Token received from support.
:::

---

# Collecting Returns

URL: /en/documentation/caas/ocr/web/collecting_results

The Web OCR SDK returns a _Promise_ that, in case of success, returns an **array of objects**, where each object represents a side of the captured document (front and/or back). In case of error, the Promise is rejected with a string describing the problem.

Below is an example of how to map each case and collect its results:

```html
<script>
    webOCR.initialize(allowed_templates)
    .then((ocr_results) => {
        console.log(ocr_results)
        // Example return:
        // [
        //   { template: "rg_front", ocr_key: "abc123...", document_capture_session_key: "uuid..." },
        //   { template: "rg_back",  ocr_key: "def456...", document_capture_session_key: "uuid..." }
        // ]
    })
    .catch((error) => {
        console.log(error)
    })
</script>
```

## Web OCR Return Description

### Success

The success return is an **array** of objects, one per captured document side:

Attribute | Type | Description
--------- | --------- | ---------
ocr_results | Array | List of objects with information about each capture performed.

### Attributes of each object in the array

Attribute | Type | Description
--------- | --------- | ---------
ocr_key | String | Identification key of the captured image. Can be used in any other QI Tech system service.
template | String | Type and side of the captured document (e.g.: `rg_front`, `rg_back`, `cnh_front`, `cnh_back`, `cin_digital`).
document_capture_session_key | String | Key that identifies the document capture session.

### Error Types

Error | Description
--------- | ---------
Invalid Web Token! Please verify your Web Token. | Web Token used is invalid. If you are certain that you are correctly using the Web Token provided by QI Tech, contact our support (suporte.caas@qitech.com.br).
Invalid Document Type! Please provide a valid document type. | Document type passed to **WebOCR.initialize()** is not valid. Check the allowed types on the [initialize function](./initialize_info.md) page.
User left Web OCR. | The user exited the Web OCR SDK before completing the document submission.

---

# The QiTechWebOCR.WebOCR() constructor

URL: /en/documentation/caas/ocr/web/constructor_info

:::info New in version 4.0.0
Starting from version **4.0.0**, the constructor no longer receives `htmlComponent` as the first parameter — the SDK creates and manages its own DOM node internally, appended to `document.body`.
:::

The `.WebOCR()` method is responsible for configuring the instance of your documentoscopy component. The constructor receives two mandatory parameters:

| Parameter | Description | Required |
|----------|----------|----------|
| webToken | Client key that identifies that the collected data comes from your application. If you have not yet received your web-token, contact <a href='mailto:suporte.caas@qitech.com.br'>support</a>. | Yes |
| sessionId | Used to define the key that identifies the session started in the SDK. It is used to track the entire flow traversed by the user in the Web OCR execution through logs. This field accepts a string of up to 255 characters. Must be unique for each session. | Yes |

After instantiation, use the following chained methods to customize behavior:

| Name | Description | Required |
|----------|----------|----------|
| `.setThemeConfiguration(object)` | Customizes the visual identity of the SDK. | No |
| `.setShowInstructionScreen(boolean)` | Displays the introduction screen with capture tips. Default: `true`. | No |
| `.setShowAllowedTemplatesScreen(boolean)` | Displays the screen informing which documents are accepted. We recommend enabling it so the user knows which documents they can submit. | No |
| `.setShowSuccessScreen(boolean)` | Displays the success screen at the end of the capture. Default: `true`. | No |
| `.setSandboxEnvironment()` | Configures the SDK to point to the Sandbox environment. | No |

The `.setThemeConfiguration` method must receive an object with the following fields:

| Name | Type | Description |
| -------- | -------- | -------- |
| primaryColor | String | _(recommended)_ Hexadecimal of the SDK's primary color — used in buttons, icons, and highlights. Default: `#555555`. |
| companyLogo | String | _(recommended)_ Path or **public URL** of your company logo (**PNG**). If not provided, a placeholder will be displayed. |
| fontFamily | String | _(recommended)_ _Font Family_ to be applied to SDK texts. If not provided, the default font will be used. |

:::caution Compatibility
The `backgroundColor` and `buttonColor` fields are still accepted by `.setThemeConfiguration`, but are only used as a fallback to derive `primaryColor` when it is not provided. Prefer using `primaryColor` directly.
:::

## Previous Versions (< 4.0.0)

In previous versions, the constructor received `htmlComponent` as the first parameter:

```js
var htmlComponent = document.getElementById('webOCR');
var webOCR = new QiTechWebOCR.WebOCR(
    htmlComponent,
    "<WEB_TOKEN>",
    "<SESSION_ID>"
)
```

---

# Implementation

URL: /en/documentation/caas/ocr/web/example

:::info New in version 4.0.0
Starting from version **4.0.0**, the `WebOCR` constructor no longer receives `htmlComponent` — the SDK creates and manages its own DOM node internally.
:::

The Web OCR SDK initialization is performed through the call of the `.initialize()` method, which belongs to the `WebOCR` class. The process is divided into two main steps:

1. **Configuration and Instantiation:** Prepare and configure the SDK instance.
2. **Capture Initialization:** Start the document capture flow for the end user.

## Complete example

```html
<script>
    var webOCR = new QiTechWebOCR.WebOCR(
        "<WEB_TOKEN>",
        "<SESSION_ID>"
    )
    .setThemeConfiguration({
        "companyLogo": "<PATH_OR_URL_TO_YOUR_COMPANY_LOGO>",
        "primaryColor": "<PRIMARY_COLOR_HEX>",
        "fontFamily": "<FONT_FAMILY>"
    })
    .setShowInstructionScreen(true)
    .setShowSuccessScreen(true)
    .setShowAllowedTemplatesScreen(false)
    .setSandboxEnvironment()
    .build()

    function initOCR(allowed_templates) {
        webOCR.initialize(allowed_templates)
        .then((ocr_results) => {
            console.log(ocr_results)
        })
        .catch((error) => {
            console.log(error)
        })
    }

    initOCR(['cnh', 'rg', 'rg_digital'])
</script>
```

## Configuration and Instantiation

To get started, create a new instance of the `WebOCR` class. The constructor requires two mandatory parameters, in the order specified below:

- **webToken** `(String)`: Your authentication token for API usage.
- **sessionId** `(String)`: A unique identifier for the user session.

### Customization (Optional)

After creating the instance, use the following chained methods to customize the experience:

- **`setThemeConfiguration`** `(object)`: Customizes the SDK appearance. Accepted fields:
    - `primaryColor` `(String)`: Primary color in hexadecimal format — used in buttons, icons, and highlights (e.g.: `'#0000FF'`).
    - `companyLogo` `(String)`: URL or path to your company logo.
    - `fontFamily` `(String)`: Font family (e.g.: `'Arial'`).

- **`setShowInstructionScreen`** `(boolean)`: Defines whether the initial instruction screen will be displayed.

- **`setShowAllowedTemplatesScreen`** `(boolean)`: Defines whether the screen informing accepted documents will be displayed. We recommend enabling it so the user knows which documents they can submit.

- **`setShowSuccessScreen`** `(boolean)`: Defines whether the success screen at the end of the capture will be displayed.

- **`setSandboxEnvironment`**: Configures the SDK to point to the sandbox environment.

### Build

Finally, you **must** call the **build()** function to instantiate the **WebOCR** class with the passed configurations. For more details about the constructor, see the [constructor](./constructor_info.md) page.

## Initializing Document Capture

With the `WebOCR` instance properly configured, call the `initialize()` method to start the capture flow. This method receives as a parameter a list (array) of strings, where each string represents a document type the user will be able to submit.

### Table with accepted templates

Name | Type | Description
---- | ---- | ---------
cnh | String | Capture of physical CNH (closed), in two steps, FRONT and BACK
rg | String | Capture of physical RG (closed), in two steps, FRONT and BACK
cin_digital | String | Submission of **digital** CIN (pdf) issued by an official application
rg_digital | String | Submission of **digital** RG (pdf) issued by an official application
rne | String | Capture of physical RNE, in two steps, FRONT and BACK
crnm | String | Capture of physical CRNM, in two steps, FRONT and BACK
others | String | Should be used to allow sending other documents besides those listed above

:::caution Attention
Adding the `others` type to the allowed templates causes every document sent to be accepted. Thus, even non-official documents will be accepted.
:::

### Return Handling

The `initialize()` method returns a Promise:

- **Success:** The Promise is resolved with an **array of objects**, where each object represents a captured document side. See the [Collecting Returns](./collecting_results.md) page for details on the format.
- **Error:** The Promise is rejected. You can catch these errors using the `.catch()` method.

---

# Importing the library

URL: /en/documentation/caas/ocr/web/import

To import our library, add the URL to the _src_ of a **script** TAG in your website's HTML, as shown in the example below:

```html
    <script src="https://ocr.caas.qitech.app/4-1-1/ocr.js"></script>
```

---

# The initialize() function

URL: /en/documentation/caas/ocr/web/initialize_info

To start the Web OCR SDK, after instantiating the **WebOCR** class, call the **initialize()** function passing a list of allowed documents as a parameter.

Below is the detail of each of the possible document types:

Name | Type | Description
---- | ---- | ---------
cnh | String | Capture of physical CNH (closed), in two steps, FRONT and BACK
rg | String | Capture of physical RG (closed), in two steps, FRONT and BACK
cin_digital | String | Submission of **digital** CIN (pdf) issued by an official application
rg_digital | String | Submission of **digital** RG (pdf) issued by an official application
rne | String | Capture of physical RNE, in two steps, FRONT and BACK
crnm | String | Capture of physical CRNM, in two steps, FRONT and BACK
others | String | Should be used to allow sending other documents besides those listed above

:::caution Attention
Adding the `others` type to the allowed templates causes every document sent to be accepted. Thus, even non-official documents will be accepted.
:::

## Implementation Example

An implementation example of the Web OCR SDK can be seen below:

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Web OCR</title>
    <script src="https://ocr.caas.qitech.app/4-1-1/ocr.js"></script>
</head>
<body>
    <div class="demo-app-container">
        <button onclick="initOCR(['rg', 'cnh', 'rg_digital'])">
            Start document collection
        </button>
    </div>
</body>

<script>
    var webOCR = new QiTechWebOCR.WebOCR(
        "<WEB_TOKEN>",
        "<SESSION_ID>"
    )
    .setThemeConfiguration({
        "companyLogo": "https://my_company/logo.png",
        "primaryColor": "#FF9900",
        "fontFamily": "Verdana"
    })
    .setShowInstructionScreen(true)
    .setShowSuccessScreen(true)
    .setShowAllowedTemplatesScreen(true)
    .setSandboxEnvironment()
    .build()

    function initOCR(allowed_templates) {
        webOCR.initialize(allowed_templates)
        .then((ocr_results) => {
            console.log(ocr_results)
        })
        .catch((error) => {
            console.log(error)
        })
    }
</script>
</html>
```

## Return Handling

The `initialize()` method returns a Promise:

- **Success:** The Promise is resolved with an **array of objects**, where each object represents a captured document side. See the [Collecting Returns](./collecting_results.md) page for details on the format.

- **Error:** The Promise is rejected. You can catch these errors using the `.catch()` method.

---

# Introduction

URL: /en/documentation/caas/ocr/web/introduction

Welcome to QI Tech's Web OCR SDK (Optical Character Recognition) for document reading. This SDK performs document capture and sends it to the QI Tech OCR API . You can use it to capture an image of a document from your client to be recognized through your web application, such as a Driver's License or Identity Card, and reference it through a key in other QI Tech system products.

## Problems?

We are not a company that hides behind an API! Contact our [support](mailto:suporte.caas@qitech.com.br) and we will respond as quickly as possible. Feel free to call us if you want a quick response!

### We Love Feedback

Even if you have already solved your problem or it is very simple (Even a typo or inadequate organization that you already understood), send us an email, so we make the documentation increasingly practical and the next person won't need to suffer the pains you suffered!

:::danger Important Warning!
Real data from individuals and/or legal entities should not be used in QI Tech's Sandbox environments.  
:::

---

# Authentication

URL: /en/documentation/caas/onboarding/authentication

> To authenticate a request, use the following code:

```shell
# In the shell, you only need to add the appropriate header to each request
curl "api_endpoint_here"
  -H "Authorization: EXAMPLE-OF-API-KEY"
```

> Replace the API Key 'EXAMPLE-OF-API-KEY' with your own key, which should be obtained from our support team.

We use an API Key to grant access to our API. It was likely sent to you by email. If you haven’t received your key yet, please send an email to suporte.caas@qitech.com.br .

Our API expects to receive the API Key in all requests to our server in a header like the one below:

`Authorization: EXAMPLE-OF-API-KEY`

:::info **Attention**

You must replace EXAMPLE-OF-API-KEY with your own key, which should be obtained from our support team.
:::

---

# HTTP Status Codes

URL: /en/documentation/caas/onboarding/http_status

All QI Tech APIs follow the standard HTTP status codes as defined in the [RFC 7231](https://tools.ietf.org/html/rfc7231):

HTTP Status | Meaning | Description
----------- | ------- | ---------------------------------
400 | Bad Request | The request sent contains a formatting error. In most cases, we return a message body explaining where the error is.
401 | Unauthorized | There was a problem with authentication. Check if the API Key is correct and placed in the proper header, as explained in the [Authentication](https://docs.qitech.com.br/en/documentation/caas/onboarding/authentication/index.html) section.
403 | Forbidden | The accessed endpoint is for internal use and not available for this API Key.
404 | Not Found | The requested data could not be found using the provided key. This status is also returned when an invalid endpoint is requested.
405 | Method Not Allowed | The HTTP method used is not supported by the requested endpoint.
406 | Not Acceptable | The data sent in the request body is invalid. Usually, this means the payload is not valid JSON.
409 | Conflict | The request ID corresponds to an ID that has already been processed. This status is returned in case of duplicate requests.
500 | Internal Server Error | We encountered an issue while processing the request. When this happens, our specialists are automatically notified and begin investigating immediately.
503 | Service Unavailable | You encountered an infrastructure outage, whether planned or unplanned, on our servers.

---

# Integration

URL: /en/documentation/caas/onboarding/integrations

Our mobile solutions are compatible with a wide range of technologies such as Flutter, Ionic Cordova, Capacitor, React Native, Java, Swift, and others. If you're interested in integrating with any of these, please get in touch with our support team to grant access to our private repositories.

---

# Introduction

URL: /en/documentation/caas/onboarding/introduction

Welcome to QI Tech's Onboarding API! This API provides access to Fraud Prevention, Anti-Money Laundering and KYC services in a Registration on your platform!

This API can be used to validate customer registration for:

* Opening Digital Accounts or Wallets
* Card Issuance
* Application User Validation
* Registration for Credit Approval
* Insurance Hiring Registration
* Registration Data Validation

You can use our API to access the endpoints for evaluating the following types of registration:

* **Natural Person** - used for registration validation of Individuals
* **Legal Person** - used for registration validation of Legal Entities

The different registration types above have specific objects and endpoints designed to cover the particularities of each entity.

## Issues?

We’re not a company that hides behind an API! Reach out to our support team and we’ll get back to you as soon as possible. Feel free to give us a call if you want a quicker answer!

### We love feedbacks

Even if you’ve already solved your issue or it is something simple (like a typo or a small organizational detail), feel free to send us an email. That way, we can keep improving our documentation and help the next person avoid the same difficulties you faced!

## Environments

We provide two environments for our clients. The base URLs for the APIs are:

* Production - `https://api.caas.qitech.app/onboarding/`
* Sandbox - `https://api.sandbox.caas.qitech.app/onboarding/`

:::danger Important Warning!
Real personal or company data must not be used in QI Tech's Sandbox environments.  
:::

In the Sandbox environment, submitted analyses are not charged and are responded to according to the following rule based on the first digit of the document number – CPF for individuals and CNPJ for legal entities:

Digit | Decision
------ | -------
0 | Manual Review  
1 | Automatically Contested  
2 | Not Analyzed  
3 | Referred for Manual Review - Later Rejected  
4 | Referred for Manual Review - Later Approved  
5 | Queued  
6 | Awaiting Data  
7 | Pending  
8 | Automatically Rejected  
9 | Automatically Approved  

For CPF or CNPJ numbers starting with digits 1 or 2, please contact our support team to ensure the manual handling is done correctly.

## Only HTTPS

For security reasons, all communication with QI Tech's APIs must be conducted over HTTPS. To ensure that no HTTP calls are made, whether by oversight or any other reason, this server only makes port 443 available with TLS 1.2 communication. Requests using other protocols will be automatically rejected.

---

# Legal Person Object

URL: /en/documentation/caas/onboarding/legal_person

At the end of registering a company on your platform, it is necessary to perform the fraud and KYC assessment for this entity, which must be carried out through the Legal Person endpoint. The data submitted must be final and must not be changed under any circumstances. That is, after this process, it should not be possible to modify basic registration data such as CNPJ, Company Name, Incorporation Date, and others. This is very important to ensure two key points:

* Consistency of the data in the Anti-Fraud database  
* Realistic risk assessment, avoiding fraud in future operations

## Legal Person Object Definition

Request Body

```json
{
  "id": "12345678",
  "registration_id": "12345678",
  "registration_date": "2019-12-11T11:37:15.12-03:00",
  "client_category" : "Premium Account",
  "legal_name": "John's Company",
  "trading_name": "John's Barbershop",
  "document_number": "11.111.111/0001-11",
  "foundation_date": "1992-09-15",
  "website": "www.johnsbarbershop.com.br",
  "activity": "Barber Shops",
  "activity_code": "96.02-5-01",
  "merchant_category_code": "0742",
  "tier" : "epp",
  "annual_revenues": 72000000,
  "emails":[
    {
      "email": "johnsample@test.com",
      "validation_type":"zaig_api",
      "validation_key": "ccc4b4b4-f91c-4475-8290-07152550aefc"
    }
  ],
  "documents": {
    "ie": {
      "number": "388.108.598.269",
      "issuer": "JUCESP",
      "issuer_state": "SP",
      "issuance_date":"2002-01-12",
      "validation_type": "zaig_api",
      "ocr_key": "c64627db-1ba4-48b6-979d-06222a25d5e9"
    },
    "company_statute": {
      "ocr_key": "60ed79c4-5aba-4cc7-aebb-5de5f92b7d0d"
    }
  },
  "address": {
    "street": "Rua do Teste",
    "number": "111",
    "neighborhood": "Bairro do Exemplo",
    "city": "Aparecida de Goiânia",
    "uf": "GO",
    "complement": "Térreo",
    "postal_code": "00000-000",
    "country": "BRA",
    "validation_type": "visit",
    "ocr_key": "265b1b74-4b93-41dc-ac78-e1c37467225d"
  },
  "phones": [
    {
      "international_dial_code": "1",
      "area_code": "11",
      "number": "999999999",
      "type": "mobile",
      "validation_type": "zaig_sms",
      "validation_key": "82473dec-8e14-4570-997a-59652818c908"
    }
  ],
  "source": {
    "channel": "app",
    "platform": "android",
    "ip":"201.6.142.66",
    "session_id": "c90ad2df-7307-4f82-8938-1da81dff2be6"
  },
  "legal_representatives": [
    {
      "name": "Frederic Attorney",
      "document_number": "111.111.111-11",
      "birthdate": "1987-06-12",
      "gender": "male",
      "nationality": "BRA",
      "mother_name": "Jackie Attorney Mother",
      "occupation": "Accountant",
      "emails":[
        {
          "email": "frederic@attorney.com",
          "validation_type":"zaig_api",
          "validation_key": "d174d522-6003-4b05-adb2-e92e92632c67"
        }
      ],
      "documents": {
        "letter_of_attorney": {
          "ocr_key": "6972894d-d2ef-4b5f-b54f-10f178bf3e5d"
        },
        "cnh": {
          "register_number": "05163811694",
          "issuer_state": "PR",
          "first_issuance_date":"2011-03-21",
          "issuance_date":"2016-06-29",
          "expiration_date":"2021-06-25",
          "category": "AB",
          "validation_type":"zaig_sdk",
          "ocr_key":"a5cf9c8f-2f66-4490-a7db-8a5bc70c1b76"
        }
      },
      "address": {
        "street": "Avenida de Exemplo",
        "number": "99",
        "neighborhood": "Vila do Exemplo",
        "city": "Jundiaí",
        "uf": "SP",
        "complement": "Ap 82",
        "postal_code": "00000-000",
        "country": "BRA",
        "validation_type":"visit",
        "ocr_key": "265b1b74-4b93-41dc-ac78-e1c37467225d"
      },
      "phones": [
        {
          "international_dial_code": "55",
          "area_code": "11",
          "number": "999998877",
          "type": "mobile",
          "validation_type": "zaig_sms",
          "validation_key": "e390d2b3-cb71-4991-9d94-1b7f8b43a04e"
        }
      ],
      "source": {
        "channel": "app",
        "platform": "ios",
        "ip":"175.92.122.2",
        "session_id": "93c68588-7a41-472f-95b3-835ea6ee1ede"
      },
      "face":
      {
        "type":"zaig_sdk",
        "registration_key":"d2677a8c-d575-44e1-a54d-ec00f9310f34"
      }
    }
  ],
  "partners": [
    {
      "name": "John Partner",
      "document_number": "111.111.111-11",
      "birthdate": "1992-09-15",
      "gender": "male",
      "nationality": "BRA",
      "mother_name": "Maria Partner's Mother",
      "occupation": "Teacher",
      "emails":[
        {
          "email": "johnsample@test.com",
          "validation_type":"zaig_api",
          "validation_key": "1fac6f8c-1a16-4a12-9afc-9a2d9ae0a31e"
        }
      ],
      "documents": {
        "rg": {
          "number": "4.366.477-8",
          "issuer": "II",
          "issuer_state": "PR",
          "issuance_date":"2002-01-12",
          "validation_type":"zaig_sdk",
          "ocr_front_key":"a5cf9c8f-2f66-4490-a7db-8a5bc70c1b76",
          "ocr_back_key":"a5cf9c8f-2f66-4490-a7db-8a5bc70c1b76"
        },
        "cnh": {
          "register_number": "05163811694",
          "issuer_state": "PR",
          "first_issuance_date":"2011-03-21",
          "issuance_date":"2016-06-29",
          "expiration_date":"2021-06-25",
          "category": "AB",
          "validation_type":"zaig_sdk",
          "ocr_key":"a5cf9c8f-2f66-4490-a7db-8a5bc70c1b76"
        }
      },
      "address": {
        "street": "Rua do Teste",
        "number": "111",
        "neighborhood": "Bairro do Exemplo",
        "city": "Aparecida de Goiânia",
        "uf": "GO",
        "complement": "Térreo",
        "postal_code": "00000-000",
        "country": "BRA",
        "validation_type":"visit",
        "ocr_key": "265b1b74-4b93-41dc-ac78-e1c37467225d"
      },
      "phones": [
        {
          "international_dial_code": "1",
          "area_code": "11",
          "number": "999999999",
          "type": "mobile",
          "validation_type": "zaig_sms",
          "validation_key": "d1713959-4ae4-4180-befc-6931c658e908"
        }
      ],
      "source": {
        "channel": "app",
        "platform": "android",
        "ip":"255.201.26.1",
        "session_id": "79d5e442-2cb7-4a9e-82c5-7fa3717d7ada"
      },
      "face":
      {
        "type":"zaig_sdk",
        "registration_key":"a2b6ae92-1394-4f9b-b8ee-5be188f93609"
      }
    }
  ]
}
```

All data exchanges involving a registration use the following definition for this object. In some cases, to simplify implementation and reduce the data flow between parties, some information may be omitted.

name | type | constraints | description
:----: | :----: | :----: | ---------
id | string | 1–50 characters | Analysis identifier. **This number must be unique for each request** *(required)*
registration_id | string | 1–50 characters | Identifier of the registration in the client’s system. To perform more than one analysis for the same registration, use the same _registration_id_ in different analyses. Defaults to the value of _id_ when not provided.
registration_date | datetime | ISO 8601 with timezone | Date and time of registration. Format: `YYYY-MM-DDTHH:MM:SS[.ffffff]±HH:MM` or `...Z`. Example: `2019-12-11T11:37:15.12-03:00` *(required)*
client_category | string | 1–100 characters | Client category according to your platform classification or loyalty program
legal_name | string | 1–1000 characters | Corporate name of the company being registered
trading_name | string | 1–1000 characters | Trade name of the company being registered
document_number | string | Format `XX.XXX.XXX/XXXX-XX` | CNPJ of the company. Must be exactly 18 characters, including dots, slash and hyphen *(required)*
foundation_date | date | Format `YYYY-MM-DD` | Company foundation date
website | string | up to 10,000 characters | Website of the company being registered
activity | string | 1–1000 characters | Business sector of the company being registered
activity_code | string | Format `XX.XX-X-XX` | CNAE code of the company’s activity. Must be exactly 10 characters. Example: `96.02-5-01`
merchant_category_code | string | enum (see list) | MCC (Merchant Category Code) for the activity sector according to card network standards
tier | string | 1–10 characters | Company size (e.g.: `mei`, `epp`, `me`, `medio`, `grande`)
annual_revenues | integer | 0 to 10,000,000,000,000 | Company’s gross annual revenue in **cents** of BRL
monthly_revenues | integer | 0 to 10,000,000,000,000 | Company’s gross monthly revenue in **cents** of BRL
emails | List of Email | — | List of Email objects describing the company’s email addresses
documents | Document | — | Document objects (State registration - *ie*, Articles of incorporation - *company_statute*)
address | Address | — | Address object describing the company’s address
phones | List of Phone | — | List of Phone objects describing the company’s phone numbers
source | Source | — | Source object describing the characteristics of the application used to send the registration
partners | List of Partner | — | List of Partner objects describing information about each of the company’s partners
legal_representatives | List of LegalRepresentative | — | List of LegalRepresentative objects describing information about each of the company’s legal representatives

### Field Formats

#### `registration_date`

Must follow ISO 8601 format with a mandatory timezone. Examples of accepted values:

```
2019-12-11T11:37:15-03:00        (no fractional seconds, offset)
2019-12-11T11:37:15.123456-03:00 (fractional seconds, up to 6 digits)
2019-12-11T14:37:15Z             (UTC)
```

> The field does **not** accept dates without a timezone component (e.g., `2019-12-11T11:37:15` is invalid).

#### `document_number` — CNPJ

The CNPJ must be sent **with punctuation**, in the format `XX.XXX.XXX/XXXX-XX`, where each `X` is a numeric digit. The field is exactly **18 characters** long.

Valid example: `11.222.333/0001-81`

#### `foundation_date`

Date in `YYYY-MM-DD` format (year-month-day), per ISO 8601.

Valid example: `1992-09-15`

#### `activity_code` — CNAE

The CNAE code must be sent in the format `XX.XX-X-XX`, with exactly **10 characters** including separators.

Valid example: `96.02-5-01`

#### `annual_revenues` and `monthly_revenues`

Both fields are integers representing monetary values in **cents of BRL**. To convert from BRL to the expected format, multiply by 100.

Example: BRL 720,000.00 → `72000000`

## Submit a Legal Person

Request Body

```json
  {
    "id": "12345",
    ...
  }
```

Response Body

```json
  {
    "id": "12345",
    "analysis_status": "automatically_approved",
    "reason": "rule_decision_enum"
  }
```

To perform the evaluation of a Registration, simply send an object of type **Legal Person** to the following endpoint with the flag properly set:

`POST https://api.caas.qitech.app/onboarding/legal_person?analyze=true`

The *analyze* parameter is used to determine whether the submitted registration should be analyzed by QI Tech's algorithms. If a registration is sent with the parameter set to **false**, it will not be analyzed or charged, but its data will still be considered by QI Tech's algorithms for future evaluations. The default value for this parameter is **true**, meaning that only registrations explicitly sent with the **false** flag will not be analyzed.

---

# Objeto Natural Person

URL: /en/documentation/caas/onboarding/natural_person

At the end of the registration process for a natural person on your platform, it is necessary to perform the fraud and KYC evaluation for that client. This must be done through the Natural Person endpoint. The data sent must be final and immutable, meaning no changes should be allowed to basic registration information such as CPF, Name, Date of Birth, and others after this process. This is crucial to ensure two main points:

* Consistency of data in the Anti-Fraud database  
* Realistic risk assessment, preventing fraud at later stages of the operation

## Natural Person Object Definition

Request Body

```json
{
  "id": "12345678",
  "registration_id": "12345678",
  "registration_date": "2019-12-11T11:37:15.12-03:00",
  "client_category": "Premium User",
  "name": "John Sample",
  "document_number": "111.111.111-11",
  "birthdate": "1992-09-15",
  "gender": "male",
  "nationality": "BRA",
  "mother_name": "Maria Sample",
  "father_name": "John Sample",
  "monthly_income": 500000,
  "declared_assets": 7500000,
  "occupation": "Teacher",
  "emails":[
    {
      "email": "johnsample@test.com",
      "validation_type":"zaig_api",
      "validation_key": "e9f0de49-16fb-431e-be1a-ee4bf1096eda"
    }
  ],
  "documents": {
    "rg": {
      "number": "4.366.477-8",
      "issuer": "II",
      "issuer_state": "PR",
      "issuance_date":"2002-01-12",
      "validation_type":"zaig_sdk",
      "ocr_front_key":"a5cf9c8f-2f66-4490-a7db-8a5bc70c1b76",
      "ocr_back_key":"a5cf9c8f-2f66-4490-a7db-8a5bc70c1b76"
    },
    "cnh": {
      "register_number": "05163811694",
      "issuer_state": "PR",
      "first_issuance_date":"2011-03-21",
      "issuance_date":"2016-06-29",
      "expiration_date":"2021-06-25",
      "category": "AB",
      "validation_type":"zaig_sdk",
      "ocr_key":"a5cf9c8f-2f66-4490-a7db-8a5bc70c1b76"
    }
  },
  "address": {
    "street": "Rua do Teste",
    "number": "111",
    "neighborhood": "Bairro do Exemplo",
    "city": "Aparecida de Goiânia",
    "uf": "GO",
    "complement": "Térreo",
    "postal_code": "00000-000",
    "country": "BRA",
    "validation_type":"visit",
    "ocr_key": "265b1b74-4b93-41dc-ac78-e1c37467225d"
  },
  "phones": [
    {
      "international_dial_code": "1",
      "area_code": "11",
      "number": "999999999",
      "type": "mobile",
      "validation_type": "zaig_sms",
      "validation_key": "82589b39-e34f-44f9-b0fe-d8fc0ee6129c"
    }
  ],
  "source": {
    "channel": "app",
    "platform": "android",
    "ip":"255.201.26.1",
    "session_id": "54b8e3cf-15de-41e5-9305-0ecf059d6e2a"
  },
  "face":
  {
    "type":"zaig_sdk",
    "registration_key":"46f38cf4-07b2-4de6-93e9-64b51a68378a"
  }
}
```

All information exchanges related to a registration use the following object definition. In some cases, to simplify implementation and reduce data flow between parties, certain information may be omitted.

name | type | constraints | description
:----: | :----: | :----: | ---------
id | string | 1–50 characters | Analysis identifier. **This number must be unique for each request** *(required)*
registration_id | string | 1–50 characters | Registration identifier in the client’s system. To perform more than one analysis for the same registration, use the same _registration_id_ across different analyses. Defaults to the value of _id_ if not provided.
registration_date | datetime | ISO 8601 with timezone | Date and time of registration. Format: `YYYY-MM-DDTHH:MM:SS[.ffffff]±HH:MM` or `...Z`. Example: `2019-12-11T11:37:15.12-03:00` *(required)*
client_category | string | 1–100 characters | Client category according to your platform’s classification or loyalty program
name | string | 1–500 characters | Full name of the individual being registered
document_number | string | Format `XXX.XXX.XXX-XX` | CPF of the individual. Must be exactly 14 characters, including dots and hyphen *(required)*
birthdate | date | Format `YYYY-MM-DD` | Birthdate of the individual
gender | enum | `male` or `female` | Gender of the individual
nationality | string | 3 uppercase letters | Nationality in ISO 3166-1 alpha-3 code. Example: `BRA`
mother_name | string | 1–500 characters | Full name of the mother
father_name | string | 1–500 characters | Full name of the father
monthly_income | integer | 1 to 100,000,000,000 | Gross monthly income in **cents** of BRL
declared_assets | integer | 1 to 100,000,000,000,000 | Declared assets in **cents** of BRL
occupation | string | 1–100 characters | Occupation of the individual being registered
emails | List of Email | — | List of Email-type objects describing the individual’s email addresses
documents | Document | — | Objects of type CNH, RG and other identification documents
address | Address | — | Address-type object describing the individual’s residential address
phones | List of Phone | — | List of Phone-type objects containing the individual’s phone numbers
source | Source | — | Source-type object describing information from the application used to send the registration
face | Face | — | Face-type object describing facial validation data used during registration, if applicable

### Field Formats

#### `registration_date`

Must follow ISO 8601 format with a mandatory timezone. Examples of accepted values:

```
2019-12-11T11:37:15-03:00        (no fractional seconds, offset)
2019-12-11T11:37:15.123456-03:00 (fractional seconds, up to 6 digits)
2019-12-11T14:37:15Z             (UTC)
```

> The field does **not** accept dates without a timezone component (e.g., `2019-12-11T11:37:15` is invalid).

#### `document_number` — CPF

The CPF must be sent **with punctuation**, in the format `XXX.XXX.XXX-XX`, where each `X` is a numeric digit. The field is exactly **14 characters** long.

Valid example: `123.456.789-09`

#### `birthdate`

Date in `YYYY-MM-DD` format (year-month-day), per ISO 8601.

Valid example: `1992-09-15`

#### `nationality`

A 3-letter **uppercase** country code following the ISO 3166-1 alpha-3 standard.

Examples: `BRA` (Brazil), `USA` (United States), `ARG` (Argentina).

#### `monthly_income` and `declared_assets`

Both fields are integers representing monetary values in **cents of BRL**. To convert from BRL to the expected format, multiply by 100.

Example: BRL 5,000.00 → `500000`

## Submit a Natural Person

Request Body

```json
  {
    "id": "12345",
    ...
  }
```

Response Body

```json
  {
    "id": "12345",
    "analysis_status": "automatically_approved",
    "reason": "rule_decision_enum"
  }
```

To evaluate a Registration, simply send a Natural Person–type object to the following endpoint with the flag set appropriately.

`POST https://api.caas.qitech.app/onboarding/natural_person?analyze=true`

The *analyze* parameter exists to indicate whether the submitted registration should be analyzed by QI Tech's algorithms. If a registration is sent with the parameter set to **false**, it will not be analyzed or charged, but its data will still be considered by QI Tech's algorithms for future analysis. The default value of this parameter is **true**, so only registrations explicitly sent with the **false** flag will not be analyzed.

---

# Shared Objects

URL: /en/documentation/caas/onboarding/objects

Many data structures are shared across different APIs. Below, you'll find simplified definitions for these shared objects.

## *email* Object

Request Body

```json
{
  "email": "johnsample@test.com",
  "validation_type":"zaig_api",
  "validation_key": "e9f0de49-16fb-431e-be1a-ee4bf1096eda"
}
```

The *email* object is used to represent emails across the entire API, as well as whether any validation method was used. They are represented as follows:

name | type | constraints | description
---- | :----: | :----: | ----------
email | string | 1–100 characters | Registered email address. *(required)*
validation_type | enum | `zaig_api` or `company_email` | Type of validation used during the email registration.
validation_key | guid | UUID (`xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`) | ID returned by QI Tech’s email validation API.

## *cnh* Object

Request Body

```json
{
  "register_number": "05163811694",
  "issuer_state": "PR",
  "first_issuance_date":"2011-03-21",
  "issuance_date":"2016-06-29",
  "expiration_date":"2021-06-25",
  "category": "AB",
  "validation_type":"zaig_sdk",
  "ocr_key":"a5cf9c8f-2f66-4490-a7db-8a5bc70c1b76"
}
```

The *cnh* object is used to represent driver’s licenses (CNHs) throughout the API, including information on whether any validation method was used. They are represented as follows:

name | type | description
---- | :----: | ----------
register_number | string | Registration number of the registered CNH.
issuer_state | enum | Enumerator for the state where the CNH was issued.
first_issuance_date | date | Date of first issuance.
issuance_date | date | Date of issuance.
expiration_date | date | Expiration date.
category | enum | CNH category in uppercase letters.
validation_type | enum | Type of validation used during the document registration.
ocr_key | guid | ID returned by QI Tech’s document validation API.

The following enumerators exist for *validation_type*: `zaig_api` and `zaig_sdk`.

## *rg* Object

Request Body

```json
{
  "number": "4.366.477-8",
  "issuer": "II",
  "issuer_state": "PR",
  "issuance_date":"2002-01-12",
  "validation_type":"zaig_sdk",
  "ocr_front_key":"a5cf9c8f-2f66-4490-a7db-8a5bc70c1b76",
  "ocr_back_key":"a5cf9c8f-2f66-4490-a7db-8a5bc70c1b76"
}
```

The *rg* object is used to represent identity documents (RGs) throughout the API, including information on whether any validation method was used. They are represented as follows:

name | type | description
---- | :----: | ----------
number | string | Registered document number, including formatting (dots, hyphens, slashes, etc.).
issuer | string | Issuing authority of the document (abbreviation, e.g.: II, SESP...).
issuer_state | enum | State (UF) where the document was issued.
issuance_date | date | Date the document was issued.
validation_type | enum | Type of validation used during the document registration.
ocr_key | guid | ID returned by QI Tech’s document validation API.

The following enumerators exist for *validation_type*: `zaig_api` and `zaig_sdk`.

## *ie* Object

Request Body

```json
{
  "number": "388.108.598.269",
  "issuer": "JUCESP",
  "issuer_state": "SP",
  "issuance_date":"2002-01-12",
  "validation_type": "zaig_api",
  "ocr_key": "c64627db-1ba4-48b6-979d-06222a25d5e9"
}
```

The *ie* object is used to represent State Registration documents within the *documents* object in the *legal_person* endpoint, including information on whether any validation method was used. It is represented as follows:

name | type | description
---- | :----: | ----------
number | string | Registered document number, including formatting (dots, hyphens, slashes, etc.).
issuer | string | Issuing authority of the document (abbreviation, e.g.: JUCESP, JUCEGO...).
issuer_state | enum | State (UF) where the document was issued.
issuance_date | date | Date the document was issued.
validation_type | enum | Type of validation used during the document registration.
ocr_key | guid | ID returned by QI Tech’s document validation API.

The following enumerators exist for *validation_type*: `zaig_api`.

## *company_statute* Object 

Request Body

```json
{
  "ocr_key": "60ed79c4-5aba-4cc7-aebb-5de5f92b7d0d"
}
```

The *company_statute* object is used to represent company formation documents, such as an Articles of Incorporation, within the *documents* object in the *legal_person* endpoint. It is represented as follows:

name | type | description
---- | :----: | ----------
ocr_key | guid | ID returned by QI Tech’s OCR API after sending the image or PDF of a company formation document.

## *letter_attorney* Object 

Request Body

```json
{
  "ocr_key": "13571175-b1d9-4507-82e0-d266516fc5ae"
}
```

The *letter_attorney* object is used to represent powers of attorney that grant authority to legal representatives within the *documents* object in the *legal_person* endpoint. It is represented as follows:

name | type | description
---- | :----: | ----------
ocr_key | guid | ID returned by QI Tech’s OCR API after sending the image or PDF of a power of attorney document.

## *address* Object

Request Body

```json
{
  "street": "Rua do Teste",
  "number": "111",
  "neighborhood": "Bairro do Exemplo",
  "city": "Aparecida de Goiânia",
  "uf": "GO",
  "complement": "Térreo",
  "postal_code": "00000-000",
  "country": "BRA",
  "validation_type":"visit",
  "ocr_key": "265b1b74-4b93-41dc-ac78-e1c37467225d"
}
```

The *address* object is used to represent addresses throughout the API. Addresses located in Brazilian territory are represented as follows:

name | type | constraints | description
---- | :----: | :----: | ----------
street | string | 1–100 characters | Street name, including thoroughfare, avoiding abbreviations whenever possible.
number | string | 1–50 characters | Property number, including letters if applicable.
neighborhood | string | 1–100 characters | Neighborhood, without abbreviations. **e.g.: Santa Felicidade**
city | string | 1–100 characters | Full city name, without abbreviations.
uf | enum | Brazilian state abbreviation (2 letters) | Federal unit (state). **e.g.: SP, GO, MG**
complement | string | 1–500 characters | Any additional information to help locate the property. **e.g.: Apartment 101, Suite 12**
postal_code | string | Format `XXXXX-XXX` | Brazilian postal code (CEP) with hyphen, exactly 9 characters. Example: `01310-100` *(required)*
country | string | 3 uppercase letters | ISO 3166-1 alpha-3 country code. Example: `BRA`
validation_type | enum | `visit` or `zaig_ocr` | Type of validation used during the address registration.
ocr_key | guid | UUID (`xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`) | ID returned by QI Tech’s OCR API or SDK after submitting the image of the proof of residence.

For addresses where the country is not Brazil (`BRA`), the `postal_code` and `uf` fields may be filled in freely.

## *phone* Object 

Request Body

```json
{
  "international_dial_code": "1",
  "area_code": "11",
  "number": "999999999",
  "type": "mobile",
  "validation_type": "zaig_sms",
  "validation_key": "82589b39-e34f-44f9-b0fe-d8fc0ee6129c"
}
```

A *phone* object represents a phone number, either domestic or international, and its classification. The fields are:

name | type | constraints | description
---- | :----: | :----: | ----------
international_dial_code | string | 1–7 characters, digits only | International dialing code, without zero or `+`. Example: `55` for Brazil *(required)*
area_code | string | 1–10 characters, digits only | Area code, without zero. Example: `11` *(required)*
number | string | 1–20 characters | Phone number, without hyphen *(required)*
type | enum | `residential`, `commercial` or `mobile` | Type of phone number.
validation_type | enum | `zaig_sms`, `zaig_call`, `company_sms` or `company_call` | Type of validation used during phone registration.
validation_key | guid | UUID (`xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`) | ID returned by QI Tech’s phone validation API.

## *source* Object 

Request Body

```json
  {
    "channel": "app",
    "platform": "android",
    "ip":"211.7.142.62",
    "session_id": "733adf2c-a994-4113-aa59-beb646091fea",
  }
```

A *source* object represents the set of information about the platform used by the client during their registration. The fields are:

name | type | description
---- | :----: | ----------
channel | string | Sales channel/ client registration
platform | string | Platform used by the client to complete their registration
ip | string | IP address collected from the device at the time of registration
session_id | string | Unique session identifier, used to match the device scan with the corresponding registration

## *face* Object 

Request Body

```json
  {
    "type":"zaig_face_sdk",
    "registration_key":"46f38cf4-07b2-4de6-93e9-64b51a68378a"
  }
```

A *face* object represents a facial recognition validation performed through QI Tech’s APIs or SDKs to verify the authenticity of the client prior to registration submission. The fields are:

name | type | description
---- | :----: | -----------
validation_type | enum | Type of facial recognition validation performed.
registration_key | guid | Identifier returned by QI Tech’s API or SDK to represent the registration.
validation_key | guid | Identifier returned by QI Tech’s API or SDK to represent the validation.

The following enumerators exist for *validation_type*: `zaig_api` and `zaig_sdk`.

## *partner* Object

Request Body

```json
  {
    "name": "John Partner",
    "document_number": "111.111.111-11",
    "birthdate": "1992-09-15",
    "gender": "male",
    "nationality": "BRA",
    "mother_name": "Maria Partner's Mother",
    "occupation": "Teacher",
    "emails":[
      {
        "email": "johnsample@test.com",
        "validation_type":"zaig_api",
        "validation_key": "e9f0de49-16fb-431e-be1a-ee4bf1096eda"
      }
    ],
    "documents": {
      "rg": {
        "number": "4.366.477-8",
        "issuer": "II",
        "issuer_state": "PR",
        "issuance_date":"2002-01-12",
        "validation_type":"zaig_sdk",
        "ocr_front_key":"a5cf9c8f-2f66-4490-a7db-8a5bc70c1b76",
        "ocr_back_key":"a5cf9c8f-2f66-4490-a7db-8a5bc70c1b76"
      },
      "cnh": {
        "register_number": "05163811694",
        "issuer_state": "PR",
        "first_issuance_date":"2011-03-21",
        "issuance_date":"2016-06-29",
        "expiration_date":"2021-06-25",
        "category": "AB",
        "validation_type":"zaig_sdk",
        "ocr_key":"a5cf9c8f-2f66-4490-a7db-8a5bc70c1b76"
      }
    },
    "address": {
      "street": "Rua do Teste",
      "number": "111",
      "neighborhood": "Bairro do Exemplo",
      "city": "Aparecida de Goiânia",
      "uf": "GO",
      "complement": "Térreo",
      "postal_code": "00000-000",
      "country": "BRA",
      "validation_type":"visit",
    },
    "phones": [
      {
        "international_dial_code": "1",
        "area_code": "11",
        "number": "999999999",
        "type": "mobile",
        "validation_type": "zaig_sms",
        "validation_key": "82589b39-e34f-44f9-b0fe-d8fc0ee6129c"
      }
    ],
    "source": {
      "channel": "app",
      "platform": "android",
      "ip":"255.321.321.1",
      "session_id": "54b8e3cf-15de-41e5-9305-0ecf059d6e2a"
    },
    "face":
    {
      "type":"zaig_sdk",
      "registration_key":"46f38cf4-07b2-4de6-93e9-64b51a68378a"
    }
  }
```

A *partner* object represents the data of a company's partner being registered, as well as information related to any validations the partner underwent during the registration process. The fields are:

name | type | description
:----: | :----: | -----------
name | string | Full name of the partner being registered
document_number | string | CPF of the partner, with periods and hyphens, following the standard format *(required)*
birthdate | date | Partner’s birthdate in the expected format
gender | enum | Partner’s gender: 'male' or 'female'
nationality | string | Nationality of the partner, in ISO 3166-1 alpha-3
mother_name | string | Full name of the partner’s mother
occupation | string | Profession of the partner being registered
emails | Email | List of Email objects describing the partner’s email addresses
documents | Document | Document object representing any documents submitted during the partner’s registration
address | Address | Address object representing the partner’s residential address
phones | List of Phone | List of phone objects with the partner’s phone numbers
source | Source | Source object describing the platform used for submitting the registration
face | Face | Face object containing information on the facial validation

## *legal_representative* Object

Request Body

```json
  {
    "name": "Frederic Attorney",
    "document_number": "111.111.111-11",
    "birthdate": "1987-06-12",
    "gender": "male",
    "nationality": "BRA",
    "mother_name": "Jackie Attorney Mother",
    "occupation": "Accountant",
    "emails":[
      {
        "email": "frederic@attorney.com",
        "validation_type":"zaig_api",
        "validation_key": "d174d522-6003-4b05-adb2-e92e92632c67"
      }
    ],
    "documents": {
      "letter_of_attorney": {
        "ocr_key": "6972894d-d2ef-4b5f-b54f-10f178bf3e5d"
      },
      "cnh": {
        "register_number": "05163811694",
        "issuer_state": "PR",
        "first_issuance_date":"2011-03-21",
        "issuance_date":"2016-06-29",
        "expiration_date":"2021-06-25",
        "category": "AB",
        "validation_type":"zaig_sdk",
        "ocr_key":"a5cf9c8f-2f66-4490-a7db-8a5bc70c1b76"
      }
    },
    "address": {
      "street": "Avenida de Exemplo",
      "number": "99",
      "neighborhood": "Vila do Exemplo",
      "city": "Jundiaí",
      "uf": "SP",
      "complement": "Ap 82",
      "postal_code": "00000-000",
      "country": "BRA",
      "validation_type":"proof_of_address",
      "ocr_key": "265b1b74-4b93-41dc-ac78-e1c37467225d"
    },
    "phones": [
      {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "999998877",
        "type": "mobile",
        "validation_type": "zaig_sms",
        "validation_key": "e390d2b3-cb71-4991-9d94-1b7f8b43a04e"
      }
    ],
    "source": {
      "channel": "app",
      "platform": "ios",
      "ip":"175.92.122.2",
      "session_id": "93c68588-7a41-472f-95b3-835ea6ee1ede"
    },
    "face":
    {
      "type":"zaig_sdk",
      "registration_key":"d2677a8c-d575-44e1-a54d-ec00f9310f34"
    }
  }
```

A *legal_representative* object represents the data of a company’s legal representative being registered, as well as information regarding any validations they underwent during the registration process. The fields are:

name | type | description
:----: | :----: | -----------
name | string | Full name of the legal representative being registered
document_number | string | CPF of the legal representative, with periods and hyphens, following the standard format
birthdate | date | Legal representative’s birthdate in the expected format
gender | enum | Legal representative’s gender: 'male' or 'female'
nationality | string | Nationality of the legal representative, in ISO 3166-1 alpha-3
mother_name | string | Full name of the legal representative’s mother
occupation | string | Profession of the legal representative being registered
emails | Email | List of Email objects describing the legal representative’s email addresses
documents | Document | Document object representing any documents submitted during the representative’s registration
address | Address | Address object representing the legal representative’s residential address
phones | List of Phone | List of phone objects with the legal representative’s phone numbers
source | Source | Source object describing the platform used for submitting the registration
face | Face | Face object containing information on the facial validation

---

# Retrieve a Registration

URL: /en/documentation/caas/onboarding/query_registration

## Search a Specific Registration

To retrieve a specific Registration, just make a GET request. The returned result is the most up-to-date JSON of the requested Registration. If the provided identifier is not associated with any object, an HTTP 404 Status will be returned.

* **Natural Person:**

`GET https://api.caas.qitech.app/onboarding/natural_person/12345678`

* **Legal Person:**

`GET https://api.caas.qitech.app/onboarding/legal_person/12345678`

```shell
curl "https://api.caas.qitech.app/onboarding/natural_person/12345678"
  -H "Authorization: EXAMPLE-OF-API-KEY"
```

> The curl above returns the JSON that represents a Natural Person object.

```shell
curl "https://api.caas.qitech.app/onboarding/legal_person/12345678"
  -H "Authorization: EXAMPLE-OF-API-KEY"
```

> The curl above returns the JSON that represents a Legal Person object.

## Retrieve PDF

To retrieve a PDF of a registration, simply make a GET request. The returned result is the PDF file generated from the analysis. If you want the PDF to be returned in base64 format, you can add a query string named `base64` with the value `true`.

:::info **Attention**

PDF generation by the platform is asynchronous and takes a few seconds. If the GET request is made before the PDF is fully generated, a 404 error will be returned with a message explaining the situation. Simply retry after a few seconds and the PDF will be returned.
:::

* **Natural Person:**

`GET https://api.caas.qitech.app/onboarding/natural_person/12345678/pdf`

`GET https://api.caas.qitech.app/onboarding/natural_person/12345678/pdf?base64=true`

* **Legal Person:**

`GET https://api.caas.qitech.app/onboarding/legal_person/12345678/pdf`

`GET https://api.caas.qitech.app/onboarding/legal_person/12345678/pdf?base64=true`

```shell
curl "https://api.caas.qitech.app/onboarding/natural_person/12345678/pdf"
  -H "Authorization: EXAMPLE-OF-API-KEY"
```

> The curl above returns the PDF file generated by the request.

```shell
curl "https://api.caas.qitech.app/onboarding/legal_person/12345678/pdf"
  -H "Authorization: EXAMPLE-OF-API-KEY"
```

> The curl above returns the PDF file generated by the request.

---

# Standards

URL: /en/documentation/caas/onboarding/standards

To simplify integration and ensure data integrity, some standards have been defined and are followed throughout the API.

## Monetary Values

> Examples:

```
10000
12345
98741
1223
1
0
```
The APIs assume that all monetary values sent are in Brazilian Reais. Values must be sent as integers in cents.

## Date and Time with Timezone

> Some examples:

```
2019-10-15T22:35:12.232-03:00
2018-05-01T13:32:11.297+00:00
2019-05-01T00:00:00.000+00:00
```

It is represented according to the ISO 8601 standard. In this case, the timezone is placed immediately after the time and should represent the timezone of the location where that data will be valid.

The validation mask is as follows:

`YYYY-MM-ddThh:mm:ss.sss±hh:mm`

## Date and Time without Timezone

> Some examples:

```
2019-10-15T22:35:12
2018-05-01T13:32:11
2019-05-01T00:00:00
```

It is represented according to the ISO 8601 standard. Data that is independent of timezones should be sent without one, always in UTC, using the letter Z to indicate that the data is in UTC. Therefore, the following format will be validated:

`YYYY-MM-ddThh:mm:ss.sssZ`

## Date
> Some examples:

``` 
2019-10-15
2019-01-01
2017-03-20
```

For fields that only receive a date—such as a birthdate—only the date, without any time, should be sent in the following format:

`YYYY-MM-dd`
 

## Documents

Since document numbers vary widely and many include non-numeric characters, all document numbers are defined as strings. Another important reason to treat them as strings is to preserve leading zeros. Documents mentioned on this page follow a strict mask and will be validated accordingly. Other documents, like RG, due to their lack of standardization, will not be validated.

## CPF

> Examples of valid CPFs based on the defined mask:

```
123.456.789-12
321.987.543-23
111.283.333-00
```

> Examples of invalid CPFs based on the defined mask:

```
8.577.477-8
08.104.627/0001-23
123.456.789-1
23.456.789-01
```

CPF is always defined as a string and will be validated against the following mask:

`###.###.###-##`

## CNPJ

> Examples of valid CNPJs based on the defined mask:

```
08.104.627/0001-02
01.079.210/0114-67
32.402.502/0001-35
```

> Examples of invalid CNPJs based on the defined mask:

```
8.577.477-8
123.456.789-12
321.987.543-23
32.402.502/0001-3
032.402.502/0001-3
```

CNPJ is always defined as a string and will be validated against the following mask:

`##.###.###/####-##`

## IP

> Examples of valid IPs based on the defined mask:

```
201.81.161.86
201.081.161.86
201.81.161.086
201.81.0.1
```

> Examples of invalid IPs:

```
201.81..86
358.81.161.86
201.81.161
```

IPs must always be sent in IPv4 format. Leading zeros are optional, as long as the following mask is respected:

`###.###.###.###`

---

# Status Dynamics

URL: /en/documentation/caas/onboarding/status_dynamics

The analysis process consists of submitting a registration, either of a **Natural Person** or a **Legal Person**, to the appropriate endpoint and waiting for the response.

After QI Tech completes the registration analysis, it will return a response with a status related to the analysis. This status is called **analysis_status**, which represents the result of the registration evaluation performed by QI Tech.

In addition to **analysis_status**, QI Tech also provides the **client_status**, which aims to represent the status that the client holds at each point in their journey on your platform.

### **analysis_status**

As previously described, QI Tech has seven **analysis_status** values that indicate the decision status from the onboarding engine and it features a simple state machine:

analysis_status | Description
:---------: | ---------
automatically_approved | QI Tech's algorithms recommend that this registration be approved  
automatically_reproved | QI Tech's algorithms recommend that this registration be rejected  
in_manual_analysis | QI Tech's algorithms have forwarded this registration for manual review  
manually_approved | After manual review, the analyst decided to approve the registration  
manually_reproved | After manual review, the analyst decided to reject the registration  
in_queue | The registration is being processed asynchronously. The result will be returned via Webhook  
pending | The queries are taking longer than expected; this registration has entered an automatic review queue and will be returned via Webhook  
not_analysed | The registration was sent with the analysis flag set to false, meaning our systems will not return a recommendation  

### **client_status**

The **client_status** indicates the client's registration situation, that is, the status of the individual or company within your platform. The following enumerators exist for this status:

client_status | Descrição
:---------: | ---------
registered | The client has been registered on your platform, but no approval or rejection decision has been made yet  
approved | The client is approved on your platform  
reproved | The client is rejected on your platform  
fraud_blocked | The client has been blocked from using your platform due to suspected or confirmed fraud  
default_blocked | The client has been blocked from using your platform due to default  
canceled | The client has canceled the use of your service

---

# Atualizar um Cadastro

URL: /en/documentation/caas/onboarding/update_registration

Request Body: In the case of blocking a registration due to fraud or suspected fraud

```json
{
  "client_status": "fraud_blocked",
  "event_date": "2019-11-05T13:34:12-03:00"
}
```

Request Body: In the case of blocking a registration due to default

```json
{
  "client_status": "default_blocked",
  "event_date": "2019-11-05T13:34:12-03:00"
}
```

Request Body: In case of registration cancellation requested by the client

```json
{
  "client_status": "cancelled",
  "event_date": "2019-11-05T13:34:12-03:00"
}
```

To ensure the feedback loop of the rules and the artificial intelligence model, it is necessary to notify the system when Registrations go through changes, such as when they are blocked or canceled. The status used for these changes is **client_status**, which must be updated whenever there are changes in the client’s lifecycle. For this, requests using the PUT method, authenticated as usual, should be used, and the statuses must follow the previously detailed standard:

* **Natural Person:**

`PUT https://api.caas.qitech.app/onboarding/natural_person/123456`

* **Legal Person:**

`PUT https://api.caas.qitech.app/onboarding/legal_person/123456`

---

# Webhook

URL: /en/documentation/caas/onboarding/webhook

Fraud status updates (for registrations that are routed to manual review or responded with a Pending status) are notified via Webhook. To enable this, you must configure an endpoint URL and a *secret_token* used to sign the request through our [support team](mailto:suporte.caas@qitech.com.br).

Although not recommended, clients may alternatively use the [polling](https://en.wikipedia.org/wiki/Polling_(computer_science)) technique. In this case, simply avoid configuring a webhook endpoint and rely on the registration retrieval endpoints to perform polling.

## Signature

> Example of signature calculation in Python

```python
    hmac_obj = hmac.new(signature_key.encode('utf-8'), (endpoint + method + payload).encode('utf-8'), hashlib.sha1)
    return hmac_obj.hexdigest()
```

To ensure that the request received on the webhook endpoint originates from our servers, an HMAC signature is sent in the `Signature` header, similar to the authentication process.

After calculating the expected signature value on your server side, it is necessary to compare the calculated signature with the one sent. If the signatures match, this means the request originated from our servers and can be trusted.

## Request

```bash
curl --location 'YOUR-ENDPOINT-HERE' \
--header 'Signature: CALCULATED-HASH-HMAC' \
--data '{"natural_person_id": "538509",  "analysis_status": "manually_approved", "event_date": "2024-11-13T17:52:50Z", "reason": "manually_approved"}'
```

The request follows the format above and notifies the change in fraud status. It is important to note that the request uses the HTTP POST verb and the body is sent as UTF-8 encoded string.

## Retries

A notification is considered successful when it receives an HTTP 200 status code in response. If the notifications fail, the system will attempt up to 5 retries at the following intervals, until a 200 is returned or all attempts are exhausted:

* 30 seconds  
* 60 seconds  
* 120 seconds  
* 240 seconds  
* 360 seconds

---

# Authorization Request

URL: /en/documentation/cards/autorizacao/

---

Once the program is set up, the cardholder has been added and has an active card, which can be used to make purchases at various points of sale around the world. Whenever a purchase is started, an `Authorization` is created to authorize it. An `Authorization Request` is forwarded to the integration partner, so that it can decide whether or not to approve this authorization based on the information contained within the request.

The `Authorization` entity contains the current state of the authorized and captured values and can assume the following status values:

| Status | Description |
|---|---|
| pending | Authorization request was authorized and no capture or reversal events were processed |
| unauthorized | Authorization request was not approved |
| completed | Authorization with at least one captured value (equal to, less than, or greater than the total authorized amount) |
| reversed | Authorization was voided in full or expired without capture |

Authorization details can be found at [Retrieve Authorization](https://docs.qitech.com.br/documentation/cards/search/buscar_autorizacao/).

The `Authorization Request` contains [Authentication Headers](https://docs.qitech.com.br/documentation/cards/autorizacao/autenticacao/) and has the following attributes:

### Authorization Request

ENDPOINT (client_url)/authorization_request
METHOD POST

Request Body

```json
{
	"authorization_key": "c91ce179-517c-48f9-9c28-18368457b67f",
	"authorization_request_key": "cccbd9e9-863f-44b5-aa05-f6afa555bb74",
	"card": {
		"card_key": "05fd3654-1f5d-479d-ade5-64239fdf214d",
		"account_key": "595e08f0-da4e-40f7-8db4-f9a25c829818",
		"type": "virtual",
		"card_name": "ecommerce sample",
		"printed_name": "Aurora Catarina",
		"status": "active",
		"brand": "visa",
		"bin": "123456",
		"last_four_digits": "5695"
	},
	"terminal_id": "123456",
	"terminal_country_code": "BRA",
	"terminal_type": "2",
	"terminal_pin_entry_capability": true,
	"terminal_magnetic_stripe_capability": true,
	"terminal_contactless_capability": false,
	"terminal_chip_capability": true,
	"merchant_acquirer_code": "250",
	"merchant_code": "123456",
	"merchant_name": "VASP LINHAS AEREAS",
	"merchant_street": "RUA CMDTE X, 127",
	"merchant_city": "SAO PAULO, SP",
	"merchant_region": "BRA",
	"merchant_postal_code": "04570-140",
	"merchant_mcc": "3036",
	"authorization_code": "473890",
	"nsu": "123456",
    "acquirer_reference_number": "12312423",
	"merchant_currency_code": "BRL",
	"merchant_amount": 10.59,
	"billing_currency_code": "BRL",
	"billing_amount": 10.59,
	"processing_datetime": "2023-01-10T13:45:52.000Z",
	"number_of_installments": 1,
	"authorization_request_type": "authorization",
	"pan_entry_mode": "chip",
	"pin_sent": true,
	"authorization": {Authorization Object}
}
```

#### Authorization Request

| Field | Type | Description |
|---|---| ---|
| `authorization_request_key` | string | Authorization request unique identifier |
| `authorization_key` | string | Authorization unique identifier |
| `card` | object |**[Object Card](#object-card)** |
| `terminal_id` | string | The terminal identifier sent by the acquirer in the authentication message |
| `terminal_country_code` | string | The country code of the terminal, sent in the authorization message according to ISO 3166-1 alpha-3 |
| `terminal_type` | string | The endpoint type as received in the authorization message |
| `terminal_pin_entry_capability` | boolean | Is there a possibility to enter the card password in the terminal? |
| `terminal_magnetic_stripe_capability` | boolean | Is the terminal capable of reading the magnetic stripe? |
| `terminal_contactless_capability` | boolean | Is the terminal capable of initiating contactless transactions? |
| `terminal_chip_capability` | boolean | Is the terminal capable of initiating transactions using the EMV chip? |
| `merchant_acquirer_code` | string | The acquirer's identifier as per the authorization message |
| `merchant_code` | string | The identifier of the merchant in the acquirer according to the authorization message |
| `merchant_name` | string | The name of the merchant according to the authorization message |
| `merchant_street` | string | Merchant's address street |
| `merchant_city` | string | Merchant's address city |
| `merchant_region` | string | Merchant's address region |
| `merchant_postal_code` | string | Merchant's address postal code |
| `merchant_mcc` | string | Merchant's category code - [Updated list can be found here](https://usa.visa.com/content/dam/VCOM/download/merchants/visa-merchant-data-standards-manual.pdf ) |
| `authorization_code` | string | 6-digit authorization code |
| `nsu` | string | Unique sequential number that defines an authorization |
| `acquirer_reference_number` | string | Unique identifier of the authorization in the acquirer |
| `merchant_currency_code` | string | The currency used by the merchant - ISO 4217-alpha |
| `merchant_amount` | decimal | Authorization amount in the merchant's currency |
| `billing_currency_code` | string | The cardholder's billing currency - ISO 4217-alpha |
| `billing_amount` | decimal | Authorization amount in cardholder's billing currency |
| `processing_datetime` | timestamp utc | Authorization's processing time |
| `number_of_installations` | int | Number of installments |
| `authorization_request_type` | enum | Enumerator of **[Authorization Request Types](#authorization-types)** |
| `pan_entry_mode` | enum | **[PAN Input Modes](#pan-input-modes)** - Chip, Typed, Stripe, Fallback, Contactless |
| `pin_sent` | boolean | Was a PIN entered in the terminal? |
| `authorization` | object | Authorization object in [Retrieve Authorization](https://docs.qitech.com.br/documentation/cards/search/buscar_autorizacao/) - presented only when the type of the authorization request is incremental |

#### Card Object

| Field | Type | Description |
|---| ---| ---|
| card_key | string | Card unique identifier|
| account_key | string | Card linked account unique identifier |
| type | string | Card type |
| card_name | string | Card name |
| printed_name | string | Name printed on card |
| status | string | Current card status |
| brand | string | Card network name |
| bin | string | Card BIN |
| last_four_digits | string | Card's last four digits |

#### Authorization Request Types

| Enumerator | Description |
|---|---|
| `authorization` | Normal authorization request |
| `incremental_authorization` | Incremental authorization request |
| `partial_reversal_authorization` | Authorization to perform a partial reversal of a previous authorized `Authorization` |
| `reversal_authorization` | Authorization to fully reverse a previous `Authorization` |

#### PAN Input Modes

Enumerator | ISO 8583 | Description
---------- | -------- | -----------
unknown | 00 | PAN entry mode unknown.
typed | 01 | PAN entered manually (typed).
bar_code | 03 | PAN entered via barcode reader
ocr | 04 | PAN entered via OCR (Optical Character Recognition)
chip | 05 | PAN inserted by integrated circuit card (Chip)
track_1 | 06 | PAN inserted by Track 1 of the stripe card
contactless | 07 | PAN entered via Contactless EMV
fallback_typed | 79 | An attempt was made to use the card or stripe reader on the device and the card but it was not possible to process the transaction with that information (Possibly a problem with the device or the card), so the PAN was entered. In some cases, the acquirer is not approved to use the CHIP or the stripe and sends this code.
fallback_magnetic_stripe | 80 | An attempt was made to use the card reader on the device and the card but it was not possible to process the transaction with that information (Possibly a problem with the device or the card), so the magnetic stripe on the card was used.
ecommerce | 81 | E-commerce / non-face-to-face transaction
magnetic_stripe | 90 | Stripe transaction (Card does not have a chip or device does not have a reader/was not approved)

### Approve or deny response to an authorization request

The response to the `Authorization Request` must be always a HTTP Status 201 and the decision must be informed in the `authorization_request_response` attribute. If the decision is negative, a denial reason enumerator must be informed and the denial details can be provided.

ENDPOINT (client_url)/authorization_request
METHOD POST
HTTP STATUS 201

Response Body

```json
{
    "approve": false,
    "denial_reason": "fraud_suspicion",
    "denial_reason_details": "Customer tried to perform a transaction 10 times the average transactions"
}
```

 
#### Detail

| Field | Type | Description |
|---|---| ---|
| `authorization_request_response` *(required)* | enumerator | `authorized` if the authorization is approved or `unauthorized` if the authorization is denied |
| `denial_reason` | enum | **[Denial Reason Enumerator](#denial-reason-enumerator)** |
| `denial_reason_details` | string | Denial reason details | |

#### Denial Reason Enumerator
| Enumerator | Description |
|--- | --- |
| **fraud_suspicion** | Authorization request with suspicious behavior|
| **blocked_cardholder** | Cardholder blocked or with restrictions |

#### Negative answer

Any HTTP status other than 201 will be interpreted as the client's inability to process the authorization. The decision rule configured in the client program will then be applied for cases of unavailability.

Important: Authorizations that are denied by the default card validation rules are automatically responded to the card network (Visa) by QI without forwarding the authorization request to the integration partner.

## Incremental Authorization

An `Authorization` may receive more than one `Authorization Request`- the second and greater are called incremental authorizations. Each `Authorization Request` may or may not be authorized and the `Authorization` entity always represents the result of all authorized responses to `Authorization Requests`.

An incremental authorization can be identified by the `authorization_type` field with value *incremental_authorization*. Whenever the request is of this type, the related `Authorization` object will be sent together with the `Authorization Request` payload.

---

# Transactions in the QI Account

URL: /en/documentation/cards/autorizacao/balance_transaction

---

In the context of prepaid cards, debit or credit situations have an impact on the cardholder's QI Account. These transactions are represented by the `Balance Transaction` entity. These transactions must obligatorily be executed on the cardholder's QI Account, even if late. Therefore, if a debit cannot be carried out for some reason, the `Balance Transaction` will remain pending and will be automatically retained by the QI system until the entire amount is debited.

It is important to monitor these transactions and if any `Balance Transaction` remains pending, the customer must contact the cardholder to ensure that the QI Account is ready and with the necessary balance to cover this pending issue.

Whenever a `Balance Transaction` is created, a `Balance Transaction Event` webhook will be sent.

Transaction Event Webhook in Account IQ

```json
{
"key": "cccbd9e9-863f-44b5-aa05-f6afa555bb74",
"date": {
"balance_transaction_key": "cccbd9e9-863f-44b5-aa05-f6afa555bb74",
"transaction_key": "b64c1ca5-095d-4005-a4ed-3be09d7b111f",
"amount": 25.32,
"transacted_at": "2023-07-24T12:00:00.000Z",
"balance_transaction_status": "transacted"
},
"webhook_type": "prepaid_card.balance_transaction_event",
"event_datetime": "2023-07-24T12:00:00.000Z"
}
```

#### Details

| Field | Type | Description |
|---|---| ---|
| `balance_transaction_key` | string | Authorization Request Unique Identifier |
| `transaction_key` | string | Entity unique identifier Authorization related to this request |
| `amount` | string | The amount transacted on the QI Account in this event |
| `transacted_at` | string | The time the transaction was executed |
| `balance_transaction_status` | string | The state of the `Balance Transaction` after this event |

The `balance_transaction_status` describes whether the transaction was executed on the cardholder's QI Account, which may be pending (`pending_transaction_execution`), partially transacted (`partially_transacted`) or transacted (`transacted`)

:::danger Atenção!
Os webhooks da QI Tech não devem ser mapeadas de forma restrita. 
Campos adicionais podem ser incluídos aos payloads dos webhooks retornados em nossas APIs.
:::

:::info Reenvio de webhooks!
A consulta e reenvio de webhooks pode ser feito conforme documentação: [Reenvio de webhooks](/documentation/notificacoes/reenvio_de_notificacoes)
:::

---

# Simulate authorization

URL: /en/documentation/cards/autorizacao/simular_autorizacao

### Request

ENDPOINT /mock/card/authorization
METHOD POST

Request Body

```json
{
  "card_key": "ff3c4484-7a52-457e-b989-d9dcb87dfcd6",
  "merchant_name": "Supermarket XYZ",
  "merchant_city": "São Paulo",
  "merchant_region": "BR",
  "merchant_postal_code": "01001000",
  "merchant_mcc": "5411",
  "amount": 150.75,
  "authorization_type": "purchase"
}
```

### Response

```json
{
  "is_approved": true,
  "response_code": "00",
  "limit_amount": null
}
```

### Request Body Object

In this table, a description of all the variables used in the above-detailed requests is available.

| Field                 | Type   | Description                                        | Max. Length  | Example              |
|-----------------------|--------|----------------------------------------------------|--------------|----------------------|
| **card_key**          | string | Card unique key (required)                         | 36           | "ff3c4484-7a52-457e-b989-d9dcb87dfcd6"    |
| **authorization_type**| string | Type of the authorization (required)               | **[Enumerators](#authorization-type-enumeradores)** |
| **merchant_name**     | string | Name of the merchant                               | 40           | "Supermarket XYZ"    |
| **merchant_city**     | string | City of the merchant                               | 40           | "São Paulo"          |
| **merchant_region**   | string | Country of the merchant                            | 2            | "BR"                 |
| **merchant_postal_code** | string | Postal code of merchant                         | 8            | "01001000"           |
| **merchant_mcc**      | string | Category code of the merchant                      | **[Enumerators](#merchant-mcc-enumeradores)** |
| **amount**            | number | Transaction amount                                 | -            | 150.75               |

### Merchant_mcc enumerators

| Enumerator | Description                                 |
|------------|--------------------------------------------|
| 5812       | Eating Places, Restaurants                 |
| 5499       | Miscellaneous Food Stores                  |
| 5814       | Fast Food Restaurants                      |
| 5411       | Grocery Stores, Supermarkets               |
| 4121       | Taxicabs and Limousines                    |
| 4111       | Local and Suburban Transit                 |
| 4215       | Courier Services, Air or Ground            |
| 5912       | Drug Stores and Pharmacies                 |
| 5815       | Digital Goods: Applications (Excludes Games)|
| 8999       | Professional Services (Not Elsewhere Classified)|
| 5462       | Bakeries                                   |
| 5541       | Service Stations (with or without Ancillary Services)|
| 7523       | Parking Lots, Parking Meters and Garages   |
| 5300       | Wholesale Clubs                            |
| 4899       | Cable, Satellite and Other Pay Television and Radio Services|
| 5311       | Department Stores                          |
| 5813       | Bars, Cocktail Lounges, Discotheques, Nightclubs and Taverns (Drinking Places)|
| 7372       | Computer Programming, Data Processing and Integrated Systems Design Services|
| 5099       | Durable Goods (Not Elsewhere Classified)   |
| 5943       | Stationery Stores, Office and School Supply Stores|
| 7299       | Miscellaneous Personal Services (Not Elsewhere Classified)|
| 5199       | Nondurable Goods (Not Elsewhere Classified)|
| 7230       | Beauty and Barber Shops                    |
| 5999       | Miscellaneous and Specialty Retail Stores  |
| 5651       | Family Clothing Stores                     |

### Authorization_type enumerators

| Enumerator  | Description                |
|-------------|----------------------------|
| purchase    | Purchase                   |
| reversal    | Reversal                   |
| withdrawal  | Withdrawal                 |

---

# Creating a physical card

URL: /en/documentation/cards/create/gerar_cartao_fisico

## Request

ENDPOINT /prepaid/card
METHOD POST

Request Body

```json
{
    "account_key": "5294ed8d-08fc-4397-b15f-6d9aa07b0041",
    "program_key": "7d405c31-ec9a-46c1-8ac8-54bab209bf41",
    "type": "plastic",
    "card_name": "ecommerce",
    "printed_name": "Aurora Catarina",
    "contactless_enabled": true,    
    "delivery_address": {
        "address": "Rua Cel. Domingos Diniz",
        "neighborhood": "Centro",
        "zip_code": "35797000",
        "city": "Presidente Juscelino",
        "state": "MG",
        "complement": "Quadra 08 Lote 259",
        "reference": "Supermercado Presidente",
        "address_type": "residential"
    }
}
```

:::info Information
The address used for sending the physical card will be the same one provided when opening the payment account at QI Tech. 
:::

### Body params

| Field                   | Type    | Description                                                                                     | Characters                                 |
|-------------------------|---------|-------------------------------------------------------------------------------------------------|--------------------------------------------|
| `account_key` *         | string  | Account identification key on QI Tech payment.                                                  | uuid                                       |
| `program_key` *         | string  | Program identification key to issue a card.                                                     | uuid                                       |
| `type` *                | string  | Type of card to be issued (PLASTIC).                                                            | **[Enumerators](#Enumerators-card_type)** |
| `card_name` *           | string  | Card alias, how this card will be identified.                                                   | 15                                         |
| `printed_name` *        | string  | Name to be printed on the card (numbers and special characters will not be allowed).            | 26                                         |
| `contactless_enabled` * | boolean | Enable or disable the use of contactless on the card                                            | -                                          |
| `delivery_address`   | Object | Card delivery address.                                                                              | **[Object Address](#address)** |

### Enumerators card_type

| Enumerator | Translate     | 
|------------|---------------|
| plastic    | Physical Card | 
| virtual    | Virtual Card  |

### Address

| Field         | Type   | Description                              | Characters |
|---------------|--------|------------------------------------------|------------|
| address*      | string | Card delivery address                    | 100        |
| neighborhood* | string | Neighborhood of the delivery address     | 100        |
| zip_code*     | string | ZIP code of the delivery address         | 8          |
| city*         | string | City of the delivery address             | 100        |
| state*        | string | State of the delivery address            | 2          |
| number        | number | Street number of the delivery address    |            |
| complement    | string | Complement of the delivery address       | 100        |
| reference     | string | Reference point of the delivery address   | 100        |
| address_type* | string | Type of delivery                         | **[Enumerators](#address-type-enumerators)** |

:::caution Attention!
The `number` field is optional. Addresses without a street number can be submitted without this field.
:::

### Enumeradores address_type

| Enumerator | Translation            | 
|------------|------------------------|
| residential| Residential address    |  
| commercial | Commercial address     | 
| other      | Other address          | 

## Response

STATUS 201

Response Body

```json
{
    "card_key": "05fd3654-1f5d-479d-ade5-64239fdf214d",
	"created_at": "2023-06-20T19:28:16Z",
    "status":"created"
}
```

### Erros

STATUS 4XX

Response Body

```json
{
  "title": "Bad Request",
  "description": "The type of person is invalid for this program, please try another.",
  "translation": "Invalid Person",
  "code": "CARD000007"
}
```

| Code      | Status code  | Description                    |
|:---------:|:------------:|:-------------------------------|
| QIT000001 | 400          | Invalid Json schema.|
| CARD000005| 404          | It was not possible to fetch the Program for the program_key \{program_key\}.|
| CARD000006| 404          | It was not possible to fetch the Account for the account_key \{account_key\}.|
| CARD000007| 400          | The type of person is invalid for this program, please try another.|
| CARD000008| 400          | The Card Holder with the status \{status\} is invalid for the operation.|
| CARD000009| 400          | We're sorry, but the card could not be generated. Please try again later.|
| CARD000010| 404          | It was not possible to fetch the Person for the person_key \{owner_person_key\}.|
| CARD000033| 403          | Create plastic card is not allowed for program_key \{program_key\}.|

### Webhook

WEBHOOK_TYPE baas.prepaid_card.card

Webhook Body

```json
{
    "webhook_type": "baas.prepaid_card.card",
    "event_datetime": "2023-07-24T12:00:00.000Z",
    "data": {
        "card_key": "9bd93e97-bb6d-410f-8981-06b2765f12a1",
        "account_key": "595e08f0-da4e-40f7-8db4-f9a25c829818",
        "program_key": "bf74df61-557a-45cb-914f-41e127a6e18c",
        "status": "created",
        "type": "plastic"
    }
}
```

---

# Creating a virtual card

URL: /en/documentation/cards/create/gerar_cartao_virtual

## Request

ENDPOINT /prepaid/card
METHOD POST

Request Body

```json
{
    "account_key": "5294ed8d-08fc-4397-b15f-6d9aa07b0041",
    "program_key":"7d405c31-ec9a-46c1-8ac8-54bab209bf41",
    "type": "virtual",
    "card_name": "ecommerce",
    "printed_name": "Aurora Catarina",
    "cvv_rotation_interval_hours": 72
}
```

  ### Body params

| Campo                           | Tipo   | Descrição                                                                                      | Caracteres                                |
|---------------------------------|--------|------------------------------------------------------------------------------------------------|-------------------------------------------|
| `account_key` *                 | string | QI Tech Payment Account Identification Key                                       | uuid                                      |
| `program_key` *                 | string | Program identification key to issue a card.                                      | uuid                                      |
| `type` *                        | string | Type of card to be issued (VIRTUAL).                                                        | **[Enumerators](#enumerators-card_type)** |
| `card_name` *                   | string | Card alias, how this card will be identified.                                           | 15                                      |
| `printed_name` *                | string | Name to be printed on the card (numbers and special characters will not be allowed). | 26                                      |
| `cvv_rotation_interval_hours` * | int    | Interval in hours to update the CVV number.                                                | Number                                    |

### Enumerators card_type

| Enumerator | Translate     | 
|------------|---------------|
| plastic    | Physical Card | 
| virtual    | Virtual Card  |

## Response

STATUS 201

Response Body

```json
{
    "card_key": "05fd3654-1f5d-479d-ade5-64239fdf214d",
	"created_at": "2023-02-20T19:28:16Z",
    "status":"created"
}
```

### Erros

STATUS 4XX

Response Body

```json
{
  "title": "Bad Request",
  "description": "The type of person is invalid for this program, please try another.",
  "translation": "Invalid Person",
  "code": "CARD000007"
}
```

| Code      | Status code  | Description                    |
|:---------:|:------------:|:-------------------------------|
| QIT000001 | 400          | Invalid Json schema.|
| CARD000005| 404          | It was not possible to fetch the Program for the program_key \{program_key\}.|
| CARD000006| 404          | It was not possible to fetch the Account for the account_key \{account_key\}.|
| CARD000007| 400          | The type of person is invalid for this program, please try another.|
| CARD000008| 400          | The Card Holder with the status \{status\} is invalid for the operation.|
| CARD000009| 400          | We're sorry, but the card could not be generated. Please try again later.|
| CARD000010| 404          | It was not possible to fetch the Person for the person_key \{owner_person_key\}.|
| CARD000032| 403          | Create virtual card is not allowed for program_key \{program_key\}.|

### Webhook

WEBHOOK_TYPE baas.prepaid_card.card

Webhook Body

```json
{
    "webhook_type": "baas.prepaid_card.card",
    "event_datetime": "2023-07-24T12:00:00.000Z",
    "data": {
        "card_key": "9bd93e97-bb6d-410f-8981-06b2765f12a1",
        "account_key": "595e08f0-da4e-40f7-8db4-f9a25c829818",
        "program_key": "bf74df61-557a-45cb-914f-41e127a6e18c",
        "status": "created",
        "type": "virtual"
    }
}
```

---

# Introduction

URL: /en/documentation/cards/introducao

QI Tech's prepaid card issuance APIs allow their partners' customers to request and issue either physical or virtual prepaid cards.

At QI Tech, we offer our partners the opportunity to become sub-issuers. Through our APIs, partners can provide their own customers with the ability to issue both physical and virtual prepaid cards, thus providing a complete solution for banking services.

To better understand our system, we will make a brief introduction of how the prepaid card ecosystem works, but we remind you that, as with other APIs, the service must be released together with our team and the **[calls are authenticated](/documentation/primeiros_passos/teste_de_autenticacao)**.

### Prepaid Card

The prepaid card is a card linked to a payment account within QI Tech.

All transactions executed through this card will debit the existing balance in the payment account.

If the account does not have a balance, the transaction will be denied.

### Prepaid Account

QI Tech is an authorized financial institution to operate with prepaid payment accounts by the Central Bank of Brazil. A prepaid card is always linked to a prepaid payment account.

Therefore, to create a prepaid card, whether physical or virtual, it is always necessary to open a payment account. Check **[here](/documentation/contas/abertura_de_conta/abertura_de_conta_pf)** our account opening API.

### Program

In order for a partner to issue a prepaid card, they must have an associated and configured program in their integration with QI.

The program is nothing more than the settings and rules necessary for the issuance of the card in accordance with the VISA flag.

Here are some important information about the program:

* **Program type** - Refers to the type of use of the card. In this documentation, it is the Prepaid modality.
* **Brand** - We use the VISA brand for the cards issued by the program.
* **Card layout** - Refers to the design that will be printed on the physical card and that will be presented in the graphical interface of the virtual card. 

:::caution Attention
For configuration of a new program in an integration, the sales team and the QI Tech deployment team must be activated.
:::

### Virtual Card

The QI Tech card API offers the functionality of generating virtual cards, which can be used in online transactions. This solution provides security and convenience to cardholders.

When using a virtual card, cardholders do not need to provide the details of the physical card during online transactions. Instead, they can generate a unique virtual card, with a number and specific information for that particular transaction. This helps reduce the risk of fraud and increases confidence in online transactions.

### Physical Card

The QI Tech Card API offers the option of creating physical cards, giving cardholders the possibility of having a plastic card for use in in-person transactions.

When requesting a physical card, the holder will receive a personalized plastic card.

The availability of the physical card offers cardholders a traditional and widely accepted way of making payments, ensuring convenience and practicality in their face-to-face transactions. In addition, the physical card can also have additional features, such as contactless payment technology to speed up transactions.

QI Tech's prepaid card API enables cardholders to choose between using virtual cards for online transactions and using physical cards for face-to-face transactions, according to their individual needs and preferences.

---

# Retrieve Authorization

URL: /en/documentation/cards/search/buscar_autorizacao

## Request

ENDPOINT /prepaid/card/(card_key)/authorization/(authorization_key)
METHOD GET

## Response

STATUS 200

Response Body

```json
{
    "authorization_key": "cccbd9e9-863f-44b5-aa05-f6afa555bb74",
    "merchant_currency_code": "BRL",
    "original_merchant_amount": 25.32,
    "billing_currency_code": "BRL",
    "original_billing_amount": 25.32,
    "merchant_amount": 25.32,
    "iof_amount": 0,
    "billing_amount": 25.32,
    "processing_datetime": "2023-07-24T12:00:00.000Z",
    "captured_amount": 25.32,
    "authorization_status": "completed",
    "card": {
        "card_key": "05fd3654-1f5d-479d-ade5-64239fdf214d",
        "account_key": "595e08f0-da4e-40f7-8db4-f9a25c829818",
        "type": "virtual",
        "card_name": "ecommerce sample",
        "printed_name": "Aurora Catarina",
        "status": "active",
        "brand": "visa",
        "bin": "123456",
        "last_four_digits": "5695"
    },
    "balance_transactions": [
        {
            "balance_transaction_key": "cccbd9e9-863f-44b5-aa05-f6afa555bb74",
            "balance_transaction_type": "debit",
            "account_transaction_key": "595e08f0-da4e-40f7-8db4-f9a25c820000",
            "account_key": "595e08f0-da4e-40f7-8db4-f9a25c829818",
            "merchant_currency_code": "BRL",
            "merchant_amount": 25.32,
            "billing_currency_code": "BRL",
            "billing_amount": 25.32,
            "processing_datetime": "2023-01-10T13:45:52.000Z",
            "balance_transaction_status": "transacted",
            "transacted_amount": 25.32,
        }
    ],
    "authorization_requests": [
        {
            "authorization_request_key": "cccbd9e9-863f-44b5-aa05-f6afa555bb74",
            "authorization_code": "473890",
            "nsu": "123456",
            "acquirer_reference_number": "12312423",
            "merchant_currency_code": "BRL",
            "merchant_amount": 25.32,
            "billing_currency_code": "BRL",
            "billing_amount": 25.32,
            "processing_datetime": "2023-01-10T13:45:52.000Z",
            "number_of_installments": 1,
            "authorization_request_type": "authorization",
            "authorization_request_response": "authorized"
        }
    ],
    "authorization_events": [
        {
            "merchant_currency_code": "BRL",
            "merchant_amount": 25.32,
            "billing_currency_code": "BRL",
            "billing_amount": 25.32,
            "processing_datetime": "2023-07-24T12:00:00.000Z",
            "authorization_event_type": "authorization"
        }
    ]
}
```

### Authorization Object

| Field | Type | Description |
|---|---| ---|
| authorization_key | string | Authorization unique identifier |
| merchant_currency_code | string | The currency used by the merchant - ISO 4217-alpha |
| original_merchant_amount | decimal | Original amount of the transaction in the merchant currency |
| billing_currency_code | string | The cardholder's billing currency - ISO 4217-alpha |
| original_billing_amount | decimal | Original amount in cardholder's billing currency |
| merchant_amount | decimal | Sum of the current authorized amount in the merchant's currency, from all authorization requests |
| iof_amount | decimal | Sum of the IOF amount for international authorizations on cardholder's billing currency |
| billing_amount | decimal | Sum of the current authorized amount in the cardholder's billing currency, from all authorization requests |
| processing_datetime | datetime UTC | Time of the authorization creation |
| captured_amount | decimal | Sum of the total value captured |
| authorization_status | enumerator | Enumerator of **[Authorization Status](#authorization-status)** |
| card | object |**[Object Card](#object-card)** |
| balance_transactions | list of objects |**[Balance Transaction Object](#balance-transaction-object)** |
| authorization_requests | list of objects |**[Authorization Request Object](#authorization-request-object)** |
| authorization_events | list of objects | **[Authorization Event Object](#authorization-event-object)** |

### Card Object

| Field | Type | Description |
|---| ---| ---|
| card_key | string | Card unique identifier|
| account_key | string | Card linked account unique identifier |
| type | string | Card type |
| card_name | string | Card name |
| printed_name | string | Name printed on card |
| status | string | Current card status |
| brand | string | Card network name |
| bin | string | Card BIN |
| last_four_digits | string | Card's last four digits |

### Balance Transaction Object

The `Balance Transaction` object represents any movement in the cardholder's account balance. They can be *debit* transactions (reducing the account balance), or they can be *credit* transactions (increasing the account balance).

| Field | Type | Description |
|---| ---| ---|
| balance_transaction_key | string | Balance transaction unique identifier |
| balance_transaction_type | enumerator | Possible values (*credit*, *debit*) |
| account_key | string | Card linked account unique identifier |
| merchant_currency_code | string | The currency used by the merchant - ISO 4217-alpha |
| merchant_amount | decimal | Amount of the transaction in the merchant currency |
| billing_currency_code | string | The cardholder's billing currency - ISO 4217-alpha |
| billing_amount | decimal | Amount of the transaction in the cardholder's billing currency |
| processing_datetime | datetime | Transaction's processing and creation datetime |
| balance_transaction_status | enumerator | The status of the balance transaction: pending (`pending_transaction_execution`), partially transacted (`partially_transacted`) or transacted (`transacted`) |
| transacted_amount | decimal | Total amount that was successfully debited/credited from cardholder's account balance |

### Authorization Request Object

Detailed in [Authorization Request](https://docs.qitech.com.br/documentation/cards/autorizacao/)

### Authorization Event Object

The `Authorization Event` object represents the events that occur with an Authorization. See [Use Cases](https://docs.qitech.com.br/documentation/manual_pre_pago/casos_uso/).

| Field | Type | Description |
|---| ---| ---|
| merchant_currency_code | string | The currency used by the merchant - ISO 4217-alpha |
| merchant_amount | decimal | Amount of the event in the merchant currency |
| billing_currency_code | string | The cardholder's billing currency - ISO 4217-alpha |
| billing_amount | decimal | mount of the event in the cardholder's billing currency |
| processing_datetime | datetime | Event's processing datetime |
| authorization_event_type | enumerator | **[Authorization Event Types](#authorization-event-types)** |

### Authorization Status

| Status | Description |
|---|---|
| pending | Authorization request was authorized and no capture or reversal events were processed |
| unauthorized | Authorization request was not approved |
| completed | Authorization with at least one captured value (equal to, less than, or greater than the total authorized amount) |
| reversed | Authorization was voided in full or expired without capture |

### Authorization Event Types

| Type | Description |
|---|---|
| authorization | An authorization request was processed |
| incremental_authorization | An incremental authorization request was processed |
| authorization_reversal | An authorization was fully reversed |
| partial_authorization_reversal | An authorization was partially reversed |
| authorization_expiration | The uncaptured amount of an authorization was expired and reversed to the cardholder's account balance |
| capture | An amount was captured for the authorization |
| refund | The captured amount was fully refunded for the authorization |
| partial_refund | The captured amount was partially refunded for the authorization |

---

# List Authorizations

URL: /en/documentation/cards/search/buscar_autorizacoes

## Request

ENDPOINT /prepaid/card/(card_key)/authorizations
METHOD GET
PARAMETERS from_date, to_date, size, page

## QUERY PARAMS

| Field | Type | Description |
|-----------------|---------|---------------------- ------------------------------------|
| `size` | int | Number of records to be returned. Default 10. |
| `page` | int | Page on which the search will be carried out. Default 1. |
| `from_date` | date | Desired period start date |
| `to_date` | date | Desired period end date |

## Response

STATUS 200

Response Body

```json
{
     "pagination": {
         "current_page": 1,
         "rows_per_page": 10,
         "next_page": 2
     },
     "date": [
         {
             "authorization_key": "cccbd9e9-863f-44b5-aa05-f6afa555bb74",
             "merchant_currency_code": "BRL",
             "original_merchant_amount": 25.31,
             "billing_currency_code": "BRL",
             "original_billing_amount": 25.31,
             "merchant_amount": 25.31,
             "iof_amount": 0,
             "billing_amount": 25.31,
             "processing_datetime": "2023-07-24T12:00:00.000Z",
             "captured_amount": 25.31,
             "authorization_status": "completed"
         },
         {
             "authorization_key": "9a7b2586-7070-4543-99eb-989d9165814e",
             "merchant_currency_code": "BRL",
             "original_merchant_amount": 65,
             "billing_currency_code": "BRL",
             "original_billing_amount": 65,
             "merchant_amount": 65,
             "iof_amount": 0,
             "billing_amount": 65,
             "processing_datetime": "2023-07-24T13:00:00.000Z",
             "captured_amount": 65,
             "authorization_status": "completed"
         }
     ]
```

---

# Search card by key

URL: /en/documentation/cards/search/buscar_cartao_by_key

## Request

ENDPOINT /prepaid/card/ CARD_KEY
METHOD GET

### Path params

| Field         | Type   | Description                        | Characters  |
|---------------|--------|------------------------------------|-------------|   
| `CARD_KEY` *  | string | Card identification key            | uuid        |
 

## Response

STATUS 200

Response Body

```json
{
    "card_key": "05fd3654-1f5d-479d-ade5-64239fdf214d",    
    "account_key": "595e08f0-da4e-40f7-8db4-f9a25c829818",
    "program_key": "6b6ebaac-043b-4390-8d62-e8098ec901e9",
    "type": "virtual",
    "card_name": "ecommerce",
    "printed_name": "Aurora Catarina",
    "cvv_rotation_interval_hours": 72,
    "created_at": "2023-02-20T19:28:16Z",
    "updated_at": "2023-02-22T19:28:16Z",
    "status": "active",
    "brand": "visa",
    "last_four_digits": "5695",
    "status_events": [
        {
            "status": "created",
            "created_at": "2023-02-20T19:28:16Z"
        },
        {
            "status": "active",
            "created_at": "2023-02-20T19:35:10Z"
        }
    ]
}
```

### Erros

STATUS 4XX

Response Body

```json
{
  "title": "Not Found",
  "description": "It was not possible to fetch the Card for the card_key f6bf148a-30b6-4a07-8c5b-3383a98ea32b.",
  "translation": "Not Found Card",
  "code": "CARD000011"
}
```

| Code      | Status code  | Description                    |
|:---------:|:------------:|:-------------------------------|
| CARD000011| 404          | It was not possible to fetch the Card for the card_key \{card_key\}.|
| CARD000016| 400          | We're sorry, but the card could not be fetch. Please try again later.|

---

# Search PCI data

URL: /en/documentation/cards/search/buscar_dados_pci

## Request

ENDPOINT /prepaid/card/ CARD_KEY /pci
METHOD GET

### Path params

| Field         | Type   | Description                        | Characters |
|---------------|--------|------------------------------------|------------|   
| `CARD_KEY` *  | string | Card identification key.           | uuid       |

## Response

STATUS 200

Response Body

```json
{
    "printed_name": "Aurora Catarina",
    "valid_until": "2023-02-20T10:04:12Z",
    "expiration_date": "03/24",
    "card_number": "4539347744299311",
    "cvv": "713"
}
```

### Erros

STATUS 4XX

Response Body

```json
{
  "title": "Not Found",
  "description": "It was not possible to fetch the Card for the card_key f6bf148a-30b6-4a07-8c5b-3383a98ea32b.",
  "translation": "Not Found Card",
  "code": "CARD000011"
}
```

| Code      | Status code  | Description                    |
|:---------:|:------------:|:-------------------------------|
| CARD000011| 404          | It was not possible to fetch the Card for the card_key \{card_key\}.|
| CARD000012| 400          | It was not possible to fetch PCI for the card_key \{card_key\}.|

---

# Track card delivery by key

URL: /en/documentation/cards/search/buscar_entrega_by_key

## Request

ENDPOINT /card/ CARD_KEY /tracking
METHOD GET

### Path params

| Field        | Type   | Description                         | Characters |
|--------------|--------|-----------------------------------|------------|
| `CARD_KEY` * | string | Card identification key | uuid       |

## Response

STATUS 200

Response Body

```json
{
  "card_key": "92b4e2bd-4a6f-4c56-859e-17c729e1f0c8",
  "tracking_code": "4F68A72B902317",
  "status": "posted",
  "recipient": "João Silva",
  "address": {
    "zip_code": "1234567",
    "street": "Rua das Flores",
    "number": 123,
    "complement": "Bloco A",
    "neighborhood": "Centro",
    "city": "Cidade Exemplo",
    "state": "SP"
  },
  "event": [
    {
      "created_at": "2024-02-27T08:30:00Z",
      "old_status": "pending",
      "new_status": "posted",
      "description": "Pedido recebido e postado",
      "place": "SAO PAULO"
    }
  ]
}
```

### Enumerator DeliveryStatus

| Enumerator         |
|--------------------|
| pending            |
| posted             |
| prepared           |
| in_transfer        |
| in_delivery_unit   |
| on_route           |
| attempt_failed     |
| awaiting_withdrawal|
| returning          |
| delivered          |
| returned           |
| canceled           |
| failed             |
| resend             |

### Errors

STATUS 4XX

Response Body

```json
{
  "title": "Not Found",
  "description": "It was not possible to fetch the Tracking for the card_key f6bf148a-30b6-4a07-8c5b-3383a98ea32b.",
  "translation": "Not Found",
  "code": "TRACK000011"
}
```

| Code      | Status code  | Description                    |
|:---------:|:------------:|:-------------------------------|
| TRACK000011| 404          | It was not possible to fetch the Tracking for the card_key \{card_key\}.|
| TRACK000016| 400          | We're sorry, but the tracking could not be fetch. Please try again later.|

---

# Retrieve PCI Password

URL: /en/documentation/cards/search/buscar_senha

## Request

ENDPOINT /prepaid/card/ CARD_KEY /pci/password
METHOD GET

### Path params

| Campo        | Tipo   | Descrição                 | Caracteres |
|--------------|--------|---------------------------|------------|   
| `CARD_KEY` * | string | Card identification key.  | uuid       |

## Response

STATUS 200

Response Body

```json
{
    "pin": "1234"
}
```

### Erros

STATUS 4XX

Response Body

```json
{
  "title": "Bad Request",
  "description": "It was not possible to fetch PCI for the card_key f6bf148a-30b6-4a07-8c5b-3383a98ea32b.",
  "translation": "Fetch PCI failed",
  "code": "CARD000012"
}
```

| Code      | Status code  | Descrição                      |
|:---------:|:------------:|:-------------------------------|
| CARD000011| 404          | It was not possible to fetch the Card for the card_key \{card_key\}.|
| CARD000012| 400          | It was not possible to fetch PCI for the card_key \{card_key\}.|

---

# List Cards

URL: /en/documentation/cards/search/listar_cartoes

## Request

ENDPOINT /prepaid/card
METHOD GET
PARÂMETROS account_key, size, page

## QUERY PARAMS

| Field            | Type   | Description                                              | Characters  |
|------------------|--------|----------------------------------------------------------|-------------| 
| `account_key` *  | string | QI Tech Payment Account Identification Key.              | uuid        |
| `size`           | int    | Number of records that will be returned. Default 10.     | -           |
| `page`           | int    | Page that will be searched. Default 0.                   | -           |

## Response

STATUS 200

Response Body

```json
{
    "pagination": {
        "current_page": 1,
        "rows_per_page": 0,
        "next_page": 2
    },
    "data": [
        {
            "card_key": "05fd3654-1f5d-479d-ade5-64239fdf214d",        
            "account_key": "595e08f0-da4e-40f7-8db4-f9a25c829818",
            "program_key": "6b6ebaac-043b-4390-8d62-e8098ec901e9",
            "type": "virtual",
            "card_name": "ecommerce",
            "printed_name": "Aurora Catarina",
            "cvv_rotation_interval_hours": 72,
            "created_at": "2023-02-20T19:28:16Z",
            "updated_at": "2023-02-22T19:28:16Z",
            "status": "active",
            "brand": "visa"
        },
        {
            "card_key": "ee084f00-d72e-4263-87fb-3a3c11a418c6",
            "account_key": "595e08f0-da4e-40f7-8db4-f9a25c829818",
            "program_key": "6b6ebaac-043b-4390-8d62-e8098ec901e9",
            "type": "virtual",
            "card_name": "uber",
            "printed_name": "Aurora Catarina",
            "cvv_rotation_interval_hours": 72,
            "created_at": "2023-02-10T11:28:16Z",
            "updated_at": "2023-02-15T11:28:16Z",
            "status": "canceled",
            "brand": "visa"
        }
    ]
}
```

### Erros

STATUS 4XX

Response Body

```json
{
  "title": "Not Found",
  "description": "It was not possible to fetch the Account for the account_key 94f982c0-164c-45e3-8a0e-69f54ad7b155.",
  "translation": "Not Found Account",
  "code": "CARD000006"
}
```

| Code      | Status code  | Description                    |
|:---------:|:------------:|:-------------------------------|
| CARD000006| 404          | It was not possible to fetch the Account for the account_key \{account_key\}.|
| CARD000021| 400          | Account key can not be null when search for cards.|
| CARD000022| 400          | Invalid integer value for page or size querystring parameters.|

---

# Activate physical card

URL: /en/documentation/cards/status/ativar_cartao

All physical cards need to be activated using an activation code that is sent along with the physical card to the holder.

When receiving the card by mail, the card holder must inform the QI partner so that the partner can activate the card through this endpoint.

:::caution Attention
For security reasons, there is no possibility of consulting the activation code via API on the part of the partner.

This code is sent exclusively to the cardholder at the time of posting the physical card.
:::

## Request

ENDPOINT /prepaid/card/ CARD_KEY /activate
METHOD PATCH

### Path params
| Field        | Type   | Description              | Characters |
|--------------|--------|--------------------------|------------|   
| `CARD_KEY` * | string | Card identification key. | uuid       |

Request Body

```json
{
    "code": "253615"
}
```

  ### Body params
| Field      | Type   | Description                    | Characters |
|------------|--------|--------------------------------|------------|
| `code`  *  | string | Activation code of the card.   | 6          |

### Erros

STATUS 4XX

Response Body

```json
{
  "title": "Not Acceptable",
  "description": "Invalid activation code [1254].",
  "translation": "Unable to activate card",
  "code": "CARD000020"
}
```

| Code      | Status code  | Description                    |
|:---------:|:------------:|:-------------------------------|
| QIT000001 | 400          | Invalid Json schema.|
| CARD000011| 404          | It was not possible to fetch the Card for the card_key \{card_key\}.|
| CARD000017| 406          | The activation operation is not valid for the current card status [\{card_status\}].|
| CARD000018| 400          | We're sorry, but the card could not be activate. Please try again later.|
| CARD000020| 406          | Invalid activation code [\{code\}].|
| CARD000023| 406          | The card type is invalid for this operation. Only plastic cards are allowed.|

### Webhook

WEBHOOK_TYPE baas.prepaid_card.card

Webhook Body

```json
{
    "webhook_type": "baas.prepaid_card.card",
    "event_datetime": "2023-07-25T12:00:00.000Z",
    "data": {
        "card_key": "9bd93e97-bb6d-410f-8981-06b2765f12a1",
        "type": "plastic",
        "status": "active",
        "old_status": "embossing"
    }
}
```

---

# Update status

URL: /en/documentation/cards/status/update_status_cartao

## Request

ENDPOINT /prepaid/card/ CARD_KEY
METHOD PATCH

### Path params
| Field        | Type   | Description              | Characters |
|--------------|--------|--------------------------|------------|   
| `CARD_KEY` * | string | Card identification key. | uuid       |

Request Body

```json
{
    "status": "blocked"
}
```

  ### Body params

| Campo       | Tipo   | Descrição    | Caracteres                                  |
|-------------|--------|--------------|---------------------------------------------|
| `status`  * | string | Card Status. | **[Enumerators](#enumerators-card_status)** |

### Enumerators card_status
| Enumerators | Translation       | Type            |
|-------------|-------------------|-----------------|
| created     | Requested created | Initial         |
| building    | Under construction| Initial         |
| active      | Ready to trade    | Active          |
| embossing   | In production     | Temporary block |
| blocked     | Blocked           | Temporary block |
| warning     | With suspicion    | Temporary block |
| pending     | Pending           | Temporary block |
| lost        | Lost              | Terminated      |
| robbed      | Robbed            | Terminated      |
| fraud       | Fraud             | Terminated      |
| canceled    | Canceled          | Terminated      |
| theft       | Theft             | Terminated      |

### Erros

STATUS 4XX

Response Body

```json
{
  "title": "Not Acceptable",
  "description": "The operation is not valid for the current status of the card [canceled]",
  "translation": "Unable to transition",
  "code": "CARD000014"
}
```

| Code      | Status code  | Description                    |
|:---------:|:------------:|:-------------------------------|
| QIT000001 | 400          | Invalid Json schema.|
| CARD000011| 404          | It was not possible to fetch the Card for the card_key \{card_key\}.|
| CARD000013| 406          | Unable to transition from \{old_status\} to \{new_status\}.|
| CARD000014| 406          | The operation is not valid for the current status of the card [\{card_status\}].|
| CARD000015| 400          | We're sorry, but the card could not be update. Please try again later|

### Webhook

WEBHOOK_TYPE baas.prepaid_card.card

Webhook Body

```json
{
    "webhook_type": "baas.prepaid_card.card",
    "event_datetime": "2023-07-25T12:00:00.000Z",
    "data": {
        "card_key": "9bd93e97-bb6d-410f-8981-06b2765f12a1",
        "type": "virtual",
        "status": "active",
        "old_status": "created"
    }
}
```

---

# Contactless Configuration

URL: /en/documentation/cards/update/contactless_cartao

Enable or disable the contactless payment functionality for in-person use.

To enable or disable the contactless payment feature of the card, the card status must be of type **Active** or **Temporary block**. (For information about the status types, refer to [here](../../cards/status/update_status_cartao#enumerators-card_status))

## Request

ENDPOINT /prepaid/card/ CARD_KEY /contactless
METHOD PATCH

### Path params
| Field        | Type   | Description                | Characters |
|--------------|--------|----------------------------|------------|   
| `CARD_KEY` * | string | Card identification key.   | uuid       |

Request Body

```json
{
    "contactless_enabled": false
}
```

### Body params

| Field                     | Type    | Description                             | Characters |
|---------------------------|---------|-----------------------------------------|------------|
| `contactless_enabled`  *  | Boolean | Indicates whether it is enabled or not. | true/false |

## Response

STATUS SUCCESS 200

### Erros
STATUS 4XX

Response Body

```json
{
  "title": "Bad Request",
  "description": "We're sorry, but the card could not be update contactless. Please try again later.",
  "translation": "Unexpected error update contactless card",
  "code": "CARD000026"
}
```

| Code      | Status code  | Description                      |
|:---------:|:------------:|:-------------------------------|
| QIT000001 | 400          | Invalid Json schema.|
| CARD000011| 404          | It was not possible to fetch the Card for the card_key \{card_key\}.|
| CARD000023| 406          | The card type is invalid for this operation. Only plastic cards are allowed.|
| CARD000026| 400          | We're sorry, but the card could not be update contactless. Please try again later.|
| CARD000025| 406          | The status \{status\} is invalid for the operation.|

### Webhook

WEBHOOK_TYPE baas.prepaid_card.card.updated.contactless

Webhook Body

```json
{
    "webhook_type": "baas.prepaid_card.card.updated.contactless",
    "event_datetime": "2023-07-25T12:00:00.000Z",
    "data": {
        "card_key": "9bd93e97-bb6d-410f-8981-06b2765f12a1",
        "contactless_enabled": true
    }
}
```

---

# Update password

URL: /en/documentation/cards/update/password_cartao

Every physical card has a password to authorize transactions, and it can be updated if necessary.

To update the card's password, the card status must be of type **Active** or **Temporary block**. (For information about status types, refer to [here](../../cards/status/update_status_cartao#enumerators-card_status))

:::caution Caution
For security reasons, be careful when updating a password, as it can impact card authorization.

Create rules to enhance password authorization security, such as avoiding using birthdates or repeated numbers (e.g., 3333).
:::

## Request

ENDPOINT /prepaid/card/ CARD_KEY /password
METHOD PATCH

### Path params
| Field        | Type   | Description                | Characters |
|--------------|--------|----------------------------|------------|   
| `CARD_KEY` * | string | Card identification key.   | uuid       |

Request Body

```json
{
    "pin": "2143"
}
```

  ### Body params

| Field     | Type   | Description                               | Characters |
|-----------|--------|-------------------------------------------|------------|
| `pin`  *  | string | Card password to authorize a transaction. | 4          |

## Response

STATUS SUCCESS 200

### Erros
STATUS 4XX

Response Body

```json
{
  "title": "Bad Request",
  "description": "We're sorry, but the card could not be update password. Please try again later.",
  "translation": "Unexpected error update password card",
  "code": "CARD000024"
}
```

| Code      | Status code  | Description                    |
|:---------:|:------------:|:-------------------------------|
| QIT000001 | 400          | Invalid Json schema.|
| CARD000011| 404          | It was not possible to fetch the Card for the card_key \{card_key\}.|
| CARD000023| 406          | The card type is invalid for this operation. Only plastic cards are allowed.|
| CARD000024| 400          | We're sorry, but the card could not be update password. Please try again later.|
| CARD000025| 406          | The status \{status\} is invalid for the operation.|

### Webhook

WEBHOOK_TYPE baas.prepaid_card.card.updated.password

Webhook Body

```json
{
    "webhook_type": "baas.prepaid_card.card.updated.password",
    "event_datetime": "2023-07-25T12:00:00.000Z",
    "data": {
        "card_key": "9bd93e97-bb6d-410f-8981-06b2765f12a1"
    }
}
```

---

# Update delivery address

URL: /en/documentation/cards/update/update_delivery_address

The delivery address update serves to correct the address in case any inconsistency is found or the delivery fails three times.

## Request

ENDPOINT /account/ ACCOUNT_KEY /card/ CARD_KEY /address
METHOD POST

### Path parameters

| Field                   | Type   | Description                                                  | Characters |
|-------------------------|--------|--------------------------------------------------------------|------------|
| `account_key`           | uuidv4 | Unique account identification key, in uuid v4 format        | 36         |
| `card_key`              | uuidv4 | Unique card identification key, in uuid v4 format           | 36         |

Request Body

```json
{
    "postal_code": "5425020",
    "street": "Rua Gilberto Sabino",
    "number": 215,
    "complement": "4 andar",
    "neighborhood": "Pinheiros",
    "city": "So Paulo",
    "state": "SP",
    "reference": "Terminal Pinheiros",
    "address_type": "commercial",
    "notes": ["obs1", "obs2"],
    "phones": [
        {"country_code": "55", "area_code": "19", "number": "983151110"},
        {"country_code": "55", "area_code": "16", "number": "992334318"},
    ],
}
```

### Request Body

### Address object

| Field                     | Type   | Description                                        | Characters |
|---------------------------|--------|----------------------------------------------------|------------|
| `street` *                | string | Street                                             | 100        |
| `number`                  | string | Number                                             | 10         |
| `neighborhood` *          | string | Neighborhood                                       | 100        |
| `postal_code` *           | string | Postal code                                        | 8          |
| `city` *                  | string | City                                               | 100        |
| `complement`              | string | Complement                                         | 100        |
| `reference`               | string | Reference point                                    | 100        |
| `notes`                   | string array | Notes related to the address               | 100        |
| `phones`                  | object array | Contact phones | **[Phone object](#phone-object)**  |
| `state` *                 | string | State (UF)       | **[State enumerators](#state-enumerators)** |
| `address_type` *          | string | Address type  | **[Address_type enumerators](#address_type-enumerators)** |

:::caution Attention!
The `number` field is optional. Addresses without a street number can be submitted without this field.
:::

:::caution Attention!
Up to two contact phones and four notes can be sent. If there are no contact phones and/or notes, these fields (`phones` and `notes`) should not be sent.
:::

### Phone object

| Field                           | Type   | Description                                      | Characters |
|---------------------------------|--------|--------------------------------------------------|------------|
| `international_dial_code` *     | string | IDD code (International Direct Dialing)         | 2          |
| `area_code` *                   | string | DDD code (Direct Distance Dialing)              | 2          |
| `number` *                      | string | Complement                                       | 9          |

### Address_type enumerators

| Enumerator         | Description              |
|--------------------|--------------------------|
| residential        | residential address      |
| commercial         | commercial address       |
| other              | other types of address   |

### State enumerators

| Enumerator         | Description           |
|--------------------|-----------------------|
| AC                 | Acre                  |
| AL                 | Alagoas               |
| AM                 | Amazonas              |
| AP                 | Amapá                 |
| BA                 | Bahia                 |
| CE                 | Ceará                 |
| DF                 | Distrito federal      |
| ES                 | Espírito Santo        |
| GO                 | Goiás                 |
| MA                 | Maranhão              |
| MG                 | Minas Gerais          |
| MS                 | Mato Grosso do Sul    |
| MT                 | Mato Grosso           |
| PA                 | Pará                  |
| PB                 | Paraíba               |
| PE                 | Pernambuco            |
| PI                 | Piauí                 |
| PR                 | Paraná                |
| RJ                 | Rio de Janeiro        |
| RN                 | Rio Grande do Norte   |
| RO                 | Rondônia              |
| RR                 | Roraima               |
| RS                 | Rio Grande do Sul     |
| SC                 | Santa Catarina        |
| SE                 | Sergipe               |
| SP                 | São Paulo             |
| TO                 | Tocantins             |
| EX                 | Exception             |

## Response

STATUS 200

Response Body

```json
{
  "card_key": "1e3183f0-1bac-4e59-81e8-2d89db224040",
  "tracking_code": "FD89B071241022",
  "address": {
    "city": "So Paulo",
    "notes": [
      "obs1",
      "obs2"
    ],
    "state": "SP",
    "number": 215,
    "phones": [
      {
        "number": "983151110",
        "area_code": "19",
        "country_code": "55"
      },
      {
        "number": "992334318",
        "area_code": "16",
        "country_code": "55"
      }
    ],
    "street": "Rua Gilberto Sabino",
    "reference": "Terminal Pinheiros",
    "complement": "4 andar",
    "postal_code": "5425020",
    "address_type": "commercial",
    "neighborhood": "Pinheiros"
  }
}

```

### Response Body Params

| Field                   | Type   | Description                                                                                     | Characters |
|-------------------------|--------|-------------------------------------------------------------------------------------------------|------------|
| `card_key` *            | uuidv4 | Unique card identification key, in uuid v4 format                                              | 36         |
| `tracking_code` *       | string | Card delivery tracking code                                                                     | 14         |
| `address`               | object | Object of type `address`, similar to what is sent in the request | **[Address object](#address-object)**  |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 403                      | QIT000005            | Permission Validator Error               | Selected agent and person_key are different | Agente selecionado e person_key são diferentes |
| 400                      | TRACK000004          | Bad Request                 | Invalid status to change delivery address. | Status inválido para mudar o endereço de entrega. |
| 500                      | TRACK000007          | Internal Server Error      | Failed to update delivery address at delivery service provider. Please, try again later!   | Falha ao atualizar endereço de entrega junto à provedora de serviços de delivery. Por favor, tente novamente mais tarde! |
| 404                      | TRACK000012          | Not Found                                 | Tracking not found for the given 'card_key'. | Rastreio não encontrado para a 'card_key' fornecida. |

---

# Contactless configuration

URL: /en/documentation/cartao_pos_pago/cartao/atualizar/atualizar_contactless

Enable or disable contactless payment functionality for in-person use.

To enable or disable contactless payment for the card, the card status must be **Active** or **Temporary block**. (For information about status types, see [here](../../credit_cards/status/atualiar_status_cartao#enumeradores-card_status))

## Request

ENDPOINT /wallet/ WALLET_KEY /card/ CARD_KEY /contactless
METHOD PATCH

### Path params
| Field        | Type   | Description                         | Characters |
|--------------|--------|-------------------------------------|------------|
| `WALLET_KEY` * | string | Wallet identification key. | uuid       |    
| `CARD_KEY` * | string | Card identification key. | uuid       |

Request Body

```json
{
    "contactless_enabled": false
}
```

### Body params

| Field                     | Type    | Description                         | Characters |
|---------------------------|---------|-------------------------------------|------------|
| `contactless_enabled`  *  | Boolean | Indicates whether it is enabled or not. | true/false |

## Response

STATUS SUCCESS 200

Response Body

```json
{
    "card_key": "05fd3654-1f5d-479d-ade5-64239fdf214d",
    "status": "active",
    "account_key": "3571e292-3a83-4011-904d-20ee963022ef",
    "program_key": "6b6ebaac-043b-4390-8d62-e8098ec901e9",
    "type": "virtual",
    "card_name": "ecommerce",
    "printed_name": "Aurora Catarina",
    "brand": "visa",
    "last_four_digits": "5695",
    "created_at": "2023-02-20T19:28:16Z",
    "updated_at": "2023-02-22T19:28:16Z",
    "cvv_rotation_interval_hours": 72
}
```

### Errors

STATUS 4XX

Response Body

```json
{
  "title": "Bad Request",
  "description": "We're sorry, but the card could not be update contactless. Please try again later.",
  "translation": "Unexpected error update contactless card",
  "code": "CARD000026"
}
```

| Code      | Status code  | Description                      |
|:---------:|:------------:|:-------------------------------|
| QIT000001 | 400          | Invalid Json schema.|
| CARD000011| 404          | It was not possible to fetch the Card for the card_key \{card_key\}.|
| CARD000023| 406          | The card type is invalid for this operation. Only plastic cards are allowed.|
| CARD000026| 400          | We're sorry, but the card could not be update contactless. Please try again later.|
| CARD000025| 406          | The status \{status\} is invalid for the operation.|

---

# Update delivery address

URL: /en/documentation/cartao_pos_pago/cartao/atualizar/atualizar_endereco_entrega

The delivery address update is used to correct the address if any inconsistency is found or if delivery fails three times.

## Request

ENDPOINT /wallet/ WALLET_KEY /card/ CARD_KEY /address
METHOD PATCH

### Path params
| Field        | Type   | Description                         | Characters |
|--------------|--------|-----------------------------------|------------|
| `WALLET_KEY` * | string | Wallet identification key. | uuid       |    
| `CARD_KEY` * | string | Card identification key. | uuid       |

Request Body

```json
{
    "postal_code": "5425020",
    "street": "Rua Gilberto Sabino",
    "number": 215,
    "complement": "4 andar",
    "neighborhood": "Pinheiros",
    "city": "So Paulo",
    "state": "SP",
    "reference": "Terminal Pinheiros",
    "address_type": "commercial",
    "notes": ["obs1", "obs2"],
    "phones": [
        {"country_code": "55", "area_code": "19", "number": "983151110"},
        {"country_code": "55", "area_code": "16", "number": "992334318"},
    ],
}
```

### Request Body

### address object

| Field                     | Type   | Description                                          | Characters |
|---------------------------|--------|----------------------------------------------------|------------|
| `street` *                | string | Street address                                         | 100        |
| `number` *                | string | Number                                             | 10         |
| `neighborhood` *          | string | Neighborhood                                             | 100        |
| `postal_code` *           | string | Postal code                                                | 8          |
| `city` *                  | string | City                                             | 100        |
| `complement`              | string | Complement                                        | 100        |
| `reference`               | string | Reference point                                | 100        |
| `notes`                   | string array | Address-related notes         | 100        |
| `phones`                  | object array | Contact phones | **[phone object](#phone-object)**  |
| `state` *                 | string | State (UF)       | **[state enumerators](#state-enumerators)** |
| `address_type` *          | string | Address type  | **[address_type enumerators](#address_type-enumerators)** |

:::caution Attention!
Up to two contact phones and four notes can be sent. If there are no contact phones and/or notes, these fields (`phones` and `notes`) should not be sent.
:::

### phone object

| Field                           | Type   | Description                                    | Characters |
|---------------------------------|--------|----------------------------------------------|------------|
| `international_dial_code` *     | string | International dial code (DDI)   | 2          |
| `area_code` *                   | string | Area code (DDD)     | 2          |
| `number` *                      | string | Complement                                  | 9          |

### address_type enumerators

| Enumerator         | Description                |
|--------------------|--------------------------|
| residential        | residential address     |
| commercial         | commercial address       |
| other              | other address types |

### state enumerators

| Enumerator         | Description             |
|--------------------|-----------------------|
| AC                 | Acre                  |
| AL                 | Alagoas               |
| AM                 | Amazonas              |
| AP                 | Amapá                 |
| BA                 | Bahia                 |
| CE                 | Ceará                 |
| DF                 | Distrito federal      |
| ES                 | Espírito Santo        |
| GO                 | Goiás                 |
| MA                 | Maranhão              |
| MG                 | Minas Gerais          |
| MS                 | Mato Grosso do Sul    |
| MT                 | Mato Grosso           |
| PA                 | Pará                  |
| PB                 | Paraíba               |
| PE                 | Pernambuco            |
| PI                 | Piauí                 |
| PR                 | Paraná                |
| RJ                 | Rio de Janeiro        |
| RN                 | Rio Grande do Norte   |
| RO                 | Rondônia              |
| RR                 | Roraima               |
| RS                 | Rio Grande do Sul     |
| SC                 | Santa Catarina        |
| SE                 | Sergipe               |
| SP                 | São Paulo             |
| TO                 | Tocantins             |
| EX                 | Exception               |

## Response

STATUS 200

Response Body

```json
{
  "card_key": "1e3183f0-1bac-4e59-81e8-2d89db224040",
  "tracking_code": "FD89B071241022",
  "address": {
    "city": "So Paulo",
    "notes": [
      "obs1",
      "obs2"
    ],
    "state": "SP",
    "number": 215,
    "phones": [
      {
        "number": "983151110",
        "area_code": "19",
        "country_code": "55"
      },
      {
        "number": "992334318",
        "area_code": "16",
        "country_code": "55"
      }
    ],
    "street": "Rua Gilberto Sabino",
    "reference": "Terminal Pinheiros",
    "complement": "4 andar",
    "postal_code": "5425020",
    "address_type": "commercial",
    "neighborhood": "Pinheiros"
  }
}

```

### Response Body Params

| Field                   | Type   | Description                                                                                       | Characters |
|-------------------------|--------|-------------------------------------------------------------------------------------------------|------------|
| `card_key` *            | uuidv4 | Unique card identification key, in uuid v4 format                                      | 36         |
| `tracking_code` *       | string | Card delivery tracking code                                                         | 14         |
| `address`               | object | Object of type `address`, similar to what is sent in the request | **[address object](#address-object)**  |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 403                      | QIT000005            | Permission Validator Error               | Selected agent and person_key are different | Agente selecionado e person_key são diferentes |
| 400                      | TRACK000004          | Bad Request                 | Invalid status to change delivery address. | Status inválido para mudar o endereço de entrega. |
| 500                      | TRACK000007          | Internal Server Error      | Failed to update delivery address at delivery service provider. Please, try again later!   | Falha ao atualizar endereço de entrega junto à provedora de serviços de delivery. Por favor, tente novamente mais tarde! |
| 404                      | TRACK000012          | Not Found                                 | Tracking not found for the given 'card_key'. | Rastreio não encontrado para a 'card_key' fornecida. |

---

# Change physical card password

URL: /en/documentation/cartao_pos_pago/cartao/atualizar/atualizar_senha

Every physical card has a password to authorize transactions, and it can be updated when necessary.

To update the card password, the status must be **Active** or **Temporary block**. (To learn about status, check [here](../../credit_cards/status/atualiar_status_cartao#enumeradores-card_status))

:::caution Attention
For security reasons, be careful when updating a password, as it can impact card authorization.

Create rules to improve password authorization security, such as not using birth dates, repeated numbers (e.g., 3333).
:::

## Request

ENDPOINT /wallet/ WALLET_KEY /card/ CARD_KEY /password
METHOD PATCH

### Path params
| Field        | Type   | Description                         | Characters |
|--------------|--------|-----------------------------------|------------| 
| `WALLET_KEY` * | string | Wallet identification key. | uuid       |   
| `CARD_KEY` * | string | Card identification key. | uuid       |

Request Body

```json
{
    "pin": "2143"
}
```

  ### Body params

| Field     | Type   | Description                                     | Characters |
|-----------|--------|-----------------------------------------------|------------|
| `pin`  *  | string | Card password to authorize a transaction. | 4          |

## Response

STATUS SUCCESS 200

Response Body

```json
{
    "card_key": "05fd3654-1f5d-479d-ade5-64239fdf214d",
    "status": "active",
    "account_key": "3571e292-3a83-4011-904d-20ee963022ef",
    "program_key": "6b6ebaac-043b-4390-8d62-e8098ec901e9",
    "type": "virtual",
    "card_name": "ecommerce",
    "printed_name": "Aurora Catarina",
    "brand": "visa",
    "last_four_digits": "5695",
    "created_at": "2023-02-20T19:28:16Z",
    "updated_at": "2023-02-22T19:28:16Z",
    "cvv_rotation_interval_hours": 72
}
```

### Errors

STATUS 4XX

Response Body

```json
{
  "title": "Bad Request",
  "description": "We're sorry, but the card could not be update password. Please try again later.",
  "translation": "Unexpected error update password card",
  "code": "CARD000024"
}
```

| Code    | Status code  | Description                      |
|:---------:|:------------:|:-------------------------------|
| QIT000001 | 400          | Invalid Json schema.|
| CARD000011| 404          | It was not possible to fetch the Card for the card_key \{card_key\}.|
| CARD000023| 406          | The card type is invalid for this operation. Only plastic cards are allowed.|
| CARD000024| 400          | We're sorry, but the card could not be update password. Please try again later.|
| CARD000025| 406          | The status \{status\} is invalid for the operation.|

---

# Scenario simulation

URL: /en/documentation/cartao_pos_pago/cartao/atualizar/simulacao_de_cenarios

This page describes how to simulate postpaid card tracking status updates to test delivery update flows. These simulations are useful for homologation and integration testing.

:::info Information

These requests simulate tracking status updates and return the HTTP status with updated tracking data.

:::

## 1 - Tracking status update simulation

Simulates the tracking status update of a postpaid card, allowing transitions between different states of the delivery process. The update creates a new event in the tracking history.

ENDPOINT /mock/wallet/ WALLET_KEY /card/ CARD_KEY /tracking

METHOD PATCH

### Path Parameters

| Field                        | Type   | Description                                  | Characters |
|------------------------------|--------|----------------------------------------------|------------|
| `wallet_key` *               | string | Unique wallet key in UUID v4 format         | 36         |
| `card_key` *                 | string | Unique card key in UUID v4 format           | 36         |

Request Body

```json
{
  "status": "posted",
  "place": "São Paulo - SP",
  "description": "Postado - logística iniciada",
  "reason": "Processamento concluído"
}
```

### Request Body Object

| Field                                    | Type    | Description                                                                        | Max. Chars. |
|------------------------------------------|---------|------------------------------------------------------------------------------------|--------------|
| `status` *                               | string  | New tracking status                                                                | **[Status enumerators](#status-enumerators)** |
| `place` *                                | string  | Location where the event occurred                                                  | 100          |
| `description` *                          | string  | Tracking event description                                                         | 255          |
| `reason`                                 | string  | Additional reason for the event (optional)                                        | 100          |

### Status enumerators

| Enumerator                  | Description                                                                       |
|-----------------------------|-----------------------------------------------------------------------------------|
| `pending`                   | Pending - awaiting initial processing                                            |
| `posted`                    | Posted - logistics initiated                                                      |
| `prepared`                  | Prepared - card prepared for transfer                                             |
| `in_transfer`               | In transfer - card in transit                                                     |
| `in_delivery_unit`          | At delivery unit - card arrived at distribution unit                             |
| `on_route`                  | On route - card out for delivery                                                  |
| `attempt_failed`            | Attempt failed - delivery attempt was not successful                             |
| `awaiting_withdrawal`       | Awaiting withdrawal - card available for pickup                                   |
| `returning`                 | Returning - card in return process                                                |
| `delivered`                 | Delivered - card was successfully delivered                                       |
| `returned`                  | Returned - card was returned                                                      |
| `canceled`                  | Canceled - tracking was canceled                                                  |
| `failed`                    | Failed - delivery process failure                                                 |
| `resend`                    | Resend - card will be resent                                                     |
| `redispatch_error`          | Redispatch error - error when redispatching the card                             |
| `waiting_for_address_update`| Waiting for address update - awaiting address confirmation                       |

### Response

STATUS 204

Response Body

```json
{}
```

:::tip Behavior
- The simulation updates the tracking status and creates a new event in the history
- Status transitions follow a specific order and validations are applied:
  - Cannot go back to previous statuses (except special statuses)
  - Cannot change status from final statuses (`delivered`, `returned`, `canceled`, `failed`)
  - Cannot transition from `waiting_for_address_update` to any status other than `pending`
  - Cannot transition to `waiting_for_address_update` from final statuses
  - Special statuses (`attempt_failed`, `resend`, `redispatch_error`) can be used at any time after the initial status
- The `reason` field is optional and, when provided, is concatenated to the event description
:::

---

# Search card by key

URL: /en/documentation/cartao_pos_pago/cartao/busca/buscar_cartao_por_chave

## Request

ENDPOINT /wallet/ WALLET_KEY /card/ CARD_KEY
METHOD GET

### Path params

| Field        | Type   | Description                         | Characters |
|--------------|--------|-------------------------------------|------------| 
| `WALLET_KEY` * | string | Wallet identification key. | uuid       |    
| `CARD_KEY` * | string | Card identification key. | uuid       |
 

## Response

STATUS 200

Response Body

```json
{
    "card_key": "05fd3654-1f5d-479d-ade5-64239fdf214d",
    "status": "active",
    "account_key": "3571e292-3a83-4011-904d-20ee963022ef",
    "program_key": "6b6ebaac-043b-4390-8d62-e8098ec901e9",
    "type": "virtual",
    "card_name": "ecommerce",
    "printed_name": "Aurora Catarina",
    "brand": "visa",
    "last_four_digits": "5695",
    "created_at": "2023-02-20T19:28:16Z",
    "updated_at": "2023-02-22T19:28:16Z",
    "cvv_rotation_interval_hours": 72
}
```

### Errors

STATUS 4XX

Response Body

```json
{
  "title": "Not Found",
  "description": "It was not possible to fetch the Card for the card_key f6bf148a-30b6-4a07-8c5b-3383a98ea32b.",
  "translation": "Not Found Card",
  "code": "CARD000011"
}
```

| Code      | Status code  | Description                      |
|:---------:|:------------:|:-------------------------------|
| CARD000011| 404          | It was not possible to fetch the Card for the card_key \{card_key\}.|
| CARD000016| 400          | We're sorry, but the card could not be fetch. Please try again later.|

---

# Search delivery by card key

URL: /en/documentation/cartao_pos_pago/cartao/busca/buscar_dados_entrega_por_chave

## Request

ENDPOINT /wallet/ WALLET_KEY /card/ CARD_KEY /tracking
METHOD GET

### Path params
| Field        | Type   | Description                         | Characters |
|--------------|--------|-------------------------------------|------------|
| `WALLET_KEY` * | string | Wallet identification key. | uuid       |    
| `CARD_KEY` * | string | Card identification key. | uuid       |

## Response

STATUS 200

Response Body

```json
{
  "card_key": "92b4e2bd-4a6f-4c56-859e-17c729e1f0c8",
  "tracking_code": "4F68A72B902317",
  "status": "posted",
  "recipient": "João Silva",
  "address": {
    "zip_code": "1234567",
    "street": "Rua das Flores",
    "number": 123,
    "complement": "Bloco A",
    "neighborhood": "Centro",
    "city": "Cidade Exemplo",
    "state": "SP"
  },
  "event": [
    {
      "created_at": "2024-02-27T08:30:00Z",
      "old_status": "pending",
      "new_status": "posted",
      "description": "Pedido recebido e postado",
      "place": "SAO PAULO"
    }
  ]
}
```

### DeliveryStatus Enumerators

| Enumerator         | Translation         |
|--------------------|---------------------|
| pending            | Pending             |
| posted             | Posted              |
| prepared           | Prepared            |
| in_transfer        | In transfer         |
| in_delivery_unit   | In delivery unit    |
| on_route           | On route            |
| attempt_failed     | Attempt failed      |
| awaiting_withdrawal| Awaiting withdrawal |
| returning          | Returning           |
| delivered          | Delivered           |
| returned           | Returned            |
| canceled           | Canceled            |
| failed             | Failed              |
| resend             | Resent              |

### Errors

STATUS 4XX

Response Body

```json
{
  "title": "Not Found",
  "description": "It was not possible to fetch the Tracking for the card_key f6bf148a-30b6-4a07-8c5b-3383a98ea32b.",
  "translation": "Not Found",
  "code": "TRACK000011"
}
```

| Code      | Status code  | Description                        |
|:---------:|:------------:|:-----------------------------------|
| TRACK000011| 404          | It was not possible to fetch the Tracking for the card_key \{card_key\}.|
| TRACK000016| 400          | We're sorry, but the tracking could not be fetch. Please try again later.|

---

# Retrieve PCI data

URL: /en/documentation/cartao_pos_pago/cartao/busca/buscar_dados_pci

## Request

ENDPOINT /wallet/ WALLET_KEY /card/ CARD_KEY /pci
METHOD GET

### Path params

| Field        | Type   | Description                         | Characters |
|--------------|--------|-------------------------------------|------------|  
| `WALLET_KEY` * | string | Wallet identification key. | uuid       |   
| `CARD_KEY` * | string | Card identification key. | uuid       |

## Response

STATUS 200

Response Body

```json
{
    "printed_name": "Aurora Catarina",
    "valid_until": "2023-02-20T10:04:12Z",
    "expiration_date": "03/24",
    "card_number": "4539347744299311",
    "cvv": "713"
}
```

### Errors

STATUS 4XX

Response Body

```json
{
  "title": "Not Found",
  "description": "It was not possible to fetch the Card for the card_key f6bf148a-30b6-4a07-8c5b-3383a98ea32b.",
  "translation": "Not Found Card",
  "code": "CARD000011"
}
```

| Code      | Status code  | Description                      |
|:---------:|:------------:|:-------------------------------|
| CARD000011| 404          | It was not possible to fetch the Card for the card_key \{card_key\}.|
| CARD000012| 400          | It was not possible to fetch PCI for the card_key \{card_key\}.|

---

# Fetch PCI Password

URL: /en/documentation/cartao_pos_pago/cartao/busca/buscar_senha

## Request

ENDPOINT /wallet/ WALLET_KEY /card/ CARD_KEY /pci/password
METHOD GET

### Path params

| Field        | Type   | Description                         | Characters |
|--------------|--------|-----------------------------------|------------| 
| `WALLET_KEY` * | string | Wallet identification key. | uuid       |    
| `CARD_KEY` * | string | Card identification key. | uuid       |

## Response

STATUS 200

Response Body

```json
{
    "pin": "1234"
}
```

### Errors

STATUS 4XX

Response Body

```json
{
  "title": "Bad Request",
  "description": "It was not possible to fetch PCI for the card_key f6bf148a-30b6-4a07-8c5b-3383a98ea32b.",
  "translation": "Fetch PCI failed",
  "code": "CARD000012"
}
```

| Code      | Status code  | Description                      |
|:---------:|:------------:|:-------------------------------|
| CARD000011| 404          | It was not possible to fetch the Card for the card_key \{card_key\}.|
| CARD000012| 400          | It was not possible to fetch PCI for the card_key \{card_key\}.|

---

# Activate physical card

URL: /en/documentation/cartao_pos_pago/cartao/status/ativar_cartao

Every physical card needs to be activated through an activation code that is sent along with the physical card to the cardholder.

When receiving the card by mail, the cardholder needs to inform the QI partner, so that the partner can activate the card through this endpoint.

:::caution Warning
For security reasons, there is no possibility for the partner to query the activation code via API.

This code is sent exclusively to the cardholder at the time of posting the physical card.

To perform integration tests, this code is returned in sandbox environment when querying a card.
:::

## Request

ENDPOINT /wallet/ WALLET_KEY /card/ CARD_KEY /activate
METHOD PATCH

### Path params
| Field        | Type   | Description                         | Characters |
|--------------|--------|-------------------------------------|------------| 
| `WALLET_KEY` * | string | Wallet identification key. | uuid       |  
| `CARD_KEY` * | string | Card identification key. | uuid       |

Request Body

```json
{
    "code": "253615"
}
```

  ### Body params

| Field     | Type   | Description                     | Characters |
|-----------|--------|---------------------------------|------------|
| `code`  * | string | Card activation code. | 6          |

## Response

STATUS 200

Response Body

```json
{
    "card_key": "05fd3654-1f5d-479d-ade5-64239fdf214d",
    "status": "active",
    "account_key": "3571e292-3a83-4011-904d-20ee963022ef",
    "program_key": "6b6ebaac-043b-4390-8d62-e8098ec901e9",
    "type": "virtual",
    "card_name": "ecommerce",
    "printed_name": "Aurora Catarina",
    "brand": "visa",
    "last_four_digits": "5695",
    "created_at": "2023-02-20T19:28:16Z",
    "updated_at": "2023-02-22T19:28:16Z",
    "cvv_rotation_interval_hours": 72
}
```

### Errors

STATUS 4XX

Response Body

```json
{
  "title": "Not Acceptable",
  "description": "Invalid activation code [1254].",
  "translation": "Unable to activate card",
  "code": "CARD000020"
}
```

| Code      | Status code  | Description                    |
|:---------:|:------------:|:-------------------------------|
| QIT000001 | 400          | Invalid Json schema.|
| CARD000011| 404          | It was not possible to fetch the Card for the card_key \{card_key\}.|
| CARD000017| 406          | The activation operation is not valid for the current card status [\{card_status\}].|
| CARD000018| 400          | We're sorry, but the card could not be activate. Please try again later.|
| CARD000020| 406          | Invalid activation code [\{code\}].|
| CARD000023| 406          | The card type is invalid for this operation. Only plastic cards are allowed.|

---

# Update status

URL: /en/documentation/cartao_pos_pago/cartao/status/atualizar_status_cartao

## Request

ENDPOINT /wallet/ WALLET_KEY /card/ CARD_KEY
METHOD PATCH

### Path params

| Field        | Type   | Description                       | Characters |
|--------------|--------|-----------------------------------|------------| 
| `WALLET_KEY` * | string | Wallet identification key. | uuid       |   
| `CARD_KEY` * | string | Card identification key. | uuid       |

Request Body

```json
{
    "status": "blocked"
}
```

  ### Body params

| Field       | Type   | Description       | Characters                                    |
|-------------|--------|-------------------|-----------------------------------------------|
| `status`  * | string | Card status. | **[Enumerators](#enumerators-card_status)** |

### Enumerators card_status
| Enumerator | Translation         | Type            |
|------------|---------------------|-----------------|
| created    | Creation requested  | Initial         |
| building   | Under construction  | Initial         |
| active     | Ready to transact   | Active          |
| embossing  | In production       | Temporary block |
| blocked    | Blocked             | Temporary block |
| warning    | Under suspicion     | Temporary block |
| pending    | Pending             | Temporary block |
| lost       | Lost                | Terminated      |
| robbed     | Robbed              | Terminated      |
| fraud      | Fraudulent          | Terminated      |
| canceled   | Canceled            | Terminated      |
| theft      | Stolen              | Terminated      |

### Errors

STATUS 4XX

Response Body

```json
{
  "title": "Not Acceptable",
  "description": "The operation is not valid for the current status of the card [canceled]",
  "translation": "Unable to transition",
  "code": "CARD000014"
}
```

| Code      | Status code  | Description                        |
|:---------:|:------------:|:-----------------------------------|
| QIT000001 | 400          | Invalid Json schema.|
| CARD000011| 404          | It was not possible to fetch the Card for the card_key \{card_key\}.|
| CARD000013| 406          | Unable to transition from \{old_status\} to \{new_status\}.|
| CARD000014| 406          | The operation is not valid for the current status of the card [\{card_status\}].|
| CARD000015| 400          | We're sorry, but the card could not be update. Please try again later|

### Webhook

WEBHOOK_TYPE baas.pospaid_card.card

Webhook Body

```json
{
    "webhook_type": "baas.pospaid_card.card",
    "event_datetime": "2023-07-25T12:00:00.000Z",
    "data": {
        "card_key": "9bd93e97-bb6d-410f-8981-06b2765f12a1",
        "type": "virtual",
        "status": "active",
        "old_status": "created"
    }
}
```

---

# Wallet Limit Update

URL: /en/documentation/cartao_pos_pago/faturas/carteira/alteracao_de_limite

The wallet limit update allows changing the postpaid credit limit value of an existing wallet.

## Request

ENDPOINT /wallet/ WALLET_KEY /wallet_limit/ WALLET_LIMIT_KEY
METHOD PATCH

### Path Parameters

| Field                        | Type   | Description                                  | Characters |
|------------------------------|--------|----------------------------------------------|------------|
| `wallet_key` *               | uuidv4 | Unique wallet key in UUID v4 format         | 36         |
| `wallet_limit_key` *         | uuidv4 | Unique wallet limit key in UUID v4 format   | 36         |

Request Body

```json
{
  "limit_amount": 10000.00
}
```

### Request Body Params

| Field                        | Type    | Description                                                                        | Characters |
|------------------------------|---------|------------------------------------------------------------------------------------|------------|
| `limit_amount` *             | float   | New postpaid credit limit amount                                                   | -          |

:::info Note
- The new limit value must be greater than or equal to the used limit (`used_limit`)
- Only limits of type `postpaid_credit_limit` can be updated
- Only wallets of type `default` can have their limits updated
- Updating the limit also updates the limit in the card service
:::

## Response

STATUS 200

Response Body: Updated wallet limit

```json
{
  "wallet_limit_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "limit_type": "postpaid_credit_limit",
  "limit_amount": 10000.00,
  "used_limit": 2500.00
}
```

### Response Body Params

| Field                            | Type    | Description                                                                        | Characters |
|----------------------------------|---------|------------------------------------------------------------------------------------|------------|
| `wallet_limit_key` *             | uuidv4  | Unique identification key of the updated limit in UUID v4 format                  | 36         |
| `limit_type` *                   | string  | Type of the updated limit                                                          | **[limit_type Enumerators](#limit_type-enumerators)** |
| `limit_amount` *                 | float   | New postpaid credit limit amount after update                                     | -          |
| `used_limit` *                   | float   | Used limit amount at the time of update                                           | -          |

### limit_type Enumerators

| Enumerator              | Description                             |
|-------------------------|-----------------------------------------|
| postpaid_credit_limit   | Postpaid credit limit                   |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                  | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|------------------------|--------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                    | CIN000110          | Bad Request                                        | New limit amount is less than used limit                                                                                 | Novo valor do limite é menor que o valor utilizado                                                                     |
| 400                    | CIN000111          | Bad Request                                        | Error while updating postpaid wallet limit in card service, try again in a few minutes.                                  | Erro ao atualizar limite de carteira pós-pago no serviço de cartão, tente novamente em alguns minutos.                |
| 400                    | CIN000112          | Bad Request                                        | Requester postpaid limit exceeded for this client                                                                        | Limite das carteiras pós-pagas do cliente excedido                                                                     |
| 403                    | CIN000108          | Forbidden                                          | Wallet type payroll is not allowed for this operation                                                              | Tipo de carteira payroll não é permitido para esta operação                                                       |
| 403                    | CIN000109          | Forbidden                                          | Wallet limit type payroll_withdraw_limit is not allowed for this operation                                                  | Tipo de limite de carteira payroll_withdraw_limit não é permitido para esta operação                                       |
| 404                    | CIN000007          | Wallet not Found                                   | Wallet with key: e91d68d4-2904-4f9d-a6ef-50c82c34531e was not found                                                                              | Carteira com a chave: e91d68d4-2904-4f9d-a6ef-50c82c34531e não foi encontrado                                                                 |
| 404                    | CIN000107          | Not Found                                          | Wallet limit not found                                                                                                    | Limite de carteira não foi encontrado                                                                                   |

---

# Search Wallet Entry by Key

URL: /en/documentation/cartao_pos_pago/faturas/carteira/consulta_entrada_por_chave

Searching for a wallet entry by key will return the complete details of a specific entry, including all related invoice items.

## Request

ENDPOINT /wallet/ WALLET_KEY /wallet_entry/ WALLET_ENTRY_KEY
METHOD GET

### Path Parameters

| Field             | Type   | Description                                      | Characters |
|-------------------|--------|--------------------------------------------------|------------|
| `wallet_key`      | uuidv4 | Unique wallet key in UUID v4 format             | 36         |
| `wallet_entry_key`| uuidv4 | Unique entry key in UUID v4 format              | 36         |

## Response

STATUS 200

Response Body: Wallet entry details

```json
{
  "wallet_entry_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "wallet_entry_amount": 150.00,
  "wallet_entry_settlement_key": "cc8fb19b-d1e4-4ce6-ad4c-61e0609a8f8d",
  "wallet_entry_type": "revolving_credit",
  "wallet_entry_status": "concluded",
  "invoice_items": [
    {
      "invoice_item_key": "3571e292-3a83-4011-904d-20ee963022ef",
      "invoice_key": "f2cad6b4-2a68-9572-99a7-2849c8d6ecf8",
      "wallet_entry_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "payment_instrument_entry_key": null,
      "installment_number": 1,
      "invoice_description": "Crédito rotativo - Taxa de juros",
      "amount": 150.00,
      "used_limit": 150.00,
      "invoice_item_status": "concluded",
      "invoice_item_due_date": "2024-02-15",
      "created_at": "2024-01-15T10:30:00Z"
    }
  ],
  "created_at": "2024-01-15T10:30:00Z"
}
```

### Response Body Params

| Field                        | Type         | Description                           | Characters                                  |
|------------------------------|--------------|---------------------------------------|---------------------------------------------|
| `wallet_entry_key` *         | uuidv4       | Unique entry identification key in uuid v4 format | 36         |
| `wallet_entry_amount` *      | float  | Entry amount                                                                      | -          |
| `wallet_entry_settlement_key` * | string    | Entry settlement key                  | -          |
| `wallet_entry_type` *        | string       | Wallet entry type                     | **[wallet_entry_type enumerators](#wallet_entry_type-enumerators)** |
| `wallet_entry_status` *      | string       | Wallet entry status                    | **[wallet_entry_status enumerators](#wallet_entry_status-enumerators)** |
| `invoice_items` *            | object array | Related invoice items                 | **[invoice_item object](#invoice_item-object)** |
| `created_at` *               | string       | Creation date (ISO 8601 UTC format)  | -          |

### invoice_item object

| Field                              | Type    | Description                                                                       | Characters |
|------------------------------------|---------|-----------------------------------------------------------------------------------|------------|
| `invoice_item_key` *               | uuidv4  | Unique invoice item identification key in uuid v4 format                         | 36         |
| `invoice_key` *                    | uuidv4  | Unique invoice identification key in uuid v4 format                              | 36         |
| `wallet_entry_key`                 | uuidv4  | Unique wallet entry identification key in uuid v4 format                        | 36         |
| `payment_instrument_entry_key`     | uuidv4  | Unique payment instrument entry identification key in uuid v4 format            | 36 |
| `installment_number` *             | integer | Installment number                                                               | -          |
| `invoice_description` *            | string  | Invoice item description                                                         | -          |
| `amount` *                         | float  | Item amount                                                                      | -          |
| `used_limit` *                     | float  | Used limit                                                                       | -          |
| `invoice_item_status` *            | string  | Invoice item status                                                              | **[invoice_item_status enumerators](#invoice_item_status-enumerators)** |
| `invoice_item_due_date` *          | string  | Item due date (YYYY-MM-DD format)                                               | 10         |
| `created_at` *                     | string  | Creation date (ISO 8601 UTC format)                                             | -          |

### wallet_entry_type enumerators

| Enumerator        | Description                                                                       |
|-------------------|-----------------------------------------------------------------------------------|
| revolving_credit  | Revolving credit                                                                  |
| payroll_withdraw  | Payroll withdrawal                                                                |
| payroll_overdue   | Payroll overdue                                                                   |

:::info Wallet Entry Types
- **`revolving_credit`**: Credit amounts made available to the customer
- **`payroll_withdraw`**: Debt generated by limit withdrawal that will be deducted monthly from INSS
- **`payroll_overdue`**: Debt generated by non-payment of the invoice and will also be deducted monthly from INSS
:::

### wallet_entry_status enumerators

| Enumerator | Description                             |
|------------|-----------------------------------------|
| concluded     | Completed entry |

### invoice_item_status enumerators

| Enumerator | Description                             |
|------------|-----------------------------------------|
| concluded    | Completed item   |
| canceled  | Canceled item               |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                  | Description (eng)<br/>`description`                                                                                    | Description (pt-br)<br/>`translation`                                                                                  |
|------------------------|--------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 404                    | CIN000007          | Wallet not Found                                   | Wallet with key: abeca0d0-a09d-4b3b-a495-40b553422ced was not found                                                   | Carteira com a chave: abeca0d0-a09d-4b3b-a495-40b553422ced não foi encontrado                                         |
| 404                    | CIN000078          | Not Found                                          | Wallet entry with key: 8cb70dea-9fb0-4a68-9572-99a72849c8d6 was not found                                             | Dívida da carteira com a chave: 8cb70dea-9fb0-4a68-9572-99a72849c8d6 não foi encontrado                                |

---

# Wallet Query by Key

URL: /en/documentation/cartao_pos_pago/faturas/carteira/consulta_por_chave

The wallet query by key returns the complete details of a specific wallet, including its invoice settings and credit limits.

## Request

ENDPOINT /wallet/ WALLET_KEY
METHOD GET

### Path Parameters

| Field                     | Type   | Description                                  | Characters |
|---------------------------|--------|----------------------------------------------|------------|
| `wallet_key`              | uuidv4 | Unique wallet identification key             | 36         |

## Response

STATUS 200

Response Body: Wallet details

```json
{
  "request_control_key": "f7947b9d-9be3-49d8-aca2-4b3249e5fa65",
  "wallet_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "owner_person_key": "ecf87b4b-fa6e-49c0-a7f0-f2cad6b42d79",
  "owner_document_number": "12345678901",
  "invoice_configuration": {
    "closing_date_configuration": {
      "type": "fixed",
      "fixed_day": 15
    },
    "due_date_configuration": {
      "type": "fixed",
      "fixed_day": 20,
      "offset_months": 0
    },
    "invoice_payment_type": "bank_slip",
    "interest_base": "calendar_days",
    "monthly_interest_percentage": 2.0,
    "fine_percentage": 2.0
  },
  "wallet_status": "active",
  "wallet_type": "default",
  "wallet_limits": [
    {
      "wallet_limit_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "limit_type": "postpaid_credit_limit",
      "limit_amount": 5000.00,
      "used_limit": 0.00
    }
  ],
  "created_at": "2024-01-15T10:30:00Z"
}
```

### Response Body Params

| Field                                    | Type    | Description                                                                        | Characters |
|------------------------------------------|---------|------------------------------------------------------------------------------------|------------|
| `wallet_key` *                           | string  | Unique wallet identification key                                                   | 36         |
| `owner_person_key` *                     | string  | Wallet owner identification key                                                    | 36      |
| `owner_document_number` *                | string  | CPF/CNPJ of the wallet owner                                                       | 11-14      |
| `invoice_configuration` *                | object  | Wallet invoice settings                                                            | **[Object invoice_configuration](#objeto-invoice_configuration)**          |
| `wallet_status` *                         | string  | Current wallet status                                                              | **[Enumerators wallet_status](#enumeradores-wallet_status)**          |
| `wallet_type` *                           | string  | Wallet type                                                                        | **[Enumerators wallet_type](#enumeradores-wallet_type)**          |
| `wallet_limits` *                         | array   | List of wallet limits                                                              | **[Object wallet_limits](#objeto-wallet_limits)**          |
| `created_at` *                            | string  | Creation date (ISO 8601 UTC format)                                               | -          |

### Object invoice_configuration

| Field                                    | Type    | Description                                                                        | Characters |
|------------------------------------------|---------|------------------------------------------------------------------------------------|------------|
| `closing_date_configuration` *           | object  | Invoice closing date configuration                                                 | **[Object closing_date_configuration](#objeto-closing_date_configuration)** |
| `due_date_configuration` *               | object  | Invoice due date configuration                                                     | **[Object due_date_configuration](#objeto-due_date_configuration)** |
| `invoice_payment_type` *                 | string  | Invoice payment type                                                               | **[Enumerators invoice_payment_type](#enumeradores-invoice_payment_type)** |
| `interest_base`                         | string  | Interest calculation base                                                          | **[Enumerators interest_base](#enumeradores-interest_base)** |
| `monthly_interest_percentage`           | float  | Monthly interest percentage for late payment (0-100)                              | -          |
| `fine_percentage`                       | float  | Fine percentage for late payment (0-100)                                          | -          |
:::info
Note: Wallets of type `payroll` do not have the fields `interest_base`, `monthly_interest_percentage` and `fine_percentage`.
:::

### Object closing_date_configuration

#### Fixed Configuration (`type: "fixed"`)

| Field                     | Type    | Description                                  | Characters |
|---------------------------|---------|----------------------------------------------|------------|
| `type` *                  | string  | Configuration type (must be "fixed")        | -          |
| `fixed_day` *             | integer | Fixed day of the month for closing (1-27)   | -          |

#### Rule-based Configuration (`type: "rule_based"`)

| Field                     | Type    | Description                                  | Characters |
|---------------------------|---------|----------------------------------------------|------------|
| `type` *                  | string  | Configuration type (must be "rule_based")   | -          |
| `rule` *                  | object  | Rule for date calculation                    | **[Object rule (closing_date_configuration)](#objeto-rule-closing_date_configuration)**          |

### Object rule (closing_date_configuration)

| Field                     | Type    | Description                                  | Characters |
|---------------------------|---------|----------------------------------------------|------------|
| `day_of_week` *          | string  | Day of the week                              | **[Enumerators day_of_week](#enumeradores-day_of_week)**          |
| `occurrence` *            | string  | Occurrence of the day in the month           | **[Enumerators occurrence](#enumeradores-occurrence)**          |
| `fallback_strategy` *     | string  | Strategy for non-business days               | **[Enumerators fallback_strategy](#enumeradores-fallback_strategy)**          |

### Object due_date_configuration

#### Fixed Configuration (`type: "fixed"`)

| Field                     | Type    | Description                                  | Characters |
|---------------------------|---------|----------------------------------------------|------------|
| `type` *                  | string  | Configuration type (must be "fixed")        | -          |
| `offset_months` *         | integer | Month offset from closing                    | -          |
| `fixed_day` *             | integer | Fixed day of the month for due date (2-27)  | -          |

#### Rule-based Configuration (`type: "rule_based"`)

| Field                     | Type    | Description                                  | Characters |
|---------------------------|---------|----------------------------------------------|------------|
| `type` *                  | string  | Configuration type (must be "rule_based")   | -          |
| `offset_months` *         | integer | Month offset from closing                    | -          |
| `rule` *                  | object  | Rule for date calculation                    | **[Object rule (due_date_configuration)](#objeto-rule-due_date_configuration)**          |

### Object rule (due_date_configuration)

| Field                     | Type    | Description                                  | Characters |
|---------------------------|---------|----------------------------------------------|------------|
| `day_of_week` *          | string  | Day of the week                              | **[Enumerators day_of_week](#enumeradores-day_of_week)**          |
| `occurrence` *            | string  | Occurrence of the day in the month           | **[Enumerators occurrence](#enumeradores-occurrence)**          |
| `fallback_strategy` *     | string  | Strategy for non-business days               | **[Enumerators fallback_strategy](#enumeradores-fallback_strategy)**          |

### Object wallet_limits

| Field                     | Type    | Description                                  | Characters |
|---------------------------|---------|----------------------------------------------|------------|
| `limit_type` *            | string  | Limit type                                   | **[Enumerators limit_type](#enumeradores-limit_type)**          |
| `limit_amount` *          | float  | Total limit amount                           | -          |
| `used_limit` *            | float  | Used limit amount                            | -          |

### Enumerators wallet_status

| Enumerator         | Description                               |
|--------------------|-----------------------------------------|
| pending_analysis   | Wallet pending KYC analysis             |
| active             | Wallet active and available for use     |
| rejected           | Wallet rejected                         |

### Enumerators wallet_type

| Enumerator | Description                     |
|-------------|---------------------------------|
| default     | Default wallet                  |
| payroll     | Payroll card wallet            |

### Enumerators limit_type

| Enumerator                | Description                     |
|---------------------------|---------------------------------|
| postpaid_credit_limit     | Postpaid credit limit          |
| payroll_withdraw_limit    | Payroll withdrawal limit (salary/payroll loans) |

:::info Limits in Payroll Wallets
Wallets of type `payroll` have two distinct limits:
- **`postpaid_credit_limit`**: Postpaid credit limit for card purchases and transactions
- **`payroll_withdraw_limit`**: Specific limit for payroll withdrawals (salary/payroll loans), which are automatically deducted from the customer's payroll
:::

### Enumerators day_of_week

| Enumerator | Description |
|-------------|-----------|
| monday     | Monday |
| tuesday    | Tuesday |
| wednesday  | Wednesday |
| thursday   | Thursday |
| friday     | Friday |
| saturday   | Saturday |
| sunday     | Sunday |

### Enumerators occurrence

| Enumerator | Description |
|-------------|-----------|
| first      | First occurrence |
| second     | Second occurrence |
| third      | Third occurrence |
| fourth     | Fourth occurrence |
| last       | Last occurrence |

### Enumerators fallback_strategy

| Enumerator           | Description                     |
|----------------------|---------------------------------|
| next_business_day    | Next business day               |
| previous_business_day| Previous business day           |
| same_day             | Same day                        |

### Enumerators invoice_payment_type

| Enumerator | Description    |
|-------------|----------------|
| bank_slip  | Bank slip     |

### Enumerators interest_base

| Enumerator      | Description     |
|-----------------|-----------------|
| calendar_days   | Calendar days   |

### Object wallet_limits

| Field                     | Type    | Description                                  | Characters |
|---------------------------|---------|----------------------------------------------|------------|
| `wallet_limit_key` *             | uuidv4  | Unique identification key of the updated limit in UUID v4 format              | 36         |
| `limit_type` *            | string  | Limit type                                   | **[Enumerators limit_type](#enumeradores-limit_type)**          |
| `limit_amount` *          | float  | Total limit amount                           | -          |
| `used_limit` *            | float  | Used limit amount                            | -          |

### Enumerators limit_type

| Enumerator                | Description                     |
|---------------------------|---------------------------------|
| postpaid_credit_limit     | Postpaid credit limit          |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 404                      | WLT000001            | Wallet Not Found                                   | Wallet with key 8cb70dea-9fb0-4a68-9572-99a72849c8d6 not found                                                                                  | Carteira com chave 8cb70dea-9fb0-4a68-9572-99a72849c8d6 não encontrada                                                                          |

---

# Wallet Creation

URL: /en/documentation/cartao_pos_pago/faturas/carteira/criacao_de_carteira

Wallet creation allows you to register a new credit wallet for an individual or legal entity.

:::info What is a Wallet
A **wallet** represents a client's invoice and functions as a centralizer to manage multiple attached payment methods. It's important to understand that:

- **One wallet = invoice**: Each wallet corresponds to a specific client's invoice (identified by CPF/CNPJ)
- **Multiple payment methods**: The same wallet can have different payment instruments (cards, PIX, etc.)
- **Separate instruments**: After creating the wallet, you'll need to separately create payment instruments (credit cards, limits, etc.)
- **Centralized management**: The wallet centralizes all operations and configurations related to that client
:::

## Request

ENDPOINT /wallet
METHOD POST

Request Body

```json
{
  "owner": {
    "request_control_key": "f7947b9d-9be3-49d8-aca2-4b3249e5fa65",
    "person_type": "natural",
    "name": "João Silva",
    "document_number": "12345678901",
    "birthdate": "1990-01-01",
    "email": "joao.silva@email.com",
    "phone": {
      "number": "99999999",
      "area_code": "11",
      "country_code": "55"
    },
    "address": {
      "street": "Rua das Flores",
      "number": "123",
      "neighborhood": "Centro",
      "postal_code": "01234567",
      "city": "São Paulo",
      "state": "SP",
      "complement": "Apto 1"
    }
  },
  "invoice_configuration": {
    "closing_date_configuration": {
      "type": "fixed",
      "fixed_day": 15
    },
    "due_date_configuration": {
      "type": "fixed",
      "fixed_day": 20,
      "offset_months": 0
    },
    "invoice_payment_type": "bank_slip",
    "interest_base": "calendar_days",
    "monthly_interest_percentage": 2.0,
    "fine_percentage": 2.0
  },
  "limits": {
    "postpaid_credit_limit": 5000.00
  }
}
```

### Request Body Params

| Field                                    | Type    | Description                                                                          | Characters |
|------------------------------------------|---------|--------------------------------------------------------------------------------------|------------|
| `request_control_key`    | uuidv4     | Unique request identification key used by the client.                                            | 36                                                                          |
| `owner`                                  | object  | Wallet owner data (individual or legal entity)                     | **[owner object](#owner-object)** |
| `person_key`                             | string  | Unique person identification key in UUID v4 format                         | 36         |
| `invoice_configuration` *                | object  | Invoice closing and due date configuration                                | **[invoice_configuration object](#invoice_configuration-object)** |
| `limits` *                               | object  | Wallet credit limits                                                     | **[limits object](#limits-object)** |

:::info Conditional Fields
- **`owner`**: Required when `person_key` is not sent
- **`person_key`**: Required when `owner` is not sent
- Fields are mutually exclusive
:::

### owner object

#### Individual (`person_type: "natural"`)

| Field                     | Type   | Description                                    | Characters |
|---------------------------|--------|------------------------------------------------|------------|
| `person_type` *           | string | Person type (must be "natural")          | -          |
| `name` *                  | string | Full name                       | 100        |
| `document_number` *       | string | CPF (numbers only)               | 11         |
| `birthdate` *             | string | Date of birth (YYYY-MM-DD format)      | 10         |
| `email` *                 | string | Contact email                            | 254        |
| `phone` *                 | object | Contact phone                          | **[phone object](#phone-object)** |
| `address` *               | object | Complete address                            | **[address object](#address-object)** |

#### Legal Entity (`person_type: "legal"`)

| Field                     | Type   | Description                                    | Characters |
|---------------------------|--------|------------------------------------------------|------------|
| `person_type` *           | string | Person type (must be "legal")            | -          |
| `name` *                  | string | Company legal name                      | 100        |
| `trading_name` *          | string | Company trade name                     | 100        |
| `document_number` *       | string | CNPJ (numbers only)            | 14         |
| `foundation_date` *       | string | Foundation date (YYYY-MM-DD format)       | 10         |
| `email` *                 | string | Contact email                            | 254        |
| `phone` *                 | object | Contact phone                          | **[phone object](#phone-object)** |
| `address` *               | object | Complete address                            | **[address object](#address-object)** |
| `legal_representatives` * | array  | List of legal representatives (individuals)               | -          |

### phone object

| Field                     | Type   | Description                                    | Characters |
|---------------------------|--------|------------------------------------------------|------------|
| `country_code` *          | string | Country code (international code)                         | 2-3        |
| `area_code` *             | string | Area code (national code)                         | 2          |
| `number` *                | string | Phone number                           | 8-9        |

### address object

| Field                     | Type   | Description                                    | Characters |
|---------------------------|--------|------------------------------------------------|------------|
| `street` *                | string | Street/avenue name                          | 500        |
| `number` *                | string | Address number                           | 10         |
| `neighborhood` *          | string | Neighborhood                                       | 100        |
| `postal_code` *           | string | ZIP code (numbers only)                         | 8          |
| `city` *                  | string | City                                       | 100        |
| `state` *                 | string | State (abbreviation)                                  | **[state enums](#state-enums)** |
| `complement`              | string | Address complement                      | 500        |

### state enums

| Enum | Description      |
|-------------|----------------|
| AC          | Acre           |
| AL          | Alagoas        |
| AM          | Amazonas       |
| AP          | Amapá          |
| BA          | Bahia          |
| CE          | Ceará          |
| DF          | Distrito Federal |
| ES          | Espírito Santo |
| GO          | Goiás          |
| MA          | Maranhão       |
| MG          | Minas Gerais    |
| MS          | Mato Grosso do Sul |
| MT          | Mato Grosso    |
| PA          | Pará           |
| PB          | Paraíba        |
| PE          | Pernambuco     |
| PI          | Piauí          |
| PR          | Paraná         |
| RJ          | Rio de Janeiro |
| RN          | Rio Grande do Norte |
| RO          | Rondônia       |
| RR          | Roraima        |
| RS          | Rio Grande do Sul |
| SC          | Santa Catarina |
| SE          | Sergipe        |
| SP          | São Paulo      |
| TO          | Tocantins      |
| EX          | Exception        |

### invoice_configuration object

| Field                                    | Type    | Description                                                                          | Characters |
|------------------------------------------|---------|--------------------------------------------------------------------------------------|------------|
| `closing_date_configuration` *           | object  | Invoice closing date configuration                                      | **[closing_date_configuration object](#closing_date_configuration-object)** |
| `due_date_configuration` *               | object  | Invoice due date configuration                                      | **[due_date_configuration object](#due_date_configuration-object)** |
| `invoice_payment_type` *                 | string  | Invoice payment type                                                       | **[invoice_payment_type enums](#invoice_payment_type-enums)** |
| `interest_base` *                        | string  | Interest calculation base                                                         | **[interest_base enums](#interest_base-enums)** |
| `monthly_interest_percentage` *          | float  | Monthly interest percentage for late payment (0-100)                                    | -          |
| `fine_percentage` *                      | float  | Fine percentage for late payment (0-100)                                            | -          |

### closing_date_configuration object

#### Fixed Configuration (`type: "fixed"`)

| Field                     | Type    | Description                                    | Characters |
|---------------------------|---------|------------------------------------------------|------------|
| `type` *                  | string  | Configuration type (must be "fixed")      | -          |
| `fixed_day` *             | integer | Fixed day of month for closing (1-27)       | -          |

#### Rule-based Configuration (`type: "rule_based"`)

| Field                     | Type    | Description                                    | Characters |
|---------------------------|---------|------------------------------------------------|------------|
| `type` *                  | string  | Configuration type (must be "rule_based") | -          |
| `rule` *                  | object  | Rule for date calculation                     | **[rule object (closing_date_configuration)](#rule-object-closing_date_configuration)**          |

### rule object (closing_date_configuration)

| Field                     | Type    | Description                                    | Characters |
|---------------------------|---------|------------------------------------------------|------------|
| `day_of_week` *          | string  | Day of the week                                | **[day_of_week enums](#day_of_week-enums)**          |
| `occurrence` *            | string  | Occurrence of the day in the month                      | **[occurrence enums](#occurrence-enums)**          |
| `fallback_strategy` *     | string  | Strategy for non-business days                | **[fallback_strategy enums](#fallback_strategy-enums)**          |

### due_date_configuration object

#### Fixed Configuration (`type: "fixed"`)

| Field                     | Type    | Description                                    | Characters |
|---------------------------|---------|------------------------------------------------|------------|
| `type` *                  | string  | Configuration type (must be "fixed")      | -          |
| `offset_months` *         | integer | Months offset from closing       | -          |
| `fixed_day` *             | integer | Fixed day of month for due date (2-27)       | -          |

#### Rule-based Configuration (`type: "rule_based"`)

| Field                     | Type    | Description                                    | Characters |
|---------------------------|---------|------------------------------------------------|------------|
| `type` *                  | string  | Configuration type (must be "rule_based") | -          |
| `offset_months` *         | integer | Months offset from closing       | -          |
| `rule` *                  | object  | Rule for date calculation                     | **[rule object (closing_date_configuration)](#rule-object-due_date_configuration)**          |

### rule object (due_date_configuration)

| Field                     | Type    | Description                                    | Characters |
|---------------------------|---------|------------------------------------------------|------------|
| `day_of_week` *          | string  | Day of the week                                | **[day_of_week enums](#day_of_week-enums)**          |
| `occurrence` *            | string  | Occurrence of the day in the month                      | **[occurrence enums](#occurrence-enums)**          |
| `fallback_strategy` *     | string  | Strategy for non-business days                | **[fallback_strategy enums](#fallback_strategy-enums)**          |

:::caution Date Validations
- Due date must be at least 2 days after closing date
- For rule-based configurations, there must be at least one day difference between the chosen weekdays for closing and due date (e.g., closing on Monday and due date on Wednesday of any week)
:::

### day_of_week enums

| Enum | Description |
|-------------|-----------|
| monday     | Monday |
| tuesday    | Tuesday |
| wednesday  | Wednesday |
| thursday   | Thursday |
| friday     | Friday |
| saturday   | Saturday |
| sunday     | Sunday |

### occurrence enums

| Enum | Description |
|-------------|-----------|
| first      | First occurrence |
| second     | Second occurrence |
| third      | Third occurrence |
| fourth     | Fourth occurrence |
| last       | Last occurrence |

### fallback_strategy enums

| Enum           | Description                    |
|----------------------|------------------------------|
| next_business_day    | Next business day             |
| previous_business_day| Previous business day            |
| same_day             | Same day                    |

### invoice_payment_type enums

| Enum | Description      |
|-------------|----------------|
| bank_slip  | Bank slip |

### interest_base enums

| Enum      | Description        |
|-----------------|------------------|
| calendar_days   | Calendar days    |

### limits object

| Field                     | Type    | Description                                    | Characters |
|---------------------------|---------|------------------------------------------------|------------|
| `postpaid_credit_limit` * | float  | Limit for postpaid credit                 | -          |

## Response

### Success - Wallet Created with Pending Analysis

STATUS 202

Response Body: Wallet pending analysis

```json
{
  "wallet_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "owner_person_key": null,
  "wallet_status": "pending_analysis"
}
```

:::info Information
If **HTTP Status 202** is returned with the `wallet_status` field valued `pending_analysis`, the creation will be processed asynchronously.
A webhook will be sent later informing whether the wallet was approved or rejected in the KYC analysis. For more details about webhooks, see the [webhook documentation](/documentation/cartao_pos_pago/faturas/webhooks/carteira)
:::

:::note Note
For cases that require KYC analysis, the `owner_person_key` field will be returned as `null` in the initial response. The wallet holder will only be created in the system at the end of the KYC process, if approved. In this case, the person key will be sent later through the approval webhook, see the [webhook documentation](/documentation/cartao_pos_pago/faturas/webhooks/carteira)
:::

### Success - Active Wallet Created

STATUS 201

Response Body: Active wallet

```json
{
  "wallet_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "owner_person_key": "ecf87b4b-fa6e-49c0-a7f0-f2cad6b42d79",
  "wallet_status": "active"
}
```

### Response Body Params

| Field                   | Type   | Description                                                                         | Characters |
|-------------------------|--------|-------------------------------------------------------------------------------------|------------|
| `wallet_key` *          | uuidv4 | Unique wallet identification key in uuid v4 format                      | 36         |
| `owner_person_key` *    | string | Wallet owner identification key                               | 36      |
| `wallet_status` *       | string | Wallet status                                                               | -          |

### wallet_status enums

| Enum         | Description                               |
|--------------------|-----------------------------------------|
| pending_analysis   | Wallet pending KYC analysis        |
| active             | Wallet active and available for use    |
| rejected           | Wallet rejected                      |

:::info Wallet Status
- **`pending_analysis`**: Returned when wallet is created with complete owner data. Will be submitted to KYC analysis.
- **`active`**: Returned when wallet is created with existing person key. Available for immediate use.
:::

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | CIN000020            | Requester not Found                                | No requester configuration found for requester key: 8e1e6b46-beb3-467b-965c-6c545707d467                                                     | Solicitante não encontrado para requester key: 8e1e6b46-beb3-467b-965c-6c545707d467                                                          |
| 404                      | CIN000062            | Not Found                                          | Person not found by person key: e51070e4-7494-468d-a20e-bf14789fa8ff                                                                            | Pessoa não encontrada para a person key: e51070e4-7494-468d-a20e-bf14789fa8ff                                                                   |
| 409                      | CIN000043            | Conflict                                           | Active wallet found                                                                                                     | Carteira ativa já existe                                                                                                |
| 400                      | CIN000063            | Bad Request                                        | Expiration date too close to closing date                                                                               | Data de vencimento muito próxima da data de fechamento                                                                  |
| 400                      | CIN000064            | Bad Request                                        | Invalid offset months for rule-based configuration                                                                      | Meses de offset inválidos para configuração baseada em regras                                                           |
| 400                      | CIN000065            | Bad Request                                        | Weekdays too close for rule-based configuration                                                                         | Dias da semana muito próximos para configuração baseada em regras                                                        |
| 400                      | CIN000002            | Bad Request                                        | Invalid signer document number                                                                                          | Número do documento do signatário inválido                                                                              |
| 400                      | CIN000066            | Bad Request                                        | Error while creating wallet in card service                                                                             | Erro ao criar carteira no serviço de cartão                                                                             |
| 409                      | CIN000099            | Conflict                                           | Request control key already exists.                                                                                     | Request control key já existe.                                                                                          |

---

# List Wallets

URL: /en/documentation/cartao_pos_pago/faturas/carteira/listar_carteiras

The wallet listing will return all wallets that match the query parameters sent in the request.

## Request

ENDPOINT /wallets
METHOD GET

### Query Parameters

| Field                     | Type    | Description                                  | Characters |
|---------------------------|---------|----------------------------------------------|------------|
| `owner_document_number`   | string  | CPF/CNPJ of the wallet owner                | 11-14 |
| `wallet_status`                  | string  | Wallet status for filtering              | **[wallet_status Enumerators](#enumerators-wallet_status)** |
| `page`                    | integer | Page number for pagination                  | - |
| `page_size`               | integer | Number of items per page                    | - |

:::caution Validations
- **Pagination**: Page and size values must be valid integers
- **Page size**: Maximum of 100 items per page
:::

### Enumerators wallet_status

| Enumerator         | Description                             |
|--------------------|-----------------------------------------|
| pending_analysis   | Wallet pending KYC analysis             |
| active             | Wallet active and available for use     |
| rejected           | Wallet rejected                         |

## Response

STATUS 200

Response Body: Wallet list

```json
{
  "data": [
    {
      "request_control_key": "f7947b9d-9be3-49d8-aca2-4b3249e5fa65",
      "wallet_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "owner_person_key": "ecf87b4b-fa6e-49c0-a7f0-f2cad6b42d79",
      "owner_document_number": "12345678901",
      "invoice_configuration": {
        "closing_date_configuration": {
          "type": "fixed",
          "fixed_day": 15
        },
        "due_date_configuration": {
          "type": "fixed",
          "fixed_day": 20,
          "offset_months": 0
        },
        "invoice_payment_type": "bank_slip",
        "interest_base": "calendar_days",
        "monthly_interest_percentage": 2.0,
        "fine_percentage": 2.0
      },
      "wallet_status": "active",
      "wallet_type": "default",
      "created_at": "2024-01-15T10:30:00Z"
    },
    {
      "request_control_key": "e1d7ca45-8180-48e4-a293-1f08a046693e",
      "wallet_key": "9db81efb-0ac1-5b79-0683-00b8395a9e7",
      "owner_document_number": "98765432100",
      "invoice_configuration": {
        "closing_date_configuration": {
          "type": "rule_based",
          "rule": {
            "day_of_week": "friday",
            "occurrence": "last",
            "fallback_strategy": "previous_business_day"
          }
        },
        "due_date_configuration": {
          "type": "rule_based",
          "offset_months": 1,
          "rule": {
            "day_of_week": "monday",
            "occurrence": "first",
            "fallback_strategy": "next_business_day"
          }
        },
        "invoice_payment_type": "bank_slip",
        "interest_base": "calendar_days",
        "monthly_interest_percentage": 1.5,
        "fine_percentage": 2.0
      },
      "wallet_status": "pending_analysis",
      "wallet_type": "default",
      "created_at": "2024-01-14T14:45:00Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "rows_per_page": 100,
  }
}
```

### Response Body Params

| Field            | Type         | Description                           | Characters                                  |
|------------------|--------------|---------------------------------------|---------------------------------------------|
| `data` *         | object array | Wallets                              | **[wallet Object](#wallet-object)**   |
| `pagination` *   | object       | Pagination information               | **[pagination Object](#pagination-object)** |

### wallet Object

| Field                     | Type   | Description                                  | Characters |
|---------------------------|--------|----------------------------------------------|------------|
| `wallet_key` *            | uuidv4 | Unique wallet identification key             | 36         |
| `owner_person_key` *      | string | Wallet owner identification key                               | 36      |
| `owner_document_number` * | string | CPF/CNPJ of the wallet owner                 | 11 or 14   |
| `invoice_configuration` * | object | Closing and due date configuration          | **[invoice_configuration Object](#invoice_configuration-object)**          |
| `wallet_status` *         | string | Current wallet status                        | **[wallet_status Enumerators](#enumerators-wallet_status)**          |
| `wallet_type` *           | string | Wallet type                                  | **[wallet_type Enumerators](#enumerators-wallet_type)**          |
| `created_at` *            | string | Creation date (ISO 8601 UTC format)          | -          |

### pagination Object

| Field                      | Type    | Description                                                                        | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------------------|
| `current_page` *           | integer | Current page                                                 | -      |
| `rows_per_page` *          | integer | Items per page                                               | -      |

### Enumerators wallet_type

| Enumerator | Description                  |
|-------------|------------------------------|
| default     | Default wallet               |
| payroll     | Payroll card wallet          |

### invoice_configuration Object

| Field                                    | Type    | Description                                                                        | Characters |
|------------------------------------------|---------|------------------------------------------------------------------------------------|------------|
| `closing_date_configuration` *           | object  | Invoice closing date configuration                                                 | **[closing_date_configuration Object](#closing_date_configuration-object)** |
| `due_date_configuration` *               | object  | Invoice due date configuration                                                     | **[due_date_configuration Object](#due_date_configuration-object)** |
| `invoice_payment_type` *                 | string  | Invoice payment type                                                               | **[invoice_payment_type Enumerators](#enumerators-invoice_payment_type)** |
| `interest_base`                         | string  | Interest calculation base                                                          | **[interest_base Enumerators](#enumerators-interest_base)** |
| `monthly_interest_percentage`          | float  | Monthly interest percentage for late payment (0-100)                              | -          |
| `fine_percentage`                       | float  | Late payment fine percentage (0-100)                                              | -          |

:::info
Note: Wallets of type `payroll` do not have the fields `interest_base`, `monthly_interest_percentage` and `fine_percentage`.
:::

### closing_date_configuration Object

#### Fixed Configuration (`type: "fixed"`)

| Field                     | Type    | Description                                  | Characters |
|---------------------------|---------|----------------------------------------------|------------|
| `type` *                  | string  | Configuration type (must be "fixed")         | -          |
| `fixed_day` *             | integer | Fixed day of the month for closing (1-27)    | -          |

#### Rule-Based Configuration (`type: "rule_based"`)

| Field                     | Type    | Description                                  | Characters |
|---------------------------|---------|----------------------------------------------|------------|
| `type` *                  | string  | Configuration type (must be "rule_based")    | -          |
| `rule` *                  | object  | Rule for date calculation                     | **[rule Object (closing_date_configuration)](#rule-object-closing_date_configuration)**          |

### rule Object (closing_date_configuration)

| Field                     | Type    | Description                                  | Characters |
|---------------------------|---------|----------------------------------------------|------------|
| `day_of_week` *          | string  | Day of the week                              | **[day_of_week Enumerators](#enumerators-day_of_week)**          |
| `occurrence` *            | string  | Occurrence of the day in the month           | **[occurrence Enumerators](#enumerators-occurrence)**          |
| `fallback_strategy` *     | string  | Strategy for non-business days               | **[fallback_strategy Enumerators](#enumerators-fallback_strategy)**          |

### due_date_configuration Object

#### Fixed Configuration (`type: "fixed"`)

| Field                     | Type    | Description                                  | Characters |
|---------------------------|---------|----------------------------------------------|------------|
| `type` *                  | string  | Configuration type (must be "fixed")         | -          |
| `offset_months` *         | integer | Months offset from closing                   | -          |
| `fixed_day` *             | integer | Fixed day of the month for due date (2-27)   | -          |

#### Rule-Based Configuration (`type: "rule_based"`)

| Field                     | Type    | Description                                  | Characters |
|---------------------------|---------|----------------------------------------------|------------|
| `type` *                  | string  | Configuration type (must be "rule_based")    | -          |
| `offset_months` *         | integer | Months offset from closing                   | -          |
| `rule` *                  | object  | Rule for date calculation                     | **[rule Object (closing_date_configuration)](#rule-object-due_date_configuration)**          |

### rule Object (due_date_configuration)

| Field                     | Type    | Description                                  | Characters |
|---------------------------|---------|----------------------------------------------|------------|
| `day_of_week` *          | string  | Day of the week                              | **[day_of_week Enumerators](#enumerators-day_of_week)**          |
| `occurrence` *            | string  | Occurrence of the day in the month           | **[occurrence Enumerators](#enumerators-occurrence)**          |
| `fallback_strategy` *     | string  | Strategy for non-business days               | **[fallback_strategy Enumerators](#enumerators-fallback_strategy)**          |

### Enumerators day_of_week

| Enumerator | Description |
|-------------|-----------|
| monday     | Monday |
| tuesday    | Tuesday |
| wednesday  | Wednesday |
| thursday   | Thursday |
| friday     | Friday |
| saturday   | Saturday |
| sunday     | Sunday |

### Enumerators occurrence

| Enumerator | Description |
|-------------|-----------|
| first      | First occurrence |
| second     | Second occurrence |
| third      | Third occurrence |
| fourth     | Fourth occurrence |
| last       | Last occurrence |

### Enumerators fallback_strategy

| Enumerator           | Description                  |
|----------------------|------------------------------|
| next_business_day    | Next business day            |
| previous_business_day| Previous business day        |
| same_day             | Same day                     |

### Enumerators invoice_payment_type

| Enumerator | Description    |
|-------------|----------------|
| bank_slip  | Bank slip      |

### Enumerators interest_base

| Enumerator      | Description      |
|-----------------|------------------|
| calendar_days   | Calendar days    |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                              | Description (eng)<br/>`description`                                                                                     | Description (pt-br)<br/>`translation`                                                                                   |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | BKS000012            | Bad Request                                        | Invalid integer value for page or size query string parameters                                                           | Valor inválido para parâmetros de página ou tamanho de página                                                           |
| 400                      | BKS000013            | Bad Request                                        | Invalid query wallet status                                                                                             | Status de consulta de carteira inválido                                                                                 |

---

# List Wallet Entries

URL: /en/documentation/cartao_pos_pago/faturas/carteira/listar_entradas_da_carteira

The wallet entries listing will return all entries of a specific wallet that match the query parameters sent in the request.

## Request

ENDPOINT /wallet/ WALLET_KEY /wallet_entries
METHOD GET

### Path Parameters

| Field        | Type   | Description                                  | Characters |
|--------------|--------|----------------------------------------------|------------|
| `wallet_key` | uuidv4 | Unique wallet key in UUID v4 format         | 36         |

### Query Parameters

| Field                        | Type    | Description                                  | Characters |
|------------------------------|---------|----------------------------------------------|------------|
| `wallet_entry_type` *        | string  | Wallet entry type                            | **[Enums wallet_entry_type](#enums-wallet_entry_type)** |
| `wallet_entry_status` *      | string  | Wallet entry status                          | **[Enums wallet_entry_status](#enums-wallet_entry_status)** |
| `page`                       | integer | Page number for pagination                   | -          |
| `page_size`                  | integer | Number of items per page                     | -          |

:::caution Validations
- **Pagination**: Page and size values must be valid integers
- **Page size**: Maximum of 100 items per page
:::

### Enums wallet_entry_type

| Enum              | Description                                                                       |
|-------------------|-----------------------------------------------------------------------------------|
| revolving_credit  | Revolving credit                                                                  |
| payroll_withdraw  | Payroll withdrawal                                                                |
| payroll_overdue   | Payroll overdue                                                                   |

:::info Wallet Entry Types
- **`revolving_credit`**: Credit amounts made available to the client
- **`payroll_withdraw`**: Debt generated by withdrawing from the limit and which will be deducted from INSS every month
- **`payroll_overdue`**: Debt generated by non-payment of the invoice and which will also be deducted from INSS every month
:::

### Enums wallet_entry_status

| Enum          | Description                             |
|---------------|-----------------------------------------|
| concluded     | Completed entry                         |

## Response

STATUS 200

Response Body: List of wallet entries

```json
{
  "data": [
    {
      "wallet_entry_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "wallet_entry_amount": 150.00,
      "wallet_entry_settlement_key": "cc8fb19b-d1e4-4ce6-ad4c-61e0609a8f8d",
      "wallet_entry_type": "revolving_credit",
      "wallet_entry_status": "concluded",
      "created_at": "2024-01-15T10:30:00Z"
    },
    {
      "wallet_entry_key": "9db81efb-0ac1-5b79-0683-00b8395a9e7",
      "wallet_entry_amount": 150.00,
      "wallet_entry_settlement_key": "20cbf6e7-9535-44b4-88e3-f2c7a178a198",
      "wallet_entry_type": "payroll_withdraw",
      "wallet_entry_status": "concluded",
      "created_at": "2024-01-14T14:45:00Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "rows_per_page": 100
  }
}
```

### Response Body Params

| Field            | Type         | Description                           | Characters                                  |
|------------------|--------------|---------------------------------------|---------------------------------------------|
| `data` *         | object array | Wallet entries                        | **[Object wallet_entry](#object-wallet_entry)** |
| `pagination` *   | object       | Pagination information                | **[Object pagination](#object-pagination)** |

### Object wallet_entry

| Field                        | Type    | Description                                                                       | Characters |
|------------------------------|---------|-----------------------------------------------------------------------------------|------------|
| `wallet_entry_key` *         | uuidv4  | Unique entry identification key in uuid v4 format                                | 36         |
| `wallet_entry_amount` *      | float   | Entry amount                                                                      | -          |
| `wallet_entry_settlement_key` * | string | Entry settlement key                                                             | -          |
| `wallet_entry_type` *        | string  | Wallet entry type                                                                 | **[Enums wallet_entry_type](#enums-wallet_entry_type)** |
| `wallet_entry_status` *      | string  | Wallet entry status                                                               | **[Enums wallet_entry_status](#enums-wallet_entry_status)** |
| `created_at` *               | string  | Creation date (ISO 8601 UTC format)                                              | -          |

### Object pagination

| Field                      | Type    | Description                                                                        | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------------------|
| `current_page` *           | integer | Current page                                                                       | -      |
| `rows_per_page` *          | integer | Items per page                                                                     | -      |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | CIN000069            | Bad Request                                        | Invalid integer value for page or size query string parameters                                                           | Valor inválido para parâmetros de página ou tamanho de página                                                           |
| 400                      | CIN000076            | Bad Request                                        | Invalid query wallet entry status                                                                                       | Status de consulta de dívida da carteira inválido                                                                       |
| 400                      | CIN000077            | Bad Request                                        | Invalid query wallet entry type                                                                                         | Tipo de consulta de dívida da carteira inválido                                                                         |
| 404                      | CIN000007            | Wallet not Found                                   | Wallet with key: abeca0d0-a09d-4b3b-a495-40b553422ced was not found                                                   | Carteira com a chave: abeca0d0-a09d-4b3b-a495-40b553422ced não foi encontrado                                         |

---

# Search Wallet Bank Slip

URL: /en/documentation/cartao_pos_pago/faturas/fatura/boleto_de_pagamento_da_fatura

The wallet bank slip search will return information about the bank slip associated with the wallet, including barcode and digitable line.

:::warning Attention
The wallet bank slip **is only generated after the closure of the first invoice**. 
:::

## Request

ENDPOINT /v2/invoice/wallet/ WALLET_KEY /wallet_bank_slip
METHOD GET

### Path Parameters

| Field         | Type   | Description                                 | Characters |
|---------------|--------|---------------------------------------------|------------|
| `wallet_key`  | uuidv4 | Wallet unique key in UUID v4 format       | 36         |

## Response

STATUS 200

Response Body: Bank slip details

```json
{
  "wallet_bank_slip_key": "3571e292-3a83-4011-904d-20ee963022ef",
  "wallet_bank_slip_status": "accepted",
  "bank_slip_amount": 150.00,
  "bank_slip_due_date": "2024-02-15",
  "bank_slip_data": {
    "barcode": "32991090000000150001234567890123456789012345",
    "digitable_line": "32991234567890123456789012345678901234567890123"
  }
}
```

### Response Body Params

| Field                    | Type   | Description                                                                      | Characters |
|--------------------------|--------|----------------------------------------------------------------------------------|------------|
| `wallet_bank_slip_key` * | uuidv4 | Unique identification key of the wallet bank slip in uuid v4 format            | 36         |
| `wallet_bank_slip_status` * | string | Bank slip status                                                                | **[wallet_bank_slip_status enumerators](#enumeradores-wallet_bank_slip_status)** |
| `bank_slip_amount` *     | float  | Bank slip amount                                                                 | -          |
| `bank_slip_due_date` *   | string | Bank slip due date (YYYY-MM-DD format)                                          | 10         |
| `bank_slip_data` *       | object | Bank slip data containing barcode and digitable line                            | **[bank_slip_data object](#objeto-bank_slip_data)** |

### bank_slip_data object

| Field                    | Type   | Description                                                                      | Characters |
|--------------------------|--------|----------------------------------------------------------------------------------|------------|
| `barcode` *              | string | Bank slip barcode                                                                | 44         |
| `digitable_line` *       | string | Bank slip digitable line                                                         | 47         |

### wallet_bank_slip_status enumerators

| Enumerator | Description                              |
|------------|------------------------------------------|
| accepted   | Bank slip accepted, awaiting registration confirmation |
| registered | Bank slip registered and available for payment |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 404                      | CIN000007            | Wallet not Found                                   | Wallet with key: abeca0d0-a09d-4b3b-a495-40b553422ced was not found                                                   | Carteira com a chave: abeca0d0-a09d-4b3b-a495-40b553422ced não foi encontrado                                         |
| 404                      | CIN000093            | Not Found                                          | Wallet bank slip was not found                                                                                          | Boleto da carteira não foi encontrado                                                                                   |

---

# Search Invoice by Key

URL: /en/documentation/cartao_pos_pago/faturas/fatura/consulta_por_chave

The invoice search by key will return the complete details of a specific invoice, including all invoice items.

## Request

ENDPOINT /wallet/ WALLET_KEY /invoice/ INVOICE_KEY
METHOD GET

### Path Parameters

| Field         | Type   | Description                                      | Characters |
|---------------|--------|--------------------------------------------------|------------|
| `wallet_key`  | uuidv4 | Unique wallet key in UUID v4 format             | 36         |
| `invoice_key` | uuidv4 | Unique invoice key in UUID v4 format            | 36         |

## Response

STATUS 200

Response Body: Invoice details

```json
{
  "invoice_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "due_date": "2024-02-15",
  "closing_date": "2024-01-31",
  "invoice_status": "opened",
  "total_amount": 350.00,
  "paid_amount": 0.00,
  "invoice_items": [
    {
      "invoice_item_key": "3571e292-3a83-4011-904d-20ee963022ef",
      "invoice_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "wallet_entry_key": null,
      "payment_instrument_entry_key": "g3ebe8d6-4c8a-1794-22d9-406c0f8g3dbe",
      "installment_number": 1,
      "invoice_description": "Compra no estabelecimento XYZ",
      "amount": 150.00,
      "used_limit": 150.00,
      "paid_amount": 0.00,
      "invoice_item_status": "concluded",
      "invoice_item_due_date": "2024-02-15",
      "created_at": "2024-01-15T10:30:00Z"
    },
    {
      "invoice_item_key": "b2c3d4e5-f6g7-8901-bcde-f23456789012",
      "invoice_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "wallet_entry_key": null,
      "payment_instrument_entry_key": "g3ebe8d6-4c8a-1794-22d9-406c0f8g3dbe",
      "installment_number": 2,
      "invoice_description": "Parcela 2 de 3 - Compra parcelada",
      "amount": 200.00,
      "used_limit": 200.00,
      "invoice_item_status": "concluded",
      "invoice_item_due_date": "2024-02-15",
      "created_at": "2024-01-16T14:45:00Z"
    }
  ],
  "invoice_payments": [
    {
      "invoice_payment_key": "c3d4e5f6-g7h8-9012-cdef-345678901234",
      "total_amount": 350.00,
      "paid_amount": 0.00,
      "invoice_payment_type": "bank_slip",
      "invoice_payment_status": "paid"
    }
  ],
  "invoice_payments_chargebacks": [
    {
      "invoice_item_key": "3571e292-3a83-4011-904d-20ee963022ef",
      "chargeback_paid_amount": 50.00
    }
  ],
  "created_at": "2024-01-15T10:30:00Z"
}
```

### Response Body Params

| Field            | Type         | Description                           | Characters                                  |
|------------------|--------------|---------------------------------------|---------------------------------------------|
| `invoice_key` *  | uuidv4       | Unique invoice identification key in uuid v4 format | 36         |
| `due_date` *     | string       | Invoice due date (YYYY-MM-DD format) | 10         |
| `closing_date` * | string       | Invoice closing date (YYYY-MM-DD format) | 10         |
| `invoice_status` * | string    | Invoice status                        | **[Enumerators invoice_status](#enumerators-invoice_status)** |
| `total_amount` * | number       | Total invoice amount                  | -          |
| `paid_amount` *  | number       | Paid invoice amount                   | -          |
| `invoice_items` * | object array | Invoice items                        | **[Object invoice_item](#object-invoice_item)** |
| `invoice_payments` *               | object array | Invoice payments                     | [Object invoice_payment](#object-invoice_payment) |
| `invoice_payments_chargebacks` *  | object array | Invoice payment chargebacks         | [Object invoice_payment_chargeback](#object-invoice_payment_chargeback) |
| `created_at` *                     | string       | Creation date (ISO 8601 UTC format) | -          |

### Object invoice_item

| Field                              | Type    | Description                                                                       | Characters |
|------------------------------------|---------|-----------------------------------------------------------------------------------|------------|
| `invoice_item_key` *               | uuidv4  | Unique invoice item identification key in uuid v4 format                         | 36         |
| `invoice_key` *                    | uuidv4  | Unique invoice identification key in uuid v4 format                              | 36         |
| `wallet_entry_key`                 | uuidv4  | Unique wallet entry identification key in uuid v4 format                        | 36         |
| `payment_instrument_entry_key`     | uuidv4  | Unique payment instrument entry identification key in uuid v4 format            | 36         |
| `installment_number` *             | integer | Installment number                                                               | -          |
| `invoice_description` *            | string  | Invoice item description                                                         | -          |
| `amount` *                         | float  | Item amount                                                                      | -          |
| `used_limit` *                     | float  | Used limit                                                                       | -          |
| `invoice_item_status` *            | string  | Invoice item status                                                              | **[Enumerators invoice_item_status](#enumerators-invoice_item_status)** |
| `invoice_item_due_date` *          | string  | Item due date (YYYY-MM-DD format)                                               | 10         |
| `created_at` *                     | string  | Creation date (ISO 8601 UTC format)                                             | -          |

### Object invoice_payment

| Field                              | Type    | Description                                                                       | Characters |
|------------------------------------|---------|-----------------------------------------------------------------------------------|------------|
| invoice_payment_key *              | uuidv4  | Unique invoice payment identification key in uuid v4 format                      | 36         |
| total_amount                       | number  | Total payment amount                                                             | -          |
| paid_amount                        | number  | Paid payment amount                                                              | -          |
| invoice_payment_type *              | string  | Invoice payment type                                                             | [Enumerators invoice_payment_type](#enumerators-invoice_payment_type) |
| invoice_payment_status *           | string  | Invoice payment status                                                           | [Enumerators invoice_payment_status](#enumerators-invoice_payment_status) |

### Object invoice_payment_chargeback

| Field                              | Type    | Description                                                                       | Characters |
|------------------------------------|---------|-----------------------------------------------------------------------------------|------------|
| invoice_item_key *                 | uuidv4  | Unique identification key of the invoice item related to the chargeback in uuid v4 format | 36         |
| chargeback_paid_amount             | number  | Used chargeback amount                                                           | -          |

### Enumerators invoice_status

| Enumerator | Description                             |
|------------|-----------------------------------------|
| opened                 | Open invoice                 |
| processing_closing     | Processing closure           |
| processing_expiration  | Processing expiration        |
| closed                 | Closed invoice               |
| processing_payment        | Awaiting payment             |
| paid                   | Paid invoice                 |

:::info Note
The `processing_payment` status is applied only for `payroll` type wallets in the scenario where the possible payment amount has already been made and there is a remaining amount to be paid with the benefit.
:::

### Enumerators invoice_payment_type

| Enumerator | Description                             |
|------------|-----------------------------------------|
| bank_slip        | Bank slip                     |
| payroll_discount | INSS discount               |

:::info Note
The `payroll_discount` type exists only for `payroll` type wallets and represents the amount that will be discounted via benefit.
:::

### Enumerators invoice_payment_status

| Enumerator | Description                             |
|------------|-----------------------------------------|
| processing_payment  | Awaiting payment                 |
| paid             | Paid                            |

:::info Note
- For `payroll_discount` type payments: the payment is created at the time of invoice closure with `processing_payment` status and the discount is requested from INSS. When the discount payment is made, the status changes to `paid`.
- For `bank_slip` type payments: the payment is created with `processing_payment` status when we receive the bank slip payment notice. At the time of bank slip settlement, the status changes to `paid`. The payment can be created with `paid` status directly if a payment notice is not received.
:::

### Enumerators invoice_item_status

| Enumerator | Description                             |
|------------|-----------------------------------------|
| concluded    | Concluded item               |
| canceled  | Canceled item                        |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 404                      | CIN000007            | Wallet not Found                                   | Wallet with key: abeca0d0-a09d-4b3b-a495-40b553422ced was not found                                                   | Carteira com a chave: abeca0d0-a09d-4b3b-a495-40b553422ced não foi encontrado                                         |
| 404                      | CIN000016            | Invoice Not Found                                  | Invoice with key: 8cb70dea-9fb0-4a68-9572-99a72849c8d6 was not found                                                  | Fatura com a chave: 8cb70dea-9fb0-4a68-9572-99a72849c8d6 não foi encontrado                                           |

---

# List Invoices

URL: /en/documentation/cartao_pos_pago/faturas/fatura/listar_faturas

The invoice listing will return all invoices from a specific wallet that match the query parameters sent in the request.

## Request

ENDPOINT /wallet/ WALLET_KEY /invoices
METHOD GET

### Path Parameters

| Field        | Type   | Description                                  | Characters |
|--------------|--------|----------------------------------------------|------------|
| `wallet_key` | uuidv4 | Unique wallet key in UUID v4 format         | 36         |

### Query Parameters

| Field                        | Type    | Description                                  | Characters |
|------------------------------|---------|----------------------------------------------|------------|
| `invoice_status` *           | string  | Invoice status                                                           | **[invoice_status Enumerators](#invoice_status-enumerators)** |
| `page`                       | integer | Page number for pagination                   | -          |
| `page_size`                  | integer | Number of items per page                     | -          |

:::caution Validations
- **Pagination**: Page and size values must be valid integers
- **Page size**: Maximum of 100 items per page
:::

### invoice_status Enumerators

| Enumerator | Description                             |
|------------|-----------------------------------------|
| opened                 | Open invoice                    |
| processing_closing     | Processing closure              |
| processing_expiration  | Processing expiration           |
| closed                 | Closed invoice                  |
| processing_payment        | Awaiting payment                |
| paid                   | Paid invoice                    |

## Response

STATUS 200

Response Body: Invoice list

```json
{
  "data": [
    {
      "invoice_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "due_date": "2024-02-15",
      "closing_date": "2024-01-31",
      "invoice_status": "opened",
      "total_amount": 350.00,
      "paid_amount": 0.00,
      "created_at": "2024-01-15T10:30:00Z"
    },
    {
      "invoice_key": "9db81efb-0ac1-5b79-0683-00b8395a9e7",
      "due_date": "2024-01-15",
      "closing_date": "2023-12-31",
      "invoice_status": "opened",
      "total_amount": 500.00,
      "paid_amount": 0.00,
      "created_at": "2024-01-14T14:45:00Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "rows_per_page": 100
  }
}
```

### Response Body Params

| Field            | Type         | Description                           | Characters                                  |
|------------------|--------------|---------------------------------------|---------------------------------------------|
| `data` *         | object array | Invoices                              | **[invoice Object](#invoice-object)**       |
| `pagination` *   | object       | Pagination information                | **[pagination Object](#pagination-object)** |

### invoice Object

| Field                        | Type    | Description                                                                       | Characters |
|------------------------------|---------|-----------------------------------------------------------------------------------|------------|
| `invoice_key` *              | uuidv4  | Unique invoice identification key in uuid v4 format                              | 36         |
| `due_date` *                 | string  | Invoice due date (YYYY-MM-DD format)                                            | 10         |
| `closing_date` *             | string  | Invoice closing date (YYYY-MM-DD format)                                        | 10         |
| `invoice_status` *           | string  | Invoice status                                                                   | **[invoice_status Enumerators](#invoice_status-enumerators)** |
| `total_amount` *             | number  | Total invoice amount                                           | -          |
| `paid_amount` *              | number  | Paid invoice amount                                            | -          |
| `created_at` *               | string  | Creation date (ISO 8601 UTC format)                                             | -          |

### pagination Object

| Field                      | Type    | Description                                                                        | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------------------|
| `current_page` *           | integer | Current page                                             | -      |
| `rows_per_page` *          | integer | Items per page                                           | -      |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | CIN000069            | Bad Request                                        | Invalid integer value for page or size query string parameters                                                           | Valor inválido para parâmetros de página ou tamanho de página                                                           |
| 400                      | CIN000079            | Bad Request                                        | Invalid query invoice status                                                                                             | Status de consulta de fatura inválido                                                                                  |
| 404                      | CIN000007            | Wallet not Found                                   | Wallet with key: abeca0d0-a09d-4b3b-a495-40b553422ced was not found                                                   | Carteira com a chave: abeca0d0-a09d-4b3b-a495-40b553422ced não foi encontrado                                         |

---

# Scenario Simulation - Invoice Closing and Expiration

URL: /en/documentation/cartao_pos_pago/faturas/fatura/simulacao_de_cenarios

This page describes how to simulate invoice closing and expiration to test the transaction flow with post-paid cards. These simulations are useful for approval and integration testing.

## 1 - Invoice closing simulation

Simulates the closing of an open invoice, changing its status to `processing_closing` and publishing the message in the closing queue. The invoice will be processed according to the wallet configuration.

ENDPOINT /mock/invoice/ INVOICE_KEY /close
MÉTODO PATCH

### Path Parameters

| Field                        | Type   | Description                                    | Characters |
|------------------------------|--------|----------------------------------------------|------------|
| `invoice_key` *           | string  | Unique invoice key in UUID v4 format                                  | 36         |

### Headers

### Request Body

This request has no body.

### Response

STATUS 204

Response Body

```json

{}

```

### Response Body Params

This response has no parameters in the body.

:::tip Behavior

- The simulation changes the invoice status to `processing_closing`
- The invoice must have status `opened` to be able to be closed
- A status change notification is sent to the client
:::

## 2 - Invoice expiration simulation

Simulates the expiration of a closed invoice, changing its status to `processing_expiration` and publishing the message in the expiration queue. The invoice will be processed according to the wallet configuration.

ENDPOINT /mock/invoice/ INVOICE_KEY /expire
MÉTODO PATCH

### Path Parameters

| Field                        | Type   | Description                                    | Characters |
|------------------------------|--------|----------------------------------------------|------------|
| `invoice_key` *           | string  | Unique invoice key in UUID v4 format                                  | 36         |

### Request Body

This request has no body.

### Response

STATUS 204

Response Body

```json

{}

```

### Response Body Params

This response has no parameters in the body.

:::tip Behavior
- The simulation changes the invoice status to `processing_expiration`
- The invoice cannot have status `opened` (it must be closed)
- The wallet must have at least one open invoice
- The wallet's next closing date cannot be earlier than the next due date
- A status change notification is sent to the client
:::

---

# Payment Instrument Limit Change

URL: /en/documentation/cartao_pos_pago/faturas/instrumento_de_pagamento/alteracao_de_limite

The payment instrument limit change allows you to modify the limit value of an existing payment instrument.

## Request

ENDPOINT /wallet/ WALLET_KEY /payment_instrument/ PAYMENT_INSTRUMENT_KEY
METHOD PATCH

### Path Parameters

| Field                        | Type   | Description                                    | Characters |
|------------------------------|--------|------------------------------------------------|------------|
| `wallet_key` *               | uuidv4 | Unique wallet key in UUID v4 format           | 36         |
| `payment_instrument_key` *   | uuidv4 | Unique payment instrument key in UUID v4 format | 36       |

Request Body

```json
{
  "limit_amount": 3000.00
}
```

### Request Body Params

| Field                        | Type    | Description                                                                        | Characters |
|------------------------------|---------|------------------------------------------------------------------------------------|------------|
| `limit_amount` *             | float   | New payment instrument limit value                                                 | -          |

:::info Note
- The new limit value must be greater than or equal to the used limit (`used_limit`)
- The new limit value cannot be greater than the wallet's postpaid credit limit (`postpaid_credit_limit`)
- Only `postpaid_card` type payment instruments can have their limits updated
- Only `default` type wallets can have payment instruments with updated limits
- The payment instrument must have `active` status to have its limit updated
:::

## Response

STATUS 200

Response Body: Payment instrument limit updated

```json
{
  "payment_instrument_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "limit_amount": 3000.00,
  "payment_instrument_status": "active"
}
```

### Response Body Params

| Field                            | Type    | Description                                                                        | Characters |
|----------------------------------|---------|------------------------------------------------------------------------------------|------------|
| `payment_instrument_key` *       | uuidv4  | Unique identification key of the updated instrument in UUID v4 format             | 36         |
| `limit_amount` *                 | float   | New instrument limit value after update                                           | -          |
| `payment_instrument_status` *    | string  | Payment instrument status                                                         | **[payment_instrument_status Enumerators](#payment_instrument_status-enumerators)** |

### payment_instrument_status Enumerators

| Enumerator | Description                             |
|------------|-----------------------------------------|
| active     | Active instrument                       |
| canceled   | Canceled instrument                     |    

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | CIN000074            | Bad Request                                        | Limit amount is greater than postpaid credit limit of the wallet.                                                       | Limite é maior que o limite de crédito pós-pago da carteira.                                                           |
| 400                      | CIN000081            | Bad Request                                        | Payment instrument is not active                                                                                         | Instrumento de pagamento não está ativo                                                                                |
| 400                      | CIN000110            | Bad Request                                        | New limit amount is less than used limit                                                                                 | Novo valor do limite é menor que o valor utilizado                                                                     |
| 403                      | CIN000108            | Forbidden                                          | Wallet type payroll is not allowed for this operation                                                                    | Tipo de carteira payroll não é permitido para esta operação                                                           |
| 403                      | CIN000113            | Forbidden                                          | Payment instrument type is not allowed for this operation                                                               | Tipo de instrumento de pagamento não é permitido para esta operação                                                    |
| 404                      | CIN000007            | Wallet not Found                                   | Wallet with key: e503fa60-285e-4632-96b6-bf3ad908a23c was not found                                                    | Carteira com a chave: e503fa60-285e-4632-96b6-bf3ad908a23c não foi encontrado                                         |
| 404                      | CIN000080            | Payment Instrument Not Found                       | Payment instrument was not found                                                                                         | Instrumento de pagamento não foi encontrado                                                                            |

---

# Payment Instrument Cancellation

URL: /en/documentation/cartao_pos_pago/faturas/instrumento_de_pagamento/cancelamento_de_instrumento_de_pagamento

Payment instrument cancellation allows you to cancel an existing payment instrument, changing its status to `canceled` and canceling the associated postpaid card.

## Request

ENDPOINT /wallet/ WALLET_KEY /payment_instrument/ PAYMENT_INSTRUMENT_KEY /cancel
METHOD PATCH

### Path Parameters

| Field                        | Type   | Description                                    | Characters |
|------------------------------|--------|----------------------------------------------|------------|
| `wallet_key` *               | uuidv4 | Unique wallet key in UUID v4 format  | 36         |
| `payment_instrument_key` *   | uuidv4 | Unique payment instrument key in UUID v4 format | 36 |

:::info Note
This request does not have a request body. Cancellation is performed only through path parameters.
:::

## Response

STATUS 200

Response Body: Canceled payment instrument

```json
{
  "payment_instrument_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "payment_instrument_status": "canceled"
}
```

### Response Body Params

| Field                            | Type    | Description                                                                          | Characters |
|----------------------------------|---------|------------------------------------------------------------------------------------|------------|
| `payment_instrument_key` *       | uuidv4  | Unique identification key of the canceled instrument in UUID v4 format          | 36         |
| `payment_instrument_status` *    | string  | Instrument status after cancellation                                         | **[payment_instrument_status Enumerators](#payment_instrument_status-enumerators)** |

### payment_instrument_status Enumerators

| Enumerator | Description                               |
|------------|-----------------------------------------|
| canceled   | Canceled instrument                   |

:::tip Behavior
- The payment instrument will be moved to `canceled` status after cancellation
- The postpaid card associated with the instrument will also be canceled automatically
- The canceled instrument cannot be used for new transactions
- The canceled instrument can still be queried and listed, but will appear with `canceled` status
:::

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | CIN000081            | Bad Request                                        | Payment instrument is not active                                                                                         | Instrumento de pagamento não está ativo                                                                                |
| 400                      | CIN000100            | Bad Request                                        | Error canceling card in card service                                                                                    | Erro ao cancelar cartão no serviço de cartões                                                                           |
| 404                      | CIN000007            | Wallet not Found                                   | Wallet with key: abeca0d0-a09d-4b3b-a495-40b553422ced was not found                                                   | Carteira com a chave: abeca0d0-a09d-4b3b-a495-40b553422ced não foi encontrado                                         |
| 404                      | CIN000080            | Payment Instrument Not Found                       | Payment instrument was not found                                                                                         | Instrumento de pagamento não foi encontrado                                                                             |

---

# Search Payment Instrument Entry by Key

URL: /en/documentation/cartao_pos_pago/faturas/instrumento_de_pagamento/consulta_entrada_por_chave

The payment instrument entry search by key will return the complete details of a specific entry, including all related invoice items.

## Request

ENDPOINT /wallet/ WALLET_KEY /payment_instrument/ PAYMENT_INSTRUMENT_KEY /payment_instrument_entry/ PAYMENT_INSTRUMENT_ENTRY_KEY
METHOD GET

### Path Parameters

| Field                          | Type   | Description                                    | Characters |
|--------------------------------|--------|----------------------------------------------|------------|
| `wallet_key`                   | uuidv4 | Unique wallet key in UUID v4 format  | 36         |
| `payment_instrument_key`       | uuidv4 | Unique payment instrument key in UUID v4 format | 36 |
| `payment_instrument_entry_key` | uuidv4 | Unique entry key in UUID v4 format    | 36         |

## Response

STATUS 200

Response Body: Payment instrument entry details

```json
{
  "payment_instrument_entry_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "payment_instrument_entry_amount": 150.00,
  "payment_instrument_entry_type": "purchase",
  "payment_instrument_entry_status": "concluded",
  "payment_instrument_entry_data": {
    "merchant_name": "Merchant Name",
    "merchant_country": "Merchant Country",
    "merchant_postal_code": "Merchant Postal Code",
    "merchant_city": "Merchant City",
    "merchant_street": "Merchant Street"
  },
  "invoice_items": [
    {
      "invoice_item_key": "3571e292-3a83-4011-904d-20ee963022ef",
      "invoice_key": "f2cad6b4-2a68-9572-99a7-2849c8d6ecf8",
      "wallet_entry_key": null,
      "payment_instrument_entry_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "installment_number": 1,
      "invoice_description": "Compra no estabelecimento XYZ",
      "amount": 150.00,
      "used_limit": 150.00,
      "invoice_item_status": "concluded",
      "invoice_item_due_date": "2024-02-15",
      "created_at": "2024-01-15T10:30:00Z"
    }
  ],
  "created_at": "2024-01-15T10:30:00Z"
}
```

### Response Body Params

| Field                                 | Type         | Description                             | Characters                                  |
|---------------------------------------|--------------|---------------------------------------|---------------------------------------------|
| `payment_instrument_entry_key` *      | uuidv4       | Unique entry identification key in uuid v4 format | 36         |
| `payment_instrument_entry_amount` *   | number       | Entry amount                      | -          |
| `payment_instrument_entry_type` *     | string       | Payment instrument entry type | **[payment_instrument_entry_type Enumerators](#payment_instrument_entry_type-enumerators)** |
| `payment_instrument_entry_status` *  | string       | Payment instrument entry status      | **[payment_instrument_entry_status Enumerators](#payment_instrument_entry_status-enumerators)** |
| `invoice_items` *                     | object array | Related invoice items          | **[invoice_item Object](#invoice_item-object)** |
| `payment_instrument_entry_data`      | object  | Additional data | **[payment_instrument_entry_data Object](#payment_instrument_entry_data-object)** |
| `created_at` *                       | string  | Creation date (ISO 8601 UTC format)                                           | -          |

### payment_instrument_entry_data Object (purchase | withdraw)

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|------------|
| `merchant_name` *          | string  | Merchant establishment name                                                 | -          |
| `merchant_country` *       | string  | Merchant establishment country                                                 | -          |
| `merchant_postal_code` *   | string  | Merchant establishment postal code                                        | -          |
| `merchant_city` *          | string  | Merchant establishment city                                               | -          |
| `merchant_street` *        | string  | Merchant establishment street                                                  | -          |

### payment_instrument_entry_data Object (postpaid_card_issuance)

| Field                           | Type    | Description                                                                          | Characters |
|---------------------------------|---------|------------------------------------------------------------------------------------|------------|
| `postpaid_card_issuance_name` * | string  | Postpaid card issuance name                                                 | -          |
| `payment_instrument_key` *      | string  | Unique payment instrument key in UUID v4 format                        | 36         |
| `postpaid_card_key` *           | string  | Unique postpaid card key in UUID v4 format                                  | 36         |

:::info Note
This entry exists only for consigned card wallet cards.
:::

### payment_instrument_entry_type Enumerators

| Enumerator              | Description                                                                         |
|-------------------------|-----------------------------------------------------------------------------------|
| purchase                | Purchase                                                                            |
| withdraw                | Withdrawal                                                                             |
| postpaid_card_issuance  | Postpaid card issuance                                                        |

### payment_instrument_entry_status Enumerators

| Enumerator              | Description                               |
|-------------------------|-----------------------------------------|
| processing_conclusion   | Entry in processing conclusion    |
| processing_cancellation | Entry in processing cancellation |
| concluded                  | Concluded entry                           |
| canceled                | Canceled entry                       |

:::info Note
The payment instrument entry can transition directly from `processing_conclusion` to `processing_cancellation` and `canceled`. In this case, no invoice item is created.
:::

### invoice_item Object

| Field                              | Type    | Description                                                                         | Characters |
|------------------------------------|---------|-----------------------------------------------------------------------------------|------------|
| `invoice_item_key` *               | uuidv4  | Unique invoice item identification key in uuid v4 format                | 36         |
| `invoice_key` *                    | uuidv4  | Unique invoice identification key in uuid v4 format                        | 36         |
| `wallet_entry_key`                 | uuidv4  | Unique wallet entry identification key in uuid v4 format          | 36         |
| `payment_instrument_entry_key`     | uuidv4  | Unique payment instrument entry identification key in uuid v4 format | 36 |
| `installment_number` *             | integer | Installment number                                                                 | -          |
| `invoice_description` *            | string  | Invoice item description                                                       | -          |
| `amount` *                         | number  | Item amount                                                                     | -          |
| `used_limit` *                     | number  | Used limit                                                                 | -          |
| `invoice_item_status` *            | string  | Invoice item status                                                          | **[invoice_item_status Enumerators](#invoice_item_status-enumerators)** |
| `invoice_item_due_date` *          | string  | Item due date (YYYY-MM-DD format)                                  | 10         |
| `created_at` *                     | string  | Creation date (ISO 8601 UTC format)                                           | -          |

### invoice_item_status Enumerators

| Enumerator | Description                               |
|------------|-----------------------------------------|
| concluded    | Concluded item (invoice to which it belongs has not been paid)   |
| canceled  | Canceled item               |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 404                      | CIN000007            | Wallet not Found                                   | Wallet with key: abeca0d0-a09d-4b3b-a495-40b553422ced was not found                                                   | Carteira com a chave: abeca0d0-a09d-4b3b-a495-40b553422ced não foi encontrado                                         |
| 404                      | CIN000017            | Payment Instrument Not Found                       | Payment instrument was not found                                                                                         | Instrumento de pagamento não foi encontrado                                                                             |
| 404                      | CIN000086            | Not Found                                          | Payment instrument entry was not found                                                                                   | Transação para instrumento de pagamento não foi encontrada                                                             |

---

# Payment Instrument Creation

URL: /en/documentation/cartao_pos_pago/faturas/instrumento_de_pagamento/criacao_de_instrumento_de_pagamento

Payment instrument creation allows registering a new payment method (such as a postpaid card) for an existing wallet.

## Request

ENDPOINT /wallet/ WALLET_KEY /payment_instrument
METHOD POST

### Path Parameters

| Field        | Type   | Description                                  | Characters |
|--------------|--------|----------------------------------------------|------------|
| `wallet_key` | uuidv4 | Unique wallet key in UUID v4 format         | 36         |

Request Body

```json
{
  "request_control_key": "f7947b9d-9be3-49d8-aca2-4b3249e5fa65",
  "owner": {
    "person_type": "natural",
    "name": "João Silva",
    "document_number": "12345678901",
    "birthdate": "1990-01-01",
    "email": "joao.silva@email.com",
    "phone": {
      "number": "99999999",
      "area_code": "11",
      "country_code": "55"
    },
    "address": {
      "street": "Rua das Flores",
      "number": "123",
      "neighborhood": "Centro",
      "postal_code": "01234567",
      "city": "São Paulo",
      "state": "SP",
      "complement": "Apto 1"
    }
  },
  "payment_instrument_type": "postpaid_card",
  "limit_amount": 2000.00,
  "postpaid_card_data": {
    "card_type": "physical",
    "card_name": "Cartão Principal",
    "printed_name": "JOAO SILVA",
    "cvv_rotation_interval_hours": 24,
    "contactless_enabled": true,
    "delivery_address": {
      "street": "Rua das Flores",
      "number": "123",
      "neighborhood": "Centro",
      "postal_code": "01234567",
      "city": "São Paulo",
      "state": "SP",
      "complement": "Apto 1"
    }
  }
}
```

### Request Body Params

| Field                        | Type    | Description                                                                        | Characters |
|------------------------------|---------|------------------------------------------------------------------------------------|------------|
| `request_control_key`    | uuidv4     | Unique request identification key used by the client.                                            | 36                                                                          |
| `owner`                      | object  | Payment instrument owner data (natural or legal person)                           | **[owner object](#owner-object)** |
| `person_key`                 | string  | Unique person identification key in UUID v4 format                                | 36         |
| `payment_instrument_type` *  | string  | Payment instrument type                                                            | **[payment_instrument_type enumerators](#payment_instrument_type-enumerators)** |
| `limit_amount`               | float  | Instrument credit limit (must be less than or equal to wallet limit)              | -          |
| `postpaid_card_data`         | object  | Postpaid card specific data                                                        | **[postpaid_card_data object](#postpaid_card_data-object)** |

:::info Conditional Fields
- **`owner`**: Required when `person_key` is not provided
- **`person_key`**: Required when `owner` is not provided
- **`postpaid_card_data`**: Required when `payment_instrument_type` is "postpaid_card"
- The fields `owner` and `person_key` are mutually exclusive
:::

:::caution Limit Validations
- The `limit_amount` **is not required**
- When provided, cannot be greater than the wallet's postpaid credit limit
- If not provided, the instrument will use the wallet's total limit
:::

### owner object

#### Natural Person (`person_type: "natural"`)

| Field                     | Type   | Description                                  | Characters |
|---------------------------|--------|----------------------------------------------|------------|
| `person_type` *           | string | Person type (must be "natural")              | -          |
| `name` *                  | string | Full name                                     | 100        |
| `document_number` *       | string | CPF (numbers only)                           | 11         |
| `birthdate` *             | string | Birth date (YYYY-MM-DD format)               | 10         |
| `email` *                 | string | Contact email                                | 254        |
| `phone` *                 | object | Contact phone                                | **[phone object](#phone-object)** |
| `address` *               | object | Complete address                             | **[address object](#address-object)** |

#### Legal Person (`person_type: "legal"`)

| Field                     | Type   | Description                                  | Characters |
|---------------------------|--------|----------------------------------------------|------------|
| `person_type` *           | string | Person type (must be "legal")                | -          |
| `name` *                  | string | Company name                                 | 100        |
| `trading_name` *          | string | Trade name                                   | 100        |
| `document_number` *       | string | CNPJ (numbers only)                          | 14         |
| `foundation_date` *       | string | Foundation date (YYYY-MM-DD format)          | 10         |
| `email` *                 | string | Contact email                                | 254        |
| `phone` *                 | object | Contact phone                                | **[phone object](#phone-object)** |
| `address` *               | object | Complete address                             | **[address object](#address-object)** |
| `legal_representatives` * | array  | List of legal representatives (natural persons)               | -          |

### phone object

| Field                     | Type   | Description                                  | Characters |
|---------------------------|--------|----------------------------------------------|------------|
| `country_code` *          | string | Country code                                 | 2-3        |
| `area_code` *             | string | Area code                                    | 2          |
| `number` *                | string | Phone number                                 | 8-9        |

### address object

| Field                     | Type   | Description                                  | Characters |
|---------------------------|--------|----------------------------------------------|------------|
| `street` *                | string | Street/avenue name                           | 500        |
| `number` *                | string | Address number                               | 10         |
| `neighborhood` *          | string | Neighborhood                                 | 100        |
| `postal_code` *           | string | Postal code (numbers only)                   | 8          |
| `city` *                  | string | City                                         | 100        |
| `state` *                 | string | State                                        | **[state enumerators](#state-enumerators)** |
| `complement`              | string | Address complement                           | 500        |

### state enumerators

| Enumerator | Description      |
|-------------|----------------|
| AC          | Acre           |
| AL          | Alagoas        |
| AM          | Amazonas       |
| AP          | Amapá          |
| BA          | Bahia          |
| CE          | Ceará          |
| DF          | Distrito Federal |
| ES          | Espírito Santo |
| GO          | Goiás          |
| MA          | Maranhão       |
| MG          | Minas Gerais    |
| MS          | Mato Grosso do Sul |
| MT          | Mato Grosso    |
| PA          | Pará           |
| PB          | Paraíba        |
| PE          | Pernambuco     |
| PI          | Piauí          |
| PR          | Paraná         |
| RJ          | Rio de Janeiro |
| RN          | Rio Grande do Norte |
| RO          | Rondônia       |
| RR          | Roraima        |
| RS          | Rio Grande do Sul |
| SC          | Santa Catarina |
| SE          | Sergipe        |
| SP          | São Paulo      |
| TO          | Tocantins      |
| EX          | Exception      |

### payment_instrument_type enumerators

| Enumerator      | Description     |
|-----------------|------------------|
| postpaid_card   | Postpaid card   |

### postpaid_card_data object

| Field                           | Type    | Description                                  | Characters |
|---------------------------------|---------|----------------------------------------------|------------|
| `card_type` *                   | string  | Card type                                    | **[card_type enumerators](#card_type-enumerators)** |
| `card_name` *                   | string  | Card name                                    | 1-50       |
| `printed_name` *                | string  | Name printed on card                         | 2-26       |
| `cvv_rotation_interval_hours`   | int  | CVV rotation interval in hours               | -          |
| `contactless_enabled`           | boolean | Enable contactless payment                   | -          |
| `delivery_address`              | object  | Card delivery address                        | **[delivery_address object](#delivery_address-object)** |

### card_type enumerators

| Enumerator | Description     |
|-------------|------------------|
| virtual     | Virtual card    |
| plastic     | Plastic card    |

:::info Conditional Fields
- **`cvv_rotation_interval_hours`**: Required for `card_type: "virtual"`. Not allowed for `card_type: "plastic"`.
- **`delivery_address`**: Not allowed for `card_type: "virtual"`. Optional for `card_type: "plastic"`, if not provided will use the `owner` address or the previously registered address for the provided `person_key`
- **`contactless_enabled`**: Not allowed for `card_type: "virtual"`, required for `card_type: "plastic"`
:::

### delivery_address object

| Field                     | Type   | Description                                  | Characters |
|---------------------------|--------|----------------------------------------------|------------|
| `street` *                | string | Street/avenue name                           | 500        |
| `number` *                | string | Address number                               | 10         |
| `neighborhood` *          | string | Neighborhood                                 | 100        |
| `postal_code` *           | string | Postal code (numbers only)                   | 8          |
| `city` *                  | string | City                                         | 100        |
| `state` *                 | string | State                                        | **[state enumerators](#state-enumerators)** |
| `complement`              | string | Address complement                           | 500        |

## Response

### Success - Instrument Created

STATUS 201

Response Body: Instrument created

```json
{
  "request_control_key": "f7947b9d-9be3-49d8-aca2-4b3249e5fa65",
  "payment_instrument_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "postpaid_card_key": "ecf87b4b-fa6e-49c0-a7f0-f2cad6b42d79",
  "owner_person_key": "f2cad6b4-2a68-9572-99a7-2849c8d6ecf8"
}
```

### Response Body Params

| Field                        | Type    | Description                                                                       | Characters |
|------------------------------|---------|-----------------------------------------------------------------------------------|------------|
| `request_control_key`        | uuidv4  | Unique request identification key used by the client.                            | 36         |
| `payment_instrument_key` *   | uuidv4  | Unique instrument identification key in uuid v4 format                           | 36         |
| `postpaid_card_key` *        | uuidv4  | Unique postpaid card identification key in uuid v4 format                        | 36         |
| `owner_person_key` *         | uuidv4  | Unique owner identification key in uuid v4 format                                | 36         |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Schema Inválido                                                                                                         |
| 404                      | CIN000062            | Not Found                                          | Person not found by person key: e51070e4-7494-468d-a20e-bf14789fa8ff                                                                            | Pessoa não encontrada para a person key: e51070e4-7494-468d-a20e-bf14789fa8ff                                                                   |
| 404                      | CIN000007            | Wallet not Found                                   | Wallet with key: abeca0d0-a09d-4b3b-a495-40b553422ced was not found                                                                             | Carteira com a chave: abeca0d0-a09d-4b3b-a495-40b553422ced não foi encontrado                                                                   |
| 400                      | CIN000073            | Bad Request                                        | Limit amount is greater than postpaid credit limit of the wallet                                                        | Limite é maior que o limite de crédito pós-pago da carteira                                                             |
| 400                      | CIN000074            | Bad Request                                        | Limit amount is greater than ccb limit of the wallet                                                                    | Limite é maior que o limite de ccb da carteira                                                                          |
| 400                      | CIN000072            | Bad Request                                        | Error while creating postpaid card in card service, try again in a few minutes                                          | Erro ao criar postpaid card no serviço de cartão, tente novamente em alguns minutos                                     |
| 400                      | CIN000067            | Bad Request                                        | Error while creating owner of the wallet. Try again in a few minutes                                                    | Erro ao criar owner da carteira. Tente novamente em alguns minutos                                                      |
| 409                      | CIN000099            | Conflict                                           | Request control key already exists.                                                                                     | Request control key já existe.                                                                                          |

---

# List Payment Instrument Entries

URL: /en/documentation/cartao_pos_pago/faturas/instrumento_de_pagamento/listar_entradas_do_instrumento_de_pagamento

The payment instrument entries listing will return all entries for a specific payment instrument that match the query parameters sent in the request.

## Request

ENDPOINT /wallet/ WALLET_KEY /payment_instrument/ PAYMENT_INSTRUMENT_KEY /payment_instrument_entries
METHOD GET

### Path Parameters

| Field                     | Type   | Description                                      | Characters |
|---------------------------|--------|--------------------------------------------------|------------|
| `wallet_key`              | uuidv4 | Wallet unique key in UUID v4 format             | 36         |
| `payment_instrument_key`  | uuidv4 | Payment instrument unique key in UUID v4 format | 36         |

### Query Parameters

| Field                                 | Type    | Description                                      | Characters |
|---------------------------------------|---------|--------------------------------------------------|------------|
| `payment_instrument_entry_type` *      | string  | Payment instrument entry type                    | **[Enumerators payment_instrument_entry_type](#enumerators-payment_instrument_entry_type)** |
| `payment_instrument_entry_status` *   | string  | Payment instrument entry status                  | **[Enumerators payment_instrument_entry_status](#enumerators-payment_instrument_entry_status)** |
| `page`                                | integer | Page number for pagination                       | -          |
| `page_size`                           | integer | Number of items per page                         | -          |

:::caution Validations
- **Pagination**: Page and size values must be valid integers
- **Page size**: Maximum of 100 items per page
:::

### Enumerators payment_instrument_entry_type

| Enumerator              | Description                                                                       |
|-------------------------|-----------------------------------------------------------------------------------|
| purchase                | Purchase                                                                          |
| withdraw                | Withdrawal                                                                        |
| postpaid_card_issuance  | Postpaid card issuance                                                            |

### Enumerators payment_instrument_entry_status

| Enumerator              | Description                               |
|-------------------------|-----------------------------------------|
| processing_conclusion   | Entry processing completion              |
| processing_cancellation | Entry processing cancellation            |
| concluded                  | Entry concluded     |
| canceled                | Entry canceled                           |

:::info Note
The payment instrument entry can transition directly from `processing_conclusion` to `processing_cancellation` and `canceled`. In this case, no invoice item is created.
:::

## Response

STATUS 200

Response Body: Payment instrument entries list

```json
{
  "data": [
    {
      "payment_instrument_entry_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "payment_instrument_entry_amount": 150.00,
      "payment_instrument_entry_type": "purchase",
      "payment_instrument_entry_status": "concluded",
      "payment_instrument_entry_data": {
        "merchant_name": "Merchant Name",
        "merchant_country": "Merchant Country",
        "merchant_postal_code": "Merchant Postal Code",
        "merchant_city": "Merchant City",
        "merchant_street": "Merchant Street"
      },
      "created_at": "2024-01-15T10:30:00Z"
    },
    {
      "payment_instrument_entry_key": "9db81efb-0ac1-5b79-0683-00b8395a9e7",
      "payment_instrument_entry_amount": 200.00,
      "payment_instrument_entry_type": "withdraw",
      "payment_instrument_entry_status": "canceled",
      "payment_instrument_entry_data": {
        "merchant_name": "Merchant Name",
        "merchant_country": "Merchant Country",
        "merchant_postal_code": "Merchant Postal Code",
        "merchant_city": "Merchant City",
        "merchant_street": "Merchant Street"
      },
      "created_at": "2024-01-14T14:45:00Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "rows_per_page": 100
  }
}
```

### Response Body Params

| Field            | Type         | Description                           | Characters                                  |
|------------------|--------------|---------------------------------------|---------------------------------------------|
| `data` *         | object array | Payment instrument entries            | **[Object payment_instrument_entry](#object-payment_instrument_entry)** |
| `pagination` *   | object       | Pagination information                | **[Object pagination](#object-pagination)** |

### Object payment_instrument_entry

| Field                                 | Type    | Description                                                                       | Characters |
|---------------------------------------|---------|-----------------------------------------------------------------------------------|------------|
| `payment_instrument_entry_key` *      | uuidv4  | Entry unique identification key in uuid v4 format                                | 36         |
| `payment_instrument_entry_amount` *   | float  | Entry amount                                                                      | -          |
| `payment_instrument_entry_type` *     | string  | Payment instrument entry type                                                     | **[Enumerators payment_instrument_entry_type](#enumerators-payment_instrument_entry_type)** |
| `payment_instrument_entry_status` *  | string  | Payment instrument entry status                                                   | **[Enumerators payment_instrument_entry_status](#enumerators-payment_instrument_entry_status)** |
| `payment_instrument_entry_data`      | object  | Additional data | **[Object payment_instrument_entry_data](#object-payment_instrument_entry_data)** |
| `created_at` *                       | string  | Creation date (ISO 8601 UTC format)                                              | -          |

### Object payment_instrument_entry_data (purchase | withdraw)

| Field                      | Type    | Description                                                                        | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|------------|
| `merchant_name` *          | string  | Merchant name                                                                     | -          |
| `merchant_country` *       | string  | Merchant country                                                                  | -          |
| `merchant_postal_code` *   | string  | Merchant postal code                                                              | -          |
| `merchant_city` *          | string  | Merchant city                                                                     | -          |
| `merchant_street` *        | string  | Merchant street                                                                   | -          |

### Object payment_instrument_entry_data (postpaid_card_issuance)

| Field                           | Type    | Description                                                                        | Characters |
|---------------------------------|---------|------------------------------------------------------------------------------------|------------|
| `postpaid_card_issuance_name` * | string  | Postpaid card issuance name                                                        | -          |
| `payment_instrument_key` *      | string  | Payment instrument unique key in UUID v4 format                                   | 36         |
| `postpaid_card_key` *           | string  | Postpaid card unique key in UUID v4 format                                        | 36         |

:::info Note
This entry exists only for payroll card wallet cards.
:::

### Object pagination

| Field                      | Type    | Description                                                                        | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------------------|
| `current_page` *           | integer | Current page                                                                      | -      |
| `rows_per_page` *          | integer | Items per page                                                                    | -      |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | CIN000069            | Bad Request                                        | Invalid integer value for page or size query string parameters                                                           | Valor inválido para parâmetros de página ou tamanho de página                                                           |
| 400                      | CIN000084            | Bad Request                                        | Invalid query payment instrument entry status                                                                           | Status de consulta de instrumento de pagamento inválido                                                                |
| 400                      | CIN000085            | Bad Request                                        | Invalid query payment instrument entry type                                                                             | Tipo de consulta de instrumento de pagamento inválido                                                                  |
| 404                      | CIN000007            | Wallet not Found                                   | Wallet with key: abeca0d0-a09d-4b3b-a495-40b553422ced was not found                                                   | Carteira com a chave: abeca0d0-a09d-4b3b-a495-40b553422ced não foi encontrado                                         |
| 404                      | CIN000017            | Payment Instrument Not Found                       | Payment instrument was not found                                                                                         | Instrumento de pagamento não foi encontrado                                                                             |

---

# List Payment Instruments

URL: /en/documentation/cartao_pos_pago/faturas/instrumento_de_pagamento/listar_instrumentos_de_pagamento

The payment instruments listing will return all payment instruments from a specific wallet that match the query parameters sent in the request.

## Request

ENDPOINT /wallet/ WALLET_KEY /payment_instruments
METHOD GET

### Path Parameters

| Field        | Type   | Description                                    | Characters |
|--------------|--------|----------------------------------------------|------------|
| `wallet_key` | uuidv4 | Unique wallet key in UUID v4 format  | 36         |

### Query Parameters

| Field                        | Type    | Description                                    | Characters |
|------------------------------|---------|----------------------------------------------|------------|
| `owner_document_number`      | string  | CPF/CNPJ of the instrument owner      | 11-14      |
| `payment_instrument_type` *  | string  | Type of payment instrument                                                  | **[Enumerators payment_instrument_type](#enumerators-payment_instrument_type)** |
| `payment_instrument_status` *| string  | Instrument status                                                             | **[Enumerators payment_instrument_status](#enumerators-payment_instrument_status)** |
| `page`                       | integer | Page number for pagination              | -          |
| `page_size`                  | integer | Number of items per page               | -          |

:::caution Validations
- **Pagination**: Page and size values must be valid integers
- **Page size**: Maximum of 100 items per page
:::

### Enumerators payment_instrument_type

| Enumerator      | Description        |
|-----------------|------------------|
| postpaid_card   | Postpaid card  |

### Enumerators payment_instrument_status

| Enumerator | Description                               |
|------------|-----------------------------------------|
| active     | Active instrument available for use |
| rejected   | Rejected instrument                   |
| canceled   | Canceled instrument                   |

## Response

STATUS 200

Response Body: List of payment instruments

```json
{
  "data": [
    {
      "request_control_key": "f7947b9d-9be3-49d8-aca2-4b3249e5fa65",
      "payment_instrument_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "postpaid_card_key": "ecf87b4b-fa6e-49c0-a7f0-f2cad6b42d79",
      "owner_person_key": "f2cad6b4-2a68-9572-99a7-2849c8d6ecf8",
      "owner_document_number": "12345678901",
      "payment_instrument_type": "postpaid_card",
      "payment_instrument_status": "active",
      "limit_amount": 2000.00,
      "used_limit": 500.00,
      "created_at": "2024-01-15T10:30:00Z"
    },
    {
      "request_control_key": "3aaad5ea-3a0f-4018-93a8-ab02f5207833",
      "payment_instrument_key": "9db81efb-0ac1-5b79-0683-00b8395a9e7",
      "postpaid_card_key": "f3dad7c5-3b79-0683-11c8-395b9e7f2cad",
      "owner_person_key": "g4ebe8d6-4c8a-1794-22d9-406c0f8g3dbe",
      "owner_document_number": "98765432100",
      "payment_instrument_type": "postpaid_card",
      "payment_instrument_status": "canceled",
      "limit_amount": 1500.00,
      "used_limit": 0.00,
      "created_at": "2024-01-14T14:45:00Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "rows_per_page": 100,
  }
}
```

### Response Body Params

| Field            | Type         | Description                             | Characters                                  |
|------------------|--------------|---------------------------------------|---------------------------------------------|
| `data` *         | object array | Payment instruments             | **[Object payment_instrument](#object-payment_instrument)**   |
| `pagination` *   | object       | Pagination information              | **[Object pagination](#object-pagination)** |

### Object payment_instrument

| Field                        | Type    | Description                                                                         | Characters |
|------------------------------|---------|-----------------------------------------------------------------------------------|------------|
| `request_control_key`        | uuidv4  | Unique identification key of the request used by the client.                   | 36         |
| `payment_instrument_key` *   | uuidv4  | Unique identification key of the instrument in uuid v4 format                   | 36         |
| `postpaid_card_key` *        | uuidv4  | Unique identification key of the postpaid card in uuid v4 format               | 36         |
| `owner_person_key` *         | uuidv4  | Unique identification key of the owner in uuid v4 format                  | 36         |
| `owner_document_number` *    | string  | CPF/CNPJ of the instrument owner                                          | 11 ou 14   |
| `payment_instrument_type` *  | string  | Type of payment instrument                                                  | **[Enumerators payment_instrument_type](#enumerators-payment_instrument_type)** |
| `payment_instrument_status` *| string  | Instrument status                                                             | **[Enumerators payment_instrument_status](#enumerators-payment_instrument_status)** |
| `limit_amount` *             | float  | Credit limit of the instrument                                                  | -          |
| `used_limit` *               | float  | Used limit of the instrument                                                   | -          |
| `created_at` *               | string  | Creation date (ISO 8601 UTC format)                                           | -          |

### Object pagination

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|--------------------------------------------------------------|
| `current_page` *           | integer | Current page                                                 | -      |
| `rows_per_page` *          | integer | Items per page                                             | -      |

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`description`                                                                                       | Description (pt-br)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | CIN000069            | Bad Request                                        | Invalid integer value for page or size query string parameters                                                           | Valor inválido para parâmetros de página ou tamanho de página                                                           |
| 400                      | CIN000070            | Bad Request                                        | Invalid query payment instrument status                                                                                 | Status de consulta de instrumento de pagamento inválido                                                                |
| 400                      | CIN000071            | Bad Request                                        | Invalid query payment instrument type                                                                                   | Tipo de consulta de instrumento de pagamento inválido                                                                  |
| 404                      | CIN000007            | Wallet not Found                                   | Wallet with key: abeca0d0-a09d-4b3b-a495-40b553422ced was not found                                                   | Carteira com a chave: abeca0d0-a09d-4b3b-a495-40b553422ced não foi encontrado                                         |

---

# Scenario simulation

URL: /en/documentation/cartao_pos_pago/faturas/instrumento_de_pagamento/simulacao_de_cenarios

This page describes how to simulate the creation and cancellation of payment instrument entries to test the transaction flow with postpaid cards. These simulations are useful for homologation and integration testing.

:::info Information
These requests simulate external transactions and return the HTTP status with the key of the created or canceled entry.
:::

## 1 - Payment instrument entry creation simulation

Simulates the creation of a payment instrument entry (transaction), such as a purchase or withdrawal made with the postpaid card. The entry will be automatically linked to invoice items according to the installment configuration.

ENDPOINT /mock/invoice/payment_instrument/ POSTPAID_CARD_KEY /payment_instrument_entry
METHOD POST

### Path Parameters

| Field                        | Type   | Description                                    | Characters |
|------------------------------|--------|----------------------------------------------|------------|
| `postpaid_card_key` *           | string  | Unique key of the postpaid card in UUID v4 format                                  | 36         |

Request Body

```json
{
    "request_control_key": "f7947b9d-9be3-49d8-aca2-4b3249e5fa65",
    "payment_instrument_entry_amount": 100.50,
    "number_of_installments": 3,
    "installment_amount": 33.50,
    "payment_instrument_entry_type": "purchase",
    "payment_instrument_entry_data": {
        "merchant_name": "Test Merchant",
        "merchant_country": "BR",
        "merchant_postal_code": "01310-100",
        "merchant_city": "São Paulo",
        "merchant_street": "Av. Paulista"
    }
}
```

### Request Body Object

| Field                                    | Type    | Description                                                                          | Max Char. |
|------------------------------------------|---------|------------------------------------------------------------------------------------|--------------|
| `request_control_key` *                  | uuidv4  | Unique identification key for the request used by the client                 | 36           |
| `payment_instrument_entry_amount` *       | float   | Total transaction amount                                                          | -            |
| `number_of_installments` *                | integer | Number of transaction installments                                                   | -            |
| `installment_amount` *                    | float   | Amount of each installment                                                             | -            |
| `payment_instrument_entry_type` *         | string  | Type of payment instrument entry                                        | **[payment_instrument_entry_type Enumerators](#payment_instrument_entry_type-enumerators)** |
| `payment_instrument_entry_data` *         | object  | Additional transaction data                                                     | **[payment_instrument_entry_data Object](#payment_instrument_entry_data-object)** |

### payment_instrument_entry_type Enumerators

| Enumerator              | Description                                                                         |
|-------------------------|-----------------------------------------------------------------------------------|
| `purchase`              | Purchase made with the card                                                    |
| `withdraw`              | Withdrawal made with the card                                                     |
| `postpaid_card_issuance`| Postpaid card issuance                                                        |

### payment_instrument_entry_data Object

| Field                      | Type    | Description                                                                          | Characters |
|----------------------------|---------|------------------------------------------------------------------------------------|------------|
| `merchant_name` *          | string  | Merchant name                                                 | -          |
| `merchant_country` *        | string  | Merchant country                                                | -          |
| `merchant_postal_code` *    | string  | Merchant postal code                                        | -          |
| `merchant_city` *           | string  | Merchant city                                               | -          |
| `merchant_street` *         | string  | Merchant street                                                  | -          |

### Response

STATUS 201

Response Body

```json
{
    "payment_instrument_entry_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6"
}
```

### Response Body Params

| Field                            | Type    | Description                                                                          | Characters |
|----------------------------------|---------|------------------------------------------------------------------------------------|------------|
| `payment_instrument_entry_key` * | uuidv4  | Unique identification key of the created entry in UUID v4 format                | 36         |

:::tip Behavior
- The simulation creates a payment instrument entry with `active` status
- The entry will be automatically linked to invoice items according to the number of installments informed
- Invoice items will be organized into invoices according to the wallet closing configuration
- The payment instrument and wallet limits will be validated before allowing entry creation
:::

## 2 - Payment instrument entry cancellation simulation

Simulates the cancellation of an existing payment instrument entry, changing its status to `canceled` and releasing the used limit.

ENDPOINT /mock/invoice/payment_instrument/ POSTPAID_CARD_KEY /payment_instrument_entry/ REQUEST_CONTROL_KEY /cancel
METHOD PATCH

### Path Parameters

| Field                        | Type   | Description                                    | Characters |
|------------------------------|--------|----------------------------------------------|------------|
| `postpaid_card_key` *           | string  | Unique key of the postpaid card in UUID v4 format                                  | 36         |
| `request_control_key` *       | uuidv4 | Unique identification key of the original request used in entry creation | 36 |

Request Body

```json
{
    "payment_instrument_entry_amount": 100.50
}
```

### Request Body Object

| Field                            | Type    | Description                                                                          | Max Char. |
|----------------------------------|---------|------------------------------------------------------------------------------------|--------------|
| `payment_instrument_entry_amount` * | float   | Cancellation amount.                                                          | -            |

### Response

STATUS 200

Response Body

```json
{
    "payment_instrument_entry_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6"
}
```

### Response Body Params

| Field                            | Type    | Description                                                                          | Characters |
|----------------------------------|---------|------------------------------------------------------------------------------------|------------|
| `payment_instrument_entry_key` * | uuidv4  | Unique identification key of the canceled entry in UUID v4 format             | 36         |

:::tip Behavior
- **Open invoices**: Cancellations in open invoices release the limit immediately and remove the amount from the invoice
- **Closed invoices**: Cancellations in closed invoices create chargebacks that will appear in the `invoice_payments_chargebacks` field when used in the next invoice
:::

---

# Wallet Webhooks

URL: /en/documentation/cartao_pos_pago/faturas/webhooks/carteira

:::danger Attention!
QI Tech webhooks should not be mapped in a restrictive way. 
Additional fields may be included in webhook payloads returned by our APIs.
:::

:::info Webhook Resending
You can check and resend webhooks by following the detailed instructions in the documentation: [Webhook Resending](/documentation/notificacoes/reenvio_de_notificacoes).
:::

## Introduction

After creating a wallet (`wallet`) within our system, webhooks will be sent with the following statuses:

| Enumerator                    | Translation            | Description                                                |
|-------------------------------|------------------------|------------------------------------------------------------|
|  active                       | active                 | Active wallet available for use                            |
|  rejected                     | rejected               | Wallet rejected in KYC analysis                           |

:::info Information
The timeout for our webhook response is 10 seconds.
:::

## Examples
----

### Opening confirmation

Webhook Body

```json
{
	"webhook_type": "baas.invoice.wallet",
	"webhook_datetime": "2024-08-13T21:35:55.679Z",
	"data": {
		"wallet_key": "fd86d9b1-2a5e-4e03-9a59-a043c7632c97",
		"owner_person_key": "ecf87b4b-fa6e-49c0-a7f0-f2cad6b42d79",
		"wallet_status": "active"
	}
}
```

### Webhook Fields

| Field              | Type    | Description                                                                       | Characters |
|--------------------|---------|-----------------------------------------------------------------------------------|------------|
| wallet_key         | string  | Unique wallet identification key in uuid v4 format                               | 36         |
| owner_person_key   | string  | Unique identification key of the wallet owner in uuid v4 format                  | 36         |
| wallet_status      | string  | Wallet status                                                                     | **[wallet_status Enumerators](#wallet_status-enumerators)** |

### wallet_status Enumerators

| Enumerator | Description                                                                       |
|------------|-----------------------------------------------------------------------------------|
| active     | Active wallet available for use                                                   |
| rejected   | Wallet rejected in KYC analysis                                                  |

---

# Wallet Entry Webhooks

URL: /en/documentation/cartao_pos_pago/faturas/webhooks/entrada_da_carteira

:::danger Attention!
QI Tech webhooks should not be mapped restrictively. 
Additional fields may be included in the webhook payloads returned by our APIs.
:::

:::info Webhook Resending
You can consult and resend webhooks following the detailed instructions in the documentation: [Webhook Resending](/documentation/notificacoes/reenvio_de_notificacoes).
:::

## Introduction

After creating a wallet entry (`wallet_entry`) within our system, webhooks will be sent with the following status:

| Enumerator                    | Translation               | Description                                                  |
|-------------------------------|------------------------|------------------------------------------------------------|
|  concluded                       | completed                  | Wallet entry completed            |

:::info Information
The timeout for our webhook response is 10 seconds.
:::

## Examples
----

### Creation confirmation

Webhook Body

```json
{
	"webhook_type": "baas.invoice.wallet_entry",
	"webhook_datetime": "2024-08-13T21:35:55.679Z",
	"data": {
		"wallet_key": "ecf87b4b-fa6e-49c0-a7f0-f2cad6b42d79",
		"wallet_entry_key": "fd86d9b1-2a5e-4e03-9a59-a043c7632c97",
        "wallet_entry_amount": 150.00,
		"wallet_entry_type": "revolving_credit",
		"wallet_entry_status": "concluded"
	}
}
```

### Webhook Fields

| Field                    | Type    | Description                                                                         | Characters |
|-------------------------|---------|-----------------------------------------------------------------------------------|------------|
| wallet_key              | string  | Unique wallet identification key in uuid v4 format                       | 36         |
| wallet_entry_key        | string  | Unique wallet entry identification key in uuid v4 format            | 36         |
| wallet_entry_amount     | number  | Wallet entry amount                                                       | -          |
| wallet_entry_type       | string  | Wallet entry type                                                       | **[wallet_entry_type Enumerators](#enumeradores-wallet_entry_type)** |
| wallet_entry_status     | string  | Wallet entry status                                                     | **[wallet_entry_status Enumerators](#enumeradores-wallet_entry_status)** |

### wallet_entry_type Enumerators

| Enumerator        | Description                                                                         |
|-------------------|-----------------------------------------------------------------------------------|
| revolving_credit  | Revolving credit                                                                  |
| payroll_withdraw  | Payroll withdrawal                                                                    |
| payroll_overdue   | Payroll overdue                                                                   |

:::info Wallet Entry Types
- **`revolving_credit`**: Credit amounts made available to the customer
- **`payroll_withdraw`**: Debt generated by withdrawing from the limit that will be deducted monthly from INSS
- **`payroll_overdue`**: Debt generated by non-payment of the invoice that will also be deducted monthly from INSS
:::

### wallet_entry_status Enumerators

| Enumerator | Description                                                                         |
|------------|-----------------------------------------------------------------------------------|
| concluded     | Wallet entry completed                                   |

---

# Payment Instrument Entry Webhooks

URL: /en/documentation/cartao_pos_pago/faturas/webhooks/entrada_do_instrumento_de_pagamento

:::danger Warning!
QI Tech webhooks should not be mapped restrictively. 
Additional fields may be included in the webhook payloads returned by our APIs.
:::

:::info Webhook Resending
You can query and resend webhooks by following the detailed instructions in the documentation: [Webhook Resending](/documentation/notificacoes/reenvio_de_notificacoes).
:::

## Introduction

After creating a payment instrument entry (`payment_instrument_entry`) within our system, webhooks will be sent with the following statuses:

| Enumerator                    | Translation               | Description                                                  |
|-------------------------------|------------------------|------------------------------------------------------------|
|  processing_conclusion        | processing completion   | Payment instrument entry in completion processing |
|  processing_cancellation      | processing cancellation | Payment instrument entry in cancellation processing |
|  concluded                       | concluded                  | Payment instrument entry concluded |
|  canceled                     | canceled              | Payment instrument entry was canceled          |

:::info Information
The timeout for our webhook responses is 10 seconds.
:::

## Examples
----

### Creation confirmation

Webhook Body

```json
{
	"webhook_type": "baas.invoice.payment_instrument_entry",
	"webhook_datetime": "2024-08-13T21:35:55.679Z",
	"data": {
		"payment_instrument_key": "ecf87b4b-fa6e-49c0-a7f0-f2cad6b42d79",
		"payment_instrument_entry_key": "fd86d9b1-2a5e-4e03-9a59-a043c7632c97",
		"payment_instrument_entry_amount": 150.00,
		"payment_instrument_entry_type": "purchase",
		"payment_instrument_entry_status": "concluded"
	}
}
```

### Cancellation confirmation

Webhook Body

```json
{
	"webhook_type": "baas.invoice.payment_instrument_entry",
	"webhook_datetime": "2024-08-13T21:35:55.679Z",
	"data": {
		"payment_instrument_key": "ecf87b4b-fa6e-49c0-a7f0-f2cad6b42d79",
		"payment_instrument_entry_key": "fd86d9b1-2a5e-4e03-9a59-a043c7632c97",
		"payment_instrument_entry_amount": 150.00,
		"payment_instrument_entry_type": "purchase",
		"payment_instrument_entry_status": "canceled"
	}
}
```

### Processing activation

Webhook Body

```json
{
	"webhook_type": "baas.invoice.payment_instrument_entry",
	"webhook_datetime": "2024-08-13T21:35:55.679Z",
	"data": {
		"payment_instrument_key": "ecf87b4b-fa6e-49c0-a7f0-f2cad6b42d79",
		"payment_instrument_entry_key": "fd86d9b1-2a5e-4e03-9a59-a043c7632c97",
		"payment_instrument_entry_amount": 150.00,
		"payment_instrument_entry_type": "purchase",
		"payment_instrument_entry_status": "processing_conclusion"
	}
}
```

### Processing cancellation

Webhook Body

```json
{
	"webhook_type": "baas.invoice.payment_instrument_entry",
	"webhook_datetime": "2024-08-13T21:35:55.679Z",
	"data": {
		"payment_instrument_key": "ecf87b4b-fa6e-49c0-a7f0-f2cad6b42d79",
		"payment_instrument_entry_key": "fd86d9b1-2a5e-4e03-9a59-a043c7632c97",
		"payment_instrument_entry_amount": 150.00,
		"payment_instrument_entry_type": "purchase",
		"payment_instrument_entry_status": "processing_cancellation"
	}
}
```

### Webhook Fields

| Field                              | Type    | Description                                                                         | Characters |
|------------------------------------|---------|-----------------------------------------------------------------------------------|------------|
| payment_instrument_key             | string  | Unique identification key for the payment instrument in uuid v4 format       | 36         |
| payment_instrument_entry_key       | string  | Unique identification key for the payment instrument entry in uuid v4 format | 36         |
| payment_instrument_entry_amount   | number  | Payment instrument entry amount                                      | -          |
| payment_instrument_entry_type     | string  | Payment instrument entry type                                        | **[payment_instrument_entry_type Enumerators](#enumeradores-payment_instrument_entry_type)** |
| payment_instrument_entry_status   | string  | Payment instrument entry status                                      | **[payment_instrument_entry_status Enumerators](#enumeradores-payment_instrument_entry_status)** |

### payment_instrument_entry_type Enumerators

| Enumerator              | Description                                                                         |
|-------------------------|-----------------------------------------------------------------------------------|
| purchase                | Purchase                                                                            |
| withdrawal              | Withdrawal                                                                             |
| postpaid_card_issuance  | Postpaid card issuance                                                        |

### payment_instrument_entry_status Enumerators

| Enumerator              | Description                                                                         |
|-------------------------|-----------------------------------------------------------------------------------|
| processing_conclusion   | Payment instrument entry in completion processing                  |
| processing_cancellation | Payment instrument entry in cancellation processing              |
| concluded                  | Payment instrument entry concluded                  |
| canceled                | Payment instrument entry was canceled                                 |

:::info Note
The payment instrument entry can transition directly from `processing_conclusion` to `processing_cancellation` and `canceled`. In this case, no invoice item is created.
:::

---

# Invoice Webhooks

URL: /en/documentation/cartao_pos_pago/faturas/webhooks/fatura

:::danger Attention!
QI Tech webhooks should not be mapped in a restrictive way. 
Additional fields may be included in the webhook payloads returned by our APIs.
:::

:::info Webhook Resending
You can check and resend webhooks by following the detailed instructions in the documentation: [Webhook Resending](/documentation/notificacoes/reenvio_de_notificacoes).
:::

## Introduction

After closing an invoice (`invoice`) within our system, a webhook will be sent with the invoice status change:

| Enumerator                    | Translation            | Description                                                |
|-------------------------------|------------------------|------------------------------------------------------------|
|  processing_closing           | processing closure     | Invoice being processed for closure                        |
|  processing_expiration       | processing expiration  | Invoice being processed for expiration                     |
|  closed                       | closed                 | Invoice closed, no longer receives items and payments have been processed |
|  processing_payment              | awaiting payment       | Invoice awaiting payment (applicable only for `payroll` type wallets when there is remaining amount to be paid) |
|  paid                         | paid                   | Invoice paid                                               |

:::info Information
The timeout for our webhook response is 10 seconds.
:::

## Examples

### Invoice closure confirmation

Webhook Body

```json
{
	"webhook_type": "baas.invoice.invoice_status_change",
	"webhook_datetime": "2024-08-13T21:35:55.679Z",
	"data": {
		"invoice_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
		"total_amount": 350.00,
		"paid_amount": 0.00,
		"closing_date": "2024-01-31",
		"due_date": "2024-02-15",
		"invoice_status": "closed"
	}
}
```

### Invoice awaiting payment (payroll wallet)

Webhook Body

```json
{
	"webhook_type": "baas.invoice.invoice_status_change",
	"webhook_datetime": "2024-08-13T21:35:55.679Z",
	"data": {
		"invoice_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
		"total_amount": 350.00,
		"paid_amount": 0.00,
		"closing_date": "2024-01-31",
		"due_date": "2024-02-15",
		"invoice_status": "processing_payment"
	}
}
```

### Webhook Fields

| Field           | Type    | Description                                                                       | Characters |
|-----------------|---------|-----------------------------------------------------------------------------------|------------|
| invoice_key     | string  | Unique invoice identification key in uuid v4 format                              | 36         |
| total_amount    | number  | Total invoice amount                                                              | -          |
| paid_amount     | number  | Paid invoice amount                                                               | -          |
| closing_date    | string  | Invoice closing date (YYYY-MM-DD format)                                         | 10         |
| due_date        | string  | Invoice due date (YYYY-MM-DD format)                                             | 10         |
| invoice_status  | string  | Invoice status                                                                   | **[invoice_status Enumerators](#invoice_status-enumerators)** |

### invoice_status Enumerators

| Enumerator            | Description                                                                       |
|-----------------------|-----------------------------------------------------------------------------------|
| processing_closing    | Invoice being processed for closure                                               |
| processing_expiration | Invoice being processed for expiration                                            |
| closed                | Invoice closed, no longer receives items and payments have been processed        |
| processing_payment       | Invoice awaiting payment (applicable only for `payroll` type wallets when there is remaining amount to be paid) |
| paid                  | Invoice paid                                                                      |

---

# Invoice Payment Webhooks

URL: /en/documentation/cartao_pos_pago/faturas/webhooks/pagamento_da_fatura

:::danger Attention!
QI Tech webhooks should not be mapped restrictively. 
Additional fields may be included in the webhook payloads returned by our APIs.
:::

:::info Webhook Resending
You can check and resend webhooks by following the detailed instructions in the documentation: [Webhook Resending](/documentation/notificacoes/reenvio_de_notificacoes).
:::

## Introduction

After a status change of an invoice payment (`invoice_payment`) within our system, a webhook will be sent with the payment status change:

| Enumerator                    | Translation            | Description                                                |
|-------------------------------|------------------------|------------------------------------------------------------|
|  processing_payment              | awaiting payment       | Invoice payment awaiting payment                           |
|  paid                         | paid                   | Invoice payment paid                                       |

:::info Information
The timeout for response to our webhooks is 10 seconds.
:::

## Examples

### Invoice payment (payroll_discount)

Webhook Body

```json
{
	"webhook_type": "baas.invoice.invoice_payment_status_change",
	"webhook_datetime": "2024-08-13T21:35:55.679Z",
	"data": {
		"wallet_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
		"invoice_payment_key": "3571e292-3a83-4011-904d-20ee963022ef",
		"total_amount": 350.00,
		"paid_amount": 0.00,
		"payment_date": "2024-02-15",
		"invoice_payment_type": "payroll_discount",
		"invoice_payment_status": "processing_payment"
	}
}
```

### Invoice payment (bank_slip)

Webhook Body

```json
{
	"webhook_type": "baas.invoice.invoice_payment_status_change",
	"webhook_datetime": "2024-08-13T21:35:55.679Z",
	"data": {
		"wallet_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
		"invoice_payment_key": "3571e292-3a83-4011-904d-20ee963022ef",
		"total_amount": 350.00,
		"paid_amount": 0.00,
		"payment_date": "2024-02-15",
		"invoice_payment_type": "bank_slip",
		"invoice_payment_status": "processing_payment"
	}
}
```

### Webhook Fields

| Field                   | Type    | Description                                                                       | Characters |
|-------------------------|---------|-----------------------------------------------------------------------------------|------------|
| wallet_key              | string  | Unique wallet identification key in uuid v4 format                               | 36         |
| invoice_payment_key     | string  | Unique invoice payment identification key in uuid v4 format                      | 36         |
| total_amount            | number  | Total amount of the invoice payment                                               | -          |
| paid_amount             | number  | Paid amount of the invoice payment                                                | -          |
| payment_date            | string  | Payment date (YYYY-MM-DD format)                                                 | 10         |
| invoice_payment_type    | string  | Invoice payment type                                                              | **[invoice_payment_type Enumerators](#enumerators-invoice_payment_type)** |
| invoice_payment_status  | string  | Invoice payment status                                                            | **[invoice_payment_status Enumerators](#enumerators-invoice_payment_status)** |

### invoice_payment_type Enumerators

| Enumerator        | Description                                                                       |
|-------------------|-----------------------------------------------------------------------------------|
| bank_slip         | Bank slip                                                                        |
| payroll_discount  | Payroll discount                                                                 |

### invoice_payment_status Enumerators

| Enumerator            | Description                                                                       |
|-----------------------|-----------------------------------------------------------------------------------|
| processing_payment       | Invoice payment awaiting payment                                                 |
| paid                  | Invoice payment paid                                                              |

:::info Note
- For `payroll_discount` type payments: the payment is created at the time of invoice closing with `processing_payment` status and the discount is requested from INSS. When the discount payment is made, the status changes to `paid`.
- For `bank_slip` type payments: the payment is created with `processing_payment` status when we receive the bank slip payment notice. At the time of bank slip settlement, the status changes to `paid`. The payment can be created with `paid` status directly if a payment notice is not received.
:::

---

# Introduction

URL: /en/documentation/cartao_pos_pago/introducao

## Postpaid Card

The APIs for postpaid card issuance offer QI Tech partners a simple and efficient way to allow their clients to request and issue Postpaid Cards, both **physical** and **virtual**.

At QI Tech, we provide our partners the opportunity to become sub-issuers. Through our APIs, they can offer their own clients the possibility to issue postpaid cards, creating a complete solution for banking and financial services.

To better understand our system, we present an overview of how the postpaid card ecosystem works. However, it's important to note that, as with all our APIs, service activation must be performed with our team, and **[calls are authenticated](/documentation/primeiros_passos/teste_de_autenticacao)**.

The postpaid card is a card linked to a credit line that allows the holder to make transactions, with payment being made later. Unlike prepaid cards, postpaid cards do not require the account balance to be pre-loaded. The user can make purchases and pay later, according to the approved credit limit.

Transactions made through the postpaid card will be charged on the holder's invoice, with a specific deadline for payment. If payment is not made by the due date, the holder may be subject to financial charges, such as interest and fees.

## Program

To issue a postpaid card, the partner needs to have a program configured in the integration with QI Tech. The program defines the rules and parameters necessary for card issuance in compliance with card brands, such as VISA.

Here are some important information about the program:

* **Program type** - Refers to the card usage modality. In this case, it's the Postpaid modality.
* **Card brand** - We use the VISA brand for issued cards.
* **Card layout** - Refers to the card design, both for the physical and virtual model, which will be displayed in the graphical interface.

:::caution Attention
To configure a new postpaid card program, it's necessary to involve QI Tech's commercial and implementation teams.
:::

## Wallet

To issue postpaid credit cards, it's necessary to first create a **wallet** that organizes the client's invoice. The wallet functions as an "account" where all cards and billing configurations are stored.

:::info What is a Wallet
The **wallet** is like the client's account where all cards and invoices are stored:

- **One wallet = invoice**: Each wallet corresponds to the invoice of a specific client (identified by CPF/CNPJ)
- **Multiple payment methods**: The same wallet can have different payment instruments (cards, PIX, etc.)
- **Separate instruments**: After creating the wallet, it will be necessary to separately create the payment instruments (credit cards, limits, etc.)
- **Centralized management**: The wallet centralizes all operations and configurations related to that client
:::

For more details on wallet creation, consult the **[complete wallet creation documentation](/documentation/cartao_pos_pago/faturas/carteira/criacao_de_carteira)**.

## Issuance Flow

To issue postpaid credit cards, the process follows a logical sequence that begins with creating a wallet for the client. This wallet functions as an "account" to organize all cards and billing configurations.

After creating the wallet, it's necessary to create a **payment instrument** of type `postpaid_card`. This instrument is responsible for managing all transactions and purchases made with the card. When creating the instrument, a physical or virtual card is automatically created as requested.

:::info Payment Instrument
The payment instrument of type `postpaid_card`:
- **Centralizes transactions**: All purchases made with the card are linked to this instrument for management
- **Automatically creates the card**: When creating the instrument, a physical or virtual card is automatically created as requested
- **Manages lifecycle**: Monitoring the status and operations of the card is done through the **[postpaid card management endpoints](/documentation/cartao_pos_pago/cartao/busca/buscar_cartao_por_chave)**
:::

To create the payment instrument, consult the **[PaymentInstrument creation documentation](/documentation/cartao_pos_pago/faturas/instrumento_de_pagamento/criacao_de_instrumento_de_pagamento)**.

### Limit Configuration

The wallet has a global credit limit that defines the maximum ceiling available for use. **Individual limits for payment instruments can also be configured**.

:::info How Limits Work
- **Wallet limit**: Defines the maximum credit ceiling available for use
- **Instrument limits**: Each instrument can have its own configured limit, as long as it's smaller than the wallet's
- **Practical example**: A wallet with a R$ 100 limit can have two instruments with limits of R$ 100 and R$ 80, but when the usage of both instruments reaches R$ 100, no more purchases will be possible
- **Real-time validation**: Both the instrument limit and wallet limit are validated before allowing a new transaction
:::

:::info Limits in Payroll Wallets
Wallets of type `payroll` have two distinct limits:
- **`postpaid_credit_limit`**: Postpaid credit limit for purchases and transactions with the card
- **`payroll_withdraw_limit`**: Specific limit for payroll withdrawals (salary/benefit), which are automatically deducted from the client's payroll

Both limits appear in the `wallet_limits` list of the wallet and function independently, allowing the client to have one limit for card purchases and another specific limit for benefit withdrawals.
:::

### Card Management and Monitoring

With the wallet and payment instrument configured, the card (physical or virtual) is automatically created and becomes available for use. The wallet centralizes all billing information, allowing monitoring of transactions, payments, and interest and penalty configurations.

Monitoring the card's status and lifecycle can be performed through the **[postpaid card management endpoints](/documentation/cartao_pos_pago/cartao/busca/buscar_cartao_por_chave)**, which allow monitoring all stages of the card's lifecycle, from creation to write-off or cancellation.

## Wallet Entries

**Wallet entries** are debts that are registered in the client's wallet. These debts can be of different types:

- **Revolving credit (`revolving_credit`)**: Credit amounts made available to the client
- **Payroll withdrawal (`payroll_withdraw`)**: Debt generated by withdrawal of the limit that will be deducted monthly from INSS
- **Payroll overdue (`payroll_overdue`)**: Debt generated by non-payment of the invoice that will also be deducted monthly from INSS

:::info How Wallet Entries Work
- **One entry = one debt**: Each entry is a specific debt
- **Becomes item in invoice**: Each installment automatically becomes an item in the invoice
- **Organized in invoice**: Items are organized in invoices
- **Everything centralized**: All debts are organized in the wallet
:::

For more information and consultation of wallet entries, consult the **[Wallet Entries documentation](/documentation/cartao_pos_pago/faturas/carteira/listar_entradas_da_carteira)**.

:::tip Wallet Entry Webhooks
To monitor wallet entry status changes in real time, use the **[Wallet Entry webhooks](/documentation/cartao_pos_pago/faturas/webhooks/wallet_entry)**.
:::

## Payment Instrument Entries

**Payment instrument entries** are transactions made with the card. Each purchase or withdrawal becomes an entry:

- **Card transactions**: Purchases made with the postpaid card
- **Card withdrawals**: Withdrawals made with the postpaid card
- **Other operations**: Other transactions related to the instrument

:::info How Payment Instrument Entries Work
- **Automatic linking**: Each entry is automatically linked to an **invoice item**
- **Invoice organization**: Invoice items are organized in **invoices**
- **Automatic invoice creation**: When a new transaction is created, the system automatically creates the necessary invoices to accommodate all transaction installments, based on the wallet's closure configuration
:::

:::warning Important about Cancellations
- **Open invoices**: Cancellations in open invoices immediately free up the limit and remove the amount from the invoice
- **Closed invoices**: Cancellations in closed invoices create chargebacks that will appear in the `invoice_payments_chargebacks` field and will be used in the next invoice
:::

For more information and consultation of payment instrument entries, consult the **[Payment Instrument Entries documentation](/documentation/cartao_pos_pago/faturas/instrumento_de_pagamento/listar_entradas_do_instrumento_de_pagamento)**.

:::tip Payment Instrument Entry Webhooks
To monitor payment instrument entry status changes in real time, use the **[Payment Instrument Entry webhooks](/documentation/cartao_pos_pago/faturas/webhooks/payment_instruction_entry)**.
:::

## Invoices

**Invoices** are created automatically as needed for invoice items. They function as containers that group related items:

- **Automatic creation**: They are created automatically when necessary, based on the wallet's closure configuration
- **Initial status**: All start with status `opened`
- **Receives new items**: New purchases and transactions go to open invoices
- **Automatic closure**: Invoices are automatically closed one day after their closure date

:::info Invoice Lifecycle
- **`opened`**: Open invoice, receiving new items. In this status, new invoice items can be added to the invoice
- **`closed`**: Closed invoice, no longer receives items. In this status, the invoice has been processed and the invoice slip is updated with the new amount and due date. The slip can be consulted through the slip endpoints
- **`processing_payment`**: Awaiting payment. Applied only for `payroll` type wallets when there is only remaining amount to be paid with the benefit after payroll deduction
:::

:::info Payroll Wallets
For `payroll` type wallets, closure works in a special way:
- **Payroll deduction**: INSS deduction amounts are grouped in an invoice payment of type `payroll_discount` that will be automatically deducted from payroll. This payment is created with status `processing_payment` when the deduction is requested from INSS and changes to `paid` when the deduction payment is made
- **Updated slip**: When there is remaining amount after payroll deduction, the invoice slip is updated with the new amount. The slip can be consulted, but the invoice payment of type `bank_slip` will only be created when the slip is effectively paid
- **Processing_payment status**: If there is no amount to be paid via slip, the invoice remains with status `processing_payment` until the benefit payment is made
:::

For more information and consultation of invoices, consult the **[Invoices documentation](/documentation/cartao_pos_pago/faturas/fatura/listar_faturas)**.

## Invoice Items

**Invoice items** are automatically created for each installment of entries (wallet entry or payment instrument entry). They represent the individual components that make up an invoice:

- **Debt installments**: Each installment of a wallet entry generates an invoice item
- **Individual transactions**: Each installment of a payment instrument entry generates an invoice item
- **Invoice breakdown**: Allow granular control of each item

:::info Invoice Item Characteristics
- **Mandatory linking**: Every invoice item must be linked to an **invoice**
- **Traceability**: Maintain reference to the original entry
- **Individual status**: Each item can have its own status (pending, paid, canceled)
- **Detailed values**: Contain specific information such as amount, limit used, and amount paid
:::

For more information and consultation of invoice items, consult the **[Invoice Items documentation](/documentation/cartao_pos_pago/faturas/fatura/consulta_por_chave)**.

---

# Manual BaaS - Conta Digital

URL: /en/documentation/casos_de_uso/manual_baas

:::warning Aviso
Antes de iniciar o processo de abertura de conta, é de responsabilidade do parceiro realizar as análises de KYC e Prevenção a Fraude.
::: 

:::danger Atenção!
Os webhooks da QI Tech não devem ser mapeadas de forma restrita. 
Campos adicionais podem ser incluídos aos payloads dos webhooks retornados em nossas APIs.
:::

:::info Reenvio de Webhooks
Você pode consultar e reenviar webhooks seguindo as instruções detalhadas na documentação: [Reenvio de Webhooks](/documentation/notificacoes/reenvio_de_notificacoes).
:::

Para isso, deve ser utilizado o endpoint de análise descrito em /onboarding.

## 1 - Criando uma Conta

### 1.1. Upload de documentos

Antes da abertura da conta deve ser realizado o upload dos documentos da empresa. Seguem listas de documentos exigidos para cada tipo de empresa:

Para S.A.'s:

- Estatuto Social.

- Ata de Eleição dos Representantes Legais da empresa.

- Procuração (caso aplicável).

- Documento com foto de cada representante legal ou procurador.

Para os demais casos:

- Contrato social.

- Procuração (caso aplicável).

- Documento com foto de cada representante legal ou procurador.Os documentos devem ser compactados em um arquivo “.zip” e enviados através do endpoint de upload de documentos ().

#### **Response**

ENDPOINT /upload
MÉTODO POST

Response Body

```json
{
    "document_key": "cd639c4a-2279-468a-a047-59865b8159ed",
    "document_md5": "8f5bef84cb07dc047017c0d304dbb6b8",
    "url": "https://storage.googleapis.com/sandbox-doc-api/documents/cd639c4a-2279-468a-a047-59865b8159ed/identificacao_teste.pdf"
}
```

:::caution IMPORTANTE
Guarde essa **_“document_key”_**, pois ela será necessária na etapa da criação da conta.
::: 

### 1.2. Criação da conta PJ

#### **Request**

ENDPOINT /account
MÉTODO POST

Request Body

```json
{
	"account_owner": {
		"annual_revenue_amount": 180000,
		"address": {
			"city": "Limeira",
			"complement": "complemento",
			"neighborhood": "Vila Cidade Jardim",
			"number": "662",
			"postal_code": "13480290",
			"state": "SP",
			"street": "Avenida Campinas"
		},
		"cnae_code": "4721-1/02",
        "company_statute": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d",
		"company_document_number": "09080702000105",
		"company_type": "ltda",
		"email": "padaria@vovolucia.com.br",
		"foundation_date": "1950-08-21",
		"annual_revenue_amount": "1000000.00",
		"name": "VOVO LUCIA CONVENIENCIA LTDA",
		"person_type": "legal",
		"phone": {
			"area_code": "19",
			"country_code": "55",
			"number": "988888888"
		},
		"trading_name": "Empadaria Vovo Lucia",
		"company_representatives": [{
				"address": {
					"city": "Recife",
					"complement": null,
					"neighborhood": "Fundão",
					"number": "137",
					"postal_code": "52221110",
					"state": "PE",
					"street": "Rua Camapuã"
				},
				"birth_date": "1972-02-02",
				"document_identification_number": "339122924",
                "document_identification": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d",
				"email": "marcos.alves@yopmail.com",
				"individual_document_number": "08531309069",
				"is_pep": false,
				"final_beneficiary": true,
				"marital_status": "single",
				"mother_name": "Sueli Isadora Alves",
				"name": "Marcos Felipe Henrique Alves",
				"nationality": "Brasileira",
				"person_type": "natural",
				"phone": {
					"area_code": "88",
					"country_code": "55",
					"number": "995924634"
				}
			},
			{
				"person_type": "natural",
				"name": "Juliana Tereza Bernardes",
				"mother_name": "Maria Mariane",
				"birth_date": "1990-05-06",
				"profession": "Deputada",
				"nationality": "Brasileira",
				"marital_status": "single",
				"is_pep": false,
				"final_beneficiary": true,
				"individual_document_number": "97564480084",
				"document_identification_number": "232479719",
                "document_identification": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d",
				"email": "juliana.tereza@yopmail.com",
				"phone": {
					"country_code": "55",
					"area_code": "11",
					"number": "912821359"
				},
				"address": {
					"street": "Passagem Mariana",
					"state": "PA",
					"city": "Ananindeua",
					"neighborhood": "Águas Lindas",
					"number": "660",
					"postal_code": "67118003",
					"complement": "complemento"
				}
			}
		]
	},
	"allowed_user": {
		"email": "juliana.tereza@yopmail.com",
		"individual_document_number": "97564480084",
		"name": "Juliana Tereza Bernardes",
		"person_type": "natural",
		"phone": {
			"country_code": "55",
			"area_code": "11",
			"number": "912828135"
		}
	},
	"signed_contract": {
        "document_key": "4d7f4e29-4b58-4905-9a69-b1f9215263f5",
        "signatures": [
            {
                "authenticity": {
                    "timestamp": "1970-01-01T00:00:01.080100Z",
                    "facial_recognition_key": "79003de0-2590-455d-9b73-426b8ca284eb",
                    "lang": "-35.8916627",
                    "lat": "-7.2226067",
                    "ip_address": "177.51.1.000",
                    "session_id": "jdifj329842"
                },
                "signer": {
                    "name": "IVANILDO DE SENA LIMA",
                    "email": "teste@gmail.com",
                    "phone": {
                        "country_code": "055",
                        "area_code": "11",
                        "number": "999999999"
                    },
                    "document_number": "99999999999"
                },
                "authentication_type": "opt-in"
            }
        ]
    }
}

```

**“account_owner”:** Os dados da empresa devem ser enviados neste objeto.

“***account_owner.company_statute***”: A “***document_key***” retornada no endpoint de upload de documentos, no momento do upload do “.zip” dos documentos societários da empresa, deve ser enviada neste campo.

“***account_owner.company_representatives***”: A lista com os dados dos representantes legais da empresa deve ser enviada neste objeto. Deve ser enviado, no mínimo, os representantes legais, suficientes para representar legalmente a empresa conforme seu respectivo estatuto/contrato social. A validação dos poderes de cada representante legal enviado fica a cargo do parceiro.

“***account_owner.company_representatives.document_identification***”: A “***document_key***” retornada no endpoint de upload de documentos, no momento do upload do “.zip” do documento com foto do representante, deve ser enviada neste campo. 

“***allowed_user***”: Neste campo devem ser enviados os dados de um dos representantes legais da empresa enviado no objeto “***account_owner.company_representatives***”. Este usuário será o usuário administrador da conta e possuirá poderes de movimentação sobre a conta e também poderes para adicionar novos usuários administradores. O SMS/e-mail de confirmação tanto para movimentação quanto adição de novos usuários será enviado para essa pessoa. 

:::info
O usuário com permissão de administrador possui plenos poderes sobre a conta (mediante autenticação de 2 fatores, via SMS ou e-mail). Sendo assim, este usuário deve possuir permissão legal para movimentá-la  segundo o contrato/estatuto social da empresa. A validação dos poderes de um usuário administrador fica a cargo do parceiro.
:::

### 1.2.1 Assinatura do Termo de Abertura de Conta
	No payload de abertura de conta deverá ser enviado o campo `signature_contract` que deverá conter as informações de device scan do momento em que o usuário (Titular da conta ou usuário master) realiza o aceite do termo de abertura de cont

### Objeto signed_contract 
| Campo | Tipo   | Descrição        | Caracteres    |
|-------|--------|------------------|---------------|
| **document_key** * | uuidv4 | Chave única de identificação do documento do **Termo de Abertura de Conta** ou **Contrato de Conta Escrow**. (A DOCUMENT_KEY é retornada na resposta do endpoint de [Upload de documentos](./upload_de_documentos)) | 36            |
| **signatures** *   | list   | Dados de assinatura do documento enviado. Cada item da lista, corresponde a um assinante do documento.      | [Objeto signatures](#objeto-signatures) |

### Objeto signatures
| Campo | Tipo       | Descrição         | Caracteres        |
|-------|------------|-------------------|-------------------|
| **authenticity** * | object     | Conjunto de dados que evidenciam a assinatura eletrônica realizada pelo assinante. | [Objeto authenticity](#objeto-authenticity) |
| **signer** * | object     | Objeto contendo os dados de um dos assinantes do documento.           | [Objeto signer](#objeto-signer)|
| **authentication_type** * | enumerator | Tipo de assinatura. Sempre será "**opt-in**"| "**opt-in**"                   |

### Objeto authenticity
| Campo | Tipo   | Descrição               | Caracteres |
|-------|--------|-------------------------|------------|
| **timestamp** *            | string | Data e hora do momento da assinatura do documento.                | 27         |
| **facial_recognition_key** | uuidv4 | Chave única de identificação da foto da selfie do titular da conta. (A DOCUMENT_KEY é retornada na resposta do endpoint de [Upload de documentos](./upload_de_documentos)) | 36         |
| **lang**                   | string | Coordenada de longitude da geolocalização do assinante capturada no momento da assinatura.                  | -          |
| **lat**                    | string | Coordenada de latitude da geolocalização do assinante capturada no momento da assinatura.                   | -          |
| **ip_address**             | string | Endereço IP do dispositivo do assinante.     | -          |
| **session_id**             | string | ID da seção do assinante no momento da assinatura.                | -          |

### Objeto signer
| Campo                 | Tipo   | Descrição                                 | Caracteres                        |
|-----------------------|--------|-------------------------------------------|-----------------------------------|
| **name** *            | string | Nome do assinante.                        | -                                 |
| **email** *           | string | Email do assinante.                       | -                                 |
| **phone** *           | object | Objeto com dados do telefone do assinante | **[Objeto phone](#objeto-phone)** |
| **document_number** * | string | CPF do assinante.                         | 11                                |

### Objeto phone 

| Campo | Descrição | Exemplo |  Máx. Caracteres | 
| --- | --- | --- | --- | 
|`country_code` *| string | Código DDI do telefone (https://ddi.guiamais.com.br/) | 3 | 
| `area_code` *| string | Código DDD do telefone (https://ddd.guiamais.com.br/) | 2 |
| `number` *| string |Número de telefone (apenas números) |  10 |

        **Response**

- MÉTODO POST
- ENDPOINT /account

Response Body

```json

{
	"data": {
		"account_info": {
			"account_branch": "0001",
			"account_digit": "2",
			"account_number": "2359934",
			"financial_institution_code": "329"
		},
		"account_owner": {
			"document_number": "09080702000105",
			"name": "VOVO LUCIA CONVENIENCIA LTDA"
		},
		"allowed_user": {
			"document_number": "97564480084",
			"name": "Juliana Tereza Bernardes"
		}
	},
	"event_datetime": "2022-09-02 22:39:10",
	"key": "\<UUID PROPOSAL-KEY\>",
	"status": "pending_kyc_analysis",
	"webhook_type": "account"
}

```

:::info IMPORTANTE
IMPORTANTE: a “***key***” retornada nesta resposta é a PROPOSAL-KEY do pedido de abertura da conta. Ela deve ser armazenada para leitura do webhook de abertura da conta.
::: 

A resposta da solicitação de abertura de conta sempre retornará o status “***pending_kyc_analysis***”.

Um número de conta será reservado para esse cliente, porém a conta ainda estará pendente de análise de KYC por parte da QI Tech. Neste momento, a conta não estará aberta e não poderá receber ou enviar recursos.

### 1.3. Criação da conta PF

        **Request**

- ENDPOINT /account
- MÉTODO POST

Request Body

```json
{
	"account_owner": {
		"address": {
			"street": "Avenida Sargento Geraldo Sant'Ana",
			"number": "1100",
			"neighborhood": "Jardim Taquaral",
			"city": "São Paulo",
			"state": "SP",
			"postal_code": "04674225"
		},
		"phone": {
			"country_code": "55",
			"number": "912828135",
			"area_code": "11"
		},
		"email": "juliana.tereza@yopmail.com",
		"name": "Juliana Tereza Bernardes",
		"person_type": "natural",
		"nationality": "Brasil",
		"birth_date": "1993-08-02",
		"mother_name": "Patricia Monica Diaz Bascur Tieppo",
		"is_pep": false,
		"individual_document_number": "97564480084",
		"document_identification": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d",
		"document_identification_type": "cnh",
        "revenue_amount": 1000,
        "profession": "autonomo"
	},
	"signed_contract": {
        "document_key": "4d7f4e29-4b58-4905-9a69-b1f9215263f5",
        "signatures": [
            {
                "authenticity": {
                    "timestamp": "1970-01-01T00:00:01.080100Z",
                    "facial_recognition_key": "79003de0-2590-455d-9b73-426b8ca284eb",
                    "lang": "-35.8916627",
                    "lat": "-7.2226067",
                    "ip_address": "177.51.1.000",
                    "session_id": "jdifj329842"
                },
                "signer": {
                    "name": "IVANILDO DE SENA LIMA",
                    "email": "teste@gmail.com",
                    "phone": {
                        "country_code": "055",
                        "area_code": "11",
                        "number": "999999999"
                    },
                    "document_number": "99999999999"
                },
                "authentication_type": "opt-in"
            }
        ]
    }
}
```

**“account_owner”:** Os dados da pessoa física titular da conta devem ser enviados neste objeto.

**“account_owner.document_identification”:** A “document_key” retornada no endpoint de upload de documentos.

#### 1.3.1. Forma de envio do documento de identificação

Na abertura da conta PF, podem ser enviados dois tipos de documento (***document_identification_type***): **cnh** ou **rg**.

O documento de identificação pode ser enviado nos formatos “**.pdf**”, “**.png**” e “**.jpeg**”.

##### 1.3.1.1. Envio de documento de identificação do tipo CNH

Caso o documento seja enviado em 2 arquivos, sendo que, a frente do documento consta em um arquivo e o verso em outro, os seguintes campos devem ser infomado no objeto ***account_owner*** do endpoint ***/account*** (**1.2.2.**):

Request Body

```json

		"document_identification": "\<DOCUMENT-KEY DA FRENTE DO DOCUMENTO\>",
		"document_identification_back": "\<DOCUMENT-KEY DA VERSO DO DOCUMENTO\>",
		"document_identification_type": "cnh",
```

Caso o documento seja enviado em 1 arquivo, contendo a frente e verso do documento no mesmo arquivo (**foto do documento ou cnh digital**), os seguintes campos devem ser infomado no objeto account_owner do endpoint ***/account*** (**1.2.2.**):
Request Body

```json
		"document_identification": "\<DOCUMENT-KEY DA FRENTE DO DOCUMENTO\>",
		"document_identification_type": "cnh",
```

##### 1.3.1.2. Envio de documento de identificação do tipo RG 

Para o tipo de documento RG, sempre devem ser enviados 2 arquivos, um contendo a frente do documento e outro com o verso do documento. Para este caso os seguintes campos devem ser infomados no objeto account_owner do endpoint /account (1.2.2.):

Request Body

```json
		"document_identification": "\<DOCUMENT-KEY DA FRENTE DO DOCUMENTO\>",
		"document_identification_back": "\<DOCUMENT-KEY DA VERSO DO DOCUMENTO\>",
		"document_identification_type": "rg",

```

        **Response**

- MÉTODO POST
- ENDPOINT /account

Response Body

```json

{
	"data": {
		"account_info": {
			"account_branch": "0001",
			"account_digit": "2",
			"account_number": "2359934",
			"financial_institution_code": "329"
		},
		"account_owner": {
            "document_number": "97564480084",
			"name": "Juliana Tereza Bernardes"
		}
	},
	"event_datetime": "2022-09-02 22:39:10",
	"key": "\<UUID PROPOSAL-KEY\>",
	"status": "pending_kyc_analysis",
	"webhook_type": "account"
}
```

:::info IMPORTANTE
**IMPORTANTE:** a “***key***” retornada nesta resposta é a **PROPOSAL-KEY** do pedido de abertura da conta. Ela deve ser armazenada para leitura do webhook de abertura da conta.
:::

A resposta da solicitação de abertura de conta sempre retornará o status “***pending_kyc_analysis***”.
Um número de conta será reservado para esse cliente, porém a conta ainda estará pendente de análise de KYC por parte da QI Tech. Neste momento, a conta não estará aberta e não poderá receber ou enviar recursos.

:::info
Para simular situações de aprovação, reprovação e analise manual pode ser utilizado o primeiro digito do CPF/CNPJ do owner da conta:

- 0 à 7 -> Análise Manual

- 8 -> Reprovação Automática

- 9 -> Aprovação Automática
:::

Após a conclusão da análise de KYC/PLD pela QI Tech, será enviado um webhook de abertura da conta, conforme abaixo:

        **Webhook**

- WEBHOOK_TYPE account
- STATUS Account Opened

Response Body

```json

{
	"data": {
		"account_info": {
			"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
			"account_digit": "2",
			"account_branch": "0001",
			"account_number": "2359934",
			"financial_institution_code": "329"
		},
		"allowed_user": {
			"name": "Juliana Tereza Bernardes",
			"document_number": "97564480084"
		},
		"account_owner": {
			"name": "VOVO LUCIA CONVENIENCIA LTDA",
			"document_number": "09080702000105"
		}
	},
	"event_datetime": "2022-09-02 22:39:39",
	"key": "\<UUID PROPOSAL-KEY\>",
	"status": "account_opened",
	"webhook_type": "account"
}
```

Neste momento será retornada “account_key” da conta e ela estará pronta para utilização.

Caso a conta não passe no processo de KYC/PLD, será enviado um webhook de conta rejeitada:

        **Webhook**

- WEBHOOK_TYPE account
- STATUS Account Rejected

Response Body

```json

{
	"data": {
		"account_info": {
			"account_digit": "2",
			"account_branch": "0001",
			"account_number": "2359934",
			"financial_institution_code": "329"
		},
		"allowed_user": {
			"name": "Juliana Tereza Bernardes",
			"document_number": "97564480084"
		},
		"account_owner": {
			"name": "VOVO LUCIA CONVENIENCIA LTDA",
			"document_number": "09080702000105"
		}
	},
	"event_datetime": "2022-09-02 22:39:39",
	"key": "\<UUID PROPOSAL-KEY\>",
	"status": "account_rejected",
	"webhook_type": "account"
}
```

:::caution Atenção

A propriedade **allowed_user** retornada apenas nos webhooks de abertura de conta de PJ, em caso de PF temos apenas a propriedade de **account_info** e **account_owner** sendo retornadas dentro do objeto de **data**.

:::

#### 1.3.2 Assinatura do Termo de Abertura de Conta
	No payload de abertura de conta deverá ser enviado o campo `signature_contract` que deverá conter as informações de device scan do momento em que o usuário (Titular da conta ou usuário master) realiza o aceite do termo de abertura de cont

### Objeto signed_contract 
| Campo | Tipo   | Descrição        | Caracteres    |
|-------|--------|------------------|---------------|
| **document_key** * | uuidv4 | Chave única de identificação do documento do **Termo de Abertura de Conta** ou **Contrato de Conta Escrow**. (A DOCUMENT_KEY é retornada na resposta do endpoint de [Upload de documentos](./upload_de_documentos)) | 36            |
| **signatures** *   | list   | Dados de assinatura do documento enviado. Cada item da lista, corresponde a um assinante do documento.      | [Objeto signatures](#objeto-signatures) |

### Objeto signatures
| Campo | Tipo       | Descrição         | Caracteres        |
|-------|------------|-------------------|-------------------|
| **authenticity** * | object     | Conjunto de dados que evidenciam a assinatura eletrônica realizada pelo assinante. | [Objeto authenticity](#objeto-authenticity) |
| **signer** * | object     | Objeto contendo os dados de um dos assinantes do documento.           | [Objeto signer](#objeto-signer)|
| **authentication_type** * | enumerator | Tipo de assinatura. Sempre será "**opt-in**"| "**opt-in**"                   |

### Objeto authenticity
| Campo | Tipo   | Descrição               | Caracteres |
|-------|--------|-------------------------|------------|
| **timestamp** *            | string | Data e hora do momento da assinatura do documento.                | 27         |
| **facial_recognition_key** | uuidv4 | Chave única de identificação da foto da selfie do titular da conta. (A DOCUMENT_KEY é retornada na resposta do endpoint de [Upload de documentos](./upload_de_documentos)) | 36         |
| **lang**                   | string | Coordenada de longitude da geolocalização do assinante capturada no momento da assinatura.                  | -          |
| **lat**                    | string | Coordenada de latitude da geolocalização do assinante capturada no momento da assinatura.                   | -          |
| **ip_address**             | string | Endereço IP do dispositivo do assinante.     | -          |
| **session_id**             | string | ID da seção do assinante no momento da assinatura.                | -          |

### Objeto signer
| Campo                 | Tipo   | Descrição                                 | Caracteres                        |
|-----------------------|--------|-------------------------------------------|-----------------------------------|
| **name** *            | string | Nome do assinante.                        | -                                 |
| **email** *           | string | Email do assinante.                       | -                                 |
| **phone** *           | object | Objeto com dados do telefone do assinante | **[Objeto phone](#objeto-phone)** |
| **document_number** * | string | CPF do assinante.                         | 11                                |

### Objeto phone 

| Campo | Descrição | Exemplo |  Máx. Caracteres | 
| --- | --- | --- | --- | 
|`country_code` *| string | Código DDI do telefone (https://ddi.guiamais.com.br/) | 3 | 
| `area_code` *| string | Código DDD do telefone (https://ddd.guiamais.com.br/) | 2 |
| `number` *| string |Número de telefone (apenas números) |  10 |

### 1.4. Recuperando dados da conta

        **Request**

- ENDPOINT /account
- MÉTODO GET
- PARAMETERS account_type[checking], owner_name, account_number, owner_document_number, account_status[opened, closed, blocked], page, page_size

        ***Response:***

Response Body

```json

{
	"data": [
		{
			"account_block_reason": null,
			"account_branch": "0001",
			"account_credentials": [{
					"account_id": 3395,
					"created_at": "2022-09-02T22:39:39",
					"credential_type": {
						"created_at": "2019-06-18T13:19:30",
						"enumerator": "observer",
						"id": 3,
						"translation_path": "account.CredentialType.observer"
					},
					"credential_type_id": 3,
					"id": 3244,
					"is_active": true,
					"person_key": "bffded45-5fcf-4d13-9d2a-566a0af338cc",
					"updated_at": null
				},
				{
					"account_id": 3395,
					"created_at": "2022-09-02T22:39:39",
					"credential_type": {
						"created_at": "2019-06-18T13:19:30",
						"enumerator": "requester",
						"id": 2,
						"translation_path": "account.CredentialType.requester"
					},
					"credential_type_id": 2,
					"id": 3245,
					"is_active": true,
					"person_key": "ef48fbe4-267b-45c1-9049-75345c075486",
					"updated_at": null
				}
			],
			"account_digit": "2",
			"account_documents": [],
			"account_events": [{
				"account_id": 3395,
				"created_at": "2022-09-02T22:39:39",
				"id": 5132,
				"new_account_status": {
					"created_at": "2019-10-11T18:58:31",
					"enumerator": "opened",
					"id": 1,
					"translation_path": "account.AccountStatus.opened"
				},
				"new_account_status_id": 1,
				"old_account_status": null,
				"old_account_status_id": null
			}],
			"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
			"account_name": "Default",
			"account_number": "2359934",
			"account_status": {
				"created_at": "2019-10-11T18:58:31",
				"enumerator": "opened",
				"translation_path": "account.AccountStatus.opened"
			},
			"account_type": {
				"created_at": "2019-03-15T13:09:15",
				"enumerator": "checking",
				"translation_path": "account.AccountType.checking"
			},
			"automatic_transfer_management_status": {
				"created_at": "2022-10-27T13:48:18",
				"enumerator": "master"
			},
			"automatic_transfers": [],
			"balance": 0,
			"blocked_balance": 0,
			"blocked_balance_events": [],
			"created_at": "2022-09-02T22:39:39",
			"destinations": [],
			"fee": 0,
			"internal_webhooks": [],
			"investment_available_amount": 0,
			"investment_configuration": null,
			"is_system_account": false,
			"owner_document_number": "09080702000105",
			"owner_name": "VOVO LUCIA CONVENIENCIA LTDA",
			"owner_person_key": "bffded45-5fcf-4d13-9d2a-566a0af338cc",
			"permitted_person_keys": [
				"bffded45-5fcf-4d13-9d2a-566a0af338cc",
				"bffded45-5fcf-4d13-9d2a-566a0af338cc",
				"ef48fbe4-267b-45c1-9049-75345c075486"
			],
			"requester_key": "ef48fbe4-267b-45c1-9049-75345c075486",
			"requester_name": "Requester Name Sandbox",
			"setup_fee": null,
			"transactional_limit": null,
			"webhook_enabled": true
		}, ...
	],
	"pagination": {
		"current_page": 1,
		"next_page": null,
		"rows_per_page": 100,
		"total_pages": 1,
		"total_rows": 8
	}
}
```

:::info
Os campos mais pertinentes da resposta da consulta dos dados da conta são: **account_branch**, **account_digit**, **account_key**, **account_number**, **balance**, **owner_document_number**, **owner_name**, **owner_person_key**.
:::

## 2 - Transferência PIX

### 2.1. Realizar Transferência PIX

Para realizar um PIX é necessário realizar três chamadas:

1. Criação do pedido de transferência: /baas/pix_transfer

2. Solicitação de token de validação de transferência: /baas/token_request

3. Aprovação da transferência: /baas/movement_validation

:::info
Uma transferência PIX pode ser realizada utilizando dois payloads distintos: **chave PIX** ou **dados bancários**. 
:::

### **2.1.1. Criação do pedido de transferência**
### Transferência utilizando uma chave PIX (CPF, CNPJ, E-mail, Celular ou chave aleatória)

- ENDPOINT /baas/pix_transfer
- MÉTODO POST

Request Body

```json
{
    "pix_transfer_type": "key",
    "source_account": {
        "account_branch": "0001",
        "account_digit": "2",
        "account_number": "2359934",
        "owner_document_number": "09080702000105"
    },
    "pix_key": "65322181032",
    "transaction_amount": 45,
    "requester_document_identification": "09080702000105"
}

```

:::info
A “**pix_key**” pode ser um **CPF**, **CNPJ**, **E-mail**, **Celular** ou uma **Chave Aleatória (UUID)**, seguindo as seguintes formatações:

**CPF:** Número inteiro com 11 dígitos.

**CNPJ:** Número inteiro com 14 dígitos.

**E-mail:** Texto contendo ao menos um “@”.

**Celular:** Texto contendo os seguintes valores: “+55” + “DDD do celular“ + “Número Inteiro do Celular com no mínimo 8 e no máximo 9 dígitos”. Ex: “+5511987654321“.

**Chave Aleatória:** UUID.
:::

### Transferência utilizando dados da Conta Bancária (PIX Manual)

- ENDPOINT /baas/pix_transfer
- MÉTODO POST

Request Body

```json

{
    "pix_transfer_type": "manual",
    "source_account": {
        "account_branch": "0001",
        "account_digit": "2",
        "account_number": "2359934",
        "owner_document_number": "09080702000105"
    },
    "target_account": {
          "account_branch": "0001",
          "account_digit": "3",
          "account_number": "12345678",
          "owner_document_number": "32402502000135",
          "owner_name": "Qi Tech",
          "account_type": "checking_account",
          "ispb": "32402502"
     },
    "transaction_amount": 45
}

```

Utilizando o PIX Manual é necessário informar o ISPB da instituição destino. Este dado é utilizado, pois existem instituições de pagamento que recebem PIX, porém não possuem código de banco. O ISPB é a base do CNPJ da instituição. Para ter acesso à lista completa de ISPB’s de cada instituição participante do PIX, basta utilizar o endpoint de consulta em nossa documentação: https://docs.qitech.com.br/reference/161-consulta-de-institui%C3%A7%C3%B5es-financeiras

Response Body

```json
{
	"data": {
		"end_to_end_id": "E3240250220221120012039U3OKZZMW8",
		"fee_amount": 1,
		"pix_message": null,
		"pix_transfer_key": "cea836b5-b02e-4f94-b1e2-4d575671c33d",
		"source_account": {
			"account_brach": "0001",
			"account_digit": "2",
			"account_number": "2359934",
			"account_type": "checking",
			"owner_document_number": "09080702000105",
			"owner_name": "VOVO LUCIA CONVENIENCIA LTDA"
		},
		"target_account": {
			"document_number": "***.221.81*-**",
			"financial_institution": "BANCO ORIGINAL S.A."
		},
		"transaction_amount": 45,
		"transfer_purpose": "transfer"
	},
	"event_datetime": "2022-09-02 22:20:47",
	"operation_key": "86d80cf4-430b-4e16-910a-41798810ddcf",
	"status": "pending_approval"
}
```

:::info Possíveis status da solicitação de transferência/pagamento via PIX: 

**pending_approval:** transferência pendente de aprovação pelo usuário administrador da conta (“***allowed_user***”)

**sent:** transferência enviada
:::

:::caution Atenção
O campo **end_to_end_id** retornado deve ser amarzenado e enviado no momento da aprovação da transação. É ELE QUEM GARANTE 
:::

Após realizar a primeira chamada de “***/baas/pix_transfer***”, é necessário solicitar o token para aprovar a transação. Para aprovar a transferência PIX, é necessário utilizar a “***pix_transfer_key***” retornada na solicitação de transferência e solicitar a geração de um token que será enviado ao usuário administrador da conta para aprovação (“**allowed_user**”).

### **2.1.2. Solicitação de token de validação de transferência:**

- ENDPOINT /baas/token_request
- MÉTODO POST

Request Body

```json
{
    "contact_type": "sms",
    "agent_document_number": "97564480084",
    "movement_payload": {
        "pix_transfer_key": "cea836b5-b02e-4f94-b1e2-4d575671c33d",
        "approver_document_number": "97564480084"
    }
}

```

:::info
**contact_type:** é o método de autenticação de dois fatores que será utilizado no momento da aprovação da transferência, podendo ser via E-mail (“email”) ou SMS (“sms”).
:::

:::info
**approver_document_number:** Deve ser informado o CPF do usuário administrador que realizará a aprovação da transferência PIX.
:::

:::info
**agent_document_number:** neste campo pode ser informado o CPF do usuário master que receberá o token para aprovação de 2 fatores da transação.
:::

A última chamada para concluir a transferência será a do “**/baas/movement_validation**” e o Token enviado deve ser informado no momento da aprovação da transferência PIX. A validade do Token é de **2 minutos**. 

O usuário administrador deve inserir na aplicação do parceiro o token recebido via E-mail ou SMS.

### **2.1.3. Aprovação da transferência:**

- ENDPOINT /baas/movement_validation
- MÉTODO POST

Request Body

```json
{
    "token": "248358",
    "movement_payload": {
        "pix_transfer_key": "cea836b5-b02e-4f94-b1e2-4d575671c33d",
        "approver_document_number": "97564480084"
    }
}

```

Reponse Body

```json

{
	"authentication_code": "287c4478a1adcd6e820e654ac1b1edf2",
	"event_datetime": "2022-09-02 23:00:07",
	"operation_key": "05283f8e-b9c0-47ff-a06f-9626be710f69",
	"pix_transaction": {
		"end_to_end_id": "E3240250220221120012039U3OKZZMW8",
		"fee_amount": 1,
		"pix_message": null,
		"pix_transfer_key": "cea836b5-b02e-4f94-b1e2-4d575671c33d",
		"pix_transfer_status": "sent",
		"pix_transfer_type": "key",
		"source_account": {
			"account_branch": "0001",
			"account_digit": "2",
			"account_number": "2359934"
		},
		"target_account": {
			"document_number": "***.221.81*-**",
			"financial_institution": "BANCO ORIGINAL S.A."
		},
		"transaction_key": "d2ba3817-26d7-4957-ab82-24f78d910a8a",
		"transfer_amount": 45
	},
	"status": "sent"
}

```

STATUS 422

Response Body

```json
{
  "data": "{\"title\": \"Pending Transfer\", \"description\": \"The transaction (<END TO END ID DO PIX>) could not be completed and is pending confirmation.\", \"translation\": \"Não foi possível concluir a transação (<END TO END ID DO PIX>) e ela está pendente de confirmação\", \"code\": \"PXT000072\"}"
}

```

:::danger HTTP Error 422
Caso seja retornado **http error 422**, a solicitação de Pix **não deve ser retentada**. É preciso checar o status da solicitação de transferência Pix através de um GET na rota [/baas/pix/pix_transfer](/documentation/pix/pesquisar_por_transferencia_pix_de_saida).
:::

### 2.2. Webhook de Efetivação de um PIX

#### **Webhook**

- WEBHOOK_TYPE account_transaction
- SOURCE_SUB_TYPE pix_withdrawal

Response Body

```json

{
  "key": "508ebbba-0b1d-41f6-b9a2-975a4c2e925e",
  "data": {
    "amount": -45,
    "origin": {
      "name": "PIX",
      "branch": "0001",
      "document": "32402502000135",
      "account_key": "3d0e7d50-e898-49f3-b23b-05353c8a3c72",
      "account_digit": "3",
      "account_number": "00003"
    },
    "timestamp": "2023-01-05T18:16:03.395863",
    "description": "237 0001 1017372-2 ***.221.81*-** BANCO BRADESCO S.A.",
    "destination": {
      "name": "Default",
      "branch": "0001",
      "document": "23426525852",
      "account_key": "508ebbba-0b1d-41f6-b9a2-975a4c2e925e",
      "account_digit": "0",
      "account_number": "7058818"
    },
    "reference_key": "aafbf4bc-58eb-45fd-899c-af44f68dfd60",
    "reference_type": "pix_outgoing",
    "account_balance": 99359.15,
    "source_sub_type": "pix_withdrawal",
    "transaction_key": "3e37a0a9-d6d2-4474-8bff-5448e446c225",
    "source_sub_type_str": "Transferência de PIX"
  },
  "datetime": "2023-01-05T18:16:03.395863",
  "webhook_type": "account_transaction"
}
```

### 2.3. Webhook de Cobrança de fee de PIX

        **Webhook**

- WEBHOOK_TYPE account_transaction
- SOURCE_SUB_TYPE pix_fee

Response Body

```json
{
  "key": "508ebbba-0b1d-41f6-b9a2-975a4c2e925e",
  "data": {
    "amount": -0.85,
    "origin": {
      "name": "Fee Account",
      "branch": "0001",
      "document": "32402502000135",
      "account_key": "3679ffd0-d52e-4492-b11c-b11c655047d3",
      "account_digit": "8",
      "account_number": "00005"
    },
    "timestamp": "2023-01-05T18:16:03.554624",
    "description": "237 0001 1017372-2 ***.221.81*-** BANCO BRADESCO S.A.",
    "destination": {
      "name": "Default",
      "branch": "0001",
      "document": "23426525852",
      "account_key": "508ebbba-0b1d-41f6-b9a2-975a4c2e925e",
      "account_digit": "0",
      "account_number": "7058818"
    },
    "reference_key": "aafbf4bc-58eb-45fd-899c-af44f68dfd60",
    "reference_type": "pix_outgoing",
    "account_balance": 99358.3,
    "source_sub_type": "pix_fee",
    "transaction_key": "53c7421b-1340-4625-b383-b94d350ff9b2",
    "source_sub_type_str": "Tarifa de PIX"
  },
  "datetime": "2023-01-05T18:16:03.554624",
  "webhook_type": "account_transaction"
}
```

### 2.4. Chargeback Pix

Um Chargeback Pix (Estorno) é realizado em 3 etapas:

- 1 - Iniciação do Chargeback Pix: /baas/pix_transfer
- 2 - Solicitação do token de autorização do Chargeback Pix: /baas/token_request
- 3 - Aprovação do Chargeback Pix: /baas/movement_validation

#### 2.4.1. Iniciando Chargeback Pix

##### Request

ENDPOINT /baas/pix_transfer
MÉTODO POST

Request Body

```json
{
    "is_chargeback": true,
    "pix_transfer_key": "a180f2fb-0c7e-4708-b6a0-8d231770132e",
    "chargeback_amount": 100.46,
    "chargeback_message": "Mensagem de devolução"
}
```

:::info
A _**pix_transfer_key**_ é a chave do Pix que creditou a conta na QI, retornada via Webhook de _**account_transaction**_.

O _**chargeback_amount**_ deve ser menor ou igual ao valor do Pix que creditou a conta na QI.
:::

##### Response

ENDPOINT /baas/pix_transfer
MÉTODO POST

Response Body

```json
{
    "data": {
        "pix_transfer_key": "7a71e1f7-d8d1-4cf0-9243-c0b3837a3d26",
        "pix_transfer_status": "pending_approval",
        "pix_transfer_type": "chargeback",
        "target_account": {
            "document_number": "***45762***",
            "financial_institution": "ITAÚ UNIBANCO S.A."
        },
        "transfer_amount": 100.46
    },
    "event_datetime": "2023-04-28 18:19:30",
    "operation_key": "ab895342-988d-4d20-ba71-f82a7b9aad1b",
    "status": "pending_approval"
}
```

:::info
A _**pix_transfer_key**_ retornada na chamada é a chave de referência do Chargeback Pix que deverá ser aprovado.
:::

#### 2.4.2. Solicitação do token de autorização do Chargeback Pix

ENDPOINT /bass/token_request
MÉTODO POST

Request Body

```json
{
    "contact_type": "email",
    "movement_payload": {
        "pix_transfer_key": "7a71e1f7-d8d1-4cf0-9243-c0b3837a3d26",
        "approver_document_number": "97564480084"
    }
}
```

#### 2.4.3. Aprovação do Chargeback Pix

ENDPOINT /bass/movement_validation
MÉTODO POST

Request Body

```json
{
    "contact_type": "email",
    "movement_payload": {
        "pix_transfer_key": "7a71e1f7-d8d1-4cf0-9243-c0b3837a3d26",
        "approver_document_number": "97564480084"
    }
}
```

## 3 - Transferência TED

:::info
As transferências TED só podem ser realizadas em dias úteis das **7:00** às **17:00**.
:::

### 3.1. Realizar Transferência TED

Para realizar uma transferência via TED é necessário realizar a seguinte chamada: 

1. Solicitação de token de validação de transferência: /baas/token_request

2. Aprovação da transferência: /baas/movement_validation

        **Request**

- ENDPOINT /baas/token_request
- MÉTODO POST

Request Body

```json
{
	"contact_type": "sms",
	"agent_document_number": "97564480084",
	"movement_payload": {
		"source_account": {
			"account_branch": "0001",
			"account_number": "9477323",
			"account_digit": "0",
			"owner_document_number": "38299588000107"
		},
		"target_account": {
			"financial_institution_code": "341",
			"account_branch": "0001",
			"account_number": "4311337",
			"account_digit": "1",
			"owner_document_number": "21669721019",
			"owner_name": "Nome do Titular da Conta Destino"
		},
		"transaction_amount": 8.86
	}
}
```

O Token enviado deve ser informado no momento da aprovação da transferência TED, e o “***movement_payload***” deve ser o mesmo informado no momento da solicitação do Token.

        **Request**

- ENDPOINT /baas/movement_validation
- MÉTODO POST

Request Body

```json
{
	"token": "329329",
	"agent_document_number": "99999999999",
	"movement_payload": {
		"source_account": {
			"account_branch": "0001",
			"account_number": "0000000",
			"account_digit": "0",
			"owner_document_number": "99999999000107"
		},
		"target_account": {
			"financial_institution_code": "341",
			"account_branch": "0001",
			"account_number": "0000000",
			"account_digit": "1",
			"owner_document_number": "999999999",
			"owner_name": "Nome do Titular da Conta Destino"
		},
		"transaction_amount": 8.86,
        "approver_document_number": "999999999"
	}
}
```

        **Response**

- MÉTODO POST
- ENDPOINT /baas/movement_validation

Response Body

```json

{
	"authentication_code": "e8f0fffaeb4ebad2df0417194fe6a9e5",
	"origin_key": "d07f77f9-f157-4c35-a26b-567cba59e385",
	"pdf_encoded_string": "\<BASE 64 DO COMPROVANTE\>",
	"source_account": {
		"account_branch": "0001",
		"account_digit": "2",
		"account_number": "2359934",
		"financial_institution_compe_number": 329,
		"financial_institution_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"owner_document_number": "09080702000105",
		"owner_document_number_formatted": "09.080.702/0001-05",
		"owner_name": "VOVO LUCIA CONVENIENCIA LTDA"
	},
	"source_subtype": "withdrawal",
	"source_subtype_translation_ptbr": "Transferência",
	"target_account": {
		"account_branch": "0001",
		"account_digit": "1",
		"account_number": "81156",
		"account_type": "checking_account",
		"account_type_str": "Conta Corrente",
		"financial_institution_compe_number": "001",
		"financial_institution_name": "Banco do Brasil S.A.",
		"owner_document_number": "10932327656",
		"owner_document_number_formatted": "109.323.276-56",
		"owner_name": "Lucas de Jesus Clarim"
	},
	"transacted_at": "2022-09-02 14:39:56",
	"transacted_at_br": "2022-09-02 11:39:56",
	"transacted_at_br_formatted": "21/11/2022, 11:39:56",
	"transacted_at_formatted": "21/11/2022, 14:39:56",
	"transaction_amount": 550,
	"transaction_amount_formatted": "R$ 550,00",
	"transaction_key": "32ac0781-f292-4172-b58f-3310102e6fb9"
}
```

:::info
O campo de “***transacted_at***“ estão em formato UTC.
:::

:::info
A “***transaction_key***“ será utilizada posteriormente para solicitação do comprovante de transferência.
:::

### 3.2. Efetivação de uma TED

        **Webhook**

- WEBHOOK_TYPE account_transaction
- SOURCE_SUB_TYPE withdrawal

Response Body

```json
{
  "key": "508ebbba-0b1d-41f6-b9a2-975a4c2e925e",
  "data": {
    "amount": -550,
    "origin": {
      "name": "TED",
      "branch": "0001",
      "document": "32402502000135",
      "account_key": "23a4a2c8-9d82-4ebe-a90d-44fe8d839ec0",
      "account_digit": "7",
      "account_number": "00001"
    },
    "timestamp": "2023-01-05T07:35:37.127502",
    "description": "001 0001 81156-1 32.402.502/0001-35 - QI Tech",
    "destination": {
      "name": "Default",
      "branch": "0001",
      "document": "23426525852",
      "account_key": "508ebbba-0b1d-41f6-b9a2-975a4c2e925e",
      "account_digit": "0",
      "account_number": "7058818"
    },
    "reference_key": "58729e67-f490-4607-aafd-2fc7945d3d77",
    "reference_type": "ted_outgoing",
    "account_balance": 99404.15,
    "source_sub_type": "withdrawal",
    "transaction_key": "4ac9e80b-22d9-4097-8676-e19f84c89543",
    "source_sub_type_str": "Transferência"
  },
  "datetime": "2023-01-05T07:35:37.127502",
  "webhook_type": "account_transaction"
}

```

### 3.3. Estorno de uma TED

        **Webhook**

- WEBHOOK_TYPE account_transaction
- SOURCE_SUB_TYPE withdrawal_reversal

Response Body

```json
{
  "key": "508ebbba-0b1d-41f6-b9a2-975a4c2e925e",
  "data": {
    "amount": 550,
    "origin": {
      "name": "TED",
      "branch": "0001",
      "document": "32402502000135",
      "account_key": "23a4a2c8-9d82-4ebe-a90d-44fe8d839ec0",
      "account_digit": "7",
      "account_number": "00001"
    },
    "timestamp": "2023-01-05T07:42:26.631137",
    "description": "001 0001 81156-1 32.402.502/0001-35 - QI Tech",
    "destination": {
      "name": "Default",
      "branch": "0001",
      "document": "23426525852",
      "account_key": "508ebbba-0b1d-41f6-b9a2-975a4c2e925e",
      "account_digit": "0",
      "account_number": "7058818"
    },
    "reference_key": "58729e67-f490-4607-aafd-2fc7945d3d77",
    "reference_type": "ted_outgoing",
    "account_balance": 99954.15,
    "source_sub_type": "withdrawal_reversal",
    "transaction_key": "53268774-6891-42a4-a658-42e21cef867c",
    "source_sub_type_str": "Estorno de Transferência"
  },
  "datetime": "2023-01-05T07:42:26.631137",
  "webhook_type": "account_transaction"
}

```

## 4 - Pagamento QR Code PIX

### 4.1. Pagando um QR Code PIX Estático

Para realizar o pagamento de um QR Code PIX Estático, é necessário realizar quatro chamadas:

1. Decodificar o QR Code PIX: /baas/pix/qrcode

2. Criação do pedido de transferência: /baas/pix_transfer

3. Solicitação de token de validação de transferência: /baas/token_request

4. Aprovação da transferência: /baas/movement_validation

A informação que deve ser utilizada para decodificação do QR Code PIX Estático é a URI do PIX Copia e Cola vinculada ao QR Code.

:::info
**Exemplo de URI PIX Copia e Cola:** 00020126580014br.gov.bcb.pix01360598e5d1-2cfc-4857-abf8-12d495aa0a6d52040000530398654040.225802BR5925VOVO LUCIA CONVENIENCIA L6009sao paulo610912345-78062070503***63043A5A
:::

        **Request**

- ENDPOINT /baas/pix/qrcode
- MÉTODO POST

Reponse Body

```json
{
    "qr_code_payload": "\<URI DO PIX COPIA E COLA\>"
}

```

        **Response**

- MÉTODO POST
- ENDPOINT /baas/pix/qrcode

Response Body

```json
{
	"end_to_end_id": "E3240250220221120030008388062101",
	"qr_code_data": {
		"additional_data": null,
		"amount": 30,
		"ispb_number": "32402502",
		"receiver_conciliation_id": "***",
		"target_account_branch": "0001",
		"target_account_digit": "5",
		"target_account_number": "2",
		"target_account_type": "checking",
		"target_bank_code": 329,
		"target_bank_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"target_document_number": "32402502000135",
		"target_name": "QI SOCIEDADE DE CREDITO DIRETO S.A.",
		"target_person_type": "legal",
		"target_pix_key": "316bd44f-2202-4c33-9dc0-096192acd427"
	},
	"qr_code_key": "1608e022-e42d-49d8-bacf-da5844570635",
	"qr_code_payload": "00020126580014br.gov.bcb.pix0136316bd44f-2202-4c33-9dc0-096192acd427520400005303986540530.005802BR5925QI SOCIEDADE DE CREDITO D6009sao paulo610912345-78062070503***63048698",
	"qr_code_type": "static"
}
```

:::caution Atenção
A requisição para pagar um PIX QR Code Estático é a mesma utilizada na transferência PIX com a as seguintes alterações:
**1** - Adição de um novo campo “***end_to_end_id***”. Deve ser informado o mesmo valor retornado da decodificação do QR Code Estático;

**2** - Informar no campo “***transaction_amount***“ o mesmo valor retornado no campo  “qr_code_data.amount” da decodificação do QR Code Estático;

**3** - Alterar o campo “***pix_transfer_type***” para “***static***“, para solicitação do pagamento via “***/baas/pix_transfer***”.
:::

        **Request**

- MÉTODO POST
- ENDPOINT /baas/pix_transfer

Request Body

```json
{
    "pix_transfer_type": "static",
    "source_account": {
        "account_branch": "0001",
        "account_digit": "2",
        "account_number": "2359934",
        "owner_document_number": "09080702000105"
    },
    "end_to_end_id": "E3240250220221118200949955075000",
    "transaction_amount": 30,
	"pix_key": "316bd44f-2202-4c33-9dc0-096192acd427",
    "requester_document_identification": "09080702000105"
}
```

        **Response**

- MÉTODO POST
- ENDPOINT /baas/pix_transfer

Response Body

```json
{
	"data": {
		"end_to_end_id": "E3240250220221118200949955075000",
		"fee_amount": 1,
		"pix_message": null,
		"pix_transfer_key": "59a0da26-3223-4679-aa2c-020d46e923c1",
		"source_account": {
			"account_brach": "0001",
			"account_digit": "2",
			"account_number": "2359934",
			"account_type": "checking",
			"owner_document_number": "09080702000105",
			"owner_name": "VOVO LUCIA CONVENIENCIA LTDA"
		},
		"target_account": {
			"document_number": "32402502000135",
			"financial_institution": "QI SOCIEDADE DE CRÉDITO DIRETO S.A."
		},
		"transaction_amount": 30,
		"transfer_purpose": "transfer"
	},
	"event_datetime": "2022-09-02 23:00:07",
	"operation_key": "527f60a4-0118-4b90-adf8-d33f895c9f8f",
	"status": "pending_approval"
}
```

Após realizar a segunda chamada no endpoint “**/baas/pix_transfer**”, é necessário solicitar o Token para aprovar a transação. Para aprovar a transferência PIX, é necessário utilizar a “**pix_transfer_key**” retornada na solicitação de transferência e solicitar a geração de um token que será enviado ao usuário administrador da conta para aprovação (“***allowed_user***”).

        **Request**

- MÉTODO POST
- ENDPOINT /baas/token_request

Request Body

```json
{
    "contact_type": "sms",
    "agent_document_number": "97564480084",
    "movement_payload": {
        "pix_transfer_key": "59a0da26-3223-4679-aa2c-020d46e923c1",
        "approver_document_number": "97564480084"
    }
}
```

A última chamada para concluir o pagamento será a do “**/baas/movement_validation**” e o Token enviado deve ser informado no momento da aprovação da transferência PIX. A validade do Token é de 2 minutos. 
O usuário administrador deve inserir na aplicação do parceiro o token recebido via E-mail ou SMS.

        **Request**

- MÉTODO POST
- ENDPOINT /baas/movement_validation

Request Body

```json
{
    "token": "957219",
    "movement_payload": {
        "pix_transfer_key": "59a0da26-3223-4679-aa2c-020d46e923c1",
        "approver_document_number": "97564480084"
    }
}
```

        **Response**

- MÉTODO POST
- ENDPOINT /baas/movement_validation

Response Body

```json
{
	"authentication_code": "4c579663bd3f369c4f5f5cd89d8e1a24",
	"event_datetime": "2022-09-02 23:00:07",
	"operation_key": "527f60a4-0118-4b90-adf8-d33f895c9f8f",
	"pix_transaction": {
		"end_to_end_id": "E3240250220221118200949955075000",
		"fee_amount": 1,
		"pix_message": null,
		"pix_transfer_key": "59a0da26-3223-4679-aa2c-020d46e923c1",
		"pix_transfer_status": "sent",
		"pix_transfer_type": "static",
		"source_account": {
			"account_branch": "0001",
			"account_digit": "2",
			"account_number": "2359934"
		},
		"target_account": {
			"document_number": "***.221.81*-**",
			"financial_institution": "BANCO ORIGINAL S.A."
		},
		"transaction_key": "d5134c23-18d2-4279-bc99-459312b64bfc",
		"transfer_amount": 30
	},
	"status": "sent"
}
```

:::info

A única diferença desta Response em relação a Response de Aprovação de Transferência PIX, é o valor do campo “***pix_transfer_type***“, que é retornado como sendo “***static***”.

:::

### 4.2. Pagando um QR Code PIX Dinâmico

Para realizar o pagamento de um QR Code PIX Dinâmico, é necessário realizar quatro chamadas:

1. Decodificar o QR Code PIX: /baas/pix/qrcode

2. Criação do pedido de transferência: /baas/pix_transfer

3. Solicitação de token de validação de transferência: /baas/token_request

4. Aprovação da transferência: /baas/movement_validation. A informação que deve ser utilizada para decodificação do QR Code PIX Dinâmico é a URI do PIX Copia e Cola vinculada 

:::info
A única alteração no “***/baas/pix/qrcode***“ entre é QR Code PIX Estático e o QR Code PIX Dinâmico, é a resposta do endpoint.
:::

        **Response**

- MÉTODO POST
- ENDPOINT /baas/pix/qrcode

Response Body

```json
{
	"end_to_end_id": "E3240250220221120162904592385040",
	"qr_code_data": {
		"account_type": "checking",
		"additional_data": [],
		"address": "Avenida Brigadeiro Faria Lima",
		"amount": 35,
		"category_code": "0000",
		"city": "Sao Paulo",
		"created_at": "2022-09-01T20:20:11",
		"days_after_due_accepted": 180,
		"discount_amount": null,
		"due_date": "2022-11-30",
		"fee_amount": null,
		"fine_amount": null,
		"ispb_number": "32402502",
		"original_amount": null,
		"payer_document_number": "10932327656",
		"payer_name": "Payer Name",
		"payer_person_type": "natural",
		"postal_code": "01452000",
		"presented_at": "2022-09-01T16:29:04",
		"question_to_payer": "QR Code Payment",
		"receiver_conciliation_id": "a6c3f35b342047e58ac105a0ae0c0c6f",
		"receiver_url": null,
		"reduction_amount": null,
		"reusable_qrcode": "yes",
		"revision": 1,
		"state": "SP",
		"status": "active",
		"target_account_branch": "0001",
		"target_account_digit": "5",
		"target_account_number": "2",
		"target_bank_code": 329,
		"target_bank_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"target_document_number": "32402502000135",
		"target_name": "QI SOCIEDADE DE CREDITO DIRETO S.A.",
		"target_person_type": "legal",
		"target_pix_key": "316bd44f-2202-4c33-9dc0-096192acd427",
		"target_trading_name": null
	},
	"qr_code_key": "a1bcf9be-918d-431e-ae79-a75f78337423",
	"qr_code_payload": "00020126970014br.gov.bcb.pix2575qrcode-h.sandbox.qitech.app/bacen/cobv/a6c3f35b-3420-47e5-8ac1-05a0ae0c0c6f5204000053039865802BR5902QI6009Sao Paulo61080145200062070503***6304AFEE",
	"qr_code_type": "dynamic_term"
}
```

:::caution Atenção
A requisição para pagar um PIX QR Code Dinâmico é a mesma utilizada na transferência PIX com a as seguintes alterações:

1 - Adição de um novo campo “end_to_end_id”. Deve ser informado o mesmo valor retornado da decodificação do QR Code Dinâmico.
2 - Informar no campo “transaction_amount“ o mesmo valor retornado no campo  “qr_code_data.amount” da decodificação do QR Code Dinâmico;
3 - Alterar o campo “pix_transfer_type” para “dynamic_term“, para solicitação do pagamento via “/baas/pix_trasnfer”.
4 - Adição de um novo campo “receiver_conciliation_id”. Deve ser informado o mesmo valor retornado da decodificação do QR Code Dinâmico.
:::

        **Request**

- MÉTODO POST
- ENDPOINT /baas/pix_transfer

Response Body

```json
{
    "pix_transfer_type": "dynamic_term",
    "source_account": {
        "account_branch": "0001",
        "account_digit": "2",
        "account_number": "2359934",
        "owner_document_number": "09080702000105"
    },
    "end_to_end_id": "E3240250220221120162904592385040",
    "receiver_conciliation_id": "a6c3f35b342047e58ac105a0ae0c0c6f",
    "transaction_amount": 35,
    "requester_document_identification": "09080702000105"
}
```

        **Response**

- MÉTODO POST
- ENDPOINT /baas/pix_transfer

Response Body

```json
{
	"data": {
		"end_to_end_id": "E3240250220221120162904592385040",
		"fee_amount": 0,
		"pix_message": null,
		"pix_transfer_key": "8ddd3bce-5130-4b5b-b7f1-40f17547a413",
		"source_account": {
			"account_brach": "0001",
			"account_digit": "2",
			"account_number": "2359934",
			"account_type": "checking",
			"owner_document_number": "09080702000105",
			"owner_name": "VOVO LUCIA CONVENIENCIA LTDA"
		},
		"target_account": {
			"document_number": "32402502000135",
			"financial_institution": "QI SOCIEDADE DE CRÉDITO DIRETO S.A."
		},
		"transaction_amount": 35,
		"transfer_purpose": "transfer"
	},
	"event_datetime": "2022-09-02 13:45:44",
	"operation_key": "c697d8d8-4520-4285-b5ec-d573fb6c1eb3",
	"status": "pending_approval"
}
```

Após realizar a segunda chamada no endpoint “***/baas/pix_transfer***”, é necessário solicitar o Token para aprovar a transação. Para aprovar a transferência PIX, é necessário utilizar a “***pix_transfer_key***” retornada na solicitação de transferência e solicitar a geração de um token que será enviado ao usuário administrador da conta para aprovação (“***allowed_user***”).

        **Request**

- MÉTODO POST
- ENDPOINT /baas/token_request

Response Body

```json
{
    "contact_type": "sms",
    "agent_document_number": "97564480084",
    "movement_payload": {
        "pix_transfer_key": "8ddd3bce-5130-4b5b-b7f1-40f17547a413",
        "approver_document_number": "97564480084"
    }
}
```
 

A última chamada para concluir o pagamento será a do “***/baas/movement_validation***” e o Token enviado deve ser informado no momento da aprovação da transferência PIX. A validade do Token é de 2 minutos. 
O usuário administrador deve inserir na aplicação do parceiro o token recebido via E-mail ou SMS.

        **Request**

- MÉTODO POST
- ENDPOINT /baas/movement_validation

Response Body

```json

{
    "token": "231564",
    "movement_payload": {
        "pix_transfer_key": "8ddd3bce-5130-4b5b-b7f1-40f17547a413",
        "approver_document_number": "97564480084"
    }
}
```

        **Response**

- MÉTODO POST
- ENDPOINT /baas/movement_validation

Response Body

```json
{
	"authentication_code": "936c01a20ebf73c6d474a14bc32553b0",
	"event_datetime": "2022-09-02 23:00:07",
	"operation_key": "c697d8d8-4520-4285-b5ec-d573fb6c1eb3",
	"pix_transaction": {
		"end_to_end_id": "E3240250220221120162904592385040",
		"fee_amount": 1,
		"pix_message": null,
		"pix_transfer_key": "8ddd3bce-5130-4b5b-b7f1-40f17547a413",
		"pix_transfer_status": "sent",
		"pix_transfer_type": "dynamic_term",
		"source_account": {
			"account_branch": "0001",
			"account_digit": "2",
			"account_number": "2359934"
		},
		"target_account": {
			"document_number": "***.221.81*-**",
			"financial_institution": "BANCO ORIGINAL S.A."
		},
		"transaction_key": "96e063f4-b1fb-4f93-ae30-906029764a0a",
		"transfer_amount": 35
	},
	"status": "sent"
}
```

:::info
A única diferença desta Response em relação a Response de Aprovação de Transferência PIX, é o valor do campo “***pix_transfer_type***“, que é retornado como sendo “***dynamic_term***”.
:::

## 5 - Gerenciar Chaves PIX

:::info
A “***pix_key***” pode ser um **CPF**, **CNPJ**, **E-mail**, **Celular** ou uma **Chave Aleatória** (UUID), seguindo as seguintes formatações:

**CPF:** Número inteiro com 11 dígitos.

**CNPJ:** Número inteiro com 14 dígitos.

**E-mail:** Texto contendo ao menos um “@”.

**Celular:** Texto contendo os seguintes valores: “+55” + “DDD do celular“ + “Número Inteiro do Celular com no mínimo 8 e no máximo 9 dígitos”. Ex: “+5511987654321“.

**Chave Aleatória:** UUID.
:::

### 5.1. Criar Chave PIX CPF, CNPJ ou Aleatória
Para criar uma chave PIX CNPJ ou Chave Aleatória, basta acionar o endpoint “***/baas/pix/keys***“, alterando apenas o “***pix_key_type***“ para “**cnpj**”, “**cpf**” ou “**random_key**”.

        **Request**

- MÉTODO POST
- ENDPOINT /baas/pix/keys

Request Body

```json

{
    "account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
    "pix_key_type": "random_key"
}
```

ou

Request Body

```json

{
    "account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
    "pix_key_type": "cnpj",
    "pix_key": "09080702000105"
}

```

ou

**payload.json**

```json

{
    "account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
    "pix_key_type": "cpf",
    "pix_key": "03882617038"
}

```

        **Response**

- MÉTODO POST
- ENDPOINT /baas/pix/keys

Response Body

```json

{
	"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
	"created_at": "2022-09-02T18:20:52",
	"pix_key": {
		"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
		"created_at": "2022-09-02T18:20:51",
		"pix_key": "09080702000105",
		"pix_key_status": "pending_confirmation",
		"pix_key_type": "cnpj",
		"updated_at": "2022-09-02T18:20:51"
	},
	"pix_key_request_key": "d60abf67-ad9c-42ee-9089-d26c8fc855b9",
	"request_data": {
		"account_created_at": "2022-09-02T22:44:36",
		"account_digit": "2",
		"account_number": "2359934",
		"account_type": "checking",
		"branch_number": "0001",
		"key": "09080702000105",
		"owner_document_number": "09080702000105",
		"owner_name": "VOVO LUCIA CONVENIENCIA LTDA",
		"owner_person_type": "legal",
		"trading_name": "VOVO LUCIA"
	},
	"request_failure_reason": null,
	"request_status": "pending",
	"request_type": "inclusion",
	"requester_key": "ef48fbe4-267b-45c1-9049-75345c075486",
	"updated_at": "2022-09-02T18:20:52"
}
```

:::caution Atenção
No caso da Response de criação de uma Chave PIX **Aleatória**, o campo “***pix_key***“ retornará um valor nulo, já que se trata de um
processo assíncrono onde a chave é gerada pelo Banco Central. Para recuperar o valor da chave aleatória gerada, é necessária realizar uma consulta à lista de chaves cadastradas em uma conta, conforme descrito no item “**Consultar Chaves PIX cadastradas em uma conta**, ou aguardar o webhook de inclusão.“.
:::

:::info
Como se trata de um processo assíncrono para verificar se as chave PIX **CNPJ** ou **CPF** estão ativas, é necessário realizar uma consulta à lista de chaves cadastradas em um conta, conforme descrito no item “**Consultar Chaves PIX cadastradas em uma conta**", ou aguardar o webhook de inclusão.
:::

**Webhook**

- WEBHOOK_TYPE key_inclusion

Response Body

```json
{
	"pix_key": "c232142c-ddbf-41d6-a54f-3b90c28b97dc",
	"account_key": "94945886-7a6f-43e6-a307-e36c959e4903",
	"webhook_type": "key_inclusion",
	"pix_key_status": "active",
	"pix_key_request_key": "e274eb13-40b3-4902-978e-8e5fa267af53",
	"pix_key_request_type": "inclusion",
	"pix_key_request_status": "approved"
}
```

### 5.2. Criar Chave PIX E-mail e Celular

Para criar uma chave PIX **E-mail** ou **Celular** deve-se acionar dois endpoints:

**1 - Para criação da chave:** POST no endpoint “**/baas/pix/keys**“, alterando o campo “***pix_key_type***“ para “email” ou “phone_number”. Neste momento, será enviado um Token para o E-mail ou Celular informado no campo “***pix_key***“.

**2 - Para aprovação da chave:** PATCH no endpoint “**/baas/pix/keys/\ **“, informando o Token recebido na etapa anterior.

        **Request**

- MÉTODO POST
- ENDPOINT /baas/pix/keys

Request Body

```json
{
    "account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
    "pix_key_type": "email",
    "pix_key": "vovo.lucia@gmail.com.br"
}
```

ou

Request Body

```json
{
    "account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
    "pix_key_type": "phone_number",
    "pix_key": "+5511987654321"
}

```

        **Response**

- MÉTODO POST
- ENDPOINT /baas/pix/keys

Response Body

```json
{
	"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
	"created_at": "2022-09-02T17:41:55",
	"pix_key": {
		"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
		"created_at": "2022-09-02T17:41:54",
		"pix_key": "pedro.pinho@qitech.com.br",
		"pix_key_status": "pending_confirmation",
		"pix_key_type": "email",
		"updated_at": "2022-09-02T17:41:54"
	},
	"pix_key_request_key": "f6209b7e-82da-44a8-9cfa-6ad0a689adb2",
	"request_data": {
		"account_created_at": "2022-09-02T22:44:36",
		"account_digit": "2",
		"account_number": "2359934",
		"account_type": "checking",
		"branch_number": "0001",
		"key": "pedro.pinho@qitech.com.br",
		"owner_document_number": "09080702000105",
		"owner_name": "VOVO LUCIA CONVENIENCIA LTDA",
		"owner_person_type": "legal",
		"trading_name": "VOVO LUCIA"
	},
	"request_failure_reason": null,
	"request_status": "pending",
	"request_type": "inclusion",
	"requester_key": "ef48fbe4-267b-45c1-9049-75345c075486",
	"updated_at": "2022-09-02T17:41:55"
}
```

**IMPORTANTE:** O valor retornado no campo “pix_key_request_key“ deve ser utilizado na URL da requisição para aprovação da criação da Chave PIX.

### 5.3. Aprovação da Chave PIX E-mail ou Celular solicitada

        **Request**

- MÉTODO PATCH
- ENDPOINT /baas/pix/keys/ PIX_KEY_REQUEST_KEY /twofa_validation

Request Body

```json
{
    "verification_code": "756816"
}
```

### 5.4. Reenviar o código de verificação

        **Request**

- MÉTODO PATCH
- ENDPOINT /baas/pix/keys/ PIX_KEY_REQUEST_KEY /resend_twofa

**payload.json**

```json
{}
```

### 5.5. Consultar Chaves PIX cadastradas em uma conta

        **Request**

- MÉTODO GET
- ENDPOINT /baas/pix/keys
- PARAMETERS account_key

        ***Response***

Response Body

```json

{
  "data": [
    {
      "account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
      "created_at": "2022-09-02T17:17:31",
      "pix_key": "0598e5d1-2cfc-4857-abf8-12d495aa0a6d",
      "pix_key_status": "active",
      "pix_key_type": "random_key",
      "updated_at": "2022-09-02T17:17:31"
    },
    {
      "account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
      "created_at": "2022-09-02T18:20:51",
      "pix_key": "09080702000105",
      "pix_key_status": "active",
      "pix_key_type": "cnpj",
      "updated_at": "2022-09-02T18:20:51"
    }
  ]
}
```

### 5.6. Exclusão de Chaves PIX

        **Request**

- MÉTODO DELETE
- ENDPOINT /baas/pix/keys/PIX-KEY

Payload: { }

        **Response**

Response Body

```json
{
	"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
	"created_at": "2022-09-02T20:00:36",
	"pix_key": {
		"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
		"created_at": "2022-09-02T18:20:51",
		"pix_key": "09080702000105",
		"pix_key_status": "inactivated",
		"pix_key_type": "cnpj",
		"updated_at": "2022-09-02T20:00:36"
	},
	"pix_key_request_key": "dced4317-c1e7-4da4-a75a-42f855c7598e",
	"request_data": {},
	"request_failure_reason": null,
	"request_status": "approved",
	"request_type": "deletion",
	"requester_key": "ef48fbe4-267b-45c1-9049-75345c075486",
	"updated_at": "2022-09-02T20:00:36"
}

```

## 6 - Gerar QR Code PIX

### 6.1. Gerando QR Code PIX Estático

O QR Code é criado a partir de uma Chave PIX ativa cadastrada em uma conta. Após a geração do QR Code, serão retornados tanto a URI do PIX Copia e Cola vinculada ao QR Code, como também o base64 da imagem do QR Code (caso solicitado).

A imagem do QR Code pode ser gerada pelo próprio parceiro a partir da URI do PIX Copia e Cola.

Para gerar um QR Code PIX Estático será usada apenas uma requisição:

        **Request**

- MÉTODO POST
- ENDPOINT /baas/qrcode/static

Request Body

```json
{
    "pix_key": "0598e5d1-2cfc-4857-abf8-12d495aa0a6d",
    "amount": 35.00,
    "receiver_name": "Tywin Lannister",
    "qr_code_format": "both"
}

```

:::info
No campo **qr_code_format** poderá ser informado os valores “***image***”, “***payload***“ e “***both***”.
- “***image***”: será retornado o campo com o base64 da imagem do QR Code PIX.
- “***payload***”: será retornado o campo com o base64 da URI do PIX Copia e Cola do QR Code PIX.
- “***both***”: serão retornados os dois campos.
:::

        **Response**

- MÉTODO POST
- ENDPOINT /baas/qrcode/static

Response Body

```json
{
    "external_reference_key": null,
    "image": "\<BASE 64 DO QR CODE PIX\>",
    "payload": "MDAwMjAxMjY0NzAwMTRici5nb3YuYmNiLnBpeDAxMjVwZWRyby5waW5ob0BxaXRlY2guY29tLmJyNTIwNDAwMDA1MzAzOTg2NTQwNTM1LjAwNTgwMkJSNTkxNVR5d2luIExhbm5pc3RlcjYwMDlzYW8gcGF1bG82MTA5MTIzNDUtNzgwNjIwNzA1MDMqKio2MzA0M0QzMA",
    "revision": null
}

```

### 6.2. Gerando QR Code PIX Dinâmico

Existem dois tipos de QR Code Dinâmico. O QR Code Dinâmico com Pagamento Instantâneo e o QR Code Dinâmico com Vencimento.

#### 6.2.1. Gerando QR Code PIX Dinâmico com Vencimento

É um tipo de QR Code PIX que funciona de forma muito semelhante a um boleto bancário, podendo possuir informação de vencimento, multa, juros por atraso e desconto por pagamento antecipado. Para gerar ester tipo de QR Code PIX é necessário apenas uma requisição no Endpoint “***/baas/qrcode/dynamic***“.

        **Request**

- MÉTODO POST
- ENDPOINT /baas/qrcode/dynamic

Request Body

```json
{
	"amount": 100,
	"qr_code_type": "dynamic_term",
	"occurrence_type": "registration",
	"max_payment_days": 180,
	"expiration_date": "2025-09-24",
	"pix_key": "0598e5d1-2cfc-4857-abf8-12d495aa0a6d",
	"payer_name": "QI Tech",
	"payer_document_number": "98765432100",
	"payer_person_type": "natural",
	"payer_request": "O que voce achou da experiencia",
	"rebate_amount": 0,
	"interest_amount": 1,
	"fine_amount": 2,
	"discounts": [{
		"limit_date": "2023-02-24",
		"amount": 20,
		"discount_type": "absolute"
	}],
	"additional_data": [{
		"\<tag_name\>": "\<tag_value\>"
	}]
}

```

:::info
**occurrence_type:** neste campo é informada a ação pretendida. Podem ser: registration, edit, write_off 
- **registration:** Para criar um novo QR Code
- **edit:** Para editar um QR Code já existente (Conforme descrito no item abaixo).
- **write_off:** para baixar um QR Code ativo.

**interest_amount:** valor em reais (R$) de juros cobrados por dia de atraso.

**fine_amount:** valor da multa por atraso, em reais (R$).

**discounts:** informação do desconto por pagamento antecipado. Caso não seja aplicável, enviar uma lista vazia ([]). 

**additional_data:** são metatags customizáveis que podem ser apresentadas para o pagador no momento do pagamento. Seguem o seguinte padrão: ”\ ”: “\ “.

**tag_name** possui uma limitação de 100 caracteres e **tag_value** possui uma limitação de 320 caracteres.
:::

        **Response**

- MÉTODO POST
- ENDPOINT /baas/qrcode/dynamic

Response Body

```json
{
	"qr_code_type": "dynamic_term",
	"amount": 100,
	"expiration_seconds": null,
	"max_payment_days": 180,
	"receiver_conciliation_id": "3bd19ada234141bf9f1fc5ce0b216723",
	"payer_name": "QI Tech",
	"payer_document_number": "98765432100",
	"payer_person_type": "natural",
	"payer_request": "O que voce achou da experiencia",
	"pix_message": null,
	"modality_alteration": false,
	"expiration_date": "2025-09-24",
	"rebate_amount": 10,
	"interest_amount": 10,
	"fine_amount": 10,
	"paid_amount": null,
	"discounts": [{
		"discount_type": "absolute",
		"limit_date": "2023-02-24",
		"amount": 20
	}],
	"additional_data": [{
		"\<tag_name\>": "\<tag_value\>"
	}],
	"origin": "system",
	"origin_key": null,
	"pix_key": "0598e5d1-2cfc-4857-abf8-12d495aa0a6d",
	"qr_code_key": "3bd19ada-2341-41bf-9f1f-c5ce0b216723",
	"occurrence_type": "registration",
	"end_to_end_id": null,
	"base_64": "MDAwMjAxMjY5NzAwMTRici5nb3YuYmNiLnBpeDI1NzVxcmNvZGUtaC5zYW5kYm94LnFpdGVjaC5hcHAvYmFjZW4vY29idi8zYmQxOWFkYS0yMzQxLTQxYmYtOWYxZi1jNWNlMGIyMTY3MjM1MjA0MDAwMDUzMDM5ODY1ODAyQlI1OTI1Vk9WTyBMVUNJQSBDT05WRU5JRU5DSUEgTDYwMDdMaW1laXJhNjEwODEzNDgwMjkwNjIwNzA1MDMqKio2MzA0QzNGNg",
	"image": "\<BASE 64 DO QR CODE PIX\>",
	"source_account_branch": null,
	"source_account_financial_institution": null,
	"source_account_ispb": null,
	"source_account_number": null,
	"source_account_digit": null,
	"qr_code_occurrence_key": "b6777e78-e00c-4e9f-9b44-aa7b551c11e4"
}
```

:::info
O campo “**base_64**“ é a URI do PIX Copia e Cola vinculado a este QR Code PIX Dinâmico.
:::
 

#### 6.2.2. Gerando QR Code PIX Dinâmico com Pagamento Instantâneo

É um tipo de QR Code PIX semelhante ao Estático, porém facilita a conciliação por parte do recebedor do pagamento e pode ter vencimento intradia (podendo durar apenas 5 minutos, por exemplo). 
Para gerar este tipo de QR Code PIX é necessário apenas uma requisição no Endpoint ***“/baas/qrcode/dynamic”***. 

        **Request**

- MÉTODO POST
- ENDPOINT /baas/qrcode/dynamic

Request Body

```json
{
	"amount": 100,
	"occurrence_type": "registration",
	"qr_code_type": "dynamic_instant",
	"pix_key": "0598e5d1-2cfc-4857-abf8-12d495aa0a6d",
	"expiration_seconds": 360,
	"payer_name": "QI Tech",
	"payer_document_number": "98765432100",
	"payer_person_type": "natural",
	"payer_request": "Valor referente a compra 1234",
	"additional_data": [{
		"\<tag_name\>": "\<tag_value\>"
	}]
}
```

        **Response**

- MÉTODO POST
- ENDPOINT /baas/qrcode/dynamic

Response Body

```json
{
	"qr_code_type": "dynamic_instant",
	"amount": 100,
	"expiration_seconds": 360,
	"max_payment_days": null,
	"receiver_conciliation_id": "8e5af204fa5844eca9707c4facc5e5f5",
	"payer_name": "QI Tech",
	"payer_document_number": "98765432100",
	"payer_person_type": "natural",
	"payer_request": "Valor referente a compra 1234",
	"pix_message": null,
	"modality_alteration": false,
	"expiration_date": null,
	"rebate_amount": null,
	"interest_amount": null,
	"fine_amount": null,
	"paid_amount": null,
	"discounts": [],
	"additional_data": [{
		"\<tag_name\>": "\<tag_value\>"
	}],
	"origin": "system",
	"origin_key": null,
	"pix_key": "0598e5d1-2cfc-4857-abf8-12d495aa0a6d",
	"qr_code_key": "8e5af204-fa58-44ec-a970-7c4facc5e5f5",
	"occurrence_type": "registration",
	"end_to_end_id": null,
	"base_64": "MDAwMjAxMjY4ODAwMTRici5nb3YuYmNiLnBpeDI1NjZxcmNvZGUtaC5zYW5kYm94LnFpdGVjaC5hcHAvYmFjZW4vOGU1YWYyMDRmYTU4NDRlY2E5NzA3YzRmYWNjNWU1ZjU1MjA0MDAwMDUzMDM5ODY1ODAyQlI1OTI1Vk9WTyBMVUNJQSBDT05WRU5JRU5DSUEgTDYwMDdMaW1laXJhNjEwODEzNDgwMjkwNjIwNzA1MDMqKio2MzA0M0RBRA",
	"image": "\<BASE 64 DO QR CODE PIX\>",
	"source_account_branch": null,
	"source_account_financial_institution": null,
	"source_account_ispb": null,
	"source_account_number": null,
	"source_account_digit": null,
	"qr_code_occurrence_key": "838e4bd3-36c9-4aa8-9be8-04079bbe8d1a"
}

```

 

#### 6.2.3. Editar dados de QR Code PIX Dinâmico

Para editar os dados de um QR Code PIX Dinâmico, é necessário informar a “***qr_code_key***“ do QR Code PIX e “***occurrence_type***” igual a “***edit***”. Nesse caso, é preciso reenviar todos os dados novamente.

        **Request**

- MÉTODO POST
- ENDPOINT /baas/qrcode/dynamic

Request Body

```json
{
    "qr_code_key": "3bd19ada-2341-41bf-9f1f-c5ce0b216723",
	"amount": 200,
	"qr_code_type": "dynamic_term",
	"occurrence_type": "edit",
	"max_payment_days": 180,
	"expiration_date": "2025-09-24",
	"pix_key": "0598e5d1-2cfc-4857-abf8-12d495aa0a6d",
	"payer_name": "QI Tech",
	"payer_document_number": "98765432100",
	"payer_person_type": "natural",
	"payer_request": "O que voce achou da experiencia",
	"rebate_amount": 0,
	"interest_amount": 1,
	"fine_amount": 2,
	"discounts": [{
		"limit_date": "2023-02-24",
		"amount": 20,
		"discount_type": "absolute"
	}],
	"additional_data": [{
		"\<tag_name\>": "\<tag_value\>"
	}]
}
```

        **Request**

- MÉTODO POST
- ENDPOINT /baas/qrcode/dynamic

Response Body

```json
{
	"qr_code_type": "dynamic_term",
	"amount": 200,
	"expiration_seconds": null,
	"max_payment_days": 180,
	"receiver_conciliation_id": "3bd19ada234141bf9f1fc5ce0b216723",
	"payer_name": "QI Tech",
	"payer_document_number": "98765432100",
	"payer_person_type": "natural",
	"payer_request": "O que voce achou da experiencia",
	"pix_message": null,
	"modality_alteration": false,
	"expiration_date": "2025-09-24",
	"rebate_amount": 10,
	"interest_amount": 10,
	"fine_amount": 10,
	"paid_amount": null,
	"discounts": [{
		"discount_type": "absolute",
		"limit_date": "2023-02-24",
		"amount": 20
	}],
	"additional_data": [{
		"\<tag_name\>": "\<tag_value\>"
	}],
	"origin": "system",
	"origin_key": null,
	"pix_key": "0598e5d1-2cfc-4857-abf8-12d495aa0a6d",
	"qr_code_key": "3bd19ada-2341-41bf-9f1f-c5ce0b216723",
	"occurrence_type": "edit",
	"end_to_end_id": null,
	"base_64": "MDAwMjAxMjY5NzAwMTRici5nb3YuYmNiLnBpeDI1NzVxcmNvZGUtaC5zYW5kYm94LnFpdGVjaC5hcHAvYmFjZW4vY29idi8zYmQxOWFkYS0yMzQxLTQxYmYtOWYxZi1jNWNlMGIyMTY3MjM1MjA0MDAwMDUzMDM5ODY1ODAyQlI1OTI1Vk9WTyBMVUNJQSBDT05WRU5JRU5DSUEgTDYwMDdMaW1laXJhNjEwODEzNDgwMjkwNjIwNzA1MDMqKio2MzA0QzNGNg",
	"image": "\<BASE 64 DO QR CODE PIX\>",
	"source_account_branch": null,
	"source_account_financial_institution": null,
	"source_account_ispb": null,
	"source_account_number": null,
	"source_account_digit": null,
	"qr_code_occurrence_key": "d9c01f70-26bc-429d-afd1-038bd3c235b2"
}

```

 

### 6.3. Baixar QR Code PIX Dinâmico

Para baixar um QR Code PIX Dinâmico, é necessário informar a “***qr_code_key***“ do QR Code PIX e “***occurrence_type***” igual a “***write_off***”.

        **Request**

- MÉTODO POST
- ENDPOINT /baas/qrcode/dynamic

Request Body

```json
{
    "qr_code_key": "3bd19ada-2341-41bf-9f1f-c5ce0b216723",
    "occurrence_type": "write_off"
}

```

        **Response**

- MÉTODO POST
- ENDPOINT /baas/qrcode/dynamic

Response Body

```json
{
	"qr_code_type": "dynamic_term",
	"amount": null,
	"expiration_seconds": 86400,
	"max_payment_days": null,
	"receiver_conciliation_id": "3bd19ada234141bf9f1fc5ce0b216723",
	"payer_name": null,
	"payer_document_number": null,
	"payer_person_type": "natural",
	"payer_request": null,
	"pix_message": null,
	"modality_alteration": false,
	"expiration_date": null,
	"rebate_amount": null,
	"interest_amount": null,
	"fine_amount": null,
	"paid_amount": null,
	"discounts": [],
	"additional_data": [],
	"origin": "system",
	"origin_key": null,
	"pix_key": "0598e5d1-2cfc-4857-abf8-12d495aa0a6d",
	"qr_code_key": "3bd19ada-2341-41bf-9f1f-c5ce0b216723",
	"occurrence_type": "write_off",
	"end_to_end_id": null,
	"base_64": null,
	"image": null,
	"source_account_branch": null,
	"source_account_financial_institution": null,
	"source_account_ispb": null,
	"source_account_number": null,
	"source_account_digit": null,
	"qr_code_occurrence_key": "46001adf-ffe2-4534-b60e-f6c16b9af56e"
}
```

## 7 - Registrar, Alterar e Pagar boletos bancários

### 7.1. Consulta de Carteiras de Cobrança

Para registrar, alterar e pagar boletos, é preciso, primeiramente, possuir o Código da Carteira de Cobrança (Requester Profile Code) vinculada a uma conta. Toda conta já nasce com uma Carteira de Cobrança vinculada. 

O Código da Carteira de Cobrança segue o seguinte padrão:

”No. do banco” + “código da carteira” + “No. agência da conta” + “No. da Conta com 7 caracteres e sem dígito“.
Por padrão, na QI Tech, os números do banco, do código da carteira e agência sempre serão “329”, “09” e “0001”, respectivamente.
ex: “**329-09-0001-2359934**”.

Caso seja necessário recuperar a lista de Códigos de Carteira de Cobrança de cada conta, deve ser utilizado o seguinte endpoint:

        **Request**

- MÉTODO GET
- ENDPOINT /bank_slip/requester_profiles

        ***Response***

Response Body

```json
{
    "requester_profile_codes": [
        "329-09-0001-1467576",
        "329-09-0001-5747500",
        "329-09-0001-2730579",
        "329-09-0001-2359934"
    ]
}
```
 

:::tip NOTA
O registro, alteração e baixa de boletos, funciona através da dinâmica de ocorrências. Cada ocorrência é enviada para a QI Tech e encaminhada para a base centralizadora de boletos.
As ocorrências podem ser aceitas ou rejeitadas pelo base centralizadora de boletos.
A resposta a respeito da aceitação ou rejeição das ocorrências é enviada via webhook ao parceiro
:::

### 7.2. Registrar Boleto 
Para realizar o registro de um boleto, é necessário enviar uma ocorrência de registro, conforme descrito no endpoint abaixo:

        **Request**

- MÉTODO POST
- ENDPOINT /multibank_instruction?use_multi_process=true

Request Body

```json

{
    "occurrences": [
        {
            "amount": 800,
            "our_number": 1,
            "automatic_bankruptcy_protest": false,
            "bank_teller_instructions": "Não aceitar após vencimento",
            "days_to_bankruptcy_protest": 0,
            "document_number": "123456/01",
            "expiration": "2022-12-01",
            "fine_percentage": "2",
            "interest_daily_value": "0.34",
            "occurrence_type": "registration",
            "payer_address": "Rua Carlos Sampaio, 123",
            "payer_document": "41184562067",
            "payer_name": "João Ninguem",
            "payer_person_type": "natural",
            "payer_postal_code_root": "15800",
            "payer_postal_code_suffix": "020",
            "registration_institution_enumerator": "qi_scd",
            "requester_profile": 9,
            "requester_profile_code": "329-09-0001-2359934"
        }
    ]
}
```

:::info
O nosso número bancário (“***our_number***”) é o ID do boleto dentro da carteira de cobrança. Ele deve ser um ID incremental.
O nosso número bancário (“***our_number”) deve ser gerado pelo parceiro e informado no momento do registro do boleto.

**IMPORTANTE:** O boleto deve ser localizado através da chave: nosso número bancário (“***our_number***”) + Código da Carteira de Cobrança (“***requester_profile_code***“).
:::

        **Response**

- MÉTODO POST
- ENDPOINT /multibank_instruction?use_multi_process=true

Response Body

```json
{
	"file_info": {
		"beneficiary_code": null,
		"beneficiary_name": null,
		"file_sequence_id": null,
		"file_type_identifier": null,
		"file_type_literal": null,
		"service_code": null,
		"service_literal": null,
		"wrote_at": null
	},
	"occurrence_stats": {
		"bank_slip_edit": 0,
		"bankruptcy_protest_request": 0,
		"cancel_rebate": 0,
		"extension": 0,
		"notary_office_entry": 0,
		"notary_office_exit": 0,
		"notary_office_payment": 0,
		"notification": 0,
		"payment": 0,
		"payment_notice": 0,
		"payment_write_off": 0,
		"protest_cancel_and_write_off_request": 0,
		"protest_cancel_request": 0,
		"protest_remove_request": 0,
		"protest_request": 0,
		"rebate": 0,
		"registration": 1,
		"write_off": 0
	},
	"semantic_errors": []
}
```

A resposta sobre a aceitação ou rejeição do registro do boleto será informada através do seguinte webhook.

        **Webhook**

- WEBHOOK_TYPE bank_slip.status_change
- STATUS registered

Response Body

```json
{
	"key": "41927fa9-f9ed-4797-b48a-6ac68e58dc17",
	"data": {
		"expiration": "2022-12-01",
		"our_number": 1,
		"bank_slip_key": "41927fa9-f9ed-4797-b48a-6ac68e58dc17",
		"rebate_amount": 0,
		"occurrence_type": "registration",
		"occurrence_feedback": "confirmed",
		"occurrence_sequence": 0,
		"requester_profile_code": "329-09-0001-2359934",
		"glados_occurrence_reasons": null,
		"cnab_file_occurrence_order": 1,
		"registration_institution_occurrence_date": "2022-11-21"
	},
	"status": "registered",
	"webhook_type": "bank_slip.status_change",
	"event_datetime": "2022-11-22 00:41:32"
}
```

Para vincular o webhook enviado a um boleto, deve-se utilizar o nosso número bancário (“***our_number***”) e o Código da Carteira de Cobrança (“requester_profile_code“).

Assim que o registro do boleto é aceito pela base centralizadora, é retornado no webhook a chave UUID do boleto (“***bank_slip_key***“). Guarde essa chave pois através dela será possível recuperar as informações do boleto.

### 7.2. Alterar Dados do Boleto

Para alterar os dados de um boleto, é necessário enviar uma ocorrência. Cada possível alteração possui sua ocorrência correspondente. A lista de ocorrências para alteração dos dados de um boleto pode ser verificada em nossa documentação Enviar instrução de Boleto[LINK]).

### 7.3. Solicitação de 2ª via de boleto

Após o registro do boleto, pode ser solicitada a geração de um arquivo “.pdf” do boleto, contendo os dados para pagamento.

        **Request**

- MÉTODO POST
- ENDPOINT /bank_slip/2-way/BANKSLIP-KEY

Payload: { }

        **Response**

Response Body

```json
{
	...
	"bank_slip_file": [{
		"barcode": "32991918600000800000001090000000000123599340",
		"created_at": "2022-11-21T23:29:45",
		"digitable_line": "32990001039000000000101235993407191860000080000",
		"url": "https://storage.googleapis.com/sandbox-bank-slip-api/bank-slip-pdf/41927fa9-f9ed-4797-b48a-6ac68e58dc17_1.pdf"
	}],
	...
}
```

:::info
Serão retornados todos os dados do boleto e o link para download do “.pdf” será informado no objeto “bank_slip_file.url“.
:::

### 7.4. Consultar dados de um Boleto

Os dados de um boleto podem ser consultados de duas formas diferentes.

#### 7.4.1. Consulta através da linha digitável

A linha digitável de um boleto é uma série numérica que traz em si as informações do boleto. Esta série numérica é digitada pelo usuário pagador do boleto no internet-banking do banco pagador.

:::info
Exemplo de linha digitável: 32990001031000000000902000000204685640000100000
:::

Através da linha digitável, podem ser consultados os dados do boleto:

        **Request**

- MÉTODO GET
- ENDPOINT /bank_slip/payment
- PARAMETERS digitable_line

        **Response**

Response Body

```json
{
	"barcode": "32991918600000800000001090000000000123599340",
	"beneficiary_bank_code": "329",
	"beneficiary_document_number": "09080702000105",
	"beneficiary_legal_name": "VOVO LUCIA CONVENIENCIA LTDA",
	"beneficiary_person_type": "legal",
	"calculated_internally": true,
	"calculation_date": "2022-11-21",
	"calculation_model": 1,
	"digitable_line": "32990001039000000000101235993407191860000080000",
	"discount_amount": "0",
	"expiration_date": "2022-12-01",
	"expired_as_of_payment_date": false,
	"expired_as_of_today": false,
	"factual_expiration_date": "2022-12-01",
	"fine_amount": "0",
	"guarantor_document": null,
	"guarantor_name": null,
	"interest_amount": "0",
	"max_payment_date": "2023-05-30",
	"nominal_amount": "800.00",
	"payer_document_number": "41184562067",
	"payer_legal_name": "Jo_o Ninguem",
	"payer_person_type": "natural",
	"payment_date": "2022-11-21",
	"rebate_amount": "0.0",
	"total_amount": "800.0",
	"valid_payment_amount": true,
	"valid_payment_calculation": true,
	"valid_payment_time_frame": true
}
```

#### 7.4.2. Consulta através da Chave do Boleto

Assim que o registro do boleto é aceito pela base centralizadora, é retornado no webhook a chave UUID do boleto (“***bank_slip_key***“). Através dessa chave é possível recuperar as informações do boleto:

        **Request**

- MÉTODO GET
- ENDPOINT /bank_slip/BANKSLIP-KEY

Request Body

```json
{
	"barcode": "32991918600000800000001090000000000123599340",
	"beneficiary_bank_code": "329",
	"beneficiary_document_number": "09080702000105",
	"beneficiary_legal_name": "VOVO LUCIA CONVENIENCIA LTDA",
	"beneficiary_person_type": "legal",
	"calculated_internally": true,
	"calculation_date": "2022-11-21",
	"calculation_model": 1,
	"digitable_line": "32990001039000000000101235993407191860000080000",
	"discount_amount": "0",
	"expiration_date": "2022-12-01",
	"expired_as_of_payment_date": false,
	"expired_as_of_today": false,
	"factual_expiration_date": "2022-12-01",
	"fine_amount": "0",
	"guarantor_document": null,
	"guarantor_name": null,
	"interest_amount": "0",
	"max_payment_date": "2023-05-30",
	"nominal_amount": "800.00",
	"payer_document_number": "41184562067",
	"payer_legal_name": "Jo_o Ninguem",
	"payer_person_type": "natural",
	"payment_date": "2022-11-21",
	"rebate_amount": "0.0",
	"total_amount": "800.0",
	"valid_payment_amount": true,
	"valid_payment_calculation": true,
	"valid_payment_time_frame": true
}
```

### 7.5. Pagar Boleto

Para realizar o pagamento de um Boleto é necessário realizar duas chamadas: 

1. Solicitação de token de validação de transferência: /baas/token_request

2. Aprovação da transferência: /baas/movement_validation

        **Request**

- MÉTODO POST
- ENDPOINT /baas/token_request

Request Body

```json
{
    "contact_type": "email",
    "agent_document_number": "97564480084",
    "movement_payload": {
        "resource_account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
        "digitable_line": "32990001031000699926165000000201993810000003500"
    }
}

```

:::info
O Token enviado deve ser informado no momento da aprovação do pagamento do boleto, e o “***movement_payload***” deve ser o mesmo informado no momento da solicitação do Token.
:::

        **Request**

- MÉTODO POST
- ENDPOINT /baas/movement_validation

Request Body

```json
{
    "token": "358192",
    "movement_payload": {
        "resource_account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
        "digitable_line": "32990001031000699926165000000201993810000003500"
    }
}

```

        **Response**

- MÉTODO POST
- ENDPOINT /baas/movement_validation

Response Body

```json
{
	"authentication_code": "7bf20f1721ecc043d2a16a20ae668b01",
	"bank_slip": {
		"beneficiary": {
			"document_number": "32402502000135",
			"document_number_formatted": "32.402.502/0001-35",
			"name": "QI SCD"
		},
		"digitable_line": "32990001031000699926165000000201993810000003500",
		"expiration_date": "2023-06-14",
		"expiration_date_formatted": "14/06/2023",
		"financial_institution_compe_number": "329",
		"financial_institution_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"payer": {
			"document_number": "10932327656",
			"document_number_formatted": "109.323.276-56",
			"name": "Lucas Clarim"
		},
		"payment_date": "2022-11-22",
		"payment_date_formatted": "22/11/2022",
		"payment_key": "13b35108-0fdc-44ab-b86d-5dda12dc8dce"
	},
	"origin_key": "13b35108-0fdc-44ab-b86d-5dda12dc8dce",
	"pdf_encoded_string": "\<BASE 64 DO COMPROVANTE\>",
	"source_account": {
		"account_branch": "0001",
		"account_digit": "2",
		"account_number": "2359934",
		"financial_institution_compe_number": 329,
		"financial_institution_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"owner_document_number": "09080702000105",
		"owner_document_number_formatted": "09.080.702/0001-05",
		"owner_name": "VOVO LUCIA CONVENIENCIA LTDA"
	},
	"source_subtype": "bank_slip_payment",
	"source_subtype_translation_ptbr": "Pagamento de Boleto",
	"transacted_at": "2022-11-22 12:26:21",
	"transacted_at_br": "2022-11-22 09:26:21",
	"transacted_at_br_formatted": "22/11/2022, 09:26:21",
	"transacted_at_formatted": "22/11/2022, 12:26:21",
	"transaction_amount": 35,
	"transaction_amount_formatted": "R$ 35,00",
	"transaction_key": "eee862b9-7f2e-4eea-b04a-fa0e89442618"
}
```

 
### 7.6. Notificação de aviso de recebimento de um Boleto

No momento em que um boleto é pago em outro banco, é enviado um aviso de que este boleto foi pago em tempo real. A Liquidação financeira do pagamento ocorrerá no próximo dia útil.

        **Webhook**

- WEBHOOK_TYPE bank_slip.status_change
- STATUS payment_notice

Response Body

```json
{
	"key": "945e191d-1a78-4a28-8669-000b7e4a3522",
	"data": {
		"our_number": 1,
		"paid_amount": 800,
		"payment_bank": 341,
		"bank_slip_key": "41927fa9-f9ed-4797-b48a-6ac68e58dc17",
		"payment_method": 2,
		"payment_origin": 3,
		"occurrence_type": "payment_notice",
		"occurrence_feedback": "confirmed",
		"occurrence_sequence": 0,
		"requester_profile_code": "329-09-0001-2359934",
		"registration_institution": "qi_scd",
		"cnab_file_occurrence_order": 1,
		"registration_institution_occurrence_date": "2022-11-02"
	},
	"status": "payment_notice",
	"webhook_type": "bank_slip.status_change",
	"event_datetime": "2022-11-21 23:02:02"
}
```

:::info
**payment_method:** é o meio de pagamento do boleto, podendo ser:

**“credit_card”:** cartão de crédito 

**”cash”:** dinheiro

**”account_debit”:** débito em conta 

**”check”:** cheque
:::

:::info
**payment_origin:** é a origem do local do pagamento do boleto, podendo ser:

**“internet”:** Internet Banking

**”phisical_cashier”:** Caixa do Banco (“boca do caixa”)

**”taa”:** Terminal de auto-atendimento

**”eletronic_file”:** CNAB de liquidação

**”call_center”:** Call Center

**”dda”:** DDA (Débito Direto Autorizado)

**”corban”:** Lotérica - Correspondente Bancário
:::

:::caution Atenção
A informação de Método de Pagamento (“***payment_method***“) e Origem do Pagamento (“***payment_origin***“), são dados informados no momento do pagamento do boleto, sua consistência e veracidade fica a cargo da instituição que processou tal pagamento.
:::

## 8 - Movimentações, Comprovantes e Extratos

:::info
Esse manual contém a estrutura/informações dos nossos produtos de Banking as a Service, porém também cabe a utilização como forma documentação de nossos endpoints.
:::

### 8.1. Movimentações
Para toda e qualquer movimentação será enviado um webhook de “***account_transaction***“.

Cada transação possui um tipo de classificação (**Source Sub Type**). Essa classificação é utilizada para categorizar cada movimentação na conta. A lista de Source Sub Types pode ser vista no **Anexo I** deste manual.

Os créditos em conta resultarão em um webhook com “***data.amount***” positivo, “***data.origin***“ sendo a conta de origem dos recursos e a “***data.destination***“ sendo a conta de destino dos recursos:

        **Webhook**

- WEBHOOK_TYPE account_transaction

Response Body: Pix

```json
{
    "key": "\<ACCOUNT-KEY\>",
	"data": {
		"amount": 1000000,
		"origin": {
			"name": "Treasury Account",
			"branch": "0001",
			"document": "32402502000135",
			"account_key": "5d068423-6094-49e4-b15b-7740038295a8",
			"account_digit": "5",
			"account_number": "00002"
		},
		"timestamp": "2022-09-02T21:36:33.446120",
		"description": "329 0001 00002-5 32.402.502/0001-35 - QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"destination": {
			"name": "Default",
			"branch": "0001",
			"document": "09080702000105",
			"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
			"account_digit": "2",
			"account_number": "2359934"
		},
		"reference_key": "983b4a28-7de6-4e71-97ef-60fb50c7b013",
		"reference_type": "movement_request",
		"account_balance": 1000000,
		"source_sub_type": "internal_funds_transfer",
		"transaction_key": "67a62397-2c32-4768-8485-ec9129a46654",
		"source_sub_type_str": "Transferência Interna",
		"transaction_details": {
			"payer_name": "0001",
			"receiver_name": "Default",
			"payer_account_digit": "5",
			"payer_account_branch": "",
			"payer_account_number": "1111111",
			"payer_document_number": "66681638999999",
			"receiver_account_digit": "6",
			"receiver_account_branch": "0000",
			"receiver_account_number": "34256449809",
			"receiver_conciliation_id": null,
			"receiver_document_number": "00809641658"
		}
	},
	"datetime": "2022-09-02T21:36:33.446120",
	"webhook_type": "account_transaction"
}
```

Response Body: Outras transações

```json
{
    "key": "\<ACCOUNT-KEY\>",
	"data": {
		"amount": 1000000,
		"origin": {
			"name": "Treasury Account",
			"branch": "0001",
			"document": "32402502000135",
			"account_key": "5d068423-6094-49e4-b15b-7740038295a8",
			"account_digit": "5",
			"account_number": "00002"
		},
		"timestamp": "2022-09-02T21:36:33.446120",
		"description": "329 0001 00002-5 32.402.502/0001-35 - QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"destination": {
			"name": "Default",
			"branch": "0001",
			"document": "09080702000105",
			"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
			"account_digit": "2",
			"account_number": "2359934"
		},
		"reference_key": "983b4a28-7de6-4e71-97ef-60fb50c7b013",
		"reference_type": "movement_request",
		"account_balance": 1000000,
		"source_sub_type": "internal_funds_transfer",
		"transaction_key": "67a62397-2c32-4768-8485-ec9129a46654",
		"source_sub_type_str": "Transferência Interna",
	},
	"datetime": "2022-09-02T21:36:33.446120",
	"webhook_type": "account_transaction"
}
```

Os débitos em conta resultarão em um webhook com “***data.amount***” negativo, “***data.origin***“ sendo a conta destinatária dos recursos e a “***data.destination***“ sendo a conta de origem dos recursos:

        **Webhook**

- WEBHOOK_TYPE account_transaction

Response Body

```json
{
	"key": "\<ACCOUNT-KEY\>",
	"data": {
		"amount": -45,
		"origin": {
			"name": "PIX",
			"branch": "0001",
			"document": "32402502000135",
			"account_key": "3d0e7d50-e898-49f3-b23b-05353c8a3c72",
			"account_digit": "3",
			"account_number": "00003"
		},
		"timestamp": "2022-09-02T23:00:05.326738",
		"description": "212 0001 1017372-2 ***.221.81*-** BANCO ORIGINAL S.A.",
		"destination": {
			"name": "Default",
			"branch": "0001",
			"document": "09080702000105",
			"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
			"account_digit": "2",
			"account_number": "2359934"
		},
		"reference_key": "cea836b5-b02e-4f94-b1e2-4d575671c33d",
		"reference_type": "pix_outgoing",
		"account_balance": 999955,
		"source_sub_type": "pix_withdrawal",
		"transaction_key": "d2ba3817-26d7-4957-ab82-24f78d910a8a",
		"source_sub_type_str": "Transferência de PIX"
	},
	"datetime": "2022-09-02T23:00:05.326738",
	"webhook_type": "account_transaction"
}
```
 

**Lista de source_sub_types’s:**

| Enum                                    | Descrição                                       |
|-----------------------------------------|-------------------------------------------------|
| operation_disbursement                  | Desembolso da Operação                          |
| protest_expense                         | Despesas de Protesto                            |
| automatic_integrated_payment            | Pagamento Automático Integrado                  |
| tax                                     | Impostos                                        |
| electronic_funds_fee                    | Tarifa de TED                                   |
| credit_operation_fee                    | Tarifa de Abertura de Crédito                   |
| internal_funds_transfer                 | Transferência Interna                           |
| incoming_funds_transfer                 | Transferência de Entrada                        |
| outgoing_funds_transfer                 | TED                                             |
| deposit                                 | Depósito                                        |
| withdrawal                              | Transferência                                   |
| withdrawal_reversal                     | Estorno de Transferência                        |
| trade_funds_transfer                    | Transferência de Pagamento de Cessão            |
| settlement_funds_transfer               | Transferência para Liquidação                   |
| bank_slip_fee                           | Tarifa de Boleto                                |
| bank_slip_settlement                    | Liquidação de Boleto                            |
| outgoing_funds_transfer_reversal        | Estorno de TED                                  |
| incoming_funds_transfer_refusal         | Transferência Negada                            |
| electronic_funds_fee_reversal           | Estorno de Tarifa de TED                        |
| monthly_account_fee_reversal            | Estorno de Tarifa de Manutenção de Conta        |
| bank_slip_fee_reversal                  | Estorno de Tarifa de Boleto                     |
| correspondent_bank_transfer             | Repasse de Correspondente Bancário              |
| credit_analysis_fee                     | Tarifa de Análise de Crédito                    |
| credit_operation_fee_reversal           | Estorno de Tarifa de Abertura de Crédito        |
| financial_investments_income            | Renda de Aplicação Financeira                   |
| bank_slip_settlement_reversal           | Estorno de Liquidação de Boleto                 |
| bank_slip_settlement_expense_reversal   | Estorno de Tarifa de liquidação de Boleto       |
| bank_slip_settlement_incoming_reversal  | Estorno de Recebimento de Liquidação de Boleto  |
| correspondent_bank_transfer_reversal    | Estrono de Repasse de Correspondente Bancário   |
| credit_analysis_fee_reversal            | Estorno de Tarifa de Análise de Crédito         |
| doc_expense_reversal                    | Estorno de Tarifa de DOC                        |
| incoming_doc_reversal                   | Estorno de Entrada de DOC                       |
| operation_disbursement_reversal         | Estorno de Desembolso da Operação               |
| operation_settling_reversal             | Estorno de Pagamento de Operação                |
| outgoing_doc_reversal                   | Estorno de Saída de DOC                         |
| rebate_reversal                         | Estorno de Rebate                               |
| settlement_funds_transfer_reversal      | Estorno de Transferência para Liquidação        |
| tax_reversal                            | Estorno de Impostos                             |
| trade_funds_transfer_reversal           | Estorno de Transferência de Pagamento de Cessão |
| bank_slip_permanency_fee                | Tarifa de Permanência do Título                 |
| bank_slip_cancel_protest_fee            | Tarifa de Permanência do Título                 |
| bank_slip_protest_fee                   | Tarifa de Pedido de Protesto                    |
| bank_slip_notary_office_fee             | Custas de Protesto                              |
| bank_slip_registration_fee              | Tarifa de Registro                              |
| bank_slip_extension_fee                 | Tarifa de Prorrogação                           |
| bank_slip_rebate_fee                    | Tarifa de Abatimento                            |
| bank_slip_discount_fee                  | Tarifa de Desconto                              |
| bank_slip_settlement_fee                | Tarifa de Liquidação                            |
| bank_slip_write_off_term_fee            | Tarifa de Baixa por Decurso de Prazo            |
| bank_slip_write_off_fee                 | Tarifa de Baixa                                 |
| bank_slip_cancel_protest_write_off_fee  | Tarifa de Sustação de Protesto com Baixa        |
| bank_slip_notary_office_settlement_fee  | Tarifa de Liquidação em Cartório                |
| rebate_tax_free                         | Repasse por Conta e Ordem                       |
| rebate_tax_free_reversal                | Estorno de Repasse por Conta e Ordem            |
| incoming_funds_transfer_reversal        | Estorno de Transferência Interna                |
| bank_slip_payment                       | Pagamento de Boleto                             |
| bank_slip_payment_reversal              | Estorno de Pagamento de Boleto                  |
| warranty_analysis_fee                   | Tarifa de Análise de Garantia                   |
| bank_slip_settlement_deposit            | Liquidação de Boleto                            |
| bank_slip_payment_withdrawal            | Pagamento de Boleto                             |
| account_setup_fee                       | Tarifa de Abertura de Conta                     |
| account_setup_fee_reversal              | Estorno de Tarifa de Abertura de Conta          |
| bank_slip_payment_withdrawal_reversal   | Estorno de Pagamento de Boleto                  |
| incoming_anticipation_of_receivable     | -                                               |
| incoming_credit_card_settlement         | Liquidação de cartão de crédito                 |
| incoming_debit_card_settlement          | Liquidação de cartão de débito                  |
| assignment_automatic_transfer           | Débito de Cessão Automática                     |
| assignment_automatic_transfer_reversal  | Estorno de Débito de Cessão Automática          |
| pix_fee                                 | Tarifa de PIX                                   |
| incoming_pix_transfer                   | Entrada de PIX                                  |
| outgoing_pix_transfer                   | Saída de PIX                                    |
| pix_fee_reversal                        | Estorno de Tarifa de PIX                        |
| incoming_pix_transfer_reversal          | Estorno de entrada de PIX                       |
| outgoing_pix_transfer_reversal          | Estorno de saída de PIX                         |
| pix_deposit                             | Depósito de PIX                                 |
| pix_withdrawal                          | Transferência de PIX                            |
| pix_withdrawal_reversal                 | Estorno de transferência de PIX                 |
| pix_chargeback_withdrawal               | Envio de devolução PIX                          |
| outgoing_pix_chargeback                 | Saída de PIX por devolução                      |
| incoming_pix_chargeback                 | Recebimento de devolução PIX                    |
| pix_chargeback_deposit                  | Entrada de PIX por devolução                    |
| pix_chargeback_withdrawal_reversal      | Estorno de envio de devolução PIX               |
| outgoing_pix_chargeback_reversal        | Estorno de saída de PIX por devolução           |
| incoming_pix_chargeback_reversal        | Estorno de recebimento de devolução PIX         |
| operation_pix_disbursement              | Desembolso PIX da Operação                      |
| operation_pix_disbursement_reversal     | Estorno de Desembolso PIX da Operação           |
| receivables_inquiry_fee                 | Tarifa de Consulta de Agenda de Recebíveis      |
| pix_deposit_reversal                    | Estorno de Depósito de PIX                      |
| internal_pix_transfer                   | Transferência de PIX                            |
| automatic_integrated_payment_reversal   | Estorno de Pagamento Automático Integrado       |
| operation_dibursement_reversal          | Estorno de Desembolso da Operação               |
| available_yield                         | Depósito de Investimento Liquido                |

 

### 8.2. Comprovantes 

O comprovante de uma transferência/pagamento pode ter seus dados recuperados através da “**transaction_key** ”.

        **Request**

- MÉTODO GET
- ENDPOINT /transaction_receipt/TRANSACTION-KEY

        **Response** - Para transferências/pagamentos PIX

Response Body

```json
{
	"chargeback_reason": null,
	"chargeback_returned_amount": null,
	"chargeback_unexpected_reason": null,
	"end_to_end_id": "E3240250220221120012039U3OKZZMW8",
	"origin_key": "cea836b5-b02e-4f94-b1e2-4d575671c33d",
	"original_transfer_data": null,
	"pix_message": null,
	"pix_transfer_type": "key",
	"receiver_conciliation_id": null,
	"source_account": {
		"account_branch": "0001",
		"account_digit": "2",
		"account_number": "2359934",
		"financial_institution_compe_number": 329,
		"financial_institution_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"owner_document_number": "09080702000105",
		"owner_name": "VOVO LUCIA CONVENIENCIA LTDA"
	},
	"source_subtype": "pix_withdrawal",
	"source_subtype_translation_ptbr": "Transferência de PIX",
	"target_account": {
		"account_branch": "0001",
		"account_digit": "2",
		"account_number": "1017372",
		"financial_institution_compe_number": 212,
		"financial_institution_name": "BANCO ORIGINAL S.A.",
		"is_internal": false,
		"ispb_number": "92894922",
		"owner_document_number": "***22181***",
		"owner_name": "Vivo Test",
		"target_pix_key": "65322181032"
	},
	"transacted_at": "2022-11-20 02:00:05",
	"transacted_at_br": "2022-11-19 23:00:05",
	"transaction_amount": 45,
	"transaction_key": "d2ba3817-26d7-4957-ab82-24f78d910a8a",
	"translated_chargeback_reason": null
}
```
 

        **Response** - Para transferências Internas ou Pagamento de TED

Response Body

```json

{
	"origin_key": "983b4a28-7de6-4e71-97ef-60fb50c7b013",
	"source_account": {
		"account_branch": "0001",
		"account_digit": "5",
		"account_number": "00002",
		"financial_institution_compe_number": 329,
		"financial_institution_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"owner_document_number": "32402502000135",
		"owner_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A."
	},
	"source_subtype": "internal_funds_transfer",
	"source_subtype_translation_ptbr": "Transferência Interna",
	"target_account": {
		"account_branch": "0001",
		"account_digit": "2",
		"account_number": "2359934",
		"financial_institution_compe_number": 329,
		"financial_institution_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"owner_document_number": "09080702000105",
		"owner_name": "VOVO LUCIA CONVENIENCIA LTDA"
	},
	"transacted_at": "2022-11-20 00:36:33",
	"transacted_at_br": "2022-11-19 21:36:33",
	"transaction_amount": 1000000,
	"transaction_key": "67a62397-2c32-4768-8485-ec9129a46654"
}
```

        **Response** - Para Pagamentos de Boletos

Response Body

```json
{
	"bank_slip": {
		"beneficiary": {
			"document_number": "32402502000135",
			"name": "QI SCD"
		},
		"digitable_line": "32990001031000699926165000000201993810000003500",
		"expiration_date": "2023-06-14",
		"financial_institution_compe_number": "329",
		"financial_institution_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"payer": {
			"document_number": "10932327656",
			"name": "Lucas Clarim"
		},
		"payment_date": "2022-11-22",
		"payment_key": "13b35108-0fdc-44ab-b86d-5dda12dc8dce"
	},
	"origin_key": "13b35108-0fdc-44ab-b86d-5dda12dc8dce",
	"source_account": {
		"account_branch": "0001",
		"account_digit": "2",
		"account_number": "2359934",
		"financial_institution_compe_number": 329,
		"financial_institution_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"owner_document_number": "09080702000105",
		"owner_name": "VOVO LUCIA CONVENIENCIA LTDA"
	},
	"source_subtype": "bank_slip_payment",
	"source_subtype_translation_ptbr": "Pagamento de Boleto",
	"transacted_at": "2022-11-22 12:26:21",
	"transacted_at_br": "2022-11-22 09:26:21",
	"transaction_amount": 35,
	"transaction_key": "eee862b9-7f2e-4eea-b04a-fa0e89442618"
}
```
 

### 8.3. Extratos

O extrato de uma conta pode ser recuperado através do seguinte endpoint:

        **Request**

- MÉTODO GET
- ENDPOINT /account_statement
- PARAMETERS account_key, document_number, date_from, date_to, page, page_size

        **Response** 

Response Body

```json
{
	"data": {
		"account_info": {
			"account_block_reason": null,
			"account_branch": "0001",
			"account_credentials": [{
					"account_id": 3395,
					"credential_type": "observer",
					"credential_type_id": 3,
					"document_number": "09080702000105",
					"id": 3244,
					"is_active": true,
					"name": "VOVO LUCIA CONVENIENCIA LTDA",
					"updated_at": null
				},
				{
					"account_id": 3395,
					"credential_type": "requester",
					"credential_type_id": 2,
					"document_number": "94310345000195",
					"id": 3245,
					"is_active": true,
					"name": "Parceiro Sandbox",
					"updated_at": null
				}
			],
			"account_digit": "2",
			"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
			"account_name": "Default",
			"account_number": "2359934",
			"account_status": "opened",
			"account_type": "checking",
			"automatic_transfer_management_status": {
				"created_at": "2022-10-27T13:48:18",
				"enumerator": "master"
			},
			"automatic_transfers": [],
			"balance": 999359,
			"blocked_balance": 0,
			"destinations": [],
			"fee": 0,
			"internal_webhooks": [],
			"investment_available_amount": 0,
			"investment_configuration": null,
			"owner_document_number": "09080702000105",
			"owner_name": "VOVO LUCIA CONVENIENCIA LTDA",
			"owner_person_key": "d2fddd2c-3436-41d5-97e0-5721ee871a3a",
			"permitted_person_keys": [
				"bffded45-5fcf-4d13-9d2a-566a0af338cc",
				"ef48fbe4-267b-45c1-9049-75345c075486"
			],
			"requester_key": "ef48fbe4-267b-45c1-9049-75345c075486",
			"requester_name": "Parceiro Sandbox",
			"setup_fee": null,
			"transactional_limit": null,
			"webhook_enabled": true
		},
		"transaction_list": [
			{
				"account_balance": 999359,
				"description": "001 0001 81156-1 109.323.276-56 - Lucas de Jesus Clarim",
				"source_subtype": "withdrawal",
				"transacted_at": "2022-11-21 14:39:56",
				"transaction_amount": -551,
				"transaction_key": "32ac0781-f292-4172-b58f-3310102e6fb9"
			},
			{
				"account_balance": 999910,
				"description": "329 0001 00002-5 32.402.502/0001-35 - QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
				"source_subtype": "internal_funds_transfer",
				"transacted_at": "2022-11-20 02:27:38",
				"transaction_amount": -45,
				"transaction_key": "9cee2272-b280-47ed-b9ec-00674f25db1b"
			},
			{
				"account_balance": 999955,
				"description": "212 0001 1017372-2 ***.221.81*-** BANCO ORIGINAL S.A.",
				"source_subtype": "pix_withdrawal",
				"transacted_at": "2022-11-20 02:00:05",
				"transaction_amount": -45,
				"transaction_key": "d2ba3817-26d7-4957-ab82-24f78d910a8a"
			},
			{
				"account_balance": 1000000,
				"description": "329 0001 00002-5 32.402.502/0001-35 - QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
				"source_subtype": "internal_funds_transfer",
				"transacted_at": "2022-11-20 00:36:33",
				"transaction_amount": 1000000,
				"transaction_key": "67a62397-2c32-4768-8485-ec9129a46654"
			}
		]
	},
	"event_datetime": "2022-11-22 12:57:44",
	"key": "d96fb39c-e80b-447b-aad8-191c9bd2eb17",
	"status": "success",
	"webhook_type": "account_statement"
}
```

## 9 - Gestão de Usuários

É possível realizar a inclusão e edição dos usuários administradores de uma conta aberta aberta. As inclusões sempre demanda autenticação de 2 fatores para os usuários que estão sendo adicionados.

### 9.1. Incluíndo um novo usuário a uma conta aberta

#### 9.1.1. Criação

Primeiro é necessário criar o usuário. No momento da criação a QI enviará um token para o usuário criado, por sms ou email.

        **Request**

- MÉTODO POST
- ENDPOINT /baas/token_request

 

Request Body

```json
{
	"contact_type": "sms",
	"agent_document_number": "97564480084",
	"person_creation": {
		"person": {
			"date_of_birth": "1987-01-11",
			"spouse_name": "sample spouse name",
			"birth_place": "sample birth place",
			"phone_number": {
				"country_code": "55",
				"area_code": "88",
				"number": "988887777"
			},
			"representative": null,
			"father_name": "sample father name",
			"address": {
				"street": "Rua Sample Avenue",
				"complement": "Apto 123",
				"state": "MG",
				"number": "1234",
				"neighborhood": "Cabral",
				"postal_code": "38300000",
				"city": "Ituiutaba"
			},
			"nationality": "Brasil",
			"document_identification_number": "890537823",
			"mother_name": "Sample Mama",
			"person_type": "natural",
			"name": "Sample Name Natural",
			"profession": "sample profession",
			"gender": null,
			"email": "sample@gmail.com",
			"document_number": "68346734500",
			"marital_status": null
		}
	}
}
```

A Autenticação de 2 fatores para criação/atualização de novos usuários só pode ser realizada via “sms”.

#### 9.1.2. Confirmação da criação

É necessário informar o token enviado para finalizar a criação do novo usuário:

        **Request**

- MÉTODO POST
- ENDPOINT /baas/movement_validation

Request Body

```json
{
	"token": "456785",
	"person_creation": {
		"person": {
			"date_of_birth": "1987-01-11",
			"spouse_name": "sample spouse name",
			"birth_place": "sample birth place",
			"phone_number": {
				"country_code": "55",
				"area_code": "88",
				"number": "988887777"
			},
			"representative": null,
			"father_name": "sample father name",
			"address": {
				"street": "Rua Sample Avenue",
				"complement": "Apto 123",
				"state": "MG",
				"number": "1234",
				"neighborhood": "Cabral",
				"postal_code": "38300000",
				"city": "Ituiutaba"
			},
			"nationality": "Brasil",
			"document_identification_number": "890537823",
			"mother_name": "Sample Mama",
			"person_type": "natural",
			"name": "Sample Name Natural",
			"profession": "sample profession",
			"gender": null,
			"email": "sample@gmail.com",
			"document_number": "68346734500",
			"marital_status": null
		}
	}
}
```

        **Response**

- MÉTODO POST
- ENDPOINT /baas/movement_validation

Response Body

```json
{
	"hash": "1ab3754bbe74e16c1bebfadd9b8fb9e3",
	"return_response": {
		"birth_place": null,
		"created_at": null,
		"date_of_birth": "1987-01-11T00:00:00",
		"document_identification_number": null,
		"email": "sample@gmail.com",
		"father_name": null,
		"gender": null,
		"is_pep": false,
		"kc_key": null,
		"marital_status": null,
		"mother_name": "Sample Mama",
		"nationality": "Brasil",
		"natural_revenue_range": {
			"average_amount": null,
			"created_at": "2021-03-12T13:26:08",
			"description": "Unavailable",
			"description_ptbr": "Indisponível",
			"enumerator": "0",
			"more_than_amount": null,
			"up_to_amount": null
		},
		"person": {
			"address": {
				"city": "Ituiutaba",
				"complement": "Apto 123",
				"created_at": null,
				"neighborhood": "Cabral",
				"number": "1234",
				"postal_code": "38300000",
				"state": "MG",
				"street": "Rua Sample Avenue"
			},
			"category": null,
			"category_nick": null,
			"created_at": null,
			"document_number": "44236096307",
			"domain": {
				"created_at": "2022-07-14T15:42:45",
				"domain_key": "7aa7e064-f06b-4e09-ae19-7c27694f545b",
				"domain_name": "Koin Soluções Domain Updated",
				"owner_person_key": "997d1b30-e40a-42a0-b87a-4191a5165494"
			},
			"internal_contact": null,
			"internal_contact_person_key": null,
			"name": "Sample Name Natural",
			"person_category": null,
			"person_code": 1564,
			"person_key": "9021859f-9860-41e6-af19-559a2599859c",
			"person_status": {
				"created_at": "2019-02-15T18:28:09",
				"enumerator": "pending",
				"translation_path": "onboarding.PersonStatus.pending"
			},
			"person_type": {
				"created_at": "2019-02-15T18:28:08",
				"enumerator": "natural",
				"translation_path": "onboarding.PersonType.natural"
			},
			"phone": [{
				"area_code": "16",
				"country_code": "55",
				"created_at": null,
				"number": "997239044",
				"phone_key": "b1c3f2d1-2433-4305-9d58-4dd83c30b7aa",
				"phone_type": null
			}],
			"professional_data": [],
			"qualifications": [],
			"registration_date": "2022-08-22",
			"risk": null,
			"special_attention": false,
			"terms_acknowledgement": false,
			"valid_cip_beneficiary": false
		},
		"profession": null,
		"revenue_amount": null,
		"spouse_name": null
	},
	"validation": true
}
```
 

#### 9.1.3. Criar vínculo profissional

Após a criação do usuário, é necessário vinculá-lo a uma empresa titular de uma conta aberta:

        **Request**

- MÉTODO POST
- ENDPOINT /baas/token_request

Request Body

```json
{
	"contact_type": "sms",
	"agent_document_number": "97564480084",
	"professional_data_creation": {
		"natural_person": "3ea7f034-f06b-4e28-ae19-7c23694f546b",
		"legal_person": "8bc83ae4-68e4-7bc9-8c84-077131ba2c93",
		"natural_person_roles": [{
				"product_type": "account",
				"role_type": "requester"
			},
			{
				"product_type": "escrow",
				"role_type": "requester"
			}
		],
		"post_type": "ceo"
	}
}
```
 

#### 9.1.4. Aprovar vínculo profissional

Para aprovar a inclusão do vínculo, é necessário enviar o token recebido pelo usuário administrador.

        **Request**

- MÉTODO POST
- ENDPOINT /baas/movement_validation

        ***Payload*** 

Response Body

```json
{
	"token": "076244",
	"professional_data_creation": {
		"natural_person": "3ea7f034-f06b-4e28-ae19-7c23694f546b",
		"legal_person": "8bc83ae4-68e4-7bc9-8c84-077131ba2c93",
		"natural_person_roles": [{
				"product_type": "account",
				"role_type": "requester"
			},
			{
				"product_type": "escrow",
				"role_type": "requester"
			}
		],
		"post_type": "ceo"
	}
}
```

        **Response**

- MÉTODO POST
- ENDPOINT /baas/movement_validation

        ***Body*** 

Response Body

```json
{
	"hash": "53d62e42d5299fca0d261ff1eae4bffc",
	"return_response": {
		"admission_date": "2022-08-22",
		"created_at": "2022-08-22T21:51:29",
		"email": null,
		"final_beneficiary": null,
		"is_active": true,
		"legal_person_key": "9bc89ea4-64e4-4bd9-8d84-077135ba2c93",
		"natural_person_key": "9021859f-9860-41e6-af19-559a2599859c",
		"natural_person_roles": [{
				"created_at": "2022-08-22T21:51:29",
				"natural_person_roles_events": [],
				"product_type": {
					"created_at": "2021-02-26T14:16:35",
					"enumerator": "account"
				},
				"role_type": {
					"created_at": "2021-02-26T14:14:52",
					"enumerator": "requester"
				},
				"updated_at": "2022-08-22T21:51:29"
			},
			{
				"created_at": "2022-08-22T21:51:29",
				"natural_person_roles_events": [],
				"product_type": {
					"created_at": "2022-04-08T14:51:34",
					"enumerator": "escrow"
				},
				"role_type": {
					"created_at": "2021-02-26T14:14:52",
					"enumerator": "requester"
				},
				"updated_at": "2022-08-22T21:51:29"
			}
		],
		"phone": null,
		"post_type": {
			"created_at": "2019-02-15T18:28:12",
			"enumerator": "ceo",
			"translation_path": "onboarding.PostType.ceo"
		},
		"profession_data_key": "bfe8bc59-533a-4c6a-be3a-af5137794c70",
		"updated_at": "2022-08-22T21:51:29"
	},
	"validation": true
}
```
 

### 9.2. Atualizando Dados de um Usuário Existente

Os dados de um usuário são sempre atualizados no nível do vínculo deste usuário com uma determinada empresa. Sendo assim, para realizar qualquer update, são sempre necessária a chave de identificação do usuário (“***natural_person***“) e a chave do vínculo deste usuário com a empresa (“***professional_data_key***“).

#### 9.2.1. Solicitar alteração

Primeiramente é necessário solicitar a atualização dos dados de um usuário em relação a uma determinada empresa.

        **Request**

- MÉTODO POST
- ENDPOINT /baas/token_request

Response Body

```json
{
	"contact_type": "sms",
	"agent_document_number": "97564480084",
	"professional_data_contact_update": {
		"professional_data_key": "4ba8ff34-e07b-4ea8-ae59-8c23994f546b",
		"natural_person": "3ea7f034-f06b-4e28-ae19-7c23694f546b",
		"email": "sample@gmail.com",
		"phone_number": {
			"country_code": "55",
			"area_code": "888",
			"number": "988887777"
		}
	}
}
```
 

#### 9.2.2. Aprovar solicitação de alteração

Para aprovar a alteração dos dados do usuário, é necessário enviar o token enviado ao usuário alvo da alteração:

        **Request**

- MÉTODO POST
- ENDPOINT /baas/movement_validation

Response Body

```json
{
	"token": "076244",
	"professional_data_contact_update": {
		"professional_data_key": "4ba8ff34-e07b-4ea8-ae59-8c23994f546b",
		"natural_person": "3ea7f034-f06b-4e28-ae19-7c23694f546b",
		"email": "sample@gmail.com",
		"phone_number": {
			"country_code": "55",
			"area_code": "888",
			"number": "988887777"
		}
	}
}
```

        **Response**

- MÉTODO POST
- ENDPOINT /baas/movement_validation

Response Body

```json
{
	"hash": "a355aade311f93ec87637e321f11386d",
	"return_response": {
		"admission_date": "2022-08-22",
		"created_at": "2022-08-22T21:51:29",
		"email": "contacto_info@fakemail.com",
		"final_beneficiary": null,
		"is_active": true,
		"legal_person_key": "9bc89ea4-64e4-4bd9-8d84-077135ba2c93",
		"natural_person_key": "9021859f-9860-41e6-af19-559a2599859c",
		"natural_person_roles": [{
				"created_at": "2022-08-22T21:51:29",
				"natural_person_roles_events": [],
				"product_type": {
					"created_at": "2021-02-26T14:16:35",
					"enumerator": "account"
				},
				"role_type": {
					"created_at": "2021-02-26T14:14:52",
					"enumerator": "requester"
				},
				"updated_at": "2022-08-22T21:51:29"
			},
			{
				"created_at": "2022-08-22T21:51:29",
				"natural_person_roles_events": [],
				"product_type": {
					"created_at": "2022-04-08T14:51:34",
					"enumerator": "escrow"
				},
				"role_type": {
					"created_at": "2021-02-26T14:14:52",
					"enumerator": "requester"
				},
				"updated_at": "2022-08-22T21:51:29"
			}
		],
		"phone": {
			"area_code": "16",
			"country_code": "55",
			"number": "997239044",
			"phone_type": "commercial"
		},
		"post_type": {
			"created_at": "2019-02-15T18:28:12",
			"enumerator": "ceo",
			"translation_path": "onboarding.PostType.ceo"
		},
		"profession_data_key": "bfe8bc59-533a-4c6a-be3a-af5137794c70",
		"updated_at": "2022-08-22T21:51:29"
	},
	"validation": true
}
```

---

# Manual BaaS - Serviço

URL: /en/documentation/casos_de_uso/manual_baas_servico

:::danger Atenção!
Os webhooks da QI Tech não devem ser mapeadas de forma restrita. 
Campos adicionais podem ser incluídos aos payloads dos webhooks retornados em nossas APIs.
:::

:::info Reenvio de Webhooks
Você pode consultar e reenviar webhooks seguindo as instruções detalhadas na documentação: [Reenvio de Webhooks](/documentation/notificacoes/reenvio_de_notificacoes).
:::

:::caution Atenção
Antes de iniciar o processo de abertura de conta, é de responsabilidade do parceiro realizar as análises de KYC e Prevenção a Fraude.

Para isso, deve ser utilizado o endpoint de análise descrito em [/onboarding](https://docs.zaig.com.br/onboarding/#introducao). 
:::

### 1 - Criando uma Conta

**1.1. Upload de documentos:** Antes da abertura da conta deve ser realizado o upload dos documentos da empresa. Seguem listas de documentos exigidos para cada tipo de empresa:

Para S.A.'s:

- Estatuto Social.

- Ata de Eleição dos Representantes Legais da empresa.

- Procuração (caso aplicável).

- Documento com foto de cada representante legal ou procurador.

Para os demais casos:

- Contrato social.

- Procuração (caso aplicável).

- Documento com foto de cada representante legal ou procurador.

Os documentos devem ser compactados em um arquivo “.zip” e enviados através do endpoint de [upload de documentos](/documentation/upload_de_documentos/).

        **Response**

ENDPOINT /upload
MÉTODO POST

Response Body

```json
{
    "document_key": "cd639c4a-2279-468a-a047-59865b8159ed",
    "document_md5": "8f5bef84cb07dc047017c0d304dbb6b8",
    "url": "https://storage.googleapis.com/sandbox-doc-api/documents/cd639c4a-2279-468a-a047-59865b8159ed/identificacao_teste.pdf"
}
```

:::info
**IMPORTANTE:** guarde essa “**document_key**”, pois ela será necessária na etapa da criação da conta.
:::
 

**1.2.1. Criação da conta PJ:**

        **Request**

ENDPOINT /account
MÉTODO POST

Request Body

```json

{
	"account_owner": {
		"address": {
			"city": "Limeira",
			"complement": "complemento",
			"neighborhood": "Vila Cidade Jardim",
			"number": "662",
			"postal_code": "13480290",
			"state": "SP",
			"street": "Avenida Campinas"
		},
		"cnae_code": "4721-1/02",
		"company_statute": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d",
		"company_document_number": "09080702000105",
		"company_type": "ltda",
		"email": "padaria@vovolucia.com.br",
		"foundation_date": "1950-08-21",
		"annual_revenue_amount": "1000000.00",
		"name": "VOVO LUCIA CONVENIENCIA LTDA",
		"person_type": "legal",
		"phone": {
			"area_code": "19",
			"country_code": "055",
			"number": "988888888"
		},
		"trading_name": "Empadaria Vovo Lucia",
		"company_representatives": [{
				"address": {
					"city": "Recife",
					"complement": null,
					"neighborhood": "Fundão",
					"number": "137",
					"postal_code": "52221110",
					"state": "PE",
					"street": "Rua Camapuã"
				},
				"birth_date": "1972-02-02",
				"document_identification_number": "339122924",
				"document_identification": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d",
				"email": "marcos.alves@yopmail.com",
				"individual_document_number": "08531309069",
				"is_pep": false,
				"final_beneficiary": true,
				"marital_status": "single",
				"mother_name": "Sueli Isadora Alves",
				"name": "Marcos Felipe Henrique Alves",
				"nationality": "Brasileira",
				"person_type": "natural",
				"phone": {
					"area_code": "88",
					"country_code": "055",
					"number": "995924634"
				}
			},
			{
				"person_type": "natural",
				"name": "Juliana Tereza Bernardes",
				"mother_name": "Maria Mariane",
				"birth_date": "1990-05-06",
				"profession": "Deputada",
				"nationality": "Brasileira",
				"marital_status": "single",
				"is_pep": false,
				"final_beneficiary": true,
				"individual_document_number": "97564480084",
				"document_identification_number": "232479719",
				"document_identification": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d",
				"email": "juliana.tereza@yopmail.com",
				"phone": {
					"country_code": "055",
					"area_code": "11",
					"number": "912821359"
				},
				"address": {
					"street": "Passagem Mariana",
					"state": "PA",
					"city": "Ananindeua",
					"neighborhood": "Águas Lindas",
					"number": "660",
					"postal_code": "67118003",
					"complement": "complemento"
				}
			}
		]
	}
}
```

“***account_owner***”: Os dados da empresa devem ser enviados neste objeto.

“***account_owner.company_statute***”: A “***document_key***” retornada no endpoint de upload de documentos, no momento do upload do “.zip” dos documentos societários da empresa, deve ser enviada neste campo.

“***account_owner.company_representatives***”: A lista com os dados dos representantes legais da empresa deve ser enviada neste objeto. Deve ser enviado, no mínimo, os representantes legais, suficientes para representar legalmente a empresa conforme seu respectivo estatuto/contrato social. A validação dos poderes de cada representante legal enviado fica a cargo do parceiro.

“***account_owner.company_representatives.document_identification***”: A “***document_key***” retornada no endpoint de upload de documentos, no momento do upload do “.zip” do documento com foto do representante, deve ser enviada neste campo.  

        **Response**

ENDPOINT /account
MÉTODO POST

Response Body

```json
{
	"data": {
		"account_info": {
			"account_branch": "0001",
			"account_digit": "2",
			"account_number": "2359934",
			"financial_institution_code": "329"
		},
		"account_owner": {
			"document_number": "09080702000105",
			"name": "VOVO LUCIA CONVENIENCIA LTDA"
		}
	},
	"event_datetime": "2022-09-02 22:39:10",
	"key": "\<UUID PROPOSAL-KEY\>",
	"status": "pending_kyc_analysis",
	"webhook_type": "account"
}
```

:::info
**IMPORTANTE:** a “***key***” retornada nesta resposta é a **PROPOSAL-KEY** do pedido de abertura da conta. Ela deve ser armazenada para leitura do webhook de abertura da conta.
:::

A resposta da solicitação de abertura de conta sempre retornará o status “***pending_kyc_analysis***”.
Um número de conta será reservado para esse cliente, porém a conta ainda estará pendente de análise de KYC por parte da QI Tech. Neste momento, a conta não estará aberta e não poderá receber ou enviar recursos.

**1.2.2. Criação da conta PF:**

        **Request**

ENDPOINT /account
MÉTODO POST

Request Body

```json
{
	"account_owner": {
		"address": {
			"street": "Avenida Sargento Geraldo Sant'Ana",
			"number": "1100",
			"neighborhood": "Jardim Taquaral",
			"city": "São Paulo",
			"state": "SP",
			"postal_code": "04674225"
		},
		"phone": {
			"country_code": "055",
			"number": "912828135",
			"area_code": "11"
		},
		"email": "juliana.tereza@yopmail.com",
		"name": "Juliana Tereza Bernardes",
		"person_type": "natural",
		"nationality": "Brasil",
		"birth_date": "1993-08-02",
		"mother_name": "Patricia Monica Diaz Bascur Tieppo",
		"is_pep": false,
		"individual_document_number": "97564480084",
		"document_identification": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d",
		"document_identification_type": "cnh",
        "revenue_amount": 1000,
        "profession": "autonomo"
	}
}
```

“***account_owner***”: Os dados da pessoa física titular da conta devem ser enviados neste objeto.

“***account_owner.document_identification***”: A “***document_key***” retornada no endpoint de upload de documentos.

        **1.2.2.1. Forma de envio do documento de identificação:** Na abertura da conta PF, podem ser enviados dois tipos de documento (***document_identification_type***): cnh ou rg.
O documento de identificação pode ser enviado nos formatos “.pdf”, “.png” e “.jpeg”.

           &nbsp**1.2.2.1.1. Envio de documento de identificação do tipo CNH:**

Caso o documento seja enviado em 2 arquivos, sendo que, a frente do documento consta em um arquivo e o verso em outro, os seguintes campos devem ser infomado no objeto ***account_owner*** do endpoint **/account (1.2.2.)**:

"document_identification": "\ ",
"document_identification_back": "\ ",
		"document_identification_type": "cnh",

Caso o documento seja enviado em 1 arquivo, contendo a frente e verso do documento no mesmo arquivo (**foto do documento ou cnh digital**), os seguintes campos devem ser infomado no objeto ***account_owner*** do endpoint ***/account*** (**1.2.2.**):

"document_identification": "\ ",
		"document_identification_type": "cnh",
           &nbsp**1.2.2.1.2. Envio de documento de identificação do tipo RG:** 
Para o tipo de documento RG, sempre devem ser enviados 2 arquivos, um contendo a frente do documento e outro com o verso do documento. Para este caso os seguintes campos devem ser infomados no objeto ***account_owner*** do endpoint ***/account*** (**1.2.2.**):

"document_identification": "\ ",
"document_identification_back": "\ ",
		"document_identification_type": "rg",
 

        **Response**

ENDPOINT /account
MÉTODO POST

Response Body

```json
{
	"data": {
		"account_info": {
			"account_branch": "0001",
			"account_digit": "2",
			"account_number": "2359934",
			"financial_institution_code": "329"
		},
		"account_owner": {
            "document_number": "97564480084",
			"name": "Juliana Tereza Bernardes"
		}
	},
	"event_datetime": "2022-09-02 22:39:10",
	"key": "\<UUID PROPOSAL-KEY\>",
	"status": "pending_kyc_analysis",
	"webhook_type": "account"
}
```

:::info
**IMPORTANTE:** a “**key**” retornada nesta resposta é a **PROPOSAL-KEY** do pedido de abertura da conta. Ela deve ser armazenada para leitura do webhook de abertura da conta.
:::

A resposta da solicitação de abertura de conta sempre retornará o status “***pending_kyc_analysis***”.
Um número de conta será reservado para esse cliente, porém a conta ainda estará pendente de análise de KYC por parte da QI Tech. Neste momento, a conta não estará aberta e não poderá receber ou enviar recursos.

:::info
Para simular situações de aprovação, reprovação e analise manual pode ser utilizado o primeiro digito do CPF/CNPJ do owner da conta:

- 0 à 7 -> Aprovação Automática

- 8 -> Reprovação Automática

- 9 -> Análise Manual
:::

**1.2.3.** Após a conclusão da análise de KYC/PLD pela QI Tech, será enviado um webhook de abertura da conta, conforme abaixo:

        **Webhook**

WEBHOOK_TYPE account
SOURCE_SUB_TYPE Account Opened

Body

```json
{
	"data": {
		"account_info": {
			"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
			"account_digit": "2",
			"account_branch": "0001",
			"account_number": "2359934",
			"financial_institution_code": "329"
		},
		"account_owner": {
			"name": "VOVO LUCIA CONVENIENCIA LTDA",
			"document_number": "09080702000105"
		}
	},
	"event_datetime": "2022-09-02 22:39:39",
	"key": "\<UUID PROPOSAL-KEY\>",
	"status": "account_opened",
	"webhook_type": "account"
}
```

:::info
Neste momento será retornada “***account_key***” da conta e ela estará pronta para utilização.
:::

**1.2.4.** Caso a conta não passe no processo de KYC/PLD, será enviado um webhook de conta rejeitada:

        **Webhook**

WEBHOOK_TYPE available_balance
STATUS Success

Body

```json
{
	"data": {
		"account_info": {
			"account_digit": "2",
			"account_branch": "0001",
			"account_number": "2359934",
			"financial_institution_code": "329"
		},
		"account_owner": {
			"name": "VOVO LUCIA CONVENIENCIA LTDA",
			"document_number": "09080702000105"
		}
	},
	"event_datetime": "2022-09-02 22:39:39",
	"key": "\<UUID PROPOSAL-KEY\>",
	"status": "account_rejected",
	"webhook_type": "account"
}
```

**1.3. Recuperando dados da conta:**

        **Request**

ENDPOINT /account
MÉTODO POST
PARAMETERS account_type[checking], owner_name, account_number, owner_document_number, account_status[opened, closed, blocked], page, page_size

Request Body

```json
{
	"data": [
		{
			"account_block_reason": null,
			"account_branch": "0001",
			"account_credentials": [{
					"account_id": 3395,
					"created_at": "2022-09-02T22:39:39",
					"credential_type": {
						"created_at": "2019-06-18T13:19:30",
						"enumerator": "observer",
						"id": 3,
						"translation_path": "account.CredentialType.observer"
					},
					"credential_type_id": 3,
					"id": 3244,
					"is_active": true,
					"person_key": "bffded45-5fcf-4d13-9d2a-566a0af338cc",
					"updated_at": null
				},
				{
					"account_id": 3395,
					"created_at": "2022-09-02T22:39:39",
					"credential_type": {
						"created_at": "2019-06-18T13:19:30",
						"enumerator": "requester",
						"id": 2,
						"translation_path": "account.CredentialType.requester"
					},
					"credential_type_id": 2,
					"id": 3245,
					"is_active": true,
					"person_key": "ef48fbe4-267b-45c1-9049-75345c075486",
					"updated_at": null
				}
			],
			"account_digit": "2",
			"account_documents": [],
			"account_events": [{
				"account_id": 3395,
				"created_at": "2022-09-02T22:39:39",
				"id": 5132,
				"new_account_status": {
					"created_at": "2019-10-11T18:58:31",
					"enumerator": "opened",
					"id": 1,
					"translation_path": "account.AccountStatus.opened"
				},
				"new_account_status_id": 1,
				"old_account_status": null,
				"old_account_status_id": null
			}],
			"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
			"account_name": "Default",
			"account_number": "2359934",
			"account_status": {
				"created_at": "2019-10-11T18:58:31",
				"enumerator": "opened",
				"translation_path": "account.AccountStatus.opened"
			},
			"account_type": {
				"created_at": "2019-03-15T13:09:15",
				"enumerator": "checking",
				"translation_path": "account.AccountType.checking"
			},
			"automatic_transfer_management_status": {
				"created_at": "2022-10-27T13:48:18",
				"enumerator": "master"
			},
			"automatic_transfers": [],
			"balance": 0,
			"blocked_balance": 0,
			"blocked_balance_events": [],
			"created_at": "2022-09-02T22:39:39",
			"destinations": [],
			"fee": 0,
			"internal_webhooks": [],
			"investment_available_amount": 0,
			"investment_configuration": null,
			"is_system_account": false,
			"owner_document_number": "09080702000105",
			"owner_name": "VOVO LUCIA CONVENIENCIA LTDA",
			"owner_person_key": "bffded45-5fcf-4d13-9d2a-566a0af338cc",
			"permitted_person_keys": [
				"bffded45-5fcf-4d13-9d2a-566a0af338cc",
				"bffded45-5fcf-4d13-9d2a-566a0af338cc",
				"ef48fbe4-267b-45c1-9049-75345c075486"
			],
			"requester_key": "ef48fbe4-267b-45c1-9049-75345c075486",
			"requester_name": "Requester Name Sandbox",
			"setup_fee": null,
			"transactional_limit": null,
			"webhook_enabled": true
		}, ...
	],
	"pagination": {
		"current_page": 1,
		"next_page": null,
		"rows_per_page": 100,
		"total_pages": 1,
		"total_rows": 8
	}
}
```

:::info
Os campos mais pertinentes da resposta da consulta dos dados da conta são: 
**account_branch**, **account_digit**, **account_key**,**account_number**, **balance**, **owner_document_number**, **owner_name**, **owner_person_key**.
:::

--- 

### 2 - Transferência PIX
**2.1. Realizar Transferência PIX:** para realizar um PIX é necessário realizar três chamadas:

1. Criação do pedido de transferência: **/baas/pix_transfer**

2. Aprovação da transferência: **/baas/pix_transfer_approval**

:::info
Uma transferência PIX pode ser realizada utilizando dois payloads distintos: **chave PIX** ou **dados bancários**.
:::

**2.2. Transferência utilizando uma chave PIX (CPF, CNPJ, E-mail, Celular ou chave aleatória):**

        **Request**

ENDPOINT /baas/pix_transfer
MÉTODO POST

Request Body

```json
{
    "pix_transfer_type": "key",
    "source_account": {
        "account_branch": "0001",
        "account_digit": "2",
        "account_number": "2359934",
        "owner_document_number": "09080702000105"
    },
    "pix_key": "65322181032",
    "transaction_amount": 45,
    "requester_document_identification": "09080702000105"
}
```

:::info
A “***pix_key***” pode ser um **CPF**, **CNPJ**, **E-mail**, **Celular** ou uma **Chave Aleatória** (UUID), seguindo as seguintes formatações:

**CPF:** Número inteiro com 11 dígitos.

**CNPJ:** Número inteiro com 14 dígitos.

**E-mail:** Texto contendo ao menos um “@”.

**Celular:** Texto contendo os seguintes valores: “+55” + “[DDD do celular]“ + “[Número Inteiro do Celular com no mínimo 8 e no máximo 9 dígitos]”. Ex: “+5511987654321“.

**Chave Aleatória:** UUID.
:::

**2.3. Transferência utilizando dados da Conta Bancária (PIX Manual):**

        **Request**

ENDPOINT /baas/pix_transfer
MÉTODO POST

Request Body

```json
{
    "pix_transfer_type": "manual",
    "source_account": {
        "account_branch": "0001",
        "account_digit": "2",
        "account_number": "2359934",
        "owner_document_number": "09080702000105"
    },
    "target_account": {
          "account_branch": "0001",
          "account_digit": "3",
          "account_number": "12345678",
          "owner_document_number": "32402502000135",
          "owner_name": "Qi Tech",
          "account_type": "checking_account",
          "ispb": "32402502"
     },
    "transaction_amount": 45
}
```

Utilizando o PIX Manual é necessário informar o ISPB da instituição destino. Este dado é utilizado, pois existem instituições de pagamento que recebem PIX, porém não possuem código de banco. O ISPB é a base do CNPJ da instituição. Para ter acesso à lista completa de ISPB’s de cada instituição participante do PIX, basta utilizar o endpoint de consulta em nossa documentação: /documentation/lista_de_instituicoes_financeiras/consulta_de_instituicoes_financeiras

 
        **Response**

ENDPOINT /baas/pix_transfer
MÉTODO POST

Response Body

```json
{
	"data": {
		"end_to_end_id": "E3240250220221120012039U3OKZZMW8",
		"fee_amount": 1,
		"pix_message": null,
		"pix_transfer_key": "cea836b5-b02e-4f94-b1e2-4d575671c33d",
		"source_account": {
			"account_brach": "0001",
			"account_digit": "2",
			"account_number": "2359934",
			"account_type": "checking",
			"owner_document_number": "09080702000105",
			"owner_name": "VOVO LUCIA CONVENIENCIA LTDA"
		},
		"target_account": {
			"document_number": "***.221.81*-**",
			"financial_institution": "BANCO ORIGINAL S.A."
		},
		"transaction_amount": 45,
		"transfer_purpose": "transfer"
	},
	"event_datetime": "2022-09-02 22:20:47",
	"operation_key": "86d80cf4-430b-4e16-910a-41798810ddcf",
	"status": "pending_approval"
}
```

:::info
Possíveis status da solicitação de transferência/pagamento via PIX: 

**pending_approval:** transferência pendente de aprovação pelo solicitante

**sent:** transferência enviada
:::

Para aprovar a transferência PIX, é necessário utilizar a “***pix_transfer_key***” retornada na solicitação de transferência (***/baas/pix_transfer***):

        **Request**

ENDPOINT /baas/pix_transfer_approval
MÉTODO POST

Request Body

```json
{
    "pix_transfer_key": "cea836b5-b02e-4f94-b1e2-4d575671c33d",
    "approver_document_number": "97564480084"
}
```

        **Response**

ENDPOINT /baas/pix_transfer_approval
MÉTODO POST

Response Body

```json
{
	"data": {
		"end_to_end_id": "E3240250220221120012039U3OKZZMW8",
		"fee_amount": 1,
		"pix_message": null,
		"pix_transfer_key": "cea836b5-b02e-4f94-b1e2-4d575671c33d",
		"source_account": {
			"account_brach": "0001",
			"account_digit": "2",
			"account_number": "2359934",
			"account_type": "checking",
			"owner_document_number": "09080702000105",
			"owner_name": "VOVO LUCIA CONVENIENCIA LTDA"
		},
		"target_account": {
			"document_number": "***.221.81*-**",
			"financial_institution": "BANCO ORIGINAL S.A."
		},
		"transaction_amount": 45,
		"transfer_purpose": "transfer"
	},
	"event_datetime": "2022-09-02 22:20:47",
	"operation_key": "86d80cf4-430b-4e16-910a-41798810ddcf",
	"status": "sent"
}
```

STATUS 422

Response Body

```json
{
  "data": "{\"title\": \"Pending Transfer\", \"description\": \"The transaction (<END TO END ID DO PIX>) could not be completed and is pending confirmation.\", \"translation\": \"Não foi possível concluir a transação (<END TO END ID DO PIX>) e ela está pendente de confirmação\", \"code\": \"PXT000072\"}"
}

```

:::danger HTTP Error 422
Caso seja retornado **http error 422**, a solicitação de Pix **não deve ser retentada**. É preciso checar o status da solicitação de transferência Pix através de um GET na rota [/baas/pix/pix_transfer](/documentation/pix/pesquisar_por_transferencia_pix_de_saida).
:::

--- 

### 3 - Movimentações, Comprovantes e Extratos

**3.1. Movimentações:**

Para toda e qualquer movimentação será enviado um webhook de “***account_transaction***“.

Cada transação possui um tipo de classificação (**Source Sub Type**). Essa classificação é utilizada para categorizar cada movimentação na conta. A lista de Source Sub Types pode ser vista no **Anexo I** deste manual.

**3.1.1.** Os créditos em conta resultarão em um webhook com “***data.amount***” positivo, “***data.origin***“ sendo a conta de origem dos recursos e a “***data.destination***“ sendo a conta de destino dos recursos:

        **Webhook**

WEBHOOK_TYPE account_transaction

Body: Pix

```json

{
    "key": "\<ACCOUNT-KEY\>",
	"data": {
		"amount": 1000000,
		"origin": {
			"name": "Treasury Account",
			"branch": "0001",
			"document": "32402502000135",
			"account_key": "5d068423-6094-49e4-b15b-7740038295a8",
			"account_digit": "5",
			"account_number": "00002"
		},
		"timestamp": "2022-09-02T21:36:33.446120",
		"description": "329 0001 00002-5 32.402.502/0001-35 - QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"destination": {
			"name": "Default",
			"branch": "0001",
			"document": "09080702000105",
			"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
			"account_digit": "2",
			"account_number": "2359934"
		},
		"reference_key": "983b4a28-7de6-4e71-97ef-60fb50c7b013",
		"reference_type": "movement_request",
		"account_balance": 1000000,
		"source_sub_type": "internal_funds_transfer",
		"transaction_key": "67a62397-2c32-4768-8485-ec9129a46654",
		"source_sub_type_str": "Transferência Interna",
		"transaction_details": {
			"payer_name": "0001",
			"receiver_name": "Default",
			"payer_account_digit": "5",
			"payer_account_branch": "",
			"payer_account_number": "1111111",
			"payer_document_number": "66681638999999",
			"receiver_account_digit": "6",
			"receiver_account_branch": "0000",
			"receiver_account_number": "34256449809",
			"receiver_conciliation_id": null,
			"receiver_document_number": "00809641658"
		}
	},
	"datetime": "2022-09-02T21:36:33.446120",
	"webhook_type": "account_transaction"
}
```

Body: Outras transações

```json

{
    "key": "\<ACCOUNT-KEY\>",
	"data": {
		"amount": 1000000,
		"origin": {
			"name": "Treasury Account",
			"branch": "0001",
			"document": "32402502000135",
			"account_key": "5d068423-6094-49e4-b15b-7740038295a8",
			"account_digit": "5",
			"account_number": "00002"
		},
		"timestamp": "2022-09-02T21:36:33.446120",
		"description": "329 0001 00002-5 32.402.502/0001-35 - QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"destination": {
			"name": "Default",
			"branch": "0001",
			"document": "09080702000105",
			"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
			"account_digit": "2",
			"account_number": "2359934"
		},
		"reference_key": "983b4a28-7de6-4e71-97ef-60fb50c7b013",
		"reference_type": "movement_request",
		"account_balance": 1000000,
		"source_sub_type": "internal_funds_transfer",
		"transaction_key": "67a62397-2c32-4768-8485-ec9129a46654",
		"source_sub_type_str": "Transferência Interna"
	},
	"datetime": "2022-09-02T21:36:33.446120",
	"webhook_type": "account_transaction"
}
```

**3.1.2.** Os débitos em conta resultarão em um webhook com “data.amount” negativo, “***data.origin***“ sendo a conta destinatária dos recursos e a “***data.destination***“ sendo a conta de origem dos recursos:

        **Webhook**

WEBHOOK_TYPE account_transaction

Body

```json
{
	"key": "\<ACCOUNT-KEY\>",
	"data": {
		"amount": -45,
		"origin": {
			"name": "PIX",
			"branch": "0001",
			"document": "32402502000135",
			"account_key": "3d0e7d50-e898-49f3-b23b-05353c8a3c72",
			"account_digit": "3",
			"account_number": "00003"
		},
		"timestamp": "2022-09-02T23:00:05.326738",
		"description": "212 0001 1017372-2 ***.221.81*-** BANCO ORIGINAL S.A.",
		"destination": {
			"name": "Default",
			"branch": "0001",
			"document": "09080702000105",
			"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
			"account_digit": "2",
			"account_number": "2359934"
		},
		"reference_key": "cea836b5-b02e-4f94-b1e2-4d575671c33d",
		"reference_type": "pix_outgoing",
		"account_balance": 999955,
		"source_sub_type": "pix_withdrawal",
		"transaction_key": "d2ba3817-26d7-4957-ab82-24f78d910a8a",
		"source_sub_type_str": "Transferência de PIX"
	},
	"datetime": "2022-09-02T23:00:05.326738",
	"webhook_type": "account_transaction"
}
```

**Lista de source_sub_types’s:**

|Enum|Descrição|
|--|--|
|operation_disbursement|		Desembolso da Operação|
|protest_expense|		Despesas de Protesto|
|automatic_integrated_payment|		Pagamento Automático Integrado|
|tax	|	Impostos|
|electronic_funds_fee|		Tarifa de TED|
|credit_operation_fee|		Tarifa de Abertura de Crédito|
|internal_funds_transfer|		Transferência Interna|
|incoming_funds_transfer|		Transferência de Entrada|
|outgoing_funds_transfer|		TED|
|deposit|		Depósito|
|withdrawal	|	Transferência|
|withdrawal_reversal	|	Estorno de Transferência|
|trade_funds_transfer|		Transferência de Pagamento de Cessão|
|settlement_funds_transfer|		Transferência para Liquidação|
|bank_slip_fee	|	Tarifa de Boleto|
|bank_slip_settlement|		Liquidação de Boleto|
|outgoing_funds_transfer_reversal|		Estorno de TED|
|incoming_funds_transfer_refusal	|	Transferência Negada|
|electronic_funds_fee_reversal|	Estorno de Tarifa de TED|
|monthly_account_fee_reversal|	Estorno de Tarifa de Manutenção de Conta|
|bank_slip_fee_reversal	|Estorno de Tarifa de Boleto|
|correspondent_bank_transfer|	Repasse de Correspondente Bancário|
|credit_analysis_fee	|Tarifa de Análise de Crédito|
|credit_operation_fee_reversal|	Estorno de Tarifa de Abertura de Crédito|
|financial_investments_income|	Renda de Aplicação Financeira|
|bank_slip_settlement_reversal|	Estorno de Liquidação de Boleto|
|bank_slip_settlement_expense_reversal|	Estorno de Tarifa de liquidação de Boleto|
|bank_slip_settlement_incoming_reversal|	Estorno de Recebimento de Liquidação de Boleto|
|correspondent_bank_transfer_reversal|	Estrono de Repasse de Correspondente Bancário|
|credit_analysis_fee_reversal|	Estorno de Tarifa de Análise de Crédito|
|doc_expense_reversal|	Estorno de Tarifa de DOC|
|incoming_doc_reversal|	Estorno de Entrada de DOC|
|operation_disbursement_reversal|	Estorno de Desembolso da Operação|
|operation_settling_reversal|	Estorno de Pagamento de Operação|
|outgoing_doc_reversal|	Estorno de Saída de DOC|
|rebate_reversal	|Estorno de Rebate|
|settlement_funds_transfer_reversal|	Estorno de Transferência para Liquidação|
|tax_reversal|	Estorno de Impostos|
|trade_funds_transfer_reversal|	Estorno de Transferência de Pagamento de Cessão|
|bank_slip_permanency_fee	|Tarifa de Permanência do Título|
|bank_slip_cancel_protest_fee	|Tarifa de Permanência do Título|
|bank_slip_protest_fee|	Tarifa de Pedido de Protesto|
|bank_slip_notary_office_fee|	Custas de Protesto|
|bank_slip_registration_fee|	Tarifa de Registro|
|bank_slip_extension_fee|	Tarifa de Prorrogação|
|bank_slip_rebate_fee	|Tarifa de Abatimento|
|bank_slip_discount_fee|	Tarifa de Desconto|
|bank_slip_settlement_fee|	Tarifa de Liquidação|
|bank_slip_write_off_term_fee|	Tarifa de Baixa por Decurso de Prazo|
|bank_slip_write_off_fee	|Tarifa de Baixa|
|bank_slip_cancel_protest_write_off_fee|	Tarifa de Sustação de Protesto com Baixa|
|bank_slip_notary_office_settlement_fee|	Tarifa de Liquidação em Cartório|
|rebate_tax_free	|Repasse por Conta e Ordem|
|rebate_tax_free_reversal|	Estorno de Repasse por Conta e Ordem|
|incoming_funds_transfer_reversal|	Estorno de Transferência Interna|
|bank_slip_payment|	Pagamento de Boleto|
|bank_slip_payment_reversal|	Estorno de Pagamento de Boleto|
|warranty_analysis_fee	|Tarifa de Análise de Garantia|
|bank_slip_settlement_deposit|	Liquidação de Boleto|
|bank_slip_payment_withdrawal	|Pagamento de Boleto|
|account_setup_fee	|Tarifa de Abertura de Conta|
|account_setup_fee_reversal|	Estorno de Tarifa de Abertura de Conta|
|bank_slip_payment_withdrawal_reversal|	Estorno de Pagamento de Boleto|
|incoming_anticipation_of_receivable|	-|
|incoming_credit_card_settlement|	Liquidação de cartão de crédito|
|incoming_debit_card_settlement|	Liquidação de cartão de débito|
|assignment_automatic_transfer	|Débito de Cessão Automática|
|assignment_automatic_transfer_reversal	|Estorno de Débito de Cessão Automática|
|pix_fee|	Tarifa de PIX|
|incoming_pix_transfer|	Entrada de PIX|
|outgoing_pix_transfer|	Saída de PIX|
|pix_fee_reversal|	Estorno de Tarifa de PIX|
|incoming_pix_transfer_reversal|	Estorno de entrada de PIX|
|outgoing_pix_transfer_reversal|	Estorno de saída de PIX|
|pix_deposit|	Depósito de PIX|
|pix_withdrawal|	Transferência de PIX|
|pix_withdrawal_reversal	|Estorno de transferência de PIX|
|pix_chargeback_withdrawal|	Envio de devolução PIX|
|outgoing_pix_chargeback	|Saída de PIX por devolução|
|incoming_pix_chargeback|	Recebimento de devolução PIX|
|pix_chargeback_deposit|	Entrada de PIX por devolução|
|pix_chargeback_withdrawal_reversal	|Estorno de envio de devolução PIX|
|outgoing_pix_chargeback_reversal	|Estorno de saída de PIX por devolução|
|incoming_pix_chargeback_reversal	|Estorno de recebimento de devolução PIX|
|operation_pix_disbursement|	Desembolso PIX da Operação|
|operation_pix_disbursement_reversal|	Estorno de Desembolso PIX da Operação|
|receivables_inquiry_fee	|Tarifa de Consulta de Agenda de Recebíveis|
|pix_deposit_reversal	|Estorno de Depósito de PIX|
|internal_pix_transfer	|Transferência de PIX|
|automatic_integrated_payment_reversal	|Estorno de Pagamento Automático Integrado|
|operation_dibursement_reversal|	Estorno de Desembolso da Operação|
|available_yield|	Depósito de Investimento Liquido|

**3.2. Comprovantes:** O comprovante de uma transferência/pagamento pode ter seus dados recuperados através da “***transaction_key***”.

        **Request**

ENDPOINT /transaction_receipt/[TRANSACTION-KEY]
MÉTODO GET

Response Body - Para transferências/pagamentos PIX

```json

{
	"chargeback_reason": null,
	"chargeback_returned_amount": null,
	"chargeback_unexpected_reason": null,
	"end_to_end_id": "E3240250220221120012039U3OKZZMW8",
	"origin_key": "cea836b5-b02e-4f94-b1e2-4d575671c33d",
	"original_transfer_data": null,
	"pix_message": null,
	"pix_transfer_type": "key",
	"receiver_conciliation_id": null,
	"source_account": {
		"account_branch": "0001",
		"account_digit": "2",
		"account_number": "2359934",
		"financial_institution_compe_number": 329,
		"financial_institution_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"owner_document_number": "09080702000105",
		"owner_name": "VOVO LUCIA CONVENIENCIA LTDA"
	},
	"source_subtype": "pix_withdrawal",
	"source_subtype_translation_ptbr": "Transferência de PIX",
	"target_account": {
		"account_branch": "0001",
		"account_digit": "2",
		"account_number": "1017372",
		"financial_institution_compe_number": 212,
		"financial_institution_name": "BANCO ORIGINAL S.A.",
		"is_internal": false,
		"ispb_number": "92894922",
		"owner_document_number": "***22181***",
		"owner_name": "Vivo Test",
		"target_pix_key": "65322181032"
	},
	"transacted_at": "2022-11-20 02:00:05",
	"transacted_at_br": "2022-11-19 23:00:05",
	"transaction_amount": 45,
	"transaction_key": "d2ba3817-26d7-4957-ab82-24f78d910a8a",
	"translated_chargeback_reason": null
}
```

 
Response Body - Para transferências Internas ou Pagamento de TED

```json
{
	"origin_key": "983b4a28-7de6-4e71-97ef-60fb50c7b013",
	"source_account": {
		"account_branch": "0001",
		"account_digit": "5",
		"account_number": "00002",
		"financial_institution_compe_number": 329,
		"financial_institution_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"owner_document_number": "32402502000135",
		"owner_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A."
	},
	"source_subtype": "internal_funds_transfer",
	"source_subtype_translation_ptbr": "Transferência Interna",
	"target_account": {
		"account_branch": "0001",
		"account_digit": "2",
		"account_number": "2359934",
		"financial_institution_compe_number": 329,
		"financial_institution_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"owner_document_number": "09080702000105",
		"owner_name": "VOVO LUCIA CONVENIENCIA LTDA"
	},
	"transacted_at": "2022-11-20 00:36:33",
	"transacted_at_br": "2022-11-19 21:36:33",
	"transaction_amount": 1000000,
	"transaction_key": "67a62397-2c32-4768-8485-ec9129a46654"
}
 ```

Response Body - Para Pagamentos de Boletos

```json

{
	"bank_slip": {
		"beneficiary": {
			"document_number": "32402502000135",
			"name": "QI SCD"
		},
		"digitable_line": "32990001031000699926165000000201993810000003500",
		"expiration_date": "2023-06-14",
		"financial_institution_compe_number": "329",
		"financial_institution_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"payer": {
			"document_number": "10932327656",
			"name": "Lucas Clarim"
		},
		"payment_date": "2022-11-22",
		"payment_key": "13b35108-0fdc-44ab-b86d-5dda12dc8dce"
	},
	"origin_key": "13b35108-0fdc-44ab-b86d-5dda12dc8dce",
	"source_account": {
		"account_branch": "0001",
		"account_digit": "2",
		"account_number": "2359934",
		"financial_institution_compe_number": 329,
		"financial_institution_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"owner_document_number": "09080702000105",
		"owner_name": "VOVO LUCIA CONVENIENCIA LTDA"
	},
	"source_subtype": "bank_slip_payment",
	"source_subtype_translation_ptbr": "Pagamento de Boleto",
	"transacted_at": "2022-11-22 12:26:21",
	"transacted_at_br": "2022-11-22 09:26:21",
	"transaction_amount": 35,
	"transaction_key": "eee862b9-7f2e-4eea-b04a-fa0e89442618"
}
 ```

**3.3. Extratos:** O extrato de uma conta pode ser recuperado através do seguinte endpoint:

        **Request**

ENDPOINT /account_statement
MÉTODO GET
PARAMETERS account_key, document_number, date_from, date_to, page, page_size

Response Body

```json
{
	"data": {
		"account_info": {
			"account_block_reason": null,
			"account_branch": "0001",
			"account_credentials": [{
					"account_id": 3395,
					"credential_type": "observer",
					"credential_type_id": 3,
					"document_number": "09080702000105",
					"id": 3244,
					"is_active": true,
					"name": "VOVO LUCIA CONVENIENCIA LTDA",
					"updated_at": null
				},
				{
					"account_id": 3395,
					"credential_type": "requester",
					"credential_type_id": 2,
					"document_number": "94310345000195",
					"id": 3245,
					"is_active": true,
					"name": "Parceiro Sandbox",
					"updated_at": null
				}
			],
			"account_digit": "2",
			"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
			"account_name": "Default",
			"account_number": "2359934",
			"account_status": "opened",
			"account_type": "checking",
			"automatic_transfer_management_status": {
				"created_at": "2022-10-27T13:48:18",
				"enumerator": "master"
			},
			"automatic_transfers": [],
			"balance": 999359,
			"blocked_balance": 0,
			"destinations": [],
			"fee": 0,
			"internal_webhooks": [],
			"investment_available_amount": 0,
			"investment_configuration": null,
			"owner_document_number": "09080702000105",
			"owner_name": "VOVO LUCIA CONVENIENCIA LTDA",
			"owner_person_key": "d2fddd2c-3436-41d5-97e0-5721ee871a3a",
			"permitted_person_keys": [
				"bffded45-5fcf-4d13-9d2a-566a0af338cc",
				"ef48fbe4-267b-45c1-9049-75345c075486"
			],
			"requester_key": "ef48fbe4-267b-45c1-9049-75345c075486",
			"requester_name": "Parceiro Sandbox",
			"setup_fee": null,
			"transactional_limit": null,
			"webhook_enabled": true
		},
		"transaction_list": [
			{
				"account_balance": 999359,
				"description": "001 0001 81156-1 109.323.276-56 - Lucas de Jesus Clarim",
				"source_subtype": "withdrawal",
				"transacted_at": "2022-11-21 14:39:56",
				"transaction_amount": -551,
				"transaction_key": "32ac0781-f292-4172-b58f-3310102e6fb9"
			},
			{
				"account_balance": 999910,
				"description": "329 0001 00002-5 32.402.502/0001-35 - QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
				"source_subtype": "internal_funds_transfer",
				"transacted_at": "2022-11-20 02:27:38",
				"transaction_amount": -45,
				"transaction_key": "9cee2272-b280-47ed-b9ec-00674f25db1b"
			},
			{
				"account_balance": 999955,
				"description": "212 0001 1017372-2 ***.221.81*-** BANCO ORIGINAL S.A.",
				"source_subtype": "pix_withdrawal",
				"transacted_at": "2022-11-20 02:00:05",
				"transaction_amount": -45,
				"transaction_key": "d2ba3817-26d7-4957-ab82-24f78d910a8a"
			},
			{
				"account_balance": 1000000,
				"description": "329 0001 00002-5 32.402.502/0001-35 - QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
				"source_subtype": "internal_funds_transfer",
				"transacted_at": "2022-11-20 00:36:33",
				"transaction_amount": 1000000,
				"transaction_key": "67a62397-2c32-4768-8485-ec9129a46654"
			}
		]
	},
	"event_datetime": "2022-11-22 12:57:44",
	"key": "d96fb39c-e80b-447b-aad8-191c9bd2eb17",
	"status": "success",
	"webhook_type": "account_statement"
}
```

---

### 4 - Transferência TED
 
:::info
As transferências TED só podem ser realizadas em dias úteis das **7:00** às **17:00**.
:::

**4.1. Realizar Transferência TED:**
Para realizar uma transferência via TED é necessário realizar a seguinte chamada: 

        **Request**

ENDPOINT /wire_transfer
MÉTODO POST

Response Body

```json
{
	"source_account": {
		"account_branch": "0001",
		"account_number": "9477323",
		"account_digit": "0",
		"owner_document_number": "38299588000107"
	},
	"target_account": {
		"financial_institution_code": "341",
		"account_branch": "0001",
		"account_number": "4311337",
		"account_digit": "1",
		"owner_document_number": "21669721019",
		"owner_name": "Nome do Titular da Conta Destino"
	},
	"transaction_amount": 8.86
}
```

        **Response**

ENDPOINT /wire_transfer
MÉTODO POST

Response Body

```json
{
	"data": {
		"source_account": {
			"account_branch": "0001",
			"account_digit": "0",
			"account_number": "9477323",
			"owner_document_number": "38299588000107"
		},
		"target_account": {
			"account_branch": "0001",
			"account_digit": "1",
			"account_number": "4311337",
			"financial_institution_code": "341",
			"owner_document_number": "21669721019",
			"owner_name": "Nome do Titular da Conta Destino"
		},
		"transaction_amount": 8.86,
		"transaction_key": "076b76b9-6177-4cd6-b164-da55df678df6"
	},
	"event_datetime": "2023-02-14 23:05:53",
	"key": "d09c5533-a8d7-4ac2-bd3b-dd4433263d80",
	"status": "success",
	"webhook_type": "wire_transfer"
}
```

O campo de “event_datetime“ esta em formato UTC.

:::info
A “***transaction_key***“ é a chave única de identificação da transferência e poderá ser utilizada posteriormente para solicitação do comprovante de transferência.
:::
 

**4.2. Estorno de uma TED:** Caso a instituição destinatária devolva a TED, será disparado o seguinte webhook:

        **Webhook**

WEBHOOK_TYPE account_transaction
SOURCE_SUB_TYPE withdrawal_reversal

Body

```json
{
	"key": "508ebbba-0b1d-41f6-b9a2-975a4c2e925e",
	"data": {
		"amount": 550,
		"origin": {
			"name": "TED",
			"branch": "0001",
			"document": "32402502000135",
			"account_key": "23a4a2c8-9d82-4ebe-a90d-44fe8d839ec0",
			"account_digit": "7",
			"account_number": "00001"
		},
		"timestamp": "2023-01-05T07:42:26.631137",
		"description": "001 0001 81156-1 32.402.502/0001-35 - QI Tech",
		"destination": {
			"name": "Default",
			"branch": "0001",
			"document": "23426525852",
			"account_key": "508ebbba-0b1d-41f6-b9a2-975a4c2e925e",
			"account_digit": "0",
			"account_number": "7058818"
		},
		"reference_key": "58729e67-f490-4607-aafd-2fc7945d3d77",
		"reference_type": "ted_outgoing",
		"account_balance": 99954.15,
		"source_sub_type": "withdrawal_reversal",
		"transaction_key": "53268774-6891-42a4-a658-42e21cef867c",
		"source_sub_type_str": "Estorno de Transferência"
	},
	"datetime": "2023-01-05T07:42:26.631137",
	"webhook_type": "account_transaction"
}
```

 
---

### 5 - Registrar e Alterar boletos bancários

**5.1. Consulta de Carteiras de Cobrança:**  Para registrar, alterar e pagar boletos, é preciso, primeiramente, possuir o Código da Carteira de Cobrança (Requester Profile Code) vinculada a uma conta. Toda conta já nasce com uma Carteira de Cobrança vinculada. 

O Código da Carteira de Cobrança segue o seguinte padrão:
”No. do banco” + “código da carteira” + “No. agência da conta” + “No. da Conta com 7 caracteres e sem dígito“.

Por padrão, na QI Tech, os números do banco, do código da carteira e agência sempre serão “329”, “09” e “0001”, respectivamente.
ex: “**329-09-0001-2359934**”.

Caso seja necessário recuperar a lista de Códigos de Carteira de Cobrança de cada conta, deve ser utilizado o seguinte endpoint:

        **Request**

ENDPOINT /bank_slip/requester_profiles
MÉTODO GET

Response Body

```json
{
    "requester_profile_codes": [
        "329-09-0001-1467576",
        "329-09-0001-5747500",
        "329-09-0001-2730579",
        "329-09-0001-2359934"
    ]
}
```

 
:::tip Dica
O registro, alteração e baixa de boletos, funciona através da dinâmica de ocorrências. Cada ocorrência é enviada para a QI Tech e encaminhada para a base centralizadora de boletos.
As ocorrências podem ser aceitas ou rejeitadas pelo base centralizadora de boletos.
A resposta a respeito da aceitação ou rejeição das ocorrências é enviada via webhook ao parceiro.
:::
 

**5.2. Registrar Boleto:** Para realizar o registro de um boleto, é necessário enviar uma ocorrência de registro, conforme descrito no endpoint abaixo:

        **Request**

ENDPOINT /multibank_instruction?use_multi_process=true
MÉTODO POST

Request Body

```json
{
    "occurrences": [
        {
            "amount": 800,
            "our_number": 1,
            "automatic_bankruptcy_protest": false,
            "bank_teller_instructions": "Não aceitar após vencimento",
            "days_to_bankruptcy_protest": 0,
            "document_number": "123456/01",
            "expiration": "2022-12-01",
            "fine_percentage": "2",
            "interest_daily_value": "0.34",
            "occurrence_type": "registration",
            "payer_address": "Rua Carlos Sampaio, 123",
            "payer_document": "41184562067",
            "payer_name": "João Ninguem",
            "payer_person_type": "natural",
            "payer_postal_code_root": "15800",
            "payer_postal_code_suffix": "020",
            "registration_institution_enumerator": "qi_scd",
            "requester_profile": 9,
            "requester_profile_code": "329-09-0001-2359934"
        }
    ]
}
```
 

:::info
O nosso número bancário (“***our_number***”) é o ID do boleto dentro da carteira de cobrança. Ele deve ser um ID incremental.
O nosso número bancário (“***our_number***”) deve ser gerado pelo parceiro e informado no momento do registro do boleto.
**IMPORTANTE:** O boleto deve ser localizado através da chave: nosso número bancário (“***our_number***”) + Código da Carteira de Cobrança (“***requester_profile_code***).
:::

        **Response**

ENDPOINT /multibank_instruction?use_multi_process=true
MÉTODO POST

Response Body

```json
{
	"file_info": {
		"beneficiary_code": null,
		"beneficiary_name": null,
		"file_sequence_id": null,
		"file_type_identifier": null,
		"file_type_literal": null,
		"service_code": null,
		"service_literal": null,
		"wrote_at": null
	},
	"occurrence_stats": {
		"bank_slip_edit": 0,
		"bankruptcy_protest_request": 0,
		"cancel_rebate": 0,
		"extension": 0,
		"notary_office_entry": 0,
		"notary_office_exit": 0,
		"notary_office_payment": 0,
		"notification": 0,
		"payment": 0,
		"payment_notice": 0,
		"payment_write_off": 0,
		"protest_cancel_and_write_off_request": 0,
		"protest_cancel_request": 0,
		"protest_remove_request": 0,
		"protest_request": 0,
		"rebate": 0,
		"registration": 1,
		"write_off": 0
	},
	"semantic_errors": []
}
```

**5.3.** A resposta sobre a aceitação ou rejeição do registro do boleto será informada através do seguinte webhook.

        **Webhook**

WEBHOOK_TYPE bank_slip.status_change
STATUS registered

Body

```json
{
	"key": "41927fa9-f9ed-4797-b48a-6ac68e58dc17",
	"data": {
		"expiration": "2022-12-01",
		"our_number": 1,
		"bank_slip_key": "41927fa9-f9ed-4797-b48a-6ac68e58dc17",
		"rebate_amount": 0,
		"occurrence_type": "registration",
		"occurrence_feedback": "confirmed",
		"occurrence_sequence": 0,
		"requester_profile_code": "329-09-0001-2359934",
		"glados_occurrence_reasons": null,
		"cnab_file_occurrence_order": 1,
		"registration_institution_occurrence_date": "2022-11-21"
	},
	"status": "registered",
	"webhook_type": "bank_slip.status_change",
	"event_datetime": "2022-11-22 00:41:32"
}
```

Para vincular o webhook enviado a um boleto, deve-se utilizar o nosso número bancário (“***our_number***”) e o Código da Carteira de Cobrança (“***requester_profile_code***“).

Assim que o registro do boleto é aceito pela base centralizadora, é retornado no webhook a chave UUID do boleto (“***bank_slip_key***“). Guarde essa chave pois através dela será possível recuperar as informações do boleto.

 

**5.4. Alterar Dados do Boleto:** Para alterar os dados de um boleto, é necessário enviar uma ocorrência. Cada possível alteração possui sua ocorrência correspondente. A lista de ocorrências para alteração dos dados de um boleto pode ser verificada em nossa documentação (/documentation/emissao_de_boleto/enviar_instrucao_de_boleto).

 

**5.5. Solicitação de 2ª via de boleto:** Após o registro do boleto, pode ser solicitada a geração de um arquivo “.pdf” do boleto, contendo os dados para pagamento.

        **Request**

ENDPOINT /bank_slip/2-way/[BANKSLIP-KEY]
MÉTODO POST

Request Body

```json

{}

```

Response Body

```json
{
	"bank_slip_file": [{
		"barcode": "32991918600000800000001090000000000123599340",
		"created_at": "2022-11-21T23:29:45",
		"digitable_line": "32990001039000000000101235993407191860000080000",
		"url": "https://storage.googleapis.com/sandbox-bank-slip-api/bank-slip-pdf/41927fa9-f9ed-4797-b48a-6ac68e58dc17_1.pdf"
	}],

}
```

:::info
Serão retornados todos os dados do boleto e o link para download do “.pdf” será informado no objeto “***bank_slip_file.url***“.
:::
 

**5.5. Consultar dados de um Boleto:** Os dados de um boleto podem ser consultados de duas formas diferentes.

        **5.5.1. Consulta através da linha digitável:** A linha digitável de um boleto é uma série numérica que traz em si as informações do boleto. Esta série numérica é digitada pelo usuário pagador do boleto no internet-banking do banco pagador.

:::info
Exemplo de linha digitável: 32990001031000000000902000000204685640000100000
:::

Através da linha digitável, podem ser consultados os dados do boleto:

        **Request**

ENDPOINT /bank_slip/payment
MÉTODO GET
PARAMETERS digitable_line

Response Body

```json
{
	"barcode": "32991918600000800000001090000000000123599340",
	"beneficiary_bank_code": "329",
	"beneficiary_document_number": "09080702000105",
	"beneficiary_legal_name": "VOVO LUCIA CONVENIENCIA LTDA",
	"beneficiary_person_type": "legal",
	"calculated_internally": true,
	"calculation_date": "2022-11-21",
	"calculation_model": 1,
	"digitable_line": "32990001039000000000101235993407191860000080000",
	"discount_amount": "0",
	"expiration_date": "2022-12-01",
	"expired_as_of_payment_date": false,
	"expired_as_of_today": false,
	"factual_expiration_date": "2022-12-01",
	"fine_amount": "0",
	"guarantor_document": null,
	"guarantor_name": null,
	"interest_amount": "0",
	"max_payment_date": "2023-05-30",
	"nominal_amount": "800.00",
	"payer_document_number": "41184562067",
	"payer_legal_name": "Jo_o Ninguem",
	"payer_person_type": "natural",
	"payment_date": "2022-11-21",
	"rebate_amount": "0.0",
	"total_amount": "800.0",
	"valid_payment_amount": true,
	"valid_payment_calculation": true,
	"valid_payment_time_frame": true
}
 ```

        **5.5.2. Consulta através da Chave do Boleto:** Assim que o registro do boleto é aceito pela base centralizadora, é retornado no webhook a chave UUID do boleto (“***bank_slip_key***“). Através dessa chave é possível recuperar as informações do boleto:

        **Request**

ENDPOINT /bank_slip/[BANKSLIP-KEY]
MÉTODO GET

Response Body

```json
{
	"barcode": "32991918600000800000001090000000000123599340",
	"beneficiary_bank_code": "329",
	"beneficiary_document_number": "09080702000105",
	"beneficiary_legal_name": "VOVO LUCIA CONVENIENCIA LTDA",
	"beneficiary_person_type": "legal",
	"calculated_internally": true,
	"calculation_date": "2022-11-21",
	"calculation_model": 1,
	"digitable_line": "32990001039000000000101235993407191860000080000",
	"discount_amount": "0",
	"expiration_date": "2022-12-01",
	"expired_as_of_payment_date": false,
	"expired_as_of_today": false,
	"factual_expiration_date": "2022-12-01",
	"fine_amount": "0",
	"guarantor_document": null,
	"guarantor_name": null,
	"interest_amount": "0",
	"max_payment_date": "2023-05-30",
	"nominal_amount": "800.00",
	"payer_document_number": "41184562067",
	"payer_legal_name": "Jo_o Ninguem",
	"payer_person_type": "natural",
	"payment_date": "2022-11-21",
	"rebate_amount": "0.0",
	"total_amount": "800.0",
	"valid_payment_amount": true,
	"valid_payment_calculation": true,
	"valid_payment_time_frame": true
}
```

**5.6. Notificação de aviso de recebimento de um Boleto:** No momento em que um boleto é pago em outro banco, é enviado um aviso de que este boleto foi pago em tempo real. A Liquidação financeira do pagamento ocorrerá no próximo dia útil.

        **Webhook**

WEBHOOK_TYPE bank_slip.status_change
STATUS payment_notice

Body

```json
{
	"key": "945e191d-1a78-4a28-8669-000b7e4a3522",
	"data": {
		"our_number": 1,
		"paid_amount": 800,
		"payment_bank": 341,
		"bank_slip_key": "41927fa9-f9ed-4797-b48a-6ac68e58dc17",
		"payment_method": 2,
		"payment_origin": 3,
		"occurrence_type": "payment_notice",
		"occurrence_feedback": "confirmed",
		"occurrence_sequence": 0,
		"requester_profile_code": "329-09-0001-2359934",
		"registration_institution": "qi_scd",
		"cnab_file_occurrence_order": 1,
		"registration_institution_occurrence_date": "2022-11-02"
	},
	"status": "payment_notice",
	"webhook_type": "bank_slip.status_change",
	"event_datetime": "2022-11-21 23:02:02"
}
```

:::info
“**payment_method:**“ é o meio de pagamento do boleto, podendo ser:

“**credit_card**”: cartão de crédito 

”**cash**”: dinheiro

”**account_debit**”: débito em conta 

”**check**”: cheque
:::

:::info
payment_origin: é a origem do local do pagamento do boleto, podendo ser:

“**internet**”: Internet Banking

”**phisical_cashier**”: Caixa do Banco (“boca do caixa”)

”**taa**”: Terminal de auto-atendimento

”**eletronic_file**”: CNAB de liquidação

”**call_center**”: Call Center

”**dda**”: DDA (Débito Direto Autorizado)

”**corban**”: Lotérica - Correspondente Bancário
:::

:::caution Atenção
A informação de Método de Pagamento (“***payment_method***“) e Origem do Pagamento (“***payment_origin***“), são dados informados no momento do pagamento do boleto, sua consistência e veracidade fica a cargo da instituição que processou tal pagamento.
:::

--- 

### 6 - Gerar QR Code PIX

**6.1. Gerando QR Code PIX Estático:** O QR Code é criado a partir de uma Chave PIX ativa cadastrada em uma conta. Após a geração do QR Code, serão retornados tanto a URI do PIX Copia e Cola vinculada ao QR Code, como também o base64 da imagem do QR Code (caso solicitado).
A imagem do QR Code pode ser gerada pelo próprio parceiro a partir da URI do PIX Copia e Cola.

Para gerar um QR Code PIX Estático será usada apenas uma requisição:

        **Request**

ENDPOINT /baas/qrcode/static
MÉTODO POST

Request Body

```json
{
    "pix_key": "0598e5d1-2cfc-4857-abf8-12d495aa0a6d",
    "amount": 35.00,
    "receiver_name": "Tywin Lannister",
    "qr_code_format": "both"
}
```

:::info
No campo **qr_code_format** poderá ser informado os valores “**image**”, “**payload**“ e “**both**”.

“**image**”: será retornado o campo com o base64 da imagem do QR Code PIX.

“**payload**”: será retornado o campo com o base64 da URI do PIX Copia e Cola do QR Code PIX.

“**both**”: serão retornados os dois campos.
:::

        **Response**

ENDPOINT /baas/qrcode/static
MÉTODO POST

Response Body

```json
{
    "external_reference_key": null,
    "image": "\<BASE 64 DA IMAGEM DO QR CODE PIX\>",
    "payload": "\<BASE 64 DA URI DO QR CODE PIX\>",
    "revision": null
}
```

**6.2. Gerando QR Code PIX Dinâmico:** Existem dois tipos de QR Code Dinâmico. O QR Code Dinâmico com Pagamento Instantâneo e o QR Code Dinâmico com Vencimento.

        **6.2.1. Gerando QR Code PIX Dinâmico com Vencimento:** É um tipo de QR Code PIX que funciona de forma muito semelhante a um boleto bancário, podendo possuir informação de vencimento, multa, juros por atraso e desconto por pagamento antecipado. Para gerar ester tipo de QR Code PIX é necessário apenas uma requisição no Endpoint “/baas/qrcode/dynamic“.

        **Request**

ENDPOINT /baas/qrcode/dynamic
MÉTODO POST

Request Body

```json
{
	"amount": 100,
	"qr_code_type": "dynamic_term",
	"occurrence_type": "registration",
	"max_payment_days": 180,
	"expiration_date": "2025-09-24",
	"pix_key": "0598e5d1-2cfc-4857-abf8-12d495aa0a6d",
	"payer_name": "QI Tech",
	"payer_document_number": "98765432100",
	"payer_person_type": "natural",
	"payer_request": "O que voce achou da experiencia",
	"rebate_amount": 0,
	"interest_amount": 1,
	"fine_amount": 2,
	"discounts": [{
		"limit_date": "2023-02-24",
		"amount": 20,
		"discount_type": "absolute"
	}],
	"additional_data": [{
		"\<tag_name\>": "\<tag_value\>"
	}]
}
```

:::info
**occurrence_type:** neste campo é informada a ação pretendida. Podem ser: registration, edit, write_off 

**registration:** Para criar um novo QR Code

**edit:** Para editar um QR Code já existente (Conforme descrito no item abaixo).

**write_off:** para baixar um QR Code ativo.

**interest_amount:** valor em reais (R$) de juros cobrados por dia de atraso.

**fine_amount:** valor da multa por atraso, em reais (R$).

**discounts:** informação do desconto por pagamento antecipado. Caso não seja aplicável, enviar uma lista vazia ([]). 

**additional_data:** são metatags customizáveis que podem ser apresentadas para o pagador no momento do pagamento. Seguem o seguinte padrão: ”\ ”: “\ “.

**tag_name:** possui uma limitação de 100 caracteres e tag_value possui uma limitação de 320 caracteres.
:::

        **Response**

ENDPOINT /baas/qrcode/dynamic
MÉTODO POST

Response Body

```json
{
	"qr_code_type": "dynamic_term",
	"amount": 100,
	"expiration_seconds": null,
	"max_payment_days": 180,
	"receiver_conciliation_id": "3bd19ada234141bf9f1fc5ce0b216723",
	"payer_name": "QI Tech",
	"payer_document_number": "98765432100",
	"payer_person_type": "natural",
	"payer_request": "O que voce achou da experiencia",
	"pix_message": null,
	"modality_alteration": false,
	"expiration_date": "2025-09-24",
	"rebate_amount": 10,
	"interest_amount": 10,
	"fine_amount": 10,
	"paid_amount": null,
	"discounts": [{
		"discount_type": "absolute",
		"limit_date": "2023-02-24",
		"amount": 20
	}],
	"additional_data": [{
		"\<tag_name\>": "\<tag_value\>"
	}],
	"origin": "system",
	"origin_key": null,
	"pix_key": "0598e5d1-2cfc-4857-abf8-12d495aa0a6d",
	"qr_code_key": "3bd19ada-2341-41bf-9f1f-c5ce0b216723",
	"occurrence_type": "registration",
	"end_to_end_id": null,
	"base_64": "\<BASE 64 DA URI DO QR CODE PIX\>",
	"image": "\<BASE 64 DA IMAGEM DO QR CODE PIX\>",
	"source_account_branch": null,
	"source_account_financial_institution": null,
	"source_account_ispb": null,
	"source_account_number": null,
	"source_account_digit": null,
	"qr_code_occurrence_key": "b6777e78-e00c-4e9f-9b44-aa7b551c11e4"
}
```

O campo “base_64“ é a URI do PIX Copia e Cola vinculado a este QR Code PIX Dinâmico.

 

        **6.2.2. Gerando QR Code PIX Dinâmico com Pagamento Instantâneo:** É um tipo de QR Code PIX semelhante ao Estático, porém facilita a conciliação por parte do recebedor do pagamento e pode ter vencimento intradia (podendo durar apenas 5 minutos, por exemplo). 
Para gerar este tipo de QR Code PIX é necessário apenas uma requisição no Endpoint “***/baas/qrcode/dynamic***”. 

        **Request**

ENDPOINT /baas/qrcode/dynamic
MÉTODO POST

Request Body

```json
{
	"amount": 100,
	"occurrence_type": "registration",
	"qr_code_type": "dynamic_instant",
	"pix_key": "0598e5d1-2cfc-4857-abf8-12d495aa0a6d",
	"expiration_seconds": 360,
	"payer_name": "QI Tech",
	"payer_document_number": "98765432100",
	"payer_person_type": "natural",
	"payer_request": "Valor referente a compra 1234",
	"additional_data": [{
		"\<tag_name\>": "\<tag_value\>"
	}]
}
```

        **Response**

ENDPOINT /baas/qrcode/dynamic
MÉTODO POST

Response Body

```json
{
	"qr_code_type": "dynamic_instant",
	"amount": 100,
	"expiration_seconds": 360,
	"max_payment_days": null,
	"receiver_conciliation_id": "8e5af204fa5844eca9707c4facc5e5f5",
	"payer_name": "QI Tech",
	"payer_document_number": "98765432100",
	"payer_person_type": "natural",
	"payer_request": "Valor referente a compra 1234",
	"pix_message": null,
	"modality_alteration": false,
	"expiration_date": null,
	"rebate_amount": null,
	"interest_amount": null,
	"fine_amount": null,
	"paid_amount": null,
	"discounts": [],
	"additional_data": [{
		"\<tag_name\>": "\<tag_value\>"
	}],
	"origin": "system",
	"origin_key": null,
	"pix_key": "0598e5d1-2cfc-4857-abf8-12d495aa0a6d",
	"qr_code_key": "8e5af204-fa58-44ec-a970-7c4facc5e5f5",
	"occurrence_type": "registration",
	"end_to_end_id": null,
	"base_64": "\<BASE 64 DA URI DO QR CODE PIX\>",
	"image": "\<BASE 64 DA IMAGEM DO QR CODE PIX\>",
	"source_account_branch": null,
	"source_account_financial_institution": null,
	"source_account_ispb": null,
	"source_account_number": null,
	"source_account_digit": null,
	"qr_code_occurrence_key": "838e4bd3-36c9-4aa8-9be8-04079bbe8d1a"
}
 ```

        **6.2.3 Editar dados de QR Code PIX Dinâmico:** Para editar os dados de um QR Code PIX Dinâmico, é necessário informar a “***qr_code_key***“ do QR Code PIX e “***occurrence_type***” igual a “***edit***”. Nesse caso, é preciso reenviar todos os dados novamente.

        **Request**

ENDPOINT /baas/qrcode/dynamic
MÉTODO POST

Request Body

```json
{
    "qr_code_key": "3bd19ada-2341-41bf-9f1f-c5ce0b216723",
	"amount": 200,
	"qr_code_type": "dynamic_term",
	"occurrence_type": "edit",
	"max_payment_days": 180,
	"expiration_date": "2025-09-24",
	"pix_key": "0598e5d1-2cfc-4857-abf8-12d495aa0a6d",
	"payer_name": "QI Tech",
	"payer_document_number": "98765432100",
	"payer_person_type": "natural",
	"payer_request": "O que voce achou da experiencia",
	"rebate_amount": 0,
	"interest_amount": 1,
	"fine_amount": 2,
	"discounts": [{
		"limit_date": "2023-02-24",
		"amount": 20,
		"discount_type": "absolute"
	}],
	"additional_data": [{
		"\<tag_name\>": "\<tag_value\>"
	}]
}
 ```

        **Response**

ENDPOINT /baas/qrcode/dynamic
MÉTODO POST

Response Body

```json
{
	"qr_code_type": "dynamic_term",
	"amount": 200,
	"expiration_seconds": null,
	"max_payment_days": 180,
	"receiver_conciliation_id": "3bd19ada234141bf9f1fc5ce0b216723",
	"payer_name": "QI Tech",
	"payer_document_number": "98765432100",
	"payer_person_type": "natural",
	"payer_request": "O que voce achou da experiencia",
	"pix_message": null,
	"modality_alteration": false,
	"expiration_date": "2025-09-24",
	"rebate_amount": 10,
	"interest_amount": 10,
	"fine_amount": 10,
	"paid_amount": null,
	"discounts": [{
		"discount_type": "absolute",
		"limit_date": "2023-02-24",
		"amount": 20
	}],
	"additional_data": [{
		"\<tag_name\>": "\<tag_value\>"
	}],
	"origin": "system",
	"origin_key": null,
	"pix_key": "0598e5d1-2cfc-4857-abf8-12d495aa0a6d",
	"qr_code_key": "3bd19ada-2341-41bf-9f1f-c5ce0b216723",
	"occurrence_type": "edit",
	"end_to_end_id": null,
	"base_64": "\<BASE 64 DA URI DO QR CODE PIX\>",
	"image": "\<BASE 64 DA IMAGEM QR CODE PIX\>",
	"source_account_branch": null,
	"source_account_financial_institution": null,
	"source_account_ispb": null,
	"source_account_number": null,
	"source_account_digit": null,
	"qr_code_occurrence_key": "d9c01f70-26bc-429d-afd1-038bd3c235b2"
}
  ```

**6.3. Excluir QR Code PIX Dinâmico:** Para baixar um QR Code PIX Dinâmico, é necessário informar a “***qr_code_key***“ do QR Code PIX e “***occurrence_type***” igual a “***write_off***”.

        **Request**

ENDPOINT /baas/qrcode/dynamic
MÉTODO POST

Request Body

```json

{
    "qr_code_key": "3bd19ada-2341-41bf-9f1f-c5ce0b216723",
    "occurrence_type": "write_off"
}

  ```

        **Response**

ENDPOINT /baas/qrcode/dynamic
MÉTODO POST

Response Body

```json

{
	"qr_code_type": "dynamic_term",
	"amount": null,
	"expiration_seconds": 86400,
	"max_payment_days": null,
	"receiver_conciliation_id": "3bd19ada234141bf9f1fc5ce0b216723",
	"payer_name": null,
	"payer_document_number": null,
	"payer_person_type": "natural",
	"payer_request": null,
	"pix_message": null,
	"modality_alteration": false,
	"expiration_date": null,
	"rebate_amount": null,
	"interest_amount": null,
	"fine_amount": null,
	"paid_amount": null,
	"discounts": [],
	"additional_data": [],
	"origin": "system",
	"origin_key": null,
	"pix_key": "0598e5d1-2cfc-4857-abf8-12d495aa0a6d",
	"qr_code_key": "3bd19ada-2341-41bf-9f1f-c5ce0b216723",
	"occurrence_type": "write_off",
	"end_to_end_id": null,
	"base_64": null,
	"image": null,
	"source_account_branch": null,
	"source_account_financial_institution": null,
	"source_account_ispb": null,
	"source_account_number": null,
	"source_account_digit": null,
	"qr_code_occurrence_key": "46001adf-ffe2-4534-b60e-f6c16b9af56e"
}
 
  ```

**6.4. Decodificando QR Code PIX:** Para decodificar um QR Code seja ele dinâmico ou estático, deve ser usado o seguinte endpoint:

        **Request**

ENDPOINT /baas/pix/qrcode
MÉTODO POST

Request Body

```json

{
    "qr_code_payload": "\<URI DO PIX COPIA E COLA\>"
}

```

:::info
Neste endpoint deve ser informada a URI do Pix Copia e Cola (link do Pix Copia e Cola).
:::

---

### 7 - Gerenciar Chaves PIX

:::info
A “***pix_key***” pode ser um **CPF**, **CNPJ**, **E-mail**, **Celular** ou uma **Chave Aleatória** (UUID), seguindo as seguintes formatações:

**CPF:** Número inteiro com 11 dígitos.

**CNPJ:** Número inteiro com 14 dígitos.

**E-mail:** Texto contendo ao menos um “@”.

**Celular:** Texto contendo os seguintes valores: “+55” + “[DDD do celular]“ + “\ ”. Ex: “+5511987654321“.

**Chave Aleatória:** UUID.
:::
 

        **7.1. Criar Chave PIX CNPJ e Aleatória:** Para criar uma chave PIX CNPJ ou Chave Aleatória, basta acionar o endpoint “***/baas/pix/keys***“, alterando apenas o “***pix_key_type***“ para “**cnpj**”, “**cpf**“ ou “**random_key**”.

        **Request**

ENDPOINT /baas/pix/keys
MÉTODO POST

Request Body

```json

{
    "account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
    "pix_key_type": "random_key"
}
```

ou

Request Body

```json
{
    "account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
    "pix_key_type": "cnpj",
    "pix_key": "09080702000105"
}
```

ou

**payload.json**

```json

{
    "account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
    "pix_key_type": "cpf",
    "pix_key": "03882617038"
}

```

        **Response**

ENDPOINT /baas/pix/keys
MÉTODO POST

Response Body

```json
{
	"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
	"created_at": "2022-09-02T18:20:52",
	"pix_key": {
		"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
		"created_at": "2022-09-02T18:20:51",
		"pix_key": "09080702000105",
		"pix_key_status": "pending_confirmation",
		"pix_key_type": "cnpj",
		"updated_at": "2022-09-02T18:20:51"
	},
	"pix_key_request_key": "d60abf67-ad9c-42ee-9089-d26c8fc855b9",
	"request_data": {
		"account_created_at": "2022-09-02T22:44:36",
		"account_digit": "2",
		"account_number": "2359934",
		"account_type": "checking",
		"branch_number": "0001",
		"key": "09080702000105",
		"owner_document_number": "09080702000105",
		"owner_name": "VOVO LUCIA CONVENIENCIA LTDA",
		"owner_person_type": "legal",
		"trading_name": "VOVO LUCIA"
	},
	"request_failure_reason": null,
	"request_status": "pending",
	"request_type": "inclusion",
	"requester_key": "ef48fbe4-267b-45c1-9049-75345c075486",
	"updated_at": "2022-09-02T18:20:52"
}
```

:::caution Atenção
No caso da Response de criação de uma Chave PIX **Aleatória**, o campo “***pix_key***“ retornará um valor nulo, já que se trata de um
processo assíncrono onde a chave é gerada pelo Banco Central. Para recuperar o valor da chave aleatória gerada, é necessária realizar uma consulta à lista de chaves cadastradas em uma conta, conforme descrito no item “**Consultar Chaves PIX cadastradas em uma conta**, ou aguardar o webhook de inclusão.“.
:::

:::info
Como se trata de um processo assíncrono para verificar se as chave PIX **CNPJ** ou **CPF** estão ativas, é necessário realizar uma consulta à lista de chaves cadastradas em um conta, conforme descrito no item “**Consultar Chaves PIX cadastradas em uma conta**", ou aguardar o webhook de inclusão.
:::

**Webhook**

- WEBHOOK_TYPE key_inclusion

Response Body

```json
{
	"pix_key": "c232142c-ddbf-41d6-a54f-3b90c28b97dc",
	"account_key": "94945886-7a6f-43e6-a307-e36c959e4903",
	"webhook_type": "key_inclusion",
	"pix_key_status": "active",
	"pix_key_request_key": "e274eb13-40b3-4902-978e-8e5fa267af53",
	"pix_key_request_type": "inclusion",
	"pix_key_request_status": "approved"
}
```

 

**7.2. Criar Chave PIX E-mail e Celular:** Para criar uma chave PIX **E-mail** ou **Celular** deve-se acionar dois endpoints:

1 - Para criação da chave: POST no endpoint “***/baas/pix/keys***“, alterando o campo “***pix_key_type***“ para “**email**” ou “**phone_number**”. Neste momento, será enviado um Token para o E-mail ou Celular informado no campo “pix_key“.

2 - Para aprovação da chave: PATCH no endpoint “**/baas/pix/keys/[pix_key_request_key]**“, informando o Token recebido na etapa anterior.

        **Request**

ENDPOINT /baas/pix/keys
MÉTODO POST

Request Body

```json
{
    "account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
    "pix_key_type": "email",
    "pix_key": "vovo.lucia@gmail.com.br"
}
```
ou

Request Body

```json
{
    "account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
    "pix_key_type": "phone_number",
    "pix_key": "+5511987654321"
}
```

        **Response**

ENDPOINT /baas/pix/keys
MÉTODO POST

Response Body

```json
{
	"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
	"created_at": "2022-09-02T17:41:55",
	"pix_key": {
		"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
		"created_at": "2022-09-02T17:41:54",
		"pix_key": "pedro.pinho@qitech.com.br",
		"pix_key_status": "pending_confirmation",
		"pix_key_type": "email",
		"updated_at": "2022-09-02T17:41:54"
	},
	"pix_key_request_key": "f6209b7e-82da-44a8-9cfa-6ad0a689adb2",
	"request_data": {
		"account_created_at": "2022-09-02T22:44:36",
		"account_digit": "2",
		"account_number": "2359934",
		"account_type": "checking",
		"branch_number": "0001",
		"key": "pedro.pinho@qitech.com.br",
		"owner_document_number": "09080702000105",
		"owner_name": "VOVO LUCIA CONVENIENCIA LTDA",
		"owner_person_type": "legal",
		"trading_name": "VOVO LUCIA"
	},
	"request_failure_reason": null,
	"request_status": "pending",
	"request_type": "inclusion",
	"requester_key": "ef48fbe4-267b-45c1-9049-75345c075486",
	"updated_at": "2022-09-02T17:41:55"
}
```

:::info
**IMPORTANTE:** O valor retornado no campo “***pix_key_request_key***“ deve ser utilizado na URL da requisição para aprovação da criação da Chave PIX.
:::

 

**7.3. Aprovação da Chave PIX E-mail ou Celular solicitada:**

        **Request**

ENDPOINT /baas/pix/keys/ PIX_KEY_REQUEST_KEY /twofa_validation
MÉTODO PATCH

Request Body

```json
{
    "verification_code": "756816"
}
```

**7.4. Reenviar o código de verificação:**

        **Request**

- MÉTODO PATCH
- ENDPOINT /baas/pix/keys/ PIX_KEY_REQUEST_KEY /resend_twofa

**payload.json**

```json
{}
```

**7.5. Consultar Chaves PIX cadastradas em uma conta:**

        **Request**

ENDPOINT /baas/pix/keys
MÉTODO GET
PARAMETERS account_key

Response Body

```json
{
  "data": [
    {
      "account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
      "created_at": "2022-09-02T17:17:31",
      "pix_key": "0598e5d1-2cfc-4857-abf8-12d495aa0a6d",
      "pix_key_status": "active",
      "pix_key_type": "random_key",
      "updated_at": "2022-09-02T17:17:31"
    },
    {
      "account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
      "created_at": "2022-09-02T18:20:51",
      "pix_key": "09080702000105",
      "pix_key_status": "active",
      "pix_key_type": "cnpj",
      "updated_at": "2022-09-02T18:20:51"
    }
  ]
}
```

**7.6. Exclusão de Chaves PIX:**

        **Request**

ENDPOINT /baas/pix/keys
MÉTODO DELETE
PARAMETERS /baas/pix/keys/[PIX-KEY]

Payload: { }

Response Body

```json

Response:

{
	"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
	"created_at": "2022-09-02T20:00:36",
	"pix_key": {
		"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
		"created_at": "2022-09-02T18:20:51",
		"pix_key": "09080702000105",
		"pix_key_status": "inactivated",
		"pix_key_type": "cnpj",
		"updated_at": "2022-09-02T20:00:36"
	},
	"pix_key_request_key": "dced4317-c1e7-4da4-a75a-42f855c7598e",
	"request_data": {},
	"request_failure_reason": null,
	"request_status": "approved",
	"request_type": "deletion",
	"requester_key": "ef48fbe4-267b-45c1-9049-75345c075486",
	"updated_at": "2022-09-02T20:00:36"
}
```
 

---

### 8 - Pagamento QR Code PIX

**8.1. Pagando um QR Code PIX Estático:**

Para realizar o pagamento de um QR Code PIX Estático, é necessário realizar três chamadas:

Decodificar o QR Code PIX: **/baas/pix/qrcode**

Criação do pedido de transferência: **/baas/pix_transfer**

Aprovação da transferência: **/baas/pix_transfer_approval**

A informação que deve ser utilizada para decodificação do QR Code PIX Estático é a URI do PIX Copia e Cola vinculada ao QR Code.

:::info
**Exemplo de URI PIX Copia e Cola:** 00020126580014br.gov.bcb.pix01360598e5d1-2cfc-4857-abf8-12d495aa0a6d52040000530398654040.225802BR5925VOVO LUCIA CONVENIENCIA L6009sao paulo610912345-78062070503***63043A5A
:::

        **Request**

ENDPOINT /baas/pix/qrcode
MÉTODO POST

Request Body

```json

{
    "qr_code_payload": "\<URI DO PIX COPIA E COLA\>"
}
```

        **Response**

ENDPOINT /baas/pix/qrcode
MÉTODO POST

Response Body

```json
{
	"end_to_end_id": "E3240250220221120030008388062101",
	"qr_code_data": {
		"additional_data": null,
		"amount": 30,
		"ispb_number": "32402502",
		"receiver_conciliation_id": "***",
		"target_account_branch": "0001",
		"target_account_digit": "5",
		"target_account_number": "2",
		"target_account_type": "checking",
		"target_bank_code": 329,
		"target_bank_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"target_document_number": "32402502000135",
		"target_name": "QI SOCIEDADE DE CREDITO DIRETO S.A.",
		"target_person_type": "legal",
		"target_pix_key": "316bd44f-2202-4c33-9dc0-096192acd427"
	},
	"qr_code_key": "1608e022-e42d-49d8-bacf-da5844570635",
	"qr_code_payload": "00020126580014br.gov.bcb.pix0136316bd44f-2202-4c33-9dc0-096192acd427520400005303986540530.005802BR5925QI SOCIEDADE DE CREDITO D6009sao paulo610912345-78062070503***63048698",
	"qr_code_type": "static"
}
```

:::caution Atenção
A requisição para pagar um PIX QR Code Estático é a mesma utilizada na transferência PIX com a as seguintes alterações:

**1 -** Adição de um novo campo “***end_to_end_id***”. Deve ser informado o mesmo valor retornado da decodificação do QR Code Estático;
**2 -** Informar no campo “***transaction_amount***“ o mesmo valor retornado no campo “***qr_code_data.amount***” da decodificação do QR Code Estático;
**3 -** Alterar o campo “***pix_transfer_typ***e” para “static“, para solicitação do pagamento via “/baas/pix_trasnfer”.
:::

:::info
A única diferença desta Response em relação a Response de Aprovação de Transferência PIX, é o valor do campo “***pix_transfer_type***“, que é retornado como sendo “***static***”.
:::
 
**8.2. Pagando um QR Code PIX Dinâmico:**

Para realizar o pagamento de um QR Code PIX Dinâmico, é necessário realizar três chamadas:

Decodificar o QR Code PIX: **/baas/pix/qrcode**

Criação do pedido de transferência: **/baas/pix_transfer**

Aprovação da transferência: **/baas/pix_transfer_approval**

A informação que deve ser utilizada para decodificação do QR Code PIX Dinâmico é a URI do PIX Copia e Cola vinculada ao QR Code.

:::info
A única alteração no “/baas/pix/qrcode“ entre é QR Code PIX Estático e o QR Code PIX Dinâmico, é a resposta do endpoint.
:::

        **Response**

ENDPOINT baas/pix/qrcode
MÉTODO POST

Response Body

```json
{
	"end_to_end_id": "E3240250220221120162904592385040",
	"qr_code_data": {
		"account_type": "checking",
		"additional_data": [],
		"address": "Avenida Brigadeiro Faria Lima",
		"amount": 35,
		"category_code": "0000",
		"city": "Sao Paulo",
		"created_at": "2022-09-01T20:20:11",
		"days_after_due_accepted": 180,
		"discount_amount": null,
		"due_date": "2022-11-30",
		"fee_amount": null,
		"fine_amount": null,
		"ispb_number": "32402502",
		"original_amount": null,
		"payer_document_number": "10932327656",
		"payer_name": "Payer Name",
		"payer_person_type": "natural",
		"postal_code": "01452000",
		"presented_at": "2022-09-01T16:29:04",
		"question_to_payer": "QR Code Payment",
		"receiver_conciliation_id": "a6c3f35b342047e58ac105a0ae0c0c6f",
		"receiver_url": null,
		"reduction_amount": null,
		"reusable_qrcode": "yes",
		"revision": 1,
		"state": "SP",
		"status": "active",
		"target_account_branch": "0001",
		"target_account_digit": "5",
		"target_account_number": "2",
		"target_bank_code": 329,
		"target_bank_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"target_document_number": "32402502000135",
		"target_name": "QI SOCIEDADE DE CREDITO DIRETO S.A.",
		"target_person_type": "legal",
		"target_pix_key": "316bd44f-2202-4c33-9dc0-096192acd427",
		"target_trading_name": null
	},
	"qr_code_key": "a1bcf9be-918d-431e-ae79-a75f78337423",
	"qr_code_payload": "00020126970014br.gov.bcb.pix2575qrcode-h.sandbox.qitech.app/bacen/cobv/a6c3f35b-3420-47e5-8ac1-05a0ae0c0c6f5204000053039865802BR5902QI6009Sao Paulo61080145200062070503***6304AFEE",
	"qr_code_type": "dynamic_term"
}

```

:::caution Atenção
A requisição para pagar um PIX QR Code Dinâmico é a mesma utilizada na transferência PIX com a as seguintes alterações:

**1 -** Adição de um novo campo “***end_to_end_id***”. Deve ser informado o mesmo valor retornado da decodificação do QR Code Dinâmico.
**2 -**Informar no campo “***transaction_amount***“ o mesmo valor retornado no campo “qr_code_data.amount” da decodificação do QR Code Dinâmico;
**3 -** Alterar o campo “***pix_transfer_type***” para “***dynamic_term***“, para solicitação do pagamento via “**/baas/pix_transfer**”.
**4 -** Adição de um novo campo “***receiver_conciliation_id***”. Deve ser informado o mesmo valor retornado da decodificação do QR Code Dinâmico.
:::

:::info
A única diferença desta Response em relação a Response de Aprovação de Transferência PIX, é o valor do campo “***pix_transfer_type***“, que é retornado como sendo “***dynamic_term***”.
::::

---

# Environments

URL: /en/documentation/certifiqi/ambientes

We have both production and sandbox environments.

### API and Platform URL

- Sandbox:
    - platform:  https://sandbox.certifiqi.com.br/
    - api: [https://api.sandbox.certifiqi.com.br](https://api.sandbox.certifiqi.com.br/)
- Produção:
    - platform: https://certifiqi.com.br/
    - api [https://api.certifiqi.com.br](https://api.sandbox.certifiqi.com.br/)

:::danger Important Notice!
Real personal and/or company data must not be used in QI Tech’s Sandbox environments.
:::

---

# ZIP Files

URL: /en/documentation/certifiqi/arquivo_zip

Every batch group, once completed, generates at least one ZIP file. In some cases, a single event may contain more than one ZIP file, since each file has a **maximum limit of 500 documents**.  

To access the ZIP, use the URL query available in section 4.5.  

### Files per Document Available in the ZIP

**CAdES**:   

- **Original PDF** with an **informative signature page**  
  - Signature file **`.p7s`**.  
- **PAdES**:  
  - **Signed PDF**.

---

# Automatic Signature

URL: /en/documentation/certifiqi/assinatura_automatica

## How It Works

Automatic signing is a feature designed to speed up and optimize the document signing process at the certification authority. With the subscriber registered in advance, when creating an event, the certification authority automatically identifies and signs the document, eliminating the need for the user to access and perform the process manually.

## Registration

To enable automatic signing with our certification authority, it is necessary to sign an agreement for the generation of private certificates, which are specific to the signing of operational documents. After the contract is signed, we will generate the private certificates for each subscriber and install them in our certification authority to enable automatic signing of the intended documents.

To complete the registration and receive the agreement, please send an email to certifiqi@qitech.com.br containing the following information:
- Model(s) of the document(s) that will be signed automatically
- Full name, email, CPF, mobile phone number, and date of birth of all signers of the said document(s), for the generation of private certificates.

With this information, our technical team will be able to complete the installation of the private certificate and provide the necessary guidance to finalize the process.

---

# Access Profile Creation

URL: /en/documentation/certifiqi/cadastro

1. Send an access request to the email certifiqi@qitech.com.br providing the following information:
   1. Company's CNPJ
   2. Full name of the Master user
   3. CPF do usuário Master
   4. Master user's CPF
2. After the access is created by the QI Tech team, the Master user will receive an email with a link to access the Certifiqi platform to complete the registration.
3. When accessing the platform for the first time, the Master user can invite other users to also gain access to the platform.

---

# Cancel a Batch Group

URL: /en/documentation/certifiqi/cancelar_batch_group_de_assinatura

This request performs the cancellation of a pending event.

## Request

ENDPOINT /batch_group/batch_group_key/cancel_signature
MÉTODO PUT

### Path Params

| Field | Description |
|---|---|
| `batch_group_key` | 	Unique key identifying the batch group. |

Response Body

```json
{
    "batch_group_key": "c0394fb2-34f6-4d70-be70-776022fe15b8",
    "name": "Teste",
    "main_related_party": "ba",
    "number_of_documents": 1,
    "total_value": 0.0,
    "all_files_url": "",
    "send_to_fund_administrator": 0,
    "signature_expiration_date": null,
    "webhook_key": null,
    "client_key": "5aaf98d2-0264-48dd-8167-eab859ce5a75",
    "requester_key": null,
    "signature_status": "pending",
    "internal_status": "pending",
    "attached_document_number": "74766848000162",
    "current_signature_position": "1",
    "control_number": "Control Number",
    "internal_webhook_key": "ac73c564-989d-4c53-932b-d8f96b007584",
    "created_at": "2023-05-15 23:54:35",
    "batch_group_type": "icp_signature",
    "requester_identifier": null,
    "send_emails": false,
    "batches": [
        {
            "document_batch_key": "cd65292e-6748-4c1a-9520-de019f2f341b",
            "name": "Termo de Endosso",
            "document_type": "term_of_endorsement",
            "signature_type": "cades",
            "signature_status": "pending",
            "created_at": "2023-05-15 23:54:35",
            "related_parties": [
                {
                    "related_party_key": "41cf4d2a-fa9a-4cd1-93a0-5a1847b14fb3",
                    "name": "nome da empresa ",
                    "role": "assignor",
                    "signature_status": "pending",
                    "signature_position": "1",
                    "created_at": "2023-05-15 23:54:35",
                    "auto_signature": 0,
                    "signer_groups": [
                        {
                            "id": 38586,
                            "expiration": null,
                            "minimum_required_signers": 1,
                            "signable_limit": null,
                            "signature_status": "pending",
                            "created_at": "2023-05-15 23:54:35",
                            "signers": [
                                {
                                    "id": 65062,
                                    "signer_control_number": "1",
                                    "signature_timestamp": null,
                                    "signature_status": "pending",
                                    "name": "João",
                                    "is_group_mandatory": true,
                                    "email": "teste@qitech.com.br",
                                    "document_number": "85653681067",
                                    "created_at": "2023-05-15 23:54:35"
                                }
                            ]
                        }
                    ]
                }
            ],
            "documents": [
                {
                    "document_key": "19f3c0ib-3926-4274-b2ab-720014b35f53",
                    "control_number": "96a8cd68-76b4-4abf-8180-7d8ebe39567e",
                    "file_size": 1681,
                    "file_url": "https://storage.googleapis.com/certifier-api-storage-sandbox/093f1aef-437e-405b-9ef9-51efd73dbd57/teste_of_original.pdf",
                    "name": "teste_of.pdf",
                    "original_file_url": "https://storage.googleapis.com/certifier-api-storage-sandbox/093f1aef-437e-405b-9ef9-51efd73dbd57/teste_of_original.pdf",
                    "status": "pending",
                    "signed_file_url": null,
                    "created_at": "2023-05-15 23:54:35",
                    "signatures": []
                }
            ]
        }
    ],
    "watcher_clients": []
}
```

---

# GET Batch Group

URL: /en/documentation/certifiqi/consultar_evento

This request returns the data of a batch group.

## Request

ENDPOINT /batch_group/batch_group_key
MÉTODO GET

### Path Params

| Campo | Descrição |
|---|---|
| `batch_group_key` | Unique key identifying the batch group. |

## Response Body Params

STATUS 200

Response Body

```json
{
    "batch_group_key": "c0394fb2-34f6-4d70-be70-776022fe15b8",
    "name": "Teste",
    "main_related_party": "ba",
    "number_of_documents": 1,
    "total_value": 0.0,
    "all_files_url": "",
    "send_to_fund_administrator": 0,
    "signature_expiration_date": null,
    "webhook_key": "ac73c564-989d-4c53-932b-d8f96b007585",
    "client_key": "5aaf98d2-0264-48dd-8167-eab859ce5a75",
    "requester_key": null,
    "signature_status": "pending",
    "internal_status": "pending",
    "attached_document_number": "74766848000162",
    "current_signature_position": "1",
    "internal_webhook_key": "ac73c564-989d-4c53-932b-d8f96b007584",
    "created_at": "2023-05-15 23:54:35",
    "batch_group_type": "icp_signature",
    "requester_identifier": null,
    "send_emails": false,
    "batches": [
        {
            "document_batch_key": "cd65292e-6748-4c1a-9520-de019f2f341b",
            "name": "Termo de Endosso",
            "document_type": "term_of_endorsement",
            "signature_type": "cades",
            "signature_status": "pending",
            "created_at": "2023-05-15 23:54:35",
            "related_parties": [
                {
                    "related_party_key": "41cf4d2a-fa9a-4cd1-93a0-5a1847b14fb3",
                    "name": "nome da empresa ",
                    "role": "assignor",
                    "signature_status": "pending",
                    "signature_position": "1",
                    "created_at": "2023-05-15 23:54:35",
                    "auto_signature": 0,
                    "notify_to": [],
                    "signer_groups": [
                        {
                            "id": 38586,
                            "expiration": null,
                            "minimum_required_signers": 1,
                            "signable_limit": null,
                            "signature_status": "pending",
                            "created_at": "2023-05-15 23:54:35",
                            "signers": [
                                {
                                    "id": 65062,
                                    "signer_control_number": "1",
                                    "signature_timestamp": null,
                                    "signature_status": "pending",
                                    "name": "João",
                                    "is_group_mandatory": true,
                                    "email": "teste@qitech.com.br",
                                    "document_number": "85653681067",
                                    "created_at": "2023-05-15 23:54:35"
                                }
                            ]
                        }
                    ]
                }
            ],
            "documents": [
                {
                    "document_key": "19f3c0ib-3926-4274-b2ab-720014b35f53",
                    "control_number": "96a8cd68-76b4-4abf-8180-7d8ebe39567e",
                    "file_size": 1681,
                    "file_url": "https://storage.googleapis.com/certifier-api-storage-sandbox/093f1aef-437e-405b-9ef9-51efd73dbd57/teste_of_original.pdf",
                    "name": "teste_of.pdf",
                    "original_file_url": "https://storage.googleapis.com/certifier-api-storage-sandbox/093f1aef-437e-405b-9ef9-51efd73dbd57/teste_of_original.pdf",
                    "status": "pending",
                    "signed_file_url": null,
                    "created_at": "2023-05-15 23:54:35",
                    "signatures": []
                }
            ]
        }
    ],
    "watcher_clients": [],
    "zip_file_keys_list": [
        "a1a8cd68-aab4-csbf-1180-dd8ebe395612",
        "cda8cd68-7331-qebf-1280-fw8ebe395676"
    ]
}

```

| Field | Type | Description |
|---|---|---|
| `main_related_party` | string | Name of the main party responsible for signing the event. |
| `name` | string | Name of the event. |
| `batch_group_key` | string | 	Key of the batch group. |
| `signature_status` | string | Status of the signature. |
| `internal_status` | string | Overall status of the event. |
| `total_value` | string | Total value of the event’s documents. |
| `client_key` | string | Client identification key. |
| `send_emails` | boolean | Indicates whether signature emails should be sent for this event. |
| `attached_document_number` | string | Assignor’s CNPJ  |
| `batches` | lista | List of different document types and their respective related parties. |
| `webhook_url` | string | URL to which the webhook will be sent. |
| `webhook_url_list` | lista | List of URLs to which the webhook will be sent. |
| `zip_file_keys_list` | list | Identification key of the ZIP files. |

### Batches Object

| Field             | Type    | Description|
|-------------------|---------|-----------------------------------------------------------------|
| `related_parties`  | list    | List of related parties involved in signing a list of documents.|
| `documents`       | list    | List of documents.|
| `name`            | string  | Name of the batch.|
| `signature_type`  | enum    | Type of signature.|
| `document_type`   | enum    | Type of document. |

### Related Parties Object

| Field              | Type    | Description|
|--------------------|---------|-----------------------------|
| `role`             | enum    | Role played by the signers.|
| `name`             | string  | Name of the related party.|
| `signature_position` | integer | Signature position.|
| `signer_groups`    | list    | List of signer groups.|

### Signer Groups Object

| Field                      | Type    | Description
|----------------------------|---------|---------------------------------------------------------------------------------------------|
| `minimum_required_signers`  | integer | Minimum number of signers required to have signed for the group's signatures to be considered complete. |
| `signers`                  | list    | List of signers that make up the signer group.|

### Signer Object

| Field                  | Type    | Description                                                                                                      |
|------------------------|---------|------------------------------------------------------------------------------------------------------------------|
| `name`                 | string  | Name of the signer.                                                                                              |
| `document_number`      | string  | Signer’s CPF (Brazilian individual tax ID).                                                                     |
| `email`                | string  | Signer's email.                                                                                                  |
| `is_group_mandatory`   | boolean | Indicates if the signer is required to sign for the signer group to be considered complete.                      |
| `signer_control_number`| string  | Free field that can be used for control purposes or external reference.                                          |
| `signature_timestamp`  | date    | Date of the signature.                                                                                           |

### Documents Object

| Field              | Type    | Description                                                                                      |
|--------------------|---------|--------------------------------------------------------------------------------------------------|
| `name`             | string  | Name of the document.                                                                            |
| `control_number`   | string  | Free field that can be used for control purposes or external reference.                          |
| `file_size`        | float   | Size of the document.                                                                            |
| `url`              | string  | Document URL.                                                                                   |
| `document_key`     | string  | Document identification key.                                                                    |
| `original_file_url`| string  | URL of the original document.                                                                   |
| `signed_file_url`  | string  | URL of the document with signing page.                                                         |
| `file_url`         | string  | URL of the signature file.                                                                      |

---

# GET URL

URL: /en/documentation/certifiqi/consultar_url

You can query the links for already created batch groups through the requests below.

# GET Batch Group URLS
### Request

ENDPOINT /batch_group/batch_group_key/url
METHOD GET

### Path Params

| Field             | Description                                              |
|-------------------|----------------------------------------------------------|
| `batch_group_key` | Unique key identifying the batch group.                |

Response Body

```json
{
	"all_files_url": "https://google.com",
	"expiration_datetime": "2024-05-01T01:00:00.000Z",
	"batches": [
		{
			"document_batch_key": "121",
			"documents": [
				{
					"document_key": "222",
					"original_file_url": "https://google2.com",
					"signed_file_url": "https://google3.com",
					"file_url": "https://google4.com"
				}
			]
		}
	]
}
```

### Body Params

| Field                | Type    | Description                                                  |  
|----------------------|---------|--------------------------------------------------------------| 
| `batch_group_key`    | string  | Unique key identifying the batch group.                    |
| `all_files_url`      | string  | URL of the zip file containing the original PDF and signature files. |
| `batches`            | string  | List of different document types.                             |
| `document_batch_key` | string  | Unique key identifying the document batch.                   |
| `documents`          | Array   | List of document objects.                                     |
| `document_key`       | string  | Unique key identifying the document.                          | 
| `original_file_url`  | string  | URL of the original document.                                 |
| `signed_file_url`    | string  | URL of the document with signing page.                        |
| `file_url`           | string  | URL of the p7s file.                                          |
| `expiration_datetime`| string  | Date and time when the URLs will expire.                      |

# Get Document URL

### Request

ENDPOINT /document/document_key/url
MÉTODO GET

### Path Params

| Field          | Description                                  |
|----------------|--------------------------------------------|
| `document_key` | Unique key identifying the document  |

Response Body

```json
{
    "document_key": "222",
    "original_file_url": "https://google2.com",
    "signed_file_url": "https://google3.com",
    "file_url": "https://google4.com",
    "expiration_datetime": "2024-05-01T01:00:00.000Z"
}
```

### Body Params

| Field                | Type    | Description                                                    |  
|----------------------|---------|----------------------------------------------------------------| 
| `document_key`       | string  | Unique key identifying the document.                           | 
| `original_file_url`  | string  | URL of the original document.                                  |
| `signed_file_url`    | string  | URL of the document with signing page.                         |
| `file_url`           | string  | URL of the p7s file.                                           |
| `expiration_datetime`| string  | Date and time when the URLs will expire.                       |

# Query URLs of a ZIP File

### Request

ENDPOINT /certifier/zip_file/zip_file_key/url
METHOD GET

### Path Params

| Field           | Description                                |
|-----------------|--------------------------------------------|
| `zip_file_key`  | Identification key of the ZIP file.        |

Response Body

```json
{
    "zip_file_key": "222",
    "signed_url": "https://google3.com",
    "expiration_datetime": "2024-05-01T01:00:00.000Z"
}
```

---

# Create Batch Group

URL: /en/documentation/certifiqi/criar_batch_group

This endpoint should be used to submit the batch group, which includes the documents and their respective signers.

## Definições

### Request

ENDPOINT /batch_group
MÉTODO POST

Request Body

```json
{
    "main_related_party": "ba",
    "webhook_url": "google.com.br",
    "send_to_fund_administrator": false,
    "is_asynchronous": false,
    "name": "Teste",
    "total_value": 0,
    "webhook_url_list": [
        "https://google.com",
        "https://google2.com"
    ],
    "attached_document_number": "74766848000162",
    "send_emails": false,
    "batches": [{
        "signature_type": "cades",
        "document_type": "term_of_endorsement",
        "name": "Termo de Endosso",
        "related_parties":[
    {
            "name": "nome da empresa ",
            "role": "assignor",
            "signature_position":1,
            "signer_groups": [
                    {
                        "minimum_required_signers": 1,
                        "signers":[
                            {
                                "name": "João",
                                "document_number": "85653681067",
                                "email": "teste@qitech.com.br",
                                "is_group_mandatory": true,
                                "signer_control_number": "1"
                            }
                        ]
                    }
                ]
            }
        ],
        "documents": [{
            "name": "teste_of.pdf",
            "control_number": null,
            "url": "https://storage.googleapis.com/certifier-api-storage-sandbox/093f1aef-437e-405b-9ef9-51efd73dbd57/teste_of_original.pdf",
            "document_key": "19f3c0ib-3926-4274-b2ab-720014b35f53",
            "file_size": 1681
        }]
    }]
}

```

STATUS 200

Response Body

```json

```json
{
    "batch_group_key": "c0394fb2-34f6-4d70-be70-776022fe15b8",
    "name": "Teste",
    "main_related_party": "ba",
    "number_of_documents": 1,
    "total_value": 0.0,
    "all_files_url": "",
    "send_to_fund_administrator": 0,
    "signature_expiration_date": null,
    "webhook_key": "ac73c564-989d-4c53-932b-d8f96b007585",
    "requester_key": null,
    "signature_status": "pending",
    "internal_status": "pending",
    "attached_document_number": "74766848000162",
    "current_signature_position": "1",
    "internal_webhook_key": "ac73c564-989d-4c53-932b-d8f96b007584",
    "created_at": "2023-05-15 23:54:35",
    "batch_group_type": "icp_signature",
    "requester_identifier": null,
    "send_emails": false,
    "is_asynchronous": false,
    "batches": [
        {
            "document_batch_key": "cd65292e-6748-4c1a-9520-de019f2f341b",
            "name": "Termo de Endosso",
            "document_type": "term_of_endorsement",
            "signature_type": "cades",
            "signature_status": "pending",
            "created_at": "2023-05-15 23:54:35",
            "related_parties": [
                {
                    "related_party_key": "41cf4d2a-fa9a-4cd1-93a0-5a1847b14fb3",
                    "name": "nome da empresa ",
                    "role": "assignor",
                    "signature_status": "pending",
                    "signature_position": "1",
                    "created_at": "2023-05-15 23:54:35",
                    "auto_signature": 0,
                    "notify_to": [],
                    "signer_groups": [
                        {
                            "id": 38586,
                            "expiration": null,
                            "minimum_required_signers": 1,
                            "signable_limit": null,
                            "signature_status": "pending",
                            "created_at": "2023-05-15 23:54:35",
                            "signers": [
                                {
                                    "id": 65062,
                                    "signer_control_number": "1",
                                    "signature_timestamp": null,
                                    "signature_status": "pending",
                                    "name": "João",
                                    "is_group_mandatory": true,
                                    "email": "teste@qitech.com.br",
                                    "document_number": "85653681067",
                                    "created_at": "2023-05-15 23:54:35"
                                }
                            ]
                        }
                    ]
                }
            ],
            "documents": [
                {
                    "document_key": "19f3c0ib-3926-4274-b2ab-720014b35f53",
                    "control_number": "96a8cd68-76b4-4abf-8180-7d8ebe39567e",
                    "file_size": 1681,
                    "file_url": "https://storage.googleapis.com/certifier-api-storage-sandbox/093f1aef-437e-405b-9ef9-51efd73dbd57/teste_of_original.pdf",
                    "name": "teste_of.pdf",
                    "original_file_url": "https://storage.googleapis.com/certifier-api-storage-sandbox/093f1aef-437e-405b-9ef9-51efd73dbd57/teste_of_original.pdf",
                    "status": "pending",
                    "signed_file_url": null,
                    "created_at": "2023-05-15 23:54:35",
                    "signatures": []
                }
            ]
        }
    ],
    "watcher_clients": []
}

```
</div>
</details>

## Request Body Params

| Field                      | Type     | Description           | Required |
|-----------------------|----------|----------------------------------|----------|
| `main_related_party`        | string   | Name of the main party responsible for signing the event.  | YES      |
| `name`                     | string   | Name of the batch group.  | YES      |
| `total_value`              | string   | Total value of the documents in the event. | YES      |
| `send_emails`  | boolean  | Indicates whether signature emails should be sent for this event. If **FALSE**, no emails will be sent at any stage of the process. | YES |
| `attached_document_number` | string   | Assignor’s CNPJ, used when the document is related to a specific assignor.| NO |
| `batches`                  | list     | List of different document types and their respective related parties. | YES|
| `webhook_url`              | string   | URL to which the notification webhook will be sent. | NO |
| `webhook_url_list`         | list     | List of URLs to which the notification webhooks will be sent. | NO |
| `is_asynchronous`          | boolean  | Indicates if the event includes a document generated asynchronously. | NO |
| `send_to_fund_administrador` | boolean | After signing, the event should notify via SOAP an administrator using the Fromtis software.| NO |

:::info
- The fields **webhook_url** or **webhook_url_list** should be sent only if there is interest in receiving webhooks. Also, only one of these options should be provided per request.
- The field **is_asynchronous** must be set to **True** when the event contains a document created asynchronously.
:::

### Objeto Batches 

| Field             | Type    | Description                                                    | Required |
|-------------------|---------|----------------------------------------------------------------|----------|
| `related_parties`  | list    | List of related parties involved in signing a list of documents.| YES      |
| `documents`       | list    | List of documents.                                              | YES      |
| `name`            | string  | Name of the batch.                                              | YES      |
| `signature_type`  | enum    | Type of signature.                                              | YES      |
| `document_type`   | enum    | Type of document.                                               | YES      |

<details>
  <summary>Enumerators for signature types (signature_type)</summary>

**cades**: Cades  
**pades**: Pades  

</details>

<details>
  <summary>Enumerators for document types (document_type)</summary>

**endorsement**: Endorsement  
**other**: Other
**contract**: Contract  
**term_of_assignment**: Term of ssignment  
**term_of_endorsement**: Term of endorsement  
**promissory_note**: Promissory note  
**rural_term_of_assignment**: Rural term of assignment  
**term_of_fomentation**: Term of fomentation
**cpr**: CPR  
**cprf**: CPRF  
**trade_bill**: Trade bill
**subscription_note**: Subscription note  
**adhesion_term**: Adhesion term  
**limited_liability_term**: Limited liability term  
**account_request_document**: Account request document  
**ccb_post_sac_cdi**: CCB POST-SAC CDI  
**ccb_post_sac_ipca**: CCB Post-SAC IPCA  
**ccb_post_sac_igpm**: CCB Post-SAC IGPM  
**ccb_post_price_cdi**: CCB Post-Price CDI  
**ccb_post_price_ipca**: CCB Post-Price IPCA  
**ccb_post_price_igpm**: CCB Post-Price IGPM  
**ccb_post_price_days_cdi**: CCB Post-Price Days CDI  
**ccb_post_price_days_ipca**: CCB Post-Price Days IPCA  
**ccb_post_price__days_igpm**: CCB Post-Price Days IGPM  
**ncom_pre_sac**: Nota Comercial Pre-Sac  
**ncom_pre_price**: Nota Comercial Pre Price  
**ncom_pre_sac_days**: Nota Comercial Pre-Price Days  
**ncom_post_sac_cdi**: Nota Comercial Post-SAC CDI  
**ncom_post_sac_ipca**: Nota Comercial Post-SAC IPCA  
**ncom_post_sac_igpm**: Nota Comercial Post-SAC IGPM  
**ncom_post_price_cdi**: Nota Comercial Post-Price CDI  
**ncom_post_price_ipca**: Nota Comercial Post-Price IPCA  
**ncom_post_price_igpm**: Nota Comercial Post-Price IGPM  
**ncom_post_price_days_cdi**: Nota Comercial Post-Price Days CDI  
**ncom_post_price_days_ipca**: Nota Comercial Post-Price Days IPCA  
**ncom_post_price__days_igpm**: Nota Comercial Post-Price Days IGPM  
**ccb_cdi_perc**: CCB CDI Perc  
**ccb_cdi_plus**: CCB CDI+  
**ccb_pre_price**: CCB Pre-Price  
**ccb_pre_sac**: CCB (pre-sac)  
**cce_cdi_perc**: CCE CDI Perc  
**cce_cdi_plus**: CCE CDI+  
**cce_pre_price**: CCE Pre-Price  
**cce_pre_sac**: CCE Pre-Sac  
**cce_post_sac_cdi**: CCE Post-SAC CDI  
**cce_post_sac_ipca**: CCE Post-SAC IPCA  
**cce_post_sac_igpm**: CCE Post-SAC IGPM  
**cce_post_price_cdi**: CCE Post-Price CDI  
**cce_post_price_ipca**: CCE Post-Price IPCA  
**cce_post_price_igpm**: CCE Post-Price IGPM  
**cce_post_price_days_cdi**: CCE Post-Price Days CDI  
**cce_post_price_days_ipca**: CCE Post-Price Days IPCA  
**cce_post_price_daysigpm**: CCE Post-Price Days IGPM  
**cci_cdi_perc**: CCI CDI Perc  
**cci_cdi_plus**: CCI CDI+  
**cci_pre_price**: CCI Pre-Price  
**cci_pre_sac**: CCI Pre-Sac  
**cci_post_sac_cdi**: CCI Post-SAC CDI  
**cci_post_sac_ipca**: CCI Post-SAC IPCA  
**cci_post_sac_igpm**: CCI Post-SAC IGPM  
**cci_post_price_cdi**: CCI Post-Price CDI  
**cci_post_price_ipca**: CCI Post-Price IPCA  
**cci_post_price_igpm**: CCI Post-Price IGPM  
**cci_post_price_days_cdi**: CCI Post-Price Days CDI  
**cci_post_price_days_ipca**: CCI Post-Price Days IPCA  
**cci_post_price_days_igpm**: CCI Post-Price Days IGPM  
**nce_cdi_perc**: NCE CDI Perc  
**nce_cdi_plus**: NCE CDI+  
**nce_pre_price**: NCE Pre-Price  
**nce_pre_sac**: NCE Pre-Sac  
**nce_post_sac**: NCE Post-SAC  
**nce_post_price**: NCE Post-Price  
**nce_post_price_days**: NCE Post-Price Days  

</details>

### Objeto Related Parties

### Related Parties Object

| Field              | Type    | Description                                                                                         | Required |
|--------------------|---------|-----------------------------------------------------------------------------------------------------|----------|
| `role`             | enum    | Role played by the signers.                                                                         | YES      |
| `name`             | string  | Name of the related party.                                                                          | YES      |
| `signature_position`| integer | Signature position; must be provided when there is a signing order among related parties. The order follows an ascending sequence. | NO       |
| `signer_groups`    | list    | List of signer groups.                                                                              | YES      |

<details>
  <summary> Enumerators for Related Party Roles (`role`)</summary>

**assignor**: Assignor  
**manager**: Manager  
**underwriter**: Underwriter  
**issuer**: Issuer  
**intervening_discharger**: Intervening discharger  
**investor**: Investor  
**debtor**: Debtor  
**secretary**: Secretary  
**intervening_consentor**: Intervening consentor  
**guarantor**: Fiador  
**fund_representative**: Fund representative
**company_representative**: Company representative  
**solidary_debtor**: Solidary debtor  
**attestant**: Attestant  
**bestowal**: Bestowal  
**owner**: Owner  
**attorney**: Attorney  
**associate**: Associate  
**co_issuer**: Co_issuer  
**fiduciary_agent**: Fiduciary agent  
**guest**: Guest  
**spouse**: Spouse  
**intervening_guarantor**: Intervening guarantor  
**fiduciary_debtor**: Fiduciary debtor  
**bonafide_depositary**: Bonafide depositary  
**faithful_depositary**: Faithful depositary  
**president**: President  
**endorser**: Endorser  
**fund_administrator**: Fund administrator  
**cosigner**: Cosigner  
**consulting**: Consulting  
**fund_manager**: Fund Manager
**director**: Director  

</details>

### Signer Groups Object

| Field                      | Type    | Description              | Required |
|----------------------------|---------|----------------------------------------------------|----------|
| `minimum_required_signers` | integer | Minimum number of signers required to consider the group's signatures complete. | YES      |
| `signers`                  | list    | List of signers that make up the signer group.        | YES      |

### Signer Object

| Field              | Type     | Description                                                            | Required |
|------------------------|----------|----------------------------------------------------------|----------|
| `name`                 | string   | Signer's full name.| YES      |
| `document_number`      | string   | Signer's CPF.| YES      |
| `email`                | string   | Signer's email address.| YES      |
| `is_group_mandatory`   | boolean  | Set to **TRUE** to indicate that the signer is required for the group to be considered complete.| YES      |
| `signer_control_number`| string   | Optional free-text field that can be used for control or external reference purposes.| YES      |

### Documents Object

:::info Important  
The `documents` field must be populated using the response from the `/document` request.  
:::

| Field             | Type   | Description | Required |
|-------------------|--------|------------------------------------------------------------------------------------------------------|----------|
| `name`            | string | Document name.           | YES      |
| `control_number`  | string | Free text field that can be used for control or external reference purposes. In the integration with Fromtis involving duplicates, this value must match the one received in the asynchronous document creation endpoint. | YES      |
| `file_size`       | float  | Document size. | YES      |
| `url`             | string | URL of the document. | YES      |
| `document_key`    | string | Unique key identifying the document. | YES      |

## Response Body Params

| Field                | Type    | Description                                                  |
|----------------------|---------|--------------------------------------------------------------|
| `batch_group_key`    | string  | Unique key identifying the batch group.                    |
| `signature_status`   | string  | Signature status.                                            |
| `internal_status`    | string  | General status of the event.                                 |
| `original_file_url`  | string  | URL of the original document.                                |
| `signed_file_url`    | string  | URL of the document with signing page.                       |
| `file_url`           | string  | URL of the signature file.                                   |
| `signature_timestamp`| date    | Date of the signature.                                       |
| `webhook_key`        | string  | Unique key identifying the webhook.                          |

---

# Create Batch Group to Notify Fromtis

URL: /en/documentation/certifiqi/criar_batch_group_fromtis

Certifiqi offers the option to send notifications via SOAP to administrators using the Fromtis software. For the notification to be performed correctly, it is necessary to follow some specific steps. If any of these steps are not completed, the batch groups will remain pending notification because it was not possible to find a lease provided by Fromtis.

The signature notification will be sent after the signing of all required documents is completed.

## Batch Group with Trade Bill

1. Document Submission
   1. Send the CNAB of the duplicates asynchronously according to topic 4.2.3.
   2. Send the assignment agreement in PDF format.
2. Event Creation
   1. Include the field is_asynchronous set to True in the request body.
   2. Include the field send_to_fund_administrator set to True in the request body.
   3. Include the field total_value with the net value of the assignment in the request body.
   4. Include the document type corresponding to the duplicate and its documents in the request body.
   5. Include the document type corresponding to the assignment agreement and its respective document in the request body.

## Batch Group with Other Asset Types

1. Document Submission
   1. Send the term of endorsemet in PDF
2. Event Creation
    1. Include the field send_to_fund_administrator set to True in the request body.
    2. Include the field total_value with the net value of the assignment in the request body.
    3. Include the document type corresponding to the assignment agreement and its respective document in the request body.

---

# Send to signature

URL: /en/documentation/certifiqi/enviar_para_assinatura

## Request

This request sends an email to the signers. The recipient must be specified during the creation of the batch group.

ENDPOINT /batch_group/batch_group_key/send_to_signature
MÉTODO PUT

### Path params

| Campo | Tipo | Descrição |
|---|---|---|
| `batch_group_key`|  string | Unique key identifying the batch group. |

Response Body

```json
{}

```

---

# Structure

URL: /en/documentation/certifiqi/estrutura

Certifiqi uses batch group that encompass different documents and their respective signers. Below are some key terms to help you understand how the platform works.

### Related Party

Represents an individual or a legal entity (company) associated with the signing of documents. It may include one or more signer groups.

### Signer Group

A group of signers that make up a related party. If any of the configured groups meet the required condition (minimum number of signatures or represented value), the related party is considered signed. This allows flexible signature rules for companies.

### Signer

A signer who belongs to a group. You can define whether their signature is mandatory for the group's condition to be satisfied.

### Document

A document that must be signed.

### Document Batch

A set of documents of a given type that must be signed by one or more related parties. A batch group can include multiple batches, each representing a different document category.

### Batch Group

The batch group itself, which groups multiple document batches (Document Batch) to be signed.

## Diagrama da estrutura

## Exemplo de Uso

### Diagrama

The batch group contains two elements of type Document Batch: one for Trade Bills and another for the Term of Assignment.

### Document Batch – Trade bill

- Contains two documents: Trade Bill 1 and Trade Bill 2.

- It is associated with a Related Party representing the Assignor.

- This Related Party has two Signer Groups:

    - Signer Group 1: composed of two signers (Signer 1 and Signer 2).

    - Signer Group 2: composed of one signer (Signer 3).

For the Related Party to be considered as signed, it is sufficient that one of the Signer Groups is satisfied. This can happen in two ways:

- Option 1: Signer 1 and Signer 2 sign, satisfying Signer Group 1.

- Option 2: Only Signer 3 signs, satisfying Signer Group 2.

Once the Related Party is satisfied by either of these options, the Trade Bill Document Batch will be considered signed.

### Document Batch – Assignment Agreement

- Contains one document: Assignment Agreement.
- Has two Related Parties:
    - Assignor
    - Fund Administrator
- Each Related Party has a signer group.
- The consulting Related Party has a Signer Group with two signers, so both signers must sign to complete the consulting related party.
- The fund administrator Related Party has a Signer Group with one signer, so this signer must sign to complete the fund administrator related party.

Once the Related Parties are satisfied, the Assignment Agreement Document Batch will be considered signed.

---

# Authentication Method

URL: /en/documentation/certifiqi/forma_de_autenticacao

To make a request to our platform, you need to include the API key in the request header using the x-api-token field, as shown in the example below:

Header

```json

{"x-api-token": "\<EXAMPLE-OF-API-KEY\>"}

```

This key is exclusive to each client and can be requested by email by sending your request to certifiqi@qitech.com.br.

---

# Start

URL: /en/documentation/certifiqi/inicio

The Certifiqi platform aims to perform signatures using certificates that comply with the ICP-Brasil standard. In addition, signatures are completed within seconds, even for a high volume of documents. For more information, visit:

https://qitech.com.br

# Signature Methods

### Cades
- A type of digital signature where the signature data is stored in a separate file. 
- File in .p7s format.

### Pades
- A type of digital signature where the signature is embedded within the PDF file itself.
- File in .pdf format.

---

# User Permissions

URL: /en/documentation/certifiqi/permissoes

Users on the platform are divided into three access categories: master, signer, and observer.

### Master:
- Can edit and create events.
- Can view all documents.
- Can change user permissions.

### Signer:
- Can sign documents on the platform.
- Can view documents for which they are a signer.

### Observer:
- Can view documents on the platform.

---

# CNAB Document Upload

URL: /en/documentation/certifiqi/upload_documentos_cnab_assincrono

# Usage  
This method is used to convert each line of a CNAB 444 file into a PDF asynchronously.

The event can be created before the document creation process is completed.

:::warning Important Notice!  
The field `is_asynchronous` must be set to TRUE when creating the event. Documents will be available for signing only after the document generation is finished.  
:::

## Request

ENDPOINT /certifier/document/trade_bill/asynchronous
MÉTODO POST

### Request Body Params

The following data must be sent as **form-data** in the request body:

| Field                 | Type   | Description                  | Required |
|-----------------------|--------|------------------------------|----------|
| `file`                | file   | Binary file of the document to be uploaded. | YES      |
| `assignor_address`    | string | Address of the assignor.      | YES      |
| `assignor_address_number` | string | Address number of the assignor. | YES   |
| `assignor_city`       | string | City of the assignor.         | YES      |
| `assignor_state`      | string | State of the assignor.        | YES      |
| `assignor_CEP`        | string | ZIP code (CEP) of the assignor. | YES    |
| `assignor_neighborhood` | string | Neighborhood of the assignor. | YES    |

### Response

STATUS 200

Response Body

```json
[
    {
        "control_number": "1123",
        "document_key": "d559e3dc-d19c-494e-b02e-b7199e5325ea",
        "file_size": 1679,
        "name": "trade_bill_1.pdf",
        "url": "https://storage.googleapis.com/certifier-api-storage-sandbox/d559e3dc-d19c-494e-b02e-b7199e5325ea/teste_of_original.pdf"
    },
    {
        "control_number": "1123",
        "document_key": "d559e3dc-d19c-494e-b02e-b7199e5325ea",
        "file_size": 1679,
        "name": "trade_bill_2.pdf",
        "url": "https://storage.googleapis.com/certifier-api-storage-sandbox/d559e3dc-d19c-494e-b02e-b7199e5325ea/teste_of_original.pdf"
    },
    {
        "control_number": "1123",
        "document_key": "d559e3dc-d19c-494e-b02e-b7199e5325ea",
        "file_size": 1679,
        "name": "trade_bill_3.pdf",
        "url": "https://storage.googleapis.com/certifier-api-storage-sandbox/d559e3dc-d19c-494e-b02e-b7199e5325ea/teste_of_original.pdf"
    }
]

```

STATUS 400

Response Body

```json
{
    "title": "Bad Request",
    "description": "Document size larger than 20 MB"
}
```

## Example Request
```shell
curl --location 'https://api.sandbox.certifiqi.com.br/document' \
--header 'x-api-token: chave de api' \
--form 'file=@"/seu_cnab.txt"' \
--form 'assignor_address="Rua"' \
--form 'assignor_address_number="1111"' \
--form 'assignor_city="São Paulo"' \
--form 'assignor_state="São Paulo"' \
--form 'assignor_CEP="123456789113"' \
--form 'assignor_neighborhood="Teste"'
```

---

# PDF Document Upload

URL: /en/documentation/certifiqi/upload_documentos_pdf

# Usage  
This method should be used to upload documents in PDF format.

## Request

ENDPOINT /document
MÉTODO POST

### Request Body Params

The following data must be sent as **form-data** in the request body:

| Field                   | Type     | Description                                                                                     | Required |
|-------------------------|----------|-------------------------------------------------------------------------------------------------|----------|
| `file`                  | file     | Binary file of the document to be uploaded.                                                     | YES      |
| `control_number`        | string   | Free field that can be used for control or external reference purposes.                         | NO       |
| `endorsement_page`      | boolean  | If set to true, an Endorsement Page will be added.                                            | NO       |
| `endorser_name`         | string   | Name of the endorser on the endorsement page.                                                | NO       |
| `endorser_document_number` | string | Document number of the endorser on the endorsement page.                                      | NO       |
| `receiver_name`         | string   | Name of the receiver on the endorsement page.                                                | NO       |
| `receiver_document_number` | string | Document number of the receiver on the endorsement page.                                      | NO       |
| `document_identifier`   | string   | Document identifier on the endorsement page.                                                  | NO       |
| `document_type`         | string   | Type of document on the endorsement page.                                                    | NO       |

## Response

STATUS 200

Response Body

```json
[
    {
        "control_number": "1123",
        "document_key": "d559e3dc-d19c-494e-b02e-b7199e5325ea",
        "file_size": 1679,
        "name": "document.pdf",
        "url": "https://storage.googleapis.com/certifier-api-storage-sandbox/d559e3dc-d19c-494e-b02e-b7199e5325ea/teste_of_original.pdf"
    },
]

```

STATUS 400

Response Body

```json
{
    "title": "Bad Request",
    "description": "Document size larger than 20 MB"
}
```

Response Body

```json
{
    "title": "Bad Request",
    "description": "PDF has editable format fields"
}
```

Response Body

```json
{
    "title": "Bad Request",
    "description": "PDF file can't have a password."
}
```

## Request de Exemplo
```shell
curl --location 'https://api.certifiqi.com.br/document' \
--header 'x-api-token: chave de api' \
--form 'file=@"/seu_arquivo.pdf"' \
--form 'endorsement_page="true"' \
--form 'endorser_name="Endorser"' \
--form 'endorser_document_number="123456789112"' \
--form 'receiver_name="Receiver"' \
--form 'receiver_document_number="123456789113"' \
--form 'document_type="Termo de Cessão"' \
--form 'document_identifier="1234"' \
--form 'control_number="999"'
```

## Adding the Endorsement Page

To add a black endorsement page at the end of the uploaded PDF, the following fields must be provided:

- `endorsement_page` set to True  
- `endorser_name`  
- `endorser_document_number`  
- `receiver_name`  
- `receiver_document_number`  
- `document_identifier`  
- `document_type`  

When these fields are sent, the added endorsement text will follow the format below:

The institution **endorser_name**, registered under CNPJ number **endorser_document_number**, endorses this **document_type** number **document_identifier** to **receiver_name**, registered under CNPJ number **receiver_document_number**, pursuant to the applicable legislation, especially paragraph 1 of article 29 of Law No. 10,931, dated August 2, 2004, aiming to transfer full ownership to the institution indicated herein.  
This endorsement is performed electronically, and the parties hereby agree and acknowledge the validity of its electronic signature, pursuant to paragraph 2 of article 10 of Provisional Measure No. 2,200, dated August 24, 2001, or any regulation that may replace it.

---

# Webhook

URL: /en/documentation/certifiqi/webhook

All notifications related to the batch group will be sent to the address registered at the event creation. In every webhook call, the payload will include data from batch_group, batches, related_parties, signer_groups, and signer.

The notification will be sent whenever one of the following stages is completed: related parties, start of ZIP file creation, or completion of the batch group.

## Notification of Signed Related Party

In this case, the **signature_status** field of the related party, the signer group, and the signers will have the value **signed**. Meanwhile, the **internal_status** field will have the value **pending**.

### Webhook Examples

Response Body

```json
{
  "batch_group_key": "d445060c-7ecf-4a18-870a-feebaadf2618",
  "name": "aaa",
  "main_related_party": "aaa",
  "number_of_documents": 1,
  "total_value": 0,
  "all_files_url": "",
  "send_to_fund_administrator": 0,
  "signature_expiration_date": null,
  "webhook_key": "e4bbb09d-97d0-4cd7-b4fc-71ed7368a650",
  "client_key": "5aaf98d2-0264-48dd-8167-eab859ce5a75",
  "requester_key": null,
  "signature_status": "pending",
  "internal_status": "pending",
  "attached_document_number": "59860422000180",
  "current_signature_position": "1",
  "control_number": null,
  "internal_webhook_key": null,
  "created_at": "2023-05-18 00:02:49",
  "batch_group_type": "icp_signature",
  "requester_identifier": null,
  "send_emails": true,
  "batches": [
    {
      "document_batch_key": "a34bd069-9ae9-4baf-8204-7559e84e6947",
      "name": "Outros",
      "document_type": "other",
      "signature_type": "cades",
      "signature_status": "pending",
      "created_at": "2023-05-18 00:02:49",
      "related_parties": [
        {
          "related_party_key": "b972beb3-7659-40ac-8999-8574cfe42191",
          "name": "Savio",
          "role": "assignor",
          "signature_status": "signed",
          "signature_position": "1",
          "created_at": "2023-05-18 00:02:49",
          "auto_signature": 0,
          "notify_to": [],
          "signer_groups": [
            {
              "id": 38598,
              "expiration": null,
              "minimum_required_signers": 1,
              "signable_limit": null,
              "signature_status": "signed",
              "created_at": "2023-05-18 00:02:49",
              "signers": [
                {
                  "id": 65095,
                  "signer_control_number": "1",
                  "signature_timestamp": "2023-05-18 00:06:08",
                  "signature_status": "signed",
                  "name": "Savio",
                  "is_group_mandatory": true,
                  "email": "savio.gama@qitech.com.br",
                  "document_number": "43141581827",
                  "created_at": "2023-05-18 00:02:49"
                }
              ]
            }
          ]
        },
        {
          "related_party_key": "e19d038e-5c60-47db-aa44-d4d948592705",
          "name": "Turing",
          "role": "guarantor",
          "signature_status": "pending",
          "signature_position": "1",
          "created_at": "2023-05-18 00:02:49",
          "auto_signature": 0,
          "notify_to": [],
          "signer_groups": [
            {
              "id": 38599,
              "expiration": null,
              "minimum_required_signers": 1,
              "signable_limit": null,
              "signature_status": "pending",
              "created_at": "2023-05-18 00:02:49",
              "signers": [
                {
                  "id": 65096,
                  "signer_control_number": "1",
                  "signature_timestamp": null,
                  "signature_status": "pending",
                  "name": "Turing",
                  "is_group_mandatory": true,
                  "email": "teste@gmail.com",
                  "document_number": "56072386105",
                  "created_at": "2023-05-18 00:02:49"
                }
              ]
            }
          ]
        }
      ],
      "documents": [
        {
          "document_key": "40c0940a-3db5-489b-86d6-ebf2717e0a9c",
          "control_number": "9f907aef-04b5-4adb-9f4e-e2c53293c4d7",
          "file_size": 1669,
          "file_url": "https://storage.googleapis.com/certifier-api-storage-sandbox/40c0940a-3db5-489b-86d6-ebf2717e0a9c/teste_of_original.pdf",
          "name": "teste_of.pdf",
          "original_file_url": "https://storage.googleapis.com/certifier-api-storage-sandbox/40c0940a-3db5-489b-86d6-ebf2717e0a9c/teste_of_original.pdf",
          "status": "pending",
          "signed_file_url": null,
          "created_at": "2023-05-18 00:02:49",
          "signatures": [
            {
              "signer": {
                "id": 65095,
                "signer_control_number": "1",
                "signature_timestamp": "2023-05-18 00:06:08",
                "signature_status": "signed",
                "name": "Savio",
                "is_group_mandatory": true,
                "email": "savio.gama@qitech.com.br",
                "document_number": "43141581827",
                "created_at": "2023-05-18 00:02:49"
              },
              "signed_hash": "ldp+t2F5MpgLtA++sIaFxEKXxsVJGnXeco2+cN7v3KSlsvxIwm2xMwQ4JjE8Mm3s93swB0dYBb5m/BBmCuRhzRsopQtVVRgRkdhKSwa5JBWVIgEd7gsb/CMIQqmG4wZLM9XZNUrx60LwfrdAnyjDEg8/JBdoeks3whOeQ1eai04dZyBAHkd6yplnFvi89PhEjLNU93C2CqyjCaSVr5HviLQovlpTxmiPYfRR+cqzlljbYLMqat2LXvjaW2T6AvtYWQRmL3HJ5GmDQytjNXsHBOQFKQ+Nyu+KnEnxg2ofqmNXlhID78YaGFpmZVLT9aLeFflJIFazaHWq6wPq8M5Hqg==",
              "signature_timestamp": "2023-05-18 00:06:08",
              "signature_status": "signed",
              "role": "assignor",
              "created_at": "2023-05-18 00:06:13"
            }
          ]
        }
      ]
    }
  ],
  "watcher_clients": [],
  "zip_file_keys_list": []
}

```

## Event Completion

To finalize the event, a webhook will first be sent indicating that all related parties have signed. At this moment, the internal_status field will have the value **waiting_zip_files_creation**. The link to the signed documents will already be available.

After the webhook mentioned above, a new webhook will be sent indicating the complete finalization of the event. At this point, the **internal_status** field will have the value **finished**, and the event will be supplemented with the ZIP file, which can be retrieved using the keys contained in **zip_file_keys_list**. The ZIP file contains all documents and the signature file.

To learn how to retrieve the ZIP file, refer to section 4.5. Retrieve URL.

### Webhook Examples Waiting for ZIP Generation

Response Body

```json
{
  "batch_group_key": "d445060c-7ecf-4a18-870a-feebaadf2618",
  "name": "aaa",
  "main_related_party": "aaa",
  "number_of_documents": 1,
  "total_value": 0,
  "all_files_url": null,
  "send_to_fund_administrator": 0,
  "signature_expiration_date": null,
  "webhook_key": "e4bbb09d-97d0-4cd7-b4fc-71ed7368a650",
  "client_key": "5aaf98d2-0264-48dd-8167-eab859ce5a75",
  "requester_key": null,
  "signature_status": "signed",
  "internal_status": "waiting_zip_files_creation",
  "attached_document_number": "59860422000180",
  "current_signature_position": "1",
  "control_number": null,
  "internal_webhook_key": null,
  "created_at": "2023-05-18 00:02:49",
  "batch_group_type": "icp_signature",
  "requester_identifier": null,
  "send_emails": true,
  "batches": [
    {
      "document_batch_key": "a34bd069-9ae9-4baf-8204-7559e84e6947",
      "name": "Outros",
      "document_type": "other",
      "signature_type": "cades",
      "signature_status": "signed",
      "created_at": "2023-05-18 00:02:49",
      "related_parties": [
        {
          "related_party_key": "b972beb3-7659-40ac-8999-8574cfe42191",
          "name": "Savio",
          "role": "assignor",
          "signature_status": "signed",
          "signature_position": "1",
          "created_at": "2023-05-18 00:02:49",
          "auto_signature": 0,
          "notify_to": [],
          "signer_groups": [
            {
              "expiration": null,
              "minimum_required_signers": 1,
              "signable_limit": null,
              "signature_status": "signed",
              "created_at": "2023-05-18 00:02:49",
              "signers": [
                {
                  "signer_control_number": "1",
                  "signature_timestamp": "2023-05-18 00:06:08",
                  "signature_status": "signed",
                  "name": "Savio",
                  "is_group_mandatory": true,
                  "email": "savio.gama@qitech.com.br",
                  "document_number": "43141581827",
                  "created_at": "2023-05-18 00:02:49"
                }
              ]
            }
          ]
        },
        {
          "related_party_key": "e19d038e-5c60-47db-aa44-d4d948592705",
          "name": "Turing",
          "role": "guarantor",
          "signature_status": "signed",
          "signature_position": "1",
          "created_at": "2023-05-18 00:02:49",
          "auto_signature": 0,
          "notify_to": [],
          "signer_groups": [
            {
              "expiration": null,
              "minimum_required_signers": 1,
              "signable_limit": null,
              "signature_status": "signed",
              "created_at": "2023-05-18 00:02:49",
              "signers": [
                {
                  "signer_control_number": "1",
                  "signature_timestamp": "2023-05-18 00:09:44",
                  "signature_status": "signed",
                  "name": "Turing",
                  "is_group_mandatory": true,
                  "email": "teste@gmail.com",
                  "document_number": "56072386105",
                  "created_at": "2023-05-18 00:02:49"
                }
              ]
            }
          ]
        }
      ],
      "documents": [
        {
          "document_key": "40c0940a-3db5-489b-86d6-ebf2717e0a9c",
          "control_number": "9f907aef-04b5-4adb-9f4e-e2c53293c4d7",
          "file_size": 1669,
          "file_url": "https://storage.googleapis.com/certifier-api-storage-sandbox/40c0940a-3db5-489b-86d6-ebf2717e0a9c/teste_of_signed.p7s",
          "name": "teste_of.pdf",
          "original_file_url": "https://storage.googleapis.com/certifier-api-storage-sandbox/40c0940a-3db5-489b-86d6-ebf2717e0a9c/teste_of_original.pdf",
          "status": "signed",
          "signed_file_url": "https://storage.googleapis.com/certifier-api-storage-sandbox/40c0940a-3db5-489b-86d6-ebf2717e0a9c/teste_of_signed.pdf",
          "created_at": "2023-05-18 00:02:49",
          "signatures": [
            {
              "signer": {
                "signer_control_number": "1",
                "signature_timestamp": "2023-05-18 00:06:08",
                "signature_status": "signed",
                "name": "Savio",
                "is_group_mandatory": true,
                "email": "savio.gama@qitech.com.br",
                "document_number": "43141581827",
                "created_at": "2023-05-18 00:02:49"
              },
              "signed_hash": "ldp+t2F5MpgLtA++sIaFxEKXxsVJGnXeco2+cN7v3KSlsvxIwm2xMwQ4JjE8Mm3s93swB0dYBb5m/BBmCuRhzRsopQtVVRgRkdhKSwa5JBWVIgEd7gsb/CMIQqmG4wZLM9XZNUrx60LwfrdAnyjDEg8/JBdoeks3whOeQ1eai04dZyBAHkd6yplnFvi89PhEjLNU93C2CqyjCaSVr5HviLQovlpTxmiPYfRR+cqzlljbYLMqat2LXvjaW2T6AvtYWQRmL3HJ5GmDQytjNXsHBOQFKQ+Nyu+KnEnxg2ofqmNXlhID78YaGFpmZVLT9aLeFflJIFazaHWq6wPq8M5Hqg==",
              "signature_timestamp": "2023-05-18 00:06:08",
              "signature_status": "signed",
              "role": "assignor",
              "created_at": "2023-05-18 00:06:13"
            },
            {
              "signer": {
                "signer_control_number": "1",
                "signature_timestamp": "2023-05-18 00:09:44",
                "signature_status": "signed",
                "name": "Turing",
                "is_group_mandatory": true,
                "email": "teste@gmail.com",
                "document_number": "56072386105",
                "created_at": "2023-05-18 00:02:49"
              },
              "signed_hash": "Djc8YDrgdrHdhpyfP6rmp/6HIPfA1NdzSU3gov1A0PbhrJhW1toOOGZ5VHCM82EHT77fB5G7gmJSIaufU9+Mz9o3pzWqY3GRQe3g9vqO01ejonIf1HOEpkx5Q/9bB23L/OlnzGfrQ2JCzsuExpTzkmG65zKMzNdHFdmz3PtdpssTl3kQNIG00piKxHE5GiRC67uYcZyFDWQbHEeNSczrCodIlKVCtfc7V8dzsfIr+4u6vtkQYhj6GTRYIxcJjgtYJfHnMlgsQUstl0Vyt3tQzfkAq021HmvlMtf/N3WZRZGThLTb1NczEEVnD/AXllQvW08mtOHQKBnVkxB8xQikEw==",
              "signature_timestamp": "2023-05-18 00:09:44",
              "signature_status": "signed",
              "role": "guarantor",
              "created_at": "2023-05-18 00:09:45"
            }
          ]
        }
      ]
    }
  ],
  "watcher_clients": [],
  "zip_file_keys_list": []
}

```

### Exemplos de Webhook Evento finalizado

Response Body

```json
{
  "batch_group_key": "d445060c-7ecf-4a18-870a-feebaadf2618",
  "name": "aaa",
  "main_related_party": "aaa",
  "number_of_documents": 1,
  "total_value": 0,
  "all_files_url": "https://storage.googleapis.com/certifier-worker-storage-sandbox/d445060c-7ecf-4a18-870a-feebaadf2618/d445060c-7ecf-4a18-870a-feebaadf2618.zip",
  "send_to_fund_administrator": 0,
  "signature_expiration_date": null,
  "webhook_key": "e4bbb09d-97d0-4cd7-b4fc-71ed7368a650",
  "client_key": "5aaf98d2-0264-48dd-8167-eab859ce5a75",
  "requester_key": null,
  "signature_status": "signed",
  "internal_status": "finished",
  "attached_document_number": "59860422000180",
  "current_signature_position": "1",
  "control_number": null,
  "internal_webhook_key": null,
  "created_at": "2023-05-18 00:02:49",
  "batch_group_type": "icp_signature",
  "requester_identifier": null,
  "send_emails": true,
  "batches": [
    {
      "document_batch_key": "a34bd069-9ae9-4baf-8204-7559e84e6947",
      "name": "Outros",
      "document_type": "other",
      "signature_type": "cades",
      "signature_status": "signed",
      "created_at": "2023-05-18 00:02:49",
      "related_parties": [
        {
          "related_party_key": "b972beb3-7659-40ac-8999-8574cfe42191",
          "name": "Savio",
          "role": "assignor",
          "signature_status": "signed",
          "signature_position": "1",
          "created_at": "2023-05-18 00:02:49",
          "auto_signature": 0,
          "notify_to": [],
          "signer_groups": [
            {
              "expiration": null,
              "minimum_required_signers": 1,
              "signable_limit": null,
              "signature_status": "signed",
              "created_at": "2023-05-18 00:02:49",
              "signers": [
                {
                  "signer_control_number": "1",
                  "signature_timestamp": "2023-05-18 00:06:08",
                  "signature_status": "signed",
                  "name": "Savio",
                  "is_group_mandatory": true,
                  "email": "savio.gama@qitech.com.br",
                  "document_number": "43141581827",
                  "created_at": "2023-05-18 00:02:49"
                }
              ]
            }
          ]
        },
        {
          "related_party_key": "e19d038e-5c60-47db-aa44-d4d948592705",
          "name": "Turing",
          "role": "guarantor",
          "signature_status": "signed",
          "signature_position": "1",
          "created_at": "2023-05-18 00:02:49",
          "auto_signature": 0,
          "notify_to": [],
          "signer_groups": [
            {
              "expiration": null,
              "minimum_required_signers": 1,
              "signable_limit": null,
              "signature_status": "signed",
              "created_at": "2023-05-18 00:02:49",
              "signers": [
                {
                  "signer_control_number": "1",
                  "signature_timestamp": "2023-05-18 00:09:44",
                  "signature_status": "signed",
                  "name": "Turing",
                  "is_group_mandatory": true,
                  "email": "teste@gmail.com",
                  "document_number": "56072386105",
                  "created_at": "2023-05-18 00:02:49"
                }
              ]
            }
          ]
        }
      ],
      "documents": [
        {
          "document_key": "40c0940a-3db5-489b-86d6-ebf2717e0a9c",
          "control_number": "9f907aef-04b5-4adb-9f4e-e2c53293c4d7",
          "file_size": 1669,
          "file_url": "https://storage.googleapis.com/certifier-api-storage-sandbox/40c0940a-3db5-489b-86d6-ebf2717e0a9c/teste_of_signed.p7s",
          "name": "teste_of.pdf",
          "original_file_url": "https://storage.googleapis.com/certifier-api-storage-sandbox/40c0940a-3db5-489b-86d6-ebf2717e0a9c/teste_of_original.pdf",
          "status": "signed",
          "signed_file_url": "https://storage.googleapis.com/certifier-api-storage-sandbox/40c0940a-3db5-489b-86d6-ebf2717e0a9c/teste_of_signed.pdf",
          "created_at": "2023-05-18 00:02:49",
          "signatures": [
            {
              "signer": {
                "signer_control_number": "1",
                "signature_timestamp": "2023-05-18 00:06:08",
                "signature_status": "signed",
                "name": "Savio",
                "is_group_mandatory": true,
                "email": "savio.gama@qitech.com.br",
                "document_number": "43141581827",
                "created_at": "2023-05-18 00:02:49"
              },
              "signed_hash": "ldp+t2F5MpgLtA++sIaFxEKXxsVJGnXeco2+cN7v3KSlsvxIwm2xMwQ4JjE8Mm3s93swB0dYBb5m/BBmCuRhzRsopQtVVRgRkdhKSwa5JBWVIgEd7gsb/CMIQqmG4wZLM9XZNUrx60LwfrdAnyjDEg8/JBdoeks3whOeQ1eai04dZyBAHkd6yplnFvi89PhEjLNU93C2CqyjCaSVr5HviLQovlpTxmiPYfRR+cqzlljbYLMqat2LXvjaW2T6AvtYWQRmL3HJ5GmDQytjNXsHBOQFKQ+Nyu+KnEnxg2ofqmNXlhID78YaGFpmZVLT9aLeFflJIFazaHWq6wPq8M5Hqg==",
              "signature_timestamp": "2023-05-18 00:06:08",
              "signature_status": "signed",
              "role": "assignor",
              "created_at": "2023-05-18 00:06:13"
            },
            {
              "signer": {
                "signer_control_number": "1",
                "signature_timestamp": "2023-05-18 00:09:44",
                "signature_status": "signed",
                "name": "Turing",
                "is_group_mandatory": true,
                "email": "teste@gmail.com",
                "document_number": "56072386105",
                "created_at": "2023-05-18 00:02:49"
              },
              "signed_hash": "Djc8YDrgdrHdhpyfP6rmp/6HIPfA1NdzSU3gov1A0PbhrJhW1toOOGZ5VHCM82EHT77fB5G7gmJSIaufU9+Mz9o3pzWqY3GRQe3g9vqO01ejonIf1HOEpkx5Q/9bB23L/OlnzGfrQ2JCzsuExpTzkmG65zKMzNdHFdmz3PtdpssTl3kQNIG00piKxHE5GiRC67uYcZyFDWQbHEeNSczrCodIlKVCtfc7V8dzsfIr+4u6vtkQYhj6GTRYIxcJjgtYJfHnMlgsQUstl0Vyt3tQzfkAq021HmvlMtf/N3WZRZGThLTb1NczEEVnD/AXllQvW08mtOHQKBnVkxB8xQikEw==",
              "signature_timestamp": "2023-05-18 00:09:44",
              "signature_status": "signed",
              "role": "guarantor",
              "created_at": "2023-05-18 00:09:45"
            }
          ]
        }
      ]
    }
  ],
  "watcher_clients": [],
  "zip_file_keys_list": [
    "a1a8cd68-aab4-csbf-1180-dd8ebe395612",
    "cda8cd68-7331-qebf-1280-fw8ebe395676"
  ]
}

```

---

# Assignment Creation

URL: /en/documentation/cessoes/criacao_de_cessao_0eaeffec-ee95-4cb1-a266-bcb52f23237d

The assignment API allows the creation and querying of assignments directly by the client. It's possible to create an assignment using the assignment configuration key (UUID4) and query general assignment information through specific endpoints.

:::caution Attention
This service is only available for partners with registered assignment configuration. Please contact our support for more details.
:::

## Assignment Creation

To create an assignment, you need to perform a POST to the endpoint with the client's configuration key (**assignment_configuration_key**), the set of **credit_operation_keys** of the credit operations that are part of the assignment, and the **daily_assignment_interest_rate**, which corresponds to the daily assignment interest rate. This rate is on the same day basis as the contract in question.

### Request

ENDPOINT /v2/assignment/assignment_configuration/[assignment_configuration_key]/assignment
METHOD POST

### Params

| Field                          | Description                                                |
| ------------------------------ | ---------------------------------------------------------- |
| `assignment_configuration_key` | Client's assignment configuration identifier key          |

Request Body

```json
{
  "credit_operation_keys": ["key1", "key2", "key3"],
  "daily_assignment_interest_rate": 0.0003
}
```

:::caution Attention
If the **daily_assignment_interest_rate** is not provided in the Request for specific contracts, the assignment rate registered in the client's assignment configuration will be used.
:::

### Response

STATUS 201

Response Body

```json
[
  {
  "assignment_key": "868a2951-efff-4e41-8adf-bc36871a20fb",
  "creation_datetime": "2023-10-01T12:00:00",
  "reference_date": "2023-10-01",
  "total_amount": 120000,
  "number_of_items": 3,
  "status": "pending_items_calculation",
  "created_at": "2023-10-01T11:00:00"
  }
]
```

## Assignment Query
To query a specific assignment, the client can perform a GET on the endpoint using the assignment identifier key (**assignment_key**).

### Request

ENDPOINT /v2/assignment/[assignment_key] METHOD GET

### Params

| Field            | Description                   |
| ---------------- | ----------------------------- |
| `assignment_key` | Assignment identifier key     |

### Response

STATUS 200

Response Body

```json
{
  "assignment_key": "77997168-5d61-430f-b5ae-08eb3d7b8c0e",
  "creation_datetime": "2023-10-01T12:00:00",
  "reference_date": "2023-10-01",
  "total_amount": 120000,
  "number_of_items": 5,
  "term_of_assignment_url": "https://example.com/assignment.pdf",
  "status": "settled",
  "signable_term_url": "https://example.com/signable_term.pdf"
}
```

## Assignment Items Query
To query the contracts in the assignment, use GET on the endpoint with the same **assignment_key**.

### Request

ENDPOINT /v2/assignment/[assignment_key]/assignment_items METHOD GET

### Params

| Field            | Description               |
| ---------------- | ------------------------- |
| `assignment_key` | Assignment identifier key |

### Response

The return is a list of information for each contract in the assignment (status 200), paginated:

### Response

STATUS 200

Response Body

```json
{
    "data": [
        {
            "assignment_item_key": "439b1257-82ac-4741-a416-a4428a9a7327",
            "control_number": "0001",
            "credit_operation_key": "d7f2ba40-30ea-4462-890c-6a99a7d85659",
            "issuer_name": "João Santos",
            "issuer_document_number": "12345678912",
            "issue_amount": 50000,
            "disbursed_amount": 45000,
            "disbursement_date": "2023-01-01",
            "number_of_installments": 12,
            "contract_number": "XXX182938",
            "present_amount": 48000,
            "status": "settled",
            "endorsement_url": "https://example.com/endorsement.pdf",
            "purchaser_document_number": "1234567890001"
        }
    ],
    "pagination": {
        "page": 1,
        "page_size": 10
    }
}
```

---

# Abertura de conta escrow PF

URL: /en/documentation/contas/abertura_de_conta_escrow/abertura_de_conta_escrow_pf

## Request

ENDPOINT /escrow
MÉTODO POST

**Request Body**

```json
{
  "account_owner": {
        "person_type": "natural",
        "name": "Patrícia Tereza Bernardes",
        "mother_name": "Maria Mariane",
        "birth_date": "1990-05-06",
        "nationality": "nationality",
        "is_pep": false,
        "individual_document_number": "34651104630",
        "document_identification": "3c24579b-9810-4fa6-9b08-fe67d237160a",
        "email": "api@qitech.com.br",
        "address": {
            "street": "Av. Brigadeiro Faria Lima",
            "state": "SP",
            "city": "São Paulo",
            "neighborhood": "Jardim Paulistano",
            "number": "2391",
            "postal_code": "01452905",
            "complement": "1o. Andar"
        },
        "phone": {
            "country_code": "055",
            "area_code": "11",
            "number": "999999999"
        },
        "proof_of_residence": "780456bd-1eec-4e5f-82c0-d8c3921497ea"
    },
  "destination_list": [
        {
            "account_branch": "0001",
            "account_digit": "4",
            "account_number": "15570",
            "document_number": "34651104630",
            "financial_institutions_code_number": "329",
            "name": "Patrícia Tereza Bernardes",
            "ted_account_type": "deposit_account"
        }
    ],
  "signed_contract": {
        "document_key": "4d7f4e29-4b58-4905-9a69-b1f9215263f5",
        "signatures": [
            {
                "authenticity": {
                    "timestamp": "1970-01-01T00:00:01.080100Z",
                    "facial_recognition_key": "79003de0-2590-455d-9b73-426b8ca284eb",
                    "lang": "-35.8916627",
                    "lat": "-7.2226067",
                    "ip_address": "177.51.1.000",
                    "session_id": "jdifj329842"
                },
                "signer": {
                    "name": "IVANILDO DE SENA LIMA",
                    "email": "teste@gmail.com",
                    "phone": {
                        "country_code": "055",
                        "area_code": "11",
                        "number": "999999999"
                    },
                    "document_number": "99999999999"
                },
                "authentication_type": "opt-in"
            }
        ]
    }
}
```

### Body Params

| Campo |Tipo | Descrição | Caracteres |
|---|---| ---|---|
| `account_owner` * | object  | Objeto Dono da conta |**[Objeto account_owner](#objeto-account_owner)**  | 
| `destination_list` | object  | lista de contas de destino, que são aquelas para onde é permitida a transferência de recursos. | **[Objeto destination_list](#objeto-destination_list)**  |
| `signed_contract` *| object | Objeto contento as informações da assinatura do contrato. | **[Objeto signed_contract](#objeto-signed_contract)** |

### Objeto account_owner

| Campo | Tipo | Descrição | Caracteres |
|---| ---| ---| ---| 
| `address` | string | Endereço do cliente. | **[Objeto adress](#objeto-address)** |  |
| `birth_date` * | string |  Data de nascimento da pessoa (formato "AAAA-MM-DD") |  |
| `document_identification` * | string |  DOCUMENT_KEY do PDF do documento de identificação da pessoa com foto (RG ou CNH) (enviado previamente) |  |
| `email` * | string |  Email do cliente. |  |
| `individual_document_number` | string | CPF da pessoa (apenas números). Limitado a 11 caracteres. |  |
| `is_pep` * | string |  Declaração se a pessoa é PEP (http://www.portaldatransparencia.gov.br/download-de-dados/pep).|  |
| `mother_name` * | string |  Nome da mãe do cliente em caso de PF. | 100 |
| `name` * | string |  Razão social em caso de operações PJ ou Nome da pessoa em caso de operações PF. | 100 |
| `nationality` * | string |  Nacionalidade do cliente. | 50 |
| `person_type` * | string | Identificador de que o objeto enviado é uma pessoa física ou jurídica.|  |
| `phone` | string | Objeto com dados do telefone | **[Objeto phone](#objeto-phone)**|
| `proof_of_residence` | string |  DOCUMENT_KEY do PDF do comprovante de endereço do endereço enviado (enviado previamente).| |

### Objeto address 

Este objeto, presente tanto no objeto PF quanto no objeto PJ, é um simples objeto para representar um endereço.

| Campo | Descrição | Exemplo |  Máx. Caracteres | 
|---|---|---|---| 
| `street` *| string | Rua do endereço  | 100 |
| `state` *| string | Estado do endereço (com dois caracteres maiúsculos) | 2 |
| `city` *| string | Cidade do endereço | 100 |
| `neighborhood` *| string |Bairro do endereço | 100 |
| `number` *| string | Número da rua | 10 |
| `postal_code` *| string |CEP do endereço (http://www.buscacep.correios.com.br/sistemas/buscacep/) (apenas números) |  8 |
| `complement` *| string |Complemento do endereço (texto livre) | 100 |

### Objeto signed_contract 
| Campo | Tipo   | Descrição        | Caracteres    |
|-------|--------|------------------|---------------|
| **document_key** * | uuidv4 | Chave única de identificação do documento do **Termo de Abertura de Conta** ou **Contrato de Conta Escrow**. (A DOCUMENT_KEY é retornada na resposta do endpoint de [Upload de documentos](./upload_de_documentos)) | 36            |
| **signatures** *   | list   | Dados de assinatura do documento enviado. Cada item da lista, corresponde a um assinante do documento.      | [Objeto signatures](#objeto-signatures) |

### Objeto signatures
| Campo | Tipo       | Descrição         | Caracteres        |
|-------|------------|-------------------|-------------------|
| **authenticity** * | object     | Conjunto de dados que evidenciam a assinatura eletrônica realizada pelo assinante. | [Objeto authenticity](#objeto-authenticity) |
| **signer** * | object     | Objeto contendo os dados de um dos assinantes do documento.           | [Objeto signer](#objeto-signer)|
| **authentication_type** * | enumerator | Tipo de assinatura. Sempre será "**opt-in**"| "**opt-in**"                   |

### Objeto authenticity
| Campo | Tipo   | Descrição               | Caracteres |
|-------|--------|-------------------------|------------|
| **timestamp** *            | string | Data e hora do momento da assinatura do documento.                | 27         |
| **facial_recognition_key** | uuidv4 | Chave única de identificação da foto da selfie do titular da conta. (A DOCUMENT_KEY é retornada na resposta do endpoint de [Upload de documentos](./upload_de_documentos)) | 36         |
| **lang**                   | string | Coordenada de longitude da geolocalização do assinante capturada no momento da assinatura.                  | -          |
| **lat**                    | string | Coordenada de latitude da geolocalização do assinante capturada no momento da assinatura.                   | -          |
| **ip_address**             | string | Endereço IP do dispositivo do assinante.     | -          |
| **session_id**             | string | ID da seção do assinante no momento da assinatura.                | -          |

### Objeto signer
| Campo                 | Tipo   | Descrição                                 | Caracteres                        |
|-----------------------|--------|-------------------------------------------|-----------------------------------|
| **name** *            | string | Nome do assinante.                        | -                                 |
| **email** *           | string | Email do assinante.                       | -                                 |
| **phone** *           | object | Objeto com dados do telefone do assinante | **[Objeto phone](#objeto-phone)** |
| **document_number** * | string | CPF do assinante.                         | 11                                |

### Objeto phone 

| Campo | Descrição | Exemplo |  Máx. Caracteres | 
| --- | --- | --- | --- | 
|`country_code` *| string | Código DDI do telefone (https://ddi.guiamais.com.br/) | 3 | 
| `area_code` *| string | Código DDD do telefone (https://ddd.guiamais.com.br/) | 2 |
| `number` *| string |Número de telefone (apenas números) |  10 |

### Objeto phone 

| Campo | Descrição | Exemplo |  Máx. Caracteres | 
| --- | --- | --- | --- | 
|`country_code` *| string | Código DDI do telefone (https://ddi.guiamais.com.br/) | 3 | 
| `area_code` *| string | Código DDD do telefone (https://ddd.guiamais.com.br/) | 2 |
| `number` *| string |Número de telefone (apenas números) |  10 |

### Objeto destination_list 

| Campo | Descrição | Exemplo |  Máx. Caracteres | 
| --- | --- | --- | --- | 
|`account_branch` *| string | Código DDI do telefone (https://ddi.guiamais.com.br/) | 3 | 
| `account_digit` *| string | Código DDD do telefone (https://ddd.guiamais.com.br/) | 2 |
| `account_number` *| string |Número de telefone (apenas números) |  10 |
| `document_number` *| string |Número de telefone (apenas números) |  10 |
| `financial_institutions_code_number` *| string |Código COMPE da instituição financeira (https://www.bcb.gov.br/pom/spb/estatistica/port/ASTR003.pdf) (com 3 dígitos). |  3 |
| `name` *| string |Nome da pessoa física ou razão social da pessoa jurídica. |  10 |
| `ted_account_type` *| enum |Tipo da conta de destino. |  **[Enumeradores](#enumeradores-ted_account_type)** |

### Enumeradores ted_account_type

| Enumerador | Tradução |
|---|---|
|  checking_account  | conta corrente |
|  deposit_account  |  conta depósito  |
|  guaranteed_account  |  conta de garantia  |
|  investment_account  |  conta de investimento |
|  payment_account  | conta de pagamento |
|  saving_account  | conta poupança  |

## Response

STATUS 200

**Response Body**

```json
{
  "data": {
    "account_info": {
      "account_branch": "0001",
      "account_digit": "3",
      "account_number": "66777",
      "financial_institution_code": "329"
    },
    "account_manager": {
      "company_representatives": [
        {
          "document_number": "08141163701",
          "name": "Aurora Simone Catarina Nogueira"
        }
      ],
      "document_number": "09456933000162",
      "name": "Kaique e Giovanna Contábil ME"
    },
    "account_owner": {
      "company_representatives": [
        {
          "document_number": "38689533370",
          "name": "Priscila Rayssa Barros"
        },
        {
          "document_number": "85324558400",
          "name": "Caio Bruno Dias"
        }
      ],
      "document_number": "98916615000167",
      "name": "Alice e Isis Advocacia ME"
    },
    "allowed_transfer_account_list": [
      {
        "account_branch": "0001",
        "account_digit": "2",
        "account_number": "532312",
        "document_number": "49067117153",
        "financial_institution": {
          "code": 341,
          "ispb": 60701190,
          "name": "Itaú Unibanco  S.A."
        },
        "name": "Juan Anthony Farias"
      },
      {
        "account_branch": "0002",
        "account_digit": "9",
        "account_number": "537612",
        "document_number": "39063217000123",
        "financial_institution": {
          "code": 33,
          "ispb": 90400888,
          "name": "Banco Santander (Brasil) S. A."
        },
        "name": "Farias Advogados"
      }
    ],
    "allowed_user": {
      "document_number": "13708610440",
      "name": "Renato Noah Pinto"
    }
  },
  "event_datetime": "2019-11-07 18:15:07",
  "key": "61341599-790b-4236-b42f-060634eba88f",
  "status": "waiting_administrator_approval",
  "webhook_type": "escrow"
}
```

STATUS 400

**Response Body**

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

```

---

# Abertura de conta escrow PJ

URL: /en/documentation/contas/abertura_de_conta_escrow/abertura_de_conta_escrow_pj

## Request

ENDPOINT /escrow
METHOD POST

**Request Body**

```json
{
    "account_manager": {
        "address": {
            "city": "São Paulo",
            "complement": "",
            "neighborhood": "Vila Madalena",
            "number": "40",
            "postal_code": "05435030",
            "state": "SP",
            "street": "Rua das batatas"
        },
        "cnae_code": "6619-3/99",
        "company_document_number": "99999999000188",
        "company_representatives": [
            {
                "address": {
                    "city": "São Paulo",
                    "complement": "",
                    "neighborhood": "Vila Madalena",
                    "number": "40",
                    "postal_code": "05435030",
                    "state": "SP",
                    "street": "Rua da Alegria"
                },
                "birth_date": "1982-12-30",
                "email": "teste@email.tech",
                "individual_document_number": "99999999999",
                "is_pep": false,
                "final_beneficiary": true,
                "mother_name": "Ana Perdigão",
                "name": "João Victor",
                "nationality": "Brasileira",
                "person_type": "natural",
                "phone": {
                    "area_code": "12",
                    "country_code": "055",
                    "number": "999999999"
                },
                "document_identification": "a28b9c7d-f0c3-4310-ac6d-61898d29b18d",
                "proof_of_residence": "a28b9c7d-f0c3-4310-ac6d-61898d29b18d"
            }
        ],
        "company_statute": "a28b9c7d-f0c3-4310-ac6d-61898d29b18d",
        "directors_election_minute": "a28b9c7d-f0c3-4310-ac6d-61898d29b18d",
        "email": "email@teste.tech",
        "foundation_date": "2021-10-05",
        "name": "TESTE TECH LTDA.",
        "person_type": "legal",
        "phone": {
            "area_code": "11",
            "country_code": "55",
            "number": "999999999"
        },
        "trading_name": "TESTE TECH LTDA."
    },
    "account_owner": {
        "address": {
            "city": "Caraguatatuba",
            "complement": "complemento",
            "neighborhood": "Jaraguazinho",
            "number": "924",
            "postal_code": "11675200",
            "state": "SP",
            "street": "Praça da Rua"
        },
        "cnae_code": "4721-1/02",
        "company_statute": "70448962-8f01-4835-b031-755514192641",
        "company_document_number": "49999999000130",
        "company_type": "ltda",
        "email": "email@yteste.com",
        "foundation_date": "2017-09-16",
        "name": "NOME DA EMPRESA",
        "person_type": "legal",
        "phone": {
            "area_code": "19",
            "country_code": "055",
            "number": "988888888"
        },
        "trading_name": "Pães e Doces",
        "company_representatives": [
            {
                "name": "Marco Ayo",
                "address": {
                    "city": "Recife",
                    "complement": null,
                    "neighborhood": "Fundão",
                    "number": "137",
                    "postal_code": "522222220",
                    "state": "PE",
                    "street": "Rua dos Camaroes"
                },
                "email": "marcos.teste@teste.com",
                "birth_date": "1972-02-02",
                "individual_document_number": "55555555555",
                "document_identification": "70448962-8454-4835-b031-755514192641",
                "document_identification_number": "999999999",
                "is_pep": false,
                "final_beneficiary": true,
                "marital_status": "single",
                "mother_name": "Sueli da Mata",
                "nationality": "Brasileira",
                "person_type": "natural",
                "phone": {
                    "area_code": "88",
                    "country_code": "055",
                    "number": "999999999"
                }
            }
        ]
    },
    "destination_list": [
        {
            "account_branch": "0001",
            "account_digit": "2",
            "account_number": "123321",
            "document_number": "99999999999",
            "financial_institutions_code_number": "341",
            "name": "Conta Destino Teste SA."
        }
    ],
    "allowed_user": {
        "email": "teste@email.com",
        "individual_document_number": "99999999999",
        "name": "Luiz Alberto ",
        "person_type": "natural",
        "phone": {
            "country_code": "055",
            "area_code": "12",
            "number": "999999999"
        }
    },
    "signed_contract": {
        "document_key": "4d7f4e29-4b58-4905-9a69-b1f9215263f5",
        "signatures": [
            {
                "authenticity": {
                    "timestamp": "1970-01-01T00:00:01.080100Z",
                    "facial_recognition_key": "79003de0-2590-455d-9b73-426b8ca284eb",
                    "lang": "-35.8916627",
                    "lat": "-7.2226067",
                    "ip_address": "177.51.1.000",
                    "session_id": "jdifj329842"
                },
                "signer": {
                    "name": "IVANILDO DE SENA LIMA",
                    "email": "teste@gmail.com",
                    "phone": {
                        "country_code": "055",
                        "area_code": "11",
                        "number": "999999999"
                    },
                    "document_number": "99999999999"
                },
                "authentication_type": "opt-in"
            }
        ]
    }
}

```

### BODY PARAMS

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `account_manager` * | object | Objeto que possui pessoa responsável pelas movimentações da conta. | **[Object adress](#object-address)** |  
| `account_owner` * |  object | Objeto Dono da conta. | **[Object account_owner](#object-account_owner)** |  
| `allowed_user` * | object | Objeto que possui pessoa que terá acesso à conta para consultas. | **[Object allowed_user](#object-allowed_user)** |  
| `destination_list` * |  object | Lista de contas de destino, que são aquelas para onde é permitida a transferência de recursos. | **[Object destination_list](#object-destination_list)** |  
| `signed_contract` *| object | Objeto contento as informações da assinatura do contrato. | **[Object signed_contract](#object-signed_contract)** |

### Object account_manager

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `address` *| object | Endereço do cliente. |  **[Object address](#object-address)** |  
| `cnae_code` * |  string | Classificação Nacional de Atividades Econômicas | 14 |
| `company_document_number` | object | CNPJ  | 14|  
| `company_statute` *| string | DOCUMENT_KEY do PDF do estatuto da empresa (enviado previamente). | chave uuid | 
| `directors_election_minute` *| string | DOCUMENT_KEY do PDF da Ata de Representantes Legais da empresa (enviado previamente). | chave uuid | 
| `email`  *| string | Email institucional da empresa. |  | 
| `foundation_date`  *| date |  Data de abertura da empresa (formato "AAAA-MM-DD"). |  
| `name`  *| string |  Razão social. |  | 
| `person_type`  *| string |  Identificador de que o objeto enviado é uma pessoa jurídica. Deve conter SEMPRE o valor "legal" para Objeto PJ. | 
| `phone` | string | Objeto com dados do telefone | **[Object phone](#object-phone)**||
| `trading_name`  *| string |  Nome fantasia da empresa | |

### Object company_representatives

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---| 
| `person_type` * | string |Identificador de que o objeto enviado é uma pessoa física. Deve conter SEMPRE o valor "natural" para Objeto PF.| 11 |
| `name` * |string | Razão social em caso de operações PJ ou Nome da pessoa em caso de operações PF. Limitado a 100 caracteres.| 11 |
| `mother_name` * |  string |Nome da mãe da pessoa.| 11 |
| `birth_date` * | string | Data de nascimento da pessoa (formato "AAAA-MM-DD") | 11 |
| `nationality` * | string | Nacionalidade do cliente. Limitado a 50 caracteres.| 11 |
| `is_pep` * | string | Declaração se a pessoa é PEP (http://www.portaldatransparencia.gov.br/download-de-dados/pep).| 11 |
| `final_beneficiary` | boolean | Declaration if the person is the final beneficiary of the company. | - |
| `individual_document_number` |  string | CPF da pessoa (apenas números). | 11 |
| `document_identification` * | string | DOCUMENT_KEY do PDF do documento de identificação da pessoa com foto (RG ou CNH) (enviado previamente) |  UUUUID |
| `proof_of_residence` * | UUUUID | DOCUMENT_KEY do PDF do comprovante de residência (enviado previamente) | UUUUID |
| `email` * | string | Email da pessoa. | 11 |
| `address` | string |  Objeto endereço da pessoa. | 11 |

### Object address 

Este objeto, presente tanto no objeto PF quanto no objeto PJ, é um simples objeto para representar um endereço.

| Campo | Descrição | Exemplo |  Máx. Caracteres | 
|---|---|---|---| 
| `street` *| string | Rua do endereço  | 10 |
| `state` *| string | Estado do endereço (com dois caracteres maiúsculos) | 2 |
| `city` *| string | Cidade do endereço | 10 |
| `neighborhood` *| string |Bairro do endereço | 10 |
| `number` *| string | Número da rua | 10 |
| `postal_code` *| string |CEP do endereço (http://www.buscacep.correios.com.br/sistemas/buscacep/) (apenas números) | 8 |
| `complement` *| string |Complemento do endereço (texto livre) | 100 |

### Object account_owner

| Campo| Tipo   | Descrição | Caracteres  |
|------|--------|-----------|-------------|
| `address`*                 | object | Objeto endereço do titular da conta   | **[Object address](#object-address)**         |
| `cnae_code` *               | string | Classificação Nacional de Atividades Econômicas | 9 |
| `company_document_number` * | string | CNPJ      | 14|
| `company_statute` *         | string | DOCUMENT_KEY do PDF do estatuto da empresa (enviado previamente).       | 36|
| `company_type`              | enum   | Tipo da empresa         | **[Enumeradores company_type](#enumeradores-company_type)** |
| `company_representatives` * | list   | Lista dos representantes legais da empresa      | **[Object company_representatives](#object-company_representatives)** |
| `email` *         | string | Email institucional da empresa.   | 254         |
| `foundation_date` *         | string | Data de abertura da empresa (formato "AAAA-MM-DD").       | 10|
| `name` *| string | Razão social. | 100         |
| `person_type` *   | enum   | Identificador de que o objeto enviado é uma pessoa jurídica. Deve conter SEMPRE o valor "legal" para Objeto PJ.| **[Enumeradores person_type](#enumeradores-person_type)**  |
| `phone` *         | object | Telefone do titular da conta.     | **[Object phone](#object-phone)**   | - |
| `trading_name` *  | string | Nome fantasia.                    | 200                   |

### Object allowed_user

| Campo | Descrição | Exemplo |  Máx. Caracteres | 
|---|---|---|---|
| `email` * | string | Email do usuário da conta. | 10 | 
| `individual_document_number` * | string | CPF do usuário da conta (apenas números). | 10 | 
| `name` * | string | Nome do usuário da conta. | 10 | 
| `person_type` * | string | Identificador de que o objeto enviado é uma pessoa física. Deve conter SEMPRE o valor "natural". | 10 | 
| `phone` | string | Objeto telefone do usuário. | **[Object phone](#object-phone)** | 

### Object destination_list

| Campo | Descrição | Exemplo |  Máx. Caracteres | 
| --- | --- | --- | --- |  
| `account_branch` * | string | Número da agência. | 3 |
| `account_digit` * | string | Dígito verificador da conta (obrigatório caso haja). | 3 |
| `account_number` * | string | Número da conta. | 3 |
| `document_number` * | string | CPF ou CNPJ da pessoa (apenas números). | 3 |
| `financial_institutions_code_number` * | string | Código COMPE da instituição financeira (https://www.bcb.gov.br/pom/spb/estatistica/port/ASTR003.pdf)| 3 |
| `name` * | string | Nome da pessoa física ou razão social da pessoa jurídica. |  
| `ted_account_type` * | enum | Tipo da conta de destino. | **[Enumeradores](#enumeradores-ted_account_type)** |

### Object signed_contract 
| Campo | Tipo   | Descrição        | Caracteres    |
|-------|--------|------------------|---------------|
| **document_key** * | uuidv4 | Chave única de identificação do documento do **Termo de Abertura de Conta** ou **Contrato de Conta Escrow**. (A DOCUMENT_KEY é retornada na resposta do endpoint de [Upload de documentos](./upload_de_documentos)) | 36            |
| **signatures** *   | list   | Dados de assinatura do documento enviado. Cada item da lista, corresponde a um assinante do documento.      | [Objeto signatures](#object-signatures) |

### Object signatures
| Campo | Tipo       | Descrição         | Caracteres        |
|-------|------------|-------------------|-------------------|
| **authenticity** * | object     | Conjunto de dados que evidenciam a assinatura eletrônica realizada pelo assinante. | [Objeto authenticity](#object-authenticity) |
| **signer** * | object     | Objeto contendo os dados de um dos assinantes do documento.           | [Objeto signer](#object-signer)|
| **authentication_type** * | enumerator | Tipo de assinatura. Sempre será "**opt-in**"| "**opt-in**"                   |

### Object authenticity
| Campo | Tipo   | Descrição               | Caracteres |
|-------|--------|-------------------------|------------|
| **timestamp** *            | string | Data e hora do momento da assinatura do documento.                | 27         |
| **facial_recognition_key** | uuidv4 | Chave única de identificação da foto da selfie do titular da conta. (A DOCUMENT_KEY é retornada na resposta do endpoint de [Upload de documentos](./upload_de_documentos)) | 36         |
| **lang**                   | string | Coordenada de longitude da geolocalização do assinante capturada no momento da assinatura.                  | -          |
| **lat**                    | string | Coordenada de latitude da geolocalização do assinante capturada no momento da assinatura.                   | -          |
| **ip_address**             | string | Endereço IP do dispositivo do assinante.     | -          |
| **session_id**             | string | ID da seção do assinante no momento da assinatura.                | -          |

### Object signer
| Campo                 | Tipo   | Descrição                                 | Caracteres                        |
|-----------------------|--------|-------------------------------------------|-----------------------------------|
| **name** *            | string | Nome do assinante.                        | -                                 |
| **email** *           | string | Email do assinante.                       | -                                 |
| **phone** *           | object | Objeto com dados do telefone do assinante | **[Object phone](#object-phone)** |
| **document_number** * | string | CPF do assinante.                         | 11                                |

### Object phone 

| Campo | Descrição | Exemplo |  Máx. Caracteres | 
| --- | --- | --- | --- | 
|`country_code` *| string | Código DDI do telefone (https://ddi.guiamais.com.br/) | 3 | 
| `area_code` *| string | Código DDD do telefone (https://ddd.guiamais.com.br/) | 2 |
| `number` *| string |Número de telefone (apenas números) |  10 |

## Response

STATUS 200

**Response Body**

```json
{
  "data": {
    "account_info": {
      "account_branch": "0001",
      "account_digit": "3",
      "account_number": "66777",
      "financial_institution_code": "329"
    },
    "account_manager": {
      "company_representatives": [
        {
          "document_number": "08141163701",
          "name": "Aurora Simone Catarina Nogueira"
        }
      ],
      "document_number": "09456933000162",
      "name": "Kaique e Giovanna Contábil ME"
    },
    "account_owner": {
      "company_representatives": [
        {
          "document_number": "38689533370",
          "name": "Priscila Rayssa Barros"
        },
        {
          "document_number": "85324558400",
          "name": "Caio Bruno Dias"
        }
      ],
      "document_number": "98916615000167",
      "name": "Alice e Isis Advocacia ME"
    },
    "allowed_transfer_account_list": [
      {
        "account_branch": "0001",
        "account_digit": "2",
        "account_number": "532312",
        "document_number": "49067117153",
        "financial_institution": {
          "code": 341,
          "ispb": 60701190,
          "name": "Itaú Unibanco  S.A."
        },
        "name": "Juan Anthony Farias"
      },
      {
        "account_branch": "0002",
        "account_digit": "9",
        "account_number": "537612",
        "document_number": "39063217000123",
        "financial_institution": {
          "code": 33,
          "ispb": 90400888,
          "name": "Banco Santander (Brasil) S. A."
        },
        "name": "Farias Advogados"
      }
    ],
    "allowed_user": {
      "document_number": "13708610440",
      "name": "Renato Noah Pinto"
    }
  },
  "event_datetime": "2019-11-07 18:15:07",
  "key": "61341599-790b-4236-b42f-060634eba88f",
  "status": "waiting_administrator_approval",
  "webhook_type": "escrow"
}
```

STATUS 400

**Response Body**

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

```

---

# Introdução

URL: /en/documentation/contas/abertura_de_conta_escrow/introducao

As contas de livre movimentação são quaisquer contas bancárias cujo saldo pode ser sacado movimentado pelo cliente, no todo ou em parte.

Abertura de conta
Assim como a emissão de dívidas, a solicitação de abertura de conta é feita com uma única chamada (não esquecendo que os documentos devem ser previamente enviados).

Recebido esse pedido de conta a QI Tech é responsável por executar o compliance e abrir a conta. Na prática:

1 - Solicitação da abertura de conta (solicitado via request)

2 - Validação de compliance (informado resultado via webhook)

3 - Abertura da conta (informado resultado via webhook)

---

# Abertura de conta PF

URL: /en/documentation/contas/abertura_de_conta/abertura_de_conta_pf

## Request

ENDPOINT /account
METHOD POST

Request Body

```json
{
	"account_owner": {
		"address": {
			"street": "Av. Brigadeiro Faria Lima",
			"state": "SP",
			"city": "São Paulo",
			"neighborhood": "Jardim Paulistano",
			"number": "2391",
			"postal_code": "01452905",
			"complement": "1o. Andar"
		},
		"birth_date": "1990-05-06",
		"document_identification": "3c24579b-9810-4fa6-9b08-fe67d237160a",
		"email": "api@qitech.com.br",
		"individual_document_number": "34651104630",
		"is_pep": false,
		"mother_name": "Maria Mariane",
		"name": "Qi Tech Ltda.",
		"nationality": "nationality",
		"person_type": "natural",
		"phone": {
			"country_code": "055",
			"area_code": "11",
			"number": "999999999"
		},
		"proof_of_residence": "780456bd-1eec-4e5f-82c0-d8c3921497ea"
	},
	"signed_contract": {
        "document_key": "4d7f4e29-4b58-4905-9a69-b1f9215263f5",
        "signatures": [
            {
                "authenticity": {
                    "timestamp": "1970-01-01T00:00:01.080100Z",
                    "facial_recognition_key": "79003de0-2590-455d-9b73-426b8ca284eb",
                    "lang": "-35.8916627",
                    "lat": "-7.2226067",
                    "ip_address": "177.51.1.000",
                    "session_id": "jdifj329842"
                },
                "signer": {
                    "name": "IVANILDO DE SENA LIMA",
                    "email": "teste@gmail.com",
                    "phone": {
                        "country_code": "055",
                        "area_code": "11",
                        "number": "999999999"
                    },
                    "document_number": "99999999999"
                },
                "authentication_type": "opt-in"
            }
        ]
    }
}
```

:::info Copiando e Colando o Payload de exemplo
Antes de iniciar os testes, a document_key do campo document_identification deve ser substituida pela chave retornada no upload de documentos dos titulares da conta.
:::

:::info Mock de CPF/CNPJ
Para simular situações de aprovação, reprovação e analise manual pode ser utilizado o primeiro digito do CPF/CNPJ do owner da conta:

0 à 7 -> Análise Manual

8 -> Reprovação Automática

9 -> Aprovação Automática
:::

### BODY PARAMS

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---|---|
| `account_owner` | object  | Objeto Dono da conta |**[Object account_owner](#object-account_owner)**  |
| `signed_contract` *| object | Objeto contento as informações da assinatura do contrato. | **[Object signed_contract](#object-signed_contract)** |

### Object account_owner

| Campo | Tipo | Descrição | Caracteres |
|---| ---| ---| ---| 
| `address` | string | Endereço do cliente. | **[Object adress](#object-address)** |  |
| `birth_date` * | string |  Data de nascimento da pessoa (formato "AAAA-MM-DD") |  |
| `document_identification` * | string |  DOCUMENT_KEY do PDF do documento de identificação da pessoa com foto (RG ou CNH) (enviado previamente) |  |
| `document_identification_back` * | string |  DOCUMENT_KEY do PDF do verso documento de identificação da pessoa com foto (RG ou CNH) (enviado previamente) |  |
| `document_identification_type` * | string |  Tipo do documento enviado previamente (RG ou CNH) |  |
| `email` * | string |  Email do cliente. |  |
| `individual_document_number` | string | CPF da pessoa (apenas números). Limitado a 11 caracteres. |  |
| `is_pep` * | string |  Declaração se a pessoa é PEP (http://www.portaldatransparencia.gov.br/download-de-dados/pep).|  |
| `mother_name` * | string |  Nome da mãe do cliente em caso de PF. | 100 |
| `name` * | string |  Razão social em caso de operações PJ ou Nome da pessoa em caso de operações PF. | 100 |
| `nationality` * | string |  Nacionalidade do cliente. | 50 |
| `person_type` * | string | Identificador de que o objeto enviado é uma pessoa física ou jurídica.|  |
| `phone` | string | Objeto com dados do telefone | **[Object phone](#object-phone)**|
| `proof_of_residence` | string |  DOCUMENT_KEY do PDF do comprovante de endereço do endereço enviado (enviado previamente).| |

### Object address 

Este objeto, presente tanto no objeto PF quanto no objeto PJ, é um simples objeto para representar um endereço.

| Campo | Descrição | Exemplo |  Máx. Caracteres | 
|---|---|---|---| 
| `street` *| string | Rua do endereço  | 100 |
| `state` *| string | Estado do endereço (com dois caracteres maiúsculos) | 2 |
| `city` *| string | Cidade do endereço | 100 |
| `neighborhood` *| string |Bairro do endereço | 100 |
| `number` *| string | Número da rua | 10 |
| `postal_code` *| string |CEP do endereço (http://www.buscacep.correios.com.br/sistemas/buscacep/) (apenas números) |  8 |
| `complement` *| string |Complemento do endereço (texto livre) | 100 |

### Object signed_contract 
| Campo | Tipo   | Descrição        | Caracteres    |
|-------|--------|------------------|---------------|
| **document_key** * | uuidv4 | Chave única de identificação do documento do **Termo de Abertura de Conta** ou **Contrato de Conta Escrow**. (A DOCUMENT_KEY é retornada na resposta do endpoint de [Upload de documentos](./upload_de_documentos)) | 36            |
| **signatures** *   | list   | Dados de assinatura do documento enviado. Cada item da lista, corresponde a um assinante do documento.      | [Objeto signatures](#object-signatures) |

### Object signatures
| Campo | Tipo       | Descrição         | Caracteres        |
|-------|------------|-------------------|-------------------|
| **authenticity** * | object     | Conjunto de dados que evidenciam a assinatura eletrônica realizada pelo assinante. | [Objeto authenticity](#object-authenticity) |
| **signer** * | object     | Objeto contendo os dados de um dos assinantes do documento.           | [Objeto signer](#object-signer)|
| **authentication_type** * | enumerator | Tipo de assinatura. Sempre será "**opt-in**"| "**opt-in**"                   |

### Object authenticity
| Campo | Tipo   | Descrição               | Caracteres |
|-------|--------|-------------------------|------------|
| **timestamp** *            | string | Data e hora do momento da assinatura do documento.                | 27         |
| **facial_recognition_key** | uuidv4 | Chave única de identificação da foto da selfie do titular da conta. (A DOCUMENT_KEY é retornada na resposta do endpoint de [Upload de documentos](./upload_de_documentos)) | 36         |
| **lang**                   | string | Coordenada de longitude da geolocalização do assinante capturada no momento da assinatura.                  | -          |
| **lat**                    | string | Coordenada de latitude da geolocalização do assinante capturada no momento da assinatura.                   | -          |
| **ip_address**             | string | Endereço IP do dispositivo do assinante.     | -          |
| **session_id**             | string | ID da seção do assinante no momento da assinatura.                | -          |

### Object signer
| Campo                 | Tipo   | Descrição                                 | Caracteres                        |
|-----------------------|--------|-------------------------------------------|-----------------------------------|
| **name** *            | string | Nome do assinante.                        | -                                 |
| **email** *           | string | Email do assinante.                       | -                                 |
| **phone** *           | object | Objeto com dados do telefone do assinante | **[Object phone](#object-phone)** |
| **document_number** * | string | CPF do assinante.                         | 11                                |

### Object phone 

| Campo | Descrição | Exemplo |  Máx. Caracteres | 
| --- | --- | --- | --- | 
|`country_code` *| string | Código DDI do telefone (https://ddi.guiamais.com.br/) | 3 | 
| `area_code` *| string | Código DDD do telefone (https://ddd.guiamais.com.br/) | 2 |
| `number` *| string |Número de telefone (apenas números) |  10 |

## Response

STATUS 200

Response Body

```json
{
  "data": {
    "account_info": {
      "account_branch": "0001",
      "account_digit": "3",
      "account_number": "70091",
      "financial_institution_code": "329",
      "account_key": "7986dcc7-4331-478f-af47-adfbdf7f4a36"
    },
    "account_owner": {
      "document_number": "08141163701",
      "name": "Aurora Simone Catarina Nogueira"
    }
  },
  "event_datetime": "2019-11-04 16:34:41",
  "key": "f834af4d-ab4b-442f-96c9-f9940d8066d4",
  "status": "pending_kyc_analysis",
  "webhook_type": "account"
}
```

STATUS 400

Response Body

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

```

---

# Abertura de conta PJ

URL: /en/documentation/contas/abertura_de_conta/abertura_de_conta_pj

## Abertura de conta PJ com autenticação de dois fatores (2FA)

### Request

ENDPOINT /account
MÉTODO POST

Request Body

```json
{
	"account_owner": {
		"address": {
			"city": "Caraguatatuba",
			"complement": "complemento",
			"neighborhood": "Jaraguazinho",
			"number": "924",
			"postal_code": "11675200",
			"state": "SP",
			"street": "Praça Jorge Vitório de Souza"
		},
		"cnae_code": "4721-1/02",
		"company_statute": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d",
		"company_document_number": "46073462000130",
		"company_type": "ltda",
		"email": "marcos.alves@yopmail.com",
		"foundation_date": "2017-09-16",
		"name": "NOME DA EMPRESA",
		"person_type": "legal",
		"phone": {
			"area_code": "19",
			"country_code": "055",
			"number": "988888888"
		},
		"trading_name": "Pães e Doces",
		"company_representatives": [{
			"name": "Marcos Felipe Henrique Alves",
			"address": {
				"city": "Recife",
				"complement": null,
				"neighborhood": "Fundão",
				"number": "137",
				"postal_code": "52221110",
				"state": "PE",
				"street": "Rua Camapuã"
			},
			"email": "marcos.alves@yopmail.com",
			"birth_date": "1972-02-02",
			"individual_document_number": "08531309069",
			"document_identification": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d",
			"document_identification_number": "339122924",
			"is_pep": false,
			"final_beneficiary": true,
			"marital_status": "single",
			"mother_name": "Sueli Isadora Alves",
			"nationality": "Brasileira",
			"person_type": "natural",
			"phone": {
				"area_code": "88",
				"country_code": "055",
				"number": "995924634"
			}
		}]
	},
	"account_manager": {
		"address": {
			"city": "São Paulo",
			"complement": "s/c",
			"neighborhood": "Pinheiros",
			"number": "215",
			"postal_code": "05427000",
			"state": "SP",
			"street": "Rua Gilberto Sabino"
		},
		"cnae_code": "4721-1/02",
		"company_statute": "39e2bf16-26fc-4684-b4c0-97e46029e916",
		"company_document_number": "35082434000162",
		"company_type": "ltda",
		"email": "partneremail@partner.com",
		"foundation_date": "2018-09-16",
		"name": "Razão Social do Parceiro",
		"person_type": "legal",
		"phone": {
			"area_code": "11",
			"country_code": "055",
			"number": "987791122"
		},
		"trading_name": "Parceiro QI",
		"company_representatives": [{
			"name": "Nome do Socio da Empresa Parceira",
			"address": {
				"city": "São Paulo",
				"complement": null,
				"neighborhood": "Pinheiros",
				"number": "45",
				"postal_code": "04758001",
				"state": "SP",
				"street": "Rua do sócio"
			},
			"email": "nomesocio@partner.com",
			"birth_date": "1972-02-02",
			"individual_document_number": "34527070835",
			"document_identification": "ceca505b-b5ef-4e0b-ab62-a6e03d8d636a",
			"document_identification_number": "368335446",
            "document_identification_type": "rg",
			"is_pep": false,
			"final_beneficiary": true,
			"marital_status": "single",
			"mother_name": "Mãe do sócio",
			"nationality": "Brasileira",
			"person_type": "natural",
			"phone": {
				"area_code": "11",
				"country_code": "055",
				"number": "915185434"
			}
		}]
	},
	"allowed_user": {
		"email": "nomegerente@partner.com",
		"individual_document_number": "34651104630",
		"name": "Luiz Alberto Da Silva",
		"person_type": "natural",
		"phone": {
			"country_code": "055",
			"area_code": "11",
			"number": "991611135"
		}
	},
	"signed_contract": {
        "document_key": "4d7f4e29-4b58-4905-9a69-b1f9215263f5",
        "signatures": [
            {
                "authenticity": {
                    "timestamp": "1970-01-01T00:00:01.080100Z",
                    "facial_recognition_key": "79003de0-2590-455d-9b73-426b8ca284eb",
                    "lang": "-35.8916627",
                    "lat": "-7.2226067",
                    "ip_address": "177.51.1.000",
                    "session_id": "jdifj329842"
                },
                "signer": {
                    "name": "IVANILDO DE SENA LIMA",
                    "email": "teste@gmail.com",
                    "phone": {
                        "country_code": "055",
                        "area_code": "11",
                        "number": "999999999"
                    },
                    "document_number": "99999999999"
                },
                "authentication_type": "opt-in"
            }
        ]
    }
}
```

## Abertura de conta PJ

### Request

ENDPOINT /account
MÉTODO POST

Request Body

```json
{
	"account_owner": {
		"address": {
			"city": "Caraguatatuba",
			"complement": "complemento",
			"neighborhood": "Jaraguazinho",
			"number": "924",
			"postal_code": "11675200",
			"state": "SP",
			"street": "Praça Jorge Vitório de Souza"
		},
		"cnae_code": "4721-1/02",
		"company_statute": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d",
		"company_document_number": "46073462000130",
		"company_type": "ltda",
		"email": "marcos.alves@yopmail.com",
		"foundation_date": "2017-09-16",
		"name": "NOME DA EMPRESA",
		"person_type": "legal",
		"phone": {
			"area_code": "19",
			"country_code": "055",
			"number": "988888888"
		},
		"trading_name": "Pães e Doces",
		"company_representatives": [{
			"name": "Marcos Felipe Henrique Alves",
			"address": {
				"city": "Recife",
				"complement": null,
				"neighborhood": "Fundão",
				"number": "137",
				"postal_code": "52221110",
				"state": "PE",
				"street": "Rua Camapuã"
			},
			"email": "marcos.alves@yopmail.com",
			"birth_date": "1972-02-02",
			"individual_document_number": "08531309069",
			"document_identification": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d",
			"document_identification_number": "339122924",
			"is_pep": false,
			"final_beneficiary": true,
			"marital_status": "single",
			"mother_name": "Sueli Isadora Alves",
			"nationality": "Brasileira",
			"person_type": "natural",
			"phone": {
				"area_code": "88",
				"country_code": "055",
				"number": "995924634"
			}
		}]
	},
	"account_manager": {
		"address": {
			"city": "São Paulo",
			"complement": "s/c",
			"neighborhood": "Pinheiros",
			"number": "215",
			"postal_code": "05427000",
			"state": "SP",
			"street": "Rua Gilberto Sabino"
		},
		"cnae_code": "4721-1/02",
		"company_statute": "39e2bf16-26fc-4684-b4c0-97e46029e916",
		"company_document_number": "35082434000162",
		"company_type": "ltda",
		"email": "partneremail@partner.com",
		"foundation_date": "2018-09-16",
		"name": "Razão Social do Parceiro",
		"person_type": "legal",
		"phone": {
			"area_code": "11",
			"country_code": "055",
			"number": "987791122"
		},
		"trading_name": "Parceiro QI",
		"company_representatives": [{
			"name": "Nome do Socio da Empresa Parceira",
			"address": {
				"city": "São Paulo",
				"complement": null,
				"neighborhood": "Pinheiros",
				"number": "45",
				"postal_code": "04758001",
				"state": "SP",
				"street": "Rua do sócio"
			},
			"email": "nomesocio@partner.com",
			"birth_date": "1972-02-02",
			"individual_document_number": "34527070835",
			"document_identification": "ceca505b-b5ef-4e0b-ab62-a6e03d8d636a",
			"document_identification_number": "368335446",
            "document_identification_type": "rg",
			"is_pep": false,
			"final_beneficiary": true,
			"marital_status": "single",
			"mother_name": "Mãe do sócio",
			"nationality": "Brasileira",
			"person_type": "natural",
			"phone": {
				"area_code": "11",
				"country_code": "055",
				"number": "915185434"
			}
		}]
	},
	"allowed_user": {
        "email": "teste@email.com",
        "individual_document_number": "99999999999",
        "name": "Luiz Alberto ",
        "person_type": "natural",
        "phone": {
            "country_code": "055",
            "area_code": "12",
            "number": "999999999"
        }
    },
	"signed_contract": {
        "document_key": "4d7f4e29-4b58-4905-9a69-b1f9215263f5",
        "signatures": [
            {
                "authenticity": {
                    "timestamp": "1970-01-01T00:00:01.080100Z",
                    "facial_recognition_key": "79003de0-2590-455d-9b73-426b8ca284eb",
                    "lang": "-35.8916627",
                    "lat": "-7.2226067",
                    "ip_address": "177.51.1.000",
                    "session_id": "jdifj329842"
                },
                "signer": {
                    "name": "IVANILDO DE SENA LIMA",
                    "email": "teste@gmail.com",
                    "phone": {
                        "country_code": "055",
                        "area_code": "11",
                        "number": "999999999"
                    },
                    "document_number": "99999999999"
                },
                "authentication_type": "opt-in"
            }
        ]
    }
}
```

:::info Copiando e Colando o Payload de exemplo
Antes de iniciar os testes, as document_keys(UUIDs) dos campos company_statute e document_identification devem ser substituidas pelas chaves retornadas no upload de documentos dos titulares da conta.
:::

:::info Mock de CPF/CNPJ
Para simular situações de aprovação, reprovação e analise manual pode ser utilizado o primeiro digito do CPF/CNPJ do owner da conta:

0 à 7 -> Análise Manual

8 -> Reprovação Automática

9 -> Aprovação Automática
:::

### Response

STATUS 200

Response Body

```json
{
  "data": {
    "account_info": {
      "account_branch": "0001",
      "account_digit": "3",
      "account_number": "5283431",
      "financial_institution_code": "329"
    },
    "account_owner": {
      "document_number": "46073462000130",
      "name": "NOME DA EMPRESA"
    },
    "allowed_user": {
      "document_number": "34651104630",
      "name": "Luiz Alberto Da Silva"
    }
  },
  "event_datetime": "2023-05-05 14:48:32",
  "key": "5b5371ae-279c-4aa7-bc1c-776e01fea7cf",
  "status": "pending_kyc_analysis",
  "webhook_type": "account"
}
```

STATUS 400

Response Body

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

### Request Body Params

| Campo                 | Tipo   | Descrição                                                                    | Caracteres                                            |
|-----------------------|--------|------------------------------------------------------------------------------|-------------------------------------------------------|
| **account_owner** *   | object | Objeto Dono da conta                                                         | **[Objeto account_owner](#objeto-account_owner)**     |
| **allowed_user** *    | object | Usuário vinculado a conta.                                                   | **[Objeto allowed_user](#objeto-allowed_user)**       |
| **account_manager**   | object | Dados do parceiro integrador que realizará a movimentação da conta via API.  | **[Objeto account_manager](#objeto-account_manager)** |
| `signed_contract` *| object | Objeto contento as informações da assinatura do contrato. | **[Objeto signed_contract](#objeto-signed_contract)** |

### Objeto account_owner

| Campo                         | Tipo   | Descrição                                                                                                                         | Caracteres                                                            |
|-------------------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|
| **address** *                 | object | Objeto endereço do titular da conta                                                                                               | **[Objeto address](#objeto-address)**                                 |
| **cnae_code** *               | string | Classificação Nacional de Atividades Econômicas                                                                                   | 9                                                                     |
| **company_document_number** * | string | CNPJ                                                                                                                              | 14                                                                    |
| **company_statute** *         | string | DOCUMENT_KEY do PDF do estatuto da empresa (enviado previamente).                                                                 | 36                                                                    |
| **company_type**              | enum   | Tipo da empresa                                                                                                                   | **[Enumeradores company_type](#enumeradores-company_type)**           |
| **company_representatives** * | list   | Lista dos representantes legais da empresa                                                                                        | **[Objeto company_representatives](#objeto-company_representatives)** |
| **email** *                   | string | Email institucional da empresa.                                                                                                   | 254                                                                   |
| **foundation_date** *         | string | Data de abertura da empresa (formato "AAAA-MM-DD").                                                                               | 10                                                                    |
| **name** *                    | string | Razão social.                                                                                                                     | 100                                                                   |
| **person_type** *             | enum   | Identificador de que o objeto enviado é uma pessoa jurídica. Deve conter SEMPRE o valor "legal" para Objeto PJ.                   | **[Enumeradores person_type](#enumeradores-person_type)**             |
| **phone** *                   | object | Telefone do titular da conta.                                                                                                     | **[Objeto phone](#objeto-phone)**                                     | - |
| **trading_name** *            | string | Nome fantasia.                                                                                                                    | 200                                                                   |

### Objeto allowed_user

| Campo                            | Tipo   | Descrição                                                                                        | Caracteres                                                 |
|----------------------------------|--------|--------------------------------------------------------------------------------------------------|------------------------------------------------------------|
| **email** *                      | string | Email do usuário da conta.                                                                       | 254                                                        |
| **individual_document_number** * | string | CPF do usuário da conta (apenas números).                                                        | 11                                                         |
| **name** *                       | string | Nome do usuário da conta.                                                                        | 100                                                        |
| **person_type** *                | enum   | Identificador de que o objeto enviado é uma pessoa física. Deve conter SEMPRE o valor "natural". | **[Enumeradores person_type](#enumeradores-person_type)**  |
| **phone**                        | object | Telefone do usuário.                                                                             | **[Objeto phone](#objeto-phone)**                          |

### Objeto account_manager

| Campo                         | Tipo   | Descrição                                                                                                                         | Caracteres                                                             |
|-------------------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------|
| **address** *                 | object | Objeto endereço do parceiro integrador                                                                                            | **[Objeto address](#objeto-address)**                                  |
| **cnae_code** *               | string | Classificação Nacional de Atividades Econômicas                                                                                   | 9                                                                      |
| **company_document_number** * | string | CNPJ                                                                                                                              | 14                                                                     |
| **company_statute** *         | string | DOCUMENT_KEY do PDF do estatuto da empresa (enviado previamente).                                                                 | 36                                                                     |
| **company_type**              | enum   | Tipo da empresa                                                                                                                   | **[Enumeradores company_type](#enumeradores-company_type)**            |
| **company_representatives** * | list   | Lista dos representantes legais da empresa                                                                                        | **[Objeto company_representatives](#objeto-company_representatives)**  |
| **email** *                   | string | Email institucional da empresa.                                                                                                   | 254                                                                    |
| **foundation_date** *         | string | Data de abertura da empresa (formato "AAAA-MM-DD").                                                                               | 10                                                                     |
| **name** *                    | string | Razão social.                                                                                                                     | 100                                                                    |
| **person_type** *             | enum   | Identificador de que o objeto enviado é uma pessoa jurídica. Deve conter SEMPRE o valor "legal" para Objeto PJ.                   | **[Enumeradores person_type](#enumeradores-person_type)**              |
| **phone** *                   | object | Telefone do parceiro integrador.                                                                                                  | **[Objeto phone](#objeto-phone)**                                      |
| **trading_name** *            | string | Nome fantasia.                                                                                                                    | 200                                                                    |

### Objeto company_representatives

| Campo                              | Tipo    | Descrição                                                                                              | Caracteres                                                                              |
|------------------------------------|---------|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
| **name** *                         | string  | Nome do representante da empresa                                                                       | 100                                                                                     |
| **address** *                      | object  | Objeto endereço do representante da empresa                                                            | **[Objeto address](#objeto-address)**                                                   |
| **email** *                        | string  | Email do representante da empresa                                                                      | 254                                                                                     |
| **birth_date** *                   | string  | Data de nascimento representante da empresa (formato "AAAA-MM-DD")                                     | 10                                                                                      |
| **individual_document_number** *   | string  | CPF do representante da empresa (apenas números).                                                      | 11                                                                                      |
| **document_identification**        | string  | DOCUMENT_KEY do PDF do documento de identificação da pessoa com foto (RG ou CNH) (enviado previamente) | 36                                                                                      |
| **document_identification_number** | string  | Número do documento de identificação com foto da pessoa (RG ou CNH)                                    | 16                                                                                      |
| **is_pep** *                       | boolean | Declaração se a pessoa é PEP (http://www.portaldatransparencia.gov.br/download-de-dados/pep).          | -                                                                                       |
| **final_beneficiary**              | boolean | Declaração se o representante é beneficiário final da empresa.                                         | -                                                                                       |
| **marital_status**                 | enum    | Estado civil do representante da empresa                                                               | **[Enumeradores marital status](#enumeradores-marital_status)**                         |
| **mother_name** *                  | string  | Nome da mãe do representante da empresa                                                                | 100                                                                                     |
| **nationality**                    | string  | Nacionalidade do representante da empresa                                                              | 50                                                                                      |
| **person_type** *                  | enum    | Identificador de que o objeto enviado é uma pessoa física                                              | **[Enumeradores person_type](#enumeradores-person_type)**                               |
| **phone** *                        | object  | Objeto com dados do telefone do representante da empresa                                               | **[Objeto phone](#objeto-phone)**                                                       |

### Objeto address

Este objeto, presente tanto no objeto PF quanto no objeto PJ, é um simples objeto para representar um endereço.

| Campo              | Descrição | Exemplo                                                                                   | Caracteres |
|--------------------|-----------|-------------------------------------------------------------------------------------------|------------|
| **street** *       | string    | Rua do endereço                                                                           | 500        |
| **state** *        | enum      | Estado do endereço (com dois caracteres maiúsculos)                                       | 2          |
| **city** *         | string    | Cidade do endereço                                                                        | 255        |
| **neighborhood** * | string    | Bairro do endereço                                                                        | 500        |
| **number** *       | string    | Número da rua                                                                             | 10         |
| **postal_code** *  | string    | CEP do endereço (http://www.buscacep.correios.com.br/sistemas/buscacep/) (apenas números) | 8          |
| **complement**     | string    | Complemento do endereço (texto livre)                                                     | 500        |

### Objeto signed_contract 
| Campo | Tipo   | Descrição        | Caracteres    |
|-------|--------|------------------|---------------|
| **document_key** * | uuidv4 | Chave única de identificação do documento do **Termo de Abertura de Conta** ou **Contrato de Conta Escrow**. (A DOCUMENT_KEY é retornada na resposta do endpoint de [Upload de documentos](./upload_de_documentos)) | 36            |
| **signatures** *   | list   | Dados de assinatura do documento enviado. Cada item da lista, corresponde a um assinante do documento.      | [Objeto signatures](#objeto-signatures) |

### Objeto signatures
| Campo | Tipo       | Descrição         | Caracteres        |
|-------|------------|-------------------|-------------------|
| **authenticity** * | object     | Conjunto de dados que evidenciam a assinatura eletrônica realizada pelo assinante. | [Objeto authenticity](#objeto-authenticity) |
| **signer** * | object     | Objeto contendo os dados de um dos assinantes do documento.           | [Objeto signer](#objeto-signer)|
| **authentication_type** * | enumerator | Tipo de assinatura. Sempre será "**opt-in**"| "**opt-in**"                   |

### Objeto authenticity
| Campo | Tipo   | Descrição               | Caracteres |
|-------|--------|-------------------------|------------|
| **timestamp** *            | string | Data e hora do momento da assinatura do documento.                | 27         |
| **facial_recognition_key** | uuidv4 | Chave única de identificação da foto da selfie do titular da conta. (A DOCUMENT_KEY é retornada na resposta do endpoint de [Upload de documentos](./upload_de_documentos)) | 36         |
| **lang**                   | string | Coordenada de longitude da geolocalização do assinante capturada no momento da assinatura.                  | -          |
| **lat**                    | string | Coordenada de latitude da geolocalização do assinante capturada no momento da assinatura.                   | -          |
| **ip_address**             | string | Endereço IP do dispositivo do assinante.     | -          |
| **session_id**             | string | ID da seção do assinante no momento da assinatura.                | -          |

### Objeto signer
| Campo                 | Tipo   | Descrição                                 | Caracteres                        |
|-----------------------|--------|-------------------------------------------|-----------------------------------|
| **name** *            | string | Nome do assinante.                        | -                                 |
| **email** *           | string | Email do assinante.                       | -                                 |
| **phone** *           | object | Objeto com dados do telefone do assinante | **[Objeto phone](#objeto-phone)** |
| **document_number** * | string | CPF do assinante.                         | 11                                |

### Objeto phone 

| Campo | Descrição | Exemplo |  Máx. Caracteres | 
| --- | --- | --- | --- | 
|`country_code` *| string | Código DDI do telefone (https://ddi.guiamais.com.br/) | 3 | 
| `area_code` *| string | Código DDD do telefone (https://ddd.guiamais.com.br/) | 2 |
| `number` *| string |Número de telefone (apenas números) |  10 |

### Enumeradores person_type
| Enum        | Description       |
|-------------|-------------------|
| **natural** | Pessoa física     |
| **legal**   | Pessoa jurídica   |

### Enumeradores document_identification_type
| Enum    | Description                            |
|---------|----------------------------------------|
| **rg**  | RG - Registro Geral                    |
| **cnh** | CNH - Carteira Nacional de Habilitação |

### Enumeradores company_type
| Enum                       | 	Description                                                             |
|----------------------------|--------------------------------------------------------------------------|
| **ltda**                   | Limitada                                                                |
| **sa**	                    | Sociedade Anônima                                                        |
| **micro_enterprise**	      | Micro Empresa                                                            |
| **freelancer**             | Freelancer                                                              |
| **sa_opened**              | Sociedade Anônima de Capital Aberto                                     |
| **sa_closed**	             | Sociedade Anônima de Capital Fechado                                     |
| **se_ltda**                | Sociedade Empresária Limitada                                           |
| **se_cn**                  | Sociedade Empresária em Nome Coletivo                                   |
| **se_cs**                  | Sociedade Empresária em Comandita Simples                               |
| **se_ca**	                 | Sociedade Empresária em Comandita por Ações                              |
| **scp**                    | Sociedade em Conta de Participação                                      |
| **ei**	                    | Empresário Individual                                                    |
| **ese**	                   | Estabelecimento, no Brasil, de Sociedade Estrangeira                     |
| **eeab**	                  | Estabelecimento, no Brasil, de Empresa Binacional Argentino-Brasileira   |
| **ssp**                    | Sociedade Simples Pura                                                  |
| **ss_ltda**	               | Sociedade Simples Limitada                                               |
| **ss_cn**                  | Sociedade Simples em Nome Coletivo                                      |
| **ss_cs**                  | Sociedade Simples em Comandita Simples                                  |
| **eireli_ne**              | Empresa Individual de Responsabilidade Limitada (de Natureza Empresária) |
| **eireli_ns**              | Empresa Individual de Responsabilidade Limitada (de Natureza Simples)   |
| **eireli**                 | Empresa de Responsabilidade Individual                                  |
| **mei**                    | Micro Empreendedor Individual                                            |
| **me**	                    | Micro Empresa                                                            |
| **cop**	                   | Cooperativa                                                              |
| **private_association**	   | Sociedade Privada                                                        |

### Enumeradores marital_status
| Enum         | 	Description  |
|--------------|---------------|
| **single**   | Solteiro(a)   |
| **married**  | Casado(a)    |
| **widower**  | Viúvo(a)     |
| **divorced** | Divorciado(a) |
| **separated** | Separado(a) |

---

# Free Movement Account Draft - Legal Entity

URL: /en/documentation/contas/abertura_de_conta/draft_checking_legal_person

The Draft Checking Legal Person flow allows creating an account opening request in two steps:

1. **POST**: Creates a draft (rough) with **maximum flexibility** - accepts from minimal data to complete data
2. **PATCH**: Submits the draft for processing, **validating completeness** of all mandatory fields

**Important**: This flow is being prepared for integration with **Monte Bravo**. The field division between POST and PATCH will be adjusted after alignment with Monte Bravo on which data will be available at each moment of the process.

## Create Legal Entity Account Draft

### Request

ENDPOINT /v2/account_request/draft_checking_legal_person
METHOD POST

### Description

This endpoint creates a **draft** for Legal Entity account opening. The POST accepts **from minimal data to complete data**, offering maximum flexibility.

### Flexibility Strategy

- **Minimal data**: CNPJ + Name + Person type
- **Partial data**: Add fields as available
- **Complete data**: Send everything at once (less common)

### Example 1: MINIMAL Payload (only required)

Request Body

```json
{
  "account_owner": {
    "company_document_number": "46073462000130",
    "name": "EMPRESA EXEMPLO TECNOLOGIA LTDA",
    "person_type": "legal"
  }
}
```

```json
{
  "request_control_key": "3571e292-3a83-4011-904d-20ee963022ef",
  "account_owner": {
    "company_document_number": "46073462000130",
    "name": "EMPRESA EXEMPLO TECNOLOGIA LTDA",
    "person_type": "legal"
  }
}
```

**Behavior**: If the same `request_control_key` is used again, returns error 409 (Conflict) instead of creating a new draft.

### Example 2: COMPLETE Payload (all data at once)

Request Body

```json
{
  "account_owner": {
    "company_document_number": "46073462000130",
    "name": "EMPRESA EXEMPLO TECNOLOGIA LTDA",
    "person_type": "legal",
    "email": "empresa@exemplo.com.br",
    "phone": {
      "country_code": "055",
      "area_code": "11",
      "number": "999999999"
    },
    "trading_name": "Empresa Exemplo",
    "company_type": "LTDA",
    "foundation_date": "2010-01-15",
    "cnae_code": "6209-1/00",
    "company_statute": "92c93e9e-b249-46b7-8c2e-95d4955a3c39",
    "monthly_revenue": 150000.00,
    "address": {
      "street": "Av. Brigadeiro Faria Lima",
      "state": "SP",
      "city": "São Paulo",
      "neighborhood": "Jardim Paulistano",
      "number": "2391",
      "postal_code": "01452905",
      "complement": "Conjunto 102"
    },
    "company_representatives": [
      {
        "name": "João Carlos da Silva",
        "email": "joao.silva@exemplo.com.br",
        "birth_date": "1985-03-20",
        "individual_document_number": "12345678901",
        "is_pep": false,
        "final_beneficiary": true,
        "mother_name": "Maria da Silva",
        "nationality": "brasileira",
        "person_type": "natural",
        "phone": {
          "country_code": "055",
          "area_code": "11",
          "number": "988888888"
        },
        "address": {
          "street": "Rua das Flores",
          "state": "SP",
          "city": "São Paulo",
          "neighborhood": "Jardins",
          "number": "123",
          "postal_code": "01310100",
          "complement": "Apto 45"
        },
        "representative_relationship": "ceo",
        "gender": "male",
        "marital_status": "married",
        "documents": {
          "cnh": {
            "ocr_key": "7a73be1a-0b66-4c0a-932a-1d1d02efdc4c"
          }
        }
      }
    ]
  }
}
```

### Response

STATUS 201

Response Body

```json
{
  "account_request_key": "abc123-def456-...",
  "account_request_status": "draft",
  "account_info": {
    "account_number": "1638634",
    "account_digit": "3",
    "account_branch": "0001"
  }
}
```

:::warning Attention
The `account_request_key` field must be stored and will be used to submit the draft via PATCH.
:::

### Request Body Params

| Field                         | Type   | Description                                                                    | Characters                                                         |
|-------------------------------|--------|------------------------------------------------------------------------------|---------------------------------------------------------------------|
| `request_control_key`         | string | UUID to ensure idempotency (36 characters)                             | 36                                                                  |
| `reserved_account_key`        | string | UUID of previously reserved account (36 characters)                          | 36                                                                  |
| `account_owner` *             | object | Account holder information (Legal Entity)                           | **[Object account_owner](#object-account_owner-post)**            |

### Object account_owner (POST)

| Field | Type | Description | Characters |
|---|---|---|---|
| `company_document_number` * | string | Company CNPJ (14 digits, numbers only) | 14 |
| `name` * | string | Company legal name | 100 |
| `person_type` * | enum | Person type (always "legal") | **[Enums person_type](#enums-person_type)** |
| `email` | string | Company email (valid email format) | 254 |
| `phone` | object | Company phone | **[Object phone](#object-phone)** |
| `trading_name` | string | Trade name | 200 |
| `company_type` | enum | Company type | **[Enums company_type](#enums-company_type)** |
| `foundation_date` | string | Foundation date (format: YYYY-MM-DD) | 10 |
| `cnae_code` | string | CNAE activity code | 9 |
| `company_statute` | string | Company statute UUID (UUID format) | 36 |
| `monthly_revenue` | number | Monthly revenue | - |
| `address` | object | Complete company address | **[Object address](#object-address)** |
| `company_representatives` | array | List of legal representatives (minimum 1 item if sent) | **[Object company_representatives](#object-company_representatives)** |

:::info Required Fields in POST
Only 3 fields are required in POST:
- `company_document_number`
- `name`
- `person_type`

All other fields are optional and can be sent according to availability.
:::

:::warning Representative Validation
If `company_representatives` is sent in POST, it must have **at least 1 item** (`minItems: 1`). Each representative must have all required fields (see PATCH section). The `documents` field within each representative is **optional in POST**.
:::

---

## Submit Legal Entity Account Draft

### Request

ENDPOINT /v2/account_request/{account_request_key}/draft_checking_legal_person
METHOD PATCH

### Description

This endpoint **submits the draft** for processing. The PATCH **validates completeness** - all required fields must be present in the PATCH payload.

**⚠️ IMPORTANT**: The PATCH **completely overwrites** the `account_owner` data with the sent payload. This means that:
- You must send **ALL** required fields in the PATCH payload, even if they were already sent in POST
- Data sent only in POST will be **lost** if not resent in PATCH
- The behavior is **complete replacement**, not merge/partial update
- The `documents` field within each `company_representative` is **required** and must contain at least one valid document type (RG, CNH, RNE, CRNM, Passport or Digital CIN)

After successful submission, the status changes from `draft` to `pending_bacen_validation` and starts Bacen Protege+ validation.

### Request Body

Request Body

```json
{
  "account_owner": {
    "company_document_number": "46073462000130",
    "name": "EMPRESA EXEMPLO TECNOLOGIA LTDA",
    "person_type": "legal",
    "email": "empresa@exemplo.com.br",
    "phone": {
      "country_code": "055",
      "area_code": "11",
      "number": "999999999"
    },
    "trading_name": "Empresa Exemplo",
    "company_type": "LTDA",
    "foundation_date": "2010-01-15",
    "cnae_code": "6209-1/00",
    "company_statute": "92c93e9e-b249-46b7-8c2e-95d4955a3c39",
    "monthly_revenue": 150000.00,
    "address": {
      "street": "Av. Brigadeiro Faria Lima",
      "state": "SP",
      "city": "São Paulo",
      "neighborhood": "Jardim Paulistano",
      "number": "2391",
      "postal_code": "01452905",
      "complement": "Conjunto 102"
    },
    "company_representatives": [
      {
        "name": "João Carlos da Silva",
        "email": "joao.silva@exemplo.com.br",
        "birth_date": "1985-03-20",
        "individual_document_number": "12345678901",
        "is_pep": false,
        "final_beneficiary": true,
        "mother_name": "Maria da Silva",
        "nationality": "brasileira",
        "person_type": "natural",
        "phone": {
          "country_code": "055",
          "area_code": "11",
          "number": "988888888"
        },
        "address": {
          "street": "Rua das Flores",
          "state": "SP",
          "city": "São Paulo",
          "neighborhood": "Jardins",
          "number": "123",
          "postal_code": "01310100",
          "complement": "Apto 45"
        },
        "representative_relationship": "ceo",
        "gender": "male",
        "marital_status": "married",
        "documents": {
          "rg": {
            "ocr_front_key": "0aa8a4ca-5873-49bd-851c-1f2c71a1cc28",
            "ocr_back_key": "29f6e346-7fae-4dcb-9ea1-2a3e4ef593ea"
          },
          "cnh": {
            "ocr_key": "7479c8e4-2a5d-4b4d-b2eb-4b841ec9390d"
          }
        },
        "face": "68da08f1-6cf4-4dce-a297-7b2f09311784"
      }
    ]
  },
  "additional_documents": [
    "61f2a65e-0ddf-4932-874f-9231794963da"
  ]
}
```

### Response

STATUS 200

Response Body

```json
{
  "account_request_key": "abc123-def456-...",
  "account_request_status": "pending_bacen_validation",
  "account_info": {
    "account_number": "1638634",
    "account_digit": "3",
    "account_branch": "0001"
  }
}
```

:::info Bacen Protege+ Flow
After successful submission, the status changes to `pending_bacen_validation`. The system performs a preliminary validation with Bacen Protege+ before proceeding with KYC analysis. After Bacen approval, the status will be automatically updated to `pending_kyc_analysis`.
:::

### Request Body Params

| Field                 | Type   | Description                                                                    | Characters                                                         |
|-----------------------|--------|------------------------------------------------------------------------------|---------------------------------------------------------------------|
| `additional_documents` | array  | List of additional document UUIDs (array of UUIDs)                    | -                                                                   |
| `account_owner` *     | object | Complete account holder information (Legal Entity)                 | **[Object account_owner (PATCH)](#object-account_owner-patch)**    |

### Object account_owner (PATCH)

| Field | Type | Description | Characters |
|---|---|---|---|
| `company_document_number` * | string | CNPJ (14 digits, numbers only, pattern: `^[0-9]{14}$`) | 14 |
| `name` * | string | Legal name | 100 |
| `person_type` * | enum | Always `"legal"` | **[Enums person_type](#enums-person_type)** |
| `email` * | string | Company email (valid email format) | 254 |
| `phone` * | object | Company phone | **[Object phone](#object-phone)** |
| `trading_name` * | string | Trade name | 200 |
| `company_type` * | enum | Company type | **[Enums company_type](#enums-company_type)** |
| `foundation_date` * | string | Foundation date (format: YYYY-MM-DD) | 10 |
| `cnae_code` * | string | CNAE activity code | 9 |
| `company_statute` * | string | Company statute UUID (UUID format) | 36 |
| `monthly_revenue` * | number | Monthly revenue | - |
| `address` * | object | Complete company address | **[Object address](#object-address)** |
| `company_representatives` * | array | List of legal representatives (minimum 1 item required) | **[Object company_representatives](#object-company_representatives)** |

:::warning Required Fields in PATCH
**ALL** fields marked with `*` are required in PATCH. The JSON schema validates the completeness of all fields before processing the submission.
:::

### Object phone

| Field | Type | Description | Characters |
|---|---|---|---|
| `country_code` * | string | Country code (1-3 digits, pattern: `^[0-9]{1,3}$`) | 1-3 |
| `area_code` * | string | Area code (1-3 digits, pattern: `^[0-9]{1,3}$`) | 1-3 |
| `number` * | string | Phone number (1-10 digits, pattern: `^[0-9]{1,10}$`) | 1-10 |
| `type` | enum | Phone type (optional: `"residential"`, `"commercial"`, `"mobile"`, `"fax"`) | - |

### Object address

| Field | Type | Description | Characters |
|---|---|---|---|
| `street` * | string | Street/Address | 1-500 |
| `neighborhood` * | string | Neighborhood | 0-100 |
| `number` * | string | Number | 1-10 |
| `postal_code` * | string | ZIP code (8 digits, numbers only, pattern: `^\d{8}$`) | 8 |
| `city` * | string | City | 1-100 |
| `state` * | enum | State (2 uppercase characters) | **[Enums state](#enums-state)** |
| `complement` | string | Complement (optional, maximum 500 characters) | 0-500 |

### Object company_representatives

| Field | Type | Description | Characters |
|---|---|---|---|
| `name` * | string | Full name | 100 |
| `address` * | object | Complete address (same structure as company address) | **[Object address](#object-address)** |
| `email` * | string | Email (valid email format) | 5-200 |
| `birth_date` * | string | Birth date (format: YYYY-MM-DD, pattern: `\d{4}-((0[1-9])|(1[0-2]))-((0[1-9])|([1-2][0-9])|(3[0-1]))`) | 10 |
| `individual_document_number` * | string | CPF (11 digits, numbers only, pattern: `^[0-9]{11}$`) | 11 |
| `is_pep` * | boolean | If is Politically Exposed Person | - |
| `final_beneficiary` | boolean | Declaration if the person is the final beneficiary of the company. | - |
| `mother_name` * | string | Mother's name | 100 |
| `nationality` * | string | Nationality | 50 |
| `person_type` * | enum | Always `"natural"` | **[Enums person_type](#enums-person_type)** |
| `phone` * | object | Phone (same structure as company phone) | **[Object phone](#object-phone)** |
| `documents` * | object | Anti-fraud documents (required in PATCH) | **[Object documents](#object-documents)** |
| `face` | string | Facial photo UUID (36 characters) | 36 |
| `document_identification` | string | Identification document UUID (UUID format) | 36 |
| `document_identification_number` | string | Identification document number | 16 |
| `marital_status` | enum | Marital status | **[Enums marital_status](#enums-marital_status)** |
| `gender` | enum | Gender | **[Enums gender](#enums-gender)** |
| `representative_relationship` | enum | Relationship with company | **[Enums representative_relationship](#enums-representative_relationship)** |

### Object documents

| Field | Type | Description | Characters |
|---|---|---|---|
| `rg` | object | OCR keys for front and back of RG upload | **[Object rg](#object-rg)** |
| `cnh` | object | OCR key for CNH upload | **[Object cnh](#object-cnh)** |
| `cnh_digital` | object | OCR key for digital CNH upload | **[Object cnh_digital](#object-cnh_digital)** |
| `national_registry_of_foreigners` | object | OCR keys for front and back of RNE upload | **[Object national_registry_of_foreigners](#object-national_registry_of_foreigners)** |
| `national_migration_registry` | object | OCR keys for front and back of CRNM upload | **[Object national_migration_registry](#object-national_migration_registry)** |
| `passport` | object | OCR key for passport upload | **[Object passport](#object-passport)** |
| `cin_digital` | object | OCR key for digital National Identity Card upload | **[Object cin_digital](#object-cin_digital)** |

### Object rg

| Field | Type | Description | Characters |
|---|---|---|---|
| `ocr_front_key` * | uuidv4 | OCR key for front image upload of RG | 36 |
| `ocr_back_key` * | uuidv4 | OCR key for back image upload of RG | 36 |

OR

| Field | Type | Description | Characters |
|---|---|---|---|
| `ocr_key` * | uuidv4 | OCR key for RG image upload | 36 |

### Object cnh

| Field | Type | Description | Characters |
|---|---|---|---|
| `ocr_front_key` * | uuidv4 | OCR key for front image upload of CNH | 36 |
| `ocr_back_key` * | uuidv4 | OCR key for back image upload of CNH | 36 |

OR

| Field | Type | Description | Characters |
|---|---|---|---|
| `ocr_key` * | uuidv4 | OCR key for CNH image upload | 36 |

### Object cnh_digital

| Field | Type | Description | Characters |
|---|---|---|---|
| `ocr_key` * | uuidv4 | OCR key for digital CNH image upload | 36 |

### Object national_registry_of_foreigners

| Field | Type | Description | Characters |
|---|---|---|---|
| `ocr_front_key` * | uuidv4 | OCR key for front image upload of RNE | 36 |
| `ocr_back_key` * | uuidv4 | OCR key for back image upload of RNE | 36 |

OR

| Field | Type | Description | Characters |
|---|---|---|---|
| `ocr_key` * | uuidv4 | OCR key for RNE image upload | 36 |

### Object national_migration_registry

| Field | Type | Description | Characters |
|---|---|---|---|
| `ocr_front_key` * | uuidv4 | OCR key for front image upload of CRNM | 36 |
| `ocr_back_key` * | uuidv4 | OCR key for back image upload of CRNM | 36 |

OR

| Field | Type | Description | Characters |
|---|---|---|---|
| `ocr_key` * | uuidv4 | OCR key for CRNM image upload | 36 |

### Object passport

| Field | Type | Description | Characters |
|---|---|---|---|
| `ocr_key` * | uuidv4 | OCR key for passport image upload | 36 |

### Object cin_digital

| Field | Type | Description | Characters |
|---|---|---|---|
| `ocr_key` * | uuidv4 | OCR key for digital National Identity Card image upload | 36 |

:::info Information
The OCR keys (`ocr_key` or `ocr_front_key` and `ocr_back_key`) from document image uploads are provided as response from the image upload in anti-fraud. The `face_recognition_key` is returned in the facial recognition response.
:::

### Response Body Params

| Field | Type | Description | Characters |
|---|---|---|---|
| `account_request_key` * | string | Account creation request identification key | - |
| `account_request_status` * | string | Request status (changes to `pending_bacen_validation` after submission) | - |
| `account_info` * | object | Object containing account information | **[Object account_info](#object-account_info)** |

### Object account_info

| Field | Type | Description | Characters |
|---|---|---|---|
| `account_branch` * | string | Branch number | 4 |
| `account_digit` * | string | Account check digit | 1 |
| `account_number` * | string | Account number | - |

### Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code<br/>`status` | QI Code<br/>`code` | Title<br/>`title`  | Description (eng)<br/>`description` | Description(ptbr) <br></br>`translation`|
|---| --- | --- | --- | --- | 
| 400 | QIT000001 | Bad Request | Schema Error | Erro de Schema|
| 400 | - | Bad Request | Invalid request body | Corpo da requisição inválido |
| 404 | QIT000404 | Not Found | Resource could not be found | Recurso não encontrado|
| 409 | - | Conflict | Duplicate request_control_key | Chave de controle duplicada |

---

## Differences between POST and PATCH

| Aspect | POST (Create Draft) | PATCH (Submit Draft) |
|---------|-------------------|------------------------|
| **Objective** | Create draft with flexibility | Validate completeness and submit to Bacen |
| **Required Fields** | Only CNPJ + Name + Type | ALL fields + 1 complete representative **with documents** |
| **documents** | Optional per representative | **Required per representative** (object with OCR documents) |
| **Representatives** | Optional | Required (minimum 1) |
| **Validation** | Minimal (only 3 fields) | Complete (all required fields) |
| **Initial Status** | N/A | `draft` (must be in this status) |
| **Final Status** | `draft` | `pending_bacen_validation` |
| **Bacen Validation** | No | Yes |
| **KYC Analysis** | No | Yes (after Bacen) |
| **Idempotency** | Yes (via `request_control_key`) | No |

---

## Usage Scenarios

### Scenario 1: Client initially has only basic data
```
POST → {CNPJ, name, type}  [status: draft]
...client collects more data...
PATCH → {all fields + documents per representative} [status: pending_bacen_validation]
```

### Scenario 2: Client has all data at once
```
POST → {all fields}  [status: draft]
PATCH → {all fields} [status: pending_bacen_validation]
```

### Scenario 3: Client sends partial data gradually
```
POST → {CNPJ, name, type, email}  [status: draft]
...client collects more data...
PATCH → {all fields including representatives with documents} [status: pending_bacen_validation]
```
---

## Enums

### Enums person_type

| Enum | Description |
|------|-----------|
| `natural` | Natural person |
| `legal` | Legal entity |

### Enums company_type

| Enum | Description |
|------|-----------|
| `ltda` | Limited |
| `sa` | Corporation |
| `micro_enterprise` | Micro Enterprise |
| `freelancer` | Freelancer |
| `sa_opened` | Open Capital Corporation |
| `sa_closed` | Closed Capital Corporation |
| `se_ltda` | Limited Business Company |
| `se_cn` | General Partnership Business Company |
| `se_cs` | Limited Partnership Business Company |
| `se_ca` | Partnership Limited by Shares Business Company |
| `scp` | Partnership in Participation |
| `ei` | Individual Entrepreneur |
| `ese` | Establishment in Brazil of Foreign Company |
| `eeab` | Establishment in Brazil of Argentine-Brazilian Binational Company |
| `ssp` | Pure Simple Partnership |
| `ss_ltda` | Limited Simple Partnership |
| `ss_cn` | General Partnership Simple Partnership |
| `ss_cs` | Limited Partnership Simple Partnership |
| `eireli_ne` | Individual Limited Liability Company (Business Nature) |
| `eireli_ns` | Individual Limited Liability Company (Simple Nature) |
| `eireli` | Individual Liability Company |
| `mei` | Individual Micro Entrepreneur |
| `me` | Micro Enterprise |
| `cop` | Cooperative |
| `private_association` | Private Association |

### Enums state

| Enum | Description |
|------|-----------|
| `AC` | Acre |
| `AL` | Alagoas |
| `AM` | Amazonas |
| `AP` | Amapá |
| `BA` | Bahia |
| `CE` | Ceará |
| `DF` | Distrito Federal |
| `ES` | Espírito Santo |
| `GO` | Goiás |
| `MA` | Maranhão |
| `MG` | Minas Gerais |
| `MS` | Mato Grosso do Sul |
| `MT` | Mato Grosso |
| `PA` | Pará |
| `PB` | Paraíba |
| `PE` | Pernambuco |
| `PI` | Piauí |
| `PR` | Paraná |
| `RJ` | Rio de Janeiro |
| `RN` | Rio Grande do Norte |
| `RO` | Rondônia |
| `RR` | Roraima |
| `RS` | Rio Grande do Sul |
| `SC` | Santa Catarina |
| `SE` | Sergipe |
| `SP` | São Paulo |
| `TO` | Tocantins |
| `EX` | Exterior |

### Enums marital_status

| Enum | Description |
|------|-----------|
| `single` | Single |
| `married` | Married |
| `widower` | Widowed |
| `divorced` | Divorced |
| `separated` | Separated |

### Enums gender

| Enum | Description |
|------|-----------|
| `male` | Male |
| `female` | Female |

### Enums representative_relationship

| Enum | Description |
|------|-----------|
| `ceo` | CEO / Chief Executive Officer |
| `analyst` | Analyst |
| `partner` | Partner |
| `director` | Director |
| `attorney` | Attorney |
| `signer` | Signer |

---

## Complete Flow

1. **POST** `/v2/account_request/draft_checking_legal_person`
   - Creates draft with available data
   - Status: `draft`
   - Returns: `account_request_key`

2. **(Optional)** Collect additional data

3. **PATCH** `/v2/account_request/{account_request_key}/draft_checking_legal_person`
   - Validates completeness of all fields
   - Sends to Bacen Protege+
   - Status: `pending_bacen_validation`

4. **Bacen Protege+ validates** (asynchronous)
   - Status: `pending_kyc_analysis` (if approved)

5. **KYC analyzes legal entity**
   - Status: `approved` (if everything is OK)

6. **Account created and ready for use**

---

---

# fluxo_de_abertura_de_conta

URL: /en/documentation/contas/abertura_de_conta/fluxo_de_abertura_de_conta

### Conta de livre movimentação

As contas de livre movimentação são quaisquer contas bancárias cujo saldo pode ser sacado movimentado pelo cliente, no todo ou em parte.

Abertura de conta
Assim como a emissão de dívidas, a solicitação de abertura de conta é feita com uma única chamada (não esquecendo que os documentos devem ser previamente enviados).

Recebido esse pedido de conta a QI Tech é responsável por executar o compliance e abrir a conta. Na prática:

1 - Solicitação da abertura de conta (solicitado via request)
2 - Validação de compliance (informado resultado via webhook)
3 - Abertura da conta (informado resultado via webhook)

---

# Introdução

URL: /en/documentation/contas/abertura_de_conta/introducao

One of the features we can offer in our integration is the ability to manage accounts and transfers to QI Tech accounts or to other financial institutions via API, but that’s not all. We provide the possibility of OPENING an account via API, whether for yourself or for third parties. 

As with other APIs, the service activation must be done with our team, and the calls are authenticated.

Account opening occurs in two mandatory steps. First, a POST request sends preliminary data to reserve the account. Then, an `account_request.status_change` webhook with the status `pending_additional_data` is triggered after the completion of QI Tech's compliance analysis. In the second step, a PATCH request finalizes the opening, formalizing the account with the additional information.

---

# Account Opening Webhooks

URL: /en/documentation/contas/abertura_de_conta/webhooks_contas

The account opening request response may return the status "pending_kyc_analysis" depending on the partner's integration configuration.

In this case, the response about the approval or rejection of the account opening will be returned asynchronously via webhook.

The account number will be reserved at the time of the opening request, but at this moment **the account is not yet open**. Only after the completion of QI Tech's KYC analysis will the account be open.

## Legal Entity Accounts

# Account Opened

WEBHOOK_TYPE account
STATUS account_opened

Webhook Body

```JSON
{
	"data": {
		"account_info": {
			"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
			"account_digit": "2",
			"account_branch": "0001",
			"account_number": "2359934",
			"financial_institution_code": "329"
		},
		"allowed_user": {
			"name": "Juliana Tereza Bernardes",
			"document_number": "12364480084"
		},
		"account_owner": {
			"name": "VOVO LUCIA CONVENIENCIA LTDA",
			"document_number": "12380702000105"
		}
	},
	"event_datetime": "2022-09-02 22:39:39",
	"key": "dc575950-dcce-48e1-99a6-5fb0ada63d86",
	"status": "account_opened",
	"webhook_type": "account"
}
```

# Account Rejected

WEBHOOK_TYPE account
STATUS account_rejected

Webhook Body

```JSON
{
	"data": {
		"account_info": {
			"account_digit": "2",
			"account_branch": "0001",
			"account_number": "2359934",
			"financial_institution_code": "329"
		},
		"allowed_user": {
			"name": "Juliana Tereza Bernardes",
			"document_number": "97564480084"
		},
		"account_owner": {
			"name": "VOVO LUCIA CONVENIENCIA LTDA",
			"document_number": "09080702000105"
		}
	},
	"event_datetime": "2022-09-02 22:39:39",
	"key": "dc575950-dcce-48e1-99a6-5fb0ada63d86",
	"status": "account_rejected",
	"webhook_type": "account"
}
```

## Individual Accounts

# Account Opened

WEBHOOK_TYPE account
STATUS account_opened

Webhook Body

```JSON
{
    "key":"b5978088-2860-4b78-bd44-77b961354014",
  	"data":{
        "account_info":{
            "account_key":"b7593804-2223-48b3-8a61-f48a651de1d4",
            "account_digit":"5",
            "account_branch":"0001",
            "account_number":"3998360",
            "financial_institution_code":"329"
        },
        "account_owner":{
            "name":"Pedro Pinho",
            "document_number":"97634408077"
        }
      },
    "status":"account_opened",
    "webhook_type":"account",
    "event_datetime":"2024-01-09 14:35:46"
}
```

# Account Rejected

WEBHOOK_TYPE account
STATUS account_rejected

Webhook Body

```JSON
{
    "key":"84864614-2860-4b78-bd44-77b961354014",
  	"data":{
        "account_info":{
            "account_key":"1435dbavf-2860-4b78-bd44-77b961354014",
            "account_digit":"5",
            "account_branch":"0001",
            "account_number":"3998360",
            "financial_institution_code":"329"
        },
        "account_owner":{
            "name":"Pedro Pinho",
            "document_number":"97634408077"
        }
      },
    "status":"account_rejected",
    "webhook_type":"account",
    "event_datetime":"2024-01-09 14:35:46"
}
```

---

# Issue Bank Relationship Letter

URL: /en/documentation/contas/carta_bancaria

The bank relationship letter ("Declaração de Relacionamento") is a PDF document digitally signed by QI SCD that confirms the active relationship between the customer and the institution, including account details. Once issued, the signed document is emailed to the recipients informed in the request.

## Request

ENDPOINT /account/ ACCOUNT_KEY /ownership_letter
METHOD POST

### Path parameters

| Field | Type | Description |
|---|------|--------------------------------|
| `ACCOUNT_KEY` | UUID | Key of the account the letter will be issued for |

### Body parameters

| Field | Type | Description | Max. Characters |
|---|---|---|---|
| `emails` * | array of strings | List of e-mails that will receive the signed PDF. Minimum 1 address. | - |

Request Body

```json
{
  "emails": ["contact@customer.com", "finance@customer.com"]
}
```

## Response

STATUS 200

Response Body

```json
{
  "document_key": "f1b8e3a2-c5d4-4e9f-a1b2-3c4d5e6f7a8b",
  "account_key": "3e4b8746-da58-4799-bcd0-063326428d3f",
  "document_type": "ownership_letter",
  "document_status": "pending",
  "external_identifier_key": "certifiqi-batch-group-key",
  "file_url": "https://api.certifiqi.com.br/events/certifiqi-batch-group-key",
  "payload": {
    "emails": ["contact@customer.com", "finance@customer.com"]
  },
  "created_at": "2026-05-28T19:50:47",
  "updated_at": "2026-05-28T19:50:47"
}
```

### Response Body parameters

| Field | Type | Description | Max. Characters |
|---|---|---|---|
| `document_key` | UUID | Internal QI identifier of the document. | 36 |
| `account_key` | UUID | Key of the source account. | 36 |
| `document_type` | string | Document type. Always `ownership_letter` on this route. | - |
| `document_status` | string | Current document status. See [Enumerators document_status](#enumerators-document_status). | - |
| `external_identifier_key` | string | External identifier of the signature batch. | 300 |
| `file_url` | string | Current document URL. While `pending`, points to signature tracking; once `sent`, points to the signed PDF. | - |
| `payload` | object | Echo of the request body. | - |
| `created_at` | datetime Zulu | Document creation date. | 20 |
| `updated_at` | datetime Zulu | Last document update. | 20 |

### Enumerators document_status

| Enumerator | Description |
|---|---|
| **pending** | Document created, awaiting signature finalization. |
| **sent** | Document signed and e-mails dispatched to recipients. |

## Get the signed document link

Once signing is complete (status `sent`), use this endpoint to obtain an **expirable link** to download the signed PDF, generated on demand by CertifIQI. While the document is still `pending` — that is, before the signature webhook has been received — the URL does not yet exist and the endpoint returns an error.

### Request

ENDPOINT /account/ ACCOUNT_KEY /document/ DOCUMENT_KEY /url
METHOD GET

### Path parameters

| Field | Type | Description |
|---|------|-----------|
| `ACCOUNT_KEY` | UUID | Key of the account the document belongs to. |
| `DOCUMENT_KEY` | UUID | Document identifier (`document_key`) returned when the letter was issued. |

## Response

STATUS 200

Response Body

```json
{
  "document_key": "f1b8e3a2-c5d4-4e9f-a1b2-3c4d5e6f7a8b",
  "document_type": "ownership_letter",
  "document_status": "sent",
  "url": "https://api.certifiqi.com.br/expirable/signed_document.pdf?token=abc123"
}
```

### Response Body parameters

| Field | Type | Description | Max. Characters |
|---|---|---|---|
| `document_key` | UUID | Internal document identifier at QI. | 36 |
| `document_type` | string | Document type. `ownership_letter` for the bank letter. | - |
| `document_status` | string | Current document status. The URL is only returned when `sent`. | - |
| `url` | string | **Expirable** link to download the signed PDF. Generated on demand; expires after a short period. | - |

### Possible errors

| Status | Description |
|---|---|
| 404 | Account or document not found for the given identifiers. |
| 409 | Document still being signed (`pending`); the signed URL is not available yet. |

---

# Issue Audit Confirmation Letter

URL: /en/documentation/contas/carta_circularizacao

The audit confirmation letter ("circularização") is an audit document digitally signed by QI SCD that confirms the balances of the accounts held by the customer at a reference date. It lists every account of the customer's document number within the same requester as the account informed in the path. Once issued, the signed PDF is emailed to the recipients informed in the request (typically the auditor).

## Request

ENDPOINT /account/ ACCOUNT_KEY /circularization_letter
METHOD POST

### Path parameters

| Field | Type | Description |
|---|------|-----------|
| `ACCOUNT_KEY` | UUID | Key of any account belonging to the customer. Used only to identify the document number and requester; the letter lists **all** accounts of the same document number within the requester. |

### Body parameters

| Field | Type | Description | Max. Characters |
|---|---|---|---|
| `emails` * | array of strings | List of e-mails that will receive the signed PDF. Minimum 1 address. Typically the requesting auditor's e-mail. | - |
| `reference_date` * | string (YYYY-MM-DD) | Reference date for the balance calculation. The letter declares each account's closing balance on this date. | 10 |
| `recipient_name` | string | Name of the recipient company/institution, used in the document's salutation ("To the gentlemen of `{recipient_name}`"). If omitted, defaults to "To whom it may concern,". | - |

Request Body

```json
{
  "emails": ["audit@audit-firm.com"],
  "reference_date": "2026-04-30",
  "recipient_name": "BDO RCS Auditores Independentes"
}
```

## Response

STATUS 200

Response Body

```json
{
  "document_key": "f1b8e3a2-c5d4-4e9f-a1b2-3c4d5e6f7a8b",
  "account_key": "3e4b8746-da58-4799-bcd0-063326428d3f",
  "document_type": "circularization_letter",
  "document_status": "pending",
  "external_identifier_key": "certifiqi-batch-group-key",
  "file_url": "https://api.certifiqi.com.br/events/certifiqi-batch-group-key",
  "payload": {
    "emails": ["audit@audit-firm.com"],
    "reference_date": "2026-04-30",
    "recipient_name": "BDO RCS Auditores Independentes"
  },
  "created_at": "2026-05-28T19:50:47",
  "updated_at": "2026-05-28T19:50:47"
}
```

### Response Body parameters

| Field | Type | Description | Max. Characters |
|---|---|---|---|
| `document_key` | UUID | Internal QI identifier of the document. | 36 |
| `account_key` | UUID | Key of the source account. | 36 |
| `document_type` | string | Document type. Always `circularization_letter` on this route. | - |
| `document_status` | string | Current document status. See [Enumerators document_status](#enumerators-document_status). | - |
| `external_identifier_key` | string | External identifier of the signature batch. | 300 |
| `file_url` | string | Current document URL. While `pending`, points to signature tracking; once `sent`, points to the signed PDF. | - |
| `payload` | object | Echo of the request body. | - |
| `created_at` | datetime Zulu | Document creation date. | 20 |
| `updated_at` | datetime Zulu | Last document update. | 20 |

### Enumerators document_status

| Enumerator | Description |
|---|---|
| **pending** | Document created, awaiting signature finalization. |
| **sent** | Document signed and e-mails dispatched to recipients. |

## Get the signed document link

Once signing is complete (status `sent`), use this endpoint to obtain an **expirable link** to download the signed PDF, generated on demand by CertifIQI. While the document is still `pending` — that is, before the signature webhook has been received — the URL does not yet exist and the endpoint returns an error.

### Request

ENDPOINT /account/ ACCOUNT_KEY /document/ DOCUMENT_KEY /url
METHOD GET

### Path parameters

| Field | Type | Description |
|---|------|-----------|
| `ACCOUNT_KEY` | UUID | Key of the account the document belongs to. |
| `DOCUMENT_KEY` | UUID | Document identifier (`document_key`) returned when the letter was issued. |

## Response

STATUS 200

Response Body

```json
{
  "document_key": "f1b8e3a2-c5d4-4e9f-a1b2-3c4d5e6f7a8b",
  "document_type": "circularization_letter",
  "document_status": "sent",
  "url": "https://api.certifiqi.com.br/expirable/signed_document.pdf?token=abc123"
}
```

### Response Body parameters

| Field | Type | Description | Max. Characters |
|---|---|---|---|
| `document_key` | UUID | Internal document identifier at QI. | 36 |
| `document_type` | string | Document type. `circularization_letter` for the circularization letter. | - |
| `document_status` | string | Current document status. The URL is only returned when `sent`. | - |
| `url` | string | **Expirable** link to download the signed PDF. Generated on demand; expires after a short period. | - |

### Possible errors

| Status | Description |
|---|---|
| 404 | Account or document not found for the given identifiers. |
| 409 | Document still being signed (`pending`); the signed URL is not available yet. |

---

# Query fees

URL: /en/documentation/contas/consulta_de_tarifas

## Request

ENDPOINT /baas/billing/ ACCOUNT_KEY /billing_configuration
METHOD GET

## Response

STATUS 200

**Response Body**

```json
{
   "billing_configuration_data":{
      "bankslip":{
         "bankslip_fees":{
            "registration":{
               "amount":10,
               "expense_type":"absolute_value"
            },
            "permanence":{
               "amount":10,
               "expense_type":"absolute_value"
            },
            "protest_removal":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "protest_request":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "protest_costs":{
               "amount":20,
               "expense_type":"percentage"
            },
            "expiration_date_change":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "rebate_inclusion":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "discount_inclusion":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "notary_office_payment":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "expiration_write_off":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "write_off":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "protest_write_off":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "protest_removal_and_write_off":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "payment":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "fine_or_interest_inclusion":{
               "amount":20,
               "expense_type":"absolute_value"
            }
         },
         "billing_account_key":"f6bc82ae-8ede-424d-9450-242a8c9d2435"
      },
      "ted":{
         "ted_fees":{
            "outgoing_ted":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "incoming_ted":{
               "amount":20,
               "expense_type":"absolute_value"
            }
         },
         "billing_account_key":"f6bc82ae-8ede-424d-9450-242a8c9d2435"
      },
      "pix":{
         "pix_fees":{
            "incoming_pix_manual":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "outgoing_pix_manual":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "incoming_pix_key":{
               "amount":30,
               "expense_type":"absolute_value"
            },
            "outgoing_pix_key":{
               "amount":30,
               "expense_type":"absolute_value"
            },
            "incoming_pix_static_qr_code":{
               "amount":30,
               "expense_type":"absolute_value"
            },
            "outgoing_pix_static_qr_code":{
               "amount":30,
               "expense_type":"absolute_value"
            },
            "incoming_pix_dynamic_qr_code":{
               "amount":30,
               "expense_type":"absolute_value"
            },
            "outgoing_pix_dynamic_qr_code":{
               "amount":30,
               "expense_type":"absolute_value"
            }
         },
         "billing_account_key":"f6bc82ae-8ede-424d-9450-242a8c9d2435"
      },
      "account_maintenance":{
         "amount":40,
         "billing_account_key":"f6bc82ae-8ede-424d-9450-242a8c9d2435"
      }
   }
}
```

### Billing_configuration_data

| Field | Type | Description |
|---| ---| ---|
| `bankslip` | object | **[Bankslip](#bankslip)** |
| `ted` | object | **[TED](#ted)** |
| `pix` | object | **[Pix](#pix)** |
| `account_maintenance` | object | **[Account maintenance](#account_maintenance)** |

### Bankslip

| Field | Type | Description |
|---|---|---|
| `bankslip_fees` | object | **[Bankslip_fees](#bankslip_fees)** |
| `billing_account_key` | string | id (uuid) containing the reference to the account to which the fee will be charged |

### Bankslip_fees

| Field | Type | Description | Reference |
|---|---|---|---|
| `registration` | object | Registration fee | **[Standard fees object](#standard-fees-object)** |
| `permanence` | object | Permanence fee for registered title | **[Standard fees object](#standard-fees-object)** |
| `protest_removal` | object | Protest removal/negative removal fee | **[Standard fees object](#standard-fees-object)** |
| `protest_request` | object | Protest/negative inclusion fee | **[Standard fees object](#standard-fees-object)** |
| `protest_costs` | object | Protest costs, for this field **expense_type must be 'percentage'** | **[Standard fees object](#standard-fees-object)** |
| `expiration_date_change` | object | Expiration date change fee | **[Standard fees object](#standard-fees-object)** |
| `rebate_inclusion` | object | Rebate inclusion fee | **[Standard fees object](#standard-fees-object)** |
| `discount_inclusion` | object | Discount inclusion fee | **[Standard fees object](#standard-fees-object)** |
| `notary_office_payment` | object | Fee for title settled at notary office | **[Standard fees object](#standard-fees-object)** |
| `expiration_write_off` | object | Fee for title written off due to elapsed time | **[Standard fees object](#standard-fees-object)** |
| `write_off` | object | Fee for title written off on request | **[Standard fees object](#standard-fees-object)** |
| `protest_write_off` | object | Fee for protested title written off | **[Standard fees object](#standard-fees-object)** |
| `protest_removal_and_write_off` | object | Fee for title written off with protest removal/notary return | **[Standard fees object](#standard-fees-object)** |
| `payment` | object | Settlement fee | **[Standard fees object](#standard-fees-object)** |
| `fine_or_interest_inclusion` | object | Fee for inclusion of fines and interest | **[Standard fees object](#standard-fees-object)** |

### Ted 

| Field | Type | Description |
|---|---|---|
| `ted_fees` | object | **[Ted_fees](#ted_fees)** |
| `billing_account_key` | string | id (uuid) containing the reference to the account to which the fee will be charged |

### Ted_fees

| Field | Type | Description |
|---|---|---|
| `outgoing_ted` | object | **[Standard fees object](#standard-fees-object)** |
| `incoming_ted` | object | **[Standard fees object](#standard-fees-object)** |

### Pix

| Field | Type | Description |
|---|---|---|
| `pix_fees` | object | **[Pix_fees](#pix_fees)** |
| `billing_account_key` | string | id (uuid) containing the reference to the account to which the fee will be charged |

### Pix_fees

| Field | Type | Description |
|---|---|---|
| `incoming_pix_manual` | object | **[Standard fees object](#standard-fees-object)** |
| `outgoing_pix_manual` | object | **[Standard fees object](#standard-fees-object)** |
| `incoming_pix_key` | object | **[Standard fees object](#standard-fees-object)** |
| `outgoing_pix_key` | object | **[Standard fees object](#standard-fees-object)** |
| `incoming_pix_static_qr_code` | object | **[Standard fees object](#standard-fees-object)** |
| `outgoing_pix_static_qr_code` | object | **[Standard fees object](#standard-fees-object)** |
| `incoming_pix_dynamic_qr_code` | object | **[Standard fees object](#standard-fees-object)** |
| `outgoing_pix_dynamic_qr_code` | object | **[Standard fees object](#standard-fees-object)** |

### Account_maintenance 
| Field | Type | Description |
|---|---|---|
| `amount` | number | Fee amount which can represent either an absolute value (absolute_value) or percentage (percentage), limited to two decimal places |
| `billing_account_key` | string | id (uuid) containing the reference to the account to which the fee will be charged |

### Standard fees object
| Field | Type | Description | Reference |
|---|---|---|---|
| `amount` | number | Fee amount which can represent either an absolute value (absolute_value) or percentage (percentage), limited to two decimal places |
| `expense_type` | enum | Fee format | **[Enumerators expense_type](#enumerators-expense_type)** |

# Enumerators

### Enumerador _Expense Type_
| Enumerator | Description |
|-----------------------|---------------------------------------------------------------------------|
| **percentage** | Percentage value |
| **absolute_value** | Absolute value |

STATUS 4XX

**Response Body: Error**

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in Portuguese",
  "code": "codigo",
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title` | Description<br/>`description` | Translation<br/>`translation` |
|-------------|----------------------|---------------------------------------------|---------------------------------------------------|-----------------------------------------------------------------------------|
| 400 | BLL000063 | Bad Request | Not allowed to view fees in unavailable accounts | Conta indisponível. |
| 404 | BLL000027 | Not Found | Account not found for the given account_key | Não foi encontrada uma conta com a chave fornecida. |

---

# Query account

URL: /en/documentation/contas/consultar_conta

## Request

ENDPOINT /account/ ACCOUNT_KEY
METHOD GET

### PATH PARAMS

| Field | Type | Description |
|---|------|--------------------------------|
| `ACCOUNT_KEY` | UUID | Key of the account to be detailed |

## Response

Response Body

```json
{
    "account_branch": "0001",
    "account_digit": "5",
    "account_documents": ["1e4b8746-da58-4799-bcd0-063326428ssd"],
    "account_key": "3e4b8746-da58-4799-bcd0-063326428d3f",
    "account_number": "5960388",
    "account_status": "opened",
    "account_type": "checking",
    "balance": 264.76,
    "blocked_balance": 0,
    "owner_document_number": "30987145223",
    "owner_name": "Maria Luiza Vieira",
    "owner_person_key": "47d08366-a8ec-414c-a0a5-a089fc8a4ee8",
    "created_at": "2023-05-15T19:56:10"
}
```

### Body params
| Field | Type | Description | Max. Characters |
|-------|---------------|----------------------------------------------|-------------------------------------------------------------|
| `account_key` | uuid | Unique account identifier. | 36 |
| `account_branch` | string | Branch, without the check digit. | 4 |
| `account_digit` | string | Account check digit. | 1 |
| `account_number` | string | Account number, without the check digit. | 20 |
| `account_type` | string | Definition of account type. | 20 |
| `account_status` | string | Account status. | [Enumerators account_status](#enumeradores-account_status) |
| `owner_document_number` | string | CPF or CNPJ number. | 14 |
| `owner_name` | string | Account holder's name. | 120 |
| `balance` | double | Account balance. | 120 |
| `blocked_balance` | double | Blocked account balance. | 120 |
| `owner_person_key` | string | Unique identifier of the account holder. | 36 |
| `account_documents` | ARRAY | Array of unique account identifiers. | - |
| `created_at` | datetime Zulu | Date the request was created. | 20 |

### Enumerators account_status
| Enumerator | Description |
|------------|-----------------|
| `opened` | Account opened |
| `closed` | Account closed |
| `blocked` | Account blocked |

STATUS 404

Response Body: User does not have credentials

```json
{
    "title": "Not Found",
    "description": "Account not found for the given key 3e4b8746-da58-4799-bcd0-063326428d3f",
    "translation": "Conta não encontrada para a seguinte chave 3e4b8746-da58-4799-bcd0-063326428d3f",
    "code": "ACC000006"
}
```

STATUS 403

Response Body: User does not have credentials

```json
{
    "title": "Permission Validator Error",
    "description": "Selected agent do not own this item.",
    "translation": "O agente selecionado não é dono do item.",
    "code": "QIT000005"
}
```

---

# List accounts

URL: /en/documentation/contas/consultar_contas

## Request

ENDPOINT /account
METHOD GET

## Query Params
| Field | Type | Description | Characters |
|---|---| ---| ---|
| `owner_document_number` | string | Account holder's document number. | - |
| `account_number` | string | Account number. | - |

## Response

STATUS 200

**Response Body**

```json
{
	"data": [
	  {
			"account_block_reason": null,
			"account_branch": "0001",
			"account_credentials": [{
					"account_id": 4130,
					"created_at": "2023-05-15T19:56:10",
					"credential_type": {
						"created_at": "2019-06-18T13:19:30",
						"enumerator": "observer",
						"id": 3,
						"translation_path": "account.CredentialType.observer"
					},
					"credential_type_id": 3,
					"id": 4394,
					"is_active": true,
					"person_key": "47d08366-a8ec-414c-a0a5-a089fc8a4ee8",
					"updated_at": null
				},
				{
					"account_id": 4130,
					"created_at": "2023-05-15T19:56:10",
					"credential_type": {
						"created_at": "2019-06-18T13:19:30",
						"enumerator": "approver_requester",
						"id": 4,
						"translation_path": "account.CredentialType.approver_requester"
					},
					"credential_type_id": 4,
					"id": 4395,
					"is_active": true,
					"person_key": "77136fe2-2ddb-4593-b285-67c40b6da46a",
					"updated_at": null
				},
				{
					"account_id": 4130,
					"created_at": "2023-05-15T19:56:10",
					"credential_type": {
						"created_at": "2019-06-18T13:19:30",
						"enumerator": "requester",
						"id": 2,
						"translation_path": "account.CredentialType.requester"
					},
					"credential_type_id": 2,
					"id": 4396,
					"is_active": true,
					"person_key": "77136fe2-2ddb-4593-b285-67c40b6da46a",
					"updated_at": null
				}
			],
			"account_digit": "5",
			"account_documents": [],
			"account_events": [{
				"account_id": 4130,
				"created_at": "2023-05-15T19:56:10",
				"id": 6250,
				"new_account_status": {
					"created_at": "2019-10-11T18:58:31",
					"enumerator": "opened",
					"id": 1,
					"translation_path": "account.AccountStatus.opened"
				},
				"new_account_status_id": 1,
				"old_account_status": null,
				"old_account_status_id": null
			}],
			"account_key": "3e4b8746-da58-4799-bcd0-063326428d3f",
			"account_name": "Default",
			"account_number": "5960388",
			"account_status": {
				"created_at": "2019-10-11T18:58:31",
				"enumerator": "opened",
				"translation_path": "account.AccountStatus.opened"
			},
			"account_type": {
				"created_at": "2019-03-15T13:09:15",
				"enumerator": "checking",
				"translation_path": "account.AccountType.checking"
			},
			"automatic_transfer_management_status": {
				"created_at": "2022-10-27T13:48:18",
				"enumerator": "master"
			},
			"automatic_transfers": [],
			"balance": 264.76,
			"blocked_balance": 0,
			"blocked_balance_events": [],
			"created_at": "2023-05-15T19:56:10",
			"destinations": [],
			"fee": null,
			"internal_webhooks": [{
				"account_id": 4130,
				"created_at": "2023-05-15T16:56:10",
				"id": 144,
				"is_active": true,
				"updated_at": "2023-05-15T16:56:10",
				"webhook_tag": {
					"created_at": "2023-03-30T20:20:04",
					"enumerator": "billing",
					"id": 2
				},
				"webhook_tag_id": 2
			}],
			"investment_available_amount": 264.76,
			"investment_configuration": {
				"block_yield": false,
				"daily_yield_percentage": 1,
				"investment_configuration_status": "active",
				"monthly_yield_amount": 0
			},
			"is_system_account": false,
			"owner_document_number": "30987145223",
			"owner_name": "Maria Luiza Vieira",
			"owner_person_key": "47d08366-a8ec-414c-a0a5-a089fc8a4ee8",
			"permitted_person_keys": [
				"47d08366-a8ec-414c-a0a5-a089fc8a4ee8",
				"47d08366-a8ec-414c-a0a5-a089fc8a4ee8",
				"77136fe2-2ddb-4593-b285-67c40b6da46a",
				"77136fe2-2ddb-4593-b285-67c40b6da46a"
			],
			"requester_key": "77136fe2-2ddb-4593-b285-67c40b6da46a",
			"requester_name": "White Label Develop",
			"setup_fee": null,
			"transactional_limit": null,
			"webhook_enabled": true
		},
		{
			"account_block_reason": null,
			"account_branch": "9999",
			"account_credentials": [],
			"account_digit": "5",
			"account_documents": [],
			"account_events": [],
			"account_key": "748b456c-92fb-4832-837a-0f0a15222a21",
			"account_name": "investment-Default",
			"account_number": "5960388",
			"account_status": {
				"created_at": "2019-10-11T18:58:31",
				"enumerator": "opened",
				"translation_path": "account.AccountStatus.opened"
			},
			"account_type": {
				"created_at": "2022-09-05T20:57:05",
				"enumerator": "investment",
				"translation_path": "account.AccountType.investment"
			},
			"automatic_transfer_management_status": {
				"created_at": "2022-10-27T13:48:18",
				"enumerator": "master"
			},
			"automatic_transfers": [],
			"balance": 0,
			"blocked_balance": 0,
			"blocked_balance_events": [],
			"created_at": "2023-05-24T12:42:42",
			"destinations": [],
			"fee": null,
			"internal_webhooks": [],
			"investment_available_amount": 0,
			"investment_configuration": null,
			"is_system_account": false,
			"owner_document_number": "30987145223",
			"owner_name": "Maria Luiza Vieira",
			"owner_person_key": "47d08366-a8ec-414c-a0a5-a089fc8a4ee8",
			"permitted_person_keys": [
				"47d08366-a8ec-414c-a0a5-a089fc8a4ee8"
			],
			"requester_key": "77136fe2-2ddb-4593-b285-67c40b6da46a",
			"requester_name": "White Label Develop",
			"setup_fee": null,
			"transactional_limit": null,
			"webhook_enabled": null
		}
	],
	"pagination": {
		"current_page": 1,
		"next_page": null,
		"rows_per_page": 100,
		"total_pages": 1,
		"total_rows": 2
	}
}
```

STATUS 400

**Response Body**

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

```

---

# Query account request details

URL: /en/documentation/contas/consultar_detalhes_pedido_conta

Endpoint to query the full details of an account opening request, including information about the proposal status, related parties, attached documents, events, and configurations.

:::info Information
This endpoint only supports **checking** and **escrow** account types.
:::

## Request

ENDPOINT /v2/account_request/ ACCOUNT_REQUEST_KEY /full
METHOD GET

### Path Params

| Field | Type | Description |
|---|------|-----------|
| `ACCOUNT_REQUEST_KEY` | UUID | Unique key of the account request to be queried |

## Response

STATUS 200

Response Body

```json
{
    "proposal_key": "3e4b8746-da58-4799-bcd0-063326428d3f",
    "contract_number": "123456",
    "requester_key": "47d08366-a8ec-414c-a0a5-a089fc8a4ee8",
    "requester_name": "Requester Name",
    "requester_document_number": "30987145223",
    "request_control_key": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
    "created_account_key": "c2790f8c-2f93-5g87-b9e4-d437b3c90c78",
    "reserved_related_account": {
        "account_branch": "0001",
        "account_number": "5960388",
        "account_digit": "5",
        "document_number": "30987145223",
        "name": "Account Holder Name",
        "financial_institutions_code_number": "329",
        "financial_institutions": {
            "name": "QI Sociedade de Crédito Direto S.A.",
            "code_number": 329,
            "ispb": 32402502
        },
        "ted_account_type": {
            "enumerator": "checking_account",
            "translation_path": "...",
            "created_at": "2023-05-15T19:56:10"
        },
        "is_activated": true,
        "updated_at": "2023-05-15T19:56:10",
        "created_at": "2023-05-15T19:56:10"
    },
    "proposal_status": {
        "enumerator": "account_opened",
        "translation_path": "...",
        "created_at": "2023-05-15T19:56:10"
    },
    "account_type": {
        "enumerator": "checking",
        "translation_path": "...",
        "created_at": "2023-05-15T19:56:10"
    },
    "document_key": "3571e292-3a83-4011-904d-20ee963022ef",
    "document_template_key": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "is_simplified": false,
    "created_at": "2023-05-15T19:56:10",
    "signed_contract": null,
    "additional_documents": null,
    "events": [
        {
            "old_status": {
                "enumerator": "pending",
                "translation_path": "...",
                "created_at": "2023-05-15T19:56:10"
            },
            "new_status": {
                "enumerator": "account_opened",
                "translation_path": "...",
                "created_at": "2023-05-15T19:56:10"
            },
            "rejection_reason": null,
            "event_description": "Account opened successfully",
            "created_at": "2023-05-15T20:00:00"
        }
    ],
    "destinations": [
        {
            "account_branch": "0001",
            "account_number": "5960389",
            "account_digit": "7",
            "document_number": "30987145223",
            "name": "Destination Name",
            "financial_institutions_code_number": "329",
            "financial_institutions": {
                "name": "QI Sociedade de Crédito Direto S.A.",
                "code_number": 329,
                "ispb": 32402502
            },
            "ted_account_type": {
                "enumerator": "checking_account",
                "translation_path": "...",
                "created_at": "2023-05-15T19:56:10"
            },
            "is_activated": true,
            "updated_at": "2023-05-15T19:56:10",
            "created_at": "2023-05-15T19:56:10"
        }
    ],
    "attached_documents": [
        {
            "document_key": "c3d4e5f6-a7b8-9012-cdef-123456789012",
            "document_type": {
                "enumerator": "identity",
                "translation_path": "...",
                "created_at": "2023-05-15T19:56:10"
            },
            "description": "Identity document",
            "document_url": "https://example.com/document.pdf",
            "is_activated": true,
            "updated_at": "2023-05-15T19:56:10",
            "created_at": "2023-05-15T19:56:10"
        }
    ],
    "related_parties": [
        {
            "person_key": "47d08366-a8ec-414c-a0a5-a089fc8a4ee8",
            "person_type": {
                "enumerator": "natural",
                "translation_path": "...",
                "created_at": "2023-05-15T19:56:10"
            },
            "individual_document_number": "30987145223",
            "company_document_number": null,
            "name": "Maria Luiza Vieira",
            "mother_name": "Dona Maria Mariane",
            "is_pep": false,
            "final_beneficiary": true,
            "is_signer": true,
            "is_activated": true,
            "address": {
                "street": "Av. Brigadeiro Faria Lima",
                "neighborhood": "Jardim Paulistano",
                "number": "2391",
                "postal_code": "01452905",
                "city": "São Paulo",
                "state": "SP",
                "country": "BR",
                "complement": "Complement",
                "created_at": "2023-05-15T19:56:10"
            },
            "phone": {
                "phone_type": {
                    "enumerator": "mobile",
                    "translation_path": "...",
                    "created_at": "2023-05-15T19:56:10"
                },
                "country_code": "055",
                "area_code": "11",
                "number": "999999999",
                "created_at": "2023-05-15T19:56:10"
            },
            "nationality": "Brazilian",
            "email": "teste@gmail.com",
            "birth_date": "1990-05-06",
            "role_type": {
                "enumerator": "account_holder",
                "translation_path": "...",
                "created_at": "2023-05-15T19:56:10"
            },
            "updated_at": "2023-05-15T19:56:10",
            "created_at": "2023-05-15T19:56:10"
        }
    ],
    "credit_operations": [],
    "automatic_transfer_config": {},
    "billing_configuration_data": null,
    "account_owner_data": null
}
```

### Response Body Params

| Field | Type | Description |
|---|------|-----------|
| `proposal_key` | string | Unique key of the account request |
| `contract_number` | string | Contract number |
| `requester_key` | string | Requester key |
| `requester_name` | string | Requester name |
| `requester_document_number` | string | Requester CPF or CNPJ |
| `request_control_key` | string | Request control key |
| `created_account_key` | string | Created account key |
| `reserved_related_account` | object | Reserved related account data (can be `null`) |
| `proposal_status` | object | Current proposal status |
| `account_type` | object | Account type |
| `document_key` | string | Document key |
| `document_template_key` | string | Document template key |
| `is_simplified` | boolean | Indicates if it is a simplified account |
| `created_at` | datetime | Request creation date |
| `signed_contract` | object | Signed contract data (can be `null`) |
| `additional_documents` | array | Additional documents (can be `null`) |
| `events` | array | List of request events |
| `rejection_reason` | string | Rejection reason, present only if there is a rejection |
| `destinations` | array | List of configured destinations |
| `attached_documents` | array | List of attached documents |
| `related_parties` | array | List of related parties |
| `credit_operations` | array | List of credit operations |
| `automatic_transfer_config` | object | Automatic transfer configuration |
| `billing_configuration_data` | object | Billing configuration (can be `null`) |
| `account_owner_data` | object | Account owner data (can be `null`) |

### Object proposal_status / account_type

| Field | Type | Description |
|---|------|-----------|
| `enumerator` | string | Enumerator value |
| `translation_path` | string | Translation path |
| `created_at` | datetime | Creation date |

### Enumerators proposal_status

| Enumerator | Description |
|------------|-----------|
| `pending` | Pending |
| `pending_kyc_analysis` | Pending KYC analysis |
| `account_opened` | Account opened |
| `rejected` | Rejected |
| `cancelled` | Cancelled |

### Enumerators account_type

| Enumerator | Description |
|------------|-----------|
| `checking` | Checking account |
| `escrow` | Escrow account |

### Object events

| Field | Type | Description |
|---|------|-----------|
| `old_status` | object | Previous status (same format as proposal_status) |
| `new_status` | object | New status (same format as proposal_status) |
| `rejection_reason` | string | Rejection reason (can be `null`) |
| `event_description` | string | Event description |
| `created_at` | datetime | Event date |

### Object destinations / reserved_related_account

| Field | Type | Description |
|---|------|-----------|
| `account_branch` | string | Branch |
| `account_number` | string | Account number |
| `account_digit` | string | Check digit |
| `document_number` | string | CPF or CNPJ |
| `name` | string | Account holder name |
| `financial_institutions_code_number` | string | Financial institution code |
| `financial_institutions` | object | Financial institution data |
| `ted_account_type` | object | TED account type |
| `is_activated` | boolean | Whether the destination is active |
| `updated_at` | datetime | Update date |
| `created_at` | datetime | Creation date |

### Object attached_documents

| Field | Type | Description |
|---|------|-----------|
| `document_key` | string | Unique document key |
| `document_type` | object | Document type (enumerator format) |
| `description` | string | Document description |
| `document_url` | string | Document URL |
| `is_activated` | boolean | Whether the document is active |
| `updated_at` | datetime | Update date |
| `created_at` | datetime | Creation date |

### Object related_parties

| Field | Type | Description |
|---|------|-----------|
| `person_key` | string | Unique person key |
| `person_type` | object | Person type (enumerator format) |
| `individual_document_number` | string | CPF |
| `company_document_number` | string | CNPJ |
| `name` | string | Name |
| `mother_name` | string | Mother's name |
| `is_pep` | boolean | Whether the person is politically exposed |
| `final_beneficiary` | boolean | Whether the person is the final beneficiary |
| `is_signer` | boolean | Whether the person is a signer |
| `is_activated` | boolean | Whether the party is active |
| `address` | object | Address |
| `phone` | object | Phone |
| `nationality` | string | Nationality |
| `email` | string | Email |
| `birth_date` | string | Date of birth |
| `role_type` | object | Role type (enumerator format) |
| `updated_at` | datetime | Update date |
| `created_at` | datetime | Creation date |

## Errors

STATUS 404

Response Body: Account request not found

```json
{
    "title": "Proposal Not Found",
    "description": "Proposal not found.",
    "translation": "Proposta não encontrada.",
    "code": "ACR000003"
}
```

STATUS 400

Response Body: Unsupported account type

```json
{
    "title": "Temporarily unavailable",
    "description": "Temporarily unavailable",
    "translation": "Temporariamente indisponível",
    "code": "ACR000068"
}
```

STATUS 403

Response Body: User does not have credentials

```json
{
    "title": "Permission Validator Error",
    "description": "Selected agent do not own this item.",
    "translation": "O agente selecionado não é dono do item.",
    "code": "QIT000005"
}
```

---

# Close a account

URL: /en/documentation/contas/encerramento_de_conta

## Request

ENDPOINT /account/ ACCOUNT_KEY /cancel
METHOD PATCH

## Response

STATUS 200

**Response Body**

```json
{
	"account_block_reason": null,
	"account_branch": "0001",
	"account_credentials": [{
			"account_id": 3493,
			"created_at": "2023-01-04T11:10:53",
			"credential_type": {
				"created_at": "2019-06-18T13:19:30",
				"enumerator": "observer",
				"id": 3,
				"translation_path": "account.CredentialType.observer"
			},
			"credential_type_id": 3,
			"id": 3456,
			"is_active": true,
			"person_key": "10ffdcef-6ac7-4ca0-9932-8a0e49ff5972",
			"updated_at": null
		},
		{
			"account_id": 3493,
			"created_at": "2023-01-04T11:10:53",
			"credential_type": {
				"created_at": "2019-06-18T13:19:30",
				"enumerator": "requester",
				"id": 2,
				"translation_path": "account.CredentialType.requester"
			},
			"credential_type_id": 2,
			"id": 3457,
			"is_active": true,
			"person_key": "78269442-caa1-4767-a049-0291b0321063",
			"updated_at": null
		}
	],
	"account_digit": "9",
	"account_documents": [],
	"account_events": [{
			"account_id": 3493,
			"created_at": "2023-01-04T11:10:53",
			"id": 5284,
			"new_account_status": {
				"created_at": "2019-10-11T18:58:31",
				"enumerator": "blocked",
				"id": 3,
				"translation_path": "account.AccountStatus.blocked"
			},
			"new_account_status_id": 3,
			"old_account_status": null,
			"old_account_status_id": null
		},
		{
			"account_id": null,
			"created_at": null,
			"id": null,
			"new_account_status": {
				"created_at": "2019-10-11T18:58:31",
				"enumerator": "closed",
				"id": 2,
				"translation_path": "account.AccountStatus.closed"
			},
			"new_account_status_id": null,
			"old_account_status": {
				"created_at": "2019-10-11T18:58:31",
				"enumerator": "blocked",
				"id": 3,
				"translation_path": "account.AccountStatus.blocked"
			},
			"old_account_status_id": null
		}
	],
	"account_key": "91e42ceb-53f7-4dc5-ab75-db30b1de491f",
	"account_name": "Default",
	"account_number": "2765703",
	"account_status": {
		"created_at": "2019-10-11T18:58:31",
		"enumerator": "closed",
		"translation_path": "account.AccountStatus.closed"
	},
	"account_type": {
		"created_at": "2019-03-15T13:09:15",
		"enumerator": "checking",
		"translation_path": "account.AccountType.checking"
	},
	"automatic_transfer_management_status": {
		"created_at": "2022-10-27T13:48:18",
		"enumerator": "master"
	},
	"automatic_transfers": [],
	"balance": 0.0,
	"blocked_balance": 0.0,
	"blocked_balance_events": [],
	"created_at": "2023-01-04T11:10:53",
	"destinations": [],
	"fee": 0.0,
	"internal_webhooks": [],
	"investment_available_amount": 0.0,
	"investment_configuration": null,
	"is_system_account": false,
	"owner_document_number": "23426525852",
	"owner_name": "Murilo Almeida",
	"owner_person_key": "10ffdcef-6ac7-4ca0-9932-8a0e49ff5972",
	"permitted_person_keys": ["10ffdcef-6ac7-4ca0-9932-8a0e49ff5972",
		"10ffdcef-6ac7-4ca0-9932-8a0e49ff5972",
		"78269442-caa1-4767-a049-0291b0321063"
	],
	"requester_key": "78269442-caa1-4767-a049-0291b0321063",
	"requester_name": "Salgadinhos Show (BAAS)",
	"setup_fee": null,
	"transactional_limit": null,
	"url": "https://storage.googleapis.com/sandbox-doc-api/documents/e054a511-a8db-4c6e-abbe-f376f36fb39c/e054a511-a8db-4c6e-abbe-f376f36fb39c.pdf",
	"webhook_enabled": true
}
```

:::caution **Attention!**

It is important that the PDF of the account closure receipt returned in the **"url"** field be presented to the client.

:::

### PATH PARAMS

| Field | Type | Description |
|---|---| ---|
| `account_key` * | string | Account key. | 

## Response

STATUS 400

**Response Body**

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

```

### Errors

| Code | Status code | Description | 
|---|---|---|
| ACC000006  | 404  | Account not found for the given key \{account_key\} |
| QIT000003  | 403  | The agent does not have enough roles. |
| ACC000127  | 500  | Failed to create account cancelling term |
| ACC000011  | 423  | Closed accounts can not perform this action. |
| ACC000123  | 400  | Account balance cannot be greater than 0. |
| ACC000124  | 400  | Can't perform this action. There'are few unpaid future transactions |
| ACC000125  | 400  | Can't perform this action. There'are few unpaid bankslip fees |
| ACC000126  | 400  | There'are few accepted or registered bankslips yet |

## Webhook

:::danger Attention!
QI Tech webhooks must not be mapped strictly. Additional fields may be included in the webhook payloads returned by our APIs.
:::

:::info Resending Webhooks
You can view and resend webhooks by following the detailed instructions in the documentation: [Resending Webhooks](/documentation/notificacoes/reenvio_de_notificacoes).
:::

Below is the webhook triggered when an account is closed.

WEBHOOK_TYPE baas.account.status_change

Webhook Body

```json
{
  "webhook_type": "baas.account.status_change",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
	"account_key":"91e42ceb-53f7-4dc5-ab75-db30b1de491f",
	"account_status":"closed"
  }
}
```

---

# Fee statement

URL: /en/documentation/contas/extrato_de_tarifas

Returns a list of the fees charged to a specific billing account in the selected period.

## Request

ENDPOINT /billing/requester_configuration/billing_account/ BILLING_ACCOUNT_KEY /invoices
METHOD GET

### Path Params

| Field | Type | Description |
|---|---| ---|
| `BILLING_ACCOUNT_KEY` | string | id (uuid) of the billing account whose fees will be listed. |

## Query Params

| Field | Type | Description |
|---|---| ---|
| `start_date` | string | Start date of the period, in `yyyy-mm-dd` format. Optional. |
| `end_date` | string | End date of the period, in `yyyy-mm-dd` format. Optional. |
| `status` | string | Filters by fee status. Optional. **[Status enumerator](#status-enumerator)** |
| `billing_type` | string | Filters by fee type. Can be provided more than once to combine types. Optional. |
| `page` | integer | Page number. Default `1`. |
| `page_size` | integer | Number of fees per page. Default `20`, maximum `50`. |

## Response

STATUS 200

**Response Body**

```json
{
  "data": [
    {
      "invoice_key": "d1f4a2b6-8c3e-4f5a-9b7d-2e6c8a0f1d3b",
      "reference_date": "2026-06-01",
      "billing_type": "account_maintenance",
      "billing_type_description": "Tarifa de Manutenção de Conta",
      "status": "paid",
      "total_amount": 30.00,
      "paid_amount": 30.00,
      "amount_owed": 0.00
    },
    {
      "invoice_key": "b2e5c3a7-9d4f-4a6b-8c1e-3f7d9b1a2c4e",
      "reference_date": "2026-06-15",
      "billing_type": "outgoing_ted",
      "billing_type_description": "Tarifa de Envio de TED",
      "status": "open",
      "total_amount": 20.00,
      "paid_amount": 0.00,
      "amount_owed": 20.00
    }
  ],
  "page": 1,
  "page_size": 20,
  "has_next_page": false
}
```

### Response Body

| Field | Type | Description |
|---|---| ---|
| `data` | array | List of charged fees. **[Data](#data)** |
| `page` | integer | Returned page. |
| `page_size` | integer | Number of fees per page. |
| `has_next_page` | boolean | Indicates whether there are more pages of results. |

### Data

| Field | Type | Description |
|---|---| ---|
| `invoice_key` | string | id (uuid) of the fee. |
| `reference_date` | string | Reference date of the fee, in `yyyy-mm-dd` format. |
| `billing_type` | string | Fee type (enumerator). |
| `billing_type_description` | string | Description of the fee type. |
| `status` | string | Fee status. **[Status enumerator](#status-enumerator)** |
| `total_amount` | number | Total amount of the fee. |
| `paid_amount` | number | Amount already paid of the fee. |
| `amount_owed` | number | Outstanding amount of the fee. Written-off fees (`written_off`) return `0`. |

# Enumerators

### Status enumerator

| Enumerator | Description |
|---|---|
| **open** | Open fee. |
| **pending** | Fee awaiting payment. |
| **paid** | Settled fee. |
| **written_off** | Written-off fee. |

STATUS 4XX

**Response Body: Error**

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo"
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`          | Description<br/>`description`                        | Translation<br/>`translation`                               |
|-------------|----------------------|-----------------------------|------------------------------------------------------|-------------------------------------------------------------|
| 400         | BLL000096            | Invalid Date Format         | Dates must be formatted as 'yyyy-mm-dd'.             | Datas devem ser formatadas como 'aaaa-mm-dd'                |
| 400         | BLL000043            | Bad Request                 | Invalid status enumerator                            | Status informado não é válido                               |
| 400         | BLL000090            | Invalid value for params    | Page Size and Page Number must be integers           | Page Size e Page Number devem ser números inteiros          |
| 400         | BLL000091            | Page size too large         | Requested page size above limit of 50                | Tamanho de página requerido acima do limite de 50           |
| 400         | BLL000063            | Bad Request                 | Not allowed to view fees in unavailable accounts     | Conta indisponível.                                         |

---

# Fee management

URL: /en/documentation/contas/gestao_de_tarifas

## Request

ENDPOINT /baas/billing/ ACCOUNT_KEY /billing_configuration
METHOD PUT

:::danger Definition and Transfer of Fees
The maximum values for each fee must be aligned with the QI Tech commercial team.
The amount to be transferred to the partner, referring to each fee charged, must also be aligned with the QI Tech commercial team.
:::

:::danger General Observations:
For this endpoint, it is important that the "Request Body" is followed strictly as all fields are mandatory.
:::

**Request Body**

```json
{
   "billing_configuration_data": {
      "bankslip": {
         "bankslip_fees": {
            "registration": {
               "amount": 10,
               "expense_type": "absolute_value"
            },
            "permanence": {
               "amount": 10,
               "expense_type": "absolute_value"
            },
            "protest_removal": {
               "amount": 10,
               "expense_type": "absolute_value"
            },
            "protest_request": {
               "amount": 10,
               "expense_type": "absolute_value"
            },
            "protest_costs": {
               "amount": 100,
               "expense_type": "percentage"
            },
            "expiration_date_change": {
               "amount": 10,
               "expense_type": "absolute_value"
            },
            "rebate_inclusion": {
               "amount": 10,
               "expense_type": "absolute_value"
            },
            "discount_inclusion": {
               "amount": 10,
               "expense_type": "absolute_value"
            },
            "notary_office_payment": {
               "amount": 10,
               "expense_type": "absolute_value"
            },
            "expiration_write_off": {
               "amount": 10,
               "expense_type": "absolute_value"
            },
            "write_off": {
               "amount": 10,
               "expense_type": "absolute_value"
            },
            "protest_write_off": {
               "amount": 10,
               "expense_type": "absolute_value"
            },
            "protest_removal_and_write_off": {
               "amount": 10,
               "expense_type": "absolute_value"
            },
            "payment": {
               "amount": 10,
               "expense_type": "absolute_value"
            },
            "fine_or_interest_inclusion": {
               "amount": 10,
               "expense_type": "absolute_value"
            }
         },
         "billing_account_key": "f6bc82ae-8ede-424d-9450-242a8c9d2435"
      },
      "ted": {
         "ted_fees": {
            "outgoing_ted": {
               "amount": 20,
               "expense_type": "absolute_value"
            },
            "incoming_ted": {
               "amount": 20,
               "expense_type": "absolute_value"
            }
         },
         "billing_account_key": "f6bc82ae-8ede-424d-9450-242a8c9d2435"
      },
      "pix": {
         "pix_fees": {
            "incoming_pix_manual": {
               "amount": 2,
               "expense_type": "absolute_value"
            },
            "outgoing_pix_manual": {
               "amount": 2,
               "expense_type": "absolute_value"
            },
            "incoming_pix_key": {
               "amount": 3,
               "expense_type": "absolute_value"
            },
            "outgoing_pix_key": {
               "amount": 3,
               "expense_type": "absolute_value"
            },
            "incoming_pix_static_qr_code": { 
               "amount": 3,
               "expense_type": "absolute_value"
            },
            "outgoing_pix_static_qr_code": {
               "amount": 3,
               "expense_type": "absolute_value"
            },
            "incoming_pix_dynamic_qr_code": {
               "amount": 3,
               "expense_type": "absolute_value"
            },
            "outgoing_pix_dynamic_qr_code": {
               "amount": 3,
               "expense_type":"absolute_value"
            }
         },
         "billing_account_key": "f6bc82ae-8ede-424d-9450-242a8c9d2435"
      },
      "account_maintenance": {
         "amount": 500,
         "billing_account_key": "f6bc82ae-8ede-424d-9450-242a8c9d2435"
      }
   }
}

```

### BODY PARAMS
| Field | Type | Description |
|---|---| ---|
| `billing_configuration_data` | object | **[billing_configuration_data](#billing_configuration_data)** |

### Billing_configuration_data
| Field | Type | Description |
|---| ---| ---|
| `bankslip` | object | **[Bankslip](#bankslip)** |
| `ted` | object | **[TED](#ted)** |
| `pix` | object | **[Pix](#pix)** |
| `account_maintenance` | object | **[Account maintenance](#account_maintenance)** |

### Bankslip
| Field | Type | Description |
|---|---|---|
| `bankslip_fees` | object | **[Bankslip_fees](#bankslip_fees)** |
| `billing_account_key` | string | id (uuid) containing the reference to the account to which the fee will be charged |

### Bankslip_fees
| Field | Type | Description | Reference |
|---|---|---|---|
| `registration` | object | Registration fee | **[Standard fees object](#standard-fees-object)** |
| `permanence` | object | Permanence fee for registered title | **[Standard fees object](#standard-fees-object)** |
| `protest_removal` | object | Protest removal/negative removal fee | **[Standard fees object](#standard-fees-object)** |
| `protest_request` | object | Protest/negative inclusion fee | **[Standard fees object](#standard-fees-object)** |
| `protest_costs` | object | Protest costs, for this field **expense_type must be 'percentage'** | **[Standard fees object](#standard-fees-object)** |
| `expiration_date_change` | object | Expiration date change fee | **[Standard fees object](#standard-fees-object)** |
| `rebate_inclusion` | object | Rebate inclusion fee | **[Standard fees object](#standard-fees-object)** |
| `discount_inclusion` | object | Discount inclusion fee | **[Standard fees object](#standard-fees-object)** |
| `notary_office_payment` | object | Fee for title settled at notary office | **[Standard fees object](#standard-fees-object)** |
| `expiration_write_off` | object | Fee for title written off due to elapsed time | **[Standard fees object](#standard-fees-object)** |
| `write_off` | object | Fee for title written off on request | **[Standard fees object](#standard-fees-object)** |
| `protest_write_off` | object | Fee for protested title written off | **[Standard fees object](#standard-fees-object)** |
| `protest_removal_and_write_off` | object | Fee for title written off with protest removal/notary return | **[Standard fees object](#standard-fees-object)** |
| `payment` | object | Settlement fee | **[Standard fees object](#standard-fees-object)** |
| `fine_or_interest_inclusion` | object | Fee for inclusion of fines and interest | **[Standard fees object](#standard-fees-object)** |

### Ted 

| Field | Type | Description |
|---|---|---|
| `ted_fees` | object | **[Ted_fees](#ted_fees)** |
| `billing_account_key` | string | id (uuid) containing the reference to the account to which the fee will be charged |
### Ted_fees

| Field | Type | Description | 
|---|---|---|
| `outgoing_ted` | object  | **[standard-fees-object](#standard-fees-object)** |S
| `incoming_ted` | object  | **[standard-fees-object](#standard-fees-object)** |

### Pix 

| Field | Type | Description |
|---|---|---|
| `pix_fees` | object | **[Pix_fees](#pix_fees)** |
| `billing_account_key` | string | id (uuid) containing the reference to the account to which the fee will be charged |

### Pix_fees

| Field | Type | Description |
|---|---|---|
| `incoming_pix_manual` | object | **[Standard fees object](#standard-fees-object)** |
| `outgoing_pix_manual` | object | **[Standard fees object](#standard-fees-object)** |
| `incoming_pix_key` | object | **[Standard fees object](#standard-fees-object)** |
| `outgoing_pix_key` | object | **[Standard fees object](#standard-fees-object)** |
| `incoming_pix_static_qr_code` | object | **[Standard fees object](#standard-fees-object)** |
| `outgoing_pix_static_qr_code` | object | **[Standard fees object](#standard-fees-object)** |
| `incoming_pix_dynamic_qr_code` | object | **[Standard fees object](#standard-fees-object)** |
| `outgoing_pix_dynamic_qr_code` | object | **[Standard fees object](#standard-fees-object)** |

### Account_maintenance 

| Field | Type | Description |
|---|---|---|
| `amount` | number | Fee amount which can represent either an absolute value (absolute_value) or a percentage (percentage), limited to two decimal places |
| `billing_account_key` | string | id (uuid) containing the reference to the account to which the fee will be charged |

### Standard-fees-object

| Field | Type | Description | Reference |
|---|---|---|---|
| `amount` | number | Fee amount which can represent either an absolute value (absolute_value) or percentage (percentage), limited to two decimal places |
| `expense_type` | enum | Fee format | **[Enumerators expense_type](#enumerators-expense_type)** |

# Enumerators

### Enumerator _Expense Type_
| Enumerator            | Description                                                                 |
|-----------------------|---------------------------------------------------------------------------|
| **percentage**        | Value in percentage                                                      |
| **absolute_value**    | Absolute value                                  |

## Response

STATUS 200

**Response Body**

```json
{
   "billing_configuration_data":{
      "bankslip":{
         "bankslip_fees":{
            "registration":{
               "amount":10,
               "expense_type":"absolute_value"
            },
            "permanence":{
               "amount":10,
               "expense_type":"absolute_value"
            },
            "protest_removal":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "protest_request":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "protest_costs":{
               "amount":20,
               "expense_type":"percentage"
            },
            "expiration_date_change":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "rebate_inclusion":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "discount_inclusion":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "notary_office_payment":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "expiration_write_off":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "write_off":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "protest_write_off":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "protest_removal_and_write_off":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "payment":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "fine_or_interest_inclusion":{
               "amount":20,
               "expense_type":"absolute_value"
            }
         },
         "billing_account_key":"f6bc82ae-8ede-424d-9450-242a8c9d2435"
      },
      "ted":{
         "ted_fees":{
            "outgoing_ted":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "incoming_ted":{
               "amount":20,
               "expense_type":"absolute_value"
            }
         },
         "billing_account_key":"f6bc82ae-8ede-424d-9450-242a8c9d2435"
      },
      "pix":{
         "pix_fees":{
            "incoming_pix_manual":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "outgoing_pix_manual":{
               "amount":20,
               "expense_type":"absolute_value"
            },
            "incoming_pix_key":{
               "amount":30,
               "expense_type":"absolute_value"
            },
            "outgoing_pix_key":{
               "amount":30,
               "expense_type":"absolute_value"
            },
            "incoming_pix_static_qr_code":{
               "amount":30,
               "expense_type":"absolute_value"
            },
            "outgoing_pix_static_qr_code":{
               "amount":30,
               "expense_type":"absolute_value"
            },
            "incoming_pix_dynamic_qr_code":{
               "amount":30,
               "expense_type":"absolute_value"
            },
            "outgoing_pix_dynamic_qr_code":{
               "amount":30,
               "expense_type":"absolute_value"
            }
         },
         "billing_account_key":"f6bc82ae-8ede-424d-9450-242a8c9d2435"
      },
      "account_maintenance":{
         "amount":40,
         "billing_account_key":"f6bc82ae-8ede-424d-9450-242a8c9d2435"
      }
   }
}
```

STATUS 400

**Response Body**

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

```

---

# Income report

URL: /en/documentation/contas/informe_rendimentos

## Request

ENDPOINT /account/ ACCOUNT_KEY /income_report/ REFERENCE_YEAR
METHOD POST

Request Body - Individual account holder

```json
{
  "partner_logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAAiCAYAAACUc"
}
```

| Field | Description | Example |
|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------|
| `partner_logo` | Partner's logo that will be displayed on the left side of the header of the income report if provided, otherwise only the QI logo will be displayed in the top right corner. The image must be provided in the standard used in html data:image/png;FORMAT,base64 | data:image/png;base64,iVBORw0... |

### PATH PARAMS
| Field | Type | Description |
|----------------|-----|--------------------------------------------------------------------------------------------------|
| `REFERENCE_YEAR` | number | Reference year of the report |
| `ACCOUNT_KEY` | UUID | Key of the account you want to consult the report for |

## Response
A blob (base64) will be returned that must be converted to the income report PDF.

STATUS 200

**Response Body**

```json
{
  "income_report_blob": "JVBERi0xLjcKJfCflqQKMSAwIG9iago8PC9UeXBlIC9QYWdlcy9LaWRzIFs2IDAgUl0vQ291bnQgMT4+CmVuZG9iagoyIDAgb2JqCjw8L1Byb2R1Y2VyIChXZWFzeVByaW50IDU3LjEpPj4KZW5kb2JqCjMgMCBvYmoKPDwvVHlwZSAvQ2F0YWxvZy9QYWdlcyAxIDAgUi9PdXRsaW5lcyAxNiAwIFI+PgplbmRvYmoKNCAwIG9iago8PC9FeHRHU3RhdGUgPDwvYTEuMCA8PC9jYSAxPj4+Pi9YT2JqZWN0IDw8L2kzYWNiNTAyY2ZjMzRmMGU0N2Y0NjlkMDJiMGRjNzExMSAyOCAwIFI+Pi9QYXR0ZXJuIDw8Pj4vU2hhZGluZyA8PD4+L0ZvbnQgMjcgMCBSPj4KZW5kb2JqCjUgMCBvYmoKPDwvRmlsdGVyIC9GbGF0ZURlY29kZS9MZW5ndGggMTU1Nz4+CnN0cmVhbQp42u1Y3YscNwx/379ingOZWLLlDzgOWpo+lJI25eAKpQ+7s9lQuLQk/f+h8tgey/OVLUnuXo69vR3LsvXThyV5oFP8eQn8zxvovQ/Omm74cPh4UL2jcXZ6GMnpM9K7T+8Pr47Qq+79vwdveIfOIvVOKeddR7a3wapguk/vDl53/GfRTbNezF5eHPgBHBYaBteDclq5DsD3qDQgRc6gmQ0qW5jYUAk23tAoPc3JjW1PQRs/29corNxif1+459t/PDhQRRkNbLoQEEL3Iaoqxg9pjHXcrBP0+xeHv2fMwl6oVE8GjKFsTiGjYUPBxjjftkgJTG+MsuzkEakYP6SxruNmnaCPSFci4Ftj1zPseoZd0zp2Sd/GLtgEKGt6tGhDgS6ESi4ruJbIrYqPWlOODzFOyDmOp7FELulPgxxnyLFFbhFWkTf0beSCbQe5EPo/kHvbB2sVUUZexwm5pzpu1gn6kyB3qkUuxg9p7FaRN/Rt5IJNYALjGJSCCbqQ2rAFwbbE7jnrIyuXodfhQxrSNGwWVfJT4XYtbtfidm4VtyBv465cO4FSBV4fJ8Fgb7himwxajB/SGOq4WSfoT4HbznDbGW6r13FL+jZuwbYDXAi9Hjko9NwMgTWQoEvCQya4SmiXionHQx8/o897bmOU4SfV6bHpumcIMEKAruEY27yQ0L1k3nEBE1/9pY/DiRQOl0Gbi3pn3MXYcFZ4UufBAUD3wz8sNH2W2n1/l+Vxu8mlv0fHkRO4EQu9doFbvu6Ohfx2/92b33/kZqC7uxz+uFEsTikCpUzgX24liPireOz5n+bfIY1J53muruTS8zjvKm9cG5/H/SLdJDowHcqvvf2zu/vp8Poum8+CrUdn14yrnI9hTlDcPgfog/MaRzO+uf/l57e/8kQxozbJlFFdbZN5jE3miyYp5pDmks9ok/mOp0wfWjNjoRUTizltbzUxBmCzo4m/ycQNfuQW08IY06zA6HkWqXmJjtufb42KW5yzx2z2Fs+DE96LYy/GmJ/LN4pXeb1fg8HNFFIgN6EYksFGFLSCQEqfJK/tzMWQYzjWIKHgiao9zbEN2+mZkm/GsM2+W8AYZiIN1AuQDI0xGKQDo/MvWYDQb9Tb3ZK5SU7TvgYPmm1hG36MO4YcBgV6/J6yz45RhawO5F+Xv1s+DCuWlkgWrsy2i3akHO+NHb1wo82AKAvTO4KWnjXJm8ehem30sJmpP6m0s7vjW6hRHh8lbOL1jBuE4A14mZCBpkwyT6JDTcjFsiURT9kmBtk5Z5phyXMsmcLdOrzJWWRIKpCv3jqymY8ksk6cO2X7XjJvtjWFYu+Ziki691p5i532fBNF47ApPmAnXSGbMB+UKbuda/HYLTAbtpncYETxic/HpTsMVxV2lw6wkdmvlFlCgoRNE5aZTKtDT6Q12s6glF2kKSfQl0Aq5+YokrBZ0Ya7VM8nKto47xhuA9zk6nOpRX60Z4kTV+cXlSkmKozpZeaDcjw29TR81QOymo8bLVBJPYt+J3FiIevvVnS0ga/aY6/3NXWkff1i3C91ZMXQuaDZl26BSuoYcr5zV/gw2J7zEdrGWlfH4CXPm5wXdn1UY5HUmtQmFudleMh6RL+FpR7EfTVx8kb6OplubFXt+vwyC1nVx8TFR4sCcrfIVt044WP9ef5+wXfpe0t8N/OlXf7yIrdTuI46F6NS/PIaglpEMB/2UshKN7ZW9JrEYFJhLYWPZnMjVl8Ty14YWm40rHKW7HMYPlYYOu366KRUeJZxiCIOS9xM/p1dudrGau5n7nQc98LKds7Z3sfChxtNj63x0vSTPp2B6To4b6VV7TOJ2maoxOUi/uJLJIQe49sAt9HgXIFnaqBw9tzc7PebgBbHosBYcSkIuciUm8ppRSvjes9Hiuqt6xo9rMBuxB32s3rUQrkiWepxyjoUPXQu+lAagKUugUuvBkCAjSjdeTkgo7ZoKbPl0dToluv2MlXQpmfcZNxzpnqsTBW4SSGnORQ2YmDrPV2uYKecAaZmqWSK/O5uPBV+WWWnSug/30iBQtXroNHgc2B8y8B4fTe9mXz7Hz3zhdAKZW5kc3RyZWFtCmVuZG9iago2IDAgb2JqCjw8L1R5cGUgL1BhZ2UvUGFyZW50IDEgMCBSL01lZGlhQm94IFswIDAgNTk1LjI3NTU5MSA4NDEuODg5NzY0XS9Db250ZW50cyA1IDAgUi9SZXNvdXJjZXMgNCAwIFIvVHJpbUJveCBbMCAwIDU5NS4yNzU1OTEgODQxLjg4OTc2NF0vQmxlZWRCb3ggWzAgMCA1OTUuMjc1NTkxIDg0MS44ODk3NjRdPj4KZW5kb2JqCjcgMCBvYmoKPDwvVGl0bGUgKEluZm9ybWUgaW1wb3N0byBkZSByZW5kYSAyMDIzKS9EZXN0IFs2IDAgUiAvWFlaIDEzNSA3NjYuNDM5NzY0IDBdL0NvdW50IDgvRmlyc3QgOCAwIFIvTGFzdCAxNSAwIFIvUGFyZW50IDE2IDAgUj4+CmVuZG9iago4IDAgb2JqCjw8L1RpdGxlIDxmZWZmMDA1MjAwNjUwMDZlMDA2NDAwNjkwMDZkMDA2NTAwNmUwMDc0MDA2ZjAwNzMwMDIwMDA1MzAwNzUwMDZhMDA2NTAwNjkwMDc0MDA2ZjAwNzMwMDIwMDBlMDAwMjAwMDU0MDA3MjAwNjkwMDYyMDA3NTAwNzQwMDYxMDBlNzAwZTMwMDZmMDAyMDAwNDUwMDc4MDA2MzAwNmMwMDc1MDA3MzAwNjkwMDc2MDA2MTAwM2E+L0Rlc3QgWzYgMCBSIC9YWVogNjIuMjUgNTk1Ljk2NTM1IDBdL0NvdW50IDEvRmlyc3QgOSAwIFIvTGFzdCA5IDAgUi9QYXJlbnQgNyAwIFIvTmV4dCAxMCAwIFI+PgplbmRvYmoKOSAwIG9iago8PC9UaXRsZSAoTmF0dXJlemEgZGUgcmVuZGltZW50bzogMTIwMTcpL0Rlc3QgWzYgMCBSIC9YWVogNjIuMjUgNTY2Ljc4ODc5NyAwXS9Db3VudCAwL1BhcmVudCA4IDAgUj4+CmVuZG9iagoxMCAwIG9iago8PC9UaXRsZSAoUmVuZGltZW50b3MgSXNlbnRvczopL0Rlc3QgWzYgMCBSIC9YWVogNjIuMjUgNDI5LjA1OTI2NiAwXS9Db3VudCAwL1ByZXYgOCAwIFIvUGFyZW50IDcgMCBSL05leHQgMTEgMCBSPj4KZW5kb2JqCjExIDAgb2JqCjw8L1RpdGxlIDxmZWZmMDA1MjAwNjUwMDZlMDA2NDAwNjkwMDZkMDA2NTAwNmUwMDc0MDA2ZjAwNzMwMDIwMDA1NDAwNzIwMDY5MDA2MjAwNzUwMDc0MDBlMTAwNzYwMDY1MDA2OTAwNzMwMDIwMDA2ZTAwNjEwMDIwMDA0NDAwNjUwMDYzMDA2YzAwNjEwMDcyMDA2MTAwZTcwMGUzMDA2ZjAwMjAwMDY0MDA2NTAwMjAwMDQxMDA2YTAwNzUwMDczMDA3NDAwNjUwMDIwMDA0MTAwNmUwMDc1MDA2MTAwNmMwMDNhPi9EZXN0IFs2IDAgUiAvWFlaIDYyLjI1IDM2NC4zNjIyNDQgMF0vQ291bnQgMC9QcmV2IDEwIDAgUi9QYXJlbnQgNyAwIFIvTmV4dCAxMiAwIFI+PgplbmRvYmoKMTIgMCBvYmoKPDwvVGl0bGUgKEJlbnMgZSBEaXJlaXRvcykvRGVzdCBbNiAwIFIgL1hZWiA2Mi4yNSAyOTkuNjY1MjIzIDBdL0NvdW50IDEvUHJldiAxMSAwIFIvRmlyc3QgMTMgMCBSL0xhc3QgMTMgMCBSL1BhcmVudCA3IDAgUi9OZXh0IDE0IDAgUj4+CmVuZG9iagoxMyAwIG9iago8PC9UaXRsZSAoU2FsZG8gZW0gQ29udGEtY29ycmVudGU6KS9EZXN0IFs2IDAgUiAvWFlaIDYyLjI1IDI3MC40ODg2NyAwXS9Db3VudCAwL1BhcmVudCAxMiAwIFI+PgplbmRvYmoKMTQgMCBvYmoKPDwvVGl0bGUgPGZlZmYwMDQzMDA3MjAwZTkwMDY0MDA2OTAwNzQwMDZmMDA3MzAwMjAwMDY1MDA2ZDAwMjAwMDU0MDA3MjAwZTIwMDZlMDA3MzAwNjkwMDc0MDA2ZjAwM2E+L0Rlc3QgWzYgMCBSIC9YWVogNjIuMjUgMTcyLjcyMDA3NiAwXS9Db3VudCAwL1ByZXYgMTIgMCBSL1BhcmVudCA3IDAgUi9OZXh0IDE1IDAgUj4+CmVuZG9iagoxNSAwIG9iago8PC9UaXRsZSA8ZmVmZjAwNDkwMDZlMDA2NjAwNmYwMDcyMDA2ZDAwNjEwMGU3MDBmNTAwNjUwMDczMDAyMDAwNDMwMDZmMDA2ZDAwNzAwMDZjMDA2NTAwNmQwMDY1MDA2ZTAwNzQwMDYxMDA3MjAwNjUwMDczMDAzYT4vRGVzdCBbNiAwIFIgL1hZWiA2Mi4yNSAxMDguMDIzMDU1IDBdL0NvdW50IDAvUHJldiAxNCAwIFIvUGFyZW50IDcgMCBSPj4KZW5kb2JqCjE2IDAgb2JqCjw8L0NvdW50IDkvRmlyc3QgNyAwIFIvTGFzdCA3IDAgUj4+CmVuZG9iagoxNyAwIG9iago8PC9MZW5ndGgxIDg4MzIvRmlsdGVyIC9GbGF0ZURlY29kZS9MZW5ndGggMzYzOT4+CnN0cmVhbQp42u06a1hUR5an7gt8ERpo8BGUtnkElRhpGpMYxTjSYoYAAjJIjPIWFOhGFLhkXEXWtAhK4qggMQQJQ9SQDfE9jBGUSdQxiWOia9SMqKzjzsZNTNYkM0BXz6nbDyFrdj+/nf2++UGd795bVffUedY5dfoBBABGwTrgIc5gSHz+lfTWBgDNdZx9dN7cSIN4UfwUx/04Xh+bMDU0v+OAAYAk4zgpIz/N5DLD1R9g5KM4/t2ytCITuCCA5gKORy7Lk7NfqS78LwCP0QBuUk5WWqa27qsmfPcFXuE5OPFIuOtJpOeFY/+c/FWl1jbVPRy3AQzPyzNmpN1Rfb0SSaE84pP5aaUmrhnK8P2TiO9XkJafNeHTpyKw64dzW03GolXWq5CC/A+y98B045Yc/SF5XdjSR575Dia4AmtX/rPBzJ43PnjrlDWHPuUaJWUjritwYGu4zqWC+gK4llhzrFtdoxRKAxr3GpvB+zS02zy8Br/ncEwEM3cMRJRbJ+5EkuNtT/4SZHMeiCK58qIkcpyA+PzAxXHZkZkoux98J3lRL1LvUkF6UgHe6L7E3gofQ7aTzRl46MbHg9HRF1+FVLx68arEq2YgHo6bnHzuwbGfoifprXelLkiVlkCSdBefYyB1EL/jg8esucQxHw2g0YJynAKzeA98HkYXNN1mcSokinUwVehWnomiDyTyhRDh5D8cDNwta46j71oCBvE8Xkm2dQqd6TBDKIdkfj9Mw3dThRbcRWz+AzufKoiC/+cmAEn50ViCf+Cm2H3ANUj2btuY+eKhaCY9HP5QG2pDbagNtaE21Jw1kfnvRKdeqWRt1amXvcb1whdYm8NjWJ8KWDH7QQjoYDo8DZEwH2Lw/M6G5WCCYijFOr0HbsOf4TurVanGQ+AJBfNZBTMe0iAX8mClgnndgWnt+R/hpA1+XI//n5qbAjNR9go4aYfPFaADgUwkKaSaHCZX7XDXAZyHHaK5au6tn4Aj3D1+Ep/Mb+FP8HcYCO7CbIREoU7oEr4RgxHixC3iQfELsVfslSYhRD40JNph9d8Z1klV0g5ptx3eQfjNT8AHQzAEQ/APDJf+d3Bh2d5IGrgerpXlf0+NSmPkVlmquVb6LTsVUq094jTxLoxgn9gDQsNV7oHaiZLK3dvHD1TuoFHu3JnSRYtK2UUv0pNkFplMJpFZ9GTyFXKEHLx2hUbR+VdWkxpSgvAKNdFKhELk3Ms+eyP14QAavUYl6gOQv5qMIaPpGUSdQcbIwtGj22/2VsqIXYnYlxF7HADRqsLDdX6C2ktyIRq9TqXRT/f30Icx4YhbadnXZcSXRLT9haZyXZV9bX8k447VVBZvETLJnICAP/9h25e76ddt9Ll7O7uIx5F3DtUg9RrU1A2pT0IrOGl7e6u9BM3EwCCVzttbFxrOOGj19s5EyUXb9s9/KSZuRNPS2NVJD9EPi/sq5RG7NtW1vPPGnLBfbataX7zJTRb3abUnDpr3+E746L3z3Y89RqK2bN/7WlNb6UbzWnP5S+x7qCbU7bZ4EU9aIERLNGqtSiPcttSd5ZItEyqFSOFSX7DQ/ntyC31yzNrDTefv2HziGRauC0UpJe3EQNWA/jFjTIzJGBtbwJ6mmBgjHxJrKoyJKSiwdLGJWJMJ/Wu9CyBFI99HwAMANSMIajQor+F1ary5l3GhX3O6LZbIrS9Zzq3ZL5Bzf5LFxb3Nskym0XMyp+VmsMohFenEIx0P9I4/gA5dotVrBhqRd5hP5eikdnTwq4mKeLzffuMufY++RitaW3a/V1HTcbT9/RpZ6JGP/mbDLi/1h83XPuWz15SvL+7zrXujsYHZKwm99T16aywOJMG2DTWhgo9KG4iO4VTuHshluvj9DPoJpfRlOh93YtkG4rd7bdAne69cuPDF9vcnk323r5PdJItkk92zn6WvHvst7aAHEDpb9ih7H3WqV3yixr2vC/VQuXNaLbGrpnDkGqv+4/LnX1ZZOjs6OEq2kn10ITXKZAqZRyLJZDQTakHX0Vq6na5lciNNsQ1p+jhtpFwae5890SzirE2WamKurKQyZ65UaDReoprjlv7jluZLtNFOiU9FSiOclHDP6NTMqNDZydbIfb4yw0xBPShiejoxiR0dOzp1SkcH+YzfcJwb3kF7+/OPs6V93fweWe5tFqb3z5EdttiPNBTvEm9vH0/cJnyg4k61ZoC3AxzeFSIWlYVc2UnVX0WmJc3stAAKlkgEMu6MZUdFdW1tdQV3edTiX9BUmXRVP2/5o8z4nu/cdUhTt3nzDia3GX0cjT4OBph+P/6CggID9WH+950tqb28fXzskerfsNb3847Xmgpar1/dT4LI8Aoyrm6t7+8ObavNOXv9D7+lp+n5rfR6FEnf01K8MiVz8vQnTx299sOUKfRwfc2y7BfTwqaHfXHi5pehyB99JHYrsQFKimEGU7ykU5OiD+mySvG0mWaekoXP7pDVtOpOXwjLUpuFr7gWKZtlUxbJpJlwzbRKyqYbSSmzZCJqBcJc8MXaGohiPYkFrB6DV+dIK3olAxG9TTtUXMipo5KhteDNd/ss7WXrlheNLlz6USEmuWG0YUPG8udj4zO5zZY7sjkx7t03D+yPKH/pFxm3Jk68YLl2MS8rKzOPcZ6KnA2SF9b2GmZRpgmyCWUbGfkHoSDEy9uZ29Sn6khvSJ2ph4i0r8dUF0Il0rt0ef6iRfnLl8qittRSnbAA830fwoUFCWaZZLe3tN269W5LO1oBtRQqUEslPiWtPT69B7iMxadQEfjl7+m/0dMkjHgYb642uf/Tym1ryjatKHcj0YcPkEAygriSxyZNopfNFad/+ObculK7BXNQj5FMD2KXViEoOqzJ2OkUdnoNb0zNLViUkp+bStJrqUvITtNNaiH8TdPOENSQdOe2t7x761ZbS6tsTliAkSsSiUxakED67byEdtTDBR5FXjZWalFjl18nCVrHOcjrY5a8EMtdtQT8clPRFq+WyVb4E71DL5PHyShUYiyX/Oneli6PEtdPjpStOrQPt4Yb042eQWtFYCx3o0aMh91Aao1a4wwtnV7J7D58t8n155FxUWQE/e5jy9O1DQ03ry5sihGHx0QXlVfK/WdlmdfLG9474umJshvQ6ZeQ6giWvwaeE8QZssdMC2KNxtgFJlJRZzHW1pK/iokLjEacLOhbrRDDMyKHPsXNVOiMH0zHk20hpRek97HF535jPDt2FpiCkdbtG89snF/IzZgz/2lG1hSHZOk+uW/xm295ed4kcfOWKGefQ85hLMs6JOMi7ALJMttsdjzXKPTFEzgIV6SwG8jmlgcNWJpTUIWrz7UWHTlUZzGvnZmwJGetpXHtrPil+NzIeMxqLFjfxMvL086dt1zEk+37Uzmvvmz5dmAPTbHjxaQMuxxikxLBzsz7YHEMjPbs5jUHjtRZNpRHLlyRuV6hszTxs48ZH05vzn39baqVHXlBQKqDKy2W2wZWWq2mF1IKCxcvLqS36QkSgaXSWKy0TiR2EhSs4wSlJwux+pKICwmml+hfaS+9yCKfJokGpD0StKiAekCUBzikd2QBmw5csCPSacOP0kCzJb2Oi8q1x7oSNPezAI2SWQ7EkkCIRn6jWYazb+j/5pHoQikuetXLJyyG2iZOCHv7lxMWCTratTDho0N0sWLw940rhiG1ZIzBEKT2oHMgXDcoqTjPgcDUQrcd5XlF83O3/nrb3d4lF8sLh1WuyzPOTnj1fCO10m8yrk0gwSVrfm6YbRgbELxz/Tt7J2jovfyCyDnhs9QB+l1VB98ej7ynWXv4PWKhUmlp2SGgYnHpiH4lb5+tryfpJIhenvL07Fnc9mGvd17dxf+LTJ6jh2XL6qq5SSmN5ZVHkBbLv1VCEIwZnPeVRGxzCXaFe7VUilD2DOmdk7wio1wI6o+37Rlusmz51YcrGlrJVbQy++1KuIz03PB8IsqBThyPM9S8mksvx8wzsorUvETNKJBsSeUaZbk/Hmzfqgif4VpWS3vaF9kKP1552Clx545VkIbN9BvyzGbL4srTZ2roc3VkLD1XwlWWcy3EVZbpBmrAQBlN/x3vmwmWDYx+FNI3IP1RLEZs5axaKdSjuHSqL+GvWV4nd0pk/qnDZHJJ/6lOTIN4XKYIX/FF9rMTVeIWEx9a1czOTvZWokbuLAqOdYzG256CgoKc+4GLnzWjXH4iO4yELPR/JkKjm50flpQyatQulcfUkEfnzLVabWevlO0RCHMB3CX4WTI8YLb4QbPcxgGzSc7ZetssNbLTDmcxN7i7QBlUgR1baFdoRCnzxffnRUGhEs/muXpoVX6NNqP+Muov4UBHtEEuWmL+lkDzxYuKEW7cQJx6cRyfLSWx7ONp2/8TOMUEOptFpnJKLNQvzw6Y9/g8fop/8LQCpR9FQrAv+rpvrR0zfirna5hp65Hxhpm2n2uxUsTPgwLmYTiufB/I+gSj+Li9z2Et/K/2Pg8T4Zq9LwzoizCaONZK4EdGw8/ACCaQYSXkwjLIgVXgh7VPBsazH4RiNn8CdNhLRww/mIM4q6AIr5WQBWmQD1Nwdj4UIP7j2HsW8hD80G4OWkXKKAufWbimGO+ZiDkc/ZMFy5FCEqxGjAzETUMqyxRMP+wz+n5IpQDvJsRJR7q5iOeH643IN01592M6CQqXXMhGSY24IvMn3/s5MZKUuSKcNSrcQlE+9l3qwJX314U41zn/L2D9fPDv6IP+geCKJ7RVwVSi+orZWDPwvw/Kk70Z6Vzhidjsc787AsGRN97HIhDcU75490fvELT7FJb/EAjoUVqC8s7HezQ8j/dYlJjAQliE9xcQCLyIwD7H/hrvexEIvI1A4Aiw3Ad/A6BmRxoKZW5kc3RyZWFtCmVuZG9iagoxOCAwIG9iago8PC9MZW5ndGgxIDk2NDgvRmlsdGVyIC9GbGF0ZURlY29kZS9MZW5ndGggNDI4Nj4+CnN0cmVhbQp42u06C1RU1drfPo8ZMjIGGUkLBYZHlo9kHJCrXU2M0JTMuPxeKnkjnOEpqCmapikgguID0AzIENMUwdSLrzHxid4y8xL5yhRJMDXvTYlGZs/99pkZHO111/rX+v9//cu91z5n77O//b33t78zc4AAQHeYBzxEBQeHjV8Ws7kMwGsoPn3qpdEvBvMH+ZM4DsNx3PgXwkIeGeFXhOM6HLe/8togv+QVNZcASCKOw2NTotNFpTgc4NErOF47JTozHZRYwas/jh2nJM9MiD084e8AqpXYuifGR8d5rr65DueuY/NPxAfdPR0cEZ8Xjr0SU7LeEjb3nITjTwG6eSWnxUY3Np99HVHNAxBdUqLfSueWw3/hfAjCu6dGp8Q/eVznAOBZic8S0tMys8znIAJRObJ5YLJyk+ueOeb058jHh9+BvgiK5eyNshx2v3R4w1FzGA1UTlYk4NABOLAUXKdMoW54LTaHmU8qJ8uY7AqXx57g1Q/1qMF2/zyHYyL0JstARL614mpE2cdy55sggXNGEIWCFxUixwkIz9svnpDwYhyMRO5/VLhQF7JGmUKaowDKLzaxWeEzSOgik38/V6IrVMMfFG47ROC6A9w2GT4HmxFbPra12EYwHNjysG223t9B2MbfwiceNd8WL0GGoi9kKiTIkJ8VWO6s8P0gg9eZw+zXoIPEKZZCphiD6/CuUECGmI30wsFFYYAoxHkd/sMiHIYEsS8ME7Lle4Kw16If1pflXQpju2RfCsOUxTBW9IWxwql7cPxpHD8JmXwADMO5APhfKAKQPPh/VpgtbPb4XbhTfwzzsDwsD8vD8rA8LA/L7+URcEDOQC1ZpYs1N3XBiVy89wEnfNIds0sv+BOMhmDMjsIhHqZAEqTBNLgGP5rNcu7sBQPgBZwfA6EQLc8nY1bXxubNzb9R6831D2bKf1gm/KK+CZnwDtTCMfiZBJDXSSH5O7nM9eMSuYL76ifcdd6dH4c1Va7v8uut9YhAhP6CXlgvXBHM4rPimF+tC8VdYouil2IM1nysW+V6UKlU+infwLpCuVvZ7vCUw4v/jfra/1id7JD0i5r1sD6sD+v/8ZqDEbmanhZSFC6ggMdgMIC3v79uiI8vr1CoXXq6EpW2Z09XlY+Pboh/gEqrYgONj48vdtQuCqVKg1PctowZ06fGTZmalE5jkoXS4u92nz8UF7/nrymOi6e3H249HRf1+ehuqZHhb/Xl3lMmTZogeZhCiEveEp60jNywuKLekTjS2w6D+1Fj1qJH6PCgLUVVxx6n/yLdOS3G9AjSxEVwmexM6eGh9ojggAKXuRZnDpibyQm4CY8CBAzx1/oxljSePgfGBQaEhgYEjkscGho6NCB0vPyrinkUt01sZFiIlmg45wrTzQqx8ecUPK9yzM3CUvEW4nFF+f2cVU6cxpNTOTm7eoLKCbR+7Mrlry4tXc3aj/QHovrxNnGit4LJBPIaCSMTaA3dTLfQmlhSSlJJGimlibSILqeJjLYRD8TbiL8bgIfOQyXqvLUqDzXREIGeJsmLiSAJZw8uuG6cJTHofDxJQxH6KRxoVP4ol6B2IQol8dDhMh2R7aPxVBBFuv5MYhvpTj9/wpHmcGnTOp8nh4vnvb946Vohg3QLHH65/hw96YpzdbQyhRwqvru4ZFMhUliL8s5FCs+gRv2telMygwoenmhatLjWTyai0Vk7ngql5ui0psnn2jetrTtBr9KOaRdT07tVl62u3VkT6bd167KcnFWPpYvF/Qfu+yhnh3vvpo9PXfTTEs9lK2vX1OxIKFq+IH/e2yw3GIHS1SBtDlQon4rYpGIa8VBpuROU43eaJt0yZXGFR4gbbb5FjHzvzu+oQiLeKfztzm56eg5lqEYZZqI9+yIWXMjEALULPCAA41slKExhQ/LD/0WeoC1mmPJ1RsYjH64o27SxPCJPFy42VtIwLy96u/UG/YlxXFj8xcH6kyODuJvIYx5SKZY9w5t5hhUnbgzeRlAju4iHX09XNe4LdBuurKC0tGBpcemu0ZuTLxKetrWZ6C0yini/Uv16huP81HpD8Mn6+pPH9h39irv18lik3IwONZNMJrmkuk+f9niJnmV+sBk1tQAldMAB+oqHWqPyEBaY6lZxA0yh0/gmMc1YJA6uI2+gTzM+C6wePAjhbWyiGni7vsXIGk8vtpvlPW0xPr+7fNmyctb6LZ6dnZ+fPXtx8iYDbe/4id4xfFzyQceZMx0fkNKK2tqKD2pr+em5paW5eaWlDa6flX/Z3Pxl+WeuT27N3X7y5PbcrczG71i56cW0RhS4J0E3xLqNmIF0soGciY0t1CpvCKpO+YaaiWubiTxODfQ8aiv9sfkp9QZqKCwpKSwsKeXef3kscWxtJiqaQ9fRt+jEPn064pOJt+CJCv2iARXKqDdiVLjIz7TsZvu4oLLrN44fOnT8uMDAceOHBo4bFzh0vBwrho4fzx2yPgfOfBtAPIcW4MAZ5fAgRKfF2KFVo8vyHrxWTdZwXvSmKWQB5/IRp15hulQ1x7RkTiXnxh256yaJeuMqSSIhtE5CC2UgrjjZmirMb8Hbw+JMHrYdpkHkKo3Ow34zEiN5dnvV+h20kVaWlFRSOsNg4C5dbilfbThMW2mTtHbTxvekt3Pz5hiLJRH0u+oWljk/cbDymy+Z/2Sam8VKtIIbswEa3cfXh9MxVxXkEG6JcEg9QKwcRRtuLjdGp6eQ5WTMLOJSnuF9seGH9vYfNnz9HMk/1RQXnU7ctpM3yMcjX6Af7d2Gke5vtI5uKS9D3TDJbsuSqVEurbtsZZs4lhEx7kYPDqDH6fndshATyXyylU6gcyUyjvhjDbFIQKfTD2gFzWL8M7wBiBexai3I5OZh7WvVGQaDcCTb9GdCs7Mp94O8fvsp6riHOu0xvS1ZcXB1iONRxpnaulStIUaDaRey8ZJBktgyPcKaw2g414SwLhitddYQYgFXyS6zeSo/adKMya1chuHI+ZdW0DXfx0YXnxUD9Xrj/p/OeyK1OHOzogox9OjimFgRaPAcVcc1NJC5/NxjnGPDzM7RDYzw3QRhEK6fKVy7+76EukSbKdzkfez+4Ekkm2+IcwAGHlSqC6dUKPiQO0bjnXajsb3UjMZLSY/pXENeJMtSsRNKXiVjycvkVbqV7qA76VY9M+JTO3YQt/SYWBpOP/yEXkqLiQWrBXvJFuzF/NzqmTaHFFjIYPpGd3RYtXbtKtoh27D+W6Kgxm/p0atcxwelqyssFmw+8OkV0wVZFlony9ITPBE/8tzFvBOIqF6tGvMIOxH5KLqRSl1C0H/QDv/3Uvpu/GecVUo3sp5E3+Offk1T/hQ0cpfDqp8flNUik4J5z5NstxFMW3qg/Xl0e42qyxHkvda1E/nG4Pinz+ykFW1B6TEXT5sqUcY7Z29sMc0iviXLlpXQM1xLj9cn0hclcm7xq6btsud8sX9Nrc/S4uJCOWJj3GtBifth3FG52g4hX18Wab0w9Fj3nZxYudrOW0OmuGf/tj0ZOw9/tZV0v53YsSRDVbujbP3shl0nttBr9Ea2OQQzjE0fFuQkZwUMe6F+o+HLAc/S+rKCd7L1s4YHPL+v/Mx5P6SOfiuOQokfZ1kGO07xvLDuFJKzn47JFgdm0zH7JeF2G4lCKe86SrgqCj0uBlcxy1t81YnxrbI6Lm5eNBjpu58L2b+npWXPftJhoEZ6BOsdUdLrOzvp5cuXSR9ewH4r/Zh+R54ir+Fuuo7ctCDe7gCPcJZNp5EJkASyi9R9RHYWmb7fbLq5inMXpbuLhFm4DYoZRrRdAuoxXxiN+dLTyJWu6/jqIZuOnSfy0eVhO+F1chLDD7qRtyg3K7OgrpJWPl+hr/3i5hnCrViYOt8pMmpH+IWrJPTS9Flp8wvJXtOXUubY4L0V63eOmbkwLqapX79zbB8MQ7p1mAljGsEsyHTHMDurXTgWPpE2cbmXWaiv15Ik/w3Zhzo6DmVv8KclJGnFkoKiooIlKyRxpGRKiYukx41G2hAZVyWRaZ82XD5/4dvj+1HnTD43lK/3faejvXuwsCy4+X5T04oK7d0afyxery5YsKq0pHhGYW8yYtM2osWzcvCg5+itJfOufvdd6+w5Vr012/j3tumKRQ0Ldp0Hr7PLBgRtDS1lAvzccRgFqCYJdSuWFBYVFaIAUlVcJAkwGol/ZBzXT7p7Imn/8W8vnL/cAFY64ci/C+4ujBdWfrV2B71SFkQphHdeXVc2872+K/vfONBGW0jPy/8k3D8URblzlztx4NB0bu6crTUoSycZQptqd+8z7JLx00ChGfH3hf4sR5Sjr68tJN8nE/MnO4l0grazLenTSVHOi+asK7knGkmkpTbR+L2dr7f87ONzMTHqb4eW3pOySk+XWGX8FHkYi4xEic0YifH86WGXOfToCh9HgwYNDBo1aFDQ99WmazU1JFHMGDh69MBBo0bdfVqS+InsVIFhiGci2uQR+xOIVFab2mrRfdjxM1I+qZCecjLK/BwOLDm5NU5ZxPu1AdtNMqjgrVufuqGyinIVUWnZ71RQB+udq0KutGVxs6v4SdNmnDxlOiJJnPeHi3dvo72x1788x9Ljw5L2SenZVj6Em8iHW9cZpv51dsJk3B8m11RVUqE8aua8RRVM5n3Jqce/kunAwaI9nyB2m8dIiNX6hnUvj3a1eQym0lziypKSlStLSlcwr+/V1kZ60avB165caWu7cuVaLLoJJX70c0rpZxYvCZe9pCdomJdY2Pt956gxXav+La+4K+r1pOU3/EHWC38aqT3BaFn36YN24E9LYujLuUWNps+Ycvw3zRoQK/Sj7a+E7q2xqTlN392Sm/HbEBs7KXTa+08Khsn6MnHvpGCelykJBYtnz49cvTAv+6t9YbtjJSF3WtaMiJzlJQuvnphyaFjHjOlv/jU4fPCA/u8mLK/q/0zrlKyJE4NefWbAoIK0ki39mTciXV8xg1mhB77cqSxvXXb710d3Yd26XSSCVg0JDhnF5TsUFpW/y+/Vk7F0p970Zs64v0QWLSrYyDwlAG16TvC15Ax2kVmOmy7W9IlrJJOq6RrtOn3thioSGTkL3UTw7QyS9kppDU1coN60qn7Z3k9IM3vJyRNu8hMVCV3v6PlH6eZpigSaazZbYo4iwdkHQgCcFDB9MvzyKZfb9VSSn060wMpv4QcQ+wjErmDYe2h4XkM2f/R91okTWYwEvot32j4RiGC/XAu4Y8Eg/5bN+gQtb7D2MXLBV9Y+b/dcsOuL2P/G2legj7ZDEKRBOsyEqZAEUyARsjDHexpi0QfcwQ/3/XOgxV4MQrjDKITJgkxsUyEeoiEFI6E7jIFUhB+IvRcgGas7ymfDlSmP4vEej2um4zUOIbvBaOxJiCEcpiFELMJGI5YpMqQ79hl+d8SSitd0hIlBvEkI547r05ButDz3IJ7XZCpJkICcpmHVy7/kT0Wc7Lf8VFmigShPwH3r7q3q+u7E/DX7ZubXPxdhX8WgNXnLVzEAZ3PSltp/QyPf2Yxj14ruCM3+dWBfAhFwwihGMP/zxWs/rAS1OACvgyEQr6PRZ9i+HovXcVgJvIIaJBAGk/D6Mb5/E9iBlcg0usG30AoTYLgjKC/IxOZjpPTFLMf6fQrr3/dviHXMvleS+3/54z8kCGZL3PT/4J+LCAusrDtb3w7Hfc8j7Max9/rcUIC7TJ/Du5Y+jVJ2s32FBPBv0Q8ExAplbmRzdHJlYW0KZW5kb2JqCjE5IDAgb2JqCjw8L0xlbmd0aCA5NTQ+PgpzdHJlYW0KL0NJREluaXQgL1Byb2NTZXQgZmluZHJlc291cmNlIGJlZ2luCjEyIGRpY3QgYmVnaW4KYmVnaW5jbWFwCi9DSURTeXN0ZW1JbmZvCjw8IC9SZWdpc3RyeSAoQWRvYmUpCi9PcmRlcmluZyAoVUNTKQovU3VwcGxlbWVudCAwCj4+IGRlZgovQ01hcE5hbWUgL0Fkb2JlLUlkZW50aXR5LVVDUyBkZWYKL0NNYXBUeXBlIDIgZGVmCjEgYmVnaW5jb2Rlc3BhY2VyYW5nZQo8MDAwMD4gPGZmZmY+CmVuZGNvZGVzcGFjZXJhbmdlCjQ1IGJlZ2luYmZjaGFyCjwwMDJjPiA8MDA0OT4KPDAwNTE+IDwwMDZlPgo8MDA0OT4gPDAwNjY+CjwwMDUyPiA8MDA2Zj4KPDAwNTU+IDwwMDcyPgo8MDA1MD4gPDAwNmQ+CjwwMDQ4PiA8MDA2NT4KPDAwMDM+IDwwMDIwPgo8MDA0Yz4gPDAwNjk+CjwwMDUzPiA8MDA3MD4KPDAwNTY+IDwwMDczPgo8MDA1Nz4gPDAwNzQ+CjwwMDQ3PiA8MDA2ND4KPDAwNDQ+IDwwMDYxPgo8MDAxNT4gPDAwMzI+CjwwMDEzPiA8MDAzMD4KPDAwMTY+IDwwMDMzPgo8MDAzNT4gPDAwNTI+CjwwMDM2PiA8MDA1Mz4KPDAwNTg+IDwwMDc1Pgo8MDA0ZD4gPDAwNmE+CjwwMGEyPiA8MDBlMD4KPDAwMzc+IDwwMDU0Pgo8MDA0NT4gPDAwNjI+CjwwMGE5PiA8MDBlNz4KPDAwYTU+IDwwMGUzPgo8MDAyOD4gPDAwNDU+CjwwMDViPiA8MDA3OD4KPDAwNDY+IDwwMDYzPgo8MDA0Zj4gPDAwNmM+CjwwMDU5PiA8MDA3Nj4KPDAwMWQ+IDwwMDNhPgo8MDAzMT4gPDAwNGU+CjwwMDVkPiA8MDA3YT4KPDAwMTQ+IDwwMDMxPgo8MDAxYT4gPDAwMzc+CjwwMGEzPiA8MDBlMT4KPDAwMjc+IDwwMDQ0Pgo8MDAyND4gPDAwNDE+CjwwMDI1PiA8MDA0Mj4KPDAwMjY+IDwwMDQzPgo8MDAxMD4gPDAwMmQ+CjwwMGFiPiA8MDBlOT4KPDAwYTQ+IDwwMGUyPgo8MDBiNz4gPDAwZjU+CmVuZGJmY2hhcgplbmRjbWFwCkNNYXBOYW1lIGN1cnJlbnRkaWN0IC9DTWFwIGRlZmluZXJlc291cmNlIHBvcAplbmQKZW5kCmVuZHN0cmVhbQplbmRvYmoKMjAgMCBvYmoKPDwvVHlwZSAvRm9udERlc2NyaXB0b3IvRm9udE5hbWUgL1JXQU5YRitEZWphVnUtU2VyaWYtQm9sZC9Gb250RmFtaWx5IChEZWphVnUgU2VyaWYpL0ZsYWdzIDYvRm9udEJCb3ggWy03IC0xNCA2MjYgNzkxXS9JdGFsaWNBbmdsZSAwL0FzY2VudCA5MzgvRGVzY2VudCAtMjM1L0NhcEhlaWdodCA3OTEvU3RlbVYgODAvU3RlbUggODAvRm9udEZpbGUyIDE3IDAgUj4+CmVuZG9iagoyMSAwIG9iago8PC9UeXBlIC9Gb250L1N1YnR5cGUgL0NJREZvbnRUeXBlMi9CYXNlRm9udCAvUldBTlhGK0RlamFWdS1TZXJpZi1Cb2xkL0NJRFN5c3RlbUluZm8gPDwvUmVnaXN0cnkgKEFkb2JlKS9PcmRlcmluZyAoSWRlbnRpdHkpL1N1cHBsZW1lbnQgMD4+L0NJRFRvR0lETWFwIC9JZGVudGl0eS9XIFszIFszNDhdIDE2IFs0MTVdIDE5IFs2OTYgNjk2IDY5NiA2OTZdIDI2IFs2OTZdIDI5IFszNjldIDM2IFs3NzYgODQ1IDc5NiA4NjcgNzYyXSA0NCBbNDY4XSA0OSBbOTE0XSA1MyBbODMxIDcyMiA3NDRdIDY4IFs2NDggNjk5IDYwOSA2OTkgNjM2IDQzMF0gNzYgWzM4MCAzNjJdIDc5IFszODAgMTA1OCA3MjcgNjY3IDY5OV0gODUgWzUyNyA1NjMgNDYyIDcyNyA1ODFdIDkxIFs1OTZdIDkzIFs1NjhdIDE2MiBbNjQ4IDY0OCA2NDggNjQ4XSAxNjkgWzYwOV0gMTcxIFs2MzZdIDE4MyBbNjY3XV0vRm9udERlc2NyaXB0b3IgMjAgMCBSPj4KZW5kb2JqCjIyIDAgb2JqCjw8L1R5cGUgL0ZvbnQvU3VidHlwZSAvVHlwZTAvQmFzZUZvbnQgL1JXQU5YRitEZWphVnUtU2VyaWYtQm9sZC9Ub1VuaWNvZGUgMTkgMCBSL0VuY29kaW5nIC9JZGVudGl0eS1IL0Rlc2NlbmRhbnRGb250cyBbMjEgMCBSXT4+CmVuZG9iagoyMyAwIG9iago8PC9MZW5ndGggMTAzOD4+CnN0cmVhbQovQ0lESW5pdCAvUHJvY1NldCBmaW5kcmVzb3VyY2UgYmVnaW4KMTIgZGljdCBiZWdpbgpiZWdpbmNtYXAKL0NJRFN5c3RlbUluZm8KPDwgL1JlZ2lzdHJ5IChBZG9iZSkKL09yZGVyaW5nIChVQ1MpCi9TdXBwbGVtZW50IDAKPj4gZGVmCi9DTWFwTmFtZSAvQWRvYmUtSWRlbnRpdHktVUNTIGRlZgovQ01hcFR5cGUgMiBkZWYKMSBiZWdpbmNvZGVzcGFjZXJhbmdlCjwwMDAwPiA8ZmZmZj4KZW5kY29kZXNwYWNlcmFuZ2UKNTEgYmVnaW5iZmNoYXIKPDAwMzQ+IDwwMDUxPgo8MDAyYz4gPDAwNDk+CjwwMDAzPiA8MDAyMD4KPDAwMzY+IDwwMDUzPgo8MDA1Mj4gPDAwNmY+CjwwMDQ2PiA8MDA2Mz4KPDAwNGM+IDwwMDY5Pgo8MDA0OD4gPDAwNjU+CjwwMDQ3PiA8MDA2ND4KPDAwNDQ+IDwwMDYxPgo8MDAyNj4gPDAwNDM+CjwwMDU1PiA8MDA3Mj4KPDAwYWI+IDwwMGU5Pgo8MDA1Nz4gPDAwNzQ+CjwwMDI3PiA8MDA0ND4KPDAwMTE+IDwwMDJlPgo8MDAyND4gPDAwNDE+CjwwMDMxPiA8MDA0ZT4KPDAwMzM+IDwwMDUwPgo8MDAyZD4gPDAwNGE+CjwwMDFkPiA8MDAzYT4KPDAwMTY+IDwwMDMzPgo8MDAxNT4gPDAwMzI+CjwwMDE3PiA8MDAzND4KPDAwMTM+IDwwMDMwPgo8MDAxOD4gPDAwMzU+CjwwMDEyPiA8MDAyZj4KPDAwMTQ+IDwwMDMxPgo8MDAxMD4gPDAwMmQ+CjwwMDI1PiA8MDA0Mj4KPDAwYjU+IDwwMGYzPgo8MDA0YT4gPDAwNjc+CjwwMDQ1PiA8MDA2Mj4KPDAwNTE+IDwwMDZlPgo8MDAxYz4gPDAwMzk+CjwwMDM3PiA8MDA1ND4KPDAwNTg+IDwwMDc1Pgo8MDA0Zj4gPDAwNmM+CjwwMDM4PiA8MDA1NT4KPDAwMjk+IDwwMDQ2Pgo8MDAxYj4gPDAwMzg+CjwwMDFhPiA8MDAzNz4KPDAwMTk+IDwwMDM2Pgo8MDBhYz4gPDAwZWE+CjwwMDM1PiA8MDA1Mj4KPDAwNTA+IDwwMDZkPgo8MDAwNz4gPDAwMjQ+CjwwMDM5PiA8MDA1Nj4KPDAwMzI+IDwwMDRmPgo8MDA1Nj4gPDAwNzM+CjwwMDU0PiA8MDA3MT4KZW5kYmZjaGFyCmVuZGNtYXAKQ01hcE5hbWUgY3VycmVudGRpY3QgL0NNYXAgZGVmaW5lcmVzb3VyY2UgcG9wCmVuZAplbmQKZW5kc3RyZWFtCmVuZG9iagoyNCAwIG9iago8PC9UeXBlIC9Gb250RGVzY3JpcHRvci9Gb250TmFtZSAvTldPTFFQK0RlamFWdS1TZXJpZi9Gb250RmFtaWx5IChEZWphVnUgU2VyaWYpL0ZsYWdzIDYvRm9udEJCb3ggWy05IC0yMDggNjEwIDUzM10vSXRhbGljQW5nbGUgMC9Bc2NlbnQgOTI4L0Rlc2NlbnQgLTIzNS9DYXBIZWlnaHQgNTMzL1N0ZW1WIDgwL1N0ZW1IIDgwL0ZvbnRGaWxlMiAxOCAwIFI+PgplbmRvYmoKMjUgMCBvYmoKPDwvVHlwZSAvRm9udC9TdWJ0eXBlIC9DSURGb250VHlwZTIvQmFzZUZvbnQgL05XT0xRUCtEZWphVnUtU2VyaWYvQ0lEU3lzdGVtSW5mbyA8PC9SZWdpc3RyeSAoQWRvYmUpL09yZGVyaW5nIChJZGVudGl0eSkvU3VwcGxlbWVudCAwPj4vQ0lEVG9HSURNYXAgL0lkZW50aXR5L1cgWzMgWzMxOF0gNyBbNjM2XSAxNiBbMzM4IDMxOCAzMzcgNjM2IDYzNiA2MzYgNjM2IDYzNiA2MzYgNjM2IDYzNiA2MzYgNjM2IDMzN10gMzYgWzcyMiA3MzUgNzY1IDgwMl0gNDEgWzY5NF0gNDQgWzM5NSA0MDFdIDQ5IFs4NzUgODIwIDY3MyA4MjAgNzUzIDY4NSA2NjcgODQzIDcyMl0gNjggWzU5NiA2NDAgNTYwIDY0MCA1OTJdIDc0IFs2NDBdIDc2IFszMjBdIDc5IFszMjAgOTQ4IDY0NCA2MDJdIDg0IFs2NDAgNDc4IDUxMyA0MDIgNjQ0XSAxNzEgWzU5MiA1OTJdIDE4MSBbNjAyXV0vRm9udERlc2NyaXB0b3IgMjQgMCBSPj4KZW5kb2JqCjI2IDAgb2JqCjw8L1R5cGUgL0ZvbnQvU3VidHlwZSAvVHlwZTAvQmFzZUZvbnQgL05XT0xRUCtEZWphVnUtU2VyaWYvVG9Vbmljb2RlIDIzIDAgUi9FbmNvZGluZyAvSWRlbnRpdHktSC9EZXNjZW5kYW50Rm9udHMgWzI1IDAgUl0+PgplbmRvYmoKMjcgMCBvYmoKPDwvUldBTlhGIDIyIDAgUi9OV09MUVAgMjYgMCBSPj4KZW5kb2JqCjI4IDAgb2JqCjw8L1R5cGUgL1hPYmplY3QvU3VidHlwZSAvSW1hZ2UvV2lkdGggMTIwL0hlaWdodCAzNC9Db2xvclNwYWNlIC9EZXZpY2VSR0IvQml0c1BlckNvbXBvbmVudCA4L0ludGVycG9sYXRlIHRydWUvRmlsdGVyIC9GbGF0ZURlY29kZS9EZWNvZGVQYXJtcyA8PC9QcmVkaWN0b3IgMTUvQ29sdW1ucyAxMjAvQ29sb3JzIDM+Pi9TTWFzayAyOSAwIFIvTGVuZ3RoIDE0Mjg+PgpzdHJlYW0KeJztWk1vGzcQfcOV8nWK4zi10osBy0CvjuQC+Q+pvejfaZCFmv6edO3kPxSIpOoawDaQU63aVlTk0MaWlq+H/dB+kCvJUdI60QMPAskdjt4OhzPDFVjgtgcUAQhAHOVvr9hmLjELKsZet3tOImQZAAPmJ/SGCKBFKyqM4D9evoYpEGPvXuddwnIIR6kXjyI23d6QAbMTREaypLsECoDbOX/SPst0S96ER6nfWuvcawDIqt7tDtze8FNo+QVAuZ0BIY4otz2YdDNv6S8fTazVvAsAIRjQ/W3JtQEqscw0t+JcpOkMME4/I1rbBZLVJdcGKKOB+ts1UZfaUQTEef+q+U1mdGdNKQWx2faSawMq4lxofQOAUu/TA/52reSxX2NP8kP3VMHJe2yQ1YWqef1h87fzwe0OmOcaQvg7qwuR/wUgQ7TbG46DoDJyrhCombm2ZzrrdU9EkUHhGQZQZ4etZFoY4XwYy19vWwY5Wx6KC2ehqU+PfwFwd8O74QSOqibr2sTe3fBuVWDWMFa0f9QKV6fgz8OfjZNqmx6FCMO7EG7nnAEdCKs6E4GEo71heejmN1YLoUoYCJqWr3sCgkHo5zONUiFrdS+ey7D/tpidkbAgodAUHADfbnl3KnREpdc1il3/zrtdpVXDyDyZrK7swQFVokPSBTVJBVOUua+He513DDQDvdd5V3LKHTRWc66oEI4DoQ2mFkq31NNcr/9kVT/9T7ISonXz/RoAGVl+etQIFUQKFuSkVJ3T6aZT8Awrbm/ob68UksAoorD5FtGaotI9T9pnr3bWMn+DkTiOpV/YtrXNp4gkOLP8gf5hRkJt6xkIDfYPn6f7Nza8CxAAyZPjzJAB4Rsh/g7MjuUKSJOSeUehb6UhCQSr1q3iZzkFoJTK9cTGjCLLAG4GMb82e7sSPtyKf81gipEdYGEsI23R4lwwuAkQoIzilJtSJHqKlpLxGDInX2/ftmr1Z3M9MhcEXLfLD0TODucnV2CTqWJ/NSHaHDgL5+QZzDnbeZ//5CgzaUdfUVubzEScuUz6MXA0Oe9J8TkhYMkmk7F16OMwhWhRlwxu5DtHl59Im88AEv2jhXneWChOjs1x9PqWJyQSot3ekFoDAiJdWfa3a+7rUzqTJFt04D+uue0zigNA9Nj//sFcWsXXNri74RVPm/XvPIwJRDHZwjGLKww1lIUoQE0oJERTa8RXKrkyRcjjj78PAYS1f7c3ZBBFI1TObntwkE61JR9m5KDjeOK2wzubXm40uc2Z9xQtR/9N62H9GQEFebjpaWOEHx+GjKmu1T37i5HZdoaCaGTDuwQMaU3jxaOV5IYld7Mlgt3uJJMs8FNQtBIflgIKcy2JrfqWzXhlJJRRaMv3osNworJ15qyHvEAoMkkusvSMOd+uEWKvk3CdEVU8GPtvWnQkPJRyLXlWJq6KhBDyD0eYBQznGwzo5Og5hWHabGuQAMDJcUuJMF7aMjP0b2Gzki7MJr273UFuckk9yG2f0eIfRJg707VS6duZqahtPQUVAAH/OJqWwl0fRHypQvXHVg8C4O+saUtNqxg5zcUygJsjR4OkaKq1rbwHv76Y8FK8+ZaRKqmXGuuiOVBw0FiWpIH0YSgFIy2/kfIbq1PzEnV5jSPuxSJDVdGoAQkYvCqUihKU2DWBg+bSnCNkzjRxLgoT6Ija6wxspl1i1wJZfuaRIE+S2zlnyYcb2dBEUfnNFZTa9f7SqAEYq05u97ys7FKQsN+8BzvXAXWJ5/l6YAiH/cZ9gd2s86D7+hR2H+LITBclXzzMeYffvC/qcsaPEYJKVByxcP1/q0f/N7AWgPzt2n7znhbbZfsE6ZTEb6zacpmvHFMqbS8bD/abq6KDXK0FCM2dxdr0y50H4lwicj6GCV8n/gW+3sq2CmVuZHN0cmVhbQplbmRvYmoKMjkgMCBvYmoKPDwvRmlsdGVyIC9GbGF0ZURlY29kZS9UeXBlIC9YT2JqZWN0L1N1YnR5cGUgL0ltYWdlL0RlY29kZVBhcm1zIDw8L1ByZWRpY3RvciAxNS9Db2x1bW5zIDEyMD4+L1dpZHRoIDEyMC9IZWlnaHQgMzQvQ29sb3JTcGFjZSAvRGV2aWNlR3JheS9CaXRzUGVyQ29tcG9uZW50IDgvSW50ZXJwb2xhdGUgdHJ1ZS9MZW5ndGggNzI4Pj4Kc3RyZWFtCnicvZfbdds6EEV3slwAOhBcgXkrMFyBmQpCVyB1ILsCJRXQtwImFZCpQHQFoCogU8G5HwCfkp2VdU2fH3EGj43XDCCI2rXKDR+vTJJKAOx2/9V+GPgoSdoAtpWkcn106gC8JOkWOCjoYNblfpN2QCFJHiCPYHm7KjjyrJfaFMDpY8illAPY+60JntvcfwTZHi5sZhbR5YrgV7QP5N1qgE8AxtXNGfkRoLvuou1uDACnugZ3y/dYkG3GNi8/MG5jGApNElvBryrbdN+jkd6En7afmjFDJzGs9tEqhyOnA+xDyC8KlJO0Qz4gnNhee8oQNQC5BCF5tEBSSkc7kL2in5DYvPfet5LcFJx7773Ueu/9gWP42gz9tz5qewHcSpKJKasdyCGuHACFFP2ptJ+C4xjDMTQxRKJa+ckSzsGfgRqoO/YGwPSLS9UB3IceaZrohXFRljLQzMzQxyVdAQ+HtHqAJHjcUPa845zyak8sm/+sz8bVTyoJ4OZLP9y5XmKdv5IbyM05+HH8vho/qyz8DI4G3lrXy+q3BE5v1puAn1IDdE9/SVro+Y32zXX8yDM+g8l9aYHmroH6rnFFkSybdEOI2z9ss5m1spcrnarqCg4ZtrwG6usNJ2wJ6dMjcAPhyEOdmmMFgOtdF6fUmcw00fhZ184VfeVf1aRe1UBMFGNYFn16CjdzfA5NcpDn1ThmN8ljX0kn1jJzXcWVyxZbszMPITLCiJu7+wQAk1LBqeL3tPZLf4K/dfemd5748c/WjlYznruugZiU26F+/xDIM0nhNTTVs/TI+8jNboP5co2r08sc8jx5J3I5z9H9XbwYzwoKU568c0byyg++MkDcOXm7KjdeiFJul+SjWYv5CYC0iGZddUDzb3z5wPPDWuSgTDOV45zdumBSPyMnA7n4Y9P/KVtOwbf05OPaYMiOi7Sxk+ZvqNWUbIujJN+fblv61f6u/gc5o4ACCmVuZHN0cmVhbQplbmRvYmoKeHJlZgowIDMwCjAwMDAwMDAwMDAgNjU1MzUgZiAKMDAwMDAwMDAxNSAwMDAwMCBuIAowMDAwMDAwMDY4IDAwMDAwIG4gCjAwMDAwMDAxMTUgMDAwMDAgbiAKMDAwMDAwMDE3NyAwMDAwMCBuIAowMDAwMDAwMzE5IDAwMDAwIG4gCjAwMDAwMDE5NDYgMDAwMDAgbiAKMDAwMDAwMjEzMSAwMDAwMCBuIAowMDAwMDAyMjcwIDAwMDAwIG4gCjAwMDAwMDI1NzEgMDAwMDAgbiAKMDAwMDAwMjY4NyAwMDAwMCBuIAowMDAwMDAyODE4IDAwMDAwIG4gCjAwMDAwMDMxNTAgMDAwMDAgbiAKMDAwMDAwMzMwMiAwMDAwMCBuIAowMDAwMDAzNDE0IDAwMDAwIG4gCjAwMDAwMDM2MTQgMDAwMDAgbiAKMDAwMDAwMzgyNiAwMDAwMCBuIAowMDAwMDAzODc4IDAwMDAwIG4gCjAwMDAwMDc2MDEgMDAwMDAgbiAKMDAwMDAxMTk3MSAwMDAwMCBuIAowMDAwMDEyOTc1IDAwMDAwIG4gCjAwMDAwMTMxOTkgMDAwMDAgbiAKMDAwMDAxMzY4NCAwMDAwMCBuIAowMDAwMDEzODI5IDAwMDAwIG4gCjAwMDAwMTQ5MTggMDAwMDAgbiAKMDAwMDAxNTEzOCAwMDAwMCBuIAowMDAwMDE1NjEzIDAwMDAwIG4gCjAwMDAwMTU3NTMgMDAwMDAgbiAKMDAwMDAxNTgwMiAwMDAwMCBuIAowMDAwMDE3NDcyIDAwMDAwIG4gCnRyYWlsZXIKPDwKL1NpemUgMzAKL1Jvb3QgMyAwIFIKL0luZm8gMiAwIFIKPj4Kc3RhcnR4cmVmCjE4NDIwCiUlRU9GCg=="
}
```

STATUS 404

**Response Body**

```json
{
  "data": "{\"title\": \"Not Found\", \"description\": \"Account not found for the given parameters.\", \"translation\": \"Conta não encontrada para os parâmetros fornecidos.\", \"extra_fields\": {}, \"code\": \"ACC000008\"}"
}

```

---

# Query Account Blocks

URL: /en/documentation/contas/ordens_de_bloqueio

## Request

ENDPOINT /account/ ACCOUNT_KEY /account_block_records
METHOD GET

### Path parameters

| Field | Type | Description                      |
|---|------|--------------------------------|
| `ACCOUNT_KEY` | UUID | Key of the account to be detailed |

### Query parameters

| Field                      | Type       | Description                                             | Characters                                                                  |
|----------------------------|------------|-------------------------------------------------------|-----------------------------------------------------------------------------|
| `block_order_statuses` * | enumerator | Indicates the status of the block order. | [block_order_statuses enumerators](#enumerators-block_order_statuses) |

### block_order_statuses enumerators

| Enumerator   | Description                    |
|--------------|------------------------------|
| **pending** | Pending block order |
| **open** | Open block order   |
| **concluded** | Concluded block order   |

## Response

STATUS 200

Response Body

```json
{
  [
    {
      "account_blocked_amount": 1000,
      "block_order": {
        "block_order_protocol": "100000000",
        "block_order_sequence": "00001",
        "case_number": "0000000000000",
        "court_code": "00000",
        "defendant_document_number": "00000000000000",
        "institution_document_number": null,
        "lawsuit_author_name": "NOME DO JUIZ",
        "lawsuit_type": "labor",
        "protocol_datetime": "2025-04-28T08:34:16Z",
        "requested_amount": 1000,
        "requester_judge": "JUIZ DE DIREITO"
      }
    }
  ]
}
```

### Response Body Params

| Field                          | Type            | Description                                          | Max. Characters |
|--------------------------------|-----------------|----------------------------------------------------|-----------------|
| `account_blocked_amount`       | float          | Amount blocked in the account.                          | -               |
| `block_order`                  | object          | Details of the block order.                     | **[block_order object](#block_order-object)**          |

### block_order object

| Field                          | Type            | Description                                          | Max. Characters |
|--------------------------------|-----------------|----------------------------------------------------|-----------------|
| `block_order_protocol`      | string          | Block order protocol.                    | -               |
| `block_order_sequence`      | string          | Block order sequence.                    | -               |
| `case_number`               | string          | Case number.                                    | -               |
| `court_code`                | string          | Court code.                                | -               |
| `defendant_document_number` | string          | Defendant's document number.                        | 14              |
| `institution_document_number` | string or null| Institution's document number, if applicable.  | -               |
| `lawsuit_author_name`       | string          | Lawsuit author's name.                         | -               |
| `lawsuit_type`              | enumerator      | Lawsuit type.                                  | **[lawsuit_type enumerators](#lawsuit_type-enumerators)**               |
| `protocol_datetime`         | string   | Protocol date and time.                          | 20              |
| `requested_amount`          | float          | Requested amount.                                  | -               |
| `requester_judge`           | string          | Requesting judge's name.                          | -               |

### lawsuit_type enumerators

| Enumerator  | Description              |
|-------------|------------------------|
| `labor`     | Labor lawsuit   |
| `civil`     | Civil lawsuit         |
| `criminal`  | Criminal lawsuit      |
| `tax`       | Tax lawsuit    |
| `family`    | Family lawsuit    |

STATUS 404

Response Body: Account not found

```json
{
    "title": "Not Found",
    "description": "Account not found for the given key 3e4b8746-da58-4799-bcd0-063326428d3f",
    "translation": "Conta não encontrada para a seguinte chave 3e4b8746-da58-4799-bcd0-063326428d3f",
    "code": "ACC000006"
}
```

STATUS 403

Response Body: User does not have permission

```json
{
    "title": "Permission Validator Error",
    "description": "Selected agent do not own this item.",
    "translation": "O agente selecionado não é dono do item.",
    "code": "QIT000005"
}
```

---

# Scenario simulation

URL: /en/documentation/contas/simulacao

Step by step to simulate blocking and unblocking of customer accounts.

## 1 - Account blocking simulation

### Request

ENDPOINT /mock/account/ ACCOUNT_KEY /block
MÉTODO PATCH

Request Body

```json
{
  "account_block_reason": "\<Motivo do bloqueio da conta\>"
}
```

### Body Parameters

| Field                | Type   | Description                          | Example                                |
|----------------------|--------|------------------------------------|----------------------------------------|
| `account_block_reason` | string | Account blocking reason         | "judicially_suspended"                   |

:::info
The possible blocking reasons can be accessed in the section [Account blocking webhook](../movimentacao_de_contas/webhook_movimentacoes#webhook-de-bloqueio-de-conta).
:::

## 2 - Account unblocking simulation

### Request

ENDPOINT /mock/account/ ACCOUNT_KEY /unblock
MÉTODO PATCH

Request Body

```json
{
}
```

---

# Create destination account for escrow

URL: /en/documentation/d88ff174-100d-4b55-80b7-86e11f508400

This endpoint allows creating a destination account for an escrow account

## Request

### Request Endpoint

ENDPOINT /account/ ACCOUNT_KEY /destination
METHOD POST

### Request Path Params

| Field               | Type    | Description                             | Characters |
|---------------------|---------|-----------------------------------------|------------|
| `account_key` *     | uuid4   | Unique account identification key.      | 36         |

Request Body: adding destination account

```json
{
    "name": "Minha conta destino",
    "ted_account_type": "checking_account",
    "document_number": "51297635200133",
    "account_branch": "3422",
    "account_digit": "8",
    "account_number": "08042",
    "financial_institutions_code_number": "329"
}
```

### Body Params

| Field                                        | Type   | Description                               |
|----------------------------------------------|--------|-------------------------------------------|
| `name` *                                     | string | Recipient name                            |    
| `ted_account_type` *                         | enum   | Destination account type.                 |
| `account_branch`  *                          | string | Destination account branch.               |
| `account_digit` *                            | string | Destination account digit.                |
| `account_number` *                           | string | Destination account number.               |
| `financial_institutions_code_number` *       | string | Destination account bank code.            |

## Response

### Success Response

STATUS 201

Response Body:

```json
{}
```

### Error Response

STATUS 4XX

Response Body

```json
{
    "title": "Título",
    "description": "Description in english",
    "translation": "Descrição em português",
    "code": "Código"
}
```

| HTTP Code | QI Code | Title                                        | Description (eng)                               | Description (pt-br)                                     |
|-----------|---------|----------------------------------------------|-------------------------------------------------|---------------------------------------------------------|
| 404       | ACC000006 | Not found                                  | Account not found for the given key ACCOUNT_KEY | Account not found for the given key ACCOUNT_KEY        |
| 403       | ACC000219 | Requester not allowed to perform this action | Requester not allowed to create destination     | Requester not allowed to create destination            |

---

# Register account in DDA

URL: /en/documentation/dda/cadastro_dda

To enable the receipt of boleto information for boletos that have the holder of a QI account as the payer, it is necessary to register this account in the DDA.

Evidence of the acceptance of the adherence terms must be sent in the request.

## Request

ENDPOINT /account/ ACCOUNT_KEY /dda
METHOD POST

Request Body

```json
{
 "account_key": "account key as uuid",
 "authorization_term": {
   "document_number": "<ACCOUNT HOLDER'S CPF>",
   "signature": {
     "signer": {
       "name": "<ACCOUNT HOLDER'S NAME>",
       "email": "<ACCOUNT HOLDER'S EMAIL>",
       "phone": {
         "number": "<ACCOUNT HOLDER'S PHONE NUMBER>",
         "area_code": "<ACCOUNT HOLDER'S AREA CODE>",
         "country_code": "55"
       },
       "document_number": "<ACCOUNT HOLDER'S CPF>"
     },
     "authentication_type": "opt_in",
     "authenticity": {
       "timestamp": "<DATE AND TIME OF SIGNATURE>",
       "ip_address": "<ACCOUNT HOLDER'S IP>",
       "fingerprint": {},
       "third_party_additional_data": {},
       "session_id": "<ACCOUNT HOLDER'S SESSION ID>"
     },
     "signed_object": {
       "raw_text": "<ADHERENCE TERM TEXT>"
     }
   }
 }
}
```

### BODY PARAMS

| Field               | Type   | Description                                            |
|---------------------|--------|--------------------------------------------------------|
| `account_key`       | string | Identification key of the account to be registered in DDA |
| `authorization_term`| string | Authorization data signed by the payer                |

## Response

STATUS 200

```json
{}
```

---

# Remover DDA account

URL: /en/documentation/dda/cancelamento_dda

After the account is removed from the DDA, notifications of boleto registrations having the account holder as the payer will no longer be received.

:::info Information
If the account holder still has other account(s) opened by the integrator partner and registered in the DDA, notifications will continue to be sent.

To stop the notifications, it is necessary to remove all of the holder's accounts registered in the DDA.
:::

Evidence of the acceptance of the adherence terms must be sent in the request.

## Request

ENDPOINT /baas/dda/account/ ACCOUNT_KEY
METHOD DELETE

Request Body

```json
{
 "authorization_term": {
   "document_number": "<ACCOUNT HOLDER'S CPF>",
   "signature": {
     "signer": {
       "name": "<ACCOUNT HOLDER'S NAME>",
       "email": "<ACCOUNT HOLDER'S EMAIL>",
       "phone": {
         "number": "<ACCOUNT HOLDER'S PHONE NUMBER>",
         "area_code": "<ACCOUNT HOLDER'S AREA CODE>",
         "country_code": "55"
       },
       "document_number": "<ACCOUNT HOLDER'S CPF>"
     },
     "authentication_type": "opt_in",
     "authenticity": {
       "timestamp": "<DATE AND TIME OF SIGNATURE>",
       "ip_address": "<ACCOUNT HOLDER'S IP>",
       "fingerprint": {},
       "third_party_additional_data": {},
       "session_id": "<ACCOUNT HOLDER'S SESSION ID>"
     },
     "signed_object": {
       "raw_text": "<REMOVAL TERM TEXT>"
     }
   }
 }
}
```

### PATH PARAMS

| Field         | Type   | Description                                        |
|---------------|--------|----------------------------------------------------|
| `ACCOUNT_KEY` | string | Identification key of the account registered in DDA |

## Response

STATUS 200

```json
{}
```

---

# Consult Account Registered in DDA

URL: /en/documentation/dda/consultar_dados_conta

## Request

ENDPOINT /baas/dda/account/ ACCOUNT_KEY
METHOD GET

### PATH PARAMS

| Field          | Type   | Description                                             |
|----------------|--------|---------------------------------------------------------|
| `ACCOUNT_KEY`  | string | Identification key of the account to be registered in DDA |

## Response

STATUS 200

Response Body

```json
{
    "account_key": "7c52d5f6-9db1-4a3c-bb03-1f76a2e8f9d2",
    "receive_webhook": true
}
```

---

# Errors Returned in the API

URL: /en/documentation/dda/erros

STATUS 400

Response Body

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

STATUS 403

Response Body

```json
{
  "data": "{\"title\": \"Forbidden\", \"description\": \"Has no permission to this account\", \"translation\": \"Não possui permissão nesta conta\", \"extra_fields\": {}, \"code\": \"QIT000079\"}",
  "title": "Forbidden", 
  "description": "Has no permission to this account",
  "translation": "Não possui permissão nesta conta", 
  "extra_fields": {}, 
  "code": "QIT000079"
  
}

```

STATUS 404

Response Body

```json
{
  "data": "{\"title\": \"Not Found\", \"description\": \"Not found account for the given key\", \"translation\": \"Não foi encontrada uma conta com a chave fornecida\", \"extra_fields\": {}, \"code\": \"QIT000099\"}",
  "title": "Not Found", 
  "description": "Not found account for the given key", 
  "translation": "Não foi encontrada uma conta com a chave fornecida",
  "extra_fields": {}, 
  "code": "QIT000099"
}

```

STATUS 400

Response Body

```json
{
  "data": "{\"title\": \"Bad Request\", \"description\": \"Error on electronic payer subscription\", \"translation\": \"Erro ao inscrever pagador eletronico.\", \"extra_fields\": {}, \"code\": \"QIT000011\"}",
  "title": "Bad Request", 
  "description": "Error on electronic payer subscription", 
  "translation": "Erro ao inscrever pagador eletronico.", 
  "extra_fields": {}, 
  "code": "QIT000011"
}

```

STATUS 409

Response Body

```json
{
  "data": "{\"title\": \"Bad Request\", \"description\": \"Bank slip already registered\", \"translation\": \"Boleto já cadastrado.\", \"extra_fields\": {}, \"code\": \"QIT100012\"}",
  "title": "Duplicated Bank Slip", 
  "description": "Bank slip already registered", 
  "translation": "Boleto já cadastrado.", 
  "extra_fields": {}, 
  "code": "QIT100012"
}

```

STATUS 409

Response Body

```json
{
  "data": "{\"title\": \"Bad Request\", \"description\": \"Account already registered\", \"translation\": \"Conta já cadastrada.\", \"extra_fields\": {}, \"code\": \"QIT200012\"}",
  "title": "Account already registered", 
  "description": "Account already registered", 
  "translation": "Conta já cadastrada.", 
  "extra_fields": {}, 
  "code": "QIT200012"
}

```

---

# Introduction

URL: /en/documentation/dda/introducao

The Authorized Direct Debit (DDA) API allows an account within QI Tech to receive information on all boletos (payment slips) that have the account holder as the payer.

:::danger General Remarks:
- For this API, the account registered in the DDA must be a QI account.
- The disclosure and acceptance of the terms are the responsibility of the partner (integrator).
:::

---

# List Accounts Registered in DDA

URL: /en/documentation/dda/lista_contas_cadastradas

## Request

ENDPOINT /baas/dda/accounts
METHOD GET

### QUERY PARAMS

| Field         | Description                               |
|---------------|-------------------------------------------|
| `page_number` | Current page being queried                |
| `page_size`   | Number of results per page                |

## Response

STATUS 200

Response Body

```json
{
	"data": [{
			"account_key": "7c52d5f6-9db1-4a3c-bb03-1f76a2e8f9d2",
			"receive_webhook": true
		},
		{
			"account_key": "a4272c1e-ab55-45de-9897-4ca6c606a738",
			"receive_webhook": true
		}
	],
	"pagination": {
		"current_page": 1,
		"next_page": null,
		"rows_per_page": 10
	}
}
```

---

# List Boletos of Account Registered in DDA (bank slip notification) with filters

URL: /en/documentation/dda/lista_notificacoes_de_boletos

Method that allows listing of boleto titles from accounts registered in the DDA, enabling filtering by account_key, status, and time interval.

## Request
ENDPOINT /baas/dda/bankslip_notifications
METHOD GET

### QUERY PARAMS

| Field               | Description                                       |
|---------------------|---------------------------------------------------|
| `account_key`       | account_key of an account registered in the DDA   |
| `status`            | status of a boleto                                |
| `min_str_start_date`| Minimum start date of the operation               |
| `max_str_start_date`| Maximum start date of the operation               |
| `page_number`       | Current page being queried                        |
| `page_size`         | Number of results per page                        |

## Response

STATUS 200

Response Body

```json
{
  "data": [
    {
        "barcode": "00193000000001000000500000001234567890123456",
        "status": "paid",
        "total_value_in_cents": 999,
        "expiration": "10/05/2023",
        "recipient": {
            "name": "Tech Solutions Ltda.",
            "document": "12345678000100"
        },
        "payer": {
            "name": "João Carlos",
            "document": "12345678900"
        }
    }
  ],
  "pagination": {
    "current_page": 1,
    "next_page": null,
    "rows_per_page": 10
  }
}
```

STATUS 400

**Response Body**

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

```

---

# Recuperação de termo de aceite e cancelamento de cadastro no DDA

URL: /en/documentation/dda/recuperacao_termo

Os termos de aceite e cancelamento do DDA (Débito Direto Autorizado) são documentos que regulamentam a autorização do cliente para utilizar o serviço de débito direto em sua conta bancária, bem como o procedimento para cancelar essa autorização, se desejado.

O termo de aceite do DDA é o documento em que o cliente formalmente consente e autoriza o débito automático das suas contas e faturas em sua conta bancária. Esse termo estabelece os direitos e responsabilidades do cliente e da instituição financeira, além de definir as condições de uso do DDA. Ele geralmente contém informações como identificação do cliente e da instituição financeira, autorização para débito automático, identificação dos pagamentos autorizados, período de vigência, direitos e responsabilidades do cliente, e direitos e responsabilidades da instituição financeira.

Já o termo de cancelamento de adesão ao DDA é o documento que permite ao cliente revogar a autorização concedida anteriormente e solicitar o cancelamento do serviço de débito direto. Esse termo geralmente requer a assinatura do cliente e a notificação da instituição financeira para interromper os débitos automáticos. É importante seguir o procedimento de cancelamento estabelecido pelo banco, que pode incluir o envio de uma solicitação por escrito, preenchimento de formulários específicos ou comunicação por meios eletrônicos.

Ambos os termos têm como objetivo garantir a transparência e a segurança nas transações financeiras do cliente, fornecendo uma base legal para o serviço de débito direto. O termo de aceite formaliza a autorização inicial e estabelece os termos e condições do serviço, enquanto o termo de cancelamento permite ao cliente encerrar a adesão ao DDA, caso não deseje mais utilizar essa forma de pagamento automático.

## Request

ENDPOINT /baas/dda/term/ TYPE
METHOD GET

### PATH PARAMS

| Campo  | Tipo   | Descrição      |
|--------|--------|----------------|
| `type` | string | tipo de termo  |

### POSSÍVEIS TIPOS DE TERMO

| Valor | Tipo   | Descrição                      |
|-------|--------|--------------------------------|
| `AS`  | string | Assinatura DDA                 |
| `CA`  | string | Cancelamento de assinatura DDA |

## Response

STATUS 200

Response Body

```json
{
    "term": "Eu, [nome completo], portador(a) do CPF/CNPJ [número do CPF/CNPJ], residente no endereço [endereço completo], doravante denominado(a) 'Cliente', solicito por meio deste Termo de Cancelamento o encerramento da adesão ao serviço de Débito Direto Autorizado (DDA), conforme as condições estabelecidas abaixo:\n\n..."
}

```
STATUS 400

**Response Body**

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

```

---

# Scenario Simulation of Boleto Registration and Modification

URL: /en/documentation/dda/simulacoes

To generate simulations of a boleto registration notification where the account holder is the payer, the integrator partner can use the endpoints below:

## Boleto Registration Request

ENDPOINT /mock/baas/dda/account/ ACCOUNT_KEY /bankslip_notification
METHOD POST

Request Body

```json
{
 	"barcode": "32993953000000714870001090000699950000347340",
    "digitable_line": "32990001039000069995000003473402395300000071487",
 	"total_value": 999,
 	"expiration_date": "2023-05-05",
 	"payer": {
 		"name": "Mateus F Carneiro",
 		"document_number": "01308925565"
 	},
 	"beneficiary": {
 		"name": "Mateus F carneiro",
 		"document_number": "01308925565"
 	}
}
```

## Response

STATUS 201

```json
{}
```

## Boleto Modification Request

ENDPOINT /mock/baas/dda/account/ ACCOUNT_KEY /bankslip_notification
METHOD PUT

Request Body

```json
{
 	"barcode": "32993953000000714870001090000699950000347340",
    "digitable_line": "32990001039000069995000003473402395300000071487",
 	"total_amount": 999,
 	"expiration_date": "2023-05-05",
 	"payer": {
 		"name": "Mateus F Carneiro",
 		"document_number": "01308925565"
 	},
 	"beneficiary": {
 		"name": "Mateus F carneiro",
 		"document_number": "01308925565"
 	},
 	"status": "written_off"
}
```

## Response

STATUS 200

```json
{}
```

---

# Webhook DDA Bank Slips

URL: /en/documentation/dda/webhooks

:::danger Attention!
QI Tech webhooks should not be mapped restrictively.
Additional fields may be included in the webhook payloads returned from our APIs.
:::

There are two types of events in the DDA that will be differentiated in the webhook by the attribute webhook_type .

```json
    {
      "webhook_type": "baas.dda.bankslip.registration",
      "key": "7c52d5f6-9db1-4a3c-bb03-1f76a2e8f9d2",
      "data": {
        "barcode": "32993953000000714870001090000699950000347340",
        "digitable_line": "32990001039000069995000003473402395300000071487",
        "status": "paid",
        "total_amount": 999.20,
        "expiration_date": "2023-06-02",
        "beneficiary": {
            "name": "Tech Solutions Ltda.",
            "document_number": "12345678000100"
        },
        "payer": {
            "name": "João Carlos",
            "document_number": "12345678900"
        }
      }
    }
```

```json
    {
      "webhook_type": "baas.dda.bankslip.update",
      "key": "7c52d5f6-9db1-4a3c-bb03-1f76a2e8f9d2",
      "data": {
        "barcode": "32993953000000714870001090000699950000347340",
        "digitable_line": "32990001039000069995000003473402395300000071487",
        "status": "paid",
        "total_amount": 999.20,
        "expiration_date": "2023-06-02",
        "beneficiary": {
            "name": "Tech Solutions Ltda.",
            "document_number": "12345678000100"
        },
        "payer": {
            "name": "João Carlos",
            "document_number": "12345678900"
        }
      }
    }
```

---

# acg1

URL: /en/documentation/documentacoes ocultas/agc1/acg1

## Request

- ENDPOINT /baas/historic_card_settlement
- MÉTODO POST

**body.json**

```json
{
	"person_type": "natural",
	"name": "João Ninguem",
	"document_number": "42866592832",
	"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",
			"ip_address": "179.104.42.245",
			"session_id": "ddb1d063-4fdf-4330-af9c-3316e9142ff3",
			"facial_recognition_key": "79003de0-2590-455d-9b73-426b8ca284eb",
			"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": "opt-in"
	}]
}

```

### Body Params

| Campo |  Tipo | Descrição |
|---|---| ---|
| `person_type`  | enum | Tipo de pessoa a ser consultada. | -- |
| `name`  | string | Nome do consultado. | -- |
| `document_number`  | string | CPF ou CNPJ do consultado. | -- |
| `signatures`  | array of objects | Lista contendo objetos de signatarios. | -- |

## Enumeradores

### Enumeradores marital_status

| Enumerador | Tradução | 
|---|---|
|  natural  |  Pessoa fisica |
|  legal  |  Pessoa juridica |

## Response

status: 201

**Response Body: PF**

```json
{
    "person_type": "natural",
    "name": "Sample Natural Person",
    "document_number": "50727483161",
    "signers": [
        {
            "name": "Sample Natural Person",
            "document_number": "50727483161",
            "email": "sample@gmail.com",
            "phone_number": "34987654321",
            "signature": {
                "authenticity": {
                    "ip_address": "127.0.0.1",
                    "session_id": "120a0a3ae723ff2858f9e0360f123723",
                    "third_party_access_token": "558f1a0b-38de-4b8d-b678-14b052adb1db",
                    "third_party_additional_data": {}
                },
                "signable_object": {
                    "document_key": "a43c1dde-0ecd-4086-8b94-714277a2dcee",
                    "document_md5": "57c0906e3c9902403ba373d9a7650f0a"
                }
            }
        }
    ],
    "historic_card_settlement_key": "74bf0f2e-8c53-4b5b-90bf-a0d21022bcff",
    "status": "signed",
    "historic_card_settlement_date": "2022-05-18T19:38:44"
}

```

status: 201

**Response Body: PJ**

```json
{
    "person_type": "legal",
    "name": "Sample Legal Person",
    "document_number": "28001500",
    "signers": [
        {
            "name": "Sample Signer",
            "document_number": "50727483161",
            "email": "sample@gmail.com",
            "phone_number": "34987654321",
            "signature": {
                "authenticity": {
                    "ip_address": "127.0.0.1",
                    "session_id": "120a0a3ae723ff2858f9e0360f123723",
                    "third_party_access_token": "candidate - 37767",
                    "third_party_additional_data": {}
                },
                "signable_object": {
                    "document_key": "a43c1dde-0ecd-4086-8b94-714277a2dcee",
                    "document_md5": "57c0906e3c9902403ba373d9a7650f0a"
                }
            }
        }
    ],
    "historic_card_settlement_key": "c2d4bfd3-6eaf-40ee-9eb1-697992336dbb",
    "status": "signed",
    "historic_card_settlement_date": "2022-05-18T19:37:38"
}

```

status: 400

**body.json**

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

```

## Webhooks

Após o envio de uma solicitação de consulta o resto do fluxo fica a cargo da QI Tech. Será então enviado um webhook apresentando dois modelos distintos:

- Em caso de consulta encontrada com sucesso, receberá um campo "**status**" com o valor "**completed**", neste caso, o objeto "**data**" trará as demais informações da consulta.

- Em caso de documento não encontrado na base para o período consultado, receberá um campo "**status**" com o valor "**not_found**", informando que a consulta não trouxe nenhuma informação.

## Exemplo de sucesso

No webhook temos o objeto "**data**" com os campos:

"**valueless_months**": Número de meses sem atividade.  
"**card_schemes**": São os arranjos de pagamentos que constituíram o valor total liquidado.  
"**value**": Valor total liquidado em cartões.

```json
{
   "status": "completed",
   "webhook_type": "historic_card_settlement",
   "data": {
      "valueless_months": 0,
      "card_schemes": [
         {
            "code": "003",
            "enumerator": "credit_mastercard",
            "description": "Mastercard Crédito"
         }
      ],
      "value": 847.86
   },
   "event_datetime": "2022-05-18T20:57:00",
   "key": "38934f1b-204f-4fc4-844d-5ad562ff36f6"
}
```

## Em caso de consulta não encontrada

```json
{
   "status": "not_found",
   "webhook_type": "historic_card_settlement",
   "event_datetime": "2022-05-18T20:57:00",
   "key": "38934f1b-204f-4fc4-844d-5ad562ff36f6"
}
```

---

# introducao

URL: /en/documentation/documentacoes ocultas/agc1/introducao

O histórico de liquidação de cartão é um novo sistema de consultas que fornece informações sobre os pagamentos liquidados de recebíveis de cartões de um determinado cliente em um período específico.

Estes dados são disponibilizados às instituições financeiras pelo banco central através de um sistema chamado ACG1. Para acessa-los a QI Tech precisa de uma autorização do consultado. Assim que as assinaturas forem efetuadas você receberá todas as informações relativas aos 12 meses anteriores à data de consulta.

Isso inclui:

- Valor Total agregado de pagamentos liquidados neste período.

- Quais os Arranjos de pagamentos que constituíram este valor total.

- Quantidade de meses em que não houve nenhum pagamento;

:::danger Atenção!

Assim como as demais APIs a liberação do serviço deve ser feita junto ao nosso time e as chamadas são autenticadas.
:::

## Fluxo de consulta

Para executar a consulta do histórico de liquidação de cartão, a QI Tech precisa enviar um documento ao Banco Central formalizando e solicitando a consulta. Este documento é gerado dentro do nosso fluxo interno com base no payload enviado ao nosso endpoint 16.1.

O Fluxo de consulta consiste em:

- Solicitação da consulta via requisição;
- Recebimento do webhook com o resultado da consulta;

---

# Permissão (Geral):

URL: /en/documentation/documentacoes ocultas/perfis_de_acesso

#### Observador

Não consegue realizar nenhuma ação na plataforma, somente visualiza os dados disponíveis.

- Exportar relatórios;
- Download de comprovantes
- Exportar extratos.

#### Operador

 Tem todos os poderes do "observador" e ainda tem poderes para:

- Cadastrar operação;
- Registrar boletos;
- Comandar instruções de boletos;
- Incluir pedido de abertura de conta escrow;
- Incluir solicitação de TED, PIX e pagamento de boletos;
- Solicitar consulta SCR;

#### Administrador

Tem todos os poderes do operador e ainda tem poderes para: 

- Aprovar pagamentos (ted, pix e boleto);
- fazer a gestão de acessos do portal e inclusão de chaves de integração, 
- cadastro de webhooks.

---

# cancelamento_de_solicitacao.md

URL: /en/documentation/documentacoes ocultas/scr/cancelamento_de_solicitacao.md

## Request

- ENDPOINT /scr
- MÉTODO DELETE

**body.json**

```json
{
	"key": "56b330f0-fb6e-4dab-bede-8ae2ecb3f4c6",
	"requester_person_key": "1da2dbd0-af45-4b4d-b685-896e449fa216"
}

```

### Body Params

| Campo |  Tipo | Descrição |
|---|---| ---|
| `key`  | enum | Chave da solicitação (SCR_KEY). | -- |
| `requester_person_key`  | string | Chave do solicitante. | -- |

## Response

status: 200

**Response Body**

```json
{
    "consent_term": null,
    "consulted_at": null,
    "created_at": "2020-04-24",
    "report_end_date": "2020-03",
    "report_start_date": "2020-01",
    "result_document": null,
    "origin_key": "353b7aea-0bc5-4981-8015-16f7ba4252d4",
    "scr_status": "canceled",
    "signers": [
        {
            "name": "Diretor 1",
            "document_number": "03030230074",
            "email": "diretor1@email.com"
        },
        {
            "name": "Diretor 2",
            "document_number": "03030230074",
            "email": "diretor2@email.com"
        }
    ],
    "subject_document_number": "05305188000108",
    "subject_name": "Padaria do Joao Ninguem",
    "subject_person_type": "legal"
}

```

status: 400

**body.json**

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

```

---

# consultar_solicitacao

URL: /en/documentation/documentacoes ocultas/scr/consultar_solicitacao

## Request

Pensando em facilitar o processo, caso o cliente queira fazer uma nova consulta com novas datas base à alguem que já fora previamente consultado, oferecemos a operação /scr/redo. A vantagem de utilizar esta operação é que, caso o documento de autorização para aquela pessoa ainda esteja válido, não haverá a criação de um novo documento para assinatura¹ e a consulta será criada imediatamente. O formato de assinatura do header e do body desta requisição é descrito em detalhes aqui.

- ENDPOINT /scr/ SCR_KEY
- MÉTODO GET

### Path Params

| Campo |  Tipo | Descrição |
|---|---| ---|
| `scr_key`  | string | Chave da solicitação de consulta SCR. | -- |

## Response

status: 200

**Response Body**

```json
{
    "consent_term": null,
    "consulted_at": null,
    "created_at": "2020-04-24",
    "report_end_date": "2020-03",
    "report_start_date": "2020-01",
    "result_document": null,
    "origin_key": "db5d1627-841f-4ddd-97f8-925557531718",
    "scr_status": "pending_signature",
    "signers": [
        {
            "name": "Diretor 1",
            "document_number": "03030230074",
            "email": "diretor1@email.com"
        },
        {
            "name": "Diretor 2",
            "document_number": "03030230074",
            "email": "diretor2@email.com"
        }
    ],
    "subject_document_number": "05305188000108",
    "subject_name": "Padaria do Joao Ninguem",
    "subject_person_type": "legal"
}

```

status: 400

**body.json**

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

```

---

# consultar_solicitacoes

URL: /en/documentation/documentacoes ocultas/scr/consultar_solicitacoes

## Request

Pensando em facilitar o processo, caso o cliente queira fazer uma nova consulta com novas datas base à alguem que já fora previamente consultado, oferecemos a operação /scr/redo. A vantagem de utilizar esta operação é que, caso o documento de autorização para aquela pessoa ainda esteja válido, não haverá a criação de um novo documento para assinatura¹ e a consulta será criada imediatamente. O formato de assinatura do header e do body desta requisição é descrito em detalhes aqui.

- ENDPOINT /scr
- MÉTODO GET

## QUERY PARAMS

| Campo |  Tipo | Descrição |
|---|---| ---|
| `origin_key`  | string | Chave de identificação da operação. Retorna todas as consultas referentes à aquela operação. | -- |
| `subject_person_type`  | enum | Filtro de tipo de pessoa consultada. | -- |
| `subject_document_number`  | string | Filtro de "CPF" ou "CNPJ", não aceita parcial. | -- |
| `created_at_start_date`  | string | Filtro de inicio da faixa de data de criação (formato: YYYY-MM-DD). | -- |
| `created_at_end_date`  | string | Filtro de fim da faixa de data de criação (formato: YYYY-MM-DD). | -- |
| `consulted_at_start_date`  | string | Filtro de inicio da faixa de data de consulta (formato: YYYY-MM-DD). | -- |
| `consulted_at_end_date`  | datetime | Filtro de fim da faixa de data de consulta (formato: YYYY-MM-DD).| -- |
| `scr_status`  | enum | Filtro de status da consulta. | -- |
| `page`  | integer | Página atual que está sendo consultada. | -- |
| `page_size`  | integer | Quantidade de resultados que cabem na página. | -- |

## Enumeradores

### Enumeradores person_type

| Enumerador | Tradução | 
|---|---|
|  natural  |  Pessoa fisica |
|  legal  |  Pessoa juridica |

### Enumeradores scr_status

| Enumerador | Tradução | 
|---|---|
|  created  |  Criado |
|  pending_signature  |  Assinatura pendente |
|  signed  |  Assinado|
|  rejected  |  Rejeitado |
|  consulted  |  Consultado |
|  error  |  Com erro |
|  canceled  |  Cancelado |

## Response

status: 200

**Response Body**

```json
{
    "data": [
        {
            "consent_term": null,
            "consulted_at": null,
            "created_at": "2020-04-24",
            "report_end_date": "2020-03",
            "report_start_date": "2020-01",
            "result_document": null,
            "origin_key": "db5d1627-841f-4ddd-97f8-925557531718",
            "scr_status": "pending_signature",
            "signers": [
                {
                    "name": "Diretor 1",
                    "document_number": "03030230074",
                    "email": "diretor1@email.com"
                },
                {
                    "name": "Diretor 2",
                    "document_number": "03030230074",
                    "email": "diretor2@email.com"
                }
            ],
            "subject_document_number": "05305188000108",
            "subject_name": "Padaria do Joao Ninguem",
            "subject_person_type": "legal"
        }
    ],
    "pagination": {
        "current_page": 1,
        "next_page": null,
        "rows_per_page": 100,
        "total_pages": 1,
        "total_rows": 55
    }
}

```

status: 400

**body.json**

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

```

---

# introducao

URL: /en/documentation/documentacoes ocultas/scr/introducao

Uma das funcionalidades que podemos oferecer em nossa integração é a possibilidade de consulta dos dados disponíveis no SCR de uma pessoa física ou jurídica via API. Com apenas uma solicitação de consulta enviada via request, a QI Tech se encarrega de enviar o pedido de autorização aos consultados, realizar a consulta (após autorizada) e despachar os resultados ao solicitante via webhook.

Além disso, para consultas PJ é possível, com uma única solicitação, consultar a empresa e seus representantes, gerando uma consulta separa para cada um dos documentos.

Assim como as demais APIs a liberação do serviço deve ser feita junto ano nosso time e as chamadas são autenticadas.

Nas subseções abaixo veremos como executar uma consulta ao SCR.

## Fluxo de consulta ao SCR

O Fluxo de consulta ao SCR consiste em:

- Solicitação da consulta (solicitado via request)
- Assinatura da autorização da consulta pelo consultado ou os representantes (enviado via e-mail)
- Realização da consulta (informado resultado via webhook)

---

# refazer_consulta

URL: /en/documentation/documentacoes ocultas/scr/refazer_consulta

## Request

Pensando em facilitar o processo, caso o cliente queira fazer uma nova consulta com novas datas base à alguem que já fora previamente consultado, oferecemos a operação /scr/redo. A vantagem de utilizar esta operação é que, caso o documento de autorização para aquela pessoa ainda esteja válido, não haverá a criação de um novo documento para assinatura¹ e a consulta será criada imediatamente. O formato de assinatura do header e do body desta requisição é descrito em detalhes aqui.

- ENDPOINT /scr/redo
- MÉTODO POST

**body.json**

```json
{
	"report_start_date": "2019-02",
	"report_end_date": "2020-03",
    "origin_key": "bf6b5e8b-93df-4443-b1fc-d760db6ea4ff"
}

```

### Body Params

| Campo |  Tipo | Descrição |
|---|---| ---|
| `report_start_date`  | enum | Data de início da consulta (formato "AAAA-MM"). | -- |
| `report_end_date`  | string | Data final da consulta (formato "AAAA-MM"). | -- |
| `origin_key`  | string | Chave do SCR original (SRC_KEY) que será utilizada para refazer a consulta. | -- |

## Response

status: 200

**Response Body**

```json
{
   "consent_term":"https://urldasassinaturas.com/assinaturas.zip",
   "consulted_at":"2020-05-08",
   "created_at":"2020-05-08",
   "origin_key":"353b7aea-0bc5-4981-8015-16f7ba4252d4",
   "report_end_date":"2020-03",
   "report_start_date":"2019-02",
   "result_document":"https://urldodocumento.com/documento_consulta.pdf",
   "scr_key":"10b3feb4-6afa-425b-8537-99c2aa7afd74",
   "scr_status":"consulted",
   "signers":[
      {
         "document_number":"41184562067",
         "email":"joao.ninguem@yopmail.com",
         "name":"Joao Ninguem"
      }
   ],
   "subject_document_number":"41184562067",
   "subject_name":"Joao Ninguem",
   "subject_person_type":"natural"
}

```

status: 400

**body.json**

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

```

---

# solicitacao_de_consulta

URL: /en/documentation/documentacoes ocultas/scr/solicitacao_de_consulta

## Request

- ENDPOINT /scr
- MÉTODO POST

**body.json**

```json
{
	"person_type": "natural",
	"name": "João Ninguem",
	"document_number": "42866592832",
    "check_representatives": true,
    "report_start_date": "2019-02",
    "report_end_date": "2020-03",
    "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",
			"ip_address": "179.104.42.245",
			"session_id": "ddb1d063-4fdf-4330-af9c-3316e9142ff3",
			"facial_recognition_key": "79003de0-2590-455d-9b73-426b8ca284eb",
			"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": "opt-in"
	}]
}

```

### Body Params

| Campo |  Tipo | Descrição |
|---|---| ---|
| `person_type`  | enum | Tipo de pessoa a ser consultada. | -- |
| `name`  | string | Nome do consultado. | -- |
| `document_number`  | string | CPF ou CNPJ do consultado. | -- |
| `check_representatives`  | boolean | Campo determinante para que haja a consulta dos representantes da empresa (booleano "true" ou "false", se omitido considera-se falso). | -- |
| `report_start_date`  | string | Data de início da consulta (formato "AAAA-MM"). A data mínima disponível para consulta na QI Tech é 2019-02. | -- |
| `report_end_date`  | string | Data final da consulta (formato "AAAA-MM"). | -- |
| `signatures`  | array of objects | Lista contendo objetos de signatarios. | -- |

## Enumeradores

### Enumeradores person_type

| Enumerador | Tradução | 
|---|---|
|  natural  |  Pessoa fisica |
|  legal  |  Pessoa juridica |

## Response

status: 200

**Response Body: PF**

```json
{
	"person_type": "legal",
	"name": "Padaria do Joao Ninguem",
	"document_number": "05305188000108",
    "signers": [
        {
            "name": "Diretor 1",
            "document_number": "41184562067",
            "email": "diretor1@email.com"
        },
        {
            "name": "Diretor 2",
            "document_number": "18631260070",
            "email": "diretor2@email.com"
        }
    ],
	"report_start_date": "2019-02",
	"report_end_date": "2020-03" ,
    "check_representatives": true
}

```

status: 200

**Response Body: PJ**

```json
{
   "webhook_type": "scr",
   "key": "f33384e8-13ed-4e43-adf3-1ba20a4a6004",
   "status": "pending_signature",
   "event_datetime": "1970-01-01 00:00:01"
}

```

status: 400

**body.json**

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

```

---

# webhook

URL: /en/documentation/documentacoes ocultas/scr/webhook

Após o envio de uma solicitação de consulta SCR com sucesso o resto do fluxo fica a cargo da QI Tech. O acompanhamento do resultado da operação é dado via Webhook seguindo o fluxo previamente estipulado. O padrão utilizado é: em caso de sucesso é enviado um webhook informando os dados da consulta, em caso de falha, um webhook é enviado informando que a solicitação foi rejeitada. Além disso o cliente pode escolher durante a contratação do serviço se os dados da consulta serão entregues apenas em pdf ou completo, que no caso retorna além do PDF todos os dados da consulta em JSON. Neste momento o cliente também recebe a chave individual da consulta scr **SCR_KEY**.

## Exemplos de sucesso

Consulta somente em PDF:

```json
{
   "data": {
    "consent_term": "https://urldasassinaturas.com/assinaturas.zip",    
    "consulted_at": "2020-05-08",    
    "created_at": "2020-05-08",   
    "origin_key": OPERATION_KEY,  
    "report_end_date": "2020-03",  
    "report_start_date": "2019-02",    
    "result_document": "https://urldodocumento.com/documento_consulta.pdf",   
    "scr_key": SCR_KEY,  
    "scr_status": "consulted",  
    "signers": [
         {
          "document_number": "41184562067",      
          "email": "joao.ninguem@yopmail.com",      
          "name": "Joao Ninguem",
         }
    ],
    "subject_document_number": "41184562067",   
    "subject_name": "Joao Ninguem",
    "subject_person_type": "natural",
   },
   "webhook_type": "scr",
   "event_datetime": EVENT_DATE_TIME,
   "status": "consulted",
   "key": OPERATION_KEY,
}
```

Consulta completa:

```json
{
   "data":{
      "consent_term":"https://urldasassinaturas.com/assinaturas.zip",
      "consulted_at":"2020-05-08",
      "created_at":"2020-05-08",
      "origin_key": OPERATION_KEY,
      "report_end_date":"2020-03",
      "report_start_date":"2019-02",
      "result_document":"https://urldodocumento.com/documento_consulta.pdf",
      "scr_key": SCR_KEY,
      "scr_status":"consulted",
      "scr_data":[
         {
            "reference_date":"2020-03",
            "financial_institution_count":"3",
            "operation_count":"10",
            "assumed_coobligation":"10235",
            "receive_coobligation":"23569",
            "start_relationship":"2000-05-01",
            "disagreement_operation_count":"2",
            "disagreement_operation_value":"523",
            "subjudice_operations_count":"1",
            "subjudice_operations_value":"10000",
            "indirect_risk":"200000",
            "error":{
               "error_code":"",
               "description":"",
               "error_type":""
            },
            "operation_items":[
               {
                  "due_value": "46800",
                  "exchange_variation": "N",
                  "category_sub":{
                     "category":{
                        "category_code": 2,
                        "category_description": "Empréstimos"

                     },
                     "category_sub_code": 3,
                     "description": "crédito pessoal - sem consignação em folha de pagam."
                  },
                  "due_type":{
                      "due_type_group": "Vencido",
                      "due_code": "205",
                      "description": "Créditos vencidos de 1 a 14 dias",
                  }
               }
            ]
         }
      ],
      "signers":[
         {
            "document_number":"41184562067",
            "email":"joao.ninguem@yopmail.com",
            "name":"Joao Ninguem"
         }
      ],
      "subject_document_number":"41184562067",
      "subject_name":"Joao Ninguem",
      "subject_person_type":"natural"
   },
   "webhook_type":"scr",
   "event_datetime": EVENT_DATE_TIME,
   "status":"consulted",
   "key": OPERATION_KEY
}
```

Consulta com representantes:

```json
{
   "data":[
      {
         "consent_term":"https://urldasassinaturas.com/assinaturas.zip",
         "consulted_at":"2020-08-12",
         "created_at":"2020-08-12",
         "origin_key": OPERATION_KEY,
         "report_end_date":"2019-07",
         "report_start_date":"2019-06",
         "result_document":"https://urldodocumento.com/documento_consulta.pdf",
         "scr_key": SCR_KEY,
         "scr_status":"consulted",
         "signed_at":"2020-08-12",
         "signers":[
            {
               "document_number":"00152300074",
               "email":"joao.ninguem@yopmail.com",
               "name":"João Almeida"
            }
         ],
         "subject_document_number":"97381542000193",
         "subject_name":"Beazini Pizzas",
         "subject_person_type":"legal"
      },
      {
         "consent_term":"https://urldasassinaturas.com/assinaturas.zip",
         "consulted_at":"2020-08-12",
         "created_at":"2020-08-12",
         "origin_key":OPERATION_KEY,
         "report_end_date":"2019-07",
         "report_start_date":"2019-06",
         "result_document":"https://urldodocumento.com/documento_consulta.pdf",
         "scr_key":SCR_KEY,
         "scr_status":"consulted",
         "signed_at":"2020-08-12",
         "signers":[
            {
               "document_number":"00152300074",
               "email":"joao.ninguem@yopmail.com",
               "name":"João Almeida"
            }
         ],
         "subject_document_number":"00152300074",
         "subject_name":"João Almeida",
         "subject_person_type":"natural"
      }
   ],
   "webhook_type":"scr",
   "event_datetime":"EVENT_DATE_TIME",
   "status":"consulted",
   "key": OPERATION_KEY
}
```

## Exemplo de falha

```json
{
   "data": {
    "consent_term": null,    
    "consulted_at": "2020-05-08",    
    "created_at": "2020-05-08",   
    "origin_key": OPERATION_KEY,  
    "report_end_date": "2020-03",  
    "report_start_date": "2019-02",    
    "result_document": null,   
    "scr_key": SCR_KEY,  
    "scr_status": "rejected",  
    "signers": [
         {
            "document_number":"41184562067",
            "email":"joao.ninguem@yopmail.com",
            "name":"Joao Ninguem"
         }
    ],
    "subject_document_number": "41184562067",   
    "subject_name": "Joao Ninguem",
    "subject_person_type": "natural",
   },
   "webhook_type": "scr",
   "event_datetime": EVENT_DATE_TIME,
   "status": "rejected",
   "key": OPERATION_KEY,
}
```

---

# Update credit debt purchaser

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

    ### Important:

    To update the credit debt purchaser, the following requirements must be met:
    - the credit operation cannot be cancelled;
    - the credit operation cannot be in the assignment processing stage;
    - the credit operation cannot be assigned;
    - there must be an active assignment configuration with the new purchaser.

## Request

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

**Request Body**

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

### PATH PARAMS

| Field        | Type   | Description |
|--------------|--------|-------------|
| `debt_key` * | string | Debt Id.    |

## Response

STATUS 201

**Response Body**

```json
{}
```

STATUS 400

**Response Body**

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

---

# Update Related Party Information for the Credit Contract

URL: /en/documentation/emissao_de_divida/atualizar_dados_da_parte_relacionada

## Request

ENDPOINT /debt/ DEBT-KEY /related_party/ RELATED-PARTY-KEY
METHOD PATCH

### Pessoa Física
**Request Body**

```json
{
  "name": "Teste teste",
  "email": "teste@teste.com",
  "address": {
    "street": "Rua teste",
    "neighborhood": "Bairro teste",
    "number": "123",
    "postal_code": "09725540",
    "city": "S\u00e3o Caetano do sul",
    "state": "SP"
  },
  "phone": {
    "country_code": "55",
    "area_code": "11",
    "number": "41234123"
  },
  "mother_name": "M\u00e3e 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"
}
```

### Pessoa Jurídica
**Request Body**

```json
{
	"name": "Teste teste",
	"email": "teste@teste.com",
	"address": {
		"street": "Rua teste",
		"neighborhood": "Bairro teste",
		"number": "123",
		"postal_code": "09725540",
		"city": "S\u00e3o 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
}
```

### PATH PARAMS

| Field | Type | Description |
|---|---|---|
| `debt_key` * | string | Operation debt_key. |
| `related_party_key` * | string |  Key of the related party to whom the documents will be sent. |

## Response

STATUS 201

**Response Body**

```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

**Response Body**

```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\u00e3o permite atualizar a parte relacionada.\", \"extra_fields\": {}, \"code\": \"COP000328\"}"
}
```

---

# Authorize disbursement

URL: /en/documentation/emissao_de_divida/autorizar_desembolso

## Request

ENDPOINT /debt/ DEBT-KEY /allow_disbursement
METHOD POST

**Request Body**

```json
{
   "allow_disbursement": true
}

```

### PATH PARAMS

| Field | Type | Description |
|---|---| ---|
| `debt_key` *(mandatory)* | string | Issued debt KEY. |

### BODY PARAMS

| Field | Type | Description |
|---|---| ---|
| `allow_disbursement` | string | Disbursement authorization indication. |

## Response

STATUS 400

**Request Body**

```json

"encurtar o json"

```

STATUS 400

**Request Body**

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

---

# Cancel debt before disbursement.

URL: /en/documentation/emissao_de_divida/cancelamento/cancelar_divida_antes_de_desembolsar

## Request

ENDPOINT /debt/ DEBT-KEY /cancel
METHOD PATCH

## Response

STATUS 200

Response Body

```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

Response Body

```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"
}
```

## PATH PARAMS

| Field | Type | Description |
|---|---| ---|
| `debt_key` * | string | Debt key returned at the moment of credit operation creation. |

---

# Cancelar permanentemente

URL: /en/documentation/emissao_de_divida/cancelamento/cancelar_permanentemente

## Request

ENDPOINT /debt/ debt_key /cancel_permanently
MÉTODO POST

## Response

STATUS 200

Response Body

```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": [
        {
          "signature_url": "https://sign.qitech.com.br/s/hNrwjda",
          "signer_document_number": "94632180173",
          "signer_email": "pedro.alves@yopmail.com",
          "signer_external_key": "07a1c438-43a4-49a9-85a9-29667507453b",
          "signer_name": "Pedro Felipe Henrique Alves",
          "signer_role": "issuer"
        },
        {
          "signature_url": "https://sign.qitech.com.br/s/EaTajda",
          "signer_document_number": "34651104630",
          "signer_email": "patricia.tereza@yopmail.com",
          "signer_external_key": "61a1ea50-769a-410a-8ef8-09f0ce4611f6",
          "signer_name": "Patrícia Tereza Bernardes",
          "signer_role": "guarantor"
        }
      ],
      "urls": [
        "https://storage.googleapis.com/sandbox-doc-api/documents/abedfeab-dcf8-4e13-897b-da02c222cef4/SALGADINHO_SALETE_LTDA-PARMALAT-CCB-1907258737-20220512165254.pdf"
      ]
    },
    "contract_fee_amount": 50000,
    "contract_fees": [
      {
        "fee_amount": 50000,
        "fee_type": "tac"
      }
    ],
    "external_contract_fee_amount": 0,
    "external_contract_fees": [],
    "installments": [
      {
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2019-08-26",
        "calendar_days": 32,
        "digitable_line": null,
        "due_date": "2019-08-26",
        "due_interest": null,
        "due_principal": 10000000,
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "81e4a732-d300-4e39-b6d5-2d9ac8df429b",
        "installment_number": 1,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 10000000,
        "original_pre_fixed_amount": 1125598.54,
        "original_principal_amortization_amount": 1000000,
        "original_total_amount": null,
        "paid_amount": 0,
        "paid_at": null,
        "payments": [],
        "post_fixed_amount": null,
        "pre_fixed_amount": 1125598.54,
        "principal_amortization_amount": 1000000,
        "tax_amount": 1312,
        "total_amount": null,
        "total_paid_amount": 0,
        "workdays": 22
      },
      {
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2019-09-25",
        "calendar_days": 30,
        "digitable_line": null,
        "due_date": "2019-09-25",
        "due_interest": null,
        "due_principal": 9000000,
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "bac4fe3e-9559-4380-9f4b-bdda3492738e",
        "installment_number": 2,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 9000000,
        "original_pre_fixed_amount": 946509.06,
        "original_principal_amortization_amount": 1000000,
        "original_total_amount": null,
        "paid_amount": 0,
        "paid_at": null,
        "payments": [],
        "post_fixed_amount": null,
        "pre_fixed_amount": 946509.06,
        "principal_amortization_amount": 1000000,
        "tax_amount": 2542,
        "total_amount": null,
        "total_paid_amount": 0,
        "workdays": 22
      },
      {
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2019-10-25",
        "calendar_days": 30,
        "digitable_line": null,
        "due_date": "2019-10-25",
        "due_interest": null,
        "due_principal": 8000000,
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "aaaec4d7-94a0-418d-8a8e-ac7af6787aec",
        "installment_number": 3,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 8000000,
        "original_pre_fixed_amount": 841341.39,
        "original_principal_amortization_amount": 1000000,
        "original_total_amount": null,
        "paid_amount": 0,
        "paid_at": null,
        "payments": [],
        "post_fixed_amount": null,
        "pre_fixed_amount": 841341.39,
        "principal_amortization_amount": 1000000,
        "tax_amount": 3772,
        "total_amount": null,
        "total_paid_amount": 0,
        "workdays": 22
      },
      {
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2019-11-25",
        "calendar_days": 31,
        "digitable_line": null,
        "due_date": "2019-11-25",
        "due_interest": null,
        "due_principal": 7000000,
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "bead5a38-c56e-4cfc-98f9-af6d71ec7d65",
        "installment_number": 4,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 7000000,
        "original_pre_fixed_amount": 762003.23,
        "original_principal_amortization_amount": 1000000,
        "original_total_amount": null,
        "paid_amount": 0,
        "paid_at": null,
        "payments": [],
        "post_fixed_amount": null,
        "pre_fixed_amount": 762003.23,
        "principal_amortization_amount": 1000000,
        "tax_amount": 5043,
        "total_amount": null,
        "total_paid_amount": 0,
        "workdays": 20
      },
      {
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2019-12-26",
        "calendar_days": 31,
        "digitable_line": null,
        "due_date": "2019-12-26",
        "due_interest": null,
        "due_principal": 6000000,
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "350a89e3-58a7-4879-b7ff-5fa0391da39c",
        "installment_number": 5,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 6000000,
        "original_pre_fixed_amount": 653145.63,
        "original_principal_amortization_amount": 1000000,
        "original_total_amount": null,
        "paid_amount": 0,
        "paid_at": null,
        "payments": [],
        "post_fixed_amount": null,
        "pre_fixed_amount": 653145.63,
        "principal_amortization_amount": 1000000,
        "tax_amount": 6314,
        "total_amount": null,
        "total_paid_amount": 0,
        "workdays": 22
      },
      {
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2020-01-27",
        "calendar_days": 32,
        "digitable_line": null,
        "due_date": "2020-01-27",
        "due_interest": null,
        "due_principal": 5000000,
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "bf935dc2-3151-4f66-91c6-35e446b57f2e",
        "installment_number": 6,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 5000000,
        "original_pre_fixed_amount": 562799.27,
        "original_principal_amortization_amount": 1000000,
        "original_total_amount": null,
        "paid_amount": 0,
        "paid_at": null,
        "payments": [],
        "post_fixed_amount": null,
        "pre_fixed_amount": 562799.27,
        "principal_amortization_amount": 1000000,
        "tax_amount": 7626,
        "total_amount": null,
        "total_paid_amount": 0,
        "workdays": 20
      },
      {
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2020-02-26",
        "calendar_days": 30,
        "digitable_line": null,
        "due_date": "2020-02-26",
        "due_interest": null,
        "due_principal": 4000000,
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "76aad8ce-3ee1-464c-90db-d72a2729560e",
        "installment_number": 7,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 4000000,
        "original_pre_fixed_amount": 420670.69,
        "original_principal_amortization_amount": 1000000,
        "original_total_amount": null,
        "paid_amount": 0,
        "paid_at": null,
        "payments": [],
        "post_fixed_amount": null,
        "pre_fixed_amount": 420670.69,
        "principal_amortization_amount": 1000000,
        "tax_amount": 8856,
        "total_amount": null,
        "total_paid_amount": 0,
        "workdays": 20
      },
      {
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2020-03-25",
        "calendar_days": 28,
        "digitable_line": null,
        "due_date": "2020-03-25",
        "due_interest": null,
        "due_principal": 3000000,
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "fc190222-5baf-4023-9e93-95b25774a37e",
        "installment_number": 8,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 3000000,
        "original_pre_fixed_amount": 293473.82,
        "original_principal_amortization_amount": 1000000,
        "original_total_amount": null,
        "paid_amount": 0,
        "paid_at": null,
        "payments": [],
        "post_fixed_amount": null,
        "pre_fixed_amount": 293473.82,
        "principal_amortization_amount": 1000000,
        "tax_amount": 10004,
        "total_amount": null,
        "total_paid_amount": 0,
        "workdays": 20
      },
      {
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2020-04-27",
        "calendar_days": 33,
        "digitable_line": null,
        "due_date": "2020-04-27",
        "due_interest": null,
        "due_principal": 2000000,
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "7c2972a8-def7-4b76-b215-0ade0a5bca13",
        "installment_number": 9,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 2000000,
        "original_pre_fixed_amount": 232548.93,
        "original_principal_amortization_amount": 1000000,
        "original_total_amount": null,
        "paid_amount": 0,
        "paid_at": null,
        "payments": [],
        "post_fixed_amount": null,
        "pre_fixed_amount": 232548.93,
        "principal_amortization_amount": 1000000,
        "tax_amount": 11357,
        "total_amount": null,
        "total_paid_amount": 0,
        "workdays": 21
      },
      {
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2020-05-25",
        "calendar_days": 28,
        "digitable_line": null,
        "due_date": "2020-05-25",
        "due_interest": null,
        "due_principal": 1000000,
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "d848c880-f489-4bc1-a9e4-101f8d664317",
        "installment_number": 10,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 1000000,
        "original_pre_fixed_amount": 97824.6,
        "original_principal_amortization_amount": 1000000,
        "original_total_amount": null,
        "paid_amount": 0,
        "paid_at": null,
        "payments": [],
        "post_fixed_amount": null,
        "pre_fixed_amount": 97824.6,
        "principal_amortization_amount": 1000000,
        "tax_amount": 12505,
        "total_amount": null,
        "total_paid_amount": 0,
        "workdays": 19
      }
    ],
    "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

Response Body

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

```

---

# Debt cancelation within 7 days of disbursement

URL: /en/documentation/emissao_de_divida/cancelamento/desistencia/cancelamento_de_divida_em_ate_sete_dias_apos_o_desembolso

## Request

ENDPOINT /debt/reversal
METHOD POST

Request Body

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

```

## Response

STATUS 200

Response Body

```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

Response Body

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

```

## Definições
| Field             | Type   | Description                      | Max. Caract. |
|-------------------|--------|--------------------------------|--------------|
| `contract_number` * | string | Credit contract number.      |              |

---

# Query reversal pix qr code

URL: /en/documentation/emissao_de_divida/cancelamento/desistencia/consulta_de_pix_qr_code_de_devolucao

Returns the reversal pix qr code previously generated for a credit operation that is being canceled. Use this endpoint after creating the reversal at `/debt/reversal` to retrieve the qr code data again (for example, to re-display it to the payer).

## Request

ENDPOINT /credit_operation/{credit_operation_key}/pix_qrcode
METHOD GET

:::info
This request has no body. The `credit_operation_key` must be provided as a path parameter in the URL.
:::

## Response

STATUS 200

Response Body

```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

Response Body — Credit Operation not found

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

Response Body — Reversal not found

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

## Definitions

### Path parameters

| Field | Type | Description |
|-------|------|-------------|
| `credit_operation_key` * | string (uuid) | Unique key of the credit operation for which the reversal pix qr code was generated. |

### Response fields

| Field | Type | Description |
|-------|------|-------------|
| `amount` | string | Reversal pix qr code amount, in BRL. |
| `copy_paste_pix` | string | Pix copy-and-paste code to be used for payment. |
| `debt_key` | string (uuid) | Key of the credit operation (debt) associated with the reversal. |
| `expiration_date` | string (date) | Expiration date of the pix qr code, in `YYYY-MM-DD` format. |
| `payer_document_number` | string | Payer's CPF/CNPJ. |
| `payer_name` | string | Payer's name. |
| `qr_code_key` | string (uuid) | Unique key of the issued pix qr code. |
| `reversal_key` | string (uuid) | Unique key of the reversal associated with the pix qr code. |
| `status` | string | Current status of the pix qr code (e.g., `waiting_payment`). |

---

# Introduction

URL: /en/documentation/emissao_de_divida/cancelamento/desistencia/introducao

In order to comply with the Consumer Protection Code, which allows the borrower to cancel the debt within 7 days through digital means, QI Tech has enabled a specific functionality to accommodate these cases.

## Operation

In QI Tech's systems, there are two ways to cancel a debt due to withdrawal within 7 days:

### 1 -Through Pix chargeback

If the borrower received the disbursement via Pix, it is possible to cancel the operation through a chargeback of the full disbursed amount up to 7 days after the disbursement date.

### 2 - Through the cancellation API

Using the [POST /debt/reversal](cancelamento_de_divida_em_ate_sete_dias_apos_o_desembolso) endpoint, it is possible to generate a QR code which, once paid by the borrower, cancels the operation.

In both cases, once the money reaches QI Tech, the operation is canceled, and if the contract assignment has already occurred, the amount is refunded to the assignee. This endpoint can be used up to 7 days after disbursement, and the expiration of the QR Code is set to 14 days after its generation. After this period, it is no longer possible to cancel the contract.

## Requirements

For the proper functioning of this endpoint, it is necessary to contact the QI Tech support team to enable the endpoint and configure the assignee's account for funds reversal.

---

# Introduction

URL: /en/documentation/emissao_de_divida/cancelamento/introducao

There are two types of debt cancellations that can be performed through QI Tech's systems.

1 - Cancellation before disbursement;

2 - Cancellation up to seven days after disbursement;

---

# Error Catalog - Lending-as-a-Service

URL: /en/documentation/emissao_de_divida/catalogo_de_erros_laas

Below are all errors that may be returned by Lending-as-a-Service APIs.
Each error code has a unique identifier that can be used as a reference.

## Common Errors

Errors shared across all platform APIs.

| Code | HTTP | Message |
|-|-|-|
| <a id="QIT000001"></a>`QIT000001` | 400 | **Schema Validator Error**<br/>{description}<br/><small>Payload Inválido</small> |
| <a id="QIT000002"></a>`QIT000002` | 403 | **Permission Validator Error**<br/>Request must be internal |
| <a id="QIT000003"></a>`QIT000003` | 403 | **Permission Validator Error**<br/>The agent does not have enough roles.<br/><small>O agente não tem funções suficientes.</small> |
| <a id="QIT000004"></a>`QIT000004` | 403 | **Permission Validator Error**<br/>Selected agent and person_key are different<br/><small>Agente selecionado e person_key são diferentes</small> |
| <a id="QIT000005"></a>`QIT000005` | 403 | **Permission Validator Error**<br/>Selected agent do not own this item.<br/><small>O agente selecionado não é dono do item.</small> |
| <a id="QIT000006"></a>`QIT000006` | 403 | **Permission Validator Error**<br/>Selected agent do not own this item and has not enough roles.<br/><small>Agente selecionado não é dono deste item e não tem funções suficientes.</small> |
| <a id="QIT000007"></a>`QIT000007` | - | **External API Error (Rest Connector)**<br/>{description}<br/><small>{translation}</small> |
| <a id="QIT000010"></a>`QIT000010` | 400 | **Search Params Error**<br/>Invalid integer value for page or size querystring parameters<br/><small>Valor inválido para parâmetros página ou tamanho de página</small> |
| <a id="QIT000400"></a>`QIT000400` | 400 | **Bad Request**<br/>The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, size too large, invalid request message framing, or deceptive request routing)<br/><small>O servidor não pode ou não processará a requisição devido a um erro do cliente (por exemplo, corpo da requisição inválido, tamanho muito grande, formatação da mensagem inválida ou rota inválida)</small> |
| <a id="QIT000404"></a>`QIT000404` | 404 | **Not Found**<br/>The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible<br/><small>O resource solicitado não pôde ser encontrado, mas pode estar disponível no futuro. Requests subsequentes do cliente são permitidos</small> |
| <a id="QIT000500"></a>`QIT000500` | 500 | **Internal Error**<br/>An internal error has occurred and its being investigated.<br/><small>Um erro interno aconteceu e está sendo investigado.</small> |
| <a id="QIT000753"></a>`QIT000753` | 500 | **Internal Error**<br/>An internal error has occurred and its being investigated.<br/><small>Um erro interno aconteceu e está sendo investigado.</small> |

## Specific Errors

### COP — Credit Operations

468 errors

| Code | HTTP | Message |
|-|-|-|
| <a id="COP000001"></a>`COP000001` | 400 | **Bad Request**<br/>Line: {index}. Invalid {value} value sent<br/><small>Linha: {index}. Valor enviado {value} inválido</small> |
| <a id="COP000002"></a>`COP000002` | 400 | **Bad Request**<br/>[{value}] Column missing<br/><small>[{value}] Coluna faltando</small> |
| <a id="COP000003"></a>`COP000003` | 400 | **Bad Request**<br/>No positions found<br/><small>Posições não encontradas</small> |
| <a id="COP000004"></a>`COP000004` | 400 | **Bad Request**<br/>Line: {index}. Invalid {value} date sent<br/><small>Linha: {index}. Data enviada {value} inválida</small> |
| <a id="COP000005"></a>`COP000005` | 400 | **Bad Request**<br/>CSV file not sent<br/><small>Arquivo CSV não enviado</small> |
| <a id="COP000006"></a>`COP000006` | 404 | **Not Found**<br/>Assignment not found for assignment_key {assignment_key}<br/><small>Cessão não encontrado para assignment_key {assignment_key}</small> |
| <a id="COP000007"></a>`COP000007` | 404 | **Not Found**<br/>No requester_configuration found for requester_key {requester_key}<br/><small>Configuração do solicitante não encontrada para a requester_key {requester_key}</small> |
| <a id="COP000008"></a>`COP000008` | 404 | **Not Found**<br/>Active configuration not found for requester_key {requester_key} and purchaser with CNPJ {document_number}<br/><small>Configuração ativa não encontrada para requester_key {requester_key} e cessionário com CNPJ {document_number}</small> |
| <a id="COP000009"></a>`COP000009` | 404 | **Not Found**<br/>Purchaser with CNPJ {purchaser_document_number} not found<br/><small>Cessionário com CNPJ {purchaser_document_number} não encontrado</small> |
| <a id="COP000010"></a>`COP000010` | 400 | **Bad Request**<br/>No purchaser defined for credit_operation {credit_operation_key}. Purchaser is required to assign a debt emission<br/><small>Cessionário não definido para a credit_operation {credit_operation_key}. Necessário para designar a emissao de dívida</small> |
| <a id="COP000011"></a>`COP000011` | 400 | **Bad Request**<br/>Different purchasers defined. Assignment operations can only assign debt emissions grouping them by the same purchaser.<br/><small>Cessionários diferentes. As cessões só podem atribuir a emissão de dívidas para um mesmo cessionário.</small> |
| <a id="COP000012"></a>`COP000012` | 422 | **Unprocessable Entity**<br/>Credit Operation {credit_operation_key} status is {co_status}. Can't create assignment<br/><small>O status da operação {credit_operation_key} é {co_status}. Não é possivel criar a cessão</small> |
| <a id="COP000013"></a>`COP000013` | 400 | **Bad Request**<br/>Different third_party_account_key between requester {requester_key} and credit_operation with key {credit_operation_key}<br/><small>third_party_account_key diferente entre o solicitante {requester_key} e credit_operation com a chave {credit_operation_key}</small> |
| <a id="COP000014"></a>`COP000014` | 400 | **Bad Request**<br/>Different credit operation ownership. Assignment operations can only assign debt emissions with the same owner.<br/><small>Propriedade diferente da operação de crédito. As cessões só podem atribuir emissões de dívida com o mesmo proprietário.</small> |
| <a id="COP000015"></a>`COP000015` | 400 | **Bad Request**<br/>Credit Operation {credit_operation_key} already has an assignment {assignment_key} with status {assignment_status_enumerator}.<br/><small>Operação {credit_operation_key} já foi cessionada {assignment_key} com status {assignment_status_enumerator}.</small> |
| <a id="COP000016"></a>`COP000016` | 400 | **Bad Request**<br/>Non existent document_key received, and requester doesn't have an assignment_template_key registered for purchaser with CNPJ {document_number}. One of them must exist to create an assignment.<br/><small>Chave do documento não existe e solicitante não possui assignment_template_key registrada para o cessionário com CNPJ {document_number}. Um dos dois deve existir para criar uma cessão.</small> |
| <a id="COP000017"></a>`COP000017` | 400 | **Bad Request**<br/>Document not found for key {document_key}<br/><small>Documento {document_key} não encontrado</small> |
| <a id="COP000018"></a>`COP000018` | 423 | **Locked**<br/>Operation window closed. System available from {OPENING_TIME} to {CLOSING_TIME}<br/><small>Operação encerrada. Sistema disponível de {OPENING_TIME} até {CLOSING_TIME}</small> |
| <a id="COP000019"></a>`COP000019` | 423 | **Locked**<br/>Operation window closed. System available only during work days.<br/><small>Operação encerrada. Sistema disponível somente em dias úteis.</small> |
| <a id="COP000020"></a>`COP000020` | 404 | **Not Found**<br/>No correspondent requester configuration exists in the database. Keep in mind that there is a fallback to null issuer_document_number<br/><small>requester_configuration correspondente não encontrada no banco de dados. Lembre-se de que existe um fallback para issuer_document_number nulo</small> |
| <a id="COP000021"></a>`COP000021` | 422 | **Invalid Data**<br/>Credit operation has invalid data: impossible to calculate values for expected disbursed amount<br/><small>A operação possui dados inválidos: impossível calcular valores para o desembolso esperado</small> |
| <a id="COP000022"></a>`COP000022` | 404 | **Not Found**<br/>Issuer not found<br/><small>Emissor não encontrado</small> |
| <a id="COP000023"></a>`COP000023` | 400 | **Bad Request**<br/>Document Key or document batch key must not be Null<br/><small>Chave do documento ou do lote de documentos não pode ser nula</small> |
| <a id="COP000024"></a>`COP000024` | 400 | **Bad Request**<br/>Status must not be Null<br/><small>Status não pode ser nulo</small> |
| <a id="COP000025"></a>`COP000025` | 400 | **Bad Request**<br/>Outgoing TED Key must not be Null<br/><small>Chave da TED de saída (outgoing_ted_key) não pode ser nula</small> |
| <a id="COP000026"></a>`COP000026` | 400 | **Bad Request**<br/>CO Key (credit_operation_key) must not be Null<br/><small>Chave da CO (credit_operation_key) não pode ser nula</small> |
| <a id="COP000027"></a>`COP000027` | 404 | **Not Found**<br/>Credit Operation not found<br/><small>Operação não encontrada</small> |
| <a id="COP000028"></a>`COP000028` | 400 | **Bad Request**<br/>{errors}<br/><small>{translated_errors}</small> |
| <a id="COP000029"></a>`COP000029` | 400 | **Bad Request**<br/>Parameter key or bank_slip_key is missing.<br/><small>O parâmetro key ou bank_slip_key está faltando.</small> |
| <a id="COP000030"></a>`COP000030` | 422 | **Unprocessable Entity**<br/>There is no rebate account in the requester configuration to send the rebate amount (payload external_contract_fee_amount is greater than 0)<br/><small>Não há uma conta de reembolso na configuração do solicitante para enviar o valor do reembolso (payload external_contract_fee_amount é maior que 0)</small> |
| <a id="COP000031"></a>`COP000031` | 422 | **Unprocessable Entity**<br/>External contract fee type was not specified in the requester configuration (payload external_contract_fee_amount is greater than 0)<br/><small>O tipo de taxa do contrato externo não foi especificado na configuração do solicitante (payload external_contract_fee_amount é maior que 0)</small> |
| <a id="COP000032"></a>`COP000032` | 422 | **Unprocessable Entity**<br/>Requester configuration has incomplete rebate data. In order to use requester configuration, either all rebate data must be filled or all of it has to be nullified<br/><small>A configuração do solicitante possui dados de descontos incompletos. Para usar a configuração do solicitante, todos os dados de descontos devem ser preenchidos ou todos devem ser anulados</small> |
| <a id="COP000034"></a>`COP000034` | 400 | **Bad Request**<br/>Missing purchaser configuration<br/><small>Configuração do cessionário ausente</small> |
| <a id="COP000035"></a>`COP000035` | 400 | **Bad Request**<br/>Requester not allowed to create a credit operation without purchaser<br/><small>Solicitante não tem permissão para criar uma operação sem o cessionário</small> |
| <a id="COP000036"></a>`COP000036` | 422 | **Unprocessable Entity**<br/>Invalid percentage receivable: total percentage is different than 100%<br/><small>Porcentagem inválida: o valor total é diferente de 100%</small> |
| <a id="COP000037"></a>`COP000037` | 400 | **Bad Request**<br/>Missing third_party_account<br/><small>conta de origem de desembolso não cadastrada</small> |
| <a id="COP000038"></a>`COP000038` | 422 | **Unprocessable Entity**<br/>Requester configuration fee amount is a percentage greater than 100%. Please check requester configuration data.<br/><small>O valor da taxa da configuração do solicitante é uma porcentagem superior a 100%. Verifique os dados da configuração do solicitante.</small> |
| <a id="COP000039"></a>`COP000039` | 400 | **Bad Request**<br/>Credit Operation with IF Code = {if_code} not found<br/><small>Operação com código da instituição financeira {if_code} não encontrada</small> |
| <a id="COP000040"></a>`COP000040` | 400 | **Bad Request**<br/>Credit Operation with IF Code = {if_code} does not have a payable installment yet<br/><small>Operação com código da instituição financeira {if_code} ainda não tem uma parcela a pagar</small> |
| <a id="COP000041"></a>`COP000041` | 400 | **Bad Request**<br/>CSV Complement for Credit Operation with IF Code = {if_code} already read<br/><small>CSV complementar para operação de crédito com código IF = {if_code} já lido</small> |
| <a id="COP000042"></a>`COP000042` | 400 | **Bad Request**<br/>Cetip Control Message LTR = {control_number_ltr} already processed<br/><small>Mensagem de controle da Cetip LTR = {control_number_ltr} já foi processada</small> |
| <a id="COP000043"></a>`COP000043` | 400 | **Bad Request**<br/>Cetip LTR Confirmation = {control_number_if} Request Message not found<br/><small>Confirmação Cetip LTR = {control_number_if} Mensagem solicitada não encontrada</small> |
| <a id="COP000044"></a>`COP000044` | 400 | **Bad Request**<br/>Cetip Control Message LTR Confirmation = {control_number_ltr} already processed<br/><small>Confirmação LTR da mensagem de controle Cetip = {control_number_ltr} já processada</small> |
| <a id="COP000045"></a>`COP000045` | 400 | **Bad Request**<br/>No CETIP Settlement found to confirm for the LTR Confirmation {control_number_ltr}<br/><small>Nenhuma liquidação encontrada está pendente confirmação para a Confirmação LTR {control_number_ltr}</small> |
| <a id="COP000046"></a>`COP000046` | 400 | **Bad Request**<br/>Expected value {expected_amount} is different from cetip message {amount}<br/><small>Valor esperado {expected_amount} é diferente da mensagem da cetip {amount}</small> |
| <a id="COP000048"></a>`COP000048` | 409 | **Conflict**<br/>Installment number {installment_number} from operation with IF Code = {if_code} is not ready for payment yet<br/><small>O número da parcela {installment_number} da operação com Código IF = {if_code} ainda não está pronto para o pagamento</small> |
| <a id="COP000049"></a>`COP000049` | 400 | **Bad Request**<br/>Number of installments  or 'number of installments - principal grace period' cannot be zero.<br/><small>O número de parcelas ou 'número de parcelas - período de carência  não pode ser zero.</small> |
| <a id="COP000050"></a>`COP000050` | 400 | **Bad Request**<br/>Credit Operation Information can not calculate cet<br/><small>Não foi possível calcular cet da operação</small> |
| <a id="COP000051"></a>`COP000051` | 400 | **Bad Request**<br/>To execute bankslip payment method without a creditor_bank_account, issuer must be a valid person on onboarding.<br/><small>Para executar o método de pagamento de boleto bancário sem uma creditor_bank_account, o emissor deve ser uma pessoa válida na integração.</small> |
| <a id="COP000052"></a>`COP000052` | 400 | **Bad Request**<br/>To execute bankslip payment method, issuer must be a valid person on onboarding.<br/><small>Para executar o método de pagamento de boleto bancário, o emissor deve ser uma pessoa válida na integração.</small> |
| <a id="COP000053"></a>`COP000053` | 400 | **Bad Request**<br/>Integrated Payment Method needs minimum of one disbursement account<br/><small>O método de pagamento integrado precisa de no mínimo uma conta de desembolso</small> |
| <a id="COP000054"></a>`COP000054` | 400 | **Bad Request**<br/>Internal disbursement account of number {account_number}-{account_branch} is invalid.<br/><small>Conta de desembolso interna com número {account_number}-{account_branch} inválida</small> |
| <a id="COP000055"></a>`COP000055` | 400 | **Bad Request**<br/>Integrated Payment Method needs settlement bank account key or a internal disbursement account to perform installment payment.<br/><small>O Método de pagamento integrado precisa da chave da conta bancária de liquidação ou de uma conta de desembolso interna para efetuar o pagamento parcelado</small> |
| <a id="COP000056"></a>`COP000056` | 400 | **Bad Request**<br/>Invalid settlement bank account key.<br/><small>Chave de conta bancária de liquidação inválida.</small> |
| <a id="COP000057"></a>`COP000057` | 400 | **Bad Request**<br/>Disbursement accounts' receivable specification must not be of mixed nature (absolute and percentage values).<br/><small>A especificação de recebimento das contas de desembolsos não deve ser de natureza mista (valores absolutos e percentuais).</small> |
| <a id="COP000058"></a>`COP000058` | 422 | **Unprocessable Entity**<br/>Resource account has invalid balance data<br/><small>Saldo inválido na conta de origem</small> |
| <a id="COP000059"></a>`COP000059` | 422 | **Unprocessable Entity**<br/>Total expenses are greater than issued amount for this operation<br/><small>O total de despesas é maior que o valor emitido para esta operação</small> |
| <a id="COP000060"></a>`COP000060` | 422 | **Unprocessable Entity**<br/>Issue amount is greater than resource account balance. Operation has been aborted<br/><small>O valor da emissão é maior que o saldo da conta de origem. A operação foi interrompida</small> |
| <a id="COP000061"></a>`COP000061` | 422 | **Unprocessable Entity**<br/>Rebate taxes are greater than rebate amount for this operation<br/><small>O valor da emissão é maior que o saldo da conta de origem. A operação foi interrompida</small> |
| <a id="COP000062"></a>`COP000062` | 422 | **Unprocessable Entity**<br/>This credit operation has no rebate account to transfer the rebate amount<br/><small>Esta operação não possui uma conta de reembolso para transferir o valor do reembolso</small> |
| <a id="COP000063"></a>`COP000063` | 400 | **Bad Request**<br/>Cannot ensure disbursed amount for non amount_receivable accounts<br/><small>Não é possível garantir o valor desembolsado para contas que não são amount_receivable</small> |
| <a id="COP000064"></a>`COP000064` | 400 | **Validation Error**<br/>{parse_error} |
| <a id="COP000065"></a>`COP000065` | 400 | **Validation Error**<br/>{parse_error} |
| <a id="COP000066"></a>`COP000066` | 400 | **Bad Request**<br/>Missing parameters for GET request<br/><small>GET request faltando parâmetros</small> |
| <a id="COP000067"></a>`COP000067` | 404 | **Not Found**<br/>Credit Operation was not found for the given parameters.<br/><small>Operação não encontrada para os parâmetros fornecidos.</small> |
| <a id="COP000068"></a>`COP000068` | 400 | **Bad Request**<br/>Please provide only one of {issue_amount, disbursed_issue_amount, final_disbursement_amount}. If one is valid, the other must be null<br/><small>Forneça apenas um dentre {issue_amount, disbursed_issue_amount, final_disbursement_amount}. Se um for válido, os outros devem ser nulos</small> |
| <a id="COP000069"></a>`COP000069` | 404 | **Not Found**<br/>Credit Operation with contract number {contract_number} not found<br/><small>Operação com número de contrato {contract_number} não encontrada</small> |
| <a id="COP000070"></a>`COP000070` | 400 | **Bad Request**<br/>Duplicated cetip assignments control numbers<br/><small>Números de controle de atribuições da cetip duplicados</small> |
| <a id="COP000071"></a>`COP000071` | 400 | **Bad Request**<br/>Total expected amount {total_expected_amount} is different from Credit Operation amount {issue_amount}<br/><small>O valor total esperado {total_expected_amount} é diferente do valor da operação de crédito {issue_amount}</small> |
| <a id="COP000073"></a>`COP000073` | 400 | **Bad Request**<br/>No active configuration found for requester {requester_key} and purchaser with CNPJ {purchaser_document_number}.<br/><small>Nenhuma configuração ativa encontrada para o solicitante {requester_key} e cessionário with CNPJ {purchaser_document_number}.</small> |
| <a id="COP000074"></a>`COP000074` | 400 | **Bad Request**<br/>Credit Operation with keys {endorsed_co_key_list} is already endorsed<br/><small>A operação de crédito com chaves {endorsed_co_key_list} já foi endossada</small> |
| <a id="COP000075"></a>`COP000075` | 404 | **Not Found**<br/>Credit Operation not found for the given key for {key}<br/><small>Operação de crédito não encontrada para a seguinte chave {key}</small> |
| <a id="COP000076"></a>`COP000076` | 400 | **Bad Request**<br/>Credit Operation with keys {key} does not have valid document<br/><small>A operação de crédito com chaves {key} não possui documento válido</small> |
| <a id="COP000077"></a>`COP000077` | 400 | **Bad Request**<br/>Credit Operation with keys {key} are waiting signature<br/><small>A operação de crédito com chaves {key} estão esperando assinatura</small> |
| <a id="COP000078"></a>`COP000078` | 400 | **Bad Request**<br/>Credit Operation with keys {key} are cancelled<br/><small>A operação de crédito com chaves {key} foram canceladas</small> |
| <a id="COP000079"></a>`COP000079` | 400 | **Bad Request**<br/>Missing mandatory parameter: document_number<br/><small>Parâmetro obrigatório ausente: document_number</small> |
| <a id="COP000080"></a>`COP000080` | 404 | **Not Found**<br/>No purchaser found with document number {document_number}.<br/><small>Cessionário com número de documento {document_number} não encontrado.</small> |
| <a id="COP000081"></a>`COP000081` | 400 | **Bad Request**<br/>Purchaser with document number {document_number} already registered. Use PUT /purchaser<br/><small>Cessionário com número de documento {document_number} já registrado. Use PUT /purchaser</small> |
| <a id="COP000082"></a>`COP000082` | 400 | **Bad Request**<br/>Purchaser with document number {document_number} não registered. Use PUT /purchaser<br/><small>Cessionário com número de documento {document_number} não registrado. Use PUT /purchaser</small> |
| <a id="COP000083"></a>`COP000083` | 400 | **Bad Request**<br/>Missing mandatory parameter: requester_key<br/><small>Parâmetro obrigatório ausente: requester_key</small> |
| <a id="COP000084"></a>`COP000084` | 409 | **Conflict**<br/>There already exists a configuration for the informed requester_key and issuer_document_number<br/><small>Já existe uma configuração para o requester_key e issuer_document_number</small> |
| <a id="COP000085"></a>`COP000085` | 404 | **Not Found**<br/>Requester configuration not found for the given parameters<br/><small>Configuração do solicitante não encontrada para os parâmetros fornecidos</small> |
| <a id="COP000086"></a>`COP000086` | 422 | **Unprocessable Entity**<br/>Invalid contract fee data: amount informed is greater than 100%<br/><small>Taxa de contrato inválida: o valor informado é superior a 100%</small> |
| <a id="COP000087"></a>`COP000087` | 422 | **Unprocessable Entity**<br/>Invalid external contract fee data: amount informed is greater than 100%<br/><small>Taxa de contrato externa inválida: o valor informado é superior a 100%</small> |
| <a id="COP000088"></a>`COP000088` | 400 | **Bad Request**<br/>Installment actual status does not allow this operation.<br/><small>O status da parcela não permite esta operação.</small> |
| <a id="COP000089"></a>`COP000089` | 400 | **Bad Request**<br/>Credit Operation {credit_operation_key} has no disbursement_date<br/><small>A operação de crédito {credit_operation_key} não tem data de desembolso</small> |
| <a id="COP000090"></a>`COP000090` | 400 | **Bad Request**<br/>{message_en}<br/><small>{message_br}</small> |
| <a id="COP000091"></a>`COP000091` | 400 | **Bad Request**<br/>No disbursement option found for credit operation<br/><small>Nenhuma opção de desembolso encontrada para operação de crédito</small> |
| <a id="COP000092"></a>`COP000092` | 400 | **Bad Request**<br/>Credit Operation's disbursement date has already been set<br/><small>A data de desembolso da operação de crédito já foi definida</small> |
| <a id="COP000093"></a>`COP000093` | 400 | **Bad Request**<br/>No disbursement option calculated to disbursement_date {disbursement_date}<br/><small>Nenhuma opção de desembolso calculada para disbursement_date {disbursement_date}</small> |
| <a id="COP000094"></a>`COP000094` | 400 | **Bad Request**<br/>More than one disbursement option calculated to {disbursement_date}<br/><small>Mais de uma opção de desembolso calculada para {disbursement_date}</small> |
| <a id="COP000095"></a>`COP000095` | 400 | **Bad Request**<br/>First due date invalid.<br/><small>Data de vencimento da primeira parcela inválida.</small> |
| <a id="COP000096"></a>`COP000096` | 400 | **Bad Request**<br/>Could not find last installment to early pay with provided key.<br/><small>NÃo foi possãvel encontrar a última parcela a ser liquidada.</small> |
| <a id="COP000097"></a>`COP000097` | 400 | **Bad Request**<br/>No installment found to early pay.<br/><small>NÃo foi possãvel encontrar a parcelas para serem liquidadas.</small> |
| <a id="COP000098"></a>`COP000098` | 400 | **Bad Request**<br/>Different credit operation ownership. Endorsement operations can only endorse debt emissions with the same owner.<br/><small>Propriedade diferente da operação de crédito. Os endossos só podem endossar emissões de dívida com o mesmo proprietário.</small> |
| <a id="COP000099"></a>`COP000099` | 400 | **Bad Request**<br/>Different credit operation ownership. Assignment operations can only assign debt emissions with the same owner.<br/><small>Propriedade diferente da operação de crédito. As cessões só podem ceder emissões de dívida com o mesmo proprietário.</small> |
| <a id="COP000100"></a>`COP000100` | 400 | **Bad Request**<br/>Credit operation cannot be early paid if it has delayed installments.<br/><small>A operação de crédito não pode ser liquidada antecipadamente porque tem parcelas atrasadas.</small> |
| <a id="COP000101"></a>`COP000101` | 400 | **Bad Request**<br/>Credit operation cannot be early paid if it has installments that are waiting payment.<br/><small>A operação de crédito não pode ser liquidada antecipadamente porque tem parcelas que foram pagas parcialmente ou estão aguardando pagamento.</small> |
| <a id="COP000102"></a>`COP000102` | 400 | **Bad Request**<br/>Credit operation cannot be early paid if it is not opened yet.<br/><small>A operação de crédito não pode ser liquidada antecipadamente porque ainda não foi desembolsada.</small> |
| <a id="COP000103"></a>`COP000103` | 400 | **Bad Request**<br/>Related party {related_party_name} provided an invalid email {email}.<br/><small>Email informado por assinante {related_party_name} é invalido: {email}.</small> |
| <a id="COP000104"></a>`COP000104` | 400 | **Bad Request**<br/>Related party {related_party_name} has no phone provided.<br/><small>Não foi informado celular para o assinante: {related_party_name}.</small> |
| <a id="COP000105"></a>`COP000105` | 400 | **Bad Request**<br/>Phone not found<br/><small>Telefone não encontrado</small> |
| <a id="COP000106"></a>`COP000106` | 400 | **Bad Request**<br/>There must be only one disbursement account, and it must be a QI SCD account<br/><small>É necessário ter apenas uma conta de desembolso, e esta conta precisa ser da QI SCD.</small> |
| <a id="COP000107"></a>`COP000107` | 400 | **Bad Request**<br/>Credit operation must be opened to execute action<br/><small>Operação de crédito precisa estar desembolsada para executar ação.</small> |
| <a id="COP000108"></a>`COP000108` | 400 | **Bad Request**<br/>Could not pay bankslip<br/><small>Não foi possível pagar o boleto</small> |
| <a id="COP000109"></a>`COP000109` | 400 | **Bad Request**<br/>Both first_due_date and first_due_date_delay were provided. Only one must be provided.<br/><small>Data da primeira parcela e Prazo até a primeira parcela foram recebidos. Envie apenas um deles.</small> |
| <a id="COP000110"></a>`COP000110` | 400 | **Bad Request**<br/>Payment type bankslip can only be used for credit operations with prefixed interest types<br/><small>Tipo de pagamento bankslip pode ser usado somente para operações de crédito com juros prefixados</small> |
| <a id="COP000111"></a>`COP000111` | 400 | **Bad Request**<br/>Received duplicated fee type. Please provide only one fee configuration per fee type.<br/><small>Por favor, envie apenas uma configuração de rebate por tipo de tarifa.</small> |
| <a id="COP000112"></a>`COP000112` | 400 | **Bad Request**<br/>Received fee type {fee_type} not pre-configured.<br/><small>O tipo de tarifa recebido {fee_type} não está pré-configurado.</small> |
| <a id="COP000113"></a>`COP000113` | 400 | **Bad Request**<br/>Cannot apply external fee. Missing external fee configuration. Please contact the operations team.<br/><small>Não é possível aplicar rebate sem pré-configuração. Por favor contatar equipe de operações.</small> |
| <a id="COP000114"></a>`COP000114` | 400 | **Bad Request**<br/>Please specify fee type to overwrite.<br/><small>Por favor, especifique o tipo de rebate para sobrescrever.</small> |
| <a id="COP000115"></a>`COP000115` | 400 | **Bad Request**<br/>Cannot disburse credit operation {credit_operation_key} due to TED closing time.<br/><small>Não é possível desembolsar a operação {credit_operation_key} porque a TED está fechada.</small> |
| <a id="COP000116"></a>`COP000116` | 400 | **Bad Request**<br/>Purchaser {document_number} already registered for requester_key {requester_key}. Use PUT request to update<br/><small>Cessionário {document_number} já cadastrado para o requester_key {requester_key}. Use request PUT para atualizar</small> |
| <a id="COP000117"></a>`COP000117` | 400 | **Bad Request**<br/>Issuer is not bank-slip payer or is not disbursable destination.<br/><small>Tomador não corresponde ao pagador do boleto, ou não é um destino de desembolso cadastrado.</small> |
| <a id="COP000118"></a>`COP000118` | 400 | **Bad Request**<br/>Duplicate entry for requester identifier key and requester key.<br/><small>Entrada duplicada de dados para requester_identifier_key e requester_key.</small> |
| <a id="COP000119"></a>`COP000119` | 400 | **Bad Request**<br/>Issue amount is missing more than permitted: {amount}. Disbursed amount: {disbursed_amount} External fee: {external_contract_fee_sum} Must be less than 20: {delta}<br/><small>Valor de emissão está faltando mais do que permitido: {amount} Desembolso líquido calculado: {disbursed_amount} Rebate: {external_contract_fee_sum} Deve ser menor que 20: {delta}</small> |
| <a id="COP000120"></a>`COP000120` | 400 | **Bad Request**<br/>Credit Operation is not waiting signature<br/><small>Operação não está no estado aguardando assinatura</small> |
| <a id="COP000121"></a>`COP000121` | 400 | **Bad Request**<br/>Resend notification is available only for clicksign and qi sign<br/><small>Reenvio de notificação está habilitado somente para clicksign e qi sign</small> |
| <a id="COP000122"></a>`COP000122` | 400 | **Bad Request**<br/>Signer {signer} is not part of the operation<br/><small>Assinante {signer} não faz parte da operação</small> |
| <a id="COP000123"></a>`COP000123` | 400 | **Bad Request**<br/>Total amortization from installment flow does not equal issue amount.<br/><small>O total de amortização das parcelas não é igual ao valor de emissão.</small> |
| <a id="COP000124"></a>`COP000124` | 400 | **Bad Request**<br/>Received credit_operation_key already registered for another operation. Please send a new one.<br/><small>A credit_operation_key recebida já está registrada para outra operação. Por favor, envie uma key não utilizada.</small> |
| <a id="COP000125"></a>`COP000125` | 400 | **Bad Request**<br/>There cannot be disbursement options when installment flow is pre-defined.<br/><small>Não pode haver opções de desembolso quando o fluxo de parcelas é pré-determinado.</small> |
| <a id="COP000126"></a>`COP000126` | 400 | **Bad Request**<br/>Total after disbursement actions amount ({after_disbursement_actions_total_amount}) greater than evaluated disbursed amount ({disbursed_amount}).<br/><small>Valor total das ações pós desembolso ({after_disbursement_actions_total_amount}) é maior que o valor liberado calculado ({disbursed_amount}).</small> |
| <a id="COP000127"></a>`COP000127` | 400 | **Bad Request**<br/>Can't create after disbursement action because bankslip {digitable_line} expiration date {expiration_date} is within disbursement period.<br/><small>Não é possível criar ações pós-desembolso porque a data de vencimento {expiration_date} do boleto {digitable_line} está dentro do período de desembolso.</small> |
| <a id="COP000128"></a>`COP000128` | 400 | **Bad Request**<br/>Can't create after disbursement action because disbursed amount is undefined.<br/><small>Não é possível criar ações pós-desembolso porque o valor do desembolso está indefinido.</small> |
| <a id="COP000129"></a>`COP000129` | 400 | **Bad Request**<br/>Size of received due_dates array does not match number of installments<br/><small>Tamanho da lista de datas de vencimento recebida não é compatível com o número de parcelas.</small> |
| <a id="COP000130"></a>`COP000130` | 400 | **Bad Request**<br/>One or more received due dates are before the disbursement date.<br/><small>Uma ou mais datas de vencimento recebidas ocorre antes do desembolso.</small> |
| <a id="COP000131"></a>`COP000131` | 400 | **Bad Request**<br/>All elements inside due dates list must be unique.<br/><small>Todos os elementos dentro da lista de datas de vencimento devem ser únicos.</small> |
| <a id="COP000133"></a>`COP000133` | 400 | **Bad Request**<br/>The disbursement need to be in a account with the same ownership as the borrower.<br/><small>O desembolso precisa ser feito para uma conta de mesma titularidade de quem está pegando o empréstimo, no caso o tomador.</small> |
| <a id="COP000134"></a>`COP000134` | 404 | **Not Found**<br/>No credit operation found for given batch.<br/><small>Nenhuma operação de crédito encontrada para o lote recebido.</small> |
| <a id="COP000135"></a>`COP000135` | 404 | **Not Found**<br/>Some credit operations were not found for given batch.<br/><small>Algumas operações de crédito não foram encontradas para o lote recebido.</small> |
| <a id="COP000136"></a>`COP000136` | 400 | **Bad Request**<br/>More than one requester found inside batch. Expected only one requester for all credit operations inside batch.<br/><small>Mais de um requester encontrado no lote de desembolso. Espera-se apenas um requester para todas as operações de crédito contidas no lote.</small> |
| <a id="COP000137"></a>`COP000137` | 400 | **Bad Request**<br/>No requester configuration found for requester {requester_key}.<br/><small>Não foi encontrado um RequesterConfiguration para o requester {requester_key}</small> |
| <a id="COP000138"></a>`COP000138` | 400 | **Bad Request**<br/>Requester {requester_key} is not configured to disburse in batch.<br/><small>Requester {requester_key} não está configurado para desembolsar em lote.</small> |
| <a id="COP000139"></a>`COP000139` | 400 | **Bad Request**<br/>Credit operations must all be waiting_disbursement to be disbursed<br/><small>Todas as operações de crédito precisam estar waiting_disbursement para serem desembolsadas</small> |
| <a id="COP000141"></a>`COP000141` | 400 | **Bad Request**<br/>Missing one or more RequesterConfigurations to disburse in batch.<br/><small>Um ou mais RequesterConfigurations estão faltando para desembolsar em lote.</small> |
| <a id="COP000142"></a>`COP000142` | 400 | **Bad Request**<br/>Bank compe code {bank_compe_code} in after disbursement action is not valid.<br/><small>Código compe {bank_compe_code} na ação pós-desembolso não é válido.</small> |
| <a id="COP000143"></a>`COP000143` | 400 | **Bad Request**<br/>Disbursed amount must be sent when there is a fee is over its value.<br/><small>Valor desembolsado deve ser informado quando a tarifa configurada é sobre valor desembolsado</small> |
| <a id="COP000144"></a>`COP000144` | 400 | **Bad Request**<br/>Related party {related_party_name} has cellphone number with less than 9 digits<br/><small>O assinante {related_party_name}, tem número de telefone celular com menos de 9 dígitos.</small> |
| <a id="COP000145"></a>`COP000145` | 400 | **Bad Request**<br/>Duplicate Operation was found<br/><small>Operação duplicada encontrada.</small> |
| <a id="COP000146"></a>`COP000146` | 400 | **Bad Request**<br/>Cannot add external fees without a rebate account.<br/><small>Impossível adicionar tarifas externas sem a conta de rebate.</small> |
| <a id="COP000147"></a>`COP000147` | 400 | **Bad Request**<br/>Purchaser account key must be sent along with automatic debt set on.<br/><small>Chave da conta do cessionário deve ser fornecida com configuração de débito automático ligada.</small> |
| <a id="COP000148"></a>`COP000148` | 400 | **Bad Request**<br/>The field disburse_before_assign: '{disburse_before_assign}' must be boolean, it was sent {type}.<br/><small>O campo disburse_before_assign: '{disburse_before_assign}' deve ser boleano, foi enviado {type}.</small> |
| <a id="COP000149"></a>`COP000149` | 400 | **Bad Request**<br/>Disbursement already completed.<br/><small>Desembolso já concluído.</small> |
| <a id="COP000150"></a>`COP000150` | 400 | **Bad Request**<br/>Unable to update assignment amount for interest type {interest_type}. Automatic update not available for this type.<br/><small>Não foi possível atualizar o valor de cessão para o tipo de juros {interest_type}. Atualização automática não disponível para este tipo.</small> |
| <a id="COP000151"></a>`COP000151` | 404 | **Not Found**<br/>Installment not found for {attribute} {value}<br/><small>Parcela não encontrada para {attribute} {value}</small> |
| <a id="COP000152"></a>`COP000152` | 400 | **Bad Request**<br/>Simulation date {simulation_date} is less than due date {due_date} for installment number {installment_number}.<br/><small>Data de simulação {simulation_date} é menor que data de vencimento {due_date} para parcela de número {installment_number}</small> |
| <a id="COP000153"></a>`COP000153` | 400 | **Bad Request**<br/>It was not possible to consult the bank slip (digitable line: {digitable_line}). Please try again in a few minutes.<br/><small>Não foi possível consultar o boleto (linha digitável: {digitable_line}). Por favor tente novamente em alguns minutos.</small> |
| <a id="COP000154"></a>`COP000154` | 400 | **Bad Request**<br/>Unable to do action, because collaterals are not constituted. Credit operation key {credit_operation_key};<br/><small>Ação não permitida, porque a garantia não foi constituído. Credit Operation Key {credit_operation_key}</small> |
| <a id="COP000155"></a>`COP000155` | 400 | **Bad Request**<br/>Unable to proceed with pix disbursement. Target account document number does not match one provided.<br/><small>Não foi possível prosseguir com o desembolso em pix. Número de documento da conta de destino não corresponde ao fornecido.</small> |
| <a id="COP000156"></a>`COP000156` | 400 | **Bad Request**<br/>Unable to proceed with pix disbursement. Target account number and branch do not match those retrieved from pix key.<br/><small>Não foi possível prosseguir com o desembolso em pix. Agência e conta fornecidos não correspondem àqueles da chave pix.</small> |
| <a id="COP000157"></a>`COP000157` | 400 | **Bad Request**<br/>Invalid Disbursement Account Payload. Please make sure it contains target Financial Institution and account data.<br/><small>Payload da conta de desembolso inválido. Certifique que dados da instituição financeira de destino e da conta estejam contidos.</small> |
| <a id="COP000158"></a>`COP000158` | 400 | **Bad Request**<br/>Payroll amount has not been informed or is zero. Please set payroll amount as decimal greater than zero.<br/><small>Valor de payroll para crédito consignado não foi informado ou é nulo. Favor informar o payroll_amount como decimal maior que zero.</small> |
| <a id="COP000159"></a>`COP000159` | 400 | **Bad Request**<br/>Payment not allowed for settlement agent {settlement_agent}<br/><small>Pagamento não autorizado para agente {settlement_agent}</small> |
| <a id="COP000160"></a>`COP000160` | 400 | **Bad Request**<br/>Payment for operations with multiple installments not allowed.<br/><small>Pagamento não autorizado para operações com multiplas parcelas.</small> |
| <a id="COP000161"></a>`COP000161` | 400 | **Bad Request**<br/>Payment for cetip operations not allowed.<br/><small>Pagamento não autorizado para operações cetipadas.</small> |
| <a id="COP000162"></a>`COP000162` | 400 | **Bad Request**<br/>Payment not allowed for current installment status: {installment_status}.<br/><small>Pagamento não autorizado para o status da parcela: {installment_status}.</small> |
| <a id="COP000163"></a>`COP000163` | 400 | **Bad Request**<br/>Action not found;<br/><small>Action não encontrada</small> |
| <a id="COP000164"></a>`COP000164` | 400 | **Bad Request**<br/>action_key is mandatory;<br/><small>Action e mandatoria</small> |
| <a id="COP000165"></a>`COP000165` | 400 | **Bad Request**<br/>The value of the new action must be lower or equal to the action to be updated<br/><small>O valor da nova action deve ser menor ou igual a action a ser atualizada</small> |
| <a id="COP000166"></a>`COP000166` | 400 | **Bad Request**<br/>Action is already done.<br/><small>action ja realizada.</small> |
| <a id="COP000167"></a>`COP000167` | 400 | **Bad Request**<br/>It's not possible to run after disbursement action  .<br/><small>Nao foi possivel rodar a acao pos desembolso</small> |
| <a id="COP000168"></a>`COP000168` | 400 | **Bad Request**<br/>Periods sent did not match the installments received.<br/><small>Os periodos enviados não batem com as parcelas enviadas</small> |
| <a id="COP000169"></a>`COP000169` | 400 | **Bad Request**<br/>Different purchaser document number. Endorsement operations can only endorse debt emissions with the same purchaser document number.<br/><small>Documento do comprador diferente da operação de crédito. Os endossos só podem endossar emissões de dívida com o mesmo comprador.</small> |
| <a id="COP000170"></a>`COP000170` | 400 | **Bad Request**<br/>Impossible to settle operation with the installments sent.<br/><small>Impossível de quitar operação com as parcelas enviadas.</small> |
| <a id="COP000171"></a>`COP000171` | 423 | **Locked**<br/>PIX Operation window closed. System available from {PIX_OPENING_TIME} to {PIX_CLOSING_TIME}<br/><small>Operação PIX encerrada. Sistema disponível de {PIX_OPENING_TIME} até {PIX_CLOSING_TIME}</small> |
| <a id="COP000172"></a>`COP000172` | 400 | **Bad Request**<br/>Interest type not allowed at this endpoint. Payment refused.<br/><small>Tipo de juros não permitido para este endpoint. Pagamento recusado.</small> |
| <a id="COP000173"></a>`COP000173` | 400 | **Bad Request**<br/>Recalculate canceled credit operation must regenerate document when certifier is not notary office<br/><small>Recálculo de operação de crédito cancelada precisa regerar documento quando a certificadora não é cartular.</small> |
| <a id="COP000174"></a>`COP000174` | 400 | **Bad Request**<br/>Denied Operation. The chosen disbursement account institution is not an active PIX participant.<br/><small>Operação Negada. A conta de desembolso não é de uma instituição participante ativa do PIX.</small> |
| <a id="COP000175"></a>`COP000175` | 400 | **Bad Request**<br/>Denied Operation. The chosen disbursement account institution was not found.<br/><small>Operação Negada. A conta de desembolso informada não é de uma instituição financeira encontrada.</small> |
| <a id="COP000176"></a>`COP000176` | 404 | **Not Found**<br/>Assignment not found for the given parameters.<br/><small>Cessão não encontrado para os parâmetros informados.</small> |
| <a id="COP000177"></a>`COP000177` | 404 | **Not Found**<br/>Assignment not found for credit_operation_key {credit_operation_key}<br/><small>Cessão não encontrado para a credit_operation_key {credit_operation_key}</small> |
| <a id="COP000178"></a>`COP000178` | 400 | **Bad Request**<br/>transaction status does not allow changing the disbursement account<br/><small>status da operação não permite alteração da conta de desembolso</small> |
| <a id="COP000179"></a>`COP000179` | 400 | **Bad Request**<br/>Number of accounts differs from those already registered in this operation<br/><small>Quantidade de contas diverge com as já cadastradas nessa operação</small> |
| <a id="COP000180"></a>`COP000180` | 400 | **Bad Request**<br/>Credit operation status does not allow this operation.<br/><small>O status da operação de crédito não permite esta operação.</small> |
| <a id="COP000181"></a>`COP000181` | 400 | **Bad Request**<br/>Related Parties with invalid document number was found<br/><small>Partes relacionadas com documentos inválidos foram encontrados</small> |
| <a id="COP000182"></a>`COP000182` | 400 | **Bad Request**<br/>Error while doing disbursement split. Percentage differ 100% was found for credit operation.<br/><small>Error ao executar split do desembolso. Porcentagem diferente de 100% foi encontrada para a operação.</small> |
| <a id="COP000183"></a>`COP000183` | 404 | **Not Found**<br/>No RequesterConfigurationPurchaser found for requester {requester_key}.<br/><small>Não foi encontrado um RequesterConfigurationPurchaser para o requester {requester_key}</small> |
| <a id="COP000184"></a>`COP000184` | 404 | **Not Found**<br/>No RequesterConfigurationPurchaser found for key {key}.<br/><small>Não foi encontrado um RequesterConfigurationPurchaser para a key {key}</small> |
| <a id="COP000185"></a>`COP000185` | 404 | **Not Found**<br/>No RequesterConfigurationPurchaser found for requester {requester_key} with document number {document_number}.<br/><small>Não foi encontrado um RequesterConfigurationPurchaser para o requester {requester_key} com o número de documento {document_number}.</small> |
| <a id="COP000186"></a>`COP000186` | 400 | **Bad Request**<br/>The contract number already exists or is duplicated.<br/><small>O número de contrato ja existe ou está duplicado.</small> |
| <a id="COP000187"></a>`COP000187` | 400 | **Bad Request**<br/>Operation must be issued to proceed to entry generation.<br/><small>A operação precisa estar assinada para prosseguir com a geração da entrada.</small> |
| <a id="COP000188"></a>`COP000188` | 400 | **Bad Request**<br/>Entry deadline must be one day less to operation disbursement date.<br/><small>A data de vencimento da entrada, deve ser um dia menor que a data de desembolso da operação.</small> |
| <a id="COP000189"></a>`COP000189` | 400 | **Bad Request**<br/>Requester must have a requester profile in bankslip.<br/><small>O solicitante precisa possuir um perfil de solicitante na bankslip.</small> |
| <a id="COP000190"></a>`COP000190` | 400 | **Bad Request**<br/>Requester need to configure a requester_account_key in configurations before proceed.<br/><small>O solicitante precisa configurar uma requester_account_key nas configurações antes de prosseguir.</small> |
| <a id="COP000191"></a>`COP000191` | 404 | **Not Found**<br/>Entry type not found.<br/><small>Tipo de entrada não encontrada.</small> |
| <a id="COP000192"></a>`COP000192` | 400 | **Bad Request**<br/>Entry must be of one type to proceed.<br/><small>Entrada precisa ter um tipo para continuar.</small> |
| <a id="COP000193"></a>`COP000193` | 400 | **Bad Request**<br/>Entry must be paid to proceed.<br/><small>A entrada precisa ser paga para prosseguir.</small> |
| <a id="COP000194"></a>`COP000194` | 404 | **Not Found**<br/>Entry not found.<br/><small>A entrada não foi encontrada.</small> |
| <a id="COP000195"></a>`COP000195` | 400 | **Bad Request**<br/>Unable to do action, because entry is not paid. Credit operation key {credit_operation_key};<br/><small>Ação não permitida, porque a entrada não foi paga. Credit Operation Key {credit_operation_key}</small> |
| <a id="COP000196"></a>`COP000196` | 400 | **Bad Request**<br/>Disbursement date can not be in the past when recalculate credit operation, Key=  {credit_operation_key}.<br/><small>Data de desembolso não pode ser no passado para o recalculo da credit operation, Key= {credit_operation_key}</small> |
| <a id="COP000197"></a>`COP000197` | 404 | **Not Found**<br/>There's no bank_slip linked to a credit transaction.<br/><small>Não há um boleto vinculado a uma operação de crédito.</small> |
| <a id="COP000198"></a>`COP000198` | 400 | **Bad Request**<br/>ISPB Number is None and not found financial institution with code number: {code_number}<br/><small>Numero ISPB é nulo e não foi possível encontrar instituição financeira com o número: {code_number}</small> |
| <a id="COP000199"></a>`COP000199` | 400 | **Bad Request**<br/>Base day must be a working day while recalculate interest for credit_operation: {co_key}.<br/><small>Base day deve ser um dia útil para recalculo de juros da credit_operation: {co_key}.</small> |
| <a id="COP000200"></a>`COP000200` | 400 | **Bad Request**<br/>This action is allowed only for canceled credit operations<br/><small>Esta ação é permitida apenas para operações de crédito canceladas</small> |
| <a id="COP000201"></a>`COP000201` | 400 | **Bad Request**<br/>The credit Operation can be uncanceled only in disbursement date range<br/><small>A operação de crédito só pode ser descancelada no período de desembolso</small> |
| <a id="COP000202"></a>`COP000202` | 400 | **Bad Request**<br/>The credit Operation can be uncanceled only before the disbursement date<br/><small>A operação de crédito só pode ser descancelada antes da data de desembolso</small> |
| <a id="COP000203"></a>`COP000203` | 400 | **Bad Request**<br/>Installments must be after disbursement_date.<br/><small>Parcelas devem ser após data de desembolso.</small> |
| <a id="COP000204"></a>`COP000204` | 400 | **Bad Request**<br/>Assignment with key {assignment_key} is not canceled and cannot be changed to waiting_signature.<br/><small>Cessão com a chave {assignment_key} não está cancelada e não pode ser mudada pra aguardando assinatura.</small> |
| <a id="COP000205"></a>`COP000205` | 404 | **Not Found**<br/>Reversal not found.<br/><small>Estorno não encontrado.</small> |
| <a id="COP000206"></a>`COP000206` | 409 | **Conflict**<br/>This KYC was already finalized with status {kyc_status}<br/><small>Essa KYC já foi finalizada com status {kyc_status}</small> |
| <a id="COP000207"></a>`COP000207` | 404 | **Not Found**<br/>A KYC with key {kyc_key} was not found for operation {credit_operation_key}<br/><small>Uma KYC com chave {kyc_key} não foi encontrada para a operação {credit_operation_key}</small> |
| <a id="COP000208"></a>`COP000208` | 400 | **Bad Request**<br/>Cancel reason {enumerator} already exists.<br/><small>Motivo de cancelamento {enumerator} já existe.</small> |
| <a id="COP000209"></a>`COP000209` | 404 | **Not Found**<br/>Cancel reason {enumerator} not found.<br/><small>Motivo de cancelamento {enumerator} não encontrado.</small> |
| <a id="COP000210"></a>`COP000210` | 400 | **Bad Request**<br/>Assignment date must be after or equal disbursement date.<br/><small>Data da cessão deve ser maior ou igual à data de desembolso.</small> |
| <a id="COP000211"></a>`COP000211` | 409 | **Conflict**<br/>This installment/entry is already paid.<br/><small>Essa parcela/entrada já está paga.</small> |
| <a id="COP000212"></a>`COP000212` | 400 | **Bad Request**<br/>The sum of the tax percentages must be less than 100%.<br/><small>Soma das porcentagens dos impostos deve ser menor que 100%.</small> |
| <a id="COP000213"></a>`COP000213` | 400 | **Bad Request**<br/>Rate fields cannot have more than 8 decimal places.<br/><small>Campos de taxa não podem ter mais de 8 casas decimais.</small> |
| <a id="COP000214"></a>`COP000214` | 400 | **Bad Request**<br/>Delay Rate field higher than allowed.<br/><small>Campo de taxa de atraso maior que o permitido.</small> |
| <a id="COP000215"></a>`COP000215` | 400 | **Bad Request**<br/>Annual CET field higher than allowed.<br/><small>Custo efetivo anual total maior que o permitido.</small> |
| <a id="COP000216"></a>`COP000216` | 400 | **Bad Request**<br/>The date to schedule payment is not valid.<br/><small>A data para agendar o pagamento não é válida.</small> |
| <a id="COP000217"></a>`COP000217` | 400 | **Bad Request**<br/>The {method} signature method is not allowed for this certifier<br/><small>O método de assinatura {method} não é permitido para essa certificadora.</small> |
| <a id="COP000218"></a>`COP000218` | 400 | **Bad Request**<br/>The disbursement account must be the same of requester account.<br/><small>A conta de desembolso precisa ser a mesma que a conta do solicitante.</small> |
| <a id="COP000219"></a>`COP000219` | 400 | **Bad Request**<br/>The final disbursement amount, added to the entry payment, must be the same as the total payment amount.<br/><small>O valor final do desembolso, somado com a entrada, precisa ser o mesmo que o valor total do pagamento.</small> |
| <a id="COP000220"></a>`COP000220` | 409 | **Bad Request**<br/>Integrity error, already exists data with this value on field: {field}.<br/><small>Erro de integridade, já existe dados com esse valor no campo: {field}.</small> |
| <a id="COP000221"></a>`COP000221` | 400 | **Bad Request**<br/>Action cannot be executed, transfer work time is out of window.<br/><small>A ação não pode ser executada, o tempo de trabalho de transferência está fora da janela.</small> |
| <a id="COP000222"></a>`COP000222` | 400 | **Bad Request**<br/>New disbursement date must be within 15 days of the actual disbursement date.<br/><small>Nova data de desembolso deve ser dentro de 15 dias da data atual de desembolso.</small> |
| <a id="COP000223"></a>`COP000223` | 400 | **Bad Request**<br/>Issuer document number must be 11 or 14 characters long.<br/><small>O document do emissor deve ter 11 ou 14 caracteres.</small> |
| <a id="COP000224"></a>`COP000224` | 400 | **Bad Request**<br/>Credit operation cannot be disbursed until is allowed.<br/><small>A operação de crédito não pode ser desembolsada até que seja permitida.</small> |
| <a id="COP000225"></a>`COP000225` | 400 | **Bad Request**<br/>Informed total IOF amount is out of calculated range.<br/><small>O IOF total informado está fora do intervalo calculado.</small> |
| <a id="COP000226"></a>`COP000226` | 400 | **Bad Request**<br/>Custom IOF request not allowed for this requester.<br/><small>Solicitação de IOF customizada não permitida para este requisitante.</small> |
| <a id="COP000227"></a>`COP000227` | 409 | **Bad Request**<br/>Integrity error, already exists operation with the same requester identifier key.<br/><small>Erro de integridade, já existe operação com a mesma chave de identificação do solicitante.</small> |
| <a id="COP000228"></a>`COP000228` | 404 | **Not Found**<br/>Financial institution not found.<br/><small>Instituição Financeira não encontrada.</small> |
| <a id="COP000229"></a>`COP000229` | 400 | **Bad Request**<br/>Pix transfer type not found, or is incorrect.<br/><small>Tipo de transferência pix não encontrado, ou está incorreto.</small> |
| <a id="COP000230"></a>`COP000230` | 404 | **Not Found**<br/>Source account not found.<br/><small>Conta de origem não encontrada.</small> |
| <a id="COP000231"></a>`COP000231` | 400 | **Bad Request**<br/>Pix operation denied, institution is not on list of participants.<br/><small>Operação Pix negada, instituição não consta na lista de participantes.</small> |
| <a id="COP000232"></a>`COP000232` | 400 | **Bad Request**<br/>Pix operation denied, pix key does not exist.<br/><small>Operação Pix negada, chave pix não existe.</small> |
| <a id="COP000233"></a>`COP000233` | 400 | **Bad Request**<br/>The disbursement account amount receivable is different from the amount of bankslip.Bankslip amount:{bankslip_amount}<br/><small>O valor a receber da conta de desembolso é diferente do valor do boleto.Valor do boleto:{bankslip_amount}</small> |
| <a id="COP000234"></a>`COP000234` | 400 | **Bad Request**<br/>Bankslip not registered.{extra_info}<br/><small>Boleto não registrado.{extra_info_br}</small> |
| <a id="COP000235"></a>`COP000235` | 400 | **Bad Request**<br/>Cannot disburse credit operation {credit_operation_key} due to BankSlip closing time.<br/><small>Não é possível desembolsar a operação {credit_operation_key} devido ao horário de fechamento do boleto.</small> |
| <a id="COP000236"></a>`COP000236` | 400 | **Bad Request**<br/>Bankslip disbursement account must have amount_receivable.<br/><small>Desembolso com boleto precisa ter o amount_receivable.</small> |
| <a id="COP000237"></a>`COP000237` | 400 | **Bad Request**<br/>Credit operation must have portability and collateral_type must be 'dataprev_reservation' or 'social_security_portability'.<br/><small>A operação de crédito precisa ter portabilidade, e o collateral_type precisa ser 'dataprev_reservation'.</small> |
| <a id="COP000238"></a>`COP000238` | 400 | **Bad Request**<br/>final_disbursement_amount field is allowed only for refinancing operations.<br/><small>O campo final_disbursement_amount só é permitido para operações de refinanciamento.</small> |
| <a id="COP000240"></a>`COP000240` | 400 | **Bad Request**<br/>Social benefit operation must have only one disbursement account<br/><small>Operações do Auxílio Brasil devem ter uma única conta de desembolso</small> |
| <a id="COP000242"></a>`COP000242` | 400 | **Bad Request**<br/>The credit operation does`not have a registration institution linked to it.<br/><small>A operação de crédito não possui instituição de registro vinculada a ela.</small> |
| <a id="COP000243"></a>`COP000243` | 400 | **Bad Request**<br/>Credit operation already in final status.<br/><small>A operação de crédito já está no status final.</small> |
| <a id="COP000244"></a>`COP000244` | 400 | **Bad Request**<br/>No collateral found for informed params.<br/><small>Nenhuma garantia encontrada para os parâmetros informados.</small> |
| <a id="COP000245"></a>`COP000245` | 400 | **Bad Request**<br/>Operation with status {credit_operation_status} cannot be cancelled.<br/><small>Essa operação com {credit_operation_status} não permite cancelamento.</small> |
| <a id="COP000246"></a>`COP000246` | 400 | **Bad Request**<br/>Assignment status does not allow this operation. status: {assignment_status}<br/><small>Status da cessão não permite essa operação. status: {assignment_status}</small> |
| <a id="COP000247"></a>`COP000247` | 400 | **Bad Request**<br/>It is not possible to carry out the assignment with the operation settled.Operation_key: {key}<br/><small>Não é possível realizar a cessão com a operação liquidada.Chave da operação: {key}</small> |
| <a id="COP000248"></a>`COP000248` | 400 | **Bad Request**<br/>Central depositories of credit operations are not the same<br/><small>Depósitos centrais das operações de crédito não são iguais</small> |
| <a id="COP000249"></a>`COP000249` | 400 | **Bad Request**<br/>The entry deadline cannot be less than disbursement date.<br/><small>A prazo da entrada não pode ser inferior à data de desembolso.</small> |
| <a id="COP000250"></a>`COP000250` | 400 | **Bad Request**<br/>Cannot recalculate operation with a reversed entry.<br/><small>Não é possível recalcular a operação com uma entrada revertida.</small> |
| <a id="COP000251"></a>`COP000251` | 400 | **Bad Request**<br/>Reversal operation is not allowed, because the status of the credit operation is not disbursed.<br/><small>A operação de estorno não é permitida, porque o status da operação de crédito não está como desembolsado.</small> |
| <a id="COP000252"></a>`COP000252` | 400 | **Bad Request**<br/>Reversal operation is not allowed when any installment is paid.<br/><small>A opera��o de estorno n�o � permitida quando h� alguma parcela paga.</small> |
| <a id="COP000253"></a>`COP000253` | 400 | **Bad Request**<br/>Purchaser account must be registered for the requester.<br/><small>A conta do fundo precisa estar cadastrada para o requester.</small> |
| <a id="COP000254"></a>`COP000254` | 400 | **Bad Request**<br/>Credit Operation cannot be reversed after 7 days<br/><small>Operação de Credito nao pode ser cancelada depois de 7 dias</small> |
| <a id="COP000255"></a>`COP000255` | 400 | **Bad Request**<br/>Must have a transaction key for the disbursement account.<br/><small>Operação de crédito precisa estar desembolsada para gerar um qr code de estorno.</small> |
| <a id="COP000256"></a>`COP000256` | 409 | **Bad Request**<br/>Reversal to this contract number is already registered.<br/><small>A reversão para este número de contrato já está registrada.</small> |
| <a id="COP000257"></a>`COP000257` | 400 | **Bad Request**<br/>Bank slip payment was rejected.<br/><small>O pagamento do boleto foi rejeitado.</small> |
| <a id="COP000258"></a>`COP000258` | 404 | **Not Found**<br/>Related_party not found for key {related_party_key}<br/><small>Parte relacionada não encontrada para a chave {related_party_key}</small> |
| <a id="COP000259"></a>`COP000259` | 400 | **Bad Request**<br/>{person_type} type related party not allow {document_type} document type<br/><small>Parte relacionada do tipo {person_type} não permite documento do tipo {document_type}</small> |
| <a id="COP000261"></a>`COP000261` | 409 | **Conflict**<br/>Credit operation already canceled: {credit_operation_key}<br/><small>Operação de crédito já cancelada: {credit_operation_key}</small> |
| <a id="COP000262"></a>`COP000262` | 400 | **Bad Request**<br/>The colateral {collateral_type} does not accept the given interest type.<br/><small>A garantia {collateral_type} não aceita o tipo de juros fornecido.</small> |
| <a id="COP000264"></a>`COP000264` | 400 | **Bad Request**<br/>Duplicate credit operation key.<br/><small>Chave da operação duplicada.</small> |
| <a id="COP000265"></a>`COP000265` | 400 | **Bad Request**<br/>Refinancing object was not sent<br/><small>Objeto com as informações do refinancimento não foi enviado corretamente</small> |
| <a id="COP000266"></a>`COP000266` | 400 | **Bad Request**<br/>Disbursed amount is not enough to refinance the operations received<br/><small>Valor desembolsado da operação não é suficiente para quitar as operações recebidas</small> |
| <a id="COP000267"></a>`COP000267` | 400 | **Bad Request**<br/>There is no opened installments to settle refinanced credit operation.<br/><small>Não há parcelas abertas para fechar uma operação refinanciada.</small> |
| <a id="COP000268"></a>`COP000268` | 400 | **Bad Request**<br/>Refinanced operation status does not allow this operation.<br/><small>Status da operação refinanciada não permite essa operação.</small> |
| <a id="COP000269"></a>`COP000269` | 400 | **Bad Request**<br/>Missing data to settle refinancing or portability operation.<br/><small>Faltando dados para fechar operação de refinanciamento ou portabilidade</small> |
| <a id="COP000270"></a>`COP000270` | 400 | **Bad Request**<br/>Refinancing disbursing amount doesn't match percentage receivable in disbursement accounts.<br/><small>Valor de desembolso do refinanciamento não está de acordo com os valores de percentage receivable.</small> |
| <a id="COP000271"></a>`COP000271` | 400 | **Bad Request**<br/>Operation status does not permit change disbursement date.<br/><small>Status da operação não permite a reapresentação.</small> |
| <a id="COP000272"></a>`COP000272` | 400 | **Bad Request**<br/>There is another refinancing credit operation created with the same sent refinanced operation.<br/><small>Já eixste uma operação de crédito de refinanciamento vinculada a uma das operações enviadas.</small> |
| <a id="COP000273"></a>`COP000273` | 400 | **Bad Request**<br/>Assignment type or document key must be in request.<br/><small>O assignment type ou a document key devem estar presentes na requisição.</small> |
| <a id="COP000274"></a>`COP000274` | 400 | **Bad Request**<br/>The document number {document_number} already exists for this requester disbursable destinations.<br/><small>O número de documento {document_number} ja existe nos destinos desembolsáveis desse solicitante.</small> |
| <a id="COP000275"></a>`COP000275` | 400 | **Bad Request**<br/>Sent ispb number doesn't match financial institution ispb number.<br/><small>O número de ispb enviado deve ser igual ao número ISPB da instituição financeira.</small> |
| <a id="COP000276"></a>`COP000276` | 400 | **Bad Request**<br/>Collateral type doesn't allow to recalculate operation.<br/><small>Garantia do contrato não permite que a operação seja recalculada.</small> |
| <a id="COP000277"></a>`COP000277` | 400 | **Bad Request**<br/>Changing disbursement date is not allowed after {number_of_days} days after {collateral_type} collateral reservation.<br/><small>Não é permitido alterar data de desembolso após {number_of_days} dias da reserva da garantia {collateral_type}.</small> |
| <a id="COP000278"></a>`COP000278` | 400 | **Bad Request**<br/>The field limit_days_to_disburse must be informed for operations with this collateral type: {collateral_type}.<br/><small>O campo limit_days_to_disburse deve ser informado para operações com esse tipo de garantia: {collateral_type}.</small> |
| <a id="COP000279"></a>`COP000279` | 400 | **Bad Request**<br/>Disbursement date must be informed for operations with this collateral type: {collateral_type}.<br/><small>Data de desembolso deve ser informada para operações com esse tipo de garantia: {collateral_type}.</small> |
| <a id="COP000280"></a>`COP000280` | 400 | **Bad Request**<br/>Bank slip is already paid or scheduled.<br/><small>O boleto ja foi pago ou agendado.</small> |
| <a id="COP000281"></a>`COP000281` | 400 | **Bad Request**<br/>Installment paid at date is invalid.<br/><small>Data de pagamento da parcela não é uma data válida.</small> |
| <a id="COP000282"></a>`COP000282` | 403 | **Unauthorized**<br/>Refinanced credit operations must be from the same requester.<br/><small>As operações refinanciadas devem ser do mesmo requester que está pedindo a operação de refinanciamento.</small> |
| <a id="COP000283"></a>`COP000283` | 400 | **Bad Request**<br/>Refinanced operations issuer document must be the same as the refinancing operation.<br/><small>O número de documento das operações refinanciadas deve o mesmo que da operação de refinanciamento.</small> |
| <a id="COP000284"></a>`COP000284` | 400 | **Bad Request**<br/>The percentage between global tc plus insurance and issue amount ({tac_percentage}%) is greater than the maximum tc percentage ({maximum_tac_percentage}%). The global tc plus insurance sent was R${global_tac} and, to be valid, the global tc plus insurance amount must be until R${valid_tac}.<br/><small>A porcentagem entre a tc global mais seguro e o valor de emissão ({tac_percentage}%) é maior que a porcentagem máxima de tc ({maximum_tac_percentage}%). A tc global mais seguro enviada foi de R${global_tac} e, para ser válido, o valor de tc global mais seguro deve ser de até R${valid_tac}.</small> |
| <a id="COP000285"></a>`COP000285` | 400 | **Bad Request**<br/>The percentage between rebate and issue amount ({rebate_percentage}%) is greater than the maximum rebate percentage ({maximum_rebate_percentage}%). The rebate amount sent was R${rebate_amount} and, to be valid, the rebate amount must be until R${valid_rebate}.<br/><small>A porcentagem entre o rebate e o valor de emissão ({rebate_percentage}%) é maior que a porcentagem máxima de rebate ({maximum_rebate_percentage}%). O valor de rebate enviado foi de R${rebate_amount} e, para ser válido, o valor de rebate deve ser de até R${valid_rebate}.</small> |
| <a id="COP000286"></a>`COP000286` | 400 | **Bad Request**<br/>Invalid disbursement information payload. Bank slip disbursement type must have a digitable line(digitable_line).<br/><small>Informações de desembolso inválido. Desembolso por boleto deve possuir linha digitavel(digitable_line).</small> |
| <a id="COP000287"></a>`COP000287` | 400 | **Bad Request**<br/>Invalid disbursement information payload. The disbursement account must have account number, digit and branch or a pix key.<br/><small>Informações de desembolso inválido. A conta de desembolso precisa possuir número, digito e agência ou uma chave pix.</small> |
| <a id="COP000288"></a>`COP000288` | 400 | **Bad Request**<br/>Invalid disbursement information payload. The target bank ispb number or financial institution code number must be informed.<br/><small>Informações de desembolso inválido. O número ispb ou código da instituição financeira deve ser informado.</small> |
| <a id="COP000289"></a>`COP000289` | 400 | **Bad Request**<br/>Requester configuration for car collateral fee not found. Please contact support.<br/><small>Configuração do requester para gravame não encontrada. Por favor entre em contato com o suporte.</small> |
| <a id="COP000290"></a>`COP000290` | 400 | **Bad Request**<br/>The date field {field_en} must have a date lower or equal from today.<br/><small>O campo de data {field_pt} precisa ter uma data menor ou igual a hoje</small> |
| <a id="COP000291"></a>`COP000291` | 400 | **BadRequest**<br/>Installment Accrual from day before needs to be calculated first.<br/><small>Accrual da parcela do dia anterior precisa ser calculado primeiro.</small> |
| <a id="COP000292"></a>`COP000292` | 400 | **BadRequest**<br/>Operation {credit_operation_key} is assigned on reference date.<br/><small>Operação {credit_operation_key} está cedida na data de referência.</small> |
| <a id="COP000293"></a>`COP000293` | 400 | **BadRequest**<br/>Operation {credit_operation_key} is canceled on reference date.<br/><small>Operação {credit_operation_key} está cancelada na data de referência.</small> |
| <a id="COP000294"></a>`COP000294` | 400 | **BadRequest**<br/>Operation {credit_operation_key} is settled on reference date.<br/><small>Operação {credit_operation_key} está quitada na data de referência.</small> |
| <a id="COP000296"></a>`COP000296` | 400 | **Bad Request**<br/>The interest rate informed/calculated for the operation exceeds what is permitted by law for the collateral type informed.  Informed/calculated interest rate: {montlhy_rate}.  Limit allowed by law for the collateral type {collateral_type}: {max_interest_rate}.<br/><small>A taxa informada/calculada da operação, ultrapassa o permitido por lei para o tipo de garantia informada.  Taxa informada/calculada da operação: {montlhy_rate}.  Limite permitido por lei para o tipo de garantia {collateral_type}: {max_interest_rate}.</small> |
| <a id="COP000297"></a>`COP000297` | 400 | **Bad Request**<br/>The INSS product is temporarily unavailable<br/><small>O produto de INSS está temporariamente indisponível</small> |
| <a id="COP000298"></a>`COP000298` | 400 | **Bad Request**<br/>The card benefit INSS product is temporarily unavailable<br/><small>O produto de cartão benefício INSS está temporariamente indisponível</small> |
| <a id="COP000299"></a>`COP000299` | 400 | **Bad Request**<br/>The operation {credit_operation_key} is canceled, but does not have a cancel event.<br/><small>A operação {credit_operation_key} está cancelada, mas não possui um evento de cancelamento.</small> |
| <a id="COP000300"></a>`COP000300` | 400 | **Bad Request**<br/>There is one or more accrual days not calculated for the operation {credit_operation_key}.<br/><small>Existe um ou mais dias de accrual não calculados para essa operação {credit_operation_key}.</small> |
| <a id="COP000301"></a>`COP000301` | 400 | **Bad Request**<br/>The operation {credit_operation_key} does not have a disbursement event before reference date.<br/><small>A operação {credit_operation_key} não possui evento de desembolso antes da data de referência.</small> |
| <a id="COP000302"></a>`COP000302` | 404 | **Not Found**<br/>Accrual not found.<br/><small>Accrual não encontrado.</small> |
| <a id="COP000304"></a>`COP000304` | 400 | **BadRequest**<br/>Credit Operation {credit_operation_key} Accrual from day before needs to be calculated first.<br/><small>Accrual da operação {credit_operation_key} do dia anterior precisa ser calculado primeiro.</small> |
| <a id="COP000305"></a>`COP000305` | 400 | **Bad Request**<br/>The operation {credit_operation_key} is settled, but does not have a settlement event.<br/><small>A operação {credit_operation_key} está quitada, mas não possui um evento de quitação.</small> |
| <a id="COP000306"></a>`COP000306` | 400 | **Bad Request**<br/>Refinancing due balance ({refinancing_due_balance}) must be lower or equal than original credit operation assignment amount ({present_value}).<br/><small>Saldo devedor de refinanciamento ({refinancing_due_balance}) deve ser menor ou igual que o saldo devedor original da operação ({present_value}).</small> |
| <a id="COP000307"></a>`COP000307` | 400 | **Bad Request**<br/>Refinancing due balance ({refinancing_due_balance}) plus entry value ({entry_value}), that is {refinancing_sum}, must be lower or equal than original credit operation assignment amount ({present_value}).<br/><small>Saldo devedor de refinanciamento ({refinancing_due_balance}) mais valor de entrada ({entry_value}), que é {refinancing_sum}, deve ser menor ou igual que o saldo devedor original da operação ({present_value}).</small> |
| <a id="COP000308"></a>`COP000308` | 400 | **Bad Request**<br/>Endorsement not found<br/><small>Endosso não encontrada</small> |
| <a id="COP000309"></a>`COP000309` | 400 | **Bad Request**<br/>Today's date is outside the disbursement range.<br/><small>A data atual está fora do intervalo de desembolso.</small> |
| <a id="COP000310"></a>`COP000310` | 400 | **Bad Request**<br/>Reference date is before permitted minimum date (2022-12-26)<br/><small>Data de referência é anterior à data mínima permitida (2022-12-26).</small> |
| <a id="COP000311"></a>`COP000311` | 404 | **Not Found**<br/>CETIP assignment not found<br/><small>Liquidação CETIP não encontrada</small> |
| <a id="COP000312"></a>`COP000312` | 400 | **Bad Request**<br/>Credit operation in {operation_status} status can't be recalculate.<br/><small>Operação de crédito em status de {operation_status} não pode ser recalculada.</small> |
| <a id="COP000313"></a>`COP000313` | 404 | **Invalid Installment Status**<br/>Invalid to amend installment on status: {installment_status}.<br/><small>Inválido para aditar parcela no status: {installment_status}.</small> |
| <a id="COP000314"></a>`COP000314` | 400 | **Bad Request**<br/>Invalid operation for non-amended operation. The actual status is: {credit_operation_status}.<br/><small>Operação inválida para operação não-aditada. O status atual é: {credit_operation_status}.</small> |
| <a id="COP000315"></a>`COP000315` | 400 | **Bad Request**<br/>Amendment operation contract number ({amendment_credit_operation_contract_number}) is different from the contract number of the new operation ({credit_operation_contract_number}).<br/><small>O número de contrato da operação aditada ({amendment_credit_operation_contract_number}) é diferente do número de contrato da nova operação ({credit_operation_contract_number}).</small> |
| <a id="COP000316"></a>`COP000316` | 400 | **Bad Request**<br/>Final disbursed amount originated by the amendment credit operation (R${final_disbursed_amount}) is different from the due balance sent (R${due_balance}).<br/><small>O valor de emissão obtido pela operação de crédito aditada (R${final_disbursed_amount}) é diferente do saldo devedor enviado (R${due_balance}).</small> |
| <a id="COP000317"></a>`COP000317` | 400 | **Bad Request**<br/>Operation is already on amended status.<br/><small>Operação já está no status de aditada.</small> |
| <a id="COP000319"></a>`COP000319` | 400 | **Bad Request**<br/>Issuer must be a legal person for Commercial Paper operation type.<br/><small>Emissor deve ser uma pessoa jurídica para operações do tipo Nota comercial.</small> |
| <a id="COP000320"></a>`COP000320` | 400 | **Bad Request**<br/>Portability data field must be in collateral data for portability collateral reservation type.<br/><small>Campo portability data deve estar no collateral data para garantias de portabilidade.</small> |
| <a id="COP000321"></a>`COP000321` | 400 | **Bad Request**<br/>Disbursement is not allowed for salary account type.<br/><small>Desembolso não é permitido para conta salário.</small> |
| <a id="COP000322"></a>`COP000322` | 400 | **Bad Request**<br/>Paid amount exceeds due balance<br/><small>Valor de pagamento excede o valor devido</small> |
| <a id="COP000323"></a>`COP000323` | 400 | **Bad Request**<br/>The difference between the sum of installments present amounts ({sum_present_values}) and the sum of installments principal amounts ({sum_principal}) can't be negative.<br/><small>A diferença entre a soma dos valores presentes das parcelas ({sum_present_values}) e a soma dos valores de amortização das parcelas ({sum_principal}) não pode ser negativa.</small> |
| <a id="COP000324"></a>`COP000324` | 400 | **Bad Request**<br/>Paid amount exceeds due balance with remaining amount {remaining_amount}<br/><small>Valor de pagamento excede o valor devido com valor restante de {remaining_amount}</small> |
| <a id="COP000325"></a>`COP000325` | 400 | **Bad Request**<br/>Difference between period and installment total amount or due date was found.<br/><small>Diferença entre period e valor total da parcela ou data de vencimento foi encontrada.</small> |
| <a id="COP000326"></a>`COP000326` | 400 | **Bad Request**<br/>Credit operation actual status is not allowed for update related party. The actual status is: {credit_operation_status}.<br/><small>O status atual da operação de crédito não permite atualizar a parte relacionada. O status atual é :{credit_operation_status}.</small> |
| <a id="COP000327"></a>`COP000327` | 400 | **Bad Request**<br/>Cetip amount different from installment total amount. Installment key: {installment_key}.<br/><small>Valor Cetip diferente do valor total da parcela. Installment key:{installment_key}</small> |
| <a id="COP000328"></a>`COP000328` | 400 | **Bad Request**<br/>Collateral type {collateral_type} is not allowed for update related party.<br/><small>O tipo de garantia {collateral_type} não permite atualizar a parte relacionada.</small> |
| <a id="COP000329"></a>`COP000329` | 400 | **Bad Request**<br/>Related party not found for given related party key: {related_party_key}<br/><small>Parte relacionada não encontrada para a related party key informada: {related_party_key}</small> |
| <a id="COP000330"></a>`COP000330` | 400 | **Bad Request**<br/>Collateral type {collateral_type} does not allow this action.<br/><small>Garantia do tipo {collateral_type} não permite essa ação.</small> |
| <a id="COP000331"></a>`COP000331` | 400 | **Bad Request**<br/>The possible days to disburse must be 30 at máximum.<br/><small>Os dias possívies para o desembolso devem ser de no máximo 30 dias.</small> |
| <a id="COP000332"></a>`COP000332` | 400 | **Bad Request**<br/>Cant't reverse this operation due to no disbursement key.<br/><small>Não é possível reverter essa operação devido devido à não existência de disbursement key.</small> |
| <a id="COP000333"></a>`COP000333` | 400 | **Bad Request**<br/>Credit Operation final disbursement cannot be negative.<br/><small>O valor de desembolso final não pode ser negativo.</small> |
| <a id="COP000334"></a>`COP000334` | 400 | **Bad Request**<br/>Reversal action not allowed because credit operation is not canceled.<br/><small>Reversão não permitida devido ao status da credit operation ser diferente de canceled.</small> |
| <a id="COP000335"></a>`COP000335` | 400 | **Bad Request**<br/>The assignment amount is superior than the operation final amount.<br/><small>O valor de cessão é superior ao valor final da operação.</small> |
| <a id="COP000336"></a>`COP000336` | 400 | **Bad Request**<br/>Only assignment related fee types permitted<br/><small>Somente tipos de tarifas relacionados com cessão são permitidos</small> |
| <a id="COP000337"></a>`COP000337` | 400 | **Bad Request**<br/>The CET informed/calculated for the operation exceeds what is permitted by law for the collateral type informed.  Informed/calculated CET: {cet}.  Limit allowed by law for the collateral type {collateral_type}: {max_cet}.<br/><small>O CET da operação, ultrapassa o permitido por lei para o tipo de garantia informada.  CET informado/calculado da operação: {cet}.  Limite permitido por lei para o tipo de garantia {collateral_type}: {max_cet}.</small> |
| <a id="COP000338"></a>`COP000338` | 400 | **Bad Request**<br/>Operation cannot became opened due to it's current status {credit_operation_status}.<br/><small>Operação não pode ir para opened devido ao seu status {credit_operation_status}.</small> |
| <a id="COP000339"></a>`COP000339` | 400 | **Bad Request**<br/>Credit Operation final disbursement cannot be negative. Disbursement option: {disbursement_option} Issue amount: {issue_amount}<br/><small>O valor de desembolso final não pode ser negativo. Opção de desembolso: {disbursement_option} Valor de Emissão {issue_amount}</small> |
| <a id="COP000341"></a>`COP000341` | 400 | **Bad Request**<br/>It is not possible to calculate installment present values for operation in status: {credit_operation_status}.<br/><small>Não é possível calcular valores presentes das parcelas para operação no status: {credit_operation_status}.</small> |
| <a id="COP000342"></a>`COP000342` | 404 | **Not Found**<br/>No Collateral Receipt Found for Informed Credit Operation<br/><small>Recibo de Garantia Não Encontrado para essa Operação de Crédito Informada</small> |
| <a id="COP000343"></a>`COP000343` | 422 | **Unprocessable Entity**<br/>Celcoin service unavailable.<br/><small>Serviço da Celcoin indisponível.</small> |
| <a id="COP000344"></a>`COP000344` | 400 | **Bad Request**<br/>Action could not be created.<br/><small>Não foi possível criar a action.</small> |
| <a id="COP000345"></a>`COP000345` | 400 | **Bad Request**<br/>The final amount exceeds the disbursed or issue amount. Ensure the sum of installments amount does surpass the disbursed or issued amount.<br/><small>O valor final ultrapassa o desembolsado ou emitido. Garanta que a soma dos valores das installments supere o valor desembolsado ou emitido.</small> |
| <a id="COP000346"></a>`COP000346` | 400 | **Bad Request**<br/>Base year days must not be null.<br/><small>Os dias do ano de base não podem ser null.</small> |
| <a id="COP000347"></a>`COP000347` | 400 | **Bad Request**<br/>This request can only be made if the operation has a disbursement date.<br/><small>Essa requisição só pode ser feita caso a operação tenha uma data de desembolso.</small> |
| <a id="COP000348"></a>`COP000348` | 400 | **Bad Request**<br/>Operation with status {credit_operation_status} cannot be settled.<br/><small>Operação com status {credit_operation_status} não pode ser quitada.</small> |
| <a id="COP000349"></a>`COP000349` | 400 | **Bad Request**<br/>Sistem with instabillity. Please, retry again in a feel minutes.<br/><small>Sistema instável. Por favor, tente novamente em alguns minutos.</small> |
| <a id="COP000350"></a>`COP000350` | 400 | **Bad Request**<br/>The reversal action is not allowed, because the credit operation disbursement key do not match with incoming disbursement key.<br/><small>A ação de reversão não é permitida, devido à disbursement key da operação de crédito não bate com a incoming disbursement key.</small> |
| <a id="COP000351"></a>`COP000351` | 400 | **Bad Request**<br/>Operation with collateral constituted cannot be recalculated.<br/><small>Operação com garantia constituída não pode ser recalculada.</small> |
| <a id="COP000352"></a>`COP000352` | 400 | **Bad Request**<br/>Date {date_string} is not a valid date. Date field: {date_name}<br/><small>Data {date_string} não é uma data valida. Campo de data: {date_name}</small> |
| <a id="COP000353"></a>`COP000353` | 400 | **Bad Request**<br/>There are operations status not in waiting disbursement.<br/><small>Existem operações em status diferente de waiting disbursement.</small> |
| <a id="COP000354"></a>`COP000354` | 400 | **Bad Request**<br/>Operation previously disbursed with disbursement key cannot force cancel. Please revert transfers.<br/><small>Operação desembolsada previamente com disbursement key não pode ser cancelada forçadamente. Por favor, reverta as transfers.</small> |
| <a id="COP000355"></a>`COP000355` | 400 | **Bad Request**<br/>Operation not eligible for tc fee charge. Please do not use this fee type for this borrower.<br/><small>Operação não elegível para cobrança de taxa do tipo tc. Por favor, não use esse tipo de fee para esse tomador de crédito.</small> |
| <a id="COP000356"></a>`COP000356` | 400 | **Bad Request**<br/>Account number length must be less than 13 for TED transfer method to non-payment account type.<br/><small>O tamanho do número da conta deve ser menor do que 13 para transferências do tipo Ted para contas que não sejam de pagamento.</small> |
| <a id="COP000357"></a>`COP000357` | 400 | **Bad Request**<br/>Issuer document number is a required property.<br/><small>O número do documento é uma propriedade obrigatória.</small> |
| <a id="COP000358"></a>`COP000358` | 400 | **Bad Request**<br/>The global tc plus insurance amount ({tac_amount}) is greater than the limit ({tac_limit_amount}) allowed for this range of issued amount.<br/><small>O valor da tc global mais seguro  ({tac_amount}) é maior que o limite ({tac_limit_amount}) permitido para essa faixa de valor de emissão.</small> |
| <a id="COP000359"></a>`COP000359` | 409 | **Conflict**<br/>This installment has already been paid more than a day ago.<br/><small>Essa parcela já foi paga há mais de um dia.</small> |
| <a id="COP000360"></a>`COP000360` | 400 | **Bad Request**<br/>Reversal qr code expiration date cannot be in past.<br/><small>Expiração do qr code da reversal não pode estar no passado.</small> |
| <a id="COP000361"></a>`COP000361` | 400 | **Bad Request**<br/>The Requester Configuration doesn't have a payment_type_configuration parameter yet. Please provide it to continue.<br/><small>O Requester ainda não possui o parâmetro payment_type_configuration em sua configuração. Por favor, envie-o para continuar.</small> |
| <a id="COP000362"></a>`COP000362` | 409 | **Conflict**<br/>This installment has already been paid today.<br/><small>Essa parcela já foi paga hoje.</small> |
| <a id="COP000363"></a>`COP000363` | 400 | **Bad Request**<br/>This credit operation is in 'canceled', 'settled' or 'canceled_permanently' status.<br/><small>Essa operação de crédito esta no status 'canceled', 'settled' ou 'canceled_permanently'.</small> |
| <a id="COP000364"></a>`COP000364` | 400 | **Bad Request**<br/>Refinanced operation disbursement date must be before or equal refinancing disbursement date.<br/><small>A data de desembolso da operação refinanceada precisa ser antes ou igual da data de desembolso da que está fazendo o refinanciamento.</small> |
| <a id="COP000365"></a>`COP000365` | 404 | **Not Found**<br/>Payment method not found.<br/><small>Método de pagamento não encontrado.</small> |
| <a id="COP000366"></a>`COP000366` | 400 | **Bad Request**<br/>Area code: {area_code} is invalid for related party phone number.<br/><small>DDD: {area_code} é invalido para o número de telefone da parte relacionada.</small> |
| <a id="COP000367"></a>`COP000367` | 400 | **Bad Request**<br/>The configuration: {reversal_to_fund} must have a purchaser account configured.<br/><small>A configuração: {reversal_to_fund} precisa ter uma conta do comprador configurada.</small> |
| <a id="COP000368"></a>`COP000368` | 400 | **Bad Request**<br/>Credit operation can't be assigned to create external contract fees.<br/><small>A operação de crédito não pode estar cedida para criar taxas de contrato externas.</small> |
| <a id="COP000369"></a>`COP000369` | 400 | **Bad Request**<br/>To assign operation you must send assigned at.<br/><small>Para ceder operação pracisa envar a data de cessão.</small> |
| <a id="COP000370"></a>`COP000370` | 404 | **Not Found**<br/>Refinancing credit operation not found.<br/><small>Operação refinanciada não encontrada.</small> |
| <a id="COP000371"></a>`COP000371` | 400 | **Bad Request**<br/>Natural person type related party must have letters in name. Invalid name: {related_party_name}<br/><small>Parte relacionada do tipo pessoa deve possuir letras no nome. Nome invalido: {related_party_name}</small> |
| <a id="COP000372"></a>`COP000372` | 400 | **Bad Request**<br/>Number of installments limit exceeded. Maximum number of installments allowed:{number_of_installments}<br/><small>Limite do número de parcelas excedido. Número de parcelas máximo permitido:{number_of_installments}</small> |
| <a id="COP000373"></a>`COP000373` | 400 | **Bad Request**<br/>Unable to cancel permanently because the collateral reservation is still being processed.<br/><small>Não é possível cancelar permanentemente porque a reserva da garantia ainda está sendo processada.</small> |
| <a id="COP000374"></a>`COP000374` | 400 | **Bad Request**<br/>Cannot change disbursement date due to TED working time. For TED disbursement, disbursement date must be a work day.<br/><small>Não é possível alterar a data de desembolso por conta do horário de funcionamento da TED. Para desembolso via TED, a data de desembolso precisa ser um dia útil.</small> |
| <a id="COP000375"></a>`COP000375` | 400 | **Bad Request**<br/>The collateral was not reserved yet for performing this action.<br/><small>A garantia ainda não foi averbada para realizar essa ação.</small> |
| <a id="COP000376"></a>`COP000376` | 400 | **Bad Request**<br/>Cannot apply external fee. Fee amount must be greather than 0.<br/><small>Não é possível aplicar rebate. O valor do fee precisa ser maior que zero.</small> |
| <a id="COP000377"></a>`COP000377` | 400 | **Bad Request**<br/>This credit operation does not fullfil the requisites for changing its purchaser.<br/><small>Essa operação de crédito não atende a todos os requisitos para a troca de cessionário.</small> |
| <a id="COP000378"></a>`COP000378` | 400 | **Bad Request**<br/>Cannot settle installment associated with a refinanced credit operation.<br/><small>Não é possível quitar parcelas associadas a operações de refinanciamento.</small> |
| <a id="COP000379"></a>`COP000379` | 400 | **Bad Request**<br/>To use qi insurance, {field} must be sent<br/><small>Para usar o seguro qi, precisa ser enviado {field_translated}</small> |
| <a id="COP000380"></a>`COP000380` | 400 | **Bad Request**<br/>To use insurance premium qi can not send {field}.<br/><small>Para usar seguro qi, não pode ser enviado {filed_translator}.</small> |
| <a id="COP000381"></a>`COP000381` | 400 | **Bad Request**<br/>Issuer not eligible to use insurance premium qi. {reason}<br/><small>Tomador não elegível para usar seguro qi. {reason_translated}</small> |
| <a id="COP000382"></a>`COP000382` | 400 | **Bad Request**<br/>An IP address in signature data is required to register this collateral.<br/><small>Um endereço de ip nos dados de assinatura é necessário para registro dessa garantia.</small> |
| <a id="COP000383"></a>`COP000383` | 404 | **Not Found**<br/>Related_party not found for document number {related_party_individual_document_number}<br/><small>Parte relacionada não encontrada para o cpf {related_party_individual_document_number}</small> |
| <a id="COP000384"></a>`COP000384` | 400 | **Bad Request**<br/>It's not possible change disbursement type to TED if disbursement date is not work day.<br/><small>Não é possível trocar o tipo de desembolso para TED se a data de desembolso não for dia útil.</small> |
| <a id="COP000385"></a>`COP000385` | 409 | **Conflict**<br/>Metadata already exists for this credit operation.<br/><small>Metadata ja existe para essa operação de crédito.</small> |
| <a id="COP000386"></a>`COP000386` | 400 | **Bad Request**<br/>'Metadata key' and 'metadata value' must be informed.<br/><small>'Metadata key' e 'metadata value' devem ser informados.</small> |
| <a id="COP000387"></a>`COP000387` | 404 | **Not Found**<br/>Metadata not found.<br/><small>'Metadata não encontrado.</small> |
| <a id="COP000388"></a>`COP000388` | 400 | **Bad Request**<br/>The new installment face value must be less than the old installment face value. Old value: {old_installment_face_value}, New value: {new_installment_face_value}.<br/><small>O novo valor de face da parcela deve ser menor que o valor antigo. Valor antigo: {old_installment_face_value}, Valor novo: {new_installment_face_value}.</small> |
| <a id="COP000389"></a>`COP000389` | 400 | **Bad Request**<br/>Operations outside the purchase's eligibility. Number of installments is below the minimum allowed<br/><small>Operações fora da elegibilidade do cessionário. Número de parcelas está abaixo do mínimo permitido.</small> |
| <a id="COP000390"></a>`COP000390` | 400 | **Bad Request**<br/>Missing fields for requester_required_data: {missing_fields}<br/><small>Campos faltando para requester_required_data: {missing_fields}</small> |
| <a id="COP000391"></a>`COP000391` | 400 | **Bad Request**<br/>Missing documents for requester_required_data: {missing_documents}<br/><small>Documentos faltando para requester_required_data: {missing_documents}</small> |
| <a id="COP000392"></a>`COP000392` | 400 | **Bad Request**<br/>The new installment face value is wrong. Old value: {old_installment_face_value}, New value: {new_installment_face_value}.<br/><small>O novo valor de face da parcela está errado. Valor antigo: {old_installment_face_value}, Valor novo: {new_installment_face_value}.</small> |
| <a id="COP000393"></a>`COP000393` | 400 | **Bad Request**<br/>Credit operation status does not allow this operation. status: {credit_operation_status}<br/><small>Status da operação de crédito não permite essa operação. status: {credit_operation_status}</small> |
| <a id="COP000394"></a>`COP000394` | 400 | **Bad Request**<br/>Phone number: {phone_number} is invalid for related party phone number.<br/><small>Numero de telefone: {phone_number} é invalido para o número de telefone da parte relacionada.</small> |
| <a id="COP000395"></a>`COP000395` | 400 | **Bad Request**<br/>Credit Operation is already not assigned<br/><small>A operação de crédito não está cedida</small> |
| <a id="COP000396"></a>`COP000396` | 400 | **Bad Request**<br/>The unassigned_at is before than the assigned_at.<br/><small>A data de recompra é depois da data de cessão</small> |
| <a id="COP000397"></a>`COP000397` | 400 | **Bad Request**<br/>Issuer data is invalid: {invalid_reason}<br/><small>Dados do tomador são invalidos: {invalid_reason}</small> |
| <a id="COP000398"></a>`COP000398` | 400 | **Bad Request**<br/>Operations of type portability can not have contract fees of type tc.<br/><small>Operações do tipo portabilidade não podem ter tarifas do tipo tc.</small> |
| <a id="COP000399"></a>`COP000399` | 400 | **Bad Request**<br/>Contract fees only can be used using billing api.<br/><small>Tarifas só podem ser cadastradas via billing api.</small> |
| <a id="COP000400"></a>`COP000400` | 400 | **Bad Request**<br/>Contract fee of fee type {fee_type} can not be created or changed.<br/><small>Tarifa do tipo {fee_type} não pode ser criada ou alterada.</small> |
| <a id="COP000401"></a>`COP000401` | 400 | **Bad Request**<br/>Contract fee of fee type {fee_type} already exists.<br/><small>Tarifa do tipo {fee_type} já existe.</small> |
| <a id="COP000402"></a>`COP000402` | 400 | **Bad Request**<br/>Reversal status {reversal_status} not permitted.<br/><small>Status de reversão {reversal_status} não permitido.</small> |
| <a id="COP000403"></a>`COP000403` | 400 | **Bad Request**<br/>Operations outside the purchase's eligibility. Interest rate of the operation is below the minimum allowed.<br/><small>Operações fora da elegibilidade do cessionário. Taxa de juros da operação está abaixo do mínimo permitido.</small> |
| <a id="COP000404"></a>`COP000404` | 404 | **Not Found**<br/>Issuer analysis does not exist for credit operation with key {credit_operation_key}<br/><small>Análise do tomador não existe para operação de crédito com chave {credit_operation_key}</small> |
| <a id="COP000405"></a>`COP000405` | 400 | **Bad Request**<br/>Refinancing not allowed when refinanced credit operation is assigned.<br/><small>Refinanciamento não permitido quando a operação de crédito refinanciada está cedida.</small> |
| <a id="COP000406"></a>`COP000406` | 404 | **Not Found**<br/>Credit operation not found for this issuer analysis<br/><small>Operação de crédito não encontrada para essa análise de tomador.</small> |
| <a id="COP000407"></a>`COP000407` | 400 | **Bad Request**<br/>Credit operation already set for this date.<br/><small>Operação de crédito já escolhida para essa data.</small> |
| <a id="COP000408"></a>`COP000408` | 400 | **Bad Request**<br/>Assignment eligibility validation failed.<br/><small>Validação de elegibilidade para cessão falhou.</small> |
| <a id="COP000409"></a>`COP000409` | 409 | **Conflict**<br/>Credit operation already canceled permanently: {credit_operation_key}<br/><small>Operação de crédito já cancelada permanentemente: {credit_operation_key}</small> |
| <a id="COP000410"></a>`COP000410` | 400 | **Bad Request**<br/>Invalid cnae code ({cnae_code}) informed to related party.<br/><small>Código cnae invalido ({cnae_code}) informado pra parte relacionada.</small> |
| <a id="COP000417"></a>`COP000417` | 400 | **Bad Request**<br/>External Contract fees only can be used using rebate api.<br/><small>Tarifas Externas só podem ser cadastradas via rebate api.</small> |
| <a id="COP000418"></a>`COP000418` | 400 | **Bad Request**<br/>The percentage between insurance premium and issue amount ({insurance_premium_percentage}%) is greater than the maximum insurance premium percentage ({maximum_insurance_premium_percentage}%). The insurance premium amount sent was R${insurance_premium_amount} and, to be valid, the insurance premium amount must be until R${insurance_premium_valid_amount}.<br/><small>A porcentagem entre o seguro e o valor de emissão ({insurance_premium_percentage}%) é maior que a porcentagem máxima de seguro ({maximum_insurance_premium_percentage}%). O valor de seguro enviado foi de R${insurance_premium_amount} e, para ser válido, o valor de seguro deve ser de até R${insurance_premium_valid_amount}.</small> |
| <a id="COP000419"></a>`COP000419` | 400 | **Bad Request**<br/>Invalid Insurance product ({insurance_premium_product}).<br/><small>Produto de Seguro inválido ({insurance_premium_product}).</small> |
| <a id="COP000420"></a>`COP000420` | 400 | **Bad Request**<br/>Installment is not in a valid status to generate a {payment_type} payment method. status: {installment_status}<br/><small>Parcela não está em um status válido para gerar um pagamento do tipo {payment_type}. status: {installment_status}</small> |
| <a id="COP000421"></a>`COP000421` | 400 | **Bad Request**<br/>Payment method already exists for this installment. payment_type: {payment_type}<br/><small>Método de pagamento já existe para esta parcela. payment_type: {payment_type}</small> |
| <a id="COP000422"></a>`COP000422` | 400 | **Bad Request**<br/>Payment generation can only be applicated in installments with not pasted business due date.<br/><small>A geração de pagamento só pode ser aplicada em parcelas com data de vencimento comercial não atingida.</small> |
| <a id="COP000423"></a>`COP000423` | 400 | **Bad Request**<br/>Payment method {payment_type} does not exist.<br/><small>Método de pagamento {payment_type} não existente.</small> |
| <a id="COP000424"></a>`COP000424` | 400 | **Bad Request**<br/>Credit operation does not permit installment payment generation, because QI is not the settlement agent.<br/><small>A operação de crédito não permite a geração de pagamento de parcela, porque a QI não é o agente de liquidação.</small> |
| <a id="COP000425"></a>`COP000425` | 400 | **Bad Request**<br/>Credit operation without disbursement account.<br/><small>Operação de credito sem conta de desembolso.</small> |
| <a id="COP000426"></a>`COP000426` | 400 | **Bad Request**<br/>The sum of the installment amounts is not equal to the paid amount. Sum of installment amounts: {sum_installment_amount}, Paid amount: {paid_amount}<br/><small>A soma dos valores das parcelas não é igual ao valor pago. Soma dos valores das parcelas: {sum_installment_amount}, Valor pago: {paid_amount}</small> |
| <a id="COP000427"></a>`COP000427` | 400 | **Bad Request**<br/>The payload cannot contain both days_to_expire and qr_code_expiration_date at the same time.<br/><small>O payload não pode conter simultaneamente os campos days_to_expire e qr_code_expiration_date</small> |
| <a id="COP000428"></a>`COP000428` | 400 | **Bad Request**<br/>The maximum due date cannot exceed 14 business days from the generation date.<br/><small>A data máxima de vencimento não pode ultrapassar 14 dias úteis a partir da data de geração.</small> |
| <a id="COP000429"></a>`COP000429` | 400 | **Bad Request**<br/>Duplicate digitable line informed in after disbursement action data.<br/><small>Linha digitável duplicada informada nas ações de pós-desembolso.</small> |
| <a id="COP000430"></a>`COP000430` | 400 | **Bad Request**<br/>The collateral {collateral_type} must have a credit agent in related party list.<br/><small>A garantia {collateral_type} deve possuir um agente de crédito na lista de partes relacionadas.</small> |
| <a id="COP000431"></a>`COP000431` | 400 | **Bad Request**<br/>'individual_document_number' must be informed for credit agent.<br/><small>'individual_document_number' deve ser informado para agente de crédito.</small> |
| <a id="COP000432"></a>`COP000432` | 403 | **Forbidden**<br/>Requester is not allowed to reverse operations.<br/><small>Requester não tem permissão para reverter operações.</small> |
| <a id="COP000433"></a>`COP000433` | 400 | **Bad Request**<br/>At least one credit_operation must be open for payment to proceed for contract number {contract_number}.<br/><small>Pelo menos uma operação de crédito deve estar aberta para o pagamento prosseguir para o contrato {contract_number}.</small> |
| <a id="COP000434"></a>`COP000434` | 400 | **Bad Request**<br/>At least one credit_operation must be opened or settled to proceed with get of deductions for the contract {contract_number}.<br/><small>Pelo menos uma operação de crédito deve estar aberta ou liquidada para prosseguir com o get de deduções para o contrato {contract_number}.</small> |
| <a id="COP000435"></a>`COP000435` | 400 | **Bad Request**<br/>The installment can't be in 'paid_partial' status with paid amount equal or greater than installment total amount.<br/><small>A parcela não pode estar no status 'paid_partial' com o valor pago igual ou maior que o valor total da parcela.</small> |
| <a id="COP000436"></a>`COP000436` | 400 | **Bad Request**<br/>A related party with role type: {role_type} already exist.<br/><small>Uma parte relacionada com o tipo de função: {role_type} já existe.</small> |
| <a id="COP000437"></a>`COP000437` | 404 | **Not Found**<br/>No portability CO found for this refinancing<br/><small>Nenhuma operação de portabilidade encontrada para este refinanciamento</small> |
| <a id="COP000438"></a>`COP000438` | 404 | **Not Found**<br/>No settled refinanced credit operation found for this refinancing<br/><small>Nenhuma operação de crédito refinanciada liquidada encontrada para este refinanciamento</small> |
| <a id="COP000439"></a>`COP000439` | 409 | **Conflict**<br/>All refinanced credit operations are already reversed<br/><small>Todas as operações de crédito refinanciadas já estão revertidas</small> |
| <a id="COP000441"></a>`COP000441` | 404 | **Not Found**<br/>No eligible refinanced credit operation found for status update.<br/><small>Nenhuma refinanced credit operation elegível encontrada para alteração de status.</small> |
| <a id="COP000442"></a>`COP000442` | 404 | **Status not found**<br/>The specified status was not found in the system.<br/><small>O status informado não foi encontrado no sistema.</small> |
| <a id="COP000443"></a>`COP000443` | 409 | **Conflict**<br/>The specified refinanced credit operation is already reversed.<br/><small>A operação de crédito refinanciada informada já foi revertida.</small> |
| <a id="COP000444"></a>`COP000444` | 400 | **Bad Request**<br/>The credit operation has more than one refinanced credit operation.<br/><small>A operação de crédito possui mais de uma operação de crédito refinanciada.</small> |
| <a id="COP000445"></a>`COP000445` | 400 | **Bad Request**<br/>The credit agent: {document_number} is not authorized to issue a credit operation.<br/><small>O agente de crédito: {document_number} não está autorizado a emitir operação de crédito.</small> |
| <a id="COP000446"></a>`COP000446` | 404 | **Not Found**<br/>No refinanced credit operations found<br/><small>Nenhuma operação de crédito refinanciada encontrada</small> |
| <a id="COP000447"></a>`COP000447` | 404 | **Not Found**<br/>No refinanced credit operations opened found<br/><small>Nenhuma operação de crédito refinanciada aberta encontrada</small> |
| <a id="COP000448"></a>`COP000448` | 400 | **Bad Request**<br/>The credit operation is settled<br/><small>A operação de crédito já está liquidada</small> |
| <a id="COP000449"></a>`COP000449` | 400 | **Bad Request**<br/>The credit operation is not eligible for insurance premium<br/><small>A operação de crédito não é elegível para seguro</small> |
| <a id="COP000450"></a>`COP000450` | 409 | **Conflict**<br/>The related party address is already set.<br/><small>O endereço da parte relacionada já está definido.</small> |
| <a id="COP000451"></a>`COP000451` | 404 | **Not Found**<br/>The related party address is not set.<br/><small>O endereço da parte relacionada não está definido.</small> |
| <a id="COP000452"></a>`COP000452` | 400 | **Bad Request**<br/>The modality ncom is not allowed for non ncom credit operation type.<br/><small>A modalidade ncom não é permitida para operações de crédito que não são ncom.</small> |
| <a id="COP000453"></a>`COP000453` | 400 | **Bad Request**<br/>The credit operation must be a ncom credit operation.<br/><small>A operação de crédito deve ser uma operação de crédito ncom.</small> |
| <a id="COP000454"></a>`COP000454` | 400 | **Bad Request**<br/>The credit operation is assigned.<br/><small>A operação de crédito está atribuída.</small> |
| <a id="COP000455"></a>`COP000455` | 404 | **Not Found**<br/>The marital status was not found.<br/><small>O estado civil não foi encontrado.</small> |
| <a id="COP000456"></a>`COP000456` | 400 | **Bad Request**<br/>The email is not valid.<br/><small>O email não é válido.</small> |
| <a id="COP000457"></a>`COP000457` | 404 | **Not Found**<br/>The property system was not found.<br/><small>O sistema de propriedade não foi encontrado.</small> |
| <a id="COP000458"></a>`COP000458` | 400 | **Bad Request**<br/>The date cannot be more than 110 years ago.<br/><small>A data não pode ser mais de 110 anos atrás.</small> |
| <a id="COP000459"></a>`COP000459` | 400 | **Bad Request**<br/>The birth date must be in YYYY-MM-DD format.<br/><small>A data de nascimento deve estar no formato YYYY-MM-DD.</small> |
| <a id="COP000460"></a>`COP000460` | 404 | **Not Found**<br/>The document identification type was not found.<br/><small>O tipo de documento de identificação não foi encontrado.</small> |
| <a id="COP000461"></a>`COP000461` | 404 | **Not Found**<br/>The gender was not found.<br/><small>O gênero não foi encontrado.</small> |
| <a id="COP000462"></a>`COP000462` | 400 | **Bad Request**<br/>The paid amount must be less than the present amount of the installment: {present_amount}.<br/><small>O valor pago deve ser menor que o valor presente da parcela: {present_amount}.</small> |
| <a id="COP000463"></a>`COP000463` | 400 | **Bad Request**<br/>The paid amount must be less than or equal to the present amount of the installment: {present_amount}.<br/><small>O valor pago deve ser menor ou igual ao valor presente da parcela: {present_amount}.</small> |
| <a id="COP000464"></a>`COP000464` | 400 | **Bad Request**<br/>The installment status must be 'paid' or 'paid_partial'.<br/><small>O status da parcela deve ser 'paid' ou 'paid_partial'.</small> |
| <a id="COP000465"></a>`COP000465` | 400 | **Bad Request**<br/>The credit operation must be assigned to be paid.<br/><small>A operação de crédito deve estar cedida para ser paga.</small> |
| <a id="COP000466"></a>`COP000466` | 400 | **Bad Request**<br/>The paid at date must be in the past.<br/><small>A data de pagamento deve ser no passado.</small> |
| <a id="COP000467"></a>`COP000467` | 400 | **Bad Request**<br/>The installment must be in a pending status to be paid.<br/><small>A parcela deve estar em um status pendente para ser paga.</small> |
| <a id="COP000468"></a>`COP000468` | 400 | **Bad Request**<br/>Cannot change disbursement date of a credit operation that has disbursement end date in the past. disbursement_end_date: {disbursement_end_date}<br/><small>Não é possível alterar a data de desembolso de uma operação de crédito que possui data de fim de desembolso no passado. disbursement_end_date: {disbursement_end_date}</small> |
| <a id="COP000469"></a>`COP000469` | 400 | **Bad Request**<br/>Cannot pay to Inbursa.<br/><small>Não é possível pagar para o Inbursa.</small> |
| <a id="COP000470"></a>`COP000470` | 400 | **Bad Request**<br/>The paid amount cannot be zero.<br/><small>O valor pago não pode ser zero.</small> |
| <a id="COP000471"></a>`COP000471` | 400 | **Bad Request**<br/>The annual CET is not valid. Received: {received_annual_cet}, Calculated: {calculated_annual_cet}<br/><small>O CET anual não é válido. Recebido: {received_annual_cet}, Calculado: {calculated_annual_cet}</small> |
| <a id="COP000472"></a>`COP000472` | 400 | **Bad Request**<br/>The monthly CET is not valid. Received: {received_monthly_cet}, Calculated: {calculated_monthly_cet}<br/><small>O CET mensal não é válido. Recebido: {received_monthly_cet}, Calculado: {calculated_monthly_cet}</small> |
| <a id="COP000473"></a>`COP000473` | 400 | **Bad Request**<br/>The date field {field_en} is invalid: {reason_en}<br/><small>O campo de data {field_pt} é inválido: {reason_pt}</small> |
| <a id="COP000474"></a>`COP000474` | 400 | **Bad Request**<br/>Installment payment before contract start<br/><small>Pagamento de parcela antes do início do contrato</small> |
| <a id="COP000475"></a>`COP000475` | 400 | **Bad Request**<br/>Amount must be greater than {min_amount} and less than {max_amount}.<br/><small>O valor deve ser maior que {min_amount} e menor que {max_amount}.</small> |
| <a id="COP000476"></a>`COP000476` | 400 | **Bad Request**<br/>The reservation status of the refinanced credit operation does not allow this operation.<br/><small>O status de reserva da operação refinanciada não permite esta operação.</small> |
| <a id="COP000477"></a>`COP000477` | 400 | **Bad Request**<br/>The paid at date is more than 5 days from the current date<br/><small>A data de pagamento está há mais de 5 dias da data atual</small> |
| <a id="COP000478"></a>`COP000478` | 400 | **Bad Request**<br/>Discount amount {discount_amount} exceeds due balance {due_balance}<br/><small>Valor de desconto {discount_amount} excede o valor devido {due_balance}</small> |
| <a id="COP000479"></a>`COP000479` | 400 | **Bad Request**<br/>Cancel not permitted, maximum quantity for uncancel reached<br/><small>Cancelamento não permitido, quantidade máxima de cancelamentos atingida</small> |
| <a id="COP000480"></a>`COP000480` | 400 | **Bad Request**<br/>Credit Operation already assigned and cannot have its purchaser changed<br/><small>A operação de crédito já está cedida e não pode ter seu cessionário alterado</small> |
| <a id="COP000481"></a>`COP000481` | 400 | **Bad Request**<br/>Credit Operation with assignment in progress and cannot have its purchaser changed<br/><small>A operação de crédito com cessão em andamento e não pode ter seu cessionário alterado</small> |
| <a id="COP000482"></a>`COP000482` | 400 | **Bad Request**<br/>A document of type {document_type} already exists for this related party.<br/><small>Um documento do tipo {document_type} já existe para o assinante em questão.</small> |
| <a id="COP000483"></a>`COP000483` | 401 | **Unauthorized**<br/>Invalid recalculation.<br/><small>Recalculo invalido.</small> |
| <a id="COP000484"></a>`COP000484` | 400 | **Bad Request**<br/>Monthly interest rate or installments must be provided.<br/><small>A taxa de juros mensal ou as parcelas devem ser fornecidas.</small> |
| <a id="COP000485"></a>`COP000485` | 400 | **Bad Request**<br/>Action must be in the same titularity as issuer document number when the operation has insurance.<br/><small>A ação deve ser na mesma titulação do documento do emitente.</small> |
| <a id="COP000486"></a>`COP000486` | 400 | **Bad Request**<br/>Action must be ted or pix when the operation has insurance.<br/><small>A ação deve ser ted ou pix quando a operação possui seguro.</small> |
| <a id="COP000487"></a>`COP000487` | 400 | **Bad Request**<br/>Action transaction amount must be equal to credit operation final disbursement amount minus insurance premium qi amount released.<br/><small>O valor da ação deve ser igual ao valor final de desembolso da operação de crédito menos o valor do seguro.</small> |
| <a id="COP000488"></a>`COP000488` | 400 | **Bad Request**<br/>The requester configuration is not active.<br/><small>A configuração do solicitante não está ativa.</small> |
| <a id="COP000506"></a>`COP000506` | 400 | **Bad Request**<br/>Vehicle proposal item mismatch in {mismatch_field}: sum of items ({items_sum}) must equal proposal.{amount_field} ({expected_amount}).<br/><small>Inconsistência em {mismatch_field} da proposta veicular: a soma dos itens ({items_sum}) deve ser igual a proposal.{amount_field} ({expected_amount}).</small> |

### CT — Credit Transfer

133 errors

| Code | HTTP | Message |
|-|-|-|
| <a id="CT000001"></a>`CT000001` | 400 | **Bad Request**<br/>Use POST /account |
| <a id="CT000002"></a>`CT000002` | 404 | **Not Found**<br/>Proposal not found<br/><small>Proposta não encontrada</small> |
| <a id="CT000003"></a>`CT000003` | 404 | **Not Found**<br/>Credit Operation not found ({credit_operation_key}).<br/><small>Operação de crédito não encontrada ({credit_operation_key}).</small> |
| <a id="CT000004"></a>`CT000004` | 409 | **Conflict**<br/>Proposal status ({proposal_status}) does not allow portability settlement request.<br/><small>Status da proposta ({proposal_status}) não permite solicitação de liquidação de portabilidade.</small> |
| <a id="CT000006"></a>`CT000006` | 404 | **Not Found**<br/>Financial Institution with code {financial_institution_code_number} not found<br/><small>Instituição Financeira com código {financial_institution_code_number} não encontrada.</small> |
| <a id="CT000007"></a>`CT000007` | 404 | **Not Found**<br/>Requester configuration for requester key {requester_key}.<br/><small>Configuração de requisitante com key {requester_key} não encontrada.</small> |
| <a id="CT000008"></a>`CT000008` | 400 | **Bad Request**<br/>CCB participants are not the same as the signers<br/><small>Participantes da CCB não são iguais aos signatários</small> |
| <a id="CT000009"></a>`CT000009` | 400 | **Bad Request**<br/>Contract amount must be greater than the disbursement amount<br/><small>Valor do contrato deve ser maior que o valor do desembolso</small> |
| <a id="CT000010"></a>`CT000010` | 400 | **Bad Request**<br/>Invalid proposal status {enumerator} for cancellation.<br/><small>Status da proposta {enumerator} inválido para cancelamento.</small> |
| <a id="CT000011"></a>`CT000011` | 400 | **Bad Request**<br/>Invalid Action<br/><small>Ação Inválida</small> |
| <a id="CT000012"></a>`CT000012` | 400 | **Bad Request**<br/>Field 'type' cannot be null and must contain one of the values ('data-signature', 'pdf-signature')<br/><small>O campo 'type' não pode ser nulo e deve conter um dos valores ('data-signature', 'pdf-signature')</small> |
| <a id="CT000013"></a>`CT000013` | 400 | **Bad Request**<br/>This operation has already been signed.<br/><small>Essa operação ja foi assinada.</small> |
| <a id="CT000014"></a>`CT000014` | 400 | **Bad Request**<br/>Invalid document certifier<br/><small>Certificadora invalida.</small> |
| <a id="CT000015"></a>`CT000015` | 400 | **Bad Request**<br/>Failed validating MT hash. Reason: {reason}<br/><small>Falha ao validar hash MT. Razão: {reason}</small> |
| <a id="CT000016"></a>`CT000016` | 400 | **Bad Request**<br/>signature_template_key not associated with requester configuration.<br/><small>signature_template_key não associada a configuração do requisitante.</small> |
| <a id="CT000017"></a>`CT000017` | 400 | **Bad Request**<br/>The proposal is not pending accptance by requester.<br/><small>A proposta não está pendente aceite.</small> |
| <a id="CT000018"></a>`CT000018` | 400 | **Bad Request**<br/>Failed to check contract in dataprev. Please try again.<br/><small>Falha ao validar contrato na dataprev, tente novamente.</small> |
| <a id="CT000019"></a>`CT000019` | 400 | **Bad Request**<br/>Proposal has no contract number.<br/><small>Proposta não tem número de contrato.</small> |
| <a id="CT000020"></a>`CT000020` | 400 | **Bad Request**<br/>Contract has errors on Dataprev.<br/><small>O contrato possui erros na Dataprev.</small> |
| <a id="CT000021"></a>`CT000021` | 400 | **Bad Request**<br/>Invalid time for signature and disbursement process.<br/><small>Horário invalido para processo de desembolso e assinatura.</small> |
| <a id="CT000023"></a>`CT000023` | 400 | **Bad Request**<br/>This operation has been canceled.<br/><small>Essa operação foi cancelada.</small> |
| <a id="CT000024"></a>`CT000024` | 404 | **Not Found**<br/>Received portability not found.<br/><small>Portabilidade não encontrada.</small> |
| <a id="CT000025"></a>`CT000025` | 404 | **Not Found**<br/>Received portability status not found.<br/><small>Status da portabilidade não encontrada.</small> |
| <a id="CT000026"></a>`CT000026` | 404 | **Not Found**<br/>Retained reason not found.<br/><small>Razão de retenção não encontrada.</small> |
| <a id="CT000027"></a>`CT000027` | 400 | **Bad Request**<br/>Approved method past closing time<br/><small>Método de aprovação fora do horário permitido</small> |
| <a id="CT000028"></a>`CT000028` | 400 | **Bad Request**<br/>Retention method past max day and closing time<br/><small>Método de retenção fora da data e horário máximo</small> |
| <a id="CT000029"></a>`CT000029` | 400 | **Bad Request**<br/>Retention reason mandatory<br/><small>Razao de retenção obrigatório</small> |
| <a id="CT000030"></a>`CT000030` | 400 | **Bad Request**<br/>Cancel reason mandatory<br/><small>Razao de cancelamento obrigatório</small> |
| <a id="CT000031"></a>`CT000031` | 404 | **Bad Request**<br/>Contract not found in BTG system. contract_number: {message}<br/><small>Contrato não encontrado no sistema do BTG. contract_number: {message}</small> |
| <a id="CT000032"></a>`CT000032` | 400 | **Bad Request**<br/>BTG due balance date doesnt match max portability date.<br/><small>Data do cálculo do saldo devedor do BTG não é igual à data máxima de envio da portabilidade.</small> |
| <a id="CT000033"></a>`CT000033` | 400 | **Bad Request**<br/>The operation data must have one of the fields: desired_installments or installment_face_value.<br/><small>O operation data deve possuir um dos campos: desired_installments or installment_face_value.</small> |
| <a id="CT000034"></a>`CT000034` | 400 | **Bad Request**<br/>Invalid fee payment for rco report.<br/><small>O status do fee payment não é válido para a validação de rco.</small> |
| <a id="CT000035"></a>`CT000035` | 400 | **Bad Request**<br/>Incomplete requester configuration. the requester must have a refinancing template key. Please, contact our support.<br/><small>Configuração incompleta do solicitante. o solicitante deve ter template key de refinanciamento. Por favor, entre em contato com nosso suporte.</small> |
| <a id="CT000036"></a>`CT000036` | 400 | **Bad Request**<br/>Operation contract document must be signed.<br/><small>O documento de contrato da operação deve estar assinado.</small> |
| <a id="CT000037"></a>`CT000037` | 400 | **Bad Request**<br/>Error while send collateral reservation.{ex}<br/><small>Erro ao enviar reserva da garantia. {ex}</small> |
| <a id="CT000038"></a>`CT000038` | 400 | **Bad Request**<br/>Credit Operation status doesnt allow signature.<br/><small>Status da operação de crédito não permite assinatura.</small> |
| <a id="CT000039"></a>`CT000039` | 400 | **Bad Request**<br/>Credit operation type must be portability_credit_operation or refinancing_credit_operation.<br/><small>Tipo da operação deve ser portability_credit_operation ou refinancing_credit_operation.</small> |
| <a id="CT000040"></a>`CT000040` | 400 | **Bad Request**<br/>Portability operation must be in 'paid' status to accept refinancing operation.<br/><small>Operação de portabilidade deve estar no status 'paid' para continuar com a operação de refinanciamento.</small> |
| <a id="CT000041"></a>`CT000041` | 400 | **Bad Request**<br/>Collateral from portability must be constituted to continue refinancing operation.<br/><small>Colateral da operação de portabilidade deve estar constituído para continuar operação de refinanciamento.</small> |
| <a id="CT000042"></a>`CT000042` | 400 | **Bad Request**<br/>Refinancing operation must be issued to proceed.<br/><small>Operação de refinanciamento deve estar emitida para prosseguir.</small> |
| <a id="CT000043"></a>`CT000043` | 404 | **Bad Request**<br/>Refinancing operation not found.<br/><small>Operação de refinanciamento não encontrada.</small> |
| <a id="CT000044"></a>`CT000044` | 400 | **Bad Request**<br/>Refinancing operation status does not allow cancellation.<br/><small>Status da operação de refinanciamento não permite cancelamento.</small> |
| <a id="CT000045"></a>`CT000045` | 400 | **Bad Request**<br/>This operation is only allowed for collateral type social_security and dataprev_reservation refinancing operations.<br/><small>Essa operação só é permitida para operações de refinanciamento com garantia de INSS.</small> |
| <a id="CT000046"></a>`CT000046` | 400 | **Bad Request**<br/>Operation status ({operation_status}) does not allow this operation.<br/><small>Status da operação de refinanciamento ({operation_status}) não permite essa operação.</small> |
| <a id="CT000047"></a>`CT000047` | 400 | **Bad Request**<br/>Refinancing operation must be constituted in Dataprev to change disbursement date.<br/><small>Operação de refinanciamento deve estar constituída para alterar data de desembolso.</small> |
| <a id="CT000048"></a>`CT000048` | 400 | **Bad Request**<br/>Incomplete requester configuration. Please Contact our support.<br/><small>Configuração do requisitante incompleta. Por favor, entre em contato com nosso suporte.</small> |
| <a id="CT000049"></a>`CT000049` | 400 | **Bad Request**<br/>Financial institution sent in original contract is not CIP participant. ispb: {ispb_number}<br/><small>Instituição financeira enviada no contrato original não é participante da CIP. ispb: {ispb_number}</small> |
| <a id="CT000050"></a>`CT000050` | 400 | **Bad Request**<br/>Financial institution code was not sent. portability_number: {portability_number}<br/><small>Código da instituição financeira não foi enviado. portability_number: {portability_number}</small> |
| <a id="CT000051"></a>`CT000051` | 400 | **Bad Request**<br/>It wasn't possible to notificate BTG about a received portability. portability_number: {portability_number}<br/><small>Não foi possível notificar o BTG sobre um ataque de portabilidade. portability_number: {portability_number}</small> |
| <a id="CT000052"></a>`CT000052` | 400 | **Bad Request**<br/>It wasn't possible to confirm a portability for BTG. portability_number: {portability_number}<br/><small>Não foi possível confirmar uma portabilidade para o BTG. portability_number: {portability_number}</small> |
| <a id="CT000053"></a>`CT000053` | 400 | **Bad Request**<br/>It wasn't possible to cancel a portability for BTG as STR0047 wasn't correct. portability_number: {portability_number}<br/><small>Não foi possível cancelar uma portabilidade para o BTG já que a STR0047 não estava correta. portability_number: {portability_number}</small> |
| <a id="CT000054"></a>`CT000054` | 400 | **Bad Request**<br/>Portability proposal do not have refinancing<br/><small>Proposta de portabilidade não foi cadastrad com o refinanciamento</small> |
| <a id="CT000055"></a>`CT000055` | 400 | **Bad Request**<br/>To create refinancing operation must be sent financial and disbursement bank account data.<br/><small>Para criar um refinanciamento os dados financeiros e de conta de desembolso devem ser enviados.</small> |
| <a id="CT000056"></a>`CT000056` | 400 | **Bad Request**<br/>Proposal actual status {proposal_status} does not allow this operation.<br/><small>O status atual da proposta {proposal_status} não permite essa operação.</small> |
| <a id="CT000057"></a>`CT000057` | 400 | **Bad Request**<br/>The installment amount of the new simulation({new_installment_amount}) must be lower than original installment amount ({origin_contract_installment_value}).<br/><small>O valor da parcela da nova simulação({new_installment_amount}) deve ser inferior ao valor da parcela da operação original ({origin_contract_installment_value}).</small> |
| <a id="CT000058"></a>`CT000058` | 400 | **Bad Request**<br/>Proposal must be submitted within {default_delta_days} days after creation, difference in days between proposal creation and submission date: {days}.<br/><small>A proposta deve ser enviada até {default_delta_days} dias depois da criação, diferença de dias entre data de criação da proposta e envio: {days}.</small> |
| <a id="CT000059"></a>`CT000059` | 400 | **Bad Request**<br/>The interest rate informed/calculated for the {operation_type} operation exceeds what is permitted by law for the collateral type informed.  Informed/calculated interest rate: {montlhy_rate}.  Limit allowed by law for the collateral type {collateral_type}: {max_interest_rate}.<br/><small>A taxa informada/calculada da operação de {operation_type_translate}, ultrapassa o permitido por lei para o tipo de garantia informada.  Taxa informada/calculada da operação: {montlhy_rate}.  Limite permitido por lei para o tipo de garantia {collateral_type}: {max_interest_rate}.</small> |
| <a id="CT000060"></a>`CT000060` | 400 | **Bad Request**<br/>The provided related_party_key is not from borrower or issuer legal representative.<br/><small>A related_party_key fornecida não é a do tomador ou do representante legal.</small> |
| <a id="CT000061"></a>`CT000061` | 400 | **Bad Request**<br/>Collateral not found for reported credit operation.<br/><small>Collateral não encontrada para operação de credito informada.</small> |
| <a id="CT000062"></a>`CT000062` | 400 | **Bad Request**<br/>Field {field} is required.<br/><small>Campo {field} é obrigatório.</small> |
| <a id="CT000063"></a>`CT000063` | 400 | **Bad Request**<br/>Wrong datetime format. Received: {signature_datetime}, expected format: '2023-01-01T12:30:55.000001Z'.<br/><small>Formato de data incorreto. Recebido: {signature_datetime}, formato esperado: '2023-01-01T12:30:55.000001Z'.</small> |
| <a id="CT000064"></a>`CT000064` | 400 | **Bad Request**<br/>Retention reason '{retention_reason}' not allowed for this operation.<br/><small>Motivo de retenção '{retention_reason}' não permitido para este tipo de operação.</small> |
| <a id="CT000065"></a>`CT000065` | 400 | **Bad Request**<br/>The number of installments of the portability operation is longer than the remaining number of installments of the original operation.<br/><small>O número de parcelas da operação de portabilidade é maior do que o número de parcelas remanescente da operação original.</small> |
| <a id="CT000066"></a>`CT000066` | 400 | **Bad Request**<br/>Portability must be in status settlement_sent to be able to change to pending_settlement_confirmation<br/><small>Portabilidade deve estar no status settlement_sent para poder alterar para pending_settlement_confirmation</small> |
| <a id="CT000067"></a>`CT000067` | 404 | **Not Found**<br/>portability_settlement not found.<br/><small>portability_settlement não encontrado.</small> |
| <a id="CT000068"></a>`CT000068` | 400 | **Bad Request**<br/>Refinancing operation can not be accepted without signature data<br/><small>Operação de refinanciamento não pode ser aceita sem dados de assinatura;</small> |
| <a id="CT000069"></a>`CT000069` | 400 | **Bad Request**<br/>Delete method past closing time<br/><small>Método de deleção fora do horário permitido</small> |
| <a id="CT000070"></a>`CT000070` | 400 | **Bad Request**<br/>Accepted by requester proposal can not be delete in the same day as approved.<br/><small>Propostas aceitas pelo solicitante não podem ser deletadas no mesmo dia de aprovação.</small> |
| <a id="CT000071"></a>`CT000071` | 400 | **Bad Request**<br/>Invalid time to send STR0047<br/><small>Horário inválido para envio de STR0047</small> |
| <a id="CT000072"></a>`CT000072` | 400 | **Bad Request**<br/>Pending settlement confirmation portability must be reserved by portability to continue refinancing operation or portability paid for at least 4 days.<br/><small>Operação de portabilidade sem pagamento confirmado só pode continuar com o refinanciamento se o colateral estiver averbado por portabilidade ou portabilidade paga a no mínimo 4 dias.</small> |
| <a id="CT000073"></a>`CT000073` | 400 | **Bad Request**<br/>Refinancing already accepted.<br/><small>Refinanciamento já foi aceito.</small> |
| <a id="CT000074"></a>`CT000074` | 400 | **Bad Request**<br/>The calculated annual interest rate ({annual_interest_rate}) is too low.<br/><small>A taxa anual calculada ({annual_interest_rate}) é muito baixa.</small> |
| <a id="CT000075"></a>`CT000075` | 400 | **Bad Request**<br/>Retention Proof document mandatory<br/><small>Documento de evidência de retenção obrigatório.</small> |
| <a id="CT000076"></a>`CT000076` | 400 | **Bad Request**<br/>Can only cancel refinancing operation with opened status.<br/><small>Somente operações de refinanciamento com status aberto podem ser canceladas</small> |
| <a id="CT000077"></a>`CT000077` | 404 | **Bad Request**<br/>Portability not found for portability_number: {portability_number}.<br/><small>Portabilidade não encontrada para o número de portabilidade: {portability_number}.</small> |
| <a id="CT000078"></a>`CT000078` | 400 | **Bad Request**<br/>Received portability status {received_portability_status} does not allow retention.<br/><small>Received portability status {received_portability_status} não permite retenção.</small> |
| <a id="CT000079"></a>`CT000079` | 400 | **Bad Request**<br/>Refinancing operation must not be constituted in Dataprev to change disbursement and financial informations.<br/><small>Operação de refinanciamento não pode estar constituída para alterar as informações financeiras e de desembolso.</small> |
| <a id="CT000080"></a>`CT000080` | 400 | **Bad Request**<br/>Refinancing operation must be signed to continue.<br/><small>Operação de refinanciamento precisa estar assinada para continuar.</small> |
| <a id="CT000081"></a>`CT000081` | 400 | **Not Found**<br/>Credit Operation not in canceled_permanently status.<br/><small>Operação de crédito não está no status canceled_permanently.</small> |
| <a id="CT000082"></a>`CT000082` | 400 | **Bad Request**<br/>Portability can not be with collateral constituted to alter data.<br/><small>Portabilidade não pode ter collateral constituído para alterar dados.</small> |
| <a id="CT000083"></a>`CT000083` | 400 | **Bad Request**<br/>Portability should be with consignable margin excceded error to alter data.<br/><small>Portabilidade deve estar com erro de margem consignade excedida para alterar dados.</small> |
| <a id="CT000084"></a>`CT000084` | 400 | **Bad Request**<br/>Portability new installment face value must be lower than old installment face value.<br/><small>Novo valor de face da parcela da portabilidade precisa ser menor que o valor antido de face.</small> |
| <a id="CT000085"></a>`CT000085` | 404 | **Not Found**<br/>Proposal does not have a portability settlement.<br/><small>Proposta não tem liquidação.</small> |
| <a id="CT000086"></a>`CT000086` | 400 | **Bad Request**<br/>It's not permitted to create operation type portability with refinancing_data<br/><small>Não é permitido criar o tipo de operação portability com refinancing_data</small> |
| <a id="CT000087"></a>`CT000087` | 400 | **Bad Request**<br/>Portability collateral must be constituted to add rebates.<br/><small>A portabilidade precisa estar com a garantia averbada para adicionar rebates.</small> |
| <a id="CT000088"></a>`CT000088` | 400 | **Bad Request**<br/>Grace period is just allowed to refinance operations.<br/><small>Carência só é permitida para operações de refinanciamento.</small> |
| <a id="CT000089"></a>`CT000089` | 400 | **Bad Request**<br/>Grace period not allowed to borrower with document number '{document_number}' from state '{state}'.<br/><small>Carência não permitida para o tomador com o cpf '{document_number}' do estado '{state}'.</small> |
| <a id="CT000090"></a>`CT000090` | 400 | **Bad Request**<br/>The number '{number_of_grace_periods}' of grace competencies is invalid. The accepted range is 0 to 6.<br/><small>O número '{number_of_grace_periods}' da carência de competências está inválido. O intervalo aceito é de 0 a 6.</small> |
| <a id="CT000091"></a>`CT000091` | 400 | **Bad Request**<br/>Annual interest rate must be lower than {max_annual_interest_rate}. Calculated annual interest rate: {annual_rate}.<br/><small>Taxa de juros anual deve ser menor que {max_annual_interest_rate}. Taxa de juros anual calculada: {annual_rate}.</small> |
| <a id="CT000092"></a>`CT000092` | 400 | **Bad Request**<br/>Current received portability status {current_received_portability_status} does not allow change to {new_received_portability_status}.<br/><small>O status de portabilidade recebida atual {current_received_portability_status} não permite alterar para {new_received_portability_status}.</small> |
| <a id="CT000093"></a>`CT000093` | 400 | **Bad Request**<br/>The ISPB code from the institution of the origin contract cannot be the same as QI SCD.<br/><small>O código ISPB da instituição do contrato de origem não pode ser o mesmo da QI SCD.</small> |
| <a id="CT000094"></a>`CT000094` | 400 | **Bad Request**<br/>Subcorban with document number {document_number} not permitted.<br/><small>Subcorban com numero de documento {document_number} não permitido.</small> |
| <a id="CT000095"></a>`CT000095` | 400 | **Bad Request**<br/>Cannot update collateral data for constituted credit operation.<br/><small>Não é possível atualizar dados de garantia para operação de crédito constituída.</small> |
| <a id="CT000096"></a>`CT000096` | 400 | **Bad Request**<br/>Cannot approve proposal for the following origin institution {ispb}.<br/><small>Não é possível aprovar a proposta para a seguinte instituição {ispb}</small> |
| <a id="CT000097"></a>`CT000097` | 400 | **Bad Request**<br/>Received Portability not retained.<br/><small>A portabilidade recebida não está retida.</small> |
| <a id="CT000098"></a>`CT000098` | 400 | **Bad Request**<br/>Invalid Ip Address {ip_address} .<br/><small>Endereço de Ip inválido {ip_address} .</small> |
| <a id="CT000099"></a>`CT000099` | 400 | **Bad Request**<br/>The installment amount of the new refinancing simulation ({new_installment_amount}) has a difference of less than {percent_difference}% compared to the original installment amount ({origin_contract_installment_value}).<br/><small>O valor da parcela da nova simulação ({new_installment_amount}) tem uma diferença inferior a {percent_difference}% em relação ao valor da parcela da operação original ({origin_contract_installment_value}).</small> |
| <a id="CT000100"></a>`CT000100` | 400 | **Bad Request**<br/>The final disbursement amount ({final_disbursement_amount}) is less than {minimum_final_disbursement_amount}.<br/><small>O valor do desembolso final ({final_disbursement_amount}) é inferior a {minimum_final_disbursement_amount}.</small> |
| <a id="CT000101"></a>`CT000101` | 400 | **Bad Request**<br/>The ISPB code from the institution of the origin contract {ispb_number} cannot be the in this list: {ispb_block_list}.<br/><small>O código ISPB da instituição do contrato de origem {ispb_number} não pode estar nessa lista: {ispb_block_list}.</small> |
| <a id="CT000102"></a>`CT000102` | 400 | **Bad Request**<br/>Operation cannot be ported with zero installments paid.<br/><small>Não é possível portar operação com nenhuma parcela paga.</small> |
| <a id="CT000103"></a>`CT000103` | 400 | **Bad Request**<br/>Operations outside the purchase's eligibility. {error}<br/><small>Operações fora da elegibilidade do cessionário. {error_ptbr}</small> |
| <a id="CT000104"></a>`CT000104` | 400 | **Bad Request**<br/>The difference between portability due balance and refinanced operation amount must be greather or equals to 10% of the due balance value. Percentual: {percentage}%.<br/><small>A diferença entre o saldo devedor da portabilidade e o valor da operação de refin deve ser maior ou igual que 10% do valor do saldo devedor. Percentage: {percentage}%.</small> |
| <a id="CT000105"></a>`CT000105` | 400 | **Bad Request**<br/>The reduction in the final disbursed amount can't be greather than 10%.<br/><small>A redução do valor de troco para o tomador não deve ser maior que 10%.</small> |
| <a id="CT000106"></a>`CT000106` | 400 | **Bad Request**<br/>The received portability cannot be accepted because the contract has been assigned<br/><small>A portabilidade não pode ser aceita porque o contrato foi cedido</small> |
| <a id="CT000107"></a>`CT000107` | 400 | **Bad Request**<br/>Assignment eligibility validation failed.<br/><small>Validação de elegibilidade para cessão falhou.</small> |
| <a id="CT000108"></a>`CT000108` | 400 | **Bad Request**<br/>All documents must have a valid 'document_key' field.<br/><small>Todos os documentos devem conter uma 'document_key' válida.</small> |
| <a id="CT000109"></a>`CT000109` | 400 | **Bad Request**<br/>All documents must have a valid 'file_type' field.<br/><small>Todos os documentos devem conter um 'file_type' válido.</small> |
| <a id="CT000110"></a>`CT000110` | 400 | **Bad Request**<br/>First refinancing due date different from first portability due date.<br/><small>Primeira data de vencimento do refinanciamento é diferente da primeira data de vencimento da portabilidade.</small> |
| <a id="CT000111"></a>`CT000111` | 400 | **Bad Request**<br/>STR not sent, could not generate STR0047 receipt<br/><small>STR não enviado, não foi possível gerar o STR0047 receipt</small> |
| <a id="CT000112"></a>`CT000112` | 400 | **Bad Request**<br/>Accepting portability disabled<br/><small>Aceitação de portabilidade desabilitada</small> |
| <a id="CT000113"></a>`CT000113` | 400 | **Bad Request**<br/>Monthly interest rate {monthly_interest_rate} is less than {min_monthly_interest_rate}<br/><small>A taxa de juros mensal {monthly_interest_rate} é menor que {min_monthly_interest_rate}</small> |
| <a id="CT000114"></a>`CT000114` | 400 | **Bad Request**<br/>the field assistance_type and state are required<br/><small>o campo assistance_type e state são obrigatórios</small> |
| <a id="CT000115"></a>`CT000115` | 400 | **Bad Request**<br/>bank code or isbp number is required |
| <a id="CT000116"></a>`CT000116` | 400 | **Bad Request**<br/>Credit agent must be informed for proposal with {collateral_type} collateral type.<br/><small>Agente de crédito deve ser informado para proposta com garantia do tipo {collateral_type}.</small> |
| <a id="CT000117"></a>`CT000117` | 400 | **Bad Request**<br/>Can only recreate portability operation with settled status.<br/><small>Só é possível recriar a operação de portabilidade com o status 'settled'.</small> |
| <a id="CT000118"></a>`CT000118` | 400 | **Bad Request**<br/>The final disbursement amount is less than {min_final_disbursement_amount_diff_percentage}% of the sum of refinancing installment minus the sum of portability installment. The minimum final disbursement amount allowed is {min_final_disbursement_amount}. Calculated final disbursement amount: {final_disbursement_amount}.<br/><small>O valor do troco é menor que {min_final_disbursement_amount_diff_percentage}% da soma do valor das parcelas do refinanciamento menos o valor soma das parcelas da portabilidade. O valor mínimo do troco permitido é de {min_final_disbursement_amount}. Valor calculado do troco: {final_disbursement_amount}.</small> |
| <a id="CT000119"></a>`CT000119` | 400 | **Bad Request**<br/>The credit agent: {document_number} is not authorized to issue a credit operation.<br/><small>O agente de crédito: {document_number} não está autorizado a emitir operação de crédito.</small> |
| <a id="CT000120"></a>`CT000120` | 400 | **Bad Request**<br/>Received portability update after closing time<br/><small>Atualização de Received portability após horário de fechamento</small> |
| <a id="CT000121"></a>`CT000121` | 400 | **Bad Request**<br/>Cannot port a contract originally issued by QI Tech.<br/><small>Não é possível portar um contrato originalmente emitido pela QI Tech.</small> |
| <a id="CT000122"></a>`CT000122` | 409 | **Conflict**<br/>The requester_control_key already exists.<br/><small>A requester_control_key já existe.</small> |
| <a id="CT000123"></a>`CT000123` | 400 | **Bad Request**<br/>Portability disbursement can not be greater than refinancing disbursement date.<br/><small>A data de desembolso da portabilidade não pode ser maior que a data de desembolso do refinanciamento.</small> |
| <a id="CT000124"></a>`CT000124` | 400 | **Bad Request**<br/>Natural person type related party can't have numbers in name and must contain at least one letter. Invalid name: {related_party_name}<br/><small>Parte relacionada do tipo pessoa física não pode possuir números no nome e deve conter pelo menos uma letra. Nome invalido: {related_party_name}</small> |
| <a id="CT000125"></a>`CT000125` | 400 | **Bad Request**<br/>The field Document Identification Date is invalid: {reason_en}<br/><small>O campo Data de expedição do documento de identidade é inválido: {reason_pt}</small> |
| <a id="CT000126"></a>`CT000126` | 400 | **Bad Request**<br/>The field Birth Date is invalid: {reason_en}<br/><small>O campo Data de Nascimento é inválido: {reason_pt}</small> |
| <a id="CT000127"></a>`CT000127` | 400 | **Bad Request**<br/>The field Foundation Date is invalid: {reason_en}<br/><small>O campo Data de Fundação é inválido: {reason_pt}</small> |
| <a id="CT000128"></a>`CT000128` | 400 | **Bad Request**<br/>The field company_document_number is invalid. Document: {document_number}<br/><small>O campo company_document_number está inválido. Documento: {document_number}</small> |
| <a id="CT000129"></a>`CT000129` | 400 | **Bad Request**<br/>The field individual_document_number is invalid. Document: {document_number}<br/><small>O campo individual_document_number está inválido. Documento: {document_number}</small> |
| <a id="CT000130"></a>`CT000130` | 400 | **Bad Request**<br/>Wrong date format. Received: {signature_datetime}, expected format: '2023-01-01'.<br/><small>Formato de data incorreto. Recebido: {signature_datetime}, formato esperado: '2023-01-01'.</small> |
| <a id="CT000131"></a>`CT000131` | 404 | **Not Found**<br/>Not found portability settlement key.<br/><small>Não foi encontrada uma baixa de portabilidade com essa chave.</small> |
| <a id="CT000131"></a>`CT000131` | 404 | **Bad Request**<br/>Portability credit operation is not opened.<br/><small>Operação de portabilidade não está aberta.</small> |
| <a id="CT000133"></a>`CT000133` | 400 | **Bad Request**<br/>Insurance premium QI is not allowed for social security collateral.<br/><small>Prêmio de seguro QI não é permitido para INSS.</small> |
| <a id="CT000134"></a>`CT000134` | 400 | **Bad Request**<br/>The number of overdue installments in the origin contract must be less than or equal to 1.<br/><small>O número de parcelas em atraso no contrato de origem deve ser menor ou igual a 1.</small> |
| <a id="CT000135"></a>`CT000135` | 400 | **Bad Request**<br/>Portability not allowed.<br/><small>Portabilidade não permitida.</small> |

### DOC — Documents

102 errors

| Code | HTTP | Message |
|-|-|-|
| <a id="DOC000001"></a>`DOC000001` | 400 | **Payload Validation Error**<br/>{parse_error} |
| <a id="DOC000002"></a>`DOC000002` | 400 | **Certifier Type Error**<br/>Document from certifier {certifier_type} not supported<br/><small>Documento da certificadora {certifier_type} não suportado</small> |
| <a id="DOC000003"></a>`DOC000003` | 400 | **Bad Request**<br/>Missing document_key. Use GET /clicksign/{document_key}<br/><small>Falta document_key. Use GET /clicksign/{document_key}</small> |
| <a id="DOC000004"></a>`DOC000004` | 404 | **Document Not Found**<br/>Document not found with provided key: {document_key}<br/><small>Documento não encontrado para seguinte chave: {document_key}</small> |
| <a id="DOC000005"></a>`DOC000005` | 400 | **Bad Request**<br/>Use GET /document/{person_key} or /document/{person_key}/{document_key}<br/><small>Use GET /document/{person_key} ou /document/{person_key}/{document_key}</small> |
| <a id="DOC000006"></a>`DOC000006` | 400 | **Bad Request**<br/>Use POST /document |
| <a id="DOC000007"></a>`DOC000007` | 404 | **Not Found**<br/>Document batch not found for key {document_batch_key}<br/><small>Lote de documento não encontrado para a chave {document_batch_key}</small> |
| <a id="DOC000008"></a>`DOC000008` | 400 | **Bad Request**<br/>No body provided<br/><small>Body da request vazio.</small> |
| <a id="DOC000009"></a>`DOC000009` | 404 | **Not Found**<br/>Status not found<br/><small>Status não encontrado</small> |
| <a id="DOC000010"></a>`DOC000010` | 400 | **Bad Request**<br/>Use PUT /document/{person_key}/{document_key}/{status_name} or /document/{document_key}/{status_name}<br/><small>Use PUT /document/{person_key}/{document_key}/{status_name} ou /document/{document_key}/{status_name}</small> |
| <a id="DOC000011"></a>`DOC000011` | 400 | **Bad Request**<br/>Missing {action} parameter. Use one of the followings: send_to_signature. Please use PUT /document_batch/{document_batch_key}/{action}<br/><small>Falta o parâmetro {action}. Use o dos seguintes valores: send_to_signature. Por favor, use PUT /document_batch/{document_batch_key}/{action}</small> |
| <a id="DOC000012"></a>`DOC000012` | 400 | **Certifier Error**<br/>Certifier {document_batch_certifier} not supported for document batch<br/><small>Certificadora {document_batch_certifier} não disponível para esta ação</small> |
| <a id="DOC000013"></a>`DOC000013` | 400 | **Document Batch Error**<br/>Document batch {document_batch_key} has no documents inside<br/><small>Lote de documentos {document_batch_key} não possui documentos</small> |
| <a id="DOC000014"></a>`DOC000014` | 400 | **Document Batch Error**<br/>Document Batch has already been sent to signature<br/><small>Lote de documentos já foi enviado para assinatura</small> |
| <a id="DOC000015"></a>`DOC000015` | 400 | **Document Batch Error**<br/>Document Batch has already been sent to signature and signed<br/><small>Lote de documentos já foi enviado para assinatura e assinado</small> |
| <a id="DOC000016"></a>`DOC000016` | 400 | **Document Batch Error**<br/>Document Batch status is canceled and cannot be sent to signature<br/><small>Lote de documentos já foi cancelado e portanto não pode ser enviado para assinatura</small> |
| <a id="DOC000017"></a>`DOC000017` | 400 | **Document Batch Error**<br/>Document {document_key} inside document_batch has status {document_status}. Document status must be pending_document_batch when sending document_batch to signature<br/><small>Documento {document_key} dentro do lote de documentos tem status {document_status}. O status do documento deve ser pending_document_batch quando está tentando enviar o lote de documentos para assinatura</small> |
| <a id="DOC000018"></a>`DOC000018` | 400 | **Document Batch Error**<br/>Missing document_batch_key. Please use PUT /document_batch/{document_batch_key}/{action}<br/><small>Chave do lote de documentos faltando (document_batch_key). Por favor use Please use PUT /document_batch/{document_batch_key}/{action}</small> |
| <a id="DOC000019"></a>`DOC000019` | 404 | **Document Not Found**<br/>Document not found<br/><small>Documento não encontrado</small> |
| <a id="DOC000020"></a>`DOC000020` | 400 | **Document Draft Error**<br/>Document final file has already been uploaded<br/><small>Arquivo final do documento já foi enviado</small> |
| <a id="DOC000021"></a>`DOC000021` | 404 | **Template Not Found**<br/>Template not found<br/><small>Template não encontrado</small> |
| <a id="DOC000022"></a>`DOC000022` | 400 | **Document Draft Error**<br/>Document must be signable<br/><small>Documento deve ser assinável</small> |
| <a id="DOC000023"></a>`DOC000023` | 400 | **Bad Request**<br/>Use POST /draft/{document_key}/{template_key} |
| <a id="DOC000024"></a>`DOC000024` | 400 | **Bad Request**<br/>No template key found<br/><small>Chave do template não encontrada</small> |
| <a id="DOC000025"></a>`DOC000025` | 400 | **Bad Request**<br/>Use POST /resend_notification/{document_key} or /resend_notification with document_key_list<br/><small>Use POST /resend_notification/{document_key} ou /resend_notification com document_key_list</small> |
| <a id="DOC000026"></a>`DOC000026` | 404 | **Not Found**<br/>Could not find any of the following document(s) {document_key_list}<br/><small>Não foi possível encontrar nenhum dos documentos {document_key_list}</small> |
| <a id="DOC000027"></a>`DOC000027` | 400 | **Bad Request**<br/>Notification resend for {certifier} is not available.<br/><small>Reenvio de notificação não disponível para {certifier}.</small> |
| <a id="DOC000028"></a>`DOC000028` | 400 | **Bad Request**<br/>Use GET /signer_group/{signer_group_key} or /signer_group?signer_group_key_list=key,key, or /signer_group?owner_person_key={person_key}&referred_party_document_number_list=document_number,document_number, or /signer_group?expiration=AAAA-MM-DD<br/><small>Use GET /signer_group/{signer_group_key} ou /signer_group?signer_group_key_list=key,key, ou /signer_group?owner_person_key={person_key}&referred_party_document_number_list=document_number,document_number, ou /signer_group?expiration=AAAA-MM-DD</small> |
| <a id="DOC000029"></a>`DOC000029` | 400 | **Bad Request**<br/>Use GET /signer_group?owner_person_key={person_key}&referred_party_document_number_list= when using referred_party_document_number_list<br/><small>Use GET /signer_group?owner_person_key={person_key}&referred_party_document_number_list= para usar referred_party_document_number_list</small> |
| <a id="DOC000030"></a>`DOC000030` | 400 | **Bad Request**<br/>Can not use signer_group_key_list and referred_party_document_number_list together<br/><small>Não é possível usar signer_group_key_list e referred_party_document_number_list juntos</small> |
| <a id="DOC000031"></a>`DOC000031` | 400 | **Bad Request**<br/>URL malformed please use /signer_group?signer_group_key_list=key,key,<br/><small>URL errada, use /signer_group?signer_group_key_list=key,key,</small> |
| <a id="DOC000032"></a>`DOC000032` | 400 | **Bad Request**<br/>URL malformed please use /signer_group?referred_party_document_number_list=document_number,document_number,<br/><small>URL errada, use /signer_group?referred_party_document_number_list=document_number,document_number,</small> |
| <a id="DOC000033"></a>`DOC000033` | 404 | **Not Found**<br/>Signer Groups with filter not found<br/><small>Grupos de assinantes com filtro não encontrados</small> |
| <a id="DOC000034"></a>`DOC000034` | 404 | **Not Found**<br/>Signer Group with key {signer_group_key} not found<br/><small>Grupo de assinantes com chave {signer_group_key}</small> |
| <a id="DOC000035"></a>`DOC000035` | 404 | **Not Found**<br/>Signer Group with key {signer_group_key} not found<br/><small>Grupo de assinantes com chave {signer_group_key}</small> |
| <a id="DOC000036"></a>`DOC000036` | 403 | **Unauthorized**<br/>This agent can not create a public signer group.<br/><small>Este agente não pode criar um grupo de assinantes público</small> |
| <a id="DOC000037"></a>`DOC000037` | 400 | **Bad Request**<br/>Use Patch /signer_group/{signer_group_key} or /signer_group with signer_group_key_list in payload.<br/><small>Use Patch /signer_group/{signer_group_key} ou /signer_group com signer_group_key_list no payload.</small> |
| <a id="DOC000038"></a>`DOC000038` | 403 | **Unauthorized**<br/>Agent can not make this update.<br/><small>Agente não autorizado para este update.</small> |
| <a id="DOC000039"></a>`DOC000039` | 403 | **Unauthorized**<br/>This agent can not modified a public signer group.<br/><small>Este agente não pode alterar um grupo de assinantes publico.</small> |
| <a id="DOC000040"></a>`DOC000040` | 400 | **Bad Request**<br/>Signer Group with key {signer_group_key} is inactivated<br/><small>Grupo de assinantes com chave {signer_group_key} está inativo.</small> |
| <a id="DOC000041"></a>`DOC000041` | 400 | **Bad Request**<br/>Use Patch /signer_group_expired with expiration in payload.<br/><small>Use Patch /signer_group_expired com data de expiração no payload.</small> |
| <a id="DOC000042"></a>`DOC000042` | 400 | **Bad Request**<br/>Can not expire signer groups different from today<br/><small>Não é possível expirar grupos de assinantes com data diferente de hoje.</small> |
| <a id="DOC000043"></a>`DOC000043` | 400 | **Bad Request**<br/>Use GET /template/{template_key} or /template/ with a document_type as parameter or owner_person_key, referred_document_number, name and document_type<br/><small>Use GET /template/{template_key} ou /template/ com parâmetro document_type ou owner_person_key, referred_document_number, name e document_type</small> |
| <a id="DOC000044"></a>`DOC000044` | 404 | **Not Found**<br/>Template not found for the given parameters.<br/><small>Template não encontrado para os parâmetros fornecidos.</small> |
| <a id="DOC000045"></a>`DOC000045` | 400 | **Bad Request**<br/>Payload schema invalid<br/><small>Payload inválido</small> |
| <a id="DOC000046"></a>`DOC000046` | 400 | **Invalid Template**<br/>Template file must have .html extension.<br/><small>Arquivo do template deve ser .html</small> |
| <a id="DOC000047"></a>`DOC000047` | 400 | **Bad Request**<br/>Use PUT /upload/{document_key}/{template_key} |
| <a id="DOC000048"></a>`DOC000048` | 400 | **Bad Request**<br/>Please inform the order to append the file (first or last)<br/><small>Por favor informe a ordem que deseja anexar o arquivo (no início ou fim)</small> |
| <a id="DOC000049"></a>`DOC000049` | 400 | **Bad Request**<br/>Document is empty<br/><small>Documento vazio</small> |
| <a id="DOC000050"></a>`DOC000050` | 400 | **Bad Request**<br/>Request is not internal<br/><small>Request não é interna</small> |
| <a id="DOC000051"></a>`DOC000051` | 400 | **Bad Request**<br/>Use POST /webhook/{source}/{document_id} |
| <a id="DOC000052"></a>`DOC000052` | 400 | **Bad Request**<br/>Document with document_key {document_key} has a wrong document batch id {document_batch_id}<br/><small>document_batch_id {document_batch_id} errado para o documento com document_key {document_key}</small> |
| <a id="DOC000053"></a>`DOC000053` | 400 | **Bad Request**<br/>Invalid status.<br/><small>Status inválido.</small> |
| <a id="DOC000054"></a>`DOC000054` | 401 | **Invalid Header**<br/>Invalid header (content-hmac)<br/><small>Header inválido (content-hmac)</small> |
| <a id="DOC000055"></a>`DOC000055` | 401 | **Unauthorized**<br/>Event {event} received. Event unauthorized<br/><small>Evento {event} recebido mas não autorizado</small> |
| <a id="DOC000056"></a>`DOC000056` | 400 | **Bad Request**<br/>Event {event} received but cannot be processed<br/><small>Evento {event} recebido mas não processado</small> |
| <a id="DOC000057"></a>`DOC000057` | 422 | **Unprocessable Entity**<br/>Unable to retrieve 'ziped_file_url' ('document' -> 'downloads' -> 'ziped_file_url') from request<br/><small>Não foi possível encontrar 'ziped_file_url' ('document' -> 'downloads' -> 'ziped_file_url') na request</small> |
| <a id="DOC000058"></a>`DOC000058` | 400 | **Bad Request**<br/>Please provide document_type<br/><small>Favor fornecer o tipo do documento</small> |
| <a id="DOC000059"></a>`DOC000059` | 400 | **Bad Request**<br/>Use POST /edit_signer/{document_key} |
| <a id="DOC000060"></a>`DOC000060` | 404 | **Not Found**<br/>Could not find any of the following document {document_key}<br/><small>Não foi possível encontrar o documento {document_key}</small> |
| <a id="DOC000061"></a>`DOC000061` | 400 | **Bad Request**<br/>Edit signerfor {certifier} is not available.<br/><small>Edição de assinante não disponível para {certifier}.</small> |
| <a id="DOC000062"></a>`DOC000062` | 400 | **Bad Request**<br/>Could not upload file because it's empty.<br/><small>Não foi possível fazer o upload porque o arquivo está vazio.</small> |
| <a id="DOC000063"></a>`DOC000063` | 400 | **Bad Request**<br/>document_key or document_batch_key is required to auto sign events. Please send one of them inside request params<br/><small>document_key ou document_batch_key é obrigatória para auto assinar eventos. Por favor envie um deles dentro dos params da request.</small> |
| <a id="DOC000064"></a>`DOC000064` | 400 | **Bad Request**<br/>control_number is already in use {control_number}<br/><small>A chave control_number enviada já está em uso {control_number}</small> |
| <a id="DOC000065"></a>`DOC000065` | 400 | **Bad Request**<br/>Document was not informed<br/><small>Documento não foi informado</small> |
| <a id="DOC000066"></a>`DOC000066` | 400 | **Bad Request**<br/>Document name '{document_name}' already exist<br/><small>Nome do documento '{document_name}' já existe</small> |
| <a id="DOC000067"></a>`DOC000067` | 400 | **Bad Request**<br/>Pdf file not found<br/><small>Arquivo pdf não encontrado</small> |
| <a id="DOC000068"></a>`DOC000068` | 500 | **Internal Error**<br/>Concurrency error! File not found {file_name}<br/><small>Erro de concorrencia. Arquivo não encontrado {file_name}</small> |
| <a id="DOC000069"></a>`DOC000069` | 400 | **Bad Request**<br/>Missing phone number for the chosen signature method.<br/><small>Número de telefone não informado para o método de assinatura escolhido.</small> |
| <a id="DOC000070"></a>`DOC000070` | 400 | **Bad Request**<br/>The PDF file is truncated or broken.<br/><small>O arquivo PDF está truncado ou quebrado.</small> |
| <a id="DOC000071"></a>`DOC000071` | 400 | **Bad Request**<br/>Error on document check. This information should have exactly {digits} digits. Document: {document}<br/><small>Erro na validação do documento. Essa informação precisa ter exatamente {digits}. Document: {document}</small> |
| <a id="DOC000072"></a>`DOC000072` | 400 | **Bad Request**<br/>Error on email check. Email format invalid Email: {email}<br/><small>Erro na Verificação do e-mail. Formato invalido: {email}</small> |
| <a id="DOC000073"></a>`DOC000073` | 400 | **Bad Request**<br/>The provided role ({role}) is not one of the valid one`s: {allowed_roles}<br/><small>A provided role ({role}) não é uma das validas: {allowed_roles}</small> |
| <a id="DOC000074"></a>`DOC000074` | 400 | **Bad Request**<br/>A click_sign_file_path must be provided.<br/><small>Um click_sign_file_path deve ser informado.</small> |
| <a id="DOC000075"></a>`DOC000075` | 400 | **Bad Request**<br/>At least the email, phone_number or is_api parameters should be provided.<br/><small>Pelo menos os parâmetros email, phone_number ou is_api devem ser informados.</small> |
| <a id="DOC000076"></a>`DOC000076` | 400 | **Bad Request**<br/>Signature method registered on signatory does not match any of email or sms.<br/><small>O método de assinatura registrado no signatário não corresponde a nenhum email or sms.</small> |
| <a id="DOC000077"></a>`DOC000077` | 400 | **Bad Request**<br/>PDF file can't have a password.<br/><small>O arquivo PDF não pode conter senha.</small> |
| <a id="DOC000078"></a>`DOC000078` | 400 | **Bad Request**<br/>File not found<br/><small>Arquivo não encontrado</small> |
| <a id="DOC000079"></a>`DOC000079` | 400 | **Invalid Template**<br/>Template syntax error. Line:{line} Error:{error_msg}<br/><small>Erro de escrita no template. Linha:{line} Erro:{error_msg}</small> |
| <a id="DOC000080"></a>`DOC000080` | 400 | **Invalid Template**<br/>Template error. Error:{error_msg}<br/><small>Erro no template. Erro:{error_msg}</small> |
| <a id="DOC000081"></a>`DOC000081` | 400 | **Invalid document type**<br/>{document_type} is not a valid document type.<br/><small>{document_type} não é um tipo de documento valido.</small> |
| <a id="DOC000082"></a>`DOC000082` | 400 | **Bad Request**<br/>Signature webhook payload should not be null.<br/><small>Payload de webhook de assinatura não pode ser nulo.</small> |
| <a id="DOC000083"></a>`DOC000083` | 400 | **Invalid signature key**<br/>Invalid QiSign signature key.<br/><small>Chave de assinatura da QiSign invalida..</small> |
| <a id="DOC000084"></a>`DOC000084` | 400 | **Invalid webhook status**<br/>Invalid status received in QiSign webhook.<br/><small>Status invalido no webhook da QISign recebido.</small> |
| <a id="DOC000085"></a>`DOC000085` | 400 | **Signed document not found**<br/>Signed document not found in QiSign.<br/><small>Documento assinado não encontrado na QiSign.</small> |
| <a id="DOC000086"></a>`DOC000086` | 400 | **Bad Request**<br/>It is necessary to send the signed pdf<br/><small>É necessário enviar o pdf assinado</small> |
| <a id="DOC000087"></a>`DOC000087` | 400 | **Bad Request**<br/>Could not render PDF. HTML may be malformed.<br/><small>Não foi possível renderizar o PDF. O HTML pode estar inválido.</small> |
| <a id="DOC000088"></a>`DOC000088` | 400 | **Bad Request**<br/>Only file with pdf content type can be sent.<br/><small>Somente arquivos com conteúdo do tipo pdf podem ser enviados.</small> |
| <a id="DOC000089"></a>`DOC000089` | 400 | **Bad Request**<br/>Document number invalid. Not possible to send the document to the clicksign .<br/><small>Número de documento inválido. Não foi possível enviar o documento para o clicksign.</small> |
| <a id="DOC000090"></a>`DOC000090` | 400 | **Bad Request**<br/>Error while sending document to the clicksing.<br/><small>Erro durante o envio do documento para o clicksing.</small> |
| <a id="DOC000091"></a>`DOC000091` | 400 | **Bad Request**<br/>Document requester must have a configuration to use this certifier. Please contact support.<br/><small>O solicitante do documento precisa ter uma configuração para usar esta certificadora. Por favor, entre em contato com o suporte.</small> |
| <a id="DOC000092"></a>`DOC000092` | 400 | **Bad Request**<br/>Invalid Status to process document ({document_key}) in {subscriber_name} subscriber. Actual status: {document_status}.<br/><small>Status invalido para processar documento ({document_key}) no subscriber {subscriber_name}. Status atual {document_status}.</small> |
| <a id="DOC000093"></a>`DOC000093` | 400 | **Bad Request**<br/>Signed document and original document must be different files.<br/><small>O documento assinado e o documento original devem ser arquivos diferentes.</small> |
| <a id="DOC000094"></a>`DOC000094` | 400 | **Bad Request**<br/>Certifier configuration not found.<br/><small>Configuração da certificadora não encontrada.</small> |
| <a id="DOC000095"></a>`DOC000095` | 400 | **Bad Request**<br/>Signer already exists for informed document number.<br/><small>Assinante ja existe para o número de documento informado.</small> |
| <a id="DOC000096"></a>`DOC000096` | 400 | **Bad Request**<br/>Signer not found for informed document number.<br/><small>Assinantenão encontrado para o número de documento informado.</small> |
| <a id="DOC000097"></a>`DOC000097` | 412 | **Document Batch Error**<br/>Documents inside document_batch has differents owners, signers or certifiers.<br/><small>Documentos dentro do Lote de Documentos possuem donos, assinantes ou certificadoras distintas.</small> |
| <a id="DOC000098"></a>`DOC000098` | 400 | **Bad Request**<br/>Cannot acess external URL to download signed PDF.<br/><small>Não foi possível acessar URL externa para baixar o PDF assinado.</small> |
| <a id="DOC000099"></a>`DOC000099` | 400 | **Bad Request**<br/>URL or Template Key must be provided for upload.<br/><small>URL ou Chave do Template deve ser enviado para o upload.</small> |
| <a id="DOC000100"></a>`DOC000100` | 400 | **Bad Request**<br/>File too large. Maximum file size: {max_size} bytes. Uploaded file size: {file_size} bytes<br/><small>Arquivo muito grande. Tamanho máximo do arquivo: {max_size} bytes. Tamanho do arquivo: {file_size} bytes.</small> |
| <a id="DOC000101"></a>`DOC000101` | 400 | **Bad Request**<br/>Documents inside document_batch has different signers.<br/><small>Documentos dentro do lote de documentos possuem assinantes distintos.</small> |
| <a id="DOC000102"></a>`DOC000102` | 400 | **Bad Request**<br/>Owner not found.<br/><small>Dono não encontrado.</small> |

### FGTS — FGTS

42 errors

| Code | HTTP | Message |
|-|-|-|
| <a id="FGTS00003"></a>`FGTS00003` | 404 | **Not Found**<br/>The given reservation_request_key {key} could not be found.<br/><small>A chave reservation_request_key {key} não pode ser encontrada.</small> |
| <a id="FGTS00004"></a>`FGTS00004` | 404 | **Not Found**<br/>The given external_key {key} could not be found.<br/><small>A chave external_key {key} não pode ser encontrada.</small> |
| <a id="FGTS00005"></a>`FGTS00005` | 400 | **Bad Request**<br/>Credit Operation status<br/><small>Status</small> |
| <a id="FGTS00007"></a>`FGTS00007` | 504 | **Gateway Time-out**<br/>The server did not respond in time<br/><small>O servidor não respondeu a tempo</small> |
| <a id="FGTS00008"></a>`FGTS00008` | 400 | **Bad Request**<br/>Caixa server did not respond in time. Try again in a few seconds.<br/><small>Os servidores da Caixa não responderam no tempo determinado. Tente novamente em alguns</small> |
| <a id="FGTS00009"></a>`FGTS00009` | 400 | **Bad Request**<br/>Caixa server did not respond with a valid token. Try again in a few seconds.<br/><small>Os servidores da Caixa não responderam com um token válido. Tente novamente em alguns</small> |
| <a id="FGTS00010"></a>`FGTS00010` | 400 | **Bad Request**<br/>Caixa server returned an error.<br/><small>Os servidores da Caixa retornaram um erro.</small> |
| <a id="FGTS00011"></a>`FGTS00011` | 500 | **Internal Error**<br/>Cache server returned an error.<br/><small>Os servidores da cache retornaram um erro.</small> |
| <a id="FGTS00012"></a>`FGTS00012` | 400 | **Bad Request**<br/>Reservation is already closed.<br/><small>Reserva já está desaverbada.</small> |
| <a id="FGTS00014"></a>`FGTS00014` | 429 | **Too Many Requests**<br/>Rate limit for document {document_number} exceeded the max of {limit_per_hour} failed requests per 15 minutes. Retry at UTC {retry_at}<br/><small>Taxa limite para o documento {document_number} excedeu o máximo de {limit_per_hour} requisições com erro em 15 minutos. Retentar às {retry_at} UTC.</small> |
| <a id="FGTS00017"></a>`FGTS00017` | 401 | **Unauthorized**<br/>Action not allowed for role: {role}<br/><small>Ação não permitida para cargo: {role}</small> |
| <a id="FGTS00020"></a>`FGTS00020` | 400 | **Bad Request**<br/> |
| <a id="FGTS00022"></a>`FGTS00022` | 400 | **Bad Request**<br/>Reservation status<br/><small>Reserva com status</small> |
| <a id="FGTS00023"></a>`FGTS00023` | 400 | **Bad Request**<br/>Reservation already in closure process. Key: {reservation_request_key}<br/><small>Reserva já em processo de desaverbação</small> |
| <a id="FGTS00024"></a>`FGTS00024` | 404 | **Not Found**<br/>The period could not be found<br/><small>O periodo nao pôde ser encontrado</small> |
| <a id="FGTS00025"></a>`FGTS00025` | 409 | **Reservation Status Conflict**<br/>A reservation {reservation_key} with status {old_status} cannot be updated to {new_status}<br/><small>Essa reserva não permite essa atualização de estados</small> |
| <a id="FGTS00026"></a>`FGTS00026` | 409 | **Reservation Status Conflict**<br/>Reservation with status<br/><small>Reservas no status</small> |
| <a id="FGTS00027"></a>`FGTS00027` | 404 | **Not Found**<br/>The given available_balance {key} could not be found.<br/><small>A solitação de saldo {key} não pode ser encontrada.</small> |
| <a id="FGTS00028"></a>`FGTS00028` | 500 | **Periods Status Are Not all Equal**<br/>Reservation with key: {key}, have periods with different status.<br/><small>Reserva com a chave: {key}, possui periodos com status diferentes</small> |
| <a id="FGTS00029"></a>`FGTS00029` | 500 | **Unexpected Period Status**<br/>Reservation with key: {key}, have periods in unexpected status.<br/><small>Reserva com a chave: {key}, possui periodos com estatus inesperados.</small> |
| <a id="FGTS00030"></a>`FGTS00030` | 500 | **Invalid Next Period**<br/>Reservation with key: {key}, has a paid period that isn<br/><small>Reserva com a chave: {key}, possui um periodo pago que não é o próximo período válido: {original_due_date}.</small> |
| <a id="FGTS00031"></a>`FGTS00031` | 400 | **Access Token Too Many Retries**<br/>Tried to get a new access token too many times while waiting a cache token<br/><small>Tentou obter um novo token de acesso muitas vezes enquanto esperava um token de cache</small> |
| <a id="FGTS00032"></a>`FGTS00032` | 404 | **Protocol Not Found**<br/>The protocol could not be found.<br/><small>O protocolo não pôde ser encontrado.</small> |
| <a id="FGTS00033"></a>`FGTS00033` | 503 | **Unavailable service**<br/>The CEF service is currently unavailable. Please, try again later<br/><small>O serviço da CEF se encontra indisponível no momento. Por favor, tente novamente mais tarde</small> |
| <a id="FGTS00034"></a>`FGTS00034` | 404 | **Available Balance To Requester Not Found**<br/>Available Balance does not belong to the requester {requester_key}.<br/><small>A consulta de saldo não pertence ao solicitante {requester_key}.</small> |
| <a id="FGTS00035"></a>`FGTS00035` | 409 | **Available Balance Status Conflict**<br/>Balance inquiry with completed process cannot have its status changed<br/><small>Consulta de saldo com processo concluído não pode ter seu status alterado</small> |
| <a id="FGTS00036"></a>`FGTS00036` | 429 | **Rate Limit Exceeded**<br/>Number of requisitions exceeded the CEF rate limit<br/><small>O número de requisições excedeu o limite da CEF</small> |
| <a id="FGTS00037"></a>`FGTS00037` | 400 | **Path Param Is Incorrect**<br/>The required path param must be<br/><small>O parâmetro de rota exigido precisa ser</small> |
| <a id="FGTS00038"></a>`FGTS00038` | 400 | **Payload Is Incorrect**<br/>A payload must be sent and cannot be empty<br/><small>Um payload deve ser enviado e ele não pode ser vazio</small> |
| <a id="FGTS00039"></a>`FGTS00039` | 408 | **The process exceeded the tolerance time**<br/>The process exceeded the tolerance time. Try again<br/><small>O processo excedeu o tempo de tolerância. Tente novamente</small> |
| <a id="FGTS00040"></a>`FGTS00040` | 404 | {queue_name} queue doesn<br/><small>A fila {queue_name} não existe. Verifique se o nome da fila está correto.</small> |
| <a id="FGTS00041"></a>`FGTS00041` | 409 | A queue with<br/><small>Já existe uma fila com o nome</small> |
| <a id="FGTS00042"></a>`FGTS00042` | 404 | The requester {requester_key} doesn<br/><small>O cliente {requester_key} não existe. Verifique se a chave do cliente está correta.</small> |
| <a id="FGTS00043"></a>`FGTS00043` | 400 | The requester<br/><small>O cliente</small> |
| <a id="FGTS00044"></a>`FGTS00044` | 403 | **Request not allowed at the moment**<br/>This request is not allowed at the moment. Please try again between the 20th and 5th of the month, during the hours of 22:00 (10 PM) to 07:00 (7 AM).<br/><small>Esta solicitação não é permitida no momento. Por favor, tente novamente entre os dias 20 e 5 do mês, durante o horário das 22:00 (10 PM) às 07:00 (7 AM).</small> |
| <a id="FGTS00045"></a>`FGTS00045` | 409 | **Period Status Conflict**<br/>The period<br/><small>O período</small> |
| <a id="FGTS00046"></a>`FGTS00046` | 409 | **Period Status Conflict**<br/>The period<br/><small>O período</small> |
| <a id="FGTS00047"></a>`FGTS00047` | 404 | **The reservation is not in status**<br/>The reservation is not in status<br/><small>A reserva não está no status</small> |
| <a id="FGTS00048"></a>`FGTS00048` | 409 | **Period Status Conflict**<br/>The period<br/><small>O período</small> |
| <a id="FGTS00049"></a>`FGTS00049` | 409 | **Reservation Already Locked**<br/>The reservation<br/><small>A reserva</small> |
| <a id="FGTS00401"></a>`FGTS00401` | 401 | **Unauthenticated User**<br/>You need to be authenticated to send this request.<br/><small>Você precisa estar autenticado para realizar essa requisição.</small> |
| <a id="FGTS00403"></a>`FGTS00403` | 404 | **Invalid Document Number Format**<br/>The given document number {document_number} is invalid or malformed. Use only digits.<br/><small>O número de documento {document_number} é inválido ou está mal formatado. Use apenas dígitos.</small> |

### FPL — Federal Payroll

23 errors

| Code | HTTP | Message |
|-|-|-|
| <a id="FPL000001"></a>`FPL000001` | 400 | **Bad Request**<br/>Given {document_number} document number is invalid.<br/><small>CPF {document_number} fornecido não é valido.</small> |
| <a id="FPL000002"></a>`FPL000002` | 400 | **Bad Request**<br/>Given reservation_period: {reservation_period}, must be greater than 0 and equal to the number of periods.<br/><small>O período da reserva deve ser maior que 0 e igual ao valor de períodos.</small> |
| <a id="FPL000003"></a>`FPL000003` | 400 | **Bad Request**<br/>All periods must have the amount equal to reservation amount: {reservation_amount}.<br/><small>Todos os períodos da reserva devem possuir valor igual ao valor reservado: {reservation_amount}</small> |
| <a id="FPL000004"></a>`FPL000004` | 400 | **Bad Request**<br/>Periods due date must be grater than today.<br/><small>Os períodos devem possuir data superior a hoje.</small> |
| <a id="FPL000006"></a>`FPL000006` | 400 | **Bad Request**<br/>Amount disbursed {disbursed_amount} cannot be greater than the sum of the {amount_payable} installments<br/><small>Montante desenbolsado {disbursed_amount} não pode ser maior que a soma das parcelas {amount_payable}</small> |
| <a id="FPL000007"></a>`FPL000007` | 400 | **Bad Request**<br/>Periods due date must occur in sub sequent months.<br/><small>Os períodos devem possuir datas em meses subsequentes.</small> |
| <a id="FPL000008"></a>`FPL000008` | 409 | **Reservation Status Conflict**<br/>Reservation with status<br/><small>Reservas no status</small> |
| <a id="FPL000009"></a>`FPL000009` | 400 | **Refinancing contract cannot be reverted**<br/>Refinancing contract cannot be reverted after 7 working days from reservation.<br/><small>Contrato de refinanciamento não pode ser revertido após 7 dias úteis da reserva.</small> |
| <a id="FPL000010"></a>`FPL000010` | 500 | **Product doesn**<br/>The requested product doesn<br/><small>O produto requerido não existe.</small> |
| <a id="FPL000012"></a>`FPL000012` | 404 | **Balance not Found**<br/>Balance with key {balance_key} was not found.<br/><small>A consulta de saldo com chave {balance_key} não foi encontrada.</small> |
| <a id="FPL000013"></a>`FPL000013` | 404 | **Reservation not Found**<br/>Reservation with key {reservation_key} was not found.<br/><small>A reserva com chave {reservation_key} não foi encontrada.</small> |
| <a id="FPL000014"></a>`FPL000014` | 404 | **External key not Found**<br/>Reservation with external key {external_key} was not found.<br/><small>A reserva com chave externa {external_key} não foi encontrada.</small> |
| <a id="FPL000015"></a>`FPL000015` | 409 |  |
| <a id="FPL000016"></a>`FPL000016` | 404 | **Contract not Found**<br/>Contract {contract_number} not found<br/><small>Contrato {contract_number} não encontrado</small> |
| <a id="FPL000018"></a>`FPL000018` | 404 | **Disbursemente Option not Found**<br/>Disbursemente option for {disbursement_date} was not found.<br/><small>Opção de desembolso para {disbursement_date} não foi encontrada.</small> |
| <a id="FPL000019"></a>`FPL000019` | - | Cache server returned an error.<br/><small>Os servidores da cache retornaram um erro.</small> |
| <a id="FPL000020"></a>`FPL000020` | 409 | **Conflict**<br/>Balance Request with status {status} cannot be retried.<br/><small>Consulta de margem com status {status} não pode ser retentado.</small> |
| <a id="FPL000021"></a>`FPL000021` | 400 | **Reservation status not permitted on refinancing**<br/>Reservation with external_key: {external_key} is on status {status} which is not permitted for refinancing.<br/><small>Reserva com a chave externa: {external_key}  está no status {status} que não é permitido para refinanciamento.</small> |
| <a id="FPL000022"></a>`FPL000022` | 404 | **Protocol not Found**<br/>Protocol with key {external_key} was not found.<br/><small>Protocolo com chave {external_key} não foi encontrada.</small> |
| <a id="FPL000023"></a>`FPL000023` | 400 | **Ivanlid protocol type**<br/>Protocol type {protocol_type} doesn<br/><small>Protocolo do tipo {protocol_type} não existe.</small> |
| <a id="FPL000024"></a>`FPL000024` | 400 | **Invalid Balance**<br/>Balance with status {balance_status} can<br/><small>A consulta de saldo com status {balance_status} não pode ser processada.</small> |
| <a id="FPL000025"></a>`FPL000025` | 500 | **Incorrect Refinanced Reservation.**<br/>The number of refinanced reservation is incorrect.<br/><small>O número de reservas refinanciadas está incorreto.</small> |
| <a id="FPL000026"></a>`FPL000026` | 400 | **Incorrect Reservation Status.**<br/>The reservation {reservation_key} is in an incorrect status for this flow - status: {status_enumerator}.<br/><small>A reserva {reservation_key} está em um status incorreto para este fluxo -  status: {status_enumerator}.</small> |

### GDF — Platform

28 errors

| Code | HTTP | Message |
|-|-|-|
| <a id="GDF000001"></a>`GDF000001` | 403 | **Permission Validation Error**<br/>Only master user's are allowed<br/><small>Somente usuários master são permitidos</small> |
| <a id="GDF000002"></a>`GDF000002` | 403 | **Permission Validation Error**<br/>A SELECTED-AGENT must be provided<br/><small>Um SELECTED-AGENT deve ser fornecido</small> |
| <a id="GDF000003"></a>`GDF000003` | 400 | **Bad Request**<br/>No API Client Key received<br/><small>Nenhuma chave de API do cliente recebida</small> |
| <a id="GDF000004"></a>`GDF000004` | 400 | **Bad Request**<br/>Empty body received<br/><small>Corpo da request vazio</small> |
| <a id="GDF000005"></a>`GDF000005` | 400 | **Bad Request**<br/>API Client already created for this person_key<br/><small>Cliente da API já criado para esta person_key</small> |
| <a id="GDF000006"></a>`GDF000006` | 400 | **Bad Request**<br/>Duplicated allowed_endpoint provided<br/><small>allowed_endpoint duplicado</small> |
| <a id="GDF000007"></a>`GDF000007` | 404 | **Not Found**<br/>No ClientIntegration found for client_integration_key: {client_integration_key} .<br/><small>Nenhuma ClientIntegration encontrada para client_integration_key: {client_integration_key}.</small> |
| <a id="GDF000008"></a>`GDF000008` | 400 | **Bad Request**<br/>A client_integration_key must be provided<br/><small>Uma client_integration_key deve ser fornecida</small> |
| <a id="GDF000009"></a>`GDF000009` | 400 | **Bad Request**<br/>A action must be provided<br/><small>Uma ação deve ser fornecida</small> |
| <a id="GDF000010"></a>`GDF000010` | 400 | **Bad Request**<br/>Action doesnt exist ({action_name}).<br/><small>Ação não existe ({action_name}).</small> |
| <a id="GDF000011"></a>`GDF000011` | 404 | **Not Found**<br/>No ClientIntegration found for client_integration_key / allowed_endpoint_key: {client_integration_key} / {allowed_endpoint_key}.<br/><small>Nenhuma ClientIntegration encontrada para client_integration_key / allowed_endpoint_key: {client_integration_key} / {allowed_endpoint_key}.</small> |
| <a id="GDF000012"></a>`GDF000012` | 404 | **Not Found**<br/>No AllowedEndpoint found for client_integration_key / allowed_endpoint_key: {client_integration_key} / {allowed_endpoint_key}.<br/><small>Nenhuma AllowedEndpoint encontrada para client_integration_key / allowed_endpoint_key: {client_integration_key} / {allowed_endpoint_key}.</small> |
| <a id="GDF000013"></a>`GDF000013` | 400 | **Bad Request**<br/>A allowed_endpoint_key must be provided<br/><small>Uma chave allowed_endpoint_key deve ser fornecida</small> |
| <a id="GDF000014"></a>`GDF000014` | 401 | **QI Unauthenticated**<br/>Please provide valid credentials as part of the request. (Documentation: https://docs.qitech.com.br) Details: {details}<br/><small>Por favor forneça credenciais válidas como parte da request. (Documentação: https://docs.qitech.com.br) Detalhes: {details_br}</small> |
| <a id="GDF000015"></a>`GDF000015` | 400 | **Bad Request**<br/>Please provide a valid client_public_key<br/><small>Por favor forneça uma chave pública válida</small> |
| <a id="GDF000016"></a>`GDF000016` | 400 | **Bad Request**<br/>Error while decoding request's JSON body. Please verify if body is valid. Details: {json_ex}<br/><small>Erro ao decodificar o JSON do corpo da requisição. Por favor verifique se o corpo é válido. Detalhes: {json_ex}</small> |
| <a id="GDF000017"></a>`GDF000017` | 400 | **Bad Request**<br/>Invalid Value ({info}).<br/><small>Valor inválido ({info}).</small> |
| <a id="GDF000018"></a>`GDF000018` | 404 | **Not Found**<br/>No ClientIntegration found for api_client_key: {api_client_key}.<br/><small>Nenhuma ClientIntegration encontrada para api_client_key: {api_client_key}.</small> |
| <a id="GDF000019"></a>`GDF000019` | 400 | **Bad Request**<br/>Informed request_type: '{request_type}' has not been mapped yet.<br/><small>Mapeamento ainda inexistente para request_type: '{request_type}'.</small> |
| <a id="GDF000020"></a>`GDF000020` | 500 | **Internal Error**<br/>Account Key can't be null when including pix key.<br/><small>Account Key não pode ser nulo quando solicitar uma inclusão de chave.</small> |
| <a id="GDF000021"></a>`GDF000021` | 500 | **Internal Error**<br/>Failed to request SCR authorization.<br/><small>Falha na requisição para autorização de SCR.</small> |
| <a id="GDF000022"></a>`GDF000022` | 400 | **Bad Request**<br/>Informed request_type: '{request_type}' has not been mapped yet.<br/><small>Mapeamento ainda inexistente para request_type: '{request_type}'.</small> |
| <a id="GDF000023"></a>`GDF000023` | 401 | **Unauthorized**<br/>Error na verificação SSL<br/><small>SSL validation error</small> |
| <a id="GDF000024"></a>`GDF000024` | 400 | **Bad Request**<br/>Error no endpoint de webhook do cliente<br/><small>Error at client webhook endpoint</small> |
| <a id="GDF000025"></a>`GDF000025` | 403 | **Permission Validation Error**<br/>Only sandbox and dev environment are allowed to request Mock API<br/><small>Somente os ambientes de desenvolvimento e de sandbox são permitidos para realizar requisições na Mock API.</small> |
| <a id="GDF000026"></a>`GDF000026` | 400 | **Bad Request**<br/>Signature method version not allowed<br/><small>Versão do método de assinatura não permitida</small> |
| <a id="GDF000027"></a>`GDF000027` | 404 | **Not Found**<br/>No ClientIntegration found for person_key: {person_key}.<br/><small>Nenhuma ClientIntegration encontrada para a person_key: {person_key}.</small> |
| <a id="GDF000028"></a>`GDF000028` | 404 | **Not Found**<br/>The request needs a body, even an empty one like: '{}'.<br/><small>A requisição precisa de um body, mesmo que um vazio como: '{}'.</small> |

### LEG — Lego

155 errors

| Code | HTTP | Message |
|-|-|-|
| <a id="LEG000001"></a>`LEG000001` | 400 | **Bad Request**<br/>Use POST /configuration |
| <a id="LEG000002"></a>`LEG000002` | 400 | **Bad Request**<br/>Request is not internal<br/><small>Request não é interna</small> |
| <a id="LEG000003"></a>`LEG000003` | 400 | **Configuration Error**<br/>A configuration already exists for the person: {person_key} on the endpoint: {endpoint}. To change a configuration use PUT /configuration<br/><small>Já existe uma configuração para a pessoa: {person_key} no endpoint: {endpoint}. Para alterar uma configuração, use PUT /configuration</small> |
| <a id="LEG000004"></a>`LEG000004` | 400 | **Bad Request**<br/>No selected-agent provided<br/><small>Nenhum selected-agent fornecido</small> |
| <a id="LEG000005"></a>`LEG000005` | 400 | **Configuration Error**<br/>No configuration found for the person: {person_key} on the endpoint: {endpoint}. To register a new one, use POST /configuration<br/><small>Nenhuma configuração encontrada para a pessoa: {person_key} no endpoint: {endpoint}. Para registrar uma nova, use POST / configuration</small> |
| <a id="LEG0000057"></a>`LEG0000057` | 400 | **Bad Request**<br/>Received operation_key already registered for another operation. Please send a new one.<br/><small>A operation_key recebida já está registrada para outra operação. Por favor, envie uma key não utilizada.</small> |
| <a id="LEG000006"></a>`LEG000006` | 400 | **Configuration Error**<br/>Multiple configurations found for the person: {person_key} on the endpoint: {endpoint}. Please contact the system administrator.<br/><small>Multiplas configurações encontradas para a pessoa: {person_key} no endpoint: {endpoint}. Por favor entre em contato com o administrador</small> |
| <a id="LEG000007"></a>`LEG000007` | 400 | **Configuration Error**<br/>No configuration key provided.<br/><small>Chave da configuração não fornecida.</small> |
| <a id="LEG000008"></a>`LEG000008` | 404 | **Configuration Error**<br/>No configuration found for the configuration_key: {configuration_key}<br/><small>Nenhuma configuração encontrada para a configuration_key: {configuration_key}.</small> |
| <a id="LEG000009"></a>`LEG000009` | 404 | **Configuration Error**<br/>No configuration found for person: {person_key}<br/><small>Nenhuma configuração encontrada para a pessoa: {person_key}.</small> |
| <a id="LEG000010"></a>`LEG000010` | 400 | **Bad Request**<br/>Action is null<br/><small>A ação é nula</small> |
| <a id="LEG0000100"></a>`LEG0000100` | 400 | **Bad Request**<br/>Failed to check contract in dataprev. Please try again.<br/><small>Falha ao validar contrato na dataprev, tente novamente.</small> |
| <a id="LEG0000101"></a>`LEG0000101` | 400 | **Bad Request**<br/>Invalid status response for checking account request. Status sent {account_status}.<br/><small>Status inválido para solicão de abertura de conta. Status enviado {account_status}.</small> |
| <a id="LEG0000102"></a>`LEG0000102` | 400 | **Bad Request**<br/>Invalid pix_key. Pix key sent {pix_key}. Please contact support<br/><small>Chave pix inválida. Chave enviada {pix_key}. Por favor entre em contato.</small> |
| <a id="LEG0000103"></a>`LEG0000103` | 400 | **Bad Request**<br/>Invalid pix_key email lenght. Pix key sent {pix_key}. Email must not exceed 72 chars.<br/><small>Chave pix inválida comprimento do email. Chave enviada {pix_key}. Email não deve ultrapassar 72 caracteres.</small> |
| <a id="LEG0000104"></a>`LEG0000104` | 400 | **Bad Request**<br/>Invalid pix_key email type. Pix key sent {pix_key}. Email must not contains white space.<br/><small>Chave pix inválida email. Chave enviada {pix_key}. Email não deve conter espaços.</small> |
| <a id="LEG0000105"></a>`LEG0000105` | 400 | **Bad Request**<br/>Invalid pix_key email type. Pix key sent {pix_key}. Email must only contains lower chars .<br/><small>Chave pix inválida email. Chave enviada {pix_key}. Email deve conter apenas caracteres minúsculos.</small> |
| <a id="LEG0000106"></a>`LEG0000106` | 400 | **Bad Request**<br/>Invalid pix_key. Pix key sent {pix_key}. Phone must been in internacional format<br/><small>Chave pix inválida. Chave enviada {pix_key}. Telefone deve ser no formato internacional</small> |
| <a id="LEG0000107"></a>`LEG0000107` | 400 | **Bad Request**<br/>Invalid pix_key. Pix key sent {pix_key}. Documents must not contains special chars.<br/><small>Chave pix inválida. Chave enviada {pix_key}. Documentos não devem conter caracteres especiais.</small> |
| <a id="LEG0000108"></a>`LEG0000108` | 400 | **Bad Request**<br/>Invalid pix_key. Pix key sent {pix_key}. Documents must be valid.<br/><small>Chave pix inválida. Chave enviada {pix_key}. Documentos devem ser válidos.</small> |
| <a id="LEG0000109"></a>`LEG0000109` | 400 | **Bad Request**<br/>Invalid pix_key. Pix key sent {pix_key}. Random key must be a valid uuid4<br/><small>Chave pix inválida. Chave enviada {pix_key}. Chave aletória deve ser um uuid4 válido.</small> |
| <a id="LEG000011"></a>`LEG000011` | 400 | **Bad Request**<br/>Invalid action<br/><small>Ação inválida</small> |
| <a id="LEG0000110"></a>`LEG0000110` | 400 | **Bad Request**<br/>Operation canceled cannot be signed.<br/><small>Operação cancelada não pode ser assinada.</small> |
| <a id="LEG0000111"></a>`LEG0000111` | 400 | **Bad Request**<br/>Field 'type' cannot be null and must contain one of the values ('data-signature', 'pdf-signature')<br/><small>O campo 'type' não pode ser nulo e deve conter um dos valores ('data-signature', 'pdf-signature')</small> |
| <a id="LEG0000112"></a>`LEG0000112` | 400 | **Bad Request**<br/>Invalid url {url}<br/><small>Url enviada não é válida {url}</small> |
| <a id="LEG0000113"></a>`LEG0000113` | 400 | **Bad Request**<br/>Invalid code number. Value financial institution code: {financial_institution_code} does not exist.<br/><small>Número Compe inválido. Valor de número compe: {financial_institution_code} não existe.</small> |
| <a id="LEG0000114"></a>`LEG0000114` | 400 | **Bad Request**<br/>Found installments with total amount below the minimum of R$ 1,00<br/><small>Foram encontradas parcelas com valor total menor que o mínimo de R$ 1,00.</small> |
| <a id="LEG0000115"></a>`LEG0000115` | 400 | **Bad Request**<br/>It is necessary to inform at least one installment<br/><small>É necessário informar no mínimo uma parcela</small> |
| <a id="LEG0000116"></a>`LEG0000116` | 400 | **Bad Request**<br/>Reserve confirmation is not possibile in current operation step.<br/><small>A operação atual não permite confirmação da reserva.</small> |
| <a id="LEG0000117"></a>`LEG0000117` | 400 | **Bad Request**<br/>Signature is not possibile in current operation step.<br/><small>A operação atual não permite assinatura.</small> |
| <a id="LEG0000118"></a>`LEG0000118` | 400 | **Bad Request**<br/>Ignoring event because is not in allowed status.<br/><small>Ignorando evento por quê não está nos status permitidos.</small> |
| <a id="LEG0000119"></a>`LEG0000119` | 400 | **Bad Request**<br/>Operation cannot be disbursed before it is signed.<br/><small>A operação não pode ser desembolsada antes de ser assinada</small> |
| <a id="LEG000012"></a>`LEG000012` | 400 | **Bad Request**<br/>Missing simulation debt key<br/><small>Falta chave da simulação de dívida</small> |
| <a id="LEG0000120"></a>`LEG0000120` | 400 | **Bad Request**<br/>Brick flow step is 'dataprev_reservation_check', but received webhook is 'opened'.<br/><small>O brick está em 'dataprev_reservation_check', mas o webhook recebido é de desembolso.</small> |
| <a id="LEG0000121"></a>`LEG0000121` | 400 | **Bad Request**<br/>Operation that is not canceled cannot process cancel permanently webhook.<br/><small>Operações que não estão canceladas não podem processar o webhook de cancelamento permanente.</small> |
| <a id="LEG0000122"></a>`LEG0000122` | 400 | **Bad Request**<br/>Contract Fee not permitted<br/><small>Tarifa não permitida</small> |
| <a id="LEG0000123"></a>`LEG0000123` | 400 | **Bad Request**<br/>Invalid event_status ({event_status}) or event_type ({event_type}) to process brick.<br/><small>Status do evento ({event_status}) ou tipo de evento ({event_type}) inválidos para processar o brick.</small> |
| <a id="LEG000013"></a>`LEG000013` | 404 | **Not Found**<br/>No operation found for key {debt_key}<br/><small>Operação não encontrada para chave {debt_key}</small> |
| <a id="LEG000014"></a>`LEG000014` | 400 | **Bad Request**<br/>Key {debt_key} doesn't belong to any operation of client {selected_agent}<br/><small>A chave {debt_key} não pertence a nenhuma operação do cliente {selected_agent}</small> |
| <a id="LEG000015"></a>`LEG000015` | 400 | **Bad Request**<br/>No operation_key provided<br/><small>Nenhuma chave de operação (operation_key) fornecida</small> |
| <a id="LEG000016"></a>`LEG000016` | 404 | **Not Found**<br/>No operation found for the given operation_key {operation_key}<br/><small>Operação não encontrada para chave de operação {operation_key}</small> |
| <a id="LEG000017"></a>`LEG000017` | 400 | **Bad Request**<br/>No relationship found for the given person {person_key} and operation {operation_key}<br/><small>Nenhuma relação encontrada para a pessoa especificada {person_key} e operação {operation_key}</small> |
| <a id="LEG000018"></a>`LEG000018` | 400 | **Bad Request**<br/>The given key {operation_key} isn`t related to {endpoint} operation. Please use the appropriate endpoint<br/><small>A chave fornecida {operation_key} não está relacionada à operação {endpoint}. Por favor, use o endpoint apropriado</small> |
| <a id="LEG000019"></a>`LEG000019` | 400 | **Bad Request**<br/>Method {method} not allowed for the endpoint {endpoint}<br/><small>Método {method} não permitido para o endpoint {endpoint}</small> |
| <a id="LEG000020"></a>`LEG000020` | 400 | **Bad Request**<br/>Missing document_key, use GET /document/{document_key}<br/><small>Chave do documento (document_key) faltando, use GET /document/{document_key}</small> |
| <a id="LEG000021"></a>`LEG000021` | 404 | **Bad Request**<br/>Document not found for key {document_key}<br/><small>Documento não encontrado para chave {document_key}</small> |
| <a id="LEG000022"></a>`LEG000022` | 400 | **Bad Request**<br/>To get document information, use GET /document/{document_key}<br/><small>Para acessar informações de um documento, use GET /document/{document_key}</small> |
| <a id="LEG000023"></a>`LEG000023` | 400 | **Bad Request**<br/>MiME type {document_mime_type} not supported<br/><small>Tipo de MiME {document_mime_type} não suportado</small> |
| <a id="LEG000024"></a>`LEG000024` | 400 | **Bad Request**<br/>File MIME type and extension don't match<br/><small>Tipo de MiME e extensão do arquivo não batem</small> |
| <a id="LEG000025"></a>`LEG000025` | 400 | **Bad Request**<br/>An error occurred when trying to create document on doc-api: no response received<br/><small>Ocorreu um erro ao tentar criar um documento na doc-api: nenhuma resposta recebida</small> |
| <a id="LEG000026"></a>`LEG000026` | 400 | **Bad Request**<br/>Person {person_key} doesn't own document {document_key}<br/><small>A pessoa {person_key} não é dona do documento {document_key}</small> |
| <a id="LEG000027"></a>`LEG000027` | 400 | **Bad Request**<br/>Operation key {operation_key} doesn't belong to requester {person_key}<br/><small>A operação {operation_key} não pertence à pessoa {person_key}</small> |
| <a id="LEG000028"></a>`LEG000028` | 400 | **Bad Request**<br/>The given key {operation_key} is not related to a credit operation<br/><small>A chave fornecida {} não está relacionada a uma operação de crédito</small> |
| <a id="LEG000029"></a>`LEG000029` | 400 | **Bad Request**<br/>Operation {operation_key} status is {credit_operation_status} and has not been issued yet<br/><small>O status da operação {operation_key} é {credit_operation_status} e ainda não foi emitido</small> |
| <a id="LEG000030"></a>`LEG000030` | 400 | **Bad Request**<br/>Operation {operation_key} is {credit_operation_status}<br/><small>Operação {operation_key} está {credit_operation_status}</small> |
| <a id="LEG000031"></a>`LEG000031` | 400 | **Bad Request**<br/>Missing compliance_document_keys<br/><small>Falta compliance_document_keys</small> |
| <a id="LEG000032"></a>`LEG000032` | 404 | **Not Found**<br/>No document was found for the given compliance_document_key: {compliance_document_key}<br/><small>Nenhum documento foi encontrado para o compliance_document_key fornecido: {compliance_document_key}</small> |
| <a id="LEG000033"></a>`LEG000033` | 500 | **Configuration Error**<br/>There is a problem with your configuration. Please contact system administration<br/><small>Há um problema com sua configuração. Entre em contato com a administração do sistema</small> |
| <a id="LEG000034"></a>`LEG000034` | 400 | **Bad Request**<br/>Found mix of split type amount and percentage<br/><small>Tipo de divisão mista entre valor e percentual</small> |
| <a id="LEG000035"></a>`LEG000035` | 400 | **Bad Request**<br/>For multiple accounts you must specify the split amounts<br/><small>Para várias contas, você deve especificar os valores divididos</small> |
| <a id="LEG000036"></a>`LEG000036` | 400 | **Bad Request**<br/>Operation ({operation_key}) status is cancelled<br/><small>Operação ({operation_key}) cancelada</small> |
| <a id="LEG000037"></a>`LEG000037` | 400 | **Bad Request**<br/>Status not implemented<br/><small>Status não implementado</small> |
| <a id="LEG000038"></a>`LEG000038` | 400 | **Bad Request**<br/>Brick {brick_name} doesnt exist.<br/><small>Bloco {brick_name} não existe.</small> |
| <a id="LEG000039"></a>`LEG000039` | 400 | **Bad Request**<br/>Account number: {account_number} with branch {branch_number} not found<br/><small>Número da conta: {account_number} com o dígito {branch_number} não encontrada</small> |
| <a id="LEG000040"></a>`LEG000040` | 400 | **Bad Request**<br/>Settlement account {account_number} does not belong to borrower with document number {borrower_document_number}<br/><small>A conta de liquidação {account_number} não pertence ao mutuário com o número do documento {borrower_document_number}</small> |
| <a id="LEG000041"></a>`LEG000041` | 400 | **Request Validator Error**<br/>{description}<br/><small>Payload Inválido</small> |
| <a id="LEG000042"></a>`LEG000042` | 400 | **Request Validator Error**<br/>Missing field document_number on disbursement_bank_accounts<br/><small>Campo ausente document_number em disbursement_bank_accounts</small> |
| <a id="LEG000043"></a>`LEG000043` | 400 | **Request Validator Error**<br/>Missing field name on disbursement_bank_accounts<br/><small>Falta o nome do campo em disbursement_bank_accounts</small> |
| <a id="LEG000044"></a>`LEG000044` | 400 | **Request Validator Error**<br/>The percentage_receivable sum of all disbursement_bank_accounts can't be greater than 100<br/><small>A soma percentual_recebível de todas as disbursement_bank_accounts não pode ser maior que 100</small> |
| <a id="LEG000045"></a>`LEG000045` | 400 | **Request Validator Error**<br/>The percentage_receivable sum of all disbursement_bank_accounts must be 100 if it was set for all accounts sent<br/><small>A soma percentage_receivable de todas as disbursement_bank_accounts deve ser 100 se foi definida para todas as contas enviadas</small> |
| <a id="LEG000046"></a>`LEG000046` | 400 | **Request Validator Error**<br/>contract_number already registered. Please use another one<br/><small>contract_number já registrado. Por favor, use outro</small> |
| <a id="LEG000047"></a>`LEG000047` | 400 | **Request Validator Error**<br/>Missing allowed_user for legal account creation<br/><small>allowed_user ausente para criação de conta PJ</small> |
| <a id="LEG000048"></a>`LEG000048` | 400 | **Bad Request**<br/>The provided requester_document_number ({document_number}) is not valid<br/><small>O requester_document_number fornecido ({document_number}) não é válido</small> |
| <a id="LEG000049"></a>`LEG000049` | 400 | **Bad Request**<br/>No operation_key or transaction_request_key provided<br/><small>Nenhuma operation_key ou transaction_request_key fornecida</small> |
| <a id="LEG000050"></a>`LEG000050` | 400 | **Bad Request**<br/>Operation not found for the given key {operation_key}.<br/><small>Operação não encontrada para a chave fornecida {operation_key}</small> |
| <a id="LEG000051"></a>`LEG000051` | 400 | **Bad Request**<br/>Operation cannot be issued before it is signed.<br/><small>A operação não pode ser emitida antes de ser assinada</small> |
| <a id="LEG000052"></a>`LEG000052` | 400 | **Bad Request**<br/>Must provide parameter action_type.<br/><small>O parâmetro action_type deve ser enviado.</small> |
| <a id="LEG000053"></a>`LEG000053` | 400 | **Bad Request**<br/>Cannot perform this action {action_type}.<br/><small>Não é possível executar esta ação {action_type}</small> |
| <a id="LEG000054"></a>`LEG000054` | 400 | **Bad Request**<br/>Invalid simulation within request<br/><small>Simulação inválida na requisição</small> |
| <a id="LEG000055"></a>`LEG000055` | 400 | **Bad Request**<br/>Provide either 'rebates' or 'rebate' and/or 'rebate_type'<br/><small>Envie somente 'rebates' ou 'rebate' e/ou 'rebate_type'</small> |
| <a id="LEG000056"></a>`LEG000056` | 403 | **Unauthorized**<br/>Client does not own this item<br/><small>O cliente não possui este item</small> |
| <a id="LEG000058"></a>`LEG000058` | 400 | **Bad Request**<br/>Provide either 'annual_interest_rate' or 'monthly_interest_rate'<br/><small>Envie somente 'annual_interest_rate' ou 'monthly_interest_rate'</small> |
| <a id="LEG000059"></a>`LEG000059` | 400 | **Bad Request**<br/>Provide 'annual_interest_rate' when interest_type is 'cdi_perc'<br/><small>Envie 'annual_interest_rate' quando o 'interest_type' for 'cdi_perc'</small> |
| <a id="LEG000060"></a>`LEG000060` | 400 | **Bad Request**<br/>Wrong parameter on the request body<br/><small>Parâmetro incorreto no body da request</small> |
| <a id="LEG000061"></a>`LEG000061` | 401 | **Unauthorized**<br/>Invalid or expired payload<br/><small>Payload inválido ou expirado</small> |
| <a id="LEG000062"></a>`LEG000062` | 400 | **Bad Request**<br/>Operation is waiting disbursement confirmation. Status received: {operation_status}<br/><small>Operação esperando confirmação do evento de desembolso: Status recebido {operation_status}</small> |
| <a id="LEG000063"></a>`LEG000063` | 400 | **Bad Request**<br/>Status not accepted by missing or wrong parameters on the callback body: {operation_status}<br/><small>Status não aceito por parâmetros ausentes ou incorretos no corpo do retorno de chamada: {operation_status}</small> |
| <a id="LEG000064"></a>`LEG000064` | 400 | **Bad Request**<br/>Assignment not found for key: {assignment_key}<br/><small>Assignment não encontrado for key: {assignment_key}</small> |
| <a id="LEG000065"></a>`LEG000065` | 400 | **Bad Request**<br/>Missing or wrong signature parameter on the request body<br/><small>Parâmetro de assinatura ausente ou incorreto no body da request</small> |
| <a id="LEG000066"></a>`LEG000066` | 400 | **Bad Request**<br/>Operation {operation_key} already has a endorsement with status {endorsement_status}<br/><small>Operação {operation_key} já tem um endosso com status {endorsement_status}</small> |
| <a id="LEG000067"></a>`LEG000067` | 500 | **Internal Error**<br/>Error while generating {errors}<br/><small>Erro ao gerar {errors}</small> |
| <a id="LEG000068"></a>`LEG000068` | 400 | **Bad Request**<br/>Invalid request body for batch simulation.<br/><small>Corpo da requisição inválido para simulações em lote.</small> |
| <a id="LEG000069"></a>`LEG000069` | 400 | **Bad Request**<br/>Invalid request body for single simulation.<br/><small>Corpo da requisição inválido para simulação unitária.</small> |
| <a id="LEG000070"></a>`LEG000070` | 400 | **Bad Request**<br/>Credit Operation key {credit_operation_key} doesn't belong to requester {person_key}<br/><small>A operação de crédito {credit_operation_key} não pertence à pessoa {person_key}</small> |
| <a id="LEG000071"></a>`LEG000071` | 400 | **Bad Request**<br/>Cannot serve {target_disbursed_amount}, the max is {max_disbursed_amount}<br/><small>Não é possível desembolsar {target_disbursed_amount}, o máximo possível é {max_disbursed_amount}</small> |
| <a id="LEG000072"></a>`LEG000072` | 400 | **Bad Request**<br/>Failed validating MT hash. Reason: {reason}<br/><small>Falha ao validar hash MT. Razão: {reason}</small> |
| <a id="LEG000073"></a>`LEG000073` | 400 | **Bad Request**<br/>Operation {operation_key} actual status does not allow cancel operation. Actual status is {co_status}<br/><small>Status da operação {operation_key} não permite cancelamento.Status atual: {co_status}</small> |
| <a id="LEG000074"></a>`LEG000074` | 400 | **Bad Request**<br/>Pix Chargeback is now allowed from escrow accounts.<br/><small>Devolução de Pix não é permitido para contas escrow</small> |
| <a id="LEG000075"></a>`LEG000075` | 400 | **Bad Request**<br/>Account {account_key} is closed.<br/><small>Conta {account_key} está fechada.</small> |
| <a id="LEG000076"></a>`LEG000076` | 400 | **Bad Request**<br/>Account {account_key} is blocked.<br/><small>Conta {account_key} está bloqueada.</small> |
| <a id="LEG000077"></a>`LEG000077` | 403 | **Unauthorized**<br/>User has no credentials to perform this action.<br/><small>Usuário não tem permissão para realizar essa ação.</small> |
| <a id="LEG000078"></a>`LEG000078` | 400 | **Bad Request**<br/>Pix key and target_account must not be null.<br/><small>Chave Pix e conta de destinos não podem ser ambos nulos.</small> |
| <a id="LEG000079"></a>`LEG000079` | 400 | **Bad Request**<br/>Schedule date can not be less than today.<br/><small>Data de agendamento não pode ser menor que hoje.</small> |
| <a id="LEG000080"></a>`LEG000080` | 400 | **Bad Request**<br/>Source Account has negative balance<br/><small>Conta de origem possui saldo negativo.</small> |
| <a id="LEG000081"></a>`LEG000081` | 400 | **Bad Request**<br/>Account destination not allowed for this escrow account.<br/><small>Conta de destino não permitida para essa conta escrow.</small> |
| <a id="LEG000082"></a>`LEG000082` | 400 | **Bad Request**<br/>Requester document identification can not be null<br/><small>O documento de identificação do requester não pode ser nulo.</small> |
| <a id="LEG000083"></a>`LEG000083` | 400 | **Bad Request**<br/>Pix Transfer not found for pix_transfer_key {pix_transfer_key}.<br/><small>Transferência Pix não encontrada para a pix_transfer_key {pix_transfer_key}.</small> |
| <a id="LEG000084"></a>`LEG000084` | 400 | **Bad Request**<br/>pix_transfer_key can not be null for chargeback<br/><small>O campo pix_transfer_key não deve ser nulo quando for uma devolução Pix.</small> |
| <a id="LEG000085"></a>`LEG000085` | 400 | **Bad Request**<br/>Invalid Pix Key.<br/><small>Pix Key inválida.</small> |
| <a id="LEG000086"></a>`LEG000086` | 400 | **Bad Request**<br/>Account for account key {account_key} not found.<br/><small>Conta para a account_key {account_key} não encontrada.</small> |
| <a id="LEG000087"></a>`LEG000087` | 400 | **Bad Request**<br/>Invalid decimal transaction amount<br/><small>Valor da transação inválido</small> |
| <a id="LEG000088"></a>`LEG000088` | 400 | **Bad Request**<br/>Transfer purpose must be one of transfer, payment_with_change or withdraw<br/><small>Finalidade da transação deve ser transfer, payment_with_change or withdraw</small> |
| <a id="LEG000089"></a>`LEG000089` | 400 | **Bad Request**<br/>When pix_transfer_type is static, dynamic_instant or dynamic_term, end_to_end_id is required<br/><small>Quando o pix_transfer_type é static, dynamic_instant ou dynamic_term, end_to_end_id é obrigatório</small> |
| <a id="LEG000090"></a>`LEG000090` | 400 | **Bad Request**<br/>Compliance has not been approved<br/><small>O Compliance não foi aprovado</small> |
| <a id="LEG000091"></a>`LEG000091` | 400 | **Bad Request**<br/>Given document number {document_number} is not source account owner.<br/><small>O documento enviado {document_number} não é dono da conta de origem</small> |
| <a id="LEG000092"></a>`LEG000092` | 400 | **Bad Request**<br/>Invalid payload for current flow step in operation {operation_key}.<br/><small>Payload inválida para a etapa de fluxo atual em operação {operation_key}.</small> |
| <a id="LEG000093"></a>`LEG000093` | 400 | **Bad Request**<br/>Origin {origin} not expected for kyc flow.<br/><small>Origem {origin} não esperada no fluxo da kyc</small> |
| <a id="LEG000094"></a>`LEG000094` | 404 | **Bad Request**<br/>Facial Biometrics Document was not found<br/><small>Documento de biometria facial não foi encontrado</small> |
| <a id="LEG000095"></a>`LEG000095` | 423 | **Locked**<br/>TED is available from {opening_time} to {closing_time}<br/><small>TED está disponível entre {opening_time} e {closing_time}</small> |
| <a id="LEG000096"></a>`LEG000096` | 400 | **Bad Request**<br/>Prefixed interest rate not registered, please contact us.<br/><small>As taxas de juros prefixadas não foram cadastradas, favor entrar em contato.</small> |
| <a id="LEG000097"></a>`LEG000097` | 401 | **Unauthorized**<br/>Access denied for informed role<br/><small>Acesso negado para o cargo informado</small> |
| <a id="LEG000098"></a>`LEG000098` | 400 | **Bad Request**<br/>Invalid date format. Should be YYYY-MM-DD<br/><small>Formato de data inválido. Deve ser YYYY-MM-DD</small> |
| <a id="LEG000099"></a>`LEG000099` | 400 | **Bad Request**<br/>Number of desired installments must be equal to number of installments<br/><small>Número de parcelas desejadas deve ser igual ao número de parcelas</small> |
| <a id="LEG000124"></a>`LEG000124` | 400 | **Bad Request**<br/>Disbursement date must be today for synchronous disbursement.<br/><small>Data de desembolso precisa ser hoje para desembolso sincrono.</small> |
| <a id="LEG000125"></a>`LEG000125` | 400 | **Bad Request**<br/>Account key not sent.<br/><small>Account key não enviada.</small> |
| <a id="LEG000126"></a>`LEG000126` | 400 | **Bad Request**<br/>Credit operation status: {co_status} does not allow this operation.<br/><small>O status da operação de crédito: {co_status} não permite esta operação.</small> |
| <a id="LEG000127"></a>`LEG000127` | 400 | **Bad Request**<br/>The new disbursement date must be between the disbursement start date and disbursement end date.<br/><small>A nova data de desembolso deve estar entre a data inicial de desembolso e a data final de desembolso.</small> |
| <a id="LEG000128"></a>`LEG000128` | 400 | **Bad Request**<br/>A new valid disbursement date must be provided.<br/><small>Uma nova data de desembolso deve ser informada.</small> |
| <a id="LEG000129"></a>`LEG000129` | 400 | **Bad Request**<br/>Flow step not found for this operation configuration.<br/><small>Etapa não encontrada para configuralçao desta operação.</small> |
| <a id="LEG000130"></a>`LEG000130` | 400 | **Bad Request**<br/>Unable to do action, because collaterals are not constituted. Credit operation key {credit_operation_key};<br/><small>Ação não permitida, porque a garantia não foi constituído. Credit Operation Key {credit_operation_key}</small> |
| <a id="LEG000131"></a>`LEG000131` | 400 | **Bad Request**<br/>Unable to do action, because entry is not paid. Credit operation key {credit_operation_key};<br/><small>Ação não permitida, porque a entrada não foi paga. Credit Operation Key {credit_operation_key}</small> |
| <a id="LEG000132"></a>`LEG000132` | 400 | **Bad Request**<br/>Credit Operation {credit_operation_key} has no disbursement_date<br/><small>A operação de crédito {credit_operation_key} não tem data de desembolso</small> |
| <a id="LEG000133"></a>`LEG000133` | 400 | **Bad Request**<br/>Assignment date must be after or equal disbursement date.<br/><small>Data da cessão deve ser maior ou igual à data de desembolso.</small> |
| <a id="LEG000134"></a>`LEG000134` | 400 | **Bad Request**<br/>Account with document number: {document_number}<br/><small>Conta com ducumento {document_number} não encontrada</small> |
| <a id="LEG000135"></a>`LEG000135` | 400 | **Bad Request**<br/>Invalid Ip Address {ip_address} .<br/><small>Endereço de Ip inválido {ip_address} .</small> |
| <a id="LEG000136"></a>`LEG000136` | 400 | **Bad Request**<br/>Pre price do not accept custom installment with principal amortization percentage.<br/><small>Pre price não aceita parcelas personalizadas com percentual de amortização.</small> |
| <a id="LEG000137"></a>`LEG000137` | 400 | **Bad Request**<br/>'amount' or 'disbursed_amount' must be informed.<br/><small>'amount' ou 'disbursed_amount' deve ser informado.</small> |
| <a id="LEG000138"></a>`LEG000138` | 400 | **Bad Request**<br/>Last installment must have interest.<br/><small>A ultima deve ter juros.</small> |
| <a id="LEG000139"></a>`LEG000139` | 400 | **Bad Request**<br/>Amortization Percentage can have a maximum of 4 decimal places.<br/><small>Porcentagem de Amortização pode ter no máximo 4 casas decimais.</small> |
| <a id="LEG000140"></a>`LEG000140` | 400 | **Bad Request**<br/>Principal amortization percentage can not be 0 without interest.<br/><small>Porcentagem da amotização principal não pode ser 0% se não há juros.</small> |
| <a id="LEG000141"></a>`LEG000141` | 400 | **Bad Request**<br/>Total amount of percentage is {total}, must be 1<br/><small>Valor total da porcentagem é {total}, deve ser 1</small> |
| <a id="LEG000142"></a>`LEG000142` | 400 | **Bad Request**<br/>Installment face value must not be informed if installment has principal_amortization_percentage.<br/><small>Valor de face da parcela não deve ser informado se a parcela possui porcentage de amortização.</small> |
| <a id="LEG000143"></a>`LEG000143` | 400 | **Bad Request**<br/>First due date should not be informed if the installment due date is informed.<br/><small>Primeira data de vencimento não deve ser informada se a data de vencimento da parcela for informada.</small> |
| <a id="LEG000144"></a>`LEG000144` | 400 | **Bad Request**<br/>Installment face value cannot be changed because it was not informed in the original request.<br/><small>O valor de face da parcela não pode ser alterado porque não foi informado na requisição original.</small> |
| <a id="LEG000145"></a>`LEG000145` | 400 | **Bad Request**<br/>The disbursement has passed {limit_days} to reverse operation.<br/><small>O desembolso passou de {limit_days} para reverter a operação.</small> |
| <a id="LEG000146"></a>`LEG000146` | 400 | **Bad Request**<br/>The reversal is allowed just for internal account disbursements.<br/><small>A reversão é permitida apenas para desembolsos em conta interna.</small> |
| <a id="LEG000147"></a>`LEG000147` | 400 | **Bad Request**<br/>The sum of disbursement account balance: {account_balance} must be equal to disbursed issue amount: {disbursed_issue_amount}.<br/><small>A soma do saldo das contas de desembolsos: {account_balance} deve ser igual ao valor desembolsado: {disbursed_issue_amount}.</small> |
| <a id="LEG000148"></a>`LEG000148` | 400 | **Bad Request**<br/>The operation cannot have more than one disbursement account to create the reversal.<br/><small>A operação não pode ter mais de uma conta de desembolso pra criar a reversão.</small> |
| <a id="LEG000149"></a>`LEG000149` | 400 | **Bad Request**<br/>Operation cannot be signed before document is generated.<br/><small>A operação não pode ser assinada antes de ter seu documento gerado.</small> |
| <a id="LEG000150"></a>`LEG000150` | 400 | **Bad Request**<br/>Signature datetime is not in the expected format: YYYY-MM-DDTHH:MM:SSZ<br/><small>Data de assinatura (signature_datetime) não está no formato esperado: YYYY-MM-DDTHH:MM:SSZ</small> |
| <a id="LEG000151"></a>`LEG000151` | 400 | **Bad Request**<br/>similarity_score cannot be null<br/><small>similarity_score não pode ser nulo</small> |
| <a id="LEG000152"></a>`LEG000152` | 400 | **Bad Request**<br/>similarity_score must be greater than 0<br/><small>similarity_score deve ser maior que 0</small> |
| <a id="LEG000153"></a>`LEG000153` | 400 | **Bad Request**<br/>Document template key must not be set for social security collateral.<br/><small>O template do documento não pode ser definido para INSS.</small> |
| <a id="LEG000154"></a>`LEG000154` | 400 | **Bad Request**<br/>Operation category 'minimum_wage_increase' is not allowed for social security collateral.<br/><small>A categoria de operação 'aumento salarial' não está permitida.</small> |
| <a id="LEG000155"></a>`LEG000155` | 400 | **Bad Request**<br/>Insurance premium not found in operation data.<br/><small>Prêmio de seguro não encontrado nos dados da operação.</small> |

### MPR — Military Payroll

32 errors

| Code | HTTP | Message |
|-|-|-|
| <a id="MPR000001"></a>`MPR000001` | 400 | **Invalid Document Number**<br/>Given {document_number} document number is invalid.<br/><small>CPF {document_number} fornecido não é valido.</small> |
| <a id="MPR000002"></a>`MPR000002` | 500 | **Internal Error**<br/>Cache server returned an error.<br/><small>Os servidores da cache retornaram um erro.</small> |
| <a id="MPR0000029"></a>`MPR0000029` | 409 | **Reservation already locked**<br/>Reservation with id {reservation_id} is already locked being processed.<br/><small>A reserva com o id {reservation_id} já está bloqueada sendo processada.</small> |
| <a id="MPR000003"></a>`MPR000003` | 400 | **Already on deletion process**<br/>Reservation with external_key: {external_key} already on deletion process<br/><small>Reserva com a chave externa: {external_key} já está em processo de desaverbação</small> |
| <a id="MPR000004"></a>`MPR000004` | 404 | **Reservation Not Found**<br/>Reservation with key: {reservation_key} not found<br/><small>Reserva com a chave: {reservation_key} não encontrada</small> |
| <a id="MPR000005"></a>`MPR000005` | 400 | **Already finished**<br/>Reservation with external_key: {external_key} is already in its final status {reservation_status}<br/><small>Reserva com a chave externa: {external_key} já está em seu status final {reservation_status}</small> |
| <a id="MPR000006"></a>`MPR000006` | 400 | **Reservation type conflict**<br/>Reservation Type: {reservation_type} not expected for {flow} flow.<br/><small>Tipo de Reserva: {reservation_type} não esperado para o fluxo {flow_translation}.</small> |
| <a id="MPR000007"></a>`MPR000007` | 404 | **Disbursement Option not Found**<br/>Disbursement option for {disbursement_date} was not found.<br/><small>Opção de desembolso para {disbursement_date} não foi encontrada.</small> |
| <a id="MPR000009"></a>`MPR000009` | 409 | **Reservation Status Conflict**<br/>Reservation with status<br/><small>Reservas no status</small> |
| <a id="MPR000010"></a>`MPR000010` | 404 | **Balance Not Found**<br/>Balance Request with key: {balance_key} was not found.<br/><small>Pedido de Margem com a chave: {balance_key} não foi encontrado.</small> |
| <a id="MPR000011"></a>`MPR000011` | 403 | **Unauthorized Request**<br/>Request must be internal or from master.<br/><small>Requisição precisar ser internal ou da master.</small> |
| <a id="MPR000012"></a>`MPR000012` | 404 | **Accrual Not Found**<br/>Accrual not found: {reference_date}.<br/><small>Accrual não encontrado: {reference_date}</small> |
| <a id="MPR000013"></a>`MPR000013` | 404 | **Active Token Not Found**<br/>Active token was not found for reservation: {reservation_key}.<br/><small>Token ativo não encontrado para a reserva: {reservation_key}</small> |
| <a id="MPR000014"></a>`MPR000014` | 400 | **Balance Not Allowed**<br/>Balance Request with status: {status} was not allowed to retry.<br/><small>Pedido de Margem com o status: {status} não foi permitido a retentativa.</small> |
| <a id="MPR000015"></a>`MPR000015` | 400 | **Balance Not Allowed**<br/>Balance Request with status: {status} was not allowed to retry.<br/><small>Pedido de Margem com o status: {status} não foi permitido a retentativa.</small> |
| <a id="MPR000016"></a>`MPR000016` | 404 | **Balance Not Found**<br/>Portability contracts report with key: {portability_contracts_report_key} was not found.<br/><small>Consulta de contratos para portabilidade com a chave: {portability_contracts_report_key} não foi encontrado.</small> |
| <a id="MPR000017"></a>`MPR000017` | 404 | **Reservation Not Found for Debt Key**<br/>Reservation with debt_key: {external_key} not found<br/><small>Reserva com a chave de débito: {external_key} não encontrada</small> |
| <a id="MPR000018"></a>`MPR000018` | 400 | **Reservation status not permitted on refinancing**<br/>Reservation with external_key: {external_key} is on status {status} which is not permitted for refinancing.<br/><small>Reserva com a chave externa: {external_key}  está no status {status} que não é permitido para refinanciamento.</small> |
| <a id="MPR000019"></a>`MPR000019` | 404 | **Period not found for informed Reservation**<br/>Reservation with reservation_key: {reservation_key} does not have a Period with due_date: {due_date}.<br/><small>Reserva com a chave: {reservation_key}  não possui uma parcela com a data de vencimento: {due_date}.</small> |
| <a id="MPR000020"></a>`MPR000020` | 400 | **Informed period not allowed to be paid**<br/>Period with due_date: {due_date} from reservation: {reservation_key} is on status: {period_status} which does not allow to be updated to status<br/><small>Periodo com vencimento: {due_date} da reserva: {reservation_key} está no status: {period_status} que não permite a atualização para o status</small> |
| <a id="MPR000021"></a>`MPR000021` | 500 | **Encoding Error**<br/>Error while encoding file<br/><small>Erro ao codificar arquivo</small> |
| <a id="MPR000022"></a>`MPR000022` | 400 | **Invalid Registration Code**<br/>Informed registration code: {registration_code} is invalid.<br/><small>Matrícula fornecida: {registration_code} é invalida.</small> |
| <a id="MPR000023"></a>`MPR000023` | 404 | **Protocol not Found**<br/>Protocol with debt key {external_key} was not found.<br/><small>Protocolo com chave {external_key} não foi encontrada.</small> |
| <a id="MPR000024"></a>`MPR000024` | 400 | **Ivanlid protocol type**<br/>Protocol type {protocol_type} doesn<br/><small>Protocolo do tipo {protocol_type} não existe.</small> |
| <a id="MPR000025"></a>`MPR000025` | 400 | **Reservation Type Not Allowed to Change**<br/>Reservation with debt_key: {external_key} is of type {reservation_type_enum}, which is not allowed to be changed.<br/><small>Reserva com a chave: {external_key} é do tipo {reservation_type_enum} e não pode ser alterada.</small> |
| <a id="MPR000026"></a>`MPR000026` | 400 | **Reservation Status not Permitted for Type Change**<br/>Reservation with debt_key: {external_key} is on status {reservation_status_enum}, which is not permitted for reservation type change.<br/><small>Reserva com a chave: {external_key} está no status {reservation_status_enum} que não é permitido para o fluxo de alteração de tipo de reserva.</small> |
| <a id="MPR000027"></a>`MPR000027` | 400 | **Proposal has Remaining Installments**<br/>Proposal {proposal_key} shouldn<br/><small>Proposal {proposal_key} não deveria ter installments sobrando.</small> |
| <a id="MPR000028"></a>`MPR000028` | 400 | **Zetra Invalid Document Type**<br/>Zetra error while uploading document. File type is invalid<br/><small>Erro ao enviar documento para Zetra. Tipo de arquivo inválido.</small> |
| <a id="MPR000030"></a>`MPR000030` | 404 | **Contract Not Found**<br/>Reservation with contract number: {contract_number} not found<br/><small>Reserva com o número de contrato: {contract_number} não encontrada</small> |
| <a id="MPR000031"></a>`MPR000031` | 500 | Proposal not found for reservation {reservation_key} - {status}<br/><small>Proposta não encontrada para reserva {reservation_key} - {status}</small> |
| <a id="MPR000032"></a>`MPR000032` | 400 | **Renegotiation Proposal bad request**<br/>Renegotiation Proposal bad request |
| <a id="MPR000033"></a>`MPR000033` | 400 | **External System Unavailable**<br/>External system response status code is greater than 500<br/><small>O sistema externo retornou um código de status superior a 500</small> |

### PPA — Private Payroll Auction

23 errors

| Code | HTTP | Message |
|-|-|-|
| <a id="PPA000001"></a>`PPA000001` | 404 | **Requester Proposal not Found**<br/>Requester Proposal with<br/><small>A entidade com</small> |
| <a id="PPA000002"></a>`PPA000002` | 500 | **Error publishing message on pub sub.**<br/>Error publishing message on Pub Sub, max reetries exceeded.<br/><small>Erro ao publicar mensagem no Pub Sub, número máximo de tentativas excedido.</small> |
| <a id="PPA000003"></a>`PPA000003` | 409 | **Entity already locked**<br/>Reservation with id {reservation_id} is already locked being processed.<br/><small>A reserva com o id {reservation_id} já está bloqueada sendo processada.</small> |
| <a id="PPA000004"></a>`PPA000004` | 404 | **Requester not Found**<br/>Requester with<br/><small>Requester com chave {requester_key} não foi encontrado.</small> |
| <a id="PPA000005"></a>`PPA000005` | 404 | **Proposal Request not Found**<br/>Proposal Request with<br/><small>Proposal Request com</small> |
| <a id="PPA000006"></a>`PPA000006` | 400 | **Auction has ended, invalid action**<br/>The auction for<br/><small>Leilão para</small> |
| <a id="PPA000007"></a>`PPA000007` | 409 | **Proposal was already cancelled**<br/>The Auction Proposal with key: {auction_proposal_key} was already cancelled<br/><small>Proposta com chave {auction_proposal_key} já foi cancelada</small> |
| <a id="PPA000008"></a>`PPA000008` | 400 | **Invalid requester proposal payload**<br/>Invalid requester proposal payload for auction_proposal_key:{auction_proposal_key}<br/><small>payload de proposta é inválido para auction_proposal_key:{auction_proposal_key}</small> |
| <a id="PPA000009"></a>`PPA000009` | 409 | **Duplicated Proposal for this issuer proposal request**<br/>Already made a proposal for issuer_proposal_request: {issuer_proposal_request_key}, the proposal key is: {auction_proposal_key}<br/><small>Proposta já foi feita: {issuer_proposal_request_key}, chave da proposta: {auction_proposal_key}</small> |
| <a id="PPA000010"></a>`PPA000010` | 502 | **Dataprevs system is down**<br/>Dataprev system is down<br/><small>Sistema da Dataprev está fora de ar</small> |
| <a id="PPA000011"></a>`PPA000011` | 400 | **Error when connecting to private payroll for external_id**<br/>Private Payroll API is not responding properly to external_id PATCH<br/><small>API de consignado privado não está respondendo devidamente ao PATCH de external_id</small> |
| <a id="PPA000013"></a>`PPA000013` | 400 | **Could not create credit operation for auction winner**<br/>Could not create credit operation for auction winner for auction_proposal_key: {auction_proposal_key}<br/><small>Erro ao criar operação de credito para proposta vencedora do leilão, chave da proposta: {auction_proposal_key}</small> |
| <a id="PPA000014"></a>`PPA000014` | 400 | **Could not simulate credit operation for Proposal**<br/>Could not simulate credit operation for auction winner for auction_proposal_key: {issuer_proposal_request_key}<br/><small>Erro ao simular operação de credito para proposta vencedora do leilão, chave da proposta: {issuer_proposal_request_key}</small> |
| <a id="PPA000015"></a>`PPA000015` | 400 | **The assignment amount is greater than the operation final amount**<br/>Could not simulate credit operation for proposal made to issuer proposal request with key: {issuer_proposal_request_key}. The input values need to be changed.<br/><small>Erro ao simular operação de credito para proposta feita a solicitação com chave {issuer_proposal_request_key}. Valores de entrada devem ser modificados.</small> |
| <a id="PPA000016"></a>`PPA000016` | 400 | **Requester with this key does not exist**<br/>Could not get the requester from exclusive employer table, requester with key {requester_key} does not exist<br/><small>Não foi possível obter o requester da tabela de empregadores exclusivos, requester_key: {requester_key}</small> |
| <a id="PPA000017"></a>`PPA000017` | 400 | **Invalid Disbursement Account**<br/>Invalid Disbursement Account while updating account for auction proposal with key: {auction_proposal_key}<br/><small>Conta de desembolso invalida enquanto atualizava proposta com chave {auction_proposal_key}</small> |
| <a id="PPA000018"></a>`PPA000018` | 400 | **Invalid Employer Document Number**<br/>Invalid Employer Document Number for auction proposal with key: {auction_proposal_key}<br/><small>Número de documento de empregador inválido para proposta com chave {auction_proposal_key}</small> |
| <a id="PPA000019"></a>`PPA000019` | 400 | **Error when cancelling credit operation**<br/>Error when cancelling credit operation for auction proposal with key: {auction_proposal_key}<br/><small>Erro ao cancelar operação de crédito para proposta com chave {auction_proposal_key}</small> |
| <a id="PPA000020"></a>`PPA000020` | 400 | **Auction Proposal Validation Error**<br/>Error when validating auction proposal for issuer proposal request with key {issuer_proposal_request_key}<br/><small>Erro durante validação de proposta para solicitação com chave da solicitação: {issuer_proposal_request_key}</small> |
| <a id="PPA000021"></a>`PPA000021` | 400 | **Termination alert found in existent balance inquiry during validation**<br/>Termination alert in existent balance inquiry during validation of auction proposal for issuer proposal request with key {issuer_proposal_request_key}<br/><small>Alerta de terminação de vínculo em consulta de margem existente durante validação de proposta para solicitação com chave da solicitação: {issuer_proposal_request_key}</small> |
| <a id="PPA000022"></a>`PPA000022` | 400 | **Invalid Interest Rate**<br/>Interest rate can<br/><small>A taxa de juros não pode ser maior que {max_interest_rate}% ou menor que {min_interest_rate}%.</small> |
| <a id="PPA000023"></a>`PPA000023` | 400 | **Insurance premium not allowed**<br/>Insurance premium is not allowed for private payroll operations<br/><small>Seguro não é permitido para operações de Consignado Privado</small> |
| <a id="PPA000024"></a>`PPA000024` | 404 | **Requester configuration not found**<br/>Requester configuration with key {requester_key} not found<br/><small>Configuração de requester com chave {requester_key} não encontrada</small> |

### PRP — Private Payroll

98 errors

| Code | HTTP | Message |
|-|-|-|
| <a id="PRP000002"></a>`PRP000002` | - | **Bad Request**<br/>The authorization term is required<br/><small>O envio do termo de autorização é obrigatório</small> |
| <a id="PRP000003"></a>`PRP000003` | - | **Bad Request**<br/>The issuer document number is invalid<br/><small>O número de documento do emissor é inválido</small> |
| <a id="PRP000004"></a>`PRP000004` | - | **Bad Request**<br/>The signer document number is invalid<br/><small>O número de documento do signatário é inválido</small> |
| <a id="PRP000005"></a>`PRP000005` | - | **Bad Request**<br/>The legal representative document number is invalid<br/><small>O número de documento do representante legal é inválido</small> |
| <a id="PRP000006"></a>`PRP000006` | - | **Conflict**<br/>The signer document number is different from the expected<br/><small>O número de documento do signatário é diferente do esperado</small> |
| <a id="PRP000007"></a>`PRP000007` | - | **Rate Limit Exceeded**<br/>Rate limit exceeded for Dataprev service. Try again later.<br/><small>Limite de chamadas excedido para o serviço do Dataprev. Tente novamente mais tarde.</small> |
| <a id="PRP000008"></a>`PRP000008` | - | **Bad Gateway**<br/>Unexpected error on Dataprev service<br/><small>Erro inesperado no serviço do Dataprev</small> |
| <a id="PRP000009"></a>`PRP000009` | - | **Balance Inquiry Not Found**<br/>The balance inquiry key is not valid<br/><small>A chave da consulta de saldo não é válida</small> |
| <a id="PRP000010"></a>`PRP000010` | - | **Employment Relationships Inquiry Not Found**<br/>The employment relationships inquiry key is not valid<br/><small>A chave da consulta de vínculos de emprego não é válida</small> |
| <a id="PRP000011"></a>`PRP000011` | - | **Reservation already exists**<br/>A reservation already exists for the external key provided<br/><small>A reserva já existe para a chave externa fornecida</small> |
| <a id="PRP000012"></a>`PRP000012` | - | **Balance inquiry not found**<br/>A balance inquiry was not found for the reservation<br/><small>Nenhuma consulta de saldo foi encontrada para a reserva</small> |
| <a id="PRP000013"></a>`PRP000013` | - | **Balance inquiry not completed**<br/>The balance inquiry was not completed<br/><small>A consulta de saldo não foi concluída</small> |
| <a id="PRP000014"></a>`PRP000014` | - | **Periods are required**<br/>The periods are required<br/><small>Os períodos são obrigatórios</small> |
| <a id="PRP000015"></a>`PRP000015` | - | **Periods are greater than maximum allowed**<br/>The periods are greater than the maximum allowed: {max_periods}<br/><small>Os períodos são maiores que o máximo permitido: {max_periods}</small> |
| <a id="PRP000016"></a>`PRP000016` | - | **First due date is less than disbursement date**<br/>The first due date must be greater than the disbursement date<br/><small>A data de vencimento inicial deve ser maior que a data de liberação</small> |
| <a id="PRP000017"></a>`PRP000017` | - | **Invalid due date**<br/>Due dates must be on or after the {due_day}th day of the month<br/><small>As datas de vencimento devem ser no dia {due_day} ou após do mês</small> |
| <a id="PRP000018"></a>`PRP000018` | - | **Monthly interest rate is greater than maximum allowed**<br/>The monthly interest rate is greater than the maximum allowed: {formatted_rate}<br/><small>A taxa de juros mensal é maior que a máxima permitida: {formatted_rate}</small> |
| <a id="PRP000021"></a>`PRP000021` | - | **Total amount is less than minimum allowed**<br/>The total amount is less than the minimum allowed: {formatted_amount}<br/><small>O valor total é menor que o mínimo permitido: {formatted_amount}</small> |
| <a id="PRP000022"></a>`PRP000022` | - | **Invalid number of documents**<br/>The number of documents must be 3 or 4<br/><small>O número de documentos deve ser 3 ou 4</small> |
| <a id="PRP000023"></a>`PRP000023` | - | **Duplicate document type**<br/>The document type {document_type} is duplicated<br/><small>O tipo de documento {DOCUMENT_TYPES_TRANSLATION[document_type]} está duplicado</small> |
| <a id="PRP000024"></a>`PRP000024` | - | **Document identification is required**<br/>The document identification is required<br/><small>O documento de identificação é obrigatório</small> |
| <a id="PRP000025"></a>`PRP000025` | - | **Document identification back is required**<br/>The document identification back is required<br/><small>O documento de identificação de verso é obrigatório</small> |
| <a id="PRP000026"></a>`PRP000026` | - | **Selfie is required**<br/>The selfie is required<br/><small>A selfie é obrigatória</small> |
| <a id="PRP000027"></a>`PRP000027` | - | **CCB document is required**<br/>Exactly one contract of {ccb_types} must be provided<br/><small>Deve ser fornecido exatamente um contrato de {ccb_types}</small> |
| <a id="PRP000028"></a>`PRP000028` | - | **Failed to download file**<br/>Failed to download file from {url}<br/><small>Falha ao baixar o arquivo de {url}</small> |
| <a id="PRP000029"></a>`PRP000029` | - | **Failed to convert PDF to image**<br/>Failed to convert PDF to image: {error}<br/><small>Falha ao converter PDF para imagem: {error}</small> |
| <a id="PRP000030"></a>`PRP000030` | - | **Empty PDF file**<br/>PDF file appears to be empty or contains no valid pages to convert<br/><small>O arquivo PDF está vazio ou não contém páginas válidas para conversão</small> |
| <a id="PRP000031"></a>`PRP000031` | - | **Invalid document image**<br/>The document image cannot be processed: {error}<br/><small>A imagem do documento não pode ser processada: {error}</small> |
| <a id="PRP000032"></a>`PRP000032` | - | **Invalid document image format**<br/>The document<br/><small>O documento</small> |
| <a id="PRP000033"></a>`PRP000033` | - | **Invalid document image size**<br/>The document<br/><small>O documento</small> |
| <a id="PRP000034"></a>`PRP000034` | - | **Error cancelling credit operation permanently**<br/>Failed to cancel credit operation permanently: {external_key}<br/><small>Falha ao cancelar permanentemente a operação de crédito: {external_key}</small> |
| <a id="PRP000035"></a>`PRP000035` | - | **Reservation not found**<br/>The reservation was not found<br/><small>A reserva não foi encontrada</small> |
| <a id="PRP000037"></a>`PRP000037` | - | **Reservation is not pending auction**<br/>The reservation is not pending auction<br/><small>A reserva não está pendente de leilão</small> |
| <a id="PRP000038"></a>`PRP000038` | - | **Error creating proposal**<br/>Failed to create proposal<br/><small>Erro ao criar proposta</small> |
| <a id="PRP000039"></a>`PRP000039` | - | **Error getting proposal**<br/>Failed to get proposal<br/><small>Erro ao obter proposta</small> |
| <a id="PRP000040"></a>`PRP000040` | - | **Reservation period is not equal to the number of periods**<br/>The reservation period is not equal to the number of periods<br/><small>O período de reserva não é igual ao número de períodos</small> |
| <a id="PRP000041"></a>`PRP000041` | - | **Error getting credit operation by external key**<br/>Failed to get credit operation by external key: {external_key}<br/><small>Falha ao buscar a operação de crédito: {external_key}</small> |
| <a id="PRP000042"></a>`PRP000042` | - | **Service Unavailable**<br/>Service unavailable for Dataprev service<br/><small>Serviço indisponível para o serviço do Dataprev</small> |
| <a id="PRP000043"></a>`PRP000043` | - | **Invalid reason**<br/>Reservation deletion failed<br/><small>Exclusão de reserva falhou</small> |
| <a id="PRP000044"></a>`PRP000044` | - | **Reason not found**<br/>Reason not found<br/><small>Motivo não encontrado</small> |
| <a id="PRP000045"></a>`PRP000045` | - | **Invalid reason**<br/>Reservation inclusion failed<br/><small>Inclusão de reserva falhou</small> |
| <a id="PRP000046"></a>`PRP000046` | - | **Error creating document**<br/>Failed to create document: {document_name}<br/><small>Falha ao criar o documento: {document_name}</small> |
| <a id="PRP000047"></a>`PRP000047` | - | **Error uploading document**<br/>Failed to upload document: {document_key}<br/><small>Falha ao enviar o documento: {document_key}</small> |
| <a id="PRP000048"></a>`PRP000048` | - | **Error updating disbursement date**<br/>Failed to update disbursement date for credit operation: {external_key}<br/><small>Falha ao atualizar a data de desembolso para a operação de crédito: {external_key}</small> |
| <a id="PRP000049"></a>`PRP000049` | - | **Error constituting collateral**<br/>Failed to constitute collateral for credit operation: {external_key}<br/><small>Falha ao constituir a garantia para a operação de crédito: {external_key}</small> |
| <a id="PRP000050"></a>`PRP000050` | - | **Error cancelling credit operation**<br/>Failed to cancel credit operation: {external_key}<br/><small>Falha ao cancelar a operação de crédito: {external_key}</small> |
| <a id="PRP000051"></a>`PRP000051` | - | **Document validation failed**<br/>Document validation failed<br/><small>A validação de documentos falhou</small> |
| <a id="PRP000052"></a>`PRP000052` | - | **Reservation cannot be deleted**<br/>The reservation is in suspension flow<br/><small>A reserva está em fluxo de suspensão</small> |
| <a id="PRP000053"></a>`PRP000053` | - | **Protocol type not found**<br/>The protocol type was not found<br/><small>O tipo de protocolo não foi encontrado</small> |
| <a id="PRP000054"></a>`PRP000054` | - | **Authentication Error**<br/>Failed to authenticate with external service<br/><small>Falha na autenticação com serviço externo</small> |
| <a id="PRP000055"></a>`PRP000055` | - | **Error getting document by name**<br/>Failed to get document by name: {document_name}<br/><small>Falha ao buscar o documento: {document_name}</small> |
| <a id="PRP000056"></a>`PRP000056` | - | **Empty document list**<br/>Document list is empty: {document_name}<br/><small>A lista de documentos está vazia: {document_name}</small> |
| <a id="PRP000057"></a>`PRP000057` | - | **Reservation is not pending requester authorization**<br/>The reservation is not pending requester authorization<br/><small>A reserva não está pendente de autorização do requerente</small> |
| <a id="PRP000058"></a>`PRP000058` | - | **Error creating credit analysis**<br/>Failed to create credit analysis for document number {document_number}<br/><small>Falha ao criar a análise de crédito para o número de documento {document_number}</small> |
| <a id="PRP000059"></a>`PRP000059` | - | **Invalid credit analysis status**<br/>Invalid credit analysis status: {analysis_status}<br/><small>Status de análise de crédito inválido: {analysis_status}</small> |
| <a id="PRP000060"></a>`PRP000060` | - | **Reservation is not pending credit analysis**<br/>The reservation is not pending credit analysis<br/><small>A reserva não está pendente de análise de crédito</small> |
| <a id="PRP000061"></a>`PRP000061` | - | **Requester configuration not found**<br/>The requester configuration with key {requester_key} was not found<br/><small>A configuração do cliente com a chave {requester_key} não foi encontrada</small> |
| <a id="PRP000062"></a>`PRP000062` | - | **Requester configuration already exists**<br/>The requester configuration with key {requester_key} already exists<br/><small>A configuração do cliente com a chave {requester_key} já existe</small> |
| <a id="PRP000063"></a>`PRP000063` | - | **Reservation is not pending documents submission**<br/>The reservation is not pending documents submission<br/><small>A reserva não está pendente de envio de documentos</small> |
| <a id="PRP000064"></a>`PRP000064` | - | **Invalid biometry analysis**<br/>The biometry analysis is invalid<br/><small>A análise biométrica é inválida</small> |
| <a id="PRP000067"></a>`PRP000067` | - | **Invalid status for cancellation**<br/>The reservation status {status} is not valid for cancellation<br/><small>O status da reserva {status} não é válido para cancelamento</small> |
| <a id="PRP000068"></a>`PRP000068` | - | **Reservation is not canceled**<br/>The reservation is not canceled<br/><small>A reserva não está cancelada</small> |
| <a id="PRP000069"></a>`PRP000069` | - | **Wrong status event**<br/>The reservation status event {status} is not valid<br/><small>O evento de status da reserva {status} não é válido</small> |
| <a id="PRP000070"></a>`PRP000070` | - | **Invalid status for reactivation**<br/>The reservation status event {status} is not valid for reactivation<br/><small>O evento de status da reserva {status} não é válido para reativação</small> |
| <a id="PRP000071"></a>`PRP000071` | - | **Error getting credit analysis**<br/>Failed to get credit analysis for reservation key: {reservation_key}<br/><small>Falha ao obter a análise de crédito para a chave de reserva: {reservation_key}</small> |
| <a id="PRP000072"></a>`PRP000072` | - | **Is not allowed to reserve**<br/>The reservation is not allowed to be reserved<br/><small>A reserva não é permitida para ser reservada</small> |
| <a id="PRP000073"></a>`PRP000073` | - | **Invalid status for documents submission**<br/>The reservation status {status} is not valid for documents submission<br/><small>O status da reserva {status} não é válido para submissão dos documentos</small> |
| <a id="PRP000074"></a>`PRP000074` | - | **Invalid status to delete**<br/>The reservation status is not valid for deletion<br/><small>O status da reserva não é válido para exclusão</small> |
| <a id="PRP000075"></a>`PRP000075` | - | **Bad Gateway**<br/>Failed to include legacy contract<br/><small>Erro ao incluir contrato legado</small> |
| <a id="PRP000076"></a>`PRP000076` | - | **Bad Request**<br/>Missing required fields<br/><small>Faltam campos obrigatórios</small> |
| <a id="PRP000077"></a>`PRP000077` | - | **Requester configuration is not active**<br/>The requester configuration with key {requester_key} is not active<br/><small>A configuração do cliente com a chave {requester_key} não está ativa</small> |
| <a id="PRP000078"></a>`PRP000078` | - | **Invalid configuration data**<br/>The requester configuration with key {requester_key} has invalid configuration data<br/><small>A configuração do cliente com a chave {requester_key} tem dados de configuração inválidos</small> |
| <a id="PRP000079"></a>`PRP000079` | - | **Legacy Contract not found**<br/>The Legacy Contract {contract_number} was not found<br/><small>O contrato legado {contract_number} não foi encontrado</small> |
| <a id="PRP000080"></a>`PRP000080` | - | **Bad Gateway**<br/>Failed to exclude legacy contract<br/><small>Erro ao excluir contrato legado</small> |
| <a id="PRP000081"></a>`PRP000081` | - | **Bad Gateway**<br/>Failed to renegotiate legacy contract<br/><small>Erro ao renegociar contrato legado</small> |
| <a id="PRP000082"></a>`PRP000082` | - | **Missing required fields**<br/>The required fields are missing<br/><small>Os campos obrigatórios estão ausentes</small> |
| <a id="PRP000083"></a>`PRP000083` | - | **Invalid legacy contract to refinance**<br/>The legacy contract {contract_number} is not valid to refinance<br/><small>O contrato legacy {contract_number} não é válido para refinanciamento</small> |
| <a id="PRP000084"></a>`PRP000084` | - | **Bad Request**<br/>The interest rate of the legacy contract {contract_number} must be greater than the new contract: {interest_rate}<br/><small>A taxa de juros do contrato legado {contract_number} precisa ser maior que a do novo contrato: {interest_rate}</small> |
| <a id="PRP000085"></a>`PRP000085` | - | **Success Reason not found**<br/>Success reason not found<br/><small>Motivo de sucesso não encontrado</small> |
| <a id="PRP000086"></a>`PRP000086` | - | **Failure Reason not found**<br/>Failure reason not found<br/><small>Motivo de falha não encontrado</small> |
| <a id="PRP000087"></a>`PRP000087` | - | **Outside of Dataprev working hours**<br/>Outside of Dataprev working hours<br/><small>Fora do horário de funcionamento da Dataprev</small> |
| <a id="PRP000088"></a>`PRP000088` | - | **Authorization Term Not Found**<br/>The Authorization Term key not found<br/><small>Termo de autorização não foi encontrado</small> |
| <a id="PRP000089"></a>`PRP000089` | - | **Termination alert found in balance inquiry**<br/>Termination alert found in existent balance inquiry during validation<br/><small>Alerta de terminação de vínculo encontrado em consulta de vínculo existente durante validação</small> |
| <a id="PRP000090"></a>`PRP000090` | - | **Bad Request**<br/>The legacy contract {contract_number} is not active<br/><small>O contrato legado {contract_number} não está ativo</small> |
| <a id="PRP000091"></a>`PRP000091` | - | **Bad Request**<br/>The employer document number is invalid<br/><small>O número do documento do empregador é inválido</small> |
| <a id="PRP000092"></a>`PRP000092` | - | **Invalid legacy contract refinancing reservation amount**<br/>Reservation amount is greater than the legacy contracts total period amount<br/><small>O valor da reserva é maior que o valor total dos períodos dos contratos legacy</small> |
| <a id="PRP000093"></a>`PRP000093` | - | **Failed to get registers**<br/>Failed to get registers<br/><small>Falha ao obter registros</small> |
| <a id="PRP000094"></a>`PRP000094` | - | **Failed to get payments**<br/>Failed to get payments<br/><small>Falha ao obter pagamentos</small> |
| <a id="PRP000095"></a>`PRP000095` | - | **Registers not found**<br/>Registers not found<br/><small>Registros não encontrados</small> |
| <a id="PRP000096"></a>`PRP000096` | - | **Payments not found**<br/>Payments not found<br/><small>Pagamentos não encontrados</small> |
| <a id="PRP000097"></a>`PRP000097` | - | **Already has balance inquiry**<br/>The reservation already has a balance inquiry<br/><small>A reserva já tem uma consulta de saldo</small> |
| <a id="PRP000098"></a>`PRP000098` | - | **Bad Request**<br/>Error on authorization term<br/><small>Erro no termo de autorização</small> |
| <a id="PRP000099"></a>`PRP000099` | - | **Requester Key Is Required**<br/>The requester key is required<br/><small>A chave do solicitante é obrigatória</small> |
| <a id="PRP000100"></a>`PRP000100` | - | **Invalid legacy contract for rollover**<br/>The legacy contract {contract_number} has different document number or employer document number<br/><small>O contrato legacy {contract_number} possui CPF ou CNPJ do empregador diferente</small> |
| <a id="PRP000101"></a>`PRP000101` | - | **Failed to create rollover reservation**<br/>Failed to create rollover reservation: {error_message or<br/><small>Falha ao criar reserva de tombamento: {error_message or</small> |
| <a id="PRP000102"></a>`PRP000102` | - | **Missing parameter**<br/>The parameter {parameter} is missing<br/><small>O parâmetro {parameter} está ausente</small> |
| <a id="PRP000104"></a>`PRP000104` | - | **Failed to generate a valid contract number**<br/>Failed to generate a contract number for a reservation<br/><small>Falha ao criar número de contrato para reserva.</small> |
| <a id="PRP000201"></a>`PRP000201` | - | **Employment Relationship Not Found**<br/>The employment relationships inquiry key is not valid<br/><small>A chave da consulta de vínculos de emprego não é válida</small> |

### RN — Renegotiation

35 errors

| Code | HTTP | Message |
|-|-|-|
| <a id="RN0000001"></a>`RN0000001` | 400 | **Bad Request**<br/>Credit operation status is invalid for this request. Status: {credit_operation_status}<br/><small>O status dessa operação de crédito é invalido para essa requisição. Status: {credit_operation_status}</small> |
| <a id="RN0000002"></a>`RN0000002` | 400 | **Bad Request**<br/>Installment status is invalid for this request.Installment key:{installment_key}<br/><small>O status dessa parcela é invalido para essa requisição.Installment key:{installment_key}</small> |
| <a id="RN0000003"></a>`RN0000003` | 404 | **Not Found**<br/>No installment found for received installment keys.<br/><small>Nenhuma parcela encontrada para as installment keys recebidas.</small> |
| <a id="RN0000004"></a>`RN0000004` | 400 | **Bad Request**<br/>The percentage discount amount must be less than or equal to 1.<br/><small>O valor do desconto percentual deve ser menor ou igual a 1.</small> |
| <a id="RN0000005"></a>`RN0000005` | 400 | **Bad Request**<br/>The discount amount cannot be greater than the the installments values.<br/><small>O valor do desconto não pode ser maior do que o valor das parcelas.</small> |
| <a id="RN0000006"></a>`RN0000006` | 400 | **Bad Request**<br/>The same installment key was informed more than once.Installment Key:{installment_key}<br/><small>A mesma installment_key foi informada mais de uma vez.Installment Key:{installment_key}</small> |
| <a id="RN0000007"></a>`RN0000007` | 400 | **Bad Request**<br/>Installment doesn<br/><small>Parcela não possui campo paid_amount. Installment_key:{installment_key}</small> |
| <a id="RN0000008"></a>`RN0000008` | 400 | **Bad Request**<br/>Proposal must have a payment linked to it.<br/><small>A proposta deve ter um pagamento vinculado a ela.</small> |
| <a id="RN0000009"></a>`RN0000009` | 403 | **Forbidden**<br/>The requester informed is not the same as the credit operation.<br/><small>O solicitante informado não é o mesmo da operação de crédito.</small> |
| <a id="RN0000010"></a>`RN0000010` | 404 | **Not Found**<br/>Proposal not found.<br/><small>Proposta não encontrada.</small> |
| <a id="RN0000011"></a>`RN0000011` | 400 | **Bad Request**<br/>Proposal cannot be canceled in current status.Status:{status}<br/><small>Proposta não pode ser cancelada no status atual.Status:{status}</small> |
| <a id="RN0000012"></a>`RN0000012` | 404 | **Not Found**<br/>Credit Operation not found for sent contract number.<br/><small>Operação de credito não encontrada pelo número de contrato enviado.</small> |
| <a id="RN0000013"></a>`RN0000013` | 404 | **Not found**<br/>The payment engine has not been found.<br/><small>O mecanismo de pagamento não foi encontrado.</small> |
| <a id="RN0000014"></a>`RN0000014` | 404 | **Not found**<br/>The requester profile has not been found.<br/><small>O perfil de solicitante não foi encontrado.</small> |
| <a id="RN0000015"></a>`RN0000015` | 400 | **Bad Request**<br/>Proposal due date or reference date cannot be in past.<br/><small>A data de vencimento da renegociação ou a data de referência não podem estar no passado.</small> |
| <a id="RN0000016"></a>`RN0000016` | 404 | **Not found**<br/>The requester configuration has not been found.<br/><small>A configuração de solicitante não foi encontrada.</small> |
| <a id="RN0000017"></a>`RN0000017` | 400 | **Bad Request**<br/>The proposal cannot be paid in current status. Proposal Status: {status}<br/><small>A renegociação não pode ser paga no status atual. Proposal Status: {status}</small> |
| <a id="RN0000018"></a>`RN0000018` | 400 | **Bad Request**<br/>The bank slip registration has been rejected.<br/><small>O registro do boleto bancário foi rejeitado.</small> |
| <a id="RN0000019"></a>`RN0000019` | 409 | **Conflict**<br/>This contract is already linked to another proposal in progress.<br/><small>Esse contrato ja está vinculado a outra proposta em andamento.</small> |
| <a id="RN0000020"></a>`RN0000020` | 400 | **Bad Request**<br/>Renegotiation request invalid due to credit operation status.<br/><small>A requisição de renegociação é inválida devido ao status da operação de crédito.</small> |
| <a id="RN0000021"></a>`RN0000021` | 400 | **Bad Request**<br/>Number of operations is greater than the maximum allowed. Maximum operations allowed: {maximum_operations}<br/><small>Número de operações é maior que o máximo permitido. Máximo de operações permitidas: {maximum_operations}</small> |
| <a id="RN0000022"></a>`RN0000022` | 400 | **Bad Request**<br/>It is not possible to carry out a batch renegotiation with different issuers.<br/><small>Não é possível realizar uma renegociação em lote com emissores diferentes.</small> |
| <a id="RN0000024"></a>`RN0000024` | 404 | **Not Found**<br/>Batch proposal not found.<br/><small>Batch proposal não encontrada.</small> |
| <a id="RN0000025"></a>`RN0000025` | 400 | **Bad Request**<br/>Batch Proposal cannot be canceled in current status.Status:{status}<br/><small>Proposta em lote não pode ser cancelada no status atual.Status:{status}</small> |
| <a id="RN0000026"></a>`RN0000026` | 400 | **Bad Request**<br/>Requester identifier key is already been used for another batch proposal.<br/><small>Requester identifier key ja está sendo utilizada para outra proposta em lote.</small> |
| <a id="RN0000027"></a>`RN0000027` | 400 | **Bad Request**<br/>The discount amount cannot be greater than the batch proposal payment amount: {payment_amount}.<br/><small>O valor do desconto não pode ser maior do que o valor de pagamento da renegociação em lote: {payment_amount}.</small> |
| <a id="RN0000028"></a>`RN0000028` | 400 | **Bad Request**<br/>Selected Installments for renegotiation must include the latest due dates.<br/><small>As parcelas selecionadas para renegociação devem incluir as últimas datas de vencimento.</small> |
| <a id="RN0000029"></a>`RN0000029` | 400 | **Bad Request**<br/>Amortization Type of collateral renegotiation must be Installment Payment.<br/><small>O tipo de amortização para a renegociação com colateral deve ser pagamento de parcelas.</small> |
| <a id="RN0000030"></a>`RN0000030` | 400 | **Bad Request**<br/>Discount amount field can<br/><small>O campo de valor de desconto não pode ser informado para a batch proposal e para as operações na mesma requisição.</small> |
| <a id="RN0000031"></a>`RN0000031` | 400 | **Bad Request**<br/>Installment payment amount can<br/><small>Valor de pagamento da parcela não pode ser 0. Installment_key: {installment_key}</small> |
| <a id="RN0000032"></a>`RN0000032` | 400 | **Bad Request**<br/>Payment amount cannot be greater than the disbursement amount.<br/><small>O valor do pagamento não pode ser maior que o valor de desembolso.</small> |
| <a id="RN0000033"></a>`RN0000033` | 400 | **Bad Request**<br/>Payment amount is not required for present amount amortization type.<br/><small>O valor do pagamento não é necessário para o tipo de amortização presente.</small> |
| <a id="RN0000034"></a>`RN0000034` | 400 | **Bad Request**<br/>Requester identifier key is already been used for another proposal.<br/><small>Requester identifier key ja está sendo utilizada para outra proposta.</small> |
| <a id="RN0000035"></a>`RN0000035` | 400 | **Bad Request**<br/>Invalid discount amount. Discount amount must be only interest discount.<br/><small>O valor do desconto é invalido. O valor do desconto deve ser apenas desconto de juros.</small> |
| <a id="RN0000036"></a>`RN0000036` | 500 | **Internal Server Error**<br/>Max retries set is too big to be executable.<br/><small>Número máximo de retentativas é muito grande.</small> |
| <a id="RN0000037"></a>`RN0000037` | 400 | **Bad Request**<br/>The payer document number does not match the employer document for the credit operation.<br/><small>O documento do pagador não corresponde ao documento do empregador para a operação de crédito.</small> |
| <a id="RN0000038"></a>`RN0000038` | 400 | **Renegotiation Errors**<br/>One or more operations failed.<br/><small>Uma ou mais operacoes falharam.</small> |

### SSC — Social Security

91 errors

| Code | HTTP | Message |
|-|-|-|
| <a id="SSC000001"></a>`SSC000001` | 404 | **Contract not Found**<br/>Contract {contract_number} not found in DataPrev<br/><small>Contrato {contract_number} não encontrado no DataPrev</small> |
| <a id="SSC000002"></a>`SSC000002` | 400 | **Contract not Found**<br/>Contract {contract_number} is not active<br/><small>Contrato {contract_number} não está ativo</small> |
| <a id="SSC000003"></a>`SSC000003` | 404 | **Benefits not Found**<br/>Benefits with key {benefits_key} was not found.<br/><small>A reserva com chave {benefits_key} não foi encontrada.</small> |
| <a id="SSC000004"></a>`SSC000004` | 404 | **Reservation not Found**<br/>Reservation with key {reservation_key} was not found.<br/><small>A reserva com chave {reservation_key} não foi encontrada.</small> |
| <a id="SSC000005"></a>`SSC000005` | 404 | **Document not Found**<br/>Document with key {document_key} was not found.<br/><small>O documento com chave {document_key} não foi encontrada.</small> |
| <a id="SSC000006"></a>`SSC000006` | 404 | **Balance not Found**<br/>Balance with key {balance_key} was not found.<br/><small>A consulta de saldo com chave {balance_key} não foi encontrada.</small> |
| <a id="SSC0000069"></a>`SSC0000069` | 404 | **Reservation not Found**<br/>Reservation with ID {reservation_id} was not found.<br/><small>A reserva com ID {reservation_id} não foi encontrada.</small> |
| <a id="SSC000007"></a>`SSC000007` | 403 | **Forbidden**<br/>There is not an active authorization for person {document_number}.<br/><small>Não existe uma autorização válida para a pessoa com cpf {document_number}.</small> |
| <a id="SSC0000071"></a>`SSC0000071` | 409 | **Reservation already locked**<br/>Reservation with key {reservation_key} is already locked being processed.<br/><small>A reserva com a key {reservation_key} já está bloqueada sendo processada.</small> |
| <a id="SSC0000072"></a>`SSC0000072` | 400 | **Refinancing contract cannot be reverted**<br/>Refinancing contract cannot be reverted after 7 working days from reservation.<br/><small>Contrato de refinanciamento não pode ser revertido após 7 dias úteis da reserva.</small> |
| <a id="SSC0000073"></a>`SSC0000073` | 400 | **The number of grace competencies is invalid**<br/>The number of grace competencies is invalid. The accepted range is 0 to 6<br/><small>O número da carência de competências está inválido. O intervalo aceito é de 0 a 6</small> |
| <a id="SSC000008"></a>`SSC000008` | 400 | **Bad Request**<br/>The term<br/><small>O documento do termo deve ser o mesmo do requisitado.</small> |
| <a id="SSC000009"></a>`SSC000009` | 400 | **Bad Request**<br/>Given {document_number} document number is invalid.<br/><small>CPF {document_number} fornecido não é valido.</small> |
| <a id="SSC000010"></a>`SSC000010` | 400 | **Bad Request**<br/>Contact phone data is missing<br/><small>Faltou informar os dados de telefone para contato</small> |
| <a id="SSC000011"></a>`SSC000011` | 400 | **Bad Request**<br/>Contact email data is missing<br/><small>Faltou informar os dados de email para contato</small> |
| <a id="SSC000012"></a>`SSC000012` | 400 | **Bad Request**<br/>Contact type attribute is required for signer object<br/><small>O atributo tipo de contato é necessário para o objeto assinante</small> |
| <a id="SSC000013"></a>`SSC000013` | 400 | **Bad Request**<br/>Cannot proceed with webhook from non signed document<br/><small>Não pode proceder com o webhook de um documento não assinado</small> |
| <a id="SSC000014"></a>`SSC000014` | 409 | **Bad Request**<br/>Term of signature is ineligible for signing<br/><small>O termo de assinatura é inelegivel para assinatura</small> |
| <a id="SSC000015"></a>`SSC000015` | 400 | **Bad Request**<br/>Values {invalid_types} are not valid document_types<br/><small>Valores {invalid_types} não são tipos de documentos válidos</small> |
| <a id="SSC000016"></a>`SSC000016` | 409 | **Reservation not deleted**<br/> |
| <a id="SSC000017"></a>`SSC000017` | 404 | **External key not Found**<br/>Reservation with external key {external_key} was not found.<br/><small>A reserva com chave externa {external_key} não foi encontrada.</small> |
| <a id="SSC000018"></a>`SSC000018` | 409 | **Reservation Status Conflict**<br/>Reservation with status<br/><small>Reservas no status</small> |
| <a id="SSC000020"></a>`SSC000020` | 400 | **Bad Request**<br/>Periods due date must occur in sub sequent months.<br/><small>Os períodos devem possuir datas em meses subsequentes.</small> |
| <a id="SSC000021"></a>`SSC000021` | 400 | **Bad Request**<br/>Given reservation must have more than 0 periods.<br/><small>A reserva precisa ter mais do que 0 períodos.</small> |
| <a id="SSC000022"></a>`SSC000022` | 400 | **Bad Request**<br/>Accrual date of the discount initiation needs to be equivalent to the current accrual date and the disbursement accrual date<br/><small>A data de competencia do inicio do desconto precisa ser equivalente a data de competencia atual e a data de competencia do desembolso</small> |
| <a id="SSC000023"></a>`SSC000023` | 400 | **Bad Request**<br/>DataPrev is closed and cannot process this request<br/><small>O DataPrev está fechado e não pode processar esse pedido.</small> |
| <a id="SSC000024"></a>`SSC000024` | 400 | **Bad Request**<br/>Portability Data is missing.<br/><small>Faltou informar os dados da portabilidade.</small> |
| <a id="SSC000025"></a>`SSC000025` | 400 | **Bad Request**<br/>The signer<br/><small>O assinante do termo precisa ser o beneficiario ou seu representante legal caso existente</small> |
| <a id="SSC000026"></a>`SSC000026` | 400 | **Bad Requests**<br/>Unexpected error from DataPrev.<br/><small>Erro inesperado do DataPrev</small> |
| <a id="SSC000027"></a>`SSC000027` | 429 | **Rate Limit Exceeded**<br/>DataPrev rate limit exceeded.<br/><small>Limite de requisições do DataPrev excedido.</small> |
| <a id="SSC000028"></a>`SSC000028` | 409 | **Conflict**<br/>Balance Request with status {status} cannot be retried.<br/><small>Consulta de margem com status {status} não pode ser retentado.</small> |
| <a id="SSC000029"></a>`SSC000029` | 409 | **Reservation Already Registered**<br/>Reservation with external key {external_key} already exists for requester {requester_key}<br/><small>Reserva com a chave externa {external_key} já está cadastrado para o requester {requester_key}</small> |
| <a id="SSC000030"></a>`SSC000030` | 404 | **Disbursement Option not Found**<br/>Disbursement option for {disbursement_date} was not found.<br/><small>Opção de desembolso para {disbursement_date} não foi encontrada.</small> |
| <a id="SSC000031"></a>`SSC000031` | 409 | **Conflict**<br/>Benefits Request with status {status} cannot be retried.<br/><small>Consulta de benefícios com status {status} não pode ser retentado.</small> |
| <a id="SSC000032"></a>`SSC000032` | 400 | **Bad Request**<br/>Refinancing Data is missing.<br/><small>Faltou informar os dados de refinanciamento.</small> |
| <a id="SSC000033"></a>`SSC000033` | 400 | **Bad Request**<br/>Refinancing Data is missing.<br/><small>Faltou informar os dados de refinanciamento.</small> |
| <a id="SSC000034"></a>`SSC000034` | 400 | **Bad Request**<br/>The Reservation(s) must be reserved in order to perform the refinancing.<br/><small>A(s) Reservas(s) não estão averbada(s) para realizar o refinanciamento.</small> |
| <a id="SSC000035"></a>`SSC000035` | 404 | **Reservation not Found**<br/>Reservation with external key {external_key} was not found.<br/><small>A reserva com chave externa {external_key} não foi encontrada.</small> |
| <a id="SSC000036"></a>`SSC000036` | 400 | **Bad Request**<br/>Trying to refinance<br/><small>Tentando refinanciar reserva com titularidade trocada.</small> |
| <a id="SSC000038"></a>`SSC000038` | 409 | **Discount Status Conflict**<br/>Discount with status<br/><small>Disconto no status</small> |
| <a id="SSC000040"></a>`SSC000040` | 404 | **Valid Balance not old than 15 days not Found**<br/>The valid balance enquire is outdated. The most recent balance is from {date}.<br/><small>A consulta de saldo é muito antiga. A consulta mais recente é de {date}.</small> |
| <a id="SSC000041"></a>`SSC000041` | 400 | **Bad Request**<br/>The benefit number {benefit_number} is {reason}<br/><small>O benefício {benefit_number} está {translation_dict[reason]}.</small> |
| <a id="SSC000042"></a>`SSC000042` | 404 | **Protocol not Found**<br/>Protocol with key {external_key} was not found.<br/><small>Protocolo com chave {external_key} não foi encontrada.</small> |
| <a id="SSC000043"></a>`SSC000043` | 404 | **Protocol not Found**<br/>Protocol with hash operation {hash_operation} was not found.<br/><small>Protocolo com hash de operação {hash_operation} não foi encontrada.</small> |
| <a id="SSC000044"></a>`SSC000044` | 400 | **Ivanlid protocol type**<br/>Protocol type {protocol_type} doesn<br/><small>Protocolo do tipo {protocol_type} não existe.</small> |
| <a id="SSC000045"></a>`SSC000045` | 409 |  |
| <a id="SSC000046"></a>`SSC000046` | 400 | **Bad Request**<br/>The INSS product is temporarily unavailable<br/><small>O produto INSS está temporariamente indisponível</small> |
| <a id="SSC000047"></a>`SSC000047` | 400 |  |
| <a id="SSC000048"></a>`SSC000048` | 500 |  |
| <a id="SSC000050"></a>`SSC000050` | 400 | **Invalid Contract Interest**<br/> |
| <a id="SSC000051"></a>`SSC000051` | 500 | **Internal Error**<br/>Erro while creating redis instances.<br/><small>Erro ao criar instâncias do redis.</small> |
| <a id="SSC000053"></a>`SSC000053` | 400 | **Reservation Cannot Be Suspended**<br/>Status {status}, reservation other than reserved status cannot be suspended<br/><small>Status {status}, reserva com status diferente de reservado não pode ser suspensa</small> |
| <a id="SSC000054"></a>`SSC000054` | 400 | **Document Submission Cannot Be Suspended**<br/>Reservation in document submission process, please try again later<br/><small>Reserva em processo de envio de documento, tente novamente mais tarde</small> |
| <a id="SSC000056"></a>`SSC000056` | 400 | **Reservation can**<br/> |
| <a id="SSC000057"></a>`SSC000057` | 400 | **Reservation can**<br/>Unknown success code: {code} to requested endpoint.<br/><small>Código de sucesso desconhecido: {code} para o endpoint requisitado.</small> |
| <a id="SSC000059"></a>`SSC000059` | 400 | **Reservation amount greater than available total balance**<br/>The installment face value: {reservation_amount} is greater than the available total balance (origin installment face value + available total balance):{total_amount_available}. Available total balance: {available_total_balance}.<br/><small>O valor da parcela: {reservation_amount} é maior que o valor total disponível (valor da parcela do contrato de origem + margem total disponível) : {total_amount_available}. Margem total diponível: {available_total_balance}.</small> |
| <a id="SSC000060"></a>`SSC000060` | 400 | **Invalid document size**<br/>The document: {document_type} should have at least 250x250px and at most 5MB.<br/><small>O documento: {document_type} deve ter no mínimo 250x250px e no máximo 5MB.</small> |
| <a id="SSC000061"></a>`SSC000061` | 400 | **Invalid document format**<br/>The document: {document_type} should be in JPEG format.<br/><small>O documento: {document_type} deve estar no formato JPEG.</small> |
| <a id="SSC000062"></a>`SSC000062` | 400 | **Status does not allow patch**<br/>Reservation {reservation_key} is on status {status_enum}. Which does not allow the field {field_name} to be changed<br/><small>Reserva {reservation_key} está no status {status_enum}. Portanto não pode ter o campo {field_name} alterado</small> |
| <a id="SSC000063"></a>`SSC000063` | 400 | **Broken Document**<br/>The document: {document_type} is truncated or broken.<br/><small>O documento: {document_type} está truncado ou corrompido.</small> |
| <a id="SSC000065"></a>`SSC000065` | 404 | **Balance not Found**<br/>Portability origin contract with key {origin_contract_key} was not found.<br/><small>Contrato de origem de portabilidade com chave {origin_contract_key} não foi encontrada.</small> |
| <a id="SSC000066"></a>`SSC000066` | 409 | **Conflict**<br/>Portability Origin Contract Request with status {status} cannot be retried.<br/><small>Contrato de Origem de Portabilidade com status {status} não pode ser retentado.</small> |
| <a id="SSC000067"></a>`SSC000067` | 409 | **Requester Configuration Already Exists**<br/>Requester configuration already exists.<br/><small>Configuração de solicitante já existe.</small> |
| <a id="SSC000068"></a>`SSC000068` | 400 | **Reservation can**<br/> |
| <a id="SSC000070"></a>`SSC000070` | 404 | **Portability Origin Contract not Found**<br/>Portability Origin Contract was not found.<br/><small>Contrato de origem de portabilidade não foi encontrado.</small> |
| <a id="SSC000074"></a>`SSC000074` | 404 | **Balance not Found**<br/>Balance with document number {document_number} was not found.<br/><small>A consulta de saldo com o cpf {document_number} não foi encontrada.</small> |
| <a id="SSC000075"></a>`SSC000075` | 400 | **Invalid last period due date**<br/>The last period due date<br/><small>A data de vencimento da última parcela</small> |
| <a id="SSC000076"></a>`SSC000076` | 400 | **Success balance request not found**<br/>A success balance request for the new benefit number<br/><small>Uma consulta de saldo válida para o novo número de benefício</small> |
| <a id="SSC000077"></a>`SSC000077` | 404 | **Balance not Found**<br/>Balance for document number {document_number} with benefit number {benefit_number} was not found.<br/><small>A consulta de saldo para o cpf {document_number} com número de benefício {benefit_number} não foi encontrada.</small> |
| <a id="SSC000078"></a>`SSC000078` | 404 | **Invalid Disbursement Date**<br/>Disbursement date for this operation is incorrect, it is not between the reservation limit and next accrual.<br/><small>A data de desembolso para esta operação está incorreta, ela não está entre a data limite de averbação e a próxima competência.</small> |
| <a id="SSC000079"></a>`SSC000079` | 400 | **Invalid Contract Interest Rate**<br/> |
| <a id="SSC000080"></a>`SSC000080` | 429 | **Rate limit exceeded**<br/> |
| <a id="SSC000081"></a>`SSC000081` | 404 | **Requester Configuration Not Found**<br/>Requester configuration<br/><small>Configuração de solicitante</small> |
| <a id="SSC000082"></a>`SSC000082` | 404 | **Bucket Configuration Not Found**<br/>Bucket configuration not found.<br/><small>Configuração de balde não encontrada.</small> |
| <a id="SSC000083"></a>`SSC000083` | 400 | **Reservation Failed**<br/>Last Response: {cancel_reason}, Tokens Available: {total_tokens}, Next Refill At: {next_refill_at}<br/><small>Última resposta: {cancel_reason}, Fichas disponíveis: {total_tokens}, Próxima Recarga: {next_refill_at}</small> |
| <a id="SSC000084"></a>`SSC000084` | 400 | **Bad Request**<br/>The reservation has already been processed and the status has changed to {reservation_status}, Available Tokens: {tokens}<br/><small>A reserva já foi processada e o status mudou para {reservation_status}, Fichas disponíveis: {tokens}</small> |
| <a id="SSC000085"></a>`SSC000085` | 400 | **Bad Request**<br/> |
| <a id="SSC000086"></a>`SSC000086` | 400 | **Bad request**<br/>Benefit with number {benefit_number} is too long or incorrect.<br/><small>Número de benefício {benefit_number} é muito longo ou está incorreto.</small> |
| <a id="SSC000087"></a>`SSC000087` | 400 | **Bad Request**<br/>Disbursement date {disbursement_date} is too old, update it.<br/><small>A data de desembolso {disbursement_date} é muito antiga, atualize-a.</small> |
| <a id="SSC000088"></a>`SSC000088` | 404 | **Reservation not Found**<br/>Reservation with contract key {contract_number} was not found.<br/><small>A reserva com chave de contrato {contract_number} não foi encontrada.</small> |
| <a id="SSC000089"></a>`SSC000089` | 404 | **Period not Found**<br/>Period with competence {competence} was not found.<br/><small>O período com competência {competence} não foi encontrado.</small> |
| <a id="SSC000090"></a>`SSC000090` | 400 | **Operation Canceled Without Installments**<br/>Operation canceled and without installments.<br/><small>Operação cancelada e sem parcelas.</small> |
| <a id="SSC000091"></a>`SSC000091` | 409 | **Refinanced Credit Operation inelegible**<br/>Operação refinanciada {refinanced_co_key} inelegível para refinaciamento.<br/><small>Refinanced Credit Operation {refinanced_co_key} inelegible for refinancing.</small> |
| <a id="SSC000092"></a>`SSC000092` | 400 | **Bad Request**<br/>The benefit number {benefit_number} is blocked by the beneficiary. blocked_date: {blocked_date}<br/><small>O benefício {benefit_number} está bloqueado pelo beneficiário. data de bloqueio: {blocked_date}</small> |
| <a id="SSC000093"></a>`SSC000093` | 400 | **Accrual not Found**<br/>Accrual with date {accrual_date} was not found. DATAPREV accrual calendar goes until december of the current year.<br/><small>A competência com data {accrual_date} não foi encontrada. O calendário de competência do DATAPREV vai até dezembro do ano atual.</small> |
| <a id="SSC000094"></a>`SSC000094` | 400 | **Suspension Reservation Failed**<br/>Suspension of reservation failed with http code {http_code}.<br/><small>Suspensão da reserva falhou com código http: {http_code}.</small> |
| <a id="SSC000095"></a>`SSC000095` | 400 | **Reservation Deleted With Canceled Operation**<br/>Reservation with external key {external_key} is deleted and credit operation is canceled.<br/><small>Reserva de external key {external_key} está deletada e operação de crédito está cancelada.</small> |
| <a id="SSC000096"></a>`SSC000096` | 501 | **Not Implemented**<br/>Not implemented<br/><small>Não implementado</small> |
| <a id="SSC000097"></a>`SSC000097` | 400 | **Deactivated Temporary**<br/>Deactivated temporary<br/><small>Desativado temporariamente</small> |
| <a id="SSC000098"></a>`SSC000098` | 400 | **Wrong reservation amount**<br/>New reservation amount {new_reservation_amount} is different from reservation amount to recalculate {reservation_amount_to_recalculate}.<br/><small>O novo valor da reserva {new_reservation_amount} é diferente do valor da reserva a ser recalculado {reservation_amount_to_recalculate}.</small> |
| <a id="SSC000099"></a>`SSC000099` | 408 | **Gateway Timeout**<br/>DataPrev did not respond in time. Please retry later.<br/><small>O DataPrev nao respondeu a tempo. Tente novamente mais tarde.</small> |

---

# Set disbursement date

URL: /en/documentation/emissao_de_divida/configurar_data_de_desembolso

## Request

ENDPOINT /debt/ DEBT-KEY /set_disbursement_date
METHOD 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 **Attention!**

If the issuance of debt with multiple dates is chosen, after the contract is signed, the disbursement date must be set through this endpoint.
:::

### PATH PARAMS

| Field | Type | Description |
|---|---| ---|
| `debt_key` * | string | Debt key returned at the moment of credit operation creation. |

### BODY PARAMS

| Field | Type | Description |Characters |
|---|---|---|---|
| `disbursement_date` * | date | Operation disbursement date. | 10 | 
| `disbursement_bank_account` | object | **[Object Disbursement Bank Account](#object-disbursement_bank_accounts)** - Bank account details for the operation disbursement. |  | 

### Object Disbursement Bank Account

Bank information for disbursement can be changed along with the disbursement date. By default, the disbursement is made to an account held by the debtor.

| Field                 | Type   | Description                                                                                          | Max. Caract. | 
|-----------------------|--------|----------------------------------------------------------------------------------------------------|--------------|
| name                  | string | Account owner's name                                                                           | 50           |
| document_number       | string | Account owner's CPF                                                                            | 11           |
| bank_code *           | string | Financial institution's COMPE code (https://www.bcb.gov.br/pom/spb/estatistica/port/ASTR003.pdf) | 3            |
| branch_number *       | string | Branch number (do not include the branch check digit!)                                  | 4            |
| account_number *      | string | Account number (without the account check digit!)                                               | 10           |
| account_digit *       | string | Account check digit (use zero in place of letters)                                     | 1            |
| account_type          | enum   | [Enumerador Account Type](#enumerador-account-type) Account type                                  | 1            |

## Response

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\"}"
}
```

---

# Debt inquiry

URL: /en/documentation/emissao_de_divida/consulta_de_divida

## Request

ENDPOINT /debt
METHOD GET

:::caution Do not combine `total_due_balance` with `key`
`total_due_balance` only works in **filter-based queries** (without `key`). When you send the `key` parameter, the endpoint uses the individual lookup route, which **ignores** `total_due_balance` (and other filters) — that's why `balance_due` is not returned.

To get `balance_due`, query **without** `key`, using the other filters. Example:

```bash
GET /debt?total_due_balance=true&contract_number=0369255657%2FMGG&issuer_document_number=05739967929&page_size=10&page=1
```

The response comes as a **list** (`data: [...]`) and each item includes `balance_due`.
:::

## Response

STATUS 200

Response Body: Inquiry without DEBT-KEY

```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
  }
}

```

Response Body: Inquiry with DEBT-KEY

```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": [
          {
            "amount": null,
            "created_at": "2022-10-19T11:54:47",
            "event_date": "2022-10-19T11:54:47",
            "installment_event_type": {
              "enumerator": "open",
              "translation_path": "co.InstallmentEventType.open"
            },
            "installment_old_status": {
              "enumerator": "created",
              "translation_path": "co.InstallmentStatus.created"
            },
            "old_due_date": null
          },
          {
            "amount": null,
            "created_at": "2022-11-18T08:00:10",
            "event_date": "2022-11-18T08:00:10",
            "installment_event_type": {
              "enumerator": "maturity",
              "translation_path": "co.InstallmentEventType.maturity"
            },
            "installment_old_status": {
              "enumerator": "opened",
              "translation_path": "co.InstallmentStatus.opened"
            },
            "old_due_date": null
          },
          {
            "amount": 11.76,
            "created_at": "2022-11-22T08:00:14",
            "event_date": "2022-11-22T08:00:14",
            "installment_event_type": {
              "enumerator": "delay_fine",
              "translation_path": "co.InstallmentEventType.delay_fine"
            },
            "installment_old_status": {
              "enumerator": "waiting_payment",
              "translation_path": "co.InstallmentStatus.waiting_payment"
            },
            "old_due_date": null
          },
          {
            "amount": 11.94,
            "created_at": "2022-11-23T09:13:46",
            "event_date": "2022-11-23T09:13:46",
            "installment_event_type": {
              "enumerator": "delay_fine",
              "translation_path": "co.InstallmentEventType.delay_fine"
            },
            "installment_old_status": {
              "enumerator": "overdue",
              "translation_path": "co.InstallmentStatus.overdue"
            },
            "old_due_date": null
          },
          {
            "amount": 12.12,
            "created_at": "2022-11-24T09:15:55",
            "event_date": "2022-11-24T09:15:55",
            "installment_event_type": {
              "enumerator": "delay_fine",
              "translation_path": "co.InstallmentEventType.delay_fine"
            },
            "installment_old_status": {
              "enumerator": "overdue",
              "translation_path": "co.InstallmentStatus.overdue"
            },
            "old_due_date": null
          },
          {
            "amount": 12.3,
            "created_at": "2022-11-25T09:24:45",
            "event_date": "2022-11-25T09:24:44",
            "installment_event_type": {
              "enumerator": "delay_fine",
              "translation_path": "co.InstallmentEventType.delay_fine"
            },
            "installment_old_status": {
              "enumerator": "overdue",
              "translation_path": "co.InstallmentStatus.overdue"
            },
            "old_due_date": null
          },
          {
            "amount": 12.84,
            "created_at": "2022-11-28T09:37:41",
            "event_date": "2022-11-28T09:37:41",
            "installment_event_type": {
              "enumerator": "delay_fine",
              "translation_path": "co.InstallmentEventType.delay_fine"
            },
            "installment_old_status": {
              "enumerator": "overdue",
              "translation_path": "co.InstallmentStatus.overdue"
            },
            "old_due_date": null
          },
          {
            "amount": 13.02,
            "created_at": "2022-11-29T09:17:44",
            "event_date": "2022-11-29T09:17:44",
            "installment_event_type": {
              "enumerator": "delay_fine",
              "translation_path": "co.InstallmentEventType.delay_fine"
            },
            "installment_old_status": {
              "enumerator": "overdue",
              "translation_path": "co.InstallmentStatus.overdue"
            },
            "old_due_date": null
          }
        ],
        "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
      },
      {
        "accrual_reference_date": null,
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": "527835e4-7b09-42f2-a7d0-befed3a326fd",
        "business_due_date": "2022-12-20",
        "calendar_days": 31,
        "cetip_settlements": [],
        "created_at": "2022-10-19T11:53:00",
        "digitable_line": "32990001031000699925349000000205492040000055231",
        "due_date": "2022-12-19",
        "due_interest": 0,
        "due_principal": 2562.07402982,
        "events": [
          {
            "amount": null,
            "created_at": "2022-10-19T11:54:47",
            "event_date": "2022-10-19T11:54:47",
            "installment_event_type": {
              "enumerator": "open",
              "translation_path": "co.InstallmentEventType.open"
            },
            "installment_old_status": {
              "enumerator": "created",
              "translation_path": "co.InstallmentStatus.created"
            },
            "old_due_date": null
          }
        ],
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "dde36938-8594-4507-a87d-cd2dd5309817",
        "installment_number": 2,
        "installment_payment": [],
        "installment_status": {
          "enumerator": "opened",
          "translation_path": "co.InstallmentStatus.opened"
        },
        "installment_type": {
          "enumerator": "principal",
          "translation_path": "co.InstallmentType.principal"
        },
        "original_due_principal": 2562.07402982,
        "original_pre_fixed_amount": 65.94922003,
        "original_principal_amortization_amount": 486.36077997,
        "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": 65.94922003,
        "principal_amortization_amount": 486.36077997,
        "qr_code_key": "9d2980e9-fa0c-4b21-a7c5-5ca266c9aba8",
        "qr_code_url": "00020126970014br.gov.bcb.pix2575qrcode-h.sandbox.qitech.app/bacen/cobv/9d2980e9-fa0c-4b21-a7c5-5ca266c9aba85204000053039865802BR5925QI SOCIEDADE DE CREDITO D6009Sao Paulo61080145200062070503***6304FBC3",
        "renegotiation_proposal_key": null,
        "tax_amount": 2.43277662,
        "total_accrual_amount": null,
        "total_amount": 552.31,
        "total_paid_amount": 0,
        "updated_at": "2022-10-19T11:56:43",
        "workdays": 21
      },
      {
        "accrual_reference_date": null,
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": "d69c9ab6-01f1-40bb-9519-a06ee2230c22",
        "business_due_date": "2023-01-19",
        "calendar_days": 30,
        "cetip_settlements": [],
        "created_at": "2022-10-19T11:53:00",
        "digitable_line": "32990001031000699925350000000203192340000055231",
        "due_date": "2023-01-18",
        "due_interest": 0,
        "due_principal": 2075.71324985,
        "events": [
          {
            "amount": null,
            "created_at": "2022-10-19T11:54:47",
            "event_date": "2022-10-19T11:54:47",
            "installment_event_type": {
              "enumerator": "open",
              "translation_path": "co.InstallmentEventType.open"
            },
            "installment_old_status": {
              "enumerator": "created",
              "translation_path": "co.InstallmentStatus.created"
            },
            "old_due_date": null
          }
        ],
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "93273ee0-71bd-46a6-b5e2-39e03a365b16",
        "installment_number": 3,
        "installment_payment": [],
        "installment_status": {
          "enumerator": "opened",
          "translation_path": "co.InstallmentStatus.opened"
        },
        "installment_type": {
          "enumerator": "principal",
          "translation_path": "co.InstallmentType.principal"
        },
        "original_due_principal": 2075.71324985,
        "original_pre_fixed_amount": 51.68519286,
        "original_principal_amortization_amount": 500.62480714,
        "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": 51.68519286,
        "principal_amortization_amount": 500.62480714,
        "qr_code_key": "d79eb27b-7a1e-4d4c-94a1-f20045c4904e",
        "qr_code_url": "00020126970014br.gov.bcb.pix2575qrcode-h.sandbox.qitech.app/bacen/cobv/d79eb27b-7a1e-4d4c-94a1-f20045c4904e5204000053039865802BR5925QI SOCIEDADE DE CREDITO D6009Sao Paulo61080145200062070503***6304E949",
        "renegotiation_proposal_key": null,
        "tax_amount": 3.73566231,
        "total_accrual_amount": null,
        "total_amount": 552.31,
        "total_paid_amount": 0,
        "updated_at": "2022-10-19T11:56:43",
        "workdays": 22
      },
      {
        "accrual_reference_date": null,
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": "5c62c50f-5326-4226-b154-a0cc6d2f62e7",
        "business_due_date": "2023-02-23",
        "calendar_days": 35,
        "cetip_settlements": [],
        "created_at": "2022-10-19T11:53:00",
        "digitable_line": "32990001031000699925351000000201192690000055231",
        "due_date": "2023-02-22",
        "due_interest": 0,
        "due_principal": 1575.08844271,
        "events": [
          {
            "amount": null,
            "created_at": "2022-10-19T11:54:47",
            "event_date": "2022-10-19T11:54:47",
            "installment_event_type": {
              "enumerator": "open",
              "translation_path": "co.InstallmentEventType.open"
            },
            "installment_old_status": {
              "enumerator": "created",
              "translation_path": "co.InstallmentStatus.created"
            },
            "old_due_date": null
          }
        ],
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "1f7b16fe-04b6-4f07-a807-eb3501e44e0d",
        "installment_number": 4,
        "installment_payment": [],
        "installment_status": {
          "enumerator": "opened",
          "translation_path": "co.InstallmentStatus.opened"
        },
        "installment_type": {
          "enumerator": "principal",
          "translation_path": "co.InstallmentType.principal"
        },
        "original_due_principal": 1575.08844271,
        "original_pre_fixed_amount": 45.8505547,
        "original_principal_amortization_amount": 506.4594453,
        "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": 45.8505547,
        "principal_amortization_amount": 506.4594453,
        "qr_code_key": "b55464c8-3764-4ee2-a814-ce22396aabe7",
        "qr_code_url": "00020126970014br.gov.bcb.pix2575qrcode-h.sandbox.qitech.app/bacen/cobv/b55464c8-3764-4ee2-a814-ce22396aabe75204000053039865802BR5925QI SOCIEDADE DE CREDITO D6009Sao Paulo61080145200062070503***63044215",
        "renegotiation_proposal_key": null,
        "tax_amount": 5.23273899,
        "total_accrual_amount": null,
        "total_amount": 552.31,
        "total_paid_amount": 0,
        "updated_at": "2022-10-19T11:56:43",
        "workdays": 23
      },
      {
        "accrual_reference_date": null,
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": "256be15f-dcc6-4775-8298-c3efde5a1147",
        "business_due_date": "2023-03-21",
        "calendar_days": 26,
        "cetip_settlements": [],
        "created_at": "2022-10-19T11:53:00",
        "digitable_line": "32990001031000699925352000000209192950000055231",
        "due_date": "2023-03-20",
        "due_interest": 0,
        "due_principal": 1068.62899741,
        "events": [
          {
            "amount": null,
            "created_at": "2022-10-19T11:54:47",
            "event_date": "2022-10-19T11:54:47",
            "installment_event_type": {
              "enumerator": "open",
              "translation_path": "co.InstallmentEventType.open"
            },
            "installment_old_status": {
              "enumerator": "created",
              "translation_path": "co.InstallmentStatus.created"
            },
            "old_due_date": null
          }
        ],
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "3ed37dc1-61f8-44f1-af21-a55f0cf0795d",
        "installment_number": 5,
        "installment_payment": [],
        "installment_status": {
          "enumerator": "opened",
          "translation_path": "co.InstallmentStatus.opened"
        },
        "installment_type": {
          "enumerator": "principal",
          "translation_path": "co.InstallmentType.principal"
        },
        "original_due_principal": 1068.62899741,
        "original_pre_fixed_amount": 23.02305805,
        "original_principal_amortization_amount": 529.28694195,
        "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": 23.02305805,
        "principal_amortization_amount": 529.28694195,
        "qr_code_key": "64e05528-83fb-432a-8af7-491ca4eb7b90",
        "qr_code_url": "00020126970014br.gov.bcb.pix2575qrcode-h.sandbox.qitech.app/bacen/cobv/64e05528-83fb-432a-8af7-491ca4eb7b905204000053039865802BR5925QI SOCIEDADE DE CREDITO D6009Sao Paulo61080145200062070503***630472F7",
        "renegotiation_proposal_key": null,
        "tax_amount": 6.59703244,
        "total_accrual_amount": null,
        "total_amount": 552.31,
        "total_paid_amount": 0,
        "updated_at": "2022-10-19T11:56:43",
        "workdays": 18
      },
      {
        "accrual_reference_date": null,
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": "a8c2edaa-ed3d-4c5b-808e-b26947a5e79e",
        "business_due_date": "2023-04-19",
        "calendar_days": 29,
        "cetip_settlements": [],
        "created_at": "2022-10-19T11:53:01",
        "digitable_line": "32990001031000699925353000000207293240000055232",
        "due_date": "2023-04-18",
        "due_interest": 0,
        "due_principal": 539.34205545,
        "events": [
          {
            "amount": null,
            "created_at": "2022-10-19T11:54:47",
            "event_date": "2022-10-19T11:54:47",
            "installment_event_type": {
              "enumerator": "open",
              "translation_path": "co.InstallmentEventType.open"
            },
            "installment_old_status": {
              "enumerator": "created",
              "translation_path": "co.InstallmentStatus.created"
            },
            "old_due_date": null
          }
        ],
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "2b58b2be-89cd-4710-a6a5-81180938b501",
        "installment_number": 6,
        "installment_payment": [],
        "installment_status": {
          "enumerator": "opened",
          "translation_path": "co.InstallmentStatus.opened"
        },
        "installment_type": {
          "enumerator": "principal",
          "translation_path": "co.InstallmentType.principal"
        },
        "original_due_principal": 539.34205545,
        "original_pre_fixed_amount": 12.97660456,
        "original_principal_amortization_amount": 539.34339544,
        "original_total_amount": 552.32,
        "paid_amount": 0,
        "paid_at": null,
        "payment_type": {
          "enumerator": "bankslip",
          "translation_path": "co.PaymentType.bankslip"
        },
        "post_fixed_amount": 0,
        "pre_fixed_amount": 12.97660456,
        "principal_amortization_amount": 539.34339544,
        "qr_code_key": "dcc7d257-e6a1-4d0a-88f7-1acf662482b5",
        "qr_code_url": "00020126970014br.gov.bcb.pix2575qrcode-h.sandbox.qitech.app/bacen/cobv/dcc7d257-e6a1-4d0a-88f7-1acf662482b55204000053039865802BR5925QI SOCIEDADE DE CREDITO D6009Sao Paulo61080145200062070503***6304C9A1",
        "renegotiation_proposal_key": null,
        "tax_amount": 8.00493468,
        "total_accrual_amount": null,
        "total_amount": 552.32,
        "total_paid_amount": 0,
        "updated_at": "2022-10-19T11:56:43",
        "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": [
          {
            "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
          }
        ],
        "birth_date": "1997-10-19",
        "birth_place": null,
        "cnae_code": null,
        "company_document_number": null,
        "created_at": "2022-10-19T11:53:01",
        "document_identification_date": null,
        "document_identification_number": "",
        "document_identification_type": null,
        "email": "wxr@ff.com",
        "foundation_date": null,
        "gender": null,
        "income": 0.01,
        "individual_document_number": "92147661180",
        "is_pep": false,
        "marital_status": {
          "enumerator": "single",
          "translation_path": "co.MaritalStatus.single"
        },
        "mother_name": null,
        "name": "Wxy  Wsx",
        "nationality": "nationality",
        "person_type": "natural",
        "phone": {
          "area_code": "00",
          "country_code": "055",
          "created_at": "2022-10-19T11:53:00",
          "number": "016048311",
          "phone_key": "341d7c67-963c-49a5-b585-265425d71f52",
          "phone_type": null
        },
        "profession": null,
        "property_system": null,
        "related_party_key": "203b2ada-ff3e-44a6-a843-f244aa1afbc9",
        "revenue": null,
        "role_type": {
          "enumerator": "issuer",
          "translation_path": "co.RoleType.issuer"
        },
        "simples_nacional_participant": null,
        "spouse_document_number": null,
        "trading_name": null
      }
    ],
    "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

Response Body

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

```

## Query Params
| Field | Type | Description                                                   | Characters |
|---|---|---------------------------------------------------------------| ---|
| `key` | string | Debt key returned at the moment of credit operation creation. | - |
| `requester_identifier_key` | string | Unique UUID4 key sent in credit operation creation payload.   | - |
| `issuer_document_number` | string | Número de documento do emitente.                              | - |
| `issuer_name` | string | Issuer's document number.                                     | - |
| `status` | string | Operation status.                                             | - |
| `page` | string | Current page being queried.                                   | - |
| `page_size` | string | Number of results that fit on the page.                       | - |
| `total_due_balance` | boolean | When sent as `true`, includes the `balance_due` field (operation's total outstanding balance) in the response. By default (`false` or absent), `balance_due` is **not** returned. | - |

:::tip Outstanding balance (`balance_due`)
The `balance_due` field represents the operation's total outstanding balance and is **only returned when the query is made with the `total_due_balance=true` parameter**. Without it, the response does not include the outstanding balance.

Example request:

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

---

# Debt Query by Contract Number

URL: /en/documentation/emissao_de_divida/consulta_por_contract_number

## Request

ENDPOINT /v2/credit_operation/contract_number/ CONTRACT-NUMBER
METHOD GET

## ⚠️ Important Note

If the contract number contains a forward slash (`/`), it is necessary to **encode the slash** as `%2F`.

### Practical example
**Original input:**
```
contract_number = 02159312/FGP
```

**Should be sent as:**
```
02159312%2FFGP
```

### Python example for encoding:
```python
import urllib.parse

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

:::

### Path params

| Field | Type | Description | Characters |
|---|---|---|---|   
| `contract_number` * | string | Credit contract number. | string |

## Response

STATUS 200

Response Body

```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
    },
    {
      "business_due_date": "2022-09-30",
      "due_date": "2022-09-29",
      "calendar_days": 31,
      "due_interest": 0,
      "due_principal": 643.63499424,
      "fine_amount": 0,
      "has_interest": true,
      "post_fixed_amount": 0,
      "pre_fixed_amount": 78.82,
      "principal_amortization_amount": 303.25,
      "tax_amount": 0.9,
      "total_amount": 382.07,
      "workdays": 22,
      "accrual_reference_date": null,
      "advanced_paid_amount": 0.0,
      "bank_slip_key": null,
      "digitable_line": null,
      "installment_key": "2a95a560-bec6-4207-9a38-98c72e023c59",
      "installment_status": "created",
      "installment_type": "principal",
      "original_due_principal": 643.63,
      "original_pre_fixed_amount": 78.82,
      "original_principal_amortization_amount": 303.25,
      "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": 2,
      "paid_at": null,
      "updated_at": null,
      "principal_amortization_payment_amount": 0,
      "prefixed_interest_payment_amount": 0
    },
    {
      "business_due_date": "2022-11-01",
      "due_date": "2022-10-31",
      "calendar_days": 32,
      "due_interest": 0,
      "due_principal": 340.38585509,
      "fine_amount": 0,
      "has_interest": true,
      "post_fixed_amount": 0,
      "pre_fixed_amount": 41.68,
      "principal_amortization_amount": 340.39,
      "tax_amount": 1.9,
      "total_amount": 382.07,
      "workdays": 21,
      "accrual_reference_date": null,
      "advanced_paid_amount": 0.0,
      "bank_slip_key": null,
      "digitable_line": null,
      "installment_key": "61924f59-11e3-49d0-9cf7-2a1d0ce54924",
      "installment_status": "created",
      "installment_type": "principal",
      "original_due_principal": 340.39,
      "original_pre_fixed_amount": 41.68,
      "original_principal_amortization_amount": 340.39,
      "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": 3,
      "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": [
    {
      "amount_type": {
        "enumerator": "percentage"
      },
      "fee_amount": 0.0,
      "tax_amount": 0.0,
      "irrf_amount": 0.0,
      "amount": 0.0,
      "pis_amount": 0.0,
      "amount_released": 0.0,
      "fee_type": {
        "enumerator": "tac"
      },
      "cofins_amount": 0.0,
      "csll_amount": 0.0,
      "description": null,
      "net_fee_amount": 0.0,
      "rebate_account": null,
      "billing_type": {
        "enumerator": "disbursement"
      },
      "created_at": "2025-10-14T22:18:07"
    },
    {
      "amount_type": {
        "enumerator": "absolute"
      },
      "fee_amount": 0.0,
      "tax_amount": 0.0,
      "irrf_amount": 0.0,
      "amount": 0.0,
      "pis_amount": 0.0,
      "amount_released": 0.0,
      "fee_type": {
        "enumerator": "spread_tax_free"
      },
      "cofins_amount": 0.0,
      "csll_amount": 0.0,
      "description": null,
      "net_fee_amount": 0.0,
      "rebate_account": null,
      "billing_type": {
        "enumerator": "disbursement"
      },
      "created_at": "2025-10-14T22:18:07"
    },
    {
      "amount_type": {
        "enumerator": "absolute"
      },
      "fee_amount": 0.0,
      "tax_amount": 0.0,
      "irrf_amount": 0.0,
      "amount": 0.0,
      "pis_amount": 0.0,
      "amount_released": 0.0,
      "fee_type": {
        "enumerator": "tac_tax_free"
      },
      "cofins_amount": 0.0,
      "csll_amount": 0.0,
      "description": null,
      "net_fee_amount": 0.0,
      "rebate_account": null,
      "billing_type": {
        "enumerator": "disbursement"
      },
      "created_at": "2025-10-14T22:18:07"
    }
  ]
}
```

STATUS 400

Response Body

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

---

# Debt Query by Credit Operation Key

URL: /en/documentation/emissao_de_divida/consulta_por_credit_operation_key

## Request

ENDPOINT /v2/credit_operation/ CREDIT-OPERATION-KEY
METHOD GET

### Path params

| Field | Type | Description | Characters |
|---|---|---|---|   
| `credit_operation_key` * | string | Credit operation key. | UUID |

### Query params

| Field | Type | Description | Default |
|---|---|---|---|
| `eval_present_value` | boolean | When `true`, calculates the present value of each installment and returns the `present_amount` field in each `installments` item, plus a root-level `present_amount` with the sum of all installments. Cannot be used for operations in status: `waiting_signature`, `signed`, `issued`, `canceled`, `canceled_permanently` or `amended`. | `false` |
| `calculate_delay` | boolean | Includes delay interest in the present value calculation. Only takes effect when `eval_present_value=true`. | `false` |
| `calculate_spread` | boolean | Includes spread in the present value calculation. Only takes effect when `eval_present_value=true`. | `true` |
| `present_value_reference_date` | string (date) | Reference date (`YYYY-MM-DD`) used as the basis for the present value calculation. Only takes effect when `eval_present_value=true`. | today |

## Response

STATUS 200

Response Body

**Without eval_present_value**

```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": [
    {
      "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
    },
    {
      "business_due_date": "2022-09-30",
      "due_date": "2022-09-29",
      "calendar_days": 31,
      "due_interest": 0,
      "due_principal": 643.63499424,
      "fine_amount": 0,
      "has_interest": true,
      "post_fixed_amount": 0,
      "pre_fixed_amount": 78.82,
      "principal_amortization_amount": 303.25,
      "tax_amount": 0.9,
      "total_amount": 382.07,
      "workdays": 22,
      "accrual_reference_date": null,
      "advanced_paid_amount": 0.0,
      "bank_slip_key": null,
      "digitable_line": null,
      "installment_key": "2a95a560-bec6-4207-9a38-98c72e023c59",
      "installment_status": "created",
      "installment_type": "principal",
      "original_due_principal": 643.63,
      "original_pre_fixed_amount": 78.82,
      "original_principal_amortization_amount": 303.25,
      "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": 2,
      "paid_at": null,
      "updated_at": null,
      "principal_amortization_payment_amount": 0,
      "prefixed_interest_payment_amount": 0
    },
    {
      "business_due_date": "2022-11-01",
      "due_date": "2022-10-31",
      "calendar_days": 32,
      "due_interest": 0,
      "due_principal": 340.38585509,
      "fine_amount": 0,
      "has_interest": true,
      "post_fixed_amount": 0,
      "pre_fixed_amount": 41.68,
      "principal_amortization_amount": 340.39,
      "tax_amount": 1.9,
      "total_amount": 382.07,
      "workdays": 21,
      "accrual_reference_date": null,
      "advanced_paid_amount": 0.0,
      "bank_slip_key": null,
      "digitable_line": null,
      "installment_key": "61924f59-11e3-49d0-9cf7-2a1d0ce54924",
      "installment_status": "created",
      "installment_type": "principal",
      "original_due_principal": 340.39,
      "original_pre_fixed_amount": 41.68,
      "original_principal_amortization_amount": 340.39,
      "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": 3,
      "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": [
    {
      "amount_type": {
        "enumerator": "percentage"
      },
      "fee_amount": 0.0,
      "tax_amount": 0.0,
      "irrf_amount": 0.0,
      "amount": 0.0,
      "pis_amount": 0.0,
      "amount_released": 0.0,
      "fee_type": {
        "enumerator": "tac"
      },
      "cofins_amount": 0.0,
      "csll_amount": 0.0,
      "description": null,
      "net_fee_amount": 0.0,
      "rebate_account": null,
      "billing_type": {
        "enumerator": "disbursement"
      },
      "created_at": "2025-10-14T22:18:07"
    },
    {
      "amount_type": {
        "enumerator": "absolute"
      },
      "fee_amount": 0.0,
      "tax_amount": 0.0,
      "irrf_amount": 0.0,
      "amount": 0.0,
      "pis_amount": 0.0,
      "amount_released": 0.0,
      "fee_type": {
        "enumerator": "spread_tax_free"
      },
      "cofins_amount": 0.0,
      "csll_amount": 0.0,
      "description": null,
      "net_fee_amount": 0.0,
      "rebate_account": null,
      "billing_type": {
        "enumerator": "disbursement"
      },
      "created_at": "2025-10-14T22:18:07"
    },
    {
      "amount_type": {
        "enumerator": "absolute"
      },
      "fee_amount": 0.0,
      "tax_amount": 0.0,
      "irrf_amount": 0.0,
      "amount": 0.0,
      "pis_amount": 0.0,
      "amount_released": 0.0,
      "fee_type": {
        "enumerator": "tac_tax_free"
      },
      "cofins_amount": 0.0,
      "csll_amount": 0.0,
      "description": null,
      "net_fee_amount": 0.0,
      "rebate_account": null,
      "billing_type": {
        "enumerator": "disbursement"
      },
      "created_at": "2025-10-14T22:18:07"
    }
  ]
}
```

**With eval_present_value=true**

```json
{
  "credit_operation_key": "eaf5836a-ea6f-4baa-ac26-ce5199dfa448",
  "issue_amount": 1006.77,
  "present_amount": 889.87,
  "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": [
    {
      "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,
      "present_amount": 296.62
    },
    {
      "business_due_date": "2022-09-30",
      "due_date": "2022-09-29",
      "calendar_days": 31,
      "due_interest": 0,
      "due_principal": 643.63499424,
      "fine_amount": 0,
      "has_interest": true,
      "post_fixed_amount": 0,
      "pre_fixed_amount": 78.82,
      "principal_amortization_amount": 303.25,
      "tax_amount": 0.9,
      "total_amount": 382.07,
      "workdays": 22,
      "accrual_reference_date": null,
      "advanced_paid_amount": 0.0,
      "bank_slip_key": null,
      "digitable_line": null,
      "installment_key": "2a95a560-bec6-4207-9a38-98c72e023c59",
      "installment_status": "created",
      "installment_type": "principal",
      "original_due_principal": 643.63,
      "original_pre_fixed_amount": 78.82,
      "original_principal_amortization_amount": 303.25,
      "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": 2,
      "paid_at": null,
      "updated_at": null,
      "principal_amortization_payment_amount": 0,
      "prefixed_interest_payment_amount": 0,
      "present_amount": 296.62
    },
    {
      "business_due_date": "2022-11-01",
      "due_date": "2022-10-31",
      "calendar_days": 32,
      "due_interest": 0,
      "due_principal": 340.38585509,
      "fine_amount": 0,
      "has_interest": true,
      "post_fixed_amount": 0,
      "pre_fixed_amount": 41.68,
      "principal_amortization_amount": 340.39,
      "tax_amount": 1.9,
      "total_amount": 382.07,
      "workdays": 21,
      "accrual_reference_date": null,
      "advanced_paid_amount": 0.0,
      "bank_slip_key": null,
      "digitable_line": null,
      "installment_key": "61924f59-11e3-49d0-9cf7-2a1d0ce54924",
      "installment_status": "created",
      "installment_type": "principal",
      "original_due_principal": 340.39,
      "original_pre_fixed_amount": 41.68,
      "original_principal_amortization_amount": 340.39,
      "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": 3,
      "paid_at": null,
      "updated_at": null,
      "principal_amortization_payment_amount": 0,
      "prefixed_interest_payment_amount": 0,
      "present_amount": 296.63
    }
  ],
  "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": [
    {
      "amount_type": {
        "enumerator": "percentage"
      },
      "fee_amount": 0.0,
      "tax_amount": 0.0,
      "irrf_amount": 0.0,
      "amount": 0.0,
      "pis_amount": 0.0,
      "amount_released": 0.0,
      "fee_type": {
        "enumerator": "tac"
      },
      "cofins_amount": 0.0,
      "csll_amount": 0.0,
      "description": null,
      "net_fee_amount": 0.0,
      "rebate_account": null,
      "billing_type": {
        "enumerator": "disbursement"
      },
      "created_at": "2025-10-14T22:18:07"
    },
    {
      "amount_type": {
        "enumerator": "absolute"
      },
      "fee_amount": 0.0,
      "tax_amount": 0.0,
      "irrf_amount": 0.0,
      "amount": 0.0,
      "pis_amount": 0.0,
      "amount_released": 0.0,
      "fee_type": {
        "enumerator": "spread_tax_free"
      },
      "cofins_amount": 0.0,
      "csll_amount": 0.0,
      "description": null,
      "net_fee_amount": 0.0,
      "rebate_account": null,
      "billing_type": {
        "enumerator": "disbursement"
      },
      "created_at": "2025-10-14T22:18:07"
    },
    {
      "amount_type": {
        "enumerator": "absolute"
      },
      "fee_amount": 0.0,
      "tax_amount": 0.0,
      "irrf_amount": 0.0,
      "amount": 0.0,
      "pis_amount": 0.0,
      "amount_released": 0.0,
      "fee_type": {
        "enumerator": "tac_tax_free"
      },
      "cofins_amount": 0.0,
      "csll_amount": 0.0,
      "description": null,
      "net_fee_amount": 0.0,
      "rebate_account": null,
      "billing_type": {
        "enumerator": "disbursement"
      },
      "created_at": "2025-10-14T22:18:07"
    }
  ]
}
```

STATUS 400

Response Body

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

---

# Debt Inquiry by Requester Identifier Key

URL: /en/documentation/emissao_de_divida/consulta_por_requester_identifier_key

## Request

ENDPOINT /v2/credit_operation/requester_identifier_key/ REQUESTER-IDENTIFIER-KEY
METHOD GET

### Path params

| Field | Type | Description | Characters |
|---|---|---|---|   
| `requester_identifier_key` * | string | UUID4 key sent during debt creation. | UUID |

### Query params

| Field | Type | Description | Default |
|---|---|---|---|
| `eval_present_value` | boolean | When `true`, calculates the present value of each installment and returns the `present_amount` field in each `installments` item, plus a root-level `present_amount` with the sum of all installments. Cannot be used for operations in status: `waiting_signature`, `signed`, `issued`, `canceled`, `canceled_permanently` or `amended`. | `false` |
| `calculate_delay` | boolean | Includes delay interest in the present value calculation. Only takes effect when `eval_present_value=true`. | `false` |
| `calculate_spread` | boolean | Includes spread in the present value calculation. Only takes effect when `eval_present_value=true`. | `true` |
| `present_value_reference_date` | string (date) | Reference date (`YYYY-MM-DD`) used as the basis for the present value calculation. Only takes effect when `eval_present_value=true`. | today |

## Response

STATUS 200

Response Body

**Without eval_present_value**

```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": [
    {
      "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
    },
    {
      "business_due_date": "2022-09-30",
      "due_date": "2022-09-29",
      "calendar_days": 31,
      "due_interest": 0,
      "due_principal": 643.63499424,
      "fine_amount": 0,
      "has_interest": true,
      "post_fixed_amount": 0,
      "pre_fixed_amount": 78.82,
      "principal_amortization_amount": 303.25,
      "tax_amount": 0.9,
      "total_amount": 382.07,
      "workdays": 22,
      "accrual_reference_date": null,
      "advanced_paid_amount": 0.0,
      "bank_slip_key": null,
      "digitable_line": null,
      "installment_key": "2a95a560-bec6-4207-9a38-98c72e023c59",
      "installment_status": "created",
      "installment_type": "principal",
      "original_due_principal": 643.63,
      "original_pre_fixed_amount": 78.82,
      "original_principal_amortization_amount": 303.25,
      "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": 2,
      "paid_at": null,
      "updated_at": null,
      "principal_amortization_payment_amount": 0,
      "prefixed_interest_payment_amount": 0
    },
    {
      "business_due_date": "2022-11-01",
      "due_date": "2022-10-31",
      "calendar_days": 32,
      "due_interest": 0,
      "due_principal": 340.38585509,
      "fine_amount": 0,
      "has_interest": true,
      "post_fixed_amount": 0,
      "pre_fixed_amount": 41.68,
      "principal_amortization_amount": 340.39,
      "tax_amount": 1.9,
      "total_amount": 382.07,
      "workdays": 21,
      "accrual_reference_date": null,
      "advanced_paid_amount": 0.0,
      "bank_slip_key": null,
      "digitable_line": null,
      "installment_key": "61924f59-11e3-49d0-9cf7-2a1d0ce54924",
      "installment_status": "created",
      "installment_type": "principal",
      "original_due_principal": 340.39,
      "original_pre_fixed_amount": 41.68,
      "original_principal_amortization_amount": 340.39,
      "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": 3,
      "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": [
    {
      "amount_type": {
        "enumerator": "percentage"
      },
      "fee_amount": 0.0,
      "tax_amount": 0.0,
      "irrf_amount": 0.0,
      "amount": 0.0,
      "pis_amount": 0.0,
      "amount_released": 0.0,
      "fee_type": {
        "enumerator": "tac"
      },
      "cofins_amount": 0.0,
      "csll_amount": 0.0,
      "description": null,
      "net_fee_amount": 0.0,
      "rebate_account": null,
      "billing_type": {
        "enumerator": "disbursement"
      },
      "created_at": "2025-10-14T22:18:07"
    },
    {
      "amount_type": {
        "enumerator": "absolute"
      },
      "fee_amount": 0.0,
      "tax_amount": 0.0,
      "irrf_amount": 0.0,
      "amount": 0.0,
      "pis_amount": 0.0,
      "amount_released": 0.0,
      "fee_type": {
        "enumerator": "spread_tax_free"
      },
      "cofins_amount": 0.0,
      "csll_amount": 0.0,
      "description": null,
      "net_fee_amount": 0.0,
      "rebate_account": null,
      "billing_type": {
        "enumerator": "disbursement"
      },
      "created_at": "2025-10-14T22:18:07"
    },
    {
      "amount_type": {
        "enumerator": "absolute"
      },
      "fee_amount": 0.0,
      "tax_amount": 0.0,
      "irrf_amount": 0.0,
      "amount": 0.0,
      "pis_amount": 0.0,
      "amount_released": 0.0,
      "fee_type": {
        "enumerator": "tac_tax_free"
      },
      "cofins_amount": 0.0,
      "csll_amount": 0.0,
      "description": null,
      "net_fee_amount": 0.0,
      "rebate_account": null,
      "billing_type": {
        "enumerator": "disbursement"
      },
      "created_at": "2025-10-14T22:18:07"
    }
  ]
}
```

**With eval_present_value=true**

```json
{
  "credit_operation_key": "eaf5836a-ea6f-4baa-ac26-ce5199dfa448",
  "issue_amount": 1006.77,
  "present_amount": 889.87,
  "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": [
    {
      "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,
      "present_amount": 296.62
    },
    {
      "business_due_date": "2022-09-30",
      "due_date": "2022-09-29",
      "calendar_days": 31,
      "due_interest": 0,
      "due_principal": 643.63499424,
      "fine_amount": 0,
      "has_interest": true,
      "post_fixed_amount": 0,
      "pre_fixed_amount": 78.82,
      "principal_amortization_amount": 303.25,
      "tax_amount": 0.9,
      "total_amount": 382.07,
      "workdays": 22,
      "accrual_reference_date": null,
      "advanced_paid_amount": 0.0,
      "bank_slip_key": null,
      "digitable_line": null,
      "installment_key": "2a95a560-bec6-4207-9a38-98c72e023c59",
      "installment_status": "created",
      "installment_type": "principal",
      "original_due_principal": 643.63,
      "original_pre_fixed_amount": 78.82,
      "original_principal_amortization_amount": 303.25,
      "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": 2,
      "paid_at": null,
      "updated_at": null,
      "principal_amortization_payment_amount": 0,
      "prefixed_interest_payment_amount": 0,
      "present_amount": 296.62
    },
    {
      "business_due_date": "2022-11-01",
      "due_date": "2022-10-31",
      "calendar_days": 32,
      "due_interest": 0,
      "due_principal": 340.38585509,
      "fine_amount": 0,
      "has_interest": true,
      "post_fixed_amount": 0,
      "pre_fixed_amount": 41.68,
      "principal_amortization_amount": 340.39,
      "tax_amount": 1.9,
      "total_amount": 382.07,
      "workdays": 21,
      "accrual_reference_date": null,
      "advanced_paid_amount": 0.0,
      "bank_slip_key": null,
      "digitable_line": null,
      "installment_key": "61924f59-11e3-49d0-9cf7-2a1d0ce54924",
      "installment_status": "created",
      "installment_type": "principal",
      "original_due_principal": 340.39,
      "original_pre_fixed_amount": 41.68,
      "original_principal_amortization_amount": 340.39,
      "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": 3,
      "paid_at": null,
      "updated_at": null,
      "principal_amortization_payment_amount": 0,
      "prefixed_interest_payment_amount": 0,
      "present_amount": 296.63
    }
  ],
  "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": [
    {
      "amount_type": {
        "enumerator": "percentage"
      },
      "fee_amount": 0.0,
      "tax_amount": 0.0,
      "irrf_amount": 0.0,
      "amount": 0.0,
      "pis_amount": 0.0,
      "amount_released": 0.0,
      "fee_type": {
        "enumerator": "tac"
      },
      "cofins_amount": 0.0,
      "csll_amount": 0.0,
      "description": null,
      "net_fee_amount": 0.0,
      "rebate_account": null,
      "billing_type": {
        "enumerator": "disbursement"
      },
      "created_at": "2025-10-14T22:18:07"
    },
    {
      "amount_type": {
        "enumerator": "absolute"
      },
      "fee_amount": 0.0,
      "tax_amount": 0.0,
      "irrf_amount": 0.0,
      "amount": 0.0,
      "pis_amount": 0.0,
      "amount_released": 0.0,
      "fee_type": {
        "enumerator": "spread_tax_free"
      },
      "cofins_amount": 0.0,
      "csll_amount": 0.0,
      "description": null,
      "net_fee_amount": 0.0,
      "rebate_account": null,
      "billing_type": {
        "enumerator": "disbursement"
      },
      "created_at": "2025-10-14T22:18:07"
    },
    {
      "amount_type": {
        "enumerator": "absolute"
      },
      "fee_amount": 0.0,
      "tax_amount": 0.0,
      "irrf_amount": 0.0,
      "amount": 0.0,
      "pis_amount": 0.0,
      "amount_released": 0.0,
      "fee_type": {
        "enumerator": "tac_tax_free"
      },
      "cofins_amount": 0.0,
      "csll_amount": 0.0,
      "description": null,
      "net_fee_amount": 0.0,
      "rebate_account": null,
      "billing_type": {
        "enumerator": "disbursement"
      },
      "created_at": "2025-10-14T22:18:07"
    }
  ]
}
```

STATUS 400

Response Body

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

---

# Operation Disbursement

URL: /en/documentation/emissao_de_divida/desembolso_da_operacao

The disbursement of an operation is the release of funds originating from the credit contract. At QI Tech, the disbursement method follows the credit product configurations as specified in the disbursement settings.

:::info Information
By default, operations are disbursed via PIX to the account sent for the operation, but there are five
options that can be selected:

**1- Pix with account information**;

**2- Pix with key**;

**3- TED**;

**4- QR code Pix**;

**5- Boleto**;

They have specific fields and are detailed in the "disbursement_bank_accounts" key of the contract issuance.
:::

QI Tech's disbursement routine runs every minute, checking if all requirements configured for the product have been met for that specific contract and changing its status.

## Disbursement Requirements

- **Disbursement date**

The operation's credit contract is only disbursed on the date defined as "disbursement_date".

- **Credit contract issued and signed**

The operation's credit contract must be issued and signed.

- **Collateral established**

In the case of operations that require guarantees, the collateral must be established for the disbursement to proceed.

- **Disbursement approval**

If the "disbursement approval" configuration is active, the contract will only be disbursed after the approval API call.

- **Operations with down payment need to be paid**

If the created operation has a down payment parameter, disbursement only occurs after payment and financial settlement in the QI Tech system.

- **Limit alignment**

It is necessary that available credit limit exists for the operation to be disbursed.

---

# Personal Debt Issuance

URL: /en/documentation/emissao_de_divida/emissao/emissao_de_divida_pf

With the debt issuance API, it is possible to request the issuance of a debt for an individual. 
It is not necessary to pre-register the borrower; simply provide the registration details at the time of the debt request.

:::danger Attention!

QI Tech offers a solution for onboarding new clients and anti-fraud.

[Check out the documentation for these APIs here..](https://www.zaig.com.br/en/devcenter.html)

To receive a quote, contact our sales team:

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

The debt API is designed to be executed in just one request, after a prior upload of files ([document upload](../../upload_de_documentos)).
The header and body signature format for this request is described in detail
[here](../../primeiros_passos/teste_de_autenticacao).

## Request

ENDPOINT /debt
METHOD POST

Request Body

```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": {
        "amount": 123456,
        "interest_type": "pre_price_days",
        "credit_operation_type": "ccb",
        "annual_interest_rate": 2.32,
        "disbursement_date": "2023-03-01",
        "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"
}
```

## Response

The response to this debt request will return the payment plan as well as a DEBT-KEY, which is the debt identifier in QI SCD.

STATUS 200

Response Body

```json
{
  "data": {
    "additional_iof": 469.1328,
    "annual_cet": "283,3821%",
    "assignment_amount": 124690.56,
    "base_iof": 473.6829374063069,
    "borrower": {
      "document_number": "96969879003",
      "name": "Alan Mathison Turing"
    },
    "cet": "11,8500%",
    "collaterals": [],
    "contract": {
      "number": "0000067563/AMT",
      "signature_information": [
        {
          "signature_url": null,
          "signer_document_number": "15627918004",
          "signer_email": "alan.turing@email.com",
          "signer_external_key": null,
          "signer_name": "Alan Mathison Turing",
          "signer_role": "issuer"
        }
      ],
      "urls": [
        "https://storage.googleapis.com/sandbox-doc-api/documents/5af36fcd-8e4c-4421-ad45-7bcba899c0d3/SYNGENTASANDBOX-ALAN_MATHISON_TURING-CCB-0000067563-20230302234816.pdf"
      ]
    },
    "contract_fee_amount": 1234.56,
    "contract_fees": [
      {
        "fee_amount": 1234.56,
        "fee_type": "tac"
      }
    ],
    "external_contract_fee_amount": 1234.56,
    "external_contract_fees": [
      {
        "fee_amount": 1234.56,
        "fee_type": "spread",
        "net_fee_amount": 1120.36,
        "tax_amount": 114.2
      }
    ],
    "installments": [
      {
        "accrual_reference_date": null,
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2023-04-03",
        "calendar_days": 31,
        "digitable_line": null,
        "due_date": "2023-04-02",
        "due_interest": 0,
        "due_principal": 123456,
        "fine_amount": null,
        "has_interest": true,
        "installment_history": [],
        "installment_key": "da264e95-2bbd-47de-876b-bfea7d25e266",
        "installment_number": 1,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 123456,
        "original_pre_fixed_amount": 13245.468714162304,
        "original_principal_amortization_amount": 58473.151285837695,
        "original_total_amount": 71718.62,
        "paid_amount": 0,
        "paid_at": null,
        "post_fixed_amount": 0,
        "pre_fixed_amount": 13245.468714162304,
        "principal_amortization_amount": 58473.151285837695,
        "qr_code_key": null,
        "qr_code_url": null,
        "renegotiation_proposal_key": null,
        "tax_amount": 148.63875056859942,
        "total_accrual_amount": null,
        "total_amount": 71718.62,
        "total_paid_amount": 0,
        "workdays": 21
      },
      {
        "accrual_reference_date": null,
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2023-05-02",
        "calendar_days": 30,
        "digitable_line": null,
        "due_date": "2023-05-02",
        "due_interest": 0,
        "due_principal": 64982.848714162305,
        "fine_amount": null,
        "has_interest": true,
        "installment_history": [],
        "installment_key": "cac7064b-2310-45e1-a91f-5e8f39f0f0ea",
        "installment_number": 2,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 64982.848714162305,
        "original_pre_fixed_amount": 6735.77577015044,
        "original_principal_amortization_amount": 64982.84422984956,
        "original_total_amount": 71718.62,
        "paid_amount": 0,
        "paid_at": null,
        "post_fixed_amount": 0,
        "pre_fixed_amount": 6735.77577015044,
        "principal_amortization_amount": 64982.84422984956,
        "qr_code_key": null,
        "qr_code_url": null,
        "renegotiation_proposal_key": null,
        "tax_amount": 325.0441868377075,
        "total_accrual_amount": null,
        "total_amount": 71718.62,
        "total_paid_amount": 0,
        "workdays": 19
      }
    ],
    "iof_charge_method": "financed",
    "issue_amount": 123456,
    "net_external_contract_fee_amount": 1120.36,
    "number_of_installments": 2,
    "prefixed_interest_rate": {
      "annual_rate": 2.32,
      "created_at": "2023-03-02T23:48:15",
      "daily_rate": 0.00329298,
      "interest_base": "calendar_days_365",
      "monthly_rate": 0.10516767
    },
    "requester_identifier_key": "1c2ca4dc-2a20-4dd4-bd5f-af143fadadf4",
    "total_iof": 942.82,
    "total_pre_fixed_amount": 19981.244484312745
  },
  "event_datetime": "2023-03-02 23:48:20",
  "key": "1c2ca4dc-2a20-4dd4-bd5f-af143fadadf4",
  "status": "waiting_signature",
  "webhook_type": "debt"
}
```

## Definições

### Object Request Body
| Field                           | Type   | Description                                                                                                                                                                                                        | Max. Caract. | 
|---------------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| **borrower** *                  | object | **[Object Borrower](#object-borrower)** - Credit operation debtor
                                                                                                                                         | -            | 
| **disbursement_bank_account** * | object | **[Object Disbursement Bank Account](#object-disbursement_bank_accounts)** - Bank account details for the operation disbursement                                                                                | -            |
| **financial** *                 | object | **[Object Financial](#object-financial)** - Bank account details for the operation disbursement. Identifier indicating that the sent object is an individual. It must ALWAYS contain the value "natural" for individual borrowers. | -            |
| **purchaser_document_number** * | string | CNPJ of the credit operation assignee (buyer)                                                                                                                                                           | -            |

### Object Borrower
| Field                            | Type    | Description                                                                             | Max. Caract. | 
|----------------------------------|---------|---------------------------------------------------------------------------------------|--------------|
| **name** *                       | string  | Borrower's name                                                                       | 100          |
| **email**                        | string  | Borrower's email                                                                      | 254          |
| **phone**                        | object  | **[Object Phone](#object-phone)** - Borrower's contact phone                    | -            | 
| **is_pep** *                     | boolean | PEP indicator (http://www.portaldatransparencia.gov.br/download-de-dados/pep)      | -            |
| **address** *                    | object  | **[Object Address](#object-address)** - Borrower's address                           | -            | 
| **role_type** *                  | enum    | default: _issuer_                                                                     | -            |
| **birth_date** *                 | date    | Borrower's date of birth (format "YYYY-MM-DD")                                  | -            |
| **mother_name** *                | string  | Borrower's mother's name                                                               | 100          |
| **nationality**                  | string  | Borrower's nationality                                                              | 50           |
| **person_type** *                | string  | Individual indicator - default: _natural_                                       | -            |
| **individual_document_number** * | string  | Borrower's CPF (numbers only)                                                       | 11           |
| **document_identification**     * | string  | DOCUMENT_KEY of the Borrower's photo identification document PDF (RG or CNH) | -            |
| **document_identification_back** |string | DOCUMENT_KEY of the PDF of the back side of the photo identification document (RG or CNH) (previously sent) | 11 |
| **wedding_certificate**          | string | DOCUMENT_KEY of the marriage certificate PDF (previously sent). If marital_status is "single," the value of this field must be NULL.. | 11 |
| **proof_of_residence** *    |string | DOCUMENT_KEY of the address proof PDF (previously sent). | 11 |

### Object Address
| Field              | Type   | Description                                                                | Max. Caract. | 
|--------------------|--------|--------------------------------------------------------------------------|--------------| 
| **city** *         | string |  City                                                       | 100          |
| **state** *        | string |  State (with two uppercase characters)                      | 2            |
| **number** *       | string | Number                                                       | 10           |
| **street** *       | string | Street                                                          | 100          |
| **complement** *   | string | Address complement (free text)                                    | 100          |
| **postal_code** *  | string | Postal Code (http://www.buscacep.correios.com.br/sistemas/buscacep/) | 8            |
| **neighborhood** * | string | Neighborhood                                                       | 100          |

### Object Phone
| Field              | Description | Example                                               | Max. Caract. | 
|--------------------|-----------|-------------------------------------------------------|--------------| 
| **number** *       | string    | Phone number                                    | 10           |
| **area_code** *    | string    | Phone area code (DDD) (https://ddd.guiamais.com.br/) | 2            |
| **country_code** * | string    | Phone DDI code (https://ddi.guiamais.com.br/) | 3            |

### Object Disbursement Bank Account

A debt issuance must contain the disbursement bank account information, typically an account held by the debtor.

| Field                 | Type   | Description                                                                                          | Max. Caract. | 
|-----------------------|--------|----------------------------------------------------------------------------------------------------|--------------|
| name                  | string | Account owner's name                                                                           | 50           |
| document_number       | string | Account owner's CPF                                                                            | 11           |
| bank_code *           | string | Financial institution's COMPE code (https://www.bcb.gov.br/pom/spb/estatistica/port/ASTR003.pdf) | 3            |
| branch_number *       | string | Branch number (do not include the branch check digit!)                                  | 4            |
| account_number *      | string | Account number (without the account check digit!)                                               | 10           |
| account_digit *       | string | Account check digit (use zero in place of letters)                                     | 1            |
| account_type          | enum   | [Enumerador Account Type](#enumerador-account-type) Account type                                  | 1            |

### Object Financial

The financial object describes the financial information of the credit operation.

| Field                      | Type   | Description                                                                                                     | Max. Caract. |
|----------------------------|--------|---------------------------------------------------------------------------------------------------------------|--------------|
| **amout**                  | float  | Issuance/Nominal value of the credit operation                                                               | -            |
| **interest_type**          | object | **[Enumerador Interest Type](#enumerador-interest-type)** - Amortization method and interest calculation method | -            |
| **credit_operation_type**  | object | **[Enumerador Credit Operation Type](#enumerador-credit-operation-type)** - Credit contract type       | -            |
| **annual_interest_rate**   | float  | Pre-fixed interest rate expressed in decimal per year                                                           | -            |
| **disbursement_date**      | date   | Operation disbursement date                                                                                | -            |
| **interest_grace_period**  | int    | Interest grace period (in months)                                                                                  | -            |
| **principal_grace_period** | int    | Principal grace period                                                                                 | -            |
| **number_of_installments** | int    | Number of installments of the credit operation                                                                     | -            |
| **fine_configuration**     | object | **[Object Fine Configuration](#object-fine-configuration)** - Late interest and penalty configuration        | -            |

### Object Fine Configuration

In the Fine Configuration object, the penalty and interest values for late payment in the credit operation are specified.

| Field                  | Type  | Description                                                                            | Max. Caract. |
|------------------------|-------|--------------------------------------------------------------------------------------|--------------|
| **contract_fine_rate** | float | Penalty rate for delay                                                       | -            |
| **interest_base**      | enum  | **[Enumerador Interest Base](#enumerador-interest-base)** - Interest calculation base | -            |
| **monthly_rate**       | float | Monthly late interest rate                                                 | -            |

### Object Rebates
| Field                           | Type   | Description                                                                                                                                                                                                        | Max. Caract. | 
|---------------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| **fee_type** *                  | enum | Fee type.                                                                                                                                   | -            | 
| **amount_type** * | object | Type of the amount to be charged.                                                                                 | -            |
| **amount** *                 | object | Fee amount. If the fee type is percentage, the value must be between 0 and 100. | -            |

### Response Body
| Field                      | Type   | Description                                                      | Max. Caract. |
|----------------------------|--------|----------------------------------------------------------------|--------------|
| **data[n].data**           | object | **[Object Data](#object-data)**                                | -            |
| **data[n].event_datetime** | date   | Moment of credit operation generation                      | -            |
| **data[n].key**            | string | **DEBT-KEY** - Unique key of the credit operation within QI | -            |
| **data[n].status**         | string | **[Possívies Status de uma dívida](../status_de_uma_divida)**     | -            |
| **data[n].type**           | string | _debt_                                                         | -            |

# Enumerators

### Person Type Enumerators_
| Enumerator             | Description             |
|------------------------|-----------------------|
| **legal**   | Corporate        |
| **natural**    | Person    |

### Amount Type_Enumerators
| Enumerator             | Description             |
|------------------------|-----------------------|
| **tac**   | Fee charged to the borrower. |
| **spread**    | Fee charged to the fund added to the operation's transfer price.    |

### Account Type_Enumerators
| Enumerator             | Description             |
|------------------------|-----------------------|
| **checking_account**   | checking account        |
| **deposit_account**    | deposit account     |
| **guaranteed_account** | guaranteed account     |
| **investment_account** | investment account |
| **payment_account**    | payment account    |
| **saving_account**     | saving account        |
| **salary_account**     | salary account         |

### Interest Type Enumerators_
| Enumerator           | Description                                                                                                                                                                |
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **pre_price_days**   | Price amortization method (equal installments) with calculation of pre-fixed interest per day                                                                                     |
| **pre_price**        | Price amortization method (equal installments) with pre-fixed interest calculation in fixed periods (30 days)                                                                |
| **pre_sac**          | SAC amortization method (constant amortization) with pre-fixed interest calculation per day                                                                                 |
| **post_sac**         | SAC amortization method (constant amortization) with interest calculation based on a pre-fixed rate + post-fixed indexer (CDI, IPCA, or IGPM) per day                  |
| **post_price**       | Price amortization method (equal installments) with interest calculation based on a pre-fixed rate + post-fixed indexer (CDI, IPCA, or IGPM) in fixed periods (30 days) |
| **post_price_days**  | Price amortization method (equal installments) with interest calculation based on a pre-fixed rate + post-fixed indexer (CDI, IPCA, or IGPM) per day                      |

### Credit Operation Type_Enumerators
| Enumerador    | Description                      |
|---------------|--------------------------------|
| **ccb**       | "Cédula de Crédito Bancário"     |
| **cce**       | "Cédula de Crédito à Exportação" |
| **cci**       | "Cédula de Crédito Imobiliário"  |
| **nce**       | "Nota de Crédito à Exportação"   |

### Interest Base_Enumerators
| Enumerador            | Description                                                                 |
|-----------------------|---------------------------------------------------------------------------|
| **workdays**          | Interest calculation base in business days considering a year of 252 days    |
| **calendar_days**     | Interest calculation base in calendar days considering a year of 360 days |
| **calendar_days_365** | Interest calculation base in calendar days considering a year of 365 days |

### Fee Type_Enumerators
Each type of fee must be enabled and configured in advance by QI Tech.

| Enumerador            | Description                                                                  |
|-----------------------|----------------------------------------------------------------------------|
| **tac**               | Registration opening fee                                             |
| **spread**            | Spread charged on the acquisition value of the credit operation                  |
| **warranty_analysis** | Warrantly analysis fee                                             |
| **ted_fee**           | TED fee                                                              |
| **spread_ted_fee**    | TED fee spread charged on the acquisition value of the credit operation |

---

# Issuance of Corporate debt

URL: /en/documentation/emissao_de_divida/emissao/emissao_de_divida_pj

With the debt issuance API, it is possible to request the issuance of a debt for a legal entity. 
It is not necessary to pre-register the borrower; simply provide the registration details at the time of the debt request.

:::danger Attention!

QI Tech offers a solution for onboarding new clients and anti-fraud.

[Check out the documentation for these APIs here..](https://www.zaig.com.br/en/devcenter.html)

To receive a quote, contact our sales team:

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

The debt API is designed to be executed in just one request, after a prior upload of files ([document upload](../../upload_de_documentos)).
The header and body signature format for this request is described in detail
[here](../../primeiros_passos/teste_de_autenticacao).

## Request

ENDPOINT /debt
METHOD POST

Request Body

```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,
                "spouse": {
                    "name": "NOME CONJUGE REPRESENTANTE",
                    "email": "conjugerepresentante@email.com",
                    "phone": {
                        "number": "988881234",
                        "area_code": "11",
                        "country_code": "055"
                    },
                    "birth_date": "1994-12-04",
                    "person_type": "natural",
                    "is_pep": false,
                    "mother_name": "NOME DA MAE DO CONJUGE DO REPRESENTANTE",
                    "individual_document_number": "26571990032",
                    "document_identification_number": "10101010100",
                    "address": {
                        "city": "São Paulo",
                        "state": "SP",
                        "number": "215",
                        "street": "Rua Gilberto Sabino",
                        "complement": "3 andar",
                        "postal_code": "05425020",
                        "neighborhood": "Pinheiros"
                    }
                },
                "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"
}

```

## Response

The response to this debt request will return the payment plan as well as a DEBT-KEY, which is the debt identifier in QI SCD.

STATUS 200

Response Body

```json
{
  "data": {
    "additional_iof": 38.57988,
    "annual_cet": "71,3492%",
    "assignment_amount": 10254.13,
    "base_iof": 12.487704111671501,
    "borrower": {
      "document_number": "80282008000127",
      "name": "RAZAO SOCIAL EMPRESA",
      "related_party_key": "7620181e-f46a-45c1-a4ea-60439b9662ad"
    },
    "cet": "4,5900%",
    "collaterals": [],
    "contract": {
      "number": "0000069971/RSE",
      "signature_information": [
        {
          "signature_url": null,
          "signer_document_number": "31057466093",
          "signer_email": "nomedorepresentante@email.com",
          "signer_external_key": null,
          "signer_name": "NOME DO REPRESENTANTE",
          "signer_role": "issuer"
        }
      ],
      "urls": [
        "https://storage.googleapis.com/sandbox-doc-api/documents/df3e4530-3deb-4ba8-ad4e-c28ebeffb831/20230504122831.pdf"
      ]
    },
    "contract_fee_amount": 101.53,
    "contract_fees": [
      {
        "fee_amount": 101.53,
        "fee_type": "tac"
      }
    ],
    "external_contract_fee_amount": 101.53,
    "external_contract_fees": [
      {
        "fee_amount": 101.53,
        "fee_type": "spread",
        "net_fee_amount": 92.14,
        "tax_amount": 9.39
      },
      {
        "fee_amount": 0,
        "fee_type": "tac",
        "net_fee_amount": 0,
        "tax_amount": 0
      }
    ],
    "installments": [
      {
        "accrual_reference_date": null,
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2023-06-05",
        "calendar_days": 30,
        "digitable_line": null,
        "due_date": "2023-06-03",
        "due_interest": 0,
        "due_principal": 10152.6,
        "fine_amount": null,
        "has_interest": true,
        "installment_history": [],
        "installment_key": "0eb42a83-557a-437a-9819-099b5364cde9",
        "installment_number": 1,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 10152.6,
        "original_pre_fixed_amount": 300.3450311613816,
        "original_principal_amortization_amount": 10152.60496883862,
        "original_total_amount": 10452.95,
        "paid_amount": 0,
        "paid_at": null,
        "post_fixed_amount": 0,
        "pre_fixed_amount": 300.3450311613816,
        "principal_amortization_amount": 10152.60496883862,
        "qr_code_key": null,
        "qr_code_url": null,
        "renegotiation_proposal_key": null,
        "tax_amount": 12.487704111671501,
        "total_accrual_amount": null,
        "total_amount": 10452.95,
        "total_paid_amount": 0,
        "workdays": 21
      }
    ],
    "iof_charge_method": "financed",
    "issue_amount": 10152.6,
    "net_external_contract_fee_amount": 92.14,
    "number_of_installments": 1,
    "prefixed_interest_rate": {
      "annual_rate": 0.42576089,
      "created_at": "2023-05-04T12:28:30",
      "daily_rate": 0.00097227,
      "interest_base": "calendar_days_365",
      "monthly_rate": 0.03
    },
    "requester_identifier_key": "feceb7fe-1305-45eb-899d-c87d36bcc534",
    "total_iof": 51.07,
    "total_pre_fixed_amount": 300.3450311613816
  },
  "event_datetime": "2023-05-04 12:28:35",
  "key": "feceb7fe-1305-45eb-899d-c87d36bcc534",
  "status": "waiting_signature",
  "webhook_type": "debt"
}

```

### Object Request Body
| Field                           | Type   | Description                                                                                                                                                                                                        | Max. Caract. | 
|---------------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| **borrower** *                  | object | **[Object Borrower](#object-borrower)** - Credit operation borrower                                                                                                                                         | -            |
| **guarantor**                   | object | **[Object Guarantor](#object-borrower)** - Credit operation guarantors                                                                                                                       | -            |  
| **disbursement_bank_account** * | object | **[Object Disbursement Bank Account](#object-disbursement_bank_accounts)** - Bank account details for the operation disbursement                                                                                 | -            |
| **financial** *                 | object | **[Object Financial](#object-financial)** - Bank account details for the operation disbursement. Identifier indicating that the sent object is an individual. It must ALWAYS contain the value "natural" for individual borrowers | -            |
| **purchaser_document_number** * | string | CNPJ do cessionário (comprador) da operação de crédito                                                                                                                                                           | -            |

### Object Borrower  
| Field                            | Type    | Description                                                                             | Max. Caract. | 
|----------------------------------|---------|---------------------------------------------------------------------------------------|--------------|
| **name** *                       | string  | Company's corporate name                                                                   | 100          |
| **trading_name** * | string | Nome fantasia |  |
| **email**   *                     | string  | Company's institutional email                                                                 | 254          |
| **phone**  *                      | object  | **[Object Phone](#object-phone)** - Company's phone number                     | -            | 
| **is_pep** *                     | boolean | PEP indicator (http://www.portaldatransparencia.gov.br/download-de-dados/pep)      | -            |
| **address** *                    | object  | **[Object Address](#object-address)** - Borrower's address

                           | -            | 
| **role_type** *                  | enum    | default: _issuer_                                                                     | -            |
| **person_type** *                | string  | Legal entity indicator - default: _legal_                                       | -            |
| **company_document_number** *    | string  | CNPJ (numbers only)                                                                 | -            |
| **cnae_code** * | string |  National Classification of Economic Activities | |
| **company_representatives** *    | array of objects | List of the company's legal representatives  | **[Object Company Representatives](#object-company_representatives)** |
| **company_type** * | enum |  Company type: "ltda", "sa",  "micro_enterprise" ou  "freelancer"| -  |
| **company_statute** * | string | document_key of the company's articles of association PDF | |
| **directors_election_minute** | string | document_key of the company's election minutes PDF (mandatory only for companies with company_type "sa") | |
| **foundation_date** * | date | Company opening date (format "YYYY-MM-DD") |  |

As shown above, both the "borrower" field and the "guarantors" fields can be populated by either a PF Object or a PJ Object. The PJ Object represents a legal entity in QI Tech.

### Object Company Representatives

| Filed | Description | Exampe | Máx. Caract. | 
|---|---|---|---| 
| **person_type** * | string | Identifier indicating that the sent object is an individual or a legal entity. | natural |
| **name** * | string | Corporate name for corporate operations or person's name for person operations. Limited to 100 characters. |  |
| **mother_name** * | string | Mother's name of the client in case of person. Limited to 100 characters. |  |
| **birth_date** * | string | Date of birth of the person (format "YYYY-MM-DD") | - |
| **profession** * |string | Client's profession. Limited to 64 characters. | 64 |
| **nationality** * | string | Client's nationality.  | 50  |
| **marital_status** * | string | Client's marital status.l do cliente. |
| **property_system** * |string | Property separation regime (mandatory only for individuals with marital_status "married").. | **[Enumeradores property_system](#enumeradores-property_system)**  |
| **wedding_certificate** * | string | DOCUMENT_KEY of the marriage certificate PDF (previously sent). If marital_status is "single," the value of this field must be NULL.. |  |
| **spouse** * |string |**[Object Spouse](#object-spouse)** (Mandatory only when "compulsory_separation_of_goods" is "total_communion_of_goods," "partial_communion_of_goods," "final_participation_of_acquisitions," or "compulsory_separation_of_goods." If marital_status is "single," the value of this field must be NULL. | **[Object Spouse](#object-spouse)** |
| **is_pep** * |  boolean |Declaration if the person is PEP (http://www.portaldatransparencia.gov.br/download-de-dados/pep). | true/false |
| **final_beneficiary** | boolean | Declaration if the person is the final beneficiary of the company. | true/false |
| **individual_document_number** * |string | Person's CPF (numbers only). | 10 |
| **document_identification** * |string | DOCUMENT_KEY of the photo identification document PDF (RG or CNH) (previously sent) |  |
| **document_identification_back** |string | DOCUMENT_KEY of the back side of the photo identification document PDF (RG or CNH) (previously sent). |  |
| **document_identification_type** * | string |Qual o tipo do documento de identificação enviado. |  |
| **document_identification_number** * |string | Identification document number of the person sent in "document_identification".  | 16 |
| **email** * |string | Client's email. | 254 | 
| **phone** * | object | Client's phone number.| **[Object Phone](#object-phone)** | - |
| **address** | object | Client's address. |  **[Object Address](#object-address)**  |  
| **proof_of_residence**  |string | DOCUMENT_KEY of the address proof PDF (previously sent). | - |

### Object Spouse
| Field | Description | Example | Max. Caract. | 
|---|---|---|---| 
| **person_type** * | string | Identifier indicating that the sent object is an individual or a legal entity. | natural |
| **name** * | string | Corporate name for corporate operations or person's name for person operations. Limited to 100 characters. |  |
| **mother_name** * | string | Mother's name of the client in case of person. Limited to 100 characters |  |
| **birth_date** * | string | Date of birth of the person (format "YYYY-MM-DD") | - |
| **profession** * |string | Client's profession. Limited to 64 characters. | 64 |
| **is_pep** * |  boolean |Declaration if the person is PEP (http://www.portaldatransparencia.gov.br/download-de-dados/pep). | true/false |
| **individual_document_number** * |string | Person's CPF (numbers only). | 10 |
| **document_identification_number** * |string |  Identification document number of the person sent in "document_identification".  | 16 |
| **email** * |string | Client's email | 254 | 
| **phone** * | object | Client's phone number. | **[Object phone](#object-phone)** | - |
| **address** | object | Client's address. |  **[Object address](#object-address)**  |  

### Object Address 

| Field              | Type   | Description                                                                | Max. Caract. | 
|--------------------|--------|--------------------------------------------------------------------------|--------------| 
| **city** *         | string | City                                                       | 100          |
| **state** *        | string | Address state (with two uppercase characters)                      | 2            |
| **number** *       | string | Address Numner                                                       | 10           |
| **street** *       | string | Steet                                                          | 100          |
| **complement** *   | string | Address complement (free text)                                    | 100          |
| **postal_code** *  | string | Postal Code (http://www.buscacep.correios.com.br/sistemas/buscacep/) | 8            |
| **neighborhood** * | string | Neighborhood                                                       | 100          |

### Object Phone 

| Field              | Description | Example                                               | Max. Caract. | 
|--------------------|-----------|-------------------------------------------------------|--------------| 
| **number** *       | string    | Phone number                                    | 10           |
| **area_code** *    | string    | Phone area code (DDD) (https://ddd.guiamais.com.br/) | 2            |
| **country_code** * | string    | Phone DDI code (https://ddi.guiamais.com.br/) | 3            |

### Object Disbursement Bank Account

A debt issuance must contain the bank information for disbursement, by default, an account held by the debtor.

| Field                 | Type   | Description                                                                                          | Max. Caract. | 
|-----------------------|--------|----------------------------------------------------------------------------------------------------|--------------|
| name                  | string | Account owner's name

                                                                           | 50           |
| document_number       | string | Account owner's CPF                                                                            | 11           |
| bank_code *           | string | Financial institution's COMPE code financeira (https://www.bcb.gov.br/pom/spb/estatistica/port/ASTR003.pdf) | 3            |
| branch_number *       | string | Branch number (do not include the branch check digit!)                                  | 4            |
| account_number *      | string | Account number (without the account check digit!)                                               | 10           |
| account_digit *       | string | Account check digit (use zero in place of letters)                                     | 1            |
| account_type          | enum   | [Enumerador Account Type](#enumerador-account-type) Account type                                  | 1            |

### Object Financial 

The financial object describes the financial information of the issuance. Here, the interest rate, grace period, and debt value, among others, are defined. The Financial Object has the fields described below, but it is important to note that some fields are optional and mutually exclusive (if one is available, the other should not be sent).

| Field                      | Type   | Description                                                                                                     | Max. Caract. |
|----------------------------|--------|---------------------------------------------------------------------------------------------------------------|--------------|
| **amout**                  | float  | Issue/Nominal value of the credit operation                                                               | -            |
| **interest_type**          | object | **[Enumerador Interest Type](#enumerador-interest-type)** - Amortization method and interest calculation method | -            |
| **credit_operation_type**  | object | **[Enumerador Credit Operation Type](#enumerador-credit-operation-type)** - Credit contract type       | -            |
| **annual_interest_rate**   | float  | Pre-fixed interest rate expressed in decimal per year                                                           | -            |
| **disbursement_date**      | date   | Operation disbursement date                                                                                | -            |
| **interest_grace_period**  | int    | Interest grace period (in months)                                                                                  | -            |
| **principal_grace_period** | int    | Principal grace period                                                                                 | -            |
| **number_of_installments** | int    | Number of installments of the credit operation                                                                     | -            |
| **fine_configuration**     | object | **[Object Fine Configuration](#object-fine-configuration)** - Late interest and penalty configuration        | -            |

### Object Fine Configuration

In the Fine Configuration Object, the penalty and late interest amounts of the credit operation are provided.

| Field                  | Type  | Description                                                                            | Max. Caract. |
|------------------------|-------|--------------------------------------------------------------------------------------|--------------|
| **contract_fine_rate** | float | Penalty rate for delay                                                       | -            |
| **interest_base**      | enum  | **[Enumerador Interest Base](#enumerador-interest-base)** - Interest calculation base | -            |
| **monthly_rate**       | float | Monthly late interest rate                                                 | -            |

### Object Rebates
| Field                           | Type   | Description                                                                                                                                                                                                        | Max. Caract. | 
|---------------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| **fee_type** *                  | enum | Fee Type.                                                                                                                                   | -            | 
| **amount_type** * | object | Amount Type.                                                                                 | -            |
| **amount** *                 | object | Fee amount. If the fee type is percentage, the value must be between 0 and 100. | -            |

### Response Body
| Field                      | Type   | Description                                                      | Max. Caract. |
|----------------------------|--------|----------------------------------------------------------------|--------------|
| **data[n].data**           | object | **[Object Data](#object-data)**                                | -            |
| **data[n].event_datetime** | date   | Moment of credit operation generation                      | -            |
| **data[n].key**            | string | **DEBT-KEY** - Unique key of the credit operation within QI | -            |
| **data[n].status**         | string | **[Possible status of a debt](../status_de_uma_divida)**     | -            |
| **data[n].type**           | string | _debt_                                                         | -            |

# Enumerators

### Person Type_Enumerators
| Enumerator             | Description             |
|------------------------|-----------------------|
| **legal**   | Corporate        |
| **natural**    | Person    |

### Amount Type_Enumerators
| Enumerator             | Description             |
|------------------------|-----------------------|
| **tac**   | Fee charged to the borrower. |
| **spread**    | Fee charged to the fund added to the operation's transfer price.    |

### Account Type_Enumerators
| Enumerator             | Description             |
|------------------------|-----------------------|
| **checking_account**   | checking account        |
| **deposit_account**    | deposit account     |
| **guaranteed_account** | guaranteed account     |
| **investment_account** | investment account |
| **payment_account**    | payment account    |
| **saving_account**     | saving account        |
| **salary_account**     | salary account         |

### Interest Type_Enumerators
| Enumerator           | Description                                                                                                                                                                |
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **pre_price_days**   | Price amortization method (equal installments) with calculation of pre-fixed interest per day                                                                                     |
| **pre_price**        | Price amortization method (equal installments) with pre-fixed interest calculation in fixed periods (30 days)                                                                |
| **pre_sac**          | SAC amortization method (constant amortization) with pre-fixed interest calculation per day                                                                                 |
| **post_sac**         | SAC amortization method (constant amortization) with interest calculation based on a pre-fixed rate + post-fixed indexer (CDI, IPCA, or IGPM) per day                  |
| **post_price**       | Price amortization method (equal installments) with interest calculation based on a pre-fixed rate + post-fixed indexer (CDI, IPCA, or IGPM) in fixed periods (30 days) |
| **post_price_days**  | Price amortization method (equal installments) with interest calculation based on a pre-fixed rate + post-fixed indexer (CDI, IPCA, or IGPM) per day                     |

### Credit Operation Type_Enumerators
| Enumerator    | Description                      |
|---------------|--------------------------------|
| **ccb**       | Cédula de Crédito Bancário     |
| **cce**       | Cédula de Crédito à Exportação |
| **cci**       | Cédula de Crédito Imobiliário  |
| **nce**       | Nota de Crédito à Exportação   |

### Interest Base_Enumerators
| Enumerator            | Description                                                                 |
|-----------------------|---------------------------------------------------------------------------|
| **workdays**          | Interest calculation base in business days considering a year of 252 days    |
| **calendar_days**     | Interest calculation base in business days considering a year of 360 days|
| **calendar_days_365** | Interest calculation base in business days considering a year of 365 days |

### Fee Type_Enumerators
Cada tipo de fee deve ser previamente habilitado e configurado pela QI Tech

| Enumerator            | Description                                                                  |
|-----------------------|----------------------------------------------------------------------------|
| **tac**               | Registration opening fee                                             |
| **spread**            | Spread charged on the acquisition value of the credit operation                  |
| **warranty_analysis** | Warranty analysis fee                                             |
| **ted_fee**           | TED Fee                                                              |
| **spread_ted_fee**    | TED fee spread charged on the acquisition value of the credit operation |

---

# Example of disbursement payloads

URL: /en/documentation/emissao_de_divida/emissao/exemplo_payloads_desembolso

Disburse to Internal QI Tech Account

ENDPOINT /debt
METHOD 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
	}]
  ...
}
```

--- 

### Disburse with Manual Pix

ENDPOINT /debt
METHOD 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 Key Types
The “pix_key” can be a CPF, CNPJ, Email, Mobile Number, or a Random Key (UUID), following these formats:

CPF: Integer with 11 digits.

CNPJ: Integer with 14 digits.

Email: Text containing at least one “@”.

Mobile Number: Text containing the following values: “+55” + “Mobile DDD” + “Mobile Number as an integer with a minimum of 8 and a maximum of 9 digits”. Example: “+5511987654321”.

Random Key: UUID.
:::

---

### Disburse with Pix Key

ENDPOINT /debt
METHOD 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"
		}]
		...
}
```
---

### Disburse with Pix QR Code

ENDPOINT /debt
METHOD POST

```json title='Request Body'

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

---

### Disburse with TED

ENDPOINT /debt
METHOD 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
		}]
		...
}
```

---

###  Disburse by Paying a Boleto

ENDPOINT /debt
METHOD POST

```json title='Request Body'

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

---

# Alternative Signatures

URL: /en/documentation/emissao_de_divida/formalizacao/assinatura_de_contrato

For the use of alternative forms of signature, the proof file dossier must be compressed into a .zip file and sent via the QI TECH /upload endpoint. The returned document_key can then be used in this endpoint as a form of contract signature.

Examples of alternative signatures:

- Recorded call;

- Credit analysis;

## Request

ENDPOINT /debt/ DEBT-KEY /signed
METHOD POST

**Request Body**

```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"
        }
    ]
}
```

## Path Params

| Field |  Type | Description | Characters | 
|---|---|---|---|
| `debt_key` * | string |  Debt key returned at the moment of credit operation creation. | - |

## Body Params

| Field |  Type | Description | Characters | 
|---|---|---|---|
| `type` * | string |  Type of signature to be sent. | - |
| `signatures` * | array of objects | List containing signature proof objects - must be sent in case of signature "type": "data-signature". |  **[Objects signatures](#object-signatures )**|
| `path-pdf-signed` * | string | URL with the signed PDF - must be sent in case of signature "type": "pdf-signature". | - |

### Object signatures

| Field |  Type | Description | Characters | 
|---|---|---|---|
| `signed_object` | object | Object containing the document being signed. | **[Objects signed_object](#object-signed_object )** |
| `authenticity` | object | Object with authentication data. | **[Objects authenticity](#object-authenticity )** |
| `signer` | object | Object with the signatory's data. | **[Object signer](#object-signer )** |
| `authentication_type` *| string | Type of signature. | - |

### Object signed_object

| Field |  Type | Description | Characters | 
|---|---|---|---|
| `raw_text` | string | Plain text with the contract data to be signed (Mandatory for opt-in type authentication). | - |
| `document_key` | string | DOCUMENT_KEY of the signed file sent via API 1.1 (mandatory only if the "raw_text" field is not sent). | - |
| `document_md5` | string | DOCUMENT_MD5 of the signed file sent via API 1.1 (mandatory only if the "raw_text" field is not sent). | - |

### Object authenticity

| Field |  Type | Description | Characters | 
|---|---|---|---|
| `timestamp` *| string | Data da assinatura. | - |
| `document_key` * | string | DOCUMET_KEY retornado pela API 1.1 após o envio do arquivo com as evidencias de assinatura. | - |
| `document_md5` * | string | DOCUMET_MD5 retornado pela API 1.1 após o envio do arquivo com as evidencias de assinatura. | - |
 
### Object signer

| Field |  Type | Description | Characters | 
|---|---|---|---|
| `name` *| string | Name of the signatory. | - |
| `email` *| string | Signatory's email. | - |
| `phone` | string | Object containing the signatory's phone. |  **[Object phone](#object-phone)** |
| `document_number` *| string | Signatory's document number. | - |

### Object phone

| Field |  Type | Description | Characters | 
|---|---|---|---|
|`country_code` *| string | Phone DDI code (https://ddi.guiamais.com.br/) | 3 | 
| `area_code` *| string | Phone area code (DDD) (https://ddd.guiamais.com.br/) | 2 |
| `number` *| string |Phone number (numbers only) |  10 |

## Response

STATUS 200

**Response Body**

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

```

STATUS 400

**Response Body**

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

```

---

# Contract signing with OPT-IN

URL: /en/documentation/emissao_de_divida/formalizacao/assinatura_opt_in

## Request

ENDPOINT /debt/ DEBT-KEY /signed
METHOD POST

**Request Body**

```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"
        }
    ]
}
```

## Path Params

| Field |  Type | Description | Characters | 
|---|---|---|---|
| `debt_key` * | string |  Debt key returned at the moment of credit operation creation. | - |

## Body Params

| Field |  Type | Description | Characters | 
|---|---|---|---|
| `type` * | string |  Type of signature to be sent. | - |
| `signatures` * | array of objects | List containing signature proof objects - must be sent in case of signature "type": "data-signature". |  **[Objects signatures](#object-signatures )**|

### Object signatures

| Field |  Type | Description | Characters | 
|---|---|---|---|
| `signed_object` | object | Object containing the document being signed. | **[Objects signed_object](#object-signed_object )** |
| `authenticity` | object | Object with authentication data. | **[Objects authenticity](#object-authenticity )** |
| `signer` | object | Object with the signatory's data. | **[Object signer](#object-signer )** |
| `authentication_type` *| string | Type of signature. | - |

### Object signed_object

| Field |  Type | Description | Characters | 
|---|---|---|---|
| `raw_text` * | string | Plain text with the contract data to be signed. | - |

### Object authenticity

| Field |  Type | Description | Characters | 
|---|---|---|---|
| `timestamp` *| string | Signature date. | - |
| `ip_address` | string | Mandatory field for the "opt-in" authentication_type indicating the IP address where the acceptance was collected. | - |
| `session_id` | string | Session identification ID of the client at the time of signing - it must be queryable and the session evidence must be stored for a minimum period of 5 years (Mandatory for the "opt-in" authentication_type). | - |
| `geolocation` | object | Optional geolocation field. | - |
 
### Object signer

| Field |  Type | Description | Characters | 
|---|---|---|---|
| `name` *| string | Signatory's name. | - |
| `email` *| string | Signatory's email. | - |
| `phone` | string | Object containing the signatory's phone number |  **[Object phone](#object-phone)** |
| `document_number` *| string | Signatory's document number. | - |

### Object phone

| Field |  Type | Description | Characters | 
|---|---|---|---|
|`country_code` *| string | Phone DDI code (https://ddi.guiamais.com.br/) | 3 | 
| `area_code` *| string | Phone area code (DDD) (https://ddd.guiamais.com.br/) | 2 |
| `number` *| string |Phone number (numbers only) |  10 |

## Response

STATUS 200

**Response Body**

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

```

STATUS 400

**Response Body**

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

```

---

# Sending the signed PDF

URL: /en/documentation/emissao_de_divida/formalizacao/assinatura_pdf

## Request

ENDPOINT /debt/ DEBT-KEY /signed
METHOD POST

**Request Body**

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

## Path Params

| Field |  Type | Description | Characters | 
|---|---|---|---|
| `debt_key` * | string |  Debt key returned at the moment of credit operation creation. | - |

## Body Params

| Field |  Type | Description | Characters | 
|---|---|---|---|
| `type` * | string |  Type of signature to be sent. | - |
| `path-pdf-signed` * | string | URL with the signed PDF - must be sent in case of signature "type": "pdf-signature". | - |

## Response

STATUS 200

**Response Body**

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

```

STATUS 400

**Response Body**

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

```

---

# Selfie Signatures

URL: /en/documentation/emissao_de_divida/formalizacao/assinatura_selfie

Selfie authentication is available to partners using QI Tech's credit analysis services, where selfie authentication is validated, and a proof ID is generated. 

This ID, generated through QI Tech's credit analysis endpoints, can be used as a contract signature.

## Request

ENDPOINT /debt/ DEBT-KEY /signed
METHOD POST

**Request Body**

```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"
        }
    ]
}
```

## Path Params

| Campo |  Tipo | Descrição | Caracteres | 
|---|---|---|---|
| `debt_key` * | string |  Chave da divida devolvida no momento da criação da operação de crédito. | - |

## Body Params

| Campo |  Tipo | Descrição | Caracteres | 
|---|---|---|---|
| `type` * | string |  Tipo de assinatura que será enviada. | - |
| `signatures` * | array of objects | Lista contendo objetos de comprovação de assinatura - deve ser enviado no caso de assinatura "type": "data-signature". |  **[Objects signatures](#object-signatures )**|

### Object signatures

| Campo |  Tipo | Descrição | Caracteres | 
|---|---|---|---|
| `signed_object` | object | Objeto contendo o documento que esta sendo assinado. | **[Objects signed_object](#object-signed_object )** |
| `authenticity` | object | objeto com dados de autenticação. | **[Objects authenticity](#object-authenticity )** |
| `signer` | object | Objeto com os dados do signatário. | **[Object signer](#object-signer )** |
| `authentication_type` *| string | Tipo de assinatura. | - |

### Object signed_object

| Campo |  Tipo | Descrição | Caracteres | 
|---|---|---|---|
| `raw_text` | string | Texto corrido com os dados do contrato que será assinado (Obrigatório para autenticação tipo opt-in). | - |
| `document_key` | string | DOCUMENT_KEY do arquivo assinado enviado a partir da API 1.1 (obrigatório apenas caso o campo "raw_text" não seja enviado). | - |
| `document_md5` | string | DOCUMENT_MD5 do arquivo assinado enviado a partir da API 1.1 (obrigatório apenas caso o campo "raw_text" não seja enviado). | - |

### Object authenticity

| Campo |  Tipo | Descrição | Caracteres | 
|---|---|---|---|
| `timestamp` *| string | Data da assinatura. | - |
| `facial_recognition_key` * | string | Deve conter o facial_recognition_key devolvido pela API de face recognition QI Tech - Este campo só é disponível para o authentication_type "selfie" e exclui a obrigatoriedade do envio de outras comprovações. | - |
 
### Object signer

| Campo |  Tipo | Descrição | Caracteres | 
|---|---|---|---|
| `name` *| string | Nome do signatário. | - |
| `email` *| string | E-mail do signatário. | - |
| `phone` | string | Objeto de telefone do signatário. |  **[Object phone](#object-phone)** |
| `document_number` *| string | Numero de documento do signatário. | - |

### Object phone

| Campo |  Tipo | Descrição | Caracteres | 
|---|---|---|---|
|`country_code` *| string | Código DDI do telefone (https://ddi.guiamais.com.br/) | 3 | 
| `area_code` *| string | Código DDD do telefone (https://ddd.guiamais.com.br/) | 2 |
| `number` *| string |Número de telefone (apenas números) |  10 |

## Response

STATUS 200

**Response Body**

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

```

STATUS 400

**Response Body**

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

```

---

# Debt Formalization

URL: /en/documentation/emissao_de_divida/formalizacao/introducao_formalizacao

By default, QI Tech collects signatures via QI Sign, and the contract is sent to the signatories at the time of issuance. However, there is also the possibility for the partner to independently collect signatures and send the signed document or signature evidence to QI Tech to proceed with the operation.

:::caution **Attention**

For the partner to collect signatures and then submit the signed document via API, it is necessary to request the configuration of this flow from the QI Tech support team.
:::

The signing process can be done in two ways:

1 - Signatures are collected through the QI Tech platform;

2 - The partner independently collects signatures and then sends the signed contract to QI Tech - This option allows for either the submission of the signed PDF or the submission of a signature hash;

The flow of calls changes according to the chosen process and can follow the call paths below:

## Flow 1
After requesting the configuration of signature flow 1 from the QI Tech support team, the only call needed to issue the debt is the call from set 3, according to the credit borrower of the operation. 

QI Tech will issue the pre-configured credit contract and send it for signing - the operation can be monitored via API 5.1 or through the sent callbacks.

The document is signed through the QI Sign platform and can occur via email, WhatsApp, or SMS within 7 days after the contract issuance.

Due to the asynchronous nature of the signature, when the contract is signed by the borrower, an event is triggered via webhook to the originator.

## Flow 2
After requesting the configuration of signature flow 2 from the QI Tech support team, there is a sequence of calls that must be made.

The first call will necessarily be the set of APIs 3 (according to the credit borrower of the operation) to issue the contract PDF, and the last call will be API 4.1 to submit the already signed contract.

In the case of document signing via a certification authority, it is necessary to send the URL with the signed PDF in API 4.1.

In the case of signing via opt-in on the frontend, the information to be sent in API 4.1 will be the acceptance evidence from the client.

QI Tech will then follow the flow for disbursement - the operation can be monitored using API 5.1 or through the sent webhooks.

## Accepted Signature Types

### **pdf-signature**
This type indicates that the PDF issued through "/debt" will be signed, and the link to the signed PDF will be sent via API 4.1 as a form of authentication.

### **data-signature**
This type indicates that the PDF issued through "/debt" will be signed through a hash attached to its last page.

Data authentication can have three types:

#### **Opt-in**
Opt-in signature means that the client will consent to the contract through the frontend. 

For this signature to be valid, some data must be sent mandatorily.

#### **Zip**
Zip signature involves the submission of a proof file, such as a recorded call.

#### **Selfie**
Selfie authentication is available to partners using QI Tech's CaaS services, where selfie authentication is validated, and a proof ID is generated.

---

# Generate Bank Slip or PIX for an Installment

URL: /en/documentation/emissao_de_divida/gerar_boleto_ou_pix_para_uma_parcela

Allows you to generate a bank slip or PIX code for the payment of a specific installment of a credit operation.

## Endpoint

### Request

ENDPOINT /debt/ DEBT-KEY /installment/ INSTALLMENT-KEY / PAYMENT-TYPE
METHOD POST
Path Parameters
| Parameter | Type | Description |
|-----------|------|-----------|
| DEBT-KEY | string | Debt identifier key |
| INSTALLMENT-KEY | string | Installment identifier key |
| PAYMENT-TYPE | string | Desired payment type: bankslip (Bank Slip) or pix (PIX QR code) |
Request Body
```json
{}
```
Response
Response Body
```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"
}
```
Response Body Object
| Field | Type | Description |
|-------|------|-----------|
| installment_key | string | Unique identifier of the installment in UUID format |
| due_date | string | Installment due date in YYYY-MM-DD format |
| business_due_date | string | Installment due date on a business day in YYYY-MM-DD format |
| pre_fixed_amount | number | Interest amount |
| principal_amortization_amount | number | Principal amount to be amortized |
| total_amount | number | Total installment amount (interest + principal) |
| bank_slip_key | string | Bank slip identifier key |
| qr_code_key | string | PIX QR code identifier key |
| qr_code_url | string | URL for PIX QR code payment |
| digitable_line | string | Bank slip digitable line |

---

# Introduction

URL: /en/documentation/emissao_de_divida/introducao

In this section, you will learn about the necessary steps for issuing, formalizing, disbursing, and canceling a credit contract.

### 1 - Uploading Required Documents for Debt Issuance

To issue a debt, certain regulatory criteria must be met. One of these criteria is the identification of the debtor by the financial institution issuing the credit. To fulfill this criterion, at a minimum, the following documents must be submitted:

- **Person**: Official photo ID (RG or CNH);
- **Corporate**: Articles of Incorporation/Bylaws, Election Meeting Minutes (for corporations), Official photo ID of representatives, Power of Attorney (if there are proxies)

To submit these documents, you must use our document upload endpoint.

:::danger Attention!

QI Tech offers a comprehensive Onboarding solution, including OCR for document validation and Anti-fraud measures.

[Check the service API documentation here.](https://www.zaig.com.br/en/devcenter.html)

For quotations and more information, please contact our sales team:

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

### 2 - Debt Simulation

At QI Tech, we provide our clients the ability to simulate credit operation values before their actual issuance. The simulation follows the same pattern as the debt issuance request, but it's not necessary to provide the debtor's registration and disbursement account details. Furthermore, we offer the possibility to perform several simulations with a single request..

### 3 - Debt Issuance
With the credit operation draft defined, the QI Tech support team will parameterize the contract on the platform, and its PDF can be issued through the debt issuance endpoint, as per the cases below:
To issue a debt for an person.
- [To issue a debt for an person.](emissao/emissao_de_divida_pf)
- [To issue a debt for a corporate entity.](emissao/emissao_de_divida_pj)

### 4 - Signature Process
After completing all these steps, we move on to the debt assignment process, which is 100% managed by QI Tech.
Para entender as configurações de assinatura [clique aqui](formalizacao/introducao_formalizacao).

### 5 - Operation Disbursement
The disbursement is automatic and can be configured in two ways. To understand the disbursement configurations [here](emissao/exemplo_payloads_desembolso).

:::info Information
By default, operations are disbursed via PIX to the account provided for the operation, but there are five options that can be selected:

**1- Pix with account information;**;

**2- Pix with key;**;

**3- Ted**;

**4- QR code Pix**;

**5- Boleto**;

They have specific fields and are detailed in the "disbursement_bank_accounts" key of the contract issuance.
:::

The QI Tech disbursement routine runs every minute, checking if all the configured requirements for the product have been met for that specific contract and updating its status.

### Requirements for Disbursement:

- **Disbursement Date**

The credit contract of the operation is only disbursed on the date defined as "disbursement_date".

- **Issued and Signed Credit Contract**

The credit contract of the operation must be issued and signed.

- **Collateral Constituted**

In the case of operations that require guarantees, the collateral must be constituted for disbursement to proceed.

- **Disbursement Approval**

If the "approval for disbursement" configuration is active, the contract will only be disbursed after the approval API call.

- **Operations with Down Payment Must Be Paid**

If the created operation has a down payment parameter, the disbursement only occurs after the payment and financial settlement in the QI Tech system.

- **Limit Alignment**

If the "high frequency disbursement" configuration is active, it is required to have an available credit limit for the operation to be disbursed.

- **Contract Assignment**

If the "disbursement after assignment" configuration is active, the operation must be assigned for the operation to be disbursed.

:::danger Attention
QI Tech does not provide credit! We are a debt facilitators and not competitors to our customers.
:::

---

# Banking correspondant monitoring

URL: /en/documentation/emissao_de_divida/mcb

---

:::caution API under development 
This API is still in its development phase. With this said, this manual is subject to alterations.
:::

## 1. Registered Corban score consulting:

### Request

ENDPOINT /mcb/requester
METHOD GET

### Response

ENDPOINT /mcb/requester
METHOD GET
HTTP STATUS 200

Response Body

```json
{
    "document_number": "56201278000181",
    "requester_status": "according",
    "name": "TESTE SERVICOS LTDA",
    "trading_name": "TESTE",
    "city": "SAO PAULO",
    "state": "SP",
    "requester_history": [
        {
            "reference_date": "2025-05-19",
            "requester_status": "according",
            "demand_percentage": 28.13,
            "legal_action_percentage": 9.81,
            "do_not_disturb_percentage": 0
        }
    ]
}
```

### Response body details

| Field                       | Type   | Description                                             |
|-----------------------------|--------|---------------------------------------------------------|
| `document_number`           | string | Corban CNPJ.                                            |
| `name`                      | string | Corban company name.                                    |
| `trading_name`              | string | Corban trade name.                                      |
| `city`                      | string | Corban city.                                            |
| `state`                     | string | Corban state (follows Brazilian UF).                    |
| `requester_status`          | string | Corban status on MCB.                                   |
| `requester_history`         | list   | Corban update history.                                  |
| `reference_date`            | string | Update reference date.                                  |
| `demand_percentage`         | number | Complaint index (percentage).                           |
| `legal_action_percentage`   | number | Legal actions index (percentage).                       |
| `do_not_disturb_percentage` | number | Complaints linked to do not disturb index (percentage). |

#### Enumerator requester status

| Enumerator             | Description                       |
|------------------------|-----------------------------------|
| **according**          | Corban is in accordance           |
| **partialy_according** | Corban is partially in accordance |
| **not_according**      | Corban is not in accordance       |
| **not_rated**          | Corban is not rated               |

## 2. Consult credit agent: 

### Request

ENDPOINT /mcb/credit_agent/[CPF-DO-AGENTE]
METHOD GET

#### QUERY PARAMETERS

| Enumerator          | Description                                                 |
|---------------------|-------------------------------------------------------------|
| **include_history** | Required parameter to return the agent's score history |

### Response

ENDPOINT /mcb/credit_agent/[CPF-DO-AGENTE]
METHOD GET
HTTP STATUS 200

Response Body

```json
{
    "document_number": "02353050069",
    "credit_agent_status": "active",
    "credit_agent_external_status": "active",
    "block_reason": null,
    "credit_agent_history": [
        {
            "credit_agent_status": "active",
            "credit_agent_external_status": "active",
            "block_reason": null,
            "current_score": 0,
            "total_score": 0,
            "score_expiration_date": null,
            "suspension_start_date": null,
            "suspension_end_date": null,
            "reference_date": "2025-06-26"
        }
    ]
}
```

### Response body details

| Field                          | Type   | Description                         |
|--------------------------------|--------|-------------------------------------|
| `document_number`              | string | Credit agent CPF.                   |
| `credit_agent_status`          | string | Credit agent status.                |
| `credit_agent_external_status` | string | Credit agent status on MCB.         |
| `block_reason`                 | string | Credit agent block reason.          |
| `current_score`                | number | Credit agent current score.         |
| `total_score`                  | number | Credit agent total score.           |
| `score_expiration_date`        | string | Credit agent score expiration date. |
| `suspension_start_date`        | string | Credit agent suspension start date. |
| `suspension_end_date`          | string | Credit agent suspension end date.   |
| `credit_agent_history`         | list   | Credit agent update history.        |
| `reference_date`               | string | Update reference date.              |

#### Enumerator credit_agent_external_status

| Enumerator                | Description                                         |
|---------------------------|-----------------------------------------------------|
| **active**                | Agent is active                                     |
| **suspended**             | Agent is suspended for 12 months                    |
| **permanently_suspended** | Agent is indeterminately suspended                  |
| **suspension_warning**    | Agent is active, but has been accused of scam/fraud |

#### Enumerator credit_agent_status

| Enumerator  | Description                                         |
|-------------|-----------------------------------------------------|
| **active**  | Agent is active                                     |
| **blocked** | Agent is blocked and can not emit credit operations |

#### Enumerator block_reason

| Enumerator                   | Description                       |
|------------------------------|-----------------------------------|
| **mcb_report_file**          | Blocked by mcb report file        |
| **expired_certificate**      | Blocked by an expired certificate |

## 3. Consult credit agents' certificate in  CRCP: 

### Request

ENDPOINT /mcb/credit_agent/[CPF-DO-AGENTE]/certificate
METHOD GET

STATUS 200

Response Body

```json
{
    "document_number": "12345678911",
    "name": "NOME DO AGENTE DE CREDITO",
    "certificate_list": [
        {
            "certifier_name": "FEBRABAN",
            "certifier_code": "6345",
            "title": "LGPD para Correspondentes no Pais Res 4 935",
            "certificate_number": "1234567891234567",
            "exam_date": "11/01/2022",
            "expiration_date": "11/01/2024",
            "certificate_status": "excluded"
        },
        {
            "certifier_name": "FEBRABAN",
            "certifier_code": "6339",
            "title": "PLDFT em Conta Corrente Poupanca para Correspondente",
            "certificate_number": "1234567891234567",
            "exam_date": "28/12/2023",
            "expiration_date": "28/12/2025",
            "certificate_status": "active"
        },
    ]
}
```

STATUS 404

Response Body

```json
{
	"title": "Not Found",
	"description": "Credit agent not found.",
	"translation": "Agente de crédito não encontrado.",
	"code": "MCB000004"
}
```

### Response body details

| Field                | Type   | Description                  |
|----------------------|--------|------------------------------|
| `document_number`    | string | Credit agents CPF.           |
| `name`               | string | Credit agent name.           |
| `certificate_list`   | list   | Credit agents certificates.  |
| `certifier_name`     | string | Certifier company name.      |
| `certifier_code`     | string | Certificate type code .      |
| `title`              | string | Certification title.         |
| `certificate_number` | string | Certificate number.          |
| `exam_date`          | string | Certificate exam date.       |
| `expiration_date`    | string | Certificate expiration date. |
| `certificate_status` | string | Certificate status.          |

#### Enumerator certificate_status

| Enumerator   | Description                                   |
|--------------|-----------------------------------------------|
| **active**   | Certificate is active                         |
| **excluded** | Certificate has been excluded by certificator |

---

# Metadata

URL: /en/documentation/emissao_de_divida/metadata

Object that allows querying credit operations through custom keys and values.

## 1. Create Metadata

### Request Body Object
| Field                           | Type   | Description                                                                                                                                                                                                        | Max. Chars. | 
|---------------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| **metadata_key** * | string | Metadata key                                                                                                                                                          | 100            |
| **metadata_value** * | string | Metadata value    | 100            |

### Request

ENDPOINT /credit_operation/[CREDIT-OPERATION-KEY]/metadata
METHOD POST

Request Body

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

## 2. Remove Metadata

### Request

ENDPOINT /credit_operation/[CREDIT-OPERATION-KEY]/metadata
METHOD DELETE

Request Body

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

## 3. Credit operation query using Metadata

:::caution 
When querying by metadata, both fields 'metadata_key' and 'metadata_value' must be provided.
:::

### Request

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

### Response

Response Body
```json
{
    "data": [
        {
            "credit_operation_key": "cc217253-e89f-4d14-bf89-fb29afaa2895",
            "contract_number": "0000000007/WO",
            "credit_operation_status": "waiting_signature",
            "additional_iof": 3.817322,
            "total_iof": 7.19,
            "original_total_iof": 7.2,
            "attached_documents": [
                {
                    "document_key": "2f7bfc50-d7c0-4d4e-a5ce-d8bba2aeb348",
                    "document_url": "https://storage.googleapis.com/dev-doc-api/documents/2f7bfc50-d7c0-4d4e-a5ce-d8bba2aeb348/sample.pdf",
                    "signature_url": null,
                    "document_type": "document_identification",
                    "signature_required": false,
                    "signed": false
                },
                {
                    "document_key": "568ca6b7-45a8-42e5-a383-e93641625040",
                    "document_url": "b",
                    "signature_url": null,
                    "document_type": "ccb_pre_price",
                    "signature_required": true,
                    "signed": false
                }
            ],
            "annual_cet": 316.4973,
            "assigned": false,
            "assigned_at": null,
            "assignment_amount": 1007.19,
            "issue_amount": 1007.19,
            "disbursed_issue_amount": 1000,
            "final_disbursement_amount": 1000,
            "base_iof": 3.37226774,
            "calculus_correction": null,
            "central_depository": null,
            "cet": 12.62,
            "collateral_constituted": true,
            "collateral_type": null,
            "contract_fee_amount": 0,
            "external_contract_fee_amount": 0,
            "credit_operation_type": "ccb",
            "operation_type": "structured_operation",
            "creditor_bank_account_key": null,
            "custodian": "qi_scd",
            "disbursement_date": "2022-08-08",
            "disbursement_start_date": "2022-08-08",
            "disbursement_end_date": "2022-08-08",
            "first_due_date": "2022-08-18",
            "disbursement_accounts": [
                {
                    "account_branch": "0001",
                    "account_digit": "3",
                    "account_number": "94134",
                    "account_type": null,
                    "disbursement_type": "pix",
                    "amount_receivable": null,
                    "digitable_line": null,
                    "financial_institutions_code_number": 329,
                    "ispb": "32402502",
                    "name": "Teste",
                    "percentage_receivable": 100,
                    "pix_key": "qitech@qitech.com.br",
                    "pix_transfer_key": "0956cf37-5ef6-4a63-9c01-f29b259e1993",
                    "pix_type": "key",
                    "qr_code_key": null
                }
            ],
            "document_certifier": "clicksign",
            "number_of_installments": 3,
            "installments": [
                {
                    "accrual_reference_date": null,
                    "advanced_paid_amount": 0,
                    "bank_slip_key": null,
                    "business_due_date": "2022-08-19",
                    "due_date": "2022-08-18",
                    "calendar_days": 10,
                    "digitable_line": null,
                    "due_interest": 0,
                    "due_principal": 1007.19,
                    "fine_amount": null,
                    "has_interest": true,
                    "installment_key": "5f45b7b4-f7f0-464b-94a7-cdea47f3811b",
                    "installment_status": "created",
                    "installment_type": "principal",
                    "original_due_principal": 1007.19,
                    "original_pre_fixed_amount": 38.24205854,
                    "original_principal_amortization_amount": 351.17794146,
                    "paid_amount": 0,
                    "post_fixed_amount": 0,
                    "original_total_amount": 389.42,
                    "pre_fixed_amount": 38.24205854,
                    "principal_amortization_amount": 351.17794146,
                    "qr_code_key": null,
                    "qr_code_url": null,
                    "renegotiation_proposal_key": null,
                    "tax_amount": 0.28796591,
                    "total_accrual_amount": null,
                    "total_amount": 389.42,
                    "total_paid_amount": 0,
                    "workdays": 8
                },
                {
                    "accrual_reference_date": null,
                    "advanced_paid_amount": 0,
                    "bank_slip_key": null,
                    "business_due_date": "2022-09-20",
                    "due_date": "2022-09-19",
                    "calendar_days": 32,
                    "digitable_line": null,
                    "due_interest": 0,
                    "due_principal": 656.01205854,
                    "fine_amount": null,
                    "has_interest": true,
                    "installment_key": "f844a3ea-bde3-4f94-ada1-607e799b9095",
                    "installment_status": "created",
                    "installment_type": "principal",
                    "original_due_principal": 656.01205854,
                    "original_pre_fixed_amount": 80.33658151,
                    "original_principal_amortization_amount": 309.08341849,
                    "paid_amount": 0,
                    "post_fixed_amount": 0,
                    "original_total_amount": 389.42,
                    "pre_fixed_amount": 80.33658151,
                    "principal_amortization_amount": 309.08341849,
                    "qr_code_key": null,
                    "qr_code_url": null,
                    "renegotiation_proposal_key": null,
                    "tax_amount": 1.06448329,
                    "total_accrual_amount": null,
                    "total_amount": 389.42,
                    "total_paid_amount": 0,
                    "workdays": 21
                },
                {
                    "accrual_reference_date": null,
                    "advanced_paid_amount": 0,
                    "bank_slip_key": null,
                    "business_due_date": "2022-10-19",
                    "due_date": "2022-10-18",
                    "calendar_days": 29,
                    "digitable_line": null,
                    "due_interest": 0,
                    "due_principal": 346.92864005,
                    "fine_amount": null,
                    "has_interest": true,
                    "installment_key": "e6d67f54-8827-40c4-ade0-1b9b8fd03689",
                    "installment_status": "created",
                    "installment_type": "principal",
                    "original_due_principal": 346.92864005,
                    "original_pre_fixed_amount": 42.49135995,
                    "original_principal_amortization_amount": 346.92864005,
                    "paid_amount": 0,
                    "post_fixed_amount": 0,
                    "original_total_amount": 389.42,
                    "pre_fixed_amount": 42.49135995,
                    "principal_amortization_amount": 346.92864005,
                    "qr_code_key": null,
                    "qr_code_url": null,
                    "renegotiation_proposal_key": null,
                    "tax_amount": 2.01981854,
                    "total_accrual_amount": null,
                    "total_amount": 389.42,
                    "total_paid_amount": 0,
                    "workdays": 20
                }
            ],
            "interest_grace_period": 0,
            "interest_payment_month_period": 1,
            "interest_subsidy_amount": 0,
            "interest_subsidy_percentage": 0,
            "interest_type": "pre_price",
            "iof_charge_method": "financed",
            "ipoc_code": "3240250202021371976458320000000007/WO",
            "issue_date": "2022-08-08",
            "issuer_document_number": "37197645832",
            "issuer_name": "Wilker Oliveira\u00e7o",
            "modality": "0202",
            "origin_key": "52539e23-5c01-4b9c-8a68-6ed750ec7bc5",
            "payment_and_settlement_agent": "qi_scd",
            "post_fixed_interest_rate": null,
            "prefixed_interest_rate": {
                "annual_rate": 3,
                "daily_rate": 0.00385824,
                "monthly_rate": 0.12246205,
                "interest_base": "calendar_days"
            },
            "fine_configuration": {
                "contract_fine_rate": 0.02,
                "fine_delay_rate": {
                    "annual_rate": 0.12682503,
                    "daily_rate": 0.00033173,
                    "interest_base": "calendar_days",
                    "monthly_rate": 0.01
                }
            },
            "principal_amortization_month_period": 1,
            "principal_grace_period": 0,
            "purchaser_document_number": "04113929151550",
            "requester_key": "52f36417-368e-4f5b-8841-71e3b9caa72f",
            "requester_identifier_key": null,
            "settlement_bank_account_key": "e7e60779-6605-4af5-bd00-1f465f2c5da5",
            "share_quantity": 2,
            "tax_configuration": {
                "iof_additional_rate": 0.000082,
                "iof_rate": 0.0038
            },
            "third_party_account_key": "96015228-4905-42fc-bda6-e70e0e552b6b",
            "disbursement_options": [
                {
                    "additional_iof": 3.817322,
                    "annual_cet": 316.4973,
                    "assignment_amount": 1007.19,
                    "base_iof": 3.37226774,
                    "calculus_correction": null,
                    "cet": 12.62,
                    "contract_fee_amount": 0,
                    "disbursed_issue_amount": 1000,
                    "disbursement_date": "2022-08-08",
                    "external_contract_fee_amount": 0,
                    "first_due_date": "2022-08-18",
                    "installments": [
                        {
                            "business_due_date": "2022-08-19",
                            "due_date": "2022-08-18",
                            "calendar_days": 10,
                            "due_interest": 0,
                            "due_principal": 1007.19,
                            "fine_amount": null,
                            "has_interest": true,
                            "post_fixed_amount": 0,
                            "pre_fixed_amount": 38.24205854,
                            "principal_amortization_amount": 351.17794146,
                            "tax_amount": 0.28796591,
                            "total_amount": 389.42,
                            "workdays": 8
                        },
                        {
                            "business_due_date": "2022-09-20",
                            "due_date": "2022-09-19",
                            "calendar_days": 32,
                            "due_interest": 0,
                            "due_principal": 656.01205854,
                            "fine_amount": null,
                            "has_interest": true,
                            "post_fixed_amount": 0,
                            "pre_fixed_amount": 80.33658151,
                            "principal_amortization_amount": 309.08341849,
                            "tax_amount": 1.06448329,
                            "total_amount": 389.42,
                            "workdays": 21
                        },
                        {
                            "business_due_date": "2022-10-19",
                            "due_date": "2022-10-18",
                            "calendar_days": 29,
                            "due_interest": 0,
                            "due_principal": 346.92864005,
                            "fine_amount": null,
                            "has_interest": true,
                            "post_fixed_amount": 0,
                            "pre_fixed_amount": 42.49135995,
                            "principal_amortization_amount": 346.92864005,
                            "tax_amount": 2.01981854,
                            "total_amount": 389.42,
                            "workdays": 20
                        }
                    ],
                    "interest_subsidy_amount": 0,
                    "issue_amount": 1007.19,
                    "net_external_contract_fee_amount": 0,
                    "share_quantity": 2,
                    "total_iof": 2,
                    "prefixed_interest_rate": {
                        "annual_rate": 3,
                        "daily_rate": 0.00385824,
                        "monthly_rate": 0.12246205,
                        "interest_base": "calendar_days"
                    }
                }
            ],
            "related_parties": [
                {
                    "company_document_number": null,
                    "email": "teste.teste@yopmail.com",
                    "foundation_date": null,
                    "gender": "male",
                    "individual_document_number": "61592798071",
                    "is_pep": null,
                    "marital_status": null,
                    "mother_name": null,
                    "nationality": null,
                    "person_type": "natural",
                    "related_party_key": "16e3b6a8-bec0-4bd2-8b23-caaad54afd8c",
                    "role_type": "issuer",
                    "trading_name": null,
                    "simples_nacional_participant": null,
                    "spouse_document_number": null,
                    "profession": null,
                    "address": {
                        "city": "Bauru",
                        "complement": null,
                        "neighborhood": "Centro",
                        "number": "343",
                        "postal_code": "17057770",
                        "state": "SP",
                        "street": "Av Um"
                    },
                    "phone": {
                        "area_code": "14",
                        "country_code": "055",
                        "number": "936180266"
                    },
                    "attached_documents": [
                        {
                            "document_key": "2f7bfc50-d7c0-4d4e-a5ce-d8bba2aeb348",
                            "document_url": "https://storage.googleapis.com/dev-doc-api/documents/2f7bfc50-d7c0-4d4e-a5ce-d8bba2aeb348/sample.pdf",
                            "signature_url": null,
                            "document_type": "document_identification",
                            "signature_required": false,
                            "signed": false
                        }
                    ]
                }
            ]
        }
    ],
    "pagination": {
        "current_page": 1,
        "next_page": 2,
        "rows_per_page": 10,
        "total_pages": 1,
        "total_rows": 1,
        "contain_last_page": true
    }
}

```

---

# Do not disturb

URL: /en/documentation/emissao_de_divida/nao_me_perturbe

"Do not disturb" is a platform that was created by telecommunications operators that allows consumers to register their phone number to not actively receive telemarketing content. In the consigned credit context, its utilization was incorporated as a measure of the 'Autoregulação do Crédito Consignado' (Consigned Credit Autoregulation) promoted by entities such as the Febraban, ABBC and CNF, with its goal to protect consumers against abusive practices in credit offers.

As a financial institution that is adherant to the "Do not disturb", we have implemented a verification mechanism that guarantees that there are no unwanted calls to blacklisted telephone numbers. Through this API, it is possible to verify whether a specific number has requested to be inserted into the "Do not disturb" database prior to any active credit offers. 

This verification is essential to ensure compliance with good faith business practices respecting customers privacy. 

:::caution Caution
Consulting the database prior to prospecting crucial.
:::

## Using guide

To consult the database, one must send a phone number through the following endpoint.

ENDPOINT /do_not_disturb?phone_number=11999999999
METHOD GET

:::caution Caution
The number must be formatted as DDD + Number, for example: 11999999999.
:::

### Response

STATUS 200 - Number found on "Do not disturb" list
STATUS 404 - Number not found on "Do not disturb" list

:::caution Caution
If the number is found on the "Do not disturb" list, a call is not to be followed through.
:::

---

# Introduction

URL: /en/documentation/emissao_de_divida/reapresentacao_de_conta_bancaria

This page will aid you to disburse after receiving a disbursement error

### 1 - Updating disbursement account

First, you must update the disbursement bank account

#### Request

ENDPOINT /debt/DEBT/disbursement_bank_accounts
MÉTODO PUT

Request Body

**Using bank account data**

```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
		}]
}
```

**Using Pix Key**

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

### 2 - Updating disbursement date

Next, you must update the disbursement date

#### Request

ENDPOINT /debt/DEBT/disbursement_option
MÉTODO PATCH

Request Body

**Atualização de data de desembolso**

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

---

# Resend related party documents for the credit contract

URL: /en/documentation/emissao_de_divida/reenviar_documentos_das_partes_relacionadas

## Request

ENDPOINT /debt/ DEBT-KEY /related_party/ RELATED-PARTY-KEY /attached_document
METHOD POST

**Request Body**

```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"
}

```

### PATH PARAMS

| Field | Type | Description |
|---|---|---|
| `debt_key` * | string | Operatio debt_key |
| `related_party_key` * | string |  Key of the related party to whom the documents will be sent. |

### BODY PARAMS

| Field | Type | Description | Characters | 
|---|---| ---| ---|
| `document_identification` | string | Front side of RG or CNH for person_type "natural" | chave uuid | 
| `document_identification_back` | string | Back side of RG or CNH for person_type "natural". | chave uuid | 
| `wedding_certificate` | string |Marriage certificate for person_type "natural". | chave uuid | 
| `proof_of_residence` | string | Proof of residence for person_type "natural". | chave uuid | 
| `company_statute` | string | Articles of association for person_type "legal". | chave uuid | 
| `directors_election_minute` | string | Board of directors election minutes for person_type "legal".. |  uuid key | 

## Response

STATUS 201

**Response Body**

```json
"
{}
"
```

STATUS 400

**Response Body**

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

---

# Reprocess post-disbursement action

URL: /en/documentation/emissao_de_divida/reprocessar_acao_pos_desembolso

This endpoint can be used to retry payment of a post-disbursement action.

## Reprocess post-disbursement action by modifying action data

### Request

ENDPOINT /baas/action/ ACTION-KEY
METHOD PATCH

Request Body

```json
{
	"destination": {
		"name": "Nome do titular da conta destino",
		"account_digit": "1",
		"account_branch": "1012",
		"account_number": "12345",
		"document_number": "12345678911",
		"financial_institution_code_number": "341"
	},
	"transaction_amount": 2200
}
```

## Reprocessar ação pós desembolso

### Request

ENDPOINT /baas/action/action_retry/ ACTION-KEY
METHOD PATCH

:::info Informação
As respostas dos dois endpoints são as mesmas
:::

## Response

STATUS 200

Response Body

```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

Response Body

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

```

STATUS 402

Response Body

```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\"}"
}

```

## PATH PARAMS

| Field | Type | Description |
|---|---| ---|
| `action_key` * | string | Action key returned at the moment of credit operation creation. |

---

# Recalculate credit contract

URL: /en/documentation/emissao_de_divida/reprocessar_contrato

This endpoint can be used to recalculate a credit operation, either to change the destination account or to change the disbursement date. A new contract is then generated and sent for signing again.

:::danger **Attention!**

The response and subsequent callbacks occur as if a new operation had been created, using the same debt_key.
:::
## Request

ENDPOINT /debt/ DEBT-KEY /recalculate_operation
METHOD POST

**Request Body**

```json
{
    "financial": {"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"
    }
}

```

### PATH PARAMS

| Field | Type | Description |
|---|---| ---|
| `debt_key` * | string | Debt key returned at the moment of credit operation creation. |

### BODY PARAMS

| Field | Type | Description |  Characters |
|---|---| ---| ---| 
| `financial` * | string | Simplified financial object that includes the disbursement date | [Objeto financial](#object-financial)   |
| `disbursement_bank_accounts` * | object | object | List of bank information for the disbursement | [Objeto disbursement_bank_accounts](#object-disbursement_bank_accounts)   |
| `debt_key` * | string | Debt key returned at the moment of credit operation creation. | chave uuid |

### Object financial

| FIELD | Type | Description | Characters | 
|---|---|---|---|
| `disbursement_date` | date | Disbursement date. | 10 |

### Object disbursement_bank_accounts

A debt issuance must contain the bank information for disbursement; by default, it is an account of the borrower. This object must be a list with one or more accounts. The disbursement_bank_accounts (Bank Account) object must include:

| Field | Type | Description | Characters | 
|---|---|---|---|
| `name` | string |Account owner's name for disbursement - Mandatory only if the transfer method is TED or Pix, and if there is more than one disbursement account.  | 50 |
| `bank_code` | string | Financial institution's COMPE code (https://www.bcb.gov.br/pom/spb/estatistica/port/ASTR003.pdf) | 3 |
| `account_digit` | string |Account check digit (mandatory if available) | 1 |
| `branch_number` | string |Branch number - Mandatory only if the transfer method is TED or Pix. | 4 |
| `account_number` |string | Account number. CPF or CNPJ of the account owner for disbursement (mandatory if there is more than one disbursement account). |  10 |
| `document_number` |string | CPF or CNPJ of the account owner for disbursement - Mandatory only if the transfer method is TED or Pix, and if there is more than one disbursement account. |  11 ou 14 |

## Response

STATUS 200

**Response Body**

```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": [
        {
          "signature_url": "https://sign.qitech.com.br/s/hNrwjda",
          "signer_document_number": "94632180173",
          "signer_email": "pedro.alves@yopmail.com",
          "signer_external_key": "07a1c438-43a4-49a9-85a9-29667507453b",
          "signer_name": "Pedro Felipe Henrique Alves",
          "signer_role": "issuer"
        },
        {
          "signature_url": "https://sign.qitech.com.br/s/EaTajda",
          "signer_document_number": "34651104630",
          "signer_email": "patricia.tereza@yopmail.com",
          "signer_external_key": "61a1ea50-769a-410a-8ef8-09f0ce4611f6",
          "signer_name": "Patrícia Tereza Bernardes",
          "signer_role": "guarantor"
        }
      ],
      "urls": [
        "https://storage.googleapis.com/sandbox-doc-api/documents/abedfeab-dcf8-4e13-897b-da02c222cef4/SALGADINHO_SALETE_LTDA-PARMALAT-CCB-1907258737-20220512165254.pdf"
      ]
    },
    "contract_fee_amount": 50000,
    "contract_fees": [
      {
        "fee_amount": 50000,
        "fee_type": "tac"
      }
    ],
    "external_contract_fee_amount": 0,
    "external_contract_fees": [],
    "installments": [
      {
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2019-08-26",
        "calendar_days": 32,
        "digitable_line": null,
        "due_date": "2019-08-26",
        "due_interest": null,
        "due_principal": 10000000,
        "fine_amount": null,
        "has_interest": true,
        "installment_key": "81e4a732-d300-4e39-b6d5-2d9ac8df429b",
        "installment_number": 1,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 10000000,
        "original_pre_fixed_amount": 1125598.54,
        "original_principal_amortization_amount": 1000000,
        "original_total_amount": null,
        "paid_amount": 0,
        "paid_at": null,
        "payments": [],
        "post_fixed_amount": null,
        "pre_fixed_amount": 1125598.54,
        "principal_amortization_amount": 1000000,
        "tax_amount": 1312,
        "total_amount": null,
        "total_paid_amount": 0,
        "workdays": 22
      }, ... x [número de parcelas]
    ],
    "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

**Response Body**

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

```

---

# Editing disbursement bank account

URL: /en/documentation/emissao_de_divida/reprocessar_multiplas_datas/trocar_conta

## Request

ENDPOINT /debt/ DEBT-KEY /disbursement_bank_accounts
METHOD PUT

### PATH PARAMS

| Field                   | Type | Description |
|-------------------------|--------|-------------|
| `debt_key` *(required)* | string | Debt Id.    |

**Request Body**

```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
	}]
}
```

### BODY PARAMS

A debt issuance must contain the disbursement bank information, which should be an account belonging to the debtor.

| Field             | Type   | Description                                                                                     | Max. Caract. | 
|-------------------|--------|-------------------------------------------------------------------------------------------------|--------------|
| name *            | string | Account owner's name                                                                            | 50           |
| document_number * | string | Account owner's CPF                                                                             | 11           |
| bank_code *       | string | Financial institution COMPE code  (https://www.bcb.gov.br/pom/spb/estatistica/port/ASTR003.pdf) | 3            |
| branch_number *   | string | Bank agency Number (do not inform agency verifying digit!)                                      | 4            |
| account_number *  | string | Account aumber (do not inform account verifying digit!)                                         | 10           |
| account_digit *   | string | Account verifying digit (inform zero rather than letters)                                       | 1            |
| account_type      | enum   | [Enumerador Account Type](#enumerador-account-type) Account type                                | 1            |

## Response

STATUS 200

**Request Body**

```json
{}
```

STATUS 400

**Request Body**

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

---

# Editing disbursement date

URL: /en/documentation/emissao_de_divida/reprocessar_multiplas_datas/trocar_data

## Request

ENDPOINT /debt/ DEBT-KEY /disbursement_option
METHOD PATCH

### PATH PARAMS

| Field                   | Type   | Description |
|-------------------------|--------|-------------|
| `debt_key` *(required)* | string | Debt Id.    |

**Request Body**

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

### BODY PARAMS

| Field | Type | Description                                                                                          |
|---|---|------------------------------------------------------------------------------------------------------|
| `disbursement_date` | string | Operation disbursement date                                                                          |
| `status` | string | Indicates if date should be configured or removed |

## Response

STATUS 200

**Request Body**

```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": [
				"https://storage.googleapis.com/dev-doc-api/documents/a715175f-8d29-4929-9576-4b692d1e9610/BEATRIZCOUTODECARVALHO-TESTE-CCB-0000051370-20230707151409.pdf"
			]
		},
		"contract_fee_amount": 0.5,
		"contract_fees": [{
			"fee_amount": 0.5,
			"fee_type": "spread"
		}],
		"disbursed_issue_amount": 4530.98,
		"entry": null,
		"external_contract_fee_amount": 0.0,
		"external_contract_fees": [{
			"description": null,
			"fee_amount": 0.0,
			"fee_type": "spread",
			"net_fee_amount": 0.0,
			"rebate_bank_account": null,
			"tax_amount": 0.0
		}],
		"installments": [{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2023-08-29",
				"calendar_days": 50,
				"digitable_line": null,
				"due_date": "2023-08-28",
				"due_interest": 0.0,
				"due_principal": 4676.47,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "29c6e226-b710-4e3b-a5d6-62119b9d9547",
				"installment_number": 1,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 4676.47,
				"original_pre_fixed_amount": 164.86042852,
				"original_principal_amortization_amount": 25.13957148,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 164.86042852,
				"principal_amortization_amount": 25.13957148,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 0.10307224,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 36
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2023-09-29",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2023-09-28",
				"due_interest": 0.0,
				"due_principal": 4651.33042852,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "322d7973-4d2a-41a6-ad1b-2fef59c551b7",
				"installment_number": 2,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 4651.33042852,
				"original_pre_fixed_amount": 100.99385125,
				"original_principal_amortization_amount": 89.00614875,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 100.99385125,
				"principal_amortization_amount": 89.00614875,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 0.59117884,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 22
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2023-10-31",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2023-10-28",
				"due_interest": 0.0,
				"due_principal": 4562.32427977,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "a2d43778-0342-48f7-a0d2-c385773fa545",
				"installment_number": 3,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 4562.32427977,
				"original_pre_fixed_amount": 95.83242026,
				"original_principal_amortization_amount": 94.16757974,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 95.83242026,
				"principal_amortization_amount": 94.16757974,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 0.85711331,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 20
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2023-11-29",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2023-11-28",
				"due_interest": 0.0,
				"due_principal": 4468.15670003,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "9126aa9a-6bb0-44c6-8ea4-61fd68fcd936",
				"installment_number": 4,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 4468.15670003,
				"original_pre_fixed_amount": 97.01661904,
				"original_principal_amortization_amount": 92.98338096,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 97.01661904,
				"principal_amortization_amount": 92.98338096,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 1.08269849,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 20
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2023-12-29",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2023-12-28",
				"due_interest": 0.0,
				"due_principal": 4375.17331907,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "f0b363f9-0aca-4154-b14a-2c7933374abc",
				"installment_number": 5,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 4375.17331907,
				"original_pre_fixed_amount": 91.90128137,
				"original_principal_amortization_amount": 98.09871863,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 91.90128137,
				"principal_amortization_amount": 98.09871863,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 1.38358433,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 21
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-01-30",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2024-01-28",
				"due_interest": 0.0,
				"due_principal": 4277.07460043,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "c7c41dee-28a3-4b37-b2de-256fa0c9a0a9",
				"installment_number": 6,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 4277.07460043,
				"original_pre_fixed_amount": 92.86767319,
				"original_principal_amortization_amount": 97.13232681,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 92.86767319,
				"principal_amortization_amount": 97.13232681,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 1.61686471,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 20
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-02-29",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2024-02-28",
				"due_interest": 0.0,
				"due_principal": 4179.94227362,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "ee5d7b27-5160-49d3-9eb0-ec5a2f20e50d",
				"installment_number": 7,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 4179.94227362,
				"original_pre_fixed_amount": 90.75864903,
				"original_principal_amortization_amount": 99.24135097,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 90.75864903,
				"principal_amortization_amount": 99.24135097,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 1.90424304,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 21
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-04-01",
				"calendar_days": 29,
				"digitable_line": null,
				"due_date": "2024-03-28",
				"due_interest": 0.0,
				"due_principal": 4080.70092265,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "a9ec8c98-0061-4956-8af8-93d5742f6c1f",
				"installment_number": 8,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 4080.70092265,
				"original_pre_fixed_amount": 82.82984224,
				"original_principal_amortization_amount": 107.17015776,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 82.82984224,
				"principal_amortization_amount": 107.17015776,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 2.31123162,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 21
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-04-30",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2024-04-28",
				"due_interest": 0.0,
				"due_principal": 3973.53076489,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "bfd2ceab-74d4-4ff4-b099-c6ab986b7acb",
				"installment_number": 9,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 3973.53076489,
				"original_pre_fixed_amount": 86.2768573,
				"original_principal_amortization_amount": 103.7231427,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 86.2768573,
				"principal_amortization_amount": 103.7231427,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 2.50055752,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 20
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-05-29",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2024-05-28",
				"due_interest": 0.0,
				"due_principal": 3869.80762219,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "eb41f47f-ffcd-4d4d-8834-600cfe95b2a4",
				"installment_number": 10,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 3869.80762219,
				"original_pre_fixed_amount": 81.2859859,
				"original_principal_amortization_amount": 108.7140141,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 81.2859859,
				"principal_amortization_amount": 108.7140141,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 2.88831393,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 21
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-07-01",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2024-06-28",
				"due_interest": 0.0,
				"due_principal": 3761.09360809,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "13183e83-70cf-4990-a3cc-c979e43015b9",
				"installment_number": 11,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 3761.09360809,
				"original_pre_fixed_amount": 81.6642313,
				"original_principal_amortization_amount": 108.3357687,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 81.6642313,
				"principal_amortization_amount": 108.3357687,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 3.15365423,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 22
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-07-30",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2024-07-28",
				"due_interest": 0.0,
				"due_principal": 3652.75783939,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "a2ed3748-8567-4cab-a1ff-0cf6b2698d15",
				"installment_number": 12,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 3652.75783939,
				"original_pre_fixed_amount": 76.72681698,
				"original_principal_amortization_amount": 113.27318302,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 76.72681698,
				"principal_amortization_amount": 113.27318302,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 3.39026637,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 20
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-08-29",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2024-08-28",
				"due_interest": 0.0,
				"due_principal": 3539.48465638,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "1e009f23-2044-40ba-8249-a9077a2391b9",
				"installment_number": 13,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 3539.48465638,
				"original_pre_fixed_amount": 76.85245907,
				"original_principal_amortization_amount": 113.14754093,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 76.85245907,
				"principal_amortization_amount": 113.14754093,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 3.3865059,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 23
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-10-01",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2024-09-28",
				"due_interest": 0.0,
				"due_principal": 3426.33711545,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "e475d886-a596-4541-bcae-4986bf7c3609",
				"installment_number": 14,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 3426.33711545,
				"original_pre_fixed_amount": 74.39569823,
				"original_principal_amortization_amount": 115.60430177,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 74.39569823,
				"principal_amortization_amount": 115.60430177,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 3.46003675,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 22
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-10-29",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2024-10-28",
				"due_interest": 0.0,
				"due_principal": 3310.73281367,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "5584643d-4e65-4e99-9483-b3c1b051fd63",
				"installment_number": 15,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 3310.73281367,
				"original_pre_fixed_amount": 69.54252108,
				"original_principal_amortization_amount": 120.45747892,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 69.54252108,
				"principal_amortization_amount": 120.45747892,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 3.60529234,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 21
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-11-29",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2024-11-28",
				"due_interest": 0.0,
				"due_principal": 3190.27533475,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "23a0002c-49bf-4c22-a506-d89ae4372249",
				"installment_number": 16,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 3190.27533475,
				"original_pre_fixed_amount": 69.27011321,
				"original_principal_amortization_amount": 120.72988679,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 69.27011321,
				"principal_amortization_amount": 120.72988679,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 3.61344551,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 22
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-12-31",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2024-12-28",
				"due_interest": 0.0,
				"due_principal": 3069.54544796,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "5efbf6d0-84bc-4041-8a33-e9ab1bf82969",
				"installment_number": 17,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 3069.54544796,
				"original_pre_fixed_amount": 64.47633798,
				"original_principal_amortization_amount": 125.52366202,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 64.47633798,
				"principal_amortization_amount": 125.52366202,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 3.7569232,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 20
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-01-29",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2025-01-28",
				"due_interest": 0.0,
				"due_principal": 2944.02178595,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "e9bb5d68-8c93-43a4-b240-d68b0d1d6d08",
				"installment_number": 18,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 2944.02178595,
				"original_pre_fixed_amount": 63.9232354,
				"original_principal_amortization_amount": 126.0767646,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 63.9232354,
				"principal_amortization_amount": 126.0767646,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 3.77347756,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 21
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-03-05",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2025-02-28",
				"due_interest": 0.0,
				"due_principal": 2817.94502134,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "d6c34059-ba9b-4345-b937-35293f34a3dd",
				"installment_number": 19,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 2817.94502134,
				"original_pre_fixed_amount": 61.18574366,
				"original_principal_amortization_amount": 128.81425634,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 61.18574366,
				"principal_amortization_amount": 128.81425634,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 3.85541069,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 23
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-03-31",
				"calendar_days": 28,
				"digitable_line": null,
				"due_date": "2025-03-28",
				"due_interest": 0.0,
				"due_principal": 2689.130765,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "63fa4169-f1a9-43f0-a059-70e2df35ac7e",
				"installment_number": 20,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 2689.130765,
				"original_pre_fixed_amount": 52.68330953,
				"original_principal_amortization_amount": 137.31669047,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 52.68330953,
				"principal_amortization_amount": 137.31669047,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.10988855,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 18
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-04-29",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2025-04-28",
				"due_interest": 0.0,
				"due_principal": 2551.81407453,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "859ee4fa-f781-419b-8888-731b0f8fc01b",
				"installment_number": 21,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 2551.81407453,
				"original_pre_fixed_amount": 55.40726995,
				"original_principal_amortization_amount": 134.59273005,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 55.40726995,
				"principal_amortization_amount": 134.59273005,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.02836041,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 19
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-05-29",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2025-05-28",
				"due_interest": 0.0,
				"due_principal": 2417.22134448,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "d6e25388-d54d-42ca-8b46-ac70fa7aeb23",
				"installment_number": 22,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 2417.22134448,
				"original_pre_fixed_amount": 50.7741553,
				"original_principal_amortization_amount": 139.2258447,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 50.7741553,
				"principal_amortization_amount": 139.2258447,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.16702953,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 21
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-07-01",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2025-06-28",
				"due_interest": 0.0,
				"due_principal": 2277.99549978,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "d92f0e38-fa48-48c2-a79e-e8316fe5c870",
				"installment_number": 23,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 2277.99549978,
				"original_pre_fixed_amount": 49.46187558,
				"original_principal_amortization_amount": 140.53812442,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 49.46187558,
				"principal_amortization_amount": 140.53812442,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.20630606,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 21
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-07-29",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2025-07-28",
				"due_interest": 0.0,
				"due_principal": 2137.45737535,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "04aa2658-8fbe-4147-8a14-03c7bba13577",
				"installment_number": 24,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 2137.45737535,
				"original_pre_fixed_amount": 44.89766385,
				"original_principal_amortization_amount": 145.10233615,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 44.89766385,
				"principal_amortization_amount": 145.10233615,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.34291292,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 21
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-08-29",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2025-08-28",
				"due_interest": 0.0,
				"due_principal": 1992.35503921,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "af5b3343-7d91-46cf-a908-bf24e4e79907",
				"installment_number": 25,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 1992.35503921,
				"original_pre_fixed_amount": 43.25979382,
				"original_principal_amortization_amount": 146.74020618,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 43.25979382,
				"principal_amortization_amount": 146.74020618,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.39193437,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 23
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-09-30",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2025-09-28",
				"due_interest": 0.0,
				"due_principal": 1845.61483303,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "1e7981d6-4274-49f1-ab6e-a98d97485e78",
				"installment_number": 26,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 1845.61483303,
				"original_pre_fixed_amount": 40.07363891,
				"original_principal_amortization_amount": 149.92636109,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 40.07363891,
				"principal_amortization_amount": 149.92636109,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.48729599,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 21
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-10-29",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2025-10-28",
				"due_interest": 0.0,
				"due_principal": 1695.68847194,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "a07e171b-e2a6-49b4-9d6d-8124fff9d736",
				"installment_number": 27,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 1695.68847194,
				"original_pre_fixed_amount": 35.61823023,
				"original_principal_amortization_amount": 154.38176977,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 35.61823023,
				"principal_amortization_amount": 154.38176977,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.62064637,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 22
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-12-01",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2025-11-28",
				"due_interest": 0.0,
				"due_principal": 1541.30670217,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "0cd84cc5-0dd0-4318-99f9-178843d3d5b5",
				"installment_number": 28,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 1541.30670217,
				"original_pre_fixed_amount": 33.46622796,
				"original_principal_amortization_amount": 156.53377204,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 33.46622796,
				"principal_amortization_amount": 156.53377204,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.6850558,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 23
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-12-30",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2025-12-28",
				"due_interest": 0.0,
				"due_principal": 1384.77293013,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "24dc3c8b-ac3a-496e-8646-a1e66051090b",
				"installment_number": 29,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 1384.77293013,
				"original_pre_fixed_amount": 29.08739451,
				"original_principal_amortization_amount": 160.91260549,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 29.08739451,
				"principal_amortization_amount": 160.91260549,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.81611428,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 19
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2026-01-29",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2026-01-28",
				"due_interest": 0.0,
				"due_principal": 1223.86032464,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "bba128ee-b195-4a65-9caf-3ebe452d9d10",
				"installment_number": 30,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 1223.86032464,
				"original_pre_fixed_amount": 26.57354762,
				"original_principal_amortization_amount": 163.42645238,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 26.57354762,
				"principal_amortization_amount": 163.42645238,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.89135372,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 22
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2026-03-03",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2026-02-28",
				"due_interest": 0.0,
				"due_principal": 1060.43387227,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "35a03898-607a-4194-804c-bfd375c3ea45",
				"installment_number": 31,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 1060.43387227,
				"original_pre_fixed_amount": 23.02508598,
				"original_principal_amortization_amount": 166.97491402,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 23.02508598,
				"principal_amortization_amount": 166.97491402,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.99755918,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 20
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2026-03-31",
				"calendar_days": 28,
				"digitable_line": null,
				"due_date": "2026-03-28",
				"due_interest": 0.0,
				"due_principal": 893.45895824,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "0a8a83db-835d-46bc-8e24-c542c44d6e68",
				"installment_number": 32,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 893.45895824,
				"original_pre_fixed_amount": 17.50393379,
				"original_principal_amortization_amount": 172.49606621,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 17.50393379,
				"principal_amortization_amount": 172.49606621,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 5.16280726,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 20
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2026-04-29",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2026-04-28",
				"due_interest": 0.0,
				"due_principal": 720.96289203,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "07e3155c-30b5-4d13-8a31-0af4c7d5c9c5",
				"installment_number": 33,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 720.96289203,
				"original_pre_fixed_amount": 15.65418772,
				"original_principal_amortization_amount": 174.34581228,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 15.65418772,
				"principal_amortization_amount": 174.34581228,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 5.21817016,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 20
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2026-05-29",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2026-05-28",
				"due_interest": 0.0,
				"due_principal": 546.61707975,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "d1badc80-d7a2-4428-abf6-4877ac9f4497",
				"installment_number": 34,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 546.61707975,
				"original_pre_fixed_amount": 11.48178326,
				"original_principal_amortization_amount": 178.51821674,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 11.48178326,
				"principal_amortization_amount": 178.51821674,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 5.34305023,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 21
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2026-06-30",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2026-06-28",
				"due_interest": 0.0,
				"due_principal": 368.098863,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "4b466830-c432-4478-a1b9-bff6562834ee",
				"installment_number": 35,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 368.098863,
				"original_pre_fixed_amount": 7.99248758,
				"original_principal_amortization_amount": 182.00751242,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 7.99248758,
				"principal_amortization_amount": 182.00751242,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 5.44748485,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 20
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2026-07-29",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2026-07-28",
				"due_interest": 0.0,
				"due_principal": 186.09135058,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "0e8843ff-1339-40ab-a0b5-c450eca68e44",
				"installment_number": 36,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 186.09135058,
				"original_pre_fixed_amount": 3.90887682,
				"original_principal_amortization_amount": 186.09112318,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 3.90887682,
				"principal_amortization_amount": 186.09112318,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 5.56970732,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 22
			}
		],
		"iof_charge_method": "financed",
		"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

**Request Body**

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

---

# Seguro

URL: /en/documentation/emissao_de_divida/seguro

Na QI Tech disponibilizamos aos nossos clientes a possibilidade de oferecer seguro junto com a operação de crédito,
aqui você entenderá como usá-lo em nossas API's e entender melhor sobre esse novo produto.

:::caution Atenção
Esse produto está disponível apenas para parceiros cadastrados, por favor consulte um de nossos comerciais para mais detalhes.
:::

## Como usar

Para contratar ou simular uma dívida com a contratação de seguro, deverá ser adicionado a lista de rebates um rebate do tipo
"insurance_premium_qi", sem nenhum valor declarado, pois ele será calculado de acordo com o valor de emissão da proposta e
com o produto de seguro a ser contratado.

:::caution Atenção
Não é possível usar rebates do tipo tac ou **insurance_premium** junto com o **insurance_premium_qi**.
:::

Objeto Rebate

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

## Simulação de dívida

### Request

No exemplo abaixo, está descrita uma simulação de dívida, onde é pedido uma cotação de seguro.

ENDPOINT /fgts_simulation
MÉTODO POST

Request Body

```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"
      }
    ]
  }
}
```

### Response

STATUS 200

Response Body

```json
{
    "type": "debt",
    "key": "a445c71c-d752-4159-82bf-097d8125b66c",
    "status": "finished",
    "event_datetime": "2024-10-03 00:26:26",
    "data": {
        "interest_type": "pre_price_days",
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "interest_payment_month_period": 1,
        "principal_grace_period": 0,
        "principal_amortization_month_period": 1,
        "operation_type": "structured_operation",
        "post_fixed_interest_base": "workdays",
        "post_fixed_interest_rate": null,
        "prefixed_interest_rate": {
            "interest_base": "calendar_days_365",
            "annual_rate": 0.23872053,
            "monthly_rate": 0.018,
            "daily_rate": 0.00058669
        },
        "issue_date": "2023-03-03",
        "number_of_installments": 1,
        "requester_key": "9cdbe6f9-0e94-45a7-af5f-2cec36356493",
        "final_disbursement_amount": 119.01,
        "total_pre_fixed_amount": 23.3844066642,
        "iof_amount": 3.74,
        "cet": 0.0773,
        "annual_cet": 1.44428,
        "disbursement_date": "2023-03-03",
        "installments": [
            {
                "calendar_days": 212,
                "workdays": 145.0,
                "business_due_date": "2023-10-02",
                "due_date": "2023-10-01",
                "due_principal": 176.62,
                "has_interest": true,
                "post_fixed_amount": null,
                "pre_fixed_amount": 23.3844066642,
                "tax_amount": 3.0702854745495474,
                "total_amount": 200,
                "principal_amortization_amount": 176.6155933358,
                "installment_number": 1
            }
        ],
        "external_contract_fees": [
            {
                "fee_type": "spread",
                "amount_type": "absolute",
                "amount": 0.0,
                "fee_amount": 0.0,
                "tax_amount": 0.0,
                "net_fee_amount": 0.0,
                "csll_amount": 0,
                "irrf_amount": 0,
                "pis_amount": 0,
                "cofins_amount": 0,
                "amount_released": 0,
                "description": null
            },
            {
                "fee_type": "tac",
                "amount_type": "absolute",
                "amount": 0.0,
                "fee_amount": 0.0,
                "tax_amount": 0.0,
                "net_fee_amount": 0.0,
                "csll_amount": 0,
                "irrf_amount": 0,
                "pis_amount": 0,
                "cofins_amount": 0,
                "amount_released": 0,
                "description": null
            },
            {
                "fee_type": "insurance_premium_qi",
                "description": "insurance_premium_plus",
                "amount_type": "percentage",
                "amount": 30.0,
                "fee_amount": 52.99,
                "tax_amount": 0.0,
                "net_fee_amount": 52.99,
                "csll_amount": 0,
                "irrf_amount": 0,
                "pis_amount": 0,
                "cofins_amount": 0,
                "amount_released": 52.99,
                "description": null
            }
        ],
        "contract_fee_amount": 0.88,
        "external_contract_fee_amount": 52.99,
        "net_external_contract_fee_amount": 52.99,
        "contract_fees": [
            {
                "fee_type": "tac",
                "amount_type": "percentage",
                "amount": 0.5,
                "fee_amount": 0.88
            }
        ],
        "issue_amount": 176.62,
        "disbursed_issue_amount": 119.01,
        "assignment_amount": 176.62,
        "disbursement_options": [
            {
                "iof_amount": 3.74,
                "total_pre_fixed_amount": 23.3844066642,
                "cet": 0.0773,
                "annual_cet": 1.44428,
                "contract_fees": [
                    {
                        "fee_type": "tac",
                        "amount_type": "percentage",
                        "amount": 0.5,
                        "fee_amount": 0.88
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "tac",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "insurance_premium_qi",
                        "description": "insurance_premium_plus",
                        "amount_type": "percentage",
                        "amount": 30.0,
                        "fee_amount": 52.99,
                        "tax_amount": 0.0,
                        "net_fee_amount": 52.99,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 52.99,
                        "description": null
                    }
                ],
                "contract_fee_amount": 0.88,
                "external_contract_fee_amount": 52.99,
                "net_external_contract_fee_amount": 52.99,
                "disbursement_date": "2023-03-03",
                "first_due_date": "2023-10-01",
                "installments": [
                    {
                        "calendar_days": 212,
                        "workdays": 145.0,
                        "business_due_date": "2023-10-02",
                        "due_date": "2023-10-01",
                        "due_principal": 176.62,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 23.3844066642,
                        "tax_amount": 3.0702854745495474,
                        "total_amount": 200,
                        "principal_amortization_amount": 176.6155933358,
                        "installment_number": 1
                    }
                ],
                "issue_amount": 176.62,
                "disbursed_issue_amount": 119.01,
                "assignment_amount": 176.62,
                "final_disbursement_amount": 119.01,
                "prefixed_interest_rate": {
                    "interest_base": "calendar_days_365",
                    "annual_rate": 0.23872053,
                    "monthly_rate": 0.018,
                    "daily_rate": 0.00058669
                }
            }
        ]
    }
}
```

:::danger AVISO
É possível validar a elegibilidade da cobrança de seguro, já na simulação.\
Para isso, é obrigatório o envio da data de nascimento (**birth_date**), CPF do devedor (**document_number**) e o rebate "**insurance_premium_qi**".\
Se o CPF for elegível, teremos um retorno de sucesso, se não for elegível, a requisição de simulação retornará um erro.
:::

:::danger AVISO
O envio da data de nascimento (**birth_date**) **não é obrigatório na simulação com seguro**. Porém, na emissão de dívida temos a obrigatoriedade do envio desse campo, caso haja a contração do produto.
:::

## Consulta de elegibilidade de CPF para o seguro

Em posse dos dados de **CPF**, é possível a consulta da elegibilidade do CPF.

### Request

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

### Params

| Campo             | Descrição                               |
|-------------------|-----------------------------------------|
| `document_number` | Número de CPF do devedor                |
| `birth_date`      | Data de nascimento                      |
| `issue_amount`    | Valor de emissão da operação de crédito |

### Response

STATUS 200

Response Body

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

### Descrição
| Campo                        | Tipo   |
|------------------------------|--------|
| `elegible`            | boleean |

:::caution Atenção
Para um CPF com o retorno **"elegible": false**, tanto a simulação, quanto a emissão da dívida não serão possíveis com o envio de insurance_premium_qi na lista **rebates**.
:::

## Criação de dívida

Para criação de dívida com seguro é necessário alguns dados obrigatórios do tomador do crédito, como **endereço, telefone, email e
data de nascimento**. Se alguns desses dados for omtido a dívida não será emitida.

### Request

ENDPOINT /debt
MÉTODO POST

Request Body

```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"
}
```

### Response

STATUS 201

Response Body

```json
{
  "webhook_type": "debt",
  "key": "7a9bb512-7b38-4dbc-a109-1bc122b67a4a",
  "status": "waiting_signature",
  "event_datetime": "2023-03-03 18:06:18",
  "data": {
    "borrower": {
      "name": "PATRICIA APARECIDA DO NASCIMENTO PEREIRA DA SILVA",
      "document_number": "46338864879",
      "related_party_key": "1b98cff5-b1eb-4f3d-b337-716d76137770"
    },
    "contract": {
      "number": "0000062201/PAD",
      "urls": [
        "https://storage.googleapis.com/live-doc-api/documents/45e5b9c0-0f56-40a8-aace-d206f72c164d/QISCD-NOME_DO_DEVEDOR-CCB-0000000002-20230317183044.pdf"
      ],
      "external_contract_key": "35b882b1-9937-41d3-bf43-e0d30062dc1b",
      "signature_information": [
        {
          "signer_name": "PATRICIA APARECIDA DO NASCIMENTO PEREIRA DA SILVA",
          "signer_document_number": "46338864879",
          "signer_role": "issuer",
          "signer_email": "email@email.com",
          "signer_external_key": "3a50f3cd-8178-49c8-9fc2-984b4caa4a5b",
          "signature_url": "https://sandbox.sign.qitech.com.br/s/ml9Myfp"
        }
      ]
    },
    "requester_identifier_key": "7a9bb512-7b38-4dbc-a109-1bc122b67a4a",
    "iof_charge_method": "financed",
    "collaterals": [],
    "contract_fees": [],
    "external_contract_fees": [
      {
        "fee_type": "insurance_premium_qi",
        "description": "insurance_premium_plus",
        "fee_amount": 52.99,
        "tax_amount": 0,
        "net_fee_amount": 52.99
      }
    ],
    "external_contract_fee_amount": 52.99,
    "net_external_contract_fee_amount": 52.99,
    "contract_fee_amount": 0,
    "issue_amount": 176.62,
    "assignment_amount": 176.62,
    "cet": "7,6200%",
    "annual_cet": "141,3472%",
    "number_of_installments": 1,
    "base_iof": 3.0702854745495474,
    "additional_iof": 0.671156,
    "total_iof": 3.74,
    "prefixed_interest_rate": {
      "annual_rate": 0.23872053,
      "created_at": "2024-09-11T18:06:07",
      "daily_rate": 0.00058669,
      "interest_base": "calendar_days_365",
      "monthly_rate": 0.018
    },
    "installments": [
      {
        "accrual_reference_date": null,
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2023-10-02",
        "calendar_days": 212,
        "digitable_line": null,
        "due_date": "2023-10-01",
        "due_interest": 0,
        "due_principal": 176.62,
        "fine_amount": null,
        "has_interest": true,
        "installment_history": [],
        "installment_key": "6087c6c1-d665-4ba8-bfb2-b447cd57d3e3",
        "installment_number": 1,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 176.62,
        "original_pre_fixed_amount": 23.3844066642,
        "original_principal_amortization_amount": 176.6155933358,
        "original_total_amount": 200,
        "paid_amount": 0,
        "paid_at": null,
        "post_fixed_amount": null,
        "pre_fixed_amount": 23.3844066642,
        "principal_amortization_amount": 176.6155933358,
        "qr_code_key": null,
        "qr_code_url": null,
        "renegotiation_proposal_key": null,
        "tax_amount": 3.0702854745495474,
        "total_accrual_amount": null,
        "total_amount": 200,
        "total_paid_amount": 0,
        "workdays": 145
      }
    ],
    "total_pre_fixed_amount": 23.3844066642
  }
}
```

## Webhooks

### Seguro emitido

 A emissão do seguro será feito após o desembolso da operação, o seguinte webhook será enviado quando o
 seguro terminar de ser emitido com os dados do seguro.

:::caution Atenção
Ao receber o webhook de bilhete emitido é obrigatório a transmissão do documento do bilhete gerado para o tomador de crédito.
:::

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"
}
```

### Seguro cancelado

O seguro pode ser cancelado quando o tomador do crédito queira desistir de operação de créditoe a operação for revertida, se algum limite de cobertura for ultrapassado (tornando inelegível a contratação do seguro)
ou quando tomador acaba desistindo somente do seguro.

:::caution Atenção
O bilhete de seguro só pode ser cancelado totalmente dentro de 7 dias corridos do desembolso da operação de crédito,
caso queira cancelar após isso o valor devolvido vai ser proporcional a duração do seguro.
:::

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"
}
```

### Motivos de cancelamento

| cancel_reason                 | Descrição                              |
|-------------------------------|----------------------------------------|
| `reversed_operation`          | Operação revertida e seguro cancelados |
| `cover_limit_amount_exceeded` | Somente o seguro foi cancelado. Algum limite de cobertura foi ultrapassado e não foi possível a emissão do seguro  |
| `insurance_premium_cancel`    | Somente o seguro foi cancelado. Cancelamento do tomador direto com a seguradora  |

## Consulta do seguro

### Request

ENDPOINT /debt/[debt_key]/insurance_premiums
METHOD GET

### Response

STATUS 200

Response Body

```json
{
  "data": [
    {
      "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,
      "customer": {
        "customer_key": "cd587fa8-3abd-4023-99ab-957df60933a5",
        "document_number": "08556878350",
        "name": "Wilker Oliveiraço",
        "birth_date": "1998-03-21",
        "email": "urich.oliveira@yopmail.com",
        "phone": {
          "country_code": "55",
          "area_code": "11",
          "number": "966931427"
        },
        "address": {
          "postal_code": "56821686",
          "state": "CE",
          "city": "Ceará",
          "neighborhood": "Marmiteiros",
          "street": "Conjunto João Gabriel da Mata",
          "number": "95",
          "complement": ""
        }
      },
      "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
        },
        {
          "cover_amount": 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
    }
  ],
  "pagination": {
    "current_page": 0,
    "next_page": 0,
    "rows_per_page": 1
  }
}
```

### Request

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

### Response

STATUS 200

Response Body

```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,
  "customer": {
    "customer_key": "cd587fa8-3abd-4023-99ab-957df60933a5",
    "document_number": "08556878350",
    "name": "Wilker Oliveiraço",
    "birth_date": "1998-03-21",
    "gender": "male",
    "email": "urich.oliveira@yopmail.com",
    "phone": {
      "country_code": "55",
      "area_code": "11",
      "number": "966931427"
    },
    "address": {
      "postal_code": "56821686",
      "state": "CE",
      "city": "Ceará",
      "neighborhood": "Marmiteiros",
      "street": "Conjunto João Gabriel da Mata",
      "number": "95",
      "complement": ""
    }
  },
  "covers": [
    {
      "cover_amount": 300,
      "cover_type": "permanent_disability",
      "cover_prize_amount": 572.82
    },
    {
      "cover_amount": 300,
      "cover_type": "accidental_death",
      "cover_prize_amount": 572.82
    },
    {
      "cover_amount": 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
}
```

## Consulta do documento bilhete

:::caution Atenção
O link do documento é expirável e tem uma duração de 15 minutos.
:::

### Request

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

### Response

STATUS 200

Response Body

```json
{
    "document_key": "a11dc0fe-51ed-41aa-bb40-bca80d6e515b",
    "signed_document_url": null,
    "document_url": "https://storage.googleapis.com/dev-doc-api-private/documents/a11dc0fe-51ed-41aa-bb40-bca80d6e515b/TESTEELECTRONIC2.pdf?Expires=1726081733&GoogleAccessId=doc-api-signed-url-service-acc%40qicredit-dev.iam.gserviceaccount.com&Signature=CNY8ch%2BQ2FuLXrbRZGLhH41A7SkNJRUUq%2FJoegTIMeXEiNImD%2FkPoEHyNtOXWUUR8JtEL6ppT0s1tXA9oFfLjzOtvzMOfpal0TwJDLSsX9r4HxcxvzFZUJELAn9yIAcRhqR%2BnzUn0WYyQA%2B0hAalz%2Bj274pXhIExqJJR4LiDUAkzRE3WD0GOvsV7afAoqQ8P3Xxj4mvOM3P%2BuFhgP6hcJmq0K%2B5qHssF3DtvpQFLcLaQ7T45YoQDCnDFGztD0Un0%2BNBwv4n2142rV3rMu9h3DzLmQbEjaeYgHb4wq2kOfyfEUSbaU683d6hA7CNyrPWMeoi%2F%2BgTfFFadbcGCMGX2%2BQ%3D%3D",
    "expiration_datetime": "2023-03-03T19:08:53.000Z"
}
```

---

# Legacy debt simulation

URL: /en/documentation/emissao_de_divida/simulacao_de_divida_antigo

At QI Tech, we provide our clients with the ability to simulate the values of a credit operation before its actual issuance. The simulation follows the same pattern as the debt issuance request, but it is not necessary to provide the borrower's registration data and disbursement account.

## Request

In the example below, a debt simulation request is described.

ENDPOINT /debt_simulation
METHOD POST

Request Body

**Due date and installment amount**

```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"
                }
            }
        ]
    }
}
```

**Rate and installment date**
```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"
    ]
  }
}
```

## Response

STATUS 200

Response Body

```json
{
    "type": "debt",
    "key": "bf84379c-d4cf-4f16-a63c-865c129e6fce",
    "status": "finished",
    "event_datetime": "2025-03-27 22:28:37",
    "data": {
        "interest_type": "pre_price_days",
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "interest_payment_month_period": 1,
        "principal_grace_period": 0,
        "principal_amortization_month_period": 1,
        "operation_type": "structured_operation",
        "post_fixed_interest_base": "workdays",
        "post_fixed_interest_rate": null,
        "prefixed_interest_rate": {
            "interest_base": "calendar_days_365",
            "annual_rate": 0.23872053,
            "monthly_rate": 0.0179999999,
            "daily_rate": 0.0005866899
        },
        "issue_date": "2026-09-06",
        "number_of_installments": 2,
        "requester_key": "f2b3b903-aa41-4a79-8b2f-abc3cc5a6590",
        "final_disbursement_amount": 701.6,
        "total_pre_fixed_amount": 153.0,
        "iof_amount": 18.34,
        "cet": 0.0219,
        "annual_cet": 0.297,
        "disbursement_date": "2026-09-06",
        "installments": [
            {
                "calendar_days": 207,
                "workdays": 140,
                "business_due_date": "2027-04-01",
                "due_date": "2027-04-01",
                "due_principal": 729.94,
                "has_interest": true,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 94.22564648,
                "tax_amount": 8.22329794,
                "total_amount": 578.69,
                "principal_amortization_amount": 484.46435352,
                "installment_number": 1
            },
            {
                "calendar_days": 366,
                "workdays": 253,
                "business_due_date": "2028-04-03",
                "due_date": "2028-04-01",
                "due_principal": 245.47564648,
                "has_interest": true,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 58.77435352,
                "tax_amount": 7.3470861,
                "total_amount": 304.25,
                "principal_amortization_amount": 245.47564648,
                "installment_number": 2
            }
        ],
        "external_contract_fees": [
            {
                "fee_type": "tac",
                "amount_type": "absolute",
                "amount": 10.0,
                "fee_amount": 10.0,
                "tax_amount": 1.42,
                "net_fee_amount": 8.58,
                "csll_amount": 0,
                "irrf_amount": 0,
                "pis_amount": 0,
                "cofins_amount": 0,
                "amount_released": 8.58,
                "description": null
            },
            {
                "fee_type": "spread_tax_free",
                "amount_type": "absolute",
                "amount": 0.0,
                "fee_amount": 0.0,
                "tax_amount": 0.0,
                "net_fee_amount": 0.0,
                "csll_amount": 0,
                "irrf_amount": 0,
                "pis_amount": 0,
                "cofins_amount": 0,
                "amount_released": 0,
                "description": null
            },
            {
                "fee_type": "tac_tax_free",
                "amount_type": "absolute",
                "amount": 0.0,
                "fee_amount": 0.0,
                "tax_amount": 0.0,
                "net_fee_amount": 0.0,
                "csll_amount": 0,
                "irrf_amount": 0,
                "pis_amount": 0,
                "cofins_amount": 0,
                "amount_released": 0,
                "description": null
            },
            {
                "fee_type": "insurance_premium",
                "amount_type": "absolute",
                "amount": 0.0,
                "fee_amount": 0.0,
                "tax_amount": 0.0,
                "net_fee_amount": 0.0,
                "csll_amount": 0,
                "irrf_amount": 0,
                "pis_amount": 0,
                "cofins_amount": 0,
                "amount_released": 0,
                "description": null
            }
        ],
        "contract_fee_amount": 3.65,
        "external_contract_fee_amount": 10.0,
        "net_external_contract_fee_amount": 8.58,
        "contract_fees": [
            {
                "fee_type": "spread",
                "amount_type": "percentage",
                "amount": 0.5,
                "fee_amount": 3.65
            },
            {
                "fee_type": "spread_ted_fee",
                "amount_type": "absolute",
                "amount": 3.0,
                "fee_amount": 3.0
            }
        ],
        "issue_amount": 729.94,
        "disbursed_issue_amount": 701.6,
        "assignment_amount": 736.59,
        "disbursement_options": [
            {
                "iof_amount": 18.34,
                "total_pre_fixed_amount": 153.0,
                "cet": 0.0219,
                "annual_cet": 0.297,
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "amount_type": "percentage",
                        "amount": 0.5,
                        "fee_amount": 3.65
                    },
                    {
                        "fee_type": "spread_ted_fee",
                        "amount_type": "absolute",
                        "amount": 3.0,
                        "fee_amount": 3.0
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "tac",
                        "amount_type": "absolute",
                        "amount": 10.0,
                        "fee_amount": 10.0,
                        "tax_amount": 1.42,
                        "net_fee_amount": 8.58,
                        "csll_amount": 0.0,
                        "irrf_amount": 0.0,
                        "pis_amount": 0.0,
                        "cofins_amount": 0.0,
                        "amount_released": 8.58,
                        "description": null
                    },
                    {
                        "fee_type": "spread_tax_free",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0.0,
                        "description": null
                    },
                    {
                        "fee_type": "tac_tax_free",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0.0,
                        "description": null
                    },
                    {
                        "fee_type": "insurance_premium",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0.0,
                        "description": null
                    }
                ],
                "contract_fee_amount": 3.65,
                "external_contract_fee_amount": 10.0,
                "net_external_contract_fee_amount": 8.58,
                "disbursement_date": "2026-09-06",
                "first_due_date": "2027-04-01",
                "installments": [
                    {
                        "calendar_days": 207,
                        "workdays": 140,
                        "business_due_date": "2027-04-01",
                        "due_date": "2027-04-01",
                        "due_principal": 729.94,
                        "has_interest": true,
                        "post_fixed_amount": 0,
                        "pre_fixed_amount": 94.22564648,
                        "tax_amount": 8.22329794,
                        "total_amount": 578.69,
                        "principal_amortization_amount": 484.46435352,
                        "installment_number": 1
                    },
                    {
                        "calendar_days": 366,
                        "workdays": 253,
                        "business_due_date": "2028-04-03",
                        "due_date": "2028-04-01",
                        "due_principal": 245.47564648,
                        "has_interest": true,
                        "post_fixed_amount": 0,
                        "pre_fixed_amount": 58.77435352,
                        "tax_amount": 7.3470861,
                        "total_amount": 304.25,
                        "principal_amortization_amount": 245.47564648,
                        "installment_number": 2
                    }
                ],
                "issue_amount": 729.94,
                "disbursed_issue_amount": 701.6,
                "assignment_amount": 736.59,
                "final_disbursement_amount": 701.6,
                "prefixed_interest_rate": {
                    "interest_base": "calendar_days_365",
                    "annual_rate": 0.23872053,
                    "monthly_rate": 0.0179999999,
                    "daily_rate": 0.0005866899
                }
            }
        ]
    }
}

```

## Definitions

### Request Body

### Borrower Object
| Field | Type  | Description  | Enum |
|---|---|---|---|
| **person_type** | object | Legal nature of the operation borrower   |  natural or legal |

### Financial Object
| Field  | Type   | Description | Max. Char. |
|---|--- |---|---|
| **amout**                  | float  | Issue/nominal value of the credit operation                                                             | -            |
| **interest_type**          | object | **[Interest Type Enumerator](#enumerator-interest-type)** - Amortization method and interest calculation form | -            |
| **credit_operation_type**  | object | **[Credit Operation Type Enumerator](#enumerator-credit-operation-type)** - Type of credit contract     | -            |
| **annual_interest_rate**   | float  | Pre-fixed interest rate expressed as decimal per year                                                         | -            |
| **disbursement_date**      | date   | Operation disbursement date                                                                              | -            |
| **interest_grace_period**  | int    | Interest grace period (in months)                                                                                | -            |
| **principal_grace_period** | int    | Principal grace period                                                                               | -            |
| **number_of_installments** | int    | Number of installments of the credit operation                                                                   | -            |
| **fine_configuration**     | object | **[fine_configuration Object](#fine-configuration-object)** - Interest and late fee configuration      | -            |

### Fine Configuration Object
| Field                  | Type  | Description                                                                            | Max. Char. |
|---|---|---|---|
| **contract_fine_rate** | float | Late fee percentage expressed as decimal                                   | -            |
| **interest_base**      | enum  | **[Interest Base Enumerator](#enumerator-interest-base)** - Interest calculation base | -            |
| **monthly_rate**       | float | Late interest percentage per month expressed as decimal                             | -            |

### Response Body
| Field                      | Type   | Description                       | Max. Char. |
|----------------------------|--------|---------------------------------|--------------|
| **data.data**           | object | **[Data Object](#data-object)** | -            |
| **data.event_datetime** | date   | Simulation generation timestamp | -            |
| **data.key**            | string | Unique simulation key        | -            |
| **data.status**         | string | _finished_                      | -            |
| **data.type**           | string | _debt_                          | -            |

### Data Object
| Field                                   | Type   | Description                                                                                                                     | Max. Char. |
|-----------------------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------|--------------|
| **annual_cet**                          | float  | Total effective cost expressed as decimal per year                                                                                | -            |
| **assignment_amount**                   | float  | Credit operation acquisition value                                                                                     | -            |
| **cet**                                 | float  | Total effective cost expressed as decimal per month                                                                                | -            |
| **contract_fee_amount**                 | float  | QI Tech fee charged on the operation                                                                                            | -            |
| **contract_fees**                       | object | **[Contract Fees Object](#contract-fees-object)** - List of QI Tech fees charged on the operation                            | -            |
| **credit_operation_type**               | enum   | **[Credit Operation Type Enumerator](#enumerator-credit-operation-type)** - Type of credit contract                       | -            |
| **disbursed_issue_amount**              | float  | Disbursed value in the credit operation                                                                                     | -            |
| **disbursement_date**                   | date   | Operation disbursement date                                                                                                | -            |
| **disbursement_options**                | list   | List of operation disbursement options (financial values of the operation may vary according to disbursement day) | -            |
| **external_contract_fee_amount**        | float  | Fee value charged on the operation rebated by QI to partner                                                                 | -            |
| **external_contract_fees**              | list   | **[Contract Fees Object](#contract-fees-object)** - List of fees charged on the operation rebated by QI to partner         | -            |
| **final_disbursement_amount**           | float  | Value effectively disbursed to the borrower                                                                                | -            |
| **installments**                        | list   | **[Installments Object](#installments-object)** - Operation installments                                                        | -            |
| **interest_grace_period**               | int    | Interest grace period (in months)                                                                                                  | -            |
| **interest_payment_month_period**       | int    | Interest charge frequency in installments (in months)                                                                       | -            |
| **interest_type**                       | enum   | **[Interest Type Enumerator](#enumerator-interest-type)** - Amortization method and interest calculation form                 | -            |
| **iof_amount**                          | float  | Total IOF value (composed of the sum of Base IOF and Total IOF)                                                               | -            |
| **issue_amount**                        | float  | Issue/nominal value of the credit operation                                                                               | -            |
| **issue_date**                          | date   | Operation contract issue date                                                                                        | -            |
| **net_external_contract_fee_amount**    | float  | Net fee value charged on the operation rebated by QI to partner                                                         | -            |
| **operation_type**                      | enum   | **[Operation Type Enumerator](#enumerator-operation-type)**                                                                   | -            |
| **post_fixed_interest_base**            | enum   | **[Interest Base Enumerator](#enumerator-interest-base)** - Interest calculation base                                          | -            |
| **post_fixed_interest_rate**            | object | **[Interest Rate Object](#interest-rate-object)** - Post-fixed interest indexer of the contract                                | -            |
| **prefixed_interest_rate**              | object | **[Interest Rate Object](#interest-rate-object)** - Pre-fixed nominal interest rate of the contract                              | -            |
| **principal_amortization_month_period** | int    | Principal charge frequency in installments (in months)                                                                   | -            |
| **principal_grace_period**              | int    | Principal grace period (in months)                                                                                      | -            |
| **requester_key**                       | string | Unique identifying key of the partner within QI.                                                                          | -            |
| **total_pre_fixed_amount**              | float  | Total interest paid by the borrower in the credit operation                                                                       | -            |

### Contract Fees Object
| Field           | Type  | Description                                                                                           | Max. Char. |
|-----------------|-------|-----------------------------------------------------------------------------------------------------|--------------|
| **amount**      | float | Fee value (in percentage or absolute value, depending on the value informed in the _amount_type_ field | -            |
| **amount_type** | enum  | **[amount_type Enumerators](#enumerator-amount-type)** - Fee value unit                   | -            |
| **fee_amount**  | float | Absolute fee value charged on the operation                                                           | -            |
| **fee_type**    | enum  | **[Fee Type Enumerator](#enumerator-fee-type)** - Type of fee charged on the operation                   | -            |

### Installments Object
| Field                             | Type    | Description                                                                      | Max. Char. |
|-----------------------------------|---------|--------------------------------------------------------------------------------|--------------|
| **business_due_date**             | date    | Installment due date on business day                                      | -            |
| **calendar_days**                 | int     | How many calendar days between one installment and another                                | -            |
| **due_date**                      | date    | Installment due date on calendar day                                   | -            |
| **due_principal**                 | float   | Remaining principal on installment due date before its payment | -            |
| **has_interest**                  | boolean | _true_ - Interest incidence indicator on installment                           | -            |
| **installment_number**            | int     | Installment number                                                              | -            |
| **post_fixed_amount**             | float   | Post-fixed interest value paid on installment                                      | -            |
| **pre_fixed_amount**              | float   | Pre-fixed interest value paid on installment                                      | -            |
| **principal_amortization_amount** | float   | Amortization value paid on installment                                           | -            |
| **tax_amount**                    | float   | Installment Base IOF                                                            | -            |
| **total_amount**                  | float   | Total installment value                                                         | -            |
| **workdays**                      | int     | How many business days between one installment and another                                   | -            |

### Interest Rate Object
| Field             | Description                                                                             | Max. Char. |
|-------------------|---------------------------------------------------------------------------------------|--------------|
| **annual_rate**   | Pre/post interest rate expressed as decimal per year                                      | -            |
| **daily_rate**    | Pre/post interest rate expressed as decimal per day                                      | -            |
| **interest_base** | **[Interest Base Enumerator](#enumerator-interest-base)** - Interest calculation base | -            |
| **monthly_rate**  | Pre/post interest rate expressed as decimal per month                                      | -            |

# Enumerators

### _Person Type_ Enumerator
| Enumerator             | Description             |
|------------------------|-----------------------|
| **legal**   | Legal entity        |
| **natural**    | Natural person    |

### _Account Type_ Enumerator
| Enumerator             | Description             |
|------------------------|-----------------------|
| **checking_account**   | Checking account        |
| **deposit_account**    | Deposit account     |
| **guaranteed_account** | Guaranteed account     |
| **investment_account** | Investment account |
| **payment_account**    | Payment account    |
| **saving_account**     | Savings account        |
| **salary_account**     | Salary account         |

### _Amount Type_ Enumerator
| Enumerator             | Description             |
|------------------------|-----------------------|
| **absolute**           | Absolute value        |
| **percentage**         | Percentage value      |

### _Interest Type_ Enumerator
| Enumerator           | Description                                                                                                                                                                |
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **pre_price_days**   | Price amortization method (equal installments) with pre-fixed interest calculation per day                                                                                     |
| **pre_price**        | Price amortization method (equal installments) with pre-fixed interest calculation in fixed periods (30 days)                                                                |
| **pre_sac**          | SAC amortization method (constant amortization) with pre-fixed interest calculation per day                                                                                 |
| **post_sac**         | SAC amortization method (constant amortization) with interest calculation based on a pre-fixed rate + post-fixed indexer (cdi, ipca or igpm) per day                  |
| **post_price**       | Price amortization method (equal installments) with interest calculation based on a pre-fixed rate + post-fixed indexer (cdi, ipca or igpm) in fixed periods (30 days) |
| **post_price_days**  | Price amortization method (equal installments) with interest calculation based on a pre-fixed rate + post-fixed indexer (cdi, ipca or igpm) per day                      |

### _Credit Operation Type_ Enumerator
| Enumerator    | Description                      |
|---------------|--------------------------------|
| **ccb**       | Bank Credit Note     |
| **cce**       | Export Credit Note |
| **cci**       | Real Estate Credit Note  |
| **nce**       | Export Credit Note   |

### _Interest Base_ Enumerator
| Enumerator            | Description                                                                 |
|-----------------------|---------------------------------------------------------------------------|
| **workdays**          | Interest calculation base in business days considering a year of 252 days    |
| **calendar_days**     | Interest calculation base in calendar days considering a year of 360 days |
| **calendar_days_365** | Interest calculation base in calendar days considering a year of 365 days |

### _Fee Type_ Enumerator
Each fee type must be previously enabled and configured by QI Tech

| Enumerator            | Description                                                                  |
|-----------------------|----------------------------------------------------------------------------|
| **tac**               | Account opening fee                                             |
| **spread**            | Premium charged on the credit operation acquisition value                  |
| **warranty_analysis** | Warranty analysis fee                                             |
| **ted_fee**           | TED fee                                                              |
| **spread_ted_fee**    | TED fee premium charged on the credit operation acquisition value |

---

# New debt simulation

URL: /en/documentation/emissao_de_divida/simulacao_de_divida_novo

At QI Tech we provide our clients with the possibility to simulate the values of a credit operation before its actual issuance. The simulation follows the same pattern as the debt issuance request, but it is not necessary to provide the cadastral data and disbursement account of the debtor.

## Request

In the example below, a debt simulation request is described.

ENDPOINT /v2/credit_operation/simulation
METHOD POST

Request Body

**Due date and installment amount**

```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
}
```

**Disbursed amount and installments**

 ```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
      }
    ]
  }
 ```

## Response

STATUS 200

Response Body

```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": [
    {
      "amount": 0.0,
      "fee_amount": 0.0,
      "amount_type": "absolute",
      "fee_type": "tac",
      "type": "external"
    },
    {
      "amount": 0.0,
      "fee_amount": 0.0,
      "amount_type": "absolute",
      "fee_type": "spread",
      "type": "external"
    },
    {
      "amount": 0.2,
      "fee_amount": 0.07,
      "amount_type": "percentage",
      "fee_type": "spread",
      "type": "internal"
    }
  ],
  "first_due_date": "2024-09-25",
  "installments": [
    {
      "due_date": "2024-09-25",
      "amount": 19.5,
      "due_principal": 36.14,
      "due_interest": 0.0,
      "has_interest": true,
      "period": 0.6129032258064516,
      "period_workdays": 0.6190476190476191,
      "calendar_days": 19,
      "workdays": 13,
      "installment_number": 1,
      "period_to_disbursement": 0.6129032258064516,
      "prefixed_amount": 1.58227236,
      "period_workdays_to_disbursement": 1.0,
      "calendar_days_to_disbursement": 19,
      "workdays_to_disbursement": 13,
      "tax_amount": 0.02791582,
      "principal_amortization_amount": 17.91772764
    },
    {
      "due_date": "2024-10-25",
      "amount": 19.5,
      "due_principal": 18.22227236,
      "due_interest": 0.0,
      "has_interest": true,
      "period": 1.0,
      "period_workdays": 1.0,
      "calendar_days": 30,
      "workdays": 22,
      "installment_number": 2,
      "period_to_disbursement": 1.6129032258064515,
      "prefixed_amount": 1.27772764,
      "period_workdays_to_disbursement": 2.0,
      "calendar_days_to_disbursement": 49,
      "workdays_to_disbursement": 35,
      "tax_amount": 0.07321709,
      "principal_amortization_amount": 18.22227236
    }
  ],
  "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
}

```

## Definitions

### Request Body

### Payload
| Field  | Type   | Description | Max. Chars. |
|---|--- |---|---|
| **credit_operation_type**                 | enum    | **[Credit Operation Type Enumerator](#credit-operation-type-enumerator)** - Credit contract type      | -            |
| **disbursed_issue_amount**                | float   | Issue/nominal amount of the credit operation      | -            |
| **disbursement_date**                     | date    | Disbursement date of the operation      | -            |
| **first_due_date**                        | date    | Due date of the first installment      | -            |
| **force_installments_on_workdays**        | boolean | _true_ - Indicator for installments scheduled on workdays     | -            |
| **interest_type**                         | enum    | **[Interest Type Enumerator](#interest-type-enumerator)** - Amortization method and interest calculation form      | -            |
| **issuer_person_type**                    | enum    | **[Person Type Enumerator](#person-type-enumerator)**      | -            |
| **monthly_interest_rate**                 | float   | Pre-fixed monthly interest rate of the contract      | -            |
| **number_of_installments**                | int     | Number of installments of the credit operation      | -            |
| **principal_amortization_month_period**   | int     | Number of months for principal amortization      | -            |
| **installments**                          | list    | **[Installments Object](#installments-object)** - Operation installments      | -            |

### Response Body

### Payload
| Field                                   | Type   | Description                                                                                                                     | Max. Chars. |
|-----------------------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------|--------------|
| **annual_cet**                          | float  | Total effective cost expressed in decimal per year                                                                                | -            |
| **assignment_amount**                   | float  | Acquisition amount of the credit operation                                                                                     | -            |
| **cet**                                 | float  | Total effective cost expressed in decimal per month                                                                                | -            |
| **fees**                                | object | **[Fees Object](#fees-object)** - List of QI Tech fees charged on the operation                            | -            |
| **disbursed_amount**                    | float  | Amount disbursed in the credit operation                                                                                     | -            |
| **disbursement_date**                   | date   | Disbursement date of the operation                                                                                                | -            |
| **installments**                        | list   | **[Installments Response Object](#installments-response-object)** - Operation installments                                                        | -            |
| **interest_type**                       | enum   | **[Interest Type Enumerator](#interest-type-enumerator)** - Amortization method and interest calculation form                 | -            |
| **additional_iof**                      | float  | Additional IOF amount                                                                                                        | -            |
| **base_iof**                            | float  | Base IOF amount                                                                                                             | -            |
| **total_iof**                           | float  | Total IOF amount                                                                                                            | -            |
| **issue_amount**                        | float  | Issue/nominal amount of the credit operation                                                                               | -            |
| **tax_configuration**                   | object | **[Tax Configuration Object](#tax-configuration-object)** - Tax rate values                                             | -            |
| **first_due_date**                      | date   | Due date of the first installment                                                                                        | -            |
| **prefixed_interest_rate**              | object | **[Interest Rate Object](#interest-rate-object)** - Pre-fixed nominal interest rate of the contract                              | -            |

### Fees Object
| Field           | Type  | Description                                                                                           | Max. Chars. |
|-----------------|-------|-----------------------------------------------------------------------------------------------------|--------------|
| **amount**      | float | Fee amount (in percentage or absolute value, depending on the value provided in the _amount_type_ field)| -            |
| **amount_type** | enum  | **[amount_type Enumerator](#amount-type-enumerator)** - Fee amount unit                   | -            |
| **fee_amount**  | float | Absolute fee amount charged on the operation                                                           | -            |
| **fee_type**    | enum  | **[Fee Type Enumerator](#fee-type-enumerator)** - Type of fee charged on the operation                   | -            |
| **type**        | enum  | **[Origin Type Enumerator](#origin-type-enumerator)** - Origin of the fee charged on the operation                         | -            |

### Installments Request Object
| Field                             | Type    | Description                                                                      | Max. Chars. |
|-----------------------------------|---------|--------------------------------------------------------------------------------|--------------|
| **due_date**                      | date    | Due date in calendar days of the installment                                   | -            |
| **total_amount**                  | float   | Total installment amount                                                         | -            |

### Installments Response Object
| Field                             | Type    | Description                                                                      | Max. Chars. |
|-----------------------------------|---------|--------------------------------------------------------------------------------|--------------|
| **calendar_days**                 | int     | How many calendar days between one installment and another                                | -            |
| **due_date**                      | date    | Due date in calendar days of the installment                                   | -            |
| **due_principal**                 | float   | Remaining principal on the installment due date before its payment | -            |
| **has_interest**                  | boolean | _true_ - Indicator of interest incidence on the installment                           | -            |
| **installment_number**            | int     | Installment number                                                              | -            |
| **prefixed_amount**               | float   | Pre-fixed interest amount paid in the installment                                      | -            |
| **principal_amortization_amount** | float   | Amortization amount paid in the installment                                           | -            |
| **tax_amount**                    | float   | Base IOF of the installment                                                            | -            |
| **amount**                        | float   | Total installment amount                                                         | -            |
| **due_interest**                  | float     | Remaining interest after the installment due date before its payment                                   | -            |
| **period**                        | float     | Installment period | -            |
| **period_workdays**               | float     | Installment period in workdays | -            |
| **period_to_disbursement**        | float     | Period until disbursement | -            |
| **period_workdays_to_disbursement**| float     | Period in workdays until disbursement | -            |
| **calendar_days_to_disbursement** | int     | How many calendar days until disbursement | -            |
| **workdays**                      | int     | How many workdays between one installment and another | -            |
| **workdays_to_disbursement**      | int     | How many workdays until disbursement | -            |

### Interest Rate Object
| Field             | Description                                                                             | Max. Chars. |
|-------------------|---------------------------------------------------------------------------------------|--------------|
| **annual_rate**   | Pre/post-fixed interest rate expressed in decimal per year                                      | -            |
| **daily_rate**    | Pre/post-fixed interest rate expressed in decimal per day                                      | -            |
| **interest_base** | **[Interest Base Enumerator](#interest-base-enumerator)** - Interest calculation base  | -            |
| **monthly_rate**  | Pre/post-fixed interest rate expressed in decimal per month                                      | -            |

### Tax Configuration Object
| Field                 | Description                                                                             | Max. Chars. |
|-----------------------|---------------------------------------------------------------------------------------|--------------|
| **base_rate**         | Base rate value                                                                | -            |
| **additional_rate**   | Additional rate value                                                           | -            |

# Enumerators

### _Person Type_ Enumerator
| Enumerator             | Description             |
|------------------------|-----------------------|
| **legal**              | Legal entity       |
| **natural**            | Natural person          |

### _Account Type_ Enumerator
| Enumerator             | Description             |
|------------------------|-----------------------|
| **checking_account**   | Checking account        |
| **deposit_account**    | Deposit account     |
| **guaranteed_account** | Guarantee account     |
| **investment_account** | Investment account |
| **payment_account**    | Payment account    |
| **saving_account**     | Savings account        |
| **salary_account**     | Salary account         |

### _Amount Type_ Enumerator
| Enumerator             | Description             |
|------------------------|-----------------------|
| **absolute**           | Absolute value        |
| **percentage**         | Percentage value      |

### _Interest Type_ Enumerator
| Enumerator           | Description                                                                                                                                                                |
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **pre_price_days**   | Price amortization method (equal installments) with pre-fixed interest calculation per day                                                                                     |
| **pre_price**        | Price amortization method (equal installments) with pre-fixed interest calculation in fixed periods (30 days)                                                                |
| **pre_sac**          | SAC amortization method (constant amortization) with pre-fixed interest calculation per day                                                                                 |
| **post_sac**         | SAC amortization method (constant amortization) with interest calculation based on a pre-fixed rate + post-fixed indexer (cdi, ipca or igpm) per day                  |
| **post_price**       | Price amortization method (equal installments) with interest calculation based on a pre-fixed rate + post-fixed indexer (cdi, ipca or igpm) in fixed periods (30 days) |
| **post_price_days**  | Price amortization method (equal installments) with interest calculation based on a pre-fixed rate + post-fixed indexer (cdi, ipca or igpm) per day                      |

### _Credit Operation Type_ Enumerator
| Enumerator    | Description                      |
|---------------|--------------------------------|
| **ccb**       | Banking Credit Note     |
| **cce**       | Export Credit Note |
| **cci**       | Real Estate Credit Note  |
| **nce**       | Export Credit Note   |

### _Interest Base_ Enumerator
| Enumerator            | Description                                                                 |
|-----------------------|---------------------------------------------------------------------------|
| **workdays**          | Interest calculation base on workdays considering a year of 252 days    |
| **calendar_days**     | Interest calculation base on calendar days considering a year of 360 days |
| **calendar_days_365** | Interest calculation base on calendar days considering a year of 365 days |

### _Fee Type_ Enumerator
Each fee type must be previously enabled and configured by QI Tech

| Enumerator            | Description                                                                  |
|-----------------------|----------------------------------------------------------------------------|
| **tac**               | Account opening fee                                             |
| **spread**            | Premium charged on the acquisition amount of the credit operation                  |
| **warranty_analysis** | Warranty analysis fee                                             |
| **ted_fee**           | TED fee                                                              |
| **spread_ted_fee**    | TED fee premium charged on the acquisition amount of the credit operation |

### _Origin Type_ Enumerator
Each fee type must be previously enabled and configured by QI Tech

| Enumerator            | Description                                                                  |
|-----------------------|----------------------------------------------------------------------------|
| **internal**          | Internal origin fee                                                   |
| **external**          | External origin fee                                                   |

---

# Error simulation in Sandbox

URL: /en/documentation/emissao_de_divida/simulando_erros

This page aims to help you simulate errors in a Sandbox environment.

# Simulating a disbursement error 

Using the following account disbursement bank acccount information, you will be able to simulate a disbursement error.

```json
account_digit: 0
account_number: 11581339
bank_code: 001
branch_number: 2874
document_number: Ajustar conforme documento de tomador
Nome: Ajustar conforme nome de tomador
```

# Simulating a QI Sign error

Using the following digits at the start of a document number, you will be able to generate a signature error.

Início de documento:
```json
0: Fraud detected in signature
8: Failed in the proof of life step
9: Facial validation did not reach the necessary score
```

---

# Possible debt statuses

URL: /en/documentation/emissao_de_divida/status_de_uma_divida

## Possible Debt Statuses

After issuing the credit contract, it can be tracked through the QI Tech platform's Webhooks. 

The states that the contract goes through are described below:

**waiting_signature**

After issuance, the first state of a contract is "waiting for signature". This status remains until the signature process is completed.

**signature_finished**

This is a transitional state. After receiving the last signature, the contract momentarily goes to the "signature_finished" status, when the webhook is triggered and transitions to the next state immediately.

**signed** 

After being signed, the contract remains in the "signed" status.

**issued**

This is a transitional state. On the disbursement date of a contract, it moves to the "issued" status, awaiting disbursement to transition to the next state.

**disbursed**

This is a transitional state. After the disbursement is made, the contract momentarily moves to the "disbursed" status, when the webhook is triggered and transitions to the next state immediately.

**opened**

After disbursement, the contract remains in the "opened" status - this is the final state if QI is not the collection agent for the operation.

**settled**

When QI Tech is the collection agent for the credit operation, the contract is monitored until it is settled. After the last installment payment, its status changes to "settled" and a webhook is triggered.

**canceled**

This state indicates that there was an error in the operation flow, such as failure to disburse credit to the debtor or the contract not being signed in a timely manner.

**canceled_permanently**

When there is any guarantee/collateral tied to the contract, this will be the final state, indicating that the guarantee/collateral has been released and the contract has been permanently canceled.

---

# Error Catalog

URL: /en/documentation/erros/catalogo_de_erros

All QI Tech APIs return errors in a standardized format:

```json
{
  "title": "HTTP Status code name",
  "description": "An english description of the error",
  "translation": "Uma descrição em português do erro",
  "code": "ERROR_UNIQUE_CODE"
}
```

## Global Errors (GDF)

Common errors across all platform APIs.

| HTTP Code | Error Code | Title | Description | Resolution |
|-|-|-|-|-|
| 400 | GDF000003 | Bad Request | No API Client Key received | Include the `API-CLIENT-KEY` header with your API key in the request. |
| 401 | GDF000014 | QI Unauthenticated | Failed while decoding the authentication token | Verify that the JWT token is being signed correctly with your EC512 private key. See the [authentication test](/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_v2). |
| 404 | GDF000018 | Not Found | No ClientIntegration found for api_client_key | Verify that the `API-CLIENT-KEY` sent matches the key registered in the QI Tech dashboard. |

## Issuer Onboarding Errors (ISS)

| HTTP Code | Error Code | Title | Description |
|-|-|-|-|
| 400 | ISS000003 | Bad Request | Issuer already exists in the database. |
| 404 | ISS000004 | Not Found | Issuer representative not found. |
| 404 | ISS000005 | Not Found | Bank account not found. |
| 404 | ISS000006 | Not Found | Issuer document not found. |
| 404 | ISS000007 | Not Found | Issuer representative document not found. |
| 404 | ISS000008 | Not Found | Issuer contact not found. |
| 404 | ISS000009 | Not Found | Issuer not found. |
| 404 | ISS000010 | Not Found | Subscriber group not found. |
| 400 | ISS000011 | Bad Request | Issuer must be in in_filling state to allow this action. |
| 400 | ISS000012 | Bad Request | It is not allowed to delete the main account, define a new main account first. |
| 400 | ISS000013 | Bad Request | It is not allowed to delete the main contact, define a new main contact first. |
| 400 | ISS000014 | Bad Request | Issuer must have at least one contact information. |
| 400 | ISS000015 | Bad Request | Access to issuer data has already been granted. |
| 400 | ISS000016 | Bad Request | Failed to send message to issuer, please try again. |
| 400 | ISS000017 | Bad Request | Invalid link. |
| 400 | ISS000018 | Bad Request | Uploaded document is invalid or low quality. |

## Investor Onboarding Errors (INV)

| HTTP Code | Error Code | Title | Description |
|-|-|-|-|
| 400 | INV000003 | Bad Request | Investor already exists in the database. |
| 404 | INV000004 | Not Found | Investor representative not found. |
| 404 | INV000005 | Not Found | Bank account not found. |
| 404 | INV000006 | Not Found | Investor document not found. |
| 404 | INV000007 | Not Found | Investor representative document not found. |
| 404 | INV000008 | Not Found | Investor contact not found. |
| 404 | INV000009 | Not Found | Investor not found. |
| 404 | INV000010 | Not Found | Subscriber group not found. |
| 400 | INV000011 | Bad Request | Investor must be in in_filling state to allow this action. |
| 400 | INV000012 | Bad Request | It is not allowed to delete the main account, define a new main account first. |
| 400 | INV000013 | Bad Request | It is not allowed to delete the main contact, define a new main contact first. |
| 400 | INV000014 | Bad Request | Investor must have at least one contact information. |
| 400 | INV000015 | Bad Request | Access to investor data has already been granted. |
| 400 | INV000016 | Bad Request | Failed to send message to investor, please try again. |
| 400 | INV000017 | Bad Request | Invalid link. |
| 400 | INV000018 | Bad Request | Uploaded document is invalid or low quality. |

## Commercial Note Issuance Errors (COM)

| HTTP Code | Error Code | Title | Description |
|-|-|-|-|
| 400 | COM000001 | Bad Request | Provided document is not valid. |
| 400 | COM000002 | Bad Request | Tenant must be configured before using this endpoint. |
| 409 | COM000003 | Conflict | Configuration for this tenant already exists. |
| 400 | COM000004 | Bad Request | Investor with the provided key not allowed. Check registration. |
| 400 | COM000005 | Bad Request | Issuer with the provided key not allowed. Check registration. |
| 400 | COM000006 | Bad Request | Operation with more than one investor not available. |
| 404 | COM000007 | Not Found | Operation not found. |
| 403 | COM000008 | Forbidden | Operation does not belong to tenant. |
| 400 | COM000010 | Bad Request | Operation cannot be updated outside of in_filling status. |

## Subscription Errors (INT)

| HTTP Code | Error Code | Title | Description |
|-|-|-|-|
| 400 | INT000001 | Bad Request | Invalid subscription type. |
| 404 | INT000002 | Not Found | Subscription not found. |
| 400 | INT000003 | Bad Request | Subscription cannot be updated outside of in_filling status. |
| 400 | INT000004 | Bad Request | Invalid payment type. |

---

# Amortização Extraordinária

URL: /en/documentation/escrituracao/amortizacao-extraordinaria/conceito

## Visão geral

Amortização extraordinária é o processo de reduzir o saldo devedor de uma emissão fora do cronograma ordinário — quando o emissor antecipa um pagamento, quita parcelas adiante do vencimento ou refinancia parte da dívida. O QI Tech recebe esse pedido via API, valida os valores e registra o evento para liquidação posterior, sem interferir nas amortizações ordinárias geradas em cada `due_date` (data de vencimento).

Os cenários típicos envolvem quitação antecipada pelo emissor, pagamento antecipado de uma ou mais parcelas e operações de refinanciamento parcial. Em todos esses casos o integrador inicia o fluxo sob demanda, informando qual parcela (ou conjunto de parcelas) está sendo amortizada e qual o valor.

Você recorre a esta API sempre que precisa alterar o saldo devedor fora da agenda ordinária de pagamentos. O resultado é sempre um evento rastreável, com `status` próprio e registro financeiro. A criação é fire-and-forget: a QI Tech orquestra liquidação, finalização e cancelamento internamente, sem que o integrador precise chamar endpoints adicionais.

## Amortização ordinária vs extraordinária

A amortização ordinária é gerada automaticamente pela QI Tech: em cada `due_date` (data de vencimento), o processo de liquidação da parcela é criado internamente sem ação do integrador. Já a amortização extraordinária é sempre iniciada sob demanda, por chamada explícita à API. As duas coexistem — registrar uma amortização extraordinária não cancela nem substitui as ordinárias que ainda vão vencer; apenas adiciona um novo evento de liquidação sobre o ativo.

## Tipos de amortização

Os cinco tipos suportados ficam no campo `amortization_type`:

- `equal_amount` (valores proporcionais) — distribui proporcionalmente o valor informado entre as parcelas vencidas primeiro e depois entre as futuras.
- `first_installments` (primeiras parcelas) — aplica o valor sequencialmente às N primeiras parcelas até esgotá-lo.
- `present_amount` (valor presente) — o integrador escolhe as parcelas e pode informar `total_discount`; a ordem de distribuição é juros → multa → principal.
- `matured_installments` (parcelas vencidas) — aplica o valor exclusivamente a parcelas já vencidas.
- `early_amortization` (amortização antecipada) — antecipa o pagamento de uma parcela futura.

Apenas `early_amortization` permite pagamento parcial — os outros quatro exigem cobertura integral do valor declarado dentro da tolerância.

## Conceitos-chave
- **`event_conciliation`** — corresponde ao evento de conciliação de uma parcela específica. Responsável pelo ato de conciliação de pagamentos e/ou amortizações extraordinárias de parcelas de um valor mobiliário.
- **`reference_date`** — data de referência fornecida pelo chamador em toda criação (deve corresponder à data de quitação). O QI Tech nunca usa `date.today()`: toda lógica relativa a datas (classificação de vencimento, projeção do Valor Presente, discriminação de parcelas vencidas vs a vencer) parte desse campo.
- **Valor Presente** — calculado internamente e consumido durante a criação do evento. O integrador não precisa calcular Valor Presente no seu lado.
- **Tolerância (`tolerance_amount`)** — diferença máxima aceita entre o valor de liquidação e o valor esperado da parcela. Default de R$ 0,01. Diferenças acima da tolerância fazem a liquidação ser rejeitada.
- **Estado parcial derivado** — quando `paid_amount > 0` e `paid_amount < expected_amount`, a parcela é considerada parcialmente paga. Não há novo status: o estado é DERIVADO das colunas `paid_amount` e `expected_amount`. O status `pending_conciliation` cobre tanto o "ainda não pago" quanto o "parcialmente pago"; `paid` só aparece quando o acumulado cobre o esperado dentro da tolerância.

## Próximos passos

Siga para o [Roteiro de Integração](../roteiro-integracao/roteiro-integracao-padrao.md) para ver o fluxo passo a passo. Para o cenário em que uma nova operação recompra amortizações extraordinárias em aberto, veja [Amortização com Recompra](./recompra-de-operacao.md).

---

# Consultar Amortização Extraordinária

URL: /en/documentation/escrituracao/amortizacao-extraordinaria/endpoints/consultar-amortizacao

Este endpoint retorna uma amortização extraordinária específica pela sua chave (`extraordinary_event_conciliation_key`). Use-o para acompanhar o status da conciliação do evento — desde `pending_conciliation` (ainda não pago ou parcialmente pago) até o estado terminal (`paid` ou `canceled`) definido pela orquestração interna da QI Tech.

A consulta é agnóstica de data e não dispara nenhuma transição de status: apenas reflete o estado atual do evento e de cada parcela vinculada.

---

## **Request**
ENDPOINT /event_conciliation/extraordinary_event/ EXTRAORDINARY-EVENT-CONCILIATION-KEY
MÉTODO GET

### **Path Params**

| Campo                                  | Tipo          | Obrigatório | Descrição                                                                 |
|----------------------------------------|---------------|-------------|---------------------------------------------------------------------------|
| `extraordinary_event_conciliation_key` | string (UUID) | Sim         | Chave única do evento extraordinário de amortização a consultar.          |

Exemplo de chamada:

```
GET /event_conciliation/extraordinary_event/11111111-1111-4111-8111-111111111111
```

---

## **Response**
STATUS 200

Response Body
```json
{
  "extraordinary_event_conciliation_key": "11111111-1111-4111-8111-111111111111",
  "security_key": "971380d4-469e-48f6-a64b-3afb8a88109e",
  "investment_key": "44444444-4444-4444-8444-444444444444",
  "amortization_type": "early_amortization",
  "total_expected_amount": 1500.00,
  "total_discount_amount": 0,
  "total_paid_amount": 0.0,
  "status": "pending_conciliation",
  "reference_date": "2026-04-24",
  "due_date": "2026-04-24",
  "paid_at": null,
  "event_conciliation_list": [
    {
      "event_conciliation_key": "22222222-2222-4222-8222-222222222222",
      "installment_key": "33333333-3333-4333-8333-333333333333",
      "event_conciliation_status": "pending_conciliation",
      "event_conciliation_type": "extraordinary_event"
    }
  ]
}
```

### **Response Body Params**

| Campo                                  | Tipo            | Descrição                                                                                                           |
|----------------------------------------|-----------------|---------------------------------------------------------------------------------------------------------------------|
| `extraordinary_event_conciliation_key` | string (UUID)   | Chave do evento extraordinário de amortização consultado.                                                          |
| `security_key`                         | string (UUID)   | Chave do ativo (`security`) ao qual o evento pertence.                                                             |
| `investment_key`                       | string (UUID)   | Chave do investimento alvo do evento.                                                                              |
| `amortization_type`                    | string          | Tipo de amortização do evento — ecoa o valor usado na criação.                                                     |
| `total_expected_amount`                | number          | Valor total esperado do evento (soma distribuída entre as parcelas) em BRL.                                        |
| `total_discount_amount`                | number          | Desconto total aplicado. Diferente de zero apenas para `present_amount`.                                           |
| `total_paid_amount`                    | number          | Valor já conciliado para o evento (em BRL). `0` enquanto nenhum pagamento foi confirmado; `> 0` em pagamento parcial. |
| `status`                               | string          | Status atual do evento: `pending_conciliation`, `paid` ou `canceled`.                                              |
| `reference_date`                       | string (date)   | Data de referência informada na criação.                                                                          |
| `due_date`                             | string (date)   | Data alvo de liquidação informada na criação.                                                                     |
| `paid_at`                              | string (date)   | Data em que o evento foi liquidado. `null` enquanto não estiver `paid`.                                            |
| `event_conciliation_list`             | array           | Lista de `event_conciliation` (evento de conciliação de cada parcela) do evento. **[Objeto event_conciliation_list](#objeto-event_conciliation_list)**. |

### **Objeto event_conciliation_list**

| Campo                       | Tipo            | Descrição                                                                                 |
|-----------------------------|-----------------|-------------------------------------------------------------------------------------------|
| `event_conciliation_key`    | string (UUID)   | Chave do evento de conciliação da parcela (`event_conciliation`).                          |
| `installment_key`           | string (UUID)   | Chave da parcela afetada por este evento de conciliação.                                   |
| `event_conciliation_status` | string          | Status atual do evento de conciliação da parcela (`pending_conciliation`, `paid`, `canceled`). |
| `event_conciliation_type`   | string          | Tipo do `event_conciliation`. Sempre `extraordinary_event` para eventos criados por este fluxo. |

:::info
O `status` (e o `event_conciliation_status` de cada parcela) reflete o estado atual no momento da consulta. A transição para `paid` ou `canceled` é feita pela orquestração interna da QI Tech — o integrador não precisa acionar nenhum endpoint para isso.
:::

---

## **Erros**

| Código     | HTTP | Significado                                                                                            |
|------------|------|--------------------------------------------------------------------------------------------------------|
| EVC100011  | 404  | Nenhuma amortização extraordinária encontrada para a `extraordinary_event_conciliation_key` informada. |

Consulte o [Catálogo de erros](/documentation/escrituracao/catalogo-erros/catalogo-erros) para resolução completa.

---

## **Veja também**

- [Criar Amortização Extraordinária](./criar-amortizacao.md)
- [Simular Valor Presente da Amortização Extraordinária](./simular-valor-presente.md)
- [Conceito](../conceito.md)
- [Roteiro de Integração](../../roteiro-integracao/roteiro-integracao-padrao.md)
- [Regras de Negócio](../regras-de-negocio.md)
- [Exemplos](../exemplos.md)

---

# Criar Amortização Extraordinária

URL: /en/documentation/escrituracao/amortizacao-extraordinaria/endpoints/criar-amortizacao

Este endpoint cria uma amortização extraordinária sobre um ou mais `installment` de uma emissão. O event-conciliation-service agrupa as parcelas em um evento extraordinário de amortização único, distribui o `amount` declarado conforme o `amortization_type` informado e obtém o Valor Presente via security-service — o integrador não calcula Valor Presente no seu lado. A `reference_date` é fornecida pelo chamador na requisição da amortização extraordinária e é a única referência temporal usada pelo serviço na classificação de vencidos e no desconto pro-rata.

---

## **Request**
ENDPOINT /event_conciliation/extraordinary_event
MÉTODO POST

### **Request Body**

Existem dois modos de criação. **Modo 1 — Targeted** exige `installment_list` (array de `installment_number`, inteiros ≥ 1) e é usado com os tipos `early_amortization`, `present_amount` e `matured_installments`. **Modo 2 — Acquittance** não recebe `installment_list` e é usado com os tipos `equal_amount` e `first_installments`. Os números enviados em `installment_list` são resolvidos pelo serviço contra `installment_number` da `security` correspondente.

Exemplo — Modo 1 (`early_amortization`):

```json
{
  "security_key": "971380d4-469e-48f6-a64b-3afb8a88109e",
  "investment_key": "<investment_key>",
  "amortization_type": "early_amortization",
  "amount": 1500.00,
  "reference_date": "2026-04-24",
  "due_date": "2026-04-24",
  "installment_list": [1]
}
```

Exemplo — Modo 2 (`equal_amount`):

```json
{
  "security_key": "971380d4-469e-48f6-a64b-3afb8a88109e",
  "investment_key": "<investment_key>",
  "amortization_type": "equal_amount",
  "amount": 5000.00,
  "reference_date": "2026-04-24",
  "due_date": "2026-04-24"
}
```

### **Request Body Params**

| Campo                     | Tipo            | Obrigatório  | Descrição                                                                                                                                                                                                  |
|---------------------------|-----------------|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `security_key`            | string (UUID)   | Sim          | Chave única do ativo (`security`) sobre o qual a amortização será aplicada.                                                                                                                                |
| `investment_key`          | string (UUID)   | Sim          | Chave do investimento alvo. Usado pelo security-service como base proporcional no cálculo de Valor Presente.                                                                                                |
| `amortization_type`       | string          | Sim          | Estratégia de distribuição. Valores: `equal_amount`, `first_installments`, `present_amount`, `matured_installments`, `early_amortization`.                                                                  |
| `amount`                  | number          | Sim          | Valor total a ser amortizado (em BRL). Distribuído entre as parcelas selecionadas conforme o `amortization_type`.                                                                                           |
| `reference_date`          | string (date)   | Sim          | Data de referência em formato `YYYY-MM-DD`. **Fornecida pelo chamador** — o serviço a usa como "hoje" para classificar parcelas vencidas e aplicar o desconto pro-rata do Valor Presente.                  |
| `due_date`                | string (date)   | Sim          | Data alvo de liquidação (tipicamente igual à `reference_date`).                                                                                                                                            |
| `installment_list`        | array de inteiros (≥ 1) | Condicional  | Lista de `installment_number` (não UUIDs) das parcelas-alvo, com `minItems: 1`. Obrigatório para `present_amount`, `matured_installments` e `early_amortization`. Omita para `equal_amount` e `first_installments` para usar distribuição por acquittance (Modo 2). O serviço resolve cada número contra `installment_number` da `security`; números inexistentes retornam `EVC000007`. O legado `installment_key_list` foi removido — clientes que ainda enviarem o campo recebem `QIT000001` (400). |
| `total_discount`          | number          | Não          | Utilizado apenas com `present_amount` — distribui o desconto na ordem juros → multa → principal.                                                                                                            |
| `number_of_installments`  | integer         | Não          | Utilizado apenas com `first_installments`, quando `installment_list` não é informado.                                                                                                                       |

---

## **Response**
STATUS 201

Response Body
```json
{
  "extraordinary_event_conciliation_key": "11111111-1111-4111-8111-111111111111",
  "security_key": "971380d4-469e-48f6-a64b-3afb8a88109e",
  "amortization_type": "early_amortization",
  "total_expected_amount": 1500.00,
  "total_discount_amount": 0,
  "status": "pending_conciliation",
  "reference_date": "2026-04-24",
  "due_date": "2026-04-24",
  "event_conciliation_list": [
    {
      "event_conciliation_key": "22222222-2222-4222-8222-222222222222",
      "installment_key": "33333333-3333-4333-8333-333333333333",
      "expected_amount": 1500.00,
      "discount_amount": 0,
      "due_date": "2026-04-24",
      "status": "pending_conciliation",
      "event_conciliation_type": "extraordinary"
    }
  ]
}
```

### **Response Body Params**

| Campo                                 | Tipo            | Descrição                                                                                                           |
|---------------------------------------|-----------------|---------------------------------------------------------------------------------------------------------------------|
| `extraordinary_event_conciliation_key`| string (UUID)   | Chave do evento geral de amortização extraordinário criado.                                                                        |
| `security_key`                        | string (UUID)   | Chave do ativo — ecoa o valor enviado.                                                                              |
| `amortization_type`                   | string          | Tipo de amortização escolhido — ecoa o valor enviado.                                                               |
| `total_expected_amount`               | number          | Soma distribuída entre os `event_conciliation` (eventos de conciliação da parcela) pelo engine do tipo escolhido.                                |
| `total_discount_amount`               | number          | Desconto total aplicado. Diferente de zero apenas para `present_amount`.                                            |
| `status`                              | string          | Status inicial do evento extraordinário. Sempre `pending_conciliation` ao criar.                                    |
| `reference_date`                      | string (date)   | Data de referência enviada na requisição (deve corresponder a data de quitação).                                                                           |
| `due_date`                            | string (date)   | Data alvo de liquidação enviada na requisição.                                                                      |
| `event_conciliation_list`             | array           | Lista de `event_conciliation` (evento de conciliação da parcela) gerado. **[Objeto event_conciliation_list](#objeto-event_conciliation_list)**. |

### **Objeto event_conciliation_list**

| Campo                    | Tipo            | Descrição                                                                                 |
|--------------------------|-----------------|-------------------------------------------------------------------------------------------|
| `event_conciliation_key` | string (UUID)   | Chave do evento de conciliação da parcela (`event_conciliation`). |
| `installment_key`        | string (UUID)   | Chave da parcela afetada por este evento de conciliação.                                                  |
| `expected_amount`        | number          | Valor atribuído a este evento de conciliação da parcela pela engine de distribuição.                                 |
| `discount_amount`        | number          | Parcela do `total_discount` alocada a este evento de conciliação da parcela (quando aplicável).                      |
| `due_date`               | string (date)   | Data de vencimento da parcela associada.                                                  |
| `status`                 | string          | Status inicial do evento de conciliação da parcela. Sempre `pending_conciliation` ao criar.                          |
| `event_conciliation_type`| string          | Tipo do `event_conciliation`. Sempre `extraordinary` para eventos de conciliação da parcela criados por este fluxo.  |

---

## **Erros**

| Código     | HTTP | Significado                                                                                            |
|------------|------|--------------------------------------------------------------------------------------------------------|
| EVC100001  | 400  | `amortization_type` inválido. Use um dos cinco valores suportados.                                     |
| EVC100002  | 400  | `installment_list` é obrigatório (e não vazio) para `present_amount`, `matured_installments` ou `early_amortization`. |
| EVC100003  | 400  | `number_of_installments` é obrigatório para `first_installments` quando `installment_list` não é enviado. |
| EVC100004  | 400  | Alguma parcela informada não pertence à `security` alvo.                                               |
| EVC000007  | 404  | Algum inteiro em `installment_list` não corresponde a nenhum `installment_number` da `security` (`InstallmentNumberNotFound`). |
| QIT000001  | 400  | Falha de schema — por exemplo, envio do legado `installment_key_list` (removido) ou item de `installment_list` que não é inteiro ≥ 1. |
| EVC100005  | 400  | `amount` não cobre todas as parcelas selecionadas (não aplicável a `early_amortization`).              |
| EVC100006  | 400  | `total_discount` excede a soma do Valor Presente das parcelas selecionadas.                            |
| EVC100007  | 400  | Para `matured_installments`, todas as parcelas selecionadas devem estar vencidas.                      |
| EVC100008  | 400  | Já existe uma amortização extraordinária pendente para a parcela — cancele-a antes de criar outra.     |
| EVC100013  | 424  | Security API indisponível (Failed Dependency). Transitório — repita após o restabelecimento.           |
| EVC100015  | 400  | `early_amortization` requer exatamente 1 parcela em `installment_list`.                                |
| EVC100016  | 400  | A parcela alvo de `early_amortization` não pode estar vencida.                                         |
| EVC100017  | 400  | Em `early_amortization`, `amount` deve ser menor ou igual ao Valor Presente da parcela.                |

Consulte o [Catálogo de erros](/documentation/escrituracao/catalogo-erros/catalogo-erros) para resolução completa.

---

## **Veja também**

- [Simular Valor Presente da Amortização Extraordinária](./simular-valor-presente.md)
- [Consultar Amortização Extraordinária](./consultar-amortizacao.md)
- [Conceito](../conceito.md)
- [Roteiro de Integração](../../roteiro-integracao/roteiro-integracao-padrao.md)
- [Regras de Negócio](../regras-de-negocio.md)
- [Exemplos](../exemplos.md)

---

# Simulate the Present Value of an Extraordinary Amortization

URL: /en/documentation/escrituracao/amortizacao-extraordinaria/endpoints/simular-valor-presente

This endpoint simulates an extraordinary amortization of type `present_amount` without creating any event — it is a pure calculation, with no side effects. From the installments provided in `installment_list`, the service calculates and returns the total `amount` (Present Value) of the extraordinary event that would be created, plus the Present Value of each `event_conciliation` (type `extraordinary`) per installment — the integrator does not calculate Present Value on their side.

`amortization_type` is not sent in the request: since this is a Present Value simulation, the type is always `present_amount`. `amount` is not sent either — it is the result of the calculation. The `reference_date` is provided by the caller and is the only temporal reference used by the service to classify overdue installments and apply the pro-rata Present Value discount; in the simulation, the `due_date` is assumed to be equal to the `reference_date`.

The response is the ready-to-use creation payload: just remove the `event_conciliation_list` field — which is informational only — and send it as the body of [Create Extraordinary Amortization](./criar-amortizacao) to execute the simulated amortization.

---

## **Request**
ENDPOINT /event_conciliation/extraordinary_event/present_value_simulation
METHOD POST

### **Request Body**

```json
{
  "security_key": "971380d4-469e-48f6-a64b-3afb8a88109e",
  "investment_key": "<investment_key>",
  "reference_date": "2026-04-24",
  "installment_list": [1, 2]
}
```

### **Request Body Params**

| Field              | Type                     | Required | Description                                                                                                                                                                                                 |
|--------------------|--------------------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `security_key`     | string (UUID)            | Yes      | Unique key of the asset (`security`) on which the amortization will be simulated.                                                                                                                          |
| `investment_key`   | string (UUID)            | Yes      | Key of the target investment. Used as the proportional basis for the Present Value calculation.                                                                                                             |
| `reference_date`   | string (date)            | Yes      | Reference date in `YYYY-MM-DD` format. **Provided by the caller** — the service uses it as "today" to classify overdue installments and apply the pro-rata Present Value discount. In the simulation, it is also used as the `due_date`. |
| `installment_list` | array of integers (≥ 1)  | Yes      | List of `installment_number` (not UUIDs) of the target installments, with `minItems: 1`. The service resolves each number against the `security`'s `installment_number`; non-existent numbers return `EVC000007`. |

Unlike creation, `amortization_type`, `amount`, and `due_date` **are not sent**: the type is always `present_amount`, the `amount` is calculated by the service, and the `due_date` is assumed to be equal to the `reference_date`.

---

## **Response**
STATUS 200

Response Body
```json
{
  "security_key": "971380d4-469e-48f6-a64b-3afb8a88109e",
  "investment_key": "<investment_key>",
  "amortization_type": "present_amount",
  "amount": 4750.00,
  "reference_date": "2026-04-24",
  "due_date": "2026-04-24",
  "installment_list": [1, 2],
  "event_conciliation_list": [
    {
      "installment_number": 1,
      "amount": 2400.00
    },
    {
      "installment_number": 2,
      "amount": 2350.00
    }
  ]
}
```

### **Response Body Params**

| Field                     | Type              | Description                                                                                                                                     |
|---------------------------|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
| `security_key`            | string (UUID)     | Asset key — echoes the value sent.                                                                                                              |
| `investment_key`          | string (UUID)     | Target investment key — echoes the value sent.                                                                                                  |
| `amortization_type`       | string            | Always `present_amount` — filled in by the service to compose the creation payload.                                                             |
| `amount`                  | number            | Total Present Value calculated for the extraordinary event (sum of the `amount` fields in `event_conciliation_list`).                           |
| `reference_date`          | string (date)     | Reference date — echoes the value sent.                                                                                                         |
| `due_date`                | string (date)     | Target settlement date — equal to the `reference_date` sent.                                                                                    |
| `installment_list`        | array of integers | Target installments — echoes the value sent.                                                                                                    |
| `event_conciliation_list` | array             | Present Value per installment of the `event_conciliation` (type `extraordinary`) that would be generated. **For visualization only — not part of the creation payload.** **[Object event_conciliation_list](#object-event_conciliation_list)**. |

:::info
The `event_conciliation_list` field is **for visualization only** — it shows the Present Value simulation for each installment and **must not be included** in the creation payload of the extraordinary event. To execute the simulated amortization, send the response **without** `event_conciliation_list` as the body of [Create Extraordinary Amortization](./criar-amortizacao).
:::

### **Object event_conciliation_list**

| Field                | Type    | Description                                                                                                |
|----------------------|---------|----------------------------------------------------------------------------------------------------------------|
| `installment_number` | integer | Number of the installment (`installment_number`) this conciliation event refers to.                        |
| `amount`             | number  | Present Value calculated for the `event_conciliation` (type `extraordinary`) of this installment.          |

---

## **Errors**

| Code       | HTTP | Meaning                                                                                                                               |
|------------|------|-------------------------------------------------------------------------------------------------------------------------------------------|
| EVC100002  | 400  | `installment_list` is required and cannot be empty.                                                                                   |
| EVC100004  | 400  | One of the provided installments does not belong to the target `security`.                                                            |
| EVC000007  | 404  | An integer in `installment_list` does not match any `installment_number` of the `security` (`InstallmentNumberNotFound`).             |
| QIT000001  | 400  | Schema failure — for example, an `installment_list` item that is not an integer ≥ 1.                                                  |
| EVC100008  | 400  | There is already a pending extraordinary amortization for the installment — cancel it before simulating/creating another.             |
| EVC100013  | 424  | Dependency temporarily unavailable (Failed Dependency). Transient — retry once it is restored.                                        |

`EVC100005` (insufficient `amount`) does not apply to the simulation — the `amount` is calculated by the service, not sent.

See the [Error catalog](/documentation/escrituracao/catalogo-erros/catalogo-erros) for complete resolution.

---

## **See also**

- [Create Extraordinary Amortization](./criar-amortizacao)
- [Get Extraordinary Amortization](./consultar-amortizacao)
- [Concept](../conceito)
- [Integration Guide](../../roteiro-integracao/roteiro-integracao-padrao)
- [Business Rules](../regras-de-negocio)
- [Examples](../exemplos)

---

# Exemplos — Amortização Extraordinária

URL: /en/documentation/escrituracao/amortizacao-extraordinaria/exemplos

Esta página apresenta dois cenários de criação. A interação do integrador é **fire-and-forget**: realiza apenas a chamada de criação e a QI Tech orquestra liquidação, finalização e cancelamento internamente. Não há webhook tenant-facing dedicado às transições de status do `event_conciliation` extraordinário; a confirmação do efeito da operação é observada via os relatórios e webhooks já existentes para a operação subjacente (ex.: `commercial_paper.operation_status_change`).

## Cenário 1: quitação antecipada parcial de uma parcela (early_amortization)

Cobre uma única parcela futura, com pagamento parcial permitido.

`POST /event_conciliation/extraordinary_event`

```json
{
  "security_key": "971380d4-469e-48f6-a64b-3afb8a88109e",
  "investment_key": "<investment_key>",
  "amortization_type": "early_amortization",
  "amount": 1500.00,
  "reference_date": "2026-04-24",
  "due_date": "2026-04-24",
  "installment_list": [3]
}
```

Resposta: `201 Created`

```json
{
  "extraordinary_event_conciliation_key": "11111111-1111-4111-8111-111111111111",
  "security_key": "971380d4-469e-48f6-a64b-3afb8a88109e",
  "amortization_type": "early_amortization",
  "total_expected_amount": 1500.00,
  "total_discount_amount": 0,
  "status": "pending_conciliation",
  "reference_date": "2026-04-24",
  "due_date": "2026-04-24",
  "event_conciliation_list": [
    {
      "event_conciliation_key": "22222222-2222-4222-8222-222222222222",
      "installment_key": "33333333-3333-4333-8333-333333333333",
      "expected_amount": 1500.00,
      "discount_amount": 0,
      "due_date": "2026-04-24",
      "status": "pending_conciliation",
      "event_conciliation_type": "extraordinary"
    }
  ]
}
```

A partir desse 201 a integração está concluída do lado do integrador. Quando o pagamento de R$ 1.500,00 atingir a conta de liquidação correspondente, a QI Tech (account-liquidation-api) liquida o evento de conciliação da parcela internamente e atualiza o `paid_amount`; quando a soma cobre `total_expected_amount - tolerance_amount`, o parent transita para `paid`. Se o pagamento não entrar, o evento é cancelado ou finalizado pela rotina diária de settlement do security-service.

## Cenário 2: quitação total com desconto (present_amount com 2 installments)

Cria uma amortização com desconto consolidado cobrindo duas parcelas.

`POST /event_conciliation/extraordinary_event`

```json
{
  "security_key": "971380d4-469e-48f6-a64b-3afb8a88109e",
  "investment_key": "<investment_key>",
  "amortization_type": "present_amount",
  "amount": 5000.00,
  "reference_date": "2026-04-24",
  "due_date": "2026-04-24",
  "installment_list": [1, 2],
  "total_discount": 100.00
}
```

Resposta `201 Created` — dois eventos de conciliação da parcela são gerados com os valores distribuídos conforme o engine de `present_amount` (juros → multa → principal). Veja [Criar Amortização Extraordinária](./endpoints/criar-amortizacao.md) para o shape completo da resposta.

A partir do 201 a interação do integrador é a mesma do Cenário 1: a QI Tech liquida cada evento de conciliação da parcela quando os pagamentos correspondentes entram, e finaliza ou cancela o evento internamente caso os valores não cheguem dentro da janela de settlement.

## Troubleshooting

Códigos de erro mais comuns ao chamar a criação. Para a lista completa, consulte o [Catálogo de erros](/documentation/escrituracao/catalogo-erros/catalogo-erros).

- **`EVC100015`** (400, EarlyAmortizationRequiresSingleInstallment) — `early_amortization` aceita exatamente uma parcela em `installment_list`. Reduza para 1.
- **`EVC000007`** (404, InstallmentNumberNotFound) — algum `installment_number` enviado em `installment_list` não existe na `security` alvo. Confira os números retornados em `GET /security/security/{security_key}` antes de chamar.
- **`QIT000001`** (400) — schema rejeitado. Causa típica: enviar o campo legado `installment_key_list` (removido) ou itens não inteiros em `installment_list`.
- **`EVC100016`** (400, EarlyAmortizationInstallmentOverdue) — a parcela alvo de `early_amortization` está vencida e não é elegível. Selecione uma parcela futura.
- **`EVC100017`** (400, EarlyAmortizationAmountExceedsPresentValue) — em `early_amortization`, o `amount` excedeu o Valor Presente da parcela. Confirme o PV antes de chamar.
- **`EVC100013`** (424, SecurityApiUnavailable) — Security API temporariamente indisponível ao buscar o Valor Presente; é transitório. Aguarde e repita a chamada.
- **`SEC000031`** (400, PostFixedSecurityNotSupported) — ativos pós-fixados (CDI, IPCA, IGPM) não são suportados na V1. Use ativos `pre_price` ou `pre_sac`.

## Veja também

- [Conceito](./conceito.md)
- [Roteiro de Integração](../roteiro-integracao/roteiro-integracao-padrao.md)
- [Regras de Negócio](./regras-de-negocio.md)
- [Criar Amortização Extraordinária](./endpoints/criar-amortizacao.md)
- [Consultar Amortização Extraordinária](./endpoints/consultar-amortizacao.md)
- [Recompra de Operação](./recompra-de-operacao.md)
- [Catálogo de erros](/documentation/escrituracao/catalogo-erros/catalogo-erros)

---

# Amortização com Recompra

URL: /en/documentation/escrituracao/amortizacao-extraordinaria/recompra-de-operacao

## Visão geral

A **recompra** é o fluxo em que uma **nova operação** de nota comercial é emitida para "recomprar" uma ou mais amortizações extraordinárias em aberto de uma operação existente. O cenário típico: o devedor tem uma operação em aberto e, junto com o investidor, decide recomprá-la — por refinanciamento ou por qualquer outro motivo negociado. Em vez de quitar a dívida com recursos próprios, eles estruturam uma nova operação cujo desembolso liquida automaticamente as amortizações extraordinárias escolhidas.

A nova operação é emitida pelo **mesmo devedor** (`issuer`) dos eventos que estão sendo recomprados. A recompra pode abranger:

- **Uma única amortização extraordinária** — o caso mais comum, recomprando uma operação.
- **Múltiplos ativos** — passando várias `extraordinary_event_conciliation_key`, inclusive de `security` diferentes, quando o devedor quer recomprar mais de um ativo na mesma nova operação.

A recompra não é uma chamada de API separada: ela é declarada **no momento da criação da nova operação**, informando a lista de chaves dos eventos extraordinários a recomprar.

## Pré-requisito

Cada amortização extraordinária a ser recomprada precisa **já existir** — criada previamente pelo fluxo de [amortização extraordinária](./endpoints/criar-amortizacao.md) — e estar em `pending_conciliation` no momento em que a nova operação é criada. São essas chaves (`extraordinary_event_conciliation_key`) que você referencia na recompra.

:::warning Datas precisam casar com o desembolso
A `reference_date` e a `due_date` informadas **na criação do evento extraordinário** precisam corresponder à **data de desembolso** da nova operação de recompra. Se essas datas não baterem com o desembolso, os eventos **não são desembolsados corretamente e são cancelados automaticamente** — a recompra não se efetiva. Planeje a `reference_date`/`due_date` do evento extraordinário já considerando quando a nova operação será desembolsada.
:::

## Como acionar

A recompra é declarada no [Cadastro de Operação de Nota Comercial](../emissao-de-notas/cadastro-operacao/criar-operacao.md) (`POST /commercial_paper/operation`): basta enviar, junto com os campos normais de criação da operação, o campo `extraordinary_event_conciliation_key_list` com as chaves dos eventos extraordinários que deseja recomprar.

```json
{
    "issuer_key": "48e2c597-f2ca-487e-9f06-2b628ecb831e",
    "issuer_bank_account": {
        "account_number": "4464541",
        "account_digit": "3",
        "account_branch": "0001",
        "financial_institution_code_number": "329",
        "financial_institution_ispb": "32402502",
        "account_type": "checking"
    },
    "investors": [
        {
            "investor_key": "70b1b638-ca56-4eb3-9a88-2fd5ffd077a7",
            "subscription_percentage": 100,
            "bank_account": {
                "account_number": "33400254",
                "account_digit": "3",
                "account_branch": "0001",
                "financial_institution_code_number": "329",
                "financial_institution_ispb": "32402502",
                "account_type": "checking"
            }
        }
    ],
    "issue_date": "2025-01-23",
    "financial": {
        "interest_type": "pre_price_days",
        "financial_base_date": "2025-01-23",
        "released_amount": 1000000,
        "number_of_installments": 5,
        "prefixed_interest_rate": {
            "interest_base": "calendar_days_365",
            "monthly_rate": 0.05
        },
        "fine_delay_rate": {
            "interest_base": "calendar_days_365",
            "monthly_rate": 0.01
        },
        "contract_fine_rate": 0.02,
        "fees": [
            {
                "amount": 5,
                "amount_type": "percentage",
                "fee_type": "structuring_fee"
            }
        ]
    },
    "extraordinary_event_conciliation_key_list": [
        "11111111-1111-4111-8111-111111111111"
    ]
}
```

O `extraordinary_event_conciliation_key_list` é o **único** acréscimo em relação ao cadastro de operação comum — todos os demais campos seguem o [contrato de criação de operação](../emissao-de-notas/cadastro-operacao/criar-operacao.md). Consulte aquela página para a referência completa de cada campo (`issuer_key`, `issuer_bank_account`, `investors`, `issue_date`, `financial`).

### Campo

| Campo                                      | Tipo                    | Obrigatório | Descrição                                                                                                                                              |
|--------------------------------------------|-------------------------|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
| `extraordinary_event_conciliation_key_list`| array de string (UUID)  | Não         | Lista de chaves das amortizações extraordinárias a recomprar. Itens únicos; uma chave por ativo recomprado. Pode abranger múltiplos `security`. Omita o campo em operações sem recompra. |

## Regra de valor

O valor da nova operação precisa ser suficiente para cobrir o que está sendo recomprado. A regra aplicada na **criação da operação** é:

> A soma do `expected_amount` de todos os eventos referenciados em `extraordinary_event_conciliation_key_list` deve ser **menor ou igual** ao `released_amount` da nova operação. Caso contrário, a criação é rejeitada com **`COM000050`** (400).

:::info `released_amount` e fees
`released_amount` é o **valor de emissão líquido de fees financiados**. Por isso, na prática, o valor de emissão da nova operação precisa cobrir no mínimo o valor dos eventos recomprados **+ fees** — só assim o `released_amount` resultante alcança a soma dos `expected_amount`.
:::

## Desembolso

> **Orquestração interna.** A recompra propriamente dita acontece no desembolso da nova operação e é executada internamente pela QI Tech — o integrador **não chama** nenhum endpoint adicional nesta etapa.

Ao desembolsar a nova operação:

1. As amortizações extraordinárias referenciadas são **liquidadas automaticamente**, transitando de `pending_conciliation` para `paid`.
2. O **restante** — `released_amount − Σ expected_amount`, quando positivo — é **repassado ao devedor**.

Ou seja, parte do desembolso quita os eventos recomprados e o que sobra vai para o devedor, em uma única operação.

## Veja também

- [Conceito](./conceito.md)
- [Criar Amortização Extraordinária](./endpoints/criar-amortizacao.md)
- [Consultar Amortização Extraordinária](./endpoints/consultar-amortizacao.md)
- [Regras de Negócio](./regras-de-negocio.md)
- [Exemplos](./exemplos.md)
- [Roteiro de Integração](../roteiro-integracao/roteiro-integracao-padrao.md)
- [Catálogo de erros](/documentation/escrituracao/catalogo-erros/catalogo-erros)

---

# Regras de Negócio — Amortização Extraordinária

URL: /en/documentation/escrituracao/amortizacao-extraordinaria/regras-de-negocio

Esta página consolida as invariantes que governam a criação, a liquidação e o cancelamento de uma amortização extraordinária. Consulte-a sempre que as páginas de endpoints citarem um código de erro, um campo ou uma condição que precise de contexto adicional.

## Data de referência (`reference_date`)

A `reference_date` é **fornecida pelo chamador** na requisição de criação e é a única referência temporal usada pelo serviço — o sistema **nunca usa** `date.today()`. Toda lógica dependente de data (classificação de parcelas vencidas, desconto pro-rata do Valor Presente, seleção de parcelas elegíveis para `early_amortization`) parte desse campo.

## Tipos de amortização

Os 5 tipos suportados e como cada um se combina com os modos de criação:

| Tipo                   | Modo                   | `installment_list`     | Regra de distribuição                                              | Permite pagamento parcial |
|------------------------|------------------------|------------------------|--------------------------------------------------------------------|---------------------------|
| `equal_amount`         | Modo 2 (Acquittance)   | Não envia              | Proporcional, vencidas primeiro e depois futuras                   | Não                        |
| `first_installments`   | Modo 2 (Acquittance)   | Não envia              | Sequencial nas N primeiras parcelas                                | Não                        |
| `present_amount`       | Modo 1 (Targeted)      | Envia                  | Explícita por parcela; desconto ordena juros → multa → principal    | Não                        |
| `matured_installments` | Modo 1 (Targeted)      | Envia                  | Apenas parcelas já vencidas                                        | Não                        |
| `early_amortization`   | Modo 1 (Targeted)      | Envia (exatamente 1)   | Uma única parcela futura com suporte a pagamento parcial           | **Sim**                    |

**Modo 1 — Targeted** (com `installment_list` — array de `installment_number` inteiros): usa o endpoint PV per-installment — uma chamada por parcela selecionada. O serviço resolve cada `installment_number` para a parcela correspondente da `security`. **Modo 2 — Acquittance** (sem `installment_list`): usa o endpoint PV bulk — uma única chamada devolve o PV de todas as parcelas.

## Amortização antecipada (`early_amortization`)

`early_amortization` é o único tipo que permite pagamento parcial. Todas as seguintes condições se aplicam:

- Exatamente **1** parcela em `installment_list` — caso contrário, `EVC100015`.
- A parcela-alvo **não pode estar vencida** — caso contrário, `EVC100016`.
- O `amount` deve ser **≤ Valor Presente** da parcela — caso contrário, `EVC100017`.
- **Pagamento parcial é permitido.** O estado `paid_amount > 0 AND paid_amount = total_expected_amount - tolerance_amount`.

## Fluxo de liquidação

> **Orquestração interna.** A liquidação dos eventos extraordinários é executada pela QI Tech (account-liquidation-api) ao detectar o pagamento — o integrador **não chama** nenhum endpoint nesta etapa, nem recebe webhook dedicado às transições de status. As regras abaixo descrevem o comportamento interno para você entender o que ocorre após a criação.

**Liquidação ordinária emite o total completo (regra 4).** A liquidação ordinária na `due_date` continua emitindo o `total_amount` completo da parcela via SQS; não há subtração do `paid_amount`. O evento reconcilia o estado parcial-pago no seu próprio engine de `early_amortization`.

## Cancelamento e finalização

> **Orquestração interna.** Cancelamento e finalização são disparados por uma rotina diária e — o integrador **não chama** nenhum endpoint para cancelar ou finalizar uma amortização extraordinária, e não há webhook tenant-facing dedicado a essas transições. A descrição abaixo é informativa.

## Veja também

- [Conceito](./conceito.md)
- [Roteiro de Integração](../roteiro-integracao/roteiro-integracao-padrao.md)
- [Criar Amortização Extraordinária](./endpoints/criar-amortizacao.md)
- [Consultar Amortização Extraordinária](./endpoints/consultar-amortizacao.md)
- [Recompra de Operação](./recompra-de-operacao.md)
- [Exemplos](./exemplos.md)
- [Catálogo de erros](/documentation/escrituracao/catalogo-erros/catalogo-erros)

---

# Error Catalog

URL: /en/documentation/escrituracao/catalogo-erros/catalogo-erros

## Error formatting

All APIs in the bookkeeping integration return API errors formatted according to the following description:

Error Response Body

```json
{
  "title": "HTTP Status code name",
  "description": "An english description of the error",
  "translation": "Uma descrição em português do erro",
  "code": "ERROR_UNIQUE_CODE"
}
```

---

## Table of possible errors in the issuer approval process

| HTTP Code | Error Code | Title                  | Description (eng)                                              | Translation (pt-BR)                                         |
|------------|----------------|-------------------------|-------------------------------------------------------------|----------------------------------------------------------|
| 400        | ISS000003      | Bad Request            | Issuer already exists in database.                         | Emissor já existe na base de dados.                     |
| 404        | ISS000004      | Not Found              | Issuer representative not found.                           | Representante do emissor não encontrado.                 |
| 404        | ISS000005      | Not Found              | Bank account not found.                                    | Conta bancária não encontrada.                          |
| 404        | ISS000006      | Not Found              | Issuer document not found.                                | Documento do emissor não encontrado.                    |
| 404        | ISS000007      | Not Found              | Issuer representative document not found.                 | Documento do representante do emissor não encontrado.   |
| 404        | ISS000008      | Not Found              | Issuer contact information not found.                     | Contato do emissor não encontrado.                      |
| 404        | ISS000009      | Not Found              | Issuer not found.                                         | Emissor não encontrado.                                 |
| 404        | ISS0000010     | Not Found              | Signer Group not found.                                   | Grupo de assinantes não encontrado.                     |
| 400        | ISS0000011     | Bad Request            | Issuer must be in status in_filling to allow this action. | Emissor deve estar no estado in_filling para permitir esta ação. |
| 400        | ISS0000018     | Bad Request            | Document sent is invalid or quality is low.               | Documento enviado é inválido ou de baixa qualidade.     |
| 400        | ISS0000012     | Bad Request            | Deleting the main account is not allowed, please set a new main account first. | Não é permitido deletar a conta principal, defina uma nova conta principal primeiro. |
| 400        | ISS0000013     | Bad Request            | Deleting the main contact is not allowed, please set a new main contact first. | Não é permitido deletar o contato principal, defina um novo contato principal primeiro. |
| 400        | ISS0000014     | Bad Request            | Issuer must have at least one contact information.        | Emissor precisa ter ao menos uma informação de contato. |
| 400        | ISS0000015     | Bad Request            | Tenant already has access to this issuer.                 | Acesso aos dados do emissor já foi concedido.           |
| 400        | ISS0000016     | Bad Request            | Failed trying to contact issuer, please retry.            | Falha ao enviar mensagem ao emissor, tente novamente.   |
| 400        | ISS0000017     | Bad Request            | Invalid link.                                             | Link inválido.                                          |

## Table of possible errors in the investor approval process

| HTTP Code | Error Code | Title                  | Description (eng)                                              | Translation (pt-BR)                                         |
|------------|----------------|-------------------------|-------------------------------------------------------------|----------------------------------------------------------|
| 400        | INV000003      | Bad Request            | Investor already exists in database.                        | Emissor já existe na base de dados.                     |
| 404        | INV000004      | Not Found              | Investor representative not found.                          | Representante do emissor não encontrado.                 |
| 404        | INV000005      | Not Found              | Bank account not found.                                     | Conta bancária não encontrada.                          |
| 404        | INV000006      | Not Found              | Investor document not found.                               | Documento do emissor não encontrado.                    |
| 404        | INV000007      | Not Found              | Investor representative document not found.                | Documento do representante do emissor não encontrado.   |
| 404        | INV000008      | Not Found              | Investor contact information not found.                    | Contato do emissor não encontrado.                      |
| 404        | INV000009      | Not Found              | Investor not found.                                        | Emissor não encontrado.                                 |
| 404        | INV0000010     | Not Found              | Signer Group not found.                                    | Grupo de assinantes não encontrado.                     |
| 400        | INV0000011     | Bad Request            | Investor must be in status in_filling to allow this action. | Emissor deve estar no estado in_filling para permitir esta ação. |
| 400        | INV0000018     | Bad Request            | Document sent is invalid or quality is low.                 | Documento enviado é inválido ou de baixa qualidade.     |
| 400        | INV0000012     | Bad Request            | Deleting the main account is not allowed, please set a new main account first. | Não é permitido deletar a conta principal, defina uma nova conta principal primeiro. |
| 400        | INV0000013     | Bad Request            | Deleting the main contact is not allowed, please set a new main contact first. | Não é permitido deletar o contato principal, defina um novo contato principal primeiro. |
| 400        | INV0000014     | Bad Request            | Investor must have at least one contact information.        | Emissor precisa ter ao menos uma informação de contato. |
| 400        | INV0000015     | Bad Request            | Tenant already has access to this investor.                 | Acesso aos dados do emissor já foi concedido.           |
| 400        | INV0000016     | Bad Request            | Failed trying to contact investor, please retry.            | Falha ao enviar mensagem ao emissor, tente novamente.   |
| 400        | INV0000017     | Bad Request            | Invalid link.                                              | Link inválido.                                          |

## Table of possible errors in the commercial paper issuance process

| HTTP Code | Error Code  | Title                  | Description (eng)                                              | Translation (pt-BR)                                         |
|------------|----------------|-------------------------|-------------------------------------------------------------|----------------------------------------------------------|
| 400        | COM000001       | Bad Request            | Document is not valid.                                      | Documento fornecido não é válido.                        |
| 400        | COM000002       | Bad Request            | Tenant must be configured before use this endpoint.        | Tenant precisa ser configurado antes de utilizar este endpoint. |
| 409        | COM000003       | Conflict               | Tenant configuration already exists.                       | Configuração para este tenant já existe.                 |
| 400        | COM000004       | Bad Request            | Investor with key (investor_key) is not allowed. Please check. | Investidor com a chave (investor_key) não permitido. Cheque o cadastro. |
| 400        | COM000005       | Bad Request            | Issuer with key (issuer_key) is not allowed. Please check. | Emissor com a chave (issuer_key) não permitido. Cheque o cadastro. |
| 400        | COM000006       | Bad Request            | Operation with more than one investor functionality not available yet. | Operação com mais de um investidor não disponível ainda. |
| 404        | COM000007       | Not Found              | Operation (operation_key) not found.                       | Operação (operation_key) não encontrada.                 |
| 403        | COM000008       | Forbidden              | Operation (operation_key) does not belong to tenant.       | Operação (operation_key) não pertence ao tenant.         |
| 400        | COM000010       | Bad Request            | Operations cannot be updated outside of in_filling status. | Operação não pode ser atualizada fora do status in_filling. |
| 404        | COM000011       | Not Found              | Related party not found.                                   | Parte relacionada não encontrada.                        |
| 400        | COM000012       | Bad Request            | Related party (related_party_key) is not associated with operation (operation_key). | A parte relacionada (related_party_key) não está associada com a operação (operation_key). |
| 404        | COM000013       | Not Found              | Signer Group not found.                                    | Grupo de assinantes não encontrado.                      |
| 400        | COM000014       | Bad Request            | Signer group (signer_group_key) is not associated with related party (related_party_key). | O grupo de assinantes (signer_group_key) não está associado com a parte relacionada (related_party_key). |
| 400        | COM000015       | Bad Request            | Signer list does not match minimum required signers field. | Lista de assinantes não é compatível com o mínimo de assinantes enviado. |
| 404        | COM000016       | Not Found              | Document not found.                                        | Documento não encontrado.                                |
| 400        | COM000017       | Bad Request            | Document (document_key) is not associated with related party (related_party_key). | O documento (document_key) não está associado com a parte relacionada (related_party_key). |
| 400        | COM000018       | Bad Request            | Document sent is invalid or quality is low.               | Documento enviado é inválido ou de baixa qualidade.      |
| 400        | COM000019       | Bad Request            | Delete issuer or investor is not allowed.                 | Não é possível deletar o emissor ou investidor.         |
| 400        | COM000020       | Bad Request            | Operation is in a final status and cannot be modified.    | Operação já está em um estado final e não pode ser atualizada. |
| 400        | COM000021       | Bad Request            | Operation is not in analysis.                             | Operação não está em análise.                           |
| 400        | COM000022       | Bad Request            | Document not signed yet.                                  | Documento ainda não foi assinado.                        |
| 400        | COM000023       | Bad Request            | Document not available yet.                               | Documento ainda não foi gerado.                         |
| 400        | COM000024       | Bad Request            | Failed to send document to signature, please retry.      | Falha ao enviar documento para assinatura, tente novamente. |
| 404        | COM000025       | Not Found              | Collateral not found.                                     | Garantia não encontrada.                                 |
| 400        | COM000026       | Bad Request            | Collateral (collateral_key) is not associated with operation (operation_key). | A garantia (collateral_key) não está associada com a operação (operation_key). |
| 400        | COM000027       | Bad Request            | Metadata not found.                                       | Metadado não encontrado.                                |
| 400        | COM000028       | Bad Request            | Operation is canceled and cannot be modified.            | Operação está cancelada e não pode ser atualizada.      |

## Table of possible errors in the quota integration process

| HTTP Code | Error Code  | Title                  | Description (eng)                                              | Translation (pt-BR)                                         |
|------------|----------------|-------------------------|-------------------------------------------------------------|----------------------------------------------------------|
| 400        | INT000001       | Bad Request            | Document is not valid.                                      | Documento fornecido não é válido.                        |
| 404        | INT000002       | Not Found              | Integralization process (integralizaion_key) not found.    | Processo de integralização (integralizaion_key) não encontrado. |
| 403        | INT000003       | Forbidden              | Integralization process (integralizaion_key) does not belong to tenant. | Processo de integralização (integralizaion_key) não pertence ao tenant. |
| 404        | INT000004       | Not Found              | Subscription (subscription_key) not found.                 | Subscrição (subscription_key) não encontrada.           |
| 400        | INT000005       | Bad Request            | Subscription (subscription_key) is not associated with integralization process (integralizaion_key). | A subscrição (subscription_key) não está associada com o processo de integralização (integralizaion_key). |
| 404        | INT000006       | Not Found              | Subscription payment not found.                            | Pagamento de subscrição não encontrado.                  |
| 400        | INT000007       | Bad Request            | Subscription payment (subscription_payment_key) is not associated with subscription (subscription_key). | O pagamento de subscrição (subscription_payment_key) não está associado com a subscrição (subscription_key). |
| 400        | INT000008       | Bad Request            | Subscription payment already analyzed.                     | Pagamento de subscrição já foi analisado.               |
| 409        | INT000009       | Conflict               | Integralization process for (operation_key) already exists. | Já existe um processo de integralização para a operação (operation_key). |
| 400        | INT000010       | Bad Request            | Subscripted quantity (subscripted_quantity) is bigger than the available quantity (available_quantity). | A quantidade de cotas subscritas (subscripted_quantity) é maior do que a quantidade disponível (available_quantity). |
| 400        | INT000011       | Bad Request            | Subscription is not waiting payment yet.                   | Subscrição ainda não está aguardando pagamento.         |
| 400        | INT000012       | Bad Request            | Subscription is in a final state and cannot be canceled.   | Subscrição já está em um status final e não pode ser cancelada. |
| 400        | INT000013       | Bad Request            | Subscription is not waiting payment yet.                   | Subscrição não está aguardando pagamento ainda.         |
| 400        | INT000014       | Bad Request            | Document not signed yet.                                   | Documento ainda não foi assinado.                        |
| 400        | INT000015       | Bad Request            | Integralization canceled.                                 | Integralização cancelada.                               |
| 400        | INT000016       | Bad Request            | Integralization cancellation denied. There are integralized quantities. | Cancelamento de integralização negado. Existem cotas integralizadas. |
| 400        | INT000017       | Bad Request            | Creation of subscriptions for an ongoing operation is not available yet. | Ainda não é possível criar subscrições para operações em andamento. |
| 400        | INT000018       | Bad Request            | To create a signature with data different from the original, you must define a recalculation method using the recalculation_method field. | Para criar uma subscrição com data diferente da original é preciso definir um método de recálculo através do campo recalculation_method. |

---

# Webhook Configuration

URL: /en/documentation/escrituracao/configuracao-webhooks

The Webhook Configuration API allows managing webhook endpoints to receive real-time notifications about bookkeeping events. Each tenant can have multiple webhook configurations, allowing events to be sent to different destinations.

---

## Data Model

### Webhook Configuration

```json
{
  "configuration_key": "550e8400-e29b-41d4-a716-446655440000",
  "tenant_key": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
  "url": "https://example.com/webhook",
  "headers": {
    "Authorization": "Bearer token",
    "X-Custom-Header": "value"
  },
  "hmac_signature_key": "secret-key"
}
```

---

## Create Webhook Configuration (POST)

### Request

ENDPOINT /outgoing_webhook/webhook_configuration
METHOD POST

### Request Body

```json
{
  "tenant_key": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
  "url": "https://example.com/webhook",
  "hmac_signature_key": "your-secret-key",
  "headers": {
    "Authorization": "Bearer token",
    "X-Custom-Header": "value"
  }
}
```

### Request Body Params

| Field                  | Type   | Description                                                 |
| ---------------------- | ------ | --------------------------------------------------------- |
| `tenant_key`*         | string | Tenant UUID (UUID v4).                               |
| `url`*                | string | Destination URL to receive webhooks.                |
| `hmac_signature_key`* | string | Secret key for HMAC signature of webhooks.       |
| `headers`             | object | Custom headers to include in requests.     |

---

### Response

STATUS 201

Response Body

```json
{
  "configuration_key": "550e8400-e29b-41d4-a716-446655440000",
  "tenant_key": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
  "url": "https://example.com/webhook",
  "headers": {
    "Authorization": "Bearer token",
    "X-Custom-Header": "value"
  },
  "hmac_signature_key": "your-secret-key"
}
```

### Response Body Params

| Field                  | Type   | Description                                                 |
| ---------------------- | ------ | --------------------------------------------------------- |
| `configuration_key`   | string | Unique webhook configuration key (UUID v4).       |
| `tenant_key`          | string | Tenant UUID.                                          |
| `url`                 | string | Configured destination URL.                             |
| `headers`             | object | Configured custom headers.                     |
| `hmac_signature_key`  | string | Secret key for HMAC signature.                     |

---

## List Webhook Configurations (GET)

### Request

ENDPOINT /outgoing_webhook/webhook_configuration
METHOD GET

### Query Params

| Field        | Type    | Description                                      |
| ------------ | ------- | ---------------------------------------------- |
| `tenant_key`* | string | Tenant UUID to filter configurations. |
| `page`       | integer | Page number (default: 1).                 |
| `page_size`  | integer | Items per page (default: 100).               |

---

### Response

STATUS 200

Response Body

```json
{
  "data": [
    {
      "configuration_key": "550e8400-e29b-41d4-a716-446655440000",
      "tenant_key": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
      "url": "https://example.com/webhook",
      "headers": {
        "Authorization": "Bearer token"
      },
      "hmac_signature_key": "your-secret-key"
    }
  ],
  "pagination": {
    "current_page": 1,
    "page_size": 100,
    "total_rows": 15,
    "total_pages": 1
  }
}
```

### Response Body Params

| Field                  | Type    | Description                                                 |
| ---------------------- | ------- | --------------------------------------------------------- |
| `data`                | array   | List of webhook configurations.                       |
| `pagination`          | object  | **[Pagination Object](#pagination-object)**.            |

---

## Get Webhook Configuration by Key (GET)

### Request

ENDPOINT /outgoing_webhook/webhook_configuration/ CONFIGURATION-KEY
METHOD GET

### Path Params

| Field               | Type   | Description                                        | Characters |
| ------------------- | ------ | ------------------------------------------------ | ---------- |
| `CONFIGURATION-KEY` | string | Unique webhook configuration key (UUID v4). | 36         |

---

### Response

STATUS 200

Response Body

```json
{
  "configuration_key": "550e8400-e29b-41d4-a716-446655440000",
  "tenant_key": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
  "url": "https://example.com/webhook",
  "headers": {
    "Authorization": "Bearer token"
  },
  "hmac_signature_key": "your-secret-key"
}
```

### Response Body Params

| Field                  | Type    | Description                                                 |
| ---------------------- | ------- | --------------------------------------------------------- |
| `configuration_key`   | string  | Unique webhook configuration key (UUID v4).       |
| `tenant_key`          | string  | Tenant UUID.                                          |
| `url`                 | string  | Configured destination URL.                             |
| `headers`             | object  | Configured custom headers.                     |
| `hmac_signature_key`  | string  | Secret key for HMAC signature.                     |

---

## Update Webhook Configuration (PUT)

### Request

ENDPOINT /outgoing_webhook/webhook_configuration/ CONFIGURATION-KEY
METHOD PUT

### Path Params

| Field               | Type   | Description                                        | Characters |
| ------------------- | ------ | ------------------------------------------------ | ---------- |
| `CONFIGURATION-KEY` | string | Unique webhook configuration key (UUID v4). | 36         |

---

### Request Body

```json
{
  "url": "https://new-url.com/webhook",
  "headers": {
    "New-Header": "new-value"
  },
  "hmac_signature_key": "new-secret-key"
}
```

### Request Body Params

| Field                 | Type   | Description                                                 |
| --------------------- | ------ | --------------------------------------------------------- |
| `url`                | string | New destination URL to receive webhooks.            |
| `headers`            | object | New custom headers to include in requests. |
| `hmac_signature_key` | string | New secret key for HMAC signature of webhooks.    |

---

### Response

STATUS 200

Response Body

```json
{
  "configuration_key": "550e8400-e29b-41d4-a716-446655440000",
  "tenant_key": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
  "url": "https://new-url.com/webhook",
  "headers": {
    "New-Header": "new-value"
  },
  "hmac_signature_key": "new-secret-key"
}
```

### Response Body Params

| Field                  | Type    | Description                                                 |
| ---------------------- | ------- | --------------------------------------------------------- |
| `configuration_key`   | string  | Unique webhook configuration key (UUID v4).       |
| `tenant_key`          | string  | Tenant UUID.                                          |
| `url`                 | string  | Configured destination URL.                             |
| `headers`             | object  | Configured custom headers.                     |
| `hmac_signature_key`  | string  | Secret key for HMAC signature.                     |

---

## Delete Webhook Configuration (DELETE)

### Request

ENDPOINT /outgoing_webhook/webhook_configuration/ CONFIGURATION-KEY
METHOD DELETE

### Path Params

| Field               | Type   | Description                                        | Characters |
| ------------------- | ------ | ------------------------------------------------ | ---------- |
| `CONFIGURATION-KEY` | string | Unique webhook configuration key (UUID v4). | 36         |

---

### Response

STATUS 200

Response Body

```json
{}
```

---

# Register Underlying Asset (Lastro)

URL: /en/documentation/escrituracao/emissao-cr/cadastro-lastro

This endpoint registers the **underlying asset** (lastro) of a CR operation. The underlying asset represents the credit rights backing the securitization. The asset document is sent in base64 and its structured data accompanies the request.

:::info
The underlying asset is sent **after the operation is created**, in a separate request. Multiple underlying assets can be registered for the same operation.
:::

---

## **Request**

ENDPOINT /cr/operation/ OPERATION-KEY /underlying_asset
METHOD POST

### Path Params

| Field           | Type   | Description                        | Characters |
|-----------------|--------|------------------------------------|------------|
| `OPERATION-KEY` * | string | Unique operation key (UUID v4).    | 36         |

---

### Request Body

Request Body

```json
{
    "underlying_asset_type": "contract",
    "underlying_asset_base64": "image_b64",
    "underlying_asset_data": {
        "contract_number": "12345",
        "debtor_document_number": "12.345.678/0001-90",
        "amount": 1075268.82,
        "due_date": "2026-01-20"
    }
}
```

### Request Body Params

| Field                     | Type   | Description                              | Max Characters                                                       |
|---------------------------|--------|------------------------------------------|----------------------------------------------------------------------|
| `underlying_asset_type` * | string | Underlying asset type.                   | **[underlying_asset_type Enumerators](#underlying_asset_type-enumerators)** |
| `underlying_asset_base64` * | string | Underlying asset document in base64.   | -                                                                    |
| `underlying_asset_data` * | object | Underlying asset data (free-form).       | -                                                                    |

### underlying_asset_type Enumerators

| Enum       | Description |
|------------|-------------|
| `contract` | Contract.   |

## **Response**

STATUS 201

Response Body

```json
{
    "underlying_asset_key": "5b1f9c2e-2a44-4f0e-9c0a-7b2e0d6f1a23",
    "underlying_asset_type": "contract",
    "underlying_asset_data": {
        "contract_number": "12345",
        "debtor_document_number": "12.345.678/0001-90",
        "amount": 1075268.82,
        "due_date": "2026-01-20"
    }
}
```

### Response Body Params

| Field                     | Type   | Description                        |
|---------------------------|--------|------------------------------------|
| `underlying_asset_key` *  | string | Unique key of the registered asset.|
| `underlying_asset_type` * | string | Underlying asset type.             |
| `underlying_asset_data` * | object | Underlying asset data.             |

---

---

# Register CR Operation

URL: /en/documentation/escrituracao/emissao-cr/cadastro-operacao

This endpoint creates a complete CR operation in a single request.

:::info
The `financial` object is **required** and must be sent already calculated, as this endpoint does not run the financial simulation. The issuer and its bank account must be previously registered.
:::

---

## **Request**

ENDPOINT /cr/create_operation
METHOD POST

The request body ranges from a **payload with the required fields** (including the financial object) to a **complete payload** that also includes related parties. See both variations below.

Payload with the required fields

```json
{
    "tenant_key": "1d29d606-649a-487f-af1c-c0f5cb3e9814",
    "issuer_key": "48e2c597-f2ca-487e-9f06-2b628ecb831e",
    "issue_number": 10,
    "issue_series": 1,
    "issue_date": "2025-01-20",
    "investors": [
        {
            "investor_key": "70b1b638-ca56-4eb3-9a88-2fd5ffd077a7",
            "bank_account": {
                "account_number": "33400254",
                "account_digit": "3",
                "account_branch": "0001",
                "financial_institution_code_number": "329",
                "financial_institution_ispb": "32402502",
                "account_type": "checking"
            }
        }
    ],
    "financial": {
        "financial_base_date": "2025-01-20",
        "interest_type": "pre_price_days",
        "issue_amount": 1075268.82,
        "issue_quantity": 1075268,
        "unit_price": 1.0000007626,
        "released_amount": 1075268.82,
        "cet": 7.7,
        "annual_cet": 143.55,
        "first_due_date": "2025-02-20",
        "number_of_installments": 5,
        "prefixed_interest_rate": {
            "interest_base": "calendar_days_365",
            "monthly_rate": 0.05,
            "daily_rate": 0.0016053474,
            "annual_rate": 0.795856326
        },
        "fine_delay_rate": { "interest_base": "calendar_days_365", "monthly_rate": 0.01 },
        "contract_fine_rate": 0.02,
        "fees": [
            { "amount": 2.0, "fee_amount": 21505.38, "amount_type": "percentage", "fee_type": "bookkeeping_fee", "type": "internal" }
        ],
        "installments": [
            {
                "installment_number": 1,
                "due_date": "2025-02-20",
                "amount": 248113.17,
                "principal_amortization_amount": 193292.79655634,
                "principal_amortization_unit_price": 1.02,
                "interest_amount": 0.0,
                "calendar_days": 31,
                "workdays": 23
            }
        ]
    }
}
```

Complete payload (with related parties)

```json
{
    "tenant_key": "1d29d606-649a-487f-af1c-c0f5cb3e9814",
    "issuer_key": "48e2c597-f2ca-487e-9f06-2b628ecb831e",
    "issue_number": 10,
    "issue_series": 1,
    "contract_number": "CR-2025-0001",
    "issue_date": "2025-01-20",
    "signature_method": "certifiqi",
    "investors": [
        {
            "investor_key": "70b1b638-ca56-4eb3-9a88-2fd5ffd077a7",
            "subscription_percentage": 100,
            "bank_account": {
                "account_number": "33400254",
                "account_digit": "3",
                "account_branch": "0001",
                "financial_institution_code_number": "329",
                "financial_institution_ispb": "32402502",
                "account_type": "checking"
            }
        }
    ],
    "financial": {
        "financial_base_date": "2025-01-20",
        "interest_type": "pre_price_days",
        "issue_amount": 1075268.82,
        "issue_quantity": 1075268,
        "unit_price": 1.0000007626,
        "released_amount": 1075268.82,
        "cet": 7.7,
        "annual_cet": 143.55,
        "first_due_date": "2025-02-20",
        "number_of_installments": 5,
        "prefixed_interest_rate": {
            "interest_base": "calendar_days_365",
            "monthly_rate": 0.05,
            "daily_rate": 0.0016053474,
            "annual_rate": 0.795856326
        },
        "fine_delay_rate": { "interest_base": "calendar_days_365", "monthly_rate": 0.01 },
        "contract_fine_rate": 0.02,
        "fees": [
            { "amount": 2.0, "fee_amount": 21505.38, "amount_type": "percentage", "fee_type": "bookkeeping_fee", "type": "internal" }
        ],
        "installments": [
            {
                "installment_number": 1,
                "due_date": "2025-02-20",
                "amount": 248113.17,
                "principal_amortization_amount": 193292.79655634,
                "principal_amortization_unit_price": 1.02,
                "interest_amount": 0.0,
                "calendar_days": 31,
                "workdays": 23
            }
        ]
    },
    "related_party_list": [
        {
            "person_type": "legal",
            "name": "Garantidora S.A.",
            "document_number": "12.345.678/0001-90",
            "trading_name": "Garantidora",
            "cnae_code": "64.62-0-00",
            "company_type": "sa",
            "foundation_date": "2010-05-01",
            "street": "Av. Paulista",
            "number": "1000",
            "neighborhood": "Bela Vista",
            "postal_code": "01310-100",
            "city": "São Paulo",
            "state": "SP",
            "role_type": "guarantor"
        },
        {
            "person_type": "natural",
            "name": "João da Silva",
            "document_number": "123.456.789-00",
            "street": "Rua das Flores",
            "number": "123",
            "neighborhood": "Centro",
            "postal_code": "01001-000",
            "city": "São Paulo",
            "state": "SP",
            "role_type": "solidary_debtor",
            "is_pep": false
        }
    ]
}
```

### **Request Body Params**

| Field               | Type    | Description                                          | Max Characters             |
| ------------------- | ------- | --------------------------------------------------- | -------------------------- |
| `tenant_key` *      | string  | Unique tenant key.                                  | -                          |
| `issuer_key` *      | string  | Unique issuer key (previously registered).          | -                          |
| `issue_number` *    | integer | Issue number.                                       | -                          |
| `issue_series` *    | integer | Issue series.                                       | -                          |
| `issue_date` *      | string  | Operation issue date (format "YYYY-MM-DD").         | -                          |
| `signature_method`  | string  | Signature method used in the operation. Optional; when omitted, defaults to `certifiqi`. | **[signature_method Enumerators](#signature_method-enumerators)** |
| `investors` *       | array   | List of involved investors.                         | **investors Object**       |
| `financial` *       | object  | Already-calculated operation financial data.        | **financial Object**       |
| `contract_number`   | string  | Contract number.                                    | -                          |
| `related_party_list` | array  | Operation related parties (guarantors, debtors, etc.). | **related_party Object** |

### investors Object

| Field                       | Type   | Description                                               |
| --------------------------- | ------ | -------------------------------------------------------- |
| `investor_key` *            | string | Unique investor key (previously registered).             |
| `bank_account` *            | object | Investor bank account (**bank_account Object**).         |
| `subscription_percentage`   | number | Subscription percentage.                                 |
| `subscription_quantity`     | number | Subscribed quantity.                                     |

### bank_account Object

| Field                                 | Type   | Description                                                   |
| ------------------------------------- | ------ | ------------------------------------------------------------- |
| `account_number` *                    | string | Bank account number.                                         |
| `account_digit` *                     | string | Bank account digit.                                          |
| `account_branch` *                    | string | Bank account branch.                                         |
| `financial_institution_code_number`   | string | Financial institution code.                                  |
| `financial_institution_ispb` *        | string | Financial institution ISPB code.                             |
| `account_type` *                      | string | Account type (`checking`, `savings`, `salary`, `payment`).  |

### financial Object

| Field                       | Type    | Description                                  |
| --------------------------- | ------- | -------------------------------------------- |
| `financial_base_date` *     | string  | Financial base date (format "YYYY-MM-DD").   |
| `interest_type` *           | string  | Interest type.                               |
| `issue_amount`              | number  | Total issued amount.                         |
| `issue_quantity`            | integer | Quantity of issued units.                    |
| `unit_price`                | number  | Unit price of the issuance.                  |
| `released_amount`           | number  | Net released amount.                         |
| `cet` / `annual_cet`        | number  | Total Effective Cost (monthly and annual), in percentage. |
| `number_of_installments` *  | integer | Number of installments.                      |
| `prefixed_interest_rate` *  | object  | Prefixed interest rate.                      |
| `fine_delay_rate`           | object  | Delay fine rate.                             |
| `contract_fine_rate`        | number  | Contractual fine in percentage.              |
| `fees`                      | array   | List of fees.                                |
| `installments`              | array   | List of already-calculated installments.     |

### related_party Object

Each item in `related_party_list` represents a party involved in the operation.

| Field             | Type    | Description                                                   |
| ----------------- | ------- | ------------------------------------------------------------ |
| `person_type` *   | string  | Person type (`natural` for individuals, `legal` for companies). |
| `name` *          | string  | Related party name.                                          |
| `document_number` * | string | CPF (individual) or CNPJ (company).                         |
| `role_type` *     | string  | Party role in the operation. **[role_type Enumerators](#role_type-enumerators)** |
| `street` *        | string  | Street.                                                     |
| `number` *        | string  | Address number.                                            |
| `neighborhood`    | string  | Neighborhood.                                              |
| `postal_code` *   | string  | Postal code (format "00000-000").                          |
| `city` *          | string  | City.                                                      |
| `state` *         | string  | State (2 letters).                                        |
| `complement`      | string  | Address complement.                                       |
| `is_pep`          | boolean | (Individual) Whether the person is a Politically Exposed Person. |
| `marital_status`  | string  | (Individual) Marital status.                              |
| `property_system` | string  | (Individual) Property regime.                             |
| `birthdate`       | string  | (Individual) Date of birth.                               |
| `mother_name`     | string  | (Individual) Mother's name.                               |
| `occupation`      | string  | (Individual) Occupation.                                  |
| `trading_name`    | string  | (Company) Trading name.                                   |
| `cnae_code`       | string  | (Company) CNAE code (format "00.00-0-00").                |
| `company_type`    | string  | (Company) Company type.                                   |
| `foundation_date` | string  | (Company) Foundation date.                                |

:::warning Attention
Required fields vary by `person_type`:
- **Individual (`natural`)**: in addition to the common fields, `is_pep` is required.
- **Company (`legal`)**: in addition to the common fields, `trading_name`, `cnae_code`, `company_type` and `foundation_date` are required.
:::

### role_type Enumerators

| Enum | Description |
|------|-------------|
| `issuer` | Issuer. |
| `investor` | Investor. |
| `cosigner` | Co-obligor. |
| `fiduciary_debtor` | Fiduciary debtor. |
| `solidary_debtor` | Joint debtor. |
| `guarantor` | Guarantor (aval). |
| `bonafide_depositary` | Bona fide depositary. |
| `intervening_guarantor` | Intervening guarantor. |
| `intervening_consentor` | Intervening consentor. |
| `intervening_discharger` | Intervening discharger. |
| `assignor` | Assignor. |
| `endorser` | Endorser. |
| `consulting` | Consulting. |
| `fund_administrator` | Fund administrator. |
| `fund_representative` | Fund representative. |
| `company_representative` | Company representative. |
| `attestant` | Attestant. |
| `debtor` | Debtor. |
| `bestowal` | Grantor. |
| `manager` | Manager. |

:::tip
Collateral and underlying assets are sent through a **separate endpoint**, after the operation is created. See the **Register underlying asset** page in this section.
:::

### signature_method Enumerators

| Enum | Description |
|------|-------------|
| `certifiqi` | Default value. The operation is sent to the signature service; a signature envelope is created and the client receives the signature URL (`signature_url`). |
| `qi_sign` | The operation is sent to the signature service; a signature envelope is created and the client receives the signature URL (`signature_url`). Also allows querying the operation's signers. |

## **Response**

STATUS 201

Response Body

```json
{
    "tenant_key": "1d29d606-649a-487f-af1c-c0f5cb3e9814",
    "operation_key": "a846cc4a-b542-4f66-9823-b6d5458bd127",
    "operation_status": "finished",
    "issuer_key": "48e2c597-f2ca-487e-9f06-2b628ecb831e",
    "issuer_name": "Dynamic Enterprises",
    "issuer_document_number": "28980395000155",
    "issue_number": 10,
    "issue_series": 1,
    "related_party_list": [ ... ],
    "financial": { ... }
}
```

The response returns the complete JSON of the created operation, including `operation_key`, the investor and related-party lists, and the calculated financial object.

---

# Send Document

URL: /en/documentation/escrituracao/emissao-cr/envio-documento

This endpoint **uploads a document** and returns the `document_key` that identifies it. This `document_key` is used to reference documents in other operation endpoints whenever the key of a previously uploaded document is required.

---

## **Request**

ENDPOINT /cr/upload
METHOD POST

Request Body

```json
{
    "document_base64": "string_b64"
}
```

### **Request Body Params**

| Field             | Type   | Description                              | Required |
|-------------------|--------|------------------------------------------|----------|
| `document_base64` * | string | Base64 encoded content of the document. | Yes      |
| `document_name`   | string | Document name.                           | -        |

## **Response**

STATUS 201

Response Body

```json
{
    "document_key": "25dd10b8-7364-4abe-b0e8-0e419b04194b"
}
```

### **Response Body Params**

| Field          | Type   | Description                            | Max Characters |
|----------------|--------|----------------------------------------|----------------|
| `document_key` * | string | Unique key of the uploaded document (UUID v4). | 36     |

---

---

# Send Operation External Document

URL: /en/documentation/escrituracao/emissao-cr/envio-documento-externo

This endpoint allows sending externally signed documents to the bookkeeping system by sending a base64 that will be analyzed and approved by the bookkeeper.

:::warning Warning
This endpoint should only be used for operations that use the **client_side** signature type or for sending the approval minutes for SA or Cooperative companies. For the flow via QI Sign or Certifiqi, contracts are generated normally.
:::

---

## Send Signed Document (POST)

### Request

ENDPOINT /cr/operation/ OPERATION-KEY /upload_signed_document
METHOD POST

### Path Params

| Field           | Type   | Description                         | Characters |
|-----------------|--------|-------------------------------------|------------|
| `OPERATION-KEY` | string | Unique operation key (UUID v4).     | 36         |

---

### Request Body

Request Body

```json
{
    "contract_base64": "image_b64",
    "contract_type": "securitization_term"
}
```

### Request Body Params

| Field               | Type   | Description                | Max Characters                                              |
|---------------------|--------|----------------------------|------------------------------------------------------------|
| `contract_type` *   | string | Type of signed document.   | **[contract_type Enumerators](#contract_type-enumerators)** |
| `contract_base64` * | string | Signed document in base64. | -                                                          |

### contract_type Enumerators

| Enum                | Description                                |
|---------------------|--------------------------------------------|
| `securitization_term` | CR securitization term. |
| `adhesion_term` | CR adhesion term. |
| `sa_minute` | CR issuance approval minutes for **SA** company. |
| `ltda_minute` | CR issuance approval minutes for **LTDA** company. |
| `cop_minute` | CR issuance approval minutes for **Cooperative**. |

### Response

The response body is a complete JSON of the updated operation.

---

---

# Register Underlying Asset (Lastro)

URL: /en/documentation/escrituracao/emissao-cra/cadastro-lastro

This endpoint registers the **underlying asset** (lastro) of a CRA operation. The underlying asset represents the credit rights backing the securitization. The asset document is sent in base64 and its structured data accompanies the request.

:::info
The underlying asset is sent **after the operation is created**, in a separate request. Multiple underlying assets can be registered for the same operation.
:::

---

## **Request**

ENDPOINT /cra/operation/ OPERATION-KEY /underlying_asset
METHOD POST

### Path Params

| Field           | Type   | Description                        | Characters |
|-----------------|--------|------------------------------------|------------|
| `OPERATION-KEY` * | string | Unique operation key (UUID v4).    | 36         |

---

### Request Body

Request Body

```json
{
    "underlying_asset_type": "contract",
    "underlying_asset_base64": "image_b64",
    "underlying_asset_data": {
        "contract_number": "12345",
        "debtor_document_number": "12.345.678/0001-90",
        "amount": 1075268.82,
        "due_date": "2026-01-20"
    }
}
```

### Request Body Params

| Field                     | Type   | Description                              | Max Characters                                                       |
|---------------------------|--------|------------------------------------------|----------------------------------------------------------------------|
| `underlying_asset_type` * | string | Underlying asset type.                   | **[underlying_asset_type Enumerators](#underlying_asset_type-enumerators)** |
| `underlying_asset_base64` * | string | Underlying asset document in base64.   | -                                                                    |
| `underlying_asset_data` * | object | Underlying asset data (free-form).       | -                                                                    |

### underlying_asset_type Enumerators

| Enum       | Description |
|------------|-------------|
| `contract` | Contract.   |

## **Response**

STATUS 201

Response Body

```json
{
    "underlying_asset_key": "5b1f9c2e-2a44-4f0e-9c0a-7b2e0d6f1a23",
    "underlying_asset_type": "contract",
    "underlying_asset_data": {
        "contract_number": "12345",
        "debtor_document_number": "12.345.678/0001-90",
        "amount": 1075268.82,
        "due_date": "2026-01-20"
    }
}
```

### Response Body Params

| Field                     | Type   | Description                        |
|---------------------------|--------|------------------------------------|
| `underlying_asset_key` *  | string | Unique key of the registered asset.|
| `underlying_asset_type` * | string | Underlying asset type.             |
| `underlying_asset_data` * | object | Underlying asset data.             |

---

---

# Register CRA Operation

URL: /en/documentation/escrituracao/emissao-cra/cadastro-operacao

This endpoint creates a complete CRA operation in a single request.

:::info
The `financial` object is **required** and must be sent already calculated, as this endpoint does not run the financial simulation. The issuer and its bank account must be previously registered.
:::

---

## **Request**

ENDPOINT /cra/create_operation
METHOD POST

The request body ranges from a **payload with the required fields** (including the financial object) to a **complete payload** that also includes related parties. See both variations below.

Payload with the required fields

```json
{
    "tenant_key": "1d29d606-649a-487f-af1c-c0f5cb3e9814",
    "issuer_key": "48e2c597-f2ca-487e-9f06-2b628ecb831e",
    "issue_number": 10,
    "issue_series": 1,
    "issue_date": "2025-01-20",
    "investors": [
        {
            "investor_key": "70b1b638-ca56-4eb3-9a88-2fd5ffd077a7",
            "bank_account": {
                "account_number": "33400254",
                "account_digit": "3",
                "account_branch": "0001",
                "financial_institution_code_number": "329",
                "financial_institution_ispb": "32402502",
                "account_type": "checking"
            }
        }
    ],
    "financial": {
        "financial_base_date": "2025-01-20",
        "interest_type": "pre_price_days",
        "issue_amount": 1075268.82,
        "issue_quantity": 1075268,
        "unit_price": 1.0000007626,
        "released_amount": 1075268.82,
        "cet": 7.7,
        "annual_cet": 143.55,
        "first_due_date": "2025-02-20",
        "number_of_installments": 5,
        "prefixed_interest_rate": {
            "interest_base": "calendar_days_365",
            "monthly_rate": 0.05,
            "daily_rate": 0.0016053474,
            "annual_rate": 0.795856326
        },
        "fine_delay_rate": { "interest_base": "calendar_days_365", "monthly_rate": 0.01 },
        "contract_fine_rate": 0.02,
        "fees": [
            { "amount": 2.0, "fee_amount": 21505.38, "amount_type": "percentage", "fee_type": "bookkeeping_fee", "type": "internal" }
        ],
        "installments": [
            {
                "installment_number": 1,
                "due_date": "2025-02-20",
                "amount": 248113.17,
                "principal_amortization_amount": 193292.79655634,
                "principal_amortization_unit_price": 1.02,
                "interest_amount": 0.0,
                "calendar_days": 31,
                "workdays": 23
            }
        ]
    }
}
```

Complete payload (with related parties)

```json
{
    "tenant_key": "1d29d606-649a-487f-af1c-c0f5cb3e9814",
    "issuer_key": "48e2c597-f2ca-487e-9f06-2b628ecb831e",
    "issue_number": 10,
    "issue_series": 1,
    "contract_number": "CRA-2025-0001",
    "issue_date": "2025-01-20",
    "signature_method": "certifiqi",
    "investors": [
        {
            "investor_key": "70b1b638-ca56-4eb3-9a88-2fd5ffd077a7",
            "subscription_percentage": 100,
            "bank_account": {
                "account_number": "33400254",
                "account_digit": "3",
                "account_branch": "0001",
                "financial_institution_code_number": "329",
                "financial_institution_ispb": "32402502",
                "account_type": "checking"
            }
        }
    ],
    "financial": {
        "financial_base_date": "2025-01-20",
        "interest_type": "pre_price_days",
        "issue_amount": 1075268.82,
        "issue_quantity": 1075268,
        "unit_price": 1.0000007626,
        "released_amount": 1075268.82,
        "cet": 7.7,
        "annual_cet": 143.55,
        "first_due_date": "2025-02-20",
        "number_of_installments": 5,
        "prefixed_interest_rate": {
            "interest_base": "calendar_days_365",
            "monthly_rate": 0.05,
            "daily_rate": 0.0016053474,
            "annual_rate": 0.795856326
        },
        "fine_delay_rate": { "interest_base": "calendar_days_365", "monthly_rate": 0.01 },
        "contract_fine_rate": 0.02,
        "fees": [
            { "amount": 2.0, "fee_amount": 21505.38, "amount_type": "percentage", "fee_type": "bookkeeping_fee", "type": "internal" }
        ],
        "installments": [
            {
                "installment_number": 1,
                "due_date": "2025-02-20",
                "amount": 248113.17,
                "principal_amortization_amount": 193292.79655634,
                "principal_amortization_unit_price": 1.02,
                "interest_amount": 0.0,
                "calendar_days": 31,
                "workdays": 23
            }
        ]
    },
    "related_party_list": [
        {
            "person_type": "legal",
            "name": "Garantidora S.A.",
            "document_number": "12.345.678/0001-90",
            "trading_name": "Garantidora",
            "cnae_code": "64.62-0-00",
            "company_type": "sa",
            "foundation_date": "2010-05-01",
            "street": "Av. Paulista",
            "number": "1000",
            "neighborhood": "Bela Vista",
            "postal_code": "01310-100",
            "city": "São Paulo",
            "state": "SP",
            "role_type": "guarantor"
        },
        {
            "person_type": "natural",
            "name": "João da Silva",
            "document_number": "123.456.789-00",
            "street": "Rua das Flores",
            "number": "123",
            "neighborhood": "Centro",
            "postal_code": "01001-000",
            "city": "São Paulo",
            "state": "SP",
            "role_type": "solidary_debtor",
            "is_pep": false
        }
    ]
}
```

### **Request Body Params**

| Field               | Type    | Description                                          | Max Characters             |
| ------------------- | ------- | --------------------------------------------------- | -------------------------- |
| `tenant_key` *      | string  | Unique tenant key.                                  | -                          |
| `issuer_key` *      | string  | Unique issuer key (previously registered).          | -                          |
| `issue_number` *    | integer | Issue number.                                       | -                          |
| `issue_series` *    | integer | Issue series.                                       | -                          |
| `issue_date` *      | string  | Operation issue date (format "YYYY-MM-DD").         | -                          |
| `signature_method`  | string  | Signature method used in the operation. Optional; when omitted, defaults to `certifiqi`. | **[signature_method Enumerators](#signature_method-enumerators)** |
| `investors` *       | array   | List of involved investors.                         | **investors Object**       |
| `financial` *       | object  | Already-calculated operation financial data.        | **financial Object**       |
| `contract_number`   | string  | Contract number.                                    | -                          |
| `related_party_list` | array  | Operation related parties (guarantors, debtors, etc.). | **related_party Object** |

### investors Object

| Field                       | Type   | Description                                               |
| --------------------------- | ------ | -------------------------------------------------------- |
| `investor_key` *            | string | Unique investor key (previously registered).             |
| `bank_account` *            | object | Investor bank account (**bank_account Object**).         |
| `subscription_percentage`   | number | Subscription percentage.                                 |
| `subscription_quantity`     | number | Subscribed quantity.                                     |

### bank_account Object

| Field                                 | Type   | Description                                                   |
| ------------------------------------- | ------ | ------------------------------------------------------------- |
| `account_number` *                    | string | Bank account number.                                         |
| `account_digit` *                     | string | Bank account digit.                                          |
| `account_branch` *                    | string | Bank account branch.                                         |
| `financial_institution_code_number`   | string | Financial institution code.                                  |
| `financial_institution_ispb` *        | string | Financial institution ISPB code.                             |
| `account_type` *                      | string | Account type (`checking`, `savings`, `salary`, `payment`).  |

### financial Object

| Field                       | Type    | Description                                  |
| --------------------------- | ------- | -------------------------------------------- |
| `financial_base_date` *     | string  | Financial base date (format "YYYY-MM-DD").   |
| `interest_type` *           | string  | Interest type.                               |
| `issue_amount`              | number  | Total issued amount.                         |
| `issue_quantity`            | integer | Quantity of issued units.                    |
| `unit_price`                | number  | Unit price of the issuance.                  |
| `released_amount`           | number  | Net released amount.                         |
| `cet` / `annual_cet`        | number  | Total Effective Cost (monthly and annual), in percentage. |
| `number_of_installments` *  | integer | Number of installments.                      |
| `prefixed_interest_rate` *  | object  | Prefixed interest rate.                      |
| `fine_delay_rate`           | object  | Delay fine rate.                             |
| `contract_fine_rate`        | number  | Contractual fine in percentage.              |
| `fees`                      | array   | List of fees.                                |
| `installments`              | array   | List of already-calculated installments.     |

### related_party Object

Each item in `related_party_list` represents a party involved in the operation.

| Field             | Type    | Description                                                   |
| ----------------- | ------- | ------------------------------------------------------------ |
| `person_type` *   | string  | Person type (`natural` for individuals, `legal` for companies). |
| `name` *          | string  | Related party name.                                          |
| `document_number` * | string | CPF (individual) or CNPJ (company).                         |
| `role_type` *     | string  | Party role in the operation. **[role_type Enumerators](#role_type-enumerators)** |
| `street` *        | string  | Street.                                                     |
| `number` *        | string  | Address number.                                            |
| `neighborhood`    | string  | Neighborhood.                                              |
| `postal_code` *   | string  | Postal code (format "00000-000").                          |
| `city` *          | string  | City.                                                      |
| `state` *         | string  | State (2 letters).                                        |
| `complement`      | string  | Address complement.                                       |
| `is_pep`          | boolean | (Individual) Whether the person is a Politically Exposed Person. |
| `marital_status`  | string  | (Individual) Marital status.                              |
| `property_system` | string  | (Individual) Property regime.                             |
| `birthdate`       | string  | (Individual) Date of birth.                               |
| `mother_name`     | string  | (Individual) Mother's name.                               |
| `occupation`      | string  | (Individual) Occupation.                                  |
| `trading_name`    | string  | (Company) Trading name.                                   |
| `cnae_code`       | string  | (Company) CNAE code (format "00.00-0-00").                |
| `company_type`    | string  | (Company) Company type.                                   |
| `foundation_date` | string  | (Company) Foundation date.                                |

:::warning Attention
Required fields vary by `person_type`:
- **Individual (`natural`)**: in addition to the common fields, `is_pep` is required.
- **Company (`legal`)**: in addition to the common fields, `trading_name`, `cnae_code`, `company_type` and `foundation_date` are required.
:::

### role_type Enumerators

| Enum | Description |
|------|-------------|
| `issuer` | Issuer. |
| `investor` | Investor. |
| `cosigner` | Co-obligor. |
| `fiduciary_debtor` | Fiduciary debtor. |
| `solidary_debtor` | Joint debtor. |
| `guarantor` | Guarantor (aval). |
| `bonafide_depositary` | Bona fide depositary. |
| `intervening_guarantor` | Intervening guarantor. |
| `intervening_consentor` | Intervening consentor. |
| `intervening_discharger` | Intervening discharger. |
| `assignor` | Assignor. |
| `endorser` | Endorser. |
| `consulting` | Consulting. |
| `fund_administrator` | Fund administrator. |
| `fund_representative` | Fund representative. |
| `company_representative` | Company representative. |
| `attestant` | Attestant. |
| `debtor` | Debtor. |
| `bestowal` | Grantor. |
| `manager` | Manager. |

:::tip
Collateral and underlying assets are sent through a **separate endpoint**, after the operation is created. See the **Register underlying asset** page in this section.
:::

### signature_method Enumerators

| Enum | Description |
|------|-------------|
| `certifiqi` | Default value. The operation is sent to the signature service; a signature envelope is created and the client receives the signature URL (`signature_url`). |
| `qi_sign` | The operation is sent to the signature service; a signature envelope is created and the client receives the signature URL (`signature_url`). Also allows querying the operation's signers. |

## **Response**

STATUS 201

Response Body

```json
{
    "tenant_key": "1d29d606-649a-487f-af1c-c0f5cb3e9814",
    "operation_key": "a846cc4a-b542-4f66-9823-b6d5458bd127",
    "operation_status": "finished",
    "issuer_key": "48e2c597-f2ca-487e-9f06-2b628ecb831e",
    "issuer_name": "Dynamic Enterprises",
    "issuer_document_number": "28980395000155",
    "issue_number": 10,
    "issue_series": 1,
    "related_party_list": [ ... ],
    "financial": { ... }
}
```

The response returns the complete JSON of the created operation, including `operation_key`, the investor and related-party lists, and the calculated financial object.

---

# Send Document

URL: /en/documentation/escrituracao/emissao-cra/envio-documento

This endpoint **uploads a document** and returns the `document_key` that identifies it. This `document_key` is used to reference documents in other operation endpoints whenever the key of a previously uploaded document is required.

---

## **Request**

ENDPOINT /cra/upload
METHOD POST

Request Body

```json
{
    "document_base64": "string_b64"
}
```

### **Request Body Params**

| Field             | Type   | Description                              | Required |
|-------------------|--------|------------------------------------------|----------|
| `document_base64` * | string | Base64 encoded content of the document. | Yes      |
| `document_name`   | string | Document name.                           | -        |

## **Response**

STATUS 201

Response Body

```json
{
    "document_key": "25dd10b8-7364-4abe-b0e8-0e419b04194b"
}
```

### **Response Body Params**

| Field          | Type   | Description                            | Max Characters |
|----------------|--------|----------------------------------------|----------------|
| `document_key` * | string | Unique key of the uploaded document (UUID v4). | 36     |

---

---

# Send Operation External Document

URL: /en/documentation/escrituracao/emissao-cra/envio-documento-externo

This endpoint allows sending externally signed documents to the bookkeeping system by sending a base64 that will be analyzed and approved by the bookkeeper.

:::warning Warning
This endpoint should only be used for operations that use the **client_side** signature type or for sending the approval minutes for SA or Cooperative companies. For the flow via QI Sign or Certifiqi, contracts are generated normally.
:::

---

## Send Signed Document (POST)

### Request

ENDPOINT /cra/operation/ OPERATION-KEY /upload_signed_document
METHOD POST

### Path Params

| Field           | Type   | Description                         | Characters |
|-----------------|--------|-------------------------------------|------------|
| `OPERATION-KEY` | string | Unique operation key (UUID v4).     | 36         |

---

### Request Body

Request Body

```json
{
    "contract_base64": "image_b64",
    "contract_type": "securitization_term"
}
```

### Request Body Params

| Field               | Type   | Description                | Max Characters                                              |
|---------------------|--------|----------------------------|------------------------------------------------------------|
| `contract_type` *   | string | Type of signed document.   | **[contract_type Enumerators](#contract_type-enumerators)** |
| `contract_base64` * | string | Signed document in base64. | -                                                          |

### contract_type Enumerators

| Enum                | Description                                |
|---------------------|--------------------------------------------|
| `securitization_term` | CRA securitization term. |
| `adhesion_term` | CRA adhesion term. |
| `sa_minute` | CRA issuance approval minutes for **SA** company. |
| `ltda_minute` | CRA issuance approval minutes for **LTDA** company. |
| `cop_minute` | CRA issuance approval minutes for **Cooperative**. |

### Response

The response body is a complete JSON of the updated operation.

---

---

# Register Underlying Asset (Lastro)

URL: /en/documentation/escrituracao/emissao-cri/cadastro-lastro

This endpoint registers the **underlying asset** (lastro) of a CRI operation. The underlying asset represents the credit rights backing the securitization. The asset document is sent in base64 and its structured data accompanies the request.

:::info
The underlying asset is sent **after the operation is created**, in a separate request. Multiple underlying assets can be registered for the same operation.
:::

---

## **Request**

ENDPOINT /cri/operation/ OPERATION-KEY /underlying_asset
METHOD POST

### Path Params

| Field           | Type   | Description                        | Characters |
|-----------------|--------|------------------------------------|------------|
| `OPERATION-KEY` * | string | Unique operation key (UUID v4).    | 36         |

---

### Request Body

Request Body

```json
{
    "underlying_asset_type": "contract",
    "underlying_asset_base64": "image_b64",
    "underlying_asset_data": {
        "contract_number": "12345",
        "debtor_document_number": "12.345.678/0001-90",
        "amount": 1075268.82,
        "due_date": "2026-01-20"
    }
}
```

### Request Body Params

| Field                     | Type   | Description                              | Max Characters                                                       |
|---------------------------|--------|------------------------------------------|----------------------------------------------------------------------|
| `underlying_asset_type` * | string | Underlying asset type.                   | **[underlying_asset_type Enumerators](#underlying_asset_type-enumerators)** |
| `underlying_asset_base64` * | string | Underlying asset document in base64.   | -                                                                    |
| `underlying_asset_data` * | object | Underlying asset data (free-form).       | -                                                                    |

### underlying_asset_type Enumerators

| Enum       | Description |
|------------|-------------|
| `contract` | Contract.   |

## **Response**

STATUS 201

Response Body

```json
{
    "underlying_asset_key": "5b1f9c2e-2a44-4f0e-9c0a-7b2e0d6f1a23",
    "underlying_asset_type": "contract",
    "underlying_asset_data": {
        "contract_number": "12345",
        "debtor_document_number": "12.345.678/0001-90",
        "amount": 1075268.82,
        "due_date": "2026-01-20"
    }
}
```

### Response Body Params

| Field                     | Type   | Description                        |
|---------------------------|--------|------------------------------------|
| `underlying_asset_key` *  | string | Unique key of the registered asset.|
| `underlying_asset_type` * | string | Underlying asset type.             |
| `underlying_asset_data` * | object | Underlying asset data.             |

---

---

# Register CRI Operation

URL: /en/documentation/escrituracao/emissao-cri/cadastro-operacao

This endpoint creates a complete CRI operation in a single request.

:::info
The `financial` object is **required** and must be sent already calculated, as this endpoint does not run the financial simulation. The issuer and its bank account must be previously registered.
:::

---

## **Request**

ENDPOINT /cri/create_operation
METHOD POST

The request body ranges from a **payload with the required fields** (including the financial object) to a **complete payload** that also includes related parties. See both variations below.

Payload with the required fields

```json
{
    "tenant_key": "1d29d606-649a-487f-af1c-c0f5cb3e9814",
    "issuer_key": "48e2c597-f2ca-487e-9f06-2b628ecb831e",
    "issue_number": 10,
    "issue_series": 1,
    "issue_date": "2025-01-20",
    "investors": [
        {
            "investor_key": "70b1b638-ca56-4eb3-9a88-2fd5ffd077a7",
            "bank_account": {
                "account_number": "33400254",
                "account_digit": "3",
                "account_branch": "0001",
                "financial_institution_code_number": "329",
                "financial_institution_ispb": "32402502",
                "account_type": "checking"
            }
        }
    ],
    "financial": {
        "financial_base_date": "2025-01-20",
        "interest_type": "pre_price_days",
        "issue_amount": 1075268.82,
        "issue_quantity": 1075268,
        "unit_price": 1.0000007626,
        "released_amount": 1075268.82,
        "cet": 7.7,
        "annual_cet": 143.55,
        "first_due_date": "2025-02-20",
        "number_of_installments": 5,
        "prefixed_interest_rate": {
            "interest_base": "calendar_days_365",
            "monthly_rate": 0.05,
            "daily_rate": 0.0016053474,
            "annual_rate": 0.795856326
        },
        "fine_delay_rate": { "interest_base": "calendar_days_365", "monthly_rate": 0.01 },
        "contract_fine_rate": 0.02,
        "fees": [
            { "amount": 2.0, "fee_amount": 21505.38, "amount_type": "percentage", "fee_type": "bookkeeping_fee", "type": "internal" }
        ],
        "installments": [
            {
                "installment_number": 1,
                "due_date": "2025-02-20",
                "amount": 248113.17,
                "principal_amortization_amount": 193292.79655634,
                "principal_amortization_unit_price": 1.02,
                "interest_amount": 0.0,
                "calendar_days": 31,
                "workdays": 23
            }
        ]
    }
}
```

Complete payload (with related parties)

```json
{
    "tenant_key": "1d29d606-649a-487f-af1c-c0f5cb3e9814",
    "issuer_key": "48e2c597-f2ca-487e-9f06-2b628ecb831e",
    "issue_number": 10,
    "issue_series": 1,
    "contract_number": "CRI-2025-0001",
    "issue_date": "2025-01-20",
    "signature_method": "certifiqi",
    "investors": [
        {
            "investor_key": "70b1b638-ca56-4eb3-9a88-2fd5ffd077a7",
            "subscription_percentage": 100,
            "bank_account": {
                "account_number": "33400254",
                "account_digit": "3",
                "account_branch": "0001",
                "financial_institution_code_number": "329",
                "financial_institution_ispb": "32402502",
                "account_type": "checking"
            }
        }
    ],
    "financial": {
        "financial_base_date": "2025-01-20",
        "interest_type": "pre_price_days",
        "issue_amount": 1075268.82,
        "issue_quantity": 1075268,
        "unit_price": 1.0000007626,
        "released_amount": 1075268.82,
        "cet": 7.7,
        "annual_cet": 143.55,
        "first_due_date": "2025-02-20",
        "number_of_installments": 5,
        "prefixed_interest_rate": {
            "interest_base": "calendar_days_365",
            "monthly_rate": 0.05,
            "daily_rate": 0.0016053474,
            "annual_rate": 0.795856326
        },
        "fine_delay_rate": { "interest_base": "calendar_days_365", "monthly_rate": 0.01 },
        "contract_fine_rate": 0.02,
        "fees": [
            { "amount": 2.0, "fee_amount": 21505.38, "amount_type": "percentage", "fee_type": "bookkeeping_fee", "type": "internal" }
        ],
        "installments": [
            {
                "installment_number": 1,
                "due_date": "2025-02-20",
                "amount": 248113.17,
                "principal_amortization_amount": 193292.79655634,
                "principal_amortization_unit_price": 1.02,
                "interest_amount": 0.0,
                "calendar_days": 31,
                "workdays": 23
            }
        ]
    },
    "related_party_list": [
        {
            "person_type": "legal",
            "name": "Garantidora S.A.",
            "document_number": "12.345.678/0001-90",
            "trading_name": "Garantidora",
            "cnae_code": "64.62-0-00",
            "company_type": "sa",
            "foundation_date": "2010-05-01",
            "street": "Av. Paulista",
            "number": "1000",
            "neighborhood": "Bela Vista",
            "postal_code": "01310-100",
            "city": "São Paulo",
            "state": "SP",
            "role_type": "guarantor"
        },
        {
            "person_type": "natural",
            "name": "João da Silva",
            "document_number": "123.456.789-00",
            "street": "Rua das Flores",
            "number": "123",
            "neighborhood": "Centro",
            "postal_code": "01001-000",
            "city": "São Paulo",
            "state": "SP",
            "role_type": "solidary_debtor",
            "is_pep": false
        }
    ]
}
```

### **Request Body Params**

| Field               | Type    | Description                                          | Max Characters             |
| ------------------- | ------- | --------------------------------------------------- | -------------------------- |
| `tenant_key` *      | string  | Unique tenant key.                                  | -                          |
| `issuer_key` *      | string  | Unique issuer key (previously registered).          | -                          |
| `issue_number` *    | integer | Issue number.                                       | -                          |
| `issue_series` *    | integer | Issue series.                                       | -                          |
| `issue_date` *      | string  | Operation issue date (format "YYYY-MM-DD").         | -                          |
| `signature_method`  | string  | Signature method used in the operation. Optional; when omitted, defaults to `certifiqi`. | **[signature_method Enumerators](#signature_method-enumerators)** |
| `investors` *       | array   | List of involved investors.                         | **investors Object**       |
| `financial` *       | object  | Already-calculated operation financial data.        | **financial Object**       |
| `contract_number`   | string  | Contract number.                                    | -                          |
| `related_party_list` | array  | Operation related parties (guarantors, debtors, etc.). | **related_party Object** |

### investors Object

| Field                       | Type   | Description                                               |
| --------------------------- | ------ | -------------------------------------------------------- |
| `investor_key` *            | string | Unique investor key (previously registered).             |
| `bank_account` *            | object | Investor bank account (**bank_account Object**).         |
| `subscription_percentage`   | number | Subscription percentage.                                 |
| `subscription_quantity`     | number | Subscribed quantity.                                     |

### bank_account Object

| Field                                 | Type   | Description                                                   |
| ------------------------------------- | ------ | ------------------------------------------------------------- |
| `account_number` *                    | string | Bank account number.                                         |
| `account_digit` *                     | string | Bank account digit.                                          |
| `account_branch` *                    | string | Bank account branch.                                         |
| `financial_institution_code_number`   | string | Financial institution code.                                  |
| `financial_institution_ispb` *        | string | Financial institution ISPB code.                             |
| `account_type` *                      | string | Account type (`checking`, `savings`, `salary`, `payment`).  |

### financial Object

| Field                       | Type    | Description                                  |
| --------------------------- | ------- | -------------------------------------------- |
| `financial_base_date` *     | string  | Financial base date (format "YYYY-MM-DD").   |
| `interest_type` *           | string  | Interest type.                               |
| `issue_amount`              | number  | Total issued amount.                         |
| `issue_quantity`            | integer | Quantity of issued units.                    |
| `unit_price`                | number  | Unit price of the issuance.                  |
| `released_amount`           | number  | Net released amount.                         |
| `cet` / `annual_cet`        | number  | Total Effective Cost (monthly and annual), in percentage. |
| `number_of_installments` *  | integer | Number of installments.                      |
| `prefixed_interest_rate` *  | object  | Prefixed interest rate.                      |
| `fine_delay_rate`           | object  | Delay fine rate.                             |
| `contract_fine_rate`        | number  | Contractual fine in percentage.              |
| `fees`                      | array   | List of fees.                                |
| `installments`              | array   | List of already-calculated installments.     |

### related_party Object

Each item in `related_party_list` represents a party involved in the operation.

| Field             | Type    | Description                                                   |
| ----------------- | ------- | ------------------------------------------------------------ |
| `person_type` *   | string  | Person type (`natural` for individuals, `legal` for companies). |
| `name` *          | string  | Related party name.                                          |
| `document_number` * | string | CPF (individual) or CNPJ (company).                         |
| `role_type` *     | string  | Party role in the operation. **[role_type Enumerators](#role_type-enumerators)** |
| `street` *        | string  | Street.                                                     |
| `number` *        | string  | Address number.                                            |
| `neighborhood`    | string  | Neighborhood.                                              |
| `postal_code` *   | string  | Postal code (format "00000-000").                          |
| `city` *          | string  | City.                                                      |
| `state` *         | string  | State (2 letters).                                        |
| `complement`      | string  | Address complement.                                       |
| `is_pep`          | boolean | (Individual) Whether the person is a Politically Exposed Person. |
| `marital_status`  | string  | (Individual) Marital status.                              |
| `property_system` | string  | (Individual) Property regime.                             |
| `birthdate`       | string  | (Individual) Date of birth.                               |
| `mother_name`     | string  | (Individual) Mother's name.                               |
| `occupation`      | string  | (Individual) Occupation.                                  |
| `trading_name`    | string  | (Company) Trading name.                                   |
| `cnae_code`       | string  | (Company) CNAE code (format "00.00-0-00").                |
| `company_type`    | string  | (Company) Company type.                                   |
| `foundation_date` | string  | (Company) Foundation date.                                |

:::warning Attention
Required fields vary by `person_type`:
- **Individual (`natural`)**: in addition to the common fields, `is_pep` is required.
- **Company (`legal`)**: in addition to the common fields, `trading_name`, `cnae_code`, `company_type` and `foundation_date` are required.
:::

### role_type Enumerators

| Enum | Description |
|------|-------------|
| `issuer` | Issuer. |
| `investor` | Investor. |
| `cosigner` | Co-obligor. |
| `fiduciary_debtor` | Fiduciary debtor. |
| `solidary_debtor` | Joint debtor. |
| `guarantor` | Guarantor (aval). |
| `bonafide_depositary` | Bona fide depositary. |
| `intervening_guarantor` | Intervening guarantor. |
| `intervening_consentor` | Intervening consentor. |
| `intervening_discharger` | Intervening discharger. |
| `assignor` | Assignor. |
| `endorser` | Endorser. |
| `consulting` | Consulting. |
| `fund_administrator` | Fund administrator. |
| `fund_representative` | Fund representative. |
| `company_representative` | Company representative. |
| `attestant` | Attestant. |
| `debtor` | Debtor. |
| `bestowal` | Grantor. |
| `manager` | Manager. |

:::tip
Collateral and underlying assets are sent through a **separate endpoint**, after the operation is created. See the **Register underlying asset** page in this section.
:::

### signature_method Enumerators

| Enum | Description |
|------|-------------|
| `certifiqi` | Default value. The operation is sent to the signature service; a signature envelope is created and the client receives the signature URL (`signature_url`). |
| `qi_sign` | The operation is sent to the signature service; a signature envelope is created and the client receives the signature URL (`signature_url`). Also allows querying the operation's signers. |

## **Response**

STATUS 201

Response Body

```json
{
    "tenant_key": "1d29d606-649a-487f-af1c-c0f5cb3e9814",
    "operation_key": "a846cc4a-b542-4f66-9823-b6d5458bd127",
    "operation_status": "finished",
    "issuer_key": "48e2c597-f2ca-487e-9f06-2b628ecb831e",
    "issuer_name": "Dynamic Enterprises",
    "issuer_document_number": "28980395000155",
    "issue_number": 10,
    "issue_series": 1,
    "related_party_list": [ ... ],
    "financial": { ... }
}
```

The response returns the complete JSON of the created operation, including `operation_key`, the investor and related-party lists, and the calculated financial object.

---

# Send Document

URL: /en/documentation/escrituracao/emissao-cri/envio-documento

This endpoint **uploads a document** and returns the `document_key` that identifies it. This `document_key` is used to reference documents in other operation endpoints whenever the key of a previously uploaded document is required.

---

## **Request**

ENDPOINT /cri/upload
METHOD POST

Request Body

```json
{
    "document_base64": "string_b64"
}
```

### **Request Body Params**

| Field             | Type   | Description                              | Required |
|-------------------|--------|------------------------------------------|----------|
| `document_base64` * | string | Base64 encoded content of the document. | Yes      |
| `document_name`   | string | Document name.                           | -        |

## **Response**

STATUS 201

Response Body

```json
{
    "document_key": "25dd10b8-7364-4abe-b0e8-0e419b04194b"
}
```

### **Response Body Params**

| Field          | Type   | Description                            | Max Characters |
|----------------|--------|----------------------------------------|----------------|
| `document_key` * | string | Unique key of the uploaded document (UUID v4). | 36     |

---

---

# Send Operation External Document

URL: /en/documentation/escrituracao/emissao-cri/envio-documento-externo

This endpoint allows sending externally signed documents to the bookkeeping system by sending a base64 that will be analyzed and approved by the bookkeeper.

:::warning Warning
This endpoint should only be used for operations that use the **client_side** signature type or for sending the approval minutes for SA or Cooperative companies. For the flow via QI Sign or Certifiqi, contracts are generated normally.
:::

---

## Send Signed Document (POST)

### Request

ENDPOINT /cri/operation/ OPERATION-KEY /upload_signed_document
METHOD POST

### Path Params

| Field           | Type   | Description                         | Characters |
|-----------------|--------|-------------------------------------|------------|
| `OPERATION-KEY` | string | Unique operation key (UUID v4).     | 36         |

---

### Request Body

Request Body

```json
{
    "contract_base64": "image_b64",
    "contract_type": "securitization_term"
}
```

### Request Body Params

| Field               | Type   | Description                | Max Characters                                              |
|---------------------|--------|----------------------------|------------------------------------------------------------|
| `contract_type` *   | string | Type of signed document.   | **[contract_type Enumerators](#contract_type-enumerators)** |
| `contract_base64` * | string | Signed document in base64. | -                                                          |

### contract_type Enumerators

| Enum                | Description                                |
|---------------------|--------------------------------------------|
| `securitization_term` | CRI securitization term. |
| `adhesion_term` | CRI adhesion term. |
| `sa_minute` | CRI issuance approval minutes for **SA** company. |
| `ltda_minute` | CRI issuance approval minutes for **LTDA** company. |
| `cop_minute` | CRI issuance approval minutes for **Cooperative**. |

### Response

The response body is a complete JSON of the updated operation.

---

---

# Operation disbursement account update.

URL: /en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/atualizar-conta-desembolso

This endpoint allows updating the disbursement account of an operation.

---

## **Operation disbursement account update (PUT)**

### **Request**
ENDPOINT /commercial_paper/operation/ OPERATION-KEY /issuer_bank_account
METHOD PUT

### **Path Params**

| Field             | Type   | Description                                     | Max Characters |
|-------------------|--------|-----------------------------------------------|-----------------|
| `OPERATION-KEY` * | string | Unique operation key (UUID v4).             | 36              |

Request Body

```json
{
    "issuer_bank_account": {
        "account_number": "4464541",
        "account_digit": "3",
        "account_branch": "0001",
        "financial_institution_code_number": "329",
        "financial_institution_ispb": "32402502",
        "account_type": "checking"
    }
}
```

### Request Body Params

### **issuer_bank_account object**

| Field                                   | Type   | Description                                |
| --------------------------------------- | ------ | ------------------------------------------ |
| `account_number` *                    | string | Bank account number.                |
| `account_digit` *                     | string | Bank account digit.                |
| `account_branch` *                    | string | Bank account branch.               |
| `financial_institution_code_number` * | string | Financial institution code.       |
| `financial_institution_ispb` *        | string | Financial institution ISPB code.  |
| `account_type` *                      | string | Account type (`checking`, `savings`). |

## **Response**

STATUS 200

Response Body

```json
{
    "tenant_key": "13a6a1d5-7a3c-4627-a0a6-9fd746662ca4",
    "operation_key": "dc368e4d-c288-4971-ad8d-5c9c31616e74",
    "operation_type": "commercial_paper",
    "operation_status": "issued",
    "backoffice_analysis_status": "approved",
    "issuer_key": "9e08fd62-ce43-4c95-99e0-4386e980d618",
    "issuer_name": "Blue Logic",
    "issuer_document_number": "97.923.586/0001-06",
    "issuer_bank_account": {
        "account_type": "checking",
        "account_digit": "3",
        "account_branch": "0001",
        "account_number": "4464541",
        "financial_institution_ispb": "32402502",
        "financial_institution_code_number": "329"
    },
    "issuer_onboarding_approved": true,
    "issue_number": 1,
    "issue_series": 1,
    "contract_number": "0000000001",
    "issue_date": "2025-02-03",
    "financial_base_date": "2025-02-03",
    "commercial_paper_template_key": "68956441-d46c-44ed-93b9-b1806dd6ada9",
    "commercial_paper_document_key": "dc368e4d-c288-4971-ad8d-5c9c31616e74/commercial_paper/2cb87abc-8bdf-4df3-be98-b7afb53b14c8",
    "adhesion_term_template_key": "58743ab9-99bd-439a-93af-16e4c5fccd6f",
    "adhesion_term_document_key": "dc368e4d-c288-4971-ad8d-5c9c31616e74/adhesion_term/fe74eaed-2f44-45b4-b972-83fa222cbf1c",
    "envelope_signature_status": "signed",
    "envelope_key": "4d7f28b4-185f-482d-929e-d1af937cb27b",
    "envelope_signature_url": "https://sandbox.certifiqi.com.br/sign?batch-group=c4747fe6-2cc0-41a9-8972-84b44f8fff8a",
    "envelope_signed_files_key": "dc368e4d-c288-4971-ad8d-5c9c31616e74/signed_files",
    "financial": {
        "financial_base_date": "2025-02-03",
        "issue_quantity": 1000000,
        "unit_price": 1.0,
        "issue_amount": 1000000.0,
        "released_amount": 1000000.0,
        "cet": 5.0,
        "annual_cet": 79.59,
        "number_of_installments": 5,
        "prefixed_interest_rate": {
            "daily_rate": 0.0016053474,
            "annual_rate": 0.795856326,
            "monthly_rate": 0.05,
            "interest_base": "calendar_days_365"
        },
        "fine_delay_rate": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days_365"
        },
        "contract_fine_rate": 0.02,
        "financial_index": null,
        "post_fixed_interest_rate": null,
        "fees": [
            {
                "type": "internal",
                "amount": 2.0,
                "fee_type": "bookkeeping_fee",
                "fee_amount": 20000.0,
                "amount_type": "percentage"
            },
            {
                "type": "external",
                "amount": 5.0,
                "fee_type": "structuring_fee",
                "fee_amount": 50000.0,
                "amount_type": "percentage"
            }
        ],
        "installment_list": [
            {
                "installment_number": 1,
                "workdays": 20,
                "calendar_days": 30,
                "principal_amortization_unit_price": 0.18122484,
                "principal_amortization_amount": 181224.84138231,
                "interest_amount": 49298.45861769,
                "amount": 230523.3,
                "due_principal": 1000000.0,
                "due_interest": 0.0,
                "due_date": "2025-03-05",
                "has_interest": true
            },
            {
                "installment_number": 2,
                "workdays": 21,
                "calendar_days": 29,
                "principal_amortization_unit_price": 0.19153595,
                "principal_amortization_amount": 191535.95353305,
                "interest_amount": 38987.34646695,
                "amount": 230523.3,
                "due_principal": 818775.15861769,
                "due_interest": 0.0,
                "due_date": "2025-04-03",
                "has_interest": true
            },
            {
                "installment_number": 3,
                "workdays": 19,
                "calendar_days": 32,
                "principal_amortization_unit_price": 0.19748652,
                "principal_amortization_amount": 197486.52331007,
                "interest_amount": 33036.77668993,
                "amount": 230523.3,
                "due_principal": 627239.20508464,
                "due_interest": 0.0,
                "due_date": "2025-05-05",
                "has_interest": true
            },
            {
                "installment_number": 4,
                "workdays": 21,
                "calendar_days": 29,
                "principal_amortization_unit_price": 0.21005991,
                "principal_amortization_amount": 210059.90840452,
                "interest_amount": 20463.39159548,
                "amount": 230523.3,
                "due_principal": 429752.68177457,
                "due_interest": 0.0,
                "due_date": "2025-06-03",
                "has_interest": true
            },
            {
                "installment_number": 5,
                "workdays": 21,
                "calendar_days": 30,
                "principal_amortization_unit_price": 0.21969277,
                "principal_amortization_amount": 219692.77337005,
                "interest_amount": 10830.52662995,
                "amount": 230523.3,
                "due_principal": 219692.77337005,
                "due_interest": 0.0,
                "due_date": "2025-07-03",
                "has_interest": true
            }
        ]
    },
    "tags": [],
    "investor_list": [
        {
            "investor_key": "a1a75b66-6f7e-4bcc-9ff5-6f8adf7cae09",
            "investor_name": "Ultimate Cascade",
            "investor_document_number": "31.424.651/0001-32",
            "subscription_percentage": 100.0,
            "subscription_quantity": 1000000,
            "investor_onboarding_approved": true,
            "bank_account": {
                "account_type": "checking",
                "account_digit": "3",
                "account_branch": "0001",
                "account_number": "33400254",
                "financial_institution_ispb": "32402502",
                "financial_institution_code_number": "329"
            },
            "updated_at": null
        }
    ],
    "related_party_list": [
        {
            "related_party_key": "1ac83d43-41cb-4ad0-a7ca-add6c3a3171c",
            "name": "Blue Logic",
            "document_number": "97.923.586/0001-06",
            "role_type": "issuer",
            "is_active": true,
            "updated_at": null,
            "trading_name": "Blue Logic",
            "cnae_code": "47.21-1-02",
            "company_type": "ltda",
            "foundation_date": "2007-10-25",
            "person_type": "legal",
            "street": "Rua Romualdo de Souza Brito",
            "neighborhood": "Centro",
            "number": "89",
            "postal_code": "08150-470",
            "city": "São Paulo",
            "state": "SP",
            "complement": "Letra C",
            "signer_group_list": [
                {
                    "signer_group_key": "fa2cbede-a501-41e1-bf70-078bb0d4ac7b",
                    "minimum_required_signers": 1,
                    "signers": [
                        {
                            "name": "John Doe",
                            "email": "123.456.789-00@yopmail.com",
                            "phone_number": "+5511988887777",
                            "document_number": "123.456.789-00",
                            "is_group_mandatory": true
                        }
                    ]
                }
            ],
            "document_list": [],
            "contact_information_list": [
                {
                    "name": "John Doe",
                    "email": "123.456.789-00@yopmail.com",
                    "is_default": true,
                    "phone_number": "+5516982399722",
                    "document_number": "123.456.789-00",
                    "issuer_contact_information_key": "6e9714f4-d652-4ca0-89e2-13e9e2ec3414"
                }
            ]
        },
        {
            "related_party_key": "bab03c76-a12a-4d88-aaf8-70799e3b1b30",
            "name": "Ultimate Cascade",
            "document_number": "31.424.651/0001-32",
            "role_type": "investor",
            "is_active": true,
            "updated_at": null,
            "trading_name": "Ultimate Cascade",
            "cnae_code": "47.21-1-02",
            "company_type": "ltda",
            "foundation_date": "2007-10-25",
            "person_type": "legal",
            "street": "Rua Romualdo de Souza Brito",
            "neighborhood": "Centro",
            "number": "89",
            "postal_code": "08150-470",
            "city": "São Paulo",
            "state": "SP",
            "complement": "Letra C",
            "signer_group_list": [
                {
                    "signer_group_key": "ccb36b0b-40b5-42e0-bc41-0e8fce57f3ca",
                    "minimum_required_signers": 1,
                    "signers": [
                        {
                            "name": "John Doe",
                            "email": "123.456.789-00@yopmail.com",
                            "phone_number": "+5516982399722",
                            "document_number": "123.456.789-00",
                            "is_group_mandatory": true
                        }
                    ]
                }
            ],
            "document_list": [],
            "contact_information_list": [
                {
                    "name": "John Doe",
                    "email": "123.456.789-00@yopmail.com",
                    "is_default": true,
                    "phone_number": "+5511988887777",
                    "document_number": "123.456.789-00",
                    "investor_contact_information_key": "26299c0f-2127-45d4-b22e-f2b494d2f7ae"
                }
            ]
        }
    ],
    "collateral_list": [
        {
            "collateral_key": "d8fdb578-1e2a-4b79-8267-5b1763e56754",
            "collateral_type": "fiduciary_alienation_property"
        }
    ],
    "metadata_list": [
        {
            "metadata_key": "convenio",
            "metadata_value": "12398129038"
        }
    ],
    "signature_method": "qi_sign"
}
```

### **Response Body Params**

| Field                        | Type   | Description                                           |
| ---------------------------- | ------ | ----------------------------------------------------- |
| `tenant_key` *             | string | Unique tenant key.                               |
| `operation_key` *          | string | Unique operation key.                           |
| `operation_status` *       | string | Operation status.                                 |
| `issuer_key` *             | string | Unique issuer key.                              |
| `issuer_name` *            | string | Issuer name.                                      |
| `issuer_document_number` * | string | Issuer document number.                                 |
| `financial` *              | object | **[financial object](#financial-object-response)** |

### financial object response

| Field                        | Type    | Description                                                | Max Characters                                                       |
| ---------------------------- | ------- | ---------------------------------------------------------- | ---------------------------------------------------------------------- |
| `financial_base_date` *    | string  | Operation financial base date (format "YYYY-MM-DD"). | -                                                                      |
| `issue_amount` *           | number  | Total operation issued amount.                         | -                                                                      |
| `released_amount` *        | number  | Net amount released in the operation.                     | -                                                                      |
| `issue_quantity` *         | integer | Total quantity of units issued.                     | -                                                                      |
| `unit_price` *             | number  | Unit price of the issuance.                              | -                                                                      |
| `cet` *                    | number  | Total Effective Cost (CET) percentage.                   | -                                                                      |
| `annual_cet` *             | number  | Annual CET percentage.                                   | -                                                                      |
| `number_of_installments` * | integer | Total number of installments.                                 | -                                                                      |
| `prefixed_interest_rate` * | object  | Object containing prefixed interest rate details.       | **[prefixed_interest_rate object](#prefixed_interest_rate-object)** |
| `fees`                     | array   | List of fees associated with the operation.                   | **[fees object](#fees-object)**                                     |
| `installments`             | array   | List of installment details generated in the operation.      | **[installments object](#installments-object)**                     |
| `fine_delay_rate` *        | object  | Object containing late payment penalty details.              | **[fine_delay_rate object](#fine_delay_rate-object)**               |
| `contract_fine_rate` *     | number  | Contract penalty applied as percentage.                   | -                                                                      |

### prefixed_interest_rate object

| Field               | Type   | Description                     | Max Characters                                                 |
| ------------------- | ------ | ------------------------------- | ---------------------------------------------------------------- |
| `interest_base` * | string | Interest calculation basis. | **[interest_base enumerators](#interest_base-enumerators)** |
| `monthly_rate` *  | number | Applied monthly interest rate.  | -                                                                |
| `daily_rate` *    | number | Applied daily interest rate. | -                                                                |
| `annual_rate` *   | number | Applied annual interest rate.   | -                                                                |

### fees object

| Field             | Type   | Description                              | Max Characters                                                 |
| ----------------- | ------ | ---------------------------------------- | ---------------------------------------------------------------- |
| `amount` *      | number | Fee percentage amount.                | -                                                                |
| `fee_amount` *  | number | Monetary value corresponding to the fee. | -                                                                |
| `amount_type` * | string | Fee amount type.                   | **[amount_type enumerators](#amount_type-enumerators)**     |
| `fee_type` *    | string | Fee type.                            | **[fee_type enumerators](#fee_type-enumerators)**           |
| `type` *        | string | Fee recipient.                   | **[fee_recipient enumerators](#fee_recipient-enumerators)** |

### installments object

| Field                                   | Type    | Description                                           |
| --------------------------------------- | ------- | ----------------------------------------------------- |
| `installment_number` *                | integer | Installment number.                                   |
| `workdays` *                          | integer | Business days until installment due date.             |
| `calendar_days` *                     | integer | Calendar days until installment due date.           |
| `principal_amortization_amount` *     | number  | Principal amortized amount.                        |
| `principal_amortization_unit_price` * | number  | Amortized amount per unit.                         |
| `interest_amount` *                   | number  | Interest amount applied to the installment.                 |
| `amount` *                            | number  | Total installment amount.                               |
| `due_date` *                          | string  | Installment due date (format "YYYY-MM-DD"). |

---

# Financial Data Update in Operation

URL: /en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/atualizar-dados-financeiros

This endpoint allows updating the financial data in an operation, following the financial object pattern, which is also sent in the simulation endpoint.

---

## **Financial Data Update in Operation (PUT)**

### **Request**
ENDPOINT /commercial_paper/operation/ OPERATION-KEY /financial
METHOD PUT

### **Path Params**

| Field             | Type   | Description                                     | Max Characters |
|-------------------|--------|-------------------------------------------------|----------------|
| `OPERATION-KEY` * | string | Unique operation key (UUID v4).                | 36             |

Request Body

```json
{
    "interest_type": "pre_price_days",
    "financial_base_date": "2025-02-03",
    "released_amount": 1000000,
    "number_of_installments": 5,
    "prefixed_interest_rate": {
        "interest_base": "calendar_days_365", 
        "monthly_rate": 0.05
    },
    "fine_delay_rate": {
        "interest_base": "calendar_days_365", 
        "monthly_rate": 0.01
    },
    "contract_fine_rate": 0.02,
    "fees": [
        {
            "amount": 5, 
            "amount_type": "percentage", 
            "fee_type": "structuring_fee",
            "type": "external"
        }
    ]
}
```

### Request Body Params

| Field                        | Type     | Description                                                                                                                     | Max Characters |
|------------------------------|----------|---------------------------------------------------------------------------------------------------------------------------------|----------------|
| `interest_type` *            | string   | Type of interest applied. | **[interest_type Enumerators](#interest_type-enumerators)** |
| `financial_base_date` *      | string   | Operation base date (format "YYYY-MM-DD").                                                                                     | -              |
| `released_amount` *          | number   | Total amount released in the operation.                                                                                        | -              |
| `number_of_installments` *   | integer  | Total number of installments.                                                                                                  | -              |
| `prefixed_interest_rate` *   | object   | Object containing prefixed interest rate details.                                                                              | **[prefixed_interest_rate Object](#prefixed_interest_rate-object)** |
| `fine_delay_rate` *          | object   | Object containing delay penalty details.                                                                                      | **[fine_delay_rate Object](#fine_delay_rate-object)** |
| `contract_fine_rate` *       | number   | Contract penalty applied as percentage.                                                                                        | -              |
| `fees`                       | array    | List of fees associated with the operation.                                                                                    | **[fees Object](#fees-object)** |

### prefixed_interest_rate Object

| Field                        | Type     | Description                                                                                                                     | Max Characters |
|------------------------------|----------|---------------------------------------------------------------------------------------------------------------------------------|----------------|
| `interest_base` *            | string   | Calculation base for interest. | **[interest_base Enumerators](#interest_base-enumerators)** |
| `monthly_rate` *             | number   | Monthly interest rate applied.                                                                                                 | -              |

### fine_delay_rate Object

| Field                        | Type     | Description                                                                                                                     | Max Characters |
|------------------------------|----------|---------------------------------------------------------------------------------------------------------------------------------|----------------|
| `interest_base` *            | string   | Base for penalty calculation. | **[interest_base Enumerators](#interest_base-enumerators)** |
| `monthly_rate` *             | number   | Monthly penalty rate.                                                                                                          | -              |

### fees Object

| Field                        | Type     | Description                                                                                                                     | Max Characters |
|------------------------------|----------|---------------------------------------------------------------------------------------------------------------------------------|----------------|
| `amount` *                   | number   | Fee amount applied.                                                                                                            | -              |
| `amount_type` *              | string   | Type of fee amount. | **[amount_type Enumerators](#amount_type-enumerators)** |
| `fee_type` *                 | string   | Type of fee. | **[fee_type Enumerators](#fee_type-enumerators)** |
| `type` *                     | string   | Fee recipient. | **[fee_recipient Enumerators](#fee_recipient-enumerators)** |

### interest_type Enumerators

| Enum                | Description                                  |
|--------------------|----------------------------------------------|
| `pre_price`       | Prefixed interest in Price model.           |
| `pre_price_days`  | Prefixed interest in Price model by calendar days. |
| `pre_sac`         | Prefixed interest in SAC model.             |
| `post_sac`        | Post-fixed interest in SAC model.           |

### interest_base Enumerators

| Enum                | Description                                  |
|--------------------|----------------------------------------------|
| `calendar_days`    | Calendar days base.                          |
| `calendar_days_365`| 365 calendar days base.                      |
| `workdays`        | Business days base.                          |

### amount_type Enumerators

| Enum         | Description                   |
|-------------|-------------------------------|
| `percentage` | Percentage value.             |
| `absolute`   | Absolute currency value.      |

### fee_type Enumerators

| Enum                                | Description                                 |
|-------------------------------------|---------------------------------------------|
| `bookkeeping_fee`                   | Financed bookkeeping fee.                   |
| `structuring_fee`                   | Financed structuring fee.                   |

### fee_recipient Enumerators

| Enum       | Description                                               |
|-----------|-----------------------------------------------------------|
| `internal` | Fee paid to the bookkeeper.                              |
| `external` | Rebate paid to the originator.                           |

## **Response**

STATUS 200

Response Body

```json
{
    "tenant_key": "13a6a1d5-7a3c-4627-a0a6-9fd746662ca4",
    "operation_key": "dc368e4d-c288-4971-ad8d-5c9c31616e74",
    "operation_type": "commercial_paper",
    "operation_status": "issued",
    "backoffice_analysis_status": "approved",
    "issuer_key": "9e08fd62-ce43-4c95-99e0-4386e980d618",
    "issuer_name": "Blue Logic",
    "issuer_document_number": "97.923.586/0001-06",
    "issuer_bank_account": {
        "account_type": "checking",
        "account_digit": "3",
        "account_branch": "0001",
        "account_number": "4464541",
        "financial_institution_ispb": "32402502",
        "financial_institution_code_number": "329"
    },
    "issuer_onboarding_approved": true,
    "issue_number": 1,
    "issue_series": 1,
    "contract_number": "0000000001",
    "issue_date": "2025-02-03",
    "financial_base_date": "2025-02-03",
    "commercial_paper_template_key": "68956441-d46c-44ed-93b9-b1806dd6ada9",
    "commercial_paper_document_key": "dc368e4d-c288-4971-ad8d-5c9c31616e74/commercial_paper/2cb87abc-8bdf-4df3-be98-b7afb53b14c8",
    "adhesion_term_template_key": "58743ab9-99bd-439a-93af-16e4c5fccd6f",
    "adhesion_term_document_key": "dc368e4d-c288-4971-ad8d-5c9c31616e74/adhesion_term/fe74eaed-2f44-45b4-b972-83fa222cbf1c",
    "envelope_signature_status": "signed",
    "envelope_key": "4d7f28b4-185f-482d-929e-d1af937cb27b",
    "envelope_signature_url": "https://sandbox.certifiqi.com.br/sign?batch-group=c4747fe6-2cc0-41a9-8972-84b44f8fff8a",
    "envelope_signed_files_key": "dc368e4d-c288-4971-ad8d-5c9c31616e74/signed_files",
    "financial": {
        "financial_base_date": "2025-02-03",
        "issue_quantity": 1000000,
        "unit_price": 1.0,
        "issue_amount": 1000000.0,
        "released_amount": 1000000.0,
        "cet": 5.0,
        "annual_cet": 79.59,
        "number_of_installments": 5,
        "prefixed_interest_rate": {
            "daily_rate": 0.0016053474,
            "annual_rate": 0.795856326,
            "monthly_rate": 0.05,
            "interest_base": "calendar_days_365"
        },
        "fine_delay_rate": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days_365"
        },
        "contract_fine_rate": 0.02,
        "financial_index": null,
        "post_fixed_interest_rate": null,
        "fees": [
            {
                "type": "internal",
                "amount": 2.0,
                "fee_type": "bookkeeping_fee",
                "fee_amount": 20000.0,
                "amount_type": "percentage"
            },
            {
                "type": "external",
                "amount": 5.0,
                "fee_type": "structuring_fee",
                "fee_amount": 50000.0,
                "amount_type": "percentage"
            }
        ],
        "installment_list": [
            {
                "installment_number": 1,
                "workdays": 20,
                "calendar_days": 30,
                "principal_amortization_unit_price": 0.18122484,
                "principal_amortization_amount": 181224.84138231,
                "interest_amount": 49298.45861769,
                "amount": 230523.3,
                "due_principal": 1000000.0,
                "due_interest": 0.0,
                "due_date": "2025-03-05",
                "has_interest": true
            },
            {
                "installment_number": 2,
                "workdays": 21,
                "calendar_days": 29,
                "principal_amortization_unit_price": 0.19153595,
                "principal_amortization_amount": 191535.95353305,
                "interest_amount": 38987.34646695,
                "amount": 230523.3,
                "due_principal": 818775.15861769,
                "due_interest": 0.0,
                "due_date": "2025-04-03",
                "has_interest": true
            },
            {
                "installment_number": 3,
                "workdays": 19,
                "calendar_days": 32,
                "principal_amortization_unit_price": 0.19748652,
                "principal_amortization_amount": 197486.52331007,
                "interest_amount": 33036.77668993,
                "amount": 230523.3,
                "due_principal": 627239.20508464,
                "due_interest": 0.0,
                "due_date": "2025-05-05",
                "has_interest": true
            },
            {
                "installment_number": 4,
                "workdays": 21,
                "calendar_days": 29,
                "principal_amortization_unit_price": 0.21005991,
                "principal_amortization_amount": 210059.90840452,
                "interest_amount": 20463.39159548,
                "amount": 230523.3,
                "due_principal": 429752.68177457,
                "due_interest": 0.0,
                "due_date": "2025-06-03",
                "has_interest": true
            },
            {
                "installment_number": 5,
                "workdays": 21,
                "calendar_days": 30,
                "principal_amortization_unit_price": 0.21969277,
                "principal_amortization_amount": 219692.77337005,
                "interest_amount": 10830.52662995,
                "amount": 230523.3,
                "due_principal": 219692.77337005,
                "due_interest": 0.0,
                "due_date": "2025-07-03",
                "has_interest": true
            }
        ]
    },
    "tags": [],
    "investor_list": [
        {
            "investor_key": "a1a75b66-6f7e-4bcc-9ff5-6f8adf7cae09",
            "investor_name": "Ultimate Cascade",
            "investor_document_number": "31.424.651/0001-32",
            "subscription_percentage": 100.0,
            "subscription_quantity": 1000000,
            "investor_onboarding_approved": true,
            "bank_account": {
                "account_type": "checking",
                "account_digit": "3",
                "account_branch": "0001",
                "account_number": "33400254",
                "financial_institution_ispb": "32402502",
                "financial_institution_code_number": "329"
            },
            "updated_at": null
        }
    ],
    "related_party_list": [
        {
            "related_party_key": "1ac83d43-41cb-4ad0-a7ca-add6c3a3171c",
            "name": "Blue Logic",
            "document_number": "97.923.586/0001-06",
            "role_type": "issuer",
            "is_active": true,
            "updated_at": null,
            "trading_name": "Blue Logic",
            "cnae_code": "47.21-1-02",
            "company_type": "ltda",
            "foundation_date": "2007-10-25",
            "person_type": "legal",
            "street": "Rua Romualdo de Souza Brito",
            "neighborhood": "Centro",
            "number": "89",
            "postal_code": "08150-470",
            "city": "São Paulo",
            "state": "SP",
            "complement": "Letra C",
            "signer_group_list": [
                {
                    "signer_group_key": "fa2cbede-a501-41e1-bf70-078bb0d4ac7b",
                    "minimum_required_signers": 1,
                    "signers": [
                        {
                            "name": "John Doe",
                            "email": "123.456.789-00@yopmail.com",
                            "phone_number": "+5511988887777",
                            "document_number": "123.456.789-00",
                            "is_group_mandatory": true
                        }
                    ]
                }
            ],
            "document_list": [],
            "contact_information_list": [
                {
                    "name": "John Doe",
                    "email": "123.456.789-00@yopmail.com",
                    "is_default": true,
                    "phone_number": "+5516982399722",
                    "document_number": "123.456.789-00",
                    "issuer_contact_information_key": "6e9714f4-d652-4ca0-89e2-13e9e2ec3414"
                }
            ]
        },
        {
            "related_party_key": "bab03c76-a12a-4d88-aaf8-70799e3b1b30",
            "name": "Ultimate Cascade",
            "document_number": "31.424.651/0001-32",
            "role_type": "investor",
            "is_active": true,
            "updated_at": null,
            "trading_name": "Ultimate Cascade",
            "cnae_code": "47.21-1-02",
            "company_type": "ltda",
            "foundation_date": "2007-10-25",
            "person_type": "legal",
            "street": "Rua Romualdo de Souza Brito",
            "neighborhood": "Centro",
            "number": "89",
            "postal_code": "08150-470",
            "city": "São Paulo",
            "state": "SP",
            "complement": "Letra C",
            "signer_group_list": [
                {
                    "signer_group_key": "ccb36b0b-40b5-42e0-bc41-0e8fce57f3ca",
                    "minimum_required_signers": 1,
                    "signers": [
                        {
                            "name": "John Doe",
                            "email": "123.456.789-00@yopmail.com",
                            "phone_number": "+5516982399722",
                            "document_number": "123.456.789-00",
                            "is_group_mandatory": true
                        }
                    ]
                }
            ],
            "document_list": [],
            "contact_information_list": [
                {
                    "name": "John Doe",
                    "email": "123.456.789-00@yopmail.com",
                    "is_default": true,
                    "phone_number": "+5511988887777",
                    "document_number": "123.456.789-00",
                    "investor_contact_information_key": "26299c0f-2127-45d4-b22e-f2b494d2f7ae"
                }
            ]
        }
    ],
    "collateral_list": [
        {
            "collateral_key": "d8fdb578-1e2a-4b79-8267-5b1763e56754",
            "collateral_type": "fiduciary_alienation_property"
        }
    ],
    "metadata_list": [
        {
            "metadata_key": "convenio",
            "metadata_value": "12398129038"
        }
    ],
}
```

### **Response Body Params**

| Field                        | Type   | Description                                           |
| ---------------------------- | ------ | ----------------------------------------------------- |
| `tenant_key` *             | string | Unique tenant key.                                   |
| `operation_key` *          | string | Unique operation key.                                |
| `operation_status` *       | string | Operation status.                                    |
| `issuer_key` *             | string | Unique issuer key.                                   |
| `issuer_name` *            | string | Issuer name.                                         |
| `issuer_document_number` * | string | Issuer document.                                     |
| `financial` *              | object | **[financial Object](#financial-response-object)** |

### financial Response Object

| Field                        | Type    | Description                                                | Max Characters                                                         |
| ---------------------------- | ------- | ---------------------------------------------------------- | ---------------------------------------------------------------------- |
| `financial_base_date` *    | string  | Financial base date of the operation (format "YYYY-MM-DD"). | -                                                                      |
| `issue_amount` *           | number  | Total issued amount of the operation.                     | -                                                                      |
| `released_amount` *        | number  | Net amount released in the operation.                     | -                                                                      |
| `issue_quantity` *         | integer | Total quantity of units issued.                           | -                                                                      |
| `unit_price` *             | number  | Unit price of the issue.                                  | -                                                                      |
| `cet` *                    | number  | Total Effective Cost (CET) as percentage.                 | -                                                                      |
| `annual_cet` *             | number  | Annual CET as percentage.                                 | -                                                                      |
| `number_of_installments` * | integer | Total number of installments.                             | -                                                                      |
| `prefixed_interest_rate` * | object  | Object containing prefixed interest rate details.        | **[prefixed_interest_rate Object](#prefixed_interest_rate-object)** |
| `fees`                     | array   | List of fees associated with the operation.               | **[fees Object](#fees-object)**                                     |
| `installments`             | array   | List of installment details generated in the operation.   | **[installments Object](#installments-object)**                     |
| `fine_delay_rate` *        | object  | Object containing delay penalty details.                 | **[fine_delay_rate Object](#fine_delay_rate-object)**               |
| `contract_fine_rate` *     | number  | Contract penalty applied as percentage.                   | -                                                                      |

### prefixed_interest_rate Object

| Field               | Type   | Description                     | Max Characters                                                   |
| ------------------- | ------ | ------------------------------- | ---------------------------------------------------------------- |
| `interest_base` * | string | Calculation base for interest. | **[interest_base Enumerators](#interest_base-enumerators)** |
| `monthly_rate` *  | number | Monthly interest rate applied.  | -                                                                |
| `daily_rate` *    | number | Daily interest rate applied.    | -                                                                |
| `annual_rate` *   | number | Annual interest rate applied.   | -                                                                |

### fees Object

| Field             | Type   | Description                              | Max Characters                                                   |
| ----------------- | ------ | ---------------------------------------- | ---------------------------------------------------------------- |
| `amount` *      | number | Percentage value of the fee.             | -                                                                |
| `fee_amount` *  | number | Monetary value corresponding to the fee. | -                                                                |
| `amount_type` * | string | Type of fee amount.                      | **[amount_type Enumerators](#amount_type-enumerators)**       |
| `fee_type` *    | string | Type of fee.                             | **[fee_type Enumerators](#fee_type-enumerators)**             |
| `type` *        | string | Fee recipient.                           | **[fee_recipient Enumerators](#fee_recipient-enumerators)**   |

### installments Object

| Field                                   | Type    | Description                                           |
| --------------------------------------- | ------- | ----------------------------------------------------- |
| `installment_number` *                | integer | Installment number.                                   |
| `workdays` *                          | integer | Business days until installment due date.            |
| `calendar_days` *                     | integer | Calendar days until installment due date.            |
| `principal_amortization_amount` *     | number  | Principal amortization amount.                        |
| `principal_amortization_unit_price` * | number  | Amortization amount per unit.                         |
| `interest_amount` *                   | number  | Interest amount applied in the installment.          |
| `amount` *                            | number  | Total installment amount.                             |
| `due_date` *                          | string  | Installment due date (format "YYYY-MM-DD").          |

---

# Updating investor data in the Operation

URL: /en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/atualizar-investidores

This endpoint allows updating investor data in an operation.

---

## **Updating investor data in the Operation (PUT)**

### **Request**
ENDPOINT /commercial_paper/operation/ OPERATION-KEY /investors
METHOD PUT

### **Path Params**

| Field             | Type   | Description                                     | Max Characters |
|-------------------|--------|-----------------------------------------------|-----------------|
| `OPERATION-KEY` * | string | Unique operation key (UUID v4).             | 36              |

Request Body

```json
{
    "investors": [
        {
            "investor_key": "a1a75b66-6f7e-4bcc-9ff5-6f8adf7cae09",
            "investor_name": "Ultimate Cascade",
            "investor_document_number": "31.424.651/0001-32",
            "subscription_quantity": 1000000,
            "bank_account": {
                "account_type": "checking",
                "account_digit": "3",
                "account_branch": "0001",
                "account_number": "33400254",
                "financial_institution_ispb": "32402502",
                "financial_institution_code_number": "329"
            }
        }
    ]
}
```

### **Request Body Params**

### **investors object**

| Field                         | Type   | Description                    |
| ----------------------------- | ------ | ------------------------------ |
| `investor_key` *            | string | Unique investor key.    |
| `subscription_percentage` * | number | Subscription percentage.    |
| `bank_account` *            | object | Investor's bank account. |

### **bank_account object**

| Field                                   | Type   | Description                                |
| --------------------------------------- | ------ | ------------------------------------------ |
| `account_number` *                    | string | Bank account number.                |
| `account_digit` *                     | string | Bank account digit.                |
| `account_branch` *                    | string | Bank account branch.               |
| `financial_institution_code_number` * | string | Financial institution code.       |
| `financial_institution_ispb` *        | string | Financial institution ISPB code.  |
| `account_type` *                      | string | Account type (`checking`, `savings`). |

## **Response**

STATUS 200

Response Body

```json
{
    "tenant_key": "13a6a1d5-7a3c-4627-a0a6-9fd746662ca4",
    "operation_key": "dc368e4d-c288-4971-ad8d-5c9c31616e74",
    "operation_type": "commercial_paper",
    "operation_status": "issued",
    "backoffice_analysis_status": "approved",
    "issuer_key": "9e08fd62-ce43-4c95-99e0-4386e980d618",
    "issuer_name": "Blue Logic",
    "issuer_document_number": "97.923.586/0001-06",
    "issuer_bank_account": {
        "account_type": "checking",
        "account_digit": "3",
        "account_branch": "0001",
        "account_number": "4464541",
        "financial_institution_ispb": "32402502",
        "financial_institution_code_number": "329"
    },
    "issuer_onboarding_approved": true,
    "issue_number": 1,
    "issue_series": 1,
    "contract_number": "0000000001",
    "issue_date": "2025-02-03",
    "financial_base_date": "2025-02-03",
    "commercial_paper_template_key": "68956441-d46c-44ed-93b9-b1806dd6ada9",
    "commercial_paper_document_key": "dc368e4d-c288-4971-ad8d-5c9c31616e74/commercial_paper/2cb87abc-8bdf-4df3-be98-b7afb53b14c8",
    "adhesion_term_template_key": "58743ab9-99bd-439a-93af-16e4c5fccd6f",
    "adhesion_term_document_key": "dc368e4d-c288-4971-ad8d-5c9c31616e74/adhesion_term/fe74eaed-2f44-45b4-b972-83fa222cbf1c",
    "envelope_signature_status": "signed",
    "envelope_key": "4d7f28b4-185f-482d-929e-d1af937cb27b",
    "envelope_signature_url": "https://sandbox.certifiqi.com.br/sign?batch-group=c4747fe6-2cc0-41a9-8972-84b44f8fff8a",
    "envelope_signed_files_key": "dc368e4d-c288-4971-ad8d-5c9c31616e74/signed_files",
    "financial": {
        "financial_base_date": "2025-02-03",
        "issue_quantity": 1000000,
        "unit_price": 1.0,
        "issue_amount": 1000000.0,
        "released_amount": 1000000.0,
        "cet": 5.0,
        "annual_cet": 79.59,
        "number_of_installments": 5,
        "prefixed_interest_rate": {
            "daily_rate": 0.0016053474,
            "annual_rate": 0.795856326,
            "monthly_rate": 0.05,
            "interest_base": "calendar_days_365"
        },
        "fine_delay_rate": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days_365"
        },
        "contract_fine_rate": 0.02,
        "financial_index": null,
        "post_fixed_interest_rate": null,
        "fees": [
            {
                "type": "internal",
                "amount": 2.0,
                "fee_type": "bookkeeping_fee",
                "fee_amount": 20000.0,
                "amount_type": "percentage"
            },
            {
                "type": "external",
                "amount": 5.0,
                "fee_type": "structuring_fee",
                "fee_amount": 50000.0,
                "amount_type": "percentage"
            }
        ],
        "installment_list": [
            {
                "installment_number": 1,
                "workdays": 20,
                "calendar_days": 30,
                "principal_amortization_unit_price": 0.18122484,
                "principal_amortization_amount": 181224.84138231,
                "interest_amount": 49298.45861769,
                "amount": 230523.3,
                "due_principal": 1000000.0,
                "due_interest": 0.0,
                "due_date": "2025-03-05",
                "has_interest": true
            },
            {
                "installment_number": 2,
                "workdays": 21,
                "calendar_days": 29,
                "principal_amortization_unit_price": 0.19153595,
                "principal_amortization_amount": 191535.95353305,
                "interest_amount": 38987.34646695,
                "amount": 230523.3,
                "due_principal": 818775.15861769,
                "due_interest": 0.0,
                "due_date": "2025-04-03",
                "has_interest": true
            },
            {
                "installment_number": 3,
                "workdays": 19,
                "calendar_days": 32,
                "principal_amortization_unit_price": 0.19748652,
                "principal_amortization_amount": 197486.52331007,
                "interest_amount": 33036.77668993,
                "amount": 230523.3,
                "due_principal": 627239.20508464,
                "due_interest": 0.0,
                "due_date": "2025-05-05",
                "has_interest": true
            },
            {
                "installment_number": 4,
                "workdays": 21,
                "calendar_days": 29,
                "principal_amortization_unit_price": 0.21005991,
                "principal_amortization_amount": 210059.90840452,
                "interest_amount": 20463.39159548,
                "amount": 230523.3,
                "due_principal": 429752.68177457,
                "due_interest": 0.0,
                "due_date": "2025-06-03",
                "has_interest": true
            },
            {
                "installment_number": 5,
                "workdays": 21,
                "calendar_days": 30,
                "principal_amortization_unit_price": 0.21969277,
                "principal_amortization_amount": 219692.77337005,
                "interest_amount": 10830.52662995,
                "amount": 230523.3,
                "due_principal": 219692.77337005,
                "due_interest": 0.0,
                "due_date": "2025-07-03",
                "has_interest": true
            }
        ]
    },
    "tags": [],
    "investor_list": [
        {
            "investor_key": "a1a75b66-6f7e-4bcc-9ff5-6f8adf7cae09",
            "investor_name": "Ultimate Cascade",
            "investor_document_number": "31.424.651/0001-32",
            "subscription_percentage": 100.0,
            "subscription_quantity": 1000000,
            "investor_onboarding_approved": true,
            "bank_account": {
                "account_type": "checking",
                "account_digit": "3",
                "account_branch": "0001",
                "account_number": "33400254",
                "financial_institution_ispb": "32402502",
                "financial_institution_code_number": "329"
            },
            "updated_at": null
        }
    ],
    "related_party_list": [
        {
            "related_party_key": "1ac83d43-41cb-4ad0-a7ca-add6c3a3171c",
            "name": "Blue Logic",
            "document_number": "97.923.586/0001-06",
            "role_type": "issuer",
            "is_active": true,
            "updated_at": null,
            "trading_name": "Blue Logic",
            "cnae_code": "47.21-1-02",
            "company_type": "ltda",
            "foundation_date": "2007-10-25",
            "person_type": "legal",
            "street": "Rua Romualdo de Souza Brito",
            "neighborhood": "Centro",
            "number": "89",
            "postal_code": "08150-470",
            "city": "São Paulo",
            "state": "SP",
            "complement": "Letra C",
            "signer_group_list": [
                {
                    "signer_group_key": "fa2cbede-a501-41e1-bf70-078bb0d4ac7b",
                    "minimum_required_signers": 1,
                    "signers": [
                        {
                            "name": "John Doe",
                            "email": "123.456.789-00@yopmail.com",
                            "phone_number": "+5511988887777",
                            "document_number": "123.456.789-00",
                            "is_group_mandatory": true
                        }
                    ]
                }
            ],
            "document_list": [],
            "contact_information_list": [
                {
                    "name": "John Doe",
                    "email": "123.456.789-00@yopmail.com",
                    "is_default": true,
                    "phone_number": "+5516982399722",
                    "document_number": "123.456.789-00",
                    "issuer_contact_information_key": "6e9714f4-d652-4ca0-89e2-13e9e2ec3414"
                }
            ]
        },
        {
            "related_party_key": "bab03c76-a12a-4d88-aaf8-70799e3b1b30",
            "name": "Ultimate Cascade",
            "document_number": "31.424.651/0001-32",
            "role_type": "investor",
            "is_active": true,
            "updated_at": null,
            "trading_name": "Ultimate Cascade",
            "cnae_code": "47.21-1-02",
            "company_type": "ltda",
            "foundation_date": "2007-10-25",
            "person_type": "legal",
            "street": "Rua Romualdo de Souza Brito",
            "neighborhood": "Centro",
            "number": "89",
            "postal_code": "08150-470",
            "city": "São Paulo",
            "state": "SP",
            "complement": "Letra C",
            "signer_group_list": [
                {
                    "signer_group_key": "ccb36b0b-40b5-42e0-bc41-0e8fce57f3ca",
                    "minimum_required_signers": 1,
                    "signers": [
                        {
                            "name": "John Doe",
                            "email": "123.456.789-00@yopmail.com",
                            "phone_number": "+5516982399722",
                            "document_number": "123.456.789-00",
                            "is_group_mandatory": true
                        }
                    ]
                }
            ],
            "document_list": [],
            "contact_information_list": [
                {
                    "name": "John Doe",
                    "email": "123.456.789-00@yopmail.com",
                    "is_default": true,
                    "phone_number": "+5511988887777",
                    "document_number": "123.456.789-00",
                    "investor_contact_information_key": "26299c0f-2127-45d4-b22e-f2b494d2f7ae"
                }
            ]
        }
    ],
    "collateral_list": [
        {
            "collateral_key": "d8fdb578-1e2a-4b79-8267-5b1763e56754",
            "collateral_type": "fiduciary_alienation_property"
        }
    ],
    "metadata_list": [
        {
            "metadata_key": "convenio",
            "metadata_value": "12398129038"
        }
    ],
}
```

### **Response Body Params**

| Field                        | Type   | Description                                           |
| ---------------------------- | ------ | ----------------------------------------------------- |
| `tenant_key` *             | string | Unique tenant key.                               |
| `operation_key` *          | string | Unique operation key.                           |
| `operation_status` *       | string | Operation status.                                 |
| `issuer_key` *             | string | Unique issuer key.                              |
| `issuer_name` *            | string | Issuer name.                                      |
| `issuer_document_number` * | string | Issuer document.                                 |
| `financial` *              | object | **[financial object](#financial-object-response)** |

### financial object response

| Field                        | Type    | Description                                                | Max Characters                                                       |
| ---------------------------- | ------- | ---------------------------------------------------------- | ---------------------------------------------------------------------- |
| `financial_base_date` *    | string  | Operation financial base date (format "YYYY-MM-DD"). | -                                                                      |
| `issue_amount` *           | number  | Total issued amount of the operation.                         | -                                                                      |
| `released_amount` *        | number  | Net amount released in the operation.                     | -                                                                      |
| `issue_quantity` *         | integer | Total quantity of units issued.                     | -                                                                      |
| `unit_price` *             | number  | Unit price of the issuance.                              | -                                                                      |
| `cet` *                    | number  | Total Effective Cost (CET) in percentage.                   | -                                                                      |
| `annual_cet` *             | number  | Annual CET in percentage.                                   | -                                                                      |
| `number_of_installments` * | integer | Total number of installments.                                 | -                                                                      |
| `prefixed_interest_rate` * | object  | Object containing prefixed interest rate details.       | **[prefixed_interest_rate object](#prefixed_interest_rate-object)** |
| `fees`                     | array   | List of fees associated with the operation.                   | **[fees object](#fees-object)**                                     |
| `installments`             | array   | List of installment details generated in the operation.      | **[installments object](#installments-object)**                     |
| `fine_delay_rate` *        | object  | Object containing delay fine details.              | **[fine_delay_rate object](#fine_delay_rate-object)**               |
| `contract_fine_rate` *     | number  | Contract fine applied in percentage.                   | -                                                                      |

### prefixed_interest_rate object

| Field               | Type   | Description                     | Max Characters                                                 |
| ------------------- | ------ | ------------------------------- | ---------------------------------------------------------------- |
| `interest_base` * | string | Calculation base for interest. | **[interest_base enumerators](#interest_base-enumerators)** |
| `monthly_rate` *  | number | Monthly interest rate applied.  | -                                                                |
| `daily_rate` *    | number | Daily interest rate applied. | -                                                                |
| `annual_rate` *   | number | Annual interest rate applied.   | -                                                                |

### fees object

| Field             | Type   | Description                              | Max Characters                                                 |
| ----------------- | ------ | ---------------------------------------- | ---------------------------------------------------------------- |
| `amount` *      | number | Percentage value of the fee.                | -                                                                |
| `fee_amount` *  | number | Monetary value corresponding to the fee. | -                                                                |
| `amount_type` * | string | Type of fee value.                   | **[amount_type enumerators](#amount_type-enumerators)**     |
| `fee_type` *    | string | Fee type.                            | **[fee_type enumerators](#fee_type-enumerators)**           |
| `type` *        | string | Fee recipient.                   | **[fee_recipient enumerators](#fee_recipient-enumerators)** |

### installments object

| Field                                   | Type    | Description                                           |
| --------------------------------------- | ------- | ----------------------------------------------------- |
| `installment_number` *                | integer | Installment number.                                   |
| `workdays` *                          | integer | Working days until installment due date.             |
| `calendar_days` *                     | integer | Calendar days until installment due date.           |
| `principal_amortization_amount` *     | number  | Principal amortized amount.                        |
| `principal_amortization_unit_price` * | number  | Amortized amount per unit.                         |
| `interest_amount` *                   | number  | Interest amount applied to the installment.                 |
| `amount` *                            | number  | Total installment amount.                               |
| `due_date` *                          | string  | Installment due date (format "YYYY-MM-DD"). |

---

# Signature Method Update in Operation

URL: /en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/atualizar-metodo-assinatura

This endpoint allows updating the signature method in an operation.

---

## **Signature Method Update in Operation (PUT)**

### **Request**
ENDPOINT /commercial_paper/operation/ OPERATION-KEY /signature_method
METHOD PUT

### **Path Params**

| Field             | Type   | Description                                     | Max Characters |
|-------------------|--------|-----------------------------------------------|-----------------|
| `OPERATION-KEY` * | string | Unique operation key (UUID v4).             | 36              |

Request Body

```json
{
    "signature_method": "qi_sign"
}
```

### Request Body Params

| Field                        | Type     | Description                                                                                                                       | Max Characters |
|------------------------------|----------|---------------------------------------------------------------------------------------------------------------------------------|-----------------|
| `signature_method` *            | string   | Signature system type. | certifiqi ou qi_sign |

## **Response**

STATUS 200

Response Body

```json
{
    "tenant_key": "13a6a1d5-7a3c-4627-a0a6-9fd746662ca4",
    "operation_key": "dc368e4d-c288-4971-ad8d-5c9c31616e74",
    "operation_type": "commercial_paper",
    "operation_status": "issued",
    "backoffice_analysis_status": "approved",
    "issuer_key": "9e08fd62-ce43-4c95-99e0-4386e980d618",
    "issuer_name": "Blue Logic",
    "issuer_document_number": "97.923.586/0001-06",
    "issuer_bank_account": {
        "account_type": "checking",
        "account_digit": "3",
        "account_branch": "0001",
        "account_number": "4464541",
        "financial_institution_ispb": "32402502",
        "financial_institution_code_number": "329"
    },
    "issuer_onboarding_approved": true,
    "issue_number": 1,
    "issue_series": 1,
    "contract_number": "0000000001",
    "issue_date": "2025-02-03",
    "financial_base_date": "2025-02-03",
    "commercial_paper_template_key": "68956441-d46c-44ed-93b9-b1806dd6ada9",
    "commercial_paper_document_key": "dc368e4d-c288-4971-ad8d-5c9c31616e74/commercial_paper/2cb87abc-8bdf-4df3-be98-b7afb53b14c8",
    "adhesion_term_template_key": "58743ab9-99bd-439a-93af-16e4c5fccd6f",
    "adhesion_term_document_key": "dc368e4d-c288-4971-ad8d-5c9c31616e74/adhesion_term/fe74eaed-2f44-45b4-b972-83fa222cbf1c",
    "envelope_signature_status": "signed",
    "envelope_key": "4d7f28b4-185f-482d-929e-d1af937cb27b",
    "envelope_signature_url": "https://sandbox.certifiqi.com.br/sign?batch-group=c4747fe6-2cc0-41a9-8972-84b44f8fff8a",
    "envelope_signed_files_key": "dc368e4d-c288-4971-ad8d-5c9c31616e74/signed_files",
    "financial": {
        "financial_base_date": "2025-02-03",
        "issue_quantity": 1000000,
        "unit_price": 1.0,
        "issue_amount": 1000000.0,
        "released_amount": 1000000.0,
        "cet": 5.0,
        "annual_cet": 79.59,
        "number_of_installments": 5,
        "prefixed_interest_rate": {
            "daily_rate": 0.0016053474,
            "annual_rate": 0.795856326,
            "monthly_rate": 0.05,
            "interest_base": "calendar_days_365"
        },
        "fine_delay_rate": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days_365"
        },
        "contract_fine_rate": 0.02,
        "financial_index": null,
        "post_fixed_interest_rate": null,
        "fees": [
            {
                "type": "internal",
                "amount": 2.0,
                "fee_type": "bookkeeping_fee",
                "fee_amount": 20000.0,
                "amount_type": "percentage"
            },
            {
                "type": "external",
                "amount": 5.0,
                "fee_type": "structuring_fee",
                "fee_amount": 50000.0,
                "amount_type": "percentage"
            }
        ],
        "installment_list": [
            {
                "installment_number": 1,
                "workdays": 20,
                "calendar_days": 30,
                "principal_amortization_unit_price": 0.18122484,
                "principal_amortization_amount": 181224.84138231,
                "interest_amount": 49298.45861769,
                "amount": 230523.3,
                "due_principal": 1000000.0,
                "due_interest": 0.0,
                "due_date": "2025-03-05",
                "has_interest": true
            },
            {
                "installment_number": 2,
                "workdays": 21,
                "calendar_days": 29,
                "principal_amortization_unit_price": 0.19153595,
                "principal_amortization_amount": 191535.95353305,
                "interest_amount": 38987.34646695,
                "amount": 230523.3,
                "due_principal": 818775.15861769,
                "due_interest": 0.0,
                "due_date": "2025-04-03",
                "has_interest": true
            },
            {
                "installment_number": 3,
                "workdays": 19,
                "calendar_days": 32,
                "principal_amortization_unit_price": 0.19748652,
                "principal_amortization_amount": 197486.52331007,
                "interest_amount": 33036.77668993,
                "amount": 230523.3,
                "due_principal": 627239.20508464,
                "due_interest": 0.0,
                "due_date": "2025-05-05",
                "has_interest": true
            },
            {
                "installment_number": 4,
                "workdays": 21,
                "calendar_days": 29,
                "principal_amortization_unit_price": 0.21005991,
                "principal_amortization_amount": 210059.90840452,
                "interest_amount": 20463.39159548,
                "amount": 230523.3,
                "due_principal": 429752.68177457,
                "due_interest": 0.0,
                "due_date": "2025-06-03",
                "has_interest": true
            },
            {
                "installment_number": 5,
                "workdays": 21,
                "calendar_days": 30,
                "principal_amortization_unit_price": 0.21969277,
                "principal_amortization_amount": 219692.77337005,
                "interest_amount": 10830.52662995,
                "amount": 230523.3,
                "due_principal": 219692.77337005,
                "due_interest": 0.0,
                "due_date": "2025-07-03",
                "has_interest": true
            }
        ]
    },
    "tags": [],
    "investor_list": [
        {
            "investor_key": "a1a75b66-6f7e-4bcc-9ff5-6f8adf7cae09",
            "investor_name": "Ultimate Cascade",
            "investor_document_number": "31.424.651/0001-32",
            "subscription_percentage": 100.0,
            "subscription_quantity": 1000000,
            "investor_onboarding_approved": true,
            "bank_account": {
                "account_type": "checking",
                "account_digit": "3",
                "account_branch": "0001",
                "account_number": "33400254",
                "financial_institution_ispb": "32402502",
                "financial_institution_code_number": "329"
            },
            "updated_at": null
        }
    ],
    "related_party_list": [
        {
            "related_party_key": "1ac83d43-41cb-4ad0-a7ca-add6c3a3171c",
            "name": "Blue Logic",
            "document_number": "97.923.586/0001-06",
            "role_type": "issuer",
            "is_active": true,
            "updated_at": null,
            "trading_name": "Blue Logic",
            "cnae_code": "47.21-1-02",
            "company_type": "ltda",
            "foundation_date": "2007-10-25",
            "person_type": "legal",
            "street": "Rua Romualdo de Souza Brito",
            "neighborhood": "Centro",
            "number": "89",
            "postal_code": "08150-470",
            "city": "São Paulo",
            "state": "SP",
            "complement": "Letra C",
            "signer_group_list": [
                {
                    "signer_group_key": "fa2cbede-a501-41e1-bf70-078bb0d4ac7b",
                    "minimum_required_signers": 1,
                    "signers": [
                        {
                            "name": "John Doe",
                            "email": "123.456.789-00@yopmail.com",
                            "phone_number": "+5511988887777",
                            "document_number": "123.456.789-00",
                            "is_group_mandatory": true
                        }
                    ]
                }
            ],
            "document_list": [],
            "contact_information_list": [
                {
                    "name": "John Doe",
                    "email": "123.456.789-00@yopmail.com",
                    "is_default": true,
                    "phone_number": "+5516982399722",
                    "document_number": "123.456.789-00",
                    "issuer_contact_information_key": "6e9714f4-d652-4ca0-89e2-13e9e2ec3414"
                }
            ]
        },
        {
            "related_party_key": "bab03c76-a12a-4d88-aaf8-70799e3b1b30",
            "name": "Ultimate Cascade",
            "document_number": "31.424.651/0001-32",
            "role_type": "investor",
            "is_active": true,
            "updated_at": null,
            "trading_name": "Ultimate Cascade",
            "cnae_code": "47.21-1-02",
            "company_type": "ltda",
            "foundation_date": "2007-10-25",
            "person_type": "legal",
            "street": "Rua Romualdo de Souza Brito",
            "neighborhood": "Centro",
            "number": "89",
            "postal_code": "08150-470",
            "city": "São Paulo",
            "state": "SP",
            "complement": "Letra C",
            "signer_group_list": [
                {
                    "signer_group_key": "ccb36b0b-40b5-42e0-bc41-0e8fce57f3ca",
                    "minimum_required_signers": 1,
                    "signers": [
                        {
                            "name": "John Doe",
                            "email": "123.456.789-00@yopmail.com",
                            "phone_number": "+5516982399722",
                            "document_number": "123.456.789-00",
                            "is_group_mandatory": true
                        }
                    ]
                }
            ],
            "document_list": [],
            "contact_information_list": [
                {
                    "name": "John Doe",
                    "email": "123.456.789-00@yopmail.com",
                    "is_default": true,
                    "phone_number": "+5511988887777",
                    "document_number": "123.456.789-00",
                    "investor_contact_information_key": "26299c0f-2127-45d4-b22e-f2b494d2f7ae"
                }
            ]
        }
    ],
    "collateral_list": [
        {
            "collateral_key": "d8fdb578-1e2a-4b79-8267-5b1763e56754",
            "collateral_type": "fiduciary_alienation_property"
        }
    ],
    "metadata_list": [
        {
            "metadata_key": "convenio",
            "metadata_value": "12398129038"
        }
    ],
    "signature_method": "qi_sign"
}
```

### **Response Body Params**

| Field                        | Type   | Description                                           |
| ---------------------------- | ------ | ----------------------------------------------------- |
| `tenant_key` *             | string | Unique tenant key.                               |
| `operation_key` *          | string | Unique operation key.                           |
| `operation_status` *       | string | Operation status.                                 |
| `issuer_key` *             | string | Unique issuer key.                              |
| `issuer_name` *            | string | Issuer name.                                      |
| `issuer_document_number` * | string | Issuer document.                                 |
| `financial` *              | object | **[financial object](#financial-object-response)** |

### Financial object response

| Field                        | Type    | Description                                                | Max Characters                                                       |
| ---------------------------- | ------- | ---------------------------------------------------------- | ---------------------------------------------------------------------- |
| `financial_base_date` *    | string  | Financial base date of the operation (format "YYYY-MM-DD"). | -                                                                      |
| `issue_amount` *           | number  | Total issued amount of the operation.                         | -                                                                      |
| `released_amount` *        | number  | Net amount released in the operation.                     | -                                                                      |
| `issue_quantity` *         | integer | Total quantity of units issued.                     | -                                                                      |
| `unit_price` *             | number  | Unit price of the issue.                              | -                                                                      |
| `cet` *                    | number  | Total Effective Cost (CET) in percentage.                   | -                                                                      |
| `annual_cet` *             | number  | Annual CET in percentage.                                   | -                                                                      |
| `number_of_installments` * | integer | Total number of installments.                                 | -                                                                      |
| `prefixed_interest_rate` * | object  | Object containing prefixed interest rate details.       | **[prefixed_interest_rate object](#prefixed_interest_rate-object)** |
| `fees`                     | array   | List of fees associated with the operation.                   | **[fees object](#fees-object)**                                     |
| `installments`             | array   | List of installment details generated in the operation.      | **[installments object](#installments-object)**                     |
| `fine_delay_rate` *        | object  | Object containing late fee details.              | **[fine_delay_rate object](#fine_delay_rate-object)**               |
| `contract_fine_rate` *     | number  | Contract fine applied in percentage.                   | -                                                                      |

### Prefixed_interest_rate object

| Field               | Type   | Description                     | Max Characters                                                 |
| ------------------- | ------ | ------------------------------- | ---------------------------------------------------------------- |
| `interest_base` * | string | Base for interest calculation. | **[interest_base enumerators](#interest_base-enumerators)** |
| `monthly_rate` *  | number | Monthly interest rate applied.  | -                                                                |
| `daily_rate` *    | number | Daily interest rate applied. | -                                                                |
| `annual_rate` *   | number | Annual interest rate applied.   | -                                                                |

### Fees object

| Field             | Type   | Description                              | Max Characters                                                 |
| ----------------- | ------ | ---------------------------------------- | ---------------------------------------------------------------- |
| `amount` *      | number | Fee percentage amount.                | -                                                                |
| `fee_amount` *  | number | Monetary value corresponding to the fee. | -                                                                |
| `amount_type` * | string | Fee amount type.                   | **[amount_type enumerators](#amount_type-enumerators)**     |
| `fee_type` *    | string | Fee type.                            | **[fee_type enumerators](#fee_type-enumerators)**           |
| `type` *        | string | Fee recipient.                   | **[fee_recipient enumerators](#fee_recipient-enumerators)** |

### Installments object

| Field                                   | Type    | Description                                           |
| --------------------------------------- | ------- | ----------------------------------------------------- |
| `installment_number` *                | integer | Installment number.                                   |
| `workdays` *                          | integer | Workdays until installment due date.             |
| `calendar_days` *                     | integer | Calendar days until installment due date.           |
| `principal_amortization_amount` *     | number  | Principal amortization amount.                        |
| `principal_amortization_unit_price` * | number  | Amortization value per unit.                         |
| `interest_amount` *                   | number  | Interest amount applied to the installment.                 |
| `amount` *                            | number  | Total installment amount.                               |
| `due_date` *                          | string  | Installment due date (format "YYYY-MM-DD"). |

---

# Sending Collateral in an Operation

URL: /en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-garantias/cadastro-garantia

This set of endpoints allows the **addition of collaterals** associated with an operation. The **collateral will be submitted for signature along with the operation documents**. Each type of collateral contains its own rules for required documents and all collateral types are covered here in this documentation.

---

## **Send Collateral (POST)**

## **Request**
ENDPOINT /commercial_paper/operation/ OPERATION-KEY /collateral
METHOD POST

### **Path Params**

| Field            | Type   | Description                                     | Max Characters |
|------------------|--------|-----------------------------------------------|-----------------|
| `OPERATION-KEY` *  | string | Unique operation key (UUID v4).             | 36              |

---

The collateral system enables the addition of different types of instruments, each with its own configuration of additional documents. In this section, we cover all available collateral models and their respective payloads.

### **Collateral Types**

**[1 - Fiduciary alienation of property](#fiduciary-alienation-of-property)** 

**[2 - Fiduciary alienation of vehicle](#fiduciary-alienation-of-vehicle)** 

**[3 - Fiduciary alienation of aircraft](#fiduciary-alienation-of-aircraft)** 

**[4 - Fiduciary alienation of equipment/products/stock](#fiduciary-alienation-of-equipment-products-and-stock)** 

**[5 - Fiduciary alienation of artwork](#fiduciary-alienation-of-artwork)** 

**[6 - Fiduciary alienation of securities](#fiduciary-alienation-of-securities)**

**[7 - Fiduciary alienation of shares and quotas](#fiduciary-alienation-of-shares-and-quotas)** 

**[8 - Fiduciary alienation of credit rights](#fiduciary-alienation-of-credit-rights)** 

**[9 - Property mortgage](#property-mortgage)** 

**[10 - Ship mortgage](#ship-mortgage)** 

**[11 - Guarantee](#guarantee)** 

**[12 - Guarantor](#guarantor)** 

**[13 - Bank surety](#bank-surety)** 

**[14 - Card receivables](#card-receivables)** 

**[15 - Stock guarantee](#stock-guarantee)** 

**[16 - Collateral monitoring](#collateral-monitoring)** 

**[17 - Other collaterals](#other-collaterals)** 

## **Fiduciary alienation of property**

Request Body

```json
{
    "collateral_document_key": "25dd10b8-7364-4abe-b0e8-0e419b04194b",
    "collateral_type": "fiduciary_alienation_property",
    "additional_documents": [
        {
            "document_type": "property_appraisal_report",
            "document_key": "a14e8b2c-bda7-4f3d-aebb-ae63822428ff"
        },
        {
            "document_type": "property_registration_updated",
            "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04"
        },
        {
            "document_type": "property_full_content_certificate",
            "document_key": "210c38b5-6b61-4b74-b042-19ebef77e360"
        },
        {
            "document_type": "property_insurance_policy",
            "document_key": "4cc6d706-551f-4d5e-8539-1b59b2f96cff"
        }
    ]
}
```

### **Document Types**

| Enum             | Description                           |
|-----------------|-----------------------------------|
| `property_appraisal_report`**      | Property Appraisal Report.             |
| `property_registration_updated`**      | Updated registration.             |
| `property_full_content_certificate`**      |  Full Content Certificate of Registration.            |
| `property_insurance_policy`      | Insurance Policy (if required in contract).             |
| `others`      | Other documents.             |

:::warning
(**) Required for fiduciary alienation of property
:::

## **Fiduciary alienation of vehicle**

Request Body

```json
{
    "collateral_document_key": "a14e8b2c-bda7-4f3d-aebb-ae63822428ff",
    "collateral_type": "fiduciary_alienation_vehicle",
    "additional_documents": [
        {
            "document_type": "vehicle_appraisal_report",
            "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04"
        },
        {
            "document_type": "vehicle_inspection_report",
            "document_key": "210c38b5-6b61-4b74-b042-19ebef77e360"
        },
        {
            "document_type": "vehicle_crv_certificate",
            "document_key": "4cc6d706-551f-4d5e-8539-1b59b2f96cff"
        }
    ]
}
```

### **Document Types**

| Enum             | Description                           |
|-----------------|-----------------------------------|
| `vehicle_appraisal_report`**      | Vehicle Appraisal Report (maximum 30-day lag) or FIPE Table.             |
| `vehicle_inspection_report`**      | Inspection report.             |
| `vehicle_crv_certificate`**      |  Updated Vehicle Registration Certificate (CRLV).            |
| `others`      | Other documents.             |

:::warning
(**) Required for fiduciary alienation of vehicle
:::

## **Fiduciary alienation of aircraft**

Request Body

```json
{
    "collateral_document_key": "a14e8b2c-bda7-4f3d-aebb-ae63822428ff",
    "collateral_type": "fiduciary_alienation_aircraft",
    "additional_documents": [
        {
            "document_type": "aircraft_certificate_anac",
            "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04"
        },
        {
            "document_type": "aircraft_rab_consult",
            "document_key": "210c38b5-6b61-4b74-b042-19ebef77e360"
        },
        {
            "document_type": "aircraft_insurance_policy",
            "document_key": "4cc6d706-551f-4d5e-8539-1b59b2f96cff"
        },
        {
            "document_type": "aircraft_appraisal_report",
            "document_key": "df608f78-5293-4f96-ab60-31185633b52c"
        }
    ]
}
```

### **Document Types**

| Enum             | Description                           |
|-----------------|-----------------------------------|
| `aircraft_certificate_anac`**      | Registration Certificate - ANAC.             |
| `aircraft_rab_consult`**      | Aircraft Consultation in Brazilian Aeronautical Registry.             |
| `aircraft_insurance_policy`**      |  Insurance Policy - Fund as Beneficiary.            |
| `aircraft_appraisal_report`**      |  Aircraft Appraisal Report.            |
| `others`      | Other documents.             |

:::warning
(**) Required for fiduciary alienation of aircraft
:::

## **Fiduciary alienation of equipment products and stock**

Request Body

```json
{
    "collateral_document_key": "a14e8b2c-bda7-4f3d-aebb-ae63822428ff",
    "collateral_type": "fiduciary_alienation_equipment",
    "additional_documents": [
        {
            "document_type": "equipment_purchase_invoice",
            "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04"
        },
        {
            "document_type": "fiduciary_depositary_declaration",
            "document_key": "210c38b5-6b61-4b74-b042-19ebef77e360"
        },
        {
            "document_type": "equipment_appraisal_report",
            "document_key": "4cc6d706-551f-4d5e-8539-1b59b2f96cff"
        },
        {
            "document_type": "equipment_insurance_policy",
            "document_key": "df608f78-5293-4f96-ab60-31185633b52c"
        }
    ]
}
```

### **Document Types**

| Enum             | Description                           |
|-----------------|-----------------------------------|
| `equipment_purchase_invoice`**      | Invoice - Purchase Record.             |
| `equipment_appraisal_report`**      | Equipment Appraisal Report (maximum 30-day lag).             |
| `equipment_insurance_policy`      |  Equipment Insurance Policy (if required in contract).            |
| `fiduciary_depositary_declaration`      |  Faithful Depositary Declaration.            |
| `others`      | Other documents.             |

:::warning
(**) Required for fiduciary alienation of equipment/product/stock
:::

## **Fiduciary alienation of artwork**

Request Body

```json
{
    "collateral_document_key": "a14e8b2c-bda7-4f3d-aebb-ae63822428ff",
    "collateral_type": "fiduciary_alienation_artwork",
    "additional_documents": [
        {
            "document_type": "artwork_appraisal_report",
            "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04"
        },
        {
            "document_type": "artwork_storage_certificate",
            "document_key": "210c38b5-6b61-4b74-b042-19ebef77e360"
        }
    ]
}
```

### **Document Types**

| Enum             | Description                           |
|-----------------|-----------------------------------|
| `artwork_appraisal_report`**      | Artwork Appraisal Report.             |
| `artwork_storage_certificate`**      | Storage Location with Adequacy Certificate.             |
| `artwork_insurance_policy`      |  Insurance Policy (if required in contract).            |
| `others`      | Other documents.             |

:::warning
(**) Required for fiduciary alienation of artwork
:::

## **Fiduciary alienation of securities**

Request Body

```json
{
    "collateral_document_key": "a14e8b2c-bda7-4f3d-aebb-ae63822428ff",
    "collateral_type": "fiduciary_alienation_securities",
    "additional_documents": [
        {
            "document_type": "securities_negotiation_block",
            "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04"
        }
    ]
}
```

### **Document Types**

| Enum             | Description                           |
|-----------------|-----------------------------------|
| `securities_negotiation_block`**      | Trading Block with Custodian.             |
| `securities_registration_gravame`      | Storage Location with Adequacy Certificate.             |
| `others`      | Other documents.             |

:::warning
(**) Required for fiduciary alienation of securities.
:::

## **Fiduciary alienation of shares and quotas**

Request Body

```json
{
    "collateral_document_key": "a14e8b2c-bda7-4f3d-aebb-ae63822428ff",
    "collateral_type": "fiduciary_assignment_shares",
    "additional_documents": [
        {
            "document_type": "share_registration_book",
            "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04"
        }
    ]
}
```

### **Document Types**

| Enum             | Description                           |
|-----------------|-----------------------------------|
| `share_registration_book`**      | Nominative Shares Registration Book with Lien Annotation.             |
| `others`      | Other documents.             |

:::warning
(**) Required for fiduciary alienation/pledge of shares/quotas
:::

## **Fiduciary alienation of credit rights**

Request Body

```json
{
    "collateral_document_key": "a14e8b2c-bda7-4f3d-aebb-ae63822428ff",
    "collateral_type": "fiduciary_assignment_shares",
}
```

### **Document Types**

| Enum             | Description                           |
|-----------------|-----------------------------------|
| `others`      | Other documents.             |

## **Property mortgage**

Request Body

```json
{
    "collateral_document_key": "a14e8b2c-bda7-4f3d-aebb-ae63822428ff",
    "collateral_type": "mortgage_property",
    "additional_documents": [
        {
            "document_type": "property_appraisal_report",
            "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04"
        },
        {
            "document_type": "property_registration",
            "document_key": "210c38b5-6b61-4b74-b042-19ebef77e360"
        },
        {
            "document_type": "property_insurance_policy",
            "document_key": "4cc6d706-551f-4d5e-8539-1b59b2f96cff"
        },
        {
            "document_type": "property_full_content_certificate",
            "document_key": "df608f78-5293-4f96-ab60-31185633b52c"
        }
    ]
}
```

### **Document Types**

| Enum             | Description                           |
|-----------------|-----------------------------------|
| `property_appraisal_report`**      | Property Appraisal Report.             |
| `property_registration`**      | Updated Property Registration.             |
| `property_full_content_certificate`**      | Full Content Certificate of Registration.             |
| `property_insurance_policy`      | Insurance Policy (if required in contract).             |
| `others`      | Other documents.             |

:::warning
(**) Required for property mortgage.
:::

## **Ship mortgage**

Request Body

```json
{
    "collateral_document_key": "a14e8b2c-bda7-4f3d-aebb-ae63822428ff",
    "collateral_type": "mortgage_ship",
    "additional_documents": [
        {
            "document_type": "ship_registration",
            "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04"
        },
        {
            "document_type": "ship_appraisal_report",
            "document_key": "210c38b5-6b61-4b74-b042-19ebef77e360"
        },
        {
            "document_type": "ship_insurance_policy",
            "document_key": "4cc6d706-551f-4d5e-8539-1b59b2f96cff"
        }
    ]
}
```

### **Document Types**

| Enum             | Description                           |
|-----------------|-----------------------------------|
| `ship_registration`**      | Updated Ship Property Registration.             |
| `ship_appraisal_report`**      | Ship Appraisal Report (maximum 3-month lag).             |
| `ship_insurance_policy`      | Ship Insurance Policy (if required in contract).            |
| `others`      | Other documents.             |

:::warning
(**) Required for ship mortgage.
:::

## **Guarantee**

Request Body

```json
{
    "collateral_document_key": "a14e8b2c-bda7-4f3d-aebb-ae63822428ff",
    "collateral_type": "guarantor",
    "additional_documents": [
        {
            "document_type": "guarantor_civil_status_declaration",
            "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04"
        },
        {
            "document_type": "guarantor_personal_document",
            "document_key": "210c38b5-6b61-4b74-b042-19ebef77e360"
        }
    ]
}
```

### **Document Types**

| Enum             | Description                           |
|-----------------|-----------------------------------|
| `guarantor_civil_status_declaration`**      | Civil Status Declaration of Guarantor.             |
| `guarantor_personal_document`**      | Personal document of Guarantor.             |
| `guarantor_income_tax_declaration`      | Income Tax Declaration of Guarantor.            |
| `others`      | Other documents.             |

:::warning
(**) Required for Guarantee.
:::

## **Guarantor**

Request Body

```json
{
    "collateral_document_key": "a14e8b2c-bda7-4f3d-aebb-ae63822428ff",
    "collateral_type": "surety",
    "additional_documents": [
        {
            "document_type": "surety_civil_status_declaration",
            "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04"
        },
        {
            "document_type": "surety_personal_document",
            "document_key": "210c38b5-6b61-4b74-b042-19ebef77e360"
        },
        {
            "document_type": "surety_income_tax_declaration",
            "document_key": "4cc6d706-551f-4d5e-8539-1b59b2f96cff"
        }
    ]
}
```

### **Document Types**

| Enum             | Description                           |
|-----------------|-----------------------------------|
| `surety_civil_status_declaration`**      | Civil Status Declaration of Guarantor.             |
| `surety_personal_document`**      | Personal document of Guarantor.             |
| `surety_income_tax_declaration`      | Income Tax Declaration of Guarantor.            |
| `others`      | Other documents.             |

:::warning
(**) Required for Guarantor.
:::

## **Bank surety**

Request Body

```json
{
    "collateral_document_key": "a14e8b2c-bda7-4f3d-aebb-ae63822428ff",
    "collateral_type": "bank_surety",
    "additional_documents": [
        {
            "document_type": "others",
            "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04"
        }
    ]
}
```

### **Document Types**

| Enum             | Description                           |
|-----------------|-----------------------------------|
| `others`      | Other documents.             |

## **Card receivables**

Request Body

```json
{
    "collateral_document_key": "a14e8b2c-bda7-4f3d-aebb-ae63822428ff",
    "collateral_type": "card_receivables",
    "additional_documents": [
        {
            "document_type": "others",
            "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04"
        }
    ]
}
```

### **Document Types**

| Enum             | Description                           |
|-----------------|-----------------------------------|
| `others`      | Other documents.             |

## **Stock guarantee**

Request Body

```json
{
    "collateral_document_key": "a14e8b2c-bda7-4f3d-aebb-ae63822428ff",
    "collateral_type": "stock_guarantee",
    "additional_documents": [
        {
            "document_type": "others",
            "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04"
        }
    ]
}
```

### **Document Types**

| Enum             | Description                           |
|-----------------|-----------------------------------|
| `others`      | Other documents.             |

## **Collateral monitoring**

Request Body

```json
{
    "collateral_document_key": "a14e8b2c-bda7-4f3d-aebb-ae63822428ff",
    "collateral_type": "monitoring_guarantee",
    "additional_documents": [
        {
            "document_type": "guarantee_contract",
            "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04"
        },
        {
            "document_type": "guarantee_agent_contract",
            "document_key": "210c38b5-6b61-4b74-b042-19ebef77e360"
        }
    ]
}
```

### **Document Types**

| Enum             | Description                           |
|-----------------|-----------------------------------|
| `guarantee_contract`**      | Guarantee Contract.             |
| `guarantee_agent_contract`**      | Guarantee Agent Contract.             |
| `others`      | Other documents.             |

:::warning
(**) Required for Collateral Monitoring.
:::

---
## **Request Body Params**

| Field                         | Type     | Description                                                        | Required |
|--------------------------------|----------|------------------------------------------------------------------|-------------|
| `collateral_document_key` * | string   | Collateral instrument key.       | Yes         |
| `collateral_type` *            | string   | Collateral type. | **[collateral_type Enums](#collateral_type-enums)** |
| `collateral_data`           | object   | Metadata structure related to collateral.               | Yes         |
| `additional_documents` | list   | Documents related to collateral. | - |

### **additional_documents list**

| Field                         | Type     | Description                                                        | Required |
|--------------------------------|----------|------------------------------------------------------------------|-------------|
| `document_key` * | string   | Collateral instrument key.       | Yes         |
| `document_type` *            | string   | Collateral document type. | Yes |

### **collateral_type Enums**

| Enum             | Description                           |
|-----------------|-----------------------------------|
| `fiduciary_alienation_property`      | Fiduciary alienation of property.             |
| `fiduciary_alienation_vehicle`      |  Fiduciary alienation of vehicle.            |
| `fiduciary_alienation_aircraft`      | Fiduciary alienation of aircraft.             |
| `fiduciary_alienation_equipment`      | Fiduciary alienation of equipment/products/stock.             |
| `fiduciary_alienation_artwork`      | Fiduciary alienation of artwork.             |
| `fiduciary_alienation_securities`      | Fiduciary alienation of securities.             |
| `fiduciary_assignment_shares`      | Fiduciary alienation/pledge of shares/quotas.             |
| `fiduciary_assignment_credit_rights`      | Fiduciary alienation of credit rights.             |
| `mortgage_property`      | Property mortgage.             |
| `mortgage_ship`      | Ship mortgage.             |
| `guarantor`      | Guarantee.             |
| `surety`      | Guarantor.             |
| `bank_surety`      | Bank surety.             |
| `card_receivables`      | Card receivables.             |
| `stock_guarantee`      | Stock guarantee.             |
| `monitoring_guarantee`      | Collateral monitoring.             |
| `others`      | Other collaterals.             |

---

# Collateral Removal from Operation

URL: /en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-garantias/remover-garantia

This endpoint allows the **removal of collaterals** associated with an operation.

---

## **Collateral Removal (DELETE)**

## **Request**
ENDPOINT /commercial_paper/operation/ OPERATION-KEY /collateral/ COLLATERAL-KEY
METHOD DELETE

### **Path Params**

| Field            | Type   | Description                                       | Max Characters |
|------------------|--------|-----------------------------------------------|-----------------|
| `OPERATION-KEY` * | string | Unique operation key (UUID v4).           | 36              |
| `COLLATERAL-KEY` * | string | Unique key of the collateral to be removed (UUID v4). | 36              |

## **Response**
STATUS 204

**No content is returned in the response body.**

---

# Document Upload

URL: /en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-garantias/upload-documento

This endpoint allows uploading **documents** associated with an operation. Such documents can be used in the collateral system to add accessory documents, in addition to the collateral instrument itself.

---

## **Document Upload (POST)**

## **Request**
ENDPOINT /commercial_paper/upload
METHOD POST

Request Body

```json
{
  "document_base64": "sringb64",
}
```

### **Request Body Params**

| Field                         | Type     | Description                                                        | Required |
|--------------------------------|----------|------------------------------------------------------------------|-------------|
| `document_base64` * | string   | Document content encoded in Base64.       | Yes         |

## **Response**
STATUS 201

Response Body

```json
{
  "document_key": "25dd10b8-7364-4abe-b0e8-0e419b04194b"
}
```

## **Response Body Params**

| Field            | Type     | Description                                      | Max Characters |
|------------------|----------|----------------------------------------------|-----------------|
| `document_key` * | string   | Unique key of the added document (UUID v4). | 36              |
---

---

# Operation Metadata Registration and Removal

URL: /en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-metadata-identificacao

This set of endpoints allows registering and removing metadata in an operation.

---

## **Operation Metadata Registration (POST)**

### **Request**
ENDPOINT /commercial_paper/operation/ OPERATION-KEY /metadata
METHOD POST

### **Path Params**

| Field             | Type   | Description                                     | Max Characters |
|-------------------|--------|-----------------------------------------------|-----------------|
| `OPERATION-KEY` * | string | Unique operation key (UUID v4).             | 36              |

Request Body

```json
{
  "metadata_key": "custom_meta_field",
  "metadata_value": "custom_meta_value"
}
```

### **Request Body Params**

| Field            | Type     | Description                            | Max Characters |
|------------------|----------|--------------------------------------|-----------------|
| `metadata_key` *   | string | Metadata key.                   | 255             |
| `metadata_value` * | string | Metadata value.                   | 1023            |

### **Response**
STATUS 201

Response Body

```json
{
  "metadata_key": "custom_meta_field",
  "metadata_value": "custom_meta_value"
}
```

### **Response Body Params**

| Field            | Type     | Description                            | Max Characters |
|------------------|----------|--------------------------------------|-----------------|
| `metadata_key` *   | string | Metadata key.                   | 255             |
| `metadata_value` * | string | Metadata value.                   | 1023            |

---

## **Operation Metadata Removal (DELETE)**

### **Request**
ENDPOINT /commercial_paper/operation/ OPERATION-KEY /metadata
METHOD DELETE

### **Path Params**

| Field            | Type   | Description                                     | Max Characters |
|------------------|--------|-----------------------------------------------|-----------------|
| `OPERATION-KEY` *  | string | Unique operation key (UUID v4).             | 36              |

Request Body

```json
{
  "metadata_key": "custom_meta_field",
  "metadata_value": "custom_meta_value"
}
```

### **Request Body Params**

| Field            | Type     | Description                            | Max Characters |
|------------------|----------|--------------------------------------|-----------------|
| `metadata_key` *   | string | Metadata key.                   | 255             |
| `metadata_value` * | string | Metadata value.                   | 1023            |

---

### **Response**
STATUS 204

**No content is returned in the response body.**

---

# Related Party Representative Document Upload and Removal

URL: /en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-parte-relacionada/adicionar-documento

This set of endpoints allows uploading and removing documents associated with related party representatives to an operation.

---

## **Representative Document Upload (POST)**

### **Request**
ENDPOINT /commercial_paper/operation/ OPERATION-KEY /related_party/ RELATED-PARTY-KEY /document
METHOD POST

### **Path Params**

| Field               | Type   | Description                                      | Max Characters |
|---------------------|--------|----------------------------------------------|-----------------|
| `OPERATION-KEY` *     | string | Unique operation key (UUID v4).          | 36              |
| `RELATED-PARTY-KEY` * | string | Unique related party key (UUID v4). | 36              |

Request Body

```json
{
  "document_base64": "dGVzdGVfZG9jdW1lbnRfYmFzZTY0",
  "document_type": "cnh"
}
```

### **Request Body Params**

| Field             | Type     | Description                                                       | Max Characters |
|------------------|----------|-----------------------------------------------------------------|-----------------|
| `document_base64` * | string   | Document file content encoded in Base64.         | -               |
| `document_type` *  | string   | Type of document being uploaded. | **[document_type Enumerators](#document_type-enumerators)** |

## **Response**
STATUS 201

Response Body

```json
{
  "document_key": "123e4567-e89b-12d3-a456-426614174000",
  "document_type": "proof_of_identity",
  "ocr_key": "123e4567-e89b-12d3-a456-426614174000"
}
```

### **Response Body Params**

| Field            | Type     | Description                                      | Max Characters |
|------------------|----------|----------------------------------------------|-----------------|
| `document_key` * | string   | Unique identifier of the uploaded document.   | 36              |
| `document_type` * | string   | Type of uploaded document. | **[document_type Enumerators](#document_type-enumerators)** |
| `ocr_key`        | string   | OCR key associated with the uploaded document.   | 36              |

---

## **Representative Document Removal (DELETE)**

### **Request**
ENDPOINT /commercial_paper/operation/ OPERATION-KEY /related_party/ RELATED-PARTY-KEY /document/ DOCUMENT-KEY
METHOD DELETE

### **Path Params**

| Field               | Type   | Description                                      | Max Characters |
|---------------------|--------|----------------------------------------------|-----------------|
| `OPERATION-KEY` *     | string | Unique operation key (UUID v4).          | 36              |
| `RELATED-PARTY-KEY` * | string | Unique related party key (UUID v4). | 36              |
| `DOCUMENT-KEY` *      | string | Unique key of the document to be removed.   | 36              |

### **Response**
STATUS 204

**No content is returned in the response body.**

### **document_type Enumerators**

| Enum                      | Description                               |
|---------------------------|-----------------------------------------|
| `danfe`                   | DANFE (Auxiliary Document of NF-e).     |
| `proof_of_address`        | Proof of Address.                |
| `letter_of_attorney`      | Power of Attorney.                             |
| `company_statute`         | Company Statute.                    |
| `cnh`                     | National Driver's License (CNH). |
| `cnh_front`               | CNH Front.                          |
| `cnh_back`                | CNH Back.                           |
| `cnh_digital`             | Digital CNH.                            |
| `rg_front`                | ID Front.                           |
| `rg_back`                 | ID Back.                            |

---

# Related Party Representative Signer Group Upload and Removal

URL: /en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-parte-relacionada/adicionar-grupo-assinantes

This set of endpoints allows uploading and removing signer groups associated with related party representatives to an operation.

---

## **Signer Group Upload (POST)**

### **Request**
ENDPOINT /commercial_paper/operation/ OPERATION-KEY /related_party/ RELATED-PARTY-KEY /signer_group
METHOD POST

### **Path Params**

| Field                 | Type   | Description                                      | Max Characters |
|-----------------------|--------|----------------------------------------------|-----------------|
| `OPERATION-KEY` *     | string | Unique operation key (UUID v4).           | 36              |
| `RELATED-PARTY-KEY` * | string | Unique related party key (UUID v4). | 36              |

Request Body

```json
{
  "minimum_required_signers": 2,
  "signers": [
    {
      "name": "João da Silva",
      "document_number": "12345678901",
      "email": "joao.silva@example.com",
      "phone_number": "+5511999999999",
      "is_group_mandatory": true
    },
    {
      "name": "Maria Souza",
      "document_number": "98765432100",
      "email": "maria.souza@example.com",
      "phone_number": "+5511988888888",
      "is_group_mandatory": false
    }
  ]
}
```

### **Request Body Params**

| Field                        | Type     | Description                                              | Max Characters |
|------------------------------|----------|--------------------------------------------------------|-----------------|
| `minimum_required_signers` * | integer  | Minimum number of signers required in the group.     | -               |
| `signers` *                  | array    | List of group signers.                         | **[signers Object](#signers-object)** |

---

### **signers Object**

| Field                    | Type     | Description                                         | Max Characters |
|--------------------------|----------|-------------------------------------------------|-----------------|
| `name` *                | string   | Full name of the signer.                     | 255             |
| `document_number` *      | string   | Signer's CPF (11 digits).                  | 11              |
| `email` *               | string   | Signer's email address.                | 1023            |
| `phone_number` *        | string   | Signer's phone number, including country code. | 20              |
| `is_group_mandatory` *  | boolean  | Indicates if the signer is mandatory.            | -               |

## **Response**
STATUS 201

Response Body

```json
{
  "signer_group_key": "123e4567-e89b-12d3-a456-426614174000",
  "minimum_required_signers": 2,
  "signers": [
    {
      "name": "João da Silva",
      "document_number": "12345678901",
      "email": "joao.silva@example.com",
      "phone_number": "+5511999999999",
      "is_group_mandatory": true
    },
    {
      "name": "Maria Souza",
      "document_number": "98765432100",
      "email": "maria.souza@example.com",
      "phone_number": "+5511988888888",
      "is_group_mandatory": false
    }
  ]
}
```

### **Response Body Params**

| Field                        | Type     | Description                                         | Max Characters |
|------------------------------|----------|-------------------------------------------------|-----------------|
| `signer_group_key` *         | string   | Unique signer group key (UUID v4).   | 36              |
| `minimum_required_signers` * | integer  | Minimum number of signers in the group.           | -               |
| `signers` *                  | array    | List of group signers.                   | **[signers Object](#signers-object)** |

---

## **Signer Group Removal (DELETE)**

### **Request**
ENDPOINT /commercial_paper/operation/ OPERATION-KEY /related_party/ RELATED-PARTY-KEY /signer_group/ SIGNER-GROUP-KEY
METHOD DELETE

### **Path Params**

| Field                 | Type   | Description                                      | Max Characters |
|-----------------------|--------|----------------------------------------------|-----------------|
| `OPERATION-KEY` *     | string | Unique operation key (UUID v4).           | 36              |
| `RELATED-PARTY-KEY` * | string | Unique related party key (UUID v4). | 36              |
| `SIGNER-GROUP-KEY` *  | string | Unique signer group key.         | 36              |

### **Response**
STATUS 204

**No content is returned in the response body.**

---

# Specific Document Related Party Registration and Removal

URL: /en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-parte-relacionada/adicionar-parte-relacionada-em-documento

This set of endpoints allows registering and removing related parties to an operation for a specific document of the operation.

---

## **Add Related Party to Document (POST)**

### **Request**

ENDPOINT /commercial_paper/operation/ OPERATION-KEY /formalization_document FORMALIZATION-DOCUMENT-KEY /related_party
METHOD POST

### **Path Params**

| Field               | Type   | Description                           | Max Characters |
| ------------------- | ------ | ------------------------------------- | ---------------- |
| `OPERATION-KEY` * | string | Unique operation key (UUID v4). | 36               |
| `FORMALIZATION-DOCUMENT-KEY` * | string | Unique operation document key (UUID v4). | 36               |

Request Body

```json
{
  "related_party_key": "48e2c597-f2ca-487e-9f06-2b628ecb831e"
}
```

### **Request Body Params**

| Field                 | Type   | Description                                                            | Max Characters                                             |
| --------------------- | ------ | ---------------------------------------------------------------------- | ------------------------------------------------------------ |
| `related_party_key` *     | string | Related Party Key |                                       | 36

## **Response**

STATUS 204

**No content is returned in the response body.**

## **Related Party Removal (DELETE)**

### **Request**

ENDPOINT /commercial_paper/operation/ OPERATION-KEY /formalization_document/ FORMALIZATION-DOCUMENT-KEY /related_party
METHOD DELETE

### **Path Params**

| Field                   | Type   | Description                           | Max Characters |
| ----------------------- | ------ | ------------------------------------- | ---------------- |
| `OPERATION-KEY` *     | string | Unique operation key (UUID v4). | 36               |
| `FORMALIZATION-DOCUMENT-KEY` * | string | Unique operation document key (UUID v4).    | 36               |

Request Body

```json
{
  "related_party_key": "48e2c597-f2ca-487e-9f06-2b628ecb831e"
}
```

### **Response**

STATUS 204

**No content is returned in the response body.**

---

# Related Party Registration and Removal

URL: /en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-parte-relacionada/cadastrar-parte-relacionada

This set of endpoints allows registering and removing related parties to an operation.

:::warning
All related parties are added by default to the Constitutive Term (**commercial_paper**). If you want to add this related party to a specific document, fill the **related_document_key** field with the key of the desired document.
:::

---

## **Related Party Registration (POST)**

### **Request**

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

### **Path Params**

| Field               | Type   | Description                           | Max Characters |
| ------------------- | ------ | ------------------------------------- | ---------------- |
| `OPERATION-KEY` * | string | Unique operation key (UUID v4). | 36               |

:::info Important
**Attention to person type when building the payload:**
- **Natural Person**: `"person_type": "natural"`
- **Legal Person**: `"person_type": "legal"`
:::

Request Body - Natural Person

```json
{
  "person_type": "natural",
  "name": "João da Silva",
  "document_number": "12345678901",
  "street": "Rua dos Exemplo",
  "neighborhood": "Centro",
  "number": "123",
  "postal_code": "01001000",
  "city": "São Paulo",
  "state": "SP",
  "role_type": "guarantor",
  "is_pep": false
}
```

Request Body - Legal Person

  ```json
  {
    "person_type": "legal",
    "name": "João da Silva",
    "trading_name": "Padaria do João LTDA",
    "document_number": "92.123.456/0001-00",
    "street": "Rua dos Exemplo",
    "neighborhood": "Centro",
    "number": "123",
    "postal_code": "01001-000",
    "city": "São Paulo",
    "state": "SP",
    "role_type": "guarantor",
    "cnae_code": "12.34-5-67",
    "company_type": "ltda",
    "foundation_date": "2025-01-01"
  }
  ```

### **Request Body Params**

| Field                 | Type   | Description                                                            | Max Characters                                             |
| --------------------- | ------ | ---------------------------------------------------------------------- | ------------------------------------------------------------ |
| `person_type` *     | string | Person type.                                                        | **[person_type Enumerators](#person_type-enumerators)** |
| `name` *            | string | Related party name.                                             | 255                                                          |
| `document_number` * | string | CPF (format "XXX.XXX.XXX-XX") or CNPJ (format "XX.XXX.XXX/XXXX-XX"). | 14                                                           |
| `street` *          | string | Address street.                                               | 500                                                          |
| `neighborhood`      | string | Address neighborhood.                                                   | 100                                                          |
| `number` *          | string | Address number.                                                  | 10                                                           |
| `postal_code` *     | string | Address postal code (format "XXXXX-XXX").                                | 8                                                            |
| `city` *            | string | Address city.                                                   | 255                                                          |
| `state` *           | string | State abbreviation (2 characters).                                        | 2                                                            |
| `role_type` *       | string | Related party role.                                            | **[role_type Enumerators](#role_type-enumerators)**     |
| `related_document_key`        | string | Document identification key (UUIDv4)                | 36

### **person_type Enumerators**

| Enum        | Description      |
| ----------- | ---------------- |
| `natural` | Natural Person   |
| `legal`   | Legal Person |

### **Additional fields for Natural Person**

| Field                              | Type    | Description                                                              | Max Characters                                                     |
| ---------------------------------- | ------- | ------------------------------------------------------------------------ | -------------------------------------------------------------------- |
| `document_identification_number` | string  | ID number (without formatting)                                                    | 20                                                                   |
| `marital_status`                 | string  | Marital status.                                                            | **[marital_status Enumerators](#marital_status-enumerators)**   |
| `property_system`                | string  | Property regime.                                                          | **[property_system Enumerators](#property_system-enumerators)** |
| `birthdate`                      | string  | Birth date (YYYY-MM-DD).                                         | -                                                                    |
| `nationality`                    | string  | Nationality.                                                           | 255                                                                  |
| `mother_name`                    | string  | Mother's name.                                                            | 255                                                                  |
| `father_name`                    | string  | Father's name.                                                             | 255                                                                  |
| `occupation`                     | string  | Occupation.                                                              | 255                                                                  |
| `is_pep` *                       | boolean | Indicates if the related party is a Politically Exposed Person (PEP). |                                                                      |

### **Additional fields for Legal Person**

| Field                 | Type   | Description                            | Max Characters                                               |
| --------------------- | ------ | -------------------------------------- | -------------------------------------------------------------- |
| `trading_name` *    | string | Company trade name.              | 1023                                                           |
| `cnae_code` *       | string | Company CNAE code (10 digits). | 10                                                             |
| `company_type` *    | string | Company type.                       | **[company_type Enumerators](#company_type-enumerators)** |
| `foundation_date` * | string | Foundation date (YYYY-MM-DD).       | -                                                              |

### **role_type Enumerators**

| Enum                       | Description              |
| -------------------------- | ------------------------ |
| `cosigner`               | Cosigner                 |
| `fiduciary_debtor`       | Fiduciary Debtor      |
| `solidary_debtor`        | Solidary Debtor       |
| `guarantor`              | Guarantor                   |
| `bonafide_depositary`    | Bona Fide Depositary        |
| `intervening_guarantor`  | Intervening Guarantor     |
| `intervening_consentor`  | Intervening Consenter    |
| `intervening_discharger` | Intervening Discharger   |
| `assignor`               | Assignor                  |
| `endorser`               | Endorser               |
| `consulting`             | Consultant                |
| `fund_administrator`     | Fund Administrator   |
| `fund_representative`    | Fund Representative   |
| `company_representative` | Company Representative |
| `attestant`              | Witness               |
| `debtor`                 | Debtor                  |
| `bestowal`               | Spousal Authorization          |
| `manager`                | Manager                   |

### marital_status Enumerators

| Enum        | Description      |
| ----------- | ---------------- |
| `single`    | Single     |
| `married`   | Married       |
| `divorced`  | Divorced   |
| `widowed`   | Widowed        |
| `separated` | Separated     |
| `stable_union`| Stable Union |

### property_system Enumerators

| Enum                              | Description                              |
| --------------------------------- | -------------------------------------- |
| `total_communion_of_goods`        | Total Community of Property                |
| `partial_communion_of_goods`      | Partial Community of Property              |
| `total_separation_of_goods`       | Total Separation of Property               |
| `final_participation_of_acquisitions` | Final Participation in Acquisitions    |
| `compulsory_separation_of_goods`  | Compulsory Separation of Property         |

### company_type Enumerators

| Enum                | Description                    |
| ------------------- | ---------------------------- |
| `ltda`             | Limited Liability Company           |
| `sa`               | Corporation            |
| `cop` | Cooperative                 |

## **Response**

STATUS 201

Response Body

```json
{
	"related_party_key": "c642a117-ea6e-4da7-a8fd-451f556e5c38",
	"name": "João da Silva",
	"document_number": "12345678901",
	"role_type": "guarantor",
	"is_active": true,
	"updated_at": null,
	"person_type": "natural",
	"street": "Rua dos Exemplo",
	"neighborhood": "Centro",
	"number": "123",
	"postal_code": "01001000",
	"city": "São Paulo",
	"state": "SP",
	"signer_group_list": [],
	"document_list": [],
	"contact_information_list": []
}
```

### **Response Body Params**

| Field                   | Type    | Description                                          | Max Characters                                             |
| ----------------------- | ------- | ---------------------------------------------------- | ------------------------------------------------------------ |
| `related_party_key` * | string  | Unique related party key.                   | 36                                                           |
| `name` *              | string  | Related party name.                           | 255                                                          |
| `document_number` *   | string  | Related party CPF/CNPJ.                       | 14                                                           |
| `role_type` *         | string  | Related party role.                          | 50                                                           |
| `is_active` *         | boolean | Indicates if it is active.                               | -                                                            |
| `updated_at`          | string  | Last update date (YYYY-MM-DD HH:mm:ss). | -                                                            |
| `person_type` *       | string  | Person type.                                      | **[person_type Enumerators](#person_type-enumerators)** |
| `street` *            | string  | Street.                                          | 500                                                          |
| `neighborhood`        | string  | Neighborhood.                                              | 100                                                          |
| `number` *            | string  | Number.                                             | 10                                                           |
| `postal_code` *       | string  | Postal code (numbers only).                              | 8                                                            |
| `city` *              | string  | City.                                              | 255                                                          |
| `state` *             | string  | State abbreviation (2 characters).                      | 2                                                            |

---

## **Related Party Removal (DELETE)**

### **Request**

ENDPOINT /commercial_paper/operation/ OPERATION-KEY /related_party/ RELATED-PARTY-KEY
METHOD DELETE

### **Path Params**

| Field                   | Type   | Description                           | Max Characters |
| ----------------------- | ------ | ------------------------------------- | ---------------- |
| `OPERATION-KEY` *     | string | Unique operation key (UUID v4). | 36               |
| `RELATED-PARTY-KEY` * | string | Unique related party key.    | 36               |

### **Response**

STATUS 204

**No content is returned in the response body.**

---

# Commercial Paper Operation Registration

URL: /en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/criar-operacao

This endpoint allows creating a new commercial paper operation based on financial and investor data.

---

## **Request**

ENDPOINT /commercial_paper/operation
METHOD POST

Request Body

```json
{
    "issuer_key": "48e2c597-f2ca-487e-9f06-2b628ecb831e",
    "issuer_bank_account": {
        "account_number": "4464541",
        "account_digit": "3",
        "account_branch": "0001",
        "financial_institution_code_number": "329",
        "financial_institution_ispb": "32402502",
        "account_type": "checking"
    },
    "investors": [
        {
            "investor_key": "70b1b638-ca56-4eb3-9a88-2fd5ffd077a7",
            "subscription_percentage": 100,
            "bank_account": {
                "account_number": "33400254",
                "account_digit": "3",
                "account_branch": "0001",
                "financial_institution_code_number": "329",
                "financial_institution_ispb": "32402502",
                "account_type": "checking"
            }
        }
    ],
    "issue_date": "2025-01-23",
    "signature_method": "certifiqi",
    "financial": {
        "interest_type": "pre_price_days",
        "financial_base_date": "2025-01-23",
        "released_amount": 1000000,
        "number_of_installments": 5,
        "prefixed_interest_rate": {
            "interest_base": "calendar_days_365",
            "monthly_rate": 0.05
        },
        "fine_delay_rate": {
            "interest_base": "calendar_days_365",
            "monthly_rate": 0.01
        },
        "contract_fine_rate": 0.02,
        "fees": [
            {
                "amount": 5,
                "amount_type": "percentage",
                "fee_type": "structuring_fee"
            }
        ]
    }
}
```

### **Request Body Params**

| Field                     | Type   | Description                                            | Max Characters                                                 |
| ------------------------- | ------ | ------------------------------------------------------ | ---------------------------------------------------------------- |
| `issuer_key` *          | string | Unique issuer key.                               | -                                                                |
| `issuer_bank_account` * | object | Issuer bank account.                            | **[issuer_bank_account Object](#issuer_bank_account-object)** |
| `investors` *           | array  | List of involved investors.                      | **[investors Object](#investors-object)**                     |
| `issue_date` *          | string | Operation issue date (format "YYYY-MM-DD"). | -                                                                |
| `signature_method`      | string | Signature method used in the operation. Optional; when omitted, defaults to `certifiqi`. | **[signature_method Enumerators](#signature_method-enumerators)** |
| `financial` *           | object | Operation financial data.                       | **[financial Object](#financial-object)**                     |

### **issuer_bank_account Object**

| Field                                   | Type   | Description                                |
| --------------------------------------- | ------ | ------------------------------------------ |
| `account_number` *                    | string | Bank account number.                |
| `account_digit` *                     | string | Bank account digit.                |
| `account_branch` *                    | string | Bank account branch.               |
| `financial_institution_code_number` * | string | Financial institution code.       |
| `financial_institution_ispb` *        | string | Financial institution ISPB code.  |
| `account_type` *                      | string | Account type (`checking`, `savings`). |

### **investors Object**

| Field                         | Type   | Description                    |
| ----------------------------- | ------ | ------------------------------ |
| `investor_key` *            | string | Unique investor key.    |
| `subscription_percentage` * | number | Subscription percentage.    |
| `bank_account` *            | object | Investor bank account. |

### **financial Object**

| Field                        | Type    | Description                                  |
| ---------------------------- | ------- | -------------------------------------------- |
| `interest_type` *          | string  | Interest type.                               |
| `financial_base_date` *    | string  | Financial base date (format "YYYY-MM-DD"). |
| `released_amount` *        | number  | Released amount.                              |
| `number_of_installments` * | integer | Number of installments.                         |
| `prefixed_interest_rate` * | object  | Prefixed interest rate.                     |
| `fine_delay_rate` *        | object  | Delay fine rate.                    |
| `contract_fine_rate` *     | number  | Contractual fine in percentage.              |
| `fees`                     | array   | List of fees.                              |

### signature_method Enumerators

| Value         | Description                                                                                                                                                                       |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `certifiqi` | Default value. The operation is sent to the signature service; a signature envelope is created and the client receives the signature URL (`signature_url`).                       |
| `qi_sign`   | The operation is sent to the signature service; a signature envelope is created and the client receives the signature URL (`signature_url`). Also allows querying the operation's signers. |

## **Response**

STATUS 201

Response Body

```json
{
    "tenant_key": "1d29d606-649a-487f-af1c-c0f5cb3e9814",
    "operation_key": "a846cc4a-b542-4f66-9823-b6d5458bd127",
    "operation_status": "in_filling",
    "issuer_key": "48e2c597-f2ca-487e-9f06-2b628ecb831e",
    "issuer_name": "Dynamic Enterprises",
    "issuer_document_number": "28980395000155",
    "financial": {
        ...
    }
}
```

### **Response Body Params**

| Field                        | Type   | Description                                           |
| ---------------------------- | ------ | ----------------------------------------------------- |
| `tenant_key` *             | string | Unique tenant key.                               |
| `operation_key` *          | string | Unique operation key.                           |
| `operation_status` *       | string | Operation status.                                 |
| `issuer_key` *             | string | Unique issuer key.                              |
| `issuer_name` *            | string | Issuer name.                                      |
| `issuer_document_number` * | string | Issuer document.                                 |
| `financial` *              | object | **[financial Object](#financial-object-response)** |

### financial Object Response

| Field                        | Type    | Description                                                | Max Characters                                                       |
| ---------------------------- | ------- | ---------------------------------------------------------- | ---------------------------------------------------------------------- |
| `financial_base_date` *    | string  | Operation financial base date (format "YYYY-MM-DD"). | -                                                                      |
| `issue_amount` *           | number  | Total issued amount of the operation.                         | -                                                                      |
| `released_amount` *        | number  | Net amount released in the operation.                     | -                                                                      |
| `issue_quantity` *         | integer | Total quantity of units issued.                     | -                                                                      |
| `unit_price` *             | number  | Unit price of the issuance.                              | -                                                                      |
| `cet` *                    | number  | Total Effective Cost (CET) in percentage.                   | -                                                                      |
| `annual_cet` *             | number  | Annual CET in percentage.                                   | -                                                                      |
| `number_of_installments` * | integer | Total number of installments.                                 | -                                                                      |
| `prefixed_interest_rate` * | object  | Object containing prefixed interest rate details.       | **[prefixed_interest_rate Object](#prefixed_interest_rate-object)** |
| `fees`                     | array   | List of fees associated with the operation.                   | **[fees Object](#fees-object)**                                     |
| `installments`             | array   | List of installment details generated in the operation.      | **[installments Object](#installments-object)**                     |
| `fine_delay_rate` *        | object  | Object containing delay fine details.              | **[fine_delay_rate Object](#fine_delay_rate-object)**               |
| `contract_fine_rate` *     | number  | Contractual fine applied in percentage.                   | -                                                                      |

### prefixed_interest_rate Object

| Field               | Type   | Description                     | Max Characters                                                 |
| ------------------- | ------ | ------------------------------- | ---------------------------------------------------------------- |
| `interest_base` * | string | Calculation base for interest. | **[interest_base Enumerators](#interest_base-enumerators)** |
| `monthly_rate` *  | number | Applied monthly interest rate.  | -                                                                |
| `daily_rate` *    | number | Applied daily interest rate. | -                                                                |
| `annual_rate` *   | number | Applied annual interest rate.   | -                                                                |

### fees Object

| Field             | Type   | Description                              | Max Characters                                                 |
| ----------------- | ------ | ---------------------------------------- | ---------------------------------------------------------------- |
| `amount` *      | number | Percentage value of the fee.                | -                                                                |
| `fee_amount` *  | number | Monetary value corresponding to the fee. | -                                                                |
| `amount_type` * | string | Type of fee value.                   | **[amount_type Enumerators](#amount_type-enumerators)**     |
| `fee_type` *    | string | Type of fee.                            | **[fee_type Enumerators](#fee_type-enumerators)**           |
| `type` *        | string | Fee recipient.                   | **[fee_recipient Enumerators](#fee_recipient-enumerators)** |

### installments Object

| Field                                   | Type    | Description                                           |
| --------------------------------------- | ------- | ----------------------------------------------------- |
| `installment_number` *                | integer | Installment number.                                   |
| `workdays` *                          | integer | Business days until installment due date.             |
| `calendar_days` *                     | integer | Calendar days until installment due date.           |
| `principal_amortization_amount` *     | number  | Principal amortized amount.                        |
| `principal_amortization_unit_price` * | number  | Amortized amount per unit.                         |
| `interest_amount` *                   | number  | Interest amount applied in the installment.                 |
| `amount` *                            | number  | Total installment amount.                               |
| `due_date` *                          | string  | Installment due date (format "YYYY-MM-DD"). |

---

# Campos Extras (Extra Fields)

URL: /en/documentation/escrituracao/emissao-de-notas/cadastro-operacao/extra-fields

Este conjunto de endpoints permite consultar os campos extras disponíveis em um template de documento e salvar valores personalizados para esses campos em uma operação.

:::warning
Para utilizar os campos extras, é necessário que o template do documento já tenha sido definido. Caso contrário, gere uma pré-visualização de minuta antes de utilizar estes endpoints.
:::

:::info Importante
Os campos extras são organizados por tipo de documento (`document_type`). Ao salvar campos extras via POST, os valores anteriores para aquele `document_type` são **substituídos integralmente** — não é feito merge com valores existentes.
:::

---

## **Consulta de Campos Extras Disponíveis (GET)**

Retorna os campos extras disponíveis no template associado ao tipo de documento da operação.

### **Request**

ENDPOINT /commercial_paper/operation/ OPERATION-KEY /extra_fields
MÉTODO GET

### **Path Params**

| Campo               | Tipo   | Descrição                           | Caracteres Máx. |
| ------------------- | ------ | ------------------------------------- | ---------------- |
| `OPERATION-KEY` * | string | Chave única da operação (UUID v4). | 36               |

### **Query Params**

| Campo               | Tipo   | Descrição                           | Caracteres Máx. |
| ------------------- | ------ | ------------------------------------- | ---------------- |
| `document_type` * | string | Tipo do documento. | **[Enumeradores document_type](#enumeradores-document_type)** |

### **Response**

STATUS 200

Response Body

```json
{
  "operation_key": "550e8400-e29b-41d4-a716-446655440000",
  "document_type": "commercial_paper",
  "template_key": "660e8400-e29b-41d4-a716-446655440001",
  "extra_fields": [
    {
      "field_key": "warranty_description",
      "field_label": "Descrição da Garantia",
      "field_type": "string"
    },
    {
      "field_key": "special_conditions",
      "field_label": "Condições Especiais",
      "field_type": "string"
    },
    {
      "field_key": "additional_clause",
      "field_label": "Cláusula Adicional",
      "field_type": "string"
    }
  ]
}
```

### **Response Body Params**

| Campo               | Tipo   | Descrição                                                     | Caracteres Máx. |
| ------------------- | ------ | --------------------------------------------------------------- | ---------------- |
| `operation_key` * | string | Chave única da operação (UUID v4).                           | 36               |
| `document_type` *  | string | Tipo do documento consultado.                                  | **[Enumeradores document_type](#enumeradores-document_type)** |
| `template_key` *   | string | Chave única do template associado (UUID v4).                  | 36               |
| `extra_fields` *   | array  | Lista de campos extras disponíveis no template.               | -                |

### **Campos do objeto extra_fields**

| Campo               | Tipo   | Descrição                                                     | Caracteres Máx. |
| ------------------- | ------ | --------------------------------------------------------------- | ---------------- |
| `field_key` *      | string | Identificador único do campo extra.                           | 255              |
| `field_label` *    | string | Rótulo descritivo do campo extra.                             | 255              |
| `field_type` *     | string | Tipo de dado do campo extra (ex: `string`).                   | 50               |

---

## **Salvar Campos Extras (POST)**

Salva os valores dos campos extras para um tipo de documento específico em uma operação. Os valores enviados substituem integralmente os campos extras anteriores para o `document_type` informado.

### **Request**

ENDPOINT /commercial_paper/operation/ OPERATION-KEY /extra_fields
MÉTODO POST

### **Path Params**

| Campo               | Tipo   | Descrição                           | Caracteres Máx. |
| ------------------- | ------ | ------------------------------------- | ---------------- |
| `OPERATION-KEY` * | string | Chave única da operação (UUID v4). | 36               |

Request Body

```json
{
  "document_type": "commercial_paper",
  "extra_fields": {
    "warranty_description": "Garantia prestada pelo avalista",
    "special_conditions": "Condição especial de vencimento antecipado",
    "additional_clause": "Cláusula de cross default"
  }
}
```

### **Request Body Params**

| Campo               | Tipo   | Descrição                                                     | Caracteres Máx. |
| ------------------- | ------ | --------------------------------------------------------------- | ---------------- |
| `document_type` * | string | Tipo do documento.                                              | **[Enumeradores document_type](#enumeradores-document_type)** |
| `extra_fields` *  | object | Objeto contendo os campos extras e seus valores. As chaves devem corresponder aos `field_key` retornados na consulta GET. Todos os valores devem ser strings. | -                |

:::warning
As chaves enviadas no objeto `extra_fields` devem corresponder exatamente aos `field_key` disponíveis no template. Chaves inválidas resultarão em erro.
:::

### **Response**

STATUS 201

Response Body

```json
{
  "operation_key": "550e8400-e29b-41d4-a716-446655440000",
  "document_type": "commercial_paper",
  "extra_fields": {
    "warranty_description": "Garantia prestada pelo avalista",
    "special_conditions": "Condição especial de vencimento antecipado",
    "additional_clause": "Cláusula de cross default"
  }
}
```

### **Response Body Params**

| Campo               | Tipo   | Descrição                                                     | Caracteres Máx. |
| ------------------- | ------ | --------------------------------------------------------------- | ---------------- |
| `operation_key` * | string | Chave única da operação (UUID v4).                           | 36               |
| `document_type` *  | string | Tipo do documento.                                              | **[Enumeradores document_type](#enumeradores-document_type)** |
| `extra_fields` *   | object | Objeto contendo os campos extras salvos com seus respectivos valores. | -                |

---

## **Enumeradores document_type**

| Enum                 | Descrição            |
| -------------------- | ---------------------- |
| `commercial_paper` | Termo Constitutivo     |
| `adhesion_term`    | Termo de Adesão       |

---

## **Erros**

| Código     | HTTP | Descrição                                                                                              |
| ---------- | ---- | -------------------------------------------------------------------------------------------------------- |
| `COM000007` | 404  | Operação não encontrada.                                                                               |
| `COM000008` | 403  | Operação não pertence ao tenant solicitante.                                                           |
| `COM000044` | 400  | Template não definido para o tipo de documento. Gere uma pré-visualização de minuta antes de prosseguir. |
| `COM000045` | 400  | Chaves de campos extras não disponíveis no template.                                                   |

---

# Cancel Operation

URL: /en/documentation/escrituracao/emissao-de-notas/cancelar-operacao

This endpoint allows changing the status of an operation to "canceled", final status for cases where the operation will no longer be completed by the client.

---

## Cancel Operation (PATCH)

### Request
ENDPOINT /commercial_paper/operation/ OPERATION-KEY
METHOD PATCH

### Path Params

| Field           | Type   | Description                                               | Characters |
|------------------|--------|----------------------------------------------------------|------------|
| `OPERATION-KEY`  | string | Unique operation key (UUID v4).                         | 36         |

---

### Request Body

```json
{
  "operation_status": "canceled"
}
```

### Request Body Params

| Field             | Type     | Description                                                 | Required |
|--------------------|----------|-----------------------------------------------------------|----------|
| `operation_status` | string   | Operation status. Must be set as `canceled`.            | Yes      |

---

### Response

The response body is a complete JSON of the updated operation.

---

---

# Query Signed Contract Link via QI SIGN of the Operation

URL: /en/documentation/escrituracao/emissao-de-notas/consulta-link-assinado-qisign

This endpoint allows you to query all signed documents of a specific operation via QI SIGN, using its unique key.

---

:::warning Attention
 The signed contract link is valid for 24 hours. After that, it is necessary to renew the link by making a new request through the endpoint.
:::

## Query Operation Signed Link (GET)

### Request
ENDPOINT /commercial_paper/operation/ OPERATION-KEY /signed_url
METHOD GET

### Path Params

| Field           | Type   | Description                                                 | Characters |
|------------------|--------|----------------------------------------------------------|------------|
| `OPERATION-KEY`  | string | Unique operation key (UUID v4).                       | 36         |

---

### Response
STATUS 200

Response Body

```json
{
    "envelope_key": "5b930d3d-3713-4c42-85d5-f8e9e44e30ce",
    "status": "signed",
    "documents": [
        {
            "document_type": "ncom_pre_price",
            "signed_url": "https://qisign-dossiers.com/7bcf5868-784a-4356-85fb-dd72fd53cd4a.pdf",
            "signers": []
        },
        {
            "document_type": "adhesion_term",
            "signed_url": "https://qisign-dossiers.com/7bcf5868-784a-4356-85fb-dd72fd53cd4a.pdf",
            "signers": []
        }
    ]
}
```

### Response Body Params

| Field                             | Type     | Description                                            | Max Characters                                                 |
|-----------------------------------|----------|------------------------------------------------------|-----------------------------------------------------------------|
| `envelope_key`                    | string   | Unique envelope key (UUID v4).                 | 36                                                              |
| `status`               | string   | Envelope status                   | [Status enumerators](#enumeradores-operation-status)
| `documents`                | list   | List of envelope documents                 | -                                                               |

### document object

| Field                              | Type     | Description                                      | Max Characters |
|-------------------------------------|----------|------------------------------------------------|-----------------|
| `document_type`                    | string   | Document type.                  | [Document type enumerators](#enumeradores-document-type)               |
| `signed_url`                    | string   | Signed contract URL for download                      | -               |
| `signers`                    | list   | List of signers                             | -               |

## **operation-status enumerators**

| Enum                           | Description                                                        |
|--------------------------------|----------------------------------------------------------------|
| `waiting_signature`            | Waiting for signatures from involved parties.                        |
| `signed`                       | Signature completed.                                        |
| `signature_rejected`           | Signature rejected.                                         |
| `canceled`                     | Operation canceled.                                           |

## **document-type enumerators**

| Enum                             | Description                                                        |
|----------------------------------|------------------------------------------------------------------|
| `contract`                       | Contract identifier.                                        |
| `ncom_pre_price`                 | Commercial note Pre price.    |
| `ncom_pre_price_days`            | Commercial note Pre price days.             |
| `ncom_pre_sac`                   | Commercial note Pre sac.    |
| `ncom_post_sac_cdi`              | Commercial note Post sac linked to CDI.                      |
| `ncom_post_sac_ipca`             | Commercial note Post sac linked to IPCA.                     |
| `ncom_post_sac_igpm`             | Commercial note Post sac linked to IGP-M.                    |
| `ncom_post_price_cdi`            | Commercial note Post price linked to CDI.                     |
| `ncom_post_price_ipca`           | Commercial note Post price linked to IPCA.                    |
| `ncom_post_price_igpm`           | Commercial note Post price linked to IGP-M.                   |
| `ncom_post_price_days_cdi`       | Commercial note Post price days linked to CDI.             |
| `ncom_post_price_days_ipca`      | Commercial note Post price days linked to IPCA.            |
| `ncom_post_price_days_igpm`      | Commercial note Post price days linked to IGP-M.           |
| `subscription_note`              | Subscription bulletin.                                               |
| `adhesion_term`                  | Adhesion term.                                                  |

---

# Query Signature Links via QI SIGN for Operation

URL: /en/documentation/escrituracao/emissao-de-notas/consulta-link-assinatura-qisign

This endpoint allows querying all signature links for a specific operation via QI SIGN, using its unique key.

---

## Query Signature Link for Operation (GET)

### Request
ENDPOINT /commercial_paper/operation/ OPERATION-KEY /signers
METHOD GET

### Path Params

| Field           | Type   | Description                                               | Characters |
|------------------|--------|----------------------------------------------------------|------------|
| `OPERATION-KEY`  | string | Unique operation key (UUID v4).                       | 36         |

---

### Response
STATUS 200

Response Body

```json
{
    "envelope_key": "5b930d3d-3713-4c42-85d5-f8e9e44e30ce",
    "status": "pending_signature",
    "documents": [
        {
            "document_type": "adhesion_term",
            "signers": [
                {
                    "document_number": "145.736.070-56",
                    "signature_url": "https://sign.qitech.com.br/s/s2S33dD",
                    "name": "Emissor assinante",
                    "email": "emissor@qitech.com.br",
                    "status": "on_signature"
                },
                {
                    "document_number": "145.736.070-56",
                    "signature_url": "https://sign.qitech.com.br/s/s2S33dD",
                    "name": "Assinante QI CTVM",
                    "email": "dtvm@qitech.com.br",
                    "status": "on_signature"
                },
                {
                    "document_number": "145.736.070-56",
                    "signature_url": "https://sign.qitech.com.br/s/s2S33dD",
                    "name": "Assinante QI TECH",
                    "email": "qi@qitech.com.br",
                    "status": "on_signature"
                }
            ]
        },
        {
            "document_type": "ncom_pre_price",
            "signers": [
                {
                    "document_number": "145.736.070-56",
                    "signature_url": "https://sign.qitech.com.br/s/s2S33dD",
                    "name": "Assinante QI TECH",
                    "email": "qi@qitech.com.br",
                    "status": "on_signature"
                },
                {
                    "document_number": "145.736.070-56",
                    "signature_url": "https://sign.qitech.com.br/s/s2S33dD",
                    "name": "Emissor assinante",
                    "email": "emissor@qitech.com.br",
                    "status": "on_signature"
                },
                {
                    "document_number": "145.736.070-56",
                    "signature_url": "https://sign.qitech.com.br/s/s2S33dD",
                    "name": "Assinante QI CTVM",
                    "email": "dtvm@qitech.com.br",
                    "status": "on_signature"
                }
            ]
        }
    ]
}
```

### Response Body Params

| Field                             | Type     | Description                                            | Max Characters                                                 |
|-----------------------------------|----------|------------------------------------------------------|-----------------------------------------------------------------|
| `envelope_key`                    | string   | Unique envelope key (UUID v4).                 | 36                                                              |
| `status`               | string   | Envelope status                   | [operation status enumerators](#operation-status-enumerators)
| `documents`                | list   | List of envelope documents                 | -                                                               |

### document object

| Field                              | Type     | Description                                      | Max Characters |
|-------------------------------------|----------|------------------------------------------------|-----------------|
| `document_type`                    | string   | Document type.                  | [document type enumerators](#document-type-enumerators)               |
| `signers`                    | list   | List of signers                             | -               |

### signer object

| Field                              | Type     | Description                                      | Max Characters |
|-------------------------------------|----------|------------------------------------------------|-----------------|
| `document_number`                    | string   | Signer's document.                 | 18                                                              |
| `signature_url`                    | string   | Signer's link                             | -               |
| `status`                    | string   | Signer's status.                  | [status enumerators](#status-enumerators)               |
| `name`                    | string   | Signer's name                             | -               |
| `email`                    | string   | Signer's email                             | -               |

## **operation-status Enumerators**

| Enum                           | Description                                                        |
|--------------------------------|----------------------------------------------------------------|
| `waiting_signature`            | Waiting for signatures from involved parties.                        |
| `signed`                       | Signature completed.                                        |
| `signature_rejected`           | Signature rejected.                                         |
| `canceled`                     | Operation canceled.                                           |

## **status Enumerators**

| Enum                           | Description                                                        |
|--------------------------------|----------------------------------------------------------------|
| `on_signature`            | Waiting for signatures from involved parties.                        |
| `analyzed`            | Signature completed via API.                        |
| `signed`                       | Signature completed.                                        |
| `signature_rejected`           | Signature rejected.                                         |
| `canceled`                     | Operation canceled.                                           |
| `created`                      | Signature created. |
| `submitted`                      | Sent to signer. |
| `sending_sign_receipt`                      | Sending simplified signature dossier. |
| `analyzing`                      | Signers under analysis. |
| `completed`                      | Signature completed. |
| `expired`                      | Signature expired. |
| `removed`                      | Signer removed. |
| `failed_waiting_for_manual_fix`                      | Signature creation failed, manual QI action required. |

## **document-type Enumerators**

| Enum                             | Description                                                        |
|----------------------------------|------------------------------------------------------------------|
| `contract`                       | Contract identifier.                                        |
| `ncom_pre_price`                 | Pre price commercial note.    |
| `ncom_pre_price_days`            | Pre price days commercial note.             |
| `ncom_pre_sac`                   | Pre sac commercial note.    |
| `ncom_post_sac_cdi`              | Post sac commercial note linked to CDI.                      |
| `ncom_post_sac_ipca`             | Post sac commercial note linked to IPCA.                     |
| `ncom_post_sac_igpm`             | Post sac commercial note linked to IGP-M.                    |
| `ncom_post_price_cdi`            | Post price commercial note linked to CDI.                     |
| `ncom_post_price_ipca`           | Post price commercial note linked to IPCA.                    |
| `ncom_post_price_igpm`           | Post price commercial note linked to IGP-M.                   |
| `ncom_post_price_days_cdi`       | Post price days commercial note linked to CDI.             |
| `ncom_post_price_days_ipca`      | Post price days commercial note linked to IPCA.            |
| `ncom_post_price_days_igpm`      | Post price days commercial note linked to IGP-M.           |
| `subscription_note`              | Subscription bulletin.                                               |
| `adhesion_term`                  | Adhesion term.                                                  |

---

# Operation Query by Key

URL: /en/documentation/escrituracao/emissao-de-notas/consulta/consulta-por-chave

This endpoint allows querying the complete details of a specific operation using its unique key.

---

## Operation Query (GET)

### Request
ENDPOINT /commercial_paper/operation/ OPERATION-KEY
METHOD GET

### Path Params

| Field           | Type   | Description                                                 | Characters |
|------------------|--------|----------------------------------------------------------|------------|
| `OPERATION-KEY`  | string | Unique operation key (UUID v4).                       | 36         |

---

### Response
STATUS 200

Response Body

```json
{
    "tenant_key": "13a6a1d5-7a3c-4627-a0a6-9fd746662ca4",
    "operation_key": "dc368e4d-c288-4971-ad8d-5c9c31616e74",
    "operation_type": "commercial_paper",
    "operation_status": "issued",
    "backoffice_analysis_status": "approved",
    "issuer_key": "9e08fd62-ce43-4c95-99e0-4386e980d618",
    "issuer_name": "Blue Logic",
    "issuer_document_number": "97.923.586/0001-06",
    "issuer_bank_account": {
        "account_type": "checking",
        "account_digit": "3",
        "account_branch": "0001",
        "account_number": "4464541",
        "financial_institution_ispb": "32402502",
        "financial_institution_code_number": "329"
    },
    "issuer_onboarding_approved": true,
    "issue_number": 1,
    "issue_series": 1,
    "contract_number": "0000000001",
    "issue_date": "2025-02-03",
    "financial_base_date": "2025-02-03",
    "commercial_paper_template_key": "68956441-d46c-44ed-93b9-b1806dd6ada9",
    "commercial_paper_document_key": "dc368e4d-c288-4971-ad8d-5c9c31616e74/commercial_paper/2cb87abc-8bdf-4df3-be98-b7afb53b14c8",
    "adhesion_term_template_key": "58743ab9-99bd-439a-93af-16e4c5fccd6f",
    "adhesion_term_document_key": "dc368e4d-c288-4971-ad8d-5c9c31616e74/adhesion_term/fe74eaed-2f44-45b4-b972-83fa222cbf1c",
    "envelope_signature_status": "signed",
    "envelope_key": "4d7f28b4-185f-482d-929e-d1af937cb27b",
    "envelope_signature_url": "https://sandbox.certifiqi.com.br/sign?batch-group=c4747fe6-2cc0-41a9-8972-84b44f8fff8a",
    "envelope_signed_files_key": "dc368e4d-c288-4971-ad8d-5c9c31616e74/signed_files",
    "financial": {
        "financial_base_date": "2025-02-03",
        "issue_quantity": 1000000,
        "unit_price": 1.0,
        "issue_amount": 1000000.0,
        "released_amount": 1000000.0,
        "cet": 5.0,
        "annual_cet": 79.59,
        "number_of_installments": 5,
        "prefixed_interest_rate": {
            "daily_rate": 0.0016053474,
            "annual_rate": 0.795856326,
            "monthly_rate": 0.05,
            "interest_base": "calendar_days_365"
        },
        "fine_delay_rate": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days_365"
        },
        "contract_fine_rate": 0.02,
        "financial_index": null,
        "post_fixed_interest_rate": null,
        "fees": [
            {
                "type": "internal",
                "amount": 2.0,
                "fee_type": "bookkeeping_fee",
                "fee_amount": 20000.0,
                "amount_type": "percentage"
            },
            {
                "type": "external",
                "amount": 5.0,
                "fee_type": "structuring_fee",
                "fee_amount": 50000.0,
                "amount_type": "percentage"
            }
        ],
        "installment_list": [
            {
                "installment_number": 1,
                "workdays": 20,
                "calendar_days": 30,
                "principal_amortization_unit_price": 0.18122484,
                "principal_amortization_amount": 181224.84138231,
                "interest_amount": 49298.45861769,
                "amount": 230523.3,
                "due_principal": 1000000.0,
                "due_interest": 0.0,
                "due_date": "2025-03-05",
                "has_interest": true
            },
            {
                "installment_number": 2,
                "workdays": 21,
                "calendar_days": 29,
                "principal_amortization_unit_price": 0.19153595,
                "principal_amortization_amount": 191535.95353305,
                "interest_amount": 38987.34646695,
                "amount": 230523.3,
                "due_principal": 818775.15861769,
                "due_interest": 0.0,
                "due_date": "2025-04-03",
                "has_interest": true
            },
            {
                "installment_number": 3,
                "workdays": 19,
                "calendar_days": 32,
                "principal_amortization_unit_price": 0.19748652,
                "principal_amortization_amount": 197486.52331007,
                "interest_amount": 33036.77668993,
                "amount": 230523.3,
                "due_principal": 627239.20508464,
                "due_interest": 0.0,
                "due_date": "2025-05-05",
                "has_interest": true
            },
            {
                "installment_number": 4,
                "workdays": 21,
                "calendar_days": 29,
                "principal_amortization_unit_price": 0.21005991,
                "principal_amortization_amount": 210059.90840452,
                "interest_amount": 20463.39159548,
                "amount": 230523.3,
                "due_principal": 429752.68177457,
                "due_interest": 0.0,
                "due_date": "2025-06-03",
                "has_interest": true
            },
            {
                "installment_number": 5,
                "workdays": 21,
                "calendar_days": 30,
                "principal_amortization_unit_price": 0.21969277,
                "principal_amortization_amount": 219692.77337005,
                "interest_amount": 10830.52662995,
                "amount": 230523.3,
                "due_principal": 219692.77337005,
                "due_interest": 0.0,
                "due_date": "2025-07-03",
                "has_interest": true
            }
        ]
    },
    "tags": [],
    "investor_list": [
        {
            "investor_key": "a1a75b66-6f7e-4bcc-9ff5-6f8adf7cae09",
            "investor_name": "Ultimate Cascade",
            "investor_document_number": "31.424.651/0001-32",
            "subscription_percentage": 100.0,
            "subscription_quantity": 1000000,
            "investor_onboarding_approved": true,
            "bank_account": {
                "account_type": "checking",
                "account_digit": "3",
                "account_branch": "0001",
                "account_number": "33400254",
                "financial_institution_ispb": "32402502",
                "financial_institution_code_number": "329"
            },
            "updated_at": null
        }
    ],
    "related_party_list": [
        {
            "related_party_key": "1ac83d43-41cb-4ad0-a7ca-add6c3a3171c",
            "name": "Blue Logic",
            "document_number": "97.923.586/0001-06",
            "role_type": "issuer",
            "is_active": true,
            "updated_at": null,
            "trading_name": "Blue Logic",
            "cnae_code": "47.21-1-02",
            "company_type": "ltda",
            "foundation_date": "2007-10-25",
            "person_type": "legal",
            "street": "Rua Romualdo de Souza Brito",
            "neighborhood": "Centro",
            "number": "89",
            "postal_code": "08150-470",
            "city": "São Paulo",
            "state": "SP",
            "complement": "Letra C",
            "signer_group_list": [
                {
                    "signer_group_key": "fa2cbede-a501-41e1-bf70-078bb0d4ac7b",
                    "minimum_required_signers": 1,
                    "signers": [
                        {
                            "name": "John Doe",
                            "email": "123.456.789-00@yopmail.com",
                            "phone_number": "+5511988887777",
                            "document_number": "123.456.789-00",
                            "is_group_mandatory": true
                        }
                    ]
                }
            ],
            "document_list": [],
            "contact_information_list": [
                {
                    "name": "John Doe",
                    "email": "123.456.789-00@yopmail.com",
                    "is_default": true,
                    "phone_number": "+5516982399722",
                    "document_number": "123.456.789-00",
                    "issuer_contact_information_key": "6e9714f4-d652-4ca0-89e2-13e9e2ec3414"
                }
            ]
        },
        {
            "related_party_key": "bab03c76-a12a-4d88-aaf8-70799e3b1b30",
            "name": "Ultimate Cascade",
            "document_number": "31.424.651/0001-32",
            "role_type": "investor",
            "is_active": true,
            "updated_at": null,
            "trading_name": "Ultimate Cascade",
            "cnae_code": "47.21-1-02",
            "company_type": "ltda",
            "foundation_date": "2007-10-25",
            "person_type": "legal",
            "street": "Rua Romualdo de Souza Brito",
            "neighborhood": "Centro",
            "number": "89",
            "postal_code": "08150-470",
            "city": "São Paulo",
            "state": "SP",
            "complement": "Letra C",
            "signer_group_list": [
                {
                    "signer_group_key": "ccb36b0b-40b5-42e0-bc41-0e8fce57f3ca",
                    "minimum_required_signers": 1,
                    "signers": [
                        {
                            "name": "John Doe",
                            "email": "123.456.789-00@yopmail.com",
                            "phone_number": "+5516982399722",
                            "document_number": "123.456.789-00",
                            "is_group_mandatory": true
                        }
                    ]
                }
            ],
            "document_list": [],
            "contact_information_list": [
                {
                    "name": "John Doe",
                    "email": "123.456.789-00@yopmail.com",
                    "is_default": true,
                    "phone_number": "+5511988887777",
                    "document_number": "123.456.789-00",
                    "investor_contact_information_key": "26299c0f-2127-45d4-b22e-f2b494d2f7ae"
                }
            ]
        }
    ],
    "collateral_list": [
        {
            "collateral_key": "d8fdb578-1e2a-4b79-8267-5b1763e56754",
            "collateral_type": "real_estate",
            "collateral_data": {
                "value": 999
            }
        }
    ],
    "metadata_list": [
        {
            "metadata_key": "convenio",
            "metadata_value": "12398129038"
        }
    ],
    "integralization_key": "d8fdb578-1e2a-4b79-8267-5b1763e56754",
    "security_key": "26299c0f-2127-45d4-b22e-f2b494d2f7ae"
}
```

### Response Body Params

| Field                             | Type     | Description                                            | Max Characters                                                 |
|-----------------------------------|----------|------------------------------------------------------|-----------------------------------------------------------------|
| `tenant_key` *                    | string   | Unique tenant key (UUID v4).                     | 36                                                              |
| `operation_key` *                 | string   | Unique operation key (UUID v4).                   | 36                                                              |
| `operation_type` *                | string   | Operation type. `commercial_paper`                 | -                                                               |
| `operation_status` *              | string   | Operation status.                                  | [operation_status enumerators](#operation_status-enumerators) |
| `issuer_key` *                    | string   | Unique issuer key (UUID v4).                    | 36                                                              |
| `issuer_name` *                   | string   | Issuer name.                                     | -                                                               |
| `issuer_document_number` *        | string   | Issuer document number (CNPJ).               | 18                                                              |
| `issuer_bank_account` *           | object   | Issuer banking data.                          | [bank_account object](#bank_account-object)                     |
| `issuer_onboarding_approved` *    | boolean  | Indicates if issuer onboarding was approved.      | -                                                               |
| `issue_number` *                  | integer  | Issue number.                                   | -                                                               |
| `issue_series` *                  | integer  | Issue series.                                    | -                                                               |
| `contract_number` *               | string   | Contract number.                                  | -                                                               |
| `issue_date` *                    | string   | Issue date (ISO 8601 format).                  | -                                                               |
| `financial_base_date` *           | string   | Operation financial base date (ISO 8601 format). | -                                                               |
| `commercial_paper_template_key` * | string   | Unique commercial paper template key.         | 36                                                              |
| `commercial_paper_document_key` * | string   | Commercial paper document key.              | -                                                               |
| `adhesion_term_template_key` *    | string   | Unique adhesion term template key.          | 36                                                              |
| `adhesion_term_document_key` *    | string   | Adhesion term document key.               | -                                                               |
| `investor_list` *                 | object   | Investor list.                               | [investor object](#investor-object)                             |

### bank_account object

| Field                              | Type     | Description                                      | Max Characters |
|-------------------------------------|----------|------------------------------------------------|-----------------|
| `account_type` *                    | string   | Account type (e.g. checking).                  | -               |
| `account_digit` *                    | string   | Bank account digit.                      | -               |
| `account_branch` *                    | string   | Bank branch.                              | -               |
| `account_number` *                    | string   | Bank account number.                      | -               |
| `financial_institution_ispb` *       | string   | Financial institution ISPB code.        | -               |
| `financial_institution_code_number` * | string   | Financial institution code.             | -               |

### financial object

| Field                              | Type     | Description                                                       | Max Characters                                                 |
|-------------------------------------|----------|-----------------------------------------------------------------|-----------------------------------------------------------------|
| `financial_base_date` *             | string   | Operation financial base date (ISO 8601 format).            | -                                                               |
| `issue_quantity` *                  | integer  | Total quantity of issued units.                          | -                                                               |
| `unit_price` *                      | float    | Issue unit price.                                      | -                                                               |
| `issue_amount` *                    | float    | Total issue amount.                                         | -                                                               |
| `released_amount` *                 | float    | Total released amount.                                           | -                                                               |
| `cet` *                             | float    | Total Effective Cost of the operation (%).                            | -                                                               |
| `annual_cet` *                      | float    | Annualized Total Effective Cost (%).                             | -                                                               |
| `number_of_installments` *          | integer  | Total number of operation installments.                           | -                                                               |
| `prefixed_interest_rate` *          | object   | Prefixed interest rate.                                        | [prefixed_interest_rate object](#prefixed_interest_rate-object) |
| `fine_delay_rate` *                 | object   | Delay fine rate                                        | [fine_delay_rate object](#fine_delay_rate-object).              | 
| `contract_fine_rate` *              | float    | Contractual fine rate (%).                                   | -                                                               |
| `financial_index`                   | string   | Financial reference index (if exists).                  | -                                                               |
| `post_fixed_interest_rate`          | object   | Post-fixed interest rate (if applicable).                        | -                                                               |
| `fees` *                            | array    | List of applicable fees.|  [fees object](#fees-object)                                                                           |
| `installment_list` *                | array    | Installment list. | [installment object](#installment-object)                                                                     |

### prefixed_interest_rate object

| Field                 | Type   | Description                                                  | Max Characters |
|-----------------------|--------|------------------------------------------------------------|-----------------|
| `daily_rate` *        | float  | Daily interest rate (%).                                  | -               |
| `annual_rate` *       | float  | Annualized interest rate (%).                              | -               |
| `monthly_rate` *      | float  | Monthly interest rate (%).                                  | -               |
| `interest_base` *     | string | Interest rate calculation base (`calendar_days_365`).    | -               |

## fine_delay_rate object

| Field               | Type   | Description                                        | Max Characters |
|---------------------|--------|--------------------------------------------------|-----------------|
| `monthly_rate` *    | float  | Monthly delay fine rate (%).             | -               |
| `interest_base` *   | string | Interest rate calculation base (`calendar_days_365`). | - |

## fees object

| Field          | Type    | Description                                      | Max Characters |
|---------------|---------|------------------------------------------------|-----------------|
| `type` *      | string  | Fee type (`internal`, `external`).         | -               |
| `amount` *    | float   | Applied fee percentage.                   | -               |
| `fee_type` *  | string  | Fee type.           | -               |
| `fee_amount` * | float  | Absolute value of applied fee.               | -               |
| `amount_type` * | string | Value type (`percentage`, `fixed`).        | -               |

## installment object

| Field                                     | Type    | Description                                                | Max Characters |
|-------------------------------------------|---------|----------------------------------------------------------|-----------------|
| `installment_number` *                    | integer | Installment number.                                       | -               |
| `workdays` *                               | integer | Number of business days until maturity.               | -               |
| `calendar_days` *                          | integer | Number of calendar days until maturity.            | -               |
| `principal_amortization_unit_price` *      | float   | Principal amortization unit value.              | -               |
| `principal_amortization_amount` *          | float   | Total principal amortization amount.                 | -               |
| `interest_amount` *                        | float   | Total interest amount for the installment.                        | -               |
| `amount` *                                 | float   | Total installment amount.                                  | -               |
| `due_principal` *                          | float   | Principal amount due after the installment.              | -               |
| `due_interest` *                           | float   | Interest amount due after the installment.                 | -               |
| `due_date` *                               | string  | Installment maturity date (ISO 8601 format).       | -               |
| `has_interest` *                           | boolean | Indicates if the installment has interest charges.           | -               |

## investor object

| Field                          | Type    | Description                                                            | Max Characters                              |
|--------------------------------|---------|----------------------------------------------------------------------|----------------------------------------------|
| `investor_key` *               | string  | Unique investor key (UUID v4).                                 | 36                                           |
| `investor_name` *              | string  | Investor name.                                                  | -                                            |
| `investor_document_number` *   | string  | Investor document number (CNPJ/CPF).                        | 18                                           |
| `subscription_percentage` *    | float   | Investor participation percentage in the operation.                | -                                            |
| `subscription_quantity` *      | integer | Number of units subscribed by the investor.                   | -                                            |
| `investor_onboarding_approved` * | boolean | Indicates if investor onboarding was approved.                   | -                                            |
| `bank_account` *               | object  | Investor banking information. | [bank_account object](#bank_account-object). |

## **operation_status enumerators**

| Enum                           | Description                                                        |
|--------------------------------|----------------------------------------------------------------|
| `in_filling`                   | Operation in filling phase.                             |
| `in_analysis`                  | Operation under analysis.                                           |
| `waiting_onboarding_approval`  | Waiting for issuer onboarding approval.                |
| `pending_signature_submission` | Waiting to be sent for signature.                             |
| `waiting_signature`            | Waiting for signatures from involved parties.                        |
| `issued`                       | Operation issued.                                             |
| `finished`                     | Operation completed.                                           |
| `signature_rejected`           | Signature rejected.                                         |
| `onboarding_reproved`          | Issuer onboarding rejected.                              |
| `compliance_reproved`          | Rejected by compliance.                                     |
| `canceled`                     | Operation canceled.                                           |

---

# Operation Query by Filters

URL: /en/documentation/escrituracao/emissao-de-notas/consulta/consulta-por-filtros

This endpoint allows querying **commercial paper** operations using optional filters.

---

## **Request**
ENDPOINT /commercial_paper/operation
METHOD GET

### **Query Params**

| Field                      | Type     | Description                                     | Required |
|----------------------------|----------|-----------------------------------------------|-------------|
| `issuer_document_number`   | string   | Issuer document number (CNPJ).        | No         |
| `investor_document_number` | string   | Investor document number (CPF/CNPJ). | No         |
| `operation_status`         | string   | Operation status.                           | **[operation_status enumerators](#operation_status-enumerators)** | No |
| `metadata_key`             | array    | Metadata key.                            | No         |
| `metadata_value`           | array    | Metadata value.                            | No         |

---

## **Response**
STATUS 200

Response Body

```json
{
    "data": [
        {
            "tenant_key": "13edaf06-9810-4689-b00b-2367274d1a14",
            "operation_key": "34bc5da7-89df-467d-93af-ed25184ab72e",
            "operation_type": "commercial_paper",
            "operation_status": "in_filling",
            "backoffice_analysis_status": "waiting_submission_for_analysis",
            "issuer_key": "7fbe9f89-b9ca-4445-85ac-6098da86bb56",
            "issuer_name": "Global Networks",
            "issuer_document_number": "73364815000123",
            "issue_number": 1,
            "contract_number": "0000000004"
        },
        {
            "tenant_key": "13edaf06-9810-4689-b00b-2367274d1a14",
            "operation_key": "f456ee66-5844-4ebc-b69d-365ce6df7138",
            "operation_type": "commercial_paper",
            "operation_status": "in_filling",
            "backoffice_analysis_status": "waiting_submission_for_analysis",
            "issuer_key": "7fbe9f89-b9ca-4445-85ac-6098da86bb56",
            "issuer_name": "Global Networks",
            "issuer_document_number": "73364815000123",
            "issue_number": 2,
            "contract_number": "0000000005"
        }
    ],
    "pagination": {
        "current_page": 1,
        "next_page": null,
        "rows_per_page": 100,
        "total_pages": 1,
        "total_rows": 2
    }
}
```

---

### **Response Body Params**

#### **Data Object**

| Field                        | Type     | Description                                                 | Max Characters |
|------------------------------|----------|-----------------------------------------------------------|-----------------|
| `tenant_key` *               | string   | Unique tenant key (UUID v4).                          | 36              |
| `operation_key` *            | string   | Unique operation key (UUID v4).                        | 36              |
| `operation_type` *           | string   | Operation type. Will always be `commercial_paper`.         | 50              |
| `operation_status` *         | string   | Current operation status. | **[operation_status enumerators](#operation_status-enumerators)** | 50 |
| `backoffice_analysis_status` | string   | Backoffice analysis status.                          | 50              |
| `issuer_key` *               | string   | Unique key of the issuer associated with the operation (UUID v4).    | 36              |
| `issuer_name` *              | string   | Name of the issuer associated with the operation.                     | 255             |
| `issuer_document_number` *   | string   | Issuer document number (CNPJ).                    | 14              |
| `issue_number` *             | integer  | Issue number associated with the operation.                   | -               |
| `contract_number` *          | string   | Contract number associated with the operation.                  | 20              |

#### **Pagination Object**

| Field             | Type     | Description                                                  |
|-------------------|----------|----------------------------------------------------------|
| `current_page` *  | integer  | Current page of the query.                               |
| `next_page`       | integer  | Next page, if it exists.                           |
| `rows_per_page` * | integer  | Number of records per page.                        |
| `total_pages` *   | integer  | Total pages available.                          |
| `total_rows` *    | integer  | Total records found for the applied filters. |

---

## **operation_status enumerators**

| Enum                           | Description                                                        |
|--------------------------------|----------------------------------------------------------------|
| `in_filling`                   | Operation in filling phase.                             |
| `in_analysis`                  | Operation under analysis.                                           |
| `waiting_onboarding_approval`  | Waiting for issuer onboarding approval.                |
| `pending_signature_submission` | Waiting to be sent for signature.                             |
| `waiting_signature`            | Waiting for signatures from involved parties.                        |
| `issued`                       | Operation issued.                                             |
| `finished`                     | Operation completed.                                           |
| `signature_rejected`           | Signature rejected.                                         |
| `onboarding_reproved`          | Issuer onboarding rejected.                              |
| `compliance_reproved`          | Rejected by compliance.                                     |
| `canceled`                     | Operation canceled.                                           |

---

# Next Issue Number Query by Issuer

URL: /en/documentation/escrituracao/emissao-de-notas/consulta/consulta-proximo-numero-emissao

This endpoint returns the next `issue_number` available for the issuer identified by `issuer_key`. The returned value considers the highest number already used in **non-canceled** operations of the issuer and the internal numbering control in the issuer configuration — the greater of the two is always returned.

If no numbering configuration exists yet for the issuer, it is created automatically with `current_issue_number = 1` and that value is returned.

---

## **Request**
ENDPOINT /commercial_paper/issuer/ ISSUER-KEY /issue_number
METHOD GET

### **Path Params**

| Field          | Type        | Description                                                                | Max Characters |
|----------------|-------------|----------------------------------------------------------------------------|----------------|
| `ISSUER-KEY` * | string/uuid | Unique identifier (UUID v4) of the issuer registered in Issuer Management. | 36             |

---

## **Response**
STATUS 200

Response Body

```json
{
    "issue_number": 42
}
```

---

### **Response Body Params**

| Field            | Type    | Description                                                                                                       | Max Characters |
|------------------|---------|-------------------------------------------------------------------------------------------------------------------|----------------|
| `issue_number` * | integer | Next issue number suggested for a new operation of the issuer. Starts at `1` for issuers with no prior operations or configuration. | -              |

---

# Send Signed Approval Minutes

URL: /en/documentation/escrituracao/emissao-de-notas/envio-ata-aprovacao

This endpoint allows sending externally signed approval minutes for SA or LTDA companies to the bookkeeping system by sending a base64 that will be analyzed and approved by the bookkeeper.

---

## Send Signed Operation (POST)

### Request
ENDPOINT /commercial_paper/operation/ OPERATION-KEY /upload_signed_document
METHOD POST

### Path Params

| Field           | Type   | Description                                                 | Characters |
|------------------|--------|----------------------------------------------------------|------------|
| `OPERATION-KEY`  | string | Unique operation key (UUID v4).                       | 36         |

---

### Request Body

Request Body

```json
{
    "contract_base64": "image_b64",
    "contract_type": "sa_minute"
}
```

### Response Body Params

| Field                        | Type     | Description                                                                                                                       | Max Characters |
|------------------------------|----------|---------------------------------------------------------------------------------------------------------------------------------|-----------------|
| `contract_type` *            | string   | Type of signed contract | **[contract_type Enumerators](#contract_type-enumerators)** |
| `contract_base64` *          | string   | Signed contract in base64

### contract_type Enumerators

| Enum                | Description                                  |
|--------------------|------------------------------------------|
| `sa_minute`        | Commercial paper issuance approval minutes for **SA** company.         |
| `coo_minute`      | Commercial paper issuance approval minutes for **COOPERATIVE** company.         |

### Response

The response body is a complete JSON of the updated operation.

---

---

# Send Signed Operation Documents

URL: /en/documentation/escrituracao/emissao-de-notas/envio-contratos-assinados

This endpoint allows sending externally signed contracts to the bookkeeping system by sending a base64 that will be analyzed and approved by the bookkeeper.

:::warning Warning
This endpoint should only be used for operations that use the **client_side** signature type or for sending the approval minutes for SA or Cooperative companies. For the flow via QI Sign or Certifiqi, contracts are generated normally.
:::

---

## Send Signed Operation (POST)

### Request
ENDPOINT /commercial_paper/operation/ OPERATION-KEY /upload_signed_document
METHOD POST

### Path Params

| Field           | Type   | Description                                                 | Characters |
|------------------|--------|----------------------------------------------------------|------------|
| `OPERATION-KEY`  | string | Unique operation key (UUID v4).                       | 36         |

---

### Request Body

Request Body

```json
{
    "contract_base64": "image_b64",
    "contract_type": "sa_minute"
}
```

### Response Body Params

| Field                        | Type     | Description                                                                                                                       | Max Characters |
|------------------------------|----------|---------------------------------------------------------------------------------------------------------------------------------|-----------------|
| `contract_type` *            | string   | Type of signed contract | **[contract_type Enumerators](#contract_type-enumerators)** |
| `contract_base64` *          | string   | Signed contract in base64

### contract_type Enumerators

| Enum                | Description                                  |
|--------------------|------------------------------------------|
| `commercial_paper` | Commercial paper constitutive term.       |
| `adhesion_term`    | Commercial paper adhesion term. |
| `sa_minute`        | Commercial paper issuance approval minutes for **SA** company.         |
| `ltda_minute`      | Commercial paper issuance approval minutes for **LTDA** company.         |

### Response

The response body is a complete JSON of the updated operation.

---

---

# Send Operation for Analysis

URL: /en/documentation/escrituracao/emissao-de-notas/envio-para-analise

This endpoint allows changing an operation's status to "in analysis", sending it to the compliance validation process by the bookkeeper.

---

## Send Operation for Analysis (PATCH)

### Request
ENDPOINT /commercial_paper/operation/ OPERATION-KEY
METHOD PATCH

### Path Params

| Field           | Type   | Description                                                 | Characters |
|------------------|--------|----------------------------------------------------------|------------|
| `OPERATION-KEY`  | string | Unique operation key (UUID v4).                       | 36         |

---

### Request Body

```json
{
  "operation_status": "in_analysis"
}
```

### Request Body Params

| Field             | Type     | Description                                                    | Required |
|--------------------|----------|------------------------------------------------------------|-------------|
| `operation_status` | string   | Operation status. Must be set to `in_analysis`. | Yes         |

---

### Response

The response body is a complete JSON of the updated operation.

---

---

# Send Operation for Signature

URL: /en/documentation/escrituracao/emissao-de-notas/envio-para-assinatura

:::warning Warning
Operations approved by compliance are automatically sent for signature periodically. This endpoint should only be used to perform an immediate send if necessary.
:::

---

## Send Operation for Signature (POST)

### Request
ENDPOINT /commercial_paper/operation/ OPERATION-KEY /send_to_signature
METHOD POST

### Path Params

| Field           | Type   | Description                                                 | Characters |
|------------------|--------|----------------------------------------------------------|------------|
| `OPERATION-KEY`  | string | Unique operation key (UUID v4).                       | 36         |

---

### Request Body

No request body is required.

---

### Response

The response body is a complete JSON of the updated operation.

---

---

# Change Adhesion Term Template

URL: /en/documentation/escrituracao/emissao-de-notas/geracao-minutas/alterar-template-ta

This endpoint allows changing the Adhesion Term template for a specific operation.

### **Request**
ENDPOINT /commercial_paper/operation/ OPERATION-KEY
METHOD PATCH

### **Path Params**

| Field            | Type   | Description                                     | Max Characters |
|------------------|--------|-----------------------------------------------|-----------------|
| `OPERATION-KEY` *  | string | Unique operation key (UUID v4).             | 36              |

---

Request Body

```json
{
  "adhesion_term_template_key": "48e2c597-f2ca-487e-9f06-2b628ecb831e"
}
```

### **Request Body Params**

| Field                                | Type     | Description                                        | Required |
|--------------------------------------|----------|--------------------------------------------------|-------------|
| `adhesion_term_template_key` *    | string   | Unique key of the new template to be used (UUID v4). | Yes |

## Response

The response body is a complete JSON of the updated operation.

---

# Change Commercial Paper Template

URL: /en/documentation/escrituracao/emissao-de-notas/geracao-minutas/alterar-template-tc

This endpoint allows changing the Commercial Paper template for a specific operation.

### **Request**
ENDPOINT /commercial_paper/operation/ OPERATION-KEY
METHOD PATCH

### **Path Params**

| Field            | Type   | Description                                     | Max Characters |
|------------------|--------|-----------------------------------------------|-----------------|
| `OPERATION-KEY` *  | string | Unique operation key (UUID v4).             | 36              |

---

Request Body

```json
{
  "commercial_paper_template_key": "48e2c597-f2ca-487e-9f06-2b628ecb831e"
}
```

### **Request Body Params**

| Field                                | Type     | Description                                        | Required |
|--------------------------------------|----------|--------------------------------------------------|-------------|
| `commercial_paper_template_key` *    | string   | Unique key of the new template to be used (UUID v4). | Yes |

## Response

The response body is a complete JSON of the updated operation.

---

# Available templates query

URL: /en/documentation/escrituracao/emissao-de-notas/geracao-minutas/consulta-minutas-disponiveis

This endpoint allows querying all templates available for use in the bookkeeping system.

### **Request**
ENDPOINT /document_template/document_template
METHOD GET

### **Query Params**

| Field                      | Type     | Description                                   | Required    |
|----------------------------|----------|-----------------------------------------------|-------------|
| `document_type`            | string   | Document type                                 | No          |

---

## Response

STATUS 200

Response Body

```json
{
  "data" : [
    {
      "document_key": "a846cc4a-b542-4f66-9823-b6d5458bd127",
      "document_type": "adhesion_term"
    },
    {
      "document_key": "a846cc4a-b542-4f66-9823-b6d5458bd127",
      "document_type": "commercial_paper"
    }
  ]
}
```

### **Response Body Params**

| Field            | Type     | Description                                      | Max Characters |
|------------------|----------|------------------------------------------------|----------------|
| `document_key` * | string   | Unique template key (UUID v4).                | 36             |
| `document_type` * | string   | Type of generated document.                    | 50             |

---

# Preview Adhesion Term

URL: /en/documentation/escrituracao/emissao-de-notas/geracao-minutas/gerar-minuta-adesao

This endpoint allows previewing an Adhesion Term draft for a specific operation using a predefined template.

---
## **Request**
ENDPOINT /commercial_paper/operation/ OPERATION-KEY /preview_adhesion_term
METHOD POST

### **Path Params**

| Field            | Type   | Description                                     | Max Characters |
|------------------|--------|-----------------------------------------------|-----------------|
| `OPERATION-KEY` *  | string | Unique operation key (UUID v4).             | 36              |

Request Body

```json
{
  "template_key": "48e2c597-f2ca-487e-9f06-2b628ecb831e"
}
```

### **Request Body Params**

| Field                                | Type     | Description                                        | Required |
|--------------------------------------|----------|--------------------------------------------------|-------------|
| `template_key` *    | string   | Unique key of the new template to be used (UUID v4). | Yes |

## **Response**
STATUS 201

Response Body

```json
{
  "operation_key": "a846cc4a-b542-4f66-9823-b6d5458bd127",
  "document_type": "adhesion_term",
  "document_base64": "dGVzdGVfZG9jdW1lbnRfYmFzZTY0"
}
```

### **Response Body Params**

| Field            | Type     | Description                                        | Max Characters |
|------------------|----------|------------------------------------------------|-----------------|
| `operation_key` * | string   | Unique operation key (UUID v4).            | 36              |
| `document_type` * | string   | Type of generated document. Will always be `adhesion_term`. | 50              |
| `document_base64` * | string   | Generated document content, encoded in Base64. | - |

---

# Preview Commercial Paper Term

URL: /en/documentation/escrituracao/emissao-de-notas/geracao-minutas/gerar-minuta-contrato

This endpoint allows generating a Commercial Paper Term draft for a specific operation using a predefined template.

---

## **Request**
ENDPOINT /commercial_paper/operation/ OPERATION-KEY /preview_commercial_paper
METHOD POST

### **Path Params**

| Field            | Type   | Description                                     | Max Characters |
|------------------|--------|-----------------------------------------------|-----------------|
| `OPERATION-KEY` *  | string | Unique operation key (UUID v4).             | 36              |

Request Body

```json
{
  "template_key": "48e2c597-f2ca-487e-9f06-2b628ecb831e"
}
```

### **Request Body Params**

| Field                                | Type     | Description                                        | Required |
|--------------------------------------|----------|--------------------------------------------------|-------------|
| `template_key` *    | string   | Unique key of the new template to be used (UUID v4). | Yes |

## **Response**
STATUS 201

Response Body

```json
{
  "operation_key": "a846cc4a-b542-4f66-9823-b6d5458bd127",
  "document_type": "commercial_paper",
  "document_base64": "dGVzdGVfZG9jdW1lbnRfYmFzZTY0"
}
```

### **Response Body Params**

| Field            | Type     | Description                                        | Max Characters |
|------------------|----------|------------------------------------------------|-----------------|
| `operation_key` * | string   | Unique operation key (UUID v4).            | 36              |
| `document_type` * | string   | Type of generated document. Will always be `commercial_paper`. | 50              |
| `document_base64` * | string   | Generated document content, encoded in Base64. | - |

---

# Introduction to Commercial Paper Issuance

URL: /en/documentation/escrituracao/emissao-de-notas/inicio

Commercial papers are financial instruments used by companies to raise funds directly in the market. This process involves several stages, from registering issuers and investors, through defining financial conditions, to the formal issuance of securities. Each stage is crucial to ensure regulatory compliance and efficiency in the fundraising process.

---

## Overview of the Issuance Process

The commercial paper issuance process is structured in several stages that ensure transparency, security, and control. Below are the main steps of the process:

1. **Issuer and Investor Registration**  
   Companies that want to issue commercial papers and investors interested in acquiring these securities need to be registered in the system. Registration includes detailed information, such as documents and bank accounts.

2. **Operation Conditions Definition**  
   The issuer defines the financial conditions of the operation, including interest rates, number of installments, issuance and maturity dates, as well as any fees and charges.

3. **Simulation**  
   Before formal issuance, a simulation is performed to calculate issuance values, installment flow, and other financial details. This stage allows adjusting operation conditions according to the needs of issuers and investors.

4. **Related Parties Registration and Documentation**  
   Includes registering involved parties, such as guarantors and co-obligors, and sending relevant documents, such as contracts and terms.

5. **Document Generation and Signing**  
   Drafts of main documents are generated, such as the **Adhesion Term** and **Constitutive Term**. After approval, documents are sent for electronic signature.

6. **Submission for Analysis and Approval**  
   The operation is submitted for compliance and back-office analysis, ensuring that all regulatory and contractual requirements are met.

7. **Formal Issuance and Registration**  
   After approval, commercial papers are formally issued and made available to investors.

Starting from the next pages, we will explore in detail each stage of the commercial paper issuance process, including endpoints and practical examples to integrate your system with the API.

---

# Financial Conditions Simulation

URL: /en/documentation/escrituracao/emissao-de-notas/simulacao

This endpoint allows simulating the financial conditions and payment flow of an operation.

---

## Request
ENDPOINT /commercial_paper/simulation
METHOD POST

### Request Body

**Released Amount**

```json
{
    "interest_type": "pre_price_days",
    "financial_base_date": "2025-01-20",
    "released_amount": 1000000,
    "number_of_installments": 5,
    "prefixed_interest_rate": {
        "interest_base": "calendar_days_365", 
        "monthly_rate": 0.05
    },
    "fine_delay_rate": {
        "interest_base": "calendar_days_365", 
        "monthly_rate": 0.01
    },
    "contract_fine_rate": 0.02,
    "fees": [
        {
            "amount": 5, 
            "amount_type": "percentage", 
            "fee_type": "structuring_fee",
            "type": "external"
        }
    ]
}
```
  

**Informing Installments**

```json
{
    "interest_type": "pre_price_days",
    "financial_base_date": "2025-01-20",
    "number_of_installments": 2,
    "installments": [
        {
            "due_date": "2026-01-01",
            "amount": 500000
        },
        {
            "due_date": "2026-02-01",
            "amount": 502004.01
        }
    ],
    "prefixed_interest_rate": {
        "interest_base": "calendar_days_365", 
        "monthly_rate": 0.05
    },
    "fine_delay_rate": {
        "interest_base": "calendar_days_365", 
        "monthly_rate": 0.01
    },
    "contract_fine_rate": 0.02,
    "fees": [
        {
            "amount": 5,
            "amount_type": "percentage",
            "fee_type": "bookkeeping_fee"
        }
    ],
}
```

### Request Body Params

| Field                        | Type     | Description                                                                                                                       | Max Characters |
|------------------------------|----------|---------------------------------------------------------------------------------------------------------------------------------|-----------------|
| `interest_type` *            | string   | Applied interest type. | **[interest_type Enumerators](#interest_type-enumerators)** |
| `financial_base_date` *      | string   | Operation base date (format "YYYY-MM-DD").                                                                                   | -               |
| `released_amount` *          | number   | Total amount released in the operation.                                                                                               | -               |
| `number_of_installments` *   | integer  | Total number of installments.                                                                                                       | -               |
| `prefixed_interest_rate` *   | object   | Object containing prefixed interest rate details.                                                                            | **[prefixed_interest_rate Object](#prefixed_interest_rate-object)** |
| `fine_delay_rate` *          | object   | Object containing delay fine details.                                                                                   | **[fine_delay_rate Object](#fine_delay_rate-object)** |
| `contract_fine_rate` *       | number   | Contractual fine applied in percentage.                                                                                       | -               |
| `fees`                       | array    | List of fees associated with the operation.                                                                                           | **[fees Object](#fees-object)** |

### prefixed_interest_rate Object

| Field                        | Type     | Description                                                                                                                       | Max Characters |
|------------------------------|----------|---------------------------------------------------------------------------------------------------------------------------------|-----------------|
| `interest_base` *            | string   | Calculation base for interest. | **[interest_base Enumerators](#interest_base-enumerators)** |
| `monthly_rate` *             | number   | Applied monthly interest rate.                                                                                                  | -               |

### fine_delay_rate Object

| Field                        | Type     | Description                                                                                                                       | Max Characters |
|------------------------------|----------|---------------------------------------------------------------------------------------------------------------------------------|-----------------|
| `interest_base` *            | string   | Base for fine calculation. | **[interest_base Enumerators](#interest_base-enumerators)** |
| `monthly_rate` *             | number   | Monthly fine rate.                                                                                                          | -               |

### fees Object

| Field                        | Type     | Description                                                                                                                       | Max Characters |
|------------------------------|----------|---------------------------------------------------------------------------------------------------------------------------------|-----------------|
| `amount` *                   | number   | Applied fee value.                                                                                                        | -               |
| `amount_type` *              | string   | Fee value type. | **[amount_type Enumerators](#amount_type-enumerators)** |
| `fee_type` *                 | string   | Fee type. | **[fee_type Enumerators](#fee_type-enumerators)** |
| `type` *                     | string   | Fee recipient. | **[fee_recipient Enumerators](#fee_recipient-enumerators)** |

### interest_type Enumerators

| Enum                | Description                                  |
|--------------------|------------------------------------------|
| `pre_price`       | Prefixed interest in Price model.       |
| `pre_price_days`  | Prefixed interest in Price model by calendar days. |
| `pre_sac`         | Prefixed interest in SAC model.         |
| `post_sac`        | Post-fixed interest in SAC model.         |

### interest_base Enumerators

| Enum                | Description                                  |
|--------------------|------------------------------------------|
| `calendar_days`    | Calendar days base.                   |
| `calendar_days_365`| 365 calendar days base.               |
| `workdays`        | Business days base.                      |

### amount_type Enumerators

| Enum         | Description                   |
|-------------|---------------------------|
| `percentage` | Percentage value.       |
| `absolute`   | Absolute value in currency.   |

### Enumeradores fee_type

| Enum                                | Descrição                                 |
|-------------------------------------|-------------------------------------------|
| `bookkeeping_fee`                   | Taxa de escrituração financiada.          |
| `structuring_fee`                   | Taxa de estruturação financiada.          |

### fee_recipient Enumerators

| Enum       | Description                                               |
|-----------|-------------------------------------------------------|
| `internal` | Fee paid to the bookkeeper.                           |
| `external` | Rebate paid to the originator.                           |

## Response
STATUS 200

Response Body

```json
{
    "financial_base_date": "2025-01-20",
    "issue_amount": 1075268.82,
    "released_amount": 1000000.0,
    "issue_quantity": 1075268,
    "unit_price": 1.00000076,
    "cet": 7.7,
    "annual_cet": 143.55,
    "number_of_installments": 5,
    "prefixed_interest_rate": {
        "interest_base": "calendar_days_365",
        "monthly_rate": 0.05,
        "daily_rate": 0.0016053474,
        "annual_rate": 0.795856326
    },
    "fees": [
        {
            "amount": 2.0,
            "fee_amount": 21505.38,
            "amount_type": "percentage",
            "fee_type": "bookkeeping_fee",
            "type": "internal"
        },
        {
            "amount": 5.0,
            "fee_amount": 53763.44,
            "amount_type": "percentage",
            "fee_type": "structuring_fee",
            "type": "external"
        }
    ],
    "installments": [
        {
            "installment_number": 1,
            "workdays": 23,
            "calendar_days": 31,
            "principal_amortization_amount": 193292.79655634,
            "principal_amortization_unit_price": 0.17976244,
            "interest_amount": 54820.37344366,
            "amount": 248113.17,
            "due_principal": 1075268.82,
            "due_interest": 0.0,
            "due_date": "2025-02-20",
            "has_interest": true
        },
        {
            "installment_number": 2,
            "workdays": 18,
            "calendar_days": 28,
            "principal_amortization_amount": 207597.32873049,
            "principal_amortization_unit_price": 0.19306566,
            "interest_amount": 40515.84126951,
            "amount": 248113.17,
            "due_principal": 881976.02344366,
            "due_interest": 0.0,
            "due_date": "2025-03-20",
            "has_interest": true
        },
        {
            "installment_number": 3,
            "workdays": 21,
            "calendar_days": 33,
            "principal_amortization_amount": 211453.91638185,
            "principal_amortization_unit_price": 0.19665229,
            "interest_amount": 36659.25361815,
            "amount": 248113.17,
            "due_principal": 674378.69471317,
            "due_interest": 0.0,
            "due_date": "2025-04-22",
            "has_interest": true
        },
        {
            "installment_number": 4,
            "workdays": 19,
            "calendar_days": 28,
            "principal_amortization_amount": 226847.52746545,
            "principal_amortization_unit_price": 0.21096836,
            "interest_amount": 21265.64253455,
            "amount": 248113.17,
            "due_principal": 462924.77833132,
            "due_interest": 0.0,
            "due_date": "2025-05-20",
            "has_interest": true
        },
        {
            "installment_number": 5,
            "workdays": 22,
            "calendar_days": 31,
            "principal_amortization_amount": 236077.25086587,
            "principal_amortization_unit_price": 0.21955201,
            "interest_amount": 12035.91913413,
            "amount": 248113.17,
            "due_principal": 236077.25086587,
            "due_interest": 0.0,
            "due_date": "2025-06-20",
            "has_interest": true
        }
    ],
    "fine_delay_rate": {
        "interest_base": "calendar_days_365",
        "monthly_rate": 0.01
    },
    "contract_fine_rate": 0.02
}
```

### Response Body Params

| Field                        | Type     | Description                                                                                               | Max Characters |
|------------------------------|----------|---------------------------------------------------------------------------------------------------------|-----------------|
| `financial_base_date` *      | string   | Operation financial base date (format "YYYY-MM-DD").                                                | -               |
| `issue_amount` *             | number   | Total issued amount of the operation.                                                                        | -               |
| `released_amount` *          | number   | Net amount released in the operation.                                                                     | -               |
| `issue_quantity` *           | integer  | Total quantity of units issued.                                                                  | -               |
| `unit_price` *               | number   | Unit price of the issuance.                                                                              | -               |
| `cet` *                      | number   | Total Effective Cost (CET) in percentage.                                                                | -               |
| `annual_cet` *               | number   | Annual CET in percentage.                                                                                | -               |
| `number_of_installments` *   | integer  | Total number of installments.                                                                               | -               |
| `prefixed_interest_rate` *   | object   | Object containing prefixed interest rate details.                                                    | **[prefixed_interest_rate Object](#prefixed_interest_rate-object)** |
| `fees`                       | array    | List of fees associated with the operation.                                                                   | **[fees Object](#fees-object)** |
| `installments`               | array    | List of installment details generated in the operation.                                                     | **[installments Object](#installments-object)** |
| `fine_delay_rate` *          | object   | Object containing delay fine details.                                                           | **[fine_delay_rate Object](#fine_delay_rate-object)** |
| `contract_fine_rate` *       | number   | Contractual fine applied in percentage.                                                                | -               |

### prefixed_interest_rate Object

| Field          | Type     | Description                                                   | Max Characters |
|---------------|----------|------------------------------------------------------------|-----------------|
| `interest_base` * | string  | Calculation base for interest. | **[interest_base Enumerators](#interest_base-enumerators)** |
| `monthly_rate` *  | number  | Applied monthly interest rate.                            | -               |
| `daily_rate` *    | number  | Applied daily interest rate.                            | -               |
| `annual_rate` *   | number  | Applied annual interest rate.                             | -               |

### fees Object

| Field      | Type    | Description                                                  | Max Characters |
|------------|--------|------------------------------------------------------------|-----------------|
| `amount` *  | number | Percentage value of the fee.                                | -               |
| `fee_amount` * | number | Monetary value corresponding to the fee.                   | -               |
| `amount_type` * | string  | Fee value type. | **[amount_type Enumerators](#amount_type-enumerators)** |
| `fee_type` * | string  | Fee type. | **[fee_type Enumerators](#fee_type-enumerators)** |
| `type` * | string  | Fee recipient. | **[fee_recipient Enumerators](#fee_recipient-enumerators)** |

### installments Object

| Field                       | Type     | Description                                              |
|----------------------------|----------|--------------------------------------------------------|
| `installment_number` *      | integer  | Installment number.                                    |
| `workdays` *               | integer  | Business days until installment due date.               |
| `calendar_days` *          | integer  | Calendar days until installment due date.            |
| `principal_amortization_amount` * | number  | Principal amortized amount.                         |
| `principal_amortization_unit_price` * | number  | Amortized amount per unit.                          |
| `interest_amount` *        | number   | Interest amount applied in the installment.                 |
| `amount` *                 | number   | Total installment amount.                               |
| `due_date` *               | string   | Installment due date (format "YYYY-MM-DD"). |

---

# Register Debenture Operation

URL: /en/documentation/escrituracao/emissao-debentures/cadastro-operacao

This endpoint creates a complete Debenture operation in a single request.

:::info
The `financial` object is **required** and must be sent already calculated, as this endpoint does not run the financial simulation. The issuer and its bank account must be previously registered.
:::

---

## **Request**

ENDPOINT /debenture/create_operation
METHOD POST

The request body ranges from a **payload with the required fields** (including the financial object) to a **complete payload** that also includes related parties. See both variations below.

Payload with the required fields

```json
{
    "tenant_key": "1d29d606-649a-487f-af1c-c0f5cb3e9814",
    "issuer_key": "48e2c597-f2ca-487e-9f06-2b628ecb831e",
    "issue_number": 10,
    "issue_series": 1,
    "issue_date": "2025-01-20",
    "investors": [
        {
            "investor_key": "70b1b638-ca56-4eb3-9a88-2fd5ffd077a7",
            "bank_account": {
                "account_number": "33400254",
                "account_digit": "3",
                "account_branch": "0001",
                "financial_institution_code_number": "329",
                "financial_institution_ispb": "32402502",
                "account_type": "checking"
            }
        }
    ],
    "financial": {
        "financial_base_date": "2025-01-20",
        "interest_type": "pre_price_days",
        "issue_amount": 1075268.82,
        "issue_quantity": 1075268,
        "unit_price": 1.0000007626,
        "released_amount": 1075268.82,
        "cet": 7.7,
        "annual_cet": 143.55,
        "first_due_date": "2025-02-20",
        "number_of_installments": 5,
        "prefixed_interest_rate": {
            "interest_base": "calendar_days_365",
            "monthly_rate": 0.05,
            "daily_rate": 0.0016053474,
            "annual_rate": 0.795856326
        },
        "fine_delay_rate": { "interest_base": "calendar_days_365", "monthly_rate": 0.01 },
        "contract_fine_rate": 0.02,
        "fees": [
            { "amount": 2.0, "fee_amount": 21505.38, "amount_type": "percentage", "fee_type": "bookkeeping_fee", "type": "internal" }
        ],
        "installments": [
            {
                "installment_number": 1,
                "due_date": "2025-02-20",
                "amount": 248113.17,
                "principal_amortization_amount": 193292.79655634,
                "principal_amortization_unit_price": 1.02,
                "interest_amount": 0.0,
                "calendar_days": 31,
                "workdays": 23
            }
        ]
    }
}
```

Complete payload (with related parties)

```json
{
    "tenant_key": "1d29d606-649a-487f-af1c-c0f5cb3e9814",
    "issuer_key": "48e2c597-f2ca-487e-9f06-2b628ecb831e",
    "issue_number": 10,
    "issue_series": 1,
    "contract_number": "DEB-2025-0001",
    "issue_date": "2025-01-20",
    "signature_method": "certifiqi",
    "investors": [
        {
            "investor_key": "70b1b638-ca56-4eb3-9a88-2fd5ffd077a7",
            "subscription_percentage": 100,
            "bank_account": {
                "account_number": "33400254",
                "account_digit": "3",
                "account_branch": "0001",
                "financial_institution_code_number": "329",
                "financial_institution_ispb": "32402502",
                "account_type": "checking"
            }
        }
    ],
    "financial": {
        "financial_base_date": "2025-01-20",
        "interest_type": "pre_price_days",
        "issue_amount": 1075268.82,
        "issue_quantity": 1075268,
        "unit_price": 1.0000007626,
        "released_amount": 1075268.82,
        "cet": 7.7,
        "annual_cet": 143.55,
        "first_due_date": "2025-02-20",
        "number_of_installments": 5,
        "prefixed_interest_rate": {
            "interest_base": "calendar_days_365",
            "monthly_rate": 0.05,
            "daily_rate": 0.0016053474,
            "annual_rate": 0.795856326
        },
        "fine_delay_rate": { "interest_base": "calendar_days_365", "monthly_rate": 0.01 },
        "contract_fine_rate": 0.02,
        "fees": [
            { "amount": 2.0, "fee_amount": 21505.38, "amount_type": "percentage", "fee_type": "bookkeeping_fee", "type": "internal" }
        ],
        "installments": [
            {
                "installment_number": 1,
                "due_date": "2025-02-20",
                "amount": 248113.17,
                "principal_amortization_amount": 193292.79655634,
                "principal_amortization_unit_price": 1.02,
                "interest_amount": 0.0,
                "calendar_days": 31,
                "workdays": 23
            }
        ]
    },
    "related_party_list": [
        {
            "person_type": "legal",
            "name": "Garantidora S.A.",
            "document_number": "12.345.678/0001-90",
            "trading_name": "Garantidora",
            "cnae_code": "64.62-0-00",
            "company_type": "sa",
            "foundation_date": "2010-05-01",
            "street": "Av. Paulista",
            "number": "1000",
            "neighborhood": "Bela Vista",
            "postal_code": "01310-100",
            "city": "São Paulo",
            "state": "SP",
            "role_type": "guarantor"
        },
        {
            "person_type": "natural",
            "name": "João da Silva",
            "document_number": "123.456.789-00",
            "street": "Rua das Flores",
            "number": "123",
            "neighborhood": "Centro",
            "postal_code": "01001-000",
            "city": "São Paulo",
            "state": "SP",
            "role_type": "solidary_debtor",
            "is_pep": false
        }
    ]
}
```

### **Request Body Params**

| Field               | Type    | Description                                          | Max Characters             |
| ------------------- | ------- | --------------------------------------------------- | -------------------------- |
| `tenant_key` *      | string  | Unique tenant key.                                  | -                          |
| `issuer_key` *      | string  | Unique issuer key (previously registered).          | -                          |
| `issue_number` *    | integer | Issue number.                                       | -                          |
| `issue_series` *    | integer | Issue series.                                       | -                          |
| `issue_date` *      | string  | Operation issue date (format "YYYY-MM-DD").         | -                          |
| `signature_method`  | string  | Signature method used in the operation. Optional; when omitted, defaults to `certifiqi`. | **[signature_method Enumerators](#signature_method-enumerators)** |
| `investors` *       | array   | List of involved investors.                         | **investors Object**       |
| `financial` *       | object  | Already-calculated operation financial data.        | **financial Object**       |
| `contract_number`   | string  | Contract number.                                    | -                          |
| `related_party_list` | array  | Operation related parties (guarantors, debtors, etc.). | **related_party Object** |

### investors Object

| Field                       | Type   | Description                                               |
| --------------------------- | ------ | -------------------------------------------------------- |
| `investor_key` *            | string | Unique investor key (previously registered).             |
| `bank_account` *            | object | Investor bank account (**bank_account Object**).         |
| `subscription_percentage`   | number | Subscription percentage.                                 |
| `subscription_quantity`     | number | Subscribed quantity.                                     |

### bank_account Object

| Field                                 | Type   | Description                                                   |
| ------------------------------------- | ------ | ------------------------------------------------------------- |
| `account_number` *                    | string | Bank account number.                                         |
| `account_digit` *                     | string | Bank account digit.                                          |
| `account_branch` *                    | string | Bank account branch.                                         |
| `financial_institution_code_number`   | string | Financial institution code.                                  |
| `financial_institution_ispb` *        | string | Financial institution ISPB code.                             |
| `account_type` *                      | string | Account type (`checking`, `savings`, `salary`, `payment`).  |

### financial Object

| Field                       | Type    | Description                                  |
| --------------------------- | ------- | -------------------------------------------- |
| `financial_base_date` *     | string  | Financial base date (format "YYYY-MM-DD").   |
| `interest_type` *           | string  | Interest type.                               |
| `issue_amount`              | number  | Total issued amount.                         |
| `issue_quantity`            | integer | Quantity of issued units.                    |
| `unit_price`                | number  | Unit price of the issuance.                  |
| `released_amount`           | number  | Net released amount.                         |
| `cet` / `annual_cet`        | number  | Total Effective Cost (monthly and annual), in percentage. |
| `number_of_installments` *  | integer | Number of installments.                      |
| `prefixed_interest_rate` *  | object  | Prefixed interest rate.                      |
| `fine_delay_rate`           | object  | Delay fine rate.                             |
| `contract_fine_rate`        | number  | Contractual fine in percentage.              |
| `fees`                      | array   | List of fees.                                |
| `installments`              | array   | List of already-calculated installments.     |

### related_party Object

Each item in `related_party_list` represents a party involved in the operation.

| Field             | Type    | Description                                                   |
| ----------------- | ------- | ------------------------------------------------------------ |
| `person_type` *   | string  | Person type (`natural` for individuals, `legal` for companies). |
| `name` *          | string  | Related party name.                                          |
| `document_number` * | string | CPF (individual) or CNPJ (company).                         |
| `role_type` *     | string  | Party role in the operation. **[role_type Enumerators](#role_type-enumerators)** |
| `street` *        | string  | Street.                                                     |
| `number` *        | string  | Address number.                                            |
| `neighborhood`    | string  | Neighborhood.                                              |
| `postal_code` *   | string  | Postal code (format "00000-000").                          |
| `city` *          | string  | City.                                                      |
| `state` *         | string  | State (2 letters).                                        |
| `complement`      | string  | Address complement.                                       |
| `is_pep`          | boolean | (Individual) Whether the person is a Politically Exposed Person. |
| `marital_status`  | string  | (Individual) Marital status.                              |
| `property_system` | string  | (Individual) Property regime.                             |
| `birthdate`       | string  | (Individual) Date of birth.                               |
| `mother_name`     | string  | (Individual) Mother's name.                               |
| `occupation`      | string  | (Individual) Occupation.                                  |
| `trading_name`    | string  | (Company) Trading name.                                   |
| `cnae_code`       | string  | (Company) CNAE code (format "00.00-0-00").                |
| `company_type`    | string  | (Company) Company type.                                   |
| `foundation_date` | string  | (Company) Foundation date.                                |

:::warning Attention
Required fields vary by `person_type`:
- **Individual (`natural`)**: in addition to the common fields, `is_pep` is required.
- **Company (`legal`)**: in addition to the common fields, `trading_name`, `cnae_code`, `company_type` and `foundation_date` are required.
:::

### role_type Enumerators

| Enum | Description |
|------|-------------|
| `issuer` | Issuer. |
| `investor` | Investor. |
| `cosigner` | Co-obligor. |
| `fiduciary_debtor` | Fiduciary debtor. |
| `solidary_debtor` | Joint debtor. |
| `guarantor` | Guarantor (aval). |
| `bonafide_depositary` | Bona fide depositary. |
| `intervening_guarantor` | Intervening guarantor. |
| `intervening_consentor` | Intervening consentor. |
| `intervening_discharger` | Intervening discharger. |
| `assignor` | Assignor. |
| `endorser` | Endorser. |
| `consulting` | Consulting. |
| `fund_administrator` | Fund administrator. |
| `fund_representative` | Fund representative. |
| `company_representative` | Company representative. |
| `attestant` | Attestant. |
| `debtor` | Debtor. |
| `bestowal` | Grantor. |
| `manager` | Manager. |

:::tip
Collateral and underlying assets are sent through a **separate endpoint**, after the operation is created. See the **Send collateral** page in this section.
:::

### signature_method Enumerators

| Enum | Description |
|------|-------------|
| `certifiqi` | Default value. The operation is sent to the signature service; a signature envelope is created and the client receives the signature URL (`signature_url`). |
| `qi_sign` | The operation is sent to the signature service; a signature envelope is created and the client receives the signature URL (`signature_url`). Also allows querying the operation's signers. |

## **Response**

STATUS 201

Response Body

```json
{
    "tenant_key": "1d29d606-649a-487f-af1c-c0f5cb3e9814",
    "operation_key": "a846cc4a-b542-4f66-9823-b6d5458bd127",
    "operation_status": "finished",
    "issuer_key": "48e2c597-f2ca-487e-9f06-2b628ecb831e",
    "issuer_name": "Dynamic Enterprises",
    "issuer_document_number": "28980395000155",
    "issue_number": 10,
    "issue_series": 1,
    "related_party_list": [ ... ],
    "financial": { ... }
}
```

The response returns the complete JSON of the created operation, including `operation_key`, the investor and related-party lists, and the calculated financial object.

---

# Send Document

URL: /en/documentation/escrituracao/emissao-debentures/envio-documento

This endpoint **uploads a document** and returns the `document_key` that identifies it. This `document_key` is used to reference documents in other endpoints — for example, the `collateral_document_key` and the `additional_documents` of [Send collateral](./envio-garantia.md).

---

## **Request**

ENDPOINT /debenture/upload
METHOD POST

Request Body

```json
{
    "document_base64": "string_b64"
}
```

### **Request Body Params**

| Field             | Type   | Description                              | Required |
|-------------------|--------|------------------------------------------|----------|
| `document_base64` * | string | Base64 encoded content of the document. | Yes      |
| `document_name`   | string | Document name.                           | -        |

## **Response**

STATUS 201

Response Body

```json
{
    "document_key": "25dd10b8-7364-4abe-b0e8-0e419b04194b"
}
```

### **Response Body Params**

| Field          | Type   | Description                            | Max Characters |
|----------------|--------|----------------------------------------|----------------|
| `document_key` * | string | Unique key of the uploaded document (UUID v4). | 36     |

---

---

# Send Operation External Document

URL: /en/documentation/escrituracao/emissao-debentures/envio-documento-externo

This endpoint allows sending externally signed documents to the bookkeeping system by sending a base64 that will be analyzed and approved by the bookkeeper.

:::warning Warning
This endpoint should only be used for operations that use the **client_side** signature type or for sending the approval minutes for SA or Cooperative companies. For the flow via QI Sign or Certifiqi, contracts are generated normally.
:::

---

## Send Signed Document (POST)

### Request

ENDPOINT /debenture/operation/ OPERATION-KEY /upload_signed_document
METHOD POST

### Path Params

| Field           | Type   | Description                         | Characters |
|-----------------|--------|-------------------------------------|------------|
| `OPERATION-KEY` | string | Unique operation key (UUID v4).     | 36         |

---

### Request Body

Request Body

```json
{
    "contract_base64": "image_b64",
    "contract_type": "debenture"
}
```

### Request Body Params

| Field               | Type   | Description                | Max Characters                                              |
|---------------------|--------|----------------------------|------------------------------------------------------------|
| `contract_type` *   | string | Type of signed document.   | **[contract_type Enumerators](#contract_type-enumerators)** |
| `contract_base64` * | string | Signed document in base64. | -                                                          |

### contract_type Enumerators

| Enum                | Description                                |
|---------------------|--------------------------------------------|
| `debenture` | Debenture issuance deed. |
| `adhesion_term` | Debenture adhesion term. |
| `sa_minute` | Debenture issuance approval minutes for **SA** company. |
| `ltda_minute` | Debenture issuance approval minutes for **LTDA** company. |
| `cop_minute` | Debenture issuance approval minutes for **Cooperative**. |

### Response

The response body is a complete JSON of the updated operation.

---

---

# Send Operation Collateral

URL: /en/documentation/escrituracao/emissao-debentures/envio-garantia

This endpoint allows **adding collateral** to a Debenture operation. The collateral is submitted for signature together with the operation documents. Each collateral type (`collateral_type`) has its own required-document rules, listed below.

:::info Where `document_key` comes from
The `collateral_document_key` and `document_key` (in `additional_documents`) reference previously uploaded documents. Each key is obtained from the [Send document](./envio-documento.md) endpoint (`POST /debenture/upload`), which receives the file in Base64 and returns the corresponding `document_key`.
:::

---

## **Request**

ENDPOINT /debenture/operation/ OPERATION-KEY /collateral
METHOD POST

### Path Params

| Field | Type | Description | Characters |
|-------|------|-------------|------------|
| `OPERATION-KEY` * | string | Unique operation key (UUID v4). | 36 |

---

## Collateral types

:::warning
Documents marked as **required** are mandatory for the respective collateral type.
:::

### Fiduciary alienation of property (`fiduciary_alienation_property`)

Request Body

```json
{
    "collateral_document_key": "25dd10b8-7364-4abe-b0e8-0e419b04194b",
    "collateral_type": "fiduciary_alienation_property",
    "additional_documents": [
        { "document_type": "property_appraisal_report", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" },
        { "document_type": "property_registration_updated", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" },
        { "document_type": "property_full_content_certificate", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" }
    ]
}
```

#### Document types

| Enum | Description | Required |
|------|-------------|----------|
| `property_appraisal_report` | Property appraisal report. | Yes |
| `property_registration_updated` | Updated property registration. | Yes |
| `property_full_content_certificate` | Full content certificate of registration. | Yes |
| `property_insurance_policy` | Insurance policy (if required by contract). | - |
| `others` | Other documents. | - |

### Fiduciary alienation of vehicle (`fiduciary_alienation_vehicle`)

Request Body

```json
{
    "collateral_document_key": "25dd10b8-7364-4abe-b0e8-0e419b04194b",
    "collateral_type": "fiduciary_alienation_vehicle",
    "additional_documents": [
        { "document_type": "vehicle_appraisal_report", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" },
        { "document_type": "vehicle_inspection_report", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" },
        { "document_type": "vehicle_crv_certificate", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" }
    ]
}
```

#### Document types

| Enum | Description | Required |
|------|-------------|----------|
| `vehicle_appraisal_report` | Vehicle appraisal report or FIPE table. | Yes |
| `vehicle_inspection_report` | Inspection report. | Yes |
| `vehicle_crv_certificate` | Updated vehicle registration certificate (CRLV). | Yes |
| `others` | Other documents. | - |

### Fiduciary alienation of aircraft (`fiduciary_alienation_aircraft`)

Request Body

```json
{
    "collateral_document_key": "25dd10b8-7364-4abe-b0e8-0e419b04194b",
    "collateral_type": "fiduciary_alienation_aircraft",
    "additional_documents": [
        { "document_type": "aircraft_certificate_anac", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" },
        { "document_type": "aircraft_rab_consult", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" },
        { "document_type": "aircraft_insurance_policy", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" },
        { "document_type": "aircraft_appraisal_report", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" }
    ]
}
```

#### Document types

| Enum | Description | Required |
|------|-------------|----------|
| `aircraft_certificate_anac` | Registration certificate - ANAC. | Yes |
| `aircraft_rab_consult` | Brazilian Aeronautical Registry (RAB) consultation. | Yes |
| `aircraft_insurance_policy` | Insurance policy - fund as beneficiary. | Yes |
| `aircraft_appraisal_report` | Aircraft appraisal report. | Yes |
| `others` | Other documents. | - |

### Fiduciary alienation of equipment/products/inventory (`fiduciary_alienation_equipment`)

Request Body

```json
{
    "collateral_document_key": "25dd10b8-7364-4abe-b0e8-0e419b04194b",
    "collateral_type": "fiduciary_alienation_equipment",
    "additional_documents": [
        { "document_type": "equipment_purchase_invoice", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" },
        { "document_type": "equipment_appraisal_report", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" }
    ]
}
```

#### Document types

| Enum | Description | Required |
|------|-------------|----------|
| `equipment_purchase_invoice` | Purchase invoice. | Yes |
| `equipment_appraisal_report` | Equipment appraisal report. | Yes |
| `equipment_insurance_policy` | Equipment insurance policy (if required). | - |
| `fiduciary_depositary_declaration` | Bona fide depositary declaration. | - |
| `others` | Other documents. | - |

### Fiduciary alienation of artwork (`fiduciary_alienation_artwork`)

Request Body

```json
{
    "collateral_document_key": "25dd10b8-7364-4abe-b0e8-0e419b04194b",
    "collateral_type": "fiduciary_alienation_artwork",
    "additional_documents": [
        { "document_type": "artwork_appraisal_report", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" },
        { "document_type": "artwork_storage_certificate", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" }
    ]
}
```

#### Document types

| Enum | Description | Required |
|------|-------------|----------|
| `artwork_appraisal_report` | Artwork appraisal report. | Yes |
| `artwork_storage_certificate` | Storage location adequacy certificate. | Yes |
| `artwork_insurance_policy` | Insurance policy (if required). | - |
| `others` | Other documents. | - |

### Fiduciary alienation of securities (`fiduciary_alienation_securities`)

Request Body

```json
{
    "collateral_document_key": "25dd10b8-7364-4abe-b0e8-0e419b04194b",
    "collateral_type": "fiduciary_alienation_securities",
    "additional_documents": [
        { "document_type": "securities_negotiation_block", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" }
    ]
}
```

#### Document types

| Enum | Description | Required |
|------|-------------|----------|
| `securities_negotiation_block` | Trading block at the custodian. | Yes |
| `securities_registration_gravame` | Lien registration. | - |
| `others` | Other documents. | - |

### Fiduciary assignment of shares/quotas (`fiduciary_assignment_shares`)

Request Body

```json
{
    "collateral_document_key": "25dd10b8-7364-4abe-b0e8-0e419b04194b",
    "collateral_type": "fiduciary_assignment_shares",
    "additional_documents": [
        { "document_type": "share_registration_book", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" }
    ]
}
```

#### Document types

| Enum | Description | Required |
|------|-------------|----------|
| `share_registration_book` | Registered shares book with lien annotation. | Yes |
| `others` | Other documents. | - |

### Property mortgage (`mortgage_property`)

Request Body

```json
{
    "collateral_document_key": "25dd10b8-7364-4abe-b0e8-0e419b04194b",
    "collateral_type": "mortgage_property",
    "additional_documents": [
        { "document_type": "property_appraisal_report", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" },
        { "document_type": "property_registration", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" },
        { "document_type": "property_full_content_certificate", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" }
    ]
}
```

#### Document types

| Enum | Description | Required |
|------|-------------|----------|
| `property_appraisal_report` | Property appraisal report. | Yes |
| `property_registration` | Updated property record. | Yes |
| `property_full_content_certificate` | Full content certificate of registration. | Yes |
| `property_insurance_policy` | Insurance policy (if required by contract). | - |
| `others` | Other documents. | - |

### Ship mortgage (`mortgage_ship`)

Request Body

```json
{
    "collateral_document_key": "25dd10b8-7364-4abe-b0e8-0e419b04194b",
    "collateral_type": "mortgage_ship",
    "additional_documents": [
        { "document_type": "ship_registration", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" },
        { "document_type": "ship_appraisal_report", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" }
    ]
}
```

#### Document types

| Enum | Description | Required |
|------|-------------|----------|
| `ship_registration` | Updated ship ownership record. | Yes |
| `ship_appraisal_report` | Ship appraisal report. | Yes |
| `ship_insurance_policy` | Ship insurance policy (if required). | - |
| `others` | Other documents. | - |

### Guaranty (aval) (`guarantor`)

Request Body

```json
{
    "collateral_document_key": "25dd10b8-7364-4abe-b0e8-0e419b04194b",
    "collateral_type": "guarantor",
    "additional_documents": [
        { "document_type": "guarantor_civil_status_declaration", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" }
    ]
}
```

#### Document types

| Enum | Description | Required |
|------|-------------|----------|
| `guarantor_civil_status_declaration` | Guarantor civil status declaration. | Yes |
| `guarantor_personal_document` | Guarantor personal document. | - |
| `guarantor_income_tax_declaration` | Guarantor income tax declaration. | - |
| `others` | Other documents. | - |

### Surety (`surety`)

Request Body

```json
{
    "collateral_document_key": "25dd10b8-7364-4abe-b0e8-0e419b04194b",
    "collateral_type": "surety",
    "additional_documents": [
        { "document_type": "surety_civil_status_declaration", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" },
        { "document_type": "surety_personal_document", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" },
        { "document_type": "surety_income_tax_declaration", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" }
    ]
}
```

#### Document types

| Enum | Description | Required |
|------|-------------|----------|
| `surety_civil_status_declaration` | Surety civil status declaration. | Yes |
| `surety_personal_document` | Surety personal document. | Yes |
| `surety_income_tax_declaration` | Surety income tax declaration. | Yes |
| `others` | Other documents. | - |

### Insurance (`insurance`)

Request Body

```json
{
    "collateral_document_key": "25dd10b8-7364-4abe-b0e8-0e419b04194b",
    "collateral_type": "insurance",
    "additional_documents": [
        { "document_type": "insurance_policy_endorsed", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" },
        { "document_type": "insurance_policy_with_expiration_and_renewal", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" }
    ]
}
```

#### Document types

| Enum | Description | Required |
|------|-------------|----------|
| `insurance_policy_endorsed` | Endorsed insurance policy. | Yes |
| `insurance_policy_with_expiration_and_renewal` | Insurance policy with expiration and renewal. | Yes |
| `others` | Other documents. | - |

### Guarantee monitoring (`monitoring_guarantee`)

Request Body

```json
{
    "collateral_document_key": "25dd10b8-7364-4abe-b0e8-0e419b04194b",
    "collateral_type": "monitoring_guarantee",
    "additional_documents": [
        { "document_type": "guarantee_contract", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" },
        { "document_type": "guarantee_agent_contract", "document_key": "1bffe8c6-0a54-4854-b693-745b3dba9e04" }
    ]
}
```

#### Document types

| Enum | Description | Required |
|------|-------------|----------|
| `guarantee_contract` | Guarantee contract. | Yes |
| `guarantee_agent_contract` | Guarantee agent contract. | Yes |
| `others` | Other documents. | - |

---

## Request Body Params

| Field | Type | Description | Required |
|-------|------|-------------|----------|
| `collateral_document_key` * | string | Key of the collateral instrument document. | Yes |
| `collateral_type` * | string | Collateral type. | **[collateral_type Enumerators](#collateral_type-enumerators)** |
| `additional_documents` | array | Additional collateral documents. | - |

### additional_documents

| Field | Type | Description | Required |
|-------|------|-------------|----------|
| `document_key` * | string | Document key. | Yes |
| `document_type` * | string | Document type. | Yes |

### collateral_type Enumerators

| Enum | Description |
|------|-------------|
| `fiduciary_alienation_property` | Fiduciary alienation of property. |
| `fiduciary_alienation_vehicle` | Fiduciary alienation of vehicle. |
| `fiduciary_alienation_aircraft` | Fiduciary alienation of aircraft. |
| `fiduciary_alienation_equipment` | Fiduciary alienation of equipment/products/inventory. |
| `fiduciary_alienation_artwork` | Fiduciary alienation of artwork. |
| `fiduciary_alienation_securities` | Fiduciary alienation of securities. |
| `fiduciary_assignment_shares` | Fiduciary assignment of shares/quotas. |
| `mortgage_property` | Property mortgage. |
| `mortgage_ship` | Ship mortgage. |
| `guarantor` | Guaranty (aval). |
| `surety` | Surety. |
| `insurance` | Insurance. |
| `monitoring_guarantee` | Guarantee monitoring. |
| `bank_surety` | Bank surety. |
| `fiduciary_assignment_credit_rights` | Fiduciary assignment of credit rights. |
| `card_receivables` | Card receivables. |
| `stock_guarantee` | Inventory guarantee. |
| `others` | Other collaterals. |

## Response

The response body is a complete JSON of the updated operation, with the new collateral in `collateral_list`.

---

---

# Issuer Registration Update

URL: /en/documentation/escrituracao/homologacao-emissor/alteracao-cadastro/

To make changes to the Issuer registration, it is necessary that its status be set to "in_filling", this will re-enable all inclusion/removal endpoints.

After making the modifications, the registration must be sent again for analysis with the status "in_analysis".

---

## Request

ENDPOINT /issuer_management/issuer/ ISSUER-KEY
METHOD PATCH

### Path Params

| Field          | Type   | Description                        | Characters |
| -------------- | ------ | ---------------------------------- | ---------- |
| `ISSUER-KEY` | string | Unique issuer key (UUID v4). | 36         |

### Request Body

Request Body
```json
{
  "issuer_status": "in_filling"
}
```

### Request Body Params

| Field              | Type   | Description                                          | Required |
| ------------------ | ------ | ---------------------------------------------------- | ------------ |
| `issuer_status`* | string | New issuer status. Accepted value:`in_filling`. | Yes          |

## Response

The response is a complete updated JSON of the issuer.

---

# Issuer Signer Groups Registration

URL: /en/documentation/escrituracao/homologacao-emissor/cadastro/assinantes-emissor

This endpoint allows registering signer groups associated with a previously registered issuer.

---

## Request

ENDPOINT /issuer_management/issuer/ ISSUER-KEY /signer_group
METHOD POST

### Path Params

| Field          | Type   | Description                        | Characters |
| -------------- | ------ | ---------------------------------- | ---------- |
| `ISSUER-KEY` | string | Unique issuer key (UUID v4). | 36         |

### Request Body

Request Body
```json
{
  "minimum_required_signers": 2,
  "signers": [
    {
      "name": "João da Silva",
      "document_number": "123.456.789-01",
      "email": "joao.silva@email.com",
      "phone_number": "+5511999999999",
      "is_group_mandatory": true
    },
    {
      "name": "Maria Souza",
      "document_number": "123.456.789-01",
      "email": "maria.souza@email.com",
      "phone_number": "+5511988888888",
      "is_group_mandatory": false
    }
  ]
}
```

### Request Body Params

| Field                          | Type    | Description                                                      | Max Characters                  |
| ------------------------------ | ------- | ---------------------------------------------------------------- | -------------------------------------- |
| `minimum_required_signers` * | integer | Minimum number of signers required to validate the group. | -                                      |
| `signers` *                  | array   | List of Signer Objects that make up the signer group       | **[Signer Object](#signer-object)** |

### Signer Object

| Field                    | Type    | Description                                                                                                         | Max Characters |
| ------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------- | --------------------- |
| `name` *               | string  | Full name of the signer.                                                                                         | 255                   |
| `document_number` *    | string  | Signer's CPF (format "XXX.XXX.XXX-XX").                                                                   | 11                    |
| `email` *              | string  | Signer's email address.                                                                                    | 1023                  |
| `phone_number`*        | string  | Signer's phone number (complete format: country code, area code and number. Example: +5511999999999). | 20                    |
| `is_group_mandatory` * | boolean | Indicates if the signer is mandatory or optional within the group.                                                  | -                     |

## Response

STATUS 201

Response Body

```json
{
  "signer_group_key": "123e4567-e89b-12d3-a456-426614174000",
  "minimum_required_signers": 2,
  "signers": [
    {
      "name": "João da Silva",
      "document_number": "123.456.789-01",
      "email": "joao.silva@email.com",
      "phone_number": "+5511999999999",
      "is_group_mandatory": true
    },
    {
      "name": "Maria Souza",
      "document_number": "123.456.789-01",
      "email": "maria.souza@email.com",
      "phone_number": "+5511988888888",
      "is_group_mandatory": false
    }
  ]
}
```

### Response Body Params

| Field                        | Type    | Description                                                | Max Characters                  |
| ---------------------------- | ------- | ---------------------------------------------------------- | -------------------------------------- |
| `signer_group_key`         | string  | Unique identifier of the signer group (UUID v4).     | 36                                     |
| `minimum_required_signers` | integer | Minimum number of signers required in the group.       | -                                      |
| `signers` *                | array   | List of Signer Objects that make up the signer group | **[Signer Object](#signer-object)** |

---

# Issuer Signer Groups Removal

URL: /en/documentation/escrituracao/homologacao-emissor/cadastro/assinantes-emissor-remocao

This endpoint allows removing signer groups associated with a previously registered issuer.

---

## Request
ENDPOINT /issuer_management/issuer/ ISSUER-KEY /signer_group/ SIGNER-GROUP-KEY
METHOD DELETE

### Path Params

| Field              | Type   | Description                                                 | Characters |
|--------------------|--------|----------------------------------------------------------|------------|
| `ISSUER-KEY`       | string | Unique issuer key (UUID v4).                         | 36         |
| `SIGNER-GROUP-KEY` | string | Unique key of the signer group to be removed (UUID v4). | 36         |

## Response
STATUS 204

No content is returned in the response body.

---

# Issuer Registration

URL: /en/documentation/escrituracao/homologacao-emissor/cadastro/cadastro-basico

This endpoint allows registering the basic information of an issuer.

## Request

ENDPOINT /issuer_management/issuer
METHOD POST

### Request Body

Request Body
```json
{
  "name": "Empresa Exemplo S.A.",
  "document_number": "12.345.678/0001-95",
  "trading_name": "Exemplo Comércio",
  "cnae_code": "62.02-3-00",
  "company_type": "sa",
  "foundation_date": "2000-01-01",
  "address": {
      "street": "Rua das Empresas",
      "neighborhood": "Centro",
      "number": "123",
      "postal_code": "01001-000",
      "city": "São Paulo",
      "state": "SP",
      "complement": "Sala 101"
  },
  "annual_revenues": 150000,
  "is_in_national_financial_system": false
}
```

### Request Body Params

| Field                 | Type   | Description                                           | Max Characters                                               |
| --------------------- | ------ | ----------------------------------------------------- | -------------------------------------------------------------- |
| `name` *            | string | Full company name.                             | 255                                                            |
| `document_number` * | string | Company CNPJ (format "XX.XXX.XXX/XXXX-XX").       | 14                                                             |
| `trading_name`*     | string | Company trade name.                             | 1023                                                           |
| `cnae_code`*        | string | Company CNAE code (format "XX.XX-X-XX").       | 7                                                              |
| `company_type`*     | string | Company type.                                      | **[company_type Enumerators](#company_type-enumerators)** |
| `foundation_date`*  | string | Company foundation date (format "YYYY-MM-DD"). | -                                                              |
| `address` *         | string | Object referencing the address                      | **[address object](#address-object)** |
| `annual_revenues`  | number | Issuer's annual revenue declaration. | - |
| `is_in_national_financial_system`  | boolean | Indicator if the issuer is part of the National Financial System. | - |

### Address Object

| Field             | Type   | Description                              | Max Characters |
| ----------------- | ------ | ---------------------------------------- | ---------------- |
| `street` *      | string | Street name of the company address.     | 500              |
| `neighborhood` *  | string | Neighborhood name of the company address.  | 100              |
| `number` *      | string | Address number.                    | 10               |
| `postal_code` * | string | Address postal code (format "XXXXX-XXX").  | 8                |
| `city` *        | string | City name of the address.             | 255              |
| `state` *       | string | State abbreviation (2 characters).          | 2                |
| `complement`    | string | Address complement, if applicable. | 100              |

### company_type Enumerators

| Enum     | Description        |
| -------- | ------------------ |
| `ltda` | Limited Company           |
| `sa`   | Sociedade Anônima |
| `cop`  | Cooperative        |

## Response

STATUS 201

Response Body

```json
{
    "issuer_key": "123e4567-e89b-12d3-a456-426614174000",
    "name": "Empresa Exemplo S.A.",
    "document_number": "12.345.678/0001-95",
    "status": "in_filling",
    "person_type": "legal",
    "trading_name": "Exemplo Comércio",
    "cnae_code": "62.02-3-00",
    "company_type": "sa",
    "foundation_date": "2000-01-01",
    "address": {
      "street": "Rua das Empresas",
      "neighborhood": "Centro",
      "number": "123",
      "postal_code": "01001-000",
      "city": "São Paulo",
      "state": "SP",
      "complement": "Sala 101"
    },
    "registration_datetime": "2023-01-01T12:00:00Z",
    "expiration_date": "2024-01-01T12:00:00Z",
    "payment_bank_account": {
        "account_number": "19500",
        "account_digit": "7",
        "account_branch": "0001"
    },
    "annual_revenues": 150000,
    "is_in_national_financial_system": false
  }
```

### Response Body Params

| Field                     | Type   | Description                         | Max Characters                                               |
| ------------------------- | ------ | ----------------------------------- | -------------------------------------------------------------- |
| `issuer_key`            | string | Unique issuer key (UUID).     | 36                                                             |
| `name`                  | string | Full issuer name.           | 255                                                            |
| `document_number`       | string | Issuer CNPJ.                    | 14                                                             |
| `status`                | string | Issuer status.                  | -                                                              |
| `person_type`           | string | Person type                      | **[person_type Enumerators](#person_type-enumerators)**   |
| `trading_name`          | string | Issuer trade name.           | 1023                                                           |
| `cnae_code`             | string | Issuer CNAE code.            | 7                                                              |
| `company_type`          | string | Company type                     | **[company_type Enumerators](#company_type-enumerators)** |
| `foundation_date`       | string | Issuer foundation date.      | -                                                              |
| `address`               | string | Object referencing the address    | **[address object](#address-object)**                       |
| `registration_datetime` | string | Issuer registration date and time. | -                                                              |
| `expiration_date`       | string | Issuer expiration date.     | -                                                              |
| `annual_revenues`  | number | Issuer's annual revenue declaration. | - |
| `is_in_national_financial_system`  | boolean | Indicator if the issuer is part of the National Financial System. | - |

### person_type Enumerators

| Enum        | Description      |
| ----------- | ---------------- |
| `legal`   | Legal Entity |
| `natural` | Natural Person   |

:::warning Warning
When registering an issuer, an internal account is reserved that will only be opened if an operation is completed.
:::

### payment_bank_account Object

| Field                | Type   | Description                 | Max Characters |
| -------------------- | ------ | --------------------------- | ---------------- |
| `account_digit` *  | string | Bank account digit. | -                |
| `account_branch` * | string | Bank branch.         | -                |
| `account_number` * | string | Bank account number. | -                |

---

# Issuer Bank Account Registration

URL: /en/documentation/escrituracao/homologacao-emissor/cadastro/conta-bancaria-emissor

This endpoint allows registering a bank account associated with a previously registered issuer.

---

## Request

ENDPOINT /issuer_management/issuer/ ISSUER-KEY /bank_account
METHOD POST

### Path Params

| Field          | Type   | Description                        | Characters |
| -------------- | ------ | ---------------------------------- | ---------- |
| `ISSUER-KEY` | string | Unique issuer key (UUID v4). | 36         |

### Request Body

Request Body
```json
{
  "account_number": "12345678",
  "account_digit": "1",
  "account_branch": "1234",
  "financial_institution_code_number": "001",
  "financial_institution_ispb": "00000000",
  "account_type": "checking"
}
```

### Request Body Params

| Field                                  | Type   | Description                                                  | Max Characters                                          |
| -------------------------------------- | ------ | ------------------------------------------------------------ | -------------------------------------------------------------- |
| `account_number` *                   | string | Bank account number. Must contain only digits.     | 20                                                             |
| `account_digit` *                    | string | Account verification digit. Must contain a single digit. | 1                                                              |
| `account_branch` *                   | string | Bank branch number. Must contain only digits.  | 6                                                              |
| `financial_institution_code_number`* | string | Financial institution code (3 digits).            | 3                                                              |
| `financial_institution_ispb` *       | string | Financial institution ISPB code (8 digits).       | 8                                                              |
| `account_type` *                     | string | Bank account type.                                     | **[account_type Enumerators](#account_type-enumerators)** |

### account_type Enumerators

| Enum         | Description        |
| ------------ | ------------------ |
| `checking` | Checking Account     |
| `savings`  | Savings Account    |
| `salary`   | Salary Account     |
| `payment`  | Payment Account |

## Response

STATUS 201

Response Body

```json
{
  "bank_account_key": "123e4567-e89b-12d3-a456-426614174000",
  "account_number": "12345678",
  "account_digit": "1",
  "account_branch": "1234",
  "financial_institution_code_number": "001",
  "financial_institution_ispb": "00000000",
  "account_type": "checking"
}
```

### Response Body Params

| Field                                 | Type   | Description                                                   | Max Characters                                          |
| ------------------------------------- | ------ | ------------------------------------------------------------- | -------------------------------------------------------------- |
| `bank_account_key`                  | string | Unique identifier of the registered bank account (UUID v4). | 36                                                             |
| `account_number`                    | string | Bank account number.                                   | 20                                                             |
| `account_digit`                     | string | Bank account verification digit.                       | 1                                                              |
| `account_branch`                    | string | Bank branch number.                                | 6                                                              |
| `financial_institution_code_number` | string | Financial institution code.                          | 3                                                              |
| `financial_institution_ispb`        | string | Financial institution ISPB code.                     | 8                                                              |
| `account_type`                      | string | Bank account type.                                      | **[account_type Enumerators](#account_type-enumerators)** |

---

# Setting the Issuer's Primary Bank Account

URL: /en/documentation/escrituracao/homologacao-emissor/cadastro/conta-bancaria-emissor-principal

This endpoint promotes an existing issuer bank account to primary (`is_default: true`). The account previously marked as primary automatically becomes `is_default: false`.

---

## Swapping the issuer's primary bank account

An issuer may have several registered bank accounts, but only one is marked as primary. To correct a primary account with incorrect data (digit, branch, ISPB), use the flow below.

:::warning Prerequisite
The issuer must be in `in_filling` status. After that status, the primary account cannot be changed — this is intentional, since the primary account is referenced by financial operations.
:::

### Swap flow (3 calls)

1. **POST** `.../bank_account` → creates the new (correct) account.
2. **POST** `.../bank_account/{key}/set_default` → promotes the new account to primary.
3. **DELETE** `.../bank_account/{old_key}` → removes the old account.

The same ordering restriction applies: since deleting the primary account is not allowed, promotion must come before removal. Reversing the order returns `HTTP 400 / ISS0000012`.

---

## Request

ENDPOINT /issuer_management/issuer/ ISSUER-KEY /bank_account/ BANK-ACCOUNT-KEY /set_default
METHOD POST

### Path Params

| Field              | Type   | Description                                                          | Characters |
|--------------------|--------|----------------------------------------------------------------------|------------|
| `ISSUER-KEY`       | string | Unique issuer key (UUID v4).                                         | 36         |
| `BANK-ACCOUNT-KEY` | string | Unique key of the bank account to be promoted to primary (UUID v4).  | 36         |

### Request Body

No content is sent in the request body.

---

## Response

STATUS 204

Account promoted to primary. No content is returned in the response body.

---

## Errors

| HTTP | Code         | Scenario                                                                |
|------|--------------|-------------------------------------------------------------------------|
| 400  | `ISS0000011` | Issuer is not in `in_filling`.                                          |
| 403  | `ISS000011`  | Tenant does not have access to this issuer.                             |
| 404  | `ISS000005`  | `bank_account_key` not found for this issuer.                           |
| 404  | `ISS000009`  | `issuer_key` not found.                                                 |

---

# Issuer Bank Account Removal

URL: /en/documentation/escrituracao/homologacao-emissor/cadastro/conta-bancaria-emissor-remocao

This endpoint allows removing bank account associated with a previously registered issuer.

---

## Request
ENDPOINT /issuer_management/issuer/ ISSUER-KEY /bank_account/ BANK-ACCOUNT-KEY
METHOD DELETE

### Path Params

| Field              | Type   | Description                                              | Characters |
|--------------------|--------|------------------------------------------------------|------------|
| `ISSUER-KEY`       | string | Unique issuer key (UUID v4).                     | 36         |
| `BANK-ACCOUNT-KEY` | string | Unique key of the bank account to be removed (UUID v4).| 36         |

---

## Response
STATUS 204

No content is returned in the response body.

---

## Notes

- Removing the account marked as primary (`is_default: true`) is not allowed. The attempt returns `HTTP 400 / ISS0000012`. To swap the primary account, see the full flow in [Setting the issuer's primary bank account](./conta-bancaria-emissor-principal.md).
- Changes to the primary account are only allowed while the issuer is in `in_filling`. Outside that status, the operation returns `HTTP 400 / ISS0000011`.

---

---

# Issuer Documents Submission

URL: /en/documentation/escrituracao/homologacao-emissor/cadastro/documentos-emissor

This endpoint allows submitting documents associated with a previously registered issuer.

---

## Request

ENDPOINT /issuer_management/issuer/ ISSUER-KEY /document
METHOD POST

### Path Params

| Field          | Type   | Description                        | Characters |
| -------------- | ------ | ---------------------------------- | ---------- |
| `ISSUER-KEY` | string | Unique issuer key (UUID v4). | 36         |

### Request Body

Request Body
```json
{
  "document_base64": "dGVzdGVfZG9jdW1lbnRfYmFzZTY0",
  "document_type": "proof_of_address"
}
```

### Request Body Params

| Field                 | Type   | Description                                             | Max Characters                                                 |
| --------------------- | ------ | ------------------------------------------------------- | ---------------------------------------------------------------- |
| `document_base64` * | string | Document file content encoded in Base64. | -                                                                |
| `document_type` *   | string | Type of document submitted.                              | **[document_type Enumerators](#document_type-enumerators)** |

| Enum                            | Description                        |
| ------------------------------- | ---------------------------------- |
| `danfe`                         | DANFE                              |
| `proof_of_address`              | Proof of Address            |
| `letter_of_attorney`            | Power of Attorney                         |
| `company_statute`               | Company Contract or Statute        |
| `commercial_board_certificate`  | Commercial Board Certificate     |
| `board_election_record`         | Board Election Minutes        |
| `manager_declaration`           | Manager Declaration               |
| `financial_statement`           | Financial Statement                 |
| `credit_report`                 | Credit Report               |
| `manager_statement`             | Administrator Statement        |
| `compliance_statement`          | Compliance Statement         |
| `cnpj_card`                     | CNPJ Card                        |
| `additional_document`           | Additional Document                |

## Response

STATUS 201

Response Body

```json
{
    "document_key": "123e4567-e89b-12d3-a456-426614174000",
    "document_type": "proof_of_address",
    "ocr_key": "123e4567-e89b-12d3-a456-426614174000"
}
```

### Response Body Params

| Field             | Type   | Description                                          | Max Length                                                       |
| ----------------- | ------ | ---------------------------------------------------- | ---------------------------------------------------------------- |
| `document_key`  | string | Unique identifier of the submitted document (UUID v4). | 36                                                               |
| `document_type` | string | Type of document submitted.                           | **[document_type Enumerators](#document_type-enumerators)** |
| `ocr_key`       | string | OCR key associated with the submitted document.            | 36                                                               |

---

# Issuer Documents Removal

URL: /en/documentation/escrituracao/homologacao-emissor/cadastro/documentos-emissor-remocao

This endpoint allows removing documents submitted for issuer registration.

---

## Request
ENDPOINT /issuer_management/issuer/ ISSUER-KEY /document/ DOCUMENT-KEY
METHOD DELETE

### Path Params

| Field          | Type   | Description                                | Characters |
|----------------|--------|------------------------------------------|------------|
| `ISSUER-KEY`   | string | Unique issuer key (UUID v4).         | 36         |
| `DOCUMENT-KEY` | string | Unique key of the document to be removed (UUID v4). | 36         |

## Response
STATUS 204

No content is returned in the response body.

---

# Issuer Representative Document Upload

URL: /en/documentation/escrituracao/homologacao-emissor/cadastro/documentos-representantes-emissor

This endpoint allows uploading documents associated with a representative of a previously registered issuer.

---
## Request
ENDPOINT /issuer_management/issuer/ ISSUER-KEY /issuer_representative/ ISSUER-REPRESENTATIVE-KEY /document
METHOD POST

### Path Params

| Field                       | Type   | Description                                           | Characters |
|-----------------------------|--------|---------------------------------------------------|------------|
| `ISSUER-KEY`                | string | Unique issuer key (UUID v4).                  | 36         |
| `ISSUER-REPRESENTATIVE-KEY` | string | Unique issuer representative key (UUID v4). | 36         |

### Request Body
Request Body
```json
{
  "document_base64": "dGVzdGVfZG9jdW1lbnRfYmFzZTY0",
  "document_type": "cnh"
}
```

### Request Body Params

| Field             | Type     | Description                                                                                   | Max Characters |
|--------------------|----------|-------------------------------------------------------------------------------------------|-----------------------|
| `document_base64` *| string   | Document file content encoded in Base64.                                     | -                     |
| `document_type` *  | string   | Type of document being uploaded. Accepted values:          | **[document_type Enumerators](#document_type-enumerators)** |

### document_type Enumerators
| Enum                            | Description                        |
| ------------------------------- | ---------------------------------- |
| `cnh`                           | National Driver's License   |
| `cnh_front`                     | CNH Front                      |
| `cnh_back`                      | CNH Back                       |
| `cnh_digital`                   | Digital CNH                        |
| `rg_front`                      | RG Front                       |
| `rg_back`                       | RG Back                        |
| `proof_of_address`              | Proof of Address            |
| `letter_of_attorney`            | Power of Attorney                         |
| `passport`                      | Passport                         |
| `national_registry_of_foreigners`| National Registry of Foreigners |

## Response
STATUS 201

Response Body

```json
{
  "document_key": "123e4567-e89b-12d3-a456-426614174000",
  "document_type": "cnh",
  "ocr_key": "123e4567-e89b-12d3-a456-426614174000"
}
```

### Response Body Params

| Field           | Type     | Description                                           | Max Characters |
|------------------|----------|-----------------------------------------------------|-----------------------|
| `document_key`   | string   | Unique identifier for the uploaded document (UUID v4). | 36                    |
| `document_type`  | string   | Type of document uploaded.                          | **[document_type Enumerators](#document_type-enumerators)** |
| `ocr_key`        | string   | OCR key associated with the uploaded document.           | 36                    |

---

# Issuer Representative Document Removal

URL: /en/documentation/escrituracao/homologacao-emissor/cadastro/documentos-representantes-emissor-remocao

This endpoint allows removing documents associated with a representative of a previously registered issuer.

---

## Request
ENDPOINT /issuer_management/issuer/ ISSUER-KEY /issuer_representative/ ISSUER-REPRESENTATIVE-KEY /document/ DOCUMENT-KEY
METHOD DELETE

### Path Params

| Field                       | Type   | Description                                           | Characters |
|-----------------------------|--------|---------------------------------------------------|------------|
| `ISSUER-KEY`                | string | Unique issuer key (UUID v4).                  | 36         |
| `ISSUER-REPRESENTATIVE-KEY` | string | Unique issuer representative key (UUID v4). | 36         |
| `DOCUMENT-KEY`              | string | Unique key of the document to be removed (UUID v4). | 36         |

## Response
STATUS 204

No content is returned in the response body.

---

# Issuer Contact Information Registration

URL: /en/documentation/escrituracao/homologacao-emissor/cadastro/informacao-contato-emissor

This endpoint allows registering contact information associated with a previously registered issuer.

---

## Request

ENDPOINT /issuer_management/issuer/ ISSUER-KEY /issuer_contact_information
METHOD POST

### Path Params

| Field          | Type   | Description                        | Characters |
| -------------- | ------ | ---------------------------------- | ---------- |
| `ISSUER-KEY` | string | Unique issuer key (UUID v4). | 36         |

### Request Body

Request Body
```json
{
  "name": "João da Silva",
  "document_number": "123.456.789-01",
  "email": "joao.silva@email.com",
  "phone_number": "+5511999999999"
}
```

### Request Body Params

| Field                 | Type   | Description                                                                                                       | Max Characters |
| --------------------- | ------ | ----------------------------------------------------------------------------------------------------------------- | --------------------- |
| `name` *            | string | Full name of the contact.                                                                                         | 255                   |
| `document_number` * | string | Contact's document number (CPF format, format "XXX.XXX.XXX-XX").                                          | 14                    |
| `email`*            | string | Contact's email address.                                                                                    | 1023                  |
| `phone_number`*     | string | Contact's phone number (complete format: country code, area code and number. Example: +5511999999999). | 20                    |

## Response

STATUS 201

Response Body

```json
{
  "issuer_contact_information_key": "123e4567-e89b-12d3-a456-426614174000",
  "name": "João da Silva",
  "document_number": "123.456.789-01",
  "email": "joao.silva@email.com",
  "phone_number": "+5511999999999"
}
```

### Response Body Params

| Field                              | Type   | Description                                                           | Max Characters |
| ---------------------------------- | ------ | --------------------------------------------------------------------- | --------------------- |
| `issuer_contact_information_key` | string | Unique identifier of the registered contact information (UUID v4). | 36                    |
| `name`                           | string | Full name of the contact.                                             | 255                   |
| `document_number`                | string | Contact's document number (CPF).                                | 11                    |
| `email`                          | string | Contact's email address.                                        | 1023                  |
| `phone_number`                   | string | Contact's phone number.                                       | 20                    |

---

# Setting the Issuer's Primary Contact

URL: /en/documentation/escrituracao/homologacao-emissor/cadastro/informacao-contato-emissor-principal

This endpoint promotes an existing issuer contact to primary (`is_default: true`). The contact previously marked as primary automatically becomes `is_default: false`.

---

## Swapping the issuer's primary contact

An issuer may have multiple registered contacts, but only one is marked as primary. If the primary contact was registered with incorrect data (typo in the e-mail, wrong digit in the phone number), use the flow below to replace it.

:::warning Prerequisite
The issuer must be in `in_filling` status. Once the issuer leaves that status, changes to the primary contact/account are not allowed — the endpoint will return `HTTP 400 / ISS0000011`.
:::

### Swap flow (3 calls)

1. **POST** `.../issuer_contact_information` → creates the new (correct) contact.
2. **POST** `.../issuer_contact_information/{key}/set_default` → promotes the new contact to primary.
3. **DELETE** `.../issuer_contact_information/{old_key}` → removes the old contact (with the typo).

Order matters: since deleting a contact marked as primary is not allowed, you must promote the new contact before deleting the old one. Reversing the order returns `HTTP 400 / ISS0000013`.

---

## Request

ENDPOINT /issuer_management/issuer/ ISSUER-KEY /issuer_contact_information/ ISSUER-CONTACT-INFORMATION-KEY /set_default
METHOD POST

### Path Params

| Field                            | Type   | Description                                                       | Characters |
|----------------------------------|--------|-------------------------------------------------------------------|------------|
| `ISSUER-KEY`                     | string | Unique issuer key (UUID v4).                                      | 36         |
| `ISSUER-CONTACT-INFORMATION-KEY` | string | Unique key of the contact to be promoted to primary (UUID v4).    | 36         |

### Request Body

No content is sent in the request body.

---

## Response

STATUS 204

Contact promoted to primary. No content is returned in the response body.

---

## Errors

| HTTP | Code         | Scenario                                                                |
|------|--------------|-------------------------------------------------------------------------|
| 400  | `ISS0000011` | Issuer is not in `in_filling`.                                          |
| 403  | `ISS000011`  | Tenant does not have access to this issuer.                             |
| 404  | `ISS000008`  | `issuer_contact_information_key` not found for this issuer.             |
| 404  | `ISS000009`  | `issuer_key` not found.                                                 |

---

# Issuer Contact Information Removal

URL: /en/documentation/escrituracao/homologacao-emissor/cadastro/informacao-contato-emissor-remocao

This endpoint allows removing contact information associated with a previously registered issuer.

---

## Request
ENDPOINT /issuer_management/issuer/ ISSUER-KEY /issuer_contact_information/ ISSUER-CONTACT-INFORMATION-KEY
METHOD DELETE

### Path Params

| Field                            | Type   | Description                                                   | Characters |
|----------------------------------|--------|-----------------------------------------------------------|------------|
| `ISSUER-KEY`                     | string | Unique issuer key (UUID v4).                          | 36         |
| `ISSUER-CONTACT-INFORMATION-KEY` | string | Unique key of the contact information to be removed (UUID v4).| 36         |

## Response
STATUS 204

No content is returned in the response body.

---

## Notes

- Removing the contact marked as primary (`is_default: true`) is not allowed. The attempt returns `HTTP 400 / ISS0000013`. To swap the primary contact, see the full flow in [Setting the issuer's primary contact](./informacao-contato-emissor-principal.md).
- Changes to the primary contact are only allowed while the issuer is in `in_filling`. Outside that status, the operation returns `HTTP 400 / ISS0000011`.

---

# Issuer Representatives Registration

URL: /en/documentation/escrituracao/homologacao-emissor/cadastro/representantes-emissor

This endpoint allows registering representatives associated with a previously registered issuer.

---

## Request

ENDPOINT /issuer_management/issuer/ ISSUER-KEY /issuer_representative
METHOD POST

### Path Params

| Field          | Type   | Description                        | Characters |
| -------------- | ------ | ---------------------------------- | ---------- |
| `ISSUER-KEY` | string | Unique issuer key (UUID v4). | 36         |

### Request Body

Request Body
```json
{
  "name": "João da Silva",
  "document_number": "123.456.789-01",
  "birthdate": "1990-01-01",
  "nationality": "BRA",
  "mother_name": "Maria da Silva",
  "address": {
      "street": "Rua das Empresas",
      "neighborhood": "Centro",
      "number": "123",
      "postal_code": "01001-000",
      "city": "São Paulo",
      "state": "SP",
      "complement": "Sala 101"
  },
  "related_party_type": "attorney",
  "annual_revenues": 150000,
}
```

### Request Body Params

| Field                              | Type    | Description                                                           | Max Characters                                                |
| ---------------------------------- | ------- | --------------------------------------------------------------------- | -------------------------------------------------------------------- |
| `name` *                         | string  | Full name of the issuer representative.                            | 255                                                                  |
| `document_number` *              | string  | Document number (CPF, format "XXX.XXX.XXX-XX").             | 11                                                                   |
| `birthdate`                      | string  | Representative's birthdate in ISO 8601 format (YYYY-MM-DD). | -                                                                    |
| `document_identification_number` | string  | Document identification number.                              | 255                                                                  |
| `marital_status`                 | string  | Representative's marital status.                                        | **[marital_status Enumerators](#marital_status-enumerators)**   |
| `property_system`                | string  | Property regime.                                                       | **[property_system Enumerators](#property_system-enumerators)** |
| `nationality` * | string | Beneficiary's country of origin. | 3, according to ISO 3166-1 alpha-3 |
| `mother_name`                    | string  | Full name of the representative's mother.                               | 1023                                                                 |
| `father_name`                    | string  | Full name of the representative's father.                                | 1023                                                                 |
| `occupation`                     | string  | Representative's occupation or profession.                            | 255                                                                  |
| `is_pep`                         | boolean | Indicates if the representative is a Politically Exposed Person (PEP).  | -                                                                    |
| `address` *                      | string  | Object referencing the address                                      | **[Address Object](#address-object)**                             |
| `annual_revenues`  | number | Annual revenue declaration of the assignor. | - |
| `related_party_type` * | enumerator | Related party relationship type. | See **[Related Party Type Enumerators](#related-party-type)** |

### Address Object

| Field             | Type   | Description                              | Max Characters |
| ----------------- | ------ | ---------------------------------------- | ---------------- |
| `street` *      | string | Street name of the company address.     | 500              |
| `neighborhood`  | string | Neighborhood name of the company address.  | 100              |
| `number` *      | string | Address number.                    | 10               |
| `postal_code` * | string | Address postal code (format "XXXXX-XXX").  | 8                |
| `city` *        | string | City name of the address.             | 255              |
| `state` *       | string | State abbreviation (2 characters).          | 2                |
| `complement`    | string | Address complement, if applicable. | 100              |

### marital_status Enumerators

| Enum             | Description        |
| ---------------- | ------------------ |
| `single`       | Single        |
| `married`      | Married          |
| `widower`      | Widowed          |
| `separated`    | Separated        |
| `stable_union` | In Stable Union |
| `divorced`     | Divorced      |

### property_system Enumerators

| Enum                                    | Description                       |
| --------------------------------------- | --------------------------------- |
| `total_communion_of_goods`            | Total Community of Property           |
| `partial_communion_of_goods`          | Partial Community of Property         |
| `total_separation_of_goods`           | Total Separation of Property         |
| `final_participation_of_acquisitions` | Final Participation in Acquisitions |
| `compulsory_separation_of_goods`      | Compulsory Separation of Property  |

### Related Party Type

| Enumerator              | Description   |
| ----------------------- | ------------- |
| **president**     | President    |
| **partner**       | Partner        |
| **administrator** | Administrator |
| **director**      | Director       |
| **manager**       | Manager        |
| **attorney**      | Attorney    |

---

## Response

STATUS 201

Response Body

```json
{
  "issuer_representative_key": "123e4567-e89b-12d3-a456-426614174000",
  "name": "João da Silva",
  "document_number": "123.456.789-01",
  "document_identification_number": "987654321",
  "marital_status": "single",
  "property_system": "partial_communion_of_goods",
  "birthdate": "1990-01-01",
  "nationality": "BRA",
  "mother_name": "Maria da Silva",
  "father_name": "José da Silva",
  "occupation": "Advogado",
  "is_pep": false,
  "address": {
      "street": "Rua das Empresas",
      "neighborhood": "Centro",
      "number": "123",
      "postal_code": "01001-000",
      "city": "São Paulo",
      "state": "SP",
      "complement": "Sala 101"
  },
  "related_party_type": "attorney",
  "annual_revenues": 150000,
  "issuer_representative_document_list": []
}
```

### Response Body Params

| Field                                   | Type    | Description                                                          | Max Characters                                                |
| --------------------------------------- | ------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- |
| `issuer_representative_key`           | string  | Unique identifier for the issuer representative (UUID v4).          | 36                                                                   |
| `name`                                | string  | Full name of the issuer representative.                           | 255                                                                  |
| `document_number`                     | string  | Representative's document number (format "XXX.XXX.XXX-XX").    | 11                                                                   |
| `document_identification_number`      | string  | Document identification number.                             | 255                                                                  |
| `marital_status`                      | string  | Representative's marital status.                                       | **[marital_status Enumerators](#marital_status-enumerators)**   |
| `property_system`                     | string  | Property regime.                                                      | **[property_system Enumerators](#property_system-enumerators)** |
| `birthdate`                           | string  | Representative's birthdate.                                 | -                                                                    |
| `nationality` * | string | Beneficiary's country of origin. | 3, according to ISO 3166-1 alpha-3 |
| `mother_name`                         | string  | Full name of the representative's mother.                              | 1023                                                                 |
| `father_name`                         | string  | Full name of the representative's father.                               | 1023                                                                 |
| `occupation`                          | string  | Representative's occupation or profession.                           | 255                                                                  |
| `is_pep`                              | boolean | Indicates if the representative is a Politically Exposed Person (PEP). | -                                                                    |
| `address` *                           | string  | Object referencing the address                                     | **[Address Object](#address-object)**                             |
| `issuer_representative_document_list` | array   | List of documents associated with the representative.                     | -                                                                    |
| `annual_revenues`  | number | Annual revenue declaration of the assignor. | - |
| `related_party_type` * | enumerator | Related party relationship type. | See **[Related Party Type Enumerators](#related-party-type)** |

---

# Issuer Representative Removal

URL: /en/documentation/escrituracao/homologacao-emissor/cadastro/representantes-emissor-remocao

This endpoint allows removing representatives submitted for issuer registration.

---

## Request
ENDPOINT /issuer_management/issuer/ ISSUER-KEY /issuer_representative/ ISSUER-REPRESENTATIVE-KEY
METHOD DELETE

### Path Params

| Field                       | Type   | Description                                              | Characters |
|-----------------------------|--------|--------------------------------------------------------|------------|
| `ISSUER-KEY`                | string | Unique issuer key (UUID v4).                      | 36         |
| `ISSUER-REPRESENTATIVE-KEY` | string | Unique key of the representative to be removed (UUID v4). | 36         |

## Response
STATUS 204

No content is returned in the response body.

---

# Get Issuer

URL: /en/documentation/escrituracao/homologacao-emissor/consulta/consulta-emissor-chave

This endpoint allows querying the complete details of an issuer registered in the system, using their unique key.

---

## Request
ENDPOINT /issuer_management/issuer/ ISSUER-KEY
METHOD GET

### Path Params

| Field        | Type   | Description                                | Characters |
|--------------|--------|------------------------------------------|------------|
| `ISSUER-KEY` | string | Unique issuer key (UUID v4).         | 36         |

## Response
STATUS 200

Response Body

```json
{
    "issuer_key": "07b1ac01-5fc4-475f-930b-19595f24bc1e",
    "name": "Fabrica Exemplo S.A.",
    "document_number": "96.146.194/0001-07",
    "status": "in_filling",
    "backoffice_analysis_status": "in_analysis",
    "person_type": "legal",
    "trading_name": "Fabrica Comércio",
    "cnae_code": "62.02-3-00",
    "company_type": "sa",
    "foundation_date": "2000-01-01",
    "address": {
      "street": "Rua das Empresas",
      "neighborhood": "Centro",
      "number": "123",
      "postal_code": "01001-000",
      "city": "São Paulo",
      "state": "SP",
      "complement": "Sala 101"
    },
    "registration_datetime": "2025-01-23T13:47:57.354528",
    "expiration_date": "2026-01-23",
    "signer_group_list": [],
    "bank_account_list": [],
    "issuer_representative_list": [],
    "issuer_contact_information_list": [],
    "issuer_document_list": [],
    "issuer_analysis_list": [],
    "payment_bank_account": {
        "account_number": "19500",
        "account_digit": "7",
        "account_branch": "0001"
    },
    "annual_revenues": 150000,
    "is_in_national_financial_system": false
}
```

### Response Body Params

| Field  | Type     | Description                                              | Max Characters                            |
|--------|----------|--------------------------------------------------------|-------------------------------------------------|
| `issuer_key` | string   | Unique issuer identifier.                        | 36                                              |
| `name` | string   | Full issuer name.                              | 255                                             |
| `document_number` | string   | Issuer document number (CNPJ).                 | 14                                              |
| `status` | string   | Issuer status                                      | **[status Enumerators](#status-enumerators)** |
| `backoffice_analysis_status`| string   | Backoffice analysis status.                       | -                                               |
| `person_type` | string   | Person type (`legal` or `natural`).                 | -                                               |
| `trading_name` | string   | Issuer trade name.                              | 1023                                            |
| `cnae_code` | string   | Issuer CNAE code.                                | 10                                              |
| `company_type` | string   | Company type Accepted: ´sa´, ´ltda´, ´cop´                          | 50                                              |
| `foundation_date` | string   | Issuer foundation date.                           | -                                               |
| `signer_group_list` | array    | List of signer groups associated with the issuer.   | -                                               |
| `bank_account_list` | array    | List of bank accounts associated with the issuer.       | -                                               |
| `issuer_representative_list` | array    | List of issuer representatives.                    | -                                               |
| `issuer_contact_information_list` | array    | List of contact information associated with the issuer. | -                                               |
| `issuer_document_list` | array    | List of documents registered for the issuer.        | -                                               |
| `address` *         | string   | Object referencing the address                   | **[address object](#address-object)**           |
| `annual_revenues`  | number | Issuer's annual revenue declaration. | - |
| `is_in_national_financial_system`  | boolean | Indicator if the issuer is part of the National Financial System. | - |

### Address Object

| Field               | Type     | Description                                           | Max Characters |
|---------------------|----------|-----------------------------------------------------|-----------------|
| `street` *          | string   | Street name of the company address.                 | 500             |
| `neighborhood`      | string   | Neighborhood name of the company address.              | 100             |
| `number` *          | string   | Address number.                                 | 10              |
| `postal_code` *     | string   | Address postal code (numbers only).                  | 8               |
| `city` *            | string   | City name of the address.                         | 255             |
| `state` *           | string   | State abbreviation (2 characters).                     | 2               |
| `complement`        | string   | Address complement, if applicable.              | 100             |

### status Enumerators
| Enum   | 	Description    |
|--------|-----------------|
| `in_filling` | In filling |
| `in_analysis`	  | Under analysis      |
| `canceled`	 | Canceled       |
| `approved`	 | Approved        |
| `reproved`	 | Rejected       |
| `expired`	 | Expired        |

:::warning Warning
When registering an issuer, an internal account is reserved that will only be opened if an operation is completed.
:::

### payment_bank_account Object

| Field                              | Type     | Description                                      | Max Characters |
|-------------------------------------|----------|------------------------------------------------|-----------------|
| `account_digit` *                    | string   | Bank account digit.                      | -               |
| `account_branch` *                    | string   | Bank branch.                              | -               |
| `account_number` *                    | string   | Bank account number.                      | -               |

---

# Issuer Query by Filters

URL: /en/documentation/escrituracao/homologacao-emissor/consulta/consulta-emissor-filtro

This endpoint allows querying issuers registered in the system using the document number (CNPJ) or Name.

---

## Request
ENDPOINT /issuer_management/issuer
METHOD GET

### Query Params

| Field             | Type     | Description                          | Required |
|-------------------|----------|------------------------------------|-------------|
| `document_number` | string   | Issuer document number.    | No         |
| `name`            | string   | Issuer name.                   | No         |
| `page`            | integer  | Current page of the query.          | No         |
| `rows_per_page`   | integer  | Number of records per page.    | No         |

## Response
STATUS 200

Response Body

```json
{
  "data": [
    {
        "issuer_key": "495ae701-5c38-49b1-b517-a3b910fe8d8f",
        "name": "Empresa Exemplo S.A.",
        "document_number": "12.345.678/0001-95",
        "status": "in_filling"
    }
  ],
  "pagination": {
    "current_page": 1,
    "next_page": null,
    "rows_per_page": 100,
    "total_pages": 1,
    "total_rows": 1
  }
}
```

### Response Body Params

| Field        | Type   | Description           |                                                                 |
|--------------|--------|---------------------|-----------------------------------------------------------------|
| `data`       | list   | List of results | **[Simplified Issuer Object](#simplified-issuer-object)** |
| `pagination` | object | Pagination data  | **[Pagination Object](#pagination-object)**                       |

### Simplified Issuer Object

| Field            | Type     | Description                                                     | Max Characters                            |
|-------------------|----------|-------------------------------------------------------------|-------------------------------------------------|
| `issuer_key` | string   | Unique issuer identifier (UUID v4).                  | 36                                              |
| `name`     | string   | Full issuer name.                                   | 255                                             |
| `document_number` | string | Issuer document number (CNPJ).                   | 14                                              |
| `status`   | string   | Current issuer status.                 | **[status Enumerators](#status-enumerators)** |

### status Enumerators
| Enum   | 	Description    |
|--------|-----------------|
| `in_filling` | In filling |
| `in_analysis`	  | Under analysis      |
| `canceled`	 | Canceled       |
| `approved`	 | Approved        |
| `reproved`	 | Rejected       |
| `expired`	 | Expired        |

### Pagination Object

| Field             | Type     | Description                                |
|-------------------|----------|------------------------------------------|
| `current_page`    | integer  | Current page of the query.                |
| `next_page`       | integer  | Next page, if it exists.             |
| `rows_per_page`   | integer  | Number of records per page.          |
| `total_pages`     | integer  | Total number of pages.                 |
| `total_rows`      | integer  | Total number of records found.   |

---

# Issuer Analysis Submission

URL: /en/documentation/escrituracao/homologacao-emissor/envio-analise/

This endpoint allows changing an issuer's status to analysis, sending it to the validation process.

---

## Request

ENDPOINT /issuer_management/issuer/ ISSUER-KEY
METHOD PATCH

### Path Params

| Field          | Type   | Description                        | Characters |
| -------------- | ------ | ---------------------------------- | ---------- |
| `ISSUER-KEY` | string | Unique issuer key (UUID v4). | 36         |

### Request Body

Request Body
```json
{
  "issuer_status": "in_analysis"
}
```

### Request Body Params

| Field             | Type   | Description                                             | Required |
| ----------------- | ------ | ------------------------------------------------------- | ------------ |
| `issuer_status` | string | New issuer status. Accepted value: `in_analysis`. | Yes          |

## Response

The response is a complete updated JSON of the issuer.

---

# Introduction

URL: /en/documentation/escrituracao/homologacao-emissor/inicio

The Issuer registration section is essential for starting Commercial Paper issuance. In this section we will explain the entire flow, from sending the first information, to sending for analysis.

To have access to the services discussed in the next sessions, contact the team [suporte.dcm@qitech.com.br](mailto:suporte.dcm@qitech.com.br), so that the proper releases are made, both in the Sandbox environment and in the production environment.

### Issuer Registration

At this stage, all information from both the Issuer and its representatives, documents, contact information, signer groups and bank accounts must be sent.

Once the information submission is complete, the registration is sent for analysis by the assignor registry team and after approval this issuer will be able to participate in Commercial Paper issuance.

If the registration has already been done on the QI CTVM assignor registry platform, it is possible to reuse this registration in a simple way, using the data access request endpoint.

### Issuer Update

In case of need for registration update, all Issuer information must be sent again with the desired modifications. After submission, a new Analysis is generated for validation. 

As soon as this new Analysis is approved, the new Issuer registration data is effectively changed.

---

# Issuer Data Access Request

URL: /en/documentation/escrituracao/homologacao-emissor/solicitacao-acesso

Clients who registered an issuer that already has a **registration in the assignor registry platform** need to **request access to the issuer data** so they can issue operations with this issuer as a party in the bookkeeping system.   

---

## **Access Request (POST)**

### **Request**
ENDPOINT /issuer_management/issuer/data_access_request
METHOD POST

---

## **Request Body**  

Request Body

```json
{
    "document_number": "96.146.194/0001-07",
}
```

---

## **Response**
STATUS 201

Response Body

```json
{
    "issuer_key": "07b1ac01-5fc4-475f-930b-19595f24bc1e",
    "name": "Fabrica Exemplo S.A.",
    "document_number": "96.146.194/0001-07",
    "status": "approved",
    "backoffice_analysis_status": "approved",
    "person_type": "legal",
    "trading_name": "Fabrica Comércio",
    "cnae_code": "62.02-3-00",
    "company_type": "sa",
    "foundation_date": "2000-01-01",
    "address": {
      "street": "Rua das Empresas",
      "neighborhood": "Centro",
      "number": "123",
      "postal_code": "01001-000",
      "city": "São Paulo",
      "state": "SP",
      "complement": "Sala 101"
    },
    "registration_datetime": "2025-01-23T13:47:57.354528",
    "expiration_date": "2026-01-23",
    "signer_group_list": [
        {
            "signer_group_key": "123e4567-e89b-12d3-a456-426614174000",
            "minimum_required_signers": 2,
            "signers": [
                {
                "name": "João da Silva",
                "document_number": "123.456.789-01",
                "email": "joao.silva@email.com",
                "phone_number": "+5511999999999",
                "is_group_mandatory": true
                },
                {
                "name": "Maria Souza",
                "document_number": "123.456.789-01",
                "email": "maria.souza@email.com",
                "phone_number": "+5511988888888",
                "is_group_mandatory": false
                }
            ]
        }
    ],
    "bank_account_list": [
        {
            "bank_account_key": "123e4567-e89b-12d3-a456-426614174000",
            "account_number": "12345678",
            "account_digit": "1",
            "account_branch": "1234",
            "financial_institution_code_number": "001",
            "financial_institution_ispb": "00000000",
            "account_type": "checking"
        }
    ],
    "issuer_representative_list": [
        {
            "issuer_representative_key": "123e4567-e89b-12d3-a456-426614174000",
            "name": "João da Silva",
            "document_number": "123.456.789-01",
            "document_identification_number": "987654321",
            "marital_status": "single",
            "property_system": "partial_communion_of_goods",
            "birthdate": "1990-01-01",
            "nationality": "BRA",
            "mother_name": "Maria da Silva",
            "father_name": "José da Silva",
            "occupation": "Advogado",
            "is_pep": false,
            "address": {
                "street": "Rua das Empresas",
                "neighborhood": "Centro",
                "number": "123",
                "postal_code": "01001-000",
                "city": "São Paulo",
                "state": "SP",
                "complement": "Sala 101"
            },
            "related_party_type": "attorney",
            "annual_revenues": 150000,
            "issuer_representative_document_list": [
                {
                    "document_key": "123e4567-e89b-12d3-a456-426614174000",
                    "document_type": "cnh",
                    "ocr_key": "123e4567-e89b-12d3-a456-426614174000"
                }
            ]
        }
    ],
    "issuer_contact_information_list": [
        {
            "name": "João da Silva",
            "document_number": "123.456.789-01",
            "email": "joao.silva@email.com",
            "phone_number": "+5511999999999"
        }
    ],
    "issuer_document_list": [
        {
            "document_key": "123e4567-e89b-12d3-a456-426614174000",
            "document_type": "proof_of_address",
            "ocr_key": "123e4567-e89b-12d3-a456-426614174000"
        }
    ],
    "issuer_analysis_list": [],
    "payment_bank_account": {
        "account_number": "19500",
        "account_digit": "7",
        "account_branch": "0001"
    }
}
```

### Response Body Params

| Field  | Type     | Description                                              | Max Characters                            |
|--------|----------|--------------------------------------------------------|-------------------------------------------------|
| `issuer_key` | string   | Unique issuer identifier.                        | 36                                              |
| `name` | string   | Full issuer name.                              | 255                                             |
| `document_number` | string   | Issuer document number (CNPJ).                 | 14                                              |
| `status` | string   | Issuer status                                      | **[status Enumerators](#status-enumerators)** |
| `backoffice_analysis_status`| string   | Backoffice analysis status.                       | -                                               |
| `person_type` | string   | Person type (`legal` or `natural`).                 | -                                               |
| `trading_name` | string   | Issuer trade name.                              | 1023                                            |
| `cnae_code` | string   | Issuer CNAE code.                                | 10                                              |
| `company_type` | string   | Company type Accepted: ´sa´, ´ltda´, ´cop´                          | 50                                              |
| `foundation_date` | string   | Issuer foundation date.                           | -                                               |
| `signer_group_list` | array    | List of signer groups associated with the issuer.   | -                                               |
| `bank_account_list` | array    | List of bank accounts associated with the issuer.       | -                                               |
| `issuer_representative_list` | array    | List of issuer representatives.                    | -                                               |
| `issuer_contact_information_list` | array    | List of contact information associated with the issuer. | -                                               |
| `issuer_document_list` | array    | List of documents registered for the issuer.        | -                                               |
| `address` *         | string   | Object referencing the address                   | **[address object](#address-object)**           |

### Address Object

| Field               | Type     | Description                                           | Max Characters |
|---------------------|----------|-----------------------------------------------------|-----------------|
| `street` *          | string   | Street name of the company address.                 | 500             |
| `neighborhood`      | string   | Neighborhood name of the company address.              | 100             |
| `number` *          | string   | Address number.                                 | 10              |
| `postal_code` *     | string   | Address postal code (numbers only).                  | 8               |
| `city` *            | string   | City name of the address.                         | 255             |
| `state` *           | string   | State abbreviation (2 characters).                     | 2               |
| `complement`        | string   | Address complement, if applicable.              | 100             |

### status Enumerators
| Enum   | 	Description    |
|--------|-----------------|
| `in_filling` | In filling |
| `in_analysis`	  | Under analysis      |
| `canceled`	 | Canceled       |
| `approved`	 | Approved        |
| `reproved`	 | Rejected       |
| `expired`	 | Expired        |

### payment_bank_account Object

| Field                              | Type     | Description                                      | Max Characters |
|-------------------------------------|----------|------------------------------------------------|-----------------|
| `account_digit` *                    | string   | Bank account digit.                      | -               |
| `account_branch` *                    | string   | Bank branch.                              | -               |
| `account_number` *                    | string   | Bank account number.                      | -               |

---

# Investor Registration Update

URL: /en/documentation/escrituracao/homologacao-investidor/alteracao-cadastro/

To make changes to the Investor registration, it is necessary that its status be set to "in_filling", this will re-enable all inclusion/removal endpoints.

After making the modifications, the registration must be sent again for analysis with the status "in_analysis".

---

## Request
ENDPOINT /investor_management/investor/ INVESTOR-KEY
METHOD PATCH

### Path Params

| Field        | Type   | Description                                | Characters |
|--------------|--------|------------------------------------------|------------|
| `INVESTOR-KEY` | string | Unique investor key (UUID v4).         | 36         |

### Request Body

Request Body
```json
{
  "investor_status": "in_filling"
}
```

### Request Body Params

| Field           | Type     | Description                                           | Required |
|------------------|----------|-----------------------------------------------------|-------------|
| `investor_status`  | string   | New investor status. Accepted value: `in_filling`. | Yes         |

## Response

The response is a complete updated JSON of the investor.

---

# Investor Signer Groups Registration

URL: /en/documentation/escrituracao/homologacao-investidor/cadastro/assinantes-investidor

This endpoint allows registering signer groups associated with a previously registered investor.

---

## Request

ENDPOINT /investor_management/investor/ INVESTOR-KEY /signer_group
METHOD POST

### Path Params

| Field            | Type   | Description                           | Characters |
| ---------------- | ------ | ------------------------------------- | ---------- |
| `INVESTOR-KEY` | string | Unique investor key (UUID v4). | 36         |

### Request Body

Request Body
```json
{
  "minimum_required_signers": 2,
  "signers": [
    {
      "name": "João da Silva",
      "document_number": "123.456.789-01",
      "email": "joao.silva@email.com",
      "phone_number": "+5511999999999",
      "is_group_mandatory": true
    },
    {
      "name": "Maria Souza",
      "document_number": "123.456.789-01",
      "email": "maria.souza@email.com",
      "phone_number": "+5511988888888",
      "is_group_mandatory": false
    }
  ]
}
```

### Request Body Params

| Field                          | Type    | Description                                                      | Max Characters                  |
| ------------------------------ | ------- | ---------------------------------------------------------------- | -------------------------------------- |
| `minimum_required_signers` * | integer | Minimum number of signers required to validate the group. | -                                      |
| `signers` *                  | array   | List of Signer Objects that make up the signer group       | **[Signer Object](#signer-object)** |

### Signer Object

| Field                    | Type    | Description                                                                                                         | Max Characters |
| ------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------- | --------------------- |
| `name` *               | string  | Full name of the signer.                                                                                         | 255                   |
| `document_number` *    | string  | Signer's CPF (format "XXX.XXX.XXX-XX").                                                                    | 11                    |
| `email` *              | string  | Signer's email address.                                                                                    | 1023                  |
| `phone_number`*        | string  | Signer's phone number (complete format: country code, area code and number. Example: +5511999999999). | 20                    |
| `is_group_mandatory` * | boolean | Indicates if the signer is mandatory or optional within the group.                                                  | -                     |

## Response

STATUS 201

Response Body

```json
{
  "signer_group_key": "123e4567-e89b-12d3-a456-426614174000",
  "minimum_required_signers": 2,
  "signers": [
    {
      "name": "João da Silva",
      "document_number": "123.456.789-01",
      "email": "joao.silva@email.com",
      "phone_number": "+5511999999999",
      "is_group_mandatory": true
    },
    {
      "name": "Maria Souza",
      "document_number": "123.456.789-01",
      "email": "maria.souza@email.com",
      "phone_number": "+5511988888888",
      "is_group_mandatory": false
    }
  ]
}
```

### Response Body Params

| Field                        | Type    | Description                                                | Max Characters                  |
| ---------------------------- | ------- | ---------------------------------------------------------- | -------------------------------------- |
| `signer_group_key`         | string  | Unique identifier of the signer group (UUID v4).     | 36                                     |
| `minimum_required_signers` | integer | Minimum number of signers required in the group.       | -                                      |
| `signers` *                | array   | List of Signer Objects that make up the signer group | **[Signer Object](#signer-object)** |

---

# Investor Signer Groups Removal

URL: /en/documentation/escrituracao/homologacao-investidor/cadastro/assinantes-investidor-remocao

This endpoint allows removing signer groups associated with a previously registered investor.

---

## Request
ENDPOINT /investor_management/investor/ INVESTOR-KEY /signer_group/ SIGNER-GROUP-KEY
METHOD DELETE

### Path Params

| Field              | Type   | Description                                                 | Characters |
|--------------------|--------|----------------------------------------------------------|------------|
| `INVESTOR-KEY`       | string | Unique investor key (UUID v4).                         | 36         |
| `SIGNER-GROUP-KEY` | string | Unique key of the signer group to be removed (UUID v4). | 36         |

## Response
STATUS 204

No content is returned in the response body.

---

# Investor Registration

URL: /en/documentation/escrituracao/homologacao-investidor/cadastro/cadastro-basico

This endpoint allows registering the basic information of an investor.

## Request

ENDPOINT /investor_management/investor
METHOD POST

### Request Body

Request Body
```json
{
  "name": "Empresa Exemplo S.A.",
  "document_number": "12.345.678/0001-95",
  "trading_name": "Exemplo Comércio",
  "cnae_code": "62.02-3-00",
  "company_type": "sa",
  "foundation_date": "2000-01-01",
  "address": {
      "street": "Rua das Empresas",
      "neighborhood": "Centro",
      "number": "123",
      "postal_code": "01001-000",
      "city": "São Paulo",
      "state": "SP",
      "complement": "Sala 101"
  }
}
```

### Request Body Params

| Field                 | Type   | Description                                           | Max Characters                                               |
| --------------------- | ------ | ----------------------------------------------------- | -------------------------------------------------------------- |
| `name` *            | string | Full company name.                             | 255                                                            |
| `document_number` * | string | Company CNPJ (format "XX.XXX.XXX/XXXX-XX").       | 14                                                             |
| `trading_name`*     | string | Company trade name.                             | 1023                                                           |
| `cnae_code`*        | string | Company CNAE code (format "XXXXX-XXX").        | 7                                                              |
| `company_type`*     | string | Company type.                                      | **[company_type Enumerators](#company_type-enumerators)** |
| `foundation_date`*  | string | Company foundation date (format "YYYY-MM-DD"). | -                                                              |
| `address` *         | string | Object referencing the address                      | **[address object](#address-object)**                       |

### Address Object

| Field             | Type   | Description                                  | Max Characters |
| ----------------- | ------ | -------------------------------------------- | ---------------- |
| `street` *      | string | Street name of the company address.         | 500              |
| `neighborhood` * | string | Neighborhood name of the company address.      | 100              |
| `number` *      | string | Address number.                        | 10               |
| `postal_code` * | string | Address postal code (format "XXXXX-XXX"). | 8                |
| `city` *        | string | City name of the address.                 | 255              |
| `state` *       | string | State abbreviation (2 characters).              | 2                |
| `complement`    | string | Address complement, if applicable.     | 100              |

### company_type Enumerators

| Enum     | Description        |
| -------- | ------------------ |
| `ltda` | Limited Company           |
| `sa`   | Sociedade Anônima |
| `cop`  | Cooperative        |

## Response

STATUS 201

Response Body

```json
{
    "investor_key": "123e4567-e89b-12d3-a456-426614174000",
    "name": "Empresa Exemplo S.A.",
    "document_number": "12.345.678/0001-95",
    "status": "in_filling",
    "person_type": "legal",
    "trading_name": "Exemplo Comércio",
    "cnae_code": "62.02-3-00",
    "company_type": "sa",
    "foundation_date": "2000-01-01",
    "address": {
      "street": "Rua das Empresas",
      "neighborhood": "Centro",
      "number": "123",
      "postal_code": "01001-000",
      "city": "São Paulo",
      "state": "SP",
      "complement": "Sala 101"
    },
    "registration_datetime": "2023-01-01T12:00:00Z",
    "expiration_date": "2024-01-01T12:00:00Z"
  }
```

### Response Body Params

| Field                     | Type   | Description                            | Max Characters                                               |
| ------------------------- | ------ | -------------------------------------- | -------------------------------------------------------------- |
| `investor_key`          | string | Unique investor key (UUID).     | 36                                                             |
| `name`                  | string | Full investor name.           | 255                                                            |
| `document_number`       | string | Investor CNPJ.                    | 14                                                             |
| `status`                | string | Investor status.                  | -                                                              |
| `person_type`           | string | Person type                         | **[person_type Enumerators](#person_type-enumerators)**   |
| `trading_name`          | string | Investor trade name.           | 1023                                                           |
| `cnae_code`             | string | Investor CNAE code.            | 7                                                              |
| `company_type`          | string | Company type                        | **[company_type Enumerators](#company_type-enumerators)** |
| `foundation_date`       | string | Investor foundation date.      | -                                                              |
| `address`               | string | Object referencing the address       | **[address object](#address-object)**                       |
| `registration_datetime` | string | Investor registration date and time. | -                                                              |
| `expiration_date`       | string | Investor expiration date.     | -                                                              |

### person_type Enumerators

| Enum        | Description      |
| ----------- | ---------------- |
| `legal`   | Legal Entity |
| `natural` | Natural Person   |

---

# Investor Bank Account Registration

URL: /en/documentation/escrituracao/homologacao-investidor/cadastro/conta-bancaria-investidor

This endpoint allows registering a bank account associated with a previously registered investor.

---

## Request

ENDPOINT /investor_management/investor/ INVESTOR-KEY /bank_account
METHOD POST

### Path Params

| Field            | Type   | Description                           | Characters |
| ---------------- | ------ | ------------------------------------- | ---------- |
| `INVESTOR-KEY` | string | Unique investor key (UUID v4). | 36         |

### Request Body

Request Body
```json
{
  "account_number": "12345678",
  "account_digit": "1",
  "account_branch": "1234",
  "financial_institution_code_number": "001",
  "financial_institution_ispb": "00000000",
  "account_type": "checking"
}
```

### Request Body Params

| Field                                  | Type   | Description                                                  | Max Characters                                          |
| -------------------------------------- | ------ | ------------------------------------------------------------ | -------------------------------------------------------------- |
| `account_number` *                   | string | Bank account number. Must contain only digits.     | 20                                                             |
| `account_digit` *                    | string | Account verification digit. Must contain a single digit. | 1                                                              |
| `account_branch` *                   | string | Bank branch number. Must contain only digits.  | 6                                                              |
| `financial_institution_code_number`* | string | Financial institution code (3 digits).            | 3                                                              |
| `financial_institution_ispb` *       | string | Financial institution ISPB code (8 digits).       | 8                                                              |
| `account_type` *                     | string | Bank account type.                                     | **[account_type Enumerators](#account_type-enumerators)** |

### account_type Enumerators

| Enum         | Description        |
| ------------ | ------------------ |
| `checking` | Checking Account     |
| `savings`  | Savings Account    |
| `salary`   | Salary Account     |
| `payment`  | Payment Account |

## Response

STATUS 201

Response Body

```json
{
  "bank_account_key": "123e4567-e89b-12d3-a456-426614174000",
  "account_number": "12345678",
  "account_digit": "1",
  "account_branch": "1234",
  "financial_institution_code_number": "001",
  "financial_institution_ispb": "00000000",
  "account_type": "checking"
}
```

### Response Body Params

| Field                                 | Type   | Description                                                   | Max Characters                                          |
| ------------------------------------- | ------ | ------------------------------------------------------------- | -------------------------------------------------------------- |
| `bank_account_key`                  | string | Unique identifier of the registered bank account (UUID v4). | 36                                                             |
| `account_number`                    | string | Bank account number.                                   | 20                                                             |
| `account_digit`                     | string | Bank account verification digit.                       | 1                                                              |
| `account_branch`                    | string | Bank branch number.                                | 6                                                              |
| `financial_institution_code_number` | string | Financial institution code.                          | 3                                                              |
| `financial_institution_ispb`        | string | Financial institution ISPB code.                     | 8                                                              |
| `account_type`                      | string | Bank account type.                                      | **[account_type Enumerators](#account_type-enumerators)** |

---

# Investor Bank Account Removal

URL: /en/documentation/escrituracao/homologacao-investidor/cadastro/conta-bancaria-investidor-remocao

This endpoint allows removing bank account associated with a previously registered investor.

---

## Request
ENDPOINT /investor_management/investor/ INVESTOR-KEY /bank_account/ BANK-ACCOUNT-KEY
METHOD DELETE

### Path Params

| Field              | Type   | Description                                              | Characters |
|--------------------|--------|------------------------------------------------------|------------|
| `INVESTOR-KEY`       | string | Unique investor key (UUID v4).                     | 36         |
| `BANK-ACCOUNT-KEY` | string | Unique key of the bank account to be removed (UUID v4).| 36         |

---

## Response
STATUS 204

No content is returned in the response body.

---

---

# Investor Documents Submission

URL: /en/documentation/escrituracao/homologacao-investidor/cadastro/documentos-investidor

This endpoint allows submitting documents associated with a previously registered investor.

---

## Request
ENDPOINT /investor_management/investor/ INVESTOR-KEY /document
METHOD POST

### Path Params

| Field         | Type   | Description                                | Characters |
|---------------|--------|------------------------------------------|------------|
| `INVESTOR-KEY`  | string | Unique investor key (UUID v4).         | 36         |

### Request Body

Request Body
```json
{
  "document_base64": "dGVzdGVfZG9jdW1lbnRfYmFzZTY0",
  "document_type": "proof_of_address"
}
```

### Request Body Params

| Field             | Type     | Description                                                                                  | Max Characters                                               |
|--------------------|----------|------------------------------------------------------------------------------------------|---------------------------------------------------------------|
| `document_base64` *| string   | Document file content encoded in Base64.                                    | -                                                             |
| `document_type` *  | string   | Type of document submitted.        | **[document_type Enumerators](#document_type-enumerators)** |

### document_type Enumerators
| Enum   | 	Description                |
|--------|-----------------------------|
| `danfe` | DANFE                       |
| `proof_of_address`	  | Proof of Address     |
| `letter_of_attorney`	 | Power of Attorney                  |
| `company_statute`	 | Company Contract or Statute |

## Response
STATUS 201

Response Body

```json
{
    "document_key": "123e4567-e89b-12d3-a456-426614174000",
    "document_type": "proof_of_address",
    "ocr_key": "123e4567-e89b-12d3-a456-426614174000"
}
```

### Response Body Params

| Field          | Type     | Description                                                        | Max Length |
|-----------------|----------|--------------------------------------------------------------------|------------|
| `document_key`   | string   | Unique identifier of the submitted document (UUID v4). | 36                    |
| `document_type`  | string   | Type of document submitted.                          | **[document_type Enumerators](#document_type-enumerators)** |
| `ocr_key`        | string   | OCR key associated with the submitted document.           | 36                    |

---

# Investor Documents Removal

URL: /en/documentation/escrituracao/homologacao-investidor/cadastro/documentos-investidor-remocao

This endpoint allows removing documents submitted for investor registration.

---

## Request
ENDPOINT /investor_management/investor/ INVESTOR-KEY /document/ DOCUMENT-KEY
METHOD DELETE

### Path Params

| Field          | Type   | Description                                | Characters |
|----------------|--------|------------------------------------------|------------|
| `INVESTOR-KEY`   | string | Unique investor key (UUID v4).         | 36         |
| `DOCUMENT-KEY` | string | Unique key of the document to be removed (UUID v4). | 36         |

## Response
STATUS 204

No content is returned in the response body.

---

# Investor Representative Documents Submission

URL: /en/documentation/escrituracao/homologacao-investidor/cadastro/documentos-representantes-investidor

This endpoint allows submitting documents associated with a representative of a previously registered investor.

---
## Request
ENDPOINT /investor_management/investor/ INVESTOR-KEY /investor_representative/ INVESTOR-REPRESENTATIVE-KEY /document
METHOD POST

### Path Params

| Field                       | Type   | Description                                           | Characters |
|-----------------------------|--------|---------------------------------------------------|------------|
| `INVESTOR-KEY`                | string | Unique investor key (UUID v4).                  | 36         |
| `INVESTOR-REPRESENTATIVE-KEY` | string | Unique investor representative key (UUID v4). | 36         |

### Request Body
Request Body
```json
{
  "document_base64": "dGVzdGVfZG9jdW1lbnRfYmFzZTY0",
  "document_type": "cnh"
}
```

### Request Body Params

| Field             | Type     | Description                                                                                   | Max Characters |
|--------------------|----------|-------------------------------------------------------------------------------------------|-----------------------|
| `document_base64` *| string   | Document file content encoded in Base64.                                     | -                     |
| `document_type` *  | string   | Type of document submitted. Accepted values:          | **[document_type Enumerators](#document_type-enumerators)** |

### document_type Enumerators
| Enum   | 	Description            |
|--------|-------------------------|
| `cnh` | Driver's License                     |
| `cnh_front`	  | Driver's License Front           |
| `cnh_back`	 | Driver's License Back            |
| `cnh_digital`	 | Digital Driver's License PDF         
| `rg_front`	 | ID Front            |
|  `rg_back`	 | ID Back             |
|  `danfe`	 | DANFE                   |
|   `proof_of_address`	 | Proof of Address |
|  `letter_of_attorney`	 | Power of Attorney              |

## Response
STATUS 201

Response Body

```json
{
  "document_key": "123e4567-e89b-12d3-a456-426614174000",
  "document_type": "cnh",
  "ocr_key": "123e4567-e89b-12d3-a456-426614174000"
}
```

### Response Body Params

| Field           | Type     | Description                                           | Max Characters |
|------------------|----------|-----------------------------------------------------|-----------------------|
| `document_key`   | string   | Unique identifier of the submitted document (UUID v4). | 36                    |
| `document_type`  | string   | Type of document submitted.                          | **[document_type Enumerators](#document_type-enumerators)** |
| `ocr_key`        | string   | OCR key associated with the submitted document.           | 36                    |

---

# Investor Representative Documents Removal

URL: /en/documentation/escrituracao/homologacao-investidor/cadastro/documentos-representantes-investidor-remocao

This endpoint allows removing documents associated with a representative of a previously registered investor.

---

## Request
ENDPOINT /investor_management/investor/ INVESTOR-KEY /investor_representative/ INVESTOR-REPRESENTATIVE-KEY /document/ DOCUMENT-KEY
METHOD DELETE

### Path Params

| Field                       | Type   | Description                                           | Characters |
|-----------------------------|--------|---------------------------------------------------|------------|
| `INVESTOR-KEY`                | string | Unique investor key (UUID v4).                  | 36         |
| `INVESTOR-REPRESENTATIVE-KEY` | string | Unique investor representative key (UUID v4). | 36         |
| `DOCUMENT-KEY`              | string | Unique key of the document to be removed (UUID v4). | 36         |

## Response
STATUS 204

No content is returned in the response body.

---

# Investor Contact Information Registration

URL: /en/documentation/escrituracao/homologacao-investidor/cadastro/informacao-contato-investidor

This endpoint allows registering contact information associated with a previously registered investor.

---

## Request

ENDPOINT /investor_management/investor/ INVESTOR-KEY /investor_contact_information
METHOD POST

### Path Params

| Field            | Type   | Description                           | Characters |
| ---------------- | ------ | ------------------------------------- | ---------- |
| `INVESTOR-KEY` | string | Unique investor key (UUID v4). | 36         |

### Request Body

Request Body
```json
{
  "name": "João da Silva",
  "document_number": "123.456.789-01",
  "email": "joao.silva@email.com",
  "phone_number": "+5511999999999"
}
```

### Request Body Params

| Field                 | Type   | Description                                                                                                       | Max Characters |
| --------------------- | ------ | ----------------------------------------------------------------------------------------------------------------- | --------------------- |
| `name` *            | string | Full name of the contact.                                                                                         | 255                   |
| `document_number` * | string | Contact's document number (CPF format, "XXX.XXX.XXX-XX").                                              | 11                    |
| `email`*            | string | Contact's email address.                                                                                    | 1023                  |
| `phone_number`*     | string | Contact's phone number (complete format: country code, area code and number. Example: +5511999999999). | 20                    |

## Response

STATUS 201

Response Body

```json
{
  "investor_contact_information_key": "123e4567-e89b-12d3-a456-426614174000",
  "name": "João da Silva",
  "document_number": "123.456.789-01",
  "email": "joao.silva@email.com",
  "phone_number": "+5511999999999"
}
```

### Response Body Params

| Field                                | Type   | Description                                                           | Max Characters |
| ------------------------------------ | ------ | --------------------------------------------------------------------- | --------------------- |
| `investor_contact_information_key` | string | Unique identifier of the registered contact information (UUID v4). | 36                    |
| `name`                             | string | Full name of the contact.                                             | 255                   |
| `document_number`                  | string | Contact's document number (CPF).                                | 11                    |
| `email`                            | string | Contact's email address.                                        | 1023                  |
| `phone_number`                     | string | Contact's phone number.                                       | 20                    |

---

# Investor Contact Information Removal

URL: /en/documentation/escrituracao/homologacao-investidor/cadastro/informacao-contato-investidor-remocao

This endpoint allows removing contact information associated with a previously registered investor.

---

## Request
ENDPOINT /investor_management/investor/ INVESTOR-KEY /investor_contact_information/ INVESTOR-CONTACT-INFORMATION-KEY
METHOD DELETE

### Path Params

| Field                            | Type   | Description                                                   | Characters |
|----------------------------------|--------|-----------------------------------------------------------|------------|
| `INVESTOR-KEY`                     | string | Unique investor key (UUID v4).                          | 36         |
| `INVESTOR-CONTACT-INFORMATION-KEY` | string | Unique key of the contact information to be removed (UUID v4).| 36         |

## Response
STATUS 204

No content is returned in the response body.

---

# Investor Representatives Registration

URL: /en/documentation/escrituracao/homologacao-investidor/cadastro/representantes-investidor

This endpoint allows registering representatives associated with a previously registered investor.

---

## Request

ENDPOINT /investor_management/investor/ INVESTOR-KEY /investor_representative
METHOD POST

### Path Params

| Field            | Type   | Description                           | Characters |
| ---------------- | ------ | ------------------------------------- | ---------- |
| `INVESTOR-KEY` | string | Unique investor key (UUID v4). | 36         |

### Request Body

Request Body
```json
{
  "name": "João da Silva",
  "document_number": "123.456.789-01",
  "birthdate": "1990-01-01",
  "nationality": "Brasileiro",
  "mother_name": "Maria da Silva",
  "address": {
      "street": "Rua das Empresas",
      "neighborhood": "Centro",
      "number": "123",
      "postal_code": "01001-000",
      "city": "São Paulo",
      "state": "SP",
      "complement": "Sala 101"
  }
}
```

### Request Body Params

| Field                               | Type    | Description                                                           | Max Characters                                                |
| ----------------------------------- | ------- | --------------------------------------------------------------------- | -------------------------------------------------------------------- |
| `name` *                          | string  | Full name of the investor representative.                         | 255                                                                  |
| `document_number` *               | string  | Document number (CPF, format "XXX.XXX.XXX-XX").            | 11                                                                   |
| `birthdate`*                      | string  | Representative's birth date in ISO 8601 format (YYYY-MM-DD). | -                                                                    |
| `document_identification_number`* | string  | Document identification number.                              | 255                                                                  |
| `marital_status`*                 | string  | Representative's marital status.                                        | **[marital_status Enumerators](#marital_status-enumerators)**   |
| `property_system`*                | string  | Property regime.                                                       | **[property_system Enumerators](#property_system-enumerators)** |
| `nationality`*                    | string  | Representative's nationality.                         | 255                                                                  |
| `mother_name`                     | string  | Representative's mother's full name.                               | 1023                                                                 |
| `father_name`                     | string  | Representative's father's full name.                                | 1023                                                                 |
| `occupation`*                     | string  | Representative's occupation or profession.                            | 255                                                                  |
| `is_pep`*                         | boolean | Indicates if the representative is a Politically Exposed Person (PEP).  | -                                                                    |
| `address` *                       | string  | Object referencing the address                                      | **[address object](#address-object)**                             |

### Address Object

| Field             | Type   | Description                              | Max Characters |
| ----------------- | ------ | ---------------------------------------- | ---------------- |
| `street` *      | string | Street name of the company address.     | 500              |
| `neighborhood`  | string | Neighborhood name of the company address.  | 100              |
| `number` *      | string | Address number.                    | 10               |
| `postal_code` * | string | Address postal code (numbers only).     | 8                |
| `city` *        | string | City name of the address.             | 255              |
| `state` *       | string | State abbreviation (2 characters).          | 2                |
| `complement`    | string | Address complement, if applicable. | 100              |

### marital_status Enumerators

| Enum             | Description        |
| ---------------- | ------------------ |
| `single`       | Single        |
| `married`      | Married          |
| `widower`      | Widowed          |
| `separated`    | Separated        |
| `stable_union` | In Stable Union |
| `divorced`     | Divorced      |

### property_system Enumerators

| Enum                                    | Description                       |
| --------------------------------------- | --------------------------------- |
| `total_communion_of_goods`            | Total Communion of Goods           |
| `partial_communion_of_goods`          | Partial Communion of Goods         |
| `total_separation_of_goods`           | Total Separation of Goods         |
| `final_participation_of_acquisitions` | Final Participation in Acquisitions |
| `compulsory_separation_of_goods`      | Compulsory Separation of Goods  |

## Response

STATUS 201

Response Body

```json
{
  "investor_representative_key": "123e4567-e89b-12d3-a456-426614174000",
  "name": "João da Silva",
  "document_number": "123.456.789-01",
  "document_identification_number": "987654321",
  "marital_status": "single",
  "property_system": "partial_communion_of_goods",
  "birthdate": "1990-01-01",
  "nationality": "Brasileiro",
  "mother_name": "Maria da Silva",
  "father_name": "José da Silva",
  "occupation": "Advogado",
  "is_pep": false,
  "address": {
      "street": "Rua das Empresas",
      "neighborhood": "Centro",
      "number": "123",
      "postal_code": "01001-000",
      "city": "São Paulo",
      "state": "SP",
      "complement": "Sala 101"
  },
  "investor_representative_document_list": []
}
```

### Response Body Params

| Field                                     | Type    | Description                                                          | Max Characters                                                |
| ----------------------------------------- | ------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- |
| `investor_representative_key`           | string  | Unique identifier of the investor representative (UUID v4).       | 36                                                                   |
| `name`                                  | string  | Full name of the investor representative.                        | 255                                                                  |
| `document_number`                       | string  | Representative's document number (CPF format).                 | 11                                                                   |
| `document_identification_number`        | string  | Document identification number.                             | 255                                                                  |
| `marital_status`                        | string  | Representative's marital status.                                       | **[marital_status Enumerators](#marital_status-enumerators)**   |
| `property_system`                       | string  | Property regime.                                                      | **[property_system Enumerators](#property_system-enumerators)** |
| `birthdate`                             | string  | Representative's birth date.                                 | -                                                                    |
| `nationality`                           | string  | Representative's nationality.                        | 255                                                                  |
| `mother_name`                           | string  | Representative's mother's full name.                              | 1023                                                                 |
| `father_name`                           | string  | Representative's father's full name.                               | 1023                                                                 |
| `occupation`                            | string  | Representative's occupation or profession.                           | 255                                                                  |
| `is_pep`                                | boolean | Indicates if the representative is a Politically Exposed Person (PEP). | -                                                                    |
| `address` *                             | string  | Object referencing the address                                     | **[address object](#address-object)**                             |
| `investor_representative_document_list` | array   | List of documents associated with the representative.                     | -                                                                    |

---

# Investor Representative Removal

URL: /en/documentation/escrituracao/homologacao-investidor/cadastro/representantes-investidor-remocao

This endpoint allows removing representatives submitted for investor registration.

---

## Request
ENDPOINT /investor_management/investor/ INVESTOR-KEY /investor_representative/ INVESTOR-REPRESENTATIVE-KEY
METHOD DELETE

### Path Params

| Field                       | Type   | Description                                              | Characters |
|-----------------------------|--------|--------------------------------------------------------|------------|
| `INVESTOR-KEY`                | string | Unique investor key (UUID v4).                      | 36         |
| `INVESTOR-REPRESENTATIVE-KEY` | string | Unique key of the representative to be removed (UUID v4). | 36         |

## Response
STATUS 204

No content is returned in the response body.

---

# Get Investor

URL: /en/documentation/escrituracao/homologacao-investidor/consulta/consulta-investidor-chave

This endpoint allows querying the complete details of an investor registered in the system, using their unique key.

---

## Request
ENDPOINT /investor_management/investor/ INVESTOR-KEY
METHOD GET

### Path Params

| Field        | Type   | Description                                | Characters |
|--------------|--------|------------------------------------------|------------|
| `INVESTOR-KEY` | string | Unique investor key (UUID v4).         | 36         |

## Response
STATUS 200

Response Body

```json
{
    "investor_key": "07b1ac01-5fc4-475f-930b-19595f24bc1e",
    "name": "Fabrica Exemplo S.A.",
    "document_number": "96.146.194/0001-07",
    "status": "in_filling",
    "backoffice_analysis_status": "in_analysis",
    "person_type": "legal",
    "trading_name": "Fabrica Comércio",
    "cnae_code": "62.02-3-00",
    "company_type": "sa",
    "foundation_date": "2000-01-01",
    "address": {
      "street": "Rua das Empresas",
      "neighborhood": "Centro",
      "number": "123",
      "postal_code": "01001-000",
      "city": "São Paulo",
      "state": "SP",
      "complement": "Sala 101"
    },
    "registration_datetime": "2025-01-23T13:47:57.354528",
    "expiration_date": "2026-01-23",
    "signer_group_list": [],
    "bank_account_list": [],
    "investor_representative_list": [],
    "investor_contact_information_list": [],
    "investor_document_list": [],
    "investor_analysis_list": []
}
```

### Response Body Params

| Field  | Type     | Description                                              | Max Characters |
|--------|----------|--------------------------------------------------------|-----------------------|
| `investor_key` | string   | Unique investor identifier.                        | 36                    |
| `name` | string   | Full investor name.                              | 255                   |
| `document_number` | string   | Investor document number (CNPJ).                 | 14                    |
| `status` | string   | Investor status                                      | **[status Enumerators](#status-enumerators)** |
| `backoffice_analysis_status`| string   | Backoffice analysis status.                       | -                     |
| `person_type` | string   | Person type (`legal` or `natural`).                 | -                     |
| `trading_name` | string   | Investor trade name.                              | 1023                  |
| `cnae_code` | string   | Investor CNAE code.                                | 7                     |
| `company_type` | string   | Company type Accepted: ´sa´, ´ltda´, ´cop´                          | 50                    |
| `foundation_date` | string   | Investor foundation date.                           | -                     |
| `signer_group_list` | array    | List of signer groups associated with the investor.   | -                     |
| `bank_account_list` | array    | List of bank accounts associated with the investor.       | -                     |
| `investor_representative_list` | array    | List of investor representatives.                    | -                     |
| `investor_contact_information_list` | array    | List of contact information associated with the investor. | -                     |
| `investor_document_list` | array    | List of documents registered for the investor.        | -                     |
| `address` *         | string   | Object referencing the address                   | **[address object](#address-object)**|

### Address Object

| Field               | Type     | Description                                           | Max Characters |
|---------------------|----------|-----------------------------------------------------|-----------------|
| `street` *          | string   | Street name of the company address.                 | 500             |
| `neighborhood`      | string   | Neighborhood name of the company address.              | 100             |
| `number` *          | string   | Address number.                                 | 10              |
| `postal_code` *     | string   | Address postal code (numbers only).                  | 8               |
| `city` *            | string   | City name of the address.                         | 255             |
| `state` *           | string   | State abbreviation (2 characters).                     | 2               |
| `complement`        | string   | Address complement, if applicable.              | 100             |

### status Enumerators
| Enum   | 	Description    |
|--------|-----------------|
| `in_filling` | In filling |
| `in_analysis`	  | Under analysis      |
| `canceled`	 | Canceled       |
| `approved`	 | Approved        |
| `reproved`	 | Rejected       |
| `expired`	 | Expired        |

---

# Investor Query by Filters

URL: /en/documentation/escrituracao/homologacao-investidor/consulta/consulta-investidor-filtro

This endpoint allows querying investors registered in the system using document number (CNPJ) or Name.

---

## Request
ENDPOINT /investor_management/investor
METHOD GET

### Query Params

| Field             | Type     | Description                          | Required |
|-------------------|----------|------------------------------------|-------------|
| `document_number` | string   | Investor document number.    | No         |
| `name`            | string   | Investor name.                   | No         |
| `page`            | integer  | Current page of the query.          | No         |
| `rows_per_page`   | integer  | Number of records per page.    | No         |

## Response
STATUS 200

Response Body

```json
{
  "data": [
    {
        "investor_key": "495ae701-5c38-49b1-b517-a3b910fe8d8f",
        "name": "Empresa Exemplo S.A.",
        "document_number": "12.345.678/0001-95",
        "status": "in_filling"
    }
  ],
  "pagination": {
    "current_page": 1,
    "next_page": null,
    "rows_per_page": 100,
    "total_pages": 1,
    "total_rows": 1
  }
}
```

### Response Body Params

| Field        | Type   | Description           |                                                                 |
|--------------|--------|---------------------|-----------------------------------------------------------------|
| `data`       | list   | Results list | **[Simplified Investor Object](#simplified-investor-object)** |
| `pagination` | object | Pagination data  | **[Pagination Object](#pagination-object)**                       |

### Simplified Investor Object

| Field            | Type     | Description                                                     | Max Characters                            |
|-------------------|----------|-------------------------------------------------------------|-------------------------------------------------|
| `investor_key` | string   | Unique investor identifier (UUID v4).                  | 36                                              |
| `name`     | string   | Full investor name.                                   | 255                                             |
| `document_number` | string | Investor document number (CNPJ).                   | 14                                              |
| `status`   | string   | Current investor status.                 | **[status enumerators](#status-enumerators)** |

### status enumerators
| Enum   | 	Description    |
|--------|-----------------|
| `in_filling` | In filling |
| `in_analysis`	  | Under analysis      |
| `canceled`	 | Canceled       |
| `approved`	 | Approved        |
| `reproved`	 | Rejected       |
| `expired`	 | Expired        |

### Pagination Object

| Field             | Type     | Description                                |
|-------------------|----------|------------------------------------------|
| `current_page`    | integer  | Current page of the query.                |
| `next_page`       | integer  | Next page, if it exists.             |
| `rows_per_page`   | integer  | Number of records per page.          |
| `total_pages`     | integer  | Total number of pages.                 |
| `total_rows`      | integer  | Total number of records found.   |

---

# Investor Analysis Submission

URL: /en/documentation/escrituracao/homologacao-investidor/envio-analise/

This endpoint allows changing an investor's status to analysis, sending it to the validation process.

---

## Request
ENDPOINT /investor_management/investor/ INVESTOR-KEY
METHOD PATCH

### Path Params

| Field        | Type   | Description                                | Characters |
|--------------|--------|------------------------------------------|------------|
| `INVESTOR-KEY` | string | Unique investor key (UUID v4).         | 36         |

### Request Body

Request Body
```json
{
  "investor_status": "in_analysis"
}
```

### Request Body Params

| Field           | Type     | Description                                         | Required |
|------------------|----------|-------------------------------------------------|-------------|
| `investor_status`  | string   | New investor status. Accepted value: `in_analysis`. | Yes         |

## Response
 The response is a complete updated JSON of the investor.

---

# Introduction

URL: /en/documentation/escrituracao/homologacao-investidor/inicio

The investor registration section is essential for the beginning of Commercial Paper issuance. In this section we will explain the entire flow, from sending the first information, to sending for analysis.

To have access to the services discussed in the next sessions, contact the team [suporte.dcm@qitech.com.br](mailto:suporte.dcm@qitech.com.br), so that the proper releases can be made, both in the Sandbox environment and in the production environment.

### Investor Registration

At this stage, all information about both the Investor and their representatives, documents, contact information, subscriber groups and bank accounts must be sent.

Once the information submission is completed, the registration is sent for analysis and after approval this investor will be able to participate in the Commercial Paper issuance.

### Investor Update

In case of need for registration updates, all Investor information must be sent again with the desired modifications. After submission, a new Analysis is generated for validation. 

As soon as this new Analysis is approved, the new Investor registration data is effectively changed.

---

# **Investor Data Access Request**

URL: /en/documentation/escrituracao/homologacao-investidor/solicitacao-acesso

Clients who registered an investor that already has a **unique registration** need to **request access to the investor's data** so they can issue operations with that investor as a party.  

When making this request, the **investor will receive an email with instructions to approve or deny access**.

---

## **Access Request (POST)**

### **Request**
ENDPOINT /investor_management/investor/ INVESTOR-KEY /data_access_request
METHOD POST

### **Path Params**

| Field          | Type   | Description                                     | Max Characters |
|---------------|--------|-----------------------------------------------|-----------------|
| `INVESTOR-KEY` * | string | Unique investor key (UUID v4).             | 36              |

---

## **Request Body**  

No request body is required.

---

## **Response**
STATUS 201

Response Body

```json
{
    "data_access_request_key": "6beb9e44-1513-4d3b-9af5-f3c39ebbf2d0",
    "requested_at": "2025-02-22T10:45:49.609517",
    "responded_at": null,
    "data_access_request_status": "in_analysis"
}
```

### **Response Body Params**

| Field                          | Type     | Description                                                   | Max Characters |
|--------------------------------|----------|-------------------------------------------------------------|-----------------|
| `data_access_request_key` *    | string   | Unique access request key (UUID v4).             | 36              |
| `requested_at` *               | string   | Date and time of the request (ISO 8601 format).              | -               |
| `responded_at`                 | string   | Date and time of the response to the request, if already responded.    | -               |
| `data_access_request_status` * | string   | Request status. | **[data_access_request_status Enumerators](#data_access_request_status-enumerators)** |

---

## **Request Status Query (GET)**

Clients can check if their request was approved, denied or is still under analysis.

## **Request**
ENDPOINT /investor_management/investor/ INVESTOR-KEY /data_access_request
METHOD GET

### **Path Params**

| Field          | Type   | Description                                     | Max Characters |
|---------------|--------|-----------------------------------------------|-----------------|
| `INVESTOR-KEY` * | string | Unique investor key (UUID v4).             | 36              |

## **Response**
STATUS 200

Response Body

```json
[
    {
        "data_access_request_key": "6beb9e44-1513-4d3b-9af5-f3c39ebbf2d0",
        "requested_at": "2025-02-22T10:45:49.609517",
        "responded_at": null,
        "data_access_request_status": "in_analysis"
    }
]
```

### **Response Body Params**

| Field                          | Type     | Description                                                   | Max Characters |
|--------------------------------|----------|-------------------------------------------------------------|-----------------|
| `data_access_request_key` *    | string   | Unique access request key (UUID v4).             | 36              |
| `requested_at` *               | string   | Date and time of the request (ISO 8601 format).              | -               |
| `responded_at`                 | string   | Date and time of the response to the request, if already responded.    | -               |
| `data_access_request_status` * | string   | Request status. | **[data_access_request_status Enumerators](#data_access_request_status-enumerators)** |

---

## **data_access_request_status Enumerators**

| Enum         | Description                                             |
|-------------|------------------------------------------------------|
| `in_analysis` | The request is under analysis by the investor.         |
| `approved`   | Access was approved and the client can view the investor's data. |
| `reproved`   | The request was denied and the client will not be able to access the investor's data. |

---

# Get Transaction Receipt

URL: /en/documentation/escrituracao/integralizacao-cotas/consulta-comprovante-transacao

This endpoint returns the receipt (PDF + metadata) of one of the BaaS TEDs that QI Tech executed for an integralization. A single integralization cycle (investor payment → fees → disbursement) can produce multiple TEDs — pick the one you want with the `transaction_type` query parameter.

If multiple TEDs of the same type were executed for the same integralization (e.g., several `extraordinary_event_payment`), this endpoint returns only the most recent one. To list all of them, use **[Get Integralization Transactions](./consulta-transacoes-integralizacao.md)**.

---

## Get Transaction Receipt (GET)

### Request
ENDPOINT /account_liquidation/integralization/ INTEGRALIZATION-KEY /transaction_receipt
METHOD GET

### Path Params

| Field                 | Type   | Description                                | Characters |
|-----------------------|--------|--------------------------------------------|------------|
| `INTEGRALIZATION-KEY` | string | Unique integralization key (UUID v4).      | 36         |

### Query Params

| Field              | Type   | Description                                                                              | Required |
|--------------------|--------|------------------------------------------------------------------------------------------|----------|
| `transaction_type` | string | Type of TED to fetch. **[transaction_type enums](#transaction_type-enums)**              | Yes      |

---

### Response
STATUS 200

Response Body

```json
{
    "transaction_key": "46804f32-101e-4702-8fbc-c2dbc4c2caec",
    "transaction_amount": 12345.67,
    "transaction_status": "settled",
    "pdf_encoded_string": "JVBERi0xLi4u..."
}
```

---

### Response Body Params

| Field                | Type   | Description                                                                                          |
|----------------------|--------|------------------------------------------------------------------------------------------------------|
| `transaction_key`    | string | Unique BaaS-side TED key — same value returned by `consulta-transacoes-integralizacao`.              |
| `transaction_amount` | number | TED amount as recorded by QI Tech.                                                                   |
| `transaction_status` | string | TED status on the BaaS side (e.g., `settled`, `paid`).                                               |
| `pdf_encoded_string` | string | Bank receipt as a base64-encoded string. Decode it to retrieve the PDF.                              |

---

### transaction_type enums

| Enum                          | Description                                                                              |
|-------------------------------|------------------------------------------------------------------------------------------|
| `disbursement`                | TED that delivered the issuer's net amount to the issuer's bank account.                 |
| `bookkeeping_fee_internal`    | TED to QI CTVM for the internal bookkeeping fee.                                         |
| `bookkeeping_fee_external`    | TED to the client's external bookkeeping account.                                        |
| `structuring_fee`             | TED to the client's structuring account.                                                 |
| `extraordinary_event_payment` | TED to an investor for an extraordinary settlement event.                                |

---

### Errors

| HTTP | Code                                                | When                                                                                                                |
|------|-----------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| 400  | `HTTPMissingParam`                                  | The `transaction_type` query parameter was not provided.                                                            |
| 400  | `HTTPInvalidParam`                                  | `transaction_type` is not one of the allowed values.                                                                |
| 404  | `ACL000004` (`IntegralizationTransactionNotFound`)  | No TED of the requested type exists for the integralization, OR the integralization was never settled (no TEDs).   |

:::note
A 404 with `ACL000004` is returned identically in every scenario (unknown key, never-settled integralization, or missing TED type) — by design, we don't differentiate the cases. To check whether an integralization exists, list its transactions first.
:::

---

# Consulta de Conta de Liquidação

URL: /en/documentation/escrituracao/integralizacao-cotas/consulta-conta-liquidacao

Este endpoint permite consultar os detalhes da conta de liquidação de um emissor — dados bancários (agência, conta, dígito), status e, quando a conta já está aberta, informações do titular e saldos.

Enquanto a conta ainda não foi aberta no BaaS, o endpoint retorna apenas os dados básicos com `account_status: "pending"`. Após a abertura, a resposta inclui os campos adicionais do titular e de saldo.

---

## Consulta de Conta de Liquidação (GET)

### Request
ENDPOINT /account_liquidation/issuer/ ISSUER-KEY
MÉTODO GET

### Path Params

| Campo        | Tipo   | Descrição                            | Caracteres |
|--------------|--------|--------------------------------------|------------|
| `ISSUER-KEY` | string | Chave única do emissor (UUID v4).    | 36         |

---

### Response
STATUS 200

Response Body — conta aberta

```json
{
    "issuer_key": "23d933e9-88ba-4291-a6a4-33f025ab361f",
    "tenant_key": "5e3045af-8be8-4cbd-9aab-9e15c4e92154",
    "bank_account_key": "8f2a6f10-3c43-4a3b-9f5e-2a9a1d4be0c1",
    "request_account_key": "1c0a2e54-77a8-4f0e-8d8e-6f2b9b3c1d22",
    "account_key": "46804f32-101e-4702-8fbc-c2dbc4c2caec",
    "account_branch": "0001",
    "account_number": "1234567",
    "account_digit": "8",
    "account_status": "opened",
    "account_type": "payment_account",
    "account_documents": [],
    "balance": 12345.67,
    "blocked_balance": 0.0,
    "owner_document_number": "12345678000190",
    "owner_name": "Emissor Exemplo LTDA",
    "owner_person_key": "9b1f3c77-5a2d-4e8f-b6a0-3d2c1e0f9a88",
    "created_at": "2026-01-15T12:34:56"
}
```

Response Body — conta pendente

```json
{
    "issuer_key": "23d933e9-88ba-4291-a6a4-33f025ab361f",
    "tenant_key": "5e3045af-8be8-4cbd-9aab-9e15c4e92154",
    "bank_account_key": "8f2a6f10-3c43-4a3b-9f5e-2a9a1d4be0c1",
    "request_account_key": "1c0a2e54-77a8-4f0e-8d8e-6f2b9b3c1d22",
    "account_branch": "0001",
    "account_number": "1234567",
    "account_digit": "8",
    "account_status": "pending"
}
```

---

### Response Body Params

| Campo                   | Tipo   | Descrição                                                                                   |
|-------------------------|--------|---------------------------------------------------------------------------------------------|
| `issuer_key`            | string | Chave única do emissor.                                                                     |
| `tenant_key`            | string | Chave única do cliente dono da conta.                                                       |
| `bank_account_key`      | string | Chave única da conta bancária no BaaS.                                                      |
| `request_account_key`   | string | Chave única da solicitação de abertura da conta.                                            |
| `account_key`           | string | Chave única da conta no BaaS. Presente apenas quando a conta já foi aberta.                 |
| `account_branch`        | string | Agência da conta.                                                                           |
| `account_number`        | string | Número da conta.                                                                            |
| `account_digit`         | string | Dígito da conta.                                                                            |
| `account_status`        | string | Status da conta. `pending` enquanto a abertura não foi concluída.                           |
| `account_type`          | string | Tipo da conta no BaaS. Presente apenas quando a conta já foi aberta.                        |
| `account_documents`     | array  | Documentos associados à conta. Presente apenas quando a conta já foi aberta.                |
| `balance`               | number | Saldo disponível da conta. Presente apenas quando a conta já foi aberta.                    |
| `blocked_balance`       | number | Saldo bloqueado da conta. Presente apenas quando a conta já foi aberta.                     |
| `owner_document_number` | string | CPF/CNPJ do titular da conta. Presente apenas quando a conta já foi aberta.                 |
| `owner_name`            | string | Nome do titular da conta. Presente apenas quando a conta já foi aberta.                     |
| `owner_person_key`      | string | Chave única do titular no BaaS. Presente apenas quando a conta já foi aberta.               |
| `created_at`            | string | Data de criação da conta. Presente apenas quando a conta já foi aberta.                     |

---

### Erros

| HTTP | Código                                                  | Quando ocorre                                                                 |
|------|---------------------------------------------------------|-------------------------------------------------------------------------------|
| 404  | `ACL000002` (`IssuerAccountLiquidationNotFound`)        | Não existe conta de liquidação para o emissor informado.                      |
| 400  | `ACL000003` (`IssuerAccountLiquidationNotBelongToTenant`) | A conta de liquidação do emissor não pertence ao cliente que fez a requisição. |

---

# Get Integralization by Key

URL: /en/documentation/escrituracao/integralizacao-cotas/consulta-processo-integralizacao

This endpoint allows querying the details of an integralization process using its unique key.

---

## Integralization Process (GET)

### Request
ENDPOINT /integralization/integralization_process/ INTEGRALIZATION-KEY
METHOD GET

### Path Params

| Field                 | Type   | Description                                                         | Characters |
|------------------------|--------|------------------------------------------------------------------|------------|
| `INTEGRALIZATION-KEY`  | string | Unique integralization key (UUID v4).                        | 36         |

---

### Response
STATUS 200

Response Body

```json
{
    "tenant_key": "39a0d458-c06f-41e7-92cf-a335cea90675",
    "integralization_key": "072a7cc4-1fbf-419b-8a41-f57bd86ee753",
    "operation_key": "c9cc8980-25b2-49ec-ac40-2a12b8df9dfc",
    "operation_type": "commercial_paper",
    "contract_number": "0000000002",
    "issue_number": 1,
    "issue_series": 1,
    "issuer_key": "1bc06a53-9503-4520-916c-38b5a6bb5912",
    "issuer_name": "Advanced Solutions",
    "issuer_document_number": "05120047000102",
    "issuer_bank_account": {
        "account_type": "checking",
        "account_digit": "3",
        "account_branch": "0001",
        "account_number": "4464541",
        "financial_institution_ispb": "32402502",
        "financial_institution_code_number": "329"
    },
    "subscripted_quantity": 1000000,
    "subscripted_total_amount": 1000000.0,
    "integralized_quantity": 1000000,
    "issue_quantity": 1000000,
    "integralization_status": "finished",
    "subscription_list": [
        {
            "subscription_key": "5a2100db-6bad-4fc7-9b5f-390543c63c55",
            "investor_key": "2d14cfef-7b95-4aa4-be0c-860ec8a60934",
            "investor_name": "Dynamic Group",
            "investor_document_number": "99525109000100",
            "investor_bank_account": {
                "account_digit": "0",
                "account_branch": "1234",
                "account_number": "12345678",
                "financial_institution_ispb": "12345678",
                "financial_institution_code_number": "001"
            },
            "subscription_date": "2025-01-27",
            "financial_base_date": "2025-01-27",
            "subscripted_quantity": 1000000,
            "unit_price": 1.0,
            "expected_amount": 1000000.0,
            "paid_amount": 1000000.0,
            "subscription_note_template_key": "8bfba2a3-1cda-45c4-9a97-05b2bf31e486",
            "subscription_note_document_key": "c9cc8980-25b2-49ec-ac40-2a12b8df9dfc/5a2100db-6bad-4fc7-9b5f-390543c63c55/subscription_note/8b6867d8-95c8-4e0d-b670-6a7d06f3acf7",
            "subscription_note_signature_status": "pending_creation",
            "subscription_payment_list": [
                {
                    "subscription_payment_key": "edf8a4cc-24c9-4dd9-8cae-9cb9151b40bf",
                    "payment_receipt_document_key": "072a7cc4-1fbf-419b-8a41-f57bd86ee753/5a2100db-6bad-4fc7-9b5f-390543c63c55/subscription_payment/edf8a4cc-24c9-4dd9-8cae-9cb9151b40bf",
                    "description": "Comprovante itau",
                    "amount": 1000000.0,
                    "subscription_payment_status": "confirmed",
                    "updated_at": "2025-01-27T14:30:18.741983"
                }
            ]
        }
    ]
}
```

---

### Response Body Params

| Field                                                                  | Type       | Description                                                                                            |
|------------------------------------------------------------------------|------------|------------------------------------------------------------------------------------------------------|
| `tenant_key`                                                           | string     | Unique key of the tenant associated with the integralization.                                                    |
| `integralization_key`                                                  | string     | Unique integralization key.                                                                       |
| `operation_key`                                                        | string     | Unique key of the associated operation.                                                                   |
| `operation_type`                                                       | string     | Operation type. Possible values: `commercial_paper`.                                             |
| `contract_number`                                                      | string     | Contract number associated with the integralization.                                                       |
| `issue_number`                                                         | integer    | Issue number associated with the integralization.                                                        |
| `issue_series`                                                         | integer    | Issue series associated with the integralization.                                                         |
| `issuer_key`                                                           | string     | Unique key of the associated issuer.                                                                    |
| `issuer_name`                                                          | string     | Name of the issuer associated with the integralization.                                                          |
| `issuer_document_number`                                               | string     | Issuer document number                                                                       |
| `issuer_bank_account`                                                  | object     | Issuer bank account data.                                                                  |
| `issuer_bank_account.account_type`                                     | string   | Bank account type (`checking`, etc.).                                                           |
| `issuer_bank_account.account_digit`                                    | string   | Bank account verification digit.                                                                |
| `issuer_bank_account.account_branch`                                   | string   | Bank branch.                                                                                    |
| `issuer_bank_account.account_number`                                   | string   | Bank account number.                                                                            |
| `issuer_bank_account.financial_institution_ispb`                       | string   | Financial institution ISPB.                                                                      |
| `issuer_bank_account.financial_institution_code_number`                | string | Financial institution code.                                                                    |
| `subscripted_quantity`                                                 | integer    | Total quantity of subscribed shares.                                                                |
| `subscripted_total_amount`                                             | number     | Total value of subscribed shares.                                                                    |
| `integralized_quantity`                                                | integer    | Total quantity of integralized shares.                                                            |
| `issue_quantity`                                                       | integer    | Total quantity of shares issued in the operation.                                                      |
| `integralization_status`                                               | string     | Integralization status. Possible values: `pending`, `finished`.                                  |
| `subscription_list`                                                    | array      | List of subscriptions associated with the integralization.    **[subscription object](#subscription-object)** |

### subscription object

| Field                                                                  | Type       | Description                                                                                                     |
|------------------------------------------------------------------------|------------|---------------------------------------------------------------------------------------------------------------|
| `subscription_key`                                   | string   | Unique subscription key.                                                                                    |
| `investor_key`                                       | string   | Unique key of the investor associated with the subscription.                                                             |
| `investor_name`                                      | string   | Investor name.                                                                                           |
| `investor_document_number`                           | string   | Investor document number (CPF or CNPJ).                                                              |
| `investor_bank_account`                              | object   | Investor bank data.                                                                                |
| `subscription_date`                                  | string   | Subscription date (format: YYYY-MM-DD).                                                                     |
| `financial_base_date`                                | string   | Financial base date of the subscription (format: YYYY-MM-DD).                                                     |
| `subscripted_quantity`                               | integer  | Quantity of subscribed shares.                                                                               |
| `unit_price`                                         | number   | Unit price of shares.                                                                                     |
| `expected_amount`                                    | number   | Total expected value of the subscription.                                                                           |
| `paid_amount`                                        | number   | Paid amount already confirmed of the subscription.                                                                       |
| `subscription_note_template_key`                     | string   | Subscription note template key.                                                                      |
| `subscription_note_document_key`                     | string   | Subscription note document key.                                                                     |
| `subscription_note_signature_status`                 | string | Subscription note signature status.                                                                   |
| `subscription_payment_list`                          | array    | List of payments associated with the subscription. **[subscription_payment object](#subscription_payment-object)]** |

### subscription_payment object

| Field                                                                  | Type       | Description                                                                              |
|------------------------------------------------------------------------|------------|----------------------------------------------------------------------------------------|
| `subscription_payment_key` | string   | Unique subscription payment key.                                                |
| `payment_receipt_document_key`                                         | string   | Payment receipt document key.                                        |
| `description`                                                          | string   | Payment receipt description.                                                 |
| `amount`                                                               | number   | Registered payment amount.                                                         |
| `subscription_payment_status`                                          | string   | Payment status. Possible values: `waiting_confirmation`, `confirmed`, `denied`. |
| `updated_at`                                                           | string   | Date and time of last payment update (format: ISO 8601).                    |

---

# Get Integralization Transactions

URL: /en/documentation/escrituracao/integralizacao-cotas/consulta-transacoes-integralizacao

This endpoint returns metadata for every BaaS TED executed by QI Tech for an integralization — without the PDF. Useful for discovering how many receipts exist, in what order they were executed, and their `transaction_key`. To get the PDF for a specific TED, use **[Get Transaction Receipt](./consulta-comprovante-transacao.md)**.

The response is in chronological order (`created_at` ASC) and includes every TED in the cycle (disbursement, fees, and extraordinary events). When multiple TEDs of the same type exist (e.g., several `extraordinary_event_payment`), all of them appear here — unlike the receipt endpoint, which returns only the most recent.

---

## Get Transactions (GET)

### Request
ENDPOINT /account_liquidation/integralization/ INTEGRALIZATION-KEY /transactions
METHOD GET

### Path Params

| Field                 | Type   | Description                                | Characters |
|-----------------------|--------|--------------------------------------------|------------|
| `INTEGRALIZATION-KEY` | string | Unique integralization key (UUID v4).      | 36         |

---

### Response
STATUS 200

Response Body

```json
[
    {
        "transaction_key": "46804f32-101e-4702-8fbc-c2dbc4c2caec",
        "external_id": "072a7cc4-1fbf-419b-8a41-f57bd86ee753",
        "transaction_amount": 12345.67,
        "transaction_type": "disbursement",
        "transaction_status": "paid",
        "created_at": "2026-05-05T13:22:01"
    }
]
```

---

### Response Body Params

| Field                | Type   | Description                                                                                              |
|----------------------|--------|----------------------------------------------------------------------------------------------------------|
| `transaction_key`    | string | Unique BaaS-side TED key.                                                                                |
| `external_id`        | string | `integralization_key` the TED belongs to.                                                                |
| `transaction_amount` | number | TED amount as recorded by QI Tech. Do not treat as the authoritative value for accounting reconciliation.|
| `transaction_type`   | string | TED type. **[transaction_type enums](./consulta-comprovante-transacao.md#transaction_type-enums)**       |
| `transaction_status` | string | Current TED status (e.g., `paid`, `settled`).                                                            |
| `created_at`         | string | Record creation timestamp (ISO 8601).                                                                    |

---

# Introduction to Shares Integralization

URL: /en/documentation/escrituracao/integralizacao-cotas/inicio

After completing the Commercial Paper issuance process, the operation will remain in issued status.

By default, the share subscription process for integralization occurs automatically after signing the constitutive instrument.

When consulting an operation in issued state, a field called `integralization_key` will be available through which the integralization process can be monitored.

The integralization process consists of:

- Share subscription
- Subscription note signing
- Payment registration
- Payment confirmation

---

# Subscription Registration

URL: /en/documentation/escrituracao/integralizacao-cotas/subscricao-cotas/cadastro-subscricao

This endpoint allows registering an investor's intention to subscribe to a specific quantity of shares in an integralization.

---

## Subscription Registration (POST)

### Request

ENDPOINT /integralization/integralization_process/ INTEGRALIZATION-KEY /subscription
METHOD POST

### Path Params

| Field                   | Type   | Description                                 | Characters |
| ----------------------- | ------ | ------------------------------------------- | ---------- |
| `INTEGRALIZATION-KEY` | string | Unique integralization key (UUID v4). | 36         |

---

### Request Body

```json
{
  "investor_key": "123e4567-e89b-12d3-a456-426614174000",
  "investor_bank_account": {
    "account_number": "12345678",
    "account_digit": "0",
    "account_branch": "1234",
    "financial_institution_code_number": "001",
    "financial_institution_ispb": "12345678"
  },
  "subscription_date": "2025-01-01",
  "financial_base_date": "2025-01-01",
  "subscription_note_template_key": "c649c01a-dd24-47b7-b93e-5a6bac50bcf0",
  "subscripted_quantity": 100000
}
```

### Request Body Params

| Field                                                        | Type    | Description                                             |
| ------------------------------------------------------------ | ------- | ------------------------------------------------------- |
| `investor_key`*                                            | string  | Unique investor key (UUID v4).                   |
| `investor_bank_account`*                                   | object  | Investor bank account data.                 |
| `investor_bank_account.account_number`*                    | string  | Investor bank account number.               |
| `investor_bank_account.account_digit`*                     | string  | Investor bank account verification digit.   |
| `investor_bank_account.account_branch`*                    | string  | Investor bank branch.                       |
| `investor_bank_account.financial_institution_code_number`* | string  | Investor's financial institution code.      |
| `investor_bank_account.financial_institution_ispb`*        | string  | Investor's financial institution ISPB.         |
| `subscripted_quantity`*                                    | integer | Quantity of shares the investor wants to subscribe to. |
| `financial_base_date`*                                     | string  | Financial base date.                                   |
| `subscription_date`*                                       | string  | Subscription date.                                   |
| `subscription_note_template_key`*                          | string  | Subscription bulletin template.                    |

---

### Response

STATUS 201

Response Body

```json
{
    "subscription_key": "2f7e00b5-988f-4214-bb46-4728d9081148",
    "investor_key": "a76e408a-c733-4a68-963a-dc93ff0bc3e3",
    "investor_name": "Global Enterprises",
    "investor_document_number": "89206257000108",
    "investor_bank_account": {
        "account_digit": "0",
        "account_branch": "1234",
        "account_number": "12345678",
        "financial_institution_ispb": "12345678",
        "financial_institution_code_number": "001"
    },
    "subscription_date": "2025-01-27",
    "financial_base_date": "2025-01-27",
    "subscripted_quantity": 1000000,
    "unit_price": 1.0,
    "expected_amount": 1000000.0,
    "paid_amount": 1000000.0,
    "subscription_note_template_key": "6d4c5168-b7c7-4092-9931-4c76aea6af80",
    "subscription_note_document_key": "5ea88fca-4ca3-4dfe-aea4-35e431aef3c5/2f7e00b5-988f-4214-bb46-4728d9081148/subscription_note/f206d799-cb94-48d5-81c5-5988ecef8079",
    "envelope_signature_status": "pending_creation",
    "envelope_signature_url": "https://certifiqi.com.br/envelope_key",
    "envelope_key": "6d4c5168-b7c7-4092-9931-4c76aea6af80",
    "subscription_payment_list": [
        {
            "subscription_payment_key": "7e51be5b-fdfd-4f2f-ba1a-0d81cdb08177",
            "payment_receipt_document_key": "f352de14-222f-4787-bd67-2063524f8d9f/2f7e00b5-988f-4214-bb46-4728d9081148/subscription_payment/7e51be5b-fdfd-4f2f-ba1a-0d81cdb08177",
            "description": "Comprovante itau",
            "amount": 1000000.0,
            "subscription_payment_status": "confirmed",
            "updated_at": "2025-01-27T14:33:54.214891"
        }
    ]
}
```

### **Response Body Params**

| Field                              | Type    | Description                                                                                                                  |
| ---------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `subscription_key`               | string  | Unique subscription key (UUID v4).                                                                                      |
| `investor_key`                   | string  | Unique key of the investor associated with the subscription (UUID v4).                                                              |
| `investor_name`                  | string  | Investor name.                                                                                                          |
| `investor_document_number`       | string  | Investor document number (CPF or CNPJ).                                                                            |
| `investor_bank_account`          | object  | **[investor_bank_account object](#investor_bank_account-object)**.                                                        |
| `subscription_date`              | string  | Subscription date (format: YYYY-MM-DD).                                                                                  |
| `financial_base_date`            | string  | Financial base date of the subscription (format: YYYY-MM-DD).                                                                  |
| `subscripted_quantity`           | integer | Quantity of subscribed shares.                                                                                              |
| `unit_price`                     | number  | Unit price of subscribed shares.                                                                                       |
| `expected_amount`                | number  | Total expected value of the subscription.                                                                                        |
| `paid_amount`                    | number  | Total amount paid in the subscription.                                                                                            |
| `subscription_note_template_key` | string  | Unique subscription note template key (UUID v4).                                                                  |
| `subscription_note_document_key` | string  | Unique subscription note document key.                                                                           |
| `envelope_signature_status`      | string  | Subscription note signature status.                                                                                |
| `envelope_signature_url`         | string  | Subscription note signature URL.                                                                                   |
| `envelope_key`                   | string  | Signature envelope key.                                                                                             |
| `subscription_payment_list`      | array   | List of payments associated with the subscription.**[subscription_payment_list object](#subscription_payment_list-object)**. |

---

### investor_bank_account object

| Field                                 | Type   | Description                                           |
| ------------------------------------- | ------ | ----------------------------------------------------- |
| `account_number`                    | string | Investor bank account number.             |
| `account_digit`                     | string | Investor bank account verification digit. |
| `account_branch`                    | string | Investor bank branch.                     |
| `financial_institution_code_number` | string | Investor's financial institution code.    |
| `financial_institution_ispb`        | string | Investor's financial institution ISPB.       |

### subscription_payment_list object

| Field                            | Type   | Description                                                                                  |
| -------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| `subscription_payment_key`     | string | Unique subscription payment key (UUID v4).                                         |
| `payment_receipt_document_key` | string | Payment receipt document key.                                              |
| `description`                  | string | Payment receipt description.                                                     |
| `amount`                       | number | Registered payment amount.                                                               |
| `subscription_payment_status`  | string | Payment status. Possible values:`waiting_confirmation`, `confirmed`, `denied`. |
| `updated_at`                   | string | Date and time of last payment update (format: ISO 8601).                       |

---

# Cancel Subscription

URL: /en/documentation/escrituracao/integralizacao-cotas/subscricao-cotas/cancelar-subscricao

---

### Request
ENDPOINT /integralization/integralization_process/ INTEGRALIZATION-KEY /subscription/ SUBSCRIPTION-KEY
METHOD PATCH

### Path Params

| Field           | Type   | Description                                            | Characters |
|------------------|--------|------------------------------------------------------|------------|
| `INTEGRALIZATION-KEY`  | string | Unique integralization process key (UUID v4). | 36         |
| `SUBSCRIPTION-KEY`  | string | Unique subscription key (UUID v4).                 | 36         |

---

### Request Body

```json
{
  "subscription_status": "canceled"
}
```
### Request Body Params

| Field             | Type     | Description                               | Required |
|-------------------|----------|-----------------------------------------|-------------|
| `subscription_status` | string   | Accepted values: `canceled`.            | Yes         |

---

### Response

STATUS 200

An updated copy of the Subscription will be returned.

---

---

# Subscription Payment Confirmation or Rejection

URL: /en/documentation/escrituracao/integralizacao-cotas/subscricao-cotas/confirmacao-pagamento

This endpoint allows confirming or rejecting the payment associated with an integralization subscription. The payment status is updated according to the value provided in the request body.

---

## Payment Status Update (PATCH)

### Request

ENDPOINT /integralization_integralization_process/ INTEGRALIZATION-KEY /subscription/ SUBSCRIPTION-KEY /subscription_payment/ SUBSCRIPTION-PAYMENT-KEY
METHOD PATCH

### Path Params

| Field                        | Type   | Description                                          | Characters |
| ---------------------------- | ------ | ---------------------------------------------------- | ---------- |
| `INTEGRALIZATION-KEY`      | string | Unique integralization key (UUID v4).          | 36         |
| `SUBSCRIPTION-KEY`         | string | Unique associated subscription key (UUID v4).    | 36         |
| `SUBSCRIPTION-PAYMENT-KEY` | string | Unique subscription payment key (UUID v4). | 36         |

---

### Request Body

```json
{
  "subscription_payment_status": "confirmed"
}
```

### Request Body Params

| Field                            | Type   | Description                                                               | Required |
| -------------------------------- | ------ | ------------------------------------------------------------------------- | ------------ |
| `subscription_payment_status`* | string | New payment status. Possible values:`confirmed` or `denied`. | Yes          |

---

### Response

STATUS 200

Response Body

```json
{
    "subscription_payment_key": "7e51be5b-fdfd-4f2f-ba1a-0d81cdb08177",
    "payment_receipt_document_key": "f352de14-222f-4787-bd67-2063524f8d9f/2f7e00b5-988f-4214-bb46-4728d9081148/subscription_payment/7e51be5b-fdfd-4f2f-ba1a-0d81cdb08177",
    "description": "Comprovante de pagamento Itau R$100.000,00",
    "amount": 100000.0,
    "subscription_payment_status": "waiting_confirmation",
    "updated_at": "2025-01-24T11:30:00Z"
}
```

---

### Response Body Params

| Field                           | Type   | Description                                                                                            |
| ------------------------------- | ------ | ------------------------------------------------------------------------------------------------------ |
| `subscription_payment_key`    | string | Unique subscription payment key (UUID v4).                                                   |
| `amount`                      | number | Declared value of the registered payment.                                                               |
| `description`                 | number | Description of the receipt content.                                                                     |
| `subscription_payment_status` | string | Updated payment status. Possible values:`waiting_confirmation` `confirmed`, `denied`. |
| `updated_at`                  | string | Date and time of payment status update (format: ISO 8601).                               |

---

# Get Subscription

URL: /en/documentation/escrituracao/integralizacao-cotas/subscricao-cotas/consulta-subscricao-cotas

This endpoint allows querying an ongoing subscription.

---

## Subscription Query (GET)

### Request
ENDPOINT /integralization/integralization_process/ INTEGRALIZATION-KEY /subscription/ SUBSCRIPTION-KEY
METHOD GET

### Path Params

| Field                 | Type   | Description                                | Characters |
|-----------------------|--------|------------------------------------------|------------|
| `INTEGRALIZATION-KEY` | string | Unique integralization key (UUID v4). | 36         |
| `SUBSCRIPTION-KEY`    | string | Unique subscription key (UUID v4).     | 36         |

---

### Response
STATUS 201

Response Body

```json
{
    "subscription_key": "2f7e00b5-988f-4214-bb46-4728d9081148",
    "investor_key": "a76e408a-c733-4a68-963a-dc93ff0bc3e3",
    "investor_name": "Global Enterprises",
    "investor_document_number": "89206257000108",
    "investor_bank_account": {
        "account_digit": "0",
        "account_branch": "1234",
        "account_number": "12345678",
        "financial_institution_ispb": "12345678",
        "financial_institution_code_number": "001"
    },
    "subscription_date": "2025-01-27",
    "financial_base_date": "2025-01-27",
    "subscripted_quantity": 1000000,
    "unit_price": 1.0,
    "expected_amount": 1000000.0,
    "paid_amount": 1000000.0,
    "subscription_note_template_key": "6d4c5168-b7c7-4092-9931-4c76aea6af80",
    "subscription_note_document_key": "5ea88fca-4ca3-4dfe-aea4-35e431aef3c5/2f7e00b5-988f-4214-bb46-4728d9081148/subscription_note/f206d799-cb94-48d5-81c5-5988ecef8079",
    "envelope_signature_status": "pending_creation",
    "envelope_signature_url": "https://certifiqi.com.br/envelope_key",
    "envelope_key": "6d4c5168-b7c7-4092-9931-4c76aea6af80",
    "subscription_payment_list": [
        {
            "subscription_payment_key": "7e51be5b-fdfd-4f2f-ba1a-0d81cdb08177",
            "payment_receipt_document_key": "f352de14-222f-4787-bd67-2063524f8d9f/2f7e00b5-988f-4214-bb46-4728d9081148/subscription_payment/7e51be5b-fdfd-4f2f-ba1a-0d81cdb08177",
            "description": "Comprovante itau",
            "amount": 1000000.0,
            "subscription_payment_status": "confirmed",
            "updated_at": "2025-01-27T14:33:54.214891"
        }
    ]
}
```

---

### **Response Body Params**

| Field                                                     | Type       | Description                                                                 |
|-----------------------------------------------------------|------------|---------------------------------------------------------------------------|
| `subscription_key`                                        | string     | Unique subscription key (UUID v4).                                     |
| `investor_key`                                            | string     | Unique key of the investor associated with the subscription (UUID v4).              |
| `investor_name`                                           | string     | Investor name.                                                      |
| `investor_document_number`                                | string     | Investor document number (CPF or CNPJ).                         |
| `investor_bank_account`                                   | object     | **[investor_bank_account object](#investor_bank_account-object)**.       |
| `subscription_date`                                       | string     | Subscription date (format: YYYY-MM-DD).                                |
| `financial_base_date`                                     | string     | Financial base date of the subscription (format: YYYY-MM-DD).                |
| `subscripted_quantity`                                    | integer    | Quantity of subscribed shares.                                          |
| `unit_price`                                              | number     | Unit price of subscribed shares.                                     |
| `expected_amount`                                         | number     | Total expected value of the subscription.                                      |
| `paid_amount`                                             | number     | Total amount paid in the subscription.                                          |
| `subscription_note_template_key`                          | string     | Unique subscription note template key (UUID v4).                 |
| `subscription_note_document_key`                          | string     | Unique subscription note document key.                          |
| `envelope_signature_status`                               | string     | Subscription note signature status.                              |
| `envelope_signature_url`                                  | string     | Subscription note signature URL.                                 |
| `envelope_key`                                            | string     | Signature envelope key.                                         |
| `subscription_payment_list`                               | array      | List of payments associated with the subscription. **[subscription_payment_list object](#subscription_payment_list-object)**. |

---

### investor_bank_account object

| Field                          | Type       | Description                                               |
|--------------------------------|------------|---------------------------------------------------------|
| `account_number`              | string     | Investor bank account number.                 |
| `account_digit`               | string     | Investor bank account verification digit.     |
| `account_branch`              | string     | Investor bank branch.                         |
| `financial_institution_code_number` | string | Investor's financial institution code.         |
| `financial_institution_ispb`   | string     | Investor's financial institution ISPB.           |

### subscription_payment_list object

| Field                                                     | Type       | Description                                                                 |
|-----------------------------------------------------------|------------|---------------------------------------------------------------------------|
| `subscription_payment_key`                                | string     | Unique subscription payment key (UUID v4).                        |
| `payment_receipt_document_key`                            | string     | Payment receipt document key.                          |
| `description`                                             | string     | Payment receipt description.                                   |
| `amount`                                                 | number     | Registered payment amount.                                           |
| `subscription_payment_status`                             | string     | Payment status. Possible values: `waiting_confirmation`, `confirmed`, `denied`. |
| `updated_at`                                              | string     | Date and time of last payment update (format: ISO 8601).      |

---

# Subscription Payment Registration

URL: /en/documentation/escrituracao/integralizacao-cotas/subscricao-cotas/registro-de-pagamento

This endpoint allows registering a payment associated with an integralization subscription. The payment includes a declared amount and a receipt in Base64.

---

## Payment Registration (POST)

### Request

ENDPOINT /integralization_integralization_process/ INTEGRALIZATION-KEY /subscription/ SUBSCRIPTION-KEY /subscription_payment
METHOD POST

### Path Params

| Field                   | Type   | Description                                       | Characters |
| ----------------------- | ------ | ------------------------------------------------- | ---------- |
| `INTEGRALIZATION-KEY` | string | Unique integralization key (UUID v4).       | 36         |
| `SUBSCRIPTION-KEY`    | string | Unique key of the associated subscription (UUID v4). | 36         |

---

### Request Body

```json
{
  "document_base64": "dGVzdGVfZG9jdW1lbnRfYmFzZTY0",
  "amount": 100000.00,
  "description": "Comprovante de pagamento Itau R$100.000,00"
}
```

### Request Body Params

| Field                | Type    | Description                                    | Required |
| -------------------- | ------- | ---------------------------------------------- | ------------ |
| `document_base64`* | string  | Payment receipt encoded in Base64. | Yes          |
| `amount`*          | number  | Declared amount of the payment made.        | Yes          |
| `description`      | string | Description of the receipt content.       | Yes          |

---

### Response

STATUS 201

Response Body

```json
{
    "subscription_payment_key": "7e51be5b-fdfd-4f2f-ba1a-0d81cdb08177",
    "payment_receipt_document_key": "f352de14-222f-4787-bd67-2063524f8d9f/2f7e00b5-988f-4214-bb46-4728d9081148/subscription_payment/7e51be5b-fdfd-4f2f-ba1a-0d81cdb08177",
    "description": "Comprovante de pagamento Itau R$100.000,00",
    "amount": 100000.0,
    "subscription_payment_status": "waiting_confirmation",
    "updated_at": null
}
```

---

### Response Body Params

| Field                           | Type   | Description                                                                                     |
| ------------------------------- | ------ | ----------------------------------------------------------------------------------------------- |
| `subscription_payment_key`    | string | Unique subscription payment key (UUID v4).                                            |
| `amount`                      | number | Declared amount of the registered payment.                                                        |
| `subscription_payment_status` | string | Current payment status. Possible values:`waiting_confirmation` `confirmed` `denied` |
| `description`                 | string | Description of the receipt content.                                                        |

---

---

# Receiving Webhooks

URL: /en/documentation/escrituracao/introducao/autenticacao_webhooks

Webhook signing uses a symmetric key encryption strategy, that is, 
both QI CTVM and the integrating partner share the same key. 
When we configure Webhooks, we will generate a Signature Key and make it available. Every request originated in the QI system,
will carry a SIGNATURE header that will be a JWT signed with this key. The encoding is performed with the HS256 algorithm.

Below we have a python example of how to perform signature decoding:
```python
from jose import jwt

signature_key = "UNIQUE CONFIGURED KEY"

signature_token = headers["SIGNATURE"]

decoded_token = jwt.decode(signature_token, key=signature_key, algorithms=["HS256"])
print(decoded_token)
```

We suggest that, in addition to comparing the signature, the integrating partner validates our IP, given that all our requests originate from the same IP, 
according to the environment:

|Environment| IP |
|--------|----|
|Production| -  |
|Sandbox | -  |

:::danger Attention!
QI CTVM webhooks should not be mapped restrictively. 
Additional fields may be included in the webhook payloads returned in our APIs.
:::

---

# Commercial Paper Bookkeeping

URL: /en/documentation/escrituracao/introducao/

This documentation aims to describe the flows, endpoints and data structures necessary to operate and issue **Commercial Paper**.

Note: In case of doubts in any step of the process, please contact [suporte.dcm@qitech.com.br](mailto:suporte.dcm@qitech.com.br) detailing your problem/question and we will assist you.

## Environments (Hosts)

QI CTVM has two environments, SANDBOX and PRODUCTION. Both environments have completely identical code and behavior, however, the SANDBOX environment presents totally fictitious monetary values, and the Production environment performs valid financial transactions.

The Sandbox environment was created for developers to perform their integrations, and when they are ready for production entry, they only need to update the environment variables with the Production parameters.

| Environment | Host                                         |
|----------|----------------------------------------------|
| Sandbox | https://api.sandbox.securities.qidtvm.com.br |
| Production | https://api.securities.qidtvm.com.br |

---

# Test endpoints

URL: /en/documentation/escrituracao/introducao/teste-autenticacao/endpoints_de_teste

## GET Method

### Request

ENDPOINT /authentication_test
METHOD GET

### Response

STATUS 200

Response Body

```json
{
  "success": "Congrats!"
}
```

## POST Method

### Request

ENDPOINT /authentication_test
METHOD POST

Request Body

```json
{
  "name": "QI Tech"
}
```

### Response

STATUS 200

Response Body

```json
{
  "name": "QI Tech",
  "success": "Congrats!"
}

```

---

# Authentication test

URL: /en/documentation/escrituracao/introducao/teste-autenticacao/teste_de_autenticacao

### 1. Introduction

In this section we will explain how the request should work so that it can be accepted by our system. 
First, you must put the API Key provided by the QI CTVM team in the API-CLIENT-KEY header. 
Then you must create an AUTHORIZATION header signing with the integrating partner's Private Key; 

Below we will teach step by step using Python to exemplify the AUTHORIZATION creation process.

### 2. Import libraries
In this Python example we are using 5 libraries to perform the authentication process.

```python
from datetime import datetime
import json
from jose import jwt
from hashlib import md5
import requests
```

### 3. Insert the private key and integration key
```python title="Encryption data"
api_key = "\<API KEY PROVIDED BY QI\>"

client_private_key = '''-----BEGIN EC PRIVATE KEY-----
MIHbAgEBBEH7OuewosJfz4zKF+Gm0ogJxhb8G6LSMDVQQbFYz335mHCx9/Pr6Yk+
yYwsVozeXhlry3/vnUn1zCasU+4O+yseZ6AHBgUrgQQAI6GBiQOBhgAEAa46fN/2
8vI64shRhu9erMA6JLl3zHFX8gFHQrbb0g4IDfjXCKMCILiwdtL8QecstsgepTa7
yo1pTXOVNDbmLX2TAK38xb2Gv6OC+PA+5drF2wWajWbVLpR2R7mYEzr5HNIAJYHb
5C1jvM2ItK2R22HAbYfH25nsvGhkCGbrRNWQVF9g
-----END EC PRIVATE KEY-----'''

```

### 4. Define variables
Define the method, endpoint and content variables specific to each request (in this example, we will use the "POST" method for the "/authentication_test" endpoint)
```python title="Request data"
base_url = "https://api.securities.qidtvm.com.br"
today_str = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S")
method = "POST"
endpoint = "/authentication_test"
body = {"name": "QI Tech"}
```

### 5. Build Base Signature Dictionary
```python title="Base dictionary"

dict_to_sign = {"timestamp": today_str, "method": method, "uri": endpoint}

```

#### 5.1. If necessary, add the content
For requests that have a _body_, you must add the md5 of the bytes of that content. Since all requests in our system are through JSON, 
you can use the following:

```python title="Base dictionary"
body_bytes = json.dumps(body).encode()

md5_instance = md5()
md5_instance.update(body_bytes)
md5_body = md5_instance.hexdigest()

dict_to_sign["payload_md5"] = md5_body
```

### 6. Perform header encryption
Perform encryption using JWT library (in this code example, we use jsonwebtoken as jwt in javascript)

```python
jwt_headers = {"alg": "ES512", "typ": "JWT"}
encoded_header_token = jwt.encode(
    claims=dict_to_sign,
    key=client_private_key,
    algorithm="ES512",
    headers=jwt_headers,
)
```

### 7. Building the final header

```python
headers = {"API-CLIENT-KEY": api_key, "AUTHORIZATION": encoded_header_token}
```

```python title="Defining final url"
url = f"{base_url}{endpoint}"
```

### Making request

```python
resp = requests.post(url=url, headers=headers, json=body)
print(resp.json())
```

---

# Keys Exchange

URL: /en/documentation/escrituracao/introducao/troca_de_chaves

## 1. Signed Request

All requests to our APIs must use the **HTTPS** protocol, using **TLS 1.2 or 1.3**, containing two Headers:

1. API-CLIENT-KEY: A key provided by our Integration team that identifies a specific integration;
2. AUTHORIZATION: A signature of the request that must be performed as explained in this manual;

As standard, QI CTVM uses asymmetric keys, where there are two different keys, one for signing, called private key , and one for reading, called public key . With the private key, the integrating partner must perform the signature using the JWT standard.
The integrating partner is responsible for generating the pair and providing the public key to the QI CTVM team so that we can validate their requests.

:::caution **Attention**
 The private key is for exclusive use by the integrating partner, and must be stored securely. QI CTVM will never ask, under any circumstances, for you to share it with us.
:::
## 2. Generating the pair

To generate a private key on a UNIX computer:

```bash
$ ssh-keygen -t ecdsa -b 521 -m PEM -f private.key
```

And from this private key generate your public key.

```bash
$ openssl ec -in private.key -pubout -outform PEM -out public.key.pub
```

The generated public key (public.key.pub file) must be sent to the QI Tech team, and wait for the integration to be configured;

---

# Asset Query

URL: /en/documentation/escrituracao/operacoes-ativas/consulta-security

This endpoint allows querying the details of an asset using its unique key.

---

## **Request**
ENDPOINT /security/security/ SECURITY-KEY
METHOD GET

### **Path Params**

| Field         | Type   | Description                                       | Characters |
|--------------|--------|-----------------------------------------------|------------|
| `SECURITY-KEY` | string | Unique security key (UUID v4).          | 36         |

---

## **Response**
STATUS 200

Response Body
```json
{
    "tenant_key": "13a6a1d5-7a3c-4627-a0a6-9fd746662ca4",
    "security_key": "42bd7161-5ec1-4f64-ac0c-861d93ffb4c2",
    "operation_key": "8eb2291e-2dbf-4af1-9d12-f29fac665ed2",
    "operation_type": "commercial_paper",
    "contract_number": "0000000027",
    "issuer_key": "9e08fd62-ce43-4c95-99e0-4386e980d618",
    "issuer_name": "Blue Logic",
    "issuer_document_number": "97.923.586/0001-06",
    "issuer_bank_account": {
        "account_type": "checking",
        "account_digit": "3",
        "account_branch": "0001",
        "account_number": "4464541",
        "financial_institution_ispb": "32402502",
        "financial_institution_code_number": "329"
    },
    "financial_base_date": "2025-02-18",
    "current_unit_price": 1.0,
    "latest_accrual_date": "2025-02-18",
    "integralized_quantity": 100000,
    "issue_quantity": 100000,
    "security_status": "active",
    "is_defaulted": false,
    "financial": {
        "financial_base_date": "2025-02-18",
        "issue_quantity": 100000,
        "unit_price": 1.0,
        "issue_amount": 100000.0,
        "released_amount": 100000.0,
        "cet": 1.0,
        "annual_cet": 12.68,
        "number_of_installments": 5,
        "prefixed_interest_rate": {
            "daily_rate": 0.0003271877,
            "annual_rate": 0.1268250301,
            "monthly_rate": 0.01,
            "interest_base": "calendar_days_365"
        },
        "post_fixed_interest_rate": null,
        "financial_index": null,
        "fine_delay_rate": {
            "daily_rate": 0.00032719,
            "annual_rate": 0.12682503,
            "monthly_rate": 0.01,
            "interest_base": "calendar_days_365"
        },
        "contract_fine_rate": 0.02,
        "fees": [
            {
                "type": "internal",
                "amount": 2.0,
                "fee_type": "bookkeeping_fee",
                "fee_amount": 2000.0,
                "amount_type": "percentage"
            },
            {
                "type": "external",
                "amount": 5.0,
                "fee_type": "structuring_fee",
                "fee_amount": 5000.0,
                "amount_type": "percentage"
            }
        ],
        "installment_list": [
            {
                "installment_key": "959a1d8f-9f7f-4b5b-b963-828693caad58",
                "installment_status": "opened",
                "installment_number": 5,
                "workdays": 21,
                "calendar_days": 30,
                "principal_amortization_unit_price": 0.20395804,
                "principal_amortization_amount": 20395.80431829,
                "interest_amount": 201.13568171,
                "interest_amount_unit_price": 0.00201136,
                "post_fixed_interest_amount": 0.0,
                "post_fixed_interest_amount_unit_price": 0.0,
                "amount": 20596.94,
                "due_principal": 20395.80431829,
                "due_interest": 0.0,
                "due_date": "2025-07-18",
                "has_interest": true,
                "current_unit_price": 0.20395804,
                "latest_accrual_date": "2025-02-18",
                "paid_at": null,
                "paid_amount": 0.0,
                "settlement_process_list": []
            },
            {
                "installment_key": "b1f4fc31-7b73-45b8-bce7-4256394b974e",
                "installment_status": "paid",
                "installment_number": 1,
                "workdays": 18,
                "calendar_days": 28,
                "principal_amortization_unit_price": 0.19676756,
                "principal_amortization_amount": 19676.75638427,
                "interest_amount": 920.18361573,
                "interest_amount_unit_price": 0.00920184,
                "post_fixed_interest_amount": 0.0,
                "post_fixed_interest_amount_unit_price": 0.0,
                "amount": 20596.94,
                "due_principal": 100000.0,
                "due_interest": 0.0,
                "due_date": "2025-03-18",
                "has_interest": true,
                "current_unit_price": 0.19676756,
                "latest_accrual_date": "2025-02-18",
                "paid_at": "2025-02-18T18:39:47.174392",
                "paid_amount": 20596.94,
                "settlement_process_list": [
                    {
                        "settlement_process_key": "a9030b64-5003-4f82-be4f-8296a4e0b140",
                        "installment_key": "b1f4fc31-7b73-45b8-bce7-4256394b974e",
                        "due_date": "2025-03-18",
                        "reference_date": "2025-03-18",
                        "current_integralized_quantity": 100000,
                        "principal_amortization_amount": 19676.75638427,
                        "interest_amount": 920.18361573,
                        "post_fixed_interest_amount": 0.0,
                        "fine_amount": 0.0,
                        "total_amount": 20596.94,
                        "expected_total_amount": 20596.94,
                        "paid_amount": 20596.94,
                        "settlement_process_status": "paid",
                        "paid_at": "2025-02-18T18:39:47.185004",
                        "settlement_process_payment_list": [
                            {
                                "settlement_process_payment_key": "69615875-ed71-44f2-9a06-20f6ea4276f3",
                                "investment": {
                                    "investment_key": "4b705afb-18cb-4fe5-922a-5eab71c2b558",
                                    "acquisition_date": "2025-02-18",
                                    "acquisition_unit_price": 1.0,
                                    "acquisition_amount": 100000.0,
                                    "acquisition_quantity": 100000.0,
                                    "investor_key": "a1a75b66-6f7e-4bcc-9ff5-6f8adf7cae09",
                                    "investor_name": "Ultimate Cascade",
                                    "investor_document_number": "31.424.651/0001-32",
                                    "investor_bank_account": {
                                        "account_type": "checking",
                                        "account_digit": "3",
                                        "account_branch": "0001",
                                        "account_number": "33400254",
                                        "financial_institution_ispb": "32402502",
                                        "financial_institution_code_number": "329"
                                    },
                                    "total_sell_amount": 0.0,
                                    "total_yield_amount": 920.18,
                                    "total_amortization_amount": 20596.94,
                                    "current_quantity": 100000,
                                    "investment_transaction_list": [
                                        {
                                            "transaction_type": "integralization",
                                            "transaction_date": "2025-02-18",
                                            "transaction_unit_price": 1.0,
                                            "transaction_amount": 100000.0,
                                            "transaction_quantity": 100000.0,
                                            "amortization_amount": 0.0,
                                            "yield_amount": 0.0,
                                            "old_quantity": 0.0,
                                            "new_quantity": 100000.0,
                                            "investment_transaction_origin": "subscription",
                                            "investment_transaction_origin_key": "8549efc4-76e3-4e62-abd1-71162b383b4e"
                                        },
                                        {
                                            "transaction_type": "maturity",
                                            "transaction_date": "2025-03-18",
                                            "transaction_unit_price": 0.2059694,
                                            "transaction_amount": 20596.94,
                                            "transaction_quantity": 0.0,
                                            "amortization_amount": 20596.94,
                                            "yield_amount": 920.18,
                                            "old_quantity": 100000.0,
                                            "new_quantity": 100000.0,
                                            "investment_transaction_origin": "settlement_process_payment",
                                            "investment_transaction_origin_key": "69615875-ed71-44f2-9a06-20f6ea4276f3"
                                        }
                                    ]
                                },
                                "investment_quantity": 100000,
                                "amount": 20596.94,
                                "paid_at": "2025-02-18T18:39:47.159822",
                                "settlement_process_payment_status": "paid",
                                "settlement_process_payment_type": "manual",
                                "settlement_process_payment_receipt_list": [
                                    {
                                        "settlement_process_payment_receipt_key": "47fa434a-68cc-47d4-af8c-6a84061f38a6",
                                        "settlement_process_payment_receipt_status": "confirmed",
                                        "updated_at": "2025-02-18T18:39:47.153603"
                                    }
                                ]
                            }
                        ]
                    }
                ]
            },
            {
                "installment_key": "dafc9683-a2b3-4bde-bf9a-ff4b2ea2599f",
                "installment_status": "opened",
                "installment_number": 2,
                "workdays": 23,
                "calendar_days": 35,
                "principal_amortization_unit_price": 0.19671978,
                "principal_amortization_amount": 19671.97807672,
                "interest_amount": 924.96192328,
                "interest_amount_unit_price": 0.00924962,
                "post_fixed_interest_amount": 0.0,
                "post_fixed_interest_amount_unit_price": 0.0,
                "amount": 20596.94,
                "due_principal": 80323.24361573,
                "due_interest": 0.0,
                "due_date": "2025-04-22",
                "has_interest": true,
                "current_unit_price": 0.19671978,
                "latest_accrual_date": "2025-02-18",
                "paid_at": null,
                "paid_amount": 0.0,
                "settlement_process_list": []
            },
            {
                "installment_key": "aab04935-763e-4431-b0e8-d3d341d5c563",
                "installment_status": "opened",
                "installment_number": 3,
                "workdays": 18,
                "calendar_days": 27,
                "principal_amortization_unit_price": 0.20058857,
                "principal_amortization_amount": 20058.85739386,
                "interest_amount": 538.08260614,
                "interest_amount_unit_price": 0.00538083,
                "post_fixed_interest_amount": 0.0,
                "post_fixed_interest_amount_unit_price": 0.0,
                "amount": 20596.94,
                "due_principal": 60651.26553901,
                "due_interest": 0.0,
                "due_date": "2025-05-19",
                "has_interest": true,
                "current_unit_price": 0.20058857,
                "latest_accrual_date": "2025-02-18",
                "paid_at": null,
                "paid_amount": 0.0,
                "settlement_process_list": []
            },
            {
                "installment_key": "6a76fd8f-631b-4b42-ac2e-daae8f87401d",
                "installment_status": "opened",
                "installment_number": 4,
                "workdays": 22,
                "calendar_days": 30,
                "principal_amortization_unit_price": 0.20196604,
                "principal_amortization_amount": 20196.60382686,
                "interest_amount": 400.33617314,
                "interest_amount_unit_price": 0.00400336,
                "post_fixed_interest_amount": 0.0,
                "post_fixed_interest_amount_unit_price": 0.0,
                "amount": 20596.94,
                "due_principal": 40592.40814515,
                "due_interest": 0.0,
                "due_date": "2025-06-18",
                "has_interest": true,
                "current_unit_price": 0.20196604,
                "latest_accrual_date": "2025-02-18",
                "paid_at": null,
                "paid_amount": 0.0,
                "settlement_process_list": []
            }
        ]
    },
    "investment_list": [
        {
            "investment_key": "4b705afb-18cb-4fe5-922a-5eab71c2b558",
            "acquisition_date": "2025-02-18",
            "acquisition_unit_price": 1.0,
            "acquisition_amount": 100000.0,
            "acquisition_quantity": 100000.0,
            "investor_key": "a1a75b66-6f7e-4bcc-9ff5-6f8adf7cae09",
            "investor_name": "Ultimate Cascade",
            "investor_document_number": "31.424.651/0001-32",
            "investor_bank_account": {
                "account_type": "checking",
                "account_digit": "3",
                "account_branch": "0001",
                "account_number": "33400254",
                "financial_institution_ispb": "32402502",
                "financial_institution_code_number": "329"
            },
            "total_sell_amount": 0.0,
            "total_yield_amount": 920.18,
            "total_amortization_amount": 20596.94,
            "current_quantity": 100000,
            "investment_transaction_list": [
                {
                    "transaction_type": "integralization",
                    "transaction_date": "2025-02-18",
                    "transaction_unit_price": 1.0,
                    "transaction_amount": 100000.0,
                    "transaction_quantity": 100000.0,
                    "amortization_amount": 0.0,
                    "yield_amount": 0.0,
                    "old_quantity": 0.0,
                    "new_quantity": 100000.0,
                    "investment_transaction_origin": "subscription",
                    "investment_transaction_origin_key": "8549efc4-76e3-4e62-abd1-71162b383b4e"
                },
                {
                    "transaction_type": "maturity",
                    "transaction_date": "2025-03-18",
                    "transaction_unit_price": 0.2059694,
                    "transaction_amount": 20596.94,
                    "transaction_quantity": 0.0,
                    "amortization_amount": 20596.94,
                    "yield_amount": 920.18,
                    "old_quantity": 100000.0,
                    "new_quantity": 100000.0,
                    "investment_transaction_origin": "settlement_process_payment",
                    "investment_transaction_origin_key": "69615875-ed71-44f2-9a06-20f6ea4276f3"
                }
            ]
        }
    ]
}
```

## **Response Body Params**

| Field                        | Type     | Description                                                    |
|------------------------------|----------|--------------------------------------------------------------|
| `tenant_key`                 | string   | Unique key of the tenant associated with the security.                 |
| `security_key`               | string   | Unique security key.                                     |
| `operation_key`              | string   | Unique key of the operation associated with the security.               |
| `operation_type`             | string   | Operation type. Possible values: `commercial_paper`.     |
| `contract_number`            | string   | Contract number associated with the security.                    |
| `issuer_key`                 | string   | Unique key of the associated issuer.                            |
| `issuer_name`                | string   | Name of the security issuer.                                 |
| `issuer_document_number`     | string   | Issuer document number (CPF/CNPJ).                   |
| `issuer_bank_account`        | object   | **[issuer_bank_account object](#bank_account-object)**.      |
| `financial_base_date`        | string   | Financial base date of the security.                            |
| `current_unit_price`         | number   | Current unit price of the security.                            |
| `latest_accrual_date`        | string   | Date of the last accrual performed.                            |
| `integralized_quantity`      | integer  | Total quantity of integralized shares.                    |
| `issue_quantity`             | integer  | Total quantity of shares issued in the operation.              |
| `security_status`            | string   | Security status. Possible values: `active`, `inactive`. |
| `is_defaulted`              | boolean  | Indicates if the security is in default (`true` or `false`).  |
| `financial`                  | object   | **[financial object](#financial-object)**.                   |
| `investment_list`            | array    | Investment list. **[investment object](#investment-object)**. |

---

### **bank_account object**

| Field                          | Type     | Description                                       |
|--------------------------------|----------|-------------------------------------------------|
| `account_number`              | string   | Issuer's bank account number.           |
| `account_digit`               | string   | Issuer's bank account verification digit. |
| `account_branch`              | string   | Issuer's bank branch.                   |
| `financial_institution_ispb`  | string   | ISPB of the issuer's financial institution.     |
| `financial_institution_code_number` | string | Code of the issuer's financial institution. |

---

### **financial object**

| Field                          | Type     | Description                                       |
|--------------------------------|----------|-------------------------------------------------|
| `financial_base_date`          | string   | Financial base date.                           |
| `issue_quantity`               | integer  | Quantity of shares issued.                   |
| `unit_price`                   | number   | Unit price of shares.                       |
| `issue_amount`                 | number   | Total issue amount.                         |
| `released_amount`              | number   | Total released amount.                           |
| `cet`                          | number   | Total effective cost (CET).                      |
| `annual_cet`                   | number   | Annualized total effective cost.                 |
| `number_of_installments`       | integer  | Total number of installments.                       |
| `prefixed_interest_rate`       | object   | **[prefixed_interest_rate object](#prefixed_interest_rate-object)**. |
| `post_fixed_interest_rate`     | object   | **[post_fixed_interest_rate object](#post_fixed_interest_rate-object)**. |
| `financial_index`              | object   | **[financial_index object](#financial_index-object)**. |
| `fine_delay_rate`              | object   | **[fine_delay_rate object](#fine_delay_rate-object)**. |
| `contract_fine_rate`           | number   | Contractual fine.                              |
| `fees`                         | array    | Fee list. **[fees object](#fees-object)**. |
| `installment_list`             | array    | Installment list. **[installment object](#installment-object)**. |

---

### **investment object**

| Field                          | Type     | Description                                       |
|--------------------------------|----------|-------------------------------------------------|
| `investment_key`               | string   | Unique investment key.                    |
| `acquisition_date`             | string   | Investment acquisition date.              |
| `acquisition_unit_price`       | number   | Unit price at acquisition.                    |
| `acquisition_amount`           | number   | Total acquisition amount.                       |
| `acquisition_quantity`         | integer  | Quantity of shares acquired.                 |
| `investor_key`                 | string   | Unique investor key.                      |
| `investor_name`                | string   | Investor name.                             |
| `investor_document_number`     | string   | Investor document (CPF/CNPJ).             |
| `investor_bank_account`        | object   | **[investor_bank_account object](#bank_account-object)**. |
| `total_sell_amount`            | number   | Total amount of sales made.               |
| `total_yield_amount`           | number   | Total yield amount.                     |
| `total_amortization_amount`    | number   | Total amortization amount.                    |
| `current_quantity`             | integer  | Current quantity of shares.                      |
| `investment_transaction_list`  | array    | Transaction list. **[investment_transaction object](#investment_transaction-object)**. |

---

### **investment_transaction object**

| Field                          | Type     | Description                                       |
|--------------------------------|----------|-------------------------------------------------|
| `transaction_type`             | string   | Transaction type (`integralization`, `maturity`). |
| `transaction_date`             | string   | Transaction date.                              |
| `transaction_unit_price`       | number   | Unit price in the transaction.                    |
| `transaction_amount`           | number   | Total transaction amount.                       |
| `transaction_quantity`         | integer  | Quantity of shares transacted.             |
| `amortization_amount`          | number   | Amortization amount in the transaction.              |
| `yield_amount`                 | number   | Yield amount in the transaction.               |
| `old_quantity`                 | integer  | Quantity of shares before the transaction.         |
| `new_quantity`                 | integer  | Quantity of shares after the transaction.           |
| `investment_transaction_origin`| string   | Transaction origin (`subscription`, `settlement_process_payment`). |
| `investment_transaction_origin_key` | string | Origin key of the transaction. |

### **prefixed_interest_rate object**

| Field               | Type   | Description                                          |
|---------------------|--------|--------------------------------------------------|
| `daily_rate`       | number | Daily prefixed interest rate.                  |
| `annual_rate`      | number | Annual prefixed interest rate.                   |
| `monthly_rate`     | number | Monthly prefixed interest rate.                  |
| `interest_base`    | string | Interest calculation base (`calendar_days_365`). |

---

### **post_fixed_interest_rate object**

| Field               | Type   | Description                                           |
|---------------------|--------|---------------------------------------------------|
| `daily_rate`       | number | Daily post-fixed interest rate.                   |
| `annual_rate`      | number | Annual post-fixed interest rate.                    |
| `monthly_rate`     | number | Monthly post-fixed interest rate.                   |
| `interest_base`    | string | Interest calculation base (`calendar_days_365`).   |

---

### **financial_index object**

| Field            | Type   | Description                                         |
|------------------|--------|-------------------------------------------------|
| `index_type`    | string | Financial index type (`CDI`, `IPCA`, etc.). |
| `index_value`   | number | Financial index value.                      |

---

### **fine_delay_rate object**

| Field               | Type   | Description                                        |
|---------------------|--------|------------------------------------------------|
| `daily_rate`       | number | Daily interest rate for payment delay.  |
| `annual_rate`      | number | Annual interest rate for payment delay.   |
| `monthly_rate`     | number | Monthly interest rate for payment delay.  |
| `interest_base`    | string | Interest calculation base (`calendar_days_365`).|

---

### **fees object**

| Field        | Type    | Description                                    |
|-------------|---------|--------------------------------------------|
| `type`      | string  | Fee type (`internal`, `external`).     |
| `amount`    | number  | Percentage or absolute value of the fee.      |
| `fee_type`  | string  | Fee type.   |
| `fee_amount`| number  | Monetary value of the applied fee.          |
| `amount_type` | string | Value type (`percentage`, `absolute`). |

---

### **installment object**

| Field                                  | Type    | Description                                                   |
|----------------------------------------|---------|-----------------------------------------------------------|
| `installment_key`                      | string  | Unique installment key.                                     |
| `installment_status`                   | string  | Installment status                      |
| `installment_number`                   | integer | Installment number in the schedule sequence.               |
| `workdays`                              | integer | Number of business days until maturity.                  |
| `calendar_days`                         | integer | Number of calendar days until maturity.               |
| `principal_amortization_unit_price`     | number  | Unit value of principal amortization.                 |
| `principal_amortization_amount`         | number  | Total principal amortization amount.                    |
| `interest_amount`                       | number  | Total interest amount of the installment.                           |
| `interest_amount_unit_price`            | number  | Unit interest value of the installment.                        |
| `post_fixed_interest_amount`            | number  | Total post-fixed interest amount of the installment.               |
| `post_fixed_interest_amount_unit_price` | number  | Unit post-fixed interest value of the installment.            |
| `amount`                                | number  | Total installment amount.                                     |
| `due_principal`                         | number  | Principal amount due before the installment.               |
| `due_interest`                          | number  | Interest amount due before the installment.                 |
| `due_date`                              | string  | Installment maturity date.                              |
| `has_interest`                          | boolean | Indicates if the installment contains interest (`true` or `false`).       |
| `current_unit_price`                    | number  | Updated unit price of the installment.                       |
| `latest_accrual_date`                   | string  | Date of the last accrual of the installment.                          |
| `paid_at`                               | string  | Installment payment date (if applicable).                |
| `paid_amount`                           | number  | Total amount paid of the installment (if applicable).                 |
| `settlement_process_list`               | array   | Settlement process list. **[settlement_process object](#settlement_process-object)** |

### **settlement_process object**

| Field                                   | Type    | Description                                                                                                                |
|-----------------------------------------|---------|--------------------------------------------------------------------------------------------------------------------------|
| `settlement_process_key`                | string  | Unique settlement process key.                                                                                   |
| `installment_key`                        | string  | Unique key of the installment associated with the settlement.                                                                           |
| `due_date`                               | string  | Maturity date of the associated installment.                                                                                 |
| `reference_date`                         | string  | Settlement reference date.                                                                                        |
| `current_integralized_quantity`          | integer | Quantity of integralized shares at the time of settlement.                                                             |
| `principal_amortization_amount`          | number  | Principal amortization amount.                                                                                       |
| `interest_amount`                        | number  | Total interest amount paid in the settlement.                                                                               |
| `post_fixed_interest_amount`             | number  | Post-fixed interest amount paid in the settlement.                                                                         |
| `fine_amount`                            | number  | Fine amount applied (if any).                                                                                     |
| `total_amount`                           | number  | Total settlement amount.                                                                                               |
| `expected_total_amount`                   | number  | Expected total settlement amount.                                                                                      |
| `paid_amount`                            | number  | Total amount paid in the settlement.                                                                                          |
| `settlement_process_status`              | string  | Settlement status (`waiting_payment`, `paid`, `canceled`).                                                            |
| `paid_at`                                | string  | Settlement payment date (if applicable).                                                                          |
| `settlement_process_payment_list`        | array   | Payment list associated with the settlement. **[settlement_process_payment object](#settlement_process_payment-object)** |

### **settlement_process_payment object**  

| Field                                       | Type    | Description                                                                                                                   |
|---------------------------------------------|---------|-----------------------------------------------------------------------------------------------------------------------------|
| `settlement_process_payment_key`           | string  | Unique settlement process payment key.                                                                         |
| `investment`                                | object  | Investment information. **[investment object](#investment-object)**.                                                   |
| `investment_quantity`                       | integer | Quantity of investment shares involved in the payment.                                                                |
| `amount`                                    | number  | Payment amount made.                                                                                               |
| `paid_at`                                   | string  | Payment date and time (ISO 8601 format).                                                                                |
| `settlement_process_payment_status`        | string  | Payment status (`waiting_payment`, `paid`, `canceled`).                                                                |
| `settlement_process_payment_type`          | string  | Payment type (`manual`).                                                                                               |
| `settlement_process_payment_receipt_list`  | array   | Payment receipt list. **[settlement_process_payment_receipt object](#settlement_process_payment_receipt-object)**. |

### **settlement_process_payment_receipt object**  

| Field                                       | Type   | Description                                                         |
|---------------------------------------------|--------|-------------------------------------------------------------------|
| `settlement_process_payment_receipt_key`    | string | Unique settlement process payment receipt key.     |
| `settlement_process_payment_receipt_status` | string | Receipt status (`waiting_confirmation`, `confirmed`, `denied`). |
| `amount`                                    | number | Receipt amount.                                                  |
| `updated_at`                                | string | Date and time of last receipt update (ISO 8601 format).   |

### **security_status Enumerators**

| Enum      | Description                                             |
|-----------|------------------------------------------------------|
| `issued`  | The security was issued but is not yet active.   |
| `active`  | The security is active and ongoing.               |
| `matured` | The security has reached maturity.                    |
| `canceled` | The security was canceled.                          |

### **installment_status Enumerators**

| Enum                        | Description                                                              |
|-----------------------------|-----------------------------------------------------------------------|
| `created`                   | The installment was created but is not yet available for payment.   |
| `opened`                    | The installment is open.                         |
| `waiting_payment`           | The installment is waiting for payment by the investor.               |
| `paid_partial`              | The installment was partially paid.                                      |
| `paid`                      | The installment was fully paid.                                       |
| `paid_early`                | The installment was paid early.                                  |
| `overdue`                   | The installment matured and was not paid.                                     |
| `paid_partial_overdue`      | The installment was partially paid after maturity.                  |
| `paid_overdue`              | The installment was paid after maturity.                               |
| `canceled`                  | The installment was canceled and does not need to be paid.                     |
| `unmonitored`               | The installment is not monitored for payments.                         |

---

# Investor Position

URL: /en/documentation/escrituracao/operacoes-ativas/posicao-investidor

This endpoint allows querying an investor's consolidated position, returning information about their holdings in securities.

---

## Request
ENDPOINT /security/investor/ INVESTOR-KEY
METHOD GET

### Path Params

| Field         | Type   | Description                                      | Characters |
|--------------|--------|-----------------------------------------------|------------|
| `INVESTOR-KEY` | string | Unique investor key (UUID v4).         | 36         |

---

### Response
STATUS 200

Response Body

```json
{
    "investor_key": "a1a75b66-6f7e-4bcc-9ff5-6f8adf7cae09",
    "investor_name": "Ultimate Cascade",
    "investor_document_number": "31.424.651/0001-32",
    "total_current_amount": 100000.0,
    "investment_list": [
        {
            "current_unit_price": 1.0,
            "current_quantity": 100000,
            "security_key": "42bd7161-5ec1-4f64-ac0c-861d93ffb4c2",
            "contract_number": "0000000027",
            "investment_key": "4b705afb-18cb-4fe5-922a-5eab71c2b558",
            "current_amount": 100000.0
        }
    ]
}
```

---

### Response Body Params

| Field                      | Type     | Description                                                        |
|----------------------------|----------|--------------------------------------------------------------------|
| `investor_key`             | string   | Unique investor key.                                        |
| `investor_name`            | string   | Investor name.                                              |
| `investor_document_number` | string   | Investor document number (CNPJ).                   |
| `total_current_amount`     | number   | Investor's total consolidated amount.                            |
| `investment_list`          | array    | List of investor's holdings in securities. **[Investment object](#investment-object)** |

### Investment object

| Field                 | Type     | Description                                        |
|-----------------------|----------|--------------------------------------------------|
| `current_unit_price`  | number   | Current unit price of the security.               |
| `current_quantity`    | integer  | Investor's current quantity of the security.     |
| `security_key`        | string   | Unique key of the associated security.              |
| `contract_number`     | string   | Contract number of the security.                 |
| `investment_key`      | string   | Unique key of the investor's investment.      |
| `current_amount`      | number   | Current value of the investor's holding.      |

---

# Commercial Notes Bookkeeping Integration Guide

URL: /en/documentation/escrituracao/roteiro-integracao/roteiro-integracao-padrao

The homologation guide describes all the resources and functionalities that need
to be tested by the integration partner in QI Tech's sandbox environment (testing environment), 
before going into production environment for commercial notes issuance.

This guide describes all the resources and functionalities involved in the product.

:::warning Attention
**All tests must be mandatorily performed in QI Tech's Sandbox environment (testing environment).
Operations performed in Sandbox environment are fictional financial operations, serving only for API functionality testing.**
:::

## Bookkeeping API Registration and Authentication
| Code  | Step | Description | Documentation Link | Prerequisites |
| --- | --- | --- | --- | --- |
| CAB0001* | Public key exchange | Perform public key exchange with the platform operations team (suporte.dcm@qitech.com.br) | [Documentation Link](/documentation/escrituracao/introducao/troca_de_chaves) |  |
| CAB0002* | Call authentication test | After receiving the API key from the platforms team, complete call authentication test |[Documentation Link](/documentation/escrituracao/introducao/teste-autenticacao/teste_de_autenticacao) <br/><br/> [Documentation Link](/documentation/escrituracao/introducao/teste-autenticacao/endpoints_de_teste) | CAB0001 |
| CAB0003* | Webhook configuration | Configure the URL for QI webhook sending. | [Documentation Link](/documentation/escrituracao/introducao/autenticacao_webhooks) <br/><br/> [Documentation Link](/documentation/escrituracao/configuracao-webhooks) <br/><br/> [Documentation Link](/documentation/escrituracao/webhooks-escrituracao) | CAB0001 and CAB0002 |

## Issuer Homologation

:::warning Attention
**For the issuer homologation flow, if the client has already performed the integration with QI TECH assignor registrations, it's possible to reuse these registrations, simplifying the homologation in the bookkeeping system**
:::

### Issuer homologation for registrations made in the QI TECH assignor system

| Code | Step | Description | Documentation Link | Prerequisites |
| --- | --- | --- | --- | --- |
| CED1001* | Reuse assignor registration | Reuse assignor registration using their CNPJ. | [Documentation Link](/documentation/escrituracao/homologacao-emissor/solicitacao-acesso) |  
| CED1002* | List registered issuers | List registered assignors, with filters by CNPJ, name | [Documentation Link](/documentation/escrituracao/homologacao-emissor/consulta/consulta-emissor-filtro) |  
| CED1003* | Issuer details | View details of a registered issuer, by issuer_key | [Documentation Link](/documentation/escrituracao/homologacao-emissor/consulta/consulta-emissor-chave) |  

### Issuer homologation for registrations made through the bookkeeping system

| Code | Step | Description | Documentation Link | Prerequisites |
| --- | --- | --- | --- | --- |
| CED0001* | Basic issuer registration | Create the issuer, providing basic registration information. | [Documentation Link](/documentation/escrituracao/homologacao-emissor/cadastro/cadastro-basico) |
| CED0002* | Issuer document sending and removal | Sending and removal of documents associated with a previously registered issuer | [Documentation Link](/documentation/escrituracao/homologacao-emissor/cadastro/documentos-emissor) <br/><br/> [Documentation Link](/documentation/escrituracao/homologacao-emissor/cadastro/documentos-emissor-remocao) | CED0001 |
| CED0003* | Issuer representatives registration and removal | Sending and removal of representatives associated with a previously registered issuer | [Documentation Link](/documentation/escrituracao/homologacao-emissor/cadastro/representantes-emissor) <br/><br/> [Documentation Link](/documentation/escrituracao/homologacao-emissor/cadastro/representantes-emissor-remocao) | CED0001 | 
| CED0004* | Issuer representative documents sending and removal | sending and removal of documents associated with a representative of a previously registered issuer | [Documentation Link](/documentation/escrituracao/homologacao-emissor/cadastro/documentos-representantes-emissor) <br/><br/> [Documentation Link](/documentation/escrituracao/homologacao-emissor/cadastro/documentos-representantes-emissor-remocao) | CED0001, CED0003 |
| CED0005* | Issuer bank account registration and removal | registration and removal of bank account associated with a previously registered issuer | [Documentation Link](/documentation/escrituracao/homologacao-emissor/cadastro/conta-bancaria-emissor) <br/><br/> [Documentation Link](/documentation/escrituracao/homologacao-emissor/cadastro/conta-bancaria-emissor-remocao) | CED0001 |
| CED0006* | Issuer signatory groups registration and removal | registration and removal of signatory groups associated with a previously registered issuer | [Documentation Link](/documentation/escrituracao/homologacao-emissor/cadastro/assinantes-emissor) <br/><br/> [Documentation Link](/documentation/escrituracao/homologacao-emissor/cadastro/assinantes-emissor-remocao) | CED0001 |
| CED0007* | Issuer contact information registration and removal | registration and removal of contact information associated with a previously registered issuer | [Documentation Link](/documentation/escrituracao/homologacao-emissor/cadastro/informacao-contato-emissor) <br/><br/> [Documentation Link](/documentation/escrituracao/homologacao-emissor/cadastro/informacao-contato-emissor-remocao) | CED0001 |
| CED0008* | Send issuer for analysis | This endpoint allows changing an issuer's status to under analysis, sending it to the validation process. | [Documentation Link](/documentation/escrituracao/homologacao-emissor/envio-analise/) | CED0001, CED0002, CED0003, CED0004, CED0005, CED0006, CED0007 |
| CED0009* | Issuer registration modification | modify issuer to allow editing | [Documentation Link](/documentation/escrituracao/homologacao-emissor/alteracao-cadastro/) | CED0001, CED0002, CED0003, CED0004, CED0005, CED0006, CED0007 |
| CED0010* | List registered issuers | List registered assignors, with filters by CNPJ, name | [Documentation Link](/documentation/escrituracao/homologacao-emissor/consulta/consulta-emissor-filtro) 
| CED0011* | Issuer details | View details of a registered issuer, by issuer_key | [Documentation Link](/documentation/escrituracao/homologacao-emissor/consulta/consulta-emissor-chave) |  

## Investor Homologation

:::warning Attention
**For the investor homologation flow, if the client has fixed funds, it's possible to register these in the setup, simplifying the integration.**
:::

### Investor homologation for registrations made in setup

| Code | Step | Description | Documentation Link | Prerequisites |
| --- | --- | --- | --- | --- |
| INV1001* | List registered investors | List registered funds, with filters by CNPJ, name | [Documentation Link](/documentation/escrituracao/homologacao-investidor/consulta/consulta-investidor-filtro) |  
| INV1002* | Investor details | View details of a registered investor, by investor_key | [Documentation Link](/documentation/escrituracao/homologacao-investidor/consulta/consulta-investidor-chave) |  

### Investor homologation for registrations made through the bookkeeping system

| Code | Step | Description | Documentation Link | Prerequisites |
| --- | --- | --- | --- | --- |
| INV0001* | Basic investor registration | Create the investor, providing basic registration information. | [Documentation Link](/documentation/escrituracao/homologacao-investidor/cadastro/cadastro-basico) |
| INV0002* | Investor document sending and removal | Sending and removal of documents associated with a previously registered investor | [Documentation Link](/documentation/escrituracao/homologacao-investidor/cadastro/documentos-investidor) <br/><br/> [Documentation Link](/documentation/escrituracao/homologacao-investidor/cadastro/documentos-investidor-remocao) | INV0001 |
| INV0003* | Investor representatives registration and removal | Sending and removal of representatives associated with a previously registered investor | [Documentation Link](/documentation/escrituracao/homologacao-investidor/cadastro/representantes-investidor) <br/><br/> [Documentation Link](/documentation/escrituracao/homologacao-investidor/cadastro/representantes-investidor-remocao) | INV0001 | 
| INV0004* | Investor representative documents sending and removal | sending and removal of documents associated with a representative of a previously registered investor | [Documentation Link](/documentation/escrituracao/homologacao-investidor/cadastro/documentos-representantes-investidor) <br/><br/> [Documentation Link](/documentation/escrituracao/homologacao-investidor/cadastro/documentos-representantes-investidor-remocao) | INV0001, INV0003 |
| INV0005* | Investor bank account registration and removal | registration and removal of bank account associated with a previously registered investor | [Documentation Link](/documentation/escrituracao/homologacao-investidor/cadastro/conta-bancaria-investidor) <br/><br/> [Documentation Link](/documentation/escrituracao/homologacao-investidor/cadastro/conta-bancaria-investidor-remocao) | INV0001 |
| INV0006* | Investor signatory groups registration and removal | registration and removal of signatory groups associated with a previously registered investor | [Documentation Link](/documentation/escrituracao/homologacao-investidor/cadastro/assinantes-investidor) <br/><br/> [Documentation Link](/documentation/escrituracao/homologacao-investidor/cadastro/assinantes-investidor-remocao) | INV0001 |
| INV0007* | Investor contact information registration and removal | registration and removal of contact information associated with a previously registered investor | [Documentation Link](/documentation/escrituracao/homologacao-investidor/cadastro/informacao-contato-investidor) <br/><br/> [Documentation Link](/documentation/escrituracao/homologacao-investidor/cadastro/informacao-contato-investidor-remocao) | INV0001 |
| INV0008* | Send investor for analysis | This endpoint allows changing an investor's status to under analysis, sending it to the validation process. | [Documentation Link](/documentation/escrituracao/homologacao-investidor/envio-analise/) | INV0001, INV0002, INV0003, INV0004, INV0005, INV0006, INV0007 |
| INV0009* | Investor registration modification | modify investor to allow editing | [Documentation Link](/documentation/escrituracao/homologacao-investidor/alteracao-cadastro/) | INV0001, INV0002, INV0003, INV0004, INV0005, INV0006, INV0007 |
| INV0010* | List registered investors | List registered funds, with filters by CNPJ, name | [Documentation Link](/documentation/escrituracao/homologacao-investidor/consulta/consulta-investidor-filtro) 
| INV0011* | Investor details | View details of a registered investor, by investor_key | [Documentation Link](/documentation/escrituracao/homologacao-investidor/consulta/consulta-investidor-chave) |  

## Commercial note issuance

After issuer and investor registrations, it's possible to issue commercial notes. For this, there are some combinations of issuance flows, which will be covered below.

| Code | Step | Description | Documentation Link | Prerequisites |
| --- | --- | --- | --- | --- |
| COM0001* | Financial conditions simulation | simulate the financial conditions and payment flow of an operation | [Documentation Link](/documentation/escrituracao/emissao-de-notas/simulacao) |
| COM0002* | Commercial note operation registration | create a new commercial note operation based on financial and investor data. | [Documentation Link](/documentation/escrituracao/emissao-de-notas/cadastro-operacao/criar-operacao) | COM0001 |
| COM0003* | Related parties registration and removal | registration and removal of related parties to an operation | [Documentation Link](/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-parte-relacionada/cadastrar-parte-relacionada) | COM0002 | 
| COM0004* | Related party representative documents sending and removal | sending and removal of documents associated with representatives of related parties to an operation | [Documentation Link](/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-parte-relacionada/adicionar-documento)| COM0002, COM0003 |
| COM0005* | Related party representative signatory groups sending and removal | sending and removal of signatory groups associated with representatives of related parties to an operation | [Documentation Link](/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-parte-relacionada/adicionar-grupo-assinantes) | COM0002, COM0003 |
| COM0006 | Preview constitutive term | generation of a draft Constitutive Term for a specific operation, using a predefined template. | [Documentation Link](/documentation/escrituracao/emissao-de-notas/geracao-minutas/gerar-minuta-contrato) | COM0002 |
| COM0007* | Modify constitutive term template | modification of the Constitutive Term template for a specific operation | [Documentation Link](/documentation/escrituracao/emissao-de-notas/geracao-minutas/alterar-template-tc) | COM0002 |
| COM0008* | Document upload | upload documents associated with an operation. The returned "document_key" can be used, for example, in the guarantees system | [Documentation Link](/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-garantias/upload-documento) | COM0002 |
| COM0009* | Operation guarantee submission | addition of guarantees associated with an operation | [Documentation Link](/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-garantias/cadastro-garantia) | COM0002, COM0008 |
| COM0010* | Contract/Guarantee related parties registration and removal | registration and removal of related parties for a specific contract/guarantee of the operation | [Documentation Link](/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-parte-relacionada/adicionar-parte-relacionada-em-documento) | COM0002, COM0003 |
| COM0011* | Send operation for analysis | change an operation's status to "under analysis", sending it to the compliance validation process by the bookkeeper | [Documentation Link](/documentation/escrituracao/emissao-de-notas/envio-para-analise) | COM0002, COM0003, COM0004, COM0005, COM0006, COM0007, COM0008, COM0009 |
| COM0012* | Send signed approval minutes | This endpoint allows sending externally signed approval minutes from SA or COP type companies to the bookkeeping system, sending a base64 that will be analyzed and approved by the bookkeeper. | [Documentation Link](/documentation/escrituracao/emissao-de-notas/envio-ata-aprovacao) | COM0002 |
| COM0013* | Query operations by filters | query commercial note operations using optional filters | [Documentation Link](/documentation/escrituracao/emissao-de-notas/consulta/consulta-por-filtros) | COM0002, COM0003, COM0004, COM0005, COM0006, COM0007, COM0008, COM0009 |
| COM0014* | Query operation by key | query complete details of a specific operation, using its unique key. | [Documentation Link](/documentation/escrituracao/emissao-de-notas/consulta/consulta-por-chave) | COM0002, COM0003, COM0004, COM0005, COM0006, COM0007, COM0008, COM0009 |

### In case signature is via QI SIGN

| Code | Step | Description | Documentation Link | Prerequisites |
| --- | --- | --- | --- | --- |
| COM0015* | Query operation signature links via QI SIGN | query all signature links for a specific operation via QI SIGN, using its unique key. | [Documentation Link](/documentation/escrituracao/emissao-de-notas/consulta-link-assinatura-qisign) | COM0002, COM0003, COM0004, COM0005, COM0006, COM0007, COM0008, COM0009 |
| COM0016* | Query signed contract links via QI SIGN for operation | query all signed documents of a specific operation via QI SIGN, using its unique key | [Documentation Link](/documentation/escrituracao/emissao-de-notas/consulta-link-assinado-qisign) | COM0002, COM0003, COM0004, COM0005, COM0006, COM0007, COM0008, COM0009 |

## Integration/Subscription process

| Code | Step | Description | Documentation Link | Prerequisites |
| --- | --- | --- | --- | --- |
| INT0001* | Query integration by key | query the details of an integration process using its unique key | [Documentation Link](/documentation/escrituracao/integralizacao-cotas/consulta-processo-integralizacao) |
| INT0002* | Subscription query | query an ongoing subscription | [Documentation Link](/documentation/escrituracao/integralizacao-cotas/subscricao-cotas/consulta-subscricao-cotas) | INT0001 |
 | INT0003 | Subscription registration | register an investor's intention to subscribe a specific quantity of integration quotas (useful when it's necessary to reschedule a subscription date) | [Documentation Link](/documentation/escrituracao/integralizacao-cotas/subscricao-cotas/cadastro-subscricao) | INT0001, INT0002 |
 | INT0004 | Cancel subscription | cancel subscription (useful when it's necessary to reschedule a subscription date) | [Documentation Link](/documentation/escrituracao/integralizacao-cotas/subscricao-cotas/cancelar-subscricao) | INT0001, INT0002 |

## Error mapping

Errors originating from issuer, investor and commercial note APIs can be found at [**Error Catalog Link**](/documentation/escrituracao/catalogo-erros/catalogo-erros)

---

# Roteiro de Integração de escrituração de notas comerciais

URL: /en/documentation/escrituracao/roteiro-integracao/roteiro-integracao-padrao-external

O roteiro de homologação descreve todos os recursos e funcionalidades que precisam
ser testados pelo parceiro integrador no ambiente de sandbox da QI Tech (ambiente de testes), 
antes da entrada em ambiente de produção para emissão de notas comerciais.

Este roteiro descreve todos os recursos e funcionalidades envolvidos no produto. 

:::warning Atenção
**Todos os testes devem ser obrigatoriamente realizados no ambiente de Sandbox da QI Tech (ambiente de testes).
As operações realizadas em ambiente de Sandbox são operações financeiras fictícias, servindo apenas para teste de funcionalidade das APIs.**
:::

## Cadastro e Autenticação API Escrituração
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| CAB0001* | Troca de chaves públicas | Realizar a troca de chaves públicas com o time operações de plataforma (suporte.dcm@qitech.com.br) | [Link Documentação](/documentation/escrituracao/introducao/troca_de_chaves) |  |
| CAB0002* | Teste de autenticação de chamadas | Após receber a chave de api com o time de plataformas, finalizar teste de autenticação de chamadas |[Link Documentação](/documentation/escrituracao/introducao/teste-autenticacao/teste_de_autenticacao) <br/><br/> [Link Documentação](/documentation/escrituracao/introducao/teste-autenticacao/endpoints_de_teste) | CAB0001 |
| CAB0003* | Configuração de webhooks | Realizar a configuração da url para envio dos webhooks por parte da QI. | [Link Documentação](/documentation/escrituracao/introducao/autenticacao_webhooks) <br/><br/> [Link Documentação](/documentation/escrituracao/configuracao-webhooks) <br/><br/> [Link Documentação](/documentation/escrituracao/webhooks-escrituracao) | CAB0001 e CAB0002 |

## Homologação do Emissor

:::warning Atenção
**Para o fluxo de homologação do emissor, caso o cliente já tenha realizado a integração com o cadastros de cedentes QI TECH, é possível reutilizar esses cadastros, simplificando a homologação no sistema de escrituração**
:::

### Homologação do emissor para cadastros feitos no sistema de cedentes QI TECH

| Código | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| CED1001* | Reaproveitar cadastro cedente | Realizar o reaproveitamento do cadastro de cedente utilizando o CNPJ do mesmo. | [Link Documentação](/documentation/escrituracao/homologacao-emissor/solicitacao-acesso) |  
| CED1002* | Listagem dos emissores cadastrados | Listagem dos cedentes cadastrados, com filtros por CNPJ, nome | [Link Documentação](/documentation/escrituracao/homologacao-emissor/consulta/consulta-emissor-filtro) |  
| CED1003* | Detalhes do emissor | Visualizar os detalhes de um emissor cadastrado, por issuer_key | [Link Documentação](/documentation/escrituracao/homologacao-emissor/consulta/consulta-emissor-chave) |  

## Homologação do Investidor

:::warning Atenção
**Para o fluxo de homologação do investidor, caso o cliente tenha fundos fixos, é possível realizar o cadastro desses no setup, simplificando a integração.**
:::

### Homologação do investidor para cadastros feitos no setup

| Código | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| INV1001* | Listagem dos investidores cadastrados | Listagem dos fundos cadastrados, com filtros por CNPJ, nome | [Link Documentação](/documentation/escrituracao/homologacao-investidor/consulta/consulta-investidor-filtro) |  
| INV1002* | Detalhes do investidor | Visualizar os detalhes de um investidor cadastro, por investor_key | [Link Documentação](/documentation/escrituracao/homologacao-investidor/consulta/consulta-investidor-chave) |  

## Emissão de nota comercial

Após os cadastros de emissores e investidores, é possível realizar a emissão de notas comerciais. Para isso, existem algumas combinações de fluxos de emissão, que serão contempladas abaixo.

| Código | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| COM0001 | Simulação de condições financeiras | simular as condições financeiras e o fluxo de pagamentos de uma operação | [Link Documentação](/documentation/escrituracao/emissao-de-notas/simulacao) |
| COM0002* | Cadastro de Operação de Nota Comercial | criar uma nova operação de nota comercial com base nos dados financeiros e de investidores. | [Link Documentação](/documentation/escrituracao/emissao-de-notas/cadastro-operacao/criar-operacao) | COM0001 |
COM0002 | 
| COM003* | Enviar Operação para Análise | alterar o status de uma operação para "em análise", enviando-a para o processo de validação de compliance pelo escriturador | [Link Documentação](/documentation/escrituracao/emissao-de-notas/envio-contratos-assinados) | COM0002 |
| COM004* | Enviar Contratos Assinados | Este endpoint permite enviar os contratos assinados de forma externa para o sistema de escrituação, enviando um base64 que será analisado e aprovado pelo escriturador. | [Link Documentação](/documentation/escrituracao/emissao-de-notas/envio-ata-aprovacao) | COM0002 |
| COM0005 | Consulta de Operações por Filtros | consultar operações de nota comercial utilizando filtros opcionais | [Link Documentação](/documentation/escrituracao/emissao-de-notas/consulta/consulta-por-filtros) | COM0002, COM0003, COM0004 |
| COM0006 | Consulta de Operação por Chave | consultar os detalhes completos de uma operação específica, utilizando sua chave única. | [Link Documentação](/documentation/escrituracao/emissao-de-notas/consulta/consulta-por-chave) | COM0002, COM0003, COM0004 |

## Mapeamento de erros

Os erros originários das apis de emissores, investidores e nota comercial podem ser encontrados em [**Link Catálogo de Erros**](/documentation/escrituracao/catalogo-erros/catalogo-erros)

---

# Roteiro de Integração de escrituração de notas comerciais + Boletos + Sistema de baixas

URL: /en/documentation/escrituracao/roteiro-integracao/roteiro-integracao-securities-baas-dtvm

O roteiro de homologação descreve todos os recursos e funcionalidades que precisam
ser testados pelo parceiro integrador no ambiente de sandbox da QI Tech (ambiente de testes), 
antes da entrada em ambiente de produção para emissão de notas comerciais, boletos e baixas.

Este roteiro descreve todos os recursos e funcionalidades envolvidos no produto. 

:::warning Atenção
**Todos os testes devem ser obrigatoriamente realizados no ambiente de Sandbox da QI Tech (ambiente de testes).
As operações realizadas em ambiente de Sandbox são operações financeiras fictícias, servindo apenas para teste de funcionalidade das APIs.**
:::

## Cadastro e Autenticação API Escrituração
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| CAB0001* | Troca de chaves públicas | Realizar a troca de chaves públicas com o time operações de plataforma (suporte.dcm@qitech.com.br) | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/introducao/troca_de_chaves) |  |
| CAB0002* | Teste de autenticação de chamadas | Após receber a chave de api com o time de plataformas, finalizar teste de autenticação de chamadas |[Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/introducao/teste-autenticacao/teste_de_autenticacao) <br/><br/> [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/introducao/teste-autenticacao/endpoints_de_teste) | CAB0001 |
| CAB0003* | Configuração de webhooks | Realizar a configuração da url para envio dos webhooks por parte da QI. | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/introducao/autenticacao_webhooks) <br/><br/> [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/configuracao-webhooks) <br/><br/> [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/webhooks-escrituracao) | CAB0001 e CAB0002 |

### Homologação do emissor para cadastros feitos pelo sistema de escrituração

| Código | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| CED0001* | Cadastro Básico do emissor | Criar o emissor, informando as informações básicas do cadastro. | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/homologacao-emissor/cadastro/cadastro-basico) |
| CED0002* | Envio e remoção de Documentos do Emissor | Envio e remoção de documentos associados a um emissor previamente cadastrado | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/homologacao-emissor/cadastro/documentos-emissor) <br/><br/> [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/homologacao-emissor/cadastro/documentos-emissor-remocao) | CED0001 |
| CED0003* | Cadastro e remoção de Representantes do Emissor | Envio e remoção de representantes associados a um emissor previamente cadastrado | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/homologacao-emissor/cadastro/representantes-emissor) <br/><br/> [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/homologacao-emissor/cadastro/representantes-emissor-remocao) | CED0001 | 
| CED0004* | Envio e remoção de Documentos do Representante do Emissor | envio e remoção de documentos associados a um representante de um emissor previamente cadastrado | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/homologacao-emissor/cadastro/documentos-representantes-emissor) <br/><br/> [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/homologacao-emissor/cadastro/documentos-representantes-emissor-remocao) | CED0001, CED0003 |
| CED0005* | Cadastro e remoção de Conta Bancária do Emissor | cadastro e remoção de conta bancária associada a um emissor previamente cadastrado | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/homologacao-emissor/cadastro/conta-bancaria-emissor) <br/><br/> [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/homologacao-emissor/cadastro/conta-bancaria-emissor-remocao) | CED0001 |
| CED0006* | Cadastro e remoção de Grupos de Assinantes do Emissor | cadastro e remoção de grupos de assinantes associados a um emissor previamente cadastrado | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/homologacao-emissor/cadastro/assinantes-emissor) <br/><br/> [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/homologacao-emissor/cadastro/assinantes-emissor-remocao) | CED0001 |
| CED0007* | Cadastro e remoção de Informações de Contato do Emissor | cadastro e remoção de informações de contato associadas a um emissor previamente cadastrado | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/homologacao-emissor/cadastro/informacao-contato-emissor) <br/><br/> [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/homologacao-emissor/cadastro/informacao-contato-emissor-remocao) | CED0001 |
| CED0008* | Envio para Análise do Emissor | Este endpoint permite alterar o status de um emissor para análise, enviando-o para o processo de validação. | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/homologacao-emissor/envio-analise/) | CED0001, CED0002, CED0003, CED0004, CED0005, CED0006, CED0007 |
| CED0009* | Alteração de Cadastro do Emissor | alterar emissor para permitir edição | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/homologacao-emissor/alteracao-cadastro/) | CED0001, CED0002, CED0003, CED0004, CED0005, CED0006, CED0007 |
| CED0010* | Listagem dos emissores cadastrados | Listagem dos cedentes cadastrados, com filtros por CNPJ, nome | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/homologacao-emissor/consulta/consulta-emissor-filtro) 
| CED0011* | Detalhes do emissor | Visualizar os detalhes de um emissor cadastrado, por issuer_key | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/homologacao-emissor/consulta/consulta-emissor-chave) |  

## Homologação do Investidor

:::warning Atenção
**Para o fluxo de homologação do investidor, será realizado o cadastro do investidor pelo time de escrituração no momento de setup e a chave será fornecida ao time.**
:::

### Homologação do investidor para cadastros feitos no setup

| Código | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| INV1001* | Listagem dos investidores cadastrados | Listagem dos fundos cadastrados, com filtros por CNPJ, nome | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/homologacao-investidor/consulta/consulta-investidor-filtro) |  
| INV1002* | Detalhes do investidor | Visualizar os detalhes de um investidor cadastro, por investor_key | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/homologacao-investidor/consulta/consulta-investidor-chave) |  

## Emissão de nota comercial

Após os cadastros de emissores e investidores, é possível realizar a emissão de notas comerciais. Para isso, existem algumas combinações de fluxos de emissão, que serão contempladas abaixo.

| Código | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| COM0001* | Simulação de condições financeiras | simular as condições financeiras e o fluxo de pagamentos de uma operação | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/emissao-de-notas/simulacao) |
| COM0002* | Cadastro de Operação de Nota Comercial | criar uma nova operação de nota comercial com base nos dados financeiros e de investidores. | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/emissao-de-notas/cadastro-operacao/criar-operacao) | COM0001 |
| COM0003 | Cadastro e Remoção de Partes Relacionadas | cadastro e a remoção de partes relacionadas a uma operação | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-parte-relacionada/cadastrar-parte-relacionada) | COM0002 | 
| COM0004 | Envio e Remoção de Documentos de Representantes de Partes Relacionadas | envio e a remoção de documentos associados a representantes de partes relacionadas a uma operação | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-parte-relacionada/adicionar-documento)| COM0002, COM0003 |
| COM0005 | Envio e Remoção de Grupos de Assinantes de Representantes de Partes Relacionadas | envio e a remoção de grupos de assinantes associados a representantes de partes relacionadas a uma operação | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/emissao-de-notas/cadastro-operacao/cadastro-parte-relacionada/adicionar-grupo-assinantes) | COM0002, COM0003 |
| COM0006 | Pré-visualizar Termo Constitutivo | geração de uma minuta do Termo Constitutivo para uma operação específica, utilizando um template predefinido. | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/emissao-de-notas/geracao-minutas/gerar-minuta-contrato) | COM0002 |
| COM0007* | Alterar Template do Termo Constitutivo | alteração do template do Termo Constitutivo para uma operação específica | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/emissao-de-notas/geracao-minutas/alterar-template-tc) | COM0002 |
| COM0008* | Enviar Operação para Análise | alterar o status de uma operação para "em análise", enviando-a para o processo de validação de compliance pelo escriturador | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/emissao-de-notas/envio-para-analise) | COM0002, COM0003, COM0004, COM0005, COM0006, COM0007 |
| COM0009* | Enviar Atas de Aprovação Assinadas | Este endpoint permite enviar as atas de aprovação de empresas do tipo SA ou COP assinadas de forma externa para o sistema de escrituação, enviando um base64 que será analisado e aprovado pelo escriturador. | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/emissao-de-notas/envio-ata-aprovacao) | COM0002 |
| COM0010* | Consulta de Operações por Filtros | consultar operações de nota comercial utilizando filtros opcionais | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/emissao-de-notas/consulta/consulta-por-filtros) | COM0002, COM0003, COM0004, COM0005, COM0006, COM0007, COM0008, COM0009 |
| COM0011* | Consulta de Operação por Chave | consultar os detalhes completos de uma operação específica, utilizando sua chave única. | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/emissao-de-notas/consulta/consulta-por-chave) | COM0002, COM0003, COM0004, COM0005, COM0006, COM0007, COM0008, COM0009 |

### Caso assinatura seja via QI SIGN

| Código | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| COM0012* | Consulta dos Links para assinatura via QI SIGN da Operação | consultar todos os links para assinatura de uma operação específica via QI SIGN, utilizando sua chave única. | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/emissao-de-notas/consulta-link-assinatura-qisign) | COM0002, COM0003, COM0004, COM0005, COM0006, COM0007, COM0008, COM0009 |
| COM0013* | Consulta do Link dos contratos assinados via QI SIGN da Operação | consultar todos os documentos assinados de uma operação específica via QI SIGN, utilizando sua chave única | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/emissao-de-notas/consulta-link-assinado-qisign) | COM0002, COM0003, COM0004, COM0005, COM0006, COM0007, COM0008, COM0009 |

## Processo de integralização/Subscrição

| Código | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| INT0001* | Consulta de Integralização por Chave | consultar os detalhes de um processo de integralização utilizando sua chave única | [Link Documentação](https://docs.qitech.com.br/documentation/escrituracao/integralizacao-cotas/consulta-processo-integralizacao) |

## Mapeamento de erros

Os erros originários das apis de emissores, investidores e nota comercial podem ser encontrados em [**Link Catálogo de Erros**](https://docs.qitech.com.br/documentation/escrituracao/catalogo-erros/catalogo-erros)

# Emissão de boletos

## Cadastro e Autenticação API BaaS
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| CAB0001* | Cadastro no ambiente de Sandbox | Realizar o cadastro na plataforma da QI Tech no ambiente de Sandbox (sandbox.qitech.app) | cs@qitech.com.br |
| CAB0002* | Validação de token em Sandbox | Realizar a validação do QI Token em Sandbox | [Download Manual de Inclusão do Token](https://docs.qitech.com.br/assets/pdfs/QI%20Tech%20Manual%20Inclus%C3%A3o%20de%20Token.pdf) | CAB0001 |
| CAB0003* | Troca de chaves públicas | Realizar a troca de chaves públicas dentro da plataforma da QI Tech em sandbox (sandbox.qitech.app) | [Link Documentação](https://docs.qitech.com.br/documentation/primeiros_passos/troca_de_chaves) | CAB0001 e CAB0002 |
| CAB0004* | Teste de autenticação de chamadas | Finalizar teste de autenticação de chamadas | [Passo a Passo](https://docs.qitech.com.br/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_v2) <br/><br/> [Link Documentação](https://docs.qitech.com.br/documentation/primeiros_passos/teste_de_autenticacao/endpoints_de_teste) | CAB0003 |
| CAB0005* | Configuração de webhooks | Realizar a configuração da url para envio dos webhooks por parte da QI, através da plataforma da QI Tech em sandbox (sandbox.qitech.app) | [Link Documentação](https://docs.qitech.com.br/documentation/primeiros_passos/configurando_webhooks) | CAB0001 e CAB0002 |

---

## QI Conta

| Código | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| QIC0001* | Consulta de dados de uma conta | Consultar dados como saldo, dados do titular, data de abertura, dentre outros | [Link Documentação](https://docs.qitech.com.br/documentation/contas/consultar_contas) | CAB0003  |

---

## Movimentações

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| QIC0008* | Consulta de Extrato | Realizar a consulta do extrato de uma conta | [Link Documentação](https://docs.qitech.com.br/documentation/movimentacao_de_contas/consulta_de_transacoes) |  CAB0003  |
| QIC0009* | Solicitação de comprovante de transferência | Solicitar um comprovante de transferência | [Link Documentação](https://docs.qitech.com.br/documentation/movimentacao_de_contas/consulta_de_transacoes)| CAB0003 |
| QIC0010* | Leitura de webhooks de transação | Recepcionar com sucesso todos os webhooks de transação |  [Link Documentação](https://docs.qitech.com.br/documentation/movimentacao_de_contas/comprovante_de_transferencia) |  CAB0003  |
| QIC0011* | Consulta de lista de instituições financeiras | Consultar lista de instituições financeiras habiliatadas para recebimento de TED e Pix |  [Link Documentação](https://docs.qitech.com.br/documentation/lista_de_instituicoes_financeiras/consulta_de_instituicoes_financeiras) |  CAB0003  |

---

## Boletos

### Gestão de Chave Pix
#### Criação e Exclusão de Chave pix
| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| PIX0001* | Criação de chave Pix | Realizar a criação de chave Pix do tipo cpf, cnpj, aleatória, e-mail e telefone | [Link Documentação](https://docs.qitech.com.br/documentation/pix/criar_chave) | 
| PIX0010* | Listagem de chaves Pix de uma QI Conta | Listar chaves Pix vinculadas a uma QI Conta | [Link Documentação](https://docs.qitech.com.br/documentation/pix/listar_chaves_pix) | PIX0001 |

### Gestão da Carteira
| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| CRT0001* | Criação de carteira | Realizar a criação de carteira para configurações específicas de pagamento, baixa, protesto, etc.  | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/carteira/criar_carteira) | 
| CRT0002* | Editar carteira | Realizar a edição das configurações padrão.  | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/carteira/editar_carteira) |  CRT0002  |

### Gestão de Boletos
| Nº      | Etapa | Descrição | Link  | Pré-requisito |
|---|---|---|---|---|
| BOL0001 | Registro de boleto único de cobrança (padrão)    | Realizar o registro de um boleto de cobrança | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/emissao/emissao_boleto_unico_padrao) | CAB0002 ou CAB0003   |
| BOL0002 | Registro de boleto único de cobrança (instantânea) | Realizar o registro de um boleto de cobrança | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/emissao/emissao_boleto_unico_instantanea) | CAB0002 ou CAB0003   |
| BOL0003 | Registro de boleto em lote  | Realizar o registro de boleto de cobrança em lote | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/emissao/emissao_em_lote) | CAB0002 ou CAB0003   |
| BOL0004 | Realizar abatimento no valor de um boleto | Realizar abatimento no valor de um boleto | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/instrucoes/abatimento/criar_abatimento) | BOL0001, BOL0002 ou BOL0003 |
| BOL0005 | Cancelar Abatimento     | Cancelar abatimento em um boleto | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/instrucoes/abatimento/cancelar_abatimento) | BOL0001, BOL0002 ou BOL0003  |
| BOL0006 | Estender vencimento de um boleto               | Enviar extensão de prazo de um boleto | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/instrucoes/extensao)     | BOL0001, BOL0002 ou BOL0003   |
| BOL0007 | Incluir desconto em um boleto               | Incluir desconto em um boleto    | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/instrucoes/desconto)     | BOL0001, BOL0002 ou BOL0003   |
| BOL0008 | Incluir juros em um boleto                   | Incluir juros em um boleto       | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/instrucoes/juros)        | BOL0001, BOL0002 ou BOL0003   |
| BOL0009 | Incluir multa em um boleto                   | Incluir multa em um boleto       | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/instrucoes/multa)        | BOL0001, BOL0002 ou BOL0003   |
| BOL0010 | Realizar baixa de um boleto                   | Baixar um boleto                 | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/instrucoes/baixa)        | BOL0001, BOL0002 ou BOL0003   |
| BOL0011 | Consultar boletos por chave      | Consultar boletos por chave      | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/consulta/consulta_por_chave) | BOL0001, BOL0002 ou BOL0003   |
| BOL0012 | Listar Boletos          | Listar boletos     | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/consulta/listar_boletos) | BOL0001, BOL0002 ou BOL0003   |
| BOL0013 | Consulta de carteira de cobrança      | Consultar uma carteira de cobrança | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/carteira/listar_carteiras) | BOL0001, BOL0002 ou BOL0003   |
| BOL0014 | Webhooks de Boleto      | Realizar a leitura de webhook para boleto | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/webhooks/boleto) | BOL0001, BOL0002 ou BOL0003   |

### Protestos
| Nº      | Etapa | Descrição | Link  | Pré-requisito |
|---|---|---|---|---|
| BOL0015 | Pedido de protesto    | Realizar o pedido de protesto de um boleto | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/instrucoes/protesto/pedido_de_protesto) | CAB0002 ou CAB0003   |
| BOL0016 | Desistência de pedido de protesto (sustação)    | Desistir do pedido de um pedido de protesto, mantendo o boleto registrado | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/instrucoes/protesto/desistencia_de_protesto) | BOL0015   |
| BOL0017 | Desistência de pedido de protesto, com baixa do boleto    | Desistir do pedido de um pedido de protesto, baixando o boleto | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/instrucoes/protesto/desistencia_de_protesto_e_baixa_do_boleto) | BOL0015  |
| BOL0018 | Remoção de protesto (cancelamento)   | Cancelar um protesto confirmado (aceito pelo cartório) | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/instrucoes/protesto/sustacao_de_protesto) | BOL0015  |
| BOL0019 | Listar protestos   | Listar os protestos da carteira de uma conta | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/instrucoes/protesto/listar_protestos) | BOL0015   |
| BOL0020 | Consultar protesto por chave   | Consultar as informações de protesto de um boleto | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/instrucoes/protesto/consulta_por_chave) | BOL0015  |
| BOL0021 | Consultar instrumento de protesto   | Consultar o instrumento de protesto (documento oficial emitido pelo cartório) | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/instrucoes/protesto/consulta_instrumento_de_protesto) | BOL0015  |

### Conciliação de Boletos
| Nº      | Etapa | Descrição | Link  | Pré-requisito |
|---|---|---|---|---|
| CON0001 | Listar grupos de liquidação  | Realizar a listagem dos grupos de liquidação dos boletos liquidados | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/liquidacao/listar_grupos_de_liquidacao) | BOL0001, BOL0002 ou BOL0003   |
| CON0002 | Listar liquidações | Realizar a listagem dos boletos dos grupos de liquidação | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/liquidacao/listar_liquidacoes) | BOL0001, BOL0002 ou BOL0003   |
| CON0003 | Webhooks de Boleto      | Realizar a leitura de webhook para boleto | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/webhooks/liquidacao) | BOL0001, BOL0002 ou BOL0003   |

## Integração QI DTVM - Baixa parcelas

| Nº      | Etapa | Descrição | Link  | Pré-requisito |
|---|---|---|---|---|
| BAX0001 | Criação do Lote de Pagamento  | Criação do Lote de Pagamento das parcelas | [Link Documentação](https://docs.qitech.com.br/documentation/iaas/liquidacao_ativos/lote_pagamento/criacao) |    |
| BAX0002 | Inserção de liquidações | Realizar a liquidação de parcelas | [Link Documentação](https://docs.qitech.com.br/documentation/iaas/liquidacao_ativos/ativos) | BAX0001   |

---

# Webhooks

URL: /en/documentation/escrituracao/webhooks-escrituracao

## Overview

Those webhooks allow you to receive real-time notifications about status changes and important events related to the Commercial Paper issuance process. When an event occurs, QI Tech automatically sends an HTTP POST payload to the configured URL in your system.

## Webhook Configuration

To receive webhooks, you need to configure an endpoint URL in your system. See the [webhook configuration documentation](./introducao/autenticacao_webhooks.md) for more details on how to register and manage your webhook URLs.

### Authentication and Security

All webhooks sent by QI Tech include an HMAC-SHA256 signature in the `Signature` header. This signature must be validated in your system to ensure the authenticity and integrity of the received data. For more information about the validation process, see the [webhook authentication documentation](./introducao/autenticacao_webhooks.md).

## Available Events

### Issuer Management

#### Issuer Registration Approved

Sent when an issuer registration is approved by compliance.

**Event Type:** `issuer_management.issuer_status_change`

**Payload:**
```json
{
  "event_type": "issuer_management.issuer_status_change",
  "event_datetime": "2025-07-30T15:32:00Z",
  "event_data": {
    "issuer_key": "18c4d162-1b1b-4c3a-b7a7-5f1200723c43",
    "status": "approved"
  }
}
```

#### Issuer Registration Rejected

Sent when an issuer registration is rejected by compliance.

**Event Type:** `issuer_management.issuer_status_change`

**Payload:**
```json
{
  "event_type": "issuer_management.issuer_status_change",
  "event_datetime": "2025-07-30T15:32:00Z",
  "event_data": {
    "issuer_key": "18c4d162-1b1b-4c3a-b7a7-5f1200723c43",
    "status": "reproved"
  }
}
```

### Investor Management

#### Investor Registration Approved

Sent when an investor registration is approved by compliance.

**Event Type:** `investor_management.investor_status_change`

**Payload:**
```json
{
  "event_type": "investor_management.investor_status_change",
  "event_datetime": "2025-07-30T15:32:00Z",
  "event_data": {
    "investor_key": "18c4d162-1b1b-4c3a-b7a7-5f1200723c43",
    "status": "approved"
  }
}
```

#### Investor Registration Rejected

Sent when an investor registration is rejected by compliance.

**Event Type:** `investor_management.investor_status_change`

**Payload:**
```json
{
  "event_type": "investor_management.investor_status_change",
  "event_datetime": "2025-07-30T15:32:00Z",
  "event_data": {
    "investor_key": "18c4d162-1b1b-4c3a-b7a7-5f1200723c43",
    "status": "reproved"
  }
}
```

### Operation Management

#### Operation Approved

Sent when an operation is approved by compliance and is ready to be sent for signature.

**Event Type:** `commercial_paper.operation_status_change`

**Payload:**
```json
{
  "event_type": "commercial_paper.operation_status_change",
  "event_datetime": "2025-07-30T15:45:00Z",
  "event_data": {
    "operation_key": "89c7f73a-c184-400c-bb2a-dd4424075a4f",
    "status": "pending_signature_submission"
  }
}
```

#### Operation Sent for Signature

Sent when an operation is sent for signature by the involved parties.

**Event Type:** `commercial_paper.operation_status_change`

**Payload:**
```json
{
  "event_type": "commercial_paper.operation_status_change",
  "event_datetime": "2025-07-30T15:45:00Z",
  "event_data": {
    "operation_key": "89c7f73a-c184-400c-bb2a-dd4424075a4f",
    "status": "waiting_signature"
  }
}
```

#### Operation Signed and Issued

Sent when an operation is signed by all parties. This event confirms that the Commercial Paper was successfully issued.

**Event Type:** `commercial_paper.operation_status_change`

**Payload:**
```json
{
  "event_type": "commercial_paper.operation_status_change",
  "event_datetime": "2025-07-30T15:45:00Z",
  "event_data": {
    "operation_key": "89c7f73a-c184-400c-bb2a-dd4424075a4f",
    "status": "issued"
  }
}
```

#### Operation Canceled

Sent when an operation is canceled.

**Event Type:** `commercial_paper.operation_status_change`

**Payload:**
```json
{
  "event_type": "commercial_paper.operation_status_change",
  "event_datetime": "2025-07-30T15:45:00Z",
  "event_data": {
    "operation_key": "89c7f73a-c184-400c-bb2a-dd4424075a4f",
    "status": "canceled"
  }
}
```

### Subscription Management

#### Subscription Sent for Signature

Sent when a subscription is created and sent for investor signature.

**Event Type:** `subscription.subscription_status_change`

**Payload:**
```json
{
  "event_type": "subscription.subscription_status_change",
  "event_datetime": "2025-07-30T16:05:00Z",
  "event_data": {
    "integralization_key": "491e4f5c-a173-4ab8-8ec6-24e7aa228099",
    "subscription_key": "eb791639-2931-41df-b087-731d40f07a7c",
    "status": "waiting_signature"
  }
}
```

#### Subscription Signed

Sent when the subscription is signed by all parties and is waiting for payment.

**Event Type:** `subscription.subscription_status_change`

**Payload:**
```json
{
  "event_type": "subscription.subscription_status_change",
  "event_datetime": "2025-07-30T16:05:00Z",
  "event_data": {
    "integralization_key": "491e4f5c-a173-4ab8-8ec6-24e7aa228099",
    "subscription_key": "eb791639-2931-41df-b087-731d40f07a7c",
    "status": "waiting_payment"
  }
}
```

#### Subscription Completed

Sent when the subscription is completely finalized after payment confirmation.

**Event Type:** `subscription.subscription_status_change`

**Payload:**
```json
{
  "event_type": "subscription.subscription_status_change",
  "event_datetime": "2025-07-30T16:05:00Z",
  "event_data": {
    "integralization_key": "491e4f5c-a173-4ab8-8ec6-24e7aa228099",
    "subscription_key": "eb791639-2931-41df-b087-731d40f07a7c",
    "status": "finished"
  }
}
```

### Subscription Payment Management

#### Payment Receipt Included

Sent when a payment receipt is included and is waiting for confirmation.

**Event Type:** `subscription_payment.subscription_payment_status_change`

**Payload:**
```json
{
  "event_type": "subscription_payment.subscription_payment_status_change",
  "event_datetime": "2025-07-30T16:05:00Z",
  "event_data": {
    "integralization_key": "491e4f5c-a173-4ab8-8ec6-24e7aa228099",
    "subscription_key": "eb791639-2931-41df-b087-731d40f07a7c",
    "subscription_payment_key": "1413020c-6965-40fb-a162-632459d35fd1",
    "status": "waiting_confirmation"
  }
}
```

#### Payment Receipt Approved

Sent when the payment receipt is approved and confirmed.

**Event Type:** `subscription_payment.subscription_payment_status_change`

**Payload:**
```json
{
  "event_type": "subscription_payment.subscription_payment_status_change",
  "event_datetime": "2025-07-30T16:05:00Z",
  "event_data": {
    "integralization_key": "491e4f5c-a173-4ab8-8ec6-24e7aa228099",
    "subscription_key": "eb791639-2931-41df-b087-731d40f07a7c",
    "subscription_payment_key": "1413020c-6965-40fb-a162-632459d35fd1",
    "status": "confirmed"
  }
}
```

## Event Flow

### Commercial Paper Issuance Flow

1. **Issuer Registration** → `issuer_status_change` (approved/reproved)
2. **Investor Registration** → `investor_status_change` (approved/reproved)
3. **Operation Creation** → `operation_status_change` (pending_signature_submission)
4. **Sent for Signature** → `operation_status_change` (waiting_signature)
5. **Operation Issued** → `operation_status_change` (issued)

### Subscription Flow

1. **Subscription Creation** → `subscription_status_change` (waiting_signature)
2. **Signature Completed** → `subscription_status_change` (waiting_payment)
3. **Receipt Inclusion** → `subscription_payment_status_change` (waiting_confirmation)
4. **Payment Confirmed** → `subscription_payment_status_change` (confirmed)
5. **Subscription Completed** → `subscription_status_change` (finished)

## Best Practices

1. **Respond quickly**: Return an HTTP 2xx status as quickly as possible to confirm webhook receipt.
2. **Asynchronous processing**: For time-consuming operations, confirm receipt immediately and process the event asynchronously.
3. **Idempotency**: Implement idempotent logic, as webhooks may be resent in case of network failure.
4. **Signature validation**: Always validate the HMAC signature before processing the webhook.
5. **Logs and monitoring**: Maintain detailed logs of all received webhooks for auditing and debugging.

## References

- [Webhook Configuration](./introducao/autenticacao_webhooks.md)

---

# Aprovação de Reserva

URL: /en/documentation/garantia_veicular/aprovacao_reserva

:::caution API em desenvolvimento
A API ainda está em fase de desenvolvimento, sendo assim, este manual está sujeito a alterações.
:::

Quando a configuração do requester define que reservas precisam de aprovação manual (`allow_reservation: false`), toda nova reserva é criada com `is_allowed_to_reserve = false`. Nesse estado, a reserva permanece em `pending_reservation` e **não é processada** pela rotina automática — fica aguardando uma aprovação explícita.

Este endpoint libera a reserva manualmente, alterando `is_allowed_to_reserve` para `true`. A partir daí, o próximo ciclo da rotina automática avança a reserva para `pending_reservation_confirmation` (veja [Mapa de Status](/documentation/garantia_veicular/mapa_de_status)).

:::info O `status` da reserva não muda com a chamada
O `reservation_status` continua `pending_reservation` antes e depois do approve. O que muda é o flag `is_allowed_to_reserve`, que destrava o processamento automático. O avanço para `pending_reservation_confirmation` acontece na próxima execução da rotina.
:::

## Aprovar Reserva

ENDPOINT /debt/ OPERATION-KEY /vehicle_collateral/reservation/approve
MÉTODO POST

O `OPERATION-KEY` é o `operation_key` da operação de crédito. A requisição **não exige body**.

Response Body (200)

```json
{
    "reservation_key": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
    "external_key": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "reservation_status": "pending_reservation",
    "is_allowed_to_reserve": true,
    "document_number": "12345678901",
    "inclusion_date": "2026-06-15"
}
```

### Campos da Response

| Campo | Tipo | Descrição |
|-------|------|-----------|
| reservation_key | String (UUID) | Identificador interno da reserva |
| external_key | String (UUID) | Identificador da operação (mesmo enviado na URL) |
| reservation_status | String | Status atual da reserva. Permanece `pending_reservation` após o approve (ver [Mapa de Status](/documentation/garantia_veicular/mapa_de_status)) |
| is_allowed_to_reserve | Boolean | `true` após a aprovação — libera o processamento automático |
| document_number | String | CPF/CNPJ do tomador |
| inclusion_date | String (`YYYY-MM-DD`) | Data de criação da reserva |

:::tip Idempotência
Chamar o endpoint quando `is_allowed_to_reserve` já é `true` retorna 200 normalmente, sem alterar o estado. Pode ser usado com segurança em retries.
:::

:::caution Validação de propriedade
A reserva precisa pertencer ao requester autenticado. Caso contrário, a resposta é `404 Not Found`.
:::

---

# Cancellation

URL: /en/documentation/garantia_veicular/cancelamento

An Auto Credit operation can be cancelled in three distinct scenarios, each with its own endpoint. In all cases, **the fiduciary lien / gravame is automatically removed from the vehicle** once the cancellation is confirmed.

| Scenario | When to use | Endpoint |
|----------|-------------|----------|
| Before disbursement | Operation created but not yet disbursed to the dealership | `PATCH /debt/{DEBT-KEY}/cancel` |
| Dealership refund | Operation already disbursed — the dealership refunds the amount via Pix QR Code | `POST /debt/reversal` |
| Permanent cancellation | Definitive withdrawal of the operation (closure without possibility of reactivation) | `POST /debt/{DEBT-KEY}/cancel_permanently` |

**Before disbursement**

While the operation has not yet been disbursed, you can cancel it directly through `PATCH /debt/{DEBT-KEY}/cancel`. Since no funds have left QI Tech to the dealership, the cancellation is immediate and no refund flow is required.

ENDPOINT /debt/ DEBT-KEY /cancel
METHOD PATCH

The full endpoint reference, including the response body, is available at [Cancel debt before disbursement](/documentation/emissao_de_divida/cancelamento/cancelar_divida_antes_de_desembolsar).

:::info When to use
Use this endpoint whenever the operation **has not yet been disbursed** (status before the disbursement to the dealership). After disbursement, use the refund flow via `/debt/reversal`.
:::

**Refund via /debt/reversal**

After disbursement, cancellation happens by refunding the amount to QI Tech via a Pix QR Code. **For Auto Credit, the QR Code is paid by the dealership** (which received the original disbursement), not by the borrower. Once payment is confirmed, the operation is cancelled and the lien/gravame is removed from the vehicle at SNG/Detran. If assignment has already occurred, the amount is refunded to the assignee.

**Step by step**

1. The partner calls **`POST /debt/reversal`** with the `contract_number` of the operation to be cancelled.
2. QI Tech responds with a Pix QR Code (`copy_paste_pix`, `amount`, `expiration_date`).
3. The partner **forwards the QR Code to the dealership** (which received the original disbursement).
4. The dealership pays the QR Code.
5. Once payment is confirmed, the operation is cancelled automatically and the **fiduciary lien / gravame is removed** from the vehicle at SNG/Detran. If assignment has already occurred, the amount is refunded to the assignee.

**Request**

```json title='POST /debt/reversal'
{
    "contract_number": "0000049343/TW"
}
```

Optional fields: `days_to_expire` (calendar days) or `workdays_to_expire` (business days) to customize the QR Code expiration (default: 14 business days).

**Response**

```json
{
    "amount": "10641.24",
    "copy_paste_pix": "00020126930014br.gov.bcb.pix2571qrcode-...",
    "expiration_date": "2025-05-24",
    "payer_document_number": "98765432000100",
    "payer_name": "CONCESSIONARIA EXEMPLO VEICULOS",
    "reversal_key": "f98a1b7c-5e3c-4e6f-8887-c7fedfa0d5b5",
    "status": "waiting_payment"
}
```

:::info Full references
- [Generate the Pix QR Code refund (`POST /debt/reversal`)](/documentation/emissao_de_divida/cancelamento/desistencia/cancelamento_de_divida_em_ate_sete_dias_apos_o_desembolso) — complete endpoint reference, including fields and error responses.
- [Query the Pix QR Code refund](/documentation/emissao_de_divida/cancelamento/desistencia/consulta_de_pix_qr_code_de_devolucao) — to track payment status.
:::

:::tip Prerequisite
The endpoint must be enabled by QI Tech, including the configuration of the assignee's refund account. Contact your QI Tech focal point to set this up.
:::

**Permanent cancellation**

Permanent cancellation closes the credit operation definitively, **with no possibility of reactivation**. Use this endpoint when the withdrawal is final and none of the recovery flows (bank account resubmission, document resending, etc.) apply.

ENDPOINT /debt/ debt_key /cancel_permanently
METHOD POST

The full endpoint reference, including the response body, is available at [Cancel permanently](/documentation/emissao_de_divida/cancelamento/cancelar_permanentemente).

:::danger Irreversible operation
After `cancel_permanently`, the operation **cannot be reactivated**. Evaluate whether the alternatives (`/cancel` before disbursement, or `/debt/reversal` after) cover your use case before using this endpoint.
:::

---

# Queries

URL: /en/documentation/garantia_veicular/consultas

:::caution API under development
The API is still in development phase, therefore, this manual is subject to changes.
:::

## Query Debt

Returns the data for a single debt or a paginated list of debts. Filters are passed as query parameters.

ENDPOINT /debt
METHOD GET

### Query Parameters

| Parameter | Type | Description | Req. |
|-----------|------|-------------|------|
| key | String (UUID) | Unique debt identifier | NO |
| contract_number | String | Contract number | NO |
| issuer_document_number | String | Borrower CPF or CNPJ | NO |
| status | String | Debt status (e.g., `opened`, `waiting_signature`, `disbursed`, `canceled`, `settled`) | NO |
| page | Integer | Page number (default: 1) | NO |
| page_size | Integer | Records per page (default: 10, max: 100) | NO |

### Response — Search by key (single record)

STATUS 200

Response Body

```json
{
    "data": {
        "key": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
        "contract_number": "OP-000000000000001",
        "status": "disbursed",
        "borrower": {
            "name": "João da Silva",
            "document_number": "12345678901",
            "person_type": "natural"
        },
        "financial": {
            "interest_type": "pre_price_days",
            "credit_operation_type": "ccb",
            "monthly_interest_rate": 0.018,
            "number_of_installments": 12,
            "issue_amount": 5419.55,
            "disbursement_date": "2025-05-10",
            "first_due_date": "2025-06-15"
        },
        "collaterals": [
            {
                "collateral_type": "vehicle",
                "collateral_key": "f1e2d3c4-b5a6-7890-fedc-ba0987654321",
                "collateral_data": {
                    "vehicle_type": "car",
                    "plate": "ABC1D23",
                    "license_state": "SP",
                    "chassi_number": "9BWZZZ37780001234",
                    "renavam": "12345678901"
                }
            }
        ],
        "created_at": "2025-05-10T14:30:00.000000",
        "updated_at": "2025-05-10T16:00:00.000000"
    }
}
```

### Response — Paginated search (list)

Response Body

```json
{
    "data": [
        {
            "key": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
            "contract_number": "OP-000000000000001",
            "status": "disbursed",
            "borrower": {
                "name": "João da Silva",
                "document_number": "12345678901",
                "person_type": "natural"
            },
            "financial": {
                "issue_amount": 5419.55,
                "number_of_installments": 12,
                "disbursement_date": "2025-05-10"
            },
            "created_at": "2025-05-10T14:30:00.000000"
        }
    ],
    "pagination": {
        "current_page": 1,
        "page_size": 10,
        "total_pages": 1,
        "total_items": 1
    }
}
```

---

## Query Reservation Status (Lien)

Returns the current status of the lien (gravame) registration at SNG/B3.

ENDPOINT /debt/ DEBT-KEY /vehicle_collateral/reservation
METHOD GET

Response Body (200)

```json
{
    "status": "reserved",
    "last_updated_at": "2026-02-13 20:38:07",
    "chassi_number": "9BWZZZ37780001234",
    "license_state": "SP",
    "collateral_number": "12345678"
}
```

### Response Fields

| Field | Type | Description |
|-------|------|-------------|
| status | String | Current lien status (see [Status Map](/documentation/garantia_veicular/mapa_de_status)). Possible values: `pending_reservation`, `pending_reservation_confirmation`, `reserved`, `pending_requester_action`, `canceled` |
| last_updated_at | String | Last update timestamp (`YYYY-MM-DD HH:MM:SS`) |
| chassi_number | String | Vehicle chassis number |
| license_state | String | Vehicle licensing state (2 chars, uppercase) |
| collateral_number | String | Collateral number (up to 8 chars; `"0"` if not yet available) |

---

## Query Registration Status (Contract)

Returns the current status of the contract registration at DETRAN/Registrar.

ENDPOINT /debt/ DEBT-KEY /vehicle_collateral/register
METHOD GET

Response Body (200)

```json
{
    "status": "registered",
    "last_updated_at": "2026-02-14 10:45:07",
    "chassi_number": "9BWZZZ37780001234",
    "license_state": "SP"
}
```

### Response Fields

| Field | Type | Description |
|-------|------|-------------|
| status | String | Current contract status (see [Status Map](/documentation/garantia_veicular/mapa_de_status)). Possible values: `pending_registration_confirmation`, `registered`, `pending_send_contract`, `pending_send_contract_confirmation`, `pending_requester_action`, `deleted` |
| last_updated_at | String | Last update timestamp (`YYYY-MM-DD HH:MM:SS`) |
| chassi_number | String | Vehicle chassis number |
| license_state | String | Vehicle licensing state (2 chars, uppercase) |

---

# Status Map and Stages

URL: /en/documentation/garantia_veicular/mapa_de_status

:::caution API under development
The API is still in development phase, therefore, this manual is subject to changes.
:::

## Overview — Complete Lifecycle

The diagram below presents the complete lifecycle of a vehicle collateral operation, from debt creation through contract registration and image submission.

```mermaid
flowchart LR
    A["POST /debt"] --> B["Signature"]
    B --> C["Lien\n(SNG/B3)"]
    C --> D["Disbursement"]
    D --> E["Contract\n(DETRAN)"]
    E --> F["Contract\nImage"]
    F --> G["Completed"]
```

---

## Collateral Lifecycle (Lien)

After the contract signature, QI Tech automatically sends the lien inclusion request to SNG/B3.

```mermaid
stateDiagram-v2
    [*] --> pending_reservation: Debt created with collateral_data

    state "pending_reservation" as pending_reservation
    state "pending_reservation_confirmation" as pending_confirmation
    state "reserved" as reserved
    state "pending_requester_action" as requester_action
    state "canceled" as canceled

    pending_reservation --> pending_confirmation: QI Tech sends to SNG/B3
    pending_reservation --> canceled: Canceled by partner

    pending_confirmation --> reserved: Lien registered successfully
    pending_confirmation --> requester_action: Data error
    pending_confirmation --> canceled: Impediment or restriction

    requester_action --> pending_confirmation: Data corrected and resubmitted

    reserved --> [*]: Ready for disbursement and contract registration
    canceled --> [*]
```

| Status | Enumerator | Description |
|--------|------------|-------------|
| Reservation Pending | `pending_reservation` | Data entered in the platform, awaiting submission to SNG/B3 |
| Reservation Confirmation Pending | `pending_reservation_confirmation` | Data sent to SNG/B3. Awaiting lien registration confirmation |
| Reserved | `reserved` | Lien registered successfully at SNG/B3. Operation ready for disbursement and contract registration |
| Requester Action Pending | `pending_requester_action` | Error in submitted data or restriction detected. Partner must correct and resubmit |
| Canceled | `canceled` | Request canceled on the platform |

### Cancellation Lifecycle (Lien Deletion)

When an operation needs to be canceled after the lien has been registered, the deletion flow is triggered:

```mermaid
flowchart LR
    A["reserved /\nregistered"] -->|Cancellation requested| B["pending_deletion"]
    B -->|Deletion sent to SNG/B3| C["pending_deletion_confirmation"]
    C -->|Deletion confirmed| D["deleted"]
```

| Status | Enumerator | Description |
|--------|------------|-------------|
| Deletion Pending | `pending_deletion` | Cancellation requested, awaiting deletion submission to SNG/B3 |
| Deletion Confirmation Pending | `pending_deletion_confirmation` | Deletion request sent. Awaiting SNG/B3 confirmation |
| Deleted | `deleted` | Collateral and contract fully canceled at SNG/B3 and DETRAN |

---

## Contract Lifecycle

After the lien is confirmed (`reserved`) and disbursement is completed, QI Tech automatically sends the contract registration to DETRAN/Registrar.

```mermaid
stateDiagram-v2
    [*] --> pending_registration_confirmation: Lien confirmed + disbursement

    state "pending_registration_confirmation" as pending_reg
    state "registered" as registered
    state "pending_send_contract" as pending_send
    state "pending_send_contract_confirmation" as pending_send_conf
    state "pending_requester_action" as requester_action
    state "deleted" as deleted

    pending_reg --> registered: Contract registered at DETRAN
    pending_reg --> requester_action: Invalid data or DETRAN counter
    pending_reg --> deleted: Canceled

    registered --> pending_send: Ready for contract image submission
    pending_send --> pending_send_conf: Image sent to DETRAN
    pending_send_conf --> registered: Image approved
    pending_send_conf --> requester_action: Image rejected (resubmission required)

    requester_action --> pending_reg: Data corrected and resubmitted
    deleted --> [*]
```

| Status | Enumerator | Description |
|--------|------------|-------------|
| Registration Confirmation Pending | `pending_registration_confirmation` | Contract sent to DETRAN/Registrar. Awaiting validation and registration |
| Registered | `registered` | Contract registered successfully at DETRAN. Next step: image submission |
| Contract Send Pending | `pending_send_contract` | Contract registered, awaiting contract image submission |
| Contract Send Confirmation Pending | `pending_send_contract_confirmation` | Image sent to DETRAN/Registrar. Awaiting validation |
| Requester Action Pending | `pending_requester_action` | DETRAN counter (DF/TO: debtor must appear in person) or invalid data/image |
| Deleted | `deleted` | Contract canceled on the platform |

:::info Internal Statuses
Image validation statuses (e.g., `invalid_image`) are exclusively internal and are **not** sent to external clients via webhook.
:::

---

# Simulation and Issuance

URL: /en/documentation/garantia_veicular/simulacao_e_emissao

:::caution API under development
The API is still in development phase, therefore, this manual is subject to changes.
:::

## Debt Simulation

Before issuing the operation, simulate the financial conditions by sending the basic data with collateral type `vehicle`. Registration fees vary per Detran region, so the collateral data is required for an accurate financial simulation.

### Request

ENDPOINT /debt_simulation
METHOD POST

Test in Playground

Request Body

**Installment value with disbursement amount**

```json
{
    "borrower": {
        "person_type": "natural"
    },
    "financial": {
        "first_due_date": "2025-06-15",
        "installment_face_value": 500,
        "disbursed_amount": 10000.00,
        "disbursement_date": "2025-05-10",
        "limit_days_to_disburse": 3,
        "number_of_installments": 12,
        "monthly_interest_rate": 0.018,
        "interest_type": "pre_price_days",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "principal_grace_period": 0
    },
    "collaterals": [
        {
            "collateral_type": "vehicle",
            "collateral_data": {
                "vehicle_type": "car",
                "license_state": "SP"
            }
        }
    ]
}
```

**Disbursement value with rate**

```json
{
    "borrower": {
        "person_type": "natural"
    },
    "financial": {
        "interest_type": "pre_price_days",
        "disbursement_date": "2025-05-10",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "monthly_interest_rate": 0.018,
        "disbursed_amount": 10000.00,
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "number_of_installments": 12,
        "principal_grace_period": 0,
        "due_dates": [
            "2025-06-15",
            "2025-07-15",
            "2025-08-15",
            "2025-09-15",
            "2025-10-15",
            "2025-11-15",
            "2025-12-15",
            "2026-01-15",
            "2026-02-15",
            "2026-03-15",
            "2026-04-15",
            "2026-05-15"
        ]
    },
    "collaterals": [
        {
            "collateral_type": "vehicle",
            "collateral_data": {
                "vehicle_type": "car",
                "license_state": "SP"
            }
        }
    ]
}
```

:::info
The simulation accepts both `installment_face_value` (fixing the installment value, varying the disbursement) and `disbursed_amount` (fixing the disbursed value, varying the installment). When using `disbursed_amount`, provide the due dates in the `due_dates` array. The `collateral_type` field must be `"vehicle"`. For simulation, the required fields in `collateral_data` are `vehicle_type` and `license_state` — fees vary per Detran region.
:::

### Response

STATUS 200

Response Body

```json
{
    "type": "debt",
    "key": "<Debt Key>",
    "status": "finished",
    "event_datetime": "2025-05-10 16:50:00",
    "data": {
        "interest_type": "pre_price_days",
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "principal_grace_period": 0,
        "operation_type": "structured_operation",
        "prefixed_interest_rate": {
            "interest_base": "calendar_days_365",
            "annual_rate": 0.23872053,
            "monthly_rate": 0.018,
            "daily_rate": 0.00058669
        },
        "issue_date": "2025-05-10",
        "number_of_installments": 12,
        "disbursement_options": [
            {
                "iof_amount": 25.50,
                "total_pre_fixed_amount": 580.45,
                "cet": 0.0230,
                "annual_cet": 0.3120,
                "contract_fees": [
                    {
                        "fee_type": "registration_fee",
                        "amount_type": "absolute",
                        "amount": 1.0,
                        "fee_amount": 350.00
                    }
                ],
                "external_contract_fees": [],
                "contract_fee_amount": 350.00,
                "external_contract_fee_amount": 0.0,
                "disbursement_date": "2025-05-10",
                "first_due_date": "2025-06-15",
                "installments": [
                    {
                        "calendar_days": 36,
                        "business_due_date": "2025-06-15",
                        "due_date": "2025-06-15",
                        "due_principal": 5419.55,
                        "has_interest": true,
                        "pre_fixed_amount": 114.65,
                        "tax_amount": 1.25,
                        "total_amount": 500,
                        "principal_amortization_amount": 385.35,
                        "installment_number": 1
                    }
                ],
                "issue_amount": 5419.55,
                "disbursed_issue_amount": 5044.05,
                "assignment_amount": 5419.55,
                "final_disbursement_amount": 5044.05,
                "prefixed_interest_rate": {
                    "interest_base": "calendar_days_365",
                    "annual_rate": 0.23872053,
                    "monthly_rate": 0.018,
                    "daily_rate": 0.00058669
                }
            }
        ]
    }
}
```

### Installments Object

| Field | Description |
|-------|-------------|
| calendar_days | Calendar days |
| business_due_date | Business day due date |
| due_date | Due date |
| due_principal | Due principal |
| has_interest | Whether the installment has interest |
| pre_fixed_amount | Pre-fixed installment amount |
| tax_amount | Tax amount |
| total_amount | Total installment amount |
| principal_amortization_amount | Principal amortization amount |
| installment_number | Installment number |

### Prefixed Interest Rate Object

| Field | Description |
|-------|-------------|
| monthly_rate | Monthly rate |
| daily_rate | Daily rate |
| annual_rate | Annual rate |
| interest_base | Interest rate calculation base |

### Contract Fees Object

| Field | Type | Description |
|-------|------|-------------|
| fee_type | String | Fee type (e.g., `registration_fee`) |
| amount_type | String | Value type (`absolute` or `percentage`) |
| amount | Float | Multiplier or percentage applied |
| fee_amount | Float | Final monetary fee amount |

:::info Registration Fees
General registration fees (DETRAN, SNG/B3) are reflected directly in the `contract_fee_amount` field within `disbursement_options`. The total fee amount is deducted from the issue amount (`issue_amount`), not from the net disbursement amount.
:::

---

## Operation Issuance

After simulating and validating the conditions, issue the credit operation with vehicle collateral. The request body includes the borrower data (natural person — the car buyer), financial data, vehicle collateral, and disbursement account.

The debt API is designed to be executed in a single request, after prior submission of files ([document upload](/documentation/upload_de_documentos/upload_de_documentos)).

:::danger Borrower and Disbursement
The debt borrower (`borrower`) is the **natural person buying the vehicle**. The disbursement (`disbursement_bank_accounts`) is made to the **dealership** — meaning the bank account details provided should belong to the dealership selling the vehicle.
:::

### Document Upload

Before issuing the debt, upload the borrower's documents via `POST /upload`. Each document returns a UUID (`document_key`) that must be included in the borrower payload.

| Document | Borrower Field | Description | Req. |
|----------|---------------|-------------|------|
| Identity document (front) | `document_identification` | ID card, driver's license or other photo ID (front) | YES |
| Identity document (back) | `document_identification_back` | Back of the identity document | YES |
| Proof of residence | `proof_of_residence` | Updated proof of address | YES |

:::info Document Upload
See the full upload documentation: [Document Upload](/documentation/upload_de_documentos/upload_de_documentos). Vehicle documents are not required.
:::

### Request

ENDPOINT /debt
METHOD POST

Test in Playground

Request Body

```json
{
    "borrower": {
        "name": "João da Silva",
        "email": "joao.silva@email.com",
        "phone": {
            "number": "999998888",
            "area_code": "11",
            "country_code": "055"
        },
        "is_pep": false,
        "address": {
            "city": "São Paulo",
            "state": "SP",
            "number": "100",
            "street": "Rua Exemplo",
            "complement": "Apto 42",
            "postal_code": "01001000",
            "neighborhood": "Centro"
        },
        "role_type": "issuer",
        "birth_date": "1990-01-15",
        "mother_name": "MARIA DA SILVA",
        "nationality": "Brasileiro",
        "person_type": "natural",
        "marital_status": "single",
        "individual_document_number": "12345678901",
        "document_identification": "<uuid-front>",
        "document_identification_back": "<uuid-back>",
        "proof_of_residence": "<uuid-proof>"
    },
    "financial": {
        "interest_type": "pre_price_days",
        "first_due_date": "2025-06-15",
        "disbursement_date": "2025-05-10",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "monthly_interest_rate": 0.018,
        "installment_face_value": 500,
        "limit_days_to_disburse": 3,
        "number_of_installments": 12,
        "principal_grace_period": 0
    },
    "collaterals": [
        {
            "percentage": 1,
            "collateral_data": {
                "vehicle": {
                    "plate_state": "SP",
                    "renavan": "12345678901",
                    "vehicle_type": "car",
                    "model": "GOL 1.0",
                    "chassis": "9BWZZZ377VT004251",
                    "model_year": 2024,
                    "chassis_type": "normal",
                    "manufacturing_year": 2023,
                    "license_state": "SP",
                    "plate": "ABC1234"
                },
                "seller": {
                    "document_number": "37197645832",
                    "name": "Seller Test"
                },
                "credit_release_postal_code": "17057770"
            },
            "collateral_type": "vehicle"
        }
    ],
    "purchaser_document_number": "32402502000135",
    "disbursement_bank_accounts": [
        {
            "name": "CONCESSIONARIA EXEMPLO VEICULOS",
            "bank_code": "329",
            "branch_number": "0001",
            "account_number": "62400",
            "account_digit": "6",
            "document_number": "98765432000100",
            "percentage_receivable": 100
        }
    ]
}
```

:::info Important
There is no need to call separate endpoints to register the lien or contract. Simply include the vehicle data in the `collaterals` object when creating the debt and QI Tech handles the entire process internally (lien inclusion at SNG/B3, contract registration at DETRAN/Registry, image submission).
:::

:::tip reservation_method
After creation, the API automatically adds `reservation_method` to `collateral_data` (value: `"creation"` or `"issuing"` depending on requester configuration). This field should not be sent in the request.
:::

:::info Disbursement value (`disbursed_amount`)
`POST /debt` accepts either `installment_face_value` (fixes the installment value, varying the disbursement) or `disbursed_amount` (fixes the disbursed value, varying the installment) inside the `financial` object. The two fields are mutually exclusive. When using `disbursed_amount`, keep all other `financial` rules (rates, dates, number of installments) identical to the simulation payload.
:::

### Insurance (`vehicle_credit_insurance`)

The Auto Credit product supports credit life insurance issued together with the debt. Insurance is signaled inside `financial.rebates` and the premium (**2.75% over the issuance amount**) is calculated automatically by QI Tech — the partner only needs to flag the contract with the correct `fee_type` and `description`.

```json title='financial.rebates — Auto insurance'
{
    "rebates": [
        {
            "fee_type": "insurance_premium_qi_gross_up",
            "description": "vehicle_credit_insurance"
        }
    ]
}
```

| Field | Value | Description |
|-------|-------|-------------|
| `fee_type` | `"insurance_premium_qi_gross_up"` | Indicates that the insurance premium must be grossed-up into the operation amount by QI Tech. |
| `description` | `"vehicle_credit_insurance"` | Identifies the Auto Credit insurance product. |

:::info Premium calculation
The **2.75% rate over the issuance amount** is applied by QI Tech at issuance time. You do not need to send `amount` or `amount_type` for this `fee_type` — flagging the contract is enough.
:::

### Disbursement Payload Examples

The `disbursement_bank_accounts` field accepts different payment methods. The disbursement is made to the **dealership**:

**Pix (key)**

```json
{
    "disbursement_bank_accounts": [
        {
            "document_number": "98765432000100",
            "name": "CONCESSIONARIA EXEMPLO VEICULOS",
            "pix_key": "2f205c99-3161-4120-badd-854039d12de6",
            "pix_transfer_type": "key",
            "percentage_receivable": 100
        }
    ]
}
```

**Pix (manual)**

```json
{
    "disbursement_bank_accounts": [
        {
            "document_number": "98765432000100",
            "name": "CONCESSIONARIA EXEMPLO VEICULOS",
            "pix_transfer_type": "manual",
            "bank_code": "329",
            "branch_number": "0001",
            "account_number": "62400",
            "account_digit": "6",
            "percentage_receivable": 100
        }
    ]
}
```

**TED**

```json
{
    "disbursement_bank_accounts": [
        {
            "transfer_method": "ted",
            "bank_code": "341",
            "branch_number": "8615",
            "account_number": "22110",
            "account_digit": "2",
            "document_number": "98765432000100",
            "name": "CONCESSIONARIA EXEMPLO VEICULOS",
            "percentage_receivable": 100
        }
    ]
}
```

**QR Code Pix**

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

**Boleto**

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

### Borrower Fields (Natural Person)

| Field | Type | Description | Req. |
|-------|------|-------------|------|
| name | String | Buyer's full name | YES |
| email | String | Contact email | YES |
| phone | Object | Contact phone | YES |
| is_pep | Boolean | Politically exposed person | YES |
| address | Object | Buyer's address | YES |
| role_type | String | Borrower role (`issuer`) | YES |
| birth_date | String | Date of birth (YYYY-MM-DD) | YES |
| mother_name | String | Mother's name | YES |
| nationality | String | Nationality | YES |
| person_type | String | Always `"natural"` | YES |
| marital_status | String | Marital status (`single`, `married`, `divorced`, `widowed`) | YES |
| individual_document_number | String | Buyer's CPF (11 digits) | YES |
| document_identification | String | UUID of the identity document (front), uploaded via `/upload` | YES |
| document_identification_back | String | UUID of the identity document (back), uploaded via `/upload` | YES |
| proof_of_residence | String | UUID of the proof of residence, uploaded via `/upload` | YES |

### collateral_data Fields

| Field | Type | Description | Req. |
|-------|------|-------------|------|
| vehicle | Object | Vehicle data | YES |
| seller | Object | Seller data | YES |
| credit_release_postal_code | String | Postal code for credit release (8 digits) | YES |

#### vehicle Object

| Field | Type | Description | Req. |
|-------|------|-------------|------|
| vehicle_type | String | Vehicle type (`car`, `motorcycle`, `truck`) | YES |
| plate | String | Vehicle plate | YES |
| plate_state | String | State of the vehicle plate (2 chars, uppercase) | YES |
| license_state | String | Vehicle licensing state (2 chars, uppercase) | YES |
| renavan | String | RENAVAN number (11 digits) | YES |
| chassis | String | Vehicle chassis number | YES |
| chassis_type | String | Chassis type (`normal` or `remarcado`) | YES |
| model | String | Vehicle model | YES |
| model_year | Integer | Model year | YES |
| manufacturing_year | Integer | Manufacturing year | YES |

#### seller Object

| Field | Type | Description | Req. |
|-------|------|-------------|------|
| name | String | Dealership/seller name | YES |
| document_number | String | CPF (11 digits) or CNPJ (14 digits) of the seller | YES |

### Response

STATUS 201

Response Body

```json
{
    "webhook_type": "debt",
    "key": "<Debt Key>",
    "status": "waiting_signature",
    "event_datetime": "2025-05-10 14:30:00",
    "data": {
        "borrower": {
            "name": "João da Silva",
            "document_number": "12345678901",
            "related_party_key": "3571e292-3a83-4011-904d-20ee963022ef"
        },
        "contract": {
            "number": "OP-000000000000001",
            "urls": [
                "https://storage.googleapis.com/doc-api/documents/<uuid>/JOAO_DA_SILVA-CCB-OP000000000000001.pdf"
            ],
            "signature_information": [
                {
                    "signer_name": "João da Silva",
                    "signer_document_number": "12345678901",
                    "signer_role": "issuer",
                    "signer_email": "joao.silva@email.com",
                    "signer_external_key": null,
                    "signature_url": null
                }
            ]
        },
        "collaterals": [
            {
                "absolute_amount": null,
                "collateral_constituted": false,
                "collateral_data": {
                    "vehicle": {
                        "plate_state": "SP",
                        "renavan": "12345678901",
                        "vehicle_type": "car",
                        "model": "GOL 1.0",
                        "chassis": "9BWZZZ377VT004251",
                        "model_year": 2024,
                        "chassis_type": "normal",
                        "manufacturing_year": 2023,
                        "license_state": "SP",
                        "plate": "ABC1234"
                    },
                    "seller": {
                        "document_number": "37197645832",
                        "name": "Seller Test"
                    },
                    "credit_release_postal_code": "17057770"
                },
                "collateral_key": "f1e2d3c4-b5a6-7890-fedc-ba0987654321",
                "collateral_type": "vehicle",
                "created_at": "2025-05-10T14:30:00.000000",
                "external_key": null,
                "percentage": 1,
                "updated_at": "2025-05-10T14:30:00.000000"
            }
        ],
        "disbursement_options": [
            {
                "disbursement_date": "2025-05-10",
                "contract_fees": [
                    {
                        "fee_type": "registration_fee",
                        "amount_type": "absolute",
                        "amount": 1.0,
                        "fee_amount": 350.00
                    }
                ],
                "external_contract_fees": [],
                "contract_fee_amount": 350.00,
                "external_contract_fee_amount": 0.0,
                "assignment_amount": 5419.55,
                "issue_amount": 5419.55,
                "cet": "2,3000%",
                "annual_cet": "31,2000%",
                "total_iof": 25.50,
                "total_pre_fixed_amount": 580.45,
                "installments": [
                    {
                        "business_due_date": "2025-06-15",
                        "calendar_days": 36,
                        "due_date": "2025-06-15",
                        "due_principal": 5419.55,
                        "has_interest": true,
                        "installment_number": 1,
                        "pre_fixed_amount": 114.65,
                        "principal_amortization_amount": 385.35,
                        "tax_amount": 1.25,
                        "total_amount": 500,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-06-15",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.018,
                    "daily_rate": 0.00058669,
                    "annual_rate": 0.23872053,
                    "interest_base": "calendar_days_365"
                }
            }
        ]
    }
}
```

### Enumerators

#### collateral_type

| Value | Description |
|-------|-------------|
| vehicle | Vehicle collateral (lien) |

#### vehicle_type

| Value | Description |
|-------|-------------|
| car | Car |
| motorcycle | Motorcycle |
| truck | Truck |

#### chassi_type

| Value | Description |
|-------|-------------|
| Remarcado | Re-stamped chassis |
| Normal | Normal chassis (default) |

---

## Cancellation

Cancellation flows for the operation (before disbursement, refund via `/debt/reversal`, or permanent cancellation) are documented on the dedicated page: [Cancellation](/documentation/garantia_veicular/cancelamento).

## Other Available Actions

After issuing the debt, other functionalities are available in the debt API that can be used in conjunction with vehicle collateral operations:

| Action | Description | Documentation |
|--------|-------------|---------------|
| Authorize disbursement | Authorize or block the disbursement of an operation | [Authorize Disbursement](/documentation/emissao_de_divida/autorizar_desembolso) |
| Update related party data | Update registration information (address, phone, email) of the parties related to the contract | [Update Related Party](/documentation/emissao_de_divida/atualizar_dados_da_parte_relacionada) |
| Resend documents | Resend documents of the parties related to the credit contract | [Resend Documents](/documentation/emissao_de_divida/reenviar_documentos_das_partes_relacionadas) |
| Bank account resubmission | Update bank details for disbursement after transfer error | [Bank Account Resubmission](/documentation/emissao_de_divida/reapresentacao_de_conta_bancaria) |
| Cancel debt | Cancel the operation before disbursement | [Debt Cancellation](/documentation/emissao_de_divida/cancelamento/cancelar_divida_antes_de_desembolsar) |
| Cancel permanently | Permanently cancel the credit operation | [Cancel Permanently](/documentation/emissao_de_divida/cancelamento/cancelar_permanentemente) |
| Dealership refund | Generate Pix QR Code for the dealership to refund the disbursed amount and release the lien | [`/debt/reversal`](/documentation/emissao_de_divida/cancelamento/desistencia/cancelamento_de_divida_em_ate_sete_dias_apos_o_desembolso) |

---

# Mocks (Sandbox)

URL: /en/documentation/garantia_veicular/testes_homologacao

:::caution API under development
The API is still in development phase, therefore, this manual is subject to changes.
:::

The homologation (sandbox) environment has a mock system that simulates different SNG/B3 response scenarios during lien registration. The behavior is controlled by the borrower's `name` field when creating the debt (`POST /debt`).

:::tip Default Flow (Success)
Any `name` that is **not** in the scenario list below will follow the default success flow: the lien will be registered (`reserved`), followed by automatic contract creation (`pending_registration_confirmation`) and progression to disbursement. Two webhooks are sent in sequence: `reservation.status_change` (status `reserved`) and `contract.status_change` (status `pending_registration_confirmation`). For details on the webhook structure, see the [Webhooks](/documentation/garantia_veicular/webhooks) page.
:::

---

## Available Scenarios

### Field Validation Error (HTTP 400)

When using the name `bob`, the lien creation is rejected with field validation errors in the payload.

| Name | Stage | Resulting Status | Webhook |
| :---: | --- | :---: | :---: |
| `bob` | Lien creation | `pending_requester_action` | Yes |

**Full webhook example**

```json
{
  "event_key": "a23bc45d-67ef-8901-abcd-234567890abc",
  "event_type": "laas.vehicle_collateral.reservation.status_change",
  "origin": "vehicle_collateral",
  "origin_key": "<reservation_key>",
  "person_key": "<requester_key>",
  "receiver_contact": null,
  "data": {
    "callback": {
      "webhook_type": "laas.vehicle_collateral.reservation.status_change",
      "status": "pending_requester_action",
      "event_datetime": "2026-04-08T15:30:00.000Z",
      "data": {
        "contract_number": "CTR-2026-001",
        "rejection_details": [
          {
            "campo": "logradouroDevedor",
            "mensagem": "caracter inválido / acima do tamanho permitido / tipo inválido / Ausência do campo"
          },
          {
            "campo": "numTelDevedor",
            "mensagem": "caracter inválido / acima do tamanho permitido"
          }
        ]
      }
    }
  }
}
```

---

### Business Errors During Lien Confirmation

The scenarios below are triggered during the status confirmation stage. All result in `pending_requester_action` and send a webhook with `error_code`.

| Name | Error | `error_code` |
| :---: | --- | --- |
| `carol` | Vehicle already has a registered financial restriction | `vehicle_has_financial_restriction_already_registered` |
| `dave` | Chassis not found in BIN | `chassis_not_found_in_bin` |
| `frank` | Plate in BIN, provide the vehicle plate | `plate_in_bin_inform_plate_of_vehicle` |
| `george` | Plate divergent from BIN base | `plate_informed_different_from_plate_informed_by_uf_of_registration_in_bin_base` |
| `ian` | Property number does not match the postal code | `property_number_does_not_correspond_to_informed_postal_code` |
| `jack` | RENAVAM divergent | `renavam_informed_different_from_renavam_informed_by_uf_of_registration_in_bin_base` |
| `kate` | Invalid property state | `property_uf_invalid` |
| `mary` | Address with invalid fill | `financied_address_with_invalid_fill` |
| `olive` | Model year divergent from BIN | `model_year_informed_different_from_model_year_in_bin` |
| `quinn` | Open protocol in licensing state | `protocol_open_in_uf_of_registration` |
| `sara` | Invalid borrower name and address | `financied_name_and_address_with_invalid_fill` |
| `taylor` | Invalid borrower name | `financied_name_with_invalid_fill` |
| `vincent` | Vehicle already reserved in state base | `vehicle_already_reserved_in_state_base` |

**Full webhook example ( carol scenario)**

```json
{
  "event_key": "<uuid>",
  "event_type": "laas.vehicle_collateral.reservation.status_change",
  "origin": "vehicle_collateral",
  "origin_key": "<reservation_key>",
  "person_key": "<requester_key>",
  "receiver_contact": null,
  "data": {
    "callback": {
      "webhook_type": "laas.vehicle_collateral.reservation.status_change",
      "key": "<reservation_key>",
      "status": "pending_requester_action",
      "event_datetime": "2026-04-08T15:30:00.000Z",
      "data": {
        "contract_number": "CTR-2026-001",
        "error_code": "vehicle_has_financial_restriction_already_registered",
        "error_reason_en": "Vehicle has financial restriction already registered",
        "error_reason_pt": "Veículo com restrição financeira já cadastrada"
      }
    }
  }
}
```

---

### Definitive Refusal (no webhook)

In these cases, the reservation is definitively refused. **No webhook is sent to the client.**

| Name | Error | Resulting Status |
| :---: | --- | :---: |
| `eve` | Restriction in manufacturing BIN | `refused` |
| `robert` | Vehicle with restriction | `refused` |

---

### Automatic Reprocessing (no webhook)

In these cases, the message is returned for automatic reprocessing. **No webhook is sent to the client.**

| Name | Error | Behavior |
| :---: | --- | --- |
| `gabriel` | Unknown error | Automatic reprocessing |
| `henry` | Owner divergent in sale communication | Automatic reprocessing |
| `linda` | Restriction in licensing state | Automatic reprocessing |
| `nancy` | Address name exceeds 30 characters | Automatic reprocessing |
| `paul` | Phone number exceeds 9 characters | Automatic reprocessing |
| `william` | Unknown error | Automatic reprocessing |

---

## Summary Table

| Name | Stage | Resulting Status | Webhook | Type |
| :---: | --- | :---: | :---: | --- |
| `bob` | Creation (HTTP 400) | `pending_requester_action` | Yes | `reservation.status_change` with `rejection_details` |
| `carol` | Confirmation | `pending_requester_action` | Yes | `reservation.status_change` with `error_code` |
| `dave` | Confirmation | `pending_requester_action` | Yes | `reservation.status_change` with `error_code` |
| `eve` | Confirmation | `refused` | No | — |
| `frank` | Confirmation | `pending_requester_action` | Yes | `reservation.status_change` with `error_code` |
| `george` | Confirmation | `pending_requester_action` | Yes | `reservation.status_change` with `error_code` |
| `gabriel` | Confirmation | Reprocessing | No | — |
| `henry` | Confirmation | Reprocessing | No | — |
| `ian` | Confirmation | `pending_requester_action` | Yes | `reservation.status_change` with `error_code` |
| `jack` | Confirmation | `pending_requester_action` | Yes | `reservation.status_change` with `error_code` |
| `kate` | Confirmation | `pending_requester_action` | Yes | `reservation.status_change` with `error_code` |
| `linda` | Confirmation | Reprocessing | No | — |
| `mary` | Confirmation | `pending_requester_action` | Yes | `reservation.status_change` with `error_code` |
| `nancy` | Confirmation | Reprocessing | No | — |
| `olive` | Confirmation | `pending_requester_action` | Yes | `reservation.status_change` with `error_code` |
| `paul` | Confirmation | Reprocessing | No | — |
| `quinn` | Confirmation | `pending_requester_action` | Yes | `reservation.status_change` with `error_code` |
| `robert` | Confirmation | `refused` | No | — |
| `sara` | Confirmation | `pending_requester_action` | Yes | `reservation.status_change` with `error_code` |
| `taylor` | Confirmation | `pending_requester_action` | Yes | `reservation.status_change` with `error_code` |
| `vincent` | Confirmation | `pending_requester_action` | Yes | `reservation.status_change` with `error_code` |
| `william` | Confirmation | Reprocessing | No | — |
| *(other)* | — | `reserved` + `pending_registration_confirmation` | Yes (2x) | `reservation.status_change` + `contract.status_change` |

:::warning Attention
The mocks above simulate only the **lien registration** (reservation) stage. The contract registration and image submission flow does not have dedicated mocks in the homologation environment.
:::

---

# Webhooks — Vehicle Collateral

URL: /en/documentation/garantia_veicular/webhooks

:::caution API under development
The API is still in development phase, therefore, this manual is subject to changes.
:::

Asynchronous notifications sent via POST by QI Tech to report status changes in the collateral (lien), contract, and debt lifecycle. The request must be answered within **5 seconds** with HTTP 200.

:::info Debt Webhooks
This section covers both **vehicle collateral** webhooks and standard **debt** webhooks. For the complete documentation of all debt-related webhooks, see: [Debt Webhooks](/documentation/webhooks/dividas).
:::

---

## Vehicle Collateral Webhooks — Reservation (SNG/B3)

WEBHOOK TYPE
laas.vehicle_collateral.reservation_status_change

Notifications related to **lien** registration at SNG/B3.

### Base Webhook Structure

```json
{
    "key": "<UUID v4 — unique webhook identifier>",
    "reservation_key": "<UUID — unique reservation identifier>",
    "credit_operation_key": "<UUID — credit operation identifier>",
    "status": "<status enumerator>",
    "webhook_type": "laas.vehicle_collateral.reservation_status_change",
    "event_datetime": "<ISO 8601 timestamp>",
    "data": {
        "contract_number": "<contract number>",
        "...": "<status-specific fields>"
    }
}
```

#### Base Fields

| Field | Type | Description |
|-------|------|-------------|
| key | String | Unique webhook identifier (UUID v4) |
| reservation_key | String | Unique reservation identifier (UUID) |
| credit_operation_key | String | Credit operation identifier (UUID) |
| status | String | Status enumerator (see [Status Map](/documentation/garantia_veicular/mapa_de_status)) |
| webhook_type | String | Always `laas.vehicle_collateral.reservation_status_change` |
| event_datetime | String | Event timestamp (ISO 8601) |
| data | Object | Status-specific payload (see examples below) |

---

### `pending_reservation_confirmation`

Collateral is being processed. Data has been sent to SNG/B3 and the system awaits confirmation.

**Payload**

```json
{
    "key": "1f975b68-7895-4c72-9d79-e73c7b0986b0",
    "reservation_key": "e73c7b68-4c72-9d79-7895-1f975b0986b0",
    "credit_operation_key": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "status": "pending_reservation_confirmation",
    "webhook_type": "laas.vehicle_collateral.reservation_status_change",
    "event_datetime": "2026-03-10T10:05:00Z",
    "data": {
        "contract_number": "123insd"
    }
}
```

---

### `reserved`

Collateral successfully reserved at SNG/B3. Lien is registered and the operation is ready for the next stage.

**Payload**

```json
{
    "key": "1f975b68-7895-4c72-9d79-e73c7b0986b0",
    "reservation_key": "e73c7b68-4c72-9d79-7895-1f975b0986b0",
    "credit_operation_key": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "status": "reserved",
    "webhook_type": "laas.vehicle_collateral.reservation_status_change",
    "event_datetime": "2026-03-10T10:10:00Z",
    "data": {
        "contract_number": "123insd",
        "collateral_number": "00123456",
        "reservation_date": "2026-03-10"
    }
}
```

---

### `pending_requester_action` (Reservation)

An error occurred during lien processing at SNG/B3. Invalid data or restriction detected. The partner must correct the information and resubmit.

**Payload**

```json
{
    "key": "1f975b68-7895-4c72-9d79-e73c7b0986b0",
    "reservation_key": "e73c7b68-4c72-9d79-7895-1f975b0986b0",
    "credit_operation_key": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "status": "pending_requester_action",
    "webhook_type": "laas.vehicle_collateral.reservation_status_change",
    "event_datetime": "2026-03-10T10:12:00Z",
    "data": {
        "contract_number": "123insd",
        "error_code": "INVALID_CHASSIS",
        "error_reason": "Chassis number does not match the vehicle records",
        "error_details": {
            "field": "chassis",
            "expected": "LISD931",
            "received": "LISD930"
        }
    }
}
```

---

### `deleted`

Collateral and contract have been cancelled. The operation was reverted at SNG/B3 and DETRAN.

**Payload**

```json
{
    "key": "1f975b68-7895-4c72-9d79-e73c7b0986b0",
    "reservation_key": "e73c7b68-4c72-9d79-7895-1f975b0986b0",
    "credit_operation_key": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "status": "deleted",
    "webhook_type": "laas.vehicle_collateral.reservation_status_change",
    "event_datetime": "2026-03-10T15:30:00Z",
    "data": {
        "contract_number": "123insd",
        "collateral_number": "00123456",
        "cancellation_date": "2026-03-10",
        "reason": "client_request"
    }
}
```

---

### Per-Status Data Fields (Reservation)

| Status | data Fields | Description |
|--------|-------------|-------------|
| `pending_reservation_confirmation` | `contract_number` | Lien sent to SNG/B3, awaiting confirmation |
| `reserved` | `contract_number`, `collateral_number`, `reservation_date` | Lien registered successfully |
| `pending_requester_action` | `contract_number`, `error_code`, `error_reason`, `error_details` | Error — partner must correct data |
| `deleted` | `contract_number`, `collateral_number`, `cancellation_date`, `reason` | Operation cancelled |

:::caution Attention
Image validation statuses are exclusively internal and are **not** sent to the external client via webhook.
:::

---

## Vehicle Collateral Webhooks — Registration (DETRAN)

WEBHOOK TYPE
laas.vehicle_collateral.register_status_change

Notifications related to **contract registration** at DETRAN/Registrar.

### Base Webhook Structure

```json
{
    "key": "<UUID v4 — unique webhook identifier>",
    "reservation_key": "<UUID — unique reservation identifier>",
    "credit_operation_key": "<UUID — credit operation identifier>",
    "status": "<status enumerator>",
    "webhook_type": "laas.vehicle_collateral.register_status_change",
    "event_datetime": "<ISO 8601 timestamp>",
    "data": {
        "contract_number": "<contract number>",
        "...": "<status-specific fields>"
    }
}
```

#### Base Fields

| Field | Type | Description |
|-------|------|-------------|
| key | String | Unique webhook identifier (UUID v4) |
| reservation_key | String | Unique reservation identifier (UUID) |
| credit_operation_key | String | Credit operation identifier (UUID) |
| status | String | Status enumerator (see [Status Map](/documentation/garantia_veicular/mapa_de_status)) |
| webhook_type | String | Always `laas.vehicle_collateral.register_status_change` |
| event_datetime | String | Event timestamp (ISO 8601) |
| data | Object | Status-specific payload (see examples below) |

---

### `pending_registration_confirmation`

Contract is being processed at DETRAN. Document has been sent and the system awaits validation.

**Payload**

```json
{
    "key": "1f975b68-7895-4c72-9d79-e73c7b0986b0",
    "reservation_key": "e73c7b68-4c72-9d79-7895-1f975b0986b0",
    "credit_operation_key": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "status": "pending_registration_confirmation",
    "webhook_type": "laas.vehicle_collateral.register_status_change",
    "event_datetime": "2026-03-10T10:15:00Z",
    "data": {
        "contract_number": "123insd",
        "stage": "contract_registration"
    }
}
```

---

### `registered`

Contract successfully registered at DETRAN. Full cycle completed. Collateral and contract are active and valid.

**Payload**

```json
{
    "key": "1f975b68-7895-4c72-9d79-e73c7b0986b0",
    "reservation_key": "e73c7b68-4c72-9d79-7895-1f975b0986b0",
    "credit_operation_key": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "status": "registered",
    "webhook_type": "laas.vehicle_collateral.register_status_change",
    "event_datetime": "2026-03-10T10:20:00Z",
    "data": {
        "contract_number": "123insd",
        "collateral_number": "00123456",
        "registration_date": "2026-03-10",
        "completion_timestamp": "2026-03-10T10:20:00Z"
    }
}
```

---

### `pending_requester_action` (Registration)

An error occurred during contract processing at DETRAN. Invalid data or counter window detected. The partner must correct the information and resubmit.

**Payload**

```json
{
    "key": "1f975b68-7895-4c72-9d79-e73c7b0986b0",
    "reservation_key": "e73c7b68-4c72-9d79-7895-1f975b0986b0",
    "credit_operation_key": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "status": "pending_requester_action",
    "webhook_type": "laas.vehicle_collateral.register_status_change",
    "event_datetime": "2026-03-10T10:22:00Z",
    "data": {
        "contract_number": "123insd",
        "error_code": "INVALID_CONTRACT_DATA",
        "error_reason": "Invalid contract data or DETRAN counter window",
        "error_details": {
            "stage": "contract_registration"
        }
    }
}
```

---

### Per-Status Data Fields (Registration)

| Status | data Fields | Description |
|--------|-------------|-------------|
| `pending_registration_confirmation` | `contract_number`, `stage` | Contract sent to DETRAN, awaiting validation |
| `registered` | `contract_number`, `collateral_number`, `registration_date`, `completion_timestamp` | Full cycle completed |
| `pending_requester_action` | `contract_number`, `error_code`, `error_reason`, `error_details` | Error — partner must correct data |

---

## Debt Webhooks

WEBHOOK TYPE
debt

The webhooks below notify about changes in the **debt** lifecycle associated with the vehicle collateral. These are the same standard debt webhooks documented at [Debt Webhooks](/documentation/webhooks/dividas).

---

### `waiting_signature`

Contract generated and available for signing. The signature URL is sent in this webhook.

**Payload**

```json
{
    "key": "<Debt Key>",
    "status": "waiting_signature",
    "webhook_type": "debt",
    "event_datetime": "2025-05-10 14:30:00",
    "data": {
        "borrower": {
            "name": "DEALERSHIP LEGAL NAME",
            "document_number": "12345678000199"
        },
        "contract": {
            "number": "OP-000000000000001",
            "urls": [
                "https://storage.googleapis.com/doc-api/documents/<uuid>/DEALERSHIP-CCB-OP000000000000001.pdf"
            ],
            "signature_information": [
                {
                    "signer_name": "REPRESENTATIVE NAME",
                    "signer_document_number": "31057466093",
                    "signer_role": "issuer",
                    "signer_email": "representative@dealership.com.br",
                    "signature_url": "https://sign.qitech.com.br/<uuid>"
                }
            ]
        }
    }
}
```

---

### `signature_finished`

All contract signatures have been completed.

**Payload**

```json
{
    "key": "<Debt Key>",
    "status": "signature_finished",
    "webhook_type": "debt",
    "event_datetime": "2025-05-10 15:00:00",
    "data": {
        "borrower": {
            "name": "DEALERSHIP LEGAL NAME",
            "document_number": "12345678000199"
        },
        "contract": {
            "number": "OP-000000000000001",
            "urls": [
                "https://storage.googleapis.com/doc-api/documents/<uuid>/DEALERSHIP-CCB-OP000000000000001-signed.pdf"
            ]
        }
    }
}
```

---

### `disbursed`

Disbursement completed successfully. Funds have been transferred to the designated account.

**Payload**

```json
{
    "key": "<Debt Key>",
    "status": "disbursed",
    "webhook_type": "debt",
    "event_datetime": "2025-05-10 16:00:00",
    "data": {
        "borrower": {
            "name": "DEALERSHIP LEGAL NAME",
            "document_number": "12345678000199"
        },
        "contract": {
            "number": "OP-000000000000001"
        },
        "disbursement_date": "2025-05-10"
    }
}
```

---

### `canceled`

Operation cancelled. If the operation is not signed or endorsed by the last disbursement date option, the partner receives this webhook notifying the cancellation.

**Payload**

```json
{
    "key": "<Debt Key>",
    "status": "canceled",
    "webhook_type": "debt",
    "event_datetime": "2025-05-20 10:00:00",
    "data": {
        "cancel_reason": "<CANCEL_REASON>",
        "cancel_reason_enumerator": "<CANCEL_REASON_ENUMERATOR>"
    }
}
```

#### Cancellation Enumerators

| Enumerator | Description |
|------------|-------------|
| requester_request | Cancelled at partner request |
| expiration | Operation expired |
| regulatory | Regulatory cancellation |
| duplicity | Duplicate operation |
| internal_error | Internal error |

---

### `settled`

Operation settled. All installments have been paid and the operation is closed.

**Payload**

```json
{
    "key": "<Debt Key>",
    "status": "settled",
    "webhook_type": "debt",
    "event_datetime": "2026-05-15 10:00:00",
    "data": {
        "borrower": {
            "name": "DEALERSHIP LEGAL NAME",
            "document_number": "12345678000199"
        },
        "contract": {
            "number": "OP-000000000000001"
        },
        "settlement_date": "2026-05-15"
    }
}
```

---

:::info Configuration
The Vehicle Collateral Webhook requires registered URLs. Consult the onboarding team for configuration.
:::

---

# Person contact change

URL: /en/documentation/gestao_de_usuarios/alteracao_de_contato_de_pessoa

## Request

### Token Request

ENDPOINT /baas/token_request
METHOD POST

Request Body

```json
{
  "contact_type": "email",
  "person_contact_update": {
    "person_key": "3ea7f034-f06b-4e28-ae19-7c23694f546b",
    "phone_number": {
      "country_code": "55",
      "area_code": "888",
      "number": "988887777"
    }
  },
  "agent_document_number": "99988877765"
}

```

### Token Validation

ENDPOINT /baas/movement_validation
METHOD POST

Request Body

```json
{
  "token": "123456",
  "person_contact_update": {
    "person_key": "3ea7f034-f06b-4e28-ae19-7c23694f546b",
    "phone_number": {
      "country_code": "55",
      "area_code": "888",
      "number": "988887777"
    }
  }
}

```

### Body Params

| Field | Type | Description | Characters |
|-------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| `contact_type` * | string | `(/baas/token_request)` Chosen method for sending the token. For SMS deliveries, only Brazilian numbers (+55) will receive the message. | "sms" |
| `token` * | string | `(/baas/token_validation)` Six-digit (6) code sent to the operation approver. E.g., "123456" | 6 |
| `person_contact_update` | Object | Contact update information | **[Object person_contact_update](#object-person_contact_update)** |
| `agent_document_number` | string | CPF of one of the account administrators who will receive the SMS for validation. E.g., "99977766654" | 11 |

### Object person_contact_update
| Field | Type | Description | Characters |
|----------------|--------|----------------------------------------------------------------------------------------------------|-------------------------------------------------|
| `person_key` * | string | Identification key of the individual. UUID v4 format. E.g., 1ed6dc4e-a0a8-42bb-8cc0-0bb3b0233fb9 | 36 |
| `phone_number` | Object | Object containing information on the new phone number | **[Object phone_number](#object-phone_number)** |
| `email` | string | New email to be registered | |

### Object phone_number
| Field | Type | Description | Characters |
|------------------|--------|-------------------------|------------|
| `country_code` * | string | Country code | 1-3 |
| `area_code` * | string | Phone area code | 1-3 |
| `number` * | string | Phone number | 10 |

:::info Implemented contact methods
The `contact_type` allowed for this operation is **sms** and **email**.
:::

:::info Modification limitations
To change the phone number, the contact method must be email, and to change the email, the contact method must be sms.
:::

:::info Number to receive token
The individual whose registration is being altered will receive the token.
:::

## Response

### Token Request

STATUS 200

Response Body

```json
{}
```

STATUS 400

Response Body: Contact type not implemented/expired

```json
{
  "title": "Bad Request",
  "description": "Contact type {contact_type} not allowed",
  "translation": "Forma de contato por {contact_type} não permitida",
  "code": "ACC000152",
  "additional_data": {}
}
```

STATUS 400

Response Body: Contact does not exist/invalid

```json
{
  "title": "Bad Request",
  "description": "Contact does not exist",
  "translation": "Contato nao existe",
  "code": "ACC000135",
  "additional_data": {}
}
```

### Token Validation

STATUS 200

Response Body

```json
{
  "hash": "8e11308086ea336edb113a6ff5746778",
  "return_response": {
    "email": "test.email@email.com",
    "person_key": "110b3ee3-cae2-44de-ba2c-494434d5cb18",
    "phone": [
      {
        "area_code": "11",
        "country_code": "55",
        "number": "988887777"
      }
    ]
  },
  "validation": true
}
```

STATUS 401

Response Body: Expired token

```json
{
  "title": "Unauthorized",
  "description": "Expired token",
  "translation": "Token Expirado",
  "code": "ACC000134",
  "additional_data": {}
}
```

STATUS 401

Response Body: Invalid token

```json
{
  "title": "Unauthorized",
  "description": "Invalid token",
  "translation": "Token Inválido",
  "code": "ACC000133",
  "additional_data": {}
}
```

---

# Linkage contact change

URL: /en/documentation/gestao_de_usuarios/alteracao_de_contato_de_vinculo

## Request

### Token Request

ENDPOINT /baas/token_request
METHOD POST

Request Body

```json
{
  "contact_type": "sms",
  "professional_data_contact_update": {
    "professional_data_key": "4ba8ff34-e07b-4ea8-ae59-8c23994f546b",
    "natural_person": "3ea7f034-f06b-4e28-ae19-7c23694f546b",
    "email": "sample@gmail.com",
    "phone_number": {
      "country_code": "55",
      "area_code": "888",
      "number": "988887777"
    }
  },
  "agent_document_number": "99988877765"
}

```

### Token Validation

ENDPOINT /baas/movement_validation
METHOD POST

Request Body

```json
{
  "token": "123456",
  "professional_data_contact_update": {
    "professional_data_key": "4ba8ff34-e07b-4ea8-ae59-8c23994f546b",
    "natural_person": "3ea7f034-f06b-4e28-ae19-7c23694f546b",
    "email": "sample@gmail.com",
    "phone_number": {
      "country_code": "55",
      "area_code": "888",
      "number": "988887777"
    }
  }
}

```

### Body Params

| Field | Type | Description | Characters |
|------------------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
| `contact_type` * | string | `(/baas/token_request)` Chosen method for sending the token. For SMS deliveries, only Brazilian numbers (+55) will receive the message. | "sms" |
| `token` * | string | `(/baas/token_validation)` Six-digit (6) code sent to the operation approver. E.g., "123456" | 6 |
| `professional_data_contact_update` | Object | Information on the professional link between an individual and a legal entity | **[Object professional_data_contact_update](#object-professional_data_contact_update)** |
| `agent_document_number` | string | CPF of one of the account administrators who will receive the SMS for validation. E.g., "99977766654" | 11 |

### Object professional_data_contact_update
| Field | Type | Description | Characters |
|---------------------------|--------|------------------------------------------------------------------------------------------------------|-------------------------------------------------|
| `natural_person` * | string | Identification key of the individual. UUID v4 format. E.g., 1ed6dc4e-a0a8-42bb-8cc0-0bb3b0233fb9 | 36 |
| `professional_data_key` * | string | Identification key of the legal entity. UUID v4 format. E.g., 1ed6dc4e-a0a8-42bb-8cc0-0bb3b0233fb9 | 36 |
| `phone_number` * | Object | Object containing information on the new phone number. | **[Object phone_number](#object-phone_number)** |
| `email` * | string | New email to be registered | |

### Object phone_number
| Field | Type | Description | Characters |
|------------------|--------|-------------------------|------------|
| `country_code` * | string | Country code | 1-3 |
| `area_code` * | string | Phone area code | 1-3 |
| `number` * | string | Phone number | 10 |

:::info Implemented contact methods
The `contact_type` allowed for this operation is **sms**.
:::

:::info Number to receive token
The individual whose registration is being altered will receive the token.
:::
## Response

### Token Request

STATUS 200

Response Body

```json
{}
```

STATUS 400

Response Body: Contact type not implemented/expired

```json
{
  "title": "Bad Request",
  "description": "Contact type {contact_type} not allowed",
  "translation": "Forma de contato por {contact_type} não permitida",
  "code": "ACC000152",
  "additional_data": {}
}
```

STATUS 400

Response Body: Contact does not exist/invalid

```json
{
  "title": "Bad Request",
  "description": "Contact does not exist",
  "translation": "Contato nao existe",
  "code": "ACC000135",
  "additional_data": {}
}
```

### Token Validation

STATUS 200

Response Body

```json
{
  "hash": "8e11308086ea336edb113a6ff5746778",
  "return_response": {
    "admission_date": "2023-06-13",
    "created_at": "2023-06-13T17:26:57",
    "email": "sampl1e@gmail.com",
    "final_beneficiary": null,
    "is_active": true,
    "legal_person_key": "b678ae5c-5797-4bd9-8a4c-9cbd1a0829a4",
    "natural_person_key": "1ed6dc4e-a0a8-42bb-8cc0-0bb3b0233fb9",
    "natural_person_roles": [
      {
        "created_at": "2023-06-13T17:26:57",
        "natural_person_roles_events": [],
        "product_type": {
          "created_at": "2022-04-08T14:51:34",
          "enumerator": "escrow"
        },
        "role_type": {
          "created_at": "2021-02-26T14:14:52",
          "enumerator": "viewer"
        },
        "updated_at": "2023-06-14T20:11:45"
      },
      {
        "created_at": "2023-06-13T17:26:57",
        "natural_person_roles_events": [],
        "product_type": {
          "created_at": "2021-02-26T14:16:35",
          "enumerator": "account"
        },
        "role_type": {
          "created_at": "2021-02-26T14:14:52",
          "enumerator": "viewer"
        },
        "updated_at": "2023-06-14T20:11:46"
      }
    ],
    "phone": {
      "area_code": "61",
      "country_code": "55",
      "number": "988887777",
      "phone_type": "commercial"
    },
    "post_type": {
      "created_at": "2019-02-15T18:28:12",
      "enumerator": "analyst",
      "translation_path": "onboarding.PostType.analyst"
    },
    "profession_data_key": "78c8b92f-4e44-4725-a5fd-aa1fca78366d",
    "updated_at": "2023-06-14T20:11:46"
  },
  "validation": true
}
```

STATUS 401

Response Body: Expired token

```json
{
  "title": "Unauthorized",
  "description": "Expired token",
  "translation": "Token Expirado",
  "code": "ACC000134",
  "additional_data": {}
}
```

STATUS 401

Response Body: Invalid token

```json
{
  "title": "Unauthorized",
  "description": "Invalid token",
  "translation": "Token Inválido",
  "code": "ACC000133",
  "additional_data": {}
}
```

---

# Edit a person's data

URL: /en/documentation/gestao_de_usuarios/alteracao_de_dados_pessoais

## Request

ENDPOINT /person/PERSON_KEY/personal_data
METHOD PATCH

### Path Params

| Field | Type | Description | Characters |
|-------------------------|------|-------------------------------|------------|
| `PERSON_KEY` * | UUID | Unique identifier of the person | 36 |

Request Body

```json
{
    "name": "Mateus da Silva",
    "date_of_birth": "1995-05-01",
    "profession": "programer",
    "mother_name": "Maria de Jesus",
    "father_name": "João dos Santos",
    "birth_place": "Taguatinga",
    "spouse_name": "Luis dos anjos",
    "is_pep": true,
    "revenue_amount": 100.52,
    "onboarding_key": "bc90744e-4f9a-42b1-9410-d5fa3c183fa8"
}

```

### BODY PARAMS

| Field | Type | Description | Characters |
|---|---| ---| ---|
| `name` | string | Full name | - |
| `date_of_birth` | string | Birth date, in the format YYYY-MM-DD | date |
| `profession` | string | Profession | - |
| `mother_name` | string | Mother's name | - |
| `father_name` | string | Father's name | - |
| `birth_place` | string | Place of birth | - |
| `spouse_name` | string | Spouse's name | - |
| `is_pep` | Boolean | Declaration if the person is a PEP (Politically Exposed Person) (http://www.portaldatransparencia.gov.br/download-de-dados/pep). | boolean |
| `revenue_amount` | number | Monthly income | - |
| `onboarding_key` | string | Key used for anti-fraud validation | uuidv4 |

## Response

STATUS 204

Response Body

```json
{}
```

STATUS 4XX

Response Body

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in Portuguese",
  "code": "codigo"
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title` | Description<br/>`description` | Translation<br/>`translation` |
|-------------|----------------------|--------------------|-------------------------------------------------------------------------|----------------------------------------------------------------------------------|
| 404 | OBD000019 | Not found | Person not found | Pessoa não encontrada. |
| 403 | OBD000073 | Unauthorized | User does not have permission to add or modify persons to this domain | Usuário não tem permissão para adicionar ou modificar pessoas a este domínio. |

---

# Edit a person's address

URL: /en/documentation/gestao_de_usuarios/alteracao_de_endereco

## Request

ENDPOINT /person/PERSON_KEY/address
METHOD PUT

### Path Params

| Field | Type | Description | Characters |
|-------------------------|------|-------------------------------|------------|
| `PERSON_KEY` * | UUID | Unique identifier of the person | 36 |

Request Body

```json
{
    "street": "Rua Sample after test",
    "complement": "Apto 125",
    "state": "MG",
    "number": "1234",
    "neighborhood": "Cabral",
    "postal_code": "38300000",
    "city": "Ituiutaba"
}

```

## Response

STATUS 204

Response Body

```json
{}
```

STATUS 4XX

Response Body

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo"
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title` | Description<br/>`description` | Translation<br/>`translation` |
|-------------|----------------------|--------------------|-------------------------------------------------------------------------|----------------------------------------------------------------------------------|
| 404 | OBD000019 | Not found | Person not found | Pessoa não encontrada. |
| 403 | OBD000073 | Unauthorized | User does not have permission to add or modify persons to this domain | Usuário não tem permissão para adicionar ou modificar pessoas a este domínio. |

---

# Check parties related to an account

URL: /en/documentation/gestao_de_usuarios/consulta_partes_relacionadas

## Request

ENDPOINT /account/ ACCOUNT_KEY /related_parties
METHOD GET

### PATH PARAMS

| Field | Type | Description |
|---|------|--------------------------------|
| `ACCOUNT_KEY` | uuidv4 | Unique identification key of the account |

## Response

STATUS 200

Response Body

```json
{
    "allowed_users": [
        {
            "natural_person_document_number": "49875468975",
            "natural_person_key": "69850ae3-28bc-4779-a871-e73e1e993412",
            "natural_person_name": "Gabriel Pomodoro",
            "professional_data_key": "3532ea7d-855b-4033-8e1c-7a28d4440d4a"
        },
        {
            "natural_person_document_number": "79857848695",
            "natural_person_key": "7f775i35-da9b-493b-8d43-c5c34282f6cb",
            "natural_person_name": "Fernando Teixeira",
            "professional_data_key": "fd6b4ta8-0c1a-481f-a046-6e0e6edcfb43"
        }
    ],
    "legal_person_key": "40e841e1-edc6-44f2-9a55-7f97eed1bef5",
    "owner_document_number": "10479846950100",
    "owner_name": "EMPRESA DE TESTE S.A"
}
```

### Body params

| Field | Type | Description |
|-------|---------------|----------------------------------------------|
| `allowed_users` | list | Object containing the users linked to the account. (**[Object allowed_users](#object-allowed_users)**) |
| `legal_person_key` | uuidv4 | Unique identification key of the account holder |
| `owner_document_number` | string | CNPJ number of the account holder. |
| `owner_name` | string | Corporate Name of the Account Holder. |

### Object allowed_users
| Field | Type | Description |
|-------|---------------|----------------------------------------------|
| `natural_person_document_number` | string | CPF number of the user linked to the account. |
| `natural_person_key` | uuidv4 | Unique identification key of the user linked to the account. |
| `natural_person_name` | string | Name of the user linked to the account. |
| `professional_data_key` | uuidv4 | Unique identification key of the link between the user and the legal entity account holder. |

---

# Person creation

URL: /en/documentation/gestao_de_usuarios/criacao_de_pessoa

## Request

### Token Request

ENDPOINT /baas/token_request
METHOD POST

Request Body

```json
{
    "contact_type": "sms",
    "person_creation": {
        "person": {
            "date_of_birth": "1987-01-11",
            "spouse_name": "sample spouse name",
            "birth_place": "sample birth place",
            "phone_number": {
                "country_code": "55",
                "area_code": "888",
                "number": "988887777"
            },
            "representative": null,
            "father_name": "sample father name",
            "address": {
                "street": "Rua Sample Avenue",
                "complement": "Apto 123",
                "state": "MG",
                "number": "1234",
                "neighborhood": "Cabral",
                "postal_code": "38300000",
                "city": "Ituiutaba"
            },
            "nationality": "Brasil",
            "document_identification_number": "sample identification number",
            "mother_name": "Sample Mama",
            "person_type": "natural",
            "name": "Sample Name Natural",
            "profession": "sample profession",
            "gender": null,
            "email": "sample@gmail.com",
            "document_number": "68346734500",
            "marital_status": null
        }
    },
	"agent_document_number": "99988877765"
    }

```

### Token Validation

ENDPOINT /baas/movement_validation
METHOD POST

Request Body

```json
{
    "token": "076244",
    "person_creation": {
        "person": {
            "date_of_birth": "1987-01-11",
            "spouse_name": "sample spouse name",
            "birth_place": "sample birth place",
            "phone_number": {
                "country_code": "55",
                "area_code": "888",
                "number": "988887777"
            },
            "representative": null,
            "father_name": "sample father name",
            "address": {
                "street": "Rua Sample Avenue",
                "complement": "Apto 123",
                "state": "MG",
                "number": "1234",
                "neighborhood": "Cabral",
                "postal_code": "38300000",
                "city": "Ituiutaba"
            },
            "nationality": "Brasil",
            "document_identification_number": "sample identification number",
            "mother_name": "Sample Mama",
            "person_type": "natural",
            "name": "Sample Name Natural",
            "profession": "sample profession",
            "gender": null,
            "email": "sample@gmail.com",
            "document_number": "68346734500",
            "marital_status": null
        }
    }
    }

```

### Body Params

| Field | Type | Description | Characters |
|---|---| ---| ---|
| `contact_type` * | string | `(/baas/token_request)` Chosen method for sending the token. For SMS deliveries, only Brazilian numbers (+55) will receive the message. | "sms" |
| `token` * | string | `(/baas/token_validation)` Six-digit (6) code sent to the operation approver. E.g., "123456" | 6 |
| `person_creation` | object | Contains an object with the information of the person to be registered | **[Object person_creation](#object-person_creation)** |
| `agent_document_number` | string | CPF of one of the account administrators who will receive the SMS for validation. E.g., "99977766654" | 11 |

### Object person_creation
| Field | Type | Description | Characters |
|---|---| ---| ---|
| `person` * | object | Information of the person to be registered. | **[Object person](#object-person)** |

### Object person
| Field | Type | Description | Characters |
|---| ---| ---| ---|
| `address` | object | Person's address. | **[Object address](#object-address)** |
| `date_of_birth` * | string | Date of birth of the person (format "YYYY-MM-DD") | |
| `document_identification_number` * | string | DOCUMENT_KEY of the person's photo ID document (RG or CNH) (previously sent) | |
| `email` * | string | Person's email. | |
| `document_number` * | string | Person's CPF (numbers only). Limited to 11 characters. | |
| `is_pep` * | string | Statement if the person is a PEP (Politically Exposed Person) (http://www.portaldatransparencia.gov.br/download-de-dados/pep).| |
| `mother_name` * | string | Mother's name of the person in case of an Individual. | 100 |
| `name` * | string | Corporate name in case of legal operations or Person's name in case of individual operations. | 100 |
| `nationality` * | string | Person's nationality. | 50 |
| `birth_place` * | string | Place of birth of the person. | 50 |
| `person_type` * | string | Identifier indicating whether the sent object is an individual or a legal entity.| "natural", "legal" |
| `phone_number` * | object | Object with phone details | **[Object phone](#object-phone)** |
| `proof_of_residence` | string | DOCUMENT_KEY of the PDF of the submitted address proof (previously sent).| |
| `spouse_name` | string | Spouse's name| |
| `father_name` | string | Father's name of the person in case of an Individual.| |
| `profession` | string | Person's profession in case of an Individual.| |

### Object address 

| Field | Description | Example | Max. Characters |
|---|---|---|---|
| `street` *| string | Street address | 100 |
| `state` *| string | State address (with two uppercase characters) | 2 |
| `city` *| string | City address | 100 |
| `neighborhood` *| string | Neighborhood address | 100 |
| `number` *| string | Street number | 10 |
| `postal_code` *| string | ZIP code (http://www.buscacep.correios.com.br/sistemas/buscacep/) (numbers only) | 8 |
| `complement` *| string | Address complement (free text) | 100 |

### Object phone

| Field | Description | Example | Max. Characters |
| --- | --- | --- | --- |
|`country_code` *| string | Phone country code (https://ddi.guiamais.com.br/) | 3 |
| `area_code` *| string | Phone area code (https://ddd.guiamais.com.br/) | 2 |
| `number` *| string | Phone number (numbers only) | 10 |

:::info Implemented contact methods
The `contact_type` allowed for this operation is **sms**.
:::

:::info Number to receive token
The person to be registered will receive the token.
:::

## Response

### Token Request

STATUS 200

Response Body

```json
{}
```

STATUS 400

Response Body: Contact type not implemented/expired

```json
{
	"title": "Bad Request",
	"description": "Contact type {contact_type} not allowed",
	"translation": "Forma de contato por {contact_type} não permitida",
	"code": "ACC000152",
	"additional_data": {}
}
```

STATUS 400

Response Body: Contact does not exist/invalid

```json
{
	"title": "Bad Request",
	"description": "Contact does not exist",
	"translation": "Contato nao existe",
	"code": "ACC000135",
	"additional_data": {}
}
```

### Token Validation

STATUS 200

Response Body

```json
{
	"hash": "bd707fdcb3f78abcab8b5c5b7459f9aa",
	"return_response": {
		"birth_place": "sample birth place",
		"created_at": "2023-06-14T20:51:32",
		"date_of_birth": "1987-01-11T00:00:00",
		"document_identification_number": "sample",
		"email": "sample@gmail.com",
		"father_name": "sample father name",
		"gender": null,
		"is_pep": false,
		"kc_key": "2eedef51-7638-4874-bb98-661080bdfbfd",
		"marital_status": null,
		"mother_name": "Sample Mama",
		"nationality": "Brasil",
		"natural_revenue_range": {
			"average_amount": null,
			"created_at": "2021-03-12T13:26:08",
			"description": "Unavailable",
			"description_ptbr": "Indisponível",
			"enumerator": "0",
			"more_than_amount": null,
			"up_to_amount": null
		},
		"person": {
			"address": {
				"city": "Ituiutaba",
				"complement": "Apto 123",
				"created_at": "2023-06-14T20:51:32",
				"neighborhood": "Cabral",
				"number": "1234",
				"postal_code": "38300000",
				"state": "MG",
				"street": "Rua Sample Avenue"
			},
			"category": null,
			"category_nick": null,
			"created_at": "2023-06-14T20:51:32",
			"document_number": "68346734500",
			"domain": {
				"created_at": "2022-06-29T19:35:17",
				"domain_key": "abc36183-9845-40b9-8a6d-3805b48057e1",
				"domain_name": "QI SCD Domain",
				"owner_person_key": "bf623fcf-6e03-42b7-8664-55141c8acddb"
			},
			"internal_contact": null,
			"internal_contact_person_key": null,
			"name": "Sample Name Natural",
			"person_category": null,
			"person_code": 1681,
			"person_key": "2eedef51-7638-4874-bb98-661080bdfbfd",
			"person_status": {
				"created_at": "2019-02-15T18:28:09",
				"enumerator": "pending",
				"translation_path": "onboarding.PersonStatus.pending"
			},
			"person_type": {
				"created_at": "2019-02-15T18:28:08",
				"enumerator": "natural",
				"translation_path": "onboarding.PersonType.natural"
			},
			"phone": [
				{
					"area_code": "888",
					"country_code": "55",
					"created_at": "2023-06-14T20:51:32",
					"number": "988887777",
					"phone_key": "9a39e3ce-e4fd-447a-9856-83df19989895",
					"phone_type": null
				}
			],
			"professional_data": [],
			"qualifications": [],
			"registration_date": "2023-06-14",
			"risk": null,
			"special_attention": false,
			"terms_acknowledgement": false,
			"valid_cip_beneficiary": false
		},
		"profession": "sample profession",
		"revenue_amount": null,
		"spouse_name": null
	},
	"validation": true
}
```

STATUS 401

Response Body: Expired token

```json
{
	"title": "Unauthorized",
	"description": "Expired token",
	"translation": "Token Expirado",
	"code": "ACC000134",
	"additional_data": {}
}
```

STATUS 401

Response Body: Invalid token

```json
{
	"title": "Unauthorized",
	"description": "Invalid token",
	"translation": "Token Inválido",
	"code": "ACC000133",
	"additional_data": {}
}
```

---

# Linkage exclusion

URL: /en/documentation/gestao_de_usuarios/exclusao_de_vinculo

## Request

### Token Request

ENDPOINT /baas/token_request
METHOD POST

Request Body

```json
{
	"contact_type":"sms",
	"professional_data_deletion":{
		"natural_person": "1ed6dc4e-a0a8-42bb-8cc0-0bb3b0233fb9",
		"legal_person": "b678ae5c-5797-4bd9-8a4c-9cbd1a0829a4"
	},
	"agent_document_number": "99988877765"
}

```

### Token Validation

ENDPOINT /baas/movement_validation
METHOD POST

Request Body

```json
{
	"token": "746116",
	"professional_data_deletion":{
		"natural_person": "1ed6dc4e-a0a8-42bb-8cc0-0bb3b0233fb9",
		"legal_person": "b678ae5c-5797-4bd9-8a4c-9cbd1a0829a4",
	}
}

```

### Body Params

| Field | Type | Description | Characters |
|---|---| ---| ---|
| `contact_type` * | string | `(/baas/token_request)` Chosen method for sending the token. For SMS deliveries, only Brazilian numbers (+55) will receive the message. | "sms" |
| `token` * | string | `(/baas/token_validation)` Six-digit (6) code sent to the operation approver. E.g., "123456" | 6 |
| `professional_data_deletion` | Object | Link between an individual and a legal entity to be removed | **[Object professional_data_deletion](#object-professional_data_deletion)** |
| `agent_document_number` | string | CPF of one of the account administrators who will receive the SMS for validation. E.g., "99977766654" | 11 |

### Object professional_data_deletion
| Field | Type | Description | Characters |
|---|---| ---| ---|
| `natural_person` * | string | Identification key of the individual. UUID v4 format. E.g., 1ed6dc4e-a0a8-42bb-8cc0-0bb3b0233fb9 | 36 |
| `legal_person` * | string | Identification key of the legal entity. UUID v4 format. E.g., 1ed6dc4e-a0a8-42bb-8cc0-0bb3b0233fb9 | 36 |

:::info Implemented contact methods
The `contact_type` allowed for this operation is **sms**.
:::

:::info Number to receive token
One of the individuals registered as **account administrator of the legal entity** to be linked will receive the token.
:::

## Response

### Token Request

STATUS 200

Response Body

```json
{}
```

STATUS 400

Response Body: Contact type not implemented/expired

```json
{
	"title": "Bad Request",
	"description": "Contact type {contact_type} not allowed",
	"translation": "Forma de contato por {contact_type} não permitida",
	"code": "ACC000152",
	"additional_data": {}
}
```

STATUS 400

Response Body: Contact does not exist/invalid

```json
{
	"title": "Bad Request",
	"description": "Contact does not exist",
	"translation": "Contato nao existe",
	"code": "ACC000135",
	"additional_data": {}
}
```

### Token Validation

STATUS 200

Response Body

```json
{
	"hash": "b6e2643b15493d8f604a3083a20f2476",
	"return_response": {
		"deleted": "OK",
		"legal_person": "b678ae5c-5797-4bd9-8a4c-9cbd1a0829a4",
		"natural_person": "1ed6dc4e-a0a8-42bb-8cc0-0bb3b0233fb9"
	},
	"validation": true
}
```

STATUS 401

Response Body: Expired token

```json
{
	"title": "Unauthorized",
	"description": "Expired token",
	"translation": "Token Expirado",
	"code": "ACC000134",
	"additional_data": {}
}
```

STATUS 401

Response Body: Invalid token

```json
{
	"title": "Unauthorized",
	"description": "Invalid token",
	"translation": "Token Inválido",
	"code": "ACC000133",
	"additional_data": {}
}
```

---

# Linkage inclusion

URL: /en/documentation/gestao_de_usuarios/inclusao_de_vinculo

## Request

### Token Request

ENDPOINT /baas/token_request
METHOD POST

Request Body

```json
{
	"contact_type":"sms",
	"professional_data_creation":{
	"natural_person": "1ed6dc4e-a0a8-42bb-8cc0-0bb3b0233fb9",
	"legal_person": "b678ae5c-5797-4bd9-8a4c-9cbd1a0829a4",
	"natural_person_roles": [
		{
			"product_type":"account",
			"role_type": "viewer"
		}
	],
	"post_type":"analyst"
	},
	"agent_document_number": "99988877765"
}

```

### Token Validation

ENDPOINT /baas/movement_validation
METHOD POST

Request Body

```json
{
	"token": "746116",
	"professional_data_creation":{
	"natural_person": "1ed6dc4e-a0a8-42bb-8cc0-0bb3b0233fb9",
	"legal_person": "b678ae5c-5797-4bd9-8a4c-9cbd1a0829a4",
	"natural_person_roles": [
		{
			"product_type":"account",
			"role_type": "viewer"
		}
	],
	"post_type":"analyst"
	}
}

```

### Body Params

| Field | Type | Description | Characters |
|---|---| ---| ---|
| `contact_type` * | string | `(/baas/token_request)` Chosen method for sending the token. For SMS deliveries, only Brazilian numbers (+55) will receive the message. | "sms" |
| `token` * | string | `(/baas/token_validation)` Six-digit (6) code sent to the operation approver. E.g., "123456" | 6 |
| `professional_data_creation` | Object | Information on the professional link between an individual and a legal entity | **[Object professional_data_creation](#object-professional_data_creation)** |
| `agent_document_number` | string | CPF of one of the account administrators who will receive the SMS for validation. E.g., "99977766654" | 11 |

### Object professional_data_creation

| Field | Type | Description | Characters |
|---|---| ---| ---|
| `natural_person` * | string | Identification key of the individual. UUID v4 format. E.g., 1ed6dc4e-a0a8-42bb-8cc0-0bb3b0233fb9 | 36 |
| `legal_person` * | string | Identification key of the legal entity. UUID v4 format. E.g., 1ed6dc4e-a0a8-42bb-8cc0-0bb3b0233fb9 | 36 |
| `natural_person_roles` * | array | Permission and product information. | Array of **[Object natural_person_roles](#object-natural_person_roles)** |
| `post_type` * | string | Account number. | "ceo", "analyst", "partner", "director", "attorney", "signer" |

### Object natural_person_role
| Field | Type | Description | Characters |
|---|---| ---| ---|
| `product_type` * | string | Type of product for which permission is to be given. | "account", "escrow" |
| `role_type` * | string | Type of permission to be given to the product. | "administrator", "requester", "viewer" |

:::info Implemented contact methods
The `contact_type` allowed for this operation is **sms**.
:::

:::info Number to receive token
One of the individuals registered as **account administrator of the legal entity** to be linked will receive the token.
:::

## Response

### Token Request

STATUS 200

Response Body

```json
{}
```

STATUS 400

Response Body: Contact type not implemented/expired

```json
{
	"title": "Bad Request",
	"description": "Contact type {contact_type} not allowed",
	"translation": "Forma de contato por {contact_type} não permitida",
	"code": "ACC000152",
	"additional_data": {}
}
```

STATUS 400

Response Body: Contact does not exist/invalid

```json
{
	"title": "Bad Request",
	"description": "Contact does not exist",
	"translation": "Contato nao existe",
	"code": "ACC000135",
	"additional_data": {}
}
```

### Token Validation

STATUS 200

Response Body

```json
{
	"hash": "c5ad79fc14d8447ae272c671fe6dc27e",
	"return_response": {
		"admission_date": "2023-06-13",
		"created_at": "2023-06-13T17:26:57",
		"email": null,
		"final_beneficiary": null,
		"is_active": true,
		"legal_person_key": "b678ae5c-5797-4bd9-8a4c-9cbd1a0829a4",
		"natural_person_key": "1ed6dc4e-a0a8-42bb-8cc0-0bb3b0233fb9",
		"natural_person_roles": [
			{
				"created_at": "2023-06-13T17:26:57",
				"natural_person_roles_events": [],
				"product_type": {
					"created_at": "2022-04-08T14:51:34",
					"enumerator": "escrow"
				},
				"role_type": {
					"created_at": "2021-02-26T14:14:52",
					"enumerator": "viewer"
				},
				"updated_at": "2023-06-13T18:24:35"
			},
			{
				"created_at": "2023-06-13T17:26:57",
				"natural_person_roles_events": [],
				"product_type": {
					"created_at": "2021-02-26T14:16:35",
					"enumerator": "account"
				},
				"role_type": {
					"created_at": "2021-02-26T14:14:52",
					"enumerator": "viewer"
				},
				"updated_at": "2023-06-13T18:24:35"
			}
		],
		"phone": null,
		"post_type": {
			"created_at": "2019-02-15T18:28:12",
			"enumerator": "analyst",
			"translation_path": "onboarding.PostType.analyst"
		},
		"profession_data_key": "78c8b92f-4e44-4725-a5fd-aa1fca78366d",
		"updated_at": "2023-06-13T18:24:35"
	},
	"validation": true
}
```

STATUS 401

Response Body: Expired token

```json
{
	"title": "Unauthorized",
	"description": "Expired token",
	"translation": "Token Expirado",
	"code": "ACC000134",
	"additional_data": {}
}
```

STATUS 401

Response Body: Invalid token

```json
{
	"title": "Unauthorized",
	"description": "Invalid token",
	"translation": "Token Inválido",
	"code": "ACC000133",
	"additional_data": {}
}
```

---

# Introduction

URL: /en/documentation/gestao_de_usuarios/tfa_introducao

The Two-Factor Authorization system, hereinafter referred to as tfa, aims to ensure authorization via a token sent to the person responsible for approving the change or inclusion of a record.

## Token Request

ENDPOINT /baas/token_request
METHOD POST

To request a token, it is necessary to make a request with the contact method for sending the token and a specific object for the type of operation to be performed. The complete explanation of the payload to be sent for each operation is detailed on its own **[page](#operations)**.
All sent payloads follow the same basic format below:

```json
{
	"contact_type":"sms",
	"\<nome_do_objeto_da_operação\>":"\<objeto_da_operação\>"
}
```
:::info Notice
`contact_type` implementations can vary from operation to operation.
:::

:::warning Notice
The `token` generated in the **Sandbox** environment will always be **329329**
:::

## Token validation

ENDPOINT /baas/movement_validation
METHOD POST

To complete the operation, it is necessary to send the received token in the payload, along with the **same** `operation_object` sent in the token request.

All sent payloads follow the same basic format below:
```json
{
	"token":"123456",
	"\<nome_do_objeto_da_operação\>":"\<objeto_da_operação\>"
}
```

:::info Attention
The token sent is valid for 120 seconds from its generation
::: 

## Operations

- **[Person creation](/documentation/gestao_de_usuarios/criacao_de_pessoa)**
- **[Linkage inclusion](/documentation/gestao_de_usuarios/inclusao_de_vinculo)**
- **[Linkage exclusion](/documentation/gestao_de_usuarios/exclusao_de_vinculo)**
- **[Linkage contact change](/documentation/gestao_de_usuarios/alteracao_de_contato_de_vinculo)**

---

# Consulta Offline de Saldo

URL: /en/documentation/guides/INSS/inquiries/offline-balance-request

Consulta Offline de Saldo

Consulta os dados de saldo mais recentes salvos no nosso banco, de forma instantânea.

:::tip Vantagens Técnicas
- **Retorno síncrono** — sem fila de processamento ou espera por webhook;
- **Acesso a benefícios bloqueados** — retorna os últimos dados salvos no sistema, mesmo que o benefício esteja bloqueado;
- **Consulta em cache** — independe da disponibilidade da Dataprev e não gera consumo de chamadas.
:::

Request

ENDPOINT /social_security/balance_request/offline
MÉTODO GET

Query Params

document_number
string
obrigatório
CPF do beneficiário (apenas números, 11 dígitos).

benefit_number
string
obrigatório
Número do benefício INSS.

**Python**

```python title="ENDPOINT"
GET /social_security/balance_request/offline?document_number=14950479032&benefit_number=22255220
```

**curl**

```bash title="ENDPOINT"
curl -X GET \
  'https://api-auth.sandbox.qitech.app/social_security/balance_request/offline?document_number=14950479032&benefit_number=22255220' \
  -H 'AUTHORIZATION: eyJhbGciOiJFUzUxMiJ9.eyJwYXlsb2FkX21kNSI6...' \
  -H 'API-CLIENT-KEY: YOUR_API_CLIENT_KEY' \
  -H 'Content-Type: application/json'
```

Response

STATUS 200

Atributos

last_successful_balance_request
object | null
Última consulta bem-sucedida. `null` se nunca houve sucesso.

**Atributos de last_successful_balance_request**

consulted_at
string
Data e hora da consulta (ISO 8601).

data
object
Dados completos de saldo do benefício. Mesma estrutura do [webhook de consulta de saldo](/documentation/roteiros_laas/webhooks_inss). Veja [detalhamento dos campos](#campos-de-data).
**Atributos de data**

name
string
Nome do beneficiário.

document_number
string
CPF do beneficiário.

benefit_number
string
Status do benefício (`elegible`, `inelegible`).

block_type
string
Tipo de bloqueio (`not_blocked`, `blocked_by_tbm`, etc.).

benefit_situation
string
Situação do benefício (`active`, `inactive`, etc.).

assistance_type
string
Tipo de assistência/aposentadoria.

available_total_balance
number
Margem total disponível para consignação.

consigned_credit
object
Saldo de crédito consignado (`balance`).

payroll_card
object
Cartão consignado (`balance`, `limit`).

benefit_card
object
Cartão benefício (`balance`, `limit`).

number_of_active_reservations
integer
Número de reservas ativas.

disbursement_bank_account
object
Dados da conta bancária de desembolso (`bank_code`, `account_digit`, `account_branch`, `account_number`).

last_blocked_status
object | null
Status de bloqueio mais recente. `null` se não há informação disponível. Derivado automaticamente da fonte **mais recente** — seja consulta de saldo, tentativa de reserva ou verificação do benefício.

**Atributos de last_blocked_status**

consulted_at
string
Data e hora da verificação mais recente (ISO 8601).

status
string
`"blocked"` ou `"unblocked"`.

:::info
Ao menos um dos dois campos será preenchido em uma resposta 200. Caso não exista nenhum dado para a combinação informada, o endpoint retorna 404.
:::

```json title="RESPONSE BODY"
{
    "last_successful_balance_request": {
        "consulted_at": "2025-01-15T14:32:10-03:00",
        "data": {
            "name": "NOME BENEFICIARIO",
            "state": "RS",
            "alimony": "not_payer",
            "birth_date": "18021978",
            "block_type": "not_blocked",
            "grant_date": "2006-05-22",
            "credit_type": "checking_account",
            "benefit_card": {
                "limit": 2259.20,
                "balance": 0
            },
            "benefit_number": "22255220",
            "benefit_status": "elegible",
            "payroll_card": {
                "limit": 2259.20,
                "balance": 0
            },
            "assistance_type": "retirement_invalidity_social_security",
            "document_number": "14950479032",
            "benefit_end_date": null,
            "consigned_credit": {
                "balance": 0
            },
            "benefit_situation": "active",
            "last_inquiry_date": "2018-06-18",
            "max_total_balance": 635.40,
            "used_total_balance": 635.40,
            "politically_exposed": {
                "type": "not_politically_exposed",
                "is_politically_exposed": false
            },
            "has_power_of_attorney": false,
            "available_total_balance": 0,
            "has_judicial_concession": false,
            "number_of_portabilities": 0,
            "disbursement_bank_account": {
                "bank_code": "748",
                "account_digit": "4",
                "account_branch": "0155",
                "account_number": "000070963"
            },
            "has_entity_representation": false,
            "social_benefit_max_balance": 635.40,
            "social_benefit_used_balance": 635.40,
            "benefit_quota_expiration_date": null,
            "number_of_active_reservations": 3,
            "number_of_suspended_reservations": 0,
            "number_of_refinanced_reservations": 0,
            "number_of_active_suspended_reservations": 3
        }
    },
    "last_blocked_status": {
        "consulted_at": "2025-01-15T14:32:10-03:00",
        "status": "unblocked"
    }
}
```

### Cenários de resposta

| Cenário | `last_successful_balance_request` | `last_blocked_status.status` |
|---------|-----------------------------------|------------------------------|
| Apenas consultas com sucesso | Dados da última consulta | `"unblocked"` |
| Apenas consultas com bloqueio | `null` | `"blocked"` |
| Consulta com sucesso seguida de bloqueio posterior | Dados da última consulta | `"blocked"` |
| Bloqueio seguido de consulta com sucesso | Dados da última consulta | `"unblocked"` |

---

## Erros

| Código HTTP | Código QI | Descrição |
|-------------|-----------|-----------|
| 401/403 | (padrão) | Headers de autenticação ausentes ou inválidos |
| 404 | `SSC000101` | Nenhum dado encontrado para a combinação de `document_number` + `benefit_number` |

**Exemplo de resposta 404**

```json
{
    "title": "Offline Balance Not Found",
    "description": "No balance data found for document_number {document_number} and benefit_number {benefit_number}.",
    "translation": "Nenhum dado de saldo encontrado para document_number {document_number} e benefit_number {benefit_number}",
    "code": "SSC000101"
}
```

---

# INSS Payroll Loans

URL: /en/documentation/guides/INSS/intro

Integration guides for payroll loan operations for INSS beneficiaries.

## Operations

### New Credit and Pure Refinancing

- **[End-to-End Flow](/documentation/guides/INSS/new-credit-and-refinancing/end-to-end)** — Step-by-step guide for a new credit or pure refinancing operation, from reservation to settlement.
- **[Recalculation](/documentation/guides/INSS/new-credit-and-refinancing/recalculate)** — How to recalculate installments and rates for an existing operation.

### Portability + Refinancing

- **[End-to-End Flow](/documentation/guides/INSS/portability+refinancing/end-to-end)** — Step-by-step guide for portability with refinancing, including debt inquiry and endorsement.

## Inquiries

- **[Offline Balance Request](/documentation/guides/INSS/inquiries/offline-balance-request)** — Asynchronous balance and margin inquiry for the beneficiary with INSS.

## Reservations

- **[Priority Queue](/documentation/guides/INSS/reservations/priority-reservation)** — Marks a reservation as `fixed_rate` for priority processing.
- **[Priority Request](/documentation/guides/INSS/reservations/priority-request)** — Synchronous request with token bucket for immediate processing.

## Signatures

- **[Batch Signature](/documentation/guides/INSS/signatures/batch-signature)** — Groups multiple operations into a single signature envelope in QI Sign.

---

# Mocks (Sandbox)

URL: /en/documentation/guides/INSS/mocks-sandbox

Mocks (Sandbox)

:::danger Aviso Importante!
Não utilize dados pessoais reais (CPF, CNPJ etc.) em ambiente sandbox.
:::

A `social-security-api` intercepta as chamadas à Dataprev em ambiente sandbox/dev e retorna respostas mockadas via [`dataprev_mocker.py`](https://gitlab.qitech.com.br/qilaas/social-security-api/-/blob/master/src/connectors/dataprev_mocker.py). Cada etapa da jornada tem sua própria chave de simulação:

| Etapa | O que decide o cenário |
|---|---|
| [Consulta de saldo/margem](#consulta-de-saldo) | CPF — match exato ou **primeiro dígito** |
| [Averbação da reserva](#averbacao) | **Primeiro dígito** do CPF |
| [Anuência (`pending_confirmation`)](#anuencia) | **Último dígito** do número do benefício |

:::tip Jornada completa em sandbox
Para que a operação percorra a jornada inteira até o desembolso, o CPF e o número do benefício precisam cair, ao mesmo tempo, num cenário de sucesso de **saldo**, de **averbação** e de **anuência**. Combinação recomendada: CPF iniciado em `1` e benefício terminado em `0`.
:::

## Consulta de saldo {#consulta-de-saldo}

A consulta de saldo/margem (`DataprevMocker.get_balance_mocker`) resolve o `document_number` em duas etapas:

1. Tenta um **match exato** do CPF contra a massa de teste.
2. Se não encontrar, usa o **primeiro dígito** do CPF como chave.

Se nenhuma das duas resolver, retorna o erro fixo:

```json
{
    "erros": [
        {
            "codigo": "QIE",
            "mensagem": "CPF divergente da massa de teste informada na documentação."
        }
    ]
}
```

com HTTP `412`.

### Cenários por primeiro dígito (fallback)

Qualquer CPF de teste cujo primeiro dígito seja um dos abaixo cai num destes cenários genéricos — útil quando você não precisa de um CPF fixo:

| 1º dígito | Cenário | `margemDisponivel` | Status |
|---|---|---|---|
| `1` | Margem completa, elegível, sem bloqueios | 431.3 | 200 |
| `2` | Erro Dataprev `D1` — dados do benefício incompletos/inconsistentes/nulos | — | 412 |
| `3` | Margem de cartão/RCC reduzida (R$ 75,90) | 431.3 | 200 |
| `4` | Margem completa (idêntico ao dígito `1`) | 431.3 | 200 |
| `8` | Margem de cartão/RCC zerada | 431.3 | 200 |

CPFs com primeiro dígito `0`, `5`, `6`, `7` ou `9` (e que não tenham match exato) caem no erro `QIE` acima.

Além desses, o mocker reconhece 42 CPFs com match exato — a tabela completa está abaixo.

### CPFs com match exato

Campos já mapeados para o schema público da QI: `consigned_credit.balance` vem de `margemDisponivel`, `available_total_balance` vem de `valorDisponivelAverbacaoEmprestimo`. Boa parte dos CPFs com `retirement_invalidity_work_accident` existe só pra cobrir uma faixa de valores de `available_total_balance` (de R$ 50 a R$ 900) — útil pra testar simulação de dívida contra um teto de margem específico.

| CPF | Benefício (código) | Elegível | Situação | Bloqueio | `consigned_credit.balance` | `available_total_balance` | Status |
|---|---|---|---|---|---|---|---|
| `18166261553` | retirement_by_contribution_time (42) — **margem negativa** | Sim | ATIVO | - | **-7.84** | **-7.84** | 200 |
| `30449750345` | pension_by_death_statute (22) | Não | INATIVO | Bloqueado por TBM | 1000 | 0 | 200 |
| `58992386400` | pension_by_death_statute (22) | Não | ATIVO | Bloqueado por TBM | 1000 | 0 | 200 |
| `15588881010` | retirement_capin_extra_emploee (37) | Sim | ATIVO | - | 1000 | 200 | 200 |
| `80436724154` | retirement_invalidity_work_accident (92) | Não | INATIVO | Bloqueado por TBM | 1000 | 5000 | 200 |
| `34166302540` | pension_by_death_federal_emploee (27) | Não | ATIVO | Bloqueado por TBM | 1000 | 5000 | 200 |
| `71020884851` | pension_by_death_diplomat (20) | Não | ATIVO | Bloqueado por TBM | 1000 | 5000 | 200 |
| `76241089684` | retirement_invalidity_work_accident (92) | Não | ATIVO | Bloqueado por TBM | 1000 | 5000 | 200 |
| `44559483922` | pension_by_death (21) | Não | ATIVO | Bloqueado por TBM | 1000 | 5000 | 200 |
| `14429281238` | pension_by_death_statute (22) | Sim | ATIVO | - | 1000 | 300 | 200 |
| `15843101037` | retirement_by_contribution_time (42) | Sim | ATIVO | - | 1000 | 2000 | 200 |
| `13686315092` | retirement_by_contribution_time (42) | Sim | ATIVO | - | 1000 | 2000 | 200 |
| `14937159097` | retirement_by_contribution_time (42) | Sim | ATIVO | - | 1000 | 50 | 200 |
| `15986213009` | retirement_by_contribution_time (42) | Sim | ATIVO | - | 1000 | 1000 | 200 |
| `17427272048` | retirement_by_age (41) | Sim | ATIVO | - | 1000 | 1600 | 200 |
| `16110575070` | retirement_by_age (41) | Sim | ATIVO | - | 1000 | 2000 | 200 |
| `14996024054` | retirement_invalidity_work_accident (92) | Sim | ATIVO | - | 1000 | 100 | 200 |
| `17702273003` | retirement_invalidity_work_accident (92) | Sim | ATIVO | - | 1000 | 150 | 200 |
| `12228342009` | retirement_invalidity_work_accident (92) | Sim | ATIVO | - | 1000 | 200 | 200 |
| `11709160071` | retirement_invalidity_work_accident (92) | Sim | ATIVO | - | 1000 | 250 | 200 |
| `12452312002` | retirement_invalidity_work_accident (92) | Sim | ATIVO | - | 1000 | 300 | 200 |
| `10650137019` | retirement_invalidity_work_accident (92) | Sim | ATIVO | - | 1000 | 350 | 200 |
| `17287554097` | retirement_invalidity_work_accident (92) | Sim | ATIVO | - | 1000 | 400 | 200 |
| `19815793039` | retirement_invalidity_work_accident (92) | Sim | ATIVO | - | 1000 | 450 | 200 |
| `11985375079` | retirement_invalidity_work_accident (92) | Sim | ATIVO | - | 1000 | 500 | 200 |
| `14732376029` | retirement_invalidity_work_accident (92) | Sim | ATIVO | - | 1000 | 750 | 200 |
| `10178596043` | retirement_invalidity_work_accident (92) | Sim | ATIVO | - | 1000 | 600 | 200 |
| `17859801060` | retirement_invalidity_work_accident (92) | Sim | ATIVO | - | 1000 | 650 | 200 |
| `11524380857` | retirement_invalidity_work_accident (92) | Sim | ATIVO | - | 1000 | 700 | 200 |
| `19447847056` | retirement_invalidity_work_accident (92) | Sim | ATIVO | - | 1000 | 800 | 200 |
| `10813389038` | retirement_invalidity_work_accident (92) | Sim | ATIVO | - | 1000 | 850 | 200 |
| `35776131499` | retirement_invalidity_work_accident (92) | Sim | ATIVO | - | 1000 | 900 | 200 |
| `17283313079` | retirement_by_contribution_time (42) | Sim | ATIVO | - | 1000 | 300 | 200 |
| `14552515004` | retirement_by_age (41) | Sim | ATIVO | - | 1000 | 300 | 200 |
| `14036419005` | retirement_invalidity_social_security (32) | Sim | ATIVO | - | 1000 | 300 | 200 |
| `13423241020` | retirement_by_contribution_time (42) | Sim | ATIVO | - | 1000 | 200 | 200 |
| `12382929090` | retirement_special (46) | Sim | ATIVO | - | 1000 | 200 | 200 |
| `73527133011` | retirement_by_contribution_time (42) | Sim | ATIVO | - | 1000 | 300 | 200 |
| `55111830081` | retirement_by_contribution_time (42) | Sim | ATIVO | - | 1000 | 300 | 200 |
| `83995332030` | retirement_by_contribution_time (42) | Sim | ATIVO | - | 1000 | 300 | 200 |
| `65954790019` | retirement_by_contribution_time (42) | Sim | ATIVO | - | 1000 | 300 | 200 |
| `16257311080` | retirement_by_contribution_time (42) | Sim | ATIVO | - | 1000 | 300 | 200 |

Todos os CPFs acima retornam `bloqueadoParaEmprestimo: false`, exceto os marcados com "Bloqueado por TBM" na coluna Bloqueio (que ainda assim respondem HTTP 200 com `elegivelEmprestimo: false`).

**Exemplo de requisição** (funciona com qualquer CPF da tabela):

ENDPOINT /social_security/balance_request/synchronous
MÉTODO POST

```python title="ENDPOINT"
POST /social_security/balance_request/synchronous
{
    "document_number": "18166261553",
    "benefit_number": "2052711150"
}
```

Resposta (HTTP 200) para o CPF de margem negativa, já mapeada para o schema público:

```json
{
    "assistance_type": "retirement_by_contribution_time",
    "available_total_balance": -7.84,
    "consigned_credit": {
        "balance": -7.84
    },
    "payroll_card": {
        "balance": 0,
        "limit": 2083.2
    },
    "benefit_card": {
        "balance": 0,
        "limit": 2083.2
    },
    "block_type": "not_blocked",
    "benefit_situation": "active"
}
```

## Averbação {#averbacao}

O envio da reserva à Dataprev (`DataprevMocker.send_reserve_balance`) é resolvido **apenas pelo primeiro dígito do CPF** — o número do benefício não influencia esta etapa:

| 1º dígito do CPF | Retorno mockado | Status |
|---|---|---|
| `1` | Sucesso `BZ` — "Averbação registrada" | 200 |
| `2` | Erro `AN` — "Conta corrente/DV do favorecido inválidos" | 412 |
| `3` | Depende do valor da operação: até R$ 1.000,00 sucesso `BZ`; acima disso, erro `HW` — "Margem consignável excedida" | 200 / 412 |
| `4` | Sucesso `BZ` — "Averbação registrada" | 200 |

Qualquer outro primeiro dígito retorna o erro `QIE` ("CPF divergente da massa de teste informada na documentação"), com HTTP `412`.

:::note
Averbação bem-sucedida **não** conclui a reserva: em crédito novo e refinanciamento ela entra em [anuência](#anuencia). Portabilidade não exige anuência e segue direto para `reserved`.
:::

## Anuência {#anuencia}

Depois da averbação, crédito novo e refinanciamento ficam em `pending_confirmation` até a Dataprev informar a confirmação do beneficiário — veja [Anuência (pending confirmation)](/documentation/guides/INSS/pending_confirmation) para o fluxo e os webhooks.

Em sandbox, a resposta dessa consulta é determinada pelo **último dígito do número do benefício** informado na reserva:

| Último dígito do benefício | Situação Dataprev simulada | Desfecho da reserva |
|---|---|---|
| `0`, `1`, `6` | 0 — Ativo | ✅ Confirmada → `reserved`, webhook de averbação e desembolso |
| `5` | 5 — Averbação programada | ✅ Confirmada → `reserved` |
| `3` | 18 na 1ª página, 0 na 2ª | ✅ Confirmada → `reserved` (exercita a paginação) |
| `8` | 18 — Pendente de confirmação | ⏳ Permanece em `pending_confirmation` |
| `9` | 19 — Não confirmado pelo beneficiário | ❌ Cancelada — `social_security_confirmation_denied_by_beneficiary` |
| `7` | 20 — Confirmação expirada | ❌ Nova tentativa de reserva ou cancelamento — `social_security_confirmation_expired` |
| `2` | Resposta sem registros | ⏳ Permanece em `pending_confirmation` |
| `4` | Erro `GR` — "O período está inválido" | ⏳ Permanece em `pending_confirmation` |

:::warning Benefícios terminados em `2` e `4`
Nesses dois cenários a consulta nunca devolve uma situação conclusiva, então a reserva fica em `pending_confirmation` indefinidamente e os webhooks de averbação e de pagamento não são emitidos. Se o objetivo é testar a jornada completa, use um benefício terminado em `0`, `1`, `3`, `5` ou `6`.
:::

## Referências

- [`dataprev_mocker.py`](https://gitlab.qitech.com.br/qilaas/social-security-api/-/blob/master/src/connectors/dataprev_mocker.py) — massa de teste completa
- [Consulta Offline de Saldo](/documentation/guides/INSS/inquiries/offline-balance-request) — schema de resposta completo

---

# Manual INSS - Crédito Novo ou Refinanciamento

URL: /en/documentation/guides/INSS/new-credit-and-refinancing/end-to-end

:::danger Atenção!
Os webhooks da QI Tech não devem ser mapeadas de forma restrita. 
Campos adicionais podem ser incluídos aos payloads dos webhooks retornados em nossas APIs.
:::

:::info Reenvio de Webhooks
Você pode consultar e reenviar webhooks seguindo as instruções detalhadas na documentação: [Reenvio de Webhooks](/documentation/notificacoes/reenvio_de_notificacoes).
:::

## 1 - Consulta da lista de benefícios com formalização do Termo de Autorização realizada através do parceiro:

### Request

Caso 1: Titular do benefício é o assinante do Termo de Autorização.

ENDPOINT /social_security/benefits_request
METHOD POST

Request Body

```json
{
	"document_number": "\<CPF BENEFICIÁRIO\>",
	"authorization_term": {
		"document_number": "\<CPF BENEFICIÁRIO\>", 
		"signature": {
			"signer": {
				"name": "\<NOME BENEFICIÁRIO OU RESPONSÁVEL LEGAL\>",
				"email": "\<EMAIL ASSINANTE\>",
				"phone": {
					"number": "\<NUMERO ASSINANTE\>",
					"area_code": "\<DDD ASSINANTE\>",
					"country_code": "55"
				},
				"document_number": "\<CPF ASSINANTE\>"
			},
			"authentication_type": "opt_in",
			"authenticity": {
				"timestamp": "\<DATA E HORA DA ASSINATURA\>",
				"ip_address": "\<IP DO ASSINANTE\>",
				"fingerprint": {},
				"third_party_additional_data": {},
				"session_id": "\<ID DA SESSÃO DO ASSINANTE\>"
			},
			"signed_object": {
				"document_key": "\<CHAVE DO DOCUMENTO NA QI\>"
			}
		}
	}
}
```

Caso 2: Titular do benefício não é o assinante do Termo de Autorização (com representante legal).

ENDPOINT /social_security/benefits_request
METHOD POST

Request Body

```json
{
	"document_number": "\<CPF BENEFICIÁRIO\>",
	"authorization_term": {
		"document_number": "\<CPF BENEFICIÁRIO\>",
		"legal_representative_document_number": "\<CPF DO ASSINANTE\>",
		"signature": {
			"signer": {
				"name": "\<NOME BENEFICIÁRIO OU RESPONSÁVEL LEGAL\>",
				"email": "\<EMAIL ASSINANTE\>",
				"phone": {
					"number": "\<NUMERO ASSINANTE\>",
					"area_code": "\<DDD ASSINANTE\>",
					"country_code": "55"
				},
				"document_number": "\<CPF ASSINANTE\>"
			},
			"authentication_type": "opt_in",
			"authenticity": {
				"timestamp": "\<DATA E HORA DA ASSINATURA\>",
				"ip_address": "\<IP DO ASSINANTE\>",
				"fingerprint": {},
				"third_party_additional_data": {},
				"session_id": "\<ID DA SESSÃO DO ASSINANTE\>"
			},
			"signed_object": {
				"document_key": "\<CHAVE DO DOCUMENTO NA QI\>"
			}
		}
	}
}
```

:::caution Atenção
Nos casos em que houver representante legal, é necessário preencher o campo **"legal_representative_document_number"** com o CPF do representante legal, e os dados do objeto **"signer"** devem ser preenchidos com os dados do mesmo.
:::

--- 

"***document_key***": utilizar a GUID retornada no endpoint /upload

Ao invés da chave do documento pdf assinado no objeto "authorization_term.signed_object.document_key", também é possível enviar o texto corrido do Termo de Autorização, através do objeto "authorization_term.signed_object.raw_text".

### Response

ENDPOINT /social_security/benefits_request
METHOD POST

Response Body

```json
{
	"benefits_request_key": "\<GUID DA CONSULTA DE BENEFÍCIO\>",
	"status": "pending_search"
}
```

Em caso de sucesso na consulta da lista de benefícios:

### Webhooks

WEBHOOK_TYPE social_security_benefits_request
STATUS Success

Webhook Body

```json
{
	"webhook_type": "social_security_benefits_request",
	"key": "\<GUID benefits_request_key\>",
	"event_datetime": "\<DATA E HORA DO ENVIO DO WEBHOOK\>",
	"status": "success",
	"data": [{
		"benefit_number": "\<No. DO BENEFÍCIO\>",
		"benefit_status": "inelegible",
        "grant_date": "2023-06-13"
	}]
}
```

| Campo                     | Descrição                           | Valores                          |
|---------------------------|-------------------------------------|----------------------------------|
| benefit_status            | Status do beneficio                 | [Enumeradores](#benefit_status_enumerator) |

Em caso de falha na consulta da lista de benefícios

WEBHOOK_TYPE social_security_benefits_request
STATUS Failure

Webhook Body

```json
{
	"webhook_type": "social_security_benefits_request",
	"key": "\<GUID benefits_request_key\>",
	"event_datetime": "\<DATA E HORA DO ENVIO DO WEBHOOK\>",
	"status": "failure",
	"data": {
		"enumerator": "not_found_legal_representative",
		"description": "no legal representative for the beneficiary"
	}
}
```

### Detalhamento de campos no webhook de falha

| Campo                     | Descrição                           | Valores                          |
|---------------------------|-------------------------------------|----------------------------------|
| enumerator                | Retorno mapeado do código Dataprev  | [Enumeradores](#dataprev_benefits_errors_enumerators) |

### Simulando cenários de sucesso e insucesso na consulta de benefício em Sandbox:
A simulação de cenários é baseado no primeiro dígito do CPF informado na operação.

**11.1.** Para CPFs iniciados com o número 1, será retornado uma resposta assíncrona de sucesso através do Webhook.

**11.2.** Para os demais CPFs, será retornado uma resposta assíncrona de erro, baseado no primeiro dígito do CPF digitado, de acordo com a tabela abaixo.

| Início do CPF | Enumerador             | Descrição            |
|---------------|------------------------|----------------------|
| 2             | inexistent_beneficiary | no beneficiary found |

:::caution Atenção
Todos os CPFs que não tiverem um cenário mapeado para o primeiro dígito, receberão um webhook com um erro padrão de cenário de teste não mapeado. 

| Enumerador    | Descrição                                                        |
|---------------|------------------------------------------------------------------|
| mock_error    | Informed document number is not a valid mock on test environment |
:::

---

## 2 - Consulta de dados do benefício:

Caso 1: Consulta de dados do benefício com o Termo de Autorização previamente enviado.

### Caso 1

#### Request

ENDPOINT /social_security/balance_request
METHOD POST

Request Body

```json
{
	"document_number": "\<CPF BENEFICIÁRIO\>",
	"benefit_number": "\<No. DO BENEFÍCIO\>"
}
```

#### Response

ENDPOINT /social_security/balance_request
METHOD POST

Response Body

```json
{
	"balance_request_key": "\<GUID DA CONSULTA DE DADOS DO BENEFÍCIO\>",
	"status": "pending_search"
}
```

Caso 2: Consulta de dados do benefício com envio do Termo de Autorização.

### Caso 2

#### Request

ENDPOINT /social_security/balance_request
METHOD POST

Request Body

```json
{
	"document_number": "\<CPF BENEFICIÁRIO\>",
	"benefit_number": "\<No. DO BENEFÍCIO\>",
	"authorization_term": {
		"document_number": "\<CPF BENEFICIÁRIO\>",
        "legal_representative_document_number": "\<CPF DO ASSINANTE\>", // CPF do representante legal (caso aplicável)
		"signature": {
			"signer": {
				"name": "\<NOME BENEFICIÁRIO OU RESPONSÁVEL LEGAL\>",
				"email": "\<EMAIL ASSINANTE\>",
				"phone": {
					"number": "\<NUMERO ASSINANTE\>",
					"area_code": "\<DDD ASSINANTE\>",
					"country_code": "55"
				},
				"document_number": "\<CPF ASSINANTE\>"
			},
			"authentication_type": "opt_in",
			"authenticity": {
				"timestamp": "\<DATA E HORA DA ASSINATURA\>",
				"ip_address": "\<IP DO ASSINANTE\>",
				"fingerprint": {},
				"third_party_additional_data": {},
				"session_id": "\<ID DA SESSÃO DO ASSINANTE\>"
			},
			"signed_object": {
				"document_key": "\<CHAVE DO DOCUMENTO NA QI\>"
			}
		}
	}
}
```

:::caution Atenção
Nos casos em que houver representante legal, é necessário preencher o campo **"legal_representative_document_number"** com o CPF do representante legal, e os dados do objeto **"signer"** devem ser preenchidos com os dados do mesmo.
:::

--- 

#### Response

ENDPOINT /social_security/balance_request
METHOD POST

Response Body

```json
{
	"balance_request_key": "\<GUID DA CONSULTA DE DADOS DO BENEFÍCIO\>",
	"status": "pending_authorization"
}

```

Em caso de sucesso na consulta de dados do benefício

### Webhooks

WEBHOOK_TYPE social_security_balance_request
STATUS Success

Webhook Body

```json
{
	"webhook_type": "social_security_balance_request",
	"key": "\<GUID balance_request_key\>",
	"event_datetime": "\<DATA E HORA DO ENVIO DO WEBHOOK\>",
	"status": "success",
	"data": {
            "name": "IVOLANDO MIRANDA",
            "state": "SP",
            "alimony": "not_payer",
            "birth_date": "07021961",
            "grant_date": "2022-09-02",
            "credit_type": "checking_account",
            "block_type": "not_blocked",
            "benefit_card": {
                "limit": 2083.2,
                "balance": 0
            },
            "benefit_number": "22255220",
            "benefit_status": "elegible",
            "payroll_card": {
                "limit": 2083.2,
                "balance": 0
            },
            "assistance_type": "retirement_by_age",
            "document_number": "14950479032",
            "benefit_end_date": "2020-12-01",
            "consigned_credit": {
                "balance": 1000
            },
            "benefit_situation": "active",
            "max_total_balance": 2000,
            "used_total_balance": 1000,
            "politically_exposed": {
                "type": "politically_exposed_level_1",
                "is_politically_exposed": true
            },
            "has_power_of_attorney": false,
            "available_total_balance": 1000,
            "has_judicial_concession": false,
            "number_of_portabilities": 0,
            "disbursement_bank_account": {
                "bank_code": "341",
                "account_digit": "6",
                "account_branch": "0155",
                "account_number": "000059923"
            },
            "has_entity_representation": false,
            "social_benefit_max_balance": 2000,
            "social_benefit_used_balance": 1000,
            "benefit_quota_expiration_date": null,
            "number_of_active_reservations": 0,
            "number_of_suspended_reservations": 0,
            "number_of_refinanced_reservations": 0,
            "number_of_active_suspended_reservations": 3
        }
}
```

### Detalhamento de campos no webhook de sucesso

| Campo                     | Descrição                                                                                                                   | Valores                                       |
|---------------------------|-----------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------|
| assistance_type           | Tipo do benefício                                                                                                           | [Enumeradores](#benefit_type_enumerator)      |
| benefit_status            | Status do beneficio                                                                                                         | [Enumeradores](#benefit_status_enumerator)    |
| has_entity_representation | Possui entidade de representação (não permite averbação)                                                                    | True ou False                                 |
| alimony_code              | Classificador da Pensão alimentícia                                                                                         | not_payer, payer, benefit                     |
| has_judicial_concession   | Benefício concedido por liminar                                                                                             | True ou False                                 |
| has_power_of_attorney     | Possui procurador?                                                                                                          | True ou False                                 |
| credit_type               | Tipo de crédito - recebimento do benefício                                                                                  | Magnetic_card, checking_account               |
| benefit_situation         | Situação do benefício                                                                                                       | [Enumeradores](#benefit_situation_enumerator) |
| used_total_balance        | Valor total comprometido em averbações de empréstimos, reservado para portabilidade, refinanciamento, alterações, RMC e RCC | Numérico                                      |
| max_total_balance         | Valor comprometido possível para a respectiva espécie do benefício                                                          | Numérico                                      |
| available_total_balance   | Valor total disponível para empréstimo, somando todas as modalidades (diferença entre max_total_balance e used_total_balance)         | Numérico                                      |
| benefit_quota_expiration_date   | Data de extinção do benefício. A informação está disponível apenas para alguns benefícios de pensão por morte. | String ou nulo     
| block_type                | Tipo de bloqueio do benefício                                                                                               | [Enumeradores](#block_type_enumerator)
| politically_exposed.type    | Pessoa politicamente exposta                                                                                                | [Enumeradores](#politically_exposed_enumerator)
| is_politically_exposed      | Pessoa politicamente exposta                                                                                                | True ou False

Em caso de falha na consulta da lista de benefícios

WEBHOOK_TYPE social_security_balance_request
STATUS Failure

Webhook Body

```json
{
	"webhook_type": "social_security_balance_request",
	"key": "\<GUID balance_request_key\>",
	"event_datetime": "\<DATA E HORA DO ENVIO DO WEBHOOK\>",
	"status": "failure",
	"data": {
		"enumerator": "not_found_legal_representative",
		"description": "no legal representative for the beneficiary"
	}
}
```

### Detalhamento de campos no webhook de falha

| Campo                     | Descrição                           | Valores                          |
|---------------------------|-------------------------------------|----------------------------------|
| enumerator                | Retorno mapeado do código Dataprev  | [Enumeradores](#dataprev_balance_errors_enumerators) |

### Simulando cenários de sucesso e insucesso na consulta de benefício em Sandbox:
A simulação de cenários é baseado no primeiro dígito do CPF informado na operação.

**11.1.** Para CPFs iniciados com o número 1, será retornado uma resposta assíncrona de sucesso através do Webhook.

**11.2.** Para os demais CPFs, será retornado uma resposta assíncrona de erro, baseado no primeiro dígito do CPF digitado, de acordo com a tabela abaixo.

| Início do CPF | Enumerador             | Descrição            |
|---------------|------------------------|----------------------|
| 2             | inexistent_beneficiary | no beneficiary found |

:::caution Atenção
Todos os CPFs que não tiverem um cenário mapeado para o primeiro dígito, receberão um webhook com um erro padrão de cenário de teste não mapeado. 

| Enumerador    | Descrição                                                        |
|---------------|------------------------------------------------------------------|
| mock_error    | Informed document number is not a valid mock on test environment |
:::

---

## 3 - Simulação de operação em batch:

### Request

ENDPOINT /debt_simulation
METHOD POST

**Crédito Novo**

```json
{
	"complex_operation": true,
	"operation_batch": [{
			"borrower": {
				"person_type": "natural"
			},
			"financial": {
				"first_due_date": "2022-12-07",
				"installment_face_value": 100.0,
				"disbursement_date": "2022-11-03",
				"limit_days_to_disburse": 3,
				"number_of_installments": 24,
				"disbursed_amount": 1876,
				"interest_type": "pre_price_days",
				"fine_configuration": {
					"monthly_rate": 0.01,
					"interest_base": "calendar_days",
					"contract_fine_rate": 0.02
				},
				"credit_operation_type": "ccb",
				"interest_grace_period": 0,
				"principal_grace_period": 0
			},
			"collaterals": [{
				"collateral_type": "social_security"
			}]
		},
		{
			"borrower": {
				"person_type": "natural"
			},
			"financial": {
				"first_due_date": "2022-12-07",
				"installment_face_value": 100.0,
				"disbursement_date": "2022-11-03",
				"limit_days_to_disburse": 3,
				"number_of_installments": 48,
				"monthly_interest_rate": 0.018,
				"interest_type": "pre_price_days",
				"fine_configuration": {
					"monthly_rate": 0.01,
					"interest_base": "calendar_days",
					"contract_fine_rate": 0.02
				},
				"credit_operation_type": "ccb",
				"interest_grace_period": 0,
				"principal_grace_period": 0
			},
			"collaterals": [{
				"collateral_type": "social_security"
			}],
	}]}
```

**Refinanciamento**

```json
{
	"complex_operation": true,
	"operation_batch": [{
			"borrower": {
				"person_type": "natural"
			},
			"financial": {
				"first_due_date": "2022-12-07",
				"installment_face_value": 100.0,
				"disbursement_date": "2022-11-03",
				"limit_days_to_disburse": 3,
				"number_of_installments": 24,
				"disbursed_amount": 1876,
				"interest_type": "pre_price_days",
				"fine_configuration": {
					"monthly_rate": 0.01,
					"interest_base": "calendar_days",
					"contract_fine_rate": 0.02
				},
				"credit_operation_type": "ccb",
				"interest_grace_period": 0,
				"principal_grace_period": 0
			},
			"collaterals": [{
				"collateral_type": "social_security"
			}],
            "refinanced_credit_operations": [
                {
                    "operation_key": "\<DEBT_KEY DA OPERAÇÃO REFINANCIADA\>"
                }
            ],
		},
		{
			"borrower": {
				"person_type": "natural"
			},
			"financial": {
				"first_due_date": "2022-12-07",
				"installment_face_value": 100.0,
				"disbursement_date": "2022-11-03",
				"limit_days_to_disburse": 3,
				"number_of_installments": 48,
				"monthly_interest_rate": 0.018,
				"interest_type": "pre_price_days",
				"fine_configuration": {
					"monthly_rate": 0.01,
					"interest_base": "calendar_days",
					"contract_fine_rate": 0.02
				},
				"credit_operation_type": "ccb",
				"interest_grace_period": 0,
				"principal_grace_period": 0
			},
			"collaterals": [{
				"collateral_type": "social_security"
			}],
            "refinanced_credit_operations": [
                {
                    "operation_key": "\<DEBT_KEY DA OPERAÇÃO REFINANCIADA\>"
                }
            ],
	}]}
```

:::info
Na request acima existem 2 simulações sendo realizadas. A primeira está fixando o valor desembolsado ao cliente (varia a taxa da operação) e a segunda, esta fixando a taxa da operação (varia o valor desembolsado).
::: 

### Response

ENDPOINT /debt_simulation
METHOD POST

Response Body

```json
{
	"data": [{
		"data": {
			"credit_operation_type": "ccb",
			"disbursement_options": [{
					"annual_cet": 0.275357735300064,
					"assignment_amount": 1947.75,
					"cet": 0.0205,
					"contract_fee_amount": 17.68,
					"contract_fees": [{
						"amount": 17.68,
						"amount_type": "absolute",
						"fee_amount": 17.68,
						"fee_type": "spread_cip_cost"
					}],
					"disbursed_issue_amount": 1876,
					"disbursement_date": "2022-11-03",
					"external_contract_fee_amount": 0,
					"external_contract_fees": [],
					"installments": [{
						"business_due_date": "2022-12-07",
						"calendar_days": 34,
						"due_date": "2022-12-07",
						"due_principal": 1930.07,
						"has_interest": true,
						"installment_number": 1,
						"post_fixed_amount": 0,
						"pre_fixed_amount": 38.88069301315790,
						"principal_amortization_amount": 61.12030698684210,
						"tax_amount": 0.17181040000000,
						"total_amount": 100.00,
						"workdays": 23
					}, "\< ... x24 \>" ],
					"iof_amount": 54.07,
					"issue_amount": 1930.07,
					"total_pre_fixed_amount": 469.9216389784704,
					"net_external_contract_fee_amount": 0,
					"prefixed_interest_rate": {
						"annual_rate": 0.23872147,
						"daily_rate": 0.00058669,
						"interest_base": "calendar_days",
						"monthly_rate": 0.018
					}
				}, {
					"annual_cet": 0.251704735300064,
					"assignment_amount": 1950.20,
					"cet": 0.0189,
					"contract_fee_amount": 17.68,
					"contract_fees": [{
						"amount": 17.68,
						"amount_type": "absolute",
						"fee_amount": 17.68,
						"fee_type": "spread_cip_cost"
					}],
					"disbursed_issue_amount": 1876,
					"disbursement_date": "2022-11-04",
					"external_contract_fee_amount": 0,
					"external_contract_fees": [],
					"installments": [{
						"business_due_date": "2023-01-09",
						"calendar_days": 66,
						"due_date": "2023-01-07",
						"due_principal": 1932.52,
						"has_interest": true,
						"installment_number": 1,
						"post_fixed_amount": 0,
						"pre_fixed_amount": 69.95069301315790,
						"principal_amortization_amount": 30.05030698684210,
						"tax_amount": 0.16051040000000,
						"total_amount": 100.00,
						"workdays": 45
					}, "\< ... x24 \>" ],
					"iof_amount": 56.52,
					"issue_amount": 1932.52,
					"total_pre_fixed_amount": 467.50,
					"net_external_contract_fee_amount": 0,
					"prefixed_interest_rate": {
						"annual_rate": 0.21731447,
						"daily_rate": 0.00053890,
						"interest_base": "calendar_days",
						"monthly_rate": 0.0165
					}
				}, "..." ],
			"interest_grace_period": 0,
			"interest_payment_month_period": 1,
			"interest_type": "pre_price_days",
			"issue_date": "2022-11-04",
			"number_of_installments": 24,
			"operation_type": "structured_operation",
			"post_fixed_interest_base": "workdays",
			"post_fixed_interest_rate": null,
			"prefixed_interest_rate": {
				"annual_rate": 0.23872147,
				"daily_rate": 0.00058669,
				"interest_base": "calendar_days",
				"monthly_rate": 0.018
			},
			"principal_amortization_month_period": 1,
			"principal_grace_period": 0,
			"requester_key": "c89a6b75-02c2-471c-a17d-95e381b6ce3d"
		},
		"event_datetime": "2022-11-03 10:00:22",
		"key": "a4dcd407-df75-46f0-b1f4-5b3a9f5d1bd6",
		"status": "finished",
		"type": "debt"
	}, {
		"data": {
			"credit_operation_type": "ccb",
			"disbursement_options": [{
					"annual_cet": 0.261477735300064,
					"assignment_amount": 3205.12,
					"cet": 0.0195,
					"contract_fee_amount": 17.68,
					"contract_fees": [{
						"amount": 17.68,
						"amount_type": "absolute",
						"fee_amount": 17.68,
						"fee_type": "spread_cip_cost"
					}],
					"disbursed_issue_amount": 3087,
					"disbursement_date": "2022-11-03",
					"external_contract_fee_amount": 0,
					"external_contract_fees": [],
					"installments": [{
						"business_due_date": "2022-12-07",
						"calendar_days": 34,
						"due_date": "2022-12-07",
						"due_principal": 3187.44,
						"has_interest": true,
						"installment_number": 1,
						"post_fixed_amount": 0,
						"pre_fixed_amount": 64.20069301315790,
						"principal_amortization_amount": 35.79930698684210,
						"tax_amount": 0.09981040000000,
						"total_amount": 100.00,
						"workdays": 23
					}, "\< ... x48 \>" ],
					"iof_amount": 100.44,
					"issue_amount": 3187.44,
					"total_pre_fixed_amount": 1612.5806389784704,
					"net_external_contract_fee_amount": 0,
					"prefixed_interest_rate": {
						"annual_rate": 0.23872147,
						"daily_rate": 0.00058669,
						"interest_base": "calendar_days",
						"monthly_rate": 0.018
					}
				},
				{
					"annual_cet": 0.261047735300064,
					"assignment_amount": 3150.54,
					"cet": 0.0195,
					"contract_fee_amount": 17.68,
					"contract_fees": [{
						"amount": 17.68,
						"amount_type": "absolute",
						"fee_amount": 17.68,
						"fee_type": "spread_cip_cost"
					}],
					"disbursed_issue_amount": 3031.72,
					"disbursement_date": "2022-11-04",
					"external_contract_fee_amount": 0,
					"external_contract_fees": [],
					"installments": [{
						"business_due_date": "2023-01-09",
						"calendar_days": 66,
						"due_date": "2023-01-07",
						"due_principal": 3132.86,
						"has_interest": true,
						"installment_number": 1,
						"post_fixed_amount": 0,
						"pre_fixed_amount": 123.65069301315790,
						"principal_amortization_amount": 0,
						"tax_amount": 0,
						"total_amount": 100.00,
						"workdays": 45
					}, "\< ... x48 \>" ],
					"iof_amount": 101.14,
					"issue_amount": 3132.86,
					"total_pre_fixed_amount": 1689.8006389784704,
					"net_external_contract_fee_amount": 0,
					"prefixed_interest_rate": {
						"annual_rate": 0.23872147,
						"daily_rate": 0.00058669,
						"interest_base": "calendar_days",
						"monthly_rate": 0.018
					}
				}, "..." ],
			"interest_grace_period": 0,
			"interest_payment_month_period": 1,
			"interest_type": "pre_price_days",
			"issue_date": "2022-11-03",
			"number_of_installments": 24,
			"operation_type": "structured_operation",
			"post_fixed_interest_base": "workdays",
			"post_fixed_interest_rate": null,
			"prefixed_interest_rate": {
				"annual_rate": 0.23872147,
				"daily_rate": 0.00058669,
				"interest_base": "calendar_days",
				"monthly_rate": 0.018
			},
			"principal_amortization_month_period": 1,
			"principal_grace_period": 0,
			"requester_key": "c89a6b75-02c2-471c-a17d-95e381b6ce3d"
		},
		"event_datetime": "2022-11-03 10:00:22",
		"key": "a4dcd407-df75-46f0-b1f4-5b3a9f5d1bd6",
		"status": "finished",
		"type": "debt"
	}]
}
```

Caso na request, seja enviado o objeto "**operation_batch[i].financial.disbursed_amount**", para cada opção de desembolso, será calculada uma "**data[i].data.disbursement_options[i].prefixed_interest_rate**" diferente.

Caso na request, seja enviado o objeto "**operation_batch[i].financial.monthly_interest_rate**", para cada opção de desembolso, será calculado um "**data[i].data.disbursement_options[i].disbursed_amount**" diferente.

:::info
Os objetos "**data[i].data.prefixed_interest_rate**" e "**data[i].data.disbursement_options[i].disbursed_amount**" são referentes ao valor da 1ª opção de desembolso.
:::

---
## 4 - Emissão de Operação:

O campo "assistance_type", localizado dentro do objeto "collateral_data", refere-se ao tipo de benefício que está sendo utilizado para o empréstimo. O mesmo é retornado na consulta de dados do benefício. Para visualizar os valores possíveis (enumeradores), consultar a tabela [Tabela de enumerador](#benefit_type_enumerator)
### Request

Caso 1: Emissão sem representante legal

ENDPOINT /debt
METHOD POST

**Crédito Novo**

```json title='Request Body'
{
  "borrower": {
    "name": "\<NOME DEVEDOR\>",
    "email": "\<EMAIL DEVEDOR\>",
    "phone": {
      "number": "\<CELUAR DO DEVEDOR\>",
      "area_code": "\<DDD DO DEVEDOR\>",
      "country_code": "+55"
    },
    "address": {
      "city": "\<CIDADE DO DEVEDOR\>",
      "state": "\<ESTADO DO DEVEDOR\>",
      "number": "\<No. DO DEVEDOR\>",
      "street": "\<RUA DO DEVEDOR\>",
      "complement": "\<COMPLEMENTO DO DEVEDOR\>",
      "postal_code": "\<CEP DO DEVEDOR\>",
      "neighborhood": "\<BAIRRO DO DEVEDOR\>"
    },
    "role_type": "issuer",
    "birth_date": "\<DATA DE NASCIMENTO DO DEVEDOR\>",
    "mother_name": "\<NOME DA MÃE DO DEVEDOR\>",
    "person_type": "natural",
    "individual_document_number": "\<CPF DO DEVEDOR\>",
    "document_identification": "2893fc74-88fd-4cc9-a5c6-8a63d9d00f41",
    "document_identification_back": "e881ddf4-bc9a-48e0-9555-cac979f65431",
    "selfie": "ca37979e-6f11-4465-bf3b-69cd8307549c"
  },
  "financial": {
    "first_due_date": "2022-12-07",
    "installment_face_value": 100.0,
    "disbursement_date": "2022-11-03",
    "limit_days_to_disburse": 3,
    "number_of_installments": 24,
    "disbursed_amount": 1876,
    "interest_type": "pre_price_days",
    "fine_configuration": {
      "monthly_rate": 0.01,
      "interest_base": "calendar_days",
      "contract_fine_rate": 0.02
    },
    "credit_operation_type": "ccb",
    "interest_grace_period": 0,
    "principal_grace_period": 0
  },
  "simplified": true,
  "collaterals": [{
    "percentage": 1,
    "collateral_data": {
      	"benefit_number": "\<No. DO BENEFÍCIO\>",
      	"state": "\<ESTADO DO BENEFICIÁRIO\>",
		"assistance_type": "\<TIPO DE BENEFÍCIO\>",
		"subcorban_document_number": "12123456000101"
    },
    "collateral_type": "social_security"
  }],
  "requester_identifier_key": "\<ID DE CONTROLE DO PARCEIRO\>",
  "disbursement_bank_account": {
    "name": "\<NOME DO DEVEDOR\>",
    "bank_code": "104",
    "account_type": "checking_account",
    "account_digit": "1",
    "branch_number": "3880",
    "account_number": "000736703806",
    "document_number": "\<CPF DO DEVEDOR\>",
    "transfer_method": "pix"
  },
  "purchaser_document_number": "\<CNPJ DO CESSIONÁRIO\>",
} 
  ```
**Refinanciamento**

```json title='Request Body'
{
  "borrower": {
    "name": "\<NOME DEVEDOR\>",
    "email": "\<EMAIL DEVEDOR\>",
    "phone": {
      "number": "\<CELUAR DO DEVEDOR\>",
      "area_code": "\<DDD DO DEVEDOR\>",
      "country_code": "+55"
    },
    "address": {
      "city": "\<CIDADE DO DEVEDOR\>",
      "state": "\<ESTADO DO DEVEDOR\>",
      "number": "\<No. DO DEVEDOR\>",
      "street": "\<RUA DO DEVEDOR\>",
      "complement": "\<COMPLEMENTO DO DEVEDOR\>",
      "postal_code": "\<CEP DO DEVEDOR\>",
      "neighborhood": "\<BAIRRO DO DEVEDOR\>"
    },
    "role_type": "issuer",
    "birth_date": "\<DATA DE NASCIMENTO DO DEVEDOR\>",
    "mother_name": "\<NOME DA MÃE DO DEVEDOR\>",
    "person_type": "natural",
    "individual_document_number": "\<CPF DO DEVEDOR\>",
    "document_identification": "2893fc74-88fd-4cc9-a5c6-8a63d9d00f41",
    "document_identification_back": "e881ddf4-bc9a-48e0-9555-cac979f65431",
    "selfie": "ca37979e-6f11-4465-bf3b-69cd8307549c"
  },
  "financial": {
    "first_due_date": "2022-12-07",
    "installment_face_value": 100.0,
    "disbursement_date": "2022-11-03",
    "limit_days_to_disburse": 3,
    "number_of_installments": 24,
    "disbursed_amount": 1876,
    "interest_type": "pre_price_days",
    "fine_configuration": {
      "monthly_rate": 0.01,
      "interest_base": "calendar_days",
      "contract_fine_rate": 0.02
    },
    "credit_operation_type": "ccb",
    "interest_grace_period": 0,
    "principal_grace_period": 0
  },
  "simplified": true,
  "collaterals": [{
    "percentage": 1,
    "collateral_data": {
      	"benefit_number": "\<No. DO BENEFÍCIO\>",
      	"state": "\<ESTADO DO BENEFICIÁRIO\>",
		"assistance_type": "\<TIPO DE BENEFÍCIO\>",
		"subcorban_document_number": "12123456000101"
		
    },
    "collateral_type": "social_security"
  }],
  "requester_identifier_key": "\<ID DE CONTROLE DO PARCEIRO\>",
  "disbursement_bank_account": {
    "name": "\<NOME DO DEVEDOR\>",
    "bank_code": "104",
    "account_type": "checking_account",
    "account_digit": "1",
    "branch_number": "3880",
    "account_number": "000736703806",
    "document_number": "\<CPF DO DEVEDOR\>",
    "transfer_method": "pix"
  },
  "refinanced_credit_operations": [
      {
          "operation_key": "\<DEBT_KEY DA OPERAÇÃO REFINANCIADA\>"
      }
  ],
  "purchaser_document_number": "\<CNPJ DO CESSIONÁRIO\>",
} 
  ```

Caso 2: Emissão com representante legal

ENDPOINT /debt
METHOD POST

**Crédito Novo**

```json
{
	"borrower": {
		"name": "\<NOME DEVEDOR\>",
		"email": "\<EMAIL DEVEDOR\>",
		"phone": {
			"number": "\<CELUAR DO DEVEDOR\>",
			"area_code": "\<DDD DO DEVEDOR\>",
			"country_code": "+55"
		},
		"address": {
			"city": "\<CIDADE DO DEVEDOR\>",
			"state": "\<ESTADO DO DEVEDOR\>",
			"number": "\<No. DO DEVEDOR\>",
			"street": "\<RUA DO DEVEDOR\>",
			"complement": "\<COMPLEMENTO DO DEVEDOR\>",
			"postal_code": "\<CEP DO DEVEDOR\>",
			"neighborhood": "\<BAIRRO DO DEVEDOR\>"
		},
		"role_type": "issuer",
		"birth_date": "\<DATA DE NASCIMENTO DO DEVEDOR\>",
		"mother_name": "\<NOME DA MÃE DO DEVEDOR\>",
		"person_type": "natural",
		"individual_document_number": "\<CPF DO DEVEDOR\>",
		"document_identification": "2893fc74-88fd-4cc9-a5c6-8a63d9d00f41",
		"document_identification_back": "e881ddf4-bc9a-48e0-9555-cac979f65431",
		"selfie": "ca37979e-6f11-4465-bf3b-69cd8307549c"
	},
	"related_parties": [{
		"name": "\<NOME REPRESENTANTE LEGAL\>",
		"email": "beatriz@qitech.com.br",
		"phone": {
			"number": "991294043",
			"area_code": "55",
			"country_code": "055"
		},
		"address": {
			"street": "AV LEONOR",
			"state": "SP",
			"city": "GUARULHOS",
			"neighborhood": "",
			"number": "1",
			"postal_code": "07025200",
			"complement": ""
		},
		"role_type": "issuer_legal_representative",
		"person_type": "natural",
		"is_pep": false,
		"individual_document_number": "45102538004",
		"birth_date": "1970-04-20",
		"mother_name": " Ana Lúcia",
		"document_identification": "2893fc74-88fd-4cc9-a5c6-8a63d9d00f41",
		"document_identification_back": "e881ddf4-bc9a-48e0-9555-cac979f65431",
		"selfie": "ca37979e-6f11-4465-bf3b-69cd8307549c"
	}],
	"financial": {
		"first_due_date": "2022-12-07",
		"installment_face_value": 100.0,
		"disbursement_date": "2022-11-03",
		"limit_days_to_disburse": 3,
		"number_of_installments": 24,
		"disbursed_amount": 1876,
		"interest_type": "pre_price_days",
		"fine_configuration": {
			"monthly_rate": 0.01,
			"interest_base": "calendar_days",
			"contract_fine_rate": 0.02
		},
		"credit_operation_type": "ccb",
		"interest_grace_period": 0,
		"principal_grace_period": 0
	},
	"simplified": true,
	"collaterals": [{
		"percentage": 1,
		"collateral_data": {
			"benefit_number": "\<No. DO BENEFÍCIO\>",
			"state": "\<ESTADO DO BENEFICIÁRIO\>",
            "assistance_type": "\<TIPO DE BENEFÍCIO\>",
			"subcorban_document_number": "12123456000101"
		},
		"collateral_type": "social_security"
	}],
	"requester_identifier_key": "\<ID DE CONTROLE DO PARCEIRO\>",
	"disbursement_bank_account": {
		"name": "\<NOME DO DEVEDOR\>",
		"bank_code": "104",
		"account_type": "checking_account",
		"account_digit": "1",
		"branch_number": "3880",
		"account_number": "000736703806",
		"document_number": "\<CPF DO DEVEDOR\>",
		"transfer_method": "pix"
	},
	"purchaser_document_number": "\<CNPJ DO CESSIONÁRIO\>"
}
```
**Refinanciamento**

```json
{
	"borrower": {
		"name": "\<NOME DEVEDOR\>",
		"email": "\<EMAIL DEVEDOR\>",
		"phone": {
			"number": "\<CELUAR DO DEVEDOR\>",
			"area_code": "\<DDD DO DEVEDOR\>",
			"country_code": "+55"
		},
		"address": {
			"city": "\<CIDADE DO DEVEDOR\>",
			"state": "\<ESTADO DO DEVEDOR\>",
			"number": "\<No. DO DEVEDOR\>",
			"street": "\<RUA DO DEVEDOR\>",
			"complement": "\<COMPLEMENTO DO DEVEDOR\>",
			"postal_code": "\<CEP DO DEVEDOR\>",
			"neighborhood": "\<BAIRRO DO DEVEDOR\>"
		},
		"role_type": "issuer",
		"birth_date": "\<DATA DE NASCIMENTO DO DEVEDOR\>",
		"mother_name": "\<NOME DA MÃE DO DEVEDOR\>",
		"person_type": "natural",
		"individual_document_number": "\<CPF DO DEVEDOR\>",
		"document_identification": "2893fc74-88fd-4cc9-a5c6-8a63d9d00f41",
		"document_identification_back": "e881ddf4-bc9a-48e0-9555-cac979f65431",
		"selfie": "ca37979e-6f11-4465-bf3b-69cd8307549c"
	},
	"related_parties": [{
		"name": "\<NOME REPRESENTANTE LEGAL\>",
		"email": "beatriz@qitech.com.br",
		"phone": {
			"number": "991294043",
			"area_code": "55",
			"country_code": "055"
		},
		"address": {
			"street": "AV LEONOR",
			"state": "SP",
			"city": "GUARULHOS",
			"neighborhood": "",
			"number": "1",
			"postal_code": "07025200",
			"complement": ""
		},
		"role_type": "issuer_legal_representative",
		"person_type": "natural",
		"is_pep": false,
		"individual_document_number": "45102538004",
		"birth_date": "1970-04-20",
		"mother_name": " Ana Lúcia",
		"document_identification": "2893fc74-88fd-4cc9-a5c6-8a63d9d00f41",
		"document_identification_back": "e881ddf4-bc9a-48e0-9555-cac979f65431",
		"selfie": "ca37979e-6f11-4465-bf3b-69cd8307549c"
	}],
	"financial": {
		"first_due_date": "2022-12-07",
		"installment_face_value": 100.0,
		"disbursement_date": "2022-11-03",
		"limit_days_to_disburse": 3,
		"number_of_installments": 24,
		"disbursed_amount": 1876,
		"interest_type": "pre_price_days",
		"fine_configuration": {
			"monthly_rate": 0.01,
			"interest_base": "calendar_days",
			"contract_fine_rate": 0.02
		},
		"credit_operation_type": "ccb",
		"interest_grace_period": 0,
		"principal_grace_period": 0
	},
	"simplified": true,
	"collaterals": [{
		"percentage": 1,
		"collateral_data": {
			"benefit_number": "\<No. DO BENEFÍCIO\>",
			"state": "\<ESTADO DO BENEFICIÁRIO\>",
            "assistance_type": "\<TIPO DE BENEFÍCIO\>",
			"subcorban_document_number": "12123456000101"
		},
		"collateral_type": "social_security"
	}],
	"requester_identifier_key": "\<ID DE CONTROLE DO PARCEIRO\>",
	"disbursement_bank_account": {
		"name": "\<NOME DO DEVEDOR\>",
		"bank_code": "104",
		"account_type": "checking_account",
		"account_digit": "1",
		"branch_number": "3880",
		"account_number": "000736703806",
		"document_number": "\<CPF DO DEVEDOR\>",
		"transfer_method": "pix"
	},
    "refinanced_credit_operations": [
        {
            "operation_key": "\<DEBT_KEY DA OPERAÇÃO REFINANCIADA\>"
        }
    ],
    "purchaser_document_number": "\<CNPJ DO CESSIONÁRIO\>",
}
```

Exemplo de objeto financial com rebates

```json
{
    "financial": {
        "first_due_date": "2022-12-07",
        "installment_face_value": 100,
        "disbursement_date": "2022-11-03",
        "limit_days_to_disburse": 3,
        "number_of_installments": 24,
        "disbursed_amount": 1876,
        "interest_type": "pre_price_days",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "principal_grace_period": 0,
        "rebates": [
            {
                "amount": 20,
                "rebate_bank_account": {
                    "name": "Teste Ltda",
                    "document_number": "18533555000164",
                    "account_digit": "0",
                    "account_number": "4290001",
                    "branch_number": "0001",
                    "bank_code": "329"
                },
                "amount_type": "percentage",
                "fee_type": "spread"
            }
        ]
    }
}
```

### Response

ENDPOINT /debt
METHOD POST

Response Body

```json
{
	"data": {
		"borrower": {
			"document_number": "\<CPF DEVEDOR\>",
			"name": "\<NOME DEVEDOR\>",
            "related_party_key": "1755ea25-f85a-4ca7-b4d5-4a198a43a2ca"
		},
		"collaterals": [{
			"absolute_amount": null,
			"collateral_constituted": false,
			"collateral_data": {
				"benefit_number": "\<No. DO BENEFÍCIO\>",
				"state": "\<ESTADO DO BENEFICIÁRIO\>",
                "assistance_type": "\<TIPO DE BENEFÍCIO\>",
                "subcorban_document_number": "12123456000101"
			},
			"collateral_key": "5e40c191-06ae-4da2-9d4b-3c0bf6eeb1a3",
			"collateral_type": "social_security",
			"created_at": "2022-11-03T20:56:09.200482",
			"external_key": "\<DEBT-KEY\>",
			"percentage": 1,
			"updated_at": "2022-11-03T20:56:09.200474"
		}],
		"contract": {
			"number": "BYX00000000001",
			"signature_information": [{
				"signature_url": null,
				"signer_document_number": "\<CPF ASSINANTE\>",
				"signer_email": "\<EMAIL ASSINANTE\>",
				"signer_external_key": null,
				"signer_name": "\<NOME ASSINANTE\>",
				"signer_role": "issuer"
			}],
			"urls": [
				"\<LINK URL DA CCB\>"
			]
		},
		"disbursement_options": [{
				"additional_iof": 24.220242,
				"annual_cet": "26.1457%",
				"assignment_amount": 3205.12,
				"base_iof": 176.6603785598479778,
				"cet": "1,9544%",
				"contract_fee_amount": 17.68,
				"contract_fees": [{
					"amount": 17.68,
					"amount_type": "absolute",
					"fee_amount": 17.68,
					"fee_type": "spread_cip_cost"
				}],
				"disbursement_date": "2022-11-03",
				"external_contract_fee_amount": 0,
				"external_contract_fees": [],
				"first_due_date": "2022-12-07",
				"installments": [{
						"additional_costs": [],
						"business_due_date": "2022-12-07",
						"calendar_days": 34,
						"due_date": "2022-12-07",
						"due_interest": 0,
						"due_principal": 3187.44,
						"fine_amount": null,
						"has_interest": true,
						"installment_number": 1,
						"installment_status": null,
						"installment_type": null,
						"post_fixed_amount": 0,
						"pre_fixed_amount": 64.20069301315790,
						"principal_amortization_amount": 35.79930698684210,
						"tax_amount": 0.10014353287723266,
						"total_amount": 100,
						"workdays": 23
					}
				],
				"issue_amount": 3187.44,
				"net_external_contract_fee_amount": 0,
				"total_iof": 100.44,
				"total_pre_fixed_amount": 3225.1656904289435
			},
			{
				"additional_iof": 24.220242,
				"annual_cet": "26.0057%",
				"assignment_amount": 3205.12,
				"base_iof": 176.6603785598479778,
				"cet": "1,9544%",
				"contract_fee_amount": 17.68,
				"contract_fees": [{
					"amount": 17.68,
					"amount_type": "absolute",
					"fee_amount": 17.68,
					"fee_type": "spread_cip_cost"
				}],
				"disbursement_date": "2022-11-04",
				"external_contract_fee_amount": 0,
				"external_contract_fees": [],
				"first_due_date": "2023-01-07",
				"installments": [{
						"additional_costs": [],
						"business_due_date": "2023-01-07",
						"calendar_days": 34,
						"due_date": "2022-12-07",
						"due_interest": 0,
						"due_principal": 3187.44,
						"fine_amount": null,
						"has_interest": true,
						"installment_number": 1,
						"installment_status": null,
						"installment_type": null,
						"post_fixed_amount": 0,
						"pre_fixed_amount": 64.20069301315790,
						"principal_amortization_amount": 35.79930698684210,
						"tax_amount": 0.10014353287723266,
						"total_amount": 100,
						"workdays": 23
					}
				],
				"issue_amount": 3187.44,
				"net_external_contract_fee_amount": 0,
				"total_iof": 100.44,
				"total_pre_fixed_amount": 3225.1656904289435
			},
			{
				"additional_iof": 24.220242,
				"annual_cet": "25.8457%",
				"assignment_amount": 3205.12,
				"base_iof": 176.6603785598479778,
				"cet": "1,9544%",
				"contract_fee_amount": 17.68,
				"contract_fees": [{
					"amount": 17.68,
					"amount_type": "absolute",
					"fee_amount": 17.68,
					"fee_type": "spread_cip_cost"
				}],
				"disbursement_date": "2022-11-05",
				"external_contract_fee_amount": 0,
				"external_contract_fees": [],
				"first_due_date": "2022-12-07",
				"installments": [{
						"additional_costs": [],
						"business_due_date": "2022-12-07",
						"calendar_days": 34,
						"due_date": "2022-12-07",
						"due_interest": 0,
						"due_principal": 3187.44,
						"fine_amount": null,
						"has_interest": true,
						"installment_number": 1,
						"installment_status": null,
						"installment_type": null,
						"post_fixed_amount": 0,
						"pre_fixed_amount": 64.20069301315790,
						"principal_amortization_amount": 35.79930698684210,
						"tax_amount": 0.10014353287723266,
						"total_amount": 100,
						"workdays": 23
					} 
				],
				"issue_amount": 3187.44,
				"net_external_contract_fee_amount": 0,
				"total_iof": 100.44,
				"total_pre_fixed_amount": 3225.1656904289435
			},
			{
				"additional_iof": 24.220242,
				"annual_cet": "26.1457%",
				"assignment_amount": 3205.12,
				"base_iof": 176.6603785598479778,
				"cet": "1,9544%",
				"contract_fee_amount": 17.68,
				"contract_fees": [{
					"amount": 17.68,
					"amount_type": "absolute",
					"fee_amount": 17.68,
					"fee_type": "spread_cip_cost"
				}],
				"disbursement_date": "2022-11-06",
				"external_contract_fee_amount": 0,
				"external_contract_fees": [],
				"first_due_date": "2022-12-07",
				"installments": [{
						"additional_costs": [],
						"business_due_date": "2022-12-07",
						"calendar_days": 34,
						"due_date": "2022-12-07",
						"due_interest": 0,
						"due_principal": 3187.44,
						"fine_amount": null,
						"has_interest": true,
						"installment_number": 1,
						"installment_status": null,
						"installment_type": null,
						"post_fixed_amount": 0,
						"pre_fixed_amount": 64.20069301315790,
						"principal_amortization_amount": 35.79930698684210,
						"tax_amount": 0.10014353287723266,
						"total_amount": 100,
						"workdays": 23
					} 
				],
				"issue_amount": 3187.44,
				"net_external_contract_fee_amount": 0,
				"total_iof": 100.44,
				"total_pre_fixed_amount": 3225.1656904289435
			}
		],
		"iof_charge_method": "financed",
		"requester_identifier_key": "3ed0744d-1f35-4688-aa65-739b8a3f9e89"
	},
	"event_datetime": "2022-11-07 13:54:58",
	"key": "3ed0744d-1f35-4688-aa65-739b8a3f9e89",
	"status": "waiting_signature",
	"webhook_type": "debt"
}
```

Caso a operação não seja assinada ou averbada até a última opção de data de desembolso o parceiro receberá um webhook informando a respeito do cancelamento da operação:

WEBHOOK_TYPE debt
STATUS Canceled
**Webhook Body**

```json
{
	"key": "\<DEBT-KEY\>",
	"data": {
		"cancel_reason": "Operacao cancelada manualmente",
		"cancel_reason_enumerator": "manual"
	},
	"status": "canceled",
	"webhook_type": "debt",
	"event_datetime": "2022-11-01 03:46:31"
}
```

### Simulando cenários de sucesso e insucesso na averbação em Sandbox:
A simulação de cenários é baseado no primeiro dígito do CPF informado na operação.

**11.1.** Para CPFs iniciados com o número 1, será retornado uma resposta assíncrona de sucesso através do Webhook.

**11.2.** Para os demais CPFs, será retornado uma resposta assíncrona de erro, baseado no primeiro dígito do CPF digitado, de acordo com a tabela abaixo.

**11.3.** Erros com Ação "cancel" receberá um webhook com o resultado final da operação.

| Início do cpf | Enumerador                   | Descrição                                                                         | Ação   |
|---------------|------------------------------|-----------------------------------------------------------------------------------|--------|
| 2             | invalid_disbursement_account | Invalid disbursemente bank account                                                | cancel |
| 3             | operation_not_allowed_IR     | Operation not allowed due to operation deadline greatter than benefit termination | cancel |

:::caution Atenção
Todos os CPFs que não tiverem um cenário mapeado para o primeiro dígito, receberão um webhook com um erro padrão de cenário de teste não mapeado. 

| Enumerador    | Descrição                                                        |
|---------------|------------------------------------------------------------------|
| mock_error    | Informed document number is not a valid mock on test environment |
:::

## 5 - Envio de documentos

É obrigatório o envio (segundo IN 138 do INSS) dos dados complementares do contrato.

Os documentos devem ser enviados através do [endpoint de upload de documentos.](../upload_de_documentos) e devem seguir a seguinte formatação:

| Validações     | Valores      |
|----------------|--------------|
| Formato        | JPEG         |
| Tamanho mínimo | 250 x 250 px |
| Tamanho máximo |     2 MB     |

:::caution Atenção
Contratos que tiverem documentos vinculados que não respeitam as regras de tamanho mínimo ou máximo serão cancelados permanentemente.
:::

Após o upload dos documentos, as chaves dos documentos enviados devem ser informadas no payload de criação da operação ou após, através do seguinte endpoint:

ENDPOINT /debt/ DEBT-KEY /related_party/ RELATED-PARTY-KEY /attached_document
METHOD POST

Request Body

```json
{
    "document_identification": "2893fc74-88fd-4cc9-a5c6-8a63d9d00f41",
    "document_identification_back": "e881ddf4-bc9a-48e0-9555-cac979f65431",
    "selfie": "ca37979e-6f11-4465-bf3b-69cd8307549c"
}
```

:::info Informação
A **related_party_key** é retornada na response da criação de dívida dentro do objeto **borrower**
:::

## 6 - Formalização da operação

Após o input dos documentos a operação pode seguir para formalização.

No caso de assinatura por parte do representante legal, no campo "**data.contract.signers[i]**" serão retornados os dados do representante legal, e o valor do objeto "**data.contract.signers[i].signer_role**" será "**issuer_legal_representative**".

**No payload de assinatura devem conter os campos obrigatórios relacionados aos documentos enviados no item 5. Os campos obrigatórios são os seguintes: _ip_address_ e _signature_datetime_.**

### Request

ENDPOINT /debt/ DEBT-KEY /signed
METHOD POST

Request Body

```json
{
	...,
	"ip_address": "192.168.0.0",
	"signature_datetime": "2020-03-20T14:28:23.382748Z",
	"similarity_score": 0.98000,
    "biometry_analysis_reference": "serpro",
	"type": "data-signature"
}
```

:::caution Atenção
O payload de envio da assinatura varia de acordo com o processo de formalização do parceiro e deve ser alinhado com o time de integração da QI Tech.
:::

#### Enumeradores _Biometry Analysis Reference_
| Enumerador    | Descrição                                                                                                                                                                                                                                                          |
|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **serpro**    | Utilizado quando o similarity_score for retornado através de consulta realizada na base de documentos com foto do Detran (Serviço prestado através da Serpro)                                                                                                      |
| **tse**       | Utilizado quando o similarity_score for retornado através de consulta realizada na base de documentos com foto do TSE                                                                                                                                              |
| **not_found** | Deve ser informado quando a biometria facial não for localizada em nenhuma das bases governamentais anteriores (serpro ou tse). Neste caso o similarity_score deve ser null ou o grau de similaridade da selfie com o documento oficial com foto, retornado pelo parceiro. |

:::danger QI Sign
A QI Tech oferece o serviço de assinatura que atende ao determinado pela IN 138. Com biometria facial e envio de documentos.

Para receber uma cotação consulte nosso time comercial:

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

### Response

ENDPOINT /debt/ DEBT-KEY /signed
METHOD POST

Response Body

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

  Após o recebimento da assinatura, uma validação dos documentos enviados e do campo assistance type será feita.
  
  Caso seja enviado um tipo de benefício [(assistance_type)](#benefit_type_enumerator) que não esteja mapeado, a operação será cancelada permanentemente.
  
  O mesmo vale para as validações de documentos, caso haja duplicidade, falta ou documentos fora dos padrões mínimos exigidos, a operação será cancelada permanente.

  Em ambos os casos, um webhook será enviado com o seguinte payload:

WEBHOOK_TYPE debt
STATUS Canceled Permanently

Webhook Body

```json
{
	"key": "<DEBT-KEY>",
	"data": {},
	"status": "canceled_permanently",
	"webhook_type": "debt",
	"event_datetime": "2022-11-01 03:46:31"
}
```

## 7 - Averbação e Desaverbação

### Averbação

Em caso de sucesso na averbação o parceiro receberá o seguinte webhook:

WEBHOOK_TYPE credit_operation.collateral
STATUS Success

Webhook Body

```json
{
	"key": "\<DEBT-KEY\>",
	"data": {
		"collateral_type": "social_security",
		"collateral_constituted": true
	},
	"event_time": "2022-10-31 15:23:46",
	"webhook_type": "credit_operation.collateral"
}
```

### Desaverbação

O cancelmento definitivo de uma operação pode ocorrer de duas formas, manual e automática. 

Para realizar o cancelamento definitivo de uma operação manualmente, com a desaverbação da margem consignável, deve ser utilizado o seguinte endpoint:

ENDPOINT /debt/ DEBT-KEY /cancel_permanently
METHOD POST

O cancelamento definitivo de forma automática acontece quando uma operação está no status "canceled" por mais de 10 dias.

A reserva pode ir para esse status por diferentes motivos, tais como: erro no processo de desembolso, cancelamento manual ou falta de opções de desembolso.
#### Webhooks

WEBHOOK_TYPE debt
STATUS Canceled Permanently
Webhook Body

```json
{
	"key": "\<DEBT-KEY\>",
	"data": {},
	"status": "canceled_permanently",
	"webhook_type": "debt",
	"event_datetime": "2022-11-01 03:46:31"
}
```

## 8 - Falha no desembolso

### TED

Em caso de falha no desembolso via TED

WEBHOOK_TYPE debt
STATUS Canceled
Webhook Body

```json
 {
 	"status": "canceled",
 	"key": "\<DEBT-KEY\>",
 	"data": {
 		"ted_refusal": {
 			"transaction_key": "16faabfc-3876-437d-a4f6-aae17a1d68c9",
 			"description": "341 0000 000000-7 12345678900 - NOME BENEFICIÁRIO",
 			"origin": {
 				"account_key": "a1d2dea5-fa90-4676-a125-da355fdc3ed0",
 				"account_number": "00086",
 				"bank_code": "329",
 				"name": "ACCOUNT TRANSITORY",
 				"type": "payment_account",
 				"document": "32402502000135",
 				"branch_digit": null,
 				"account_digit": "8",
 				"branch": "0001"
 			},
 			"fee": 0,
 			"reason_enumerator": "agencia_conta_invalida",
 			"timestamp": "2022-11-07T14:36:05",
 			"amount": 483.6,
 			"reason": "Agência ou Conta Destinatária do Crédito Inválida",
 			"destination": {
 				"branch": "0000",
 				"account_number": "000000",
 				"name": "NOME BENEFICIÁRIO",
 				"purpose": "Crédito em Conta",
 				"type": "checking_account",
 				"branch_digit": null,
 				"document": "12345678900",
 				"bank_code": "341",
 				"account_digit": "7"
 			}
 		},
 		"cancel_reason": "ted_refusal"
 	}
 }
```

### Pix

Em caso de falha no desembolso via Pix

WEBHOOK_TYPE debt
STATUS Canceled
Webhook Body

```json
{
        "webhook_type": "debt",
        "data": {
          "pix_refusal": {
            "reason_enumerator": "invalid_document_number",
            "reason": "CPF/CNPJ do usuário recebedor não é compatível com o titular da conta de destino."
          },
          "cancel_reason": "pix_refusal"
        },
        "status": "canceled",
        "key": "\<DEBT-KEY\>",
        "event_datetime": "2022-11-07 15:29:37"
      }
```

## 9 - Reapresentação de Pagamento

Altera a data de desembolso sem afetar os valores financeiros da operação.

### Request

ENDPOINT /debt/ DEBT-KEY /change_disbursement_date
MÉTODO POST
Request Body

```json
{
    "disbursement_date": "2022-11-04",
    "disbursement_bank_accounts": [
        {
            "branch_number": "1232",
            "account_digit": "4",
            "account_number": "412412412",
            "account_type": "checking_account",
            "document_number": "\<CPF BENEFICIÁRIO\>",
            "bank_code": 184,
            "ispb_number": "17298092",
            "name": "\<NOME BENEFICIÁRIO\>",
            "percentage_receivable": 100
        }
    ]
}
```
 

### Response

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

Response Body

```json
{
    "disbursement_accounts": [
        {
            "account_branch": "1232",
            "account_digit": "4",
            "account_number": "412412412",
            "account_type": "checking_account",
            "amount_receivable": null,
            "created_at": "2022-05-24T14:51:46",
            "digitable_line": null,
            "disbursement_type": "ted",
            "document_number": "37197645832",
            "financial_institutions": {
                "code_number": 184,
                "ispb": 17298092,
                "name": "BCO ITAÚ BBA S.A."
            },
            "financial_institutions_code_number": 184,
            "is_pix_disbursement": false,
            "ispb": "17298092",
            "name": "Márcio e Catarina Gráfica Ltda",
            "percentage_receivable": 50.0,
            "pix_key": null,
            "pix_transfer_key": null,
            "pix_type": null,
            "qr_code_key": null,
            "retry_counter": 0,
            "retry_vector": null,
            "transaction_key": null,
            "webhook_key": null
        }
    ],
    "disbursement_date": "2022-11-04"
}
```

---

![Competence Diagram](@site/static/img/imagem_manual_credito_novo_inss.webp)

## 10 - Recuperar resposta da última request

O last response é uma forma de mapear, de forma simples e objetiva, a resposta da comunicação entre a QI e a Dataprev, possibilitando saber quando essa requisição foi feita e qual o retorno obtido (através de um enumerador). Os enumeradores estão diretamente relacionados aos códigos de retorno da Dataprev e são divididos em duas formas: "errors" e "success". 

Cada enumerador tem uma descrição detalhada e o código de referência da Dataprev. Podemos conferir abaixo, com mais detalhes, como serão apresentados os dados do last response.

### Casos de sucesso

#### Request
ENDPOINT /debt/DEBT-KEY/collateral
METHOD GET

#### Response

Response Body

```json
{
  "collateral_constituted": true,
  "collateral_type": "type",
  "updated_at": "2023-05-24 19:13:02",
  "collateral_data": {
    "state": "SP",
    "benefit_number": 1976703155,
    "status": "reserved",
    "last_response": {
      "success": [
        {
          "enumerator": "succesfully_included",
          "reservation_method" : "new_credit"
        }
      ]
    },
    "last_response_event_datetime": "2023-05-22T19:13:02Z"
  }
}
```

### Detalhamento de campos no retorno da request
| Campo                     | Descrição                           | Valores                          |
|---------------------------|-------------------------------------|----------------------------------|
| enumerator                | Retorno mapeado do código Dataprev  | [Enumeradores](#dataprev_response_enumerator_success)|
| reservation_method        | Método de averbação da reserva      | portability, new_credit, refinancing|

### Casos de erro

#### Request
ENDPOINT /debt/DEBT-KEY/collateral
METHOD GET

#### Response

Response Body

```json
{
  "collateral_constituted": false,
  "collateral_type": "type",
  "updated_at": "2023-05-24 19:13:02",
  "collateral_data": {
    "state": "SP",
    "benefit_number": 1976703155,
    "status": "pending_reservation",
    "last_response": {
      "errors": [
        {
          "enumerator": "benefit_blocked_by_tbm",
          "reservation_method" : "new_credit"
        }
      ]
    },
    "last_response_event_datetime": "2023-05-22T19:13:02Z"
  }
}
```

### Detalhamento de campos no retorno da request
| Campo                     | Descrição                           | Valores                          |
|---------------------------|-------------------------------------|----------------------------------|
| enumerator                | Retorno mapeado do código Dataprev  | [Enumeradores](#dataprev_response_enumerator_errors)|
| reservation_method        | Método de averbação da reserva      | portability, new_credit, refinancing|

## 11 - Recuperar última consulta do benefício

Por esse endpoint é possível consultar quando foi a última consulta do benefício na Dataprev.

#### Request
ENDPOINT /social_security/benefit/BENEFIT-NUMBER
MÉTODO GET

#### Response

Response Body

```json
{
    "last_balance_check": "2025-08-22T19:13:02Z",
    "status": "pending_balance_request"
}
```

## 12 - Webhook de resposta da última tentativa de averbação

Caso a operação não tenha sucesso na averbação, a mesma ficará em retentativa e será enviado o seguinte webhook, detalhando o motivo da não averbação, o horário desta tentativa e o método de averbação utilizado:

WEBHOOK_TYPE credit_operation.collateral

        *Body:*

**body.json**

```json

{
	"webhook_type": "credit_operation.collateral",
	"key": "\<CREDIT-OPERATION-KEY\>",
	"event_time": "2022-11-24T15:42:12",
	"data": {
		"collateral_type": "social_security",
		"collateral_constituted": false,
		"collateral_data": {
			"status": "pending_reservation",
			"last_response": {
				"errors": [{
					"enumerator": "consignable_margin_excceded"
				}]
			},
			"last_response_event_datetime": "2023-05-22T19:13:02Z",
			"reservation_method": "new_credit",
		}
	}
}

```

## 13. Mapeamento de enumeradores

### Tabela de retorno de erros Dataprev - averbação {#dataprev_response_enumerator_errors}
| Código Dataprev | Enumerador                                       | Descrição                                                   | Ação Qi              |
|-----------------|--------------------------------------------------|-------------------------------------------------------------|----------------------|
| HW              | consignable_margin_excceded                      | Exceeded consignable margin                                 | Teimosinha           |
| IT              | benefit_blocked_by_tbm                           | Benefit blocked due to benefit transfer                     | Teimosinha           |
| IE              | benefit_blocked_by_beneficiary                   | Benefit blocked by beneficiary                              | Teimosinha           |
| AN              | invalid_disbursement_account                     | Invalid disbursement bank account                           | Cancelar             |
| HX              | reservation_already_included                     | Reservation already included                                | Confirmar averbação  |
| IF              | benefit_blocked_by_granting_process              | Benefit blocked during granting process                     | Teimosinha           |
| AV              | processing_payroll                               | Operation couldn`t be done during processing payroll period | Teimosinha           |
| OF              | invalid_cbc                                      | Invalid cbc                                                 | Teimosinha           |
| IA              | first_name_mismatch                              | First name mismatch benefit owner or legal representative   | Teimosinha           |
| OS              | legal_representative_document_number_mismatch    | Document number mismatch legal representative               | Teimosinha           |
| AY              | invalid_state                                    | Invalid state                                               | Teimosinha           |
| HZ              | operation_not_allowed_on_this_reservation_status | Operation couldn`t be done with current reservation status  | Teimosinha           |
| AP              | invalid_contract_date                            | Accrual, end or start contract date is invalid              | Teimosinha           |
| GA              | required_fields_missing                          | Required fields are missing                                 | Teimosinha           |
| BC              | cbc_missing                                      | CBC is missing                                              | Teimosinha           |
| NC              | contract_number_missing                          | Contract number is missing                                  | Teimosinha           |
| NB              | benefit_number_missing                           | Benefit number is missing                                   | Teimosinha           |
| CA              | invalid_bank_code                                | Invalid bank code                                           | Teimosinha           |
| HR              | exceeded_number_of_allowed_contracts             | Amount of contracts is above the limit                      | Teimosinha           |
| PV              | invalid_image_format                             | Image with wrong format                                     | Teimosinha           |
| IR              | operation_not_allowed_IR                         | Operation date is greater than benefit expiration           | Cancelar             |
| PK              | wrong_bank_code_destination                      | Portability number was found with wrong bank code destination| Teimosinha          |
| PH              | wrong_benefit_number_on_portability              | Portability number was found with wrong benefit number      | Teimosinha           |
| PI              | invalid_contract_total_amount         | Reservation contract total amount should be greater than Dataprev reference amount     | Teimosinha           |

### Tabela de retorno de sucesso - averbação {#dataprev_response_enumerator_success}
| Código Dataprev | Enumerador               | Descrição                               |
|--------|--------------------------|-----------------------------------------|
| BD     | successfully_included    | Inclusion has been successfully done    |
| BF     | successfully_removed     | Removal has been successfully done      |
| BR     | successfully_reactivated | Reactivation has been successfully done |
| BS     | successfully_suspended   | Suspension has been successfully done   |

### Tabela de retorno de erros na consulta de saldo {#dataprev_balance_errors_enumerators}
| Código | Enumerador                            | Descrição                                                                       |
|--------|---------------------------------------|---------------------------------------------------------------------------------|
| CR     | not_found_legal_representative        | no legal representative for the beneficiary                                     |
| CD     | inexistent_beneficiary                | no beneficiary found                                                            |
| AS     | benefity_without_legal_representative | beneficiary does not have a legal representative                                |
| BI     | inexistent_benefit                    | no benefit found                                                                |
| D1     | inconsistent_balance_benefit_data     | The balance benefit data registered is either inconsistent, null or incomplete. |

### Tabela de retorno de erros na consulta de benefícios {#dataprev_benefits_errors_enumerators}
| Código | Enumerador                            | Descrição                                                                       |
|--------|---------------------------------------|---------------------------------------------------------------------------------|
| CR     | not_found_legal_representative        | no legal representative for the beneficiary                                     |
| CD     | inexistent_beneficiary                | no beneficiary found                                                            |
| AS     | benefity_without_legal_representative | beneficiary does not have a legal representative                                |

### Tabela de situação de benefícios {#benefit_situation_enumerator}
| Items |
|-------|
| active |
| excluded |
| terminated |
| suspended |
| suspended_by_CONPAG |
| terminated_by_SISOBI |
| receiving_monthly_recover_6_months |
| receiving_monthly_recover_18_months |
| suspended_by_name_error |
| suspended_by_credentialed_payer |
| suspended_by_inspection |
| suspended_by_audit |
| terminated_by_inspection |
| terminated_by_audit |
| receiving_monthly_recover_6_months_inspection |
| receiving_monthly_recover_18_months_inspection |
| suspended_by_SISOBI |
| canceled_by_audit |

### Tabela de status de benefícios {#benefit_status_enumerator}

| Enumerador | Descrição                                           |
|------------|-----------------------------------------------------|
| Elegible   | Elegível para empréstimo                            |
| Inelegible | Benefício inelegível para empréstimo                |
| Blocked    | Benefício elegível, porém bloqueado para empréstimo |

### Tabela de tipos de bloqueio {#block_type_enumerator}

| Enumerador | Descrição                                           |
|------------|-----------------------------------------------------|
| 0          | Sem bloqueio                                        |
| 1          | Bloqueado pelo Segurado                             |
| 2          | Bloqueado por TBM                                   |
| 3          | Bloqueado na Concessão                              |

### Tabela de tipos de politicamente exposto {#politically_exposed_enumerator}

| Enumerador | Descrição                                           |
|------------|-----------------------------------------------------|
| 0          | Pessoa Não Exposta Politicamente                    |
| 1          | Pessoa Exposta Politicamente - Nível 1              |

### Tabela de benefícios {#benefit_type_enumerator}

| código   | benefício                                                |
| --- | ------------------------------------------------ |
| 1   | pension_by_death_rural_worker                    |
| 2   | pension_by_death_accident_rural_worker           |
| 3   | pension_by_death_rural_employer                  |
| 4   | retirement_invalidity_rural_emploee              |
| 5   | retirement_invalidity_accident_rural_worker      |
| 6   | retirement_invalidity_rural_employer             |
| 7   | retirement_by_eldness_rural_worker               |
| 8   | retirement_by_age_rural_employer                 |
| 9   | complement_by_work_accident_rural_worker         |
| 11  | support_invalidity_rural_worker                  |
| 12  | support_by_age_rural_worker                      |
| 13  | aid_sickness_rural_worker                        |
| 15  | aid_time_off_rural_worker                        |
| 16  | aid_federal                                      |
| 17  | international_agreement                          |
| 18  | inclusion_benefit                                |
| 19  | pension_student_law7004                          |
| 20  | pension_by_death_diplomat                        |
| 21  | pension_by_death                                 |
| 22  | pension_by_death_statute                         |
| 23  | pension_by_death_veteran                         |
| 24  | pension_special_institutional_act                |
| 25  | aid_time_off                                     |
| 26  | pension_by_death_special_law593                  |
| 27  | pension_by_death_federal_emploee                 |
| 28  | pension_by_death_general_regime_law20465         |
| 29  | pension_by_death_marine_veteran                  |
| 30  | monthly_income_lifetime_invalidity               |
| 31  | aid_sickness                                     |
| 32  | retirement_invalidity_social_security            |
| 33  | retirement_invalidity_aeronautic                 |
| 34  | retirement_invalidity_marine_law1756             |
| 35  | aid_sickness_veteran                             |
| 36  | aid_social_security_accident                     |
| 37  | retirement_capin_extra_emploee                   |
| 38  | retirement_federal_extra_emploee                 |
| 39  | aid_invalidity_student_law7004                   |
| 40  | monthly_income_lifetime_by_age_upper70_law6179   |
| 41  | retirement_by_age                                |
| 42  | retirement_by_contribution_time                  |
| 43  | retirement_by_time_of_service_veteran            |
| 44  | retirement_special_aeronautic                    |
| 45  | retirement_by_time_of_service_journalist         |
| 46  | retirement_special                               |
| 47  | allowance_25                                     |
| 48  | allowance_20                                     |
| 49  | retirement_ordinary                              |
| 50  | aid_sickness_extinct_basic_plan                  |
| 51  | retirement_invalidity_extinct_basic_plan         |
| 52  | retirement_by_age_extinct_basic_plan             |
| 53  | aid_time_off_extinct_basic_plan                  |
| 54  | pension_indemnity_federal                        |
| 55  | pension_by_death_extinct_basic_plan              |
| 56  | pension_lifetime_syndrome_thalidomide            |
| 57  | retirement_by_teacher_labor_time                 |
| 58  | retirement_anisty                                |
| 59  | pension_by_death_amnesty                         |
| 60  | indemnity                                        |
| 61  | aid_birth                                        |
| 62  | aid_funeral                                      |
| 63  | aid_funeral_rural_worker                         |
| 64  | aid_funeral_rural_employer                       |
| 65  | savings_special_autarchy                         |
| 67  | savings_mandatory_ipase_law5128                  |
| 68  | savings_special_retirement_ps_affiliated_upper60 |
| 69  | savings_student_law7004                          |
| 70  | restitution                                      |
| 71  | monthly_income                                   |
| 72  | retirement_by_time_of_service_law1756            |
| 73  | monthly_income_family_statute                    |
| 74  | complement_pension_federal                       |
| 75  | complement_retirement_federal                    |
| 76  | monthly_income_statute                           |
| 77  | monthly_income_sinpas_family_statute             |
| 78  | retirement_by_age_law1756                        |
| 79  | advantage                                        |
| 80  | monthly_income_maternity                         |
| 81  | compulsory_retirement                            |
| 82  | retirement_by_time_of_service_sasse              |
| 83  | retirement_invalidity_ex_sasse                   |
| 84  | pension_by_death_sasse                           |
| 85  | pension_lifetime_rubber_tapper_law7986           |
| 86  | pension_lifetime_rubber_tapper_dependent_law7986 |
| 87  | continuous_aid_physical_disabilities             |
| 88  | continuous_aid_eldness                           |
| 89  | pension_special_hemodialysis_victim_caruaru      |
| 90  | medic_assistency_work_accident                   |
| 91  | aid_sickness_by_work_accident                    |
| 92  | retirement_invalidity_work_accident              |
| 93  | pension_by_death_work_accident                   |
| 94  | aid_work_accident                                |
| 95  | aid_additional_work_accident                     |
| 96  | pension_special_leprosy_law11520                 |
| 97  | savings_by_death_work_accident                   |
| 98  | aid_longshoreman                                 |
| 99  | time_off_15                                      |

---

# Recalculate Credit Operation

URL: /en/documentation/guides/INSS/new-credit-and-refinancing/recalculate

Recalculate Credit Operation

Recalculates the financial terms of an existing credit operation based on a **new installment face value**. Ideal for when the beneficiary's consignable margin changes and the installment amount needs to be adjusted.

:::tip Advantages
- **Preserves original terms** — interest rates, tenors, and operation structure are maintained; only the installment value changes
- **Immediate response** — the operation is recalculated and returned in the same call, no async processing
- **Automatic validation** — the endpoint verifies preconditions, rate limits, and INSS rules before applying
:::

## Request

ENDPOINT /v2/credit_operation/ CREDIT_OPERATION_KEY /recalculate
METHOD POST

### Path Params

credit_operation_key
string (UUID)
required
Unique key of the credit operation to be recalculated.

### Body Params

installment_face_value
number
required
New installment face value. Must be less than or equal to the original value and above the minimum threshold.

```python
{
    "installment_face_value": 180.50
}
```

:::caution Warning
The new `installment_face_value` can only be **reduced** from the original value. The endpoint rejects values above the original or outside the allowed variance range.
:::

### Preconditions

The operation must meet **all** of the following conditions to be recalculated:

| Condition | Error if not met |
|-----------|------------------|
| Operation exists | [`COP000027`](#COP000027) (404) |
| Requester owns the operation | [`QIT000005`](#QIT000005) (403) |
| Collateral type is `social_security` | [`COP000276`](#COP000276) |
| Status: `waiting_signature`, `issued`, or `canceled` | [`COP000489`](#COP000489) |
| Collateral not yet constituted | [`COP000489`](#COP000489) |
| Operation type: `structured_operation` | [`COP000489`](#COP000489) |
| Disbursement end date not expired | [`COP000489`](#COP000489) |
| Original operation has an `installment_face_value` | [`COP000489`](#COP000489) |
| New value within allowed limits | [`COP000490`](#COP000490) |

## Response

STATUS 200

Returns the full recalculated credit operation object — same structure as the [credit operation query by key](/documentation/emissao_de_divida/consulta_por_credit_operation_key).

## Errors

| HTTP Code | QI Code | Description | Translation |
|-----------|---------|-------------|-------------|
| 404 | <span id="COP000027">`COP000027`</span> | Credit Operation not found | Operação não encontrada |
| 403 | <span id="QIT000005">`QIT000005`</span> | Selected agent does not own this item | O agente selecionado não é dono do item |
| 400 | <span id="COP000276">`COP000276`</span> | Collateral type doesn't allow recalculation | Garantia do contrato não permite que a operação seja recalculada |
| 400 | <span id="COP000335">`COP000335`</span> | Assignment amount exceeds operation final amount | O valor de cessão é superior ao valor final da operação |
| 400 | <span id="COP000339">`COP000339`</span> | Final disbursement amount cannot be negative | O valor de desembolso final não pode ser negativo |
| 400 | <span id="COP000489">`COP000489`</span> | Operation not allowed to be recalculated | A operação de crédito não está permitida para ser recalculada |
| 400 | <span id="COP000490">`COP000490`</span> | Installment face value variance not allowed | A variação do valor da parcela não está permitida |

Detailed reasons for error COP000489

The `COP000489` code is returned for different unmet preconditions. The `reason` field in the response indicates the specific cause:

| Reason | Description |
|--------|-------------|
| Invalid status | Credit operation status does not allow recalculation |
| Collateral already constituted | The credit operation collateral has already been constituted |
| Invalid operation type | Credit operation type does not allow recalculation |
| Disbursement date expired | The credit operation disbursement end date is in the past |
| Missing installment value | Installment face value was not informed in the original operation |

---

# Anuência (pending confirmation)

URL: /en/documentation/guides/INSS/pending_confirmation

Anuência (pending confirmation)

Após a averbação, a reserva entra em **`pending_confirmation`** aguardando a confirmação do beneficiário no INSS. A QI Tech notifica o parceiro via webhook e segue consultando a Dataprev até a confirmação, recusa ou expiração do prazo.

:::info Escopo
Aplica-se a **crédito novo** e **refinanciamento**. **Portabilidade não exige anuência.**
:::

:::tip Vigência
**19/05/2026 às 06:00.** Mapeie o novo webhook para acionar o beneficiário com agilidade.
:::

## Fluxo

- Averbação bem-sucedida → reserva entra em `pending_confirmation`.
- QI Tech envia o webhook `laas.social_security.reservation.status_change` e dispara SMS ao beneficiário.
- Consulta à Dataprev **a cada 3 horas**; **cada consulta redispara o webhook**.
- SMS adicional ao beneficiário **uma vez por dia** enquanto a operação estiver pendente.
- **Prazo máximo:** 5 dias corridos. Se expirar ou for recusada, ocorre **desaverbação** automática.

| Desfecho | Webhook |
|---|---|
| Beneficiário confirma | `credit_operation.collateral` com `collateral_constituted: true` |
| Beneficiário recusa | `debt` / `canceled` — `social_security_confirmation_denied_by_beneficiary` |
| Prazo expira | `debt` / `canceled` — `social_security_confirmation_expired` |

## Webhook — anuência pendente

WEBHOOK_TYPE laas.social_security.reservation.status_change
STATUS pending_confirmation

```json
{
  "key": "<CREDIT-OPERATION-KEY>",
  "webhook_type": "laas.social_security.reservation.status_change",
  "status": "pending_confirmation",
  "event_datetime": "2026-05-19 06:15:00",
  "data": {
      "confirmation_deadline": "2026-05-20T14:25:03Z"
  }
}
```

## Webhook — anuência concluída

Mesmo webhook de averbação já existente. Veja [Sucesso na averbação](/documentation/guides/INSS/new-credit-and-refinancing/end-to-end#sucesso-na-averbação).

WEBHOOK_TYPE credit_operation.collateral

```json
{
  "key": "<CREDIT-OPERATION-KEY>",
  "data": {
    "collateral_type": "social_security",
    "collateral_constituted": true
  },
  "event_time": "2026-05-19 12:42:00",
  "webhook_type": "credit_operation.collateral"
}
```

## Webhook — recusa ou expiração

Mesmo webhook de cancelamento já existente, distinguindo o motivo via `cancel_reason_enumerator`:

| Enumerador | Quando |
|---|---|
| `social_security_confirmation_denied_by_beneficiary` | Beneficiário recusou a confirmação |
| `social_security_confirmation_expired` | Prazo de 5 dias expirou |

WEBHOOK_TYPE debt
STATUS canceled

```json
{
  "key": "<CREDIT-OPERATION-KEY>",
  "status": "canceled",
  "data": {
    "cancel_reason": "Beneficiário recusou a confirmação da reserva",
    "cancel_reason_enumerator": "social_security_confirmation_denied_by_beneficiary"
  },
  "webhook_type": "debt",
  "event_datetime": "2026-05-21 09:10:00"
}
```

## Testando em sandbox

Em sandbox o desfecho da anuência é simulado pelo **último dígito do número do benefício** — terminados em `0`, `1`, `3`, `5` ou `6` confirmam automaticamente; `9` recusa; `7` expira; `8`, `2` e `4` permanecem pendentes. Tabela completa em [Mocks (Sandbox)](/documentation/guides/INSS/mocks-sandbox#anuencia).

## Forçar consulta imediata (Fura-fila)

O [Fura-fila](/documentation/guides/INSS/reservations/priority-request) passa a aceitar reservas em `pending_confirmation`, forçando uma consulta imediata à Dataprev.

:::warning Consumo de ficha
Se a reserva **ainda não tiver sido confirmada**, retorna `ReservationFailed` com `last_response = confirmation_still_pending` e **consome uma ficha** do balde. Ajuste sua lógica de retentativas.
:::

---

# Alterando o Cessionário

URL: /en/documentation/guides/INSS/portability+refinancing/alterando-cessionario

Alterando o Cessionário

Em uma operação de Portabilidade + Refinanciamento, é possível definir um cessionário diferente do padrão no momento de aceite do refinanciamento. Isso é feito por meio do campo `purchaser_document_number` no corpo da requisição de aceite.

## Endpoint de Aceite

O cessionário é configurado ao aceitar a operação de refinanciamento (Troco) via:

- MÉTODO POST
- ENDPOINT /v2/credit_transfer/proposal/**\{proposal_key\}**/refinancing_credit_operation/acceptance

Consulte o [Fluxo Completo](./end-to-end) para o contexto completo da chamada de aceite, incluindo os demais campos obrigatórios.

## Campo `purchaser_document_number`

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `purchaser_document_number` | string | Opcional | CNPJ (14 dígitos) do cessionário a ser utilizado nesta operação. Sobrescreve o cessionário padrão do parceiro. |

:::info
Se o campo `purchaser_document_number` for omitido, a operação utilizará o cessionário padrão configurado para o parceiro na QI Tech.
:::

:::caution
O campo `purchaser_document_number` só pode ser definido no momento do aceite (POST). Não é possível alterá-lo posteriormente via endpoints de correção (PUT).
:::

## Exemplo de Request Body

O exemplo abaixo destaca o uso do campo `purchaser_document_number` junto aos campos `financial` e `disbursement_bank_accounts`:

```json
{
    "financial": {
        "installment_face_value": 379.87,
        "monthly_interest_rate": 0.0166,
        "number_of_installments": 84,
        "limit_days_to_disburse": 7,
        "disbursement_date": "2024-07-02",
        "rebates": []
    },
    "disbursement_bank_accounts": [
        {
            "document_number": "92093764000197",
            "branch_number": "0001",
            "name": "TESTE LTDA",
            "percentage_receivable": 100,
            "account_number": "120012",
            "account_digit": "3",
            "bank_code": "329"
        }
    ],
    "purchaser_document_number": "28534595027164"
}
```

O campo `purchaser_document_number` deve conter o CNPJ do cessionário desejado, com 14 dígitos numéricos sem formatação.

---

# Consultas e Enumeradores

URL: /en/documentation/guides/INSS/portability+refinancing/consultas-e-enumeradores

Consultas e Enumeradores

Endpoints auxiliares e tabelas de referência para o fluxo de Port+Refin INSS.

## 9 - Consulta de Lista de Participantes do CTC - CIP:

        **Request**

- MÉTODO GET
- ENDPOINT /v2/credit_transfer/participants

Testar no Playground

        *Response:*

**response.json**

```json
[
    {
        "name": "\<NOME DO BANCO\>",
        "bank_code": "\<CÓDIGO DO BANCO\>",
        "ispb": "\<BASE DO CNPJ DO BANCO\>"
    }
]
 
```

## 10 - Recuperar resposta da última request

O last response é uma forma de mapear, de forma simples e objetiva, a resposta da comunicação entre a QI e a Dataprev, possibilitando saber quando essa requisição foi feita e qual o retorno obtido (através de um enumerador). Os enumeradores estão diretamente relacionados aos códigos de retorno da Dataprev e são divididos em duas formas: "errors" e "success". 

Cada enumerador tem uma descrição detalhada e o código de referência da Dataprev. Podemos conferir abaixo, com mais detalhes, como serão apresentados os dados do last response.

### Casos de sucesso

#### Request - Credit Transfer
ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /CREDIT-OPERATION-TYPE/collateral
MÉTODO GET

#### PATH PARAMETERS credit-operation-type
| Enumerador               					| Descrição                  		|
|-------------------------------------------|--------------------------------|
| refinancing_credit_operation  			| Operação de refinanciamento    |
| portability_credit_operation     			| Operação de portabilidade      |

#### Response

Response Body

```json
{
   "collateral_data":{
      "benefit_number":1976703155,
      "state":"PI",
      "last_response":{
         "success":[
            {
               "enumerator":"succesfully_included",
               "reservation_method":"portability"
            }
         ]
      },
      "last_response_event_datetime":"2023-05-22T19:13:02Z",
      "status":"reserved"
   },
   "collateral_constituted":true,
   "collateral_type":"social_security"
}
```

### Detalhamento de campos no retorno da request
| Campo                     | Descrição                           | Valores                          |
|---------------------------|-------------------------------------|----------------------------------|
| enumerator                | Retorno mapeado do código Dataprev  | [Enumeradores](#dataprev_response_enumerator_success)|
| reservation_method        | Método de averbação da reserva      | portability, new_credit, refinancing|

### Casos de erro

#### Request
ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /CREDIT-OPERATION-TYPE/collateral
MÉTODO GET

#### Response

Response Body

```json
{
  "collateral_constituted": false,
  "collateral_type": "type",
  "updated_at": "2023-05-24 19:13:02",
  "collateral_data": {
    "state": "SP",
    "benefit_number": 1976703155,
    "status": "pending_reservation",
    "last_response": {
      "errors": [
        {
          "enumerator": "benefit_blocked_by_tbm",
          "reservation_method" : "portability"
        },
        {
          "enumerator": "benefit_blocked_by_tbm",
          "reservation_method" : "new_credit"
        }
      ]
    },
    "last_response_event_datetime": "2023-05-22T19:13:02Z"
  }
}
```

### Detalhamento de campos no webhook de falha
| Campo                     | Descrição                           | Valores                          |
|---------------------------|-------------------------------------|----------------------------------|
| enumerator                | Retorno mapeado do código Dataprev  | [Enumeradores](#dataprev_response_enumerator_errors) |
| reservation_method        | Método de averbação da reserva      | portability, new_credit, refinancing|
## 11 - Webhook de resposta da última tentativa de averbação

Caso a operação não tenha sucesso na averbação, a mesma ficará em retentativa e será enviado o seguinte webhook, detalhando o motivo da não averbação, o horário desta tentativa e o método de averbação utilizado:

**Ver exemplos de webhook**

**Webhook portabilidade**

WEBHOOK_TYPE credit_transfer.proposal.credit_operation

  ```json

  {
    "webhook_type": "credit_transfer.proposal.collateral",
    "proposal_key": "\<PROPOSAL-KEY\>",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
      "credit_operation_type": "portability",
      "credit_operation_key": "\<CREDIT-OPERATION-KEY\>",
      "collateral_type": "social_security",
      "collateral_constituted": false,
      "collateral_data": {
        "status": "pending_reservation",
        "last_response": {
          "errors": [{
            "enumerator": "consignable_margin_excceded"
          }]
        },
        "last_response_event_datetime": "2023-05-22T19:13:02Z",
        "reservation_method": "new_credit",
      }
    }
  }

  ```
**Webhook refinanciamento**

WEBHOOK_TYPE credit_operation.collateral

  ```json

  {
    "webhook_type": "credit_operation.collateral",
    "key": "\<CREDIT-OPERATION-KEY\>",
    "event_time": "2022-11-24T15:42:12",
    "data": {
      "collateral_type": "social_security",
      "collateral_constituted": false,
      "collateral_data": {
        "status": "pending_reservation",
        "last_response": {
          "errors": [{
            "enumerator": "consignable_margin_excceded"
          }]
        },
        "last_response_event_datetime": "2023-05-22T19:13:02Z",
        "reservation_method": "refinancing",
      }
    }
  }

  ```

### Detalhamento de campos no webhook de falha
| Campo                     | Descrição                           | Valores                          |
|---------------------------|-------------------------------------|----------------------------------|
| enumerator                | Retorno mapeado do código Dataprev  | [Enumeradores](#dataprev_response_enumerator_errors) |
| reservation_method        | Método de averbação da reserva      | portability, new_credit, refinancing|

## 12 - Consulta de portabilidade de origem

É possível consultar os dados da portabilidade do banco de origem como, por exemplo, o número do benefício, a data de início da portabilidade, o número dos contratos excluídos, os valores das parcelas desaverbadas, ultima parcela paga, data de exclusão, entre outros.

        **Request**
- MÉTODO POST
- ENDPOINT /social_security/reservation/external_key/CREDIT-OPERATION-KEY/portability_origin_contract

        *Payload:*

**payload.json**

```json
{
    "request_type":"portability_number",
    "portability_number": "202402070000298096242"
}

```

        **Response**

- MÉTODO POST
- ENDPOINT /social_security/reservation/external_key/CREDIT-OPERATION-KEY/portability_origin_contract

**body.json**

```json
{
    "origin_contract_request_key": "9bb68c89-4b88-400d-9359-99ad8d42a69e",
    "status": "pending_search",
    "status_events": [
        {
            "status": "pending_search"
        }
    ]
}

```

Em caso de sucesso na consulta do número de benefício

         **Webhook**

- WEBHOOK_TYPE social_security_portability_origin_contract_request
- STATUS Success

**body.json**

```json
{
    "webhook": {
        "key": "25e93655-4713-488b-8800-7ac4fddf745f",
        "data": {
          "portability_number": 9223372036854776000,
          "portability_status": "open",
          "benefit_number": 1544326820,
          "portability_start_date": "2024-02-22",
          "deleted_contracts": [
            {
              "origin_bank": {
                "bank_code": 752,
                "name": "CETELEM-BNP"
              },
              "contract_number": "22-844817807/20",
              "last_installment_paid": 84,
              "exclusion_date": "22022024",
              "period_amount": 165.73
            }
          ]
        },
        "status": "success",
        "webhook_type": "social_security_portability_origin_contract_request",
        "event_datetime": "2024-02-26T21:36:22"
    }
}

```

Em caso de falha na consulta do número de benefício

        **Webhook**

- WEBHOOK_TYPE social_security_portability_origin_contract_request
- STATUS Failure

**body.json**

```json
{
    "webhook": {
        "key": "522b5d7d-2dfc-4e92-99b7-d4df3d97edb2",
        "data": {
            "enumerator": "invalid_bank_code",
            "description": "Invalid bank code"
        },
        "status": "failure",
        "webhook_type": "social_security_portability_origin_contract_request",
        "event_datetime": "2024-02-26T21:36:22"
    }
}

```

## 13. Diminuir o valor das parcelas

Este endpoint permite a redução do valor das parcelas de um contrato de portabilidade de crédito. Esta funcionalidade é especialmente útil em casos onde a margem consignável é excedida devido ao banco de origem desaverbar uma quantia menor do que a esperada.

        **Request**
- MÉTODO PUT
- ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /portability_credit_operation

        *Payload:*

**payload.json**

```json
{
    "installment_face_value": 382.18
}

```

        **Response sucesso - HTTP 200**

**body.json**

```json
{
        "credit_operation_key": "7aa77bca-c724-4c1a-bfae-9b1b7bd81ab2",
        "contract_number": "0000000007/WO",
        "document_key": "045a8f35-6170-4112-8d83-29a753d0c78e",
        "document_url": "http://teste.com",
        "signed_url": "signed_url_test",
        "credit_operation_status": "waiting_signature",
        "fine_configuration": {
            "contract_fine_rate": 0.02,
            "interest_base": "calendar_days",
            "monthly_rate": 0.01
        },
        "disbursement_accounts": [
            {
                "account_digit": "3",
                "account_branch": "0001",
                "account_number": "94134",
                "ispb": "32402502",
                "name": "Wilker Teste",
                "document_number": "37197645832"
            }
        ],
        "disbursement_options": [
            {
                "prefixed_interest_rate": {
                    "annual_rate": 3.0,
                    "daily_rate": 0.00385824,
                    "interest_base": "calendar_days",
                    "monthly_rate": 0.12246205
                },
                "total_iof": 7.03,
                "external_contract_fee_amount": 0.0,
                "external_contract_fees": [],
                "contract_fee_amount": 0.0,
                "number_of_installments": 3,
                "contract_fees": [],
                "disbursed_issue_amount": 1000.0,
                "issue_amount": 1007.03,
                "disbursement_date": "2022-08-24",
                "cet": 12.6,
                "annual_cet": 315.3944,
                "installments": [
                    {
                        "business_due_date": "2022-08-30",
                        "calendar_days": 5,
                        "due_date": "2022-08-29",
                        "due_principal": 1007.03,
                        "installment_number": 1,
                        "pre_fixed_amount": 84.43554587915118,
                        "principal_amortization_amount": 297.73445412084885,
                        "total_amount": 382.17,
                        "workdays": 3
                    },
                    {
                        "business_due_date": "2022-09-30",
                        "calendar_days": 31,
                        "due_date": "2022-09-29",
                        "due_principal": 709.2955458791512,
                        "installment_number": 2,
                        "pre_fixed_amount": 47.97894031795043,
                        "principal_amortization_amount": 334.19105968204957,
                        "total_amount": 382.17,
                        "workdays": 22
                    },
                    {
                        "business_due_date": "2022-11-01",
                        "calendar_days": 32,
                        "due_date": "2022-10-31",
                        "due_principal": 375.1044861971016,
                        "installment_number": 3,
                        "pre_fixed_amount": 7.055513802898396,
                        "principal_amortization_amount": 375.1044861971016,
                        "total_amount": 382.16,
                        "workdays": 21
                    }
                ],
                "final_disbursement_amount": 997.87
            }
        ],
        "final_disbursement_amount": 997.87,
        "collateral_is_constituted": false
    }
```

## 14. Mapeamento de enumeradores

### Enumeradores Retention Reason {#retention_reason_enumerator}
| Enumerador                               | Descrição                                              |
|------------------------------------------|--------------------------------------------------------|
| **issuer_retention**                     | Retenção do Cliente                                    |
| **different_from_original**              | Condições da proposta divergentes do contrato original |
| **issuer_lawsuit**                       | Cliente com ação judicial                              |
| **insurance_in_progress**                | Indenização de seguro em andamento                     |
| **collateral_in_execution**              | Garantia em Execução                                   |
| **contract_not_found**                   | Contrato não encontrado                                |
| **invalid_contract_type**                | Tipo de contrato inválido                              |
| **portability_in_progress**              | Portabilidade em andamento                             |
| **assigned_contract**                    | Contrato cedido                                        |
| **issuer_document_number_invalid**       | CPF não é do contrato                                  |
| **unrelated_issuer_document_number**     | CPF informado não é o do titular                       |
| **assigned_without_co_obligation**       | Contrato cedido sem coobrigação                        |
| **fgts_in_use**                          | FGTS AMORTIZAR em uso                                  |
| **fgts_funding**                         | FGTS funding                                           |
| **portability_not_requested**            | O cliente não solicitou a portabilidade                |
| **wrong_original_financial_institution** | IF Credora Original Incorreta                          |

### Tabela de retorno de erros Dataprev - averbação {#dataprev_response_enumerator_errors}
| Código Dataprev | Enumerador                                       | Descrição                                                   | Ação Qi              |
|-----------------|--------------------------------------------------|-------------------------------------------------------------|----------------------|
| HW              | consignable_margin_excceded                      | Exceeded consignable margin                                 | Teimosinha           |
| IT              | benefit_blocked_by_tbm                           | Benefit blocked due to benefit transfer                     | Teimosinha           |
| IE              | benefit_blocked_by_beneficiary                   | Benefit blocked by beneficiary                              | Teimosinha           |
| AN              | invalid_disbursement_account                     | Invalid disbursement bank account                           | Teimosinha             |
| HX              | reservation_already_included                     | Reservation already included                                | Confirmar averbação  |
| IF              | benefit_blocked_by_granting_process              | Benefit blocked during granting process                     | Teimosinha           |
| AV              | processing_payroll                               | Operation couldn`t be done during processing payroll period | Teimosinha           |
| OF              | invalid_cbc                                      | Invalid cbc                                                 | Teimosinha           |
| IA              | first_name_mismatch                              | First name mismatch benefit owner or legal representative   | Teimosinha           |
| OS              | legal_representative_document_number_mismatch    | Document number mismatch legal representative               | Teimosinha           |
| AY              | invalid_state                                    | Invalid state                                               | Teimosinha           |
| HZ              | operation_not_allowed_on_this_reservation_status | Operation couldn`t be done with current reservation status  | Teimosinha           |
| AP              | invalid_contract_date                            | Accrual, end or start contract date is invalid              | Teimosinha           |
| GA              | required_fields_missing                          | Required fields are missing                                 | Teimosinha           |
| BC              | cbc_missing                                      | CBC is missing                                              | Teimosinha           |
| NC              | contract_number_missing                          | Contract number is missing                                  | Teimosinha           |
| NB              | benefit_number_missing                           | Benefit number is missing                                   | Teimosinha           |
| CA              | invalid_bank_code                                | Invalid bank code                                           | Teimosinha           |
| HR              | exceeded_number_of_allowed_contracts             | Amount of contracts is above the limit                      | Teimosinha           |
| PV              | invalid_image_format                             | Image with wrong format                                     | Teimosinha           |
| IR              | operation_not_allowed_IR                         | Operation date is greater than benefit expiration           | Teimosinha             |
| PK              | wrong_bank_code_destination                      | Portability number was found with wrong bank code destination| Teimosinha          |
| PH              | wrong_benefit_number_on_portability              | Portability number was found with wrong benefit number      | Teimosinha           |
| PI              | invalid_contract_total_amount         | Reservation contract total amount should be greater than Dataprev reference amount     | Teimosinha           |

:::danger Atenção!
Todas as taxas e valores do contrato são validados no momento da criação da reserva.

A crítica "invalid_contract_total_amount" ocorre nos casos em que os contratos se estendem por muito tempo sem serem averbados, o que impacta os valores previamente estabelecidos.
:::

### Tabela de retorno de sucesso - averbação {#dataprev_response_enumerator_success}
| Código Dataprev | Enumerador               | Descrição                               |
|--------|--------------------------|-----------------------------------------|
| BD     | successfully_included    | Inclusion has been successfully done    |
| BF     | successfully_removed     | Removal has been successfully done      |
| BR     | successfully_reactivated | Reactivation has been successfully done |
| BS     | successfully_suspended   | Suspension has been successfully done   |

### Tabela de retorno de erros na consulta de saldo {#dataprev_balance_errors_enumerators}
| Código | Enumerador                            | Descrição                                                                       |
|--------|---------------------------------------|---------------------------------------------------------------------------------|
| CR     | not_found_legal_representative        | no legal representative for the beneficiary                                     |
| CD     | inexistent_beneficiary                | no beneficiary found                                                            |
| AS     | benefity_without_legal_representative | beneficiary does not have a legal representative                                |
| BI     | inexistent_benefit                    | no benefit found                                                                |
| D1     | inconsistent_balance_benefit_data     | The balance benefit data registered is either inconsistent, null or incomplete. |

### Tabela de retorno de erros na consulta de benefícios {#dataprev_benefits_errors_enumerators}
| Código | Enumerador                            | Descrição                                                                       |
|--------|---------------------------------------|---------------------------------------------------------------------------------|
| CR     | not_found_legal_representative        | no legal representative for the beneficiary                                     |
| CD     | inexistent_beneficiary                | no beneficiary found                                                            |
| AS     | benefity_without_legal_representative | beneficiary does not have a legal representative                                |

### Tabela de situação de benefícios {#benefit_situation_enumerator}
| Items |
|-------|
| active |
| excluded |
| terminated |
| suspended |
| suspended_by_CONPAG |
| terminated_by_SISOBI |
| receiving_monthly_recover_6_months |
| receiving_monthly_recover_18_months |
| suspended_by_name_error |
| suspended_by_credentialed_payer |
| suspended_by_inspection |
| suspended_by_audit |
| terminated_by_inspection |
| terminated_by_audit |
| receiving_monthly_recover_6_months_inspection |
| receiving_monthly_recover_18_months_inspection |
| suspended_by_SISOBI |
| canceled_by_audit |

### Tabela de status de benefícios {#benefit_status_enumerator}

| Enumerador | Descrição                                           |
|------------|-----------------------------------------------------|
| Elegible   | Elegível para empréstimo                            |
| Inelegible | Benefício inelegível para empréstimo                |
| Blocked    | Benefício elegível, porém bloqueado para empréstimo |

### Tabela de tipos de bloqueio {#block_type_enumerator}

| Enumerador | Descrição                                           |
|------------|-----------------------------------------------------|
| 0          | Sem bloqueio                                        |
| 1          | Bloqueado pelo Segurado                             |
| 2          | Bloqueado por TBM                                   |
| 3          | Bloqueado na Concessão                              |

### Tabela de tipos de politicamente exposto {#politically_exposed_enumerator}

| Enumerador | Descrição                                           |
|------------|-----------------------------------------------------|
| 0          | Pessoa Não Exposta Politicamente                    |
| 1          | Pessoa Exposta Politicamente - Nível 1              |

### Tabela de benefícios {#benefit_type_enumerator}

| código   | benefício                                   |
| --- | ------------------------------------------------ |
| 1   | pension_by_death_rural_worker                    |
| 2   | pension_by_death_accident_rural_worker           |
| 3   | pension_by_death_rural_employer                  |
| 4   | retirement_invalidity_rural_emploee              |
| 5   | retirement_invalidity_accident_rural_worker      |
| 6   | retirement_invalidity_rural_employer             |
| 7   | retirement_by_eldness_rural_worker               |
| 8   | retirement_by_age_rural_employer                 |
| 9   | complement_by_work_accident_rural_worker         |
| 11  | support_invalidity_rural_worker                  |
| 12  | support_by_age_rural_worker                      |
| 13  | aid_sickness_rural_worker                        |
| 15  | aid_time_off_rural_worker                        |
| 16  | aid_federal                                      |
| 17  | international_agreement                          |
| 18  | inclusion_benefit                                |
| 19  | pension_student_law7004                          |
| 20  | pension_by_death_diplomat                        |
| 21  | pension_by_death                                 |
| 22  | pension_by_death_statute                         |
| 23  | pension_by_death_veteran                         |
| 24  | pension_special_institutional_act                |
| 25  | aid_time_off                                     |
| 26  | pension_by_death_special_law593                  |
| 27  | pension_by_death_federal_emploee                 |
| 28  | pension_by_death_general_regime_law20465         |
| 29  | pension_by_death_marine_veteran                  |
| 30  | monthly_income_lifetime_invalidity               |
| 31  | aid_sickness                                     |
| 32  | retirement_invalidity_social_security            |
| 33  | retirement_invalidity_aeronautic                 |
| 34  | retirement_invalidity_marine_law1756             |
| 35  | aid_sickness_veteran                             |
| 36  | aid_social_security_accident                     |
| 37  | retirement_capin_extra_emploee                   |
| 38  | retirement_federal_extra_emploee                 |
| 39  | aid_invalidity_student_law7004                   |
| 40  | monthly_income_lifetime_by_age_upper70_law6179   |
| 41  | retirement_by_age                                |
| 42  | retirement_by_contribution_time                  |
| 43  | retirement_by_time_of_service_veteran            |
| 44  | retirement_special_aeronautic                    |
| 45  | retirement_by_time_of_service_journalist         |
| 46  | retirement_special                               |
| 47  | allowance_25                                     |
| 48  | allowance_20                                     |
| 49  | retirement_ordinary                              |
| 50  | aid_sickness_extinct_basic_plan                  |
| 51  | retirement_invalidity_extinct_basic_plan         |
| 52  | retirement_by_age_extinct_basic_plan             |
| 53  | aid_time_off_extinct_basic_plan                  |
| 54  | pension_indemnity_federal                        |
| 55  | pension_by_death_extinct_basic_plan              |
| 56  | pension_lifetime_syndrome_thalidomide            |
| 57  | retirement_by_teacher_labor_time                 |
| 58  | retirement_anisty                                |
| 59  | pension_by_death_amnesty                         |
| 60  | indemnity                                        |
| 61  | aid_birth                                        |
| 62  | aid_funeral                                      |
| 63  | aid_funeral_rural_worker                         |
| 64  | aid_funeral_rural_employer                       |
| 65  | savings_special_autarchy                         |
| 67  | savings_mandatory_ipase_law5128                  |
| 68  | savings_special_retirement_ps_affiliated_upper60 |
| 69  | savings_student_law7004                          |
| 70  | restitution                                      |
| 71  | monthly_income                                   |
| 72  | retirement_by_time_of_service_law1756            |
| 73  | monthly_income_family_statute                    |
| 74  | complement_pension_federal                       |
| 75  | complement_retirement_federal                    |
| 76  | monthly_income_statute                           |
| 77  | monthly_income_sinpas_family_statute             |
| 78  | retirement_by_age_law1756                        |
| 79  | advantage                                        |
| 80  | monthly_income_maternity                         |
| 81  | compulsory_retirement                            |
| 82  | retirement_by_time_of_service_sasse              |
| 83  | retirement_invalidity_ex_sasse                   |
| 84  | pension_by_death_sasse                           |
| 85  | pension_lifetime_rubber_tapper_law7986           |
| 86  | pension_lifetime_rubber_tapper_dependent_law7986 |
| 87  | continuous_aid_physical_disabilities             |
| 88  | continuous_aid_eldness                           |
| 89  | pension_special_hemodialysis_victim_caruaru      |
| 90  | medic_assistency_work_accident                   |
| 91  | aid_sickness_by_work_accident                    |
| 92  | retirement_invalidity_work_accident              |
| 93  | pension_by_death_work_accident                   |
| 94  | aid_work_accident                                |
| 95  | aid_additional_work_accident                     |
| 96  | pension_special_leprosy_law11520                 |
| 97  | savings_by_death_work_accident                   |
| 98  | aid_longshoreman                                 |
| 99  | time_off_15                                      |

---

# Manual Portabilidade + Refinanciamento do INSS

URL: /en/documentation/guides/INSS/portability+refinancing/end-to-end

:::danger Atenção!
Os webhooks da QI Tech não devem ser mapeadas de forma restrita. 
Campos adicionais podem ser incluídos aos payloads dos webhooks retornados em nossas APIs.
:::

:::info Reenvio de Webhooks
Você pode consultar e reenviar webhooks seguindo as instruções detalhadas na documentação: [Reenvio de Webhooks](/documentation/notificacoes/reenvio_de_notificacoes).
:::

Para iniciar o processo de Portabilidade + Refinanciamento - INSS, primeiramente é necessário coletar os dados do benefício para checagem da elegibilidade como também os dados da conta de pagamento do benefício. Os itens 1 e 2, descrevem o procedimento para consulta da lista de benefícios de um determinado beneficiário e procedimento para consulta dos dados do benefício. 

## 1 - Consulta da lista de benefícios com formalização do Termo de Autorização realizada através do parceiro: 

        **1.1.** Titular do benefício é o assinante do Termo de Autorização.

        **Request**

- ENDPOINT /social_security/benefits_request
- MÉTODO POST

        *Payload:*

**payload.json**

```json
{
	"document_number": "16514548091",
	"authorization_term": {
		"document_number": "16514548091",
		"signature": {
			"signer": {
				"name": "Nome Devedor",
				"phone": {
					"number": "887577622",
					"area_code": "19",
					"country_code": "55"
				},
				"document_number": "16514548091"
			},
			"authentication_type": "opt_in",
			"authenticity": {
				"timestamp": "2023-12-05T21:04:06",
				"ip_address": "200.223.171.82",
				"fingerprint": {
					"lat": "-44.00524157713981",
					"long": "-19.807649431219804",
					"name": "Nome Cliente",
					"model": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",
					"localeHashValue": "hash cliente"
				},
				"third_party_additional_data": {},
				"session_id": "ID DA SESSÃO DO ASSINANTE"
			},
			"signed_object": {
				"document_key": "cfbc8469-89ea-4a80-9f64-ba7b1566c68b"
			}
		}
	}
}
```

        **1.2.** Titular do benefício **não** é o assinante do Termo de Autorização (com representante legal).

:::caution Atenção 

Como o assinante do termo nesse caso é o representante legal, os dados que preenchem o objeto **signer**, são os dados do representante legal.

:::

        **Request**

- ENDPOINT /social_security/benefits_request
- MÉTODO POST

        *Payload:*

**payload.json**

```json
{
	"document_number": "16514548091",
	"authorization_term": {
		"document_number": "16514548091",
        "legal_representative_document_number": "70957091060",
		"signature": {
			"signer": {
				"name": "Nome Representante legal",
				"phone": {
					"number": "887577622",
					"area_code": "19",
					"country_code": "55"
				},
				"document_number": "70957091060"
			},
			"authentication_type": "opt_in",
			"authenticity": {
				"timestamp": "2023-12-05T21:04:06",
				"ip_address": "200.223.171.82",
				"fingerprint": {
					"lat": "-44.00524157713981",
					"long": "-19.807649431219804",
					"name": "Nome Cliente",
					"model": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",
					"localeHashValue": "hash cliente"
				},
				"third_party_additional_data": {},
				"session_id": "ID DA SESSÃO DO ASSINANTE"
			},
			"signed_object": {
				"document_key": "cfbc8469-89ea-4a80-9f64-ba7b1566c68b"
			}
		}
	}
}

```

:::caution Atenção
Nos casos em que houver representante legal, é necessário preencher o campo **"legal_representative_document_number"** com o CPF do representante legal, e os dados do objeto **"signer"** devem ser preenchidos com os dados do mesmo.
:::

--- 

        "**document_key**": utilizar a GUID retornada no endpoint /upload

:::info
**Ao invés** da chave do documento pdf assinado no objeto **“authorization_term.signed_object.document_key"**, também é possível enviar o texto corrido do Termo de Autorização, através do objeto **"authorization_term.signed_object.raw_text"**.
:::

        **Response**

- MÉTODO POST
- ENDPOINT social_security/benefits_request

**body.json**

```json

{
    "benefits_request_key": "c9d2aa83-006b-4753-92ad-64411a7aa700",
    "document_number": "18028522041",
    "status": "pending_authorization",
    "authorization_term": {
        "authorization_term_key": "5a7b6489-8a47-4b61-a85a-6986b058fda6",
        "status": "signed"
    },
    "status_events": [
        {
            "status": "pending_authorization",
            "event_date": "2023-12-22T16:12:50"
        }
    ]
}

```

Em caso de sucesso na consulta da lista de benefícios:

        **Webhook**

- WEBHOOK_TYPE social_security_benefits_request
- STATUS Success

        *Body:*

**body.json**

```json
{
    "webhook": {
        "key": "54cddd0f-b976-4266-91ea-90279bfb49a1",
        "data": [
            {
                "grant_date": [
                    "2010-10-18"
                ],
                "benefit_number": 2052711150,
                "benefit_status": "elegible"
            }
        ],
        "status": "success",
        "webhook_type": "social_security_benefits_request",
        "event_datetime": "2023-12-22T13:20:44"
    }
}
```

| Campo                     | Descrição                           | Valores                          |
|---------------------------|-------------------------------------|----------------------------------|
| benefit_number            | Número do beneficio                 | - |
| benefit_status            | Status do beneficio                 | [Enumeradores](#benefit_status_enumerator) |

Em caso de falha na consulta da lista de benefícios:

        **Webhook**

- WEBHOOK_TYPE social_security_benefits_request
- STATUS Failure

        *Body:*

**body.json**

```json

{
    "webhook": {
        "key": "0020653e-c3b0-4606-af31-2ea4a577a5ce",
        "data": {
            "enumerator": "inexistent_beneficiary",
            "description": "no beneficiary found"
        },
        "status": "failure",
        "webhook_type": "social_security_benefits_request",
        "event_datetime": "2023-12-22T15:46:31"
    }
}

```

### Detalhamento de campos no webhook de falha

| Campo                     | Descrição                           | Valores                          |
|---------------------------|-------------------------------------|----------------------------------|
| enumerator                | Retorno mapeado do código Dataprev  | [Enumeradores](#dataprev_benefits_errors_enumerators) |
### Simulando cenários de sucesso e insucesso na consulta de benefício em Sandbox:
A simulação de cenários é baseado no primeiro dígito do CPF informado na operação.

**11.1.** Para CPFs iniciados com o número 1, será retornado uma resposta assíncrona de sucesso através do Webhook.

**11.2.** Para os demais CPFs, será retornado uma resposta assíncrona de erro, baseado no primeiro dígito do CPF digitado, de acordo com a tabela abaixo.

| Início do CPF | Enumerador             | Descrição            |
|---------------|------------------------|----------------------|
| 2             | inexistent_beneficiary | no beneficiary found |

:::caution Atenção
Todos os CPFs que não tiverem um cenário mapeado para o primeiro dígito, receberão um webhook com um erro padrão de cenário de teste não mapeado. 

| Enumerador    | Descrição                                                        |
|---------------|------------------------------------------------------------------|
| mock_error    | Informed document number is not a valid mock on test environment |
:::

--- 

## 2 - Consulta de dados do benefício
        **2.1.** Consulta de dados do benefício com o Termo de Autorização previamente enviado.

        **Request**
- MÉTODO POST
- ENDPOINT /social_security/balance_request

        *Payload:*

**payload.json**

```json
{
    "document_number": "16514548091",
    "benefit_number": 2052711150
}

```

        **Response**

- MÉTODO POST
- ENDPOINT /social_security/balance_request

        *Body:*

**body.json**

```json
{
    "balance_request_key": "ffda1935-9cad-47df-b848-cd33c96024e4",
    "document_number": "16514548091",
    "status": "pending_authorization",
    "authorization_term": {
        "authorization_term_key": "19196811-366f-4422-a729-4d0aa552449b",
        "status": "allowed"
    },
    "status_events": [
        {
            "status": "pending_authorization",
            "event_date": "2023-12-22T16:18:18"
        }
    ]
}

```

        **2.2.** Consulta de dados do benefício com envio do Termo de Autorização.

        **Request**

- MÉTODO POST
- ENDPOINT /social_security/balance_request

        *Payload:*

**payload.json**

```json
{
    "document_number": "14950479032",
    "benefit_number": 22255220,
	"authorization_term": {
		"document_number": "14950479032",
                "legal_representative_document_number": "32866210050", // CPF do representante legal (caso aplicável)
		"signature": {
			"signer": {
				"name": "Nome Cliente",
				"phone": {
					"number": "887577622",
					"area_code": "19",
					"country_code": "55"
				},
				"document_number": "14950479032"
			},
			"authentication_type": "opt_in",
			"authenticity": {
				"timestamp": "2023-12-05T21:04:06",
				"ip_address": "200.223.171.82",
				"fingerprint": {
					"lat": "-44.00524157713981",
					"long": "-19.807649431219804",
					"name": "Nome Cliente",
					"model": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",
					"localeHashValue": "hash cliente"
				},
				"third_party_additional_data": {},
				"session_id": "b75c7ac2-3be3-41b6-b769-4d982a5824a2"
			},
			"signed_object": {
				"document_key": "cfbc8469-89ea-4a80-9f64-ba7b1566c68b"
			}
		}
	}
}

```

:::caution Atenção
Nos casos em que houver representante legal, é necessário preencher o campo **"legal_representative_document_number"** com o CPF do representante legal, e os dados do objeto **"signer"** devem ser preenchidos com os dados do mesmo.
:::

--- 

        **Response**

- MÉTODO POST
- ENDPOINT /social_security/balance_request

- Body:

**body.json**

```json

{
    "balance_request_key": "ffda1935-9cad-47df-b848-cd33c96024e4",
    "document_number": "14950479032",
    "status": "pending_authorization",
    "authorization_term": {
        "authorization_term_key": "19196811-366f-4422-a729-4d0aa552449b",
        "status": "signed"
    },
    "status_events": [
        {
            "status": "pending_authorization",
            "event_date": "2023-12-22T16:18:18"
        }
    ]
}
 
```

Em caso de sucesso na consulta de dados do benefício

         **Webhook**

- WEBHOOK_TYPE /social_security/balance_request
- STATUS Success

        *Body:*
 
**body.json**

```json
{
    "webhook": {
        "key": "ffda1935-9cad-47df-b848-cd33c96024e4",
        "data": {
            "name": "IVOLANDO MIRANDA",
            "state": "SP",
            "alimony": "not_payer",
            "birth_date": "07021961",
            "grant_date": "2022-09-02",
            "credit_type": "checking_account",
            "block_type": "not_blocked",
            "benefit_card": {
                "limit": 2083.2,
                "balance": 0
            },
            "benefit_number": "22255220",
            "benefit_status": "elegible",
            "payroll_card": {
                "limit": 2083.2,
                "balance": 0
            },
            "assistance_type": "retirement_by_age",
            "document_number": "14950479032",
            "benefit_end_date": "2020-12-01",
            "consigned_credit": {
                "balance": 1000
            },
            "benefit_situation": "active",
            "max_total_balance": 2000,
            "used_total_balance": 1000,
            "politically_exposed": {
                "type": "politically_exposed_level_1",
                "is_politically_exposed": true
            },
            "has_power_of_attorney": false,
            "available_total_balance": 1000,
            "has_judicial_concession": false,
            "number_of_portabilities": 0,
            "disbursement_bank_account": {
                "bank_code": "341",
                "account_digit": "6",
                "account_branch": "0155",
                "account_number": "000059923"
            },
            "has_entity_representation": false,
            "social_benefit_max_balance": 2000,
            "social_benefit_used_balance": 1000,
            "benefit_quota_expiration_date": null,
            "number_of_active_reservations": 0,
            "number_of_suspended_reservations": 0,
            "number_of_refinanced_reservations": 0,
            "number_of_active_suspended_reservations": 3
        },
        "status": "success",
        "webhook_type": "social_security_balance_request",
        "event_datetime": "2023-12-22T16:18:21"
    }
}

```

### Detalhamento de campos no webhook de sucesso

| Campo                     | Descrição                                                                                                                   | Valores                                       |
|---------------------------|-----------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------|
| assistance_type           | Tipo do benefício                                                                                                           | [Enumeradores](#benefit_type_enumerator)      |
| benefit_status            | Status do beneficio                                                                                                         | [Enumeradores](#benefit_status_enumerator)    |
| has_entity_representation | Possui entidade de representação (não permite averbação)                                                                    | True ou False                                 |
| alimony_code              | Classificador da Pensão alimentícia                                                                                         | not_payer, payer, benefit                     |
| has_judicial_concession   | Benefício concedido por liminar                                                                                             | True ou False                                 |
| has_power_of_attorney     | Possui procurador?                                                                                                          | True ou False                                 |
| credit_type               | Tipo de crédito - recebimento do benefício                                                                                  | Magnetic_card, checking_account               |
| benefit_situation         | Situação do benefício                                                                                                       | [Enumeradores](#benefit_situation_enumerator) |
| used_total_balance        | Valor total comprometido em averbações de empréstimos, reservado para portabilidade, refinanciamento, alterações, RMC e RCC | Numérico                                      |
| max_total_balance         | Valor comprometido possível para a respectiva espécie do benefício                                                          | Numérico                                      |
| available_total_balance   | Valor total disponível para empréstimo, somando todas as modalidades (diferença entre max_total_balance e used_total_balance)         | Numérico                                      |
| benefit_quota_expiration_date   | Data de extinção do benefício. A informação está disponível apenas para alguns benefícios de pensão por morte. | String ou nulo   
| block_type                | Tipo de bloqueio do benefício                                                                                               | [Enumeradores](#block_type_enumerator)
| politically_exposed.type    | Pessoa politicamente exposta                                                                                                | [Enumeradores](#politically_exposed_enumerator)
| is_politically_exposed      | Pessoa politicamente exposta                                                                                                | True ou False

Em caso de falha na consulta da lista de benefícios

        **Webhook**

- WEBHOOK_TYPE /social_security/balance_request
- STATUS Failure

        *Body:*

**body.json**

```json
{
    "webhook": {
        "key": "37a14593-b934-457c-8cf6-e51f184b1f1c",
        "data": {
            "enumerator": "inexistent_beneficiary",
            "description": "no beneficiary found"
        },
        "status": "failure",
        "webhook_type": "social_security_balance_request",
        "event_datetime": "2023-12-22T16:22:29"
    }
}

```

### Detalhamento de campos no webhook de falha

| Campo                     | Descrição                           | Valores                          |
|---------------------------|-------------------------------------|----------------------------------|
| enumerator                | Retorno mapeado do código Dataprev  | [Enumeradores](#dataprev_balance_errors_enumerators) |
### Simulando cenários de sucesso e insucesso na consulta de dados do benefício em Sandbox:
A simulação de cenários é baseado no primeiro dígito do CPF informado na operação.

**11.1.** Para CPFs iniciados com o número 1, será retornado uma resposta assíncrona de sucesso através do Webhook.

**11.2.** Para os demais CPFs, será retornado uma resposta assíncrona de erro, baseado no primeiro dígito do CPF digitado, de acordo com a tabela abaixo.

| Início do CPF | Enumerador             | Descrição            |
|---------------|------------------------|----------------------|
| 2             | inexistent_beneficiary | no beneficiary found |

:::caution Atenção
Todos os CPFs que não tiverem um cenário mapeado para o primeiro dígito, receberão um webhook com um erro padrão de cenário de teste não mapeado. 

| Enumerador    | Descrição                                                        |
|---------------|------------------------------------------------------------------|
| mock_error    | Informed document number is not a valid mock on test environment |
:::

---

## 3 - Digitação da Proposta:
**3.1. Digitação da Proposta de Portabilidade com Refinanciamento:** Essa forma de digitação é utilizada para realizar a portabilidade de um contrato de crédito, liberando, ao final, mais dinheiro para o devedor. O valor liberado após a portabilidade é chamado de “Troco”. A Proposta de Portabilidade e a Proposta de Refinanciamento podem ser geradas em uma mesma Request.

Para a digitação da proposta devem ser enviadas as seguintes informações:

- Dados cadastrais do tomador do crédito.

- Dados cadastrais do Representante Legal (caso aplicável).

- Dados financeiros da operação de portabilidade informando sempre o número de parcelas e uma das opções entre taxa de juros e valor de face da parcela.

- Dados financeiros da operação de refinanciamento (operação que quita a operação de portabilidade e libera o troco) juntamente com os dados de conta bancária para pagamento do troco, conforme retornado na consulta dos dados do benefício.

- Saldo devedor, número do contrato original e ispb do credor original. Como a operação de Refinanciamento não possui data de desembolso fixa, a mudança na data de desembolso altera os valores da operação, sendo necessário informar se a taxa (“**monthly_interest_rate**”) deve ser fixa ou se o valor liberado ao cliente (“**disbursed_amount**“) deve ser fixo.

**Caso a proposta seja de cliente analfabeto, os dados do rogado e testemunhas devem ser enviados no campo additional_data do payload de criação da proposta. Porém, deve ser previamente alinhado com a QI Tech quais informações e formato serão utilizados**

        **3.1.1. Digitação da Proposta de Portabilidade com Refinanciamento com taxa fixa:** Segue abaixo, exemplo de digitação da proposta fixando a taxa da operação:

 
        **Request**

- MÉTODO POST
- STATUS /v2/credit_transfer/proposal

        *Payload:*

**Sem Registro na C3**

```json title='Request Body'

{
    "proposal_type": "inss",
    "purchaser_document_number": "32402502000135",
    "borrower": {
        "person_type": "natural",
        "name": "Marilene da Silva",
        "mother_name": "Maria Mariane",
        "birth_date": "1990-05-06",
        "profession": "Desenvolvedora",
        "nationality": "Brasileira",
        "marital_status": "single",
        "is_pep": false,
        "individual_document_number": "20676928013",
        "document_identification_number": "381803326",
        "email": "elaineisadoradacruz@hotmal.com",
        "phone": {
            "country_code": "055",
            "area_code": "11",
            "number": "912828135"
        },
        "address": {
            "street": "Passagem Mariana",
            "state": "PA",
            "city": "Ananindeua",
            "neighborhood": "Águas Lindas",
            "number": "660",
            "postal_code": "67118003",
            "complement": "complemento"
        },
        "document_identification": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d",
        "document_identification_back": "7b8f7848-78b5-405b-a62c-f23a432fde1a",
        "selfie": "2a2d000e-9f2b-4c4e-95f9-1561950db076"
    },
    "related_parties": [
        {
            "name": "Nome Representante Legal",
            "email": "email@email.com.br",
            "birth_date": "2000-12-12",
            "is_pep": false,
            "mother_name": "maria",
            "phone": {
                "number": "991294043",
                "area_code": "11",
                "country_code": "055"
            },
            "address": {
                "street": "Avenida das Castanheiras",
                "state": "SP",
                "city": "Brasília",
                "neighborhood": "bairro",
                "number": "12",
                "postal_code": "71900100",
                "complement": ""
            },
            "role_type": "issuer_legal_representative",
            "person_type": "natural",
            "individual_document_number": "20676928013",
            "document_identification": "359530eb-41dc-41bd-8385-b86d6bd6e650",
            "document_identification_back": "ae320312-532c-467c-b11f-48e3ec87452b",
            "document_identification_number": "123456789",
            "selfie": "f28e1a70-32e8-4620-9d72-c89ac8c7adb1"
        }
    ],
    "collaterals": [
        {
            "collateral_type": "social_security",
            "collateral_data": {
                "benefit_number": "22255220",
                "state": "SP",
            "subcorban_document_number": "12123456000101"
            }
        }
    ],
    "portability_credit_operation": {
        "financial": {
            "monthly_interest_rate": 0.0132,
            "number_of_installments": 10
        },
        "contract_number": "300523588BF"
    },
    "refinancing_credit_operation": {
        "financial": {
            "monthly_interest_rate": 0.0132,
            "installment_face_value": 100,
            "number_of_installments": 10
        },
        "disbursement_bank_account": {
            "account_digit": "1",
            "account_number": "000059923",
            "ispb": "341",
            "bank_code": "341",
            "branch_number": "0155"
        },
        "contract_number": "200523588BF"
    },
    "origin_contract": {
        "ispb": "60746948",
        "contract_number": "558472",
        "last_due_balance": 997.87,
        "installment_number": "84",
        "opened_installment_number": "81",
        "overdue_installment_number": "0"

    },
    "additional_data": {}
}

```
**Com Registro na C3**

```json title='Request Body'
{
    "proposal_type": "inss",
    "purchaser_document_number": "32402502000135",
    "borrower": {
        "person_type": "natural",
        "name": "Marilene da Silva",
        "mother_name": "Maria Mariane",
        "gender": "female",
        "birth_date": "1990-05-06",
        "profession": "Desenvolvedora",
        "nationality": "Brasileira",
        "marital_status": "single",
        "is_pep": false,
        "individual_document_number": "20676928013",
        "document_identification_number": "381803326",
        "document_identification_date": "2019-01-28",
        "document_identification_type": "rg",
        "email": "elaineisadoradacruz@hotmal.com",
        "phone": {
            "country_code": "055",
            "area_code": "11",
            "number": "912828135"
        },
        "address": {
            "street": "Passagem Mariana",
            "state": "PA",
            "city": "Ananindeua",
            "neighborhood": "Águas Lindas",
            "number": "660",
            "postal_code": "67118003",
            "complement": "complemento"
        },
        "document_identification": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d",
        "document_identification_back": "7b8f7848-78b5-405b-a62c-f23a432fde1a",
        "selfie": "2a2d000e-9f2b-4c4e-95f9-1561950db076"
    },
    "related_parties": [
        {
            "name": "Nome Representante Legal",
            "email": "email@email.com.br",
            "birth_date": "2000-12-12",
            "is_pep": false,
            "mother_name": "maria",
            "phone": {
                "number": "991294043",
                "area_code": "11",
                "country_code": "055"
            },
            "address": {
                "street": "Avenida das Castanheiras",
                "state": "SP",
                "city": "Brasília",
                "neighborhood": "bairro",
                "number": "12",
                "postal_code": "71900100",
                "complement": ""
            },
            "role_type": "issuer_legal_representative",
            "person_type": "natural",
            "individual_document_number": "20676928013",
            "document_identification": "359530eb-41dc-41bd-8385-b86d6bd6e650",
            "document_identification_back": "ae320312-532c-467c-b11f-48e3ec87452b",
            "document_identification_number": "123456789",
            "selfie": "f28e1a70-32e8-4620-9d72-c89ac8c7adb1"
        }
    ],
    "collaterals": [
        {
            "collateral_type": "social_security",
            "collateral_data": {
                "benefit_number": "22255220",
                "state": "SP",
                "subcorban_document_number": "12123456000101"
            }
        }
    ],
    "portability_credit_operation": {
        "financial": {
            "monthly_interest_rate": 0.0132,
            "number_of_installments": 10
        },
        "contract_number": "300523588PF"
    },
    "refinancing_credit_operation": {
        "financial": {
            "monthly_interest_rate": 0.0132,
            "installment_face_value": 100,
            "number_of_installments": 10
        },
        "disbursement_bank_account": {
            "account_digit": "1",
            "account_number": "000059923",
            "ispb": "341",
            "bank_code": "341",
            "branch_number": "0155"
        },
        "contract_number": "200523588PK"
    },
    "origin_contract": {
        "ispb": "60746948",
        "contract_number": "558472",
        "last_due_balance": 997.87,
        "installment_number": "84",
        "opened_installment_number": "81",
        "overdue_installment_number": "0"

    },
    "additional_data": {}
}
```

:::info Carência pro Rio Grande do Sul
Segundo informado pelo DATAPREV, os benefícios provenientes do RS poderão ter uma carência de até **6 meses** nos novos contratos de refinancimento gerados a partir de 28/06/2024.
Para isso, é preciso acrescentar um campo a mais nos payloads acima dentro de "**collateral_data**" chamado "**number_of_grace_periods**". Esse campo vai conter o valor do número de meses desejados para carência, como no exemplo abaixo:
```json
"collaterals": [
    {
        "collateral_type": "social_security",
        "collateral_data": {
            "benefit_number": "22255220",
            "state": "RS",
            "number_of_grace_periods": 3,
            "subcorban_document_number": "12123456000101"
        }
    }
]
```
:::

:::caution Atenção
A lista “**related_parties**”, só deve ser enviada caso seja uma operação com Representante Legal.
Quando enviado, deve conter os dados cadastrais do representante legal e o campo “**role_type**” deve ser enviado contendo o valor: ”**issuer_legal_representative**”.
:::

:::info
No campo “**origin_contract.ispb**“ é informado o **ISPB** da instituição Credora Original.
O **ISPB** é a base do CNPJ da instituição. Para ter acesso à lista completa de **ISPB’s** de cada instituição participante do CTC - CIP (Central de Transferência de Crédito), basta utilizar o endpoint de consulta de participantes do CTC (índice):
:::

        **3.1.2. Digitação da Proposta de Portabilidade com Refinanciamento com valor liberado fixo:** 

         Segue abaixo, exemplo de digitação da proposta fixando o valor liberado ao cliente:

        **Request**

- MÉTODO POST
- STATUS /v2/credit_transfer/proposal

        *Payload:*

**Sem Registro na C3**

```json title='Request Body'
{
	"proposal_type": "inss",
	"purchaser_document_number": "32402502000135",
	"borrower": {
		"person_type": "natural",
		"name": "Elaine Isadora da Cruz",
		"mother_name": "Maria Mariane",
		"birth_date": "1990-05-06",
		"profession": "Desenvolvedora",
		"nationality": "Brasileira",
		"marital_status": "single",
		"is_pep": false,
		"individual_document_number": "90406718261",
		"document_identification_number": "381803326",
		"email": "elaineisadoradacruz@hotmal.com",
		"phone": {
			"country_code": "055",
			"area_code": "11",
			"number": "996363253"
		},
		"address": {
			"street": "Passagem Mariana",
			"state": "PA",
			"city": "Ananindeua",
			"neighborhood": "Aguas Lindas",
			"number": "660",
			"postal_code": "67118003",
			"complement": "complemento"
		},
		"document_identification": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d",
		"document_identification_back": "7b8f7848-78b5-405b-a62c-f23a432fde1a",
		"selfie": "2a2d000e-9f2b-4c4e-95f9-1561950db076"
	},
	"related_parties": [{
		"name": "Nome Representante Legal",
		"email": "email@email.com.br",
		"birth_date": "2000-12-12",
		"is_pep": false,
		"mother_name": "maria",
		"phone": {
			"number": "991294043",
			"area_code": "11",
			"country_code": "055"
		},
		"address": {
			"street": "Avenida das Castanheiras",
			"state": "SP",
			"city": "Brasília",
			"neighborhood": "bairro",
			"number": "12",
			"postal_code": "71900100",
			"complement": ""
		},
		"role_type": "issuer_legal_representative",
		"person_type": "natural",
		"individual_document_number": "45102538004",
		"document_identification": "359530eb-41dc-41bd-8385-b86d6bd6e650",
		"document_identification_back": "ae320312-532c-467c-b11f-48e3ec87452b",
        "document_identification_number": "123456789",
		"selfie": "f28e1a70-32e8-4620-9d72-c89ac8c7adb1"

	}],
	"collaterals": [{
		"collateral_type": "social_security",
		"collateral_data": {
			"benefit_number": "12345678",
			"state": "SP",
            "subcorban_document_number": "12123456000101"
		}
	}],
	"portability_credit_operation": {
		"financial": {
			"monthly_interest_rate": 0.0132,
			"number_of_installments": 10
		},
		"contract_number": "3635259610"
	},
	"refinancing_credit_operation": {
		"financial": {
			"disbursed_amount": 1000,
			"installment_face_value": 110,
			"number_of_installments": 10
		},
		"disbursement_bank_account": {
			"account_digit": "1",
			"account_number": "00001",
			"bank_code": "033",
			"branch_number": "0001"
		},
		"contract_number": "3635259632"
	},
	"origin_contract": {
		"ispb": "60746948",
		"contract_number": "5584745",
		"last_due_balance": 800,
        "installment_number": "84",
        "opened_installment_number": "81",
        "overdue_installment_number": "0"

	},
    "additional_data": {}
}
```
**Com Registro na C3**

```json title='Request Body'
{
	"proposal_type": "inss",
	"purchaser_document_number": "32402502000135",
	"borrower": {
		"person_type": "natural",
		"name": "Elaine Isadora da Cruz",
		"mother_name": "Maria Mariane",
		"birth_date": "1990-05-06",
        "gender": "female",
		"profession": "Desenvolvedora",
		"nationality": "Brasileira",
		"marital_status": "single",
		"is_pep": false,
		"individual_document_number": "90406718261",
		"document_identification_number": "381803326",
        "document_identification_type": "rg",
        "document_identification_date": "2019-01-28",
		"email": "elaineisadoradacruz@hotmal.com",
		"phone": {
			"country_code": "055",
			"area_code": "11",
			"number": "996363253"
		},
		"address": {
			"street": "Passagem Mariana",
			"state": "PA",
			"city": "Ananindeua",
			"neighborhood": "Aguas Lindas",
			"number": "660",
			"postal_code": "67118003",
			"complement": "complemento"
		},
		"document_identification": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d",
		"document_identification_back": "7b8f7848-78b5-405b-a62c-f23a432fde1a",
		"selfie": "2a2d000e-9f2b-4c4e-95f9-1561950db076"
	},
	"related_parties": [{
		"name": "Nome Representante Legal",
		"email": "email@email.com.br",
		"birth_date": "2000-12-12",
		"is_pep": false,
		"mother_name": "maria",
		"phone": {
			"number": "991294043",
			"area_code": "11",
			"country_code": "055"
		},
		"address": {
			"street": "Avenida das Castanheiras",
			"state": "SP",
			"city": "Brasília",
			"neighborhood": "bairro",
			"number": "12",
			"postal_code": "71900100",
			"complement": ""
		},
		"role_type": "issuer_legal_representative",
		"person_type": "natural",
		"individual_document_number": "45102538004",
		"document_identification": "359530eb-41dc-41bd-8385-b86d6bd6e650",
		"document_identification_back": "ae320312-532c-467c-b11f-48e3ec87452b",
        "document_identification_number": "123456789",
		"selfie": "f28e1a70-32e8-4620-9d72-c89ac8c7adb1"
	}],
	"collaterals": [{
		"collateral_type": "social_security",
		"collateral_data": {
			"benefit_number": "12345678",
			"state": "SP",
            "subcorban_document_number": "12123456000101"
		}
	}],
	"portability_credit_operation": {
		"financial": {
			"monthly_interest_rate": 0.0132,
			"number_of_installments": 10
		},
		"contract_number": "3635259611"
	},
	"refinancing_credit_operation": {
		"financial": {
			"disbursed_amount": 1000,
			"installment_face_value": 110,
			"number_of_installments": 10
		},
		"disbursement_bank_account": {
			"account_digit": "1",
			"account_number": "00001",
			"bank_code": "033",
			"branch_number": "0001"
		},
		"contract_number": "3635259663"
	},
	"origin_contract": {
		"ispb": "60746948",
		"contract_number": "5584745",
		"last_due_balance": 800,
        "installment_number": "84",
        "opened_installment_number": "81",
        "overdue_installment_number": "0"

	},
    "additional_data": {}
}
```

        **3.1.3. Response**

- MÉTODO POST
- STATUS /v2/credit_transfer/proposal

        *Body:*

**body.json**

```json
{
    "borrower": {
        "individual_document_number": "90406718261",
        "name": "Elaine Isadora da Cruz",
        "related_party_key": "d7f84a9d-28ba-4355-8e5e-a436ff4c3c2d",
        "role_type": "issuer"
    },
    "portability_credit_operation": {
        "collateral_is_constituted": false,
        "contract_number": "3635259611",
        "credit_operation_key": "235ce3a5-eea1-4b13-9335-3de577318f8b",
        "credit_operation_status": "waiting_signature",
        "disbursement_accounts": [],
        "disbursement_options": [
            {
                "annual_cet": 0.17295,
                "cet": 0.0134,
                "contract_fee_amount": 0.0,
                "contract_fees": [
                    {
                        "amount": 0.5,
                        "amount_type": "percentage",
                        "fee_amount": 0.0,
                        "fee_type": "tac"
                    }
                ],
                "disbursed_issue_amount": 800.0,
                "disbursement_date": "2023-12-22",
                "external_contract_fee_amount": 0.0,
                "external_contract_fees": [
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "spread",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    },
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "tac",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    },
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "insurance_premium",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    }
                ],
                "installments": [
                    {
                        "business_due_date": "2024-02-22",
                        "calendar_days": 62,
                        "due_date": "2024-02-22",
                        "due_principal": 800.0,
                        "installment_number": 1,
                        "pre_fixed_amount": 21.977846031814607,
                        "principal_amortization_amount": 65.21215396818539,
                        "total_amount": 87.19,
                        "workdays": 40
                    },
                    {
                        "business_due_date": "2024-03-22",
                        "calendar_days": 29,
                        "due_date": "2024-03-22",
                        "due_principal": 734.7878460318146,
                        "installment_number": 2,
                        "pre_fixed_amount": 9.373907348762184,
                        "principal_amortization_amount": 77.81609265123781,
                        "total_amount": 87.19,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-04-22",
                        "calendar_days": 31,
                        "due_date": "2024-04-22",
                        "due_principal": 656.9717533805768,
                        "installment_number": 3,
                        "pre_fixed_amount": 8.963122696164149,
                        "principal_amortization_amount": 78.22687730383585,
                        "total_amount": 87.19,
                        "workdays": 20
                    },
                    {
                        "business_due_date": "2024-05-22",
                        "calendar_days": 30,
                        "due_date": "2024-05-22",
                        "due_principal": 578.744876076741,
                        "installment_number": 4,
                        "pre_fixed_amount": 7.639487642788938,
                        "principal_amortization_amount": 79.55051235721106,
                        "total_amount": 87.19,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-06-24",
                        "calendar_days": 33,
                        "due_date": "2024-06-24",
                        "due_principal": 499.19436371952986,
                        "installment_number": 5,
                        "pre_fixed_amount": 7.253119731550034,
                        "principal_amortization_amount": 79.93688026844997,
                        "total_amount": 87.19,
                        "workdays": 22
                    },
                    {
                        "business_due_date": "2024-07-22",
                        "calendar_days": 28,
                        "due_date": "2024-07-22",
                        "due_principal": 419.2574834510799,
                        "installment_number": 6,
                        "pre_fixed_amount": 5.163027422441386,
                        "principal_amortization_amount": 82.02697257755861,
                        "total_amount": 87.19,
                        "workdays": 20
                    },
                    {
                        "business_due_date": "2024-08-22",
                        "calendar_days": 31,
                        "due_date": "2024-08-22",
                        "due_principal": 337.2305108735213,
                        "installment_number": 7,
                        "pre_fixed_amount": 4.600865151805861,
                        "principal_amortization_amount": 82.58913484819413,
                        "total_amount": 87.19,
                        "workdays": 23
                    },
                    {
                        "business_due_date": "2024-09-23",
                        "calendar_days": 32,
                        "due_date": "2024-09-23",
                        "due_principal": 254.64137602532716,
                        "installment_number": 8,
                        "pre_fixed_amount": 3.586947657335553,
                        "principal_amortization_amount": 83.60305234266444,
                        "total_amount": 87.19,
                        "workdays": 22
                    },
                    {
                        "business_due_date": "2024-10-22",
                        "calendar_days": 29,
                        "due_date": "2024-10-22",
                        "due_principal": 171.0383236826627,
                        "installment_number": 9,
                        "pre_fixed_amount": 2.18198682510524,
                        "principal_amortization_amount": 85.00801317489476,
                        "total_amount": 87.19,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-11-22",
                        "calendar_days": 31,
                        "due_date": "2024-11-22",
                        "due_principal": 86.03031050776795,
                        "installment_number": 10,
                        "pre_fixed_amount": 1.1637189988799015,
                        "principal_amortization_amount": 86.0262810011201,
                        "total_amount": 87.19,
                        "workdays": 22
                    }
                ],
                "issue_amount": 800.0,
                "number_of_installments": 10,
                "prefixed_interest_rate": {
                    "annual_rate": 0.17042118,
                    "daily_rate": 0.00043722,
                    "interest_base": "calendar_days",
                    "monthly_rate": 0.0132
                },
                "total_iof": 0.0
            }
        ],
        "document_key": "c4cedeaf-23bf-450d-9fba-5ec6b5d45afb",
        "document_url": "https://storage.googleapis.com/sandbox-doc-api/documents/c4cedeaf-23bf-450d-9fba-5ec6b5d45afb/TESTEINSSS.A.-ELAINEISADORADACRUZ-CCB-3635259611.pdf",
        "final_disbursement_amount": 0.0
    },
    "proposal_key": "2f7e320c-2a35-4e78-bfd7-a298b28a7497",
    "proposal_number": "17032782193414588",
    "proposal_status": "pending_submission",
    "refinancing_credit_operation": {
        "collateral_is_constituted": false,
        "contract_number": "3635259663",
        "credit_operation_key": "f73ba4d2-cd0a-4405-a47e-a51f325a9756",
        "credit_operation_status": "waiting_signature",
        "disbursement_accounts": [
            {
                "account_branch": "0001",
                "account_digit": "1",
                "account_number": "00001",
                "bank_code": "033"
            }
        ],
        "disbursement_options": [
            {
                "annual_cet": 0.193423,
                "cet": 0.0148,
                "contract_fee_amount": 1.03,
                "contract_fees": [
                    {
                        "amount": 0.5,
                        "amount_type": "percentage",
                        "fee_amount": 1.03,
                        "fee_type": "tac"
                    }
                ],
                "disbursed_issue_amount": 1000.0,
                "disbursement_date": "2023-12-22",
                "external_contract_fee_amount": 0.0,
                "external_contract_fees": [
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "spread",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    },
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "tac",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    },
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "insurance_premium",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    }
                ],
                "installments": [
                    {
                        "business_due_date": "2024-02-22",
                        "calendar_days": 62,
                        "due_date": "2024-02-22",
                        "due_principal": 1005.24,
                        "installment_number": 1,
                        "pre_fixed_amount": 28.92478321729087,
                        "principal_amortization_amount": 81.07521678270913,
                        "total_amount": 110.0,
                        "workdays": 40
                    },
                    {
                        "business_due_date": "2024-03-22",
                        "calendar_days": 29,
                        "due_date": "2024-03-22",
                        "due_principal": 924.1647832172908,
                        "installment_number": 2,
                        "pre_fixed_amount": 12.344286518064438,
                        "principal_amortization_amount": 97.65571348193556,
                        "total_amount": 110.0,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-04-22",
                        "calendar_days": 31,
                        "due_date": "2024-04-22",
                        "due_principal": 826.5090697353553,
                        "installment_number": 3,
                        "pre_fixed_amount": 11.806660138520433,
                        "principal_amortization_amount": 98.19333986147957,
                        "total_amount": 110.0,
                        "workdays": 20
                    },
                    {
                        "business_due_date": "2024-05-22",
                        "calendar_days": 30,
                        "due_date": "2024-05-22",
                        "due_principal": 728.3157298738757,
                        "installment_number": 4,
                        "pre_fixed_amount": 10.06605046134725,
                        "principal_amortization_amount": 99.93394953865275,
                        "total_amount": 110.0,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-06-24",
                        "calendar_days": 33,
                        "due_date": "2024-06-24",
                        "due_principal": 628.381780335223,
                        "installment_number": 5,
                        "pre_fixed_amount": 9.559924513271145,
                        "principal_amortization_amount": 100.44007548672886,
                        "total_amount": 110.0,
                        "workdays": 22
                    },
                    {
                        "business_due_date": "2024-07-22",
                        "calendar_days": 28,
                        "due_date": "2024-07-22",
                        "due_principal": 527.9417048484942,
                        "installment_number": 6,
                        "pre_fixed_amount": 6.807113809566991,
                        "principal_amortization_amount": 103.19288619043301,
                        "total_amount": 110.0,
                        "workdays": 20
                    },
                    {
                        "business_due_date": "2024-08-22",
                        "calendar_days": 31,
                        "due_date": "2024-08-22",
                        "due_principal": 424.7488186580611,
                        "installment_number": 7,
                        "pre_fixed_amount": 6.067525608326975,
                        "principal_amortization_amount": 103.93247439167303,
                        "total_amount": 110.0,
                        "workdays": 23
                    },
                    {
                        "business_due_date": "2024-09-23",
                        "calendar_days": 32,
                        "due_date": "2024-09-23",
                        "due_principal": 320.8163442663881,
                        "installment_number": 8,
                        "pre_fixed_amount": 4.731771911001933,
                        "principal_amortization_amount": 105.26822808899807,
                        "total_amount": 110.0,
                        "workdays": 22
                    },
                    {
                        "business_due_date": "2024-10-22",
                        "calendar_days": 29,
                        "due_date": "2024-10-22",
                        "due_principal": 215.54811617739003,
                        "installment_number": 9,
                        "pre_fixed_amount": 2.87912691853476,
                        "principal_amortization_amount": 107.12087308146523,
                        "total_amount": 110.0,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-11-22",
                        "calendar_days": 31,
                        "due_date": "2024-11-22",
                        "due_principal": 108.4272430959248,
                        "installment_number": 10,
                        "pre_fixed_amount": 1.5688802916587754,
                        "principal_amortization_amount": 108.43111970834123,
                        "total_amount": 110.0,
                        "workdays": 22
                    }
                ],
                "issue_amount": 1005.24,
                "number_of_installments": 10,
                "prefixed_interest_rate": {
                    "annual_rate": 0.17905959,
                    "daily_rate": 0.00045765,
                    "interest_base": "calendar_days",
                    "monthly_rate": 0.01382107
                },
                "total_iof": 4.21
            }
        ],
        "document_key": "f4dfb505-3cec-4a97-9b16-dadc39bb4c7e",
        "document_url": "https://storage.googleapis.com/sandbox-doc-api/documents/f4dfb505-3cec-4a97-9b16-dadc39bb4c7e/TESTEINSSS.A.-ELAINEISADORADACRUZ-CCB-3635259663.pdf",
        "final_disbursement_amount": 200.0
    },
    "related_party_list": [
        {
            "individual_document_number": "45102538004",
            "name": "Nome Representante Legal",
            "related_party_key": "632fa6c5-40e8-4e76-862e-e10951ed8bff",
            "role_type": "issuer_legal_representative"
        }
    ]
}

```

Segue abaixo definições e descrições de alguns campos retornados na resposta da digitação da Proposta: 

**[A]**: ***“portability_credit_operation.disbursement_options.iof_amount”***: Na Operação de Portabilidade o IOF sempre será zero.

**[B]**: ***“portability_credit_operation.disbursement_options.disbursed_issue_amount”***: É igual ao valor do saldo devedor do Contrato Original.

**[C]**: ***“portability_credit_operation.disbursement_options.issue_amount”***: É o valor da Operação de Portabilidade.

:::tip Relação
[C] = [A] + [B]
:::

**[D]**: ***“refinancing_credit_operation.disbursement_options.iof_amount”***: Valor de IOF da Operação de Refinanciamento (Troco).

**[E]**: ***“refinancing_credit_operation.disbursement_options.disbursed_issue_amount”***: É o valor destinado à quitação do saldo devedor da Operação de Portabilidade.

:::tip Relação
[E] = [C]
::: 

**[F]**: **“refinancing_credit_operation.disbursement_options.final_disbursement_amount”**: É o valor do Troco liberado para o cliente na conta de desembolso informada no momento da digitação da Proposta (deve ser a conta informação da consulta dos dados do benefício).

**[G]**: **“refinancing_credit_operation.disbursement_options.issue_amount”**: É o valor do Refinanciamento.

:::tip Relação
{"\n"}
[G] = [F] + [E] + [D]
{"\n"}
:::

Os campos “**portability_credit_operation.disbursement_options.collateral_constituted**“ e “**refinancing_credit_operation.disbursement_options.collateral_constituted**“ informam se a margem do cliente esta averbada na Dataprev. O processo de averbação da Portabilidade será iniciado assim que os recursos para quitação do contrato original forem enviados a Instituição Credora Original (Item **6.4.**). O Processo de averbação do Refinanciamento é iniciado no momento em que o Parceiro decide por prosseguir com a Operação de Refinanciamento (Item **7.1.1.** e **7.2.**).

 

        **3.2. Digitação da Proposta de Portabilidade:**

        A Proposta de Portabilidade (Portabilidade Pura) deve ser digitada de forma semelhante ao descrito no item 3.1.1, porém deve ser enviada sem o objeto **“refinancing_credit_operation“**.

        **Request**

- MÉTODO POST
- STATUS /v2/credit_transfer/proposal

        *Body:*

**body.json**

```json

{
	"proposal_type": "inss",
	"purchaser_document_number": "32402502000135",
	"borrower": {
		"person_type": "natural",
		"name": "Elaine Isadora da Cruz",
		"mother_name": "Maria Mariane",
		"birth_date": "1990-05-06",
        "gender": "female",
		"profession": "Desenvolvedora",
		"nationality": "Brasileira",
		"marital_status": "single",
		"is_pep": false,
		"individual_document_number": "90406718261",
		"document_identification_number": "381803326",
        "document_identification_type": "rg",
         "document_identification_date": "2019-01-28",
		"email": "elaineisadoradacruz@hotmal.com",
		"phone": {
			"country_code": "055",
			"area_code": "11",
			"number": "996363253"
		},
		"address": {
			"street": "Passagem Mariana",
			"state": "PA",
			"city": "Ananindeua",
			"neighborhood": "Aguas Lindas",
			"number": "660",
			"postal_code": "67118003",
			"complement": "complemento"
		},
		"document_identification": "8b0d8c33-01c9-4cf5-a0fa-1d2a96f4b34d",
		"document_identification_back": "7b8f7848-78b5-405b-a62c-f23a432fde1a",
		"selfie": "2a2d000e-9f2b-4c4e-95f9-1561950db076"
	},
	"related_parties": [{
		"name": "Nome Representante Legal",
		"email": "email@email.com.br",
		"birth_date": "2000-12-12",
		"is_pep": false,
		"mother_name": "maria",
		"phone": {
			"number": "991294043",
			"area_code": "11",
			"country_code": "055"
		},
		"address": {
			"street": "Avenida das Castanheiras",
			"state": "SP",
			"city": "Brasília",
			"neighborhood": "bairro",
			"number": "12",
			"postal_code": "71900100",
			"complement": ""
		},
		"role_type": "issuer_legal_representative",
		"person_type": "natural",
		"individual_document_number": "45102538004",
		"document_identification": "359530eb-41dc-41bd-8385-b86d6bd6e650",
		"document_identification_back": "ae320312-532c-467c-b11f-48e3ec87452b",
        "document_identification_number": "123456789",
		"selfie": "f28e1a70-32e8-4620-9d72-c89ac8c7adb1"
	}],
	"collaterals": [{
		"collateral_type": "social_security",
		"collateral_data": {
			"benefit_number": "12345678",
			"state": "SP",
            "subcorban_document_number": "12123456000101"
		}
	}],
	"portability_credit_operation": {
		"financial": {
			"monthly_interest_rate": 0.0132,
			"number_of_installments": 10
		},
		"contract_number": "1020252636"
	},

	"origin_contract": {
		"ispb": "60746948",
		"contract_number": "558474520",
		"last_due_balance": 800,
        "installment_number": "84",
        "opened_installment_number": "81",
        "overdue_installment_number": "0"

	},
    "additional_data": {}
}

```

        **Response**

- MÉTODO POST
- STATUS /v2/credit_transfer/proposal

        *Payload:*

**payload.json**

```json
{
    "borrower": {
        "individual_document_number": "90406718261",
        "name": "Elaine Isadora da Cruz",
        "related_party_key": "f9fbaa93-4d57-494f-b60f-dcba8cb64a45",
        "role_type": "issuer"
    },
    "portability_credit_operation": {
        "collateral_is_constituted": false,
        "contract_number": "1020252636",
        "credit_operation_key": "1cd34a63-5a61-49a3-90a5-7a515ee98932",
        "credit_operation_status": "waiting_signature",
        "disbursement_accounts": [],
        "disbursement_options": [
            {
                "annual_cet": 0.17295,
                "cet": 0.0134,
                "contract_fee_amount": 0.0,
                "contract_fees": [
                    {
                        "amount": 0.5,
                        "amount_type": "percentage",
                        "fee_amount": 0.0,
                        "fee_type": "tac"
                    }
                ],
                "disbursed_issue_amount": 800.0,
                "disbursement_date": "2023-12-22",
                "external_contract_fee_amount": 0.0,
                "external_contract_fees": [
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "spread",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    },
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "tac",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    },
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "insurance_premium",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    }
                ],
                "installments": [
                    {
                        "business_due_date": "2024-02-22",
                        "calendar_days": 62,
                        "due_date": "2024-02-22",
                        "due_principal": 800.0,
                        "installment_number": 1,
                        "pre_fixed_amount": 21.977846031814607,
                        "principal_amortization_amount": 65.21215396818539,
                        "total_amount": 87.19,
                        "workdays": 40
                    },
                    {
                        "business_due_date": "2024-03-22",
                        "calendar_days": 29,
                        "due_date": "2024-03-22",
                        "due_principal": 734.7878460318146,
                        "installment_number": 2,
                        "pre_fixed_amount": 9.373907348762184,
                        "principal_amortization_amount": 77.81609265123781,
                        "total_amount": 87.19,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-04-22",
                        "calendar_days": 31,
                        "due_date": "2024-04-22",
                        "due_principal": 656.9717533805768,
                        "installment_number": 3,
                        "pre_fixed_amount": 8.963122696164149,
                        "principal_amortization_amount": 78.22687730383585,
                        "total_amount": 87.19,
                        "workdays": 20
                    },
                    {
                        "business_due_date": "2024-05-22",
                        "calendar_days": 30,
                        "due_date": "2024-05-22",
                        "due_principal": 578.744876076741,
                        "installment_number": 4,
                        "pre_fixed_amount": 7.639487642788938,
                        "principal_amortization_amount": 79.55051235721106,
                        "total_amount": 87.19,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-06-24",
                        "calendar_days": 33,
                        "due_date": "2024-06-24",
                        "due_principal": 499.19436371952986,
                        "installment_number": 5,
                        "pre_fixed_amount": 7.253119731550034,
                        "principal_amortization_amount": 79.93688026844997,
                        "total_amount": 87.19,
                        "workdays": 22
                    },
                    {
                        "business_due_date": "2024-07-22",
                        "calendar_days": 28,
                        "due_date": "2024-07-22",
                        "due_principal": 419.2574834510799,
                        "installment_number": 6,
                        "pre_fixed_amount": 5.163027422441386,
                        "principal_amortization_amount": 82.02697257755861,
                        "total_amount": 87.19,
                        "workdays": 20
                    },
                    {
                        "business_due_date": "2024-08-22",
                        "calendar_days": 31,
                        "due_date": "2024-08-22",
                        "due_principal": 337.2305108735213,
                        "installment_number": 7,
                        "pre_fixed_amount": 4.600865151805861,
                        "principal_amortization_amount": 82.58913484819413,
                        "total_amount": 87.19,
                        "workdays": 23
                    },
                    {
                        "business_due_date": "2024-09-23",
                        "calendar_days": 32,
                        "due_date": "2024-09-23",
                        "due_principal": 254.64137602532716,
                        "installment_number": 8,
                        "pre_fixed_amount": 3.586947657335553,
                        "principal_amortization_amount": 83.60305234266444,
                        "total_amount": 87.19,
                        "workdays": 22
                    },
                    {
                        "business_due_date": "2024-10-22",
                        "calendar_days": 29,
                        "due_date": "2024-10-22",
                        "due_principal": 171.0383236826627,
                        "installment_number": 9,
                        "pre_fixed_amount": 2.18198682510524,
                        "principal_amortization_amount": 85.00801317489476,
                        "total_amount": 87.19,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-11-22",
                        "calendar_days": 31,
                        "due_date": "2024-11-22",
                        "due_principal": 86.03031050776795,
                        "installment_number": 10,
                        "pre_fixed_amount": 1.1637189988799015,
                        "principal_amortization_amount": 86.0262810011201,
                        "total_amount": 87.19,
                        "workdays": 22
                    }
                ],
                "issue_amount": 800.0,
                "number_of_installments": 10,
                "prefixed_interest_rate": {
                    "annual_rate": 0.17042118,
                    "daily_rate": 0.00043722,
                    "interest_base": "calendar_days",
                    "monthly_rate": 0.0132
                },
                "total_iof": 0.0
            }
        ],
        "document_key": "2f9ac920-a5e8-4386-b049-dc971e1fc20b",
        "document_url": "https://storage.googleapis.com/sandbox-doc-api/documents/2f9ac920-a5e8-4386-b049-dc971e1fc20b/TESTEINSSS.A.-ELAINEISADORADACRUZ-CCB-1020252636.pdf",
        "final_disbursement_amount": 0.0
    },
    "proposal_key": "9661aef8-e897-4405-a44f-ca8a43d9cee3",
    "proposal_number": "17032785232138245",
    "proposal_status": "pending_submission",
    "related_party_list": [
        {
            "individual_document_number": "45102538004",
            "name": "Nome Representante Legal",
            "related_party_key": "c8166f37-b496-455a-96e7-f75e24f084a1",
            "role_type": "issuer_legal_representative"
        }
    ]
}
```
 

        **3.3. Recuperando dados de uma proposta:**

- MÉTODO GET
- STATUS /v2/credit_transfer/proposal/PROPOSAL-KEY

        *Response:*

**response.json**

```json
{
    "borrower": {
        "address": {
            "city": "Ananindeua",
            "complement": "complemento",
            "neighborhood": "Aguas Lindas",
            "number": "660",
            "postal_code": "67118003",
            "state": "PA",
            "street": "Passagem Mariana"
        },
        "birth_date": "1990-05-06",
        "document_identification_date": "2019-01-28",
        "document_identification_number": "381803326",
        "document_identification_type": "rg",
        "email": "elaineisadoradacruz@hotmal.com",
        "gender": "female",
        "individual_document_number": "90406718261",
        "is_pep": false,
        "marital_status": "single",
        "mother_name": "Maria Mariane",
        "name": "Elaine Isadora da Cruz",
        "nationality": "Brasileira",
        "person_type": "natural",
        "phone": {
            "area_code": "11",
            "country_code": "055",
            "number": "996363253"
        },
        "profession": "Desenvolvedora",
        "related_party_key": "f9fbaa93-4d57-494f-b60f-dcba8cb64a45",
        "role_type": "issuer"
    },
    "origin_operation": {
        "contract_number": "558474520",
        "ispb_number": "60746948",
        "last_due_balance": 800.0
    },
    "portability_credit_operation": {
        "collateral_is_constituted": false,
        "contract_number": "1020252636",
        "credit_operation_key": "1cd34a63-5a61-49a3-90a5-7a515ee98932",
        "credit_operation_status": "waiting_signature",
        "disbursement_accounts": [],
        "disbursement_options": [
            {
                "annual_cet": 0.17295,
                "cet": 0.0134,
                "contract_fee_amount": 0.0,
                "contract_fees": [
                    {
                        "amount": 0.5,
                        "amount_type": "percentage",
                        "fee_amount": 0.0,
                        "fee_type": "tac"
                    }
                ],
                "disbursed_issue_amount": 800.0,
                "disbursement_date": "2023-12-22",
                "external_contract_fee_amount": 0.0,
                "external_contract_fees": [
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "spread",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    },
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "tac",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    },
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "insurance_premium",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    }
                ],
                "installments": [
                    {
                        "business_due_date": "2024-02-22",
                        "calendar_days": 62,
                        "due_date": "2024-02-22",
                        "due_principal": 800.0,
                        "installment_number": 1,
                        "pre_fixed_amount": 21.977846031814607,
                        "principal_amortization_amount": 65.21215396818539,
                        "total_amount": 87.19,
                        "workdays": 40
                    },
                    {
                        "business_due_date": "2024-03-22",
                        "calendar_days": 29,
                        "due_date": "2024-03-22",
                        "due_principal": 734.7878460318146,
                        "installment_number": 2,
                        "pre_fixed_amount": 9.373907348762184,
                        "principal_amortization_amount": 77.81609265123781,
                        "total_amount": 87.19,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-04-22",
                        "calendar_days": 31,
                        "due_date": "2024-04-22",
                        "due_principal": 656.9717533805768,
                        "installment_number": 3,
                        "pre_fixed_amount": 8.963122696164149,
                        "principal_amortization_amount": 78.22687730383585,
                        "total_amount": 87.19,
                        "workdays": 20
                    },
                    {
                        "business_due_date": "2024-05-22",
                        "calendar_days": 30,
                        "due_date": "2024-05-22",
                        "due_principal": 578.744876076741,
                        "installment_number": 4,
                        "pre_fixed_amount": 7.639487642788938,
                        "principal_amortization_amount": 79.55051235721106,
                        "total_amount": 87.19,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-06-24",
                        "calendar_days": 33,
                        "due_date": "2024-06-24",
                        "due_principal": 499.19436371952986,
                        "installment_number": 5,
                        "pre_fixed_amount": 7.253119731550034,
                        "principal_amortization_amount": 79.93688026844997,
                        "total_amount": 87.19,
                        "workdays": 22
                    },
                    {
                        "business_due_date": "2024-07-22",
                        "calendar_days": 28,
                        "due_date": "2024-07-22",
                        "due_principal": 419.2574834510799,
                        "installment_number": 6,
                        "pre_fixed_amount": 5.163027422441386,
                        "principal_amortization_amount": 82.02697257755861,
                        "total_amount": 87.19,
                        "workdays": 20
                    },
                    {
                        "business_due_date": "2024-08-22",
                        "calendar_days": 31,
                        "due_date": "2024-08-22",
                        "due_principal": 337.2305108735213,
                        "installment_number": 7,
                        "pre_fixed_amount": 4.600865151805861,
                        "principal_amortization_amount": 82.58913484819413,
                        "total_amount": 87.19,
                        "workdays": 23
                    },
                    {
                        "business_due_date": "2024-09-23",
                        "calendar_days": 32,
                        "due_date": "2024-09-23",
                        "due_principal": 254.64137602532716,
                        "installment_number": 8,
                        "pre_fixed_amount": 3.586947657335553,
                        "principal_amortization_amount": 83.60305234266444,
                        "total_amount": 87.19,
                        "workdays": 22
                    },
                    {
                        "business_due_date": "2024-10-22",
                        "calendar_days": 29,
                        "due_date": "2024-10-22",
                        "due_principal": 171.0383236826627,
                        "installment_number": 9,
                        "pre_fixed_amount": 2.18198682510524,
                        "principal_amortization_amount": 85.00801317489476,
                        "total_amount": 87.19,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-11-22",
                        "calendar_days": 31,
                        "due_date": "2024-11-22",
                        "due_principal": 86.03031050776795,
                        "installment_number": 10,
                        "pre_fixed_amount": 1.1637189988799015,
                        "principal_amortization_amount": 86.0262810011201,
                        "total_amount": 87.19,
                        "workdays": 22
                    }
                ],
                "issue_amount": 800.0,
                "number_of_installments": 10,
                "prefixed_interest_rate": {
                    "annual_rate": 0.17042118,
                    "daily_rate": 0.00043722,
                    "interest_base": "calendar_days",
                    "monthly_rate": 0.0132
                },
                "total_iof": 0.0
            }
        ],
        "document_key": "2f9ac920-a5e8-4386-b049-dc971e1fc20b",
        "document_url": "https://storage.googleapis.com/sandbox-doc-api/documents/2f9ac920-a5e8-4386-b049-dc971e1fc20b/TESTEINSSS.A.-ELAINEISADORADACRUZ-CCB-1020252636.pdf",
        "final_disbursement_amount": 0.0
    },
    "proposal_key": "9661aef8-e897-4405-a44f-ca8a43d9cee3",
    "proposal_number": "17032785232138245",
    "proposal_status": "pending_submission",
    "related_party_list": [
        {
            "address": {
                "city": "Brasília",
                "complement": "",
                "neighborhood": "bairro",
                "number": "12",
                "postal_code": "71900100",
                "state": "SP",
                "street": "Avenida das Castanheiras"
            },
            "birth_date": "2000-12-12",
            "document_identification_date": "2019-01-28",
            "document_identification_type": "rg",
            "email": "email@email.com.br",
            "gender": "female",
            "individual_document_number": "45102538004",
            "is_pep": false,
            "mother_name": "maria",
            "name": "Nome Representante Legal",
            "person_type": "natural",
            "phone": {
                "area_code": "11",
                "country_code": "055",
                "number": "991294043"
            },
            "related_party_key": "c8166f37-b496-455a-96e7-f75e24f084a1",
            "role_type": "issuer_legal_representative"
        }
    ],
    "collaterals": [{
		"collateral_type": "social_security",
		"collateral_data": {
			"benefit_number": 12345678,
			"state": "SP"
		}
	}],
    "inclusion_date": "2022-11-24",
    "due_balance_expected_return_date": "2022-12-01"
}

```

:::info
No caso da recuperação dos dados de uma proposta de portabilidade pura o objeto “refinancing_credit_operation” não será retornado.
:::

### Correção de dados para refinanciamento:
É possível corrigir os dados financeiros e os bancários da operação de refinanciamento enquanto o refinanciamento original não for averbado.

ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /refinancing_credit_operation
METHOD PUT

Request Body

```json
{
    "financial": {
        "interest_type": "pre_price_days",
        "first_due_date": "2024-06-10",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "credit_operation_type": "ccb",
        "monthly_interest_rate": 0.0167,
        "installment_face_value": 410,
        "limit_days_to_disburse": 7,
        "number_of_installments": 84
		},
    "disbursement_bank_account": {
        "account_digit": "1",
        "account_number": "00001",
        "bank_code": "033",
        "branch_number": "0001"
    }
}

```
  

        *Response:*

**response.json**

```json

{
	"credit_operation_key": "\<CREDIT-OPERATION-KEY\>",
	"contract_number": "00000002",
	"document_key": "\<DOCUMENT-KEY da CCB de Refinanciamento\>",
	"document_url": "\<URL da CCB de Refinanciamento\>",
	"credit_operation_status": "issued",
	"fine_configuration": {
		"contract_fine_rate": 0.02,
		"interest_base": "calendar_days",
		"monthly_rate": 0.01
	},
	"disbursement_options": [{
		"installments": [{
				"additional_costs": [],
				"bank_slip_key": null,
				"business_due_date": "2021-08-09",
				"calendar_days": 53,
				"digitable_line": null,
				"due_date": "2021-08-08",
				"due_interest": 0,
				"due_principal": 997.87,
				"fine_amount": null,
				"has_interest": true,
				"installment_key": "e3bedf31-1e87-4ba4-a36c-d52f7f5c9036",
				"installment_number": 1,
				"installment_status": "created",
				"installment_type": "principal",
				"paid_amount": 0,
				"paid_at": null,
				"post_fixed_amount": 0,
				"pre_fixed_amount": 54.84865004983954,
				"principal_amortization_amount": 306.98134995016045,
				"total_amount": 361.83,
				"workdays": 37
			},
			{
				"additional_costs": [],
				"bank_slip_key": null,
				"business_due_date": "2021-09-08",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2021-09-08",
				"due_interest": 0,
				"due_principal": 690.8886500498395,
				"fine_amount": null,
				"has_interest": true,
				"installment_key": "e8406cdb-844c-4e6d-9620-3635fab9d8d1",
				"installment_number": 2,
				"installment_status": "created",
				"installment_type": "principal",
				"paid_amount": 0,
				"paid_at": null,
				"post_fixed_amount": 0,
				"pre_fixed_amount": 21.964874249804833,
				"principal_amortization_amount": 339.86512575019515,
				"tax_amount": 0,
				"total_amount": 361.83,
				"workdays": 22
			}
		],
		"prefixed_interest_rate": {
				"annual_rate": 0.44556431,
				"daily_rate": 0.00564312,
				"monthly_rate": 0.0556431,
				"interest_base": "calendar_days_365"
		},
		"iof_amount": 50,
		"external_contract_fee_amount": 0,
		"external_contract_fees": [],
		"contract_fee_amount": 0,
		"contract_fees": [],
		"number_of_installments": 2,
		"disbursed_issue_amount": 997.87,
		"final_disbursement_amount": 100,
		"issue_amount": 1147.87,
		"disbursement_date": "2021-05-31",
		"cet": 1.212,
		"annual_cet": 32.122
	}],
	"disbursement_bank_account": {
		"account_digit": "1",
		"account_number": "00001",
		"ispb": "00000000",
		"branch_number": "0001"
	}
}

```

:::caution 
A key da operação de refinanciamento, a document key, a document url, a related_party_key e a borrower related_party_key mudarão após essa ação, sendo necessário a reassinatura da CCB.
:::

### Correção de dados para portabilidade e refin:
É possível corrigir os dados bancários, número do benefício e nome até que o contrato de portabilidade seja averbado. Tanto os dados do operação de portabilidade quanto do refinanciamento serão ajustados. Para isso basta utilizar a seguinte chamada:

ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /collateral
METHOD PATCH

Request Body

**Dados Bancários**

```json
{
	"disbursement_bank_account": {
		"bank_code": "123",
		"account_digit": "1",
		"account_branch": "1234",
		"account_number": "5678",
		"document_number": "12345678901"
	}
}

```
  
**Número do Benefício**

```json
{
	"benefit_number": 1234567890
}
```

**Nome**

```json
{
	"name": "Nome do Beneficiário"
}
```

### Simulando cenários de sucesso e insucesso na averbação em Sandbox:
A simulação de cenários é baseado no primeiro dígito do CPF informado na operação.

**11.1.** Para CPFs iniciados com o número 1, será retornado uma resposta assíncrona de sucesso através do Webhook.

**11.2.** Para os demais CPFs, será retornado uma resposta assíncrona de erro, baseado no primeiro dígito do CPF digitado, de acordo com a tabela abaixo.

**11.3.** Erros com Ação "cancel" receberá um webhook com o resultado final da operação.

| Início do cpf | Enumerador                   | Descrição                                                                         | Ação   |
|---------------|------------------------------|-----------------------------------------------------------------------------------|--------|
| 2             | invalid_disbursement_account | Invalid disbursemente bank account                                                | cancel |
| 3             | operation_not_allowed_IR     | Operation not allowed due to operation deadline greatter than benefit termination | cancel |

:::caution Atenção
Todos os CPFs que não tiverem um cenário mapeado para o primeiro dígito, receberão um webhook com um erro padrão de cenário de teste não mapeado. 

| Enumerador    | Descrição                                                        |
|---------------|------------------------------------------------------------------|
| mock_error    | Informed document number is not a valid mock on test environment |
:::
---

## 4 - Envio de documentos

Segundo IN 138 do INSS é obrigatório o envio dos dados complementares do contrato.

Os documentos devem ser enviados através do [endpoint de upload de documentos.](../upload_de_documentos) e devem seguir a seguinte formatação:

| Validações     | Valores      |
|----------------|--------------|
| Formato        | JPEG         |
| Tamanho mínimo | 250 x 250 px |
| Tamanho máximo |     2 MB     |

:::caution Atenção
Contratos que tiverem documentos vinculados que não respeitam as regras de tamanho mínimo ou máximo serão cancelados permanentemente.
:::

Caso as validações não sejam atendidas, no momento que o parceiro seguir com a proposta após receber o saldo devedor, iremos devolver os seguintes erros :

**Formato inválido**

```json
{
    "title": "Invalid document format",
    "description": "The document: document_identification_back should be in JPEG format.",
    "translation": "O documento: document_identification_back deve estar no formato JPEG.",
    "code": "SSC000061"
}
```
  
**Tamanho inválido**

```json
{
    "title": "Invalid document size",
    "description": "The document: document_identification_back should have at least 250x250px.",
    "translation": "O documento: document_identification_back deve ter no mínimo 250x250px.",
    "code": "SSC000060"
}
```

Após o upload de documentos, as chaves dos documentos enviados devem ser informadas no payload de criação da proposta no tópico anterior dentro do campo *borrower* ou dentro do objeto de *related_parties** correspondente ao representante legal (*"role_type": "issuer_legal_representative"*):

```json
{
    "document_identification": "2893fc74-88fd-4cc9-a5c6-8a63d9d00f41",
    "document_identification_back": "e881ddf4-bc9a-48e0-9555-cac979f65431",
    "selfie": "ca37979e-6f11-4465-bf3b-69cd8307549c"
}
```

Ou ainda, após a criação da proposta, podem ser informadas através do seguinte endpoint:

ENDPOINT /debt/ DEBT-KEY /related_party/ RELATED-PARTY-KEY /attached_document
METHOD POST

Request Body

```json
{
    "document_identification": "2893fc74-88fd-4cc9-a5c6-8a63d9d00f41",
    "document_identification_back": "e881ddf4-bc9a-48e0-9555-cac979f65431",
    "selfie": "ca37979e-6f11-4465-bf3b-69cd8307549c"
}
```

:::info Informação
A **related_party_key** é retornada na response da criação de dívida dentro do objeto **borrower** e dentro de cada uma das partes relacionadas dentro de **related_party_list** se for o caso.
:::

---

## 5 - Simulando Proposta de Portabilidade e/ou Refinanciamento:

        **5.1. Simulação de Portabilidade com Refinanciamento:** 
Antes de realizar a digitação da Proposta de Portabilidade com Refinanciamento, é possível simular as condições financeiras da proposta, sem a necessidade de coletar os dados cadastrais do cliente.

        **5.1.1. Simulação de Portabilidade com Refinanciamento, com taxa fixa:**
Assim como na Digitação da Proposta (3.1.1), é possível realizar a simulação fixando a taxa do contrato:

        **Request**
- MÉTODO POST
- STATUS /v2/credit_transfer/proposal_simulation

        *Request:*

**body.json**

```json
{
	"borrower": {
		"person_type": "natural"
	},
	"collaterals": [{
		"collateral_type": "social_security"
	}],
	"portability_credit_operation": {
		"financial": {
			"monthly_interest_rate": 0.0132,
			"number_of_installments": 10
		}
	},
	"refinancing_credit_operation": {
		"financial": {
                        "days_to_accrual": 0,
			"monthly_interest_rate": 0.0132,
			"installment_face_value": 100,
			"number_of_installments": 10
		}
	},
	"origin_contract": {
		"last_due_balance": 997.87,
        "installment_number": "84",
        "opened_installment_number": "81",
        "overdue_installment_number": "0"

	}
}
```

:::info
No payload acima, são descritos os dados mínimos para realização da simulação.
:::

        **Response**
- MÉTODO POST
- STATUS /v2/credit_transfer/proposal_simulation

        *Payload:*

**response.json**

```json

{
    "borrower": {
        "individual_document_number": "98765432100",
        "related_party_key": "fa55dca3-3147-45d2-bb8d-941f2d7191da",
        "role_type": "issuer"
    },
    "portability_credit_operation": {
        "credit_operation_key": "a66675e6-bdc2-4468-8420-2889d5cec0a8",
        "credit_operation_status": "waiting_signature",
        "disbursement_accounts": [],
        "disbursement_options": [
            {
                "annual_cet": 0.173044,
                "cet": 0.0134,
                "contract_fee_amount": 0.0,
                "contract_fees": [
                    {
                        "amount": 0.5,
                        "amount_type": "percentage",
                        "fee_amount": 0.0,
                        "fee_type": "tac"
                    }
                ],
                "disbursed_issue_amount": 997.87,
                "disbursement_date": "2023-12-22",
                "external_contract_fee_amount": 0.0,
                "external_contract_fees": [
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "spread",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    },
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "tac",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    },
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "insurance_premium",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    }
                ],
                "installments": [
                    {
                        "business_due_date": "2024-02-22",
                        "calendar_days": 62,
                        "due_date": "2024-02-22",
                        "due_principal": 997.87,
                        "installment_number": 1,
                        "pre_fixed_amount": 27.413791524708554,
                        "principal_amortization_amount": 81.34620847529145,
                        "total_amount": 108.76,
                        "workdays": 40
                    },
                    {
                        "business_due_date": "2024-03-22",
                        "calendar_days": 29,
                        "due_date": "2024-03-22",
                        "due_principal": 916.5237915247086,
                        "installment_number": 2,
                        "pre_fixed_amount": 11.692366920719124,
                        "principal_amortization_amount": 97.06763307928088,
                        "total_amount": 108.76,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-04-22",
                        "calendar_days": 31,
                        "due_date": "2024-04-22",
                        "due_principal": 819.4561584454277,
                        "installment_number": 3,
                        "pre_fixed_amount": 11.179911547915339,
                        "principal_amortization_amount": 97.58008845208467,
                        "total_amount": 108.76,
                        "workdays": 20
                    },
                    {
                        "business_due_date": "2024-05-22",
                        "calendar_days": 30,
                        "due_date": "2024-05-22",
                        "due_principal": 721.876069993343,
                        "installment_number": 4,
                        "pre_fixed_amount": 9.5288330736045,
                        "principal_amortization_amount": 99.2311669263955,
                        "total_amount": 108.76,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-06-24",
                        "calendar_days": 33,
                        "due_date": "2024-06-24",
                        "due_principal": 622.6449030669476,
                        "installment_number": 5,
                        "pre_fixed_amount": 9.046812945831448,
                        "principal_amortization_amount": 99.71318705416856,
                        "total_amount": 108.76,
                        "workdays": 22
                    },
                    {
                        "business_due_date": "2024-07-22",
                        "calendar_days": 28,
                        "due_date": "2024-07-22",
                        "due_principal": 522.9317160127789,
                        "installment_number": 6,
                        "pre_fixed_amount": 6.439743824282488,
                        "principal_amortization_amount": 102.32025617571752,
                        "total_amount": 108.76,
                        "workdays": 20
                    },
                    {
                        "business_due_date": "2024-08-22",
                        "calendar_days": 31,
                        "due_date": "2024-08-22",
                        "due_principal": 420.61145983706143,
                        "installment_number": 7,
                        "pre_fixed_amount": 5.738438681013405,
                        "principal_amortization_amount": 103.0215613189866,
                        "total_amount": 108.76,
                        "workdays": 23
                    },
                    {
                        "business_due_date": "2024-09-23",
                        "calendar_days": 32,
                        "due_date": "2024-09-23",
                        "due_principal": 317.58989851807485,
                        "installment_number": 8,
                        "pre_fixed_amount": 4.473657660291388,
                        "principal_amortization_amount": 104.28634233970861,
                        "total_amount": 108.76,
                        "workdays": 22
                    },
                    {
                        "business_due_date": "2024-10-22",
                        "calendar_days": 29,
                        "due_date": "2024-10-22",
                        "due_principal": 213.30355617836625,
                        "installment_number": 9,
                        "pre_fixed_amount": 2.721176981322744,
                        "principal_amortization_amount": 106.03882301867725,
                        "total_amount": 108.76,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-11-22",
                        "calendar_days": 31,
                        "due_date": "2024-11-22",
                        "due_principal": 107.26473315968899,
                        "installment_number": 10,
                        "pre_fixed_amount": 1.4934220715493307,
                        "principal_amortization_amount": 107.26657792845067,
                        "total_amount": 108.76,
                        "workdays": 22
                    }
                ],
                "issue_amount": 997.87,
                "number_of_installments": 10,
                "prefixed_interest_rate": {
                    "annual_rate": 0.17042118,
                    "daily_rate": 0.00043722,
                    "interest_base": "calendar_days",
                    "monthly_rate": 0.0132
                },
                "total_iof": 0.0
            }
        ],
        "final_disbursement_amount": 0.0
    },
    "proposal_key": "28a925f6-570e-4724-9132-3bd42f267c4f",
    "proposal_number": "17032788499215403",
    "proposal_status": "pending_submission",
    "refinancing_credit_operation": {
        "credit_operation_key": "aaf9abe0-2b8a-4688-8e09-413e1bd5285e",
        "credit_operation_status": "waiting_signature",
        "disbursement_accounts": [],
        "disbursement_options": [
            {
                "annual_cet": 0.172031,
                "cet": 0.0133,
                "contract_fee_amount": -0.4,
                "contract_fees": [
                    {
                        "amount": 0.5,
                        "amount_type": "percentage",
                        "fee_amount": -0.4,
                        "fee_type": "tac"
                    }
                ],
                "disbursed_issue_amount": 918.04,
                "disbursement_date": "2023-12-22",
                "external_contract_fee_amount": 0.0,
                "external_contract_fees": [
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "spread",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    },
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "tac",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    },
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "insurance_premium",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    }
                ],
                "installments": [
                    {
                        "business_due_date": "2024-02-22",
                        "calendar_days": 62,
                        "due_date": "2024-02-22",
                        "due_principal": 917.64,
                        "installment_number": 1,
                        "pre_fixed_amount": 25.2095730147,
                        "principal_amortization_amount": 74.7904269853,
                        "total_amount": 100.0,
                        "workdays": 40
                    },
                    {
                        "business_due_date": "2024-03-22",
                        "calendar_days": 29,
                        "due_date": "2024-03-22",
                        "due_principal": 842.8495730147,
                        "installment_number": 2,
                        "pre_fixed_amount": 10.7524369787,
                        "principal_amortization_amount": 89.2475630213,
                        "total_amount": 100.0,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-04-22",
                        "calendar_days": 31,
                        "due_date": "2024-04-22",
                        "due_principal": 753.6020099934,
                        "installment_number": 3,
                        "pre_fixed_amount": 10.2814172859,
                        "principal_amortization_amount": 89.7185827141,
                        "total_amount": 100.0,
                        "workdays": 20
                    },
                    {
                        "business_due_date": "2024-05-22",
                        "calendar_days": 30,
                        "due_date": "2024-05-22",
                        "due_principal": 663.8834272793,
                        "installment_number": 4,
                        "pre_fixed_amount": 8.7632941742,
                        "principal_amortization_amount": 91.2367058258,
                        "total_amount": 100.0,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-06-24",
                        "calendar_days": 31,
                        "due_date": "2024-06-22",
                        "due_principal": 572.6467214535,
                        "installment_number": 5,
                        "pre_fixed_amount": 7.8126464787,
                        "principal_amortization_amount": 92.1873535213,
                        "total_amount": 100.0,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-07-22",
                        "calendar_days": 30,
                        "due_date": "2024-07-22",
                        "due_principal": 480.4593679322,
                        "installment_number": 6,
                        "pre_fixed_amount": 6.3420966342,
                        "principal_amortization_amount": 93.6579033658,
                        "total_amount": 100.0,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-08-22",
                        "calendar_days": 31,
                        "due_date": "2024-08-22",
                        "due_principal": 386.8014645664,
                        "installment_number": 7,
                        "pre_fixed_amount": 5.2771618926,
                        "principal_amortization_amount": 94.7228381074,
                        "total_amount": 100.0,
                        "workdays": 23
                    },
                    {
                        "business_due_date": "2024-09-23",
                        "calendar_days": 31,
                        "due_date": "2024-09-22",
                        "due_principal": 292.078626459,
                        "installment_number": 8,
                        "pre_fixed_amount": 3.9848593609,
                        "principal_amortization_amount": 96.0151406391,
                        "total_amount": 100.0,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-10-22",
                        "calendar_days": 30,
                        "due_date": "2024-10-22",
                        "due_principal": 196.0634858199,
                        "installment_number": 9,
                        "pre_fixed_amount": 2.5880710578,
                        "principal_amortization_amount": 97.4119289422,
                        "total_amount": 100.0,
                        "workdays": 22
                    },
                    {
                        "business_due_date": "2024-11-22",
                        "calendar_days": 31,
                        "due_date": "2024-11-22",
                        "due_principal": 98.6515568777,
                        "installment_number": 10,
                        "pre_fixed_amount": 1.3459361963,
                        "principal_amortization_amount": 98.6540638037,
                        "total_amount": 100.0,
                        "workdays": 22
                    }
                ],
                "issue_amount": 917.64,
                "number_of_installments": 10,
                "prefixed_interest_rate": {
                    "annual_rate": 0.17042118,
                    "daily_rate": 0.00043722,
                    "interest_base": "calendar_days",
                    "monthly_rate": 0.0132
                },
                "total_iof": 0.0
            }
        ],
        "final_disbursement_amount": -79.83
    }
}

```

        **5.1.2. Simulação de Portabilidade com Refinanciamento, com valor liberado fixo:** 
Assim como na digitação da proposta (**3.1.2**), é possível realizar a simulação fixando o valor liberado ao cliente:

        **Request**
- MÉTODO POST
- STATUS /v2/credit_transfer/proposal_simulation

        *Payload:*

**payload.json**

```json

{
	"borrower": {
		"person_type": "natural"
	},
	"collaterals": [{
		"collateral_type": "social_security"
	}],
	"portability_credit_operation": {
		"financial": {
			"installment_face_value": 100,
			"number_of_installments": 10
		}
	},
	"refinancing_credit_operation": {
		"financial": {
            "days_to_accrual": 0,
            "disbursed_amount": 1000,
			"installment_face_value": 100,
			"number_of_installments": 10
		}
	},
	"origin_contract": {
		"last_due_balance": 997.87,
        "installment_number": "84",
        "opened_installment_number": "81",
        "overdue_installment_number": "0"

	}
}
```

        **Response**
- MÉTODO POST
- STATUS /v2/credit_transfer/proposal_simulation

        *Payload:*

**payload.json**

```json

{
	"portability_credit_operation": {
		"fine_configuration": {
			"contract_fine_rate": 0.02,
			"interest_base": "calendar_days",
			"monthly_rate": 0.01
		},
		"disbursement_options": [{
			"installments": [{
					"bank_slip_key": null,
					"digitable_line": null,
					"business_due_date": "2021-08-09",
					"calendar_days": 53,
					"due_date": "2021-08-08",
					"due_principal": 997.87,
					"installment_key": "e3bedf31-1e87-4ba4-a36c-d52f7f5c9036",
					"installment_number": 1,
					"pre_fixed_amount": 54.84865004983954,
					"principal_amortization_amount": 306.98134995016045,
					"total_amount": 361.83,
					"workdays": 37
				},
				{
					"bank_slip_key": null,
					"digitable_line": null,
					"business_due_date": "2021-09-08",
					"calendar_days": 31,
					"due_date": "2021-09-08",
					"due_principal": 690.89,
					"installment_key": "e8406cdb-844c-4e6d-9620-3635fab9d8d1",
					"installment_number": 2,
					"pre_fixed_amount": 21.964874249804833,
					"principal_amortization_amount": 339.86512575019515,
					"total_amount": 361.83,
					"workdays": 22
				}
			],
			"prefixed_interest_rate": {
				"annual_rate": 0.44556431,
				"daily_rate": 0.00564312,
				"monthly_rate": 0.0556431,
				"interest_base": "calendar_days_365"
			},
			"iof_amount": 0,
			"external_contract_fee_amount": 0,
			"external_contract_fees": [],
			"contract_fee_amount": 0,
			"contract_fees": [],
			"number_of_installments": 2,
			"disbursed_issue_amount": 1000,
			"issue_amount": 1000,
			"disbursement_date": "2021-05-31",
			"cet": 1.212,
			"annual_cet": 32.122
		}]
	},
	"refinancing_credit_operation": {
		"fine_configuration": {
			"contract_fine_rate": 0.02,
			"interest_base": "calendar_days",
			"monthly_rate": 0.01
		},
		"disbursement_options": [{
			"installments": [{
					"bank_slip_key": null,
					"digitable_line": null,
					"business_due_date": "2021-08-09",
					"calendar_days": 53,
					"due_date": "2021-08-08",
					"due_principal": 997.87,
					"installment_key": "e3bedf31-1e87-4ba4-a36c-d52f7f5c9036",
					"installment_number": 1,
					"pre_fixed_amount": 54.84865004983954,
					"principal_amortization_amount": 306.98134995016045,
					"total_amount": 361.83,
					"workdays": 37
				},
				{
					"bank_slip_key": null,
					"digitable_line": null,
					"business_due_date": "2021-09-08",
					"calendar_days": 31,
					"due_date": "2021-09-08",
					"due_principal": 690.89,
					"installment_key": "e8406cdb-844c-4e6d-9620-3635fab9d8d1",
					"installment_number": 2,
					"pre_fixed_amount": 21.964874249804833,
					"principal_amortization_amount": 339.86512575019515,
					"total_amount": 361.83,
					"workdays": 22
				}
			],
			"prefixed_interest_rate": {
				"annual_rate": 0.44556431,
				"daily_rate": 0.00564312,
				"monthly_rate": 0.0556431,
				"interest_base": "calendar_days_365"
			},
			"iof_amount": 0,
			"external_contract_fee_amount": 0,
			"external_contract_fees": [],
			"contract_fee_amount": 0,
			"contract_fees": [],
			"number_of_installments": 2,
			"disbursed_issue_amount": 1000,
			"issue_amount": 1000,
			"disbursement_date": "2021-05-31",
			"cet": 1.212,
			"annual_cet": 32.122
		}]
	}
}

```

        **5.2. Simulação de Portabilidade:**
Também é possível simular as condições financeiras de uma Proposta de Portabilidade (Portabilidade Pura), sem a necessidade de coletar os dados cadastrais do cliente.

        **Request**
- MÉTODO POST
- STATUS /v2/credit_transfer/proposal_simulation

        *Payload:*

**payload.json**

```json
{
	"borrower": {
		"person_type": "natural"
	},
	"collaterals": [{
		"collateral_type": "social_security"
	}],
	"portability_credit_operation": {
		"financial": {
			"monthly_interest_rate": 0.0132,
			"installment_face_value": 100,
			"number_of_installments": 10
		}
	},
	"origin_contract": {
		"last_due_balance": 997.87,
        "installment_number": "84",
        "opened_installment_number": "81",
        "overdue_installment_number": "0"

	}
}
```
 

        **Response**
- MÉTODO POST
- STATUS /v2/credit_transfer/proposal_simulation

        *Payload:*

**payload.json**

```json
{
	"portability_credit_operation": {
		"fine_configuration": {
			"contract_fine_rate": 0.02,
			"interest_base": "calendar_days",
			"monthly_rate": 0.01
		},
		"disbursement_options": [{
			"installments": [{
					"bank_slip_key": null,
					"digitable_line": null,
					"business_due_date": "2021-08-09",
					"calendar_days": 53,
					"due_date": "2021-08-08",
					"due_principal": 997.87,
					"installment_key": "e3bedf31-1e87-4ba4-a36c-d52f7f5c9036",
					"installment_number": 1,
					"pre_fixed_amount": 54.84865004983954,
					"principal_amortization_amount": 306.98134995016045,
					"total_amount": 361.83,
					"workdays": 37
				},
				{
					"bank_slip_key": null,
					"digitable_line": null,
					"business_due_date": "2021-09-08",
					"calendar_days": 31,
					"due_date": "2021-09-08",
					"due_principal": 690.89,
					"installment_key": "e8406cdb-844c-4e6d-9620-3635fab9d8d1",
					"installment_number": 2,
					"pre_fixed_amount": 21.964874249804833,
					"principal_amortization_amount": 339.86512575019515,
					"total_amount": 361.83,
					"workdays": 22
				}
			],
			"prefixed_interest_rate": {
				"annual_rate": 0.44556431,
				"daily_rate": 0.00564312,
				"monthly_rate": 0.0556431,
				"interest_base": "calendar_days_365"
			},
			"iof_amount": 0,
			"external_contract_fee_amount": 0,
			"external_contract_fees": [],
			"contract_fee_amount": 0,
			"contract_fees": [],
			"number_of_installments": 2,
			"disbursed_issue_amount": 1000,
			"issue_amount": 1000,
			"disbursement_date": "2021-05-31",
			"cet": 1.212,
			"annual_cet": 32.122
		}]
	}
}

```
 

--- 

## 6 - Formalização da Proposta:
        Para formalização das operações de Portabilidade e/ou Refinanciamento (Troco), deve-se enviar as evidências de assinatura dos contratos gerados na digitação da Proposta.

**No payload de assinatura devem conter os campos obrigatórios relacionados aos documentos enviados no item 4. Os campos obrigatórios são os seguintes: _ip_address_ e _signature_datetime_.**

        **6.1.** Para assinatura da Operação de Portabilidade o Parceiro deve realizar a seguinte chamada:

        **Request**
- MÉTODO POST
- STATUS /v2/credit_transfer/proposal/ PROPOSAL-KEY /portability_credit_operation/signature

        *Payload:*

**payload.json**

```json
{
    "type": "pdf-signature",
    "biometry_analysis_reference": "SERPRO",
    "signature_datetime": "2023-12-22T15:01:32.482Z",
    "signed_pdf_path": "https://termos-originacao.s3.amazonaws.com/5cd2a7f9",
    "ip_address": "179.145.48.219",
    "similarity_score": "0.9750000000000001"
}

```

### Enumeradores _Biometry Analysis Reference_
| Enumerador    | Descrição                                                                                                                                                                                                                                                          |
|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **serpro**    | Utilizado quando o similarity_score for retornado através de consulta realizada na base de documentos com foto do Detran (Serviço prestado através da Serpro)                                                                                                      |
| **tse**       | Utilizado quando o similarity_score for retornado através de consulta realizada na base de documentos com foto do TSE                                                                                                                                              |
| **not_found** | Deve ser informado quando a biometria facial não for localizada em nenhuma das bases governamentais anteriores (serpro ou tse). Neste caso o similarity_score deve ser null ou o grau de similaridade da selfie com o documento oficial com foto, retornado pelo parceiro. |

        A conclusão da assinatura será notificada de forma assíncrona:

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal.credit_operation

        *Body:*

**body.json**

```json
{
	"webhook_type": "credit_transfer.proposal.credit_operation",
	"proposal_key": "\<PROPOSAL-KEY\>",
	"event_datetime": "2022-11-24T15:42:12",
	"data": {
		"credit_operation_type": "portability",
		"credit_operation_key": "\<CREDIT-OPERATION-KEY\>",
		"document_key": "\<GUID DO DOCUMENTO NA QI\>",
		"signed_document_url": "\<LINK DO URL DO PDF ASSINADO\>",
		"credit_operation_status": "signed"
	}
}

```

        **6.2.** Para assinatura da Operação de Refinanciamento (Troco) o Parceiro deve realizar a seguinte chamada:

        **Request**

- MÉTODO POST
- ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /refinancing_credit_operation/signature

        *Payload:*

**payload.json**

```json
{
    "type": "pdf-signature",
    "signed_pdf_path": "\<LINK PUBLICO DO PDF ASSINADO\>",
	"ip_address": "192.168.0.0",
	"signature_datetime": "2020-03-20T14:28:23.382748Z",
	"similarity_score": 0.98000,
	"biometry_analysis_reference": "serpro"
}
```

        A conclusão da assinatura será notificada de forma assíncrona:

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal.credit_operation

        *Body:*

**body.json**

```json

{
	"webhook_type": "credit_transfer.proposal.credit_operation",
	"proposal_key": "\<PROPOSAL-KEY\>",
	"event_datetime": "2022-11-24T15:42:12",
	"data": {
		"credit_operation_type": "refinancing",
		"credit_operation_key": "\<CREDIT-OPERATION-KEY\>",
		"document_key": "\<GUID DO DOCUMENTO NA QI\>",
		"signed_document_url": "\<LINK DO URL DO PDF ASSINADO\>",
		"credit_operation_status": "signed"
	}
}

```

 
--- 
 

## 7 - Máquina de Status da Proposta de Portabilidade:

        Os estados da Proposta de Portabilidade refletem as etapas envolvidas no processo de portabilidade de crédito dentro do CTC (Central de Transferência de Crédito) da CIP.
Segue abaixo a descrição do fluxo e do significado de cada status envolvido em uma Proposta de Portabilidade, desde sua digitação até sua liquidação.

        **7.1. pending_response:**
Status da proposta após realização da digitação. Neste status a proposta foi recebida com sucesso pela QI e enviada para o CTC - CIP.

                **6.1.1 rejected:** 
Caso a digitação da proposta seja rejeitada pelo CTC - CIP, será enviado um webhook com o motivo da rejeição:

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS rejected

        *Body:*

**body.json**

```json
{
  "webhook_type": "credit_transfer.proposal",
  "proposal_key": "\<PROPOSAL-KEY\>",
  "proposal_status": "rejected",
  "event_datetime": "2022-11-24T15:42:12",
  "data": {
    "error": {
        "code": "ECTC0023",
        "reason": "Contrato com portabilidade em andamento"
    }
  }
}

```

                **7.1.1 rejected reasons:** 
Caso a digitação da proposta seja rejeitada pelo CTC - CIP, será enviado um webhook com o motivo da rejeição:

 
| reason                             | description                                                                                                                   | external_code |
|------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|---------------|
| portability_in_progress            | Contrato com portabilidade em andamento                                                                                       | ECTC0023      |
| portability_finished               | Portabilidade já finalizada para o contrato informado                                                                         | ECTC0028      |
| portability_in_expiration_progress | Portabilidade não permitida. Contrato com portabilidade em situação de "Decurso de prazo" por não efetivação da portabilidade | ECTC0085      |
| unexpected_error                   | Erro inesperado                                                                                                               | ECTC9999      |
| portability_payment_rejected       | Pagamento de portabilidade rejeitado.                                                                                         |               |
| divergent_due_balance              | Saldo devedor final deve ser menor que saldo devedor devolvido pela cip.                                                      |               |

        **7.2. pending_acceptance:** Status da Proposta após envio/aceite pelo CTC - CIP. A Proposta, neste momento, está aguardando resposta de saldo devedor pelo banco credor original. Neste momento é enviado um webhook com o número da Portabilidade no CTC - CIP:

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS pending_acceptance

        *Body:*

**body.json**

```json

{
    "webhook_type": "credit_transfer.proposal",
    "proposal_key": "\<PROPOSAL-KEY\>",
    "proposal_status": "pending_acceptance",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
        "portability_number": "202211230000246536429",
        "inclusion_date": "2022-11-24",
        "due_balance_expected_return_date": "2022-12-01"
    }
}
```

:::info
O **“portability_number“** é o Número da Portabilidade dentro do CTC - CIP, e é o número utilizado pela instituição proponente e instituição credora original para localizar a Proposta de Portabilidade.
:::

        Assim que o banco credor original responder à solicitação de portabilidade, será enviado um webhook com a resposta do valor do saldo devedor no caso da não retenção, e com a informação de “retido”, no caso da retenção:

        **7.2.1. accepted:** Status da Proposta quando o banco credor original retorna o saldo devedor e não retem o crédito. Será enviado um webhook com a informação do saldo devedor.
O banco credor original tem até 5 d.u. após a recepção da Proposta de Portabilidade, para envio da resposta com a informação do saldo devedor da operação.

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS accepted

        *Body:*

**body.json**

```json

{
	"webhook_type": "credit_transfer.proposal",
	"proposal_key": "\<PROPOSAL-KEY\>",
	"proposal_status": "accepted",
	"event_datetime": "2022-11-24T15:42:12",
	"data": {
		"final_due_balance": 1000,
		"portability_number": "202211230000246536429",
		"original_contract": {
			"origin_contract_number": "5584745",
			"origin_ispb_number": "60746948",
			"origin_document_number": "90406718261",
			"origin_operation_type": "0202",
			"installment_face_value": 1000,
			"total_iof": 1,
			"first_due_date": "2021-05-31",
			"last_due_date": "2022-05-31",
			"interest": 1,
			"cet": 1,
			"installment_number": 12,
			"amortization": 1,
			"final_due_balance": 1000,
			"final_due_date": "2021-08-31",
			"contract_date": "2021-04-31"
		}
	}
}
```

        Com a informação do saldo devedor retornado pela instituição credora original, o parceiro tomará a decisão se seguir ou não com a Portabilidade. 

:::info
Horário limite para envio do saldo devedor pela instituição credora original é às 10:00.
:::

        Após o recebimento do saldo devedor, caso o Parceiro decida seguir com a Proposta Portabilidade, ele deve realizar a seguinte chamada:

        **Request**

- MÉTODO PATCH
- ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY

        *Payload:*

**payload.json**

```json
{
    "status":"accepted_by_requester"
}
```

        O Parceiro pode adicionar dados de novo valor de parcela ou nova taxa nessa chamada, caso queira alterá-los:

        **Request**

- MÉTODO PATCH
- ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY

        *Payload:*

**payload.json**

```json
{
    "status":"accepted_by_requester",
	"financial": {
		"installment_face_value": 100
	}
	
}
```

        **Request**

- MÉTODO PATCH
- ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY

        *Payload:*

**payload.json**

```json
{
    "status":"accepted_by_requester",
	"financial": {
		"monthly_interest_rate": 0.01
	}
	
}
```

:::danger Atenção!
Caso o valor da parcela seja maior que valor total disponível (valor da parcela do contrato de origem + margem total disponível do benefício),
será retornado o seguinte erro: 
```json
{
    "title": "Reservation amount greater than available total balance",
    "description": "The installment face value: 54.4 is greater than the available total balance (origin installment face value + available total balance):30.4. Available total balance: -20.0.",
    "translation": "O valor da parcela: 54.4 é maior que o valor total disponível (valor da parcela do contrato de origem + margem total disponível) : 30.4. Margem total diponível: -20.0.",
    "code": "SSC000059"
}

```
Ao receber esta crítica, é possível que uma nova chamada seja feita, alterando o valor da parcela para que ela se ajuste ao valor total disponível.

Se o ajuste no valor da parcela não for feito até o horário limite para aceite do saldo devedor, será necessária uma nova digitação de proposta.
:::

        Caso o Parceiro decida por não prosseguir com a Proposta de Portabilidade, ele deve, **obrigatoriamente** realizar a seguinte chamada para informar a desistência da Portabilidade:

        **Request**

- MÉTODO DELETE
- ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY

        Após o envio do cancelamento da Proposta de Portabilidade ao CTC - CIP, será enviado um webhook de Proposta Cancelada:

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS canceled

        *Body:*

**body.json**

```json

{
    "webhook_type": "credit_transfer.proposal",
    "proposal_status": "canceled",
    "proposal_key": "\<PROPOSAL-KEY\>",
    "event_datetime": "2022-11-24T15:42:12"
}

```

:::info
O horário limite para aceite do saldo devedor é 16:30. 
Não é possível retomar uma Proposta com status “canceled”. Caso a Proposta esteja com este status, será necessária a realização de uma nova digitação.
:::
 

        **7.2.2. retained:**  Status da Proposta quando o banco credor original retem o crédito, será enviado o webhook com a informação de retenção. O banco credor original do crédito tem até 2 d.u. após a recepção da Proposta de Portabilidade, para envio da resposta de retenção do crédito.

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS retained

        *Body:*

**body.json**

```json

{
  "webhook_type": "credit_transfer.proposal",
  "proposal_key": "\<PROPOSAL-KEY\>",
  "proposal_status": "retained",
  "event_datetime": "2022-11-24T15:42:12",
  "data": {
    "retained_reason": {
      "reason": "issuer_retention",
      "description": "Retenção do Cliente"
    }
  }
}
```

### Detalhamento de campos no webhook de proposal
| Campo                     | Descrição                           | Valores                          |
|---------------------------|-------------------------------------|----------------------------------|
| reason                    | lista dos motivos de retenção de uma Proposta  | [Enumeradores](#retention_reason_enumerator) |
 

        **7.3. accepted_by_requester:** Após aprovada pelo parceiro, a Proposta segue o fluxo interno da QI para liquidação.

        **7.4. settlement_sent:** 
Após conclusão do fluxo interno da QI para liquidação da Proposta de Portabilidade o recurso para pagamento do saldo devedor é enviado ao credor original disparando o seguinte webhook para o Parceiro:

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS settlement_sent

        *Body:*

**body.json**

```json

{
	"webhook_type": "credit_transfer.proposal",
	"proposal_key": "\<PROPOSAL KEY\>",
	"proposal_status": "settlement_sent",
	"event_datetime": "2022-11-24T15:42:12",
	"data": {
		"receipt": {
			"amount": 1000,
			"timestamp": "2022-09-14 11:55:31",
			"description": "237 0001 1000093 1000093-3 59588111000103 - BCO BRADESCO S.A.",
			"ted_receipt_document_key": "a34e84a2-1628-4f23-8c11-2b2f4656ced1",
			"ted_receipt_url": "https://qitech.com.br/",
			"transaction_key": "ed3e84a2-1628-4f23-8c11-2b2f4656cedf",
			"origin": {
				"account_key": "ed3e84a2-1628-4f23-8c11-2b2f4656cedf",
				"bank_code": "329",
				"branch": "0001",
				"branch_digit": null,
				"account_number": "1000361",
				"account_digit": "3",
				"type": "checking_account",
				"name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
				"document": "32402502000135"
			},
			"destination": {
				"bank_code": "237",
				"branch": "0001",
				"branch_digit": null,
				"account_number": "1000093",
				"account_digit": "3",
				"type": "checking_account",
				"name": "BCO BRADESCO S.A.",
				"document": "59588111000103",
				"purpose": "Saída Liquidação de Portabilidade"
			}
		}
	}
}
```

Neste momento será iniciada averbação da Operação de Portabilidade na Dataprev. O processo de averbação acontecerá em paralelo aos itens seguintes (itens 7.5., 7.5.1. e 7.5.2.)

 

        **7.5. pending_settlement_confirmation:** Após a confirmação do envio dos recursos para pagamento do saldo devedor, é aguardada a confirmação da quitação do contrato por parte da Instituição Credora Original. Nesta etapa o Parceiro receberá o seguinte webhook:

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS pending_settlement_confirmation

        *Body:*

**body.json**

```json
{
    "webhook_type": "credit_transfer.proposal",
    "proposal_key": "\<PROPOSAL-KEY\>",
    "proposal_status": "pending_settlement_confirmation",
    "event_datetime": "2022-11-24T15:42:12"
}
```

:::info
A confirmação da quitação do contrato é encaminhada pela Instituição Credora Original ao CTC - CIP e posteriormente encaminhado pelo CTC - CIP à QI.

O SLA para confirmação da quitação da Portabilidade é de **2 d.u.** contados a partir do envio dos recursos para pagamento do saldo devedor do contrato original.
:::
 
        **7.5.1. paid:** Assim que a QI receber do CTC - CIP a confirmação da quitação do Contrato Original, a Proposta constará como paga e a Portabilidade estará finalizada. 

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS paid

        *Body:*

**body.json**

```json

{
    "webhook_type": "credit_transfer.proposal",
    "proposal_key": "\<PROPOSAL-KEY\>",
    "proposal_status": "paid",
    "event_datetime": "2022-11-24T15:42:12"
}
```

        Nesta etapa, caso a averbação da Operação de Portabilidade já esteja concluída, a Operação de Refinanciamento (Troco), poderá ser iniciada (fluxo descrito no item 7).

        **7.5.1.1.** A notificação sobre a averbação da Operação de Portabilidade será enviada através do seguinte webhook:

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal.collateral

        *Body:*

**body.json**

```json

{
    "webhook_type": "credit_transfer.proposal.collateral",
    "proposal_key": "\<PROPOSAL-KEY\>",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
        "credit_operation_type": "portability",
		"credit_operation_key": "\<CREDIT-OPERATION-KEY\>",
		"collateral_type": "social_security",
		"collateral_constituted": true,
		"collateral_data": {
                    "reservation_method": "portability", 
                }
	}
}
```
 
        data.collateral_data.reservation_method: [portability, new_credit ]

        **7.5.2. rejected:** 
Caso o banco credor original rejeite a quitação do contrato, o recurso enviado para quitação do saldo devedor do contrato original será devolvido, e a proposta será finalizada. O parceiro receberá o webhook de **“rejected”**.

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS rejected

        *Body:*

**body.json**

```json

{
    "webhook_type": "credit_transfer.proposal",
    "proposal_key": "\<PROPOSAL-KEY\>",
    "proposal_status": "rejected",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
        "error": {
            "code": "QCTC0001",
            "reason": "Pagamento de portabilidade rejeitado."
        }
    }
}
```
 

        Caso nesta etapa a Operação de Portabilidada já esteja averbada na Dataprev, será realizada a desaverbação da margem.

:::info
Não é possível retomar uma Proposta com status “**rejected**”. É sempre necessário realizar uma nova digitação.
:::

--- 

## 8 - Máquina de Status da Operação de Refinanciamento (Troco):
        **8.1** 
No momento em que a Operação de Portabilidade é paga, o Parceiro pode optar por seguir com a Operação de Refinanciamento (Troco) ou não.

#### Enumeradores credit_operation_status
| Enumerador               					| Descrição                  	 		|
|-------------------------------------------|---------------------------------------|
| waiting_signature  						| Operação aguardando assinatura 		|
| signed     								| Operação assinada			     		|
| issued  									| Operação emitida			     		|
| disbursed									| Operação desembolsada		     		|
| settled     								| Operação liquidada	         		|
| canceled     								| Operação cancelada		     		|
| canceled_permanently  					| Operação cancelada permanentemente    |

        **8.1.1.** Para prosseguir com o Refinanciamento (Troco), o Parceiro deve realizar a seguinte chamada:

        **Request**

- MÉTODO POST
- ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /refinancing_credit_operation/acceptance

**Financial body**

```json
{
    "financial": {
        "installment_face_value": 379.87,
        "monthly_interest_rate": 0.0166,
        "number_of_installments": 84,
        "limit_days_to_disburse": 7,
        "disbursement_date": "2024-07-02",
        "rebates": [
            {
                "rebate_bank_account": {
                    "bank_code": "329",
                    "account_digit": "9",
                    "document_number": "18533555000164",
                    "name": "Teste Ltda",
                    "account_number": "4290002",
                    "branch_number": "0001"
                },
                "amount_type": "percentage",
                "fee_type": "spread",
                "amount": 9.5
            },
            {
                "amount": 20,
                "rebate_bank_account": {
                    "name": "Teste Ltda",
                    "document_number": "18533555000164",
                    "account_digit": "0",
                    "account_number": "4290001",
                    "branch_number": "0001",
                    "bank_code": "329"
                },
                "amount_type": "percentage",
                "fee_type": "insurance_premium"
            }
        ]
    }
}
```

**Disbursement bank accounts body**

```json
{
    "disbursement_bank_accounts": [
        {
            "document_number": "92093764000197",
            "branch_number": "0001",
            "name": "TESTE LTDA",
            "percentage_receivable": 100,
            "account_number": "120012",
            "account_digit": "3",
            "bank_code": "329"
        }
    ]
}
```

        **Response:**

**response.json**

```json

{
	"credit_operation_key": "\<CREDIT-OPERATION-KEY\>",
	"contract_number": "00000002",
	"document_key": "\<DOCUMENT-KEY da CCB de Refinanciamento\>",
	"document_url": "\<URL da CCB de Refinanciamento\>",
	"credit_operation_status": "issued",
	"fine_configuration": {
		"contract_fine_rate": 0.02,
		"interest_base": "calendar_days",
		"monthly_rate": 0.01
	},
	"disbursement_options": [{
		"installments": [{
				"additional_costs": [],
				"bank_slip_key": null,
				"business_due_date": "2021-08-09",
				"calendar_days": 53,
				"digitable_line": null,
				"due_date": "2021-08-08",
				"due_interest": 0,
				"due_principal": 997.87,
				"fine_amount": null,
				"has_interest": true,
				"installment_key": "e3bedf31-1e87-4ba4-a36c-d52f7f5c9036",
				"installment_number": 1,
				"installment_status": "created",
				"installment_type": "principal",
				"paid_amount": 0,
				"paid_at": null,
				"post_fixed_amount": 0,
				"pre_fixed_amount": 54.84865004983954,
				"principal_amortization_amount": 306.98134995016045,
				"total_amount": 361.83,
				"workdays": 37
			},
			{
				"additional_costs": [],
				"bank_slip_key": null,
				"business_due_date": "2021-09-08",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2021-09-08",
				"due_interest": 0,
				"due_principal": 690.8886500498395,
				"fine_amount": null,
				"has_interest": true,
				"installment_key": "e8406cdb-844c-4e6d-9620-3635fab9d8d1",
				"installment_number": 2,
				"installment_status": "created",
				"installment_type": "principal",
				"paid_amount": 0,
				"paid_at": null,
				"post_fixed_amount": 0,
				"pre_fixed_amount": 21.964874249804833,
				"principal_amortization_amount": 339.86512575019515,
				"tax_amount": 0,
				"total_amount": 361.83,
				"workdays": 22
			}
		],
		"prefixed_interest_rate": {
				"annual_rate": 0.44556431,
				"daily_rate": 0.00564312,
				"monthly_rate": 0.0556431,
				"interest_base": "calendar_days_365"
		},
		"iof_amount": 50,
		"external_contract_fee_amount": 0,
		"external_contract_fees": [],
		"contract_fee_amount": 0,
		"contract_fees": [],
		"number_of_installments": 2,
		"disbursed_issue_amount": 997.87,
		"final_disbursement_amount": 100,
		"issue_amount": 1147.87,
		"disbursement_date": "2021-05-31",
		"cet": 1.212,
		"annual_cet": 32.122
	}],
	"disbursement_bank_account": {
		"account_digit": "1",
		"account_number": "00001",
		"ispb": "00000000",
		"branch_number": "0001"
	}
}
```

        **8.1.2.** Caso o Parceiro opte por não prosseguir com a Operação de Refinanciamento (Troco), ele deve realizar a seguinte chamada:

**Request**

- MÉTODO DELETE
- ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /refinancing_credit_operation
 

        **8.2. Averbação do Refinanciamento (Troco):** 
Assim que o Parceiro optar por prosseguir com a Operação de Refinanciamento, a rotina para averbação da margem consignável terá início. Assim que a averbação da margem consignável do INSS for concluída o parceiro recebera o seguinte webhook:

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal.collateral

        *Body:*

**body.json**

```json

{
    "webhook_type": "credit_transfer.proposal.collateral",
    "proposal_key": "\<PROPOSAL-KEY\>",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
        "credit_operation_type": "refinancing",
		"credit_operation_key": "\<CREDIT-OPERATION-KEY\>",
		"collateral_type": "social_security",
		"collateral_constituted": true
	}
}
```

        **8.3. Desembolo do Refinanciamento (Troco):**

        Assim que a averbação da margem consignável do INSS for concluída a operação estará pronta para desembolso.
No desembolso da Operação de Refinanciamento, a Operação de Portabilidade será quitada e caso exista valor desembolsado remanescente (**7.1.1. “disbursement_options.final_disbursement_amount”**), este valor será liberado para o cliente (Troco) na conta para desembolso da Operação (**“disbursement_bank_account“**).
A liberação do troco para o cliente pode ser realizada via PIX ou TED, em qualquer horário do dia (obedecendo horário comercial de 7:00 às 17:00 em dias úteis, no caso da TED).

        **8.3.1.** Caso o desembolso do troco para o cliente seja bem sucedido, será enviado um webhook com os dados da comprovação do desembolso:

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal.credit_operation

        *Body:*

**body.json**

```json

{
	"webhook_type": "credit_transfer.proposal.credit_operation",
	"proposal_key": "\<PROPOSAL-KEY\>",
	"event_datetime": "2022-11-24T15:42:12",
	"data": {
		"credit_operation_status": "disbursed",
		"credit_operation_type": "refinancing",
		"credit_operation_key": "\<CREDIT-OPERATION-KEY\>",
		"ted_receipt_list": [{
			"fee": 0,
			"url": "https://qitech.com.br/",
			"amount": 500,
			"origin": {
				"name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
				"type": "payment_account",
				"branch": "0001",
				"document": "32402502000135",
				"bank_code": "329",
				"account_key": "871059bd-4014-41ad-82b4-28275ff0e67b",
				"branch_digit": null,
				"account_digit": "5",
				"account_branch": "0001",
				"account_number": "00002"
			},
			"timestamp": "2022-09-28T13:00:47",
			"description": "DESCRIPTION",
			"destination": {
				"name": "Elaine Isadora da Cruz",
				"type": "checking_account",
				"bank_code": "033",
				"branch": "0001",
				"purpose": "Crédito PIX em Conta",
				"document_number": "90406718261",
				"bank_ispb": "90400888",
				"branch_digit": null,
				"account_digit": "1",
				"account_number": "00001"
			},
			"end_to_end_id": null,
			"transaction_key": "871059bd-4014-41ad-82b4-28275ff0e67b",
			"origin_transaction_key": null
		}]
	}
}
```
 

        **8.3.2.** Caso ocorra falha no desembolso, o parceiro receberá o seguinte webhook:

                **7.3.2.1.** Falha no desembolso via PIX:

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal.credit_operation

        *Body:*

**body.json**

```json

{
	"webhook_type": "credit_transfer.proposal.credit_operation",
	"proposal_key": "60fbbfe2-eb52-4825-9ed5-f169a58b9999",
	"event_datetime": "2022-11-24T15:42:12",
	"data": {
		"credit_operation_status": "canceled",
		"credit_operation_type": "refinancing",
		"credit_operation_key": "1a1a44df-29b6-431c-89af-53657d906333",
		"pix_refusal": {
            "reason_enumerator": "invalid_document_number",
            "reason": "CPF/CNPJ do usuário recebedor não é compatível com o titular da conta de destino."
        },
        "cancel_reason": "pix_refusal"
	}
}
```

                **7.3.2.2.** Falha no desembolso via TED:

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal.credit_operation

        *Body:*

**body.json**

```json
{
    "webhook": {
        "data": {
            "cancel_reason": "Agência ou Conta Destinatária do Crédito Inválida",
            "credit_operation_key": "1a1a44df-29b6-431c-89af-53657d906333",
            "credit_operation_type": "refinancing",
            "credit_operation_status": "canceled",
            "cancel_reason_enumerator": "agencia_conta_invalida"
        },
        "proposal_key": "60fbbfe2-eb52-4825-9ed5-f169a58b9999",
        "webhook_type": "credit_transfer.proposal.credit_operation",
        "event_datetime": "2023-12-22T10:15:25"
    }
}

```
 

        **8.3.3.** 
No caso de falha no desembolso da Operação, o desembolso pode ser retentato alterando-se os dados bancários:

        **Request**

- MÉTODO PATCH
- ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /refinancing_credit_operation

        *Payload:*

**payload.json**

```json
{
	"disbursement_date": "2022-11-04",
	"disbursement_bank_account": {
		"account_branch": "1232",
		"account_digit": "4",
		"account_number": "412412412",
		"account_type": "checking_account",
		"document_number": "\<CPF BENEFICIÁRIO\>",
		"ispb": "17298092",
		"name": "\<NOME BENEFICIÁRIO\>"
	}
}

```

## 9 - Consulta de Lista de Participantes do CTC - CIP:

        **Request**

- MÉTODO GET
- ENDPOINT /v2/credit_transfer/participants

        *Response:*

**response.json**

```json
[
    {
        "name": "\<NOME DO BANCO\>",
        "bank_code": "\<CÓDIGO DO BANCO\>",
        "ispb": "\<BASE DO CNPJ DO BANCO\>"
    }
]
 
```

## 10 - Recuperar resposta da última request

O last response é uma forma de mapear, de forma simples e objetiva, a resposta da comunicação entre a QI e a Dataprev, possibilitando saber quando essa requisição foi feita e qual o retorno obtido (através de um enumerador). Os enumeradores estão diretamente relacionados aos códigos de retorno da Dataprev e são divididos em duas formas: "errors" e "success". 

Cada enumerador tem uma descrição detalhada e o código de referência da Dataprev. Podemos conferir abaixo, com mais detalhes, como serão apresentados os dados do last response.

### Casos de sucesso

#### Request - Credit Transfer
ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /CREDIT-OPERATION-TYPE/collateral
METHOD GET

#### PATH PARAMETERS credit-operation-type
| Enumerador               					| Descrição                  		|
|-------------------------------------------|--------------------------------|
| refinancing_credit_operation  			| Operação de refinanciamento    |
| portability_credit_operation     			| Operação de portabilidade      |

#### Response

Response Body

```json
{
   "collateral_data":{
      "benefit_number":1976703155,
      "state":"PI",
      "last_response":{
         "success":[
            {
               "enumerator":"succesfully_included",
               "reservation_method":"portability"
            }
         ]
      },
      "last_response_event_datetime":"2023-05-22T19:13:02Z",
      "status":"reserved"
   },
   "collateral_constituted":true,
   "collateral_type":"social_security"
}
```

### Detalhamento de campos no retorno da request
| Campo                     | Descrição                           | Valores                          |
|---------------------------|-------------------------------------|----------------------------------|
| enumerator                | Retorno mapeado do código Dataprev  | [Enumeradores](#dataprev_response_enumerator_success)|
| reservation_method        | Método de averbação da reserva      | portability, new_credit, refinancing|

### Casos de erro

#### Request
ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /CREDIT-OPERATION-TYPE/collateral
METHOD GET

#### Response

Response Body

```json
{
  "collateral_constituted": false,
  "collateral_type": "type",
  "updated_at": "2023-05-24 19:13:02",
  "collateral_data": {
    "state": "SP",
    "benefit_number": 1976703155,
    "status": "pending_reservation",
    "last_response": {
      "errors": [
        {
          "enumerator": "benefit_blocked_by_tbm",
          "reservation_method" : "portability"
        },
        {
          "enumerator": "benefit_blocked_by_tbm",
          "reservation_method" : "new_credit"
        }
      ]
    },
    "last_response_event_datetime": "2023-05-22T19:13:02Z"
  }
}
```

### Detalhamento de campos no webhook de falha
| Campo                     | Descrição                           | Valores                          |
|---------------------------|-------------------------------------|----------------------------------|
| enumerator                | Retorno mapeado do código Dataprev  | [Enumeradores](#dataprev_response_enumerator_errors) |
| reservation_method        | Método de averbação da reserva      | portability, new_credit, refinancing|
## 11 - Webhook de resposta da última tentativa de averbação

Caso a operação não tenha sucesso na averbação, a mesma ficará em retentativa e será enviado o seguinte webhook, detalhando o motivo da não averbação, o horário desta tentativa e o método de averbação utilizado:

**Webhook portabilidade**

WEBHOOK_TYPE credit_transfer.proposal.credit_operation

  ```json

  {
    "webhook_type": "credit_transfer.proposal.collateral",
    "proposal_key": "\<PROPOSAL-KEY\>",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
      "credit_operation_type": "portability",
      "credit_operation_key": "\<CREDIT-OPERATION-KEY\>",
      "collateral_type": "social_security",
      "collateral_constituted": false,
      "collateral_data": {
        "status": "pending_reservation",
        "last_response": {
          "errors": [{
            "enumerator": "consignable_margin_excceded"
          }]
        },
        "last_response_event_datetime": "2023-05-22T19:13:02Z",
        "reservation_method": "new_credit",
      }
    }
  }

  ```
**Webhook refinanciamento**

WEBHOOK_TYPE credit_operation.collateral

  ```json

  {
    "webhook_type": "credit_operation.collateral",
    "key": "\<CREDIT-OPERATION-KEY\>",
    "event_time": "2022-11-24T15:42:12",
    "data": {
      "collateral_type": "social_security",
      "collateral_constituted": false,
      "collateral_data": {
        "status": "pending_reservation",
        "last_response": {
          "errors": [{
            "enumerator": "consignable_margin_excceded"
          }]
        },
        "last_response_event_datetime": "2023-05-22T19:13:02Z",
        "reservation_method": "refinancing",
      }
    }
  }

  ```

### Detalhamento de campos no webhook de falha
| Campo                     | Descrição                           | Valores                          |
|---------------------------|-------------------------------------|----------------------------------|
| enumerator                | Retorno mapeado do código Dataprev  | [Enumeradores](#dataprev_response_enumerator_errors) |
| reservation_method        | Método de averbação da reserva      | portability, new_credit, refinancing|

## 12 - Consulta de portabilidade de origem

É possível consultar os dados da portabilidade do banco de origem como, por exemplo, o número do benefício, a data de início da portabilidade, o número dos contratos excluídos, os valores das parcelas desaverbadas, ultima parcela paga, data de exclusão, entre outros.

        **Request**
- MÉTODO POST
- ENDPOINT /social_security/reservation/external_key/CREDIT-OPERATION-KEY/portability_origin_contract

        *Payload:*

**payload.json**

```json
{
    "request_type":"portability_number",
    "portability_number": "202402070000298096242"
}

```

        **Response**

- MÉTODO POST
- ENDPOINT /social_security/reservation/external_key/CREDIT-OPERATION-KEY/portability_origin_contract

        *Body:*

**body.json**

```json
{
    "origin_contract_request_key": "9bb68c89-4b88-400d-9359-99ad8d42a69e",
    "status": "pending_search",
    "status_events": [
        {
            "status": "pending_search"
        }
    ]
}

```

Em caso de sucesso na consulta do número de benefício

         **Webhook**

- WEBHOOK_TYPE social_security_portability_origin_contract_request
- STATUS Success

        *Body:*
 
**body.json**

```json
{
    "webhook": {
        "key": "25e93655-4713-488b-8800-7ac4fddf745f",
        "data": {
          "portability_number": 9223372036854776000,
          "portability_status": "open",
          "benefit_number": 1544326820,
          "portability_start_date": "2024-02-22",
          "deleted_contracts": [
            {
              "origin_bank": {
                "bank_code": 752,
                "name": "CETELEM-BNP"
              },
              "contract_number": "22-844817807/20",
              "last_installment_paid": 84,
              "exclusion_date": "22022024",
              "period_amount": 165.73
            }
          ]
        },
        "status": "success",
        "webhook_type": "social_security_portability_origin_contract_request",
        "event_datetime": "2024-02-26T21:36:22"
    }
}

```

Em caso de falha na consulta do número de benefício

        **Webhook**

- WEBHOOK_TYPE social_security_portability_origin_contract_request
- STATUS Failure

        *Body:*

**body.json**

```json
{
    "webhook": {
        "key": "522b5d7d-2dfc-4e92-99b7-d4df3d97edb2",
        "data": {
            "enumerator": "invalid_bank_code",
            "description": "Invalid bank code"
        },
        "status": "failure",
        "webhook_type": "social_security_portability_origin_contract_request",
        "event_datetime": "2024-02-26T21:36:22"
    }
}

```

## 13. Diminuir o valor das parcelas

Este endpoint permite a redução do valor das parcelas de um contrato de portabilidade de crédito. Esta funcionalidade é especialmente útil em casos onde a margem consignável é excedida devido ao banco de origem desaverbar uma quantia menor do que a esperada.

        **Request**
- MÉTODO PUT
- ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /portability_credit_operation

        *Payload:*

**payload.json**

```json
{
    "installment_face_value": 382.18
}

```

        **Response sucesso - HTTP 200**

        *Body:*

**body.json**

```json
{
        "credit_operation_key": "7aa77bca-c724-4c1a-bfae-9b1b7bd81ab2",
        "contract_number": "0000000007/WO",
        "document_key": "045a8f35-6170-4112-8d83-29a753d0c78e",
        "document_url": "http://teste.com",
        "signed_url": "signed_url_test",
        "credit_operation_status": "waiting_signature",
        "fine_configuration": {
            "contract_fine_rate": 0.02,
            "interest_base": "calendar_days",
            "monthly_rate": 0.01
        },
        "disbursement_accounts": [
            {
                "account_digit": "3",
                "account_branch": "0001",
                "account_number": "94134",
                "ispb": "32402502",
                "name": "Wilker Teste",
                "document_number": "37197645832"
            }
        ],
        "disbursement_options": [
            {
                "prefixed_interest_rate": {
                    "annual_rate": 3.0,
                    "daily_rate": 0.00385824,
                    "interest_base": "calendar_days",
                    "monthly_rate": 0.12246205
                },
                "total_iof": 7.03,
                "external_contract_fee_amount": 0.0,
                "external_contract_fees": [],
                "contract_fee_amount": 0.0,
                "number_of_installments": 3,
                "contract_fees": [],
                "disbursed_issue_amount": 1000.0,
                "issue_amount": 1007.03,
                "disbursement_date": "2022-08-24",
                "cet": 12.6,
                "annual_cet": 315.3944,
                "installments": [
                    {
                        "business_due_date": "2022-08-30",
                        "calendar_days": 5,
                        "due_date": "2022-08-29",
                        "due_principal": 1007.03,
                        "installment_number": 1,
                        "pre_fixed_amount": 84.43554587915118,
                        "principal_amortization_amount": 297.73445412084885,
                        "total_amount": 382.17,
                        "workdays": 3
                    },
                    {
                        "business_due_date": "2022-09-30",
                        "calendar_days": 31,
                        "due_date": "2022-09-29",
                        "due_principal": 709.2955458791512,
                        "installment_number": 2,
                        "pre_fixed_amount": 47.97894031795043,
                        "principal_amortization_amount": 334.19105968204957,
                        "total_amount": 382.17,
                        "workdays": 22
                    },
                    {
                        "business_due_date": "2022-11-01",
                        "calendar_days": 32,
                        "due_date": "2022-10-31",
                        "due_principal": 375.1044861971016,
                        "installment_number": 3,
                        "pre_fixed_amount": 7.055513802898396,
                        "principal_amortization_amount": 375.1044861971016,
                        "total_amount": 382.16,
                        "workdays": 21
                    }
                ],
                "final_disbursement_amount": 997.87
            }
        ],
        "final_disbursement_amount": 997.87,
        "collateral_is_constituted": false
    }
```

## 14. Mapeamento de enumeradores

### Enumeradores Retention Reason {#retention_reason_enumerator}
| Enumerador                               | Descrição                                              |
|------------------------------------------|--------------------------------------------------------|
| **issuer_retention**                     | Retenção do Cliente                                    |
| **different_from_original**              | Condições da proposta divergentes do contrato original |
| **issuer_lawsuit**                       | Cliente com ação judicial                              |
| **insurance_in_progress**                | Indenização de seguro em andamento                     |
| **collateral_in_execution**              | Garantia em Execução                                   |
| **contract_not_found**                   | Contrato não encontrado                                |
| **invalid_contract_type**                | Tipo de contrato inválido                              |
| **portability_in_progress**              | Portabilidade em andamento                             |
| **assigned_contract**                    | Contrato cedido                                        |
| **issuer_document_number_invalid**       | CPF não é do contrato                                  |
| **unrelated_issuer_document_number**     | CPF informado não é o do titular                       |
| **different_from_original**              | Condições da proposta divergentes do contrato original |
| **issuer_lawsuit**                       | Cliente com ação judicial                              |
| **assigned_without_co_obligation**       | Contrato cedido sem coobrigação                        |
| **insurance_in_progress**                | Indenização de seguro em andamento                     |
| **collateral_in_execution**              | Garantia em Execução                                   |
| **fgts_in_use**                          | FGTS AMORTIZAR em uso                                  |
| **fgts_funding**                         | FGTS funding                                           |
| **portability_not_requested**            | O cliente não solicitou a portabilidade                |
| **wrong_original_financial_institution** | IF Credora Original Incorreta                          |

### Tabela de retorno de erros Dataprev - averbação {#dataprev_response_enumerator_errors}
| Código Dataprev | Enumerador                                       | Descrição                                                   | Ação Qi              |
|-----------------|--------------------------------------------------|-------------------------------------------------------------|----------------------|
| HW              | consignable_margin_excceded                      | Exceeded consignable margin                                 | Teimosinha           |
| IT              | benefit_blocked_by_tbm                           | Benefit blocked due to benefit transfer                     | Teimosinha           |
| IE              | benefit_blocked_by_beneficiary                   | Benefit blocked by beneficiary                              | Teimosinha           |
| AN              | invalid_disbursement_account                     | Invalid disbursement bank account                           | Teimosinha             |
| HX              | reservation_already_included                     | Reservation already included                                | Confirmar averbação  |
| IF              | benefit_blocked_by_granting_process              | Benefit blocked during granting process                     | Teimosinha           |
| AV              | processing_payroll                               | Operation couldn`t be done during processing payroll period | Teimosinha           |
| OF              | invalid_cbc                                      | Invalid cbc                                                 | Teimosinha           |
| IA              | first_name_mismatch                              | First name mismatch benefit owner or legal representative   | Teimosinha           |
| OS              | legal_representative_document_number_mismatch    | Document number mismatch legal representative               | Teimosinha           |
| AY              | invalid_state                                    | Invalid state                                               | Teimosinha           |
| HZ              | operation_not_allowed_on_this_reservation_status | Operation couldn`t be done with current reservation status  | Teimosinha           |
| AP              | invalid_contract_date                            | Accrual, end or start contract date is invalid              | Teimosinha           |
| GA              | required_fields_missing                          | Required fields are missing                                 | Teimosinha           |
| BC              | cbc_missing                                      | CBC is missing                                              | Teimosinha           |
| NC              | contract_number_missing                          | Contract number is missing                                  | Teimosinha           |
| NB              | benefit_number_missing                           | Benefit number is missing                                   | Teimosinha           |
| CA              | invalid_bank_code                                | Invalid bank code                                           | Teimosinha           |
| HR              | exceeded_number_of_allowed_contracts             | Amount of contracts is above the limit                      | Teimosinha           |
| PV              | invalid_image_format                             | Image with wrong format                                     | Teimosinha           |
| IR              | operation_not_allowed_IR                         | Operation date is greater than benefit expiration           | Teimosinha             |
| PK              | wrong_bank_code_destination                      | Portability number was found with wrong bank code destination| Teimosinha          |
| PH              | wrong_benefit_number_on_portability              | Portability number was found with wrong benefit number      | Teimosinha           |
| PI              | invalid_contract_total_amount         | Reservation contract total amount should be greater than Dataprev reference amount     | Teimosinha           |

:::danger Atenção!
Todas as taxas e valores do contrato são validados no momento da criação da reserva.

A crítica "invalid_contract_total_amount" ocorre nos casos em que os contratos se estendem por muito tempo sem serem averbados, o que impacta os valores previamente estabelecidos.
:::

### Tabela de retorno de sucesso - averbação {#dataprev_response_enumerator_success}
| Código Dataprev | Enumerador               | Descrição                               |
|--------|--------------------------|-----------------------------------------|
| BD     | successfully_included    | Inclusion has been successfully done    |
| BF     | successfully_removed     | Removal has been successfully done      |
| BR     | successfully_reactivated | Reactivation has been successfully done |
| BS     | successfully_suspended   | Suspension has been successfully done   |

### Tabela de retorno de erros na consulta de saldo {#dataprev_balance_errors_enumerators}
| Código | Enumerador                            | Descrição                                                                       |
|--------|---------------------------------------|---------------------------------------------------------------------------------|
| CR     | not_found_legal_representative        | no legal representative for the beneficiary                                     |
| CD     | inexistent_beneficiary                | no beneficiary found                                                            |
| AS     | benefity_without_legal_representative | beneficiary does not have a legal representative                                |
| BI     | inexistent_benefit                    | no benefit found                                                                |
| D1     | inconsistent_balance_benefit_data     | The balance benefit data registered is either inconsistent, null or incomplete. |

### Tabela de retorno de erros na consulta de benefícios {#dataprev_benefits_errors_enumerators}
| Código | Enumerador                            | Descrição                                                                       |
|--------|---------------------------------------|---------------------------------------------------------------------------------|
| CR     | not_found_legal_representative        | no legal representative for the beneficiary                                     |
| CD     | inexistent_beneficiary                | no beneficiary found                                                            |
| AS     | benefity_without_legal_representative | beneficiary does not have a legal representative                                |

### Tabela de situação de benefícios {#benefit_situation_enumerator}
| Items |
|-------|
| active |
| excluded |
| terminated |
| suspended |
| suspended_by_CONPAG |
| terminated_by_SISOBI |
| receiving_monthly_recover_6_months |
| receiving_monthly_recover_18_months |
| suspended_by_name_error |
| suspended_by_credentialed_payer |
| suspended_by_inspection |
| suspended_by_audit |
| terminated_by_inspection |
| terminated_by_audit |
| receiving_monthly_recover_6_months_inspection |
| receiving_monthly_recover_18_months_inspection |
| suspended_by_SISOBI |
| canceled_by_audit |

### Tabela de status de benefícios {#benefit_status_enumerator}

| Enumerador | Descrição                                           |
|------------|-----------------------------------------------------|
| Elegible   | Elegível para empréstimo                            |
| Inelegible | Benefício inelegível para empréstimo                |
| Blocked    | Benefício elegível, porém bloqueado para empréstimo |

### Tabela de tipos de bloqueio {#block_type_enumerator}

| Enumerador | Descrição                                           |
|------------|-----------------------------------------------------|
| 0          | Sem bloqueio                                        |
| 1          | Bloqueado pelo Segurado                             |
| 2          | Bloqueado por TBM                                   |
| 3          | Bloqueado na Concessão                              |

### Tabela de tipos de politicamente exposto {#politically_exposed_enumerator}

| Enumerador | Descrição                                           |
|------------|-----------------------------------------------------|
| 0          | Pessoa Não Exposta Politicamente                    |
| 1          | Pessoa Exposta Politicamente - Nível 1              |

### Tabela de benefícios {#benefit_type_enumerator}

| código   | benefício                                   |
| --- | ------------------------------------------------ |
| 1   | pension_by_death_rural_worker                    |
| 2   | pension_by_death_accident_rural_worker           |
| 3   | pension_by_death_rural_employer                  |
| 4   | retirement_invalidity_rural_emploee              |
| 5   | retirement_invalidity_accident_rural_worker      |
| 6   | retirement_invalidity_rural_employer             |
| 7   | retirement_by_eldness_rural_worker               |
| 8   | retirement_by_age_rural_employer                 |
| 9   | complement_by_work_accident_rural_worker         |
| 11  | support_invalidity_rural_worker                  |
| 12  | support_by_age_rural_worker                      |
| 13  | aid_sickness_rural_worker                        |
| 15  | aid_time_off_rural_worker                        |
| 16  | aid_federal                                      |
| 17  | international_agreement                          |
| 18  | inclusion_benefit                                |
| 19  | pension_student_law7004                          |
| 20  | pension_by_death_diplomat                        |
| 21  | pension_by_death                                 |
| 22  | pension_by_death_statute                         |
| 23  | pension_by_death_veteran                         |
| 24  | pension_special_institutional_act                |
| 25  | aid_time_off                                     |
| 26  | pension_by_death_special_law593                  |
| 27  | pension_by_death_federal_emploee                 |
| 28  | pension_by_death_general_regime_law20465         |
| 29  | pension_by_death_marine_veteran                  |
| 30  | monthly_income_lifetime_invalidity               |
| 31  | aid_sickness                                     |
| 32  | retirement_invalidity_social_security            |
| 33  | retirement_invalidity_aeronautic                 |
| 34  | retirement_invalidity_marine_law1756             |
| 35  | aid_sickness_veteran                             |
| 36  | aid_social_security_accident                     |
| 37  | retirement_capin_extra_emploee                   |
| 38  | retirement_federal_extra_emploee                 |
| 39  | aid_invalidity_student_law7004                   |
| 40  | monthly_income_lifetime_by_age_upper70_law6179   |
| 41  | retirement_by_age                                |
| 42  | retirement_by_contribution_time                  |
| 43  | retirement_by_time_of_service_veteran            |
| 44  | retirement_special_aeronautic                    |
| 45  | retirement_by_time_of_service_journalist         |
| 46  | retirement_special                               |
| 47  | allowance_25                                     |
| 48  | allowance_20                                     |
| 49  | retirement_ordinary                              |
| 50  | aid_sickness_extinct_basic_plan                  |
| 51  | retirement_invalidity_extinct_basic_plan         |
| 52  | retirement_by_age_extinct_basic_plan             |
| 53  | aid_time_off_extinct_basic_plan                  |
| 54  | pension_indemnity_federal                        |
| 55  | pension_by_death_extinct_basic_plan              |
| 56  | pension_lifetime_syndrome_thalidomide            |
| 57  | retirement_by_teacher_labor_time                 |
| 58  | retirement_anisty                                |
| 59  | pension_by_death_amnesty                         |
| 60  | indemnity                                        |
| 61  | aid_birth                                        |
| 62  | aid_funeral                                      |
| 63  | aid_funeral_rural_worker                         |
| 64  | aid_funeral_rural_employer                       |
| 65  | savings_special_autarchy                         |
| 67  | savings_mandatory_ipase_law5128                  |
| 68  | savings_special_retirement_ps_affiliated_upper60 |
| 69  | savings_student_law7004                          |
| 70  | restitution                                      |
| 71  | monthly_income                                   |
| 72  | retirement_by_time_of_service_law1756            |
| 73  | monthly_income_family_statute                    |
| 74  | complement_pension_federal                       |
| 75  | complement_retirement_federal                    |
| 76  | monthly_income_statute                           |
| 77  | monthly_income_sinpas_family_statute             |
| 78  | retirement_by_age_law1756                        |
| 79  | advantage                                        |
| 80  | monthly_income_maternity                         |
| 81  | compulsory_retirement                            |
| 82  | retirement_by_time_of_service_sasse              |
| 83  | retirement_invalidity_ex_sasse                   |
| 84  | pension_by_death_sasse                           |
| 85  | pension_lifetime_rubber_tapper_law7986           |
| 86  | pension_lifetime_rubber_tapper_dependent_law7986 |
| 87  | continuous_aid_physical_disabilities             |
| 88  | continuous_aid_eldness                           |
| 89  | pension_special_hemodialysis_victim_caruaru      |
| 90  | medic_assistency_work_accident                   |
| 91  | aid_sickness_by_work_accident                    |
| 92  | retirement_invalidity_work_accident              |
| 93  | pension_by_death_work_accident                   |
| 94  | aid_work_accident                                |
| 95  | aid_additional_work_accident                     |
| 96  | pension_special_leprosy_law11520                 |
| 97  | savings_by_death_work_accident                   |
| 98  | aid_longshoreman                                 |
| 99  | time_off_15                                      |

## 15. Simulação de Cenários
### Portabilidade

        **15.1.** Aprovação pelo CTC

A proposta deve estar em status "pending_response". Se o cliente tiver configuração de envio manual a proposta será 
criada com status "pending_submission" e somente após o patch de "pending_response" este webhook deverá ser enviado. 
Caso a configuração seja de envio automático a proposta será criada com status "pending_response" e este webhook poderá 
ser chamado logo após.  

        **Request**

- ENDPOINT /mock/credit_transfer/ctc
- MÉTODO POST

        *Payload:*

**payload.json**

```json
{
    "proposal_key": "CHAVE DA PROPOSTA",
    "event_type": "proposal_creation_accepted"
}
```

        **15.2.** Rejeição pelo CTC

A proposta deve estar em status "pending_response".

        **Request**

- ENDPOINT /mock/credit_transfer/ctc
- MÉTODO POST

        *Payload:*

**payload.json**

```json
{
    "proposal_key": "CHAVE DA PROPOSTA",
    "event_type": "proposal_creation_refused"
}
```

        **15.3.** Envio de saldo devedor pelo banco de origem

A chamada de aprovação pelo CTC (**15.1**) deve ser enviada antes. A proposta deve estar em status "pending_acceptance"

        **Request**

- ENDPOINT /mock/credit_transfer/ctc
- MÉTODO POST

        *Payload:*

**payload.json**

```json
{
    "proposal_key": "CHAVE DA PROPOSTA",
    "event_type": "proposal_approval",
    "due_balance": 9000, // Opcional, se não informado será enviado o valor usado na criação da proposta
    "installment_face_value": 300, // Opcional, se não informado será enviado o valor usado na criação da proposta
    "number_of_installments": 40 // Opcional, se não informado será enviado o valor usado na criação da proposta
}
```

        **15.4.** Retenção pelo banco de origem

A chamada de aprovação pelo CTC (**15.1**) deve ser enviada antes. A proposta deve estar em status "pending_acceptance"

        **Request**

- ENDPOINT /mock/credit_transfer/ctc
- MÉTODO POST

        *Payload:*

**payload.json**

```json
{
    "proposal_key": "CHAVE DA PROPOSTA",
    "event_type": "proposal_retention"
}
```

        **15.5.** Devolução do pagamento pelo banco de origem

Só pode ser enviado depois que a proposta for aceita e a operação de portabilidade desembolsada. Proposta deve estar em 
status "settlement_sent", "pending_settlement_confirmation" ou "paid".

        **Request**

- ENDPOINT /mock/credit_transfer/str
- MÉTODO POST

        *Payload:*

**payload.json**

```json
{
    "proposal_key": "CHAVE DA PROPOSTA",
    "event_type": "payment_rejected"
}
```

        **15.6.** Confirmação de pagamento pelo CTC

Proposta deve ter sido aceita e a operação de portabilidade desembolsada. Status deve ser "settlement_sent".

        **Request**

- ENDPOINT /mock/credit_transfer/ctc
- MÉTODO POST

        *Payload:*

**payload.json**

```json
{
    "proposal_key": "CHAVE DA PROPOSTA",
    "event_type": "settlement_confirmation"
}
```

        **15.7.** Confirmação de pagamento pelo banco de origem

Deve ser chamado após a confirmação de pagamento pelo CTC (**15.6**). Proposta deve estar em status 
"pending_settlement_confirmation".

        **Request**

- ENDPOINT /mock/credit_transfer/ctc
- MÉTODO POST

        *Payload:*

**payload.json**

```json
{
    "proposal_key": "CHAVE DA PROPOSTA",
    "event_type": "payment_confirmation"
}
```

        **15.8.** Averbação de garantia

Proposta deve estar em status "pending_settlement_confirmation" ou "paid", após **15.6** ou **15.7**.

        **Request**

- ENDPOINT /mock/credit_transfer/collateral
- MÉTODO POST

        *Payload:*

**payload.json**

```json
{
    "proposal_key": "CHAVE DA PROPOSTA",
    "credit_operation_type": "portability",
    "collateral_constituted": true
}
```

### Refinanciamento

        **15.9.** Averbação de garantia

Proposta deve estar em status "paid" ou "pending_settlement_confirmation" com garantia de portabilidade averbada e o 
refinanciamento deve ter sido aceito.

        **Request**

- ENDPOINT /mock/credit_transfer/collateral
- MÉTODO POST

        *Payload:*

**payload.json**

```json
{
    "proposal_key": "CHAVE DA PROPOSTA",
    "credit_operation_type": "refinancing",
    "collateral_constituted": true
}
```

        **15.10.** Falha na averbação de garantia

Proposta deve estar em status "paid" ou "pending_settlement_confirmation" com garantia de portabilidade averbada e o 
refinanciamento deve ter sido aceito.

        **Request**

- ENDPOINT /mock/credit_transfer/collateral
- MÉTODO POST

        *Payload:*

**payload.json**

```json
{
    "proposal_key": "CHAVE DA PROPOSTA",
    "credit_operation_type": "refinancing",
    "collateral_constituted": false
}
```

        **15.11.** Falha no desembolso

Operação de refinanciamento deve ter sido desembolsada.

        **Request**

- ENDPOINT /mock/credit_transfer/disbursement
- MÉTODO POST

        *Payload:*

**payload.json**

```json
{
    "proposal_key": "CHAVE DA PROPOSTA",
    "event_type": "disbursement_failed"
}
```

## 16. Incluir Fee na operação de portabilidade rebatido pela QI ao parceiro

Para inclusão do fee, é necessário que a operação esteja averbada, desembolsada e que não esteja cedida.

ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /portability_credit_operation/rebate
METHOD POST

        **Request**

**payload.json**

```json
{
    "amount": 20,
    "rebate_bank_account": {
        "name": "Teste Ltda",
        "document_number": "18533555000164",
        "account_digit": "0",
        "account_number": "4290001",
        "branch_number": "0001",
        "bank_code": "329"
    },
    "amount_type": "percentage",
    "fee_type": "spread"
}
```

        **Response**

**response.json**

```json
{}
```

---

# Máquinas de Status

URL: /en/documentation/guides/INSS/portability+refinancing/maquinas-de-status

Máquinas de Status — Port+Refin

:::info
Esta página descreve as máquinas de status que cobrem o que acontece **após a formalização da proposta**. Para o fluxo completo de digitação e pré-aprovação, consulte o [Fluxo Completo](./end-to-end).
:::

## Portabilidade — Máquina de Status

![Máquina de estados da proposta de portabilidade](/img/diagrams/inss-port-refin-maquinas-de-status-1.svg)

        Os estados da Proposta de Portabilidade refletem as etapas envolvidas no processo de portabilidade de crédito dentro do CTC (Central de Transferência de Crédito) da CIP.
Segue abaixo a descrição do fluxo e do significado de cada status envolvido em uma Proposta de Portabilidade, desde sua digitação até sua liquidação.

        **7.1. pending_response:**
Status da proposta após realização da digitação. Neste status a proposta foi recebida com sucesso pela QI e enviada para o CTC - CIP.

                **7.1.1 rejected:** 
Caso a digitação da proposta seja rejeitada pelo CTC - CIP, será enviado um webhook com o motivo da rejeição:

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS rejected

**body.json**

```json
{
  "webhook_type": "credit_transfer.proposal",
  "proposal_key": "\<PROPOSAL-KEY\>",
  "proposal_status": "rejected",
  "event_datetime": "2022-11-24T15:42:12",
  "data": {
    "error": {
        "code": "ECTC0023",
        "reason": "Contrato com portabilidade em andamento"
    }
  }
}

```

                **7.1.1 rejected reasons:** 
Caso a digitação da proposta seja rejeitada pelo CTC - CIP, será enviado um webhook com o motivo da rejeição:

 
| reason                             | description                                                                                                                   | external_code |
|------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|---------------|
| portability_in_progress            | Contrato com portabilidade em andamento                                                                                       | ECTC0023      |
| portability_finished               | Portabilidade já finalizada para o contrato informado                                                                         | ECTC0028      |
| portability_in_expiration_progress | Portabilidade não permitida. Contrato com portabilidade em situação de "Decurso de prazo" por não efetivação da portabilidade | ECTC0085      |
| unexpected_error                   | Erro inesperado                                                                                                               | ECTC9999      |
| portability_payment_rejected       | Pagamento de portabilidade rejeitado.                                                                                         |               |
| divergent_due_balance              | Saldo devedor final deve ser menor que saldo devedor devolvido pela cip.                                                      |               |

        **7.2. pending_acceptance:** Status da Proposta após envio/aceite pelo CTC - CIP. A Proposta, neste momento, está aguardando resposta de saldo devedor pelo banco credor original. Neste momento é enviado um webhook com o número da Portabilidade no CTC - CIP:

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS pending_acceptance

**body.json**

```json

{
    "webhook_type": "credit_transfer.proposal",
    "proposal_key": "\<PROPOSAL-KEY\>",
    "proposal_status": "pending_acceptance",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
        "portability_number": "202211230000246536429",
        "inclusion_date": "2022-11-24",
        "due_balance_expected_return_date": "2022-12-01"
    }
}
```

:::info
O **"portability_number"** é o Número da Portabilidade dentro do CTC - CIP, e é o número utilizado pela instituição proponente e instituição credora original para localizar a Proposta de Portabilidade.
:::

        Assim que o banco credor original responder à solicitação de portabilidade, será enviado um webhook com a resposta do valor do saldo devedor no caso da não retenção, e com a informação de "retido", no caso da retenção:

        **7.2.1. accepted:** Status da Proposta quando o banco credor original retorna o saldo devedor e não retem o crédito. Será enviado um webhook com a informação do saldo devedor.
O banco credor original tem até 5 d.u. após a recepção da Proposta de Portabilidade, para envio da resposta com a informação do saldo devedor da operação.

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS accepted

**body.json**

```json

{
	"webhook_type": "credit_transfer.proposal",
	"proposal_key": "\<PROPOSAL-KEY\>",
	"proposal_status": "accepted",
	"event_datetime": "2022-11-24T15:42:12",
	"data": {
		"final_due_balance": 1000,
		"portability_number": "202211230000246536429",
		"original_contract": {
			"origin_contract_number": "5584745",
			"origin_ispb_number": "60746948",
			"origin_document_number": "90406718261",
			"origin_operation_type": "0202",
			"installment_face_value": 1000,
			"total_iof": 1,
			"first_due_date": "2021-05-31",
			"last_due_date": "2022-05-31",
			"interest": 1,
			"cet": 1,
			"installment_number": 12,
			"amortization": 1,
			"final_due_balance": 1000,
			"final_due_date": "2021-08-31",
			"contract_date": "2021-04-31"
		}
	}
}
```

        Com a informação do saldo devedor retornado pela instituição credora original, o parceiro tomará a decisão se seguir ou não com a Portabilidade. 

:::info
Horário limite para envio do saldo devedor pela instituição credora original é às 10:00.
:::

        Após o recebimento do saldo devedor, caso o Parceiro decida seguir com a Proposta Portabilidade, ele deve realizar a seguinte chamada:

        **Request**

- MÉTODO PATCH
- ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY

Testar no Playground

        *Payload:*

**payload.json**

```json
{
    "status":"accepted_by_requester"
}
```

:::caution Atenção
Para propostas que envolvam troco após o refinanciamento, é necessário que o valor do troco calculado de acordo com as novas condições do contrato após o retorno do saldo devedor seja de pelo menos 5% da diferença entre a soma de todas as parcelas do refinanciamento subtraida da soma de todas as parcelas da portabilidade. Caso contrário, a requisição receberá o seguinte erro:

STATUS 400

**Response Body**

```json
{
    "title": "Bad Request", 
    "code": "CT000118",
    "description": "The final disbursement amount is less than 5% of the sum of refinancing installment minus the sum of portability installment. The minimum final disbursement amount allowed is 500.00. Calculated final disbursement amount: 400.00.", 
    "translation": "O valor do troco é menor que 5% da soma do valor das parcelas do refinanciamento menos o valor soma das parcelas da portabilidade. O valor mínimo do troco permitido é de 500.00. Valor calculado do troco: 400.00."
}

```
::: 

        O Parceiro pode adicionar dados de novo valor de parcela ou nova taxa nessa chamada, caso queira alterá-los:

        **Request**

- MÉTODO PATCH
- ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY

        *Payload:*

**payload.json**

```json
{
    "status":"accepted_by_requester",
	"financial": {
		"installment_face_value": 100
	}
	
}
```

        **Request**

- MÉTODO PATCH
- ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY

        *Payload:*

**payload.json**

```json
{
    "status":"accepted_by_requester",
	"financial": {
		"monthly_interest_rate": 0.01
	}
	
}
```

:::info Campos adicionais opcionais
Além dos campos `status` e `financial`, o endpoint de aceite da proposta também aceita os seguintes campos opcionais:
- **`borrower.document_identification_type`** (string ou null): Tipo do documento de identificação
- **`borrower.document_identification_number`** (string, máx. 16 caracteres): Número do documento de identificação
- **`borrower.gender`** (string ou null): Gênero do tomador. Valores aceitos: `"male"`, `"female"` ou `null`
- **`credit_agent`** (objeto): Agente de crédito com `name` (string, máx. 100) e `document_number` (string, 11 ou 14 dígitos)
:::

:::danger Atenção!
Caso o valor da parcela seja maior que valor total disponível (valor da parcela do contrato de origem + margem total disponível do benefício),
será retornado o seguinte erro: 
```json
{
    "title": "Reservation amount greater than available total balance",
    "description": "The installment face value: 54.4 is greater than the available total balance (origin installment face value + available total balance):30.4. Available total balance: -20.0.",
    "translation": "O valor da parcela: 54.4 é maior que o valor total disponível (valor da parcela do contrato de origem + margem total disponível) : 30.4. Margem total diponível: -20.0.",
    "code": "SSC000059"
}

```
Ao receber esta crítica, é possível que uma nova chamada seja feita, alterando o valor da parcela para que ela se ajuste ao valor total disponível.

Se o ajuste no valor da parcela não for feito até o horário limite para aceite do saldo devedor, será necessária uma nova digitação de proposta.
:::

        Caso o Parceiro decida por não prosseguir com a Proposta de Portabilidade, ele deve, **obrigatoriamente** realizar a seguinte chamada para informar a desistência da Portabilidade:

        **Request**

- MÉTODO DELETE
- ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY

Testar no Playground

        Após o envio do cancelamento da Proposta de Portabilidade ao CTC - CIP, será enviado um webhook de Proposta Cancelada:

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS canceled

**body.json**

```json

{
    "webhook_type": "credit_transfer.proposal",
    "proposal_status": "canceled",
    "proposal_key": "\<PROPOSAL-KEY\>",
    "event_datetime": "2022-11-24T15:42:12"
}

```

:::info
O horário limite para aceite do saldo devedor é 16:30. 
Não é possível retomar uma Proposta com status "canceled". Caso a Proposta esteja com este status, será necessária a realização de uma nova digitação.
:::
 

        **7.2.2. retained:**  Status da Proposta quando o banco credor original retem o crédito, será enviado o webhook com a informação de retenção. O banco credor original do crédito tem até 2 d.u. após a recepção da Proposta de Portabilidade, para envio da resposta de retenção do crédito.

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS retained

**body.json**

```json

{
  "webhook_type": "credit_transfer.proposal",
  "proposal_key": "\<PROPOSAL-KEY\>",
  "proposal_status": "retained",
  "event_datetime": "2022-11-24T15:42:12",
  "data": {
    "retained_reason": {
      "reason": "issuer_retention",
      "description": "Retenção do Cliente"
    }
  }
}
```

### Detalhamento de campos no webhook de proposal
| Campo                     | Descrição                           | Valores                          |
|---------------------------|-------------------------------------|----------------------------------|
| reason                    | lista dos motivos de retenção de uma Proposta  | [Enumeradores](#retention_reason_enumerator) |
 

        **7.3. accepted_by_requester:** Após aprovada pelo parceiro, a Proposta segue o fluxo interno da QI para liquidação.

        **7.4. settlement_sent:** 
Após conclusão do fluxo interno da QI para liquidação da Proposta de Portabilidade o recurso para pagamento do saldo devedor é enviado ao credor original disparando o seguinte webhook para o Parceiro:

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS settlement_sent

**body.json**

```json

{
	"webhook_type": "credit_transfer.proposal",
	"proposal_key": "\<PROPOSAL KEY\>",
	"proposal_status": "settlement_sent",
	"event_datetime": "2022-11-24T15:42:12",
	"data": {
		"receipt": {
			"amount": 1000,
			"timestamp": "2022-09-14 11:55:31",
			"description": "237 0001 1000093 1000093-3 59588111000103 - BCO BRADESCO S.A.",
			"ted_receipt_document_key": "a34e84a2-1628-4f23-8c11-2b2f4656ced1",
			"ted_receipt_url": "https://qitech.com.br/",
			"transaction_key": "ed3e84a2-1628-4f23-8c11-2b2f4656cedf",
			"origin": {
				"account_key": "ed3e84a2-1628-4f23-8c11-2b2f4656cedf",
				"bank_code": "329",
				"branch": "0001",
				"branch_digit": null,
				"account_number": "1000361",
				"account_digit": "3",
				"type": "checking_account",
				"name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
				"document": "32402502000135"
			},
			"destination": {
				"bank_code": "237",
				"branch": "0001",
				"branch_digit": null,
				"account_number": "1000093",
				"account_digit": "3",
				"type": "checking_account",
				"name": "BCO BRADESCO S.A.",
				"document": "59588111000103",
				"purpose": "Saída Liquidação de Portabilidade"
			}
		}
	}
}
```

Neste momento será iniciada averbação da Operação de Portabilidade na Dataprev. O processo de averbação acontecerá em paralelo aos itens seguintes (itens 7.5., 7.5.1. e 7.5.2.)

 

        **7.5. pending_settlement_confirmation:** Após a confirmação do envio dos recursos para pagamento do saldo devedor, é aguardada a confirmação da quitação do contrato por parte da Instituição Credora Original. Nesta etapa o Parceiro receberá o seguinte webhook:

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS pending_settlement_confirmation

**body.json**

```json
{
    "webhook_type": "credit_transfer.proposal",
    "proposal_key": "\<PROPOSAL-KEY\>",
    "proposal_status": "pending_settlement_confirmation",
    "event_datetime": "2022-11-24T15:42:12"
}
```

:::info
A confirmação da quitação do contrato é encaminhada pela Instituição Credora Original ao CTC - CIP e posteriormente encaminhado pelo CTC - CIP à QI.

O SLA para confirmação da quitação da Portabilidade é de **2 d.u.** contados a partir do envio dos recursos para pagamento do saldo devedor do contrato original.
:::
 
        **7.5.1. paid:** Assim que a QI receber do CTC - CIP a confirmação da quitação do Contrato Original, a Proposta constará como paga e a Portabilidade estará finalizada. 

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS paid

**body.json**

```json

{
    "webhook_type": "credit_transfer.proposal",
    "proposal_key": "\<PROPOSAL-KEY\>",
    "proposal_status": "paid",
    "event_datetime": "2022-11-24T15:42:12"
}
```

        Nesta etapa, caso a averbação da Operação de Portabilidade já esteja concluída, a Operação de Refinanciamento (Troco), poderá ser iniciada (fluxo descrito no item 7).

        **7.5.1.1.** A notificação sobre a averbação da Operação de Portabilidade será enviada através do seguinte webhook:

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal.collateral

**body.json**

```json

{
    "webhook_type": "credit_transfer.proposal.collateral",
    "proposal_key": "\<PROPOSAL-KEY\>",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
        "credit_operation_type": "portability",
		"credit_operation_key": "\<CREDIT-OPERATION-KEY\>",
		"collateral_type": "social_security",
		"collateral_constituted": true,
		"collateral_data": {
                    "reservation_method": "portability", 
                }
	}
}
```
 
        data.collateral_data.reservation_method: [portability, new_credit ]

        **7.5.2. rejected:** 
Caso o banco credor original rejeite a quitação do contrato, o recurso enviado para quitação do saldo devedor do contrato original será devolvido, e a proposta será finalizada. O parceiro receberá o webhook de **"rejected"**.

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS rejected

**body.json**

```json

{
    "webhook_type": "credit_transfer.proposal",
    "proposal_key": "\<PROPOSAL-KEY\>",
    "proposal_status": "rejected",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
        "error": {
            "code": "QCTC0001",
            "reason": "Pagamento de portabilidade rejeitado."
        }
    }
}
```
 

        Caso nesta etapa a Operação de Portabilidada já esteja averbada na Dataprev, será realizada a desaverbação da margem.

:::info
Não é possível retomar uma Proposta com status "**rejected**". É sempre necessário realizar uma nova digitação.
:::

--- 

## Refinanciamento (Troco) — Máquina de Status

![Máquina de estados da operação de refinanciamento](/img/diagrams/inss-port-refin-maquinas-de-status-2.svg)

        **8.1** 
No momento em que a Operação de Portabilidade é paga, o Parceiro pode optar por seguir com a Operação de Refinanciamento (Troco) ou não.

#### Enumeradores credit_operation_status
| Enumerador               					| Descrição                  	 		|
|-------------------------------------------|---------------------------------------|
| waiting_signature  						| Operação aguardando assinatura 		|
| signed     								| Operação assinada			     		|
| issued  									| Operação emitida			     		|
| disbursed									| Operação desembolsada		     		|
| settled     								| Operação liquidada	         		|
| canceled     								| Operação cancelada		     		|
| canceled_permanently  					| Operação cancelada permanentemente    |

        **8.1.1.** Para prosseguir com o Refinanciamento (Troco), o Parceiro deve realizar a seguinte chamada passando os campos 'Financial' e 'Disbursement Bank Accounts':

*Adicionalmente, pode-se passar o campo 'purchaser_document_number' para alterar o cessionário da operação.

        **Request**

- MÉTODO POST
- ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /refinancing_credit_operation/acceptance

Testar no Playground

**Request Body**

```json
{
    "financial": {
        "installment_face_value": 379.87,
        "monthly_interest_rate": 0.0166,
        "number_of_installments": 84,
        "limit_days_to_disburse": 7,
        "disbursement_date": "2024-07-02",
        "rebates": [
            {
                "rebate_bank_account": {
                    "bank_code": "329",
                    "account_digit": "9",
                    "document_number": "18533555000164",
                    "name": "Teste Ltda",
                    "account_number": "4290002",
                    "branch_number": "0001"
                },
                "amount_type": "percentage",
                "fee_type": "spread",
                "amount": 9.5
            },
            {
                "amount": 20,
                "rebate_bank_account": {
                    "name": "Teste Ltda",
                    "document_number": "18533555000164",
                    "account_digit": "0",
                    "account_number": "4290001",
                    "branch_number": "0001",
                    "bank_code": "329"
                },
                "amount_type": "percentage",
                "fee_type": "insurance_premium"
            }
        ]
    },
    "disbursement_bank_accounts": [
        {
            "document_number": "92093764000197",
            "branch_number": "0001",
            "name": "TESTE LTDA",
            "percentage_receivable": 100,
            "account_number": "120012",
            "account_digit": "3",
            "bank_code": "329"
        }
    ],
    "purchaser_document_number": "28534595027164"
}
```

        **Response:**

**Response**

```json

{
	"credit_operation_key": "\<CREDIT-OPERATION-KEY\>",
	"contract_number": "00000002",
	"document_key": "\<DOCUMENT-KEY da CCB de Refinanciamento\>",
	"document_url": "\<URL da CCB de Refinanciamento\>",
	"credit_operation_status": "issued",
	"fine_configuration": {
		"contract_fine_rate": 0.02,
		"interest_base": "calendar_days",
		"monthly_rate": 0.01
	},
	"disbursement_options": [{
		"installments": [{
				"additional_costs": [],
				"bank_slip_key": null,
				"business_due_date": "2021-08-09",
				"calendar_days": 53,
				"digitable_line": null,
				"due_date": "2021-08-08",
				"due_interest": 0,
				"due_principal": 997.87,
				"fine_amount": null,
				"has_interest": true,
				"installment_key": "e3bedf31-1e87-4ba4-a36c-d52f7f5c9036",
				"installment_number": 1,
				"installment_status": "created",
				"installment_type": "principal",
				"paid_amount": 0,
				"paid_at": null,
				"post_fixed_amount": 0,
				"pre_fixed_amount": 54.84865004983954,
				"principal_amortization_amount": 306.98134995016045,
				"total_amount": 361.83,
				"workdays": 37
			},
			{
				"additional_costs": [],
				"bank_slip_key": null,
				"business_due_date": "2021-09-08",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2021-09-08",
				"due_interest": 0,
				"due_principal": 690.8886500498395,
				"fine_amount": null,
				"has_interest": true,
				"installment_key": "e8406cdb-844c-4e6d-9620-3635fab9d8d1",
				"installment_number": 2,
				"installment_status": "created",
				"installment_type": "principal",
				"paid_amount": 0,
				"paid_at": null,
				"post_fixed_amount": 0,
				"pre_fixed_amount": 21.964874249804833,
				"principal_amortization_amount": 339.86512575019515,
				"tax_amount": 0,
				"total_amount": 361.83,
				"workdays": 22
			}
		],
		"prefixed_interest_rate": {
				"annual_rate": 0.44556431,
				"daily_rate": 0.00564312,
				"monthly_rate": 0.0556431,
				"interest_base": "calendar_days_365"
		},
		"iof_amount": 50,
		"external_contract_fee_amount": 0,
		"external_contract_fees": [],
		"contract_fee_amount": 0,
		"contract_fees": [],
		"number_of_installments": 2,
		"disbursed_issue_amount": 997.87,
		"final_disbursement_amount": 100,
		"issue_amount": 1147.87,
		"disbursement_date": "2021-05-31",
		"cet": 1.212,
		"annual_cet": 32.122
	}],
	"disbursement_bank_account": {
		"account_digit": "1",
		"account_number": "00001",
		"ispb": "00000000",
		"branch_number": "0001"
	}
}
```

        **8.1.2.** Caso o Parceiro opte por não prosseguir com a Operação de Refinanciamento (Troco), ele deve realizar a seguinte chamada:

**Request**

- MÉTODO DELETE
- ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /refinancing_credit_operation
 

        **8.2. Averbação do Refinanciamento (Troco):** 
Assim que o Parceiro optar por prosseguir com a Operação de Refinanciamento, a rotina para averbação da margem consignável terá início. Assim que a averbação da margem consignável do INSS for concluída o parceiro recebera o seguinte webhook:

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal.collateral

**Body**

```json

{
    "webhook_type": "credit_transfer.proposal.collateral",
    "proposal_key": "\<PROPOSAL-KEY\>",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
        "credit_operation_type": "refinancing",
		"credit_operation_key": "\<CREDIT-OPERATION-KEY\>",
		"collateral_type": "social_security",
		"collateral_constituted": true
	}
}
```

        **8.3. Desembolo do Refinanciamento (Troco):**

        Assim que a averbação da margem consignável do INSS for concluída a operação estará pronta para desembolso.
No desembolso da Operação de Refinanciamento, a Operação de Portabilidade será quitada e caso exista valor desembolsado remanescente (**7.1.1. "disbursement_options.final_disbursement_amount"**), este valor será liberado para o cliente (Troco) na conta para desembolso da Operação (**"disbursement_bank_account"**).
A liberação do troco para o cliente pode ser realizada via PIX ou TED, em qualquer horário do dia (obedecendo horário comercial de 7:00 às 17:00 em dias úteis, no caso da TED).

        **8.3.1.** Caso o desembolso do troco para o cliente seja bem sucedido, será enviado um webhook com os dados da comprovação do desembolso:

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal.credit_operation

**body.json**

```json

{
	"webhook_type": "credit_transfer.proposal.credit_operation",
	"proposal_key": "\<PROPOSAL-KEY\>",
	"event_datetime": "2022-11-24T15:42:12",
	"data": {
		"credit_operation_status": "disbursed",
		"credit_operation_type": "refinancing",
		"credit_operation_key": "\<CREDIT-OPERATION-KEY\>",
		"ted_receipt_list": [{
			"fee": 0,
			"url": "https://qitech.com.br/",
			"amount": 500,
			"origin": {
				"name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
				"type": "payment_account",
				"branch": "0001",
				"document": "32402502000135",
				"bank_code": "329",
				"account_key": "871059bd-4014-41ad-82b4-28275ff0e67b",
				"branch_digit": null,
				"account_digit": "5",
				"account_branch": "0001",
				"account_number": "00002"
			},
			"timestamp": "2022-09-28T13:00:47",
			"description": "DESCRIPTION",
			"destination": {
				"name": "Elaine Isadora da Cruz",
				"type": "checking_account",
				"bank_code": "033",
				"branch": "0001",
				"purpose": "Crédito PIX em Conta",
				"document_number": "90406718261",
				"bank_ispb": "90400888",
				"branch_digit": null,
				"account_digit": "1",
				"account_number": "00001"
			},
			"end_to_end_id": null,
			"transaction_key": "871059bd-4014-41ad-82b4-28275ff0e67b",
			"origin_transaction_key": null
		}]
	}
}
```
 

        **8.3.2.** Caso ocorra falha no desembolso, o parceiro receberá o seguinte webhook:

                **7.3.2.1.** Falha no desembolso via PIX:

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal.credit_operation

**body.json**

```json

{
	"webhook_type": "credit_transfer.proposal.credit_operation",
	"proposal_key": "60fbbfe2-eb52-4825-9ed5-f169a58b9999",
	"event_datetime": "2022-11-24T15:42:12",
	"data": {
		"credit_operation_status": "canceled",
		"credit_operation_type": "refinancing",
		"credit_operation_key": "1a1a44df-29b6-431c-89af-53657d906333",
		"pix_refusal": {
            "reason_enumerator": "invalid_document_number",
            "reason": "CPF/CNPJ do usuário recebedor não é compatível com o titular da conta de destino."
        },
        "cancel_reason": "pix_refusal"
	}
}
```

                **7.3.2.2.** Falha no desembolso via TED:

        **Webhook**

- WEBHOOK_TYPE credit_transfer.proposal.credit_operation

**body.json**

```json
{
    "webhook": {
        "data": {
            "cancel_reason": "Agência ou Conta Destinatária do Crédito Inválida",
            "credit_operation_key": "1a1a44df-29b6-431c-89af-53657d906333",
            "credit_operation_type": "refinancing",
            "credit_operation_status": "canceled",
            "cancel_reason_enumerator": "agencia_conta_invalida"
        },
        "proposal_key": "60fbbfe2-eb52-4825-9ed5-f169a58b9999",
        "webhook_type": "credit_transfer.proposal.credit_operation",
        "event_datetime": "2023-12-22T10:15:25"
    }
}

```
 

        **8.3.3.**
No caso de falha no desembolso da Operação, o desembolso pode ser retentato alterando-se os dados bancários:

        **Request**

- MÉTODO PATCH
- ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /refinancing_credit_operation

Testar no Playground

        *Payload:*

**payload.json**

```json
{
	"disbursement_date": "2022-11-04",
	"disbursement_bank_account": {
		"account_branch": "1232",
		"account_digit": "4",
		"account_number": "412412412",
		"account_type": "checking_account",
		"document_number": "14950479032",
		"ispb": "17298092",
		"name": "Maria da Silva"
	}
}

```

---

# Recálculo e Reformalização do Refinanciamento

URL: /en/documentation/guides/INSS/portability+refinancing/reformalization

Recálculo e Reformalização do Refinanciamento

Enquanto a operação de **refinanciamento ainda não foi averbada na Dataprev**, é possível corrigir seus dados financeiros e bancários. Existem dois endpoints para isso:

| Endpoint | Gera nova CCB? | Quando usar |
|----------|----------------|-------------|
| `PUT …/refinancing_credit_operation` | **Sim** (reassinatura) | Corrigir condições e **emitir uma nova CCB** para reassinatura. |
| `PUT …/refinancing_credit_operation/recalculate` | **Não** | Ajustar o **valor da parcela** sem gerar nova CCB. |

Ambos aceitam o objeto `collateral_data` para **adicionar, alterar ou remover a carência** (`number_of_grace_periods`) informada pelo requisitante — veja [Carência](#carência).

:::info Pré-condição comum
A operação de refinanciamento **não pode estar averbada** (constituída na Dataprev). Caso contrário, retornamos [`CT000079`](#errors).
:::

---

## Correção com nova CCB

Corrige os dados financeiros e bancários da operação de refinanciamento gerando uma **nova CCB**. Use quando for necessário reemitir o contrato.

ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /refinancing_credit_operation
MÉTODO PUT

Testar no Playground

**Request Body**

```json
{
    "financial": {
        "interest_type": "pre_price_days",
        "first_due_date": "2024-06-10",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "credit_operation_type": "ccb",
        "monthly_interest_rate": 0.0167,
        "installment_face_value": 410,
        "limit_days_to_disburse": 7,
        "number_of_installments": 84
    },
    "disbursement_bank_account": {
        "account_digit": "1",
        "account_number": "00001",
        "bank_code": "033",
        "branch_number": "0001"
    }
}
```

A resposta (`200`) retorna o objeto da operação de refinanciamento — mesma estrutura apresentada no [Fluxo Completo](/documentation/guides/INSS/portability+refinancing/end-to-end).

:::caution Reassinatura obrigatória
A `credit_operation_key`, a `document_key`, a `document_url`, a `related_party_key` e a `borrower.related_party_key` **mudam** após essa ação, sendo necessária a **reassinatura da CCB**.
:::

---

## Recálculo sem nova CCB

Recalcula o **valor da parcela** da operação de refinanciamento **sem gerar uma nova CCB**. O novo valor de parcela deve ser **menor** que o original.

ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /refinancing_credit_operation/recalculate
MÉTODO PUT

Testar no Playground

**Request Body**

```json
{
    "financial": {
        "interest_type": "pre_price_days",
        "first_due_date": "2024-06-10",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "credit_operation_type": "ccb",
        "monthly_interest_rate": 0.0167,
        "installment_face_value": 410,
        "limit_days_to_disburse": 7,
        "number_of_installments": 84
    },
    "disbursement_bank_account": {
        "account_digit": "1",
        "account_number": "00001",
        "bank_code": "033",
        "branch_number": "0001"
    }
}
```

A resposta (`200`) retorna o objeto da operação de refinanciamento — mesma estrutura apresentada no [Fluxo Completo](/documentation/guides/INSS/portability+refinancing/end-to-end).

:::caution Atenção
O novo `installment_face_value` precisa ser **menor** que o valor original. A redução do valor de troco para o tomador não pode ultrapassar **30%** (caso contrário, retornamos [`CT000105`](#errors)).
:::

---

## Carência

Conforme a IN 204, as operações de INSS podem ter **carência** (`number_of_grace_periods`), informada dentro de `collateral_data` na criação da proposta. Tanto a **correção com nova CCB** quanto o **recálculo** permitem **alterar ou remover** essa carência, enviando o objeto `collateral_data` no corpo da requisição.

collateral_data.number_of_grace_periods
integer
opcional
Número de meses de carência (de 0 a 3). Aplica-se à garantia social_security da operação.

| Valor enviado | Comportamento |
|---------------|---------------|
| `1`, `2` ou `3` | **Define/atualiza** a carência da operação. |
| `0` | **Remove** a carência previamente informada. |
| Campo ausente (sem `collateral_data`) | Mantém a carência atual, sem alteração. |
| Fora do intervalo (`< 0` ou `> 3`) | Erro [`CT000090`](#errors). |

**Exemplo — removendo a carência no recálculo**

```json
{
    "financial": {
        "installment_face_value": 380,
        "number_of_installments": 84,
        "monthly_interest_rate": 0.0166
    },
    "disbursement_bank_account": {
        "account_digit": "1",
        "account_number": "00001",
        "bank_code": "033",
        "branch_number": "0001"
    },
    "collateral_data": {
        "number_of_grace_periods": 0
    }
}
```

:::info
Ao alterar a carência, a **primeira data de vencimento** (`first_due_date`) é recalculada junto à Dataprev a partir do novo número de meses de carência.
:::

---

## Erros {#errors}

| Código HTTP | Código QI | Descrição |
|-------------|-----------|-----------|
| 404 | `CT000002` | Proposta não encontrada. |
| 404 | `CT000043` | Operação de refinanciamento não encontrada. |
| 400 | `CT000046` | O status da operação de refinanciamento não permite essa operação. |
| 400 | `CT000079` | Operação de refinanciamento não pode estar constituída (averbada) para alterar dados. |
| 400 | `CT000090` | Número de carências inválido. O intervalo aceito é de 0 a 3. |
| 400 | `CT000100` | O valor do desembolso final é inferior ao mínimo permitido. |
| 400 | `CT000105` | A redução do valor de troco para o tomador não pode ser maior que 30%. |
| 400 | `CT000133` | Prêmio de seguro QI não é permitido para INSS. |

---

# Fura-fila (priority request)

URL: /en/documentation/guides/INSS/reservations/priority-request

Fura-fila (priority request)

Mecanismo para tentar uma **averbação de forma síncrona**, sem esperar a fila assíncrona da Dataprev, usando um **balde de fichas** por requester. Cada chamada consome uma ficha; em caso de sucesso na averbação a ficha pode ser devolvida; em falha, a ficha é perdida até a próxima reposição periódica.

:::info Não confunda com reserva prioritária (fixed rate)
Este guia trata de **`POST …/priority_request`** e **`GET /social_security/bucket_configuration`** (balde de fichas / fura-fila). É **diferente** da marcação de reserva **`fixed_rate`** em [Reserva prioritária (fixed rate)](/documentation/guides/INSS/reservations/priority-reservation) (`PATCH` / `DELETE` em `/priority_reservation`).
:::

## Contexto

A Dataprev limita o throughput (**ordem de 25 requisições por segundo**). Por isso as tentativas de averbação costumam ser processadas em **fila**. O endpoint `priority_request` permite pular essa fila quando há **ficha disponível** no balde.

**Resumo do balde:**

- Cada requisição **consome** uma ficha.
- Averbação **bem-sucedida** → a ficha pode ser **devolvida** ao balde.
- Averbação com **erro** → a ficha é **perdida** até a reposição.
- Existe **capacidade máxima** e **intervalo de reposição** configurados para o seu requester.
- Sem fichas → nova tentativa falha até a próxima reposição.

**Exemplo ilustrativo do balde**

Configuração de exemplo: **10 fichas** máximas, **30 minutos** entre reposições.

**Hora 0:** balde criado na capacidade máxima.

**9 min:** uma requisição falha na averbação → perde 1 ficha.

**17 min:** uma requisição tem sucesso → número de fichas inalterado.

**30 min:** primeira reposição → balde volta ao máximo.

**47 min:** dez requisições com sucesso → nenhuma ficha perdida.

**1 h:** segunda reposição; se o balde já estiver cheio, nada muda.

**1 h 12 min:** cinco falhas → perda de 5 fichas.

**1 h 30 min:** terceira reposição → ex.: 6 fichas disponíveis.

**1 h 38 min:** seis falhas → balde esgota.

**1 h 51 min:** tentativa sem fichas → barrada.

**2 h:** quarta reposição → novas tentativas liberadas.

Para o passo a passo completo da operação (validação de reserva, webhooks de sucesso, correção de dados), veja o [Fluxo completo — crédito novo e refinanciamento](/documentation/guides/INSS/new-credit-and-refinancing/end-to-end#sistema-de-priorização-de-requisições-fura-fila).

---

## Disparar requisição prioritária

Request

ENDPOINT /social_security/reservation/external_key/ EXTERNAL_KEY /priority_request
MÉTODO POST

Path params

external_key
string
obrigatório
Chave da operação no fluxo (mesmo conceito de DEBT-KEY nos roteiros INSS ou payroll_card_reservation_key nos fluxos de cartão consignado INSS).

**Body:** não há corpo na requisição.

Testar no Playground

**Python**

```python title="ENDPOINT"
POST /social_security/reservation/external_key/YOUR_EXTERNAL_KEY/priority_request
```

**curl**

```bash title="ENDPOINT"
curl -X POST \
  'https://api-auth.sandbox.qitech.app/social_security/reservation/external_key/YOUR_EXTERNAL_KEY/priority_request' \
  -H 'AUTHORIZATION: eyJhbGciOiJFUzUxMiJ9.eyJwYXlsb2FkX21kNSI6...' \
  -H 'API-CLIENT-KEY: YOUR_API_CLIENT_KEY' \
  -H 'SELECTED-AGENT: YOUR_REQUESTER_KEY' \
  -H 'Content-Type: application/json'
```

Response (sucesso)

STATUS 200

Atributos

max_bucket_capacity
integer
Capacidade máxima do balde (fichas).

bucket_fill_rate_minutes
integer
Intervalo de reposição, em minutos.

available_tokens
integer
Fichas disponíveis após a operação.

status
string
Status da reserva após a tentativa (ex.: pending_document_submission ).

next_refill_at
string
Próximo instante de reposição do balde (ISO 8601).

:::tip Webhook de sucesso
Se a averbação for concluída com sucesso, o parceiro recebe o webhook credit_operation.collateral com status de sucesso. Detalhes no [mesmo capítulo do fluxo completo](/documentation/guides/INSS/new-credit-and-refinancing/end-to-end#sucesso-na-averbação).
:::

```json title="RESPONSE BODY"
{
  "max_bucket_capacity": 10,
  "bucket_fill_rate_minutes": 30,
  "available_tokens": 7,
  "status": "pending_document_submission",
  "next_refill_at": "2025-02-04T20:28:35Z"
}
```

---

## Consultar configuração do balde

Permite ver capacidade, fichas disponíveis e próxima reposição **sem** disparar uma requisição prioritária.

Request

ENDPOINT /social_security/bucket_configuration
MÉTODO GET

Sem path params nem query obrigatórios.

Testar no Playground

**Python**

```python title="ENDPOINT"
GET /social_security/bucket_configuration
```

**curl**

```bash title="ENDPOINT"
curl -X GET \
  'https://api-auth.sandbox.qitech.app/social_security/bucket_configuration' \
  -H 'AUTHORIZATION: eyJhbGciOiJFUzUxMiJ9.eyJwYXlsb2FkX21kNSI6...' \
  -H 'API-CLIENT-KEY: YOUR_API_CLIENT_KEY' \
  -H 'SELECTED-AGENT: YOUR_REQUESTER_KEY' \
  -H 'Content-Type: application/json'
```

Response

STATUS 200

Atributos

max_bucket_capacity
integer
Capacidade máxima do balde.

bucket_fill_rate_minutes
integer
Intervalo de reposição, em minutos.

available_tokens
integer
Fichas disponíveis no momento.

next_refill_at
string
Próxima reposição (ISO 8601).

```json title="RESPONSE BODY"
{
  "max_bucket_capacity": 10,
  "bucket_fill_rate_minutes": 30,
  "available_tokens": 7,
  "next_refill_at": "2025-02-04T20:08:35Z"
}
```

---

## Erros

| HTTP | Código | Título (exemplo) | Quando ocorre |
|------|--------|------------------|---------------|
| 400 / 4xx | SSC000083 | Reservation Failed | Tentativa prioritária executada, mas a averbação falhou (mensagem costuma citar última resposta da Dataprev, fichas restantes e próxima reposição). |
| 429 / 4xx | SSC000080 | Rate limit exceeded | Nenhuma ficha disponível; aguardar a próxima reposição do balde. |

**Exemplos de corpo de erro (JSON)**

```json
{
  "title": "Reservation Failed",
  "description": "Last Response: consignable_margin_excceded, Tokens Available: 9, Next Refill At: 2025-02-04T20:18:35Z",
  "translation": "Ultima resposta: consignable_margin_excceded, Fichas disponiveis: 9, Proxima Recarga: 2025-02-04T20:18:35Z",
  "extra_fields": {},
  "code": "SSC000083"
}
```

```json
{
  "title": "Rate limit exceeded",
  "description": "Request limit exceeded. No tokens available, next refill in 8 minutes.",
  "translation": "Limite de solicitacoes excedido. Nenhuma ficha disponivel, proxima recarga em 8 minutos.",
  "extra_fields": {},
  "code": "SSC000080"
}
```

---

# Fila prioritária

URL: /en/documentation/guides/INSS/reservations/priority-reservation

Fila prioritária (fixed rate)

Marca a reserva INSS como `fixed_rate`, respeitando o **limite de reservas prioritárias ativas**.

**Quando usar**

- **Desbloqueio:** o benefício está em liberação.
- **Concorrência por margem:** operações concorridas e críticas (ex.: novo entrante).

**Antes de priorizar múltiplas reservas:** `GET /social_security/priority_reservation_configuration` mostra uso atual e limite.

## Status da reserva permitidos

Só é possível **definir** ou **remover** prioridade `fixed_rate` quando a reserva está em um destes status:

| Status | Descrição resumida |
|--------|-------------------|
| `pending_reservation` | Reserva pendente |
| `in_queue_pending_reservation` | Na fila, aguardando reserva |
| `pending_balance_request` | Aguardando consulta de saldo |
| `in_queue_pending_balance_request` | Na fila, aguardando consulta de saldo |

Fora desses status, a API retorna erro indicando status não permitido.

:::tip Limite simultâneo
Se o número de reservas já marcadas como prioritárias atingir o máximo configurado, um novo `PATCH` retorna erro de limite excedido. Use o `GET` de configuração para acompanhar o uso atual sem priorizar outra reserva.
:::

---

## Definir prioridade

Request

ENDPOINT /social_security/reservation/external_key/ EXTERNAL_KEY /priority_reservation
MÉTODO PATCH

Path params

external_key
string
obrigatório
Identificador externo da reserva no seu fluxo (mesmo conceito de DEBT-KEY nos roteiros de crédito consignado INSS).

**Python**

```python title="ENDPOINT"
PATCH /social_security/reservation/external_key/YOUR_EXTERNAL_KEY/priority_reservation
```

**curl**

```bash title="ENDPOINT"
curl -X PATCH \
  'https://api-auth.sandbox.qitech.app/social_security/reservation/external_key/YOUR_EXTERNAL_KEY/priority_reservation' \
  -H 'AUTHORIZATION: eyJhbGciOiJFUzUxMiJ9.eyJwYXlsb2FkX21kNSI6...' \
  -H 'API-CLIENT-KEY: YOUR_API_CLIENT_KEY' \
  -H 'SELECTED-AGENT: YOUR_REQUESTER_KEY' \
  -H 'Content-Type: application/json'
```

Response

STATUS 200

Atributos

external_key
string
Chave externa da reserva.

reservation_priority_type
string
Tipo de prioridade; em sucesso, fixed_rate .

current_number_of_priority_reservations
integer
Quantidade atual de reservas prioritárias do requester após a operação.

max_number_of_priority_reservations
integer
Limite máximo configurado.

```json title="RESPONSE BODY"
{
  "external_key": "550e8400-e29b-41d4-a716-446655440000",
  "reservation_priority_type": "fixed_rate",
  "current_number_of_priority_reservations": 1,
  "max_number_of_priority_reservations": 10
}
```

---

## Remover prioridade

Request

ENDPOINT /social_security/reservation/external_key/ EXTERNAL_KEY /priority_reservation
MÉTODO DELETE

Path params

external_key
string
obrigatório
Identificador externo da reserva.

Remove a prioridade da reserva (`reservation_priority_type` passa a `null`). Exige que a prioridade atual seja `fixed_rate` (se houver outro tipo, a API retorna erro). Status da reserva deve continuar na lista permitida.

**Python**

```python title="ENDPOINT"
DELETE /social_security/reservation/external_key/YOUR_EXTERNAL_KEY/priority_reservation
```

**curl**

```bash title="ENDPOINT"
curl -X DELETE \
  'https://api-auth.sandbox.qitech.app/social_security/reservation/external_key/YOUR_EXTERNAL_KEY/priority_reservation' \
  -H 'AUTHORIZATION: eyJhbGciOiJFUzUxMiJ9.eyJwYXlsb2FkX21kNSI6...' \
  -H 'API-CLIENT-KEY: YOUR_API_CLIENT_KEY' \
  -H 'SELECTED-AGENT: YOUR_REQUESTER_KEY' \
  -H 'Content-Type: application/json'
```

Response

STATUS 200

Atributos

external_key
string
Chave externa da reserva.

reservation_priority_type
null
Sem prioridade após a remoção.

current_number_of_priority_reservations
integer
Contagem após a remoção.

max_number_of_priority_reservations
integer
Limite máximo configurado.

```json title="RESPONSE BODY"
{
  "external_key": "550e8400-e29b-41d4-a716-446655440000",
  "reservation_priority_type": null,
  "current_number_of_priority_reservations": 0,
  "max_number_of_priority_reservations": 10
}
```

---

## Consultar limite e uso atual

Request

ENDPOINT /social_security/priority_reservation_configuration
MÉTODO GET

Retorna o resumo de quantas reservas prioritárias o requester tem no momento, o máximo permitido e a lista completa das reservas atualmente na fila prioritária.

**Python**

```python title="ENDPOINT"
GET /social_security/priority_reservation_configuration
```

**curl**

```bash title="ENDPOINT"
curl -X GET \
  'https://api-auth.sandbox.qitech.app/social_security/priority_reservation_configuration' \
  -H 'AUTHORIZATION: eyJhbGciOiJFUzUxMiJ9.eyJwYXlsb2FkX21kNSI6...' \
  -H 'API-CLIENT-KEY: YOUR_API_CLIENT_KEY' \
  -H 'SELECTED-AGENT: YOUR_REQUESTER_KEY' \
  -H 'Content-Type: application/json'
```

Response

STATUS 200

Atributos

current_number_of_priority_reservations
integer
Reservas prioritárias ativas no momento.

max_number_of_priority_reservations
integer
Teto configurado para o requester.

reservations
array of objects
Lista das reservas atualmente na fila prioritária, ordenadas por fixed_rate_set_at crescente. Máximo de 100 itens.

**Atributos de reservations**

credit_operation_key
string
Chave externa da reserva.

contract_number
string
Número do contrato.

status
string
Status atual da reserva. Valores possíveis: pending_reservation , in_queue_pending_reservation , pending_balance_request , in_queue_pending_balance_request .

type
string
Enumerador do tipo da reserva.

fixed_rate_set_at
string (ISO 8601)
Data e hora em que a reserva foi adicionada à fila prioritária.

```json title="RESPONSE BODY"
{
  "current_number_of_priority_reservations": 2,
  "max_number_of_priority_reservations": 10,
  "reservations": [
    {
      "credit_operation_key": "550e8400-e29b-41d4-a716-446655440000",
      "contract_number": "BYX2000013373",
      "status": "pending_reservation",
      "type": "new",
      "fixed_rate_set_at": "2026-04-13T14:00:00Z"
    }
  ]
}
```

---

## Erros

### PATCH — definir prioridade

| HTTP | Código | Título (exemplo) | Quando ocorre |
|------|--------|------------------|---------------|
| 400 | QIT000006 | Priority reservation configuration not set | Requester sem configuração de prioridade de reserva |
| 400 | QIT000006 | Reservation status not allowed | Status da reserva fora da lista permitida |
| 400 | QIT000006 | Priority reservation limit exceeded | Limite simultâneo atingido |
| 404 | SSC000035 | Reservation not Found | Reserva inexistente para requester + `external_key` |
| 409 | QIT000008 | Priority reservation already fixed_rate | Já está `fixed_rate` |

### DELETE — remover prioridade

| HTTP | Código | Título (exemplo) | Quando ocorre |
|------|--------|------------------|---------------|
| 400 | QIT000006 | Reservation priority type not fixed_rate | Há prioridade, mas não é `fixed_rate` |
| 400 | QIT000006 | Reservation status not allowed | Status não permitido |
| 404 | SSC000035 | Reservation not Found | Reserva não encontrada |

### GET — configuração

| HTTP | Código | Título (exemplo) | Quando ocorre |
|------|--------|------------------|---------------|
| 404 | QIT000007 | Priority reservation configuration not found | Sem configuração para o requester |

**Exemplos de corpo de erro (JSON)**

```json
{
  "title": "Reservation not Found",
  "description": "...",
  "translation": "...",
  "code": "SSC000035"
}
```

```json
{
  "title": "Priority reservation already fixed_rate",
  "description": "...",
  "translation": "...",
  "code": "QIT000008"
}
```

---

# Assinatura em grupo (INSS)

URL: /en/documentation/guides/INSS/signatures/batch-group-signature

:::caution Disponibilidade
Este fluxo está em implantação. Por ora, ele cobre operações **INSS** (`social_security`) com o certificador **`qi_sign`**. Alinhe com o time de integração da QI Tech a liberação para o seu requester antes de iniciar a integração em produção.
:::

O fluxo de **assinatura em grupo** agrupa **várias operações** em **uma única pasta de assinatura** do QI Sign. O beneficiário faz **uma única jornada de assinatura** (prova de vida, documento e OTP) e assina **todas as operações do grupo de uma só vez**, com **um único link**.

:::info Fluxo
0. (opcional) Faça upload do [documento de identificação](#documento-de-identificacao-pre-coletado) do beneficiário, para que ele não precise fotografá-lo durante a assinatura
1. Abra o grupo com `POST /document/document_batch_group` e guarde a `document_batch_group_key`.
2. Crie cada operação (`/debt`, `/v2/credit_transfer/proposal`, etc) enviando `document_batch_group_key` na raiz do payload.
3. (Opcional) Consulte o grupo e remova operações antes do envio.
4. Envie o grupo para assinatura com `PUT /document/document_batch_group/{key}/send_to_signature` e obtenha o **link único** do beneficiário.
5. O beneficiário assina todas as operações de uma vez; cada operação evolui individualmente e o grupo é concluído quando todas chegam a um status terminal.
:::

:::info Grupo × lote
Cada operação (dívida, proposta de portabilidade/refin ou reserva de cartão) continua sendo **um lote** (envelope). O **grupo** é a camada acima dos lotes (pasta), responsável por reunir os envelopes e disparar **uma única assinatura**. Se você ainda utiliza o fluxo de [lote externo](/documentation/guides/INSS/signatures/batch-signature), consulte a [tabela de migração](#migracao) ao final desta página.
:::

:::caution Regras do grupo
- **Assinante único:** o grupo suporta **apenas um assinante** (o beneficiário). Não é possível informar múltiplos assinantes na pasta.
- **Mesma titularidade:** o assinante informado na abertura do grupo deve ser **o mesmo** de todas as operações anexadas. Operação com assinante divergente retorna **erro síncrono** (`DOC000121`).
- **Tipos permitidos:** o grupo aceita operações INSS de Crédito Novo, Portabilidade/Refinanciamento e Cartão Consignado, desde que compartilhem o mesmo assinante.
- **Limite de operações:** o grupo aceita **no máximo 7 operações** (lotes). A inclusão de uma operação além do limite retorna **erro síncrono** (`DOC000127`).
- **Contato obrigatório:** informe `signer_email` e/ou `signer_phone` no assinante. Sem um meio de contato, não é possível gerar o link de assinatura.
- **Certificador:** derivado automaticamente da configuração do requester (`qi_sign`); não é enviado na requisição.
:::

:::info Convivência com os fluxos atuais (período de transição)
O fluxo de grupo é **opcional e aditivo**: ele só é acionado quando `document_batch_group_key` é enviado na criação da operação. Os fluxos existentes — assinatura individual por operação com o certificador configurado para o requester (inclusive certificadores externos, como `client_side`) e o [lote externo](/documentation/guides/INSS/signatures/batch-signature) — **continuam funcionando sem alteração** durante o período de transição. Dentro do grupo, a assinatura é sempre coletada via **QI Sign**, mesmo que o requester utilize outro certificador nos fluxos regulares.
:::

---

## 1. Abrir o grupo

ENDPOINT /document/document_batch_group
MÉTODO POST

Request Body

```json
{
    "batch_group_type": "social_security",
    "request_control_key": "5ed20003-0610-46d2-88cc-a5d0de640696",
    "signer": {
        "signer_document_number": "14471835092",
        "signer_name": "Nome devedor",
        "signer_email": "maria.silva@email.com",
        "signer_phone": {
            "country_code": "55",
            "area_code": "11",
            "number": "999538380"
        },
        "signer_role": "issuer",
        "signature_method": "whatsapp"
    },
    "personal_document": {
        "type": "rg",
        "document_identification_front_key": "3b28a1a6-51c0-4f0e-9b64-2c98d6a3f1e0",
        "document_identification_back_key": "9d47c2b1-8f3a-4e5d-a1c2-7b6e5d4f3a2b"
    }
}
```

### Body Params

:::info Certificador
O certificador (`qi_sign`) é **derivado** da configuração do requester e **não** é enviado na requisição. Requesters cuja configuração não use `qi_sign` recebem `DOC000118`.
:::

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `batch_group_type` | string | Tipo do grupo. Atualmente o único valor é `social_security`. | **[Batch Group Type](#batch-group-type)** |
| `request_control_key` | string | Chave de **idempotência** (UUID v4), **obrigatória**. Reenviar o mesmo valor retorna o grupo já existente (evita grupos/pastas duplicados em retentativas). Não reutilize entre grupos distintos. | 36 |
| `signer` | object | Dados do beneficiário que assinará todas as operações do grupo. | **[Signer Object](#signer-object)** |
| `personal_document` | object | (Opcional) Documento de identificação do beneficiário coletado previamente, para dispensar a foto do documento durante a jornada de assinatura. | **[Documento pré-coletado](#documento-de-identificacao-pre-coletado)** |

### Signer Object

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `signer_document_number` | string | CPF/CNPJ do assinante (apenas dígitos). | 11 a 14 |
| `signer_name` | string | Nome do assinante. | 100 |
| `signer_email` | string | E-mail para envio do link de assinatura. (opcional) | 255 |
| `signer_phone.country_code` | string | Código do país (ex.: `"55"`). (opcional) | 5 |
| `signer_phone.area_code` | string | DDD do assinante. (opcional) | 5 |
| `signer_phone.number` | string | Número de telefone do assinante. (opcional) | 15 |
| `signer_role` | string | Papel do assinante (ex.: `issuer`). **Deve ser igual ao papel do assinante nas operações anexadas**, caso contrário a inclusão retorna `DOC000121`. | 100 |
| `signature_method` | string | Canal de envio do link de assinatura. (opcional) | **[Signature Method](#signature-method)** |
| `birth_date` | string | Data de nascimento do assinante (`AAAA-MM-DD`). (opcional) | 10 |

### Documento de identificação pré-coletado {#documento-de-identificacao-pre-coletado}

Se o seu fluxo já coleta o documento de identificação do beneficiário (RG, CNH etc.) antes da assinatura, envie-o na abertura do grupo pelo objeto **`personal_document`**. As imagens são encaminhadas ao QI Sign junto com a criação da pasta e a etapa de captura do documento chega **pré-atendida** na jornada — o beneficiário não precisa fotografar o documento novamente durante a assinatura.

O envio acontece em duas etapas:

1. **Faça o upload dos arquivos previamente** pelo [fluxo de upload de documentos](../../../upload_de_documentos/upload_de_documentos.md) e guarde a `document_key` de cada arquivo (um arquivo por lado do documento, ou um arquivo único no caso de documento digital).
2. **Referencie as chaves** no objeto `personal_document` da abertura do grupo.

```json title="Trecho ilustrativo (raiz do payload de abertura do grupo)"
{
    "personal_document": {
        "type": "rg",
        "document_identification_front_key": "3b28a1a6-51c0-4f0e-9b64-2c98d6a3f1e0",
        "document_identification_back_key": "9d47c2b1-8f3a-4e5d-a1c2-7b6e5d4f3a2b"
    }
}
```

#### Personal Document Object

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `type` | string | Tipo do documento de identificação. | **[Personal Document Type](#personal-document-type)** |
| `document_identification_front_key` | string | `document_key` do arquivo com a **frente** do documento. Obrigatório no modo frente e verso (junto com `..._back_key`). | 36 |
| `document_identification_back_key` | string | `document_key` do arquivo com o **verso** do documento. Obrigatório no modo frente e verso (junto com `..._front_key`). | 36 |
| `document_identification_full_key` | string | `document_key` do arquivo **único** com o documento completo (documento digital). Não pode ser combinado com as chaves de frente/verso. | 36 |

:::caution Regras do documento pré-coletado
- Envie **frente + verso** (`document_identification_front_key` + `document_identification_back_key`) **ou** o **arquivo único** (`document_identification_full_key`) — nunca os dois modos juntos.
- Cada `type` suporta modos específicos — veja **[Personal Document Type](#personal-document-type)**. Combinação inválida retorna `DOC000128`.
- Os documentos referenciados devem pertencer ao seu requester e já ter o **arquivo enviado** (upload concluído). Chave inexistente ou de outro requester retorna `DOC000004`; documento sem arquivo retorna `DOC000049`.
- O envio é feito **apenas na abertura do grupo** — não é possível adicionar ou trocar o documento depois que o grupo foi criado. Se algum arquivo for rejeitado, a criação do grupo falha por inteiro (nenhum grupo é criado).
:::

O objeto `personal_document` enviado é ecoado nas [consultas do grupo](#3-consultar-o-grupo).

---

### Response

STATUS 201

Response Body

```json
{
    "document_batch_group_key": "17f35e19-a039-468f-aaa7-84aa8edec3dc",
    "status": "pending_batches"
}
```

| Campo | Tipo | Descrição |
|---|---|---|
| `document_batch_group_key` | string | Identificador do grupo. Guarde para os próximos passos. |
| `status` | string | Status inicial do grupo: `pending_batches`. Veja **[Status do grupo](#status-do-grupo)**. |

---

## 2. Incluir operações no grupo

Ao criar cada operação, envie **`document_batch_group_key` na raiz do JSON** (mesmo nível dos demais campos principais do produto). A operação é criada normalmente, mas a sua assinatura fica **vinculada à pasta do grupo** — não é gerado link de assinatura individual.

Crédito Novo / Refin POST /debt
Portabilidade / Refin POST /v2/credit_transfer/proposal
Cartão POST /payroll_card_reservation/social_security

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `document_batch_group_key` | string | A `document_batch_group_key` retornada na abertura do grupo; enviada na raiz do payload de criação da operação. Obrigatório no fluxo com grupo. | 36 |

```json title="Trecho ilustrativo (raiz do payload)"
{
    "document_batch_group_key": "17f35e19-a039-468f-aaa7-84aa8edec3dc"
}
```

O restante do body segue o contrato de cada endpoint. Consulte os [roteiros de crédito consignado INSS](/documentation/guides/INSS/intro) conforme o produto.

:::info Resposta da operação no fluxo com grupo
Como o link de assinatura passa a ser **único e no nível do grupo**, a resposta de criação da operação **não retorna** dados de assinatura individuais (ex.: `signature_information` na proposta de portabilidade/refin). O link é obtido apenas no [envio do grupo para assinatura](#5-enviar-para-assinatura).
:::

---

## 3. Consultar o grupo

ENDPOINT /document/document_batch_group/{document_batch_group_key}
MÉTODO GET

Recomendado antes de enviar para assinatura, para conferir as operações agrupadas e seus status.

### Path Params

| Campo | Tipo | Descrição |
|---|---|---|
| `document_batch_group_key` | string | Chave do grupo. |

:::info Consulta por idempotência
Também é possível consultar pela `request_control_key`: `GET /document/document_batch_group/request_control_key/{request_control_key}`.
:::

### Exemplo de chamada

```
GET /document/document_batch_group/17f35e19-a039-468f-aaa7-84aa8edec3dc
```

---

### Response

STATUS 200

Response Body

```json
{
    "document_batch_group_key": "17f35e19-a039-468f-aaa7-84aa8edec3dc",
    "request_control_key": "5ed20003-0610-46d2-88cc-a5d0de640696",
    "external_key": "c109d589-ae18-4f4f-ad31-2879bf714c71",
    "group_name": "Assinatura de operações INSS",
    "batch_group_type": "social_security",
    "status": "pending_batches",
    "signature_url": null,
    "personal_document": {
        "type": "rg",
        "document_identification_front_key": "3b28a1a6-51c0-4f0e-9b64-2c98d6a3f1e0",
        "document_identification_back_key": "9d47c2b1-8f3a-4e5d-a1c2-7b6e5d4f3a2b"
    },
    "batches": [
        {
            "document_batch_key": "5cca1dad-28fe-4f19-8bbb-0edd6f042384",
            "origin_key": "324caa35-ba10-4590-ae2b-5efef71709c3",
            "origin_type": "credit_operation",
            "status": "pending_signature"
        },
        {
            "document_batch_key": "085e3098-0bdb-4472-a4ae-dafc1bafda53",
            "origin_key": "2f7e320c-2a35-4e78-bfd7-a298b28a7497",
            "origin_type": "credit_transfer_proposal",
            "status": "pending_signature"
        }
    ]
}
```

| Campo | Tipo | Descrição |
|---|---|---|
| `document_batch_group_key` | string | Identificador do grupo. |
| `request_control_key` | string | Chave de idempotência informada na abertura do grupo. |
| `external_key` | string | Identificador da pasta no QI Sign. |
| `group_name` | string | Nome gerado para o grupo (ex.: `Assinatura de operações INSS`). |
| `batch_group_type` | string | Tipo do grupo. Veja **[Batch Group Type](#batch-group-type)**. |
| `status` | string | Status do grupo. Veja **[Status do grupo](#status-do-grupo)**. |
| `signature_url` | string | Link único de assinatura do beneficiário. Disponível após o envio para assinatura. Com o [preenchimento automático do login](#5-enviar-para-assinatura) habilitado, retorna o link já autenticado. |
| `personal_document` | object | [Documento de identificação pré-coletado](#documento-de-identificacao-pre-coletado) informado na abertura do grupo (`null` se não enviado). |
| `batches` | array | Operações anexadas ao grupo. **[Batch Object](#batch-object)** |

### Batch Object

| Campo | Tipo | Descrição |
|---|---|---|
| `document_batch_key` | string | Chave do lote (envelope) da operação. |
| `origin_key` | string | Chave da operação de origem. Veja **[Origin Type](#origin-type)**. |
| `origin_type` | string | Tipo da operação de origem. Veja **[Origin Type](#origin-type)**. |
| `status` | string | Status da operação dentro do grupo. Veja **[Status da operação](#status-da-operação)**. |

---

## 4. Remover operação do grupo

Desvincula e cancela uma operação específica antes do envio para assinatura (para reagrupar, se necessário). Só é permitido enquanto o grupo está em `pending_batches`.

ENDPOINT /document/document_batch_group/{document_batch_group_key}/remove_batch
MÉTODO PUT

### Path Params

| Campo | Tipo | Descrição |
|---|---|---|
| `document_batch_group_key` | string | Chave do grupo. |

Request Body

```json
{
    "origin_key": "324caa35-ba10-4590-ae2b-5efef71709c3"
}
```

### Body Params

| Campo | Tipo | Descrição |
|---|---|---|
| `origin_key` | string | Chave da operação a remover (a mesma `origin_key` retornada na consulta do grupo). |

---

### Response

STATUS 201

Retorna o grupo atualizado, já sem a operação removida em `batches` (mesmo formato da [consulta do grupo](#3-consultar-o-grupo)).

Response Body

```json
{
    "document_batch_group_key": "17f35e19-a039-468f-aaa7-84aa8edec3dc",
    "status": "pending_batches",
    "signature_url": null,
    "batches": [
        {
            "document_batch_key": "085e3098-0bdb-4472-a4ae-dafc1bafda53",
            "origin_key": "2f7e320c-2a35-4e78-bfd7-a298b28a7497",
            "origin_type": "credit_transfer_proposal",
            "status": "pending_signature"
        }
    ]
}
```

---

## 5. Enviar para assinatura

Fecha o grupo e dispara a pasta para assinatura no QI Sign. Retorna o **link único** (`signature_url`) que o beneficiário usa para assinar todas as operações de uma só vez.

ENDPOINT /document/document_batch_group/{document_batch_group_key}/send_to_signature
MÉTODO PUT

### Path Params

| Campo | Tipo | Descrição |
|---|---|---|
| `document_batch_group_key` | string | Chave do grupo. |

**Body:** objeto JSON vazio `{}`.

:::caution Pré-condições do envio
- O grupo precisa estar em `pending_batches`.
- Deve haver **ao menos uma** operação anexada (`DOC000120`).
- Todas as operações devem ter o **mesmo assinante** do grupo (`DOC000121`).
:::

---

### Response

STATUS 201

O grupo passa para `pending_signature` e a `signature_url` é preenchida.

Response Body

```json
{
    "document_batch_group_key": "17f35e19-a039-468f-aaa7-84aa8edec3dc",
    "status": "pending_signature",
    "signature_url": "https://sign.sandbox.qitech.app/f/17f35e19-a039-468f-aaa7-84aa8edec3dc",
    "batches": [
        {
            "document_batch_key": "085e3098-0bdb-4472-a4ae-dafc1bafda53",
            "origin_key": "2f7e320c-2a35-4e78-bfd7-a298b28a7497",
            "origin_type": "credit_transfer_proposal",
            "status": "pending_signature"
        }
    ]
}
```

| Campo | Tipo | Descrição |
|---|---|---|
| `status` | string | Status do grupo após o envio: `pending_signature`. |
| `signature_url` | string | Link único de assinatura do beneficiário. |
| `batches` | array | Operações do grupo. **[Batch Object](#batch-object)** |

:::info Link com preenchimento automático do login
Sob demanda, é possível habilitar o **preenchimento automático do login**. Com a opção habilitada, a `signature_url` retornada no envio para assinatura e nas [consultas do grupo](#3-consultar-o-grupo) passa a ser um **link autenticado**: a tela de login da jornada de assinatura já vem preenchida com os dados do beneficiário.
:::

---

## Acompanhamento

Após o envio, o beneficiário assina todas as operações com **um único link**. Na jornada de assinatura, o beneficiário pode **aceitar ou recusar cada operação individualmente** — desfechos parciais são normais (ex.: duas operações assinadas e uma recusada no mesmo grupo). Cada operação evolui de forma independente e o grupo é concluído (`completed`) quando **nenhuma** operação permanece em `pending_signature`, independentemente da combinação de desfechos. Acompanhe o desfecho de cada operação pelos webhooks do respectivo produto (abaixo) ou pela [consulta do grupo](#3-consultar-o-grupo).

:::info Submissão automática (Portabilidade/Refin)
No fluxo com grupo, após a assinatura da proposta de portabilidade/refin a submissão à registradora é feita **automaticamente** — a proposta avança para `pending_response` sem necessidade do `PATCH` manual de submissão.
:::

### Webhook de operação assinada

Cada operação assinada segue o **mesmo fluxo de webhooks do produto** (dívida emitida, proposta submetida etc.) — nenhum campo muda em relação ao fluxo sem grupo. Consulte os webhooks de cada produto nos [roteiros INSS](/documentation/guides/INSS/intro).

### Webhook de assinatura recusada

Quando o beneficiário **recusa** uma operação do grupo, a operação é **cancelada** no respectivo produto e o parceiro recebe o webhook de mudança de status com o motivo `signature_rejected`:

**Crédito Novo / Refin (dívida):**

```json
{
    "key": "324caa35-ba10-4590-ae2b-5efef71709c3",
    "data": {
        "cancel_reason": "Operação cancelada porque o assinante recusou a assinatura.",
        "cancel_reason_enumerator": "signature_rejected"
    },
    "status": "canceled",
    "webhook_type": "debt",
    "event_datetime": "2026-07-06 14:30:00"
}
```

**Portabilidade / Refin (proposta):**

```json
{
    "webhook_type": "credit_transfer.proposal",
    "proposal_key": "2f7e320c-2a35-4e78-bfd7-a298b28a7497",
    "event_datetime": "2026-07-06T14:30:00",
    "proposal_status": "canceled",
    "cancel_reason": "signature_rejected"
}
```

| Produto | `webhook_type` | Campo de status | Motivo da recusa |
|---|---|---|---|
| Crédito Novo / Refin | `debt` | `status: "canceled"` | `data.cancel_reason_enumerator: "signature_rejected"` |
| Portabilidade / Refin | `credit_transfer.proposal` | `proposal_status: "canceled"` | `cancel_reason: "signature_rejected"` |

Na [consulta do grupo](#3-consultar-o-grupo), a operação recusada aparece com status `sign_rejected`.

---

## Erros

| HTTP | Código | Quando ocorre |
|---|---|---|
| 400 | `DOC000118` | O certificador configurado para o requester não é suportado (apenas `qi_sign`). |
| 404 | `DOC000117` | Grupo não encontrado para a chave informada. |
| 409 | `DOC000119` | Grupo não está em `pending_batches` e não pode ser modificado. |
| 400 | `DOC000120` | Envio para assinatura sem nenhuma operação anexada. |
| 400 | `DOC000121` | Assinante de uma operação difere do assinante do grupo. |
| 400 | `DOC000122` | `origin_key` não informado na remoção. |
| 404 | `DOC000123` | `origin_key` não encontrado entre as operações do grupo. |
| 400 | `DOC000127` | O grupo já possui o número máximo de operações (5). |
| 400 | `DOC000128` | O `type` do documento pré-coletado não suporta o modo enviado (frente e verso × arquivo único). Veja **[Personal Document Type](#personal-document-type)**. |
| 400 | `DOC000129` | A jornada de assinatura configurada para o requester não coleta documento de identificação — o envio de documento pré-coletado não se aplica. |
| 400 | `DOC000130` | O `type` do documento pré-coletado não está entre os tipos aceitos pela configuração do requester. |
| 404 | `DOC000004` | `document_key` do documento pré-coletado não encontrada (inclui documento pertencente a outro requester). |
| 400 | `DOC000049` | Documento pré-coletado sem arquivo — o upload não foi concluído antes da abertura do grupo. |
| 400 | `DOC000126` | Configuração do requester incompleta. |
| 404 | `DOC000091` | Configuração de certificador não encontrada para o requester. |

---

## Enumeradores

### Batch Group Type

| Enumerador | Descrição |
|---|---|
| `social_security` | Operações de crédito consignado INSS. |

### Signature Method

| Enumerador | Descrição |
|---|---|
| `email` | Link de assinatura enviado por e-mail. |
| `sms` | Link de assinatura enviado por SMS. |
| `whatsapp` | Link de assinatura enviado por WhatsApp. |

### Personal Document Type

Tipos aceitos no [documento de identificação pré-coletado](#documento-de-identificacao-pre-coletado) e os modos de envio suportados por cada um:

| Enumerador | Documento | Frente e verso | Arquivo único |
|---|---|---|---|
| `rg` | Registro Geral (RG) | ✔ | — |
| `cnh` | Carteira Nacional de Habilitação | ✔ | ✔ |
| `cin` | Carteira de Identidade Nacional | — | ✔ |

- **Frente e verso:** envie `document_identification_front_key` + `document_identification_back_key`.
- **Arquivo único:** envie apenas `document_identification_full_key` (documento digital, ex.: CNH digital).

### Origin Type

| Enumerador | Operação | `origin_key` |
|---|---|---|
| `credit_operation` | Crédito Novo / Refin (`POST /debt`) | `credit_operation_key` |
| `credit_transfer_proposal` | Portabilidade / Refin (`POST /v2/credit_transfer/proposal`) | `proposal_key` |
| `payroll_card_reservation` | Cartão Consignado (`POST /payroll_card_reservation/social_security`) | chave da reserva |

### Status do grupo

| Status | Descrição |
|---|---|
| `pending_batches` | Grupo aberto, recebendo operações. Permite incluir/remover operações. |
| `pending_signature` | Enviado para assinatura; aguardando o beneficiário assinar. |
| `completed` | Todas as operações do grupo chegaram a um status terminal. |
| `canceled` | Grupo cancelado. |

### Status da operação

| Status | Descrição |
|---|---|
| `pending_signature` | Operação anexada ao grupo, aguardando assinatura. |
| `signed` | Operação assinada com sucesso. |
| `sign_rejected` | Beneficiário recusou a assinatura da pasta. |
| `canceled` | Operação/pasta cancelada. |

---

## Migração do lote externo para o grupo {#migracao}

O fluxo de [lote externo](/documentation/guides/INSS/signatures/batch-signature) (`document_batch_key`) é substituído pelo fluxo de grupo (`document_batch_group_key`). Principais diferenças:

- Você **não** cria mais o lote e adiciona documentos manualmente: cada operação (`/debt`, `/v2/credit_transfer/proposal`, cartão) já é um lote, e o **grupo** apenas os reúne.
- O link de assinatura passa a ser **único e no nível do grupo**, retornado no envio para assinatura — não há link por operação.

| Antigo (lote externo) | Novo (grupo) |
|---|---|
| `POST /document/document_batch` (`type: social_security_external_batch`) | `POST /document/document_batch_group` |
| `document_batch_key` na raiz da operação | `document_batch_group_key` na raiz da operação |
| `GET /document/document_batch/{key}` | `GET /document/document_batch_group/{key}` |
| `DELETE /document/document_batch/{key}/documents` (limpar tudo) | `PUT /document/document_batch_group/{key}/remove_batch` (remover uma operação) |
| `PUT /document/document_batch/{key}/send_to_signature` | `PUT /document/document_batch_group/{key}/send_to_signature` |

---

# Assinatura em lote (INSS)

URL: /en/documentation/guides/INSS/signatures/batch-signature

Assinatura em lote (INSS)

Fluxo para agrupar **várias operações** em **um único envelope de assinatura** do QI Sign: você abre o lote, cria as operações referenciando o lote, confere (opcionalmente limpa) e dispara o envio para assinatura.

:::caution Fluxo legado
Este é o fluxo de **lote externo** (`document_batch_key`). Ele permanece disponível, mas o caminho recomendado para novas integrações é a **[Assinatura em grupo](/documentation/guides/INSS/signatures/batch-group-signature)** (`document_batch_group_key`), que reúne as operações em uma pasta e dispara **uma única assinatura** para o beneficiário. Consulte a [tabela de migração](/documentation/guides/INSS/signatures/batch-group-signature#migracao).
:::

:::caution Regras do lote
**Mesma titularidade:** todas as operações do lote devem ser do **CPF** ou do **mesmo representante legal**. Incluir CPF “A” e CPF “B” no mesmo lote gera **erro síncrono** no `POST` da operação.

**Tipos permitidos:** por ora o fluxo aceita operações INSS de Crédito Novo e Cartão Consignado no mesmo lote.
:::

---

## Abrir o lote

Request

ENDPOINT /document/document_batch
MÉTODO POST

Body

type
string
obrigatório
Fixo: social_security_external_batch .

certifier_type
string
obrigatório
Fixo: qi_sign .

batch_name
string
obrigatório
Nome do lote para identificação; **máximo 100 caracteres**. Use um identificador único por lote na sua operação.

request_control_key
string (UUID v4)
obrigatório
Chave de **idempotência**; não reutilize entre lotes distintos.

**Python**

```python title="ENDPOINT"
POST /document/document_batch
```

**curl**

```bash title="ENDPOINT"
curl -X POST \
  'https://api-auth.sandbox.qitech.app/document/document_batch' \
  -H 'AUTHORIZATION: eyJhbGciOiJFUzUxMiJ9.eyJwYXlsb2FkX21kNSI6...' \
  -H 'API-CLIENT-KEY: YOUR_API_CLIENT_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "social_security_external_batch",
    "certifier_type": "qi_sign",
    "batch_name": "Lote INSS - pedido-2025-03-001",
    "request_control_key": "5ed20003-0610-46d2-88cc-a5d0de640696"
  }'
```

```json title="REQUEST BODY (exemplo)"
{
  "type": "social_security_external_batch",
  "certifier_type": "qi_sign",
  "batch_name": "Lote INSS - pedido-2025-03-001",
  "request_control_key": "5ed20003-0610-46d2-88cc-a5d0de640696"
}
```

Response

STATUS 201

Atributos

document_batch_key
string
Identificador do lote. Guarde para os próximos passos.

```json title="RESPONSE BODY"
{
  "document_batch_key": "17f35e19-a039-468f-aaa7-84aa8edec3dc"
}
```

---

## Incluir operações no lote

Ao criar cada operação, envie **`document_batch_key` na raiz do JSON** (mesmo nível dos demais campos principais do produto).

Cartão POST /payroll_card_reservation/social_security
Empréstimo POST /debt

document_batch_key
string
obrigatório no fluxo com lote
O mesmo document_batch_key retornado na abertura do lote; envie na raiz do payload de criação da operação.

```json title="Trecho ilustrativo (raiz do payload)"
{
  "document_batch_key": "17f35e19-a039-468f-aaa7-84aa8edec3dc"
}
```

O restante do body segue o contrato de cada endpoint. Consulte os [roteiros de crédito consignado INSS](/documentation/guides/INSS/new-credit-and-refinancing/end-to-end) conforme o produto.

---

## Consultar documentos do lote

Request

ENDPOINT /document/document_batch/ DOCUMENT_BATCH_KEY
MÉTODO GET

Path params

document_batch_key
string
obrigatório
Chave do lote.

Recomendado antes de fechar o lote para conferir tipos e chaves de documento agrupados.

**Python**

```python title="ENDPOINT"
GET /document/document_batch/YOUR_DOCUMENT_BATCH_KEY
```

**curl**

```bash title="ENDPOINT"
curl -X GET \
  'https://api-auth.sandbox.qitech.app/document/document_batch/YOUR_DOCUMENT_BATCH_KEY' \
  -H 'AUTHORIZATION: eyJhbGciOiJFUzUxMiJ9.eyJwYXlsb2FkX21kNSI6...' \
  -H 'API-CLIENT-KEY: YOUR_API_CLIENT_KEY' \
  -H 'Content-Type: application/json'
```

Response

STATUS 200

Atributos

document_batch_key
string
Chave do lote.

documents
array
Lista de documentos; cada item costuma trazer document_key e document_type (ex.: ccb_pre_price_days , payroll_card_term ).

```json title="RESPONSE BODY (exemplo)"
{
  "document_batch_key": "1eee4ec2-05f5-45ef-aa64-38bb3d9de02f",
  "documents": [
    {
      "document_key": "5cca1dad-28fe-4f19-8bbb-0edd6f042384",
      "document_type": "ccb_pre_price_days"
    },
    {
      "document_key": "c109d589-ae18-4f4f-ad31-2879bf714c71",
      "document_type": "withdrawal_operation_term"
    },
    {
      "document_key": "085e3098-0bdb-4472-a4ae-dafc1bafda53",
      "document_type": "payroll_card_term"
    },
    {
      "document_key": "eafdb3bd-5c21-415f-bdc2-8e366d54094c",
      "document_type": "payroll_card_consent_term"
    }
  ]
}
```

---

## Limpar documentos do lote

Remove todos os documentos vinculados ao lote (para reagrupar do zero, se necessário).

Request

ENDPOINT /document/document_batch/ DOCUMENT_BATCH_KEY /documents
MÉTODO DELETE

Path params

document_batch_key
string
obrigatório
Chave do lote.

**Python**

```python title="ENDPOINT"
DELETE /document/document_batch/YOUR_DOCUMENT_BATCH_KEY/documents
```

**curl**

```bash title="ENDPOINT"
curl -X DELETE \
  'https://api-auth.sandbox.qitech.app/document/document_batch/YOUR_DOCUMENT_BATCH_KEY/documents' \
  -H 'AUTHORIZATION: eyJhbGciOiJFUzUxMiJ9.eyJwYXlsb2FkX21kNSI6...' \
  -H 'API-CLIENT-KEY: YOUR_API_CLIENT_KEY' \
  -H 'Content-Type: application/json'
```

Response

STATUS 200

Corpo de resposta conforme padrão da API para sucesso neste recurso (pode ser vazio ou objeto mínimo).

```json title="RESPONSE BODY (exemplo)"
{}
```

---

## Enviar para assinatura

Fecha o lote e dispara os documentos para assinatura no QI Sign.

Request

ENDPOINT /document/document_batch/ DOCUMENT_BATCH_KEY /send_to_signature
MÉTODO PUT

Path params

document_batch_key
string
obrigatório
Chave do lote.

**Body:** objeto JSON vazio `{}`.

**Python**

```python title="ENDPOINT"
PUT /document/document_batch/YOUR_DOCUMENT_BATCH_KEY/send_to_signature
```

**curl**

```bash title="ENDPOINT"
curl -X PUT \
  'https://api-auth.sandbox.qitech.app/document/document_batch/YOUR_DOCUMENT_BATCH_KEY/send_to_signature' \
  -H 'AUTHORIZATION: eyJhbGciOiJFUzUxMiJ9.eyJwYXlsb2FkX21kNSI6...' \
  -H 'API-CLIENT-KEY: YOUR_API_CLIENT_KEY' \
  -H 'Content-Type: application/json' \
  -d '{}'
```

```json title="REQUEST BODY"
{}
```

Response

STATUS 200

```json title="RESPONSE BODY (exemplo)"
{}
```

---

## Erros

| HTTP | Código | Título (exemplo) | Endpoint | Quando ocorre |
|------|--------|------------------|----------|---------------|
| 404 | DOC000007 | (lote não encontrado) | `GET /document/document_batch/DOCUMENT_BATCH_KEY` | `document_batch_key` inexistente |
| 409 | DOC000103 | Bad Request | POST /document/document_batch | `request_control_key` duplicado (idempotência violada de forma inválida) |

**Exemplo de erro (idempotência)**

```json
{
  "code": "DOC000103",
  "title": "Bad Request",
  "description": "request_control_key already exists",
  "translation": "Chave de controle da request já existe.",
  "http_status": 409
}
```

:::info Conflito de titularidade ou tipo
Validações de **mesmo CPF/representante** e de **tipo de operação** no lote costumam retornar erro no POST da operação ( /debt ou /payroll_card_reservation/social_security ), não no endpoint do lote. O corpo de erro segue o catálogo do recurso chamado.
:::

:::info Migração de paths
Endpoints antigos foram substituídos pelos paths abaixo:

| Antigo | Novo |
|--------|------|
| `POST /document_batch/external` | `POST /document/document_batch` |
| `GET /document_batch/external/DOCUMENT_BATCH_KEY` | `GET /document/document_batch/DOCUMENT_BATCH_KEY` |
| `PUT /document_batch/DOCUMENT_BATCH_KEY/send_to_signature` | `PUT /document/document_batch/DOCUMENT_BATCH_KEY/send_to_signature` |
:::

---

# Document Insertion

URL: /en/documentation/iaas/aditamento_recebiveis/envio_documento

### Request

ENDPOINT /asset_amendment/fund_class/FUND_CLASS_KEY/amendment_configuration/AMENDMENT_CONFIGURATION_KEY/asset_amendment/ASSET_AMENDMENT_KEY/document
METHOD POST

```json title='Request Body'
{
    "document_type":"amendment_term",
    "document_b64": "aGVsbG8gd29ybGQgaWYgeW91IGRlY29kZWQgbWUsIGJlIGNhcmVmdWwuIEl0IG11c3QgYmUgYSBQREYgRmlsZSBvdGhlcndpc2UgSSB3aWxsIHJhaXNlIGFuIEVycm9yLg=="
}
```

#### Body Params

| Field | Type | Description
|-|-|-|
| `document_type` * | string | Document type (always amendment_term).|
| `document_b64` * | string | Must be the binary of the file, in PDF, encoded in Base64.

### Response

STATUS 201

```json title='Response Body'
{
    "document_key": "8e515a17-8b4d-49a3-aed6-47c9574e426a"
}
```

---

# Introduction

URL: /en/documentation/iaas/aditamento_recebiveis/inicio

The Receivables Amendment system is a solution that allows the modification and update of existing contracts and agreements related to receivables. This module offers essential functionalities to:

- Perform changes to existing receivables contracts
- Manage modifications to payment conditions

This documentation provides a detailed view on how to use the amendment system, including its main features and flows. Here you will find information about:

- Amendment processes
- Endpoints and payloads

To start using the system, navigate through the topics available in this documentation to better understand each aspect of the amendment module.

---

# Amendment Request Creation

URL: /en/documentation/iaas/aditamento_recebiveis/pedido_aditamento_contrato

---
To make an amendment request, you need to make a request using the unique key that represents the fund (FUND_CLASS_KEY, provided by Qi Tech) and the unique key that represents the amendment pipeline configurations (AMENDMENT_CONFIGURATION_KEY, provided by Qi Tech).

In amendments made through this system, it is allowed to change the payment flow or nominal rate of the contract or both. It is also possible to define that the amendment will be made together with a down payment made by the debtor.

### Request

ENDPOINT /asset_amendment/fund_class/FUND_CLASS_KEY/amendment_configuration/AMENDMENT_CONFIGURATION_KEY/asset_amendment
METHOD POST

```json title='Request Body'
{
	"asset_external_id": "931e9437-d025-41ab-bb53-6b94e10fd361",
    "amendment_date": "2024-04-01",
    "amendment_type": "all_contract",
    "down_payment_value": 400.23,
    "installments":[
        {
            "maturity_date": "2025-01-31",
            "face_value": 1000.31,
            "installment_number": 1
        },
        {
            "maturity_date": "2025-02-31",
            "face_value": 1000.31,
            "installment_number": 2
        }
    ],
    "pre_fixed":{
        "monthly_rate": 0.02,
        "calendar_base": "workdays"
    }
}
```

#### Body Params

| Field | Type | Description | Required |
|-|-|-|-|
| `asset_external_id` | string | Unique identification key of the contract being amended. | Yes |
| `amendment_date` | string | Date when the amendment is being made (format: YYYY-MM-DD) | Yes |
| `amendment_type` | string | Type of amendment to be made. See **[Amendment Type Enumerator](#amendment-type-enumerator) | Yes |
| `down_payment_value` | number | Down payment amount to be paid by the debtor at the time of amendment | No |
| `installments` | array | List of contract installments after the amendment | Yes |
| `installments[].maturity_date` | string | Installment due date (format: YYYY-MM-DD) | Yes |
| `installments[].face_value` | number | Nominal value of the installment | Yes |
| `installments[].installment_number` | number | Sequential number of the installment | Yes |
| `pre_fixed` | object | Pre-fixed rate configurations | Yes |
| `pre_fixed.monthly_rate` | number | Monthly rate to be applied | Yes |
| `pre_fixed.calendar_base` | string | Calendar base for calculation (e.g.: "workdays") | Yes |

### Response

STATUS 201

```json title='Response Body'
{
    "asset_amendment_key": "a914aac6-93ff-45ee-8574-f4dbaf6c0642",
    "status": "pending_assets_insertion",
}
```

### Amendment Type Enumerator
| Enumerator   | Description     |
|--------------|---------------|
| **payment_flow**   | Amendment of payment flow only |
| **nominal_rate** | Amendment of contract nominal rate only |
| **all_contract** | Amendment of both payment flow and contract nominal rate |

:::caution **Attention**
The installments and pre_fixed fields should exist or not according to the type of amendment to be made as per the following table
:::

| Amendment type | installments | pre_fixed |
|------------------- | ------------ | --------- |
| all_contract | Required | Required |
| pre_fixed | Should not be sent | Required |
| payment_flow | Required | Should not be sent |

---

# Public Securities Recorder

URL: /en/documentation/iaas/boletador/boletador_titulos_publicos

## Request

ENDPOINT /trade_treasury/public/fund_class/{fund_class_key}/operation
METHOD POST

### Path params

| Parameter | Type | Description |
| :---- | :---- | :---- |
| `fund_class_key` | string | Unique identifier for the fund. |

```json title="Request Body"
{
    "external_id": "a3f1c2e4-7b8d-4e6f-9a0b-1c2d3e4f5a6b",
    "operation_date": "2025-12-04",
    "payment_date": "2025-12-04",
    "operation_part": "assignee",
    "operation_type": "outright_operation",
    "counterparty": {
        "iselic_number": "20824264",
        "selic_account_number": "123456789",
        "document_number": "20.824.264/0001-77"
    },
    "treasury_type": "ntn_b",
    "unit_price": 1234.567891,
    "units": 10,
    "maturity_date": "2035-05-15"
}
```

### Body attributes

| Field | Type | Required | Description |
| :---- | :---- | :---- | :---- |
| `external_id` | string | optional | External identifier for idempotency (UUID). Auto-generated if not provided. Maximum 36 characters. |
| `operation_date` | string (date) | required | Operation date in `YYYY-MM-DD` format. Must be a business day and equal to the fund's `accounting_date`. |
| `payment_date` | string (date) | required | Settlement date in `YYYY-MM-DD` format. Must be `>= operation_date`. For non-term operations (`outright_operation`, `buyback_operation`), must equal `operation_date`. |
| `operation_part` | string | required | Fund's role: `assignee` (buyer) or `assignor` (seller). |
| `operation_type` | string | required | Operation type: `outright_operation`, `buyback_operation`. `buyback_operation` requires `operation_part == "assignee"`. |
| `counterparty` | object | required | Counterparty data. See object below. |
| `treasury_type` | string | required | Security type: `lft`, `ltn`, `ntn_b`, or `ntn_f`. |
| `unit_price` | number | required | Unit price. Accepts any decimal precision; the server truncates down based on type: `buyback_operation` → 8 decimal places; others → 6 decimal places. |
| `units` | integer | required | Number of securities (positive integer). |
| `maturity_date` | string (date) | required | Security maturity date (`YYYY-MM-DD`). Must be strictly after `operation_date`. |
| `yearly_negotiated_rate` | number | conditional | Annual negotiated rate (%). **Required for** `buyback_operation`. |
| `return_date` | string (date) | conditional | Return date (`YYYY-MM-DD`). **Required for** `buyback_operation`. Must be `> operation_date`. |

#### `counterparty` object

| Field | Type | Required | Description |
| :---- | :---- | :---- | :---- |
| `iselic_number` | string | required | Counterparty iSELIC number (8 digits). |
| `selic_account_number` | string | required | Counterparty SELIC account number (9 digits). |
| `document_number` | string | required | Counterparty CNPJ with punctuation (format `XX.XXX.XXX/XXXX-XX`). |

## Response

STATUS 201

```json title="Response Body"
{
    "operation_key": "85cfd700-54a4-40f4-bc61-2ece992864ea",
    "external_id": "a3f1c2e4-7b8d-4e6f-9a0b-1c2d3e4f5a6b",
    "fund_class": {
        "fund_class_key": "5122bf31-660a-4f61-a447-38e5e17162dd",
        "manager_key": "bea7581a-f901-4995-a486-46e18ae61aab",
        "name": "EXAMPLE FUND DTVM",
        "document_number": "81.692.758/0001-30",
        "accounting_date": "2025-12-04"
    },
    "status": "pending_manager_approval",
    "operation_part": "assignee",
    "operation_type": {
        "enumerator": "outright_operation",
        "code": 1052
    },
    "treasury": {
        "enumerator": "ntn_b",
        "code": 760199
    },
    "operation_date": "2025-12-04",
    "payment_date": "2025-12-04",
    "maturity_date": "2035-05-15",
    "total_operation_value": 12345.67,
    "units": 10,
    "unit_price": 1234.567891,
    "counterparty": {
        "iselic_number": "20824264",
        "document_number": "20.824.264/0001-77",
        "selic_account_number": "123456789"
    },
    "isin_code": "BRSTNCNTB633",
    "issue_date": "2025-11-04",
    "operation_data": {}
}
```

### Response attributes

| Field | Type | Description |
| :---- | :---- | :---- |
| `operation_key` | string | Unique operation identifier generated by QI Tech (UUID). |
| `external_id` | string | External identifier provided or auto-generated. |
| `fund_class` | object | Data of the fund associated with the operation. |
| `status` | string | Initial operation status. |
| `operation_part` | string | `assignee` (buyer) or `assignor` (seller). |
| `operation_type` | object | `{ enumerator, code }` — operation type and corresponding SELIC code. |
| `treasury` | object | `{ enumerator, code }` — security type and corresponding SELIC code. |
| `operation_date` | string | Operation date (`YYYY-MM-DD`). |
| `payment_date` | string | Settlement date (`YYYY-MM-DD`). |
| `maturity_date` | string | Security maturity date (`YYYY-MM-DD`). |
| `total_operation_value` | decimal | Total operation value (units × unit_price). |
| `units` | integer | Number of securities. |
| `unit_price` | number | Unit price of the security. |
| `counterparty` | object | Counterparty data (`iselic_number`, `document_number`, `selic_account_number`). |
| `isin_code` | string | Security ISIN code. |
| `issue_date` | string | Security issue date (`YYYY-MM-DD`). |
| `operation_data` | object | Additional internal operation metadata. |

---

# Public Securities Listing

URL: /en/documentation/iaas/boletador/listagem_titulos_publicos

## Request

ENDPOINT /trade_treasury/public/fund_class/{fund_class_key}/operations
METHOD GET

### Path params

| Parameter | Type | Description |
| :---- | :---- | :---- |
| `fund_class_key` | string | Unique identifier for the fund. |

### Query params

| Parameter | Type | Default | Maximum | Description |
| :---- | :---- | :---- | :---- | :---- |
| `limit` | integer | 100 | 500 | Number of items per page. |
| `page` | integer | 0 | — | Page number (0-indexed). |
| `status` | string | — | — | Filter by exact operation status. |
| `not_status` | string | — | — | Exclude operations with a given status. |
| `treasury_type` | string | — | — | Filter by security type (`lft`, `ltn`, `ntn_b`, `ntn_f`). |
| `operation_type` | string | — | — | Filter by operation type (`outright_operation`, `buyback_operation`). |
| `operation_date` | string | — | — | Filter by exact operation date (`YYYY-MM-DD`). |
| `from_operation_date` | string | — | — | Filter operations with date `>=` value (`YYYY-MM-DD`). |
| `to_operation_date` | string | — | — | Filter operations with date `<=` value (`YYYY-MM-DD`). |
| `maturity_date` | string | — | — | Filter by exact maturity date (`YYYY-MM-DD`). |
| `from_maturity_date` | string | — | — | Filter maturities `>=` value (`YYYY-MM-DD`). |
| `to_maturity_date` | string | — | — | Filter maturities `<=` value (`YYYY-MM-DD`). |

## Response

STATUS 200

```json title="Response Body"
{
    "data": [
        {
            "operation_key": "e96ff035-e0bc-4819-931a-6a9f7fc1c597",
            "external_id": "a3f1c2e4-7b8d-4e6f-9a0b-1c2d3e4f5a6b",
            "fund_class": {
                "fund_class_key": "9b6145dc-2207-428d-84c1-2f949461891a",
                "manager_key": "73a21e11-0ab7-461d-a93f-1e90c0a5dc0d",
                "name": "FUNDO DE INVESTIMENTO TESTE",
                "document_number": "41.202.838/0001-45",
                "accounting_date": "2025-04-14",
                "custodian": {
                    "name": "QI DISTRIBUIDORA DE TITULOS E VALORES MOBILIARIOS LTDA",
                    "document_number": "46.955.383/0001-52",
                    "iselic_number": "46955383"
                },
                "selic_account_number": "000216832",
                "target_account_key": "d3dcbf3c-1bbf-495b-b792-ac448ee20ac4"
            },
            "status": "pending_manager_approval",
            "operation_part": "assignee",
            "operation_type": {
                "enumerator": "outright_operation",
                "code": 1052
            },
            "treasury": {
                "enumerator": "ntn_b",
                "code": 760199
            },
            "operation_date": "2025-04-14",
            "payment_date": "2025-04-14",
            "maturity_date": "2025-05-15",
            "total_operation_value": 250.0,
            "units": 5,
            "unit_price": 50.0,
            "counterparty": {
                "iselic_number": "20824264",
                "document_number": "20.824.264/0001-77",
                "selic_account_number": "123456789"
            },
            "isin_code": "BRSTNCNTB633",
            "issue_date": "2000-07-15",
            "operation_data": {}
        }
    ],
    "limit": 100,
    "page": 0,
    "is_last_page": true
}
```

### Response attributes

| Field | Type | Description |
| :---- | :---- | :---- |
| `data` | array | List of operations. Each item contains the same fields as the individual retrieval response. |
| `limit` | integer | Number of items returned on the page. |
| `page` | integer | Current page (0-indexed). |
| `is_last_page` | boolean | Whether this is the last page of results. |

---

# Introduction

URL: /en/documentation/iaas/boletos/inicio

In this section we will explain how the **billing slip issuance** ecosystem works in the context of a **receivables assignment to Investment Funds**.

## Billing Slip Issuance Structure

The billing slip issuance process within receivables assignment follows the following structure:

1. **Collection account registration and assignment contract generation**  
   - [5.2.4. Assignment Contract](/documentation/iaas/homologacao_cedente/contrato_de_cessao/pedido_de_contrato)

2. **Billing Slip Registration**  
   - The billing slip is registered with the issuing bank as soon as the assignment is paid.  
   - Required information:  
     - Assignor identification  
     - Drawee (payer) identification  
     - Nominal value  
     - Due date  

3. **Registration Confirmation**  
   - The billing slip registration confirmation is done on the next business day in the bank return processing

4. **Settlement**  
   - When the billing slip is paid by the drawee, the settlement is captured and updated automatically.  
   - The financial flow goes to the Fund's main account, composing the available cash.

5. **Write-off**  
   - If the bill payment is made through an assignor write-off or substitution, the billing slip is written off automatically

:::warning
For billing slip issuance to occur **automatically**, it is mandatory that the **Assignment Contract** contains all necessary collection information and that there is a **collection account properly registered** in the system.  
:::

To have access to these services, contact the team at [integracao.dtvm@qitech.com.br](mailto:integracao.dtvm@qitech.com.br), so that the appropriate permissions can be made, both in the Homologation (Sandbox) environment and in the production environment.

---

# Instruções de Boleto

URL: /en/documentation/iaas/boletos/instrucoes_boleto

Este endpoint permite enviar instruções a um boleto já registrado, como prorrogação de vencimento, atualização de juros e multa, inclusão de descontos, abatimento, baixa e solicitação de protesto.

## Request

ENDPOINT /bankslip_collection/fund_class/ FUND_CLASS_KEY /bankslip_configuration/ BANKSLIP_CONFIGURATION_KEY /bankslip/ BANKSLIP_KEY
MÉTODO PUT

### Path Parameters

| Campo                          | Tipo   | Descrição                                                              | Caracteres |
|--------------------------------|--------|------------------------------------------------------------------------|------------|
| `fund_class_key`               | uuidv4 | Chave única de identificação da classe de fundo, no formato uuid v4    | 36         |
| `bankslip_configuration_key`   | uuidv4 | Chave única de identificação da configuração do boleto, no formato uuid v4 | 36     |
| `bankslip_key`                 | uuidv4 | Chave única de identificação do boleto, no formato uuid v4             | 36         |

### Request Body Params

O campo `occurrence_type` define qual instrução será enviada ao boleto. O campo `occurrence_data` contém os dados específicos da instrução, quando aplicável.

| Campo             | Tipo   | Descrição                                                                 | Caracteres                                                              |
|-------------------|--------|---------------------------------------------------------------------------|-------------------------------------------------------------------------|
| `occurrence_type` | string | Tipo da instrução a ser enviada ao boleto.                                | **[Enumerador occurrence_type](#enumeradores-occurrence_type)**          |
| `occurrence_data` | object | Dados da instrução. Obrigatório para os tipos que exigem parâmetros adicionais. | Varia conforme o `occurrence_type`                                |

### Enumeradores occurrence_type

| Enumerador             | Descrição                                           |
|------------------------|-----------------------------------------------------|
| `due_date_extension`   | Prorrogação da data de vencimento                   |
| `delay_interest_update`| Atualização dos juros de mora                       |
| `delay_fine_update`    | Atualização da multa por atraso                     |
| `rebate`               | Aplicação de abatimento                             |
| `rebate_withdrawn`     | Cancelamento do abatimento                          |
| `discount_inclusion`   | Inclusão de descontos                               |
| `write_off`            | Baixa do boleto                                     |
| `protest_request`      | Solicitação de protesto                             |

---

### Instrução: `due_date_extension` — Prorrogação de Vencimento

Request Body

```json
{
  "occurrence_type": "due_date_extension",
  "occurrence_data": {
    "due_date": "2026-12-31"
  }
}
```

#### Objeto occurrence_data — due_date_extension

| Campo      | Tipo   | Descrição                                         | Caracteres |
|------------|--------|---------------------------------------------------|------------|
| `due_date` | string | Nova data de vencimento do boleto (formato `YYYY-MM-DD`) | 10  |

---

### Instrução: `delay_interest_update` — Atualização de Juros de Mora

Request Body

```json
{
  "occurrence_type": "delay_interest_update",
  "occurrence_data": {
    "interest": {
      "method": "pre_fixed",
      "pre_fixed": {
        "monthly_rate": 1.5,
        "calendar_base": "calendar_360"
      }
    }
  }
}
```

#### Objeto occurrence_data — delay_interest_update

| Campo      | Tipo   | Descrição                             |
|------------|--------|---------------------------------------|
| `interest` | object | Configuração dos juros de mora (ver abaixo). |

#### Objeto interest

| Campo        | Tipo   | Descrição                                                     |
|--------------|--------|---------------------------------------------------------------|
| `method`     | string | Método de cálculo dos juros. Valor: `pre_fixed`               |
| `pre_fixed`  | object | Parâmetros para o cálculo de juros pré-fixados (ver abaixo).  |

#### Objeto pre_fixed

| Campo           | Tipo   | Descrição                                                                                    |
|-----------------|--------|----------------------------------------------------------------------------------------------|
| `monthly_rate`  | number | Taxa mensal de juros (0.01 Equivale a 1% ao mes).             |
| `calendar_base` | string | Base de calendário para cálculo. **[Enumerador calendar_base](#enumeradores-calendar_base)** |

#### Enumeradores calendar_base

| Enumerador      | Descrição              |
|-----------------|------------------------|
| `calendar_360`  | Base de 360 dias       |
| `workdays`      | Dias úteis             |
| `calendar_365`  | Base de 365 dias       |

---

### Instrução: `delay_fine_update` — Atualização de Multa por Atraso

Request Body

```json
{
  "occurrence_type": "delay_fine_update",
  "occurrence_data": {
    "fine": {
      "fine_type": "percentage",
      "percentage_value": 2.0
    }
  }
}
```

#### Objeto occurrence_data — delay_fine_update

| Campo  | Tipo   | Descrição                              |
|--------|--------|----------------------------------------|
| `fine` | object | Configuração da multa por atraso (ver abaixo). |

#### Objeto fine

| Campo              | Tipo   | Descrição                                                        |
|--------------------|--------|------------------------------------------------------------------|
| `fine_type`        | string | Tipo da multa. Valor: `percentage`                               |
| `percentage_value` | number | Percentual da multa. Deve ser maior ou igual a `0`.              |

---

### Instrução: `rebate` — Abatimento

Request Body

```json
{
  "occurrence_type": "rebate",
  "occurrence_data": {
    "rebate": 50.00
  }
}
```

#### Objeto occurrence_data — rebate

| Campo    | Tipo   | Descrição                          |
|----------|--------|------------------------------------|
| `rebate` | number | Valor do abatimento a ser aplicado. |

---

### Instrução: `rebate_withdrawn` — Cancelamento de Abatimento

Esta instrução não requer `occurrence_data`.

Request Body

```json
{
  "occurrence_type": "rebate_withdrawn"
}
```

---

### Instrução: `discount_inclusion` — Inclusão de Descontos

Request Body

```json
{
  "occurrence_type": "discount_inclusion",
  "occurrence_data": {
    "discounts": [
      {
        "discount_type": "percentage",
        "discount_number": 1,
        "discount_limit_date": "2026-11-30",
        "discount_amount": 5.0
      }
    ]
  }
}
```

#### Objeto occurrence_data — discount_inclusion

| Campo       | Tipo        | Descrição                                          |
|-------------|-------------|----------------------------------------------------|
| `discounts` | array       | Lista de descontos a serem aplicados (ver abaixo). |

#### Objeto discount (item do array discounts)

| Campo                 | Tipo   | Descrição                                                                                    | Caracteres |
|-----------------------|--------|----------------------------------------------------------------------------------------------|------------|
| `discount_type`       | string | Tipo do desconto. **[Enumerador discount_type](#enumeradores-discount_type)**               | -          |
| `discount_number`     | number | Número sequencial do desconto.                                                               | -          |
| `discount_limit_date` | string | Data limite para aplicação do desconto (formato `YYYY-MM-DD`).                               | 10         |
| `discount_amount`     | number | Valor do desconto.                                                                           | -          |

#### Enumeradores discount_type

| Enumerador                                    | Descrição                                                                  |
|-----------------------------------------------|----------------------------------------------------------------------------|
| `absolute`                                    | Valor fixo                                                                 |
| `percentage`                                  | Porcentagem fixa                                                           |
| `anticipation_workdays_daily_amount`          | Valor diário de antecipação sobre dias úteis                               |
| `anticipation_workdays_daily_percentage`      | Porcentagem diária de antecipação sobre dias úteis                         |
| `anticipation_calendar_days_daily_amount`     | Valor diário de antecipação sobre dias corridos                            |
| `anticipation_calendar_days_daily_percentage` | Porcentagem diária de antecipação sobre dias corridos                      |

---

### Instrução: `write_off` — Baixa do Boleto

Esta instrução não requer `occurrence_data`.

Request Body

```json
{
  "occurrence_type": "write_off"
}
```

---

### Instrução: `protest_request` — Solicitação de Protesto

Request Body

```json
{
  "occurrence_type": "protest_request",
  "occurrence_data": {
    "protest_type": "protest"
  }
}
```

#### Objeto occurrence_data — protest_request

| Campo          | Tipo   | Descrição                                                                              |
|----------------|--------|----------------------------------------------------------------------------------------|
| `protest_type` | string | Tipo do protesto. **[Enumerador protest_type](#enumeradores-protest_type)**             |

#### Enumeradores protest_type

| Enumerador           | Descrição                    |
|----------------------|------------------------------|
| `protest`            | Protesto padrão              |
| `bankruptcy_protest` | Protesto por falência         |

---

## Response

STATUS 201

Response Body

```json title='Response Body'
{
  "bankslip_key": "c9eb109c-800f-4cf5-b209-2119c9d77a72",
  "external_participant_control_number": "801KFZFNB4UZ34MLGJG2X9WNG",
  "bankslip_configuration": {
    "bankslip_configuration_key": "1b382eb7-7006-4389-975b-afa76b0ad7b4",
    "bankslip_profile": {
      "bankslip_profile_key": "5910d4a3-f5df-432a-902f-849a1a77cd86",
      "bankslip_profile_code": "329-09-0001-4993010",
      "bankslip_profile_number": 1,
      "bankslip_provider": "qi_scd",
      "additional_information": {
        "external_beneficiary_key": "2666e7a3-0bd7-46fc-8f6b-725f2ef9b13f"
      },
      "internal_account_key": "6b5335ed-1380-4348-9520-8998ca6e388b",
      "fund_class": {
        "fund_class_key": "7f03069e-1854-4cee-8e59-a6a548976015",
        "document_number": "51.620.927/0001-65",
        "name": "Sample Fund Class",
        "manager": {
          "name": "Sample Manager",
          "manager_key": "5cb734e9-c33b-4e7e-bb40-f894aa82b153",
          "document_number": "51.620.927/0001-65"
        }
      }
    }
  },
  "due_date": "2026-12-31",
  "face_value": 629.33,
  "status": "registered",
  "participant_control_number": "801KFZFNB4UZ34MLGJG2X9WNG",
  "borrower": {
    "document_number": "755.510.684-12",
    "name": "Tomador Exemplo",
    "person_type": "natural_person",
    "address": {
      "postal_code": "05425-020"
    }
  },
  "assignor": {
    "name": "Cedente LTDA",
    "document_number": "37.341.966/0001-00",
    "person_type": "legal_person"
  },
  "bankslip_type": "simple",
  "delay": null,
  "our_number": "00000012345",
  "our_number_digit": "6",
  "digitable_line": "32991.23456 78901.234567 89012.345678 9 00010000062933",
  "barcode": "32999000010000062933123456789012345678901234",
  "occurrences": [
    {
      "occurrence_key": "e9898e50-cd2b-492f-9201-7e5c5f231853",
      "status": "pending_submission",
      "type": "due_date_extension",
      "occurrence_data": {
        "due_date": "2026-12-31"
      }
    }
  ],
  "settlement_instructions": [
    {
      "settlement_instruction_key": "fe419363-bf04-4b3a-90bd-185618baa720",
      "status": "pending_bankslip_payment",
      "asset_type": "duplicata_mercantil",
      "asset_key": "22fc5c95-3622-48ad-b26a-99f8d0499e69",
      "external_id": "758638e4-6fe6-4b69-8799-30728ca16a22",
      "issue_date": "2025-01-17",
      "maturity_date": "2026-12-31",
      "face_value": 629.33,
      "order_number": "49761-1"
    }
  ]
}
```

### Bankslip

| Campo                                 | Tipo   | Descrição                                                              |
|---------------------------------------|--------|------------------------------------------------------------------------|
| `bankslip_key`                        | string | Identificador único do boleto.                                         |
| `external_participant_control_number` | string | Número de controle externo do participante.                            |
| `bankslip_configuration`              | object | Configuração do boleto (ver abaixo).                                   |
| `due_date`                            | date   | Data de vencimento do boleto.                                          |
| `face_value`                          | number | Valor nominal do boleto.                                               |
| `status`                              | string | Status atual do boleto.                                                |
| `participant_control_number`          | string | Número de controle interno do participante.                            |
| `borrower`                            | object | Objeto que representa o tomador (sacado).                              |
| `assignor`                            | object | Objeto que representa o cedente do recebível.                          |
| `bankslip_type`                       | string | Tipo do boleto.                                                        |
| `delay`                               | object | Dados de mora do boleto, quando aplicável.                             |
| `order_number`                        | string | Número do pedido, quando disponível.                                   |
| `our_number`                          | string | Nosso número, quando disponível.                                       |
| `our_number_digit`                    | string | Dígito verificador do nosso número, quando disponível.                 |
| `digitable_line`                      | string | Linha digitável do boleto, quando disponível.                          |
| `barcode`                             | string | Código de barras do boleto, quando disponível.                         |
| `occurrences`                         | array  | Lista de ocorrências relacionadas ao boleto (cada item é um objeto).   |
| `settlement_instructions`             | array  | Lista de instruções de liquidação relacionadas ao boleto.              |

### Bankslip Configuration

| Campo                        | Tipo   | Descrição                        |
|------------------------------|--------|----------------------------------|
| `bankslip_configuration_key` | string | Chave de configuração do boleto. |
| `bankslip_profile`           | object | Perfil de boleto associado.      |

### Bankslip Profile

| Campo                      | Tipo   | Descrição                                                    |
|----------------------------|--------|--------------------------------------------------------------|
| `bankslip_profile_key`     | string | Identificador do perfil de boleto.                           |
| `bankslip_profile_code`    | string | Código do perfil.                                            |
| `bankslip_profile_number`  | number | Número do perfil.                                            |
| `bankslip_provider`        | string | Provedor do boleto.                                          |
| `additional_information`   | object | Informações adicionais do perfil.                            |
| `internal_account_key`     | string | Identificador da conta interna associada.                    |
| `fund_class`               | object | Objeto representando a classe de fundo (ver abaixo).         |

### Fund Class

| Campo             | Tipo   | Descrição                                       | Caracteres |
|-------------------|--------|-------------------------------------------------|------------|
| `fund_class_key`  | string | Chave única de identificação da classe de fundo | 36         |
| `document_number` | string | CNPJ da classe de fundo                         | -          |
| `name`            | string | Nome da classe de fundo                         | até 255    |

### Borrower

| Campo             | Tipo   | Descrição                      |
|-------------------|--------|--------------------------------|
| `name`            | string | Nome do tomador.               |
| `document_number` | string | Documento (CPF/CNPJ).          |
| `person_type`     | string | Tipo de pessoa.                |
| `address`         | object | Endereço do tomador.           |

### Assignor

| Campo             | Tipo   | Descrição             |
|-------------------|--------|-----------------------|
| `name`            | string | Nome do cedente.      |
| `document_number` | string | Documento (CNPJ).     |
| `person_type`     | string | Tipo de pessoa.       |

### Occurrences

Cada item do array é um objeto com os seguintes campos:

| Campo             | Tipo   | Descrição                       |
|-------------------|--------|---------------------------------|
| `occurrence_key`  | string | Identificador da ocorrência.    |
| `status`          | string | Status da ocorrência.           |
| `type`            | string | Tipo da ocorrência.             |
| `occurrence_data` | object | Dados adicionais da ocorrência. |

### Settlement Instructions

Cada item do array é um objeto com os seguintes campos:

| Campo                        | Tipo   | Descrição                                            |
|------------------------------|--------|------------------------------------------------------|
| `settlement_instruction_key` | string | Identificador da instrução de liquidação.            |
| `status`                     | string | Status da instrução de liquidação.                   |
| `asset_type`                 | string | Tipo do ativo.                                       |
| `asset_key`                  | string | Chave única do ativo no sistema.                     |
| `external_id`                | string | Identificador externo do cliente.                    |
| `issue_date`                 | date   | Data de emissão.                                     |
| `maturity_date`              | date   | Data de vencimento.                                  |
| `face_value`                 | number | Valor de face do ativo.                              |
| `order_number`               | string | Número do contrato.                                  |

---

## Error Response

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| Código HTTP<br/>`status` | Código QI<br/>`code` | Título<br/>`title`    | Descrição (eng)<br/>`description`                            | Descrição (pt-br)<br/>`translation`                              |
|--------------------------|----------------------|-----------------------|--------------------------------------------------------------|------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request           | Schema Error                                                 | Schema Inválido                                                  |
| 404                      | BSC000009            | Bankslip not Found    | Bankslip with key `{bankslip_key}` was not found.            | Boleto com chave `{bankslip_key}` não foi encontrado.            |

---

# CNAB Files Retrieval

URL: /en/documentation/iaas/boletos/recuperar_arquivo_retorno

---

## List CNAB files

Returns a paginated list of CNAB files (remittance and return files exchanged with the bank) belonging to a bankslip profile of a fund class.

### Request

ENDPOINT /bankslip_collection/fund_class/FUND_CLASS_KEY/bankslip_profile/BANKSLIP_PROFILE_KEY/cnab_files
METHOD GET

### Path Params

| Parameter              | Description                                                                                                              |
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
| `fund_class_key`       | Key of the fund class. Returns `404` (`NotFoundFundClass`) if it doesn't exist.                                             |
| `bankslip_profile_key` | Key of the bankslip profile, which must belong to the fund class. Returns `404` (`NotFoundBankslipConfiguration`) if not found. |

### Query Params

All parameters are optional.

| Parameter      | Type   | Description                                                                   |
|----------------|--------|--------------------------------------------------------------------------------|
| `initial_date` | date   | Filters files with `cnab_date` greater than or equal to the given date (YYYY-MM-DD). |
| `final_date`   | date   | Filters files with `cnab_date` less than or equal to the given date (YYYY-MM-DD).    |
| `cnab_type`    | string | Filters by file type (see **[CNAB Type](#cnab-type)**).                        |
| `limit`        | int    | Value between 0 and 20 with the number of items per page. Default: `10`.       |
| `page`         | int    | Zero-based page number. Default: `0`.                                          |

When `is_last_page` is `false`, request the next `page` to retrieve the remaining results.

### Response

Response Body

```json title='Response Body'
{
    "data": [
        {
            "cnab_file_key": "79f21d3e-ed99-413c-8e05-39cf84fbab7c",
            "bankslip_profile": {
                "bankslip_profile_key": "a1d7f09b-cb77-48da-a23d-b83d97d4b46b",
                "bankslip_profile_code": "329-09-0001-0000000",
                "bankslip_profile_number": 9,
                "bankslip_provider": "qi_scd",
                "additional_information": {
                    "requester_profile_key": "30f72181-042c-4aae-9be7-b2794916416f"
                },
                "internal_account_key": "18809219-17d9-4845-a830-51e7f2beaf28",
                "fund_class": {
                    "fund_class_key": "92c63a0f-25d6-45cb-90a2-6026c0ce2ef9",
                    "document_number": "00.000.000/0001-01",
                    "name": "FUNDO DE INVESTIMENTO EM DIREITOS CREDITÓRIOS",
                    "manager": {
                        "name": "GESTÃO DE RECURSOS",
                        "manager_key": "7a5ff2f5-f127-451c-98d8-001826c35c3c",
                        "document_number": "00.100.100/0001-00"
                    }
                }
            },
            "cnab_date": "2025-07-30",
            "type": "return",
            "status": "completed",
            "download_filename": "cnab-retorno-2025-07-30-79f21d3e.ret",
            "url": "https://s3.amazonaws.com/...",
            "external_cnab_file_key": "e8b5e962-eb5f-4b9d-8d2b-70cd6d3d5252",
            "number_of_occurrences": 6
        },
        {
            "cnab_file_key": "ff7aaa47-a901-4f66-98d7-46f76ca4fa16",
            "bankslip_profile": {
                "bankslip_profile_key": "e0771a02-4f3e-4162-a468-a872fc6975e4",
                "bankslip_profile_code": "329-09-0001-0000000",
                "bankslip_profile_number": 9,
                "bankslip_provider": "qi_scd",
                "additional_information": {
                    "requester_profile_key": "cdec985f-e629-44ce-8511-a323f38bd63e"
                },
                "internal_account_key": "5e621ba2-b4ac-4ddd-9893-82d220e1577e",
                "fund_class": {
                    "fund_class_key": "92c63a0f-25d6-45cb-90a2-6026c0ce2ef9",
                    "document_number": "00.000.000/0001-01",
                    "name": "FUNDO DE INVESTIMENTO EM DIREITOS CREDITÓRIOS",
                    "manager": {
                        "name": "GESTÃO DE RECURSOS",
                        "manager_key": "7a5ff2f5-f127-451c-98d8-001826c35c3c",
                        "document_number": "00.100.100/0001-00"
                    }
                }
            },
            "cnab_date": "2025-07-30",
            "type": "external_return",
            "status": "completed",
            "download_filename": "cnab-retorno-2025-07-30-ff7aaa47.ret",
            "url": "https://s3.amazonaws.com/...",
            "external_cnab_file_key": "d3b1f7c4-9e2a-4f6b-8c1d-5a7e9b3f2c8e",
            "number_of_occurrences": 3,
            "bankslip_expenses": [
                {
                    "bankslip_expense_key": "4d727b05-00df-454e-93e3-160ec9ee596c",
                    "type": "fee_or_costs.payment",
                    "number_of_expenses": 3,
                    "total_value": 2.25,
                    "status": "completed"
                }
            ]
        }
    ],
    "limit": 10,
    "page": 0,
    "is_last_page": true
}
```

### Paginated Object

| Field          | Type    | Description                                          |
|----------------|---------|------------------------------------------------------|
| `data`         | array   | List of **[CNAB File](#cnab-file)** objects          |
| `limit`        | int     | Limit of objects retrieved per page                  |
| `page`         | int     | Number of the retrieved page                         |
| `is_last_page` | boolean | Indicates whether the retrieved page is the last one |

### CNAB File

| Field                    | Type   | Description                                                                                                      |
|--------------------------|--------|--------------------------------------------------------------------------------------------------------------------|
| `cnab_file_key`          | string | Unique identifier of the CNAB file.                                                                                  |
| `bankslip_profile`       | object | Associated bankslip profile (see **[Bankslip Profile](/documentation/iaas/boletos/recuperar_boletos#bankslip-profile)**).                      |
| `cnab_date`              | date   | Date of the CNAB file.                                                                                                |
| `type`                   | string | File type (see **[CNAB Type](#cnab-type)**).                                                                          |
| `status`                 | string | File status (see **[CNAB Status](#cnab-status)**).                                                                    |
| `download_filename`      | string | Name the file is downloaded with.                                                                                     |
| `url`                    | string | Pre-signed URL to download the file, valid for **1 hour**. Omitted if it cannot be generated.                         |
| `external_cnab_file_key` | string | Identifier of the external CNAB file. Only present when the file has this value.                                      |
| `header`                 | string | File header. Only present when the file has this value.                                                               |
| `trailer`                | string | File trailer. Only present when the file has this value.                                                              |
| `number_of_occurrences`  | int    | Number of occurrences in the file. Only present when the file has this value.                                         |
| `expectation`            | object | Expectation data of the file. Only present when the file has this value.                                              |
| `bankslip_expenses`      | array  | List of **[Bankslip Expense](#bankslip-expense)** objects. Only present when the file has associated expenses.        |

### Bankslip Expense

| Field                  | Type   | Description                      |
|------------------------|--------|----------------------------------|
| `bankslip_expense_key` | string | Unique identifier of the expense.|
| `type`                 | string | Expense type.                    |
| `number_of_expenses`   | int    | Number of grouped expenses.      |
| `total_value`          | number | Total value of the expenses.     |
| `status`               | string | Expense status.                  |

## CNAB Type

| Enumerator            | Description          |
|-----------------------|----------------------|
| `return`              | Return File          |
| `external_return`     | External Return File |
| `remittance`          | Remittance           |
| `external_remittance` | External Remittance  |

## CNAB Status

| Enumerator           | Description        |
|----------------------|--------------------|
| `created`            | Created            |
| `pending_processing` | Pending processing |
| `completed`          | Completed          |
| `canceled`           | Canceled           |

---

# Recuperação de Boleto e Segunda via

URL: /en/documentation/iaas/boletos/recuperar_boleto

---

## Lista de Boletos

### Request

ENDPOINT /bankslip_collection/fund_class/FUND_CLASS_KEY/bankslip_profile/BANKSLIP_PROFILE_KEY/bankslip/BANKSLIP_KEY
MÉTODO GET

### Response 
Response Body

```json title='Response Body'
{
        
    "bankslip_key": "c9eb109c-800f-4cf5-b209-2119c9d77a72",
    "external_participant_control_number": "801KFZFNB4UZ34MLGJG2X9WNG",
    "asset_type": "duplicata_mercantil",
    "bankslip_configuration": {
        "bankslip_configuration_key": "1b382eb7-7006-4389-975b-afa76b0ad7b4",
        "bankslip_profile": {
            "bankslip_profile_key": "5910d4a3-f5df-432a-902f-849a1a77cd86",
            "bankslip_profile_code": "329-09-0001-4993010",
            "bankslip_profile_number": 1,
            "bankslip_provider": "qi_scd",
            "additional_information": {
                "external_beneficiary_key": "2666e7a3-0bd7-46fc-8f6b-725f2ef9b13f"
            },
            "internal_account_key": "6b5335ed-1380-4348-9520-8998ca6e388b",
            "fund_class": {
                "fund_class_key": "7f03069e-1854-4cee-8e59-a6a548976015",
                "document_number": "51.620.927/0001-65",
                "name": "Sample_Name",
                "manager": {
                    "name": "Sample name",
                    "manager_key": "5cb734e9-c33b-4e7e-bb40-f894aa82b153",
                    "document_number": "51.620.927/0001-65"
                }
            }
        }
    },
    "due_date": "2026-04-21",
    "face_value": 629.33,
    "status": "pending_registration",
    "participant_control_number": "801KFZFNB4UZ34MLGJG2X9WNG",
    "borrower": {
        "document_number": "755.510.684-12",
        "name": "Tomador",
        "person_type": "legal_person",
        "address": {
            "postal_code": "05425-020"
        }
    },
    "assignor": {
        "name": "Assignor LTDA",
        "document_number": "37.341.966/0001-00",
        "person_type": "legal_person"
    },
    "occurrences": [
        {
            "occurrence_key": "e9898e50-cd2b-492f-9201-7e5c5f231853",
            "status": "pending_submission",
            "type": "registration",
            "occurrence_data": null
        }
    ],
    "settlement_instructions": [
        {
            "settlement_instruction_key": "fe419363-bf04-4b3a-90bd-185618baa720",
            "status": "pending_bankslip_payment",
            "asset_type": "duplicata_mercantil",
            "asset_key": "22fc5c95-3622-48ad-b26a-99f8d0499e69",
            "external_id": "758638e4-6fe6-4b69-8799-30728ca16a22",
            "issue_date": "2025-01-17",
            "maturity_date": "2026-09-17",
            "face_value": 629.33,
            "order_number": "49761-1"
        }
    ],
    "bankslip_url": "https://bankslip-proxys-bucket-production.s3.amazonaws.com/"

        
}
```

### Bankslip

| Campo                                 | Tipo     | Descrição                                                            |
|---------------------------------------|----------|----------------------------------------------------------------------|
| `bankslip_key`                        | string   | Identificador único do boleto.                                       |
| `external_participant_control_number` | string   | Número de controle externo do participante.                          |
| `asset_type`                          | string   | Tipo de ativo atrelado.                                              |
| `due_date`                            | date     | Data de vencimento do boleto.                                        |
| `face_value`                          | number   | Valor nominal do boleto.                                             |
| `status`                              | string   | Status atual do boleto.                                              |
| `participant_control_number`          | string   | Número de controle interno do participante.                          |
| `bankslip_configuration`              | object   | Objeto que contém a configuração do boleto (ver abaixo).             |
| `borrower`                            | object   | Objeto que representa o tomador (sacado).                            |
| `assignor`                            | object   | Objeto que representa o cedente do recebível.                        |
| `occurrences`                         | array    | Lista de ocorrências relacionadas ao boleto (cada item é um objeto). |
| `settlement_instructions`             | array    | Lista de instruções de liquidação relacionadas ao boleto.            |
| `bankslip_url`                        | array    | Link para recuperação de segunda via.                                |

### Bankslip Configuration

| Campo                                | Tipo     | Descrição                        |
|--------------------------------------|----------|----------------------------------|
| `bankslip_configuration_key`         | string   | Chave de configuração do boleto. |
| `bankslip_profile`                   | object   | Perfil de boleto associado.      |

---

### Bankslip Profile

| Campo                                | Tipo     | Descrição |
|--------------------------------------|----------|-------------------------------|
| `bankslip_profile_key`               | string   | Identificador do perfil de boleto. |
| `bankslip_profile_code`              | string   | Código do perfil. |
| `bankslip_profile_number`            | number   | Número do perfil. |
| `bankslip_provider`                  | string   | Provedor do boleto. |
| `additional_information`             | object   | Informações adicionais (ver abaixo). |
| `internal_account_key`               | string   | Identificador da conta interna associada. |
| `fund_class`                         | object   | Objeto representando o fundo de investimento (ver abaixo). |

### Fund Class

| Campo                         | Tipo     | Descrição                                         | Caracteres |
|-------------------------------|----------|---------------------------------------------------|------------|
| `name`                        | string   | Nome da classe de fundo                           | até 255    |
| `fund_class_key`              | string   | Chave única de identificação da classe de fundo   | 36         |
| `document_number`             | string   | CNPJ da classe de fundo                           | -          |

### Borrower 

| Campo                                | Tipo     | Descrição                     |
|--------------------------------------|----------|-------------------------------|
|  `name`                              | string   | Nome do tomador. |
|  `document_number`                   | string   | Documento (CPF/CNPJ). |
|  `person_type`                       | string   | Tipo de pessoa. |
|  `address`                           | object   | Endereço do tomador (ver abaixo). |

### Address

| Campo                                | Tipo     | Descrição                     |
|--------------------------------------|----------|-------------------------------|
| `street`                             | string   | Logradouro do endereço. |
| `number`                             | string   | Número do endereço. |
| `neighborhood`                       | string   | Bairro. |
| `city`                               | string   | Cidade. |
| `postal_code`                        | string   | CEP. |
| `uf`                                 | string   | Unidade federativa (sigla do estado). |
| `country`                            | string   | País no formato ISO Alpha-3. |

---

## Assignor (Cedente)

| Campo                                | Tipo     | Descrição         |
|--------------------------------------|----------|-------------------|
| `name`                               | string   | Nome do cedente.  |
| `document_number`                    | string   | Documento (CNPJ). |
| `person_type`                        | string   | Tipo de pessoa.   |

---

## Occurrences

Cada item do array é um objeto com os seguintes campos:

| Campo                                | Tipo     | Descrição                       |
|--------------------------------------|----------|---------------------------------|
| `occurrence_key`                     | string   | Identificador da ocorrência.    |
| `status`                             | string   | Status da ocorrência.           |
| `type`                               | string   | Tipo da ocorrência.             |
| `occurrence_data`                    | object   | Dados adicionais da ocorrência. |

## Settlement Instructions

Cada item do array é um objeto com os seguintes campos:

| Campo                         | Tipo     | Descrição                                            |
|-------------------------------|----------|------------------------------------------------------|
| `settlement_instruction_key`  | string   | Identificador da instrução de liquidação.            |
| `status`                      | string   | Status da instrução de liquidação.                   |
| `asset_type`                  | string   | Tipo do ativo.                                       |
| `asset_key`                   | string   | Chave única do ativo no sistema.                     |
| `external_id`                 | string   | Identifica externo do cliente (utilizado na cessão). |
| `issue_date`                  | date     | Data de emissão.                                     |
| `maturity_date`               | date     | Data de vencimento.                                  |
| `face_value`                  | number   | Valor de face do ativo.                              |
| `order_number`                | string   | Número do contrato.                                  |
| `installment_number`          | number   | Número da parcela do ativo.                          |

---

# Bankslip Retrieval

URL: /en/documentation/iaas/boletos/recuperar_boletos

---

## Bankslip List

### Request

ENDPOINT /bankslip_collection/fund_class/FUND_CLASS_KEY/bankslip_profile/BANKSLIP_PROFILE_KEY/bankslips
MÉTODO GET

### Query Params
| Parameter                    | Description                                                |
|------------------------------|------------------------------------------------------------|
| `limit`                      | Value between 0 and 100 with the number of items per page. |
| `page`                       | Page number (starting from zero).                          |
| `borrower_document_number`   | Borrower document number (numbers only).                   |
| `assignor_document_number`   | Assignor document number (numbers only).                   |
| `participant_control_number` | Participant control number.                                 |
| `order_number`               | Contract number.                                           |
| `our_number`                 | Our bankslip number at the bank.                          |

### Response 
Response Body

```json title='Response Body'
{
    "data": [
        {
            "bankslip_key": "c9eb109c-800f-4cf5-b209-2119c9d77a72",
            "external_participant_control_number": "801KFZFNB4UZ34MLGJG2X9WNG",
            "asset_type": "duplicata_mercantil",
            "bankslip_configuration": {
                "bankslip_configuration_key": "1b382eb7-7006-4389-975b-afa76b0ad7b4",
                "bankslip_profile": {
                    "bankslip_profile_key": "5910d4a3-f5df-432a-902f-849a1a77cd86",
                    "bankslip_profile_code": "329-09-0001-4993010",
                    "bankslip_profile_number": 1,
                    "bankslip_provider": "qi_scd",
                    "additional_information": {
                        "external_beneficiary_key": "2666e7a3-0bd7-46fc-8f6b-725f2ef9b13f"
                    },
                    "internal_account_key": "6b5335ed-1380-4348-9520-8998ca6e388b",
                    "fund_class": {
                        "fund_class_key": "7f03069e-1854-4cee-8e59-a6a548976015",
                        "document_number": "51.620.927/0001-65",
                        "name": "Sample_Name",
                        "manager": {
                            "name": "Sample name",
                            "manager_key": "5cb734e9-c33b-4e7e-bb40-f894aa82b153",
                            "document_number": "51.620.927/0001-65"
                        }
                    }
                }
            },
            "due_date": "2024-02-17",
            "face_value": 629.33,
            "status": "pending_registration",
            "participant_control_number": "801KFZFNB4UZ34MLGJG2X9WNG",
            "borrower": {
                "document_number": "755.510.684-12",
                "name": "Tomador",
                "person_type": "legal_person",
                "address": {
                    "postal_code": "05425-020"
                }
            },
            "assignor": {
                "name": "Assignor LTDA",
                "document_number": "37.341.966/0001-00",
                "person_type": "legal_person"
            },
            "occurrences": [
                {
                    "occurrence_key": "e9898e50-cd2b-492f-9201-7e5c5f231853",
                    "status": "pending_submission",
                    "type": "registration",
                    "occurrence_data": null
                }
            ]
        },
        {
            "bankslip_key": "4584e60c-752f-479d-831a-50f09c2c7de2",
            "external_participant_control_number": "TBFBDWKTEWJ7UTR6CPL4BAE4P",
            "asset_type": "duplicata_mercantil",
            "bankslip_configuration": {
                "bankslip_configuration_key": "1b382eb7-7006-4389-975b-afa76b0ad7b4",
                "bankslip_profile": {
                    "bankslip_profile_key": "5910d4a3-f5df-432a-902f-849a1a77cd86",
                    "bankslip_profile_code": "329-09-0001-4993010",
                    "bankslip_profile_number": 1,
                    "bankslip_provider": "qi_scd",
                    "additional_information": {
                        "external_beneficiary_key": "2666e7a3-0bd7-46fc-8f6b-725f2ef9b13f"
                    },
                    "internal_account_key": "6b5335ed-1380-4348-9520-8998ca6e388b",
                    "fund_class": {
                        "fund_class_key": "7f03069e-1854-4cee-8e59-a6a548976015",
                        "document_number": "51.620.927/0001-65",
                        "name": "Sample_Name",
                        "manager": {
                            "name": "Sample name",
                            "manager_key": "5cb734e9-c33b-4e7e-bb40-f894aa82b153",
                            "document_number": "51.620.927/0001-65"
                        }
                    }
                }
            },
            "due_date": "2024-02-17",
            "face_value": 629.33,
            "status": "pending_registration",
            "participant_control_number": "TBFBDWKTEWJ7UTR6CPL4BAE4P",
            "borrower": {
                "document_number": "784.508.035-78",
                "name": "mgkstsdibe",
                "person_type": "legal_person",
                "address": {
                    "postal_code": "05425-020"
                }
            },
            "assignor": {
                "name": "Assignor LTDA",
                "document_number": "37.341.966/0001-00",
                "person_type": "legal_person"
            },
            "occurrences": [
                {
                    "occurrence_key": "07ad7fce-fec6-40ac-be22-1ffd031f36bc",
                    "status": "pending_submission",
                    "type": "registration",
                    "occurrence_data": null
                }
            ]
        }
    ],
    "limit": 15,
    "page": 0,
    "is_last_page": true
}
```

### Paginated Object

| Field         | Type     | Description                                                    |
|---------------|----------|----------------------------------------------------------------|
| `data`        | array    | List of **[Bankslip](#bankslip)** objects                     |
| `limit`       | int      | Limit of objects retrieved per page                            |
| `page`        | int      | Retrieved page number                                          |
| `is_last_page`| boolean  | Information indicating if the retrieved page is the last one  |

### Bankslip

| Field                                 | Type     | Description                                                     |
|---------------------------------------|----------|-----------------------------------------------------------------|
| `bankslip_key`                        | string   | Unique bankslip identifier.                                     |
| `external_participant_control_number` | string   | External participant control number.                            |
| `asset_type`                          | string   | Linked asset type.                                              |
| `due_date`                            | date     | Bankslip due date.                                              |
| `face_value`                          | number   | Bankslip face value.                                            |
| `status`                              | string   | Current bankslip status.                                        |
| `participant_control_number`          | string   | Internal participant control number.                            |
| `bankslip_configuration`              | object   | Object containing the bankslip configuration (see below).      |
| `borrower`                            | object   | Object representing the borrower (payer).                      |
| `assignor`                            | object   | Object representing the receivables assignor.                  |
| `occurrences`                         | array    | List of bankslip-related occurrences (each item is an object). |

### Bankslip Configuration

| Field                                | Type     | Description                      |
|--------------------------------------|----------|----------------------------------|
| `bankslip_configuration_key`         | string   | Bankslip configuration key.      |
| `bankslip_profile`                   | object   | Associated bankslip profile.     |

---

### Bankslip Profile

| Field                                | Type     | Description |
|--------------------------------------|----------|-------------------------------|
| `bankslip_profile_key`               | string   | Bankslip profile identifier. |
| `bankslip_profile_code`              | string   | Profile code. |
| `bankslip_profile_number`            | number   | Profile number. |
| `bankslip_provider`                  | string   | Bankslip provider. |
| `additional_information`             | object   | Additional information (see below). |
| `internal_account_key`               | string   | Associated internal account identifier. |
| `fund_class`                         | object   | Object representing the investment fund (see below). |

### Fund Class

| Field                         | Type     | Description                                       | Characters |
|-------------------------------|----------|---------------------------------------------------|------------|
| `name`                        | string   | Fund class name                                   | up to 255  |
| `fund_class_key`              | string   | Fund class unique identification key              | 36         |
| `document_number`             | string   | Fund class CNPJ                                   | -          |

### Borrower 

| Field                                | Type     | Description                   |
|--------------------------------------|----------|-------------------------------|
|  `name`                              | string   | Borrower name. |
|  `document_number`                   | string   | Document (CPF/CNPJ). |
|  `person_type`                       | string   | Person type. |
|  `address`                           | object   | Borrower address (see below). |

### Address

| Field                                | Type     | Description                   |
|--------------------------------------|----------|-------------------------------|
| `street`                             | string   | Address street. |
| `number`                             | string   | Address number. |
| `neighborhood`                       | string   | Neighborhood. |
| `city`                               | string   | City. |
| `postal_code`                        | string   | Postal code. |
| `uf`                                 | string   | Federative unit (state abbreviation). |
| `country`                            | string   | Country in ISO Alpha-3 format. |

---

## Assignor (Cedente)

| Field                                | Type     | Description       |
|--------------------------------------|----------|-------------------|
| `name`                               | string   | Assignor name.    |
| `document_number`                    | string   | Document (CNPJ).  |
| `person_type`                        | string   | Person type.      |

---

## Occurrences

Each array item is an object with the following fields:

| Field                                | Type     | Description                     |
|--------------------------------------|----------|---------------------------------|
| `occurrence_key`                     | string   | Occurrence identifier.          |
| `status`                             | string   | Occurrence status.              |
| `type`                               | string   | Occurrence type.                |
| `occurrence_data`                    | object   | Additional occurrence data.     |

## Specific Bankslip

### Request

ENDPOINT /bankslip_collection/fund_class/FUND_CLASS_KEY/bankslip_configuration/BANKSLIP_CONFIGURATION_KEY/bankslip/BANKSLIP_KEY
MÉTODO GET

### Response 
Response Body

```json title='Response Body'
{
    "bankslip_key": "283bd9f4-7a18-4947-870e-cdb7170be6cb",
    "external_participant_control_number": "0175458470012171954123456",
    "bankslip_configuration": {
        "bankslip_configuration_key": "b3d4a489-a9d1-4afd-b1fc-719a06a1b49a",
        "bankslip_profile": {
            "bankslip_profile_key": "77dac6b1-2744-42d7-a9a1-57384e078e75",
            "bankslip_profile_code": "329-09-0001-1234567",
            "bankslip_profile_number": 9,
            "bankslip_provider": "qi_scd",
            "additional_information": {
                "requester_profile_key": "7c39615a-ae39-44be-b3b3-44b25ade2583"
            },
            "internal_account_key": "545fb51c-1e8e-4019-92dc-cae42eb5e1df",
            "fund_class": {
                "fund_class_key": "48ea2b09-d975-48d5-90e9-180af52441d1",
                "document_number": "21.453.503/0001-00",
                "name": "FUNDO FIDC",
                "manager": {
                    "name": "GESTORA",
                    "manager_key": "d59acd84-e81c-4822-9f34-968a8ccf54bd",
                    "document_number": "12.345.678/0001-01"
                }
            }
        }
    },
    "due_date": "2030-03-03",
    "face_value": 3000.0,
    "status": "registered",
    "participant_control_number": "0175324300089281954563002",
    "borrower": {
        "name": "BORROWER",
        "document_number": "00.000.000/0001-00",
        "person_type": "legal_person",
        "address": {
            "street": "RUA DOS PINHEIROS",
            "number": "250",
            "neighborhood": "SPINHEIROS",
            "city": "SAO PAULO",
            "postal_code": "74015-170"
        }
    },
    "assignor": {
        "name": "CEDENTE LTDA",
        "document_number": "01.001.001/0001-01",
        "person_type": "legal_person"
    },
    "bankslip_type": "simple_collection",
    "order_number": "31234-1",
    "digitable_line": "32990001039000000000101634386701233740000700000",
    "barcode": "39483137400003000000001090000000000161938270",
    "occurrences": [
        {
            "occurrence_key": "187b8700-361d-4df4-ba71-930f79a835a4",
            "status": "succeeded",
            "type": "registration",
            "occurrence_data": null
        }
    ],
    "settlement_instructions": [
        {
            "settlement_instruction_key": "eefbe1c4-bd85-4ba0-9400-4a0e20889dc7",
            "status": "pending_bankslip_payment",
            "issue_date": "2025-02-05",
            "maturity_date": "2030-03-03",
            "face_value": 3000.0,
            "asset_type": "duplicata_servicos",
            "asset_key": "c9168305-334e-47a1-91d6-6448337b5fd1",
            "order_number": "31234-1"
        }
    ],
    "bankslip_url": "https://url.com/c9168305-334e-47a1-91d6-6448337b5fd1_1.pdf"
}
```

---

# Bankslip Profiles Retrieval

URL: /en/documentation/iaas/boletos/recuperar_carteiras_cobranca

---

## List bankslip profiles

Returns a paginated list of the bankslip profiles of a fund class. Access is granted only to the manager responsible for the fund class.

### Request

ENDPOINT /bankslip_collection/fund_class/FUND_CLASS_KEY/bankslip_profiles
METHOD GET

### Path Params

| Parameter        | Description                                                                     |
|------------------|-----------------------------------------------------------------------------------|
| `fund_class_key` | Key of the fund class. Returns `404` (`NotFoundFundClass`) if it doesn't exist.    |

### Query Params

All parameters are optional.

| Parameter | Type | Description                                                          |
|-----------|------|-----------------------------------------------------------------------|
| `limit`   | int  | Value between 0 and 50 with the number of items per page. Default: `10`. |
| `page`    | int  | Zero-based page number. Default: `0`.                                 |

When `is_last_page` is `false`, request the next `page` to retrieve the remaining results.

### Response

Response Body

```json title='Response Body'
{
    "data": [
        {
            "bankslip_profile_key": "a1d7f09b-cb77-48da-a23d-b83d97d4b46b",
            "bankslip_profile_code": "329-09-0001-0000000",
            "bankslip_profile_number": 9,
            "bankslip_provider": "qi_scd",
            "additional_information": {
                "requester_profile_key": "30f72181-042c-4aae-9be7-b2794916416f"
            },
            "internal_account_key": "18809219-17d9-4845-a830-51e7f2beaf28",
            "fund_class": {
                "fund_class_key": "92c63a0f-25d6-45cb-90a2-6026c0ce2ef9",
                "document_number": "00.000.000/0001-01",
                "name": "FUNDO DE INVESTIMENTO EM DIREITOS CREDITÓRIOS",
                "manager": {
                    "name": "GESTÃO DE RECURSOS",
                    "manager_key": "7a5ff2f5-f127-451c-98d8-001826c35c3c",
                    "document_number": "00.100.100/0001-00"
                }
            },
            "total_value": 12345.67,
            "total_overdue_value": 890.12
        },
        {
            "bankslip_profile_key": "e0771a02-4f3e-4162-a468-a872fc6975e4",
            "bankslip_profile_code": "329-09-0001-0000001",
            "bankslip_profile_number": 10,
            "bankslip_provider": "qi_scd",
            "additional_information": {
                "requester_profile_key": "cdec985f-e629-44ce-8511-a323f38bd63e"
            },
            "internal_account_key": "5e621ba2-b4ac-4ddd-9893-82d220e1577e",
            "fund_class": {
                "fund_class_key": "92c63a0f-25d6-45cb-90a2-6026c0ce2ef9",
                "document_number": "00.000.000/0001-01",
                "name": "FUNDO DE INVESTIMENTO EM DIREITOS CREDITÓRIOS",
                "manager": {
                    "name": "GESTÃO DE RECURSOS",
                    "manager_key": "7a5ff2f5-f127-451c-98d8-001826c35c3c",
                    "document_number": "00.100.100/0001-00"
                }
            }
        }
    ],
    "limit": 10,
    "page": 0,
    "is_last_page": true,
    "elapsed_time_ms": 12.34
}
```

### Paginated Object

| Field             | Type    | Description                                              |
|-------------------|---------|----------------------------------------------------------|
| `data`            | array   | List of **[Bankslip Profile](#bankslip-profile)** objects |
| `limit`           | int     | Limit of objects retrieved per page                      |
| `page`            | int     | Number of the retrieved page                             |
| `is_last_page`    | boolean | Indicates whether the retrieved page is the last one     |
| `elapsed_time_ms` | number  | Server-side query execution time, in milliseconds        |

### Bankslip Profile

| Field                     | Type   | Description                                                                                                   |
|---------------------------|--------|-------------------------------------------------------------------------------------------------------------------|
| `bankslip_profile_key`    | string | Identifier of the bankslip profile.                                                                                 |
| `bankslip_profile_code`   | string | Profile code.                                                                                                       |
| `bankslip_profile_number` | number | Profile number.                                                                                                     |
| `bankslip_provider`       | string | Bankslip provider.                                                                                                  |
| `additional_information`  | object | Additional information of the profile.                                                                              |
| `internal_account_key`    | string | Identifier of the associated internal account.                                                                      |
| `fund_class`              | object | Object representing the fund class (see **[Fund Class](/documentation/iaas/boletos/recuperar_boletos#fund-class)**).                          |
| `total_value`             | number | Total outstanding value of the profile. Only present after the profile's periodic balance calculation.              |
| `total_overdue_value`     | number | Total overdue value of the profile. Only present after the profile's periodic balance calculation.                  |

---

# Bankslip Configurations Retrieval

URL: /en/documentation/iaas/boletos/recuperar_configuracoes_boleto

---

## List bankslip configurations

Returns a paginated list of the bankslip configurations of a bankslip profile within a fund class. Access is granted only to the manager responsible for the fund class.

### Request

ENDPOINT /bankslip_collection/fund_class/FUND_CLASS_KEY/bankslip_profile/BANKSLIP_PROFILE_KEY/bankslip_configurations
METHOD GET

### Path Params

| Parameter              | Description                                                                                                          |
|------------------------|-------------------------------------------------------------------------------------------------------------------------|
| `fund_class_key`       | Key of the fund class. Returns `404` (`NotFoundFundClass`) if it doesn't exist.                                           |
| `bankslip_profile_key` | Key of the bankslip profile, which must belong to the fund class. Returns `404` (`NotFoundBankslipProfile`) if not found. |

### Query Params

All parameters are optional.

| Parameter     | Type   | Description                                                                                                  |
|---------------|--------|-----------------------------------------------------------------------------------------------------------------|
| `issuer_type` | string | Filters by issuer type (see **[Issuer Type](#issuer-type)**). An unknown value returns an `InvalidValueForEntity` error. |
| `limit`       | int    | Value between 0 and 30 with the number of items per page. Default: `10`.                                          |
| `page`        | int    | Zero-based page number. Default: `0`.                                                                             |

When `is_last_page` is `false`, request the next `page` to retrieve the remaining results.

### Response

Response Body

```json title='Response Body'
{
    "data": [
        {
            "bankslip_configuration_key": "1b382eb7-7006-4389-975b-afa76b0ad7b4",
            "bankslip_profile": {
                "bankslip_profile_key": "a1d7f09b-cb77-48da-a23d-b83d97d4b46b",
                "bankslip_profile_code": "329-09-0001-0000000",
                "bankslip_profile_number": 9,
                "bankslip_provider": "qi_scd",
                "additional_information": {
                    "requester_profile_key": "30f72181-042c-4aae-9be7-b2794916416f"
                },
                "internal_account_key": "18809219-17d9-4845-a830-51e7f2beaf28",
                "fund_class": {
                    "fund_class_key": "92c63a0f-25d6-45cb-90a2-6026c0ce2ef9",
                    "document_number": "00.000.000/0001-01",
                    "name": "FUNDO DE INVESTIMENTO EM DIREITOS CREDITÓRIOS",
                    "manager": {
                        "name": "GESTÃO DE RECURSOS",
                        "manager_key": "7a5ff2f5-f127-451c-98d8-001826c35c3c",
                        "document_number": "00.100.100/0001-00"
                    }
                }
            },
            "bankslip_issuer_type": "manager",
            "delay": 0,
            "our_number_range": {
                "our_number_range_initial": 1,
                "our_number_range_final": 99999
            }
        },
        {
            "bankslip_configuration_key": "9c47d1a8-3f2e-4b6d-8a1c-5e7f9b3d2c80",
            "bankslip_profile": {
                "bankslip_profile_key": "a1d7f09b-cb77-48da-a23d-b83d97d4b46b",
                "bankslip_profile_code": "329-09-0001-0000000",
                "bankslip_profile_number": 9,
                "bankslip_provider": "qi_scd",
                "additional_information": {
                    "requester_profile_key": "30f72181-042c-4aae-9be7-b2794916416f"
                },
                "internal_account_key": "18809219-17d9-4845-a830-51e7f2beaf28",
                "fund_class": {
                    "fund_class_key": "92c63a0f-25d6-45cb-90a2-6026c0ce2ef9",
                    "document_number": "00.000.000/0001-01",
                    "name": "FUNDO DE INVESTIMENTO EM DIREITOS CREDITÓRIOS",
                    "manager": {
                        "name": "GESTÃO DE RECURSOS",
                        "manager_key": "7a5ff2f5-f127-451c-98d8-001826c35c3c",
                        "document_number": "00.100.100/0001-00"
                    }
                }
            },
            "bankslip_issuer_type": "internal",
            "delay": 1
        }
    ],
    "limit": 10,
    "page": 0,
    "is_last_page": true,
    "elapsed_time_ms": 12.34
}
```

### Paginated Object

| Field             | Type    | Description                                                        |
|-------------------|---------|--------------------------------------------------------------------|
| `data`            | array   | List of **[Bankslip Configuration](#bankslip-configuration)** objects |
| `limit`           | int     | Limit of objects retrieved per page                                |
| `page`            | int     | Number of the retrieved page                                       |
| `is_last_page`    | boolean | Indicates whether the retrieved page is the last one               |
| `elapsed_time_ms` | number  | Server-side query execution time, in milliseconds                  |

### Bankslip Configuration

| Field                        | Type   | Description                                                                                                            |
|------------------------------|--------|------------------------------------------------------------------------------------------------------------------------------|
| `bankslip_configuration_key` | string | Unique identifier of the bankslip configuration.                                                                               |
| `bankslip_profile`           | object | Associated bankslip profile (see **[Bankslip Profile](/documentation/iaas/boletos/recuperar_boletos#bankslip-profile)**).                                |
| `bankslip_issuer_type`       | string | Bankslip issuer type (see **[Issuer Type](#issuer-type)**).                                                                    |
| `delay`                      | int    | Delay configured for bankslip issuance.                                                                                        |
| `our_number_range`           | object | "Nosso número" range assigned to the configuration (see **[Our Number Range](#our-number-range)**). Only present when the configuration has a range assigned. |

### Our Number Range

| Field                      | Type | Description                          |
|----------------------------|------|--------------------------------------|
| `our_number_range_initial` | int  | Start of the "nosso número" range.   |
| `our_number_range_final`   | int  | End of the "nosso número" range.     |

## Issuer Type

| Enumerator   | Description |
|--------------|-------------|
| `internal`   | Internal    |
| `manager`    | Manager     |
| `consultant` | Consultant  |

---

# Webhooks

URL: /en/documentation/iaas/boletos/webhook

Ao longo do ciclo de vida do boleto, o sistema envia webhooks para notificar o parceiro integrador sobre mudanças de status. Todos os eventos utilizam o tipo `bankslip_collection.bankslip_status_change`.

:::info Configuração de webhooks
Para receber webhooks, é necessário ter uma URL de callback configurada junto à QI Tech. Entre em contato com [integracao@qitech.com.br](mailto:integracao@qitech.com.br) para configurar.
:::

## Estrutura do webhook

Todos os webhooks de boleto seguem a mesma estrutura base:

| Campo | Tipo | Descrição |
|---|---|---|
| `webhook_type` | string | Tipo do webhook. Sempre `bankslip_collection.bankslip_status_change`. |
| `webhook_datetime` | string | Data e hora do evento no formato ISO 8601. |
| `data` | object | Dados do evento. Veja tabela abaixo. |

#### Atributos de `data`

| Campo | Tipo | Descrição |
|---|---|---|
| `bankslip_key` | string (UUID) | Identificador único do boleto. |
| `bankslip_configuration_key` | string (UUID) | Identificador da configuração do boleto. |
| `bankslip_profile_key` | string (UUID) | Identificador do perfil do boleto. |
| `status` | string | Status atual do boleto. |
| `fund_class` | object | Dados da classe do fundo associada ao boleto. |
| `external_participant_control_number` | string | Número de controle externo do participante. |
| `participant_control_number` | string | Número de controle interno do participante. |
| `face_value` | float | Valor de face do boleto. |
| `due_date` | string | Data de vencimento no formato `YYYY-MM-DD`. |
| `borrower` | object | Dados do sacado (devedor). |
| `assignor` | object | Dados do cedente. |
| `settlement_instructions` | array | Lista de instruções de liquidação vinculadas ao boleto. |
| `our_number` | integer | **(Opcional)** Nosso número atribuído pelo banco emissor. |
| `our_number_digit` | string | **(Opcional)** Dígito verificador do nosso número. |
| `order_number` | string | **(Opcional)** Número do pedido. |
| `digitable_line` | string | **(Opcional)** Linha digitável do boleto. Presente quando disponível após o registro. |
| `barcode` | string | **(Opcional)** Código de barras do boleto. Presente quando disponível após o registro. |

#### Atributos de `fund_class`

| Campo | Tipo | Descrição |
|---|---|---|
| `document_number` | string | CNPJ da classe do fundo. |
| `fund_class_key` | string (UUID) | Identificador da classe do fundo. |
| `name` | string | Nome da classe do fundo. |

#### Atributos de `settlement_instructions`

| Campo | Tipo | Descrição |
|---|---|---|
| `asset_key` | string (UUID) | Identificador do ativo associado. |
| `asset_type` | string | Tipo do ativo (ex: `duplicata_mercantil`, `duplicata_servicos`, `ccb`). |
| `issue_date` | string | Data de emissão do ativo no formato `YYYY-MM-DD`. |
| `maturity_date` | string | Data de vencimento do ativo no formato `YYYY-MM-DD`. |
| `face_value` | float | Valor de face do ativo. |
| `status` | string | Status da instrução de liquidação. |
| `external_id` | string | **(Opcional)** Identificador externo do ativo. |
| `installment_number` | integer | **(Opcional)** Número da parcela, quando aplicável (ex: CCBs parceladas). |
| `order_number` | string | **(Opcional)** Número do pedido da instrução. |

---

## Eventos por status

### Registro do Boleto

STATUS pending_registration

Enviado quando um boleto é criado e submetido ao banco emissor para registro. O boleto aguarda a confirmação da instituição bancária. Dependendo do banco, os campos `digitable_line`, `barcode` e `our_number` podem estar presentes quando o banco os retorna imediatamente no ato do registro. Para outros bancos, esses campos são preenchidos somente após a confirmação via arquivo de retorno.

```json title='Webhook Body'
{
    "webhook_type": "bankslip_collection.bankslip_status_change",
    "webhook_datetime": "2026-04-15T12:55:35Z",
    "data": {
        "bankslip_key": "7a26c259-1b1f-4d73-9a5b-48230022b8f2",
        "bankslip_configuration_key": "b6b4ff70-917c-4003-bc4d-ebc4ccdd606c",
        "bankslip_profile_key": "5666937c-944a-44c6-98e6-3591f99fe4ff",
        "status": "pending_registration",
        "fund_class": {
            "document_number": "17.645.194/0001-85",
            "fund_class_key": "d81118d0-527b-45b0-8c60-76e9d3ab3aa3",
            "name": "Nome da Classe do Fundo"
        },
        "external_participant_control_number": "XO0QYVBF1JU9LFBBKGT7XYQV9",
        "participant_control_number": "XO0QYVBF1JU9LFBBKGT7XYQV9",
        "face_value": 629.33,
        "due_date": "2026-09-17",
        "borrower": {
            "document_number": "631.430.668-06",
            "name": "Nome do Sacado",
            "person_type": "natural_person",
            "address": {
                "postal_code": "05425-020"
            }
        },
        "assignor": {
            "name": "Nome do Cedente",
            "document_number": "37.341.966/0001-00",
            "person_type": "legal_person"
        },
        "settlement_instructions": [
            {
                "asset_key": "22fc5c95-3622-48ad-b26a-99f8d0499e69",
                "external_id": "758638e4-6fe6-4b69-8799-30728ca16a22",
                "asset_type": "duplicata_mercantil",
                "issue_date": "2025-01-17",
                "maturity_date": "2026-09-17",
                "face_value": 629.33,
                "status": "pending_bankslip_payment"
            }
        ],
        "our_number": 10507,
        "our_number_digit": "0"
    }
}
```

---

### Boleto Registrado

STATUS registered

Enviado quando o banco emissor **confirma o registro** do boleto. A partir deste momento, o boleto está apto para pagamento pelo sacado. Neste webhook, os campos `digitable_line`, `barcode`, `our_number` e `our_number_digit` estarão presentes.

```json title='Webhook Body'
{
    "webhook_type": "bankslip_collection.bankslip_status_change",
    "webhook_datetime": "2026-04-15T13:10:22Z",
    "data": {
        "bankslip_key": "7a26c259-1b1f-4d73-9a5b-48230022b8f2",
        "bankslip_configuration_key": "b6b4ff70-917c-4003-bc4d-ebc4ccdd606c",
        "bankslip_profile_key": "5666937c-944a-44c6-98e6-3591f99fe4ff",
        "status": "registered",
        "fund_class": {
            "document_number": "17.645.194/0001-85",
            "fund_class_key": "d81118d0-527b-45b0-8c60-76e9d3ab3aa3",
            "name": "Nome da Classe do Fundo"
        },
        "external_participant_control_number": "XO0QYVBF1JU9LFBBKGT7XYQV9",
        "participant_control_number": "XO0QYVBF1JU9LFBBKGT7XYQV9",
        "face_value": 629.33,
        "due_date": "2026-09-17",
        "borrower": {
            "document_number": "631.430.668-06",
            "name": "Nome do Sacado",
            "person_type": "natural_person",
            "address": {
                "postal_code": "05425-020"
            }
        },
        "assignor": {
            "name": "Nome do Cedente",
            "document_number": "37.341.966/0001-00",
            "person_type": "legal_person"
        },
        "settlement_instructions": [
            {
                "asset_key": "22fc5c95-3622-48ad-b26a-99f8d0499e69",
                "external_id": "758638e4-6fe6-4b69-8799-30728ca16a22",
                "asset_type": "duplicata_mercantil",
                "issue_date": "2025-01-17",
                "maturity_date": "2026-09-17",
                "face_value": 629.33,
                "status": "pending_bankslip_payment"
            }
        ],
        "our_number": 10507,
        "our_number_digit": "0",
        "digitable_line": "03399.87654 32100.012345 67890.123456 1 00000000062933",
        "barcode": "03391000000000629333987654321000123456789012345"
    }
}
```

---

### Boleto Rejeitado

STATUS rejected

Enviado quando o banco emissor **rejeita o registro** do boleto. O boleto não estará disponível para pagamento e não avançará no fluxo. As instruções de liquidação vinculadas também são marcadas como `rejected`.

```json title='Webhook Body'
{
    "webhook_type": "bankslip_collection.bankslip_status_change",
    "webhook_datetime": "2026-04-15T13:10:22Z",
    "data": {
        "bankslip_key": "7a26c259-1b1f-4d73-9a5b-48230022b8f2",
        "bankslip_configuration_key": "b6b4ff70-917c-4003-bc4d-ebc4ccdd606c",
        "bankslip_profile_key": "5666937c-944a-44c6-98e6-3591f99fe4ff",
        "status": "rejected",
        "fund_class": {
            "document_number": "17.645.194/0001-85",
            "fund_class_key": "d81118d0-527b-45b0-8c60-76e9d3ab3aa3",
            "name": "Nome da Classe do Fundo"
        },
        "external_participant_control_number": "XO0QYVBF1JU9LFBBKGT7XYQV9",
        "participant_control_number": "XO0QYVBF1JU9LFBBKGT7XYQV9",
        "face_value": 629.33,
        "due_date": "2026-09-17",
        "borrower": {
            "document_number": "631.430.668-06",
            "name": "Nome do Sacado",
            "person_type": "natural_person",
            "address": {
                "postal_code": "05425-020"
            }
        },
        "assignor": {
            "name": "Nome do Cedente",
            "document_number": "37.341.966/0001-00",
            "person_type": "legal_person"
        },
        "settlement_instructions": [
            {
                "asset_key": "22fc5c95-3622-48ad-b26a-99f8d0499e69",
                "external_id": "758638e4-6fe6-4b69-8799-30728ca16a22",
                "asset_type": "duplicata_mercantil",
                "issue_date": "2025-01-17",
                "maturity_date": "2026-09-17",
                "face_value": 629.33,
                "status": "rejected"
            }
        ],
        "our_number": 10507,
        "our_number_digit": "0"
    }
}
```

---

### Boleto Baixado

STATUS written_off

Enviado quando o boleto é **baixado** na instituição emissora. Isso pode ocorrer por solicitação de cancelamento.

```json title='Webhook Body'
{
    "webhook_type": "bankslip_collection.bankslip_status_change",
    "webhook_datetime": "2026-04-15T14:30:00Z",
    "data": {
        "bankslip_key": "7a26c259-1b1f-4d73-9a5b-48230022b8f2",
        "bankslip_configuration_key": "b6b4ff70-917c-4003-bc4d-ebc4ccdd606c",
        "bankslip_profile_key": "5666937c-944a-44c6-98e6-3591f99fe4ff",
        "status": "written_off",
        "fund_class": {
            "document_number": "17.645.194/0001-85",
            "fund_class_key": "d81118d0-527b-45b0-8c60-76e9d3ab3aa3",
            "name": "Nome da Classe do Fundo"
        },
        "external_participant_control_number": "XO0QYVBF1JU9LFBBKGT7XYQV9",
        "participant_control_number": "XO0QYVBF1JU9LFBBKGT7XYQV9",
        "face_value": 629.33,
        "due_date": "2026-09-17",
        "borrower": {
            "document_number": "631.430.668-06",
            "name": "Nome do Sacado",
            "person_type": "natural_person",
            "address": {
                "postal_code": "05425-020"
            }
        },
        "assignor": {
            "name": "Nome do Cedente",
            "document_number": "37.341.966/0001-00",
            "person_type": "legal_person"
        },
        "settlement_instructions": [
            {
                "asset_key": "22fc5c95-3622-48ad-b26a-99f8d0499e69",
                "external_id": "758638e4-6fe6-4b69-8799-30728ca16a22",
                "asset_type": "duplicata_mercantil",
                "issue_date": "2025-01-17",
                "maturity_date": "2026-09-17",
                "face_value": 629.33,
                "status": "written_off"
            }
        ],
        "our_number": 10507,
        "our_number_digit": "0",
        "digitable_line": "03399.87654 32100.012345 67890.123456 1 00000000062933",
        "barcode": "03391000000000629333987654321000123456789012345"
    }
}
```

---

# Portfolio - Approval

URL: /en/documentation/iaas/composicao_carteira/aprovar_carteira

---

### Request

ENDPOINT /composition/fund_class/FUND_CLASS_KEY/composition/COMPOSITION_KEY
METHOD PUT

```json title='Request Body'
{
    "new_status":"confirmed"
}

```

### "new_status" Enumerators

| Enumerator                    | Description   |
|--------------------------|--------|
| `confirmed`        | Approve the portfolio |
| `reproved`                 | Reject the portfolio |

---

# Wallet - Download Wallet

URL: /en/documentation/iaas/composicao_carteira/baixar_carteira

## Introduction

This feature aims to download, synchronously, a report based on the **Composition**. The supported reports are:

- **wallet_composition_by_composition.xlsx**
- **xml_401_by_composition.xml**
- **xml_5_by_composition.xml**

### Request

ENDPOINT /composition/fund_class/FUND_CLASS_KEY/report
METHOD POST
STATUS 201

```json title='Request Body'
{
    "composition_type": "final_quota | pre_quota",
    "report_type": "wallet_composition_by_composition | xml_401_by_composition | xml_5_by_composition",
    "reference_date": "2025-01-20"
}
```

### Response

```json title='Response Body'
{
    "document_b64": "BASE64"
}
```

:::warning Warning
To download the wallet, it must be in the final status **confirmed (Confirmada)**, otherwise the response will be a **400**.

:::

---

# Introduction

URL: /en/documentation/iaas/composicao_carteira/inicio

This section will explain how Wallet consumption works through APIs. Every day, the wallets of all Investment Funds managed by QI CTVM are made available through this API, with the information that comprises the quota for that particular day.

During the Fund closing process, and consequently the availability of its wallet, we generate a first wallet, called the **Validation Wallet**, and once this is approved, we proceed to make available the **Final Wallet**.

The main difference between both wallets is that the validation one is generated prior to liability processing, which includes amortizations, applications and redemptions, while the final one already reflects these movements. Information about assets, expenses, reconciliations, and cash are always identical between the two wallets. Practically speaking, what changes is that any "Payable" for Redemptions to be Quoted, or "Receivable" for Financial Applications to be Quoted, are quoted and affect the number of Quotas of the Issuance Series, without therefore altering the Published Quota.

:::warning
It is very important that any criticisms or validations are made on the **Validation Wallet** before its approval, because once it is approved, the system proceeds to liability processing and consequently to making the final wallet available. At this stage, as liability processing has already occurred, any redemptions and amortizations may have already been settled.
:::

To have access to these services, contact the team [integracao.dtvm@qitech.com.br](mailto:integracao.dtvm@qitech.com.br), so that the appropriate authorizations can be made, both in the Homologation environment (Sandbox) and in the production environment.

---

# Portfolio - Portfolio Recovery

URL: /en/documentation/iaas/composicao_carteira/recuperar_carteira

---

## Portfolio List

### Request

ENDPOINT /composition/fund_class/FUND_CLASS_KEY/compositions
METHOD GET

### Query Params
| Parameter        | Description |
|------------------|-----------------------------------------------------------------------------------------------------|
| `not_status`     | Filters results excluding compositions that are in the informed status.                          |
| `status`         | Filters results bringing only compositions that are in the informed status.                    |
| `reference_date` | Reference date for querying compositions. Must be in `YYYY-MM-DD` format.             |
| `type`           | Type of composition to be filtered pre_quota/final_quota.                                            |
| `start_date`     | Start date of the search range. Required if `end_date` is informed. Format: `YYYY-MM-DD`. |
| `end_date`       | End date of the search range. Required if `start_date` is informed. Format: `YYYY-MM-DD`. |

:::warning Warning
    There are two ways to filter by date:
- Consuming a specific date , sending the *reference_date* field as *query param*.
- Consuming a period , sending the *start_date* and *end_date* fields as *query param*
:::

```json title='Response Body'
{
    "data": [
        {
            "composition_key": "f2208257-1489-4937-8862-031bca34016f",
            "status": "confirmed",
            "type": "pre_quota",
            "composition_date": "2024-11-13",
            "fund_class": {
                "name": "A SAMPLE CLASS",
                "fund_class_key": "5dac941c-c779-4049-a4ee-7cee583b6860",
                "document_number": "18.687.469/0001-06"
            }
        },
        {
            "composition_key": "f2208257-1489-4937-8862-031bca34016f",
            "status": "confirmed",
            "type": "final_quota",
            "composition_date": "2024-11-13",
            "fund_class": {
                "name": "A SAMPLE CLASS",
                "fund_class_key": "5dac941c-c779-4049-a4ee-7cee583b6860",
                "document_number": "18.687.469/0001-06"
            }
        }
    ],
    "limit": 50,
    "page": 0,
    "is_last_page": true
}

```

### Paginated Object

| Field         | Type   | Description                                                      |
|---------------|--------|----------------------------------------------------------------|
| `data`        | array  | List of **[Composition](#composition)** objects            |
| `limit`       | int    | Limit of objects retrieved per page                       |
| `page`        | int    | Number of the retrieved page                                    |
| `is_last_page`| boolean| Information indicating if the retrieved page is the last        |

### Composition

| Field                    | Type   | Description                                       |
|--------------------------|--------|-------------------------------------------------|
| `composition_key`        | string | Unique portfolio identification key        |
| `status`                 | string | The status of that portfolio                       |
| `type`                   | string | The type of that portfolio, pre_quota/final_quota  |
| `composition_date`       | string | Reference date of the portfolio                  |
| `fund_class`             | object | **[Fund Class](#fund_class)** object         |

### Fund Class

| Field                         | Type     | Description                                         | Characters |
|-------------------------------|----------|---------------------------------------------------|------------|
| `name`                        | string   | Fund class name                           | up to 255    |
| `fund_class_key`              | string   | Unique fund class identification key   | 36         |
| `document_number`             | string   | Fund class CNPJ                           | -          |

---

## Portfolio Information

### Request

ENDPOINT /composition/fund_class/FUND_CLASS_KEY/composition/COMPOSITION_KEY
METHOD GET

```json title='Response Body'
{
    "composition_key": "f2208257-1489-4937-8862-031bca34016f",
    "status": "confirmed",
    "type": "pre_quota",
    "composition_date": "2024-12-02",
    "fund_class": {
        "name": "A SAMPLE CLASS",
        "fund_class_key": "5dac941c-c779-4049-a4ee-7cee583b6860",
        "document_number": "18.687.469/0001-06"
    },
    "issuance_series": [
      {
        "issuance_serie_key": "840e01e9-0df8-4719-83c4-f10b839d8384",
        "name": "SUBORDINADA - 1",
        "gross_net_worth": 1891397.29,
        "net_net_worth": 1891397.29,
        "gross_quota_value": 1.76821576,
        "net_quota_value": 1.76821576,
        "number_of_quotas": 1069664.309518427,
        "applied_value": 0.0,
        "applied_quotas": 0.0,
        "redeemed_value": 0.0,
        "redeemed_quotas": 0.0,
        "amortized_value": 0.0,
        "tax_anticipated_value": 0.0,
        "tax_anticipated_quotas": 0.0,
        "profitabilities": [
            {
                "reference_date": "2024-11-29", 
                "quota_value": 1.76065188,
                "di_benchmark_quota_value": 1.7613906
            },
            {
                "reference_date": "2024-11-25", 
                "quota_value": 1.7568068,
                "di_benchmark_quota_value": 1.76049545
            },
            {
                "reference_date": "2024-11-01", 
                "quota_value": 1.74121452,
                "di_benchmark_quota_value": 1.75502225
            },
            {
                "reference_date": "2024-10-03", 
                "quota_value": 1.72167143,
                "di_benchmark_quota_value": 1.75002091
            },
            {
                "reference_date": "2024-09-03", 
                "quota_value": 1.70128747,
                "di_benchmark_quota_value": 1.74445962
            },
            {
                "reference_date": "2024-06-05", 
                "quota_value": 1.63380383,
                "di_benchmark_quota_value": 1.7178922
            },
            {
                "reference_date": "2023-12-08", 
                "quota_value": 1.52421994,
                "di_benchmark_quota_value": 1.68553599
            }
        ]
      }
    ],
    "assets": [
        {
            "asset_key": "34f42521-f27f-424a-958f-8b53f15cc80d",
            "asset_type": "fixed_income_fund_quota",
            "purchase_date": "2024-11-27",
            "total_purchase_value": 1009320,
            "bad_debt_percentage": 0,
            "bad_debt_value": 0,
            "overdue_accounting_value": 0,
            "current_accounting_value": 1234335,
            "current_fair_accounting_value": 1234335
        }
    ],
    "consolidated_assets": [
        {
            "asset_type": "ccb",
            "total_units": 175623,
            "bad_debt_value": 0,
            "overdue_accounting_value": 75642,
            "current_accounting_value": 187762590,
            "current_fair_accounting_value": 187762590
        }
    ],
    "receivables": [
        {
          "origin_key": "a60f9226-edac-488e-9a58-6205a334e6ba",
          "origin_type": "expense",
          "description": "Taxa CVM - 2024",
          "total_value": 711515,
          "recognized_value": 654125,
          "start_date": "2024-01-09",
          "end_date": "2024-12-31",
          "payment_date": "2024-05-10"
        }
    ],
    "payables": [
      {
        "origin_key": "19b83b17-d36c-4edd-97fe-99af6a0a4a63",
        "origin_type": "expense",
        "description": "Taxa de Gestão - 2024/12",
        "total_value": 14586,
        "recognized_value": 14586,
        "start_date": "2024-12-02",
        "end_date": "2024-12-31",
        "payment_date": "2025-01-08"
      },
    ],
    "cash_accounts": [
      {
        "account_key": "a41e4fa8-6950-485e-9a5b-70f21cc6774a",
        "balance": 100000,
        "unconcilied_cash_in": 0,
        "unconcilied_cash_out": 0,
        "account_branch": "0001",
        "account_digit": "1",
        "account_number": "372832",
        "accounting_identification": 1,
        "financial_institution": {
            "code": "329",
            "ispb": "32402502",
            "name": "QI Sociedade de Crédito Direto"
        }
      }
    ]
}

```

### Complete Composition

| Field                    | Type   | Description                                                   |
|--------------------------|--------|-------------------------------------------------------------|
| `composition_key`        | string | Unique portfolio identification key                    |
| `status`                 | string | The status of that portfolio                                   |
| `type`                   | string | The type of that portfolio, pre_quota/final_quota              |
| `composition_date`       | string | Reference date of the portfolio                              |
| `fund_class`             | object | **[Fund Class](#fund_class)** object                     |
| `issuance_series`        | array  | List of **[Issuance Series](#issuance_series)** objects |
| `assets`                 | array  | List of **[Assets](#composition)** objects              |
| `consolidated_assets`    | array  | List of **[Consolidated Assets](#composition)** objects |
| `receivables`            | array  | List of **[Receivables](#composition)** objects         |
| `payables`               | array  | List of **[Paybles](#composition)** objects             |
| `cash_accounts`          | array  | List of **[Cash Accounts](#composition)** objects       |

### Issuance Serie

| Field                    | Type   | Description                                                   |
|--------------------------|--------|-------------------------------------------------------------|
| `issuance_serie_key`     | string | Unique issuance series identification key            |
| `name`                   | string | The name of that series                                        |
| `gross_net_worth`        | float  | Gross net worth of that series                                    |
| `net_net_worth`          | float  | Net worth of that series                                  |
| `gross_quota_value`      | float  | Gross quota value                                         |
| `net_quota_value`        | float  | Net quota value                                       |
| `number_of_quotas`       | float  | Total number of quotas                                       |
| `profitabilities`        | array  | List of **[Profitability](#profitability)** objects     |

### Profitability

| Field                       | Type   | Description                                                            |
|-----------------------------|--------|----------------------------------------------------------------------|
| `reference_date`            | string | Reference date on which performance is analyzed                 |
| `quota_value`               | float  | Series quota value on the reference date                       |
| `di_benchmark_quota_value`  | float  | Quota value today if the reference quota ran at 100% DI  |

### Assets

| Field                           | Type    | Description                                             |
|---------------------------------|---------|-------------------------------------------------------|
| `asset_key`                     | string  | Unique asset identification key                 |
| `asset_type`                    | string  | Asset type                                       |
| `purchase_date`                 | string  | Asset acquisition date                            |
| `total_purchase_value`          | string  | Total asset acquisition value                     |
| `bad_debt_percentage`           | string  | Applied PDD percentage                                     |
| `bad_debt_value`                | integer | Total PDD value considered - Integer in cents  |
| `overdue_accounting_value`      | integer | Asset overdue value - Integer in cents          |
| `current_accounting_value`      | integer | Asset total value - Integer in cents           |
| `current_fair_accounting_value` | integer | Asset total value - Integer in cents           |

### Consolidated Assets

| Field                           | Type    | Description                                                            |
|---------------------------------|---------|----------------------------------------------------------------------|
| `asset_type`                    | string  | Asset type                                                      |
| `total_units`                   | string  | Total number of consolidated assets of this type                     |
| `bad_debt_value`                | integer | Total PDD value considered - Integer in cents                 |
| `overdue_accounting_value`      | integer | Asset overdue value - Integer in cents                         |
| `current_accounting_value`      | integer | Asset total value - Integer in cents                           |
| `current_fair_accounting_value` | integer | Reference date on which performance is analyzed                 |

### Receivables

| Field                       | Type   | Description                                                            |
|-----------------------------|--------|----------------------------------------------------------------------|
| `origin_key`                | string | Unique identification key of the resource that originates this receivable   |
| `origin_type`               | string | Type of resource that originates this receivable                         |
| `description`               | string | Item description                                                    |
| `total_value`               | float  | Total receivable value                                              |
| `recognized_value`          | float  | Value that has already been allocated                                        |
| `start_date`                | string | Allocation start date                                      |
| `end_date`                  | string | Allocation end date                                         |
| `payment_date`              | string | Settlement date                                                 |

### Payables

| Field                       | Type   | Description                                                            |
|-----------------------------|--------|----------------------------------------------------------------------|
| `origin_key`                | string | Unique identification key of the resource that originates this payable     |
| `origin_type`               | string | Type of resource that originates this payable                           |
| `description`               | string | Item description                                                    |
| `total_value`               | float  | Total payable value                                                |
| `recognized_value`          | float  | Value that has already been allocated                                        |
| `start_date`                | string | Allocation start date                                      |
| `end_date`                  | string | Allocation end date                                         |
| `payment_date`              | string | Settlement date                                                 |

### Cash Accounts

| Field                       | Type    | Description                                                         |
|-----------------------------|---------|-------------------------------------------------------------------|
| `account_key`               | string  | Unique account identification key                             |
| `balance`                   | integer | Account balance - Integer in cents                            |
| `unconcilied_cash_in`       | integer | Value of inflows to reconcile in this account - Integer in cents |
| `unconcilied_cash_out`      | integer | Value of outflows to reconcile in this account - Integer in cents   |
| `account_branch`            | string  | Account branch                                                |
| `account_digit`             | string  | Account digit                                                 |
| `account_number`            | string  | Account number                                                 |
| `accounting_identification` | integer | Accounting identifier of that account                            |
| `financial_institution`     | object  | **[Financial Institution](#financial_institution)** object    |

### Financial Institution

| Field                       | Type   | Description             |
|-----------------------------|--------|-----------------------|
| `code`                      | string | Financial institution COMPE code    |
| `ispb`                      | string | Financial institution ISPB          |
| `name`                      | string | Financial institution name          |

---

# Financial Applications Query by Fund Class

URL: /en/documentation/iaas/cotas_de_fundo/consulta_paginada_aplicacoes_financeiras

:::warning Attention
This feature is only available for integrations that exercise the role of **Manager**.
:::

### Request

ENDPOINT /trade_fund_quota/fund_class/FUND_CLASS_KEY/financial_applications
METHOD GET

#### Query Params

| Parameter                          | Type   | Description                                         |
| ---------------------------------- | ------ | --------------------------------------------------- |
| `quotation_date`                   | date   | Quotation date of the application                   |
| `financial_application_status`     | string | Filters applications by a specific status           |
| `not_financial_application_status` | string | Excludes applications with a specific status        |
| `document_number`                  | string | CNPJ of the invested fund class                     |

### Response

STATUS 200

Case 01: Return with one application

```json
{
  "data": [
        {
            "amount": 0.00,
            "financial_application_key": "UUID",
            "asset_key": "UUID",
            "quotation_date": "YYYY-MM-DD",
            "status": "confirmed",
            "issuance_serie": {
                "issuance_serie_key": "UUID",
                "name": "Invested Issuance Serie Name",
                "subclass_name": "Invested Sub Class Name",
                "serie": 1,
                "quota_calculation_method": "quota_value",
                "internal_code": "Internal Code",
                "fund_class_name": "Invested Fund Class Name",
                "fund_class_short_name": "Invested Fund Class short name",
                "fund_class_document_number": "00.000.000/0000-00",
                "minimum_share_capital": 0.0,
                "investment_category": "multi_market",
                "payment_type": "transfer",
                "account_data": {
                    "account_digit": "0",
                    "account_branch": "0001",
                    "account_number": "12345",
                    "financial_institution_code": "329",
                    "financial_institution_ispb": "00000000"
                },
                "last_updated_date": "YYYY-MM-DD",
                "administrator": {
                    "administrator_key": "UUID",
                    "name": "Administrator Name",
                    "document_number": "00.000.000/0000-00"
                },
                "operation_periods": {
                    "redemption_request": {
                        "payment": {
                            "days": 1,
                            "type": "until",
                            "calendar_base": "calendar_365"
                        },
                        "quotation": {
                            "days": 1,
                            "type": "fixed",
                            "calendar_base": "calendar_365"
                        }
                    },
                    "amortization_request": {
                        "payment": {
                            "days": 0,
                            "type": "fixed",
                            "calendar_base": "workdays"
                        },
                        "quotation": {
                            "days": 0,
                            "type": "fixed",
                            "calendar_base": "workdays"
                        }
                    },
                    "financial_application": {
                        "payment": {
                            "days": 0,
                            "type": "fixed",
                            "calendar_base": "workdays"
                        },
                        "quotation": {
                            "days": 0,
                            "type": "fixed",
                            "calendar_base": "workdays"
                        }
                    }
                },
                "isin_code": "BR000000000"
            },
            "fund_class": {
                "fund_class_key": "UUID",
                "name": "Fund Class Name",
                "short_name": "Fund Class Short Name",
                "document_number": "00.000.000/0000-00",
                "accounting_date": "YYYY-MM-DD",
                "distributor": {
                    "name": "Distributor Name",
                    "distributor_key": "UUID",
                    "document_number": "00.000.000/0000-00"
                },
                "manager": {
                    "manager_key": "UUID",
                    "manager_name": "Manager Name",
                    "document_number": "00.000.000/0000-00"
                }
            }
        }
    ],
    "limit": 10,
    "page": 0,
    "is_last_page": true
}
```

### Page
| Field         | Type   | Description                                                                    |
|---------------|--------|--------------------------------------------------------------------------------|
| `data`        | array  | List of **[Financial Application](#financial_application)** objects           |
| `limit`       | int    | Limit of objects retrieved per page                                            |
| `page`        | int    | Retrieved page number                                                          |
| `is_last_page`| boolean| Information indicating if the retrieved page is the last one                   |

### Financial Application

| Field                                | Type   | Description                                     |
| ------------------------------------ | ------ | ----------------------------------------------- |
| amount                               | float  | Applied amount                                  |
| financial_application_key            | string | Unique key of the financial application         |
| asset_key                            | string | Related asset key                               |
| quotation_date                       | string | Quotation date (YYYY-MM-DD)                     |
| status                               | string | Application status                              |
| external_financial_application_key   | string | External identifier of the financial application |
| issuance_serie                       | JSON   | **[Issuance Serie](#issuance-serie)** object    |
| fund_class                           | JSON   | **[Fund Class](#fund-class)** object            |

### Issuance Serie

| Field                         | Type   | Description                                           |
| ----------------------------- | ------ | ----------------------------------------------------- |
| issuance_serie_key            | string | Unique key of the issuance series                     |
| name                          | string | Name of the issuance series                           |
| subclass_name                 | string | Subclass name (ex: SUBORDINADA)                       |
| serie                         | int    | Series number                                         |
| quota_calculation_method      | string | Quota calculation method (ex: quota_value)            |
| internal_code                 | string | Internal code of the series                           |
| fund_class_name               | string | Name of the fund class associated with the series     |
| fund_class_short_name         | string | Short name of the fund class                          |
| fund_class_document_number    | string | CNPJ of the fund class                                |
| minimum_share_capital         | float  | Minimum value for application                         |
| investment_category           | string | Investment category (ex: multi_market)                |
| payment_type                  | string | Payment type (ex: transfer)                           |
| account_data                  | JSON   | **[Account Data](#account-data)** object              |
| last_updated_date             | string | Last update date (YYYY-MM-DD)                         |
| administrator                 | JSON   | **[Administrator](#administrator)** object            |
| operation_periods             | JSON   | **[Operation Periods](#operation-periods)** object    |
| isin_code                     | string | ISIN code of the series                               |

### Administrator

| Field              | Type   | Description                  |
| ------------------ | ------ | ---------------------------- |
| administrator_key  | string | Unique key of the administrator |
| name               | string | Administrator name           |
| document_number    | string | Administrator CNPJ           |

### Operation Periods

| Field                  | Type | Description                                                                              |
| ---------------------- | ---- | ---------------------------------------------------------------------------------------- |
| redemption_request     | JSON | **[Quotation and Payment](#quotation-and-payment)** periods object for redemptions     |
| amortization_request   | JSON | **[Quotation and Payment](#quotation-and-payment)** periods object for amortizations   |
| financial_application  | JSON | **[Quotation and Payment](#quotation-and-payment)** periods object for applications    |

### Quotation and Payment

| Field          | Type   | Description                                      |
| -------------- | ------ | ------------------------------------------------ |
| days           | int    | Number of days                                   |
| type           | string | Counting type (ex: fixed, until)                 |
| calendar_base  | string | Calendar base (ex: workdays, calendar_365)       |

### Account Data

| Field                        | Type   | Description                                                   |
| ---------------------------- | ------ | ------------------------------------------------------------- |
| account_digit                | string | Bank account digit                                            |
| account_branch               | string | Bank branch number                                            |
| account_number               | string | Bank account number                                           |
| financial_institution_code   | string | Financial institution code                                    |
| financial_institution_ispb   | string | Financial institution ISPB (Brazilian Payment System)        |

### Fund Class

| Field            | Type   | Description                             |
| ---------------- | ------ | --------------------------------------- |
| fund_class_key   | string | Unique key of the fund class            |
| name             | string | Full name of the fund class             |
| short_name       | string | Short name of the fund class            |
| document_number  | string | CNPJ of the fund class                  |
| accounting_date  | string | Most recent accounting date             |
| distributor      | JSON   | **[Distributor](#distributor)** object |
| manager          | JSON   | **[Manager](#manager)** object          |

### Distributor

| Field            | Type   | Description                 |
| ---------------- | ------ | --------------------------- |
| name             | string | Distributor name            |
| distributor_key  | string | Unique key of the distributor |
| document_number  | string | Distributor CNPJ            |

### Manager

| Field            | Type   | Description                       |
| ---------------- | ------ | --------------------------------- |
| manager_key      | string | Unique key of the manager         |
| manager_name     | string | Name of the fund class manager    |
| document_number  | string | Manager CNPJ                      |

---

# Fund Class Redemption Request Query

URL: /en/documentation/iaas/cotas_de_fundo/consulta_paginada_resgates

:::warning Warning
This feature is only available for integrations that perform the Manager role.
:::

### Request

ENDPOINT /trade_fund_quota/fund_class/FUND_CLASS_KEY/redemption_requests
METHOD GET

#### Query Params

| Parameter                       | Type   | Description                                 |
| ------------------------------- | ------ | ------------------------------------------- |
| `quotation_date`                | date   | Redemption quotation date                   |
| `redemption_request_status`     | string | Filter redemptions by a specific status    |
| `not_redemption_request_status` | string | Exclude redemptions with a specific status |
| `document_number`               | string | CNPJ of the invested fund class             |

### Response

STATUS 200

Case 01: Return with one redemption

```json
{
  "data": [
    {
      "redemption_request_key": "UUID",
      "status": "confirmed",
      "quotation_date": "YYYY-MM-DD",
      "payment_date": "YYYY-MM-DD",
      "amount": 0.00,
      "issuance_serie": {
        "issuance_serie_key": "UUID",
        "name": "Issuance Serie Name",
        "subclass_name": "SUBORDINADA",
        "serie": 1,
        "quota_calculation_method": "quota_value",
        "internal_code": "Internal Code",
        "fund_class_name": "Fund Class Name",
        "fund_class_short_name": "Fund Class Short Name",
        "fund_class_document_number": "00.000.000/0000-00",
        "minimum_share_capital": 0.0,
        "investment_category": "fixed_income",
        "payment_type": "automatic_debit",
        "financial_institution_code": "341",
        "account_data": {
                    "account_digit": "0",
                    "account_branch": "0001",
                    "account_number": "12345",
                    "financial_institution_code": "329",
                    "financial_institution_ispb": "00000000"
                },
        "last_updated_date": "YYYY-MM-DD",
        "administrator": {
          "administrator_key": "UUID",
          "name": "Administrator Name",
          "document_number": "00.000.000/0000-00"
        },
        "operation_periods": {
                    "redemption_request": {
                        "payment": {
                            "days": 1,
                            "type": "until",
                            "calendar_base": "calendar_365"
                        },
                        "quotation": {
                            "days": 1,
                            "type": "fixed",
                            "calendar_base": "calendar_365"
                        }
                    },
                    "amortization_request": {
                        "payment": {
                            "days": 0,
                            "type": "fixed",
                            "calendar_base": "workdays"
                        },
                        "quotation": {
                            "days": 0,
                            "type": "fixed",
                            "calendar_base": "workdays"
                        }
                    },
                    "financial_application": {
                        "payment": {
                            "days": 0,
                            "type": "fixed",
                            "calendar_base": "workdays"
                        },
                        "quotation": {
                            "days": 0,
                            "type": "fixed",
                            "calendar_base": "workdays"
                        }
                    }
                },
        "issuance_serie_data": {
          "name": "Issuance Serie Name",
          "serie": 1,
          "payment_type": "automatic_debit",
          "remuneration": "residual",
          "internal_code": "Internal Code",
          "subclass_name": "SUBORDINADA",
          "fund_class_name": "Fund Class Name",
          "issuance_serie_key": "UUID",
          "tax_classification": "long_term",
          "investment_category": "fixed_income",
          "fund_class_short_name": "Fund Class Short Name",
          "minimum_share_capital": 0.00,
          "quota_calculation_method": "quota_value",
          "financial_institution_code": "329",
          "fund_class_document_number": "00.000.000/0000-00",
          "administrator_document_number": "00.000.000/0000-00"
        }
      },
      "fund_class": {
        "fund_class_key": "UUID",
        "name": "Fund Class Name",
        "short_name": "Fund Class Short Name",
        "document_number": "00.000.000/0000-00",
        "accounting_date": "YYYY-MM-DD",
        "distributor": {
          "name": "Distributor Name",
          "distributor_key": "UUID",
          "document_number": "00.000.000/0000-00"
        },
        "manager": {
          "manager_key": "UUID",
          "manager_name": "Manager Name",
          "document_number": "00.000.000/0000-00"
        }
      }
    }
  ],
  "limit": 10,
  "page": 0,
  "is_last_page": true
}
```

### Page
| Field          | Type    | Description                                                   |
| -------------- | ------- | ------------------------------------------------------------- |
| `data`         | array   | List of **[Redemption Request](#redemption-request)** objects |
| `limit`        | int     | Limit of objects retrieved per page                           |
| `page`         | int     | Retrieved page number                                         |
| `is_last_page` | boolean | Information indicating if the retrieved page is the last one  |

### Redemption Request

| Field                              | Type   | Description                                 |
| ---------------------------------- | ------ | ------------------------------------------- |
| redemption_request_key             | string | Unique key for the redemption request       |
| external_redemption_request_key    | string | External control key (optional)             |
| status                             | string | Redemption status (e.g., confirmed)        |
| quotation_date                     | string | Redemption quotation date                   |
| payment_date                       | string | Redemption payment date                     |
| amount                             | float  | Redeemed amount                             |
| issuance_serie                     | JSON   | **[Issuance Serie](#issuance-serie)** object |
| fund_class                         | JSON   | **[Fund Class](#fund-class)** object       |

### Issuance Serie

| Field                         | Type   | Description                                          |
| ----------------------------- | ------ | ---------------------------------------------------- |
| issuance_serie_key            | string | Unique key for the issuance series                   |
| name                          | string | Name of the issuance series                          |
| subclass_name                 | string | Subclass name (e.g., SUBORDINADA)                   |
| serie                         | int    | Series number                                        |
| quota_calculation_method      | string | Quota calculation method (e.g., quota_value)        |
| internal_code                 | string | Series internal code                                 |
| fund_class_name               | string | Name of the fund class associated with the series    |
| fund_class_short_name         | string | Short name of the fund class                         |
| fund_class_document_number    | string | CNPJ of the fund class                              |
| minimum_share_capital         | float  | Minimum value for investment                         |
| investment_category           | string | Investment category (e.g., multi_market)            |
| payment_type                  | string | Payment type (e.g., transfer)                       |
| account_data                  | JSON   | **[Account Data](#account-data)** object            |
| last_updated_date             | string | Last update date (YYYY-MM-DD)                       |
| administrator                 | JSON   | **[Administrator](#administrator)** object          |
| operation_periods             | JSON   | **[Operation Periods](#operation-periods)** object  |
| isin_code                     | string | ISIN code of the series                             |

### Administrator

| Field              | Type   | Description               |
| ------------------ | ------ | ------------------------- |
| administrator_key  | string | Unique administrator key  |
| name               | string | Administrator name        |
| document_number    | string | Administrator CNPJ        |

### Operation Periods

| Field                  | Type | Description                                                                              |
| ---------------------- | ---- | ---------------------------------------------------------------------------------------- |
| redemption_request     | JSON | **[Quotation and Payment](#quotation-and-payment)** periods object for redemptions     |
| amortization_request   | JSON | **[Quotation and Payment](#quotation-and-payment)** periods object for amortizations   |
| financial_application  | JSON | **[Quotation and Payment](#quotation-and-payment)** periods object for applications    |

### Quotation and Payment

| Field          | Type   | Description                                     |
| -------------- | ------ | ----------------------------------------------- |
| days           | int    | Number of days                                  |
| type           | string | Count type (e.g., fixed, until)                |
| calendar_base  | string | Calendar base (e.g., workdays, calendar_365)   |

### Account Data

| Field                        | Type   | Description                                                      |
| ---------------------------- | ------ | ---------------------------------------------------------------- |
| account_digit                | string | Bank account digit                                               |
| account_branch               | string | Bank branch number                                               |
| account_number               | string | Bank account number                                              |
| financial_institution_code   | string | Financial institution code                                       |
| financial_institution_ispb   | string | Financial institution ISPB (Brazilian Payment System)           |

### Fund Class

| Field            | Type   | Description                              |
| ---------------- | ------ | ---------------------------------------- |
| fund_class_key   | string | Unique fund class key                    |
| name             | string | Full name of the fund class              |
| short_name       | string | Short name of the fund class             |
| document_number  | string | CNPJ of the fund class                  |
| accounting_date  | string | Most recent accounting date              |
| distributor      | JSON   | **[Distributor](#distributor)** object   |
| manager          | JSON   | **[Manager](#manager)** object           |

### Distributor

| Field            | Type   | Description            |
| ---------------- | ------ | ---------------------- |
| name             | string | Distributor name       |
| distributor_key  | string | Unique distributor key |
| document_number  | string | Distributor CNPJ       |

### Manager

| Field            | Type   | Description               |
| ---------------- | ------ | ------------------------- |
| manager_key      | string | Unique manager key        |
| manager_name     | string | Fund class manager name   |
| document_number  | string | Manager CNPJ              |

---

# Issuance Series Query

URL: /en/documentation/iaas/cotas_de_fundo/consulta_paginada_series_de_emissao

:::warning Attention
This feature is only available for integrations that perform the role of **Manager**.
:::

### Request

ENDPOINT /trade_fund_quota/issuance_series
METHOD GET

#### Query Params

| Parameter                    | Type   | Description                        |
| ---------------------------- | ------ | ---------------------------------- |
| `fund_class_document_number` | string | Fund CNPJ (00.000.000/0001-00)    |

### Response

STATUS 200

Case 01: Return with one series

```json
{
  "data": [
    {
        "issuance_serie_key": "UUID",
        "name": "Invested Issuance Serie Name",
        "subclass_name": "Invested Sub Class Name",
        "serie": 1,
        "quota_calculation_method": "quota_value",
        "internal_code": "Internal Code",
        "fund_class_name": "Invested Fund Class Name",
        "fund_class_short_name": "Invested Fund Class short name",
        "fund_class_document_number": "00.000.000/0000-00",
        "minimum_share_capital": 0.0,
        "investment_category": "multi_market",
        "payment_type": "transfer",
        "account_data": {
            "account_digit": "0",
            "account_branch": "0001",
            "account_number": "12345",
            "financial_institution_code": "329",
            "financial_institution_ispb": "00000000"
        },
        "last_updated_date": "YYYY-MM-DD",
        "administrator": {
            "administrator_key": "UUID",
            "name": "Administrator Name",
            "document_number": "00.000.000/0000-00"
        },
        "operation_periods": {
            "redemption_request": {
                "payment": {
                    "days": 1,
                    "type": "until",
                    "calendar_base": "calendar_365"
                },
                "quotation": {
                    "days": 1,
                    "type": "fixed",
                    "calendar_base": "calendar_365"
                }
            },
            "amortization_request": {
                "payment": {
                    "days": 0,
                    "type": "fixed",
                    "calendar_base": "workdays"
                },
                "quotation": {
                    "days": 0,
                    "type": "fixed",
                    "calendar_base": "workdays"
                }
            },
            "financial_application": {
                "payment": {
                    "days": 0,
                    "type": "fixed",
                    "calendar_base": "workdays"
                },
                "quotation": {
                    "days": 0,
                    "type": "fixed",
                    "calendar_base": "workdays"
                }
            }
        },
        "isin_code": "BR000000000"
    }
    ],
    "limit": 10,
    "page": 0,
    "is_last_page": true
}
```

### Page
| Field         | Type   | Description                                                                  |
|---------------|--------|------------------------------------------------------------------------------|
| `data`        | array  | List of **[Issuance Serie](#issuance_serie)** objects                       |
| `limit`       | int    | Limit of objects retrieved per page                                          |
| `page`        | int    | Number of the retrieved page                                                 |
| `is_last_page`| boolean| Information indicating whether the retrieved page is the last               |

### Issuance Serie

| Field                         | Type   | Description                                           |
| ----------------------------- | ------ | ----------------------------------------------------- |
| issuance_serie_key            | string | Unique key of the issuance series                     |
| name                          | string | Name of the issuance series                           |
| subclass_name                 | string | Subclass name (e.g., SUBORDINADA)                     |
| serie                         | int    | Series number                                         |
| quota_calculation_method      | string | Quota calculation method (e.g., quota_value)          |
| internal_code                 | string | Internal code of the series                           |
| fund_class_name               | string | Name of the fund class associated with the series     |
| fund_class_short_name         | string | Short name of the fund class                          |
| fund_class_document_number    | string | CNPJ of the fund class                                |
| minimum_share_capital         | float  | Minimum value for investment                          |
| investment_category           | string | Investment category (e.g., multi_market)              |
| payment_type                  | string | Payment type (e.g., transfer)                         |
| account_data                  | JSON   | **[Account Data](#account-data)** object              |
| last_updated_date             | string | Last update date (YYYY-MM-DD)                         |
| administrator                 | JSON   | **[Administrator](#administrator)** object            |
| operation_periods             | JSON   | **[Operation Periods](#operation-periods)** object    |
| isin_code                     | string | ISIN code of the series                               |

### Administrator

| Field              | Type   | Description                      |
| ------------------ | ------ | -------------------------------- |
| administrator_key  | string | Unique key of the administrator  |
| name               | string | Administrator name               |
| document_number    | string | Administrator CNPJ               |

### Operation Periods

| Field                  | Type | Description                                                                                     |
| ---------------------- | ---- | ----------------------------------------------------------------------------------------------- |
| redemption_request     | JSON | **[Quotation and Payment](#quotation-and-payment)** periods object for redemptions            |
| amortization_request   | JSON | **[Quotation and Payment](#quotation-and-payment)** periods object for amortizations          |
| financial_application  | JSON | **[Quotation and Payment](#quotation-and-payment)** periods object for applications           |

### Quotation and Payment

| Field          | Type   | Description                                      |
| -------------- | ------ | ------------------------------------------------ |
| days           | int    | Number of days                                   |
| type           | string | Counting type (e.g., fixed, until)              |
| calendar_base  | string | Calendar base (e.g., workdays, calendar_365)    |

### Account Data

| Field                        | Type   | Description                                                                 |
| ---------------------------- | ------ | --------------------------------------------------------------------------- |
| account_digit                | string | Bank account digit                                                          |
| account_branch               | string | Bank branch number                                                          |
| account_number               | string | Bank account number                                                         |
| financial_institution_code   | string | Financial institution code                                                  |
| financial_institution_ispb   | string | Financial institution ISPB (Brazilian Payment System)                      |

---

# Introduction

URL: /en/documentation/iaas/cotas_de_fundo/inicio

The Fund Shares system is a solution that allows the purchase, sale, and consultation related to shares of other funds. This module offers essential functionalities for:

- Managing contributions and redemptions in other funds
- Creating operations

This documentation provides a detailed overview of how to use the fund shares system, including its main features and flows. Here you will find information about:

- Purchase, sale, and consultation related to shares of other funds
- Endpoints and payloads

To start using the system, navigate through the topics available in this documentation to better understand each aspect of the fund shares module.

---

# Create Financial Application

URL: /en/documentation/iaas/cotas_de_fundo/operacao_aplicacoes_financeiras

---
:::warning Attention
This feature is only available for integrations that perform the Manager role.
:::

### Request

ENDPOINT /trade_fund_quota/fund_class/FUND_CLASS_KEY/financial_application
MÉTODO POST
STATUS 201

```json title='Request Body'
{
  "issuance_serie_key": "UUID",
  "source_account_key": "UUID",
  "amount": 0.00,
  "quotation_date": "YYYY-MM-DD",
  "payment_method": "string"
}
```

:::note **Attention**.
Whenever the operation is in a series where "payment_type" is "automatic_debit" (usually clearing funds), it is necessary to send the source_account_key.

This operation will not result in an actual application, only in creating expectations and transferring to the account under your ownership so that the operation can be carried out subsequently.

You can retrieve this key through the endpoint: [`Recuperando Informações da Conta`](/documentation/iaas/visibildade_de_caixa/get_accounts)
Where the source_account_key is the account_key of the institution where you wish to make the application.

Otherwise, do not send this field.
:::

### Body params
| Field                | Type   | Description                                      | Required |
| -------------------- | ------ | ------------------------------------------------ | -------- |
| `issuance_serie_key` | string | Unique identification key for the issuance series | Yes      |
| `amount`             | float  | Application amount                               | Yes      |
| `source_account_key` | string | Key of the destination bank account for resources | No       |
| `quotation_date`     | string | Quotation date in `YYYY-MM-DD` format           | No       |
| `payment_method`     | string | Payment method (`wire_transfer`, `pix`)          | No       |

### Response
Response Body

```json
{
"amount": 0.00,
"financial_application_key": "UUID",
"asset_key": "UUID",
"quotation_date": "YYYY-MM-DD",
"status": "confirmed",
"issuance_serie": {
    "issuance_serie_key": "UUID",
    "name": "Invested Issuance Serie Name",
    "subclass_name": "Invested Sub Class Name",
    "serie": 1,
    "quota_calculation_method": "quota_value",
    "internal_code": "Internal Code",
    "fund_class_name": "Invested Fund Class Name",
    "fund_class_short_name": "Invested Fund Class short name",
    "fund_class_document_number": "00.000.000/0000-00",
    "minimum_share_capital": 0.0,
    "investment_category": "multi_market",
    "payment_type": "transfer",
    "account_data": {
        "account_digit": "0",
        "account_branch": "0001",
        "account_number": "12345",
        "financial_institution_code": "329",
        "financial_institution_ispb": "00000000"
    },
    "last_updated_date": "YYYY-MM-DD",
    "administrator": {
        "administrator_key": "UUID",
        "name": "Administrator Name",
        "document_number": "00.000.000/0000-00"
    },
    "operation_periods": {
        "redemption_request": {
            "payment": {
                "days": 1,
                "type": "until",
                "calendar_base": "calendar_365"
            },
            "quotation": {
                "days": 1,
                "type": "fixed",
                "calendar_base": "calendar_365"
            }
        },
        "amortization_request": {
            "payment": {
                "days": 0,
                "type": "fixed",
                "calendar_base": "workdays"
            },
            "quotation": {
                "days": 0,
                "type": "fixed",
                "calendar_base": "workdays"
            }
        },
        "financial_application": {
            "payment": {
                "days": 0,
                "type": "fixed",
                "calendar_base": "workdays"
            },
            "quotation": {
                "days": 0,
                "type": "fixed",
                "calendar_base": "workdays"
            }
        }
    },
    "isin_code": "BR000000000"
},
"fund_class": {
    "fund_class_key": "UUID",
    "name": "Fund Class Name",
    "short_name": "Fund Class Short Name",
    "document_number": "00.000.000/0000-00",
    "accounting_date": "YYYY-MM-DD",
    "distributor": {
        "name": "Distributor Name",
        "distributor_key": "UUID",
        "document_number": "00.000.000/0000-00"
    },
    "manager": {
        "manager_key": "UUID",
        "manager_name": "Manager Name",
        "document_number": "00.000.000/0000-00"
    }
}
}
```

# Approve Financial Application

---

### Request

ENDPOINT /trade_fund_quota/fund_class/FUND_CLASS_KEY/financial_application/FINANCIAL_APPLICATION_KEY
MÉTODO PUT
STATUS 202

```json title='Request Body'
{
  "status": "pending_payment"
}
```

### Body params
| Field    | Type   | Description                                                        |
| -------- | ------ | ------------------------------------------------------------------ |
| `status` | string | New status of the redemption request. See allowed values below. |

### Response
Response Body

```json
{
"amount": 0.00,
"financial_application_key": "UUID",
"asset_key": "UUID",
"quotation_date": "YYYY-MM-DD",
"status": "confirmed",
"issuance_serie": {
    "issuance_serie_key": "UUID",
    "name": "Invested Issuance Serie Name",
    "subclass_name": "Invested Sub Class Name",
    "serie": 1,
    "quota_calculation_method": "quota_value",
    "internal_code": "Internal Code",
    "fund_class_name": "Invested Fund Class Name",
    "fund_class_short_name": "Invested Fund Class short name",
    "fund_class_document_number": "00.000.000/0000-00",
    "minimum_share_capital": 0.0,
    "investment_category": "multi_market",
    "payment_type": "transfer",
    "account_data": {
        "account_digit": "0",
        "account_branch": "0001",
        "account_number": "12345",
        "financial_institution_code": "329",
        "financial_institution_ispb": "00000000"
    },
    "last_updated_date": "YYYY-MM-DD",
    "administrator": {
        "administrator_key": "UUID",
        "name": "Administrator Name",
        "document_number": "00.000.000/0000-00"
    },
    "operation_periods": {
        "redemption_request": {
            "payment": {
                "days": 1,
                "type": "until",
                "calendar_base": "calendar_365"
            },
            "quotation": {
                "days": 1,
                "type": "fixed",
                "calendar_base": "calendar_365"
            }
        },
        "amortization_request": {
            "payment": {
                "days": 0,
                "type": "fixed",
                "calendar_base": "workdays"
            },
            "quotation": {
                "days": 0,
                "type": "fixed",
                "calendar_base": "workdays"
            }
        },
        "financial_application": {
            "payment": {
                "days": 0,
                "type": "fixed",
                "calendar_base": "workdays"
            },
            "quotation": {
                "days": 0,
                "type": "fixed",
                "calendar_base": "workdays"
            }
        }
    },
    "isin_code": "BR000000000"
},
"fund_class": {
    "fund_class_key": "UUID",
    "name": "Fund Class Name",
    "short_name": "Fund Class Short Name",
    "document_number": "00.000.000/0000-00",
    "accounting_date": "YYYY-MM-DD",
    "distributor": {
        "name": "Distributor Name",
        "distributor_key": "UUID",
        "document_number": "00.000.000/0000-00"
    },
    "manager": {
        "manager_key": "UUID",
        "manager_name": "Manager Name",
        "document_number": "00.000.000/0000-00"
    }
}
}
```

# Cancel Financial Application

---

### Request

ENDPOINT /trade_fund_quota/fund_class/FUND_CLASS_KEY/financial_application/FINANCIAL_APPLICATION_KEY/cancel
MÉTODO PUT
STATUS 202

:::note **Attention**.
You can cancel an application request if it is in any of these statuses:
 - pending_manager_approval
 - pending_distributor_approval

Otherwise you will receive an error with the following code: TFQ000073
:::

### Response
Response Body

```json
{
"amount": 0.00,
"financial_application_key": "UUID",
"asset_key": "UUID",
"quotation_date": "YYYY-MM-DD",
"status": "confirmed",
"issuance_serie": {
    "issuance_serie_key": "UUID",
    "name": "Invested Issuance Serie Name",
    "subclass_name": "Invested Sub Class Name",
    "serie": 1,
    "quota_calculation_method": "quota_value",
    "internal_code": "Internal Code",
    "fund_class_name": "Invested Fund Class Name",
    "fund_class_short_name": "Invested Fund Class short name",
    "fund_class_document_number": "00.000.000/0000-00",
    "minimum_share_capital": 0.0,
    "investment_category": "multi_market",
    "payment_type": "transfer",
    "account_data": {
        "account_digit": "0",
        "account_branch": "0001",
        "account_number": "12345",
        "financial_institution_code": "329",
        "financial_institution_ispb": "00000000"
    },
    "last_updated_date": "YYYY-MM-DD",
    "administrator": {
        "administrator_key": "UUID",
        "name": "Administrator Name",
        "document_number": "00.000.000/0000-00"
    },
    "operation_periods": {
        "redemption_request": {
            "payment": {
                "days": 1,
                "type": "until",
                "calendar_base": "calendar_365"
            },
            "quotation": {
                "days": 1,
                "type": "fixed",
                "calendar_base": "calendar_365"
            }
        },
        "amortization_request": {
            "payment": {
                "days": 0,
                "type": "fixed",
                "calendar_base": "workdays"
            },
            "quotation": {
                "days": 0,
                "type": "fixed",
                "calendar_base": "workdays"
            }
        },
        "financial_application": {
            "payment": {
                "days": 0,
                "type": "fixed",
                "calendar_base": "workdays"
            },
            "quotation": {
                "days": 0,
                "type": "fixed",
                "calendar_base": "workdays"
            }
        }
    },
    "isin_code": "BR000000000"
},
"fund_class": {
    "fund_class_key": "UUID",
    "name": "Fund Class Name",
    "short_name": "Fund Class Short Name",
    "document_number": "00.000.000/0000-00",
    "accounting_date": "YYYY-MM-DD",
    "distributor": {
        "name": "Distributor Name",
        "distributor_key": "UUID",
        "document_number": "00.000.000/0000-00"
    },
    "manager": {
        "manager_key": "UUID",
        "manager_name": "Manager Name",
        "document_number": "00.000.000/0000-00"
    }
}
}
```

---

# Create Redemption Request

URL: /en/documentation/iaas/cotas_de_fundo/operacao_resgates

---
:::warning Attention
This feature is only available for integrations that exercise the Manager role.
:::

### Request

ENDPOINT /trade_fund_quota/fund_class/FUND_CLASS_KEY/redemption_request
METHOD POST
STATUS 201

```json title='Request Body'
{
  "issuance_serie_key": "UUID",
  "external_id": "UUID",
  "amount": 0.00,
  "source_account_key": "UUID",
  "redeem_all": false
}
```

:::note **Attention**.
Whenever the operation is in a series where "payment_type" is "automatic_debit" (usually zeragem funds), you need to send the source_account_key.

This operation will not result in an actual redemption, only in creating expectations and transferring to your account for the operation to be carried out subsequently.

You can retrieve this key through the endpoint: [`Retrieving Account Information`](/documentation/iaas/visibildade_de_caixa/get_accounts)
Where the source_account_key is the account_key of the institution where you want to perform the redemption.

Otherwise, do not send this field.
:::

### Body params
| Field                | Type    | Description                                                  | Required |
| -------------------- | ------- | ------------------------------------------------------------ | -------- |
| `issuance_serie_key` | string  | Unique key of the Issuance Series                           | Yes      |
| `external_id`        | string  | Unique external identifier of the redemption request        | Yes      |
| `amount`             | float   | Gross redemption amount (ignored if `redeem_all` is `true`) | No       |
| `source_account_key` | string  | Key of the source bank account of the fund class            | No       |
| `redeem_all`         | boolean | Indicates if the redemption should be total                 | No       |

### Response
Response Body

```json
{
  "redemption_request_key": "UUID",
  "status": "confirmed",
  "quotation_date": "YYYY-MM-DD",
  "payment_date": "YYYY-MM-DD",
  "amount": 0.00,
  "issuance_serie": {
    "issuance_serie_key": "UUID",
    "name": "Issuance Serie Name",
    "subclass_name": "SUBORDINADA",
    "serie": 1,
    "quota_calculation_method": "quota_value",
    "internal_code": "Internal Code",
    "fund_class_name": "Fund Class Name",
    "fund_class_short_name": "Fund Class Short Name",
    "fund_class_document_number": "00.000.000/0000-00",
    "minimum_share_capital": 0.0,
    "investment_category": "fixed_income",
    "payment_type": "automatic_debit",
    "financial_institution_code": "341",
    "account_data": {
                "account_digit": "0",
                "account_branch": "0001",
                "account_number": "12345",
                "financial_institution_code": "329",
                "financial_institution_ispb": "00000000"
            },
    "last_updated_date": "YYYY-MM-DD",
    "administrator": {
      "administrator_key": "UUID",
      "name": "Administrator Name",
      "document_number": "00.000.000/0000-00"
    },
    "operation_periods": {
                "redemption_request": {
                    "payment": {
                        "days": 1,
                        "type": "until",
                        "calendar_base": "calendar_365"
                    },
                    "quotation": {
                        "days": 1,
                        "type": "fixed",
                        "calendar_base": "calendar_365"
                    }
                },
                "amortization_request": {
                    "payment": {
                        "days": 0,
                        "type": "fixed",
                        "calendar_base": "workdays"
                    },
                    "quotation": {
                        "days": 0,
                        "type": "fixed",
                        "calendar_base": "workdays"
                    }
                },
                "financial_application": {
                    "payment": {
                        "days": 0,
                        "type": "fixed",
                        "calendar_base": "workdays"
                    },
                    "quotation": {
                        "days": 0,
                        "type": "fixed",
                        "calendar_base": "workdays"
                    }
                }
            },
    "issuance_serie_data": {
      "name": "Issuance Serie Name",
      "serie": 1,
      "payment_type": "automatic_debit",
      "remuneration": "residual",
      "internal_code": "Internal Code",
      "subclass_name": "SUBORDINADA",
      "fund_class_name": "Fund Class Name",
      "issuance_serie_key": "UUID",
      "tax_classification": "long_term",
      "investment_category": "fixed_income",
      "fund_class_short_name": "Fund Class Short Name",
      "minimum_share_capital": 0.00,
      "quota_calculation_method": "quota_value",
      "financial_institution_code": "329",
      "fund_class_document_number": "00.000.000/0000-00",
      "administrator_document_number": "00.000.000/0000-00"
    }
  },
  "fund_class": {
    "fund_class_key": "UUID",
    "name": "Fund Class Name",
    "short_name": "Fund Class Short Name",
    "document_number": "00.000.000/0000-00",
    "accounting_date": "YYYY-MM-DD",
    "distributor": {
      "name": "Distributor Name",
      "distributor_key": "UUID",
      "document_number": "00.000.000/0000-00"
    },
    "manager": {
      "manager_key": "UUID",
      "manager_name": "Manager Name",
      "document_number": "00.000.000/0000-00"
    }
  }
}
```

# Approve a Redemption Request

---

### Request

ENDPOINT /trade_fund_quota/fund_class/FUND_CLASS_KEY/redemption_request/REDEMPTION_REQUEST_KEY
METHOD PUT
STATUS 202

```json title='Request Body'
{
  "status": "pending_external_approval"
}

```

### Body params
| Field    | Type   | Description                                                          |
| -------- | ------ | -------------------------------------------------------------------- |
| `status` | string | New status of the redemption request. See allowed values below.     |

### Response
Response Body

```json
{
  "redemption_request_key": "UUID",
  "status": "pending_external_approval",
  "quotation_date": "YYYY-MM-DD",
  "payment_date": "YYYY-MM-DD",
  "amount": 0.00,
  "issuance_serie": {
    "issuance_serie_key": "UUID",
    "name": "Issuance Serie Name",
    "subclass_name": "SUBORDINADA",
    "serie": 1,
    "quota_calculation_method": "quota_value",
    "internal_code": "Internal Code",
    "fund_class_name": "Fund Class Name",
    "fund_class_short_name": "Fund Class Short Name",
    "fund_class_document_number": "00.000.000/0000-00",
    "minimum_share_capital": 0.0,
    "investment_category": "fixed_income",
    "payment_type": "automatic_debit",
    "financial_institution_code": "341",
    "account_data": {
                "account_digit": "0",
                "account_branch": "0001",
                "account_number": "12345",
                "financial_institution_code": "329",
                "financial_institution_ispb": "00000000"
            },
    "last_updated_date": "YYYY-MM-DD",
    "administrator": {
      "administrator_key": "UUID",
      "name": "Administrator Name",
      "document_number": "00.000.000/0000-00"
    },
    "operation_periods": {
                "redemption_request": {
                    "payment": {
                        "days": 1,
                        "type": "until",
                        "calendar_base": "calendar_365"
                    },
                    "quotation": {
                        "days": 1,
                        "type": "fixed",
                        "calendar_base": "calendar_365"
                    }
                },
                "amortization_request": {
                    "payment": {
                        "days": 0,
                        "type": "fixed",
                        "calendar_base": "workdays"
                    },
                    "quotation": {
                        "days": 0,
                        "type": "fixed",
                        "calendar_base": "workdays"
                    }
                },
                "financial_application": {
                    "payment": {
                        "days": 0,
                        "type": "fixed",
                        "calendar_base": "workdays"
                    },
                    "quotation": {
                        "days": 0,
                        "type": "fixed",
                        "calendar_base": "workdays"
                    }
                }
            },
    "issuance_serie_data": {
      "name": "Issuance Serie Name",
      "serie": 1,
      "payment_type": "automatic_debit",
      "remuneration": "residual",
      "internal_code": "Internal Code",
      "subclass_name": "SUBORDINADA",
      "fund_class_name": "Fund Class Name",
      "issuance_serie_key": "UUID",
      "tax_classification": "long_term",
      "investment_category": "fixed_income",
      "fund_class_short_name": "Fund Class Short Name",
      "minimum_share_capital": 0.00,
      "quota_calculation_method": "quota_value",
      "financial_institution_code": "329",
      "fund_class_document_number": "00.000.000/0000-00",
      "administrator_document_number": "00.000.000/0000-00"
    }
  },
  "fund_class": {
    "fund_class_key": "UUID",
    "name": "Fund Class Name",
    "short_name": "Fund Class Short Name",
    "document_number": "00.000.000/0000-00",
    "accounting_date": "YYYY-MM-DD",
    "distributor": {
      "name": "Distributor Name",
      "distributor_key": "UUID",
      "document_number": "00.000.000/0000-00"
    },
    "manager": {
      "manager_key": "UUID",
      "manager_name": "Manager Name",
      "document_number": "00.000.000/0000-00"
    }
  }
}
```

# Cancel a Redemption Request

---

### Request

ENDPOINT /trade_fund_quota/fund_class/FUND_CLASS_KEY/redemption_request/REDEMPTION_REQUEST_KEY/cancel
METHOD PUT
STATUS 202

:::note **Attention**.
You can cancel a redemption request if it is in one of these statuses:
 - pending_manager_approval
 - pending_distributor_approval

Otherwise you will receive an error with the following code: TFQ000078
:::

### Response
Response Body

```json
{
  "redemption_request_key": "UUID",
  "status": "canceled",
  "quotation_date": "YYYY-MM-DD",
  "payment_date": "YYYY-MM-DD",
  "amount": 0.00,
  "issuance_serie": {
    "issuance_serie_key": "UUID",
    "name": "Issuance Serie Name",
    "subclass_name": "SUBORDINADA",
    "serie": 1,
    "quota_calculation_method": "quota_value",
    "internal_code": "Internal Code",
    "fund_class_name": "Fund Class Name",
    "fund_class_short_name": "Fund Class Short Name",
    "fund_class_document_number": "00.000.000/0000-00",
    "minimum_share_capital": 0.0,
    "investment_category": "fixed_income",
    "payment_type": "automatic_debit",
    "financial_institution_code": "341",
    "account_data": {
                "account_digit": "0",
                "account_branch": "0001",
                "account_number": "12345",
                "financial_institution_code": "329",
                "financial_institution_ispb": "00000000"
            },
    "last_updated_date": "YYYY-MM-DD",
    "administrator": {
      "administrator_key": "UUID",
      "name": "Administrator Name",
      "document_number": "00.000.000/0000-00"
    },
    "operation_periods": {
                "redemption_request": {
                    "payment": {
                        "days": 1,
                        "type": "until",
                        "calendar_base": "calendar_365"
                    },
                    "quotation": {
                        "days": 1,
                        "type": "fixed",
                        "calendar_base": "calendar_365"
                    }
                },
                "amortization_request": {
                    "payment": {
                        "days": 0,
                        "type": "fixed",
                        "calendar_base": "workdays"
                    },
                    "quotation": {
                        "days": 0,
                        "type": "fixed",
                        "calendar_base": "workdays"
                    }
                },
                "financial_application": {
                    "payment": {
                        "days": 0,
                        "type": "fixed",
                        "calendar_base": "workdays"
                    },
                    "quotation": {
                        "days": 0,
                        "type": "fixed",
                        "calendar_base": "workdays"
                    }
                }
            },
    "issuance_serie_data": {
      "name": "Issuance Serie Name",
      "serie": 1,
      "payment_type": "automatic_debit",
      "remuneration": "residual",
      "internal_code": "Internal Code",
      "subclass_name": "SUBORDINADA",
      "fund_class_name": "Fund Class Name",
      "issuance_serie_key": "UUID",
      "tax_classification": "long_term",
      "investment_category": "fixed_income",
      "fund_class_short_name": "Fund Class Short Name",
      "minimum_share_capital": 0.00,
      "quota_calculation_method": "quota_value",
      "financial_institution_code": "329",
      "fund_class_document_number": "00.000.000/0000-00",
      "administrator_document_number": "00.000.000/0000-00"
    }
  },
  "fund_class": {
    "fund_class_key": "UUID",
    "name": "Fund Class Name",
    "short_name": "Fund Class Short Name",
    "document_number": "00.000.000/0000-00",
    "accounting_date": "YYYY-MM-DD",
    "distributor": {
      "name": "Distributor Name",
      "distributor_key": "UUID",
      "document_number": "00.000.000/0000-00"
    },
    "manager": {
      "manager_key": "UUID",
      "manager_name": "Manager Name",
      "document_number": "00.000.000/0000-00"
    }
  }
}
```

---

# Consulta de despesas consolidadas

URL: /en/documentation/iaas/despesas/despesa_consolidada/consulta_despesas

Endpoints para consultar as despesas de uma classe de fundo. Existem dois modos de consulta: a **listagem paginada** de todas as despesas de uma classe de fundo, e a **consulta individual** de uma despesa específica.

:::tip Quando utilizar
Utilize estes endpoints para acompanhar o status das despesas cadastradas, verificar valores provisionados e consolidados, e consultar os dados de pagamento de cada despesa.
:::

## Listagem de despesas

Retorna a lista paginada de todas as despesas de uma classe de fundo, com suporte a diversos filtros.

### Request

ENDPOINT /expense/fund_class/{fund_class_key}/expenses
MÉTODO GET

### Query params

| Parâmetro | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `page` | integer | opcional | Número da página (começa em 0). Padrão: `0`. |
| `limit` | integer | opcional | Quantidade de registros por página. Mínimo: `0`. Máximo: `100`. Padrão: `10`. |
| `reference_date` | string | opcional | Filtra despesas pela data de referência exata, no formato `YYYY-MM-DD`. |
| `from_end_deferral_date` | string | opcional | Filtra despesas com data de encerramento de diferimento maior ou igual à data informada, no formato `YYYY-MM-DD`. |
| `to_end_deferral_date` | string | opcional | Filtra despesas com data de encerramento de diferimento menor ou igual à data informada, no formato `YYYY-MM-DD`. |
| `status` | string | opcional | Filtra pelo status da despesa. Aceita múltiplos valores separados por vírgula (ex: `paid,consolidated`). Veja [enumeradores de `status`](#enumeradores-de-status). |
| `expense_type` | string | opcional | Filtra pelo tipo da despesa. Aceita múltiplos valores separados por vírgula (ex: `management_tax,custody_tax`). Veja [enumeradores de `type`](#enumeradores-de-type). |
| `expense_status_to_ignore` | string | opcional | Exclui da listagem despesas com o status informado. |
| `expense_type_to_ignore` | string | opcional | Exclui da listagem despesas com o tipo informado. |
| `ignore_paid_on_future` | boolean | opcional | Quando `true`, exclui despesas que já foram pagas mas com data de confirmação posterior à data de referência. |

```python title="Exemplo de chamada"
GET /expense/fund_class/{fund_class_key}/expenses?page=0&limit=10&status=consolidated,paid
```

### Response

STATUS 200

```json title="Response Body"
{
    "data": [
        {
            "expense_key": "3571e292-3a83-4011-904d-20ee963022ef",
            "fund_class": {
                "name": "Fundo de Investimento XYZ",
                "manager": {
                    "name": "Gestora ABC",
                    "manager_key": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
                    "document_number": "12.345.678/0001-90"
                },
                "fund_class_key": "c1d2e3f4-a5b6-7890-abcd-ef1234567890",
                "document_number": "98.765.432/0001-10",
                "accounting_date": "2025-06-10"
            },
            "status": "consolidated",
            "type": "management_tax",
            "reference_date": "2025-06-10",
            "start_deferral_date": "2025-06-01",
            "end_deferral_date": "2025-06-30",
            "consolidated_value": 1500.00,
            "provisioned_value": 1500.00,
            "recognized_value": 1500.00,
            "payment": null,
            "expense_datetime": "2025-06-01T00:00:00Z",
            "description": "Taxa de gestão referente ao mês de junho/2025",
            "payment_method": "transfer",
            "payment_date": "2025-06-30",
            "payment_confirmation": {
                "confirmation_date": "2025-06-30"
            }
        }
    ],
    "limit": 10,
    "page": 0,
    "is_last_page": true
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `data` | array | Lista de objetos de despesa. Veja [Atributos de cada despesa](#atributos-de-cada-despesa-objetos-dentro-de-data). |
| `page` | integer | Número da página atual. |
| `limit` | integer | Quantidade de registros por página. |
| `is_last_page` | boolean | Indica se esta é a última página de resultados. |

#### Atributos de cada despesa (objetos dentro de `data`)

| Campo | Tipo | Descrição |
|---|---|---|
| `expense_key` | string | Identificador único da despesa (UUID). |
| `fund_class` | object | Dados da classe de fundo à qual a despesa pertence. Veja [Atributos de `fund_class`](#atributos-de-fund_class). |
| `status` | string | Status atual da despesa. Veja [enumeradores de `status`](#enumeradores-de-status). |
| `type` | string | Tipo da despesa. Veja [enumeradores de `type`](#enumeradores-de-type). |
| `reference_date` | string | Data de referência da despesa no formato `YYYY-MM-DD`. |
| `start_deferral_date` | string | Data de início do diferimento no formato `YYYY-MM-DD`. |
| `end_deferral_date` | string | Data de encerramento do diferimento no formato `YYYY-MM-DD`. |
| `consolidated_value` | number | Valor consolidado da despesa. Pode ser `null` quando a despesa ainda não foi consolidada. |
| `provisioned_value` | number | Valor provisionado da despesa. Pode ser `null` quando ainda não há provisão. |
| `recognized_value` | number | Valor reconhecido da despesa. |
| `payment` | object | Dados do pagamento associado à despesa. Pode ser `null` quando não há pagamento vinculado. |
| `expense_datetime` | string | Data e hora de criação da despesa no formato ISO 8601 (ex: `2025-06-01T00:00:00Z`). |
| `description` | string | Descrição textual da despesa. |
| `payment_method` | string | Método de pagamento da despesa. Veja [enumeradores de `payment_method`](#enumeradores-de-payment_method). |
| `payment_date` | string | Data de pagamento no formato `YYYY-MM-DD`. Presente somente quando a despesa possui data de pagamento definida. |
| `payment_confirmation` | object | Dados de confirmação de pagamento. Presente somente quando o pagamento foi confirmado. Veja [Atributos de `payment_confirmation`](#atributos-de-payment_confirmation). |

#### Atributos de `fund_class`

| Campo | Tipo | Descrição |
|---|---|---|
| `name` | string | Nome da classe de fundo. |
| `fund_class_key` | string | Identificador único da classe de fundo (UUID). |
| `document_number` | string | CNPJ da classe de fundo. |
| `accounting_date` | string | Data de contabilização da classe de fundo no formato `YYYY-MM-DD`. |
| `manager` | object | Dados do gestor responsável. Veja [Atributos de `manager`](#atributos-de-manager). |

#### Atributos de `manager`

| Campo | Tipo | Descrição |
|---|---|---|
| `name` | string | Nome do gestor. |
| `manager_key` | string | Identificador único do gestor (UUID). |
| `document_number` | string | CNPJ do gestor. |

#### Atributos de `payment_confirmation`

| Campo | Tipo | Descrição |
|---|---|---|
| `confirmation_date` | string | Data de confirmação do pagamento no formato `YYYY-MM-DD`. |

---

## Consulta de despesa específica

Retorna os dados completos de uma despesa específica de uma classe de fundo.

### Request

ENDPOINT /expense/fund_class/{fund_class_key}/expense/{expense_key}
MÉTODO GET

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `fund_class_key` | string | Identificador único (UUID) da classe de fundo à qual a despesa pertence. |
| `expense_key` | string | Identificador único (UUID) da despesa a ser consultada. |

```python title="Exemplo de chamada"
GET /expense/fund_class/{fund_class_key}/expense/{expense_key}
```

### Response

STATUS 200

```json title="Response Body"
{
    "expense_key": "3571e292-3a83-4011-904d-20ee963022ef",
    "fund_class": {
        "name": "Fundo de Investimento XYZ",
        "manager": {
            "name": "Gestora ABC",
            "manager_key": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
            "document_number": "12.345.678/0001-90"
        },
        "fund_class_key": "c1d2e3f4-a5b6-7890-abcd-ef1234567890",
        "document_number": "98.765.432/0001-10",
        "accounting_date": "2025-06-10"
    },
    "status": "consolidated",
    "type": "management_tax",
    "reference_date": "2025-06-10",
    "start_deferral_date": "2025-06-01",
    "end_deferral_date": "2025-06-30",
    "consolidated_value": 1500.00,
    "provisioned_value": 1500.00,
    "recognized_value": 1500.00,
    "payment": null,
    "expense_datetime": "2025-06-01T00:00:00Z",
    "description": "Taxa de gestão referente ao mês de junho/2025",
    "payment_method": "transfer",
    "payment_date": "2025-06-30",
    "payment_confirmation": {
        "confirmation_date": "2025-06-30"
    }
}
```

### Atributos da resposta

A resposta possui a mesma estrutura de cada objeto do array `data` retornado pela [listagem de despesas](#atributos-de-cada-despesa-objetos-dentro-de-data).

---

## Possíveis erros

STATUS 404

**Despesa não encontrada**

O `expense_key` informado não corresponde a nenhuma despesa cadastrada para esta classe de fundo. Verifique se os identificadores estão corretos.

```json
{
  "title": "Expense not Found",
  "description": "The Expense with key {expense_key} was not found in Fund Class with key {fund_class_key}.",
  "translation": "A Despesa com a chave {expense_key} nao foi encontrada na classe de fundos com a chave {fund_class_key}.",
  "code": "EXP000010"
}
```

---

## Enumeradores de `status`

| Valor | Descrição |
|---|---|
| `created` | Despesa criada, ainda não iniciou o processo de provisionamento. |
| `in_provision` | Despesa em processo de provisionamento diário. |
| `on_demand_recognition` | Despesa com reconhecimento sob demanda (manual). |
| `consolidated` | Despesa consolidada — valor total reconhecido e pronto para pagamento. |
| `paid` | Despesa paga. |
| `canceled` | Despesa cancelada. |
| `completed` | Despesa encerrada. |

## Enumeradores de `type`

| Valor | Descrição |
|---|---|
| `administration_tax` | Taxa de administração. |
| `management_tax` | Taxa de gestão. |
| `performance_fee` | Taxa de performance. |
| `custody_tax` | Taxa de custódia. |
| `distribution_fee` | Taxa de distribuição. |
| `consulting_fee` | Taxa de consultoria. |
| `audit_tax` | Taxa de auditoria. |
| `cvm_tax` | Taxa CVM. |
| `cetip_tax` | Taxa CETIP. |
| `anbima_tax` | Taxa ANBIMA. |
| `selic_tax` | Taxa SELIC. |
| `notary` | Cartório. |
| `bank_account` | Conta bancária. |
| `bankslip_fee` | Taxa de boleto. |
| `sale_commission_tax` | Taxa de comissão de venda. |
| `certifier_fee` | Taxa de certificadora. |
| `rating_agency_fee` | Taxa de agência de rating. |
| `lawyer_fee` | Honorários advocatícios. |
| `bookkeeping_fee` | Taxa de escrituração. |
| `insurance_fee` | Taxa de seguro. |
| `collection_agent_fee` | Taxa de agente cobrador. |
| `servicing_fee` | Taxa de serviços. |
| `fund_structuring_fee` | Taxa de estruturação do fundo. |
| `credit_rights_registration_fee` | Taxa de registro de direitos creditórios. |
| `origination_fee` | Taxa de originação. |

## Enumeradores de `payment_method`

| Valor | Descrição |
|---|---|
| `transfer` | Transferência bancária. |
| `automatic_debit` | Débito automático. |
| `bank_slip` | Boleto bancário. |

---

# Atualização do Contrato

URL: /en/documentation/iaas/despesas/submissao_despesa/contrato/atualizacao

Edite os dados de um contrato enquanto ele ainda estiver no status `created`. Após a [submissão](/documentation/iaas/despesas/submissao_despesa/contrato/submissao), o contrato não pode mais ser alterado.

:::info
Somente contratos com status `created` podem ser atualizados.
:::

## Request

ENDPOINT /expense_submission/fund_class/{fund_class_key}/contract/{contract_key}
MÉTODO PUT

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `fund_class_key` | string | Chave única do fundo (UUID) |
| `contract_key` | string | Chave única do contrato |

```json title="Request Body"
{
    "name": "Contrato de Auditoria - Exercício 2026 (revisado)",
    "vendor_key": "3571e292-3a83-4011-904d-20ee963022ef",
    "expense_type": "audit_tax",
    "submission_nature": "manual_submission",
    "contract_value": 60000.00,
    "validity_date": "2026-12-31"
}
```

### Atributos do body

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `name` | string | opcional | Novo nome do contrato. Máximo de 255 caracteres. |
| `vendor_key` | string | opcional | Nova chave do fornecedor. |
| `expense_type` | string | opcional | Novo tipo de despesa. Ver [Tipos de despesa](/documentation/iaas/despesas/submissao_despesa/contrato/criacao#tipos-de-despesa). |
| `submission_nature` | string | opcional | Nova natureza de submissão: `manual_submission` ou `rebate`. |
| `contract_value` | number | opcional | Novo valor máximo do contrato. Mínimo: `0`. |
| `validity_date` | string | opcional | Nova data de validade no formato `YYYY-MM-DD`. |

## Response

STATUS 200

```json title="Response Body"
{
    "name": "Contrato de Auditoria - Exercício 2026 (revisado)",
    "contract_key": "contrato-auditoria-2026",
    "fund_class": {
        "name": "FUNDO DE INVESTIMENTO EM DIREITOS CREDITÓRIOS EXEMPLO",
        "manager": {
            "name": "EXEMPLO GESTORA LTDA",
            "manager_key": "a7498c6c-1893-42ec-a8f3-bc6ad0c6b52c",
            "document_number": "45.585.471/0001-47"
        },
        "fund_class_key": "4b8377d0-58ec-479f-8ee9-9f963d5c47ad",
        "document_number": "60.910.091/0001-24"
    },
    "vendor": {
        "vendor_key": "3571e292-3a83-4011-904d-20ee963022ef",
        "name": "AUDITORES EXEMPLO S.A.",
        "document_number": "12.345.678/0001-90",
        "requires_invoice": "True"
    },
    "expense_type": "audit_tax",
    "status": "created",
    "contract_value": 60000.00,
    "validity_date": "2026-12-31",
    "submission_nature": "manual_submission"
}
```

Os atributos da resposta seguem a mesma estrutura da [criação do contrato](/documentation/iaas/despesas/submissao_despesa/contrato/criacao#atributos-da-resposta).

## Possíveis erros

STATUS 404

**Contrato não encontrado**

O par `fund_class_key` + `contract_key` não corresponde a nenhum contrato cadastrado.

```json
{
  "title": "Contract Not Found",
  "description": "Contract with key {contract_key} and fund class {fund_class_key} was not found.",
  "translation": "O contrato com chave {contract_key} do fundo {fund_class_key} não foi encontrado.",
  "code": "ESB000011"
}
```

STATUS 400

**Contrato não pode ser editado neste status**

O contrato não está no status `created` e não pode ser editado.

```json
{
  "title": "Cannot Update Contract In This Status",
  "description": "Contract {contract_key} cannot be updated with status {current_status}.",
  "translation": "O contrato {contract_key} não pode ser atualizado com o status {current_status}.",
  "code": "ESB000022"
}
```

## Próximos passos

1. **[Submeter o contrato](/documentation/iaas/despesas/submissao_despesa/contrato/submissao)** — envie o contrato para análise quando estiver pronto.
2. **[Cancelar o contrato](/documentation/iaas/despesas/submissao_despesa/contrato/cancelamento)** — cancele o contrato caso não seja mais necessário.

---

# Cancelamento do Contrato

URL: /en/documentation/iaas/despesas/submissao_despesa/contrato/cancelamento

Cancele um contrato que não seja mais necessário. O cancelamento é uma operação irreversível.

:::caution Atenção
Um contrato cancelado não pode ser reativado. Despesas que estejam sob um contrato cancelado também são impactadas. Certifique-se de que o cancelamento é realmente necessário antes de prosseguir.
:::

## Request

ENDPOINT /expense_submission/fund_class/{fund_class_key}/contract/{contract_key}/cancel
MÉTODO PUT

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `fund_class_key` | string | Chave única do fundo (UUID) |
| `contract_key` | string | Chave única do contrato |

Este endpoint não requer body na requisição.

## Response

STATUS 200

```json title="Response Body"
{
    "name": "Contrato de Auditoria - Exercício 2026",
    "contract_key": "contrato-auditoria-2026",
    "fund_class": {
        "name": "FUNDO DE INVESTIMENTO EM DIREITOS CREDITÓRIOS EXEMPLO",
        "manager": {
            "name": "EXEMPLO GESTORA LTDA",
            "manager_key": "a7498c6c-1893-42ec-a8f3-bc6ad0c6b52c",
            "document_number": "45.585.471/0001-47"
        },
        "fund_class_key": "4b8377d0-58ec-479f-8ee9-9f963d5c47ad",
        "document_number": "60.910.091/0001-24"
    },
    "vendor": {
        "vendor_key": "3571e292-3a83-4011-904d-20ee963022ef",
        "name": "AUDITORES EXEMPLO S.A.",
        "document_number": "12.345.678/0001-90",
        "requires_invoice": "True"
    },
    "expense_type": "audit_tax",
    "status": "canceled",
    "contract_value": 50000.00,
    "validity_date": "2026-12-31",
    "submission_nature": "manual_submission"
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `status` | string | Novo status do contrato. Sempre retorna `canceled` após o cancelamento bem-sucedido. |

Os demais campos seguem a mesma estrutura da [criação do contrato](/documentation/iaas/despesas/submissao_despesa/contrato/criacao#atributos-da-resposta).

## Possíveis erros

STATUS 404

**Contrato não encontrado**

O par `fund_class_key` + `contract_key` não corresponde a nenhum contrato cadastrado.

```json
{
  "title": "Contract Not Found",
  "description": "Contract with key {contract_key} and fund class {fund_class_key} was not found.",
  "translation": "O contrato com chave {contract_key} do fundo {fund_class_key} não foi encontrado.",
  "code": "ESB000011"
}
```

STATUS 400

**Contrato já em status final**

O contrato já está em um status final (`approved` ou `rejected`) e não pode ser cancelado.

```json
{
  "title": "Already In Final Contract Status",
  "description": "The contract {contract_key} is already in a final status: {current_status}.",
  "translation": "O contrato {contract_key} já está em um status final: {current_status}.",
  "code": "ESB000020"
}
```

---

# Criação do Contrato

URL: /en/documentation/iaas/despesas/submissao_despesa/contrato/criacao

Este é o **primeiro passo** do fluxo de submissão de despesas pelo agente integrador. O contrato define a relação comercial entre o fundo e um fornecedor, estabelecendo o tipo de despesa e as condições de pagamento.

:::info Pré-requisitos
Antes de criar um contrato, você precisa ter em mãos:
- `fund_class_key` — chave única do fundo, fornecida pela QI Tech
- `vendor_key` — chave do fornecedor cadastrado. Consulte a [listagem de fornecedores](/documentation/iaas/despesas/submissao_despesa/fornecedor/listagem) para obtê-la

Para mais detalhes sobre o fluxo completo, consulte a [página de introdução](/documentation/iaas/despesas/submissao_despesa/inicio).
:::

:::caution Atenção
O campo `submission_nature = rebate` só pode ser utilizado em conjunto com `expense_type = distribution_fee`. Para todos os demais tipos de despesa, use `submission_nature = manual_submission`.
:::

## Request

ENDPOINT /expense_submission/fund_class/{fund_class_key}/contract
MÉTODO POST

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `fund_class_key` | string | Chave única do fundo (UUID) |

```json title="Request Body"
{
    "name": "Contrato de Auditoria - Exercício 2026",
    "vendor_key": "3571e292-3a83-4011-904d-20ee963022ef",
    "expense_type": "audit_tax",
    "submission_nature": "manual_submission",
    "contract_value": 50000.00,
    "validity_date": "2026-12-31",
    "contract_key": "contrato-auditoria-2026"
}
```

### Atributos do body

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `name` | string | obrigatório | Nome do contrato. Máximo de 255 caracteres. |
| `vendor_key` | string | obrigatório | Chave única do fornecedor (máximo 255 caracteres). |
| `expense_type` | string | obrigatório | Tipo de despesa. Ver [Tipos de despesa](#tipos-de-despesa). |
| `submission_nature` | string | obrigatório | Natureza de submissão: `manual_submission` ou `rebate`. |
| `contract_value` | number | opcional | Valor máximo do contrato. Quando informado, a soma das despesas não pode exceder este valor. Mínimo: `0`. |
| `validity_date` | string | opcional | Data de validade do contrato no formato `YYYY-MM-DD`. Após esta data, nenhuma nova despesa pode ser criada. |
| `contract_key` | string | opcional | Identificador personalizado do contrato no sistema do parceiro. Máximo de 255 caracteres. Quando não informado, um UUID é gerado automaticamente. |

### Tipos de despesa

| Valor | Descrição |
|---|---|
| `cvm_tax` | Taxa CVM |
| `cetip_tax` | Taxa CETIP |
| `anbima_tax` | Taxa ANBIMA |
| `notary` | Cartório |
| `audit_tax` | Taxa de auditoria |
| `administration_tax` | Taxa de administração |
| `management_tax` | Taxa de gestão |
| `bank_account` | Conta bancária |
| `selic_tax` | Taxa SELIC |
| `consulting_fee` | Honorários de consultoria |
| `custody_tax` | Taxa de custódia |
| `performance_fee` | Taxa de performance |
| `bankslip_fee` | Taxa de boleto |
| `sale_commission_tax` | Comissão de venda |
| `certifier_fee` | Honorários de certificador |
| `rating_agency_fee` | Taxa de agência de rating |
| `lawyer_fee` | Honorários advocatícios |
| `bookkeeping_fee` | Taxa de escrituração |
| `distribution_fee` | Taxa de distribuição |
| `insurance_fee` | Taxa de seguro |
| `collection_agent_fee` | Honorários de agente de cobrança |
| `servicing_fee` | Taxa de serviços |
| `fund_structuring_fee` | Taxa de estruturação do fundo |
| `credit_rights_registration_fee` | Taxa de registro de direitos creditórios |
| `origination_fee` | Taxa de originação |

## Response

STATUS 201

```json title="Response Body"
{
    "name": "Contrato de Auditoria - Exercício 2026",
    "contract_key": "contrato-auditoria-2026",
    "fund_class": {
        "name": "FUNDO DE INVESTIMENTO EM DIREITOS CREDITÓRIOS EXEMPLO",
        "manager": {
            "name": "EXEMPLO GESTORA LTDA",
            "manager_key": "a7498c6c-1893-42ec-a8f3-bc6ad0c6b52c",
            "document_number": "45.585.471/0001-47"
        },
        "fund_class_key": "4b8377d0-58ec-479f-8ee9-9f963d5c47ad",
        "document_number": "60.910.091/0001-24"
    },
    "vendor": {
        "vendor_key": "3571e292-3a83-4011-904d-20ee963022ef",
        "name": "AUDITORES EXEMPLO S.A.",
        "document_number": "12.345.678/0001-90",
        "requires_invoice": "True"
    },
    "expense_type": "audit_tax",
    "status": "created",
    "contract_value": 50000.00,
    "validity_date": "2026-12-31",
    "submission_nature": "manual_submission"
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `name` | string | Nome do contrato. |
| `contract_key` | string | Chave única do contrato. Guarde este valor para as próximas etapas. |
| `fund_class` | object | Dados do fundo associado. Veja [Atributos de `fund_class`](#atributos-de-fund_class). |
| `vendor` | object | Dados do fornecedor. Veja [Atributos de `vendor`](#atributos-de-vendor). |
| `expense_type` | string | Tipo de despesa do contrato. |
| `status` | string | Status inicial do contrato. Sempre retorna `created`. |
| `contract_value` | number | Valor máximo do contrato, ou `null` quando não informado. |
| `validity_date` | string | Data de validade no formato `YYYY-MM-DD`, ou `null` quando não informada. |
| `submission_nature` | string | Natureza de submissão do contrato. |

#### Atributos de `fund_class`

| Campo | Tipo | Descrição |
|---|---|---|
| `name` | string | Nome do fundo. |
| `manager` | object | Dados do gestor do fundo. |
| `manager.name` | string | Nome do gestor. |
| `manager.manager_key` | string | Chave única do gestor (UUID). |
| `manager.document_number` | string | CNPJ do gestor. |
| `fund_class_key` | string | Chave única do fundo (UUID). |
| `document_number` | string | CNPJ do fundo. |

#### Atributos de `vendor`

| Campo | Tipo | Descrição |
|---|---|---|
| `vendor_key` | string | Chave única do fornecedor. |
| `name` | string | Nome do fornecedor. |
| `document_number` | string | CPF ou CNPJ do fornecedor. |
| `requires_invoice` | string | Indica se o fornecedor exige nota fiscal (`"True"` ou `"False"`). |

## Possíveis erros

STATUS 404

**Fundo não encontrado**

A `fund_class_key` informada na URL não corresponde a nenhum fundo cadastrado.

```json
{
  "title": "Fund Class Not Found",
  "description": "Fund Class with key {fund_class_key} was not found.",
  "translation": "O Fundo com chave {fund_class_key} nao foi encontrado.",
  "code": "ESB000005"
}
```

**Fornecedor não encontrado**

A `vendor_key` informada no body não corresponde a nenhum fornecedor cadastrado.

```json
{
  "title": "Vendor Not Found",
  "description": "Vendor with key {vendor_key} was not found.",
  "translation": "O fornecedor com a chave {vendor_key} nao foi encontrado.",
  "code": "ESB000008"
}
```

STATUS 409

**Contract key duplicada**

Já existe um contrato com a `contract_key` informada neste fundo. Use um identificador diferente ou omita o campo para gerar um UUID automaticamente.

```json
{
  "title": "Contract Key Already Exists",
  "description": "A Contract with key {contract_key} already exists.",
  "translation": "Um contrato com a chave {contract_key} já existe.",
  "code": "ESB000012"
}
```

STATUS 400

**Tipo de despesa incompatível com a natureza de submissão**

O valor `rebate` em `submission_nature` só é válido quando `expense_type` é `distribution_fee`.

```json
{
  "title": "Invalid Expense Type",
  "description": "The expense type {expense_type} is not valid for submission nature {submission_nature}.",
  "translation": "O tipo de despesa {expense_type} não é válido para a natureza de submissão {submission_nature}.",
  "code": "ESB000031"
}
```

## Próximos passos

Após criar o contrato, o fluxo continua com:

1. **[Submissão do contrato](/documentation/iaas/despesas/submissao_despesa/contrato/submissao)** — envie o contrato para análise e aprovação pela QI Tech.
2. **[Atualização do contrato](/documentation/iaas/despesas/submissao_despesa/contrato/atualizacao)** — edite os dados do contrato enquanto ele ainda estiver em status `created`.

---

# Listagem de Contratos

URL: /en/documentation/iaas/despesas/submissao_despesa/contrato/listagem

Liste os contratos de um fundo com filtros opcionais por tipo de despesa, status ou natureza de submissão.

## Request

ENDPOINT /expense_submission/fund_class/{fund_class_key}/contracts
MÉTODO GET

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `fund_class_key` | string | Chave única do fundo (UUID) |

### Query params

| Parâmetro | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `expense_type` | string | opcional | Filtra por tipo de despesa. Ver [tipos de despesa](/documentation/iaas/despesas/submissao_despesa/contrato/criacao#tipos-de-despesa). |
| `status` | string | opcional | Filtra por status do contrato (`created`, `pending_adm_approval`, `approved`, `rejected`, `canceled`). |
| `submission_nature` | string | opcional | Filtra por natureza: `manual_submission` ou `rebate`. |
| `limit` | integer | opcional | Número de itens por página. Mínimo: `1`. Máximo: `1000`. Padrão: `10`. |
| `page` | integer | opcional | Número da página (base zero). Padrão: `0`. |

## Response

STATUS 200

```json title="Response Body"
{
    "data": [
        {
            "name": "Contrato de Auditoria - Exercício 2026",
            "contract_key": "contrato-auditoria-2026",
            "fund_class": {
                "name": "FUNDO DE INVESTIMENTO EM DIREITOS CREDITÓRIOS EXEMPLO",
                "manager": {
                    "name": "EXEMPLO GESTORA LTDA",
                    "manager_key": "a7498c6c-1893-42ec-a8f3-bc6ad0c6b52c",
                    "document_number": "45.585.471/0001-47"
                },
                "fund_class_key": "4b8377d0-58ec-479f-8ee9-9f963d5c47ad",
                "document_number": "60.910.091/0001-24"
            },
            "vendor": {
                "vendor_key": "3571e292-3a83-4011-904d-20ee963022ef",
                "name": "AUDITORES EXEMPLO S.A.",
                "document_number": "12.345.678/0001-90",
                "requires_invoice": "True"
            },
            "expense_type": "audit_tax",
            "status": "approved",
            "contract_value": 50000.00,
            "validity_date": "2026-12-31",
            "submission_nature": "manual_submission"
        }
    ],
    "limit": 10,
    "page": 0,
    "is_last_page": true
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `data` | array | Lista de contratos. Cada item segue a estrutura da [consulta individual](/documentation/iaas/despesas/submissao_despesa/contrato/recuperacao). |
| `limit` | integer | Número de itens por página utilizado na consulta. |
| `page` | integer | Número da página atual. |
| `is_last_page` | boolean | Indica se esta é a última página de resultados. |

## Possíveis erros

STATUS 404

**Fundo não encontrado**

A `fund_class_key` informada na URL não corresponde a nenhum fundo cadastrado.

```json
{
  "title": "Fund Class Not Found",
  "description": "Fund Class with key {fund_class_key} was not found.",
  "translation": "O Fundo com chave {fund_class_key} nao foi encontrado.",
  "code": "ESB000005"
}
```

---

# Consulta de Contrato

URL: /en/documentation/iaas/despesas/submissao_despesa/contrato/recuperacao

Recupere os dados e o status atual de um contrato específico.

## Request

ENDPOINT /expense_submission/fund_class/{fund_class_key}/contract/{contract_key}
MÉTODO GET

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `fund_class_key` | string | Chave única do fundo (UUID) |
| `contract_key` | string | Chave única do contrato |

## Response

STATUS 200

```json title="Response Body"
{
    "name": "Contrato de Auditoria - Exercício 2026",
    "contract_key": "contrato-auditoria-2026",
    "fund_class": {
        "name": "FUNDO DE INVESTIMENTO EM DIREITOS CREDITÓRIOS EXEMPLO",
        "manager": {
            "name": "EXEMPLO GESTORA LTDA",
            "manager_key": "a7498c6c-1893-42ec-a8f3-bc6ad0c6b52c",
            "document_number": "45.585.471/0001-47"
        },
        "fund_class_key": "4b8377d0-58ec-479f-8ee9-9f963d5c47ad",
        "document_number": "60.910.091/0001-24"
    },
    "vendor": {
        "vendor_key": "3571e292-3a83-4011-904d-20ee963022ef",
        "name": "AUDITORES EXEMPLO S.A.",
        "document_number": "12.345.678/0001-90",
        "requires_invoice": "True"
    },
    "expense_type": "audit_tax",
    "status": "approved",
    "contract_value": 50000.00,
    "validity_date": "2026-12-31",
    "submission_nature": "manual_submission"
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `name` | string | Nome do contrato. |
| `contract_key` | string | Chave única do contrato. |
| `fund_class` | object | Dados do fundo associado. |
| `vendor` | object | Dados do fornecedor. |
| `expense_type` | string | Tipo de despesa do contrato. |
| `status` | string | Status atual do contrato. Ver tabela de [status do contrato](/documentation/iaas/despesas/submissao_despesa/inicio#status-do-contrato). |
| `contract_value` | number | Valor máximo do contrato, ou `null` quando não informado. |
| `validity_date` | string | Data de validade no formato `YYYY-MM-DD`, ou `null` quando não informada. |
| `submission_nature` | string | Natureza de submissão do contrato. |

## Possíveis erros

STATUS 404

**Contrato não encontrado**

O par `fund_class_key` + `contract_key` não corresponde a nenhum contrato cadastrado.

```json
{
  "title": "Contract Not Found",
  "description": "Contract with key {contract_key} and fund class {fund_class_key} was not found.",
  "translation": "O contrato com chave {contract_key} do fundo {fund_class_key} não foi encontrado.",
  "code": "ESB000011"
}
```

---

# Submissão do Contrato

URL: /en/documentation/iaas/despesas/submissao_despesa/contrato/submissao

Após criar o contrato, submeta-o para análise da QI Tech. A submissão encaminha o contrato para revisão manual e muda seu status para `pending_adm_approval`.

:::caution Atenção
Após a submissão, o contrato não pode mais ser editado. Verifique todos os dados antes de prosseguir. Caso precise fazer alterações, utilize o endpoint de [atualização](/documentation/iaas/despesas/submissao_despesa/contrato/atualizacao) enquanto o status ainda for `created`.
:::

## Request

ENDPOINT /expense_submission/fund_class/{fund_class_key}/contract/{contract_key}/submit
MÉTODO PUT

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `fund_class_key` | string | Chave única do fundo (UUID) |
| `contract_key` | string | Chave única do contrato |

Este endpoint não requer body na requisição.

## Response

STATUS 200

```json title="Response Body"
{
    "name": "Contrato de Auditoria - Exercício 2026",
    "contract_key": "contrato-auditoria-2026",
    "fund_class": {
        "name": "FUNDO DE INVESTIMENTO EM DIREITOS CREDITÓRIOS EXEMPLO",
        "manager": {
            "name": "EXEMPLO GESTORA LTDA",
            "manager_key": "a7498c6c-1893-42ec-a8f3-bc6ad0c6b52c",
            "document_number": "45.585.471/0001-47"
        },
        "fund_class_key": "4b8377d0-58ec-479f-8ee9-9f963d5c47ad",
        "document_number": "60.910.091/0001-24"
    },
    "vendor": {
        "vendor_key": "3571e292-3a83-4011-904d-20ee963022ef",
        "name": "AUDITORES EXEMPLO S.A.",
        "document_number": "12.345.678/0001-90",
        "requires_invoice": "True"
    },
    "expense_type": "audit_tax",
    "status": "pending_adm_approval",
    "contract_value": 50000.00,
    "validity_date": "2026-12-31",
    "submission_nature": "manual_submission"
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `status` | string | Novo status do contrato. Sempre retorna `pending_adm_approval` após a submissão bem-sucedida. |

Os demais campos seguem a mesma estrutura da [criação do contrato](/documentation/iaas/despesas/submissao_despesa/contrato/criacao#atributos-da-resposta).

## Possíveis erros

STATUS 404

**Contrato não encontrado**

O par `fund_class_key` + `contract_key` não corresponde a nenhum contrato cadastrado.

```json
{
  "title": "Contract Not Found",
  "description": "Contract with key {contract_key} and fund class {fund_class_key} was not found.",
  "translation": "O contrato com chave {contract_key} do fundo {fund_class_key} não foi encontrado.",
  "code": "ESB000011"
}
```

STATUS 400

**Transição de status inválida**

O contrato não pode ser submetido a partir do status atual. A submissão só é permitida quando o contrato está no status `created`.

```json
{
  "title": "Invalid Contract Status Change",
  "description": "It is not possible to change the contract status from {current_status} to {new_status}.",
  "translation": "Não é possível alterar o status do contrato de {current_status} para {new_status}.",
  "code": "ESB000013"
}
```

## Próximos passos

Após submeter o contrato, aguarde a análise da QI Tech. Enquanto isso, você pode:

1. **[Consultar o contrato](/documentation/iaas/despesas/submissao_despesa/contrato/recuperacao)** — acompanhe o status do contrato.
2. **[Criar despesas](/documentation/iaas/despesas/submissao_despesa/despesa/criacao)** — despesas podem ser criadas mesmo enquanto o contrato aguarda aprovação (exceto contratos com status `rejected`).

---

# Atualização da Despesa

URL: /en/documentation/iaas/despesas/submissao_despesa/despesa/atualizacao

Edite os dados de uma despesa enquanto ela ainda estiver no status `created`. Após a submissão ou após a criação com documentos (status `pending_adm_approval`), a despesa não pode mais ser alterada.

:::info
Somente despesas com status `created` podem ser atualizadas.
:::

## Request

ENDPOINT /expense_submission/fund_class/{fund_class_key}/contract/{contract_key}/expense/{expense_key}
MÉTODO PUT

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `fund_class_key` | string | Chave única do fundo (UUID) |
| `contract_key` | string | Chave única do contrato |
| `expense_key` | string | Chave única da despesa (UUID) |

```json title="Request Body"
{
    "payment_method": "transfer",
    "start_deferral_date": "2026-06-02",
    "end_deferral_date": "2026-06-30",
    "description": "Honorários de auditoria - 1º semestre 2026 (corrigido)",
    "payment_value": 16000.00,
    "payment_date": "2026-07-01",
    "payment": {
        "target": {
            "name": "AUDITORES EXEMPLO S.A.",
            "document_number": "12.345.678/0001-90"
        },
        "target_account": {
            "account_number": "123456",
            "account_branch": "0001",
            "account_digit": "0",
            "financial_institution_code": "341"
        },
        "transfer_type": "wire_transfer",
        "source_account": {
            "account_key": "5e621ba2-b4ac-4ddd-9893-82d220e1577e"
        }
    }
}
```

### Atributos do body

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `payment_method` | string | opcional | Método de pagamento: `transfer`, `automatic_debit` ou `bank_slip`. |
| `start_deferral_date` | string | opcional | Data início da competência no formato `YYYY-MM-DD`. Deve ser dia útil. |
| `end_deferral_date` | string | opcional | Data fim da competência no formato `YYYY-MM-DD`. Deve ser dia útil. |
| `description` | string | opcional | Nova descrição da despesa. Máximo de 200 caracteres. |
| `payment_value` | number | opcional | Novo valor da despesa. Mínimo: `0`. |
| `payment_date` | string | opcional | Nova data de pagamento no formato `YYYY-MM-DD`. Deve ser dia útil. |
| `payment` | object | opcional | Novos dados do pagamento. Mesma estrutura da [criação da despesa](/documentation/iaas/despesas/submissao_despesa/despesa/criacao#atributos-de-payment). |

## Response

STATUS 200

A resposta segue a mesma estrutura da [criação da despesa](/documentation/iaas/despesas/submissao_despesa/despesa/criacao#atributos-da-resposta), com os campos atualizados.

## Possíveis erros

STATUS 404

**Despesa não encontrada**

O conjunto `fund_class_key` + `contract_key` + `expense_key` não corresponde a nenhuma despesa cadastrada.

```json
{
  "title": "Expense Not Found",
  "description": "Expense with key {expense_key} was not found.",
  "translation": "A despesa com chave {expense_key} não foi encontrada.",
  "code": "ESB000016"
}
```

STATUS 400

**Despesa não pode ser editada neste status**

A despesa não está no status `created` e não pode ser editada.

```json
{
  "title": "Cannot Update Expense In This Status",
  "description": "Expense {expense_key} cannot be updated with status {current_status}.",
  "translation": "A despesa {expense_key} não pode ser atualizada com o status {current_status}.",
  "code": "ESB000023"
}
```

## Próximos passos

1. **[Submeter a despesa](/documentation/iaas/despesas/submissao_despesa/despesa/submissao)** — encaminhe para análise quando estiver pronto.
2. **[Cancelar a despesa](/documentation/iaas/despesas/submissao_despesa/despesa/cancelamento)** — cancele caso não seja mais necessária.

---

# Cancelamento da Despesa

URL: /en/documentation/iaas/despesas/submissao_despesa/despesa/cancelamento

Cancele uma despesa que não seja mais necessária. O cancelamento é uma operação irreversível.

:::caution Atenção
Uma despesa cancelada não pode ser reativada. Certifique-se de que o cancelamento é realmente necessário antes de prosseguir. Despesas nos status `approved` ou `rejected` não podem ser canceladas.
:::

## Request

ENDPOINT /expense_submission/fund_class/{fund_class_key}/contract/{contract_key}/expense/{expense_key}/cancel
MÉTODO PUT

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `fund_class_key` | string | Chave única do fundo (UUID) |
| `contract_key` | string | Chave única do contrato |
| `expense_key` | string | Chave única da despesa (UUID) |

Este endpoint não requer body na requisição.

## Response

STATUS 200

```json title="Response Body"
{
    "expense_key": "7f3e9a1b-2c4d-5e6f-8901-abcdef234567",
    "contract_key": "contrato-auditoria-2026",
    "status": "canceled",
    "payment_method": "transfer",
    "start_deferral_date": "2026-06-02",
    "end_deferral_date": "2026-06-30",
    "description": "Honorários de auditoria referente ao 1º semestre de 2026",
    "payment": {
        "target": {
            "name": "AUDITORES EXEMPLO S.A.",
            "document_number": "12.345.678/0001-90"
        },
        "target_account": {
            "account_number": "123456",
            "account_branch": "0001",
            "account_digit": "0",
            "financial_institution_code": "341"
        }
    },
    "payment_value": 15000.00,
    "payment_date": "2026-07-01",
    "rebate_expense_key": null,
    "fund_class": {
        "name": "FUNDO DE INVESTIMENTO EM DIREITOS CREDITÓRIOS EXEMPLO",
        "manager": {
            "name": "EXEMPLO GESTORA LTDA",
            "manager_key": "a7498c6c-1893-42ec-a8f3-bc6ad0c6b52c",
            "document_number": "45.585.471/0001-47"
        },
        "fund_class_key": "4b8377d0-58ec-479f-8ee9-9f963d5c47ad",
        "document_number": "60.910.091/0001-24"
    }
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `status` | string | Novo status da despesa. Sempre retorna `canceled` após o cancelamento bem-sucedido. |

Os demais campos seguem a mesma estrutura da [criação da despesa](/documentation/iaas/despesas/submissao_despesa/despesa/criacao#atributos-da-resposta).

## Possíveis erros

STATUS 404

**Despesa não encontrada**

O conjunto `fund_class_key` + `contract_key` + `expense_key` não corresponde a nenhuma despesa cadastrada.

```json
{
  "title": "Expense Not Found",
  "description": "Expense with key {expense_key} was not found.",
  "translation": "A despesa com chave {expense_key} não foi encontrada.",
  "code": "ESB000016"
}
```

STATUS 400

**Despesa já em status final**

A despesa já está em um status final (`approved` ou `rejected`) e não pode ser cancelada.

```json
{
  "title": "Already In Final Expense Status",
  "description": "Expense {expense_key} is already in a final status: {current_status}.",
  "translation": "A despesa {expense_key} já está em um status final: {current_status}.",
  "code": "ESB000021"
}
```

---

# Criação da Despesa

URL: /en/documentation/iaas/despesas/submissao_despesa/despesa/criacao

Crie uma despesa individual sob um contrato existente. A despesa contém os dados de pagamento, o período de competência e os documentos comprobatórios.

:::info Pré-requisitos
- O contrato referenciado deve existir e não pode estar no status `rejected`.
- As datas (`payment_date`, `start_deferral_date`, `end_deferral_date`) devem ser **dias úteis** (sem fins de semana ou feriados nacionais).
- `start_deferral_date` não pode ser posterior a `end_deferral_date`.
- Quando o contrato possui `contract_value`, a soma dos valores de todas as despesas não pode ultrapassar esse limite.
:::

:::tip Atalho para submissão
Se os documentos comprobatórios forem incluídos no campo `documents` durante a criação, a despesa é **automaticamente encaminhada para revisão** (status `pending_adm_approval`), sem necessidade de chamar o endpoint de submissão separadamente.
:::

## Request

ENDPOINT /expense_submission/fund_class/{fund_class_key}/contract/{contract_key}/expense
MÉTODO POST

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `fund_class_key` | string | Chave única do fundo (UUID) |
| `contract_key` | string | Chave única do contrato |

```json title="Request Body — Pagamento por transferência (TED/PIX)"
{
    "payment_method": "transfer",
    "start_deferral_date": "2026-06-02",
    "end_deferral_date": "2026-06-30",
    "description": "Honorários de auditoria referente ao 1º semestre de 2026",
    "payment_value": 15000.00,
    "payment_date": "2026-07-01",
    "payment": {
        "target": {
            "name": "AUDITORES EXEMPLO S.A.",
            "document_number": "12.345.678/0001-90"
        },
        "target_account": {
            "account_number": "123456",
            "account_branch": "0001",
            "account_digit": "0",
            "financial_institution_code": "341"
        },
        "transfer_type": "wire_transfer",
        "source_account": {
            "account_key": "5e621ba2-b4ac-4ddd-9893-82d220e1577e"
        }
    },
    "documents": [
        {
            "name": "NF-e 001234",
            "document_type": "invoice",
            "document_b64": "JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoK..."
        }
    ]
}
```

```json title="Request Body — Pagamento por boleto"
{
    "payment_method": "bank_slip",
    "start_deferral_date": "2026-06-02",
    "end_deferral_date": "2026-06-30",
    "description": "Taxa de custódia - junho/2026",
    "payment_value": 3500.00,
    "payment_date": "2026-07-01",
    "payment": {
        "target": {
            "name": "CUSTODIANTE EXEMPLO S.A.",
            "document_number": "98.765.432/0001-10"
        },
        "bank_slip": {
            "digitable_line": "34191.09008 63521.510047 91020.150008 1 10010000035000"
        },
        "source_account": {
            "account_key": "5e621ba2-b4ac-4ddd-9893-82d220e1577e"
        }
    }
}
```

### Atributos do body

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `payment_method` | string | obrigatório | Método de pagamento: `transfer`, `automatic_debit` ou `bank_slip`. |
| `start_deferral_date` | string | obrigatório | Data início da competência no formato `YYYY-MM-DD`. Deve ser dia útil. |
| `end_deferral_date` | string | obrigatório | Data fim da competência no formato `YYYY-MM-DD`. Deve ser dia útil e ≥ `start_deferral_date`. |
| `description` | string | obrigatório | Descrição da despesa. Máximo de 200 caracteres. |
| `payment_value` | number | obrigatório | Valor da despesa. Mínimo: `0`. |
| `payment_date` | string | obrigatório | Data de pagamento no formato `YYYY-MM-DD`. Deve ser dia útil. |
| `payment` | object | obrigatório | Dados do pagamento. Ver [Atributos de `payment`](#atributos-de-payment). |
| `documents` | array | opcional | Lista de documentos comprobatórios. Quando informado, a despesa é automaticamente encaminhada para revisão. Ver [Atributos de `documents`](#atributos-de-documents). |

#### Atributos de `payment`

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `target` | object | obrigatório | Dados do beneficiário. |
| `target.name` | string | obrigatório | Nome do beneficiário. |
| `target.document_number` | string | obrigatório | CPF (`###.###.###-##`) ou CNPJ (`##.###.###/####-##`) do beneficiário. |
| `target_account` | object | condicional | Dados da conta bancária de destino. Obrigatório para `payment_method = transfer`. |
| `target_account.account_number` | string | obrigatório | Número da conta (1-20 dígitos, não pode ser todos zeros). |
| `target_account.account_branch` | string | obrigatório | Agência (exatamente 4 dígitos, não pode ser todos zeros). |
| `target_account.account_digit` | string | obrigatório | Dígito verificador (1 dígito). |
| `target_account.financial_institution_code` | string | obrigatório | Código do banco (exatamente 3 dígitos, não pode ser todos zeros). |
| `target_account.financial_institution_ispb` | string | opcional | ISPB do banco (exatamente 8 dígitos). |
| `target_account.account_type` | string | opcional | Tipo da conta bancária. |
| `transfer_type` | string | condicional | Tipo de transferência: `pix` ou `wire_transfer`. Necessário para `payment_method = transfer`. |
| `target_pix_key` | string | condicional | Chave PIX do beneficiário (1-77 caracteres). Obrigatório quando `transfer_type = pix`. |
| `pix_qrcode` | string | opcional | QR Code PIX (1-255 caracteres). |
| `bank_slip` | object | condicional | Dados do boleto. Obrigatório para `payment_method = bank_slip`. |
| `bank_slip.digitable_line` | string | obrigatório | Linha digitável do boleto (47-48 caracteres). |
| `source_account` | object | opcional | Conta de débito de origem do pagamento. |
| `source_account.account_key` | string | obrigatório | Chave única da conta de origem (UUID). |
| `conciliation_metadata` | object | opcional | Metadados de conciliação. |
| `conciliation_metadata.fee_type` | string | opcional | Tipo de taxa para conciliação. |
| `conciliation_metadata.conciliation_value` | string | opcional | Valor de conciliação. |
| `conciliation_metadata.conciliation_field` | string | opcional | Campo de conciliação. |

#### Atributos de `documents`

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `name` | string | obrigatório | Nome do documento. Máximo de 255 caracteres. |
| `document_type` | string | obrigatório | Tipo do documento: `invoice` (NF), `calculation_memory` (memória de cálculo), `contract` (contrato) ou `bank_slip` (boleto). |
| `document_b64` | string | obrigatório | Conteúdo do documento codificado em Base64. |

## Response

STATUS 201

```json title="Response Body"
{
    "expense_key": "7f3e9a1b-2c4d-5e6f-8901-abcdef234567",
    "contract_key": "contrato-auditoria-2026",
    "status": "pending_adm_approval",
    "payment_method": "transfer",
    "start_deferral_date": "2026-06-02",
    "end_deferral_date": "2026-06-30",
    "description": "Honorários de auditoria referente ao 1º semestre de 2026",
    "payment": {
        "target": {
            "name": "AUDITORES EXEMPLO S.A.",
            "document_number": "12.345.678/0001-90"
        },
        "target_account": {
            "account_number": "123456",
            "account_branch": "0001",
            "account_digit": "0",
            "financial_institution_code": "341"
        },
        "transfer_type": "wire_transfer",
        "source_account": {
            "account_key": "5e621ba2-b4ac-4ddd-9893-82d220e1577e"
        }
    },
    "payment_value": 15000.00,
    "payment_date": "2026-07-01",
    "rebate_expense_key": null,
    "fund_class": {
        "name": "FUNDO DE INVESTIMENTO EM DIREITOS CREDITÓRIOS EXEMPLO",
        "manager": {
            "name": "EXEMPLO GESTORA LTDA",
            "manager_key": "a7498c6c-1893-42ec-a8f3-bc6ad0c6b52c",
            "document_number": "45.585.471/0001-47"
        },
        "fund_class_key": "4b8377d0-58ec-479f-8ee9-9f963d5c47ad",
        "document_number": "60.910.091/0001-24"
    }
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `expense_key` | string | Chave única da despesa (UUID). Guarde este valor para as próximas etapas. |
| `contract_key` | string | Chave do contrato ao qual a despesa pertence. |
| `status` | string | Status da despesa. Será `pending_adm_approval` se documentos foram incluídos na criação, ou `created` caso contrário. |
| `payment_method` | string | Método de pagamento da despesa. |
| `start_deferral_date` | string | Data início de competência no formato `YYYY-MM-DD`. |
| `end_deferral_date` | string | Data fim de competência no formato `YYYY-MM-DD`. |
| `description` | string | Descrição da despesa. |
| `payment` | object | Dados do pagamento conforme enviado na criação. |
| `payment_value` | number | Valor da despesa. |
| `payment_date` | string | Data de pagamento no formato `YYYY-MM-DD`. |
| `rebate_expense_key` | string | Chave da despesa original quando se tratar de um rebate, ou `null`. |
| `fund_class` | object | Dados do fundo associado. |

## Possíveis erros

STATUS 404

**Contrato não encontrado**

O par `fund_class_key` + `contract_key` não corresponde a nenhum contrato cadastrado.

```json
{
  "title": "Contract Not Found",
  "description": "Contract with key {contract_key} and fund class {fund_class_key} was not found.",
  "translation": "O contrato com chave {contract_key} do fundo {fund_class_key} não foi encontrado.",
  "code": "ESB000011"
}
```

STATUS 400

**Contrato rejeitado**

Não é possível criar despesas em um contrato com status `rejected`.

```json
{
  "title": "Cannot Create Expense On Rejected Contract",
  "description": "Cannot create expense on rejected contract {contract_key}.",
  "translation": "Não é possível criar despesa no contrato rejeitado {contract_key}.",
  "code": "ESB000035"
}
```

**Contrato vencido**

A data de validade do contrato já passou. Não é possível criar novas despesas.

```json
{
  "title": "Contract Expired",
  "description": "Contract {contract_key} has expired.",
  "translation": "O contrato {contract_key} está vencido.",
  "code": "ESB000029"
}
```

**Soma das despesas excede o valor do contrato**

A soma dos valores de todas as despesas ultrapassaria o `contract_value` definido no contrato.

```json
{
  "title": "Expense Value Sum Greater Than Contract",
  "description": "The sum of expense values exceeds the contract value for {contract_name}.",
  "translation": "A soma dos valores das despesas excede o valor do contrato {contract_name}.",
  "code": "ESB000030"
}
```

**Data inválida (não é dia útil)**

A data informada em `payment_date`, `start_deferral_date` ou `end_deferral_date` não é um dia útil.

```json
{
  "title": "Date Invalid For Expense Creation",
  "description": "The date {date} is not a valid workday for expense creation.",
  "translation": "A data {date} não é um dia útil válido para criação de despesa.",
  "code": "ESB000032"
}
```

**Data início posterior à data fim de competência**

O campo `start_deferral_date` é posterior ao `end_deferral_date`.

```json
{
  "title": "Start Deferral Date Greater Than End Deferral Date",
  "description": "The start deferral date {start_date} is greater than the end deferral date {end_date}.",
  "translation": "A data de início de competência {start_date} é maior que a data de fim de competência {end_date}.",
  "code": "ESB000033"
}
```

## Próximos passos

- Se os documentos foram incluídos na criação (status `pending_adm_approval`): aguarde a análise da QI Tech.
- Se os documentos **não** foram incluídos (status `created`):
  1. **[Upload de documentos](/documentation/iaas/despesas/submissao_despesa/documentos/upload)** — adicione ao menos um documento antes de submeter.
  2. **[Submeter a despesa](/documentation/iaas/despesas/submissao_despesa/despesa/submissao)** — encaminhe para análise da QI Tech.

---

# Listagem de Despesas

URL: /en/documentation/iaas/despesas/submissao_despesa/despesa/listagem

Liste as despesas submetidas de um contrato ou de um fundo com filtros opcionais.

## Listar por contrato

ENDPOINT /expense_submission/fund_class/{fund_class_key}/contract/{contract_key}/expenses
MÉTODO GET

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `fund_class_key` | string | Chave única do fundo (UUID) |
| `contract_key` | string | Chave única do contrato |

### Query params

| Parâmetro | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `payment_method` | string | opcional | Filtra por método de pagamento: `transfer`, `automatic_debit` ou `bank_slip`. |
| `payment_date` | string | opcional | Filtra pela data de pagamento no formato `YYYY-MM-DD`. |
| `start_deferral_date` | string | opcional | Filtra pela data início de competência no formato `YYYY-MM-DD`. |
| `end_deferral_date` | string | opcional | Filtra pela data fim de competência no formato `YYYY-MM-DD`. |
| `status` | string | opcional | Filtra por status (`created`, `pending_adm_approval`, `approved`, `rejected`, `canceled`). |
| `limit` | integer | opcional | Número de itens por página. Mínimo: `1`. Máximo: `1000`. Padrão: `10`. |
| `page` | integer | opcional | Número da página (base zero). Padrão: `0`. |

## Response

STATUS 200

```json title="Response Body"
{
    "data": [
        {
            "expense_key": "7f3e9a1b-2c4d-5e6f-8901-abcdef234567",
            "contract_key": "contrato-auditoria-2026",
            "status": "approved",
            "payment_method": "transfer",
            "start_deferral_date": "2026-06-02",
            "end_deferral_date": "2026-06-30",
            "description": "Honorários de auditoria referente ao 1º semestre de 2026",
            "payment": {
                "target": {
                    "name": "AUDITORES EXEMPLO S.A.",
                    "document_number": "12.345.678/0001-90"
                },
                "target_account": {
                    "account_number": "123456",
                    "account_branch": "0001",
                    "account_digit": "0",
                    "financial_institution_code": "341"
                }
            },
            "payment_value": 15000.00,
            "payment_date": "2026-07-01",
            "rebate_expense_key": null,
            "fund_class": {
                "name": "FUNDO DE INVESTIMENTO EM DIREITOS CREDITÓRIOS EXEMPLO",
                "manager": {
                    "name": "EXEMPLO GESTORA LTDA",
                    "manager_key": "a7498c6c-1893-42ec-a8f3-bc6ad0c6b52c",
                    "document_number": "45.585.471/0001-47"
                },
                "fund_class_key": "4b8377d0-58ec-479f-8ee9-9f963d5c47ad",
                "document_number": "60.910.091/0001-24"
            }
        }
    ],
    "limit": 10,
    "page": 0,
    "is_last_page": true
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `data` | array | Lista de despesas. Cada item segue a estrutura da [consulta individual](/documentation/iaas/despesas/submissao_despesa/despesa/recuperacao). |
| `limit` | integer | Número de itens por página utilizado na consulta. |
| `page` | integer | Número da página atual. |
| `is_last_page` | boolean | Indica se esta é a última página de resultados. |

---

## Listar por fundo

Para consultar todas as despesas de um fundo, independentemente do contrato:

ENDPOINT /expense_submission/fund_class/{fund_class_key}/expenses
MÉTODO GET

Aceita os mesmos query params da listagem por contrato, com os parâmetros adicionais:

| Parâmetro | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `rebate` | boolean | opcional | Filtra apenas despesas do tipo rebate (`true`) ou apenas despesas regulares (`false`). |
| `description` | string | opcional | Filtra pela descrição da despesa (busca parcial). |

## Possíveis erros

STATUS 404

**Fundo ou contrato não encontrado**

O `fund_class_key` ou `contract_key` informado não corresponde a nenhum registro cadastrado.

```json
{
  "title": "Contract Not Found",
  "description": "Contract with key {contract_key} and fund class {fund_class_key} was not found.",
  "translation": "O contrato com chave {contract_key} do fundo {fund_class_key} não foi encontrado.",
  "code": "ESB000011"
}
```

---

# Consulta de Despesa

URL: /en/documentation/iaas/despesas/submissao_despesa/despesa/recuperacao

Recupere os dados e o status atual de uma despesa no fluxo de submissão.

:::tip
Este endpoint retorna o status da despesa **dentro do processo de submissão** (ex: `created`, `pending_adm_approval`, `approved`). Para consultar despesas já consolidadas no ledger do fundo, utilize a [API de consulta de despesas](/documentation/iaas/despesas/despesa_consolidada/consulta_despesas).
:::

## Request

ENDPOINT /expense_submission/fund_class/{fund_class_key}/contract/{contract_key}/expense/{expense_key}
MÉTODO GET

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `fund_class_key` | string | Chave única do fundo (UUID) |
| `contract_key` | string | Chave única do contrato |
| `expense_key` | string | Chave única da despesa (UUID) |

## Response

STATUS 200

```json title="Response Body"
{
    "expense_key": "7f3e9a1b-2c4d-5e6f-8901-abcdef234567",
    "contract_key": "contrato-auditoria-2026",
    "status": "approved",
    "payment_method": "transfer",
    "start_deferral_date": "2026-06-02",
    "end_deferral_date": "2026-06-30",
    "description": "Honorários de auditoria referente ao 1º semestre de 2026",
    "payment": {
        "target": {
            "name": "AUDITORES EXEMPLO S.A.",
            "document_number": "12.345.678/0001-90"
        },
        "target_account": {
            "account_number": "123456",
            "account_branch": "0001",
            "account_digit": "0",
            "financial_institution_code": "341"
        },
        "transfer_type": "wire_transfer",
        "source_account": {
            "account_key": "5e621ba2-b4ac-4ddd-9893-82d220e1577e"
        }
    },
    "payment_value": 15000.00,
    "payment_date": "2026-07-01",
    "rebate_expense_key": null,
    "fund_class": {
        "name": "FUNDO DE INVESTIMENTO EM DIREITOS CREDITÓRIOS EXEMPLO",
        "manager": {
            "name": "EXEMPLO GESTORA LTDA",
            "manager_key": "a7498c6c-1893-42ec-a8f3-bc6ad0c6b52c",
            "document_number": "45.585.471/0001-47"
        },
        "fund_class_key": "4b8377d0-58ec-479f-8ee9-9f963d5c47ad",
        "document_number": "60.910.091/0001-24"
    }
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `expense_key` | string | Chave única da despesa (UUID). |
| `contract_key` | string | Chave do contrato ao qual a despesa pertence. |
| `status` | string | Status atual no fluxo de submissão. Ver tabela de [status da despesa](/documentation/iaas/despesas/submissao_despesa/inicio#status-da-despesa). |
| `payment_method` | string | Método de pagamento: `transfer`, `automatic_debit` ou `bank_slip`. |
| `start_deferral_date` | string | Data início de competência no formato `YYYY-MM-DD`. |
| `end_deferral_date` | string | Data fim de competência no formato `YYYY-MM-DD`. |
| `description` | string | Descrição da despesa. |
| `payment` | object | Dados do pagamento conforme cadastrados. |
| `payment_value` | number | Valor da despesa. |
| `payment_date` | string | Data de pagamento no formato `YYYY-MM-DD`. |
| `rebate_expense_key` | string | Chave da despesa original quando se tratar de um rebate, ou `null`. |
| `fund_class` | object | Dados do fundo associado. |

## Possíveis erros

STATUS 404

**Despesa não encontrada**

O conjunto `fund_class_key` + `contract_key` + `expense_key` não corresponde a nenhuma despesa cadastrada.

```json
{
  "title": "Expense Not Found",
  "description": "Expense with key {expense_key} was not found.",
  "translation": "A despesa com chave {expense_key} não foi encontrada.",
  "code": "ESB000016"
}
```

---

# Submissão da Despesa

URL: /en/documentation/iaas/despesas/submissao_despesa/despesa/submissao

Encaminhe uma despesa para análise da QI Tech. A submissão só é necessária quando a despesa foi criada **sem documentos** — caso contrário, a despesa já é automaticamente encaminhada durante a criação.

:::caution Atenção
- É obrigatório ter ao menos um documento anexado à despesa antes de submeter.
- Somente despesas no status `created` podem ser submetidas por este endpoint. Despesas que já passaram pela criação com documentos estarão no status `pending_adm_approval` e não precisam ser submetidas novamente.
:::

## Request

ENDPOINT /expense_submission/fund_class/{fund_class_key}/contract/{contract_key}/expense/{expense_key}/submit
MÉTODO PUT

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `fund_class_key` | string | Chave única do fundo (UUID) |
| `contract_key` | string | Chave única do contrato |
| `expense_key` | string | Chave única da despesa (UUID) |

Este endpoint não requer body na requisição.

## Response

STATUS 200

```json title="Response Body"
{
    "expense_key": "7f3e9a1b-2c4d-5e6f-8901-abcdef234567",
    "contract_key": "contrato-auditoria-2026",
    "status": "pending_adm_approval",
    "payment_method": "transfer",
    "start_deferral_date": "2026-06-02",
    "end_deferral_date": "2026-06-30",
    "description": "Honorários de auditoria referente ao 1º semestre de 2026",
    "payment": {
        "target": {
            "name": "AUDITORES EXEMPLO S.A.",
            "document_number": "12.345.678/0001-90"
        },
        "target_account": {
            "account_number": "123456",
            "account_branch": "0001",
            "account_digit": "0",
            "financial_institution_code": "341"
        },
        "transfer_type": "wire_transfer",
        "source_account": {
            "account_key": "5e621ba2-b4ac-4ddd-9893-82d220e1577e"
        }
    },
    "payment_value": 15000.00,
    "payment_date": "2026-07-01",
    "rebate_expense_key": null,
    "fund_class": {
        "name": "FUNDO DE INVESTIMENTO EM DIREITOS CREDITÓRIOS EXEMPLO",
        "manager": {
            "name": "EXEMPLO GESTORA LTDA",
            "manager_key": "a7498c6c-1893-42ec-a8f3-bc6ad0c6b52c",
            "document_number": "45.585.471/0001-47"
        },
        "fund_class_key": "4b8377d0-58ec-479f-8ee9-9f963d5c47ad",
        "document_number": "60.910.091/0001-24"
    }
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `status` | string | Novo status da despesa. Sempre retorna `pending_adm_approval` após a submissão bem-sucedida. |

Os demais campos seguem a mesma estrutura da [criação da despesa](/documentation/iaas/despesas/submissao_despesa/despesa/criacao#atributos-da-resposta).

## Possíveis erros

STATUS 404

**Despesa não encontrada**

O conjunto `fund_class_key` + `contract_key` + `expense_key` não corresponde a nenhuma despesa cadastrada.

```json
{
  "title": "Expense Not Found",
  "description": "Expense with key {expense_key} was not found.",
  "translation": "A despesa com chave {expense_key} não foi encontrada.",
  "code": "ESB000016"
}
```

STATUS 400

**Despesa sem documentos**

Não há documentos anexados à despesa. Faça o [upload de ao menos um documento](/documentation/iaas/despesas/submissao_despesa/documentos/upload) antes de submeter.

```json
{
  "title": "Submission Must Have At Least One Pending Analysis Document",
  "description": "Expense {expense_key} must have at least one document in pending_adm_approval or approved status.",
  "translation": "A despesa {expense_key} deve ter ao menos um documento em status pending_adm_approval ou approved.",
  "code": "ESB000025"
}
```

**Transição de status inválida**

A despesa não está no status `created` e não pode ser submetida por este endpoint.

```json
{
  "title": "Cannot Update Expense In This Status",
  "description": "Expense {expense_key} cannot be updated with status {current_status}.",
  "translation": "A despesa {expense_key} não pode ser atualizada com o status {current_status}.",
  "code": "ESB000023"
}
```

## Próximos passos

Após submeter a despesa, aguarde a análise da QI Tech. Você pode acompanhar o status via:

**[Consultar a despesa](/documentation/iaas/despesas/submissao_despesa/despesa/recuperacao)** — verifique o status atual da despesa.

---

# Listagem de Documentos

URL: /en/documentation/iaas/despesas/submissao_despesa/documentos/listagem

Liste todos os documentos vinculados a uma despesa ou a um contrato.

---

## Listar documentos de uma despesa

ENDPOINT /expense_submission/fund_class/{fund_class_key}/contract/{contract_key}/expense/{expense_key}/documents
MÉTODO GET

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `fund_class_key` | string | Chave única do fundo (UUID) |
| `contract_key` | string | Chave única do contrato |
| `expense_key` | string | Chave única da despesa (UUID) |

## Response

STATUS 200

```json title="Response Body"
{
    "data": [
        {
            "name": "NF-e 001234 - Auditoria jun/2026",
            "expense_document_key": "d4e5f6a7-b8c9-0123-def4-567890abcdef",
            "expense_key": "7f3e9a1b-2c4d-5e6f-8901-abcdef234567",
            "document_type": "invoice",
            "status": "approved"
        },
        {
            "name": "Memória de Cálculo - jun/2026",
            "expense_document_key": "e5f6a7b8-c9d0-1234-ef56-7890abcdef12",
            "expense_key": "7f3e9a1b-2c4d-5e6f-8901-abcdef234567",
            "document_type": "calculation_memory",
            "status": "pending_adm_approval"
        }
    ]
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `data` | array | Lista de documentos. |
| `data[].name` | string | Nome do documento. |
| `data[].expense_document_key` | string | Chave única do documento (UUID). |
| `data[].expense_key` | string | Chave da despesa à qual o documento pertence. |
| `data[].document_type` | string | Tipo do documento: `invoice`, `calculation_memory`, `contract` ou `bank_slip`. |
| `data[].status` | string | Status do documento: `pending_adm_approval`, `approved` ou `rejected`. |

---

## Listar documentos de um contrato

ENDPOINT /expense_submission/fund_class/{fund_class_key}/contract/{contract_key}/documents
MÉTODO GET

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `fund_class_key` | string | Chave única do fundo (UUID) |
| `contract_key` | string | Chave única do contrato |

## Response

STATUS 200

```json title="Response Body"
{
    "data": [
        {
            "name": "Contrato de Prestação de Serviços - Auditoria 2026",
            "contract_document_key": "f6a7b8c9-d0e1-2345-fa67-890abcdef123",
            "contract_key": "contrato-auditoria-2026",
            "document_type": "contract",
            "status": "approved"
        }
    ]
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `data` | array | Lista de documentos. |
| `data[].name` | string | Nome do documento. |
| `data[].contract_document_key` | string | Chave única do documento de contrato (UUID). |
| `data[].contract_key` | string | Chave do contrato ao qual o documento pertence. |
| `data[].document_type` | string | Tipo do documento. |
| `data[].status` | string | Status do documento: `pending_adm_approval`, `approved` ou `rejected`. |

## Possíveis erros

STATUS 404

**Despesa ou contrato não encontrado**

As chaves informadas na URL não correspondem a nenhum registro cadastrado.

```json
{
  "title": "Expense Not Found",
  "description": "Expense with key {expense_key} was not found.",
  "translation": "A despesa com chave {expense_key} não foi encontrada.",
  "code": "ESB000016"
}
```

---

# Upload de Documentos

URL: /en/documentation/iaas/despesas/submissao_despesa/documentos/upload

Adicione documentos comprobatórios a uma despesa ou contrato. Os documentos passam por análise da QI Tech e são obrigatórios para a submissão da despesa.

:::tip Atalho na criação
Você pode incluir documentos diretamente no body da [criação da despesa](/documentation/iaas/despesas/submissao_despesa/despesa/criacao) — nesse caso, a despesa já entra em `pending_adm_approval` sem precisar chamar este endpoint separadamente.
:::

:::info Tipos de documento aceitos
- `invoice` — Nota fiscal eletrônica (NF-e)
- `calculation_memory` — Memória de cálculo ou planilha de apuração
- `contract` — Contrato do serviço prestado
- `bank_slip` — Boleto bancário
:::

---

## Upload de documento em despesa

ENDPOINT /expense_submission/fund_class/{fund_class_key}/contract/{contract_key}/expense/{expense_key}/document
MÉTODO POST

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `fund_class_key` | string | Chave única do fundo (UUID) |
| `contract_key` | string | Chave única do contrato |
| `expense_key` | string | Chave única da despesa (UUID) |

```json title="Request Body"
{
    "name": "NF-e 001234 - Auditoria jun/2026",
    "document_type": "invoice",
    "document_b64": "JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwKL0xlbmd0aCAzIDAgUgo..."
}
```

### Atributos do body

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `name` | string | obrigatório | Nome do documento. Máximo de 255 caracteres. |
| `document_type` | string | obrigatório | Tipo do documento: `invoice`, `calculation_memory`, `contract` ou `bank_slip`. |
| `document_b64` | string | obrigatório | Conteúdo do arquivo codificado em Base64. |

## Response

STATUS 201

```json title="Response Body"
{
    "name": "NF-e 001234 - Auditoria jun/2026",
    "expense_document_key": "d4e5f6a7-b8c9-0123-def4-567890abcdef",
    "expense_key": "7f3e9a1b-2c4d-5e6f-8901-abcdef234567",
    "document_type": "invoice",
    "status": "pending_adm_approval"
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `name` | string | Nome do documento. |
| `expense_document_key` | string | Chave única do documento (UUID). |
| `expense_key` | string | Chave da despesa à qual o documento pertence. |
| `document_type` | string | Tipo do documento. |
| `status` | string | Status inicial do documento. Sempre retorna `pending_adm_approval`. |

---

## Upload de documento em contrato

Documentos também podem ser vinculados diretamente ao contrato (ex: o contrato do serviço prestado).

ENDPOINT /expense_submission/fund_class/{fund_class_key}/contract/{contract_key}/document
MÉTODO POST

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `fund_class_key` | string | Chave única do fundo (UUID) |
| `contract_key` | string | Chave única do contrato |

O body e os atributos da resposta seguem a mesma estrutura do upload em despesa, com os campos `contract_document_key` e `contract_key` no lugar de `expense_document_key` e `expense_key`.

```json title="Response Body"
{
    "name": "Contrato de Prestação de Serviços - Auditoria 2026",
    "contract_document_key": "e5f6a7b8-c9d0-1234-ef56-7890abcdef12",
    "contract_key": "contrato-auditoria-2026",
    "document_type": "contract",
    "status": "pending_adm_approval"
}
```

---

## Consultar documento por chave

Recupere os dados de um documento e acesse o link para download do arquivo.

### Documento de despesa

ENDPOINT /expense_submission/fund_class/{fund_class_key}/contract/{contract_key}/expense/{expense_key}/document/{document_key}
MÉTODO GET

```json title="Response Body"
{
    "name": "NF-e 001234 - Auditoria jun/2026",
    "expense_document_key": "d4e5f6a7-b8c9-0123-def4-567890abcdef",
    "expense_key": "7f3e9a1b-2c4d-5e6f-8901-abcdef234567",
    "document_type": "invoice",
    "status": "approved",
    "document_url": "https://storage.example.com/documents/NF-001234.pdf?X-Amz-Expires=3600&..."
}
```

| Campo | Tipo | Descrição |
|---|---|---|
| `document_url` | string | URL pré-assinada para download do arquivo. Válida por tempo limitado. |
| `status` | string | Status do documento: `pending_adm_approval`, `approved` ou `rejected`. |

## Possíveis erros

STATUS 404

**Despesa não encontrada**

O conjunto de chaves na URL não corresponde a nenhuma despesa cadastrada.

```json
{
  "title": "Expense Not Found",
  "description": "Expense with key {expense_key} was not found.",
  "translation": "A despesa com chave {expense_key} não foi encontrada.",
  "code": "ESB000016"
}
```

**Documento não encontrado**

O `document_key` informado não corresponde a nenhum documento cadastrado para esta despesa.

```json
{
  "title": "Document Not Found",
  "description": "Document with key {document_key} was not found.",
  "translation": "O documento com chave {document_key} não foi encontrado.",
  "code": "ESB000015"
}
```

STATUS 400

**Formato do documento inválido**

O conteúdo em `document_b64` não é um Base64 válido ou o formato do arquivo não é suportado.

```json
{
  "title": "Invalid Document Format",
  "description": "The document format is invalid.",
  "translation": "Formato do documento invalido.",
  "code": "ESB000014"
}
```

## Próximos passos

Com ao menos um documento em `pending_adm_approval` ou `approved`, a despesa está pronta para ser submetida:

**[Submeter a despesa](/documentation/iaas/despesas/submissao_despesa/despesa/submissao)** — encaminhe para análise da QI Tech.

---

# Fluxo de submissão de despesas

URL: /en/documentation/iaas/despesas/submissao_despesa/fluxo_despesas

Esta página oferece uma visão holística do fluxo de submissão de despesas: desde a criação do contrato até a aprovação das despesas individuais pela QI Tech. Acompanhe a evolução dos **status do contrato**, dos **status de cada despesa** e as ações esperadas em cada etapa.

:::tip Como usar este fluxograma
Passe o mouse sobre cada etapa para ver os detalhes do endpoint e acessar a documentação completa. As trilhas coloridas mostram simultaneamente o que acontece com o contrato e com cada despesa.
:::

{`
.cf-legend{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:24px}
.cf-legend-item{display:flex;align-items:center;gap:6px;font-size:0.8rem;font-weight:600}
.cf-legend-dot{width:12px;height:12px;border-radius:3px}

.cf-step{position:relative;margin-bottom:4px}
.cf-step:not(:last-child)::after{content:'';display:block;width:2px;height:16px;margin:0 auto;background:var(--ifm-color-emphasis-300)}

.cf-card{border:1.5px solid var(--ifm-color-emphasis-200);border-radius:10px;padding:16px 20px;transition:box-shadow 0.2s,border-color 0.2s;cursor:pointer;background:var(--ifm-background-surface-color,var(--ifm-background-color))}
.cf-card:hover{box-shadow:0 4px 16px rgba(0,0,0,0.08);border-color:var(--ifm-color-primary)}

.cf-card-header{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.cf-num{width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:0.8rem;font-weight:800;color:#fff;flex-shrink:0}
.cf-num-int{background:#3b82f6}
.cf-num-qi{background:#8b5cf6}
.cf-title{font-size:1rem;font-weight:700;color:var(--ifm-font-color-base)}
.cf-actor{font-size:0.7rem;font-weight:700;padding:2px 8px;border-radius:12px;margin-left:auto}
.cf-actor-int{background:rgba(59,130,246,0.12);color:#2563eb}
.cf-actor-qi{background:rgba(139,92,246,0.12);color:#7c3aed}
.cf-subtitle{font-size:0.82rem;color:var(--ifm-color-emphasis-700);margin-top:4px;margin-left:38px}

.cf-tracks{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;margin-left:38px}
.cf-track{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:6px;font-size:0.75rem;font-family:var(--ifm-font-family-monospace);border:1px solid}
.cf-track-contrato{background:rgba(34,197,94,0.1);color:#16a34a;border-color:rgba(34,197,94,0.25)}
.cf-track-despesa{background:rgba(59,130,246,0.1);color:#2563eb;border-color:rgba(59,130,246,0.25)}
.cf-track-err{background:rgba(239,68,68,0.1);color:#dc2626;border-color:rgba(239,68,68,0.25)}
.cf-track-label{font-family:var(--ifm-font-family-base);font-weight:700;font-size:0.7rem;text-transform:uppercase;letter-spacing:0.03em}
.cf-new{font-weight:700}
.cf-unchanged{opacity:0.5}

.cf-details{max-height:0;overflow:hidden;opacity:0;transition:max-height 0.35s ease,opacity 0.25s ease,margin 0.3s ease;margin-left:38px}
.cf-card:hover .cf-details{max-height:300px;opacity:1;margin-top:14px;padding-top:12px;border-top:1px solid var(--ifm-color-emphasis-200)}

.cf-endpoint{font-family:var(--ifm-font-family-monospace);font-size:0.82rem;padding:8px 12px;border-radius:6px;background:var(--ifm-color-emphasis-100);margin-bottom:8px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.cf-method{font-weight:800;padding:2px 6px;border-radius:4px;font-size:0.72rem}
.cf-method-post{background:#f97316;color:#fff}
.cf-method-put{background:#3b82f6;color:#fff}
.cf-method-get{background:#22c55e;color:#fff}
.cf-desc{font-size:0.82rem;color:var(--ifm-color-emphasis-700);margin-bottom:8px}
.cf-link{font-size:0.82rem;font-weight:600;color:var(--ifm-color-primary);text-decoration:none}
.cf-link:hover{text-decoration:underline}

.cf-branch{margin-top:12px;margin-left:38px;display:flex;gap:12px;flex-wrap:wrap}
.cf-branch-path{flex:1;min-width:200px;border-radius:8px;padding:10px 14px;border:1.5px dashed}
.cf-branch-ok{border-color:rgba(34,197,94,0.4);background:rgba(34,197,94,0.05)}
.cf-branch-err{border-color:rgba(239,68,68,0.4);background:rgba(239,68,68,0.05)}
.cf-branch-label{font-size:0.78rem;font-weight:700;margin-bottom:4px}
.cf-branch-label-ok{color:#16a34a}
.cf-branch-label-err{color:#dc2626}

html[data-theme='dark'] .cf-track-contrato{background:rgba(34,197,94,0.15);color:#4ade80;border-color:rgba(34,197,94,0.3)}
html[data-theme='dark'] .cf-track-despesa{background:rgba(59,130,246,0.15);color:#60a5fa;border-color:rgba(59,130,246,0.3)}
html[data-theme='dark'] .cf-track-err{background:rgba(239,68,68,0.15);color:#f87171;border-color:rgba(239,68,68,0.3)}
html[data-theme='dark'] .cf-branch-ok{background:rgba(34,197,94,0.08)}
html[data-theme='dark'] .cf-branch-err{background:rgba(239,68,68,0.08)}
html[data-theme='dark'] .cf-actor-int{background:rgba(59,130,246,0.2);color:#60a5fa}
html[data-theme='dark'] .cf-actor-qi{background:rgba(139,92,246,0.2);color:#a78bfa}
`}

## Legenda

Agente Integrador
QI Tech (análise manual)
Status do Contrato
Status da Despesa

## Fluxograma

1
Criação do contrato
Agente Integrador
Cria um contrato vinculando o fundo a um fornecedor e definindo o tipo de despesa ( expense_type ) e a natureza de submissão ( submission_nature ).
Contrato: created
POST /expense_submission/fund_class/{fund_class_key}/contract
O contrato fica pronto para ser atualizado ou submetido para aprovação.
Ver documentação completa →

2
Submissão do contrato para aprovação
Agente Integrador
Sinaliza que o contrato está pronto para análise da QI Tech. Após a submissão, o contrato não pode mais ser editado.
Contrato: pending_adm_approval
PUT /expense_submission/fund_class/{fund_class_key}/contract/{contract_key}/submit
O contrato aguarda revisão manual pela equipe da QI Tech.
Ver documentação completa →

3
Análise e aprovação do contrato
QI Tech
A equipe da QI Tech analisa o contrato. Em caso de dúvidas, podem criar anotações que o agente integrador poderá responder.
Contrato aprovado
approved
Despesas podem ser criadas e submetidas.
Contrato rejeitado
rejected
Nenhuma despesa poderá ser criada neste contrato.
Use o endpoint de consulta para acompanhar o status do contrato.
GET /expense_submission/fund_class/{fund_class_key}/contract/{contract_key}
Ver documentação completa →

4
Criação da despesa
Agente Integrador
Cria uma despesa individual sob o contrato aprovado, informando dados de pagamento, período de competência e documentos comprobatórios. Ao incluir documentos na criação, a despesa é automaticamente encaminhada para revisão.
Contrato: approved
Despesa: created → pending_adm_approval*
POST /expense_submission/fund_class/{fund_class_key}/contract/{contract_key}/expense
*Se documentos forem incluídos no body da criação, a despesa vai diretamente para pending_adm_approval . Caso contrário, fica em created .
Ver documentação completa →

5
Upload de documentos (quando necessário)
Agente Integrador
Se os documentos não foram enviados na criação da despesa, faça o upload separadamente antes de submeter. Ao menos um documento é obrigatório para submissão.
Despesa: created
POST /expense_submission/fund_class/{fund_class_key}/contract/{contract_key}/expense/{expense_key}/document
Envie os documentos comprobatórios (NF, memória de cálculo, contrato ou boleto) em Base64.
Ver documentação completa →

6
Submissão da despesa para aprovação
Agente Integrador
Encaminha a despesa para análise da QI Tech. Obrigatório ter ao menos um documento anexado.
Despesa: pending_adm_approval
PUT /expense_submission/fund_class/{fund_class_key}/contract/{contract_key}/expense/{expense_key}/submit
Somente aplicável quando a despesa foi criada sem documentos ( status = created ). Caso contrário, a despesa já estará em pending_adm_approval .
Ver documentação completa →

7
Análise e aprovação da despesa
QI Tech
A QI Tech analisa os dados de pagamento e os documentos comprobatórios. Após aprovação, a despesa é processada internamente e registrada na carteira do fundo.
Despesa aprovada
approved
Despesa registrada. Fluxo encerrado com sucesso.
Despesa rejeitada
rejected
Verifique as anotações da QI Tech para entender o motivo da rejeição.
Use o endpoint de consulta para acompanhar o status da despesa.
GET /expense_submission/fund_class/{fund_class_key}/contract/{contract_key}/expense/{expense_key}
Ver documentação completa →

---

# Anotações da Análise

URL: /en/documentation/iaas/despesas/submissao_despesa/fornecedor/anotacoes

Durante a revisão, a equipe da QI Tech pode abrir **anotações** — solicitações de esclarecimento ou correção sobre os dados do fornecedor ou os documentos enviados. O agente integrador deve responder a essas anotações para que a análise prossiga.

:::info Status das anotações
| Status | Descrição |
|---|---|
| `created` | Anotação criada pela QI Tech |
| `opened` | Anotação aberta, aguardando resposta |
| `closed` | Anotação respondida ou encerrada |
:::

---

## Listar anotações de uma análise

ENDPOINT /vendor_registry/analysis/{analysis_key}/annotations
MÉTODO GET

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `analysis_key` | string | Chave única da análise (UUID) |

### Query params

| Parâmetro | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `status` | string (lista) | opcional | Filtra anotações pelo status. Valores: `created`, `opened`, `closed`. Aceita múltiplos valores. |
| `limit` | integer | opcional | Número de itens por página. Mínimo: `0`. Máximo: `1000`. Padrão: `10`. |
| `page` | integer | opcional | Número da página (base zero). Padrão: `0`. |

## Response

STATUS 200

```json title="Response Body"
{
    "data": [
        {
            "annotation_key": "f6a7b8c9-d0e1-2345-f678-90abcdef1234",
            "annotation_message": "Por favor, envie o contrato social atualizado com as últimas alterações societárias.",
            "annotation_response": null,
            "annotation_datetime": "2026-06-10 14:32:00",
            "analysis_key": "c3d4e5f6-a7b8-9012-cdef-345678901234",
            "status": "opened"
        }
    ],
    "limit": 10,
    "page": 0,
    "is_last_page": true
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `data` | array | Lista de anotações. |
| `limit` | integer | Número de itens por página utilizado na consulta. |
| `page` | integer | Número da página atual. |
| `is_last_page` | boolean | Indica se esta é a última página de resultados. |

#### Atributos de cada anotação em `data`

| Campo | Tipo | Descrição |
|---|---|---|
| `annotation_key` | string | Chave única da anotação (UUID). |
| `annotation_message` | string | Mensagem da anotação criada pela QI Tech. |
| `annotation_response` | string \| null | Resposta do agente integrador, ou `null` se ainda não respondida. |
| `annotation_datetime` | string | Data e hora em que a anotação foi criada. |
| `analysis_key` | string | Chave da análise à qual a anotação pertence. |
| `status` | string | Status da anotação: `created`, `opened` ou `closed`. |

---

## Consultar anotação por chave

ENDPOINT /vendor_registry/analysis/{analysis_key}/annotation/{annotation_key}
MÉTODO GET

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `analysis_key` | string | Chave única da análise (UUID) |
| `annotation_key` | string | Chave única da anotação (UUID) |

## Response

STATUS 200

```json title="Response Body"
{
    "annotation_key": "f6a7b8c9-d0e1-2345-f678-90abcdef1234",
    "annotation_message": "Por favor, envie o contrato social atualizado com as últimas alterações societárias.",
    "annotation_response": null,
    "annotation_datetime": "2026-06-10 14:32:00",
    "analysis_key": "c3d4e5f6-a7b8-9012-cdef-345678901234",
    "status": "opened"
}
```

---

## Responder a uma anotação

ENDPOINT /vendor_registry/analysis/{analysis_key}/annotation/{annotation_key}/respond
MÉTODO PUT

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `analysis_key` | string | Chave única da análise (UUID) |
| `annotation_key` | string | Chave única da anotação (UUID) |

```json title="Request Body"
{
    "annotation_response": "O contrato social atualizado foi enviado no documento 'Contrato Social - AUDITORES EXEMPLO S.A.'."
}
```

### Atributos do body

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `annotation_response` | string | obrigatório | Resposta à anotação. Máximo de 200 caracteres. |

## Response

STATUS 202

```json title="Response Body"
{
    "annotation_key": "f6a7b8c9-d0e1-2345-f678-90abcdef1234",
    "annotation_message": "Por favor, envie o contrato social atualizado com as últimas alterações societárias.",
    "annotation_response": "O contrato social atualizado foi enviado no documento 'Contrato Social - AUDITORES EXEMPLO S.A.'.",
    "annotation_datetime": "2026-06-10 14:32:00",
    "analysis_key": "c3d4e5f6-a7b8-9012-cdef-345678901234",
    "status": "closed"
}
```

---

## Possíveis erros

STATUS 404

**Anotação não encontrada**

A `annotation_key` informada na URL não corresponde a nenhuma anotação desta análise.

```json
{
  "title": "Annotation not found",
  "description": "Annotation with the key {annotation_key} was not found.",
  "translation": "A anotação com a chave {annotation_key} não foi encontrada.",
  "code": "VRG0000012"
}
```

STATUS 409

**Anotação já respondida**

A anotação informada já possui uma resposta registrada.

```json
{
  "title": "Annotation Already Responded",
  "description": "Annotation with key {annotation_key} is already responded.",
  "translation": "Anotação com chave {annotation_key} está respondida.",
  "code": "VRG0000013"
}
```

---

## Próximos passos

Após responder às anotações, aguarde a QI Tech retomar a análise. Acompanhe o status via:

**[Consultar análise por chave](/documentation/iaas/despesas/submissao_despesa/fornecedor/listagem#consultar-análise-por-chave)** — monitore o andamento da análise.

---

# Atualização de Dados da Análise

URL: /en/documentation/iaas/despesas/submissao_despesa/fornecedor/atualizacao

Enquanto a análise estiver no status `pending_submission`, é possível atualizar os dados de pagamento e a flag `requires_invoice`. Após submeter para `pending_adm_approval`, a edição não é mais permitida.

:::caution Restrição de status
Este endpoint só aceita atualizações quando a análise está no status `pending_submission`. Se a análise foi retornada pela QI Tech para este status, também é possível editar antes de reenviar.
:::

---

## Request

ENDPOINT /vendor_registry/analysis/{analysis_key}/update
MÉTODO PUT

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `analysis_key` | string | Chave única da análise (UUID) |

```json title="Request Body"
{
    "requires_invoice": false,
    "payment_method": "transfer",
    "payment": {
        "target": {
            "name": "AUDITORES EXEMPLO S.A.",
            "document_number": "12.345.678/0001-90"
        },
        "target_pix_key": "12345678000190",
        "transfer_type": "pix"
    }
}
```

### Atributos do body

Ao menos um campo deve ser informado.

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `requires_invoice` | boolean | opcional | Indica se esta análise exige nota fiscal. |
| `payment_method` | string | opcional | Método de pagamento padrão. Atualmente suporta apenas `transfer`. Obrigatório quando `payment` é informado. |
| `payment` | object | opcional | Dados bancários do fornecedor. Consulte os [atributos de `payment`](/documentation/iaas/despesas/submissao_despesa/fornecedor/criacao#atributos-de-payment). Obrigatório quando `payment_method` é informado. |

:::info Limpeza dos dados de pagamento
Se apenas um dos campos `payment` ou `payment_method` for informado (sem o outro), ambos serão removidos da análise.
:::

---

## Response

STATUS 200

```json title="Response Body"
{
    "analysis_key": "c3d4e5f6-a7b8-9012-cdef-345678901234",
    "status": "pending_submission",
    "requires_invoice": false,
    "manager": {
        "name": "EXEMPLO GESTORA LTDA",
        "manager_key": "a7498c6c-1893-42ec-a8f3-bc6ad0c6b52c",
        "document_number": "45.585.471/0001-47"
    },
    "vendor": {
        "vendor_key": "3571e292-3a83-4011-904d-20ee963022ef",
        "name": "AUDITORES EXEMPLO S.A.",
        "document_number": "12.345.678/0001-90",
        "requires_invoice": true,
        "status": "pending_analysis"
    },
    "payment_method": "transfer",
    "payment": {
        "target": {
            "name": "AUDITORES EXEMPLO S.A.",
            "document_number": "12.345.678/0001-90"
        },
        "target_pix_key": "12345678000190",
        "transfer_type": "pix"
    }
}
```

---

## Possíveis erros

STATUS 409

**Análise não editável**

A análise está em um status que não permite edição. Somente análises no status `pending_submission` podem ser editadas via este endpoint.

```json
{
  "title": "Analysis Not Editable",
  "description": "Analysis with key {analysis_key} is on status '{current_status}' and cannot be edited.",
  "translation": "A análise com chave {analysis_key} está no status '{current_status}' e não pode ser editada.",
  "code": "VRG000032"
}
```

STATUS 404

**Análise não encontrada**

A `analysis_key` informada na URL não corresponde a nenhuma análise cadastrada.

```json
{
  "title": "Analysis not found",
  "description": "Analysis with the key {analysis_key} was not found.",
  "translation": "A análise com a chave {analysis_key} não foi encontrada.",
  "code": "VRG000007"
}
```

---

## Próximos passos

Após atualizar os dados, prossiga para:

**[Submeter a análise](/documentation/iaas/despesas/submissao_despesa/fornecedor/submissao)** — encaminhe para revisão da QI Tech.

---

# Cancelamento da Análise

URL: /en/documentation/iaas/despesas/submissao_despesa/fornecedor/cancelamento

Cancele uma análise de cadastro de fornecedor que ainda esteja em andamento. Após o cancelamento, nenhuma alteração adicional pode ser feita nessa análise.

:::info Quando é possível cancelar
O cancelamento está disponível enquanto a análise estiver nos status `pending_submission` ou `pending_adm_approval`. Análises já `approved`, `rejected` ou `canceled` não podem ser canceladas.
:::

---

## Request

ENDPOINT /vendor_registry/analysis/{analysis_key}/cancel
MÉTODO PUT

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `analysis_key` | string | Chave única da análise (UUID) |

Este endpoint não requer body.

## Response

STATUS 202

```json title="Response Body"
{
    "analysis_key": "c3d4e5f6-a7b8-9012-cdef-345678901234",
    "status": "canceled"
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `analysis_key` | string | Chave única da análise. |
| `status` | string | Novo status da análise. Sempre retorna `canceled`. |

---

## Possíveis erros

STATUS 409

**Transição de status não permitida**

A análise está em um status que não permite cancelamento (por exemplo, já foi aprovada ou rejeitada).

```json
{
  "title": "Analysis Status Transition Denied",
  "description": "Analysis with key {analysis_key} is not allowed to switch status from {current_status} to canceled.",
  "translation": "Análise com chave {analysis_key} não pode trocar de status de {current_status} para canceled.",
  "code": "VRG000008"
}
```

STATUS 404

**Análise não encontrada**

A `analysis_key` informada na URL não corresponde a nenhuma análise cadastrada.

```json
{
  "title": "Analysis not found",
  "description": "Analysis with the key {analysis_key} was not found.",
  "translation": "A análise com a chave {analysis_key} não foi encontrada.",
  "code": "VRG000007"
}
```

---

## Próximos passos

Para cadastrar o fornecedor novamente, inicie um novo processo via:

**[Criação de análise](/documentation/iaas/despesas/submissao_despesa/fornecedor/criacao)** — submeta os dados do fornecedor novamente.

---

# Cadastro de Fornecedor

URL: /en/documentation/iaas/despesas/submissao_despesa/fornecedor/criacao

O cadastro de fornecedores é o **pré-requisito** para a criação de contratos de despesa. O processo é realizado pelo próprio agente integrador via API e passa por análise e aprovação da QI Tech antes de o fornecedor ser ativado na plataforma.

:::info Fluxo de cadastro
O cadastro de um fornecedor segue as seguintes etapas:

1. **Criação da análise** — envio dos dados do fornecedor (esta página)
2. **Upload de documentos** — anexar documentos comprobatórios
3. **Submissão para revisão** — encaminhar para análise da QI Tech
4. **Resposta a anotações** (se solicitado) — responder às solicitações da equipe de análise
5. **Aprovação** — o fornecedor é ativado e a `vendor_key` fica disponível para uso em contratos

Para detalhes sobre as etapas seguintes, consulte:
- [Upload de documentos](/documentation/iaas/despesas/submissao_despesa/fornecedor/documentos)
- [Submissão para análise](/documentation/iaas/despesas/submissao_despesa/fornecedor/submissao)
- [Anotações](/documentation/iaas/despesas/submissao_despesa/fornecedor/anotacoes)
:::

---

## Request

ENDPOINT /vendor_registry/analysis
MÉTODO POST

```json title="Request Body"
{
    "vendor_document_number": "12.345.678/0001-90",
    "vendor_name": "AUDITORES EXEMPLO S.A.",
    "requires_invoice": true,
    "payment_method": "transfer",
    "payment": {
        "target": {
            "name": "AUDITORES EXEMPLO S.A.",
            "document_number": "12.345.678/0001-90"
        },
        "target_account": {
            "account_number": "123456",
            "account_branch": "0001",
            "account_digit": "0",
            "financial_institution_code": "341"
        }
    }
}
```

### Atributos do body

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `vendor_document_number` | string | obrigatório | CPF ou CNPJ do fornecedor com pontuação. Mínimo 14, máximo 18 caracteres. |
| `vendor_name` | string | obrigatório | Nome completo do fornecedor. Máximo de 255 caracteres. |
| `requires_invoice` | boolean | opcional | Indica se o fornecedor exige nota fiscal para pagamento. Padrão: `false`. |
| `payment_method` | string | opcional | Método de pagamento padrão do fornecedor. Atualmente suporta apenas `transfer`. Obrigatório quando `payment` é informado. |
| `payment` | object | opcional | Dados bancários padrão do fornecedor. Ver [Atributos de `payment`](#atributos-de-payment). Obrigatório quando `payment_method` é informado. |

#### Atributos de `payment`

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `target` | object | obrigatório | Dados do beneficiário do pagamento. |
| `target.name` | string | obrigatório | Nome do beneficiário. |
| `target.document_number` | string | obrigatório | CPF ou CNPJ do beneficiário com pontuação. |
| `target_account` | object | opcional | Dados da conta bancária de destino (TED/DOC). Obrigatório quando `transfer_type` não é informado ou é `wire_transfer`. |
| `target_account.account_number` | string | obrigatório | Número da conta (1–20 dígitos, não pode ser zeros). |
| `target_account.account_branch` | string | obrigatório | Agência bancária (exatamente 4 dígitos, não pode ser zeros). |
| `target_account.account_digit` | string | obrigatório | Dígito verificador da conta (1 dígito). |
| `target_account.financial_institution_code` | string | obrigatório | Código do banco (exatamente 3 dígitos, não pode ser zeros). |
| `target_account.financial_institution_ispb` | string | opcional | ISPB do banco (exatamente 8 dígitos). Quando não informado, é preenchido automaticamente com base no `financial_institution_code`. |
| `target_account.account_type` | string | opcional | Tipo da conta bancária. |
| `transfer_type` | string | opcional | Tipo de transferência. Informe `pix` para pagamento via Pix. Quando omitido, o pagamento é via TED/DOC. |
| `target_pix_key` | string | opcional | Chave Pix do destinatário (máx. 77 caracteres). Obrigatório quando `transfer_type` é `pix` e `target_account` não é informado. A chave Pix deve pertencer ao CPF/CNPJ de `target.document_number`. |

---

## Response

STATUS 201

```json title="Response Body"
{
    "analysis_key": "c3d4e5f6-a7b8-9012-cdef-345678901234",
    "status": "pending_submission",
    "requires_invoice": true,
    "manager": {
        "name": "EXEMPLO GESTORA LTDA",
        "manager_key": "a7498c6c-1893-42ec-a8f3-bc6ad0c6b52c",
        "document_number": "45.585.471/0001-47"
    },
    "vendor": {
        "vendor_key": "3571e292-3a83-4011-904d-20ee963022ef",
        "name": "AUDITORES EXEMPLO S.A.",
        "document_number": "12.345.678/0001-90",
        "requires_invoice": true,
        "status": "pending_analysis"
    },
    "payment_method": "transfer",
    "payment": {
        "target": {
            "name": "AUDITORES EXEMPLO S.A.",
            "document_number": "12.345.678/0001-90"
        },
        "target_account": {
            "account_number": "123456",
            "account_branch": "0001",
            "account_digit": "0",
            "financial_institution_code": "341",
            "financial_institution_ispb": "60701190"
        }
    }
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `analysis_key` | string | Chave única da análise (UUID). Guarde este valor para as próximas etapas. |
| `status` | string | Status inicial da análise. Sempre retorna `pending_submission`. |
| `requires_invoice` | boolean | Indica se esta análise exige nota fiscal. |
| `manager` | object | Dados do gestor autenticado. |
| `manager.name` | string | Nome do gestor. |
| `manager.manager_key` | string | Chave única do gestor (UUID). |
| `manager.document_number` | string | CNPJ do gestor. |
| `vendor` | object | Dados do fornecedor. |
| `vendor.vendor_key` | string | Chave única do fornecedor. Disponível após aprovação para uso em contratos. |
| `vendor.name` | string | Nome do fornecedor. |
| `vendor.document_number` | string | CPF ou CNPJ do fornecedor. |
| `vendor.requires_invoice` | boolean | Indica se o fornecedor exige nota fiscal. |
| `vendor.status` | string | Status do fornecedor: `pending_analysis` enquanto a análise estiver em curso. |
| `payment_method` | string | Método de pagamento, quando informado. |
| `payment` | object | Dados bancários, quando informados. |

---

## Possíveis erros

STATUS 409

**Fornecedor já ativo**

Já existe um fornecedor ativo (`status = active`) com o CNPJ/CPF informado. Utilize a [listagem de fornecedores](/documentation/iaas/despesas/submissao_despesa/fornecedor/listagem) para obter a `vendor_key`.

```json
{
  "title": "Vendor already exists",
  "description": "Already exists an active vendor with the document number {vendor_document_number}.",
  "translation": "Já existe um fornecedor ativo com o cnpj {vendor_document_number}.",
  "code": "VRG000015"
}
```

STATUS 404

**Gestor não encontrado**

O `manager_key` do agente autenticado não corresponde a nenhum gestor cadastrado na plataforma.

```json
{
  "title": "Manager not found",
  "description": "Manager with the key {manager_key} was not found.",
  "translation": "O gestor com a chave {manager_key} não foi encontrado.",
  "code": "VRG000001"
}
```

STATUS 400

**Número de documento inválido**

O CPF ou CNPJ informado em `vendor_document_number` não é válido.

```json
{
  "title": "Invalid document number",
  "description": "The document number {vendor_document_number} is invalid.",
  "translation": "O documento {vendor_document_number} é inválido.",
  "code": "VRG000002"
}
```

---

## Próximos passos

Com a análise criada (status `pending_submission`), as próximas etapas são:

1. **[Upload de documentos](/documentation/iaas/despesas/submissao_despesa/fornecedor/documentos)** — anexe o contrato social e documentos dos representantes.
2. **[Submissão para análise](/documentation/iaas/despesas/submissao_despesa/fornecedor/submissao)** — encaminhe a análise para revisão da QI Tech.

---

# Documentos da Análise

URL: /en/documentation/iaas/despesas/submissao_despesa/fornecedor/documentos

Após [criar a análise](/documentation/iaas/despesas/submissao_despesa/fornecedor/criacao), faça o upload dos documentos comprobatórios do fornecedor. É obrigatório ter ao menos um documento antes de [submeter a análise para revisão](/documentation/iaas/despesas/submissao_despesa/fornecedor/submissao).

:::info Tipos de documento aceitos
- `vendor_bylaws` — Contrato social do fornecedor
- `representative_document` — Documento de identificação do representante legal
:::

:::info Status inicial
Documentos enviados via API entram automaticamente com status `pending_adm_approval`, aguardando revisão da QI Tech.
:::

---

## Upload de documento

ENDPOINT /vendor_registry/analysis/{analysis_key}/document
MÉTODO POST

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `analysis_key` | string | Chave única da análise (UUID) |

```json title="Request Body"
{
    "name": "Contrato Social - AUDITORES EXEMPLO S.A.",
    "document_type": "vendor_bylaws",
    "document_b64": "JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwKL0xlbmd0aCAzIDAgUgo..."
}
```

### Atributos do body

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `name` | string | obrigatório | Nome do documento. Máximo de 255 caracteres. |
| `document_type` | string | obrigatório | Tipo do documento: `vendor_bylaws` ou `representative_document`. |
| `document_b64` | string | obrigatório | Conteúdo do arquivo codificado em Base64. |

## Response

STATUS 201

```json title="Response Body"
{
    "document_name": "Contrato Social - AUDITORES EXEMPLO S.A.",
    "document_key": "d4e5f6a7-b8c9-0123-def4-567890abcdef",
    "document_type": "vendor_bylaws",
    "analysis_key": "c3d4e5f6-a7b8-9012-cdef-345678901234",
    "status": "pending_adm_approval"
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `document_name` | string | Nome do documento. |
| `document_key` | string | Chave única do documento (UUID). |
| `document_type` | string | Tipo do documento: `vendor_bylaws` ou `representative_document`. |
| `analysis_key` | string | Chave da análise à qual o documento pertence. |
| `status` | string | Status do documento. Sempre retorna `pending_adm_approval`. |

---

## Listar documentos de uma análise

ENDPOINT /vendor_registry/analysis/{analysis_key}/documents
MÉTODO GET

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `analysis_key` | string | Chave única da análise (UUID) |

## Response

STATUS 200

```json title="Response Body"
{
    "data": [
        {
            "document_name": "Contrato Social - AUDITORES EXEMPLO S.A.",
            "document_key": "d4e5f6a7-b8c9-0123-def4-567890abcdef",
            "document_type": "vendor_bylaws",
            "analysis_key": "c3d4e5f6-a7b8-9012-cdef-345678901234",
            "status": "pending_adm_approval"
        },
        {
            "document_name": "RG - João da Silva",
            "document_key": "e5f6a7b8-c9d0-1234-ef56-7890abcdef12",
            "document_type": "representative_document",
            "analysis_key": "c3d4e5f6-a7b8-9012-cdef-345678901234",
            "status": "approved"
        }
    ]
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `data` | array | Lista de documentos da análise. |
| `data[].document_name` | string | Nome do documento. |
| `data[].document_key` | string | Chave única do documento (UUID). |
| `data[].document_type` | string | Tipo do documento. |
| `data[].analysis_key` | string | Chave da análise. |
| `data[].status` | string | Status do documento: `pending_adm_approval`, `approved` ou `rejected`. |

---

## Consultar documento por chave

Recupere os dados de um documento específico, incluindo URL de download.

ENDPOINT /vendor_registry/analysis/{analysis_key}/documents/{document_key}
MÉTODO GET

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `analysis_key` | string | Chave única da análise (UUID) |
| `document_key` | string | Chave única do documento (UUID) |

## Response

STATUS 200

```json title="Response Body"
{
    "document_name": "Contrato Social - AUDITORES EXEMPLO S.A.",
    "document_key": "d4e5f6a7-b8c9-0123-def4-567890abcdef",
    "document_type": "vendor_bylaws",
    "analysis_key": "c3d4e5f6-a7b8-9012-cdef-345678901234",
    "status": "approved",
    "document_url": "https://storage.example.com/documents/d4e5f6a7-b8c9-0123-def4-567890abcdef?X-Amz-Expires=86400&..."
}
```

### Atributos adicionais

| Campo | Tipo | Descrição |
|---|---|---|
| `document_url` | string | URL pré-assinada para download do arquivo. Válida por 24 horas. |

---

## Possíveis erros

STATUS 404

**Análise não encontrada**

A `analysis_key` informada na URL não corresponde a nenhuma análise cadastrada.

```json
{
  "title": "Analysis not found",
  "description": "Analysis with the key {analysis_key} was not found.",
  "translation": "A análise com a chave {analysis_key} não foi encontrada.",
  "code": "VRG000007"
}
```

**Documento não encontrado**

A `document_key` informada na URL não corresponde a nenhum documento desta análise.

```json
{
  "title": "Document not found",
  "description": "Document with the key {document_key} was not found.",
  "translation": "O documento com a chave {document_key} não foi encontrada.",
  "code": "VRG000003"
}
```

STATUS 400

**Formato do documento inválido**

O conteúdo em `document_b64` não é um Base64 válido.

```json
{
  "title": "Invalid document format",
  "description": "Invalid Document format",
  "translation": "Formato do documento invalido",
  "code": "VRG000004"
}
```

---

## Próximos passos

Com ao menos um documento enviado, prossiga para:

**[Submeter a análise](/documentation/iaas/despesas/submissao_despesa/fornecedor/submissao)** — encaminhe para revisão da QI Tech.

---

# Consulta de Fornecedores e Análises

URL: /en/documentation/iaas/despesas/submissao_despesa/fornecedor/listagem

Recupere os fornecedores ativos e acompanhe o andamento das análises de cadastro em curso.

---

## Listar fornecedores

ENDPOINT /vendor_registry/vendors
MÉTODO GET

### Query params

| Parâmetro | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `name` | string | opcional | Filtra fornecedores cujo nome contenha o valor informado (busca parcial, sem distinção de maiúsculas/minúsculas). |
| `document_number` | string | opcional | Filtra pelo CPF ou CNPJ exato do fornecedor. |
| `status` | string (lista) | opcional | Filtra pelo status do fornecedor. Valores: `pending_analysis`, `active`, `inactive`. Aceita múltiplos valores. |
| `limit` | integer | opcional | Número de itens por página. Mínimo: `0`. Máximo: `1000`. Padrão: `10`. |
| `page` | integer | opcional | Número da página (base zero). Padrão: `0`. |

## Response

STATUS 200

```json title="Response Body"
{
    "data": [
        {
            "vendor_key": "3571e292-3a83-4011-904d-20ee963022ef",
            "name": "AUDITORES EXEMPLO S.A.",
            "document_number": "12.345.678/0001-90",
            "requires_invoice": true,
            "status": "active",
            "payment_method": "transfer"
        },
        {
            "vendor_key": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
            "name": "CVM",
            "document_number": "29.507.878/0001-08",
            "requires_invoice": true,
            "status": "active"
        }
    ],
    "limit": 10,
    "page": 0,
    "is_last_page": true
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `data` | array | Lista de fornecedores. |
| `limit` | integer | Número de itens por página utilizado na consulta. |
| `page` | integer | Número da página atual. |
| `is_last_page` | boolean | Indica se esta é a última página de resultados. |

#### Atributos de cada fornecedor em `data`

| Campo | Tipo | Descrição |
|---|---|---|
| `vendor_key` | string | Chave única do fornecedor. Use este valor na criação de contratos. |
| `name` | string | Nome do fornecedor. |
| `document_number` | string | CPF ou CNPJ do fornecedor. |
| `requires_invoice` | boolean | Indica se o fornecedor exige nota fiscal. |
| `status` | string | Status do fornecedor: `pending_analysis`, `active` ou `inactive`. |
| `payment_method` | string | Método de pagamento padrão, quando cadastrado. |
| `payment` | object | Dados bancários padrão, quando cadastrados. |

#### Status do fornecedor

| Status | Descrição |
|---|---|
| `pending_analysis` | Fornecedor com análise de cadastro em andamento |
| `active` | Fornecedor aprovado e disponível para uso em contratos |
| `inactive` | Fornecedor inativo |

---

## Consultar fornecedor por chave

ENDPOINT /vendor_registry/vendor/{vendor_key}
MÉTODO GET

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `vendor_key` | string | Chave única do fornecedor (UUID, 36 caracteres) |

## Response

STATUS 200

```json title="Response Body"
{
    "vendor_key": "3571e292-3a83-4011-904d-20ee963022ef",
    "name": "AUDITORES EXEMPLO S.A.",
    "document_number": "12.345.678/0001-90",
    "requires_invoice": true,
    "status": "active",
    "payment_method": "transfer",
    "payment": {
        "target": {
            "name": "AUDITORES EXEMPLO S.A.",
            "document_number": "12.345.678/0001-90"
        },
        "target_account": {
            "account_number": "123456",
            "account_branch": "0001",
            "account_digit": "0",
            "financial_institution_code": "341",
            "financial_institution_ispb": "60701190"
        }
    }
}
```

## Possíveis erros

STATUS 404

**Fornecedor não encontrado**

A `vendor_key` informada não corresponde a nenhum fornecedor cadastrado.

```json
{
  "title": "Vendor not found",
  "description": "Vendor with the key {vendor_key} was not found.",
  "translation": "O fornecedor com a chave {vendor_key} não foi encontrada.",
  "code": "VRG000014"
}
```

---

## Listar análises

ENDPOINT /vendor_registry/analyses
MÉTODO GET

### Query params

| Parâmetro | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `status` | string (lista) | opcional | Filtra pelo status da análise. Valores: `pending_submission`, `pending_adm_approval`, `approved`, `rejected`, `canceled`, `other_analysis_approved`. Aceita múltiplos valores. |
| `manager_key` | string | opcional | Filtra as análises de um gestor específico. |
| `vendor_key` | string | opcional | Filtra as análises de um fornecedor específico. |
| `limit` | integer | opcional | Número de itens por página. Mínimo: `0`. Máximo: `1000`. Padrão: `10`. |
| `page` | integer | opcional | Número da página (base zero). Padrão: `0`. |

## Response

STATUS 200

```json title="Response Body"
{
    "data": [
        {
            "analysis_key": "c3d4e5f6-a7b8-9012-cdef-345678901234",
            "status": "pending_adm_approval",
            "requires_invoice": true,
            "manager": {
                "name": "EXEMPLO GESTORA LTDA",
                "manager_key": "a7498c6c-1893-42ec-a8f3-bc6ad0c6b52c",
                "document_number": "45.585.471/0001-47"
            },
            "vendor": {
                "vendor_key": "3571e292-3a83-4011-904d-20ee963022ef",
                "name": "AUDITORES EXEMPLO S.A.",
                "document_number": "12.345.678/0001-90",
                "requires_invoice": true,
                "status": "pending_analysis"
            }
        }
    ],
    "limit": 10,
    "page": 0,
    "is_last_page": true
}
```

---

## Consultar análise por chave

ENDPOINT /vendor_registry/analysis/{analysis_key}
MÉTODO GET

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `analysis_key` | string | Chave única da análise (UUID) |

## Response

STATUS 200

```json title="Response Body"
{
    "analysis_key": "c3d4e5f6-a7b8-9012-cdef-345678901234",
    "status": "pending_adm_approval",
    "requires_invoice": true,
    "manager": {
        "name": "EXEMPLO GESTORA LTDA",
        "manager_key": "a7498c6c-1893-42ec-a8f3-bc6ad0c6b52c",
        "document_number": "45.585.471/0001-47"
    },
    "vendor": {
        "vendor_key": "3571e292-3a83-4011-904d-20ee963022ef",
        "name": "AUDITORES EXEMPLO S.A.",
        "document_number": "12.345.678/0001-90",
        "requires_invoice": true,
        "status": "pending_analysis"
    },
    "payment_method": "transfer",
    "payment": {
        "target": {
            "name": "AUDITORES EXEMPLO S.A.",
            "document_number": "12.345.678/0001-90"
        },
        "target_account": {
            "account_number": "123456",
            "account_branch": "0001",
            "account_digit": "0",
            "financial_institution_code": "341",
            "financial_institution_ispb": "60701190"
        }
    }
}
```

## Possíveis erros

STATUS 404

**Análise não encontrada**

A `analysis_key` informada não corresponde a nenhuma análise cadastrada.

```json
{
  "title": "Analysis not found",
  "description": "Analysis with the key {analysis_key} was not found.",
  "translation": "A análise com a chave {analysis_key} não foi encontrada.",
  "code": "VRG000007"
}
```

---

## Próximos passos

Com a `vendor_key` de um fornecedor `active` em mãos, prossiga para:

**[Criar contrato](/documentation/iaas/despesas/submissao_despesa/contrato/criacao)** — vincule o fornecedor ao fundo e defina o tipo de despesa.

---

# Submissão para Análise

URL: /en/documentation/iaas/despesas/submissao_despesa/fornecedor/submissao

Após [criar a análise](/documentation/iaas/despesas/submissao_despesa/fornecedor/criacao) e [fazer upload dos documentos](/documentation/iaas/despesas/submissao_despesa/fornecedor/documentos), submeta a análise para revisão da QI Tech alterando o status para `pending_adm_approval`.

:::caution Pré-requisito
É obrigatório ter ao menos um documento com status `pending_adm_approval` ou `approved` antes de submeter a análise. Caso contrário, a requisição será rejeitada com erro `VGR000030`.
:::

---

## Submeter a análise

ENDPOINT /vendor_registry/analysis/{analysis_key}
MÉTODO PUT

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `analysis_key` | string | Chave única da análise (UUID) |

```json title="Request Body"
{
    "status": "pending_adm_approval"
}
```

### Atributos do body

| Campo | Tipo | Obrigatoriedade | Valores aceitos | Descrição |
|---|---|---|---|---|
| `status` | string | obrigatório | `pending_adm_approval`, `pending_submission` | Novo status da análise. Use `pending_adm_approval` para submeter para revisão, ou `pending_submission` para retornar ao rascunho. |

## Response

STATUS 202

```json title="Response Body"
{
    "analysis_key": "c3d4e5f6-a7b8-9012-cdef-345678901234",
    "status": "pending_adm_approval"
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `analysis_key` | string | Chave única da análise. |
| `status` | string | Novo status da análise. |

---

## Ciclo de vida da análise

A tabela abaixo descreve todas as transições de status possíveis e quem as executa:

| Status | Descrição | Quem transita |
|---|---|---|
| `pending_submission` | Análise criada, aguardando submissão | Estado inicial; agente retorna para edição |
| `pending_adm_approval` | Submetida, aguardando revisão da QI Tech | Agente integrador |
| `approved` | Aprovada pela QI Tech; fornecedor ativado | QI Tech (interno) |
| `rejected` | Rejeitada pela QI Tech | QI Tech (interno) |
| `canceled` | Cancelada pelo agente integrador | Agente integrador via [endpoint de cancelamento](/documentation/iaas/despesas/submissao_despesa/fornecedor/cancelamento) |
| `other_analysis_approved` | Outra análise do mesmo fornecedor foi aprovada primeiro | Automático |

### Transições permitidas pelo agente integrador

```
pending_submission ──→ pending_adm_approval  (submissão para revisão)
pending_submission ──→ canceled              (cancelamento)
pending_adm_approval ──→ pending_submission  (retorno para edição)
pending_adm_approval ──→ canceled            (cancelamento)
```

:::info Edição após retorno
Quando a QI Tech retorna a análise para `pending_submission`, é possível atualizar os dados de pagamento e a flag `requires_invoice` antes de submeter novamente. Consulte a página de [atualização de dados](/documentation/iaas/despesas/submissao_despesa/fornecedor/atualizacao).
:::

---

## Possíveis erros

STATUS 400

**Análise sem documentos**

A análise não possui nenhum documento com status `pending_adm_approval` ou `approved`. Faça o [upload de ao menos um documento](/documentation/iaas/despesas/submissao_despesa/fornecedor/documentos) antes de submeter.

```json
{
  "title": "Analysis Submission Must Have At Least One Pending Analysis Document",
  "description": "Analysis with key {analysis_key} must have at least one pending analysis document to be submitted.",
  "translation": "A análise com a chave {analysis_key} deve ter pelo menos um documento de análise pendente para ser enviada.",
  "code": "VGR000030"
}
```

STATUS 409

**Transição de status não permitida**

A transição de status solicitada não é permitida para o status atual da análise.

```json
{
  "title": "Analysis Status Transition Denied",
  "description": "Analysis with key {analysis_key} is not allowed to switch status from {current_status} to {new_status}.",
  "translation": "Análise com chave {analysis_key} não pode trocar de status de {current_status} para {new_status}.",
  "code": "VRG000008"
}
```

**Análise já rejeitada**

Análises rejeitadas não podem ter o status alterado.

```json
{
  "title": "Canceled Analysis",
  "description": "Analysis with key {analysis_key} is already rejected, it can't be updated.",
  "translation": "Análise com chave {analysis_key} está rejeitada, não pode ser atualizada.",
  "code": "VRG0000009"
}
```

**Análise já aprovada**

Análises aprovadas não podem ter o status alterado.

```json
{
  "title": "Completed Analysis",
  "description": "Analysis with key {analysis_key} is already completed, it can't be updated.",
  "translation": "Análise com chave {analysis_key} está finalizada, não pode ser atualizada.",
  "code": "VRG0000010"
}
```

STATUS 404

**Análise não encontrada**

A `analysis_key` informada na URL não corresponde a nenhuma análise cadastrada.

```json
{
  "title": "Analysis not found",
  "description": "Analysis with the key {analysis_key} was not found.",
  "translation": "A análise com a chave {analysis_key} não foi encontrada.",
  "code": "VRG000007"
}
```

---

## Próximos passos

Após submeter a análise, o processo de revisão da QI Tech se inicia. Durante este período:

- **[Acompanhar o status](/documentation/iaas/despesas/submissao_despesa/fornecedor/listagem#consultar-análise-por-chave)** — verifique o progresso da análise.
- **[Responder anotações](/documentation/iaas/despesas/submissao_despesa/fornecedor/anotacoes)** — responda eventuais solicitações da equipe de análise.

Após aprovação, a `vendor_key` do fornecedor estará disponível para uso em contratos de despesa.

---

# Submissão de Despesas

URL: /en/documentation/iaas/despesas/submissao_despesa/inicio

Esta seção documenta as APIs que viabilizam o processo de Submissão de Despesas para Fundos de Investimento administrados pela QI CTVM. Por meio dessas APIs, é possível registrar contratos com fornecedores, submeter despesas individuais e acompanhar o ciclo de aprovação de cada lançamento.

## Fluxo de submissão

O diagrama abaixo ilustra as etapas do fluxo:

![Etapas do fluxo de submissão de despesas](/img/diagrams/iaas-despesas-inicio.svg)

## Passo a passo

### 0. Cadastro do Fornecedor (pré-requisito)

Antes de criar um contrato, o fornecedor que prestará serviços ao fundo deve estar cadastrado na plataforma. Esse cadastro é realizado pela equipe de operações da QI Tech. Após o cadastro, a `vendor_key` é disponibilizada para uso nos contratos.

**[Acessar documentação do cadastro de fornecedor](/documentation/iaas/despesas/submissao_despesa/fornecedor/criacao)** | **[Consultar fornecedores cadastrados](/documentation/iaas/despesas/submissao_despesa/fornecedor/listagem)**

### 1. Criação do Contrato

Crie um contrato vinculando o fundo a um fornecedor e definindo o tipo de despesa. O contrato é o contêiner que agrupa todas as despesas de uma mesma relação comercial.

**[Acessar documentação da criação do contrato](/documentation/iaas/despesas/submissao_despesa/contrato/criacao)**

### 2. Submissão do Contrato para Aprovação

Após criar e revisar o contrato, submeta-o para análise da QI Tech. O contrato passará para o status `pending_adm_approval` até ser aprovado ou rejeitado.

**[Acessar documentação da submissão do contrato](/documentation/iaas/despesas/submissao_despesa/contrato/submissao)**

### 3. Criação da Despesa

Com o contrato aprovado, crie as despesas individuais informando os dados de pagamento, período de competência e documentos comprobatórios. Ao incluir documentos na criação, a despesa é automaticamente encaminhada para revisão.

**[Acessar documentação da criação da despesa](/documentation/iaas/despesas/submissao_despesa/despesa/criacao)**

### 4. Upload de Documentos (quando não incluídos na criação)

Caso os documentos não tenham sido incluídos na criação da despesa, faça o upload separadamente antes de submeter.

**[Acessar documentação de upload de documentos](/documentation/iaas/despesas/submissao_despesa/documentos/upload)**

### 5. Submissão da Despesa para Aprovação

Submeta a despesa para análise da QI Tech. É obrigatório que ao menos um documento esteja anexado antes da submissão.

**[Acessar documentação da submissão da despesa](/documentation/iaas/despesas/submissao_despesa/despesa/submissao)**

:::info Processamento interno
Após a aprovação da despesa pela QI Tech, o lançamento é processado internamente e registrado na carteira do fundo de forma automática.
:::

## Status do contrato

| Status | Descrição |
|---|---|
| `created` | Contrato criado, aguardando submissão |
| `pending_adm_approval` | Submetido, aguardando análise da QI Tech |
| `approved` | Aprovado pela QI Tech |
| `rejected` | Rejeitado pela QI Tech |
| `canceled` | Cancelado pelo agente integrador |

## Status da despesa

| Status | Descrição |
|---|---|
| `created` | Despesa criada, aguardando documentos ou submissão |
| `pending_adm_approval` | Submetida (ou criada com documentos), aguardando análise da QI Tech |
| `approved` | Aprovada pela QI Tech |
| `rejected` | Rejeitada pela QI Tech |
| `canceled` | Cancelada pelo agente integrador |

---

# Issuances - Integralization

URL: /en/documentation/iaas/emissoes/cadastrar_boleta

---

## Integralization

Using the following endpoint, it is possible to initiate integralization on an issuance.

### Request

ENDPOINT /trade_security/fund_class/FUND_CLASS_KEY/integralization
METHOD POST

```json title="Request Body"
{
 "security_external_id": "a23c006c-befd-40e0-bc3d-fbd2dfbbea5d",
 "bookkeeper_document_number": "00.000.000/0000-00",
 "security_key": "272a394a-e3d0-4484-b00e-e18a4e22bb5e",
 "unit_price": "2.00",
 "number_of_units": "100.00",
 "external_id": "90b679c0-2674-4cad-917a-5c786b0bf992",
 "integralization_date": "2025-05-27",
 "payment": {
   "target_account": {
    "account_branch": "0001",
    "account_digit": "0",
    "account_number": "12345",
    "financial_institution_code": "329",
    "financial_institution_ispb": "32402502"
   }
  }
}

```

### Definitions

#### Purchase Operation

| Field                         | Type   | Description                                      | Required |
| ------------------------------| ------ | ------------------------------------------------ | -------- |
| `security_external_id`        | string | External identifier of the asset                 | Yes*     |
| `bookkeeper_document_number`  | string | Bookkeeper's CNPJ number                        | Yes*     |
| `security_key`                | string | Internal asset key                               | Yes*     |
| `unit_price`                  | float  | Unit price in integralization                    | Yes      |
| `number_of_units`             | float  | Number of units purchased                        | Yes      |
| `external_id`                 | string | External identifier of the purchase operation    | Yes      |
| `integralization_date`        | string | Integralization date                             | Yes      |
| `payment`                     | dict   | [Payment](#payment) object for settlement        | Yes      |

:::note ⚠️ **Important** ( * )
The structured asset identification can be done in two ways:

1. By providing the `security_key` field **(internal key)**; **or**
2. By providing **both** the `security_external_id` and `bookkeeper_document_number` fields.

At least **one of the identification methods** must be present in the payload. If both are present, the internal key will be considered as priority.
:::

##### Payment

| Field                        | Type   | Description                                         | Required |
| ---------------------------- | ------ | --------------------------------------------------- | -------- |
| `target_account`             | string | [Bank account](#bank-account) object for settlement | Yes      |

##### Bank account

| Field                        | Type   | Description                                         | Required |
| ---------------------------- | ------ | --------------------------------------------------- | -------- |
| `account_branch`             | string | Bank account branch                                 | Yes      |
| `account_digit`              | string | Account verification digit                          | Yes      |
| `account_number`             | string | Bank account number                                 | Yes      |
| `financial_institution_code` | string | Financial institution code                          | Yes      |
| `financial_institution_ispb` | string | Financial institution ISPB code                     | Yes      |

### Response

STATUS 201

```json title='Response Body'
{
 "integralization_key": "1568b67b-088e-43be-938b-0f817b805f7a",
 "external_id": "90b679c0-2674-4cad-917a-5c786b0bf992",
 "status": "pending_administrator_approval",
}
```

---

# Asset Registration - Issuances

URL: /en/documentation/iaas/emissoes/cadastro_ativo

---

## Creation - Commercial Paper

Using the following endpoint, it is possible to register a new note in the structured assets orchestrator.

Registered assets appear with **pre_operational** status so that documents related to the asset can be submitted. This way, it is possible to pre-register an asset and enable it for operation only after the proper formalizations are completed, as detailed in the next segment.

Below is an explanatory list of fields and details of their requirements and types.

### Request

ENDPOINT /security/security
METHOD POST

```json title='Request Body'
{
    "external_id": "string",
    "asset_type": "commercial_paper",
    "b3_code":"25M000000",
    "isin_code":"BR00ABCDE000",
    "contract_number": "SCR12345",
    "ipoc_code": "string",
    "maturity_date": "YYYY-MM-DD",
    "allowed_managers": ["00.000.000/0000-00", "00.000.000/0000-00", "00.000.000/0000-00"],
    "allowed_consultants": ["00.000.000/0000-00", "00.000.000/0000-00", "00.000.000/0000-00"],
    "issuer_document_number": "00.000.000/0000-00",
    "bookkeeper_document_number": "00.000.000/0000-00",
    "number_of_units": 1,
    "principal_unit_price": 1000000.00,
    "issue_value": 1000000.00,
    "issue_unit_price": 1000000.00,
    "issue_date": "YYYY-MM-DD",
    "amortization_type": "sac",
    "installments": [
        {
            "installment_number": 1,
            "maturity_date": "YYYY-MM-DD",
            "principal_unit_price": 1000000.00,
            "face_unit_price": 1010000.00,
            "amortization_percentage": 1
        }
    ],
    "delay": {
        "fine": {
            "fine_type": "percentage",
            "percentage_value": 0.0
        },
        "interest": {
            "method": "compound",
            "pre_fixed": {
                "monthly_rate": 0.0,
                "calendar_base": "calendar_360"
            }
        }
    },
    "pre_fixed": {
        "monthly_rate": 0.01,
        "calendar_base": "calendar_360"
    },
    "post_fixed": {
        "lag": {
            "amount": 1,
            "reference": "daily"
        },
        "rate": 1,
        "indexer": "di",
        "calendar_base": "workdays"
    }
}

```

## Definitions

### Asset Object (Request Body)

| Field                         | Type   | Description                                      | Required    |
| ------------------------------| ------ | ------------------------------------------------ | ----------- |
| `asset_type`                  | string | Enumerator that determines the [Asset Type](#asset-type-enumerator) | Yes         |
| `external_id`                 | string | External identifier of the asset; Key used to access the entity | Yes         |
| `b3_code`                     | string | Cetip code of the asset                          | No          |
| `isin_code`                   | string | ISIN (International Securities Identification Number) code | No          |
| `ipoc_code`                   | string | IPOC code of the asset                           | No          |
| `allowed_managers`            | list   | List of manager CNPJs with permission to operate on the issuance | No          |
| `allowed_consultants`         | list   | List of consultant CNPJs with permission to operate on the issuance | No          |
| `issuer_document_number`      | string | Issuer's CNPJ or CPF number                      | Yes         |
| `bookkeeper_document_number`  | string | Bookkeeper's CNPJ number                         | Yes         |
| `number_of_units`             | float  | Number of units                                  | Yes         |
| `issue_unit_price`            | float  | Unit price at issuance                           | Yes         |
| `issue_value`                 | float  | Asset value at issuance                          | Yes         |
| `principal_unit_price`        | float  | Principal unit value of asset at issuance        | Yes         |
| `issue_date`                  | string | Issuance date in `YYYY-MM-DD` format             | Yes         |
| `disbursement_date`           | string | Issuance date in `YYYY-MM-DD` format             | Yes         |
| `amortization_type`           | string | [Amortization Type](#amortization-type-enumerator) enumerator | Yes         |
| `contract_number`             | string | Contract number                                  | Yes         |
| `maturity_date`               | string | Asset maturity date                              | Yes         |
| `installments`                | dict   | [Installments](#installment-object) object       | Yes         |
| `delay`                       | dict   | [Delay](#delay-object) object                    | Yes         |
| `pre_fixed`                   | dict   | [Pre-fixed](#pre-fixed-object) object            | Yes         |
| `post_fixed`                  | dict   | [Post-fixed](#post-fixed-object) object          | No          |

#### Asset Type Enumerator

| Enumerator   | Description     |
|--------------|---------------|
| **commercial_paper** | Commercial Paper asset type |
| **debenture** | Debenture asset type |
| **cri** | CRI asset type |
| **cra** | CRA asset type |

#### Amortization Type Enumerator

| Enumerator   | Description     |
|--------------|---------------|
| **sac**   | SAC type amortization |
| **price**   | Price type amortization |

#### Installment Object

| Field                           | Type   | Description                                | Required    |
| ------------------------------- | ------ | -------------------------------------------| ----------- |
| `installment_number`            | int    | Installment Number                         | Yes         |
| `maturity_date`                 | string | Maturity Date in `YYYY-MM-DD` format       | Yes         |
| `principal_unit_price`          | float  | Asset principal unit value                 | Yes         |
| `face_unit_price`               | float  | Asset face unit value                      | Yes         |
| `amortization_percentage`       | float  | Amortization Percentage                    | No          |

#### Delay Object

| Field                | Type   | Description                                        | Required    |
|-|-|-|-|
| `fine` | object | Fine object at maturity. See **[Delay Fine Object](#delay-fine-object)**. | Yes |
| `interest` | object | Late interest object. See **[Late Interest Object](#late-interest-object)**. | Yes |

#### Delay Fine Object

| Field | Type   | Description | Required |
|-|-|-|-|
| `fine_type` | string | Fine Type. | Yes |
| `percentage_value` | number | Fine Value, if fine type is `percentage`. Unit of measure: from 0 to 1, considering 0 to 100% | Yes |
| `amount` | number | Fine Value, if fine type is `fixed`.  | Yes |

##### Fine Type Enumerator

| Enumerator     | Description                               |
|----------------|-------------------------------------------|
| **percentage** | Percentage fine on installment value      |
| **fixed**      | Fixed fine value                          |

#### Late Interest Object

| Field | Type | Description | Required |
|-|-|-|-|
| `method` * | string | See **[Late Interest Method Enumerator](#late-interest-method-enumerator)**. | Yes |
| `pre_fixed` * | object | See **[Pre-fixed Object](#pre-fixed-object)**. | Yes |

##### Late Interest Method Enumerator

| Enumerator   | Description                |
|--------------|----------------------------|
| **compound** | For compound late interest |
| **simple**   | For simple late interest   |

#### Pre-fixed Object

| Field | Type | Description | Required |
|-|-|-|-|
| `calendar_base` *| string | The calculation base used. | enumerator |
| `monthly_rate` * | number | The contract monthly rate. For 1% use 0.01 | Up to 8 decimal places |

#### Post-fixed Object

| Field         | Type   | Description                                      | Required    |
|---------------|--------|--------------------------------------------------|-------------|
| rate          | int    | Fixed rate applied                               | Yes         |
| indexer       | string | Reference index for correction (di, ipca)       | Yes         |
| calendar_base | string | Type of calendar considered                      | Yes         |

#### Lag Object

| Field     | Type   | Description                                | Required    |
|-----------|--------|--------------------------------------------|-------------|
| amount    | int    | Amount of lag units                        | Yes         |
| reference | string | Time unit of lag                           | Yes         |

#### Calculation Base Enumerator

| Enumerator   | Description     |
|--------------|---------------|
| **daily** | For daily delay values |
| **monthly** | For monthly delay values |

#### Delay Reference Enumerator

| Enumerator   | Description     |
|--------------|---------------|
| **workdays** | For business days calculation base (252) |
| **calendar_365**   | For 365 calculation base |
| **calendar_360**   | For 360 calculation base |

### Response

STATUS 201

```json title='Response Body'
{
    "security_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "status": "pre_operational",
}
```

<!-- ### Possíveis erros

STATUS 404

Response Body

```json
{
  "title": "Assignment not found",
  "description": "Assignment not found",
  "translation": "Lote não encontrado",
  "code": "TRC000018"
}

```

STATUS 404

Response Body

```json
{
  "title": "Asset type does not exist",
  "description": "Asset type 'invalid_asset_type' does not exist",
  "translation": "Tipo do ativo 'invalid_asset_type' nao existe",
  "code": "TRC000015"
}

```

STATUS 400

Response Body

```json
{
  "title": "Invalid asset type configuration",
  "description": "This assignment can not receive this asset type: ccb",
  "translation": "Esse lote não pode receber esse tipo de ativo: ccb",
  "code": "TRC000025"
}

```

STATUS 400

Response Body

```json
{
  "title": "Assignment is closed",
  "description": "Assignment is closed to insert new assets",
  "translation": "Lote esta fechado para inserir novos ativos",
  "code": "TRC000022"
}

```

STATUS 400

Response Body

```json
{
  "title": "Invalid Document number",
  "description": "Given '000.000.000-00' document number is invalid.",
  "translation": "O numero de document '000.000.000-00' fornecido não é valido.",
  "code": "TRC000009"
}

```

STATUS 400

Response Body

```json
{
  "title": "Originator bond not found",
  "description": "Originator bond not found",
  "translation": "Vinculo com originador não foi encontrado",
  "code": "TRC000019"
}

```

STATUS 400

Response Body

```json
{
  "title": "Already Exist This External Id",
  "description": "Already exist an asset with this External Id",
  "translation": "Ja existe um ativo com esse External Id",
  "code": "TRC000054"
}

```
-->

---

# Issuance Confirmation

URL: /en/documentation/iaas/emissoes/confirmacao_emissao

## Confirmation - Commercial Note

After completing all formalizations and registering the necessary documents in the asset, it's possible to approve it, signaling that it's ready to proceed with operations.

It's worth noting that purchase operations can be launched on pre-operational assets, but these cannot be settled until the asset issuance is confirmed.

### Request

ENDPOINT /security/security/EXTERNAL_ID/confirm
MÉTODO PUT

```json title="Request Body"
{
 "bookkeeper_document_number": "00.000.000/0000-00"
}

```

| Field                         | Type   | Description                                         | Required |
| ------------------------------| ------ | --------------------------------------------------- | -------- |
| `bookkeeper_document_number`  | string | CNPJ of the bookkeeper for issuance identification | Yes      |

#### Definition

### Response

STATUS 202

```json title='Response Body'
{
    "security_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "status": "active",
}
```

---

# Introduction

URL: /en/documentation/iaas/emissoes/inicio

The issuance ecosystem is responsible for the creation, purchase, sale, and payments of assets such as Commercial Notes, Debentures, CRIs, and CRAs. The functionalities available for use are:

- Register a new pre-operational asset;
- Confirm the issuance;
- Create purchase or sale tickets;

This documentation provides a detailed overview of how to use the issuance system, including its main features and workflows.

To start using the system, navigate through the topics available in this documentation to better understand each aspect of the fund share module.

---

# Apontamentos de Compliance

URL: /en/documentation/iaas/homologacao_cedente/cadastro/apontamentos

Durante o processo de análise cadastral do Cedente, as equipes de Compliance, Risco ou de validação interna podem registrar **apontamentos** (também chamados de *annotations*). Um apontamento é uma solicitação ou questionamento direcionado ao agente responsável pelo cadastro, que precisa ser respondido para que a análise prossiga.

Sempre que um apontamento é criado, ele nasce no status `open` e, caso configurado, é disparado um [Webhook de Apontamento](/documentation/iaas/homologacao_cedente/cadastro/webhooks_analise#webhooks-de-apontamento) notificando a abertura. Também é enviado um e-mail aos destinatários configurados para o agente. Após o agente responder ao apontamento, ele passa para o status `closed` e um novo webhook é disparado.

:::info
Apontamentos só existem enquanto a análise estiver em um dos status `in_manual_analysis`, `pending_internal_validation` ou `in_risk_analysis`. Cada apontamento aceita apenas **uma** resposta.
:::

---

## Consulta Paginada de Apontamentos

Recupera a lista de apontamentos de uma análise, permitindo ao agente identificar o que precisa ser respondido.

### Request

ENDPOINT /assignor_registry/public/assignor_registry/ASSIGNOR_REGISTRY_KEY/analysis/ANALYSIS_KEY/annotations
MÉTODO GET

### Query params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `limit` | integer | Limite de objetos por página (padrão 10, máximo 50). | - |
| `page` | integer | Página desejada (inicia em 0). | - |

### Response

STATUS 200

```json title='Response Body'
{
    "data": [
        {
            "annotation_key": "1f2e3d4c-5b6a-4c8d-9e0f-1a2b3c4d5e6f",
            "analysis_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
            "assignor_registry_key": "35ff6e5c-a3e7-4b04-a8be-6e49a3a906e4",
            "status": "open",
            "origin_type": "compliance",
            "annotation_datetime": "2025-01-22T20:30:23Z",
            "message": "Anexar detalhes do processo XXXXXXXXXXX."
        }
    ],
    "limit": 10,
    "page": 0,
    "is_last_page": true
}
```

### Erros Tratáveis

| Código | HTTP | Causa | Como resolver |
|--------|------|-------|---------------|
| ASR000026 | 404 | Agente não encontrado para a `AGENT-KEY` informada. | Verificar se a chave do agente autenticado está correta. |

---

## Consulta de Apontamento por Chave

### Request

ENDPOINT /assignor_registry/public/assignor_registry/ASSIGNOR_REGISTRY_KEY/analysis/ANALYSIS_KEY/annotation/ANNOTATION_KEY
MÉTODO GET

### Response

STATUS 200

```json title='Response Body'
{
    "annotation_key": "1f2e3d4c-5b6a-4c8d-9e0f-1a2b3c4d5e6f",
    "analysis_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "assignor_registry_key": "35ff6e5c-a3e7-4b04-a8be-6e49a3a906e4",
    "status": "closed",
    "origin_type": "compliance",
    "annotation_datetime": "2025-01-22T20:30:23Z",
    "message": "Anexar detalhes do processo XXXXXXXXXXX.",
    "response": "Segue autos do processo.",
    "response_datetime": "2025-01-23T14:05:11Z",
    "attached_document_key": "8e515a17-8b4d-49a3-aed6-47c9574e426a"
}
```

:::info
Os campos `response`, `response_datetime` e `attached_document_key` só são retornados quando o apontamento já foi respondido e/ou possui um documento anexado.
:::

### Erros Tratáveis

| Código | HTTP | Causa | Como resolver |
|--------|------|-------|---------------|
| ASR000026 | 404 | Agente não encontrado para a `AGENT-KEY` informada. | Verificar se a chave do agente autenticado está correta. |
| ASR000004 | 404 | Cedente não encontrado para o `assignor_registry_key` informado. | Verificar se o `assignor_registry_key` está correto e pertence ao agente autenticado. |
| ASR000033 | 404 | Análise não encontrada para o `analysis_key` informado. | Verificar se o `analysis_key` está correto. |
| ASR000043 | 404 | Apontamento não encontrado para o `annotation_key` informado. | Verificar se o `annotation_key` pertence à análise indicada. |

---

## Resposta ao Apontamento

Envia a resposta do agente a um apontamento. Opcionalmente, é possível anexar um documento em PDF que comprove ou complemente a resposta.

### Request

ENDPOINT /assignor_registry/public/assignor_registry/ASSIGNOR_REGISTRY_KEY/analysis/ANALYSIS_KEY/annotation/ANNOTATION_KEY
MÉTODO PUT

```json title='Request Body'
{
    "response": "Segue autos do processo.",
    "document_b64": "aGVsbG8gd29ybGQgaWYgeW91IGRlY29kZWQgbWUsIGJlIGNhcmVmdWwuIEl0IG11c3QgYmUgYSBQREYgRmlsZSBvdGhlcndpc2UgSSB3aWxsIHJhaXNlIGFuIEVycm9yLg=="
}
```

### Objeto de Resposta

| Campo | Tipo | Descrição | Caracteres |
|-------|------|-----------|------------|
| `response` * | string | Texto de resposta ao apontamento. | 1 - 3000 |
| `document_b64` | string | Binário do arquivo em PDF, codificado em Base64. | - |

*Campos obrigatórios.

### Response

STATUS 202

```json title='Response Body'
{
    "annotation_key": "1f2e3d4c-5b6a-4c8d-9e0f-1a2b3c4d5e6f",
    "analysis_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "assignor_registry_key": "35ff6e5c-a3e7-4b04-a8be-6e49a3a906e4",
    "status": "closed",
    "origin_type": "compliance",
    "annotation_datetime": "2025-01-22T20:30:23Z",
    "message": "Anexar detalhes do processo XXXXXXXXXXX.",
    "response": "Segue autos do processo.",
    "response_datetime": "2025-01-23T14:05:11Z",
    "attached_document_key": "8e515a17-8b4d-49a3-aed6-47c9574e426a"
}
```

### Erros Tratáveis

| Código | HTTP | Causa | Como resolver |
|--------|------|-------|---------------|
| ASR000026 | 404 | Agente não encontrado para a `AGENT-KEY` informada. | Verificar se a chave do agente autenticado está correta. |
| ASR000004 | 404 | Cedente não encontrado para o `assignor_registry_key` informado. | Verificar se o `assignor_registry_key` está correto e pertence ao agente autenticado. |
| ASR000033 | 404 | Análise não encontrada para o `analysis_key` informado. | Verificar se o `analysis_key` está correto. |
| ASR000043 | 404 | Apontamento não encontrado para o `annotation_key` informado. | Verificar se o `annotation_key` pertence à análise indicada. |
| ASR000045 | 400 | O apontamento não está mais em status `open` e não aceita mais respostas. | Só é possível responder apontamentos com status `open`. |
| ASR000044 | 400 | O apontamento já foi respondido. | Cada apontamento aceita apenas uma resposta. |
| ASR000005 | 400 | Formato de arquivo inválido. | Enviar `document_b64` como string em base64 válida. |
| ASR000060 | 400 | O arquivo enviado não é um PDF válido. | O conteúdo decodificado de `document_b64` deve ser um PDF. |
| ASR000059 | 400 | Tamanho do arquivo excede o limite. | Reduzir o tamanho do PDF antes de enviar (limite informado na mensagem do erro). |

---

## Consulta de Documento do Apontamento

Recupera uma URL temporária para download do documento anexado a um apontamento.

### Request

ENDPOINT /assignor_registry/public/assignor_registry/ASSIGNOR_REGISTRY_KEY/analysis/ANALYSIS_KEY/annotation/ANNOTATION_KEY/document/DOCUMENT_KEY
MÉTODO GET

### Response

STATUS 200

```json title='Response Body'
{
    "document_url": "https://assignor-bucket.s3.amazonaws.com/8e515a17-8b4d-49a3-aed6-47c9574e426a?..."
}
```

:::info
A `document_url` retornada é uma URL pré-assinada com validade de 24 horas.
:::

### Erros Tratáveis

| Código | HTTP | Causa | Como resolver |
|--------|------|-------|---------------|
| ASR000026 | 404 | Agente não encontrado para a `AGENT-KEY` informada. | Verificar se a chave do agente autenticado está correta. |
| ASR000004 | 404 | Cedente não encontrado para o `assignor_registry_key` informado. | Verificar se o `assignor_registry_key` está correto e pertence ao agente autenticado. |
| ASR000033 | 404 | Análise não encontrada para o `analysis_key` informado. | Verificar se o `analysis_key` está correto. |
| ASR000043 | 404 | Apontamento não encontrado para o `annotation_key` informado. | Verificar se o `annotation_key` pertence à análise indicada. |
| ASR000006 | 404 | Documento não encontrado para o `document_key` informado. | Verificar se o `document_key` corresponde ao documento anexado ao apontamento. |

---

## Objeto de Apontamento

| Campo | Tipo | Descrição |
|-------|------|-----------|
| `annotation_key` | string | Identificador único do apontamento. |
| `analysis_key` | string | Chave da análise à qual o apontamento pertence. |
| `assignor_registry_key` | string | Chave do cedente. |
| `status` | string | Status atual do apontamento. Ver **[Annotation Status](#annotation-status)**. |
| `origin_type` | string | Origem do apontamento. Ver **[Annotation Origin Type](#annotation-origin-type)**. |
| `annotation_datetime` | string | Data e hora de criação do apontamento (ISO 8601). |
| `message` | string | Mensagem do apontamento registrada pela equipe da QI DTVM. |
| `response` | string | Resposta enviada pelo agente (presente após a resposta). |
| `response_datetime` | string | Data e hora da resposta (presente após a resposta). |
| `attached_document_key` | string | Chave do documento anexado à resposta (quando houver). |

### Annotation Status

| Enumerador | Descrição |
| ---------- | --------- |
| **created** | Apontamento criado, ainda não disponibilizado. |
| **open** | Aberto e aguardando resposta do agente. |
| **closed** | Respondido e encerrado. |

### Annotation Origin Type

| Enumerador | Descrição |
| ---------- | --------- |
| **compliance** | Apontamento originado pela equipe de Compliance (análise manual). |
| **risk_analysis** | Apontamento originado pela equipe de Risco. |
| **internal** | Apontamento originado na validação interna. |

---

# Atualização de Cadastro

URL: /en/documentation/iaas/homologacao_cedente/cadastro/atualizacao_de_cadastro

---

## Atualização de Cadastro de Cedente Pessoa Jurídica

### Request

ENDPOINT /assignor_registry/assignor_registry/ASSIGNOR_REGISTRY_KEY
METHOD PUT

```json title='Request Body'
{
  "name": "QI CTVM",
  "document_number": "67.987.787/0001-06",
  "person_type": "legal_person",
  "email": "qidtvm@qitech.com.br",
  "maturity_level": "factoring",
  "address": {
    "street": "Gilberto Sabino",
    "number": "215",
    "neighborhood": "Pinheiros",
    "city": "São Paulo",
    "postal_code": "05425-020",
    "uf": "SP",
    "country": "BRA"
  },
  "phone": {
    "area_code": "11",
    "number": "936360268"
  },
  "legal_person": {
    "activity_code": "11.11-1-11",
    "representatives": [
      {
        "name": "Natália Nascimento",
        "document_number": "883.512.866-80",
        "email": "natália.nascimento@yopmail.com",
        "representative_type": "attorney",
        "person_type": "natural_person",
        "address": {
          "street": "Gilberto Sabino",
          "number": "215",
          "neighborhood": "Pinheiros",
          "city": "São Paulo",
          "postal_code": "05425-020",
          "uf": "SP",
          "country": "BRA"
        },
        "phone": {
          "area_code": "11",
          "number": "36360268"
        },
        "natural_person": {
          "mother_name": "Lívia Santos",
          "birthdate": "1978-04-11"
        }
      },
      {
        "name": "Natália Nascimento",
        "document_number": "802.834.257-41",
        "email": "natália.nascimento@yopmail.com",
        "representative_type": "attorney",
        "person_type": "natural_person",
        "address": {
          "street": "Gilberto Sabino",
          "number": "215",
          "neighborhood": "Pinheiros",
          "city": "São Paulo",
          "postal_code": "05425-020",
          "uf": "SP",
          "country": "BRA"
        },
        "phone": {
          "area_code": "11",
          "number": "36360268"
        },
        "natural_person": {
          "mother_name": "Lívia Santos",
          "birthdate": "1978-04-11"
        }
      }
    ]
  }
}
```

### Definição do Cedente

| Campo | Tipo | Descrição | Caracteres |
|-------|------|-----------|------------|
| `name` * | string | Nome do cedente. | 1 a 255 |
| `maturity_level` * | string | Nível de maturidade (risco) do cedente. Ver **[Níveis de Maturidade](#níveis-de-maturidade)**| 1 a 255 |
| `document_number` * | string | Número de documento do cedente (CNPJ). | 14 a 18 |
| `person_type` * | string | Tipo de pessoa (física ou jurídica) do cedente. | 1 a 255 |
| `email`  | string | Endereço de e-mail do cedente. | 1 a 255 |
| `phone`  | object | Objeto referenciando as informações do telefone do cedente. Ver **[Definição de Telefone](#definição-de-telefone)**. | - |
| `address` * | object | Objeto referenciando as informações do endereço do cedente. Ver **[Definição de Endereço](#definição-de-endereço)**. | - |
| `legal_person` * | object | Objeto referenciando as informações da pessoa jurídica do cedente. Ver **[Definição de Pessoa Jurídica](#definição-de-pessoa-jurídica)**. | - |

*Campos obrigatórios.

### Response

STATUS 202

```json title='Response Body'
{
  "assignor_registry_key": "c4295375-4077-4092-a258-5bcdf8875907",
  "status": "pending_registry",
  "name": "QI CTVM",
  "document_number": "67.987.787/0001-06",
  "person_type": "legal_person",
  "maturity_level": "factoring",
  "email": "qidtvm@qitech.com.br",
  "phone": {
    "number": "936360268",
    "area_code": "11"
  },
  "address": {
    "uf": "SP",
    "city": "São Paulo",
    "number": "215",
    "street": "Gilberto Sabino",
    "country": "BRA",
    "postal_code": "05425-020",
    "neighborhood": "Pinheiros"
  },
  "legal_person": {
    "activity_code": "11.11-1-11",
    "representatives": []
  },
  "last_analysis": {
    "analysis_key": "d7805a05-98a7-486b-a440-807f1d3d5691",
    "analysis_number": 1,
    "assignor_registry_key": "c4295375-4077-4092-a258-5bcdf8875907",
	"status": "pending_documents",
    "analysis_data": {
      "name": "QI CTVM",
      "email": "qidtvm@qitech.com.br",
      "phone": {
        "number": "936360268",
        "area_code": "11"
      },
      "address": {
        "uf": "SP",
        "city": "São Paulo",
        "number": "215",
        "street": "Gilberto Sabino",
        "country": "BRA",
        "postal_code": "05425-020",
        "neighborhood": "Pinheiros"
      },
      "person_type": "legal_person",
      "legal_person": {
        "activity_code": "11.11-1-11",
        "representatives": [
          {
            "name": "Natália Nascimento",
            "email": "natália.nascimento@yopmail.com",
            "phone": {
              "number": "36360268",
              "area_code": "11"
            },
            "address": {
              "uf": "SP",
              "city": "São Paulo",
              "number": "215",
              "street": "Gilberto Sabino",
              "country": "BRA",
              "postal_code": "05425-020",
              "neighborhood": "Pinheiros"
            },
            "person_type": "natural_person",
            "natural_person": {
              "birthdate": "1978-04-11",
              "mother_name": "Lívia Santos"
            },
            "document_number": "883.512.866-80",
            "representative_type": "attorney"
          },
          {
            "name": "Natália Nascimento",
            "email": "natália.nascimento@yopmail.com",
            "phone": {
              "number": "36360268",
              "area_code": "11"
            },
            "address": {
              "uf": "SP",
              "city": "São Paulo",
              "number": "215",
              "street": "Gilberto Sabino",
              "country": "BRA",
              "postal_code": "05425-020",
              "neighborhood": "Pinheiros"
            },
            "person_type": "natural_person",
            "natural_person": {
              "birthdate": "1978-04-11",
              "mother_name": "Lívia Santos"
            },
            "document_number": "802.834.257-41",
            "representative_type": "attorney"
          }
        ]
      },
      "maturity_level": "factoring",
      "document_number": "67.987.787/0001-06"
    },
    "analysis_representatives": [
      {
        "analysis_representative_key": "5cdcc13b-c67d-45f3-aa66-36cb4f178b59",
        "document_number": "802.834.257-41",
        "person_data": {
          "name": "Natália Nascimento",
          "email": "natália.nascimento@yopmail.com",
          "phone": {
            "number": "36360268",
            "area_code": "11"
          },
          "address": {
            "uf": "SP",
            "city": "São Paulo",
            "number": "215",
            "street": "Gilberto Sabino",
            "country": "BRA",
            "postal_code": "05425-020",
            "neighborhood": "Pinheiros"
          },
          "person_type": "natural_person",
          "natural_person": {
            "birthdate": "1978-04-11",
            "mother_name": "Lívia Santos"
          },
          "document_number": "802.834.257-41",
          "representative_type": "attorney"
        }
      },
      {
        "analysis_representative_key": "d4c75c93-4aa9-4567-89c4-b49334927721",
        "document_number": "883.512.866-80",
        "person_data": {
          "name": "Natália Nascimento",
          "email": "natália.nascimento@yopmail.com",
          "phone": {
            "number": "36360268",
            "area_code": "11"
          },
          "address": {
            "uf": "SP",
            "city": "São Paulo",
            "number": "215",
            "street": "Gilberto Sabino",
            "country": "BRA",
            "postal_code": "05425-020",
            "neighborhood": "Pinheiros"
          },
          "person_type": "natural_person",
          "natural_person": {
            "birthdate": "1978-04-11",
            "mother_name": "Lívia Santos"
          },
          "document_number": "883.512.866-80",
          "representative_type": "attorney"
        }
      }
    ],
    "documents": []
  }
}
```

:::info
É importante armazenar a `analysis_key` e as `analysis_representative_key` que serão utilizadas para envio de documentos do cedente e dos representantes.
:::

---

## Atualização de Cadastro de Cedente Pessoa Física

### Request

ENDPOINT /assignor_registry/assignor_registry/ASSIGNOR_REGISTRY_KEY
METHOD PUT

```json title='Request Body'
{
  "name": "Natália Nascimento",
  "document_number": "951.585.151-31",
  "person_type": "natural_person",
  "email": "natália.nascimento@yopmail.com",
  "maturity_level": "factoring",
  "address": {
    "street": "Gilberto Sabino",
    "number": "215",
	"complement": "Sample Apt1",
    "neighborhood": "Pinheiros",
    "city": "São Paulo",
    "postal_code": "05425-020",
    "uf": "SP",
    "country": "BRA"
  },
  "phone": {
    "area_code": "11",
    "number": "36360268"
  },
  "natural_person": {
    "mother_name": "Lívia Santos",
    "birthdate": "1978-04-11"
  }
}
```

---

### Definição do Cedente

| Campo | Tipo | Descrição | Caracteres |
|-------|------|-----------|------------|
| `name` * | string | Nome do cedente. | 1 a 255 |
| `maturity_level` * | string | Nível de maturidade (risco) do cedente. Ver **[Níveis de Maturidade](#níveis-de-maturidade)**| 1 a 255 |
| `document_number` * | string | Número de documento do cedente (CPF). | 14 a 18 |
| `person_type` * | string | Tipo de pessoa (física ou jurídica) do cedente. | 1 a 255 |
| `email` * | string | Endereço de e-mail do cedente. | 1 a 255 |
| `phone`  | object | Objeto referenciando as informações do telefone do cedente. Ver **[Definição de Telefone](#definição-de-telefone)**. | - |
| `address` * | object | Objeto referenciando as informações do endereço do cedente. Ver **[Definição de Endereço](#definição-de-endereço)**. | - |
| `natural_person` * | object | Objeto referenciando as informações da pessoa física do cedente. Ver **[Definição de Pessoa Física](#definição-de-pessoa-física)**. | - |

*Campos obrigatórios.

### Response

STATUS 202

```json title='Response Body'
{
  "assignor_registry_key": "2c242f4b-ae30-4207-9c83-07194f66b95c",
  "status": "pending_registry",
  "name": "Natália Nascimento",
  "document_number": "951.585.151-31",
  "person_type": "natural_person",
  "maturity_level": "factoring",
  "email": "natália.nascimento@yopmail.com",
  "phone": {
    "number": "36360268",
    "area_code": "11"
  },
  "address": {
    "uf": "SP",
    "city": "São Paulo",
    "number": "215",
    "street": "Gilberto Sabino",
    "country": "BRA",
    "postal_code": "05425-020",
    "neighborhood": "Pinheiros"
  },
  "natural_person": {
    "birthdate": "1978-04-11",
    "mother_name": "Lívia Santos"
  },
  "last_analysis": {
    "analysis_key": "303ee51e-813d-45e2-b427-07a0e4b64836",
    "analysis_number": 1,
    "assignor_registry_key": "2c242f4b-ae30-4207-9c83-07194f66b95c",
    "status": "pending_documents",
    "analysis_data": {
      "name": "Natália Nascimento",
      "email": "natália.nascimento@yopmail.com",
      "phone": {
        "number": "36360268",
        "area_code": "11"
      },
      "address": {
        "uf": "SP",
        "city": "São Paulo",
        "number": "215",
        "street": "Gilberto Sabino",
        "country": "BRA",
        "postal_code": "05425-020",
        "neighborhood": "Pinheiros"
      },
      "person_type": "natural_person",
      "maturity_level": "factoring",
      "natural_person": {
        "birthdate": "1978-04-11",
        "mother_name": "Lívia Santos"
      },
      "document_number": "951.585.151-31"
    },
    "analysis_representatives": [],
    "documents": []
  }
}
```

:::info
É importante armazenar a `analysis_key` e as `analysis_representative_key` que serão utilizadas para envio de documentos do cedente e dos representantes.
:::

:::caution Atenção!
Ao atualizar o cadastro de um cedente, uma nova análise cadastral é gerada, resultando em uma nova `analysis_key` e novas `analysis_representative_key`. O cadastro só será efetivamente atualizado após a aprovação desta nova análise. 
:::

:::caution Importante!
Não é possível atualizar dados essenciais do cedente como **Nome**, **Número do Documento**, **Tipo de Pessoa**. Os dados cadastrais passíveis de alteração incluem:
- Email;
- Endereço;
- Telefone;
- Representantes (inclusão e alteração de vigentes);
- Nível do Cedente (em caso de evolução)
:::

---
## Definições

### Definição de Endereço

| Campo | Tipo | Descrição | Caracteres |
|-------|------|-----------|------------|
| `street` * | string | Nome da rua. | 1 a 255 |
| `number` * | string | Número do endereço. | 1 a 4 |
| `neighborhood` * | string | Bairro. | 1 a 255 |
| `city` * | string | Cidade. | 1 a 255 |
| `uf` * | string | Sigla do estado. | 2 |
| `complement` | string | Complemento do endereço. | 1 a 255 |
| `postal_code` * | string | Código postal. | 9 (formato: XXXXX-XXX) |
| `country` * | string | País (sigla). | 3 |

*Campos obrigatórios.

---

### Definição de Telefone

| Campo | Tipo | Descrição | Caracteres |
|-------|------|-----------|------------|
| `international_dial_code` | string | Código internacional de discagem. | 1 a 3 |
| `area_code` * | string | Código de área. | 2 |
| `number` * | string | Número de telefone. | 8 a 9 |

*Campos obrigatórios.

---

### Definição de Pessoa Jurídica

| Campo | Tipo | Descrição | Caracteres |
|-------|------|-----------|------------|
| `foundation_date` | string | Data de fundação da empresa. | 10 (formato: YYYY-MM-DD) |
| `activity_code` | string | Código de atividade da empresa. | 10 (formato: XX.XX-X-XX) |
| `annual_revenues` | integer | Receita anual da empresa. | - |
| `representatives` * | array | Lista de representantes da empresa **. Ver  **[Definição de Representante](#definição-de-representante)**. | - |

*Campos obrigatórios.

**Atualmente são aceitos apenas representantes **Pessoa Física**.

### Definição de Representante

| Campo | Tipo | Descrição | Caracteres |
|-------|------|-----------|------------|
| `name` * | string | Nome do representante. | 1 a 255 |
| `document_number`* | string | Número de documento do representante (CPF). | 14 a 18 |
| `person_type` * | string | Tipo de pessoa do representante (deve ser pessoa física). | 1 a 255 |
| `email` * | string | Endereço de e-mail do representante. | 1 a 255 |
| `phone`  | object | Objeto referenciando as informações do telefone do representante. Ver **[Definição de Telefone](#definição-de-telefone)**. | - |
| `address`  | object | Objeto referenciando as informações do endereço do representante. Ver **[Definição de Endereço](#definição-de-endereço)**. | - |
| `natural_person` * | object | Objeto referenciando as informações da pessoa física do representante. Ver **[Definição de Pessoa Física](#definição-de-pessoa-física)**. | - |

*Campos obrigatórios.

---

### Definição de Pessoa Física

| Campo | Tipo | Descrição | Caracteres |
|-------|------|-----------|------------|
| `birthdate` * | string | Data de nascimento da pessoa. | 10 (formato: YYYY-MM-DD) |
| `gender` | string | Gênero da pessoa. Ver **[Enumerador de Gênero](#enumerador-de-gênero)**. | 1 a 6 (valores: "male" ou "female") |
| `mother_name` | string | Nome da mãe da pessoa. | 1 a 255 |

*Campos obrigatórios.

#### Enumerador de Gênero

| Enumerador   | Descrição     |
|--------------|---------------|
| **male** | Masculino. |
| **female**   | Feminino. |

# Enumeradores

### Assignor Registry Status

| Enumerador                 | Descrição       |
| -------------------------- | ----------------- |
| **pending_registry** | Pendente Registro |
| **registered**       | Registrado        |

---

### Analysis Status

| Enumerador              | Descrição           |
| ----------------------- | --------------------- |
| **pending_documents**  | Pendente Documentos   |
| **sent_to_analysis**   | Enviado para Análise |
| **in_manual_analysis** | Em Análise Manual    |
| **approved**           | Aprovado              |
| **reproved**           | Reprovado             |

---

### Representative Type

| Enumerador              | Descrição   |
| ----------------------- | ------------- |
| **president**     | Presidente    |
| **partner**       | Sócio        |
| **administrator** | Administrador |
| **director**      | Diretor       |
| **manager**       | Gestor        |
| **attorney**      | Procurador    |

---

### Níveis de Maturidade

#### Enumerador: maturity_level

| Enumerador                    | Descrição           |
| ----------------------------- | --------------------- |
| **factoring**           | Fomento Mercantil     |
| **assignor_risk**       | Risco Cedente         |
| **debtor_risk**         | Risco Sacado          |
| **limited_issuer_risk** | Risco Sacado Limitado |

#### Hierarquia de Níveis de Maturidade

| Nível de Maturidade | Níveis Subsequentes |
|----------------------|---------------------|
| Fomento Mercantil | Risco do Cedente, Risco do Devedor, Risco do Emissor Limitado |
| Risco do Cedente | Risco do Devedor, Risco do Emissor Limitado |
| Risco do Devedor | Risco do Emissor Limitado |
| Risco do Emissor Limitado | - |

---

# Definição de Assinantes

URL: /en/documentation/iaas/homologacao_cedente/cadastro/definicao_de_assinantes

Após o envio do cadastro do cedente, é possível, **opcionalmente**, definir conjuntos customizados de assinantes para a operação. Esses conjuntos determinam quais partes relacionadas (do cedente ou de avalistas) devem assinar cada tipo de documento, com possibilidade de regras por tipo de produto.

Caso nenhum conjunto customizado seja enviado, o sistema utiliza os conjuntos padrão definidos pela administradora.

:::info Informação
Os conjuntos de assinantes (`signer_group_sets`) representam grupos de assinantes vinculados a um proprietário (`owner`), que pode ser o **cedente** (`assignor_registry`) ou uma **parte relacionada de análise** (`analysis_related_party`, de avalistas).

A definição customizada permite, por exemplo, exigir múltiplos assinantes, ou restringir quem pode assinar determinado produto.
:::

:::warning Atenção
A definição de conjuntos customizados deve ocorrer antes da etapa de [Envio para Análise](/documentation/iaas/homologacao_cedente/cadastro/disparo_da_analise). Após o envio para análise, os conjuntos vigentes serão utilizados nas assinaturas dos contratos de cessão.
:::

---

## Definição de Conjunto Customizado para o Cedente

Permite ao cliente substituir o conjunto padrão de assinantes do cedente por um ou mais conjuntos customizados, organizados por produto. Os assinantes informados devem corresponder a partes relacionadas previamente cadastradas como representantes do cedente.

### Request

ENDPOINT /assignor_registry/assignor_registry/ASSIGNOR_REGISTRY_KEY/analysis/ANALYSIS_KEY/custom_signer_groups
MÉTODO POST

```json title='Request Body'
{
  "signer_group_sets": [
    {
      "product": "assignment_contract",
      "signer_groups": [
        {
          "minimum_required_signers": 2,
          "signers": [
            {
              "document_number": "883.512.866-80",
              "is_required_signer": true
            },
            {
              "document_number": "802.834.257-41",
              "is_required_signer": false
            }
          ],
          "expiration": "2026-12-31"
        }
      ]
    },
    {
      "product": "commercial_paper",
      "signer_groups": [
        {
          "minimum_required_signers": 1,
          "signers": [
            {
              "document_number": "883.512.866-80",
              "is_required_signer": true
            }
          ],
          "expiration": "2026-12-31"
        }
      ]
    }
  ]
}
```

### Response

STATUS 204

Sem conteúdo no corpo de resposta.

:::info Informação
A criação de um conjunto customizado para o cedente substitui o conjunto `main` (padrão) vigente para o produto informado. Apenas os conjuntos com `status` ativo são utilizados nas assinaturas.
:::

:::warning Atenção
Ao enviar, o grupo de assinantes nasce no status `in_analysis`. Signer groups sets neste status não são enviados para assinatura. Com a aprovação do cadastro, o grupo passa para o status `valid`, e só então, será utilizado para assinaturas acima do `main` signer group.
:::

:::warning Atenção
Caso o `custom` signer group enviado seja **menos restritivo** que o validado pela Administradora, a análise será **negada**.
:::

### Erros Tratáveis

| Código | HTTP | Causa | Como resolver |
|--------|------|-------|---------------|
| ASR000004 | 404 | Cedente não encontrado para o `assignor_registry_key` informado. | Verificar se o `assignor_registry_key` está correto. |
| ASR000033 | 404 | Análise não encontrada para o `analysis_key` informado. | Verificar se o `analysis_key` está correto. |
| ASR000066 | 400 | Status da análise não permite definição de grupos customizados. | A análise deve estar em `pending_documents` para receber grupos customizados. |
| ASR000109 | 404 | Tipo de produto inválido. | Usar um valor válido para `product` (ver enum [Product Type](#product-type)). |
| ASR000118 | 400 | Signatário inválido. | O `document_number` enviado em `signers` deve corresponder a um representante já cadastrado para o cedente, com `is_representative=true`. |

---

## Definição de Conjunto Customizado para Parte Relacionada

Permite definir conjuntos customizados para uma parte relacionada específica do cedente — como avalistas (`guarantors`) — utilizando a `analysis_related_party_key` retornada na criação da análise.

:::info Informação
Lembre-se de que avalistas são representados como `analysis_related_party`. Logo, este endpoint é o ponto único para customizar assinantes de qualquer parte vinculada à análise (representantes do cedente, avalistas e representantes de avalistas).
:::

### Request

ENDPOINT /assignor_registry/assignor_registry/ASSIGNOR_REGISTRY_KEY/analysis/ANALYSIS_KEY/related_party/ANALYSIS_RELATED_PARTY_KEY/custom_signer_groups
MÉTODO POST

```json title='Request Body'
{
  "signer_group_sets": [
    {
      "product": "assignment_contract",
      "signer_groups": [
        {
          "minimum_required_signers": 1,
          "signers": [
            {
              "document_number": "244.412.084-13",
              "is_required_signer": true
            }
          ],
          "expiration": "2026-12-31"
        }
      ]
    }
  ]
}
```

### Response

STATUS 204

Sem conteúdo no corpo de resposta.

:::warning Atenção
Ao enviar, o grupo de assinantes nasce no status `in_analysis`. Signer groups sets neste status não são enviados para assinatura. Com a aprovação do cadastro, o grupo passa para o status `valid`, e só então, será utilizado para assinaturas acima do `main` signer group.
:::

:::warning Atenção
Caso o `custom` signer group enviado seja **menos restritivo** que o validado pela Administradora, a análise será **negada**.
:::

### Erros Tratáveis

| Código | HTTP | Causa | Como resolver |
|--------|------|-------|---------------|
| ASR000004 | 404 | Cedente não encontrado para o `assignor_registry_key` informado. | Verificar se o `assignor_registry_key` está correto. |
| ASR000033 | 404 | Análise não encontrada para o `analysis_key` informado. | Verificar se o `analysis_key` está correto. |
| ASR000035 | 404 | Parte relacionada da análise não encontrada para o `analysis_related_party_key` informado. | Verificar se o `analysis_related_party_key` corresponde a um avalista ou representante de avalista da análise. |
| ASR000066 | 400 | Status da análise não permite definição de grupos customizados. | A análise deve estar em `pending_documents` para receber grupos customizados. |
| ASR000109 | 404 | Tipo de produto inválido. | Usar um valor válido para `product` (ver enum [Product Type](#product-type)). |
| ASR000118 | 400 | Signatário inválido. | O `document_number` enviado em `signers` deve corresponder a um representante já cadastrado para a parte relacionada (avalista ou representante de avalista). |

---

## Consulta de Conjuntos de Assinantes

Esse endpoint permite ao cliente consultar os conjuntos de assinantes existentes para o cedente e suas partes relacionadas, incluindo os conjuntos padrão gerados automaticamente. É útil para identificar `signer_group_set_key` e estrutura atual antes de criar uma versão customizada.

### Request

ENDPOINT /assignor_registry/signer_group_sets
MÉTODO GET

#### Query Parameters

| Campo | Tipo | Descrição |
|-------|------|-----------|
| `limit` | integer | Quantidade de itens por página (0 a 50). Padrão: 10. |
| `page` | integer | Página a ser consultada, iniciando em 0. Padrão: 0. |
| `owner_key` | string | Filtra pelo identificador do proprietário (cedente ou parte relacionada). |
| `owner_type` | string | Tipo do proprietário. Ver **[Owner Type](#owner-type)**. |
| `owner_document_number` | string | Documento do proprietário. Exige `owner_type` para ser utilizado. |
| `product_type` | string | Filtra por tipo de produto. Ver **[Product Type](#product-type)**. |

### Response

STATUS 200

```json title='Response Body'
{
  "data": [
    {
      "signer_group_set_key": "f2c1e4a8-91d2-4f10-8a3b-7e5c9b2d4a6e",
      "owner_key": "c4295375-4077-4092-a258-5bcdf8875907",
      "owner_type": "assignor_registry",
      "product_type": "assignment_contract",
      "signer_group_set_type": "custom",
      "status": "active",
      "signer_groups": [
        {
          "minimum_required_signers": 2,
          "signers": [
            {
              "document_number": "883.512.866-80",
              "is_required_signer": true
            },
            {
              "document_number": "802.834.257-41",
              "is_required_signer": false
            }
          ],
          "expiration": null
        }
      ]
    }
  ],
  "limit": 10,
  "page": 0,
  "is_last_page": true
}
```

### Erros Tratáveis

| Código | HTTP | Causa | Como resolver |
|--------|------|-------|---------------|
| ASR000121 | 400 | `owner_document_number` enviado sem `owner_type`. | Ao filtrar por `owner_document_number`, sempre informar também `owner_type`. |
| ASR000120 | 400 | Valor de `status` inválido no filtro. | Usar um valor válido para o filtro `status` (ver enum [Signer Group Set Status](#signer-group-set-status)). |

---

## Definições

### Definição de Conjunto de Assinantes (Signer Group Set)

| Campo | Tipo | Descrição | Caracteres |
|-------|------|-----------|------------|
| `signer_group_set_key` | string | Identificador único do conjunto. | 36 |
| `owner_key` | string | Identificador do proprietário. Pode ser `assignor_registry_key` ou `analysis_related_party_key`. | 36 |
| `owner_type` | string | Tipo do proprietário. | Ver **[Owner Type](#owner-type)**. |
| `product_type` | string | Tipo de produto ao qual o conjunto está associado. | Ver **[Product Type](#product-type)**. |
| `signer_group_set_type` | string | Tipo do conjunto (`main` ou `custom`). | Ver **[Signer Group Set Type](#signer-group-set-type)**. |
| `status` | string | Status do conjunto. | Ver **[Signer Group Set Status](#signer-group-set-status)**. |
| `signer_groups` | array | Lista de grupos de assinantes que compõem o conjunto. | Ver **[Definição de Grupo de Assinantes](#definição-de-grupo-de-assinantes-signer-group)**. |

---

### Definição de Item de Envio (Signer Group Set Item)

Estrutura utilizada no corpo das requisições de criação de conjuntos customizados.

| Campo | Tipo | Descrição | Caracteres |
|-------|------|-----------|------------|
| `product` * | string | Tipo de produto ao qual o conjunto será associado. | Ver **[Product Type](#product-type)**. |
| `signer_groups` * | array | Lista de grupos de assinantes (mínimo 1). | Ver **[Definição de Grupo de Assinantes](#definição-de-grupo-de-assinantes-signer-group)**. |

*Campos obrigatórios.

---

### Definição de Grupo de Assinantes (Signer Group)

| Campo | Tipo | Descrição | Caracteres |
|-------|------|-----------|------------|
| `minimum_required_signers` * | number | Quantidade mínima de assinantes do grupo necessários para validar a assinatura. | Mínimo 1 |
| `signers` * | array | Lista de assinantes do grupo (mínimo 1). | Ver **[Definição de Assinante](#definição-de-assinante-signer)**. |
| `expiration` | string | Data de expiração do grupo no formato `YYYY-MM-DD`. | 10 |

*Campos obrigatórios.

---

### Definição de Assinante (Signer)

| Campo | Tipo | Descrição | Caracteres |
|-------|------|-----------|------------|
| `document_number` * | string | CPF do assinante no formato `XXX.XXX.XXX-XX`. | 14 |
| `is_required_signer` * | boolean | Indica se o assinante é obrigatório no grupo. | - |

*Campos obrigatórios.

:::info Informação
Os `document_number` enviados devem corresponder a partes relacionadas (representantes do cedente, ou representantes do avalista em questão) presentes no cadastro do cedente. Documentos que não estiverem associados ao cedente serão rejeitados.
:::

---

# Enumeradores

### Owner Type

| Enumerador | Descrição |
|------------|-----------|
| **assignor_registry** | Conjunto vinculado ao cedente. |
| **analysis_related_party** | Conjunto vinculado a uma parte relacionada da análise (avalistas). |

---

### Product Type

| Enumerador | Descrição |
|------------|-----------|
| **assignment_contract** | Contrato de cessão (utilizado por padrão). |
| **commercial_paper** | Nota Comercial (Cadastro único com a plataforma de escrituração). |

---

### Signer Group Set Type

| Enumerador | Descrição |
|------------|-----------|
| **main** | Conjunto padrão, gerado da análise da Administradora. |
| **custom** | Conjunto customizado, criado pelo cliente sobrepondo o conjunto `main`. |

---

### Signer Group Set Status

| Enumerador | Descrição |
|------------|-----------|
| **in_analysis** | Conjunto enviado e atrelado à análise em aberto. |
| **active** | Conjunto vigente e utilizado nas assinaturas. |
| **inactive** | Conjunto substituído por uma versão mais recente ou desativado. |

---

# Envio para Análise

URL: /en/documentation/iaas/homologacao_cedente/cadastro/disparo_da_analise

---
### Request

ENDPOINT /assignor_registry/assignor_registry/ASSIGNOR_REGISTRY_KEY/analysis/ANALYSIS_KEY
METHOD PUT

```json title='Request Body'
{
    "analysis_status":"sent_to_analysis"
}
```

### Body Params

| Campo | Tipo | Descrição | Caracteres |
|-------|------|-----------|------------|
| `analysis_status` * | string | Novo status da análise a ser enviado (deve ser igual a **sent_to_analysis**). | 1 a 50 |

*Campo obrigatório.

### Response

STATUS 202

```json title='Response Body'
{
  "analysis_key": "2b1fa466-4d36-48e9-b6e3-776a1b700b9f",
  "analysis_number": 1,
  "assignor_registry_key": "d0a93900-457d-496a-8326-480ecaf946c3",
  "status": "sent_to_analysis"
}
```

:::caution Atenção!
Uma análise deve ser efetivamente enviada somente após anexar todos os documentos pertinentes. Uma vez enviada a análise, não será mais possível anexar novos documentos.
:::

---

# Envio de Cadastro

URL: /en/documentation/iaas/homologacao_cedente/cadastro/envio_de_cadastro

---
## Cadastro de Cedente Pessoa Jurídica

### Request

ENDPOINT /assignor_registry/assignor_registry
METHOD POST

```json title='Request Body'
{
  "name": "QI CTVM",
  "document_number": "67.987.787/0001-06",
  "person_type": "legal_person",
  "email": "qidtvm@qitech.com.br",
  "maturity_level": "debtor_risk",
  "address": {
    "street": "Gilberto Sabino",
    "number": "215",
    "neighborhood": "Pinheiros",
    "city": "São Paulo",
    "postal_code": "05425-020",
    "uf": "SP",
    "country": "BRA"
  },
  "phone": {
    "area_code": "11",
    "number": "936360268"
  },
  "legal_person": {
    "activity_code": "11.11-1-11",
    "representatives": [
      {
        "name": "Natália Nascimento",
        "document_number": "883.512.866-80",
        "email": "natália.nascimento@yopmail.com",
        "representative_type": "attorney",
        "person_type": "natural_person",
        "address": {
          "street": "Gilberto Sabino",
          "number": "215",
          "neighborhood": "Pinheiros",
          "city": "São Paulo",
          "postal_code": "05425-020",
          "uf": "SP",
          "country": "BRA"
        },
        "phone": {
          "area_code": "11",
          "number": "36360268"
        },
        "natural_person": {
          "mother_name": "Lívia Santos",
          "birthdate": "1978-04-11"
        }
      },
      {
        "name": "Natália Nascimento",
        "document_number": "802.834.257-41",
        "email": "natália.nascimento@yopmail.com",
        "representative_type": "attorney",
        "person_type": "natural_person",
        "address": {
          "street": "Gilberto Sabino",
          "number": "215",
          "neighborhood": "Pinheiros",
          "city": "São Paulo",
          "postal_code": "05425-020",
          "uf": "SP",
          "country": "BRA"
        },
        "phone": {
          "area_code": "11",
          "number": "36360268"
        },
        "natural_person": {
          "mother_name": "Lívia Santos",
          "birthdate": "1978-04-11"
        }
      }
    ]
  }
}
```

---

### Definição do Cedente

| Campo | Tipo | Descrição | Caracteres |
|-------|------|-----------|------------|
| `name` * | string | Nome do cedente. | 1 a 255 |
| `maturity_level` * | string | Nível de maturidade (risco) do cedente. Ver **[Níveis de Maturidade](#níveis-de-maturidade)**| 1 a 255 |
| `document_number` * | string | Número de documento do cedente (CNPJ). | 14 a 18 |
| `person_type` * | string | Tipo de pessoa (física ou jurídica) do cedente. | 1 a 255 |
| `email`  | string | Endereço de e-mail do cedente. | 1 a 255 |
| `phone`  | object | Objeto referenciando as informações do telefone do cedente. Ver **[Definição de Telefone](#definição-de-telefone)**. | - |
| `address` * | object | Objeto referenciando as informações do endereço do cedente. Ver **[Definição de Endereço](#definição-de-endereço)**. | - |
| `legal_person` * | object | Objeto referenciando as informações da pessoa jurídica do cedente. Ver **[Definição de Pessoa Jurídica](#definição-de-pessoa-jurídica)**. | - |

*Campos obrigatórios.

### Response

STATUS 201

```json title='Response Body'
{
  "assignor_registry_key": "c4295375-4077-4092-a258-5bcdf8875907",
  "status": "pending_registry",
  "name": "QI CTVM",
  "document_number": "67.987.787/0001-06",
  "person_type": "legal_person",
  "maturity_level": "debtor_risk",
  "email": "qidtvm@qitech.com.br",
  "phone": {
    "number": "936360268",
    "area_code": "11"
  },
  "address": {
    "uf": "SP",
    "city": "São Paulo",
    "number": "215",
    "street": "Gilberto Sabino",
    "country": "BRA",
    "postal_code": "05425-020",
    "neighborhood": "Pinheiros"
  },
  "legal_person": {
    "activity_code": "11.11-1-11",
    "representatives": []
  },
  "last_analysis": {
    "analysis_key": "d7805a05-98a7-486b-a440-807f1d3d5691",
    "analysis_number": 1,
    "assignor_registry_key": "c4295375-4077-4092-a258-5bcdf8875907",
	"status": "pending_documents",
    "analysis_data": {
      "name": "QI CTVM",
      "email": "qidtvm@qitech.com.br",
      "phone": {
        "number": "936360268",
        "area_code": "11"
      },
      "address": {
        "uf": "SP",
        "city": "São Paulo",
        "number": "215",
        "street": "Gilberto Sabino",
        "country": "BRA",
        "postal_code": "05425-020",
        "neighborhood": "Pinheiros"
      },
      "person_type": "legal_person",
      "legal_person": {
        "activity_code": "11.11-1-11",
        "representatives": [
          {
            "name": "Natália Nascimento",
            "email": "natália.nascimento@yopmail.com",
            "phone": {
              "number": "36360268",
              "area_code": "11"
            },
            "address": {
              "uf": "SP",
              "city": "São Paulo",
              "number": "215",
              "street": "Gilberto Sabino",
              "country": "BRA",
              "postal_code": "05425-020",
              "neighborhood": "Pinheiros"
            },
            "person_type": "natural_person",
            "natural_person": {
              "birthdate": "1978-04-11",
              "mother_name": "Lívia Santos"
            },
            "document_number": "883.512.866-80",
            "representative_type": "attorney"
          },
          {
            "name": "Natália Nascimento",
            "email": "natália.nascimento@yopmail.com",
            "phone": {
              "number": "36360268",
              "area_code": "11"
            },
            "address": {
              "uf": "SP",
              "city": "São Paulo",
              "number": "215",
              "street": "Gilberto Sabino",
              "country": "BRA",
              "postal_code": "05425-020",
              "neighborhood": "Pinheiros"
            },
            "person_type": "natural_person",
            "natural_person": {
              "birthdate": "1978-04-11",
              "mother_name": "Lívia Santos"
            },
            "document_number": "802.834.257-41",
            "representative_type": "attorney"
          }
        ]
      },
      "maturity_level": "debtor_risk",
      "document_number": "67.987.787/0001-06"
    },
    "analysis_representatives": [
      {
        "analysis_representative_key": "5cdcc13b-c67d-45f3-aa66-36cb4f178b59",
        "document_number": "802.834.257-41",
        "person_data": {
          "name": "Natália Nascimento",
          "email": "natália.nascimento@yopmail.com",
          "phone": {
            "number": "36360268",
            "area_code": "11"
          },
          "address": {
            "uf": "SP",
            "city": "São Paulo",
            "number": "215",
            "street": "Gilberto Sabino",
            "country": "BRA",
            "postal_code": "05425-020",
            "neighborhood": "Pinheiros"
          },
          "person_type": "natural_person",
          "natural_person": {
            "birthdate": "1978-04-11",
            "mother_name": "Lívia Santos"
          },
          "document_number": "802.834.257-41",
          "representative_type": "attorney"
        }
      },
      {
        "analysis_representative_key": "d4c75c93-4aa9-4567-89c4-b49334927721",
        "document_number": "883.512.866-80",
        "person_data": {
          "name": "Natália Nascimento",
          "email": "natália.nascimento@yopmail.com",
          "phone": {
            "number": "36360268",
            "area_code": "11"
          },
          "address": {
            "uf": "SP",
            "city": "São Paulo",
            "number": "215",
            "street": "Gilberto Sabino",
            "country": "BRA",
            "postal_code": "05425-020",
            "neighborhood": "Pinheiros"
          },
          "person_type": "natural_person",
          "natural_person": {
            "birthdate": "1978-04-11",
            "mother_name": "Lívia Santos"
          },
          "document_number": "883.512.866-80",
          "representative_type": "attorney"
        }
      }
    ],
    "documents": []
  }
}
```

:::info
É importante armazenar a `assignor_registry_key` pois ela será utilizada em diversos outros processos, assim como a `analysis_key` e as `analysis_representative_key` que serão utilizadas para envio de documentos do cedente e dos representantes.
:::

---

## Cadastro de Cedente Pessoa Física

### Request

ENDPOINT /assignor_registry/assignor_registry
METHOD POST

```json title='Request Body'
{
  "name": "Natália Nascimento",
  "document_number": "951.585.151-31",
  "person_type": "natural_person",
  "email": "natália.nascimento@yopmail.com",
  "maturity_level": "debtor_risk",
  "address": {
    "street": "Gilberto Sabino",
    "number": "215",
	"complement": "Sample Apt1",
    "neighborhood": "Pinheiros",
    "city": "São Paulo",
    "postal_code": "05425-020",
    "uf": "SP",
    "country": "BRA"
  },
  "phone": {
    "area_code": "11",
    "number": "36360268"
  },
  "natural_person": {
    "mother_name": "Lívia Santos",
    "birthdate": "1978-04-11"
  }
}
```

---

### Definição do Cedente

| Campo | Tipo | Descrição | Caracteres |
|-------|------|-----------|------------|
| `name` * | string | Nome do cedente. | 1 a 255 |
| `maturity_level` * | string | Nível de maturidade (risco) do cedente. Ver **[Níveis de Maturidade](#níveis-de-maturidade)**| 1 a 255 |
| `document_number` * | string | Número de documento do cedente (CPF). | 14 a 18 |
| `person_type` * | string | Tipo de pessoa (física ou jurídica) do cedente. | 1 a 255 |
| `email` * | string | Endereço de e-mail do cedente. | 1 a 255 |
| `phone`  | object | Objeto referenciando as informações do telefone do cedente. Ver **[Definição de Telefone](#definição-de-telefone)**. | - |
| `address` * | object | Objeto referenciando as informações do endereço do cedente. Ver **[Definição de Endereço](#definição-de-endereço)**. | - |
| `natural_person` * | object | Objeto referenciando as informações da pessoa física do cedente. Ver **[Definição de Pessoa Física](#definição-de-pessoa-física)**. | - |

*Campos obrigatórios.

---

### Response

STATUS 201

```json title='Response Body'
{
  "assignor_registry_key": "2c242f4b-ae30-4207-9c83-07194f66b95c",
  "status": "pending_registry",
  "name": "Natália Nascimento",
  "document_number": "951.585.151-31",
  "person_type": "natural_person",
  "maturity_level": "debtor_risk",
  "email": "natália.nascimento@yopmail.com",
  "phone": {
    "number": "36360268",
    "area_code": "11"
  },
  "address": {
    "uf": "SP",
    "city": "São Paulo",
    "number": "215",
    "street": "Gilberto Sabino",
    "country": "BRA",
    "postal_code": "05425-020",
    "neighborhood": "Pinheiros"
  },
  "natural_person": {
    "birthdate": "1978-04-11",
    "mother_name": "Lívia Santos"
  },
  "last_analysis": {
    "analysis_key": "303ee51e-813d-45e2-b427-07a0e4b64836",
    "analysis_number": 1,
    "assignor_registry_key": "2c242f4b-ae30-4207-9c83-07194f66b95c",
    "status": "pending_documents",
    "analysis_data": {
      "name": "Natália Nascimento",
      "email": "natália.nascimento@yopmail.com",
      "phone": {
        "number": "36360268",
        "area_code": "11"
      },
      "address": {
        "uf": "SP",
        "city": "São Paulo",
        "number": "215",
        "street": "Gilberto Sabino",
        "country": "BRA",
        "postal_code": "05425-020",
        "neighborhood": "Pinheiros"
      },
      "person_type": "natural_person",
      "maturity_level": "debtor_risk",
      "natural_person": {
        "birthdate": "1978-04-11",
        "mother_name": "Lívia Santos"
      },
      "document_number": "951.585.151-31"
    },
    "analysis_representatives": [],
    "documents": []
  }
}
```

:::info
É importante armazenar a `assignor_registry_key` pois ela será utilizada em diversos outros processos, assim como a `analysis_key` e as `analysis_representative_key` que serão utilizadas para envio de documentos do cedente e dos representantes.
:::

---

## Definições

### Definição de Endereço

| Campo | Tipo | Descrição | Caracteres |
|-------|------|-----------|------------|
| `street` * | string | Nome da rua. | 1 a 255 |
| `number` * | string | Número do endereço. | 1 a 4 |
| `neighborhood` * | string | Bairro. | 1 a 255 |
| `city` * | string | Cidade. | 1 a 255 |
| `uf` * | string | Sigla do estado. | 2 |
| `complement` | string | Complemento do endereço. | 1 a 255 |
| `postal_code` * | string | Código postal. | 9 (formato: XXXXX-XXX) |
| `country` * | string | País (sigla). | 3 |

*Campos obrigatórios.

---

### Definição de Telefone

| Campo | Tipo | Descrição | Caracteres |
|-------|------|-----------|------------|
| `international_dial_code` | string | Código internacional de discagem. | 1 a 3 |
| `area_code` * | string | Código de área. | 2 |
| `number` * | string | Número de telefone. | 8 a 9 |

*Campos obrigatórios.

---

### Definição de Pessoa Jurídica

| Campo | Tipo | Descrição | Caracteres |
|-------|------|-----------|------------|
| `foundation_date` | string | Data de fundação da empresa. | 10 (formato: YYYY-MM-DD) |
| `activity_code` | string | Código de atividade da empresa. | 10 (formato: XX.XX-X-XX) |
| `annual_revenues` | integer | Receita anual da empresa. | - |
| `representatives` * | array | Lista de representantes da empresa **. Ver  **[Definição de Representante](#definição-de-representante)**. | - |

*Campos obrigatórios.

**Atualmente são aceitos apenas representantes **Pessoa Física**.

### Definição de Representante

| Campo | Tipo | Descrição | Caracteres |
|-------|------|-----------|------------|
| `name` * | string | Nome do representante. | 1 a 255 |
| `document_number` * | string | Número de documento do representante (CPF). | 14 a 18 |
| `person_type` * | string | Tipo de pessoa do representante (deve ser pessoa física). | 1 a 255 |
| `email` * | string | Endereço de e-mail do representante. | 1 a 255 |
| `phone`  | object | Objeto referenciando as informações do telefone do representante. Ver **[Definição de Telefone](#definição-de-telefone)**. | - |
| `address`  | object | Objeto referenciando as informações do endereço do representante. Ver **[Definição de Endereço](#definição-de-endereço)**. | - |
| `natural_person` * | object | Objeto referenciando as informações da pessoa física do representante. Ver **[Definição de Pessoa Física](#definição-de-pessoa-física)**. | - |

*Campos obrigatórios.

---

### Definição de Pessoa Física

| Campo | Tipo | Descrição | Caracteres |
|-------|------|-----------|------------|
| `birthdate` * | string | Data de nascimento da pessoa. | 10 (formato: YYYY-MM-DD) |
| `gender` | string | Gênero da pessoa. Ver **[Enumerador de Gênero](#enumerador-de-gênero)**. | 1 a 6 (valores: "male" ou "female") |
| `mother_name` | string | Nome da mãe da pessoa. | 1 a 255 |

*Campos obrigatórios.

#### Enumerador de Gênero

| Enumerador   | Descrição     |
|--------------|---------------|
| **male** | Masculino. |
| **female**   | Feminino. |

# Enumeradores

### Assignor Registry Status

| Enumerador                 | Descrição       |
| -------------------------- | ----------------- |
| **pending_registry** | Pendente Registro |
| **registered**       | Registrado        |

---

### Analysis Status

| Enumerador              | Descrição           |
| ----------------------- | --------------------- |
| **pending_documents**  | Pendente Documentos   |
| **sent_to_analysis**   | Enviado para Análise |
| **in_manual_analysis** | Em Análise Manual    |
| **approved**           | Aprovado              |
| **reproved**           | Reprovado             |

---

### Representative Type

| Enumerador              | Descrição   |
| ----------------------- | ------------- |
| **president**     | Presidente    |
| **partner**       | Sócio        |
| **administrator** | Administrador |
| **director**      | Diretor       |
| **manager**       | Gestor        |
| **attorney**      | Procurador    |

---

### Níveis de Maturidade

#### Enumerador: maturity_level

| Enumerador                    | Descrição           |
| ----------------------------- | --------------------- |
| **factoring**           | Fomento Mercantil     |
| **assignor_risk**       | Risco Cedente         |
| **debtor_risk**         | Risco Sacado          |
| **limited_issuer_risk** | Risco Sacado Limitado |

#### Hierarquia de Níveis de Maturidade

| Nível de Maturidade | Níveis Subsequentes |
|----------------------|---------------------|
| Fomento Mercantil | Risco do Cedente, Risco do Devedor, Risco do Emissor Limitado |
| Risco do Cedente | Risco do Devedor, Risco do Emissor Limitado |
| Risco do Devedor | Risco do Emissor Limitado |
| Risco do Emissor Limitado | - |

---

# Envio de Documentos

URL: /en/documentation/iaas/homologacao_cedente/cadastro/envio_de_documentos

---

## Documentos do Cedente

### Request

ENDPOINT /assignor_registry/assignor_registry/ASSIGNOR_REGISTRY_KEY/analysis/ANALYSIS_KEY/document
METHOD POST

```json title='Request Body'
{
    "document_type":"social_contract",
    "document_b64": "aGVsbG8gd29ybGQgaWYgeW91IGRlY29kZWQgbWUsIGJlIGNhcmVmdWwuIEl0IG11c3QgYmUgYSBQREYgRmlsZSBvdGhlcndpc2UgSSB3aWxsIHJhaXNlIGFuIEVycm9yLg=="
}
```

## Objeto de Documento

| Campo | Tipo | Descrição | Caracteres |
|-------|------|-----------|------------|
| `document_type` * | string | Tipo do documento. Ver **[Tipos de Documento ](#tipos-de-documento)**.  | 1 a 50 |
| `document_b64` * | string | Deve ser o binário do arquivo em PDF, codificado em Base64. | - |

*Campos obrigatórios.

### Response

STATUS 201

```json title='Response Body'
{
    "document_key": "8e515a17-8b4d-49a3-aed6-47c9574e426a",
    "document_type": "social_contract",
    "analysis_key": "63db95c2-9985-405a-a521-6904f9e96cc6",
    "status": "valid"
}
```

:::info
Em caso de atualização cadastral, o envio de documentos específicos do cedente na análise será necessário somente quando houver alguma atualização nas informações que sejam **específicas do cedente**.
:::

## Documentos dos Representantes

### Request

ENDPOINT /assignor_registry/assignor_registry/ASSIGNOR_REGISTRY_KEY/analysis/ANALYSIS_KEY/analysis_representative/ANALYSIS_REPRESENTATIVE_KEY/document
METHOD POST

```json title='Request Body'
{
    "document_type":"cnh",
    "document_b64": "aGVsbG8gd29ybGQgaWYgeW91IGRlY29kZWQgbWUsIGJlIGNhcmVmdWwuIEl0IG11c3QgYmUgYSBQREYgRmlsZSBvdGhlcndpc2UgSSB3aWxsIHJhaXNlIGFuIEVycm9yLg=="
}
```

### Object de Documento

| Campo | Tipo | Descrição | Caracteres |
|-------|------|-----------|------------|
| `document_type` * | string | Tipo do documento. Ver **[Tipos de Documento ](#tipos-de-documento)**.  | 1 a 50 |
| `document_b64` * | string | Deve ser o binário do arquivo em PDF, codificado em Base64. | - |

*Campos obrigatórios.

### Response

STATUS 201

```json title='Response Body'
{
    "document_key": "afe8532a-4b0b-4e63-8d16-5084b2681752",
    "document_type": "cnh",
    "analysis_representative_key": "fd1fb513-5ffc-4060-bca1-17deed680011",
    "status": "valid"
}
```

:::info
Em caso de atualização cadastral, o envio de documentos dos representantes na análise será necessário somente quando houver alguma inclusão ou atualização de representantes do cedente.
:::

:::caution Atenção!
Caso um documento seja enviado com o tipo errado, ou com má qualidade ele pode retornar com o status **invalid**, e assim é necessário reenviá-lo corretamente.
:::

---

## Tipos de Documento

### Enumeradores: *document_type*

| Enumerador                   | Descrição                |
| ---------------------------- | -------------------------- |
| **cnh**                      | CNH                        |
| **rg_back**                  | RG parte traseira          |
| **rg_front**                 | RG parte frontal           |
| **proof_of_residence**       | Comprovante de Residência  |
| **cnpj_card**                | Cartão CNPJ                |
| **financial_statements**     | Declarações Financeiras    |
| **power_of_attorney**        | Procuração                 |
| **billing_statement**        | Extrato de Cobrança        |
| **social_contract**          | Contrato/Estatuto Social   |

### Documentos padrão do cedente

| Tipo de Pessoa | *document_type* | Descrição |
|----------------|-------------------|------------|
| Pessoa Física | cnh | CNH (Carteira Nacional de Habilitação) |
| Pessoa Física | rg_back | RG (Carteira de Identidade) - Verso |
| Pessoa Física | rg_front | RG (Carteira de Identidade) - Frente |
| Pessoa Jurídica | social_contract | Contrato Social |

### Documentos padrão do representante

| Tipo de Pessoa | *document_type* | Descrição |
|----------------|-------------------|------------|
| Pessoa Física | cnh | CNH (Carteira Nacional de Habilitação) |
| Pessoa Física | rg_back | RG (Carteira de Identidade) - Verso |
| Pessoa Física | rg_front | RG (Carteira de Identidade) - Frente |
| Pessoa Jurídica | social_contract | Contrato Social |

### Documentos exigidos por nível de maturidade

| Nível de Maturidade | *document_type* | Descrição |
|----------------------|-------------------|---------------------|
| factoring | financial_statements | Demonstrativos Financeiros |
| factoring | power_of_attorney | Procuração |
| factoring | billing_statement | Extrato Bancário |
| assignor_risk | financial_statements | Demonstrativos Financeiros |
| debtor_risk | - | - |

---

# Branch Registration

URL: /en/documentation/iaas/homologacao_cedente/cadastro/filiais

For branch enablement, there are two operational flows that can be followed:

1. **Complete Flow (From scratch):** This is the comprehensive branch registration, covering everything from address and billing data to legal representative and guarantor information. In this flow, enablement follows the standard process presented previously in the documentation, going through document approval and power validation. This flow requires a new assignment contract for effective enablement of the assignor in the fund.
2. **Simplified Flow (Linked Registration):** Presented on this page, this flow treats the branch registration as a link to a previously registered parent company. In it, only basic data is sent and a new `assignor_registry_key` is created, but data such as representatives and guarantors are mandatorily reused from the parent company analysis.

:::info
If the branch is already registered as an assignor, it's also possible to link it to the parent company. In this case, previous documentation, representation and guarantors are discarded, and it inherits the parent company's data.
:::

## Advantages of the Facilitated Flow

There are two main advantages in the facilitated branch activation flow:

* **Payment Options:** When performing an assignment operation with the branch, the parent company accounts also become payment options.
* **Configuration Replication:** All Assignment Configurations from the parent company are automatically replicated to the branch as soon as it's approved, avoiding the need for the contract signing step. To retrieve the new keys, we recommend using the paginated assignment configuration GET, topic 5.3.1.2., with parameters such as `assignment_contract_key`, `asset_type` and `assignor_document_number`, using the contract formalized by the parent company as reference.

:::warning Attention
The facilitated branch flow requires the presence of the following clause in the parent contract formalized with the parent company to be used:

> CONSIDERING that the ASSIGNOR declares and guarantees that, if applicable, it is the parent company and holds full powers to legally represent all its branches before the ASSIGNEE, including for the practice of all acts necessary for the formalization and execution of assignments. The ASSIGNOR recognizes and assumes joint and unlimited responsibility for all obligations assumed by its branches as a result of assignments made with the ASSIGNEE, waiving, for all purposes, any allegation of lack of powers or autonomy.
:::

---

## Creating a new Branch

Even though the parent company's AML has already been performed, the first analysis (the linking one) of a branch always goes through the external data consultation and validation step, requiring waiting for the analysis approval or rejection hook, which is sent automatically.

### Request

ENDPOINT /assignor_registry/assignor_registry/ASSIGNOR_REGISTRY_KEY/branch
MÉTODO POST

:::info
The `assignor_registry_key` sent in the request must belong to the assignor's PARENT COMPANY, and it must already be enabled.
:::

```json title='Request Body'
{
    "document_number": "32.402.502/0002-16",
    "email": "qitechfilial@qitech.com.br",
    "phone": {
        "international_dial_code": "+55",
        "area_code": "11",
        "number": "936360269"
    },
    "address": {
        "street": "Rua Maria Carolina dois",
        "number": "624",
        "neighborhood": "Jardim Paulistano",
        "city": "Campinas",
        "postal_code": "01445-000",
        "uf": "SP",
        "country": "BRA"
    },
    "annual_revenues": 20000,
    "accounts": [
        {
            "account_branch": "0001",
            "account_number": "0423223",
            "account_digit": "6",
            "financial_institution_code": "329",
            "account_type": "checking_account",
            "default_account": true
        }
    ]
}
```

| Field | Type | Description | Characters |
|-------|------|-------------|------------|
| `document_number` * | string | Assignor document number (CNPJ). | 14 to 18 |
| `annual_revenues` * | number | Declaration of assignor's annual revenue, in integers. | Minimum of 1 |
| `email` * | string | Assignor email address. | 1 to 255 |
| `phone`  | object | Object referencing assignor's phone information. | See **[Phone Definition](#definição-de-telefone)**. |
| `address` * | object | Object referencing assignor's address information. | See **[Address Definition](#definição-de-endereço)**. |
| `accounts` * | array | List of assignor's disbursement accounts.| See **[Account Definition](#definição-de-conta)**. |

*Required fields.

### Response

STATUS 201

```json title='Response Body'
{
  "assignor_registry_key": "9c130814-1aa5-4dcb-b6af-c4abdfca2947",
  "status": "pending_registry",
  "name": "QI Tech",
  "document_number": "32.402.502/0002-16",
  "last_analysis": {
    "analysis_key": "49bcaaca-6029-4f6f-97a0-d71f7cefb7ae",
    "analysis_number": 1,
	  "status": "sent_to_analysis",
    "analysis_related_parties": [
      {
        "analysis_related_party_key": "65a74b18-0da8-4460-844b-524c9941e615",
        "document_number": "802.834.257-41",
        "name": "Roberto Carlos",
        "documents": []
      },
      {
        "analysis_related_party_key": "f2bc3473-1686-4d15-9a06-b51d25e20cb4",
        "document_number": "883.512.866-80",
        "name": "Natália Nascimento",
        "documents": []
      },
      {
        "analysis_related_party_key": "272cc251-a56d-4b89-82a1-d815a319b9fb",
        "passport_number": "C01X00T47",
        "name": "Maria Vitoria",
        "documents": []
      }
    ],
    "documents": [
      {
        "document_key": "5530af20-f52e-4a2e-b0f3-732e8121f4b3",
        "document_type": "social_contract",
        "status": "valid",
      }
    ],
    "analysis_data": {}
  }
}
```

| Field | Type | Description | Characters |
|-------|------|-------------|------------|
| `assignor_registry_key` | string | Registry identifier. | 36 |
| `status` | string | Registry status. | See **[Registry status enumerators](#assignor-registry-status)**. |
| `name` | string | Assignor name. | 1 to 255 |
| `document_number` | string | Assignor document. | 14 to 18 |
| `last_analysis`  | object | Analysis object. | See **[Analysis Definition](#definição-de-análise)**. |

:::info
All representation, guarantor and document information will be automatically replicated from the parent company registry. However, the account sent must be owned by the branch, otherwise, future transfers will fail.
:::

:::info
It's important to store the assignor_registry_key, as it will be used in various other processes, as well as the analysis_key and analysis_related_party_key.
:::

---

## Linking an existing branch to the parent company

If both the branch and parent company already exist in different registries, it's possible to force the link between them. In this flow, all branch information that wasn't part of the creation request payload will be replaced by the parent company information.

### Request

ENDPOINT /assignor_registry/assignor_registry/ASSIGNOR_REGISTRY_KEY/branch
MÉTODO PUT

:::info
The `assignor_registry_key` sent in the request must belong to the assignor's PARENT COMPANY, and it must already be enabled.
:::

```json title='Request Body'
{
    "branch_assignor_registry_key": "9c130814-1aa5-4dcb-b6af-c4abdfca2947",
}
```

| Field | Type | Description | Characters |
|-------|------|-------------|------------|
| `branch_assignor_registry_key` * | string | Registry identifier. | 36 |

*Required fields.

### Response

STATUS 200

```json title='Response Body'
{
  "assignor_registry_key": "9c130814-1aa5-4dcb-b6af-c4abdfca2947",
  "status": "pending_registry",
  "name": "QI Tech",
  "document_number": "32.402.502/0002-16",
  "last_analysis": {
    "analysis_key": "49bcaaca-6029-4f6f-97a0-d71f7cefb7ae",
    "analysis_number": 1,
	  "status": "sent_to_analysis",
    "analysis_related_parties": [
      {
        "analysis_related_party_key": "65a74b18-0da8-4460-844b-524c9941e615",
        "document_number": "802.834.257-41",
        "name": "Roberto Carlos",
        "documents": []
      },
      {
        "analysis_related_party_key": "f2bc3473-1686-4d15-9a06-b51d25e20cb4",
        "document_number": "883.512.866-80",
        "name": "Natália Nascimento",
        "documents": []
      },
      {
        "analysis_related_party_key": "272cc251-a56d-4b89-82a1-d815a319b9fb",
        "passport_number": "C01X00T47",
        "name": "Maria Vitoria",
        "documents": []
      }
    ],
    "documents": [
      {
        "document_key": "5530af20-f52e-4a2e-b0f3-732e8121f4b3",
        "document_type": "social_contract",
        "status": "valid",
      }
    ],
    "analysis_data": {}
  }
}
```

| Field | Type | Description | Characters |
|-------|------|-------------|------------|
| `assignor_registry_key` | string | Registry identifier. | 36 |
| `status` | string | Registry status. | See **[Registry status enumerators](#assignor-registry-status)**. |
| `name` | string | Assignor name. | 1 to 255 |
| `document_number` | string | Assignor document. | 14 to 18 |
| `last_analysis`  | object | Analysis object. | See **[Analysis Definition](#definição-de-análise)**. |

---

## Updating Branch Data

Even though it's a linked registry, branch information can still be updated, but with some restrictions:

Information such as email, phone, address and annual_revenues can be updated using the same endpoint used to change parent company data (presented below). However, data such as name, related_parties, guarantors and documentation itself must always be updated in the Parent Company. When the parent company change is approved, all linked branches automatically replicate the data.

### Request

ENDPOINT /assignor_registry/assignor_registry/ASSIGNOR_REGISTRY_KEY
MÉTODO PUT

```json title='Request Body'
{
  "email": "qidtvm@qitech.com.br",
  "annual_revenues": 1000000,
  "address": {
    "street": "Rua Maria Carolina",
    "number": "624",
    "neighborhood": "Jardim Paulistano",
    "city": "São Paulo",
    "postal_code": "01445-000",
    "uf": "SP",
    "country": "BRA"
  },
  "phone": {
    "international_dial_code": "+55",
    "area_code": "11",
    "number": "936360268"
  }
}
```

| Field | Type | Description | Characters |
|-------|------|-------------|------------|
| `annual_revenues`  | number | Declaration of assignor's annual revenue. | - |
| `email`  | string | Assignor email address. | 1 to 255 |
| `phone`  | object | Object referencing assignor's phone information. | See **[Phone Definition](#definição-de-telefone)**. |
| `address`  | object | Object referencing assignor's address information. | See **[Address Definition](#definição-de-endereço)**. |

If you don't want to change a field, simply don't send it in the request.

### Response

STATUS 200

```json title='Response Body'
{
  "assignor_registry_key": "9c130814-1aa5-4dcb-b6af-c4abdfca2947",
  "status": "registred",
  "name": "QI Tech",
  "document_number": "32.402.502/0002-16",
  "last_analysis": {
    "analysis_key": "f51a49e1-842c-471f-a0e1-32ee9f12625d",
    "analysis_number": 2,
    "status": "approved",
    "analysis_related_parties": [
      {
        "analysis_related_party_key": "f361763a-91f5-4688-8e28-cc3f3fbccf9a",
        "document_number": "802.834.257-41",
        "name": "Roberto Carlos",
        "documents": []
      },
      {
        "analysis_related_party_key": "7ea3193b-8e53-40b7-94cf-2d3cc62942e0",
        "document_number": "883.512.866-80",
        "name": "Natália Nascimento",
        "documents": []
      },
      {
        "analysis_related_party_key": "f321f063-5f9a-4964-a24a-52deba128160",
        "passport_number": "C01X00T47",
        "name": "Maria Vitoria",
        "documents": []
      }
    ],
    "documents": [
      {
        "document_key": "994621ac-7d3f-4f6b-90c5-74a4d8c5d017",
        "document_type": "social_contract",
        "status": "valid",
      }
    ],
    "analysis_data": {}
  }
}
```

| Field | Type | Description | Characters |
|-------|------|-------------|------------|
| `assignor_registry_key` | string | Registry identifier. | 36 |
| `status` | string | Registry status. | See **[Registry status enumerators](#assignor-registry-status)**. |
| `name` | string | Assignor name. | 1 to 255 |
| `document_number` | string | Assignor document. | 14 to 18 |
| `last_analysis`  | object | Analysis object. | See **[Analysis Definition](#definição-de-análise)**. |

:::info
Unlike parent company registration, since the changes don't involve representation and AML data, branch changes are always AUTOMATICALLY approved.
:::

:::info
Account maintenance follows exactly the same logic as parent company account maintenance, according to section 5.2.2.5.
:::

---

## Definitions

### Address Definition

| Field | Type | Description | Characters |
|-------|------|-------------|------------|
| `street` * | string | Street name. | 1 to 255 |
| `number` * | string | Address number. | 1 to 4 |
| `neighborhood` * | string | Neighborhood. | 1 to 255 |
| `city` * | string | City. | 1 to 255 |
| `uf` * | string | State abbreviation. | 2 |
| `complement` | string | Address complement. | 1 to 255 |
| `postal_code` * | string | Postal code. | 9 (format: XXXXX-XXX) |
| `country` * | string | Country (abbreviation). | 3, according to ISO 3166-1 alpha-3 |

*Required fields.

---

### Phone Definition

| Field | Type | Description | Characters |
|-------|------|-------------|------------|
| `international_dial_code` * | string | International dialing code. | 1 to 3 |
| `area_code` * | string | Area code. | 2 |
| `number` * | string | Phone number. | 8 to 9 |

*Required fields.

---

### Related Party Definition

| Field | Type | Description | Characters |
|-------|------|-------------|------------|
| `name` * | string | Related party name. | 1 to 255 |
| `document_number` ** | string | Beneficiary document number (CPF). | 14 to 18 |
| `passport_number` ** | string | Foreign beneficiary document number. | 8 to 9 |
| `related_party_type` * | string | Related party relationship type. | See **[Related party type enumerators](#related-party-type)** |
| `nationality` * | string | Beneficiary's country of origin. | 3, according to ISO 3166-1 alpha-3 |
| `direct_beneficiary` * | boolean | Beneficiary directly or indirectly linked to the assignor. | 1 to 255 |
| `is_representative` * | boolean | Indicator if the related party is a signing representative of the assignor. | 1 to 255 |
| `company_registry_number` *** | string | If not directly linked to the assignor, which company they are linked to. | 1 to 255 |
| `company_country` *** | string | Country where the link company between the beneficiary and assignor is registered. | 3, according to ISO 3166-1 alpha-3 |
| `address` | object | Object referencing the representative's address information. | See **[Address Definition](#definição-de-endereço)**. |
| `email` **** | string | Representative email address. | 1 to 255 |
| `phone` | object | Object referencing the representative's phone information. |  See **[Phone Definition](#definição-de-telefone)**. |
| `marital_status` | string | Related party marital status. | See **[Marital status enumerators](#marital-status)**. |
| `property_system` | string | Property separation regime. | See **[Property system enumerators](#property-system)**. |
| `profession` | string | Related party profession. | 1 to 255. |

*Required fields.

**document_number required for Brazilians, for foreigners, if they have CPF, document_number can be used, otherwise, at least passport_number must be sent.

***Required fields if the related party is not a beneficiary directly linked to the assignor. Otherwise, they shouldn't be sent.

****Fields required only for signing representatives.

:::info
Non-mandatory fields like `marital_status` and `address` can be sent if you want more complete qualification in the parent assignment contract in future steps.
:::

---

### Analysis Definition

| Field | Type | Description | Characters |
|-------|------|-------------|------------|
| `analysis_key` * | string | Analysis identifier. | 36 |
| `analysis_number` * | integer | Sequential analysis number. | - |
| `status` * | string | Analysis status. | See **[Analysis status enumerators](#analysis-status)**. |
| `analysis_related_parties` * | array | Analysis related parties. | See **[Analysis Related Parties Definition](#definição-de-partes-relacionadas-de-análise)**. |
| `documents` * | array | Analysis documents. | See **[Document Definition](#definição-de-documentos)**. |
| `analysis_data` * | object | Request payload that originated the analysis. | - |
| `analysis_datetime` * | string | Analysis creation datetime object. | - |
| `reproval_reason` | string | Enumerator with analysis rejection reason. | See **[Reproval reason enumerators](#analysis-reproval-reason)**. |
| `reproval_details` | string | Free field with analysis rejection details. | - |

*Required fields.

---

### Analysis Related Parties Definition

| Field | Type | Description | Characters |
|-------|------|-------------|------------|
| `analysis_related_party_key` * | string | Related party identifier. | 36 |
| `document_number` * | string | Related party document number. | 14 to 18 |
| `name` * | string | Related party name. | 1 to 255 |
| `documents` * | array | Related party analysis documents. | See **[Document Definition](#definição-de-documentos)**. |

*Required fields.

---

### Document Definition

| Field | Type | Description | Characters |
|-------|------|-------------|------------|
| `document_key` * | string | Document identifier. | 36 |
| `document_type` * | string | Document type. | See **[Document type enumerators](#document-type)**. |
| `status` | string | Document status. | See **[Document status enumerators](#document-status)**. |
| `observation` | string | Sent observations. | - |

*Required fields.

---

### Account Definition

| Field | Type | Description | Characters |
|-------|------|-------------|------------|
| `account_branch` * | string | Assignor account branch. | 4 |
| `account_number` * | string | Assignor account number. | 3 - 20 |
| `account_digit` * | string | Assignor account digit. | 1 |
| `financial_institution_code` * | string | Assignor account bank code. | 3 |
| `account_type` * | string | Account type. | See **[Account type enumerators](#account-type)**. |
| `default_account` * | boolean | Default disbursement account. | - |

*Required fields.

Only one assignor account can be the default account, which will be the account to which assignment money will be sent if no alternative account is specified. If more than one default account is sent, an error will be returned.

:::warning Attention
Be very careful when filling in account data. If the account is invalid, the assignment payment will not occur, and the entire operation will be canceled.
:::

---

### Guarantor Definition

| Field | Type | Description | Characters |
|-------|------|-------------|------------|
| `name` * | string | Guarantor name. | 3 - 255 |
| `document_number` * | string | Guarantor document number. | 14 to 18 |
| `person_type` * | string | Person type (individual or legal entity) of the assignor. | - |
| `email` * | string | Guarantor email address. | 1 to 255 |
| `nationality` | string | Guarantor's country of origin. | 3, according to ISO 3166-1 alpha-3 |
| `phone` | object | Object referencing guarantor's phone information. |  See **[Phone Definition](#definição-de-telefone)**. |
| `address` | object | Object referencing guarantor's address information. | See **[Address Definition](#definição-de-endereço)**. |
| `guarantor_representatives` | array | Guarantor signers - Only for legal entity guarantor. | See **[Guarantor Representative Definition](#definição-de-representante-do-avalista)**. |
| `marital_status` | string | Guarantor marital status. | See **[Marital status enumerators](#marital-status)**. |
| `property_system` | string | Property separation regime. | See **[Property system enumerators](#property-system)**. |
| `profession` | string | Guarantor profession. | 1 to 255. |

*Required fields.

The `guarantor_representatives` field can be used to indicate both representatives of a legal entity guarantor, as well as, in the case of an individual guarantor, where necessary, the spouse for Spousal Consent.

:::warning Attention
Both the guarantor and representatives will also be added to the generated analysis, requiring sending standard documents according to their person type. They also go through the compliance process, which may generate findings.
:::

---

### Guarantor Representative Definition

| Field | Type | Description | Characters |
|-------|------|-------------|------------|
| `name` * | string | Representative name. | 3 - 255 |
| `document_number` * | string | Guarantor representative document number - must be an individual. | 14 |
| `email` * | string | Guarantor representative email address. | 1 to 255 |
| `nationality` | string | Guarantor representative's country of origin. | 3, according to ISO 3166-1 alpha-3 |
| `address` | object | Object referencing guarantor representative's address information. | See **[Address Definition](#definição-de-endereço)**. |
| `phone` | object | Object referencing guarantor representative's phone information. |  See **[Phone Definition](#definição-de-telefone)**. |
| `marital_status` | string | Guarantor representative marital status. | See **[Marital status enumerators](#marital-status)**. |
| `property_system` | string | Property separation regime. | See **[Property system enumerators](#property-system)**. |
| `profession` | string | Guarantor representative profession. | 1 to 255. |

---

# Enumerators

### Assignor Registry Status

| Enumerator                 | Description       |
| -------------------------- | ----------------- |
| **pending_registry** | Pending Registration |
| **registered**       | Registered        |

---

### Analysis Status

| Enumerator              | Description           |
| ----------------------- | --------------------- |
| **pending_documents**  | Pending Documents   |
| **sent_to_analysis**   | Sent to Analysis |
| **pending_internal_validation** | In Document Validation    |
| **in_manual_analysis** | In Manual Compliance Analysis    |
| **approved**           | Approved              |
| **reproved**           | Rejected             |

---

### Related Party Type

| Enumerator              | Description   |
| ----------------------- | ------------- |
| **president**     | President    |
| **partner**       | Partner        |
| **administrator** | Administrator |
| **director**      | Director       |
| **manager**       | Manager        |
| **attorney**      | Attorney    |

---

### Document Status

| Enumerator              | Description   |
| ----------------------- | ------------- |
| **created**     | Created    |
| **valid**       | Valid        |
| **invalid** | Invalid |
| **canceled** | Canceled |
| **accepted** | Accepted, but not validated |

---

### Document Type

| Enumerator                   | Description                |
| ---------------------------- | -------------------------- |
| **cnh**                      | Driver's License.                        |
| **rg_back**                  | ID back side.          |
| **rg_front**                 | ID front side.           |
| **passport**                 | Passport - exclusive for foreigners.           |
| **national_migration_registry**                 | National Migration Registry.           |
| **cin_digital**                 | National Identity Card (Digital).           |
| **passport**                 | Passport - exclusive for foreigners.           |
| **social_contract**          | Social Contract/Bylaws.   |
| **cnpj_card**          | CNPJ Card.   |
| **commercial_board_certificate** | Simplified Commercial Board Certificate. |
| **board_election_record** | Current Board Election Minutes. |
| **power_of_attorney**        | Power of Attorney - required if the representative is an attorney. |
| **marital_power_of_attorney**        | Spousal Power of Attorney - available only for spouses. |
| **compliance_statement**        | Compliance Opinion. |
| **financial_statement**        | Financial Statement. |
| **credit_report**        | Credit Minutes/Opinion. |
| **manager_statement**        | Manager Opinion/Record. |
| **visit_report**        | Visit Report. |
| **proof_of_residence**        | Proof of Residence. |
| **credit_agency_consulation**        | Credit Protection Agency Consultation. |
| **annual_revenues_declaration**        | Revenue Declaration. |
| **financial_institutions_declaration**        | Banking Relationship Declaration. |
| **additional_document**        | Additional document - free. |

---

### Account Type

| Enumerator           | Description           |
|----------------------|---------------------|
| **checking_account** | Checking Account      |

---

### Analysis Reproval Reason
| Enum         | 	Description  |
|--------------|---------------|
| **assignor_update**   | Analysis canceled due to subsequent registry update |
| **insuficient_documents**  | Minimum documentation for power verification not sent |
| **compliance_reproval**  | Link rejection by compliance team analysis |
| **unidentified_related_parties** | Related party sent, but link not proven |
| **invalid_documents** | Invalid/expired documentation |
| **missing_related_parties** | Mandatory related party not sent |

---

### Marital Status
| Enum         | 	Description  |
|--------------|---------------|
| **single**   | Single   |
| **married**  | Married    |
| **widower**  | Widowed     |
| **divorced** | Divorced |
| **separated** | Separated |
| **stable_union** | In Stable Union |

---

### Property System

| Enum                              | Description                              |
| --------------------------------- | -------------------------------------- |
| **total_communion_of_goods**        | Total Communion of Goods                |
| **partial_communion_of_goods**      | Partial Communion of Goods              |
| **total_separation_of_goods**       | Total Separation of Goods               |
| **final_participation_of_acquisitions** | Final Participation in Acquisitions    |
| **compulsory_separation_of_goods**  | Compulsory Separation of Goods         |

---

# Assignor Accounts

URL: /en/documentation/iaas/homologacao_cedente/cadastro/manutencao_de_contas

When registering an assignor, it is mandatory to provide at least one assignment disbursement account for the assignor. During the assignment approval stage by the manager, it is possible to indicate any of the registered accounts for the assignor to receive the disbursement. It is worth noting that if the operation proposer between assignor and fund is a consultant, account maintenance will be the responsibility of the consultancy instead of the manager.

Unlike registration data such as representatives, addresses, and other data, no new analysis will be created when making changes to the assignor's accounts, so the change takes effect immediately. For a disbursement account, the account holder must obligatorily be the assignor, including account ownership, and the account owner's document number is already assumed to be the assignor's.

:::warning Attention
Be very careful when filling in account data. If the account is invalid, the assignment payment will not occur, and the entire operation will be canceled.
:::

---

## Adding Alternative Account

### Request

ENDPOINT /assignor_registry/assignor_registry/ASSIGNOR_REGISTRY_KEY/account
METHOD POST

```json title='Request Body'
{
    "account_number": "8473124",
    "account_digit": "8",
    "account_branch": "0001",
    "account_type": "checking_account",
    "financial_institution_code": "329",
    "default_account": false
}
```

## Account Object

| Field | Type | Description | Characters |
|-------|------|-------------|------------|
| `account_number` * | string | Account number. | 3-20 |
| `account_digit` * | string | Account digit. | 1 |
| `account_branch` * | string | Account branch. | 4 |
| `account_type` * | string | Account type. | - |
| `financial_institution_code` * | string | Bank code of the account. | 3 |
| `default_account` * | boolean | Default disbursement account. | - |

*Required fields.

### Response

STATUS 201

```json title='Response Body'
{
    "account_key": "3c53a94a-2b81-4837-b7eb-8e025e69d81c",
    "account_branch": "0001",
    "account_number": "8473124",
    "account_digit": "8",
    "account_type": "checking_account",
    "status": "active",
    "financial_institution_code": "329",
    "financial_institution_ispb": "32402502",
    "default_account": false,
}
```

:::info
If the new account is sent with "default_account" true, the old default disbursement account will be made a non-default account, and from then on, the new posted account will be the default disbursement account.
:::

## Account Update

It is not possible to change account data. If desired, it is necessary to deactivate the incorrect account and create a new account with valid data.

To change the default disbursement account, simply indicate which will be the new account, and the old one will be automatically changed. It is not possible to set an account as non-default disbursement; you must always indicate the new one.

### Request

ENDPOINT /assignor_registry/assignor_registry/ASSIGNOR_REGISTRY_KEY/account/ACCOUNT_KEY
METHOD PUT

```json title='Request Body'
{
    "status": "active",
    "default_account": true,
}
```

## Account Object

| Field | Type | Description | Characters |
|-------|------|-------------|------------|
| `status` | string | New account status. | See **[Account Status Enumerators](#account-status)**. |
| `default_account` | boolean | Default disbursement account. | - |

*Required fields (none).

### Response

STATUS 200

```json title='Response Body'
{
    "account_key": "3c53a94a-2b81-4837-b7eb-8e025e69d81c",
    "account_branch": "0001",
    "account_number": "8473124",
    "account_digit": "8",
    "account_type": "checking_account",
    "status": "active",
    "financial_institution_code": "329",
    "financial_institution_ispb": "32402502",
    "default_account": true,
}
```

:::info
If the update is sent with "default_account" true, the old default disbursement account will be made a non-default account, and from then on, the new posted account will be the default disbursement account. It is not possible to deactivate a default account or set an inactive account as default.
:::

# Enumerators

### Account Status

| Enumerator                 | Description       |
| -------------------------- | ----------------- |
| **active** | Active account available as disbursement option. |
| **inactive** | Inactive account unavailable for disbursement. |

---

# Webhooks da Análise

URL: /en/documentation/iaas/homologacao_cedente/cadastro/webhooks_analise

---

#### Em Análise Manual

STATUS In Manual Analysis

```json title='Webhook Body'
{
    "assignor_registry_key": "35ff6e5c-a3e7-4b04-a8be-6e49a3a906e4",
    "analysis_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "status": "in_manual_analysis"
}
```

#### Aprovado

STATUS Approved

```json title='Webhook Body'
{
    "assignor_registry_key": "35ff6e5c-a3e7-4b04-a8be-6e49a3a906e4",
    "analysis_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "status": "approved"
}
```

#### Reprovado

STATUS Reproved

```json title='Webhook Body'
{
    "assignor_registry_key": "35ff6e5c-a3e7-4b04-a8be-6e49a3a906e4",
    "analysis_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "status": "reproved"
}
```

---

# Consulta de Análise

URL: /en/documentation/iaas/homologacao_cedente/consulta/consulta_de_analise

---
## Consulta de Análise Específica

### Request

ENDPOINT /assignor_registry/assignor_registry/ASSIGNOR_REGISTRY_KEY/analysis/ANALYSIS_KEY
METHOD GET

### Response

STATUS 202

```json title='Response Body'
{
  "analysis_key": "d7805a05-98a7-486b-a440-807f1d3d5691",
  "analysis_number": 1,
  "assignor_registry_key": "c4295375-4077-4092-a258-5bcdf8875907",
  "status": "pending_documents",
  "analysis_data": {
    "name": "QI CTVM",
    "email": "qidtvm@qitech.com.br",
    "phone": {
      "number": "936360268",
      "area_code": "11"
    },
    "address": {
      "uf": "SP",
      "city": "São Paulo",
      "number": "215",
      "street": "Gilberto Sabino",
      "country": "BRA",
      "postal_code": "05425-020",
      "neighborhood": "Pinheiros"
    },
    "person_type": "legal_person",
    "legal_person": {
      "activity_code": "11.11-1-11",
      "representatives": [
        {
          "name": "Natália Nascimento",
          "email": "natália.nascimento@yopmail.com",
          "phone": {
            "number": "36360268",
            "area_code": "11"
          },
          "address": {
            "uf": "SP",
            "city": "São Paulo",
            "number": "215",
            "street": "Gilberto Sabino",
            "country": "BRA",
            "postal_code": "05425-020",
            "neighborhood": "Pinheiros"
          },
          "person_type": "natural_person",
          "natural_person": {
            "birthdate": "1978-04-11",
            "mother_name": "Lívia Santos"
          },
          "document_number": "883.512.866-80",
          "representative_type": "attorney"
        },
        {
          "name": "Natália Nascimento",
          "email": "natália.nascimento@yopmail.com",
          "phone": {
            "number": "36360268",
            "area_code": "11"
          },
          "address": {
            "uf": "SP",
            "city": "São Paulo",
            "number": "215",
            "street": "Gilberto Sabino",
            "country": "BRA",
            "postal_code": "05425-020",
            "neighborhood": "Pinheiros"
          },
          "person_type": "natural_person",
          "natural_person": {
            "birthdate": "1978-04-11",
            "mother_name": "Lívia Santos"
          },
          "document_number": "802.834.257-41",
          "representative_type": "attorney"
        }
      ]
    },
    "maturity_level": "debtor_risk",
    "document_number": "67.987.787/0001-06"
  }
}
```

---

## Consulta Paginada de Análises

### Request

ENDPOINT /assignor_registry/assignor_registry/ASSIGNOR_REGISTRY_KEY/analyses
METHOD GET

### Path params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `limit` | integer | Limite de objetos | - |
| `page` | integer | Página desejada | - |

### Response

STATUS 202

```json title='Response Body'
{
    "data": [
      {
        "analysis_key": "d7805a05-98a7-486b-a440-807f1d3d5691",
        "analysis_number": 1,
        "assignor_registry_key": "c4295375-4077-4092-a258-5bcdf8875907",
        "status": "pending_documents",
        "analysis_data": {
          "name": "QI CTVM",
          "email": "qidtvm@qitech.com.br",
          "phone": {
            "number": "936360268",
            "area_code": "11"
          },
          "address": {
            "uf": "SP",
            "city": "São Paulo",
            "number": "215",
            "street": "Gilberto Sabino",
            "country": "BRA",
            "postal_code": "05425-020",
            "neighborhood": "Pinheiros"
          },
          "person_type": "legal_person",
          "legal_person": {
            "activity_code": "11.11-1-11",
            "representatives": [
              {
                "name": "Natália Nascimento",
                "email": "natália.nascimento@yopmail.com",
                "phone": {
                  "number": "36360268",
                  "area_code": "11"
                },
                "address": {
                  "uf": "SP",
                  "city": "São Paulo",
                  "number": "215",
                  "street": "Gilberto Sabino",
                  "country": "BRA",
                  "postal_code": "05425-020",
                  "neighborhood": "Pinheiros"
                },
                "person_type": "natural_person",
                "natural_person": {
                  "birthdate": "1978-04-11",
                  "mother_name": "Lívia Santos"
                },
                "document_number": "883.512.866-80",
                "representative_type": "attorney"
              },
              {
                "name": "Natália Nascimento",
                "email": "natália.nascimento@yopmail.com",
                "phone": {
                  "number": "36360268",
                  "area_code": "11"
                },
                "address": {
                  "uf": "SP",
                  "city": "São Paulo",
                  "number": "215",
                  "street": "Gilberto Sabino",
                  "country": "BRA",
                  "postal_code": "05425-020",
                  "neighborhood": "Pinheiros"
                },
                "person_type": "natural_person",
                "natural_person": {
                  "birthdate": "1978-04-11",
                  "mother_name": "Lívia Santos"
                },
                "document_number": "802.834.257-41",
                "representative_type": "attorney"
              }
            ]
          },
          "maturity_level": "debtor_risk",
          "document_number": "67.987.787/0001-06"
        }
      }
    ],
    "limit": 10,
    "page": 0,
    "is_last_page": true,
}
```

---

# Consulta de Cedente

URL: /en/documentation/iaas/homologacao_cedente/consulta/consulta_de_cedente

---
## Consulta de Cedente Específico

### Request

ENDPOINT /assignor_registry/assignor_registry/ASSIGNOR_REGISTRY_KEY
METHOD GET

---

### Response

STATUS 202

```json title='Response Body'
{
  "assignor_registry_key": "c4295375-4077-4092-a258-5bcdf8875907",
  "status": "pending_registry",
  "name": "QI CTVM",
  "document_number": "67.987.787/0001-06",
  "person_type": "legal_person",
  "maturity_level": "debtor_risk",
  "email": "qidtvm@qitech.com.br",
  "phone": {
    "number": "936360268",
    "area_code": "11"
  },
  "address": {
    "uf": "SP",
    "city": "São Paulo",
    "number": "215",
    "street": "Gilberto Sabino",
    "country": "BRA",
    "postal_code": "05425-020",
    "neighborhood": "Pinheiros"
  },
  "legal_person": {
    "activity_code": "11.11-1-11",
    "representatives": []
  },
  "last_analysis": {
    "analysis_key": "d7805a05-98a7-486b-a440-807f1d3d5691",
    "analysis_number": 1,
    "assignor_registry_key": "c4295375-4077-4092-a258-5bcdf8875907",
	"status": "pending_documents",
    "analysis_data": {
      "name": "QI CTVM",
      "email": "qidtvm@qitech.com.br",
      "phone": {
        "number": "936360268",
        "area_code": "11"
      },
      "address": {
        "uf": "SP",
        "city": "São Paulo",
        "number": "215",
        "street": "Gilberto Sabino",
        "country": "BRA",
        "postal_code": "05425-020",
        "neighborhood": "Pinheiros"
      },
      "person_type": "legal_person",
      "legal_person": {
        "activity_code": "11.11-1-11",
        "representatives": [
          {
            "name": "Natália Nascimento",
            "email": "natália.nascimento@yopmail.com",
            "phone": {
              "number": "36360268",
              "area_code": "11"
            },
            "address": {
              "uf": "SP",
              "city": "São Paulo",
              "number": "215",
              "street": "Gilberto Sabino",
              "country": "BRA",
              "postal_code": "05425-020",
              "neighborhood": "Pinheiros"
            },
            "person_type": "natural_person",
            "natural_person": {
              "birthdate": "1978-04-11",
              "mother_name": "Lívia Santos"
            },
            "document_number": "883.512.866-80",
            "representative_type": "attorney"
          },
          {
            "name": "Natália Nascimento",
            "email": "natália.nascimento@yopmail.com",
            "phone": {
              "number": "36360268",
              "area_code": "11"
            },
            "address": {
              "uf": "SP",
              "city": "São Paulo",
              "number": "215",
              "street": "Gilberto Sabino",
              "country": "BRA",
              "postal_code": "05425-020",
              "neighborhood": "Pinheiros"
            },
            "person_type": "natural_person",
            "natural_person": {
              "birthdate": "1978-04-11",
              "mother_name": "Lívia Santos"
            },
            "document_number": "802.834.257-41",
            "representative_type": "attorney"
          }
        ]
      },
      "maturity_level": "debtor_risk",
      "document_number": "67.987.787/0001-06"
    },
    "analysis_representatives": [
      {
        "analysis_representative_key": "5cdcc13b-c67d-45f3-aa66-36cb4f178b59",
        "document_number": "802.834.257-41",
        "person_data": {
          "name": "Natália Nascimento",
          "email": "natália.nascimento@yopmail.com",
          "phone": {
            "number": "36360268",
            "area_code": "11"
          },
          "address": {
            "uf": "SP",
            "city": "São Paulo",
            "number": "215",
            "street": "Gilberto Sabino",
            "country": "BRA",
            "postal_code": "05425-020",
            "neighborhood": "Pinheiros"
          },
          "person_type": "natural_person",
          "natural_person": {
            "birthdate": "1978-04-11",
            "mother_name": "Lívia Santos"
          },
          "document_number": "802.834.257-41",
          "representative_type": "attorney"
        }
      },
      {
        "analysis_representative_key": "d4c75c93-4aa9-4567-89c4-b49334927721",
        "document_number": "883.512.866-80",
        "person_data": {
          "name": "Natália Nascimento",
          "email": "natália.nascimento@yopmail.com",
          "phone": {
            "number": "36360268",
            "area_code": "11"
          },
          "address": {
            "uf": "SP",
            "city": "São Paulo",
            "number": "215",
            "street": "Gilberto Sabino",
            "country": "BRA",
            "postal_code": "05425-020",
            "neighborhood": "Pinheiros"
          },
          "person_type": "natural_person",
          "natural_person": {
            "birthdate": "1978-04-11",
            "mother_name": "Lívia Santos"
          },
          "document_number": "883.512.866-80",
          "representative_type": "attorney"
        }
      }
    ],
    "documents": []
  }
}
```

---

## Consulta Paginada de Cedentes

### Request

ENDPOINT /assignor_registry/assignor_registries
METHOD GET

### Path params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `name` | string | Nome do cedente | 1-255 |
| `document_number` | string | Número de documento do cedente | 1-18 |
| `maturity_level` | string | Nível de risco do cedente  | 1-255 |
| `assignor_registry_status` | string | Status do cedente | 1-255 |
| `analysis_status` | string | Status da análise mais recente | 1-255 |
| `limit` | integer | Limite de objetos | - |
| `page` | integer | Página desejada | - |

### Response

STATUS 202

```json title='Response Body'
{
    "data": [
      {
        "assignor_registry_key": "2c242f4b-ae30-4207-9c83-07194f66b95c",
        "status": "pending_registry",
        "name": "Natália Nascimento",
        "document_number": "951.585.151-31",
        "person_type": "natural_person",
        "maturity_level": "debtor_risk",
        "email": "natália.nascimento@yopmail.com",
        "phone": {
          "number": "36360268",
          "area_code": "11"
        },
        "address": {
          "uf": "SP",
          "city": "São Paulo",
          "number": "215",
          "street": "Gilberto Sabino",
          "country": "BRA",
          "postal_code": "05425-020",
          "neighborhood": "Pinheiros"
        },
        "natural_person": {
          "birthdate": "1978-04-11",
          "mother_name": "Lívia Santos"
        },
        "last_analysis": {
          "analysis_key": "303ee51e-813d-45e2-b427-07a0e4b64836",
          "analysis_number": 1,
          "assignor_registry_key": "2c242f4b-ae30-4207-9c83-07194f66b95c",
          "status": "pending_documents",
          "analysis_data": {
            "name": "Natália Nascimento",
            "email": "natália.nascimento@yopmail.com",
            "phone": {
              "number": "36360268",
              "area_code": "11"
            },
            "address": {
              "uf": "SP",
              "city": "São Paulo",
              "number": "215",
              "street": "Gilberto Sabino",
              "country": "BRA",
              "postal_code": "05425-020",
              "neighborhood": "Pinheiros"
            },
            "person_type": "natural_person",
            "maturity_level": "debtor_risk",
            "natural_person": {
              "birthdate": "1978-04-11",
              "mother_name": "Lívia Santos"
            },
            "document_number": "951.585.151-31"
          },
          "analysis_representatives": [],
          "documents": []
        }
      }
    ],
    "limit": 10,
    "page": 0,
    "is_last_page": true,
}
```

---

# Query Documents

URL: /en/documentation/iaas/homologacao_cedente/contrato_de_cessao/consulta_de_documentos

---

### Request

ENDPOINT /assignment_contract/assignment_contract/ASSIGNMENT_CONTRACT_KEY/attached_document/DOCUMENT_KEY
METHOD GET

### Path Params

| Parameter                    | Description                        |
|------------------------------|------------------------------------|
| `assignment_contract_key`    | Assignment contract key            |
| `document_key`               | Document key                       |

### Response 
STATUS 200

```json
{
   "document_key":"UUID",
   "document_type":"manager_declaration | assignment_contract",
   "status":"signed | pending_signature",
   "document_template_key":"UUID",
   "required_parties":[
      "manager | consultant | attestant"
   ],
   "download_url":"url para download do documento"
}
```

:::info Note
The download url field provides the signed URL for downloading the document in its most current version, meaning if the document is signed it will be provided through this same URL. It expires and should not be used for timeless queries.
:::

### Attached Document Definition

| Field | Type | Description | Characters |
|-------|------|-----------|------------|
| `document_key` * | string | Document unique identification key. | 36 |
| `document_type` * | string | Document type. | -- |
| `status` * | string | Document status. | See **[Document status enumerators](#attached-document-status)**. |
| `document_template_key` | string | Unique identification key of the template that generated the document. | 36 |
| `required_parties` | array | List of parties that sign the document in question. | -- |
| `download_url` | string | PDF download URL. | -- |

# Enumerators

### Attached Document Status

| Enumerator              | Description           |
| ----------------------- | --------------------- |
| **pending_generate**  | Pending document generation |
| **approved** | Document generated |
| **signed**           | Document signed |

---

# Contract Manipulation

URL: /en/documentation/iaas/homologacao_cedente/contrato_de_cessao/manutencao_do_contrato

---

Depending on the flow, it may be necessary to make some calls to complete the contract flow.

---

# Manager Approval

---

If the contract is proposed by a consultancy, after document generation, manager approval will be required before it is sent for signature.

### Request

ENDPOINT /assignment_contract/assignment_contract/ASSIGNMENT_CONTRACT_KEY
MÉTODO PUT

```json title='Request Body'
{
    "status": "denied",
    "denial_reason": "Documentação do cedente insuficiente",
}
```

#### Body Params

| Field | Type | Description | Characters |
|-|-|-|-|
| `status` * | string | Manager's Decision. denied or approved | -- |
| `denial_reason` | string | Description with the reason for refusal. | 1 to 500 |

*Required fields

### Response

STATUS 202

---

# Manual Signature Submission

---

If the template configures manual submission for signature, it's possible to group multiple contracts, as long as they have the same manager, assignor and guarantors, for the same signature batch.

### Request

ENDPOINT /assignment_contract/signature_batch
MÉTODO POST

```json title='Request Body'
{
    "assignment_contract_keys": ["assignment_contract_key", "assignment_contract_key"],
}
```

#### Body Params

| Field | Type | Description | Characters |
|-|-|-|-|
| `assignment_contract_keys` * | array | List of contracts to be sent in the same batch | -- |

*Required fields

### Response

STATUS 202

---

# Contract Cancellation

---

At any stage, except in the case of an already signed contract, it's possible to cancel it. If it's in signature, the signature event is also canceled

### Request

ENDPOINT /assignment_contract/assignment_contract/ASSIGNMENT_CONTRACT_KEY
MÉTODO PUT

```json title='Request Body'
{
    "status": "canceled"
}
```

#### Body Params

| Field | Type | Description | Characters |
|-|-|-|-|
| `status` * | string | canceled | -- |

*Required fields

### Response

STATUS 202

---

# Contrato de Cessão

URL: /en/documentation/iaas/homologacao_cedente/contrato_de_cessao/pedido_de_contrato

---

Esse processo gera um contrato de cessão entre o Fundo de Investimento e o Cedente e o envia para a assinatura.

### Request

ENDPOINT /assignment_contract/assignment_contract
METHOD POST

```json title='Request Body'
{
    "fund_class_key": "813ce253-bae5-4448-8d15-04c48d9991b7",
    "assignor_registry_key": "3b5fa168-9ad3-4fd6-b972-e7fb90fab478",
    "assignment_contract_template_key": "2555f90a-4c6a-4d65-8bda-5d16f827840c"
}
```

#### Body Params

| Campo | Tipo | Descrição | Caracteres |
|-|-|-|-|
| `fund_class_key` * | string | Chave única de identificação do Fundo. Gerada na criação do Fundo e fornecida pelo time da QI CTVM. | chave uuid |
| `assignment_contract_template_key` * | string | Chave única de identificação do Template de Contrato. Também fornecida pelo time da QI CTVM. | chave uuid |
| `assignor_registry_key` * | string | Chave única de identificação do Cedente. Obtida no momento do cadastro. | chave uuid |

### Response

STATUS 201

```json title='Response Body'
{
    "assignment_contract_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "assignment_contract_status": "pending_document",
    "products": [
        {
            "product_key": "57efbd9f-0917-4c79-9a43-bc8f1039fc78",
            "asset_type": "ccb",
            "status": "pending_contract",
            "required_documents": [
                "ccb"
            ]
        }
    ]
}
```

---

# Recuperação do Contrato

URL: /en/documentation/iaas/homologacao_cedente/contrato_de_cessao/recuperacao_de_contrato

---

## Recuperação do Contrato

### Request

ENDPOINT /assignment_contract/assignment_contract/ASSIGNMENT_CONTRACT_KEY
METHOD GET

### Response

STATUS 200

```json title='Response Body'
{
    "assignment_contract_key": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
    "fund_class": {
        "name": "Fundo Sample 1",
        "fund_class_key": "26404d8c-28fc-4ee0-9de4-938753fe5bae",
        "document_number": "77.993.885/0001-00"
    },
    "assignor": {
        "assignor_key": "d9e2359c-1578-42e6-967f-cb3e58d711ff",
        "document_number": "57.116.082/0001-51",
        "name": "George o Cedente"
    },
    "status": "signed",
    "creation_datetime": "2023-07-03T23:43:09Z",
    "products": [
        {
            "product_key": "57efbd9f-0917-4c79-9a43-bc8f1039fc78",
            "asset_type": "ccb",
            "status": "pending_contract",
            "required_documents": [
                "ccb"
            ]
        }
    ]
}
```

---

# Webhooks do Contrato

URL: /en/documentation/iaas/homologacao_cedente/contrato_de_cessao/webhooks_contrato

---

#### Contrato Enviado para Assinatura

STATUS Pending Signature

```json title='Webhook Body'
{
    "assignment_contract_key": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
    "status": "pending_signature"
}
```

#### Assinado

STATUS Signed

```json title='Webhook Body'
{
    "assignment_contract_key": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
    "status": "signed"
}
```

---

# Introdução

URL: /en/documentation/iaas/homologacao_cedente/inicio

A parte de cadastro de Cedente é essencial para o início da operação de qualquer fundo que compre direitos creditórios. Nessa seção iremos explicar todo o fluxo, desde o envio das primeiras informações, até a abertura da Esteira de Cessão para envio de Ativos.

Para ter acesso aos serviços discutidos nas próximas sessões, entre em contato com o time [integracao.dtvm@qitech.com.br](mailto:integracao.dtvm@qitech.com.br), para que seja feito as devidas liberações, tanto em ambiente de Homologação (Sandbox) quanto em ambiente de produção.

É importante mencionar que para a efetiva liberação de um Cedente, deve-se consumir dois diferentes sistemas:

1. O cadastro do Cedente em nossa base, realizado uma única vez;

2. Formalização de um Contrato de Cessão, entre o Cedente e o Fundo;

### Cadastro do Cedente

Nessa etapa, deve-se enviar todas as informações tanto do Cedente quanto dos seus representantes. Uma vez feito o envio, o Cedente nasce Pendente Registro, é gerada uma primeira análise e deve-se enviar a documentação necessária nessa Análise para garantirmos a validade do Cadastro. Por fim, após anexar todos os documentos necessários deve-se comandar o disparo da Análise, ou seja, o envio da Análise para validação.

Assim que esta primeira Análise for aprovada, o cadastro do Cedente é efetivado e ele recebe o status Registrado, estando disponível para as próximas operações. Nesse momento, caso configurado, enviamos um Webhook notificando que a Análise foi aprovada.

### Atualização de Cedente

Em caso de necessidade de atualização cadastral, deve-se enviar novamente todas as informações do Cedente com as modificações desejadas. Após envio, é gerada uma nova Análise em que é necessário anexar a documentação necessária para garantirmos a validade da atualização. Por fim, após anexar todos os documentos necessários deve-se comandar o disparo da Análise, ou seja, o envio da nova Análise para validação. 

Assim que esta nova Análise for aprovada, os novos dados cadastrais do Cedente são efetivamente alterados. Nesse momento, caso configurado, enviamos um Webhook notificando que a Análise foi aprovada. Note que, uma atualização cadastral de um Cedente não gera impedimento em realizar novas operações com ele.

### Formalização de Contrato de Cessão

Para formalizar a relação entre o Cedente e o Fundo, é necessário a assinatura de um Contrato de Cessão, que rege essa venda de ativos. Nós disponibilizamos uma API que viabiliza com que esse processo seja automático.

O processo involve o pedido de formalização, que irá disparar internamente a criação do contrato e envio para assinatura. Uma vez com o contrato assinado, os produtos ficam disponíveis para ativação. Assim o cliente escolhe qual produto quer ativar, e uma vez feito, o sistema começa a configurar a Esteira de Cessão. Ao terminar, o cliente captura através do Produto, a Assignment Configuration Key, identificador que será utilizado posteriormente no processo de venda de ativos.

---

# SFTP Integration

URL: /en/documentation/iaas/integracao_sftp/inicio

SFTP (Secure File Transfer Protocol) is the channel through which QI CTVM makes fund reports available for download . The available models, the column-by-column layout of each file, and downloadable examples are in the [DTVM Reports documentation](/documentation/iaas/relatorios_dtvm/).

For the integration, we recommend libraries and clients that implement the protocol, such as `paramiko` in Python, the command-line `sftp`, or any standard SFTP client.

:::info Access provisioning
To request access, contact [integracao.dtvm@qitech.com.br](mailto:integracao.dtvm@qitech.com.br). Access is granted first in the Sandbox environment and then in Production.
:::

## How authentication works

Access is authenticated with an **SSH public key** — there is no password. You generate the key pair, keep the private key under your control, and send us only the public key, which we register on your SFTP user.

| Who          | What they provide                                                       |
| ------------ | ----------------------------------------------------------------------- |
| **You**      | The public key (the `.pub` file), in OpenSSH format                     |
| **QI CTVM**  | `HOSTNAME`, `PORT` (22) and `USERNAME`, plus the host <em>fingerprint</em> |

:::danger Never send your private key
No QI Tech team will ever ask for your private key. If someone asks — by e-mail, by ticket, or through any other channel — it is not us. The 1Password sharing described in step 3 is for the **public** key (`sftp_qitech.pub`) only.

If the private key has already been sent to anyone or attached anywhere, treat it as compromised: generate a new pair and send us the new public key.
:::

## 1. Generating the key pair

Generate a pair **dedicated to SFTP**. Do not reuse the key that signs your JWT tokens: they are credentials for different systems, with different life cycles — rotating one would force rotating the other, and a leak on either side would affect both.

Replace `company-name` with your company's name — for example, `sftp-acme`. This text is only a comment inside the key, and it is there to help us identify it.

**Linux / macOS**

```bash
mkdir -p ~/.ssh && chmod 700 ~/.ssh
ssh-keygen -t ed25519 -C "sftp-company-name" -f ~/.ssh/sftp_qitech
```

**Windows (PowerShell)**

```powershell
New-Item -ItemType Directory -Force "$env:USERPROFILE\.ssh" | Out-Null
ssh-keygen -t ed25519 -C "sftp-company-name" -f "$env:USERPROFILE\.ssh\sftp_qitech"
```

**Windows (cmd)**

```batch
if not exist "%USERPROFILE%\.ssh" mkdir "%USERPROFILE%\.ssh"
ssh-keygen -t ed25519 -C "sftp-company-name" -f "%USERPROFILE%\.ssh\sftp_qitech"
```

**Windows (WSL)**

```bash
mkdir -p ~/.ssh && chmod 700 ~/.ssh
ssh-keygen -t ed25519 -C "sftp-company-name" -f ~/.ssh/sftp_qitech
```

Inside WSL, use the Linux path (`~/.ssh`). The key is stored in the WSL file system, not in the Windows user folder.

:::caution Copy the command from the matching tab
Each tab writes the folder path the way that particular program understands it, so the commands are not interchangeable. If you run the command from one tab in a different program, you get `No such file or directory` and no key is created — just go back and copy the command from the right tab.

On Windows, if you are not sure which one to use, use **PowerShell**: it is what Windows Terminal opens by default.
:::

The command asks for a passphrase and generates two files:

| File               | What it is                                            |
| ------------------ | ----------------------------------------------------- |
| `sftp_qitech`      | **Private key.** Never send it, never share it.       |
| `sftp_qitech.pub`  | **Public key.** This is the one you must send us.     |

About the passphrase :

- **Automated integration** (a service of yours downloading the reports): leave it empty, pressing Enter at both prompts, and protect the private key wherever it is stored, in a secrets manager with restricted access. A passphrase that has to be available to the process at run time adds no real protection.
- **Use by a person**: set a passphrase .

`ssh-keygen` already creates the private key with permissions restricted to your user. If you copy the file to another machine, restore the permissions — SSH clients refuse private keys that are readable by other users:

```bash
chmod 600 ~/.ssh/sftp_qitech
```

## 2. Checking the public key format

The content of the `.pub` file is **a single line**, starting with the key type and ending with the comment:

```
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE1wA3uBEFYG+Yi7zIw7/YUJJ4fBB0MUZsvUVaqyyv6M sftp-acme
```

Check the file before sending it to us:

```bash
ssh-keygen -lf ~/.ssh/sftp_qitech.pub
```

The expected response is the key fingerprint , in the format `256 SHA256:... sftp-acme (ED25519)`. If the command answers `is not a public key file`, the file is corrupted or is not an OpenSSH public key.

### If your key is in PEM/X.509 format

A key that starts with `-----BEGIN PUBLIC KEY-----` is in PEM/X.509 format, the OpenSSL standard. That format **cannot be registered on the SFTP**: the server expects the OpenSSH format, on a single line.

If that key is already dedicated to SFTP, you do not need to generate another one — just convert it:

- **You still have the matching private key.** Works for any key type:

  ```bash
  ssh-keygen -y -f path/to/private_key
  ```

- **You only have the public key in PEM.** Works for RSA keys:

  ```bash
  ssh-keygen -i -m PKCS8 -f path/to/public_key.pem
  ```

Both commands print the key in OpenSSH format to standard output. The conversion does not preserve the original comment; if you want, append `sftp-company-name` to the end of the line.

## 3. Sending the public key

Send the public key through **1Password**, sharing the item with the integration team. This is the channel we use to receive keys: it preserves the content exactly as you generated it and keeps the origin of the delivery verifiable — anyone able to replace your public key along the way would gain access to your SFTP directory.

1. In 1Password, create an item and paste the content of the `sftp_qitech.pub` file into it **as plain text, on a single line, with no line breaks**.
2. Add the key fingerprint — the output of the `ssh-keygen -lf` from the previous step. We compare it with the fingerprint of the key we received and confirm it was not altered along the way.
3. Share the item with the integration team and let us know at [integracao.dtvm@qitech.com.br](mailto:integracao.dtvm@qitech.com.br) that the item has been shared.

:::caution Do not attach the key in `.docx` or `.pdf`
The automatic formatting of those programs replaces characters (a `+` with an em dash, straight quotes with typographic ones) and inserts line breaks. Any of those changes invalidates the key, and the error only shows up at connection time.
:::

Once the public key is registered, we confirm the release and send you the `HOSTNAME`, the `USERNAME`, and the host fingerprint .

## 4. Connecting to the SFTP

### Check the host key on the first connection

On the first connection, your client will ask whether you trust the server. Do not accept it without checking: compare the fingerprint shown with the one the integration team sent. That comparison is what prevents another server from impersonating ours.

```bash
ssh-keyscan -t ed25519 <hostname> > qitech_host_key
ssh-keygen -lf qitech_host_key          # compare with the fingerprint sent by QI CTVM
cat qitech_host_key >> ~/.ssh/known_hosts
```

Once checked, `known_hosts` becomes the client's reference, and connections presenting a different host key are refused automatically.

### Connection credentials

| Credential        | Source                                     |
| ----------------- | ------------------------------------------ |
| `HOSTNAME`        | Server address, provided by QI CTVM        |
| `PORT`            | 22                                         |
| `USERNAME`        | User, provided by QI CTVM                  |
| **Private key**   | The `sftp_qitech` file you generated       |

:::caution Warning
These credentials provide direct access to your fund's reports and should not be shared.
:::

### Code example

**Python**

```python
import paramiko

HOSTNAME = "sftp.example.com"             # provided by QI CTVM
PORT = 22
USERNAME = "username"                     # provided by QI CTVM
PRIVATE_KEY = "/path/to/sftp_qitech"      # the private key you generated
KNOWN_HOSTS = "/path/to/known_hosts"      # with the QI CTVM host key already checked

client = paramiko.SSHClient()
client.load_host_keys(KNOWN_HOSTS)

# Refuses the connection if the host key is not the expected one.
# Do not use AutoAddPolicy: it accepts any server with no verification.
client.set_missing_host_key_policy(paramiko.RejectPolicy())

client.connect(
    hostname=HOSTNAME,
    port=PORT,
    username=USERNAME,
    key_filename=PRIVATE_KEY,  # paramiko identifies the key type from the file
    look_for_keys=False,
    allow_agent=False,
    timeout=30,
)

try:
    with client.open_sftp() as sftp:
        # Lists the available files
        for name in sftp.listdir("/"):
            print(name)

        # Downloads a file
        sftp.get("remote/path/file.csv", "local/path/file.csv")
finally:
    client.close()
```

## 5. Downloading the files

Files are named from the fund short name , the report model and the reference date in YYYY-MM-DD format:

- `example_name_assets_wallet_composition_2026-07-29.csv`

The available models, the column-by-column layout of each file, and downloadable examples are in the [DTVM Reports documentation](/documentation/iaas/relatorios_dtvm/).

:::info Information
The SFTP service provided is exclusively for downloading files; upload is not permitted.
:::

## Key rotation and revocation

To replace the key, generate a new pair and send us the new public key through 1Password, following steps 1 to 3. We register the new key and let you know when the previous one has been removed, so the switch happens with no downtime window.

If you suspect the private key has been compromised, notify the integration team at the same contact: we revoke the old key's access immediately, before registering the new one.

---

# Recebimento de Webhooks

URL: /en/documentation/iaas/introducao/autenticacao_webhooks

A assinatura dos Webhooks utilizam-se de uma estratégia de criptografia com chaves simétricas, ou seja, tanto a QI CTVM quanto o Parceiro integrador compartilham de uma mesma chave. Ao realizarmos uma configuração de Webhooks, iremos gerar uma Signature Key e disponibiliza-lá. Toda requisição originada no sistema da QI, irá carregar um header SIGNATURE que será um JWT assinado com essa chave. O encoding é realizado com o algoritmo HS256.

Abaixo temos um exemplo em python de como realizar o decoding da assinatura:
```python
from jose import jwt

signature_key = "CHAVE UNICA DISPONIBILIZADA PELO TIME QI"

signature_token = headers["SIGNATURE"]

decoded_token = jwt.decode(signature_token, key=signature_key, algorithms=["HS256"])
print(decoded_token)
```

Sugerimos que, além de comparar a assinatura, o parceiro integrador valide o nosso IP, dado que todas as nossas requisições são originadas de um mesmo IP, conforme o ambiente:

Ambiente|IP
|---|---|
Produção|54.205.166.229
Sandbox|52.72.221.4

---

# Introdução

URL: /en/documentation/iaas/introducao/inicio

A QI CTVM é uma instituição financeira que presta os serviços de Administração e Custódia de Fundos de Investimento. Nós temos uma série de serviços, utilizando REST APIs que viabilizam uma nova experiência em toda a operação, visando facilidades, automações e uma total transparência para os envolvidos.

Essa documentação tem como objetivo descrever os fluxos, endpoints e estruturas de dados necessárias para operar quaisquer Fundos de Investimentos.

Obs.: Em caso de dúvidas em qualquer etapa do processo favor entre em contato com [integracao.dtvm@qitech.com.br](mailto:integracao.dtvm@qitech.com.br) detalhando seu problema/dúvida que te auxiliaremos.

## Perfis de Acesso

No nosso sistema nós reconhecemos o usuário pelo perfil que ele assume dentro da estrutura da QI CTVM. Possuímos 4 principais perfis:
1. Gestores;
2. Originadores;
3. Cedentes;
4. Investidores;

Cada um desses perfis possui um Endpoint específico para a sua integração, com as devidas rotas disponibilizadas;

Para criarmos um Perfil de Acesso para utilização das nossas APIs é necessário que se entre em contato com nosso time através do e-mail [integracao.dtvm@qitech.com.br](mailto:integracao.dtvm@qitech.com.br).

## Ambientes (Hosts)

A QI CTVM possui dois ambientes, SANDBOX e PRODUÇÃO. Ambos os ambientes possuem código e comportamento completamente idênticos, porém, o ambiente de SANDBOX apresenta valores monetários totalmente fictícios, e o ambiente de Produção realiza transações financeiras válidas.

O ambiente Sandbox foi criado para os desenvolvedores realizarem suas integrações, e quando estiverem prontos para entrada em produção, atualizarem apenas as variáveis de ambiente com os parâmetros de Produção.

 Perfil        | Ambiente | Host                                           |
|--------------|----------|------------------------------------------------|  
 Gestores      | Sandbox  | https://manager-api.sandbox.qidtvm.com.br/     |     
 Originadores  | Sandbox  | https://originator-api.sandbox.qidtvm.com.br/  | 
 Cedentes      | Sandbox  | https://assignor-api.sandbox.qidtvm.com.br/    |
 Investidores  | Sandbox  | https://investor-api.sandbox.qidtvm.com.br/    |
 Gestores      | Produção | https://manager-api.qidtvm.com.br/             | 
 Cedentes      | Produção | https://assignor-api.qidtvm.com.br/            |
 Originadores  | Produção | https://originator-api.qidtvm.com.br/          |
 Investidores  | Produção | https://investor-api.qidtvm.com.br/            |

---

# Endpoints Package

URL: /en/documentation/iaas/introducao/pacote_endpoints

To facilitate the integration experience with the QI Tech ecosystem, we provide a complete package containing all possible endpoints, already organized in a folder structure.

Our goal is to make the integration process more agile, clear and standardized — reducing initial effort and ensuring that you have immediate access to all necessary resources during implementation.

This package centralizes:

- The complete list of available endpoints for each product;

- Structure organized by themes, following the documentation;

A single point of reference, avoiding fragmented queries or loss of important information.

By providing this folder, we seek to ensure that integrator partners have a simpler, faster and more structured path to start their implementations with QI Tech, reinforcing our commitment to clarity, security and technical efficiency.

### [📦 Download complete Python package](/downloads/integracao_python_iaas.zip)

---

# Endpoints de teste

URL: /en/documentation/iaas/introducao/teste_de_autenticacao/endpoints_de_teste

## Método GET

### Request

ENDPOINT /authentication_test
MÉTODO GET

### Response

STATUS 200

Response Body

```json
{
  "success": "Congrats!"
}
```

## Metodo POST

### Request

ENDPOINT /authentication_test
MÉTODO POST

Request Body

```json
{
  "name": "QI Tech"
}
```

### Response

STATUS 200

Response Body

```json
{
  "name": "QI Tech",
  "success": "Congrats!"
}

```

---

# Teste de autenticação

URL: /en/documentation/iaas/introducao/teste_de_autenticacao/

### 1. Introdução

Nessa seção iremos explicar como deve funcionar a requisição para que possa ser aceita pelo nosso sistema. Em primeiro Lugar deve-se colocar no header API-CLIENT-KEY a Api Key fornecida pelo time da QI CTVM. Depois deve-se criar um Header de AUTHORIZATION assinando com a Chave Privada do parceiro integrador; 

Abaixo iremos ensinar o passo a passo utilizando de Python para exemplificar o processo de criação da AUTHORIZATION.

### 2. Importar bibliotecas
Neste exemplo em python estamos usando 5 bibliotecas para poder realizar o processo de autenticação.

```python
from datetime import datetime
import json
from jose import jwt
from hashlib import md5
import requests
```

### 3. Inserir a chave privada e a chave de integração
```python title="Dados da criptografia"
api_key = "\<API KEY FORNECIDA PELA QI\>"

client_private_key = '''-----BEGIN EC PRIVATE KEY-----
MIHbAgEBBEH7OuewosJfz4zKF+Gm0ogJxhb8G6LSMDVQQbFYz335mHCx9/Pr6Yk+
yYwsVozeXhlry3/vnUn1zCasU+4O+yseZ6AHBgUrgQQAI6GBiQOBhgAEAa46fN/2
8vI64shRhu9erMA6JLl3zHFX8gFHQrbb0g4IDfjXCKMCILiwdtL8QecstsgepTa7
yo1pTXOVNDbmLX2TAK38xb2Gv6OC+PA+5drF2wWajWbVLpR2R7mYEzr5HNIAJYHb
5C1jvM2ItK2R22HAbYfH25nsvGhkCGbrRNWQVF9g
-----END EC PRIVATE KEY-----'''

```

### 4. Definir variáveis
Definir as variáveis método, endpoint e conteúdo particular a cada requisição (neste exemplo, utilizaremos o método "POST" para o endpoint "/authentication_test")
```python title="Dados da requisição"
base_url = "https://assignor-api.qidtvm.com.br"
today_str = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S")
method = "POST"
endpoint = "/authentication_test"
body = {"name": "QI Tech"}
```

### 5. Construir Dicionário Base de Assinatura
```python title="Dicionário base"

dict_to_sign = {"timestamp": today_str, "method": method, "uri": endpoint}

```

#### 5.1. Se necessário, adicionar o conteúdo
Para as requisições que tenham _body_, deve-se adicionar o md5 do bytes desse conteúdo. Como todas as requisições no nosso sistema são através de JSON, pode-se usar o seguinte:

```python title="Dicionário base"
body_bytes = json.dumps(body).encode()

md5_instance = md5()
md5_instance.update(body_bytes)
md5_body = md5_instance.hexdigest()

dict_to_sign["payload_md5"] = md5_body
```

### 6. Realizar criptografia do header
Realizar criptografia utilizando biblioteca JWT (neste exemplo de código, utilizamos jsonwebtoken como jwt em javascript)

```python
jwt_headers = {"alg": "ES512", "typ": "JWT"}
encoded_header_token = jwt.encode(
    claims=dict_to_sign,
    key=client_private_key,
    algorithm="ES512",
    headers=jwt_headers,
)
```

### 7. Montando o header final

```python
headers = {"API-CLIENT-KEY": api_key, "AUTHORIZATION": encoded_header_token}
```

```python title="Definindo url final"
url = f"{base_url}{endpoint}"
```

### Realizando requisição

```python
resp = requests.post(url=url, headers=headers, json=body)
print(resp.json())
```

---

# Troca de Chaves

URL: /en/documentation/iaas/introducao/troca_de_chaves

## 1. Requisição Assinada

Todas as requisições em nossas APIs devem usar o protocolo **HTTPs**, utilizando **TLS 1.2 ou 1.3**, contendo dois Headers:

1. API-CLIENT-KEY: Uma chave disponibilizada pelo nosso time de Integração que identifica uma integração específica;
2. AUTHORIZATION: Uma assinatura da requisição que deve ser realizada conforme explicado nesse manual;

Como padrão a QI CTVM utiliza-se do padrão de chaves assimétricas, onde existem duas chaves diferentes, uma para assinatura, denominada chave privada , e uma para leitura, denominada de chave pública . Com a chave privada, o parceiro integrador deverá realizar a assinatura utilizando-se do padrão JWT.
O parceiro integrador é responsável por gerar o par e fornecer ao time da QI CTVM a chave pública para que possamos validar as suas requisições.

:::caution **Atenção**
 A chave privada é de uso exclusivo do parceiro integrador, e deve ser armazenada com segurança. A QI CTVM nunca irá pedir, em hipótese alguma, que voce a compartilhe conosco.
:::
## 2. Gerando o par

Para gerar uma chave privada em um computador UNIX faça:

```bash
$ ssh-keygen -t ecdsa -b 521 -m PEM -f private.key
```

E a partir desta chave privada gere sua chave pública.

```bash
$ openssl ec -in private.key -pubout -outform PEM -out public.key.pub
```

A chave pública gerada (arquivo public.key.pub) deve ser enviada para o time da QI Tech, e aguardar a integração ser configurada;

---

# Início

URL: /en/documentation/iaas/investidor/cadastro_investidor/inicio

Esta seção descreve o processo geral de **cadastro de investidores** na plataforma QI Tech. O cadastro é o passo inicial obrigatório antes que qualquer investidor possa participar de uma oferta, subscrever cotas ou movimentar recursos. Ao final do fluxo, a QI Tech executa uma **análise cadastral** que valida os dados, documentos e enquadramento do investidor frente às exigências regulatórias.

### Como o cadastro está estruturado

O cadastro de investidor é dividido em quatro fluxos, organizados de acordo com o tipo de investidor e o canal pelo qual ele será integrado. Cada fluxo é descrito em detalhes em sua respectiva subseção.

Carteira Administrada
carteiras geridas profissionalmente em nome de um titular econômico (investor owner) `investor-integration`
Fundo de Investimento
veículos com CNPJ próprio (FIMs, FIAs, FIDCs e demais classes) que aplicam recursos em nome de seus cotistas `investor-integration`
Distribuição Externa
investidores cadastrados por conta e ordem por meio de distribuidores parceiros `distributor-integration`
Cadastrar como Gestor / Consultor
gestores (`manager-integration`) e consultores (`consultant-integration`) fazem o cadastro de seus cotistas

### Conceitos comuns a todos os fluxos

Apesar das particularidades de cada tipo, todos os fluxos compartilham um conjunto de conceitos e recursos:

- **Investor / Investor Analysis** — cada investidor possui um identificador único (`investor_key`) e, a cada ciclo de cadastro, uma nova análise cadastral (`investor_analysis_key`). É a análise que recebe os dados, documentos e o resultado final da validação.
- **Feedbacks** — durante e após a análise, a QI Tech pode solicitar correções ou complementos por meio de feedbacks, que ficam disponíveis na própria análise cadastral.
- **Etapas cadastrais** — os fluxos cadastrais seguem linearmente os seguintes passos:
  - Criação do investidor (primeiro cadastro) ou análise (atualização) - **Cliente**;
  - Envio de dados cadastrais e documentos necessários - **Cliente**;
  - Envio do cadastro para análise - **Cliente**;
  - Aprovação do cadastro ou retorno para preenchimento com feedbacks - **QI Tech**;
  - Assinatura de documentos - **Cliente**.

Uma vez que o cliente assinar os documentos enviados após a análise, o investidor estará apto a interagir com o resto do sistema, como geração de termos de adesão, boletins de subscrição e boletagem de aportes.

---

# atualizacao_cadastral

URL: /en/documentation/iaas/investidor/cadastro/atualizacao_cadastral



---

# atualizar_status_grupo_assinantes

URL: /en/documentation/iaas/investidor/cadastro/atualizar_status_grupo_assinantes



---

# busca_informacoes_de_uma_analise_cadastral_do_investidor

URL: /en/documentation/iaas/investidor/cadastro/busca_informacoes_de_uma_analise_cadastral_do_investidor



---

# busca_informacoes_do_investidor

URL: /en/documentation/iaas/investidor/cadastro/busca_informacoes_do_investidor



---

# buscar_documentos_para_assinatura

URL: /en/documentation/iaas/investidor/cadastro/buscar_documentos_para_assinatura



---

# Query paginated investor data

URL: /en/documentation/iaas/investidor/cadastro/buscar_investidores_paginado

---

### Introduction
This resource allows listing investors applying optional filters (document, status and name), with pagination.

### Input / Output

There is no request body. Filters are passed via *query string*, all optional.

As ***output***, the list of investors matching the provided filters is returned.

### Request

ENDPOINT `/investor_registry/investors`
METHOD `GET`
STATUS `200`

### Query Params

All parameters are **optional**.

| Param             | Type   | Default | Description                                                     |
|-------------------|--------|:-------:|-----------------------------------------------------------------|
| `document_number` | string | `None`  | Filter by complete document                                     |
| `status`          | string | `None`  | Filter by status                                                |
| `name`            | string | `None`  | Filter by name                                                  |
| `limit`           | int    | `100`   | Items per page (min `0`, max `500`)                             |
| `page`            | int    | `0`     | Page; the offset is calculated as `page * limit`                |

### Response

```json title='Response Body'
{
    "data": [
        {
            "name": "investidor 1",
            "status": "approved",
            "person_type": "natural_person",
            "investor_key": "UUID v4",
            "email": "investidor1@exemplo.com",
            "phone": "11999990001",
            "distributor": {
                "distributor_key": "UUID v4",
                "name": "Distribuidora XYZ",
                "document_number": "00000000000191",
                "registry_configuration": {}
            }
        },
        {
            "name": "investidor 2",
            "status": "pending",
            "person_type": "natural_person",
            "investor_key": "UUID v4",
            "email": "investidor2@exemplo.com",
            "phone": "11999990002",
            "distributor": {
                "distributor_key": "UUID v4",
                "name": "Distribuidora XYZ",
                "document_number": "00000000000191",
                "registry_configuration": {}
            }
        }
    ],
    "limit": 50,
    "page": 0,
    "is_last_page": true
}
```

### Response Params

| Field          | Type    | Description                                                        |
|----------------|---------|--------------------------------------------------------------------|
| `data`         | array   | List of **[Investor](#investor)** objects                          |
| `limit`        | int     | Number of items per page used in the query                         |
| `page`         | int     | Returned page                                                      |
| `is_last_page` | boolean | Indicates whether this is the last page of results                 |

### Investor {#investor}

| Field           | Type   | Description                                        |
|-----------------|--------|----------------------------------------------------|
| `investor_key`  | string | Investor's unique identification key               |
| `name`          | string | Investor's name (or company name)                  |
| `status`        | string | Investor's current status                          |
| `person_type`   | string | Person type (`natural_person` or `legal_person`)   |
| `email`         | string | Investor's contact email                           |
| `phone`         | string | Investor's contact phone                           |
| `distributor`   | object | **Distributor** object                             |

### Distributor {#distributor}

| Field                    | Type   | Description                                      |
|--------------------------|--------|--------------------------------------------------|
| `distributor_key`        | string | Distributor's unique key                         |
| `name`                   | string | Distributor's name                               |
| `document_number`        | string | Distributor's CNPJ                               |
| `registry_configuration` | object | Distributor's registry configuration             |

---

# consultar_analise_em_andamento

URL: /en/documentation/iaas/investidor/cadastro/consultar_analise_em_andamento



---

# atualizar_status_conta_bancaria

URL: /en/documentation/iaas/investidor/cadastro/contas_bancarias/atualizar_status_conta_bancaria



---

# definir_conta_principal

URL: /en/documentation/iaas/investidor/cadastro/contas_bancarias/definir_conta_principal



---

# enviar_contas_bancarias

URL: /en/documentation/iaas/investidor/cadastro/contas_bancarias/enviar_contas_bancarias



---

# Create investor / investor analysis

URL: /en/documentation/iaas/investidor/cadastro/criar_investidor

---

### Introduction
This resource aims to inform us of basic data to start the **registry analysis** of an investor. 
There are 2 types of **registry analysis**: **natural person** and **legal person**. Legal persons, in turn, have ***sub types***, which are used to distinguish the necessary information during registration.

:::info Information
In the Sandbox environment, we have the following rule for approvals: CPF/CNPJ starting with 1: Automatic rejection; CPF/CNPJ starting with 8: Pending Manual Validation; The rest are automatically approved. 
:::

### Registration Flow

Legal person investor registration follows these steps:

1. **Create Investor** - Initial investor creation and registry analysis
2. **Send Registry Data** - Specific legal person data
3. **Send Address** - Address information
4. **Send Assets** - Net worth data
5. **Send Bank Accounts** - Bank account information
6. **Send Suitability** - Suitability questionnaire (mandatory for retail investors)
7. **Send Subscriber Groups** - Definition of subscriber groups
8. **Send Investor Documents** - Upload of mandatory documents
9. **Create Related Parties** - Registration of partners, directors, administrators, etc.
10. **Send Related Parties Documents** - Upload of related parties documents
11. **Send for Analysis** - Submission for registry analysis
12. **Sign Documents** - Document signing after approval

### Input / Output:
Each type of **registry analysis** expects a set of data as ***input***. Below are examples of how to initiate each of these flows.

As ***output***, an ***investor_key*** and an ***investor_analysis_key*** will be delivered. The ***investor_analysis_key*** is used to identify the created **registry analysis**.
The ***investor_key*** is used to identify the **investor** to which the **registry analysis** belongs.

Thus, a single ***investor_key*** (investor) can be associated with one or more ***investor_analysis_key*** (registry analysis).

Both the ***investor_key*** and the ***investor_analysis_key*** will be used in other endpoints that interact with the **investor** or with the **registry analysis**.

### Request

ENDPOINT `/investor_registry/v2/investor`
METHOD `POST`
STATUS `201`

### Request body
```json title='Request Body'
{
    "name": "string",
    "document_number": "xx.xxx.xxx/xxxx-xx",
    "person_type": "legal_person | natural_person",
    "person_sub_type": "regular | fund_class",
    "external_distribution_key": "campo livre",
    "email": "string",
    "phone": {
	    "international_dial_code": "+xx",
	    "area_code": "xx",
	    "number": "xxxxxxxxxx"
    }
}

```

:::warning Attention
Required fields change according to **person_type**.

- If **natural_person** (natural person):
    - The fields **name**, **document_number**, **person_type**, **email** and **phone** are mandatory

- If **legal_person** (legal person):
    - The fields **name**, **document_number**, **person_type**

- If **nominee** (PCO):
    - The fields **name**, **person_type**, **external_distribution_key** are mandatory

:::

:::info Information
The **registry_user** is the entity that represents the user who will fill in the investor's registry data.
In the case of **natural person**, the investor themselves fills in their registry data.
:::

Case 02: Register Legal Person

```json title='Request Body'
{
  "name": "Fundo XPTO", 
  "document_number": "12.456.789/0001-00", 
  "person_type": "legal_person",
  "person_sub_type": "regular",
  "registry_user": {
    "name": "José da Silva", 
    "document_number": "123.456.789-00",
    "email": "example@example.com",
    "phone": {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "1234567890"
    },
  }
}
```

### Body params
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `name`                            | string   | Investor name                                                                |   1  - 255   |    Yes      |
| `document_number`                 | string   | CPF or CNPJ                                                                  |   13 - 18    |    Yes      |
| `person_type`                     | string   | **[Person Type](#person_type)** enumerator                                  |      -       |    Yes      |
| `person_sub_type`                 | string   | **[Person Sub Type](#person_sub_type)** enumerator                          |      -       |    Yes      |
| `email`                           | string   | Email                                                                        |   1  - 255   |    No       |
| `phone`                           | JSON     | **[Phone](#phone)** object                                                   |      -       |    No       |
| `registry_user`                   | JSON     | **[Registry User](#registry_user)** object                                  |      -       |    No       |

### Phone
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `international_dial_code`         | string   | International code                                                           |   1  - 3     |    Yes      |
| `area_code`                       | string   | Area code                                                                    |      2       |    Yes      |
| `number`                          | string   | Phone number                                                                 |   8  - 9     |    Yes      |

### Registry User
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `name`                            | string   | Registry user name                                                           |   1  - 255   |    Yes      |
| `document_number`                 | string   | CPF                                                                          |   13    |    Yes      |
| `person_type`                     | string   | **[Person Type](#person_type)** enumerator                                  |      -       |    Yes      |
| `email`                           | string   | Email                                                                        |   1  - 255   |    Yes      |
| `phone`                           | JSON     | **[Phone](#phone)** object                                                   |      -       |    Yes      |

### Person Type
| Enumerator                        | Description                                                                  |
|-----------------------------------|------------------------------------------------------------------------------|
| `natural_person`                  | Natural person                                                               |
| `legal_person`                    | Legal person                                                                 |

### Person Sub Type
| Enumerator                        | Description                                                                  |
|-----------------------------------|------------------------------------------------------------------------------|
| `regular`                         | -                                                                            |
| `fund_class`                      | Investment fund                                                              |

### Response
```json title='Response Body'
{
    "investor_key": "UUID",
    "investor_analysis_key": "UUID"
}
```

---

# definir_grupo_assinantes_padrao

URL: /en/documentation/iaas/investidor/cadastro/definir_grupo_assinantes_padrao



---

# enviar_cadastro_para_analise

URL: /en/documentation/iaas/investidor/cadastro/enviar_cadastro_para_analise



---

# enviar_dados_cadastrais

URL: /en/documentation/iaas/investidor/cadastro/enviar_dados_cadastrais



---

# enviar_endereco

URL: /en/documentation/iaas/investidor/cadastro/enviar_endereco



---

# enviar_grupos_assinantes

URL: /en/documentation/iaas/investidor/cadastro/enviar_grupos_assinantes



---

# enviar_investor_document

URL: /en/documentation/iaas/investidor/cadastro/enviar_investor_document



---

# enviar_patrimonio

URL: /en/documentation/iaas/investidor/cadastro/enviar_patrimonio



---

# consultar_feedback

URL: /en/documentation/iaas/investidor/cadastro/feedback/consultar_feedback



---

# enviar_mensagem_feedback

URL: /en/documentation/iaas/investidor/cadastro/feedback/enviar_mensagem_feedback



---

# listar_feedbacks

URL: /en/documentation/iaas/investidor/cadastro/feedback/listar_feedbacks



---

# Introdução

URL: /en/documentation/iaas/investidor/cadastro/introducao

Esta seção reúne os fluxos de cadastro de investidores que não se enquadram nas categorias específicas — **Carteira Administrada**, **Fundo de Investimento** ou **Distribuição Externa** —, cobrindo pessoas físicas e jurídicas em geral, como é o caso de um consultor (`consultant-integration`) ou gestor (`manager-integration`) estar cadastrando um investidor.

O cadastro contempla o envio de dados cadastrais, endereço, patrimônio, contas bancárias, suitability, grupos de assinantes, partes relacionadas e, quando aplicável, *investor owner*, até o disparo da análise cadastral pela QI Tech.

Importante ressaltar que nesses casos a assinatura é sempre executada exclusivamente pelo investidor ou representante legal identificado durante a análise.

### Fluxo de Cadastro

1. Criar Investidor
criação inicial do investidor e abertura da primeira análise cadastral
↓
2. Enviar Dados Cadastrais
dados específicos da pessoa física ou jurídica
↓
3. Enviar Endereço
informações de endereço
↓
4. Enviar Patrimônio
informações de patrimônio e enquadramento
↓
5. Enviar Contas Bancárias
contas para movimentação
↓
6. Enviar Suitability
questionário de adequação ao perfil (não exigido para fundos de investimento)
↓
7. Enviar Grupos de Assinantes
definição de quem deve assinar os documentos
↓
8. Enviar Documentos do Investidor
upload de documentos obrigatórios
↓
9. Criar Partes Relacionadas
sócios, diretores, beneficiários finais
↓
10. Enviar Documentos das Partes Relacionadas
documentos de cada parte relacionada
↓
11. Enviar para Análise
submissão da análise cadastral para validação
↓
12. Assinar Documentos
assinatura dos documentos gerados após aprovação

Nas subseções a seguir veremos cada uma das etapas necessárias para concluir esses cadastros.

---

# criar_parte_relacionada

URL: /en/documentation/iaas/investidor/cadastro/related_party/criar_parte_relacionada



---

# enviar_documento_parte_relacionada

URL: /en/documentation/iaas/investidor/cadastro/related_party/enviar_documento_parte_relacionada



---

# consultar_formulario_suitability

URL: /en/documentation/iaas/investidor/cadastro/suitability/consultar_formulario_suitability



---

# enviar_suitability

URL: /en/documentation/iaas/investidor/cadastro/suitability/enviar_suitability



---

# atualizacao_cadastral

URL: /en/documentation/iaas/investidor/carteira_administrada/atualizacao_cadastral



---

# atualizar_status_grupo_assinantes

URL: /en/documentation/iaas/investidor/carteira_administrada/atualizar_status_grupo_assinantes



---

# busca_informacoes_de_uma_analise_cadastral_do_investidor

URL: /en/documentation/iaas/investidor/carteira_administrada/busca_informacoes_de_uma_analise_cadastral_do_investidor



---

# busca_informacoes_do_investidor

URL: /en/documentation/iaas/investidor/carteira_administrada/busca_informacoes_do_investidor



---

# buscar_documentos_para_assinatura

URL: /en/documentation/iaas/investidor/carteira_administrada/buscar_documentos_para_assinatura



---

# consultar_analise_em_andamento

URL: /en/documentation/iaas/investidor/carteira_administrada/consultar_analise_em_andamento



---

# atualizar_status_conta_bancaria

URL: /en/documentation/iaas/investidor/carteira_administrada/contas_bancarias/atualizar_status_conta_bancaria



---

# definir_conta_principal

URL: /en/documentation/iaas/investidor/carteira_administrada/contas_bancarias/definir_conta_principal



---

# enviar_contas_bancarias

URL: /en/documentation/iaas/investidor/carteira_administrada/contas_bancarias/enviar_contas_bancarias



---

# Create investor / investor analysis

URL: /en/documentation/iaas/investidor/carteira_administrada/criar_investidor

---

### Introduction
This resource aims to inform us of basic data to start the **registry analysis** of an investor. 
There are 2 types of **registry analysis**: **natural person** and **legal person**. Legal persons, in turn, have ***sub types***, which are used to distinguish the necessary information during registration.

:::info Information
In the Sandbox environment, we have the following rule for approvals: CPF/CNPJ starting with 1: Automatic rejection; CPF/CNPJ starting with 8: Pending Manual Validation; The rest are automatically approved. 
:::

### Registration Flow

Legal person investor registration follows these steps:

1. **Create Investor** - Initial investor creation and registry analysis
2. **Send Registry Data** - Specific legal person data
3. **Send Address** - Address information
4. **Send Assets** - Net worth data
5. **Send Bank Accounts** - Bank account information
6. **Send Suitability** - Suitability questionnaire (mandatory for retail investors)
7. **Send Subscriber Groups** - Definition of subscriber groups
8. **Send Investor Documents** - Upload of mandatory documents
9. **Create Related Parties** - Registration of partners, directors, administrators, etc.
10. **Send Related Parties Documents** - Upload of related parties documents
11. **Send for Analysis** - Submission for registry analysis
12. **Sign Documents** - Document signing after approval

### Input / Output:
Each type of **registry analysis** expects a set of data as ***input***. Below are examples of how to initiate each of these flows.

As ***output***, an ***investor_key*** and an ***investor_analysis_key*** will be delivered. The ***investor_analysis_key*** is used to identify the created **registry analysis**.
The ***investor_key*** is used to identify the **investor** to which the **registry analysis** belongs.

Thus, a single ***investor_key*** (investor) can be associated with one or more ***investor_analysis_key*** (registry analysis).

Both the ***investor_key*** and the ***investor_analysis_key*** will be used in other endpoints that interact with the **investor** or with the **registry analysis**.

### Request

ENDPOINT `/investor_registry/v2/investor`
METHOD `POST`
STATUS `201`

### Request body
```json title='Request Body'
{
    "name": "string",
    "document_number": "xx.xxx.xxx/xxxx-xx",
    "person_type": "legal_person | natural_person",
    "person_sub_type": "regular | fund_class",
    "external_distribution_key": "campo livre",
    "email": "string",
    "phone": {
	    "international_dial_code": "+xx",
	    "area_code": "xx",
	    "number": "xxxxxxxxxx"
    }
}

```

:::warning Attention
Required fields change according to **person_type**.

- If **natural_person** (natural person):
    - The fields **name**, **document_number**, **person_type**, **email** and **phone** are mandatory

- If **legal_person** (legal person):
    - The fields **name**, **document_number**, **person_type**

- If **nominee** (PCO):
    - The fields **name**, **person_type**, **external_distribution_key** are mandatory

:::

:::info Information
The **registry_user** is the entity that represents the user who will fill in the investor's registry data.
In the case of **natural person**, the investor themselves fills in their registry data.
:::

Case 02: Register Legal Person

```json title='Request Body'
{
  "name": "Fundo XPTO", 
  "document_number": "12.456.789/0001-00", 
  "person_type": "legal_person",
  "person_sub_type": "regular",
  "registry_user": {
    "name": "José da Silva", 
    "document_number": "123.456.789-00",
    "email": "example@example.com",
    "phone": {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "1234567890"
    },
  }
}
```

### Body params
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `name`                            | string   | Investor name                                                                |   1  - 255   |    Yes      |
| `document_number`                 | string   | CPF or CNPJ                                                                  |   13 - 18    |    Yes      |
| `person_type`                     | string   | **[Person Type](#person_type)** enumerator                                  |      -       |    Yes      |
| `person_sub_type`                 | string   | **[Person Sub Type](#person_sub_type)** enumerator                          |      -       |    Yes      |
| `email`                           | string   | Email                                                                        |   1  - 255   |    No       |
| `phone`                           | JSON     | **[Phone](#phone)** object                                                   |      -       |    No       |
| `registry_user`                   | JSON     | **[Registry User](#registry_user)** object                                  |      -       |    No       |

### Phone
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `international_dial_code`         | string   | International code                                                           |   1  - 3     |    Yes      |
| `area_code`                       | string   | Area code                                                                    |      2       |    Yes      |
| `number`                          | string   | Phone number                                                                 |   8  - 9     |    Yes      |

### Registry User
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `name`                            | string   | Registry user name                                                           |   1  - 255   |    Yes      |
| `document_number`                 | string   | CPF                                                                          |   13    |    Yes      |
| `person_type`                     | string   | **[Person Type](#person_type)** enumerator                                  |      -       |    Yes      |
| `email`                           | string   | Email                                                                        |   1  - 255   |    Yes      |
| `phone`                           | JSON     | **[Phone](#phone)** object                                                   |      -       |    Yes      |

### Person Type
| Enumerator                        | Description                                                                  |
|-----------------------------------|------------------------------------------------------------------------------|
| `natural_person`                  | Natural person                                                               |
| `legal_person`                    | Legal person                                                                 |

### Person Sub Type
| Enumerator                        | Description                                                                  |
|-----------------------------------|------------------------------------------------------------------------------|
| `regular`                         | -                                                                            |
| `fund_class`                      | Investment fund                                                              |

### Response
```json title='Response Body'
{
    "investor_key": "UUID",
    "investor_analysis_key": "UUID"
}
```

---

# definir_grupo_assinantes_padrao

URL: /en/documentation/iaas/investidor/carteira_administrada/definir_grupo_assinantes_padrao



---

# enviar_cadastro_para_analise

URL: /en/documentation/iaas/investidor/carteira_administrada/enviar_cadastro_para_analise



---

# enviar_dados_cadastrais

URL: /en/documentation/iaas/investidor/carteira_administrada/enviar_dados_cadastrais



---

# enviar_endereco

URL: /en/documentation/iaas/investidor/carteira_administrada/enviar_endereco



---

# enviar_grupos_assinantes

URL: /en/documentation/iaas/investidor/carteira_administrada/enviar_grupos_assinantes



---

# enviar_investor_document

URL: /en/documentation/iaas/investidor/carteira_administrada/enviar_investor_document



---

# enviar_patrimonio

URL: /en/documentation/iaas/investidor/carteira_administrada/enviar_patrimonio



---

# consultar_feedback

URL: /en/documentation/iaas/investidor/carteira_administrada/feedback/consultar_feedback



---

# enviar_mensagem_feedback

URL: /en/documentation/iaas/investidor/carteira_administrada/feedback/enviar_mensagem_feedback



---

# listar_feedbacks

URL: /en/documentation/iaas/investidor/carteira_administrada/feedback/listar_feedbacks



---

# Introdução

URL: /en/documentation/iaas/investidor/carteira_administrada/introducao

Esta seção descreve o fluxo de cadastro de investidores do tipo **Carteira Administrada** — carteiras geridas profissionalmente em nome de um titular econômico (o *investor owner*).

Diferente do cadastro de uma pessoa física ou jurídica padrão, aqui o investidor é a própria carteira, e o cadastro precisa contemplar tanto os dados da carteira quanto os dados do titular que detém os recursos investidos por meio dela.

O tipo de integração utilizada para esse tipo de cadastro de investidor é a `investor-integration`, descrita na seção de introdução da documentação. Para cadastrar um investidor através de uma gestora de carteiras é necessário que o cadastro da gestora esteja atualizado, o que pode ser garantido e mantido através da mesma integração de investidor. Dessa forma, a gestora pode realizar sua atualização cadastral através da API de cadastro de investidores, bem como a manutenção de seus próprios investidores.

Um ponto muito importante é que apenas gestoras que estiverem com seus cadastros atualizados podem realizar o cadastro de investidores de carteira administrada. Portanto, é necessário realizar essa manutenção cadastral.

### Fluxo de Cadastro

1. Criar Investidor
criação inicial do investidor e abertura da primeira análise cadastral
↓
2. Enviar Dados Cadastrais
dados específicos da pessoa física ou jurídica
↓
3. Enviar Endereço
informações de endereço
↓
4. Enviar Patrimônio
informações de patrimônio e enquadramento
↓
5. Enviar Contas Bancárias
contas para movimentação
↓
6. Enviar Suitability
questionário de adequação ao perfil
↓
7. Enviar Grupos de Assinantes
definição de quem deve assinar os documentos
↓
8. Enviar Documentos do Investidor
upload de documentos obrigatórios
↓
9. Criar Partes Relacionadas
sócios, diretores, beneficiários finais
↓
10. Enviar Documentos das Partes Relacionadas
documentos de cada parte relacionada
↓
11. Enviar Contrato de Carteira Administrada
documento que atesta representação legal
↓
12. Enviar para Análise
submissão da análise cadastral para validação
↓
13. Assinar Documentos
assinatura dos documentos gerados após aprovação

Nas subseções a seguir veremos cada uma das etapas necessárias para concluir o cadastro de uma Carteira Administrada e disparar a análise cadastral pela QI Tech.

---

# enviar_documento_investor_owner

URL: /en/documentation/iaas/investidor/carteira_administrada/investor_owner/enviar_documento_investor_owner



---

# criar_parte_relacionada

URL: /en/documentation/iaas/investidor/carteira_administrada/related_party/criar_parte_relacionada



---

# enviar_documento_parte_relacionada

URL: /en/documentation/iaas/investidor/carteira_administrada/related_party/enviar_documento_parte_relacionada



---

# consultar_formulario_suitability

URL: /en/documentation/iaas/investidor/carteira_administrada/suitability/consultar_formulario_suitability



---

# enviar_suitability

URL: /en/documentation/iaas/investidor/carteira_administrada/suitability/enviar_suitability



---

# Assinar Documento

URL: /en/documentation/iaas/investidor/compartilhado/assinar_documento

---
### Introdução
Este recurso confirma a assinatura de um documento gerado para a formalização do cadastro do investidor via método **opt-in**. Os tipos suportados são: ficha cadastral (pessoa física ou jurídica), termo de investidor qualificado e termo de investidor profissional.

Diferente de **[Enviar Documento Assinado](/documentation/iaas/investidor/compartilhado/enviar_documento_assinado)** (que faz upload do arquivo final assinado), este recurso apenas registra a comprovação da assinatura por meio do hash de opt-in coletado pelo distribuidor.

:::warning Atenção
Este recurso está disponível apenas para integrações que atuam como **Distribuidor** com `document_signature` configurado como `opt-in`. O documento deve estar com status `generated`.
:::

### Input / Output

Como ***input*** envie o `opt_in_hash` que comprova a assinatura.

Como ***output***, quando a confirmação finaliza o lote, é retornada a chave `investor_document_key`.

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/investor_analysis/{investor_analysis_key}/document_batch/{document_batch_key}/document/{investor_document_key}/sign_document`
MÉTODO `PUT`
STATUS `200`

### Request body

```json title='Request Body'
{
  "opt_in_hash": "OPT_IN_HASH"
}
```

### Body params
| Campo         | Tipo   | Descrição                                  | Obrigatório |
|---------------|--------|--------------------------------------------|-------------|
| `opt_in_hash` | string | Hash de verificação da assinatura opt-in   |    Sim      |

:::warning Atenção
Durante o processo de integração será exigido um meio de autenticação da hash enviada.
:::

### Response
```json title='Response Body'
{
    "investor_document_key": "UUID"
}
```

---

# Atualização Cadastral

URL: /en/documentation/iaas/investidor/compartilhado/atualizacao_cadastral

---
### Introdução

Após o cadastro inicial de um investidor já ter sido aprovado, novos ciclos de cadastro podem ser abertos sempre que houver necessidade de **atualização cadastral** — seja por mudança de dados, vencimento de documentos ou solicitação de uma nova análise pela QI Tech.

Diferente do cadastro inicial, a atualização **não cria um novo investidor**: ela apenas abre uma nova **análise cadastral** (`investor_analysis`) sobre o investidor existente. A partir disso, o fluxo segue exatamente o mesmo do cadastro original: envio dos dados, documentos, partes relacionadas e submissão para análise.

### Input / Output

Como ***input*** não é necessário enviar nenhum corpo de requisição — basta informar a `investor_key` do investidor que terá sua análise atualizada.

Como ***output*** será retornada a representação da nova análise cadastral, contendo a `investor_analysis_key` que deve ser utilizada nas etapas seguintes do fluxo.

### Request

ENDPOINT `/investor_registry/v2/investor/{investor_key}/investor_analysis`
MÉTODO `POST`
STATUS `201`

:::info
A requisição é enviada **sem corpo** (`body` vazio). Os dados da atualização serão enviados nas etapas subsequentes do fluxo, da mesma forma que no cadastro inicial.
:::

### Próximos passos

A partir do retorno da `investor_analysis_key`, o processo de atualização cadastral segue **o mesmo fluxo do cadastro inicial** descrito nesta seção:

1. Envio dos dados cadastrais (pessoa física/jurídica, endereço, patrimônio).
2. Envio de contas bancárias, suitability, grupos de assinantes, partes relacionadas e documentos — conforme aplicável ao tipo de investidor.
3. Envio do cadastro para análise.
4. Assinatura dos documentos gerados após a aprovação.

Consulte as etapas subsequentes desta seção para os detalhes de cada recurso.

---

# Atualizar Status do Grupo de Assinantes

URL: /en/documentation/iaas/investidor/compartilhado/atualizar_status_grupo_assinantes

---
### Introdução
Este recurso altera o status de um grupo de assinantes previamente cadastrado em uma análise cadastral — por exemplo, para inativar um grupo que não deve mais ser utilizado.

O grupo é identificado pela sua chave externa (`external_signer_group_key`), retornada na criação.

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/investor_analysis/{investor_analysis_key}/signer_group/{external_signer_group_key}/status`
MÉTODO `PUT`
STATUS `202`

### Request body
```json title='Request Body'
{
    "status": "inactive"
}
```

### Body params
| Campo    | Tipo   | Descrição                                                       | Obrigatório |
|----------|--------|-----------------------------------------------------------------|-------------|
| `status` | string | Novo status do grupo. Valores típicos: `active`, `inactive`     |    Sim      |

### Response
`202 Accepted`. A representação atualizada do grupo é retornada no corpo.

---

# Consulta Informações de uma Análise Cadastral do Investidor

URL: /en/documentation/iaas/investidor/compartilhado/busca_informacoes_de_uma_analise_cadastral_do_investidor

---

### Introdução
Este recurso retorna a representação completa de uma **análise cadastral**, incluindo dados cadastrais preenchidos (`natural_person` / `legal_person`), endereço, patrimônio, suitability, contas bancárias, grupos de assinantes, partes relacionadas, investor owners, documentos da análise, lotes de documentos para assinatura e histórico de eventos de status.

### Input / Output

Não há corpo de requisição.

Como ***output*** será retornada a representação da análise cadastral identificada por `investor_analysis_key`.

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/investor_analysis/{investor_analysis_key}`
MÉTODO `GET`
STATUS `200`

:::info Endpoints relacionados
- **Análise em andamento** para um investidor: `GET /investor_registry/investor/{investor_key}/in_progress_investor_analysis`.
- **Listagem paginada de análises** do agente: `GET /investor_registry/investor_analyses`.
:::

### Response

Caso 01: Análise de Pessoa Jurídica — Fundo de Investimento

```json
{
   "investor_analysis_key": "UUID",
   "name": "Fundo XPTO Multimercado",
   "document_number": "12.345.678/0001-90",
   "analysis_datetime": "2025-04-29T12:07:55Z",
   "status": "manually_approved",
   "analysis_type": "v2",
   "agent_key": "UUID",
   "investor": {
      "investor_key": "UUID",
      "name": "Fundo XPTO Multimercado",
      "document_number": "12.345.678/0001-90",
      "person_type": "legal_person",
      "investor_sub_type": "fund_class",
      "status": "registered"
   },
   "registry_user": {
      "registry_user_key": "UUID",
      "name": "Sample Investor Name",
      "document_number": "123.456.789-00",
      "email": "user@example.com",
      "phone": {
         "number": "987654321",
         "area_code": "11",
         "international_dial_code": "55"
      }
   },
   "email": "fundo@example.com",
   "phone": {
      "number": "987654321",
      "area_code": "11",
      "international_dial_code": "55"
   },
   "address": {
      "uf": "SP",
      "city": "São Paulo",
      "number": "1000",
      "street": "Avenida Paulista",
      "country": "BRA",
      "complement": "Sala 1010",
      "postal_code": "01310-100",
      "neighborhood": "Bela Vista"
   },
   "legal_person": {
      "legal_name": "Fundo XPTO Multimercado FIC FIM",
      "constitution_date": "2020-01-15",
      "exclusive_fund_class": false
   },
   "net_worth": {
      "total_net_worth": 25000000,
      "total_financial_applications": 25000000,
      "monthly_income": 0,
      "other_incomes": 0,
      "real_estate": 0,
      "movable_assets": 0,
      "investor_category": "professional"
   },
   "investor_category": "professional",
   "bank_accounts": [
      {
         "bank_account_key": "UUID",
         "main_account": true,
         "account_digit": "8",
         "account_branch": "2152",
         "account_number": "43473205725488",
         "financial_institution_code": "349",
         "status": "active"
      }
   ],
   "signer_groups": [
      {
         "signer_group_key": "UUID",
         "external_signer_group_key": "UUID",
         "is_default": true,
         "minimum_required_signers": 1,
         "status": "active",
         "signers": [
            {
               "name": "Representante Legal",
               "document_number": "123.456.789-00",
               "email": "rep@example.com",
               "is_required_signer": true
            }
         ]
      }
   ],
   "investor_owners": [
      {
         "external_investor_owner_key": "UUID",
         "investor_owner_type": "fund_class_administrator",
         "document_number": "07.228.314/0001-95",
         "status": "active"
      },
      {
         "external_investor_owner_key": "UUID",
         "investor_owner_type": "fund_class_manager",
         "document_number": "77.784.920/0001-72",
         "status": "active"
      }
   ],
   "related_parties": [],
   "representatives_analyses": [
      {
         "representative_analysis_key": "UUID",
         "name": "Sample",
         "document_number": "069.800.621-66",
         "status": "pending_documents",
         "documents": [],
         "powers": [
            "investor_registry.create_investor",
            "investor_registry.update_investor_analysis"
         ]
      }
   ],
   "documents": [
      {
         "document_key": "UUID",
         "type": "cnpj_card",
         "status": "valid",
         "observation": null
      }
   ],
   "document_batches": [
      {
         "document_batch_key": "UUID",
         "status": "signed",
         "documents": [
            {
               "investor_document_key": "UUID",
               "document_type": "legal_person_registry_form",
               "status": "signed",
               "signature_method": "certifiqi"
            }
         ]
      }
   ],
   "feedbacks": [],
   "status_events": [
      {"status": "pending_registry_data", "event_datetime": "2025-04-29T12:07:55Z"},
      {"status": "sent_to_analysis",       "event_datetime": "2025-04-29T12:08:00Z"},
      {"status": "manually_approved",      "event_datetime": "2025-04-29T13:00:00Z"}
   ]
}
```

### Investor Analysis
| Campo                       | Tipo    | Descrição                                                                |
|-----------------------------|---------|--------------------------------------------------------------------------|
| `investor_analysis_key`     | string  | Chave única da análise cadastral                                         |
| `name`                      | string  | Nome (ou razão social)                                                   |
| `document_number`           | string  | CPF / CNPJ                                                               |
| `analysis_datetime`         | string  | Data/hora de criação da análise                                          |
| `analysis_type`             | string  | `v1` ou `v2`                                                             |
| `status`                    | string  | Enumerador de **[Investor Analysis Status](#analysis-status)**           |
| `investor_category`         | string  | Enquadramento autodeclarado (`retail`, `qualified`, `professional`)      |
| `suitability`               | string  | Perfil suitability calculado (quando aplicável)                          |
| `signature_method`          | string  | Método de assinatura definido para a análise                             |
| `expiration_date`           | string  | Data de expiração do cadastro                                            |
| `investor`                  | object  | Investidor associado                                                     |
| `email`                     | string  | E-mail                                                                   |
| `phone`                     | object  | Objeto de **[Phone](#phone)**                                            |
| `address`                   | object  | Endereço — ver doc **Enviar Endereço**                                   |
| `natural_person`            | object  | Dados de pessoa física — ver doc **Enviar Dados Cadastrais**             |
| `legal_person`              | object  | Dados de pessoa jurídica — ver doc **Enviar Dados Cadastrais**           |
| `net_worth`                 | object  | Dados patrimoniais — ver doc **Enviar Patrimônio**                       |
| `bank_accounts`             | array   | Contas bancárias                                                         |
| `signer_groups`             | array   | Grupos de assinantes                                                     |
| `investor_owners`           | array   | Vínculos de propriedade (relevante para `fund_class`)                    |
| `related_parties`           | array   | Partes relacionadas                                                      |
| `documents`                 | array   | Documentos enviados na análise                                           |
| `document_batches`          | array   | Lotes de documentos para assinatura                                      |
| `feedbacks`                 | array   | Feedbacks trocados na análise                                            |
| `status_events`             | array   | Histórico de eventos de status                                           |

### Legal Person — campos `fund_class`
Quando `investor.investor_sub_type` é `fund_class`, os campos abaixo são enriquecidos automaticamente a partir da base da CVM durante o envio para análise:

| Campo                  | Tipo    | Descrição                                                                |
|------------------------|---------|--------------------------------------------------------------------------|
| `legal_name`           | string  | Razão social / nome da classe do fundo                                   |
| `constitution_date`    | string  | Data de constituição                                                     |
| `exclusive_fund_class` | boolean | Indica se a classe é exclusiva                                           |

### Phone
| Campo                     | Tipo   | Descrição              | Caracteres |
|---------------------------|--------|------------------------|------------|
| `international_dial_code` | string | Código internacional   |   1 - 3    |
| `area_code`               | string | DDD                    |     2      |
| `number`                  | string | Número de telefone     |   8 - 9    |

### Investor Analysis Status {#analysis-status}
| Enumerador                | Descrição                            |
|---------------------------|--------------------------------------|
| `created`                 | Criada                               |
| `pending_registry_data`   | Pendente dados cadastrais            |
| `pending_documents`       | Pendente documentos                  |
| `sent_to_analysis`        | Enviada para análise                 |
| `in_manual_analysis`      | Em análise manual                    |
| `automatically_approved`  | Aprovada automaticamente             |
| `automatically_reproved`  | Reprovada automaticamente            |
| `manually_approved`       | Aprovada manualmente                 |
| `manually_reproved`       | Reprovada manualmente                |
| `expired`                 | Expirada                             |

---

# Consulta Informações do Investidor

URL: /en/documentation/iaas/investidor/compartilhado/busca_informacoes_do_investidor

---

### Introdução
Este recurso retorna os dados completos de um **investidor** — incluindo suas análises cadastrais, lotes de documentos, eventos de status, distribuidor e usuário cadastrador.

### Input / Output

Não há corpo de requisição. As chaves de identificação são passadas no *path*.

Como ***output*** será retornada a representação atual do investidor.

### Request

ENDPOINT `/investor_registry/investor/{investor_key}`
MÉTODO `GET`
STATUS `200`

:::info Endpoints relacionados
- **Listar investidores do agente**: `GET /investor_registry/investors` (paginado, com filtros `name`, `document_number`, `status`).
- **Listar investidores possuídos por um investor owner** (uso típico: fund class): `GET /investor_registry/investor/{investor_key}/investors`.
:::

### Response

Caso 01: Pessoa Física

```json
{
   "investor_key": "UUID",
   "name": "João da Silva",
   "document_number": "123.456.789-00",
   "status": "pending_analysis",
   "email": "joao@example.com",
   "person_type": "natural_person",
   "phone": {
      "number": "987654321",
      "area_code": "11",
      "international_dial_code": "55"
   },
   "distributor": {
      "distributor_key": "UUID",
      "name": "Distribuidor XPTO",
      "document_number": "00.000.000/0000-00"
   },
   "analyses": [
      {
         "investor_analysis_key": "UUID",
         "analysis_datetime": "2025-04-29 12:07:55.059999",
         "status": "pending_registry_data"
      }
   ],
   "document_batches": [],
   "status_events": [
      {
         "status": "pending_analysis",
         "event_datetime": "2025-04-29 12:07:55.000000"
      }
   ]
}
```

Caso 02: Pessoa Jurídica — Fundo de Investimento

```json
{
   "investor_key": "UUID",
   "name": "Fundo XPTO Multimercado",
   "document_number": "12.345.678/0001-90",
   "status": "registered",
   "person_type": "legal_person",
   "investor_sub_type": "fund_class",
   "distributor": {
      "distributor_key": "UUID",
      "name": "Distribuidor XPTO",
      "document_number": "00.000.000/0000-00"
   },
   "analyses": [
      {
         "investor_analysis_key": "UUID",
         "analysis_datetime": "2025-04-29 12:07:55.059999",
         "status": "manually_approved"
      }
   ],
   "document_batches": [
      {
         "document_batch_key": "UUID",
         "status": "signed",
         "documents": [
            {
               "investor_document_key": "UUID",
               "type": "legal_person_registry_form",
               "status": "signed"
            }
         ]
      }
   ],
   "status_events": [
      {
         "status": "registered",
         "event_datetime": "2025-04-29 13:08:25.673902"
      }
   ]
}
```

### Investor
| Campo               | Tipo    | Descrição                                                                       |
|---------------------|---------|---------------------------------------------------------------------------------|
| `investor_key`      | string  | Chave única de identificação do investidor                                      |
| `name`              | string  | Nome (ou razão social) do investidor                                            |
| `document_number`   | string  | CPF / CNPJ do investidor                                                        |
| `email`             | string  | E-mail de contato                                                               |
| `phone`             | object  | Objeto de **[Phone](#phone)**                                                   |
| `status`            | string  | Enumerador de **[Investor Status](#investor-status)**                           |
| `person_type`       | string  | Enumerador de **[Person Type](#person-type)**                                   |
| `investor_sub_type` | string  | Enumerador de **[Investor Sub Type](#investor-sub-type)**, quando aplicável     |
| `distributor`       | object  | Objeto de **[Distributor](#distributor)**                                       |
| `analyses`          | array   | Lista de objetos de **[Investor Analysis](#investor-analysis)**                 |
| `document_batches`  | array   | Lista de objetos de **[Document Batch](#document-batch)**                       |
| `status_events`     | array   | Lista de objetos de **[Status Event](#status-event)**                           |

### Phone
| Campo                     | Tipo   | Descrição              | Caracteres |
|---------------------------|--------|------------------------|------------|
| `international_dial_code` | string | Código internacional   |   1 - 3    |
| `area_code`               | string | DDD                    |     2      |
| `number`                  | string | Número de telefone     |   8 - 9    |

### Investor Status {#investor-status}
| Enumerador            | Descrição               |
|-----------------------|-------------------------|
| `created`             | Criado                  |
| `pending_analysis`    | Pendente análise        |
| `pending_documents`   | Pendente documentos     |
| `incomplete`          | Cadastro incompleto     |
| `pending_update`      | Pendente atualização    |
| `registered`          | Cadastrado              |
| `registry_expired`    | Cadastro expirado       |

### Person Type {#person-type}
| Enumerador        | Descrição        |
|-------------------|------------------|
| `natural_person`  | Pessoa física    |
| `legal_person`    | Pessoa jurídica  |
| `nominee`         | Nominee / PCO    |

### Investor Sub Type {#investor-sub-type}
| Enumerador               | Descrição                       |
|--------------------------|---------------------------------|
| `default`                | Pessoa jurídica regular         |
| `financial_institution`  | Instituição financeira          |
| `fund_class`             | Fundo de investimento           |
| `non-resident`           | Não-residente                   |

### Distributor {#distributor}
| Campo               | Tipo   | Descrição                                          |
|---------------------|--------|----------------------------------------------------|
| `distributor_key`   | string | Chave única do distribuidor                        |
| `name`              | string | Nome do distribuidor                               |
| `document_number`   | string | CNPJ do distribuidor                               |

### Investor Analysis {#investor-analysis}
| Campo                    | Tipo   | Descrição                                                        |
|--------------------------|--------|------------------------------------------------------------------|
| `investor_analysis_key`  | string | Chave única da análise cadastral                                 |
| `analysis_datetime`      | string | Data/hora de criação da análise                                  |
| `status`                 | string | Enumerador de **[Investor Analysis Status](#analysis-status)**   |
| `registry_user`          | object | Objeto de **[Registry User](#registry-user)**, quando presente   |

### Document Batch {#document-batch}
| Campo                | Tipo   | Descrição                                              |
|----------------------|--------|--------------------------------------------------------|
| `document_batch_key` | string | Chave única do lote de documentos                      |
| `status`             | string | Enumerador de **[Document Batch Status](#batch-status)**|
| `documents`          | array  | Lista de objetos de **[Investor Document](#investor-document)**|

### Investor Document {#investor-document}
| Campo                  | Tipo   | Descrição                                                       |
|------------------------|--------|-----------------------------------------------------------------|
| `investor_document_key`| string | Chave única do documento do investidor                          |
| `type`                 | string | Enumerador de **[Document Type](#document-type)**               |
| `status`               | string | Enumerador de **[Investor Document Status](#document-status)**  |

### Registry User {#registry-user}
| Campo               | Tipo   | Descrição                                       |
|---------------------|--------|-------------------------------------------------|
| `registry_user_key` | string | Chave única do usuário cadastrador              |
| `kc_user_id`        | string | ID do usuário no KeyCloak                       |
| `name`              | string | Nome                                            |
| `document_number`   | string | CPF                                             |
| `email`             | string | E-mail                                          |
| `phone`             | object | Objeto de **[Phone](#phone)**                   |

### Investor Analysis Status {#analysis-status}
| Enumerador                | Descrição                            |
|---------------------------|--------------------------------------|
| `created`                 | Criada                               |
| `pending_registry_data`   | Pendente dados cadastrais            |
| `pending_documents`       | Pendente documentos                  |
| `sent_to_analysis`        | Enviada para análise                 |
| `in_manual_analysis`      | Em análise manual                    |
| `automatically_approved`  | Aprovada automaticamente             |
| `automatically_reproved`  | Reprovada automaticamente            |
| `manually_approved`       | Aprovada manualmente                 |
| `manually_reproved`       | Reprovada manualmente                |
| `expired`                 | Expirada                             |

### Document Batch Status {#batch-status}
| Enumerador               | Descrição                       |
|--------------------------|---------------------------------|
| `creating_documents`     | Documentos sendo gerados        |
| `send_to_signature`      | Enviado para assinatura         |
| `pending_signature`      | Aguardando assinatura           |
| `signed`                 | Assinado                        |

### Document Type {#document-type}
| Enumerador                     | Descrição                              |
|--------------------------------|----------------------------------------|
| `cnh`                          | CNH                                    |
| `rg`                           | RG                                     |
| `rg_back`                      | RG — verso                             |
| `rg_front`                     | RG — frente                            |
| `proof_of_residence`           | Comprovante de residência              |
| `cnpj_card`                    | Cartão CNPJ                            |
| `financial_statements`         | Demonstrações financeiras              |
| `social_contract`              | Contrato social                        |
| `company_statute`              | Estatuto                               |
| `board_election_record`        | Ata de eleição                         |
| `fund_prospectus`              | Regulamento do fundo                   |
| `power_of_attorney`            | Procuração                             |
| `billing_statement`            | Fatura / extrato                       |
| `investor_qualification_proof` | Comprovação de qualificação            |
| `qualified_investor_term`      | Termo de investidor qualificado        |
| `professional_investor_term`   | Termo de investidor profissional       |
| `natural_person_registry_form` | Ficha cadastral — pessoa física        |
| `legal_person_registry_form`   | Ficha cadastral — pessoa jurídica      |

### Investor Document Status {#document-status}
| Enumerador         | Descrição                              |
|--------------------|----------------------------------------|
| `sent_to_generate` | Enviado para ser gerado                |
| `generated`        | Gerado                                 |
| `signed`           | Assinado                               |

### Status Event {#status-event}
| Campo            | Tipo   | Descrição                                                       |
|------------------|--------|-----------------------------------------------------------------|
| `status`         | string | Enumerador de status                                            |
| `event_datetime` | string | Data/hora do evento                                             |

---

# Buscar Lotes de Documentos para Assinatura

URL: /en/documentation/iaas/investidor/compartilhado/buscar_documentos_para_assinatura

---
### Introdução
Este recurso retorna os **lotes de documentos** (`document_batches`) gerados para um investidor após o envio da análise cadastral. Cada lote agrupa os documentos a serem assinados (ficha cadastral, termos de investidor qualificado/profissional, etc.) e expõe o status e o método de assinatura de cada documento.

### Input / Output

Não há corpo de requisição. Opcionalmente é possível filtrar por análise cadastral via query param.

Como ***output*** será retornada a lista de lotes do investidor.

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/document_batches`
MÉTODO `GET`
STATUS `200`

### Query params
| Campo                   | Tipo   | Descrição                                                            | Obrigatório |
|-------------------------|--------|----------------------------------------------------------------------|-------------|
| `investor_analysis_key` | string | Filtra os lotes pertencentes a uma análise cadastral específica      |    Não      |

### Response

```json title='Response Body'
[
  {
    "document_batch_key": "UUID",
    "status": "pending_signature",
    "investor_analysis_key": "UUID",
    "url": "https://docs.qitech.com.br/...",
    "documents": [
      {
        "investor_document_key": "UUID",
        "document_type": "legal_person_registry_form",
        "status": "generated",
        "signature_method": "certifiqi"
      },
      {
        "investor_document_key": "UUID",
        "document_type": "professional_investor_term",
        "status": "generated",
        "signature_method": "certifiqi"
      }
    ]
  }
]
```

### Document Batch Status
| Enumerador              | Descrição                       |
|-------------------------|---------------------------------|
| `creating_documents`    | Documentos sendo gerados        |
| `pending_signer_groups` | Aguardando grupos de assinantes |
| `send_to_signature`     | Enviados para assinatura        |
| `pending_signature`     | Aguardando assinatura           |
| `signed`                | Assinados                       |

:::info Detalhes de assinatura
Para detalhes de cada assinatura em um lote específico, utilize `GET /investor_registry/investor/{investor_key}/document_batch/{document_batch_key}/signature_details`.
:::

---

# Consultar Análise em Andamento

URL: /en/documentation/iaas/investidor/compartilhado/consultar_analise_em_andamento

---
### Introdução
Este recurso retorna a **análise cadastral em andamento** (não finalizada) associada a um investidor. Útil para retomar um cadastro em progresso sem precisar conhecer a `investor_analysis_key`.

Considera-se "em andamento" qualquer análise cujo status ainda não tenha sido finalizado (criada, pendente de dados/documentos, enviada para análise, em análise manual).

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/in_progress_investor_analysis`
MÉTODO `GET`
STATUS `200`

### Response
A análise cadastral em andamento é retornada no corpo da resposta. Para o formato completo, consulte **Busca informações de uma análise cadastral do investidor**.

---

# Adicionar Conta Bancária

URL: /en/documentation/iaas/investidor/compartilhado/contas_bancarias/adicionar_contas_bancarias

---

### Request

ENDPOINT /investor_registry/investor/\{investor_key\}/bank_account
MÉTODO POST
STATUS 201

### Request body
```json title='Request Body'
{
    "financial_institution_code": "329",
    "account_number": "000000",
    "account_digit": "0",
    "account_branch": "000"
}
```

### Body params
| Campo                             | Tipo     | Descrição                                                                    | Caracteres   | Obrigatório |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `financial_institution_code`                            | string   | Código da Instituição Financeira                                                           |   1  - 4   |    Sim      |
| `account_number`                 | string   | Número de Conta                                                                  |   1 - 20    |    Sim      |
| `account_digit`                     | string   | Dígito de Conta                                |      1       |    Sim      |
| `account_branch`                           | string   | Agência                                                                       |   1  - 4   |    Sim      |

### Response
```json title='Response Body'
{
    "bank_account_key": "UUID"
}
```

### Erros Tratáveis
| Código                             | Significado     |
|------------------------------------|-----------------|
"IVR000077" | Essa conta já foi cadastrada para o investidor |

---

# Atualizar Conta Bancária

URL: /en/documentation/iaas/investidor/compartilhado/contas_bancarias/atualizar_conta_bancaria

---

### Request

ENDPOINT /investor_registry/investor/\{investor_key\}/bank_account/\{bank_account_key\}/update
MÉTODO PUT
STATUS 204

### Request body
```json title='Request Body'
{
    "status": "str",
    "main_account": true,
}
```

:::warning Atenção
    Existem três formas de atualizar a conta bancária:
- Atualizar o *status* para inactive , desativando o uso da conta.
- Atualizar o *status* para active , reativando o uso da conta.
- Atualizar a definição de conta principal utilizando a propriedade *main_account* , tornando a conta em questão a principal do investidor.

    Caso sejam enviados ambos os parâmetros, um erro será retornado.
:::

### Body params
| Campo                             | Tipo     | Descrição                                                                    | Caracteres   | Obrigatório |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `status`                            | string   | Novo Status da Conta                                                           |   1 - 20   |    Não      |
| `main_account`                            | bool   | Define se a conta é a principal do investidor |   -   |    Não      |

---

# Atualizar Status da Conta Bancária

URL: /en/documentation/iaas/investidor/compartilhado/contas_bancarias/atualizar_status_conta_bancaria

---
### Introdução
Este recurso altera o status de uma conta bancária previamente cadastrada em uma análise cadastral — por exemplo, para inativar uma conta que não deve mais ser utilizada.

A conta é identificada pela sua chave externa (`external_bank_account_key`), retornada na criação.

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/investor_analysis/{investor_analysis_key}/bank_account/{external_bank_account_key}/status`
MÉTODO `PUT`
STATUS `202`

### Request body
```json title='Request Body'
{
    "status": "inactive"
}
```

### Body params
| Campo    | Tipo   | Descrição                                                     | Obrigatório |
|----------|--------|---------------------------------------------------------------|-------------|
| `status` | string | Novo status da conta. Valores típicos: `active`, `inactive`   |    Sim      |

### Response
`202 Accepted`. A representação atualizada da conta é retornada no corpo.

---

# Consultar Contas Bancárias

URL: /en/documentation/iaas/investidor/compartilhado/contas_bancarias/buscar_contas_bancarias

---

### Request

ENDPOINT /investor/investor/INVESTOR_KEY/bank_accounts
MÉTODO GET
STATUS 200

### Query params
| Campo                             | Tipo     | Descrição                                                                    | Opções   | Obrigatório |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `status`                            | string   | Novo Status da Conta                                                           |   "active" ou "inactive"   |    Não      |
| `main_account`                            | bool   | Define se a conta é a principal do investidor |   True ou False   |    Não      |

### Responses

```json
{
    "data": [
        {
            "bank_account_key": "UUID4",
            "financial_institution_code": "329",
            "account_number": "00000000",
            "account_digit": "0",
            "account_branch": "0001",
            "main_account": true,
            "status": "active"
        },
        {
            "bank_account_key": "UUID4",
            "financial_institution_code": "329",
            "account_number": "00000000",
            "account_digit": "0",
            "account_branch": "0001",
            "main_account": false,
            "status": "inactive"
        }
    ],
    "limit": 50,
    "page": 0,
    "is_last_page": true
}
```

---

# Definir Conta Bancária Principal

URL: /en/documentation/iaas/investidor/compartilhado/contas_bancarias/definir_conta_principal

---
### Introdução
Este recurso define (ou remove) uma conta bancária como **conta principal** do investidor dentro de uma análise cadastral. Apenas **uma** conta pode estar marcada como principal por vez — ao marcar uma como principal, a conta anteriormente principal é automaticamente desmarcada.

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/investor_analysis/{investor_analysis_key}/bank_account/{external_bank_account_key}/default`
MÉTODO `PUT`
STATUS `202`

### Request body
```json title='Request Body'
{
    "value": true
}
```

### Body params
| Campo   | Tipo    | Descrição                                       | Obrigatório |
|---------|---------|-------------------------------------------------|-------------|
| `value` | boolean | `true` para definir esta conta como principal   |    Sim      |

### Response
`202 Accepted`. A representação atualizada da conta é retornada no corpo.

---

# Enviar Conta Bancária do Investidor

URL: /en/documentation/iaas/investidor/compartilhado/contas_bancarias/enviar_contas_bancarias

---
### Introdução
Este recurso cadastra uma conta bancária para o investidor dentro de uma análise cadastral. **Cada conta deve ser enviada em uma requisição independente** — para cadastrar mais de uma conta, chame o endpoint múltiplas vezes.

### Input / Output

Como ***input*** envie os dados de uma conta bancária.

Como ***output*** será retornada a conta criada, incluindo a chave `bank_account_key` gerada.

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/investor_analysis/{investor_analysis_key}/bank_account`
MÉTODO `POST`
STATUS `201`

### Request body

Exemplo: conta principal individual

```json title='Request Body'
{
    "financial_institution_code": "341",
    "account_number": "12345678",
    "account_digit": "9",
    "account_branch": "0001",
    "main_account": true
}
```

Exemplo: conta conjunta

```json title='Request Body'
{
    "financial_institution_code": "341",
    "account_number": "12345678",
    "account_digit": "9",
    "account_branch": "0001",
    "shared_account_owners": [
        {
            "name": "Maria Silva",
            "document_number": "068.045.160-95"
        }
    ]
}
```

### Body params
| Campo                        | Tipo    | Descrição                                                                       | Caracteres | Obrigatório |
|------------------------------|---------|---------------------------------------------------------------------------------|------------|-------------|
| `financial_institution_code` | string  | Código da instituição financeira (compe / ISPB curto)                           |   1 - 4    |    Sim      |
| `account_number`             | string  | Número da conta bancária (apenas dígitos)                                       |   1 - 20   |    Sim      |
| `account_digit`              | string  | Dígito verificador da conta                                                     |     1      |    Sim      |
| `account_branch`             | string  | Número da agência (4 dígitos)                                                   |     4      |    Sim      |
| `main_account`               | boolean | Indica se é a conta principal do investidor                                     |     -      |    Não      |
| `shared_account_owners`      | array   | Lista de objetos de **[Shared Account Owner](#shared-account-owners)**          |     -      |    Não      |

:::info
Apenas uma conta pode ser marcada como `main_account: true`. Se nenhuma conta for marcada como principal, a primeira cadastrada é assumida como principal.
:::

### Shared Account Owners {#shared-account-owners}
| Campo             | Tipo   | Descrição                                                                  | Caracteres | Obrigatório |
|-------------------|--------|----------------------------------------------------------------------------|------------|-------------|
| `name`            | string | Nome do co-titular da conta                                                |     -      |    Sim      |
| `document_number` | string | CPF do co-titular (`XXX.XXX.XXX-XX`)       |  14  |    Sim      |

### Response
A conta bancária criada é retornada no corpo, incluindo `external_bank_account_key` e `status`.

---

# Criar investidor

URL: /en/documentation/iaas/investidor/compartilhado/criar_investidor

---

### Introdução
Este recurso tem como objetivo nos informar dados básicos para iniciar o cadastro de um **investidor**.

A criação de um investidor já dispara, em conjunto, a abertura de uma primeira **análise cadastral** vinculada a ele. Por isso, ao final desta chamada são retornadas duas chaves: ***investor_key*** (identifica o investidor) e ***investor_analysis_key*** (identifica a análise cadastral em andamento).

Existem 3 tipos principais de investidor, definidos pelo campo **`person_type`**: **pessoa física** (`natural_person`) e **pessoa jurídica** (`legal_person`). Para pessoas jurídicas, o campo **`investor_sub_type`** distingue subtipos como **fundo de investimento** (`fund_class`), que possuem regras próprias ao longo do fluxo de cadastro.

:::info Informação
No ambiente de Homologação, temos a seguinte regra para aprovações: CPF/CNPJ com início **1**: reprovação automática; CPF/CNPJ com início **8**: pendente de validação manual; o restante é aprovado automaticamente.
:::

### Input / Output

Como ***input*** envie os dados básicos do investidor. Os campos obrigatórios variam de acordo com **`person_type`** e **`investor_sub_type`**.

Como ***output*** serão retornadas a ***investor_key*** e a ***investor_analysis_key***. A ***investor_key*** identifica o investidor; a ***investor_analysis_key*** identifica a análise cadastral aberta junto com a criação. Um mesmo investidor pode possuir mais de uma análise cadastral ao longo do tempo (renovações, atualizações).

### Request

ENDPOINT `/investor_registry/investor`
MÉTODO `POST`
STATUS `201`

### Request body

Caso 01: Pessoa Física

```json title='Request Body'
{
    "name": "João da Silva",
    "document_number": "123.456.789-00",
    "person_type": "natural_person",
    "email": "joao.silva@example.com",
    "phone": {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "987654321"
    }
}
```

Caso 02: Pessoa Jurídica

```json title='Request Body'
{
    "name": "Empresa XPTO Ltda",
    "document_number": "12.345.678/0001-90",
    "person_type": "legal_person",
    "investor_sub_type": "default",
    "registry_user": {
        "name": "José da Silva",
        "document_number": "123.456.789-00",
        "email": "jose.silva@example.com",
        "phone": {
            "international_dial_code": "55",
            "area_code": "11",
            "number": "987654321"
        }
    }
}
```

:::warning Atenção
Os campos obrigatórios mudam de acordo com o **`person_type`**:

- **`natural_person`**: `name`, `document_number`, `person_type` (`email` e `phone` recomendados para criação de usuário)
- **`legal_person`**: `name`, `document_number`, `person_type`, `investor_sub_type` e `registry_user`
:::

:::info Sobre o `registry_user`
O **`registry_user`** representa o usuário (pessoa física) responsável por preencher os dados cadastrais do investidor. Para **pessoa física**, normalmente este usuário é o próprio investidor e o campo pode ser omitido. Para **pessoa jurídica**, é o representante que responderá pelo preenchimento.
:::

### Body params
| Campo                       | Tipo     | Descrição                                                                                   | Caracteres   | Obrigatório |
|-----------------------------|----------|---------------------------------------------------------------------------------------------|--------------|-------------|
| `name`                      | string   | Nome (ou razão social) do investidor                                                        |   1 - 255    |    Sim      |
| `person_type`               | string   | Enumerador de **[Person Type](#person-type)**                                               |      -       |    Sim      |
| `document_number`           | string   | CPF (`XXX.XXX.XXX-XX`) ou CNPJ (`XX.XXX.XXX/XXXX-XX`)                                       |   14 ou 18   |    Sim*     |
| `investor_sub_type`         | string   | Enumerador de **[Investor Sub Type](#investor-sub-type)**                                   |      -       |    Não      |
| `email`                     | string   | E-mail do investidor                                                                        |   1 - 255    |    Não      |
| `phone`                     | object   | Objeto de **[Phone](#phone)**                                                               |      -       |    Não      |
| `registry_user`             | object   | Objeto de **[Registry User](#registry-user)**                                               |      -       |    Não      |

### Phone
| Campo                       | Tipo     | Descrição                                                                                   | Caracteres   | Obrigatório |
|-----------------------------|----------|---------------------------------------------------------------------------------------------|--------------|-------------|
| `international_dial_code`   | string   | Código internacional (ex.: `55`)                                                            |   1 - 3      |    Sim      |
| `area_code`                 | string   | DDD                                                                                         |      2       |    Sim      |
| `number`                    | string   | Número do telefone                                                                          |   8 - 9      |    Sim      |

### Registry User
| Campo               | Tipo     | Descrição                                            | Caracteres   | Obrigatório |
|---------------------|----------|------------------------------------------------------|--------------|-------------|
| `name`              | string   | Nome do usuário cadastrador                          |   1 - 255    |    Sim      |
| `document_number`   | string   | CPF do usuário (formato `XXX.XXX.XXX-XX`)            |     14       |    Sim      |
| `email`             | string   | E-mail do usuário                                    |   1 - 255    |    Sim      |
| `phone`             | object   | Objeto de **[Phone](#phone)**                        |      -       |    Sim      |

### Person Type {#person-type}
| Enumerador          | Descrição                                            |
|---------------------|------------------------------------------------------|
| `natural_person`    | Pessoa física                                        |
| `legal_person`      | Pessoa jurídica                                      |

### Investor Sub Type {#investor-sub-type}
| Enumerador               | Descrição                                                                                  |
|--------------------------|--------------------------------------------------------------------------------------------|
| `default`                | Pessoa jurídica regular (default quando o campo não é informado)                           |

### Response
```json title='Response Body'
{
    "investor_key": "UUID",
    "investor_analysis_key": "UUID"
}
```

---

# Definir Grupo de Assinantes Padrão

URL: /en/documentation/iaas/investidor/compartilhado/definir_grupo_assinantes_padrao

---
### Introdução
Este recurso define (ou remove) um grupo de assinantes como **grupo padrão** da análise cadastral. Apenas **um** grupo pode estar marcado como padrão por vez — ao marcar um grupo como padrão, o grupo anteriormente padrão é automaticamente desmarcado.

O grupo padrão é o utilizado por default na geração dos documentos para assinatura, caso a análise seja submetida sem informar explicitamente um `external_signer_group_key`.

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/investor_analysis/{investor_analysis_key}/signer_group/{external_signer_group_key}/default`
MÉTODO `PUT`
STATUS `202`

### Request body
```json title='Request Body'
{
    "value": true
}
```

### Body params
| Campo   | Tipo    | Descrição                                  | Obrigatório |
|---------|---------|--------------------------------------------|-------------|
| `value` | boolean | `true` para definir este grupo como padrão |    Sim      |

### Response
`202 Accepted`. A representação atualizada do grupo é retornada no corpo.

---

# Enviar Cadastro do Investidor para Análise

URL: /en/documentation/iaas/investidor/compartilhado/enviar_cadastro_para_analise

---
### Introdução
Este recurso submete a **análise cadastral** preenchida para validação. A partir desse momento, os dados são enviados aos serviços de compliance e os documentos são gerados para assinatura.

:::warning Atenção
A **análise cadastral** ocorre de forma assíncrona. Recomendamos integrar com os **webhooks** de mudança de status para acompanhar a evolução.
:::

### Input / Output

O corpo é **opcional** — pode ser enviado vazio (`null` ou `{}`). Quando enviado, permite informar o método de assinatura e o grupo de assinantes que deverá ser utilizado para os documentos gerados.

Como ***output*** será retornada a representação atualizada da análise cadastral.

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/investor_analysis/{investor_analysis_key}/submit`
MÉTODO `PUT`
STATUS `202`

### Request body

O corpo pode ser enviado vazio (`{}`) — neste caso a API utiliza o método de assinatura e o grupo de assinantes padrão da análise. Para sobrescrever esses valores, envie os campos opcionais abaixo.

```json title='Request Body'
{
    "signature_method": "certifiqi",
    "external_signer_group_key": "3f8a5a3e-1f0a-4d9b-8a6e-9b4c0e7d8f12"
}
```

### Body params
| Campo                       | Tipo   | Descrição                                                              | Obrigatório |
|-----------------------------|--------|------------------------------------------------------------------------|-------------|
| `signature_method`          | string | Método de assinatura a ser utilizado (ex.: `certifiqi`, `opt_in`)      |    Não      |
| `external_signer_group_key` | string | Chave externa do grupo de assinantes a ser utilizado para esta análise |    Não      |

### Response
A análise cadastral atualizada é retornada no corpo da resposta.

---

# Enviar Dados Cadastrais do Investidor

URL: /en/documentation/iaas/investidor/compartilhado/enviar_dados_cadastrais

---
### Introdução
Este recurso tem como objetivo enviar os dados cadastrais específicos da pessoa que compõe a **análise cadastral** de um investidor.

O corpo enviado deve conter **um** dos blocos `natural_person` ou `legal_person`, coerente com o `person_type` informado na criação do investidor.

### Input / Output

Como ***input*** envie os dados cadastrais específicos do tipo de investidor.

Como ***output*** será retornada a representação atualizada da análise cadastral. As chaves ***investor_key*** e ***investor_analysis_key*** identificam o investidor e a análise atualizada.

:::info Investidor `fund_class`
Para fundos de investimento (`investor_sub_type: "fund_class"`), as informações da pessoa jurídica (razão social, data de constituição, etc.) são preenchidas **automaticamente** a partir da base da CVM ao enviar a análise para validação. Esta etapa não é necessária para esse subtipo.
:::

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/investor_analysis/{investor_analysis_key}/registry_data`
MÉTODO `PUT`
STATUS `202`

### Request body

Exemplo: Pessoa Física

```json title='Request Body'
{
    "name": "João da Silva",
    "email": "joao.silva@example.com",
    "phone": {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "987654321"
    },
    "natural_person": {
        "birthdate": "1990-05-15",
        "gender": "male",
        "mother_name": "Maria da Silva",
        "nationality": "BRA",
        "place_of_birth": {
            "country": "BRA",
            "uf": "SP",
            "city": "São Paulo"
        },
        "marital_status": "single",
        "spouse": {
            "name": "Maria Santos",
            "document_number": "123.456.789-00"
        },
        "profession": "Engenheiro",
        "occupation": "Engenheiro de Software",
        "occupation_company": {
            "name": "Empresa XYZ Ltda",
            "document_number": "12.345.678/0001-90"
        }
    }
}
```

Exemplo: Pessoa Jurídica

```json title='Request Body'
{
    "name": "Empresa XPTO Ltda",
    "email": "contato@empresaxpto.com.br",
    "phone": {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "1234567890"
    },
    "legal_person": {
        "legal_name": "Empresa XPTO Limitada",
        "constitution_date": "2020-01-15"
    }
}
```

Exemplo: Pessoa Jurídica (`fund_class`)

```json title='Request Body'
{
    "name": "Empresa XPTO Ltda",
    "email": "contato@empresaxpto.com.br",
    "phone": {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "1234567890"
    },
    "legal_person": {
        "giin_number": "XXXXXX.XXXXX.XX.XXX",
    }
}
```

### Body params
| Campo             | Tipo     | Descrição                                                                            | Caracteres | Obrigatório |
|-------------------|----------|--------------------------------------------------------------------------------------|------------|-------------|
| `name`            | string   | Nome (ou razão social) do investidor                                                 |   1 - 255  |    Não      |
| `email`           | string   | E-mail de contato                                                                    |   1 - 255  |    Não      |
| `phone`           | object   | Objeto de **[Phone](#phone)**                                                        |     -      |    Não      |
| `natural_person`  | object   | Objeto de **[Natural Person](#natural-person)** — obrigatório para pessoa física     |     -      |    Sim*     |
| `legal_person`    | object   | Objeto de **[Legal Person](#legal-person)** — obrigatório para pessoa jurídica       |     -      |    Sim*     |

\* É obrigatório enviar **exatamente um** entre `natural_person` ou `legal_person`, de acordo com o `person_type` do investidor.

### Natural Person {#natural-person}
| Campo                  | Tipo   | Descrição                                                       | Caracteres | Obrigatório |
|------------------------|--------|-----------------------------------------------------------------|------------|-------------|
| `birthdate`            | string | Data de nascimento (`YYYY-MM-DD`)                               |     10     |    Sim      |
| `mother_name`          | string | Nome completo da mãe                                            |   1 - 255  |    Sim      |
| `nationality`          | string | Nacionalidade — código ISO de 3 letras (ex.: `BRA`)             |      3     |    Sim      |
| `place_of_birth`       | object | Objeto de **[Place of Birth](#place-of-birth)**                 |     -      |    Sim      |
| `marital_status`       | string | Enumerador de **[Marital Status](#marital-status)**             |     -      |    Sim      |
| `profession`           | string | Profissão                                                       |   1 - 255  |    Sim      |
| `occupation`           | string | Ocupação                                                        |   1 - 255  |    Sim      |
| `gender`               | string | Enumerador de **[Gender](#gender)**                             |     -      |    Não      |
| `spouse`               | object | Objeto de **[Spouse](#spouse)**                                 |     -      |    Não      |
| `occupation_company`   | object | Objeto de **[Occupation Company](#occupation-company)**         |     -      |    Não      |

### Gender {#gender}
| Enumerador | Descrição    |
|------------|--------------|
| `male`     | Masculino    |
| `female`   | Feminino     |

### Marital Status {#marital-status}
| Enumerador                                  | Descrição                                       |
|---------------------------------------------|-------------------------------------------------|
| `single`                                    | Solteiro(a)                                     |
| `married`                                   | Casado(a)                                       |
| `civil_union`                               | União estável                                   |
| `divorced`                                  | Divorciado(a)                                   |
| `widowed`                                   | Viúvo(a)                                        |
| `married_with_partial_community_property`   | Casado(a) em comunhão parcial de bens           |

### Place of Birth {#place-of-birth}
| Campo     | Tipo   | Descrição                                          | Caracteres | Obrigatório |
|-----------|--------|----------------------------------------------------|------------|-------------|
| `country` | string | Código ISO do país (3 letras, ex.: `BRA`)          |     3      |    Não      |
| `uf`      | string | Estado (UF)                                        |     -      |    Não      |
| `city`    | string | Cidade                                             |     -      |    Não      |

### Spouse {#spouse}
| Campo             | Tipo   | Descrição                                                            | Caracteres | Obrigatório |
|-------------------|--------|----------------------------------------------------------------------|------------|-------------|
| `name`            | string | Nome completo do cônjuge                                             |   1 - 255  |    Sim      |
| `document_number` | string | CPF do cônjuge (`XXX.XXX.XXX-XX`)    |   14 |    Sim      |

### Occupation Company {#occupation-company}
| Campo             | Tipo   | Descrição                                                  | Caracteres | Obrigatório |
|-------------------|--------|------------------------------------------------------------|------------|-------------|
| `name`            | string | Nome da empresa                                            |   1 - 255  |    Sim      |
| `document_number` | string | CNPJ da empresa (`XX.XXX.XXX/XXXX-XX`)                     |     18     |    Sim      |

### Legal Person {#legal-person}
| Campo               | Tipo   | Descrição                                                                | Caracteres | Obrigatório |
|---------------------|--------|--------------------------------------------------------------------------|------------|-------------|
| `legal_name`        | string | Razão social da empresa                                                  |   1 - 255  |    Não      |
| `constitution_date` | string | Data de constituição (`YYYY-MM-DD`)                                      |     10     |    Não      |
| `giin_number`       | string | GIIN (`Global Intermediary Identification Number`), quando aplicável     |   1 - 20   |    Não      |

### Phone {#phone}
| Campo                     | Tipo   | Descrição              | Caracteres | Obrigatório |
|---------------------------|--------|------------------------|------------|-------------|
| `international_dial_code` | string | Código internacional   |   1 - 3    |    Sim      |
| `area_code`               | string | DDD                    |     2      |    Sim      |
| `number`                  | string | Número de telefone     |   8 - 9    |    Sim      |

### Response
A análise cadastral atualizada é retornada no corpo da resposta. Para o formato completo, consulte **Busca informações de uma análise cadastral do investidor**.

---

---

# Enviar Documento Assinado

URL: /en/documentation/iaas/investidor/compartilhado/enviar_documento_assinado

---
### Introdução
Este recurso faz o **upload do arquivo assinado** de um documento gerado para a formalização do cadastro do investidor, dentro de um `document_batch`. Os tipos suportados são: ficha cadastral (pessoa física ou jurídica), termo de investidor qualificado e termo de investidor profissional.

Utilize este recurso quando o distribuidor é responsável por gerar e assinar o documento externamente (configuração `document_generation: external`) e precisa enviar o arquivo PDF/imagem final ao QI Tech. Para confirmar uma assinatura via *opt-in*, utilize **[Assinar Documento](/documentation/iaas/investidor/compartilhado/assinar_documento)**.

:::warning Atenção
Este recurso está disponível apenas para integrações que atuam como **Distribuidor** com `document_generation` configurado como `external`. O documento deve estar com status `pending_external_upload`.
:::

### Input / Output

Como ***input*** envie o conteúdo do arquivo codificado em **base64**.

Como ***output***, quando o envio finaliza o lote, é retornada a chave `investor_document_key`.

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/investor_analysis/{investor_analysis_key}/document_batch/{document_batch_key}/document/{investor_document_key}/signed_document`
MÉTODO `POST`
STATUS `201`

### Request body

```json title='Request Body'
{
  "document_b64": "base64_encoded_document_content"
}
```

### Body params
| Campo          | Tipo   | Descrição                                              | Obrigatório |
|----------------|--------|--------------------------------------------------------|-------------|
| `document_b64` | string | Conteúdo do arquivo assinado codificado em **base64**  |    Sim      |

### Response
```json title='Response Body'
{
    "investor_document_key": "UUID"
}
```

---

# Enviar Endereço do Investidor

URL: /en/documentation/iaas/investidor/compartilhado/enviar_endereco

---
### Introdução
Este recurso tem como objetivo enviar o endereço que compõe a **análise cadastral** de um investidor.

:::info Investidor `fund_class`
Para fundos de investimento, o endereço é herdado automaticamente do **administrador** vinculado ao fundo durante o envio para análise. O envio desta etapa é opcional nesse cenário.
:::

### Input / Output

Como ***input*** envie os dados de endereço.

Como ***output*** será retornada a representação atualizada da análise cadastral.

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/investor_analysis/{investor_analysis_key}/address`
MÉTODO `PUT`
STATUS `202`

Exemplo

```json title='Request Body'
{
    "street": "Avenida Paulista",
    "number": "1000",
    "neighborhood": "Bela Vista",
    "city": "São Paulo",
    "postal_code": "01310-100",
    "uf": "SP",
    "country": "BRA",
    "complement": "Sala 1010"
}
```

### Body params
| Campo          | Tipo   | Descrição                                            | Caracteres | Obrigatório |
|----------------|--------|------------------------------------------------------|------------|-------------|
| `street`       | string | Logradouro                                           |   1 - 255  |    Sim      |
| `number`       | string | Número (somente dígitos)                             |   1 - 10   |    Sim      |
| `neighborhood` | string | Bairro                                               |   1 - 255  |    Sim      |
| `city`         | string | Cidade                                               |   1 - 255  |    Sim      |
| `postal_code`  | string | CEP (`XXXXX-XXX`)                                    |     9      |    Sim      |
| `uf`           | string | Unidade Federativa — ex.: `SP`, `CE`, `MG`           |     2      |    Sim      |
| `country`      | string | Código ISO do país, 3 letras — ex.: `BRA`            |     3      |    Sim      |
| `complement`   | string | Complemento                                          |   1 - 255  |    Não      |

### Response
A análise cadastral atualizada é retornada no corpo da resposta. Para o formato completo, consulte **Busca informações de uma análise cadastral do investidor**.

---

---

# Enviar Grupo de Assinantes

URL: /en/documentation/iaas/investidor/compartilhado/enviar_grupos_assinantes

---

### Introdução
Este recurso cadastra um **grupo de assinantes** que será responsável por assinar os documentos gerados na análise cadastral do investidor. **Cada grupo deve ser enviado em uma requisição independente** — para cadastrar mais de um grupo, chame o endpoint múltiplas vezes.

:::warning Atenção
Cada signatário enviado neste recurso será **validado contra os representantes legais** declarados em **[Criar Parte Relacionada](./related_party/criar_parte_relacionada.md)**. Portanto, todo `signer` deve **também** ser cadastrado previamente como parte relacionada com `legal_representative: true` (e, quando aplicável, `direct_beneficiary: true`). Signatários que não constarem entre os representantes legais da análise cadastral terão o cadastro recusado.
:::

### Input / Output

Como ***input*** envie a definição de um único grupo de assinantes.

Como ***output*** será retornada a representação do grupo criado.

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/investor_analysis/{investor_analysis_key}/signer_group`
MÉTODO `POST`
STATUS `201`

### Request body

Exemplo

```json title='Request Body'
{
    "is_default": true,
    "minimum_required_signers": 2,
    "expiration_date": "2025-12-31",
    "signers": [
        {
            "name": "João Silva",
            "document_number": "123.456.789-00",
            "email": "joao.silva@example.com",
            "is_required_signer": true
        },
        {
            "name": "Maria Santos",
            "document_number": "987.654.321-00",
            "email": "maria.santos@example.com",
            "is_required_signer": true
        },
        {
            "name": "Pedro Oliveira",
            "document_number": "456.789.123-00",
            "email": "pedro.oliveira@example.com",
            "is_required_signer": false
        }
    ]
}
```

### Body params
| Campo                       | Tipo    | Descrição                                                                | Obrigatório |
|-----------------------------|---------|--------------------------------------------------------------------------|-------------|
| `is_default`                | boolean | Indica se este é o grupo padrão da análise                               |    Sim      |
| `minimum_required_signers`  | number  | Número mínimo de assinaturas necessárias (>= 1)                          |    Sim      |
| `signers`                   | array   | Lista de objetos de **[Signers](#signers)**                              |    Sim      |
| `expiration_date`           | string  | Data de expiração do grupo (`YYYY-MM-DD`)                                |    Não      |

### Signers {#signers}
| Campo                | Tipo    | Descrição                                                            | Caracteres | Obrigatório |
|----------------------|---------|----------------------------------------------------------------------|------------|-------------|
| `name`               | string  | Nome do signatário                                                   |   1 - 255  |    Sim      |
| `document_number`    | string  | CPF ou CNPJ do signatário                                            |  14 ou 18  |    Sim      |
| `email`              | string  | E-mail do signatário                                                 |     -      |    Sim      |
| `is_required_signer` | boolean | Indica se o signatário é obrigatório para considerar o grupo completo |     -      |    Sim      |

:::info Informação
- Apenas **um** grupo pode estar marcado como `is_default: true` por análise.
- `minimum_required_signers` deve ser menor ou igual ao total de signatários da lista.
- Pelo menos um signatário deve ter `is_required_signer: true`.
- Após `expiration_date`, o grupo não poderá mais ser utilizado para assinatura de documentos.
:::

### Response
O grupo de assinantes criado é retornado no corpo da resposta, incluindo a chave `external_signer_group_key`.

---

---

# Enviar Documento do Investidor

URL: /en/documentation/iaas/investidor/compartilhado/enviar_investor_document

---

### Introdução
Este recurso faz o upload de um documento que compõe a análise cadastral do investidor. Os documentos obrigatórios variam conforme o `person_type` e o `investor_sub_type` do investidor, bem como sua categoria (varejo, qualificado, profissional).

:::warning Atenção
Este endpoint deve ser chamado **uma vez para cada documento** obrigatório.
:::

### Input / Output

Como ***input*** envie o conteúdo do arquivo em **base64**, o tipo do documento e a extensão.

Como ***output*** será retornada a representação do documento criado, com sua `document_key` (também referida como `external_investor_analysis_document_key`).

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/investor_analysis/{investor_analysis_key}/document`
MÉTODO `POST`
STATUS `201`

### Query params
| Campo   | Tipo    | Descrição                                                                                                                | Obrigatório |
|---------|---------|--------------------------------------------------------------------------------------------------------------------------|-------------|
| `force` | boolean | Se `true`, força o envio mesmo quando há validação prévia falha. O documento entra obrigatoriamente em análise manual.   |    Não      |

### Request body

Exemplo: CNH (Pessoa Física)

```json title='Request Body'
{
    "type": "cnh",
    "document_b64": "base64_encoded_document_content",
    "file_extension": "pdf",
    "document_data": {
        "document_type": "CNH",
        "issuer_entity": "DETRAN"
    }
}
```

Exemplo: RG (frente e verso)

```json title='Request Body — Frente'
{
    "type": "rg_front",
    "document_b64": "base64_encoded_document_content",
    "file_extension": "jpeg",
    "document_data": {
        "document_type": "RG",
        "issuer_entity": "SSP",
        "document_number": "20.932.206-8"
    }
}
```
```json title='Request Body — Verso'
{
    "type": "rg_back",
    "document_b64": "base64_encoded_document_content",
    "file_extension": "jpeg"
}
```

Exemplo: Cartão CNPJ (Pessoa Jurídica)

```json title='Request Body'
{
    "type": "cnpj_card",
    "document_b64": "base64_encoded_document_content",
    "file_extension": "pdf"
}
```

### Body params
| Campo            | Tipo   | Descrição                                                          | Caracteres | Obrigatório |
|------------------|--------|--------------------------------------------------------------------|------------|-------------|
| `type`           | string | Enumerador de **[Document Type](#document-type)**                  |     -      |    Sim      |
| `document_b64`   | string | Conteúdo do arquivo codificado em base64                           |     -      |    Sim      |
| `file_extension` | string | Extensão do arquivo. Valores aceitos: `pdf`, `jpeg`                |     -      |    Sim      |
| `document_data`  | object | Metadados livres do documento (ex.: número, órgão emissor)         |     -      |    Não      |
| `observation`    | string | Observação livre sobre o documento                                 |   até 500  |    Não      |

### Document Type {#document-type}
| Enumerador                     | Descrição                                            | Extensões      |
|--------------------------------|------------------------------------------------------|----------------|
| `cnh`                          | CNH                                                  | `pdf`, `jpeg`  |
| `rg`                           | RG (frente e verso em arquivo único)                 | `pdf`, `jpeg`  |
| `rg_front`                     | RG — frente                                          | `pdf`, `jpeg`  |
| `rg_back`                      | RG — verso                                           | `pdf`, `jpeg`  |
| `proof_of_residence`           | Comprovante de residência                            | `pdf`, `jpeg`  |
| `cnpj_card`                    | Cartão CNPJ                                          | `pdf`, `jpeg`  |
| `social_contract`              | Contrato social                                      | `pdf`, `jpeg`  |
| `company_statute`              | Estatuto                                             | `pdf`, `jpeg`  |
| `board_election_record`        | Ata de eleição estatutária                           | `pdf`, `jpeg`  |
| `financial_statements`         | Demonstrações financeiras                            | `pdf`, `jpeg`  |
| `investor_qualification_proof` | Comprovação de qualificação                          | `pdf`, `jpeg`  |
| `power_of_attorney`            | Procuração                                           | `pdf`, `jpeg`  |
| `billing_statement`            | Fatura / extrato                                     | `pdf`, `jpeg`  |
| `fund_prospectus`              | Regulamento do fundo de investimento                 | `pdf`, `jpeg`  |

### Documentos Obrigatórios

#### Pessoa Física (`natural_person`)
| Documento                                  | Descrição                          |
|--------------------------------------------|------------------------------------|
| `cnh` ou (`rg_front` + `rg_back`) ou `rg`  | Documento de identificação         |
| `proof_of_residence`                       | Comprovante de residência          |

#### Pessoa Jurídica regular (`legal_person` / `investor_sub_type: default`)
| Documento                       | Quando enviar                                |
|---------------------------------|----------------------------------------------|
| `financial_statements`          | Todos                                        |
| `social_contract`               | Quando aplicável                             |
| `company_statute`               | Quando aplicável                             |
| `board_election_record`         | Quando aplicável                             |
| `investor_qualification_proof`  | Investidor qualificado / profissional        |

#### Pessoa Jurídica — Fundo de Investimento (`investor_sub_type: fund_class`)
| Documento                | Descrição                                           |
|--------------------------|-----------------------------------------------------|
| `cnpj_card`              | Cartão CNPJ do fundo                                |
| `financial_statements`   | Demonstrações financeiras                           |
| `fund_prospectus`        | Regulamento do fundo                                |

### Response
O documento criado é retornado no corpo da resposta, incluindo a chave `document_key` (também referenciada como `external_investor_analysis_document_key`) e o `status` inicial (`valid`, `invalid` ou `in_manual_analysis`).

---

# Enviar Patrimônio do Investidor

URL: /en/documentation/iaas/investidor/compartilhado/enviar_patrimonio

---
### Introdução
Este recurso registra as informações de patrimônio e enquadramento do investidor (varejo, qualificado ou profissional).

:::info Investidor `fund_class`
Para fundos de investimento, o patrimônio é calculado **automaticamente** a partir dos dados públicos da CVM ao enviar a análise para validação. O envio desta etapa não é necessário para esse subtipo.
:::

### Input / Output

Como ***input*** envie os valores patrimoniais e a categoria autodeclarada do investidor.

Como ***output*** será retornada a representação atualizada da análise cadastral.

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/investor_analysis/{investor_analysis_key}/net_worth`
MÉTODO `PUT`
STATUS `202`

Exemplo

```json title='Request Body'
{
    "investor_category": "retail",
    "total_net_worth": 250000,
    "total_financial_applications": 80000,
    "monthly_income": 15000,
    "other_incomes": 0,
    "real_estate": 150000,
    "movable_assets": 20000,
    "resource_origin": "Renda do trabalho"
}
```

### Body params
| Campo                          | Tipo   | Descrição                                                          | Obrigatório |
|--------------------------------|--------|--------------------------------------------------------------------|-------------|
| `total_net_worth`              | number | Patrimônio total (>= 0)                                            |    Sim      |
| `total_financial_applications` | number | Total em aplicações financeiras (>= 0)                             |    Sim      |
| `monthly_income`               | number | Renda ou faturamento mensal (>= 0)                                 |    Sim      |
| `other_incomes`                | number | Outras rendas mensais (>= 0)                                       |    Sim      |
| `real_estate`                  | number | Patrimônio em imóveis (>= 0)                                       |    Sim      |
| `movable_assets`               | number | Patrimônio em bens móveis (>= 0)                                   |    Sim      |
| `investor_category`            | string | Enumerador de **[Investor Category](#investor-category)**          |    Sim      |
| `resource_origin`              | string | Origem dos recursos (até 255 caracteres)                           |    Não      |

### Investor Category {#investor-category}
| Enumerador     | Descrição     |
|----------------|---------------|
| `retail`       | Varejo        |
| `qualified`    | Qualificado   |
| `professional` | Profissional  |

### Response
A análise cadastral atualizada é retornada no corpo da resposta. Para o formato completo, consulte **Busca informações de uma análise cadastral do investidor**.

---

# Consultar Feedback

URL: /en/documentation/iaas/investidor/compartilhado/feedback/consultar_feedback

---
### Introdução
Este recurso retorna a representação detalhada de um único **feedback** identificado por `feedback_key`.

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/feedback/{feedback_key}`
MÉTODO `GET`
STATUS `200`

### Response

```json
{
  "feedback_key": "UUID",
  "status": "open",
  "origin_type": "investor_analysis_document",
  "origin_key": "UUID",
  "messages": [
    {
      "message": "Por favor, reenvie o comprovante de residência.",
      "sender_type": "backoffice",
      "created_at": "2025-04-29T12:07:55Z"
    },
    {
      "message": "Comprovante reenviado.",
      "sender_type": "agent",
      "created_at": "2025-04-29T15:10:00Z"
    }
  ]
}
```

---

# Enviar Mensagem em Feedback

URL: /en/documentation/iaas/investidor/compartilhado/feedback/enviar_mensagem_feedback

---
### Introdução
Este recurso adiciona uma nova **mensagem** a um feedback existente — ou cria o feedback caso ele ainda não exista para a entidade de origem informada (`origin_type` + `origin_key`).

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/feedback/{feedback_key}/message`
MÉTODO `PUT`
STATUS `201`

### Request body
```json title='Request Body'
{
    "message": "Estamos providenciando o documento solicitado.",
    "origin_type": "investor_analysis_document",
    "origin_key": "UUID"
}
```

### Body params
| Campo         | Tipo   | Descrição                                                                  | Caracteres | Obrigatório |
|---------------|--------|----------------------------------------------------------------------------|------------|-------------|
| `message`     | string | Conteúdo da mensagem                                                       |  1 - 1000  |    Sim      |
| `origin_type` | string | Tipo da entidade à qual o feedback se refere                               |   1 - 50   |    Sim      |
| `origin_key`  | string | Chave da entidade de origem (UUID)                                         |     36     |    Sim      |

### Response
O feedback atualizado é retornado no corpo da resposta.

---

# Listar Feedbacks

URL: /en/documentation/iaas/investidor/compartilhado/feedback/listar_feedbacks

---
### Introdução
Este recurso lista os **feedbacks** trocados em torno de uma entidade da análise cadastral. Feedbacks são utilizados para comunicação assíncrona com o backoffice (ex.: pendências de documento, comentários do compliance).

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/feedbacks`
MÉTODO `GET`
STATUS `200`

### Query params
| Campo         | Tipo    | Descrição                                                                                  | Obrigatório |
|---------------|---------|--------------------------------------------------------------------------------------------|-------------|
| `origin_type` | string  | Tipo da entidade de origem (ex.: `investor_analysis`, `investor_analysis_document`)        |    Sim      |
| `origin_key`  | string  | Chave da entidade de origem (UUID)                                                         |    Sim      |
| `page`        | integer | Página (>= 0). Default: `0`                                                                |    Não      |
| `limit`       | integer | Tamanho da página. Default: `100`                                                          |    Não      |

### Response

```json
{
  "data": [
    {
      "feedback_key": "UUID",
      "status": "open",
      "messages": [
        {
          "message": "Por favor, reenvie o comprovante de residência com data atualizada.",
          "sender_type": "backoffice",
          "created_at": "2025-04-29T12:07:55Z"
        }
      ],
      "origin_type": "investor_analysis_document",
      "origin_key": "UUID"
    }
  ],
  "page": 0,
  "limit": 100,
  "is_last_page": true
}
```

---

# Criar Investor Owner

URL: /en/documentation/iaas/investidor/compartilhado/investor_owner/criar_investor_owner

---
### Introdução
Este recurso cria um vínculo de **propriedade / responsabilidade** (`investor_owner`) entre o investidor da análise e outro investidor já existente no sistema (identificado pelo CNPJ informado). É utilizado principalmente em fluxos de **carteira administrada** para registrar o gestor de carteira.

:::info Quando usar
- Para fundos de investimento (`fund_class`), os vínculos com **administrador** e **gestor** são criados **automaticamente** ao enviar a análise para validação, com base nos dados públicos da CVM. Este endpoint deve ser usado para registrar vínculos **adicionais** (ex.: investidor exclusivo, gestor de carteira), ou para fluxos diferentes do auto-enriquecimento.
- O investidor referenciado pelo `document_number` precisa estar previamente cadastrado no distribuidor.
:::

### Input / Output

Como ***input*** envie o CNPJ do investidor que será o "owner" e o tipo do vínculo.

Como ***output*** o status `201 Created` é retornado.

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/investor_analysis/{investor_analysis_key}/investor_owner`
MÉTODO `POST`
STATUS `201`

### Request body

```json title='Request Body'
{
    "investor_owner_type": "wallet_manager",
    "document_number": "07.228.314/0001-95"
}
```

### Body params
| Campo                          | Tipo   | Descrição                                                                            | Caracteres | Obrigatório |
|--------------------------------|--------|--------------------------------------------------------------------------------------|------------|-------------|
| `investor_owner_type`          | string | Enumerador de **[Investor Owner Type](#investor-owner-type)**                        |   1 - 50   |    Sim      |
| `document_number`              | string | CNPJ do investidor que será o owner (`XX.XXX.XXX/XXXX-XX`)                           |     18     |    Sim      |
| `external_investor_owner_key`  | string | Chave externa pré-definida para este vínculo. Caso omitida, é gerada automaticamente |   1 - 36   |    Não      |

### Investor Owner Type {#investor-owner-type}
| Enumerador                  | Descrição                                                         |
|-----------------------------|-------------------------------------------------------------------|
| `fund_class_administrator`  | Administrador do fundo                                            |
| `fund_class_manager`        | Gestor do fundo                                                   |
| `wallet_manager`            | Gestor de carteira                                                |

### Atualizar status de um Investor Owner

Para inativar ou reativar um vínculo, utilize:

ENDPOINT `/investor_registry/investor/{investor_key}/investor_analysis/{investor_analysis_key}/investor_owner/{external_investor_owner_key}/status`
MÉTODO `PUT`
STATUS `202`

```json title='Request Body'
{
    "status": "active"
}
```

---

# Enviar Documento de Investor Owner

URL: /en/documentation/iaas/investidor/compartilhado/investor_owner/enviar_documento_investor_owner

---
### Introdução
Este recurso faz o upload de um documento associado a um **investor owner** (vínculo de propriedade) de uma análise cadastral. Aplica-se principalmente aos fluxos de fundo de investimento, onde podem ser exigidos documentos do administrador, gestor ou investidor exclusivo.

### Input / Output

Como ***input*** envie o arquivo em **base64**, o tipo e a extensão.

Como ***output*** será retornada a representação do documento criado.

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/investor_analysis/{investor_analysis_key}/investor_owner/{external_investor_owner_key}/document`
MÉTODO `POST`
STATUS `201`

### Request body
```json title='Request Body'
{
    "type": "power_of_attorney",
    "document_b64": "base64_encoded_document_content",
    "file_extension": "pdf"
}
```

### Body params
| Campo            | Tipo   | Descrição                                              | Obrigatório |
|------------------|--------|--------------------------------------------------------|-------------|
| `type`           | string | Tipo do documento (ver enumerador em **Enviar Documento do Investidor**) |    Sim      |
| `document_b64`   | string | Conteúdo do arquivo em base64                          |    Sim      |
| `file_extension` | string | Extensão (`pdf` ou `jpeg`)                             |    Sim      |
| `document_data`  | object | Metadados livres do documento                          |    Não      |
| `observation`    | string | Observação livre (até 500 caracteres)                  |    Não      |

### Endpoints relacionados
- `GET .../investor_owner/{external_investor_owner_key}/document/{investor_owner_document_key}` — consultar um documento de investor owner.
- `PUT .../investor_owner/{external_investor_owner_key}/document/{investor_owner_document_key}/update` — atualizar o status de um documento.

---

# Criar Parte Relacionada

URL: /en/documentation/iaas/investidor/compartilhado/related_party/criar_parte_relacionada

---

### Introdução
Este recurso tem como objetivo identificar os beneficiários finais (pessoas físicas) e controladores relacionados ao investidor pessoa jurídica, como sócios, diretores, administradores, etc ou procuradores de pessoa física.

:::warning Atenção
- É obrigatório criar **pelo menos uma** parte relacionada para Pessoas Jurídicas ou Pessoa Física (quando houver procurador da PF)
- É obrigatório que **pelo menos uma** parte relacionada tenha `legal_representative: true`
- Para pessoa jurídica como parte relacionada, o `related_party_type` deve ser `parent_company`
- Este endpoint deve ser chamado múltiplas vezes, uma vez para cada parte relacionada
:::

:::info Sobre os Beneficiários Finais
*Beneficiário Final é a pessoa natural que, em última instância exerce posição de controle ou influência significativa na empresa, especialmente as que detêm 15% ou mais de participação direta ou indireta, exercem cargo de administração ou representam a empresa para fins legais.*

*Informar os dados das pessoas físicas que detêm 15% ou mais de participação societária direta ou indireta e administradores. Se nenhum dos sócios/acionistas detém individualmente participação igual ou maior a 15%, solicitamos enviar as informações dos 03 controladores que detêm os maiores percentuais de participação.*
:::

### Input / Output:
Como ***input*** devem ser enviados os dados da parte relacionada.

Como ***output*** será entregue uma ***external_related_party_key*** e os detalhes da parte relacionada criada.

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/investor_analysis/{investor_analysis_key}/related_party`
MÉTODO `POST`
STATUS `201`

### Request body

Exemplo: Sócio Pessoa Física

```json title='Request Body'
{
    "name": "João Silva",
    "document_number": "123.456.789-00",
    "person_type": "natural_person",
    "related_party_type": "partner",
    "resident": true,
    "legal_representative": true,
    "direct_beneficiary": true,
    "address": {
        "postal_code": "01000-000",
        "street": "Rua das Flores",
        "number": "123",
        "neighborhood": "Centro",
        "city": "São Paulo",
        "uf": "SP",
        "country": "BRA",
        "complement": "Apto 101"
    },
    "participation_percentage": 0.5,
    "monthly_income": 50000.00,
    "email": "joao.silva@example.com",
    "phone": {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "987654321"
    }
}
```

Exemplo: Empresa Controladora (Pessoa Jurídica)

```json title='Request Body'
{
    "name": "Empresa Controladora Ltda",
    "document_number": "98.765.432/0001-11",
    "person_type": "legal_person",
    "related_party_type": "parent_company",
    "resident": true,
    "legal_representative": false,
    "direct_beneficiary": true,
    "address": {
        "postal_code": "02000-000",
        "street": "Avenida Principal",
        "number": "456",
        "neighborhood": "Jardim",
        "city": "São Paulo",
        "uf": "SP",
        "country": "BRA"
    },
    "participation_percentage": 0.8,
    "email": "contato@controladora.com.br",
    "phone": {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "123456789"
    }
}
```

### Body params
| Campo                             | Tipo     | Descrição                                                                    | Caracteres   | Obrigatório |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `name`                            | string   | Nome da parte relacionada                                                    |   1  - 255   |    Sim      |
| `document_number`                 | string   | CPF ou CNPJ                                                                  |   1  - 18    |    Sim      |
| `person_type`                     | string   | Enumerador de **[Person Type](#person-type-related-party)**                 |      -       |    Sim      |
| `related_party_type`              | string   | Enumerador de **[Related Party Type](#related-party-type)**                 |      -       |    Sim      |
| `resident`                        | boolean  | Define se é residente no Brasil                                             |      -       |    Sim      |
| `legal_representative`            | boolean  | Define se é representante legal                                              |      -       |    Sim      |
| `direct_beneficiary`              | boolean  | Define se é beneficiário direto                                               |      -       |    Sim      |
| `participation_percentage`        | number   | Percentual de participação (0 a 1)                                           |      -       |    Sim      |
| `address`                         | object   | Objeto de **[Address](#address)**                                            |      -       |    Não      |
| `email`                           | string   | E-mail                                                                       |   1  - 100   |    Não      |
| `phone`                           | object   | Objeto de **[Phone](#phone)**                                                |      -       |    Não      |
| `monthly_income`                  | number   | Renda mensal                                                                  |      -       |    Não      |
| `expiration_date`                 | string   | Data de expiração (formato: YYYY-MM-DD)                                      |      10      |    Não      |

### Person Type (Related Party) {#person-type-related-party}
| Enumerador                        | Descrição                                                                    |
|-----------------------------------|------------------------------------------------------------------------------|
| `natural_person`                  | Pessoa física                                                                |
| `legal_person`                    | Pessoa jurídica                                                              |

### Related Party Type {#related-party-type}
| Enumerador                        | Descrição                                                                    |
|-----------------------------------|------------------------------------------------------------------------------|
| `president`                       | Presidente                                                                   |
| `partner`                         | Sócio                                                                        |
| `administrator`                   | Administrador                                                                |
| `director`                        | Diretor                                                                      |
| `manager`                         | Gestor                                                                       |
| `attorney`                        | Procurador                                                                   |
| `parent_company`                  | Empresa controladora (apenas para pessoa jurídica)                          |
| `asset_custodian`                 | Custodiante de ativos                                                        |
| `exclusive_investor`                 | Investidor Exclusivo                                                        |

### Address {#address}
| Campo                             | Tipo     | Descrição                                                                    | Caracteres   | Obrigatório |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `postal_code`                     | string   | CEP                                                                          |      9       |    Sim      |
| `street`                          | string   | Logradouro                                                                   |   1  - 255   |    Não      |
| `number`                          | string   | Número                                                                       |   1  - 10    |    Não      |
| `neighborhood`                    | string   | Bairro                                                                       |   1  - 255   |    Não      |
| `city`                            | string   | Cidade                                                                       |   1  - 255   |    Não      |
| `uf`                              | string   | Estado                                                                       |      2       |    Não      |
| `country`                         | string   | País                                                                         |      3       |    Não      |
| `complement`                      | string   | Complemento                                                                  |   1  - 255   |    Não      |

### Phone {#phone}
| Campo                             | Tipo     | Descrição                                                                    | Caracteres   | Obrigatório |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `international_dial_code`         | string   | Código internacional                                                         |   1  - 3     |    Sim      |
| `area_code`                       | string   | Código de área                                                               |      2       |    Sim      |
| `number`                          | string   | Número de telefone                                                           |   8  - 9     |    Sim      |

### Response
```json title='Response Body'
{
    "related_party_key": "UUID",
    "external_related_party_key": "UUID",
    "name": "João Silva",
    "document_number": "123.456.789-00",
    "person_type": "natural_person",
    "related_party_type": "partner",
    "status": "active",
    "resident": true,
    "legal_representative": true,
    "direct_beneficiary": true,
    "address": {...},
    "participation_percentage": 0.5,
    "monthly_income": 50000.00,
    "email": "joao.silva@example.com",
    "phone": {...}
}
```

---

# Enviar Documento da Parte Relacionada

URL: /en/documentation/iaas/investidor/compartilhado/related_party/enviar_documento_parte_relacionada

---

### Introdução
Este recurso tem como objetivo fazer upload dos documentos obrigatórios de cada parte relacionada criada.

:::warning Atenção
- Este endpoint deve ser chamado para **cada** parte relacionada criada que seja **pessoa física**
- A parte relacionada deve estar com status **"active"** para receber documentos
- Para pessoa física: é obrigatório enviar um documento de identificação (cnh ou rg)
- Para tipo attorney (procurador): é obrigatório enviar power_of_attorney (procuração)
:::

### Input / Output:
Como ***input*** deve ser enviado o documento em base64, o tipo do documento e a extensão do arquivo.

Como ***output*** será entregue uma ***related_party_document_key*** que identifica o documento enviado.

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/investor_analysis/{investor_analysis_key}/related_party/{external_related_party_key}/document`
MÉTODO `POST`
STATUS `201`

### Request body

Exemplo: Documento de Identificação (CNH)

```json title='Request Body'
{
    "type": "cnh",
    "document_b64": "base64_encoded_document_content",
    "file_extension": "pdf"
}
```

Exemplo: RG (Frente e Verso)

```json title='Request Body - Frente'
{
    "type": "rg_front",
    "document_b64": "base64_encoded_document_content",
    "file_extension": "pdf"
}
```

```json title='Request Body - Verso'
{
    "type": "rg_back",
    "document_b64": "base64_encoded_document_content",
    "file_extension": "pdf"
}
```

Exemplo: Procuração (para tipo attorney)

```json title='Request Body'
{
    "type": "power_of_attorney",
    "document_b64": "base64_encoded_document_content",
    "file_extension": "pdf"
}
```

### Body params
| Campo                             | Tipo     | Descrição                                                                    | Caracteres   | Obrigatório |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `type`                            | string   | Tipo de documento                                                           |   1  - 50    |    Sim      |
| `document_b64`                    | string   | Base 64 do documento                                                         |      -       |    Sim      |
| `file_extension`                 | string   | Extensão do arquivo (pdf, png, jpeg)                                         |   1  - 10    |    Sim      |

### Document Type (Related Party)
| Enumerador                        | Descrição                   | Extensões Suportadas        | Obrigatório Para                    |
|-----------------------------------|-----------------------------|-----------------------------|-------------------------------------|
| `cnh`                             | CNH                         | pdf, jpeg                   | Pessoa física (uma opção)           |
| `rg`                              | RG                          | pdf, jpeg                   | Pessoa física (uma opção)           |
| `rg_back`                         | Verso do RG                 | pdf, jpeg                   | Pessoa física (com rg_front)        |
| `rg_front`                        | Frente do RG                | pdf, jpeg                   | Pessoa física (com rg_back)         |
| `power_of_attorney`               | Procuração                  | pdf, jpeg                   | Tipo attorney                       |

### Documentos Obrigatórios
| Documento                         | Descrição                                                  | Tipo de Parte Relacionada               |
|-----------------------------------|------------------------------------------------------------|-----------------------------------------|
| `cnh` ou (`rg_front` + `rg_back`) | Documento de identificação                                 | Pessoa física                           |
| `power_of_attorney`               | Procuração                                                  | Tipo attorney                           |

### Response
```json title='Response Body'
{
    "related_party_document_key": "UUID",
    "status": "valid | invalid | in_manual_analysis"
}
```

:::info Informação
O documento será validado automaticamente após o upload. O status pode ser:
- `valid`: Documento válido
- `invalid`: Documento inválido
- `in_manual_analysis`: Em análise manual

Para documentos inválidos, é possível forçar o envio usando o parâmetro `force=true`. No entanto, ao utilizar essa flag o documento será submetido para avaliação manual, necessariamente.
:::

---

# Consultar Formulário Suitability

URL: /en/documentation/iaas/investidor/compartilhado/suitability/consultar_formulario_suitability

:::warning Atenção
 O envio do `suitability` ***NÃO*** é necessário para investidores que sejam **Fundos de Investimento** ou **Pessoas Jurídicas** enquadradas como **qualificadas** ou **profissionais**.
:::

### Request:
:::info
O formulário suitability muda de acordo com o `person_type` do investidor sendo cadastrado. Para obter o formulário suitability a ser respondido é necessário realizar uma consulta no formulário vigente para o tipo de investidor.
:::

ENDPOINT `/investor_registry/v2/suitability_form`
MÉTODO `GET`
STATUS `200`

### Query params
| Campo                             | Tipo     | Descrição                                                                    | Caracteres   | Obrigatório |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `person_type`                 | enumerator    | `natural_person` \| `legal_person`                                                        |      -       |    Sim      |

### Response

Caso 01: Pessoa Jurídica

```json
{
    "01": {
        "title": "Por quanto tempo a empresa pretende manter seu dinheiro investido?",
        "options": {
            "A": {
                "title": "Pretende manter os recursos aplicados em até 1 ano e utilizar parte importante ou a integridade dos recursos desta carteira nesse período."
            },
            "B": {
                "title": "Pretende manter os recursos aplicados entre 2 e 3 anos e utilizar parte importante ou a integridade dos recursos desta carteira nesse período."
            },
            "C": {
                "title": "Pretende manter os recursos aplicados entre 4 e 5 anos e utilizar os recursos desta carteira após esse período."
            },
            "D": {
                "title": "Pretende manter os recursos aplicados por um período acima de 5 anos e não tem planos de utilizar esses recursos, por enquanto."
            }
        }
    },
    "02": {
        "title": "Qual objetivo do investimento da empresa e a sua tolerância em relação aos riscos?",
        "options": {
            "A": {
                "title": "Preservação do capital para não perder valor ao longo do tempo, assumindo baixos riscos de perdas."
            },
            "B": {
                "title": "Aumento gradual do capital ao longo do tempo, assumindo médios riscos de perdas."
            },
            "C": {
                "title": "Aumento do capital acima da taxa de retorno média do mercado, mesmo que isso implique assumir riscos de perdas elevadas."
            },
            "D": {
                "title": "Obter no curto prazo retornos elevados e significativamente acima da taxa de retorno média do mercado, assumindo riscos elevados."
            }
        }
    },
    "03": {
        "title": "Com quais produtos de investimento a pessoa responsável pela tomada de decisões sobre investimentos em nome da empresa tem familiaridade (conhecimento do produto e dos riscos envolvidos)?",
        "options": {
            "A": {
                "title": "Renda Fixa (CDB, Tesouro Direto e Fundos de Renda Fixa)."
            },
            "B": {
                "title": "Renda Fixa (LCI, LCA, Debêntures, CRI, CRA, Fundos de Renda Fixa, etc)."
            },
            "C": {
                "title": "Renda Fixa, Fundos Multimercados, Renda Variável e Derivativos."
            },
            "D": {
                "title": "Renda Fixa, Fundos Multimercados, Renda Variável e Operações Estruturadas (Fundos Estruturados, COE, Swaps e Derivativos)."
            }
        }
    },
    "04": {
        "title": "Com quais produtos de investimento a empresa realizou operações 3 ou mais vezes nos últimos 2 anos?",
        "options": {
            "A": {
                "title": "Não investi nos últimos 2 anos ou investi menos de 3 vezes."
            },
            "B": {
                "title": "Renda Fixa (LCI, LCA, Debêntures, CRI, CRA, Fundos de Renda Fixa, etc)."
            },
            "C": {
                "title": "Renda Fixa, Fundos Multimercados, Renda Variável e Derivativos."
            },
            "D": {
                "title": "Renda Fixa, Multimercados, Renda Variável e Operações Estruturadas (Fundos Estruturados, COE, Swaps e Derivativos)."
            }
        }
    },
    "05": {
        "title": "Qual a composição mais aproximada do seu portfólio de investimentos?",
        "options": {
            "A": {
                "title": "Não possuo recursos investidos."
            },
            "B": {
                "title": "A totalidade dos recursos está aplicada em Renda Fixa (CDB, Tesouro Direto e Fundos de Renda Fixa)."
            },
            "C": {
                "title": "Entre 70% e 90% dos recursos estão aplicados em Renda Fixa (LCI, LCA, Debêntures, CRI, CRA, Fundos de Renda Fixa, etc) e entre 10% e 30% dos recursos estão aplicados em Fundos Multimercados, Renda Variável e Derivativos."
            },
            "D": {
                "title": "Mais de 50% dos recursos estão aplicados em Renda Fixa, Fundos Multimercados, Renda Variável e Operações Estruturadas (Fundos Estruturados, COE, Swaps e Derivativos)."
            }
        }
    },
    "06": {
        "title": "Qual a faixa de faturamento médio mensal?",
        "options": {
            "A": {
                "title": "Até R$ 500.000,00."
            },
            "B": {
                "title": "De R$ 500.000,01 a R$ 1.000.000,00."
            },
            "C": {
                "title": "De R$ 100.000,01 a R$ 5.000.000,00."
            },
            "D": {
                "title": "Acima de R$ 5.000.000,01."
            }
        }
    },
    "07": {
        "title": "Indique a faixa que corresponde ao valor total do patrimônio da empresa (bens móveis, imóveis, etc.:",
        "options": {
            "A": {
                "title": "Até R$ 500.000,00."
            },
            "B": {
                "title": "De R$ 500.000,01 a R$ 1.000.000,00."
            },
            "C": {
                "title": "De R$ 100.000,01 a R$ 5.000.000,00."
            },
            "D": {
                "title": "Acima de R$ 5.000.000,01."
            }
        }
    },
    "08": {
        "title": "Sobre os ativos que compõem o patrimônio da empresa, qual o percentual dos seus ativos financeiros (ex: aplicações financeiras)?",
        "options": {
            "A": {
                "title": "Cerca de 30% são ativos financeiros."
            },
            "B": {
                "title": "Cerca de 40% são ativos financeiros."
            },
            "C": {
                "title": "Cerca de 60% são ativos financeiros."
            },
            "D": {
                "title": "Cerca de 70% são ativos financeiros."
            }
        }
    }

}
```

Caso 02: Pessoa Física

```json
{
    "01": {
        "title": "Durante qual período pretende manter os seus investimentos e qual a sua necessidade de utilização dos recursos ao longo do tempo?",
        "options": {
            "A": {
                "title": "Pretende manter os recursos aplicados em até 1 ano e utilizar parte importante ou a integridade dos recursos desta carteira nesse período."
            },
            "B": {
                "title": "Pretende manter os recursos aplicados entre 2 e 3 anos e utilizar parte importante ou a integridade dos recursos desta carteira nesse período."
            },
            "C": {
                "title": "Pretende manter os recursos aplicados entre 4 e 5 anos e utilizar os recursos desta carteira após esse período."
            },
            "D": {
                "title": "Pretende manter os recursos aplicados por um período acima de 5 anos e não tem planos de utilizar esses recursos, por enquanto."
            }
        }
    },
    "02": {
        "title": "Qual objetivo do investimento e o seu perfil em relação à tolerância a riscos?",
        "options": {
            "A": {
                "title": "Preservação do capital para não perder valor ao longo do tempo, assumindo baixos riscos de perdas."
            },
            "B": {
                "title": "Aumento gradual do capital ao longo do tempo, assumindo médios riscos de perdas."
            },
            "C": {
                "title": "Aumento do capital acima da taxa de retorno média do mercado, mesmo que isso implique assumir riscos de perdas elevadas."
            },
            "D": {
                "title": "Obter no curto prazo retornos elevados e significativamente acima da taxa de retorno média do mercado, assumindo riscos elevados."
            }
        }
    },
    "03": {
        "title": "Com quais produtos de investimento você tem familiaridade (conhecimento do produto e dos riscos envolvidos)?",
        "options": {
            "A": {
                "title": "Renda Fixa (CDB, Tesouro Direto e Fundos de Renda Fixa)."
            },
            "B": {
                "title": "Renda Fixa (LCI, LCA, Debêntures, CRI, CRA, Fundos de Renda Fixa, etc)."
            },
            "C": {
                "title": "Renda Fixa, Fundos Multimercados, Renda Variável e Derivativos."
            },
            "D": {
                "title": "Renda Fixa, Fundos Multimercados, Renda Variável e Operações Estruturadas (Fundos Estruturados, COE, Swaps e Derivativos)."
            }
        }
    },
    "04": {
        "title": "Com quais produtos de investimento você operou 3 ou mais vezes nos últimos 2 anos?",
        "options": {
            "A": {
                "title": "Não investi nos últimos 2 anos ou investi menos de 3 vezes."
            },
            "B": {
                "title": "Renda Fixa (LCI, LCA, Debêntures, CRI, CRA, Fundos de Renda Fixa, etc)."
            },
            "C": {
                "title": "Renda Fixa, Fundos Multimercados, Renda Variável e Derivativos."
            },
            "D": {
                "title": "Renda Fixa, Multimercados, Renda Variável e Operações Estruturadas (Fundos Estruturados, COE, Swaps e Derivativos)."
            }
        }
    },
    "05": {
        "title": "Qual a composição mais aproximada do seu portfólio de investimentos?",
        "options": {
            "A": {
                "title": "Não possuo recursos investidos."
            },
            "B": {
                "title": "A totalidade dos recursos está aplicada em Renda Fixa (CDB, Tesouro Direto e Fundos de Renda Fixa)."
            },
            "C": {
                "title": "Entre 70% e 90% dos recursos estão aplicados em Renda Fixa (LCI, LCA, Debêntures, CRI, CRA, Fundos de Renda Fixa, etc) e entre 10% e 30% dos recursos estão aplicados em Fundos Multimercados, Renda Variável e Derivativos."
            },
            "D": {
                "title": "Mais de 50% dos recursos estão aplicados em Renda Fixa, Fundos Multimercados, Renda Variável e Operações Estruturadas (Fundos Estruturados, COE, Swaps e Derivativos)."
            }
        }
    },
    "06": {
        "title": "Qual opção melhor representa seu conhecimento sobre produtos e serviços financeiros a partir da sua formação acadêmica e experiência profissional?",
        "options": {
            "A": {
                "title": "Não concluí o ensino superior e minha experiência profissional não aprimorou meu conhecimento sobre produtos e serviços financeiros."
            },
            "B": {
                "title": "Concluí o ensino superior, mas minha experiência profissional não aprimorou meu conhecimento sobre produtos e serviços financeiros."
            },
            "C": {
                "title": "Não concluí o ensino superior, mas pela minha experiência profissional desenvolvi conhecimento suficiente sobre produtos e serviços."
            },
            "D": {
                "title": "Concluí o ensino superior e pela minha experiência profissional desenvolvi conhecimento suficiente sobre produtos e serviços financeiros."
            }
        }
    },
    "07": {
        "title": "Qual a sua renda mensal?",
        "options": {
            "A": {
                "title": "Até R$ 5.000,00."
            },
            "B": {
                "title": "De R$ 5.000,01 a R$ 15.000,00."
            },
            "C": {
                "title": "De R$ 15.000,01 a R$ 30.000,00."
            },
            "D": {
                "title": "Acima de R$ 30.000,01."
            }
        }
    },
    "08": {
        "title": "Qual é o valor do seu patrimônio? [ativos não financeiros (residência, terrenos, casa de campo e/ou praia, outros ativos) + ativos financeiros (aplicações financeiras).",
        "options": {
            "A": {
                "title": "Até R$ 500.000,00."
            },
            "B": {
                "title": "De R$ 500.000,01 a R$ 1.500.000,00."
            },
            "C": {
                "title": "De R$ 1.500.000,01 a R$ 3.000.000,00."
            },
            "D": {
                "title": "Acima de R$ 3.000.000,01."
            }
        }
    },
    "09": {
        "title": "Sobre os ativos que compõem o seu patrimônio, qual o percentual dos seus ativos financeiros (ex: aplicações financeiras)?",
        "options": {
            "A": {
                "title": "Cerca de 30% são ativos financeiros."
            },
            "B": {
                "title": "Cerca de 40% são ativos financeiros."
            },
            "C": {
                "title": "Cerca de 60% são ativos financeiros."
            },
            "D": {
                "title": "Cerca de 70% são ativos financeiros."
            }
        }
    }

}
```

---

# Enviar Resposta Suitability

URL: /en/documentation/iaas/investidor/compartilhado/suitability/enviar_suitability

---
### Introdução
Este recurso tem como objetivo enviar as respostas fornecidas para o formulário suitability respondido pelo investidor.

### Input / Output:
Os dados cadastrais mudam de acordo com os dados passados na etapa de **Criar investidor**. Segue abaixo exemplos de quais dados devem ser enviados para cada variação.

Como ***output*** será entregue uma ***investor_key*** e uma ***investor_analysis_key***. A ***investor_analysis_key*** é utilizada para identificar a **análise cadastral** atualizada.
A ***investor_key*** é utilizada para identificar o **investidor** ao qual a **análise cadastral** pertence.

:::warning Atenção
 O envio do `suitability` é **opcional** para investidores que sejam Pessoa Jurídica enquadradas como qualificadas ou profissionais.
:::

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/investor_analysis/{investor_analysis_key}/suitability`
MÉTODO `PUT`
STATUS `202`

Exemplo - Pessoa Jurídica

```json title='Request Body'
{
    "01": "A",
    "02": "A",
    "03": "A",
    "04": "A",
    "05": "A",
    "06": "A",
    "07": "A",
    "08": "A",
    "09": "A"
}
```

### Body params
| Campo                   | Tipo   | Descrição                                                                                          | Caracteres | Obrigatório |
|-------------------------|--------|----------------------------------------------------------------------------------------------------|------------|-------------|
| `01`..`NN`              | string | Resposta para cada questão do formulário. Valor é a letra da alternativa (`A`–`D`)                 |     1      |    Sim*     |

\* As chaves numéricas (`01`, `02`, ...) representam o número da questão; o valor deve ser uma única letra maiúscula correspondente à alternativa escolhida.

### Response
A análise cadastral atualizada é retornada no corpo da resposta.

---

# assinar_documento

URL: /en/documentation/iaas/investidor/distribuicao_externa/assinar_documento



---

# atualizacao_cadastral

URL: /en/documentation/iaas/investidor/distribuicao_externa/atualizacao_cadastral



---

# atualizar_status_grupo_assinantes

URL: /en/documentation/iaas/investidor/distribuicao_externa/atualizar_status_grupo_assinantes



---

# busca_informacoes_de_uma_analise_cadastral_do_investidor

URL: /en/documentation/iaas/investidor/distribuicao_externa/busca_informacoes_de_uma_analise_cadastral_do_investidor



---

# busca_informacoes_do_investidor

URL: /en/documentation/iaas/investidor/distribuicao_externa/busca_informacoes_do_investidor



---

# buscar_documentos_para_assinatura

URL: /en/documentation/iaas/investidor/distribuicao_externa/buscar_documentos_para_assinatura



---

# consultar_analise_em_andamento

URL: /en/documentation/iaas/investidor/distribuicao_externa/consultar_analise_em_andamento



---

# atualizar_status_conta_bancaria

URL: /en/documentation/iaas/investidor/distribuicao_externa/contas_bancarias/atualizar_status_conta_bancaria



---

# definir_conta_principal

URL: /en/documentation/iaas/investidor/distribuicao_externa/contas_bancarias/definir_conta_principal



---

# enviar_contas_bancarias

URL: /en/documentation/iaas/investidor/distribuicao_externa/contas_bancarias/enviar_contas_bancarias



---

# Create investor / investor analysis

URL: /en/documentation/iaas/investidor/distribuicao_externa/criar_investidor

---

### Introduction
This resource aims to inform us of basic data to start the **registry analysis** of an investor. 
There are 2 types of **registry analysis**: **natural person** and **legal person**. Legal persons, in turn, have ***sub types***, which are used to distinguish the necessary information during registration.

:::info Information
In the Sandbox environment, we have the following rule for approvals: CPF/CNPJ starting with 1: Automatic rejection; CPF/CNPJ starting with 8: Pending Manual Validation; The rest are automatically approved. 
:::

### Registration Flow

Legal person investor registration follows these steps:

1. **Create Investor** - Initial investor creation and registry analysis
2. **Send Registry Data** - Specific legal person data
3. **Send Address** - Address information
4. **Send Assets** - Net worth data
5. **Send Bank Accounts** - Bank account information
6. **Send Suitability** - Suitability questionnaire (mandatory for retail investors)
7. **Send Subscriber Groups** - Definition of subscriber groups
8. **Send Investor Documents** - Upload of mandatory documents
9. **Create Related Parties** - Registration of partners, directors, administrators, etc.
10. **Send Related Parties Documents** - Upload of related parties documents
11. **Send for Analysis** - Submission for registry analysis
12. **Sign Documents** - Document signing after approval

### Input / Output:
Each type of **registry analysis** expects a set of data as ***input***. Below are examples of how to initiate each of these flows.

As ***output***, an ***investor_key*** and an ***investor_analysis_key*** will be delivered. The ***investor_analysis_key*** is used to identify the created **registry analysis**.
The ***investor_key*** is used to identify the **investor** to which the **registry analysis** belongs.

Thus, a single ***investor_key*** (investor) can be associated with one or more ***investor_analysis_key*** (registry analysis).

Both the ***investor_key*** and the ***investor_analysis_key*** will be used in other endpoints that interact with the **investor** or with the **registry analysis**.

### Request

ENDPOINT `/investor_registry/v2/investor`
METHOD `POST`
STATUS `201`

### Request body
```json title='Request Body'
{
    "name": "string",
    "document_number": "xx.xxx.xxx/xxxx-xx",
    "person_type": "legal_person | natural_person",
    "person_sub_type": "regular | fund_class",
    "external_distribution_key": "campo livre",
    "email": "string",
    "phone": {
	    "international_dial_code": "+xx",
	    "area_code": "xx",
	    "number": "xxxxxxxxxx"
    }
}

```

:::warning Attention
Required fields change according to **person_type**.

- If **natural_person** (natural person):
    - The fields **name**, **document_number**, **person_type**, **email** and **phone** are mandatory

- If **legal_person** (legal person):
    - The fields **name**, **document_number**, **person_type**

- If **nominee** (PCO):
    - The fields **name**, **person_type**, **external_distribution_key** are mandatory

:::

:::info Information
The **registry_user** is the entity that represents the user who will fill in the investor's registry data.
In the case of **natural person**, the investor themselves fills in their registry data.
:::

Case 02: Register Legal Person

```json title='Request Body'
{
  "name": "Fundo XPTO", 
  "document_number": "12.456.789/0001-00", 
  "person_type": "legal_person",
  "person_sub_type": "regular",
  "registry_user": {
    "name": "José da Silva", 
    "document_number": "123.456.789-00",
    "email": "example@example.com",
    "phone": {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "1234567890"
    },
  }
}
```

### Body params
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `name`                            | string   | Investor name                                                                |   1  - 255   |    Yes      |
| `document_number`                 | string   | CPF or CNPJ                                                                  |   13 - 18    |    Yes      |
| `person_type`                     | string   | **[Person Type](#person_type)** enumerator                                  |      -       |    Yes      |
| `person_sub_type`                 | string   | **[Person Sub Type](#person_sub_type)** enumerator                          |      -       |    Yes      |
| `email`                           | string   | Email                                                                        |   1  - 255   |    No       |
| `phone`                           | JSON     | **[Phone](#phone)** object                                                   |      -       |    No       |
| `registry_user`                   | JSON     | **[Registry User](#registry_user)** object                                  |      -       |    No       |

### Phone
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `international_dial_code`         | string   | International code                                                           |   1  - 3     |    Yes      |
| `area_code`                       | string   | Area code                                                                    |      2       |    Yes      |
| `number`                          | string   | Phone number                                                                 |   8  - 9     |    Yes      |

### Registry User
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `name`                            | string   | Registry user name                                                           |   1  - 255   |    Yes      |
| `document_number`                 | string   | CPF                                                                          |   13    |    Yes      |
| `person_type`                     | string   | **[Person Type](#person_type)** enumerator                                  |      -       |    Yes      |
| `email`                           | string   | Email                                                                        |   1  - 255   |    Yes      |
| `phone`                           | JSON     | **[Phone](#phone)** object                                                   |      -       |    Yes      |

### Person Type
| Enumerator                        | Description                                                                  |
|-----------------------------------|------------------------------------------------------------------------------|
| `natural_person`                  | Natural person                                                               |
| `legal_person`                    | Legal person                                                                 |

### Person Sub Type
| Enumerator                        | Description                                                                  |
|-----------------------------------|------------------------------------------------------------------------------|
| `regular`                         | -                                                                            |
| `fund_class`                      | Investment fund                                                              |

### Response
```json title='Response Body'
{
    "investor_key": "UUID",
    "investor_analysis_key": "UUID"
}
```

---

# definir_grupo_assinantes_padrao

URL: /en/documentation/iaas/investidor/distribuicao_externa/definir_grupo_assinantes_padrao



---

# enviar_cadastro_para_analise

URL: /en/documentation/iaas/investidor/distribuicao_externa/enviar_cadastro_para_analise



---

# Send Investor Registry Data

URL: /en/documentation/iaas/investidor/distribuicao_externa/enviar_dados_cadastrais

---
### Introduction
This resource aims to inform us of the registry data related to the type of person that will compose the **registry analysis** of an investor.

### Input / Output:
As ***input***, specific registry data should be sent according to the investor type (`natural_person` or `legal_person`).

As ***output***, an ***investor_key*** and an ***investor_analysis_key*** will be delivered.

### Request

ENDPOINT `/investor_registry/v2/investor/{investor_key}/investor_analysis/{investor_analysis_key}/registry_data`
METHOD `PUT`
STATUS `202`

### Request body

Example: Send Natural Person Registry Data

```json title='Request Body'
{
    "name": "João da Silva",
    "email": "joao.silva@example.com",
    "phone": {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "1234567890"
    },
    "natural_person": {
        "birthdate": "1990-05-15",
        "gender": "male",
        "mother_name": "Maria da Silva",
        "nationality": "BRA",
        "place_of_birth": {
            "country": "BRA",
            "uf": "SP",
            "city": "São Paulo"
        },
        "marital_status": "single",
        "spouse": {
            "name": "Maria Santos",
            "document_number": "123.456.789-00"
        },
        "profession": "Engenheiro",
        "occupation": "Engenheiro de Software",
        "occupation_company": {
            "name": "Empresa XYZ Ltda",
            "document_number": "12.345.678/0001-90"
        }
    }
}
```

Example: Send Legal Person Registry Data

```json title='Request Body'
{
    "name": "Empresa XPTO Ltda",
    "email": "contato@empresaxpto.com.br",
    "phone": {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "1234567890"
    },
    "legal_person": {
        "legal_name": "Empresa XPTO Limitada",
        "constitution_date": "2020-01-15"
    }
}
```

### Body params
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `name`                            | string   | Investor name                                                                |   1  - 255   |    Yes      |
| `email`                           | string   | Investor email                                                               |   1  - 255   |    Yes      |
| `phone`                           | object   | **[Phone](#phone)** object                                                   |      -       |    Yes      |
| `natural_person`                  | object   | **[Natural Person](#natural-person)** object (required for natural person)  |      -       |    Yes*     |
| `legal_person`                    | object   | **[Legal Person](#legal-person)** object (required for legal person)        |      -       |    Yes*     |

\* `natural_person` is required when `person_type` is `natural_person`. `legal_person` is required when `person_type` is `legal_person`.

### Natural Person {#natural-person}
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `birthdate`                       | string   | Birth date (format: YYYY-MM-DD)                                              |      10      |    Yes      |
| `gender`                          | string   | Gender. **[Gender](#gender)** enumerator                                     |   1  - 6     |    No       |
| `mother_name`                     | string   | Mother's full name                                                           |   1  - 255   |    Yes      |
| `nationality`                     | string   | Nationality                                                                  |   1  - 255   |    Yes      |
| `place_of_birth`                  | object   | **[Place of Birth](#place-of-birth)** object                                |      -       |    Yes      |
| `marital_status`                  | string   | Marital status                                                               |   1  - 255   |    Yes      |
| `spouse`                          | object   | **[Spouse](#spouse)** object                                                 |      -       |    No       |
| `profession`                      | string   | Profession                                                                   |   1  - 255   |    Yes      |
| `occupation`                      | string   | Occupation                                                                   |   1  - 255   |    Yes      |
| `occupation_company`              | object   | **[Occupation Company](#occupation-company)** object                        |      -       |    No       |

### Gender {#gender}
| Enumerator                        | Description                                                                  |
|-----------------------------------|------------------------------------------------------------------------------|
| `male`                            | Male                                                                         |
| `female`                          | Female                                                                       |

### Place of Birth {#place-of-birth}
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `country`                         | string   | Country                                                                      |      -       |    No       |
| `uf`                              | string   | State (UF)                                                                   |      -       |    No       |
| `city`                            | string   | City                                                                         |      -       |    No       |

### Spouse {#spouse}
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `name`                            | string   | Spouse's full name                                                           |   1  - 255   |    Yes      |
| `document_number`                 | string   | Spouse's CPF or CNPJ (format: XXX.XXX.XXX-XX or XX.XXX.XXX/XXXX-XX)         |      14      |    Yes      |

### Occupation Company {#occupation-company}
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `name`                            | string   | Company name                                                                 |   1  - 255   |    Yes      |
| `document_number`                 | string   | Company CNPJ (format: XX.XXX.XXX/XXXX-XX)                                   |      18      |    Yes      |

### Legal Person {#legal-person}
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `legal_name`                      | string   | Company legal name                                                           |   1  - 255   |    Yes      |
| `constitution_date`                | string   | Company constitution date (format: YYYY-MM-DD)                              |      10      |    Yes      |

### Phone {#phone}
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `international_dial_code`         | string   | International dial code                                                      |   1  - 3     |    Yes      |
| `area_code`                       | string   | Area code                                                                    |      2       |    Yes      |
| `number`                          | string   | Phone number                                                                 |   8  - 9     |    Yes      |

### Response
```json title='Response Body'
{
    "investor_key": "UUID",
    "investor_analysis_key": "UUID"
}
```

---

---

# enviar_documento_assinado

URL: /en/documentation/iaas/investidor/distribuicao_externa/enviar_documento_assinado



---

# enviar_endereco

URL: /en/documentation/iaas/investidor/distribuicao_externa/enviar_endereco



---

# enviar_grupos_assinantes

URL: /en/documentation/iaas/investidor/distribuicao_externa/enviar_grupos_assinantes



---

# Send Investor Document

URL: /en/documentation/iaas/investidor/distribuicao_externa/enviar_investor_document

---

### Introduction
This resource aims to upload the investor's mandatory documents.

### Input / Output:
As ***input***, the document in base64, document type, and file extension must be sent.

As ***output***, a ***document_key*** will be provided that identifies the sent document.

:::warning Attention
This endpoint must be called multiple times, once for each mandatory document. The mandatory documents vary according to the investor type (natural person or legal person) and investor category (retail, qualified or professional).
:::

### Request

ENDPOINT `/investor_registry/v2/investor/{investor_key}/investor_analysis/{investor_analysis_key}/document`
MÉTODO `POST`
STATUS `201`

### Request body

Example: Identification Document - Natural Person (CNH)

```json title='Request Body'
{
    "type": "cnh",
    "document_b64": "base64_encoded_document_content",
    "file_extension": "pdf",
    "document_data": {
        "document_type": "CNH",
        "issuer_entity": "DETRAN"
    }
}
```

Example: Identification Document - Natural Person (RG)

```json title='Request Body - Frente'
{
    "type": "rg_front",
    "document_b64": "base64_encoded_document_content",
    "file_extension": "pdf",
    "document_data": {
        "document_type": "RG",
        "issuer_entity": "SSP",
        "document_number": "20.932.206-8"
    }
}
```

```json title='Request Body - Verso'
{
    "type": "rg_back",
    "document_b64": "base64_encoded_document_content",
    "file_extension": "pdf"
}
```

Example: CNPJ Card - Legal Person

```json title='Request Body'
{
    "type": "cnpj_card",
    "document_b64": "base64_encoded_document_content",
    "file_extension": "pdf",
    "document_data": {
        "document_type": "CNPJ",
        "issuer_entity": "RFB"
    }
}
```

Example: Financial Statements - Legal Person

```json title='Request Body'
{
    "type": "financial_statements",
    "document_b64": "base64_encoded_document_content",
    "file_extension": "pdf"
}
```

Example: Proof of Residence

```json title='Request Body'
{
    "type": "proof_of_residence",
    "document_b64": "base64_encoded_document_content",
    "file_extension": "pdf"
}
```

### Body params
| Field                             | Type     | Description                                                                  | Characters   | Required |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|----------|
| `type`                            | string   | Identification document type                                                |   1  - 50    |    Yes   |
| `document_b64`                    | string   | Base 64 of the document                                                     |      -       |    Yes   |
| `file_extension`                  | string   | File extension (pdf, png, jpeg)                                            |   1  - 10    |    Yes   |
| `document_data`                   | object   | Object containing the document identification information                    |      -       |    No    |

### Document Type {#document-type}
| Enumerator                        | Description                                                                  | Supported Extensions        |
|-----------------------------------|------------------------------------------------------------------------------|-----------------------------|
| `cnh`                             | CNH                                                                          | pdf, jpeg                   |
| `rg`                              | RG                                                                           | pdf, jpeg                   |
| `rg_back`                         | Back of RG                                                                   | pdf, jpeg                   |
| `rg_front`                        | Front of RG                                                                  | pdf, jpeg                   |
| `proof_of_residence`              | Proof of residence                                                           | pdf, jpeg                   |
| `cnpj_card`                       | CNPJ Card                                                                    | pdf, jpeg                   |
| `social_contract`                 | Social Contract                                                              | pdf, jpeg        
| `company_statute`                 | Company Statute                                                              | pdf, jpeg                  |
| `board_election_record`           | Board Election Minutes                                                       | pdf, jpeg       
| `financial_statements`            | Financial Statements                                                         | pdf, jpeg                   |
| `investor_qualification_proof`    | Qualification Proof                                                          | pdf, jpeg                   |
| `power_of_attorney`               | Power of Attorney                                                            | pdf, jpeg                   |
| `billing_statement`               | Bill/Statement                                                               | pdf, jpeg                   |
| `fund_prospectus`                 | Investment Fund Bylaws                                                       | pdf, jpeg                   |

### Mandatory Documents

#### Natural Person
| Document                         | Description                                                                   | Required For                        |
|-----------------------------------|------------------------------------------------------------------------------|-------------------------------------|
| `cnh` or (`rg_front` + `rg_back`) or `rg` | Investor identification document                                            | All natural person investors        |
| `proof_of_residence`              | Proof of residence                                                           | All natural person investors        |

#### Legal Person - Regular
| Document                         | Description                                                                   | Required For                        |
|-----------------------------------|------------------------------------------------------------------------------|-------------------------------------|                                
| `financial_statements`            | Company financial statements                                                 | All                                 |
| `social_contract`                 | Company social contract                                                      | When applicable        
| `company_statute`                 | Company statute                                                              | When applicable        
| `board_of_election_records`       | Election minutes                                                             | When applicable                     |
| `investor_qualification_proof`    | Proof of qualification as qualified investor                                 | Qualified investor                  |

#### Legal Person - Investment Fund
| Document                         | Description                                                                   | Required For                        |
|-----------------------------------|------------------------------------------------------------------------------|-------------------------------------|
| `cnpj_card`                       | Document proving the fund's existence                                        | All                                 |
| `financial_statements`            | Financial statements                                                         | All                                 |
| `fund_prospectus`                 | Investment Fund Bylaws                                                       | All                                 |

### Response
```json title='Response Body'
{
    "document_key": "UUID"
}
```

---

# enviar_patrimonio

URL: /en/documentation/iaas/investidor/distribuicao_externa/enviar_patrimonio



---

# Enviar Resposta Suitability

URL: /en/documentation/iaas/investidor/distribuicao_externa/enviar_suitability

---
### Introdução
Este recurso tem como objetivo enviar a categoria suitability definida para o investidor.

### Input / Output:
Os dados cadastrais mudam de acordo com os dados passados na etapa de **Criar investidor**. Segue abaixo exemplos de quais dados devem ser enviados para cada variação.

Como ***output*** será entregue uma ***investor_key*** e uma ***investor_analysis_key***. A ***investor_analysis_key*** é utilizada para identificar a **análise cadastral** atualizada.
A ***investor_key*** é utilizada para identificar o **investidor** ao qual a **análise cadastral** pertence.

:::warning Atenção
 O envio do `suitability` é **opcional** para investidores que sejam Pessoa Jurídica enquadradas como qualificadas ou profissionais.
:::

### Request

ENDPOINT `/investor_registry/investor/{investor_key}/investor_analysis/{investor_analysis_key}/suitability`
MÉTODO `PUT`
STATUS `202`

Exemplo

```json title='Request Body'
{
   "profile": "bold"
}
```

### Body Params
| Campo               | Tipo     | Descrição                                            | Caracteres   | Obrigatório |
|---------------------|----------|------------------------------------------------------|--------------|-------------|
| `profile`              | string   | **[categoria suitability cadastrador](#profile)**                          |   1 - 255    |    Sim      |

### Profile {#profile}
| Enumerador          | Descrição                                            |
|---------------------|------------------------------------------------------|
| `bold`    | Arrojado                                        |
| `moderate`      | Moderado                                      |
| `conservative`           | Conservador            |

### Response
A análise cadastral atualizada é retornada no corpo da resposta.

---

# consultar_feedback

URL: /en/documentation/iaas/investidor/distribuicao_externa/feedback/consultar_feedback



---

# enviar_mensagem_feedback

URL: /en/documentation/iaas/investidor/distribuicao_externa/feedback/enviar_mensagem_feedback



---

# listar_feedbacks

URL: /en/documentation/iaas/investidor/distribuicao_externa/feedback/listar_feedbacks



---

# Introdução

URL: /en/documentation/iaas/investidor/distribuicao_externa/introducao

Esta seção descreve o fluxo de cadastro de investidores no contexto de **Distribuição Externa** — quando os investidores são captados por um distribuidor externo e aportam em produtos da QI Tech por meio dele — através da integração de distribuição externa (`distributor-integration`).

Embora o esqueleto do cadastro seja semelhante ao de um investidor padrão (dados cadastrais, contas bancárias, suitability, grupos de assinantes, partes relacionadas e investor owner quando aplicável), o vínculo com o distribuidor responsável é o que diferencia este fluxo dos demais.

Além disso, existem duas formas diferentes de criar investidores distribuídos externamente: uma com identificação do investidor e outra **PCO** (Por Conta e Ordem). Para o caso de investidores PCO, é necessário apenas o `POST` de criação do investidor e ele já estará apto a investir em todo o sistema.

:::warning Investor Owner
O sistema de cadastro de investidor trabalha com o conceito de investor-owner, que nada mais é do que um investidor que é "dono" de outro investidor. Os casos de uso para isso são investidores cadastrados como carteira administrada e fundos de investimento. Portanto, para fundos de investimento e investidores de carteira administrada é necessário que os gestores/administrador estejam devidamente identificados e atualizados dentro do sistema.
:::

### Fluxo de Cadastro — Investidor Identificado

1. Criar Investidor
criação inicial do investidor e abertura da primeira análise cadastral
↓
2. Enviar Dados Cadastrais
dados específicos da pessoa física ou jurídica
↓
3. Enviar Endereço
informações de endereço
↓
4. Enviar Patrimônio
informações de patrimônio e enquadramento
↓
5. Enviar Contas Bancárias
contas para movimentação
↓
6. Enviar Suitability
questionário de adequação ao perfil
↓
7. Enviar Grupos de Assinantes
definição de quem deve assinar os documentos
↓
8. Enviar Documentos do Investidor
upload de documentos obrigatórios
↓
9. Criar Partes Relacionadas
sócios, diretores, beneficiários finais
↓
10. Enviar Documentos das Partes Relacionadas
documentos de cada parte relacionada
↓
11. Enviar para Análise
submissão da análise cadastral para validação
↓
12. Assinar Documentos
assinatura dos documentos gerados após aprovação

### Fluxo de Cadastro — Por Conta e Ordem (PCO)

1. Criar Investidor
criação inicial do investidor — não há esteira cadastral adicional para PCO

Nas subseções a seguir veremos cada uma das etapas necessárias para concluir o cadastro de um investidor via Distribuição Externa e disparar a análise cadastral pela QI Tech.

---

# criar_investor_owner

URL: /en/documentation/iaas/investidor/distribuicao_externa/investor_owner/criar_investor_owner



---

# enviar_documento_investor_owner

URL: /en/documentation/iaas/investidor/distribuicao_externa/investor_owner/enviar_documento_investor_owner



---

# criar_parte_relacionada

URL: /en/documentation/iaas/investidor/distribuicao_externa/related_party/criar_parte_relacionada



---

# enviar_documento_parte_relacionada

URL: /en/documentation/iaas/investidor/distribuicao_externa/related_party/enviar_documento_parte_relacionada



---

# atualizacao_cadastral

URL: /en/documentation/iaas/investidor/fundo_de_investimento/atualizacao_cadastral



---

# busca_informacoes_de_uma_analise_cadastral_do_investidor

URL: /en/documentation/iaas/investidor/fundo_de_investimento/busca_informacoes_de_uma_analise_cadastral_do_investidor



---

# busca_informacoes_do_investidor

URL: /en/documentation/iaas/investidor/fundo_de_investimento/busca_informacoes_do_investidor



---

# buscar_documentos_para_assinatura

URL: /en/documentation/iaas/investidor/fundo_de_investimento/buscar_documentos_para_assinatura



---

# atualizar_status_conta_bancaria

URL: /en/documentation/iaas/investidor/fundo_de_investimento/contas_bancarias/atualizar_status_conta_bancaria



---

# definir_conta_principal

URL: /en/documentation/iaas/investidor/fundo_de_investimento/contas_bancarias/definir_conta_principal



---

# enviar_contas_bancarias

URL: /en/documentation/iaas/investidor/fundo_de_investimento/contas_bancarias/enviar_contas_bancarias



---

# Create investor / investor analysis

URL: /en/documentation/iaas/investidor/fundo_de_investimento/criar_investidor

---

### Introduction
This resource aims to inform us of basic data to start the **registry analysis** of an investor. 
There are 2 types of **registry analysis**: **natural person** and **legal person**. Legal persons, in turn, have ***sub types***, which are used to distinguish the necessary information during registration.

:::info Information
In the Sandbox environment, we have the following rule for approvals: CPF/CNPJ starting with 1: Automatic rejection; CPF/CNPJ starting with 8: Pending Manual Validation; The rest are automatically approved. 
:::

### Registration Flow

Legal person investor registration follows these steps:

1. **Create Investor** - Initial investor creation and registry analysis
2. **Send Registry Data** - Specific legal person data
3. **Send Address** - Address information
4. **Send Assets** - Net worth data
5. **Send Bank Accounts** - Bank account information
6. **Send Suitability** - Suitability questionnaire (mandatory for retail investors)
7. **Send Subscriber Groups** - Definition of subscriber groups
8. **Send Investor Documents** - Upload of mandatory documents
9. **Create Related Parties** - Registration of partners, directors, administrators, etc.
10. **Send Related Parties Documents** - Upload of related parties documents
11. **Send for Analysis** - Submission for registry analysis
12. **Sign Documents** - Document signing after approval

### Input / Output:
Each type of **registry analysis** expects a set of data as ***input***. Below are examples of how to initiate each of these flows.

As ***output***, an ***investor_key*** and an ***investor_analysis_key*** will be delivered. The ***investor_analysis_key*** is used to identify the created **registry analysis**.
The ***investor_key*** is used to identify the **investor** to which the **registry analysis** belongs.

Thus, a single ***investor_key*** (investor) can be associated with one or more ***investor_analysis_key*** (registry analysis).

Both the ***investor_key*** and the ***investor_analysis_key*** will be used in other endpoints that interact with the **investor** or with the **registry analysis**.

### Request

ENDPOINT `/investor_registry/v2/investor`
METHOD `POST`
STATUS `201`

### Request body
```json title='Request Body'
{
    "name": "string",
    "document_number": "xx.xxx.xxx/xxxx-xx",
    "person_type": "legal_person | natural_person",
    "person_sub_type": "regular | fund_class",
    "external_distribution_key": "campo livre",
    "email": "string",
    "phone": {
	    "international_dial_code": "+xx",
	    "area_code": "xx",
	    "number": "xxxxxxxxxx"
    }
}

```

:::warning Attention
Required fields change according to **person_type**.

- If **natural_person** (natural person):
    - The fields **name**, **document_number**, **person_type**, **email** and **phone** are mandatory

- If **legal_person** (legal person):
    - The fields **name**, **document_number**, **person_type**

- If **nominee** (PCO):
    - The fields **name**, **person_type**, **external_distribution_key** are mandatory

:::

:::info Information
The **registry_user** is the entity that represents the user who will fill in the investor's registry data.
In the case of **natural person**, the investor themselves fills in their registry data.
:::

Case 02: Register Legal Person

```json title='Request Body'
{
  "name": "Fundo XPTO", 
  "document_number": "12.456.789/0001-00", 
  "person_type": "legal_person",
  "person_sub_type": "regular",
  "registry_user": {
    "name": "José da Silva", 
    "document_number": "123.456.789-00",
    "email": "example@example.com",
    "phone": {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "1234567890"
    },
  }
}
```

### Body params
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `name`                            | string   | Investor name                                                                |   1  - 255   |    Yes      |
| `document_number`                 | string   | CPF or CNPJ                                                                  |   13 - 18    |    Yes      |
| `person_type`                     | string   | **[Person Type](#person_type)** enumerator                                  |      -       |    Yes      |
| `person_sub_type`                 | string   | **[Person Sub Type](#person_sub_type)** enumerator                          |      -       |    Yes      |
| `email`                           | string   | Email                                                                        |   1  - 255   |    No       |
| `phone`                           | JSON     | **[Phone](#phone)** object                                                   |      -       |    No       |
| `registry_user`                   | JSON     | **[Registry User](#registry_user)** object                                  |      -       |    No       |

### Phone
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `international_dial_code`         | string   | International code                                                           |   1  - 3     |    Yes      |
| `area_code`                       | string   | Area code                                                                    |      2       |    Yes      |
| `number`                          | string   | Phone number                                                                 |   8  - 9     |    Yes      |

### Registry User
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `name`                            | string   | Registry user name                                                           |   1  - 255   |    Yes      |
| `document_number`                 | string   | CPF                                                                          |   13    |    Yes      |
| `person_type`                     | string   | **[Person Type](#person_type)** enumerator                                  |      -       |    Yes      |
| `email`                           | string   | Email                                                                        |   1  - 255   |    Yes      |
| `phone`                           | JSON     | **[Phone](#phone)** object                                                   |      -       |    Yes      |

### Person Type
| Enumerator                        | Description                                                                  |
|-----------------------------------|------------------------------------------------------------------------------|
| `natural_person`                  | Natural person                                                               |
| `legal_person`                    | Legal person                                                                 |

### Person Sub Type
| Enumerator                        | Description                                                                  |
|-----------------------------------|------------------------------------------------------------------------------|
| `regular`                         | -                                                                            |
| `fund_class`                      | Investment fund                                                              |

### Response
```json title='Response Body'
{
    "investor_key": "UUID",
    "investor_analysis_key": "UUID"
}
```

---

# enviar_cadastro_para_analise

URL: /en/documentation/iaas/investidor/fundo_de_investimento/enviar_cadastro_para_analise



---

# Send Investor Registry Data

URL: /en/documentation/iaas/investidor/fundo_de_investimento/enviar_dados_cadastrais

---
### Introduction
This resource aims to inform us of the registry data related to the type of person that will compose the **registry analysis** of an investor.

### Input / Output:
As ***input***, specific registry data should be sent according to the investor type (`natural_person` or `legal_person`).

As ***output***, an ***investor_key*** and an ***investor_analysis_key*** will be delivered.

### Request

ENDPOINT `/investor_registry/v2/investor/{investor_key}/investor_analysis/{investor_analysis_key}/registry_data`
METHOD `PUT`
STATUS `202`

### Request body

Example: Send Natural Person Registry Data

```json title='Request Body'
{
    "name": "João da Silva",
    "email": "joao.silva@example.com",
    "phone": {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "1234567890"
    },
    "natural_person": {
        "birthdate": "1990-05-15",
        "gender": "male",
        "mother_name": "Maria da Silva",
        "nationality": "BRA",
        "place_of_birth": {
            "country": "BRA",
            "uf": "SP",
            "city": "São Paulo"
        },
        "marital_status": "single",
        "spouse": {
            "name": "Maria Santos",
            "document_number": "123.456.789-00"
        },
        "profession": "Engenheiro",
        "occupation": "Engenheiro de Software",
        "occupation_company": {
            "name": "Empresa XYZ Ltda",
            "document_number": "12.345.678/0001-90"
        }
    }
}
```

Example: Send Legal Person Registry Data

```json title='Request Body'
{
    "name": "Empresa XPTO Ltda",
    "email": "contato@empresaxpto.com.br",
    "phone": {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "1234567890"
    },
    "legal_person": {
        "legal_name": "Empresa XPTO Limitada",
        "constitution_date": "2020-01-15"
    }
}
```

### Body params
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `name`                            | string   | Investor name                                                                |   1  - 255   |    Yes      |
| `email`                           | string   | Investor email                                                               |   1  - 255   |    Yes      |
| `phone`                           | object   | **[Phone](#phone)** object                                                   |      -       |    Yes      |
| `natural_person`                  | object   | **[Natural Person](#natural-person)** object (required for natural person)  |      -       |    Yes*     |
| `legal_person`                    | object   | **[Legal Person](#legal-person)** object (required for legal person)        |      -       |    Yes*     |

\* `natural_person` is required when `person_type` is `natural_person`. `legal_person` is required when `person_type` is `legal_person`.

### Natural Person {#natural-person}
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `birthdate`                       | string   | Birth date (format: YYYY-MM-DD)                                              |      10      |    Yes      |
| `gender`                          | string   | Gender. **[Gender](#gender)** enumerator                                     |   1  - 6     |    No       |
| `mother_name`                     | string   | Mother's full name                                                           |   1  - 255   |    Yes      |
| `nationality`                     | string   | Nationality                                                                  |   1  - 255   |    Yes      |
| `place_of_birth`                  | object   | **[Place of Birth](#place-of-birth)** object                                |      -       |    Yes      |
| `marital_status`                  | string   | Marital status                                                               |   1  - 255   |    Yes      |
| `spouse`                          | object   | **[Spouse](#spouse)** object                                                 |      -       |    No       |
| `profession`                      | string   | Profession                                                                   |   1  - 255   |    Yes      |
| `occupation`                      | string   | Occupation                                                                   |   1  - 255   |    Yes      |
| `occupation_company`              | object   | **[Occupation Company](#occupation-company)** object                        |      -       |    No       |

### Gender {#gender}
| Enumerator                        | Description                                                                  |
|-----------------------------------|------------------------------------------------------------------------------|
| `male`                            | Male                                                                         |
| `female`                          | Female                                                                       |

### Place of Birth {#place-of-birth}
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `country`                         | string   | Country                                                                      |      -       |    No       |
| `uf`                              | string   | State (UF)                                                                   |      -       |    No       |
| `city`                            | string   | City                                                                         |      -       |    No       |

### Spouse {#spouse}
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `name`                            | string   | Spouse's full name                                                           |   1  - 255   |    Yes      |
| `document_number`                 | string   | Spouse's CPF or CNPJ (format: XXX.XXX.XXX-XX or XX.XXX.XXX/XXXX-XX)         |      14      |    Yes      |

### Occupation Company {#occupation-company}
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `name`                            | string   | Company name                                                                 |   1  - 255   |    Yes      |
| `document_number`                 | string   | Company CNPJ (format: XX.XXX.XXX/XXXX-XX)                                   |      18      |    Yes      |

### Legal Person {#legal-person}
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `legal_name`                      | string   | Company legal name                                                           |   1  - 255   |    Yes      |
| `constitution_date`                | string   | Company constitution date (format: YYYY-MM-DD)                              |      10      |    Yes      |

### Phone {#phone}
| Field                             | Type     | Description                                                                  | Characters   | Required    |
|-----------------------------------|----------|------------------------------------------------------------------------------|--------------|-------------|
| `international_dial_code`         | string   | International dial code                                                      |   1  - 3     |    Yes      |
| `area_code`                       | string   | Area code                                                                    |      2       |    Yes      |
| `number`                          | string   | Phone number                                                                 |   8  - 9     |    Yes      |

### Response
```json title='Response Body'
{
    "investor_key": "UUID",
    "investor_analysis_key": "UUID"
}
```

---

---

# consultar_feedback

URL: /en/documentation/iaas/investidor/fundo_de_investimento/feedback/consultar_feedback



---

# enviar_mensagem_feedback

URL: /en/documentation/iaas/investidor/fundo_de_investimento/feedback/enviar_mensagem_feedback



---

# listar_feedbacks

URL: /en/documentation/iaas/investidor/fundo_de_investimento/feedback/listar_feedbacks



---

# Introdução

URL: /en/documentation/iaas/investidor/fundo_de_investimento/introducao

Esta seção descreve o fluxo de cadastro de investidores do tipo **Fundo de Investimento** — veículos com CNPJ próprio (FIMs, FIAs, FIDCs e demais classes) que aplicam recursos em nome de seus cotistas.

Por se tratar de um veículo, o cadastro contempla os dados do fundo, do seu *investor owner* (administrador/gestor responsável) e das demais entidades exigidas pela análise cadastral. O envio de `suitability` **não** é necessário para este tipo de investidor.

O tipo de integração utilizada para esse tipo de cadastro de investidor é a `investor-integration`, descrita na seção de introdução da documentação. Para cadastrar um investidor através de uma gestora ou administradora é necessário que o cadastro da gestora esteja atualizado, o que pode ser garantido e mantido através da mesma integração de investidor. Dessa forma, a gestora pode realizar sua atualização cadastral através da API de cadastro de investidores, bem como a manutenção de seus próprios fundos enquanto investidores.

Um ponto muito importante é que apenas gestoras e administradoras que estiverem com seus cadastros atualizados podem realizar o cadastro de fundos de investimento. Portanto, é necessário realizar essa manutenção cadastral.

### Fluxo de Cadastro

1. Criar Investidor
criação inicial do investidor e abertura da primeira análise cadastral
↓
2. Enviar Dados Cadastrais
dados específicos do fundo de investimento
↓
3. Enviar Contas Bancárias
contas para movimentação
↓
4. Criar Partes Relacionadas
investidores exclusivos (quando aplicável)
↓
5. Enviar Documentos das Partes Relacionadas
documentos de cada investidor exclusivo
↓
6. Enviar para Análise
submissão da análise cadastral para validação
↓
7. Assinar Documentos
assinatura dos documentos gerados após aprovação

Nas subseções a seguir veremos cada uma das etapas necessárias para concluir o cadastro de um Fundo de Investimento e disparar a análise cadastral pela QI Tech.

---

# criar_parte_relacionada

URL: /en/documentation/iaas/investidor/fundo_de_investimento/related_party/criar_parte_relacionada



---

# enviar_documento_parte_relacionada

URL: /en/documentation/iaas/investidor/fundo_de_investimento/related_party/enviar_documento_parte_relacionada



---

# Recuperando Informações da Posição do Investidor

URL: /en/documentation/iaas/investidor/informacoes_posicao_investidor

---

### Request

ENDPOINT /quota/investor/INVESTOR_KEY/investor_positions
METHOD GET

### Responses

STATUS 200

Caso 01: Investidor com Posição em somente uma série de COTA ÚNICA
```json
{
    "data": [
        {
            "investor": {
                "distributor": {
                    "distributor_key": "UUID",
                    "document_number": "00.000.000/0000-00",
                    "name": "SAMPLE DISTRIBUTOR NAME",
                    "account_data": {
                        "owner": {
                            "name": "SAMPLE DISTRIBUTOR NAME",
                            "document_number": "00.000.000/0000-00"
                        },
                        "account_digit": "0",
                        "account_branch": "0000",
                        "account_number": "00000",
                        "financial_institution_code": "000",
                        "financial_institution_ispb": "00000000"
                    }
                },
                "investor_key": "UUID",
                "document_number": "00.000.000/0000-00",
                "name": "SAMPLE INVESTOR NAME",
                "person_type": "natural_person / legal_person / fund_class",
                "account_data": {
                    "account_digit": "0",
                    "account_branch": "0000",
                    "account_number": "00000",
                    "financial_institution_code": "000",
                    "financial_institution_ispb": "00000000"
                },
                "investor_sub_type": "person / financial_institution"
            },
            "total_net_worth": 0.00,
            "total_number_of_quotas": 0.00000000000000,
            "investor_position_key": "UUID",
            "issuance_serie": {
                "name": "1",
                "cetip_code": "0000000UN1",
                "start_date": "YYYY-MM-DD",
                "maturity_date": "YYYY-MM-DD",
                "original_quota_value": 0.00000000000000,
                "remuneration_type": "residual",
                "investment_category": "fidc / multi_market",
                "condominum_type": "open_ended / close_ended",
                "tax_classification": "short_term / long_term",
                "investment_restriction_type": "just_professional",
                "issuance_serie_key": "UUID",
                "minimum_share_capital": 0.0,
                "accounting_date": "YYYY-MM-DD",
                "sub_class": {
                    "name": "COTA ÚNICA",
                    "sub_class_key": "UUID",
                    "subordination_level": 0,
                    "fund_class": {
                        "name": "SAMPLE FUND CLASS NAME",
                        "fund_class_key": "UUID",
                        "document_number": "00.000.000/0000-00"
                    }
                }
            }
        },
    ],
    "limit": 50,
    "page": 0,
    "is_last_page": true
}
```

Caso 02: Investidor com Posição em somente uma série de COTA SÊNIOR
```json
{
    "data": [
        {
            "investor": {
                "distributor": {
                    "distributor_key": "UUID",
                    "document_number": "00.000.000/0000-00",
                    "name": "SAMPLE DISTRIBUTOR NAME",
                    "account_data": {
                        "owner": {
                            "name": "SAMPLE DISTRIBUTOR NAME",
                            "document_number": "00.000.000/0000-00"
                        },
                        "account_digit": "0",
                        "account_branch": "0000",
                        "account_number": "00000",
                        "financial_institution_code": "000",
                        "financial_institution_ispb": "00000000"
                    }
                },
                "investor_key": "UUID",
                "document_number": "00.000.000/0000-00",
                "name": "SAMPLE INVESTOR NAME",
                "person_type": "natural_person / legal_person / fund_class",
                "account_data": {
                    "account_digit": "0",
                    "account_branch": "0000",
                    "account_number": "00000",
                    "financial_institution_code": "000",
                    "financial_institution_ispb": "00000000"
                },
                "investor_sub_type": "person / financial_institution"
            },
            "total_net_worth": 0.00,
            "total_number_of_quotas": 0.00000000000000,
            "investor_position_key": "UUID",
            "issuance_serie": {
                "name": "1",
                "cetip_code": "0000000SN1",
                "start_date": "YYYY-MM-DD",
                "maturity_date": "YYYY-MM-DD",
                "original_quota_value": 0.00000000000000,
                "remuneration_type": "yield_curve",
                "interest_rate_type": "post_fixed",
                "pre_fixed": {
                    "calendar_base": "workdays / calendar_360 / calendar_365",
                    "monthly_rate": 0.00000000000000
                },
                "post_fixed": {
                    "calendar_base": "workdays / calendar_360 / calendar_365",
                    "indexer": "di / ipca",
                    "rate": 1,
                    "lag": {"reference": "daily / monthly", "amount": 1},
                },
                "investment_category": "fidc / multi_market",
                "condominum_type": "open_ended / close_ended",
                "tax_classification": "short_term / long_term",
                "investment_restriction_type": "just_professional",
                "issuance_serie_key": "UUID",
                "minimum_share_capital": 0.0,
                "accounting_date": "YYYY-MM-DD",
                "sub_class": {
                    "name": "COTA SÊNIOR",
                    "sub_class_key": "UUID",
                    "subordination_level": 1,
                    "fund_class": {
                        "name": "SAMPLE FUND CLASS NAME",
                        "fund_class_key": "UUID",
                        "document_number": "00.000.000/0000-00"
                    }
                }
            }
        },
    ],
    "limit": 50,
    "page": 0,
    "is_last_page": true
}
```

Caso 03: Investidor com Posição em duas uma séries, uma COTA SÊNIOR e uma COTA SUBORDINADA
```json
{
   "data":[
      {
         "investor":{
            "distributor":{
               "distributor_key":"UUID",
               "document_number":"00.000.000/0000-00",
               "name":"SAMPLE DISTRIBUTOR NAME",
               "account_data":{
                  "owner":{
                     "name":"SAMPLE DISTRIBUTOR NAME",
                     "document_number":"00.000.000/0000-00"
                  },
                  "account_digit":"0",
                  "account_branch":"0000",
                  "account_number":"00000",
                  "financial_institution_code":"000",
                  "financial_institution_ispb":"00000000"
               }
            },
            "investor_key":"UUID",
            "document_number":"00.000.000/0000-00",
            "name":"SAMPLE INVESTOR NAME",
            "person_type":"natural_person / legal_person / fund_class",
            "account_data":{
               "account_digit":"0",
               "account_branch":"0000",
               "account_number":"00000",
               "financial_institution_code":"000",
               "financial_institution_ispb":"00000000"
            },
            "investor_sub_type":"person / financial_institution"
         },
         "total_net_worth":0.00,
         "total_number_of_quotas":0.00000000000000,
         "investor_position_key": "UUID",
         "issuance_serie":{
            "name":"1",
            "cetip_code":"0000000SN1",
            "start_date":"YYYY-MM-DD",
            "maturity_date":"YYYY-MM-DD",
            "original_quota_value":0.00000000000000,
            "remuneration_type":"yield_curve",
            "interest_rate_type":"post_fixed",
            "pre_fixed":{
               "calendar_base":"workdays / calendar_360 / calendar_365",
               "monthly_rate":0.00000000000000
            },
            "post_fixed":{
               "calendar_base":"workdays / calendar_360 / calendar_365",
               "indexer":"di / ipca",
               "rate":1,
               "lag":{
                  "reference":"daily / monthly",
                  "amount":1
               }
            },
            "investment_category":"fidc / multi_market",
            "condominum_type":"open_ended / close_ended",
            "tax_classification":"short_term / long_term",
            "investment_restriction_type":"just_professional",
            "issuance_serie_key":"UUID",
            "minimum_share_capital":0.0,
            "accounting_date":"YYYY-MM-DD",
            "sub_class":{
               "name":"COTA SÊNIOR",
               "sub_class_key":"UUID",
               "subordination_level":1,
               "fund_class":{
                  "name":"SAMPLE FUND CLASS NAME",
                  "fund_class_key":"UUID",
                  "document_number":"00.000.000/0000-00"
               }
            }
         }
      },
      {
         "investor":{
            "distributor":{
               "distributor_key":"UUID",
               "document_number":"00.000.000/0000-00",
               "name":"SAMPLE DISTRIBUTOR NAME",
               "account_data":{
                  "owner":{
                     "name":"SAMPLE DISTRIBUTOR NAME",
                     "document_number":"00.000.000/0000-00"
                  },
                  "account_digit":"0",
                  "account_branch":"0000",
                  "account_number":"00000",
                  "financial_institution_code":"000",
                  "financial_institution_ispb":"00000000"
               }
            },
            "investor_key":"UUID",
            "document_number":"00.000.000/0000-00",
            "name":"SAMPLE INVESTOR NAME",
            "person_type":"natural_person / legal_person / fund_class",
            "account_data":{
               "account_digit":"0",
               "account_branch":"0000",
               "account_number":"00000",
               "financial_institution_code":"000",
               "financial_institution_ispb":"00000000"
            },
            "investor_sub_type":"person / financial_institution"
         },
         "total_net_worth":0.00,
         "total_number_of_quotas":0.00000000000000,
         "investor_position_key": "UUID",
         "issuance_serie":{
            "name":"1",
            "cetip_code":"0000000JR1",
            "start_date":"YYYY-MM-DD",
            "maturity_date":"YYYY-MM-DD",
            "original_quota_value":0.00000000000000,
            "remuneration_type":"residual",
            "investment_category":"fidc / multi_market",
            "condominum_type":"open_ended / close_ended",
            "tax_classification":"short_term / long_term",
            "investment_restriction_type":"just_professional",
            "issuance_serie_key":"UUID",
            "minimum_share_capital":0.0,
            "accounting_date":"YYYY-MM-DD",
            "sub_class":{
               "name":"COTA SUBORDINADA",
               "sub_class_key":"UUID",
               "subordination_level":0,
               "fund_class":{
                  "name":"SAMPLE FUND CLASS NAME",
                  "fund_class_key":"UUID",
                  "document_number":"00.000.000/0000-00"
               }
            }
         }
      }
   ],
   "limit":50,
   "page":0,
   "is_last_page":true
}
```

### Response Fields

| Campo         | Tipo   | Descrição                                                      |
|---------------|--------|----------------------------------------------------------------|
| `data`        | array  | Lista de objetos de **[Investor Position](#investor_position)**|
| `limit`       | int    | Limite de objetos recuperados por página                       |
| `page`        | int    | Número da página recuperada                                    |
| `is_last_page`| boolean| Informação que indica se a página recuperada é a última        |

### Investor Position
| Campo                    | Tipo   | Descrição                                             |
|--------------------------|--------|-------------------------------------------------------|
| `investor`               | JSON   | Objeto de **[Investor](#investor)**                   |
| `total_net_worth`        | float  | Patrimônio Líquido da posição do investidor           |
| `total_number_of_quotas` | float  | Número de cotas da posição do investidor              |
| `issuance_serie`         | JSON   | Objeto de **[Issuance Serie](#issuance_serie)**       |
| `investor_position_key`  | JSON   | Chave única de identificação da posição do investidor |

### Investor
| Campo                    | Tipo     | Descrição                                         | Caracteres |
|--------------------------|----------|---------------------------------------------------|------------|
| `name`                   | string   | Nome do investidor                                | até 255    |
| `investor_key`           | string   | Chave única de identificação do investidor        | 36         |
| `document_number`        | string   | CPF/CNPJ do investidor                            | 14 ou 18   |
| `person_type`            | string   | Pessoa Física / Pessoa Jurídica / Classe de Fundo | até 50     |
| `investor_sub_type`      | string   | Default / Instituição Financeira                  | até 50     |
| `distributor`            | JSON     | Objeto de **[Distributor](#distributor)**         |     -      |             
| `account_data`           | JSON     | Objeto de **[Account Data](#account_data)**       |     -      |

### Distributor
| Campo                    | Tipo     | Descrição                                         | Caracteres |
|--------------------------|----------|---------------------------------------------------|------------|
| `name`                   | string   | Nome do distribuidor                              | até 255    |
| `distributor_key`        | string   | Chave única de identificação do distribuidor      |     -      |             
| `document_number`        | string   | CPF/CNPJ do distribuidor                          | 14 ou 18   |
| `account_data`           | JSON     | Objeto de **[Account Data](#account_data)**       |     -      |

### Account Data
| Campo                        | Tipo     | Descrição                                                                   |
|------------------------------|----------|-----------------------------------------------------------------------------|
| `account_digit`              | string   | Dígito da conta bancária                                                    |
| `account_branch`             | string   | N° da agência da conta bancária                                             |             
| `account_number`             | string   | N° da conta bancária                                                        |
| `financial_institution_code` | string   | Código da instituição financeira                                            |
| `financial_institution_ispb` | string   | Identificador no Sistema de Pagamento Brasileiro da instituição financeira  |

### Issuance Serie
| Campo                         | Tipo     | Descrição                                         | Caracteres |
|-------------------------------|----------|---------------------------------------------------|------------|
| `name`                        | string   | Nome da série de emissão                          | até 255    |
| `issuance_serie_key`          | string   | Chave única de identificação da série de emissão  | 36         |
| `cetip_code`                  | string   | Código da série de emissão como ativo na CETIP    | 10         |             
| `start_date`                  | string   | Data de início da série de emissão                | 10         |
| `maturity_date`               | string   | Data de vencimento da série de emissão            | 10         |
| `original_quota_value`        | float    | Valor de cota original                            | -          |
| `remuneration_type`           | string   | Curva de rendimento / Residual                    | até 50     |
| `investment_category`         | string   | FIDC / Multimercado                               | até 50     |
| `condominum_type`             | string   | Aberto / Fechado                                  | até 50     |
| `tax_classification`          | string   | Curto prazo / Longo prazo                         | até 50     |
| `investment_restriction_type` | string   | Sem restrição / Qualificado / Profissional        | até 50     |
| `minimum_share_capital`       | float    | Valor mínimo para aplicação                       | -          |
| `accounting_date`             | string   | Data contábil da série de emissão                 | 10         |
| `sub_class`                   | JSON     | Objeto de **[Sub Class](#sub_class)**             | -          |

### Sub Class 
| Campo                         | Tipo     | Descrição                                         | Caracteres |
|-------------------------------|----------|---------------------------------------------------|------------|
| `name`                        | string   | Nome da sub classe                                | até 255    |
| `sub_class_key`               | string   | Chave única de identificação da sub classe        | 36         |
| `subordination_level`         | int      | Nível de subordinação da sub classe               | -          |             
| `fund_class`                  | JSON     | Objeto de **[Fund Class](#fund_class)**           | -          |

### Fund Class 
| Campo                         | Tipo     | Descrição                                         | Caracteres |
|-------------------------------|----------|---------------------------------------------------|------------|
| `name`                        | string   | Nome da classe de fundo                           | até 255    |
| `fund_class_key`              | string   | Chave única de identificação da classe de fundo   | 36         |
| `document_number`             | string   | CNPJ da classe de fundo                           | -          |

---

# Introduction

URL: /en/documentation/iaas/investidor/inicio

In this section we will explain the tools available to query information related to the Investor.

To access these services, contact the team at [integracao.dtvm@qitech.com.br](mailto:integracao.dtvm@qitech.com.br), so that the appropriate permissions can be granted, both in the Staging environment (Sandbox) and in the production environment.

### Investor Position Information

With this tool it is possible to retrieve a list of information about the investor's Investment Position, as described in: [5.8.2 Investor Position Information](/documentation/iaas/investidor/informacoes_posicao_investidor).

### Subscription Bulletin Information

With this tool it is possible to retrieve a list of information about the investor's subscription bulletins, as described in: [5.8.4 Subscription Bulletin Information](/documentation/iaas/passivo/controle_de_oferta/informacoes_boletins_de_subscricao).

---

# Settlement Insertion

URL: /en/documentation/iaas/liquidacao_ativos/ativos/

Endpoint to insert individual settlements into a previously created payment batch. Each settlement represents a payment (total or partial) for an asset in the fund's portfolio — such as installment settlement, amortization, repurchase, or interest payment.

:::info Settlement vs Repurchase
Both asset settlement and repurchase are performed through this endpoint. The `collection_origin_type` field differentiates the two operations:
- `borrower` — for **settlements** (payment made by the drawer/debtor).
- `assignor` — for **repurchases** (payment made by the assignor).
:::

:::tip Where am I in the flow?
This is the **2nd step** of the settlement flow. Before this step, you must have [created the payment batch](/documentation/iaas/liquidacao_ativos/lote_pagamento/criacao).
:::

## Request

ENDPOINT /settlement/fund_class/{fund_class_key}/payment_batch/{external_id}/settlement
METHOD POST

### Path params

| Parameter | Type | Description |
|---|---|---|
| `external_id` | string | The `external_id` of the payment batch where the settlement will be inserted. |

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

### Body attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `asset_type` | string | required | Asset type. See [`asset_type` enumerators](#asset_type-enumerators). Maximum 255 characters. |
| `total_value` | number | required | Total payment amount (two decimal places). |
| `external_id` | string | required | Unique identifier for this settlement in the integrating partner's system. Maximum 50 characters. |
| `settlement_type` | string | required | Settlement type. See [`settlement_type` enumerators](#settlement_type-enumerators). Maximum 50 characters. |
| `collection_origin_type` | string | optional | Determines whether the operation is a settlement (`borrower`) or repurchase (`assignor`). See [`collection_origin_type` enumerators](#collection_origin_type-enumerators). |
| `contract_number` | string | optional | Contract number associated with the asset. Maximum 50 characters. |
| `asset_external_id` | string | optional | Unique identifier for the asset in the system, provided during assignment. Maximum 50 characters. |
| `asset_key` | string | optional | Internal asset key at QI Tech (UUID, 36 characters). |
| `if_code` | string | optional | Financial instrument code (B3). Maximum 36 characters. |
| `participant_control_number` | string | optional | Participant control number provided during assignment. Maximum 50 characters. |
| `installment_number` | integer | optional | Installment number to be paid. Required for installment-based settlement types. |
| `installment_maturity_date` | string | optional | Installment maturity date in `YYYY-MM-DD` format. |
| `installment_external_id` | string | optional | External identifier for the installment. Maximum 50 characters. |
| `collection_date` | string | optional | Payment date in `YYYY-MM-DD` format. Field intended for integrator control. |

:::caution Attention
The fields `asset_external_id`, `contract_number`, and `asset_key` are alternative ways to identify the asset in the system. Provide **only one** of them — do not send multiple simultaneously.
:::

:::info Difference between external_id fields
The `external_id` field in the request body refers to the **settlement** identifier. The `external_id` field in the URL refers to the **payment batch** identifier.
:::

**`asset_type` enumerators:**

| Value | Description |
|---|---|
| `ccb` | Bank Credit Note (Cédula de Crédito Bancário) |
| `cce` | Export Credit Note (Cédula de Crédito à Exportação) |
| `structured_ccb` | Structured Bank Credit Note |
| `structured_cce` | Structured Export Credit Note |
| `structured_nce` | Structured Export Credit Certificate |
| `structured_cci` | Structured Real Estate Credit Note |
| `duplicata_mercantil` | Commercial Invoice |
| `duplicata_servicos` | Service Invoice |
| `discounted_contract` | Contract |

**`settlement_type` enumerators:**

| Value | Description |
|---|---|
| `asset_settlement` | Full asset settlement. |
| `asset_amortization` | Asset amortization (grace period). |
| `fine_payment` | Asset interest or late fee payment. |
| `installment_settlement` | Installment settlement. `installment_number` required. |
| `installment_amortization` | Installment amortization. `installment_number` required. |
| `installment_fine_payment` | Installment interest or late fee payment. `installment_number` required. |
| `gloss` | Installment write-off. `installment_number` required. |

**`collection_origin_type` enumerators:**

| Value | Description |
|---|---|
| `borrower` | Settlement — payment made by the drawer/debtor. |
| `assignor` | Repurchase — payment made by the assignor. |

## Response

STATUS 201

```json title="Response Body"
{
    "status": "validated",
    "total_value": 130.50,
    "external_id": "931e9437-d025-41ab-bb53-6b94e10fd361",
    "type": "installment_settlement",
    "settlement_key": "b2c3d4e5-f6a7-8901-abcd-ef1234567890",
    "installment_number": 1,
    "settlement_result": 0.0,
    "total_number_of_units": 1,
    "collection_origin_type": "borrower",
    "assets": [
        {
            "asset_key": "f34e9437-d025-41ab-bb53-6b94e10fd361",
            "number_of_units": 1,
            "present_value": 1250.00,
            "installment_face_value": 130.50
        }
    ]
}
```

### Response attributes

| Field | Type | Description |
|---|---|---|
| `status` | string | Settlement status. After successful insertion, returns `validated`. |
| `total_value` | number | Total payment amount. |
| `external_id` | string | External settlement key provided by the partner. |
| `type` | string | Settlement type. |
| `settlement_key` | string | Unique settlement identifier generated by QI Tech (UUID). |
| `installment_number` | integer | Installment number. Present when applicable. |
| `settlement_result` | number | Settlement result. Present when calculated. |
| `total_number_of_units` | integer | Total number of asset units affected by the settlement. |
| `collection_origin_type` | string | Collection origin type (`borrower` or `assignor`). Present when provided in the request. |
| `assets` | array | List of assets affected by the settlement. See [Assets attributes](#assets-attributes). |

#### Assets attributes

| Field | Type | Description |
|---|---|---|
| `asset_key` | string | Unique asset identifier (UUID). |
| `number_of_units` | integer | Number of asset units. |
| `present_value` | number | Current asset value in BRL. |
| `installment_face_value` | number | Installment face value. Present when applicable. |
| `installment_post_maturity_interest_value` | number | Post-maturity interest value for the installment. Present when applicable. |
| `installment_delay_interest_value` | number | Late interest value for the installment. Present when applicable. |
| `installment_delay_fine_value` | number | Late fine value for the installment. Present when applicable. |

## Possible errors

STATUS 404

**Payment batch not found**

The `external_id` of the batch provided in the URL does not match any batch registered for this fund. Verify that the identifier is correct.

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

STATUS 400

**Duplicate external_id settlement**

A settlement with the provided `external_id` already exists in this batch. Each settlement must have a unique identifier. Generate a new `external_id` and try again.

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

## Next steps

After inserting all desired settlements, the flow continues with:

1. **[Batch closure](/documentation/iaas/liquidacao_ativos/lote_pagamento/fechamento)** — signal that all settlements have been inserted so that processing can begin.

---

# Settlement Removal

URL: /en/documentation/iaas/liquidacao_ativos/ativos/remocao_liquidacoes

Endpoint to discard an individual settlement previously inserted into a payment batch. Only settlements in batches that have not yet been closed can be removed.

:::tip When to use
Use this endpoint when you need to remove an incorrect or unwanted settlement before [closing the batch](/documentation/iaas/liquidacao_ativos/lote_pagamento/fechamento). After the batch is closed, individual settlements cannot be removed.
:::

## Request

ENDPOINT /settlement/fund_class/{fund_class_key}/payment_batch/{external_id}/settlement/{settlement_external_id}
METHOD PUT

### Path params

| Parameter | Type | Description |
|---|---|---|
| `external_id` | string | The `external_id` of the payment batch. |
| `settlement_external_id` | string | The `external_id` of the settlement to be discarded. |

```json title="Request Body"
{
    "status": "discarded"
}
```

### Body attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `status` | string | required | New settlement status. To discard, send `discarded`. |

## Response

STATUS 200

```json title="Response Body"
{
    "external_id": "931e9437-d025-41ab-bb53-6b94e10fd361",
    "status": "discarded"
}
```

### Response attributes

| Field | Type | Description |
|---|---|---|
| `external_id` | string | External settlement key provided by the partner. |
| `status` | string | New settlement status: `discarded`. |

## Possible errors

STATUS 404

**Settlement not found**

The `settlement_external_id` provided in the URL does not match any settlement registered in this batch. Verify that the batch and settlement identifiers are correct.

```json
{
  "title": "Settlement not found",
  "description": "The Settlement with external_id {external_id} was not found",
  "translation": "A Liquidação com identificador externo {external_id} não foi encontrada",
  "code": "SET000011"
}
```

STATUS 400

**Invalid status**

The value provided in the `status` field is not valid. For removal, use only `discarded`.

```json
{
  "title": "Invalid status",
  "description": "The status given: {status} is not suported.",
  "translation": "O status: {status} não possui suporte.",
  "code": "SET000026"
}
```

STATUS 400

**Batch already closed**

The payment batch has already been closed and no longer allows changes to settlements. It is not possible to remove settlements from batches that have passed the `pending_settlements_insertion` status.

```json
{
  "title": "Payment Batch Status mismatch",
  "description": "Payment batch of key: {payment_batch_key} with status: {current} was expected to be: {expected}",
  "translation": "O lote de pagamento com chave: {payment_batch_key} e com status: {current} não passou, era esperado que fosse: {expected}",
  "code": "SET000016"
}
```

STATUS 400

**Incompatible settlement status**

The settlement is in a status that does not allow it to be discarded. Only settlements with `validated` status can be removed.

```json
{
  "title": "Settlement type mismatch",
  "description": "The settlement given has the status: {current_status} and was expected: {expected_status}",
  "translation": "A liquidação com status: {current_status} era esperado ter: {expected_status}",
  "code": "SET000024"
}
```

---

# Settlement Webhooks

URL: /en/documentation/iaas/liquidacao_ativos/ativos/webhook

Throughout the settlement processing, the system sends webhooks to notify the integrating partner about status changes for each individual settlement. All webhooks have the type `settlement.settlement_status_change` and identify the settlement by the `settlement_external_id` provided at creation.

:::info Webhook configuration
To receive webhooks, you must have a callback URL configured with QI Tech. Contact [integracao.dtvm@qitech.com.br](mailto:integracao.dtvm@qitech.com.br) to configure.
:::

## Statuses with webhook

The diagram below shows the three statuses that generate webhooks to the integrating partner:

```mermaid
graph LR
    A([validated]) -->|Successfully processed| B([settled])
    A -->|Discarded| C([discarded])
```

## Webhook structure

All settlement webhooks follow the same base structure:

| Field | Type | Description |
|---|---|---|
| `webhook_type` | string | Always `settlement.settlement_status_change`. |
| `webhook_datetime` | string | Event date and time in ISO 8601 format. |
| `data` | array | List with event data. See table below. |

#### Attributes of each object in `data`

Conditional fields are echoed directly from what was sent during settlement creation. The payload varies according to the `settlement_type` and the asset identification method used.

**Always present fields:**

| Field | Type | Description |
|---|---|---|
| `payment_batch_external_id` | string | The `external_id` of the payment batch. |
| `settlement_external_id` | string | The `external_id` of the settlement. |
| `settlement_status` | string | New settlement status. |
| `settlement_type` | string | Settlement type. |
| `total_value` | number | Total settlement amount in BRL. |
| `fund_class_document_number` | string | CNPJ of the associated fund. |
| `asset_key` | string | Internal asset key at QI Tech (UUID). |

**Asset identification — only one of the fields below will be present, according to what was provided at creation:**

| Field | Type | Description |
|---|---|---|
| `contract_number` | string | Contract number. Present if provided at creation. |
| `asset_external_id` | string | Asset `external_id` in the partner's system. Present if provided at creation. |

**Installment fields — present only for installment-based settlement types (`installment_settlement`, `installment_amortization`, `installment_fine_payment`, `gloss`):**

| Field | Type | Description |
|---|---|---|
| `installment_number` | integer | Installment number. |
| `installment_maturity_date` | string | Installment maturity date in `YYYY-MM-DD` format. Present when provided at creation. |
| `installment_external_id` | string | Installment `external_id`. Present when provided at creation. |

```json title="Standard webhook structure"
{
    "data": [
        {
            "payment_batch_external_id": "ac597f90-a13e-4f78-86f0-11c66f5fa6d6",
            "settlement_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
            "settlement_status": "STATUS",
            "settlement_type": "installment_settlement",
            "total_value": 130.50,
            "fund_class_document_number": "60.910.091/0001-24",
            "asset_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c",
            "contract_number": "0032226586/NNT",
            "installment_number": 3
        }
    ],
    "webhook_type": "settlement.settlement_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

## Events by status

### Settlement Completed

STATUS settled

Sent when the settlement is successfully processed and the amount has been properly reconciled in the fund's portfolio. This is the final status of a successful settlement — from this moment, the financial movement is effective.

```json title="Webhook Body"
{
    "data": [
        {
            "payment_batch_external_id": "ac597f90-a13e-4f78-86f0-11c66f5fa6d6",
            "settlement_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
            "settlement_status": "settled",
            "settlement_type": "installment_settlement",
            "total_value": 130.50,
            "fund_class_document_number": "60.910.091/0001-24",
            "asset_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c",
            "contract_number": "0032226586/NNT",
            "installment_number": 3
        }
    ],
    "webhook_type": "settlement.settlement_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

### Settlement Discarded

STATUS discarded

Sent when the settlement is discarded from the processing flow. Discarded settlements do not generate financial movement. There are three situations that cause this status:

1. **Manual removal before batch closure** — the integrating partner removes the settlement via the [settlement removal](/documentation/iaas/liquidacao_ativos/ativos/remocao_liquidacoes) endpoint while the batch is still open.
2. **Internal discard after review** — the QI Tech team discards a settlement that was under manual review (`pending_validation`), for example due to data inconsistency.
3. **Rejection** — during processing, the fund's portfolio returns a definitive rejection for a settlement with zero value. In these cases, the system determines that reprocessing the settlement would produce the same result and discards it.

```json title="Webhook Body"
{
    "data": [
        {
            "payment_batch_external_id": "ac597f90-a13e-4f78-86f0-11c66f5fa6d6",
            "settlement_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
            "settlement_status": "discarded",
            "settlement_type": "installment_settlement",
            "total_value": 130.50,
            "fund_class_document_number": "60.910.091/0001-24",
            "asset_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c",
            "contract_number": "0032226586/NNT",
            "installment_number": 3
        }
    ],
    "webhook_type": "settlement.settlement_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

---

# Asset Settlement Flow

URL: /en/documentation/iaas/liquidacao_ativos/fluxo_liquidacao

This page provides a holistic view of the asset settlement flow for assets already in the fund's portfolio: from payment batch creation to settlement completion and portfolio update. Follow the evolution of **batch statuses**, **individual settlement statuses**, and **webhooks** at each step.

:::tip How to use this flowchart
Hover over each step to see endpoint details and access the full documentation. The colored tracks show simultaneously what happens to the batch, each settlement, and which webhooks you will receive after processing.
:::

{`
.cf-legend{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:24px}
.cf-legend-item{display:flex;align-items:center;gap:6px;font-size:0.8rem;font-weight:600}
.cf-legend-dot{width:12px;height:12px;border-radius:3px}

.cf-step{position:relative;margin-bottom:4px}
.cf-step:not(:last-child)::after{content:'';display:block;width:2px;height:16px;margin:0 auto;background:var(--ifm-color-emphasis-300)}

.cf-card{border:1.5px solid var(--ifm-color-emphasis-200);border-radius:10px;padding:16px 20px;transition:box-shadow 0.2s,border-color 0.2s;cursor:pointer;background:var(--ifm-background-surface-color,var(--ifm-background-color))}
.cf-card:hover{box-shadow:0 4px 16px rgba(0,0,0,0.08);border-color:var(--ifm-color-primary)}

.cf-card-header{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.cf-num{width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:0.8rem;font-weight:800;color:#fff;flex-shrink:0}
.cf-num-int{background:#3b82f6}
.cf-num-qi{background:#8b5cf6}
.cf-num-ges{background:#d946ef}
.cf-title{font-size:1rem;font-weight:700;color:var(--ifm-font-color-base)}
.cf-actor{font-size:0.7rem;font-weight:700;padding:2px 8px;border-radius:12px;margin-left:auto}
.cf-actor-int{background:rgba(59,130,246,0.12);color:#2563eb}
.cf-actor-qi{background:rgba(139,92,246,0.12);color:#7c3aed}
.cf-actor-ges{background:rgba(217,70,239,0.12);color:#c026d3}
.cf-subtitle{font-size:0.82rem;color:var(--ifm-color-emphasis-700);margin-top:4px;margin-left:38px}

.cf-tracks{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;margin-left:38px}
.cf-track{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:6px;font-size:0.75rem;font-family:var(--ifm-font-family-monospace);border:1px solid}
.cf-track-lote{background:rgba(34,197,94,0.1);color:#16a34a;border-color:rgba(34,197,94,0.25)}
.cf-track-ativo{background:rgba(59,130,246,0.1);color:#2563eb;border-color:rgba(59,130,246,0.25)}
.cf-track-wh{background:rgba(245,158,11,0.1);color:#b45309;border-color:rgba(245,158,11,0.25)}
.cf-track-err{background:rgba(239,68,68,0.1);color:#dc2626;border-color:rgba(239,68,68,0.25)}
.cf-track-label{font-family:var(--ifm-font-family-base);font-weight:700;font-size:0.7rem;text-transform:uppercase;letter-spacing:0.03em}
.cf-new{font-weight:700}
.cf-unchanged{opacity:0.5}

.cf-details{max-height:0;overflow:hidden;opacity:0;transition:max-height 0.35s ease,opacity 0.25s ease,margin 0.3s ease;margin-left:38px}
.cf-card:hover .cf-details{max-height:300px;opacity:1;margin-top:14px;padding-top:12px;border-top:1px solid var(--ifm-color-emphasis-200)}

.cf-endpoint{font-family:var(--ifm-font-family-monospace);font-size:0.82rem;padding:8px 12px;border-radius:6px;background:var(--ifm-color-emphasis-100);margin-bottom:8px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.cf-method{font-weight:800;padding:2px 6px;border-radius:4px;font-size:0.72rem}
.cf-method-post{background:#f97316;color:#fff}
.cf-method-put{background:#3b82f6;color:#fff}
.cf-method-get{background:#22c55e;color:#fff}
.cf-desc{font-size:0.82rem;color:var(--ifm-color-emphasis-700);margin-bottom:8px}
.cf-link{font-size:0.82rem;font-weight:600;color:var(--ifm-color-primary);text-decoration:none}
.cf-link:hover{text-decoration:underline}

.cf-branch{margin-top:12px;margin-left:38px;display:flex;gap:12px;flex-wrap:wrap}
.cf-branch-path{flex:1;min-width:200px;border-radius:8px;padding:10px 14px;border:1.5px dashed}
.cf-branch-ok{border-color:rgba(34,197,94,0.4);background:rgba(34,197,94,0.05)}
.cf-branch-err{border-color:rgba(239,68,68,0.4);background:rgba(239,68,68,0.05)}
.cf-branch-label{font-size:0.78rem;font-weight:700;margin-bottom:4px}
.cf-branch-label-ok{color:#16a34a}
.cf-branch-label-err{color:#dc2626}

html[data-theme='dark'] .cf-track-lote{background:rgba(34,197,94,0.15);color:#4ade80;border-color:rgba(34,197,94,0.3)}
html[data-theme='dark'] .cf-track-ativo{background:rgba(59,130,246,0.15);color:#60a5fa;border-color:rgba(59,130,246,0.3)}
html[data-theme='dark'] .cf-track-wh{background:rgba(245,158,11,0.15);color:#fbbf24;border-color:rgba(245,158,11,0.3)}
html[data-theme='dark'] .cf-track-err{background:rgba(239,68,68,0.15);color:#f87171;border-color:rgba(239,68,68,0.3)}
html[data-theme='dark'] .cf-branch-ok{background:rgba(34,197,94,0.08)}
html[data-theme='dark'] .cf-branch-err{background:rgba(239,68,68,0.08)}
html[data-theme='dark'] .cf-actor-int{background:rgba(59,130,246,0.2);color:#60a5fa}
html[data-theme='dark'] .cf-actor-qi{background:rgba(139,92,246,0.2);color:#a78bfa}
html[data-theme='dark'] .cf-actor-ges{background:rgba(217,70,239,0.2);color:#e879f9}
`}

## Legend

Integration Agent
QI Tech (automatic)
Batch Status
Settlement Status
Webhook

## Flowchart

1
Payment batch creation
Integration Agent
Creates a batch with a unique identifier ( external_id ) per fund, with optional credit account and other metadata.
Batch: pending_settlements_insertion
POST /settlement/fund_class/{fund_class_key}/payment_batch
The batch is ready to receive settlements.
View full documentation →

2
Settlement insertion
Integration Agent
Inserts each settlement (installment, amortization, full settlement, etc.) into the batch. Repeat for all desired operations.
Batch: pending_settlements_insertion
Settlement: validated
POST /settlement/fund_class/{fund_class_key}/payment_batch/{external_id}/settlement
Each settlement receives status validated after successful insertion. No webhook is sent at this point; webhooks are sent after closure and processing.
View full documentation →

3
Settlement removal (optional)
Integration Agent
Before closing the batch, you can discard a settlement inserted by mistake. Only settlements with validated status can be removed.
Batch: pending_settlements_insertion
Settlement: validated
Removed a settlement
discarded
The settlement will not be included in processing.
Not applicable
Skip this step if you do not need to remove any settlement.
PUT /settlement/fund_class/{fund_class_key}/payment_batch/{external_id}/settlement/{settlement_external_id}
Body: {"status": "discarded"} . After batch closure, individual settlements cannot be removed.
View full documentation →

4
Batch closure
Integration Agent
Signals that all settlements have been inserted (and adjusted) and that processing can begin — or discards the entire batch.
Batch: pending_payment / discarded
Settlement: validated (or discarded)
Process batch
pending_payment
At least one settlement must be in the batch.
Discard batch
discarded
No settlements will be processed. Flow ended.
PUT /settlement/fund_class/{fund_class_key}/payment_batch/{external_id}
Send {"batch_status": "pending_payment"} to close and process, or {"batch_status": "discarded"} to discard the batch.
View full documentation →

5
Batch payment
QI Tech
QI Tech confirms the batch payment. Individual settlements are then processed and settlement webhooks are triggered.
Batch: paid
Webhook: payment_batch_status_change
Webhook settlement.payment_batch_status_change with status paid . Optionally, use the batch listing to monitor the batch.
GET /settlement/fund_class/{fund_class_key}/payment_batches
Optional query to track the batch by status or reference date.
Batch webhooks →

6
Settlement completion
QI Tech
Each successfully processed settlement is reconciled in the fund's portfolio. This is the final success status per settlement.
Settlement: settled
Webhook: settlement_status_change
Webhook settlement.settlement_status_change with settlement_status settled for each completed settlement (after batch payment).
View settlement webhook documentation →

---

## Webhook Summary

The table below consolidates all webhooks from the settlement API:

| # | Webhook Type | Status Field | Value | Point in Flow | Expected Action |
|---|---|---|---|---|---|
| 1 | `settlement.payment_batch_status_change` | `status` | `paid` | After batch payment confirmation (step 5) | From this event onward, settlements are processed and per-settlement webhooks begin to be sent. |
| 2 | `settlement.settlement_status_change` | `settlement_status` | `settled` | Per settlement, after successful processing (step 6) | Settlement completed and reconciled in the portfolio. |
| 3 | `settlement.settlement_status_change` | `settlement_status` | `discarded` | Per settlement, when discarded by manual removal, internal discard, or permanent portfolio rejection | Settlement will not be processed. No financial movement is generated. |
| 4 | `settlement.payment_batch_status_change` | `status` | `completed` | After all batch settlements reach a final status (`settled` or `discarded`) | The batch cycle is closed. All settlements have been processed. |
| 5 | `settlement.payment_batch_status_change` | `status` | `discarded` | When the batch is discarded (by partner request, automatic discard, or cash account cancellation failure) | No settlements in the batch will be processed. |

:::info Settlement Webhook Payload
The `settlement_status_change` webhook payload varies according to the data sent when creating the settlement:

- **Asset identification:** only one of the fields `contract_number` or `asset_external_id` will be present, depending on the identification method used during creation. Never both simultaneously.
- **Installment fields** (`installment_number`, `installment_maturity_date`, `installment_external_id`): present only for installment-based settlement types — `installment_settlement`, `installment_amortization`, `installment_fine_payment`, and `gloss`. Absent for full asset types (`asset_settlement`, `asset_amortization`, `fine_payment`).

For the complete payload structure, see [Payment Batch Webhooks](/documentation/iaas/liquidacao_ativos/lote_pagamento/webhook) and [Settlement Webhooks](/documentation/iaas/liquidacao_ativos/ativos/webhook).
:::

---

# Asset Settlement

URL: /en/documentation/iaas/liquidacao_ativos/inicio

This section documents the APIs that enable the Asset Settlement process for Investment Funds administered by QI CTVM. Through these APIs, it is possible to record installment payments, amortizations, repurchases, and other settlement events for assets in the fund's portfolio.

:::tip Context
The asset settlement described in this section applies exclusively to credit rights (CCBs, invoices, contracts, etc.) already included in the fund's portfolio. Treasury Bills, Debentures, and other fixed-income assets do not apply to this flow.
:::

:::info Prerequisites
- To access these services, contact [integracao.dtvm@qitech.com.br](mailto:integracao.dtvm@qitech.com.br) to enable access to the Sandbox (Staging) and Production environments.
- You will need the `fund_class_key` (fund key), which is part of the base URL for all endpoints in this API:

```
/settlement/fund_class/{fund_class_key}
```
:::

## Settlement Flow

The diagram below shows the main path, the branches and the resulting status of each step. Hover a node to see the endpoint and click to open its documentation.

<FlowDiagram
  columns={3}
  labels={{ you: 'Integrator', qitech: 'QI Tech', manager: 'Fund manager', docs: 'View documentation' }}
  nodes={[
    { id: 'criacao', row: 1, col: 2, actor: 'you', num: 1,
      title: 'Payment Batch Creation',
      status: 'pending_settlements_insertion',
      desc: 'Container for all settlements that will be processed together, identified by a unique external_id.',
      endpoint: { method: 'POST', path: '/settlement/fund_class/{fund_class_key}/payment_batch' },
      href: '/documentation/iaas/liquidacao_ativos/lote_pagamento/criacao' },

    { id: 'insercao', row: 2, col: 2, actor: 'you', num: 2,
      title: 'Settlement Insertion',
      status: 'settlement: validated',
      desc: 'One request per settlement, specifying asset type, amount, settlement type and identifiers.',
      endpoint: { method: 'POST', path: '.../payment_batch/{external_id}/settlement' },
      href: '/documentation/iaas/liquidacao_ativos/ativos' },

    { id: 'remocao', row: 2, col: 3, actor: 'you', tag: 'Optional',
      title: 'Removal of a settlement',
      status: 'settlement: discarded',
      desc: 'Discards a settlement inserted by mistake. Only possible while the batch has not been closed.',
      endpoint: { method: 'PUT', path: '.../settlement/{settlement_external_id}' },
      href: '/documentation/iaas/liquidacao_ativos/ativos/remocao_liquidacoes' },

    { id: 'encerramento', row: 3, col: 2, actor: 'you', num: 3,
      title: 'Batch Closure',
      desc: 'Sets batch_status. At least one settlement must have been inserted.',
      endpoint: { method: 'PUT', path: '.../payment_batch/{external_id}' },
      href: '/documentation/iaas/liquidacao_ativos/lote_pagamento/fechamento' },

    { id: 'descartado', row: 4, col: 1, actor: 'you', tone: 'end',
      title: 'Batch discarded',
      status: 'discarded',
      desc: 'No settlement is processed and no financial movement is generated. Flow terminated.' },

    { id: 'pago', row: 4, col: 2, actor: 'qitech',
      title: 'Batch payment confirmed',
      status: 'paid',
      desc: 'QI Tech confirms the payment. From this event onwards the individual settlements start being processed.',
      href: '/documentation/iaas/liquidacao_ativos/lote_pagamento/webhook' },

    { id: 'processa', row: 5, col: 2, actor: 'qitech',
      title: 'Processing of each settlement',
      status: 'settlement: settled',
      desc: "Each settlement is reconciled in the fund's portfolio and notified individually via webhook.",
      href: '/documentation/iaas/liquidacao_ativos/ativos/webhook' },

    { id: 'conciliada', row: 6, col: 2, actor: 'qitech', tone: 'ok',
      title: 'Fund portfolio reconciled',
      status: 'completed',
      desc: 'All settlements reached a final status and the batch cycle is closed.',
      href: '/documentation/iaas/liquidacao_ativos/lote_pagamento/webhook' },
  ]}
  edges={[
    { from: 'criacao', to: 'insercao' },
    { from: 'insercao', to: 'remocao', dashed: true },
    { from: 'insercao', to: 'encerramento' },
    { from: 'encerramento', to: 'descartado', label: 'discarded', tone: 'end' },
    { from: 'encerramento', to: 'pago', label: 'pending_payment', tone: 'ok' },
    { from: 'pago', to: 'processa', label: 'webhook' },
    { from: 'processa', to: 'conciliada', label: 'webhook' },
  ]}
/>

:::tip Full flow
For every status transition, the webhook payloads and the exception paths, see the [Asset Settlement Flow](/documentation/iaas/liquidacao_ativos/fluxo_liquidacao).
:::

## Step by Step

### 1. Payment Batch Creation

Create a payment batch with a unique identifier (`external_id`). The batch is the container for all settlements that will be processed together.

**[Access payment batch creation documentation](/documentation/iaas/liquidacao_ativos/lote_pagamento/criacao)**

### 2. Settlement Insertion

Add settlements to the created batch. Each settlement must be inserted individually, specifying the asset type, amount, settlement type, and required identifiers.

**[Access settlement insertion documentation](/documentation/iaas/liquidacao_ativos/ativos)**

While the batch has not been closed, a settlement inserted by mistake can be removed.

**[Access settlement removal documentation](/documentation/iaas/liquidacao_ativos/ativos/remocao_liquidacoes)**

### 3. Batch Closure

After inserting all settlements, close the batch to start internal processing. Cash reconciliation and portfolio update will be performed automatically. Alternatively, the same endpoint allows you to discard the entire batch — in that case no settlement is processed.

**[Access batch closure documentation](/documentation/iaas/liquidacao_ativos/lote_pagamento/fechamento)**

### 4. Tracking via Webhooks

Track progress through webhooks:
- **[Payment batch webhooks](/documentation/iaas/liquidacao_ativos/lote_pagamento/webhook)** — notifications about batch status.
- **[Settlement webhooks](/documentation/iaas/liquidacao_ativos/ativos/webhook)** — individual status notifications for each settlement.

:::info Automatic Processing
Cash reconciliation and portfolio update are performed automatically by the API after batch closure.
:::

---

# Payment Batch Creation

URL: /en/documentation/iaas/liquidacao_ativos/lote_pagamento/criacao

This is the **first step** of the asset settlement flow. Creating the payment batch reserves a grouping where the settlements to be processed will be inserted in subsequent steps.

:::info Prerequisites
Before creating a batch, you need the `fund_class_key` — the unique fund key in which assets will be settled. This key is part of the endpoint used throughout this API:

```
/settlement/fund_class/{fund_class_key}
```

For more details about the complete flow, see the [introduction page](/documentation/iaas/liquidacao_ativos/inicio).
:::

:::caution Attention
Each batch must have a **unique** `external_id` per fund. The system will not allow the creation of two batches with the same identifier.
:::

## Request

ENDPOINT /settlement/fund_class/{fund_class_key}/payment_batch
METHOD POST

```json title="Request Body"
{
    "external_id": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "description": "PAYMENTS - ABC - 2025-01-01",
    "account": {
        "account_number": "123456",
        "account_digit": "0",
        "account_branch": "0001",
        "financial_institution_code": "329"
    }
}
```

### Body attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `external_id` | string | required | Unique identifier for this batch in the integrating partner's system. Maximum 50 characters. |
| `description` | string | optional | Settlement batch description. Maximum 255 characters. |
| `account` | object | optional | Data of the account where the settlement will be credited. When not provided, the settlement will be generated in the fund's main account. See [Account attributes](#account-attributes). |
| `account_key` | string | optional | Key of the account where the settlement will be credited (UUID, 36 characters). Alternative to the `account` field. |
| `reference_date` | string | optional | Settlement reference date in `YYYY-MM-DD` format. |
| `end_to_end_id` | string | optional | End-to-end PIX identifier of the financial counterpart of the settlement. Maximum 32 characters. |
| `source_document_number` | string | optional | CPF or CNPJ of the financial counterpart of the settlement, with punctuation (e.g., `12.345.678/0001-90` or `123.456.789-00`). |

:::caution Attention
The `account` and `account_key` fields must not be passed simultaneously. If neither is provided, the settlement will be generated in the fund's main account. Account information must refer to an account belonging to the fund.
:::

#### Account attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `account_number` | string | required | Account number. Maximum 20 characters. |
| `account_digit` | string | required | Account check digit. 1 character. |
| `account_branch` | string | required | Account branch. Maximum 4 characters. |
| `financial_institution_code` | string | required | Financial institution code. Maximum 20 characters. |

## Response

STATUS 201

```json title="Response Body"
{
    "external_id": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "description": "PAYMENTS - ABC - 2025-01-01",
    "fund_class": {
        "name": "CREDIT RIGHTS INVESTMENT FUND",
        "manager": {
            "name": "EXAMPLE CAPITAL",
            "manager_key": "a7498c6c-1893-42ec-a8f3-bc6ad0c6b52c",
            "document_number": "45.585.471/0001-47"
        },
        "fund_class_key": "4b8377d0-58ec-479f-8ee9-9f963d5c47ad",
        "document_number": "60.910.091/0001-24"
    },
    "payment_batch_key": "63f0dbec-e9c4-4943-929e-1d47b9edbb0b",
    "status": "pending_settlements_insertion",
    "reference_date": "2025-01-01",
    "account_key": "5e621ba2-b4ac-4ddd-9893-82d220e1577e"
}
```

### Response attributes

| Field | Type | Description |
|---|---|---|
| `external_id` | string | The same external key provided in the request. |
| `description` | string | Batch description. |
| `fund_class` | object | Data of the fund associated with the batch. See [fund_class attributes](#fund_class-attributes). |
| `payment_batch_key` | string | Unique batch identifier generated by QI Tech (UUID). |
| `status` | string | Initial batch status. Always returns `pending_settlements_insertion`, indicating the batch is ready to receive settlements. |
| `reference_date` | string | Settlement reference date in `YYYY-MM-DD` format. |
| `account_key` | string | Key of the account associated with the batch (UUID). |

#### fund_class attributes

| Field | Type | Description |
|---|---|---|
| `name` | string | Fund name. |
| `manager` | object | Fund manager data. See [manager attributes](#manager-attributes). |
| `fund_class_key` | string | Unique fund key (UUID). |
| `document_number` | string | Fund CNPJ. |

#### manager attributes

| Field | Type | Description |
|---|---|---|
| `name` | string | Manager name. |
| `manager_key` | string | Unique manager key (UUID). |
| `document_number` | string | Manager CNPJ. |

## Possible errors

STATUS 404

**Fund not found**

The `fund_class_key` provided in the URL does not match any registered fund. Verify that the key is correct.

```json
{
  "title": "Fund Class not Found",
  "description": "Fund Class with key {fund_class_key} was not found.",
  "translation": "A Classe de Fundo com chave {fund_class_key} nao foi encontrado.",
  "code": "SET000005"
}
```

STATUS 409

**Duplicate External ID**

A batch with the provided `external_id` already exists. Each batch must have a unique identifier. Generate a new `external_id` and try again.

```json
{
  "title": "Payment batch external id already exists",
  "description": "The Payment Batch with external id {payment_batch_external_id} already exists",
  "translation": "O Lote de Pagamento com identificador externo {payment_batch_external_id} ja existe",
  "code": "SET000009"
}
```

STATUS 400

**Accounting date mismatch**

The batch is being created on a date different from the fund's current accounting date. Verify the fund's accounting date and try again.

```json
{
  "title": "Bad Request",
  "description": "Payment batch is being created in {accounting_date}, while fund is in {fund_class_accounting_date}",
  "translation": "Payment batch esta sendo criado em {accounting_date}, fundo esta em {fund_class_accounting_date}",
  "code": "SET000044"
}
```

STATUS 404

**Account not found**

The `account_key` provided does not match any registered account. Verify that the key is correct and that the account belongs to the fund.

```json
{
  "title": "Account not found",
  "description": "The account with key ({account_key}) was not found.",
  "translation": "A conta com chave({account_key}) não foi encontrada.",
  "code": "SET000009"
}
```

## Next steps

After creating the batch, the flow continues with:

1. **[Settlement insertion](/documentation/iaas/liquidacao_ativos/ativos)** — add settlements (installment payments, amortizations, etc.) to the batch.
2. **[Batch closure](/documentation/iaas/liquidacao_ativos/lote_pagamento/fechamento)** — signal that all settlements have been inserted so that processing can begin.

---

# Close Payment Batch Insertion

URL: /en/documentation/iaas/liquidacao_ativos/lote_pagamento/fechamento

After inserting all desired settlements into the batch, use this endpoint to signal that insertion is complete and processing can begin. You can also discard the entire batch.

:::tip Where am I in the flow?
This is the **3rd step** of the settlement flow. Before this step, you must have:
1. [Created the payment batch](/documentation/iaas/liquidacao_ativos/lote_pagamento/criacao)
2. [Inserted the settlements](/documentation/iaas/liquidacao_ativos/ativos)
:::

## Request

ENDPOINT /settlement/fund_class/{fund_class_key}/payment_batch/{external_id}
METHOD PUT

### Path params

| Parameter | Type | Description |
|---|---|---|
| `external_id` | string | The `external_id` provided when creating the batch. |

```json title="Request Body"
{
    "batch_status": "pending_payment"
}
```

### Body attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `batch_status` | string | required | Status to which the batch will be updated. See [enumerators](#batch_status-enumerators) below. |

**`batch_status` enumerators:**

| Value | Description |
|---|---|
| `pending_payment` | Closes insertion and starts batch processing. |
| `discarded` | Discards the entire batch. No settlements will be processed. |

## Response

STATUS 200

```json title="Response Body"
{
    "external_id": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "status": "pending_payment"
}
```

### Response attributes

| Field | Type | Description |
|---|---|---|
| `external_id` | string | External batch key provided by the partner. |
| `status` | string | New batch status. |

## Possible errors

STATUS 404

**Batch not found**

The `external_id` provided in the URL does not match any batch registered for this fund. Verify that the identifier is correct.

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

STATUS 400

**Invalid status**

The value provided in the `batch_status` field is not valid. Use only `pending_payment` or `discarded`.

```json
{
  "title": "Invalid status",
  "description": "The status given: {status} is not suported.",
  "translation": "O status: {status} não possui suporte.",
  "code": "SET000026"
}
```

STATUS 400

**Batch with no settlements**

You attempted to close the batch, but it has no settlements inserted yet. You must [insert at least one settlement](/documentation/iaas/liquidacao_ativos/ativos) before closing the batch.

```json
{
  "title": "Payment Batch with no settlement",
  "description": "Payment batch of external_id: {payment_batch_external_id} have no settlements to be settled",
  "translation": "O lote de pagamento com identificador: {payment_batch_external_id} não possui liquidações",
  "code": "SET000017"
}
```

## Next steps

After closing the batch, processing starts automatically. Track the result through webhooks:

1. **[Payment batch webhooks](/documentation/iaas/liquidacao_ativos/lote_pagamento/webhook)** — notification when the batch is paid.
2. **[Settlement webhooks](/documentation/iaas/liquidacao_ativos/ativos/webhook)** — individual notification for each processed settlement.

---

# Payment Batch Listing

URL: /en/documentation/iaas/liquidacao_ativos/lote_pagamento/listagem

Paginated query endpoint that returns payment batches for a given fund class. Use the available filters to search batches by status or reference date.

## Request

ENDPOINT /settlement/fund_class/{fund_class_key}/payment_batches
METHOD GET

### Query params

| Parameter | Type | Required | Description |
|---|---|---|---|
| `status` | string | optional | Filter by a specific batch status. See [status enumerators](#batch-status-enumerators). |
| `reference_date` | string | optional | Filter by reference date in `YYYY-MM-DD` format. |
| `page` | integer | optional | Page number (starts at 0). Default: `0`. |
| `limit` | integer | optional | Number of records per page. Default: `10`. Maximum: `50`. |

```python title="Example call"
GET /settlement/fund_class/{fund_class_key}/payment_batches?status=completed&reference_date=2025-01-01&page=0&limit=10
```

## Response

STATUS 200

```json title="Response Body"
{
    "data": [
        {
            "description": "SETTLEMENT BATCH 08/08",
            "fund_class": {
                "name": "CREDIT RIGHTS INVESTMENT FUND",
                "manager": {
                    "name": "EXAMPLE CAPITAL",
                    "manager_key": "a7498c6c-1893-42ec-a8f3-bc6ad0c6b52c",
                    "document_number": "45.585.471/0001-47"
                },
                "fund_class_key": "a3ecf74b-d280-4d3c-aefd-cb223dbf0451",
                "document_number": "60.910.091/0001-24"
            },
            "payment_batch_key": "50859e88-544c-4c79-a7aa-d373d90aa571",
            "status": "completed",
            "external_id": "5910209c-9cb5-4569-9069-f2dbc8060434",
            "reference_date": "2025-08-08",
            "account_key": "5e621ba2-b4ac-4ddd-9893-82d220e1577e",
            "total_value": 143.18
        }
    ],
    "limit": 10,
    "page": 0,
    "is_last_page": false
}
```

### Response attributes

| Field | Type | Description |
|---|---|---|
| `data` | array | List of payment batch objects. See table below. |
| `page` | integer | Current page number. |
| `limit` | integer | Number of records per page. |
| `is_last_page` | boolean | Indicates whether this is the last page of results. |

#### Attributes of each batch (objects within `data`)

| Field | Type | Description |
|---|---|---|
| `description` | string | Batch description. |
| `fund_class` | object | Data of the fund associated with the batch. See [fund_class attributes](/documentation/iaas/liquidacao_ativos/lote_pagamento/criacao#fund_class-attributes) on the Creation page. |
| `payment_batch_key` | string | Unique batch identifier (UUID). |
| `status` | string | Current batch status. See [status enumerators](#batch-status-enumerators) below. |
| `external_id` | string | External key provided by the partner. |
| `reference_date` | string | Reference date in `YYYY-MM-DD` format. |
| `account_key` | string | Key of the account associated with the batch (UUID). |
| `total_value` | number | Total value of batch settlements in BRL. May not be present if the batch has not yet been processed. |

## Batch status enumerators

| Status | Description |
|---|---|
| `pending_settlements_insertion` | Batch created, awaiting settlement insertion. |
| `pending_payment` | Batch closed, awaiting payment processing. |
| `paid` | Batch payment completed. |
| `completed` | Batch processing completed successfully. |
| `discarded` | Batch discarded. |

---

# Payment Batch Webhooks

URL: /en/documentation/iaas/liquidacao_ativos/lote_pagamento/webhook

Throughout the settlement flow, the system sends webhooks to notify the integrating partner about payment batch status changes. All webhooks have the type `settlement.payment_batch_status_change` and identify the batch by the `external_id` provided at creation.

:::info Webhook configuration
To receive webhooks, you must have a callback URL configured with QI Tech. Contact [integracao.dtvm@qitech.com.br](mailto:integracao.dtvm@qitech.com.br) to configure.
:::

## Statuses with webhook

The diagram below shows the three statuses that generate webhooks to the integrating partner:

```mermaid
graph LR
    A([paid]) -->|All settlements completed| B([completed])
    C([discarded])
```

## Webhook structure

All payment batch webhooks follow the same structure:

| Field | Type | Description |
|---|---|---|
| `webhook_type` | string | Always `settlement.payment_batch_status_change`. |
| `webhook_datetime` | string | Event date and time in ISO 8601 format. |
| `data` | object | Event data. See table below. |

#### `data` attributes

| Field | Type | Description |
|---|---|---|
| `external_id` | string | The batch `external_id` provided at creation. |
| `status` | string | New batch status. |
| `fund_class_document_number` | string | CNPJ of the fund associated with the batch. |

```json title="Standard webhook structure"
{
    "data": {
        "external_id": "57efbd9f-0917-4c79-9a43-bc8f1039fc78",
        "status": "STATUS",
        "fund_class_document_number": "60.910.091/0001-24"
    },
    "webhook_type": "settlement.payment_batch_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

## Events by status

### Batch Paid

STATUS paid

Sent when the batch payment is confirmed by QI Tech. From this point, individual settlements are processed in sequence and the respective [settlement webhooks](/documentation/iaas/liquidacao_ativos/ativos/webhook) are sent as each one is completed.

```json title="Webhook Body"
{
    "data": {
        "external_id": "57efbd9f-0917-4c79-9a43-bc8f1039fc78",
        "status": "paid",
        "fund_class_document_number": "60.910.091/0001-24"
    },
    "webhook_type": "settlement.payment_batch_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

### Batch Completed

STATUS completed

Sent when all batch settlements have reached a final status (`settled` or `discarded`). This is the terminal status of the batch after the successful completion of the settlement cycle. Upon receiving this event, the integrating partner can consider the batch fully processed.

```json title="Webhook Body"
{
    "data": {
        "external_id": "57efbd9f-0917-4c79-9a43-bc8f1039fc78",
        "status": "completed",
        "fund_class_document_number": "60.910.091/0001-24"
    },
    "webhook_type": "settlement.payment_batch_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

### Batch Discarded

STATUS discarded

Sent when the batch is discarded. This can occur by explicit request from the integrating partner at [batch closure](/documentation/iaas/liquidacao_ativos/lote_pagamento/fechamento), by automatic discard of open batches by QI Tech, or after cancellation with the cash account. No settlements associated with the batch will be processed after this status.

```json title="Webhook Body"
{
    "data": {
        "external_id": "57efbd9f-0917-4c79-9a43-bc8f1039fc78",
        "status": "discarded",
        "fund_class_document_number": "60.910.091/0001-24"
    },
    "webhook_type": "settlement.payment_batch_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

# Asset Creation — CCB

URL: /en/documentation/iaas/negociacao_recebiveis/asset/criacao_co

Endpoint to insert a **CCB** (Bank Credit Note) asset into an assignment batch. Each asset represents a credit operation that will be assigned to the fund.

:::tip Where am I in the flow?
This is the **2nd step** of the assignment flow. Before this, you must have [created the batch](/documentation/iaas/negociacao_recebiveis/assignment/criacao). After inserting assets, submit the required [documents](/documentation/iaas/negociacao_recebiveis/asset/documents) and [close the insertion](/documentation/iaas/negociacao_recebiveis/assignment/fechamento).
:::

:::caution Attention
The `external_id` field of the credit operation must be unique for each asset and must not be confused with the `external_id` of the batch.
:::

## Request

ENDPOINT /trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment/{assignment_external_id}/asset
METHOD POST

```json title="Request Body"
{
    "asset_type": "ccb",
    "total_purchase_value": 1351.66,
    "premiums": [
      {
        "premium_type": "spread",
        "total_value": 13.38
      }
    ],
    "credit_operation": {
      "contract": {
        "number": "0008309052/NBF",
        "disbursement_date": "2023-07-06",
        "issue_date": "2023-07-06",
        "signature_date": "2023-07-06",
        "issue_value": 1338.28
      },
      "amortization_type": "sac",
      "borrower": {
        "name": "QI CTVM",
        "document_number": "19.845.976/0001-93",
        "person_type": "legal_person",
        "email": "qidtvm@qitech.com.br",
        "address": {
          "street": "Pátio de Teixeira",
          "number": "1",
          "neighborhood": "Estrela do Oriente",
          "city": "Rondônia",
          "postal_code": "01012-030",
          "uf": "RO",
          "country": "BRA"
        },
        "phone": {
          "area_code": "11",
          "number": "936360268"
        },
        "legal_person": {
          "activity_code": "11.11-1-11"
        }
      },
      "delay": {
        "fine": {
          "fine_type": "percentage",
          "percentage_value": 0.0
        },
        "interest": {
          "method": "compound",
          "pre_fixed": {
            "monthly_rate": 0.0,
            "calendar_base": "calendar_360"
          }
        }
      },
      "principal_value": 1338.28,
      "interest_rate_type": "pre_fixed",
      "external_id": "ccf6f331-d55f-46c0-a32f-fb909884dbb2",
      "originator_document_number": "75.723.105/0001-78",
      "pre_fixed": {
        "calendar_base": "calendar_365",
        "monthly_rate": 0.018
      },
      "installments": [
        {
          "maturity_date": "2023-10-01",
          "installment_number": 1,
          "face_value": 689.33
        },
        {
          "maturity_date": "2024-10-01",
          "installment_number": 2,
          "face_value": 482.53
        },
        {
          "maturity_date": "2025-10-01",
          "installment_number": 3,
          "face_value": 300.36
        }
      ],
      "modality_code": "0202",
      "consignee": {
        "consignee_type": "inss",
        "name": "Consignee name",
        "document_number": "11.620.231/3105-71"
      },
      "collaterals": [
        {
          "collateral_type": "social_security",
          "benefit_number": "0000000000",
          "benefit_type": "benefit_type",
          "status": "reserved"
        }
      ]
    }
}
```

### Body attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `asset_type` | string | required | Asset type. For CCB, use `ccb`. |
| `total_purchase_value` | number | required | Total asset purchase value — the effective amount the assignee will pay. Up to 2 decimal places. |
| `premiums` | array | optional | List of premiums involved in the sale. Informational only — not used in calculations. |
| `credit_operation` | object | required | Credit operation data. See [credit_operation attributes](#credit_operation-attributes). |

#### `premiums` attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `premium_type` | string | required | Premium type. |
| `total_value` | number | required | Total premium value. Up to 2 decimal places. |

**`premium_type` enumerators:**

| Value | Description |
|---|---|
| `spread` | Spread linked to origination and credit issuance. |

#### `credit_operation` attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `external_id` | string | required | Unique identifier for this asset in the partner's system. Maximum 50 characters. |
| `originator_document_number` | string | required | Formatted CPF or CNPJ of the originator/consultant who facilitated the operation. |
| `principal_value` | number | required | Total outstanding principal of the operation. Up to 8 decimal places. |
| `contract` | object | required | Contract data. See [contract attributes](#contract-attributes). |
| `borrower` | object | required | Borrower/debtor data. See [borrower attributes](#borrower-attributes). |
| `amortization_type` | string | required | Amortization type used in calculation. |
| `interest_rate_type` | string | required | Operation interest rate type. |
| `pre_fixed` | object | required | Pre-fixed rate calculation data. See [pre_fixed attributes](#pre_fixed-attributes). |
| `installments` | array | required | List of operation installments. See [installments attributes](#installments-attributes). |
| `delay` | object | optional | Late fine and interest data. See [delay attributes](#delay-attributes). |
| `modality_code` | string | optional | 4-digit code specifying the category or type of financial operation associated with the asset. |
| `consignee` | object | optional | Consignee entity data. See [consignee attributes](#consignee-attributes). |
| `collaterals` | array | optional | List of collaterals associated with the operation. See [collaterals attributes](#collaterals-attributes). |

**`amortization_type` enumerators:**

| Value | Description |
|---|---|
| `sac` | SAC amortization type. |
| `price` | Price amortization type. |

**`interest_rate_type` enumerators:**

| Value | Description |
|---|---|
| `pre_fixed` | For pre-fixed rate operations. |
| `post_fixed` | For post-fixed rate operations. |

#### `contract` attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `number` | string | required | Contract number. Maximum 50 characters. |
| `disbursement_date` | string | required | Disbursement date in `YYYY-MM-DD` format. |
| `issue_date` | string | required | Issue date in `YYYY-MM-DD` format. |
| `signature_date` | string | optional | Contract signature date in `YYYY-MM-DD` format. |
| `issue_value` | number | required | Contract issue value. Up to 2 decimal places. |

#### `borrower` attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string | required | Borrower name. Maximum 255 characters. |
| `document_number` | string | required | Borrower CPF or CNPJ. |
| `person_type` | string | required | Person type. |
| `email` | string | optional | Borrower email. Maximum 255 characters. |
| `address` | object | required | Borrower address. See [address attributes](#address-attributes). |
| `phone` | object | optional | Borrower phone. See [phone attributes](#phone-attributes). |

**`person_type` enumerators:**

| Value | Description |
|---|---|
| `natural_person` | Individual. When set, include the `natural_person` object inside `borrower`. See [natural_person attributes](#natural_person-attributes). |
| `legal_person` | Legal entity. When set, include the `legal_person` object inside `borrower`. See [legal_person attributes](#legal_person-attributes). |

#### `address` attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `street` | string | required | Street address. If not all details are available, send the compiled information in this field. Maximum 255 characters. |
| `number` | string | optional | Address number. Maximum 40 characters. |
| `neighborhood` | string | optional | Neighborhood. Maximum 255 characters. |
| `city` | string | optional | City. Maximum 255 characters. |
| `uf` | string | optional | State abbreviation. 2 characters. |
| `complement` | string | optional | Complement. Maximum 255 characters. |
| `postal_code` | string | required | Postal code (CEP). 9 characters (with hyphen). |
| `country` | string | optional | Country in ISO 3166-1 alpha-3 format. 3 characters. |

#### `phone` attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `area_code` | string | required | Area code (DDD). 2 digits. |
| `number` | string | required | Phone number. Up to 9 digits. |

#### `natural_person` attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `birthdate` | string | optional | Date of birth in `YYYY-MM-DD` format. |
| `gender` | string | optional | Gender. |
| `mother_name` | string | optional | Mother's name. Maximum 255 characters. |

**`gender` enumerators:**

| Value | Description |
|---|---|
| `male` | Male. |
| `female` | Female. |

#### `legal_person` attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `foundation_date` | string | optional | Foundation date in `YYYY-MM-DD` format. |
| `activity_code` | string | required | Activity code in `11.11-1-11` format. |
| `annual_revenues` | integer | optional | Annual revenue in cents. |
| `representatives` | array | optional | List of legal representatives. See [representatives attributes](#representatives-attributes). |

#### `representatives` attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string | required | Representative name. Maximum 255 characters. |
| `document_number` | string | required | Representative CPF or CNPJ. |
| `email` | string | optional | Representative email. Maximum 255 characters. |
| `phone` | object | optional | Phone. Same structure as [phone attributes](#phone-attributes). |
| `address` | object | optional | Address. Same structure as [address attributes](#address-attributes). |
| `person_type` | string | required | Person type (`natural_person` or `legal_person`). |
| `representative_type` | string | optional | Representative type. Maximum 50 characters. |

#### `pre_fixed` attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `calendar_base` | string | required | Calculation base used. |
| `monthly_rate` | number | required | Monthly contract rate. For 1%, provide `0.01`. Up to 8 decimal places. |

**`calendar_base` enumerators:**

| Value | Description |
|---|---|
| `workdays` | Calculation base in business days (252). |
| `calendar_365` | Calculation base of 365 days. |
| `calendar_360` | Calculation base of 360 days. |

#### `installments` attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `maturity_date` | string | required | Installment maturity date in `YYYY-MM-DD` format. |
| `installment_number` | integer | required | Installment number. |
| `face_value` | number | optional | Installment face value. Up to 8 decimal places. |
| `principal_value` | number | optional | Expected principal to be amortized on the maturity date. Up to 8 decimal places. |

#### `delay` attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `fine` | object | optional | Late fine data. See [fine attributes](#fine-attributes). |
| `interest` | object | optional | Late interest data. See [interest attributes](#interest-attributes). |

#### `fine` attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `fine_type` | string | required | Fine type. |
| `percentage_value` | number | conditional | Fine value when `fine_type` is `percentage`. From 0 to 1, representing 0% to 100%. Up to 2 decimal places. |
| `amount` | number | conditional | Fixed fine amount when `fine_type` is `fixed`. Up to 2 decimal places. |

**`fine_type` enumerators:**

| Value | Description |
|---|---|
| `percentage` | Percentage fine on installment value. |
| `fixed` | Fixed fine amount. |

#### `interest` attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `method` | string | required | Late interest method. |
| `pre_fixed` | object | required | Pre-fixed rate data. Same structure as [pre_fixed attributes](#pre_fixed-attributes). |

**`method` enumerators:**

| Value | Description |
|---|---|
| `compound` | Compound late interest. |
| `simple` | Simple late interest. |

#### `consignee` attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string | required | Consignee entity name. Maximum 255 characters. |
| `document_number` | string | required | Consignee entity CPF or CNPJ. |
| `consignee_type` | string | required | Consignee type. |

**`consignee_type` enumerators:**

| Value | Description |
|---|---|
| `public` | Public consignee. |
| `private` | Private consignee. |
| `inss` | INSS (Social Security) consignee. |

#### `collaterals` attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `collateral_type` | string | required | Collateral type. |

**`collateral_type` enumerators:**

| Value | Description |
|---|---|
| `fgts` | FGTS (severance fund) collateral. Include [FGTS collateral attributes](#fgts-collateral-attributes). |
| `social_security` | INSS (social security) collateral. Include [INSS collateral attributes](#inss-collateral-attributes). |
| `home_equity` | Real estate collateral. Include [real estate collateral attributes](#real-estate-collateral-attributes). |

#### FGTS collateral attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `protocol_number` | string | required | Protocol number. |
| `status` | string | required | Collateral status. |

#### INSS collateral attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `benefit_number` | string | required | Benefit number. |
| `benefit_type` | string | required | Benefit type. |
| `status` | string | required | Collateral status. |

#### Real estate collateral attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `enterprise_name` | string | required | Enterprise name. |
| `registration_number` | string | required | Property registration number. |
| `enterprise_document_number` | string | optional | CPF or CNPJ associated with the enterprise. |
| `collateral_properties` | array | required | List of property attributes. See [collateral_properties attributes](#collateral_properties-attributes). |

#### `collateral_properties` attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `address` | object | required | Property address. Same structure as [address attributes](#address-attributes). |
| `total_collateral_value` | number | required | Property value. Up to 8 decimal places. |

## Response

STATUS 201

```json title="Response Body"
{
    "asset_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "external_id": "ccf6f331-d55f-46c0-a32f-fb909884dbb2",
    "status": "pending_eligibility"
}
```

### Response attributes

| Field | Type | Description |
|---|---|---|
| `asset_key` | string | Unique asset identifier generated by QI Tech (UUID). |
| `external_id` | string | The same external key provided in the `external_id` field of `credit_operation`. |
| `status` | string | Initial asset status. Always returns `pending_eligibility`, indicating the asset was inserted and awaits eligibility analysis. |

## Possible errors

STATUS 404

**Batch not found**

The `assignment_external_id` provided in the URL does not match any existing batch in this assignment configuration. Verify that the identifier is correct.

```json
{
  "title": "Assignment not found",
  "description": "Assignment not found",
  "translation": "Lote não encontrado",
  "code": "TRC000018"
}
```

STATUS 404

**Asset type does not exist**

The value provided in the `asset_type` field is not a valid type. Verify that the type is correct (e.g., `ccb`, `duplicata_mercantil`, `discounted_contract`).

```json
{
  "title": "Asset type does not exist",
  "description": "Asset type 'invalid_asset_type' does not exist",
  "translation": "Tipo do ativo 'invalid_asset_type' nao existe",
  "code": "TRC000015"
}
```

STATUS 400

**Asset type incompatible with batch**

The batch was configured to receive a different asset type than the one provided. Each assignment configuration accepts only one specific asset type. Verify the assignment configuration being used.

```json
{
  "title": "Invalid asset type configuration",
  "description": "This assignment can not receive this asset type: ccb",
  "translation": "Esse lote não pode receber esse tipo de ativo: ccb",
  "code": "TRC000025"
}
```

STATUS 400

**Batch closed for insertion**

The batch has already been closed for new asset insertion. After closure, no more assets can be added. If needed, [reopen the batch](/documentation/iaas/negociacao_recebiveis/asset/remocao_ativos) before inserting new assets.

```json
{
  "title": "Assignment is closed",
  "description": "Assignment is closed to insert new assets",
  "translation": "Lote esta fechado para inserir novos ativos",
  "code": "TRC000022"
}
```

STATUS 400

**Invalid document number**

One of the document numbers provided (CPF or CNPJ) is invalid. Verify the `document_number`, `originator_document_number`, and other document fields in the request body.

```json
{
  "title": "Invalid Document number",
  "description": "Given '000.000.000-00' document number is invalid.",
  "translation": "O numero de document '000.000.000-00' fornecido não é valido.",
  "code": "TRC000009"
}
```

STATUS 400

**Duplicate external_id**

An asset with the provided `external_id` already exists. Each asset must have a unique identifier. Generate a new `external_id` and try again.

```json
{
  "title": "Already Exist This External Id",
  "description": "Already exist an asset with this External Id",
  "translation": "Ja existe um ativo com esse External Id",
  "code": "TRC000054"
}
```

## Next steps

After inserting the asset, the flow continues with:

1. **[Document submission](/documentation/iaas/negociacao_recebiveis/asset/documents)** — send the required documentation for each asset approved in eligibility.
2. **[Insertion closure](/documentation/iaas/negociacao_recebiveis/assignment/fechamento)** — signal that all assets have been inserted so that the batch proceeds to eligibility analysis.

---

# Criação de Ativo — CTE

URL: /en/documentation/iaas/negociacao_recebiveis/asset/criacao_cte

Endpoint para inserir um ativo do tipo **CTE** (Conhecimento de Transporte Eletrônico) em um lote de cessão. O CTE é um documento fiscal eletrônico que comprova a prestação de serviço de transporte, utilizado como direito creditório na operação de cessão.

:::tip Onde estou no fluxo?
Este é o **2º passo** do fluxo de cessão. Antes, você deve ter [criado o lote](/documentation/iaas/negociacao_recebiveis/assignment/criacao). Após inserir os ativos, envie os [documentos](/documentation/iaas/negociacao_recebiveis/asset/documents) exigidos e [encerre a inserção](/documentation/iaas/negociacao_recebiveis/assignment/fechamento).
:::

:::caution Atenção
O campo `external_id` do direito creditório deve ser único para cada ativo e não deve ser confundido com o `external_id` do lote.
:::

## Request

ENDPOINT /trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment/{assignment_external_id}/asset
MÉTODO POST

```json title="Request Body"
{
    "asset_type": "cte",
    "total_purchase_value": 1231.21,
    "discounted_credit_right": {
        "external_id": "ccf6f331-d55f-46c0-a32f-fb909884dbb2",
        "originator_document_number": "46.282.154/0001-14",
        "maturity_date": "2023-12-10",
        "order_number": "18923619954796912",
        "face_value": 1023.01,
        "person_type": "legal_person",
        "borrower": {
            "name": "Transportadora Exemplo Ltda",
            "document_number": "46.282.154/0001-14",
            "person_type": "legal_person",
            "email": "contato@transportadora.com.br",
            "address": {
                "street": "Avenida Paulista",
                "number": "1000",
                "neighborhood": "Bela Vista",
                "city": "São Paulo",
                "postal_code": "01310-100",
                "uf": "SP",
                "country": "BRA"
            },
            "phone": {
                "area_code": "11",
                "number": "936360268"
            },
            "legal_person": {
                "activity_code": "49.30-2-01"
            }
        },
        "participant_control_number": "ICX841HWCPUGU4U101XPLDW8D",
        "bankslip": {
            "our_number": {
                "number": 2,
                "digit": "P"
            }
        },
        "delay": {
            "fine": {
                "fine_type": "percentage",
                "percentage_value": 0.0
            },
            "interest": {
                "method": "pre_fixed",
                "pre_fixed": {
                    "daily_rate": 0.0,
                    "calendar_base": "calendar_360"
                }
            }
        },
        "invoice": {
            "access_key": "35231146282154000114570000000001189236199547",
            "total_value": 1231.21,
            "serie": "001",
            "number": "958431587",
            "issue_date": "2023-10-10"
        }
    }
}
```

### Atributos do body

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `asset_type` | string | obrigatório | Tipo do ativo. Para CTE, informar `cte`. |
| `total_purchase_value` | number | obrigatório | Valor total da compra do ativo — efetivamente quanto o cessionário vai pagar. Até 2 casas decimais. |
| `discounted_credit_right` | object | obrigatório | Dados do direito creditório. Veja [Atributos de `discounted_credit_right`](#atributos-de-discounted_credit_right). |

#### Atributos de `discounted_credit_right`

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `external_id` | string | obrigatório | Chave única de identificação deste ativo no sistema do parceiro. Máximo de 50 caracteres. |
| `originator_document_number` | string | obrigatório | CPF ou CNPJ formatado do originador/consultor que viabilizou a operação. |
| `maturity_date` | string | obrigatório | Data de vencimento no formato `YYYY-MM-DD`. |
| `order_number` | string | obrigatório | Número do pedido. Máximo de 45 caracteres. |
| `face_value` | number | obrigatório | Valor de face. Até 8 casas decimais. |
| `person_type` | string | opcional | Tipo de pessoa do sacado (`natural_person` ou `legal_person`). |
| `borrower` | object | obrigatório | Dados do sacado. Consulte os [Atributos de `borrower`](#atributos-de-borrower). |
| `invoice` | object | obrigatório | Dados do CT-e. Veja [Atributos de `invoice`](#atributos-de-invoice). |
| `participant_control_number` | string | opcional | Número de controle do participante no sistema do parceiro. Máximo de 25 caracteres alfanuméricos. |
| `bankslip` | object | opcional | Dados do boleto. Veja [Atributos de `bankslip`](#atributos-de-bankslip). |
| `delay` | object | opcional | Dados de multa e juros por atraso. Veja [Atributos de `delay`](#atributos-de-delay). |

#### Atributos de `invoice`

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `access_key` | string | obrigatório | Chave de acesso do CT-e. 44 caracteres. Os caracteres de posição 20 a 22 devem corresponder ao modelo do documento (`57` ou `67`). |
| `total_value` | number | opcional | Valor total do CT-e. Até 2 casas decimais. |
| `serie` | string | obrigatório | Número de série do CT-e. Máximo de 3 caracteres. |
| `number` | string | obrigatório | Número do CT-e. Máximo de 9 caracteres. |
| `issue_date` | string | obrigatório | Data de emissão no formato `YYYY-MM-DD`. |

#### Atributos de `borrower`

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `name` | string | obrigatório | Nome do sacado. Máximo de 255 caracteres. |
| `document_number` | string | obrigatório | CPF ou CNPJ do sacado. |
| `person_type` | string | obrigatório | Tipo de pessoa. |
| `email` | string | opcional | E-mail do sacado. Máximo de 255 caracteres. |
| `address` | object | obrigatório | Endereço do sacado. Veja [Atributos de `address`](#atributos-de-address). |
| `phone` | object | opcional | Telefone do sacado. Veja [Atributos de `phone`](#atributos-de-phone). |

**Enumeradores de `person_type`:**

| Valor | Descrição |
|---|---|
| `natural_person` | Pessoa Física. Quando informado, incluir o objeto `natural_person` dentro de `borrower`. Veja [Atributos de `natural_person`](#atributos-de-natural_person). |
| `legal_person` | Pessoa Jurídica. Quando informado, incluir o objeto `legal_person` dentro de `borrower`. Veja [Atributos de `legal_person`](#atributos-de-legal_person). |

#### Atributos de `address`

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `street` | string | obrigatório | Logradouro. Caso não tenha todas as informações, enviar o compilado neste campo. Máximo de 255 caracteres. |
| `number` | string | opcional | Número do endereço. Máximo de 40 caracteres. |
| `neighborhood` | string | opcional | Bairro. Máximo de 255 caracteres. |
| `city` | string | opcional | Cidade. Máximo de 255 caracteres. |
| `uf` | string | opcional | Sigla do estado. 2 caracteres. |
| `complement` | string | opcional | Complemento. Máximo de 255 caracteres. |
| `postal_code` | string | obrigatório | CEP. 9 caracteres (com hífen). |
| `country` | string | opcional | País no formato ISO 3166-1 alpha-3. 3 caracteres. |

#### Atributos de `phone`

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `area_code` | string | obrigatório | Código de área (DDD). 2 dígitos. |
| `number` | string | obrigatório | Número de telefone. Até 9 dígitos. |

#### Atributos de `natural_person`

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `birthdate` | string | opcional | Data de nascimento no formato `YYYY-MM-DD`. |
| `gender` | string | opcional | Gênero. |
| `mother_name` | string | opcional | Nome da mãe. Máximo de 255 caracteres. |

**Enumeradores de `gender`:**

| Valor | Descrição |
|---|---|
| `male` | Masculino. |
| `female` | Feminino. |

#### Atributos de `legal_person`

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `foundation_date` | string | opcional | Data de fundação no formato `YYYY-MM-DD`. |
| `activity_code` | string | obrigatório | Código de atividade no formato `11.11-1-11`. |
| `annual_revenues` | integer | opcional | Receita anual em centavos. |
| `representatives` | array | opcional | Lista de representantes legais. Veja [Atributos de `representatives`](#atributos-de-representatives). |

#### Atributos de `representatives`

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `name` | string | obrigatório | Nome do representante. Máximo de 255 caracteres. |
| `document_number` | string | obrigatório | CPF ou CNPJ do representante. |
| `email` | string | opcional | E-mail do representante. Máximo de 255 caracteres. |
| `phone` | object | opcional | Telefone. Mesma estrutura de [Atributos de `phone`](#atributos-de-phone). |
| `address` | object | opcional | Endereço. Mesma estrutura de [Atributos de `address`](#atributos-de-address). |
| `person_type` | string | obrigatório | Tipo de pessoa (`natural_person` ou `legal_person`). |
| `representative_type` | string | opcional | Tipo do representante. Máximo de 50 caracteres. |

#### Atributos de `bankslip`

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `our_number` | object | opcional | Dados do nosso número. Aplicável apenas quando o nosso número é emitido pelo cliente. Veja [Atributos de `our_number`](#atributos-de-our_number). |

#### Atributos de `our_number`

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `number` | number | obrigatório | Nosso número. Número bancário para cobrança com registro. 1 a 11 caracteres numéricos. |
| `digit` | string | obrigatório | Dígito verificador de auto conferência do nosso número. 1 caractere alfanumérico. |

#### Atributos de `delay`

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `fine` | object | opcional | Dados da multa por atraso. Veja [Atributos de `fine`](#atributos-de-fine). |
| `interest` | object | opcional | Dados do juros de mora. Veja [Atributos de `interest`](#atributos-de-interest). |

#### Atributos de `fine`

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `fine_type` | string | obrigatório | Tipo da multa. |
| `percentage_value` | number | condicional | Valor da multa quando `fine_type` for `percentage`. De 0 a 1, representando 0% a 100%. Até 2 casas decimais. |
| `amount` | number | condicional | Valor fixo da multa quando `fine_type` for `fixed`. Até 2 casas decimais. |

**Enumeradores de `fine_type`:**

| Valor | Descrição |
|---|---|
| `percentage` | Multa percentual sobre o valor da parcela. |
| `fixed` | Valor fixo de multa. |

#### Atributos de `interest`

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `method` | string | obrigatório | Método do juros de mora. |
| `pre_fixed` | object | obrigatório | Dados da taxa pré-fixada. Veja [Atributos de `pre_fixed`](#atributos-de-pre_fixed). |

**Enumeradores de `method`:**

| Valor | Descrição |
|---|---|
| `compound` | Juros de mora composto. |
| `simple` | Juros de mora simples. |
| `pre_fixed` | Juros de mora pré-fixado. |

#### Atributos de `pre_fixed`

| Campo | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `daily_rate` | number | condicional | Taxa diária. Informar quando `method` for `pre_fixed`. Para 1%, informar `0.01`. Até 8 casas decimais. |
| `calendar_base` | string | obrigatório | Base de cálculo utilizada. |

**Enumeradores de `calendar_base`:**

| Valor | Descrição |
|---|---|
| `workdays` | Base de cálculo em dias úteis (252). |
| `calendar_365` | Base de cálculo em 365 dias. |
| `calendar_360` | Base de cálculo em 360 dias. |

## Response

STATUS 201

```json title="Response Body"
{
    "asset_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "external_id": "ccf6f331-d55f-46c0-a32f-fb909884dbb2",
    "status": "pending_eligibility"
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `asset_key` | string | Identificador único do ativo gerado pela QI Tech (UUID). |
| `external_id` | string | A mesma chave externa fornecida no campo `external_id` do `discounted_credit_right`. |
| `status` | string | Status inicial do ativo. Sempre retorna `pending_eligibility`, indicando que o ativo foi inserido e aguarda análise de elegibilidade. |

## Possíveis erros

STATUS 404

**Lote não encontrado**

O `assignment_external_id` informado na URL não corresponde a nenhum lote existente nesta configuração de cessão. Verifique se o identificador está correto.

```json
{
  "title": "Assignment not found",
  "description": "Assignment not found",
  "translation": "Lote não encontrado",
  "code": "TRC000018"
}
```

STATUS 404

**Tipo de ativo não existe**

O valor informado no campo `asset_type` não é um tipo válido. Verifique se o tipo está correto (ex: `cte`).

```json
{
  "title": "Asset type does not exist",
  "description": "Asset type 'invalid_asset_type' does not exist",
  "translation": "Tipo do ativo 'invalid_asset_type' nao existe",
  "code": "TRC000015"
}
```

STATUS 400

**Tipo de ativo incompatível com o lote**

O lote foi configurado para receber um tipo de ativo diferente do informado. Cada configuração de cessão aceita apenas um tipo de ativo específico. Verifique a configuração de cessão utilizada.

```json
{
  "title": "Invalid asset type configuration",
  "description": "This assignment can not receive this asset type: cte",
  "translation": "Esse lote não pode receber esse tipo de ativo: cte",
  "code": "TRC000025"
}
```

STATUS 400

**Lote fechado para inserção**

O lote já foi encerrado para inserção de novos ativos. Após o encerramento, não é possível adicionar mais ativos. Caso precise, [reabra o lote](/documentation/iaas/negociacao_recebiveis/asset/remocao_ativos) antes de inserir novos ativos.

```json
{
  "title": "Assignment is closed",
  "description": "Assignment is closed to insert new assets",
  "translation": "Lote esta fechado para inserir novos ativos",
  "code": "TRC000022"
}
```

STATUS 400

**Chave de acesso do CT-e ausente**

O campo `access_key` dentro de `invoice` é obrigatório para ativos do tipo `cte`. Inclua a chave de acesso do CT-e no request body.

```json
{
  "title": "Access Key Required",
  "description": "Access key is required for cte asset type",
  "translation": "Chave de acesso é obrigatória para o tipo de ativo cte",
  "code": "TRC000134"
}
```

STATUS 400

**Chave de acesso do CT-e inválida**

A `access_key` informada não corresponde a um CT-e válido. Os caracteres de posição 20 a 22 da chave de acesso devem ser `57` ou `67`, que identificam o modelo do documento fiscal CT-e.

```json
{
  "title": "Invalid CTE Access Key",
  "description": "Access key is not valid for a CTE document",
  "translation": "Chave de acesso não é válida para um documento CT-e",
  "code": "TRC000133"
}
```

STATUS 400

**External ID duplicado**

Já existe um ativo cadastrado com o `external_id` informado. Cada ativo deve ter um identificador único. Gere um novo `external_id` e tente novamente.

```json
{
  "title": "Already Exist This External Id",
  "description": "Already exist an asset with this External Id",
  "translation": "Ja existe um ativo com esse External Id",
  "code": "TRC000054"
}
```

## Próximos passos

Após inserir o ativo, o fluxo continua com:

1. **[Envio dos documentos](/documentation/iaas/negociacao_recebiveis/asset/documents)** — envie a documentação exigida para cada ativo aprovado na elegibilidade.
2. **[Encerramento da inserção](/documentation/iaas/negociacao_recebiveis/assignment/fechamento)** — sinalize que todos os ativos foram inseridos para que o lote siga para a análise de elegibilidade.

---

# Asset Creation — Discounted Contract

URL: /en/documentation/iaas/negociacao_recebiveis/asset/criacao_discounted_contract

Endpoint to insert a **Discounted Contract** asset into an assignment batch. This asset type represents a discounted credit right derived from an installment-based contract, where a single installment is linked to a source contract.

:::tip Where am I in the flow?
This is the **2nd step** of the assignment flow. Before this, you must have [created the batch](/documentation/iaas/negociacao_recebiveis/assignment/criacao). After inserting assets, submit the required [documents](/documentation/iaas/negociacao_recebiveis/asset/documents) and [close the insertion](/documentation/iaas/negociacao_recebiveis/assignment/fechamento).
:::

:::caution Attention
The `external_id` field of the credit right must be unique for each asset and must not be confused with the `external_id` of the batch.
:::

## Request

ENDPOINT /trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment/{assignment_external_id}/asset
METHOD POST

```json title="Request Body"
{
    "asset_type": "discounted_contract",
    "total_purchase_value": 1231.21,
    "discounted_credit_right": {
        "external_id": "ccf6f331-d55f-46c0-a32f-fb909884dbb2",
        "originator_document_number": "46.282.154/0001-14",
        "face_value": 1023.01,
        "maturity_date": "2023-12-10",
        "installment_number": 3,
        "borrower": {
            "name": "Natália Nascimento",
            "document_number": "805.359.140-08",
            "person_type": "natural_person",
            "email": "natalia.nascimento@yopmail.com",
            "address": {
                "street": "Gilberto Sabino",
                "number": "215",
                "neighborhood": "Pinheiros",
                "city": "São Paulo",
                "postal_code": "05425-020",
                "uf": "SP",
                "country": "BRA"
            },
            "phone": {
                "area_code": "11",
                "number": "36360268"
            },
            "natural_person": {
                "mother_name": "Lívia Santos",
                "birthdate": "2001-01-05"
            }
        },
        "contract": {
            "number_of_installments": 12,
            "total_face_value": 12276.12,
            "number": "CONTR-2023-00123",
            "issue_date": "2023-01-10"
        }
    }
}
```

### Body attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `asset_type` | string | required | Asset type. Must be `discounted_contract`. |
| `total_purchase_value` | number | required | Total asset purchase value — the effective amount the assignee will pay. Up to 2 decimal places. |
| `discounted_credit_right` | object | required | Credit right data. See [discounted_credit_right attributes](#discounted_credit_right-attributes). |

#### `discounted_credit_right` attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `external_id` | string | required | Unique identifier for this asset in the partner's system. Maximum 50 characters. |
| `originator_document_number` | string | required | Formatted CPF or CNPJ of the originator/consultant who facilitated the operation. |
| `face_value` | number | required | Face value of this installment. Up to 8 decimal places. |
| `maturity_date` | string | required | Installment maturity date in `YYYY-MM-DD` format. |
| `installment_number` | integer | required | Installment sequence number within the source contract. |
| `borrower` | object | required | Borrower data. See [borrower attributes](/documentation/iaas/negociacao_recebiveis/asset/criacao_co#borrower-attributes) on the CCB Asset Creation page. |
| `contract` | object | required | Source contract data. See [contract attributes](#contract-attributes). |

#### `contract` attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `number_of_installments` | integer | required | Total number of installments in the source contract. |
| `total_face_value` | number | required | Total face value of the source contract (sum of all installments). Up to 2 decimal places. |
| `number` | string | required | Contract number in the originator's system. Maximum 50 characters. |
| `issue_date` | string | required | Contract issue date in `YYYY-MM-DD` format. |

## Response

STATUS 201

```json title="Response Body"
{
    "asset_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "external_id": "ccf6f331-d55f-46c0-a32f-fb909884dbb2",
    "status": "pending_eligibility"
}
```

### Response attributes

| Field | Type | Description |
|---|---|---|
| `asset_key` | string | Unique asset identifier generated by QI Tech (UUID). |
| `external_id` | string | The same external key provided in the `external_id` field of `discounted_credit_right`. |
| `status` | string | Initial asset status. Always returns `pending_eligibility`, indicating the asset was inserted and awaits eligibility analysis. |

## Possible errors

STATUS 404

**Batch not found**

```json
{
  "title": "Assignment not found",
  "description": "Assignment not found",
  "translation": "Lote não encontrado",
  "code": "TRC000018"
}
```

STATUS 404

**Asset type does not exist**

```json
{
  "title": "Asset type does not exist",
  "description": "Asset type 'invalid_asset_type' does not exist",
  "translation": "Tipo do ativo 'invalid_asset_type' nao existe",
  "code": "TRC000015"
}
```

STATUS 400

**Asset type incompatible with batch**

```json
{
  "title": "Invalid asset type configuration",
  "description": "This assignment can not receive this asset type: discounted_contract",
  "translation": "Esse lote não pode receber esse tipo de ativo: discounted_contract",
  "code": "TRC000025"
}
```

STATUS 400

**Batch closed for insertion**

```json
{
  "title": "Assignment is closed",
  "description": "Assignment is closed to insert new assets",
  "translation": "Lote esta fechado para inserir novos ativos",
  "code": "TRC000022"
}
```

STATUS 400

**Duplicate external_id**

```json
{
  "title": "Already Exist This External Id",
  "description": "Already exist an asset with this External Id",
  "translation": "Ja existe um ativo com esse External Id",
  "code": "TRC000054"
}
```

## Next steps

After inserting the asset, the flow continues with:

1. **[Document submission](/documentation/iaas/negociacao_recebiveis/asset/documents)** — send the required documentation for each asset approved in eligibility.
2. **[Insertion closure](/documentation/iaas/negociacao_recebiveis/assignment/fechamento)** — signal that all assets have been inserted so that the batch proceeds to eligibility analysis.

---

# Asset Creation — Invoice (Duplicata)

URL: /en/documentation/iaas/negociacao_recebiveis/asset/criacao_duplicata

Endpoint to insert a **Invoice** asset into an assignment batch. There are two accepted subtypes: **Commercial Invoice** (`duplicata_mercantil`) — linked to a merchandise sales invoice — and **Service Invoice** (`duplicata_servicos`) — linked to a service provision invoice.

:::info Difference between types
Both types use the same request body structure. The main difference is that **commercial invoices** do not require document submission after eligibility, while **service invoices** do. See the [Document Insertion](/documentation/iaas/negociacao_recebiveis/asset/documents) page for more details.
:::

:::tip Where am I in the flow?
This is the **2nd step** of the assignment flow. Before this, you must have [created the batch](/documentation/iaas/negociacao_recebiveis/assignment/criacao). After inserting assets, submit the required [documents](/documentation/iaas/negociacao_recebiveis/asset/documents) and [close the insertion](/documentation/iaas/negociacao_recebiveis/assignment/fechamento).
:::

:::caution Attention
The `external_id` field of the credit right must be unique for each asset and must not be confused with the `external_id` of the batch.
:::

## Request

ENDPOINT /trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment/{assignment_external_id}/asset
METHOD POST

```json title="Request Body"
{
    "asset_type": "duplicata_mercantil",
    "total_purchase_value": 1231.21,
    "discounted_credit_right": {
        "external_id": "ccf6f331-d55f-46c0-a32f-fb909884dbb2",
        "originator_document_number": "46.282.154/0001-14",
        "maturity_date": "2023-12-10",
        "order_number": "18923619954796912",
        "face_value": 1023.01,
        "person_type": "natural_person",
        "borrower": {
            "name": "Natália Nascimento",
            "document_number": "805.359.140-08",
            "person_type": "natural_person",
            "email": "natalia.nascimento@yopmail.com",
            "address": {
                "street": "Gilberto Sabino",
                "number": "215",
                "neighborhood": "Pinheiros",
                "city": "São Paulo",
                "postal_code": "05425-020",
                "uf": "SP",
                "country": "BRA"
            },
            "phone": {
                "area_code": "11",
                "number": "36360268"
            },
            "natural_person": {
                "mother_name": "Lívia Santos",
                "birthdate": "2001-01-05"
            }
        },
        "participant_control_number": "ICX841HWCPUGU4U101XPLDW8D",
        "bankslip": {
            "our_number": {
                "number": 2,
                "digit": "P"
            }
        },
        "delay": {
            "fine": {
                "fine_type": "percentage",
                "percentage_value": 0.0
            },
            "interest": {
                "method": "pre_fixed",
                "pre_fixed": {
                    "daily_rate": 0.0,
                    "calendar_base": "calendar_360"
                }
            }
        },
        "invoice": {
            "access_key": "69037229347091328617032722238810300308237163",
            "total_value": 1231.21,
            "serie": "123",
            "number": "958431587",
            "issue_date": "2023-10-10"
        }
    }
}
```

### Body attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `asset_type` | string | required | Asset type. Accepted values: `duplicata_mercantil` or `duplicata_servicos`. |
| `total_purchase_value` | number | required | Total asset purchase value — the effective amount the assignee will pay. Up to 2 decimal places. |
| `discounted_credit_right` | object | required | Credit right data. See [discounted_credit_right attributes](#discounted_credit_right-attributes). |

#### `discounted_credit_right` attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `external_id` | string | required | Unique identifier for this asset in the partner's system. Maximum 50 characters. |
| `originator_document_number` | string | required | Formatted CPF or CNPJ of the originator/consultant who facilitated the operation. |
| `maturity_date` | string | required | Maturity date in `YYYY-MM-DD` format. |
| `order_number` | string | required | Order number. Maximum 45 characters. |
| `face_value` | number | required | Face value. Up to 8 decimal places. |
| `person_type` | string | optional | Borrower person type (`natural_person` or `legal_person`). |
| `borrower` | object | required | Borrower data. See [borrower attributes](/documentation/iaas/negociacao_recebiveis/asset/criacao_co#borrower-attributes) on the CCB Asset Creation page. |
| `participant_control_number` | string | optional | Participant control number in the partner's system. Maximum 50 alphanumeric characters. |
| `bankslip` | object | optional | Bank slip data. See [bankslip attributes](#bankslip-attributes). |
| `delay` | object | optional | Late fine and interest data. See [delay attributes](/documentation/iaas/negociacao_recebiveis/asset/criacao_co#delay-attributes) on the CCB Asset Creation page. |
| `invoice` | object | required | Invoice data. See [invoice attributes](#invoice-attributes). |

#### `bankslip` attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `our_number` | object | optional | Our number data. Applicable only when the number is issued by the client. See [our_number attributes](#our_number-attributes). |

#### `our_number` attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `number` | number | required | Our number. Bank collection number with registration. 1 to 11 numeric characters. |
| `digit` | string | required | Check digit for our number self-verification. 1 alphanumeric character. |

#### `invoice` attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `access_key` | string | required | Invoice access key. 44 characters. |
| `total_value` | number | optional | Total invoice value. Up to 2 decimal places. |
| `serie` | string | required | Invoice series number. Maximum 3 characters. |
| `number` | string | required | Invoice number. Maximum 50 characters. |
| `issue_date` | string | required | Issue date in `YYYY-MM-DD` format. |

## Response

STATUS 201

```json title="Response Body"
{
    "asset_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "external_id": "ccf6f331-d55f-46c0-a32f-fb909884dbb2",
    "status": "pending_eligibility"
}
```

### Response attributes

| Field | Type | Description |
|---|---|---|
| `asset_key` | string | Unique asset identifier generated by QI Tech (UUID). |
| `external_id` | string | The same external key provided in the `external_id` field of `discounted_credit_right`. |
| `status` | string | Initial asset status. Always returns `pending_eligibility`, indicating the asset was inserted and awaits eligibility analysis. |

## Possible errors

STATUS 404

**Batch not found**

```json
{
  "title": "Assignment not found",
  "description": "Assignment not found",
  "translation": "Lote não encontrado",
  "code": "TRC000018"
}
```

STATUS 404

**Asset type does not exist**

```json
{
  "title": "Asset type does not exist",
  "description": "Asset type 'invalid_asset_type' does not exist",
  "translation": "Tipo do ativo 'invalid_asset_type' nao existe",
  "code": "TRC000015"
}
```

STATUS 400

**Asset type incompatible with batch**

```json
{
  "title": "Invalid asset type configuration",
  "description": "This assignment can not receive this asset type: duplicata_mercantil",
  "translation": "Esse lote não pode receber esse tipo de ativo: duplicata_mercantil",
  "code": "TRC000025"
}
```

STATUS 400

**Batch closed for insertion**

```json
{
  "title": "Assignment is closed",
  "description": "Assignment is closed to insert new assets",
  "translation": "Lote esta fechado para inserir novos ativos",
  "code": "TRC000022"
}
```

STATUS 400

**Duplicate external_id**

```json
{
  "title": "Already Exist This External Id",
  "description": "Already exist an asset with this External Id",
  "translation": "Ja existe um ativo com esse External Id",
  "code": "TRC000054"
}
```

## Next steps

After inserting the asset, the flow continues with:

1. **[Document submission](/documentation/iaas/negociacao_recebiveis/asset/documents)** — send the required documentation for each asset approved in eligibility.
2. **[Insertion closure](/documentation/iaas/negociacao_recebiveis/assignment/fechamento)** — signal that all assets have been inserted so that the batch proceeds to eligibility analysis.

---

# Addition of Assets to be Repurchased

URL: /en/documentation/iaas/negociacao_recebiveis/asset/criacao_repurchased_asset

Endpoint to insert an asset into a **substitution batch** — a special batch used when an assignor needs to repurchase previously assigned assets and replace them with new ones. This endpoint is used to declare which assets are being repurchased and at what value.

:::info Substitution batches
This endpoint is only applicable for substitution-type assignment configurations. Standard assignment batches use the regular asset creation endpoints (`criacao_co`, `criacao_duplicata`, etc.).
:::

:::tip Where am I in the flow?
This is the **asset insertion step** within a substitution batch. Before this, you must have [created the batch](/documentation/iaas/negociacao_recebiveis/assignment/criacao). After inserting repurchased assets, [close the insertion](/documentation/iaas/negociacao_recebiveis/assignment/fechamento).
:::

## Request

ENDPOINT /trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment/{assignment_external_id}/repurchased_asset
METHOD POST

```json title="Request Body"
{
    "asset_type": "ccb",
    "external_id": "ccf6f331-d55f-46c0-a32f-fb909884dbb2",
    "assignor_document_number": "46.282.154/0001-14",
    "repurchase_value": 1500.00,
    "settlement_type": "asset_settlement"
}
```

### Body attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `asset_type` | string | required | Type of the asset being repurchased. Accepted values: `ccb`, `duplicata_mercantil`, `duplicata_servicos`, `discounted_contract`. |
| `external_id` | string | required | The `external_id` of the originally assigned asset being repurchased. |
| `assignor_document_number` | string | required | Formatted CPF or CNPJ of the assignor who originally transferred the asset. |
| `repurchase_value` | number | required | Repurchase value in BRL. Up to 2 decimal places. |
| `settlement_type` | string | required | Settlement type for the repurchase. Accepted values: `asset_settlement` or `asset_amortization`. |

**`settlement_type` enumerators:**

| Value | Description |
|---|---|
| `asset_settlement` | Full repurchase — the entire outstanding balance of the asset is settled. |
| `asset_amortization` | Partial repurchase — only the principal (amortization) portion is settled. |

## Response

STATUS 201

```json title="Response Body"
{
    "repurchased_asset_key": "7a3f1c92-84bd-4e2a-b017-cf3e8d9a1234",
    "asset_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "assignor": {
        "assignor_key": "c1d2e3f4-a5b6-7890-abcd-ef1234567890",
        "document_number": "46.282.154/0001-14",
        "name": "Example Assignor Ltda"
    },
    "assignment": {
        "assignment_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
        "external_id": "931e9437-d025-41ab-bb53-6b94e10fd361",
        "status": "pending_assets_insertion"
    }
}
```

### Response attributes

| Field | Type | Description |
|---|---|---|
| `repurchased_asset_key` | string | Unique identifier for this repurchase record (UUID). |
| `asset_key` | string | Unique identifier of the original asset being repurchased (UUID). |
| `assignor` | object | Assignor data. |
| `assignor.assignor_key` | string | Unique assignor identifier (UUID). |
| `assignor.document_number` | string | Assignor CPF/CNPJ. |
| `assignor.name` | string | Assignor name. |
| `assignment` | object | Substitution batch data. |
| `assignment.assignment_key` | string | Unique batch identifier (UUID). |
| `assignment.external_id` | string | External batch identifier provided by the partner. |
| `assignment.status` | string | Current batch status. |

## Possible errors

STATUS 404

**Batch not found**

```json
{
  "title": "Assignment not found",
  "description": "Assignment not found",
  "translation": "Lote não encontrado",
  "code": "TRC000018"
}
```

STATUS 404

**Asset not found**

```json
{
  "title": "Asset not found",
  "description": "Asset not found",
  "translation": "Ativo não encontrado",
  "code": "TRC000017"
}
```

STATUS 400

**Batch closed for insertion**

```json
{
  "title": "Assignment is closed",
  "description": "Assignment is closed to insert new assets",
  "translation": "Lote esta fechado para inserir novos ativos",
  "code": "TRC000022"
}
```

## Next steps

After inserting all repurchased assets:

1. **[Insertion closure](/documentation/iaas/negociacao_recebiveis/assignment/fechamento)** — signal that all repurchased assets have been declared so that the batch proceeds to the substitution process.

---

# Document Insertion

URL: /en/documentation/iaas/negociacao_recebiveis/asset/documents

Endpoint to submit documentation required for an asset that has been approved in the eligibility step. Each document must be submitted in a separate request as a Base64-encoded PDF.

:::info Which assets require documents?
- **CCB** (`ccb`): document submission is always required.
- **Service Invoice** (`duplicata_servicos`): document submission is required.
- **Commercial Invoice** (`duplicata_mercantil`): document submission is **not** required.
- **Discounted Contract** (`discounted_contract`): check the product configuration in the Assignment Contract.

The asset will only advance to `pre_approved` status once all required documents have been submitted.
:::

:::tip Where am I in the flow?
This step occurs **after receiving an Asset Eligibility Webhook** with status `pending_documentation`. Submit all required documents for each approved asset, then [close the insertion](/documentation/iaas/negociacao_recebiveis/assignment/fechamento) when all assets are ready.
:::

## Request

ENDPOINT /trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment/{assignment_external_id}/asset/{asset_key}/document
METHOD POST

### Path params

| Parameter | Type | Description |
|---|---|---|
| `fund_class_key` | string | Unique fund identifier (UUID). |
| `assignment_configuration_key` | string | Unique assignment configuration identifier (UUID). |
| `assignment_external_id` | string | External identifier of the batch, provided at batch creation. |
| `asset_key` | string | Unique asset identifier returned at asset creation (UUID). |

```json title="Request Body"
{
    "document_type": "ccb",
    "document_b64": "JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0ZpbHRlci9GbGF0ZURlY29kZT4+..."
}
```

### Body attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `document_type` | string | required | Type of document being submitted. Accepted values: `ccb` or `duplicata_servicos`. |
| `document_b64` | string | required | PDF file content encoded in Base64. |

**`document_type` enumerators:**

| Value | Description |
|---|---|
| `ccb` | Credit Certificate (Cédula de Crédito Bancário) — used for CCB assets. |
| `duplicata_servicos` | Service Invoice — used for service invoice assets. |

## Response

STATUS 201

```json title="Response Body"
{
    "document_key": "9b4d1a7c-2e3f-4a5b-8c9d-0e1f2a3b4c5d"
}
```

### Response attributes

| Field | Type | Description |
|---|---|---|
| `document_key` | string | Unique document identifier generated by QI Tech (UUID). |

## Possible errors

STATUS 404

**Asset not found**

```json
{
  "title": "Asset not found",
  "description": "Asset not found",
  "translation": "Ativo não encontrado",
  "code": "TRC000017"
}
```

STATUS 400

**Invalid asset status for document submission**

The asset is not in a status that allows document submission. This typically means the asset has not yet been approved in eligibility or has already been discarded.

```json
{
  "title": "Invalid operation",
  "description": "Asset is not in a valid status to receive documents",
  "translation": "Ativo não está em status válido para receber documentos",
  "code": "TRC000024"
}
```

STATUS 400

**Invalid document type for asset**

The `document_type` provided does not match the asset type. For example, submitting a `duplicata_servicos` document for a CCB asset.

```json
{
  "title": "Invalid document type",
  "description": "Document type is not valid for this asset type",
  "translation": "Tipo de documento inválido para esse tipo de ativo",
  "code": "TRC000026"
}
```

STATUS 400

**Document already submitted**

A document of this type has already been submitted for this asset.

```json
{
  "title": "Document already exists",
  "description": "A document of this type already exists for this asset",
  "translation": "Já existe um documento desse tipo para esse ativo",
  "code": "TRC000055"
}
```

## Next steps

After submitting all required documents for an asset, the asset moves to `pre_approved` status. Once all assets in the batch are either `pre_approved` or `discarded`:

1. **[Close insertion](/documentation/iaas/negociacao_recebiveis/assignment/fechamento)** — signal that no more assets will be inserted, triggering the batch eligibility analysis.

---

# Asset Query

URL: /en/documentation/iaas/negociacao_recebiveis/asset/recuperar_ativos

Endpoints to query assets inserted in an assignment batch. There are two query modes: **paginated listing** of all assets in a batch, and **individual retrieval** of a specific asset.

:::tip When to use
Use these endpoints to track asset statuses after insertion, verify which were approved or denied in eligibility, and check denial reasons when applicable.
:::

## Asset Listing

Returns the paginated list of all assets in a batch.

### Request

ENDPOINT /trade_receivables/fund_class/{fund_class_key}/assignment/{assignment_external_id}/assets
METHOD GET

### Query params

| Parameter | Type | Required | Description |
|---|---|---|---|
| `page` | integer | optional | Page number (starts at 0). Default: `0`. |
| `limit` | integer | optional | Number of records per page. Default: `10`. |

```python title="Example call"
GET /trade_receivables/fund_class/{fund_class_key}/assignment/{assignment_external_id}/assets?page=0&limit=10
```

### Response

STATUS 200

```json title="Response Body"
{
    "data": [
        {
            "asset_key": "f4348106-01c4-4c59-a261-7c09db811c47",
            "external_id": "e292656f-f7fb-44dc-96f3-667c36c88442",
            "total_purchase_value": 1231.21,
            "asset_type": "duplicata_mercantil",
            "status": "denied",
            "duration": 9177,
            "denied_by": "document",
            "denial_reason": "Invalid documents"
        }
    ],
    "limit": 10,
    "page": 0,
    "is_last_page": true
}
```

### Response attributes

| Field | Type | Description |
|---|---|---|
| `data` | array | List of asset objects. See table below. |
| `page` | integer | Current page number. |
| `limit` | integer | Number of records per page. |
| `is_last_page` | boolean | Indicates whether this is the last page of results. |

#### Attributes of each asset (objects within `data`)

| Field | Type | Description |
|---|---|---|
| `asset_key` | string | Unique asset identifier (UUID). |
| `external_id` | string | External key provided by the partner at creation. |
| `total_purchase_value` | number | Total asset purchase value. |
| `asset_type` | string | Asset type (e.g., `ccb`, `duplicata_mercantil`, `discounted_contract`). |
| `status` | string | Current asset status. See the [status enumerators](#asset-status-enumerators) table below. |
| `duration` | integer | Asset duration in days. May not be present if not yet calculated. |
| `denied_by` | string | Indicates the source of denial (e.g., `document`, `eligibility`). Present only when the asset was denied. |
| `denial_reason` | string | Description of the denial reason. Present only when the asset was denied. |

:::info Nested objects
Depending on the asset type, the response will include the `credit_operation` object (for CCBs) or `discounted_credit_right` object (for invoices and discounted contracts) with all credit operation data.
:::

## Individual Asset Retrieval

Returns the complete data of a specific asset from the batch.

### Request

ENDPOINT /trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment/{assignment_external_id}/asset/{asset_external_id}
METHOD GET

### Path params

| Parameter | Type | Description |
|---|---|---|
| `asset_external_id` | string | The `external_id` provided at asset creation. |

### Response

STATUS 200

```json title="Response Body"
{
    "asset_key": "074f8786-447f-4524-9f4f-a5cf8a890bb4",
    "external_id": "acfbc329-4e67-40ea-bd8d-5debdaebe144",
    "total_purchase_value": 1231.21,
    "asset_type": "duplicata_mercantil",
    "status": "denied",
    "duration": 9184,
    "denied_by": "document",
    "denial_reason": "Invalid documents"
}
```

### Response attributes

The response has the same structure as each object in the `data` array returned by the [asset listing](#attributes-of-each-asset-objects-within-data), plus the complete credit operation object (`credit_operation` or `discounted_credit_right`, depending on the asset type).

## Asset status enumerators

| Status | Description |
|---|---|
| `pending_eligibility` | Asset inserted, awaiting eligibility analysis. |
| `pre_approved` | Asset pre-approved in individual eligibility. |
| `pending_documentation` | Asset approved in eligibility, awaiting document submission. |
| `approved` | Asset approved with validated documentation. |
| `denied` | Asset denied in eligibility or document validation. |
| `discarded` | Asset discarded from the batch. |

---

# Asset Removal from Batch

URL: /en/documentation/iaas/negociacao_recebiveis/asset/remocao_ativos

Process to remove assets from a batch that is awaiting manager approval. Removal involves **3 sequential steps**: reopen the batch, remove the desired assets, and close the batch again.

:::info Prerequisite
Asset removal is only possible when the batch is in `pending_manager_approval` status. With the batch in this status, it must be reopened before any asset changes can be made.
:::

## Step 1 — Reopen the batch

Change the batch status to `pending_assets_insertion` to allow asset removal.

### Request

ENDPOINT /trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment/{assignment_external_id}
METHOD PUT

```json title="Request Body"
{
    "assignment_status": "pending_assets_insertion"
}
```

#### Body attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `assignment_status` | string | required | Status to update the batch to. To reopen, send `pending_assets_insertion`. |

### Response

STATUS 200

```json title="Response Body"
{
    "assignment_key": "8e515a17-8b4d-49a3-aed6-47c9574e426a",
    "external_id": "9eec85be-97c9-41e0-88b3-b17a39869b36",
    "status": "pending_assets_insertion",
    "number_of_approved_assets": 10,
    "assignment_total_value": 1234.99
}
```

#### Response attributes

| Field | Type | Description |
|---|---|---|
| `assignment_key` | string | Unique batch identifier (UUID). |
| `external_id` | string | External batch key provided by the partner. |
| `status` | string | New batch status: `pending_assets_insertion`. |
| `number_of_approved_assets` | integer | Number of approved assets in the batch. |
| `assignment_total_value` | number | Total assignment value in BRL. |

## Step 2 — Remove assets

With the batch reopened, remove each desired asset by changing its status to `denied`. Make one request per asset to be removed.

### Request

ENDPOINT /trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment/{assignment_external_id}/asset/{asset_external_id}
METHOD PUT

### Path params

| Parameter | Type | Description |
|---|---|---|
| `asset_external_id` | string | The `external_id` of the asset to be removed. |

```json title="Request Body"
{
    "asset_status": "denied"
}
```

#### Body attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `asset_status` | string | required | Status to update the asset to. To remove, send `denied`. |

### Response

STATUS 200

```json title="Response Body"
{
    "external_id": "9eec85be-97c9-41e0-88b3-b17a39869b36",
    "status": "denied"
}
```

#### Response attributes

| Field | Type | Description |
|---|---|---|
| `external_id` | string | Asset external key. |
| `status` | string | New asset status: `denied`. |

## Step 3 — Close the batch again

After removing the desired assets, close the batch so it proceeds again to manager approval.

### Request

ENDPOINT /trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment/{assignment_external_id}
METHOD PUT

```json title="Request Body"
{
    "assignment_status": "completed_assets_insertion"
}
```

#### Body attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `assignment_status` | string | required | Status to update the batch to. To close, send `completed_assets_insertion`. |

### Response

STATUS 200

```json title="Response Body"
{
    "assignment_key": "8e515a17-8b4d-49a3-aed6-47c9574e426a",
    "external_id": "9eec85be-97c9-41e0-88b3-b17a39869b36",
    "status": "completed_assets_insertion",
    "number_of_approved_assets": 10,
    "assignment_total_value": 1234.99
}
```

#### Response attributes

| Field | Type | Description |
|---|---|---|
| `assignment_key` | string | Unique batch identifier (UUID). |
| `external_id` | string | External batch key provided by the partner. |
| `status` | string | New batch status: `completed_assets_insertion`. |
| `number_of_approved_assets` | integer | Number of remaining approved assets. |
| `assignment_total_value` | number | Updated total assignment value in BRL. |

After closing the batch, it will proceed again to manager approval and continue the flow normally.

## Possible errors

STATUS 404

**Asset not found**

The `asset_external_id` provided in the URL does not match any asset in the batch. Verify the identifier is correct and that the asset belongs to the specified batch.

```json
{
  "title": "Asset not found",
  "description": "Asset not found",
  "translation": "Ativo não foi encontrado",
  "code": "TRC000020"
}
```

STATUS 400

**Asset cannot be removed**

The specified asset cannot be denied/removed in its current status. This can occur when the asset has already been discarded or when the batch is not open for modification.

```json
{
  "title": "Cant deny this asset.",
  "description": "This asset cant be denied.",
  "translation": "Esse ativo não pode ser negado",
  "code": "TRC000086"
}
```

STATUS 400

**Invalid batch status for this operation**

The batch is not in a status that allows this operation. To remove assets, the batch must be in `pending_assets_insertion` status. Check the current batch status and, if necessary, reopen it first (Step 1).

```json
{
  "title": "Invalid assignment status",
  "description": "Assignment is not in a valid status for this operation",
  "translation": "O lote não está em um status valido para essa operação",
  "code": "TRC000087"
}
```

---

# Asset Webhooks

URL: /en/documentation/iaas/negociacao_recebiveis/asset/webhooks

Throughout the assignment flow, the system sends webhooks to notify the integrating partner about status changes of individual assets. There are two webhook types: `trade_receivables.asset_status_change` for status changes and `trade_receivables.asset_creation` to confirm asset creation.

:::info Webhook configuration
To receive webhooks, you must have a callback URL configured with QI Tech. Contact [integracao.dtvm@qitech.com.br](mailto:integracao.dtvm@qitech.com.br) to set up.
:::

## Asset status flow

The diagram below illustrates the status transitions that generate webhooks throughout the flow:

```mermaid
graph TB
    A[pending_eligibility] -->|Denied| B[denied]
    A -->|Documentation required| C[pending_documentation]
    A -->|Pre-approved| D[pre_approved]
    C -->|Valid documents| D
    C -->|Invalid documents| B
    D -->|Formalization| E[pending_formalization]
    E -->|Portfolio included| F[completed]
    A -->|Discarded| G[discarded]
    C -->|Discarded| G
```

## Webhook structure

All asset webhooks share the same base structure:

| Field | Type | Description |
|---|---|---|
| `webhook_type` | string | Webhook type: `trade_receivables.asset_status_change` or `trade_receivables.asset_creation`. |
| `webhook_datetime` | string | Event date and time in ISO 8601 format. |
| `data` | object | Event data. See table below. |

#### `data` attributes

| Field | Type | Description |
|---|---|---|
| `assignment_external_id` | string | The `external_id` of the batch the asset belongs to. |
| `asset_external_id` | string | The `external_id` of the asset. |
| `asset_new_status` | string | New asset status. |
| `fund_class_key` | string | Identifier of the fund class associated with the batch. |
| `asset_payload` | object | Present only in the creation webhook (`asset_creation`). Contains all asset data as submitted at creation. |

```json title="Standard webhook structure"
{
    "data": {
        "assignment_external_id": "ac597f90-a13e-4f78-86f0-11c66f5fa6d6",
        "asset_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
        "asset_new_status": "STATUS",
        "fund_class_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c"
    },
    "webhook_type": "trade_receivables.asset_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

## Events by status

### Asset Created

STATUS pending_eligibility

Sent when an asset is successfully inserted into the batch. This webhook includes the `asset_payload` field with all credit operation data submitted at creation. The webhook type is `trade_receivables.asset_creation`.

```json title="Webhook Body"
{
    "data": {
        "assignment_external_id": "ac597f90-a13e-4f78-86f0-11c66f5fa6d6",
        "asset_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
        "asset_new_status": "pending_eligibility",
        "fund_class_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c",
        "asset_payload": {
            "premiums": [
                {
                    "total_value": 1.2,
                    "premium_type": "spread"
                }
            ],
            "asset_type": "ccb",
            "credit_operation": {
                "delay": {
                    "fine": {
                        "amount": 0.0,
                        "fine_type": "percentage"
                    },
                    "interest": {
                        "method": "compound",
                        "pre_fixed": {
                            "monthly_rate": 0.0,
                            "calendar_base": "workdays"
                        }
                    }
                },
                "borrower": {
                    "name": "João Pereira",
                    "email": "exemplo3@gmail.com",
                    "phone": {
                        "number": "948386674",
                        "area_code": "11"
                    },
                    "address": {
                        "uf": "SP",
                        "city": "São Paulo",
                        "number": "84",
                        "street": "RUA GILBERTO SABINO",
                        "country": "BRA",
                        "postal_code": "05425-020",
                        "neighborhood": "Pinheiros"
                    },
                    "person_type": "natural_person",
                    "natural_person": {
                        "birthdate": "1970-02-18",
                        "mother_name": "Natalia Nascimento"
                    },
                    "document_number": "926.857.750-05"
                },
                "contract": {
                    "cet": 0.0314,
                    "number": "0032226586/NNT",
                    "iof_value": 3.04,
                    "issue_date": "2024-04-24",
                    "issue_value": 93.05,
                    "signature_date": "2024-04-24",
                    "disbursement_date": "2024-04-24",
                    "disbursement_value": 62.1
                },
                "pre_fixed": {
                    "monthly_rate": 0.0179,
                    "calendar_base": "calendar_365"
                },
                "external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
                "installments": [
                    {
                        "face_value": 30.81,
                        "maturity_date": "2025-02-01",
                        "installment_number": 1
                    },
                    {
                        "face_value": 26.19,
                        "maturity_date": "2026-02-01",
                        "installment_number": 2
                    },
                    {
                        "face_value": 29.68,
                        "maturity_date": "2027-02-01",
                        "installment_number": 3
                    },
                    {
                        "face_value": 23.74,
                        "maturity_date": "2028-02-01",
                        "installment_number": 4
                    },
                    {
                        "face_value": 28.49,
                        "maturity_date": "2029-02-01",
                        "installment_number": 5
                    },
                    {
                        "face_value": 19.94,
                        "maturity_date": "2030-02-01",
                        "installment_number": 6
                    },
                    {
                        "face_value": 13.96,
                        "maturity_date": "2031-02-01",
                        "installment_number": 7
                    },
                    {
                        "face_value": 13.03,
                        "maturity_date": "2032-02-01",
                        "installment_number": 8
                    }
                ],
                "principal_value": 93.05,
                "amortization_type": "price",
                "interest_rate_type": "pre_fixed",
                "originator_document_number": "40.940.511/0001-08"
            },
            "total_purchase_value": 94.86
        }
    },
    "webhook_type": "trade_receivables.asset_creation",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

### Approved in Eligibility — Pending Documentation

STATUS pending_documentation

Sent when the asset is **approved** in eligibility analysis and is awaiting submission of required documents. Use the [Document Insertion](/documentation/iaas/negociacao_recebiveis/asset/documents) endpoint to submit the required documentation.

```json title="Webhook Body"
{
    "data": {
        "assignment_external_id": "ac597f90-a13e-4f78-86f0-11c66f5fa6d6",
        "asset_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
        "asset_new_status": "pending_documentation",
        "fund_class_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c"
    },
    "webhook_type": "trade_receivables.asset_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

### Pre-Approved

STATUS pre_approved

Sent when the asset is **pre-approved**, after successful document validation (or when no additional documentation is required). The asset is ready to advance to the formalization/registration step.

```json title="Webhook Body"
{
    "data": {
        "assignment_external_id": "ac597f90-a13e-4f78-86f0-11c66f5fa6d6",
        "asset_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
        "asset_new_status": "pre_approved",
        "fund_class_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c"
    },
    "webhook_type": "trade_receivables.asset_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

### Pending Formalization

STATUS pending_formalization

Sent when the pre-approved asset has been submitted for the formalization step (registration with the relevant authority). The asset awaits completion of the registration process before being added to the portfolio.

```json title="Webhook Body"
{
    "data": {
        "assignment_external_id": "ac597f90-a13e-4f78-86f0-11c66f5fa6d6",
        "asset_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
        "asset_new_status": "pending_formalization",
        "fund_class_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c"
    },
    "webhook_type": "trade_receivables.asset_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

### Asset Completed

STATUS completed

Sent when the asset has been **successfully added to the fund's portfolio**. This is the final status of a successful asset — from this point on, the asset is within the fund's inventory.

```json title="Webhook Body"
{
    "data": {
        "assignment_external_id": "ac597f90-a13e-4f78-86f0-11c66f5fa6d6",
        "asset_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
        "asset_new_status": "completed",
        "fund_class_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c"
    },
    "webhook_type": "trade_receivables.asset_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

### Denied in Eligibility

STATUS denied

Sent when the asset is **denied** in eligibility analysis or document validation. The asset will not advance further in the flow.

```json title="Webhook Body"
{
    "data": {
        "assignment_external_id": "ac597f90-a13e-4f78-86f0-11c66f5fa6d6",
        "asset_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
        "asset_new_status": "denied",
        "fund_class_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c"
    },
    "webhook_type": "trade_receivables.asset_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

### Asset Discarded

STATUS discarded

Sent when the asset is discarded from the batch. This can occur due to manual removal or processing issues.

```json title="Webhook Body"
{
    "data": {
        "assignment_external_id": "ac597f90-a13e-4f78-86f0-11c66f5fa6d6",
        "asset_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
        "asset_new_status": "discarded",
        "fund_class_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c"
    },
    "webhook_type": "trade_receivables.asset_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

# Manager Approval

URL: /en/documentation/iaas/negociacao_recebiveis/assignment/aprovacao

After the batch eligibility is approved, the fund manager must analyze and decide whether to approve or deny the batch. If approved, the system generates the Assignment Term and submits it for signature. If denied, the batch is discarded and the process ends.

:::info Manager-exclusive endpoint
This endpoint is available **only for fund managers**. If the manager is not integrated via API, this action can be performed through the [Manager Portal](https://manager-dash.qidtvm.com.br/).
:::

:::tip Where am I in the flow?
This step occurs after **batch eligibility** has been approved. You will receive a [webhook](/documentation/iaas/negociacao_recebiveis/assignment/webhooks) with status `pending_manager_approval` indicating the batch is awaiting the manager's decision.
:::

## Request

ENDPOINT /trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment/{assignment_external_id}
METHOD PUT

### Path params

| Parameter | Type | Description |
|---|---|---|
| `assignment_external_id` | string | The `external_id` provided at batch creation. |

```json title="Request Body — Approval"
{
    "assignment_status": "approved",
    "disbursement_account_key": "764746ce-a530-4a71-af66-3f7c879627df"
}
```

```json title="Request Body — Denial"
{
    "assignment_status": "denied"
}
```

### Body attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `assignment_status` | string | required | Manager's decision on the batch. Accepted values: `approved` or `denied`. |
| `disbursement_account_key` | string | optional | Unique key (UUID, 36 characters) of the disbursement account registered in the assignor onboarding. If not provided, the default account configured in the assignment contract will be used. |

**`assignment_status` enumerators:**

| Value | Description |
|---|---|
| `approved` | Approves the batch — the system will generate the Assignment Term. |
| `denied` | Denies the batch — the batch will be discarded. |

## Response

STATUS 200

```json title="Response Body — Approval"
{
    "assignment_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "external_id": "931e9437-d025-41ab-bb53-6b94e10fd361",
    "status": "approved",
    "number_of_approved_assets": 45,
    "assignment_total_value": 150000.00
}
```

```json title="Response Body — Denial"
{
    "assignment_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "external_id": "931e9437-d025-41ab-bb53-6b94e10fd361",
    "status": "denied",
    "number_of_approved_assets": 0,
    "assignment_total_value": 0.00
}
```

### Response attributes

| Field | Type | Description |
|---|---|---|
| `assignment_key` | string | Unique batch identifier (UUID). |
| `external_id` | string | External batch key provided by the partner. |
| `status` | string | New batch status after the manager's decision (`approved` or `denied`). |
| `number_of_approved_assets` | integer | Number of assets approved in eligibility. In case of denial, the value will be `0`. |
| `assignment_total_value` | number | Total assignment value in BRL. In case of denial, the value will be `0.00`. |

## Possible errors

STATUS 400

**Batch not found**

The `external_id` provided in the URL does not match any existing batch in this assignment configuration. Verify the identifier is correct and that you are using the correct `fund_class_key` and `assignment_configuration_key`.

```json
{
  "title": "Assignment not found",
  "description": "Assignment not found",
  "translation": "Cessão não foi encontrada",
  "code": "TRC000018"
}
```

STATUS 400

**Invalid operation for current status**

The batch is not in a status that allows approval or denial. This typically occurs when the batch has not yet passed eligibility, or when it has already been approved/denied previously. Check the current batch status via [Batch Retrieval](/documentation/iaas/negociacao_recebiveis/assignment/recuperacao) to understand which stage it is at.

```json
{
  "title": "Invalid operation",
  "description": "This assignment can not receive 'denied' status",
  "translation": "Esse lote não pode receber o status 'denied'",
  "code": "TRC000024"
}
```

## Next steps

After manager approval, the flow continues automatically:

1. **Assignment Term Signature** — the system generates the Assignment Term and sends it for signature by all parties. You will receive a [webhook](/documentation/iaas/negociacao_recebiveis/assignment/webhooks) with status `pending_assignment_term_signature`. The document can be retrieved via [Assignment Documents](/documentation/iaas/negociacao_recebiveis/assignment/documento_da_cessao).
2. **Payment** — after signing, the system pays the assignor. A [webhook](/documentation/iaas/negociacao_recebiveis/assignment/webhooks) with status `pending_payment` will be sent.
3. **Portfolio inclusion** — assets are added to the fund's portfolio and the batch is finalized with status `completed`.

---

# Assignment Batch Creation

URL: /en/documentation/iaas/negociacao_recebiveis/assignment/criacao

This is the **first step** of the credit rights assignment flow. Creating the batch (*assignment*) reserves a grouping container where the assets to be assigned to the fund will be inserted in subsequent steps.

:::info Prerequisites
Before creating a batch, you need:
- The `fund_class_key` — unique key of the assignee fund.
- The `assignment_configuration_key` — unique key of the assignment configuration, obtained during [Assignor Onboarding](/documentation/iaas/homologacao_cedente/contrato_de_cessao/pedido_de_contrato).

These two keys compose the endpoints used in all endpoints of this API:

```
/trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}
```

For more details about the complete flow, see the [Credit Rights Assignment Manual](/documentation/iaas/negociacao_recebiveis/manual_api).
:::

## Request

ENDPOINT /trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment
METHOD POST

```json title="Request Body"
{
    "external_id": "931e9437-d025-41ab-bb53-6b94e10fd361",
    "assignment_date": "2024-04-01"
}
```

### Body attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `external_id` | string | required | Unique identification key for this batch in the integrating partner's system. Must be unique — the system will not allow creating two batches with the same identifier. Maximum 50 characters. |
| `assignment_date` | string | optional | Assignment date in `YYYY-MM-DD` format. When provided, must match the fund's accounting date (*accounting_date*). If not provided, the current accounting date will be used. |

## Response

STATUS 201

```json title="Response Body"
{
    "assignment_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "external_id": "931e9437-d025-41ab-bb53-6b94e10fd361",
    "status": "pending_assets_insertion"
}
```

### Response attributes

| Field | Type | Description |
|---|---|---|
| `assignment_key` | string | Unique batch identifier generated by QI Tech (UUID). |
| `external_id` | string | The same external key provided in the request. |
| `status` | string | Initial batch status. Always returns `pending_assets_insertion`, indicating the batch is ready to receive assets. |

## Possible errors

STATUS 404

**Assignment configuration not found**

The combination of `fund_class_key` and `assignment_configuration_key` provided does not match any assignment configuration. Verify the keys are correct and that the assignment contract has already been onboarded at the [Assignor Onboarding](/documentation/iaas/homologacao_cedente/contrato_de_cessao/pedido_de_contrato) step.

```json
{
  "title": "AssignmentConfiguration was not found",
  "description": "AssignmentConfiguration was not found",
  "translation": "Configuração de cessão não foi encontrada",
  "code": "TRC000016"
}
```

STATUS 400

**Invalid assignment date**

The date provided in the `assignment_date` field does not match the fund's current accounting date. Each fund has a current accounting date, and the assignment date must equal that date. Check the fund's current accounting date or omit the `assignment_date` field to let the system use it automatically.

```json
{
  "title": "Invalid assignment date.",
  "description": "Given assignment date is different from fund accounting date.",
  "translation": "Data de cessão fornecida diferente da data do fundo.",
  "code": "TRC000083"
}
```

STATUS 400

**Duplicate external_id**

A batch with the provided `external_id` already exists. Each batch must have a unique identifier in the system. Generate a new `external_id` and try again.

```json
{
  "title": "Already Exists This External Id",
  "description": "Already Exists This External Id",
  "translation": "Já existe lote com esse external_id",
  "code": "TRC000041"
}
```

## Next steps

After creating the batch, the flow continues with:

1. **[Asset insertion](/documentation/iaas/negociacao_recebiveis/asset/criacao_co)** — add the assets (CCBs, invoices, etc.) to be assigned to the fund.
2. **[Document submission](/documentation/iaas/negociacao_recebiveis/asset/documents)** — submit the required documentation for each asset approved in eligibility.
3. **[Insertion closure](/documentation/iaas/negociacao_recebiveis/assignment/fechamento)** — signal that all assets have been inserted so that the batch proceeds to eligibility analysis.

---

# Assignment Documents

URL: /en/documentation/iaas/negociacao_recebiveis/assignment/documento_da_cessao

Retrieves the download links for the Assignment Term — both the original version and the signed version. This endpoint becomes available from the moment the Term is generated, i.e., after the batch reaches `pending_assignment_term_signature` status.

:::tip When to use
After receiving the [webhook](/documentation/iaas/negociacao_recebiveis/assignment/webhooks) with status `pending_assignment_term_signature`, use this endpoint to obtain the Assignment Term link and track whether the signature has been completed.
:::

## Request

ENDPOINT /trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment/{assignment_external_id}/assignment_term_link
METHOD GET

### Path params

| Parameter | Type | Description |
|---|---|---|
| `fund_class_key` | string | Unique fund key (UUID). |
| `assignment_configuration_key` | string | Assignment configuration key (UUID). |
| `assignment_external_id` | string | The `external_id` provided at batch creation. |

## Response

STATUS 200

```json title="Response Body"
{
    "assignment_term_url": "https://storage.example.com/term/abc123.pdf",
    "signed_assignment_term_url": "https://storage.example.com/term/abc123_signed.pdf"
}
```

### Response attributes

| Field | Type | Description |
|---|---|---|
| `assignment_term_url` | string | URL that directs to the term signature page on CertifiQI. |
| `signed_assignment_term_url` | string \| null | URL for the signed Assignment Term. Returns `null` while the document has not yet been signed by all parties. |

:::info Note
The `signed_assignment_term_url` field will be `null` while the Assignment Term has not yet been signed by all involved parties. After the signature is completed, the batch will advance to `pending_payment` status and a [webhook](/documentation/iaas/negociacao_recebiveis/assignment/webhooks) will be sent.
:::

---

# Close Asset Insertion

URL: /en/documentation/iaas/negociacao_recebiveis/assignment/fechamento

After inserting all desired assets into the batch, use this endpoint to signal that insertion is complete. From this point, once all assets are either pre-approved (`pre_approved`) or discarded (`discarded`), the overall batch eligibility will be automatically evaluated.

:::info No need to wait for asset webhooks
You can close the insertion at any time after inserting the assets. There is no need to wait for all assets to complete individual eligibility. The system will automatically wait until all assets have finished analysis before proceeding with batch eligibility.
:::

:::tip Where am I in the flow?
This is the **3rd step** of the assignment flow. Before this step, you must have:
1. [Created the batch](/documentation/iaas/negociacao_recebiveis/assignment/criacao)
2. [Inserted the assets](/documentation/iaas/negociacao_recebiveis/asset/criacao_co) and [submitted the documents](/documentation/iaas/negociacao_recebiveis/asset/documents)
:::

## Request

ENDPOINT /trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment/{assignment_external_id}
METHOD PUT

### Path params

| Parameter | Type | Description |
|---|---|---|
| `assignment_external_id` | string | The `external_id` provided at batch creation. |

```json title="Request Body"
{
    "assignment_status": "completed_assets_insertion"
}
```

### Body attributes

| Field | Type | Required | Description |
|---|---|---|---|
| `assignment_status` | string | required | Status to update the batch to. To close asset insertion, send `completed_assets_insertion`. |

## Response

STATUS 200

```json title="Response Body"
{
    "assignment_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "external_id": "931e9437-d025-41ab-bb53-6b94e10fd361",
    "status": "completed_assets_insertion",
    "number_of_approved_assets": 0,
    "assignment_total_value": 0.00
}
```

### Response attributes

| Field | Type | Description |
|---|---|---|
| `assignment_key` | string | Unique batch identifier (UUID). |
| `external_id` | string | External batch key provided by the partner. |
| `status` | string | New batch status: `completed_assets_insertion`. |
| `number_of_approved_assets` | integer | Number of approved assets in the batch. At this stage, the value will be `0` since eligibility has not yet been processed. |
| `assignment_total_value` | number | Total assignment value in BRL. At this stage, the value will be `0.00` since pricing has not yet occurred. |

## Possible errors

STATUS 400

**Batch has no inserted assets**

You attempted to close asset insertion, but the batch has no assets yet. You must [insert at least one asset](/documentation/iaas/negociacao_recebiveis/asset/criacao_co) before closing the batch.

```json
{
  "title": "Cannot Close This Assignment",
  "description": "Cannot close this assignment because there is no asset.",
  "translation": "Não é possível fechar este lote porque não há nenhum ativo.",
  "code": "TRC000042"
}
```

## Next steps

After closing the insertion, the flow continues automatically:

1. **Asset eligibility** — each asset will be analyzed individually. You will receive [asset webhooks](/documentation/iaas/negociacao_recebiveis/asset/webhooks) informing approval or denial.
2. **Batch eligibility** — once all assets have been analyzed, the batch eligibility will be evaluated. The result will be notified via a [batch webhook](/documentation/iaas/negociacao_recebiveis/assignment/webhooks).
3. **[Manager approval](/documentation/iaas/negociacao_recebiveis/assignment/aprovacao)** — if the batch is approved in eligibility, the fund manager must approve it.

---

# Assignment Batch Listing

URL: /en/documentation/iaas/negociacao_recebiveis/assignment/listagem

Paginated query endpoint that returns assignment batches for a given fund class. Use the available filters to search batches by date, status, or combinations of status.

:::info Fund class endpoint
Unlike other batch endpoints, this one uses only the `fund_class_key` in the URL — no need to provide `assignment_configuration_key`. This allows listing batches from all assignment configurations of a fund at once.
:::

## Request

ENDPOINT /trade_receivables/fund_class/{fund_class_key}/assignments
METHOD GET

### Query params

| Parameter | Type | Required | Description |
|---|---|---|---|
| `assignment_date` | string | optional | Filter by assignment date in `YYYY-MM-DD` format. |
| `assignment_status` | string | optional | Filter by a specific batch status. |
| `in_status` | array | optional | List of statuses to **include** in the search. Returns only batches that are in one of the provided statuses. |
| `not_in_status` | array | optional | List of statuses to **exclude** from the search. Returns only batches that are **not** in the provided statuses. |
| `assignor_document_number` | string | optional | Filter by assignor CPF/CNPJ. Must be sent **with punctuation** (e.g., `12.345.678/0001-90` or `123.456.789-00`). |
| `page` | integer | optional | Page number (starts at 0). Default: `0`. |
| `limit` | integer | optional | Number of records per page. Default: `25`. Maximum: `155`. |

```python title="Example call"
GET /trade_receivables/fund_class/{fund_class_key}/assignments?assignment_date=2024-04-01&in_status=pending_manager_approval,completed&page=0&limit=10
```

## Response

STATUS 200

```json title="Response Body"
{
  "data": [
    {
      "assignment_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
      "external_id": "931e9437-d025-41ab-bb53-6b94e10fd361",
      "name": "ASSIGNMENT #12345",
      "assignment_configuration": {
        "assignment_configuration_key": "3571e292-3a83-4011-904d-20ee963022ef",
        "validation_configuration_key": "v1w2x3y4-z5a6-7890-abcd-ef1234567890",
        "assignment_configuration_name": "CCB Config Fund Alpha",
        "assignment_contract_key": "k1l2m3n4-o5p6-7890-abcd-ef1234567890",
        "registry_type": "internal_registry",
        "asset_type": "ccb",
        "assignment_configuration_type": "standard",
        "consultant_decision_type": "manual_approval",
        "asset_fees": null,
        "assignment_reports": null,
        "fund_class": {
          "fund_class_key": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
          "name": "Alpha FIDC Fund",
          "document_number": "12.345.678/0001-90",
          "accounting_date": "2024-04-01",
          "manager": {
            "manager_key": "e1f2a3b4-c5d6-7890-abcd-ef1234567890",
            "document_number": "11.222.333/0001-44",
            "manager_name": "Example Manager S.A."
          }
        },
        "assignor": {
          "assignor_key": "c1d2e3f4-a5b6-7890-abcd-ef1234567890",
          "document_number": "98.765.432/0001-10",
          "name": "Example Assignor Ltda"
        },
        "consultant": {
          "consultant_key": "g1h2i3j4-k5l6-7890-abcd-ef1234567890",
          "document_number": "55.666.777/0001-88",
          "name": "Example Consulting Ltda"
        },
        "originator_bonds": [
          {
            "originator": {
              "originator_key": "h1i2j3k4-l5m6-7890-abcd-ef1234567890",
              "document_number": "22.333.444/0001-55",
              "name": "Example Originator Ltda"
            }
          }
        ],
        "webhook_configuration_bonds": [
          {
            "webhook_configuration_bond": {
              "webhook_configuration_key": "w1x2y3z4-a5b6-7890-abcd-ef1234567890",
              "agent_type": "assignor",
              "agent_key": "c1d2e3f4-a5b6-7890-abcd-ef1234567890"
            },
            "signature_key": "s1t2u3v4-w5x6-7890-abcd-ef1234567890",
            "webhook_url": "https://partner.example.com/webhooks/trade_receivables"
          }
        ]
      },
      "assignment_number": "00012345",
      "assignment_date": "2024-04-01",
      "status": "completed",
      "assignment_term_key": "b1c2d3e4-f5a6-7890-abcd-ef1234567890",
      "disbursement": {
        "target_account": {
          "account_key": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
          "account_type": "checking_account",
          "account_branch": "001",
          "account_number": "12345",
          "account_digit": "4",
          "financial_institution_code": "341",
          "financial_institution_ispb": "60701190",
          "owner": {
            "document_number": "98.765.432/0001-10"
          }
        }
      },
      "assignment_total_value": 150000.00,
      "assignment_irr": 0.0215
    }
  ],
  "limit": 10,
  "page": 0,
  "is_last_page": true
}
```

### Response attributes

| Field | Type | Description |
|---|---|---|
| `data` | array | List of assignment batch objects. See table below. |
| `page` | integer | Current page number. |
| `limit` | integer | Number of records per page. |
| `is_last_page` | boolean | Indicates whether this is the last page of results. |

#### Attributes of each batch (objects within `data`)

Each object in the array has the same structure returned by the [Batch Retrieval](/documentation/iaas/negociacao_recebiveis/assignment/recuperacao) endpoint, except for the `status_events` field which is **not returned** in the listing.

| Field | Type | Description |
|---|---|---|
| `assignment_key` | string | Unique batch identifier (UUID). |
| `external_id` | string | External key provided by the partner. |
| `name` | string | Assignment identifying name. |
| `assignment_number` | string | Assignment batch number. |
| `assignment_date` | string | Assignment date in `YYYY-MM-DD` format. |
| `status` | string | Current batch status. See the [status enumerators](#batch-status-enumerators) table below. |
| `origin_type` | string | Batch origin (e.g., `client`). |
| `assignment_term_key` | string | Assignment Term key (UUID). Available after term generation. |
| `assignment_total_value` | number | Total assignment value in BRL. May not be present if not yet calculated. |
| `assignment_irr` | number | Internal rate of return (IRR) of the batch. May not be present if not yet calculated. |
| `assignment_configuration` | object | Data of the assignment configuration associated with the batch. See [assignment_configuration attributes](/documentation/iaas/negociacao_recebiveis/assignment/recuperacao#assignment_configuration-attributes) on the Retrieval page. |
| `disbursement` | object \| null | Disbursement account data (when applicable). |
| `assignor_discounts` | array | List of assignor discounts. Present only when discounts are configured. See [assignor_discounts attributes](/documentation/iaas/negociacao_recebiveis/assignment/recuperacao#assignor_discounts-attributes) on the Retrieval page. |

## Batch status enumerators

| Status | Description |
|---|---|
| `pending_assets_insertion` | Batch created, awaiting asset insertion |
| `completed_assets_insertion` | Asset insertion closed, awaiting eligibility |
| `pending_eligibility` | Under eligibility analysis |
| `pending_consultant_approval` | Awaiting consultant approval |
| `pending_manager_approval` | Awaiting manager approval |
| `pending_assets_registry` | Awaiting asset registration |
| `pending_assignment_term` | Awaiting Assignment Term generation |
| `pending_assignment_term_signature` | Awaiting Assignment Term signature |
| `pending_custody` | Awaiting custody |
| `pending_payment` | Awaiting payment to assignor |
| `pending_assets_wallet_inclusion` | Awaiting asset portfolio inclusion |
| `completed` | Assignment completed successfully |
| `denied` | Batch denied in eligibility |
| `discarded` | Batch discarded |

---

# Assignment Batch Retrieval

URL: /en/documentation/iaas/negociacao_recebiveis/assignment/recuperacao

Retrieves the complete details of a specific assignment batch, including configuration information, current status, event history, disbursement data, and financial values.

:::tip When to use
Use this endpoint to check the current state of a batch at any point in the flow — for example, to verify if the batch has passed eligibility, if the manager has already approved it, or if payment has been made.
:::

## Request

ENDPOINT /trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment/{assignment_external_id}
METHOD GET

### Path params

| Parameter | Type | Description |
|---|---|---|
| `fund_class_key` | string | Unique fund key (UUID). |
| `assignment_configuration_key` | string | Assignment configuration key (UUID). |
| `assignment_external_id` | string | The `external_id` provided at batch creation. |

## Response

STATUS 200

```json title="Response Body"
{
  "assignment_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
  "external_id": "931e9437-d025-41ab-bb53-6b94e10fd361",
  "name": "ASSIGNMENT #12345",
  "assignment_configuration": {
    "assignment_configuration_key": "3571e292-3a83-4011-904d-20ee963022ef",
    "validation_configuration_key": "v1w2x3y4-z5a6-7890-abcd-ef1234567890",
    "assignment_configuration_name": "CCB Config Fund Alpha",
    "assignment_contract_key": "k1l2m3n4-o5p6-7890-abcd-ef1234567890",
    "registry_type": "internal_registry",
    "asset_type": "ccb",
    "assignment_configuration_type": "standard",
    "consultant_decision_type": "manual_approval",
    "asset_fees": null,
    "assignment_reports": null,
    "fund_class": {
      "fund_class_key": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
      "name": "Alpha FIDC Fund",
      "document_number": "12.345.678/0001-90",
      "accounting_date": "2024-04-01",
      "manager": {
        "manager_key": "e1f2a3b4-c5d6-7890-abcd-ef1234567890",
        "document_number": "11.222.333/0001-44",
        "manager_name": "Example Manager S.A."
      }
    },
    "assignor": {
      "assignor_key": "c1d2e3f4-a5b6-7890-abcd-ef1234567890",
      "document_number": "98.765.432/0001-10",
      "name": "Example Assignor Ltda"
    },
    "consultant": {
      "consultant_key": "g1h2i3j4-k5l6-7890-abcd-ef1234567890",
      "document_number": "55.666.777/0001-88",
      "name": "Example Consulting Ltda"
    },
    "originator_bonds": [
      {
        "originator": {
          "originator_key": "h1i2j3k4-l5m6-7890-abcd-ef1234567890",
          "document_number": "22.333.444/0001-55",
          "name": "Example Originator Ltda"
        }
      }
    ],
    "webhook_configuration_bonds": [
      {
        "webhook_configuration_bond": {
          "webhook_configuration_key": "w1x2y3z4-a5b6-7890-abcd-ef1234567890",
          "agent_type": "assignor",
          "agent_key": "c1d2e3f4-a5b6-7890-abcd-ef1234567890"
        },
        "signature_key": "s1t2u3v4-w5x6-7890-abcd-ef1234567890",
        "webhook_url": "https://partner.example.com/webhooks/trade_receivables"
      }
    ]
  },
  "assignment_number": "00012345",
  "assignment_date": "2024-04-01",
  "status": "completed",
  "origin_type": "client",
  "assignment_term_key": "b1c2d3e4-f5a6-7890-abcd-ef1234567890",
  "disbursement": {
    "target_account": {
      "account_key": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
      "account_type": "checking_account",
      "account_branch": "001",
      "account_number": "12345",
      "account_digit": "4",
      "financial_institution_code": "341",
      "financial_institution_ispb": "60701190",
      "owner": {
        "document_number": "98.765.432/0001-10"
      }
    }
  },
  "assignment_total_value": 150000.00,
  "assignment_irr": 0.0215,
  "assignor_discounts": [
    {
      "assignor_discount_key": "ad12e3f4-a5b6-7890-abcd-ef1234567890",
      "assignor_discount_type": "flat_rate",
      "status": "approved",
      "total_value": 500.00,
      "description": "Administration fee"
    }
  ],
  "status_events": [
    {
      "status": "pending_assets_insertion",
      "event_datetime": "2024-04-01 10:00:00"
    },
    {
      "status": "completed_assets_insertion",
      "event_datetime": "2024-04-01 11:30:00"
    },
    {
      "status": "pending_eligibility",
      "event_datetime": "2024-04-01 11:35:00"
    },
    {
      "status": "completed",
      "event_datetime": "2024-04-01 16:00:00",
      "selected_agent": {
        "AGENT-TYPE": "manager",
        "AGENT-KEY": "e1f2a3b4-c5d6-7890-abcd-ef1234567890",
        "AGENT-USER": "manager@example.com"
      }
    }
  ]
}
```

### Response attributes

| Field | Type | Description |
|---|---|---|
| `assignment_key` | string | Unique batch identifier generated by QI Tech (UUID). |
| `external_id` | string | External key provided by the partner at creation. |
| `name` | string | Assignment identifying name. |
| `assignment_number` | string | Sequential assignment batch number. |
| `assignment_date` | string | Assignment date in `YYYY-MM-DD` format. |
| `status` | string | Current batch status. See the [status enumerators](/documentation/iaas/negociacao_recebiveis/assignment/listagem#batch-status-enumerators) for all possible values. |
| `assignment_term_key` | string | Assignment Term key (UUID). Available after term generation. |
| `assignment_total_value` | number | Total assignment value in BRL. Available after approval. May not be present if not yet calculated. |
| `assignment_irr` | number | Internal rate of return (IRR) of the batch. May not be present if not yet calculated. |
| `assignment_configuration` | object | Complete assignment configuration data. See table below. |
| `disbursement` | object \| null | Disbursement account data. `null` when not yet configured. |
| `assignor_discounts` | array | List of assignor discounts. Present only when discounts are configured. See table below. |
| `status_events` | array | Batch status transition history. See table below. |

#### `assignment_configuration` attributes

| Field | Type | Description |
|---|---|---|
| `assignment_configuration_key` | string | Configuration key (UUID). |
| `validation_configuration_key` | string | Validation configuration key (UUID). |
| `assignment_configuration_name` | string | Assignment configuration name. |
| `assignment_contract_key` | string | Assignment contract key (UUID). |
| `registry_type` | string | Asset registration type (e.g., `internal_registry`, `external_registry`). |
| `asset_type` | string | Asset type accepted in this configuration (e.g., `ccb`, `duplicata_mercantil`, `duplicata_servico`). |
| `assignment_configuration_type` | string | Assignment configuration type (e.g., `standard`). |
| `consultant_decision_type` | string | Consultant decision type (e.g., `manual_approval`, `auto_approval`). |
| `asset_fees` | object \| null | Asset fee configuration, when applicable. |
| `assignment_reports` | object \| null | Assignment report configuration, when applicable. |
| `fund_class` | object | Assignee fund data. See table below. |
| `assignor` | object | Assignor data. See table below. |
| `consultant` | object | Consultant data. Present when the configuration has a linked consultant. See table below. |
| `originator_bonds` | array | List of originators linked to the configuration. See table below. |
| `webhook_configuration_bonds` | array | List of linked webhook configurations. See table below. |

#### `fund_class` attributes

| Field | Type | Description |
|---|---|---|
| `fund_class_key` | string | Unique fund key (UUID). |
| `name` | string | Fund name. |
| `document_number` | string | Fund CNPJ. |
| `accounting_date` | string | Fund's current accounting date in `YYYY-MM-DD` format. |
| `manager` | object | Fund manager data. See table below. |

#### `manager` attributes

| Field | Type | Description |
|---|---|---|
| `manager_key` | string | Unique manager key (UUID). |
| `document_number` | string | Manager CNPJ. |
| `manager_name` | string | Manager name. |

#### `assignor` attributes

| Field | Type | Description |
|---|---|---|
| `assignor_key` | string | Unique assignor key (UUID). |
| `document_number` | string | Assignor CPF/CNPJ. |
| `name` | string | Assignor name. |

#### `consultant` attributes

| Field | Type | Description |
|---|---|---|
| `consultant_key` | string | Unique consultant key (UUID). |
| `document_number` | string | Consultant CNPJ. |
| `name` | string | Consultant name. |

#### `originator_bonds` attributes

| Field | Type | Description |
|---|---|---|
| `originator` | object | Originator data. |
| `originator.originator_key` | string | Unique originator key (UUID). |
| `originator.document_number` | string | Originator CNPJ. |
| `originator.name` | string | Originator name. |

#### `webhook_configuration_bonds` attributes

| Field | Type | Description |
|---|---|---|
| `webhook_configuration_bond` | object | Webhook configuration data. |
| `webhook_configuration_bond.webhook_configuration_key` | string | Unique webhook configuration key (UUID). |
| `webhook_configuration_bond.agent_type` | string | Type of agent that will receive the webhook (e.g., `assignor`, `manager`, `consultant`). |
| `webhook_configuration_bond.agent_key` | string | Key of the linked agent. |
| `signature_key` | string | Signature key for webhook validation (UUID). |
| `webhook_url` | string | Webhook destination URL. |

#### `assignor_discounts` attributes

| Field | Type | Description |
|---|---|---|
| `assignor_discount_key` | string | Unique discount key (UUID). |
| `assignor_discount_type` | string | Assignor discount type (e.g., `flat_rate`). |
| `status` | string | Discount status (e.g., `approved`, `pending`). |
| `total_value` | number | Total discount value in BRL. |
| `description` | string | Discount description. |

#### `status_events` attributes

| Field | Type | Description |
|---|---|---|
| `status` | string | Event status. |
| `event_datetime` | string | Event date and time in `YYYY-MM-DD HH:MM:SS` format. |
| `selected_agent` | object | Data of the agent responsible for the transition. Present only when the transition was made by an identified agent. |

---

# How to create an assignment?

URL: /en/documentation/iaas/negociacao_recebiveis/assignment/video_cessao

This guide presents the complete flow for creating a credit rights assignment, from batch creation to asset portfolio inclusion in the fund. Use the video below as a visual reference and the links to access detailed documentation for each step.

:::tip Full manual
For an in-depth understanding of the business rules and the product, see the [Credit Rights Assignment Manual](/documentation/iaas/negociacao_recebiveis/manual_api).
:::

## Video — Assignment flow via Python

## Step by step

### 1. Batch Creation

Create an assignment batch by providing a unique identifier (`external_id`). The batch will be the container for all assets to be assigned to the fund.

**[Go to batch creation documentation](/documentation/iaas/negociacao_recebiveis/assignment/criacao)**

### 2. Asset Insertion

Add the assets (CCBs, invoices, etc.) to the created batch. Each asset must be inserted individually with its operation details, installments, and borrower data.

**[Go to asset insertion documentation](/documentation/iaas/negociacao_recebiveis/asset/criacao_co)**

### 3. Document Submission

For each asset approved in individual eligibility, submit the documents required by the product (contract, invoice, etc.). The asset only advances in the pipeline after all required documents have been submitted.

**[Go to document submission documentation](/documentation/iaas/negociacao_recebiveis/asset/documents)**

### 4. Close Insertion

Signal that all assets have been inserted into the batch. This command allows the system to evaluate the eligibility of the batch as a whole after all assets have been analyzed.

**[Go to closure documentation](/documentation/iaas/negociacao_recebiveis/assignment/fechamento)**

### 5. Manager Approval

After batch eligibility is approved, the fund manager analyzes and approves or denies the batch. If approved, the Assignment Term will be generated automatically.

**[Go to manager approval documentation](/documentation/iaas/negociacao_recebiveis/assignment/aprovacao)**

### 6. Signature, Payment, and Portfolio Inclusion

The final steps are automated: the Assignment Term is signed by the parties, payment is made to the assignor, and assets are added to the fund's portfolio. Track progress through [batch webhooks](/documentation/iaas/negociacao_recebiveis/assignment/webhooks).

---

# Assignment Batch Webhooks

URL: /en/documentation/iaas/negociacao_recebiveis/assignment/webhooks

Throughout the assignment flow, the system sends webhooks to notify the integrating partner about batch status changes. All webhooks have the type `trade_receivables.assignment_status_change` and identify the batch by the `assignment_external_id` provided at creation.

:::info Webhook configuration
To receive webhooks, you must have a callback URL configured with QI Tech. Contact [integracao.dtvm@qitech.com.br](mailto:integracao.dtvm@qitech.com.br) to set up.
:::

## Batch status flow

The diagram below illustrates the status transitions that generate webhooks throughout the flow:

```mermaid
graph TB
    A[pending_assets_insertion] -->|Insertion closed| B[completed_assets_insertion]
    B --> C[pending_eligibility]
    C -->|Denied| Y[denied]
    Y --> Z[discarded]
    C -->|With consultant| D[pending_consultant_approval]
    C -->|Without consultant| E[pending_manager_approval]
    D -->|Consultant approved| E
    D -->|Consultant denied| Y
    E -->|Manager denied| Y
    E -->|Manager approved| F[waiting_assets_to_formalize]
    F -->|Assets formalized| G[pending_assignment_term]
    G -->|Term ready| H[pending_assignment_term_signature]
    F -->|Term ready directly| H
    H -->|Term signed| I[pending_payment]
    I -->|Payment confirmed| J[pending_assets_wallet_inclusion]
    J -->|Assets in portfolio| K[completed]
```

## Webhook structure

All assignment batch webhooks share the same structure:

| Field | Type | Description |
|---|---|---|
| `webhook_type` | string | Always `trade_receivables.assignment_status_change`. |
| `webhook_datetime` | string | Event date and time in ISO 8601 format. |
| `data` | object | Event data. See table below. |

#### `data` attributes

| Field | Type | Description |
|---|---|---|
| `assignment_external_id` | string | The `external_id` of the batch provided at creation. |
| `assignment_new_status` | string | New batch status. |
| `fund_class_key` | string | Identifier of the fund class associated with the batch. |
| `signed_term_url` | string | URL to download the signed Assignment Term. Present only in the `pending_payment` webhook when the term was signed digitally. |

```json title="Standard webhook structure"
{
    "data": {
        "assignment_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
        "assignment_new_status": "STATUS",
        "fund_class_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c"
    },
    "webhook_type": "trade_receivables.assignment_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

## Events by status

### Batch Created — Awaiting Asset Insertion

STATUS pending_assets_insertion

Sent when a new assignment batch is successfully created and is ready to receive assets. This is the first webhook in the batch lifecycle. The assignor can insert assets while the batch is in this status.

```json title="Webhook Body"
{
    "data": {
        "assignment_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
        "assignment_new_status": "pending_assets_insertion",
        "fund_class_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c"
    },
    "webhook_type": "trade_receivables.assignment_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

### Asset Insertion Completed

STATUS completed_assets_insertion

Sent when asset insertion is **closed** by the assignor. From this point, no more assets can be added to the batch, which automatically advances to the eligibility analysis.

```json title="Webhook Body"
{
    "data": {
        "assignment_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
        "assignment_new_status": "completed_assets_insertion",
        "fund_class_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c"
    },
    "webhook_type": "trade_receivables.assignment_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

### Under Eligibility Analysis

STATUS pending_eligibility

Sent when the batch starts the eligibility analysis process. All assets are analyzed individually, and the aggregate result determines the batch approval or denial.

```json title="Webhook Body"
{
    "data": {
        "assignment_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
        "assignment_new_status": "pending_eligibility",
        "fund_class_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c"
    },
    "webhook_type": "trade_receivables.assignment_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

### Pending Consultant Approval

STATUS pending_consultant_approval

Sent when the batch passes eligibility analysis and is awaiting the **consultant's** decision. This status occurs when the configured approval flow requires prior consultant approval before the manager. The consultant can approve or deny the batch via the [Consultant Portal](https://consultant-dash.qidtvm.com.br/).

```json title="Webhook Body"
{
    "data": {
        "assignment_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
        "assignment_new_status": "pending_consultant_approval",
        "fund_class_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c"
    },
    "webhook_type": "trade_receivables.assignment_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

### Pending Manager Approval

STATUS pending_manager_approval

Sent when the batch is **approved in eligibility** (and by the consultant, when applicable) and is awaiting the fund manager's decision. The manager must approve or deny the batch via [Manager Approval](/documentation/iaas/negociacao_recebiveis/assignment/aprovacao) or the [Manager Portal](https://manager-dash.qidtvm.com.br/).

```json title="Webhook Body"
{
    "data": {
        "assignment_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
        "assignment_new_status": "pending_manager_approval",
        "fund_class_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c"
    },
    "webhook_type": "trade_receivables.assignment_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

### Awaiting Asset Formalization

STATUS waiting_assets_to_formalize

Sent when the manager **approves** the batch and the system awaits the completion of formalization (registration) of all approved assets. The batch remains in this status until all assets complete the registration process.

```json title="Webhook Body"
{
    "data": {
        "assignment_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
        "assignment_new_status": "waiting_assets_to_formalize",
        "fund_class_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c"
    },
    "webhook_type": "trade_receivables.assignment_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

### Awaiting Assignment Term Generation

STATUS pending_assignment_term

Sent when all assets have been formalized and the system is **generating the Assignment Term**. The batch awaits completion of document generation before submitting it for signature.

```json title="Webhook Body"
{
    "data": {
        "assignment_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
        "assignment_new_status": "pending_assignment_term",
        "fund_class_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c"
    },
    "webhook_type": "trade_receivables.assignment_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

### Pending Term Signature

STATUS pending_assignment_term_signature

Sent after manager approval, when the Assignment Term has been generated and submitted for signature by all involved parties. You can retrieve the document via [Assignment Documents](/documentation/iaas/negociacao_recebiveis/assignment/documento_da_cessao).

```json title="Webhook Body"
{
    "data": {
        "assignment_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
        "assignment_new_status": "pending_assignment_term_signature",
        "fund_class_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c"
    },
    "webhook_type": "trade_receivables.assignment_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

### Pending Payment

STATUS pending_payment

Sent after the Assignment Term has been signed by all parties. The system will pay the assignor the total amount of the assignment to the configured account. The total amount is the sum of all `total_purchase_value` of non-discarded assets in the batch.

```json title="Webhook Body"
{
    "data": {
        "assignment_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
        "assignment_new_status": "pending_payment",
        "fund_class_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c"
    },
    "webhook_type": "trade_receivables.assignment_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

### Awaiting Asset Portfolio Inclusion

STATUS pending_assets_wallet_inclusion

Sent after payment to the assignor is confirmed, when assets are being **added to the fund's portfolio**. The system processes the inclusion of assets into the fund's inventory.

```json title="Webhook Body"
{
    "data": {
        "assignment_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
        "assignment_new_status": "pending_assets_wallet_inclusion",
        "fund_class_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c"
    },
    "webhook_type": "trade_receivables.assignment_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

### Assignment Completed

STATUS completed

Sent when all assets in the batch have been **successfully added to the fund's portfolio**. From this point on, the assets are within the fund's inventory. This is the final status of a successful assignment.

```json title="Webhook Body"
{
    "data": {
        "assignment_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
        "assignment_new_status": "completed",
        "fund_class_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c"
    },
    "webhook_type": "trade_receivables.assignment_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

### Denied in Eligibility

STATUS denied

Sent when the batch is **denied** in eligibility analysis or by the fund manager/consultant. The batch can still be manipulated, but if no action is taken it will be discarded.

```json title="Webhook Body"
{
    "data": {
        "assignment_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
        "assignment_new_status": "denied",
        "fund_class_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c"
    },
    "webhook_type": "trade_receivables.assignment_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

### Batch Discarded

STATUS discarded

Sent when the batch is discarded. This can occur due to eligibility denial, manager denial, or issues in asset registration. The batch will not advance further in the flow.

```json title="Webhook Body"
{
    "data": {
        "assignment_external_id": "1caff47c-bd05-48b0-a6bc-9569f5070f6b",
        "assignment_new_status": "discarded",
        "fund_class_key": "b7d3e2a1-4c5f-4e8b-9d1a-2f3c4e5a6b7c"
    },
    "webhook_type": "trade_receivables.assignment_status_change",
    "webhook_datetime": "2024-04-23T15:08:30Z"
}
```

---

# Assignment Flow

URL: /en/documentation/iaas/negociacao_recebiveis/fluxo_cessao

This page provides a holistic view of the entire credit rights assignment flow, from batch creation to asset inclusion in the fund's portfolio. Follow the evolution of **batch statuses**, **asset statuses**, and **webhooks** received at each step.

:::tip How to use this flowchart
Hover over each step to see endpoint details and access the full documentation. The three colored tracks show simultaneously what happens to the batch, assets, and which webhooks you will receive.
:::

{`
.cf-legend{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:24px}
.cf-legend-item{display:flex;align-items:center;gap:6px;font-size:0.8rem;font-weight:600}
.cf-legend-dot{width:12px;height:12px;border-radius:3px}

.cf-step{position:relative;margin-bottom:4px}
.cf-step:not(:last-child)::after{content:'';display:block;width:2px;height:16px;margin:0 auto;background:var(--ifm-color-emphasis-300)}

.cf-card{border:1.5px solid var(--ifm-color-emphasis-200);border-radius:10px;padding:16px 20px;transition:box-shadow 0.2s,border-color 0.2s;cursor:pointer;background:var(--ifm-background-surface-color,var(--ifm-background-color))}
.cf-card:hover{box-shadow:0 4px 16px rgba(0,0,0,0.08);border-color:var(--ifm-color-primary)}

.cf-card-header{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.cf-num{width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:0.8rem;font-weight:800;color:#fff;flex-shrink:0}
.cf-num-int{background:#3b82f6}
.cf-num-qi{background:#8b5cf6}
.cf-num-ges{background:#d946ef}
.cf-title{font-size:1rem;font-weight:700;color:var(--ifm-font-color-base)}
.cf-actor{font-size:0.7rem;font-weight:700;padding:2px 8px;border-radius:12px;margin-left:auto}
.cf-actor-int{background:rgba(59,130,246,0.12);color:#2563eb}
.cf-actor-qi{background:rgba(139,92,246,0.12);color:#7c3aed}
.cf-actor-ges{background:rgba(217,70,239,0.12);color:#c026d3}
.cf-subtitle{font-size:0.82rem;color:var(--ifm-color-emphasis-700);margin-top:4px;margin-left:38px}

.cf-tracks{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;margin-left:38px}
.cf-track{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:6px;font-size:0.75rem;font-family:var(--ifm-font-family-monospace);border:1px solid}
.cf-track-lote{background:rgba(34,197,94,0.1);color:#16a34a;border-color:rgba(34,197,94,0.25)}
.cf-track-ativo{background:rgba(59,130,246,0.1);color:#2563eb;border-color:rgba(59,130,246,0.25)}
.cf-track-wh{background:rgba(245,158,11,0.1);color:#b45309;border-color:rgba(245,158,11,0.25)}
.cf-track-err{background:rgba(239,68,68,0.1);color:#dc2626;border-color:rgba(239,68,68,0.25)}
.cf-track-label{font-family:var(--ifm-font-family-base);font-weight:700;font-size:0.7rem;text-transform:uppercase;letter-spacing:0.03em}
.cf-new{font-weight:700}
.cf-unchanged{opacity:0.5}

.cf-details{max-height:0;overflow:hidden;opacity:0;transition:max-height 0.35s ease,opacity 0.25s ease,margin 0.3s ease;margin-left:38px}
.cf-card:hover .cf-details{max-height:300px;opacity:1;margin-top:14px;padding-top:12px;border-top:1px solid var(--ifm-color-emphasis-200)}

.cf-endpoint{font-family:var(--ifm-font-family-monospace);font-size:0.82rem;padding:8px 12px;border-radius:6px;background:var(--ifm-color-emphasis-100);margin-bottom:8px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.cf-method{font-weight:800;padding:2px 6px;border-radius:4px;font-size:0.72rem}
.cf-method-post{background:#f97316;color:#fff}
.cf-method-put{background:#3b82f6;color:#fff}
.cf-method-get{background:#22c55e;color:#fff}
.cf-desc{font-size:0.82rem;color:var(--ifm-color-emphasis-700);margin-bottom:8px}
.cf-link{font-size:0.82rem;font-weight:600;color:var(--ifm-color-primary);text-decoration:none}
.cf-link:hover{text-decoration:underline}

.cf-branch{margin-top:12px;margin-left:38px;display:flex;gap:12px;flex-wrap:wrap}
.cf-branch-path{flex:1;min-width:200px;border-radius:8px;padding:10px 14px;border:1.5px dashed}
.cf-branch-ok{border-color:rgba(34,197,94,0.4);background:rgba(34,197,94,0.05)}
.cf-branch-err{border-color:rgba(239,68,68,0.4);background:rgba(239,68,68,0.05)}
.cf-branch-label{font-size:0.78rem;font-weight:700;margin-bottom:4px}
.cf-branch-label-ok{color:#16a34a}
.cf-branch-label-err{color:#dc2626}

html[data-theme='dark'] .cf-track-lote{background:rgba(34,197,94,0.15);color:#4ade80;border-color:rgba(34,197,94,0.3)}
html[data-theme='dark'] .cf-track-ativo{background:rgba(59,130,246,0.15);color:#60a5fa;border-color:rgba(59,130,246,0.3)}
html[data-theme='dark'] .cf-track-wh{background:rgba(245,158,11,0.15);color:#fbbf24;border-color:rgba(245,158,11,0.3)}
html[data-theme='dark'] .cf-track-err{background:rgba(239,68,68,0.15);color:#f87171;border-color:rgba(239,68,68,0.3)}
html[data-theme='dark'] .cf-branch-ok{background:rgba(34,197,94,0.08)}
html[data-theme='dark'] .cf-branch-err{background:rgba(239,68,68,0.08)}
html[data-theme='dark'] .cf-actor-int{background:rgba(59,130,246,0.2);color:#60a5fa}
html[data-theme='dark'] .cf-actor-qi{background:rgba(139,92,246,0.2);color:#a78bfa}
html[data-theme='dark'] .cf-actor-ges{background:rgba(217,70,239,0.2);color:#e879f9}
`}

## Legend

Integration Agent
QI Tech (automatic)
Fund Manager
Batch Status
Asset Status
Webhook

## Flowchart

1
Batch Creation
Integration Agent
Creates an assignment batch with a unique identifier ( external_id ).
Batch: pending_assets_insertion
POST /trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment
The batch is created with status pending_assets_insertion , ready to receive assets.
View full documentation →

2
Asset Insertion
Integration Agent
Inserts assets into the batch (CCB, invoice, or discounted contract). Repeat for each asset.
Batch: pending_assets_insertion
Asset: pending_eligibility
Webhook: asset_creation
POST /trade_receivables/.../assignment/{assignment_external_id}/asset
Each asset is created with status pending_eligibility . You will receive a trade_receivables.asset_creation webhook confirming insertion.
CCB →
Invoice →
Discounted Contract →

3
Document Submission
Integration Agent
Submits required documents for each asset (PDF in Base64). Commercial invoices (duplicatas mercantis) do not require documents.
Batch: pending_assets_insertion
Asset: pending_eligibility
POST /trade_receivables/.../asset/{asset_external_id}/document
Send documents after receiving the pending_documentation webhook for the asset (step 5a).
View full documentation →

4
Close Insertion
Integration Agent
Signals that all assets have been inserted in the batch. The eligibility analysis will start automatically.
Batch: completed_assets_insertion
Asset: pending_eligibility
PUT /trade_receivables/.../assignment/{assignment_external_id}
Send {"assignment_status": "completed_assets_insertion"} . It is not necessary to wait for individual asset eligibility webhooks.
View full documentation →

5a
Asset Eligibility
QI Tech
QI Tech analyzes each asset individually. You receive one webhook per asset with the result.
Batch: completed_assets_insertion
Asset: pre_approved / denied
Webhook: asset_status_change
Asset approved
pre_approved
The asset was pre-approved in eligibility.
Asset rejected
denied
The asset does not proceed in the flow.
Webhook trade_receivables.asset_status_change — sent for each asset with the eligibility result.
View asset webhook documentation →

5b
Batch Eligibility
QI Tech
When all assets have been analyzed, QI Tech evaluates the eligibility of the batch as a whole.
Batch: pending_manager_approval / denied

Webhook: assignment_status_change
Batch eligible
pending_manager_approval
The batch awaits fund manager approval (step 6).
Batch rejected
denied
The batch causes fund non-compliance. Flow ended.
Webhook trade_receivables.assignment_status_change — reports whether the batch was approved or rejected in eligibility.
View batch webhook documentation →

6
Manager Approval
Fund Manager
The fund manager reviews and approves or rejects the batch (via API or the Manager Portal). If approved, the Assignment Term is generated automatically.
Batch: pending_assignment_term_signature
Webhook: assignment_status_change
PUT /trade_receivables/.../assignment/{assignment_external_id}
Endpoint available for managers only. Send {"assignment_status": "approved"} or "denied" . After approval, you receive the webhook with status pending_assignment_term_signature .
View full documentation →

7
Assignment Term Signature
QI Tech
The Assignment Term is generated and sent for signature. All related parties must sign the term for the flow to proceed. The integrator can consult the document at any time.
Batch: pending_payment
Webhook: assignment_status_change
GET /trade_receivables/.../assignment/{assignment_external_id}/assignment_term_link
Consult the Assignment Term (original and signed). After all parties sign, you receive the webhook with status pending_payment .
View full documentation →

8
Payment to Assignor
QI Tech
Payment is made automatically to the assignor in the account configured during onboarding.
Batch: pending_assets_wallet_inclusion
Webhook: assignment_status_change
The total amount is the sum of total_purchase_value of all non-discarded assets. After payment, you receive the webhook with status pending_assets_wallet_inclusion .

9
Portfolio Inclusion
QI Tech
Assets are included in the fund's portfolio. The assignment is complete.
Batch: completed
Asset: completed
Webhook: assignment_status_change
You receive the final webhook with status completed . From this moment, the assets are in the fund's portfolio.
View webhook documentation →

---

## Webhook Summary

The table below consolidates all webhooks the integrator receives throughout the flow, in chronological order:

| # | Webhook Type | Status | Point in Flow | Expected Action |
|---|---|---|---|---|
| 1 | `asset_creation` | `pending_eligibility` | After each asset insertion (step 2) | None — receipt confirmation. |
| 2 | `asset_status_change` | `pre_approved` | Asset approved in eligibility (step 5a) | None — asset pre-approved. |
| 3 | `asset_status_change` | `denied` | Asset rejected in eligibility (step 5a) | None — asset does not proceed. |
| 4 | `assignment_status_change` | `pending_manager_approval` | Batch approved in eligibility (step 5b) | Wait for [manager approval](/documentation/iaas/negociacao_recebiveis/assignment/aprovacao). |
| 5 | `assignment_status_change` | `denied` | Batch rejected in eligibility (step 5b) | None — flow ended. |
| 6 | `assignment_status_change` | `pending_assignment_term_signature` | Manager approved the batch (step 6) | Optional: [consult Assignment Term](/documentation/iaas/negociacao_recebiveis/assignment/documento_da_cessao). |
| 7 | `assignment_status_change` | `pending_payment` | Term signed by all parties (step 7) | None — payment in processing. |
| 8 | `assignment_status_change` | `pending_assets_wallet_inclusion` | Payment completed (step 8) | None — portfolio inclusion in processing. |
| 9 | `assignment_status_change` | `completed` | Assets included in portfolio (step 9) | Assignment completed successfully. |
| — | `assignment_status_change` | `discarded` | Any time (rejection/error) | None — batch discarded. |

:::info Webhook prefix
All webhook types have the prefix `trade_receivables.`. For example: `trade_receivables.asset_creation` and `trade_receivables.assignment_status_change`. For details on the complete webhook structure, see [Asset Webhooks](/documentation/iaas/negociacao_recebiveis/asset/webhooks) and [Batch Webhooks](/documentation/iaas/negociacao_recebiveis/assignment/webhooks).
:::

---

# Credit Rights Assignment

URL: /en/documentation/iaas/negociacao_recebiveis/inicio

This section documents the APIs that enable the Credit Rights Assignment process for Investment Funds administered by QI CTVM. The flow covers everything from assignment batch creation to asset inclusion in the fund's portfolio.

:::tip Full Manual
For an in-depth understanding of the business rules and product, see the [Credit Rights Assignment Manual](/documentation/iaas/negociacao_recebiveis/manual_api). We recommend reading it alongside the routes provided here.
:::

:::info Prerequisites
- To access these services, contact [integracao.dtvm@qitech.com.br](mailto:integracao.dtvm@qitech.com.br) to enable access to the Sandbox (Staging) and Production environments.
- You will need the `fund_class_key` (fund key) and the `assignment_configuration_key` (assignment configuration key), obtained during [Assignor Onboarding](/documentation/iaas/homologacao_cedente/contrato_de_cessao/pedido_de_contrato).
- To query available assignment configurations, use the [Assignment Configuration Listing](/documentation/iaas/negociacao_recebiveis/listagem) endpoint.
:::

## Assignment Flow

The diagram below shows the main path, the branches and the resulting status of each step. Hover a node to see the endpoint and click to open its documentation.

<FlowDiagram
  columns={3}
  labels={{ you: 'Integrator', qitech: 'QI Tech', manager: 'Fund manager', docs: 'View documentation' }}
  nodes={[
    { id: 'criacao', row: 1, col: 2, actor: 'you', num: 1,
      title: 'Batch Creation',
      status: 'pending_assets_insertion',
      desc: 'Container for all assets that will be assigned to the fund, identified by a unique external_id.',
      endpoint: { method: 'POST', path: '/trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment' },
      href: '/documentation/iaas/negociacao_recebiveis/assignment/criacao' },

    { id: 'ativos', row: 2, col: 2, actor: 'you', num: 2,
      title: 'Asset Insertion',
      status: 'asset: pending_eligibility',
      desc: 'One request per asset, with its operation information, installments and borrower data.',
      endpoint: { method: 'POST', path: '.../assignment/{assignment_external_id}/asset' },
      href: '/documentation/iaas/negociacao_recebiveis/asset/criacao_co' },

    { id: 'documentos', row: 3, col: 2, actor: 'you', num: 3,
      title: 'Document Submission',
      desc: 'The asset only proceeds in the pipeline after every document required by the product has been submitted.',
      endpoint: { method: 'POST', path: '.../asset/{asset_external_id}/document' },
      href: '/documentation/iaas/negociacao_recebiveis/asset/documents' },

    { id: 'fechamento', row: 4, col: 2, actor: 'you', num: 4,
      title: 'Insertion Closure',
      status: 'completed_assets_insertion',
      desc: 'Signals that all assets have been inserted and releases the batch for the eligibility analysis.',
      endpoint: { method: 'PUT', path: '.../assignment/{assignment_external_id}' },
      href: '/documentation/iaas/negociacao_recebiveis/assignment/fechamento' },

    { id: 'elegibilidade', row: 5, col: 2, actor: 'qitech',
      title: 'Asset and batch eligibility',
      desc: 'Each asset is analysed individually and then the batch as a whole. Rejected assets do not stay in the batch.',
      href: '/documentation/iaas/negociacao_recebiveis/asset/webhooks' },

    { id: 'reprovado', row: 6, col: 1, actor: 'qitech', tone: 'end',
      title: 'Rejected',
      status: 'denied',
      desc: 'The asset or the batch failed eligibility, or the fund manager rejected the batch. Flow terminated.' },

    { id: 'aprovacao', row: 6, col: 2, actor: 'manager', tag: 'Conditional', num: 5,
      title: 'Consultant and/or manager approval',
      status: 'pending_manager_approval',
      desc: 'A manual step only if the assignment configuration requires it. Otherwise the approval is automatic and no action is needed.',
      endpoint: { method: 'PUT', path: '.../assignment/{assignment_external_id}' },
      href: '/documentation/iaas/negociacao_recebiveis/assignment/aprovacao' },

    { id: 'termo', row: 7, col: 2, actor: 'qitech',
      title: 'Assignment Term generated and signed',
      status: 'pending_assignment_term_signature',
      desc: 'Once the batch is approved, the Assignment Term is generated and signed by all parties.',
      href: '/documentation/iaas/negociacao_recebiveis/assignment/webhooks' },

    { id: 'pagamento', row: 8, col: 2, actor: 'qitech',
      title: 'Payment to the assignor',
      status: 'pending_payment',
      desc: 'The assignment amount is transferred to the assignor.',
      href: '/documentation/iaas/negociacao_recebiveis/assignment/webhooks' },

    { id: 'encarteirado', row: 9, col: 2, actor: 'qitech', tone: 'ok',
      title: "Assets included in the fund's portfolio",
      status: 'completed',
      desc: "The assets enter the fund's portfolio and the batch cycle is closed.",
      href: '/documentation/iaas/negociacao_recebiveis/assignment/webhooks' },
  ]}
  edges={[
    { from: 'criacao', to: 'ativos' },
    { from: 'ativos', to: 'documentos' },
    { from: 'documentos', to: 'fechamento' },
    { from: 'fechamento', to: 'elegibilidade' },
    { from: 'elegibilidade', to: 'reprovado', label: 'denied', tone: 'end' },
    { from: 'elegibilidade', to: 'aprovacao', label: 'pre_approved', tone: 'ok' },
    { from: 'elegibilidade', to: 'termo', label: 'automatic', via: 'right', dashed: true },
    { from: 'aprovacao', to: 'reprovado', tone: 'end' },
    { from: 'aprovacao', to: 'termo', label: 'approved', tone: 'ok' },
    { from: 'termo', to: 'pagamento', label: 'webhook' },
    { from: 'pagamento', to: 'encarteirado', label: 'webhook' },
  ]}
/>

:::tip Full flow
For every status transition, the webhook payloads and the exception paths, see the [Assignment Flow](/documentation/iaas/negociacao_recebiveis/fluxo_cessao).
:::

## Step by Step

### 1. Batch Creation

Create an assignment batch with a unique identifier (`external_id`). The batch is the container for all assets that will be assigned to the fund.

**[Access batch creation documentation](/documentation/iaas/negociacao_recebiveis/assignment/criacao)**

### 2. Asset Insertion

Add assets (CCBs, invoices, etc.) to the created batch. Each asset must be inserted individually with its operation information, installments, and borrower data.

**[Access asset insertion documentation](/documentation/iaas/negociacao_recebiveis/asset/criacao_co)**

### 3. Document Submission

For each asset inserted, send the documents required by the product (contract, invoice, etc.). The asset only proceeds in the pipeline after all required documents have been submitted.

**[Access document submission documentation](/documentation/iaas/negociacao_recebiveis/asset/documents)**

### 4. Insertion Closure

Signal that all assets have been inserted in the batch. The system will wait for individual analysis of each asset before proceeding with the eligibility of the batch as a whole.

**[Access closure documentation](/documentation/iaas/negociacao_recebiveis/assignment/fechamento)**

### 5. Manager Approval

After the batch eligibility is approved, the batch moves on to approval. Depending on the assignment configuration, this step is either **manual** — the consultant and/or the fund manager review and approve or reject the batch, and the batch stays in `pending_consultant_approval` / `pending_manager_approval` until the decision is made — or **automatic**, with no action from the integrator. If approved, the Assignment Term will be generated automatically.

**[Access approval documentation](/documentation/iaas/negociacao_recebiveis/assignment/aprovacao)**

### 6. Signature, Payment, and Portfolio Inclusion

The final steps are automated: the Assignment Term is signed by all parties, payment is made to the assignor, and assets are included in the fund's portfolio. Track progress through [batch webhooks](/documentation/iaas/negociacao_recebiveis/assignment/webhooks).

## Substitution Batches

The substitution flow follows the same steps as the assignment flow, with an additional step: before inserting the assets to be purchased, it is necessary to insert the assets that will be **repurchased** by the assignor.

1. Batch creation
2. **Repurchase asset insertion** — [Access documentation](/documentation/iaas/negociacao_recebiveis/asset/criacao_repurchased_asset)
3. Insertion of assets to be purchased
4. Insertion closure

---

# Assignment Configuration Listing

URL: /en/documentation/iaas/negociacao_recebiveis/listagem

Paginated query endpoint that returns assignment configurations linked to a given fund class. Each configuration represents the relationship between an assignee fund and an assignor, including registration rules, accepted asset type, and approval settings.

## Request

ENDPOINT /trade_receivables/fund_class/{fund_class_key}/assignment_configurations
METHOD GET

### Path params

| Parameter | Type | Description |
|---|---|---|
| `fund_class_key` | string | Unique fund key (UUID). |

### Query params

| Parameter | Type | Required | Description |
|---|---|---|---|
| `assignment_contract_key` | string | optional | Filter by key of the contract that originated the configuration (UUID). |
| `asset_type` | string | optional | Filter by accepted asset type in the configuration (e.g., `ccb`, `duplicata_mercantil`, `duplicata_servicos`). |
| `assignor_document_number` | string | optional | Filter by assignor CPF/CNPJ. Must be sent **with punctuation** (e.g., `12.345.678/0001-90` or `123.456.789-00`). |
| `page` | integer | optional | Page number (starts at 0). Default: `0`. |
| `limit` | integer | optional | Number of records per page. Default: `10`. |

```python title="Example call"
GET /trade_receivables/fund_class/{fund_class_key}/assignment_configurations?asset_type=ccb&assignor_document_number=98.765.432/0001-10&page=0&limit=10
```

## Response

STATUS 200

```json title="Response Body"
{
  "data": [
    {
      "assignment_configuration_key": "3571e292-3a83-4011-904d-20ee963022ef",
      "assignment_configuration_name": "CCB Config Fund Alpha",
      "assignment_contract_key": "k1l2m3n4-o5p6-7890-abcd-ef1234567890",
      "registry_type": "internal_registry",
      "asset_type": "ccb",
      "fund_class": {
        "fund_class_key": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
        "name": "Alpha FIDC Fund",
        "document_number": "12.345.678/0001-90",
        "accounting_date": "2024-04-01",
        "manager": {
          "manager_key": "e1f2a3b4-c5d6-7890-abcd-ef1234567890",
          "document_number": "11.222.333/0001-44",
          "manager_name": "Example Manager S.A."
        }
      },
      "assignor": {
        "assignor_key": "c1d2e3f4-a5b6-7890-abcd-ef1234567890",
        "document_number": "98.765.432/0001-10",
        "name": "Example Assignor Ltda"
      },
      "consultant_decision_type": "manual_approval",
      "consultant": {
        "consultant_key": "g1h2i3j4-k5l6-7890-abcd-ef1234567890",
        "document_number": "55.666.777/0001-88",
        "name": "Example Consulting Ltda"
      }
    }
  ],
  "limit": 10,
  "page": 0,
  "is_last_page": true
}
```

### Response attributes

| Field | Type | Description |
|---|---|---|
| `data` | array | List of assignment configuration objects. See table below. |
| `page` | integer | Current page number. |
| `limit` | integer | Number of records per page. |
| `is_last_page` | boolean | Indicates whether this is the last page of results. |

#### Attributes of each configuration (objects within `data`)

| Field | Type | Description |
|---|---|---|
| `assignment_configuration_key` | string | Unique assignment configuration identifier (UUID). |
| `assignment_configuration_name` | string | Assignment configuration name. |
| `assignment_contract_key` | string | Key of the assignment contract that originated this configuration (UUID). |
| `registry_type` | string | Asset registration type. Possible values: `internal_registry`, `external_registry`. |
| `asset_type` | string | Asset type accepted in this configuration. Possible values: `ccb`, `duplicata_mercantil`, `duplicata_servico`. |
| `consultant_decision_type` | string | Consultant decision type for eligibility. Possible values: `automatic_approval`, `manual_approval`. |
| `fund_class` | object | Assignee fund data. See [fund_class attributes](/documentation/iaas/negociacao_recebiveis/assignment/recuperacao#fund_class-attributes) on the Retrieval page. |
| `assignor` | object | Assignor data. See [assignor attributes](/documentation/iaas/negociacao_recebiveis/assignment/recuperacao#assignor-attributes) on the Retrieval page. |
| `consultant` | object | Consultant data linked to the configuration. See [consultant attributes](/documentation/iaas/negociacao_recebiveis/assignment/recuperacao#consultant-attributes) on the Retrieval page. |

---

# Credit Rights Assignment Manual

URL: /en/documentation/iaas/negociacao_recebiveis/manual_api

This manual describes the step-by-step process involved in Credit Rights Assignment to Funds administered by QI CTVM. It also explains the business rules of the product and the key points that the integrating partner must be aware of for a faster and more efficient integration.

## Prerequisites

1. An Assignment Contract must have been established and the respective Product must have been activated (see **[Assignor Onboarding](/documentation/iaas/homologacao_cedente/contrato_de_cessao/pedido_de_contrato)** APIs);

2. Only the Fund Manager, the Assignor party to the Contract, and linked Originators can access this service.

3. The unique identification key of the Assignee Fund ( fund_class_key ) and the unique identification key of the Assignment Configuration ( assignment_configuration_key ) must be stored.

```python
BASE_URL = "/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}"
```

:::info
The _**BASE_URL**_ will be the path used in all endpoints of this API.
:::

## State Flow

The Assignment pipeline has two main entities with related state machines. On one side we have the Batch, called assignment , and on the other we have the Assets, called asset . For the former, the flow is as follows:

```mermaid
graph TB
LA[pending_assets_insertion] --> |Close Insertion| LB[completed_assets_insertion]
LB --> |All Assets Pre-approved or Discarded| LC[pending_eligibility]
LC --> |Not accepted| LZ[discarded]
LC --> |Accepted| LD[pending_manager_approval]
LD --> |Manager rejected| LZ
LD --> |Manager approved| LE[pending_assignment_term_signature]
LE --> |Term Signed| LG[pending_payment]
LG --> |Payment| LH[pending_assets_wallet_inclusion]
LH --> |All Assets in Portfolio| LI[completed]
```

For the Asset:

```mermaid
graph TB
LA[pending_eligibility] --> |Accepted| LB[pending_documentation]
LA --> |Not accepted| LZ[discarded]
LB --> |Documents Inserted| LC[pre_approved]
LC --> |Manager approved| LE[pending_formalization]
LE --> |Payment| LH[sending_to_wallet]
LH --> |In Portfolio| LI[completed]
```

## Integration Summary

In summary, to reach Asset Portfolio Inclusion, the following steps apply:

1. Batch Creation;
2. Asset Insertion;
3. Close Asset Insertion;
4. Asset Eligibility Webhook;
5. Document Submission;
6. Batch Eligibility Webhook;
7. Manager Approval;
8. Assignment Term Signature;
9. Assignment Payment;
10. Asset Portfolio Inclusion;

## 1 - Batch Creation

For **[Batch creation](/documentation/iaas/negociacao_recebiveis/assignment/criacao)**, only a unique identifier generated in the integrating partner's system is required. This will be the identifier used both in Webhook responses and in the routes for other features explained below.

It is critically important that this identifier is unique — the QI CTVM system will not allow the partner to send the same Batch twice.

## 2 - Asset Insertion

Asset insertion is the most delicate part of the entire integration. This section explains the business rules involved in creating Assets, both those independent of asset type and those specific to a particular type.

It is important for understanding this API to understand the concept of Asset Value and Asset Purchase Value. For this, the following notation is used:

**[A]** as the Asset Purchase Value, provided at the root of the object — it means how much the Fund should pay for this Asset.

**[B]** as the total sum of Premiums for the operation. It can be obtained by summing all total_values of the premiums provided.

**[C]** as the total sum of Discounts for the operation. It can be obtained by summing all total_values of the deductions provided.

**[D]** as the Asset Value, which can be inferred using the following formula:

:::tip Relationship
[D] = [A] - [B] + [C]
:::

### 2.1 - Asset Type-Independent Rules

#### 2.1.1 - Asset Type Compatibility with Assignment Configuration

Each Assignment Configuration is unique per asset type. It is never possible to place CCBs and Invoices in the same batch, for example. The activated product that generated the assignment_configuration_key contains a specific asset type, and that will be the only type accepted in a given Configuration.
If this is violated, the following error will be returned:

Response Body
STATUS 400

```json title='Response Body'
{
    "code": "TRC000025"
}
```

#### 2.1.2 - Insertion into Closed Batches

If an attempt is made to insert an asset into batches that have already been closed, the integrating partner will receive the following error:

Response Body
STATUS 400

```json title='Response Body'
{
    "code": "TRC000022"
}
```

#### 2.1.3 - Postal Code Validation

The postal code of the borrower's address object must be valid. If an invalid one is provided, the request will not be accepted and will return the following error:

Response Body
STATUS 404

```json title='Response Body'
{
    "code": "TRC000070"
}
```

#### 2.1.4 - External ID Uniqueness

The same asset cannot be assigned twice by the partner. Therefore, if the asset already exists in our database and has not been discarded, the following error will be raised:

Response Body
STATUS 409

```json title='Response Body'
{
    "code": "TRC000054"
}
```

### 2.2 - Rules for Credit Operations

Credit Operations are assets that derive from a commitment made by a Borrower, who borrows money at a given rate and honors a payment commitment according to a specific flow. Therefore, these assets always have an outstanding principal and an interest rate that increases this value. The data structure required for creating a Credit Operation can be found **[on this page](/documentation/iaas/negociacao_recebiveis/asset/criacao_co)**.

#### 2.2.1 - Asset Value vs Outstanding Principal Divergence

For a Credit Operation, the Asset Value must always be greater than or equal to the Outstanding Principal (the principal_value field of the Credit Operation object). The error related to this business rule is:

Response Body
STATUS 409

```json title='Response Body'
{
    "code": "TRC000054"
}
```

#### 2.2.2 - Contract Issue Value vs Outstanding Principal Divergence

The Contract Issue Value must always be greater than or equal to the Outstanding Principal. The error related to this business rule is:

Response Body
STATUS 409

```json title='Response Body'
{
    "code": "TRC000054"
}
```

#### 2.2.3 - Sequential Installments

All installments of a credit operation must be ordered in ascending order by maturity date ( maturity_date ) with sequential numbers ( installment_number ). If the flow starts with installment number 1, the next must be 2, then 3, and so on.

The errors related to these rules are respectively:

Response Body
STATUS 409

```json title='Response Body'
{
    "code": "TRC000054"
}
```

Response Body
STATUS 409

```json title='Response Body'
{
    "code": "TRC000054"
}
```

#### 2.2.4 - Pre-fixed and Post-fixed Objects

According to the interest rate type ( interest_rate_type ) of an operation, pre-fixed and/or post-fixed objects must be provided. If the interest rate type is pre-fixed, **only** the pre-fixed object is required. For post-fixed, the post-fixed object is **mandatory** and the pre-fixed is **optional**.

## 3 - Close Asset Insertion

After all assets in the Batch have been created, the partner can trigger **[closure of Asset Insertion](/documentation/iaas/negociacao_recebiveis/assignment/fechamento)**. This process is important so that the QI CTVM system knows that from this point, once all assets have been properly analyzed by Eligibility with all documentation provided, the Eligibility of the entire Batch can be analyzed.

:::info
It is not necessary to wait for the Webhook of all Assets before performing this action. As soon as no more assets are to be inserted, this command can be executed.
:::

## 4 - Asset Eligibility Webhook

As Assets are analyzed against the Fund's Eligibility rules, the system returns **[Webhooks](/documentation/iaas/negociacao_recebiveis/asset/webhooks)**, one by one. These Webhooks will be identified by the unique asset identifier provided by the partner at creation time.

Only two outcomes can result from this analysis: asset **approval** or **rejection**. If the former occurs, the Asset will proceed in the pipeline, subject to document insertion. Otherwise, it moves to the discarded state and will not proceed to the next steps.

## 5 - Document Submission

Upon approval of an asset in Eligibility, the partner can proceed with **[document insertion](/documentation/iaas/negociacao_recebiveis/asset/documents)** required by the product. Each required document must be submitted in a separate request. Content is transmitted as a Base64 binary, making it possible via JSON like all other APIs in our system.

Note that this request requires, in addition to the file binary, the document type. The Asset will only proceed in the pipeline when all required documents have been submitted. When that happens, it will move to the Pre-Approved ( pre_approved ) state.

:::warning Warning
The required documents depend on the Product type and the Fund Regulations. This can be obtained by retrieving the Product from the Assignment Contract that was activated to obtain the assignment_configuration_key for this batch.
:::

:::info
It is not necessary to have triggered the Asset Insertion Closure. If you want to link the Document Submission logic to the Receipt of the Webhook, this is entirely possible and recommended.
:::

## 6 - Batch Eligibility Webhook

As soon as a Batch that has had asset insertion closed, and all its Assets have been either discarded or pre-approved, it will proceed to a Batch-wide Eligibility analysis. Even if all Assets have been approved, the Batch as a whole may cause fund non-compliance. This is why a second eligibility step is needed.

Similar to the Asset, there are two possible outcomes from Eligibility: approval or rejection. The result will be reported through a **[Webhook](/documentation/iaas/negociacao_recebiveis/assignment/webhooks)**, this time identified by the Batch external_id .

If the Batch is rejected, it will be discarded and the process ends. Otherwise, it will proceed to a Manager review and approval step.

## 7 - Manager Approval

Manager approval must be done through a **[specific request](/documentation/iaas/negociacao_recebiveis/assignment/aprovacao)**, or through our **[Portal](https://manager-dash.qidtvm.com.br/)**. If the Batch is denied, it will be discarded and the process ends. Otherwise, the system generates the Assignment Term and sends it for signature, putting the Batch in the pending_assignment_term_signature state, where it will remain until all related parties sign the Document.

## 8 - Assignment Term Signature

Once signed, we send a **[Webhook](/documentation/iaas/negociacao_recebiveis/assignment/webhooks)** notifying that the Term has been signed and should proceed to payment, moving to pending_payment .

## 9 - Assignment Payment

At this point, the system pays the Assignor the total amount of the Assignment — the sum of all total_purchase_value of non-discarded assets — to the account provided at the time of Product activation. Once this payment is confirmed, we send a **[Webhook](/documentation/iaas/negociacao_recebiveis/assignment/webhooks)** and assets begin to be included in the portfolio.

## 10 - Asset Portfolio Inclusion

Finally, once all assets have been properly included in the portfolio, the Batch becomes completed . From this point, the integrating partner can be fully certain that all those assets are properly within the Fund's inventory.

---

# Listagem de Solicitações de Amortização

URL: /en/documentation/iaas/passivo/amortizacao/listagem

Endpoint de consulta paginada que retorna as solicitações de amortização de uma determinada classe de fundo. A resposta inclui, para cada solicitação, os dados financeiros calculados, o histórico de status, as amortizações por investidor e os dados da série de emissão vinculada.

:::info Filtros de retorno
Por padrão, todos os sub-objetos (`issuance_serie`, `investor_amortizations` e `status_events`) são retornados. Utilize os query params `dto_filters_*` para omitir campos e reduzir o tamanho da resposta.
:::

## Request

ENDPOINT /quota/fund_class/{fund_class_key}/amortization_requests
MÉTODO GET

### Path params

| Parâmetro | Tipo | Descrição |
|---|---|---|
| `fund_class_key` | string | Chave única da classe de fundo (UUID). |

### Query params

| Parâmetro | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `page` | integer | opcional | Número da página (começa em 0). Padrão: `0`. |
| `limit` | integer | opcional | Quantidade de registros por página. Padrão: `20`. Máximo: `100`. |
| `dto_filters_issuance_serie` | boolean | opcional | Quando `true`, omite o objeto `issuance_serie` de cada item. Padrão: `false`. |
| `dto_filters_investor_amortizations` | boolean | opcional | Quando `true`, omite o array `investor_amortizations` de cada item. Padrão: `false`. |
| `dto_filters_status_events` | boolean | opcional | Quando `true`, omite o array `status_events` de cada item. Padrão: `false`. |

```python title="Exemplo de chamada"
GET /quota/fund_class/{fund_class_key}/amortization_requests?page=0&limit=20
```

## Response

STATUS 200

```json title="Response Body"
{
  "data": [
    {
      "amortization_request_key": "3571e292-3a83-4011-904d-20ee963022ef",
      "type": "scheduled_amortization",
      "regime_type": "issuance_serie_principal_percentage",
      "quotation_date": "2026-06-05",
      "principal_percentage": 0.5,
      "financial_application_yield_percentage": 0.12,
      "gross_value": 10000.0,
      "result_quota_value": 1.05,
      "amortization_value": 5000.0,
      "net_value": 4750.0,
      "quota_percentage": 0.5,
      "status": "done",
      "status_events": [
        {
          "status": "created",
          "event_datetime": "2026-06-01T10:00:00.000Z"
        },
        {
          "status": "done",
          "event_datetime": "2026-06-05T14:30:00.000Z"
        }
      ],
      "investor_amortizations": [
        {
          "investor_amortization_key": "f1e2d3c4-b5a6-7890-fedc-ba9876543210",
          "investor": {
            "investor_key": "aaaa1111-bbbb-2222-cccc-dddd33334444",
            "name": "Investidor Exemplo S.A.",
            "person_type": "legal",
            "document_number": "12.345.678/0001-99",
            "distributor": {
              "distributor_key": "dddd4444-eeee-5555-ffff-aaaa66667777",
              "name": "Distribuidora Exemplo",
              "document_number": "98.765.432/0001-11",
              "account_data": {
                "bank": "341",
                "agency": "1234",
                "account": "56789-0"
              }
            }
          },
          "status": "done",
          "net_value": 4750.0,
          "ir_value": 200.0,
          "iof_value": 50.0,
          "ir_compensation": 0.0,
          "iof_compensation": 0.0,
          "total_value": 5000.0,
          "payment_method": "regular",
          "payment_date": "2026-06-06",
          "status_events": [
            {
              "status": "created",
              "event_datetime": "2026-06-01T10:00:00.000Z"
            },
            {
              "status": "done",
              "event_datetime": "2026-06-06T09:00:00.000Z"
            }
          ],
          "amortizations": [
            {
              "financial_application_key": "fa111111-2222-3333-4444-555566667777",
              "amortization_key": "am888888-9999-aaaa-bbbb-ccccddddeeee",
              "status": "settled",
              "principal_reduction": 2500.0,
              "acquisition_cost_reduction": 0.0,
              "yield_value": 300.0,
              "total_value": 2800.0,
              "ir_value": 100.0,
              "iof_value": 25.0,
              "taxable_yield_value": 300.0
            }
          ],
          "payments": [
            {
              "payment_key": "pp000000-1111-2222-3333-444455556666",
              "origin_key": "f1e2d3c4-b5a6-7890-fedc-ba9876543210",
              "total_value": 4750.0,
              "target_account": {
                "bank": "341",
                "agency": "1234",
                "account": "56789-0"
              },
              "payment_type": "amortization_payment.investor",
              "payment_date": "2026-06-06",
              "status": "paid",
              "status_events": [
                {
                  "status": "paid",
                  "event_datetime": "2026-06-06T09:15:00.000Z"
                }
              ]
            }
          ]
        }
      ],
      "issuance_serie": {
        "issuance_serie_key": "is111111-2222-3333-4444-555566667777",
        "name": "Série A - Cota Sênior",
        "serie": 1,
        "original_quota_value": 1.0,
        "current_quota_value": 1.05,
        "current_number_of_quotas": 1000000.0,
        "current_net_worth": 1050000.0,
        "current_principal_value": 1000000.0,
        "performance_fee_current_value": 0.0,
        "remuneration_type": "cdi_plus",
        "minimum_share_capital": 1000.0,
        "status": "active",
        "internal_code": "SR-001",
        "processing_method": "pro_rata",
        "operation_period_configuration": {
          "subscription_days": [1, 2, 3, 4, 5],
          "redemption_days": [1, 2, 3, 4, 5]
        },
        "sub_class": {
          "sub_class_key": "sc222222-3333-4444-5555-666677778888",
          "name": "Classe Sênior",
          "subordination_level": 1,
          "fund_class": {
            "fund_class_key": "fc333333-4444-5555-6666-777788889999",
            "name": "Fundo de Investimento em Direitos Creditórios Exemplo",
            "short_name": "FIDC Exemplo",
            "document_number": "11.222.333/0001-44",
            "accounting_date": "2026-06-09",
            "sub_type": "exclusive",
            "tax_classification": "long_term",
            "condominum_type": "closed",
            "investment_category": "credit_rights",
            "prevent_payment": false,
            "manager": {
              "manager_key": "mg444444-5555-6666-7777-888899990000",
              "name": "Gestora Exemplo DTVM",
              "document_number": "55.666.777/0001-88"
            }
          }
        }
      }
    }
  ],
  "limit": 20,
  "page": 0,
  "is_last_page": true
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `data` | array | Lista de solicitações de amortização. Veja tabela abaixo. |
| `page` | integer | Número da página atual. |
| `limit` | integer | Quantidade de registros por página. |
| `is_last_page` | boolean | Indica se esta é a última página de resultados. |

#### Atributos de cada solicitação (objetos dentro de `data`)

| Campo | Tipo | Descrição |
|---|---|---|
| `amortization_request_key` | string | Identificador único da solicitação (UUID). |
| `type` | string | Tipo da amortização. Consulte os [enumeradores de tipo](#enumeradores-de-type) abaixo. |
| `regime_type` | string | Regime de cálculo da amortização. Consulte os [enumeradores de regime](#enumeradores-de-regime_type) abaixo. |
| `quotation_date` | string | Data de cotação no formato `YYYY-MM-DD`. |
| `principal_percentage` | number | Percentual do principal a ser amortizado. Presente conforme o `regime_type`. |
| `financial_application_yield_percentage` | number | Percentual de rendimento da aplicação financeira. Presente conforme o `regime_type`. |
| `gross_value` | number | Valor bruto total da amortização em reais. |
| `result_quota_value` | number | Valor da cota resultante após a amortização. |
| `amortization_value` | number | Valor total a ser amortizado em reais. |
| `net_value` | number | Valor líquido total após impostos em reais. |
| `quota_percentage` | number | Percentual de cotas resgatadas. Presente conforme o `regime_type`. |
| `status` | string | Status atual da solicitação. Consulte os [enumeradores de status](#enumeradores-de-status) abaixo. |
| `status_events` | array | Histórico de transições de status. Omitido se `dto_filters_status_events=true`. Veja tabela abaixo. |
| `investor_amortizations` | array | Lista de amortizações individuais por investidor. Omitido se `dto_filters_investor_amortizations=true`. Veja tabela abaixo. |
| `issuance_serie` | object | Dados da série de emissão vinculada. Omitido se `dto_filters_issuance_serie=true`. Veja tabela abaixo. |

#### Atributos de `status_events`

| Campo | Tipo | Descrição |
|---|---|---|
| `status` | string | Status do evento. |
| `event_datetime` | string | Data e hora do evento no formato ISO 8601 (ex: `2026-06-01T10:00:00.000Z`). |

#### Atributos de `investor_amortizations`

| Campo | Tipo | Descrição |
|---|---|---|
| `investor_amortization_key` | string | Identificador único da amortização do investidor (UUID). |
| `investor` | object | Dados do investidor. Veja tabela abaixo. |
| `status` | string | Status da amortização do investidor. Consulte os [enumeradores de status do investidor](#enumeradores-de-status-do-investor_amortization) abaixo. |
| `net_value` | number | Valor líquido a pagar ao investidor em reais. |
| `ir_value` | number | Valor de IR retido em reais. |
| `iof_value` | number | Valor de IOF retido em reais. |
| `ir_compensation` | number | Compensação de IR em reais. |
| `iof_compensation` | number | Compensação de IOF em reais. |
| `total_value` | number | Valor total bruto em reais. Presente após o cálculo. |
| `payment_method` | string | Método de pagamento. Consulte os [enumeradores de método de pagamento](#enumeradores-de-payment_method) abaixo. |
| `payment_date` | string | Data prevista do pagamento no formato `YYYY-MM-DD`. |
| `status_events` | array | Histórico de transições de status do investidor. Mesma estrutura de `status_events` da solicitação. |
| `amortizations` | array | Detalhamento por aplicação financeira. Veja tabela abaixo. |
| `payments` | array | Lista de pagamentos gerados. Veja tabela abaixo. |

#### Atributos de `investor`

| Campo | Tipo | Descrição |
|---|---|---|
| `investor_key` | string | Chave única do investidor (UUID). |
| `name` | string | Nome do investidor. |
| `person_type` | string | Tipo de pessoa (`natural` ou `legal`). |
| `document_number` | string | CPF ou CNPJ do investidor. Presente quando disponível. |
| `external_id` | string | Identificador externo do investidor. Presente quando informado. |
| `external_distribution_key` | string | Chave de distribuição externa. Presente quando informada. |
| `short_name` | string | Nome abreviado. Presente quando informado. |
| `sub_type` | string | Subtipo do investidor. Presente quando informado. |
| `distributor` | object | Dados da distribuidora vinculada. Veja tabela abaixo. |

#### Atributos de `distributor`

| Campo | Tipo | Descrição |
|---|---|---|
| `distributor_key` | string | Chave única da distribuidora (UUID). |
| `name` | string | Nome da distribuidora. |
| `document_number` | string | CNPJ da distribuidora. |
| `account_data` | object | Dados bancários da distribuidora. |

#### Atributos de `amortizations`

| Campo | Tipo | Descrição |
|---|---|---|
| `financial_application_key` | string | Chave da aplicação financeira (UUID). |
| `amortization_key` | string | Chave única da amortização (UUID). |
| `status` | string | Status da amortização. |
| `principal_reduction` | number | Redução de principal em reais. |
| `acquisition_cost_reduction` | number | Redução de custo de aquisição em reais. |
| `yield_value` | number | Valor de rendimento em reais. Presente quando calculado. |
| `total_value` | number | Valor total em reais. Presente quando calculado. |
| `ir_value` | number | Valor de IR em reais. Presente quando calculado. |
| `iof_value` | number | Valor de IOF em reais. Presente quando calculado. |
| `taxable_yield_value` | number | Valor de rendimento tributável em reais. Presente quando calculado. |

#### Atributos de `payments`

| Campo | Tipo | Descrição |
|---|---|---|
| `payment_key` | string | Chave única do pagamento (UUID). |
| `origin_key` | string | Chave da origem do pagamento (UUID). |
| `total_value` | number | Valor total do pagamento em reais. |
| `target_account` | object | Dados da conta de destino. |
| `description` | string | Descrição do pagamento. Presente quando informada. |
| `payment_type` | string | Tipo do pagamento. Consulte os [enumeradores de tipo de pagamento](#enumeradores-de-payment_type) abaixo. |
| `payment_date` | string | Data do pagamento no formato `YYYY-MM-DD`. |
| `status` | string | Status do pagamento. Consulte os [enumeradores de status do pagamento](#enumeradores-de-status-do-payment) abaixo. |
| `deleted_at` | string | Data e hora de exclusão no formato ISO 8601. Presente apenas quando o pagamento foi cancelado. |
| `status_events` | array | Histórico de transições de status do pagamento. Mesma estrutura de `status_events` da solicitação. |

#### Atributos de `issuance_serie`

| Campo | Tipo | Descrição |
|---|---|---|
| `issuance_serie_key` | string | Chave única da série de emissão (UUID). |
| `name` | string | Nome da série de emissão. |
| `serie` | integer | Número da série. |
| `original_quota_value` | number | Valor original da cota em reais. |
| `current_quota_value` | number | Valor atual da cota em reais (calculado como `current_net_worth / current_number_of_quotas`). |
| `current_number_of_quotas` | number | Quantidade atual de cotas em circulação. |
| `current_net_worth` | number | Patrimônio líquido atual em reais. |
| `current_principal_value` | number | Valor de principal atual em reais. |
| `performance_fee_current_value` | number | Valor atual de taxa de performance em reais. |
| `remuneration_type` | string | Tipo de remuneração da série. |
| `minimum_share_capital` | number | Capital mínimo em reais. |
| `status` | string | Status da série de emissão. |
| `internal_code` | string | Código interno da série. |
| `processing_method` | string | Método de processamento (ex: `pro_rata`). |
| `operation_period_configuration` | object | Configuração de períodos operacionais da série. |
| `pre_fixed` | number | Taxa pré-fixada. Presente quando aplicável. |
| `post_fixed` | object | Dados do indexador pós-fixado. Presente quando aplicável. |
| `interest_rate_type` | string | Tipo de taxa de juros. Presente quando aplicável. |
| `isin_code` | string | Código ISIN da série. Presente quando informado. |
| `external_id` | string | Identificador externo. Presente quando informado. |
| `specific_interest_rate_data` | object | Dados específicos de taxa de juros. Presente quando aplicável. |
| `fixed_principal_value` | number | Valor de principal fixo. Presente quando aplicável. |
| `sub_class` | object | Dados da subclasse vinculada. Veja tabela abaixo. |

#### Atributos de `sub_class`

| Campo | Tipo | Descrição |
|---|---|---|
| `sub_class_key` | string | Chave única da subclasse (UUID). |
| `name` | string | Nome da subclasse. |
| `subordination_level` | integer | Nível de subordinação da subclasse. |
| `fund_class` | object | Dados da classe de fundo. Veja tabela abaixo. |

#### Atributos de `fund_class`

| Campo | Tipo | Descrição |
|---|---|---|
| `fund_class_key` | string | Chave única da classe de fundo (UUID). |
| `name` | string | Nome do fundo. |
| `short_name` | string | Nome abreviado do fundo. |
| `document_number` | string | CNPJ do fundo. |
| `accounting_date` | string | Data contábil vigente no formato `YYYY-MM-DD`. |
| `sub_type` | string | Subtipo do fundo. |
| `tax_classification` | string | Classificação tributária do fundo. |
| `condominum_type` | string | Tipo de condomínio do fundo. |
| `investment_category` | string | Categoria de investimento. |
| `prevent_payment` | boolean | Indica se pagamentos estão bloqueados para o fundo. |
| `manager` | object | Dados do gestor do fundo. |
| `administrator` | object | Dados do administrador. Presente quando informado. |
| `integralization_account_key` | string | Chave da conta de integralização (UUID). Presente quando informada. |

## Enumeradores de `type`

| Valor | Descrição |
|---|---|
| `scheduled_amortization` | Amortização programada/agendada |
| `extraordinary_amortization` | Amortização extraordinária |

## Enumeradores de `regime_type`

| Valor | Descrição |
|---|---|
| `cash_availability` | Baseado na disponibilidade de caixa |
| `issuance_serie_principal_percentage` | Percentual do principal da série de emissão |
| `quota_percentage` | Percentual de cotas |
| `financial_application_principal_percentage` | Percentual do principal da aplicação financeira |
| `net_value` | Valor líquido fixo |
| `gross_value` | Valor bruto fixo |
| `financial_application_yield_percentage` | Percentual de rendimento da aplicação financeira |

## Enumeradores de `status`

| Status | Descrição |
|---|---|
| `created` | Solicitação criada |
| `waiting_quotation_date` | Aguardando data de cotação |
| `pending_inputs` | Aguardando dados de entrada |
| `processing_calculation` | Cálculo em processamento |
| `processing_investor_amortizations` | Processando amortizações dos investidores |
| `pending_manual_approval` | Aguardando aprovação manual |
| `processing_approval` | Aprovação em processamento |
| `processing_issuance_serie_impacts` | Processando impactos na série de emissão |
| `reprocessed` | Reprocessada |
| `reproved` | Reprovada |
| `done` | Concluída |

## Enumeradores de status do `investor_amortization`

| Status | Descrição |
|---|---|
| `created` | Amortização do investidor criada |
| `pending_quote` | Aguardando cotação |
| `processing_approval` | Aprovação em processamento |
| `pending_manual_approval` | Aguardando aprovação manual |
| `done` | Concluída |
| `reproved` | Reprovada |

## Enumeradores de `payment_method`

| Valor | Descrição |
|---|---|
| `regular` | Pagamento padrão (TED/PIX) |
| `b3` | Pagamento via B3 |

## Enumeradores de `payment_type`

| Valor | Descrição |
|---|---|
| `amortization_payment.investor` | Pagamento de amortização ao investidor |
| `amortization_payment.ir` | Recolhimento de IR da amortização |
| `amortization_payment.iof` | Recolhimento de IOF da amortização |
| `amortization_payment.collateral` | Pagamento de garantia da amortização |
| `redemption.investor` | Pagamento de resgate ao investidor |
| `redemption.ir` | Recolhimento de IR do resgate |
| `redemption.iof` | Recolhimento de IOF do resgate |
| `redemption.integralization_iof` | Recolhimento de IOF de integralização do resgate |
| `redemption.tax_anticipation` | Antecipação de tributos do resgate |

## Enumeradores de status do `payment`

| Status | Descrição |
|---|---|
| `created` | Pagamento criado |
| `pending_payment` | Aguardando pagamento |
| `pending_manual_approval` | Aguardando aprovação manual |
| `pending_confirmation` | Aguardando confirmação |
| `pending_accounting_date` | Aguardando data contábil |
| `paid` | Pago |
| `canceled` | Cancelado |

---

# Paginated Financial Application Query

URL: /en/documentation/iaas/passivo/aplicacao_financeira/busca_paginada_aplicacoes_financeiras

---

### Requests

Request by investor: this endpoint will return all financial applications of an investor
ENDPOINT /quota/investor/INVESTOR_KEY/financial_applications
METHOD GET
STATUS 200
Request by fund: this endpoint will return all financial applications of a fund
ENDPOINT /quota/fund_class/FUND_CLASS_KEY/financial_applications
METHOD GET
STATUS 200

### Query Params

| Parameter        | Description                                                                      |
|------------------|----------------------------------------------------------------------------------|
| `quotation_date` | Quotation date of the applications                                               |
| `status`         | List of desired **[Financial Application Status](#financial_application_status)** |
| `application_from_datetime` | Returns only financial applications whose application datetime is greater than or equal to the provided value. |
| `application_to_datetime` | Returns only financial applications whose application datetime is less than or equal to the provided value. |
| `issuance_serie_key` | Filters applications by issuance series                                      |
| `types`          | List of desired application types (e.g.: primary_market, secondary_market)       |
| `fund_class_document_number` | Filters by the fund class document number _(only on the query by investor)_ |
| `manager_key`    | Filters by manager _(only on the query by investor)_                             |
| `investor_name`  | Filters by investor name _(only on the query by fund)_                           |
| `investor_document_number` | Filters by investor document number _(only on the query by fund)_      |

### Responses

Case 01: Successful query

```json
{
    "data": [
        {
        "external_id": "",
        "financial_application_key": "UUID",
        "share_capital": 0.00,
        "investor_position": {
            "investor": {
                "investor_key": "UUID",
                "document_number": "999.999.999-99" | "99.999.999/9999-99",
                "name": "",
                "person_type": "natural_person" | "legal_person",
                "account_data": {
                    "owner": {
                        "name": "",
                        "document_number": "99.999.999/9999-99"
                    },
                    "account_digit": "0",
                    "account_branch": "0000",
                    "account_number": "00000",
                    "financial_institution_code": "000",
                    "financial_institution_ispb": "00000000"
                },
                "distributor": {
                    "distributor_key": "UUID",
                    "document_number": "99.999.999/9999-99",
                    "name": "",
                    "account_data": {
                        "owner": {
                            "name": "",
                            "document_number": "99.999.999/9999-99"
                        },
                        "account_digit": "0",
                        "account_branch": "0000",
                        "account_number": "00000",
                        "financial_institution_code": "000",
                        "financial_institution_ispb": "00000000"
                    },
                }
            },
            "total_net_worth": 0.00,
            "total_number_of_quotas": 0.00000000,
            "issuance_serie": {},
            "investor_position_key":"UUID"
        },
        "original_principal_value": 0.00000000,
        "current_principal_value": 0.00000000,
        "original_number_of_units": 0.00000000,
        "current_number_of_units": 0.00000000,
        "quotation_date": "yyyy-mm-dd",
        "application_datetime": "YYYY-MM-DDTHH:MM:SSZ",
        "status": "pending_payment" | "pending_quote" | "quoted" | "settled" | "redeemed" | "canceled",
        "status_events": [
            {
                "event_datetime": "yyyy-mm-dd HH:MM:SS:ms",
                "status": "pending_payment" | "pending_quote" | "quoted" | "settled" | "redeemed" | "canceled",
            }
        ],
        "capital_returns": [
            {
                "capital_return_key": "UUID",
                "origin_key": "UUID",
                "net_value": 0.00,
                "iof_value": 0.00,
                "ir_value": 0.00,
                "payment_date": "yyyy-mm-dd",
                "capital_return_date": "yyyy-mm-dd",
                "status": "",
                "capital_return_type": "",
                "number_of_units": "",
            }
        ],
        }
    ],
    "limit": 50,
    "page": 0,
    "is_last_page": true
}
```

### Page
| Field         | Type    | Description                                                           |
|---------------|---------|-----------------------------------------------------------------------|
| `data`        | array   | List of **[Financial Application](#financial_application)** objects  |
| `limit`       | int     | Limit of objects retrieved per page                                   |
| `page`        | int     | Number of the retrieved page                                          |
| `is_last_page`| boolean | Information indicating if the retrieved page is the last one         |

### Financial Application
| Field                         | Type     | Description                                                                   | Characters |
|-------------------------------|----------|-------------------------------------------------------------------------------|------------|
| `external_id`                 | string   | External identifier                                                           | up to 100  |
| `financial_application_key`   | string   | Unique identification key of the financial application                        | 36         |
| `share_capital`               | float    | Investment amount                                                             | -          |             
| `investor_position`           | JSON     | **[Investor Position](#investor_position)** object                           | -          |
| `original_principal_value`    | float    | Original principal value per share                                            | -          |
| `current_principal_value`     | float    | Current principal value per share                                             | -          |
| `original_number_of_units`    | float    | Original quantity of shares                                                   | -          |
| `current_number_of_units`     | float    | Current quantity of shares                                                    | -          |
| `quotation_date`              | string   | Quotation date                                                                | -          |
| `application_datetime`        | string   | Financial application creation date                                           | -          |
| `status`                      | string   | **[Financial Application Status](#financial_application_status)** enumerator | -          |
| `status_events`               | array    | List of **[Status Event](#status_event)** objects                            | -          |
| `capital_returns`             | array    | List of **[Capital Return](#capital_return)** objects                        | -          |

### Financial Application Status
| Enumerator               | Description                                     |
|--------------------------|-------------------------------------------------|
| `pending_payment`        | Pending payment                                 |
| `pending_quote`          | Pending quotation                               |
| `quoted`                 | Quoted                                          |
| `settled`                | Fully amortized                                 |
| `redeemed`               | Fully redeemed                                  |
| `canceled`               | Canceled                                        |

### Investor Position
| Field                    | Type   | Description                                           |
|--------------------------|--------|-------------------------------------------------------|
| `investor`               | JSON   | **[Investor](#investor)** object                      |
| `total_net_worth`        | float  | Net worth of the investor's position                  |
| `total_number_of_quotas` | float  | Number of quotas in the investor's position          |
| `issuance_serie`         | JSON   | **[Issuance Serie](#issuance_serie)** object         |
| `investor_position_key`  | JSON   | Unique identification key of the investor's position |

### Investor
| Field                    | Type     | Description                              | Characters |
|--------------------------|----------|------------------------------------------|------------|
| `name`                   | string   | Investor name                            | up to 255  |
| `investor_key`           | string   | Unique identification key of the investor| 36         |
| `document_number`        | string   | CPF/CNPJ of the investor                 | 14 or 18   |
| `person_type`            | string   | Natural Person / Legal Person / Fund Class| up to 50   |
| `distributor`            | JSON     | **[Distributor](#distributor)** object   | -          |             
| `account_data`           | JSON     | **[Account Data](#account_data)** object | -          |

### Distributor
| Field                    | Type     | Description                                     | Characters |
|--------------------------|----------|-------------------------------------------------|------------|
| `name`                   | string   | Distributor name                                | up to 255  |
| `distributor_key`        | string   | Unique identification key of the distributor    | -          |             
| `document_number`        | string   | CPF/CNPJ of the distributor                     | 14 or 18   |
| `account_data`           | JSON     | **[Account Data](#account_data)** object       | -          |

### Account Data
| Field                        | Type     | Description                                                                        |
|------------------------------|----------|------------------------------------------------------------------------------------|
| `account_digit`              | string   | Bank account digit                                                                 |
| `account_branch`             | string   | Bank account branch number                                                         |             
| `account_number`             | string   | Bank account number                                                                |
| `financial_institution_code` | string   | Financial institution code                                                         |
| `financial_institution_ispb` | string   | Brazilian Payment System identifier of the financial institution                   |

### Issuance Serie
| Field                         | Type     | Description                                              | Characters |
|-------------------------------|----------|----------------------------------------------------------|------------|
| `name`                        | string   | Issuance series name                                     | up to 255  |
| `issuance_serie_key`          | string   | Unique identification key of the issuance series         | 36         |
| `cetip_code`                  | string   | CETIP code of the issuance series as an asset           | 10         |             
| `start_date`                  | string   | Start date of the issuance series                        | 10         |
| `maturity_date`               | string   | Maturity date of the issuance series                     | 10         |
| `original_quota_value`        | float    | Original quota value                                     | -          |
| `remuneration_type`           | string   | Yield curve / Residual                                   | up to 50   |
| `investment_category`         | string   | FIDC / Multi-market                                      | up to 50   |
| `condominum_type`             | string   | Open / Closed                                            | up to 50   |
| `tax_classification`          | string   | Short term / Long term                                   | up to 50   |
| `investment_restriction_type` | string   | No restriction / Qualified / Professional                | up to 50   |
| `minimum_share_capital`       | float    | Minimum value for investment                             | -          |
| `accounting_date`             | string   | Accounting date of the issuance series                   | 10         |
| `sub_class`                   | JSON     | **[Sub Class](#sub_class)** object                       | -          |

### Sub Class 
| Field                         | Type     | Description                                     | Characters |
|-------------------------------|----------|-------------------------------------------------|------------|
| `name`                        | string   | Sub class name                                  | up to 255  |
| `sub_class_key`               | string   | Unique identification key of the sub class      | 36         |
| `subordination_level`         | int      | Subordination level of the sub class            | -          |             
| `fund_class`                  | JSON     | **[Fund Class](#fund_class)** object           | -          |

### Fund Class 
| Field                         | Type     | Description                                    | Characters |
|-------------------------------|----------|------------------------------------------------|------------|
| `name`                        | string   | Fund class name                                | up to 255  |
| `fund_class_key`              | string   | Unique identification key of the fund class    | 36         |
| `document_number`             | string   | CNPJ of the fund class                         | -          |             

### Capital Return
| Field                     | Type     | Description                                                      |
|---------------------------|----------|------------------------------------------------------------------|
| `capital_return_key`      | string   | Unique identification key of the capital return                  |                       
| `origin_key`              | string   | Unique identification key of the capital return origin           |                               
| `net_value`               | float    | Net value of the capital return                                  |       
| `iof_value`               | float    | IOF value of the capital return                                  |   
| `ir_value`                | float    | IR value of the capital return                                   |   
| `payment_date`            | string   | Payment date of the capital return                               |   
| `capital_return_date`     | string   | Creation date of the capital return                              |           
| `status`                  | string   | Sending to Administrator / Pending Payment / Paid               |                           
| `capital_return_type`     | string   | Amortization / Redemption Request / Come-quotas                  |               
| `number_of_units`         | float    | Number of quotas of the capital return                           |

---

# Paginated Query of Financial Application Closing

URL: /en/documentation/iaas/passivo/aplicacao_financeira/busca_paginada_fechamento_das_aplicacoes_financeiras

---

### Requests

Request by fund class
ENDPOINT /quota/fund_class/FUND_CLASS_KEY/financial_application_closings
METHOD GET
STATUS 200

#### Query Params

| Parameter          | Description                                                                          |
|--------------------|--------------------------------------------------------------------------------------|
| `accounting_date`  | Specific accounting closing date (format `yyyy-mm-dd`)                               |
| `from_date`        | Period start date (format `yyyy-mm-dd`)                                              |
| `to_date`          | Period end date (format `yyyy-mm-dd`)                                                |
| `limit`            | Limit of objects retrieved per page (minimum `0`, maximum `75`, default `75`)        |
| `page`             | Retrieved page number (minimum `0`, default `0`)                                     |

:::warning Warning
You must send `accounting_date` **or** the combination of `from_date` and `to_date`. If none of these parameters is sent, the resource will return a missing required parameters error.
:::

Request by investor and financial application
ENDPOINT /quota/investor/INVESTOR_KEY/financial_application/FINANCIAL_APPLICATION_KEY/financial_application_closings
METHOD GET
STATUS 200

#### Query Params

| Parameter                            | Description                                                                                  |
|--------------------------------------|----------------------------------------------------------------------------------------------|
| `last_financial_application_closing` | Boolean. When `true`, returns only the latest closing of the application. Default: `false`.  |
| `limit`                              | Limit of objects retrieved per page (minimum `0`, maximum `500`, default `50`)               |
| `page`                               | Retrieved page number (minimum `0`, default `0`)                                             |

### Responses

Case 01: Successful query

```json
{
    "data": [
        {
            "financial_application": {
                "financial_application_key": "UUID",
                "share_capital": 0.00,
                "status": "pending_payment" | "pending_quote" | "quoted" | "settled" | "redeemed" | "canceled",
                "investor": {
                    "investor_key": "UUID",
                    "name": "",
                    "person_type": "natural_person" | "legal_person",
                    "document_number": "999.999.999-99" | "99.999.999/9999-99",
                    "distributor": {
                        "distributor_key": "UUID",
                        "name": "",
                        "document_number": "99.999.999/9999-99",
                        "account_data": {}
                    }
                },
                "issuance_serie": {},
                "financial_application_type": "regular",
                "payment_method": "regular" | "cetip" | "b3",
                "quotation_date": "yyyy-mm-dd",
                "current_principal_value": 0.00000000,
                "current_number_of_quotas": 0.00000000,
                "original_number_of_quotas": 0.00000000,
                "original_number_of_quotas_str": "0.00000000",
                "acquisition_cost": 0.00,
                "external_id": "",
                "redemptions": [],
                "amortizations": [],
                "status_events": [],
                "reserved_taxable_yields": []
            },
            "total_value": 0.00,
            "number_of_quotas": 0.00000000,
            "principal_value": 0.00,
            "acquisition_cost": 0.00,
            "yield_value": 0.00,
            "ir_value": 0.00,
            "iof_value": 0.00,
            "taxable_yield_value": 0.00,
            "accounting_date": "yyyy-mm-dd"
        }
    ],
    "limit": 75,
    "page": 0,
    "is_last_page": true
}
```

:::caution **Warning**
The fields below in the `financial_application` object are **conditional** — only returned when the underlying data exists:

- `redemptions[]`, `amortizations[]`, `status_events[]`, `reserved_taxable_yields[]`: lists are omitted when empty.
- `original_number_of_quotas` (and its sibling `original_number_of_quotas_str`), `current_principal_value`, `acquisition_cost`, `current_number_of_quotas`, `quotation_date`: populated after the application's quotation processing.
- `payment_method`, `financial_application_type`, `external_id`: optional per application — returned when provided at creation or in a later update.

The envelope (`data`, `limit`, `page`, `is_last_page`) and the fields of the **[Financial Application Closing](#financial-application-closing)** object are always present in the response.
:::

### Page
| Field         | Type   | Description                                                                            |
|---------------|--------|----------------------------------------------------------------------------------------|
| `data`        | array  | List of **[Financial Application Closing](#financial-application-closing)** objects    |
| `limit`       | int    | Limit of objects retrieved per page                                                    |
| `page`        | int    | Retrieved page number                                                                  |
| `is_last_page`| boolean| Information indicating whether the retrieved page is the last                          |

### Financial Application Closing
| Field                   | Type     | Description                                                   |
|-------------------------|----------|---------------------------------------------------------------|
| `financial_application` | JSON     | **[Financial Application](#financial-application)** object    |
| `total_value`           | float    | Total closing value of the application                        |
| `number_of_quotas`      | float    | Number of quotas referring to the closing                     |
| `principal_value`       | float    | Principal value referring to the closing                      |
| `acquisition_cost`      | float    | Acquisition cost of the quotas related to the closing         |
| `yield_value`           | float    | Gross yield value                                             |
| `ir_value`              | float    | IR value                                                      |
| `iof_value`             | float    | IOF value                                                     |
| `taxable_yield_value`   | float    | Taxable yield value                                           |
| `accounting_date`       | string   | Accounting date referring to the application closing          |

### Financial Application
| Field                              | Type     | Description                                                                     |
|------------------------------------|----------|---------------------------------------------------------------------------------|
| `financial_application_key`        | string   | Unique identification key of the financial application                          |
| `share_capital`                    | float    | Investment amount                                                               |
| `status`                           | string   | **[Financial Application Status](#financial-application-status)** enumerator    |
| `investor`                         | JSON     | **[Investor](#investor)** object                                                |
| `issuance_serie`                   | JSON     | **[Issuance Serie](#issuance-serie)** object                                    |
| `redemptions`                      | array    | List of **[Redemption](#redemption)** objects *(conditional)*                   |
| `amortizations`                    | array    | List of **[Amortization](#amortization)** objects *(conditional)*               |
| `status_events`                    | array    | List of **[Status Event](#status-event)** objects *(conditional)*               |
| `reserved_taxable_yields`          | array    | List of **[Reserved Taxable Yield](#reserved-taxable-yield)** objects *(conditional)* |
| `financial_application_type`       | string   | Financial application type *(conditional)*                                      |
| `original_number_of_quotas`        | float    | Original number of quotas *(conditional)*                                       |
| `original_number_of_quotas_str`    | string   | Precision-preserving string version of the original number of quotas *(conditional)* |
| `current_principal_value`          | float    | Current principal value per quota *(conditional)*                               |
| `acquisition_cost`                 | float    | Acquisition cost of the application's quotas *(conditional)*                    |
| `current_number_of_quotas`         | float    | Current number of quotas *(conditional)*                                        |
| `payment_method`                   | string   | Payment method (`regular`, `cetip`, `b3`) *(conditional)*                       |
| `quotation_date`                   | string   | Quotation date *(conditional)*                                                  |
| `external_id`                      | string   | External identifier *(conditional)*                                             |

### Financial Application Status
| Enumerator        | Description                |
|-------------------|----------------------------|
| `pending_payment` | Pending payment            |
| `pending_quote`   | Pending quotation          |
| `quoted`          | Quoted                     |
| `settled`         | Fully amortized            |
| `redeemed`        | Fully redeemed             |
| `canceled`        | Canceled                   |

### Investor
| Field                       | Type     | Description                                            |
|-----------------------------|----------|--------------------------------------------------------|
| `investor_key`              | string   | Unique identification key of the investor              |
| `name`                      | string   | Investor name                                          |
| `person_type`               | string   | `natural_person` / `legal_person` / `fund_class`       |
| `distributor`               | JSON     | **[Distributor](#distributor)** object                 |
| `document_number`           | string   | Investor CPF/CNPJ *(conditional)*                      |
| `external_id`               | string   | External identifier of the investor *(conditional)*    |
| `external_distribution_key` | string   | External distribution key *(conditional)*              |

### Distributor
| Field                    | Type     | Description                                         |
|--------------------------|----------|-----------------------------------------------------|
| `distributor_key`        | string   | Unique identification key of the distributor        |
| `name`                   | string   | Distributor name                                    |
| `document_number`        | string   | Distributor CNPJ                                    |
| `account_data`           | JSON     | Distributor bank account data object                |

### Issuance Serie
| Field                            | Type     | Description                                                                                          |
|----------------------------------|----------|------------------------------------------------------------------------------------------------------|
| `issuance_serie_key`             | string   | Unique identification key of the issuance series                                                     |
| `name`                           | string   | Issuance series name                                                                                 |
| `serie`                          | string   | Series identifier                                                                                    |
| `internal_code`                  | string   | Series internal code                                                                                 |
| `status`                         | string   | Issuance series status enumerator                                                                    |
| `original_quota_value`           | float    | Original quota value                                                                                 |
| `current_quota_value`            | float    | Current quota value (calculated from `current_net_worth` / `current_number_of_quotas`)               |
| `current_number_of_quotas`       | float    | Current number of quotas in circulation                                                              |
| `current_net_worth`              | float    | Current net worth                                                                                    |
| `current_principal_value`        | float    | Current principal value                                                                              |
| `performance_fee_current_value`  | float    | Current performance fee                                                                              |
| `minimum_share_capital`          | float    | Minimum value for investment                                                                         |
| `remuneration_type`              | string   | Remuneration type (enumerator)                                                                       |
| `interest_rate_type`             | string   | Interest rate type (enumerator)                                                                      |
| `processing_method`              | string   | Series processing method (enumerator)                                                                |
| `operation_period_configuration` | JSON     | Operation period configuration                                                                       |
| `sub_class`                      | JSON     | **[Sub Class](#sub-class)** object                                                                   |
| `pre_fixed`                      | JSON     | Pre-fixed configuration *(conditional)*                                                              |
| `post_fixed`                     | JSON     | Post-fixed configuration *(conditional)*                                                             |
| `isin_code`                      | string   | ISIN code *(conditional)*                                                                            |
| `external_id`                    | string   | External identifier of the issuance series *(conditional)*                                           |
| `specific_interest_rate_data`    | JSON     | Specific interest rate data *(conditional)*                                                          |

### Sub Class
| Field                  | Type     | Description                                         |
|------------------------|----------|-----------------------------------------------------|
| `sub_class_key`        | string   | Unique identification key of the sub class          |
| `name`                 | string   | Sub class name                                      |
| `subordination_level`  | int      | Sub class subordination level                       |
| `fund_class`           | JSON     | **[Fund Class](#fund-class)** object                |

### Fund Class
| Field                          | Type     | Description                                         |
|--------------------------------|----------|-----------------------------------------------------|
| `fund_class_key`               | string   | Unique identification key of the fund class         |
| `name`                         | string   | Fund class name                                     |
| `short_name`                   | string   | Fund class short name                               |
| `document_number`              | string   | Fund class CNPJ                                     |
| `accounting_date`              | string   | Fund class accounting date                          |
| `sub_type`                     | string   | Fund class sub-type (enumerator)                    |
| `tax_classification_id`        | string   | Tax classification (enumerator)                     |
| `condominum_type_id`           | string   | Condominium type (enumerator)                       |
| `investment_category_id`       | string   | Investment category (enumerator)                    |
| `prevent_payment`              | boolean  | Prevent payment flag                                |
| `integralization_account_key`  | string   | Integralization account key                         |
| `manager`                      | JSON     | **[Manager](#manager)** object                      |

### Manager
| Field               | Type     | Description                                 |
|---------------------|----------|---------------------------------------------|
| `manager_key`       | string   | Unique identification key of the manager    |
| `manager_name`      | string   | Manager name                                |
| `document_number`   | string   | Manager CNPJ                                |

---

# Query Financial Application by Key

URL: /en/documentation/iaas/passivo/aplicacao_financeira/buscar_aplicacao_financeira_por_chave

---

### Request

ENDPOINT /quota/investor/INVESTOR_KEY/financial_application/FINANCIAL_APPLICATION_KEY
METHOD GET
STATUS 200

### Responses
 

Case 01: Successful query

```json
{
    "external_id": "",
    "financial_application_key": "UUID",
    "share_capital": 0.00,
    "investor_position": {
        "investor": {
            "investor_key": "UUID",
            "document_number": "999.999.999-99" | "99.999.999/9999-99",
            "name": "",
            "person_type": "natural_person" | "legal_person",
            "account_data": {
                "owner": {
                    "name": "",
                    "document_number": "99.999.999/9999-99"
                },"issuance_serie": {},
                "account_digit": "0",
                "account_branch": "0000",
                "account_number": "00000",
                "financial_institution_code": "000",
                "financial_institution_ispb": "00000000"
            },
            "distributor": {
                "distributor_key": "UUID",
                "document_number": "99.999.999/9999-99",
                "name": "",
                "account_data": {
                    "owner": {
                        "name": "",
                        "document_number": "99.999.999/9999-99"
                    },
                    "account_digit": "0",
                    "account_branch": "0000",
                    "account_number": "00000",
                    "financial_institution_code": "000",
                    "financial_institution_ispb": "00000000"
                },
            }
        },
        "total_net_worth": 0.00,
        "total_number_of_quotas": 0.00000000,
        "investor_position_key": "UUID",
        "issuance_serie":{
            "name":"1",
            "cetip_code":"0000000SN1",
            "start_date":"YYYY-MM-DD",
            "maturity_date":"YYYY-MM-DD",
            "original_quota_value":0.00000000000000,
            "remuneration_type":"yield_curve",
            "interest_rate_type":"post_fixed",
            "pre_fixed":{
               "calendar_base":"workdays / calendar_360 / calendar_365",
               "monthly_rate":0.00000000000000
            },
            "post_fixed":{
               "calendar_base":"workdays / calendar_360 / calendar_365",
               "indexer":"di / ipca",
               "rate":1,
               "lag":{
                  "reference":"daily / monthly",
                  "amount":1
               }
            },
            "investment_category":"fidc / multi_market",
            "condominum_type":"open_ended / close_ended",
            "tax_classification":"short_term / long_term",
            "investment_restriction_type":"just_professional",
            "issuance_serie_key":"UUID",
            "minimum_share_capital":0.0,
            "accounting_date":"YYYY-MM-DD",
            "sub_class":{
               "name":"COTA SÊNIOR",
               "sub_class_key":"UUID",
               "subordination_level":1,
               "fund_class":{
                  "name":"SAMPLE FUND CLASS NAME",
                  "fund_class_key":"UUID",
                  "document_number":"00.000.000/0000-00"
               }
            }
        }
    },
    "original_principal_value": 0.00000000,
    "current_principal_value": 0.00000000,
    "original_number_of_units": 0.00000000,
    "current_number_of_units": 0.00000000,
    "quotation_date": "yyyy-mm-dd",
    "status": "pending_payment" | "pending_quote" | "quoted" | "settled" | "redeemed" | "canceled",
    "status_events": [
        {
            "event_datetime": "yyyy-mm-dd HH:MM:SS:ms",
            "status": "pending_payment" | "pending_quote" | "quoted" | "settled" | "redeemed" | "canceled",
        }
    ],
    "capital_returns": [
        {
            "capital_return_key": "UUID",
            "origin_key": "UUID",
            "net_value": 0.00,
            "iof_value": 0.00,
            "ir_value": 0.00,
            "payment_date": "yyyy-mm-dd",
            "capital_return_date": "yyyy-mm-dd",
            "status": "",
            "capital_return_type": "",
            "number_of_units": "",
        }
    ],
}
```

### Financial Application
| Field                         | Type     | Description                                                                     | Characters |
|-------------------------------|----------|---------------------------------------------------------------------------------|------------|
| `external_id`                 | string   | External identifier                                                             | up to 100  |
| `financial_application_key`   | string   | Unique identification key for the financial application                         | 36         |
| `share_capital`               | float    | Investment amount                                                               | -          |             
| `investor_position`           | JSON     | **[Investor Position](#investor_position)** object                             | -          |
| `original_principal_value`    | float    | Original principal value per share                                              | -          |
| `current_principal_value`     | float    | Current principal value per share                                               | -          |
| `original_number_of_units`    | float    | Original quantity of shares                                                     | -          |
| `current_number_of_units`     | float    | Current quantity of shares                                                      | -          |
| `quotation_date`              | string   | Quotation date                                                                  | -          |
| `status`                      | string   | **[Financial Application Status](#financial_application_status)** enumerator   | -          |
| `status_events`               | array    | List of **[Status Event](#status_event)** objects                              | -          |
| `capital_returns`             | array    | List of **[Capital Return](#capital_return)** objects                          | -          |

### Financial Application Status
| Enumerator               | Description                                     |
|--------------------------|-------------------------------------------------|
| `pending_payment`        | Pending payment                                 |
| `pending_quote`          | Pending quotation                               |
| `quoted`                 | Quoted                                          |
| `settled`                | Fully amortized                                 |
| `redeemed`               | Fully redeemed                                  |
| `canceled`               | Canceled                                        |

### Investor Position
| Field                    | Type   | Description                                           |
|--------------------------|--------|-------------------------------------------------------|
| `investor`               | JSON   | **[Investor](#investor)** object                      |
| `total_net_worth`        | float  | Net worth of the investor's position                  |
| `total_number_of_quotas` | float  | Number of shares in the investor's position           |
| `issuance_serie`         | JSON   | **[Issuance Serie](#issuance_serie)** object         |
| `investor_position_key`  | JSON   | Unique identification key for the investor's position |

### Investor
| Field                    | Type     | Description                               | Characters |
|--------------------------|----------|-------------------------------------------|------------|
| `name`                   | string   | Investor's name                           | up to 255  |
| `investor_key`           | string   | Unique identification key for the investor| 36         |
| `document_number`        | string   | CPF/CNPJ of the investor                  | 14 or 18   |
| `person_type`            | string   | Natural Person / Legal Person / Fund Class| up to 50   |
| `distributor`            | JSON     | **[Distributor](#distributor)** object    |     -      |             
| `account_data`           | JSON     | **[Account Data](#account_data)** object  |     -      |

### Distributor
| Field                    | Type     | Description                                  | Characters |
|--------------------------|----------|----------------------------------------------|------------|
| `name`                   | string   | Distributor's name                           | up to 255  |
| `distributor_key`        | string   | Unique identification key for the distributor|     -      |             
| `document_number`        | string   | CPF/CNPJ of the distributor                  | 14 or 18   |
| `account_data`           | JSON     | **[Account Data](#account_data)** object     |     -      |

### Account Data
| Field                        | Type     | Description                                                         |
|------------------------------|----------|---------------------------------------------------------------------|
| `account_digit`              | string   | Bank account digit                                                  |
| `account_branch`             | string   | Bank account branch number                                          |             
| `account_number`             | string   | Bank account number                                                 |
| `financial_institution_code` | string   | Financial institution code                                          |
| `financial_institution_ispb` | string   | Brazilian Payment System identifier for the financial institution   |

### Issuance Serie
| Field                         | Type     | Description                                        | Characters |
|-------------------------------|----------|----------------------------------------------------|------------|
| `name`                        | string   | Issuance series name                               | up to 255  |
| `issuance_serie_key`          | string   | Unique identification key for the issuance series  | 36         |
| `cetip_code`                  | string   | Issuance series code as asset in CETIP            | 10         |             
| `start_date`                  | string   | Issuance series start date                         | 10         |
| `maturity_date`               | string   | Issuance series maturity date                      | 10         |
| `original_quota_value`        | float    | Original share value                               | -          |
| `remuneration_type`           | string   | Yield curve / Residual                             | up to 50   |
| `investment_category`         | string   | FIDC / Multi-market                                | up to 50   |
| `condominum_type`             | string   | Open-ended / Close-ended                           | up to 50   |
| `tax_classification`          | string   | Short-term / Long-term                             | up to 50   |
| `investment_restriction_type` | string   | No restriction / Qualified / Professional          | up to 50   |
| `minimum_share_capital`       | float    | Minimum value for investment                       | -          |
| `accounting_date`             | string   | Accounting date of the issuance series             | 10         |
| `sub_class`                   | JSON     | **[Sub Class](#sub_class)** object                 | -          |

### Sub Class 
| Field                         | Type     | Description                                | Characters |
|-------------------------------|----------|--------------------------------------------|------------|
| `name`                        | string   | Sub class name                             | up to 255  |
| `sub_class_key`               | string   | Unique identification key for the sub class| 36         |
| `subordination_level`         | int      | Subordination level of the sub class       | -          |             
| `fund_class`                  | JSON     | **[Fund Class](#fund_class)** object       | -          |

### Fund Class 
| Field                         | Type     | Description                                    | Characters |
|-------------------------------|----------|------------------------------------------------|------------|
| `name`                        | string   | Fund class name                                | up to 255  |
| `fund_class_key`              | string   | Unique identification key for the fund class   | 36         |
| `document_number`             | string   | CNPJ of the fund class                         | -          |             

### Capital Return
| Field                     | Type     | Description                                                |
|---------------------------|----------|------------------------------------------------------------|
| `capital_return_key`      | string   | Unique identification key for the capital return           |                       
| `origin_key`              | string   | Unique identification key for the capital return origin    |                               
| `net_value`               | float    | Net value of the capital return                            |       
| `iof_value`               | float    | IOF value of the capital return                            |   
| `ir_value`                | float    | IR value of the capital return                             |   
| `payment_date`            | string   | Payment date of the capital return                         |   
| `capital_return_date`     | string   | Creation date of the capital return                        |           
| `status`                  | string   | Sending to Administrator / Pending Payment / Paid          |                           
| `capital_return_type`     | string   | Amortization / Redemption Request / Come-cotas             |               
| `number_of_units`         | float    | Number of shares of the capital return                     |

---

# Create Financial Application

URL: /en/documentation/iaas/passivo/aplicacao_financeira/criar_aplicacao_financeira

---

### Request

ENDPOINT /quota/investor/INVESTOR_KEY/financial_application
METHOD POST
STATUS 201

```json title='Request Body'
{
    "issuance_serie_key": "UUID",
    "share_capital": 0.00,
    "payment_method": "b3 / regular",
    "central_depositary": "unregistered / cetip",
    "quotation_date": "yyyy-mm-dd"
}
```

:::note **Required Fields**.
- issuance_serie_key 
- share_capital
:::

:::caution **Attention**
**payment_method** and **central_depositary** are optional fields, so if they are not sent, the default marked option will be considered.

- This will be deprecated in future versions, making it mandatory to send the fields
- With **central_depositary** `cetip`, **payment_method** can be `regular` or `b3`. With `unregistered`, only `regular` (`b3` is not allowed).
:::
### Body params
| Field                             | Type     | Description                                                                                                              |
|-----------------------------------|----------|--------------------------------------------------------------------------------------------------------------------------|
| `issuance_serie_key`              | string   | Unique identification key for the Issuance Series                                                                        |
| `share_capital`                   | float    | Financial application amount                                                                                             |
| `payment_method`                  | string   | Payment Method. Expected values:<br />• regular: Pix or TED **(default)**<br />• b3: Via B3                      |
| `central_depositary`              | string   | Depositary type. Expected values:<br />• unregistered: Without registrar<br />• cetip: Registered at Cetip **(default)** |
| `quotation_date`                  | string   | Application quotation date, in yyyy-mm-dd format (optional)                                                              |

### Response
```json title='Response Body'
{
    "financial_application_key": "UUID"
}
```

---

# Manual approval of quota lock

URL: /en/documentation/iaas/passivo/bloqueio_de_cotas/aprovar_bloqueio_pendente_aprovacao

---

### Introduction
This feature aims to detail the manual approval flow for a quota lock.

:::warning Attention
The quota lock will only go to pending manual approval if the lock amount exceeds the total equity value by up to **3.8%**

:::

### Approval

ENDPOINT quota_lock/investor/INVESTOR_KEY/quota_lock/QUOTA_LOCk_KEY/pending_manual_approval/approve
MÉTODO PUT
STATUS 204

### Rejection

ENDPOINT quota_lock/investor/INVESTOR_KEY/quota_lock/QUOTA_LOCk_KEY/pending_manual_approval/reprove
MÉTODO PUT
STATUS 204

---

# Query quota lock

URL: /en/documentation/iaas/passivo/bloqueio_de_cotas/consulta_de_bloqueio_de_cotas

---

### Introduction
This feature aims to detail the information of a **quota lock** request for an **investor**.

### Request

ENDPOINT /quota_lock/investor/INVESTOR_KEY/quota_lock/QUOTA_LOCK_KEY
METHOD GET
STATUS 200

### Response
```json
{
  "quota_lock_key": "UUID",
  "status": "pending_documents",
  "original_locked_quotas": 0.0,
  "current_locked_quotas": 0.0,
  "original_locked_value": 0.0,
  "current_locked_value": 0.0,
  "type": "collateral",
  "collateral": {
    "recipient": {
      "name": "Sample Recipient Name",
      "document_number": "000.000.000-00",
      "person_type": "natural_person",
      "natural_person": {
        "birthdate": "YYYY-MM-DD",
        "mother_name": "Sample Recipient Mother Name"
      }
    },
    "borrower": {
      "name": "Sample Borrower Name",
      "document_number": "000.000.000-00",
      "person_type": "natural_person",
      "natural_person": {
        "birthdate": "YYYY-MM-DD",
        "mother_name": "Sample Borrower Mother Name"
      }
    },
    "assets": [
      {
        "asset_key": "UUID",
        "asset_type": "cce",
        "credit_operation": {
          "contract_number": "1000000001",
          "principal_value": 0.0,
          "interest_rate_type": "post_fixed",
          "pre_fixed": {
            "monthly_rate": 0.0,
            "calendar_base": "calendar_360"
          },
          "post_fixed": {
            "calendar_base": "workdays",
            "indexer": "di",
            "rate": 1,
            "lag": {
              "reference": "daily",
              "amount": 1
            }
          }
        },
        "documents": [
          {
            "document_key": "UUID",
            "document_type": "asset_document"
          }
        ]
      }
    ],
    "issuance_series": [
      {
        "issuance_serie_key": "UUID",
        "number_of_quotas": 0.0,
        "financial_value": 0.0
      },
      {
        "issuance_serie_key": "UUID",
        "number_of_quotas": 0.0,
        "financial_value": 0.0
      }
    ],
    "documents": [
      {
        "document_key": "UUID",
        "document_type": "collateral_contract"
      }
    ]
  },
  "investor_positions_locks": [
    {
      "investor_position_lock_key": "UUID",
      "investor_position_key": "UUID",
      "original_locked_quotas": 0.0,
      "current_locked_quotas": 0.0,
      "original_locked_value": 0.0,
      "current_locked_value": 0.0
    }
  ]
}
```

### Quota Lock
| Field                       | Type   | Description                                                              | Characters |
|-----------------------------|------- |--------------------------------------------------------------------------|------------|
| `quota_lock_key`            | string | Unique identifier of the quota lock                                      | 36         |
| `status`                    | string | Quota lock status enumerator                                            | up to 255  |
| `type`                      | string | Quota lock type enumerator                                               | up to 255  |
| `original_locked_quotas`    | float  | Original quantity of locked quotas                                       | -          |
| `current_locked_quotas`     | float  | Current quantity of locked quotas                                        | -          |
| `original_locked_value`     | float  | Original lock value                                                      | -          |
| `current_locked_value`      | float  | Current lock value                                                       | -          |
| `collateral`                | JSON   | **[Collateral](#collateral)** object                                      | -          |
| `investor_positions_locks`  | Array  | List of **[Investor position lock](#locked-investor-positions)** objects                 | -          |

### Quota Lock Status
| Enumerator               | Description            |
|--------------------------|------------------------|
| `pending_documents`      | Pending documents      |
| `pending_approval`       | Pending approval       |
| `denied`                 | Denied                 |
| `approved`               | Approved               |

### Quota Lock Type
| Enumerator               | Description            |
|--------------------------|------------------------|
| `collateral`             | Collateral             |

### Collateral
| Field                       | Type   | Description                                                               | Characters |
|-----------------------------|------- |---------------------------------------------------------------------------|------------|
| `recipient`                 | JSON   | **[Recipient](#recipient)** object                                        | -          |
| `borrower`                  | JSON   | **[Borrower](#borrower)** object                                          | -          |
| `assets`                    | Array  | List of **[Asset](#asset)** objects                                       | -          |
| `issuance_series`           | Array  | List of **[Issuance series](#issuance_serie)** objects                    | -          |
| `documents`                 | Array  | List of **[Collateral document](#collateral_document)** objects           | -          |

### Recipient
| Field                       | Type   | Description                                         | Characters |
|-----------------------------|------- |-----------------------------------------------------|------------|
| `name`                      | string | Recipient name                                      | up to 255  |
| `document_number`           | string | Recipient CPF / CNPJ                                | 14 or 18   |
| `person_type`               | string | Natural or legal person enumerator                   | up to 255  |
| `natural_person`            | JSON   | **[Natural Person](#natural_person)** object        | -          |
| `legal_person`              | JSON   | **[Legal Person](#legal_person)** object            | -          |

### Borrower
| Field                       | Type   | Description                                         | Characters |
|-----------------------------|------- |-----------------------------------------------------|------------|
| `name`                      | string | Borrower name                                       | up to 255  |
| `document_number`           | string | Borrower CPF / CNPJ                                 | 14 or 18   |
| `person_type`               | string | Natural or legal person enumerator                   | up to 255  |
| `natural_person`            | JSON   | **[Natural Person](#natural_person)** object        | -          |
| `legal_person`              | JSON   | **[Legal Person](#legal_person)** object            | -          |

### Person Type
| Enumerator               | Description            |
|--------------------------|------------------------|
| `natural_person`         | Natural person         |
| `legal_person`           | Legal person           |

### Natural Person
| Field                       | Type   | Description                                         | Characters |
|-----------------------------|------- |-----------------------------------------------------|------------|
| `birthdate`                 | string | Birth date                                          | 10         |
| `mother_name`               | string | Mother's name                                       | up to 255  |

### Legal Person
| Field            | Type     | Description                                                      | Characters   |
|------------------|----------|------------------------------------------------------------------|--------------|
| `activity_code`  | string   | National Classification of Economic Activities (CNAE)            |     10       |
| `representatives`| array    | List of **[Representative](#representative)** objects            |      -       |

### Representative
| Field                             | Type     | Description                                      | Characters   |
|-----------------------------------|----------|--------------------------------------------------|--------------|
| `name`                            | string   | Representative name                              |   up to 255  |
| `document_number`                 | string   | Representative CPF                               |     14       |

### Asset
| Field                             | Type     | Description                                                       | Characters   |
|-----------------------------------|----------|-------------------------------------------------------------------|--------------|
| `asset_key`                       | string   | Unique asset identifier                                           |   up to 255  |
| `asset_type`                      | string   | Asset type enumerator                                             |   up to 255  |
| `status`                          | string   | Asset status enumerator                                           |   up to 255  |
| `credit_operation`                | JSON     | **[Credit Operation](#credit_operation)** object                  |     -        |
| `documents`                       | Array    | List of **[Asset document](#asset_document)** objects             |     -        |

### Asset Status
| Enumerator               | Description            |
|--------------------------|------------------------|
| `pending_approval`       | Pending approval       |
| `done`                   | Completed              |

### Document
| Field                             | Type     | Description                                                       | Characters   |
|-----------------------------------|----------|-------------------------------------------------------------------|--------------|
| `document_key`                    | string   | Unique asset identifier                                           |   up to 255  |
| `document_type`                   | string   | Asset type enumerator                                             |   up to 255  |

### Asset Type
| Enumerator               | Description |
|--------------------------|-------------|
| `ccb`                    | CCB         |
| `cce`                    | CCE         |

### Credit Operation
| Field                             | Type     | Description                                             | Characters   |
|-----------------------------------|----------|---------------------------------------------------------|--------------|
| `contract_number`                 | string   | Contract number                                         |   up to 255  |
| `principal_value`                 | string   | Operation principal value                               |     -        |
| `interest_rate_type`              | string   | Post-fixed / pre-fixed enumerator                       |   up to 255  |
| `pre_fixed`                       | JSON     | **[Pre-fixed](#pre_fixed)** object                     |     -        |
| `post_fixed`                      | JSON     | **[Post-fixed](#pós_fixed)** object                    |     -        |

### Interest Rate Type
| Enumerator               | Description            |
|--------------------------|------------------------|
| `pre_fixed`              | Pre-fixed              |
| `post_fixed`             | Post-fixed             |

### Pre fixed 
| Field                         | Type     | Description                                                        | Characters |
|-------------------------------|----------|--------------------------------------------------------------------|------------|
| `calendar_base`               | string   | Business days / 360-day calendar / 365-day calendar enumerator     | up to 255  |
| `monthly_rate`                | float    | Monthly rate                                                       | -          |

### Post fixed 
| Field                         | Type     | Description                                                         | Characters |
|-------------------------------|----------|---------------------------------------------------------------------|------------|
| `calendar_base`               | string   | Business days / 360-day calendar / 365-day calendar enumerator      | up to 255  |
| `indexer`                     | string   | DI / IPCA enumerator                                                | up to 255  |
| `rate`                        | float    | Rate                                                                | -          |
| `lag`                         | JSON     | **[Lag](#lag)** object                                              | -          |

### calendar_base
| Enumerator               | Description            |
|--------------------------|------------------------|
| `workdays`               | Business days          |
| `calendar_360`           | 360-day calendar       |
| `calendar_365`           | 365-day calendar       |

### Indexer
| Enumerator               | Description            |
|--------------------------|------------------------|
| `di`                     | DI                     |
| `ipca`                   | IPCA                   |

### Lag
| Field                         | Type     | Description                                         | Characters |
|-------------------------------|----------|-----------------------------------------------------|------------|
| `reference`                   | string   | Daily / Monthly enumerator                          | up to 255  |
| `amount`                      | integer  | Lag amount                                          | -          |

### Reference
| Enumerator               | Description            |
|--------------------------|------------------------|
| `daily`                  | Daily                  |
| `monthly`                | Monthly                |

### Locked Investor Positions
| Field                           | Type   | Description                                                           | Characters |
|---------------------------------|------- |-----------------------------------------------------------------------|------------|
| `investor_position_lock_key`    | string | Unique identifier of the investor position lock                       | 36         |
| `investor_position_key`         | string | Unique identifier of the investor position                            | 36         |
| `original_locked_quotas`        | float  | Original quantity of locked quotas                                    | -          |
| `current_locked_quotas`         | float  | Current quantity of locked quotas                                     | -          |
| `original_locked_value`         | float  | Original lock value                                                   | -          |
| `current_locked_value`          | float  | Current lock value                                                    | -          |

### Responses
```json title='Response Body'
{
    "quota_lock_key": "UUID"
}
```

---

# Query investor quota locks

URL: /en/documentation/iaas/passivo/bloqueio_de_cotas/consulta_de_bloqueio_de_cotas_de_um_investidor

---

### Introduction
This resource aims to detail the information of all **quota lock** requests from an **investor**.

### Request

ENDPOINT /quota_lock/investor/INVESTOR_KEY/quota_locks
METHOD GET
STATUS 200

### Response
```json
{
  "data": [
    {
      "quota_lock_key": "UUID",
      "status": "pending_documents",
      "original_locked_quotas": 0.0,
      "current_locked_quotas": 0.0,
      "original_locked_value": 0.0,
      "current_locked_value": 0.0,
      "type": "collateral",
      "collateral": {
        "recipient": {
          "name": "Sample Recipient Name",
          "document_number": "000.000.000-00",
          "person_type": "natural_person",
          "natural_person": {
            "birthdate": "YYYY-MM-DD",
            "mother_name": "Sample Recipient Mother Name"
          }
        },
        "borrower": {
          "name": "Sample Borrower Name",
          "document_number": "000.000.000-00",
          "person_type": "natural_person",
          "natural_person": {
            "birthdate": "YYYY-MM-DD",
            "mother_name": "Sample Borrower Mother Name"
          }
        },
        "assets": [
          {
            "asset_key": "UUID",
            "asset_type": "cce",
            "credit_operation": {
              "contract_number": "1000000001",
              "principal_value": 0.0,
              "interest_rate_type": "post_fixed",
              "pre_fixed": {
                "monthly_rate": 0.0,
                "calendar_base": "calendar_360"
              },
              "post_fixed": {
                "calendar_base": "workdays",
                "indexer": "di",
                "rate": 1,
                "lag": {
                  "reference": "daily",
                  "amount": 1
                }
              }
            },
            "documents": [
              {
                "document_key": "UUID",
                "document_type": "asset_document"
              }
            ]
          }
        ],
        "issuance_series": [
          {
            "issuance_serie_key": "UUID",
            "number_of_quotas": 0.0,
            "financial_value": 0.0
          },
          {
            "issuance_serie_key": "UUID",
            "number_of_quotas": 0.0,
            "financial_value": 0.0
          }
        ],
        "documents": [
          {
            "document_key": "UUID",
            "document_type": "collateral_contract"
          }
        ]
      },
      "investor_positions_locks": [
        {
          "investor_position_lock_key": "UUID",
          "investor_position_key": "UUID",
          "original_locked_quotas": 0.0,
          "current_locked_quotas": 0.0,
          "original_locked_value": 0.0,
          "current_locked_value": 0.0
        }
      ]
    },
    {
      "quota_lock_key":"04eeaabc-cb40-484a-b730-85ed5aed7bbf",
      "status":"approved",
      "type":"lawsuit",
      "original_locked_value":"50000.00",
      "current_locked_value":"50000.00",
      "lawsuit":{
          "protocol":"20250037746822",
          "lock_date":"2024-01-15",
          "unlock_date":"2024-01-16",
          "process_number":"13289520258250000",
          "document_number":"236.682.501-38",
          "requested_amount":50000.0
      }
    }
  ],
  "page": 0,
  "is_last_page": true
}
```

### Quota Lock
| Field                       | Type   | Description                                                            | Characters |
|-----------------------------|------- |------------------------------------------------------------------------|------------|
| `quota_lock_key`            | string | Unique identifier for quota lock                                       | 36         |
| `status`                    | string | Quota lock status enumerator                                           | up to 255  |
| `type`                      | string | Quota lock type enumerator                                             | up to 255  |
| `original_locked_quotas`    | float  | Original amount of locked quotas                                       | -          |
| `current_locked_quotas`     | float  | Current amount of locked quotas                                        | -          |
| `original_locked_value`     | float  | Original lock value                                                    | -          |
| `current_locked_value`      | float  | Current lock value                                                     | -          |
| `collateral`                | JSON   | **[Collateral](#collateral)** object                                   | -          |
| `investor_positions_locks`  | Array  | List of **[Investor position lock](#locked-investor-positions)** objects              | -          |

### Quota Lock Status
| Enumerator               | Description           |
|--------------------------|-----------------------|
| `pending_documents`      | Pending documents     |
| `pending_approval`       | Pending approval      |
| `denied`                 | Denied                |
| `approved`               | Approved              |

### Quota Lock Type
| Enumerator               | Description           |
|--------------------------|-----------------------|
| `collateral`             | Collateral            |

### Collateral
| Field                       | Type   | Description                                                           | Characters |
|-----------------------------|------- |-----------------------------------------------------------------------|------------|
| `recipient`                 | JSON   | **[Recipient](#recipient)** object                                    | -          |
| `borrower`                  | JSON   | **[Borrower](#borrower)** object                                      | -          |
| `assets`                    | Array  | List of **[Asset](#asset)** objects                                   | -          |
| `issuance_series`           | Array  | List of **[Issuance series](#issuance_serie)** objects                | -          |
| `documents`                 | Array  | List of **[Collateral document](#collateral_document)** objects       | -          |

### Recipient
| Field                       | Type   | Description                                         | Characters |
|-----------------------------|------- |-----------------------------------------------------|------------|
| `name`                      | string | Recipient name                                      | up to 255  |
| `document_number`           | string | Recipient CPF / CNPJ                                | 14 or 18   |
| `person_type`               | string | Natural or legal person enumerator                  | up to 255  |
| `natural_person`            | JSON   | **[Natural Person](#natural_person)** object        | -          |
| `legal_person`              | JSON   | **[Legal Person](#legal_person)** object            | -          |

### Borrower
| Field                       | Type   | Description                                         | Characters |
|-----------------------------|------- |-----------------------------------------------------|------------|
| `name`                      | string | Borrower name                                       | up to 255  |
| `document_number`           | string | Borrower CPF / CNPJ                                 | 14 or 18   |
| `person_type`               | string | Natural or legal person enumerator                  | up to 255  |
| `natural_person`            | JSON   | **[Natural Person](#natural_person)** object        | -          |
| `legal_person`              | JSON   | **[Legal Person](#legal_person)** object            | -          |

### Person Type
| Enumerator               | Description           |
|--------------------------|-----------------------|
| `natural_person`         | Natural person        |
| `legal_person`           | Legal person          |

### Natural Person
| Field                       | Type   | Description                                         | Characters |
|-----------------------------|------- |-----------------------------------------------------|------------|
| `birthdate`                 | string | Birth date                                          | 10         |
| `mother_name`               | string | Mother's name                                       | up to 255  |

### Legal Person
| Field            | Type     | Description                                                              | Characters   |
|------------------|----------|--------------------------------------------------------------------------|--------------|
| `activity_code`  | string   | National Classification of Economic Activities (CNAE)                    |     10       |
| `representatives`| array    | List of **[Representative](#representative)** objects                    |      -       |

### Representative
| Field                             | Type     | Description                                    | Characters   |
|-----------------------------------|----------|------------------------------------------------|--------------|
| `name`                            | string   | Representative name                            |   up to 255  |
| `document_number`                 | string   | Representative CPF                             |     14       |

### Asset
| Field                             | Type     | Description                                                   | Characters   |
|-----------------------------------|----------|---------------------------------------------------------------|--------------|
| `asset_key`                       | string   | Unique asset identifier                                       |   up to 255  |
| `asset_type`                      | string   | Asset type enumerator                                         |   up to 255  |
| `status`                          | string   | Asset status enumerator                                       |   up to 255  |
| `credit_operation`                | JSON     | **[Credit Operation](#credit_operation)** object              |     -        |
| `documents`                       | Array    | List of **[Asset document](#asset_document)** objects         |     -        |

### Asset Status
| Enumerator               | Description           |
|--------------------------|-----------------------|
| `pending_approval`       | Pending approval      |
| `done`                   | Done                  |

### Document
| Field                             | Type     | Description                                                   | Characters   |
|-----------------------------------|----------|---------------------------------------------------------------|--------------|
| `document_key`                    | string   | Unique asset identifier                                       |   up to 255  |
| `document_type`                   | string   | Asset type enumerator                                         |   up to 255  |

### Asset Type
| Enumerator               | Description |
|--------------------------|-------------|
| `ccb`                    | CCB         |
| `cce`                    | CCE         |

### Credit Operation
| Field                             | Type     | Description                                           | Characters   |
|-----------------------------------|----------|-------------------------------------------------------|--------------|
| `contract_number`                 | string   | Contract number                                       |   up to 255  |
| `principal_value`                 | string   | Operation principal value                             |     -        |
| `interest_rate_type`              | string   | Post-fixed / pre-fixed enumerator                     |   up to 255  |
| `pre_fixed`                       | JSON     | **[Pre-fixed](#pre_fixed)** object                   |     -        |
| `post_fixed`                      | JSON     | **[Post-fixed](#pós_fixed)** object                  |     -        |

### Interest Rate Type
| Enumerator               | Description           |
|--------------------------|-----------------------|
| `pre_fixed`              | Pre-fixed             |
| `post_fixed`             | Post-fixed            |

### Pre fixed 
| Field                         | Type     | Description                                                      | Characters |
|-------------------------------|----------|------------------------------------------------------------------|------------|
| `calendar_base`               | string   | Workdays / calendar 360 / calendar 365 enumerator               | up to 255  |
| `monthly_rate`                | float    | Monthly rate                                                     | -          |

### Post fixed 
| Field                         | Type     | Description                                                         | Characters |
|-------------------------------|----------|---------------------------------------------------------------------|------------|
| `calendar_base`               | string   | Workdays / calendar 360 / calendar 365 enumerator                  | up to 255  |
| `indexer`                     | string   | DI / IPCA enumerator                                                | up to 255  |
| `rate`                        | float    | Rate                                                                | -          |
| `lag`                         | JSON     | **[Lag](#lag)** object                                              | -          |

### calendar_base
| Enumerator               | Description           |
|--------------------------|-----------------------|
| `workdays`               | Workdays              |
| `calendar_360`           | Calendar 360 days     |
| `calendar_365`           | Calendar 365 days     |

### Indexer
| Enumerator               | Description           |
|--------------------------|-----------------------|
| `di`                     | DI                    |
| `ipca`                   | IPCA                  |

### Lag
| Field                         | Type     | Description                                       | Characters |
|-------------------------------|----------|---------------------------------------------------|------------|
| `reference`                   | string   | Daily / Monthly enumerator                        | up to 255  |
| `amount`                      | integer  | Lag amount                                        | -          |

### Reference
| Enumerator               | Description           |
|--------------------------|-----------------------|
| `daily`                  | Daily                 |
| `monthly`                | Monthly               |

### Locked Investor Positions
| Field                           | Type   | Description                                                           | Characters |
|---------------------------------|------- |-----------------------------------------------------------------------|------------|
| `investor_position_lock_key`    | string | Unique identifier for investor position lock                          | 36         |
| `investor_position_key`         | string | Unique identifier for investor position                               | 36         |
| `original_locked_quotas`        | float  | Original amount of locked quotas                                      | -          |
| `current_locked_quotas`         | float  | Current amount of locked quotas                                       | -          |
| `original_locked_value`         | float  | Original lock value                                                   | -          |
| `current_locked_value`          | float  | Current lock value                                                    | -          |

### Responses
```json title='Response Body'
{
    "quota_lock_key": "UUID"
}
```

---

# Send Collateral Document

URL: /en/documentation/iaas/passivo/bloqueio_de_cotas/enviar_documento_da_garantia

---
### Introduction
This resource aims to send us the **document** related to the formalization of the **collateral** for which a **quota lock** is being requested.

### Input / Output:
As ***input***, the **document type** and the **base 64** of the document must be sent. See example below.

As ***output***, a ***collateral_document_key*** will be delivered. The ***collateral_document_key*** is used to identify the **collateral document** sent.

### Request

ENDPOINT /quota_lock/investor/INVESTOR_KEY/quota_lock/QUOTA_LOCK_KEY/collateral/COLLATERAL_KEY/document
MÉTODO POST
STATUS 201

### Request body
```json title='Request Body'
{
  "document_type": "collateral_contract",
  "document_b64" : "B64"
}
```

### Response
```json title='Response Body'
{
    "collateral_document_key": "UUID"
}
```

---

# Send Asset Document

URL: /en/documentation/iaas/passivo/bloqueio_de_cotas/enviar_documento_do_ativo

---
### Introduction
This feature aims to send us the **document** of the **asset** that is the object of the **collateral** for which a **quota lock** is being requested

### Input / Output:
As ***input***, the **document type** and the **base 64** of the document must be sent. Example below.

As ***output***, an ***asset_document_key*** will be delivered. The ***asset_document_key*** is used to identify the **asset document** sent.

### Request

ENDPOINT /quota_lock/investor/INVESTOR_KEY/quota_lock/QUOTA_LOCK_KEY/collateral/COLLATERAL_KEY/asset/ASSET_KEY/document
MÉTODO POST
STATUS 201

### Request body
```json title='Request Body'
{
  "document_type": "asset_document",
  "document_b64" : "B64"
}
```

### Response
```json title='Response Body'
{
    "asset_document_key": "UUID"
}
```

---

# Reduce quota lock

URL: /en/documentation/iaas/passivo/bloqueio_de_cotas/reduzir_bloqueio_de_cotas

---

### Introduction
This feature aims to reduce the **quota lock** value of an **investor**.

### Request

ENDPOINT /quota_lock/investor/INVESTOR_KEY/quota_lock/QUOTA_LOCK_KEY/investor_position_lock/INVESTOR_POSITION_LOCK_KEY/event
METHOD POST
STATUS 201
LOCKED_
Locked value reduction

```json
{
    "type": "decrease_locked_value",
    "new_locked_value": 0.00
}
```

Locked quota quantity reduction

```json
{
    "type": "decrease_locked_quotas",
    "new_locked_quotas": 0.00
}
```

### Locked Investor Position Event
| Field                       | Type   | Description                          | Characters | Required | 
|-----------------------------|--------|--------------------------------------|------------|----------| 
| `type`                      | string | Event type enumerator                | up to 255  |   Yes    | 
| `new_locked_value`          | float  | New locked financial value           | -          |    No    | 
| `new_locked_quotas`         | float  | New locked quota quantity            | -          |    No    | 

### Quota Lock Type
| Enumerator               | Description                                      |
|--------------------------|--------------------------------------------------|
| `decrease_locked_quotas` | Decrease locked quota quantity                   |
| `decrease_locked_value`  | Decrease locked financial value                  |

---

# Request quota lock

URL: /en/documentation/iaas/passivo/bloqueio_de_cotas/solicitar_bloqueio_de_cotas

---

### Introduction
This resource aims to create a **quota lock** request for an **investor**.

### Input / Output:
The **lock type** and specific information for the lock type must be sent.

As ***output***, the ***quota_lock_key*** will be delivered, representing the **quota lock**.

### Request

ENDPOINT /quota_lock/investor/INVESTOR_KEY/quota_lock
METHOD POST
STATUS 201

Quota lock by collateral - natural person

```json
{
    "type": "collateral",
    "collateral": {
        "recipient": {
            "name": "Sample Recipient Name",
            "document_number": "000.000.000-00",
            "person_type": "natural_person",
            "natural_person": {
               "birthdate": "YYYY-MM-DD",
               "mother_name": "Sample Recipient Mother Name",
            }
        },
        "borrower": {
            "name": "Sample Borrower Name",
            "document_number": "000.000.000-00",
            "person_type": "natural_person",
            "natural_person": {
               "birthdate": "YYYY-MM-DD",
               "mother_name": "Sample Borrower Mother Name",
            }
        },
        "assets": [
            {
                "asset_type": "cce",
                "credit_operation": {
                    "contract_number": "1000000001",
                    "principal_value": 0.0,
                    "interest_rate_type": "post_fixed",
                    "pre_fixed": {
                        "monthly_rate": 0.0,
                        "calendar_base": "calendar_360",
                    },
                    "post_fixed": {
                        "calendar_base": "workdays",
                        "indexer": "di",
                        "rate": 1,
                        "lag": {
                           "reference": "daily",
                           "amount": 1
                        },
                    },
                },
            },
        ],
        "issuance_series": [
            {
                "issuance_serie_key": "UUID",
                "number_of_quotas": 0.00,
                "financial_value": 0.00,
            },
            {
                "issuance_serie_key": "UUID",
                "number_of_quotas": 0.00,
                "financial_value": 0.00,
            },
        ],
        "bank_account_key": "UUID"
    },
}
```

Quota lock by collateral - legal person

```json
{
    "type": "collateral",
    "collateral": {
        "recipient": {
            "name": "Sample Recipient Name",
            "document_number": "000.000.000-00",
            "person_type": "legal_person",
            "legal_person": {
                "activity_code": "00.00-0-00",
                "representatives": [
                    {
                        "name": "Sample Recipient Representative Name",
                        "document_number": "000.000.000-00",
                    }
                ],
            }
        },
        "borrower": {
            "name": "Sample Borrower Name",
            "document_number": "000.000.000-00",
            "person_type": "legal_person",
            "legal_person": {
                "activity_code": "00.00-0-00",
                "representatives": [
                    {
                        "name": "Sample Borrower Representative Name",
                        "document_number": "000.000.000-00",
                    }
                ],
            }
        },
        "assets": [
            {
                "asset_type": "cce",
                "credit_operation": {
                    "contract_number": "1000000001",
                    "principal_value": 0.0,
                    "interest_rate_type": "post_fixed",
                    "pre_fixed": {
                        "monthly_rate": 0.0,
                        "calendar_base": "calendar_360",
                    },
                    "post_fixed": {
                        "calendar_base": "workdays",
                        "indexer": "di",
                        "rate": 1,
                        "lag": {
                           "reference": "daily",
                           "amount": 1
                        },
                    },
                },
            },
        ],
        "issuance_series": [
            {
                "issuance_serie_key": "UUID",
                "number_of_quotas": 0.00,
                "financial_value": 0.00,
            },
            {
                "issuance_serie_key": "UUID",
                "number_of_quotas": 0.00,
                "financial_value": 0.00,
            },
        ],
        "bank_account_key": "UUID"
    },
}
```

### Quota Lock
| Field                       | Type   | Description                                                      | Characters |
|-----------------------------|------- |------------------------------------------------------------------|------------|
| `type`                      | string | Quota lock type enumerator                                       | up to 255  |
| `collateral`                | string | **[Collateral](#collateral)** object                            | -          |

### Quota Lock Type
| Enumerator               | Description           |
|--------------------------|-----------------------|
| `collateral`             | Collateral            |

### Collateral
| Field                       | Type   | Description                                                      | Characters | Required |
|-----------------------------|------- |------------------------------------------------------------------|------------|----------|
| `recipient`                 | JSON   | **[Recipient](#recipient)** object                               | -          |   Yes    |
| `borrower`                  | JSON   | **[Borrower](#borrower)** object                                 | -          |   Yes    |
| `assets`                    | Array  | List of **[Asset](#asset)** objects                              | -          |   Yes    |
| `issuance_series`           | Array  | List of **[Issuance Series](#issuance_serie)** objects           | -          |   Yes    |
| `bank_account_key`          | string | Bank account UUID associated with the collateral                 | -          |   No     |

### Recipient
| Field                       | Type   | Description                                         | Characters | Required |
|-----------------------------|------- |-----------------------------------------------------|------------|----------|
| `name`                      | string | Recipient name                                      | up to 255  |   Yes    |
| `document_number`           | string | Recipient's CPF / CNPJ                              | 14 or 18   |   Yes    |
| `person_type`               | string | Natural person or legal person enumerator           | up to 255  |   Yes    |
| `natural_person`            | JSON   | **[Natural Person](#natural_person)** object        | -          |   No     |
| `legal_person`              | JSON   | **[Legal Person](#legal_person)** object            | -          |   No     |

### Borrower
| Field                       | Type   | Description                                         | Characters | Required |
|-----------------------------|------- |-----------------------------------------------------|------------|----------|
| `name`                      | string | Borrower name                                       | up to 255  |   Yes    |
| `document_number`           | string | Borrower's CPF / CNPJ                               | 14 or 18   |   Yes    |
| `person_type`               | string | Natural person or legal person enumerator           | up to 255  |   Yes    |
| `natural_person`            | JSON   | **[Natural Person](#natural_person)** object        | -          |   No     |
| `legal_person`              | JSON   | **[Legal Person](#legal_person)** object            | -          |   No     |

### Person Type
| Enumerator               | Description           |
|--------------------------|-----------------------|
| `natural_person`         | Natural person        |
| `legal_person`           | Legal person          |

### Natural Person
| Field                       | Type   | Description                                         | Characters | Required |
|-----------------------------|------- |-----------------------------------------------------|------------|----------|
| `birthdate`                 | string | Birth date                                          | 10         |   Yes    |
| `mother_name`               | string | Mother's name                                       | up to 255  |   Yes    |

### Legal Person
| Field            | Type     | Description                                              | Characters   | Required |
|------------------|----------|----------------------------------------------------------|--------------|----------|
| `activity_code`  | string   | National Classification of Economic Activities (CNAE)    |     10       |   Yes    |         
| `representatives`| array    | List of **[Representative](#representative)** objects    |      -       |   Yes    |

### Representative
| Field                             | Type     | Description                                  | Characters   | Required |
|-----------------------------------|----------|----------------------------------------------|--------------|----------|
| `name`                            | string   | Representative name                          |   up to 255  |   Yes    |
| `document_number`                 | string   | Representative's CPF                         |     14       |   Yes    |

### Asset
| Field                             | Type     | Description                                           | Characters   | Required |
|-----------------------------------|----------|-------------------------------------------------------|--------------|----------|
| `asset_type`                      | string   | Asset type enumerator                                 |   up to 255  |   Yes    |
| `credit_operation`                | JSON     | **[Credit Operation](#credit_operation)** object      |     -        |   No     |

### Asset Type
| Enumerator               | Description |
|--------------------------|-------------|
| `ccb`                    | CCB         |
| `cce`                    | CCE         |

### Credit Operation
| Field                             | Type     | Description                                           | Characters   | Required |
|-----------------------------------|----------|-------------------------------------------------------|--------------|----------|
| `contract_number`                 | string   | Contract number                                       |   up to 255  |   Yes    |
| `principal_value`                 | string   | Principal value of the operation                      |     -        |   Yes    |
| `interest_rate_type`              | string   | Post-fixed / pre-fixed enumerator                     |   up to 255  |   Yes    |
| `pre_fixed`                       | JSON     | **[Pre-fixed](#pre_fixed)** object                    |     -        |   No     |
| `post_fixed`                      | JSON     | **[Post-fixed](#pós_fixed)** object                   |     -        |   No     |

### Interest Rate Type
| Enumerator               | Description           |
|--------------------------|-----------------------|
| `pre_fixed`              | Pre-fixed             |
| `post_fixed`             | Post-fixed            |

### Pre fixed 
| Field                         | Type     | Description                                                      | Characters |
|-------------------------------|----------|------------------------------------------------------------------|------------|
| `calendar_base`               | string   | Working days / 360-day calendar / 365-day calendar enumerator    | up to 255  |
| `monthly_rate`                | float    | Monthly rate                                                     | -          |

### Post fixed 
| Field                         | Type     | Description                                                         | Characters |
|-------------------------------|----------|---------------------------------------------------------------------|------------|
| `calendar_base`               | string   | Working days / 360-day calendar / 365-day calendar enumerator       | up to 255  |
| `indexer`                     | string   | DI / IPCA enumerator                                                | up to 255  |
| `rate`                        | float    | Rate                                                                | -          |
| `lag`                         | JSON     | **[Lag](#lag)** object                                              | -          |

### calendar_base
| Enumerator               | Description           |
|--------------------------|-----------------------|
| `workdays`               | Working days          |
| `calendar_360`           | 360-day calendar      |
| `calendar_365`           | 365-day calendar      |

### Indexer
| Enumerator               | Description           |
|--------------------------|-----------------------|
| `di`                     | DI                    |
| `ipca`                   | IPCA                  |

### Lag
| Field                         | Type     | Description                                       | Characters |
|-------------------------------|----------|---------------------------------------------------|------------|
| `reference`                   | string   | Daily / Monthly enumerator                        | up to 255  |
| `amount`                      | integer  | Lag amount                                        | -          |

### Reference
| Enumerator               | Description           |
|--------------------------|-----------------------|
| `daily`                  | Daily                 |
| `monthly`                | Monthly               |

### Issuance Serie
| Field                             | Type     | Description                                       | Characters   | Required |
|-----------------------------------|----------|---------------------------------------------------|--------------|----------|
| `issuance_serie_key`              | string   | Issuance series key                               |     36       |   Yes    |
| `number_of_quotas`                | float    | Number of quotas to be locked                     |     -        |   No     |
| `financial_value`                 | float    | Financial value to be locked                      |     -        |   No     |

### Responses
```json title='Response Body'
{
    "quota_lock_key": "UUID"
}
```

---

# Quota lock webhook

URL: /en/documentation/iaas/passivo/bloqueio_de_cotas/webhooks_de_bloqueio_de_cota

---

### Introduction
Below are the details about webhooks sent during the **quota lock** process.

Lock approved

```json
{
  "webhook_type": "quota_lock.quota_lock_status_change",
  "webhook_datetime": "2024-12-05T00:00:00Z",
  "data": {
    "status": "approved",
    "quota_lock_key": "UUID"
  }
}
```

Lock denied
    
```json
{
  "webhook_type": "quota_lock.quota_lock_status_change",
  "webhook_datetime": "2024-12-05T00:00:00Z",
  "data": {
    "status": "denied",
    "quota_lock_key": "UUID"
  }
}
```

---

# Consulta paginada de investidores por classe de fundo

URL: /en/documentation/iaas/passivo/consultas/consulta_investidores_classe_fundo

Retorna **investidores que possuem aplicação financeira** vinculada à classe de fundo informada (via séries de emissão e subclasses), de forma paginada. Permite filtrar por documento, nome e **data contábil** do fundo.

## Request

ENDPOINT /quota/fund_class/{fund_class_key}/investors
MÉTODO GET

### Query params

| Parâmetro | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `page` | integer | opcional | Número da página (começa em `0`).|
| `limit` | integer | opcional | Registros por página. Padrão: `20`. Máximo: `500`. |
| `document_number` | string | opcional | Filtra pelo documento do investidor com pontuação. |
| `reference_date` | string (data) | opcional | Restringe a registros em que a **data contábil da classe de fundo** (`accounting_date`) é igual à data informada (formato aceito pelo servidor para parâmetros de data, tipicamente `YYYY-MM-DD`). |

```python title="Exemplo de chamada"
GET /quota/fund_class/{fund_class_key}/investors?page=0&limit=25&reference_date=2024-04-01
```

## Response

STATUS 200

```json title="Response Body"
{
  "data": [
    {
      "distributor": {
        "distributor_key": "3571e292-3a83-4011-904d-20ee963022ef",
        "document_number": "12.345.678/0001-90",
        "name": "Distribuidora Exemplo S.A.",
        "account_data": {
          "owner": {
            "name": "Distribuidora Exemplo S.A.",
            "document_number": "12.345.678/0001-90"
          },
          "account_digit": "1",
          "account_branch": "0001",
          "account_number": "12345",
          "financial_institution_code": "341",
          "financial_institution_ispb": "60746948"
        }
      },
      "investor_key": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "name": "Maria Cotista Silva",
      "person_type": "natural_person",
      "document_number": "123.456.789-00",
      "external_id": "ext-inv-001",
      "external_distribution_key": null
    },
    {
      "distributor": {
        "distributor_key": "3571e292-3a83-4011-904d-20ee963022ef",
        "document_number": "12.345.678/0001-90",
        "name": "Distribuidora Exemplo S.A.",
        "account_data": {
          "owner": {
            "name": "Distribuidora Exemplo S.A.",
            "document_number": "12.345.678/0001-90"
          },
          "account_digit": "1",
          "account_branch": "0001",
          "account_number": "12345",
          "financial_institution_code": "341",
          "financial_institution_ispb": "60746948"
        }
      },
      "investor_key": "c3d4e5f6-a7b8-9012-cdef-123456789012",
      "name": "Investimentos PJ Ltda",
      "person_type": "legal_person",
      "document_number": "98.765.432/0001-10",
      "external_id": null,
      "external_distribution_key": "dist-key-7721"
    }
  ],
  "limit": 20,
  "page": 0,
  "is_last_page": true
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `data` | array | Lista de investidores. |
| `page` | integer | Página atual. |
| `limit` | integer | Tamanho da página. |
| `is_last_page` | boolean | Indica fim da paginação. |

#### Campos de cada investidor em `data`

| Campo | Tipo | Descrição |
|---|---|---|
| `investor_key` | string | Identificador único do investidor (UUID). |
| `name` | string | Nome. |
| `person_type` | string | Tipo de pessoa (enumerador, ex.: `natural_person`, `legal_person`). |
| `document_number` | string | Documento, quando houver. |
| `distributor` | object | Dados da distribuidora (`distributor_key`, `document_number`, `name`, `account_data`). |
| `external_id` | string | Opcional — identificador externo. |
| `external_distribution_key` | string | Opcional — chave de distribuição externa. |

## Possíveis erros

STATUS 404

**Classe de fundo não encontrada**

```json
{
  "title": " Fund Class not Found",
  "description": "Fund Class with key {fund_class_key} was not found.",
  "translation": "A classe com chave {fund_class_key} não foi encontrado.",
  "code": "QTA000002"
}
```

---

# Consulta paginada de posições de cotistas por classe de fundo

URL: /en/documentation/iaas/passivo/consultas/consulta_posicoes_cotistas_classe_fundo

Endpoint de consulta paginada que retorna as **posições por investidor e série de emissão** em uma classe de fundo: cotistas com saldo de cotas na aplicação financeira, com valor de cota obtido do fechamento mais recente da série. Utilize `document_number` para filtrar um cotista específico.

## Request

ENDPOINT /quota/fund_class/{fund_class_key}/investor_positions
MÉTODO GET

### Query params

| Parâmetro | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `page` | integer | opcional | Número da página (começa em `0`). Padrão: `0`. |
| `limit` | integer | opcional | Quantidade de registros por página. Padrão: `20`. Máximo: `100`. |
| `document_number` | string | opcional | Filtra pelo documento do investidor (com pontuação). |

```python title="Exemplo de chamada"
GET /quota/fund_class/{fund_class_key}/investor_positions?page=0&limit=20&document_number=123.456.789-00
```

## Response

STATUS 200

```json title="Response Body"
{
  "data": [
    {
      "investor": {
        "distributor": {
          "distributor_key": "3571e292-3a83-4011-904d-20ee963022ef",
          "document_number": "12.345.678/0001-90",
          "name": "Distribuidora Exemplo S.A.",
          "account_data": {
            "owner": {
              "name": "Distribuidora Exemplo S.A.",
              "document_number": "12.345.678/0001-90"
            },
            "account_digit": "1",
            "account_branch": "0001",
            "account_number": "12345",
            "financial_institution_code": "341",
            "financial_institution_ispb": "60746948"
          }
        },
        "investor_key": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
        "name": "Maria Cotista Silva",
        "person_type": "natural_person",
        "document_number": "123.456.789-00",
        "external_id": "ext-inv-001",
        "external_distribution_key": null
      },
      "issuance_serie": {
        "issuance_serie_key": "c3d4e5f6-a7b8-9012-cdef-123456789012",
        "original_quota_value": 1.0,
        "current_number_of_quotas": 500000.0,
        "current_net_worth": 525000.75,
        "current_principal_value": 500000.0,
        "performance_fee_current_value": 0.0,
        "remuneration_type": "yield_curve",
        "minimum_share_capital": 1000.0,
        "interest_rate_type": "post_fixed",
        "name": "Série Única",
        "serie": 1,
        "sub_class": {
          "name": "Cota Sênior",
          "sub_class_key": "d4e5f6a7-b8c9-0123-def0-234567890123",
          "subordination_level": 1,
          "fund_class": {
            "name": "Fundo Exemplo FIDC",
            "short_name": "FEX",
            "document_number": "12.345.678/0001-90",
            "fund_class_key": "e5f6a7b8-c9d0-1234-ef01-345678901234",
            "accounting_date": "2024-06-01",
            "sub_type": "fidc",
            "tax_classification_id": "long_term",
            "condominum_type_id": "open_ended",
            "investment_category_id": "fidc",
            "prevent_payment": false,
            "integralization_account_key": null,
            "manager": {
              "manager_key": "f6a7b8c9-d0e1-2345-f012-456789012345",
              "document_number": "98.765.432/0001-10",
              "manager_name": "Gestora Exemplo S.A."
            }
          }
        },
        "status": "active",
        "internal_code": "INT-FEX-01",
        "processing_method": "standard",
        "operation_period_configuration": {
          "subscription": {},
          "redemption": {}
        },
        "current_quota_value": 1.0500015,
        "post_fixed": {
          "calendar_base": "calendar_252",
          "indexer": "cdi",
          "rate": 1.0,
          "lag": {
            "reference": "daily",
            "amount": 1
          }
        },
        "isin_code": "BRSTREXTFID6",
        "external_id": null,
        "specific_interest_rate_data": null
      },
      "number_of_quotas": 10000.0,
      "quota_value": 1.05234567
    }
  ],
  "limit": 20,
  "page": 0,
  "is_last_page": true
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `data` | array | Lista de posições. Cada item agrega **investidor**, **série de emissão**, **quantidade de cotas** e **valor de cota** (`quota_value` quando existir fechamento). |
| `page` | integer | Página atual. |
| `limit` | integer | Tamanho da página solicitado. |
| `is_last_page` | boolean | Indica se não há mais registros após esta página. |

#### Objeto em `data`

| Campo | Tipo | Descrição |
|---|---|---|
| `investor` | object | Dados do cotista e da distribuidora . |
| `issuance_serie` | object | Série de emissão da posição, incluindo `sub_class` e `fund_class` aninhados. |
| `number_of_quotas` | number | Soma das cotas da aplicação financeira para aquele investidor e série. |
| `quota_value` | number | Valor de cota do fechamento mais recente da série; omitido se não houver fechamento disponível. |

Campos opcionais ou nulos em `issuance_serie` (como `pre_fixed`, `external_id`, `integralization_account_key`) podem variar conforme o cadastro da série.

Para mais contexto sobre séries, consulte [Consulta paginada de séries de emissão](/documentation/iaas/cotas_de_fundo/consulta_paginada_series_de_emissao).

## Possíveis erros

STATUS 404

**Classe de fundo não encontrada**

```json
{
  "title": " Fund Class not Found",
  "description": "Fund Class with key {fund_class_key} was not found.",
  "translation": "A classe com chave {fund_class_key} não foi encontrado.",
  "code": "QTA000002"
}
```

STATUS 404

**Gestor não encontrado**

```json
{
  "title": "Manager not Found",
  "description": "Manager with Key {manager_key} was not found",
  "translation": "O gestor com chave {manager_key} nao foi encontrado",
  "code": "QTA00053"
}
```

---

# Paginated Query of Quota Evolution Map

URL: /en/documentation/iaas/passivo/consultas/consultar_mapa_de_evolucao_de_cotas

### Request

ENDPOINT /composition/fund_class/FUND-CLASS-KEY/issuance_serie/ISSUANCE-SERIE-KEY/quota_evolution_map
METHOD GET
STATUS 200

### Params

| Parameter            | Type   | Required | Description           |
| -------------------- | ------ | -------- | --------------------- |
| `fund_class_key`     | `UUID` | Yes      | Fund key              |
| `issuance_serie_key` | `UUID` | Yes      | Issuance series key   |

### Query Params

| Parameter        | Type         | Required    | Description                                       |
| ---------------- | ------------ | ----------- | ------------------------------------------------- |
| `reference_date` | `YYYY-MM-DD` | Conditional | Single reference date for query                   |
| `start_date`     | `YYYY-MM-DD` | Conditional | Start date of the interval                        |
| `end_date`       | `YYYY-MM-DD` | Conditional | End date of the interval                          |
| `limit`          | `int`        | No          | Number of records per page (default: 10)         |
| `page`           | `int`        | No          | Current page (default: 0)                         |

:::warning Warning  
It is mandatory to pass one of the date filters, reference_date brings the mec for a specific date, the combination of start_date and end_date will bring the mec in a date range. If neither filter is sent, you will receive an error: CMP000018
:::

Case 01: Return with one date

```json
{
  "data": [
    {
      "gross_net_worth": 10867777.38,
      "net_net_worth": 10867777.38,
      "gross_quota_value": 1.855893979904,
      "net_quota_value": 1.855893979904,
      "number_of_quotas": 5855818.003441199,
      "composition_date": "2025-05-04",
      "applied_value": 0.0,
      "applied_quotas": 0.0,
      "redeemed_value": 0.0,
      "redeemed_quotas": 0.0,
      "amortized_value": 0.0,
      "tax_anticipated_value": 0.0,
      "tax_anticipated_quotas": 0.0,
      "daily_rentability": 0.0006,
      "monthly_rentability": 0.0072,
      "yearly_rentability": 0.0898
    },
  ],
  "is_last_page": true,
  "page": 0,
  "limit": 10
}
```

###   Quota Evolution Map

| Field                    | Type   | Description                                                     |
| ------------------------ | ------ | --------------------------------------------------------------- |
| `gross_net_worth`        | number | Gross net worth on composition day                              |
| `net_net_worth`          | number | Net worth on composition day                                    |
| `gross_quota_value`      | number | Gross quota value                                               |
| `net_quota_value`        | number | Net quota value                                                 |
| `number_of_quotas`       | number | Total number of quotas on the day                               |
| `composition_date`       | string | Composition date (format: `YYYY-MM-DD`)                         |
| `applied_value`          | number | Value applied on the day                                        |
| `applied_quotas`         | number | Number of quotas applied on the day                             |
| `redeemed_value`         | number | Value redeemed on the day                                       |
| `redeemed_quotas`        | number | Number of quotas redeemed on the day                            |
| `amortized_value`        | number | Amortized value on the day                                      |
| `tax_anticipated_value`  | number | Anticipated tax value on the day                                |
| `tax_anticipated_quotas` | number | Number of quotas with anticipated tax on the day               |
| `daily_rentability`      | number | Daily profitability (decimal format, ex: `0.0007` for 0.07%)   |
| `monthly_rentability`    | number | Monthly profitability (decimal format, ex: `0.0060` for 0.60%) |
| `yearly_rentability`     | number | Yearly profitability (decimal format, ex: `0.096` for 9.6%)    |

---

# Paginated Query of Issuance Series

URL: /en/documentation/iaas/passivo/consultas/consultar_todas_series_de_emissao

### Request

ENDPOINT /quota/issuance_series
METHOD GET
STATUS 200

### Query Params

| Parameter                     | Description                                                               |
|-------------------------------|---------------------------------------------------------------------------|
| `issuance_serie_key`          | Unique identification key of the issuance series                         |
| `fund_class_document_number`  | CNPJ of the fund related to the issuance series                          |

:::warning Attention  
During the integration process, a means of authenticating the sent hash will be required.  
:::

Case 01: Return with one issuance series

```json
{
  "data": [
    {
      "name": "Sample Issuance Serie Name",
      "investment_category": "fidc",
      "condominum_type": "open_ended",
      "tax_classification": "long_term",
      "investment_restriction_type": "professional",
      "remuneration_type": "residual",
      "issuance_serie_key": "UUID",
      "minimum_share_capital": 0.0,
      "accounting_date": "YYYY-MM-DD",
      "start_date": "YYYY-MM-DD",
      "original_quota_value": 1.0,
      "serie": 1,
      "maturity_date": "YYYY-MM-DD",
      "sub_class": {
        "name": "Sample Sub Class Name",
        "sub_class_key": "UUID",
        "subordination_level": 0,
        "fund_class": {
          "name": "Sample Fund Name",
          "fund_class_key": "UUID",
          "document_number": "00.000.000/0000-00",
          "administrator": {
            "name": "Sample Administrator Name",
            "administrator_key": "UUID",
            "document_number": "00.000.000/0000-00"
          }
        }
      }
    }
  ],
  "limit": 50,
  "page": 0,
  "is_last_page": true
}
```

### Issuance Serie

| Field                         | Type   | Description                                                               |
|-------------------------------|--------|---------------------------------------------------------------------------|
| `name`                        | string | Name of the issuance series                                               |
| `investment_category`         | string | Investment category (e.g.: fidc)                                          |
| `condominium_type`            | string | Condominium type (`open_ended` or `closed_ended`)                        |
| `tax_classification`          | string | Tax classification (e.g.: `long_term`)                                   |
| `investment_restriction_type` | string | Investment restriction type (e.g.: `professional`)                       |
| `remuneration_type`           | string | Remuneration type (e.g.: `residual`)                                     |
| `issuance_serie_key`          | string | Unique identification key of the series                                   |
| `minimum_share_capital`       | number | Minimum capital of the series                                             |
| `accounting_date`             | string | Accounting date of the series                                             |
| `start_date`                  | string | Start date of the series                                                  |
| `original_quota_value`        | number | Original quota value                                                      |
| `serie`                       | number | Series number                                                             |
| `maturity_date`               | string | Maturity date of the series                                               |
| `sub_class`                   | JSON   | **[Sub Class](#sub-class)** object with subclass information             |

### Sub Class

| Field              | Type   | Description                                                        |
|--------------------|--------|--------------------------------------------------------------------|
| `name`             | string | Name of the subclass                                               |
| `sub_class_key`    | string | Unique key of the subclass                                         |
| `subordination_level` | number | Subordination level                                             |
| `fund_class`       | JSON   | **[Fund Class](#fund-class)** object with fund information        |

### Fund Class

| Field             | Type   | Description                                                                          |
|-------------------|--------|--------------------------------------------------------------------------------------|
| `fund_class_key`  | string | Unique identification key of the fund                                               |
| `document_number` | string | CNPJ of the fund                                                                     |
| `name`            | string | Name of the fund                                                                     |
| `administrator`   | JSON   | **[Administrator](#administrator)** object with administrator information           |

### Administrator

| Field               | Type   | Description                                    |
|---------------------|--------|------------------------------------------------|
| `administrator_key` | string | Unique identification key of the administrator |
| `name`              | string | Name of the administrator                      |
| `document_number`   | string | CNPJ of the administrator                      |

---

# Paginated Query for Funds

URL: /en/documentation/iaas/passivo/consultas/consultar_todos_fundos

---
:::warning Attention
This resource is only available for integrations that exercise the role of **Distributor**.
:::

### Request

ENDPOINT /quota/fund_classes
METHOD GET
STATUS 200

### Query Params

| Parameter                    | Description                                                                          |
|------------------------------|--------------------------------------------------------------------------------------|
| `document_number`            | Fund document                                                                        |
| `fund_class_key`             | Unique fund identification key                                                       |

:::warning Attention
During the integration process, a means of authentication for the sent hash will be required.
:::
Case 01: Return with only one fund

```json
{
    "data": [
      {
         "name":"SAMPLE FUND CLASS NAME",
         "fund_class_key":"UUID",
         "document_number":"00.000.000/0000-00",
         "administrator":{
            "name":"SAMPLE ADMINISTRATOR NAME",
            "administrator_key":"UUID",
            "document_number":"00.000.000/0000-00"
         }
      }
    ],
    "limit": 50,
    "page": 0,
    "is_last_page": true
}
```

### Fund Class

| Field             | Type   | Description                                                                           |
| ----------------- | ------ | ------------------------------------------------------------------------------------- |
| `fund_class_key`  | string | Unique fund identification key                                                        |
| `document_number` | string | Fund CNPJ                                                                             |
| `name`            | string | Fund name                                                                             |
| `administrator`   | JSON   | **[Administrator](#administrator)** object with administrator information             |

### Administrator
| Field               | Type   | Description                                    |
| ------------------- | ------ | ---------------------------------------------- |
| `administrator_key` | string | Unique administrator identification key        |
| `name`              | string | Administrator name                             |
| `document_number`   | string | Administrator CNPJ                             |

---

# Send Signed Subscription Note

URL: /en/documentation/iaas/passivo/controle_de_oferta/enviar_boletim_de_subscricao_assinado

---
### Introduction
This feature aims to send us proof of signature of the **subscription note** from an **investor** to a **quota offering** of a fund.

:::warning Attention
This feature is only available for integrations that exercise the role of **Distributor**.
:::

### Input / Output:
As ***input***, information related to the subscription should be sent, the UUID of the fund's **quota offering** that the investor subscribed to, **signature type** and depending on the signature, the necessary content for validation. See example below.

As ***output***, a ***subscription_note_key*** will be delivered. The ***subscription_note_key*** is used to identify the **subscription note**.

### Request

ENDPOINT /quota_offering_control/investor/INVESTOR_KEY/signed_subscription_note
MÉTODO POST
STATUS 201

### Request body
```json title='Request Body'
{
  "number_of_quotas": 0.0,
  "original_subscription_note_value": 0.0,
  "start_date": "YYYY-MM-DD",
  "maturity_date": "YYYY-MM-DD",
  "quota_offering_key": "UUID",
  "transaction_type": "ted | b3",
  "signature_method": "opt_in",
  "opt_in_hash" : "OPT_IN_HASH"
}
```
:::warning Attention
During the integration process, an authentication method for the sent hash will be required.
:::

### Response
```json title='Response Body'
{
    "subscription_note_key": "UUID"
}
```

---

# Retrieving Information about Subscription Note

URL: /en/documentation/iaas/passivo/controle_de_oferta/informacoes_boletins_de_subscricao

---

### Request

ENDPOINT /quota_offering_control/investor/INVESTOR_KEY/subscription_notes
MÉTODO GET

:::warning Attention
The endpoint above is only available for integrations that play the **Distributor** role.
:::

ENDPOINT /quota_offering_control/fund_class/FUND_CLASS_KEY/subscription_notes
MÉTODO GET

:::warning Attention
The endpoint above is only available for integrations that play the **Manager** role.
:::
   ### Responses

STATUS 200

Case 01: Investor with a Subscription Note

```json
{
   "data":[
      {
         "subscription_note_key":"UUID",
         "quota_offering":{
            "quota_offering_key":"UUID",
            "status":"active / closed",
            "original_quota_offering_value":0.00,
            "issued_number_of_quotas":0.00000000,
            "remaining_quota_offering_value":0.00,
            "start_date":"YYYY-MM-DD",
            "issuance_serie":{
               "name":"1",
               "issuance_serie_key":"UUID",
               "sub_class":{
                  "name":"SÊNIOR",
                  "sub_class_key":"UUID",
                  "subordination_level":1,
                  "fund_class":{
                     "fund_class_key":"UUID",
                     "name":"SAMPLE FUND CLASS NAME",
                     "document_number":"00.000.000/0000-00",
                     "short_name":"SAMPLE FUND CLASS SHORT NAME"
                  }
               },
               "classification":"general / qualified / professional",
               "market_type":"primary / secondary"
            },
            "type":"public / private",
            "data":{
               "type":"public / private",
               "cvm_registration":{
                  "date":"YYYY-MM-DD",
                  "number":"AAA/BBB/CCC/DDD/EEE/YYYY/000"
               },
               "lead_coordinator":{
                  "name":"SAMPLE LEAD COORDINATOR NAME",
                  "address":{
                     "uf":"SP",
                     "city":"São Paulo",
                     "number":"0000",
                     "street":"Sample street name",
                     "complement":"Sample complement"
                  },
                  "document_number":"00.000.000/0000-00"
               },
               "original_quota_offering_value":0.00
            }
         },
         "investor":{
            "distributor":{
               "distributor_key":"UUID",
               "document_number":"00.000.000/0000-00",
               "name":"Sample Distributor Name"
            },
            "investor_key":"UUID",
            "document_number":"00.000.000/0000-00",
            "name":"SAMPLE INVESTOR NAME",
            "person_type":"natural_person / legal_person"
         },
         "status":"send_to_generate_document / pending_document / pending_signature / canceled / active / sold_off",
         "transaction_type":"b3 / ted",
         "original_subscription_note_value":0.00,
         "issued_number_of_quotas":0.00000000,
         "remaining_subscription_note_value":0.00,
         "start_date":"YYYY-MM-DD",
         "financial_application_events":[
            {
               "financial_application_event_key":"UUID",
               "financial_application_key":"UUID",
               "type":"consume_value",
               "share_capital":0.00,
               "event_datetime":"YYYY-MM-DD HH:MM:SS"
            },
            {
               "financial_application_event_key":"UUID",
               "financial_application_key":"UUID",
               "type":"update_quotas",
               "number_of_quotas":0.00,
               "event_datetime":"YYYY-MM-DD HH:MM:SS"
            },
                        {
               "financial_application_event_key":"UUID",
               "financial_application_key":"UUID",
               "type":"cancel",
               "event_datetime":"YYYY-MM-DD HH:MM:SS"
            }
         ]
      }
   ],
   "limit":50,
   "page":0,
   "is_last_page":true
}
```

Case 02: Investor without Subscription Note
```json
{
   "data":[],
   "limit":50,
   "page":0,
   "is_last_page":true
}
```

### Response Fields

| Field         | Type   | Description                                                    |
|---------------|--------|----------------------------------------------------------------|
| `data`        | array  | List of **[Subscription Note](#subscription-note)** objects   |
| `limit`       | int    | Limit of objects retrieved per page                            |
| `page`        | int    | Number of the retrieved page                                   |
| `is_last_page`| boolean| Information indicating if the retrieved page is the last one  |

### Note

TYPE * means that the field can be null,
as in the example below:
| Type     |
|----------|
| string * |

### Subscription Note
| Field                     | Type     | Description                                                                                         |
|---------------------------|----------|-----------------------------------------------------------------------------------------------------|
| `subscription_note_key`   | string   | Unique subscription note identification key                                                         |        
| `quota_offering`          | JSON     | **[Quota Offering](#quota-offering)** object                                                       |
| `investor`                | JSON     | **[Investor](#investor)** object                                                                   |
| `status`                  | string   | Send to generate document / Pending document / Pending signature / Canceled / Active / Sold out   |
| `transaction_type`        | string   | B3 / TED                                                                                            |
| `original_subscription_note_value`   | float    | Original subscription note value                                                         |       
| `issued_number_of_quotas` | float    | Number of issued quotas                                                                             |   
| `remaining_subscription_note_value`  | float    | Remaining subscription note value                                                         |   
| `start_date`              | string   | Subscription note start date                                                                        |
| `financial_application_events`| array    | List of **[Financial Application Event](#financial-application-event)** objects            |
| `maturity_date`            | string* | Maturity date                                                                                      |       
| `original_number_of_quotas`| string* | Number of issued quotas                                                                            |

### Quota Offering
| Field                             | Type     | Description                                                                             |
|-----------------------------------|----------|-----------------------------------------------------------------------------------------|
| `quota_offering_key`              | string   | Unique offering identification key                                                      |
| `status`                          | string   | Active / Closed                                                                         |
| `original_quota_offering_value`   | float    | Original offering value                                                                 |
| `issued_number_of_quotas`         | float    | Number of subscribed quotas                                                             |
| `remaining_quota_offering_value`  | float    | Remaining offering value                                                                |       
| `start_date`                      | string   | Offering start date                                                                     |
| `issuance_serie`                  | string   | **[Issuance Serie](#issuance-serie)** object                        |
| `type`                            | string   | Public/private offering type                                                            |
| `cvm_registration`                | JSON    *| CVM registration data                                                                   |
| `lead_coordinator`                | JSON    *| Lead coordinator data                                                                   |
| `maturity_date`                   | string  *| Maturity date                                                                           |       
| `original_number_of_quotas`       | string  *| Number of issued quotas                                                                 |

cvm_registration
```json
{
   "date":"YYYY-MM-DD",
   "number":"AAA/BBB/CCC/DDD/EEE/YYYY/000"
}
```
lead_coordinator
```json
{
   "name":"SAMPLE LEAD COORDINATOR NAME",
   "address":{
      "uf":"SP",
      "city":"São Paulo",
      "number":"0000",
      "street":"Sample street name",
      "complement":"Sample complement"
   },
   "document_number":"00.000.000/0000-00"
}
```

### Financial Application Event
| Field                             | Type     | Description                                                                             |
|-----------------------------------|----------|-----------------------------------------------------------------------------------------|
| `financial_application_key`       | string   | Unique financial application identification key                                         |
| `financial_application_event_key` | string   | Unique financial application event identification key                                   |
| `type`                            | string   | Consume value / Update quotas / Cancel                                                  |
| `event_datetime`                  | string   | Event date and time                                                                     |
| `share_capital`                   | float   *| Financial application investment value *ONLY APPEARS WHEN 'consume_value'              |
| `number_of_quotas`                | float   *| Financial application number of quotas *ONLY APPEARS WHEN 'update_quotas'              |       

### Issuance Serie
| Field                         | Type     | Description                                       |
|-------------------------------|----------|---------------------------------------------------|
| `name`                        | string   | Issuance serie name                               |
| `issuance_serie_key`          | string   | Unique issuance serie identification key          |
| `sub_class`                   | JSON     | **[Sub Class](#sub-class)** object               |
| `classification`              | string   | Professional / Qualified / General                |
| `market_type`                 | string   | Primary / Secondary                               |
| `serie`                       | integer  | Return curve / Residual                           |

### Sub Class 
| Field                         | Type     | Description                                       |
|-------------------------------|----------|---------------------------------------------------|
| `name`                        | string   | Sub class name                                    |
| `sub_class_key`               | string   | Unique sub class identification key               |
| `subordination_level`         | int      | Sub class subordination level                     |             
| `fund_class`                  | JSON     | **[Fund Class](#fund-class)** object             |

### Fund Class 
| Field                         | Type     | Description                                       |
|-------------------------------|----------|---------------------------------------------------|
| `name`                        | string   | Fund class name                                   |
| `fund_class_key`              | string   | Unique fund class identification key              |
| `document_number`             | string   | Fund class CNPJ                                   | 
| `short_name`                  | string   | Fund class short name                             |

### Investor
| Field                    | Type     | Description                                       |
|--------------------------|----------|---------------------------------------------------|
| `name`                   | string   | Investor name                                     |
| `investor_key`           | string   | Unique investor identification key                |
| `document_number`        | string   | Investor CPF/CNPJ                                 |
| `person_type`            | string   | Natural Person / Legal Person / Fund Class       |
| `distributor`            | JSON     | **[Distributor](#distributor)** object           |             

### Distributor
| Field                    | Type     | Description                                       |
|--------------------------|----------|---------------------------------------------------|
| `name`                   | string   | Distributor name                                  |
| `distributor_key`        | string   | Unique distributor identification key             |             
| `document_number`        | string   | Distributor CPF/CNPJ                              |

---

# Retrieving Information about Offerings

URL: /en/documentation/iaas/passivo/controle_de_oferta/informacoes_das_ofertas

---

### Request

ENDPOINT /quota_offering_control/fund_class/FUND_CLASS_KEY/quota_offerings
METHOD GET

:::warning Warning
This resource is only available for integrations that exercise the role of **Manager**.
:::

   ### Responses

STATUS 200

   ### Query Params

| Parameter                    | Description                                                                          |
|------------------------------|--------------------------------------------------------------------------------------|
| `sub_class_key`              | Unique identification key of the sub class                                          |
| `issuance_serie_key`         | Unique identification key of the issuance series                                    |

Case 01: Fund with one Offering

```json
{
   "data":[{
      "quota_offering":{
         "quota_offering_key":"UUID",
         "status":"active / closed",
         "original_quota_offering_value":0.00,
         "issued_number_of_quotas":0.00000000,
         "remaining_quota_offering_value":0.00,
         "start_date":"YYYY-MM-DD",
         "issuance_serie":{
            "name":"1",
            "issuance_serie_key":"UUID",
            "sub_class":{
               "name":"SÊNIOR",
               "sub_class_key":"UUID",
               "subordination_level":1,
               "fund_class":{
                  "fund_class_key":"UUID",
                  "name":"SAMPLE FUND CLASS NAME",
                  "document_number":"00.000.000/0000-00",
                  "short_name":"SAMPLE FUND CLASS SHORT NAME"
               }
            },
            "classification":"general / qualified / professional",
            "market_type":"primary / secondary"
         },
         "type":"public / private",
         "data":{
            "type":"public / private",
            "cvm_registration":{
               "date":"YYYY-MM-DD",
               "number":"AAA/BBB/CCC/DDD/EEE/YYYY/000"
            },
            "lead_coordinator":{
               "name":"SAMPLE LEAD COORDINATOR NAME",
               "address":{
                  "uf":"SP",
                  "city":"São Paulo",
                  "number":"0000",
                  "street":"Sample street name",
                  "complement":"Sample complement"
               },
               "document_number":"00.000.000/0000-00"
            },
            "original_quota_offering_value":0.00
         }
      }
   }
   ],
   "limit":50,
   "page":0,
   "is_last_page":true
}
```

Case 02: Fund without an Offering
```json
{
   "data":[],
   "limit":50,
   "page":0,
   "is_last_page":true
}
```

### Response Fields

| Field         | Type   | Description                                                    |
|---------------|--------|----------------------------------------------------------------|
| `data`        | array  | List of **[Quota Offering](#quota-offering)** objects         |
| `limit`       | int    | Limit of objects retrieved per page                            |
| `page`        | int    | Number of the retrieved page                                   |
| `is_last_page`| boolean| Information indicating whether the retrieved page is the last |

### Note

TYPE * means that the field can be null,
as in the example below:
| Type     |
|----------|
| string * |

### Quota Offering
| Field                             | Type     | Description                                                                             |
|-----------------------------------|----------|-----------------------------------------------------------------------------------------|
| `quota_offering_key`              | string   | Unique identification key of the offering                                               |
| `status`                          | string   | Active / Closed                                                                         |
| `original_quota_offering_value`   | float    | Original value of the offering                                                          |
| `issued_number_of_quotas`         | float    | Number of subscribed quotas                                                             |
| `remaining_quota_offering_value`  | float    | Remaining value of the offering                                                         |       
| `start_date`                      | string   | Start date of the offering                                                              |
| `issuance_serie`                  | string   | **[Issuance Serie](#issuance-serie)** object                                           |
| `type`                            | string   | Type of offering public/private                                                         |
| `cvm_registration`                | JSON    *| CVM registration data                                                                   |
| `lead_coordinator`                | JSON    *| Lead coordinator data                                                                   |
| `maturity_date`                   | string  *| Maturity date                                                                           |       
| `original_number_of_quotas`       | string  *| Number of issued quotas                                                                 |

cvm_registration
```json
{
   "date":"YYYY-MM-DD",
   "number":"AAA/BBB/CCC/DDD/EEE/YYYY/000"
}
```
lead_coordinator
```json
{
   "name":"SAMPLE LEAD COORDINATOR NAME",
   "address":{
      "uf":"SP",
      "city":"São Paulo",
      "number":"0000",
      "street":"Sample street name",
      "complement":"Sample complement"
   },
   "document_number":"00.000.000/0000-00"
}
```

### Issuance Serie
| Field                         | Type     | Description                                       |
|-------------------------------|----------|---------------------------------------------------|
| `name`                        | string   | Name of the issuance series                       |
| `issuance_serie_key`          | string   | Unique identification key of the issuance series  |
| `sub_class`                   | JSON     | **[Sub Class](#sub-class)** object                |
| `classification`              | string   | Professional / Qualified / General                |
| `market_type`                 | string   | Primary / Secondary                               |
| `serie`                       | integer  | Yield curve / Residual                            |

### Sub Class 
| Field                         | Type     | Description                                       |
|-------------------------------|----------|---------------------------------------------------|
| `name`                        | string   | Name of the sub class                             |
| `sub_class_key`               | string   | Unique identification key of the sub class        |
| `subordination_level`         | int      | Subordination level of the sub class              |             
| `fund_class`                  | JSON     | **[Fund Class](#fund-class)** object              |

### Fund Class 
| Field                         | Type     | Description                                       |
|-------------------------------|----------|---------------------------------------------------|
| `name`                        | string   | Name of the fund class                            |
| `fund_class_key`              | string   | Unique identification key of the fund class       |
| `document_number`             | string   | CNPJ of the fund class                            | 
| `short_name`                  | string   | Short name of the fund class                      |

---

# Request Subscription Note

URL: /en/documentation/iaas/passivo/controle_de_oferta/solicitar_boletim_de_subscricao

---
### Introduction
This feature aims to create a **subscription note** request from an **investor** to a **quota offering** of a fund. From this request, the subscription note document is generated according to the generation type configured on the offering.

### Input / Output:
As ***input***, the UUID of the **quota offering** the investor is subscribing to, the **subscription note value**, the **transaction type** and, optionally, the signature method and the signer group should be sent. See example below.

As ***output***, the complete object of the created **subscription note** will be delivered, including the ***subscription_note_key***. The ***subscription_note_key*** is used to identify the **subscription note**.

### Request

ENDPOINT /quota_offering_control/investor/INVESTOR_KEY/subscription_note
METHOD POST
STATUS 201

### Path Params

| Parameter         | Description             |
|-------------------|-------------------------|
| `INVESTOR_KEY`    | UUID of the investor    |

### Request body
```json title='Request Body'
{
  "original_subscription_note_value": 50000.00,
  "quota_offering_key": "UUID",
  "transaction_type": "ted",
  "signature_method": "certifiqi",
  "signer_group_key": "UUID"
}
```

### Subscription Note
| Field                              | Type   | Description                                                                                                                                      | Required |
|------------------------------------|--------|----------------------------------------------------------------------------------------------------------------------------------------------------|----------|
| `original_subscription_note_value` | number | Subscription note value. Minimum 0. Cannot exceed the remaining value of the offering                                                               |    Yes   |
| `quota_offering_key`               | string | UUID (36 characters) of the quota offering. The offering must exist and have `active` status                                                        |    Yes   |
| `transaction_type`                 | string | `ted` or `b3`. For `b3`, the fund class must have a registered B3 account                                                                           |    Yes   |
| `signature_method`                 | string | Signature method enumerator. If omitted, the service defines it by person type: `natural_person` → `qi_sign`, `legal_person` → `certifiqi`          |    No    |
| `signer_group_key`                 | string | UUID (36 characters) of the signer group. If omitted, the investor's default signer group is used                                                   |    No    |

### Signature Method

| Enumerator    | Description                                                  |
|---------------|--------------------------------------------------------------|
| `certifiqi`   | Signature via CertifiQi (Digital Certificate)                |
| `qi_sign`     | Signature via QI Sign (Electronic Signature)                 |

### Response
```json title='Response Body'
{
  "subscription_note_key": "UUID",
  "status": "created",
  "original_number_of_quotas": 500,
  "original_subscription_note_value": 50000.00,
  "issued_number_of_quotas": 0,
  "remaining_subscription_note_value": 50000.00,
  "start_date": "YYYY-MM-DD",
  "transaction_type": "ted",
  "signature_method": "certifiqi",
  "investor": {
    "distributor": {
      "distributor_key": "UUID",
      "document_number": "00.000.000/0000-00",
      "name": "SAMPLE DISTRIBUTOR NAME"
    },
    "investor_key": "UUID",
    "name": "SAMPLE INVESTOR NAME",
    "person_type": "natural_person / legal_person",
    "document_number": "00.000.000/0000-00"
  },
  "quota_offering": {
    "quota_offering_key": "UUID",
    "status": "active",
    "original_quota_offering_value": 10000000.00,
    "issued_number_of_quotas": 25000.00,
    "remaining_quota_offering_value": 7500000.00,
    "start_date": "YYYY-MM-DD",
    "issuance_serie": {
      "name": "1",
      "issuance_serie_key": "UUID",
      "external_id": "SERIE-001",
      "sub_class": {
        "name": "SENIOR",
        "sub_class_key": "UUID",
        "subordination_level": 1,
        "fund_class": {
          "fund_class_key": "UUID",
          "document_number": "00.000.000/0000-00",
          "name": "SAMPLE FUND CLASS NAME",
          "short_name": "SAMPLE FUND CLASS SHORT NAME",
          "manager": {
            "name": "SAMPLE MANAGER NAME",
            "manager_key": "UUID",
            "document_number": "00.000.000/0000-00"
          },
          "administrator": {
            "name": "SAMPLE ADMINISTRATOR NAME",
            "administrator_key": "UUID",
            "document_number": "00.000.000/0000-00",
            "data": {}
          },
          "b3_account": "123456"
        }
      },
      "classification": "general / qualified / professional",
      "market_type": "primary / secondary",
      "serie": 1,
      "issuance_serie_configuration": {}
    },
    "type": "public / private",
    "subscription_note_template_key": "UUID",
    "subscription_note_generation_type": "internal / external",
    "regulatory_type": "exclusive_fund",
    "maturity_date": "YYYY-MM-DD",
    "status_events": [
      {
        "status": "created",
        "event_datetime": "YYYY-MM-DD HH:MM:SS"
      },
      {
        "status": "active",
        "event_datetime": "YYYY-MM-DD HH:MM:SS"
      }
    ]
  },
  "financial_application_events": [],
  "status_events": [
    {
      "status": "created",
      "event_datetime": "YYYY-MM-DD HH:MM:SS",
      "selected_agent": "distributor"
    }
  ]
}
```

The detailed description of the **[Quota Offering](/documentation/iaas/passivo/controle_de_oferta/informacoes_boletins_de_subscricao#quota-offering)**, **[Investor](/documentation/iaas/passivo/controle_de_oferta/informacoes_boletins_de_subscricao#investor)** and **[Financial Application Event](/documentation/iaas/passivo/controle_de_oferta/informacoes_boletins_de_subscricao#financial-application-event)** objects can be found on the **[Subscription Note Information](/documentation/iaas/passivo/controle_de_oferta/informacoes_boletins_de_subscricao)** page.

---

# Retrieving Public Quotas

URL: /en/documentation/iaas/passivo/fundos/cotas_publicas

---

### Request

ENDPOINT /public_dash/mark_to_market/fund_quota/mark_to_markets
METHOD GET
STATUS 200

### Query Params

| Parameter                   |  Type    | Description                                                                           |
|-----------------------------|----------|---------------------------------------------------------------------------------------|
| `internal_codes`            |  list    | List of internal codes of the issuance series for exact record filtering.            |
| `from_reference_date`       |  string  | Start date of the period to be queried (YYYY-MM-DD)                                  |
| `to_reference_date`         |  string  | End date of the period to be queried (YYYY-MM-DD)                                    |
| `internal_code`             |  string  | Unique code of the issuance series to be queried                                     |
| `fund_class_document_number`|  string  | CNPJ (with punctuation) of the fund to be queried                                    |
| `limit`                     |  int     | Limit of objects retrieved per page                                                   |
| `page`                      |  int     | Page number retrieved                                                                 |

:::warning Warning
The quota value is found at the **issuance series (issuance_serie)** level and therefore the use of the **fund_class_document_number** parameter implies the return of all series.
It is recommended to use this filter only for mapping unique identifiers of the issuance series (**internal_code** and **issuance_serie_key**).
:::

### Response
```json title='Response Body'
{
   "data": [
      {
         "issuance_serie_key": "1de4125b-48c7-40ca-b97b-0b65fb356468",
         "internal_code": "INTERNAL-CODE-2",
         "fund_class_document_number": "12.345.678/0001-95",
         "fund_class_name": "FUNDO DE INVESTIMENTO DE TESTES",
         "marks_to_market": [
            {
               "reference_date": "2025-09-05",
               "before_amortization_unit_price": 1000,
               "unit_price": 1000
            }
         ]
      },
      {
         "issuance_serie_key": "71f7ee44-388d-4916-b068-647e82fd67c8",
         "internal_code": "INTERNAL-CODE-1",
         "fund_class_document_number": "12.345.678/0001-95",
         "fund_class_name": "FUNDO DE INVESTIMENTO DE TESTES",
         "marks_to_market": [
            {
               "reference_date": "2025-09-04",
               "before_amortization_unit_price": 1000,
               "unit_price": 1000
            }
         ]
      }
   ],
   "limit": 5,
   "page": 0,
   "is_last_page": true
}
```

### Issuance Serie

| Field                             | Type   | Description                                                  |
|-----------------------------------|--------|--------------------------------------------------------------|
| `issuance_serie_key`              | string | Key that identifies the issuance series                     |
| `internal_code`                   | string | Code that identifies the issuance series internally         |
| `fund_class_document_number`      | string | CNPJ of the investment fund queried                         |
| `fund_class_name`                 | string | Name of the investment fund queried                         |
| `marks_to_market`                 | array  | List of **[Marks To Market](#marks-to-market)** objects                                    |

### Marks To Market

| Field                             | Type   | Description                                                  |
|-----------------------------------|--------|--------------------------------------------------------------|
| `reference_date`                  | string | Date of the issuance series quota value (YYYY-MM-DD)        |
| `before_amortization_unit_price`  | float  | The issuance series quota value before amortization         |
| `unit_price`                      | float  | The issuance series quota value after closing               |

---

# Introduction

URL: /en/documentation/iaas/passivo/inicio

Welcome to the integration documentation for **Liability**-related operations. In this section, we present all the necessary tools and resources to interact with the offered services, from investor registration to the execution of financial operations.

## Overview

The Liability API offers a set of functionalities to facilitate the management and execution of financial operations for investment funds. With it, it is possible to perform investor registration, financial applications, redemption requests, share blocking, and other essential operations for asset management.

The services are made available through endpoints that allow secure and efficient communication between client applications and the platform.

### Service Access

To obtain access to the services, it is necessary to perform the necessary clearances in our Staging (Sandbox) and Production environments. Contact the integration team at [integracao.dtvm@qitech.com.br](mailto:integracao.dtvm@qitech.com.br) to request access credentials and receive guidance on the activation process.

## Available Resources

### Investor Registration

- **Create investor / investor analysis**: Allows investor registration and initial registration analysis. Described in: [5.9.2.1 Create investor](/documentation/iaas/investidor/cadastro/criar_investidor)
- **Fetch investor information**: Queries registration information of an investor. Described in: [5.9.2.2 Fetch investor information](/documentation/iaas/investidor/cadastro/busca_informacoes_do_investidor)
- **Fetch investor registration analysis information**: Allows querying the registration analysis status of an investor. Described in: [5.9.2.3 Fetch registration analysis](/documentation/iaas/investidor/cadastro/busca_informacoes_de_uma_analise_cadastral_do_investidor)
- **Send registration data**: Sends complementary registration data for analysis. Described in: [5.9.2.4 Send registration data](/documentation/iaas/investidor/cadastro/enviar_dados_cadastrais)

### Financial Application

- **Create Financial Application**: Allows creating a financial application in an issuance series. Described in: [5.9.5.1 Create Financial Application](/documentation/iaas/passivo/aplicacao_financeira/criar_aplicacao_financeira)
- **Query Financial Application**: Allows querying financial applications by key or through paginated search. Described in: [5.9.5.2 Query by key](/documentation/iaas/passivo/aplicacao_financeira/buscar_aplicacao_financeira_por_chave) and [5.9.5.3 Paginated query](/documentation/iaas/passivo/aplicacao_financeira/busca_paginada_aplicacoes_financeiras)

### Redemption Request

- **Create Redemption Request**: Allows creating a redemption request for an investor. Described in: [5.9.6.1 Create Redemption Request](/documentation/iaas/passivo/pedido_de_resgate/criar_pedido_de_resgate)
- **Query Redemption Request**: Queries redemption requests by key or through paginated search. Described in: [5.9.6.2 Query by key](/documentation/iaas/passivo/pedido_de_resgate/buscar_pedido_de_resgate_por_chave), [5.9.6.3 Paginated query by investor](/documentation/iaas/passivo/pedido_de_resgate/consulta_pedidos_resgate_investidor) and [5.9.6.4 Paginated query by fund class](/documentation/iaas/passivo/pedido_de_resgate/consulta_pedidos_resgate_classe_fundo)

### Share Blocking

- **Request Share Blocking**: Allows requesting share blocking for guarantee. Described in: [5.9.8.1 Request Share Blocking](/documentation/iaas/passivo/bloqueio_de_cotas/solicitar_bloqueio_de_cotas)
- **Query Share Blockings**: Queries share blockings by investor or in a paginated manner. Described in: [5.9.8.2 Query share blockings](/documentation/iaas/passivo/bloqueio_de_cotas/consulta_de_bloqueio_de_cotas)

## Conclusion

This documentation serves as a complete guide for integration and utilization of Liability services. In case of questions, contact our support team at [integracao.dtvm@qitech.com.br](mailto:integracao.dtvm@qitech.com.br).

---

# Query Redemption Request by Key

URL: /en/documentation/iaas/passivo/pedido_de_resgate/buscar_pedido_de_resgate_por_chave

---

### Request

ENDPOINT /quota/investor/INVESTOR_KEY/redemption_request/REDEMPTION_REQUEST_KEY
METHOD GET
STATUS 200

### Responses

Case 01: Successful query

```json
{
    "redemption_request_key": "UUID",
    "redemption_request_type": "gross_redemption_value" | "number_of_quotas" | "remaining_application_value",
    "status": "pending_quote" | "processing_quote" | "canceled" | "quoted",
    "quotation_date": "yyyy-mm-dd",
    "payment_date":"yyyy-mm-dd",
    "request_datetime":"yyyy-mm-dd HH:MM:SS:MS",
    "processed_value": 0.00,
    "investor_position": {
        "investor": {
            "investor_key": "UUID",
            "document_number": "999.999.999-99" | "99.999.999/9999-99",
            "name": "",
            "person_type": "natural_person" | "legal_person",
            "account_data": {
                "owner": {
                    "name": "",
                    "document_number": "99.999.999/9999-99"
                },
                "account_digit": "0",
                "account_branch": "0000",
                "account_number": "00000",
                "financial_institution_code": "000",
                "financial_institution_ispb": "00000000"
            },
            "distributor": {
                "distributor_key": "UUID",
                "document_number": "99.999.999/9999-99",
                "name": "",
                "account_data": {
                    "owner": {
                        "name": "",
                        "document_number": "99.999.999/9999-99"
                    },
                    "account_digit": "0",
                    "account_branch": "0000",
                    "account_number": "00000",
                    "financial_institution_code": "000",
                    "financial_institution_ispb": "00000000"
                },
            }
        },
        "total_net_worth": 0.00,
        "total_number_of_quotas": 0.00000000,
        "investor_position_key":"UUID",
        "issuance_serie":{
            "name":"1",
            "cetip_code":"0000000SN1",
            "start_date":"YYYY-MM-DD",
            "maturity_date":"YYYY-MM-DD",
            "original_quota_value":0.00000000000000,
            "remuneration_type":"yield_curve",
            "interest_rate_type":"post_fixed",
            "pre_fixed":{
               "calendar_base":"workdays / calendar_360 / calendar_365",
               "monthly_rate":0.00000000000000
            },
            "post_fixed":{
               "calendar_base":"workdays / calendar_360 / calendar_365",
               "indexer":"di / ipca",
               "rate":1,
               "lag":{
                  "reference":"daily / monthly",
                  "amount":1
               }
            },
            "investment_category":"fidc / multi_market",
            "condominum_type":"open_ended / close_ended",
            "tax_classification":"short_term / long_term",
            "investment_restriction_type":"just_professional",
            "issuance_serie_key":"UUID",
            "minimum_share_capital":0.0,
            "accounting_date":"YYYY-MM-DD",
            "sub_class":{
               "name":"COTA SÊNIOR",
               "sub_class_key":"UUID",
               "subordination_level":1,
               "fund_class":{
                  "name":"SAMPLE FUND CLASS NAME",
                  "fund_class_key":"UUID",
                  "document_number":"00.000.000/0000-00"
               }
            }
        }
    },
    "status_events": [
        {
            "event_datetime": "yyyy-mm-dd HH:MM:SS:ms",
            "status": "pending_quote" | "processing_quote" | "canceled" | "quoted",
        }
    ],
}
```

### Redemption Request
| Field                         | Type     | Description                                                                     | Characters |
|-------------------------------|----------|---------------------------------------------------------------------------------|------------|
| `redemption_request_key`      | string   | Unique identifier key for the redemption request                                | 36         |
| `redemption_request_type`     | string   | **[Redemption Request Type](#redemption_request_type)** enumerator              | -          |             
| `status`                      | string   | **[Redemption Request Status](#redemption_request_status)** enumerator          | -          |
| `quotation_date`              | string   | Quotation date                                                                  | -          |
| `payment_date`                | string   | Payment date                                                                    | -          |
| `request_datetime`            | string   | Redemption request creation date                                                | -          |
| `processed_value`             | float    | Processed redemption value                                                      | -          |
| `investor_position`           | JSON     | **[Investor Position](#investor_position)** object                              | -          |
| `status_events`               | array    | List of **[Status Event](#status_event)** objects                              | -          |

### Redemption Request Type
| Enumerator                    | Description                                     |
|-------------------------------|-------------------------------------------------|
| `gross_redemption_value`      | Redemption by gross value                       |
| `number_of_quotas`            | Redemption by number of quotas                  |
| `remaining_application_value` | Redemption by remaining value                   |

### Redemption Request Status
| Enumerator               | Description                                     |
|--------------------------|-------------------------------------------------|
| `pending_quote`          | Pending payment                                 |
| `processing_quote`       | Pending quotation                               |
| `quoted`                 | Quoted                                          |
| `canceled`               | Fully amortized                                 |

### Investor Position
| Field                    | Type   | Description                                           |
|--------------------------|--------|-------------------------------------------------------|
| `investor`               | JSON   | **[Investor](#investor)** object                      |
| `total_net_worth`        | float  | Net worth of the investor position                    |
| `total_number_of_quotas` | float  | Number of quotas in the investor position             |
| `issuance_serie`         | JSON   | **[Issuance Serie](#issuance_serie)** object         |
| `investor_position_key`  | JSON   | Unique identifier key for the investor position       |

### Investor
| Field                    | Type     | Description                                       | Characters |
|--------------------------|----------|---------------------------------------------------|------------|
| `name`                   | string   | Investor name                                     | up to 255  |
| `investor_key`           | string   | Unique identifier key for the investor            | 36         |
| `document_number`        | string   | Investor CPF/CNPJ                                 | 14 or 18   |
| `person_type`            | string   | Individual / Legal Entity / Fund Class            | up to 50   |
| `distributor`            | JSON     | **[Distributor](#distributor)** object            |     -      |             
| `account_data`           | JSON     | **[Account Data](#account_data)** object          |     -      |

### Distributor
| Field                    | Type     | Description                                       | Characters |
|--------------------------|----------|---------------------------------------------------|------------|
| `name`                   | string   | Distributor name                                  | up to 255  |
| `distributor_key`        | string   | Unique identifier key for the distributor        |     -      |             
| `document_number`        | string   | Distributor CPF/CNPJ                              | 14 or 18   |
| `account_data`           | JSON     | **[Account Data](#account_data)** object          |     -      |

### Account Data
| Field                        | Type     | Description                                                                     |
|------------------------------|----------|---------------------------------------------------------------------------------|
| `account_digit`              | string   | Bank account digit                                                              |
| `account_branch`             | string   | Bank account branch number                                                      |             
| `account_number`             | string   | Bank account number                                                             |
| `financial_institution_code` | string   | Financial institution code                                                      |
| `financial_institution_ispb` | string   | Brazilian Payment System identifier for the financial institution               |

### Issuance Serie
| Field                         | Type     | Description                                       | Characters |
|-------------------------------|----------|---------------------------------------------------|------------|
| `name`                        | string   | Issuance serie name                               | up to 255  |
| `issuance_serie_key`          | string   | Unique identifier key for the issuance serie     | 36         |
| `cetip_code`                  | string   | Issuance serie code as CETIP asset                | 10         |             
| `start_date`                  | string   | Issuance serie start date                         | 10         |
| `maturity_date`               | string   | Issuance serie maturity date                      | 10         |
| `original_quota_value`        | float    | Original quota value                              | -          |
| `remuneration_type`           | string   | Yield curve / Residual                            | up to 50   |
| `investment_category`         | string   | FIDC / Multi-market                               | up to 50   |
| `condominum_type`             | string   | Open / Closed                                     | up to 50   |
| `tax_classification`          | string   | Short term / Long term                            | up to 50   |
| `investment_restriction_type` | string   | No restriction / Qualified / Professional         | up to 50   |
| `minimum_share_capital`       | float    | Minimum value for investment                      | -          |
| `accounting_date`             | string   | Issuance serie accounting date                    | 10         |
| `sub_class`                   | JSON     | **[Sub Class](#sub_class)** object                | -          |

### Sub Class 
| Field                         | Type     | Description                                       | Characters |
|-------------------------------|----------|---------------------------------------------------|------------|
| `name`                        | string   | Sub class name                                    | up to 255  |
| `sub_class_key`               | string   | Unique identifier key for the sub class          | 36         |
| `subordination_level`         | int      | Sub class subordination level                     | -          |             
| `fund_class`                  | JSON     | **[Fund Class](#fund_class)** object             | -          |

### Fund Class 
| Field                         | Type     | Description                                       | Characters |
|-------------------------------|----------|---------------------------------------------------|------------|
| `name`                        | string   | Fund class name                                   | up to 255  |
| `fund_class_key`              | string   | Unique identifier key for the fund class         | 36         |
| `document_number`             | string   | Fund class CNPJ                                   | -          |

---

# Consulta paginada de pedidos de resgate por classe de fundo

URL: /en/documentation/iaas/passivo/pedido_de_resgate/consulta_pedidos_resgate_classe_fundo

Lista **pedidos de resgate** vinculados a uma **classe de fundo** (`fund_class_key`), com paginação. Permite filtrar por **status**, **data de cotização** e **documento do investidor**.

## Request

ENDPOINT /quota/fund_class/{fund_class_key}/redemption_requests
MÉTODO GET

### Query params

| Parâmetro | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `page` | integer | opcional | Número da página (começa em `0`). Padrão: `0`. |
| `limit` | integer | opcional | Registros por página. Padrão: `20`. Máximo: `500`. |
| `quotation_date` | string | opcional | Filtra pela data de cotização (`YYYY-MM-DD`). |
| `investor_document_number` | string | opcional | Filtra pelo documento do investidor (com pontuação). |
| `request_from_datetime` | string (date-time) | opcional | Retorna apenas os pedidos com data/hora de solicitação maior ou igual ao valor informado. Formato ISO 8601 com Z (`YYYY-MM-DDTHH:MM:SSZ`). |
| `request_to_datetime` | string (date-time) | opcional | Retorna apenas os pedidos com data/hora de solicitação menor ou igual ao valor informado. Formato ISO 8601 com Z (`YYYY-MM-DDTHH:MM:SSZ`). |

```python title="Exemplo de chamada"
GET /quota/fund_class/{fund_class_key}/redemption_requests?page=0&limit=50&investor_document_number=12.345.678/0001-90
```

## Response

STATUS 200

```json title="Response Body"
{
  "data": [
    {
      "redemption_request_key": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
      "quotation_date": "2024-06-15",
      "payment_date": "2024-06-18",
      "redemption_request_type": "number_of_quotas",
      "request_datetime": "2024-06-10T14:00:00.000000Z",
      "status": "quoted",
      "redemption_request_data": {
        "number_of_quotas": 500.0
      },
      "processed_value": 5250.5,
      "ir_value": 0.0,
      "iof_value": 0.0,
      "issuance_serie": {
        "issuance_serie_key": "c3d4e5f6-a7b8-9012-cdef-123456789012",
        "original_quota_value": 1.0,
        "current_number_of_quotas": 499500.0,
        "current_net_worth": 524475.25,
        "current_principal_value": 499500.0,
        "performance_fee_current_value": 0.0,
        "remuneration_type": "yield_curve",
        "minimum_share_capital": 1000.0,
        "interest_rate_type": "post_fixed",
        "name": "Série Única",
        "serie": 1,
        "sub_class": {
          "name": "Cota Sênior",
          "sub_class_key": "d4e5f6a7-b8c9-0123-def0-234567890123",
          "subordination_level": 1,
          "fund_class": {
            "name": "Fundo Exemplo FIDC",
            "short_name": "FEX",
            "document_number": "12.345.678/0001-90",
            "fund_class_key": "e5f6a7b8-c9d0-1234-ef01-345678901234",
            "accounting_date": "2024-06-01",
            "sub_type": "fidc",
            "tax_classification_id": "long_term",
            "condominum_type_id": "open_ended",
            "investment_category_id": "fidc",
            "prevent_payment": false,
            "integralization_account_key": null,
            "manager": {
              "manager_key": "f6a7b8c9-d0e1-2345-f012-456789012345",
              "document_number": "98.765.432/0001-10",
              "manager_name": "Gestora Exemplo S.A."
            }
          }
        },
        "status": "active",
        "internal_code": "INT-FEX-01",
        "processing_method": "standard",
        "operation_period_configuration": {},
        "current_quota_value": 1.05000055,
        "post_fixed": {
          "calendar_base": "calendar_252",
          "indexer": "cdi",
          "rate": 1.0,
          "lag": {
            "reference": "daily",
            "amount": 1
          }
        },
        "isin_code": "BRSTREXTFID6",
        "external_id": null,
        "specific_interest_rate_data": null
      },
      "investor": {
        "distributor": {
          "distributor_key": "3571e292-3a83-4011-904d-20ee963022ef",
          "document_number": "12.345.678/0001-90",
          "name": "Distribuidora Exemplo S.A.",
          "account_data": {
            "owner": {
              "name": "Distribuidora Exemplo S.A.",
              "document_number": "12.345.678/0001-90"
            },
            "account_digit": "1",
            "account_branch": "0001",
            "account_number": "12345",
            "financial_institution_code": "341",
            "financial_institution_ispb": "60746948"
          }
        },
        "investor_key": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
        "name": "Maria Cotista Silva",
        "person_type": "natural_person",
        "document_number": "123.456.789-00",
        "external_id": "ext-inv-001",
        "external_distribution_key": null
      },
      "status_events": [
        {
          "status": "pending_quote",
          "event_datetime": "2024-06-10T14:00:01.000000Z"
        },
        {
          "status": "quoted",
          "event_datetime": "2024-06-15T18:30:00.000000Z"
        }
      ]
    }
  ],
  "limit": 20,
  "page": 0,
  "is_last_page": true
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `data` | array | Pedidos de resgate. |
| `page` | integer | Página atual. |
| `limit` | integer | Tamanho da página. |
| `is_last_page` | boolean | Última página da consulta. |

#### Campos principais de cada pedido em `data`

| Campo | Tipo | Descrição |
|---|---|---|
| `redemption_request_key` | string | Identificador único do pedido (UUID). |
| `redemption_request_type` | string | Tipo do pedido — veja [Tipos de pedido](#tipos-de-pedido-de-resgate). |
| `status` | string | Status atual — veja [Status do pedido](#status-do-pedido-de-resgate). |
| `quotation_date` | string | Data de cotização (`YYYY-MM-DD`). |
| `payment_date` | string | Data prevista/realizada de pagamento (`YYYY-MM-DD`). |
| `request_datetime` | string | Momento da solicitação (ISO 8601 com sufixo Z quando aplicável). |
| `processed_value` | number | Valor processado (quando aplicável). |
| `ir_value` / `iof_value` | number | Retenções quando aplicáveis. |
| `redemption_request_data` | object | Payload específico do tipo de resgate (valores solicitados, cotas, etc.). |
| `issuance_serie` | object | Série de emissão vinculada. |
| `investor` | object | Dados do investidor e distribuidora. |
| `status_events` | array | Histórico de mudanças de status. |

## Tipos de pedido de resgate

| Valor | Descrição |
|---|---|
| `gross_redemption_value` | Resgate por valor bruto. |
| `number_of_quotas` | Resgate por quantidade de cotas. |
| `remaining_application_value` | Resgate do valor remanescente da aplicação. |
| `net_value_redemption` | Resgate por valor líquido. |

## Status do pedido de resgate

| Status | Descrição resumida |
|---|---|
| `created` | Criado. |
| `pending_manager_approval` | Aguardando aprovação do gestor. |
| `pending_quote` | Aguardando cotização. |
| `processing_quotation` | Cotização em processamento. |
| `pending_quotation_date_input` | Aguardando informação de data de cotização. |
| `quoted` | Cotizado. |
| `canceled` | Cancelado. |
| `reprocessed` | Reprocessado. |

## Objetos da resposta

### Issuance Serie (`issuance_serie`)
| Campo | Tipo | Descrição |
|---|---|---|
| `issuance_serie_key` | string | Chave única de identificação da série de emissão |
| `name` | string | Nome da série de emissão |
| `serie` | int | Número da série |
| `original_quota_value` | float | Valor da cota original |
| `current_quota_value` | float | Valor atual da cota |
| `current_number_of_quotas` | float | Quantidade atual de cotas |
| `current_net_worth` | float | Patrimônio líquido atual |
| `current_principal_value` | float | Valor de principal atual |
| `performance_fee_current_value` | float | Valor atual de taxa de performance |
| `minimum_share_capital` | float | Valor mínimo para aplicação |
| `remuneration_type` | string | Tipo de remuneração (ex.: `yield_curve`) |
| `interest_rate_type` | string | Tipo de taxa (`post_fixed` / `pre_fixed`) |
| `post_fixed` / `pre_fixed` | object | Dados de remuneração (`calendar_base`, `indexer`, `rate`, `lag`) |
| `status` | string | Status da série de emissão (ex.: `active`) |
| `internal_code` | string | Código interno da série |
| `isin_code` | string | Código ISIN |
| `processing_method` | string | Método de processamento |
| `operation_period_configuration` | object | Configuração de períodos de operação |
| `external_id` | string | Identificador externo |
| `sub_class` | object | Objeto **Sub Class** |

### Sub Class (`sub_class`)
| Campo | Tipo | Descrição |
|---|---|---|
| `name` | string | Nome da subclasse |
| `sub_class_key` | string | Chave única de identificação da subclasse |
| `subordination_level` | int | Nível de subordinação da subclasse |
| `fund_class` | object | Objeto **Fund Class** |

### Fund Class (`fund_class`)
| Campo | Tipo | Descrição |
|---|---|---|
| `name` | string | Nome da classe de fundo |
| `short_name` | string | Nome curto da classe de fundo |
| `fund_class_key` | string | Chave única de identificação da classe de fundo |
| `document_number` | string | CNPJ da classe de fundo |
| `accounting_date` | string | Data contábil da classe de fundo |
| `sub_type` | string | Subtipo (ex.: `fidc`) |
| `tax_classification_id` | string | Classificação tributária (ex.: `long_term`) |
| `condominum_type_id` | string | Tipo de condomínio (ex.: `open_ended`) |
| `investment_category_id` | string | Categoria de investimento (ex.: `fidc`) |
| `prevent_payment` | boolean | Indica se os pagamentos estão bloqueados |
| `integralization_account_key` | string | Chave da conta de integralização |
| `manager` | object | Objeto **Manager** |

### Manager (`manager`)
| Campo | Tipo | Descrição |
|---|---|---|
| `manager_key` | string | Chave única de identificação do gestor |
| `document_number` | string | CNPJ do gestor |
| `manager_name` | string | Nome do gestor |

### Investor (`investor`)
| Campo | Tipo | Descrição |
|---|---|---|
| `investor_key` | string | Chave única de identificação do investidor |
| `name` | string | Nome do investidor |
| `document_number` | string | CPF/CNPJ do investidor |
| `person_type` | string | Tipo de pessoa (`natural_person` / `legal_person`) |
| `external_id` | string | Identificador externo do investidor |
| `external_distribution_key` | string | Chave de distribuição externa |
| `distributor` | object | Objeto **Distributor** |

### Distributor (`distributor`)
| Campo | Tipo | Descrição |
|---|---|---|
| `distributor_key` | string | Chave única de identificação do distribuidor |
| `name` | string | Nome do distribuidor |
| `document_number` | string | CNPJ do distribuidor |
| `account_data` | object | Objeto **Account Data** |

### Account Data (`account_data`)
| Campo | Tipo | Descrição |
|---|---|---|
| `owner` | object | Titular da conta (`name`, `document_number`) |
| `account_digit` | string | Dígito da conta bancária |
| `account_branch` | string | N° da agência da conta bancária |
| `account_number` | string | N° da conta bancária |
| `financial_institution_code` | string | Código da instituição financeira |
| `financial_institution_ispb` | string | Identificador no Sistema de Pagamento Brasileiro (ISPB) da instituição financeira |

## Possíveis erros

STATUS 404

**Classe de fundo não encontrada**

```json
{
  "title": " Fund Class not Found",
  "description": "Fund Class with key {fund_class_key} was not found.",
  "translation": "A classe com chave {fund_class_key} não foi encontrado.",
  "code": "QTA000002"
}
```

---

# Consulta paginada de pedidos de resgate por investidor

URL: /en/documentation/iaas/passivo/pedido_de_resgate/consulta_pedidos_resgate_investidor

Retorna os **pedidos de resgate** de um investidor identificado por `investor_key`, com paginação e filtros opcionais por **status** e **data de cotização**. A lista é ordenada por fundo, subclasse, série e data de cotização (mais recente primeiro).

## Request

ENDPOINT /quota/investor/{investor_key}/redemption_requests
MÉTODO GET

### Query params

| Parâmetro | Tipo | Obrigatoriedade | Descrição |
|---|---|---|---|
| `page` | integer | opcional | Número da página (começa em `0`) |
| `limit` | integer | opcional | Registros por página. Padrão: `20`. Máximo: `500`. |
| `status` | array de strings | opcional | Um ou mais valores de status do pedido (veja [Status do pedido de resgate](#status-do-pedido-de-resgate)). Repita o parâmetro ou use o formato aceito pela plataforma para listas. |
| `quotation_date` | string | opcional | Filtra pela data de cotização no formato `YYYY-MM-DD`. |
| `fund_class_document_number` | string | opcional | Filtra pelo documento (CNPJ) da classe de fundo. |
| `request_from_datetime` | string (date-time) | opcional | Retorna apenas os pedidos com data/hora de solicitação maior ou igual ao valor informado. Formato ISO 8601 com Z (`YYYY-MM-DDTHH:MM:SSZ`). |
| `request_to_datetime` | string (date-time) | opcional | Retorna apenas os pedidos com data/hora de solicitação menor ou igual ao valor informado. Formato ISO 8601 com Z (`YYYY-MM-DDTHH:MM:SSZ`). |

```python title="Exemplo de chamada"
GET /quota/investor/{investor_key}/redemption_requests?page=0&limit=20&status=quoted&quotation_date=2024-06-15
```

## Response

STATUS 200

```json title="Response Body"
{
  "data": [
    {
      "redemption_request_key": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
      "quotation_date": "2024-06-15",
      "payment_date": "2024-06-18",
      "redemption_request_type": "number_of_quotas",
      "request_datetime": "2024-06-10T14:00:00.000000Z",
      "status": "quoted",
      "redemption_request_data": {
        "number_of_quotas": 500.0
      },
      "processed_value": 5250.5,
      "ir_value": 0.0,
      "iof_value": 0.0,
      "issuance_serie": {
        "issuance_serie_key": "c3d4e5f6-a7b8-9012-cdef-123456789012",
        "original_quota_value": 1.0,
        "current_number_of_quotas": 499500.0,
        "current_net_worth": 524475.25,
        "current_principal_value": 499500.0,
        "performance_fee_current_value": 0.0,
        "remuneration_type": "yield_curve",
        "minimum_share_capital": 1000.0,
        "interest_rate_type": "post_fixed",
        "name": "Série Única",
        "serie": 1,
        "sub_class": {
          "name": "Cota Sênior",
          "sub_class_key": "d4e5f6a7-b8c9-0123-def0-234567890123",
          "subordination_level": 1,
          "fund_class": {
            "name": "Fundo Exemplo FIDC",
            "short_name": "FEX",
            "document_number": "12.345.678/0001-90",
            "fund_class_key": "e5f6a7b8-c9d0-1234-ef01-345678901234",
            "accounting_date": "2024-06-01",
            "sub_type": "fidc",
            "tax_classification_id": "long_term",
            "condominum_type_id": "open_ended",
            "investment_category_id": "fidc",
            "prevent_payment": false,
            "integralization_account_key": null,
            "manager": {
              "manager_key": "f6a7b8c9-d0e1-2345-f012-456789012345",
              "document_number": "98.765.432/0001-10",
              "manager_name": "Gestora Exemplo S.A."
            }
          }
        },
        "status": "active",
        "internal_code": "INT-FEX-01",
        "processing_method": "standard",
        "operation_period_configuration": {},
        "current_quota_value": 1.05000055,
        "post_fixed": {
          "calendar_base": "calendar_252",
          "indexer": "cdi",
          "rate": 1.0,
          "lag": {
            "reference": "daily",
            "amount": 1
          }
        },
        "isin_code": "BRSTREXTFID6",
        "external_id": null,
        "specific_interest_rate_data": null
      },
      "investor": {
        "distributor": {
          "distributor_key": "3571e292-3a83-4011-904d-20ee963022ef",
          "document_number": "12.345.678/0001-90",
          "name": "Distribuidora Exemplo S.A.",
          "account_data": {
            "owner": {
              "name": "Distribuidora Exemplo S.A.",
              "document_number": "12.345.678/0001-90"
            },
            "account_digit": "1",
            "account_branch": "0001",
            "account_number": "12345",
            "financial_institution_code": "341",
            "financial_institution_ispb": "60746948"
          }
        },
        "investor_key": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
        "name": "Maria Cotista Silva",
        "person_type": "natural_person",
        "document_number": "123.456.789-00",
        "external_id": "ext-inv-001",
        "external_distribution_key": null
      },
      "status_events": [
        {
          "status": "pending_quote",
          "event_datetime": "2024-06-10T14:00:01.000000Z"
        },
        {
          "status": "quoted",
          "event_datetime": "2024-06-15T18:30:00.000000Z"
        }
      ]
    }
  ],
  "limit": 20,
  "page": 0,
  "is_last_page": true
}
```

### Atributos da resposta

| Campo | Tipo | Descrição |
|---|---|---|
| `data` | array | Pedidos de resgate. |
| `page` | integer | Página atual. |
| `limit` | integer | Tamanho da página. |
| `is_last_page` | boolean | Última página da consulta. |

#### Campos principais de cada pedido em `data`

| Campo | Tipo | Descrição |
|---|---|---|
| `redemption_request_key` | string | Identificador único do pedido (UUID). |
| `redemption_request_type` | string | Tipo do pedido — veja [Tipos de pedido](#tipos-de-pedido-de-resgate). |
| `status` | string | Status atual — veja [Status do pedido](#status-do-pedido-de-resgate). |
| `quotation_date` | string | Data de cotização (`YYYY-MM-DD`). |
| `payment_date` | string | Data prevista/realizada de pagamento (`YYYY-MM-DD`). |
| `request_datetime` | string | Momento da solicitação (ISO 8601 com sufixo Z quando aplicável). |
| `processed_value` | number | Valor processado (quando aplicável). |
| `ir_value` / `iof_value` | number | Retenções quando aplicáveis. |
| `redemption_request_data` | object | Payload específico do tipo de resgate (valores solicitados, cotas, etc.). |
| `issuance_serie` | object | Série de emissão vinculada. |
| `investor` | object | Dados do investidor e distribuidora. |
| `status_events` | array | Histórico de mudanças de status. |
| `cancellation_data` | object | Presente quando o pedido foi cancelado (omitido quando `null`). |

## Tipos de pedido de resgate

| Valor | Descrição |
|---|---|
| `gross_redemption_value` | Resgate por valor bruto. |
| `number_of_quotas` | Resgate por quantidade de cotas. |
| `remaining_application_value` | Resgate do valor remanescente da aplicação. |
| `net_value_redemption` | Resgate por valor líquido. |

## Status do pedido de resgate

| Status | Descrição resumida |
|---|---|
| `created` | Criado. |
| `pending_manager_approval` | Aguardando aprovação do gestor. |
| `pending_quote` | Aguardando cotização. |
| `processing_quotation` | Cotização em processamento. |
| `pending_quotation_date_input` | Aguardando informação de data de cotização. |
| `quoted` | Cotizado. |
| `canceled` | Cancelado. |
| `reprocessed` | Reprocessado. |

## Objetos da resposta

### Issuance Serie (`issuance_serie`)
| Campo | Tipo | Descrição |
|---|---|---|
| `issuance_serie_key` | string | Chave única de identificação da série de emissão |
| `name` | string | Nome da série de emissão |
| `serie` | int | Número da série |
| `original_quota_value` | float | Valor da cota original |
| `current_quota_value` | float | Valor atual da cota |
| `current_number_of_quotas` | float | Quantidade atual de cotas |
| `current_net_worth` | float | Patrimônio líquido atual |
| `current_principal_value` | float | Valor de principal atual |
| `performance_fee_current_value` | float | Valor atual de taxa de performance |
| `minimum_share_capital` | float | Valor mínimo para aplicação |
| `remuneration_type` | string | Tipo de remuneração (ex.: `yield_curve`) |
| `interest_rate_type` | string | Tipo de taxa (`post_fixed` / `pre_fixed`) |
| `post_fixed` / `pre_fixed` | object | Dados de remuneração (`calendar_base`, `indexer`, `rate`, `lag`) |
| `status` | string | Status da série de emissão (ex.: `active`) |
| `internal_code` | string | Código interno da série |
| `isin_code` | string | Código ISIN |
| `processing_method` | string | Método de processamento |
| `operation_period_configuration` | object | Configuração de períodos de operação |
| `external_id` | string | Identificador externo |
| `sub_class` | object | Objeto **Sub Class** |

### Sub Class (`sub_class`)
| Campo | Tipo | Descrição |
|---|---|---|
| `name` | string | Nome da subclasse |
| `sub_class_key` | string | Chave única de identificação da subclasse |
| `subordination_level` | int | Nível de subordinação da subclasse |
| `fund_class` | object | Objeto **Fund Class** |

### Fund Class (`fund_class`)
| Campo | Tipo | Descrição |
|---|---|---|
| `name` | string | Nome da classe de fundo |
| `short_name` | string | Nome curto da classe de fundo |
| `fund_class_key` | string | Chave única de identificação da classe de fundo |
| `document_number` | string | CNPJ da classe de fundo |
| `accounting_date` | string | Data contábil da classe de fundo |
| `sub_type` | string | Subtipo (ex.: `fidc`) |
| `tax_classification_id` | string | Classificação tributária (ex.: `long_term`) |
| `condominum_type_id` | string | Tipo de condomínio (ex.: `open_ended`) |
| `investment_category_id` | string | Categoria de investimento (ex.: `fidc`) |
| `prevent_payment` | boolean | Indica se os pagamentos estão bloqueados |
| `integralization_account_key` | string | Chave da conta de integralização |
| `manager` | object | Objeto **Manager** |

### Manager (`manager`)
| Campo | Tipo | Descrição |
|---|---|---|
| `manager_key` | string | Chave única de identificação do gestor |
| `document_number` | string | CNPJ do gestor |
| `manager_name` | string | Nome do gestor |

### Investor (`investor`)
| Campo | Tipo | Descrição |
|---|---|---|
| `investor_key` | string | Chave única de identificação do investidor |
| `name` | string | Nome do investidor |
| `document_number` | string | CPF/CNPJ do investidor |
| `person_type` | string | Tipo de pessoa (`natural_person` / `legal_person`) |
| `external_id` | string | Identificador externo do investidor |
| `external_distribution_key` | string | Chave de distribuição externa |
| `distributor` | object | Objeto **Distributor** |

### Distributor (`distributor`)
| Campo | Tipo | Descrição |
|---|---|---|
| `distributor_key` | string | Chave única de identificação do distribuidor |
| `name` | string | Nome do distribuidor |
| `document_number` | string | CNPJ do distribuidor |
| `account_data` | object | Objeto **Account Data** |

### Account Data (`account_data`)
| Campo | Tipo | Descrição |
|---|---|---|
| `owner` | object | Titular da conta (`name`, `document_number`) |
| `account_digit` | string | Dígito da conta bancária |
| `account_branch` | string | N° da agência da conta bancária |
| `account_number` | string | N° da conta bancária |
| `financial_institution_code` | string | Código da instituição financeira |
| `financial_institution_ispb` | string | Identificador no Sistema de Pagamento Brasileiro (ISPB) da instituição financeira |

## Possíveis erros

STATUS 404

**Status informado inválido**

Algum valor em `status` não corresponde a um enumerador válido de `RedemptionRequestStatus`.

```json
{
  "title": "Not found enumerator",
  "description": "invalid_status is not a valid type of RedemptionRequestStatus",
  "translation": "invalid_status não é um tipo válido de RedemptionRequestStatus",
  "code": "QTA000004"
}
```

---

# Create Redemption Request

URL: /en/documentation/iaas/passivo/pedido_de_resgate/criar_pedido_de_resgate

---

### Request

ENDPOINT /quota/investor/INVESTOR_KEY/redemption_request
METHOD POST
STATUS 201

```json title='Request Body'
{
    "issuance_serie_key": "UUID",
    "redemption_request_type": "gross_redemption_value" | "number_of_quotas" | "remaining_application_value" | "net_value_redemption",
    "payment_method": "regular / b3",
    "gross_redemption_value":0.00,
    "net_value": 0.00,
    "remaining_application_value":0.00,
    "number_of_quotas":0.00000000,
    "disbursement_account_key": "UUID",
    "quotation_date": "yyyy-mm-dd",
    "reference_date": "yyyy-mm-dd"
}
```

:::::warning
- The redemption_request_type field defines whether the gross_redemption_value , remaining_application_value and number_of_quotas fields should be passed or not.

- If gross_redemption_value , the gross_redemption_value field is required.
- If remaining_application_value , the remaining_application_value field is required.
- If number_of_quotas , the number_of_quotas field is required.
- If net_value_redenotuib , the net_value field is required.

- The disbursement_account_key field should be used for redemption settlement in a specific account of the investor. If no specific account is informed, the investor's primary account will be used
:::::

### Body params
| Field                             | Type     | Description                                                                            | Required
|-----------------------------------|----------|----------------------------------------------------------------------------------------|-----|
| `issuance_serie_key`              | string   | Unique identifier key for the Issuance Series                                         | Yes
| `redemption_request_type`         | string   | Enumerator for **[Redemption Request Types](#tipos_de_pedido_de_resgate)**           | Yes
| `gross_redemption_value`          | float    | Gross redemption value, without deducting IR and IOF                                  | No
| `net_value`                       | float    | Net redemption value, already discounting IR and IOF                                  | No
| `remaining_application_value`     | float    | Remaining application value                                                            | No
| `number_of_quotas`                | float    | Financial application value                                                            | No
| `disbursement_account_key`                | string   | Unique identifier key for the investor's bank account                                 | No |
| `quotation_date`                | string   | Redemption quotation date                        | No |
| `payment_method`                | string   | Redemption payment method. Expected values:<br />• regular **(default)**<br />• b3: Via B3 | No |
| `reference_date`                | string   | Redemption reference date, in yyyy-mm-dd format                                       | No |

### Redemption Request Types
| Enumerator                      | Description                                     |
|---------------------------------|-------------------------------------------------|
| `gross_redemption_value`        | Redemption by gross value                       |
| `number_of_quotas`              | Redemption by number of quotas                  |
| `remaining_application_value`   | Redemption by remaining position                |]
| `net_value_redemption`          | Redemption by net value             |

### Response
```json title='Response Body'
{
    "redemption_request_key": "UUID"
}
```

---

# Send Signed Adhesion Term

URL: /en/documentation/iaas/passivo/termo_de_adesao/enviar_termo_de_adesao_assinado

---
### Introduction
This resource aims to send us the signature proof of the **adhesion term** of an **investor** to an **issuance series** of a fund.

:::warning Attention
This resource is only available for integrations that play the role of **Distributor**.
:::

### Input / Output:
As ***input***, the UUID of the fund's **issuance series** that the investor adhered to and **signature type** must be sent, and depending on the signature, the necessary content for validation. Example follows below.

As ***output***, an ***investor_adhesion_key*** will be delivered. The ***investor_adhesion_key*** is used to identify the **investor's adhesion**.

### Request

ENDPOINT /investor_adhesion/investor/INVESTOR_KEY/signed_investor_adhesion
METHOD POST
STATUS 201

### Request body
```json title='Request Body'
{
  "issuance_serie_key": "UUID",
  "signature_method": "opt_in",
  "opt_in_hash" : "OPT_IN_HASH"
}
```
:::warning Attention
During the integration process, an authentication method for the sent hash will be required.
:::

### Response
```json title='Response Body'
{
    "investor_adhesion_key": "UUID"
}
```

---

# Request Adhesion Term

URL: /en/documentation/iaas/passivo/termo_de_adesao/solicitar_termo_de_adesao

---

### Introduction
This resource aims to create a request for an **adhesion term** of an **investor** to an **issuance series** of a fund. From this request, the documents needed to formalize the adhesion are generated according to the issuance series configuration.

:::warning Attention
This resource is only available for integrations that play the role of **Manager** of the fund.
:::

### Input / Output:
As ***input***, the UUID of the **issuance series** to which the investor is adhering must be sent and, optionally, the **signature method** that will be used for the generated documents.

As ***output***, an ***investor_adhesion_key*** will be delivered. The ***investor_adhesion_key*** is used to identify the **investor's adhesion**.

### Request

ENDPOINT /investor_adhesion/investor/INVESTOR_KEY/investor_adhesion
METHOD POST
STATUS 201

### Request body
```json title='Request Body'
{
  "issuance_serie_key": "UUID",
  "signature_method": "qi_sign"
}
```

### Investor Adhesion
| Field                | Type   | Description                                                                 | Length     | Required |
|----------------------|--------|-----------------------------------------------------------------------------|------------|----------|
| `issuance_serie_key` | string | Key of the issuance series to which the investor is adhering                | 36         |   Yes    |
| `signature_method`   | string | Enumerator of the signature method to be used on the generated documents    | up to 255  |   No     |

### Signature Method
| Enumerator    | Description                           |
|---------------|---------------------------------------|
| `certifiqi`   | Signature via CertifiQi               |
| `qi_sign`     | Signature via QI Sign                 |

### Response
```json title='Response Body'
{
    "investor_adhesion_key": "UUID"
}
```

:::info Adhesion flow
After creation, the adhesion can follow two paths, depending on the issuance series configuration:

- **With documents to generate**: the adhesion is created in the `pending_documents` status and stays there until all required documents are generated and signed.
- **Without documents to generate**: the adhesion is created directly in the `active` status.

If an `active` or `pending_documents` adhesion already exists for the same investor and issuance series, the new request is rejected.
:::

---

# Razão Contábil

URL: /en/documentation/iaas/relatorios_dtvm/accounting_ledger

## Visão Geral

O relatório `accounting_ledger` apresenta o razão contábil do fundo em um intervalo de datas. Para cada conta do plano de contas com movimentações no período, o relatório exibe uma linha de saldo inicial, todos os lançamentos individuais com data, contrapartida, valor e descrição, e uma linha de saldo final com totais de débito e crédito. Auditores, administradores e analistas utilizam este relatório para rastrear a origem de cada lançamento contábil e verificar a evolução dos saldos conta a conta.

## O que você precisa informar

| Variável | Obrigatória | Descrição |
|----------|-------------|-----------|
| `fund_class_key` | sim | Identificador da classe de fundo sobre a qual o relatório é gerado. |
| `start_date` | sim | Data de início do período, no formato `AAAA-MM-DD`. |
| `end_date` | sim | Data de fim do período, no formato `AAAA-MM-DD`. Precisa ser **posterior** à data de início. |

:::warning É preciso haver contabilidade fechada nas duas datas
O relatório só é gerado se existir fechamento contábil na data de início **e** na data de fim. Sem isso a solicitação é recusada com a mensagem "Não existe contabil na data ...".
:::

:::warning As duas datas têm de estar no mesmo exercício contábil
Além de existir fechamento nas duas datas, elas precisam pertencer ao **mesmo exercício** (mesmo *ledger*). Um período que atravessa o encerramento de exercício faz a geração falhar.
:::

## Estrutura do Arquivo

| Atributo | Valor |
|----------|-------|
| Formato | XLSX |
| Nomenclatura | `{nome_resumido_fundo}_accounting_ledger_{YYYY-MM-DD}.xlsx` |

## Conteúdo da Planilha

### Cabeçalho do Fundo

Apresentado nas primeiras linhas da planilha:

| Campo | Descrição |
|-------|-----------|
| Fundo | Nome completo da classe de fundo. |
| CNPJ | CNPJ da classe de fundo. |

:::warning O sinal do saldo aqui é diferente do Relatório de Balanço
Neste relatório o saldo é o valor cru do fechamento (crédito positivo, débito negativo). No [Relatório de Balanço](/documentation/iaas/relatorios_dtvm/balance_report) o mesmo saldo é normalizado pela natureza da conta. A mesma conta pode, portanto, aparecer como `-45000.00` aqui e `45000.00` lá — são a mesma posição, em convenções de sinal diferentes.
:::

### Lançamentos por Conta

Para cada conta com movimentações no período, o relatório exibe:

1. **Linha de saldo inicial** (em negrito) — saldo da conta na Data de Início.
2. **Linhas de lançamento** — um registro por movimento contábil.
3. **Linha de saldo final** (em negrito) — saldo da conta na Data Final com totais de débito e crédito.

| Coluna | Tipo | Formato / Exemplo | Descrição |
|--------|------|-------------------|-----------|
| `Data` | data | `2026-07-15` | Data contábil do lançamento. Nas linhas de saldo inicial e final, exibe a Data de Início e a Data Final respectivamente. |
| `Conta` | string | `"1.2.1.10.00.001.001-9"` | Número da conta no plano de contas, com dígito verificador. |
| `Nome da Conta` | string | `"Direitos Creditórios sem Coobrigação"` | Nome descritivo da conta contábil. |
| `Tipo do Lançamento` | string (enum) | `"A"` | Tipo do lançamento: `"A"` para automático; `"M"` para manual; `"I"` para linha de saldo inicial; `"F"` para linha de saldo final. |
| `ContraPartida` | string | `"7.9.1.20.00.001.001-1"` | Número da conta de contrapartida do lançamento. Vazio nas linhas de saldo inicial e final. |
| `Débito` | número | `1500.00` | Valor do lançamento a débito (em reais). Zero quando o lançamento é a crédito. |
| `Crédito` | número | `0.00` | Valor do lançamento a crédito (em reais). Zero quando o lançamento é a débito. |
| `Saldo` | número | `-196500.00` | Saldo acumulado da conta após o lançamento (em reais). Crédito soma e débito subtrai, **sem normalização pela natureza da conta** — por isso uma conta de ativo com saldo devedor aparece negativa aqui. |
| `Descrição` | string | `"ACRUO DE ATIVOS - CCBs"` | Descrição do evento contábil associado ao lançamento. |

---

# Composição de Carteira de Ativos

URL: /en/documentation/iaas/relatorios_dtvm/assets_wallet_composition

## Visão Geral

O relatório `assets_wallet_composition` apresenta a posição completa de todos os ativos que compõem o estoque do fundo em uma determinada data de referência. Ele é gerado uma vez ao dia e consolida três categorias de ativos:

- **operações de crédito** (ex: CCB) — uma linha por **parcela** da operação;
- **direitos creditórios descontados** (ex: duplicatas, CT-e, contratos descontados) — uma linha por título;
- **títulos privados** (ex: debêntures, notas comerciais) — uma linha por parcela do título.

Gestores e analistas utilizam este relatório para acompanhar o estoque, avaliar provisões para devedores duvidosos e monitorar a evolução da carteira.

:::info Uma linha por parcela
Para operações de crédito parceladas, a mesma operação aparece em várias linhas — uma por parcela — repetindo os dados cadastrais (`external_id`, `contract_number`, `purchase_value`) e variando `installment_number`, `face_value`, `maturity_date` e `installment_purchase_value`.
:::

:::tip Também em PDF
Este relatório está descrito em linguagem de negócio no [Manual de Relatórios QI Tech](./manual_relatorios_qi_tech.pdf) — revisão 2, julho de 2026. O manual cobre quatro relatórios: este, a [Composição de Ativos da Cessão](/documentation/iaas/relatorios_dtvm/assignment_assets_wallet_composition), a [Aquisição Consolidada](/documentation/iaas/relatorios_dtvm/consolidated_credit_rights_acquisition_assets) e a [Conciliação Consolidada de Direitos Creditórios](/documentation/iaas/relatorios_dtvm/consolidated_credit_rights_conciliation_assets).

Nesta seção do manual os nomes das colunas aparecem em maiúsculas. No arquivo entregue eles vêm sempre em **minúsculas**, conforme a tabela de colunas abaixo.
:::

## O que você precisa informar

| Variável | Obrigatória | Descrição |
|----------|-------------|-----------|
| `fund_class_key` | sim | Identificador da classe de fundo sobre a qual o relatório é gerado. |
| `reference_date` | sim | Data de referência, no formato `AAAA-MM-DD`. |

:::info Fundos de cota de abertura
Para os fundos que operam com relatório de cota de abertura, a posição entregue é a do **dia anterior** à data de referência informada.
:::

## Estrutura do Arquivo

| Atributo | Valor |
|----------|-------|
| Formato | CSV |
| Encoding | UTF-8 |
| Delimitador | `,` (vírgula) |
| Cabeçalho | Sim (primeira linha) |
| Nomenclatura | `{nome_resumido_fundo}_assets_wallet_composition_{AAAA-MM-DD}.csv` |

Os nomes das colunas são gerados em **minúsculas**. Datas são escritas no formato `AAAA-MM-DD` e valores decimais usam ponto como separador, com até 8 casas decimais.

## Colunas

| Coluna | Tipo | Formato / Exemplo | Descrição |
|--------|------|-------------------|-----------|
| `fund_name` | string | `"FUNDO EXEMPLO FIDC RESPONSABILIDADE LIMITADA"` | Nome da classe de fundo. |
| `fund_document` | string | `"12.345.678/0001-99"` | CNPJ da classe de fundo. |
| `report_date` | data | `2026-07-30` | Data em que o relatório foi gerado. Nas linhas de títulos privados, esta coluna traz a data de referência da carteira. |
| `originator_name` | string | `"ORIGINADOR EXEMPLO S.A."` | Nome da empresa originadora da operação. Para títulos privados, o valor é `-`. |
| `originator_document` | string | `"11.222.333/0001-44"` | CNPJ do originador. Para títulos privados, o valor é `-`. |
| `assignor_name` | string | `"CEDENTE EXEMPLO S.A."` | Nome do cedente da operação. Para títulos privados, o valor é `-`. |
| `assignor_document` | string | `"22.333.444/0001-55"` | CNPJ do cedente. Para títulos privados, o valor é `-`. |
| `borrower_name` | string | `"MARIA APARECIDA DE SOUZA"` | Nome do devedor. Para direitos creditórios descontados, é o sacado; para títulos privados, é o emissor. |
| `borrower_document` | string | `"123.456.789-00"` | CPF ou CNPJ do devedor / sacado / emissor. |
| `external_id` | string | `"10a20b30-0001-4bbb-9222-000000000201"` | Identificador externo do ativo, conforme informado na criação. |
| `contract_number` | string | `"0900112233/EXA"` | Número do contrato ou número do pedido (`order_number`) associado à operação. |
| `asset_type` | string (enum) | `"ccb"` | Tipo do ativo. Exemplos: `ccb`, `duplicata_mercantil`, `duplicata_servicos`, `cte`, `discounted_contract`, `debenture`. |
| `face_value` | número | `1678.90` | Valor de face da parcela (ou do título) na data de referência, em reais. |
| `present_value` | número | `1663.48` | Valor presente da parcela (ou do título) na data de referência, em reais. |
| `purchase_value` | texto numérico | `4690.80` | Valor pelo qual o **ativo** foi adquirido pelo fundo, em reais. Repetido em todas as parcelas da mesma operação. |
| `bad_provision_value` | número | `0.0` | Valor da provisão para devedores duvidosos (PDD) constituída sobre o ativo, em reais. |
| `bad_provision_range` | string | `"AA"` | Faixa de classificação de risco da PDD — as usuais são `AA`, `A`, `B`, `C`, `D`, `E`, `F`, `G` e `H`, e ativos baixados podem trazer `WO`. Quando não há classificação, o relatório traz `AA`. |
| `fund_date` | data | `2026-07-29` | Data de referência da carteira. |
| `maturity_date` | data | `2026-08-28` | Data de vencimento da parcela (ou do título). |
| `business_maturity_date` | data | `2026-08-28` | Data de vencimento ajustada para dia útil. |
| `issue_date` | texto de data | `2026-07-28` | Data de emissão do contrato. Para direitos creditórios descontados, corresponde à data de aquisição. |
| `purchase_date` | texto de data | `2026-07-29` | Data de aquisição do ativo pelo fundo. |
| `total_duration` | inteiro | `30` | Prazo total em dias corridos, da aquisição até o vencimento. |
| `present_duration` | inteiro | `30` | Prazo remanescente em dias corridos, da data de referência até o vencimento. Fica negativo quando o ativo está vencido. |
| `asset_maturity_status` | string (enum) | `"on_time"` | Situação do vencimento: `OVERDUE` quando vencido, `on_time` quando dentro do prazo. |
| `assignment_rate_of_return` | número | `0.0312` | Taxa interna de retorno (TIR) da cessão. Vazio para títulos privados. |
| `purchase_rate_of_return` | texto numérico | `0.031874210` | TIR corrente da operação no momento da aquisição. Para títulos privados, o valor é `-`. |
| `has_assignor_coobligation` | string | `"False"` | Indica coobrigação do cedente: `True` ou `False`. Para títulos privados, o valor é `-`. |
| `installment_number` | inteiro | `1` | Número da parcela. Para direitos creditórios descontados, é sempre `1`. |
| `bad_debt_type` | string | `"default"` | Tipo de classificação da PDD aplicada ao ativo. |
| `nominal_rate` | número | `0.0231` | Taxa nominal mensal pré-fixada da operação. Vazio para direitos creditórios descontados e títulos privados. |
| `operation_type` | string | `"ccb"` | Tipo da operação registrado no cadastro do ativo. Vazio para títulos privados. |
| `installment_purchase_value` | texto numérico | `1598.74210000` | Valor pago pelo fundo pela **parcela** específica, em reais. Vazio para direitos creditórios descontados e títulos privados. |

:::note Coluna adicional
Quando a entrega é configurada com a opção `benefit_number`, o relatório traz uma coluna extra `benefit_type` ao final, com o tipo de benefício associado à garantia da operação.
:::

---

# Composição de Ativos da Cessão

URL: /en/documentation/iaas/relatorios_dtvm/assignment_assets_wallet_composition

## Visão Geral

O relatório `assignment_assets_wallet_composition` detalha os ativos de **uma cessão específica**, no mesmo formato do relatório de [Composição de Carteira de Ativos](/documentation/iaas/relatorios_dtvm/assets_wallet_composition). É o relatório usado para conferir o que entrou na carteira imediatamente após uma aquisição, antes de o ativo passar a compor as posições diárias.

- **operações de crédito** — uma linha por **parcela**;
- **direitos creditórios descontados** — uma linha por **ativo**.

:::tip Também em PDF
Este relatório está descrito em linguagem de negócio no [Manual de Relatórios QI Tech](./manual_relatorios_qi_tech.pdf) — revisão 2, julho de 2026. O manual cobre quatro relatórios: este, a [Composição de Carteira de Ativos](/documentation/iaas/relatorios_dtvm/assets_wallet_composition), a [Aquisição Consolidada](/documentation/iaas/relatorios_dtvm/consolidated_credit_rights_acquisition_assets) e a [Conciliação Consolidada de Direitos Creditórios](/documentation/iaas/relatorios_dtvm/consolidated_credit_rights_conciliation_assets).

Nesta seção do manual os nomes das colunas aparecem em maiúsculas. No arquivo entregue eles vêm sempre em **minúsculas**, conforme a tabela de colunas abaixo.
:::

## O que você precisa informar

| Variável | Obrigatória | Descrição |
|----------|-------------|-----------|
| `external_id` | sempre | O "seu número" da cessão a consultar. |
| `asset_type` | sempre | Define qual consulta é executada. Operações de crédito: `ccb`, `structured_ccb`, `cce`, `structured_cce`, `structured_cci`, `structured_nce`. Direitos creditórios descontados: `duplicata_mercantil`, `duplicata_servicos`, `discounted_contract`, `legal_fees`, `cte`. Um tipo fora dessas listas faz o relatório falhar. |
| `fund_class_key` | só para direitos creditórios descontados | Classe de fundo sobre a qual o relatório é gerado. Para operações de crédito o filtro é feito apenas pela cessão, e o fundo informado é ignorado. |

## Estrutura do Arquivo

| Atributo | Valor |
|----------|-------|
| Formato | CSV |
| Encoding | UTF-8 |
| Delimitador | `,` (vírgula) |
| Cabeçalho | Sim (primeira linha) |
| Nomenclatura | `{nome_resumido_fundo}_assignment_assets_wallet_composition_{AAAA-MM-DD}_{external_id}.csv` |

:::note O nome do arquivo termina com o identificador da cessão
Diferente dos relatórios diários, este acrescenta o `external_id` da cessão ao final do nome. Como o `external_id` é obrigatório, o sufixo está sempre presente.
:::

## O que o relatório traz

- Todos os ativos da cessão informada, **exceto** os descartados (`discarded`) e os reprovados (`denied`).
- As últimas colunas variam conforme o tipo de ativo — veja `asset_external_id` / `invoice_number` e `monthly_rate` na tabela abaixo.
- Campos sem valor vêm vazios no arquivo.

## Colunas

| Coluna | Tipo | Formato / Exemplo | Descrição |
|--------|------|-------------------|-----------|
| `fund_name` | string | `"FUNDO EXEMPLO FIDC RESPONSABILIDADE LIMITADA"` | Nome da classe de fundo. |
| `fund_document` | string | `"12.345.678/0001-99"` | CNPJ da classe de fundo. |
| `fund_date` | data | `2026-07-29` | Data contábil corrente do fundo. |
| `originator_name` | string | `"ORIGINADOR EXEMPLO S.A."` | Nome do originador. |
| `originator_document` | string | `"11.222.333/0001-44"` | CNPJ do originador. |
| `name` | string | `"CEDENTE EXEMPLO S.A."` | Nome do **cedente**. Atenção ao cabeçalho genérico: apesar de `name`, o conteúdo é o cedente, não o fundo nem o devedor. |
| `document_number` | string | `"22.333.444/0001-55"` | CNPJ do **cedente**. Mesma observação da coluna anterior. |
| `borrower_name` | string | `"MARIA APARECIDA DE SOUZA"` | Nome do devedor ou do sacado. |
| `borrower_document` | string | `"123.456.789-00"` | CPF ou CNPJ do devedor/sacado. |
| `external_id` | string | `"10a20b30-0001-4bbb-9222-000000000201-1"` | Identificador externo da **parcela** (operação de crédito) ou do **ativo** (direito creditório descontado). |
| `contract_number` | string | `"0900112233/EXA"` | Número do contrato ou do pedido. |
| `asset_type` | string (enum) | `"ccb"` | Tipo do ativo. |
| `face_value` | número | `1678.90` | Valor de face/nominal (em reais). |
| `present_value` | número | `1598.74210000` | Valor presente. Nesta visão, igual ao valor de compra. |
| `purchase_value` | número | `1598.74210000` | Valor de aquisição (em reais). |
| `bad_provision_value` | número | `0` | Provisão para devedores duvidosos. **Fixo em `0`** nesta visão. |
| `bad_provision_range` | string | `"AA"` | Faixa de PDD. **Fixo em `AA`** (melhor faixa) nesta visão. |
| `report_date` | data | `2026-07-30` | Data de geração do relatório. |
| `maturity_date` | data | `2026-08-28` | Vencimento da parcela ou do ativo. |
| `business_maturity_date` | data | `2026-08-28` | Vencimento ajustado. Nesta visão, repete o `maturity_date`. |
| `issue_date` | data | `2026-07-29` | Data de emissão. Nesta visão, traz a **data da cessão**. |
| `purchase_date` | data | `2026-07-29` | Data de aquisição. Nesta visão, traz a **data da cessão**. |
| `total_duration` | número | `30` | Prazo total, em dias. |
| `present_duration` | número | `30` | Prazo atual, em dias. |
| `asset_maturity_status` | string (enum) | `"on_time"` | `OVERDUE` quando a data da cessão é posterior ao vencimento; `on_time` nos demais casos. |
| `assignment_irr` | número | `0.0312` | Taxa de cessão. |
| `purchase_irr` | número | `0.03187421` | Taxa de compra do recebível. |
| `has_assignor_coobligation` | string | `"False"` | Coobrigação do cedente, como texto `"True"` ou `"False"`. |
| `asset_external_id` **ou** `invoice_number` | string | `"10a20b30-0001-4bbb-9222-000000000201"` | Operação de crédito: identificador externo do ativo (`asset_external_id`). Direito creditório descontado: chave de acesso da NF-e (`invoice_number`). |
| `monthly_rate` | string | `"0.0231"` | Taxa mensal pré-fixada. **Só existe no arquivo de operações de crédito** — no de direitos creditórios descontados a coluna não é emitida. |

## Colunas opcionais

Podem ser solicitadas na geração do relatório e são acrescentadas **ao final** do arquivo, nesta ordem. Valem apenas para **operações de crédito**.

| Coluna | Descrição |
|--------|-----------|
| `installment_number` | Número da parcela. |
| `disbursement_value` | Valor desembolsado no contrato. |
| `cet` | Custo Efetivo Total do contrato. |
| `issue_value` | Valor de emissão do contrato. |
| `interest_rate_type` | Tipo da taxa de juros da operação. |
| `borrower_birthdate` | Data de nascimento do devedor (pessoa natural). |
| `benefit_type` | Tipo de benefício da primeira garantia da operação. |

:::note Como pedir as colunas opcionais
A habilitação é feita pela QI CTVM na configuração da entrega, por relatório. Se você precisar de alguma dessas colunas, informe ao time de integração quais deseja.
:::

---

# Lastros da Cessão

URL: /en/documentation/iaas/relatorios_dtvm/assignment_documents

## Visão Geral

O relatório `assignment_documents` lista os **documentos comprobatórios** dos ativos de uma cessão específica, com um link de download para cada arquivo. É o relatório usado para arquivar o lastro da operação: uma linha por documento, com a chave do ativo a que ele pertence.

Ele é o complemento da [Composição de Ativos da Cessão](/documentation/iaas/relatorios_dtvm/assignment_assets_wallet_composition): aquele traz os valores e características dos ativos cedidos, este traz os arquivos que os comprovam.

## O que você precisa informar

| Variável | Obrigatória | Descrição |
|----------|-------------|-----------|
| `fund_class_key` | sim | Identificador da classe de fundo da cessão. |
| `external_id` | sim | O "seu número" da cessão a consultar. |

Este relatório **não recebe data de referência** — ele sempre reflete os documentos existentes no momento da geração.

## Estrutura do Arquivo

| Atributo | Valor |
|----------|-------|
| Formato | CSV |
| Encoding | UTF-8 |
| Delimitador | `,` (vírgula) |
| Cabeçalho | Sim (primeira linha) |
| Nomenclatura | `{nome_resumido_fundo}_assignment_documents_{external_id}_{AAAA-MM-DD}.csv` |

:::warning A nomenclatura deste relatório é diferente
Duas diferenças em relação aos outros relatórios:

1. o identificador da cessão vem **antes** da data, e não no fim do nome — compare com o `assignment_assets_wallet_composition`, que acrescenta o `external_id` no final;
2. a data no nome é a **data de geração do arquivo** (fuso de Brasília), não uma data de referência informada por você. Gerar o mesmo relatório em dois dias diferentes produz dois nomes diferentes para o mesmo conteúdo.
:::

## Colunas

| Coluna | Tipo | Formato / Exemplo | Descrição |
|--------|------|-------------------|-----------|
| `assignment_external_id` | string | `"CESSAO-2026-07-29-001"` | Identificador externo da cessão. Igual em todas as linhas do arquivo. |
| `asset_key` | string | `"1a2b3c40-0001-4aaa-9111-000000000101"` | Chave interna do ativo gerada pela QI Tech (UUID). Repete-se quando o ativo tem mais de um documento. |
| `asset_external_id` | string | `"10a20b30-0001-4bbb-9222-000000000201"` | Identificador externo do ativo. |
| `document_key` | string | `"50e60f70-0001-4fff-9666-000000000601"` | Chave interna do documento gerada pela QI Tech (UUID). |
| `document_type` | string (enum) | `"ccb"`, `"duplicata_mercantil"`, `"duplicata_servicos"`, `"discounted_contract"`, `"cte"`, `"invoice"` | Tipo do documento. Acompanha o tipo do ativo, exceto `invoice`, que é a nota fiscal do recebível. |
| `document_url` | string | `"https://...s3.amazonaws.com/...?X-Amz-Signature=..."` | Link de download direto do arquivo. Veja o aviso sobre validade abaixo. |

:::danger Os links expiram em 5 dias
`document_url` é uma URL pré-assinada, gerada no momento em que o relatório é produzido e válida por **5 dias (432.000 segundos)**. Depois disso o link retorna erro e é preciso gerar o relatório novamente para obter links novos.

Não armazene as URLs como referência permanente do documento. Se você precisa guardar o lastro, **baixe os arquivos** dentro da janela de validade e use `document_key` como identificador estável do documento.
:::

## O que o relatório traz

- Os documentos de todos os ativos da cessão informada, **exceto** os dos ativos descartados (`discarded`) e reprovados (`denied`).
- **Uma linha por documento.** Um ativo com contrato e nota fiscal aparece em duas linhas, com o mesmo `asset_key` e `document_type` diferentes.
- Ativos sem documento anexado não aparecem no arquivo.

:::tip Cruzando com a composição da cessão
`asset_external_id` e `asset_key` são as chaves de junção com a [Composição de Ativos da Cessão](/documentation/iaas/relatorios_dtvm/assignment_assets_wallet_composition). Cruzando os dois arquivos você confere se todo ativo cedido tem o lastro correspondente — um ativo presente na composição e ausente aqui é um ativo sem documento anexado.
:::

---

# Relatório de Balanço

URL: /en/documentation/iaas/relatorios_dtvm/balance_report

## Visão Geral

O relatório `balance_report` apresenta o balanço contábil consolidado do fundo entre duas datas de referência. Ele exibe, para cada conta do plano de contas, o saldo inicial (Data de Início), os movimentos de débito e crédito ocorridos no período e o saldo final (Data Final). O relatório organiza as contas em uma estrutura hierárquica (grupos e subgrupos) e inclui totalizadores para ativo, passivo, patrimônio líquido, receitas, despesas e compensações. Administradores e analistas utilizam este relatório para verificar a consistência contábil e auditar a evolução do balanço do fundo.

## O que você precisa informar

| Variável | Obrigatória | Descrição |
|----------|-------------|-----------|
| `fund_class_key` | sim | Identificador da classe de fundo sobre a qual o relatório é gerado. |
| `start_date` | sim | Data de início do período, no formato `AAAA-MM-DD`. |
| `end_date` | sim | Data de fim do período, no formato `AAAA-MM-DD`. Precisa ser **posterior** à data de início. |

:::warning É preciso haver contabilidade fechada nas duas datas
O relatório só é gerado se existir fechamento contábil na data de início **e** na data de fim. Sem isso a solicitação é recusada com a mensagem "Não existe contabil na data ...".
:::

:::warning As duas datas têm de estar no mesmo exercício contábil
Além de existir fechamento nas duas datas, elas precisam pertencer ao **mesmo exercício** (mesmo *ledger*). Um período que atravessa o encerramento de exercício faz a geração falhar.
:::

## Estrutura do Arquivo

| Atributo | Valor |
|----------|-------|
| Formato | XLSX |
| Nomenclatura | `{nome_resumido_fundo}_balance_report_{YYYY-MM-DD}.xlsx` |

## Conteúdo da Planilha

### Cabeçalho do Fundo

Apresentado nas primeiras linhas da planilha:

| Campo | Descrição |
|-------|-----------|
| Nome do Fundo | Nome completo da classe de fundo. |
| CNPJ do Fundo | CNPJ da classe de fundo. |
| Data de Início | Data de início do período no formato `YYYY-MM-DD`. |
| Data Final | Data de fim do período no formato `YYYY-MM-DD`. |
| Total do Ativo | Soma do saldo final das contas de ativo. |
| Total do Passivo | Soma do saldo final das contas de passivo. |
| Total de PL | Saldo final das contas de patrimônio líquido. |
| Total de Receitas | Saldo final das contas de receita. |
| Total de Despesas | Saldo final das contas de despesa. |
| Total de Compensação Ativa | Saldo final das contas de compensação ativa (grupo 3). |
| Total de Compensação Passiva | Saldo final das contas de compensação passiva (grupo 9). |
| PL por Contas Patrimoniais | `Total do Ativo - Total do Passivo` |
| PL por Contas de Resultado | `Total de PL + Total de Receitas + Total de Despesas` |
| Bate Compensação | `Total de Compensação Ativa - Total de Compensação Passiva` |

:::note Os totais são fórmulas do Excel
As células do cabeçalho não são valores fixos: elas referenciam as linhas de total da tabela de contas (por exemplo, `Total do Ativo` é `=G20`). Ao abrir o arquivo, o Excel recalcula tudo — e, se você editar a tabela, os totais acompanham.
:::

### Tabela de Contas

Linhas organizadas hierarquicamente por número de conta, sem formatação especial — apenas a linha de cabeçalho da tabela vem em negrito:

| Coluna | Tipo | Formato / Exemplo | Descrição |
|--------|------|-------------------|-----------|
| `Número da Conta` | string | `"1.1.2.80.00.010.001-8"` | Número da conta no plano de contas, com dígito verificador. As linhas de grupo trazem o número do nível correspondente — por exemplo `1-7` (ATIVO) e `1.1-6` (DISPONIBILIDADES). |
| `Nome da Conta` | string | `"Conta Caixa - Banco Exemplo"` | Nome descritivo da conta contábil. |
| `Tipo da Conta` | string (enum) | `"A"` | Tipo da linha: `"A"` para conta analítica; `"S"` para conta sintética (agrupadora, exibida em negrito). |
| `Saldo em Término de {Data de Início}` | número | `40000.00` | Saldo da conta na Data de Início, em reais. Negativo indica saldo de natureza contrária à conta. |
| `Movimentos de Débito` | número | `5000.00` | Soma dos lançamentos a débito no período (em reais). O sinal segue a natureza da conta: positivo nas contas devedoras, negativo nas credoras. |
| `Movimentos de Crédito` | número | `0.00` | Soma dos lançamentos a crédito no período (em reais). Sinal invertido em relação à coluna de débito: negativo nas contas devedoras, positivo nas credoras. |
| `Saldo em Término de {Data Final}` | número | `45000.00` | Saldo da conta na Data Final, em reais. |

---

# Demonstrativo de Caixa

URL: /en/documentation/iaas/relatorios_dtvm/cash_account_demonstrative

## Visão Geral

O relatório `cash_account_demonstrative` é um extrato diário das movimentações e saldos das contas bancárias do fundo ao fim do dia. Ele é gerado uma vez por dia, após o encerramento do ciclo financeiro, e apresenta os saldos de abertura (D-1) e encerramento (D0) de cada conta, além de todas as transações ocorridas ao longo do dia. Gestores e administradores utilizam este relatório para conferir a posição de caixa e conciliar as movimentações financeiras do fundo.

O relatório pode ser gerado em modo de fundo único ou em modo multi-fundo. No modo multi-fundo, cada classe de fundo é apresentada em uma aba separada dentro da mesma planilha.

## O que você precisa informar

| Variável | Obrigatória | Descrição |
|----------|-------------|-----------|
| `fund_class_key` | sim | Identificador da classe de fundo sobre a qual o relatório é gerado. |
| `reference_date` | sim | Data de referência, no formato `AAAA-MM-DD`. |

## Estrutura do Arquivo

| Atributo | Valor |
|----------|-------|
| Formato | XLSX |
| Aba | `Demonstrativo de Caixa` (no modo multi-fundo, uma aba por fundo, nomeada com o nome do fundo) |
| Nomenclatura | `{nome_resumido_fundo}_cash_account_demonstrative_{AAAA-MM-DD}.xlsx` |

:::tip Versão para conciliação automatizada
Este relatório é uma planilha formatada para leitura. Para conciliar as movimentações de forma automatizada — com identificador de transação, tipo, status de conciliação e saldos antes e depois de cada lançamento — utilize o relatório [Movimentações de Caixa](/documentation/iaas/relatorios_dtvm/cash_account_demonstrative_movements), em CSV.
:::

## Conteúdo da Planilha

Cada aba da planilha (uma por fundo) contém as seguintes seções:

### Cabeçalho do Fundo

Apresentado no topo da aba, com as informações de identificação da classe de fundo:

| Campo | Descrição |
|-------|-----------|
| Data de referência | Data de referência do relatório no formato `YYYY-MM-DD`. |
| Nome da classe de fundo | Nome completo da classe de fundo. |
| CNPJ da classe de fundo | CNPJ da classe de fundo. |
| Nome da gestora | Nome da gestora responsável pelo fundo. |
| CNPJ da gestora | CNPJ da gestora responsável pelo fundo. |

### Extrato por Conta Bancária

Abaixo do cabeçalho, sob o título **Extrato**, é exibida uma tabela por conta bancária do fundo, com as seguintes colunas:

| Coluna | Tipo | Formato / Exemplo | Descrição |
|--------|------|-------------------|-----------|
| `Data de referência` | data | `2026-07-29` | Data de referência do relatório. |
| `Banco` | string | `"999 - BANCO EXEMPLO S.A."` | Código COMPE e nome da instituição financeira, no formato `{código} - {nome}`. |
| `Agência/Conta` | string | `"0001/4417206-9"` | Número da agência e da conta, no formato `{agência}/{conta}-{dígito}`. |
| `Descrição` | string | `"Liquidação de parcelas"` | Descrição da movimentação conforme o grupo de conciliação da transação. |
| `Valor (R$)` | número | `2417.86` | Valor da movimentação em reais. Valores negativos indicam saída de caixa. |

Cada tabela de conta exibe ainda três linhas de resumo, em negrito e com fundo cinza. Nessas linhas, o rótulo (`Saldo D-1`, `Total`, `Saldo D0`) ocupa a primeira coluna, no lugar da data de referência:

| Linha | Posição | Descrição |
|-------|---------|-----------|
| **Saldo D-1** | primeira linha da tabela | Saldo da conta ao início do dia (encerramento do dia anterior). |
| **Total** | após as movimentações | Soma de todas as movimentações do dia para a conta. |
| **Saldo D0** | última linha da tabela | Saldo da conta ao encerramento do dia de referência. |

---

# Movimentações de Caixa

URL: /en/documentation/iaas/relatorios_dtvm/cash_account_demonstrative_movements

## Visão Geral

O relatório `cash_account_demonstrative_movements` lista, transação a transação, todas as movimentações das contas bancárias do fundo na data de referência. É a versão tabular do [Demonstrativo de Caixa](/documentation/iaas/relatorios_dtvm/cash_account_demonstrative): enquanto o demonstrativo é uma planilha formatada para leitura, este arquivo é um CSV pensado para conciliação automatizada, com o identificador de cada transação, o tipo, o status de conciliação e os saldos antes e depois do lançamento.

:::info Janela do dia
São consideradas as transações registradas entre 03:00 (UTC) da data de referência e 03:00 (UTC) do dia seguinte — ou seja, o dia inteiro no horário de Brasília. As linhas vêm ordenadas por data e hora da transação.
:::

## O que você precisa informar

| Variável | Obrigatória | Descrição |
|----------|-------------|-----------|
| `fund_class_key` | sim | Identificador da classe de fundo sobre a qual o relatório é gerado. |
| `reference_date` | sim | Data de referência, no formato `AAAA-MM-DD`. |

## Estrutura do Arquivo

| Atributo | Valor |
|----------|-------|
| Formato | CSV |
| Encoding | UTF-8 |
| Delimitador | `,` (vírgula) |
| Cabeçalho | Sim (primeira linha) |
| Nomenclatura | `{nome_resumido_fundo}_cash_account_demonstrative_movements_{AAAA-MM-DD}.csv` |

:::warning Valores em centavos
As colunas `amount`, `previous_balance` e `post_balance` são números **inteiros em centavos** — `241786` significa R$ 2.417,86. Diferente dos demais relatórios, que trazem valores em reais.
:::

## Colunas

| Coluna | Tipo | Formato / Exemplo | Descrição |
|--------|------|-------------------|-----------|
| `fund_class_name` | string | `"FUNDO EXEMPLO FIDC RESPONSABILIDADE LIMITADA"` | Nome da classe de fundo. |
| `fund_class_document_number` | string | `"12.345.678/0001-99"` | CNPJ da classe de fundo. |
| `account_number` | string | `"4417206"` | Número da conta bancária, sem o dígito. |
| `account_digit` | string | `"9"` | Dígito verificador da conta. |
| `account_branch` | string | `"0001"` | Agência da conta. |
| `if_name` | string | `"BANCO EXEMPLO S.A."` | Nome da instituição financeira. |
| `if_code` | string | `"999"` | Código COMPE da instituição financeira. |
| `if_ispb` | string | `"99999999"` | ISPB da instituição financeira. |
| `transaction_key` | string | `"30c40d50-0001-4ddd-9444-000000000401"` | Identificador único da transação na QI CTVM (UUID). |
| `external_key` | string | `"40d50e60-0001-4eee-9555-000000000501"` | Identificador da transação na instituição financeira de origem. |
| `transaction_description` | string | `"Liquidação de parcelas de CCB"` | Descrição da transação conforme informada pela instituição financeira. |
| `transaction_type` | string (enum) | `"incoming_pix"` | Tipo da transação. Ver [tabela de tipos](#tipos-de-transação). |
| `transaction_status` | string (enum) | `"reconciled"` | Status de conciliação: `created`, `pending_conciliation` ou `reconciled`. |
| `amount` | inteiro (centavos) | `241786` | Valor da transação. Negativo indica saída de caixa. |
| `previous_balance` | inteiro (centavos) | `52811947` | Saldo da conta antes da transação. |
| `post_balance` | inteiro (centavos) | `53053733` | Saldo da conta após a transação. |
| `transaction_datetime` | data | `2026-07-29` | Data e hora da transação. **No arquivo, o campo é exportado apenas com a data**, no formato `AAAA-MM-DD`. |
| `accounting_date` | data | `2026-07-29` | Data contábil atribuída à transação. |
| `conciliation_description` | string | `"Liquidação de parcelas"` | Descrição do grupo de conciliação ao qual a transação foi associada. Vazio enquanto a transação não é conciliada. |

## Tipos de transação

| Valor | Descrição |
|-------|-----------|
| `incoming_pix` | Pix recebido. |
| `outgoing_pix` | Pix enviado. |
| `incoming_wire_transfer` | TED recebida. |
| `outgoing_wire_transfer` | TED enviada. |
| `outgoing_bank_slip_payment` | Pagamento de boleto. |
| `incoming_bank_slip_payment_reversal` | Estorno de pagamento de boleto. |
| `outgoing_bankslip_registration` | Custo de registro de boleto. |
| `outgoing_bankslip_payment` | Custo de pagamento de boleto. |
| `outgoing_bankslip_due_date_extension` | Custo de prorrogação de vencimento de boleto. |
| `outgoing_bankslip_permanence` | Custo de permanência de boleto. |
| `outgoing_bankslip_rebate` | Custo de abatimento de boleto. |
| `outgoing_bankslip_write_off` | Custo de baixa de boleto. |

---

# Aquisição Consolidada de Direitos Creditórios

URL: /en/documentation/iaas/relatorios_dtvm/consolidated_credit_rights_acquisition_assets

## Visão Geral

O relatório `consolidated_credit_rights_acquisition_assets` lista os direitos creditórios adquiridos pelo fundo na data de referência, com os valores de compra, o spread e as características da operação. Em um único arquivo, ele reúne as duas naturezas de ativo:

- **operações de crédito** (ex: CCB) — uma linha por **parcela** adquirida;
- **direitos creditórios descontados** (ex: duplicatas) — uma linha por **ativo**, já que não têm parcelas.

Este relatório substitui os antigos `credit_rights_acquisition_assets`, `credit_rights_acquisition_installments` e `discounted_credit_rights_acquisition_assets`, que deixaram de ser entregues.

:::tip Também em PDF
Este relatório está descrito em linguagem de negócio no [Manual de Relatórios QI Tech](./manual_relatorios_qi_tech.pdf) — revisão 2, julho de 2026. O manual cobre quatro relatórios: este, a [Composição de Ativos da Cessão](/documentation/iaas/relatorios_dtvm/assignment_assets_wallet_composition), a [Composição de Carteira de Ativos](/documentation/iaas/relatorios_dtvm/assets_wallet_composition) e a [Conciliação Consolidada de Direitos Creditórios](/documentation/iaas/relatorios_dtvm/consolidated_credit_rights_conciliation_assets).
:::

## O que você precisa informar

| Variável | Obrigatória | Descrição |
|----------|-------------|-----------|
| `fund_class_key` | sim | Identificador da classe de fundo sobre a qual o relatório é gerado. |
| `reference_date` | sim | Data de referência, no formato `AAAA-MM-DD`. |

## Estrutura do Arquivo

| Atributo | Valor |
|----------|-------|
| Formato | CSV |
| Encoding | UTF-8 |
| Delimitador | `,` (vírgula) |
| Cabeçalho | Sim (primeira linha) |
| Nomenclatura | `{nome_resumido_fundo}_consolidated_credit_rights_acquisition_assets_{YYYY-MM-DD}.csv` |

## O que o relatório traz

- Os ativos comprados na data de referência (`purchase_date` igual à data informada).
- Ativos inativos são excluídos.
- Campos sem valor vêm **vazios** no arquivo.

:::info Fundos de cota de abertura
Para os fundos que operam com relatório de cota de abertura, o ramo de direitos creditórios descontados usa o **dia útil imediatamente anterior** à data de referência, enquanto o ramo de operações de crédito usa a própria data. As duas naturezas convivem no mesmo arquivo com datas de referência diferentes.
:::

## Colunas

| Coluna | Tipo | Formato / Exemplo | Descrição |
|--------|------|-------------------|-----------|
| `reference_date` | data | `2026-07-29` | Data de compra do ativo. |
| `fund_class_name` | string | `"FUNDO EXEMPLO FIDC RESPONSABILIDADE LIMITADA"` | Nome da classe de fundo. |
| `fund_class_document_number` | string | `"12.345.678/0001-99"` | CNPJ da classe de fundo. |
| `originator_name` | string | `"ORIGINADOR EXEMPLO S.A."` | Nome da empresa originadora do ativo. |
| `originator_document_number` | string | `"11.222.333/0001-44"` | CNPJ do originador. |
| `assignor_name` | string | `"CEDENTE EXEMPLO S.A."` | Nome do cedente. |
| `assignor_document_number` | string | `"22.333.444/0001-55"` | CNPJ do cedente. |
| `borrower_name` | string | `"MARIA APARECIDA DE SOUZA"` | Nome do devedor (tomador do crédito) ou do sacado. |
| `borrower_document_number` | string | `"123.456.789-00"` | CPF ou CNPJ do devedor/sacado. |
| `asset_type` | string (enum) | `"ccb"`, `"duplicata_mercantil"`, `"duplicata_servicos"` | Tipo do ativo. Determina qual dos dois ramos originou a linha. |
| `has_assignor_coobligation` | booleano | `False` | Indica se há coobrigação do cedente. |
| `asset_key` | string | `"1a2b3c40-0001-4aaa-9111-000000000101"` | Chave interna do ativo gerada pela QI Tech (UUID). |
| `contract_number` | string | `"0900112233/EXA"` | Número do contrato (operação de crédito) ou do pedido (direito creditório descontado). Para direito creditório descontado sem número de pedido, cai no número do contrato. |
| `external_id` | string | `"10a20b30-0001-4bbb-9222-000000000201"` | Identificador externo do ativo. |
| `installment_number` | número | `1` | Número da parcela. Para direito creditório descontado, sempre `1`. |
| `issue_date` | data | `2026-07-28` | Data de emissão do contrato. Para direito creditório descontado, vem `-`. |
| `purchase_date` | data | `2026-07-29` | Data de compra do ativo pelo fundo. |
| `installment_maturity_date` | data | `2026-08-28` | Data de vencimento da parcela. Para direito creditório descontado, é o vencimento do próprio ativo. |
| `total_purchase_value` | número | `4712.35` | Valor total pago pelo ativo, incluindo encargos (em reais). Repete-se em todas as parcelas do mesmo ativo. |
| `asset_purchase_value` | número | `4690.8` | Valor do ativo sem encargos e sem spread (em reais). |
| `installment_purchase_value` | número | `1598.7421` | Valor de compra da parcela (em reais). Para direito creditório descontado, é igual ao `total_purchase_value`. |
| `principal_value` | número | `1480.12` | Valor de principal da parcela (em reais). Para direito creditório descontado, vem **vazio**. |
| `face_value` | número | `1678.9` | Valor de face da parcela ou do ativo (em reais). |
| `index` | string (enum) | `"pre_fixed"` | Indexador / tipo de taxa de juros. Para direito creditório descontado, sempre `pre_fixed`. |
| `index_calendar_base` | string (enum) | `"calendar_365"`, `"calendar_360"`, `"workdays"` | Base de calendário usada na apropriação de juros. Para direito creditório descontado, sempre `workdays`. |
| `monthly_rate` | string | `"0.0231"` | Taxa mensal pré-fixada do contrato. Para direito creditório descontado, traz a **taxa de compra do recebível (TIR)**, e não uma taxa mensal — no exemplo, `0.19842300000000`. |
| `calendar_base` | string (enum) | `"calendar_365"` | Base de calendário do pré-fixado. Para direito creditório descontado, sempre `workdays`. |
| `iof_value` | string | `"52.40"` | Valor de IOF do contrato. Para direito creditório descontado, vem `-`. |
| `maturity_date` | data | `2026-10-28` | Data de vencimento final do ativo. |
| `total_purchase_spread` | número | `21.55` | Spread de aquisição (`total_purchase_value − asset_purchase_value`), em reais. **Nunca negativo**: quando a diferença é menor que zero, o campo vem `0`. |

:::note Como cruzar as linhas de um mesmo ativo
As parcelas de uma operação de crédito repetem `asset_key`, `external_id` e `contract_number`, e variam apenas em `installment_number`, `installment_maturity_date`, `installment_purchase_value`, `principal_value` e `face_value`. Os valores de nível de ativo (`total_purchase_value`, `asset_purchase_value`, `total_purchase_spread`) se repetem em todas as parcelas — **não devem ser somados** por linha.
:::

---

# Conciliação Consolidada de Direitos Creditórios

URL: /en/documentation/iaas/relatorios_dtvm/consolidated_credit_rights_conciliation_assets

## Visão Geral

O relatório `consolidated_credit_rights_conciliation_assets` lista os eventos de pagamento dos direitos creditórios registrados em uma data contábil, mostrando o efeito de cada pagamento sobre o valor do ativo: valor antes, valor depois, redução e resultado contábil apurado. Em um único arquivo, ele reúne as duas naturezas de ativo:

- **operações de crédito** (ex: CCB);
- **direitos creditórios descontados** (ex: duplicatas).

Este relatório substitui os antigos `credit_rights_conciliation_assets`, `credit_rights_conciliation_installments` e `discounted_credit_rights_conciliation_assets`, que deixaram de ser entregues.

:::tip Também em PDF
Este relatório está descrito em linguagem de negócio no [Manual de Relatórios QI Tech](./manual_relatorios_qi_tech.pdf) — revisão 2, julho de 2026. O manual cobre quatro relatórios: este, a [Composição de Ativos da Cessão](/documentation/iaas/relatorios_dtvm/assignment_assets_wallet_composition), a [Composição de Carteira de Ativos](/documentation/iaas/relatorios_dtvm/assets_wallet_composition) e a [Aquisição Consolidada de Direitos Creditórios](/documentation/iaas/relatorios_dtvm/consolidated_credit_rights_acquisition_assets).
:::

## O que você precisa informar

| Variável | Obrigatória | Descrição |
|----------|-------------|-----------|
| `fund_class_key` | sim | Identificador da classe de fundo sobre a qual o relatório é gerado. |
| `reference_date` | sim | Data de referência, no formato `AAAA-MM-DD`. |

## Estrutura do Arquivo

| Atributo | Valor |
|----------|-------|
| Formato | CSV |
| Encoding | UTF-8 |
| Delimitador | `,` (vírgula) |
| Cabeçalho | Sim (primeira linha) |
| Nomenclatura | `{nome_resumido_fundo}_consolidated_credit_rights_conciliation_assets_{YYYY-MM-DD}.csv` |

## O que o relatório traz

- Os eventos de pagamento cuja data contábil é a data de referência.
- Considera os ativos nas situações **ativo**, **vendido**, **liquidado** e **baixado**.
- Cada linha é **um evento de pagamento** — um mesmo ativo pode aparecer em várias linhas no mesmo dia.

:::info Campos sem valor vêm como `-`
Diferente dos outros relatórios em CSV, este preenche os campos nulos com `-` em vez de deixá-los vazios.
:::

:::info Fundos de cota de abertura
Para os fundos que operam com relatório de cota de abertura, o ramo de direitos creditórios descontados usa o **dia anterior** à data de referência, enquanto o ramo de operações de crédito usa a própria data.
:::

## Colunas

| Coluna | Tipo | Formato / Exemplo | Descrição |
|--------|------|-------------------|-----------|
| `reference_date` | data | `2026-07-29` | Data contábil do evento de pagamento. |
| `fund_class_name` | string | `"FUNDO EXEMPLO FIDC RESPONSABILIDADE LIMITADA"` | Nome da classe de fundo. |
| `fund_class_document_number` | string | `"12.345.678/0001-99"` | CNPJ da classe de fundo. |
| `originator_name` | string | `"ORIGINADOR EXEMPLO S.A."` | Nome da empresa originadora do ativo. |
| `originator_document_number` | string | `"11.222.333/0001-44"` | CNPJ do originador. |
| `assignor_name` | string | `"CEDENTE EXEMPLO S.A."` | Nome do cedente. |
| `assignor_document_number` | string | `"22.333.444/0001-55"` | CNPJ do cedente. |
| `borrower_name` | string | `"MARIA APARECIDA DE SOUZA"` | Nome do devedor (tomador do crédito) ou do sacado. |
| `borrower_document_number` | string | `"123.456.789-00"` | CPF ou CNPJ do devedor/sacado. |
| `asset_type` | string (enum) | `"ccb"`, `"duplicata_mercantil"`, `"duplicata_servicos"` | Tipo do ativo. Determina qual dos dois ramos originou a linha. |
| `asset_key` | string | `"1a2b3c40-0003-4aaa-9111-000000000103"` | Chave interna do ativo gerada pela QI Tech (UUID). |
| `external_id` | string | `"10a20b30-0003-4bbb-9222-000000000203"` | Identificador externo do ativo. |
| `contract_number` | string | `"0900098765/EXC"` | Número do contrato (operação de crédito) ou do pedido (direito creditório descontado). Para direito creditório descontado sem número de pedido, cai no número do contrato. |
| `maturity_date` | data | `2027-01-11` | Data de vencimento final do ativo. |
| `total_purchase_value` | número | `5324.8` | Valor total pago pelo fundo na aquisição do ativo (em reais). |
| `purchase_date` | data | `2026-01-12` | Data de aquisição do ativo pelo fundo. |
| `internal_rate_of_return` | número | `0.0231` | Taxa interna de retorno do ativo. Operação de crédito: taxa corrente. Direito creditório descontado: taxa de compra do recebível. |
| `payment_date` | data | `2026-07-29` | Data contábil do pagamento. Traz sempre o mesmo valor de `reference_date`. |
| `payment_amount` | número | `512.68` | Valor pago no evento (em reais). |
| `payment_key` | string | `"20b30c40-0001-4ccc-9333-000000000301"` | Chave interna do evento de pagamento gerada pela QI Tech (UUID). |
| `payment_type` | string (enum) | `"installment_settlement"`, `"installment_amortization"`, `"asset_settlement"`, `"asset_amortization"`, `"fine_payment"`, `"gloss"`, ... | Tipo do pagamento. |
| `payment_event_type` | string (enum) | `"settlement"`, `"substitution"`, `"repurchase"`, `"unperformed"` | Natureza do evento que originou o pagamento: liquidação, substituição, recompra ou inadimplemento. Eventos anteriores à criação deste campo vêm como `-`. |
| `old_asset_current_value` | número | `5361.42` | Valor contábil do ativo imediatamente **antes** do evento (em reais). |
| `new_asset_current_value` | número | `4890.33` | Valor contábil do ativo imediatamente **depois** do evento (em reais). |
| `asset_reduction_value` | número | `471.09` | Redução do valor contábil do ativo (`old − new`), em reais. |
| `result_value` | número | `41.59` | Resultado contábil apurado no evento (em reais). |
| `written_off_accounting_result_value` | número inteiro | `0` | Resultado contábil de baixa (*write-off*) associado ao evento, **em centavos** — este é o único campo monetário do arquivo que não é convertido para reais. Para direito creditório descontado, sempre `0`. |
| `installment_number` | string | `"1"` | Número da parcela liquidada. Para direito creditório descontado, é o sufixo do número do pedido quando ele existe (`8977-3` → `3`); caso contrário, `-`. |

:::tip Conferindo o resultado do dia
A soma de `result_value` é o resultado contábil reconhecido pelos direitos creditórios na data, e deve fechar com as contas de receita correspondentes no [Relatório de Balanço](/documentation/iaas/relatorios_dtvm/balance_report) e na [Razão Contábil](/documentation/iaas/relatorios_dtvm/accounting_ledger). A soma de `asset_reduction_value` é a variação do estoque explicada por pagamentos no dia.
:::

---

# Relatórios DTVM

URL: /en/documentation/iaas/relatorios_dtvm/

Os relatórios DTVM fornecem uma visão detalhada das operações e posições financeiras dos fundos de investimento administrados pela QI CTVM. Eles são destinados a gestores e analistas que precisam acompanhar a composição da carteira, as aquisições e liquidações de ativos, e a movimentação de caixa do fundo em cada data de referência.

## Exemplos de relatórios

Baixe exemplos de todos os relatórios disponíveis: [example_reports.zip](./example_reports.zip)

O pacote contém um arquivo de cada relatório, gerado pelo mesmo código que produz os arquivos em produção, com dados fictícios. Os exemplos são consistentes entre si: descrevem o mesmo fundo (`FUNDO EXEMPLO FIDC RESPONSABILIDADE LIMITADA`), na mesma data de referência (`2026-07-29`), e fecham entre si — o patrimônio líquido, o saldo de caixa e a posição por classe de ativo são os mesmos em todos os arquivos que trazem esses números.

## Nomenclatura dos arquivos

Todos os arquivos seguem o padrão `{nome_resumido_fundo}_{modelo}_{data_de_referência}.{extensão}`, onde:

- **nome resumido do fundo** é o identificador curto acordado com a QI CTVM na configuração da entrega (nos exemplos, `example_name`);
- **modelo** é o nome do relatório, conforme a coluna "Modelo" da tabela abaixo;
- **data de referência** está no formato `AAAA-MM-DD`.

Há três exceções ao padrão: o `wallet_composition_by_composition` é entregue como `wallet_composition` (sem o sufixo do modelo); o `assignment_assets_wallet_composition` acrescenta o identificador da cessão ao final do nome; e o `assignment_documents` coloca o identificador da cessão **antes** da data, que nele é a data de geração do arquivo.

:::info Relatórios de período
`quota_mec`, `balance_report` e `accounting_ledger` são gerados a partir de um intervalo (`start_date` / `end_date`), e não de uma única data. Nesses casos, a data no nome do arquivo é a data de referência da entrega.
:::

## Convenções dos arquivos CSV

Valem para todos os relatórios em CSV:

| Atributo | Padrão |
|----------|--------|
| Encoding | UTF-8, **sem BOM** |
| Delimitador | `,` (vírgula) |
| Separador decimal | `.` (ponto) |
| Fim de linha | `CRLF` (`\r\n`) |
| Cabeçalho | sempre presente, na primeira linha, com os nomes das colunas em minúsculas |

:::note Delimitador e separador decimal são configuráveis
Se o seu processo exigir `;` como delimitador ou `,` como separador decimal, a QI CTVM pode configurar isso por fundo na entrega. Sem configuração específica, valem os padrões da tabela acima. A exceção é o `quota_mec` em CSV, que usa `;` por definição do relatório.
:::

## Entrega via SFTP

Os relatórios são disponibilizados diariamente via SFTP (Secure File Transfer Protocol). Cada arquivo é gravado na pasta configurada para o fundo, com exatamente o nome descrito acima. Para instruções de conexão, credenciais e exemplos de código para download, consulte a [documentação de integração SFTP](/documentation/iaas/integracao_sftp/inicio).

Os relatórios que entram na rotina diária são definidos por fundo, na configuração da entrega. Para incluir ou remover um relatório da rotina, entre em contato com o time de integração.

## Relatórios disponíveis

| Relatório | Descrição | Modelo | Formato do arquivo |
|-----------|-----------|--------|-------------------|
| [Composição de Carteira de Ativos](/documentation/iaas/relatorios_dtvm/assets_wallet_composition) | Posição completa de todos os ativos que compõem o estoque do fundo em uma data de referência, ativo a ativo. | `assets_wallet_composition` | CSV |
| [Composição de Ativos da Cessão](/documentation/iaas/relatorios_dtvm/assignment_assets_wallet_composition) | Ativos de uma cessão específica, no mesmo formato da composição de carteira. Gerado sob demanda, por cessão. | `assignment_assets_wallet_composition` | CSV |
| [Lastros da Cessão](/documentation/iaas/relatorios_dtvm/assignment_documents) | Documentos comprobatórios dos ativos de uma cessão, com link de download por arquivo. Gerado sob demanda, por cessão. | `assignment_documents` | CSV |
| [Composição da Carteira](/documentation/iaas/relatorios_dtvm/wallet_composition) | Carteira consolidada do fundo ao fim do dia, por classe de ativo, com séries de emissão, valores a pagar e a receber, caixa, rentabilidade e resultado. | `wallet_composition_by_composition` | XLSX |
| [Aquisição Consolidada de Direitos Creditórios](/documentation/iaas/relatorios_dtvm/consolidated_credit_rights_acquisition_assets) | Direitos creditórios adquiridos em um dia — operações de crédito por parcela e direitos creditórios descontados por ativo, no mesmo arquivo. | `consolidated_credit_rights_acquisition_assets` | CSV |
| [Conciliação Consolidada de Direitos Creditórios](/documentation/iaas/relatorios_dtvm/consolidated_credit_rights_conciliation_assets) | Eventos de pagamento dos direitos creditórios em uma data contábil, com o efeito de cada pagamento sobre o valor do ativo. | `consolidated_credit_rights_conciliation_assets` | CSV |
| [Demonstrativo de Caixa](/documentation/iaas/relatorios_dtvm/cash_account_demonstrative) | Extrato diário das movimentações e saldos das contas bancárias do fundo. | `cash_account_demonstrative` | XLSX |
| [Movimentações de Caixa](/documentation/iaas/relatorios_dtvm/cash_account_demonstrative_movements) | Mesma movimentação do demonstrativo de caixa em formato tabular, transação a transação, para conciliação automatizada. | `cash_account_demonstrative_movements` | CSV |
| [Cotas MEC](/documentation/iaas/relatorios_dtvm/quota_mec) | Evolução diária de cotas, patrimônio e rentabilidade das séries de emissão. | `quota_mec` | XLSX ou CSV |
| [Relatório de Balanço](/documentation/iaas/relatorios_dtvm/balance_report) | Balanço contábil consolidado do fundo com saldos e movimentações por conta. | `balance_report` | XLSX |
| [Razão Contábil](/documentation/iaas/relatorios_dtvm/accounting_ledger) | Razão contábil detalhado com todos os lançamentos por conta no período. | `accounting_ledger` | XLSX |
| [XML ANBIMA (tipos 5 e 401)](/documentation/iaas/relatorios_dtvm/xml_anbima) | Arquivos de posição no padrão ANBIMA, gerados a partir da composição da carteira. | `xml_5_by_composition` `xml_401_by_composition` | XML |

---

# Cotas MEC

URL: /en/documentation/iaas/relatorios_dtvm/quota_mec

## Visão Geral

O relatório `quota_mec` apresenta a evolução diária das cotas e do patrimônio do fundo em um intervalo de datas, calculada com base nos fechamentos de série de emissão. Cada linha representa um dia útil de uma série de emissão, contendo valores de patrimônio bruto e líquido, cota de fechamento, movimentações de aplicação e resgate, come-cotas e rentabilidade acumulada diária, mensal e anual. Gestores e administradores utilizam este relatório para acompanhar a performance do fundo e enviar informações regulatórias ao MEC (Método de Envio de Cota).

O relatório pode ser gerado nos formatos XLSX (uma aba por classe de fundo) ou CSV. O CSV só é aceito quando o pedido cobre **uma única classe de fundo**.

## O que você precisa informar

| Variável | Obrigatória | Descrição |
|----------|-------------|-----------|
| `fund_class_key` | sim | Identificador da classe de fundo sobre a qual o relatório é gerado. |
| `start_date` | sim | Data de início do período, no formato `AAAA-MM-DD`. |
| `end_date` | sim | Data de fim do período, no formato `AAAA-MM-DD`. Não pode ser anterior à data de início. |
| `include_secondary_market` | não | Booleano. Quando omitido, vale `true`. |
| `file_format` | não | `xlsx` (padrão) ou `csv`. Qualquer outro valor é recusado. |
| `issuance_serie_key` | não | Restringe o arquivo a uma única série de emissão. |

:::warning É preciso haver cota no período
O relatório só é gerado se ao menos uma série de emissão da classe tiver valor de cota (de abertura ou de fechamento) dentro do intervalo. Sem isso a solicitação é recusada.
:::

## Estrutura do Arquivo

| Atributo | Valor |
|----------|-------|
| Formato | XLSX ou CSV |
| Encoding | UTF-8 |
| Delimitador (CSV) | `;` (ponto e vírgula) |
| Nomenclatura | `{nome_resumido_fundo}_quota_mec_{AAAA-MM-DD}.xlsx` (ou `.csv`) |

No XLSX, cada classe de fundo ocupa uma aba, nomeada com o nome do fundo (limitado a 31 caracteres pelo Excel), o cabeçalho vem em português e as linhas em ordem cronológica crescente. Datas são apresentadas no formato `DD/MM/AAAA`.

:::info Variação no formato CSV
O CSV é gerado apenas para uma classe de fundo por arquivo e difere do XLSX em dois pontos: o cabeçalho vem com os **nomes técnicos em inglês** (`fund_class_name`, `fund_class_document_number`, `sub_class_name`, `issuance_serie_name`, `accounting_date`, `gross_net_worth`, `gross_quota_value`, `performance_fee_current_value`, `net_net_worth`, `net_quota_value`, `final_net_worth`, `final_quota_value`, `total_net_worth`, `issued_quotas`, `total_daily_applications`, `redeemed_quotas`, `total_daily_redemptions`, `tax_anticipated_quotas`, `total_daily_tax_anticipations`, `total_daily_amortizations`, `daily_rentability`, `monthly_rentability`, `yearly_rentability`), na mesma ordem da tabela abaixo; e as linhas vêm em ordem **cronológica decrescente**, da data mais recente para a mais antiga.
:::

## Colunas

| Coluna | Tipo | Formato / Exemplo | Descrição |
|--------|------|-------------------|-----------|
| `Nome do Fundo` | string | `"FUNDO EXEMPLO FIDC RESPONSABILIDADE LIMITADA"` | Nome da classe de fundo. |
| `CNPJ do Fundo` | string | `"12.345.678/0001-99"` | CNPJ da classe de fundo. |
| `Sub Classe` | string | `"SUBORDINADA"` | Nome da subclasse do fundo. |
| `Série de Emissão` | string | `"PRIMEIRA"` | Nome da série de emissão. |
| `Data de Referência` | data | `29/07/2026` | Data contábil de referência (apenas dias úteis). |
| `Patrimônio Bruto` | número | `10500000.00` | Patrimônio líquido bruto antes da provisão de taxa de performance (em reais). |
| `Cota Bruta` | número | `1.050000` | Valor da cota bruta antes da taxa de performance. |
| `Taxa de Performance` | número | `5000.00` | Valor corrente da taxa de performance provisionada (em reais). |
| `PL Pré Movimentação` | número | `10495000.00` | Patrimônio líquido antes das movimentações do dia (em reais). |
| `Cota Pré Movimentação` | número | `1.049500` | Valor da cota antes das movimentações do dia. |
| `PL de Fechamento` | número | `10495000.00` | Patrimônio líquido de fechamento antes das amortizações (em reais). |
| `Cota de Fechamento` | número | `1.049500` | Valor da cota de fechamento antes das amortizações. |
| `PL Pós Movimentações` | número | `10490000.00` | Patrimônio líquido total após todas as movimentações do dia (em reais). |
| `Cotas Integralizadas` | número | `1000.00000` | Quantidade de cotas emitidas (aplicadas) no dia. |
| `Total Aplicado` | número | `1049500.00` | Valor total aplicado no dia (em reais). |
| `Cotas Resgatadas` | número | `500.00000` | Quantidade de cotas resgatadas no dia. |
| `Total Resgatado` | número | `524750.00` | Valor total resgatado no dia (em reais). |
| `Come-cotas` | número | `200.00000` | Quantidade de cotas consumidas pela antecipação de IR (come-cotas). |
| `Total de Come-cotas` | número | `200.00` | Valor total do come-cotas do dia (em reais). |
| `Total Amortizado` | número | `0.00` | Valor total amortizado no dia (em reais). |
| `Rentabilidade Diária` | número | `0.000420` | Rentabilidade do dia, calculada como `(cota_pré_movimentação / cota_fechamento_anterior) - 1`. |
| `Rentabilidade Mensal` | número | `0.005200` | Rentabilidade acumulada no mês corrente (base composta). Reinicia no início de cada mês. |
| `Rentabilidade Anual` | número | `0.063000` | Rentabilidade acumulada no ano corrente (base composta). Reinicia no início de cada ano. |

---

# Composição da Carteira

URL: /en/documentation/iaas/relatorios_dtvm/wallet_composition

## Visão Geral

O relatório `wallet_composition_by_composition` é a foto consolidada da carteira do fundo ao fim do dia. Ele reúne, em uma única planilha, o patrimônio e a cota de cada série de emissão, a posição por classe de ativo (títulos públicos, emissões, operações de crédito, direitos creditórios descontados, cotas de fundo, swaps e imóveis), os valores a pagar e a receber, os saldos de caixa e a rentabilidade das séries — sempre com o percentual que cada linha representa do patrimônio líquido.

É o relatório usado por gestores e administradores para conferir o fechamento do dia: o somatório das seções de ativos, menos os valores a pagar e mais os valores a receber, reconcilia com o patrimônio líquido informado no cabeçalho.

:::info Base do relatório
O relatório é gerado a partir de uma **composição** de carteira já fechada — confirmada ou aguardando confirmação. Por padrão é usada a composição de cota de fechamento (`final_quota`); mediante configuração, também pode ser gerado sobre a composição de cota de abertura (`opening_quota`) ou pré-cota (`pre_quota`).
:::

## O que você precisa informar

| Variável | Obrigatória | Descrição |
|----------|-------------|-----------|
| `fund_class_key` | sim | Identificador da classe de fundo sobre a qual o relatório é gerado. |
| `reference_date` | sim, se não informar `composition_key` | Data de referência, no formato `AAAA-MM-DD`. |
| `composition_key` | alternativa à data | Identificador de uma composição específica. |
| `composition_type` | não | `final_quota` (padrão), `opening_quota` ou `pre_quota`. Qualquer outro valor é recusado. |

:::warning É preciso existir composição na data
Se não houver composição do tipo pedido na data de referência, a solicitação é recusada com a mensagem "Não existe composition para esta 'reference_date'".
:::

## Estrutura do Arquivo

| Atributo | Valor |
|----------|-------|
| Formato | XLSX |
| Abas | `Sheet` (composição) e `P&L` (receitas e despesas do dia) |
| Nomenclatura | `{nome_resumido_fundo}_wallet_composition_{AAAA-MM-DD}.xlsx` |

:::note Nome do arquivo
O modelo a ser solicitado é `wallet_composition_by_composition`, mas o arquivo entregue é nomeado `wallet_composition`, sem o sufixo.
:::

Cada seção é apresentada com um título em negrito, uma linha de cabeçalho e, ao final, linhas de total por tipo de ativo e um total geral da seção — essas linhas de total aparecem em negrito e com fundo cinza. **Seções sem posição na data não são impressas**: um fundo que não tem imóveis, por exemplo, não terá a seção `IMÓVEIS`.

:::tip Como conferir o fechamento
Somando a coluna `% do PL` dos totais gerais de todas as seções — ativos, mais valores a receber, menos valores a pagar, mais caixa — o resultado é 100% do patrimônio líquido do cabeçalho.

Uma diferença pequena pode aparecer quando o fundo tem **emissões com ágio ainda não diferido**: na seção `EMISSÕES` o `Valor D0 (R$)` é apurado pelo valor contábil do papel, enquanto nas demais classes ele considera o valor justo. O ágio a diferir, nesse caso, fica fora da soma das seções, mas está dentro do patrimônio líquido.
:::

## Aba `Sheet`

### Cabeçalho do fundo

| Campo | Descrição |
|-------|-----------|
| Data de referência | Data da composição, no formato `AAAA-MM-DD`. |
| Nome da classe de fundo | Nome completo da classe de fundo. |
| CNPJ da classe de fundo | CNPJ da classe de fundo. |
| Nome da gestora | Nome da gestora do fundo. |
| CNPJ da gestora | CNPJ da gestora do fundo. |
| Patrimônio bruto (R$) | Soma do patrimônio bruto de todas as séries de emissão. |
| Patrimônio líquido (R$) | Soma do patrimônio líquido de todas as séries de emissão. É o denominador da coluna `% do PL` em todas as seções. |
| Número de cotas | Soma das cotas de todas as séries de emissão. |

### `SÉRIES DE EMISSÃO`

| Coluna | Descrição |
|--------|-----------|
| Nome | Nome da série de emissão. |
| Patrimônio bruto (R$) | Patrimônio bruto da série, antes da provisão de taxa de performance. |
| Cota bruta (R$) | Valor da cota bruta da série. |
| Patrimônio líquido (R$) | Patrimônio líquido da série. |
| Cota líquida (R$) | Valor da cota líquida da série. |
| Número de cotas | Quantidade de cotas da série. |

### `TÍTULOS PÚBLICOS`

Uma linha por título público em estoque (LFT, LTN, NTN-B e suas versões compromissadas).

| Coluna | Descrição |
|--------|-----------|
| Data de referência | Data da composição. |
| Identificador / Código SELIC | Código SELIC do título. |
| Tipo do ativo | `LFT`, `LTN`, `NTN-B`, `LFT COMPROMISSADA`, etc. |
| Emissor | `Tesouro Nacional`. |
| Tipo de amortização | `No vencimento` ou `Juros semestrais`. |
| Data de emissão / Data de compra / Data de vencimento | Datas do título e da aquisição. |
| Unidades compradas / Unidades atuais | Quantidade de títulos adquirida e em estoque. |
| PU de compra (R$) / PU D0 (R$) | Preço unitário de aquisição e preço unitário na data de referência. |
| Valor de compra (R$) / Valor D0 (R$) | Valor financeiro de aquisição e valor na data de referência. |
| % de Tesouros | Participação do título no total de títulos públicos. |
| % do PL | Participação do título no patrimônio líquido do fundo. |

### `EMISSÕES`

Uma linha por título privado ofertado (debênture, CRI, CRA, CDB, letra financeira). Notas comerciais são apresentadas em seção própria, com colunas equivalentes, em ordem própria.

| Coluna | Descrição |
|--------|-----------|
| Data de referência | Data da composição. |
| Identificador | Código externo do papel. |
| Tipo do ativo | `DEBENTURE`, `CRI`, `CRA`, `CDB`, `Letra Financeira`, `NOTA COMERCIAL`. |
| Código ISIN / Código B3 | Códigos de identificação do papel. |
| Emissor | Nome do emissor. |
| Data de emissão / Data de compra / Data de vencimento | Datas do papel e da aquisição. |
| Unidades compradas / Unidades atuais | Quantidade adquirida e em estoque. |
| PU de compra (R$) / PU do ativo (R$) / PU D0 (R$) | Preço unitário de aquisição, preço unitário contábil e preço unitário líquido de PDD. |
| Valor de compra (R$) / Valor do ativo (R$) / Valor D0 (R$) | Valor de aquisição, valor contábil e valor líquido de PDD. |
| PDD (R$) / PDD (%) | Provisão para devedores duvidosos, em reais (negativa) e em percentual. |
| Valor vencido (R$) / Valor não vencido (R$) | Parcela vencida e não vencida do valor contábil. |
| % de Emissões | Participação do papel no total de emissões. |
| % do PL | Participação do papel no patrimônio líquido do fundo. |

### `OPERAÇÕES DE CRÉDITO`

Operações de crédito (CCB, CCE, NCE e suas versões estruturadas). Para os tipos consolidados — `CCB`, `CCE`, `NCE` — a carteira é apresentada em **uma única linha por tipo**, identificada como `CCB CONSOLIDADO`, e não operação a operação; o detalhamento ativo a ativo está no relatório [Composição de Carteira de Ativos](/documentation/iaas/relatorios_dtvm/assets_wallet_composition).

| Coluna | Descrição |
|--------|-----------|
| Data de referência | Data da composição. |
| Identificador | Número do contrato da operação ou `{TIPO} CONSOLIDADO` nas linhas consolidadas. |
| Tipo do ativo | `CCB`, `CCB ESTRUTURADA`, `CCE`, `NCE ESTRUTURADA`, etc. |
| Código IF | Código do papel na B3, quando registrado. |
| Data de emissão / Data de compra / Data de vencimento | Datas do contrato e da aquisição. Vazias nas linhas consolidadas. |
| Unidades atuais | Quantidade de operações em estoque. |
| PU de compra (R$) / PU em acruo (R$) / PU D0 (R$) | Preços unitários. Vazios nas linhas consolidadas. |
| Valor D0 (R$) | Valor da posição líquido de PDD. |
| PDD (R$) / PDD (%) | Provisão para devedores duvidosos. |
| Valor do ativo (R$) | Valor contábil da posição. |
| Valor vencido (R$) / Valor em acruo (R$) | Parcela vencida e parcela em acruo do valor contábil. |
| Ágio restante (R$) | Ágio ainda não diferido (valor justo menos valor contábil). |
| Juros pós-vencimento (R$) / Juros de mora (R$) / Multa por atraso (R$) | Encargos por atraso. **Estas três colunas só aparecem quando há algum encargo de atraso na carteira de CCB.** |
| % de Operações de Crédito | Participação da linha no total de operações de crédito. |
| % do PL | Participação da linha no patrimônio líquido do fundo. |

### `DC DESCONTADOS`

Direitos creditórios descontados (duplicatas mercantis e de serviços, CT-e, contratos descontados). Sempre apresentados de forma consolidada, uma linha por tipo.

| Coluna | Descrição |
|--------|-----------|
| Data de referência | Data da composição. |
| Identificador | `{TIPO} CONSOLIDADO`. |
| Tipo do ativo | `DUPLICATA MERCANTIL`, `DUPLICATA SERVIÇOS`, `CTE`, `CONTRATO`. |
| Valor D0 (R$) | Valor da posição líquido de PDD. |
| Valor do ativo (R$) | Valor contábil da posição. |
| Valor vencido (R$) / Valor em acruo (R$) | Parcela vencida e parcela em acruo do valor contábil. |
| PDD (R$) | Provisão para devedores duvidosos (negativa). |
| % de Direitos Creditórios Descontados | Participação da linha no total de direitos creditórios descontados. |
| % do PL | Participação da linha no patrimônio líquido do fundo. |

### `COTAS DE FUNDOS`

| Coluna | Descrição |
|--------|-----------|
| Data de referência | Data da composição. |
| Tipo do ativo | `FIDC`, `RENDA FIXA`, `MULTIMERCADO`, `FIA`, `FIP`, `FII`. |
| Nome do Fundo / Documento do Fundo | Nome e CNPJ do fundo investido. |
| Senioridade | `SÊNIOR`, `MEZANINO` ou `SUBORDINADA`. |
| Código Interno | Código interno da classe investida. |
| Data de compra | Sempre vazia nesta seção. |
| Valor de compra (R$) / Unidades compradas / PU de compra (R$) | Dados da aquisição. |
| Unidades atuais / Valor D0 (R$) / PU D0 (R$) | Posição na data de referência. |
| % de Cotas | Participação da linha no total de cotas de fundos. |
| % do PL | Participação da linha no patrimônio líquido do fundo. |

### `SWAP` e `IMÓVEIS`

Apresentadas apenas para fundos que possuem esses ativos. `SWAP` traz contraparte, valores nominais e valores atualizados de ativo e passivo; `IMÓVEIS` traz número de matrícula, valor e data de avaliação e a próxima avaliação prevista.

### `VALORES A PAGAR`

| Coluna | Descrição |
|--------|-----------|
| Data de referência | Data da composição. |
| Tipo de a pagar | Descrição da despesa (ex: `TAXA DE ADMINISTRAÇÃO`). |
| Total provisionado | Valor total provisionado da despesa. |
| Valor reconhecido | Valor já reconhecido no resultado, apresentado como negativo. |
| Valor restante | Diferença entre o total provisionado e o valor reconhecido. |
| Inicio da provisão / Fim da provisão / Data do pagamento | Datas da provisão e do pagamento previsto. |
| % do PL | Participação do valor reconhecido no patrimônio líquido (negativa). |

### `VALORES A RECEBER`

Mesma estrutura da seção anterior, com as colunas `Total a diferir`, `Valor diferido`, `Valor restante`, `Inicio do diferimento` e `Fim do diferimento`.

### `CONTAS CAIXA`

| Coluna | Descrição |
|--------|-----------|
| Data de referência | Data da composição. |
| Nome da conta | Instituição financeira e identificação contábil da conta. |
| Dados da conta | Agência e conta no formato `Ag.: {agência} \| Cc.: {conta}-{dígito}`. |
| Entrada a conciliar / Saída a conciliar | Valores creditados ou debitados ainda não conciliados. |
| Saldo | Saldo da conta na data de referência. |
| % do PL | Participação do saldo no patrimônio líquido do fundo. |

### `RENTABILIDADE`

Um bloco por série de emissão, com uma linha por janela de apuração.

| Coluna | Descrição |
|--------|-----------|
| Tipo | `Diária`, `Mensal`, `Anual` ou `D-N` (janela de N dias corridos). |
| Data de Referência | Data inicial da janela de apuração. |
| Cota de Referência | Valor da cota na data inicial da janela. |
| Cota Benchmark | Valor da cota do benchmark (DI) na data inicial da janela. |
| Cota Atual | Valor da cota líquida na data da composição. |
| Rendimento Total | Rentabilidade da cota na janela, em percentual. |
| Rendimento (%CDI) | Rentabilidade como percentual do CDI. `-` quando não há benchmark na janela. |
| Rendimento (CDI+) | Rentabilidade expressa como CDI mais spread anualizado (252 dias úteis). `-` quando o resultado é negativo ou não há benchmark. |

## Aba `P&L`

Compara os saldos das contas de resultado (grupos contábeis `07` — receitas — e `08` — despesas) entre o dia útil anterior e a data de referência.

### `RESUMIDO`

| Coluna | Descrição |
|--------|-----------|
| Data de Referência | Data da composição. |
| Tipo | `Receitas`, `Despesas` ou `Resultado`. A classificação usa o **sinal do saldo final** de cada conta, não o grupo do plano de contas: uma conta de receita com saldo negativo entra em `Despesas`. |
| Valor (R$) | Variação do dia. `Resultado` é a soma de receitas e despesas. |

### `DETALHES`

| Coluna | Descrição |
|--------|-----------|
| Nome da Conta | Nome da conta contábil de resultado. |
| Data Inicial / Valor Inicial (R$) | Dia útil anterior e saldo da conta nessa data. |
| Data Final / Valor Final (R$) | Data de referência e saldo da conta nessa data. |
| Resultado (R$) | Variação do saldo no dia. |
| Variação (%) | Variação percentual em relação ao saldo inicial. |

Somente contas com variação no dia aparecem na seção.

---

# XML ANBIMA (tipos 5 e 401)

URL: /en/documentation/iaas/relatorios_dtvm/xml_anbima

## Visão Geral

A QI CTVM gera os arquivos de posição de carteira no padrão ANBIMA a partir da composição de carteira do fundo. São dois modelos, entregues como arquivos independentes:

| Modelo | Padrão | Descrição |
|--------|--------|-----------|
| `xml_5_by_composition` | Arquivo de Posição ANBIMA 5.0 (ISO 20022, `semt.003.001.04`) | Posição da carteira em estrutura ISO 20022, com identificação de administrador, gestor e custodiante, posição por ativo, valores a pagar e a receber. |
| `xml_401_by_composition` | Arquivo de Posição ANBIMA 4.01 | Posição da carteira no layout 4.01, com cabeçalho do fundo e blocos por classe de ativo. |

:::info Qual é o "XML da ANBIMA"
Quando se fala do XML da ANBIMA no dia a dia, o arquivo em questão é o **`xml_5_by_composition`** — a versão 5.0 do arquivo de posição. O `xml_401_by_composition` é a versão anterior do mesmo padrão, ainda exigida por alguns consumidores.
:::

## O que você precisa informar

| Variável | Obrigatória | Descrição |
|----------|-------------|-----------|
| `fund_class_key` | sim | Identificador da classe de fundo sobre a qual o arquivo é gerado. |
| `reference_date` | sim | Data de referência da posição, no formato `AAAA-MM-DD`. |
| `type_fund_code_anbima` | não | Código do tipo de fundo na tabela da ANBIMA. Quando omitido, é derivado do cadastro do fundo. Um código fora da lista de válidos faz a geração falhar. |
| `issuance_serie_key` | não (só XML 401) | Restringe o arquivo a uma única série de emissão. Sem ele, todas as séries da classe entram no arquivo. |

## Estrutura do Arquivo

| Atributo | Valor |
|----------|-------|
| Formato | XML |
| Encoding | UTF-8 |
| Nomenclatura | `{nome_resumido_fundo}_xml_5_by_composition_{AAAA-MM-DD}.xml` e `{nome_resumido_fundo}_xml_401_by_composition_{AAAA-MM-DD}.xml` |

Ambos os arquivos são gerados a partir de uma **composição de carteira** já fechada na data de referência — confirmada ou aguardando confirmação. Antes de montar o arquivo, o serviço reconcilia a posição: a soma dos ativos, mais os valores a receber, menos os valores a pagar, tem que fechar com o patrimônio líquido informado pelas séries de emissão. Quando não fecha, o arquivo não é gerado.

## Como receber

Há duas formas, que podem ser usadas em conjunto:

1. **Na rotina diária do SFTP**, junto com os demais relatórios. Basta solicitar ao time de integração a inclusão dos modelos `xml_5_by_composition` e/ou `xml_401_by_composition` na configuração da entrega.
2. **Sob demanda, pela API**, com a rota de download de relatório da composição:

ENDPOINT /composition/fund_class/{fund_class_key}/report
MÉTODO POST

```json title="Request Body"
{
    "composition_type": "final_quota",
    "report_type": "xml_5_by_composition",
    "reference_date": "2026-07-29"
}
```

A resposta devolve o arquivo em base64, no campo `document_b64`. A carteira precisa estar no status **confirmed** para o download ser possível. Detalhes em [Carteira - Baixar a Carteira](/documentation/iaas/composicao_carteira/baixar_carteira).

## Conteúdo do arquivo tipo 5

O arquivo tem o elemento raiz `PosicaoAtivosCarteira` e é dividido em duas partes:

- **`AppHdr`** — cabeçalho da mensagem: administrador remetente (nome e CNPJ), fundo destinatário, identificador da mensagem, versão do layout (`semt.003.001.04`), serviço (`Arquivo de Posicao 5.0`) e data/hora de geração.
- **`Document / SctiesBalAcctgRpt`** — corpo da posição:

| Elemento | Conteúdo |
|----------|----------|
| `Pgntn` | Paginação do arquivo. |
| `StmtGnlDtls` | Dados gerais do extrato: data da composição, frequência e tipo de atualização. |
| `AcctOwnr` | CNPJ do administrador (titular da conta). |
| `AcctSvcr` | CNPJ da gestora. |
| `SfkpgAcct` | CNPJ e nome do custodiante. |
| `BalForAcct` | Classe de fundo e séries de emissão, com ISIN, quantidade de cotas, valor da cota, valor total dos ativos, e o detalhamento de valores a pagar (`PAYA`) e a receber (`RECE`). |
| `SubAcctDtls` | Uma entrada por ativo da carteira: títulos públicos, títulos privados, debêntures, cotas de fundo, direitos creditórios, swaps, imóveis e contas caixa. |
| `AcctBaseCcyTtlAmts` | Patrimônio líquido total do fundo. |

Os valores a pagar são classificados com os códigos ISO correspondentes à natureza da despesa — `ADMF` (taxa de administração), `MANF` (gestão), `PERF` (performance), `CETI` (CETIP), `REGF` (CVM), `ANBI` (ANBIMA), `AUDT` (auditoria), `SELC` (SELIC), `CUST` (custódia), `LEGA` (serviços) — ou `OTHR` para os demais.

## Conteúdo do arquivo tipo 401

O arquivo tem o elemento raiz `arquivoposicao_4_01`, com um elemento `fundo` que reúne:

| Bloco | Conteúdo |
|-------|----------|
| `header` | ISIN, CNPJ e nome do fundo, data da posição, administrador, gestor e custodiante, valor e quantidade de cotas, patrimônio líquido, valor dos ativos, valores a receber e a pagar, tipo de fundo ANBIMA. |
| `titpublico` | Um bloco por título público, com código SELIC, datas, quantidades, PUs, indexador e valor financeiro. |
| `titprivado` | Um bloco por título privado que não seja debênture. |
| `debenture` | Um bloco por debênture. |
| `swap` | Um bloco por contrato de swap, com valores de ativo e passivo. |
| `cotas` | Um bloco por cota de fundo investida, com ISIN, CNPJ do fundo, quantidade e PU. |
| `caixa` | Saldo das contas caixa. |
| `despesas` | Taxas de administração e performance do fundo. |
| `outrasdespesas` | Demais despesas provisionadas. |
| `provisao` | Provisões constituídas, com data e valor. |
| `fidc` | Valor financeiro total dos direitos creditórios da carteira. |

Blocos sem posição na data não são incluídos no arquivo.

---

# Criação de um ativo a ser recomprado/vendido

URL: /en/documentation/iaas/venda_ativos/asset/criacao_recompra

---

### Request

ENDPOINT /trade_resolve/BASE_URL/assignment/EXTERNAL_ID/asset
METHOD POST

```json title='Request Body'
{
	"external_id": "931e9437-d025-41ab-bb53-6b94e10fd361",
        "sale_value": 1234.56
}
```

:::info 
O external_id informado na payload deve corresponder ao external_id de um ativo que está presente na carteira do fundo.
:::

#### Body Params

| Campo | Tipo | Descrição | Caracteres |
|-|-|-|-|
| `external_id` * | string | Chave única de identificação do ativo a ser recomprado/vendido informada pelo parceiro. | Até 50 |
| `sale_value` *| float | Valor pelo qual o ativo será baixado | 2 casas decimais |

### Response

STATUS 201

```json title='Response Body'
{
    "assignment_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "status": "pending_assets_insertion",
}
```

---

# Aprovação do Gestor

URL: /en/documentation/iaas/venda_ativos/assignment/aprovacao_recompra

:::info Aos Gestores
É importante mencionar que essa rota está disponível somente para Gestores. Caso ele não seja integrado, pode-se realizar esta ação via Portal.
:::

### Request

ENDPOINT /trade_resolve/BASE_URL/assignment/EXTERNAL_ID
METHOD PUT

```json title='Request Body'
{
	"assignment_status": "approved"
}
```

#### Enumeradores Assignment Status
| Enumerador   | Descrição     |
|--------------|---------------|
| **approved**   | Para aprovar o Lote |
| **reproved**  | Para reprovar o Lote  |

### Response

STATUS 201

```json title='Response Body'
{
    "assignment_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "status": "approved",
}
```

---

# Criação de um lote de recompra

URL: /en/documentation/iaas/venda_ativos/assignment/criacao_recompra

---

### Request

ENDPOINT /trade_resolve/BASE_URL/assignment
METHOD POST

```json title='Request Body'
{
    "external_id": "931e9437-d025-41ab-bb53-6b94e10fd361",
    "assignment_date": "2024-04-01"
}
```

#### Body Params

| Campo | Tipo | Descrição | Caracteres |
|-|-|-|-|
| `external_id` * | string | Chave única de identificação deste lote no sistema do parceiro integrador. | Até 50 |
| `assignment_date` *| string | Data da recompra | YYYY-MM-DD

### Response

STATUS 201

```json title='Response Body'
{
    "assignment_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "status": "pending_assets_insertion",
}
```

---

# Encerrar Inserção de Ativos

URL: /en/documentation/iaas/venda_ativos/assignment/fechamento_recompra

### Request

ENDPOINT /trade_resolve/BASE_URL/assignment/EXTERNAL_ID
METHOD PUT

```json title='Request Body'
{
	"assignment_status": "completed_assets_insertion"
}
```

### Response

STATUS 201

```json title='Response Body'
{
    "assignment_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
    "status": "completed_assets_insertion",
}
```

---

# Recompra e Venda de Ativos

URL: /en/documentation/iaas/venda_ativos/inicio

Esta seção documenta as APIs que viabilizam a **venda e a recompra de direitos creditórios** já encarteirados nos fundos administrados pela QI CTVM. O fluxo abrange desde a criação do lote até a baixa dos ativos da carteira do fundo.

:::tip Contexto
Este serviço apenas **baixa os ativos da carteira** do fundo. Ele não envia dados para outras administradoras.

Existem dois conceitos fundamentais: o **lote** (`assignment`) e o **ativo** (`asset`). Um lote é composto por um ou mais ativos, e cada ativo inserido precisa já estar na carteira do fundo.
:::

:::info Pré-requisitos
- Para ter acesso a esses serviços, entre em contato com [integracao.dtvm@qitech.com.br](mailto:integracao.dtvm@qitech.com.br) para liberação dos ambientes de Homologação (Sandbox) e Produção.
- Você precisará da `fund_class_key` (chave do fundo), que compõe a URL base de todos os endpoints desta API, e da `assignment_configuration_key` (chave da configuração), informada na criação do lote:

```
/trade_resolve/fund_class/{fund_class_key}
```
:::

## Fluxo de venda/recompra

O diagrama abaixo mostra o caminho principal, as bifurcações e o status resultante de cada etapa. Passe o mouse em um nó para ver o endpoint e clique para abrir a documentação.

<FlowDiagram
  columns={3}
  nodes={[
    { id: 'criacao', row: 1, col: 2, actor: 'you', num: 1,
      title: 'Criação do Lote',
      status: 'pending_assets_insertion',
      desc: 'Informe um external_id único, a data da operação e a conta que fará o pagamento ao fundo.',
      endpoint: { method: 'POST', path: '/trade_resolve/fund_class/{fund_class_key}/assignment' },
      href: '/documentation/iaas/venda_ativos/assignment/criacao_recompra' },

    { id: 'ativos', row: 2, col: 2, actor: 'you', num: 2,
      title: 'Inserção dos Ativos',
      status: 'ativo: pending_wallet_sale',
      desc: 'Uma requisição por ativo, identificado pelo mesmo external_id com que foi encarteirado. O ativo precisa estar ativo na carteira.',
      endpoint: { method: 'POST', path: '.../assignment/{external_id}/asset' },
      href: '/documentation/iaas/venda_ativos/asset/criacao_recompra' },

    { id: 'validacao', row: 2, col: 3, actor: 'you', tag: 'Condicional',
      title: 'Confirmação do preço',
      status: 'ativo: pending_validation',
      desc: 'Quando o preço de venda diverge mais de 5% do valor justo contábil, o ativo fica retido e exige confirmação explícita. Endpoint ainda não documentado — alinhe com integracao.dtvm@qitech.com.br.' },

    { id: 'encerramento', row: 3, col: 2, actor: 'you', num: 3,
      title: 'Encerramento do Lote',
      desc: 'É necessário ter ao menos um ativo não descartado. Você pode enviar number_of_assets e total_value para a API conferir os totais.',
      endpoint: { method: 'PUT', path: '.../assignment/{external_id}' },
      href: '/documentation/iaas/venda_ativos/assignment/fechamento_recompra' },

    { id: 'descartado', row: 4, col: 1, actor: 'you', tone: 'end',
      title: 'Lote descartado',
      status: 'discarded',
      desc: 'O descarte está disponível até o encerramento. Depois que o termo entra em circulação, o lote não pode mais ser descartado.' },

    { id: 'termo', row: 4, col: 2, actor: 'qitech',
      title: 'Termo de Recompra',
      status: 'pending_signed_term_submission',
      desc: 'Termo interno: a QI Tech gera o documento e coleta as assinaturas. Termo externo: o integrador envia o termo já assinado.' },

    { id: 'credito', row: 5, col: 2, actor: 'qitech',
      title: 'Aguardando o crédito no fundo',
      status: 'pending_payment',
      desc: 'Com o termo assinado, a QI Tech registra a expectativa de pagamento na conta do fundo.' },

    { id: 'baixa', row: 6, col: 2, actor: 'qitech', tone: 'ok',
      title: 'Ativos baixados da carteira',
      status: 'completed',
      desc: 'Confirmado o crédito, os ativos são baixados um a um. Quando todos concluem, o lote é encerrado.' },
  ]}
  edges={[
    { from: 'criacao', to: 'ativos' },
    { from: 'ativos', to: 'validacao', label: 'diverge > 5%', dashed: true },
    { from: 'validacao', to: 'encerramento', label: 'confirmado', dashed: true },
    { from: 'ativos', to: 'encerramento' },
    { from: 'encerramento', to: 'descartado', label: 'discarded', tone: 'end' },
    { from: 'encerramento', to: 'termo', label: 'encerrado', tone: 'ok' },
    { from: 'termo', to: 'credito', label: 'assinado' },
    { from: 'credito', to: 'baixa', label: 'pago' },
  ]}
/>

## Passo a passo

### 1. Criação do Lote

Crie o lote informando um identificador único (`external_id`), a data da operação e a conta que fará o pagamento ao fundo. O lote nasce em `pending_assets_insertion` e é o contêiner de todos os ativos que serão baixados.

**[Acessar documentação da criação do lote](/documentation/iaas/venda_ativos/assignment/criacao_recompra)**

### 2. Inserção dos Ativos

Insira um ativo por requisição, identificando-o pelo mesmo `external_id` com que ele foi encarteirado. O ativo precisa estar **ativo** na carteira do fundo no momento da inserção.

**[Acessar documentação da inserção de ativos](/documentation/iaas/venda_ativos/asset/criacao_recompra)**

:::caution Divergência de preço acima de 5%
Se o preço de venda informado divergir em **mais de 5%** do valor justo contábil do ativo, o ativo não segue automaticamente: ele fica em `pending_validation` e exige uma confirmação explícita do integrador antes de entrar na baixa. Divergências de até 5% seguem direto para `pending_wallet_sale`.

O endpoint de confirmação ainda não está documentado nesta seção — se o seu fluxo pode gerar divergências acima de 5%, alinhe o procedimento com [integracao.dtvm@qitech.com.br](mailto:integracao.dtvm@qitech.com.br).
:::

### 3. Encerramento do Lote

Após inserir todos os ativos, encerre o lote. É necessário ter ao menos um ativo não descartado. Opcionalmente, você pode enviar `number_of_assets` e `total_value` para que a API confira a quantidade e o valor total consolidados antes de aceitar o encerramento.

O descarte do lote está disponível **até esta etapa**: depois que o termo entra em circulação, o lote não pode mais ser descartado.

**[Acessar documentação do encerramento](/documentation/iaas/venda_ativos/assignment/fechamento_recompra)**

### 4. Termo de Recompra

O responsável pela emissão do Termo de Recompra depende da configuração do lote:

- **Termo interno** — a QI Tech gera o termo e coleta as assinaturas das partes. Nenhuma ação do integrador é necessária.
- **Termo externo** — o lote passa para `pending_signed_term_submission` e o integrador precisa enviar o termo já assinado para que o fluxo prossiga.

Em ambos os casos, com o termo assinado o lote passa a `pending_payment`, aguardando o crédito na conta do fundo.

### 5. Pagamento e Baixa dos Ativos

As etapas finais são automatizadas: a QI Tech confirma o crédito na conta do fundo, os ativos são baixados da carteira e, quando todos os ativos são concluídos, o lote é encerrado em `completed`.

---

# Retrieving Account Information

URL: /en/documentation/iaas/visibildade_de_caixa/get_accounts

---

### Request

ENDPOINT /cash_account/fund_class/FUND_CLASS_KEY/accounts
METHOD GET
### Response

STATUS 200

```json title='Response Body'
{
    {
   "data":[
      {
         "account_key":"fdbe66e9-4b1d-4254-8473-523b8d3587be",
         "account_type":"checking_account",
         "financial_institution":{
            "ispb":"32402502",
            "code":"329",
            "name":"QI Sociedade de Crédito Direto"
         },
         "account_status":"open",
         "account_number":"999999",
         "account_digit":"9",
         "account_branch":"0001",
         "accounting_identification":1,
         "balance":0,
         "owner":{
            "name":"FUNDO DE INVESTIMENTO EM DIREITOS CREDITORIOS",
            "document_number":"16.958.441/0001-30"
         },
         "owner_document_number":"16.958.441/0001-30"
      },
      {
         "account_key":"e40dd24e-4341-4736-a868-f3e767dd6c31",
         "account_type":"checking_account",
         "financial_institution":{
            "ispb":"32402502",
            "code":"329",
            "name":"QI Sociedade de Crédito Direto"
         },
         "account_status":"open",
         "account_number":"77777",
         "account_digit":"7",
         "account_branch":"0001",
         "accounting_identification":2,
         "balance":0,
         "owner":{
            "name":"FUNDO DE INVESTIMENTO EM DIREITOS CREDITORIOS",
            "document_number":"16.958.441/0001-30"
         },
         "owner_document_number":"16.958.441/0001-30"
      }
   ],
   "limit":10,
   "page":0,
   "is_last_page":true
}
}
```

### Response Fields

| Field         | Type   | Description                                            |
|---------------|--------|--------------------------------------------------------|
| `data`        | array  | List of **[Account](#account)** objects               |
| `limit`       | int    | Limit of objects retrieved per page                    |
| `page`        | int    | Number of the retrieved page                           |
| `is_last_page`| boolean| Information indicating if the retrieved page is the last|

### Account
| Field                       | Type   | Description                                    | Characters |
|-----------------------------|--------|------------------------------------------------|------------|
| `account_key`               | string | Unique identifier key of the account in the system | 36         |
| `account_type`              | string | Account type                                   | Up to 50   |
| `financial_institution`     | JSON   | Financial institution object                   | -          |
| `account_status`            | string | Account status                                 | Up to 50   |
| `account_number`            | string | Account number                                 | Up to 50   |
| `account_digit`             | string | Account digit                                  | 1          |
| `account_branch`            | string | Account branch                                 | Up to 50   |
| `accounting_identification` | int    | Account ordinal identifier                     | -          |
| `balance`                   | int    | Account balance at the moment                  | -          |
| `owner`                     | JSON   | Owner object                                   | -          |
| `owner_document_number`     | string | Owner's document                               | 14 or 18   |

:::caution **Attention**

The balance is provided by concatenating reais and cents e.g.: 1234 = R$ 12.34
:::
### Financial institution
| Field  | Type   | Description                                      | Characters |
|--------|--------|--------------------------------------------------|------------|
| `ispb` | string | Brazilian Payment System Identifier             | 8          |
| `code` | string | Financial institution code                       | 3          |
| `name` | string | Financial institution name                       | Up to 255  |

### Owner
| Field             | Type   | Description           | Characters |
|-------------------|--------|-----------------------|------------|
| `name`            | string | Owner's name          | up to 255  |
| `document_number` | string | Owner's document      | 14 or 18   |

---

# Retrieving Account Transactions

URL: /en/documentation/iaas/visibildade_de_caixa/get_transaction_reversals

---

### Request

ENDPOINT /cash_account/account/ACCOUNT_KEY/transactions
METHOD GET

### Response

STATUS 200

```json title='Response Body'
{
    "data": [
        {
            "transaction_key": "ed585534-8c05-431d-b829-0dc7883b24ba",
            "transaction_type": "outgoing_wire_transfer",
            "transaction_status": "pending_conciliation",
            "transaction_description": "Descrição do pagamento",
            "amount": -70000,
            "transaction_datetime": "2025-01-01T14:00:00Z",
            "account_balance": 500000,
            "transaction_data": {
               "counter_part_account": {
                  "owner": {
                        "name": "Nome da Contraparte",
                        "document_number": "***.805.49*-**"
                  },
                  "account_digit": "8",
                  "account_branch": "1",
                  "account_number": "1234567",
                  "financial_institution": {
                        "code": "329",
                        "ispb": "32402502"
                  }
               },
            },
            "account": {
                "account_key": "9c1d0c18-01ea-4c32-a878-1c6391f9aa44",
                "account_type": "checking_account",
                "financial_institution": {
                    "ispb": "32402502",
                    "code": "329",
                    "name": "QI Sociedade de Crédito Direto"
                },
                "account_status": "open",
                "account_number": "3289018",
                "account_digit": "7",
                "account_branch": "0001",
                "accounting_identification": 1,
                "balance": 500000,
                "owner": {
                    "name": "FUNDO TESTE",
                    "document_number": "93.625.214/0001-34"
                },
                "owner_document_number": "93.625.214/0001-34",
                "account_configuration": {
                    "pix": true,
                    "wire_transfer": true
                },
                "billings": []
            }
        },
        {
            "transaction_key": "16c9c463-266e-4e73-b87d-efc32aa6727a",
            "transaction_type": "incoming_wire_transfer",
            "transaction_status": "reconciled",
            "transaction_description": "Descrição",
            "amount": 300000,
            "transaction_datetime": "2025-06-04T13:00:00Z",
            "account_balance": 570000,
            "transaction_data": {
               "counter_part_account": {
                  "owner": {
                     "name": "FUNDO TESTE",
                     "document_number": "93.625.214/0001-34"
                  },
                  "account_digit": "8",
                  "account_branch": "73",
                  "account_number": "567567",
                  "financial_institution": {
                     "code": "341",
                     "ispb": "60701190",
                  }
               },
            },
            "account": {
                "account_key": "9c1d0c18-01ea-4c32-a878-1c6391f9aa44",
                "account_type": "checking_account",
                "financial_institution": {
                    "ispb": "32402502",
                    "code": "329",
                    "name": "QI Sociedade de Crédito Direto"
                },
                "account_status": "open",
                "account_number": "3289018",
                "account_digit": "7",
                "account_branch": "0001",
                "accounting_identification": 1,
                "balance": 500000,
                "owner": {
                    "name": "FUNDO TESTE",
                    "document_number": "93.625.214/0001-34"
                },
                "owner_document_number": "93.625.214/0001-34",
                "account_configuration": {
                    "pix": true,
                    "wire_transfer": true
                },
                "billings": []
            },
            "conciliation_group": {
                "description": "TRANSFERÊNCIA: CONTA COBRANÇA -> CONTA PRINCIPAL",
                "conciliation_group_key": "1ac2921c-6c81-481b-8472-6c4126bba4bf",
                "conciliation_group_datetime": "2025-01-01T13:28:58Z"
            }
        }
    ],
    "limit": 10,
    "page": 0,
    "is_last_page": true
}
```

### Query Params

| Field         | Type   | Description                |
|---------------|--------|----------------------------|
| `status`      | string | Transaction status         |
| `start_date`  | string | Query start date           |
| `end_date`    | string | Query end date             |
| `page`        | string | Retrieved page number      |

### Response Fields

| Field         | Type   | Description                                        |
|---------------|--------|----------------------------------------------------|
| `data`        | array  | List of **[Transaction](#transaction)** objects   |
| `limit`       | int    | Limit of objects retrieved per page                |
| `page`        | int    | Retrieved page number                              |
| `is_last_page`| boolean| Information indicating if the retrieved page is the last|

### Transaction
| Field                       | Type   | Description                                       | Characters |
|-----------------------------|--------|---------------------------------------------------|------------|
| `transaction_key`           | string | Unique transaction identifier key                 | 36         |
| `transaction_type`          | string | Transaction type                                  | Up to 50   |
| `transaction_status`        | string | Transaction status                                | Up to 50   |
| `transaction_description`   | string | Transaction description provided by the bank      | Up to 255  |
| `amount`                    | bigint | Transaction amount times 100 (ex: R$1.00 == 100) | -          |
| `transaction_datetime`      | string | Transaction date and time                         | ISO 8601   |
| `account_balance`           | bigint | Account balance after the transaction             | -          |
| `transaction_data`          | JSON   | Object with additional transaction information    | -          |
| `account`                   | JSON   | Account object containing the transaction         | -          |

### Account
| Field                       | Type   | Description                         | Characters |
|-----------------------------|--------|-------------------------------------|------------|
| `account_key`               | string | Unique account identifier key       | 36         |
| `account_type`              | string | Account type                        | Up to 50   |
| `financial_institution`     | JSON   | Financial institution object        | -          |
| `account_status`            | string | Account status                      | Up to 50   |
| `account_number`            | string | Account number                      | Up to 50   |
| `account_digit`             | string | Account digit                       | 1          |
| `account_branch`            | string | Account branch                      | Up to 50   |
| `accounting_identification` | int    | Account ordinal identifier          | -          |
| `balance`                   | int    | Account balance at the moment       | -          |
| `owner`                     | JSON   | Owner object                        | -          |
| `owner_document_number`     | string | Owner document                      | 14 or 18   |

:::caution **Attention**

The balance is provided by concatenating reais and centavos ex.: 1234 = R$ 12.34
:::
### Financial Institution
| Field  | Type   | Description                                       | Characters |
|--------|--------|---------------------------------------------------|------------|
| `ispb` | string | Brazilian Payment System Identifier              | 8          |
| `code` | string | Financial institution code                        | 3          |
| `name` | string | Financial institution name                        | Up to 255  |

### Owner
| Field             | Type   | Description           | Characters |
|-------------------|--------|-----------------------|------------|
| `name`            | string | Owner name            | up to 255  |
| `document_number` | string | Owner document        | 14 or 18   |

### Conciliation Group
| Field                         | Type   | Description                              | Characters |
|-------------------------------|--------|------------------------------------------|------------|
| `description`                 | string | Transaction conciliation description     | Up to 255  |
| `conciliation_group_key`      | string | Unique conciliation identifier key       | 36         |
| `conciliation_group_datetime` | string | Conciliation date and time               | ISO 8601   |

---

# Retrieving Account Transactions

URL: /en/documentation/iaas/visibildade_de_caixa/get_transactions

---

### Request

ENDPOINT /cash_account/account/ACCOUNT_KEY/transactions
METHOD GET

### Response

STATUS 200

```json title='Response Body'
{
    "data": [
        {
            "transaction_key": "ed585534-8c05-431d-b829-0dc7883b24ba",
            "transaction_type": "outgoing_wire_transfer",
            "transaction_status": "pending_conciliation",
            "transaction_description": "Descrição do pagamento",
            "amount": -70000,
            "transaction_datetime": "2025-01-01T14:00:00Z",
            "account_balance": 500000,
            "transaction_data": {
               "counter_part_account": {
                  "owner": {
                        "name": "Nome da Contraparte",
                        "document_number": "***.805.49*-**"
                  },
                  "account_digit": "8",
                  "account_branch": "1",
                  "account_number": "1234567",
                  "financial_institution": {
                        "code": "329",
                        "ispb": "32402502"
                  }
               },
            },
            "account": {
                "account_key": "9c1d0c18-01ea-4c32-a878-1c6391f9aa44",
                "account_type": "checking_account",
                "financial_institution": {
                    "ispb": "32402502",
                    "code": "329",
                    "name": "QI Sociedade de Crédito Direto"
                },
                "account_status": "open",
                "account_number": "3289018",
                "account_digit": "7",
                "account_branch": "0001",
                "accounting_identification": 1,
                "balance": 500000,
                "owner": {
                    "name": "FUNDO TESTE",
                    "document_number": "93.625.214/0001-34"
                },
                "owner_document_number": "93.625.214/0001-34",
                "account_configuration": {
                    "pix": true,
                    "wire_transfer": true
                },
                "billings": []
            }
        },
        {
            "transaction_key": "16c9c463-266e-4e73-b87d-efc32aa6727a",
            "transaction_type": "incoming_wire_transfer",
            "transaction_status": "reconciled",
            "transaction_description": "Descrição",
            "amount": 300000,
            "transaction_datetime": "2025-06-04T13:00:00Z",
            "account_balance": 570000,
            "transaction_data": {
               "counter_part_account": {
                  "owner": {
                     "name": "FUNDO TESTE",
                     "document_number": "93.625.214/0001-34"
                  },
                  "account_digit": "8",
                  "account_branch": "73",
                  "account_number": "567567",
                  "financial_institution": {
                     "code": "341",
                     "ispb": "60701190",
                  }
               },
            },
            "account": {
                "account_key": "9c1d0c18-01ea-4c32-a878-1c6391f9aa44",
                "account_type": "checking_account",
                "financial_institution": {
                    "ispb": "32402502",
                    "code": "329",
                    "name": "QI Sociedade de Crédito Direto"
                },
                "account_status": "open",
                "account_number": "3289018",
                "account_digit": "7",
                "account_branch": "0001",
                "accounting_identification": 1,
                "balance": 500000,
                "owner": {
                    "name": "FUNDO TESTE",
                    "document_number": "93.625.214/0001-34"
                },
                "owner_document_number": "93.625.214/0001-34",
                "account_configuration": {
                    "pix": true,
                    "wire_transfer": true
                },
                "billings": []
            },
            "conciliation_group": {
                "description": "TRANSFERÊNCIA: CONTA COBRANÇA -> CONTA PRINCIPAL",
                "conciliation_group_key": "1ac2921c-6c81-481b-8472-6c4126bba4bf",
                "conciliation_group_datetime": "2025-01-01T13:28:58Z"
            }
        }
    ],
    "limit": 10,
    "page": 0,
    "is_last_page": true
}
```

### Query Params

| Field         | Type   | Description                    |
|---------------|--------|--------------------------------|
| `status`      | string | Transaction status             |
| `start_date`  | string | Query start date               |
| `end_date`    | string | Query end date                 |
| `page`        | string | Retrieved page number          |

### Response Fields

| Field         | Type   | Description                                            |
|---------------|--------|--------------------------------------------------------|
| `data`        | array  | List of **[Transaction](#transaction)** objects       |
| `limit`       | int    | Limit of objects retrieved per page                    |
| `page`        | int    | Retrieved page number                                  |
| `is_last_page`| boolean| Information indicating if the retrieved page is the last|

### Transaction
| Field                       | Type   | Description                                       | Characters |
|-----------------------------|--------|---------------------------------------------------|------------|
| `transaction_key`           | string | Unique transaction identifier key                 | 36         |
| `transaction_type`          | string | Transaction type                                  | Up to 50   |
| `transaction_status`        | string | Transaction status                                | Up to 50   |
| `transaction_description`   | string | Transaction description provided by the bank      | Up to 255  |
| `amount`                    | bigint | Transaction value times 100 (e.g.: R$1.00 == 100) | -          |
| `transaction_datetime`      | string | Transaction date and time                         | ISO 8601   |
| `account_balance`           | bigint | Account balance after the transaction             | -          |
| `transaction_data`          | JSON   | Object with additional transaction information    | -          |
| `account`                   | JSON   | Account object containing the transaction         | -          |

### Account
| Field                       | Type   | Description                     | Characters |
|-----------------------------|--------|---------------------------------|------------|
| `account_key`               | string | Unique account identifier key   | 36         |
| `account_type`              | string | Account type                    | Up to 50   |
| `financial_institution`     | JSON   | Financial institution object    | -          |
| `account_status`            | string | Account status                  | Up to 50   |
| `account_number`            | string | Account number                  | Up to 50   |
| `account_digit`             | string | Account digit                   | 1          |
| `account_branch`            | string | Account branch                  | Up to 50   |
| `accounting_identification` | int    | Account ordinal identifier      | -          |
| `balance`                   | int    | Current account balance         | -          |
| `owner`                     | JSON   | Owner object                    | -          |
| `owner_document_number`     | string | Owner's document                | 14 or 18   |

:::caution **Attention**

The balance is provided by concatenating reais and centavos e.g.: 1234 = R$ 12.34
:::
### Finacial institution
| Field  | Type   | Description                                       | Characters |
|--------|--------|---------------------------------------------------|------------|
| `ispb` | string | Brazilian Payment System Identifier              | 8          |
| `code` | string | Financial institution code                        | 3          |
| `name` | string | Financial institution name                        | Up to 255  |

### Owner
| Field             | Type   | Description          | Characters |
|-------------------|--------|----------------------|------------|
| `name`            | string | Owner's name         | up to 255  |
| `document_number` | string | Owner's document     | 14 or 18   |

### Conciliation Group
| Field                         | Type   | Description                              | Characters |
|-------------------------------|--------|------------------------------------------|------------|
| `description`                 | string | Transaction reconciliation description   | Up to 255  |
| `conciliation_group_key`      | string | Unique reconciliation identifier key     | 36         |
| `conciliation_group_datetime` | string | Reconciliation date and time             | ISO 8601   |

---

# Introdução

URL: /en/documentation/iaas/visibildade_de_caixa/inicio

A visibilidade das movimentações de caixa é extremamente importante para a gestão de um fundo de investimento. Nesta seção iremos explicar as ferramentas disponibilizadas para consultar as informações de contas.

Para ter acesso a esses serviços, entre em contato com o time [integracao.dtvm@qitech.com.br](mailto:integracao.dtvm@qitech.com.br), para que seja feito as devidas liberações, tanto em ambiente de Homologação (Sandbox), quanto em ambiente produtivo.

### Informações de conta
Nessa ferramenta é possível resgatar uma lista de informações das contas de um fundo, conforme descrito em: [5.7.2.1 Recuperando Informações da Conta](/documentation/iaas/visibildade_de_caixa/get_accounts).

---

# Transfer Between Fund Accounts

URL: /en/documentation/iaas/visibildade_de_caixa/post_internal_transfer

This feature allows transferring amounts between two accounts belonging to the same fund, debiting the source account and crediting the target account.

---

### Request

ENDPOINT /transfer/fund_class/FUND_CLASS_KEY/internal_transfer
METHOD POST

```json title='Request Body'
{
    "amount": 15000,
    "description": "Internal transfer",
    "origin_key": "<UUID>",
    "origin_type": "manual_transfer",
    "source_account_key": "<UUID>",
    "target_account_key": "<UUID>",
    "transfer_type": "pix"
}
```

### Response

STATUS 201

```json title='Response Body'
{
    "internal_transfer_key": "<UUID>",
    "internal_transfer_status": "created"
}
```

### Path Params

| Field            | Type   | Description                                     |
|------------------|--------|-------------------------------------------------|
| `fund_class_key` | string | Unique identifier key for the fund at QI CTVM  |

### Body Params

| Field                 | Type   | Description                                                                                                          |
|-----------------------|--------|--------------------------------------------------------------------------------------------------------------------|
| `amount`             | int    | Amount to be transferred, in cents (e.g., `15000` = BRL 150.00)                                                    |
| `description`        | string | Transfer description                                                                                               |
| `origin_key`         | string | Unique idempotency key for the transfer (UUID v4), generated by the integrator on each request                    |
| `origin_type`        | string | Transfer origin type. Must be sent as `manual_transfer`                                                             |
| `source_account_key` | string | Unique identifier key for the account to be debited (source)                                                        |
| `target_account_key` | string | Unique identifier key for the account to be credited (target)                                                       |
| `transfer_type`      | string | Transfer type. Accepts `pix` or `wire_transfer`, limited to what the source account supports |

:::caution **Attention**

To receive the transfer result, it is necessary to configure the transfer confirmation webhook.
:::

---

# Creating Reversal Request

URL: /en/documentation/iaas/visibildade_de_caixa/post_transaction_reversal

---

### Request

ENDPOINT /transaction_reversal/fund_class/FUND_CLASS_KEY/transaction_reversal
METHOD POST

### Response

STATUS 201

```json title='Response Body'
{
    "amount": 125.25,
    "description": "Estorno - transferência indevida",
    "reversal_type": "pix",
    "reference_date": "2025-01-01",
    "source_account": {
        "owner": {
            "name": "Nome do Fundo",
            "document_number": "123.805.491-24"
        },
        "account_digit": "8",
        "account_branch": "0001",
        "account_number": "1234567",
        "financial_institution": {
            "ispb": "32402502",
            "code": "329",
            "name": "QI Sociedade de Crédito Direto"
        },
    },
    "target_pix_key": "exemplo@gmail.com"
}
```

### Path Params

| Field           | Type   | Description                                     | 
|-----------------|--------|-------------------------------------------------|
| `fund_class_key`| string | Unique identifier key for the fund at QI CTVM  |

### Body Params

| Field                | Type                    | Description                                                                |
|----------------------|-------------------------|----------------------------------------------------------------------------|
| `amount`*            | float                   | Amount to be reversed                                                      |
| `description`*       | string                  | Description of the reversal performed                                      |
| `reversal_type`*     | string                  | Type of reversal to be sent                                                |
| `reference_date`*    | string                  | Reference date for reversal processing                                     |
| `source_account_key` | int                     | Unique identifier key for the reversal source account                      |
| `source_account`     | **[Account](#account)** | Reversal source account object                                             |
| `target_account`     | **[Account](#account)** | Reversal target account object                                             |
| `transaction_key`    | string                  | Unique identifier key for the transfer to reverse in the cash system      |
| `target_pix_key`     | string                  | PIX key of the target account                                              |

:::caution **Attention**

The fields `source_account_key` and `source_account` and the fields `target_account`, `transaction_key` and `target_pix_key` are identifier fields for the source of the amount to be reversed and the reversal destination respectively. **1 field from each** must be sent, if multiple fields are sent, it will return a 400 error.
:::

### Account
| Field                       | Type   | Description                         | Characters |
|-----------------------------|--------|-------------------------------------|------------|
| `account_number`            | string | Account number                      | Up to 50   |
| `account_digit`             | string | Account digit                       | 1          |
| `account_branch`            | string | Account branch                      | Up to 4    |
| `financial_institution`     | JSON   | Financial institution object        | -          |
| `owner`                     | JSON   | Owner object                        | -          |

### Finacial institution
| Field  | Type   | Description                                           | Characters |
|--------|--------|-------------------------------------------------------|------------|
| `ispb` | string | Brazilian Payment System Identifier                  | 8          |
| `code` | string | Financial institution code                            | 3          |
| `name` | string | Financial institution name                            | Up to 255  |

### Owner
| Field             | Type   | Description           | Characters |
|-------------------|--------|-----------------------|------------|
| `name`            | string | Owner name            | up to 255  |
| `document_number` | string | Owner document        | 14 or 18   |

---

# Webhooks

URL: /en/documentation/iaas/visibildade_de_caixa/webhook_transaction_reversal

---
#### Liquidação concluida

STATUS Settled

```json title='Webhook Body'
{
    "data":{
        "transaction_reversal_key": "b6da1a84-5bb3-4d71-9912-cbbcfe7189c1", 
        "amount": 123.45,
        "status": "paid", 
        "description": "Valor de liquidação indevido",
        "reference_date": "2025-03-23",
        "fund_class_document_number": "12.345.678/0009-10",
        "fund_class_key": "0619574f-2815-419d-8208-630b0dc30487",
        "source_account": {
            "account_digit": "7",
            "account_branch": "0001",
            "account_number": "0099999",
            "owner": {
                "name": "FUNDO DE INVESTIMENTO",
                "document_number": "12.345.678/0009-10"
            },
            "financial_institution": {
                "code": "329",
                "ispb": "32402502",
                "name": "QI Sociedade de Crédito Direto"
            },
        },
        "target_account":{
            "owner": {
                "name": "Nome fictício",
                "document_number": "111.202.188-99"
            },
            "account_digit": "0",
            "account_branch": "0001",
            "account_number": "1029490",
            "target_pix_key": "1232221",
            "financial_institution": {
                "code": "033",
                "ispb": "90400888",
                "name": "BCO SANTANDER (BRASIL) S.A."
            }
        },
        "external_key":"40054daa-c3c5-49cd-add7-858b576c5887"
    },
    "webhook_type":"transaction_reversal.transaction_reversal_status_change",
    "webhook_datetime":"2025-03-23T15:08:30Z"
}
```

---

# Introduction to Documentation

URL: /en/documentation/introducao_api_reference

This documentation aims to describe and guide the developer in using our REST API.

## Introduction
We are the first financial institution to create an exclusive Bank-as-a-Service (BaaS) model in Brazil. Our goal is to help any Fintech/Credit Manager or company have access to fast, agile, and secure financial services, however they want. Learn more at https://qitech.com.br.

## Environments (Hosts)
QI Tech has completely separate infrastructures for the SANDBOX and PRODUCTION environments, where the sandbox environment presents entirely fictitious monetary values, and only the Production environment performs valid financial transactions.

The Sandbox environment was created for developers to perform their integrations, and when ready for production, they only need to update the Host and Access Token variables with the parameters from the Production environment.

In addition to the division by environments, we also have the segregation of HOSTs related to financial services, analysis services, and QI Tech certification services as per the table below:
| Service | Environment | Host |
| ----------- | -------- | ------------------------------------- |
| BaaS and LaaS | Production | https://api-auth.qitech.app/ |
| BaaS and LaaS | Sandbox | https://api-auth.sandbox.qitech.app/ |
| CaaS | Production | https://api.caas.qitech.app/ |
| CaaS | Sandbox | https://api.sandbox.caas.qitech.app/ |
| CertifiQI | Production | https://api.certifiqi.com.br/ |
| CertifiQI | Sandbox | https://api.sandbox.certifiqi.com.br/ |

The environments are always on the same version, so when an update occurs in Production, the same update occurs in the Sandbox environment.

## How is this documentation divided?
After completing the initial steps in the "Necessary Steps to Start" section, you can already consume QI Tech's microservices in the sandbox environment.

This documentation is divided by products, which are:
- **Banking as a Service**
- **Lending as a Service**
- **Risk Solutions**
- **Certification Authority**

To facilitate communication with the QI Tech support team, we have also separated these sections by numbers.

## Error Messages
:::danger Attention!
Error messages returned by QI should not be strictly mapped. Additional fields may be included in the error messages of our APIs in the future.
:::

---

# Bem Vindo à Seção de Manuais das API's da QI Tech

URL: /en/documentation/introducao_manuais

Esta seção é destinada à orientação dos diferentes casos de uso das APIs da QI Tech.

---

# Bem Vindo à Seção de Manuais das API's da QI Tech

URL: /en/documentation/introducao_operational_guides

Esta seção é destinada à orientação dos diferentes casos de uso das APIs da QI Tech.

---

# Consulta de instituições financeiras

URL: /en/documentation/lista_de_instituicoes_financeiras/consulta_de_instituicoes_financeiras

## Request

ENDPOINT /financial_institution
MÉTODO GET

### QUERY PARAMS

| Campo | Descrição |
|---|---|
| `ispb_number` | Número ISPB da instituição financeira. |
| `name` | Nome da instituição financeira |
| `compe_number` | Número Compe da instituição financeira. |
| `min_str_start_date` | Data mínima de início da operação. |
| `max_str_start_date` | Data máxima de início da operação. |
| `page_number` | Página atual que está sendo consultada |
| `page_size` | Quantidade de resultados por página |

## Response

status: 200

Response Body: Consulta com paginação

```json
{
  "data": [
    {
      "compe_number": "001",
      "created_at": "2019-06-19T17:31:51",
      "is_active": true,
      "is_compe_participant": true,
      "ispb_number": "00000000",
      "name": "Banco do Brasil S.A.",
      "str_start_date": "2002-04-22"
    },
    {
      "compe_number": "070",
      "created_at": "2019-06-19T17:31:51",
      "is_active": true,
      "is_compe_participant": true,
      "ispb_number": "00000208",
      "name": "Banco de Brasília S.A.",
      "str_start_date": "2002-04-22"
    }
  ],
  "pagination": {
    "current_page": 1,
    "next_page": 2,
    "rows_per_page": 2,
    "total_pages": 115,
    "total_rows": 230
  }
}

```

Response Body: Consulta sem paginação

```json
{
  "94968518": {
    "compe_number": "289",
    "is_active": true,
    "is_compe_participant": false,
    "ispb_number": "94968518",
    "name": "Decyseo Corretora de Câmbio Ltda.",
    "str_start_date": "2019-03-14"
  },
  "00000000": {
    "compe_number": "001",
    "is_active": true,
    "is_compe_participant": true,
    "ispb_number": "00000000",
    "name": "Banco do Brasil S.A.",
    "str_start_date": "2002-04-22"
  }
}

```

:::info

Os parâmetros da requisição são opcionais, caso nenhum seja especificado, todas as instituições serão retornadas na resposta da requisição (sem paginação).

:::

---

# Air Force Payroll Manual

URL: /en/documentation/manual_aeronautica/manual_consignado

---

:::danger Warning!
QI Tech webhooks should not be mapped restrictively. 
Additional fields may be included in the webhook payloads returned by our APIs.
:::

:::info Webhook Resending
You can consult and resend webhooks by following the detailed instructions in the documentation: [Webhook Resending](/documentation/notificacoes/reenvio_de_notificacoes).
:::

:::info AIR FORCE Operation
The Air Force payroll system, via API, operates 24 hours a day, every day of the week, including holidays.
:::

## 1. Authorization

Before sending any Air Force Payroll request (Query, Debt Issuance, etc.), it is necessary to upload the military personnel's consent authorizing QI to proceed with the query, registration and maintenance in payroll. 
To upload the authorization, follow the step-by-step process found in the [**Document Upload**](../upload_de_documentos/) section

The upload will return a unique key in the return field "**document_key**" which should be sent in the Payroll Margin Query request payload as "**authorization_document_key**", as detailed below in item **[3. Payroll Margin Query.](#3-consulta-de-margem-consignável)**

## 2. Simulation of Success Scenarios in Balance Queries, Contract List Query and Registrations in Sandbox

For testing purposes, we have a set of data that can be used to simulate success cases in sandbox:

| document_number | registration_code  |    token       | birthdate |
|-----------------|--------------------|----------------|-----------|
| 60221284630     |       18571        |    abc123      |1954-09-08 |
| 57343241400     |       72893        |    abc123      |1998-02-06 |
| 13212590696     |       15410        |    abc123      |1959-11-14 |

This information should be sent in the **request payload** during simulation and the result will be sent through the corresponding success webhook.

## 3. Payroll Margin Query {#3-consulta-de-margem-consignavel}

With the **CPF**, **Military registration number** and **Authorization Document Key** data, the integrating partner can perform the **asynchronous query** of the military personnel's payroll margin through the following endpoint:

### Request

ENDPOINT /airforce_payroll/balance
METHOD POST

Request Body

```json
{
    "document_number": "45507529710",
    "registration_code": "146254221",
    "authorization_document_key": "f2bc2369-89ea-4a80-9f64-ba7b1566cd31",
}
```

:::info
 The CPF must be informed in text format, with a maximum of 11 characters, without ".", without "-" and left-aligned with zeros.
 The Registration must also be in text format.
:::

#### Request Body Params

| Field                        | Type   | Description                                 |
|------------------------------|--------|-------------------------------------------|
| `document_number`            | string | Military personnel's CPF.                           |
| `registration_code`          | string    | Military personnel's registration.                     |
| `authorization_document_key` | uuid   | **document_key** of the authorization term. |

### Synchronous Response

ENDPOINT /airforce_payroll/balance
STATUS 201

Response Body

```json
{
	"balance_key": "81da8afb-e1b2-4215-8093-c4b5feab8a9f",
	"status": "pending_search"
}
```

**Since it's asynchronous, the borrower's margin query data will be returned via webhook.**

#### Response Body Params

| Field                        | Type   | Description                                                                                                              |
|------------------------------|--------|------------------------------------------------------------------------------------------------------------------------|
| `balance_key`                | string | Payroll Margin query identification key.                                                              |
| `status`                     | enum   | [Payroll margin query status enumerators below.](#enumeradores-de-status-de-consulta-de-margem-consignável) |

#### Payroll Margin Query Status Enumerators {#enumeradores-de-status-de-consulta-de-margem-consignavel}

| Enumerator        | Description                                                                   |
|-------------------|-----------------------------------------------------------------------------|
| `pending_search`  | Payroll margin query pending response from the air force system. |
| `processed`       | Payroll margin query processed.                                  |

:::info
 The status ***'processed'*** refers only to the fact that the balance request was effectively sent and processed, but does not refer to its success or failure, such information will be in the payload sent via **Webhook** explained below. 
:::

### Successful Query

The success webhook will be returned as follows: 

WEBHOOK_TYPE airforce_payroll.balance

Body

```json
{
	"webhook_type": "airforce_payroll.balance.status_change",
	"key": "81da8afb-e1b2-4215-8093-c4b5feab8a9f",
	"event_datetime": "2023-05-28T08:43:29Z",
	"status": "processed",
	"data": {
            "military_unit": "Aeronáutica Brasileira",
            "military_branch": "IAE",
            "category": "Ativo",
            "name": "João da Silva",
            "document_number": "12345678901",
            "registration_code": "ABC123",
            "balance": "15000.00",
            "birth_date": "1980-01-01",
            "grant_date": "2005-03-15",
            "allowed_installment_numbers": 24
     }
}
```

#### Response Body Params success
| Field                              | Type    | Description                                                                        |
|------------------------------------|---------|----------------------------------------------------------------------------------|
| `webhook_type`                     | string  | Webhook type.                                                                 |
| `key`                              | uuid    | Webhook reference key. In this case, it refers to the **balance_key**          |
| `event_datetime`                   | string  | Webhook sending date and time.                                                 |
| `status`                           | string  | Payroll margin query status.                                        |
| `data`                             | json    | Field that will contain data related to the query.                             |
| `data.military_unit`               | string  | Establishment where the military personnel is registered in the eConsig system.                  |
| `data.military_branch`             | string  | Military agency/organization where the military personnel is.                                    |
| `data.category`                    | string  | Military personnel category.                                                            |
| `data.name`                        | string  | Military personnel name.                                                                 |
| `data.document_number`             | string  | Military personnel CPF.                                                                  |
| `data.registration_code`           | string  | Military personnel registration.                                                            |
| `data.balance`                     | string  | Available margin for payroll loan contracting.                     |
| `data.birth_date`                  | string  | Military personnel birth date.                                                   |
| `data.grant_date`                  | string  | Military personnel admission date.                                                     |
| `data.allowed_installment_numbers` | string  | Installment limit number for a payroll loan for the queried military personnel. |

### Failed Query

The failure webhook will be returned as follows: 

WEBHOOK_TYPE airforce_payroll.balance

Body

```json
{
    "webhook_type": "airforce_payroll.balance.status_change",
    "key": "81da8afb-e1b2-4215-8093-c4b5feab8a9f",
    "event_datetime": "2023-05-28T08:43:29Z",
    "status": "processed",
    "data": { 
            "title": "insufficient_permission",
            "description": "User Has insufficient permissions for this operation.",
            "translation": "Usuario nao possui permissoes suficientes para essa operacao.",
            "code": "ZP000329",
            "extra_fields": {} 
    }
}
```

Each **mapped** error type has a title, code and more detailed description. If it hasn't been mapped yet, we'll return in the same format but with the title ***unknown_response***. Except for identical fields, the table below describes in detail the returned parameters.

#### Response body params failure

| Field                     | Type   | Description                                                                                                               |
|---------------------------|--------|-------------------------------------------------------------------------------------------------------------------------|
| `data.title`                     | string |Title referring to the error that occurred.                                                                                       |
| `data.description`               | string |Detailed description in **English** of the error that occurred.                                                                      |
| `data.translation`               | string |Translation of the error description that occurred.                                                                                   |
| `data.code`                      | string |Error code received. **The last 3 digits refer to the error code received by Zetra.** (ex: ZP000***329***) |
| `data.extra_fields`              |  json  |Field intended for possible extra attributes.                                                                            |

 --- 

### Request for a Payroll Margin Query

If the partner wants to know about the progress of any created Balance entity, they can make a request for it:

:::danger Warning!
We strongly recommend using the Webhook as a reference for the borrower's Payroll Margin Query information. Feature subject to future removal.
:::

 #### Request

ENDPOINT /airforce_payroll/balance/[balance_key]
METHOD GET

#### Response

ENDPOINT /airforce_payroll/balance/[balance_key]
STATUS 200

Body

```json
{
	"status": "processed",
	"data": {
            "military_unit": "Aeronáutica Brasileira",
            "military_branch": "IAE",
            "category": "Ativo",
            "name": "João da Silva",
            "document_number": "12345678901",
            "registration_code": "ABC123",
            "balance": "15000.00",
            "birth_date": "1980-01-01",
            "grant_date": "2005-03-15",
            "allowed_installment_numbers": 24
     }
}
```

## 4. Contract List Query

With the **CPF**, **Military registration** and **Token** data of the potential borrower, the integrating partner can query the military personnel's contract list available for purchase through the following endpoint:

### Request

ENDPOINT /airforce_payroll/portability_contracts_report
METHOD POST

Request Body

```json
{
    "document_number": "45507529710",
    "registration_code": "146254221",
    "token": "abc1234"
}
```

:::info
 The CPF must be informed in text format, with a maximum of 11 characters, without ".", without "-" and left-aligned with zeros. The Registration must also be in text format.
:::

#### Request Body Params

| Field                        | Type   | Description                                 |
|------------------------------|--------|-------------------------------------------|
| `document_number`            | string | Military personnel CPF.                           |
| `registration_code`          | string | Military personnel registration.                     |
| `token`                      | string | Military personnel password.                         |

### Synchronous Response

ENDPOINT /airforce_payroll/portability_contracts_report
STATUS 201

Response Body

```json
{
    "portability_contracts_report_key": "3e41a8afb-e1b2-4215-8093-c4b5feab529c" ,
    "status": "pending_search"
}
```

**Since it's asynchronous, the borrower's contract list query data will be returned via webhook.**

#### Response Body Params

| Field                              | Type   | Description                                                                                                              |
|------------------------------------|--------|------------------------------------------------------------------------------------------------------------------------|
| `portability_contracts_report_key` | string | Contract list query identification key.                                                              |
| `status`                           | enum   | [Contract list query status enumerators.](#enumeradores-de-status-da-consulta-da-lista-de-contratos) |

#### Contract List Query Status Enumerators {#enumeradores-de-status-da-consulta-da-lista-de-contratos}

| Enumerator         | Description                                                                   |
|--------------------|-----------------------------------------------------------------------------|
| `pending_search`   | Contract list query pending response from the air force system. |
| `processed`        | Contract list query processed.                                  |

:::info
 The status ***'processed'*** refers only to the fact that the contract list query request was effectively sent and processed, but does not refer to its success or failure, such information will be in the payload sent via **Webhook** explained below. 
:::

### Contract List Query Webhook

The success webhook will be returned as follows: 

WEBHOOK_TYPE airforce_payroll.portability_contracts_report

Body

```json
{
    "webhook_type": "airforce_payroll.portability_contracts_report.status_change",
    "key": "3e41a8afb-e1b2-4215-8093-c4b5feab529c",
    "event_datetime": "2023-05-28T08:43:29Z",
    "status": "processed",
    "data": {
        "document_number": "45507529710",
        "contracts" : [
            {
                "econsig_id": "2361529",
                "consignatory": "BANCO XPTO", 
                "contract_date": "2022-01-03T15:01:57Z",
                "installment_amount": 10.0,
                "number_of_installments": 5,
                "number_of_paid_installments": 1,
                "contract_status":"in_progress"			
            },
            {
                "econsig_id": "2361529",
                "consignatory": "BANCO XPTO", 
                "contract_date": "2022-01-03T15:01:57Z",
                "installment_amount": 10.0,
                "number_of_installments": 5,
                "number_of_paid_installments": 1,
                "contract_status":"in_progress"			
            }
        ]
        
    }
}
```

#### Response Body Params
| Field                                             | Type    | Description                                                                        |
|---------------------------------------------------|---------|----------------------------------------------------------------------------------|
| `webhook_type`                                    | string  | Webhook type.                                                                 |
| `key`                                             | uuid    | Webhook reference key. In this case, it refers to the **balance_key**          |
| `event_datetime`                                  | string  | Webhook sending date and time.                                                 |
| `status`                                          | string  | Payroll margin query status.                                        |
| `data`                                            | json    | Field that will contain data related to the query.                             |
| `data.document_number`                            | string  | Military personnel CPF.                                                                  |
| `data.contracts`                                  | array   | List of contracts and their respective information.                           |
| `data.contracts.econsig_id`                       | string  | Contract unique identifier in the Zetra system.                             |
| `data.contracts.consignatory`                     | string  | Contract consignatory.                                                       |
| `data.contracts.installment_amount`               | float   | Installment amount.                                                                |
| `data.contracts.number_of_installments`           | int     | Total number of contract installments.                                            |
| `data.contracts.number_of_paid_installments`      | int     | Number of installments paid up to the current term.                                   |
| `data.contracts.contract_status`                  | string  | Contract status.                                                            |

The possible Contract Statuses are mapped here.
| Contract Status             | contract_status              | 
|-----------------------------------|------------------------------|
|"Aguard. Confirmação"              | `waiting_confirmation`       |
|"Suspensa Pelo Gestor."            | `suspend_by_manager`         |
|"Aguard. Liquidação"               | `waiting_closure`            |
|"Aguard. Liquidação Portabilidade" | `waiting_portability_closure`|
|"Aguard. Margem"                   | `waiting_balance`            |
|"Encerrado por Exclusão"           | `closed_by_exclusion`        |
|"Aguard. Deferimento"              | `waiting_approval`           |
|"Indeferida"                       | `rejected`                   |
|"Deferida"                         | `accepted`                   |
|"Em Andamento"                     | `in_progress`                |
|"Suspensa"                         | `suspended`                  |
|"Cancelada"                        | `canceled`                   |
|"Liquidada"                        | `settled`                    |
|"Concluído"                        | `completed`                  |

:::info
 These contract statuses also refer to the possible statuses of internal contracts.
:::

### Request for a Contract List Query

If the partner wants to know about the progress of a Contract List Query, they can make a request for it:

:::danger Warning!
We strongly recommend using the Webhook as a reference for the borrower's Contract List information. Feature subject to future removal.
:::

#### Request

ENDPOINT /airforce_payroll/portability_contracts_report/[portability_contracts_report_key]
METHOD GET

#### Response

ENDPOINT /airforce_payroll/portability_contracts_report/[portability_contracts_report_key]
STATUS 200

Body

```json
{
    "status": "processed",
    "data": {
        "document_number": "45507529710",
        "contracts" : [
            {
                "econsig_id": "2361529",
                "consignatory": "BANCO XPTO", 
                "contract_date": "2022-01-03T15:01:57Z",
                "installment_amount": 10.0,
                "number_of_installments": 5,
                "number_of_paid_installments": 1,
                "contract_status":"in_progress"			
            },
            {
                "econsig_id": "2361529",
                "consignatory": "BANCO XPTO", 
                "contract_date": "2022-01-03T15:01:57Z",
                "installment_amount": 10.0,
                "number_of_installments": 5,
                "number_of_paid_installments": 1,
                "contract_status":"in_progress"			
            }
        ]
        
    }
}
```

## 5. Personal Credit Operation Simulation

First, it's necessary to calculate the value of the Personal Credit operation needed to settle the original credit operation.

The outstanding balance value of the original debt must be informed in the _**disbursed_amount**_ field.

:::caution Warning
The operation must be simulated with only 1 installment, disbursement on **D0** and the installment must have its due date for **D+5 business days**, counted from the operation disbursement (payment) date.
:::

### Request

ENDPOINT /debt_simulation
METHOD POST

```json title='Request Body'
{
	"borrower": {
		"person_type": "natural"
	},
	"financial": {
		"disbursed_amount": 80492.95,
		"monthly_interest_rate": 0.03,
		"credit_operation_type": "ccb",
		"disbursement_date": "2023-03-17",
		"issue_date": "2023-03-17",
		"fine_configuration": {
			"contract_fine_rate": 0,
			"interest_base": "workdays",
			"monthly_rate": 0
		},
		"interest_grace_period": 0,
		"interest_type": "pre_price_days",
		"number_of_installments": 1,
		"principal_grace_period": 0,
		"first_due_date_delay": 5
	}
}
```

---

## 6. AIR FORCE Payroll Credit Operation Simulation

In this simulation the informed fields will have their values assigned as follows:

_**installment_face_value**_ = Payroll margin value

_**disbursement_date**_ = **D+5 business days** from the simulation moment

_**due_balance**_ = **total_amount** of the 1st installment returned in the Personal Credit Operation simulation

_**original_deadline**_ = Total deadline in days of the Personal Credit Operation (5 days)

### Request

ENDPOINT /debt_simulation
METHOD POST

```json title='Request Body'
{
    "borrower": {
        "person_type": "natural"
    },
    "financial": {
        "first_due_date": "2023-06-10",
        "installment_face_value": 100.0,
        "disbursement_date": "2023-03-22",
        "number_of_installments": 96,
        "monthly_interest_rate": 0.0205,
        "interest_type": "pre_price_days",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "principal_grace_period": 0
    },
    "collaterals": [{
        "collateral_type": "airforce_payroll"
    }],
    "refinanced_credit_operations": [
        {
            "due_balance": 1250.20,
            "original_deadline": 120
        }
    ]
}
```

The _**data.final_disbursement_amount**_ field returned in the simulation will be the value of the change paid to the customer.

---

### Query the installment value of the Personal Credit operation

#### Request

ENDPOINT /debt?key=[DEBT-KEY]&eval_present_value=True&calculate_delay=True&calculate_spread=False
METHOD GET

:::info Information
The DEBT-KEY is the key returned in the operation creation response (/debt response)
:::

---

## 7. Creating the debtor's ownership account

Before typing the proposals, it's necessary to open an account for the debtor at QI Tech.

The account will be used to receive the Personal Credit Operation disbursement, make payments of the outstanding balance of the original debt at another bank (via Bank Slip, TED or Pix).

### Request

ENDPOINT /account
METHOD POST

```json title='Request Body'
{
	"is_operation_account": true,
	"account_owner": {
		"address": {
			"city": "São Paulo",
			"complement": "s/c",
			"neighborhood": "Pinheiros",
			"number": "215",
			"postal_code": "12345012",
			"state": "SP",
			"street": "Gilberto Sabino"
		},
		"birth_date": "1961-01-30",
		"document_identification": "261a8fbc-d998-4dd7-8515-ddebb212ae27",
		"is_pep": false,
		"mother_name": "Nome da Mãe do Devedor",
		"nationality": "brasileiro",
		"email": "email@email.com",
		"individual_document_number": "12345678911",
		"name": "Nome do Devedor",
		"phone": {
			"area_code": "11",
			"country_code": "055",
			"number": "900000000"
		},
		"person_type": "natural"
	}
}
```

| Parameter                                                    | Description                                          |
|--------------------------------------------------------------|----------------------------------------------------|
| **account_owner**                                            | Debtor data                                   |
| **is_operation_account**                                     | Indicator that the account is an operation account. |

### Response

ENDPOINT /account
METHOD POST

```json title='Response Body'
{
	"data": {
		"account_info": {
			"account_branch": "0001",
			"account_digit": "3",
			"account_number": "1234567",
			"financial_institution_code": "329"
		},
		"account_owner": {
			"document_number": "12345678911",
			"name": "Nome do Devedor"
		}
	},
	"event_datetime": "2023-03-21 12:30:24",
	"key": "8ff1e73f-e87b-4641-99a6-3267030c6034",
	"status": "account_pending_operation",
	"webhook_type": "account"
}
```

:::info
The account data returned in /account should be used as the disbursement account for the Personal Credit Operation
:::

### 5xx Error or Timeout 

The flow should not proceed while the account is not successfully opened. 
For failure cases, it should be checked whether the account was actually not opened for the customer, before a possible retry attempt.

It's possible to check if the account was opened for the customer by listing the accounts opened for a specific CPF.

#### Request

ENDPOINT /account
METHOD POST
PARAMETER owner_document_number, requester_key

| Parameter                 | Description                          |
|---------------------------|------------------------------------|
| **owner_document_number** | Debtor's CPF                     |
| **requester_key**         | It's an internal integration key. |

#### Response
STATUS 200

```json title='Response Body'
{
	"data": [{
		...
		"account_branch": "0001",
		...
		"account_digit": "2",
		...
		"account_key": "f600a6a9-0845-454f-b25c-a6d108ea582e",
		"account_name": "Default",
		"account_number": "1467576",
		"account_status": {
			"created_at": "2019-10-11T18:58:31",
			"enumerator": "opened",
			"translation_path": "account.AccountStatus.opened"
		},
		...
		"owner_document_number": "09080702000105",
		"owner_name": "Nome do Devedor",
		...
	}],
	"pagination": {
		"current_page": 1,
		"next_page": null,
		"rows_per_page": 100,
		"total_pages": 1,
		"total_rows": 1
	}
}
```

:::info Information
In the response payload above, only the fields relevant for reading are listed.
:::

---

## 8. Operations Issuance

- **Personal Credit Operation**: Must be issued with disbursement on D0 and with only one installment due on **D+5 business days** from disbursement.

:::danger Warning
For issuing the Personal Credit Operation, the "_**financial**_" object must be sent with exactly the same information sent in its simulation.
:::

:::info Information
The Personal Credit Operation can only disburse on **business days** and at the following times, depending on the payment method of the outstanding balance of the original debt:
- **TED**: disbursement between **6:30 and 17:15**
- **Bank Slip**: disbursement between **7:

---

# Homologation Roadmap - BNPL

URL: /en/documentation/manual_bnpl_ecommerce/manual_bnpl

## Summary
This document guides clients through integrating Buy Now Pay Later (BNPL) with the QI Tech platform. It outlines the essential steps and provides answers to common questions.

## 1. Document Inquiry
The document inquiry can be performed using the following request:

### Request Body Upload

ENDPOINT /document/[document_key]/url
METHOD GET

Testar no Playground

### Path Params

| Field          | Description                              |
|--------------- |------------------------------------------|
| `document_key` | Unique document key                      |

:::caution Attention
The document URL will be generated with an expiration period of 10 minutes.
:::

Response Body

```json
{
    "document_key": "8a1e62f3-7add-4240-a51d-e0f1a2f421fa",
    "document_url": "expirable_url",
    "signed_document_url": "expirable_url",
    "expiration_datetime": "2024-05-01T01:00:00.000Z"
}
```

## 2. Document upload
To receive the document_key for the debt issuance documents, you must upload them using the following request:

### Request Body Upload

ENDPOINT /upload
METHOD POST

Testar no Playground

Response Body

```json
{
  "document_key": "cfbc8469-89ea-4a80-9f64-ba7b1566c68b",
  "document_md5": "cd451103fa512frc98ce684d3896698c"
}
```

:::caution Atenção
Remember to save the **document_key**, as this key is required to query the document.
:::

### API call example

Example for uploading an image from a URL.

**Python**

```python

import jwt
import hashlib
import requests
from requests_toolbelt.multipart.encoder import MultipartEncoder
import json
from datetime import datetime

BASE_URL = "https://api-auth.sandbox.qitech.app"
API_KEY = "4c268c0a-53ff-429b-92b6-47ef98a6d89a" # This key is an example; please use your own key.
CLIENT_PRIVATE_KEY = ''''
-----BEGIN EC PRIVATE KEY-----
MIHbAgEBBEHh1hIeOPE5XNNhn6bxRAmVswsPZ0wZCmzVvP8Tl/LZK9ofVmRVGzll
srU1uezJEyHKYdOHrE2p52xUj+pHzjJvb6AHBgUrgQQAI6GBiQOBhgAEAAofUz1J
hBSOyGHLsnV9Sz0DSWmhl7U+ljqbfa8PKVFWSV3w16I1v2zME5/UzUhHn1gWsjnv
7/ekcLLAQbvqMPNXAfjIhFXLAPzqbB9iCuVua1v0Vgy52rBemOWrJka/Ws2bnKR8
h1N1OxOYeYr6C2jqMygBLktKMAs+282CEiEb4bIv
-----END EC PRIVATE KEY----- 
''' # This key is an example; please use your own key.

def get_document(url):
    try:
        response = requests.get(url)
        return response.content
    except Exception as error:
        print("Error fetching document:", error)
        raise

def upload_document(array_buffer):
    endpointeger= "/upload"
    method = "POST"
    timestamp = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + "Z"
    md5_hash = hashlib.md5(array_buffer).hexdigest()

    jwt_header = {
        "typ": "JWT",
        "alg": "ES512",
    }

    jwt_body = {
        "payload_md5": md5_hash,
        "timestamp": timestamp,
        "method": method,
        "uri": endpoint,
    }

    encoded_header_token = jwt.encode(jwt_body, CLIENT_PRIVATE_KEY, algorithm="ES512", headers=jwt_header)

    signed_header = {
        "Authorization": encoded_header_token,
        "API-CLIENT-KEY": API_KEY,
        "Content-Type": "multipart/form-data",
    }

    url = f"{BASE_URL}{endpoint}"
    multipart_data = MultipartEncoder(
        fields={'file': ('image.jpeg', array_buffer, 'image/jpeg')}
    )
    signed_header['Content-Type'] = multipart_data.content_type

    try:
        response = requests.post(url, headers=signed_header, data=multipart_data)
        response_data = response.json()
        document_key = response_data.get('document_key')
        print(f'Response data is: {response_data} and document_key is: {document_key}')
        return document_key
    except Exception as error:
        print('Error:', error)
        raise

def main():
    file_url = "{FILE_URL}"

    document_buffer = get_document(file_url)

    document_key = upload_document(document_buffer)

    print("document_key is", document_key)

if __name__ == "__main__":
    main()

```
  

**Node.js**

```js
const jwt = require('jsonwebtoken')
const crypto = require('crypto')
const axios = require('axios')
const FormData = require('form-data')
const fs = require('fs')
const fetch = require('node-fetch')

async function getDocument(url) {
  try {
    const response = await axios.get(url, { responseType: 'arraybuffer' })
    return response.data
  } catch (error) {
    console.error('Error fetching document:', error)
    throw error
  }
}

async function uploadDocument(arrayBuffer) {
  const endpointeger= '/upload'
  const method = 'POST'
  const timestamp = new Date().toISOString()
  const md5_hash = crypto.createHash('md5').update(arrayBuffer).digest('hex')
  const client_private_key = `-----BEGIN EC PRIVATE KEY-----
    MIHbAgEBBEHh1hIeOPE5XNNhn6bxRAmVswsPZ0wZCmzVvP8Tl/LZK9ofVmRVGzll
    srU1uezJEyHKYdOHrE2p52xUj+pHzjJvb6AHBgUrgQQAI6GBiQOBhgAEAAofUz1J
    hBSOyGHLsnV9Sz0DSWmhl7U+ljqbfa8PKVFWSV3w16I1v2zME5/UzUhHn1gWsjnv
    7/ekcLLAQbvqMPNXAfjIhFXLAPzqbB9iCuVua1v0Vgy52rBemOWrJka/Ws2bnKR8
    h1N1OxOYeYr6C2jqMygBLktKMAs+282CEiEb4bIv
    -----END EC PRIVATE KEY-----`; // This key is an example; please use your own key.
  const api_key = '4c268c0a-53ff-429b-92b6-47ef98a6d89a' // This key is an example; please use your own key.

  try {
    const jwt_header = {
      typ: 'JWT',
      alg: 'ES512',
    }

    const jwt_body = {
      payload_md5: md5_hash,
      timestamp: timestamp,
      method: method,
      uri: endpoint,
    }

    const encoded_header_token = jwt.sign(jwt_body, client_private_key, {
      algorithm: 'ES512',
      header: jwt_header,
    })

    const signed_header = {
      AUTHORIZATION: encoded_header_token,
      'API-CLIENT-KEY': api_key,
      'Content-Type': 'multipart/form-data',
    }

    const url = `${base_url}${endpoint}`
    const formData = new FormData()
    formData.append('file', Buffer.from(arrayBuffer), {
      filename: 'image.jpeg',
    })

    fetch(url, {
      method: 'POST',
      headers: signed_header,
      body: formData,
    })
      .then(data => {
        console.log('Response data is: ' + data)

        return data.document_key
      })
      .catch(error => {
        console.log('Error: ' + error)
      })
  } catch (error) {
    console.error('Error:', error)
  }
}

async function main() {
  const fileUrl = '<URL_LINK_TO_DOCUMENT_IMAGE>'
  const documentBuffer = await getDocument(fileUrl)
  const documentKey = await uploadDocument(documentBuffer)

  console.log('Document key is: ' + documentKey)
}

main()
```

- OBS: The example above uses the library [node-fetch](https://www.npmjs.com/package/node-fetch) to make the call, but you can use the library of your choice. The important thing is that the call must be made using the POST method, with the `Content-Type` header set to `multipart/form-data` and the body must be a FormData object with the key `file` and the value as the file binary to be sent.

:::warning Aviso
The 'Axios' library has a bug that causes FormData to be sent empty. The issue can be seen on the [GitHub repository](https://github.com/axios/axios/issues/5986). If this problem has not yet been resolved at the time of your integration, we suggest using the 'node-fetch' library to make this call.
:::

  

## 3. Debt Simulation

### Request Debt Simulation

At QI Tech, we provide our clients with the ability to simulate the values of a credit operation before it is actually issued. The simulation follows the same pattern as the debt issuance request, but it is not necessary to provide the debtor’s registration and disbursement account details. The following endpoint is a simplified version of /debt_simulation, but much more optimized. It is used to calculate only one disbursement option.

ENDPOINT /v2/credit_operation/simulation
METHOD POST

Testar no Playground

Request Body

```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
}
```

### Request Body Details

| Field  | Type   | Description | Max. Char. |
|---|--- |---|---|
| **credit_operation_type***                 | string    |   Type of credit agreement      |  **[Credit Operation Type Enumerator](#credit-operation-type-enumerator)**           |
| **disbursed_issue_amount***                | float   | The value actually released to the borrower      | 15,2           |
| **disbursement_date***                     | string    | The specific date the loan funds are made available      | 10            |
| **first_due_date***                        | string    | Due date of the first installment      | 10             |
| **force_installments_on_workdays***        | boolean | If true, ensures all installment due dates are moved to the next business day  |       5       |
| **interest_type***                         | string    |  Amortization method      | **[Interest Type Enumerator ](#interest-type-enumerator)**           |
| **issuer_person_type***                    | string    | Defines whether the issuer is an individual (natural person) or a legal entity (corporation/business)     | **[Person Type Enumerator](#person-type-enumerator)**           |
| **monthly_interest_rate***                 | float   |The percentage charged on a principal balance over a one-month period    | 10,6           |
| **number_of_installments***                | integer    | Number of installments      | 3            |
| **principal_amortization_month_period***   | integer    | Period, in months, between installments      | 1            |

### Response Debt Simulation

STATUS 200

Response Body

```json
    {
        "disbursement_date": "2025-09-24",
        "issue_amount": 2821.32,
        "interest_type": "pre_price_days",
        "assignment_amount": 2829.78,
        "base_iof": 10.6,
        "total_iof": 21.32,
        "additional_iof": 10.72,
        "cet": 5.09,
        "annual_cet": 81.39,
        "first_due_date": "2025-10-24",
        "disbursed_amount": 2800,
        "prefixed_interest_rate": {
            "annual_rate": 0.6935459998,
            "daily_rate": 0.0014644728,
            "interest_base": "calendar_days",
            "monthly_rate": 0.04488
        },
        "tax_configuration": {
            "base_rate": 8.2e-05,
            "additional_rate": 0.0038
        },
        "fees": [
            {
                "amount": 0.3,
                "fee_amount": 8.46,
                "amount_type": "percentage",
                "fee_type": "spread",
                "type": "internal"
            }
        ],
        "installments": [
            {
                "due_date": "2025-10-24",
                "amount": 1507.4,
                "due_principal": 2821.32,
                "due_interest": 0,
                "has_interest": true,
                "period": 1,
                "period_workdays": 1.1,
                "calendar_days": 30,
                "workdays": 22,
                "installment_number": 1,
                "period_to_disbursement": 1,
                "prefixed_amount": 126.62083829,
                "period_workdays_to_disbursement": 1.1,
                "calendar_days_to_disbursement": 30,
                "workdays_to_disbursement": 22,
                "tax_amount": 3.39671674,
                "principal_amortization_amount": 1380.77916171
            },
            {
                "due_date": "2025-11-24",
                "amount": 1507.4,
                "due_principal": 1440.54083829,
                "due_interest": 0,
                "has_interest": true,
                "period": 1,
                "period_workdays": 1,
                "calendar_days": 31,
                "workdays": 20,
                "installment_number": 2,
                "period_to_disbursement": 2,
                "prefixed_amount": 66.85916171,
                "period_workdays_to_disbursement": 2.1,
                "calendar_days_to_disbursement": 61,
                "workdays_to_disbursement": 42,
                "tax_amount": 7.20558527,
                "principal_amortization_amount": 1440.54083829
            }
        ]
    }
```

### Response Body Details
| Field                                   | Type   | Description                                                                                                                     |
|-----------------------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------|
| **annual_cet**                          | float  | Total effective cost expressed as a decimal per year                                                                                | -            |
| **assignment_amount**                   | float  | Acquisition value of the credit operation                                                                                     | -            |
| **cet**                                 | float  | Total effective cost expressed as a decimal per month                                                                                | -            |
| **fees**                                | object | **[Object Fees](#object-fees)** - List of QI Tech fees charged on the operation                            | -            |
| **disbursed_amount**                    | float  | Amount disbursed in the credit operation                                                                                     | -            |
| **disbursement_date**                   | string   | Disbursement date of the operation                                                                                                | -            |
| **installments**                        | array   | **[Object Installments](#object-installments)** - Installments of the operation                                                        | -            |
| **interest_type**                       | string   | **[Enumerator Interest Type](#enumerator-interest-type)** - Amortization method and interest calculation method                 | -            |
| **additional_iof**                      | float  |A fixed-rate tax applied to the transaction principal, independent of the duration of the credit operation                                                                               | -            |
| **base_iof**                            | float  |  The taxable amount or principal value used as the basis for calculating the Tax on Financial Operations  | -            |
| **total_iof**                           | float  | The total amount of Tax on Financial Operations applied to the transaction   | -            |
| **issue_amount**                        | float  | Issue/nominal value of the credit operation                                                                               | -            |
| **tax_configuration**                   | object | **[Object Tax Configuration](#object-tax-configuration)** - Rate iof values                                             | -            |
| **first_due_date**                      | string   | Due date of the first installment                                                                                        | -            |
| **prefixed_interest_rate**              | object | **[Object Interest Rate](#object-interest-rate)** - Nominal interest rate                              | -            |

## 4. Debt issuance for natural persons

This endpoint issues the debt and processes the contract signature via opt-in. Disbursement occurs automatically immediately after issuance. Pre-registration is not required; simply provide the borrower's details during the debt request.

### Request

ENDPOINT /signed_debt
METHOD POST

Testar no Playground

Request Body

```json
{
    "additional_data": {
        "contract": {
            "contract_number": "TIK11267101100",
            "signed": true,
            "signatures": [
                {
                    "signer": {
                        "name": "Alan Mathison Turing",
                        "phone": {
                            "number": "912345678",
                            "area_code": "11",
                            "country_code": "055"
                        },
                        "email": "alan.turing@email.com",
                        "document_number": "96969879003"
                    },
                    "signature": {
                        "ip_address": "168.211.22.84",
                        "timestamp": "27-10-2025 11:07:15",
                        "signature_file": {
                            "file_url": "http://qitech.com.br/signature.pdf",
                            "file_type": "pdf"
                        },
                        "geolocation": {
                            "long": "-46.63611",
                            "lat": "-23.5475"
                        },
                        "fingerprint_device": null
                    }
                }
            ]
        }
    },
    "financial": {
        "number_of_installments": 2,
        "credit_operation_type": "ccb",
        "interest_type": "pre_price_days",
        "monthly_interest_rate": 0.07,
        "disbursed_amount": 200,
        "fine_configuration": {
            "contract_fine_rate": 0.02,
            "monthly_rate": 0.15,
            "interest_base": "calendar_days"
        },
        "interest_grace_period": 0,
        "disbursement_date": "2026-02-06",
        "first_due_date": "2026-03-06",
        "principal_grace_period": 0
    },
    "disbursement_bank_accounts": [
        {
            "account_digit": "5",
            "document_number": "32402502000135",
            "bank_code": "329",
            "account_number": "00002",
            "percentage_receivable": 100,
            "branch_number": "0001",
            "name": "Accout Name"
        }
    ],
    "requester_identifier_key":"6b558426-6b6c-4c9e-bfb3-5734fe45a651",
    "purchaser_document_number": "32402502000135",
    "borrower": {
        "email": "alan.turing@email.com",
        "document_identification": "494598fd-c226-4332-a500-591ae3884673",
        "document_identification_back": "494598fd-c226-4332-a500-591ae3884673",
        "birth_date": "1990-11-20",
        "person_type": "natural",
        "is_pep":false,
        "profession": "Public server",
        "individual_document_number": "96969879003",
        "address": {
            "city": "São Paulo",
            "neighborhood": "CENTRO",
            "street": "Avenida Feliz",
            "complement": "AP 801",
            "postal_code": "49026100",
            "state": "SP",
            "number": "1000"
        },
        "phone": {
            "country_code": "055",
            "number": "912345678",
            "area_code": "11"
        },
        "mother_name": "MARIA TURING",
        "document_identification_number": "96969879003",
        "name": "Alan Mathison Turing"
    }
}
```

### Request Body Details

| Field  | Type   | Description | Max. Char. |
|---|--- |---|---|
| **borrower** *                  | object | Borrower Object - The debtor of the credit operation         | **[Borrower Object](#borrower-object)** |
| **disbursement_bank_account** * | object |  Technical details of the bank account where the operation funds will be deposited.                                                                                 | **[Disbursement Bank Account Object](#disbursement-bank-account-object)**          |
| **financial** *                 | object | Contains all financial details and calculation parameters for the operation. | **[ Financial Object](#financial-object)**            |
| **purchaser_document_number** * | string | Assignee's Tax ID – The buyer of the credit operation (FIDC/Receivables Investment Fund).   | 14           |
| **additional_data** * | object | Assignee's Tax ID – The buyer of the credit operation (FIDC/Receivables Investment Fund).   | **[ Additional Data Object](#additional-data-object)**          |

### Borrower Object 

|Field|Type|Description|Max. Char.|
|---|--- |---|---|
|name *|string|Full name of the borrower|100|
|email|string|Borrower's electronic mail address|254|
|phone|object| Borrower's contact telephone details| **[Phone Object](#phone-object)**|
|is_pep *|boolean|Politically Exposed Person (PEP) indicator|5|
|address *|object| Borrower's residential address details| **[Address Object](#address-object)** |
|role_type *|enum|The role of the person in the operation. Default: issuer|-|
|birth_date *|date|Borrower's date of birth (Format: "YYYY-MM-DD")|10|
|mother_name *|string|Borrower's mother's full name|100|
|nationality|string|Borrower's nationality|50|
|person_type *|string|Person classification|7|
|individual_document_number *|string|Borrower's Tax ID (CPF) - numbers only|11|
|document_identification *|string|DOCUMENT_KEY of the uploaded identification document (RG or CNH)|36|
|document_identification_back|string|DOCUMENT_KEY of the uploaded back side of the identification document|36|

### Address Object

|Field|Type|Description|Max. Char.|
|---|--- |---|---|
|city *|string|City name of the address|100|
|state *|string|State abbreviation (two uppercase characters)|2|
|number *|string|Street number|10|
|street *|string|Street name|100|
|complement *|string|Address complement (free text)|100|
|postal_code *|string|Postal code (CEP) - numbers only|8|
|neighborhood *|string|Neighborhood or district name|100|

### Phone Object 

|Field|Type|Description|Max. Char.|
|---|--- |---|---|
|number *|string|Subscriber's phone number|9|
|area_code *|string|Two-digit regional area code (e.g., "11")|2|
|country_code *|string|International dialing code (e.g., "055")|3|

### Disbursement Bank Account Object
|Field|Type|Description|Max. Char.|
|---|--- |---|---|
|name|string|Account holder's full name|50|
|document_number|string|Account holder's Tax ID (CPF)|11|
|bank_code *|string|Financial institution's COMPE code|3|
|branch_number *|string|Branch number (do not include the branch check digit!)|4|
|account_number *|string|Account number (do not include the account check digit!)|10|
|account_digit *|string|Account check digit (use zero instead of letters)|1|
|account_type|enum|Account Type Enumerator - Type of the bank account| **[Account Type Object](#account-type-object)**|

### Additional Data Object 

|Field|Type|Description|Max. Char.|
|---|--- |---|---|
|contract_number *|string|The unique identifier or reference number of the contract|12|
|signed *|boolean|Indicates if the contract has been successfully signed|5|
|signatures *|array|List of digital signature evidence objects (Opt-in)|-|
|name *|string|Full name of the signer|255|
|document_number *|string|Signer's tax identification number (CPF)|11|
|email *|string|Electronic mail address of the signer|100|
|area_code *|string|Two-digit regional area code (e.g., "11")|2|
|number *|string|Subscriber's phone number|9|
|country_code *|string|International dialing code (e.g., "055")|3|
|ip_address *|string|The IP address used during the signature process|45|
|timestamp *|string|Date and time of the signature (DD-MM-YYYY HH:mm:ss)|19|
|file_url *|string|Direct link to the signed contract document (PDF)|2048|
|file_type *|string|Format of the signature file (e.g., "pdf")|4|
|long *|string|Geographic longitude coordinate of the signature location|20|
|lat *|string|Geographic latitude coordinate of the signature location|20|
|fingerprint_device|string|Unique digital identifier of the device used|-|

### Response

The response to this debt request will return the payment plan as well as a **DEBT-KEY**, which is the identifier of the debt in QI SCD.

STATUS 201

Response Body

```json
{
    "webhook_type": "debt",
    "key": "a6dbf441-31b0-44df-9bb8-593553de2c45",
    "status": "issued",
    "event_datetime": "2026-02-10 00:01:20",
    "data": {
        "borrower": {
            "name": "Alan Mathison Turing",
            "document_number": "96969879003",
            "related_party_key": "6995ff6e-27c2-47e9-b4bf-640934b56b23"
        },
        "contract": {
            "document_key": null,
            "number": "TIK11267101100",
            "urls": [],
            "signature_information": [
                {
                    "signer_name": "Alan Mathison Turing",
                    "signer_document_number": "96969879003",
                    "signer_role": "issuer",
                    "signer_email": "alan.turing@email.com",
                    "signer_external_key": null,
                    "signature_url": null
                }
            ]
        },
        "requester_identifier_key": "6b558426-6b6c-4c9e-bfb3-5734fe45a651",
        "iof_charge_method": "financed",
        "collaterals": [],
        "contract_fees": [
            {
                "fee_type": "spread",
                "fee_amount": 0.6
            }
        ],
        "external_contract_fees": [],
        "external_contract_fee_amount": 0,
        "net_external_contract_fee_amount": 0,
        "contract_fee_amount": 0.6,
        "issue_amount": 201.49,
        "assignment_amount": 202.09,
        "cet": "7,6600%",
        "annual_cet": "142,5744%",
        "number_of_installments": 2,
        "base_iof": 0.73,
        "additional_iof": 0.76,
        "total_iof": 1.49,
        "ipoc_code": "324025020203196969879003TIK11267101100",
        "prefixed_interest_rate": {
            "annual_rate": 1.252191589,
            "created_at": "2026-02-10T00:01:18",
            "daily_rate": 0.0022578334,
            "interest_base": "calendar_days",
            "monthly_rate": 0.07
        },
        "installments": [
            {
                "accrual_reference_date": null,
                "additional_costs": [],
                "advanced_paid_amount": 0,
                "bank_slip_key": null,
                "business_due_date": "2026-03-06",
                "calendar_days": 28,
                "digitable_line": null,
                "due_date": "2026-03-06",
                "due_interest": 0,
                "due_principal": 201.49,
                "fine_amount": null,
                "has_interest": true,
                "installment_history": [],
                "installment_key": "5c121fac-20f8-4481-b7b6-d0647a0ce524",
                "installment_number": 1,
                "installment_payment": [],
                "installment_status": "created",
                "installment_type": "principal",
                "original_due_principal": 201.49,
                "original_pre_fixed_amount": 13.13403553,
                "original_principal_amortization_amount": 97.92596447,
                "original_total_amount": 111.06,
                "paid_amount": 0,
                "paid_at": null,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 13.13403553,
                "principal_amortization_amount": 97.92596447,
                "qr_code_key": null,
                "qr_code_url": null,
                "renegotiation_proposal_key": null,
                "tax_amount": 0.22483801,
                "total_accrual_amount": null,
                "total_amount": 111.06,
                "total_paid_amount": 0,
                "workdays": 18
            },
            {
                "accrual_reference_date": null,
                "additional_costs": [],
                "advanced_paid_amount": 0,
                "bank_slip_key": null,
                "business_due_date": "2026-04-06",
                "calendar_days": 31,
                "digitable_line": null,
                "due_date": "2026-04-06",
                "due_interest": 0,
                "due_principal": 103.56403553,
                "fine_amount": null,
                "has_interest": true,
                "installment_history": [],
                "installment_key": "a8a21d7a-481e-43ba-b115-fd89253bcde9",
                "installment_number": 2,
                "installment_payment": [],
                "installment_status": "created",
                "installment_type": "principal",
                "original_due_principal": 103.56403553,
                "original_pre_fixed_amount": 7.49596447,
                "original_principal_amortization_amount": 103.56403553,
                "original_total_amount": 111.06,
                "paid_amount": 0,
                "paid_at": null,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 7.49596447,
                "principal_amortization_amount": 103.56403553,
                "qr_code_key": null,
                "qr_code_url": null,
                "renegotiation_proposal_key": null,
                "tax_amount": 0.5010428,
                "total_accrual_amount": null,
                "total_amount": 111.06,
                "total_paid_amount": 0,
                "workdays": 20
            }
        ],
        "total_pre_fixed_amount": 20.63
    }
}
```

## 5. Webhooks

After the successful response, you will receive a webhook with the signed CCB and a webhook indicating the disbursement's success or failure.

### Signature webhook

Response Body

```json
{
    "key": "1ebd4a90-2721-4c39-a399-427fa16bca65",
    "status": "signature_finished",
    "webhook_type": "debt",
    "event_datetime": "2025-10-27 17:09:33",
    "signed_contract_url": "https://storage.googleapis.com/sandbox-doc-api/documents/c8b191cb-7b90-4e37-9280-397a597babc1/RAFAELAEBENJAMINFINANCEIRALTDA-ALAN_MATHISON_TURING-CCB-TIK11267101212-20251027170925_signed.pdf"
}

```

### Disbursement webhook

Response Body

```json
{
    "key": "1ebd4a90-2721-4c39-a399-427fa16bca65",
    "data": {
      "installments": [
        {
          "due_date": "2025-11-27",
          "total_amount": 87.43,
          "installment_key": "e25fb146-0a61-4319-a722-d01b2213d0f9",
          "pre_fixed_amount": 29.26477451,
          "installment_number": 1,
          "principal_amortization_amount": 58.16522549
        },
        {
          "due_date": "2025-12-27",
          "total_amount": 87.43,
          "installment_key": "2557de2b-6df1-4a8a-b46a-59206ece157f",
          "pre_fixed_amount": 20.11446867,
          "installment_number": 2,
          "principal_amortization_amount": 67.31553133
        },
        {
          "due_date": "2026-01-27",
          "total_amount": 87.43,
          "installment_key": "cc503d1d-6387-4a1f-bd78-62b248d02ec8",
          "pre_fixed_amount": 11.07075682,
          "installment_number": 3,
          "principal_amortization_amount": 76.35924318
        }
      ],
      "ted_receipt_list": [],
      "requester_identifier_key": null
    },
    "status": "disbursed",
    "webhook_type": "debt",
    "event_datetime": "2025-10-27 17:10:21"
}

```

If the debt fails to disburse, or is returned, you will receive a cancellation webhook.

### Cancelation webhook

Response Body

```json
{
     "webhook_type": "debt",
     "key":"1ebd4a90-2721-4c39-a399-427fa16bca65",
     "event_datetime": "2025-10-27 16:38:59",
    "data": {
        "cancel_reason": "Operacao cancelada manualmente",
        "cancel_reason_enumerator": "manual"
    },
     "status":"canceled"
  }

```

****Cancelation reasons****

| cancel_reason_enumerator | Description |  
|---|---|  
|disbursing_error|Operation canceled due to an error during disbursement.  
|waiting_signature |Operation canceled due to missing signature. 
|pix_max_retry|Operation canceled because the receiving bank could not process the disbursement.  
|manual|Operation canceled manually.  
|agencia_conta_invalida|Invalid agency or recipient account number.  
|invalid_account|The destination account number is nonexistent or invalid.  
|invalid_document_number|The CPF/CNPJ of the destination account is incorrect.  
|unsupported_transaction|The destination account does not support this type of transaction.  
|invalid_ispb|The ISPB number is invalid or nonexistent.  
|rejected_payment|Payment order was rejected by the receiving bank.  
| refund_after_payee_request | Refund requested by the payee                                                |
| invalid_account            | The destination account number is nonexistent or invalid.                    |
| invalid_document_number    | The CPF/CNPJ of the destination account is incorrect.                        |
| rejected_payment           | Payment rejected by the receiving bank.                                      |
| blocked_account            | The destination account is blocked.                                          |
| unsupported_transaction    | The destination account does not support this type of transaction.           |
| amount_too_great           | Payment/refund amount exceeds the limit for the credited destination account. |
| invalid_ispb               | The ISPB number is invalid or nonexistent.                                   |
| receiver_error             | Transaction interrupted due to error on the receiver's PSP.                  |
| closed_account             | The destination account is closed.                                           |
| disbursing_hour_closed     | Disbursement occurred outside of the allowed time frame.                     |
| unregistered_pix_key       | The Pix key is not being used.                                               |
| manual                     | Operation manually canceled.                                                 |
| spi_timeout                | Timeout control in SPI.                                                     |

## 6. Cancellation

### Cancel debt before disbursement

### Request Body

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

Testar no Playground

### Path params

| Field  | Type   | Description | Max. Char. |
|---|---| ---| ---|
| `debt_key` * | string | Debt unique identifier key returned at the moment of the credit operation creation. | 32 |  

### Response Body

STATUS 200

Response Body

```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
  }
}

```

### Debt cancellation within seven days after disbursement

###  Request Body

ENDPOINT /debt/reversal
MÉTODO POST

Testar no Playground

Request Body

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

```

### Request Body Details
| Field  | Type   | Description | Max. Char. |
|-------------------|--------|--------------------------------|--------------|
| `contract_number` * | string | Contract Number of the CCB |              |

###  Response Body

STATUS 200

Response Body

```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"
}

```

## 7. Debt inquiry

You can query the debt later to retrieve information or track its current status:

ENDPOINT /v2/credit_operation/ CREDIT-OPERATION-KEY
METHOD GET

Testar no Playground

### Path params

| Field  | Type   | Description | Max. Char. |
|---|---|---|---|   
| `credit_operation_key` * | string |  Key of the credit operation | UUID |

### Response

STATUS 200

Response Body

```json
{
   "credit_operation_key":"31381158-e138-4aaa-99b7-f78356e71004",
   "issue_amount":201,
   "origin_key":"31381158-e138-4aaa-99b7-f78356e71004",
   "total_iof":1,
   "assigned_at":null,
   "disbursement_start_date":"2026-02-23",
   "disbursement_end_date":"2026-02-23",
   "issue_date":"2026-02-23",
   "requester_identifier_key":"12313asdjasdx998",
   "installments":[
      {
         "business_due_date":"2026-02-24",
         "due_date":"2026-02-24",
         "calendar_days":1,
         "due_interest":0,
         "due_principal":201,
         "fine_amount":0,
         "has_interest":true,
         "post_fixed_amount":0,
         "pre_fixed_amount":0.46,
         "principal_amortization_amount":103.45,
         "tax_amount":0.01,
         "total_amount":103.91,
         "workdays":1,
         "accrual_reference_date":null,
         "advanced_paid_amount":0,
         "bank_slip_key":null,
         "digitable_line":null,
         "installment_key":"cfd67eb8-cd1e-438b-8636-44cb94176515",
         "installment_status":"created",
         "installment_type":"principal",
         "original_due_principal":201,
         "original_pre_fixed_amount":0.46,
         "original_principal_amortization_amount":103.45,
         "paid_amount":0,
         "original_total_amount":103.91,
         "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
      },
      {
         "business_due_date":"2026-03-24",
         "due_date":"2026-03-24",
         "calendar_days":28,
         "due_interest":0,
         "due_principal":97.54761348,
         "fine_amount":0,
         "has_interest":true,
         "post_fixed_amount":0,
         "pre_fixed_amount":6.36,
         "principal_amortization_amount":97.55,
         "tax_amount":0.23,
         "total_amount":103.91,
         "workdays":20,
         "accrual_reference_date":null,
         "advanced_paid_amount":0,
         "bank_slip_key":null,
         "digitable_line":null,
         "installment_key":"445f1c2d-3967-4b23-9290-e19a0a5fb956",
         "installment_status":"created",
         "installment_type":"principal",
         "original_due_principal":97.55,
         "original_pre_fixed_amount":6.36,
         "original_principal_amortization_amount":97.55,
         "paid_amount":0,
         "original_total_amount":103.91,
         "qr_code_key":null,
         "qr_code_url":null,
         "renegotiation_proposal_key":null,
         "total_accrual_amount":0,
         "total_paid_amount":0,
         "installment_number":2,
         "paid_at":null,
         "updated_at":null,
         "principal_amortization_payment_amount":0,
         "prefixed_interest_payment_amount":0
      }
   ],
   "first_due_date":"2026-02-24",
   "requester_key":"3e69b448-9afb-4aef-9c0d-0a3059350d80",
   "original_total_iof":null,
   "contract_number":"TIK122710117",
   "credit_operation_status_enumerator":"issued",
   "operation_type_enumerator":"structured_operation",
   "disbursement_date":"2026-02-23",
   "issuer_name":"Alan Mathison Turing",
   "issuer_document_number":"46843213049",
   "external_contract_fees":[
      
   ],
   "cet":8.23,
   "annual_cet":158.43,
   "final_disbursement_amount":200,
   "number_of_installments":2,
   "disbursement_issue_amount":200,
   "prefixed_interest_rate":{
      "annual_rate":1.252191589,
      "daily_rate":0.0022578334,
      "interest_base":{
         "enumerator":"calendar_days",
         "year_days":360
      },
      "monthly_rate":0.07
   },
   "fine_configuration":{
      "contract_fine_rate":0.02,
      "fine_delay_rate":{
         "annual_rate":4.35025011,
         "daily_rate":0.0046696,
         "interest_base":{
            "enumerator":"calendar_days",
            "year_days":360
         },
         "monthly_rate":0.15
      }
   },
   "attached_documents":[
      {
         "document_key":"494598fd-c226-4332-a500-591ae3884673",
         "document_url":"https://storage.googleapis.com/sandbox-doc-api/documents/494598fd-c226-4332-a500-591ae3884673/3d684e68e7df4e557d0480d98e2692.jpg",
         "signature_url":null,
         "document_type":"document_identification",
         "signature_required":false,
         "signed":false
      },
      {
         "document_key":"494598fd-c226-4332-a500-591ae3884673",
         "document_url":"https://storage.googleapis.com/sandbox-doc-api/documents/494598fd-c226-4332-a500-591ae3884673/3d684e68e7df4e557d0480d98e2692.jpg",
         "signature_url":null,
         "document_type":"document_identification_back",
         "signature_required":false,
         "signed":false
      },
      {
         "document_key":"73584aa0-91d4-483b-a95c-1b0263c14126",
         "document_url":"https://storage.googleapis.com/sandbox-doc-api/documents/73584aa0-91d4-483b-a95c-1b0263c14126/CASTELLOBNPL-ALAN_MATHISON_TURING-CCB-TIK122710117-202602241151.pdf",
         "signature_url":"https://storage.googleapis.com/sandbox-doc-api/documents/73584aa0-91d4-483b-a95c-1b0263c14126/CASTELLOBNPL-ALAN_MATHISON_TURING-CCB-TIK122710117-202602241151_signed.pdf",
         "document_type":"ccb_pre_price_days",
         "signature_required":true,
         "signed":true
      }
   ],
   "related_parties":[
      {
         "related_party_key":"fe133e90-9ee6-401a-a5a4-7d415ecb04fd",
         "role_type":"issuer",
         "person_type":"natural",
         "name":"Alan Mathison Turing",
         "email":"weiwenqian.wayne@bytedance.com",
         "individual_document_number":"46843213049"
      }
   ],
   "base_iof":0.24,
   "additional_iof":0.76,
   "assignment_amount":201.6,
   "total_prefixed_amount":6.82
}
```

STATUS 400

Response Body

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

You can also query the debt later to retrieve the log of events status:

ENDPOINT /v2/credit_operation/ CREDIT-OPERATION-KEY /events
METHOD GET

CREDIT-OPERATION-KEY /events">Testar no Playground

### Path params

| Field  | Type   | Description | Max. Char. |
|---|---|---|---|   
| `credit_operation_key` * | string | Key of the credit operation | UUID |

### Response

STATUS 200

Response Body

```json
{
  "data": [
    {
      "status": "waiting_signature",
      "reason": null,
      "cancel_reason": null,
      "event_date": "2026-03-13T17:19:59Z"
    },
    {
      "status": "issued",
      "reason": null,
      "cancel_reason": null,
      "event_date": "2026-03-13T17:19:59Z"
    },
    {
      "status": "waiting_disbursement",
      "reason": null,
      "cancel_reason": null,
      "event_date": "2026-03-13T17:19:59Z"
    },
    {
      "status": "opened",
      "reason": null,
      "cancel_reason": null,
      "event_date": "2026-03-13T17:19:59Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "next_page": null,
    "rows_per_page": 10
  }
}
```

STATUS 400

Response Body

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

## 8. Assignment Inquiry

###  Assignment Confirmation Webhook
This webhook is triggered to notify the client that the assignment process has been initiated. It provides the essential metadata required to track the assignment.

Response Body

```json
{
   "key":"b866dc02-73db-42a4-bc66-866d465cbb73",
   "webhook_type":"assignment.status_change",
   "event_datetime":"2026-03-09T19:47:00Z",
   "data":{
      "assignment_key":"550e8400-e29b-41d4-a716-446655440000",
      "term_of_assignment_url":"[https://api.sistema.com.br/terms/7742.pdf](https://api.sistema.com.br/terms/7742.pdf)",
      "number_of_items":1,
      "total_amount":100,
      "reference_date":"2026-03-01"
   }
}

```

|Field|Type|Description|Maximum lenght|
|---|---|---|---|
|assignment_key|string|Unique identifier for the assignment operation|36|
|term_of_assignment_url|string| URL to download the Term of Assignment (PDF)|2048|
|number_of_items|integer|Total number of credit operations (items) included in this assignment|5|
|total_amount|float|The sum of the present value of all items in the assignment|15,2|
|reference_date|string|The base date used for the assignment calculations (YYYY-MM-DD)|10|

To query a specific assignment, the client can perform a GET request on the endpoint using the assignment identifier key (assignment_key).

###  Request Body

ENDPOINT /v2/assignment/[assignment_key] METHOD GET

Testar no Playground

### Params

| Field            | Descrição                      |
| ---------------- | ------------------------------ |
| `assignment_key` | Assignment unique identifier key |

### Response

STATUS 200

Response Body

```json
{
"assignment_key": "77997168-5d61-430f-b5ae-08eb3d7b8c0e",
"creation_datetime": "2023-10-01T12:00:00",
"reference_date": "2023-10-01",
"total_amount": 120000,
"number_of_items": 5,
"term_of_assignment_url": "https://example.com/assignment.pdf",
"status": "settled",
"signable_term_url": "https://example.com/signable_term.pdf"
}
```

To query the contracts within an assignment, use a GET request on the endpoint with the same **assignment_key**.

### Request Body

ENDPOINT /v2/assignment/[ASSIGNMENT_KEY]/assignment_items?page=1&page_size=100 METHOD GET

Testar no Playground

### Path Params

| Field      | Type    | Description    | 
|-----------------|---------|----------------|
| `assignment_key` | string |Assignment unique identifier key |

### Query Params

| Field      | Type    | Description    | 
|-----------------|---------|----------------|
| `page` | string |Number of the page |
| `page_size` | string | Length of the page, limited by 100 |

The response is a paginated list containing information for each contract in the assignment (status 200):

### Response Body

STATUS 200

Response Body

```json
{
        "pagination": {
            "page": 1,
            "page_size": 10
        }
        "data": [
        {
                "assignment_date": date,
        "assignment_item_key": uuid,
        "contract_number": "TIK000012312",
        "control_number": "TIK000012312",
        "requester_identifier_key": uuid,  -> including this field
        "credit_operation_key": string,
        "disbursed_amount": 80.0,
        "disbursement_date": date,
        "endorsement_url": url,
        "issue_amount": 180.00,
        "issuer_document_number": string,
        "issuer_name": string,
        "number_of_installments": 10,
        "present_amount": 180.0,
        "contract_present_amount": 180.0,
        "purchaser_document_number": string,
        "status": "settled/canceled",
        "rejected_reasons": []
        "assignment_items": [
            {
                "installment_key": uuid,
                "present_amount": 100,
                "due_date": date,
                "your_number": "TIK000012312001"
            },
            {
                "installment_key": uuid,
                "present_amount": 80,
                "due_date": date,
                "your_number": "TIK000012312002"
            }
        ]
      }
    ]
}
```

Query the assigment batchs by the **assignment_date**.

### Request Body

ENDPOINT /v2/assignments?reference_date METHOD GET

Testar no Playground

### Query Params

| Field                             | Type    | Description                                                                      | 
|-----------------------------------|---------|--------------------------------------------------------------------------------|
| `reference_date` |string| Date of assignment attempt |

### Response Body

STATUS 200

Response Body

```json
{"data": [{
      "assignment_key": "439b1257-82ac-4741-a416-a4428a9a7327",
      "number_of_items": 10000,
      "reference_date": "2025-01-01",
      "signable_term_url": "https://example.com/endorsement.pdf",
      "status": "settled",
      "term_of_assignment_url": "signed_url",
      "total_amount": 100.00,
  },
  {
      "assignment_key": "439b1257-82ac-4741-a416-a4428a9a7327",
      "number_of_items": 10000,
      "reference_date": "2025-01-01",
      "signable_term_url": "https://example.com/endorsement.pdf",
      "status": "settled",
      "term_of_assignment_url": "signed_url",
      "total_amount": 100.00,
  },
  {
      "assignment_key": "439b1257-82ac-4741-a416-a4428a9a7327",
      "number_of_items": 10000,
      "reference_date": "2025-01-01",
      "signable_term_url": "https://example.com/endorsement.pdf",
      "status": "canceled",
      "term_of_assignment_url": "signed_url",
      "total_amount": 100.00,
  }
  ]}
```

## 9. Refund Flow

###  Refund
This webhook is triggered to notify the client that the assignment process has been initiated. It provides the essential metadata required to track the assignment.
About the amortization_type, defines the amortization strategy for the renegotiation proposal. Use full_settle to request a total refund (full settlement of the debt) or equal_amount to process partial refunds based on a specific payment value.

### Query Params

| Field                             | Type    | Description                                                                      | 
|-----------------------------------|---------|--------------------------------------------------------------------------------|
| debt_key | string | Unique identifier (UUID) of the debt or credit operation to be renegotiated. |
| payment_type | string | The type of payment for the renegotiation (e.g., internal). |
| amortization_type | string | Method of amortization. Possible values: full_settle or equal_amount. |
| reference_date | string | Reference date for calculating values and projections (format YYYY-MM-DD). |
| payment_amount | number | Total amount to be paid in the renegotiation proposal. |
| account_key | string | Unique identifier (UUID) of the account associated with the payment. |
| request_control_key | string | Idempotency key (UUID) used to prevent duplicate requests for the same operation. |

ENDPOINT /renegotiation/proposal
MÉTODO POST

Request Body

**Full Refund**

```json
{
  "debt_key": "c0e4a0a3-98aa-47b5-a1db-f2c63bf1fe16",
  "payment_type": "internal",
  "amortization_type": "full_settle",
  "reference_date": "2025-10-20",
  "payment_amount": 1000,
  "account_key": "eaf3ad19-a2a5-41be-a646-c910dc92429f",
  "request_control_key": "eaf3ad19-a2a5-41be-a646-c910dc92429f"
}
```

**Partial Refund**

 ```json
{
  "debt_key": "c0e4a0a3-98aa-47b5-a1db-f2c63bf1fe16",
  "payment_type": "internal",
  "amortization_type": "equal_amount",
  "reference_date": "2025-10-20",
  "payment_amount": 1000,
  "account_key": "eaf3ad19-a2a5-41be-a646-c910dc92429f",
  "request_control_key": "eaf3ad19-a2a5-41be-a646-c910dc92429f"
}
 ```

### Response Body

STATUS 200

Response Body

```json
{
  "contract_number": "0000281416/NDR",
  "discount_percentage": 0,
  "discount_amount": 0,
  "amortization_type": "full_settle",
  "payment_amount": 50,
  "requester_name": "Ali Pay",
  "requester_key": "a29eb3a6-f278-4b09-95df-f52b789ee120",
  "origin_key": "6f9743be-b58a-46c9-9460-478e718848b6",
  "issuer_name": "NOME DO REPRESENTANTE",
  "issuer_document_number": "31057466093",
  "affected_installments": [{
    "installment_key": "f73bc15a-0075-4c5d-bb0d-e364ec55ff5b",
    "due_date": "2025-11-20",
    "principal_amount": 0.08,
    "interest_amount": 5.19,
    "fine_amount": 0,
    "total_amount": 5.27,
    "present_amount": 5.27,
    "paid_amount": 5.94,
    "principal_amortization_payment_amount": null,
    "prefixed_interest_payment_amount": null
  }, {
    "installment_key": "3ddb34d5-f63b-4238-945f-e89661cb628d",
    "due_date": "2025-12-20",
    "principal_amount": 0.1,
    "interest_amount": 3.57,
    "fine_amount": 0,
    "total_amount": 3.68,
    "present_amount": 3.68,
    "paid_amount": 7.53,
    "principal_amortization_payment_amount": null,
    "prefixed_interest_payment_amount": null
  }, {
    "installment_key": "2e018153-51fa-4d04-b5df-8ff1570f8dc5",
    "due_date": "2026-01-20",
    "principal_amount": 0.11,
    "interest_amount": 3.07,
    "fine_amount": 0,
    "total_amount": 3.18,
    "present_amount": 3.18,
    "paid_amount": 8.03,
    "principal_amortization_payment_amount": null,
    "prefixed_interest_payment_amount": null
  }, {
    "installment_key": "4dc7d6f3-cd70-4425-84ad-e59348c9b1b0",
    "due_date": "2026-02-20",
    "principal_amount": 0.12,
    "interest_amount": 2.39,
    "fine_amount": 0,
    "total_amount": 2.51,
    "present_amount": 2.51,
    "paid_amount": 8.7,
    "principal_amortization_payment_amount": null,
    "prefixed_interest_payment_amount": null
  }, {
    "installment_key": "eda0e9c0-d7d7-4249-9087-b6dfe0f48941",
    "due_date": "2026-03-20",
    "principal_amount": 0.13,
    "interest_amount": 1.49,
    "fine_amount": 0,
    "total_amount": 1.63,
    "present_amount": 1.63,
    "paid_amount": 9.58,
    "principal_amortization_payment_amount": null,
    "prefixed_interest_payment_amount": null
  }, {
    "installment_key": "0ae280f4-8697-4956-ad36-7fd49a757334",
    "due_date": "2026-04-20",
    "principal_amount": 0.14,
    "interest_amount": 0.85,
    "fine_amount": 0,
    "total_amount": 1,
    "present_amount": 1,
    "paid_amount": 10.21,
    "principal_amortization_payment_amount": null,
    "prefixed_interest_payment_amount": null
  }],
  "remaining_installments": [],
  "proposal_key": "c01e5d06-fcde-40b4-a0c8-5930c54d222c",
  "proposal_status": "paid",
  "payment_type": "internal",
  "payment": {
    "digitable_line": null,
    "qr_code_url": null,
    "qr_code_key": null,
    "bank_slip_key": null,
    "paid_method_type": "internal",
    "source_account_key": "5d068423-6094-49e4-b15b-7740038295a8",
    "payment_data": {
      "target_account_key": "5d068423-6094-49e4-b15b-7740038295a8",
      "transaction_amount": 50
    }
  },
  "proposal_due_date": "2025-10-13",
  "reference_date": "2025-10-13",
  "devolution_amount": 0
}
```

## 10. Ordinary Repayment Flow

###  Standard Payment
For the ordinary installment repayment flow, please refer to the following link: [Renegociação em lote](/documentation/renegociacao/renegociacao_em_lote).

## 11. Technical Specifications and Enums

### Fees Object
| Field           | Type  | Description                                                                                           |
|-----------------|-------|-----------------------------------------------------------------------------------------------------|
| **amount**      | float | Fee amount (in percentage or absolute value, depending on the value provided in the amount_type field)| -            |
| **amount_type** | enum  | Fee value unit                   |  **[Amount Type Enumerator](#amount-type-enumerator)**             |
| **fee_amount**  | float | Absolute value of the fee charged in the operation                                                           | -            |
| **fee_type**    | string  | Type of fee charged in the operation                   | **[Fee Type Enumerator](#fee-type-enumerator)**          |
| **type**        | string  |  Source of the fee charged in the operation                         | **[Origin Type Enumerator](#origin-type-enumerator)**          |

### Installments Object
| Field                             | Type    | Description                                                                      | 
|-----------------------------------|---------|--------------------------------------------------------------------------------|
| **calendar_days**                 | integer    | Number of calendar days between installments                                | -            |
| **due_date**                      | string    | Installment due date in calendar days                                   | -            |
| **due_principal**                 | float   | Remaining principal on the installment due date before its payment | -            |
| **has_interest**                  | boolean | _true_ - If true, interest applies to the installment                           | -            |
| **installment_number**            | integer    | Installment number                                                              | -            |
| **prefixed_amount**               | float   | Fixed interest amount paid on the installment                                      | -            |
| **principal_amortization_amount** | float   | Principal amount paid on the installment                                           | -            |
| **tax_amount**                    | float   | Base IOF amount of installment                                                            | -            |
| **amount**                        | float   | Installment total value                                                         | -            |
| **due_interest**                  | float     | Remaining interest after the installment due date before its payment                                   | -            |
| **period**                        | float     | Installment period | -            |
| **period_workdays**               | float     | Installment period in business days | -            |
| **period_to_disbursement**        | float     | Period until disbursement | -            |
| **period_workdays_to_disbursement**| float     | Business days until disbursement | -            |
| **calendar_days_to_disbursement** | integer    | Calendar days to disbursement | -            |
| **workdays**                      | integer    | Business days between installments | -            |
| **workdays_to_disbursement**      | integer    | Business days until disbursement | -            |

### Interest Rate Object
| Field             | Description                                                                             | 
|-------------------|---------------------------------------------------------------------------------------|
| **annual_rate**   | Annual fixed/floating interest rate expressed as a decimal                                      | -            |
| **daily_rate**    | Daily fixed/floating interest rate expressed as a decimal                                      | -            |
| **interest_base** | **[Interest Base Enumerator](#interest-base-enumerator)** - Interest calculation basis  | -            |
| **monthly_rate**  | Monthly fixed/floating interest rate expressed as a decimal                                      | -            |

### Tax Configuration Object
| Field                 | Description                                                                             | 
|-----------------------|---------------------------------------------------------------------------------------|
| **base_rate**         | Base IOF rate value                                                                | -            |
| **additional_rate**   | Additional IOF rate value                                                           | -            |

### Enumeratores

### Person Type Enumerator
| Enumerator             | Description             |
|------------------------|-----------------------|
| **legal**              | Legal person       |
| **natural**            | Natural person          |

### Account Type Enumerator
| Enumerator             | Description             |
|------------------------|-----------------------|
| **checking_account**   | Checking account        |

### Amount Type Enumerator
| Enumerator             | Description             |
|------------------------|-----------------------|
| **absolute**           | Absolute value        |
| **percentage**         | Percentage value      |

###  Interest Type Enumerator
| Enumerator           | Description                                                                                                                                                                |
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **pre_price_days**   | Price amortization method (equal installments) with daily fixed-rate interest calculation                                                                                     |
| **pre_price**        | Price amortization method (equal installments) with fixed-rate interest calculation over 30-day periods                                                                |

### Credit Operation Type Enumerator 
| Enumerator    | Description                      |
|---------------|--------------------------------|
| **ccb**       | Bank Credit Note    |

### Interest Base Enumerator 
| Enumerator            | Description                                                                 |
|-----------------------|---------------------------------------------------------------------------|
| **workdays**          | Interest calculation basis in business days, assuming a 252-day year    |
| **calendar_days**     | Interest calculation basis in calendar days, assuming a 360-day year |
| **calendar_days_365** | Interest calculation basis in calendar days, assuming a 365-day year |

###  Fee Type Enumerator
Each fee type must be previously enabled and configured by QI Tech

| Enumerator            | Description                                                                  |
|-----------------------|----------------------------------------------------------------------------|
| **spread**            | Premium included in the credit operation's acquisition value                  |
| **spread_ted_fee**    | Premium on the TED transfer fee |

### Origin Type Enumerator
Each fee type must be previously enabled and configured by QI Tech

| Enumerator            | Description                                                                  |
|-----------------------|----------------------------------------------------------------------------|
| **internal**          | Internal fee                                                   |
| **external**          | External fee                                                   |

---

# Homologation Roadmap - BNPL

URL: /en/documentation/manual_bnpl_ecommerce/

## Summary
The objective of this document is to guide all clients through the integration process of Buy Now Pay Later (BNPL) with QI Tech's platform.

This document outlines the key steps involved and addresses potential questions. For further details, please refer to the full documentation provided in **[item 10](#10---references)**.

## 1. Document upload
To receive the document_key for the debt issuance documents, you must upload them using the following request:

### Request Body Upload

ENDPOINT /upload
MÉTODO POST

Response Body

```json
{
  "document_key": "cfbc8469-89ea-4a80-9f64-ba7b1566c68b",
  "document_md5": "cd451103fa512frc98ce684d3896698c"
}
```

:::caution Atenção
Lembrar de salvar a **document_key**, chave essa necessária para a consulta do documento.
:::

### Exemplo de chamada

Exemplo para upload de uma imagem a partir de uma URL.

**Python**

```python

import jwt
import hashlib
import requests
from requests_toolbelt.multipart.encoder import MultipartEncoder
import json
from datetime import datetime

BASE_URL = "https://api-auth.sandbox.qitech.app"
API_KEY = "4c268c0a-53ff-429b-92b6-47ef98a6d89a" # Esta chave é um exemplo, por favor utilize sua própria chave
CLIENT_PRIVATE_KEY = ''''
-----BEGIN EC PRIVATE KEY-----
MIHbAgEBBEHh1hIeOPE5XNNhn6bxRAmVswsPZ0wZCmzVvP8Tl/LZK9ofVmRVGzll
srU1uezJEyHKYdOHrE2p52xUj+pHzjJvb6AHBgUrgQQAI6GBiQOBhgAEAAofUz1J
hBSOyGHLsnV9Sz0DSWmhl7U+ljqbfa8PKVFWSV3w16I1v2zME5/UzUhHn1gWsjnv
7/ekcLLAQbvqMPNXAfjIhFXLAPzqbB9iCuVua1v0Vgy52rBemOWrJka/Ws2bnKR8
h1N1OxOYeYr6C2jqMygBLktKMAs+282CEiEb4bIv
-----END EC PRIVATE KEY----- 
''' # Esta chave é um exemplo, por favor utilize sua própria chave

def get_document(url):
    try:
        response = requests.get(url)
        return response.content
    except Exception as error:
        print("Error fetching document:", error)
        raise

def upload_document(array_buffer):
    endpoint = "/upload"
    method = "POST"
    timestamp = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + "Z"
    md5_hash = hashlib.md5(array_buffer).hexdigest()

    jwt_header = {
        "typ": "JWT",
        "alg": "ES512",
    }

    jwt_body = {
        "payload_md5": md5_hash,
        "timestamp": timestamp,
        "method": method,
        "uri": endpoint,
    }

    encoded_header_token = jwt.encode(jwt_body, CLIENT_PRIVATE_KEY, algorithm="ES512", headers=jwt_header)

    signed_header = {
        "Authorization": encoded_header_token,
        "API-CLIENT-KEY": API_KEY,
        "Content-Type": "multipart/form-data",
    }

    url = f"{BASE_URL}{endpoint}"
    multipart_data = MultipartEncoder(
        fields={'file': ('image.jpeg', array_buffer, 'image/jpeg')}
    )
    signed_header['Content-Type'] = multipart_data.content_type

    try:
        response = requests.post(url, headers=signed_header, data=multipart_data)
        response_data = response.json()
        document_key = response_data.get('document_key')
        print(f'Response data is: {response_data} and document_key is: {document_key}')
        return document_key
    except Exception as error:
        print('Error:', error)
        raise

def main():
    file_url = "{FILE_URL}"

    document_buffer = get_document(file_url)

    document_key = upload_document(document_buffer)

    print("document_key is", document_key)

if __name__ == "__main__":
    main()

```
  

**Node.js**

```js
const jwt = require('jsonwebtoken')
const crypto = require('crypto')
const axios = require('axios')
const FormData = require('form-data')
const fs = require('fs')
const fetch = require('node-fetch')

async function getDocument(url) {
  try {
    const response = await axios.get(url, { responseType: 'arraybuffer' })
    return response.data
  } catch (error) {
    console.error('Error fetching document:', error)
    throw error
  }
}

async function uploadDocument(arrayBuffer) {
  const endpoint = '/upload'
  const method = 'POST'
  const timestamp = new Date().toISOString()
  const md5_hash = crypto.createHash('md5').update(arrayBuffer).digest('hex')
  const client_private_key = `-----BEGIN EC PRIVATE KEY-----
    MIHbAgEBBEHh1hIeOPE5XNNhn6bxRAmVswsPZ0wZCmzVvP8Tl/LZK9ofVmRVGzll
    srU1uezJEyHKYdOHrE2p52xUj+pHzjJvb6AHBgUrgQQAI6GBiQOBhgAEAAofUz1J
    hBSOyGHLsnV9Sz0DSWmhl7U+ljqbfa8PKVFWSV3w16I1v2zME5/UzUhHn1gWsjnv
    7/ekcLLAQbvqMPNXAfjIhFXLAPzqbB9iCuVua1v0Vgy52rBemOWrJka/Ws2bnKR8
    h1N1OxOYeYr6C2jqMygBLktKMAs+282CEiEb4bIv
    -----END EC PRIVATE KEY-----`; // Esta chave é um exemplo, por favor utilize sua própria chave
  const api_key = '4c268c0a-53ff-429b-92b6-47ef98a6d89a' // Esta chave é um exemplo, por favor utilize sua própria chave

  try {
    const jwt_header = {
      typ: 'JWT',
      alg: 'ES512',
    }

    const jwt_body = {
      payload_md5: md5_hash,
      timestamp: timestamp,
      method: method,
      uri: endpoint,
    }

    const encoded_header_token = jwt.sign(jwt_body, client_private_key, {
      algorithm: 'ES512',
      header: jwt_header,
    })

    const signed_header = {
      AUTHORIZATION: encoded_header_token,
      'API-CLIENT-KEY': api_key,
      'Content-Type': 'multipart/form-data',
    }

    const url = `${base_url}${endpoint}`
    const formData = new FormData()
    formData.append('file', Buffer.from(arrayBuffer), {
      filename: 'image.jpeg',
    })

    fetch(url, {
      method: 'POST',
      headers: signed_header,
      body: formData,
    })
      .then(data => {
        console.log('Response data is: ' + data)

        return data.document_key
      })
      .catch(error => {
        console.log('Error: ' + error)
      })
  } catch (error) {
    console.error('Error:', error)
  }
}

async function main() {
  const fileUrl = '<URL_LINK_TO_DOCUMENT_IMAGE>'
  const documentBuffer = await getDocument(fileUrl)
  const documentKey = await uploadDocument(documentBuffer)

  console.log('Document key is: ' + documentKey)
}

main()
```

- OBS: The example above uses the library [node-fetch](https://www.npmjs.com/package/node-fetch) to make the call, but you can use the library of your choice. The important thing is that the call must be made using the POST method, with the `Content-Type` header set to `multipart/form-data` and the body must be a FormData object with the key `file` and the value as the file binary to be sent.

:::warning Aviso
The 'Axios' library has a bug that causes FormData to be sent empty. The issue can be seen on the [GitHub repository](https://github.com/axios/axios/issues/5986). If this problem has not yet been resolved at the time of your integration, we suggest using the 'node-fetch' library to make this call.
:::

  

## 2. Debt Simulation

### Request Debt Simulation

At QI Tech, we provide our clients with the ability to simulate the values of a credit operation before it is actually issued. The simulation follows the same pattern as the debt issuance request, but it is not necessary to provide the debtor’s registration and disbursement account details. The following endpoint is a simplified version of /debt_simulation, but much more optimized. It is used to calculate only one disbursement option.

ENDPOINT /v2/credit_operation/simulation
METHOD POST

Request Body

```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
}
```

### Request Body Details

| Field  | Type   | Description | Max. Char. |
|---|--- |---|---|
| **credit_operation_type***                 | enum    | **[Enumerator Credit Operation Type](#Enumerator-credit-operation-type)** - Type of credit agreement      | -            |
| **disbursed_issue_amount***                | float   | The value actually released to the borrower      | -            |
| **disbursement_date***                     | date    | The specific date the loan funds are made available      | -            |
| **first_due_date***                        | date    | Due date of the first installment      | -            |
| **force_installments_on_workdays***        | boolean | _true_ - If true, all due dates will fall on business days     | -            |
| **interest_type***                         | enum    | **[Enumerator Interest Type](#Enumerator-interest-type)** - Amortization method      | -            |
| **issuer_person_type***                    | enum    | **[Enumerator Person Type](#Enumerator-person-type)**      | -            |
| **monthly_interest_rate***                 | float   | Monthly interest rate      | -            |
| **number_of_installments***                | int     | Number of installments      | -            |
| **principal_amortization_month_period***   | int     | Period, in months, between installments      | -            |

### Response Debt Simulation

STATUS 200

Response Body

```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": [
    {
      "amount": 0.0,
      "fee_amount": 0.0,
      "amount_type": "absolute",
      "fee_type": "tac",
      "type": "external"
    },
    {
      "amount": 0.0,
      "fee_amount": 0.0,
      "amount_type": "absolute",
      "fee_type": "spread",
      "type": "external"
    },
    {
      "amount": 0.2,
      "fee_amount": 0.07,
      "amount_type": "percentage",
      "fee_type": "spread",
      "type": "internal"
    }
  ],
  "first_due_date": "2024-09-25",
  "installments": [
    {
      "due_date": "2024-09-25",
      "amount": 19.5,
      "due_principal": 36.14,
      "due_interest": 0.0,
      "has_interest": true,
      "period": 0.6129032258064516,
      "period_workdays": 0.6190476190476191,
      "calendar_days": 19,
      "workdays": 13,
      "installment_number": 1,
      "period_to_disbursement": 0.6129032258064516,
      "prefixed_amount": 1.58227236,
      "period_workdays_to_disbursement": 1.0,
      "calendar_days_to_disbursement": 19,
      "workdays_to_disbursement": 13,
      "tax_amount": 0.02791582,
      "principal_amortization_amount": 17.91772764
    },
    {
      "due_date": "2024-10-25",
      "amount": 19.5,
      "due_principal": 18.22227236,
      "due_interest": 0.0,
      "has_interest": true,
      "period": 1.0,
      "period_workdays": 1.0,
      "calendar_days": 30,
      "workdays": 22,
      "installment_number": 2,
      "period_to_disbursement": 1.6129032258064515,
      "prefixed_amount": 1.27772764,
      "period_workdays_to_disbursement": 2.0,
      "calendar_days_to_disbursement": 49,
      "workdays_to_disbursement": 35,
      "tax_amount": 0.07321709,
      "principal_amortization_amount": 18.22227236
    }
  ],
  "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
}
```

### Response Body Details
| Campo                                   | Tipo   | Description                                                                                                                     | Máx. Caract. |
|-----------------------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------|--------------|
| **annual_cet**                          | float  | Total effective cost expressed as a decimal per year                                                                                | -            |
| **assignment_amount**                   | float  | Acquisition value of the credit operation                                                                                     | -            |
| **cet**                                 | float  | Total effective cost expressed as a decimal per month.                                                                                | -            |
| **fees**                                | object | **[Object Fees](#object-fees)** - List of QI Tech fees charged on the operation                            | -            |
| **disbursed_amount**                    | float  | Amount disbursed in the credit operation                                                                                     | -            |
| **disbursement_date**                   | date   | Disbursement date of the operation                                                                                                | -            |
| **installments**                        | list   | **[Object Installments](#object-installments)** - Installments of the operation                                                        | -            |
| **interest_type**                       | enum   | **[Enumerator Interest Type](#Enumerator-interest-type)** - Amortization method and interest calculation method                 | -            |
| **additional_iof**                      | float  | Additional IOF amount                                                                                                        | -            |
| **base_iof**                            | float  | Base IOF amount                                                                                                             | -            |
| **total_iof**                           | float  | Total IOF amount                                                                                                            | -            |
| **issue_amount**                        | float  | Issue/nominal value of the credit operation                                                                               | -            |
| **tax_configuration**                   | object | **[Object Tax Configuration](#object-tax-configuration)** - Rate iof values                                             | -            |
| **first_due_date**                      | date   | Due date of the first installment                                                                                        | -            |
| **prefixed_interest_rate**              | object | **[Object Interest Rate](#object-interest-rate)** - Nominal interest rate                              | -            |

### Object Fees
| Campo           | Tipo  | Description                                                                                           | Máx. Caract. |
|-----------------|-------|-----------------------------------------------------------------------------------------------------|--------------|
| **amount**      | float | Fee amount (in percentage or absolute value, depending on the value provided in the amount_type field)| -            |
| **amount_type** | enum  | **[Enumerators amount_type](#Enumerator-amount-type)** - Fee value unit                   | -            |
| **fee_amount**  | float | Absolute value of the fee charged in the operation                                                           | -            |
| **fee_type**    | enum  | **[Enumerator Fee Type](#Enumerator-fee-type)** - Type of fee charged in the operation                   | -            |
| **type**        | enum  | **[Enumerator Origin Type](#Enumerator-origin-type)** - Source of the fee charged in the operation                         | -            |

### Object Installments
| Campo                             | Tipo    | Description                                                                      | Máx. Caract. |
|-----------------------------------|---------|--------------------------------------------------------------------------------|--------------|
| **calendar_days**                 | int     | Number of calendar days between installments                                | -            |
| **due_date**                      | date    | Installment due date in calendar days                                   | -            |
| **due_principal**                 | float   | Remaining principal on the installment due date before its payment | -            |
| **has_interest**                  | boolean | _true_ - If true, interest applies to the installment                           | -            |
| **installment_number**            | int     | Installment number                                                              | -            |
| **prefixed_amount**               | float   | Fixed interest amount paid on the installment                                      | -            |
| **principal_amortization_amount** | float   | Principal amount paid on the installment                                           | -            |
| **tax_amount**                    | float   | Base IOF amount of installment                                                            | -            |
| **amount**                        | float   | Installment total value                                                         | -            |
| **due_interest**                  | float     | Remaining interest after the installment due date before its payment                                   | -            |
| **period**                        | float     | Installment period | -            |
| **period_workdays**               | float     | Installment period in business days | -            |
| **period_to_disbursement**        | float     | Period until disbursement | -            |
| **period_workdays_to_disbursement**| float     | Business days until disbursement | -            |
| **calendar_days_to_disbursement** | int     | Calendar days to disbursement | -            |
| **workdays**                      | int     | Business days between installments | -            |
| **workdays_to_disbursement**      | int     | Business days until disbursement | -            |

### Object Interest Rate
| Campo             | Description                                                                             | Máx. Caract. |
|-------------------|---------------------------------------------------------------------------------------|--------------|
| **annual_rate**   | Annual fixed/floating interest rate expressed as a decimal                                      | -            |
| **daily_rate**    | Daily fixed/floating interest rate expressed as a decimal                                      | -            |
| **interest_base** | **[Enumerator Interest Base](#Enumerator-interest-base)** - Interest calculation basis  | -            |
| **monthly_rate**  | Monthly fixed/floating interest rate expressed as a decimal                                      | -            |

### Object Tax Configuration
| Campo                 | Description                                                                             | Máx. Caract. |
|-----------------------|---------------------------------------------------------------------------------------|--------------|
| **base_rate**         | Base IOF rate value                                                                | -            |
| **additional_rate**   | Additional IOF rate value                                                           | -            |

### Enumeratores

#### Enumerator _Person Type_
| Enumerator             | Description             |
|------------------------|-----------------------|
| **legal**              | Legal person       |
| **natural**            | Natural person          |

#### Enumerator _Account Type_
| Enumerator             | Description             |
|------------------------|-----------------------|
| **checking_account**   | Checking account        |
| **deposit_account**    | Deposit account     |
| **guaranteed_account** | Guaranteed account     |
| **investment_account** | Investment account |
| **payment_account**    | Payment account    |
| **saving_account**     | Saving account        |
| **salary_account**     | Salary account         |

#### Enumerator _Amount Type_
| Enumerator             | Description             |
|------------------------|-----------------------|
| **absolute**           | Absolute value        |
| **percentage**         | percentage value      |

#### Enumerator _Interest Type_
| Enumerator           | Description                                                                                                                                                                |
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **pre_price_days**   | Price amortization method (equal installments) with daily fixed-rate interest calculation                                                                                     |
| **pre_price**        | Price amortization method (equal installments) with fixed-rate interest calculation over 30-day periods                                                                |
| **pre_sac**          | Constant principal amortization (SAC system) with interest calculated daily on a fixed-rate basis                                                                                 |
| **post_sac**         | Constant principal amortization (SAC system) with daily interest calculation based on a fixed rate plus a floating-rate index (e.g., CDI, IPCA, or IGPM)                  |
| **post_price**       | Price amortization method (equal installments) with interest calculated over 30-day periods based on a fixed rate plus a floating-rate index (e.g., CDI, IPCA, or IGPM) |
| **post_price_days**  | Price amortization method (equal installments) with daily interest calculation based on a fixed rate plus a floating-rate index (e.g., CDI, IPCA, or IGPM)                      |

#### Enumerator _Credit Operation Type_
| Enumerator    | Description                      |
|---------------|--------------------------------|
| **ccb**       | CCB     |
| **cce**       | CCE |
| **cci**       | CCI  |
| **nce**       | NCE   |

#### Enumerator _Interest Base_
| Enumerator            | Description                                                                 |
|-----------------------|---------------------------------------------------------------------------|
| **workdays**          | Interest calculation basis in business days, assuming a 252-day year    |
| **calendar_days**     | Interest calculation basis in calendar days, assuming a 360-day year |
| **calendar_days_365** | Interest calculation basis in calendar days, assuming a 365-day year |

#### Enumerator _Fee Type_
Each fee type must be previously enabled and configured by QI Tech

| Enumerator            | Description                                                                  |
|-----------------------|----------------------------------------------------------------------------|
| **tac**               | Registration Fee                                             |
| **spread**            | Premium included in the credit operation's acquisition value                  |
| **warranty_analysis** | Collateral analysis fee                                             |
| **ted_fee**           | TED transfer fee                                                              |
| **spread_ted_fee**    | Premium on the TED transfer fee |

#### Enumerator _Origin Type_
Each fee type must be previously enabled and configured by QI Tech

| Enumerator            | Description                                                                  |
|-----------------------|----------------------------------------------------------------------------|
| **internal**          | Internal fee                                                   |
| **external**          | External fee                                                   |

## 3. Debt Issuance for Individuals

This endpoint issues the debt and processes the contract signature via opt-in. Immediately after issuance, the debt is automatically disbursed. It is not necessary to pre-register the borrower; simply provide the registration details at the time of the debt request.  

### Request

ENDPOINT /signed_debt
METHOD POST

Request Body

```json
{
    "simplified": true,
    "additional_data": {
        "contract": {
            "contract_number": "TIK11267101212",
            "signed": true,
            "signatures": [
                {
                    "signer": {
                        "name": "Alan Mathison Turing",
                        "phone": {
                            "number": "912345678",
                            "area_code": "11",
                            "country_code": "055"
                        },
                        "email": "alan.turing@email.com",
                        "document_number": "96969879003"
                    },
                    "signature": {
                        "ip_address": "168.211.22.84",
                        "timestamp": "27-10-2025 11:07:15",
                        "signature_file": {
                            "file_url": "http://qitech.com.br/signature.pdf",
                            "file_type": "pdf"
                        },
                        "geolocation": {
                            "long": "",
                            "lat": ""
                        },
                        "fingerprint_device": null
                    }
                }
            ]
        }
    },
    "financial": {
        "number_of_installments": 3,
        "credit_operation_type": "ccb",
        "interest_type": "pre_price_days",
        "annual_interest_rate": 3.81790482,
        "disbursed_amount": 200,
        "fine_configuration": {
            "contract_fine_rate": 0.02,
            "monthly_rate": 0.15,
            "interest_base": "calendar_days"
        },
        "interest_grace_period": 0,
        "rebates": null,
        "issue_date": "2025-10-27",
        "disbursement_date": "2025-10-27",
        "first_due_date": "2025-11-27",
        "principal_grace_period": 0
    },
    "disbursement_bank_accounts": [
        {
            "account_digit": "5",
            "document_number": "32402502000135",
            "bank_code": "329",
            "account_number": "00002",
            "percentage_receivable": 100,
            "branch_number": "0001",
            "name": "CONTA LOJISTA"
        }
    ],
    "purchaser_document_number": "32402502000135",
    "borrower": {
        "email": "alan.turing@email.com",
        "document_identification": "494598fd-c226-4332-a500-591ae3884673",
        "document_identification_back": "494598fd-c226-4332-a500-591ae3884673",
        "birth_date": "1990-11-20",
        "person_type": "natural",
        "profession": "Public server",
        "individual_document_number": "96969879003",
        "address": {
            "city": "São Paulo",
            "neighborhood": "CENTRO",
            "street": "Avenida Feliz",
            "complement": "AP 801",
            "postal_code": "49026100",
            "state": "SP",
            "number": "1000"
        },
        "phone": {
            "country_code": "055",
            "number": "912345678",
            "area_code": "11"
        },
        "mother_name": "MARIA TURING",
        "marital_status": "married",
        "nationality": "",
        "document_identification_number": "96969879003",
        "name": "Alan Mathison Turing"
    }
}
```

### Response

The response to this debt request will return the payment plan as well as a **DEBT-KEY**, which is the identifier of the debt in QI SCD.

STATUS 201

Response Body

```json
{
    "webhook_type": "debt",
    "key": "1ebd4a90-2721-4c39-a399-427fa16bca65",
    "status": "waiting_signature",
    "event_datetime": "2025-10-27 17:09:31",
    "data": {
        "borrower": {
            "name": "Alan Mathison Turing",
            "document_number": "96969879003",
            "related_party_key": "d6353266-30bc-4ab1-964e-2c7a643d8ba2"
        },
        "contract": {
            "document_key": "c8b191cb-7b90-4e37-9280-397a597babc1",
            "number": "TIK11267101212",
            "urls": [
                "https://storage.googleapis.com/sandbox-doc-api/documents/c8b191cb-7b90-4e37-9280-397a597babc1/RAFAELAEBENJAMINFINANCEIRALTDA-ALAN_MATHISON_TURING-CCB-TIK11267101212-20251027170925.pdf"
            ],
            "signature_information": [
                {
                    "signer_name": "Alan Mathison Turing",
                    "signer_document_number": "96969879003",
                    "signer_role": "issuer",
                    "signer_email": "alan.turing@email.com",
                    "signer_external_key": null,
                    "signature_url": null
                }
            ]
        },
        "requester_identifier_key": "1ebd4a90-2721-4c39-a399-427fa16bca65",
        "iof_charge_method": "financed",
        "collaterals": [],
        "contract_fees": [
            {
                "fee_type": "spread",
                "fee_amount": 1.01
            },
            {
                "fee_type": "spread_ted_fee",
                "fee_amount": 0.5
            }
        ],
        "external_contract_fees": [],
        "external_contract_fee_amount": 0,
        "net_external_contract_fee_amount": 0,
        "contract_fee_amount": 1.51,
        "issue_amount": 201.84,
        "assignment_amount": 203.35,
        "cet": "14,7500%",
        "annual_cet": "421,3334%",
        "number_of_installments": 3,
        "base_iof": 1.06,
        "additional_iof": 0.78,
        "total_iof": 1.84,
        "ipoc_code": "324025020203196969879003TIK11267101212",
        "prefixed_interest_rate": {
            "annual_rate": 3.81790482,
            "created_at": "2025-10-27T17:09:25",
            "daily_rate": 0.0043771607,
            "interest_base": "calendar_days",
            "monthly_rate": 0.14
        },
        "installments": [
            {
                "accrual_reference_date": null,
                "additional_costs": [],
                "advanced_paid_amount": 0,
                "bank_slip_key": null,
                "business_due_date": "2025-11-28",
                "calendar_days": 31,
                "digitable_line": null,
                "due_date": "2025-11-27",
                "due_interest": 0,
                "due_principal": 201.84,
                "fine_amount": null,
                "has_interest": true,
                "installment_history": [],
                "installment_key": "e25fb146-0a61-4319-a722-d01b2213d0f9",
                "installment_number": 1,
                "installment_payment": [],
                "installment_status": "created",
                "installment_type": "principal",
                "original_due_principal": 201.84,
                "original_pre_fixed_amount": 29.26477451,
                "original_principal_amortization_amount": 58.16522549,
                "original_total_amount": 87.43,
                "paid_amount": 0,
                "paid_at": null,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 29.26477451,
                "principal_amortization_amount": 58.16522549,
                "qr_code_key": null,
                "qr_code_url": null,
                "renegotiation_proposal_key": null,
                "tax_amount": 0.147856,
                "total_accrual_amount": null,
                "total_amount": 87.43,
                "total_paid_amount": 0,
                "workdays": 22
            },
            {
                "accrual_reference_date": null,
                "additional_costs": [],
                "advanced_paid_amount": 0,
                "bank_slip_key": null,
                "business_due_date": "2025-12-30",
                "calendar_days": 30,
                "digitable_line": null,
                "due_date": "2025-12-27",
                "due_interest": 0,
                "due_principal": 143.67477451,
                "fine_amount": null,
                "has_interest": true,
                "installment_history": [],
                "installment_key": "2557de2b-6df1-4a8a-b46a-59206ece157f",
                "installment_number": 2,
                "installment_payment": [],
                "installment_status": "created",
                "installment_type": "principal",
                "original_due_principal": 143.67477451,
                "original_pre_fixed_amount": 20.11446867,
                "original_principal_amortization_amount": 67.31553133,
                "original_total_amount": 87.43,
                "paid_amount": 0,
                "paid_at": null,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 20.11446867,
                "principal_amortization_amount": 67.31553133,
                "qr_code_key": null,
                "qr_code_url": null,
                "renegotiation_proposal_key": null,
                "tax_amount": 0.33671229,
                "total_accrual_amount": null,
                "total_amount": 87.43,
                "total_paid_amount": 0,
                "workdays": 20
            },
            {
                "accrual_reference_date": null,
                "additional_costs": [],
                "advanced_paid_amount": 0,
                "bank_slip_key": null,
                "business_due_date": "2026-01-28",
                "calendar_days": 31,
                "digitable_line": null,
                "due_date": "2026-01-27",
                "due_interest": 0,
                "due_principal": 76.35924318,
                "fine_amount": null,
                "has_interest": true,
                "installment_history": [],
                "installment_key": "cc503d1d-6387-4a1f-bd78-62b248d02ec8",
                "installment_number": 3,
                "installment_payment": [],
                "installment_status": "created",
                "installment_type": "principal",
                "original_due_principal": 76.35924318,
                "original_pre_fixed_amount": 11.07075682,
                "original_principal_amortization_amount": 76.35924318,
                "original_total_amount": 87.43,
                "paid_amount": 0,
                "paid_at": null,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 11.07075682,
                "principal_amortization_amount": 76.35924318,
                "qr_code_key": null,
                "qr_code_url": null,
                "renegotiation_proposal_key": null,
                "tax_amount": 0.57605413,
                "total_accrual_amount": null,
                "total_amount": 87.43,
                "total_paid_amount": 0,
                "workdays": 21
            }
        ],
        "total_pre_fixed_amount": 60.45
    }
}
```

:::info **Main fields definitions***
For any doubts, feel free to consult QI Tech's **[documentation](https://docs.qitech.com.br/en/documentation/emissao_de_divida/emissao/emissao_de_divida_pf/index.html)** with the explanation of every field of Debt insuance API.
:::

## 4. Webhooks

After the successful response, you will receive a webhook with the signed CCB and a webhook indicating the disbursement's success or failure.

### Signature webhook

Response Body

```json
{
  "webhook": {
    "key": "1ebd4a90-2721-4c39-a399-427fa16bca65",
    "status": "signature_finished",
    "webhook_type": "debt",
    "event_datetime": "2025-10-27 17:09:33",
    "signed_contract_url": "https://storage.googleapis.com/sandbox-doc-api/documents/c8b191cb-7b90-4e37-9280-397a597babc1/RAFAELAEBENJAMINFINANCEIRALTDA-ALAN_MATHISON_TURING-CCB-TIK11267101212-20251027170925_signed.pdf"
  }
}

```

### Disbursement webhook

Response Body

```json
{
  "webhook": {
    "key": "1ebd4a90-2721-4c39-a399-427fa16bca65",
    "data": {
      "installments": [
        {
          "due_date": "2025-11-27",
          "total_amount": 87.43,
          "installment_key": "e25fb146-0a61-4319-a722-d01b2213d0f9",
          "pre_fixed_amount": 29.26477451,
          "installment_number": 1,
          "principal_amortization_amount": 58.16522549
        },
        {
          "due_date": "2025-12-27",
          "total_amount": 87.43,
          "installment_key": "2557de2b-6df1-4a8a-b46a-59206ece157f",
          "pre_fixed_amount": 20.11446867,
          "installment_number": 2,
          "principal_amortization_amount": 67.31553133
        },
        {
          "due_date": "2026-01-27",
          "total_amount": 87.43,
          "installment_key": "cc503d1d-6387-4a1f-bd78-62b248d02ec8",
          "pre_fixed_amount": 11.07075682,
          "installment_number": 3,
          "principal_amortization_amount": 76.35924318
        }
      ],
      "ted_receipt_list": [],
      "requester_identifier_key": null
    },
    "status": "disbursed",
    "webhook_type": "debt",
    "event_datetime": "2025-10-27 17:10:21"
  }
}

```

If the debt fails to disburse, or is returned, you will receive a cancellation webhook.

### Cancelation webhook

Response Body

```json
{
     "webhook_type": "debt",
     "key":"1ebd4a90-2721-4c39-a399-427fa16bca65",
     "event_datetime": "2025-10-27 16:38:59",
    "data": {
        "cancel_reason": "Operacao cancelada manualmente",
        "cancel_reason_enumerator": "manual"
    },
     "status":"canceled "
  }

```

****Cancelation reasons****

| cancel_reason_enumerator | Description |  
|---|---|  
|disbursing_error|Operation canceled due to an error during disbursement.  
|waiting_signature |Operation canceled due to missing signature. 
|pix_max_retry|Operation canceled because the receiving bank could not process the disbursement.  
|manual|Operation canceled manually.  
|agencia_conta_invalida|Invalid agency or recipient account number.  
|invalid_account|The destination account number is nonexistent or invalid.  
|invalid_document_number|The CPF/CNPJ of the destination account is incorrect.  
|unsupported_transaction|The destination account does not support this type of transaction.  
|invalid_ispb|The ISPB number is invalid or nonexistent.  
|rejected_payment|Payment order was rejected by the receiving bank.  
| refund_after_payee_request | Refund requested by the payee                                                |
| invalid_account            | The destination account number is nonexistent or invalid.                    |
| invalid_document_number    | The CPF/CNPJ of the destination account is incorrect.                        |
| rejected_payment           | Payment rejected by the receiving bank.                                      |
| blocked_account            | The destination account is blocked.                                          |
| unsupported_transaction    | The destination account does not support this type of transaction.           |
| amount_too_great           | Payment/refund amount exceeds the limit for the credited destination account. |
| invalid_ispb               | The ISPB number is invalid or nonexistent.                                   |
| receiver_error             | Transaction interrupted due to error on the receiver's PSP.                  |
| closed_account             | The destination account is closed.                                           |
| disbursing_hour_closed     | Disbursement occurred outside of the allowed time frame.                     |
| unregistered_pix_key       | The Pix key is not being used.                                               |
| manual                     | Operation manually canceled.                                                 |
| spi_timeout                | Timeout control in SPI.                                                     |

## 5. Debt installments
If QI Tech is the collection agent for the operation, there is a specific API to retrieve information about the installments. The statuses that can be configured are:

- webhook_type: installment.status_change
- Webhook status: opened, paid, waiting_payment, paid_early, paid_partial, overdue, paid_partial_overdue and paid_overdue

### Examples

****Paid Installment****

```json
{
  "webhook": {
    "key": "1ebd4a90-2721-4c39-a399-427fa16bca65",
    "data": {
      "status": "paid",
      "installment": {
        "events": [
          {
            "amount": null,
            "created_at": null,
            "event_date": "2025-10-27T17:10:21",
            "old_due_date": null,
            "installment_event_type": {
              "enumerator": "open",
              "translation_path": "co.InstallmentEventType.open"
            },
            "installment_old_status": {
              "enumerator": "created",
              "translation_path": "co.InstallmentStatus.created"
            }
          },
          {
            "amount": 87.43,
            "created_at": "2025-10-27T17:10:21",
            "event_date": "2025-10-27T17:10:21",
            "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": "2025-10-27T17:10:21",
        "due_date": "2026-01-27",
        "workdays": 21,
        "created_at": "2025-10-27T17:09:25",
        "tax_amount": 0.57605413,
        "updated_at": "2025-10-27T17:10:21",
        "fine_amount": null,
        "paid_amount": 87.43,
        "qr_code_key": null,
        "qr_code_url": null,
        "due_interest": 0.0,
        "has_interest": true,
        "payment_type": {
          "enumerator": "bankslip",
          "translation_path": "co.PaymentType.bankslip"
        },
        "total_amount": 87.43,
        "bank_slip_key": null,
        "calendar_days": 31,
        "due_principal": 76.35924318,
        "digitable_line": null,
        "installment_key": "cc503d1d-6387-4a1f-bd78-62b248d02ec8",
        "additional_costs": [],
        "installment_type": {
          "enumerator": "principal",
          "translation_path": "co.InstallmentType.principal"
        },
        "pre_fixed_amount": 11.07075682,
        "business_due_date": "2026-01-28",
        "cetip_settlements": [],
        "post_fixed_amount": 0.0,
        "total_paid_amount": 0.0,
        "installment_number": 3,
        "installment_status": {
          "enumerator": "opened",
          "translation_path": "co.InstallmentStatus.opened"
        },
        "installment_history": [],
        "installment_payment": [],
        "advanced_paid_amount": 0.0,
        "total_accrual_amount": null,
        "original_total_amount": 87.43,
        "accrual_reference_date": null,
        "original_due_principal": 76.35924318,
        "original_pre_fixed_amount": 11.07075682,
        "renegotiation_proposal_key": null,
        "principal_amortization_amount": 76.35924318,
        "original_principal_amortization_amount": 76.35924318
      },
      "is_finished": false
    },
    "webhook_type": "installment.status_change"
  }
}
```

****Bank slips data****

```json
{
    "key": "1ebd4a90-2721-4c39-a399-427fa16bca65",
    "data": {
        "status": "update",
        "installments": [
            {
                "due_date": "2025-11-27",
                "qr_code_key": "eeb4f5a6-6cba-4901-8113-21c7261b54ac",
                "qr_code_url": "00020126930014br.gov.bcb.pix2571qrcode-h.sandbox.qitech.app/bacen/cobv/eeb4f5a66cba4901811321c7261b54ac5204000053039865802BR5925QISOCIEDADEDECREDITODIRET6008SaoPaulo61080145200062070503***6304D300",
                "total_amount": 87.43,
                "bank_slip_key": "524440c0-302b-4553-8211-5cf012f2e718",
                "digitable_line": "32990001031000700326159000000204112780000008743",
                "installment_key": "e25fb146-0a61-4319-a722-d01b2213d0f9",
                "pre_fixed_amount": 29.26477451,
                "principal_amortization_amount": 58.16522549
            },
            {
                "due_date": "2025-12-27",
                "qr_code_key": "98781ab0-318a-43c4-9ce6-fdc22514c540",
                "qr_code_url": "00020126930014br.gov.bcb.pix2571qrcode-h.sandbox.qitech.app/bacen/cobv/98781ab0318a43c49ce6fdc22514c5405204000053039865802BR5925QISOCIEDADEDECREDITODIRET6008SaoPaulo61080145200062070503***63040687",
                "total_amount": 87.43,
                "bank_slip_key": "ece5355a-4b51-48af-aa4b-f074b93c9fef",
                "digitable_line": "32990001031000700326160000000202613080000008743",
                "installment_key": "2557de2b-6df1-4a8a-b46a-59206ece157f",
                "pre_fixed_amount": 20.11446867,
                "principal_amortization_amount": 67.31553133
            },
            {
                "due_date": "2026-01-27",
                "qr_code_key": "289792ad-3e5a-4308-8e3d-7b75afe0fea5",
                "qr_code_url": "00020126930014br.gov.bcb.pix2571qrcode-h.sandbox.qitech.app/bacen/cobv/289792ad3e5a43088e3d7b75afe0fea55204000053039865802BR5925QISOCIEDADEDECREDITODIRET6008SaoPaulo61080145200062070503***630443CC",
                "total_amount": 87.43,
                "bank_slip_key": "09888b40-6844-4c8c-a474-f22a94e463a9",
                "digitable_line": "32990001031000700326161000000200313390000008743",
                "installment_key": "cc503d1d-6387-4a1f-bd78-62b248d02ec8",
                "pre_fixed_amount": 11.07075682,
                "principal_amortization_amount": 76.35924318
            }
        ]
    },
    "webhook_type": "installment.status_change"
}

```

Furthermore, there is an option to retrieve the duplicate copy of the installment:

ENDPOINT /bank_slip/2-way/ BANK_SLIP_KEY*
METHOD PATCH

`*BANK_SLIP_KEY (string): Payment slip identification key.`

****Duplicate Copy****

```json
{
  "key": "1150f778-b479-42ab-b76b-c6a76cdfcf50",
  "data": {
    "status": "update",
    "installments": [
      {
        "due_date": "2024-12-02",
        "qr_code_key": "56da9761-a425-488d-a65c-e54680346533",
        "qr_code_url": "00020126830014br.gov.bcb.pix2561qrcode.qitech.app/bacen/cobv/56da9761a425488da65ce543047339",
        "total_amount": 16.2,
        "bank_slip_key": "27e70d92-caee-4fe2-92f3-f967fd26ce70",
        "digitable_line": "32990001031000000000908001075103782160000759600",
        "installment_key": "e80a53c6-080a-48d6-ba12-dd01459650ed",
        "pre_fixed_amount": 16.2,
        "principal_amortization_amount": 0
      },
      {
        "due_date": "2025-03-05",
        "qr_code_key": "fbea5390-3a77-4432-b8f3-d174aff9c048",
        "qr_code_url": "00020126830014br.gov.bcb.pix2561qrcode.qitech.app/bacen/cobv/56da9761a425488da65ce543047339",
        "total_amount": 84.12,
        "bank_slip_key": "82f5741b-9cf6-4a9c-b9b4-8fcc29a94969",
        "digitable_line": "32990001031000000000908001075103782160000759600",
        "installment_key": "c8c43838-2ff0-4d4e-af1e-35ac20255030",
        "pre_fixed_amount": 47.5953627,
        "principal_amortization_amount": 36.5246373
      }
    ]
  },
  "webhook_type": "installment.status_change"
}

```

## 6. Debt inquiry

You can also query the debt later to retrieve information or track its status:

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

### Path params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|   
| `credit_operation_key` * | string | Chave da operação de crédito. | UUID |

### Response

STATUS 200

Response Body

```json
{
    "credit_operation_key": "1ebd4a90-2721-4c39-a399-427fa16bca65",
    "issue_amount": 201.84,
    "origin_key": "1ebd4a90-2721-4c39-a399-427fa16bca65",
    "total_iof": 1.84,
    "disbursement_start_date": "2025-10-27",
    "disbursement_end_date": "2025-10-27",
    "issue_date": "2025-10-27",
    "requester_identifier_key": "1ebd4a90-2721-4c39-a399-427fa16bca65",
    "installments": [
        {
            "business_due_date": "2025-11-28",
            "due_date": "2025-11-27",
            "calendar_days": 31,
            "due_interest": 0,
            "due_principal": 201.84,
            "fine_amount": 0,
            "has_interest": true,
            "post_fixed_amount": 0,
            "pre_fixed_amount": 29.26,
            "principal_amortization_amount": 58.17,
            "tax_amount": 0.15,
            "total_amount": 87.43,
            "workdays": 22,
            "accrual_reference_date": null,
            "advanced_paid_amount": 0,
            "bank_slip_key": "524440c0-302b-4553-8211-5cf012f2e718",
            "digitable_line": "32990001031000700326159000000204112780000008743",
            "installment_key": "e25fb146-0a61-4319-a722-d01b2213d0f9",
            "installment_status": "opened",
            "installment_type": "principal",
            "original_due_principal": 201.84,
            "original_pre_fixed_amount": 29.26,
            "original_principal_amortization_amount": 58.17,
            "paid_amount": 0,
            "original_total_amount": 87.43,
            "qr_code_key": "eeb4f5a6-6cba-4901-8113-21c7261b54ac",
            "qr_code_url": "00020126930014br.gov.bcb.pix2571qrcode-h.sandbox.qitech.app/bacen/cobv/eeb4f5a66cba4901811321c7261b54ac5204000053039865802BR5925QISOCIEDADEDECREDITODIRET6008SaoPaulo61080145200062070503***6304D300",
            "renegotiation_proposal_key": null,
            "total_accrual_amount": 0,
            "total_paid_amount": 0,
            "installment_number": 1,
            "paid_at": null,
            "updated_at": "2025-10-27T17:10:21",
            "principal_amortization_payment_amount": 0,
            "prefixed_interest_payment_amount": 0
        },
        {
            "business_due_date": "2025-12-30",
            "due_date": "2025-12-27",
            "calendar_days": 30,
            "due_interest": 0,
            "due_principal": 143.67477451,
            "fine_amount": 0,
            "has_interest": true,
            "post_fixed_amount": 0,
            "pre_fixed_amount": 20.11,
            "principal_amortization_amount": 67.32,
            "tax_amount": 0.34,
            "total_amount": 87.43,
            "workdays": 20,
            "accrual_reference_date": null,
            "advanced_paid_amount": 0,
            "bank_slip_key": "ece5355a-4b51-48af-aa4b-f074b93c9fef",
            "digitable_line": "32990001031000700326160000000202613080000008743",
            "installment_key": "2557de2b-6df1-4a8a-b46a-59206ece157f",
            "installment_status": "opened",
            "installment_type": "principal",
            "original_due_principal": 143.67,
            "original_pre_fixed_amount": 20.11,
            "original_principal_amortization_amount": 67.32,
            "paid_amount": 0,
            "original_total_amount": 87.43,
            "qr_code_key": "98781ab0-318a-43c4-9ce6-fdc22514c540",
            "qr_code_url": "00020126930014br.gov.bcb.pix2571qrcode-h.sandbox.qitech.app/bacen/cobv/98781ab0318a43c49ce6fdc22514c5405204000053039865802BR5925QISOCIEDADEDECREDITODIRET6008SaoPaulo61080145200062070503***63040687",
            "renegotiation_proposal_key": null,
            "total_accrual_amount": 0,
            "total_paid_amount": 0,
            "installment_number": 2,
            "paid_at": null,
            "updated_at": "2025-10-27T17:10:21",
            "principal_amortization_payment_amount": 0,
            "prefixed_interest_payment_amount": 0
        },
        {
            "business_due_date": "2026-01-28",
            "due_date": "2026-01-27",
            "calendar_days": 31,
            "due_interest": 0,
            "due_principal": 76.35924318,
            "fine_amount": 0,
            "has_interest": true,
            "post_fixed_amount": 0,
            "pre_fixed_amount": 11.07,
            "principal_amortization_amount": 76.36,
            "tax_amount": 0.58,
            "total_amount": 87.43,
            "workdays": 21,
            "accrual_reference_date": null,
            "advanced_paid_amount": 0,
            "bank_slip_key": "09888b40-6844-4c8c-a474-f22a94e463a9",
            "digitable_line": "32990001031000700326161000000200313390000008743",
            "installment_key": "cc503d1d-6387-4a1f-bd78-62b248d02ec8",
            "installment_status": "opened",
            "installment_type": "principal",
            "original_due_principal": 76.36,
            "original_pre_fixed_amount": 11.07,
            "original_principal_amortization_amount": 76.36,
            "paid_amount": 0,
            "original_total_amount": 87.43,
            "qr_code_key": "289792ad-3e5a-4308-8e3d-7b75afe0fea5",
            "qr_code_url": "00020126930014br.gov.bcb.pix2571qrcode-h.sandbox.qitech.app/bacen/cobv/289792ad3e5a43088e3d7b75afe0fea55204000053039865802BR5925QISOCIEDADEDECREDITODIRET6008SaoPaulo61080145200062070503***630443CC",
            "renegotiation_proposal_key": null,
            "total_accrual_amount": 0,
            "total_paid_amount": 0,
            "installment_number": 3,
            "paid_at": null,
            "updated_at": "2025-10-27T17:10:21",
            "principal_amortization_payment_amount": 0,
            "prefixed_interest_payment_amount": 0
        }
    ],
    "first_due_date": "2025-11-27",
    "requester_key": "6ca83592-ce8c-42f5-ac0d-5ce182dbe794",
    "original_total_iof": null,
    "contract_number": "TIK11267101212",
    "credit_operation_status_enumerator": "opened",
    "operation_type_enumerator": "structured_operation",
    "disbursement_date": "2025-10-27",
    "issuer_name": "Alan Mathison Turing",
    "issuer_document_number": "96969879003",
    "external_contract_fees": [],
    "cet": 14.75,
    "annual_cet": 421.33,
    "final_disbursement_amount": 200,
    "number_of_installments": 3,
    "disbursement_issue_amount": 200,
    "prefixed_interest_rate": {
        "annual_rate": 3.81790482,
        "daily_rate": 0.0043771607,
        "interest_base": {
            "enumerator": "calendar_days",
            "year_days": 360
        },
        "monthly_rate": 0.14
    },
    "fine_configuration": {
        "contract_fine_rate": 0.02,
        "fine_delay_rate": {
            "annual_rate": 4.35025011,
            "daily_rate": 0.0046696,
            "interest_base": {
                "enumerator": "calendar_days",
                "year_days": 360
            },
            "monthly_rate": 0.15
        }
    },
    "attached_documents": [
        {
            "document_key": "494598fd-c226-4332-a500-591ae3884673",
            "document_url": "https://storage.googleapis.com/sandbox-doc-api/documents/494598fd-c226-4332-a500-591ae3884673/3d684e68e7df4e557d0480d98e26be92.jpg",
            "signature_url": null,
            "document_type": "document_identification",
            "signature_required": false,
            "signed": false
        },
        {
            "document_key": "494598fd-c226-4332-a500-591ae3884673",
            "document_url": "https://storage.googleapis.com/sandbox-doc-api/documents/494598fd-c226-4332-a500-591ae3884673/3d684e68e7df4e557d0480d98e26be92.jpg",
            "signature_url": null,
            "document_type": "document_identification_back",
            "signature_required": false,
            "signed": false
        },
        {
            "document_key": "c8b191cb-7b90-4e37-9280-397a597babc1",
            "document_url": "https://storage.googleapis.com/sandbox-doc-api/documents/c8b191cb-7b90-4e37-9280-397a597babc1/RAFAELAEBENJAMINFINANCEIRALTDA-ALAN_MATHISON_TURING-CCB-TIK11267101212-20251027170925.pdf",
            "signature_url": "https://storage.googleapis.com/sandbox-doc-api/documents/c8b191cb-7b90-4e37-9280-397a597babc1/RAFAELAEBENJAMINFINANCEIRALTDA-ALAN_MATHISON_TURING-CCB-TIK11267101212-20251027170925_signed.pdf",
            "document_type": "ccb_pre_price_days",
            "signature_required": true,
            "signed": true
        }
    ]
}
```

STATUS 400

Response Body

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

---

# Inquiry - BNPL Issuance

URL: /en/documentation/manual_bnpl_full/emissao/consulta

# Inquiry - BNPL Issuance


## Summary

You can query the debt at any time to retrieve information or track its current status.

## Query Credit Operation

There are two ways to query an operation:
- By `credit_operation_key` (DEBT-KEY)
- By `requester_identifier_key` (identifier key sent during issuance)

### By Credit Operation Key

ENDPOINT /v2/credit_operation/ CREDIT-OPERATION-KEY
METHOD GET

Test in Playground

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| `credit_operation_key`* | string | Credit operation key (DEBT-KEY) | UUID |

### By Requester Identifier Key

ENDPOINT /v2/credit_operation/requester_identifier_key/ REQUESTER-IDENTIFIER-KEY
METHOD GET

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| `requester_identifier_key`* | string | Identifier key sent during issuance | UUID |

### Response

STATUS 200

Response Body

```json
{
    "credit_operation_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c",
    "issue_amount": 1007.62,
    "origin_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c",
    "total_iof": 7.62,
    "assigned_at": null,
    "disbursement_start_date": "2026-04-07",
    "disbursement_end_date": "2026-04-07",
    "issue_date": "2026-04-07",
    "requester_identifier_key": "d1905ef5-19df-4183-bf0e-802b8229933c",
    "installments": [
        {
            "business_due_date": "2026-05-07",
            "due_date": "2026-05-07",
            "calendar_days": 30,
            "due_interest": 0,
            "due_principal": 1007.62,
            "fine_amount": 0,
            "has_interest": true,
            "post_fixed_amount": 0,
            "pre_fixed_amount": 52.4,
            "principal_amortization_amount": 491.49,
            "tax_amount": 1.21,
            "total_amount": 543.89,
            "workdays": 20,
            "accrual_reference_date": null,
            "advanced_paid_amount": 0,
            "bank_slip_key": null,
            "digitable_line": null,
            "installment_key": "1dea396f-beb1-4df3-9822-35800b4c095a",
            "installment_status": "opened",
            "installment_type": "principal",
            "original_due_principal": 1007.62,
            "original_pre_fixed_amount": 52.4,
            "original_principal_amortization_amount": 491.49,
            "paid_amount": 0,
            "original_total_amount": 543.89,
            "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": "2026-04-07T23:59:27",
            "principal_amortization_payment_amount": 0,
            "prefixed_interest_payment_amount": 0
        },
        {
            "business_due_date": "2026-06-08",
            "due_date": "2026-06-07",
            "calendar_days": 31,
            "due_interest": 0,
            "due_principal": 516.1296159,
            "fine_amount": 0,
            "has_interest": true,
            "post_fixed_amount": 0,
            "pre_fixed_amount": 27.76,
            "principal_amortization_amount": 516.13,
            "tax_amount": 2.58,
            "total_amount": 543.89,
            "workdays": 20,
            "accrual_reference_date": null,
            "advanced_paid_amount": 0,
            "bank_slip_key": null,
            "digitable_line": null,
            "installment_key": "370e73d1-55d8-431e-9b22-d08fb8297999",
            "installment_status": "opened",
            "installment_type": "principal",
            "original_due_principal": 516.13,
            "original_pre_fixed_amount": 27.76,
            "original_principal_amortization_amount": 516.13,
            "paid_amount": 0,
            "original_total_amount": 543.89,
            "qr_code_key": null,
            "qr_code_url": null,
            "renegotiation_proposal_key": null,
            "total_accrual_amount": 0,
            "total_paid_amount": 0,
            "installment_number": 2,
            "paid_at": null,
            "updated_at": "2026-04-07T23:59:27",
            "principal_amortization_payment_amount": 0,
            "prefixed_interest_payment_amount": 0
        }
    ],
    "first_due_date": "2026-05-07",
    "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
    "contract_number": "DWF1761222116",
    "credit_operation_status_enumerator": "opened",
    "operation_type_enumerator": "structured_operation",
    "disbursement_date": "2026-04-07",
    "issuer_name": "Dante Ferrarini",
    "issuer_document_number": "31057466093",
    "external_contract_fees": [
        {
            "amount_type": "absolute",
            "fee_amount": 0,
            "tax_amount": 0,
            "irrf_amount": 0,
            "amount": 0,
            "pis_amount": 0,
            "amount_released": 0,
            "fee_type": "tac",
            "cofins_amount": 0,
            "csll_amount": 0,
            "description": null,
            "net_fee_amount": 0,
            "rebate_account": null
        }
    ],
    "cet": 5.82,
    "annual_cet": 97.05,
    "final_disbursement_amount": 1000,
    "number_of_installments": 2,
    "disbursement_issue_amount": 1000,
    "prefixed_interest_rate": {
        "annual_rate": 0.8373372409,
        "daily_rate": 0.0016911989,
        "interest_base": {
            "enumerator": "calendar_days",
            "year_days": 360
        },
        "monthly_rate": 0.052
    },
    "fine_configuration": {
        "contract_fine_rate": 0.02,
        "fine_delay_rate": {
            "annual_rate": 0.12682503,
            "daily_rate": 0.00033173,
            "interest_base": {
                "enumerator": "calendar_days",
                "year_days": 360
            },
            "monthly_rate": 0.01
        }
    },
    "attached_documents": [
        {
            "document_key": "d6705fc4-80e0-4c8e-9aff-f3875024e6a4",
            "document_url": "https://storage.googleapis.com/sandbox-doc-api/documents/...",
            "signature_url": "https://storage.googleapis.com/sandbox-doc-api/documents/..._signed.pdf",
            "document_type": "ccb_pre_price_days",
            "signature_required": true,
            "signed": true
        }
    ],
    "related_parties": [
        {
            "related_party_key": "24fac77e-7782-4f72-b31a-daee288e34ed",
            "role_type": "issuer",
            "person_type": "natural",
            "name": "Dante Ferrarini",
            "email": "",
            "individual_document_number": "31057466093"
        }
    ],
    "base_iof": 3.79,
    "additional_iof": 3.83,
    "assignment_amount": 1010.64,
    "created_at": "2026-04-07T23:59:22Z",
    "total_prefixed_amount": 80.16
}
```

STATUS 400

Response Body

```json
{
    "data": "{\"title\": \"Bad Request\", \"description\": \"Invalid request body.\", \"translation\": \"Corpo da requisição inválido.\", \"extra_fields\": {}, \"code\": \"LEG000069\"}"
}
```

---

## Query Operation Events

You can also query the event history (status log) of the operation:

ENDPOINT /v2/credit_operation/ CREDIT-OPERATION-KEY /events
METHOD GET

Test in Playground

### Path Params

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| `credit_operation_key`* | string | Credit operation key | UUID |

### Response

STATUS 200

Response Body

```json
{
    "data": [
        {
            "status": "waiting_signature",
            "reason": null,
            "cancel_reason": null,
            "event_date": "2026-03-13T17:19:59Z"
        },
        {
            "status": "issued",
            "reason": null,
            "cancel_reason": null,
            "event_date": "2026-03-13T17:19:59Z"
        },
        {
            "status": "waiting_disbursement",
            "reason": null,
            "cancel_reason": null,
            "event_date": "2026-03-13T17:19:59Z"
        },
        {
            "status": "opened",
            "reason": null,
            "cancel_reason": null,
            "event_date": "2026-03-13T17:19:59Z"
        }
    ],
    "pagination": {
        "current_page": 1,
        "next_page": null,
        "rows_per_page": 10
    }
}
```

### Operation Status Enumerators

| Status | Description |
|---|---|
| `waiting_signature` | Waiting for contract signature |
| `issued` | Operation issued |
| `waiting_disbursement` | Waiting for disbursement |
| `opened` | Operation opened (disbursement completed) |
| `canceled` | Operation canceled |
| `settled` | Operation settled (all installments paid) |

---

# BNPL Issuance

URL: /en/documentation/manual_bnpl_full/emissao/

# BNPL Issuance


## Summary

This endpoint issues the debt and processes the contract signature via opt-in. Disbursement occurs automatically immediately after issuance. Pre-registration is not required; simply provide the borrower's details during the debt request.

## Request

ENDPOINT /signed_debt
METHOD POST

Test in Playground

Request Body

```json
{
    "borrower": {
        "name": "Dante Ferrarini",
        "email": "",
        "phone": {
            "number": "185633631",
            "area_code": "15",
            "country_code": "086"
        },
        "is_pep": false,
        "address": {
            "city": "São Paulo",
            "state": "SP",
            "number": "",
            "street": "Rua Gilberto Sabino",
            "postal_code": "05425020",
            "neighborhood": "Pinheiros",
            "complement": ""
        },
        "role_type": "issuer",
        "birth_date": "1993-09-10",
        "person_type": "natural",
        "attached_documents_list": [
            {
                "selfie": "250e7e95-57c8-40bd-a0cd-0be8eb172916"
            }
        ],
        "individual_document_number": "31057466093"
    },
    "financial": {
        "interest_type": "pre_price_days",
        "disbursement_date": "2026-04-07",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "disbursed_amount": 1000,
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "number_of_installments": 2,
        "principal_grace_period": 0,
        "monthly_interest_rate": 0.052
    },
    "simplified": true,
    "additional_data": {
        "contract": {
            "contract_number": "DWF1761222116",
            "signatures": [
                {
                    "signer": {
                        "name": "Dante Ferrarini",
                        "email": "",
                        "phone": {
                            "number": "185633631",
                            "area_code": "15",
                            "country_code": "086"
                        },
                        "document_number": "31057466093"
                    },
                    "signature": {
                        "timestamp": "28-01-2026 06:36:35",
                        "ip_address": "192.168.1.1",
                        "signature_file": {
                            "file_url": "https://qitech.com.br/signature.pdf",
                            "file_type": "pdf"
                        }
                    }
                }
            ]
        }
    },
    "requester_identifier_key": "d1905ef5-19df-4183-bf0e-802b8229933c",
    "purchaser_document_number": "32402502000135",
    "disbursement_bank_accounts": [
        {
            "name": "company name",
            "ispb_number": "32402502",
            "account_digit": "5",
            "branch_number": "0001",
            "account_number": "7617846",
            "document_number": "32246162000281",
            "percentage_receivable": 100
        }
    ]
}
```

### Request Body Details

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| **borrower*** | object | Borrower Object - The debtor of the credit operation | **[Borrower Object](#borrower-object)** |
| **financial*** | object | Contains all financial details and calculation parameters for the operation | **[Financial Object](#financial-object)** |
| **simplified** | boolean | If true, uses the simplified issuance flow | - |
| **additional_data*** | object | Additional contract data, including signatures | **[Additional Data Object](#additional-data-object)** |
| **requester_identifier_key** | string | Requester identifier key | UUID |
| **purchaser_document_number*** | string | Assignee's Tax ID – The buyer of the credit operation (FIDC/Receivables Investment Fund) | 14 |
| **disbursement_bank_accounts*** | array | Technical details of the bank account where the operation funds will be deposited | **[Disbursement Bank Account Object](#disbursement-bank-account-object)** |

### Borrower Object

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| name* | string | Full name of the borrower | 100 |
| email | string | Borrower's email address | 254 |
| phone | object | Borrower's contact telephone details | **[Phone Object](#phone-object)** |
| is_pep* | boolean | Politically Exposed Person (PEP) indicator | 5 |
| address* | object | Borrower's residential address details | **[Address Object](#address-object)** |
| role_type | string | The role of the person in the operation (e.g., "issuer") | 10 |
| birth_date* | date | Borrower's date of birth (Format: "YYYY-MM-DD") | 10 |
| person_type* | string | Person classification (natural or legal) | 7 |
| attached_documents_list | array | List of attached documents (e.g., selfie) | **[Attached Documents Object](#attached-documents-object)** |
| individual_document_number* | string | Borrower's Tax ID (CPF) - numbers only | 11 |

### Attached Documents Object

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| selfie | string | DOCUMENT_KEY of the selfie document uploaded via upload | UUID |

### Address Object

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| city* | string | City name of the address | 100 |
| state* | string | State abbreviation (two uppercase characters) | 2 |
| number | string | Street number | 10 |
| street* | string | Street name | 100 |
| complement | string | Address complement (free text) | 100 |
| postal_code* | string | Postal code (CEP) - numbers only | 8 |
| neighborhood* | string | Neighborhood or district name | 100 |

### Phone Object

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| number* | string | Subscriber's phone number | 9 |
| area_code* | string | Two-digit regional area code (e.g., "11") | 2 |
| country_code* | string | International dialing code (e.g., "055") | 3 |

### Financial Object

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| interest_type* | string | Amortization method | 20 |
| disbursement_date* | string | Disbursement date | 10 |
| fine_configuration* | object | Fine and penalty configuration | **[Fine Configuration Object](#fine-configuration-object)** |
| disbursed_amount* | float | Amount to be disbursed | 15,2 |
| credit_operation_type* | string | Type of credit operation (e.g., "ccb") | 10 |
| interest_grace_period | integer | Interest grace period (in months) | 3 |
| number_of_installments* | integer | Number of installments | 3 |
| principal_grace_period | integer | Principal grace period (in months) | 3 |
| monthly_interest_rate* | float | Monthly interest rate | 10,6 |

### Fine Configuration Object

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| monthly_rate* | float | Monthly penalty rate | 10,6 |
| interest_base* | string | Penalty calculation base (e.g., "calendar_days") | 20 |
| contract_fine_rate* | float | Contractual fine rate | 10,6 |

### Disbursement Bank Account Object

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| name | string | Account holder's full name | 50 |
| ispb_number | string | Financial institution's ISPB code | 8 |
| account_digit* | string | Account check digit (use zero instead of letters) | 1 |
| branch_number* | string | Branch number (do not include the branch check digit!) | 4 |
| account_number* | string | Account number (do not include the account check digit!) | 10 |
| document_number | string | Account holder's Tax ID (CPF/CNPJ) | 14 |
| percentage_receivable* | float | Disbursement percentage for this account | 3 |

### Additional Data Object

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| contract* | object | Contract data | **[Contract Object](#contract-object)** |

### Contract Object

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| contract_number* | string | The unique identifier or reference number of the contract | 20 |
| signatures* | array | List of digital signature evidence objects (Opt-in) | **[Signature Object](#signature-object)** |

### Signature Object

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| signer* | object | Signer identification data | **[Signer Object](#signer-object)** |
| signature* | object | Digital signature evidence data | **[Signature Details Object](#signature-details-object)** |

### Signer Object

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| name* | string | Full name of the signer | 255 |
| document_number* | string | Signer's tax identification number (CPF) | 11 |
| email | string | Electronic mail address of the signer | 100 |
| phone | object | Signer's contact telephone details | **[Phone Object](#phone-object)** |

### Signature Details Object

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| ip_address* | string | The IP address used during the signature process | 45 |
| timestamp* | string | Date and time of the signature (ISO 8601: YYYY-MM-DDTHH:mm:ssZ) | 24 |
| signature_file* | object | Digital signature file | **[Signature File Object](#signature-file-object)** |

### Signature File Object

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| file_url* | string | Direct link to the signed contract document (PDF) | 2048 |
| file_type* | string | Format of the signature file (e.g., "pdf") | 4 |

## Response

The response to this debt request will return the payment plan as well as a **DEBT-KEY**, which is the identifier of the debt in QI SCD.

STATUS 201

Response Body

```json
{
    "webhook_type": "debt",
    "key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c",
    "status": "issued",
    "event_datetime": "2026-04-07 23:59:28",
    "data": {
        "borrower": {
            "name": "Dante Ferrarini",
            "document_number": "31057466093",
            "related_party_key": "24fac77e-7782-4f72-b31a-daee288e34ed"
        },
        "contract": {
            "document_key": null,
            "number": "DWF1761222116",
            "urls": [],
            "signature_information": [
                {
                    "signer_name": "Dante Ferrarini",
                    "signer_document_number": "31057466093",
                    "signer_role": "issuer",
                    "signer_email": null,
                    "signer_external_key": null,
                    "signature_url": null
                }
            ]
        },
        "requester_identifier_key": "d1905ef5-19df-4183-bf0e-802b8229933c",
        "iof_charge_method": "financed",
        "collaterals": [],
        "contract_fees": [
            {
                "fee_type": "spread",
                "fee_amount": 3.02
            }
        ],
        "external_contract_fees": [
            {
                "fee_type": "tac",
                "fee_amount": 0,
                "tax_amount": 0,
                "net_fee_amount": 0
            }
        ],
        "external_contract_fee_amount": 0,
        "net_external_contract_fee_amount": 0,
        "contract_fee_amount": 3.02,
        "issue_amount": 1007.62,
        "assignment_amount": 1010.64,
        "cet": "5,8200%",
        "annual_cet": "97,0501%",
        "number_of_installments": 2,
        "base_iof": 3.79,
        "additional_iof": 3.83,
        "total_iof": 7.62,
        "ipoc_code": "324025020203131057466093DWF1761222116",
        "prefixed_interest_rate": {
            "annual_rate": 0.8373372409,
            "created_at": "2026-04-07T23:59:22",
            "daily_rate": 0.0016911989,
            "interest_base": "calendar_days",
            "monthly_rate": 0.052
        },
        "installments": [
            {
                "accrual_reference_date": null,
                "additional_costs": [],
                "advanced_paid_amount": 0,
                "bank_slip_key": null,
                "business_due_date": "2026-05-07",
                "calendar_days": 30,
                "digitable_line": null,
                "due_date": "2026-05-07",
                "due_interest": 0,
                "due_principal": 1007.62,
                "fine_amount": null,
                "has_interest": true,
                "installment_history": [],
                "installment_key": "1dea396f-beb1-4df3-9822-35800b4c095a",
                "installment_number": 1,
                "installment_payment": [],
                "installment_status": "created",
                "installment_type": "principal",
                "original_due_principal": 1007.62,
                "original_pre_fixed_amount": 52.3996159,
                "original_principal_amortization_amount": 491.4903841,
                "original_total_amount": 543.89,
                "paid_amount": 0,
                "paid_at": null,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 52.3996159,
                "principal_amortization_amount": 491.4903841,
                "qr_code_key": null,
                "qr_code_url": null,
                "renegotiation_proposal_key": null,
                "tax_amount": 1.20906634,
                "total_accrual_amount": null,
                "total_amount": 543.89,
                "total_paid_amount": 0,
                "workdays": 20
            },
            {
                "accrual_reference_date": null,
                "additional_costs": [],
                "advanced_paid_amount": 0,
                "bank_slip_key": null,
                "business_due_date": "2026-06-08",
                "calendar_days": 31,
                "digitable_line": null,
                "due_date": "2026-06-07",
                "due_interest": 0,
                "due_principal": 516.1296159,
                "fine_amount": null,
                "has_interest": true,
                "installment_history": [],
                "installment_key": "370e73d1-55d8-431e-9b22-d08fb8297999",
                "installment_number": 2,
                "installment_payment": [],
                "installment_status": "created",
                "installment_type": "principal",
                "original_due_principal": 516.1296159,
                "original_pre_fixed_amount": 27.7603841,
                "original_principal_amortization_amount": 516.1296159,
                "original_total_amount": 543.89,
                "paid_amount": 0,
                "paid_at": null,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 27.7603841,
                "principal_amortization_amount": 516.1296159,
                "qr_code_key": null,
                "qr_code_url": null,
                "renegotiation_proposal_key": null,
                "tax_amount": 2.58168034,
                "total_accrual_amount": null,
                "total_amount": 543.89,
                "total_paid_amount": 0,
                "workdays": 20
            }
        ],
        "total_pre_fixed_amount": 80.16
    }
}
```

:::caution Attention
Remember to save the **DEBT-KEY** returned in the response, as it will be required for queries, renegotiations, and reversals of the operation.
:::

### Response Body Details

| Field | Type | Description |
|---|---|---|
| **webhook_type** | string | Event type identifier |
| **key** | string | DEBT-KEY — unique identifier of the debt in QI SCD (UUID) |
| **status** | string | Current status of the debt |
| **event_datetime** | string | Date and time of the event (ISO 8601) |
| **data** | object | **[Data Object](#data-object)** — Operation data |

### Data Object

| Field | Type | Description |
|---|---|---|
| **borrower** | object | **[Borrower Response Object](#borrower-response-object)** — Borrower data |
| **contract** | object | **[Contract Response Object](#contract-response-object)** — Contract data |
| **requester_identifier_key** | string | Requester identifier key (UUID) |
| **iof_charge_method** | string | IOF charge method — always "financed" |
| **collaterals** | array | List of collaterals associated with the operation |
| **contract_fees** | array | **[Contract Fees Object](#contract-fees-object)** — QI Tech fees charged on the operation |
| **external_contract_fees** | array | **[External Contract Fees Object](#external-contract-fees-object)** — External fees charged on the operation |
| **external_contract_fee_amount** | float | Total external contract fee amount |
| **net_external_contract_fee_amount** | float | Net external contract fee amount after taxes |
| **contract_fee_amount** | float | Total QI Tech contract fee amount |
| **issue_amount** | float | Nominal/issue value of the credit operation |
| **assignment_amount** | float | Acquisition value of the credit operation |
| **cet** | string | Monthly total effective cost (CET) |
| **annual_cet** | string | Annual total effective cost (CET) |
| **number_of_installments** | integer | Number of installments |
| **base_iof** | float | Base IOF amount |
| **additional_iof** | float | Additional IOF amount |
| **total_iof** | float | Total IOF amount |
| **ipoc_code** | string | Brazilian credit registry code generated by QI Tech |
| **prefixed_interest_rate** | object | **[Interest Rate Response Object](#interest-rate-response-object)** — Nominal interest rate details |
| **installments** | array | **[Installments Response Object](#installments-response-object)** — Operation installments |
| **total_pre_fixed_amount** | float | Total pre-fixed interest amount across all installments |

### Borrower Response Object

| Field | Type | Description |
|---|---|---|
| **name** | string | Full name of the borrower |
| **document_number** | string | Borrower's tax ID (CPF) |
| **related_party_key** | string | Borrower's unique identifier in QI Tech (UUID) |

### Contract Response Object

| Field | Type | Description |
|---|---|---|
| **document_key** | string | Contract document key |
| **number** | string | Contract number |
| **urls** | array | List of contract document URLs |
| **signature_information** | array | **[Signature Information Object](#signature-information-object)** — Signature details |

### Signature Information Object

| Field | Type | Description |
|---|---|---|
| **signer_name** | string | Signer's full name |
| **signer_document_number** | string | Signer's tax ID (CPF) |
| **signer_role** | string | Signer's role in the operation |
| **signer_email** | string | Signer's email address |
| **signer_external_key** | string | External signer key |
| **signature_url** | string | URL of the signed document |

### Contract Fees Object

| Field | Type | Description |
|---|---|---|
| **fee_type** | string | Fee type |
| **fee_amount** | float | Fee amount |

### External Contract Fees Object

| Field | Type | Description |
|---|---|---|
| **fee_type** | string | External fee type |
| **fee_amount** | float | External fee amount |
| **tax_amount** | float | Tax amount on the fee |
| **net_fee_amount** | float | Net fee amount after taxes |

### Interest Rate Response Object

| Field | Type | Description |
|---|---|---|
| **annual_rate** | float | Annual interest rate |
| **created_at** | string | Rate creation timestamp (ISO 8601) |
| **daily_rate** | float | Daily interest rate |
| **interest_base** | string | Interest calculation base |
| **monthly_rate** | float | Monthly interest rate |

### Installments Response Object

| Field | Type | Description |
|---|---|---|
| **accrual_reference_date** | string | Reference date for installment calculations |
| **additional_costs** | array | List of additional costs on the installment |
| **advanced_paid_amount** | float | Amount paid in advance |
| **bank_slip_key** | string | Bank slip (boleto) key |
| **business_due_date** | string | Due date adjusted to the next business day |
| **calendar_days** | integer | Calendar days between installments |
| **digitable_line** | string | Boleto digitable line |
| **due_date** | string | Installment due date |
| **due_interest** | float | Remaining interest before payment on due date |
| **due_principal** | float | Outstanding balance at time of installment |
| **fine_amount** | float | Fine amount applied |
| **has_interest** | boolean | Indicator of interest incidence on the installment |
| **installment_history** | array | History of installment events |
| **installment_key** | string | Unique installment identifier (UUID) |
| **installment_number** | integer | Installment number |
| **installment_payment** | array | List of payments made on this installment |
| **installment_status** | string | Current installment status |
| **installment_type** | string | Installment type — always "principal" |
| **original_due_principal** | float | Original outstanding balance at issuance |
| **original_pre_fixed_amount** | float | Original pre-fixed interest amount at issuance |
| **original_principal_amortization_amount** | float | Original principal amortization amount at issuance |
| **original_total_amount** | float | Original total installment amount at issuance |
| **paid_amount** | float | Amount already paid |
| **paid_at** | string | Date of payment |
| **post_fixed_amount** | float | Post-fixed interest amount — always 0 |
| **pre_fixed_amount** | float | Current pre-fixed interest amount |
| **principal_amortization_amount** | float | Principal amortization amount |
| **qr_code_key** | string | PIX QR code key |
| **qr_code_url** | string | PIX QR code URL |
| **renegotiation_proposal_key** | string | Renegotiation proposal key, if applicable |
| **tax_amount** | float | IOF amount on the installment |
| **total_accrual_amount** | float | Total accrual amount |
| **total_amount** | float | Total installment amount |
| **total_paid_amount** | float | Total amount paid on this installment so far |
| **workdays** | integer | Business days between installments |

---

# Simulation - BNPL Issuance

URL: /en/documentation/manual_bnpl_full/emissao/simulacao

# Simulation - BNPL Issuance


## Summary

At QI Tech, we provide our clients with the ability to simulate the values of a credit operation before it is actually issued. The simulation follows the same pattern as the debt issuance request, but it is not necessary to provide the borrower's registration and disbursement account details.

## Request

ENDPOINT /v2/credit_operation/simulation
METHOD POST

Test in Playground

Request Body

```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": 2,
    "principal_amortization_month_period": 1
}
```


### Request Body Details

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| **credit_operation_type*** | string | Type of credit operation | **[Credit Operation Type Enumerator](#credit-operation-type-enumerator)** |
| **disbursed_issue_amount*** | float | The value actually released to the borrower | 15,2 |
| **disbursement_date*** | string | The specific date the loan funds are made available | 10 |
| **first_due_date*** | string | Due date of the first installment | 10 |
| **force_installments_on_workdays*** | boolean | If true, ensures all installment due dates are moved to the next business day | - |
| **interest_type*** | string | Amortization method | **[Interest Type Enumerator](#interest-type-enumerator)** |
| **issuer_person_type*** | string | Defines whether the issuer is an individual or a legal entity | **[Person Type Enumerator](#person-type-enumerator)** |
| **monthly_interest_rate*** | float | The percentage charged on a principal balance over a one-month period | 10,6 |
| **number_of_installments*** | integer | Number of installments | 3 |
| **principal_amortization_month_period*** | integer | Period, in months, between installments | 1 |

### Credit Operation Type Enumerator

| Value | Description |
|---|---|
| `ccb` | Bank Credit Certificate (Cédula de Crédito Bancário) |

### Interest Type Enumerator

| Value | Description |
|---|---|
| `pre_price_days` | Pre-fixed interest with Price amortization by calendar days |
| `pre_price` | Pre-fixed interest with Price amortization by months |
| `pre_sac` | Pre-fixed interest with SAC amortization |

### Person Type Enumerator

| Value | Description |
|---|---|
| `natural` | Individual (natural person) |
| `legal` | Legal entity (corporation/business) |

## Response

STATUS 200

Response Body

```json
{
    "disbursement_date": "2025-09-24",
    "issue_amount": 2821.32,
    "interest_type": "pre_price_days",
    "assignment_amount": 2829.78,
    "base_iof": 10.6,
    "total_iof": 21.32,
    "additional_iof": 10.72,
    "cet": 5.09,
    "annual_cet": 81.39,
    "first_due_date": "2025-10-24",
    "disbursed_amount": 2800,
    "prefixed_interest_rate": {
        "annual_rate": 0.6935459998,
        "daily_rate": 0.0014644728,
        "interest_base": "calendar_days",
        "monthly_rate": 0.04488
    },
    "tax_configuration": {
        "base_rate": 8.2e-05,
        "additional_rate": 0.0038
    },
    "fees": [
        {
            "amount": 0.3,
            "fee_amount": 8.46,
            "amount_type": "percentage",
            "fee_type": "spread",
            "type": "internal"
        }
    ],
    "installments": [
        {
            "due_date": "2025-10-24",
            "amount": 1507.4,
            "due_principal": 2821.32,
            "due_interest": 0,
            "has_interest": true,
            "period": 1,
            "period_workdays": 1.1,
            "calendar_days": 30,
            "workdays": 22,
            "installment_number": 1,
            "period_to_disbursement": 1,
            "prefixed_amount": 126.62248868,
            "period_workdays_to_disbursement": 1.1,
            "calendar_days_to_disbursement": 30,
            "workdays_to_disbursement": 22,
            "tax_amount": 3.39671268,
            "principal_amortization_amount": 1380.77751132
        },
        {
            "due_date": "2025-11-24",
            "amount": 1507.4,
            "due_principal": 1440.54248868,
            "due_interest": 0,
            "has_interest": true,
            "period": 1,
            "period_workdays": 1,
            "calendar_days": 31,
            "workdays": 20,
            "installment_number": 2,
            "period_to_disbursement": 2,
            "prefixed_amount": 66.85751132,
            "period_workdays_to_disbursement": 2.1,
            "calendar_days_to_disbursement": 61,
            "workdays_to_disbursement": 42,
            "tax_amount": 7.20559353,
            "principal_amortization_amount": 1440.54248868
        }
    ]
}
```


### Response Body Details

| Field | Type | Description |
|---|---|---|
| **annual_cet** | float | Total effective cost expressed as a decimal per year |
| **assignment_amount** | float | Acquisition value of the credit operation |
| **cet** | float | Total effective cost expressed as a decimal per month |
| **fees** | array | **[Fees Object](#fees-object)** - List of QI Tech fees charged on the operation |
| **disbursed_amount** | float | Amount disbursed in the credit operation |
| **disbursement_date** | string | Disbursement date of the operation |
| **installments** | array | **[Installments Object](#installments-object)** - Installments of the operation |
| **interest_type** | string | Amortization method and interest calculation method |
| **additional_iof** | float | A fixed-rate tax applied to the transaction principal |
| **base_iof** | float | The taxable amount used as the basis for calculating the Tax on Financial Operations |
| **total_iof** | float | The total amount of Tax on Financial Operations applied to the transaction |
| **issue_amount** | float | Issue/nominal value of the credit operation |
| **tax_configuration** | object | **[Tax Configuration Object](#tax-configuration-object)** - IOF rate values |
| **first_due_date** | string | Due date of the first installment |
| **prefixed_interest_rate** | object | **[Interest Rate Object](#interest-rate-object)** - Nominal interest rate |

### Fees Object

| Field | Type | Description |
|---|---|---|
| **amount** | float | Fee value or percentage |
| **fee_amount** | float | Monetary fee value |
| **amount_type** | string | Value type (percentage or fixed) |
| **fee_type** | string | Fee type |
| **type** | string | Fee classification (internal or external) |

### Installments Object

| Field | Type | Description |
|---|---|---|
| **due_date** | string | Installment due date |
| **amount** | float | Total installment amount |
| **due_principal** | float | Outstanding balance at the time of the installment |
| **due_interest** | float | Remaining interest after the installment due date before its payment |
| **has_interest** | boolean | Indicator of interest incidence on the installment |
| **installment_number** | integer | Installment number |
| **prefixed_amount** | float | Pre-fixed interest amount paid in the installment |
| **tax_amount** | float | IOF amount on the installment |
| **principal_amortization_amount** | float | Principal amortization amount |
| **period** | float | Installment period |
| **period_workdays** | float | Installment period in workdays |
| **period_to_disbursement** | float | Number of accumulated periods from disbursement to this installment |
| **period_workdays_to_disbursement** | float | Number of accumulated periods in workdays from disbursement to this installment |
| **calendar_days** | integer | Calendar days between installments |
| **calendar_days_to_disbursement** | integer | Accumulated calendar days from disbursement to this installment |
| **workdays** | integer | Business days between installments |
| **workdays_to_disbursement** | integer | Accumulated business days from disbursement to this installment |

### Tax Configuration Object

| Field | Type | Description |
|---|---|---|
| **base_rate** | float | Base IOF rate |
| **additional_rate** | float | Additional IOF rate |

### Interest Rate Object

| Field | Type | Description |
|---|---|---|
| **annual_rate** | float | Annual interest rate |
| **daily_rate** | float | Daily interest rate |
| **interest_base** | string | Interest calculation base |
| **monthly_rate** | float | Monthly interest rate |

---

# Webhooks - BNPL Issuance

URL: /en/documentation/manual_bnpl_full/emissao/webhooks

## Summary

After a successful issuance response, you will receive webhooks notifying you about the events in the operation lifecycle: contract signature, disbursement, and eventually cancellation.

:::danger Attention!
Webhooks should not be strictly mapped. New fields may be added to the payload without prior notice.
:::

## Signature Webhook

This webhook is sent when the contract (CCB) is successfully signed.

WEBHOOK_TYPE debt
STATUS signature_finished

Webhook Body

```json
{
    "key": "1ebd4a90-2721-4c39-a399-427fa16bca65",
    "status": "signature_finished",
    "webhook_type": "debt",
    "event_datetime": "2025-10-27T17:09:33Z",
    "signed_contract_url": "https://storage.googleapis.com/sandbox-doc-api/documents/c8b191cb-7b90-4e37-9280-397a597babc1/CCB-TIK11267101212-20251027170925_signed.pdf"
}
```

### Signature Webhook Fields

| Field | Type | Description |
|---|---|---|
| **key** | string | Unique debt key (DEBT-KEY) |
| **status** | string | Event status: `signature_finished` |
| **webhook_type** | string | Webhook type: `debt` |
| **event_datetime** | string | Event date and time |
| **signed_contract_url** | string | URL of the signed contract (PDF) |

## Disbursement Webhook

This webhook confirms that the disbursement was successfully completed.

WEBHOOK_TYPE debt
STATUS disbursed

Webhook Body

```json
{
    "key": "1ebd4a90-2721-4c39-a399-427fa16bca65",
    "data": {
        "installments": [
            {
                "due_date": "2025-11-27",
                "total_amount": 87.43,
                "installment_key": "e25fb146-0a61-4319-a722-d01b2213d0f9",
                "pre_fixed_amount": 29.26477451,
                "installment_number": 1,
                "principal_amortization_amount": 58.16522549
            },
            {
                "due_date": "2025-12-27",
                "total_amount": 87.43,
                "installment_key": "2557de2b-6df1-4a8a-b46a-59206ece157f",
                "pre_fixed_amount": 20.11446867,
                "installment_number": 2,
                "principal_amortization_amount": 67.31553133
            },
            {
                "due_date": "2026-01-27",
                "total_amount": 87.43,
                "installment_key": "cc503d1d-6387-4a1f-bd78-62b248d02ec8",
                "pre_fixed_amount": 11.07075682,
                "installment_number": 3,
                "principal_amortization_amount": 76.35924318
            }
        ],
        "ted_receipt_list": [],
        "requester_identifier_key": null
    },
    "status": "disbursed",
    "webhook_type": "debt",
    "event_datetime": "2025-10-27T17:10:21Z"
}
```

### Disbursement Webhook Fields

| Field | Type | Description |
|---|---|---|
| **key** | string | Unique debt key (DEBT-KEY) |
| **status** | string | Event status: `disbursed` |
| **webhook_type** | string | Webhook type: `debt` |
| **event_datetime** | string | Event date and time |
| **data.installments** | array | List of installments with their keys and amounts |
| **data.ted_receipt_list** | array | List of TED receipts (when applicable) |

## Cancellation Webhook

If the debt fails to disburse, or is returned, you will receive a cancellation webhook.

WEBHOOK_TYPE debt
STATUS canceled

Webhook Body

```json
{
    "webhook_type": "debt",
    "key": "1ebd4a90-2721-4c39-a399-427fa16bca65",
    "event_datetime": "2025-10-27T16:38:59Z",
    "data": {
        "cancel_reason": "Operacao cancelada manualmente",
        "cancel_reason_enumerator": "manual"
    },
    "status": "canceled"
}
```

### Cancellation Webhook Fields

| Field | Type | Description |
|---|---|---|
| **key** | string | Unique debt key (DEBT-KEY) |
| **status** | string | Event status: `canceled` |
| **webhook_type** | string | Webhook type: `debt` |
| **event_datetime** | string | Event date and time |
| **data.cancel_reason** | string | Textual description of the cancellation reason |
| **data.cancel_reason_enumerator** | string | Cancellation reason enumerator |

### Cancellation Enumerators

| Enumerator | Description |
|---|---|
| `disbursing_error` | Operation canceled due to an error during disbursement |
| `waiting_signature` | Operation canceled due to missing signature |
| `pix_max_retry` | Operation canceled because the receiving bank could not process the disbursement |
| `manual` | Operation canceled manually |
| `agencia_conta_invalida` | Invalid agency or recipient account number |
| `invalid_account` | The destination account number is nonexistent or invalid |
| `invalid_document_number` | The CPF/CNPJ of the destination account is incorrect |
| `unsupported_transaction` | The destination account does not support this type of transaction |
| `invalid_ispb` | The ISPB number is invalid or nonexistent |
| `rejected_payment` | Payment order was rejected by the receiving bank |
| `refund_after_payee_request` | Refund requested by the payee |
| `blocked_account` | The destination account is blocked |
| `amount_too_great` | Payment/refund amount exceeds the limit for the credited destination account |
| `receiver_error` | Transaction interrupted due to error on the receiver's PSP |
| `closed_account` | The destination account is closed |
| `disbursing_hour_closed` | Disbursement occurred outside of the allowed time frame |
| `unregistered_pix_key` | The Pix key is not registered |
| `spi_timeout` | Timeout control in SPI |

---

# BNPL Reversal

URL: /en/documentation/manual_bnpl_full/estorno/

# BNPL Reversal


## Summary

The reversal of a BNPL operation allows you to reverse the disbursement. There are two cancellation/reversal scenarios:

1. **Cancellation before disbursement**: Cancels the operation before the funds are transferred
2. **Reversal after disbursement (up to 7 days)**: Generates a Pix refund so the borrower can return the funds

---

## 1. Cancellation Before Disbursement

Cancels a credit operation that has not yet been disbursed.

### Request

ENDPOINT /debt/ DEBT-KEY /cancel
METHOD PATCH

Test in Playground

### Path Params

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| `debt_key`* | string | Unique debt key returned at the time of the credit operation creation | UUID |

### Response

STATUS 200

Response Body

```json
{}
```

:::caution Attention
This endpoint can only be used for operations that have **not yet been disbursed**. For already disbursed operations, use the reversal endpoint below.
:::

---

## 2. Reversal After Disbursement (Up to 7 Days)

Reverses a BNPL operation that has already been disbursed, within 7 calendar days after disbursement. The system generates a copy-and-paste Pix code so the borrower can return the funds.

### Request

ENDPOINT /debt/reversal
METHOD POST

Test in Playground

Request Body

```json
{
    "credit_operation_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c"
}
```


### Body Params

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| `credit_operation_key`* | string | Credit operation key (DEBT-KEY) | UUID |

### Response

STATUS 200

Response Body

```json
{
    "payer_name": "Dante Ferrarini",
    "payer_document_number": "31057466093",
    "amount": 1000,
    "expiration_date": "2026-04-28",
    "copy_paste_pix": "00020126930014br.gov.bcb.pix2571qrcode-h.sandbox.qitech.app/bacen/cobv/fb1906ab2eff40109609855ac104f60e5204000053039865802BR5925QISOCIEDADEDECREDITODIRET6008SaoPaulo61080145200062070503***63046387",
    "reversal_key": "7a18fdb6-a3e7-4fc9-833e-0f6d8e98de3b",
    "status": "active",
    "debt_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c",
    "qr_code_key": "fb1906ab-2eff-4010-9609-855ac104f60e"
}
```


### Response Details

| Field | Type | Description |
|---|---|---|
| **payer_name** | string | Borrower's name |
| **payer_document_number** | string | Borrower's CPF/CNPJ |
| **amount** | float | Total amount to be returned |
| **expiration_date** | string | Expiration date of the refund Pix |
| **copy_paste_pix** | string | Pix copy-and-paste code for fund return |
| **reversal_key** | string | Unique reversal key (UUID) |
| **status** | string | Reversal status: `active` |
| **debt_key** | string | Debt key (DEBT-KEY) |
| **qr_code_key** | string | Pix QR Code key (UUID) |

:::warning Important
- Reversal can only be performed within **7 calendar days** after disbursement
- The generated `copy_paste_pix` has an **expiration date**. After this date, the Pix can no longer be used
- After the borrower pays the Pix, the operation will be automatically canceled and you will receive a cancellation webhook
:::

---

# Refund via Amortization — equal_amount and full_settle

URL: /en/documentation/manual_bnpl_full/estorno/estorno_amortizacao

## Summary

In addition to the cancel-before-disbursement and 7-day Pix reversal flows (see [BNPL Refund](./estorno.md)), BNPL Full offers **two amortization-based refund modes** that return funds by debiting an internal partner account directly:

- **`equal_amount`** — **partial** refund. Distributes the informed amount proportionally across the operation's installments, reducing the outstanding balance. The operation remains active, with remaining installments still open.
- **`full_settle`** — **total** refund. Settles the operation in full in a single transaction, calculating the present value of all installments as of `reference_date`. After settlement, the operation is marked as `settled` and no remaining installments exist.

Both modes use the `POST /renegotiation/proposal` endpoint with `payment_type: "internal"`, which means the amount is moved directly from the account informed in `account_key`, without generating a bank slip or Pix.

---

## When to use each mode

### `equal_amount` — Partial Refund

Use when the borrower wants to **reduce** the outstanding balance without closing the operation. The `payment_amount` is distributed across installments, amortizing principal, interest, and any applicable fine. Installments that have not been fully amortized remain in `remaining_installments` to be collected on their upcoming due dates.

Typical cases:

- Borrower overpaid and wants to offset part of the debt only.
- Partial return of funds negotiated between partner and borrower.
- Application of credits or one-off refunds on active operations.

### `full_settle` — Total Refund

Use when the goal is to **pay off** the operation completely. The system calculates the present value of all open installments as of `reference_date` (principal + accrued interest + any applicable fine) and distributes the `payment_amount` to zero out the balance. The operation transitions to `settled`.

Typical cases:

- Refund after the 7-day `POST /debt/reversal` window.
- Early payoff requested by the borrower.
- Administrative closure of the operation with full return of funds.

:::info Sequencing
The two modes can be combined. For example: several `equal_amount` calls for partial amortizations, followed by a final `full_settle` to close out the remaining balance.
:::

---

## Request

ENDPOINT /renegotiation/proposal
METHOD POST

Try in Playground

Request Body

**equal_amount (partial)**

```json
{
    "debt_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c",
    "payment_type": "internal",
    "amortization_type": "equal_amount",
    "reference_date": "2026-04-13",
    "payment_amount": 50.00,
    "account_key": "5ae72355-1e47-4624-9915-ceb93d872194",
    "request_control_key": "94b31045-c8e7-45be-a88d-2ae25c5df5db"
}
```

**full_settle (total)**

```json
{
    "debt_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c",
    "payment_type": "internal",
    "amortization_type": "full_settle",
    "reference_date": "2026-04-13",
    "payment_amount": 1043.55,
    "account_key": "5ae72355-1e47-4624-9915-ceb93d872194",
    "request_control_key": "e5f6c3d4-e5f6-7890-abcd-ef1234567890"
}
```

### Body Params

| Field | Type | Description | Characters |
|---|---|---|---|
| `debt_key`* | string | Unique key of the credit operation to be refunded | UUID |
| `payment_type`* | string | Must be `internal` for refunds via internal account | 8 |
| `amortization_type`* | string | Refund mode | **[Amortization Type Enumerators](#amortization-type-enumerators)** |
| `reference_date`* | string | Reference date for present-value calculation (format `YYYY-MM-DD`) | 10 |
| `payment_amount`* | float | Refund amount in BRL (R$). In `equal_amount`, it is the partial amount to be offset. In `full_settle`, it must cover the total balance on `reference_date` | 15,2 |
| `account_key`* | string | Internal account key from which the amount will be debited | UUID |
| `request_control_key`* | string | Request control key (idempotency) | UUID |

### Amortization Type Enumerators

| Value | Description |
|---|---|
| **`equal_amount`** | Partial refund. `payment_amount` is distributed proportionally across installments; the operation remains active with the remaining installments still open. |
| **`full_settle`** | Total refund. Fully settles the operation on `reference_date`. The operation transitions to `settled` and no remaining installments exist. |

---

## Response

STATUS 201

Response Body

```json
{
    "proposal_key": "bcc16a6d-ce21-4cd4-8d8c-d26f89ccc685",
    "contract_number": "DWF1761222116",
    "amortization_type": "equal_amount",
    "payment_amount": 50.00,
    "discount_percentage": 0,
    "discount_amount": 0,
    "requester_name": "Dante Ltda",
    "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
    "origin_key": null,
    "issuer_name": "Dante Ferrarini",
    "issuer_document_number": "31057466093",
    "affected_installments": [
        {
            "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88",
            "due_date": "2026-05-07",
            "principal_amount": 15.71,
            "interest_amount": 4.07,
            "fine_amount": 0,
            "total_amount": 19.78,
            "present_amount": 18.00,
            "paid_amount": 18.00,
            "principal_amortization_payment_amount": 18.00,
            "prefixed_interest_payment_amount": 0,
            "fine_payment_amount": 0
        }
    ],
    "remaining_installments": [
        {
            "installment_key": "370e73d1-55d8-431e-9b22-d08fb8297999",
            "due_date": "2026-06-07",
            "principal_amount": 15.71,
            "interest_amount": 4.07,
            "fine_amount": 0,
            "total_amount": 19.78
        }
    ],
    "proposal_status": "pending_payment",
    "payment_type": "internal",
    "payment": {
        "digitable_line": null,
        "qr_code_url": null,
        "qr_code_key": null,
        "bank_slip_key": null,
        "paid_method_type": "internal",
        "source_account_key": "5ae72355-1e47-4624-9915-ceb93d872194",
        "payment_data": {
            "target_account_key": "6108dd45-580d-48c4-b3bb-74c1e843be49",
            "transaction_amount": 50.00
        }
    },
    "proposal_due_date": "2026-04-13",
    "reference_date": "2026-04-13",
    "devolution_amount": 0,
    "request_control_key": "94b31045-c8e7-45be-a88d-2ae25c5df5db"
}
```

### Response Details

| Field | Type | Description |
|---|---|---|
| `proposal_key` | string | Unique key of the refund proposal (UUID). Save it for queries and webhooks. |
| `amortization_type` | string | Mode used (`equal_amount` or `full_settle`). |
| `payment_amount` | float | Amount effectively applied in the refund. |
| `proposal_status` | string | Proposal state. Starts at `pending_payment` and transitions to `paid` after the internal debit. |
| `affected_installments` | array | Installments that received the refund amount. For each installment, shows the `paid_amount` split across principal, interest, and fine. |
| `remaining_installments` | array | Installments that remain open after the refund. Empty in `full_settle`. |
| `payment.payment_data.target_account_key` | string | Destination account of the internal debit. |
| `payment.payment_data.transaction_amount` | float | Amount effectively moved from `account_key`. |
| `devolution_amount` | float | Overpayment amount returned to the fund. Only non-zero when a prior payment already exists on the operation and the refund plus that payment together exceed the outstanding balance — the excess is returned via this field. |
| `request_control_key` | string | Echo of the idempotency key sent in the request. |

---

## Rules and notes

:::caution Attention

- **Operation state**: the operation must be active and disbursed. Operations not yet disbursed must be cancelled via `PATCH /debt/{debt_key}/cancel`.
- **`reference_date`**: drives interest and fine calculation. In `full_settle`, the entire balance is brought to present value on this date. **Cannot be earlier than the operation's disbursement date** — that is the minimum allowed value.
- **Overdue installments**: when there are overdue installments, the `paid_amount` of the affected installment is split across `principal_amortization_payment_amount`, `prefixed_interest_payment_amount`, and `fine_payment_amount`. Check the breakdown in the `affected_installments` array.
- **Idempotency**: `request_control_key` is mandatory. Use a unique UUID per attempt to avoid duplicates.
- **`full_settle` with insufficient amount**: if `payment_amount` is lower than the calculated total balance, the debit is still processed and distributed proportionally — check the operation's final status to confirm settlement.

:::

:::info Combining modes

- Several `equal_amount` proposals can be made in sequence, each offsetting part of the balance.
- A `full_settle` can be made after one or more `equal_amount` proposals to close out the remaining balance.
- Each proposal is independent and must use a distinct `request_control_key`.

:::

---

## Query proposal status

After creating the proposal, query its status by the `request_control_key` sent in the request.

ENDPOINT /renegotiation/proposal/request_control_key/ REQUEST-CONTROL-KEY
METHOD GET

### Path Params

| Field | Type | Description | Characters |
|---|---|---|---|
| `request_control_key`* | string | Control key sent on proposal creation | UUID |

The response follows the same format as the `POST` return. The `proposal_status` field indicates progress:

| Status | Description |
|---|---|
| `pending_payment` | Proposal created, awaiting internal debit processing. |
| `paid` | Debit processed. In `full_settle`, the operation is already `settled`. |

---

## Settlement Webhook

When a refund fully settles the operation — typically in `full_settle`, but also in cases where the cumulative `equal_amount` amortizations zero out the balance — the system sends a `debt` webhook with status `settled`.

WEBHOOK_TYPE debt
STATUS settled

Use this webhook to asynchronously confirm that the operation was closed after the internal debit is processed. The full payload and fields follow the pattern described in [Webhooks - BNPL Refund](./webhooks.md).

---

# Webhooks - BNPL Reversal

URL: /en/documentation/manual_bnpl_full/estorno/webhooks

## Summary

After creating a reversal request, the system will send webhooks to notify you about the events in the reversal process.

:::danger Attention!
Webhooks should not be strictly mapped. New fields may be added to the payload without prior notice.
:::

## Cancellation by Reversal Webhook

When the borrower makes the Pix refund payment generated by the reversal, the credit operation is automatically canceled and the following webhook is sent:

WEBHOOK_TYPE debt
STATUS canceled

Webhook Body

```json
{
    "webhook_type": "debt",
    "key": "1ebd4a90-2721-4c39-a399-427fa16bca65",
    "event_datetime": "2025-10-27T16:38:59Z",
    "data": {
        "cancel_reason": "Operacao cancelada por estorno",
        "cancel_reason_enumerator": "refund_after_payee_request"
    },
    "status": "canceled"
}
```

### Webhook Fields

| Field | Type | Description |
|---|---|---|
| **webhook_type** | string | Webhook type: `debt` |
| **key** | string | Unique debt key (DEBT-KEY) |
| **event_datetime** | string | Event date and time |
| **status** | string | Event status: `canceled` |
| **data.cancel_reason** | string | Textual description of the cancellation reason |
| **data.cancel_reason_enumerator** | string | Cancellation reason enumerator |

### Reversal-Related Cancellation Enumerators

| Enumerator | Description |
|---|---|
| `refund_after_payee_request` | Refund requested by the payee |
| `manual` | Operation canceled manually |
| `disbursing_error` | Operation canceled due to an error during disbursement |

---

## Transaction Reversal Settlement Webhook

For reversals processed via the `transaction_reversal` endpoint, the confirmation webhook follows the format below:

WEBHOOK_TYPE transaction_reversal.transaction_reversal_status_change
STATUS paid

Webhook Body

```json
{
    "data": {
        "transaction_reversal_key": "b6da1a84-5bb3-4d71-9912-cbbcfe7189c1",
        "amount": 123.45,
        "status": "paid",
        "description": "Valor de liquidação indevido",
        "reference_date": "2025-03-23",
        "fund_class_document_number": "12.345.678/0009-10",
        "fund_class_key": "0619574f-2815-419d-8208-630b0dc30487",
        "source_account": {
            "account_digit": "7",
            "account_branch": "0001",
            "account_number": "0099999",
            "owner": {
                "name": "FUNDO DE INVESTIMENTO",
                "document_number": "12.345.678/0009-10"
            },
            "financial_institution": {
                "code": "329",
                "ispb": "32402502",
                "name": "QI Sociedade de Crédito Direto"
            }
        },
        "target_account": {
            "owner": {
                "name": "Nome fictício",
                "document_number": "111.202.188-99"
            },
            "account_digit": "0",
            "account_branch": "0001",
            "account_number": "1029490",
            "target_pix_key": "1232221",
            "financial_institution": {
                "code": "033",
                "ispb": "90400888",
                "name": "BCO SANTANDER (BRASIL) S.A."
            }
        },
        "external_key": "40054daa-c3c5-49cd-add7-858b576c5887"
    },
    "webhook_type": "transaction_reversal.transaction_reversal_status_change",
    "webhook_datetime": "2025-03-23T15:08:30Z"
}
```

### Transaction Reversal Webhook Fields

| Field | Type | Description |
|---|---|---|
| **webhook_type** | string | Webhook type: `transaction_reversal.transaction_reversal_status_change` |
| **webhook_datetime** | string | Webhook send date and time |
| **data.transaction_reversal_key** | string | Unique reversal key |
| **data.amount** | float | Reversed amount |
| **data.status** | string | Reversal status: `paid` |
| **data.description** | string | Reversal description |
| **data.reference_date** | string | Processing reference date |
| **data.fund_class_key** | string | Fund key |
| **data.source_account** | object | Reversal source account details |
| **data.target_account** | object | Reversal target account details |
| **data.external_key** | string | External key of the reversed transaction |

---

# Present Value Inquiry - BNPL Refinancing

URL: /en/documentation/manual_bnpl_full/refinanciamento/consulta_valor_presente

# Present Value Inquiry - BNPL Refinancing


## Summary

To find out the present value that will be used in the refinancing of an operation, you can use the debt inquiry endpoint with the query params listed below.

## Request

ENDPOINT /debt
METHOD GET

### Query Params

| Field | Type | Description |
|---|---|---|
| `key`* | string | Debt key (DEBT-KEY) returned at the time of the credit operation creation |
| `eval_present_value`* | string | Indicates that the current value of each installment should be calculated and displayed (`true`) |
| `calculate_delay`* | string | Indicates that, if the installment is overdue, penalty interest and fines should be calculated with the present value (`true`) |
| `calculate_spread`* | string | Indicates whether the spread value of the operation should be added to the present value. For refinancing operations should be `false` |

### URL Example

```
/debt?key=72760166-4ddf-41fb-8a8c-605f8f4fc35c&eval_present_value=true&calculate_delay=true&calculate_spread=false
```

### Response

STATUS 200

Response Body

```json
{
    "webhook_type": "debt",
    "operation_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c",
    "status": "opened",
    "data": {
        "credit_operation_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c",
        "contract_number": "DWF1761222116",
        "annual_cet": 97.05,
        "cet": 5.82,
        "disbursed_issue_amount": 1000,
        "disbursement_date": "2026-04-07",
        "issue_amount": 1007.62,
        "final_disbursement_amount": 1000,
        "number_of_installments": 2,
        "total_iof": 7.62,
        "base_iof": 3.79,
        "additional_iof": 3.83,
        "assignment_amount": 1007.63,
        "issuer_name": "Dante Ferrarini",
        "issuer_document_number": "31057466093",
        "prefixed_interest_rate": {
            "annual_rate": 0.8373372409,
            "daily_rate": 0.0016911989,
            "interest_base": {
                "enumerator": "calendar_days",
                "year_days": 360
            },
            "monthly_rate": 0.052
        },
        "installments": [
            {
                "installment_key": "1dea396f-beb1-4df3-9822-35800b4c095a",
                "installment_number": 1,
                "due_date": "2026-05-07",
                "business_due_date": "2026-05-07",
                "calendar_days": 30,
                "total_amount": 543.89,
                "due_principal": 1007.62,
                "pre_fixed_amount": 52.3996159,
                "principal_amortization_amount": 491.4903841,
                "tax_amount": 1.20906634,
                "installment_status": {
                    "enumerator": "opened"
                },
                "paid_amount": 0,
                "present_amount": 517.01,
                "workdays": 20
            },
            {
                "installment_key": "370e73d1-55d8-431e-9b22-d08fb8297999",
                "installment_number": 2,
                "due_date": "2026-06-07",
                "business_due_date": "2026-06-08",
                "calendar_days": 31,
                "total_amount": 543.89,
                "due_principal": 516.1296159,
                "pre_fixed_amount": 27.7603841,
                "principal_amortization_amount": 516.1296159,
                "tax_amount": 2.58168034,
                "installment_status": {
                    "enumerator": "opened"
                },
                "paid_amount": 0,
                "present_amount": 490.62,
                "workdays": 20
            }
        ]
    }
}
```


:::tip Refinancing Value
The total value to be used as `disbursed_amount` in the refinancing simulation/creation is the sum of the `present_amount` of all installments. In this example: 517.01 + 490.62 = **1007.63**.
:::

:::caution Attention
For refinancing operations, the `calculate_spread` field should always be `false`, as the spread value should not be considered in the present value calculation for settlement.
:::

---

# Creation - BNPL Refinancing

URL: /en/documentation/manual_bnpl_full/refinanciamento/criacao

# Creation - BNPL Refinancing


## Summary

Creating a refinancing uses the same endpoint and payload as the issuance (`/signed_debt`), with the addition of the `refinanced_credit_operations` object containing the list of operations to be settled. The sum of the present value of the previous contracts will be retained and only the surplus will be released to the borrower's account.

## Request

ENDPOINT /signed_debt
METHOD POST

Test in Playground

Request Body

```json
{
    "borrower": {
        "name": "Dante Ferrarini",
        "email": "",
        "phone": {
            "number": "185633631",
            "area_code": "15",
            "country_code": "086"
        },
        "is_pep": false,
        "address": {
            "city": "São Paulo",
            "state": "SP",
            "number": "",
            "street": "Rua Gilberto Sabino",
            "postal_code": "05425020",
            "neighborhood": "Pinheiros",
            "complement": ""
        },
        "role_type": "issuer",
        "birth_date": "1993-09-10",
        "person_type": "natural",
        "attached_documents_list": [
            {
                "selfie": "250e7e95-57c8-40bd-a0cd-0be8eb172916"
            }
        ],
        "individual_document_number": "31057466093"
    },
    "financial": {
        "final_disbursement_amount": 0,
        "interest_type": "pre_price_days",
        "credit_operation_type": "ccb",
        "annual_interest_rate": 2.32,
        "disbursement_date": "2026-04-07",
        "interest_grace_period": 0,
        "principal_grace_period": 0,
        "number_of_installments": 3,
        "fine_configuration": {
            "contract_fine_rate": 0.02,
            "interest_base": "calendar_days",
            "monthly_rate": 0.01
        }
    },
    "simplified": true,
    "additional_data": {
        "contract": {
            "contract_number": "DWFR00000012",
            "signatures": [
                {
                    "signer": {
                        "name": "Dante Ferrarini",
                        "email": "",
                        "phone": {
                            "number": "185633631",
                            "area_code": "15",
                            "country_code": "086"
                        },
                        "document_number": "31057466093"
                    },
                    "signature": {
                        "timestamp": "2026-04-08T00:40:30Z",
                        "ip_address": "192.168.1.1",
                        "signature_file": {
                            "file_url": "https://qitech.com.br/signature.pdf",
                            "file_type": "pdf"
                        }
                    }
                }
            ]
        }
    },
    "refinanced_credit_operations": [
        {
            "operation_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c"
        }
    ],
    "requester_identifier_key": "d2107ef5-19df-4183-bf0e-802b8229933c",
    "purchaser_document_number": "32402502000135",
    "disbursement_bank_accounts": [
        {
            "name": "company name",
            "ispb_number": "32402502",
            "account_digit": "5",
            "branch_number": "0001",
            "account_number": "7617846",
            "document_number": "32246162000281",
            "percentage_receivable": 100
        }
    ]
}
```


:::caution Attention
The payload is **identical** to the issuance (`/signed_debt`), with the addition of the **`refinanced_credit_operations`** field containing the list of operations to be settled.
:::

### Request Body Details

The payload contains all fields from the [BNPL Issuance](../emissao/emissao), with the addition of:

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| **refinanced_credit_operations*** | array | List of operations to be refinanced | **[Refinanced Credit Operations Object](#refinanced-credit-operations-object)** |

All other fields follow the same specification as the issuance:
- **[Borrower Object](../emissao/emissao#borrower-object)**
- **[Additional Data Object](../emissao/emissao#additional-data-object)**
- **[Disbursement Bank Account Object](../emissao/emissao#disbursement-bank-account-object)**

:::info Financial Object Difference
In refinancing, the `financial` field uses `annual_interest_rate` instead of `monthly_interest_rate`, and the `disbursed_amount` should be the total present value of the operation to be refinanced (obtained from the present value inquiry).
:::

### Refinanced Credit Operations Object

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| `operation_key`* | string | Key of the operation to be refinanced (DEBT-KEY of the original operation) | UUID |

## Response

The response follows the same format as the debt issuance, returning the **DEBT-KEY** of the new contract.

STATUS 201

Response Body

```json
{
    "webhook_type": "debt",
    "key": "290f042f-eedd-4d9d-b621-3a81df0181b6",
    "status": "opened",
    "event_datetime": "2026-04-08 00:40:37",
    "data": {
        "borrower": {
            "name": "Dante Ferrarini",
            "document_number": "31057466093",
            "related_party_key": "3d62f3c6-1ae5-49f9-aa5d-21a08d95aad6"
        },
        "contract": {
            "document_key": null,
            "number": "DWFR00000012",
            "urls": [],
            "signature_information": [
                {
                    "signer_name": "Dante Ferrarini",
                    "signer_document_number": "31057466093",
                    "signer_role": "issuer",
                    "signer_email": null,
                    "signer_external_key": null,
                    "signature_url": null
                }
            ]
        },
        "requester_identifier_key": "d2107ef5-19df-4183-bf0e-802b8229933c",
        "iof_charge_method": "financed",
        "collaterals": [],
        "contract_fees": [
            {
                "fee_type": "spread",
                "fee_amount": 3.05
            },
            {
                "fee_type": "spread_refinancing",
                "fee_amount": 3.02
            }
        ],
        "external_contract_fees": [
            {
                "fee_type": "tac",
                "fee_amount": 0,
                "tax_amount": 0,
                "net_fee_amount": 0
            }
        ],
        "external_contract_fee_amount": 0,
        "net_external_contract_fee_amount": 0,
        "contract_fee_amount": 6.07,
        "issue_amount": 1016.72,
        "assignment_amount": 1022.79,
        "cet": "11,1900%",
        "annual_cet": "256,9982%",
        "number_of_installments": 3,
        "base_iof": 5.23,
        "additional_iof": 3.86,
        "total_iof": 9.09,
        "ipoc_code": "324025020203131057466093DWFR00000012",
        "prefixed_interest_rate": {
            "annual_rate": 2.32,
            "created_at": "2026-04-08T00:40:30",
            "daily_rate": 0.0033387969,
            "interest_base": "calendar_days",
            "monthly_rate": 0.1051676747
        },
        "installments": [
            {
                "accrual_reference_date": null,
                "additional_costs": [],
                "advanced_paid_amount": 0,
                "bank_slip_key": null,
                "business_due_date": "2026-05-07",
                "calendar_days": 30,
                "digitable_line": null,
                "due_date": "2026-05-07",
                "due_interest": 0,
                "due_principal": 1016.72,
                "fine_amount": null,
                "has_interest": true,
                "installment_history": [],
                "installment_key": "52810e9d-0815-4fd1-ab20-d8b37dcd936e",
                "installment_number": 1,
                "installment_payment": [],
                "installment_status": "created",
                "installment_type": "principal",
                "original_due_principal": 1016.72,
                "original_pre_fixed_amount": 106.92260459,
                "original_principal_amortization_amount": 306.50739541,
                "original_total_amount": 413.43,
                "paid_amount": 0,
                "paid_at": null,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 106.92260459,
                "principal_amortization_amount": 306.50739541,
                "qr_code_key": null,
                "qr_code_url": null,
                "renegotiation_proposal_key": null,
                "tax_amount": 0.75400819,
                "total_accrual_amount": null,
                "total_amount": 413.43,
                "total_paid_amount": 0,
                "workdays": 20
            },
            {
                "accrual_reference_date": null,
                "additional_costs": [],
                "advanced_paid_amount": 0,
                "bank_slip_key": null,
                "business_due_date": "2026-06-08",
                "calendar_days": 31,
                "digitable_line": null,
                "due_date": "2026-06-07",
                "due_interest": 0,
                "due_principal": 710.21260459,
                "fine_amount": null,
                "has_interest": true,
                "installment_history": [],
                "installment_key": "2bcfe19e-9847-4c8f-be80-17f646a897c4",
                "installment_number": 2,
                "installment_payment": [],
                "installment_status": "created",
                "installment_type": "principal",
                "original_due_principal": 710.21260459,
                "original_pre_fixed_amount": 77.30856978,
                "original_principal_amortization_amount": 336.12143022,
                "original_total_amount": 413.43,
                "paid_amount": 0,
                "paid_at": null,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 77.30856978,
                "principal_amortization_amount": 336.12143022,
                "qr_code_key": null,
                "qr_code_url": null,
                "renegotiation_proposal_key": null,
                "tax_amount": 1.68127939,
                "total_accrual_amount": null,
                "total_amount": 413.43,
                "total_paid_amount": 0,
                "workdays": 20
            },
            {
                "accrual_reference_date": null,
                "additional_costs": [],
                "advanced_paid_amount": 0,
                "bank_slip_key": null,
                "business_due_date": "2026-07-07",
                "calendar_days": 30,
                "digitable_line": null,
                "due_date": "2026-07-07",
                "due_interest": 0,
                "due_principal": 374.09117437,
                "fine_amount": null,
                "has_interest": true,
                "installment_history": [],
                "installment_key": "7cf785c9-b6cf-4e9b-9c09-61d917bc72b8",
                "installment_number": 3,
                "installment_payment": [],
                "installment_status": "created",
                "installment_type": "principal",
                "original_due_principal": 374.09117437,
                "original_pre_fixed_amount": 39.33882563,
                "original_principal_amortization_amount": 374.09117437,
                "original_total_amount": 413.43,
                "paid_amount": 0,
                "paid_at": null,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 39.33882563,
                "principal_amortization_amount": 374.09117437,
                "qr_code_key": null,
                "qr_code_url": null,
                "renegotiation_proposal_key": null,
                "tax_amount": 2.79146834,
                "total_accrual_amount": null,
                "total_amount": 413.43,
                "total_paid_amount": 0,
                "workdays": 22
            }
        ],
        "total_pre_fixed_amount": 223.57
    }
}
```

:::info Note
- The present value of the operations listed in `refinanced_credit_operations` will be automatically retained to settle the previous contracts
- Only the surplus (difference between the disbursed amount and the retained amount) will be released to the borrower's account
- After creation, the refinanced contracts will be automatically settled
- The issuance webhooks (signature, disbursement, cancellation) follow the same pattern described in the [Issuance Webhooks](../emissao/webhooks) section
:::

---

# Introduction - BNPL Refinancing

URL: /en/documentation/manual_bnpl_full/refinanciamento/introducao

## Summary

Refinancing consists of generating a new credit contract to settle a previous one. The flow works the same way as a simple debt issuance, however, when the operation values are provided, the sum of the present value of the previous contracts will be retained and only the surplus, if any, will be released to the borrower's account.

## Refinancing Flow

1. **Present value inquiry**: Query the present value of the original operation to determine the amount needed for settlement
2. **Simulation**: Simulate the refinancing with the new operation data and the reference to the original operation
3. **Creation**: Create the refinancing by providing the list of operations to be settled in `refinanced_credit_operations`

:::info Important
The payload used for both simulation and creation of a refinancing is the same as a simple debt, with the addition of the list of operations to be settled in **`refinanced_credit_operations`**.
:::

---

# Simulation - BNPL Refinancing

URL: /en/documentation/manual_bnpl_full/refinanciamento/simulacao

# Simulation - BNPL Refinancing


## Summary

Before creating a refinancing, you can simulate the values of the new operation. The simulation uses the same payload as a simple debt simulation, with the addition of the `refinanced_credit_operations` field.

## Request

ENDPOINT /debt_simulation
METHOD POST

Request Body

```json
{
    "borrower": {
        "person_type": "natural"
    },
    "refinanced_credit_operations": [
        {
            "operation_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c"
        }
    ],
    "financial": {
        "disbursed_amount": 1007.63,
        "interest_type": "pre_price_days",
        "credit_operation_type": "ccb",
        "annual_interest_rate": 2.32,
        "disbursement_date": "2026-04-07",
        "interest_grace_period": 0,
        "principal_grace_period": 0,
        "number_of_installments": 3,
        "fine_configuration": {
            "contract_fine_rate": 0.02,
            "interest_base": "calendar_days",
            "monthly_rate": 0.01
        }
    }
}
```


### Body Params

| Field | Type | Description |
|---|---|---|
| **borrower*** | object | Borrower data (minimum: `person_type`) |
| **refinanced_credit_operations*** | array | List of operations to be refinanced |
| **financial*** | object | Financial data for the new operation |

### refinanced_credit_operations Object

| Field | Type | Description |
|---|---|---|
| `operation_key`* | string | Key of the operation to be refinanced (DEBT-KEY) |

## Response

STATUS 200

Response Body

```json
{
    "type": "debt",
    "key": "daa5173d-ae44-44c5-87bc-f9115cfbcaa1",
    "status": "finished",
    "event_datetime": "2026-04-08 00:36:02",
    "data": {
        "interest_type": "pre_price_days",
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "interest_payment_month_period": 1,
        "principal_grace_period": 0,
        "principal_amortization_month_period": 1,
        "operation_type": "settlement_refinancing",
        "prefixed_interest_rate": {
            "interest_base": "calendar_days_365",
            "annual_rate": 2.32,
            "monthly_rate": 0.1051676747,
            "daily_rate": 0.0032929847
        },
        "issue_date": "2026-04-07",
        "number_of_installments": 3,
        "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
        "final_disbursement_amount": 0.01,
        "refinanced_credit_operations": [
            {
                "refinanced_credit_operation_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c",
                "refinanced_credit_operation_status": "pending_payment",
                "due_balance": 1007.62,
                "due_balance_reference_date": "2026-04-07",
                "original_deadline": 61
            }
        ],
        "total_pre_fixed_amount": 220.27,
        "iof_amount": 9.09,
        "cet": 0.1103,
        "annual_cet": 2.5111,
        "disbursement_date": "2026-04-07",
        "installments": [
            {
                "calendar_days": 30,
                "workdays": 20,
                "business_due_date": "2026-05-07",
                "due_date": "2026-05-07",
                "due_principal": 1016.72,
                "has_interest": true,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 105.38950323,
                "tax_amount": 0.75507362,
                "total_amount": 412.33,
                "principal_amortization_amount": 306.94049677,
                "installment_number": 1
            },
            {
                "calendar_days": 31,
                "workdays": 20,
                "business_due_date": "2026-06-08",
                "due_date": "2026-06-07",
                "due_principal": 709.77950323,
                "has_interest": true,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 76.15320432,
                "tax_amount": 1.68155633,
                "total_amount": 412.33,
                "principal_amortization_amount": 336.17679568,
                "installment_number": 2
            },
            {
                "calendar_days": 30,
                "workdays": 22,
                "business_due_date": "2026-07-07",
                "due_date": "2026-07-07",
                "due_principal": 373.60270755,
                "has_interest": true,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 38.72729245,
                "tax_amount": 2.7878234,
                "total_amount": 412.33,
                "principal_amortization_amount": 373.60270755,
                "installment_number": 3
            }
        ],
        "external_contract_fees": [
            {
                "fee_type": "tac",
                "amount_type": "absolute",
                "amount": 0,
                "fee_amount": 0,
                "tax_amount": 0,
                "net_fee_amount": 0
            }
        ],
        "contract_fee_amount": 3.05,
        "external_contract_fee_amount": 0,
        "net_external_contract_fee_amount": 0,
        "contract_fees": [
            {
                "fee_type": "spread",
                "amount_type": "percentage",
                "amount": 0.3,
                "fee_amount": 3.05
            }
        ],
        "issue_amount": 1016.72,
        "disbursed_issue_amount": 1007.63,
        "assignment_amount": 1019.77
    }
}
```

---

# Scenarios - BNPL Batch Renegotiation

URL: /en/documentation/manual_bnpl_full/renegociacao/cenarios

## Overview

This document presents the main batch renegotiation scenarios for BNPL operations. All scenarios use `amortization_type: "installment_payment"` and allow applying individual discounts per installment through the `discount_amount` field in each installment object.

:::info Per-Installment Discount Logic
You can apply different discounts to each installment individually. Simply add the `discount_amount` field (absolute value in BRL) inside the desired installment object. Installments without the `discount_amount` field will be charged at the full present value.
:::

---

## Scenario 1: 1 Installment Loan - Standard Payment

The borrower has a 1-installment BNPL loan and wants to settle it at the present value.

### Payload Example

```json
{
    "payment_type": "pix",
    "amortization_type": "installment_payment",
    "proposal_due_date": "2026-04-10",
    "discount_percentage": 0,
    "reference_date": "2026-04-10",
    "request_control_key": "3571e292-3a83-4011-904d-20ee963022ef",
    "operations": [
        {
            "debt_key": "bf1175f4-750d-42b9-b264-5e7cd8c1c189",
            "installments": [
                {
                    "installment_key": "0298c572-7b6b-4db0-88d6-4bf1622d3e2d"
                }
            ]
        }
    ]
}
```

---

## Scenario 2: 1 Installment Loan - Interest Free Payment

The borrower has a 1-installment BNPL loan and negotiates an interest-free payment. The discount applied corresponds to the interest amount of the installment.

### Payload Example

```json
{
    "payment_type": "pix",
    "amortization_type": "installment_payment",
    "proposal_due_date": "2026-04-10",
    "discount_percentage": 0,
    "reference_date": "2026-04-10",
    "request_control_key": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "operations": [
        {
            "debt_key": "bf1175f4-750d-42b9-b264-5e7cd8c1c189",
            "installments": [
                {
                    "installment_key": "0298c572-7b6b-4db0-88d6-4bf1622d3e2d",
                    "discount_amount": 54.19
                }
            ]
        }
    ]
}
```

:::info Note
The `discount_amount` value (54.19) corresponds to the interest amount (`pre_fixed_amount`) of the installment. This way, the borrower only pays the principal amount.
:::

---

## Scenario 3: 1 Installment Loan - Interest + IOF Free Payment

The borrower has a 1-installment BNPL loan and negotiates a payment without interest and without IOF. The discount applied corresponds to the sum of interest and IOF of the installment.

### Payload Example

```json
{
    "payment_type": "pix",
    "amortization_type": "installment_payment",
    "proposal_due_date": "2026-04-10",
    "discount_percentage": 0,
    "reference_date": "2026-04-10",
    "request_control_key": "c3d4e5f6-a7b8-9012-cdef-123456789012",
    "operations": [
        {
            "debt_key": "bf1175f4-750d-42b9-b264-5e7cd8c1c189",
            "installments": [
                {
                    "installment_key": "0298c572-7b6b-4db0-88d6-4bf1622d3e2d",
                    "discount_amount": 55.44
                }
            ]
        }
    ]
}
```

:::info Note
The `discount_amount` value (55.44) corresponds to the sum of interest (`pre_fixed_amount`: 54.19) + IOF (`tax_amount`: 1.25) of the installment. This way, the borrower only pays the principal amortization amount.
:::

---

## Scenario 4: Multiple Installments with Individual Discount

The borrower has a BNPL loan with multiple installments and negotiates different discounts for specific installments. Installments without the `discount_amount` field are charged at the full present value.

### Payload Example

```json
{
    "payment_type": "pix",
    "amortization_type": "installment_payment",
    "proposal_due_date": "2026-04-10",
    "discount_percentage": 0,
    "reference_date": "2026-04-10",
    "request_control_key": "d4e5f6a7-b8c9-0123-defa-234567890123",
    "operations": [
        {
            "debt_key": "bf1175f4-750d-42b9-b264-5e7cd8c1c189",
            "installments": [
                {
                    "installment_key": "0298c572-7b6b-4db0-88d6-4bf1622d3e2d",
                    "discount_amount": 20
                },
                {
                    "installment_key": "5e267f58-0f55-4b12-9582-63e0e9e082a8"
                },
                {
                    "installment_key": "5be492bf-b637-4999-986d-ecf423cc5dd1"
                },
                {
                    "installment_key": "15abfbfd-8608-45e9-abbb-a04c021dcf7b",
                    "discount_amount": 10
                },
                {
                    "installment_key": "c8eb83b3-5b0d-4326-947c-79279cdce2d6"
                }
            ]
        }
    ]
}
```

:::info Note
In this example:
- Installment 1: R$ 20.00 discount
- Installment 2: no discount (full present value)
- Installment 3: no discount (full present value)
- Installment 4: R$ 10.00 discount
- Installment 5: no discount (full present value)
:::

---

## Scenario 5: Overdue Installment Payment

The borrower has overdue installments and wants to settle them. Overdue installments already include automatically calculated fines and penalty interest. Individual discounts can be applied to reduce the amount.

### Payload Example

```json
{
    "payment_type": "bank_slip",
    "amortization_type": "installment_payment",
    "proposal_due_date": "2026-04-10",
    "discount_percentage": 0,
    "reference_date": "2026-04-10",
    "request_control_key": "e5f6a7b8-c9d0-1234-efab-345678901234",
    "operations": [
        {
            "debt_key": "bf1175f4-750d-42b9-b264-5e7cd8c1c189",
            "installments": [
                {
                    "installment_key": "0298c572-7b6b-4db0-88d6-4bf1622d3e2d",
                    "discount_amount": 15
                },
                {
                    "installment_key": "5e267f58-0f55-4b12-9582-63e0e9e082a8",
                    "discount_amount": 15
                }
            ]
        }
    ]
}
```

:::caution Attention
For overdue installments, the present value already includes fines (`fine_amount`) and penalty interest calculated automatically based on the contract's `fine_configuration`. The `discount_amount` is applied on this total value.
:::

---

## Scenario 6: Multiple Operations with Individual Per-Installment Discount

The borrower has BNPL loans across different operations and wants to settle installments from all of them in a single payment, with individual discounts.

### Payload Example

```json
{
    "payment_type": "pix",
    "amortization_type": "installment_payment",
    "proposal_due_date": "2026-04-10",
    "discount_percentage": 0,
    "reference_date": "2026-04-10",
    "request_control_key": "f6a7b8c9-d0e1-2345-fabc-456789012345",
    "operations": [
        {
            "debt_key": "bf1175f4-750d-42b9-b264-5e7cd8c1c189",
            "installments": [
                {
                    "installment_key": "0298c572-7b6b-4db0-88d6-4bf1622d3e2d",
                    "discount_amount": 20
                },
                {
                    "installment_key": "5e267f58-0f55-4b12-9582-63e0e9e082a8"
                }
            ]
        },
        {
            "debt_key": "a2c3d4e5-860f-4b7a-9c1d-2e3f4a5b6c7d",
            "installments": [
                {
                    "installment_key": "7b8c9d0e-1f2a-3b4c-5d6e-7f8a9b0c1d2e",
                    "discount_amount": 30
                }
            ]
        }
    ]
}
```

---

## Installments Object - Discount Field

| Field | Type | Description | Required |
|---|---|---|---|
| `installment_key`* | string | Key of the installment to be renegotiated | Yes |
| `discount_amount` | float | Discount amount in BRL (R$) applied individually to the installment | No |

:::info About the discount_amount field
- The `discount_amount` field is **optional** and can be provided for any installment
- The value is an **absolute discount in BRL** (not a percentage)
- Installments without the `discount_amount` field are charged at the **full present value**
- The discount is applied on the installment's present value at the `reference_date`
:::

---

## Scenarios Summary Table

| Scenario | Description | Discount |
|---|---|---|
| 1 installment - standard | Payment at present value | No discount |
| 1 installment - interest free | Discount = interest amount | `discount_amount` = `pre_fixed_amount` |
| 1 installment - interest + IOF free | Discount = interest + IOF | `discount_amount` = `pre_fixed_amount` + `tax_amount` |
| Multiple installments | Individual discounts per installment | `discount_amount` per installment |
| Overdue installments | Overdue installments with fines/penalties | Optional `discount_amount` |
| Multiple operations | Different operations in one batch | `discount_amount` per installment |

---

## Important Rules

:::caution Batch Renegotiation Rules
- All operations must belong to the **same issuer** and the same **integration key**
- Limit of **50 operations** per batch
- A single payment method (bank slip/Pix) is generated for the total batch amount
- If an installment included in the batch is paid externally before confirmation, the batch is **rejected**
- If payment is not made by the `proposal_due_date`, the batch is **rejected**
- The `amortization_type` used is always `installment_payment`
- The `discount_amount` field is applied **individually per installment**
:::

---

# Inquiry - BNPL Batch Renegotiation

URL: /en/documentation/manual_bnpl_full/renegociacao/consulta

# Inquiry - BNPL Batch Renegotiation


## Overview

You can query the status and details of a batch renegotiation proposal using the `batch_proposal_key` or the `request_control_key`.

---

## Query by Batch Proposal Key

ENDPOINT /renegotiation/batch_proposal/ BATCH-PROPOSAL-KEY
METHOD GET

### Path Params

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| `batch_proposal_key`* | string | Batch renegotiation proposal key | UUID |

### Response

STATUS 200

Response Body

```json
{
    "batch_proposal_key": "ff5ad6dd-2087-4850-a3e8-b37634448b4e",
    "discount_percentage": 0,
    "discount_amount": 0,
    "amortization_type": "installment_payment",
    "payment_amount": 517.88,
    "requester_name": "Dante Ltda",
    "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
    "issuer_name": "Dante Ferrarini",
    "reference_date": "2026-04-08",
    "issuer_document_number": "31057466093",
    "batch_proposal_status": "pending_payment",
    "proposal_due_date": "2026-04-15",
    "payment_type": "pix",
    "request_control_key": "94b31045-c8e7-45be-a88d-2ae25c5df5db",
    "origin_key": null,
    "operations": [
        {
            "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
            "contract_number": "DWF1761222116",
            "payment_amount": 517.88,
            "discount_amount": 0,
            "origin_key": null,
            "affected_installments": [
                {
                    "installment_key": "1dea396f-beb1-4df3-9822-35800b4c095a",
                    "due_date": "2026-05-07",
                    "principal_amount": 491.49,
                    "interest_amount": 52.4,
                    "fine_amount": 0,
                    "total_amount": 543.89,
                    "present_amount": 517.88,
                    "paid_amount": 517.88,
                    "principal_amortization_payment_amount": 491.49,
                    "prefixed_interest_payment_amount": 26.39,
                    "fine_payment_amount": 0,
                    "discount_amount": 0
                }
            ],
            "remaining_installments": [
                {
                    "installment_key": "370e73d1-55d8-431e-9b22-d08fb8297999",
                    "due_date": "2026-06-07",
                    "principal_amount": 516.13,
                    "interest_amount": 27.76,
                    "fine_amount": 0,
                    "total_amount": 543.89
                }
            ],
            "debt_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c"
        }
    ],
    "payment": {
        "digitable_line": null,
        "qr_code_url": "00020126930014br.gov.bcb.pix2571qrcode-h.sandbox.qitech.app/bacen/cobv/acaeb341e1264cde99b93e247e12b3725204000053039865802BR5925QISOCIEDADEDECREDITODIRET6008SaoPaulo61080145200062070503***63043AD0",
        "qr_code_key": "acaeb341-e126-4cde-99b9-3e247e12b372",
        "bank_slip_key": null,
        "paid_method_type": "pix",
        "source_account_key": null,
        "payment_data": {
            "creditor_bank_account_key": "6108dd45-580d-48c4-b3bb-74c1e843be49",
            "batch_renegotiation_proposal_key": "ff5ad6dd-2087-4850-a3e8-b37634448b4e"
        }
    }
}
```


---

## Query by Request Control Key

ENDPOINT /renegotiation/batch_proposal/request_control_key/ REQUEST-CONTROL-KEY
METHOD GET

### Path Params

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| `request_control_key`* | string | Request control key | UUID |

### Response

The response follows the same format as the query by `batch_proposal_key`.

---

## List Batch Renegotiations

ENDPOINT /renegotiation/batch_proposal
METHOD GET

### Query Params

| Field | Type | Description |
|---|---|---|
| `batch_proposal_status` | string | Filter by batch proposal status |
| `issuer_document_number` | string | Filter by issuer CPF/CNPJ |
| `request_control_key` | string | Filter by control key |

### Response

STATUS 200

Response Body

```json
{
    "data": [
        {
            "batch_proposal_key": "ff5ad6dd-2087-4850-a3e8-b37634448b4e",
            "discount_percentage": 0,
            "discount_amount": 0,
            "amortization_type": "installment_payment",
            "payment_amount": 517.88,
            "requester_name": "Dante Ltda",
            "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
            "issuer_name": "Dante Ferrarini",
            "reference_date": "2026-04-08",
            "issuer_document_number": "31057466093",
            "batch_proposal_status": "pending_payment",
            "proposal_due_date": "2026-04-15",
            "payment_type": "pix",
            "request_control_key": "94b31045-c8e7-45be-a88d-2ae25c5df5db",
            "origin_key": null
        }
    ],
    "pagination": {
        "current_page": 1,
        "next_page": 2,
        "rows_per_page": 10,
        "total_pages": 150,
        "total_rows": 1495
    }
}
```


---

## Cancel a Batch Renegotiation

ENDPOINT /renegotiation/batch_proposal/ BATCH-PROPOSAL-KEY
METHOD DELETE

### Path Params

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| `batch_proposal_key`* | string | Key of the batch renegotiation proposal to be canceled | UUID |

### Response

STATUS 204

Response Body

```json
{}
```


:::caution Attention
Only proposals with status `pending_payment` can be canceled.
:::

---

# Renegotiation with IOF Spread and Interest-Only Discount - BNPL

URL: /en/documentation/manual_bnpl_full/renegociacao/iof-spread-e-desconto-juros

## Overview

This page documents the batch renegotiation flow for BNPL operations where the credit operation was created with `iof_charge_method: "spread"`. In this model, the IOF is **not** financed in the installments — it is calculated normally but added to the `assignment_amount` (assignment value), not to the borrower's installments.

Additionally, the field `discount_validation: "only_interest_discount"` can be used in each operation within the `operations[]` array to restrict discounts to the interest portion only. If the discount exceeds the interest and reaches the principal or fine, the API will return the error `InvalidDiscountAmountOnlyInterestDiscount`.

The flow uses the batch endpoints: simulation (`POST /renegotiation/batch_proposal_simulation`) followed by the proposal (`POST /renegotiation/batch_proposal`). The `discount_validation` field is set **per operation** in the `operations[]` array, not at the root level of the payload.

:::info Note — iof_charge_method
The `iof_charge_method` field is set at the time of **credit operation creation** (credit-operation-api), not during renegotiation. When `iof_charge_method: "spread"`:
- The IOF is calculated normally (base IOF + additional IOF), but is **not** deducted from the borrower's installments
- The IOF is added to the `assignment_amount` — meaning the IOF cost is reflected in the assignment value
- The borrower's installments are "clean" of IOF

The three possible values are:
- `"financed"` **(default)** — IOF is financed in the installments (deducted from the amount credited to the borrower)
- `"spread"` — IOF is added to the assignment value (`assignment_amount`), not to the installments
- `"free"` — No IOF (`total_iof = 0`)
:::

:::caution Attention — discount_validation
When `discount_validation: "only_interest_discount"` is set on an operation, the system validates that the discount applied to each installment does **not** include principal amortization (`discount_principal_amortization_amount`) or fine (`discount_fine_amount`). Only interest (prefixed interest) can be discounted.

If any installment has a discount that reaches the principal or fine, the API returns the error `InvalidDiscountAmountOnlyInterestDiscount` and the entire request fails.
:::

## Step 1: Batch Simulation

ENDPOINT /renegotiation/batch_proposal_simulation
METHOD POST

:::warning Attention
The fields `discount_amount` and `discount_percentage` **CANNOT** be sent together in the same payload (root level).
:::

Request Body

```json
{
    "amortization_type": "installment_payment",
    "reference_date": "2026-04-20",
    "discount_percentage": 0.0,
    "operations": [
        {
            "debt_key": "3571e292-3a83-4011-904d-20ee963022ef",
            "discount_validation": "only_interest_discount",
            "installments": [
                {
                    "installment_key": "f9e8d7c6-b5a4-3210-fedc-ba9876543210"
                }
            ]
        }
    ]
}
```

### Body Params

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| `amortization_type`* | string | Amortization type | **[Amortization Type Enumerators](#amortization-type-enumerators)** |
| `reference_date`* | string | Reference date for present value calculation (must be D+1) | 10 |
| `discount_percentage` | float | Discount percentage on the present value ((1 - percentage) x Present Value) | 10 |
| `discount_amount` | float | Discount amount applied on the present value | 10 |
| `operations`* | array | List of operations to be renegotiated | **[Operations Object](#operations-object)** |

### Operations Object

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| `debt_key`* | string | Unique key of the credit operation (DEBT-KEY) | UUID |
| `discount_validation` | string | Discount validation rule. When set to `"only_interest_discount"`, the applied discount cannot exceed the interest portion. | **[Discount Validation Enumerators](#discount-validation-enumerators)** |
| `installments`* | array | Installments to be renegotiated | **[Installments Object](#installments-object)** |

### Installments Object

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| `installment_key`* | string | Key of the installment to be renegotiated | UUID |
| `paid_amount` | float | Amount paid (or allocated) on the installment, in BRL (R$). Required when `amortization_type` is **`present_amount`**. | 15,2 |
| `discount_amount` | float | Discount amount in BRL (R$) on the installment. Required when `amortization_type` is **`present_amount`** (use `0` if there is no discount). Optional for other types. | 15,2 |

### Discount Validation Enumerators

| Field | Description |
|---|---|
| `only_interest_discount` | Validates that the discount applied to each installment does not exceed the interest amount. If the discount reaches the principal or fine, the API returns the error `InvalidDiscountAmountOnlyInterestDiscount`. |

### Amortization Type Enumerators

| Field | Description |
|---|---|
| **installment_payment** | Renegotiation for payment of specific installments sent in the payload. Requires the `installment_key` of each installment. |
| **overdue_installment_payment** | Renegotiation targeted at overdue installment payment. Requires the `installment_key` of each installment. |
| **present_amount** | Simulation with per-installment present value. In each `installments[]`, `installment_key`, **`paid_amount`** and **`discount_amount`** are required. |

## Response

STATUS 200

Response Body

```json
{
    "batch_proposal_key": "7423c701-3578-4733-8f30-81ab60afdb6d",
    "discount_percentage": 0,
    "discount_amount": 0,
    "amortization_type": "installment_payment",
    "payment_amount": 517.88,
    "requester_name": "Empresa Exemplo Ltda",
    "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
    "issuer_name": "João da Silva",
    "reference_date": "2026-04-20",
    "issuer_document_number": "31057466093",
    "operations": [
        {
            "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
            "contract_number": "DWF1761222116",
            "payment_amount": 517.88,
            "discount_amount": 0,
            "origin_key": null,
            "affected_installments": [
                {
                    "installment_key": "f9e8d7c6-b5a4-3210-fedc-ba9876543210",
                    "due_date": "2026-05-07",
                    "principal_amount": 491.49,
                    "interest_amount": 52.40,
                    "fine_amount": 0,
                    "total_amount": 543.89,
                    "present_amount": 517.88,
                    "paid_amount": 517.88,
                    "principal_amortization_payment_amount": 491.49,
                    "prefixed_interest_payment_amount": 26.39,
                    "fine_payment_amount": 0,
                    "discount_amount": 0
                }
            ],
            "remaining_installments": [
                {
                    "installment_key": "370e73d1-55d8-431e-9b22-d08fb8297999",
                    "due_date": "2026-06-07",
                    "principal_amount": 516.13,
                    "interest_amount": 27.76,
                    "fine_amount": 0,
                    "total_amount": 543.89
                }
            ],
            "debt_key": "3571e292-3a83-4011-904d-20ee963022ef"
        }
    ]
}
```

## Step 2: Batch Proposal

ENDPOINT /renegotiation/batch_proposal
METHOD POST

:::warning Attention
The fields `discount_amount` and `discount_percentage` **CANNOT** be sent together in the same payload (root level).
:::

Request Body

```json
{
    "amortization_type": "installment_payment",
    "reference_date": "2026-04-20",
    "proposal_due_date": "2026-04-27",
    "payment_type": "pix",
    "discount_percentage": 0.0,
    "request_control_key": "94b31045-c8e7-45be-a88d-2ae25c5df5db",
    "operations": [
        {
            "debt_key": "3571e292-3a83-4011-904d-20ee963022ef",
            "discount_validation": "only_interest_discount",
            "installments": [
                {
                    "installment_key": "f9e8d7c6-b5a4-3210-fedc-ba9876543210"
                }
            ]
        }
    ]
}
```

### Body Params

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| `amortization_type`* | string | Amortization type | **[Amortization Type Enumerators](#amortization-type-enumerators-1)** |
| `reference_date`* | string | Reference date for present value calculation (D+1) | 10 |
| `proposal_due_date`* | string | Due date for the renegotiation proposal | 10 |
| `payment_type`* | string | Payment type | **[Payment Type Enumerators](#payment-type-enumerators)** |
| `request_control_key` | string | Control key for tracking and unique identification (optional) | UUID |
| `discount_percentage` | float | Discount percentage on the present value | 10 |
| `discount_amount` | float | Discount amount on the present value | 10 |
| `operations`* | array | List of operations to be renegotiated | **[Operations Object](#operations-object-1)** |

### Operations Object

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| `debt_key`* | string | Unique key of the credit operation (DEBT-KEY) | UUID |
| `discount_validation` | string | Discount validation rule. When set to `"only_interest_discount"`, the applied discount cannot exceed the interest portion. | **[Discount Validation Enumerators](#discount-validation-enumerators-1)** |
| `installments`* | array | Installments to be renegotiated | **[Installments Object](#installments-object-1)** |

### Installments Object

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| `installment_key`* | string | Key of the installment to be renegotiated | UUID |
| `paid_amount` | float | Amount paid (or allocated) on the installment, in BRL (R$). Required when `amortization_type` is **`present_amount`**. | 15,2 |
| `discount_amount` | float | Discount amount in BRL (R$) applied to the installment. Required when `amortization_type` is **`present_amount`** (use `0` if there is no discount). For other amortization types, it remains optional per installment. | 15,2 |

### Discount Validation Enumerators

| Field | Description |
|---|---|
| `only_interest_discount` | Validates that the discount applied to each installment does not exceed the interest amount. If the discount reaches the principal or fine, the API returns the error `InvalidDiscountAmountOnlyInterestDiscount`. |

### Payment Type Enumerators

| Field | Description |
|---|---|
| `bank_slip` | Payment via bank slip (generates bank slip and Pix) |
| `pix` | Payment via Pix (generates Pix only) |
| `manual` | Manual payment (does not generate a payment method) |

### Amortization Type Enumerators

| Field | Description |
|---|---|
| **installment_payment** | Renegotiation for payment of specific installments. Requires the `installment_key` of each installment. |
| **overdue_installment_payment** | Renegotiation targeted at overdue installment payment. Requires the `installment_key` of each installment. |
| **present_amount** | Renegotiation with per-installment present value composition. In each item of `installments[]`, `installment_key`, **`paid_amount`** and **`discount_amount`** are required. |

## Response

STATUS 201

Response Body

```json
{
    "batch_proposal_key": "ff5ad6dd-2087-4850-a3e8-b37634448b4e",
    "discount_percentage": 0,
    "discount_amount": 0,
    "amortization_type": "installment_payment",
    "payment_amount": 517.88,
    "requester_name": "Empresa Exemplo Ltda",
    "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
    "issuer_name": "João da Silva",
    "reference_date": "2026-04-20",
    "issuer_document_number": "31057466093",
    "batch_proposal_status": "pending_payment",
    "proposal_due_date": "2026-04-27",
    "payment_type": "pix",
    "request_control_key": "94b31045-c8e7-45be-a88d-2ae25c5df5db",
    "origin_key": null,
    "operations": [
        {
            "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
            "contract_number": "DWF1761222116",
            "payment_amount": 517.88,
            "discount_amount": 0,
            "origin_key": null,
            "affected_installments": [
                {
                    "installment_key": "f9e8d7c6-b5a4-3210-fedc-ba9876543210",
                    "due_date": "2026-05-07",
                    "principal_amount": 491.49,
                    "interest_amount": 52.40,
                    "fine_amount": 0,
                    "total_amount": 543.89,
                    "present_amount": 517.88,
                    "paid_amount": 517.88,
                    "principal_amortization_payment_amount": 491.49,
                    "prefixed_interest_payment_amount": 26.39,
                    "fine_payment_amount": 0,
                    "discount_amount": 0
                }
            ],
            "remaining_installments": [
                {
                    "installment_key": "370e73d1-55d8-431e-9b22-d08fb8297999",
                    "due_date": "2026-06-07",
                    "principal_amount": 516.13,
                    "interest_amount": 27.76,
                    "fine_amount": 0,
                    "total_amount": 543.89
                }
            ],
            "debt_key": "3571e292-3a83-4011-904d-20ee963022ef"
        }
    ],
    "payment": {
        "digitable_line": null,
        "qr_code_url": "00020126930014br.gov.bcb.pix2571qrcode-h.sandbox.qitech.app/bacen/cobv/acaeb341e1264cde99b93e247e12b3725204000053039865802BR5925QISOCIEDADEDECREDITODIRET6008SaoPaulo61080145200062070503***63043AD0",
        "qr_code_key": "acaeb341-e126-4cde-99b9-3e247e12b372",
        "bank_slip_key": null,
        "paid_method_type": "pix",
        "source_account_key": null,
        "payment_data": {
            "creditor_bank_account_key": "6108dd45-580d-48c4-b3bb-74c1e843be49",
            "batch_renegotiation_proposal_key": "ff5ad6dd-2087-4850-a3e8-b37634448b4e"
        }
    }
}
```

:::info Important
Save the **batch_proposal_key** returned in the response. It will be needed to check the batch renegotiation status and to receive payment webhooks.
:::

## Error: Discount Exceeds Interest

When `discount_validation: "only_interest_discount"` is set on an operation and the applied discount amount exceeds the interest portion, the API returns the following error:

Error Response

```json
{
    "code": "InvalidDiscountAmountOnlyInterestDiscount",
    "message": "Discount amount must be only interest discount"
}
```

The validation is performed **per installment** during amortization processing. If any individual installment has a discount whose value includes principal amortization (`discount_principal_amortization_amount > 0`) or fine (`discount_fine_amount > 0`), the entire request is rejected.

## Assignment

:::info Note
After the proposal is paid, the assignment step (`POST /credit_operations/assign`) creates a formal transfer of the credit operation. This is a separate endpoint from the **credit-operation-api**.

When the credit operation has `iof_charge_method: "spread"`, the calculated `assignment_amount` includes the IOF that was **not** financed in the installments. In other words, the assignment value reflects the total cost including the separate IOF.
:::

---

# Batch Renegotiation Proposal - BNPL

URL: /en/documentation/manual_bnpl_full/renegociacao/proposta

# Batch Renegotiation Proposal - BNPL


## Overview

After simulating the values, you can create a batch renegotiation proposal for multiple BNPL operations. The proposal generates a single payment method (bank slip and/or Pix) that covers all operations included in the batch.

For the **`present_amount`** amortization type, each installment informed in `operations[].installments[]` must include **`paid_amount`** (amount paid/allocated to that installment) and **`discount_amount`** (discount in BRL applied to the installment), in addition to **`installment_key`**.

:::caution Attention
Batch renegotiation can only be created with operations from the same issuer and the same integration key. There is a limit of **50 operations** per batch renegotiation.
:::

## Request

ENDPOINT /renegotiation/batch_proposal
METHOD POST

:::warning Attention
The fields `discount_amount` and `discount_percentage` **CANNOT** be sent together in the same payload (root level).
:::

:::info Note
At the root of the body, `discount_amount` and `discount_percentage` are alternatives for a global discount on the present value. The **`paid_amount`** and **`discount_amount`** fields inside each object of `operations[].installments[]` define the per-installment composition when `amortization_type` is **`present_amount`** (they are required in this mode and do not conflict with the root-level rule).
:::

Request Body

```json
{
    "amortization_type": "present_amount",
    "reference_date": "2026-04-08",
    "proposal_due_date": "2026-04-15",
    "discount_percentage": 0.0,
    "payment_type": "pix",
    "request_control_key": "94b31045-c8e7-45be-a88d-2ae25c5df5db",
    "operations": [
        {
            "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
            "installments": [
                {
                    "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88",
                    "paid_amount": 500,
                    "discount_amount": 50
                }
            ]
        },
        {
            "debt_key": "2cbfb9b1-1fdb-5f8d-9967-b338e5eb83f9",
            "installments": [
                {
                    "installment_key": "2ef25ed8-7124-44f5-9e3d-1d1a7196166e",
                    "paid_amount": 150,
                    "discount_amount": 10
                }
            ]
        }
    ]
}
```


### Body Params

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| `amortization_type`* | string | Amortization type | **[Amortization Type Enumerators](#amortization-type-enumerators)** |
| `reference_date`* | string | Reference date for present value calculation (D+1) | 10 |
| `proposal_due_date`* | string | Due date for the renegotiation proposal | 10 |
| `payment_type`* | string | Payment type | **[Payment Type Enumerators](#payment-type-enumerators)** |
| `request_control_key` | string | Control key for tracking and unique identification (optional) | UUID |
| `discount_percentage` | float | Discount percentage on the present value | 10 |
| `discount_amount` | float | Discount amount on the present value | 10 |
| `operations`* | array | List of operations to be renegotiated | **[Operations Object](#operations-object)** |

### Operations Object

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| `debt_key`* | string | Unique key of the credit operation (DEBT-KEY) | UUID |
| `installments`* | array | Installments to be renegotiated | **[Installments Object](#installments-object)** |

### Installments Object

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| `installment_key`* | string | Key of the installment to be renegotiated | UUID |
| `paid_amount` | float | Amount paid (or allocated) on the installment, in BRL (R$). Required when `amortization_type` is **`present_amount`**. | 15,2 |
| `discount_amount` | float | Discount amount in BRL (R$) applied to the installment. Required when `amortization_type` is **`present_amount`** (use `0` if there is no discount). For other amortization types, it remains optional per installment. | 15,2 |

### Payment Type Enumerators

| Field | Description |
|---|---|
| `bank_slip` | Payment via bank slip (generates bank slip and Pix) |
| `pix` | Payment via Pix (generates Pix only) |
| `manual` | Manual payment (does not generate a payment method) |

### Amortization Type Enumerators

| Field | Description |
|---|---|
| **present_amount** | Renegotiation with per-installment present value composition. In each item of `installments[]`, `installment_key`, **`paid_amount`** and **`discount_amount`** are required. |
| **installment_payment** | Renegotiation for payment of specific installments. Requires the `installment_key` of each installment. |
| **overdue_installment_payment** | Renegotiation targeted at overdue installment payment. Requires the `installment_key` of each installment. |

## Response

STATUS 201

Response Body

```json
{
    "batch_proposal_key": "ff5ad6dd-2087-4850-a3e8-b37634448b4e",
    "discount_percentage": 0,
    "discount_amount": 0,
    "amortization_type": "present_amount",
    "payment_amount": 517.88,
    "requester_name": "Dante Ltda",
    "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
    "issuer_name": "Dante Ferrarini",
    "reference_date": "2026-04-08",
    "issuer_document_number": "31057466093",
    "batch_proposal_status": "pending_payment",
    "proposal_due_date": "2026-04-15",
    "payment_type": "pix",
    "request_control_key": "94b31045-c8e7-45be-a88d-2ae25c5df5db",
    "origin_key": null,
    "operations": [
        {
            "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
            "contract_number": "DWF1761222116",
            "payment_amount": 517.88,
            "discount_amount": 0,
            "origin_key": null,
            "affected_installments": [
                {
                    "installment_key": "1dea396f-beb1-4df3-9822-35800b4c095a",
                    "due_date": "2026-05-07",
                    "principal_amount": 491.49,
                    "interest_amount": 52.4,
                    "fine_amount": 0,
                    "total_amount": 543.89,
                    "present_amount": 517.88,
                    "paid_amount": 517.88,
                    "principal_amortization_payment_amount": 491.49,
                    "prefixed_interest_payment_amount": 26.39,
                    "fine_payment_amount": 0,
                    "discount_amount": 0
                }
            ],
            "remaining_installments": [
                {
                    "installment_key": "370e73d1-55d8-431e-9b22-d08fb8297999",
                    "due_date": "2026-06-07",
                    "principal_amount": 516.13,
                    "interest_amount": 27.76,
                    "fine_amount": 0,
                    "total_amount": 543.89
                }
            ],
            "debt_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c"
        }
    ],
    "payment": {
        "digitable_line": null,
        "qr_code_url": "00020126930014br.gov.bcb.pix2571qrcode-h.sandbox.qitech.app/bacen/cobv/acaeb341e1264cde99b93e247e12b3725204000053039865802BR5925QISOCIEDADEDECREDITODIRET6008SaoPaulo61080145200062070503***63043AD0",
        "qr_code_key": "acaeb341-e126-4cde-99b9-3e247e12b372",
        "bank_slip_key": null,
        "paid_method_type": "pix",
        "source_account_key": null,
        "payment_data": {
            "creditor_bank_account_key": "6108dd45-580d-48c4-b3bb-74c1e843be49",
            "batch_renegotiation_proposal_key": "ff5ad6dd-2087-4850-a3e8-b37634448b4e"
        }
    }
}
```


:::info Important
Save the **batch_proposal_key** returned in the response. It will be needed to check the batch renegotiation status and to receive payment webhooks.
:::

---

# Simulation - BNPL Batch Renegotiation

URL: /en/documentation/manual_bnpl_full/renegociacao/simulacao

# Simulation - BNPL Batch Renegotiation


## Overview

Before creating a renegotiation proposal, you can simulate the batch renegotiation values for BNPL operations. The simulation allows you to view the affected installments, discount values, and the final amount to be paid for multiple operations simultaneously.

With **`amortization_type`** set to **`present_amount`**, send in each installment of `operations[].installments[]` the fields **`paid_amount`**, **`discount_amount`** and **`installment_key`**, just like in the batch proposal.

:::caution Attention
Batch renegotiation can only be created with operations from the same issuer and the same integration key. There is a limit of **50 operations** per batch renegotiation.
:::

## Request

ENDPOINT /renegotiation/batch_proposal_simulation
METHOD POST

:::warning Attention
The fields `discount_amount` and `discount_percentage` **CANNOT** be sent together in the same payload (root level).
:::

:::info Note
At the root level, `discount_amount` and `discount_percentage` are alternatives for a global discount. The **`paid_amount`** and **`discount_amount`** fields in `operations[].installments[]` are used with **`present_amount`** per installment and do not replace the root-level rule.
:::

Request Body

```json
{
    "amortization_type": "present_amount",
    "reference_date": "2026-04-08",
    "discount_percentage": 0.0,
    "operations": [
        {
            "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
            "installments": [
                {
                    "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88",
                    "paid_amount": 500,
                    "discount_amount": 50
                }
            ]
        },
        {
            "debt_key": "2cbfb9b1-1fdb-5f8d-9967-b338e5eb83f9",
            "installments": [
                {
                    "installment_key": "2ef25ed8-7124-44f5-9e3d-1d1a7196166e",
                    "paid_amount": 150,
                    "discount_amount": 10
                }
            ]
        }
    ]
}
```


### Body Params

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| `amortization_type`* | string | Amortization type | **[Amortization Type Enumerators](#amortization-type-enumerators)** |
| `reference_date`* | string | Reference date for present value calculation (must be D+1) | 10 |
| `discount_percentage` | float | Discount percentage on the present value ((1 - percentage) * Present Value) | 10 |
| `discount_amount` | float | Discount amount applied to the present value | 10 |
| `operations`* | array | List of operations to be renegotiated | **[Operations Object](#operations-object)** |

### Operations Object

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| `debt_key`* | string | Unique key of the credit operation (DEBT-KEY) | UUID |
| `installments`* | array | Installments to be renegotiated | **[Installments Object](#installments-object)** |

### Installments Object

| Field | Type | Description | Max. Char. |
|---|---|---|---|
| `installment_key`* | string | Key of the installment to be renegotiated | UUID |
| `paid_amount` | float | Amount paid (or allocated) on the installment, in BRL (R$). Required when `amortization_type` is **`present_amount`**. | 15,2 |
| `discount_amount` | float | Discount amount in BRL (R$) on the installment. Required when `amortization_type` is **`present_amount`** (use `0` if there is no discount). Optional for other types. | 15,2 |

### Amortization Type Enumerators

| Field | Description |
|---|---|
| **present_amount** | Simulation with present value per installment. In each `installments[]`, `installment_key`, **`paid_amount`** and **`discount_amount`** are required. |
| **installment_payment** | Renegotiation for payment of specific installments sent in the payload. Requires the `installment_key` of each installment. |
| **overdue_installment_payment** | Renegotiation targeted at overdue installment payment. Requires the `installment_key` of each installment. |

## Response

STATUS 200

Response Body

```json
{
    "batch_proposal_key": "7423c701-3578-4733-8f30-81ab60afdb6d",
    "discount_percentage": 0,
    "discount_amount": 0,
    "amortization_type": "present_amount",
    "payment_amount": 517.88,
    "requester_name": "Dante Ltda",
    "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
    "issuer_name": "Dante Ferrarini",
    "reference_date": "2026-04-08",
    "issuer_document_number": "31057466093",
    "operations": [
        {
            "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
            "contract_number": "DWF1761222116",
            "payment_amount": 517.88,
            "discount_amount": 0,
            "origin_key": null,
            "affected_installments": [
                {
                    "installment_key": "1dea396f-beb1-4df3-9822-35800b4c095a",
                    "due_date": "2026-05-07",
                    "principal_amount": 491.4903841,
                    "interest_amount": 52.3996159,
                    "fine_amount": 0,
                    "total_amount": 543.89,
                    "present_amount": 517.88,
                    "paid_amount": 517.88,
                    "principal_amortization_payment_amount": 491.49,
                    "prefixed_interest_payment_amount": 26.39,
                    "fine_payment_amount": 0,
                    "discount_amount": 0
                }
            ],
            "remaining_installments": [
                {
                    "installment_key": "370e73d1-55d8-431e-9b22-d08fb8297999",
                    "due_date": "2026-06-07",
                    "principal_amount": 516.1296159,
                    "interest_amount": 27.7603841,
                    "fine_amount": 0,
                    "total_amount": 543.89
                }
            ],
            "debt_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c"
        }
    ]
}
```


### Discount Fields

Percentage discount

```json
{
    "discount_percentage": 0.5
}
```


Absolute discount

```json
{
    "discount_amount": 200
}
```

---

# Webhooks - BNPL Batch Renegotiation

URL: /en/documentation/manual_bnpl_full/renegociacao/webhooks

## Overview

After creating a batch renegotiation proposal, the system will send webhooks to notify about the payment or rejection of the proposal.

:::danger Attention!
Webhooks should not be strictly mapped. New fields may be added to the payload without prior notice.
:::

## Payment Webhook

This webhook is sent when payment for the batch renegotiation proposal is confirmed.

WEBHOOK_TYPE renegotiation.batch_proposal
STATUS paid

Webhook Body

```json
{
    "webhook_type": "renegotiation.batch_proposal",
    "key": "<BATCH-PROPOSAL-KEY>",
    "event_datetime": "<DATA E HORA DO ENVIO DO WEBHOOK>",
    "status": "paid",
    "data": {
        "paid_method_type": "<METODO DE PAGAMENTO>",
        "paid_in": {
            "code_number": "<CODIGO DO BANCO LIQUIDANTE>",
            "ispb": "<ISPB DO BANCO LIQUIDANTE>",
            "name": "<NOME DO BANCO LIQUIDANTE>"
        }
    }
}
```

### Payment Webhook Fields

| Field | Type | Description |
|---|---|---|
| **webhook_type** | string | Webhook type: `renegotiation.batch_proposal` |
| **key** | string | Batch renegotiation proposal key (BATCH-PROPOSAL-KEY) |
| **event_datetime** | string | Date and time when the webhook was sent |
| **status** | string | Event status: `paid` |
| **data.paid_method_type** | string | Payment method used |
| **data.paid_in.code_number** | string | Settling bank code |
| **data.paid_in.ispb** | string | Settling bank ISPB |
| **data.paid_in.name** | string | Settling bank name |

### paid_method_type Enumerators

| Enumerator | Description |
|---|---|
| **bank_slip** | Payment made via bank slip |
| **pix** | Payment made via Pix |

---

## Rejection Webhook

A batch renegotiation may be rejected due to payment deadline expiration or an installment payment made outside of the renegotiation.

WEBHOOK_TYPE renegotiation.batch_proposal
STATUS rejected

Webhook Body

```json
{
    "webhook_type": "renegotiation.batch_proposal",
    "key": "<BATCH-PROPOSAL-KEY>",
    "event_datetime": "<DATA E HORA DO ENVIO DO WEBHOOK>",
    "status": "rejected",
    "data": {}
}
```

:::caution Attention
A batch renegotiation may be rejected due to:
- **Deadline expiration**: payment was not made by the due date (`proposal_due_date`)
- **External payment**: an installment included in the renegotiation was paid outside of the batch before payment confirmation
:::

---

## Installment Payment Data

When an installment is paid through a batch renegotiation, the payment data is recorded in the installment:

Payment Data

```json
{
    "batch_renegotiation_proposal_key": "f9addba2-ec91-41bf-a150-c59eb1c3fbef",
    "paid_in": {
        "ispb": "18236120",
        "name": "NU PAGAMENTOS - IP",
        "code_number": 260
    },
    "resource_account_key": "ea44b9f2-ad00-4896-b8a3-b1a3da28a72f"
}
```

### Payment Data Fields

| Field | Type | Description |
|---|---|---|
| **batch_renegotiation_proposal_key** | string | Batch renegotiation proposal key that originated the payment |
| **paid_in.ispb** | string | ISPB of the bank used for payment |
| **paid_in.name** | string | Name of the bank used for payment |
| **paid_in.code_number** | integer | Code of the bank used for payment |
| **resource_account_key** | string | Key of the resource account that received the payment |

---

# Integration Scripts - BNPL Full

URL: /en/documentation/manual_bnpl_full/scripts_integracao

## Summary

We provide ready-to-use Python scripts that demonstrate the complete BNPL Full integration flow with the QI Tech Sandbox API. Each script corresponds to a tested and validated API call.

**All payloads and responses shown in this documentation reflect the actual Sandbox API responses obtained through these scripts.**

## Download

The scripts are available in the project repository:

📦 Download complete Python package

## Prerequisites

- Python 3.8+
- Dependencies: `requests`, `python-jose`, `python-dotenv`
- A `_local.env` file with your Sandbox credentials:
  - `API_KEY` - Your API client key
  - `QI_PUBLIC_KEY` - QI Tech public key
  - `CLIENT_PRIVATE_KEY` - Your EC private key (PEM)

## Available Scripts

### Issuance

| # | Script | Endpoint | Method | Description |
|---|--------|----------|--------|-------------|
| 01 | `01_issuance_simulation.py` | `/v2/credit_operation/simulation` | POST | Simulate a credit operation before issuance |
| 02 | `02_issuance_issuance.py` | `/signed_debt` | POST | Issue the debt with opt-in contract signature |
| 03 | `03_issuance_query.py` | `/v2/credit_operation/requester_identifier_key/{key}` | GET | Query the issued operation |

### Reversal

| # | Script | Endpoint | Method | Description |
|---|--------|----------|--------|-------------|
| 04 | `04_reversal_cancel_before_disbursement.py` | `/debt/{debt_key}/cancel` | PATCH | Cancel an operation before disbursement |
| 05 | `05_reversal_cancel_after_disbursement.py` | `/debt/reversal` | POST | Reverse an operation after disbursement (generates Pix refund) |

### Renegotiation

| # | Script | Endpoint | Method | Description |
|---|--------|----------|--------|-------------|
| 06 | `06_renegotiation_simulation.py` | `/renegotiation/batch_proposal_simulation` | POST | Simulate a batch renegotiation |
| 07 | `07_renegotiation_proposal.py` | `/renegotiation/batch_proposal` | POST | Create a batch renegotiation proposal |
| 08 | `08_renegotiation_query.py` | `/renegotiation/batch_proposal/{key}` | GET | Query a batch proposal by key |
| 09 | `09_renegotiation_list.py` | `/renegotiation/batch_proposal` | GET | List all batch proposals |
| 10 | `10_renegotiation_cancel.py` | `/renegotiation/batch_proposal/{key}` | DELETE | Cancel a pending batch proposal |

### Refinancing

| # | Script | Endpoint | Method | Description |
|---|--------|----------|--------|-------------|
| 11 | `11_refinancing_present_value.py` | `/debt` | GET | Query present value for refinancing calculation |
| 12 | `12_refinancing_simulation.py` | `/debt_simulation` | POST | Simulate a refinancing operation |
| 13 | `13_refinancing_issuance.py` | `/signed_debt` | POST | Create a refinancing (issues new debt, settles the previous one) |

## How to Use

1. Download the scripts from the repository
2. Create a `_local.env` file with your Sandbox credentials
3. Run the scripts in numerical order
4. Update keys (`DEBT_KEY`, `BATCH_PROPOSAL_KEY`, etc.) between scripts as needed

:::info About the documentation examples
Each script includes the actual API response as a comment block at the end of the file. These examples are the source of truth for the payloads displayed on the pages of this documentation.
:::

---

# Payroll Card Manual - Tracking

URL: /en/documentation/manual_cartao_beneficio/manual_cartao_beneficio_acompanhamento

:::info Navigation
- [Issuance](/documentation/manual_cartao_beneficio/manual_cartao_beneficio_emissao) (previous)
- [Webhooks](/documentation/manual_cartao_beneficio/manual_cartao_beneficio_webhook) (next)
:::

:::caution API under development
The API is still in development phase, therefore, this manual is subject to changes.
:::

---

## 1. Payroll card reservation query

Queries the details of a specific reservation through its key (`payroll_card_reservation_key`) or the request key (`request_control_key`). Returns a **single object** containing the reservation details.

**GET**
/payroll_card_reservation/social_security/[PAYROLL-CARD-RESERVATION-KEY]
**GET**
/payroll_card_reservation/social_security/request_control_key/[REQUEST-CONTROL-KEY]

#### Query Params

**Query Params**

| Field       | Type    | Description                                                                 |
|-------------|---------|---------------------------------------------------------------------------|
| retrieve_document_urls | bool  | Whether certain document URLs should be returned. Set to False by default. |

:::warning retrieve_document_urls Parameter

Enabling this parameter may cause request latencies. Use only when necessary.

Currently, only the `benefit.policy_document_url` field is impacted by this parameter, but other url fields (such as `attached_documents.document_url` and `attached_documents.signature_url`) will be updated to depend on this parameter.

The impacted fields (both currently and in the future) are marked with (*).

:::

### Response

**Response Body**

```json
{
  "request_control_key": "550e8400-e29b-41d4-a716-446655440000",
  "payroll_card_reservation_key": "3571e292-3a83-4011-904d-20ee963022ef",
  "payroll_card_reservation_status": "pending_document_generation",
  "card_holder_document_number": "12345678901",
  "identifier_number": "1234567890",
  "total_limit_amount": 8000.00,
  "reservation_amount": 250.00,
  "reservation_contract_number": "PCR0123456789",
  "wallet_key": null,
  "payroll_card_type": "social_security_payroll_card",
  "signature_url": "https://sandbox.sign.qitech.com.br/s/teste",
  "signature_data": {
      "document_similarity_score": 1,
      "similarity_score": 0.75,
      "biometry_analysis_reference": "internal",
  },
  "withdrawal": {
    "withdrawal_key": "b2c3d4e5-f6g7-8901-bcde-f23456789012",
    "withdrawal_amount": 5600.00,
    "withdrawal_status": "waiting_signature",
    "contract_number": "PCR12345678",
    "disbursement_date": "2025-08-08",
    "withdrawal_data": {
      "disbursement_options": [
        {
          "disbursement_date": "2025-08-08",
          "cet": 0.0262,
          "annual_cet": 0.3643,
          "issue_amount": 5827.36,
          "prefixed_interest_rate": {
            "daily_rate": 0.0008104046,
            "interest_base": "calendar_days",
            "monthly_rate": 0.0246,
            "annual_rate": 0.3386043084
          },
          "installments": [
            {
              "total_amount": 152.5,
              "due_date": "2025-10-10",
              "installment_number": 1
            },
            {
              "total_amount": 152.5,
              "due_date": "2025-11-10",
              "installment_number": 2
            },
            {
              "total_amount": 152.5,
              "due_date": "2025-12-10",
              "installment_number": 3
            }
          ]
        }
      ]
    }
  },
  "payroll_card": {
    "payroll_card_key": "c3d4e5f6-g7h8-9012-cdef-345678901234",
    "payroll_card_status": "pending_issuance",
    "card_limit": 2400.00,
    "card_issuance_entry_amount": 17.28
  },
  "attached_documents": [
    {
      "document_key": "d4e5f6g7-h8i9-0123-defg-456789012345",
      "document_batch_key": "e5f6g7h8-i9j0-1234-efgh-567890123456",
      "document_type": "withdrawal_operation_term",
      "document_certifier": "qi_sign",
      "document_status": "pending_generation",
      "document_url": null,
      "signature_url": null,
    },
    {
      "document_key": "f6g7h8i9-j0k1-2345-fghi-678901234567",
      "document_batch_key": "e5f6g7h8-i9j0-1234-efgh-567890123456",
      "document_type": "payroll_card_term",
      "document_certifier": "qi_sign",
      "document_status": "pending_generation",
      "document_url": null,
      "signature_url": null,
    },
    {
      "document_key": "925c0a62-ef98-4891-909b-9955a87ccefb",
      "document_batch_key": "e5f6g7h8-i9j0-1234-efgh-567890123456",
      "document_type": "payroll_card_consent_term",
      "document_certifier": "qi_sign",
      "document_status": "pending_generation",
      "document_url": null,
      "signature_url": null,
    }
  ],
  "benefit": {
    "benefit_key": "0b80d313-2ade-4a28-be58-38b9219c2b8c",
    "card_insurance_key": "0151934c-b219-458f-98a3-8b0f85c70307",
    "status": "active",
    "due_date": "2036-02-18",
    "policy_document_key": "6363eb63-2e85-4786-bc03-8c1ddd8e2be2",
    "policy_document_url": "https://example.com/policy.pdf"
  }
}
```

**Response Body Details**

| Field | Type | Description |
|---|---|---| 
| request_control_key | string | Request identification key | 
| payroll_card_reservation_key | string | Payroll card reservation key | 
| payroll_card_reservation_status | string | Payroll card reservation status | 
| card_holder_document_number | string | Card holder's CPF | 
| identifier_number | string | Operation identifier number | 
| reservation_amount | number | Payroll card reservation amount |
| reservation_contract_number | string | Dataprev annotation contract number | 
| withdrawal | object | Withdrawal data | 
| payroll_card | object | Payroll card data | 
| attached_documents | array | List of attached documents | 
| payroll_card_type | string | Card type (`social_security_benefit_card` or `social_security_payroll_card`) | 
| wallet_key | string | Unique wallet key created (UUID4) | 
| signature_url | string | Reservation contract signature URL (Only present in payload after signature link generation) | 
| signature_data | object | Biometric data collected during signature (Only present in payload after document signature) | 
| benefit | object | Insurance/benefit data associated with the card (Only present in payload after card issuance) | 

#### Payload withdrawal

| Field | Type | Description | 
|---|---|---| 
| withdrawal_key | string | Unique withdrawal key | 
| contract_number | string | Withdrawal CCB contract number | 
| withdrawal_amount | number | Calculated disbursement amount for withdrawal CCB | 
| disbursement_date | date | Operation disbursement date | 
| withdrawal_status | string | Withdrawal status | 
| withdrawal_data | object | Detailed withdrawal data |

#### Payload withdrawal_data

| Field | Type | Description |
|---|---|---| 
| prefixed_interest_rate | object | Prefixed interest rate | 
| disbursement_options | array | Available disbursement options | 

#### Payload prefixed_interest_rate

| Field | Type | Description | 
|---|---|---| 
| daily_rate | number | Daily rate | 
| interest_base | string | Interest calculation base | 
| monthly_rate | number | Monthly rate | 
| annual_rate | number | Annual rate | 

#### Payload disbursement_options

| Field | Type | Description | 
|---|---|---| 
| disbursement_date | string | Disbursement date | 
| cet | number | Monthly Total Effective Cost | 
| annual_cet | number | Annual Total Effective Cost | 
| total_iof | number | Total IOF amount |  
| disbursed_issue_amount | number | Disbursement amount |  
| issue_amount | number | Issue amount |  
| installments | array | List of installments | 

#### Payload installments

| Field | Type | Description | 
|---|---|---| 
| total_amount | number | Total installment amount | 
| due_date | string | Due date | 
| installment_number | number | Installment number | 

#### Payload payroll_card

| Field | Type | Description | 
|---|---|---| 
| payroll_card_key | string | Unique payroll card key | 
| payroll_card_status | string | Payroll card status | 
| card_limit | number | Total calculated card limit | 
| card_issuance_entry_amount | number | Card issuance fee amount | 

#### Payload attached_documents

| Field | Type | Description | 
|---|---|---| 
| document_key | string | Unique document key | 
| document_batch_key | string | Document batch key | 
| document_type | string | Document type | 
| document_certifier | string | Document certifier | 
| document_status | string | Document status | 
| document_url (*) | string | Document URL | 
| signature_url (*) | string | Signature URL | 

---

#### Payload signature_data

| Field | Type | Description | 
|---|---|---| 
| document_similarity_score | number | Biometric similarity score between the signer and the submitted document (0-1) |
| similarity_score | number | Biometric similarity score between the signer and the reference found in the face database (0-1) |
| biometry_analysis_reference | string | Origin database of the face used to calculate the biometric similarity score |

---

#### Payload benefit

| Field | Type | Description | 
|---|---|---| 
| benefit_key | string | Unique benefit key (UUID) | 
| status | string | Insurance issuance status (`created`, `pending_emission`, `active`, `canceled` or `inactive`)  |
| policy_document_key | string | Unique policy document key (UUID) |
| policy_document_url (*) | string | Insurance policy document URL |

---

## 2. Payroll card reservation query by CPF

Queries the active reservations of a given CPF. Returns a **list of objects** within the `payroll_card_reservations` property.

**GET**
/payroll_card_reservation/social_security/card_holder_document_number/[CARD-HOLDER-DOCUMENT-NUMBER]

### Response

**Response Body**

```json
{
   "payroll_card_reservations": [
      {
        "request_control_key": "d3bc353e-d612-4029-9d77-4dca9171c3b5",
        "payroll_card_reservation_key": "5fb9d810-be74-4d26-959d-c75d10834e93",
        "payroll_card_reservation_status": "card_issued",
        "card_holder_document_number": "12345678901",
        "identifier_number": "1234567890",
        "total_limit_amount": 8000.00,
        "reservation_amount": 250.00,
        "reservation_contract_number": "PCR0123456789",
        "wallet_key": "298e4d37-0f20-4aed-ad66-016f8487afba",
        "payroll_card_type": "social_security_payroll_card",
        "card_holder": {
          "email": "joao.teste@example.com",
          "phone": {
            "number": "352141677",
            "area_code": "11",
            "country_code": "055"
          },
          "address": {
            "city": "Belo Horizonte",
            "state": "MG",
            "number": "7889",
            "street": "Rua Santos",
            "complement": "Apto 243",
            "postal_code": "30112000",
            "neighborhood": "Centro"
          }
        },
        "attached_documents": [
          {
              "document_key": "910e8de5-16af-4bc5-8ee1-4a0652ca0cbf",
              "document_type": "withdrawal_operation_term",
              "document_certifier": "qi_sign",
              "document_status": "signed",
              "document_batch_key": "f28bf87a-11cd-4d89-89c0-19229a1b31a7",
              "document_url": "https://storage.googleapis.com/example_document.pdf",
              "signature_url": "https://storage.googleapis.com/example_document_signed.pdf",
          },
          {
              "document_key": "332017f4-a0d6-463a-8557-e925a9485251",
              "document_type": "payroll_card_term",
              "document_certifier": "qi_sign",
              "document_status": "signed",
              "document_batch_key": "f28bf87a-11cd-4d89-89c0-19229a1b31a7",
              "document_url": "https://storage.googleapis.com/example_document.pdf",
              "signature_url": "https://storage.googleapis.com/example_document_signed.pdf",
          },
          {
              "document_key": "b098074a-7cba-4b67-81e1-8d587185504b",
              "document_type": "payroll_card_consent_term",
              "document_certifier": "qi_sign",
              "document_status": "signed",
              "document_batch_key": "f28bf87a-11cd-4d89-89c0-19229a1b31a7",
              "document_url": "https://storage.googleapis.com/example_document.pdf",
              "signature_url": "https://storage.googleapis.com/example_document_signed.pdf",
          },
          {
              "document_key": "b1c3e915-6707-49f5-85a9-398ef997fdad",
              "document_type": "selfie",
              "document_certifier": "qi_sign",
              "document_status": "generated",
              "document_url": "https://storage.googleapis.com/selfie.jpeg"
          },
          {
              "document_key": "5769a335-a2ac-4913-a742-38b9d1e4abd2",
              "document_type": "document_identification",
              "document_certifier": "qi_sign",
              "document_status": "generated",
              "document_url": "https://storage.googleapis.com/cnh.jpeg"
          },
          {
              "document_key": "75577d34-4ebd-4488-aca8-b064e603c973",
              "document_type": "document_identification_back",
              "document_certifier": "qi_sign",
              "document_status": "generated",
              "document_url": "https://storage.googleapis.com/cnh_back.jpeg"
          },
          {
              "document_key": "2fc216c6-5d1c-4713-b70b-6e1f75f8bb17",
              "document_type": "payroll_card_confirmation_video",
              "document_certifier": "electronic_client_side",
              "document_status": "generated",
              "document_url": "https://storage.googleapis.com/video.mp4"
          }
        ],
      },
      {
        "request_control_key": "d3bc353e-d612-4029-9d77-4dca9171c3b5",
        "payroll_card_reservation_key": "5fb9d810-be74-4d26-959d-c75d10834e93",
        "payroll_card_reservation_status": "pending_withdrawal_disbursement",
        "card_holder_document_number": "12345678901",
        "identifier_number": "1234567890",
        "total_limit_amount": 8000.00,
        "reservation_amount": 250.00,
        "reservation_contract_number": "PCR0123456789",
        "wallet_key": "298e4d37-0f20-4aed-ad66-016f8487afba",
        "payroll_card_type": "social_security_payroll_card",
        "card_holder": {
          "email": "joao.teste@example.com",
          "phone": {
            "number": "352141677",
            "area_code": "11",
            "country_code": "055"
          },
          "address": {
            "city": "Belo Horizonte",
            "state": "MG",
            "number": "7889",
            "street": "Rua Santos",
            "complement": "Apto 243",
            "postal_code": "30112000",
            "neighborhood": "Centro"
          }
        },
        "attached_documents": [
          {
              "document_key": "910e8de5-16af-4bc5-8ee1-4a0652ca0cbf",
              "document_type": "withdrawal_operation_term",
              "document_certifier": "qi_sign",
              "document_status": "signed",
              "document_batch_key": "f28bf87a-11cd-4d89-89c0-19229a1b31a7",
              "document_url": "https://storage.googleapis.com/example_document.pdf",
              "signature_url": "https://storage.googleapis.com/example_document_signed.pdf",
          },
          {
              "document_key": "332017f4-a0d6-463a-8557-e925a9485251",
              "document_type": "payroll_card_term",
              "document_certifier": "qi_sign",
              "document_status": "signed",
              "document_batch_key": "f28bf87a-11cd-4d89-89c0-19229a1b31a7",
              "document_url": "https://storage.googleapis.com/example_document.pdf",
              "signature_url": "https://storage.googleapis.com/example_document_signed.pdf",
          },
          {
              "document_key": "87c23417-c342-4cc7-81b6-81185b6012ce",
              "document_type": "payroll_card_consent_term",
              "document_certifier": "qi_sign",
              "document_status": "signed",
              "document_batch_key": "f28bf87a-11cd-4d89-89c0-19229a1b31a7",
              "document_url": "https://storage.googleapis.com/example_document.pdf",
              "signature_url": "https://storage.googleapis.com/example_document_signed.pdf",
          },
          {
              "document_key": "b1c3e915-6707-49f5-85a9-398ef997fdad",
              "document_type": "selfie",
              "document_certifier": "qi_sign",
              "document_status": "generated",
              "document_url": "https://storage.googleapis.com/selfie.jpeg"
          },
          {
              "document_key": "5769a335-a2ac-4913-a742-38b9d1e4abd2",
              "document_type": "document_identification",
              "document_certifier": "qi_sign",
              "document_status": "generated",
              "document_url": "https://storage.googleapis.com/cnh.jpeg"
          },
          {
              "document_key": "75577d34-4ebd-4488-aca8-b064e603c973",
              "document_type": "document_identification_back",
              "document_certifier": "qi_sign",
              "document_status": "generated",
              "document_url": "https://storage.googleapis.com/cnh_back.jpeg"
          },
          {
              "document_key": "b574b555-e3c9-402a-a869-c4bc27751be8",
              "document_type": "payroll_card_confirmation_video",
              "document_certifier": "electronic_client_side",
              "document_status": "generated",
              "document_url": "https://storage.googleapis.com/video.mp4"
          }
        ],
      }
   ]
}
```

---

## 3. Status Machines

### Payroll Card Reservation

The **Payroll Card Reservation** entity has the following statuses and transitions:

```mermaid
stateDiagram-v2
    [*] --> pending_document_generation
    pending_document_generation --> pending_signature : Documents generated
    pending_signature --> pending_onboarding : Documents signed
    pending_onboarding --> pending_collateral_reservation : Onboarding approved
    pending_onboarding --> canceled : Onboarding/KYC failure
    pending_collateral_reservation --> pending_additional_documents_submission : Collateral reserved
    pending_additional_documents_submission --> pending_additional_documents_validation : Additional documents received
    pending_additional_documents_validation --> pending_withdrawal_disbursement : Additional documents approved
    pending_additional_documents_validation -->  pending_additional_documents_submission: Additional documents rejected
    pending_withdrawal_disbursement --> pending_card_issuance : Disbursement completed
    pending_card_issuance --> card_issued : Card created
    canceled 
    card_issued --> [*]
```

#### Status Descriptions

| Status | Description |
|--------|-----------|
| `pending_document_generation` | Waiting for document generation for signature |
| `pending_onboarding` | Waiting for onboarding and KYC process |
| `pending_collateral_reservation` | Waiting for collateral reservation |
| `pending_additional_documents_submission` | Margin annotated. Waiting for confirmation video submission |
| `pending_additional_documents_validation` | Waiting for confirmation video validation |
| `pending_withdrawal_disbursement` | Waiting for withdrawal operation disbursement |
| `pending_card_issuance` | Waiting for wallet creation and card issuance |
| `card_issued` | Card created and active |
| `canceled` | Operation canceled |

### Withdrawal

The **Withdrawal** entity has the following statuses and transitions:

```mermaid
stateDiagram-v2
    [*] --> pending_signature
    pending_signature --> pending_disbursement : Documents signed
    pending_disbursement --> opened : Disbursement completed
    opened --> [*]
```

#### Status Descriptions

| Status | Description |
|--------|-----------|
| `pending_signature` | Waiting for terms signature |
| `pending_disbursement` | Waiting for withdrawal operation disbursement |
| `opened` | Disbursement completed and operation active |
| `canceled` | Operation canceled |

### Benefit

The **Benefit** entity has the following statuses and transitions:

```mermaid
stateDiagram-v2
    [*] --> created
    created --> pending_emission : Waiting for insurance issuance
    pending_emission --> active : Insurance issued
    active --> canceled : Insurance canceled
    active --> inactive : Insurance expired
```

#### Status Descriptions

| Status | Description |
|--------|-----------|
| `created` | Insurance in processing |
| `pending_emission` | Waiting for insurance issuance |
| `active` | Insurance issued and active |
| `canceled` | Insurance canceled |
| `inactive` | Insurance expired or inactive |

---

## 4. Reservation cancellation

Allows the cancellation of the payroll card reservation.

:::warning Restrictions
API cancellation is only allowed **before** withdrawal disbursement (Status: `pending_withdrawal_disbursement` or earlier).
If the withdrawal has already been completed or the card has already been issued, cancellation must be handled via support, as it involves financial reversal.
:::

**PATCH**
/payroll_card_reservation/social_security/[PAYROLL-CARD-RESERVATION-KEY]/cancel

### Response

STATUS
**200** (OK)

The request was processed successfully. No content returned (Empty body).

```json
// Empty response body
```

---

# Documents and Signature

URL: /en/documentation/manual_cartao_beneficio/manual_cartao_beneficio_documentos

:::info Navigation
- [Webhooks](/documentation/manual_cartao_beneficio/manual_cartao_beneficio_webhook) (previous)
- [Address Management](/documentation/manual_cartao_beneficio/manual_cartao_beneficio_endereco) (next)
:::

This section details the document generation flow and the electronic signature process, either via external flow or via Qi Sign.

:::info Note
If the client is integrated with the QISign signature flow, the items in this section are optional.
:::

## 1. Documents Webhook

After creating the operation, documents (`payroll_card_term`, `withdrawal_operation_term` and `payroll_card_consent_term`) are generated asynchronously. The API sends a webhook for each document notifying the document status change.

:::caution Attention
If the client does not use QISign, the client must implement handling of this webhook to capture the document URLs and direct the beneficiary to sign through the chosen external certification provider.
:::

:::info Tracking via Webhook
To check the complete structure of the payloads, event scenarios and implement URL capture, consult the **[Documents Webhook (Generation and Validation)](./manual_cartao_beneficio_webhook.md#2-webhook-de-documentos-geração-e-validação)** section in the Webhooks Manual.
:::

## 2. External document signature

This endpoint is used when signature and biometrics collection is done by the client's interface (Client Side) or external partner. The client must send the signed documents and biometric data for validation.

:::caution Attention
This step should only be called if the signature flow is **not** Qi Sign. If using Qi Sign, confirmation will be automatic.
:::

:::tip Before sending
Upload the 5 mandatory documents (selfie, front/back of ID, card contract and withdrawal contract) using the Document Upload endpoint to obtain the `document_key`s.
:::

### Request

**POST**
/payroll_card_reservation/social_security/{payroll_card_reservation_key}/signature

**Request Body**

```json
{
  "documents": [
    { "document_type": "selfie", "document_key": "2c8f2b3d-8c7a-4e3b-9f6a-1234567890ab" },
    { "document_type": "document_identification", "document_key": "b1a2c3d4-e5f6-7890-abcd-ef0123456789" },
    { "document_type": "document_identification_back", "document_key": "0a1b2c3d-4e5f-6789-0abc-def123456789" },
    { "document_type": "payroll_card_term", "document_key": "9f8e7d6c-5b4a-3210-fedc-ba9876543210" }, 
    { "document_type": "payroll_card_consent_term", "document_key": "d9b64eae-6e11-4b82-92f0-a0e1a3049eee" }, 
    { "document_type": "withdrawal_operation_term", "document_key": "a05c74eb-542a-4820-8954-eef92ebb383f" }
  ],
  "ip_address": "192.168.1.100",
  "signature_datetime": "2025-01-15T14:30:00Z",
  "similarity_score": 0.95,
  "biometry_analysis_reference": "serpro"
}
```

**Request Body Details**

| Field | Type | Description | Required |
|---|---|---|---|
| documents | array | List of the 5 required documents | Yes |
| biometry_analysis_reference | string | Biometric analysis reference | Yes |
| signature_datetime | string | Signature date and time (ISO 8601) | Yes |
| ip_address | string | IP address from where the signature was made | Yes |
| similarity_score | float | Biometric similarity score | Yes |

#### _Biometry Analysis Reference_ Enumerators

| Enumerator    | Description                                                                                                                                                                                                                                                          |
|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| serpro    | Used when the similarity_score is returned through a query performed on the Detran photo document database (Service provided through Serpro)                                                                                                      |
| tse       | Used when the similarity_score is returned through a query performed on the TSE photo document database                                                                                                                                              |
| not_found | Should be informed when facial biometry is not found in any of the previous government databases (serpro or tse). In this case the similarity_score should be null or the degree of similarity of the selfie with the official photo document, returned by the partner. |

#### documents Item

| Field | Type | Description | Format | Required |
|---|---|---|---|---|
| document_type | string | Document type | Enum: "selfie", "document_identification", "document_identification_back", "payroll_card_term", "payroll_card_consent_term", "withdrawal_operation_term" | Yes |
| document_key | string | Unique document key | UUID v4 | Yes |

**Notes about document types:**
- `selfie`: Beneficiary photo
- `document_identification`: Front of identification document
- `document_identification_back`: Back of identification document  
- `payroll_card_term`: **Signed** card terms and conditions
- `payroll_card_consent_term`: **Signed** card contracting consent term
- `withdrawal_operation_term`: **Signed** withdrawal operation term

:::danger QI Sign
QI Tech offers the signature service that meets the requirements determined by IN 138. With facial biometrics and document sending.

To receive a quote, contact our commercial team:

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

### Response

STATUS
**200** (OK)

**Response Body**

```json
{
  "payroll_card_reservation_key": "d4e5f6g7-h8i9-0123-defg-456789012345",
  "payroll_card_reservation_status": "pending_onboarding",
  "attached_documents": [
    {
      "document_key": "0b6c9bb9-0bc1-4fd2-9aab-3ccf5c8bc69d",
      "document_type": "withdrawal_operation_term",
      "document_certifier": "electronic_client_side",
      "document_url": "https://storage.googleapis.com/live-doc-api/documents/withdrawal_operation_term.pdf",
      "document_status": "signed",
      "document_batch_key": "ccc42bc6-efbc-4e8f-a7da-fb6cb77e4146",
      "signature_url": "https://storage.googleapis.com/live-doc-api/documents/withdrawal_operation_term_signed.pdf",
    },
    {
      "document_key": "f974bb60-ff4c-4027-9d88-399470586691",
      "document_type": "payroll_card_term",
      "document_certifier": "electronic_client_side",
      "document_url": "https://storage.googleapis.com/live-doc-api/documents/payroll_card_term.pdf",
      "document_status": "signed",
      "document_batch_key": "ccc42bc6-efbc-4e8f-a7da-fb6cb77e4146",
      "signature_url": "https://storage.googleapis.com/live-doc-api/documents/payroll_card_term_signed.pdf",
    },
    {
      "document_key": "0133eda8-0e82-41d9-ae8d-7020f023b0f9",
      "document_type": "payroll_card_consent_term",
      "document_certifier": "electronic_client_side",
      "document_url": "https://storage.googleapis.com/live-doc-api/documents/payroll_card_consent_term.pdf",
      "document_status": "signed",
      "document_batch_key": "ccc42bc6-efbc-4e8f-a7da-fb6cb77e4146",
      "signature_url": "https://storage.googleapis.com/live-doc-api/documents/payroll_card_consent_term.pdf",
    },
    {
      "document_key": "2c8f2b3d-8c7a-4e3b-9f6a-1234567890ab",
      "document_type": "selfie",
      "document_certifier": "electronic_client_side",
      "document_url": "https://storage.googleapis.com/live-doc-api/documents/selfie.pdf",
      "document_status": "generated"
    },
    {
      "document_key": "b1a2c3d4-e5f6-7890-abcd-ef0123456789",
      "document_type": "document_identification",
      "document_certifier": "electronic_client_side",
      "document_url": "https://storage.googleapis.com/live-doc-api/documents/document_identification.pdf",
      "document_status": "generated"
    },
    {
      "document_key": "0a1b2c3d-4e5f-6789-0abc-def123456789",
      "document_type": "document_identification_back",
      "document_certifier": "electronic_client_side",
      "document_url": "https://storage.googleapis.com/live-doc-api/documents/document_identification_back.pdf",
      "document_status": "generated"
    }
  ]
}
```

**Response Body Details**

| Field | Type | Description |
|---|---|---|
| payroll_card_reservation_key | string | Payroll card reservation key |
| payroll_card_reservation_status | string | Reservation status (pending_onboarding) |
| attached_documents | array | List of documents and their status |

:::info Information
After confirming the signature of both documents, the payroll card status will change to "pending_onboarding", indicating that the operation is awaiting the card onboarding process.
:::

#### Common Errors

**404 - Document Not Found**

```json
{
  "title": "Document Not Found",
  "description": "Document selfie not found",
  "translation": "Documento selfie não encontrado"
}
```

**Explanation:** This error occurs when the `document_key` informed in the request was not found in the system. Check if the `document_key` was correctly obtained through the Document Upload endpoint

---

## 3. Signature Confirmation

Regardless of the signature method (External or Qi Sign), when the process is successfully completed, you will receive a webhook for reservation status change.

Consult the **Status Change Webhooks** section in the [Main Flow Manual](./manual_cartao_beneficio_emissao.md) to see the payload example with status `pending_onboarding`.

---

# Manual Cartão Consignado - Criação

URL: /en/documentation/manual_cartao_beneficio/manual_cartao_beneficio_emissao

:::info Navegação
- [Acompanhamento](/documentation/manual_cartao_beneficio/manual_cartao_beneficio_acompanhamento) (próximo)
:::

:::caution API em desenvolvimento
A API ainda está em fase de desenvolvimento, sendo assim, este manual esta sujeito a alterações.
:::

---

:::info **Consultas de Benefícios**
Para consulta de dados do benefício e consulta da lista de benefícios, visite os seguintes itens na documentação do INSS:

- [Consulta da lista de benefícios](/documentation/manual_inss/manual_credito_novo/#1---consulta-da-lista-de-benefícios-com-formalização-do-termo-de-autorização-realizada-através-do-parceiro)
- [Consulta de dados do benefício](/documentation/manual_inss/manual_credito_novo/#2---consulta-de-dados-do-benefício)
:::

## 1. Consulta de elegibilidade do beneficiário

A consulta de elegibilidade permite verificar se um CPF está elegível para o cartão consignado/benefício do INSS. Esta operação é síncrona e retorna imediatamente o resultado da verificação.

Em posse dos dados de **CPF** e **data de nascimento**, é possível consultar a elegibilidade do beneficiário. Atualmente, a única validação de elegibilidade realizada é se a idade do beneficiário está entre 18 e 65 anos.

### Request

**GET**
/payroll_card_reservation/social_security/eligibility

**Params**

| Campo             | Tipo   | Descrição                    | Obrigatório | Formatação |
|-------------------|--------|------------------------------|-------------|------------|
| document_number | string | Número de CPF do beneficiário | Sim         | 11 dígitos numéricos |
| birth_date     | date   | Data de nascimento           | Sim         | YYYY-MM-DD |

### Response

STATUS
**200** (OK)

**Exemplos de Response**

**Elegível:**
```json
{
    "status": "eligible"
}
```

**Não elegível - Idade fora do intervalo:**
```json
{
    "status": "not_eligible",
    "error_description": "Age 66 is not within the eligible range (18-65 years)"
}
```

**Response Body Details**

| Campo     | Tipo    | Descrição                                    |
|-----------|---------|----------------------------------------------|
| status | string | Status da elegibilidade (eligible/not_eligible) |
| error_description | string | Descrição do erro quando não elegível (opcional) |

---

## 2. Simulação de saque e limite do cartão

A simulação permite calcular o valor de saque disponível e o limite do cartão consignado baseado nos parâmetros financeiros informados. Esta operação é útil para apresentar ao beneficiário as condições antes da contratação.

### Request
**POST**
/payroll_card_reservation/social_security/simulation

**Request Body**

```json
{
  "financial": {
    "salary_amount": 5000.00,
    "number_of_installments": 96,
    "monthly_interest_rate": 0.0246
  },
  "withdrawal": {
    "disbursement_date": "2026-01-02",
    "limit_days_to_disburse": 1,
    "withdrawal_ratio": 0.7
  },
  "collateral": {
    "collateral_type": "social_security_benefit_card"
  }
}
```

**Request Body Details**

| Campo | Tipo | Descrição | Formatação | Obrigatório |
|---|---|---|---|---|
| financial | object | Dados financeiros da operação | - | Sim |
| withdrawal | object | Dados do saque | - | Sim |
| collateral | object | Dados do colateral | - | Sim |

#### Payload financial

| Campo | Tipo | Descrição | Formatação | Obrigatório |
|---|---|---|---|---|
| salary_amount | number | Valor do salário do beneficiário | Mínimo: 1 | Sim |
| number_of_installments | number  | Número de parcelas da CCB de saque | Mínimo: 1, Máximo: 96 | Sim |
| monthly_interest_rate | number  | Taxa de juros mensal da CCB de saque | Mínimo: 0.01, Máximo: 0.0246 | Sim |

#### Payload withdrawal

| Campo | Tipo | Descrição | Formatação | Obrigatório |
|---|---|---|---|---|
| disbursement_date | date  | Data do desembolso da CCB de saque | YYYY-MM-DD | Sim |
| limit_days_to_disburse | number  | Número de dias limite para desembolso da CCB de saque | Mínimo: 1, Máximo: 10| Sim |
| withdrawal_ratio | number  | Parte do limite que será usado para o saque | Mínimo: 0.5, Máximo: 0.7 | Não (default: 0.7) |

#### Payload collateral

| Campo | Tipo | Descrição | Formatação | Obrigatório |
|---|---|---|---|---|
| collateral_type | string | Tipo do cartão | Enum: "social_security_benefit_card", "social_security_payroll_card" | Sim |

### Response

STATUS
**201** (Created)

**Response Body**

```json
{
   "total_limit_amount": 8000,
   "reservation_amount": 250,
   "withdrawal": {
      "withdrawal_amount": 5600,
      "withdrawal_data": {
         "prefixed_interest_rate": {
            "interest_base": "calendar_days",
            "annual_rate": 0.3386043084,
            "monthly_rate": 0.0246,
            "daily_rate": 0.0008104046
         },
         "disbursement_options": [
            {
               "disbursement_date": "2026-01-02",
               "cet": 0.0261,
               "annual_cet": 0.3618,
               "total_iof": 193.55,
               "disbursed_issue_amount": 5600,
               "issue_amount": 5793.55,
               "installments": [
                  {
                     "total_amount": 160.51,
                     "due_date": "2026-02-10",
                     "business_due_date": "2026-02-11",
                     "installment_number": 1
                  },
                  {
                     "total_amount": 160.51,
                     "due_date": "2026-03-10",
                     "business_due_date": "2026-03-11",
                     "installment_number": 2
                  },
                  {
                     "total_amount": 160.51,
                     "due_date": "2026-04-10",
                     "business_due_date": "2026-04-13",
                     "installment_number": 3
                  },
                  ...
               ]
            }
         ]
      }
   },
   "payroll_card": {
      "card_limit": 2400
   }
}
```

**Response Body Details**

| Campo | Tipo | Descrição |
|---|---|---| 
| total_limit_amount | number | Valor total do limite disponível considerando saque e cartão | 
| reservation_amount | number | Valor da reserva do cartão consignado | 
| withdrawal | object | Dados do saque |
| withdrawal.withdrawal_amount | number | Valor de desembolso calculado para CCB de saque | 
| withdrawal.withdrawal_data | object | Dados detalhados do saque | 
| payroll_card | object | Dados do cartão consignado | 
| payroll_card.card_limit | number | Limite total calculado para o cartão | 

#### Payload withdrawal.withdrawal_data

| Campo | Tipo | Descrição | 
|---|---|---| 
| prefixed_interest_rate | object | Taxa de juros prefixada |
| disbursement_options | array | Opções de desembolso disponíveis | 

#### Payload prefixed_interest_rate

| Campo | Tipo | Descrição | 
|---|---|---| 
| daily_rate | number | Taxa diária | 
| interest_base | string | Base de cálculo dos juros | 
| monthly_rate | number | Taxa mensal | 
| annual_rate | number | Taxa anual | 

#### Payload disbursement_options

| Campo | Tipo | Descrição | 
|---|---|---| 
| disbursement_date | string | Data do desembolso | 
| cet | number | Custo Efetivo Total mensal | 
| annual_cet | number | Custo Efetivo Total anual | 
| total_iof | number | Valor total de IOF |  
| disbursed_issue_amount | number | Valor de desembolso |  
| issue_amount | number | Valor de emissão |  
| installments | array | Lista de parcelas | 

#### Payload installments

| Campo | Tipo | Descrição | 
|---|---|---| 
| total_amount | number | Valor total da parcela | 
| due_date | string | Data de vencimento | 
| installment_number | number | Número da parcela | 

---

## 3. Criação da operação de saque e geração do termo

A criação da operação de saque inicia o processo de contratação do cartão consignado. Esta operação cria a reserva do cartão, gera os documentos necessários e retorna as chaves para acompanhamento do processo.

**POST**
/payroll_card_reservation/social_security

### Request

**Request Body**

```json
{
  "request_control_key": "150e8400-e29b-41d4-a716-446655440000",
  "purchaser_document_number": "55566677000177",
  "card_holder": {
    "name": "Carlos Eduardo Lima",
    "email": "carlos.lima@email.com",
    "phone": {
      "number": "654321098",
      "area_code": "31",
      "country_code": "055"
    },
    "gender": "male",
    "address": {
      "city": "Belo Horizonte",
      "state": "MG",
      "number": "789",
      "street": "Rua das Palmeiras",
      "complement": "Casa 3",
      "postal_code": "30112000",
      "neighborhood": "Savassi"
    },
    "birth_date": "1990-09-18",
    "mother_name": "Fernanda Lima",
    "nationality": "Brasileiro",
    "document_number": "55566677788",
    "document_identification": {
      "document_identification_date": "2012-05-20",
      "document_identification_type": "rg",
      "document_identification_number": "555666777"
    }
  },
  "related_parties": [
    {
      "name": "Pedro Costa",
      "email": "pedro.costa@email.com",
      "phone": {
        "number": "765432109",
        "area_code": "21",
        "country_code": "055"
      },
      "address": {
        "city": "Rio de Janeiro",
        "state": "RJ",
        "number": "789",
        "street": "Rua Ipanema",
        "complement": "Apto 12",
        "postal_code": "22080001",
        "neighborhood": "Ipanema"
      },
      "role_type": "issuer_legal_representative",
      "person_type": "natural",
      "is_pep": false,
      "individual_document_number": "11122233344",
      "birth_date": "1980-12-05",
      "mother_name": "Lucia Costa",
      "document_identification": {
        "document_identification_date": "2017-01-14",
        "document_identification_type": "rg",
        "document_identification_number": "222333444"
      }
    }
  ],
  "withdrawal": {
    "disbursement_date": "2026-01-02",
    "limit_days_to_disburse": 1,
    "withdrawal_ratio": 0.7,
    "contract_number": "PCR12345678",
    "disbursement_bank_account": {
      "name": "Carlos Eduardo Lima",
      "bank_code": "104",
      "account_digit": "3",
      "branch_number": "5678",
      "account_number": "987654321",
      "document_number": "55566677788",
      "transfer_method": "pix",
      "account_type": "checking_account"
    }
  },
  "financial": {
    "salary_amount": 5000.00,
    "number_of_installments": 96,
    "monthly_interest_rate": 0.0246,
    "emission_installments": 1
  },
  "collateral": {
    "state": "MG",
    "benefit_number": "5556667777",
    "collateral_type": "social_security_benefit_card",
    "subcorban_document_number": "12123456000101",
    "assistance_type": "pension_by_death_rural_worker"
  },
  "credit_agent": {
    "document_number": "44455566677",
    "name": "Agente de Crédito Lima"
  }
}
```

**Request Body Details**

| Campo | Tipo | Descrição | Formatação | Obrigatório |
|---|---|---|---|---|
| request_control_key | string | Chave de identificação da requisição | UUID v4 | Sim |
| purchaser_document_number | string | CNPJ do comprador | 14 dígitos numéricos | Sim |
| card_holder | object | Dados do portador do cartão | - | Sim |
| withdrawal | object | Dados do saque | - | Sim |
| financial | object | Dados financeiros da operação | - | Sim |
| collateral | object | Dados do colateral | - | Sim |
| credit_agent | object | Dados do agente de crédito | - | Sim |
| related_parties | array | Lista de partes relacionadas | - | Não |

#### Payload card_holder

| Campo | Tipo | Descrição | Formatação | Obrigatório |
|---|---|---|---|---|
| name | string | Nome completo do portador | Mínimo: 1 caractere válido | Sim |
| email | string | Email do portador | Formato de email válido | Sim |
| phone | object | Dados do telefone | - | Sim |
| gender | string | Gênero | Enum: "male", "female" | Sim |
| address | object | Endereço do portador e de entrega do cartão. | - | Sim |
| birth_date | date | Data de nascimento | YYYY-MM-DD | Sim |
| mother_name | string | Nome da mãe | Mínimo: 1 caractere válido | Sim |
| nationality | string | Nacionalidade | Mínimo: 1 caractere | Sim |
| document_number | string | CPF do portador | 11 dígitos numéricos | Sim |
| document_identification | object | Dados do documento de identificação | - | Sim |

#### Payload related_parties

| Campo | Tipo | Descrição | Formatação | Obrigatório |
|---|---|---|---|---|
| name | string | Nome da parte relacionada | Mínimo: 1 caractere válido | Sim |
| email | string | Email da parte relacionada | Formato de email válido | Sim |
| phone | object | Dados do telefone | - | Sim |
| address | object | Endereço da parte relacionada | - | Sim |
| role_type | string | Tipo de papel | Enum: "issuer_legal_representative", "issuer_attorney" | Sim |
| person_type | string | Tipo de pessoa | Enum: "natural" | Sim |
| is_pep | boolean | Se é pessoa politicamente exposta | true/false | Sim |
| individual_document_number | string | CPF da parte relacionada | 11 dígitos numéricos | Sim |
| birth_date | date | Data de nascimento | YYYY-MM-DD | Sim |
| mother_name | string | Nome da mãe | Mínimo: 1 caractere válido | Sim |
| document_identification | object | Dados do documento de identificação | - | Sim |

#### Payload phone

| Campo | Tipo | Descrição | Formatação | Obrigatório |
|---|---|---|---|---|
| number | string | Número do telefone | Apenas números | Sim |
| area_code | string | Código de área | Apenas números | Sim |
| country_code | string | Código do país | Apenas números | Sim |

#### Payload address

| Campo | Tipo | Descrição | Formatação | Obrigatório |
|---|---|---|---|---|
| city | string | Cidade | Mínimo: 1 caractere | Sim |
| state | string | Estado | 2 caracteres | Sim |
| number | string | Número | Mínimo: 1 caractere | Sim |
| street | string | Rua | Mínimo: 1 caractere | Sim |
| complement | string | Complemento | Mínimo: 1 caractere | Não |
| postal_code | string | CEP | 8 dígitos numéricos | Sim |
| neighborhood | string | Bairro | Mínimo: 1 caractere | Sim |

#### Payload document_identification

| Campo | Tipo | Descrição | Formatação | Obrigatório |
|---|---|---|---|---|
| document_identification_date | date | Data de emissão do documento | YYYY-MM-DD | Sim |
| document_identification_type | string | Tipo do documento | Enum: "rg", "passport", "other" | Sim |
| document_identification_number | string | Número do documento | Mínimo: 1 caractere | Sim |

#### Payload withdrawal

| Campo | Tipo | Descrição | Formatação | Obrigatório |
|---|---|---|---|---|
| disbursement_date | date | Data do desembolso | YYYY-MM-DD | Sim |
| limit_days_to_disburse | number | Número de dias limite para desembolso | Mínimo: 1, Máximo: 10 | Sim |
| contract_number | string | Número do contrato | 3 letras maiúsculas + 8 números | Sim |
| disbursement_bank_account | object | Conta bancária para desembolso | - | Sim |

#### Payload disbursement_bank_account

| Campo | Tipo | Descrição | Formatação | Obrigatório |
|---|---|---|---|---|
| name | string | Nome do titular da conta | Mínimo: 1 caractere válido | Sim |
| bank_code | string | Código do banco | 3 dígitos numéricos | Sim |
| account_digit | string | Dígito da conta | 1 dígito numérico | Sim |
| branch_number | string | Número da agência | Apenas números | Sim |
| account_number | string | Número da conta | Apenas números | Sim |
| document_number | string | CPF do titular | 11 dígitos numéricos | Sim |
| transfer_method | string | Método de transferência | Enum: "pix", "ted" | Sim |
| account_type | string | Tipo de conta | Enum: "checking_account","deposit_account","guaranteed_account","investment_account","payment_account","saving_account","salary_account" | Sim |

#### Payload financial

| Campo | Tipo | Descrição | Formatação | Obrigatório |
|---|---|---|---|---|
| salary_amount | number | Valor do salário do beneficiário (valor total do benefício) | Mínimo: 1 | Sim |
| number_of_installments | number | Número de parcelas das CCBs (saque e rotativo) | Mínimo: 1, Máximo: 96 | Sim |
| monthly_interest_rate | number | Taxa de juros mensal das CCBs (saque e rotativo) | Mínimo: 0.01, Máximo: 0.0246 | Sim |
| emission_installments | number | Número de Parcelas da taxa de emissão do cartão (Conforme coletado com o beneficiário) | Mínimo: 1, Máximo: 3 | Sim |

#### Payload collateral

| Campo | Tipo | Descrição | Formatação | Obrigatório |
|---|---|---|---|---|
| state | string | Estado | 2 caracteres | Sim |
| benefit_number | string | Número do benefício | Mínimo: 1 caractere | Sim |
| collateral_type | string | Tipo da garantia | Enum: "social_security_benefit_card" (Cartão Benefício), "social_security_payroll_card" (Cartão Consignado) | Sim |
| assistance_type | string | Tipo do benefício | Enum: [Enumeradores](#benefit_type_enumerator)  | Sim |

#### Payload credit_agent

| Campo | Tipo | Descrição | Formatação | Obrigatório |
|---|---|---|---|---|
| document_number | string | CPF do agente de crédito | 11 ou 14 dígitos numéricos | Sim |
| name | string | Nome do agente de crédito | Mínimo: 1 caractere válido | Sim |

### Response

STATUS
**201** (Created)

**Response Body**

```json
{
   "request_control_key": "150e8400-e29b-41d4-a716-446655440000",
   "payroll_card_type": "social_security_benefit_card",
   "payroll_card_reservation_key": "72d63aea-15b6-402c-a18b-d12cd4619c9d",
   "card_holder_document_number": "55566677788",
   "identifier_number": "5556667777",
   "total_limit_amount": 8000,
   "reservation_amount": 250,
   "withdrawal": {
      "withdrawal_key": "56cfe7b7-ed6e-4212-8744-c9fcff309ec0",
      "withdrawal_amount": 5600,
      "credit_operation_key": null,
      "withdrawal_status": "pending_signature",
      "contract_number": "PCR12345678",
      "withdrawal_data": {
         "prefixed_interest_rate": {
            "interest_base": "calendar_days",
            "annual_rate": 0.3386043084,
            "monthly_rate": 0.0246,
            "daily_rate": 0.0008104046
         },
         "disbursement_options": [
            {
               "disbursement_date": "2026-01-02",
               "cet": 0.0261,
               "annual_cet": 0.3618,
               "total_iof": 193.55,
               "disbursed_issue_amount": 5600,
               "issue_amount":  5793.55,
               "installments": [
                  {
                     "total_amount": 160.51,
                     "due_date": "2026-02-10",
                     "business_due_date": "2026-02-11",
                     "installment_number": 1
                  },
                  {
                     "total_amount": 160.51,
                     "due_date": "2026-03-10",
                     "business_due_date": "2026-03-11",
                     "installment_number": 2
                  },
                  {
                     "total_amount": 160.51,
                     "due_date": "2026-04-10",
                     "business_due_date": "2026-04-13",
                     "installment_number": 3
                  },
                  ...
               ]
            }
         ]
      },
      "wallet_entry_key": null
   },
   "payroll_card": {
      "payroll_card_key": "572650c7-67f6-4f73-8444-b9da72000057",
      "payroll_card_status": "pending_issuance",
      "card_key": null,
      "payment_instrument_key": null,
      "card_issuance_entry_key": null,
      "card_issuance_entry_amount": 17.28,
      "card_limit": 2400
   },
   "attached_documents": [
      {
         "document_key": "32f5e5e2-a15a-40af-9ddc-cddaba1966cf",
         "document_type": "withdrawal_operation_term",
         "document_certifier": "qi_sign",
         "document_status": "pending_generation",
         "document_url": null,
         "document_batch_key": "f4f2b64c-5608-44bb-a2df-bf62cf26cc76"
      },
      {
         "document_key": "7767e30e-417e-4dd7-b061-bba722451d10",
         "document_type": "payroll_card_term",
         "document_certifier": "qi_sign",
         "document_status": "pending_generation",
         "document_url": null,
         "document_batch_key": "f4f2b64c-5608-44bb-a2df-bf62cf26cc76"
      },
      {
         "document_key": "6c839b10-9558-4e6e-9f7d-d1e494cf6156",
         "document_type": "payroll_card_consent_term",
         "document_certifier": "qi_sign",
         "document_status": "pending_generation",
         "document_url": null,
         "document_batch_key": "f4f2b64c-5608-44bb-a2df-bf62cf26cc76"
      }
   ],
   "payroll_card_reservation_status": "pending_document_generation",
   "wallet_key": null,
   "reservation_contract_number": "PCR0000000822"
}
```

**Response Body Details**

| Campo | Tipo | Descrição |
|---|---|---| 
| request_control_key | string | Chave de identificação da requisição | 
| payroll_card_reservation_key | string | Chave da reserva do cartão consignado | 
| payroll_card_reservation_status | string | Status da reserva do cartão consignado | 
| card_holder_document_number | string | CPF do portador do cartão | 
| identifier_number | string | Número identificador da operação | 
| reservation_amount | number | Valor da reserva do cartão consignado |
| reservation_contract_number | string | Número do contrato de averbação na Dataprev | 
| withdrawal | object | Dados do saque | 
| payroll_card | object | Dados do cartão consignado | 
| attached_documents | array | Lista de documentos anexados | 
| payroll_card_type | string | Tipo do cartão (`social_security_benefit_card` ou `social_security_payroll_card`) | 
| wallet_key | string | Chave única da wallet criada (UUID4) | 

#### Payload withdrawal

| Campo | Tipo | Descrição | 
|---|---|---| 
| withdrawal_key | string | Chave única do saque | 
| contract_number | string | Número do contrato da CCB de saque | 
| withdrawal_amount | number | Valor de desembolso calculado para CCB de saque | 
| disbursement_date | date | Data de desembolso da operação | 
| withdrawal_status | string | Status do saque | 
| withdrawal_data | object | Dados detalhados do saque |

#### Payload withdrawal_data

| Campo | Tipo | Descrição |
|---|---|---| 
| prefixed_interest_rate | object | Taxa de juros prefixada | 
| disbursement_options | array | Opções de desembolso disponíveis | 

#### Payload prefixed_interest_rate

| Campo | Tipo | Descrição | 
|---|---|---| 
| daily_rate | number | Taxa diária | 
| interest_base | string | Base de cálculo dos juros | 
| monthly_rate | number | Taxa mensal | 
| annual_rate | number | Taxa anual | 

#### Payload disbursement_options

| Campo | Tipo | Descrição | 
|---|---|---| 
| disbursement_date | string | Data do desembolso | 
| cet | number | Custo Efetivo Total mensal | 
| annual_cet | number | Custo Efetivo Total anual | 
| total_iof | number | Valor total de IOF |  
| disbursed_issue_amount | number | Valor de desembolso |  
| issue_amount | number | Valor de emissão |  
| installments | array | Lista de parcelas | 

#### Payload installments

| Campo | Tipo | Descrição | 
|---|---|---| 
| total_amount | number | Valor total da parcela | 
| due_date | string | Data de vencimento | 
| installment_number | number | Número da parcela | 

#### Payload payroll_card

| Campo | Tipo | Descrição | 
|---|---|---| 
| payroll_card_key | string | Chave única do cartão consignado | 
| payroll_card_status | string | Status do cartão consignado | 
| card_limit | number | Limite total calculado para o cartão | 
| card_issuance_entry_amount | number | Valor da Taxa de emissão do cartão | 

#### Payload attached_documents

| Campo | Tipo | Descrição | 
|---|---|---| 
| document_key | string | Chave única do documento | 
| document_batch_key | string | Chave do lote de documentos | 
| document_type | string | Tipo do documento | 
| document_certifier | string | Certificadora do documento | 
| document_status | string | Status do documento | 
| document_url | string | URL do documento | 
| signature_url | string | URL da assinatura | 

---

---

## 4. Envio de documentos adicionais

Após a averbação da margem na Dataprev, a reserva é atualizada para o status `pending_additional_documents_submission`. Para liberar o desembolso da operação, é obrigatório o envio dos documentos adicionais (Para o produto de Cartão Consignado/Benefício de INSS, o **vídeo de confirmação da contratação**).

O processamento do upload é assíncrono. O upload bem sucedido aciona a transição automática da reserva para `pending_additional_documents_validation`, disparando os webhooks de [alteração de status](./manual_cartao_beneficio_webhook.md) e de [atualização de documentos](./manual_cartao_beneficio_documentos.md), e acionando a validação dos documentos.

:::info Reprovação e Re-envio de Documentos Adicionais
Caso os documentos adicionais sejam rejeitados na validação do sistema, a reserva retornará para o status `pending_additional_documents_submission` e será possível realizar o re-envio dos documentos adicionais por este mesmo endpoint. Não é possível realizar o re-envio dos documentos adicionais antes da aprovação/rejeição pela análise do sistema, e existe um limite de 5 análises por reserva e tipo de documento.
:::

:::warning Atenção: Gatilho de Desembolso
O envio e a subsequente aprovação pelo sistema dos documentos adicionais são tratados como autorização para a operação de crédito. Após a validação bem sucedida dos dos arquivos, a operação seguirá automaticamente para o status `pending_withdrawal_disbursement`, notificado ao cliente por um webhook, e será efetuado o desembolso na conta do beneficiário, **sem etapas adicionais de aprovação**.
:::

### Request

**POST**
/payroll_card_reservation/social_security/[PAYROLL-CARD-RESERVATION-KEY]/additional_documents

**Params**

| Campo | Tipo | Descrição | Obrigatório |
|---|---|---|---|
| payroll_card_reservation_key | string | Chave única da reserva (UUID) | Sim |

**Request Body**

```json
{
  "documents": [
      {
        "document_type": "payroll_card_confirmation_video", 
        "document_url": "https://download.samplelib.com/mp4/sample-5s.mp4"
      }
  ]
}
```

**Request Body Details**

| Campo | Tipo | Descrição | Obrigatório |
|---|---|---|---|
| documents | array | Lista de documentos a serem anexados | Sim |

#### Payload documents

| Campo | Tipo | Descrição | Formatação | Obrigatório |
|---|---|---|---|---|
| document_type | string | Tipo do documento | Enum: "payroll_card_confirmation_video" | Sim |
| document_url | string | URL pública para download do arquivo de vídeo | URL válida | Sim |

:::info **URL do Vídeo**
Garanta que a URL enviada é acessível por usuários externos, para conseguirmos efetuar o upload do arquivo para o banco de dados interno da QI.

- Formatos de arquivo suportados: .mp4
- Tamanho máximo do arquivo: 256MB
:::

### Response

STATUS
**200** (OK)

A requisição foi recebida com sucesso e o documento será processado assincronamente.

```json
{
   "attached_documents": [
      {
         "document_key": "2fc216c6-5d1c-4713-b70b-6e1f75f8bb17",
         "document_type": "payroll_card_confirmation_video",
         "document_certifier": "electronic_client_side",
         "document_status": "pending_generation",
         "document_url": ""
      }
   ],
}
```

---

## 5. Reapresentação de Pagamento do Saque

Caso o pagamento não seja processado devido a dados incorretos, é possível pode ajustar as informações da conta bancária para reapresentação através do seguinte endpoint:

**PATCH**
/payroll_card_reservation/social_security/[PAYROLL-CARD-RESERVATION-KEY]/disbursement_account

### Request

**Request Body**

```json
{
   "disbursement_bank_account": {
      "name": "Carlos Eduardo Lima",
      "bank_code": "001",
      "account_digit": "3",
      "branch_number": "5678",
      "account_number": "987654321",
      "document_number": "55566677788",
      "transfer_method": "pix",
      "account_type": "checking_account"
   }
}
```

**Request Body Details**

| Campo | Tipo | Descrição | Formatação | Obrigatório |
|---|---|---|---|---|
| disbursement_bank_account | object | Conta bancária para desembolso | - | Sim |

#### Payload disbursement_bank_account

| Campo | Tipo | Descrição | Formatação | Obrigatório |
|---|---|---|---|---|
| name | string | Nome do titular da conta | Mínimo: 1 caractere válido | Sim |
| bank_code | string | Código do banco | 3 dígitos numéricos | Sim |
| account_digit | string | Dígito da conta | 1 dígito numérico | Sim |
| branch_number | string | Número da agência | Apenas números | Sim |
| account_number | string | Número da conta | Apenas números | Sim |
| document_number | string | CPF do titular | 11 dígitos numéricos | Sim |
| transfer_method | string | Método de transferência | Enum: "pix", "ted" | Sim |
| account_type | string | Tipo de conta | Enum: "checking_account","deposit_account","guaranteed_account","investment_account","payment_account","saving_account","salary_account" | Sim |

### Response

STATUS
**200** (OK)

---

## 6. Anexos 

### Ambiente de Homologação (Mocks)

Para facilitar os testes de integração em ambiente de **Sandbox**, o sistema simula diferentes comportamentos baseados no **primeiro dígito do CPF do beneficiário** enviado no payload de criação.

Utilize a tabela abaixo para simular cenários de sucesso e erro:

| 1º Dígito do CPF | Cenário | Comportamento Interno | Resultado Final (Cliente) |
| :---: | --- | --- | --- |
| **1** | **Fluxo Ideal (Completo)** | **Sucesso** na Assinatura <br/> **Sucesso** no Onboarding <br/> **Sucesso** na Averbação (Dataprev) | **Cartão emitido** <br/> (Status: `card_issued`) |
| **2** | **Erro na Consulta Dataprev** | **Sucesso** na Assinatura <br/> **Sucesso** no Onboarding <br/> **Falha** na Consulta de Benefício | **Reserva cancelada** <br/> (Status: `canceled`) <br/> + **Envio de Webhook de status** <br/> (Status: `canceled`) |
| **3** | **Erro na Averbação Dataprev** | **Sucesso** na Assinatura <br/> **Sucesso** no Onboarding <br/> **Falha** na Averbação/Reserva de Margem | **Reserva cancelada** <br/> (Status: `canceled`) <br/> + **Envio de Webhook de status** <br/> (Status: `canceled`) |
| **4** | **Erro de Endereço** | **Sucesso** na Assinatura <br/> **Sucesso** no Onboarding (Endereço Divergente) <br/> **Sucesso** na Averbação (Dataprev) | **Cartão emitido** <br/> (Status: `card_issued`) <br/> + **Envio de Webhook de atualização de endereço** |
| **5** | **Onboarding Rejeitado** | **Sucesso** na Assinatura <br/> **Rejeição** no Onboarding/KYC | **Reserva cancelada** <br/> (Status: `canceled`) <br/> + **Envio de Webhook de status** <br/> (Status: `canceled`) |
| **6** | **Inelegível (Idade > 65)** | **Sucesso** na Assinatura <br/> **Sucesso** no Onboarding (Retorna idade superior a 65 anos) | **Reserva cancelada** <br/> (Status: `canceled`) <br/> + **Envio de Webhook de status** <br/> (Status: `canceled`) |
| **7** | **Inelegível (Idade < 18)** | **Sucesso** na Assinatura <br/> **Sucesso** no Onboarding (Retorna idade inferior a 18 anos) | **Reserva cancelada** <br/> (Status: `canceled`) <br/> + **Envio de Webhook de status** <br/> (Status: `canceled`) |
| **8** | **Teimosinha (Retentativa)** | **Sucesso** na Assinatura <br/> **Sucesso** no Onboarding <br/> **Falha Temporária** na Averbação (Dataprev) | **Aguardando liberação** <br/> (Status: `pending_reservation`) <br/> + **Envio de Webhook de Collateral** |

:::tip Dica
Para testar o **Fluxo ideal**, certifique-se de usar um CPF que comece com o dígito `1` (ex: `123.456.789-00`) e que seja válido (cálculo de dígitos verificadores correto).
:::

:::warning Aviso
Os mocks de sucesso estão configurados para simular benefícios de até R$10.000,00. Caso valores de benefício acima deste sejam usados, o sistema irá retornar erro de margem excedida na averbação, cancelando a reserva.
:::
---

### Tabela de benefícios {#benefit_type_enumerator}

| código   | benefício                                   |
| --- | ------------------------------------------------ |
| 1   | pension_by_death_rural_worker                    |
| 2   | pension_by_death_accident_rural_worker           |
| 3   | pension_by_death_rural_employer                  |
| 4   | retirement_invalidity_rural_emploee              |
| 5   | retirement_invalidity_accident_rural_worker      |
| 6   | retirement_invalidity_rural_employer             |
| 7   | retirement_by_eldness_rural_worker               |
| 8   | retirement_by_age_rural_employer                 |
| 9   | complement_by_work_accident_rural_worker         |
| 11  | support_invalidity_rural_worker                  |
| 12  | support_by_age_rural_worker                      |
| 13  | aid_sickness_rural_worker                        |
| 15  | aid_time_off_rural_worker                        |
| 16  | aid_federal                                      |
| 17  | international_agreement                          |
| 18  | inclusion_benefit                                |
| 19  | pension_student_law7004                          |
| 20  | pension_by_death_diplomat                        |
| 21  | pension_by_death                                 |
| 22  | pension_by_death_statute                         |
| 23  | pension_by_death_veteran                         |
| 24  | pension_special_institutional_act                |
| 25  | aid_time_off                                     |
| 26  | pension_by_death_special_law593                  |
| 27  | pension_by_death_federal_emploee                 |
| 28  | pension_by_death_general_regime_law20465         |
| 29  | pension_by_death_marine_veteran                  |
| 30  | monthly_income_lifetime_invalidity               |
| 31  | aid_sickness                                     |
| 32  | retirement_invalidity_social_security            |
| 33  | retirement_invalidity_aeronautic                 |
| 34  | retirement_invalidity_marine_law1756             |
| 35  | aid_sickness_veteran                             |
| 36  | aid_social_security_accident                     |
| 37  | retirement_capin_extra_emploee                   |
| 38  | retirement_federal_extra_emploee                 |
| 39  | aid_invalidity_student_law7004                   |
| 40  | monthly_income_lifetime_by_age_upper70_law6179   |
| 41  | retirement_by_age                                |
| 42  | retirement_by_contribution_time                  |
| 43  | retirement_by_time_of_service_veteran            |
| 44  | retirement_special_aeronautic                    |
| 45  | retirement_by_time_of_service_journalist         |
| 46  | retirement_special                               |
| 47  | allowance_25                                     |
| 48  | allowance_20                                     |
| 49  | retirement_ordinary                              |
| 50  | aid_sickness_extinct_basic_plan                  |
| 51  | retirement_invalidity_extinct_basic_plan         |
| 52  | retirement_by_age_extinct_basic_plan             |
| 53  | aid_time_off_extinct_basic_plan                  |
| 54  | pension_indemnity_federal                        |
| 55  | pension_by_death_extinct_basic_plan              |
| 56  | pension_lifetime_syndrome_thalidomide            |
| 57  | retirement_by_teacher_labor_time                 |
| 58  | retirement_anisty                                |
| 59  | pension_by_death_amnesty                         |
| 60  | indemnity                                        |
| 61  | aid_birth                                        |
| 62  | aid_funeral                                      |
| 63  | aid_funeral_rural_worker                         |
| 64  | aid_funeral_rural_employer                       |
| 65  | savings_special_autarchy                         |
| 67  | savings_mandatory_ipase_law5128                  |
| 68  | savings_special_retirement_ps_affiliated_upper60 |
| 69  | savings_student_law7004                          |
| 70  | restitution                                      |
| 71  | monthly_income                                   |
| 72  | retirement_by_time_of_service_law1756            |
| 73  | monthly_income_family_statute                    |
| 74  | complement_pension_federal                       |
| 75  | complement_retirement_federal                    |
| 76  | monthly_income_statute                           |
| 77  | monthly_income_sinpas_family_statute             |
| 78  | retirement_by_age_law1756                        |
| 79  | advantage                                        |
| 80  | monthly_income_maternity                         |
| 81  | compulsory_retirement                            |
| 82  | retirement_by_time_of_service_sasse              |
| 83  | retirement_invalidity_ex_sasse                   |
| 84  | pension_by_death_sasse                           |
| 85  | pension_lifetime_rubber_tapper_law7986           |
| 86  | pension_lifetime_rubber_tapper_dependent_law7986 |
| 87  | continuous_aid_physical_disabilities             |
| 88  | continuous_aid_eldness                           |
| 89  | pension_special_hemodialysis_victim_caruaru      |
| 90  | medic_assistency_work_accident                   |
| 91  | aid_sickness_by_work_accident                    |
| 92  | retirement_invalidity_work_accident              |
| 93  | pension_by_death_work_accident                   |
| 94  | aid_work_accident                                |
| 95  | aid_additional_work_accident                     |
| 96  | pension_special_leprosy_law11520                 |
| 97  | savings_by_death_work_accident                   |
| 98  | aid_longshoreman                                 |
| 99  | time_off_15                                      |

---

# Address Management

URL: /en/documentation/manual_cartao_beneficio/manual_cartao_beneficio_endereco

:::info Navigation
- [Documents and Signature](/documentation/manual_cartao_beneficio/manual_cartao_beneficio_documentos) (previous)
:::

During the Onboarding and KYC process, the beneficiary's address is validated both by our analysis processes and by the beneficiary themselves. If any inconsistency is detected, the client will be notified to confirm or correct the data with the beneficiary.

## 1. Address validation error webhook

This webhook is triggered when the KYC process identifies inconsistencies between the submitted address and the address in our database.

:::caution Action Required
Upon receiving this webhook, the client must contact the beneficiary and request data correction through the **Address Update** endpoint. Failure to execute this correction may result in card delivery failures
:::

WEBHOOK TYPE
laas.payroll_card_reservation.address

**Webhook Body**

```json
{
    "key": "3571e292-3a83-4011-904d-20ee963022ef",
    "webhook_type": "laas.payroll_card_reservation.address",
    "status": "pending_card_issuance",
    "event_datetime": "2025-01-15T16:45:00Z",
    "data": {
        "address": {
          "city": "Belo Horizonte",
          "state": "MG",
          "postal_code": "30112000",
          "street": "Rua Inexistente",
          "number": "000",
          "neighborhood": "Savassi"
        }, 
        "rejected_reason": "address_validation_failed",
        "rejection_details": {
            "description": "Endereço não encontrado na base de validação"
        }
    }
}
```

---

## 2. Address Update

Endpoint used to correct the beneficiary's address after receiving an address validation error webhook.

:::info 
If the beneficiary confirms the address, it is not necessary to send an address update request, and the already registered address will be used for card delivery.
:::

### Request

**PATCH**
/payroll_card_reservation/social_security/{payroll_card_reservation_key}/address

**Request Body**

```json
{
    "address": {
        "city": "Belo Horizonte",
        "state": "MG",
        "number": "789",
        "street": "Rua das Palmeiras",
        "complement": "Casa 3",
        "postal_code": "30112000",
        "neighborhood": "Savassi"
    }
}
```

**Params Details**

| Field | Type | Description | Required |
|---|---|---|---|
| city | string | City | Yes |
| state | string | State (UF) | Yes |
| number | string | Number | Yes |
| street | string | Street | Yes |
| complement | string | Complement | No |
| postal_code | string | Postal Code (numbers only) | Yes |
| neighborhood | string | Neighborhood | Yes |

### Response

STATUS
**200** (OK)

The operation will be automatically reprocessed in the KYC flow, potentially resulting in a new error webhook if any inconsistency is detected again.

---

# Payroll Card Manual - Webhook

URL: /en/documentation/manual_cartao_beneficio/manual_cartao_beneficio_webhook

:::info Navigation
- [Tracking](/documentation/manual_cartao_beneficio/manual_cartao_beneficio_acompanhamento) (previous)
- [Documents and Signature](/documentation/manual_cartao_beneficio/manual_cartao_beneficio_documentos) (next)
:::

:::caution API under development
The API is still in development phase, therefore this manual is subject to changes.
:::

---

## 1. Status Change Webhook (Global)

To track the evolution of the request (Signature completed, Onboarding failure, Disbursement made or Card issued), the API sends a single webhook notifying the status change of the reservation.

WEBHOOK TYPE
laas.payroll_card_reservation.status_change

### General Webhook Structure

| Field | Type | Description |
|---|---|---|
| key | string | Card reservation key |
| status | string | New reservation status |
| webhook_type | string | `laas.payroll_card_reservation.status_change` |
| event_datetime | string | Event date and time |
| data | object | Object containing relevant data for the state change |

### Scenarios

#### A. Signature Completed (Pending Onboarding)
Occurs when documents are signed (via Qi Sign or externally). The reservation status changes to `pending_onboarding` and the flow proceeds to onboarding.

Returns the list of attached documents of the Reservation, plus the signatory's facial analysis data.

**Payload Example**

```json
{
    "key": "3571e292-3a83-4011-904d-20ee963022ef",
    "status": "pending_onboarding",
    "webhook_type": "laas.payroll_card_reservation.status_change",
    "event_datetime": "2025-01-15T14:30:00Z",
    "data": {
        "attached_documents": [
            {
                "document_key":"332017f4-a0d6-463a-8557-e925a9485251",
                "document_type":"payroll_card_term",
                "document_certifier":"qi_sign",
                "document_status":"signed",
                "document_batch_key":"f28bf87a-11cd-4d89-89c0-19229a1b31a7",
                "document_url": "https://storage.googleapis.com/example_document.pdf",
                "signature_url": "https://storage.googleapis.com/example_document_signed.pdf",
            },
            {
                "document_key":"0f0651de-bf3f-45f8-891f-f81b9c24df10",
                "document_type":"payroll_card_consent_term",
                "document_certifier":"qi_sign",
                "document_status":"signed",
                "document_batch_key":"f28bf87a-11cd-4d89-89c0-19229a1b31a7",
                "document_url": "https://storage.googleapis.com/example_document.pdf",
                "signature_url": "https://storage.googleapis.com/example_document_signed.pdf",
            },
            {
                "document_key":"910e8de5-16af-4bc5-8ee1-4a0652ca0cbf",
                "document_type":"withdrawal_operation_term",
                "document_certifier":"qi_sign",
                "document_status":"signed",
                "document_batch_key":"f28bf87a-11cd-4d89-89c0-19229a1b31a7",
                "document_url": "https://storage.googleapis.com/example_document.pdf",
                "signature_url": "https://storage.googleapis.com/example_document_signed.pdf",
            },
            {
                "document_key":"b1c3e915-6707-49f5-85a9-398ef997fdad",
                "document_type":"selfie",
                "document_certifier":"qi_sign",
                "document_status":"generated",
                "document_url":"https://storage.googleapis.com/selfie.jpeg"
            },
            {
                "document_key":"5769a335-a2ac-4913-a742-38b9d1e4abd2",
                "document_type":"document_identification",
                "document_certifier":"qi_sign",
                "document_status":"generated",
                "document_url":"https://storage.googleapis.com/cnh.jpeg"
            },
            {
                "document_key":"75577d34-4ebd-4488-aca8-b064e603c973",
                "document_type":"document_identification_back",
                "document_certifier":"qi_sign",
                "document_status":"generated",
                "document_url":"https://storage.googleapis.com/cnh_back.jpeg"
            }
        ],
        "signature_data": {
            "document_similarity_score": 1,
            "similarity_score": 0.75,
            "biometry_analysis_reference": "internal",
        }
    }
}
```

**Response Body Details**

| Field | Type | Description |
|---|---|---|
| attached_documents | array | List of documents created for the reservation |
| signature_data | object | Biometric data collected during signature |

##### Payload signature_data

| Field | Type | Description |
|---|---|---|
| document_similarity_score | number | Biometric similarity score between the signatory and the submitted document (0-1) |
| similarity_score | number | Biometric similarity score between the signatory and the reference found in the face database (0-1) |
| biometry_analysis_reference | string | Origin database of the face used for calculating the biometric similarity score |

#### B. Additional Documents Submission (Pending Additional Documents Submission)
Occurs when the margin is successfully reserved at Dataprev **OR** when the operation returns from the validation stage due to additional document (video) rejection.

This webhook indicates that the operation is awaiting the submission (or resubmission) of the confirmation video via the `/additional_documents` endpoint. In case of resubmission due to rejection, the payload will return the `rejection_reason` field.

**Payload Example**

```json
{
    "key": "3571e292-3a83-4011-904d-20ee963022ef",
    "status": "pending_additional_documents_submission",
    "webhook_type": "laas.payroll_card_reservation.status_change",
    "event_datetime": "2025-01-15T16:00:00Z",
    "data": {
        "rejection_reason": "Vídeo sem áudio ou ilegível" // Present only when returning from pending_additional_documents_validation status after document rejection
    }
}
```

#### C. Additional Documents Validation (Pending Additional Documents Validation)
Occurs after successful submission of the confirmation video. The status changes to `pending_additional_documents_validation`, indicating that the video/additional document has entered the queue for validation and analysis.

**Payload Example**

```json
{
    "key": "3571e292-3a83-4011-904d-20ee963022ef",
    "status": "pending_additional_documents_validation",
    "webhook_type": "laas.payroll_card_reservation.status_change",
    "event_datetime": "2025-01-15T16:15:00Z",
    "data": {}
}
```

#### D. Additional Documents Approved (Pending Withdrawal Disbursement)
Occurs after the validation stage analyzes and approves the confirmation video. The status changes to `pending_withdrawal_disbursement` (awaiting withdrawal disbursement).

**Payload Example**

```json
{
    "key": "3571e292-3a83-4011-904d-20ee963022ef",
    "status": "pending_withdrawal_disbursement",
    "webhook_type": "laas.payroll_card_reservation.status_change",
    "event_datetime": "2025-01-15T17:00:00Z",
    "data": {
        "credit_operation_key": "3571e292-3a83-4011-904d-20ee963022ef"
    }
}
```

#### E. Disbursement Made (Pending Card Issuance)
Occurs when the withdrawal is executed. The status changes to `pending_card_issuance` (awaiting card issuance) and the flow proceeds to card issuance.

Returns no additional information.

**Payload Example**

```json
{
    "key": "3571e292-3a83-4011-904d-20ee963022ef",
    "status": "pending_card_issuance",
    "webhook_type": "laas.payroll_card_reservation.status_change",
    "event_datetime": "2025-01-15T17:00:00Z",
    "data": {
        "wallet_key": "9a7b7982-8bf7-4a2c-942c-588166811623"
    }
}
```

#### F. Card Issued (Card Issued)
Occurs when the wallet and card are created.

**Payload Example**

```json
{
    "key": "3571e292-3a83-4011-904d-20ee963022ef",
    "status": "card_issued",
    "webhook_type": "laas.payroll_card_reservation.status_change",
    "event_datetime": "2025-01-15T18:30:00Z",
    "data": {
        "card_key": "7c6b421e-7ae0-4419-b021-87bcc0be8748"
    }
}
```

---

#### G. Cancellation (Canceled)
Occurs when the operation is cancelled for some reason (Rejection in identity or credit validations, error in margin reservation at Dataprev, etc.).

Returns the cancellation reason and details.

**Payload Example**

```json
{
    "key": "3571e292-3a83-4011-904d-20ee963022ef",
    "status": "canceled",
    "webhook_type": "laas.payroll_card_reservation.status_change",
    "event_datetime": "2025-01-15T16:45:00Z",
    "data": {
        "cancel_reason": "not_eligible", 
        "cancel_details": "Age 15 is not within the eligible range (18-79 years)"
    }
}
```

---

## 2. Documents Webhook (Generation and Validation)

This webhook notifies changes in the individual status of each document attached to the operation. This includes contract generation, the signature collection stage, and responses from the additional document validation stage (such as the confirmation video).

WEBHOOK TYPE
laas.payroll_card_reservation.attached_document.status_change

### General Webhook Structure

| Field | Type | Description |
|---|---|---|
| key | string | Document key |
| status | string | New document status (`generated`, `pending_signature`, `approved`, `rejected`) |
| webhook_type | string | `laas.payroll_card_reservation.attached_document.status_change` |
| event_datetime | string | Event date and time |
| data | object | Object containing relevant data for the status change |

#### Details of the `data` object

| Field | Type | Description |
| --- | --- | --- |
| payroll_card_reservation_key | string | Card reservation key |
| document_key | string | Unique document key |
| document_type | string | Document type |
| document_url | string | Link to view the document |
| signature_url | string | Link to the signature flow. Only when `status` is `pending_signature`. |
| rejection_reason | string | Rejection reason. Only when `status` is `rejected`. |

### Scenarios

#### A. Document Generated (generated)
Occurs when operation contracts are successfully generated and ready for viewing.

**Payload Example**

```json
{
    "key": "332017f4-a0d6-463a-8557-e925a9485251",
    "status": "generated",
    "webhook_type": "laas.payroll_card_reservation.attached_document.status_change",
    "event_datetime": "2025-01-15T14:30:00Z",
    "data": {
        "payroll_card_reservation_key": "910e8de5-16af-4bc5-8ee1-4a0652ca0cbf",
        "document_key": "332017f4-a0d6-463a-8557-e925a9485251",
        "document_type": "payroll_card_term",
        "document_url": "https://storage.googleapis.com/example_document.pdf",
        "signature_url": null
    }
}
```

#### B. Pending Signature (pending_signature)
Occurs when contracts are generated and ready for signature by the beneficiary. Returns the `signature_url`.

**Payload Example**

```json
{
    "key": "332017f4-a0d6-463a-8557-e925a9485251",
    "status": "pending_signature",
    "webhook_type": "laas.payroll_card_reservation.attached_document.status_change",
    "event_datetime": "2025-01-15T14:30:00Z",
    "data": {
        "payroll_card_reservation_key": "910e8de5-16af-4bc5-8ee1-4a0652ca0cbf",
        "document_key": "332017f4-a0d6-463a-8557-e925a9485251",
        "document_type": "payroll_card_term",
        "document_url": "https://storage.googleapis.com/example_document.pdf",
        "signature_url": "https://test.sign.qitech.com.br/s/SVomf6J"
    }
}
```

#### C. Additional Document Approved (approved)
Occurs as a response to validation of an additional document (such as the confirmation video), indicating that it was validated and accepted by our team or checking system.

**Payload Example**

```json
{
    "key": "2fc216c6-5d1c-4713-b70b-6e1f75f8bb17",
    "status": "approved",
    "webhook_type": "laas.payroll_card_reservation.attached_document.status_change",
    "event_datetime": "2025-01-15T16:45:00Z",
    "data": {
        "payroll_card_reservation_key": "910e8de5-16af-4bc5-8ee1-4a0652ca0cbf",
        "document_key": "2fc216c6-5d1c-4713-b70b-6e1f75f8bb17",
        "document_type": "payroll_card_confirmation_video",
        "document_url": "https://storage.googleapis.com/video.mp4",
        "signature_url": null
    }
}
```

#### D. Additional Document Rejected (rejected)
Occurs as a negative response to validation of an additional document. In this scenario, the file was rejected and the payload will include the `rejection_reason` property explaining why.

**Payload Example**

```json
{
    "key": "2fc216c6-5d1c-4713-b70b-6e1f75f8bb17",
    "status": "rejected",
    "webhook_type": "laas.payroll_card_reservation.attached_document.status_change",
    "event_datetime": "2025-01-15T16:50:00Z",
    "data": {
        "payroll_card_reservation_key": "910e8de5-16af-4bc5-8ee1-4a0652ca0cbf",
        "document_key": "2fc216c6-5d1c-4713-b70b-6e1f75f8bb17",
        "document_type": "payroll_card_confirmation_video",
        "document_url": "https://storage.googleapis.com/video_bad.mp4",
        "signature_url": null,
        "rejection_reason": "Áudio inaudível e rosto do cliente não visível"
    }
}
```

---

## 3. Dataprev Return Webhook (Collateral)

This webhook notifies about the progress of margin reservation with Dataprev.

It is mainly used in **"Retry"** scenarios, where temporary failures (such as locked margin or temporarily exceeded installment value) do not immediately cancel the reservation. In these cases, the reservation remains in the endorsement queue until the last configured disbursement date.

WEBHOOK TYPE
social_security.collateral

### General Webhook Structure

| Field | Type | Description |
|---|---|---|
| key | string | **Card Reservation** key (`payroll_card_reservation_key`) |
| webhook_type | string | Always `social_security.collateral` |
| event_time | string | Event date and time |
| data | object | Detailed data from Dataprev return |
| data.collateral_constituted | boolean | Indicates if the collateral was successfully constituted (`true` or `false`) |
| data.collateral_data.status | string | Reservation status (ex: `pending_reservation`) |
| data.collateral_data.last_response | object | Contains the list of errors returned by Dataprev (ex: `installment_limit_excceded`) |

**Payload Example - Temporary Failure**

```json
{
  "event_time": "2026-01-06 18:48:51",
  "key": "b670553f-28f4-4cf2-a3b5-e33c5ae86bb5",
  "webhook_type": "social_security.collateral",
  "data": {
    "collateral_data": {
      "last_response": {
        "errors": [
          {
            "enumerator": "installment_limit_excceded"
          }
        ]
      },
      "status": "pending_reservation",
      "last_response_event_datetime": "2026-01-06T18:48:51Z",
      "reservation_method": "social_security_payroll_card"
    },
    "collateral_type": "social_security_payroll_card",
    "collateral_constituted": false
  }
}
```

---

## 4. Credit Operation Webhook (Disbursement and CCB Status)

This webhook notifies the status change of the **Credit Operation** (CCB) linked to the reservation. It is triggered at two main moments:
1. **Success (`opened`):** The amount was successfully transferred to the client's account.
2. **Cancellation (`canceled`):** A banking error occurred in disbursement (ex: invalid account, ownership discrepancy) and the operation was cancelled.

WEBHOOK TYPE
laas.credit_operation.status_change

### General Webhook Structure

| Field | Type | Description |
|---|---|---|
| key | string | **Credit Operation** key (`credit_operation_key`) |
| status | string | New operation status: `opened` (Success) or `canceled` (Failure) |
| webhook_type | string | Always `laas.credit_operation.status_change` |
| event_datetime | string | Event date and time |
| data | object | Variable object containing success details or error reason |

---

### Scenario A: Successful Disbursement (`opened`)

When the status is `opened`, the `data` object contains the final financial details and transaction receipt.

| Field (inside `data`) | Type | Description |
|---|---|---|
| installments | array | List of confirmed installments with final dates and amounts |
| transaction_receipts | array | List of bank transfer receipts |
| requester_identifier_key | string | Unique requester identifier |

**Payload Example - Success**

```json
{
    "key": "550e8400-e29b-41d4-a716-446655440000",
    "status": "opened",
    "webhook_type": "laas.credit_operation.status_change",
    "event_datetime": "2025-10-14 13:26:52",
    "data": {
      "installments": [
        {
          "due_date": "2025-12-28",
          "total_amount": 315.02,
          "installment_key": "123e4567-e89b-12d3-a456-426614174000",
          "pre_fixed_amount": 212.35873015,
          "installment_number": 1,
          "principal_amortization_amount": 102.66126985
        },
        {
          "due_date": "2026-01-28",
          "total_amount": 315.02,
          "installment_key": "123e4567-e89b-12d3-a456-426614174001",
          "pre_fixed_amount": 76.17371273,
          "installment_number": 2,
          "principal_amortization_amount": 238.84628727
        },
        {
          "due_date": "2026-02-28",
          "total_amount": 315.02,
          "installment_key": "123e4567-e89b-12d3-a456-426614174002",
          "pre_fixed_amount": 59.12264515,
          "installment_number": 3,
          "principal_amortization_amount": 255.89735485
        },
        {
          "due_date": "2026-03-28",
          "total_amount": 315.02,
          "installment_key": "123e4567-e89b-12d3-a456-426614174003",
          "pre_fixed_amount": 36.77641144,
          "installment_number": 4,
          "principal_amortization_amount": 278.24358856
        },
        {
          "due_date": "2026-04-28",
          "total_amount": 315.02,
          "installment_key": "123e4567-e89b-12d3-a456-426614174004",
          "pre_fixed_amount": 20.98850053,
          "installment_number": 5,
          "principal_amortization_amount": 294.03149947
        }
      ],
      "disbursement_type": "pix",
      "transaction_receipts": [
        {
          "fee": 0,
          "url": "https://bank-receipt-url.com/receipt.pdf",
          "amount": 1151.15,
          "origin": {
            "name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
            "type": "payment_account",
            "branch": "0001",
            "document": "32402502000135",
            "bank_code": "329",
            "account_key": "acc_origin_uuid",
            "branch_digit": null,
            "account_digit": "1",
            "account_branch": "0001",
            "account_number": "1234567",
            "financial_institution_name": "QI SCD S.A."
          },
          "timestamp": "2025-10-14T13:26:52",
          "description": "1234567 - Roberto Alves",
          "destination": {
            "name": "Roberto Alves",
            "type": "checking_account",
            "branch": "0001",
            "purpose": "Crédito PIX em Conta",
            "document": "12345678911",
            "bank_ispb": "12121212",
            "branch_digit": null,
            "account_digit": "2",
            "account_number": "123456",
            "financial_institution_name": "BANCO"
          },
          "end_to_end_id": "E32402502202510141326",
          "transaction_key": "tx_key_uuid",
          "origin_transaction_key": "origin_tx_key_uuid"
        }
      ],
      "requester_identifier_key": "req_id_key_uuid"
    }
}
```

---

### Scenario B: Disbursement Failure (`canceled`)

When the status is `canceled`, the `data` object contains the reason for banking refusal (returned Pix or TED).

| Field (inside `data`) | Type | Description |
|---|---|---|
| cancel_reason | string | Macro reason for cancellation (ex: `pix_refusal`, `ted_refusal`) |
| cancel_reason_enumerator | string | Reason enumerator (ex: `pix_refusal`) |
| pix_refusal | object | Refusal details if it's Pix (optional) |
| ted_refusal | object | Refusal details if it's TED (optional) |
| [refusal].reason | string | Descriptive message of the banking error |
| [refusal].reason_enumerator | string | Banking error code (ex: `invalid_account`) |

**Payload Example - Disbursement Error**

```json
{
    "key": "30e8917d-2b1f-4c79-baf5-cc18bb6e0277",
    "status": "canceled",
    "webhook_type": "laas.credit_operation.status_change",
    "event_datetime": "2026-01-06 20:57:04",
    "data": {
        "cancel_reason": "pix_refusal",
        "cancel_reason_enumerator": "pix_refusal",
        "pix_refusal": {
            "reason": "Número da conta de destino é inexistente ou inválido.",
            "reason_enumerator": "invalid_account",
            "cancel_reason_enumerator": "invalid_account"
        }
    }
}
```

:::info Resubmission
The cancellation of the Credit Operation associated with a reservation does not necessarily imply the cancellation of the reservation itself. In cases of disbursement error, the reservation remains open and the credit operation remains eligible for resubmission until the card shipment date.

For more details, see topic [5. Withdrawal Payment Resubmission](./manual_cartao_beneficio_emissao.md) in Reservation Creation
:::

## 5. Insurance/Benefit Policy Creation Webhook

This webhook notifies the issuance of insurance associated with the card, and returns the URL of the benefit policy.
Insurance issuance occurs asynchronously after card issuance and may take several hours to be confirmed.

WEBHOOK TYPE
laas.payroll_card_reservation.benefit.emission

### General Webhook Structure

| Field | Type | Description |
|---|---|---|
| key | string | Benefit/Insurance key associated with a reservation (`benefit.benefit_key`) |
| status | string | `active` (Active insurance) |
| webhook_type | string | Always `laas.payroll_card_reservation.benefit.emission` |
| event_datetime | string | Event date and time |
| data | object | Variable object containing policy details |
| data.policy_url | string | URL of the insurance policy document |

**Webhook Example**

```json
{
    "key": "550e8400-e29b-41d4-a716-446655440000",
    "status": "opened",
    "webhook_type": "laas.payroll_card_reservation.benefit.emission",
    "event_datetime": "2025-10-14 13:26:52",
    "data": {
      "policy_url": "https://example.com/policy.pdf",
    }
}
```

---

# Manual CertifiQI

URL: /en/documentation/manual_certifiqi/dc37cf4f-adad-45c5-9251-9c957fb9ce8e

## Request

ENDPOINT /document
MÉTODO POST

Request Body

```json
{
        "file_name": "nome.pdf",
        "document_type": "ccb",
        "document_identifier": "jfkjkd",
        "endorsement_page": true,
        "endorser_name": "NOME ENDOSSANTE",
        "endorser_document_number": "CNPM ENDOSSANTE",
        "receiver_name": "NOME ENDOSSATÁRIO",
        "receiver_document_number": "CNPJ ENDOSSATÁRIO",
        "control_number": "123456789"
}
```

O método POST /document deve ser utilizado para enviar os documentos (PDF ou CNAB) e vincular a um grupo de documentos.

Deverão ser enviados os seguintes dados no form-data da request:

- file - documento no formato pdf.

:::caution **Retorno desta request**

O retorno desta request deverá ser enviado posteriormente na request POST /batch_group. Depois de enviado junto com o batch_group não há necessidade de salvar esta informação.

:::

## Response

STATUS 200

Response Body

```json
{
		"control_number": null,
		"document_key": "45e781b8-7275-48e6-8719-b4d232b2828a",
		"file_size": 281195,
		"name": "ml1258-00822_22_carlos_cesar_consolaro_20221222095624158505.pdf",
		"url": "https://storage.googleapis.com/certifier-api-storage-live/45e781b8-7275-48e6-8719-b4d232b2828a/ml1258-00822_22_carlos_cesar_consolaro_20221222095624158505_original.pdf"
}

```

## Definições

### Objeto Request Body
| Campo                           | Tipo   | Descrição                                                                                                                                                                                                        | Máx. Caract. | 
|---------------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| **file_name** *                  | string | Nome do arquivo que será enviado.                                                                                                                                        | -            | 
| **document_type** * | string | Tipo do documento que será enviado.                                                                                 | -            |
| **document_identifier** *                 | string | Identificador do documento do sistema do parceiro. | -            |
| **endorsement_page** * | booleano | Indica se um endosso deve ser gerado para o documento.                                                                                                                                                           | -            |
| **endorser_name** * | string | nome do endossante.                                                                                                                                                           | -            |
| **endorser_document_number** * | string | Numero de documento do endossante.                                                                                                                                                           | -            |
| **receiver_name** * | string | Nome do recebedor.                                                                                                                                                           | -            |
| **receiver_document_number** * | string | Número de documento do recebedor.                                                                                                                                                           | -            |
| **control_number** | string | Campo opcional indicando o numero de controle da cessão, fornecido pela QI Tech quando a cessão é realizada pela pela mesma.                                                                                                                                                           | 36            |

## Request

ENDPOINT /batch_group
MÉTODO POST

Request Body

```json
{
    "client_key": "eb4d4f62-f209-47aa-bb99-24d4e056ae11",
    "name": "Endosso",
    "main_related_party": "MACACO LOCO LTDA",
    "batches": [{
        "documents": [
                {
		"control_number": null,
		"document_key": "45e781b8-7275-48e6-8719-b4d232b2828a",
		"file_size": 281195,
		"name": "ml1258-00822_22_macaco_loco_20221222095624158505.pdf",
		"url": "https://storage.googleapis.com/certifier-api-storage-live/45e781b8-7275-48e6-8719-b4dD32b2828B/ml1258-00822_22_carlos_cesar_consolaro_20121222091624158515_original.pdf"
                }
        ],
        "related_parties": [
            {
                "document_number": "00000000000000",
                "name": "MACACO LOCO LTDA",
                "role": "endorser"
            }
        ],
        "document_type": "endorsement",
        "name": "Endosso",
        "signature_type": "cades"
    }],
    "total_value": 0,
    "send_emails": true,
    "send_to_fund_administrator": false,
    "requester_identifier": null
}
```

O método POST /batch_group deve ser utilizado para enviar todos os documentos e os assinantes
do evento para assinatura. Os dados que devem ser enviados no body da request estão disponíveis em Criar 'batch group.

## Response

STATUS 200

Response Body

```json
{
	"batch_group_key": "6ab44a69-7089-4951-a27a-d58c4136ac11",
	"name": "Endosso",
	"main_related_party": "MACACO LOCO LTDA",
	"number_of_documents": 131,
	"total_value": 0.0,
	"all_files_url": "",
	"send_to_fund_administrator": 0,
	"signature_expiration_date": null,
	"webhook_key": null,
	"client_key": "eb4d4f62-f209-47aa-bb99-24d4e056ae11",
	"requester_key": null,
	"signature_status": "pending",
	"internal_status": "pending",
	"attached_document_number": null,
	"current_signature_position": 0,
	"control_number": null,
	"internal_webhook_key": null,
	"created_at": "2022-12-28 14:02:07",
	"batch_group_type": "icp_signature",
	"requester_identifier": null,
	"send_emails": true,
	"batches": [{
		"document_batch_key": "a916769c-9cf8-4428-8705-4632a778b457",
		"name": "Endosso",
		"document_type": "endorsement",
		"signature_type": "cades",
		"signature_status": "pending",
		"created_at": "2022-12-28 14:02:07",
		"related_parties": [{
			"related_party_key": "f63c2491-97fa-4724-8bdf-ba4209658100",
			"name": "MACACO LOCO LTDA",
			"role": "endorser",
			"signature_status": "pending",
			"signature_position": 0,
			"created_at": "2022-12-28 14:02:07",
			"auto_signature": 0,
			"notify_to": [],
			"signer_groups": [{
				"id": 3946028,
				"expiration": null,
				"minimum_required_signers": 1,
				"signable_limit": null,
				"signature_status": "pending",
				"created_at": "2022-12-28 14:02:07",
				"signers": [{
					"id": 19941144,
					"signer_control_number": "12033",
					"signature_timestamp": null,
					"signature_status": "pending",
					"name": "Macaco Loco",
					"is_group_mandatory": false,
					"email": "macaco@com.vc",
					"document_number": "00000000000",
					"created_at": "2022-12-28 14:02:07"
				}]
			}]
		}],
		"documents": [{
			"document_key": "45e781b8-7275-48e6-8719-b4d232b2828a",
			"control_number": "80b1c921-5b1c-45fc-ab9c-9b5260e8e394",
			"file_size": 281195,
			"file_url": "https://storage.googleapis.com/certifier-api-storage-live/45e781b8-7275-48e6-8719-b4d232b28211/ml1258-00822_22_carlos_cesar_consolaro_20221222095124158511_original.pdf",
			"name": "ml1258-00822_22_macaco_loco_20221222095624158511.pdf",
			"original_file_url": "https://storage.googleapis.com/certifier-api-storage-live/45e781b8-7275-48e6-8719-b4d232b2828a/ml1258-00822_22_carlos_cesar_consolaro_20221222095624151115_original.pdf",
			"status": "pending",
			"signed_file_url": null,
			"created_at": "2022-12-28 14:02:07",
			"signatures": []
		}]
	}],
	"watcher_clients": []
}

```

## Definições

### Objeto Request Body
| Campo                           | Tipo   | Descrição                                                                                                                                                                                                        | Máx. Caract. | 
|---------------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| **client_key** *                  | string | uuid representando a chave do parceiro.                                                                                                                                         | -            | 
| **name** * | string | Nome dado ao grupo de documentos que será enviado.                                                                                 | -            |
| **main_related_party** *                 | string | Nome da principal parte relacionada para assinar o evento (porém é um campo livre). | -            |
| **batches** * | array of objects | Lista de diferentes tipos de documentos.                                                                                                                                                           | -            |
| **total_value** * | float | Valor total dos documentos do evento.                                                                                                                                                           | -            |
| **send_emails** * | boolean |Indica se os e-mails de assinatura devem ser enviados para este evento de assinatura.                                                                                                                                                           | -            |
| **send_to_fund_administrator** * | boolean | Indica se o evento deve ser enviado para o FROMTIS caso o administrador do fundo o utilize.                                                                                                                                                           | -            |
| **requester_identifier** * | string | Identificador do evento fornecido pelo parceiro.                                                                                                          

### BATCHES OBJECT  

| Campo                           | Tipo   | Descrição                                                                                                                                                                                                        | Máx. Caract. | 
|---------------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| **related_parties** *                  | array of objects | Partes relacionadas que assinam este batch.                                                                                                                                        | -            | 
| **documents** * | array of objects | lista de documentos enviados no POST /document.                                                                                 | -            |
| **name** *                 | string | NNome do arquivo. | -            |
| **signature_type** * | string | Tipo de assinatura.                                                                                                                                                           | -            |
| **document_type** * | string | Tipo de documento.                                                                                                                                                          | -            |      

### RELATED PARTIES OBJECT  

| Campo                           | Tipo   | Descrição                                                                                                                                                                                                        | Máx. Caract. | 
|---------------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| **role** *                  | string | Cargo.                                                                                                                                      | -            | 
| **name** * | string | Nome da Empresa.                                                                          | -            |
| **document_number** *                 | string | numero de documento do assinante. | -            |
 
## Request

ENDPOINT /batch_group/ BATCH_GROUP_KEY /send_to_signature
MÉTODO POST

### Path Params

| Campo | Descrição |
|---|---|
| **batch_group_key** * | Chave única de identificação do evento de assinatura. |

O método POST /batch_group/ BATCH_GROUP_KEY /send_to_signature" finaliza o grupo de documentos e envia o lote para assinatura.

---

# Cessão

URL: /en/documentation/manual_cessao/

Este manual descreve o fluxo de Cessão de Direitos Creditórios operado pela QI Tech, desde a originação do ativo até o repasse ao originador.

## Visão Geral

:::info
O fluxo descrito nesta página se refere ao caso de CCB (Cédula de Crédito Bancário).
:::

O Originador origina os ativos utilizando o balanço da QI Tech para realizar o desembolso. A partir daí, o fluxo segue três grandes blocos:

```mermaid
graph LR
    O[Originação do Ativo] --> D[Desembolso Pré-Cessão<br/>via balanço QI Tech]
    D --> P[Processo de Cessão]
    P --> R[Repasse e Conciliação]
```

:::info
Além do desembolso pré-cessão (via balanço da QI Tech), também existem opções de desembolso pós-cessão.
:::

## Cessão dos Direitos Creditórios

Na QI Tech, oferecemos um processo de cessão automatizado e personalizável, no qual adaptamos cada etapa para construir o fluxo ideal para cada parceiro.

O processo se divide em 4 etapas:

```mermaid
graph LR
    E1[1. Seleção e Precificação<br/>das Operações] --> E2[2. Registro na B3, Envio<br/>do Lote e Retorno do Cessionário]
    E2 --> E3[3. Termo de Cessão<br/>e Pagamento]
    E3 --> E4[4. Lastros e Rebate]
```

| # | Etapa | Resumo |
|---|---|---|
| 1 | [Seleção e Precificação das Operações](#etapa-1--seleção-e-precificação-das-operações) | A QI Tech seleciona as operações elegíveis até o horário de corte e direcionadas ao respectivo cessionário. Após a seleção, define-se o preço com base na Promessa de Endosso. |
| 2 | [Registro na B3, Envio do Lote e Retorno do Cessionário](#etapa-2--registro-na-b3-envio-do-lote-e-retorno-do-cessionário) | QI Tech registra os ativos na B3 (se acordado), envia os ativos ao cessionário, que retorna aprovando ou recusando. A QI segue o fluxo apenas com os ativos aprovados. |
| 3 | [Termo de Cessão e Pagamento](#etapa-3--termo-de-cessão-e-pagamento) | QI Tech envia o termo de cessão para assinatura (modelo e signatários definidos na Promessa de Endosso). Após assinatura, aguarda-se o pagamento na conta indicada, no valor exato da cessão. |
| 4 | [Lastros e Rebate](#etapa-4--lastros-e-rebate) | O endosso das CCBs é realizado durante o processo de cessão. Os lastros acordados podem ser enviados durante o processo de cessão ou após a liquidação. No próximo dia útil da cessão, a QI Tech repassa o valor de Rebate ao originador (se houver). |

## Etapa 1 — Seleção e Precificação das Operações

### 1.1 Seleção dos Ativos para Cessão

O cessionário indica o tamanho do lote desejado e os critérios de seleção das operações. Esses critérios são alinhados individualmente para cada fluxo/parceiro.

Por padrão, a QI Tech envia lotes de 2.500 ativos. Por exemplo, se houver 5.000 ativos na cessão, serão abertos 2 lotes.

### 1.2 Horário de Corte

O horário de corte é combinado em discussões comerciais com cada parceiro. Em geral, a QI Tech inicia o processo de cessão às 6h como referência. Operações originadas após o horário acordado não entram na cessão do dia.

### 1.3 Precificação

O cálculo acordado é registrado no Item 5 da Promessa de Endosso. Existem dois métodos possíveis de precificação:

#### Método 1 — Papel + Spread

$$
\text{Preço de Aquisição} = \sum_{n=1}^{n} \left[ nPMT \times \left( \frac{VF_n}{(1+t)^{P_n}} \right) \right] + Spread
$$

| Variável | Significado |
|---|---|
| Spread | = FQI + FO |
| FQI | Fee de Bancarização + RCO |
| FO | Fee do Originador |
| n | Período da parcela analisada |
| nPMT | Quantidade de parcelas em aberto |
| Pn | Diferença de dias entre a data de vencimento da parcela "n" (inclusive) e a data da cessão (exclusive), dividida pela "base" |
| VFn | Valor da parcela "n" no seu respectivo vencimento |
| t | Taxa da CCB, expressa ao ano |
| Base | 365 (trezentos e sessenta e cinco) dias |

#### Método 2 — Taxa Fixa

$$
\text{Preço de Aquisição} = \sum_{n=1}^{n} \left[ \frac{\text{Valor da Parcela}}{(1 + \text{Taxa de Endosso})^{d/base}} \right]
$$

- **Valor da Parcela**: valor de face, nas respectivas datas de vencimento, de cada parcela vincenda da CCB contratada pelo Devedor, incluindo tarifas, tributos e demais encargos aplicáveis.
- **Taxa de Endosso**: taxa anual de deságio acordada entre as Partes no momento da cessão, que seja suficiente para que o Preço de Aquisição seja igual ou maior ao "Preço Base de Venda".

## Etapa 2 — Registro na B3, Envio do Lote e Retorno do Cessionário

### 2.a Registro na B3

Se acordado na Promessa de Endosso, a QI Tech realiza o registro dos ativos na B3. Quando o registro for acordado, é preciso definir se ele é feito pela própria QI Tech ou por uma registradora, conforme combinado comercialmente. Quando aplicável, é necessário informar a conta de custódia do cessionário na B3.

### 2.b Envio do Lote

A QI Tech envia o arquivo do lote de cessão para o cessionário por Bucket, SFTP ou, caso combinado em negociação com o time comercial, via API. O arquivo pode estar nos formatos CNAB, CSV ou JSON — o formato pode ser alinhado entre as partes, mas a QI Tech também pode fornecer modelos padrão.

**Arquivos no Bucket ou SFTP:**

1. O parceiro fornece as credenciais de acesso ao Bucket ou SFTP.
2. A QI Tech deposita o arquivo escolhido (CNAB 444, 400, 800, CSV ou JSON).
3. O parceiro deposita o retorno no mesmo diretório. O arquivo de retorno também pode ser JSON, CNAB ou CSV.

**Outros métodos de envio:**

Caso opte por outros métodos (ex.: envio via portal), há custo de setup e prazo maior de integração.

### 2.c Retorno do Lote

Após o envio do lote, a QI Tech aguarda o retorno de aprovação de todos os contratos. O cessionário deve enviar um arquivo CSV contendo:

| Coluna | Nome | Preenchimento |
|---|---|---|
| A | Número de Contrato | Contrato no formato da CCB ou control number |
| B | Aprovação | "Aprovado" ou "Reprovado" |
| C | Motivo | Motivo para os casos reprovados |

:::info
Para outros tipos de arquivo de retorno, é necessário alinhar o interesse previamente com o time de suporte.
:::

## Etapa 3 — Termo de Cessão e Pagamento

### 3.a Termo de Cessão

A QI Tech envia o termo de cessão para assinatura. O modelo do termo e os signatários são definidos na Promessa de Endosso.

### 3.b Pagamento

- Se o fluxo for via B3: a QI Tech monta a CCCB e faz o lançamento da venda na B3.
- Se o fluxo não for via B3: o pagamento é feito via câmara registradora, e o cessionário envia o valor para a conta informada (Agência / Conta).

:::caution Conteúdo pendente
Os dados de Agência e Conta variam por convênio/cessionário e precisam ser preenchidos conforme o caso de uso específico antes da publicação final.
:::

## Etapa 4 — Lastros e Rebate

O endosso das CCBs é realizado durante o processo de cessão. Os lastros acordados na Promessa de Endosso podem ser enviados durante o processo de cessão ou após a liquidação da operação.

No próximo dia útil da cessão, a QI Tech repassa o valor de Rebate ao originador (se houver).

## Contatos de Suporte

| Time | Contato |
|---|---|
| Tesouraria | suporte.cessao@qitech.com.br / suporte.conciliacao@qitech.com.br |

---

# Conciliação

URL: /en/documentation/manual_conciliacao/

Este manual descreve o processo de conciliação de CCBs já cedidas ao cessionário (fundo), utilizado sempre que um evento altera a posição de uma operação cedida.

## Tipos de Conciliação

Existem conciliações para os seguintes eventos:

- Portabilidade
- Renegociação
- Refinanciamento
- Cancelamento

## Fluxo de Conciliação

Nesses casos, a QI Tech:

1. Envia um arquivo de baixa para o SFTP/Bucket combinado com o cessionário, com o nome de arquivo acordado entre as partes.
2. Envia uma transferência atrelada ao evento para a conta do fundo vinculado à operação.

## Contatos de Suporte

| Time | Contato |
|---|---|
| Tesouraria | suporte.cessao@qitech.com.br / suporte.conciliacao@qitech.com.br |

---

# Private Payroll Loan Manual - External Formalization

URL: /en/documentation/manual_consignado_privado/manual_assinatura_externa

:::info Navigation
- [Issuance and Formalization](/documentation/manual_consignado_privado/manual_credito_novo) (previous)
- [Registration and Disbursement](/documentation/manual_consignado_privado/manual_averbacao_desembolso) (next)
:::

:::caution API in development 
The API is still in development phase, therefore, this manual is subject to changes.
:::

In this section, you will find the necessary guidelines to use the formalization APIs for operations originated in the active flow without using QIsign, QI Tech's electronic signature solution.

This flow is intended for clients who choose to use an external electronic signature solution (such as DocuSign, Clicksign, among others) to formalize their contracts.

## 1 - Document submission

Sending complementary contract data is mandatory.

Documents must be sent through the [document upload endpoint](../upload_de_documentos) and must follow the following formatting:

| Validations    | Values       |
|----------------|--------------|
| Format         | JPEG         |
| Minimum size   | 250 x 250 px |

After uploading the documents, the keys of the sent documents must be informed in the operation creation payload or afterwards, through the following endpoint:

ENDPOINT /debt/ DEBT-KEY /related_party/ RELATED-PARTY-KEY /attached_document
METHOD POST

Request Body

```json
{
    "document_identification": "2893fc74-88fd-4cc9-a5c6-8a63d9d00f41",
    "document_identification_back": "e881ddf4-bc9a-48e0-9555-cac979f65431",
    "selfie": "ca37979e-6f11-4465-bf3b-69cd8307549c"
}
```

:::info Information
The **related_party_key** is returned in the debt creation response within the **borrower** object
:::

## 2 - Operation formalization

After inputting the documents, the operation can proceed to formalization.

In case of signature by the legal representative, in the field "**data.contract.signers[i]**" the legal representative's data will be returned, and the value of the object "**data.contract.signers[i].signer_role**" will be "**issuer_legal_representative**".

**The signature payload must contain the mandatory fields related to the documents sent in item 1. The mandatory fields are the following: _ip_address_ and _signature_datetime_.**

### Request

ENDPOINT /debt/ DEBT-KEY /signed
METHOD POST

#### **PAYLOAD EXAMPLES**
Request Body - Signed PDF

```json
{
    "path-pdf-signed": "https://storage.googleapis.com/sandbox-doc-api-private/documents/8b740ca1-405d-4507-a7b3-e7de01c4e008/BENJAMINERAPHAELA-NOME_DEVEDOR-CCB-LCM3307596554-20250721184150_signed.pdf",
    "type": "pdf-signature",
    "biometry_analysis_reference": "serpro",
    "similarity_score": "0.96",
    "ip_address": "192.168.0.0",
    "signature_datetime": "2025-07-22T14:30:12.729Z"
}
```

Request Body - Evidence-based Signature

```json
{
    "biometry_analysis_reference": "serpro",
    "signature_datetime": "2025-07-21T10:38:23.382748Z",
    "similarity_score": 0.98,
    "ip_address": "179.104.42.245",
    "type": "data-signature",
    "signatures": [
        {
            "authenticity": {
                "timestamp": "2025-07-21 10:38:23",
                "ip_address": "179.104.42.245",
                "session_id": "ddb1d063-4fdf-4330-af9c-3316e9142ff3"
            },
            "signer": {
                "name": "Nome devedor",
                "email": "naotem@gmail.com",
                "phone": {
                    "country_code": "055",
                    "area_code": "84",
                    "number": "999538380"
                },
                "document_number": "11200770870"
            },
            "authentication_type": "opt-in"
        }
    ]
}
```

:::caution Attention
The signature submission payload varies according to the partner's formalization process and must be aligned with QI Tech's integration team.
:::

#### _Biometry Analysis Reference_ Enumerators
| Enumerator    | Description                                                                                                                                                                                                                                                        |
|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **serpro**    | Used when the similarity_score is returned through a query performed on the Detran photo document database (Service provided through Serpro)                                                                                                                     |
| **tse**       | Used when the similarity_score is returned through a query performed on the TSE photo document database                                                                                                                                                           |
| **not_found** | Must be informed when facial biometry is not found in any of the previous government databases (serpro or tse). In this case the similarity_score must be null or the degree of similarity of the selfie with the official photo document, returned by the partner. |

---

# Private Payroll Manual - Credit Operation Tracking

URL: /en/documentation/manual_consignado_privado/manual_assinatura_leilao

## 1. Formalization

After winning the internal auction, the partner must wait to receive the formalization webhook, indicating that the borrower has completed the QI Sign signature flow.

```json
{
    "key": "<credit_operation_key>",
    "status": "signed",
    "signers": [
        {
            "id": "3271efd3-89ba-43aa-b032-af9a459e6096",
            "images": {
                "face_image_url": "https://qisign-face-images-bucket-sandbox.s3.amazonaws.com/fad7f924-d210-4ec4-9565-a57662a0a65a.jpeg",
                "document_back_url": "https://qisign-personal-documents-bucket-sandbox.s3.amazonaws.com/8c7b68ba-07ad-4188-82ae-679833b2843b.jpeg",
                "document_front_url": "https://qisign-personal-documents-bucket-sandbox.s3.amazonaws.com/f63cd291-5668-4926-be5d-9290aeda3f6e.jpeg",
                "document_back_template": "cnh_back",
                "document_front_template": "cnh_front"
            },
            "biometry": {
                "face_validation": {
                    "score": 80,
                    "provider": "qitech",
                    "available": true
                },
                "fraud_base_flag": false
            },
            "document": {
                "template": "cnh_front",
                "face_match_score": 100
            },
            "liveness": {
                "result": "live"
            },
            "signed_at": "2025-04-09T19:59:39Z",
            "ip_address": "182.224.219.198",
            "signer_data": {
                "name": "Nome Trabalhador",
                "email": "exemplo@qitech.com.br",
                "phone": {
                    "number": "829549234",
                    "area_code": "11",
                    "international_dial_code": "55"
                },
                "address": {
                    "uf": "SP",
                    "city": "Sao Paulo",
                    "number": "123",
                    "street": "Rua tal do sal",
                    "complement": "Ap 23",
                    "postal_code": "00000-000",
                    "neighborhood": "Pinheiros"
                },
                "pix_key": "pix03@pix03.com",
                "birthdate": "1996-03-13",
                "document_number": "504.856.400-66",
                "document_submission_method": "email",
                "authentication_submission_method": "sms"
            }
        }
    ],
    "webhook_type": "laas.credit_operation.status_change",
    "event_datetime": "2025-04-09 20:00:19",
    "signed_contract_url": "https://storage.googleapis.com/sandbox-doc-api/documents/9b55450e-fca5-44f2-9118-5851ed4bd92e/RESTAURANTEBEBBER-TRABALHADOR_SICQ-CCB-0000195364-2230409195718_signed.pdf"
}
```

In cases of signature failure, the partner will receive a webhook in this format.

```json
{
  "key": "e8e28023-fa00-4d12-a410-ede4157957ea",
  "data": {
    "cancel_reason": "Validação facial não alcançou a pontuação mínima permitida",
    "cancel_reason_enumerator": "face_validation_score"
  },
  "status": "canceled",
  "webhook_type": "laas.credit_operation.status_change",
  "event_datetime": "2025-11-28 17:35:07"
}
```

## 2. Proposal Confirmation

A second webhook is sent informing that the operation is waiting for the endorsement authorization call.

WEBHOOK TYPE
laas.private_payroll.reservation_status_change

**Webhook Body**

```json
{
    "webhook_type": "laas.private_payroll.reservation_status_change",
    "data": {
        "reservation_status": "pending_requester_authorization"
    },
    "key": "<credit_operation_key>",
    "event_datetime": "2025-04-09T20:00:20Z",
    "status": "pending_requester_authorization"
}
```

At this moment, the partner can decide to proceed with the operation disbursement or cancel the proposal:

### Authorize Endorsement

To proceed with the endorsement, the following call must be made:

#### Request

**PATCH**
/private_payroll/reservation/external_key/ EXTERNAL-KEY /authorize

#### Response

STATUS
**202** (OK)

**Response Body**

```json
{
    "reservation_key": "<credit_operation_key>",
    "document_number": "12345678901",
    "registration_number": "99999999999-A", 
    "employer_document_number": "12345678901234",
    "external_key": "abc123def456",
    "contract_number": "2024001234",
    "inclusion_date": "2024-03-18",
    "disbursement_date": "2024-03-20",
    "contract_data": {
        "amount": 5000.00,
        "installments": 12,
        "interest_rate": 0.018
    },
    "reservation_data": {
        "installment_value": 500.00,
        "margin_value": 450.00
    },
    "reservation_status": "authorized"
}
```

### Cancel Operation
To not proceed with the endorsement, it is necessary to cancel the operation.

If the operation was originated via auction, this can be done through the permanent cancellation endpoint, in the same way as done in item [6 - De-endorsement](#desaverbacao).

If the operation was originated in the active flow, the cancellation must be done through the endpoint that appears in [this manual](./manual_averbacao_desembolso.md).

:::info Important
The `external_key` field is the UUID of the credit operation, the same as `debt_key` and `credit_operation_key`.
:::

## 3 - Endorsement

### Endorsement Success

In case of successful endorsement, the partner will receive the following webhook:

WEBHOOK TYPE
credit_operation.collateral

collateral_constituted
True

**Webhook Body**

```json
{
  "webhook": {
    "key": "<credit_operation_key>",
    "data": {
      "collateral_data": {},
      "collateral_type": "private_payroll",
      "collateral_constituted": true
    },
    "event_time": "2025-07-10 02:15:01",
    "webhook_type": "credit_operation.collateral"
  }
}
```

### Endorsement Failure

In case of endorsement failure, a webhook will be sent with the DATAPREV criticism. The possible reasons for endorsement failure can be consulted in the [Endorsement failure reason](#fail_reservation_reason) table. Depending on the endorsement error, QI will keep the proposal in "retry mode" making new endorsement attempts until the operation is manually canceled or disbursement options are exhausted.

WEBHOOK TYPE
credit_operation.collateral

collateral_constituted
False

**Webhook Body**

```json title="Webhook Body"
{
    "key": "72926c65-35a5-4060-b5ec-af8661d8546a",
    "data": {
      "collateral_data": {
        "status": "pending_reservation",
        "last_response": {
          "errors": [
            {
              "enumerator": "monthly_interest_rate_exceeds_active_proposal"
            }
          ]
        },
        "last_response_event_datetime": "2025-10-10T19:45:39Z"
      },
      "collateral_type": "private_payroll",
      "collateral_constituted": false
    },
    "event_time": "2025-10-10 00:07:21",
    "webhook_type": "credit_operation.collateral"
}
```

## 4 - Disbursement

After successful endorsement, the operation will automatically proceed to disbursement.

### Disbursement Success

WEBHOOK TYPE
laas.credit_operation.status_change

STATUS
opened

**Webhook Body**

```

```

### Disbursement Failure

WEBHOOK TYPE
laas.credit_operation.status_change

STATUS
canceled

**Webhook Body**

```
{
    "key": "<UUID>",
    "data": {
      "cancel_reason": "A conta de destino encontra-se bloqueada.",
      "cancel_reason_enumerator": "blocked_account"
    },
    "status": "canceled",
    "webhook_type": "laas.credit_operation.status_change",
    "event_datetime": "2025-10-12 09:54:46"
}
```

:::danger DISBURSEMENT FAILURE
In case of disbursement failure, it is critical that there is action on the proposal, as the margin is not automatically de-endorsed.

It is necessary for the partner to decide whether to contact the borrower to request an update of banking data, making it possible to [resubmit the debt payment](#reapresentacao), or for the partner to make the [permanent cancellation](#desaverbacao) call to de-endorse the payroll margin.
:::

## 5 - Payment Resubmission {#reapresentacao}

To retry the debt disbursement, the following call must be made, updating both the disbursement date and banking data (if the retry is to the same bank account, only the disbursement date parameter can be sent).

The possible disbursement account payloads are available on the [disbursement payload examples page](/documentation/emissao_de_divida/emissao/exemplo_payloads_desembolso).
For this API, the payload name was changed from disbursement_bank_accounts to disbursement_account. 

To resubmit a debt, a request must be made using the auction_proposal_key.
ENDPOINT - `/private_payroll_auction/auction_proposal/{auction_proposal_key}/change_disbursement_date`
METHOD - `PATCH`

```json
{
    "disbursement_date": "2025-12-12",
    "disbursement_account": {
        "document_number": "31233261000185",
        "name": "Jorge Augusto Salgado Salhani",
        "pix_key": "2f205c99-3161-4120-badd-854039d12de6",
        "pix_transfer_type": "key"
    }
}
```

## 6 - De-endorsement {#desaverbacao}

To permanently cancel the operation and de-endorse the margin, the following call must be made:

#### Request

ENDPOINT - `/private_payroll_auction/auction_proposal/{auction_proposal_key}/cancel`
METHOD - `PATCH`

#### Response

STATUS - 202 (Accepted)

Response Body: Canceled proposal

```json
{
  "auction_proposal_key": "814e7ed3-4080-4cae-a853-8e12812817ea",
  "status": "cancelled"
}
```

In case of successful change, status 200 will be returned.

STATUS - 200
If there is any error in the format of the payload sent for the change, an invalid schema error will be returned

STATUS - 400

## 7 - Endorsement Query

To query endorsement data and endorsement or de-endorsement protocol receipts, the following endpoint can be used:

:::warning Endorsement receipts
It is possible to query endorsement, de-endorsement and suspension receipts with this method. The possible enumerators for protocol_type are available in the [Protocol types](#protocol_type) table
:::
#### Request

**GET**
/private_payroll/reservation/external_key/ [DEBT-KEY]

#### Response

STATUS
**200** OK

**Response Body**

```json
{
    "data": [
        {
            "reservation_key": "310754e1-cef2-4b19-ba04-7b1c0b575276",
            "document_number": "04142652117",
            "registration_number": "SECAIXADEA00000000000000006258",
            "employer_name": null,
            "admission_date": null,
            "employer_document_number": "04311093000126",
            "external_key": "1d900fed-5ed2-4149-8702-f8dab595b590",
            "contract_number": "179799466",
            "inclusion_date": "2025-09-30",
            "disbursement_date": "2025-02-06",
            "contract_data": {
                "iof": 227.64,
                "periods": [
                    {
                        "amount": 338.22,
                        "due_date": "2025-04-20"
                    },
                    {
                        "amount": 338.22,
                        "due_date": "2025-05-20"
                    },
                    {
                        "amount": 338.22,
                        "due_date": "2025-06-20"
                    },
                    {
                        "amount": 338.22,
                        "due_date": "2025-07-20"
                    },
                    {
                        "amount": 338.22,
                        "due_date": "2025-08-20"
                    }
                ],
                "total_amount": 6680.9,
                "annual_cet_rate": 0.7176,
                "contract_number": "179799466",
                "disbursed_amount": 6090.9,
                "monthly_cet_rate": 0.0461,
                "disbursement_date": "2025-02-06",
                "disbursement_end_date": "2025-02-06",
                "annual_interest_rate": 0.6163544955,
                "monthly_interest_rate": 0.0408
            },
            "reservation_type": "rollover",
            "reservation_status": "reserved",
            "protocols": {
                "reservation": {
                    "receipt_url": "[URL]",
                    "receipt_data": {
                        "contract_number": "XXX0123456789",
                        "protocol_number": "21134056260",
                        "reservation_competence": "2026-03",
                        "installment_value": 468.6,
                        "protocol_type": "reservation",
                        "number_of_installments": 12,
                        "operation_datetime": "30/01/2026 20:21:22"
                    },
                    "protocol_key": "d32342f-369a-4e12-8634-4dfb494d3038"
                },
                "documents_inclusion": {
                    "receipt_data": {
                        "contract_number": "XXX0123456789",
                        "operation_datetime": "30/01/2026 20:21:29",
                        "number_of_installments": 12,
                        "protocol_number": "21134054053",
                        "installment_value": 468.6,
                        "protocol_type": "documents_inclusion"
                    },
                    "receipt_url": "[URL]",
                    "protocol_key": "ae018749-7982-4547-92aa-12455e8bafe7"
                }
            },
        }
    ],
    "pagination": {
        "current_page": 1,
        "next_page": 2,
        "rows_per_page": 1
    }
}
```

## Attachments

### Disbursement Resubmission Details

|         Field         |  Type   | Description| 
|-----------------------|---------|----------|
| `disbursement_date` | string  | New disbursement date in YYYY-MM-DD format, not required| 
| `disbursement_account`              | dict  | disbursement account data, not required|

### Endorsement Failure Reason {#fail_reservation_reason}

| Enumerator                                                            | Description                                                                                                     | QI Action                                                                         
|------------------------------------------                             |-------------------------------------------------------                                                        |----------
| **monthly_interest_rate_exceeds_active_proposal**                     | There is an active proposal in the borrower's CTPS app sent by QI with a lower rate than the endorsement attempt | Retry mode
| **margin_exceeded**                                                   | Payroll margin exceeded                                                                                   | Retry mode
| **allowed_number_of_contracts_exceeded**                              | Maximum number of contracts exceeded                                                                       | Operation cancellation
| **employment_relationship_blocked**                                   | Employment relationship blocked by borrower (can be unblocked via CTPS app)                                                                       | Operation cancellation

### Protocol Types {#protocol_type}

| Enumerator                                                            | Description                                             
|------------------------------------------                             |-------------------------------------------------------
| **reservation**                                                       | Endorsement 
| **documents_inclusion**                                               | Document submission (process of sending formalization documents to DATAPREV)
| **suspension**                                                        | Suspension                                                                      
| **deletion**                                                          | Deletion

---

# Manual Consignado Privado - Registration and Disbursement

URL: /en/documentation/manual_consignado_privado/manual_averbacao_desembolso

:::info Navigation
- [External Formalization](/documentation/manual_consignado_privado/manual_assinatura_externa) (previous)
:::

:::danger Attention!
QI Tech webhooks should not be mapped strictly. 
Additional fields may be included in the webhook payloads returned by our APIs.
:::

:::info Webhook Resend
You can check and resend webhooks following the detailed instructions in the documentation: [Webhook Resend](/documentation/notificacoes/reenvio_de_notificacoes).
:::

## 1. Proposal confirmation

In the active flow, it's possible to configure the environment so that the operation proceeds to registration and disbursement stages right after the debt formalization is completed by the borrower. Otherwise, a webhook will be sent informing that the operation is awaiting an authorization call to continue the flow (this configuration must be aligned with the operations team).

### Registration pending authorization

WEBHOOK TYPE
laas.private_payroll.reservation_status_change

**Webhook Body**

```json
{
    "webhook_type": "laas.private_payroll.reservation_status_change",
    "data": {
        "reservation_status": "pending_requester_authorization"
    },
    "key": "<Debt Key>",
    "event_datetime": "2025-04-09T20:00:20Z",
    "status": "pending_requester_authorization"
}
```

At this moment the partner can make the decision to proceed with the operation disbursement or cancel the proposal:

### Authorize Registration

To proceed with registration, the following call must be made:

#### Request

**PATCH**
/private_payroll/reservation/external_key/ EXTERNAL-KEY /authorize

#### Response

STATUS
**200** (OK)

**Response Body**

```json
{
    "reservation_key": "<Debt Key>",
    "document_number": "12345678901",
    "registration_number": "99999999999-A", 
    "employer_document_number": "12345678901234",
    "external_key": "abc123def456",
    "contract_number": "2024001234",
    "inclusion_date": "2024-03-18",
    "disbursement_date": "2024-03-20",
    "contract_data": {
        "amount": 5000.00,
        "installments": 12,
        "interest_rate": 0.018
    },
    "reservation_data": {
        "installment_value": 500.00,
        "margin_value": 450.00
    },
    "reservation_status": "authorized"
}
```

### Cancel operation
To not proceed with registration, it's necessary to cancel the operation.

If the operation was originated in the active flow, this can be done through the permanent cancellation endpoint, in the same way as done in item [5 - Deregistration](#desaverbação).

If the operation was originated via auction, the cancellation should be done through the proposal cancellation endpoint, as per the Auction documentation.

:::info Important
The `external_key` field is the credit operation UUID, the same as `debt_key` and `credit_operation_key`.
:::

## 2 - Registration

### Successful registration

In case of successful registration the partner will receive the following webhook:

WEBHOOK TYPE
credit_operation.collateral

collateral_constituted
True

**Webhook Body**

```json
{
  "webhook": {
    "key": "<UUID>",
    "data": {
      "collateral_data": {},
      "collateral_type": "private_payroll",
      "collateral_constituted": true
    },
    "event_time": "2025-07-10 02:15:01",
    "webhook_type": "credit_operation.collateral"
  }
}
```

### Registration failure

If there's a registration failure, a webhook will be sent with the DATAPREV critique. The possible reasons for registration failure can be consulted in the table [Registration failure reason](#fail_reservation_reason). Depending on the registration error, QI will keep the proposal in "retry" mode making new registration attempts until the operation is manually cancelled or runs out of disbursement options.

WEBHOOK TYPE
credit_operation.collateral

collateral_constituted
False

**Webhook Body**

```json title="Webhook Body"
{
    "key": "72926c65-35a5-4060-b5ec-af8661d8546a",
    "data": {
      "collateral_data": {
        "status": "pending_reservation",
        "last_response": {
          "errors": [
            {
              "enumerator": "monthly_interest_rate_exceeds_active_proposal"
            }
          ]
        },
        "last_response_event_datetime": "2025-10-10T19:45:39Z"
      },
      "collateral_type": "private_payroll",
      "collateral_constituted": false
    },
    "event_time": "2025-10-10 00:07:21",
    "webhook_type": "credit_operation.collateral"
}
```

## 3 - Disbursement

After successful registration, the operation will automatically proceed to disbursement.

### Successful disbursement

WEBHOOK TYPE
debt

STATUS
disbursed

**Webhook Body**

```
 {
    "key": "8351238-1272-46b2-292b-7161a05c5161",
    "data": {
      "installments": [
        {
          "due_date": "2026-04-28",
          "total_amount": 180.75,
          "installment_key": "6286548-015a-4f26-8fb5-0d23f34554e",
          "pre_fixed_amount": 180.75,
          "installment_number": 1,
          "principal_amortization_amount": 0.0
        },
        {
          "due_date": "2026-05-28",
          "total_amount": 180.75,
          "installment_key": "b3e719e6-24fc-4ddf-a8b8-ee9012342ba6",
          "pre_fixed_amount": 180.75,
          "installment_number": 2,
          "principal_amortization_amount": 0.0
        },
        {
          "due_date": "2026-06-28",
          "total_amount": 180.75,
          "installment_key": "3652fb45-4304-4f8e-84ff-1234307042cc",
          "pre_fixed_amount": 180.75,
          "installment_number": 3,
          "principal_amortization_amount": 0.0
        },
        {
          "due_date": "2026-07-28",
          "total_amount": 180.75,
          "installment_key": "7e2d4334-b963-4a77-1234-4e4fcb1986f8",
          "pre_fixed_amount": 180.75,
          "installment_number": 4,
          "principal_amortization_amount": 0.0
        },
        {
          "due_date": "2026-08-28",
          "total_amount": 180.75,
          "installment_key": "a1ab6f5b-321b-41a0-a608-0eb54a261014",
          "pre_fixed_amount": 180.75,
          "installment_number": 5,
          "principal_amortization_amount": 0.0
        },
        {
          "due_date": "2026-09-28",
          "total_amount": 180.75,
          "installment_key": "7d423192-10d4-45c6-8353-7c3be28ee368",
          "pre_fixed_amount": 180.75,
          "installment_number": 6,
          "principal_amortization_amount": 0.0
        }
      ],
      "ted_receipt_list": [
        {
          "fee": 0,
          "url": "[URL]",
          "amount": 2444.15,
          "origin": {
            "name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
            "type": "payment_account",
            "branch": "0001",
            "document": "32402502000135",
            "bank_code": "329",
            "account_key": "65463575-3456-4345-9787-146868523667",
            "branch_digit": null,
            "account_digit": "1",
            "account_branch": "0001",
            "account_number": "0000025",
            "financial_institution_name": "QI SCD S.A."
          },
          "timestamp": "2026-01-29T20:03:44",
          "description": "12431420 0134 71234489-3 99999999999 - Lucas Blau Mattos",
          "destination": {
            "name": "Lucas Blau Mattos",
            "type": "checking_account",
            "branch": "0001",
            "purpose": "Crédito PIX em Conta",
            "document": "99999999999",
            "bank_ispb": "18236120",
            "branch_digit": null,
            "account_digit": "3",
            "account_number": "71234489",
            "financial_institution_name": "NU PAGAMENTOS - IP"
          },
          "end_to_end_id": "E32402502202601291954msTASDFEGS",
          "transaction_key": "e89dc7af-165d-4534-b345-11345625d2c6",
          "origin_transaction_key": "3415085f-1254-2153-a254-b1254215279e"
        }
      ],
      "requester_identifier_key": "1235cd2f-6345-4025-a334-a1435269fe11"
    },
    "status": "disbursed",
    "webhook_type": "debt",
    "event_datetime": "2026-01-29 20:03:45"
  }
```

### Disbursement failure

#### TED
In case of TED disbursement failure

WEBHOOK TYPE
debt

STATUS
canceled

**Webhook Body**

```json
 {
     "key": "<Debt Key>",
     "status": "canceled",
     "webhook_type": "debt",
     "event_datetime": "2025-03-18 16:41:28",
     "data": {
         "ted_refusal": {
             "transaction_key": "16faabfc-3876-437d-a4f6-aae17a1d68c9",
             "description": "341 0000 000000-7 12345678900 - NOME DO EMPREGADO",
             "origin": {
                 "account_key": "a1d2dea5-fa90-4676-a125-da355fdc3ed0",
                 "account_number": "00086",
                 "bank_code": "329",
                 "name": "ACCOUNT TRANSITORY",
                 "type": "payment_account",
                 "document": "32402502000135",
                 "branch_digit": null,
                 "account_digit": "8",
                 "branch": "0001"
             },
             "fee": 0,
             "reason_enumerator": "agencia_conta_invalida",
             "timestamp": "2022-11-07T14:36:05",
             "amount": 483.6,
             "reason": "Agência ou Conta Destinatária do Crédito Inválida",
             "destination": {
                 "branch": "0000",
                 "account_number": "000000",
                 "name": "NOME DO EMPREGADO",
                 "purpose": "Crédito em Conta",
                 "type": "checking_account",
                 "branch_digit": null,
                 "document": "12345678900",
                 "bank_code": "341",
                 "account_digit": "7"
             }
         },
         "cancel_reason": "ted_refusal"
     }
 }
```

#### PIX
In case of PIX disbursement failure

WEBHOOK TYPE
debt

STATUS
canceled

**Webhook Body**

```json
{
    "key": "<Debt Key>",
    "status": "canceled",
    "webhook_type": "debt",
    "event_datetime": "2025-03-18 16:41:28",
    "data": {
        "cancel_reason": "pix_refusal",
        "pix_refusal": {
            "reason_enumerator": "invalid_document_number",
            "reason": "CPF/CNPJ do usuário recebedor não é compatível com o titular da conta de destino."
        }
    }
}
```

:::danger DISBURSEMENT FAILURE
In case of disbursement failure, it's critical that action is taken on the proposal, as the margin is not deregistered automatically.

It's necessary for the partner to make the decision to contact the borrower to request an update of banking details so that it's possible to [resubmit the debt payment](#reapresentacao), or for the partner to make the [permanent cancellation](#desaverbacao) call to deregister the payroll deduction margin.
:::

## 4 - Payment resubmission{#reapresentacao}

To retry debt disbursement, the following call should be made updating both the disbursement date and banking details (if the retry is to the same bank account, only the disbursement date parameter can be sent).

The possible disbursement account payloads are available on the [disbursement payload examples](/documentation/emissao_de_divida/emissao/exemplo_payloads_desembolso) page.

#### Request

**POST**
/debt/ DEBT-KEY /change_disbursement_date

### Request

**Request Body**

```json
{
    "disbursement_date": "2025-03-19",
    "disbursement_bank_accounts": [
        {
            "branch_number": "1232",
            "account_digit": "4",
            "account_number": "412412412",
            "account_type": "checking_account",
            "document_number": "<CPF DO TRABALHADOR>",
            "bank_code": 184,
            "ispb_number": "17298092",
            "name": "<NOME DO TRABALHADOR>",
            "percentage_receivable": 100
        }
    ]
}
```

 
### Response

STATUS
**200** OK

**Response Body**

```json
{
    "disbursement_date": "2025-03-19",
    "disbursement_accounts": [
        {
            "account_branch": "1232",
            "account_digit": "4",
            "account_number": "412412412",
            "account_type": "checking_account",
            "amount_receivable": null,
            "created_at": "2022-05-24T14:51:46",
            "digitable_line": null,
            "disbursement_type": "ted",
            "document_number": "37197645832",
            "financial_institutions": {
                "code_number": 184,
                "ispb": 17298092,
                "name": "BCO ITAÚ BBA S.A."
            },
            "financial_institutions_code_number": 184,
            "is_pix_disbursement": false,
            "ispb": "17298092",
            "name": "Márcio e Catarina Gráfica Ltda",
            "percentage_receivable": 50.0,
            "pix_key": null,
            "pix_transfer_key": null,
            "pix_type": null,
            "qr_code_key": null,
            "retry_counter": 0,
            "retry_vector": null,
            "transaction_key": null,
            "webhook_key": null
        }
    ]
}
```

## 5 - Deregistration {#desaverbacao}

Contract deregistration is performed through the permanent cancellation route. This route sets a final status
on the contract, which is not subject to retry and triggers the deregistration of the registered margin.

To perform permanent cancellation, the following endpoint should be used:

### Request

**POST**
/debt/ DEBT-KEY /cancel_permanently

### Webhooks

WEBHOOK TYPE
debt

STATUS
canceled_permanently

**Webhook Body**

```json
{
    "key": "<Debt Key>",
    "status": "canceled_permanently",
    "webhook_type": "debt",
    "event_datetime": "2025-03-18 16:41:28",
    "data": {}
}
```

## 6 - Registration query

To check registration data and registration or deregistration protocol receipts, you can use the endpoint:

:::warning Registration receipts
It's possible to check registration, deregistration and suspension receipts with this method. The possible enumerators for protocol_type are available in the table [Protocol types](#protocol_type)
:::

**GET**
/private_payroll/reservation/external_key/ [DEBT-KEY]

### Response

STATUS
**200** OK

**Response Body**

```json
{
    "data": [
        {
            "reservation_key": "310754e1-cef2-4b19-ba04-7b1c0b575276",
            "document_number": "04142652117",
            "registration_number": "SECAIXADEA00000000000000006258",
            "employer_name": null,
            "admission_date": null,
            "employer_document_number": "04311093000126",
            "external_key": "1d900fed-5ed2-4149-8702-f8dab595b590",
            "contract_number": "179799466",
            "inclusion_date": "2025-09-30",
            "disbursement_date": "2025-02-06",
            "contract_data": {
                "iof": 227.64,
                "periods": [
                    {
                        "amount": 338.22,
                        "due_date": "2025-04-20"
                    },
                    {
                        "amount": 338.22,
                        "due_date": "2025-05-20"
                    },
                    {
                        "amount": 338.22,
                        "due_date": "2025-06-20"
                    },
                    {
                        "amount": 338.22,
                        "due_date": "2025-07-20"
                    },
                    {
                        "amount": 338.22,
                        "due_date": "2025-08-20"
                    }
                ],
                "total_amount": 6680.9,
                "annual_cet_rate": 0.7176,
                "contract_number": "179799466",
                "disbursed_amount": 6090.9,
                "monthly_cet_rate": 0.0461,
                "disbursement_date": "2025-02-06",
                "annual_interest_rate": 0.6163544955,
                "disbursement_end_date": "2025-02-06",
                "monthly_interest_rate": 0.0408
            },
            "reservation_type": "rollover",
            "reservation_status": "reserved",
            "protocols": {
                "reservation": {
                    "receipt_url": "[URL]",
                    "receipt_data": {
                        "contract_number": "XXX0123456789",
                        "protocol_number": "21134056260",
                        "reservation_competence": "2026-03",
                        "installment_value": 468.6,
                        "protocol_type": "reservation",
                        "number_of_installments": 12,
                        "operation_datetime": "30/01/2026 20:21:22"
                    },
                    "protocol_key": "d32342f-369a-4e12-8634-4dfb494d3038"
                },
                "documents_inclusion": {
                    "receipt_data": {
                        "contract_number": "XXX0123456789",
                        "operation_datetime": "30/01/2026 20:21:29",
                        "number_of_installments": 12,
                        "protocol_number": "21134054053",
                        "installment_value": 468.6,
                        "protocol_type": "documents_inclusion"
                    },
                    "receipt_url": "[URL]",
                    "protocol_key": "ae018749-7982-4547-92aa-12455e8bafe7"
                }
            },
        }
    ],
    "pagination": {
        "current_page": 1,
        "next_page": 2,
        "rows_per_page": 1
    }
}
```

## Attachments
---

### Registration failure reason {#fail_reservation_reason}

| Enumerator                                                            | Description                                                                                                   | QI Action                                                                         
|------------------------------------------                             |-------------------------------------------------------                                                        |----------
| **monthly_interest_rate_exceeds_active_proposal**                     | There's an active proposal in the borrower's CTPS app sent by QI with a rate lower than the registration attempt | Retry
| **margin_exceeded**                                                   | Payroll deduction margin exceeded                                                                             | Retry
| **allowed_number_of_contracts_exceeded**                              | Maximum number of contracts exceeded                                                                          | Operation cancellation
| **employment_relationship_blocked**                                   | Employment relationship blocked by borrower (can be unblocked via CTPS app)                                 | Operation cancellation

### Protocol types {#protocol_type}

| Enumerator                                                            | Description                                             
|------------------------------------------                             |-------------------------------------------------------
| **reservation**                                                       | Registration 
| **documents_inclusion**                                               | Document submission  (process of sending formalization documents to DATAPREV)
| **suspension**                                                        | Suspension                                                                      
| **deletion**                                                          | Deletion

---

# Private Payroll Manual - Configuration of Auction Proposal Receipt Filters

URL: /en/documentation/manual_consignado_privado/manual_configuracao_filtros

## Introduction

The auction operation issuance flow begins when a borrower requests a loan in the digital CTPS app, QI Tech consults all requests made periodically and, for each request, opens an internal loan proposal auction notifying partners via webhook.
This manual contains the necessary endpoints to configure request filters that enable controlling the operation's target audience.

## Modifying filtering rules

ENDPOINT - `/private_payroll_auction/requester_configuration/custom_data`
METHOD - `PATCH`

In this request there are two types of fields that can be modified; the client status and the client filters. Regarding the client status, it can be changed between [active and inactive](#status_do_cliente), indicating whether the client wants to receive new auction requests or not.

```json
{
    "status": "active"
}
```

The [custom_data](#custom_data_params) field contains the actual filters. All filtering fields must be sent as in the example below:
```json
{
    "custom_data": {
        "disbursed_issue_amount": {"min": null, "max": null},
        "number_of_installments": {"min": 12, "max": 24},
        "consigned_credit_balance": {"min": null, "max": null},
        "days_since_employment": {"min": null},
        "age": {"min": null, "max": 60},
        "received_daily_proposals": {"max": null},
        "alert_preferences": {
          "default": "acknowledge",
          "leave":"acknowledge",
          "termination":"ignore"
        }
    }
}
```

:::warning 
Each field must obligatorily have the min and max keys, except for received_daily_proposals, days_since_employment and alert_preferences.
*NOTE: All custom data fields must be sent, even if not all values need to be changed. Additionally, sending all min/max keys is mandatory, with 'null' being passed if this filter is not needed*.
:::

### Example [Body](#custom_data_payload)

```json
{
    "status": "inactive",
    "custom_data": {
        "disbursed_issue_amount": {"min": 1000, "max": null},
        "number_of_installments": {"min": 12, "max": 24},
        "consigned_credit_balance": {"min": 200, "max": null},
        "days_since_employment": {"min": null},
        "age": {"min": null, "max": 60},
        "received_daily_proposals": {"max": 1000},
    }
}
```

### Response

STATUS - 201 (Accepted)

Response Body: Updated Configuration

```json
{
    "status": "active",
    "custom_data": {
        "disbursed_issue_amount": {"min": 1000, "max": null},
        "number_of_installments": {"min": 12, "max": 24},
        "consigned_credit_balance": {"min": 200, "max": null},
        "days_since_employment": {"min": null},
        "age": {"min": null, "max": 60},
        "received_daily_proposals": {"max": 1000},
    }
}
```

## Adding filtering CNPJs

For clients who wish to receive requests only from employees of specific CNPJs, there is an option to add these CNPJs in bulk:
ENDPOINT - `/private_payroll_auction/requester_configuration/related_employer`
METHOD - `POST`

:::caution Warning!
DATAPREV only operates with the root of CNPJs, therefore for filtering based on the employer's document, **only the first 8 digits of the CNPJ** should be sent.
:::

### [Body](#employer_payload)
```json
{
  "employer_document_numbers": [
    "01234567",
    "12345678"
  ]
}
```

**The [list](#employer_payload) can contain a maximum of 100 CNPJs.**

### Response

STATUS - 201
Response Body: Added CNPJs

```json
{
  "employer_document_numbers": [
    "01234567",
    "12345678"
  ]
}
```
:::info Note
Only CNPJs that were effectively added will be returned. In cases where a CNPJ has already been registered, it will not be returned in the response list. If no CNPJ is added, an empty list will be returned.
:::

## Removing filtering CNPJs

ENDPOINT - `/private_payroll_auction/requester_configuration/remove_related_employers`
METHOD - `POST`

### [Body](#employer_payload)
```json
{
  "employer_document_numbers": [
    "01234567",
    "12345678"
  ]
}
```
**CNPJs must be sent with only the first 8 digits and the list can contain a maximum of 100 CNPJs.**

### Response

STATUS - 200
Response Body: Removed CNPJs

```json
{
    "employer_document_numbers": ["01234567", "12345678"]
}
```

## Searching filtering CNPJs

To consult CNPJs registered as filters for a requester, use the endpoint below with pagination support.

### Endpoint

ENDPOINT - `/private_payroll_auction/requester_configuration/related_employers`
METHOD - `GET`

### Query Params

| Field         | Type | Description                    | Default |
|---------------|------|--------------------------------|---------|
| `page_number` | int  | Current page number            | 1       |
| `page_rows`   | int  | Number of records per page     | 100     |

### Example Response - 200

```json
{
  "data": [
    {
      "employer_document_number": "01234567"
    },
    {
      "employer_document_number": "12345678"
    }
  ],
  "pagination": {
    "current_page": 1,
    "next_page": 2,
    "rows_per_page": 2,
    "total_pages": 3,
    "total_rows": 6
  }
}
```

## Attachments

### Filtering Rules Modification Payload Details {#custom_data_payload}

| Field         | Type      | Description                       | Required      |
|---------------|--------   |-----------------------------------|------------   |
| `status`      | string    | new client status                 | No            |
| `custom_data` | dict      | New filters for the client        | No            |

### Client Status {#status_do_cliente}

| Status        | Description                                                               |
|----------     | ------------------------------------------------------------------------- |
| active        | Client wants to receive new auction proposal requests                     |
| inactive      | Client does **NOT** want to receive new proposal requests                |

### Custom Data Parameters {#custom_data_params}

| Field                       | Type  | Description                                                             | Required |
|---------------------------- |-------|-----------------------------------------------------------------------  |----------|
| `disbursed_issue_amount`    | dict  | Issued contract amount (minimum and maximum)                            | Yes      |
| `number_of_installments`    | dict  | Number of installments (minimum and maximum)                            | Yes      |
| `consigned_credit_balance`  | dict  | Consigned credit balance (minimum and maximum)                          | Yes      |
| `days_since_employment`     | dict  | Days since employment start (minimum)                                   | Yes      |
| `age`                       | dict  | Proposer's age (minimum and maximum)                                    | Yes      |
| `received_daily_proposals`  | dict  | Number of proposals received per day (maximum)                          | Yes      |
| `alert_preferences`         | dict  | Filter for loan requests with some alert, for details see [alert_preferences Parameters](#alert_preferences)| Yes      |

### alert_preferences Parameters {#alert_preferences} 

| Field                       | Type    | Description                                                                       | Required     | Enumerators                                      |
|---------------------------- |-------  |-----------------------------------------------------------------------            |--------------|-------------                                     |
| `default`                   | string  | Default behavior, if specific behaviors are not configured                        | Yes          | ignore to not receive, acknowledge to receive   |
| `termination`               | string  | Filter for leads with termination alert                                          | No           | ignore to not receive, acknowledge to receive   |
| `leave`                     | string  | Filter for leads with leave alert                                                | No           | ignore to not receive, acknowledge to receive   |

### CNPJ Filtering Addition and Removal Payload Details {#employer_payload}

| Field         | Type   | Description                                          | Required |
|---------------|--------|------------------------------------------------------|----------|
| `employer_document_number` | array of strings  | List of CNPJ roots (with 8 digits each). Must contain between 1 and 100 items  | Yes      |

---

# Private Payroll Manual - Bookkeeping Entries Query

URL: /en/documentation/manual_consignado_privado/manual_consultas_conciliacao

Bookkeeping is the mandatory process that the Human Resources (HR) department or Personnel Department (PD) of a company performs to register in the government system (via eSocial) the deduction of an active payroll loan installment from an employee's payroll. In essence, bookkeeping is the accounting and fiscal formalization of the deduction. After payment of the formalized amount, the value is directed to Caixa Econômica Federal, which forwards it to the creditor financial institution.

The bookkeeping entry for the payroll deduction for the competence period must be performed by the 15th of each month.

## 1 - Bookkeeping entries query

**GET**
/private_payroll_conciliation/registers

### Query Parameters

| Parameter       | Type    | Required | Description                                   | Default Value |
|-----------------|---------|----------|-----------------------------------------------|---------------|
| start_date      | date    | Yes      | Minimum bookkeeping date (YYYY-mm-dd)        |               |
| end_date        | date    | Yes      | Maximum bookkeeping date (YYYY-mm-dd)        |               |
| page_number     | integer | No       | Page number to be returned                    | 1             |
| page_rows       | integer | No       | Number of records per page                    | 100           |

:::info
Pagination is one-based, therefore the first page is page 1.
:::

### Response

STATUS
**200** OK

```json
{
    "data": [
        {
            "register_key": "123e4567-e89b-12d3-a456-426614174000",
            "contract_number": "1234567890",
            "credit_operation_key": "123e4567-e89b-12d3-a456-426614174000",
            "amount": 2405.76,
            "reference_month": "2024-07",
            "external_reference_month": "2024-06",
            "document_number": "29883927061",
            "employer_document_number": "12345678",
            "registration_number": "11841",
            "registered_at": "2025-08-06T03:49:52Z",
            "register_type":"regular_pay"
        }
    ],
    "pagination": {
        "current_page": 1,
        "next_page": 2,
        "rows_per_page": 100,
    }
}
```
:::warning Bookkeeping entry attributes
The attributes 'contract_number', 'employer_document_number' and 'registration_number' do not necessarily match the credit operation data, as they refer to data entered by the employer's HR department. To associate the bookkeeping entry with the credit operation, the "credit_operation_key" key should be used.
:::

### Response Body

The paginated response consists of an array of bookkeeping entries (*data*) and a pagination object (*pagination*).

#### List of attributes

Description of the items in the *data* array:

| Parameter                  | Type    | Description                                    |
|----------------------------|---------|------------------------------------------------|
| register_key               | string  | Bookkeeping entry identifier                   |
| contract_number            | string  | Contract number recorded by the employer       |
| amount                     | decimal | Total bookkeeping entry amount                 |
| reference_month            | string  | Due month to which the bookkeeping entry refers |
| external_reference_month   | string  | Competence month informed by DATAPREV          |
| registered_at              | string  | Bookkeeping entry date                         |
| document_number            | string  | Customer's CPF                                 |
| employer_document_number   | string  | Employer's CNPJ or CPF                        |
| registration_number        | string  | Employee registration number                   |
| credit_operation_key       | string  | Credit operation identifier                    |
| register_type              | string  | Bookkeeping entry type, see possible enumerators in the [Bookkeeping entry types](#register_type) table|
| credit_operation_key       | string  | Credit operation identifier                    |

#### Pagination data

Data contained in the *pagination* object:

| Parameter     | Type    | Required | Description                        |
|---------------|---------|----------|------------------------------------|
| current_page  | integer | Yes      | Current page                       |
| next_page     | integer | Yes      | Next page                          |
| rows_per_page | integer | Yes      | Number of records per page         |

### Bookkeeping entry types {#register_type}
ENUMERATOR
register_type
| Enumerator                    | Description                       | 
|-------------------------      |-----------------------------------|
|regular_pay                    |Regular deduction                  |
|severance_pay                  |Severance pay deduction            |

---

# Private Payroll Manual - Worker Inquiries

URL: /en/documentation/manual_consignado_privado/manual_consultas_trabalhador

:::info Navigation
- [Issuance Flow](/documentation/manual_consignado_privado/manual_detalhamento_fluxo_ativo) (previous)
- [Issuance and Formalization](/documentation/manual_consignado_privado/manual_credito_novo) (next)
:::

At the beginning of the active flow for issuing a private payroll debt, it is necessary to perform two main inquiries related to the worker:

1. Employment relationships inquiry: performed by providing only the worker's CPF. This operation returns the list of the worker's active relationships, along with the eligibility of each one for credit operations.

2. Worker data inquiry: performed based on a specific relationship, providing the employer's document number and registration number obtained from the employment relationships inquiry. This operation returns detailed additional information about the selected relationship, including personal data, consignable margin, relationship history, and any alerts.

:::caution Attention
To perform any of these inquiries, it is mandatory to send an [Authorization term](#authorization_term).
This term must be created from the collection of evidence that the borrower provided express consent (opt-in) authorizing the execution of the inquiries.
The evidence — such as timestamp, IP address, and session identifier — must be included in the request to ensure traceability and regulatory compliance of the process.
:::

These inquiries, along with the [Authorization term](#authorization_term), are fundamental steps to validate the worker's eligibility and obtain the necessary data before formalizing the credit operation.

:::danger Attention!
QI Tech webhooks should not be strictly mapped. 
Additional fields may be included in the webhook payloads returned by our APIs.
:::

:::info Webhook Resending
You can consult and resend webhooks by following the detailed instructions in the documentation: [Webhook Resending](/documentation/notificacoes/reenvio_de_notificacoes).
:::

## 1 - Worker employment relationships inquiry:
The employment relationships inquiry is an asynchronous operation. When sending the request, QI Tech will process the inquiry in the background and return the result through a webhook when completed.

The webhook will be sent to the URL configured in your environment.

**POST**
/private_payroll/employment_relationships_inquiry

### Request

**Case 1:** The worker is the signer of the [Authorization term](#authorization_term).
**Request Body**

```json
{
    "document_number": "12345678909",
    "authorization_term": {
        "signature": {
            "signer": {
                "name": "Nome do tomador",
                "email": "email_do_tomador@email.com",
                "phone": {
                    "number": "999999999",
                    "area_code": "11",
                    "country_code": "55"
                },
                "document_number": "12345678909"
            },
            "authentication_type": "opt_in",
            "authenticity": {
                "timestamp": "2025-03-24T12:19:08Z",
                "ip_address": "255.255.255.255",
                "fingerprint": {},
                "session_id": "0b73fdb9-1b3b-4f09-9cf2-b775a1ce58d2"
            }
        }
    }
}
```

**Case 2:** The legal representative is the signer of the [Authorization term](#authorization_term).
**Request Body**

```json
{
    "document_number": "12345678909",
    "authorization_term": {
      "legal_representative_document_number": "32165498709",
        "signature": {
            "signer": {
                "name": "Nome do tomador",
                "email": "email_do_tomador@email.com",
                "phone": {
                    "number": "999999999",
                    "area_code": "11",
                    "country_code": "55"
                },
                "document_number": "12345678909"
            },
            "authentication_type": "opt_in",
            "authenticity": {
                "timestamp": "2025-03-24T12:19:08Z",
                "ip_address": "255.255.255.255",
                "fingerprint": {},
                "session_id": "0b73fdb9-1b3b-4f09-9cf2-b775a1ce58d2"
            }
        }
    }
}
```

:::caution Attention
In cases where there is a legal representative, it is necessary to fill the **"legal_representative_document_number"** field
with the legal representative's CPF, and the **"signer"** object data must be filled with the same person's data.
:::

### Response

STATUS
**202** Accepted

**Response Body**

```json
{
    "employment_relationships_inquiry_key": "<UUID>",
    "employment_relationships_inquiry_status": "pending_inquiry"
}
```

:::info
The possible values for the **employment_relationships_inquiry_status** enumerator are listed
in the section [Employment relationships inquiry status](#status-das-consultas).
:::

### Webhooks

WEBHOOK TYPE
laas.private_payroll.employment_relationships_inquiry_status_change

Employment relationships inquiry result:

STATUS
completed

**Webhook Body**

```json
{
    "key": "<Employment Relationships Inquiry Key>",
    "status": "completed",
    "webhook_type": "laas.private_payroll.employment_relationships_inquiry_status_change",
    "event_datetime": "2025-03-24T15:28:31Z",
    "data": {
        "authorization_term": {
            "status": "authorized",
            "authorization_term_key": "<UUID>",
            "signed_at": "2025-03-24T12:19:08Z",
            "expiration_date": "2025-04-24"
        },
        "employment_relationships": [
            {
                "eligible": true,
                "document_number": "47812365409",
                "registration_number": "99999999999-A", 
                "employer_document_type": "cpf",
                "employer_document_number": "34848037034"
            },
            {
                "eligible": false,
                "document_number": "47812365409",
                "registration_number": "11111111111-B",
                "employer_document_type": "cnpj",
                "employer_document_number": "33296860000173"
            }
        ]
    }
}
```

STATUS
failed

**Webhook Body**

```json
{
    "key": "<Employment Relationships Inquiry Key>",
    "status": "failed",
    "webhook_type": "laas.private_payroll.employment_relationships_inquiry_status_change",
    "event_datetime": "2025-03-24T15:28:31Z",
    "data": {
        "enumerator": "ineligible_worker_cpf",
        "description": "CPF not found in database or worker CPF ineligible",
        "translation": "CPF não encontrado na base ou CPF do trabalhador inelegível"
    }
}
```

:::warning Warning
To simulate a failure in sandbox environment, perform an inquiry with a CPF starting with digit 2.
:::
---

## 2 - Worker data inquiry: {#consulta-de-dados}
The worker data inquiry is an asynchronous operation. When sending the request, QI Tech will process the inquiry in the background and return the result through a webhook when completed.

The webhook will be sent to the URL configured in your environment.

There are two possible scenarios for performing the inquiry:

1. Using an [Authorization term](#authorization_term) previously sent in the employment relationships inquiry
2. Sending a new [Authorization term](#authorization_term) along with the inquiry

In both cases, it is necessary to provide the worker's registration number obtained from the employment relationships inquiry.

**POST**
/private_payroll/balance_inquiry

### Request

**Case 1:** Worker data inquiry with previously sent [Authorization term](#authorization_term).
**Request Body**

```json
{
    "document_number": "<CPF FUNCIONÁRIO>",
    "registration_number": "<NÚMERO DE MATRÍCULA>",
    "employer_document_number": "<CNPJ EMPREGADOR>"
}
```

**Case 2:** Worker data inquiry with [Authorization term](#authorization_term) sending.
**Request Body**

```json
{
    "document_number": "<CPF FUNCIONÁRIO>",
    "registration_number": "<NÚMERO DE MATRÍCULA>",
    "employer_document_number": "<CNPJ EMPREGADOR>",
    "authorization_term": {
        "legal_representative_document_number": "<CPF DO REPRESENTANTE LEGAL>", // Caso aplicável
        "signature": {
            "signer": {
                "name": "<NOME DO ASSINANTE>",
                "email": "<EMAIL DO ASSINANTE>",
                "phone": {
                    "number": "<NUMERO DO ASSINANTE>",
                    "area_code": "<DDD DO ASSINANTE>",
                    "country_code": "55"
                },
                "document_number": "<CPF DO ASSINANTE>"
            },
            "authentication_type": "opt_in",
            "authenticity": {
                "timestamp": "<DATA E HORA DA ASSINATURA>",
                "ip_address": "<IP DO ASSINANTE>",
                "fingerprint": {},
                "session_id": "<ID DA SESSÃO DO ASSINANTE>"
            }
        }
    }
}
```

:::caution Attention
In cases where there is a legal representative, it is necessary to fill the **"legal_representative_document_number"** field
with the legal representative's CPF, and the **"signer"** object data must be filled with the same person's data.
:::

### Response

STATUS
**202** (Accepted)

**Response Body**

```json
{
    "balance_inquiry_key": "<Balance Inquiry Key>",
    "balance_inquiry_status": "pending_inquiry"
}
```

:::info
The possible values for the **balance_inquiry_status** enumerator are listed
in the section [Worker data inquiry status](#status-das-consultas).
:::

### Webhooks

WEBHOOK TYPE
laas.private_payroll.balance_inquiry_status_change

Worker data inquiry result:

STATUS
completed

**Webhook Body**

```json
{
    "key": "<Balance Inquiry Key>",
    "status": "completed",
    "webhook_type": "laas.private_payroll.balance_inquiry_status_change",
    "event_datetime": "2024-02-21T14:30:25Z",
    "data": {
        "document_number": "99999999999",
        "registration_number": "99999999999-A",
        "employer_document_number": "99999999999962",
        "name": "JOÃO SILVA",
        "gender": "male",
        "birth_date": "1985-07-20",
        "worker_category_code": 101,
        "eligible": true,
        "available_margin_amount": 5000.00,
        "base_margin_amount": 4500.00,
        "total_due_amount": 8207.54,
        "admission_date": "2020-03-15",
        "termination_date": null,
        "termination_reason_code": null,
        "political_exposition": "not_exposed",
        "suspended_loans_count": 2,
        "block_type": "no_block",
        "blocked_at": null,
        "employer_name": "EMPRESA XYZ LTDA",
        "mother_name": "MARIA DA SILVA",
        "nationality": {
            "code": 76,
            "description": "BRASIL"
        },
        "occupation": {
            "code": 724325,
            "description": "SOLDADOR ELETRICO"
        },
        "economic_activity": {
            "code": 2833000,
            "description": "FABRICACAO DE MAQUINAS E EQUIPAMENTOS PARA A AGRICULTURA E PECUARIA, PECAS E ACESSORIOS, EXCETO PARA IRRIGACAO"
        },
        "ineligibility_reason": "not_informed",
        "employer_activity_start_date": "2010-05-12",
        "legacy_loans": [],
        "alerts": [
            {
                "alert_type": "leave",
                "reference_date": "2025-02-11",
                "event_id": 123456,
                "leave_reason_code": 3,
                "leave_start_date": "2025-02-11",
                "leave_end_date": "2025-03-11"
            },
            {
                "alert_type": "termination",
                "reference_date": "2025-02-11", 
                "event_id": 789012,
                "termination_reason_code": 1,
                "termination_date": "2025-02-11",
                "notice_period_start_date": "2025-01-11",
                "notice_period_end_date": "2025-02-11"
            }
        ]
    }
}
```

STATUS
failed

**Webhook Body**

```json
{
    "key": "<Balance Inquiry Key>",
    "status": "failed",
    "webhook_type": "laas.private_payroll.balance_inquiry_status_change",
    "event_datetime": "2024-02-21T14:30:25Z",
    "data": {
      "authorization_term": {
        "status": "authorized",
        "signed_at": "2025-08-10T17:42:05Z",
        "expiration_date": "2025-09-09",
        "authorization_term_key": "4444cc5b-9c60-473f-8fe4-6c43b855be6d"
      }
    }
}
```

Result in case of blocked employment relationship:

STATUS
completed

**Webhook Body**

```json
{
    "document_number": "99999999999",
    "registration_number": "abc",
    "employer_document_number": "12345678",
    "block_type": "blocked_by_the_worker",
    "blocked_at": "2025-12-11T10:00:00Z",
    "data": {
      "authorization_term": {
        "status": "authorized",
        "signed_at": "2025-08-10T17:42:05Z",
        "expiration_date": "2025-09-09",
        "authorization_term_key": "4444cc5b-9c60-473f-8fe4-6c43b855be6d"
      }
    }
}
```

:::warning Warning
To simulate a failure in sandbox environment, perform an inquiry with a CPF starting with digit 2.
:::

## Attachments
---
### Authorization term object details {#authorization_term}
| Field                   | Requirement | Description                        | 
|-------------------------|-----------------|------------------------------------|
|Name                     |Required      |Borrower name                     |
|Email                    |Optional         |Borrower email                    |
|Phone                    |Optional         |Borrower phone                 |
|Document_number          |Required      |Borrower CPF                      |
|Authentication_type      |Required      |Mandatory "opt-in"           |
|Timestamp                |Required      |Borrower consent timestamp, mandatory in format:  2025-08-04T23:45:30Z|
|Ip_address               |Required      |User session IP, either IPv4 (e.g.: 192.168.0.1) or IPv6 (e.g.: 2001:0db8:85a3:0000:0000:8a2e:0370:7334)|
|Fingerprint              |Required      |Object where additional evidence can be sent that contributes to the robustness of consent and assists in traceability, although required, can be sent as a null object|
|Session_id               |Required      |Internal identifier key of the user session, minimum length 10 and maximum 50|

**Examples of fingerprint object fields**
```json
{
  "fingerprint_id": "4c188fc4-2cb4-48cc-9236-7df953570638",
  "lat": "-15.82891",
  "long": "-48.12751",
  "name": "ALBERTO PEREIRA",
  "device": "Web",
  "browser": "Chrome",
  "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/037.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/037.36",
  "browser_version": "120.0.0.0"
}
```
### Worker data inquiry webhook details
| Field                         | Description                        | 
|-------------------------      |------------------------------------|
|document_number                |Borrower document                 |
|registration_number            |Employment relationship registration number                    |
|employer_document_number       |Employer document number (for CNPJ only the first 8 digits)|
|name                           |Borrower name                      |
|gender                         |Borrower gender           |
|birth_date                     |Borrower birth date|
|worker_category_code           |[Worker category](https://www.gov.br/esocial/pt-br/documentacao-tecnica/manuais/leiautes-esocial-v-1-1-beta/tabelas.html#01) in compliance with the eSocial website|
|eligible                       |Relationship eligibility for payroll credit issuance|
|available_margin_amount        |Consignable margin|
|base_margin_amount             |Salary|
|total_due_amount               |Borrower outstanding balance|
|admission_date                 |Admission date|
|termination_date               |Termination date|
|termination_reason_code        |[Termination reason](https://www.gov.br/esocial/pt-br/documentacao-tecnica/leiautes-esocial-versao-1-3-nt-03-2025/tabelas.html#19) in compliance with the eSocial website|
|political_exposition           |Borrower political exposure level, check possible enumerators in the [Political exposure](#exposição-política) table|
|employer_name                  |Employer name|
|mother_name                    |Borrower mother's name|
|nationality.description        |Borrower nationality|
|nationality.code               |Borrower nationality code according to the numerical standard of part 1 of ISO 3166 norm|
|occupation.description         |Borrower occupation according to the Brazilian Classification of Occupations (CBO)|
|occupation.code                |Code according to CBO 2002|
|economic_activity.description  |Employer economic activity according to the National Classification of Economic Activities (CNAE)|
|economic_activity.code         |Code according to CNAE Subclasses 2.3|
|ineligibility_reason           |Relationship ineligibility reason|
|employer_activity_start_date   |Employer activity start date|
|legacy_loans                   |List of active loans reported by FIs, for field details check the [Legacy loans object details](#legacy_loans) table|
|alerts                         |List with history of leaves and termination warnings of the relationship, for field details check the [Alerts object details](#alerts) table|
|suspended_loans_count          |Number of suspended loans|
|block_type                     |Employment relationship blocking type, check possible enumerators in the [Salary blocking](#block) table|
|blocked_at                     |Employment relationship blocking date|

### Political exposure {#exposicao-politica}

ENUMERATOR
political_exposition

| Enumerator    | Description                                                               |
| ------------- | ------------------------------------------------------------------------- |
| not_exposed   | Person not politically exposed                                          |
| level_1       | Politically exposed person level 1                                      |
| level_2       | Politically exposed person level 2                                      |
| not_informed  | No information about political exposure                              |

### Alerts object details {#alerts}
| Field                         | Description                        | 
|-------------------------      |------------------------------------|
|alert_type                     |Alert type, check possible enumerators in the [Alert types](#alert_type) table|
|reference_date                 |Event reference date|
|event_id                       |Event identifier|
|leave_reason_code              |[Leave reason](https://www.gov.br/esocial/pt-br/documentacao-tecnica/leiautes-esocial-versao-1-3-nt-03-2025/tabelas.html#18) in compliance with the eSocial website|
|leave_start_date               |Leave start date|
|leave_end_date                 |Leave end date|
|termination_reason_code        |[Termination reason](https://www.gov.br/esocial/pt-br/documentacao-tecnica/leiautes-esocial-versao-1-3-nt-03-2025/tabelas.html#19) in compliance with the eSocial website|
|termination_date               |Relationship termination date|
|notice_period_start_date       |Notice period start date|
|notice_period_end_date         |Notice period end date|

### Alert types {#alert_type}
ENUMERATOR
alert_type
| Enumerator                    | Description                       | 
|-------------------------      |-----------------------------------|
|leave                          |Leave                        |
|termination                    |Termination notice       |

### Legacy loans object details {#legacy_loans}
| Field                         | Description                        | 
|-------------------------      |------------------------------------|
|loan_amount                    |Disbursed amount|
|monthly_cet                    |Monthly CET|
|monthly_rate                   |Monthly rate|
|contract_type                  |Contract type, check possible enumerators in the [Legacy contract types](#contract_type) table|
|contract_number                |Contract number|
|contract_end_date              |Contract end date|
|paid_installments              |Number of paid installments|
|total_installments             |Total number of installments|
|installment_amount             |Installment amount|
|contract_start_date            |Contract start date|
|outstanding_balance            |Outstanding balance|
|last_update_timestamp          |Last update date|
|financial_institution_code     |Code of the FI that reported the loan|

### Legacy contract types{#contract_type}
ENUMERATOR
contract_type
| Enumerator                    | Description                       | 
|-------------------------      |-----------------------------------|
|unsecured_non_consigned_loan   |Unsecured non-payroll loan|
|loan_with_payroll_deductions   |Loan with payroll deductions|

### Employment relationships inquiry and worker data inquiry status {#status-das-consultas}

ENUMERATOR
employment_relationships_inquiry_status

ENUMERATOR
balance_inquiry_status

| Status                | Description                                                                   |
| --------------------- | ----------------------------------------------------------------------------- |
| pending_authorization | Authorization data was sent and is pending processing.    |
| pending_inquiry       | The inquiry is authorized and pending processing.                      |
| completed             | The inquiry was successfully completed.                                         |
| failed                | The inquiry failed.                                                            |

### Employment relationship blocking {#block}

ENUMERATOR
block_type

| Enumerator            | Description                                                               |
| -------------         | ------------------------------------------------------------------------- |
| no_block              | Employment relationship not blocked                                          |
| blocked_by_the_worker | Employment relationship blocked by the worker                                      |

---

# Private Payroll Manual - Legacy Contracts

URL: /en/documentation/manual_consignado_privado/manual_contratos_legados

:::caution API under development 
The API is still in development phase, therefore this manual is subject to changes.
:::

The renegotiation of a legacy contract is done by creating a new debt, with the legacy contract data informed in the *collateral_data* field.

To verify the legacy contracts that have been included in the system, you should perform a query for legacy loans.
If not found, please contact support to request inclusion.

Due to Private Payroll business rules, currently the worker can have only one active contract. 
Therefore, if the worker has more than one legacy contract, only one of them can be renegotiated.
Similarly, if the worker has an active contract, it will not be possible to create a renegotiation for them.

The debt creation and signature flow is the same used for creating a new credit. The difference is in the debt registration, which is done automatically by the system after contract signature, not requiring manual approval and not needing SCR consultation.

## 1 - Legacy loans query

**GET**
/private_payroll/legacy_contracts

### Query Parameters

| Parameter       | Type    | Required | Description                        | Default Value |
|-----------------|---------|----------|------------------------------------|---------------|
| page            | integer | No       | Page number to be returned         | 1             |
| page_size       | integer | No       | Number of records per page         | 100           |
| document_number | string  | No       | Customer CPF without punctuation   | N/A           |

:::info
Pagination is one-based, therefore the first page is page 1.
:::

### Response

STATUS
**200** OK

```json
{
    "data": [
        {
            "legacy_contract_key": "123e4567-e89b-12d3-a456-426614174000",
            "document_number": "29883927061",
            "contract_number": "1234567890",
            "legacy_contract_data": {
                "cet": 0.0637,
                "due_balance": 1935,
                "total_amount": 2405.76,
                "contract_type": "consigned_loan",
                "interest_rate": 0.0409,
                "period_amount": 129.33,
                "contract_end_date": "2026-10-05",
                "number_of_periods": 36,
                "contract_start_date": "2023-10-06",
                "registration_number": "11841",
                "number_of_paid_periods": 17,
                "employer_document_number": "43028211000145"
            }, 
            "status": "active"
        }
    ],
    "pagination": {
        "current_page": 1,
        "next_page": 2,
        "rows_per_page": 100,
        "total_pages": 1,
        "total_rows": 1
    }
}
```

### Response Body

The paginated response consists of an array of contracts (*data*) and a pagination object (*pagination*).

#### Contracts list

Description of the *data* array items:

| Parameter            | Type    | Required | Description                           |
|----------------------|---------|----------|---------------------------------------|
| legacy_contract_key  | string  | Yes      | Legacy contract unique identifier     |
| document_number      | string  | Yes      | Customer CPF                          |
| contract_number      | string  | Yes      | Contract number                       |
| legacy_contract_data | object  | Yes      | Legacy contract data                  |
| status               | string  | Yes      | Contract status                       |

#### Legacy contract data

Data contained in the *legacy_contract_data* object:

| Parameter                | Type    | Required | Description                 |
|--------------------------|---------|----------|-----------------------------|
| cet                      | decimal | Yes      | Total Effective Cost        |
| due_balance              | decimal | Yes      | Outstanding balance         |
| total_amount             | decimal | Yes      | Total contract amount       |
| contract_type            | string  | Yes      | Contract type               |
| interest_rate            | decimal | Yes      | Interest rate               |
| period_amount            | decimal | Yes      | Installment amount          |
| contract_end_date        | string  | Yes      | Contract end date           |
| number_of_periods        | integer | Yes      | Total number of installments|
| contract_start_date      | string  | Yes      | Contract start date         |
| registration_number      | string  | Yes      | Employee registration number|
| number_of_paid_periods   | integer | Yes      | Number of paid installments |
| employer_document_number | string  | Yes      | Employer CNPJ               |

#### Pagination data

Data contained in the *pagination* object:

| Parameter     | Type    | Required | Description                    |
|---------------|---------|----------|--------------------------------|
| current_page  | integer | Yes      | Current page                   |
| next_page     | integer | Yes      | Next page                      |
| rows_per_page | integer | Yes      | Number of records per page     |
| total_pages   | integer | Yes      | Total pages                    |
| total_rows    | integer | Yes      | Total records                  |

## 2 - Legacy Contract Deletion

The deletion of a legacy contract is performed by the following endpoint:

**DELETE**
/private_payroll/legacy_contract/ contract_number

Where the path parameter "contract_number" should be the contract to be deleted, in string format.

### Response

In case of success the following response will be returned:

STATUS
**200** OK

While in the case where the indicated legacy contract does not exist, a NotFound error will be returned, with error code "PRP000079".

STATUS
**404** NOT FOUND

## 3 - Renegotiation creation

The renegotiation of a legacy contract is performed by creating a debt similar to creating a new credit, with the difference that the legacy contract data must be informed in the *collateral_data* field as exemplified below:

**POST**
/debt

```json
{
    "simplified": true,
    "requester_identifier_key": "05a9c4cc-39d5-48fe-ab47-8f1b37d8bffb",
    "purchaser_document_number": "30620610000159",
    "borrower": {
        "role_type": "issuer",
        "person_type": "natural",
        "name": "EXEMPLO",
        "email": "exemplo@exemplo.com",
        "individual_document_number": "48674911013",
        "birth_date": "1991-01-01",
        "mother_name": "MÃE DO EXEMPLO",
        "phone": {
            "country_code": "55",
            "area_code": "11",
            "number": "999999999"
        },
        "address": {
            "street": "RUA EXEMPLO",
            "number": "123",
            "complement": "APTO 123",
            "neighborhood": "BAIRRO EXEMPLO",
            "postal_code": "12345678",
            "city": "SÃO PAULO",
            "state": "SP"
        },
    },
    "disbursement_bank_accounts": [
        {
            "name": "EXEMPLO",
            "document_number": "48674911013",
            "pix_transfer_type": "key",
            "pix_key": "pix03@pix03.com",
            "amount_receivable": 2000
        },
        {
            "name": "Cel-lep Ensino De Idiomas S.a.",
            "document_number": "10772420000140",
            "digitable_line": "32990001039000210987502864982109595090000063958",
            "amount_receivable": 639.58
        }
    ],
    "financial": {
        "credit_operation_type": "ccb",
        "interest_type": "pre_price_days",
        "interest_grace_period": 0,
        "principal_grace_period": 0,
        "limit_days_to_disburse": 1,
        "number_of_installments": 12,
        "installment_face_value": 250,
        "disbursement_date": "2025-05-12",
        "disbursed_amount": 2639.58,
        "first_due_date": "2025-07-28",
        "fine_configuration": {
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02,
            "monthly_rate": 0.01
        },
    },
    "collaterals": [
        {
            "percentage": 1,
            "collateral_type": "private_payroll",
            "collateral_data": {
                "registration_number": "g7D1IFvUmq2s7zE9UVsV0HQwfcbHj",
                "employer_document_number": "60518978000171",
                "operation_category": "legacy_contract_refinancing",
                "legacy_contract_numbers": ["0000001523EMP"],
            }
        }
    ]
}
```

:::info
If there is a legal representative, they should be informed in the *related_parties* field as exemplified in the new credit example.

```json
{
    "related_parties": [
        {
            "role_type": "issuer_legal_representative",
            "person_type": "natural",
            "name": "REPRESENTANTE EXEMPLO",
            "email": "representante.exemplo@exemplo.com",
            "individual_document_number": "79795844067",
            "birth_date": "1970-04-20",
            "mother_name": "MÃE DO REPRESENTANTE",
            "phone": {
                "country_code": "55",
                "area_code": "11",
                "number": "999999999"
            },
            "address": {
                "street": "RUA EXEMPLO",
                "number": "123",
                "complement": "APTO 123",
                "neighborhood": "BAIRRO EXEMPLO",
                "postal_code": "12345678",
                "city": "SÃO PAULO",
                "state": "SP"
            }
        }
    ]
}
```
:::

### Response

STATUS
**201** Created

```json title="Response Body"
{
    "webhook_type": "debt",
    "key": "<Debt Key>",
    "status": "waiting_signature",
    "event_datetime": "2025-05-06 10:00:00",
    "data": {
        "borrower": {
            "name": "Nome devedor",
            "document_number": "58307769019",
            "related_party_key": "28b7fc16-6d1f-467d-9667-62a8c13daea6"
        },
        "contract": {
            "number": "0000644710/NDV",
            "urls": [
                "https://storage.googleapis.com/sandbox-doc-api/documents/a2e9c83a-3666-4def-8b27-e96fabb8705c/NOME_DEVEDOR-CCB-TST0000644710-20241107231916.pdf"
            ],
            "signature_information": [
                {
                    "signer_name": "Nome devedor",
                    "signer_document_number": "14471835092",
                    "signer_role": "issuer",
                    "signer_email": null,
                    "signer_external_key": null,
                    "signature_url": null
                }
            ]
        },
        "requester_identifier_key": "05a9c4cc-39d5-48fe-ab47-8f1b37d8bffb",
        "iof_charge_method": "financed",
        "collaterals": [
            {
                "absolute_amount": null,
                "collateral_constituted": false,
                "collateral_data": {
                    "operation_category": "legacy_contract_refinancing",
                    "legacy_contract_number": "1234567890"
                },
                "collateral_key": "26c7f4f4-51f3-41fa-b880-9691211136aa",
                "collateral_type": "private_payroll",
                "created_at": "2024-11-07T23:19:16.413448",
                "external_key": null,
                "percentage": 1,
                "updated_at": "2024-11-07T23:19:16.413441"
            }
        ],
        "disbursement_options": [
            {
                "disbursement_date": "2024-11-07",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.55
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.05,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 914.3,
                "issue_amount": 909.75,
                "cet": "2,0100%",
                "annual_cet": "27,0481%",
                "base_iof": 16.259002146803677,
                "additional_iof": 3.45705,
                "total_iof": 19.72,
                "total_pre_fixed_amount": 108.6508885851,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 74,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 909.75,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 37.1789024864,
                        "principal_amortization_amount": 64.6610975136,
                        "tax_amount": 0.3923635397125248,
                        "total_amount": 101.84,
                        "workdays": 49.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0889024864,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.753721435360089,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5486660915,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.9845001990781314,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            }
        ]
    }
} 
```

---

# Manual Consignado Privado - Crédito Novo

URL: /en/documentation/manual_consignado_privado/manual_credito_novo

:::info Navegação
- [Consultas do Trabalhador](/documentation/manual_consignado_privado/manual_consultas_trabalhador) (anterior)
- [Formalização Externa](/documentation/manual_consignado_privado/manual_assinatura_externa) (próximo)
:::

:::danger Atenção!
Os webhooks da QI Tech não devem ser mapeados de forma estrita. 
Campos adicionais podem ser incluídos aos payloads dos webhooks retornados em nossas APIs.
:::

:::info Reenvio de Webhooks
Você pode consultar e reenviar webhooks seguindo as instruções detalhadas na documentação: [Reenvio de Webhooks](/documentation/notificacoes/reenvio_de_notificacoes).
:::

## 1 - Simulação da dívida:
CRÉDITO NOVO

### Request

**POST**
/debt_simulation

**Valor de parcela**

```json title='Request Body'
{
    "borrower": {
        "person_type": "natural"
    },
    "financial": {
        "first_due_date": "2024-12-07",
        "installment_face_value": 100,
        "disbursement_date": "2024-11-05",
        "limit_days_to_disburse": 3,
        "number_of_installments": 4,
        "monthly_interest_rate": 0.018,
        "interest_type": "pre_price_days",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "principal_grace_period": 0
    },
    "collaterals": [
        {
            "collateral_type": "private_payroll"
        }
    ]
}
```

**Valor desembolsado**

```json title='Request Body'
{
    "borrower": {
        "person_type": "natural"
    },
    "financial": {
        "first_due_date": "2024-12-07",
        "disbursed_amount": 1000,
        "disbursement_date": "2024-11-05",
        "limit_days_to_disburse": 3,
        "number_of_installments": 4,
        "monthly_interest_rate": 0.018,
        "interest_type": "pre_price_days",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "principal_grace_period": 0
    },
    "collaterals": [
        {
            "collateral_type": "private_payroll"
        }
    ]
}
```

:::info
Na request acima existem 2 simulações sendo realizadas. A primeira está fixando o valor de parcela ao cliente
(varia o valor desembolsado) e a segunda está fixando o valor desembolsado (varia o valor de parcela).
::: 

### Response

STATUS
**200** (OK)

**Response Body**

```json
{
    "type": "debt",
    "key": "<Debt Key>",
    "status": "finished",
    "event_datetime": "2024-11-05 16:50:00",
    "data": {
        "interest_type": "pre_price_days",
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "interest_payment_month_period": 1,
        "principal_grace_period": 0,
        "principal_amortization_month_period": 1,
        "operation_type": "structured_operation",
        "post_fixed_interest_base": "workdays",
        "post_fixed_interest_rate": null,
        "prefixed_interest_rate": {
            "interest_base": "calendar_days_365",
            "annual_rate": 0.23872053,
            "monthly_rate": 0.018,
            "daily_rate": 0.00058669
        },
        "issue_date": "2024-11-05",
        "number_of_installments": 4,
        "requester_key": "e5eb6a0a-e003-4cbd-b702-5a25bf71af0a",
        "final_disbursement_amount": 0.0,
        "disbursement_options": [
            {
                "iof_amount": 3.93,
                "total_pre_fixed_amount": 17.8715883143,
                "cet": 0.0257,
                "annual_cet": 0.355163,
                "contract_fees": [
                    {
                        "fee_type": "tac",
                        "amount_type": "percentage",
                        "amount": 0.6,
                        "fee_amount": 2.29
                    },
                    {
                        "fee_type": "ted_fee",
                        "amount_type": "absolute",
                        "amount": 1.0,
                        "fee_amount": 1.0
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "insurance_premium",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "tac",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    }
                ],
                "contract_fee_amount": 2.29,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "disbursement_date": "2024-11-05",
                "first_due_date": "2024-12-21",
                "installments": [
                    {
                        "calendar_days": 34,
                        "workdays": 23.0,
                        "business_due_date": "2024-12-21",
                        "due_date": "2024-12-21",
                        "due_principal": 382.13,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 7.6967422515,
                        "tax_amount": 0.257341482602818,
                        "total_amount": 100,
                        "principal_amortization_amount": 92.3032577485,
                        "installment_number": 1
                    },
                    {
                        "calendar_days": 29,
                        "workdays": 19.0,
                        "business_due_date": "2025-01-21",
                        "due_date": "2025-01-21",
                        "due_principal": 289.8267422515,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.9718040699,
                        "tax_amount": 0.4909156601748966,
                        "total_amount": 100,
                        "principal_amortization_amount": 95.0281959301,
                        "installment_number": 2
                    },
                    {
                        "calendar_days": 31,
                        "workdays": 23.0,
                        "business_due_date": "2025-02-21",
                        "due_date": "2025-02-21",
                        "due_principal": 194.7985463214,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5742034136,
                        "tax_amount": 0.7432500400879712,
                        "total_amount": 100,
                        "principal_amortization_amount": 96.4257965864,
                        "installment_number": 3
                    },
                    {
                        "calendar_days": 28,
                        "workdays": 18.0,
                        "business_due_date": "2025-03-21",
                        "due_date": "2025-03-21",
                        "due_principal": 98.372749735,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.6288385793,
                        "tax_amount": 0.9841050988526828,
                        "total_amount": 100,
                        "principal_amortization_amount": 98.3711614207,
                        "installment_number": 4
                    }
                ],
                "issue_amount": 382.13,
                "disbursed_issue_amount": 374.91,
                "assignment_amount": 382.13,
                "final_disbursement_amount": 374.91,
                "prefixed_interest_rate": {
                    "interest_base": "calendar_days_365",
                    "annual_rate": 0.23872053,
                    "monthly_rate": 0.018,
                    "daily_rate": 0.00058669
                }
            },
            {
                "iof_amount": 4.77,
                "total_pre_fixed_amount": 24.2597288075,
                "cet": 0.0243,
                "annual_cet": 0.334037,
                "contract_fees": [
                    {
                        "fee_type": "tac",
                        "amount_type": "percentage",
                        "amount": 0.6,
                        "fee_amount": 2.25
                    },
                    {
                        "fee_type": "ted_fee",
                        "amount_type": "absolute",
                        "amount": 1.0,
                        "fee_amount": 1.0
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "insurance_premium",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "tac",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    }
                ],
                "contract_fee_amount": 2.25,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "disbursement_date": "2024-11-06",
                "first_due_date": "2025-01-21",
                "installments": [
                    {
                        "calendar_days": 62,
                        "workdays": 41.0,
                        "business_due_date": "2025-01-21",
                        "due_date": "2025-01-21",
                        "due_principal": 375.74,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 13.9149280115,
                        "tax_amount": 0.437656505989534,
                        "total_amount": 100,
                        "principal_amortization_amount": 86.0850719885,
                        "installment_number": 1
                    },
                    {
                        "calendar_days": 31,
                        "workdays": 23.0,
                        "business_due_date": "2025-02-21",
                        "due_date": "2025-02-21",
                        "due_principal": 289.6549280115,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 5.3146959395,
                        "tax_amount": 0.722070128765373,
                        "total_amount": 100,
                        "principal_amortization_amount": 94.6853040605,
                        "installment_number": 2
                    },
                    {
                        "calendar_days": 28,
                        "workdays": 18.0,
                        "business_due_date": "2025-03-21",
                        "due_date": "2025-03-21",
                        "due_principal": 194.969623951,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.2283291407,
                        "tax_amount": 0.9601685182659746,
                        "total_amount": 100,
                        "principal_amortization_amount": 96.7716708593,
                        "installment_number": 3
                    },
                    {
                        "calendar_days": 31,
                        "workdays": 21.0,
                        "business_due_date": "2025-04-07",
                        "due_date": "2025-04-07",
                        "due_principal": 98.1979530917,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.8017757158,
                        "tax_amount": 1.2239426674782687,
                        "total_amount": 100,
                        "principal_amortization_amount": 98.1982242842,
                        "installment_number": 4
                    }
                ],
                "issue_amount": 375.74,
                "disbursed_issue_amount": 367.72,
                "assignment_amount": 375.74,
                "final_disbursement_amount": 367.72,
                "prefixed_interest_rate": {
                    "interest_base": "calendar_days_365",
                    "annual_rate": 0.23872053,
                    "monthly_rate": 0.018,
                    "daily_rate": 0.00058669
                }
            },
            {
                "iof_amount": 4.74,
                "total_pre_fixed_amount": 24.0392857898,
                "cet": 0.0243,
                "annual_cet": 0.334673,
                "contract_fees": [
                    {
                        "fee_type": "tac",
                        "amount_type": "percentage",
                        "amount": 0.6,
                        "fee_amount": 2.26
                    },
                    {
                        "fee_type": "ted_fee",
                        "amount_type": "absolute",
                        "amount": 1.0,
                        "fee_amount": 1.0
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "insurance_premium",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "tac",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    }
                ],
                "contract_fee_amount": 2.26,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "disbursement_date": "2024-11-07",
                "first_due_date": "2025-01-21",
                "installments": [
                    {
                        "calendar_days": 61,
                        "workdays": 40.0,
                        "business_due_date": "2025-01-21",
                        "due_date": "2025-01-21",
                        "due_principal": 375.96,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 13.6944849939,
                        "tax_amount": 0.4317001860605122,
                        "total_amount": 100,
                        "principal_amortization_amount": 86.3055150061,
                        "installment_number": 1
                    },
                    {
                        "calendar_days": 31,
                        "workdays": 23.0,
                        "business_due_date": "2025-02-21",
                        "due_date": "2025-02-21",
                        "due_principal": 289.6544849939,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 5.3146959395,
                        "tax_amount": 0.714305933832412,
                        "total_amount": 100,
                        "principal_amortization_amount": 94.6853040605,
                        "installment_number": 2
                    },
                    {
                        "calendar_days": 28,
                        "workdays": 18.0,
                        "business_due_date": "2025-03-21",
                        "due_date": "2025-03-21",
                        "due_principal": 194.9691809334,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.2283291407,
                        "tax_amount": 0.952233241255512,
                        "total_amount": 100,
                        "principal_amortization_amount": 96.7716708593,
                        "installment_number": 3
                    },
                    {
                        "calendar_days": 31,
                        "workdays": 21.0,
                        "business_due_date": "2025-04-07",
                        "due_date": "2025-04-07",
                        "due_principal": 98.1975100741,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.8017757157,
                        "tax_amount": 1.2158904130882027,
                        "total_amount": 100,
                        "principal_amortization_amount": 98.1982242843,
                        "installment_number": 4
                    }
                ],
                "issue_amount": 375.96,
                "disbursed_issue_amount": 367.96,
                "assignment_amount": 375.96,
                "final_disbursement_amount": 367.96,
                "prefixed_interest_rate": {
                    "interest_base": "calendar_days_365",
                    "annual_rate": 0.23872053,
                    "monthly_rate": 0.018,
                    "daily_rate": 0.00058669
                }
            },
            {
                "iof_amount": 4.71,
                "total_pre_fixed_amount": 23.8187134405,
                "cet": 0.0244,
                "annual_cet": 0.335196,
                "contract_fees": [
                    {
                        "fee_type": "tac",
                        "amount_type": "percentage",
                        "amount": 0.6,
                        "fee_amount": 2.26
                    },
                    {
                        "fee_type": "ted_fee",
                        "amount_type": "absolute",
                        "amount": 1.0,
                        "fee_amount": 1.0
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "insurance_premium",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "tac",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    }
                ],
                "contract_fee_amount": 2.26,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "disbursement_date": "2024-11-08",
                "first_due_date": "2025-01-21",
                "installments": [
                    {
                        "calendar_days": 60,
                        "workdays": 39.0,
                        "business_due_date": "2025-01-21",
                        "due_date": "2025-01-21",
                        "due_principal": 376.18,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 13.4739126445,
                        "tax_amount": 0.42570834978906,
                        "total_amount": 100,
                        "principal_amortization_amount": 86.5260873555,
                        "installment_number": 1
                    },
                    {
                        "calendar_days": 31,
                        "workdays": 23.0,
                        "business_due_date": "2025-02-21",
                        "due_date": "2025-02-21",
                        "due_principal": 289.6539126445,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 5.3146959395,
                        "tax_amount": 0.706541738899451,
                        "total_amount": 100,
                        "principal_amortization_amount": 94.6853040605,
                        "installment_number": 2
                    },
                    {
                        "calendar_days": 28,
                        "workdays": 18.0,
                        "business_due_date": "2025-03-21",
                        "due_date": "2025-03-21",
                        "due_principal": 194.968608584,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.2283291407,
                        "tax_amount": 0.9442979642450494,
                        "total_amount": 100,
                        "principal_amortization_amount": 96.7716708593,
                        "installment_number": 3
                    },
                    {
                        "calendar_days": 31,
                        "workdays": 21.0,
                        "business_due_date": "2025-04-21",
                        "due_date": "2025-04-21",
                        "due_principal": 98.1969377247,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.8017757158,
                        "tax_amount": 1.20783815869566,
                        "total_amount": 100,
                        "principal_amortization_amount": 98.1982242842,
                        "installment_number": 4
                    }
                ],
                "issue_amount": 376.18,
                "disbursed_issue_amount": 368.21,
                "assignment_amount": 376.18,
                "final_disbursement_amount": 368.21,
                "prefixed_interest_rate": {
                    "interest_base": "calendar_days_365",
                    "annual_rate": 0.23872053,
                    "monthly_rate": 0.018,
                    "daily_rate": 0.00058669
                }
            }
        ]
    }
}
```

---

## 2 - Emissão da operação:
O campo "registration_number", localizado dentro do objeto "collateral_data", refere-se ao número de matrícula de um vínculo empregatício. O mesmo é retornado na consulta de vínculos empregatícios.

CRÉDITO NOVO

### Request

**POST**
/debt

**Sem representante legal**

```json title='Request Body'
{
    "borrower": {
        "name": "Nome devedor",
        "email":"email.devedor@gmail.com",
        "phone": {
            "number": "999538380",
            "area_code": "84",
            "country_code": "055"
        },
        "gender": "female",
        "political_exposition": "not_exposed",
        "address": {
            "city": "Natal",
            "state": "RN",
            "number": "1984",
            "street": "Rua",
            "complement": "complemento",
            "postal_code": "59065720",
            "neighborhood": "bairro"
        },
        "role_type": "issuer",
        "birth_date": "1959-07-08",
        "mother_name": "NOME DA MAE",
        "nationality": "Brasileiro",
        "person_type": "natural",
        "marital_status": "single",
        "attached_documents_list": [],
        "individual_document_number": "14471835092",
        "document_identification_date": "2015-10-02",
        "document_identification_type": "rg",
        "document_identification_number": "003709888"
    },
    "financial": {
        "interest_type": "pre_price_days",
        "first_due_date": "2023-09-21",
        "disbursement_date": "2024-11-07",
        "fine_configuration": {
            "monthly_rate": 0.0166,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0
        },
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "monthly_interest_rate": 0.0166,
        "installment_face_value": 101.84,
        "limit_days_to_disburse": 7,
        "number_of_installments": 10,
        "principal_grace_period": 0,
        "rebates": [ // Opcional
            {
                "amount": 20,
                "rebate_bank_account": {
                    "name": "Teste Ltda",
                    "document_number": "18533555000164",
                    "account_digit": "0",
                    "account_number": "4290001",
                    "branch_number": "0001",
                    "bank_code": "329"
                },
                "amount_type": "percentage",
                "fee_type": "spread"
            }
        ]
    },
    "simplified": true,
    "collaterals": [
        {
            "percentage": 1,
            "collateral_type": "private_payroll",
            "collateral_data": {
                "employer_document_number": "07940839000159",
                "registration_number": "99999999999-A"
            }
        }
    ],
    "additional_data": {
        "contract": {
            "contract_number": "TST0000644799"
        }
    },
    "purchaser_document_number": "32402502000135",
    "disbursement_bank_accounts": [
        {
            "name": "NOME DEVEDOR",
            "bank_code": "001",
            "account_digit": "0",
            "branch_number": "2874",
            "account_number": "000057555",
            "document_number": "14471835092",
            "transfer_method": "pix",
            "percentage_receivable": 100
        }
    ]
}
```

**Com representante legal**

```json title='Request Body'
{
    "borrower": {
        "name": "Nome devedor",
        "phone": {
            "number": "999538380",
            "area_code": "84",
            "country_code": "055"
        },
        "gender": "female",
        "political_exposition": "not_exposed",
        "address": {
            "city": "Natal",
            "state": "RN",
            "number": "1984",
            "street": "Rua",
            "complement": "complemento",
            "postal_code": "59065720",
            "neighborhood": "bairro"
        },
        "role_type": "issuer",
        "birth_date": "1959-07-08",
        "mother_name": "NOME DA MAE",
        "nationality": "Brasileiro",
        "person_type": "natural",
        "marital_status": "single",
        "attached_documents_list": [],
        "individual_document_number": "14471835092",
        "document_identification_date": "2015-10-02",
        "document_identification_type": "rg",
        "document_identification_number": "003709888"
    },
    "related_parties": [
        {
            "role_type": "issuer_legal_representative",
            "person_type": "natural",
            "name": "REPRESENTANTE EXEMPLO",
            "email": "representante.exemplo@exemplo.com",
            "individual_document_number": "79795844067",
            "birth_date": "1970-04-20",
            "mother_name": "MÃE DO REPRESENTANTE",
            "phone": {
                "country_code": "55",
                "area_code": "11",
                "number": "999999999"
            },
            "address": {
                "street": "RUA EXEMPLO",
                "number": "123",
                "complement": "APTO 123",
                "neighborhood": "BAIRRO EXEMPLO",
                "postal_code": "12345678",
                "city": "SÃO PAULO",
                "state": "SP"
            }
        }
    ],
    "financial": {
        "interest_type": "pre_price_days",
        "first_due_date": "2024-09-21",
        "disbursement_date": "2024-11-07",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0
        },
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "monthly_interest_rate": 0.0166,
        "installment_face_value": 1000,
        "limit_days_to_disburse": 7,
        "number_of_installments": 84,
        "principal_grace_period": 0,
        "rebates": [ // Opcional
            {
                "amount": 20,
                "rebate_bank_account": {
                    "name": "Teste Ltda",
                    "document_number": "18533555000164",
                    "account_digit": "0",
                    "account_number": "4290001",
                    "branch_number": "0001",
                    "bank_code": "329"
                },
                "amount_type": "percentage",
                "fee_type": "spread"
            }
        ]
    },
    "simplified": true,
    "collaterals": [
        {
            "percentage": 1,
            "collateral_type": "private_payroll",
            "collateral_data": {
                "employer_document_number": "07940839000159",
                "registration_number": "99999999999-A"
            }
        }
    ],
    "additional_data": {
        "contract": {
            "contract_number": "TST0000644715"
        }
    },
    "purchaser_document_number": "32402502000135",
    "disbursement_bank_accounts": [
        {
            "name": "NOME DEVEDOR",
            "bank_code": "001",
            "account_digit": "0",
            "branch_number": "2874",
            "account_number": "000057555",
            "document_number": "14471835092",
            "transfer_method": "pix",
            "percentage_receivable": 100
        }
    ]
}
```

### Response

STATUS
**201** (Created)

**Response Body**

```json title="Response Body"
{
    "webhook_type": "debt",
    "key": "<Debt Key>",
    "status": "waiting_signature",
    "event_datetime": "2024-11-07 23:19:22",
    "data": {
        "borrower": {
            "name": "Nome devedor",
            "document_number": "14471835092",
            "related_party_key": "28b7fc16-6d1f-467d-9667-62a8c13daea6"
        },
        "contract": {
            "number": "TST0000644710",
            "urls": [
                "https://storage.googleapis.com/sandbox-doc-api/documents/a2e9c83a-3666-4def-8b27-e96fabb8705c/NOME_DEVEDOR-CCB-TST0000644710-20241107231916.pdf"
            ],
            "signature_information": [
                {
                    "signer_name": "Nome devedor",
                    "signer_document_number": "14471835092",
                    "signer_role": "issuer",
                    "signer_email": null,
                    "signer_external_key": null,
                    "signature_url": null
                }
            ]
        },
        "requester_identifier_key": "eb859ebe-3a41-49bf-a6c3-d6902039ec00",
        "iof_charge_method": "financed",
        "collaterals": [
            {
                "absolute_amount": null,
                "collateral_constituted": false,
                "collateral_data": {
                    "registration_number": "99999999999-A",
                    "employer_document_number": "07940839000159"
                },
                "collateral_key": "26c7f4f4-51f3-41fa-b880-9691211136aa",
                "collateral_type": "private_payroll",
                "created_at": "2024-11-07T23:19:16.413448",
                "external_key": null,
                "percentage": 1,
                "updated_at": "2024-11-07T23:19:16.413441"
            }
        ],
        "disbursement_options": [
            {
                "disbursement_date": "2024-11-07",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.55
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.05,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 914.3,
                "issue_amount": 909.75,
                "cet": "2,0100%",
                "annual_cet": "27,0481%",
                "base_iof": 16.259002146803677,
                "additional_iof": 3.45705,
                "total_iof": 19.72,
                "total_pre_fixed_amount": 108.6508885851,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 74,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 909.75,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 37.1789024864,
                        "principal_amortization_amount": 64.6610975136,
                        "tax_amount": 0.3923635397125248,
                        "total_amount": 101.84,
                        "workdays": 49.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0889024864,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.753721435360089,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5486660915,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.9845001990781314,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2772376046,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.222548377175604,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4632222376,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.4797864582180404,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.4416948163,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.72770892770474,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.7989345071,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.999011328473856,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5716418016,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.274874127227187,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.570357168,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.570318634292211,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.3090744135,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141716,
                        "principal_amortization_amount": 100.3081858284,
                        "tax_amount": 2.8541691195612935,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            },
            {
                "disbursement_date": "2024-11-08",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.55
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.05,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 914.79,
                "issue_amount": 910.24,
                "cet": "2,0200%",
                "annual_cet": "27,0539%",
                "base_iof": 16.187351160427028,
                "additional_iof": 3.458912,
                "total_iof": 19.65,
                "total_pre_fixed_amount": 108.1583324947,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 73,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 910.24,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 36.6863463961,
                        "principal_amortization_amount": 65.1536536039,
                        "tax_amount": 0.3900097704729454,
                        "total_amount": 101.84,
                        "workdays": 48.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0863463961,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.7465431359757072,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5461100012,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.9770979419422056,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2746815143,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.21518362791551,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4606661473,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.4721586929694939,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.439138726,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.7200302213593857,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.7963784168,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.991202690472005,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5690857113,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.266920021887232,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.5678010777,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.562261209106342,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.3065183232,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141715,
                        "principal_amortization_amount": 100.3081858285,
                        "tax_amount": 2.845943848326202,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            },
            {
                "disbursement_date": "2024-11-09",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.55
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.05,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 915.28,
                "issue_amount": 910.73,
                "cet": "2,0200%",
                "annual_cet": "27,0599%",
                "base_iof": 16.115620969325082,
                "additional_iof": 3.460774,
                "total_iof": 19.58,
                "total_pre_fixed_amount": 107.6655097248,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 72,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 910.73,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 36.1935236262,
                        "principal_amortization_amount": 65.6464763738,
                        "tax_amount": 0.3875767965109152,
                        "total_amount": 101.84,
                        "workdays": 48.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0835236262,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.7393648365913253,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5432872313,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.9696956848062798,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2718587444,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.207818878655416,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4578433774,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.4645309277209473,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.4363159561,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.7123515150140312,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.7935556469,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.983394052470154,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5662629414,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.2589659165472766,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.5649783078,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.554203783920473,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.3036955533,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141715,
                        "principal_amortization_amount": 100.3081858285,
                        "tax_amount": 2.837718577088265,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            },
            {
                "disbursement_date": "2024-11-10",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.56
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.06,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 915.79,
                "issue_amount": 911.23,
                "cet": "2,0200%",
                "annual_cet": "27,0635%",
                "base_iof": 16.0438115087348,
                "additional_iof": 3.462674,
                "total_iof": 19.51,
                "total_pre_fixed_amount": 107.1724201311,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 71,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 911.23,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 35.7004340324,
                        "principal_amortization_amount": 66.1395659676,
                        "tax_amount": 0.3850645530633672,
                        "total_amount": 101.84,
                        "workdays": 48.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0904340324,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.7321865372069436,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5501976375,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.962293427670354,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2787691506,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.200454129395322,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4647537836,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.4569031624724007,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.4432263623,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.7046728086686769,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.8004660531,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.975585414468303,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5731733476,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.2510118112073214,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.571888714,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.546146358734604,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.3106059595,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141716,
                        "principal_amortization_amount": 100.3081858284,
                        "tax_amount": 2.829493305847507,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            },
            {
                "disbursement_date": "2024-11-11",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.56
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.06,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 916.28,
                "issue_amount": 911.72,
                "cet": "2,0200%",
                "annual_cet": "27,0698%",
                "base_iof": 15.971922713858204,
                "additional_iof": 3.464536,
                "total_iof": 19.44,
                "total_pre_fixed_amount": 106.6790635687,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 70,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 911.72,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 35.2070774702,
                        "principal_amortization_amount": 66.6329225298,
                        "tax_amount": 0.382472975321052,
                        "total_amount": 101.84,
                        "workdays": 47.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0870774702,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.7250082378225619,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5468410753,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.9548911705344282,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2754125884,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.193089380135228,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4613972214,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.449275397223854,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.4398698001,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.6969941023233224,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.7971094909,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.967776776466452,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5698167854,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.243057705867366,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.5685321518,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.538088933548735,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.3072493973,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141714,
                        "principal_amortization_amount": 100.3081858286,
                        "tax_amount": 2.8212680346152035,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            },
            {
                "disbursement_date": "2024-11-12",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.56
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.06,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 916.77,
                "issue_amount": 912.21,
                "cet": "2,0200%",
                "annual_cet": "27,0762%",
                "base_iof": 15.899954519820076,
                "additional_iof": 3.466398,
                "total_iof": 19.37,
                "total_pre_fixed_amount": 106.1854398936,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 69,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 912.21,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 34.7134537949,
                        "principal_amortization_amount": 67.1265462051,
                        "tax_amount": 0.3798019984284558,
                        "total_amount": 101.84,
                        "workdays": 46.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0834537949,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.71782993843818,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5432174,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.9474889133985024,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2717889131,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.185724630875134,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4577735461,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.4416476319753073,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.4362461248,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.689315395977968,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.7934858156,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.959968138464601,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5661931101,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.2351036005274114,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.5649084765,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.530031508362866,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.303625722,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141716,
                        "principal_amortization_amount": 100.3081858284,
                        "tax_amount": 2.8130427633716497,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            },
            {
                "disbursement_date": "2024-11-13",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.56
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.06,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 917.27,
                "issue_amount": 912.71,
                "cet": "2,0200%",
                "annual_cet": "27,0802%",
                "base_iof": 15.827906861727051,
                "additional_iof": 3.468298,
                "total_iof": 19.3,
                "total_pre_fixed_amount": 105.691548961,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 68,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 912.71,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 34.2195628621,
                        "principal_amortization_amount": 67.6204371379,
                        "tax_amount": 0.3770515574809304,
                        "total_amount": 101.84,
                        "workdays": 45.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0895628621,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.7106516390537982,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5493264672,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.9400866562625766,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2778979803,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.17835988161504,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4638826133,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.4340198667267607,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.442355192,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.6816366896326136,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.7995948828,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.95215950046275,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5723021773,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.227149495187456,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.5710175437,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.521974083176997,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.3097347892,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141718,
                        "principal_amortization_amount": 100.3081858282,
                        "tax_amount": 2.8048174921281284,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            },
            {
                "disbursement_date": "2024-11-14",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.57
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.07,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 917.77,
                "issue_amount": 913.2,
                "cet": "2,0200%",
                "annual_cet": "27,0870%",
                "base_iof": 15.755779674642707,
                "additional_iof": 3.47016,
                "total_iof": 19.23,
                "total_pre_fixed_amount": 105.1973906257,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 67,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 913.2,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 33.7254045271,
                        "principal_amortization_amount": 68.1145954729,
                        "tax_amount": 0.3742215875281126,
                        "total_amount": 101.84,
                        "workdays": 44.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0854045271,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.7034733396694164,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5451681322,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.9326843991266508,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2737396453,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.170995132354946,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4597242783,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.4263921014782142,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.438196857,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.6739579832872593,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.7954365478,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.944350862460899,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5681438423,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.219195389847501,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.5668592087,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.513916657991128,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.3055764542,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141715,
                        "principal_amortization_amount": 100.3081858285,
                        "tax_amount": 2.79659222089858,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            }
        ]
    }
} 
```

### Objeto Installments

| Campo | Descrição |
|-------|-----------|
| additional_costs | Custos adicionais |
| business_due_date | Data de vencimento em dia útil |
| calendar_days | Dias corridos |
| due_date | Data de vencimento |
| due_interest | Juros do vencimento |
| due_principal | Principal do vencimento |
| fine_amount | Multa do vencimento |
| has_interest | Indica se o vencimento possui juros |
| installment_number | Número da parcela |
| installment_status | Status da parcela |
| installment_type | Tipo de parcela |
| post_fixed_amount | Valor da parcela após juros |
| pre_fixed_amount | Valor da parcela antes de juros |
| principal_amortization_amount | Valor da amortização do principal da parcela |
| tax_amount | Valor dos juros da parcela |
| total_amount | Valor total da parcela |
| workdays | Dias úteis |

### Objeto Prefixed Interest Rate

| Campo | Descrição |
|-------|-----------|
| monthly_rate | Taxa mensal |
| daily_rate | Taxa diária |
| annual_rate | Taxa anual |
| interest_base | Base de cálculo da taxa de juros |

### Webhooks

Caso a operação não seja assinada ou averbada até a última opção de data de desembolso o parceiro receberá um webhook
informando a respeito do cancelamento da operação:

WEBHOOK TYPE
debt

STATUS
Canceled

**Webhook Body**

```json title="Webhook Body"
{
    "key": "<Debt Key>",
    "status": "canceled",
    "webhook_type": "debt",
    "event_datetime": "2025-03-18 13:46:31",
    "data": {
        "cancel_reason": "<CANCEL_REASON>",
        "cancel_reason_enumerator": "<CANCEL_REASON_ENUMERATOR>"
    }
}
```

### Objeto Data

| Campo | Descrição |
|-------|-----------|
| cancel_reason | Motivo do cancelamento |
| cancel_reason_enumerator | Enumerador do motivo do cancelamento |

## 3 - Coleta de documentos e formalização da operação
É obrigatório o envio dos dados complementares do contrato para a formalização da operação.

Recomendamos fortemente que a coleta e assinatura dos documentos da operação sejam realizadas por meio do **QI Sign**, nossa plataforma proprietária de assinatura eletrônica com tecnologia de antifraude embarcada.

Por ter sido desenvolvida internamente e estar totalmente integrada aos nossos sistemas, o uso do QI Sign garante:

- **Automação completa do fluxo de formalização**: a operação segue automaticamente para a próxima etapa após a assinatura.
- **Upload automático de documentos**: todos os arquivos assinados são enviados diretamente para o sistema de crédito, sem necessidade de intervenção manual.
- **Segurança e rastreabilidade**: o processo é seguro, auditável e em conformidade com os requisitos regulatórios.

Essa abordagem reduz erros operacionais, acelera a liberação do crédito e melhora significativamente a experiência do cliente.

### Por que usar o QI Sign?

- **Assinatura remota por celular**, com reconhecimento facial em conformidade com a regulação.
- **Integração via API RESTful**, facilitando automação de fluxos de assinatura.
- **Segurança jurídica**, com diferentes níveis de comprovação de identidade.
- **Soluções escaláveis** e sob demanda para corporações que precisam digitalizar seus processos.

:::info QI Sign
O **QI Sign** é a plataforma de assinatura eletrônica da QI Tech, desenvolvida internamente para atender às exigências regulatórias do mercado de crédito.  
Com suporte a **biometria facial** e **envio automático de documentos**, garante segurança, agilidade e rastreabilidade durante a formalização.

Para mais informações ou para solicitar uma proposta, entre em contato com nosso time comercial:  
📧 **comercial@qitech.com.br**  
📞 **(11) 2339-4763**
:::
### Formalização Externa
Caso a formalização das operações não seja realizada através do QI Sign, o procedimento de formalização deve ser consultado no [manual de formalização externa.](./manual_assinatura_externa.md)

## Webhooks

Após a assinatura do contrato, o parceiro receberá um webhook informando a respeito da assinatura do contrato. Com o seguinte body:

```json
{
    "key": "<Debt Key>",
    "status": "signed",
    "signers": [
        {
            "id": "3271efd3-89ba-43aa-b032-af9a459e6096",
            "images": {
                "face_image_url": "https://qisign-face-images-bucket-sandbox.s3.amazonaws.com/fad7f924-d210-4ec4-9565-a57662a0a65a.jpeg",
                "document_back_url": "https://qisign-personal-documents-bucket-sandbox.s3.amazonaws.com/8c7b68ba-07ad-4188-82ae-679833b2843b.jpeg",
                "document_front_url": "https://qisign-personal-documents-bucket-sandbox.s3.amazonaws.com/f63cd291-5668-4926-be5d-9290aeda3f6e.jpeg",
                "document_back_template": "cnh_back",
                "document_front_template": "cnh_front"
            },
            "biometry": {
                "face_validation": {
                    "score": 80,
                    "provider": "qitech",
                    "available": true
                },
                "fraud_base_flag": false
            },
            "document": {
                "template": "cnh_front",
                "face_match_score": 100
            },
            "liveness": {
                "result": "live"
            },
            "signed_at": "2025-04-09T19:59:39Z",
            "ip_address": "182.224.219.198",
            "signer_data": {
                "name": "Nome Trabalhador",
                "email": "exemplo@qitech.com.br",
                "phone": {
                    "number": "829549234",
                    "area_code": "11",
                    "international_dial_code": "55"
                },
                "address": {
                    "uf": "SP",
                    "city": "Sao Paulo",
                    "number": "123",
                    "street": "Rua tal do sal",
                    "complement": "Ap 23",
                    "postal_code": "00000-000",
                    "neighborhood": "Pinheiros"
                },
                "pix_key": "pix03@pix03.com",
                "birthdate": "1996-03-13",
                "document_number": "504.856.400-66",
                "document_submission_method": "email",
                "authentication_submission_method": "sms"
            }
        }
    ],
    "webhook_type": "laas.credit_operation.status_change",
    "event_datetime": "2025-04-09 20:00:19",
    "signed_contract_url": "https://storage.googleapis.com/sandbox-doc-api/documents/9b55450e-fca5-44f2-9118-5851ed4bd92e/RESTAURANTEBEBBER-TRABALHADOR_SICQ-CCB-0000195364-2230409195718_signed.pdf"
}
```

### Objeto Signers

| Campo | Descrição |
|-------|-----------|
| id | ID do signatário |
| images | Imagens do signatário |

### Objeto Images

| Campo | Descrição |
|-------|-----------|
| face_image_url | URL da imagem da face do signatário |
| document_back_url | URL da imagem do verso do documento do signatário |
| document_front_url | URL da imagem do documento do signatário |
| document_back_template | Template do verso do documento do signatário |
| document_front_template | Template do documento do signatário |

### Objeto Biometry

| Campo | Descrição |
|-------|-----------|
| face_validation | Validação da rosto do signatário (true ou false) |
| face_validation.score | Pontuação da rosto do signatário (0 a 100) |
| face_validation.available | Disponibilidade da validação da rosto do signatário (true ou false) |
| face_validation.provider | Provedor da validação da rosto do signatário (qitech ou external) |
| fraud_base_flag | Flag de fraude base (true ou false) |

### Objeto Document

| Campo | Descrição |
|-------|-----------|
| template | Template do documento (cnh_front, cnh_back, rg_front, rg_back) |
| face_match_score | Pontuação da rosto do signatário (0 a 100) |

### Objeto Liveness

| Campo | Descrição |
|-------|-----------|
| result | Resultado da liveness (live ou spoof) |

### Objeto Signer Data

| Campo | Descrição |
|-------|-----------|
| name | Nome do signatário |
| email | Email do signatário |
| phone | Telefone do signatário |

### Objeto Address

| Campo | Descrição |
|-------|-----------|
| uf | Unidade Federativa |
| city | Cidade |
| number | Número |
| street | Rua |
| complement | Complemento |
| postal_code | CEP |
| neighborhood | Bairro |

## Enumeradores

### Status da reserva {#status-da-reserva}

ENUMERADOR
reservation_status

| Status                        | Descrição                                                                 |
| ----------------------------- | ------------------------------------------------------------------------- |
| pending_auction               | A reserva foi criada e está esperando o início do leilão (receber uma solicitação de proposta).                                |
| pending_reservation           | A reserva foi criada e está pendente de averbação.                                      |
| pending_documents_submission  | A reserva já foi averbada e está pendente de envio de documentos. |
| reserved                      | A reserva foi averbada com sucesso. Fluxo de averbação concluído. |
| canceled                      | Em caso de envio de documentos inválidos, a reserva é cancelada. |
| pending_suspension            | A reserva está averbada e foi solicitada a suspensão. |
| suspended                     | A reserva foi suspensa com sucesso. |
| settled                       | A reserva foi liquidada com sucesso. |
| pending_deletion              | A reserva está averbada e foi solicitada a exclusão. |
| deleted                       | A reserva foi excluída com sucesso. |

---

# Private Payroll Loan Manual - Active Origination Flow

URL: /en/documentation/manual_consignado_privado/manual_detalhamento_fluxo_ativo

:::info Next step
- [Worker Queries](/documentation/manual_consignado_privado/manual_consultas_trabalhador)
:::

## Flow stages

### 1. Worker queries
Perform [worker queries](./manual_consultas_trabalhador.md) to verify the eligibility of employment relationships for payroll loan origination and available payroll deduction margin, along with other information.

### 2. Origination and operation formalization

Execute simulation and credit operation creation calls and guide the borrower through the CCB signing flow.

### 3. Registration

Monitor DATAPREV's response regarding registration attempts.

### 4. Disbursement

Monitor the operation disbursement and handle any disbursement failures.

---

# Private Payroll Loan Manual - Auction Issuance Flow

URL: /en/documentation/manual_consignado_privado/manual_detalhamento_fluxo_leilao

## Flow Steps

### 1. Loan request filter configuration
Configure loan request reception filters in order to select the target audience you wish to target.

### 2. Receiving loan request webhooks and submitting proposals

Receive filtered loan request webhooks, simulate desired credit conditions and submit the proposal to the internal auction.

### 3. Monitoring internal auction proposal status and credit operation signature

Wait for internal auction update webhooks and operation signature.

### 4. Payroll deduction authorization and disbursement monitoring

Authorize the payroll deduction and handle possible payroll deduction and disbursement failures.

---

# Private Payroll Manual - Internal Auction

URL: /en/documentation/manual_consignado_privado/manual_leilao_interno

## 1. Auction Start

After configuring the loan request filters, the partner will start receiving webhooks notifying these requests. 

```json
{
    "status": "ongoing",
    "event_datetime": "2025-03-20T14:47:43Z",
    "key": "88b0203d-31ad-48c6-a795-b6d45ab4898a",
    "webhook_type": "laas.private_payroll_auction.new_issuer_proposal_request",
    "data": {
        "issuer_proposal_request_key": "88b0203d-31ad-48c6-a795-b6d45ab4898a",
        "status": "ongoing",
        "expiration_datetime": "2025-03-21T11:47:12Z",
        "inclusion_limit_datetime": "2025-03-20T11:49:43Z",
        "issuer_proposal_request_data": {
            "issuer_registration_number": "TESTE123",
            "birth_date": "1973-03-14",
            "disbursed_issue_amount": 2100,
            "admission_date": "2020-03-10",
            "consigned_credit_balance": 10000,
            "eligible": true,
            "employer_document_type": "cnpj",
            "document_number": "00737823780",
            "employer_document_number": "29113956000181",
            "number_of_installments": 10,
            "political_exposition": "not_exposed",
            "name": "VALENTINA SANTOS",
            "alerts": [
                {
                    "alert_type": "leave",
                    "description": "Afastamento",
                    "reference_date": "2025-02-11",
                    "event_id": "123456",
                    "leave_reason_code": 3,
                    "leave_start_date": "2025-02-11",
                    "leave_end_date": "2025-03-11"
                },
                {
                    "alert_type": "termination",
                    "description": "Desligamento",
                    "reference_date": "2025-02-11", 
                    "event_id": "789012",
                    "termination_reason_code": 1,
                    "termination_date": "2025-02-11",
                    "notice_period_start_date": "2025-01-11",
                    "notice_period_end_date": "2025-02-11"
                }
            ]
        },
    }
}
```

Each loan request goes through two stages: the internal auction and the auction in the CTPS app. The internal auction starts as soon as the webhook is received and ends at the timestamp indicated in the *inclusion_limit_datetime* field. During this period, proposals from all partners are received and ranked based on the rate. Once the internal auction ends, the proposal with the best conditions is sent to the borrower's CTPS where proposals from all FIs are presented.
If no proposal is sent by the end of the internal auction, the first proposal sent after the *inclusion_limit_datetime* will automatically win and be sent to the CTPS.

## 2. Credit Proposal  

### Request

ENDPOINT - `/private_payroll_auction/issuer_proposal_request/{issuer_proposal_request_key}/auction_proposal`
METHOD - `POST`

Request Body: Including an AuctionProposal in the auction

**Disbursed Amount & Interest Rate**

```json
{
    "request_control_key" : "111e7ed3-4080-4cae-a853-8e12812817ea",
    "disbursed_issue_amount": 15000,
    "monthly_interest_rate": 0.02,
    "number_of_installments": 48,
    "purchaser_document_number": "01272247000120",
    "days_to_expiration": 10,
    "rebates": [
        {
            "fee_type": "spread",
            "amount_type": "percentage",
            "amount": 4.17
        }
    ]
}
```

**Installment Value & Interest Rate**

```json
{
    "request_control_key" : "111e7ed3-4080-4cae-a853-8e12812817ea",
    "installment_face_value": 1000,
    "monthly_interest_rate": 0.02,
    "number_of_installments": 48,
    "purchaser_document_number": "01272247000120",
    "days_to_expiration": 10,
    "rebates": [
        {
            "fee_type": "spread",
            "amount_type": "percentage",
            "amount": 4.17
        }
    ]
}
```

### Response

STATUS - 200 (Accepted)

Response Body: Proposal created

```json
{
  "auction_proposal_key": "814e7ed3-4080-4cae-a853-8e12812817ea",
  "issuer_proposal_request_key" : "100e7ed3-4080-4cae-a853-8e12812817ea",
  "request_control_key" : "111e7ed3-4080-4cae-a853-8e12812817ea",
  "status": "bid",
  "proposal_score" : 0.4,
  "inclusion_date" : "2025-03-18T14:52:07.123456",
  "rank_position" : null,
  "proposal_data": {
        "simulation": {
            "total_iof": 15.46,
            "annual_cet": 0.0603,
            "monthly_cet": 0.0049,
            "issue_amount": 1015.46,
            "annual_interest_rate": 0.0180272568,
            "monthly_interest_rate": 0.00149,
            "disbursed_issue_amount": 1000.0,
            "installment_face_value": 102.25,
            "number_of_installments" : 48
        },
        "monthly_interest_rate": null,
        "disbursed_issue_amount": 15000,
        "installment_face_value": 102.25,
        "number_of_installments": 48
  },
}
```

STATUS - 400 (Rejected)

Response Body: Bad Request

```json
{
  "title": "Bad Request",
  "description": "Calculated installment face value is greater than consigned credit balance",
  "translation": "Schema Invalido",
  "extra_fields": {},
  "code": "QIT000001"
}
```

## 3. Auction Closure

When the internal auction ends, a webhook is sent updating the partner on whether they won or lost the auction. In case of victory, the credit operation is created and the QI Sign formalization link is sent to the borrower's CTPS app. From this moment on, the operation monitoring should be performed through the *credit_operation_key*.

WEBHOOK_TYPE laas.private_payroll_auction.end_of_auction

```json
{
    "key": "250cfea5-99dc-4c80-be3e-2231350cf9a2", // esta chave é igual à auction_proposal_key
    "data": {
        "auction_proposal_key": "250cfea5-99dc-4c80-be3e-2231350cf9a2",
        "status": "won",
        "type": "auction",
        "rank_position": 1,
        "signature_url": "https://sandbox.sign.qitech.com.br/r/3D1s523",
        "credit_operation_key": "9e06ca79-3610-4794-8312-9663e0343f6b",
        "issuer_proposal_request_key": "262d0584-9827-4652-9b27-6a46c9832f38"
    },
    "status": "won",
    "event_datetime": "2025-03-20T14:48:43Z",
    "webhook_type": "laas.private_payroll_auction.end_of_auction"
}
```

The credit operation key will be sent with a null value for losing proposals.

:::info Attention
The signature link will not be sent in the production environment, only in sandbox so that it is possible to simulate the borrower's signature.
:::

## Attachments

### IssuerProposalRequest Object Definition

| Name            | Type   | Description                                                                          |
| --------------- | ------ | ---------------------------------------------------------------------------------- |
| issuer_proposal_request_key | string  | Unique identifier of the **Proposal Request** |
| issuer_proposal_request_data| object  | Object that describes the **Proposal Request** data |
| status                      | string  | Status of the **Proposal Request** (`ongoing`, `finished`, `expired`)|

### IssuerProposalRequestData Object Definition

| Name            | Type   | Description                                                                          |
| --------------- | ------ | ---------------------------------------------------------------------------------- |
| name                        |string | Full name of the Borrower |
| document_number             |string | CPF of the Borrower |
| birth_date                  |string | Date of birth of the Borrower in `YYYY-MM-DD` format |
| disbursed_amount            |float  | Disbursement amount requested by the borrower |
| number_of_installments      |integer| Number of installments requested by the borrower |
| consigned_credit_balance    |float  | Available consigned credit balance of the borrower |
| admission_date              |string | Date of admission of the worker in the current position in `YYYY-MM-DD` format |
| issuer_registration_code    |string | eSocial registration number of the employee|
| employer_document_number    |string | CNPJ of the employer |
| eligible                    |boolean| True if eligible, False if not eligible|
| employer_document_type      |string | CNPJ or CPF|
|alerts                         |List with history of leaves and employment termination notices, for field details check the table [alerts object details](#alerts)|

### alerts object details {#alerts}
| Field                         | Description                          | 
|-------------------------      |------------------------------------|
|alert_type                     |Alert type, check possible enumerators in the table [Alert types](#alert_type)|
|reference_date                 |Event reference date|
|event_id                       |Event identifier|
|leave_reason_code              |[Leave reason](https://www.gov.br/esocial/pt-br/documentacao-tecnica/leiautes-esocial-versao-1-3-nt-03-2025/tabelas.html#18) in accordance with the eSocial website|
|leave_start_date               |Leave start date|
|leave_end_date                 |Leave end date|
|termination_reason_code        |[Termination reason](https://www.gov.br/esocial/pt-br/documentacao-tecnica/leiautes-esocial-versao-1-3-nt-03-2025/tabelas.html#19) in accordance with the eSocial website|
|termination_date               |Employment termination date|
|notice_period_start_date       |Prior notice period start date|
|notice_period_end_date         |Prior notice period end date|

### Alert types {#alert_type}
ENUMERATOR
alert_type
| Enumerator                    | Description                         | 
|-------------------------      |-----------------------------------|
|leave                          |Leave of absence                   |
|termination                    |Prior notice of termination        |

### Proposal Request Status Details

| Status  | Description                                                                 |
| ------- | ------------------------------------------------------------------------- |
| ongoing | **Proposal Request** in progress, the auction remains active.  |
| finished| **Proposal Request** completed, the auction has ended and a submitted **Proposal** was accepted and included. |
| expired | **Proposal Request** expired, the auction has ended without the inclusion of any **Proposal** in due time.  |

### Auction Proposal Request Details

| Field         | Type    | Description                                                                                                       | Required |
|---------------|---------|-----------------------------------------------------------------------------------------------------------------|----------|
| `issuer_proposal_request_key` | string  | Unique identification key of the **IssuerProposalRequest** included in uuid v4 format.                          | Yes      |
| `auction_proposal_key` | string  | Unique identification key of the **AuctionProposal** included in uuid v4 format.                                | Yes      |
| `disbursed_issue_amount`| float   | Disbursement amount intended by the **Proposal**.                                                               | Yes      |
| `purchaser_document_number` | integer | CNPJ of the debt purchaser | Yes      |
| `monthly_interest_rate` | float   | Monthly interest rate of the **Proposal** in the range of 0 to 1 (0% to 100%, respectively).                   | No       |
| `installment_face_value`| float   | Installment value intended by the **Proposal**.                                                                 | No       |
| `number_of_installments`| integer | Number of installments of the proposal.                                                                         | Yes      |
| `days_to_expiration`| integer | Number of days until the proposal expires. If the key is not included, the proposal validity will be 7 days    | No       |
| `rebates` | list    | List of credit operation rebates. Uses the same standard as active issuance (/debt)                            | No       |

---

# Manual Consignado Privado - Refinanciamento

URL: /en/documentation/manual_consignado_privado/manual_refinanciamento

:::info 
Este manual é dedicado a documentar o refinanciamento de operações originadas na QI Tech já no crédito do trabalhador, ou de operações legado tombadas para o crédito do trabalhador.
:::

:::danger Opções de desembolso
Como no crédito novo, as operações de refinanciamento terão suas opções de desembolso limitadas à uma mesma competência, além disso, uma vez averbada a operação de refinanciamento deverá desembolsar na mesma data, caso contrário será cancelada permanentemente e precisará ser reformalizada.
:::

:::warning Data de liquidação
Para garantir o direito de arrependimento do tomador, as operações refinanciadas somente serão liquidadas 7 dias úteis após a data de desembolso da dívida. 
:::

Para simular e emitir dívidas de refinanciamento, deve-se adicionar ao payload as chaves das dívidas que serão refinanciadas no seguinte formato:

REFINANCIAMENTO

```json 
  "refinanced_credit_operations": [
    {
      "operation_key": "c63f3a4c-0cde-4be7-8bb2-00ffc564cddb"
    }
  ]
```

## 1 - Simulação da dívida:

### Request

**POST**
/debt_simulation

```json title='Request Body'
{
    "borrower": {
        "person_type": "natural"
    },
    "financial": {
        "first_due_date": "2024-12-07",
        "installment_face_value": 100,
        "disbursement_date": "2024-11-05",
        "limit_days_to_disburse": 3,
        "number_of_installments": 4,
        "monthly_interest_rate": 0.018,
        "interest_type": "pre_price_days",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "principal_grace_period": 0
    },
    "collaterals": [
        {
            "collateral_type": "private_payroll"
        }
    ],
    "refinanced_credit_operations": [
        {
        "operation_key": "c63f3a4c-0cde-4be7-8bb2-00ffc564cddb"
        }
    ]
}
```

### Response

STATUS
**200** (OK)

**Response Body**

```json
{
    "type": "debt",
    "key": "<Debt Key>",
    "status": "finished",
    "event_datetime": "2024-11-05 16:50:00",
    "data": {
        "interest_type": "pre_price_days",
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "interest_payment_month_period": 1,
        "principal_grace_period": 0,
        "principal_amortization_month_period": 1,
        "operation_type": "refinancing",
        "post_fixed_interest_base": "workdays",
        "post_fixed_interest_rate": null,
        "prefixed_interest_rate": {
            "interest_base": "calendar_days_365",
            "annual_rate": 0.23872053,
            "monthly_rate": 0.018,
            "daily_rate": 0.00058669
        },
        "issue_date": "2024-11-05",
        "number_of_installments": 4,
        "requester_key": "e5eb6a0a-e003-4cbd-b702-5a25bf71af0a",
        "final_disbursement_amount": 0.0,
        "disbursement_options": [
            {
                "iof_amount": 3.93,
                "total_pre_fixed_amount": 17.8715883143,
                "cet": 0.0257,
                "annual_cet": 0.355163,
                "contract_fees": [
                    {
                        "fee_type": "tac",
                        "amount_type": "percentage",
                        "amount": 0.6,
                        "fee_amount": 2.29
                    },
                    {
                        "fee_type": "ted_fee",
                        "amount_type": "absolute",
                        "amount": 1.0,
                        "fee_amount": 1.0
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "insurance_premium",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "tac",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    }
                ],
                "contract_fee_amount": 2.29,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "disbursement_date": "2024-11-05",
                "first_due_date": "2024-12-21",
                "installments": [
                    {
                        "calendar_days": 34,
                        "workdays": 23.0,
                        "business_due_date": "2024-12-21",
                        "due_date": "2024-12-21",
                        "due_principal": 382.13,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 7.6967422515,
                        "tax_amount": 0.257341482602818,
                        "total_amount": 100,
                        "principal_amortization_amount": 92.3032577485,
                        "installment_number": 1
                    },
                    {
                        "calendar_days": 29,
                        "workdays": 19.0,
                        "business_due_date": "2025-01-21",
                        "due_date": "2025-01-21",
                        "due_principal": 289.8267422515,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.9718040699,
                        "tax_amount": 0.4909156601748966,
                        "total_amount": 100,
                        "principal_amortization_amount": 95.0281959301,
                        "installment_number": 2
                    },
                    {
                        "calendar_days": 31,
                        "workdays": 23.0,
                        "business_due_date": "2025-02-21",
                        "due_date": "2025-02-21",
                        "due_principal": 194.7985463214,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5742034136,
                        "tax_amount": 0.7432500400879712,
                        "total_amount": 100,
                        "principal_amortization_amount": 96.4257965864,
                        "installment_number": 3
                    },
                    {
                        "calendar_days": 28,
                        "workdays": 18.0,
                        "business_due_date": "2025-03-21",
                        "due_date": "2025-03-21",
                        "due_principal": 98.372749735,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.6288385793,
                        "tax_amount": 0.9841050988526828,
                        "total_amount": 100,
                        "principal_amortization_amount": 98.3711614207,
                        "installment_number": 4
                    }
                ],
                "issue_amount": 382.13,
                "disbursed_issue_amount": 374.91,
                "assignment_amount": 382.13,
                "final_disbursement_amount": 374.91,
                "prefixed_interest_rate": {
                    "interest_base": "calendar_days_365",
                    "annual_rate": 0.23872053,
                    "monthly_rate": 0.018,
                    "daily_rate": 0.00058669
                }
            },
            {
                "iof_amount": 4.77,
                "total_pre_fixed_amount": 24.2597288075,
                "cet": 0.0243,
                "annual_cet": 0.334037,
                "contract_fees": [
                    {
                        "fee_type": "tac",
                        "amount_type": "percentage",
                        "amount": 0.6,
                        "fee_amount": 2.25
                    },
                    {
                        "fee_type": "ted_fee",
                        "amount_type": "absolute",
                        "amount": 1.0,
                        "fee_amount": 1.0
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "insurance_premium",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "tac",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    }
                ],
                "contract_fee_amount": 2.25,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "disbursement_date": "2024-11-06",
                "first_due_date": "2025-01-21",
                "installments": [
                    {
                        "calendar_days": 62,
                        "workdays": 41.0,
                        "business_due_date": "2025-01-21",
                        "due_date": "2025-01-21",
                        "due_principal": 375.74,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 13.9149280115,
                        "tax_amount": 0.437656505989534,
                        "total_amount": 100,
                        "principal_amortization_amount": 86.0850719885,
                        "installment_number": 1
                    },
                    {
                        "calendar_days": 31,
                        "workdays": 23.0,
                        "business_due_date": "2025-02-21",
                        "due_date": "2025-02-21",
                        "due_principal": 289.6549280115,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 5.3146959395,
                        "tax_amount": 0.722070128765373,
                        "total_amount": 100,
                        "principal_amortization_amount": 94.6853040605,
                        "installment_number": 2
                    },
                    {
                        "calendar_days": 28,
                        "workdays": 18.0,
                        "business_due_date": "2025-03-21",
                        "due_date": "2025-03-21",
                        "due_principal": 194.969623951,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.2283291407,
                        "tax_amount": 0.9601685182659746,
                        "total_amount": 100,
                        "principal_amortization_amount": 96.7716708593,
                        "installment_number": 3
                    },
                    {
                        "calendar_days": 31,
                        "workdays": 21.0,
                        "business_due_date": "2025-04-07",
                        "due_date": "2025-04-07",
                        "due_principal": 98.1979530917,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.8017757158,
                        "tax_amount": 1.2239426674782687,
                        "total_amount": 100,
                        "principal_amortization_amount": 98.1982242842,
                        "installment_number": 4
                    }
                ],
                "issue_amount": 375.74,
                "disbursed_issue_amount": 367.72,
                "assignment_amount": 375.74,
                "final_disbursement_amount": 367.72,
                "prefixed_interest_rate": {
                    "interest_base": "calendar_days_365",
                    "annual_rate": 0.23872053,
                    "monthly_rate": 0.018,
                    "daily_rate": 0.00058669
                }
            },
            {
                "iof_amount": 4.74,
                "total_pre_fixed_amount": 24.0392857898,
                "cet": 0.0243,
                "annual_cet": 0.334673,
                "contract_fees": [
                    {
                        "fee_type": "tac",
                        "amount_type": "percentage",
                        "amount": 0.6,
                        "fee_amount": 2.26
                    },
                    {
                        "fee_type": "ted_fee",
                        "amount_type": "absolute",
                        "amount": 1.0,
                        "fee_amount": 1.0
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "insurance_premium",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "tac",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    }
                ],
                "contract_fee_amount": 2.26,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "disbursement_date": "2024-11-07",
                "first_due_date": "2025-01-21",
                "installments": [
                    {
                        "calendar_days": 61,
                        "workdays": 40.0,
                        "business_due_date": "2025-01-21",
                        "due_date": "2025-01-21",
                        "due_principal": 375.96,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 13.6944849939,
                        "tax_amount": 0.4317001860605122,
                        "total_amount": 100,
                        "principal_amortization_amount": 86.3055150061,
                        "installment_number": 1
                    },
                    {
                        "calendar_days": 31,
                        "workdays": 23.0,
                        "business_due_date": "2025-02-21",
                        "due_date": "2025-02-21",
                        "due_principal": 289.6544849939,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 5.3146959395,
                        "tax_amount": 0.714305933832412,
                        "total_amount": 100,
                        "principal_amortization_amount": 94.6853040605,
                        "installment_number": 2
                    },
                    {
                        "calendar_days": 28,
                        "workdays": 18.0,
                        "business_due_date": "2025-03-21",
                        "due_date": "2025-03-21",
                        "due_principal": 194.9691809334,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.2283291407,
                        "tax_amount": 0.952233241255512,
                        "total_amount": 100,
                        "principal_amortization_amount": 96.7716708593,
                        "installment_number": 3
                    },
                    {
                        "calendar_days": 31,
                        "workdays": 21.0,
                        "business_due_date": "2025-04-07",
                        "due_date": "2025-04-07",
                        "due_principal": 98.1975100741,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.8017757157,
                        "tax_amount": 1.2158904130882027,
                        "total_amount": 100,
                        "principal_amortization_amount": 98.1982242843,
                        "installment_number": 4
                    }
                ],
                "issue_amount": 375.96,
                "disbursed_issue_amount": 367.96,
                "assignment_amount": 375.96,
                "final_disbursement_amount": 367.96,
                "prefixed_interest_rate": {
                    "interest_base": "calendar_days_365",
                    "annual_rate": 0.23872053,
                    "monthly_rate": 0.018,
                    "daily_rate": 0.00058669
                }
            },
            {
                "iof_amount": 4.71,
                "total_pre_fixed_amount": 23.8187134405,
                "cet": 0.0244,
                "annual_cet": 0.335196,
                "contract_fees": [
                    {
                        "fee_type": "tac",
                        "amount_type": "percentage",
                        "amount": 0.6,
                        "fee_amount": 2.26
                    },
                    {
                        "fee_type": "ted_fee",
                        "amount_type": "absolute",
                        "amount": 1.0,
                        "fee_amount": 1.0
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "insurance_premium",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "tac",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    }
                ],
                "contract_fee_amount": 2.26,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "disbursement_date": "2024-11-08",
                "first_due_date": "2025-01-21",
                "installments": [
                    {
                        "calendar_days": 60,
                        "workdays": 39.0,
                        "business_due_date": "2025-01-21",
                        "due_date": "2025-01-21",
                        "due_principal": 376.18,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 13.4739126445,
                        "tax_amount": 0.42570834978906,
                        "total_amount": 100,
                        "principal_amortization_amount": 86.5260873555,
                        "installment_number": 1
                    },
                    {
                        "calendar_days": 31,
                        "workdays": 23.0,
                        "business_due_date": "2025-02-21",
                        "due_date": "2025-02-21",
                        "due_principal": 289.6539126445,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 5.3146959395,
                        "tax_amount": 0.706541738899451,
                        "total_amount": 100,
                        "principal_amortization_amount": 94.6853040605,
                        "installment_number": 2
                    },
                    {
                        "calendar_days": 28,
                        "workdays": 18.0,
                        "business_due_date": "2025-03-21",
                        "due_date": "2025-03-21",
                        "due_principal": 194.968608584,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.2283291407,
                        "tax_amount": 0.9442979642450494,
                        "total_amount": 100,
                        "principal_amortization_amount": 96.7716708593,
                        "installment_number": 3
                    },
                    {
                        "calendar_days": 31,
                        "workdays": 21.0,
                        "business_due_date": "2025-04-21",
                        "due_date": "2025-04-21",
                        "due_principal": 98.1969377247,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.8017757158,
                        "tax_amount": 1.20783815869566,
                        "total_amount": 100,
                        "principal_amortization_amount": 98.1982242842,
                        "installment_number": 4
                    }
                ],
                "issue_amount": 376.18,
                "disbursed_issue_amount": 368.21,
                "assignment_amount": 376.18,
                "final_disbursement_amount": 368.21,
                "prefixed_interest_rate": {
                    "interest_base": "calendar_days_365",
                    "annual_rate": 0.23872053,
                    "monthly_rate": 0.018,
                    "daily_rate": 0.00058669
                },
                "refinanced_credit_operations": [
                    {
                        "due_balance": 833.55,
                        "due_balance_reference_date": "2025-07-16",
                        "original_deadline": 275,
                        "refinanced_credit_operation_key": "dd65582d-ea63-44ab-8ee8-438b2d7246c7",
                        "refinanced_credit_operation_status": "pending_payment"
                    }
                ]
            }
        ]
    }
}
```

---

## 2 - Emissão da operação:

REFINANCIAMENTO

### Request

**POST**
/debt

```json title='Request Body'
{
    "borrower": {
        "name": "Nome devedor",
        "email":"email.devedor@gmail.com",
        "phone": {
            "number": "999538380",
            "area_code": "84",
            "country_code": "055"
        },
        "gender": "female",
        "political_exposition": "not_exposed",
        "address": {
            "city": "Natal",
            "state": "RN",
            "number": "1984",
            "street": "Rua",
            "complement": "complemento",
            "postal_code": "59065720",
            "neighborhood": "bairro"
        },
        "role_type": "issuer",
        "birth_date": "1959-07-08",
        "mother_name": "NOME DA MAE",
        "nationality": "Brasileiro",
        "person_type": "natural",
        "marital_status": "single",
        "attached_documents_list": [],
        "individual_document_number": "14471835092",
        "document_identification_date": "2015-10-02",
        "document_identification_type": "rg",
        "document_identification_number": "003709888"
    },
    "financial": {
        "interest_type": "pre_price_days",
        "first_due_date": "2023-09-21",
        "disbursement_date": "2024-11-07",
        "fine_configuration": {
            "monthly_rate": 0.0166,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0
        },
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "monthly_interest_rate": 0.0166,
        "installment_face_value": 101.84,
        "limit_days_to_disburse": 7,
        "number_of_installments": 10,
        "principal_grace_period": 0,
        "rebates": [ // Opcional
            {
                "amount": 20,
                "rebate_bank_account": {
                    "name": "Teste Ltda",
                    "document_number": "18533555000164",
                    "account_digit": "0",
                    "account_number": "4290001",
                    "branch_number": "0001",
                    "bank_code": "329"
                },
                "amount_type": "percentage",
                "fee_type": "spread"
            }
        ]
    },
    "simplified": true,
    "collaterals": [
        {
            "percentage": 1,
            "collateral_type": "private_payroll",
            "collateral_data": {
                "employer_document_number": "07940839000159",
                "registration_number": "99999999999-A"
            }
        }
    ],
    "additional_data": {
        "contract": {
            "contract_number": "TST0000644799"
        }
    },
    "purchaser_document_number": "32402502000135",
    "disbursement_bank_accounts": [
        {
            "name": "NOME DEVEDOR",
            "bank_code": "001",
            "account_digit": "0",
            "branch_number": "2874",
            "account_number": "000057555",
            "document_number": "14471835092",
            "transfer_method": "pix",
            "percentage_receivable": 100
        }
    ],
    "refinanced_credit_operations": [
        {
        "operation_key": "dd65582d-ea63-44ab-8ee8-438b2d7246c7"
        }
    ]
}
```

### Response

STATUS
**201** (Created)

**Response Body**

```json title="Response Body"
{
    "webhook_type": "debt",
    "key": "<Debt Key>",
    "status": "waiting_signature",
    "event_datetime": "2024-11-07 23:19:22",
    "data": {
        "borrower": {
            "name": "Nome devedor",
            "document_number": "14471835092",
            "related_party_key": "28b7fc16-6d1f-467d-9667-62a8c13daea6"
        },
        "contract": {
            "number": "TST0000644710",
            "urls": [
                "https://storage.googleapis.com/sandbox-doc-api/documents/a2e9c83a-3666-4def-8b27-e96fabb8705c/NOME_DEVEDOR-CCB-TST0000644710-20241107231916.pdf"
            ],
            "signature_information": [
                {
                    "signer_name": "Nome devedor",
                    "signer_document_number": "14471835092",
                    "signer_role": "issuer",
                    "signer_email": null,
                    "signer_external_key": null,
                    "signature_url": null
                }
            ]
        },
        "requester_identifier_key": "eb859ebe-3a41-49bf-a6c3-d6902039ec00",
        "iof_charge_method": "financed",
        "collaterals": [
            {
                "absolute_amount": null,
                "collateral_constituted": false,
                "collateral_data": {
                    "registration_number": "99999999999-A",
                    "employer_document_number": "07940839000159"
                },
                "collateral_key": "26c7f4f4-51f3-41fa-b880-9691211136aa",
                "collateral_type": "private_payroll",
                "created_at": "2024-11-07T23:19:16.413448",
                "external_key": null,
                "percentage": 1,
                "updated_at": "2024-11-07T23:19:16.413441"
            }
        ],
        "disbursement_options": [
            {
                "disbursement_date": "2024-11-07",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.55
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.05,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 914.3,
                "issue_amount": 909.75,
                "cet": "2,0100%",
                "annual_cet": "27,0481%",
                "base_iof": 16.259002146803677,
                "additional_iof": 3.45705,
                "total_iof": 19.72,
                "total_pre_fixed_amount": 108.6508885851,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 74,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 909.75,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 37.1789024864,
                        "principal_amortization_amount": 64.6610975136,
                        "tax_amount": 0.3923635397125248,
                        "total_amount": 101.84,
                        "workdays": 49.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0889024864,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.753721435360089,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5486660915,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.9845001990781314,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2772376046,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.222548377175604,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4632222376,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.4797864582180404,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.4416948163,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.72770892770474,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.7989345071,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.999011328473856,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5716418016,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.274874127227187,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.570357168,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.570318634292211,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.3090744135,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141716,
                        "principal_amortization_amount": 100.3081858284,
                        "tax_amount": 2.8541691195612935,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            },
            {
                "disbursement_date": "2024-11-08",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.55
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.05,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 914.79,
                "issue_amount": 910.24,
                "cet": "2,0200%",
                "annual_cet": "27,0539%",
                "base_iof": 16.187351160427028,
                "additional_iof": 3.458912,
                "total_iof": 19.65,
                "total_pre_fixed_amount": 108.1583324947,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 73,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 910.24,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 36.6863463961,
                        "principal_amortization_amount": 65.1536536039,
                        "tax_amount": 0.3900097704729454,
                        "total_amount": 101.84,
                        "workdays": 48.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0863463961,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.7465431359757072,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5461100012,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.9770979419422056,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2746815143,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.21518362791551,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4606661473,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.4721586929694939,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.439138726,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.7200302213593857,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.7963784168,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.991202690472005,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5690857113,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.266920021887232,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.5678010777,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.562261209106342,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.3065183232,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141715,
                        "principal_amortization_amount": 100.3081858285,
                        "tax_amount": 2.845943848326202,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            },
            {
                "disbursement_date": "2024-11-09",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.55
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.05,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 915.28,
                "issue_amount": 910.73,
                "cet": "2,0200%",
                "annual_cet": "27,0599%",
                "base_iof": 16.115620969325082,
                "additional_iof": 3.460774,
                "total_iof": 19.58,
                "total_pre_fixed_amount": 107.6655097248,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 72,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 910.73,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 36.1935236262,
                        "principal_amortization_amount": 65.6464763738,
                        "tax_amount": 0.3875767965109152,
                        "total_amount": 101.84,
                        "workdays": 48.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0835236262,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.7393648365913253,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5432872313,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.9696956848062798,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2718587444,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.207818878655416,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4578433774,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.4645309277209473,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.4363159561,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.7123515150140312,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.7935556469,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.983394052470154,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5662629414,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.2589659165472766,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.5649783078,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.554203783920473,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.3036955533,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141715,
                        "principal_amortization_amount": 100.3081858285,
                        "tax_amount": 2.837718577088265,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            },
            {
                "disbursement_date": "2024-11-10",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.56
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.06,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 915.79,
                "issue_amount": 911.23,
                "cet": "2,0200%",
                "annual_cet": "27,0635%",
                "base_iof": 16.0438115087348,
                "additional_iof": 3.462674,
                "total_iof": 19.51,
                "total_pre_fixed_amount": 107.1724201311,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 71,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 911.23,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 35.7004340324,
                        "principal_amortization_amount": 66.1395659676,
                        "tax_amount": 0.3850645530633672,
                        "total_amount": 101.84,
                        "workdays": 48.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0904340324,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.7321865372069436,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5501976375,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.962293427670354,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2787691506,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.200454129395322,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4647537836,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.4569031624724007,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.4432263623,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.7046728086686769,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.8004660531,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.975585414468303,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5731733476,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.2510118112073214,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.571888714,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.546146358734604,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.3106059595,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141716,
                        "principal_amortization_amount": 100.3081858284,
                        "tax_amount": 2.829493305847507,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            },
            {
                "disbursement_date": "2024-11-11",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.56
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.06,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 916.28,
                "issue_amount": 911.72,
                "cet": "2,0200%",
                "annual_cet": "27,0698%",
                "base_iof": 15.971922713858204,
                "additional_iof": 3.464536,
                "total_iof": 19.44,
                "total_pre_fixed_amount": 106.6790635687,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 70,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 911.72,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 35.2070774702,
                        "principal_amortization_amount": 66.6329225298,
                        "tax_amount": 0.382472975321052,
                        "total_amount": 101.84,
                        "workdays": 47.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0870774702,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.7250082378225619,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5468410753,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.9548911705344282,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2754125884,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.193089380135228,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4613972214,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.449275397223854,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.4398698001,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.6969941023233224,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.7971094909,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.967776776466452,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5698167854,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.243057705867366,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.5685321518,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.538088933548735,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.3072493973,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141714,
                        "principal_amortization_amount": 100.3081858286,
                        "tax_amount": 2.8212680346152035,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            },
            {
                "disbursement_date": "2024-11-12",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.56
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.06,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 916.77,
                "issue_amount": 912.21,
                "cet": "2,0200%",
                "annual_cet": "27,0762%",
                "base_iof": 15.899954519820076,
                "additional_iof": 3.466398,
                "total_iof": 19.37,
                "total_pre_fixed_amount": 106.1854398936,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 69,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 912.21,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 34.7134537949,
                        "principal_amortization_amount": 67.1265462051,
                        "tax_amount": 0.3798019984284558,
                        "total_amount": 101.84,
                        "workdays": 46.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0834537949,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.71782993843818,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5432174,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.9474889133985024,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2717889131,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.185724630875134,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4577735461,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.4416476319753073,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.4362461248,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.689315395977968,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.7934858156,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.959968138464601,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5661931101,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.2351036005274114,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.5649084765,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.530031508362866,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.303625722,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141716,
                        "principal_amortization_amount": 100.3081858284,
                        "tax_amount": 2.8130427633716497,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            },
            {
                "disbursement_date": "2024-11-13",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.56
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.06,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 917.27,
                "issue_amount": 912.71,
                "cet": "2,0200%",
                "annual_cet": "27,0802%",
                "base_iof": 15.827906861727051,
                "additional_iof": 3.468298,
                "total_iof": 19.3,
                "total_pre_fixed_amount": 105.691548961,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 68,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 912.71,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 34.2195628621,
                        "principal_amortization_amount": 67.6204371379,
                        "tax_amount": 0.3770515574809304,
                        "total_amount": 101.84,
                        "workdays": 45.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0895628621,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.7106516390537982,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5493264672,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.9400866562625766,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2778979803,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.17835988161504,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4638826133,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.4340198667267607,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.442355192,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.6816366896326136,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.7995948828,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.95215950046275,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5723021773,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.227149495187456,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.5710175437,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.521974083176997,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.3097347892,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141718,
                        "principal_amortization_amount": 100.3081858282,
                        "tax_amount": 2.8048174921281284,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            },
            {
                "disbursement_date": "2024-11-14",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.57
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.07,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 917.77,
                "issue_amount": 913.2,
                "cet": "2,0200%",
                "annual_cet": "27,0870%",
                "base_iof": 15.755779674642707,
                "additional_iof": 3.47016,
                "total_iof": 19.23,
                "total_pre_fixed_amount": 105.1973906257,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 67,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 913.2,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 33.7254045271,
                        "principal_amortization_amount": 68.1145954729,
                        "tax_amount": 0.3742215875281126,
                        "total_amount": 101.84,
                        "workdays": 44.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0854045271,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.7034733396694164,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5451681322,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.9326843991266508,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2737396453,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.170995132354946,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4597242783,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.4263921014782142,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.438196857,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.6739579832872593,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.7954365478,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.944350862460899,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5681438423,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.219195389847501,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.5668592087,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.513916657991128,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.3055764542,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141715,
                        "principal_amortization_amount": 100.3081858285,
                        "tax_amount": 2.79659222089858,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            }
        ]
    }
} 
```

## Anexo
### Campos relevantes

| Campo                                             | Descrição                                                                                                                                                                                                        |
|---------------------------------                  |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **issue_amount**                                  | Valor de emissão                                                                                                                            |
| **disbursed_issue_amount**                        | Valor total desembolsado (troco + quitações)                                                                                |
| **final_disbursement_amount**                     | Valor do troco                                                                            |
| **refinanced_credit_operations.due_balance**      | Saldo devedor da dívida refinanciada |

---

# Insurance

URL: /en/documentation/manual_consignado_privado/manual_seguro

**This manual goes through the steps of the payroll credit issuance flow linked to insurance contracting. The disbursement of these operations will be carried out in an internal account owned by the borrower, opened during the issuance flow. From this account, a split will occur in the credit disbursement, transferring part of the disbursed amount to an external account to QI owned by the borrower and the remainder for the insurance premium payment.**

## 1. BC PROTEGE+ Query

The insurance issuance flow along with a credit operation will involve opening an internal account at QI owned by the borrower. To open the account, it is necessary that the borrower is not on the [BC PROTEGE+](https://www.bcb.gov.br/meubc/bcprotege) list.
It is possible to perform the query via API using the following endpoint. If the borrower is on the list, the insurance will be canceled after formalization.

GET /bacen_protect/validate/ [document_number]

Response Body

**Account opening approved**

```json
{
    "permission_result": "approved"
}
```

**Account opening rejected**

```json
{
    "permission_result": "rejected"
}
```

:::info Sandbox Testing
CPFs starting with 9 will return rejected permission.
:::

## 2. Debt simulation and issuance

To simulate and issue a debt linked to insurance issuance, an object must be added to the rebates list within the financial object.

```json title='Rebate Object'
{
  "rebates": [
    {
      "fee_type": "insurance_premium_qi",
      "description": "insurance_premium_description"
    }
  ]
}
```

### Simulation payload example

POST /debt

request_body

```json
{
    "borrower": {
        "person_type": "natural"
    },
    "financial": {
        "first_due_date": "2024-12-07",
        "installment_face_value": 100,
        "disbursement_date": "2024-11-05",
        "limit_days_to_disburse": 3,
        "number_of_installments": 4,
        "monthly_interest_rate": 0.018,
        "interest_type": "pre_price_days",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "principal_grace_period": 0,
        "rebates": [
          {
            "fee_type": "insurance_premium_qi",
            "description": "insurance_premium_description"
          }
        ]
    }
}
```

### Issuance payload example

POST /debt_simulation

request_body

```json
{
    "borrower": {
        "name": "Nome devedor",
        "email":"email.devedor@gmail.com",
        "phone": {
            "number": "999538380",
            "area_code": "84",
            "country_code": "055"
        },
        "gender": "female",
        "political_exposition": "not_exposed",
        "address": {
            "city": "Natal",
            "state": "RN",
            "number": "1984",
            "street": "Rua",
            "complement": "complemento",
            "postal_code": "59065720",
            "neighborhood": "bairro"
        },
        "role_type": "issuer",
        "birth_date": "1959-07-08",
        "mother_name": "NOME DA MAE",
        "nationality": "Brasileiro",
        "person_type": "natural",
        "marital_status": "single",
        "attached_documents_list": [],
        "individual_document_number": "14471835092",
        "document_identification_date": "2015-10-02",
        "document_identification_type": "rg",
        "document_identification_number": "003709888"
    },
    "financial": {
        "interest_type": "pre_price_days",
        "first_due_date": "2023-09-21",
        "disbursement_date": "2024-11-07",
        "fine_configuration": {
            "monthly_rate": 0.0166,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0
        },
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "monthly_interest_rate": 0.0166,
        "installment_face_value": 101.84,
        "limit_days_to_disburse": 7,
        "number_of_installments": 10,
        "principal_grace_period": 0,
        "rebates": [ // Opcional
          {
            "fee_type": "insurance_premium_qi",
            "description": "insurance_premium_description"
          }
        ]
    },
    "simplified": true,
    "collaterals": [
        {
            "percentage": 1,
            "collateral_type": "private_payroll",
            "collateral_data": {
                "employer_document_number": "07940839000159",
                "registration_number": "99999999999-A"
            }
        }
    ],
    "additional_data": {
        "contract": {
            "contract_number": "TST0000644799"
        }
    },
    "purchaser_document_number": "32402502000135",
    "disbursement_bank_accounts": [
        {
            "name": "NOME DEVEDOR",
            "bank_code": "001",
            "account_digit": "0",
            "branch_number": "2874",
            "account_number": "000057555",
            "document_number": "14471835092",
            "transfer_method": "pix",
            "percentage_receivable": 100
        }
    ]
}
```

:::warning Product Selection
The _description_ enumerator is used to define the type of insurance product that will be issued, which directly affects the premium amount and coverages. Consult the operations team to know which enumerators should be used in your integration.
:::

## 3. Formalization

During the debt formalization flow in QI Sign, some screens will be presented to ensure the borrower's awareness and consent regarding insurance contracting.

:::warning OPT-OUT
It is possible that the borrower decides to abandon the insurance contracting and proceed only with credit contracting. In this case, the amount that would be destined for the insurance premium will also be disbursed to the borrower's account.
:::

Along with the credit formalization webhook, an event will be sent informing whether the insurance was accepted or rejected in the formalization flow.

WEBHOOK_TYPE insurance_premium.status_change

Webhook Body

**Operation formalized with insurance**

```json
{
  "data": {
    "credit_operation_key": "5ae2c008-44c1-4435-bbfa-094a4b11d962",
    "payment_account": {
      "account_number": "1234567",
      "account_digit": "8",
      "account_branch": "0001",
      "owner_document_number": "98765432100",
      "ispb": "32402502"
    }
  },
  "event_datetime": "2023-03-03 22:39:39",
  "key": "dc575950-dcce-48e1-99a6-5fb0ada63d86",
  "status": "accepted",
  "webhook_type": "insurance_premium.status_change"
}
```

**Operation formalized without insurance**

```json
{
  "data": {
    "credit_operation_key": "5ae2c008-44c1-4435-bbfa-094a4b11d962",
    "rejection_reason": "" 
  },
  "event_datetime": "2023-03-03 22:39:39",
  "key": "dc575950-dcce-48e1-99a6-5fb0ada63d86",
  "status": "rejected",
  "webhook_type": "insurance_premium.status_change"
}
```

:::info Rejection Reason
The possible rejection reason enumerators can be consulted in the [Rejection reasons](#rejection_reason) table.
:::
:::info Account Opening
After debt formalization with insurance, an internal account is opened where the full credit operation disbursement amount will be deposited and from which the split between the amount disbursed to the borrower and the insurance premium amount will be performed. The bank account details are provided in the *payment_account* object.
:::

## 4. Internal disbursement

After the endorsement stage, the operation will be disbursed to the internal account opened after formalization and the following disbursement webhook will be sent.

WEBHOOK_TYPE debt
STATUS disbursed

payload

```json
{
    "key": "53f23b3be-2bc8-46fb-943f-5d4532eecf5e",
    "data": {
      "installments": [
        {
          "due_date": "2026-01-24",
          "total_amount": 4645.64,
          "installment_key": "80f8f098-0232-4543-1e6b-50f970bac6e2",
          "pre_fixed_amount": 74.31,
          "installment_number": 1,
          "principal_amortization_amount": 4571.33
        }
      ],
      "ted_receipt_list": [],
    "status": "disbursed",
    "webhook_type": "debt",
    "event_datetime": "2025-12-26 18:56:45"
  }
}
```

## 5. Post-disbursement actions

To monitor success or failure in transfer attempts to the external account owned by the borrower, the following webhook should be monitored.

WEBHOOK_TYPE after_disbursement_action_update

Webhook Body

**Disbursement error**

```json
{
  "data": [
    {
      "action_error": {
        "description": "An error occurred while sending pix_transfer bfea6188-879c-46e5-b842-d1e934d44775 to SPI",
        "error_code": "disbursing_error"
      },
      "status": "error",
      "action_data": {
        "pix_transfer_type": "manual",
        "target_account": {
          "document_number": "98765432100",
          "financial_institution_code": 1,
          "ispb": 0,
          "name": "Nome Tomador",
          "financial_institution_code_number": "341",
          "account_branch": "9123",
          "account_digit": "0",
          "account_number": "9999"
        },
        "transaction_amount": 100
      },
      "action_key": "fcec7529-3598-4ce2-9448-4c24d1cb9df0",
      "execution_data": null,
      "action_type": "pix"
    }
  ],
  "event_datetime": "2025-12-30 13:25:08",
  "key": "e7a73248-d737-4cb4-ad07-6d303fc4b96c",
  "webhook_type": "debt_actions"
}
```

**Disbursement success**

```json
{
  "key": "29294369-6d9e-4700-a11b-172f80e51802",
  "webhook_type": "debt_actions",
  "data": [
    {
      "action_type": "pix",
      "action_data": {
        "transaction_amount": 100,
        "target_account": {
          "ispb": 0,
          "name": "Nome Tomador",
          "account_number": "20001",
          "account_branch": "0897",
          "document_number": "98765432100",
          "account_digit": "0",
          "financial_institution_code_number": "341",
          "financial_institution_code": 1
        },
        "pix_transfer_type": "manual"
      },
      "action_key": "7b529465-fc0e-4a16-ab3b-259699632896",
      "execution_data": {
        "original_transfer_data": null,
        "pdf_encoded_string": "comprovante do desembolso em base64",
        "chargeback_unexpected_reason": null,
        "transacted_at": "2025-12-30 12:59:46",
        "source_subtype_translation_ptbr": "Desembolso PIX da Operação",
        "receiver_conciliation_id": null,
        "transaction_key": "6c039a31-0d4c-452f-b9aa-9a389ae354d3",
        "pix_message": "",
        "transaction_amount": 100,
        "end_to_end_id": "E32402502202512301259djWNilNGhHj",
        "translated_chargeback_reason": null,
        "transacted_at_br": "2025-12-30 09:59:46",
        "origin_key": "a9d91b03-6a4b-4833-bc89-69afcb07ee75",
        "chargeback_reason": null,
        "transacted_at_formatted": "30/12/2025, 12:59:46",
        "source_account": {
          "owner_name": "Nome Tomador",
          "account_number": "7617846",
          "account_branch": "0001",
          "owner_document_number_formatted": "987.654.321-00",
          "owner_document_number": "98765432100",
          "account_digit": "5",
          "financial_institution_compe_number": "329",
          "financial_institution_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A."
        },
        "target_account": {
          "target_pix_key": null,
          "owner_document_number_formatted": "***.654.***-**",
          "owner_document_number": "***654*****",
          "owner_name": "Nome Tomador",
          "account_type_str": "Conta Corrente",
          "account_type": "checking_account",
          "account_number": "020001",
          "ispb_number": "60701190",
          "is_internal": false,
          "account_branch": "0897",
          "financial_institution_compe_number": 341,
          "account_digit": "0",
          "financial_institution_name": "ITAÚ UNIBANCO S.A."
        },
        "chargeback_returned_amount": null,
        "transaction_amount_formatted": "R$ 100,00",
        "source_subtype": "operation_pix_disbursement",
        "pix_transfer_type": "manual",
        "transacted_at_br_formatted": "30/12/2025, 09:59:46"
      },
      "action_error": null,
      "status": "done"
    }
  ],
  "event_datetime": "2025-12-30 13:00:58"
}
```

### Post-disbursement action resubmission

In case of failure, the following endpoint should be used for post-disbursement action resubmission

ENDPOINT /baas/action/ ACTION-KEY
METHOD PATCH

payload

**Manual pix resubmission payload**

```json
{
  "pix_transfer_type": "manual",
  "target_account": {
      "name": "Nome Tomador",
      "account_digit": "0",
      "account_branch": "9123",
      "account_number": "9999",
      "document_number": "98765432100",
      "financial_institution_code_number": "341"
  }
}
```
**Pix key resubmission payload**

```json
{
  "pix_transfer_type": "key",
  "pix_key": "98765432100" 
}
```

**TED resubmission payload**

```json
{
  "action_type": "funds_transfer",
  "destination": {
      "account_branch": "3181",
      "account_digit": "6",
      "account_number": "26284",
      "document_number": "48127500211248",
      "financial_institution_code_number": "001",
      "name": "JOANA LUCILIA GOMES DA SILVA",
      "transfer_type": "ted",
  },
}
```

:::info Sandbox Testing
To test a post-disbursement action failure, you can use account number 11581339 for manual pix or key b9380607-dac6-4e17-8ca7-eb761e3aa1dc for pix key.

payload

**Manual pix mocked payload example**

```json
	"disbursement_bank_accounts": [{
			"document_number": "77564023082",
			"name": "Jorge Augusto Salgado Salhani",
			"pix_transfer_type": "manual",
			"bank_code": "001",
			"branch_number": "0001",
			"account_number": "11581339",
			"account_digit": "0",
			"percentage_receivable": 100
		}]
```
**Pix key mocked payload example**

```json
	"disbursement_bank_accounts": [{
			"document_number": "61295118092",
			"name": "Mock Person Name",
			"pix_key": "b9380607-dac6-4e17-8ca7-eb761e3aa1dc",
			"pix_transfer_type": "key"
		}]
```

To test a TED transfer refusal, use the endpoint:

ENDPOINT /mock/ted/ted_refusal
METHOD POST

Request Body

```json
{
  "transaction_key": "\<Chave unitária da transação\>"
}
```

:::

## 6. Cancellation in case of post-disbursement action failure

In case of failure where internal disbursement has already been done, post-disbursement action with failure and no action resubmission, the following endpoint should be used for cancellation.

ENDPOINT /debt/ DEBT-KEY /reversal
METHOD PUT

payload
```json
{}
```

## 7. Insurance issuance

After success in the post-disbursement action, the premium amount transfer will be performed and insurance will be issued. To monitor the insurance status, the following webhook should be monitored.

WEBHOOK_TYPE insurance_premium.status_change

Webhook Body

**Insurance issued**

```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"
}
```

**Insurance canceled**

```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"
}
```

:::info Insurance Cancellation
To check the possible reasons for insurance cancellation, consult the [Cancellation reason](#cancel-insurance) table.
:::
:::danger Mandatory policy ticket sending to borrower
It is mandatory that the policy pdf is sent to the borrower after insurance issuance. The document can be consulted through the **[document query](../upload_de_documentos/consulta_documents)** using the *insurance_policy_document_key* provided in the insurance issuance webhook.
:::
:::info Sandbox Testing
To test insurance cancellation, you can use the following endpoint:

POST /mock/insurance_premium/ [INSURANCE-PREMIUM-KEY] /cancel

:::
### Insurance query

To actively query insurance information, the following endpoint can be used.

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

STATUS 200

Response Body

```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,
  "customer": {
    "customer_key": "cd587fa8-3abd-4023-99ab-957df60933a5",
    "document_number": "08556878350",
    "name": "Wilker Oliveiraço",
    "birth_date": "1998-03-21",
    "gender": "male",
    "email": "urich.oliveira@yopmail.com",
    "phone": {
      "country_code": "55",
      "area_code": "11",
      "number": "966931427"
    },
    "address": {
      "postal_code": "56821686",
      "state": "CE",
      "city": "Ceará",
      "neighborhood": "Marmiteiros",
      "street": "Conjunto João Gabriel da Mata",
      "number": "95",
      "complement": ""
    }
  },
  "covers": [
    {
      "cover_amount": 300,
      "cover_type": "permanent_disability",
      "cover_prize_amount": 572.82
    },
    {
      "cover_amount": 300,
      "cover_type": "accidental_death",
      "cover_prize_amount": 572.82
    },
    {
      "cover_amount": 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
}
```

## Flowchart

```mermaid
stateDiagram-v2
    [*] --> Consulta_BC_PROTEGE+ : Lead inicial
    Consulta_BC_PROTEGE+ --> Emissão_sem_seguro : permission_result = rejected
    Consulta_BC_PROTEGE+ --> Emissão_com_seguro : permission_result = approved
    Emissão_com_seguro --> QI_Sign : Formalização
    QI_Sign --> Emissão_sem_seguro : Tomador recusou seguro
    QI_Sign --> Abertura_de_conta : Tomador concordou com seguro
    Abertura_de_conta --> Averbação
    Averbação --> Desembolso_em_conta_interna
    Desembolso_em_conta_interna --> Split_por_ações_pós_desembolso  
```

## Attachments
---

### Rejection reason {#rejection_reason}

| Enumerator                                | Description                                           |
|------------------------------------------ |-------------------------------------------------------|
| **insurance_rejected**                    | insurance rejected                                    |
| **bacen_protect**                         | bc protect+                                           |

### Cancellation reason {#cancel-insurance}

| Enumerator                                | Description                                            |
|------------------------------------------ |-------------------------------------------------------|
| reversed_operation                        | Operation reversed and insurance canceled|
| cover_limit_amount_exceeded               | Only insurance was canceled. Some coverage limit was exceeded and insurance issuance was not possible|
| insurance_premium_cancel                  | Only insurance was canceled. Borrower cancellation directly with the insurer|

---

# Private Payroll Manual - Legacy Rollover

URL: /en/documentation/manual_consignado_privado/manual_tombamento_legado

:::caution API in development 
The API is still in development phase, therefore this manual is subject to changes.
:::

## 1 - Prerequisites

To roll over a contract to the new payroll loan model, it must have been previously informed and be in "active" status. If there are still any legacy contracts that have not been informed or are not in the correct status, please urgently inform the operations team. The [legacy contracts manual](./manual_contratos_legados) contains the documentation to check informed contracts.

Additionally, per DATAPREV requirement, it's necessary that the borrower is still employed in the same employment relationship as the informed contract. It's possible to check the borrower's active employment relationships without sending an authorization term using the call below (it will validate if there's an active legacy contract for the same CPF):

## 2 - Employment relationships inquiry for rollover:
The employment relationships inquiry is an asynchronous operation. When sending the request, QI Tech will process the inquiry in the background and return the result through a webhook when completed.
The webhook will be sent to the URL configured in your environment.

To check the active employment relationships of a borrower who has an active legacy contract, an employment relationships inquiry should be made using the same endpoint as the issuance flow, adding an extra field to the request payload root.

**POST**
/private_payroll/employment_relationships_inquiry

### Request

**Request Body**

```json
{
    "document_number" : "<CPF FUNCIONÁRIO>",
    "inquiry_type" : "legacy"
}
```

### Response

STATUS
**202** Accepted

**Response Body**

```json
{
    "employment_relationships_inquiry_key": "<UUID>",
    "employment_relationships_inquiry_status": "pending_inquiry"
}
```

### Webhooks

WEBHOOK TYPE
laas.private_payroll.employment_relationships_inquiry_status_change

Employment relationships inquiry result:

STATUS
completed

**Webhook Body**

```json
{
    "key": "<Employment Relationships Inquiry Key>",
    "status": "completed",
    "webhook_type": "laas.private_payroll.employment_relationships_inquiry_status_change",
    "event_datetime": "2025-03-24T15:28:31Z",
    "data": {
        "inquiry_type": "legacy",
        "employment_relationships": [
            {
                "eligible": true,
                "document_number": "47812365409",
                "registration_number": "99999999999-A", 
                "employer_document_type": "cnpj",
                "employer_document_number": "12345678000173"
            },
            {
                "eligible": true,
                "document_number": "47812365409",
                "registration_number": "11111111111-B",
                "employer_document_type": "cnpj",
                "employer_document_number": "43211234000189"
            }
        ]
    }
}
```

STATUS
failed

**Webhook Body**

```json
{
    "key": "<Employment Relationships Inquiry Key>",
    "status": "failure",
    "webhook_type": "laas.private_payroll.employment_relationships_inquiry_status_change",
    "event_datetime": "2025-03-24T15:28:31Z"
}
```

## 3 - Legacy contract rollover call:

:::warning Attention!
The borrower name, employer document, and employment relationship registration number fields must be filled with the data returned in the employment relationships inquiry, otherwise DATAPREV will return an error in the endorsement.
:::
:::warning Attention!
If a registration fee (TAC) was charged in the original operation, the value of this fee will be calculated by the difference between the issuance amount and the sum of the disbursed amount with the IOF amount.
:::
ROLLOVER

### Request

**POST**
/credit_operation/external

**Legacy contract issued externally**

```json title='Request Body'
{
    "requester_identifier_key": "d6a931e8-1655-479e-97a8-df8b426f49a0",
    "borrower": {
        "name": "Nome devedor",
        "role_type": "issuer",
        "person_type": "natural",
        "individual_document_number": "14471835092",
    },
    "collaterals": [
        {
            "percentage": 1,
            "collateral_type": "private_payroll",
            "collateral_data": {
                "legacy_contract_number": "109230148",
                "operation_category": "legacy_contract_rollover",
                "employer_document_number": "07940839000159",
                "registration_number": "99999999999-A",
            },
        }
    ],
    "control_number": "CTRL-2025-0001",
    "purchaser_document_number": "32402502000135",
    "disbursement_bank_account": {
        "name": "NOME DEVEDOR",
        "bank_code": "001",
        "account_digit": "0",
        "branch_number": "2874",
        "account_number": "000057555",
        "document_number": "14471835092",
        "transfer_method": "pix",
        "percentage_receivable": 100,
    },
    "financial": {
        "interest_type": "pre_price_days",
        "disbursement_date": "2024-11-07",
        "fine_configuration": {
            "monthly_rate": 0.0186,
            "interest_base": "calendar_days_365",
            "contract_fine_rate": 0,
        },
        "monthly_interest_rate": 0.04,
        "credit_operation_type": "ccb",
        "principal_grace_period": 0,
        "interest_grace_period": 0,
        "total_iof": 50,
        "amount": 700,
        "disbursed_amount": 500,
        "monthly_cet": 0.015,
        "annual_cet": 31.81,
        "installment_face_value": 82.57,
        "installments" : [
            {
                "due_date":"2025-04-07",
                "control_number": "CTRL-2025-1001",
                "status": "paid"
            },
            {
                "due_date":"2025-05-07",
                "control_number": "CTRL-2025-1002",
                "status": "paid"
            },
            {
                "due_date":"2025-06-07",
                "control_number": "CTRL-2025-1003",
                "status": "opened"
            },
            {
                "due_date":"2025-08-07",
                "due_balance": 11.20,
                "control_number": "CTRL-2025-1004",
                "status": "paid_partial"  
            },
            {
                "due_date":"2025-09-07",
                "control_number": "CTRL-2025-1005",
                "status": "opened"
            },
            {
                "due_date":"2025-10-07",
                "control_number": "CTRL-2025-1006",
                "status": "opened"
            },
            {
                "due_date":"2025-11-07",
                "due_balance": 70.09,
                "control_number": "CTRL-2025-1007",
                "status": "paid_partial"
            }
        ]
    },
}
```

:::warning Attention!
All installments must be informed, even if they have already been paid. The installment statuses must be informed according to the description below.
:::

#### Status Description

| Status | Description |
|--------|-----------|
| `opened` | Open installment |
| `paid_partial` | Partially paid installment |
| `paid` | Fully paid installment |
| `overdue` | Overdue and unpaid installment |

### Response

STATUS
**201** Created

**Response Body**

```json
{
    "issue_date": "2024-11-07",
    "issuer_name": "Nome Devedor",
    "disbursement_start_date": "2024-11-07",
    "credit_operation_status_enumerator": "opened",
    "original_total_iof": null,
    "origin_key": "<UUID>",
    "contract_number": "LEG0123456789",
    "first_due_date": "2025-04-07",
    "disbursement_end_date": "2024-11-07",
    "requester_identifier_key": "<KEY>",
    "credit_operation_key": "<UUID>",
    "operation_type_enumerator": "external_operation",
    "issue_amount": 700,
    "requester_key": "<UUID>",
    "disbursement_date": "2024-11-07",
    "total_iof": 50,
    "external_contract_fees": [
        {
        "tax_amount": 50,
        "cofins_amount": 0,
        "fee_type": {
            "enumerator": "tac"
        },
        "fee_amount": 150,
        "csll_amount": 0,
        "amount_released": 135,
        "irrf_amount": 0,
        "billing_type": {
            "enumerator": "rebate"
        },
        "amount": 150,
        "amount_type": {
            "enumerator": "absolute"
        },
        "pis_amount": 0,
        "rebate_account": null,
        "description": null,
        "created_at": "2024-11-07T01:51:41",
        "net_fee_amount": 135
        }
    ],
    "installments": [
        {
            "principal_amortization_amount": 23.2268766,
            "qr_code_url": null,
            "installment_type": "principal",
            "due_interest": 0,
            "paid_amount": 82.57,
            "original_total_amount": 82.57,
            "tax_amount": 0.12951306,
            "due_principal": 10,
            "bank_slip_key": null,
            "total_accrual_amount": null,
            "total_amount": 82.57,
            "calendar_days": 145,
            "installment_key": "f9d8ecae-a314-460a-987c-3a48afc283ef",
            "has_interest": true,
            "due_date": "2025-04-07",
            "original_principal_amortization_amount": 23.2268766,
            "pre_fixed_amount": 82.57,
            "digitable_line": null,
            "accrual_reference_date": null,
            "qr_code_key": null,
            "advanced_paid_amount": 0,
            "post_fixed_amount": 0,
            "original_pre_fixed_amount": 82.57,
            "original_due_principal": 635,
            "business_due_date": "2025-04-22",
            "workdays": 145,
            "installment_status": "paid",
            "total_paid_amount": 82.57,
            "renegotiation_proposal_key": null,
            "fine_amount": null
        },
        {
            "principal_amortization_amount": 23.2268766,
            "qr_code_url": null,
            "installment_type": "principal",
            "due_interest": 0,
            "paid_amount": 82.57,
            "original_total_amount": 82.57,
            "tax_amount": 0.12951306,
            "due_principal": 10,
            "bank_slip_key": null,
            "total_accrual_amount": null,
            "total_amount": 82.57,
            "calendar_days": 145,
            "installment_key": "f9d8ecae-a314-460a-987c-3a48afc283ef",
            "has_interest": true,
            "due_date": "2025-05-07",
            "original_principal_amortization_amount": 23.2268766,
            "pre_fixed_amount": 82.57,
            "digitable_line": null,
            "accrual_reference_date": null,
            "qr_code_key": null,
            "advanced_paid_amount": 0,
            "post_fixed_amount": 0,
            "original_pre_fixed_amount": 82.57,
            "original_due_principal": 635,
            "business_due_date": "2025-04-22",
            "workdays": 145,
            "installment_status": "paid",
            "total_paid_amount": 82.57,
            "renegotiation_proposal_key": null,
            "fine_amount": null
        },
        ...
    ]
}
```

---

# Manual – Private Payroll: Employment Relationships

URL: /en/documentation/manual_consignado_privado/manual_vinculos_empregaticios

:::caution  API under development  
The API is still in development phase, therefore this manual is subject to changes.
:::

---

## 1. Document Objective
This manual describes how employment relationship monitoring works for credit borrowers in **Private Payroll** and how updates are notified via **webhooks**.

---

## 2. Context and Motivation
Private payroll credit contracts depend on active employment relationships to maintain valid reservations.  
For this reason, **Dataprev** is consulted daily to identify changes in these relationships (e.g., termination of work contract or creation of a new relationship).

When there are changes, the system sends **automatic webhooks** to partners informing the new reservation status or the new detected relationship.

---

### 🔄 General Process Flow

1. The system consults employment relationships daily in Dataprev.  
2. If an active relationship is terminated, the contract is updated and the partner is notified.  
3. If the worker creates a new relationship, the system automatically identifies it and tries to **relink the reservation**.  
4. Webhooks are sent at each step so the partner can keep their systems updated.

---

## 3. Webhook – Employment Relationship Termination

### 📅 When it is sent
When a worker **loses their employment relationship** and the payroll contract was associated with that relationship.

### 🔍 What happens
The reservation status is updated to **"terminated"**, indicating it was closed due to relationship termination.  
The partner must update their system according to this information.

### 💡 Payload Example
```json
{
    "status": "terminated",
    "event_datetime": "2025-03-20T14:47:43Z",
    "key": "<Debt Key>",
    "webhook_type": "laas.private_payroll.reservation_status_change",
    "data": {
            "reservation_key": "<Reservation Key>",
            "document_number": "12345678901",
            "reservation_status": "terminated",
            "requester_key": "123e4567-e89b-12d3-a456-426614174000",
            "registration_number": "99999999999-A",
            "employer_name": "VIPER SERVICOS DO NORDESTE LTDA",
            "admission_date": "2025-04-02",
            "employer_document_number": "12345678901234",
            "external_key": "123e4567-e89b-12d3-a456-426614174000",
            "contract_number": "2024001234",
            "inclusion_date": "2025-04-02",
            "disbursement_date": "2025-04-05",
            "reservation_type": "new_credit",
    }
}
```

## 4. Webhook – New Employment Relationships

### 📅 When it is sent

When the system identifies that the worker with an active contract now has a new employment relationship, after the previous termination.

### 🔍 What happens

The system notifies the partner with complete data of the new relationship.

### 💡 Payload Example

```json
{
    "status": "active",
    "event_datetime": "2025-03-20T14:47:43Z",
    "key": "<Debt Key>",
    "webhook_type": "laas.private_payroll.new_employment_relationship",
    "data": {
        "document_number": "71742311016",
        "registration_number": "123456789ABCDEFR",
        "employer_document_number": "02302554000179",
        "status": "active",
        "employment_relationship_data": {
            "name": "LETYCIA AGUILAR DA SILVA",
            "eligible": true,
            "loan_count": 0,
            "employer_name": "VIPER SERVICOS DO NORDESTE LTDA",
            "admission_date": "2025-04-02",
            "total_due_amount": 1642.16,
            "base_margin_amount": 911.67,
            "political_exposition": "not_exposed",
            "worker_category_code": 101,
            "employer_document_type": "CNPJ",
            "available_margin_amount": 319.08
        }
    }
}
```

## 5. Webhook – Reservation Relinked to New Relationship

### 📅 When it is sent

After the system detects a new relationship and automatically relinks a reservation that was terminated.

### 🔍 What happens

Relinking occurs only if the new margin is sufficient.

There is no installment recalculation or debt reprofiling.

A new reservation key (reservation_key) is generated, keeping the same credit_operation_key or external_key.

The partner receives two webhooks, one informing the new reservation with status "reserved" and another informing the status change of the old
reservation to "transferred" status. This way it's possible to track relinked, terminated and transferred contracts.

### 💡 Payload Example - Relinked Contract

```json
{
    "status": "reserved",
    "event_datetime": "2025-03-20T14:47:43Z",
    "key": "<Debt Key>",
    "webhook_type": "laas.private_payroll.renewed_reservation",
    "data": {
            "reservation_key": "<Reservation Key>",
            "document_number": "12345678901",
            "reservation_status": "reserved",
            "requester_key": "123e4567-e89b-12d3-a456-426614174000",
            "registration_number": "99999999999-A",
            "employer_name": "VIPER SERVICOS DO NORDESTE LTDA",
            "admission_date": "2025-04-02",
            "employer_document_number": "12345678901234",
            "external_key": "123e4567-e89b-12d3-a456-426614174000",
            "contract_number": "2024001234",
            "inclusion_date": "2025-04-02",
            "disbursement_date": "2025-04-05",
            "reservation_type": "transferred",
    }
}
```

### 💡 Payload Example - Transferred Contract

```json
{
    "status": "transferred",
    "event_datetime": "2025-03-20T14:47:43Z",
    "key": "<Debt Key>",
    "webhook_type": "laas.private_payroll.reservation_status_change",
    "data": {
            "reservation_key": "<Reservation Key>",
            "document_number": "12345678901",
            "requester_key": "123e4567-e89b-12d3-a456-426614174000",
            "registration_number": "99999999999-A",
            "employer_name": "VIPER SERVICOS DO NORDESTE LTDA",
            "admission_date": "2025-04-02",
            "employer_document_number": "12345678901234",
            "external_key": "123e4567-e89b-12d3-a456-426614174000",
            "contract_number": "2024001234",
            "inclusion_date": "2025-04-02",
            "disbursement_date": "2025-04-05",
            "reservation_type": "new_credit",
            "reservation_status": "transferred",
    }
}
```

### Note:

The external_key or credit_operation_key like most of the data remains the same.

## 6. Best Practices

Monitor your webhooks daily to ensure synchronization with the LaaS system.

Handle status updates in an idempotent way (i.e., avoid processing the same event twice).

Keep logs of webhook receipts for auditing purposes.

---

# Manual Consignado Privado - Portabilidade: Consultas Prévias

URL: /en/documentation/manual_consignado_privado/portabilidade/consultas

:::danger Consulta obrigatória antes da proposta
Antes de digitar uma proposta de portabilidade, é **obrigatório** realizar uma **consulta de dados válida do trabalhador**. Sem uma consulta de dados concluída com sucesso, o pedido de averbação da portabilidade (e do refinanciamento) **não é criado**. Sempre faça a consulta antes de digitar a proposta.
:::

São duas consultas, ambas assinadas com o **Termo de Autorização**:

1. **Consulta dos vínculos empregatícios** — `POST /private_payroll/employment_relationships_inquiry`
2. **Consulta de dados do trabalhador (saldo e margem consignável)** — `POST /private_payroll/balance_inquiry`

:::info Estas consultas são documentadas em detalhe
As duas consultas, o Termo de Autorização e os enumeradores de status (`employment_relationships_inquiry_status`, `balance_inquiry_status`) estão detalhados em **[Consultas do Trabalhador](/documentation/manual_consignado_privado/manual_consultas_trabalhador)**. Esta página mostra como elas se encaixam na jornada de portabilidade.

A consulta de dados do trabalhador valida a elegibilidade, a margem consignável e os dados da conta de pagamento antes da digitação da proposta.
:::

## Onde a consulta entra no fluxo

```
1.  POST /private_payroll/employment_relationships_inquiry   (vínculos + Termo de Autorização)
2.  POST /private_payroll/balance_inquiry                    (margem consignável + Termo de Autorização)
3.  POST /v2/credit_transfer/proposal                        (digitação da proposta de portabilidade)
```

A **consulta de dados do trabalhador (passo 2) deve ter sido concluída com sucesso antes do passo 3**. A proposta de portabilidade só deve ser digitada após a consulta retornar com sucesso — é ela que valida a margem consignável e habilita a averbação da operação.

---

# Manual Consignado Privado - Portabilidade: Consultas e Operações Pós-Proposta

URL: /en/documentation/manual_consignado_privado/portabilidade/consultas_pos_proposta

## Consulta de Lista de Participantes do CTC

ENDPOINT /v2/credit_transfer/participants
MÉTODO GET

Testar no Playground

**Resposta**

**response.json**

```json
[
    {
        "name": "<NOME DO BANCO>",
        "bank_code": "<CÓDIGO DO BANCO>",
        "ispb": "<BASE DO CNPJ DO BANCO>"
    }
]
```

## Recuperar resposta da última request

O last response é uma forma de mapear, de forma simples e objetiva, a resposta da comunicação entre a QI e o empregador, possibilitando saber quando essa requisição foi feita e qual o retorno obtido (através de um enumerador). Os enumeradores estão divididos em duas formas: "errors" e "success".

Cada enumerador tem uma descrição detalhada e o código de referência. Podemos conferir abaixo, com mais detalhes, como serão apresentados os dados do last response.

### Casos de sucesso

#### Requisição
ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /CREDIT-OPERATION-TYPE/collateral
MÉTODO GET

#### Path Params credit-operation-type
| Enumerador               					| Descrição                  		|
|-------------------------------------------|--------------------------------|
| refinancing_credit_operation  			| Operação de refinanciamento    |
| portability_credit_operation     			| Operação de portabilidade      |

#### Resposta

Response Body

```json
{
    "collateral_data": {
        "employer_document_number": "<CNPJ DO EMPREGADOR>",
        "registration_number": "<MATRÍCULA DO TRABALHADOR>",
        "last_response": {
            "success": [
                {
                    "enumerator": "succesfully_included",
                    "reservation_method": "portability"
                }
            ]
        },
        "last_response_event_datetime": "2023-05-22T19:13:02Z",
        "status": "reserved"
    },
    "collateral_constituted": true,
    "collateral_type": "private_payroll"
}
```

### Detalhamento de campos no retorno da request
| Campo                     | Descrição                           | Valores                          |
|---------------------------|-------------------------------------|----------------------------------|
| enumerator                | Retorno mapeado do código de resposta  | [Consultas do Trabalhador](/documentation/manual_consignado_privado/manual_consultas_trabalhador)|
| reservation_method        | Método de averbação da reserva      | portability, new_credit, refinancing|

### Casos de erro

#### Requisição
ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /CREDIT-OPERATION-TYPE/collateral
MÉTODO GET

#### Resposta

Response Body

```json
{
    "collateral_constituted": false,
    "collateral_type": "type",
    "updated_at": "2023-05-24 19:13:02",
    "collateral_data": {
        "employer_document_number": "<CNPJ DO EMPREGADOR>",
        "registration_number": "<MATRÍCULA DO TRABALHADOR>",
        "status": "pending_reservation",
        "last_response": {
            "errors": [
                {
                    "enumerator": "consignable_margin_exceeded",
                    "reservation_method": "portability"
                },
                {
                    "enumerator": "consignable_margin_exceeded",
                    "reservation_method": "new_credit"
                }
            ]
        },
        "last_response_event_datetime": "2023-05-22T19:13:02Z"
    }
}
```

### Detalhamento de campos no webhook de falha
| Campo                     | Descrição                           | Valores                          |
|---------------------------|-------------------------------------|----------------------------------|
| enumerator                | Retorno mapeado do código de resposta  | [Consultas do Trabalhador](/documentation/manual_consignado_privado/manual_consultas_trabalhador) |
| reservation_method        | Método de averbação da reserva      | portability, new_credit, refinancing|

## Webhook de resposta da última tentativa de averbação

Caso a operação não tenha sucesso na averbação na folha do empregador, a mesma ficará em retentativa e será enviado o seguinte webhook, detalhando o motivo da não averbação, o horário desta tentativa e o método de averbação utilizado. Trata-se da reserva de margem (averbação) na folha de pagamento de funcionários de empresas privadas.

**Operação de portabilidade**

WEBHOOK_TYPE credit_transfer.proposal.collateral

```json
{
    "webhook_type": "credit_transfer.proposal.collateral",
    "proposal_key": "<PROPOSAL-KEY>",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
        "credit_operation_type": "portability",
        "credit_operation_key": "<CREDIT-OPERATION-KEY>",
        "collateral_type": "private_payroll",
        "collateral_constituted": false,
        "collateral_data": {
            "status": "pending_reservation",
            "last_response": {
                "errors": [
                    {
                        "enumerator": "consignable_margin_exceeded"
                    }
                ]
            },
            "last_response_event_datetime": "2023-05-22T19:13:02Z",
            "reservation_method": "new_credit"
        }
    }
}
```

**Operação de refinanciamento**

:::info Mesmo webhook da averbação de portabilidade
A averbação do Refinanciamento (Troco) usa o **mesmo** `webhook_type` `credit_transfer.proposal.collateral` usado para a averbação da Portabilidade — a diferença está apenas no campo `data.credit_operation_type`, que aqui vem como `"refinancing"`.
:::

WEBHOOK_TYPE credit_transfer.proposal.collateral

```json
{
    "webhook_type": "credit_transfer.proposal.collateral",
    "proposal_key": "<PROPOSAL-KEY>",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
        "credit_operation_type": "refinancing",
        "credit_operation_key": "<CREDIT-OPERATION-KEY>",
        "collateral_type": "private_payroll",
        "collateral_constituted": false,
        "collateral_data": {
            "status": "pending_reservation",
            "last_response": {
                "errors": [
                    {
                        "enumerator": "consignable_margin_exceeded"
                    }
                ]
            },
            "last_response_event_datetime": "2023-05-22T19:13:02Z",
            "reservation_method": "refinancing"
        }
    }
}
```

### Detalhamento de campos no webhook de falha
| Campo                     | Descrição                           | Valores                          |
|---------------------------|-------------------------------------|----------------------------------|
| enumerator                | Retorno mapeado do código de resposta  | [Consultas do Trabalhador](/documentation/manual_consignado_privado/manual_consultas_trabalhador) |
| reservation_method        | Método de averbação da reserva      | portability, new_credit, refinancing|

## Dados do contrato de origem

Não existe um endpoint separado para "consultar" os dados do contrato de origem (banco credor original) depois da digitação — esses dados chegam automaticamente ao parceiro no webhook de **[`accepted`](/documentation/manual_consignado_privado/portabilidade/maquina_de_status#accepted)**, dentro de `data.original_contract`, assim que a instituição credora original informa o saldo devedor real (`final_due_balance`). O objeto traz, entre outros campos, o número e o ISPB do contrato de origem, a taxa e o CET do contrato original, o número de parcelas e a data da última parcela.

:::info Consulta prévia (antes da proposta)
A elegibilidade do trabalhador para a portabilidade — vínculo empregatício, contratos existentes na folha do empregador — é apurada nas **[Consultas Prévias](/documentation/manual_consignado_privado/portabilidade/consultas)**, obrigatórias antes da digitação da proposta.
:::

## Diminuir o valor das parcelas

Este endpoint permite a redução do valor das parcelas de um contrato de portabilidade de crédito. Esta funcionalidade é especialmente útil em casos onde a margem consignável é excedida devido ao banco de origem desaverbar uma quantia menor do que a esperada.

ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /portability_credit_operation
MÉTODO PUT

**Requisição**

**request.json**

```json
{
    "installment_face_value": 382.18
}
```

**Resposta sucesso - HTTP 200**

**response.json**

```json
{
    "credit_operation_key": "7aa77bca-c724-4c1a-bfae-9b1b7bd81ab2",
    "contract_number": "0000000007/WO",
    "document_key": "045a8f35-6170-4112-8d83-29a753d0c78e",
    "document_url": "http://teste.com",
    "signed_url": "signed_url_test",
    "credit_operation_status": "waiting_signature",
    "fine_configuration": {
        "contract_fine_rate": 0.02,
        "interest_base": "calendar_days",
        "monthly_rate": 0.01
    },
    "disbursement_accounts": [
        {
            "account_digit": "3",
            "account_branch": "0001",
            "account_number": "94134",
            "ispb": "32402502",
            "name": "Wilker Teste",
            "document_number": "37197645832"
        }
    ],
    "disbursement_options": [
        {
            "prefixed_interest_rate": {
                "annual_rate": 3.0,
                "daily_rate": 0.00385824,
                "interest_base": "calendar_days",
                "monthly_rate": 0.12246205
            },
            "total_iof": 7.03,
            "external_contract_fee_amount": 0.0,
            "external_contract_fees": [],
            "contract_fee_amount": 0.0,
            "number_of_installments": 3,
            "contract_fees": [],
            "disbursed_issue_amount": 1000.0,
            "issue_amount": 1007.03,
            "disbursement_date": "2022-08-24",
            "cet": 12.6,
            "annual_cet": 315.3944,
            "installments": [
                {
                    "business_due_date": "2022-08-30",
                    "calendar_days": 5,
                    "due_date": "2022-08-29",
                    "due_principal": 1007.03,
                    "installment_number": 1,
                    "pre_fixed_amount": 84.43554587915118,
                    "principal_amortization_amount": 297.73445412084885,
                    "total_amount": 382.17,
                    "workdays": 3
                },
                {
                    "business_due_date": "2022-09-30",
                    "calendar_days": 31,
                    "due_date": "2022-09-29",
                    "due_principal": 709.2955458791512,
                    "installment_number": 2,
                    "pre_fixed_amount": 47.97894031795043,
                    "principal_amortization_amount": 334.19105968204957,
                    "total_amount": 382.17,
                    "workdays": 22
                },
                {
                    "business_due_date": "2022-11-01",
                    "calendar_days": 32,
                    "due_date": "2022-10-31",
                    "due_principal": 375.1044861971016,
                    "installment_number": 3,
                    "pre_fixed_amount": 7.055513802898396,
                    "principal_amortization_amount": 375.1044861971016,
                    "total_amount": 382.16,
                    "workdays": 21
                }
            ],
            "final_disbursement_amount": 997.87
        }
    ],
    "final_disbursement_amount": 997.87,
    "collateral_is_constituted": false
}
```

## Incluir Fee na operação de portabilidade rebatido pela QI ao parceiro

Para inclusão do fee, é necessário que a operação esteja averbada, desembolsada e que não esteja cedida.

ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /portability_credit_operation/rebate
MÉTODO POST

**Requisição**

**request.json**

```json
{
    "amount": 20,
    "rebate_bank_account": {
        "name": "Teste Ltda",
        "document_number": "18533555000164",
        "account_digit": "0",
        "account_number": "4290001",
        "branch_number": "0001",
        "bank_code": "329"
    },
    "amount_type": "percentage",
    "fee_type": "spread"
}
```

**Resposta**

**response.json**

```json
{}
```

## Recibo do pagamento de portabilidade (STR00047)

Após o pagamento da portabilidade, é possível gerar o recibo da transação.

ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /receipt_str0047
MÉTODO POST

**Requisição**

**request.json**

```json
{}
```

**Resposta**

**response.json**

```json
{
    "proposal_key": "CHAVE DA PROPOSTA",
    "receipt_url": "URL DO RECIBO",
    "receipt_document_key": "CHAVE DO RECIBO"
}
```

---

# Manual Consignado Privado - Portabilidade: Enumeradores

URL: /en/documentation/manual_consignado_privado/portabilidade/enumeradores

## Mapeamento de enumeradores

Esta página reúne os enumeradores utilizados ao longo do fluxo de Portabilidade de Consignado Privado: `retention_reason`, `proposal_status`, `credit_operation_status` e `politically_exposed`.

Os enumeradores relacionados à situação do trabalhador, à margem consignável e a bloqueios na folha de pagamento são apurados nas consultas prévias à proposta e estão detalhados no [Manual de Consultas do Trabalhador](/documentation/manual_consignado_privado/manual_consultas_trabalhador), que documenta `employment_relationships_inquiry_status` e `balance_inquiry_status`.

### Enumeradores Retention Reason {#retention_reason_enumerator}
| Enumerador                               | Descrição                                              |
|------------------------------------------|--------------------------------------------------------|
| **issuer_retention**                     | Retenção do Cliente                                    |
| **different_from_original**              | Condições da proposta divergentes do contrato original |
| **issuer_lawsuit**                       | Cliente com ação judicial                              |
| **insurance_in_progress**                | Indenização de seguro em andamento                     |
| **collateral_in_execution**              | Garantia em Execução                                   |
| **contract_not_found**                   | Contrato não encontrado                                |
| **invalid_contract_type**                | Tipo de contrato inválido                              |
| **portability_in_progress**              | Portabilidade em andamento                             |
| **assigned_contract**                    | Contrato cedido                                        |
| **issuer_document_number_invalid**       | CPF não é do contrato                                  |
| **unrelated_issuer_document_number**     | CPF informado não é o do titular                       |
| **assigned_without_co_obligation**       | Contrato cedido sem coobrigação                        |
| **fgts_in_use**                          | FGTS AMORTIZAR em uso                                  |
| **fgts_funding**                         | FGTS funding                                           |
| **portability_not_requested**            | O cliente não solicitou a portabilidade                |
| **wrong_original_financial_institution** | IF Credora Original Incorreta                          |

### Enumeradores proposal_status {#proposal_status_enumerator}

Os estados da Proposta de Portabilidade refletem as etapas do processo de portabilidade de crédito dentro do CTC (Central de Transferência de Crédito) da Núclea, desde a digitação até a liquidação.

| Enumerador                        | Descrição                                                                                                       |
|-----------------------------------|-----------------------------------------------------------------------------------------------------------------|
| pending_submission                | Proposta criada e aguardando envio                                                                              |
| pending_response                  | Proposta digitada, recebida com sucesso pela QI e enviada para o CTC                                       |
| pending_acceptance                | Proposta enviada/aceita pelo CTC, aguardando resposta de saldo devedor pela instituição credora original  |
| accepted                          | Instituição credora original retornou o saldo devedor e não reteve o crédito                                     |
| retained                          | Crédito retido pela instituição credora original                                                                |
| settlement_sent                   | Liquidação enviada à instituição credora original                                                               |
| pending_settlement_confirmation   | Aguardando confirmação da liquidação                                                                            |
| paid                              | Proposta liquidada/paga                                                                                          |
| rejected                          | Digitação da proposta rejeitada pelo CTC                                                                   |
| canceled                          | Proposta cancelada                                                                                              |

### Enumeradores credit_operation_status {#credit_operation_status_enumerator}
| Enumerador               					| Descrição                  	 		|
|-------------------------------------------|---------------------------------------|
| waiting_signature  						| Operação aguardando assinatura 		|
| signed     								| Operação assinada			     		|
| issued  									| Operação emitida			     		|
| disbursed									| Operação desembolsada		     		|
| settled     								| Operação liquidada	         		|
| canceled     								| Operação cancelada		     		|
| canceled_permanently  					| Operação cancelada permanentemente    |

### Tabela de tipos de politicamente exposto {#politically_exposed_enumerator}

| Enumerador | Descrição                                           |
|------------|-----------------------------------------------------|
| 0          | Pessoa Não Exposta Politicamente                    |
| 1          | Pessoa Exposta Politicamente - Nível 1              |

---

## Situação do trabalhador, margem e bloqueios

A elegibilidade do trabalhador, a margem consignável e eventuais bloqueios da folha de pagamento são apurados nas consultas prévias à digitação da proposta. Os enumeradores correspondentes estão detalhados no [Manual de Consultas do Trabalhador](/documentation/manual_consignado_privado/manual_consultas_trabalhador).

### Retorno da averbação

A averbação da operação ocorre junto ao empregador/folha de pagamento de funcionários de empresas privadas. As críticas associadas decorrem da consulta de vínculo empregatício e de saldo do trabalhador.

### Situação e status do vínculo empregatício

Refletem a situação do vínculo empregatício do trabalhador junto ao empregador/folha de pagamento de funcionários de empresas privadas. Consulte os enumeradores de status de consulta no [Manual de Consultas do Trabalhador](/documentation/manual_consignado_privado/manual_consultas_trabalhador).

### Bloqueios do vínculo empregatício

Bloqueios são tratados no contexto do vínculo empregatício do trabalhador. Consulte o detalhamento no [Manual de Consultas do Trabalhador](/documentation/manual_consignado_privado/manual_consultas_trabalhador) e no [Manual de Vínculos Empregatícios](/documentation/manual_consignado_privado/manual_vinculos_empregaticios).

---

# Manual Consignado Privado - Portabilidade: Formalização

URL: /en/documentation/manual_consignado_privado/portabilidade/formalizacao

A formalização — coleta de documentos e assinatura dos contratos gerados na digitação da proposta — é realizada **integralmente pelo QI Sign**.

:::info Formalização via QI Sign
A QI Tech coleta os documentos do tomador e captura a assinatura no fluxo do QI Sign. O parceiro **não envia documentos** — nem no payload da proposta, nem por qualquer outro endpoint — e **não submete evidências de assinatura**.
:::

O andamento da assinatura de cada operação (portabilidade e refinanciamento) é refletido no `credit_operation_status` (`waiting_signature → issued → ...`) e pode ser acompanhado em [Acompanhamento da Operação](/documentation/manual_consignado_privado/portabilidade/maquina_de_status).

---

# Manual Consignado Privado - Portabilidade: Acompanhamento da Operação

URL: /en/documentation/manual_consignado_privado/portabilidade/maquina_de_status

## Status da Proposta de Portabilidade

Os estados da Proposta de Portabilidade refletem as etapas envolvidas no processo de portabilidade de crédito dentro do CTC (Central de Transferência de Crédito) da Núclea.
Segue abaixo a descrição do fluxo e do significado de cada status envolvido em uma Proposta de Portabilidade, desde sua digitação até sua liquidação.

### pending_response

Status da proposta após realização da digitação. Neste status a proposta foi recebida com sucesso pela QI e enviada para o CTC.

#### rejected

Caso a digitação da proposta seja rejeitada pelo CTC, será enviado um webhook com o motivo da rejeição:

**Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS rejected

**webhook.json**

```json
{
    "webhook_type": "credit_transfer.proposal",
    "proposal_key": "<PROPOSAL-KEY>",
    "proposal_status": "rejected",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
        "error": {
            "code": "ECTC0023",
            "reason": "Contrato com portabilidade em andamento"
        }
    }
}
```

#### rejected reasons

Caso a digitação da proposta seja rejeitada pelo CTC, será enviado um webhook com o motivo da rejeição:

| reason                             | description                                                                                                                   | external_code |
|------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|---------------|
| portability_in_progress            | Contrato com portabilidade em andamento                                                                                       | ECTC0023      |
| portability_finished               | Portabilidade já finalizada para o contrato informado                                                                         | ECTC0028      |
| portability_in_expiration_progress | Portabilidade não permitida. Contrato com portabilidade em situação de "Decurso de prazo" por não efetivação da portabilidade | ECTC0085      |
| unexpected_error                   | Erro inesperado                                                                                                               | ECTC9999      |
| portability_payment_rejected       | Pagamento de portabilidade rejeitado.                                                                                         |               |
| divergent_due_balance              | Saldo devedor final deve ser menor que saldo devedor devolvido pela Núclea.                                                      |               |

### pending_acceptance

Status da Proposta após envio/aceite pelo CTC. A Proposta, neste momento, está aguardando resposta de saldo devedor pelo banco credor original. Neste momento é enviado um webhook com o número da Portabilidade no CTC:

**Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS pending_acceptance

**webhook.json**

```json
{
    "webhook_type": "credit_transfer.proposal",
    "proposal_key": "<PROPOSAL-KEY>",
    "proposal_status": "pending_acceptance",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
        "portability_number": "202211230000246536429",
        "inclusion_date": "2022-11-24",
        "due_balance_expected_return_date": "2022-12-01"
    }
}
```

:::info
O **“portability_number“** é o Número da Portabilidade dentro do CTC, e é o número utilizado pela instituição proponente e instituição credora original para localizar a Proposta de Portabilidade.
:::

Assim que o banco credor original responder à solicitação de portabilidade, será enviado um webhook com a resposta do valor do saldo devedor no caso da não retenção, e com a informação de “retido”, no caso da retenção:

#### accepted

Status da Proposta quando o banco credor original retorna o saldo devedor e não retem o crédito. Será enviado um webhook com a informação do saldo devedor.
O banco credor original tem até 5 d.u. após a recepção da Proposta de Portabilidade, para envio da resposta com a informação do saldo devedor da operação.

**Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS accepted

**webhook.json**

```json
{
    "webhook_type": "credit_transfer.proposal",
    "proposal_key": "<PROPOSAL-KEY>",
    "proposal_status": "accepted",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
        "final_due_balance": 1000,
        "portability_number": "202211230000246536429",
        "original_contract": {
            "origin_contract_number": "5584745",
            "origin_ispb_number": "60746948",
            "origin_document_number": "90406718261",
            "origin_operation_type": "0202",
            "installment_face_value": 1000,
            "total_iof": 1,
            "first_due_date": "2021-05-31",
            "last_due_date": "2022-05-31",
            "interest": 1,
            "cet": 1,
            "installment_number": 12,
            "amortization": 1,
            "final_due_balance": 1000,
            "final_due_date": "2021-08-31",
            "contract_date": "2021-04-31"
        }
    }
}
```

Com a informação do saldo devedor retornado pela instituição credora original, o parceiro tomará a decisão se seguir ou não com a Portabilidade.

:::info
Horário limite para envio do saldo devedor pela instituição credora original é às 10:00.
:::

:::info Saldo devedor real diferente do estimado na proposta
O `final_due_balance` informado pela instituição credora original é validado contra o saldo devedor estimado enviado na proposta (`origin_contract.last_due_balance`): se o saldo real superar o estimado em mais de **15%**, a proposta é automaticamente rejeitada com o motivo `divergent_due_balance` (ver [rejected reasons](#rejected-reasons)). Dentro dessa tolerância, a proposta segue para `accepted` normalmente — mas as condições financeiras só são recalculadas com base no saldo real no momento do aceite (`PATCH .../accepted_by_requester` abaixo), não antes.
:::

Após o recebimento do saldo devedor, caso o Parceiro decida seguir com a Proposta Portabilidade, ele deve realizar a seguinte chamada:

ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY
MÉTODO PATCH

Testar no Playground

**Requisição**

**request.json**

```json
{
    "status": "accepted_by_requester"
}
```

:::caution Atenção
Para propostas que envolvam troco após o refinanciamento, o troco recalculado de acordo com as novas condições do contrato (após o retorno do saldo devedor) também precisa respeitar o piso mínimo — que é **escalonado pelo número de parcelas em aberto do contrato de origem** (5% para menos de 56 parcelas, 3% para 56 a 71, 2% para 72 ou mais; ver [Simulação](/documentation/manual_consignado_privado/portabilidade/simulacao)) em relação à diferença entre a soma de todas as parcelas do refinanciamento e a soma de todas as parcelas da portabilidade. Caso contrário, a requisição receberá o seguinte erro:

STATUS 400

**Response Body**

```json
{
    "code": "CT000118",
    "title": "Bad Request",
    "description": "The final disbursement amount is less than 5% of the sum of refinancing installment minus the sum of portability installment. The minimum final disbursement amount allowed is 500.00. Calculated final disbursement amount: 400.00.",
    "translation": "O valor do troco é menor que 5% da soma do valor das parcelas do refinanciamento menos o valor soma das parcelas da portabilidade. O valor mínimo do troco permitido é de 500.00. Valor calculado do troco: 400.00."
}
```
:::

:::info Recálculo das condições com base no saldo devedor real
Essa chamada (`accepted_by_requester`) recalcula a simulação da Portabilidade — e do Refinanciamento/Troco, se houver — usando o saldo devedor **real** (`final_due_balance`), e retorna as condições recalculadas na própria resposta (além dos webhooks de status). Duas garantias protegem o tomador nesse recálculo:
- O valor da nova parcela não pode ultrapassar o valor da parcela do contrato de origem.
- O valor do Troco recalculado não pode ser reduzido em mais de **10%** em relação ao Troco calculado na digitação/simulação original.
:::

O Parceiro pode adicionar dados de novo valor de parcela ou nova taxa nessa chamada, caso queira alterá-los:

ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY
MÉTODO PATCH

**Requisição**

**request.json**

```json
{
    "status": "accepted_by_requester",
    "financial": {
        "installment_face_value": 100
    }
}
```

ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY
MÉTODO PATCH

**Requisição**

**request.json**

```json
{
    "status": "accepted_by_requester",
    "financial": {
        "monthly_interest_rate": 0.01
    }
}
```

:::info Campos adicionais opcionais
Além dos campos `status` e `financial`, o endpoint de aceite da proposta também aceita os seguintes campos opcionais:
- **`borrower.document_identification_type`** (string ou null): Tipo do documento de identificação
- **`borrower.document_identification_number`** (string, máx. 16 caracteres): Número do documento de identificação
- **`borrower.gender`** (string ou null): Gênero do tomador. Valores aceitos: `"male"`, `"female"` ou `null`
:::

:::danger Atenção!
Caso o valor da parcela seja maior que valor total disponível (valor da parcela do contrato de origem + margem consignável total disponível),
será retornado o seguinte erro:
```json
{
    "code": "SSC000059",
    "title": "Reservation amount greater than available total balance",
    "description": "The installment face value: 54.4 is greater than the available total balance (origin installment face value + available total balance):30.4. Available total balance: -20.0.",
    "translation": "O valor da parcela: 54.4 é maior que o valor total disponível (valor da parcela do contrato de origem + margem total disponível) : 30.4. Margem total diponível: -20.0."
}
```
Ao receber esta crítica, é possível que uma nova chamada seja feita, alterando o valor da parcela para que ela se ajuste ao valor total disponível.

Se o ajuste no valor da parcela não for feito até o horário limite para aceite do saldo devedor, será necessária uma nova digitação de proposta.
:::

Caso o Parceiro decida por não prosseguir com a Proposta de Portabilidade, ele deve, **obrigatoriamente** realizar a seguinte chamada para informar a desistência da Portabilidade:

ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY
MÉTODO DELETE

Testar no Playground

Após o envio do cancelamento da Proposta de Portabilidade ao CTC, será enviado um webhook de Proposta Cancelada:

**Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS canceled

**webhook.json**

```json
{
    "webhook_type": "credit_transfer.proposal",
    "proposal_status": "canceled",
    "proposal_key": "<PROPOSAL-KEY>",
    "event_datetime": "2022-11-24T15:42:12"
}
```

:::info
O comando de pagamento do saldo devedor (envio da liquidação) deve ser enviado até às 16:00.
Não é possível retomar uma Proposta com status “canceled”. Caso a Proposta esteja com este status, será necessária a realização de uma nova digitação.
:::

#### retained

Status da Proposta quando o banco credor original retem o crédito, será enviado o webhook com a informação de retenção. O banco credor original do crédito tem até 5 d.u. após a recepção da Proposta de Portabilidade, para envio da resposta de retenção do crédito — o mesmo prazo aplicável ao envio do saldo devedor (ver [`accepted`](#accepted)).

**Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS retained

**webhook.json**

```json
{
    "webhook_type": "credit_transfer.proposal",
    "proposal_key": "<PROPOSAL-KEY>",
    "proposal_status": "retained",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
        "retained_reason": {
            "reason": "issuer_retention",
            "description": "Retenção do Cliente"
        }
    }
}
```

### Detalhamento de campos no webhook de proposal
| Campo                     | Descrição                           | Valores                          |
|---------------------------|-------------------------------------|----------------------------------|
| reason                    | lista dos motivos de retenção de uma Proposta  | [Enumeradores](/documentation/manual_consignado_privado/portabilidade/enumeradores#retention_reason_enumerator) |

### accepted_by_requester

Após aprovada pelo parceiro, a Proposta segue o fluxo interno da QI para liquidação.

### settlement_sent

Após conclusão do fluxo interno da QI para liquidação da Proposta de Portabilidade o recurso para pagamento do saldo devedor é enviado ao credor original disparando o seguinte webhook para o Parceiro:

**Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS settlement_sent

**webhook.json**

```json
{
    "webhook_type": "credit_transfer.proposal",
    "proposal_key": "<PROPOSAL KEY>",
    "proposal_status": "settlement_sent",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
        "receipt": {
            "amount": 1000,
            "timestamp": "2022-09-14 11:55:31",
            "description": "237 0001 1000093 1000093-3 59588111000103 - BCO BRADESCO S.A.",
            "ted_receipt_document_key": "a34e84a2-1628-4f23-8c11-2b2f4656ced1",
            "ted_receipt_url": "https://qitech.com.br/",
            "transaction_key": "ed3e84a2-1628-4f23-8c11-2b2f4656cedf",
            "origin": {
                "account_key": "ed3e84a2-1628-4f23-8c11-2b2f4656cedf",
                "bank_code": "329",
                "branch": "0001",
                "branch_digit": null,
                "account_number": "1000361",
                "account_digit": "3",
                "type": "checking_account",
                "name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
                "document": "32402502000135"
            },
            "destination": {
                "bank_code": "237",
                "branch": "0001",
                "branch_digit": null,
                "account_number": "1000093",
                "account_digit": "3",
                "type": "checking_account",
                "name": "BCO BRADESCO S.A.",
                "document": "59588111000103",
                "purpose": "Saída Liquidação de Portabilidade"
            }
        }
    }
}
```

Neste momento será iniciada averbação da Operação de Portabilidade na folha do empregador. O processo de averbação acontecerá em paralelo aos itens seguintes (itens 7.5., 7.5.1. e 7.5.2.)

### pending_settlement_confirmation

Após a confirmação do envio dos recursos para pagamento do saldo devedor, é aguardada a confirmação da quitação do contrato por parte da Instituição Credora Original. Nesta etapa o Parceiro receberá o seguinte webhook:

**Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS pending_settlement_confirmation

**webhook.json**

```json
{
    "webhook_type": "credit_transfer.proposal",
    "proposal_key": "<PROPOSAL-KEY>",
    "proposal_status": "pending_settlement_confirmation",
    "event_datetime": "2022-11-24T15:42:12"
}
```

:::info
A confirmação da quitação do contrato é encaminhada pela Instituição Credora Original ao CTC e posteriormente encaminhado pelo CTC à QI.

O SLA para confirmação da quitação da Portabilidade é de **2 d.u.** contados a partir do envio dos recursos para pagamento do saldo devedor do contrato original.
:::

#### paid

Assim que a QI receber do CTC a confirmação da quitação do Contrato Original, a Proposta constará como paga e a Portabilidade estará finalizada.

**Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS paid

**webhook.json**

```json
{
    "webhook_type": "credit_transfer.proposal",
    "proposal_key": "<PROPOSAL-KEY>",
    "proposal_status": "paid",
    "event_datetime": "2022-11-24T15:42:12"
}
```

Nesta etapa, caso a averbação da Operação de Portabilidade já esteja concluída, a Operação de Refinanciamento (Troco), poderá ser iniciada (fluxo descrito no item 7).

A notificação sobre a averbação da Operação de Portabilidade será enviada através do seguinte webhook:

**Webhook**

- WEBHOOK_TYPE credit_transfer.proposal.collateral

**webhook.json**

```json
{
    "webhook_type": "credit_transfer.proposal.collateral",
    "proposal_key": "<PROPOSAL-KEY>",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
        "credit_operation_type": "portability",
        "credit_operation_key": "<CREDIT-OPERATION-KEY>",
        "collateral_type": "private_payroll",
        "collateral_constituted": true,
        "collateral_data": {
            "reservation_method": "portability"
        }
    }
}
```

data.collateral_data.reservation_method: [portability, new_credit ]

#### rejected

Caso o banco credor original rejeite a quitação do contrato, o recurso enviado para quitação do saldo devedor do contrato original será devolvido, e a proposta será finalizada. O parceiro receberá o webhook de **“rejected”**.

**Webhook**

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS rejected

**webhook.json**

```json
{
    "webhook_type": "credit_transfer.proposal",
    "proposal_key": "<PROPOSAL-KEY>",
    "proposal_status": "rejected",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
        "error": {
            "code": "QCTC0001",
            "reason": "Pagamento de portabilidade rejeitado."
        }
    }
}
```

Caso nesta etapa a Operação de Portabilidada já esteja averbada na folha do empregador, será realizada a desaverbação da margem.

:::info
Não é possível retomar uma Proposta com status “**rejected**”. É sempre necessário realizar uma nova digitação.
:::

---

## Status da Operação de Refinanciamento (Troco)

No momento em que a Operação de Portabilidade é paga, o Parceiro pode optar por seguir com a Operação de Refinanciamento (Troco) ou não.

#### Enumeradores credit_operation_status
| Enumerador               					| Descrição                  	 		|
|-------------------------------------------|---------------------------------------|
| waiting_signature  						| Operação aguardando assinatura 		|
| signed     								| Operação assinada			     		|
| issued  									| Operação emitida			     		|
| disbursed									| Operação desembolsada		     		|
| settled     								| Operação liquidada	         		|
| canceled     								| Operação cancelada		     		|
| canceled_permanently  					| Operação cancelada permanentemente    |

Para prosseguir com o Refinanciamento (Troco), o Parceiro deve realizar a seguinte chamada passando os campos 'Financial' e 'Disbursement Bank Accounts':

*Adicionalmente, pode-se passar o campo 'purchaser_document_number' para alterar o cessionário da operação.

ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /refinancing_credit_operation/acceptance
MÉTODO POST

Testar no Playground

**Requisição**

**request.json**

```json
{
    "financial": {
        "installment_face_value": 379.87,
        "monthly_interest_rate": 0.0166,
        "number_of_installments": 84,
        "limit_days_to_disburse": 7,
        "disbursement_date": "2024-07-02",
        "rebates": [
            {
                "rebate_bank_account": {
                    "bank_code": "329",
                    "account_digit": "9",
                    "document_number": "18533555000164",
                    "name": "Teste Ltda",
                    "account_number": "4290002",
                    "branch_number": "0001"
                },
                "amount_type": "percentage",
                "fee_type": "spread",
                "amount": 9.5
            },
            {
                "amount": 20,
                "rebate_bank_account": {
                    "name": "Teste Ltda",
                    "document_number": "18533555000164",
                    "account_digit": "0",
                    "account_number": "4290001",
                    "branch_number": "0001",
                    "bank_code": "329"
                },
                "amount_type": "percentage",
                "fee_type": "insurance_premium"
            }
        ]
    },
    "disbursement_bank_accounts": [
        {
            "document_number": "92093764000197",
            "branch_number": "0001",
            "name": "TESTE LTDA",
            "percentage_receivable": 100,
            "account_number": "120012",
            "account_digit": "3",
            "bank_code": "329"
        }
    ],
    "purchaser_document_number": "28534595027164"
}
```

**Resposta**

**response.json**

```json
{
    "credit_operation_key": "<CREDIT-OPERATION-KEY>",
    "contract_number": "00000002",
    "document_key": "<DOCUMENT-KEY da CCB de Refinanciamento>",
    "document_url": "<URL da CCB de Refinanciamento>",
    "credit_operation_status": "issued",
    "fine_configuration": {
        "contract_fine_rate": 0.02,
        "interest_base": "calendar_days",
        "monthly_rate": 0.01
    },
    "disbursement_options": [
        {
            "installments": [
                {
                    "additional_costs": [],
                    "bank_slip_key": null,
                    "business_due_date": "2021-08-09",
                    "calendar_days": 53,
                    "digitable_line": null,
                    "due_date": "2021-08-08",
                    "due_interest": 0,
                    "due_principal": 997.87,
                    "fine_amount": null,
                    "has_interest": true,
                    "installment_key": "e3bedf31-1e87-4ba4-a36c-d52f7f5c9036",
                    "installment_number": 1,
                    "installment_status": "created",
                    "installment_type": "principal",
                    "paid_amount": 0,
                    "paid_at": null,
                    "post_fixed_amount": 0,
                    "pre_fixed_amount": 54.84865004983954,
                    "principal_amortization_amount": 306.98134995016045,
                    "total_amount": 361.83,
                    "workdays": 37
                },
                {
                    "additional_costs": [],
                    "bank_slip_key": null,
                    "business_due_date": "2021-09-08",
                    "calendar_days": 31,
                    "digitable_line": null,
                    "due_date": "2021-09-08",
                    "due_interest": 0,
                    "due_principal": 690.8886500498395,
                    "fine_amount": null,
                    "has_interest": true,
                    "installment_key": "e8406cdb-844c-4e6d-9620-3635fab9d8d1",
                    "installment_number": 2,
                    "installment_status": "created",
                    "installment_type": "principal",
                    "paid_amount": 0,
                    "paid_at": null,
                    "post_fixed_amount": 0,
                    "pre_fixed_amount": 21.964874249804833,
                    "principal_amortization_amount": 339.86512575019515,
                    "tax_amount": 0,
                    "total_amount": 361.83,
                    "workdays": 22
                }
            ],
            "prefixed_interest_rate": {
                "annual_rate": 0.44556431,
                "daily_rate": 0.00564312,
                "monthly_rate": 0.0556431,
                "interest_base": "calendar_days_365"
            },
            "iof_amount": 50,
            "external_contract_fee_amount": 0,
            "external_contract_fees": [],
            "contract_fee_amount": 0,
            "contract_fees": [],
            "number_of_installments": 2,
            "disbursed_issue_amount": 997.87,
            "final_disbursement_amount": 100,
            "issue_amount": 1147.87,
            "disbursement_date": "2021-05-31",
            "cet": 1.212,
            "annual_cet": 32.122
        }
    ],
    "disbursement_bank_account": {
        "account_digit": "1",
        "account_number": "00001",
        "ispb": "00000000",
        "branch_number": "0001"
    }
}
```

Caso o Parceiro opte por não prosseguir com a Operação de Refinanciamento (Troco), ele deve realizar a seguinte chamada:

ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /refinancing_credit_operation
MÉTODO DELETE

### Averbação do Refinanciamento (Troco)

Assim que o Parceiro optar por prosseguir com a Operação de Refinanciamento, a rotina para averbação da margem consignável terá início. Assim que a averbação da margem consignável na folha do empregador for concluída o parceiro recebera o seguinte webhook:

**Webhook**

- WEBHOOK_TYPE credit_transfer.proposal.collateral

**webhook.json**

```json
{
    "webhook_type": "credit_transfer.proposal.collateral",
    "proposal_key": "<PROPOSAL-KEY>",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
        "credit_operation_type": "refinancing",
        "credit_operation_key": "<CREDIT-OPERATION-KEY>",
        "collateral_type": "private_payroll",
        "collateral_constituted": true
    }
}
```

### Desembolso do Refinanciamento (Troco)

Assim que a averbação da margem consignável na folha do empregador for concluída a operação estará pronta para desembolso.
No desembolso da Operação de Refinanciamento, a Operação de Portabilidade será quitada e caso exista valor desembolsado remanescente (**7.1.1. “disbursement_options.final_disbursement_amount”**), este valor será liberado para o cliente (Troco) na conta para desembolso da Operação (**“disbursement_bank_account“**).
A liberação do troco para o cliente pode ser realizada via PIX ou TED, em qualquer horário do dia (obedecendo horário comercial de 7:00 às 17:00 em dias úteis, no caso da TED).

Caso o desembolso do troco para o cliente seja bem sucedido, será enviado um webhook com os dados da comprovação do desembolso:

**Webhook**

- WEBHOOK_TYPE credit_transfer.proposal.credit_operation

**webhook.json**

```json
{
    "webhook_type": "credit_transfer.proposal.credit_operation",
    "proposal_key": "<PROPOSAL-KEY>",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
        "credit_operation_status": "disbursed",
        "credit_operation_type": "refinancing",
        "credit_operation_key": "<CREDIT-OPERATION-KEY>",
        "ted_receipt_list": [
            {
                "fee": 0,
                "url": "https://qitech.com.br/",
                "amount": 500,
                "origin": {
                    "name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
                    "type": "payment_account",
                    "branch": "0001",
                    "document": "32402502000135",
                    "bank_code": "329",
                    "account_key": "871059bd-4014-41ad-82b4-28275ff0e67b",
                    "branch_digit": null,
                    "account_digit": "5",
                    "account_branch": "0001",
                    "account_number": "00002"
                },
                "timestamp": "2022-09-28T13:00:47",
                "description": "DESCRIPTION",
                "destination": {
                    "name": "Elaine Isadora da Cruz",
                    "type": "checking_account",
                    "bank_code": "033",
                    "branch": "0001",
                    "purpose": "Crédito PIX em Conta",
                    "document_number": "90406718261",
                    "bank_ispb": "90400888",
                    "branch_digit": null,
                    "account_digit": "1",
                    "account_number": "00001"
                },
                "end_to_end_id": null,
                "transaction_key": "871059bd-4014-41ad-82b4-28275ff0e67b",
                "origin_transaction_key": null
            }
        ]
    }
}
```

Caso ocorra falha no desembolso, o parceiro receberá o seguinte webhook:

#### Falha no desembolso via PIX

**Webhook**

- WEBHOOK_TYPE credit_transfer.proposal.credit_operation

**webhook.json**

```json
{
    "webhook_type": "credit_transfer.proposal.credit_operation",
    "proposal_key": "60fbbfe2-eb52-4825-9ed5-f169a58b9999",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
        "credit_operation_status": "canceled",
        "credit_operation_type": "refinancing",
        "credit_operation_key": "1a1a44df-29b6-431c-89af-53657d906333",
        "pix_refusal": {
            "reason_enumerator": "invalid_document_number",
            "reason": "CPF/CNPJ do usuário recebedor não é compatível com o titular da conta de destino."
        },
        "cancel_reason": "pix_refusal"
    }
}
```

#### Falha no desembolso via TED

**Webhook**

- WEBHOOK_TYPE credit_transfer.proposal.credit_operation

**webhook.json**

```json
{
    "webhook": {
        "data": {
            "cancel_reason": "Agência ou Conta Destinatária do Crédito Inválida",
            "credit_operation_key": "1a1a44df-29b6-431c-89af-53657d906333",
            "credit_operation_type": "refinancing",
            "credit_operation_status": "canceled",
            "cancel_reason_enumerator": "agencia_conta_invalida"
        },
        "proposal_key": "60fbbfe2-eb52-4825-9ed5-f169a58b9999",
        "webhook_type": "credit_transfer.proposal.credit_operation",
        "event_datetime": "2023-12-22T10:15:25"
    }
}
```

No caso de falha no desembolso da Operação, o desembolso pode ser retentato alterando-se os dados bancários:

ENDPOINT /v2/credit_transfer/proposal/ PROPOSAL-KEY /refinancing_credit_operation
MÉTODO PATCH

Testar no Playground

**Requisição**

**request.json**

```json
{
    "disbursement_date": "2022-11-04",
    "disbursement_bank_account": {
        "account_branch": "1232",
        "account_digit": "4",
        "account_number": "412412412",
        "account_type": "checking_account",
        "document_number": "14950479032",
        "ispb": "17298092",
        "name": "Maria da Silva"
    }
}
```

---

# Manual Consignado Privado - Portabilidade: Mocks e Sandbox

URL: /en/documentation/manual_consignado_privado/portabilidade/mocks_sandbox

:::danger Aviso Importante!
Não utilize dados pessoais reais (CPF, CNPJ etc.) em ambiente sandbox.
:::

## Simulação de Cenários

### Portabilidade

#### 1. Solicitação do Saldo Devedor

Após a assinatura da operação de portabilidade, caso o cliente tenha configuração de envio manual, a proposta será 
criada com status "pending_submission" e somente após a chamada da rota a seguir, a solicitação do saldo devedor será feita. 
Caso a configuração seja de envio automático a proposta será criada com status "pending_response", ou seja, já está aguardando o retorno do saldo
e não é necessário chamar esta rota.

**Requisição**

ENDPOINT /v2/credit_transfer/proposal/PROPOSAL-KEY
MÉTODO PATCH

**request.json**

```json
{
    "status": "pending_response"
}
```

#### 2. Aprovação pelo CTC

A proposta deve estar em status "pending_response".

**Requisição**

ENDPOINT /mock/credit_transfer/ctc
MÉTODO POST

**request.json**

```json
{
    "proposal_key": "CHAVE DA PROPOSTA",
    "event_type": "proposal_creation_accepted"
}
```

#### 3. Rejeição pelo CTC

A proposta deve estar em status "pending_response".

**Requisição**

ENDPOINT /mock/credit_transfer/ctc
MÉTODO POST

**request.json**

```json
{
    "proposal_key": "CHAVE DA PROPOSTA",
    "event_type": "proposal_creation_refused"
}
```

#### 4. Envio de saldo devedor pelo banco de origem

A chamada de aprovação pelo CTC (**2**) deve ser enviada antes. A proposta deve estar em status "pending_acceptance". 
Após esta rota, receberá o webhook informando o saldo devedor atual da dívida e caso queira seguir com a operação deve chamar
a rota apresentada no fluxo de aceite da proposta.

**Requisição**

ENDPOINT /mock/credit_transfer/ctc
MÉTODO POST

**request.json**

```json
{
    "proposal_key": "CHAVE DA PROPOSTA",
    "event_type": "proposal_approval",
    "due_balance": 9000, // Opcional, se não informado será enviado o valor usado na criação da proposta
    "installment_face_value": 300, // Opcional, se não informado será enviado o valor usado na criação da proposta
    "installment_number": 40, // Opcional, se não informado será enviado o valor usado na criação da proposta
    "opened_installment_number": 35, // Opcional, se não informado será enviado igual ao installment_number
    "overdue_installment_number": 5 // Opcional, se não informado será enviado 0
}
```

#### 5. Retenção pelo banco de origem

A chamada de aprovação pelo CTC (**2**) deve ser enviada antes. A proposta deve estar em status "pending_acceptance"

**Requisição**

ENDPOINT /mock/credit_transfer/ctc
MÉTODO POST

**request.json**

```json
{
    "proposal_key": "CHAVE DA PROPOSTA",
    "event_type": "proposal_retention"
}
```

#### 6. Devolução do pagamento pelo banco de origem

Só pode ser enviado depois que a proposta for aceita e a operação de portabilidade desembolsada. Proposta deve estar em 
status "settlement_sent", "pending_settlement_confirmation" ou "paid".

**Requisição**

ENDPOINT /mock/credit_transfer/str
MÉTODO POST

**request.json**

```json
{
    "proposal_key": "CHAVE DA PROPOSTA",
    "event_type": "payment_rejected"
}
```

#### 7. Confirmação de pagamento pelo CTC

Proposta deve ter sido aceita e a operação de portabilidade desembolsada. Status deve ser "settlement_sent".

**Requisição**

ENDPOINT /mock/credit_transfer/ctc
MÉTODO POST

**request.json**

```json
{
    "proposal_key": "CHAVE DA PROPOSTA",
    "event_type": "settlement_confirmation"
}
```

#### 8. Confirmação de pagamento pelo banco de origem

Deve ser chamado após a confirmação de pagamento pelo CTC (**7**). Proposta deve estar em status 
"pending_settlement_confirmation".

**Requisição**

ENDPOINT /mock/credit_transfer/ctc
MÉTODO POST

**request.json**

```json
{
    "proposal_key": "CHAVE DA PROPOSTA",
    "event_type": "payment_confirmation"
}
```

#### 9. Averbação de garantia

Proposta deve estar em status "pending_settlement_confirmation" ou "paid", após **7** ou **8**.

**Requisição**

ENDPOINT /mock/credit_transfer/collateral
MÉTODO POST

**request.json**

```json
{
    "proposal_key": "CHAVE DA PROPOSTA",
    "credit_operation_type": "portability",
    "collateral_constituted": true
}
```

### Refinanciamento

#### 10. Averbação de garantia

Proposta deve estar em status "paid" ou "pending_settlement_confirmation" com garantia de portabilidade averbada e o 
refinanciamento deve ter sido aceito.

**Requisição**

ENDPOINT /mock/credit_transfer/collateral
MÉTODO POST

**request.json**

```json
{
    "proposal_key": "CHAVE DA PROPOSTA",
    "credit_operation_type": "refinancing",
    "collateral_constituted": true
}
```

#### 11. Falha na averbação de garantia

Proposta deve estar em status "paid" ou "pending_settlement_confirmation" com garantia de portabilidade averbada e o 
refinanciamento deve ter sido aceito.

**Requisição**

ENDPOINT /mock/credit_transfer/collateral
MÉTODO POST

**request.json**

```json
{
    "proposal_key": "CHAVE DA PROPOSTA",
    "credit_operation_type": "refinancing",
    "collateral_constituted": false
}
```

#### 12. Falha no desembolso

Operação de refinanciamento deve ter sido desembolsada.

**Requisição**

ENDPOINT /mock/credit_transfer/disbursement
MÉTODO POST

**request.json**

```json
{
    "proposal_key": "CHAVE DA PROPOSTA",
    "event_type": "disbursement_failed"
}
```

---

# Manual Consignado Privado - Portabilidade: Digitação da Proposta

URL: /en/documentation/manual_consignado_privado/portabilidade/proposta

A digitação da proposta cria a operação de **portabilidade** e, opcionalmente, a operação de **refinanciamento** (Troco) na mesma requisição, por meio do endpoint `POST /v2/credit_transfer/proposal`.

ENDPOINT /v2/credit_transfer/proposal
MÉTODO POST

Testar no Playground

:::caution Atenção
Para que os pedidos de averbação, tanto da portabilidade quanto do refinanciamento, sejam criados com sucesso, é preciso que uma **consulta de dados válida do trabalhador** tenha sido feita **previamente**. Siga os passos de [Consultas Prévias](/documentation/manual_consignado_privado/portabilidade/consultas).
:::

## Estrutura da requisição

A requisição é composta por alguns campos no nível raiz e pelos objetos da operação. A estrutura geral é a seguinte — cada objeto é detalhado nas seções abaixo:

```json title='Estrutura geral'
{
    "proposal_type": "private_company",
    "purchaser_document_number": "32402502000135",
    "borrower": ,
    "related_parties": [ /* representante legal, quando houver */ ],
    "collaterals": [ /* garantia: folha de pagamento */ ],
    "portability_credit_operation": ,
    "refinancing_credit_operation": ,
    "origin_contract": ,
    "additional_data": {}
}
```

| Campo (raiz) | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| `proposal_type` | string | ✅ | `"private_company"` para Consignado Privado. |
| `purchaser_document_number` | string | ✅ | CNPJ do comprador da operação. |
| `additional_data` | object | — | Dados complementares da operação. |

:::info Portabilidade sem refinanciamento
Para uma **portabilidade pura**, sem liberação de Troco, omita o objeto `refinancing_credit_operation`, mantendo `portability_credit_operation` e `origin_contract`.
:::

### `borrower` — dados do tomador

Dados cadastrais do tomador do crédito. Ver objeto compartilhado [Borrower](/documentation/objetos_compartilhados/borrower). Os documentos do tomador **não são enviados na proposta** — a formalização é feita via QI Sign. Ver [Formalização](/documentation/manual_consignado_privado/portabilidade/formalizacao).

```json
{
    "person_type": "natural",
    "name": "Marilene da Silva",
    "mother_name": "Maria Mariane",
    "birth_date": "1990-05-06",
    "profession": "Desenvolvedora",
    "nationality": "Brasileira",
    "marital_status": "single",
    "is_pep": false,
    "individual_document_number": "20676928013",
    "document_identification_number": "381803326",  // obrigatório
    "document_identification_type": "rg",  // obrigatório — rg | cnh | cin
    "document_identification_date": "2019-01-28",
    "email": "marilene@email.com",
    "phone": {
        "country_code": "055",
        "area_code": "11",
        "number": "912828135"
    },
    "address": {
        "street": "Passagem Mariana",
        "state": "PA",
        "city": "Ananindeua",
        "neighborhood": "Águas Lindas",
        "number": "660",
        "postal_code": "67118003",
        "complement": "complemento"
    }
}
```

:::danger Documento de identificação obrigatório (a partir de 03/08/2026)
A Núclea passará a exigir o documento de identificação do tomador no registro da portabilidade a partir de **06/08/2026**. Por isso, a partir de **segunda-feira, 03/08/2026**, `borrower.document_identification_type` e `borrower.document_identification_number` passam a ser **obrigatórios** na digitação da proposta — propostas sem esses campos retornam erro.

Quando `document_identification_type` for `cin`, o `document_identification_number` **pode** ser igual ao `individual_document_number` (CPF), já que a CIN usa o número do CPF. Para os demais tipos (`rg`, `cnh`), enviar o CPF em `document_identification_number` retorna erro.
:::

| Campo (`borrower`) | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| `person_type` | string | ✅ | `natural`. |
| `individual_document_number` | string | ✅ | CPF do tomador (11 dígitos, sem pontuação). |
| `document_identification_type` | string | ✅ | Tipo do documento de identificação. Valores: `rg`, `cnh`, `cin`. |
| `document_identification_number` | string (máx. 16) | ✅ | Número do documento informado em `document_identification_type`. Igual ao CPF **somente** quando o tipo for `cin`. |
| `document_identification_date` | string | — | Data de emissão do documento (`YYYY-MM-DD`). |

### `related_parties` — representante legal (opcional)

Envie esta lista **apenas** quando a operação tem representante legal. Cada item deve conter os dados cadastrais do representante e o campo `role_type` com o valor `issuer_legal_representative`.

```json
[
    {
        "name": "Nome Representante Legal",
        "email": "email@email.com.br",
        "birth_date": "2000-12-12",
        "is_pep": false,
        "mother_name": "maria",
        "phone": {
            "number": "991294043",
            "area_code": "11",
            "country_code": "055"
        },
        "address": {
            "street": "Avenida das Castanheiras",
            "state": "SP",
            "city": "Brasília",
            "neighborhood": "bairro",
            "number": "12",
            "postal_code": "71900100",
            "complement": ""
        },
        "role_type": "issuer_legal_representative",
        "person_type": "natural",
        "individual_document_number": "45102538004",
        "document_identification_type": "rg",
        "document_identification_number": "123456789"
    }
]
```

### `collaterals` — garantia (folha de pagamento)

A garantia é a folha de pagamento de funcionários de empresas privadas. O `collateral_data` carrega o CNPJ do empregador e a matrícula do trabalhador.

```json
[
    {
        "collateral_type": "private_payroll",
        "collateral_data": {
            "employer_document_number": "<CNPJ DO EMPREGADOR>",
            "registration_number": "<MATRÍCULA DO TRABALHADOR>"
        }
    }
]
```

### `portability_credit_operation` — operação portada

Operação que assume (porta) o contrato de origem. Informe sempre `number_of_installments` e **uma** entre `monthly_interest_rate` ou `installment_face_value`.

```json
{
    "financial": {
        "monthly_interest_rate": 0.0132,
        "number_of_installments": 10
    },
    "contract_number": "300523588PF"
}
```

### `refinancing_credit_operation` — Troco (opcional)

Operação que quita a portabilidade e libera o Troco na conta do trabalhador. Como o refinanciamento **não tem data de desembolso fixa**, a mudança na data de desembolso altera os valores da operação — por isso é necessário fixar **a taxa** (`monthly_interest_rate`) **ou** o **valor liberado** ao cliente (`disbursed_amount`).

A única diferença entre as duas formas está no objeto `financial`; `disbursement_bank_account` (conta de destino do Troco) e `contract_number` são iguais nos dois casos.

**Fixando a taxa**

```json
{
    "financial": {
        "monthly_interest_rate": 0.0132,
        "installment_face_value": 100,
        "number_of_installments": 10
    },
    "disbursement_bank_account": {
        "account_digit": "1",
        "account_number": "000059923",
        "ispb": "341",
        "bank_code": "341",
        "branch_number": "0155"
    },
    "contract_number": "200523588PK"
}
```

**Fixando o valor liberado**

```json
{
    "financial": {
        "disbursed_amount": 1000,
        "installment_face_value": 100,
        "number_of_installments": 10
    },
    "disbursement_bank_account": {
        "account_digit": "1",
        "account_number": "000059923",
        "ispb": "341",
        "bank_code": "341",
        "branch_number": "0155"
    },
    "contract_number": "200523588PK"
}
```

### `origin_contract` — contrato de origem

Identifica a dívida na instituição credora original.

```json
{
    "ispb": "60746948",
    "contract_number": "558472",
    "last_due_balance": 997.87
}
```

:::info ISPB do credor original
O `origin_contract.ispb` é o **ISPB** da instituição credora original (a base do CNPJ da instituição). A lista completa de ISPBs das instituições participantes da CTC pode ser obtida pelo endpoint de [consulta de participantes do CTC](/documentation/manual_consignado_privado/portabilidade/consultas_pos_proposta).
:::

### Campos das operações

| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| `collaterals[].collateral_type` | string | ✅ | `"private_payroll"`. |
| `collaterals[].collateral_data.employer_document_number` | string | ✅ | CNPJ do empregador. |
| `collaterals[].collateral_data.registration_number` | string | ✅ | Matrícula do trabalhador na folha do empregador. |
| `portability_credit_operation.financial.number_of_installments` | integer | ✅ | Número de parcelas. |
| `portability_credit_operation.financial.monthly_interest_rate` / `installment_face_value` | number | ✅ | Enviar **uma** das duas. |
| `portability_credit_operation.contract_number` | string | ✅ | Número do contrato de portabilidade gerado. |
| `refinancing_credit_operation.financial` | object | ⚠️ | Necessário quando há Troco. Fixar `monthly_interest_rate` (taxa) **ou** `disbursed_amount` (valor liberado). |
| `refinancing_credit_operation.disbursement_bank_account` | object | ⚠️ | Conta de destino do Troco. |
| `origin_contract.ispb` | string | ✅ | ISPB do credor original (base do CNPJ). |
| `origin_contract.contract_number` | string | ✅ | Número do contrato na instituição de origem. |
| `origin_contract.last_due_balance` | number | ✅ | Saldo devedor do contrato de origem. |

## Response

A criação da proposta retorna a `proposal_key` e, dentro de `borrower` e de cada item de `related_parties`, a `related_party_key` (identificador de cada parte na proposta).

**Response Body (resumido)**

```json
{
    "proposal_key": "<PROPOSAL-KEY>",
    "status": "pending_submission",
    "borrower": {
        "name": "Marilene da Silva",
        "individual_document_number": "20676928013",
        "role_type": "issuer",
        "related_party_key": "511d7186-3c17-4f35-8887-c4aefaf270be"
    },
    "collaterals": [
        {
            "collateral_type": "private_payroll",
            "collateral_data": {
                "employer_document_number": "<CNPJ DO EMPREGADOR>",
                "registration_number": "<MATRÍCULA DO TRABALHADOR>"
            }
        }
    ],
    "portability_credit_operation": {
        "contract_number": "300523588PF"
    },
    "refinancing_credit_operation": {
        "contract_number": "200523588PK"
    },
    "origin_contract": {
        "ispb": "60746948",
        "contract_number": "558472",
        "last_due_balance": 997.87
    }
}
```

:::info Recuperar dados de uma proposta
Em casos de timeout ou operação duplicada, é possível recuperar os dados de uma proposta enviando a `requester_control_key` no lugar da `proposal_key`. Ver [Consultas e Operações Pós-Proposta](/documentation/manual_consignado_privado/portabilidade/consultas_pos_proposta).
:::

## Correção de dados

Após a digitação, dados da proposta podem ser corrigidos antes do avanço do fluxo — para a operação de refinanciamento, para a portabilidade, ou para ambas. Dependendo do dado alterado, pode ser necessária uma **nova assinatura da CCB**. As transições e o endpoint de atualização (`PATCH /v2/credit_transfer/proposal/{PROPOSAL-KEY}`) estão detalhados em [Acompanhamento da Operação](/documentation/manual_consignado_privado/portabilidade/maquina_de_status).

---

# Manual Consignado Privado - Portabilidade: Simulação

URL: /en/documentation/manual_consignado_privado/portabilidade/simulacao

A simulação retorna as condições financeiras da operação — cronograma de parcelas, CET e o valor do Troco — **antes da digitação da proposta** e sem precisar coletar os dados cadastrais do cliente. Use-a para validar taxas, número de parcelas e o Troco com o trabalhador.

ENDPOINT /v2/credit_transfer/proposal_simulation
MÉTODO POST

Testar no Playground

:::caution Troco mínimo escalonado pelo número de parcelas em aberto
Em propostas com Troco, o valor do Troco precisa corresponder a um percentual mínimo da diferença entre a soma das parcelas do refinanciamento e a soma das parcelas da portabilidade. Esse percentual mínimo **diminui conforme o número de parcelas em aberto do contrato de origem** (`origin_contract`):

| Parcelas em aberto do contrato de origem | Troco mínimo |
|---|---|
| Menos de 56 | **5%** |
| De 56 a 71 | **3%** |
| 72 ou mais | **2%** |

Caso o Troco calculado fique abaixo do piso aplicável, a requisição retorna o erro **400**:

STATUS 400

**Response Body**

```json
{
    "code": "CT000118",
    "title": "Bad Request",
    "description": "The final disbursement amount is less than 5% of the sum of refinancing installment minus the sum of portability installment. The minimum final disbursement amount allowed is 500.00. Calculated final disbursement amount: 400.00.",
    "translation": "O valor do troco é menor que 5% da soma do valor das parcelas do refinanciamento menos o valor soma das parcelas da portabilidade. O valor mínimo do troco permitido é de 500.00. Valor calculado do troco: 400.00."
}
```
:::

## Portabilidade com Refinanciamento

Simula a portabilidade e o refinanciamento (Troco) na mesma requisição, retornando as condições das duas operações.

### Requisição

O corpo contém apenas os dados mínimos da simulação. Assim como na [Digitação da Proposta](/documentation/manual_consignado_privado/portabilidade/proposta), a diferença entre os dois modos está em como o refinanciamento é fixado — pela **taxa** (`monthly_interest_rate`) ou pelo **valor liberado** ao cliente (`disbursed_amount`):

**Fixando a taxa**

```json
{
    "borrower": {
        "person_type": "natural"
    },
    "collaterals": [
        {
            "collateral_type": "private_payroll"
        }
    ],
    "portability_credit_operation": {
        "financial": {
            "monthly_interest_rate": 0.0132,
            "number_of_installments": 10
        }
    },
    "refinancing_credit_operation": {
        "financial": {
            "days_to_accrual": 0,
            "monthly_interest_rate": 0.0132,
            "installment_face_value": 100,
            "number_of_installments": 10
        }
    },
    "origin_contract": {
        "last_due_balance": 997.87
    }
}
```

**Fixando o valor liberado**

```json
{
    "borrower": {
        "person_type": "natural"
    },
    "collaterals": [
        {
            "collateral_type": "private_payroll"
        }
    ],
    "portability_credit_operation": {
        "financial": {
            "installment_face_value": 100,
            "number_of_installments": 10
        }
    },
    "refinancing_credit_operation": {
        "financial": {
            "days_to_accrual": 0,
            "disbursed_amount": 1000,
            "installment_face_value": 100,
            "number_of_installments": 10
        }
    },
    "origin_contract": {
        "last_due_balance": 997.87
    }
}
```

### Resposta

A resposta retorna **6 campos** no nível raiz: três identificadores da proposta e três objetos com os detalhes do tomador e das operações.

```json title='Estrutura da resposta'
{
    "proposal_key": "...",                      /* chave única da proposta */
    "proposal_number": "...",                   /* número da proposta */
    "proposal_status": "pending_submission",    /* status atual da proposta */
    "borrower": ,
    "portability_credit_operation": ,
    "refinancing_credit_operation": 
}
```

| Campo | Tipo | Descrição |
|---|---|---|
| `proposal_key` | string | Chave única da proposta. |
| `proposal_number` | string | Número da proposta. |
| `proposal_status` | string | Status atual da proposta (ex.: `pending_submission`). |
| `borrower` | object | Dados do tomador, incluindo a `related_party_key` usada no envio de documentos. |
| `portability_credit_operation` | object | Condições da operação de portabilidade: `disbursement_options` com o cronograma de `installments`, as taxas (`cet`, `annual_cet`, `prefixed_interest_rate`) e o `issue_amount`. |
| `refinancing_credit_operation` | object | Condições do refinanciamento (Troco). O valor do Troco aparece em `final_disbursement_amount`. |

Exemplo completo da resposta:

**response.json**

```json
{
    "proposal_key": "28a925f6-570e-4724-9132-3bd42f267c4f",
    "proposal_number": "17032788499215403",
    "proposal_status": "pending_submission",
    "borrower": {
        "individual_document_number": "98765432100",
        "related_party_key": "fa55dca3-3147-45d2-bb8d-941f2d7191da",
        "role_type": "issuer"
    },
    "portability_credit_operation": {
        "credit_operation_key": "a66675e6-bdc2-4468-8420-2889d5cec0a8",
        "credit_operation_status": "waiting_signature",
        "disbursement_accounts": [],
        "disbursement_options": [
            {
                "annual_cet": 0.173044,
                "cet": 0.0134,
                "contract_fee_amount": 0.0,
                "contract_fees": [
                    {
                        "amount": 0.5,
                        "amount_type": "percentage",
                        "fee_amount": 0.0,
                        "fee_type": "tac"
                    }
                ],
                "disbursed_issue_amount": 997.87,
                "disbursement_date": "2023-12-22",
                "external_contract_fee_amount": 0.0,
                "external_contract_fees": [
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "spread",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    },
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "tac",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    },
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "insurance_premium",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    }
                ],
                "installments": [
                    {
                        "business_due_date": "2024-02-22",
                        "calendar_days": 62,
                        "due_date": "2024-02-22",
                        "due_principal": 997.87,
                        "installment_number": 1,
                        "pre_fixed_amount": 27.413791524708554,
                        "principal_amortization_amount": 81.34620847529145,
                        "total_amount": 108.76,
                        "workdays": 40
                    },
                    {
                        "business_due_date": "2024-03-22",
                        "calendar_days": 29,
                        "due_date": "2024-03-22",
                        "due_principal": 916.5237915247086,
                        "installment_number": 2,
                        "pre_fixed_amount": 11.692366920719124,
                        "principal_amortization_amount": 97.06763307928088,
                        "total_amount": 108.76,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-04-22",
                        "calendar_days": 31,
                        "due_date": "2024-04-22",
                        "due_principal": 819.4561584454277,
                        "installment_number": 3,
                        "pre_fixed_amount": 11.179911547915339,
                        "principal_amortization_amount": 97.58008845208467,
                        "total_amount": 108.76,
                        "workdays": 20
                    },
                    {
                        "business_due_date": "2024-05-22",
                        "calendar_days": 30,
                        "due_date": "2024-05-22",
                        "due_principal": 721.876069993343,
                        "installment_number": 4,
                        "pre_fixed_amount": 9.5288330736045,
                        "principal_amortization_amount": 99.2311669263955,
                        "total_amount": 108.76,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-06-24",
                        "calendar_days": 33,
                        "due_date": "2024-06-24",
                        "due_principal": 622.6449030669476,
                        "installment_number": 5,
                        "pre_fixed_amount": 9.046812945831448,
                        "principal_amortization_amount": 99.71318705416856,
                        "total_amount": 108.76,
                        "workdays": 22
                    },
                    {
                        "business_due_date": "2024-07-22",
                        "calendar_days": 28,
                        "due_date": "2024-07-22",
                        "due_principal": 522.9317160127789,
                        "installment_number": 6,
                        "pre_fixed_amount": 6.439743824282488,
                        "principal_amortization_amount": 102.32025617571752,
                        "total_amount": 108.76,
                        "workdays": 20
                    },
                    {
                        "business_due_date": "2024-08-22",
                        "calendar_days": 31,
                        "due_date": "2024-08-22",
                        "due_principal": 420.61145983706143,
                        "installment_number": 7,
                        "pre_fixed_amount": 5.738438681013405,
                        "principal_amortization_amount": 103.0215613189866,
                        "total_amount": 108.76,
                        "workdays": 23
                    },
                    {
                        "business_due_date": "2024-09-23",
                        "calendar_days": 32,
                        "due_date": "2024-09-23",
                        "due_principal": 317.58989851807485,
                        "installment_number": 8,
                        "pre_fixed_amount": 4.473657660291388,
                        "principal_amortization_amount": 104.28634233970861,
                        "total_amount": 108.76,
                        "workdays": 22
                    },
                    {
                        "business_due_date": "2024-10-22",
                        "calendar_days": 29,
                        "due_date": "2024-10-22",
                        "due_principal": 213.30355617836625,
                        "installment_number": 9,
                        "pre_fixed_amount": 2.721176981322744,
                        "principal_amortization_amount": 106.03882301867725,
                        "total_amount": 108.76,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-11-22",
                        "calendar_days": 31,
                        "due_date": "2024-11-22",
                        "due_principal": 107.26473315968899,
                        "installment_number": 10,
                        "pre_fixed_amount": 1.4934220715493307,
                        "principal_amortization_amount": 107.26657792845067,
                        "total_amount": 108.76,
                        "workdays": 22
                    }
                ],
                "issue_amount": 997.87,
                "number_of_installments": 10,
                "prefixed_interest_rate": {
                    "annual_rate": 0.17042118,
                    "daily_rate": 0.00043722,
                    "interest_base": "calendar_days",
                    "monthly_rate": 0.0132
                },
                "total_iof": 0.0
            }
        ],
        "final_disbursement_amount": 0.0
    },
    "refinancing_credit_operation": {
        "credit_operation_key": "aaf9abe0-2b8a-4688-8e09-413e1bd5285e",
        "credit_operation_status": "waiting_signature",
        "disbursement_accounts": [],
        "disbursement_options": [
            {
                "annual_cet": 0.172031,
                "cet": 0.0133,
                "contract_fee_amount": -0.4,
                "contract_fees": [
                    {
                        "amount": 0.5,
                        "amount_type": "percentage",
                        "fee_amount": -0.4,
                        "fee_type": "tac"
                    }
                ],
                "disbursed_issue_amount": 918.04,
                "disbursement_date": "2023-12-22",
                "external_contract_fee_amount": 0.0,
                "external_contract_fees": [
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "spread",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    },
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "tac",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    },
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "insurance_premium",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    }
                ],
                "installments": [
                    {
                        "business_due_date": "2024-02-22",
                        "calendar_days": 62,
                        "due_date": "2024-02-22",
                        "due_principal": 917.64,
                        "installment_number": 1,
                        "pre_fixed_amount": 25.2095730147,
                        "principal_amortization_amount": 74.7904269853,
                        "total_amount": 100.0,
                        "workdays": 40
                    },
                    {
                        "business_due_date": "2024-03-22",
                        "calendar_days": 29,
                        "due_date": "2024-03-22",
                        "due_principal": 842.8495730147,
                        "installment_number": 2,
                        "pre_fixed_amount": 10.7524369787,
                        "principal_amortization_amount": 89.2475630213,
                        "total_amount": 100.0,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-04-22",
                        "calendar_days": 31,
                        "due_date": "2024-04-22",
                        "due_principal": 753.6020099934,
                        "installment_number": 3,
                        "pre_fixed_amount": 10.2814172859,
                        "principal_amortization_amount": 89.7185827141,
                        "total_amount": 100.0,
                        "workdays": 20
                    },
                    {
                        "business_due_date": "2024-05-22",
                        "calendar_days": 30,
                        "due_date": "2024-05-22",
                        "due_principal": 663.8834272793,
                        "installment_number": 4,
                        "pre_fixed_amount": 8.7632941742,
                        "principal_amortization_amount": 91.2367058258,
                        "total_amount": 100.0,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-06-24",
                        "calendar_days": 31,
                        "due_date": "2024-06-22",
                        "due_principal": 572.6467214535,
                        "installment_number": 5,
                        "pre_fixed_amount": 7.8126464787,
                        "principal_amortization_amount": 92.1873535213,
                        "total_amount": 100.0,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-07-22",
                        "calendar_days": 30,
                        "due_date": "2024-07-22",
                        "due_principal": 480.4593679322,
                        "installment_number": 6,
                        "pre_fixed_amount": 6.3420966342,
                        "principal_amortization_amount": 93.6579033658,
                        "total_amount": 100.0,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-08-22",
                        "calendar_days": 31,
                        "due_date": "2024-08-22",
                        "due_principal": 386.8014645664,
                        "installment_number": 7,
                        "pre_fixed_amount": 5.2771618926,
                        "principal_amortization_amount": 94.7228381074,
                        "total_amount": 100.0,
                        "workdays": 23
                    },
                    {
                        "business_due_date": "2024-09-23",
                        "calendar_days": 31,
                        "due_date": "2024-09-22",
                        "due_principal": 292.078626459,
                        "installment_number": 8,
                        "pre_fixed_amount": 3.9848593609,
                        "principal_amortization_amount": 96.0151406391,
                        "total_amount": 100.0,
                        "workdays": 21
                    },
                    {
                        "business_due_date": "2024-10-22",
                        "calendar_days": 30,
                        "due_date": "2024-10-22",
                        "due_principal": 196.0634858199,
                        "installment_number": 9,
                        "pre_fixed_amount": 2.5880710578,
                        "principal_amortization_amount": 97.4119289422,
                        "total_amount": 100.0,
                        "workdays": 22
                    },
                    {
                        "business_due_date": "2024-11-22",
                        "calendar_days": 31,
                        "due_date": "2024-11-22",
                        "due_principal": 98.6515568777,
                        "installment_number": 10,
                        "pre_fixed_amount": 1.3459361963,
                        "principal_amortization_amount": 98.6540638037,
                        "total_amount": 100.0,
                        "workdays": 22
                    }
                ],
                "issue_amount": 917.64,
                "number_of_installments": 10,
                "prefixed_interest_rate": {
                    "annual_rate": 0.17042118,
                    "daily_rate": 0.00043722,
                    "interest_base": "calendar_days",
                    "monthly_rate": 0.0132
                },
                "total_iof": 0.0
            }
        ],
        "final_disbursement_amount": -79.83
    }
}
```

## Portabilidade pura

Para simular uma portabilidade sem liberação de Troco, envie apenas `portability_credit_operation` — sem o objeto `refinancing_credit_operation`.

**Requisição**

**request.json**

```json
{
    "borrower": {
        "person_type": "natural"
    },
    "collaterals": [
        {
            "collateral_type": "private_payroll"
        }
    ],
    "portability_credit_operation": {
        "financial": {
            "monthly_interest_rate": 0.0132,
            "installment_face_value": 100,
            "number_of_installments": 10
        }
    },
    "origin_contract": {
        "last_due_balance": 997.87
    }
}
```
 

**Resposta**

**response.json**

```json
{
    "portability_credit_operation": {
        "fine_configuration": {
            "contract_fine_rate": 0.02,
            "interest_base": "calendar_days",
            "monthly_rate": 0.01
        },
        "disbursement_options": [
            {
                "installments": [
                    {
                        "bank_slip_key": null,
                        "digitable_line": null,
                        "business_due_date": "2021-08-09",
                        "calendar_days": 53,
                        "due_date": "2021-08-08",
                        "due_principal": 997.87,
                        "installment_key": "e3bedf31-1e87-4ba4-a36c-d52f7f5c9036",
                        "installment_number": 1,
                        "pre_fixed_amount": 54.84865004983954,
                        "principal_amortization_amount": 306.98134995016045,
                        "total_amount": 361.83,
                        "workdays": 37
                    },
                    {
                        "bank_slip_key": null,
                        "digitable_line": null,
                        "business_due_date": "2021-09-08",
                        "calendar_days": 31,
                        "due_date": "2021-09-08",
                        "due_principal": 690.89,
                        "installment_key": "e8406cdb-844c-4e6d-9620-3635fab9d8d1",
                        "installment_number": 2,
                        "pre_fixed_amount": 21.964874249804833,
                        "principal_amortization_amount": 339.86512575019515,
                        "total_amount": 361.83,
                        "workdays": 22
                    }
                ],
                "prefixed_interest_rate": {
                    "annual_rate": 0.44556431,
                    "daily_rate": 0.00564312,
                    "monthly_rate": 0.0556431,
                    "interest_base": "calendar_days_365"
                },
                "iof_amount": 0,
                "external_contract_fee_amount": 0,
                "external_contract_fees": [],
                "contract_fee_amount": 0,
                "contract_fees": [],
                "number_of_installments": 2,
                "disbursed_issue_amount": 1000,
                "issue_amount": 1000,
                "disbursement_date": "2021-05-31",
                "cet": 1.212,
                "annual_cet": 32.122
            }
        ]
    }
}
```

---

# Manual Consignado Privado - Portabilidade + Refinanciamento

URL: /en/documentation/manual_consignado_privado/portabilidade/visao_geral

Este manual documenta o fluxo de **portabilidade de crédito consignado privado**: a compra de uma dívida consignada originada em outra instituição, com a opção de, ao final, liberar mais crédito ao trabalhador (o **Troco**) por meio de uma operação de refinanciamento.

A proposta de portabilidade é digitada no endpoint `POST /v2/credit_transfer/proposal` e processada junto à **CTC** (Central de Transferência de Crédito, operada pela Núclea). A garantia da operação é a folha de pagamento de funcionários de empresas privadas (`collateral_type: "private_payroll"`), averbada junto ao empregador.

Além do passo a passo de integração, esta página descreve o **fluxo de negócio** por trás da portabilidade — como funciona a comunicação com a instituição credora original através da CTC, os prazos e retornos possíveis, e o que fazer quando o saldo devedor real diverge do saldo estimado no início do fluxo. Use-a como referência para desenhar a esteira de emissão do seu produto.

## Quando usar

Use a portabilidade quando o trabalhador já possui um contrato de consignado privado em **outra instituição** e deseja transferir essa dívida para a sua operação. Dois cenários:

- **Portabilidade pura** — assume a dívida de origem nas novas condições, sem liberar caixa adicional.
- **Portabilidade + Refinanciamento (com Troco)** — assume a dívida de origem e, na mesma proposta, refinancia a operação liberando um valor adicional (Troco) ao trabalhador. A proposta de portabilidade e a de refinanciamento são geradas na **mesma requisição**.

## Composição da operação

Uma proposta de portabilidade é montada com até três blocos, além dos dados cadastrais do tomador:

| Bloco | Campo no payload | Papel |
|---|---|---|
| **Garantia** | `collaterals[].collateral_type: "private_payroll"` | Folha de pagamento de funcionários de empresas privadas (averbação junto ao empregador). `collateral_data` carrega `employer_document_number` e `registration_number`. |
| **Portabilidade** | `portability_credit_operation` | Operação que assume (porta) o contrato de origem. Informa `number_of_installments` e **uma** entre `monthly_interest_rate` ou `installment_face_value`. |
| **Refinanciamento (Troco)** | `refinancing_credit_operation` | Opcional. Quita a operação de portabilidade e libera o Troco na conta do trabalhador. Carrega `disbursement_bank_account`. |
| **Contrato de origem** | `origin_contract` | Identifica a dívida na instituição credora original: `ispb`, `contract_number`, `last_due_balance`. |

## Como funciona a portabilidade na CTC/Núclea

A portabilidade não é uma transação direta entre a QI Tech e o banco onde o trabalhador tem a dívida hoje — toda a comunicação passa por uma câmara centralizadora, e envolve prazos e decisões de terceiros que o parceiro precisa entender para desenhar sua esteira corretamente.

### Os papéis envolvidos

| Papel | Quem é |
|---|---|
| **Instituição Proponente** | A QI Tech, atuando em nome do parceiro — é quem está "comprando" a dívida do trabalhador. |
| **Instituição Credora Original** (o "banco atacado") | A instituição onde o contrato consignado hoje existe. Pode ser qualquer participante da CTC (bancos digitais que atuam fortemente em consignado privado, como o Nubank, são um exemplo comum, mas o fluxo é o mesmo para qualquer credora original). |
| **CTC (Central de Transferência de Crédito)** | Câmara centralizadora operada pela Núclea, regulamentada pela Resolução BCB nº 4.292/2013. Nenhuma comunicação ocorre diretamente entre Proponente e Credora Original — tudo passa pela CTC, que também atribui um Número Único de Portabilidade a cada solicitação. |
| **Empregador** | Mantém a folha de pagamento onde a margem consignável do trabalhador é averbada (reservada) e desaverbada (liberada) a cada operação. |

### 1. Simulação com base nos dados informados pelo próprio trabalhador

No início do fluxo, o parceiro **não tem acesso aos dados oficiais do contrato na instituição credora original** — só o próprio trabalhador pode informá-los. Por isso, tanto a [Simulação](/documentation/manual_consignado_privado/portabilidade/simulacao) quanto a [Digitação da Proposta](/documentation/manual_consignado_privado/portabilidade/proposta) são montadas com um **saldo devedor estimado** (`origin_contract.last_due_balance`) e os dados de identificação do contrato de origem (`ispb`, `contract_number`) fornecidos pelo trabalhador — não com o saldo contábil real, que só existe dentro da credora original.

É nessa simulação que as condições da operação de portabilidade — e, se houver, do Refinanciamento (Troco) — são calculadas e apresentadas ao trabalhador antes de qualquer envio à CTC.

### 2. O envio da solicitação ("ataque") à instituição credora original

A digitação da proposta (`POST /v2/credit_transfer/proposal`) só monta e registra a operação — o "ataque" à instituição credora original **só é enviado depois que o tomador assina a proposta** na [Formalização](/documentation/manual_consignado_privado/portabilidade/formalizacao). É esse envio, pós-assinatura, que a CTC repassa à instituição credora original identificada em `origin_contract`, e é ele que dá início à contagem dos prazos de resposta descritos a seguir. Ver os status `pending_response` / `pending_acceptance` em [Acompanhamento da Operação](/documentation/manual_consignado_privado/portabilidade/maquina_de_status).

### 3. Prazos de resposta da instituição credora original

Os prazos de resposta são definidos pela regulamentação da CTC/Núclea, não por configuração da QI Tech — a credora original tem **até 5 dias úteis**, após a recepção do ataque, tanto para decidir se retém o cliente (recusar a portabilidade) quanto para responder informando o saldo devedor — é o mesmo prazo para as duas decisões, não um sendo subconjunto do outro.

Dentro do dia em que a resposta é dada, há ainda dois horários-limite:

- A instituição credora original deve liberar/informar o saldo devedor **até às 10:00**.
- A QI Tech deve enviar o comando de pagamento (liquidação do saldo devedor) **até às 16:00** do mesmo dia.

Se a credora original não responder dentro do prazo de 5 dias úteis, a solicitação entra em **decurso de prazo** — isso **não cancela automaticamente** a portabilidade, ela continua válida e pode ser respondida a qualquer momento. Se o parceiro (ou o trabalhador) decidir desistir nesse meio tempo, é necessário cancelar explicitamente a proposta. Ver o detalhamento de status em [Acompanhamento da Operação](/documentation/manual_consignado_privado/portabilidade/maquina_de_status).

### 4. Os retornos possíveis da instituição credora original

| Retorno | O que significa |
|---|---|
| **Retenção** (`retained`) | A credora original decide manter o cliente e informa o motivo (ver [Enumeradores](/documentation/manual_consignado_privado/portabilidade/enumeradores#retention_reason_enumerator)). O contrato retido continua disponível para uma nova tentativa de portabilidade no futuro — inclusive pela própria QI Tech, com uma oferta diferente. |
| **Aceite com saldo devedor** (`accepted`) | A credora original não reteve o cliente e informa o saldo devedor contábil **real** do contrato (`final_due_balance`), junto com os dados completos do contrato original (taxa, CET, parcelas, datas). |

### 5. Quando o saldo devedor real diverge do saldo estimado

Este é o ponto mais importante para quem desenha uma esteira de portabilidade: a proposta é montada com uma **estimativa**, mas quem decide o valor real a ser pago é a instituição credora original — e os dois valores raramente coincidem exatamente.

- Se o saldo devedor real superar o estimado em **mais de 15%**, a proposta é **automaticamente rejeitada** pela QI Tech, com o motivo `divergent_due_balance` — evitando prosseguir com uma operação montada sobre uma premissa muito distante da realidade.
- Dentro dessa margem de 15%, a proposta segue para `accepted`, e cabe ao parceiro decidir se quer continuar. Essa decisão é formalizada pela chamada de aceite (`accepted_by_requester` — ver [Acompanhamento da Operação](/documentation/manual_consignado_privado/portabilidade/maquina_de_status)), que **recalcula as condições financeiras da operação (e do Troco, se houver) com base no saldo devedor real**, com duas garantias comerciais:
  - A parcela recalculada nunca pode ficar **maior** que a parcela do contrato de origem.
  - O Troco recalculado não pode **cair mais de 10%** em relação ao Troco originalmente calculado na simulação/digitação — preservando, dentro de uma margem, a oferta feita ao trabalhador no início do fluxo.

Se as novas condições não forem aceitáveis, o parceiro deve cancelar a proposta explicitamente; não é possível retomar uma proposta cancelada ou rejeitada — é sempre necessária uma nova digitação.

### 6. Pagamento do saldo devedor e averbação da margem: dois processos em paralelo

Uma vez aceita, a QI Tech envia o pagamento do saldo devedor à instituição credora original (liquidação) — e, **em paralelo**, inicia a averbação da nova operação de portabilidade na folha do empregador. São dois processos independentes, cada um com seu próprio acompanhamento (status da proposta vs. webhook de averbação): o envio do pagamento **não espera** a confirmação da averbação da margem. Ao desenhar sua esteira, não assuma que "pagamento enviado" já significa "margem garantida" — acompanhe os dois eventos separadamente em [Acompanhamento da Operação](/documentation/manual_consignado_privado/portabilidade/maquina_de_status).

### 7. A liberação da margem pelo banco atacado e a averbação da nova operação

Para que a averbação da nova operação seja aceita, o registro central de consignado privado precisa refletir que a margem do trabalhador — antes reservada pela instituição credora original — já está livre. Isso normalmente é consequência do próprio andamento da portabilidade (quitação do contrato original), mas pode não estar refletido no registro no exato momento em que a QI tenta averbar a nova operação.

Por isso, falhas transitórias na averbação (por exemplo, margem ainda aparecendo como comprometida, ou taxa da nova proposta em conflito com uma proposta ativa do trabalhador) não cancelam a operação de imediato: a QI tenta novamente de forma automática ("teimosinha") até que a averbação seja aceita ou até que um motivo terminal exija o cancelamento manual. Os motivos de falha e o comportamento de retentativa estão detalhados em [Averbação e Desembolso](/documentation/manual_consignado_privado/manual_averbacao_desembolso#fail_reservation_reason); o webhook de confirmação (sucesso ou falha) da averbação da portabilidade está documentado em [Acompanhamento da Operação](/documentation/manual_consignado_privado/portabilidade/maquina_de_status).

### 8. Da portabilidade paga ao início do Refinanciamento (Troco)

A operação de Refinanciamento (Troco), quando existe, só pode ser aceita **depois que a garantia da operação de Portabilidade estiver averbada** — a tentativa de prosseguir com o Troco antes disso é bloqueada. Ao desenhar a esteira, aguarde o webhook de averbação da Portabilidade antes de disparar a aceitação do Refinanciamento. Uma vez aceito, o Troco segue seu próprio ciclo de averbação e desembolso, detalhado em [Acompanhamento da Operação](/documentation/manual_consignado_privado/portabilidade/maquina_de_status).

## Fluxo (passo a passo)

1. **[Consultas prévias](/documentation/manual_consignado_privado/portabilidade/consultas)** — consulta dos vínculos empregatícios e dos dados do trabalhador (margem consignável), com o Termo de Autorização. **Pré-requisito obrigatório** para a averbação.
2. **[Simulação](/documentation/manual_consignado_privado/portabilidade/simulacao)** — simula as condições financeiras e o Troco, a partir do saldo devedor estimado informado pelo trabalhador, antes (ou em vez) de digitar a proposta.
3. **[Digitação da proposta](/documentation/manual_consignado_privado/portabilidade/proposta)** — `POST /v2/credit_transfer/proposal` com a garantia `private_payroll`, a operação de portabilidade e, opcionalmente, a de refinanciamento.
4. **[Formalização](/documentation/manual_consignado_privado/portabilidade/formalizacao)** — assinatura das operações via QI Sign. A QI Tech coleta os documentos e captura a assinatura; o parceiro não envia documentos. É **só após a assinatura** que o "ataque" é enviado à instituição credora original através da CTC.
5. **[Acompanhamento da Operação](/documentation/manual_consignado_privado/portabilidade/maquina_de_status)** — acompanhamento da proposta na CTC (`pending_response → pending_acceptance → accepted → accepted_by_requester → settlement_sent → paid`), incluindo o recálculo por divergência de saldo devedor e a averbação da margem, e da operação de refinanciamento/Troco (`issued → disbursed`).
6. **[Consultas e operações pós-proposta](/documentation/manual_consignado_privado/portabilidade/consultas_pos_proposta)** — lista de participantes da CTC, recuperação da última resposta de averbação, redução de parcelas, fee e recibo de pagamento.
7. **[Mocks e Sandbox](/documentation/manual_consignado_privado/portabilidade/mocks_sandbox)** — simulação de cenários (aprovação, rejeição, saldo) em ambiente de testes.

Referência transversal: **[Enumeradores](/documentation/manual_consignado_privado/portabilidade/enumeradores)**.

## Pré-requisito: consultas do trabalhador

Antes da digitação, é obrigatório realizar uma **consulta de dados válida** do trabalhador (consulta dos vínculos empregatícios + consulta de saldo/margem), assinada com o **Termo de Autorização**. Essas consultas estão documentadas em **[Consultas do Trabalhador](/documentation/manual_consignado_privado/manual_consultas_trabalhador)**; a página [Consultas prévias](/documentation/manual_consignado_privado/portabilidade/consultas) explica como elas se encaixam no fluxo de portabilidade.

## Glossário

| Termo | Significado |
|---|---|
| **CTC** | Central de Transferência de Crédito, operada pela Núclea — câmara que intermedia toda a comunicação da portabilidade entre a Instituição Proponente e a Instituição Credora Original. |
| **Instituição Proponente** | Quem propõe a portabilidade — a QI Tech, atuando em nome do parceiro. |
| **Instituição Credora Original / "banco atacado"** | Instituição onde o contrato consignado hoje existe. |
| **"Ataque"** | Termo de mercado para o envio da solicitação de portabilidade, pela CTC, à instituição credora original. |
| **Saldo devedor estimado** | Valor informado pelo trabalhador na proposta (`origin_contract.last_due_balance`), usado para simular e digitar a operação antes de qualquer confirmação da credora original. |
| **Saldo devedor real** | Valor contábil oficial do contrato de origem, informado pela credora original na resposta de aceite (`final_due_balance`). Pode divergir do saldo estimado — ver [seção 5](#5-quando-o-saldo-devedor-real-diverge-do-saldo-estimado). |
| **Retenção** | Decisão da credora original de não liberar o cliente para a portabilidade, com motivo obrigatório. |
| **Troco** | Valor adicional liberado ao trabalhador quando a portabilidade vem acompanhada de refinanciamento (`refinancing_credit_operation`). |
| **`origin_contract`** | Dados do contrato na instituição credora original (`ispb`, `contract_number`, `last_due_balance`). |
| **Averbação** | Reserva da margem consignável na folha de pagamento do empregador, garantindo o desconto das parcelas. |
| **"Teimosinha"** | Retentativa automática de averbação feita pela QI Tech quando a tentativa falha por um motivo não terminal (ex.: margem ainda não liberada pela credora original). |
| **`private_payroll`** | `collateral_type` da garantia de folha de pagamento de funcionários de empresas privadas; `collateral_data` = `employer_document_number` + `registration_number`. |
| **`proposal_type`** | Tipo da proposta; para Consignado Privado, `"private_company"`. |

---

# FGTS Authorization Consultation Manual

URL: /en/documentation/manual_consulta_de_autorizacao_FGTS/

:::info See also
- [FGTS Origination](/documentation/manual_FGTS/manual_fgts)
:::

## 1. Beneficiary Authorization Consultation

The authorization consultation allows you to verify if the beneficiary has granted authorization for endorsement and balance inquiry in FGTS, linked to a specific CPF, to perform operations with Caixa Econômica Federal.

### Consultation Characteristics

- **Synchronous request**: Returns result immediately
- **Business rule**: The consultation succeeds only for the last partner with whom the beneficiary has an active relationship
- **Exception**: If the beneficiary has not performed operations in the last 90 days, the consultation will return data for all partners

### Requirements

To perform the consultation, the beneficiary's **CPF** is required.

### Endpoint

**GET**
`/fgts_issuer_auth_manager/issuer/{CPF}`

**Path Params**

| Field           | Type   | Description                   | Required | Format                       |
|-----------------|--------|-------------------------------|----------|------------------------------|
| document_number | string | Beneficiary's CPF number      | Yes      | 11 numeric digits, no punctuation |

### Success Response

STATUS
**200** (OK)

**Response Examples**

**Authorized:**
```json
{
    "authorization_limit_date": "2026-01-01",
    "last_checked_at": "2025-10-01",
    "status": "authorized"
}
```

**Not Authorized:**
```json
{
    "authorization_limit_date": null,
    "last_checked_at": "2025-10-01",
    "status": "unauthorized"
}
```

### Error Response

STATUS
**404** (Not Found)

Returned when the CPF is not found in the database.

## Status Reference

| Status         | Description                        |
|----------------|------------------------------------|
| `authorized`   | Beneficiary has authorization      |
| `unauthorized` | Beneficiary does not have authorization |

## Response Fields

| Field                      | Type   | Description                                  |
|----------------------------|--------|----------------------------------------------|
| `authorization_limit_date` | string | Authorization expiration date (format: YYYY-MM-DD) |
| `last_checked_at`          | string | Date of last authorization update            |
| `status`                   | string | Current authorization status                 |

---

# Consulta - Emissão Crédito Clean

URL: /en/documentation/manual_credito_clean/emissao/consulta

## Resumo

Você pode consultar a dívida a qualquer momento para obter informações ou acompanhar o status atual da operação.

## Consultar Operação de Crédito

Existem duas formas de consultar uma operação:
- Por `credit_operation_key` (DEBT-KEY)
- Por `requester_identifier_key` (chave identificadora enviada na emissão)

### Por Credit Operation Key

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

Testar no Playground

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `credit_operation_key`* | string | Chave da operação de crédito (DEBT-KEY) | UUID |

### Por Requester Identifier Key

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

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `requester_identifier_key`* | string | Chave identificadora enviada na emissão | UUID |

### Response

STATUS 200

Response Body

```json
{
    "credit_operation_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c",
    "issue_amount": 1007.62,
    "origin_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c",
    "total_iof": 7.62,
    "assigned_at": null,
    "disbursement_start_date": "2026-04-07",
    "disbursement_end_date": "2026-04-07",
    "issue_date": "2026-04-07",
    "requester_identifier_key": "d1905ef5-19df-4183-bf0e-802b8229933c",
    "installments": [
        {
            "business_due_date": "2026-05-07",
            "due_date": "2026-05-07",
            "calendar_days": 30,
            "due_interest": 0,
            "due_principal": 1007.62,
            "fine_amount": 0,
            "has_interest": true,
            "post_fixed_amount": 0,
            "pre_fixed_amount": 52.4,
            "principal_amortization_amount": 491.49,
            "tax_amount": 1.21,
            "total_amount": 543.89,
            "workdays": 20,
            "accrual_reference_date": null,
            "advanced_paid_amount": 0,
            "bank_slip_key": null,
            "digitable_line": null,
            "installment_key": "1dea396f-beb1-4df3-9822-35800b4c095a",
            "installment_status": "opened",
            "installment_type": "principal",
            "original_due_principal": 1007.62,
            "original_pre_fixed_amount": 52.4,
            "original_principal_amortization_amount": 491.49,
            "paid_amount": 0,
            "original_total_amount": 543.89,
            "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": "2026-04-07T23:59:27",
            "principal_amortization_payment_amount": 0,
            "prefixed_interest_payment_amount": 0
        },
        {
            "business_due_date": "2026-06-08",
            "due_date": "2026-06-07",
            "calendar_days": 31,
            "due_interest": 0,
            "due_principal": 516.1296159,
            "fine_amount": 0,
            "has_interest": true,
            "post_fixed_amount": 0,
            "pre_fixed_amount": 27.76,
            "principal_amortization_amount": 516.13,
            "tax_amount": 2.58,
            "total_amount": 543.89,
            "workdays": 20,
            "accrual_reference_date": null,
            "advanced_paid_amount": 0,
            "bank_slip_key": null,
            "digitable_line": null,
            "installment_key": "370e73d1-55d8-431e-9b22-d08fb8297999",
            "installment_status": "opened",
            "installment_type": "principal",
            "original_due_principal": 516.13,
            "original_pre_fixed_amount": 27.76,
            "original_principal_amortization_amount": 516.13,
            "paid_amount": 0,
            "original_total_amount": 543.89,
            "qr_code_key": null,
            "qr_code_url": null,
            "renegotiation_proposal_key": null,
            "total_accrual_amount": 0,
            "total_paid_amount": 0,
            "installment_number": 2,
            "paid_at": null,
            "updated_at": "2026-04-07T23:59:27",
            "principal_amortization_payment_amount": 0,
            "prefixed_interest_payment_amount": 0
        }
    ],
    "first_due_date": "2026-05-07",
    "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
    "contract_number": "DWF1761222116",
    "credit_operation_status_enumerator": "opened",
    "operation_type_enumerator": "structured_operation",
    "disbursement_date": "2026-04-07",
    "issuer_name": "Dante Ferrarini",
    "issuer_document_number": "31057466093",
    "external_contract_fees": [
        {
            "amount_type": "absolute",
            "fee_amount": 0,
            "tax_amount": 0,
            "irrf_amount": 0,
            "amount": 0,
            "pis_amount": 0,
            "amount_released": 0,
            "fee_type": "tac",
            "cofins_amount": 0,
            "csll_amount": 0,
            "description": null,
            "net_fee_amount": 0,
            "rebate_account": null
        }
    ],
    "cet": 5.82,
    "annual_cet": 97.05,
    "final_disbursement_amount": 1000,
    "number_of_installments": 2,
    "disbursement_issue_amount": 1000,
    "prefixed_interest_rate": {
        "annual_rate": 0.8373372409,
        "daily_rate": 0.0016911989,
        "interest_base": {
            "enumerator": "calendar_days",
            "year_days": 360
        },
        "monthly_rate": 0.052
    },
    "fine_configuration": {
        "contract_fine_rate": 0.02,
        "fine_delay_rate": {
            "annual_rate": 0.12682503,
            "daily_rate": 0.00033173,
            "interest_base": {
                "enumerator": "calendar_days",
                "year_days": 360
            },
            "monthly_rate": 0.01
        }
    },
    "attached_documents": [
        {
            "document_key": "d6705fc4-80e0-4c8e-9aff-f3875024e6a4",
            "document_url": "https://storage.googleapis.com/sandbox-doc-api/documents/...",
            "signature_url": "https://storage.googleapis.com/sandbox-doc-api/documents/..._signed.pdf",
            "document_type": "ccb_pre_price_days",
            "signature_required": true,
            "signed": true
        }
    ],
    "related_parties": [
        {
            "related_party_key": "24fac77e-7782-4f72-b31a-daee288e34ed",
            "role_type": "issuer",
            "person_type": "natural",
            "name": "Dante Ferrarini",
            "email": "",
            "individual_document_number": "31057466093"
        }
    ],
    "base_iof": 3.79,
    "additional_iof": 3.83,
    "assignment_amount": 1010.64,
    "created_at": "2026-04-07T23:59:22Z",
    "total_prefixed_amount": 80.16
}
```

STATUS 400

Response Body

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

---

## Consultar Eventos da Operação

Você também pode consultar o histórico de eventos (log de status) da operação:

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

Testar no Playground

### Path Params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `credit_operation_key`* | string | Chave da operação de crédito | UUID |

### Response

STATUS 200

Response Body

```json
{
    "data": [
        {
            "status": "waiting_signature",
            "reason": null,
            "cancel_reason": null,
            "event_date": "2026-03-13T17:19:59Z"
        },
        {
            "status": "issued",
            "reason": null,
            "cancel_reason": null,
            "event_date": "2026-03-13T17:19:59Z"
        },
        {
            "status": "waiting_disbursement",
            "reason": null,
            "cancel_reason": null,
            "event_date": "2026-03-13T17:19:59Z"
        },
        {
            "status": "opened",
            "reason": null,
            "cancel_reason": null,
            "event_date": "2026-03-13T17:19:59Z"
        }
    ],
    "pagination": {
        "current_page": 1,
        "next_page": null,
        "rows_per_page": 10
    }
}
```

### Enumeradores de Status da Operação

| Status | Descrição |
|---|---|
| `waiting_signature` | Aguardando assinatura do contrato |
| `issued` | Operação emitida |
| `waiting_disbursement` | Aguardando desembolso |
| `opened` | Operação aberta (desembolso realizado) |
| `canceled` | Operação cancelada |
| `settled` | Operação liquidada (todas as parcelas pagas) |

---

# Consulta de Cessão

URL: /en/documentation/manual_credito_clean/emissao/consulta_cessao

## Resumo

A cessão é o processo pelo qual as operações de crédito (itens) são transferidas para um cessionário. Você pode acompanhar e consultar as cessões a qualquer momento para obter informações ou verificar o status atual do processo.

## Webhook de Confirmação de Cessão

Este webhook é disparado para notificar o cliente de que o processo de cessão foi iniciado. Ele fornece os metadados essenciais necessários para acompanhar a cessão.

Response Body

```json
{
    "key": "19e34186-847b-4dd7-9fc2-d14e28bc2f10",
    "data": {
        "status": "settled",
        "total_amount": 1917.04,
        "assignment_key": "19e34186-847b-4dd7-9fc2-d14e28bc2f10",
        "reference_date": "2026-04-10",
        "number_of_items": 8,
        "term_of_assignment_url": null
    },
    "webhook_type": "assignment.status_change",
    "event_datetime": "2026-04-10T22:37:52"
}
```

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `assignment_key` | string | Identificador único da operação de cessão | 36 |
| `term_of_assignment_url` | string | URL para download do Termo de Cessão (PDF) | 2048 |
| `number_of_items` | integer | Número total de operações de crédito (itens) incluídas nesta cessão | 5 |
| `total_amount` | float | Soma do valor presente de todos os itens da cessão | 15,2 |
| `reference_date` | string | Data base utilizada para os cálculos da cessão (YYYY-MM-DD) | 10 |

---

## Consultar uma Cessão Específica

Para consultar uma cessão específica, o cliente pode realizar uma requisição GET no endpoint utilizando a chave identificadora da cessão (`assignment_key`).

ENDPOINT /v2/assignment/ ASSIGNMENT-KEY
MÉTODO GET

Testar no Playground

### Path Params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `assignment_key`* | string | Chave identificadora única da cessão | UUID |

### Response

STATUS 200

Response Body

```json
{
    "assignment_key": "77997168-5d61-430f-b5ae-08eb3d7b8c0e",
    "creation_datetime": "2023-10-01T12:00:00",
    "reference_date": "2023-10-01",
    "total_amount": 120000,
    "number_of_items": 5,
    "term_of_assignment_url": "https://example.com/assignment.pdf",
    "status": "settled",
    "signable_term_url": "https://example.com/signable_term.pdf"
}
```

---

## Consultar os Itens (Contratos) de uma Cessão

Para consultar os contratos contidos em uma cessão, utilize uma requisição GET no endpoint com a mesma `assignment_key`.

ENDPOINT /v2/assignment/ ASSIGNMENT-KEY /assignment_items?page=1&page_size=100
MÉTODO GET

Testar no Playground

### Path Params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `assignment_key`* | string | Chave identificadora única da cessão | UUID |

### Query Params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `page` | string | Número da página | - |
| `page_size` | string | Tamanho da página, limitado a 100 | - |

### Response

A resposta é uma lista paginada contendo as informações de cada contrato da cessão (status 200):

STATUS 200

Response Body

```json
{
    "pagination": {
        "page": 1,
        "page_size": 10
    },
    "data": [
        {
            "assignment_date": "2026-04-10",
            "assignment_item_key": "uuid",
            "contract_number": "TIK000012312",
            "control_number": "TIK000012312",
            "requester_identifier_key": "uuid",
            "credit_operation_key": "string",
            "disbursed_amount": 80.0,
            "disbursement_date": "2026-04-10",
            "endorsement_url": "url",
            "issue_amount": 180.00,
            "issuer_document_number": "string",
            "issuer_name": "string",
            "number_of_installments": 10,
            "present_amount": 180.0,
            "contract_present_amount": 180.0,
            "purchaser_document_number": "string",
            "status": "settled",
            "rejected_reasons": [],
            "assignment_items": [
                {
                    "installment_key": "uuid",
                    "present_amount": 100,
                    "due_date": "2026-05-10",
                    "your_number": "TIK000012312001"
                },
                {
                    "installment_key": "uuid",
                    "present_amount": 80,
                    "due_date": "2026-06-10",
                    "your_number": "TIK000012312002"
                }
            ]
        }
    ]
}
```

---

## Consultar Lotes de Cessão por Data

Consulte os lotes de cessão pela data de referência (`reference_date`).

ENDPOINT /v2/assignment/assignments?reference_date=2026-05-15
MÉTODO GET

Testar no Playground

### Query Params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `reference_date` | string | Data da tentativa de cessão (YYYY-MM-DD) | 10 |

### Response

STATUS 200

Response Body

```json
{
    "data": [
        {
            "assignment_key": "439b1257-82ac-4741-a416-a4428a9a7327",
            "number_of_items": 10000,
            "reference_date": "2025-01-01",
            "signable_term_url": "https://example.com/endorsement.pdf",
            "status": "settled",
            "term_of_assignment_url": "signed_url",
            "total_amount": 100.00
        },
        {
            "assignment_key": "439b1257-82ac-4741-a416-a4428a9a7327",
            "number_of_items": 10000,
            "reference_date": "2025-01-01",
            "signable_term_url": "https://example.com/endorsement.pdf",
            "status": "settled",
            "term_of_assignment_url": "signed_url",
            "total_amount": 100.00
        },
        {
            "assignment_key": "439b1257-82ac-4741-a416-a4428a9a7327",
            "number_of_items": 10000,
            "reference_date": "2025-01-01",
            "signable_term_url": "https://example.com/endorsement.pdf",
            "status": "canceled",
            "term_of_assignment_url": "signed_url",
            "total_amount": 100.00
        }
    ]
}
```

---

# Emissão Crédito Clean

URL: /en/documentation/manual_credito_clean/emissao/

## Resumo

O Crédito Clean oferece **dois fluxos de emissão**:

| Fluxo | Endpoints | Quando usar |
|---|---|---|
| **Emissão com Assinatura Imediata** | `POST /signed_debt` | A assinatura do tomador é coletada pelo parceiro e enviada junto com a emissão em uma única chamada via opt-in |
| **Emissão com Assinatura Posterior** | `POST /debt` → `POST /debt/{debt_key}/signed` | A dívida é criada primeiro e a assinatura é enviada em uma chamada separada |

---

# Emissão com Assinatura Posterior

URL: /en/documentation/manual_credito_clean/emissao/emissao_dois_passos

Neste fluxo, a dívida é criada em uma primeira chamada e a assinatura do tomador é enviada em uma chamada separada. O sistema gera o contrato e aguarda a assinatura antes de processar o desembolso.

---

## Passo 1 — Criação da Dívida (`POST /debt`)

### Request

ENDPOINT /debt
MÉTODO POST

Request Body

**disbursed_amount**

```json
{
    "borrower": {
        "name": "Dante Ferrarini",
        "email": "dante@email.com",
        "phone": {
            "number": "185633631",
            "area_code": "15",
            "country_code": "055"
        },
        "is_pep": false,
        "address": {
            "city": "São Paulo",
            "state": "SP",
            "number": "1000",
            "street": "Rua Gilberto Sabino",
            "complement": "",
            "postal_code": "05425020",
            "neighborhood": "Pinheiros"
        },
        "role_type": "issuer",
        "birth_date": "1993-09-10",
        "person_type": "natural",
        "individual_document_number": "31057466093"
    },
    "financial": {
        "interest_type": "pre_price_days",
        "disbursement_date": "2026-04-07",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "disbursed_amount": 1000,
        "monthly_interest_rate": 0.052,
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "number_of_installments": 2,
        "principal_grace_period": 0
    },
    "disbursement_bank_account": {
        "name": "Dante Ferrarini",
        "document_number": "31057466093",
        "bank_code": "329",
        "branch_number": "0001",
        "account_number": "7617846",
        "account_digit": "5",
        "account_type": "checking_account"
    },
    "purchaser_document_number": "32402502000135"
}
```

**installments**

```json
{
    "borrower": {
        "name": "Dante Ferrarini",
        "email": "dante@email.com",
        "phone": {
            "number": "185633631",
            "area_code": "15",
            "country_code": "055"
        },
        "is_pep": false,
        "address": {
            "city": "São Paulo",
            "state": "SP",
            "number": "1000",
            "street": "Rua Gilberto Sabino",
            "complement": "",
            "postal_code": "05425020",
            "neighborhood": "Pinheiros"
        },
        "role_type": "issuer",
        "birth_date": "1993-09-10",
        "person_type": "natural",
        "individual_document_number": "31057466093"
    },
    "financial": {
        "interest_type": "pre_price_days",
        "disbursement_date": "2026-04-07",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "monthly_interest_rate": 0.052,
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "principal_grace_period": 0,
        "desired_installments": [
            {
                "due_date": "2026-05-07",
                "total_amount": 543.89
            },
            {
                "due_date": "2026-06-07",
                "total_amount": 543.89
            }
        ]
    },
    "disbursement_bank_account": {
        "name": "Dante Ferrarini",
        "document_number": "31057466093",
        "bank_code": "329",
        "branch_number": "0001",
        "account_number": "7617846",
        "account_digit": "5",
        "account_type": "checking_account"
    },
    "purchaser_document_number": "32402502000135"
}
```

**due_dates**

```json
{
    "borrower": {
        "name": "Dante Ferrarini",
        "email": "dante@email.com",
        "phone": {
            "number": "185633631",
            "area_code": "15",
            "country_code": "055"
        },
        "is_pep": false,
        "address": {
            "city": "São Paulo",
            "state": "SP",
            "number": "1000",
            "street": "Rua Gilberto Sabino",
            "complement": "",
            "postal_code": "05425020",
            "neighborhood": "Pinheiros"
        },
        "role_type": "issuer",
        "birth_date": "1993-09-10",
        "person_type": "natural",
        "individual_document_number": "31057466093"
    },
    "financial": {
        "interest_type": "pre_price_days",
        "disbursement_date": "2026-04-07",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "disbursed_amount": 1000,
        "monthly_interest_rate": 0.052,
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "principal_grace_period": 0,
        "due_dates": [
            "2026-05-07",
            "2026-06-07"
        ]
    },
    "disbursement_bank_account": {
        "name": "Dante Ferrarini",
        "document_number": "31057466093",
        "bank_code": "329",
        "branch_number": "0001",
        "account_number": "7617846",
        "account_digit": "5",
        "account_type": "checking_account"
    },
    "purchaser_document_number": "32402502000135"
}
```

### Body Params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| **borrower*** | object | Objeto do tomador | **[Objeto Borrower](#objeto-borrower)** |
| **financial*** | object | Detalhes financeiros da operação | **[Objeto Financial](#objeto-financial)** |
| **disbursement_bank_account*** | object | Dados da conta bancária do tomador para recebimento do desembolso | **[Objeto Disbursement Bank Account](#objeto-disbursement-bank-account)** |
| **purchaser_document_number*** | string | CNPJ do cessionário | 14 |

### Objeto Borrower

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| name* | string | Nome completo do tomador | 100 |
| email | string | Endereço de e-mail do tomador | 254 |
| phone | object | Dados de telefone do tomador | **[Objeto Phone](#objeto-phone)** |
| is_pep* | boolean | Indicador de Pessoa Politicamente Exposta | 5 |
| address* | object | Endereço residencial do tomador | **[Objeto Address](#objeto-address)** |
| role_type | string | Papel do tomador na operação (ex: "issuer") | 10 |
| birth_date* | date | Data de nascimento do tomador (Formato: "YYYY-MM-DD") | 10 |
| person_type* | string | Classificação da pessoa (natural ou legal) | 7 |
| individual_document_number* | string | CPF do tomador - somente números | 11 |

### Objeto Address

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| city* | string | Nome da cidade | 100 |
| state* | string | Sigla do estado (duas letras maiúsculas) | 2 |
| number | string | Número do logradouro | 10 |
| street* | string | Nome do logradouro | 100 |
| complement | string | Complemento do endereço (texto livre) | 100 |
| postal_code* | string | CEP - somente números | 8 |
| neighborhood* | string | Nome do bairro | 100 |

### Objeto Phone

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| number* | string | Número do telefone | 9 |
| area_code* | string | Código de área (DDD) | 2 |
| country_code* | string | Código internacional (ex: "055") | 3 |

### Objeto Financial

:::info Formas de definir o valor da operação
É possível definir o valor da operação de três formas mutuamente exclusivas:
- **`disbursed_amount` + `monthly_interest_rate` + `number_of_installments`**: informe o valor a ser desembolsado, a taxa de juros e o número de parcelas — o sistema calcula o valor de cada parcela.
- **`desired_installments`**: informe um array com a data e o valor total de cada parcela individualmente — o sistema calcula o valor de desembolso.
- **`disbursed_amount` + `due_dates`**: informe o valor de desembolso e um array com as datas de vencimento — o sistema calcula os valores das parcelas para a agenda irregular informada.
:::

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| interest_type* | string | Método de amortização | 20 |
| disbursement_date* | string | Data de desembolso | 10 |
| fine_configuration* | object | Configuração de multa e mora | **[Objeto Fine Configuration](#objeto-fine-configuration)** |
| monthly_interest_rate* | float | Taxa de juros mensal | 10,6 |
| disbursed_amount | float | Valor a ser desembolsado. Obrigatório se `desired_installments` não for informado | 15,2 |
| number_of_installments | integer | Número de parcelas. Obrigatório se `disbursed_amount` for informado sem `due_dates` | 3 |
| desired_installments | array | Array de parcelas com data e valor definidos individualmente. Obrigatório se `disbursed_amount` não for informado | **[Objeto Desired Installments](#objeto-desired-installments)** |
| due_dates | array | Lista de datas de vencimento (YYYY-MM-DD). Utilizado com `disbursed_amount` para agenda de parcelas irregular | - |
| credit_operation_type* | string | Tipo da operação de crédito (ex: "ccb") | 10 |
| interest_grace_period | integer | Período de carência de juros (em meses) | 3 |
| principal_grace_period | integer | Período de carência do principal (em meses) | 3 |

### Objeto Desired Installments

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| due_date* | string | Data de vencimento da parcela (YYYY-MM-DD) | 10 |
| total_amount* | float | Valor total da parcela | 15,2 |

### Objeto Fine Configuration

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| monthly_rate* | float | Taxa de mora mensal | 10,6 |
| interest_base* | string | Base de cálculo da mora (ex: "calendar_days") | 20 |
| contract_fine_rate* | float | Taxa de multa contratual | 10,6 |

### Objeto Disbursement Bank Account

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| name | string | Nome do titular da conta | 50 |
| document_number | string | CPF do titular da conta | 11 |
| bank_code* | string | Código COMPE da instituição financeira | 3 |
| branch_number* | string | Número da agência (sem dígito verificador) | 4 |
| account_number* | string | Número da conta (sem dígito verificador) | 10 |
| account_digit* | string | Dígito verificador da conta (usar zero no lugar de letras) | 1 |
| account_type | enum | Tipo da conta (`checking_account`, `saving_account`, `payment_account`, etc.) | - |

### Response

STATUS 200

A resposta retorna o plano de pagamento e a **DEBT-KEY**, com status `waiting_signature`. O desembolso não é realizado até que a assinatura seja enviada no Passo 2.

Response Body

```json
{
    "webhook_type": "debt",
    "key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
    "status": "waiting_signature",
    "event_datetime": "2026-04-07 22:46:10",
    "data": {
        "borrower": {
            "name": "Dante Ferrarini",
            "document_number": "31057466093",
            "related_party_key": "d5cbcada-42e7-4d5b-84fc-3c2dc8038411"
        },
        "contract": {
            "number": "0000192840/DWF",
            "urls": [
                "https://storage.googleapis.com/sandbox-doc-api/documents/b2d974f9-c710-42e3-8ea4-69cc31561c38/CCB-0000192840-20260407.pdf"
            ],
            "signers": [
                {
                    "signer_name": "Dante Ferrarini",
                    "signer_document_number": "31057466093",
                    "signer_role": "issuer",
                    "signer_email": "dante@email.com",
                    "signer_external_key": null,
                    "signature_url": null
                }
            ]
        },
        "installments": [...],
        "total_pre_fixed_amount": 80.16
    }
}
```

:::caution Atenção
Salve a **DEBT-KEY** retornada — ela é necessária para enviar a assinatura no Passo 2.
:::

---

## Passo 2 — Envio da Assinatura (`POST /debt/{DEBT-KEY}/signed`)

### Request

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

Request Body

```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": "Dante Ferrarini",
                "email": "dante@email.com",
                "phone": {
                    "country_code": "055",
                    "area_code": "15",
                    "number": "185633631"
                },
                "document_number": "31057466093"
            },
            "authentication_type": "opt-in"
        }
    ]
}
```

### Path Params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `debt_key`* | string | Chave da dívida retornada no Passo 1 | UUID |

### Body Params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `type`* | string | Tipo de assinatura. Valor: `data_signature` | - |
| `signatures`* | array | Lista de objetos de comprovação de assinatura | **[Objeto signatures](#objeto-signatures)** |

### Objeto signatures

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `signed_object` | object | Documento que está sendo assinado | **[Objeto signed_object](#objeto-signed_object)** |
| `authenticity` | object | Dados de autenticação da assinatura | **[Objeto authenticity](#objeto-authenticity)** |
| `signer` | object | Dados do assinante | **[Objeto signer](#objeto-signer)** |
| `authentication_type`* | string | Tipo de assinatura. Valor: `opt-in` | - |

### Objeto signed_object

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `raw_text`* | string | Texto corrido com os dados do contrato que será assinado | - |

### Objeto authenticity

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `timestamp`* | string | Data e hora da assinatura | - |
| `ip_address`* | string | Endereço IP onde o aceite foi coletado | - |
| `session_id`* | string | ID de sessão do cliente no momento da assinatura — deve ser armazenado por no mínimo 5 anos | - |
| `geolocation` | object | Geolocalização opcional | - |

### Objeto signer

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `name`* | string | Nome do assinante | - |
| `email`* | string | E-mail do assinante | - |
| `phone` | object | Telefone do assinante | **[Objeto Phone](#objeto-phone)** |
| `document_number`* | string | CPF do assinante | - |

### Response

STATUS 200

Response Body

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

---

# Issuance with Immediate Signature (/signed_debt)

URL: /en/documentation/manual_credito_clean/emissao/emissao_signed_debt

This endpoint issues the debt and processes the contract signature via opt-in in a single call. Disbursement occurs on the date informed in the `disbursement_date` field, which may differ from the issuance date. No pre-registration is required; just provide the borrower's data within the issuance request.

## Request

ENDPOINT /signed_debt
METHOD POST

Try it in the Playground

Request Body

**disbursed_amount**

```json
{
    "borrower": {
        "name": "Dante Ferrarini",
        "email": "",
        "phone": {
            "number": "185633631",
            "area_code": "15",
            "country_code": "086"
        },
        "is_pep": false,
        "address": {
            "city": "São Paulo",
            "state": "SP",
            "number": "",
            "street": "Rua Gilberto Sabino",
            "postal_code": "05425020",
            "neighborhood": "Pinheiros",
            "complement": ""
        },
        "role_type": "issuer",
        "birth_date": "1993-09-10",
        "person_type": "natural",
        "attached_documents_list": [
            {
                "selfie": "250e7e95-57c8-40bd-a0cd-0be8eb172916"
            }
        ],
        "individual_document_number": "31057466093"
    },
    "financial": {
        "interest_type": "pre_price_days",
        "disbursement_date": "2026-04-07",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "disbursed_amount": 1000,
        "monthly_interest_rate": 0.052,
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "number_of_installments": 2,
        "principal_grace_period": 0
    },
    "simplified": true,
    "additional_data": {
        "contract": {
            "contract_number": "DWF1761222116",
            "signatures": [
                {
                    "signer": {
                        "name": "Dante Ferrarini",
                        "email": "",
                        "phone": {
                            "number": "185633631",
                            "area_code": "15",
                            "country_code": "086"
                        },
                        "document_number": "31057466093"
                    },
                    "signature": {
                        "timestamp": "28-01-2026 06:36:35",
                        "ip_address": "192.168.1.1",
                        "signature_file": {
                            "file_url": "https://qitech.com.br/signature.pdf",
                            "file_type": "pdf"
                        }
                    }
                }
            ]
        }
    },
    "requester_identifier_key": "d1905ef5-19df-4183-bf0e-802b8229933c",
    "purchaser_document_number": "32402502000135",
    "disbursement_bank_accounts": [
        {
            "name": "Dante Ferrarini",
            "ispb_number": "32402502",
            "account_digit": "5",
            "branch_number": "0001",
            "account_number": "7617846",
            "document_number": "31057466093",
            "percentage_receivable": 100
        }
    ]
}
```

**installments**

```json
{
    "borrower": {
        "name": "Dante Ferrarini",
        "email": "",
        "phone": {
            "number": "185633631",
            "area_code": "15",
            "country_code": "086"
        },
        "is_pep": false,
        "address": {
            "city": "São Paulo",
            "state": "SP",
            "number": "",
            "street": "Rua Gilberto Sabino",
            "postal_code": "05425020",
            "neighborhood": "Pinheiros",
            "complement": ""
        },
        "role_type": "issuer",
        "birth_date": "1993-09-10",
        "person_type": "natural",
        "attached_documents_list": [
            {
                "selfie": "250e7e95-57c8-40bd-a0cd-0be8eb172916"
            }
        ],
        "individual_document_number": "31057466093"
    },
    "financial": {
        "interest_type": "pre_price_days",
        "disbursement_date": "2026-04-07",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "monthly_interest_rate": 0.052,
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "principal_grace_period": 0,
        "desired_installments": [
            {
                "due_date": "2026-05-07",
                "total_amount": 543.89
            },
            {
                "due_date": "2026-06-07",
                "total_amount": 543.89
            }
        ]
    },
    "simplified": true,
    "additional_data": {
        "contract": {
            "contract_number": "DWF1761222116",
            "signatures": [
                {
                    "signer": {
                        "name": "Dante Ferrarini",
                        "email": "",
                        "phone": {
                            "number": "185633631",
                            "area_code": "15",
                            "country_code": "086"
                        },
                        "document_number": "31057466093"
                    },
                    "signature": {
                        "timestamp": "28-01-2026 06:36:35",
                        "ip_address": "192.168.1.1",
                        "signature_file": {
                            "file_url": "https://qitech.com.br/signature.pdf",
                            "file_type": "pdf"
                        }
                    }
                }
            ]
        }
    },
    "requester_identifier_key": "d1905ef5-19df-4183-bf0e-802b8229933c",
    "purchaser_document_number": "32402502000135",
    "disbursement_bank_accounts": [
        {
            "name": "Dante Ferrarini",
            "ispb_number": "32402502",
            "account_digit": "5",
            "branch_number": "0001",
            "account_number": "7617846",
            "document_number": "31057466093",
            "percentage_receivable": 100
        }
    ]
}
```

**due_dates**

```json
{
    "borrower": {
        "name": "Dante Ferrarini",
        "email": "",
        "phone": {
            "number": "185633631",
            "area_code": "15",
            "country_code": "086"
        },
        "is_pep": false,
        "address": {
            "city": "São Paulo",
            "state": "SP",
            "number": "",
            "street": "Rua Gilberto Sabino",
            "postal_code": "05425020",
            "neighborhood": "Pinheiros",
            "complement": ""
        },
        "role_type": "issuer",
        "birth_date": "1993-09-10",
        "person_type": "natural",
        "attached_documents_list": [
            {
                "selfie": "250e7e95-57c8-40bd-a0cd-0be8eb172916"
            }
        ],
        "individual_document_number": "31057466093"
    },
    "financial": {
        "interest_type": "pre_price_days",
        "disbursement_date": "2026-04-07",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "disbursed_amount": 1000,
        "monthly_interest_rate": 0.052,
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "principal_grace_period": 0,
        "due_dates": [
            "2026-05-07",
            "2026-06-07"
        ]
    },
    "simplified": true,
    "additional_data": {
        "contract": {
            "contract_number": "DWF1761222116",
            "signatures": [
                {
                    "signer": {
                        "name": "Dante Ferrarini",
                        "email": "",
                        "phone": {
                            "number": "185633631",
                            "area_code": "15",
                            "country_code": "086"
                        },
                        "document_number": "31057466093"
                    },
                    "signature": {
                        "timestamp": "28-01-2026 06:36:35",
                        "ip_address": "192.168.1.1",
                        "signature_file": {
                            "file_url": "https://qitech.com.br/signature.pdf",
                            "file_type": "pdf"
                        }
                    }
                }
            ]
        }
    },
    "requester_identifier_key": "d1905ef5-19df-4183-bf0e-802b8229933c",
    "purchaser_document_number": "32402502000135",
    "disbursement_bank_accounts": [
        {
            "name": "Dante Ferrarini",
            "ispb_number": "32402502",
            "account_digit": "5",
            "branch_number": "0001",
            "account_number": "7617846",
            "document_number": "31057466093",
            "percentage_receivable": 100
        }
    ]
}
```

### Request Body Details

| Field | Type | Description | Length |
|---|---|---|---|
| **borrower*** | object | Borrower object - The debtor of the credit operation | **[Borrower Object](#borrower-object)** |
| **financial*** | object | Contains all financial details and calculation parameters of the operation | **[Financial Object](#financial-object)** |
| **simplified** | boolean | If true, uses the simplified issuance flow | - |
| **additional_data*** | object | Additional contract data, including signatures | **[Additional Data Object](#additional-data-object)** |
| **requester_identifier_key** | string | Requester identifier key | UUID |
| **purchaser_document_number*** | string | CNPJ of the assignee – The purchaser of the credit operation (FIDC) | 14 |
| **disbursement_bank_accounts*** | array | Borrower's bank account data for receiving the disbursement | **[Disbursement Bank Account Object](#disbursement-bank-account-object)** |

### Borrower Object

| Field | Type | Description | Length |
|---|---|---|---|
| name* | string | Borrower's full name | 100 |
| email | string | Borrower's email address | 254 |
| phone | object | Borrower's phone data | **[Phone Object](#phone-object)** |
| is_pep* | boolean | Politically Exposed Person indicator | 5 |
| address* | object | Borrower's residential address | **[Address Object](#address-object)** |
| role_type | string | Borrower's role in the operation (e.g., "issuer") | 10 |
| birth_date* | date | Borrower's date of birth (Format: "YYYY-MM-DD") | 10 |
| person_type* | string | Person classification (natural or legal) | 7 |
| attached_documents_list | array | List of attached documents (e.g., selfie) | **[Attached Documents Object](#attached-documents-object)** |
| individual_document_number* | string | Borrower's CPF - numbers only | 11 |

### Attached Documents Object

| Field | Type | Description | Length |
|---|---|---|---|
| selfie | string | DOCUMENT_KEY of the selfie document submitted via upload | UUID |

### Address Object

| Field | Type | Description | Length |
|---|---|---|---|
| city* | string | City name | 100 |
| state* | string | State abbreviation (two uppercase letters) | 2 |
| number | string | Street number | 10 |
| street* | string | Street name | 100 |
| complement | string | Address complement (free text) | 100 |
| postal_code* | string | Postal code (CEP) - numbers only | 8 |
| neighborhood* | string | Neighborhood name | 100 |

### Phone Object

| Field | Type | Description | Length |
|---|---|---|---|
| number* | string | Phone number | 9 |
| area_code* | string | Area code (DDD) | 2 |
| country_code* | string | International code (e.g., "055") | 3 |

### Financial Object

:::info Ways to define the operation amount
The operation amount can be defined through the following mutually exclusive combinations (provide **one and only one** of the value keys, alongside the other required fields):
- **`disbursed_amount` + `monthly_interest_rate` + `number_of_installments`**: provide the net amount to be disbursed, the interest rate and the number of installments — the system computes each installment value.
- **`amount` + `monthly_interest_rate` + `number_of_installments`**: provide the gross amount (with IOF) of the operation — the system computes the net disbursement and each installment value.
- **`final_disbursement_amount` + `monthly_interest_rate` + `number_of_installments`**: provide the final amount that must reach the recipient and the system inflates `issue_amount` to cover IOF.
- **`installment_face_value` + `number_of_installments` + (`disbursed_amount` or `amount`)**: provide the desired value per installment; when this combination is used **without** `monthly_interest_rate`, the system assumes a zero rate.
- **`desired_installments`**: provide an array with the due date and total value of each installment individually — the system computes the disbursement value.
- **`disbursed_amount` + `due_dates`**: provide the disbursement amount and an array with the due dates — the system computes the installment values for the informed irregular schedule.
:::

| Field | Type | Description | Length |
|---|---|---|---|
| interest_type* | string | Amortization method | 20 |
| disbursement_date* | string | Disbursement date | 10 |
| first_due_date | string | Due date of the first installment (YYYY-MM-DD) | 10 |
| limit_days_to_disburse | integer | Number of days after `disbursement_date` during which disbursement may still occur | 3 |
| fine_configuration* | object | Fine and arrears configuration | **[Fine Configuration Object](#fine-configuration-object)** |
| monthly_interest_rate | float | Monthly interest rate. Optional when `installment_face_value` is used | 10,6 |
| annual_interest_rate | float | Annual interest rate (alternative to `monthly_interest_rate`) | 10,6 |
| daily_interest_rate | float | Daily interest rate (alternative to `monthly_interest_rate`) | 10,6 |
| disbursed_amount | float | Net amount to be disbursed | 15,2 |
| amount | float | Gross amount of the operation (`issue_amount`) — includes IOF | 15,2 |
| final_disbursement_amount | float | Final amount to reach the recipient — system inflates `issue_amount` to cover IOF | 15,2 |
| installment_face_value | float | Desired value of each installment | 15,2 |
| number_of_installments | integer | Number of installments | 3 |
| desired_installments | array | Array of installments with individually defined date and value | **[Desired Installments Object](#desired-installments-object)** |
| due_dates | array | List of due dates (YYYY-MM-DD). Used with `disbursed_amount` for an irregular installment schedule | - |
| total_iof | float | Total IOF amount — when omitted, the system calculates it automatically | 15,2 |
| credit_operation_type* | string | Credit operation type (e.g., "ccb") | 10 |
| interest_grace_period | integer | Interest grace period (in months) | 3 |
| principal_grace_period | integer | Principal grace period (in months) | 3 |

### Desired Installments Object

| Field | Type | Description | Length |
|---|---|---|---|
| due_date* | string | Installment due date (YYYY-MM-DD) | 10 |
| total_amount* | float | Total installment amount | 15,2 |

### Fine Configuration Object

| Field | Type | Description | Length |
|---|---|---|---|
| monthly_rate* | float | Monthly arrears rate | 10,6 |
| interest_base* | string | Arrears calculation base (e.g., "calendar_days") | 20 |
| contract_fine_rate* | float | Contract fine rate | 10,6 |

### Disbursement Bank Account Object

| Field | Type | Description | Length |
|---|---|---|---|
| name | string | Full name of the destination account holder | 100 |
| document_number | string | CPF or CNPJ of the destination account holder | 11 or 14 |
| transfer_method | string | Transfer method. Values: `pix`, `ted` (default: `pix`) | 3 |
| pix_transfer_type | string | Pix transfer subtype. Values: `manual`, `key`, `qrcode` | 6 |
| ispb_number | string | ISPB code of the financial institution | 8 |
| bank_code | string | COMPE code of the financial institution (alternative to `ispb_number`) | 3 |
| branch_number | string | Branch number (without check digit) | 4 |
| account_number | string | Account number (without check digit) | 19 |
| account_digit | string | Account check digit (use zero in place of letters) | 1 |
| account_type | string | Destination account type. Values: `checking_account`, `saving_account`, `salary_account`, `payment_account`, `deposit_account`, `guaranteed_account`, `investment_account` | 20 |
| pix_key | string | Recipient's Pix key — required when `pix_transfer_type` = `key` | - |
| qr_code_key | string | UUID key of a Pix QR Code already registered — required when `pix_transfer_type` = `qrcode` | 36 |
| qr_code_url | string | EMV string (copy-and-paste) of the Pix QR Code — alternative to `qr_code_key` | 250 |
| digitable_line | string | Bank slip digitable line — used for disbursement via boleto | 47-48 |
| end_to_end_id | string | Pix end-to-end identifier (populated in the response) | 32 |
| percentage_receivable | float | Percentage of the disbursement allocated to this account. Required when `amount_receivable` is not provided | 3 |
| amount_receivable | float | Fixed amount allocated to this account. Required when `percentage_receivable` is not provided | 15,2 |

:::info Supported disbursement modes
The field combination depends on `transfer_method` and `pix_transfer_type`:
- **QI Tech internal account or TED**: `bank_code`/`ispb_number` + `branch_number` + `account_number` + `account_digit` + `document_number` + `name` + `percentage_receivable`.
- **Pix manual**: `pix_transfer_type` = `manual` + account data (same as TED).
- **Pix by key**: `pix_transfer_type` = `key` + `pix_key`.
- **Pix by QR Code (registered)**: `pix_transfer_type` = `qrcode` + `qr_code_key`.
- **Pix by QR Code (copy-and-paste)**: `qr_code_url` + `transfer_method` = `pix`.
- **Boleto payment**: `digitable_line` + `amount_receivable`.
:::

### Additional Data Object

| Field | Type | Description | Length |
|---|---|---|---|
| contract* | object | Contract data | **[Contract Object](#contract-object)** |

### Contract Object

| Field | Type | Description | Length |
|---|---|---|---|
| contract_number* | string | Unique contract identifier number | 20 |
| signatures* | array | List of digital signature evidence objects (Opt-in) | **[Signature Object](#signature-object)** |

### Signature Object

| Field | Type | Description | Length |
|---|---|---|---|
| signer* | object | Signer identification data | **[Signer Object](#signer-object)** |
| signature* | object | Digital signature evidence data | **[Signature Details Object](#signature-details-object)** |

### Signer Object

| Field | Type | Description | Length |
|---|---|---|---|
| name* | string | Signer's full name | 255 |
| document_number* | string | Signer's CPF | 11 |
| email | string | Signer's email | 100 |
| phone | object | Signer's phone data | **[Phone Object](#phone-object)** |

### Signature Details Object

| Field | Type | Description | Length |
|---|---|---|---|
| ip_address* | string | IP address used in the signature | 45 |
| timestamp* | string | Signature date and time (ISO 8601: YYYY-MM-DDTHH:mm:ssZ) | 24 |
| signature_file* | object | Digital signature file | **[Signature File Object](#signature-file-object)** |

### Signature File Object

| Field | Type | Description | Length |
|---|---|---|---|
| file_url* | string | Direct link to the signed contract document (PDF) | 2048 |
| file_type* | string | Signature file format (e.g., "pdf") | 4 |

## Response

The response to the issuance request returns the payment schedule and a **DEBT-KEY**, which identifies the debt at QI SCD.

STATUS 201

Response Body

```json
{
    "webhook_type": "debt",
    "key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c",
    "status": "issued",
    "event_datetime": "2026-04-07 23:59:28",
    "data": {
        "borrower": {
            "name": "Dante Ferrarini",
            "document_number": "31057466093",
            "related_party_key": "24fac77e-7782-4f72-b31a-daee288e34ed"
        },
        "contract": {
            "document_key": null,
            "number": "DWF1761222116",
            "urls": [],
            "signature_information": [
                {
                    "signer_name": "Dante Ferrarini",
                    "signer_document_number": "31057466093",
                    "signer_role": "issuer",
                    "signer_email": null,
                    "signer_external_key": null,
                    "signature_url": null
                }
            ]
        },
        "requester_identifier_key": "d1905ef5-19df-4183-bf0e-802b8229933c",
        "iof_charge_method": "financed",
        "collaterals": [],
        "contract_fees": [
            {
                "fee_type": "spread",
                "fee_amount": 3.02
            }
        ],
        "external_contract_fees": [
            {
                "fee_type": "tac",
                "fee_amount": 0,
                "tax_amount": 0,
                "net_fee_amount": 0
            }
        ],
        "external_contract_fee_amount": 0,
        "net_external_contract_fee_amount": 0,
        "contract_fee_amount": 3.02,
        "issue_amount": 1007.62,
        "assignment_amount": 1010.64,
        "cet": "5,8200%",
        "annual_cet": "97,0501%",
        "number_of_installments": 2,
        "base_iof": 3.79,
        "additional_iof": 3.83,
        "total_iof": 7.62,
        "ipoc_code": "324025020203131057466093DWF1761222116",
        "prefixed_interest_rate": {
            "annual_rate": 0.8373372409,
            "created_at": "2026-04-07T23:59:22",
            "daily_rate": 0.0016911989,
            "interest_base": "calendar_days",
            "monthly_rate": 0.052
        },
        "installments": [
            {
                "accrual_reference_date": null,
                "additional_costs": [],
                "advanced_paid_amount": 0,
                "bank_slip_key": null,
                "business_due_date": "2026-05-07",
                "calendar_days": 30,
                "digitable_line": null,
                "due_date": "2026-05-07",
                "due_interest": 0,
                "due_principal": 1007.62,
                "fine_amount": null,
                "has_interest": true,
                "installment_history": [],
                "installment_key": "1dea396f-beb1-4df3-9822-35800b4c095a",
                "installment_number": 1,
                "installment_payment": [],
                "installment_status": "created",
                "installment_type": "principal",
                "original_due_principal": 1007.62,
                "original_pre_fixed_amount": 52.3996159,
                "original_principal_amortization_amount": 491.4903841,
                "original_total_amount": 543.89,
                "paid_amount": 0,
                "paid_at": null,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 52.3996159,
                "principal_amortization_amount": 491.4903841,
                "qr_code_key": null,
                "qr_code_url": null,
                "renegotiation_proposal_key": null,
                "tax_amount": 1.20906634,
                "total_accrual_amount": null,
                "total_amount": 543.89,
                "total_paid_amount": 0,
                "workdays": 20
            },
            {
                "accrual_reference_date": null,
                "additional_costs": [],
                "advanced_paid_amount": 0,
                "bank_slip_key": null,
                "business_due_date": "2026-06-08",
                "calendar_days": 31,
                "digitable_line": null,
                "due_date": "2026-06-07",
                "due_interest": 0,
                "due_principal": 516.1296159,
                "fine_amount": null,
                "has_interest": true,
                "installment_history": [],
                "installment_key": "370e73d1-55d8-431e-9b22-d08fb8297999",
                "installment_number": 2,
                "installment_payment": [],
                "installment_status": "created",
                "installment_type": "principal",
                "original_due_principal": 516.1296159,
                "original_pre_fixed_amount": 27.7603841,
                "original_principal_amortization_amount": 516.1296159,
                "original_total_amount": 543.89,
                "paid_amount": 0,
                "paid_at": null,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 27.7603841,
                "principal_amortization_amount": 516.1296159,
                "qr_code_key": null,
                "qr_code_url": null,
                "renegotiation_proposal_key": null,
                "tax_amount": 2.58168034,
                "total_accrual_amount": null,
                "total_amount": 543.89,
                "total_paid_amount": 0,
                "workdays": 20
            }
        ],
        "total_pre_fixed_amount": 80.16
    }
}
```

:::caution Attention
Remember to save the returned **DEBT-KEY**, as it will be required for queries, renegotiations, and chargebacks of the operation.
:::

### Response Body Details

| Field | Type | Description |
|---|---|---|
| **webhook_type** | string | Event type identifier |
| **key** | string | DEBT-KEY — unique identifier of the debt at QI SCD (UUID) |
| **status** | string | Current debt status |
| **event_datetime** | string | Event date and time (ISO 8601) |
| **data** | object | **[Data Object](#data-object)** — Operation data |

### Data Object

| Field | Type | Description |
|---|---|---|
| **borrower** | object | **[Borrower Response Object](#borrower-response-object)** — Borrower data |
| **contract** | object | **[Contract Response Object](#contract-response-object)** — Contract data |
| **requester_identifier_key** | string | Requester identifier key (UUID) |
| **iof_charge_method** | string | IOF charge method — always "financed" |
| **collaterals** | array | List of operation collaterals |
| **contract_fees** | array | **[Contract Fees Object](#contract-fees-object)** — QI Tech fees charged in the operation |
| **external_contract_fees** | array | **[External Contract Fees Object](#external-contract-fees-object)** — External fees charged in the operation |
| **external_contract_fee_amount** | float | Total amount of external fees |
| **net_external_contract_fee_amount** | float | Net amount of external fees after taxes |
| **contract_fee_amount** | float | Total amount of QI Tech fees |
| **issue_amount** | float | Nominal amount of the credit operation |
| **assignment_amount** | float | Assignment amount of the credit operation |
| **cet** | string | Monthly Total Effective Cost |
| **annual_cet** | string | Annual Total Effective Cost |
| **number_of_installments** | integer | Number of installments |
| **base_iof** | float | Base IOF amount |
| **additional_iof** | float | Additional IOF amount |
| **total_iof** | float | Total IOF amount |
| **ipoc_code** | string | Brazilian credit registration code generated by QI Tech |
| **prefixed_interest_rate** | object | **[Interest Rate Response Object](#interest-rate-response-object)** — Nominal interest rate |
| **installments** | array | **[Installments Response Object](#installments-response-object)** — Operation installments |
| **disbursement_account** | array | **[Disbursement Account Response Object](#disbursement-account-response-object)** — Disbursement account data (only for PIX-by-key or QR Code disbursements) |
| **total_pre_fixed_amount** | float | Total pre-fixed interest amount across all installments |

### Disbursement Account Response Object

Returned only when the disbursement is via **PIX key** (`pix_key`) or **QR Code** (`qr_code_key` / `qr_code_url`). For TED, manual PIX, or bank-slip disbursements, the `disbursement_account` field **is not present** in the response.

| Field | Type | Description |
|---|---|---|
| **name** | string | Destination account holder's name (always in clear text). |
| **document_number** | string | CPF or CNPJ of the destination account holder. **CPF (11 digits) is returned masked** as `***XXXXXX**` when the account was resolved via QR Code; **CNPJ (14 digits) is returned in full**. In the `pix_key` flow with DICT lookup, it is returned without masking. |
| **pix_key** | string | Recipient's PIX key (client input or extracted from the decoded QR Code). |
| **qr_code_key** | string | UUID of the PIX QR Code when disbursement was via registered QR. |
| **qr_code_url** | string | EMV copy-and-paste of the QR Code when disbursement was via copy-and-paste QR. |
| **account_branch** | string | Destination account branch (populated in `pix_key` flow with DICT lookup). |
| **account_number** | string | Destination account number. |
| **account_digit** | string | Destination account check digit. |
| **account_type** | string | Destination account type. |
| **ispb** | string | ISPB code of the destination financial institution. |
| **percentage_receivable** | float | Percentage of the disbursement allocated to this account. |
| **amount_receivable** | float | Fixed amount allocated to this account. |
| **end_to_end_id** | string | PIX end-to-end identifier, assigned after decoding/lookup. |

:::info Conditional behavior
The `disbursement_account` field is **strictly populated** with `name` and `document_number` when the flow is PIX (key or QR Code). The remaining fields depend on the disbursement type: for example, in `qr_code_url` the `account_branch`/`account_number`/`account_digit` fields are `null` because the dynamic EMV does not carry them.
:::

### Borrower Response Object

| Field | Type | Description |
|---|---|---|
| **name** | string | Borrower's full name |
| **document_number** | string | Borrower's CPF |
| **related_party_key** | string | Unique borrower identifier at QI Tech (UUID) |

### Contract Response Object

| Field | Type | Description |
|---|---|---|
| **document_key** | string | Contract document key |
| **number** | string | Contract number |
| **urls** | array | List of contract document URLs |
| **signature_information** | array | **[Signature Information Object](#signature-information-object)** — Signature information |

### Signature Information Object

| Field | Type | Description |
|---|---|---|
| **signer_name** | string | Signer's full name |
| **signer_document_number** | string | Signer's CPF |
| **signer_role** | string | Signer's role in the operation |
| **signer_email** | string | Signer's email |
| **signer_external_key** | string | Signer's external key |
| **signature_url** | string | URL of the signed document |

### Contract Fees Object

| Field | Type | Description |
|---|---|---|
| **fee_type** | string | Fee type |
| **fee_amount** | float | Fee amount |

### External Contract Fees Object

| Field | Type | Description |
|---|---|---|
| **fee_type** | string | External fee type |
| **fee_amount** | float | External fee amount |
| **tax_amount** | float | Tax amount on the fee |
| **net_fee_amount** | float | Net fee amount after taxes |

### Interest Rate Response Object

| Field | Type | Description |
|---|---|---|
| **annual_rate** | float | Annual interest rate |
| **created_at** | string | Rate creation timestamp (ISO 8601) |
| **daily_rate** | float | Daily interest rate |
| **interest_base** | string | Interest calculation base |
| **monthly_rate** | float | Monthly interest rate |

### Installments Response Object

| Field | Type | Description |
|---|---|---|
| **accrual_reference_date** | string | Installment calculation reference date |
| **additional_costs** | array | List of additional installment costs |
| **advanced_paid_amount** | float | Amount paid in advance |
| **bank_slip_key** | string | Bank slip key |
| **business_due_date** | string | Due date adjusted to the next business day |
| **calendar_days** | integer | Calendar days between installments |
| **digitable_line** | string | Bank slip digitable line |
| **due_date** | string | Installment due date |
| **due_interest** | float | Outstanding interest amount on the due date before payment |
| **due_principal** | float | Outstanding balance at the installment moment |
| **fine_amount** | float | Applied fine amount |
| **has_interest** | boolean | Indicates whether interest applies to the installment |
| **installment_history** | array | Installment event history |
| **installment_key** | string | Unique installment identifier (UUID) |
| **installment_number** | integer | Installment number |
| **installment_payment** | array | List of payments made on the installment |
| **installment_status** | string | Current installment status |
| **installment_type** | string | Installment type — always "principal" |
| **original_due_principal** | float | Original outstanding balance at issuance |
| **original_pre_fixed_amount** | float | Original pre-fixed interest amount at issuance |
| **original_principal_amortization_amount** | float | Original principal amortization amount at issuance |
| **original_total_amount** | float | Original total installment amount at issuance |
| **paid_amount** | float | Amount already paid on the installment |
| **paid_at** | string | Payment date |
| **post_fixed_amount** | float | Post-fixed interest amount — always 0 |
| **pre_fixed_amount** | float | Current pre-fixed interest amount |
| **principal_amortization_amount** | float | Principal amortization amount |
| **qr_code_key** | string | Pix QR Code key |
| **qr_code_url** | string | Pix QR Code URL |
| **renegotiation_proposal_key** | string | Renegotiation proposal key, when applicable |
| **tax_amount** | float | IOF amount on the installment |
| **total_accrual_amount** | float | Total accrued interest amount |
| **total_amount** | float | Total installment amount |
| **total_paid_amount** | float | Total amount paid on the installment so far |
| **workdays** | integer | Business days between installments |

---

# Simulação - Emissão Crédito Clean

URL: /en/documentation/manual_credito_clean/emissao/simulacao

## Resumo

Na QI Tech, disponibilizamos aos nossos clientes a possibilidade de simular os valores de uma operação de crédito antes de sua emissão efetiva. A simulação segue o mesmo padrão da requisição de emissão de dívida, porém não é necessário fornecer os dados cadastrais do tomador e da conta de desembolso.

## Request

ENDPOINT /v2/credit_operation/simulation
MÉTODO POST

Testar no Playground

Request Body

**disbursed_issue_amount**

```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": 2,
    "principal_amortization_month_period": 1
}
```

**installments**

```json
{
    "credit_operation_type": "ccb",
    "disbursement_date": "2026-01-26",
    "interest_type": "pre_price_days",
    "issuer_person_type": "natural",
    "monthly_interest_rate": 0.04488,
    "installments": [
        {
            "due_date": "2026-02-26",
            "amount": 137.48
        },
        {
            "due_date": "2026-03-26",
            "amount": 180.56
        }
    ]
}
```

### Detalhes do Request Body

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| **credit_operation_type*** | string | Tipo de operação de crédito | **[Enumerador Credit Operation Type](#enumerador-credit-operation-type)** |
| **disbursed_issue_amount** | float | Valor efetivamente liberado ao tomador. Obrigatório no fluxo padrão | 15,2 |
| **disbursement_date*** | string | Data em que os recursos do empréstimo serão disponibilizados | 10 |
| **first_due_date** | string | Data de vencimento da primeira parcela. Obrigatório no fluxo padrão | 10 |
| **force_installments_on_workdays** | boolean | Se verdadeiro, move datas de vencimento para o próximo dia útil | - |
| **interest_type*** | string | Método de amortização | **[Enumerador Interest Type](#enumerador-interest-type)** |
| **issuer_person_type*** | string | Define se o emissor é pessoa física ou jurídica | **[Enumerador Person Type](#enumerador-person-type)** |
| **monthly_interest_rate*** | float | Taxa de juros mensal aplicada sobre o saldo principal | 10,6 |
| **number_of_installments** | integer | Número de parcelas. Obrigatório no fluxo padrão | 3 |
| **principal_amortization_month_period** | integer | Período, em meses, entre as parcelas. Obrigatório no fluxo padrão | 1 |
| **installments** | array | Lista de parcelas para simulação. Cada item deve conter `due_date` e `amount`. Utilizar em substituição a `number_of_installments` + `first_due_date` | **[Objeto Installments Request](#objeto-installments-request)** |

### Objeto Installments Request

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| **due_date*** | string | Data de vencimento da parcela (YYYY-MM-DD) | 10 |
| **amount*** | float | Valor total da parcela. O sistema calcula o `disbursed_issue_amount` correspondente | 15,2 |

### Enumerador Credit Operation Type

| Valor | Descrição |
|---|---|
| `ccb` | Cédula de Crédito Bancário |

### Enumerador Interest Type

| Valor | Descrição |
|---|---|
| `pre_price_days` | Juros pré-fixados com amortização Price por dias corridos |
| `pre_price` | Juros pré-fixados com amortização Price por meses |
| `pre_sac` | Juros pré-fixados com amortização SAC |

### Enumerador Person Type

| Valor | Descrição |
|---|---|
| `natural` | Pessoa física |
| `legal` | Pessoa jurídica |

## Response

STATUS 200

Response Body

```json
{
    "disbursement_date": "2025-09-24",
    "issue_amount": 2821.32,
    "interest_type": "pre_price_days",
    "assignment_amount": 2829.78,
    "base_iof": 10.6,
    "total_iof": 21.32,
    "additional_iof": 10.72,
    "cet": 5.09,
    "annual_cet": 81.39,
    "first_due_date": "2025-10-24",
    "disbursed_amount": 2800,
    "prefixed_interest_rate": {
        "annual_rate": 0.6935459998,
        "daily_rate": 0.0014644728,
        "interest_base": "calendar_days",
        "monthly_rate": 0.04488
    },
    "tax_configuration": {
        "base_rate": 8.2e-05,
        "additional_rate": 0.0038
    },
    "fees": [
        {
            "amount": 0.3,
            "fee_amount": 8.46,
            "amount_type": "percentage",
            "fee_type": "spread",
            "type": "internal"
        }
    ],
    "installments": [
        {
            "due_date": "2025-10-24",
            "amount": 1507.4,
            "due_principal": 2821.32,
            "due_interest": 0,
            "has_interest": true,
            "period": 1,
            "period_workdays": 1.1,
            "calendar_days": 30,
            "workdays": 22,
            "installment_number": 1,
            "period_to_disbursement": 1,
            "prefixed_amount": 126.62248868,
            "period_workdays_to_disbursement": 1.1,
            "calendar_days_to_disbursement": 30,
            "workdays_to_disbursement": 22,
            "tax_amount": 3.39671268,
            "principal_amortization_amount": 1380.77751132
        },
        {
            "due_date": "2025-11-24",
            "amount": 1507.4,
            "due_principal": 1440.54248868,
            "due_interest": 0,
            "has_interest": true,
            "period": 1,
            "period_workdays": 1,
            "calendar_days": 31,
            "workdays": 20,
            "installment_number": 2,
            "period_to_disbursement": 2,
            "prefixed_amount": 66.85751132,
            "period_workdays_to_disbursement": 2.1,
            "calendar_days_to_disbursement": 61,
            "workdays_to_disbursement": 42,
            "tax_amount": 7.20559353,
            "principal_amortization_amount": 1440.54248868
        }
    ]
}
```

### Detalhes do Response Body

| Campo | Tipo | Descrição |
|---|---|---|
| **annual_cet** | float | Custo Efetivo Total anualizado expresso em decimal |
| **assignment_amount** | float | Valor de cessão da operação de crédito |
| **cet** | float | Custo Efetivo Total mensal expresso em decimal |
| **fees** | array | **[Objeto Fees](#objeto-fees)** - Lista de taxas da QI Tech cobradas na operação |
| **disbursed_amount** | float | Valor desembolsado na operação de crédito |
| **disbursement_date** | string | Data de desembolso da operação |
| **installments** | array | **[Objeto Installments](#objeto-installments)** - Parcelas da operação |
| **interest_type** | string | Método de amortização e cálculo de juros |
| **additional_iof** | float | IOF adicional aplicado sobre o principal da transação |
| **base_iof** | float | Base de cálculo do IOF |
| **total_iof** | float | Valor total do IOF aplicado na transação |
| **issue_amount** | float | Valor nominal da operação de crédito |
| **tax_configuration** | object | **[Objeto Tax Configuration](#objeto-tax-configuration)** - Valores das taxas de IOF |
| **first_due_date** | string | Data de vencimento da primeira parcela |
| **prefixed_interest_rate** | object | **[Objeto Interest Rate](#objeto-interest-rate)** - Taxa de juros nominal |

### Objeto Fees

| Campo | Tipo | Descrição |
|---|---|---|
| **amount** | float | Valor ou percentual da taxa |
| **fee_amount** | float | Valor monetário da taxa |
| **amount_type** | string | Tipo do valor (percentage ou fixed) |
| **fee_type** | string | Tipo da taxa |
| **type** | string | Classificação da taxa (internal ou external) |

### Objeto Installments

| Campo | Tipo | Descrição |
|---|---|---|
| **due_date** | string | Data de vencimento da parcela |
| **amount** | float | Valor total da parcela |
| **due_principal** | float | Saldo devedor no momento da parcela |
| **due_interest** | float | Valor de juros remanescente na data de vencimento antes do pagamento |
| **has_interest** | boolean | Indicador de incidência de juros na parcela |
| **installment_number** | integer | Número da parcela |
| **prefixed_amount** | float | Valor dos juros pré-fixados pagos na parcela |
| **tax_amount** | float | Valor do IOF na parcela |
| **principal_amortization_amount** | float | Valor de amortização do principal |
| **period** | float | Período da parcela |
| **period_workdays** | float | Período da parcela em dias úteis |
| **period_to_disbursement** | float | Número de períodos acumulados desde o desembolso até a parcela |
| **period_workdays_to_disbursement** | float | Número de períodos em dias úteis acumulados desde o desembolso até a parcela |
| **calendar_days** | integer | Dias corridos entre parcelas |
| **calendar_days_to_disbursement** | integer | Dias corridos acumulados desde o desembolso até a parcela |
| **workdays** | integer | Dias úteis entre parcelas |
| **workdays_to_disbursement** | integer | Dias úteis acumulados desde o desembolso até a parcela |

### Objeto Tax Configuration

| Campo | Tipo | Descrição |
|---|---|---|
| **base_rate** | float | Taxa base do IOF |
| **additional_rate** | float | Taxa adicional do IOF |

### Objeto Interest Rate

| Campo | Tipo | Descrição |
|---|---|---|
| **annual_rate** | float | Taxa de juros anual |
| **daily_rate** | float | Taxa de juros diária |
| **interest_base** | string | Base de cálculo dos juros |
| **monthly_rate** | float | Taxa de juros mensal |

---

# Webhooks - Emissão Crédito Clean

URL: /en/documentation/manual_credito_clean/emissao/webhooks

## Resumo

Após a resposta de sucesso da emissão, você receberá webhooks notificando sobre os eventos do ciclo de vida da operação: assinatura do contrato, desembolso e, eventualmente, cancelamento.

:::danger Atenção!
Os webhooks não devem ser mapeados de forma estrita. Novos campos podem ser adicionados ao payload sem aviso prévio.
:::

## Webhook de Assinatura

Este webhook é enviado quando o contrato (CCB) é assinado com sucesso.

WEBHOOK_TYPE debt
STATUS signature_finished

Webhook Body

```json
{
    "key": "1ebd4a90-2721-4c39-a399-427fa16bca65",
    "status": "signature_finished",
    "webhook_type": "debt",
    "event_datetime": "2025-10-27T17:09:33Z",
    "signed_contract_url": "https://storage.googleapis.com/sandbox-doc-api/documents/c8b191cb-7b90-4e37-9280-397a597babc1/CCB-TIK11267101212-20251027170925_signed.pdf"
}
```

### Campos do Webhook de Assinatura

| Campo | Tipo | Descrição |
|---|---|---|
| **key** | string | Chave única da dívida (DEBT-KEY) |
| **status** | string | Status do evento: `signature_finished` |
| **webhook_type** | string | Tipo do webhook: `debt` |
| **event_datetime** | string | Data e hora do evento |
| **signed_contract_url** | string | URL do contrato assinado (PDF) |

## Webhook de Desembolso

Este webhook confirma que o desembolso foi realizado com sucesso.

WEBHOOK_TYPE debt
STATUS disbursed

Webhook Body

```json
{
    "key": "1ebd4a90-2721-4c39-a399-427fa16bca65",
    "data": {
        "installments": [
            {
                "due_date": "2025-11-27",
                "total_amount": 87.43,
                "installment_key": "e25fb146-0a61-4319-a722-d01b2213d0f9",
                "pre_fixed_amount": 29.26477451,
                "installment_number": 1,
                "principal_amortization_amount": 58.16522549
            },
            {
                "due_date": "2025-12-27",
                "total_amount": 87.43,
                "installment_key": "2557de2b-6df1-4a8a-b46a-59206ece157f",
                "pre_fixed_amount": 20.11446867,
                "installment_number": 2,
                "principal_amortization_amount": 67.31553133
            },
            {
                "due_date": "2026-01-27",
                "total_amount": 87.43,
                "installment_key": "cc503d1d-6387-4a1f-bd78-62b248d02ec8",
                "pre_fixed_amount": 11.07075682,
                "installment_number": 3,
                "principal_amortization_amount": 76.35924318
            }
        ],
        "ted_receipt_list": [],
        "requester_identifier_key": null
    },
    "status": "disbursed",
    "webhook_type": "debt",
    "event_datetime": "2025-10-27T17:10:21Z"
}
```

### Campos do Webhook de Desembolso

| Campo | Tipo | Descrição |
|---|---|---|
| **key** | string | Chave única da dívida (DEBT-KEY) |
| **status** | string | Status do evento: `disbursed` |
| **webhook_type** | string | Tipo do webhook: `debt` |
| **event_datetime** | string | Data e hora do evento |
| **data.installments** | array | Lista de parcelas com suas chaves e valores |
| **data.ted_receipt_list** | array | Lista de comprovantes de TED (quando aplicável) |

## Webhook de Cancelamento

Se a dívida falhar no desembolso ou for devolvida, você receberá um webhook de cancelamento.

WEBHOOK_TYPE debt
STATUS canceled

Webhook Body

```json
{
    "webhook_type": "debt",
    "key": "1ebd4a90-2721-4c39-a399-427fa16bca65",
    "event_datetime": "2025-10-27T16:38:59Z",
    "data": {
        "cancel_reason": "Operacao cancelada manualmente",
        "cancel_reason_enumerator": "manual"
    },
    "status": "canceled"
}
```

### Campos do Webhook de Cancelamento

| Campo | Tipo | Descrição |
|---|---|---|
| **key** | string | Chave única da dívida (DEBT-KEY) |
| **status** | string | Status do evento: `canceled` |
| **webhook_type** | string | Tipo do webhook: `debt` |
| **event_datetime** | string | Data e hora do evento |
| **data.cancel_reason** | string | Descrição textual do motivo do cancelamento |
| **data.cancel_reason_enumerator** | string | Enumerador do motivo do cancelamento |

### Enumeradores de Cancelamento

| Enumerador | Descrição |
|---|---|
| `disbursing_error` | Operação cancelada por erro durante o desembolso |
| `waiting_signature` | Operação cancelada por falta de assinatura |
| `pix_max_retry` | Operação cancelada porque o banco receptor não processou o desembolso |
| `manual` | Operação cancelada manualmente |
| `agencia_conta_invalida` | Agência ou número de conta do destinatário inválidos |
| `invalid_account` | Número da conta de destino inexistente ou inválido |
| `invalid_document_number` | CPF/CNPJ da conta de destino incorreto |
| `unsupported_transaction` | A conta de destino não suporta este tipo de transação |
| `invalid_ispb` | O número ISPB é inválido ou inexistente |
| `rejected_payment` | Ordem de pagamento rejeitada pelo banco receptor |
| `refund_after_payee_request` | Estorno solicitado pelo beneficiário |
| `blocked_account` | A conta de destino está bloqueada |
| `amount_too_great` | Valor excede o limite da conta de destino |
| `receiver_error` | Transação interrompida por erro no PSP do receptor |
| `closed_account` | A conta de destino está encerrada |
| `disbursing_hour_closed` | Desembolso fora do horário permitido |
| `unregistered_pix_key` | A chave Pix não está registrada |
| `spi_timeout` | Timeout no controle SPI |

---

## Webhook de Quitação

Quando todas as parcelas são pagas e a operação é quitada integralmente, o sistema envia este webhook.

WEBHOOK_TYPE debt
STATUS settled

Webhook Body

```json
{
    "key": "1ebd4a90-2721-4c39-a399-427fa16bca65",
    "data": {
        "settlement_amount": 3429.38
    },
    "status": "settled",
    "webhook_type": "debt",
    "event_datetime": "2025-10-27T07:03:49Z"
}
```

### Campos do Webhook de Quitação

| Campo | Tipo | Descrição |
|---|---|---|
| **key** | string | Chave única da dívida (DEBT-KEY) |
| **status** | string | Status do evento: `settled` |
| **webhook_type** | string | Tipo do webhook: `debt` |
| **event_datetime** | string | Data e hora do evento |
| **data.settlement_amount** | float | Valor total liquidado |

## Webhook de Confirmação de Cessão

Este webhook é enviado quando uma cessão de operações de crédito é processada. Ele notifica que o processo de cessão foi iniciado e fornece os metadados necessários para rastreamento.

WEBHOOK_TYPE assignment.status_change

Webhook Body

```json
{
    "key": "b866dc02-73db-42a4-bc66-866d465cbb73",
    "webhook_type": "assignment.status_change",
    "event_datetime": "2026-04-10T22:37:52Z",
    "data": {
        "assignment_key": "550e8400-e29b-41d4-a716-446655440000",
        "term_of_assignment_url": "https://example.com/terms/cessao.pdf",
        "number_of_items": 1,
        "total_amount": 1000,
        "reference_date": "2026-04-10"
    }
}
```

### Campos do Webhook de Confirmação de Cessão

| Campo | Tipo | Descrição |
|---|---|---|
| **key** | string | Chave única da cessão |
| **webhook_type** | string | Tipo do webhook: `assignment.status_change` |
| **event_datetime** | string | Data e hora do evento |
| **data.assignment_key** | string | Identificador único da cessão (UUID) |
| **data.term_of_assignment_url** | string | URL para download do Termo de Cessão (PDF) |
| **data.number_of_items** | integer | Total de operações de crédito incluídas na cessão |
| **data.total_amount** | float | Soma do valor presente de todos os itens da cessão |
| **data.reference_date** | string | Data base utilizada nos cálculos da cessão (YYYY-MM-DD) |

---

## Webhook de Cancelamento Permanente

Operações com status `canceled` são automaticamente canceladas de forma permanente após 7 dias. O cancelamento permanente também pode ser acionado manualmente via endpoint `/debt/{debt_key}/cancel_permanently`.

WEBHOOK_TYPE debt
STATUS canceled_permanently

Webhook Body

```json
{
    "key": "1ebd4a90-2721-4c39-a399-427fa16bca65",
    "data": {},
    "status": "canceled_permanently",
    "webhook_type": "debt",
    "event_datetime": "2025-10-27T03:46:31Z"
}
```

### Campos do Webhook de Cancelamento Permanente

| Campo | Tipo | Descrição |
|---|---|---|
| **key** | string | Chave única da dívida (DEBT-KEY) |
| **status** | string | Status do evento: `canceled_permanently` |
| **webhook_type** | string | Tipo do webhook: `debt` |
| **event_datetime** | string | Data e hora do evento |

---

## Webhook de Atualização de Parcela

Enviado quando o status de uma parcela é atualizado (pagamento, vencimento, antecipação, etc.).

WEBHOOK_TYPE installment.status_change

:::info Documentação completa
Payload detalhado e todos os status possíveis estão em [Webhooks de Parcelas](/documentation/webhooks/parcelas).
:::

### Status de parcela

| Status | Descrição |
|---|---|
| `opened` | Parcela em aberto |
| `paid` | Parcela paga |
| `waiting_payment` | Aguardando pagamento |
| `paid_early` | Parcela paga antecipadamente |
| `paid_partial` | Parcela paga parcialmente |
| `overdue` | Parcela vencida |
| `paid_partial_overdue` | Parcela paga parcialmente após vencimento |
| `paid_overdue` | Parcela paga após vencimento |

---

# Estorno Crédito Clean

URL: /en/documentation/manual_credito_clean/estorno/

## Resumo

O estorno de uma operação Crédito Clean permite reverter o desembolso realizado. Existem três cenários de cancelamento/estorno:

1. **Cancelamento antes do desembolso**: Cancela a operação antes que os recursos sejam transferidos
2. **Estorno após o desembolso — via Pix de devolução (até 7 dias)**: Gera um Pix copia-e-cola para que o tomador devolva os recursos
3. **Estorno após o desembolso — via conta interna QI**: A devolução é feita diretamente pela conta interna da QI Tech, sem ação do tomador

---

## 1. Cancelamento Antes do Desembolso

Cancela uma operação de crédito que ainda não foi desembolsada.

### Request

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

Testar no Playground

### Path Params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `debt_key`* | string | Chave única da dívida retornada no momento da criação da operação de crédito | UUID |

### Response

STATUS 200

Response Body

```json
{}
```

:::caution Atenção
Este endpoint só pode ser utilizado para operações que ainda **não foram desembolsadas**. Para operações já desembolsadas, utilize o endpoint de estorno abaixo.
:::

---

## 2. Estorno Após o Desembolso — Via Pix de Devolução (Até 7 Dias)

Utilizado quando o parceiro deseja solicitar ao tomador que devolva os recursos via Pix. O sistema gera um Pix copia-e-cola para que o tomador realize a devolução. Assim que o pagamento é confirmado, a operação é cancelada automaticamente.

:::info Quando usar
Use este endpoint quando o estorno deve ser realizado pelo **próprio tomador**, que receberá um Pix de devolução para pagar.
:::

### Request

ENDPOINT /debt/reversal
MÉTODO POST

Testar no Playground

Request Body

```json
{
    "credit_operation_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c"
}
```

### Body Params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `credit_operation_key`* | string | Chave da operação de crédito (DEBT-KEY) | UUID |

### Response

STATUS 200

Response Body

```json
{
    "payer_name": "Dante Ferrarini",
    "payer_document_number": "31057466093",
    "amount": 1000,
    "expiration_date": "2026-04-28",
    "copy_paste_pix": "00020126930014br.gov.bcb.pix2571qrcode-h.sandbox.qitech.app/bacen/cobv/fb1906ab2eff40109609855ac104f60e5204000053039865802BR5925QISOCIEDADEDECREDITODIRET6008SaoPaulo61080145200062070503***63046387",
    "reversal_key": "7a18fdb6-a3e7-4fc9-833e-0f6d8e98de3b",
    "status": "active",
    "debt_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c",
    "qr_code_key": "fb1906ab-2eff-4010-9609-855ac104f60e"
}
```

### Detalhes do Response

| Campo | Tipo | Descrição |
|---|---|---|
| **payer_name** | string | Nome do tomador |
| **payer_document_number** | string | CPF/CNPJ do tomador |
| **amount** | float | Valor total a ser devolvido |
| **expiration_date** | string | Data de expiração do Pix de devolução |
| **copy_paste_pix** | string | Código Pix copia-e-cola para devolução dos recursos |
| **reversal_key** | string | Chave única do estorno (UUID) |
| **status** | string | Status do estorno: `active` |
| **debt_key** | string | Chave da dívida (DEBT-KEY) |
| **qr_code_key** | string | Chave do QR Code Pix (UUID) |

:::warning Importante
- O estorno só pode ser realizado dentro de **7 dias corridos** após o desembolso
- O `copy_paste_pix` gerado possui uma **data de expiração**. Após essa data, o Pix não poderá mais ser utilizado
- Após o pagamento do Pix pelo tomador, a operação será cancelada automaticamente e você receberá um webhook de cancelamento
:::

---

## 3. Estorno Após o Desembolso — Via Conta Interna QI

Utilizado quando a devolução dos recursos é realizada diretamente pela **conta interna da QI Tech**, sem necessidade de ação do tomador. Indicado para o método `internal`, onde o valor é debitado internamente sem geração de Pix.

:::info Quando usar
Use este endpoint quando o estorno é operado pelo **parceiro via conta interna da QI Tech**, sem envolver o tomador no processo de devolução.
:::

### Request

ENDPOINT /credit_operation/ CREDIT-OPERATION-KEY /reversal
MÉTODO PUT

:::info Header obrigatório
Envie o header `SELECTED-AGENT` com o valor do seu `requester_key`.
:::

### Path Params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `credit_operation_key`* | string | Chave da operação de crédito (DEBT-KEY) | UUID |

Request Body (opcional)

```json
{
    "cancel_reason": "reversed_manually"
}
```

### Body Params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `cancel_reason` | string | Motivo do estorno. Se não informado, o sistema utilizará o padrão. | - |

---

# Webhooks - Estorno Crédito Clean

URL: /en/documentation/manual_credito_clean/estorno/webhooks

## Resumo

Após a criação de um pedido de estorno, o sistema enviará webhooks para notificar sobre os eventos do processo de reversão.

:::danger Atenção!
Os webhooks não devem ser mapeados de forma estrita. Novos campos podem ser adicionados ao payload sem aviso prévio.
:::

## Webhook de Cancelamento por Estorno

Quando o tomador realiza o pagamento do Pix de devolução gerado pelo estorno, a operação de crédito é cancelada automaticamente e o seguinte webhook é enviado:

WEBHOOK_TYPE debt
STATUS canceled

Webhook Body

```json
{
    "webhook_type": "debt",
    "key": "1ebd4a90-2721-4c39-a399-427fa16bca65",
    "event_datetime": "2025-10-27T16:38:59Z",
    "data": {
        "cancel_reason": "Operacao cancelada por estorno",
        "cancel_reason_enumerator": "refund_after_payee_request"
    },
    "status": "canceled"
}
```

### Campos do Webhook

| Campo | Tipo | Descrição |
|---|---|---|
| **webhook_type** | string | Tipo do webhook: `debt` |
| **key** | string | Chave única da dívida (DEBT-KEY) |
| **event_datetime** | string | Data e hora do evento |
| **status** | string | Status do evento: `canceled` |
| **data.cancel_reason** | string | Descrição textual do motivo do cancelamento |
| **data.cancel_reason_enumerator** | string | Enumerador do motivo do cancelamento |

### Enumeradores de Cancelamento Relacionados a Estorno

| Enumerador | Descrição |
|---|---|
| `refund_after_payee_request` | Estorno solicitado pelo beneficiário |
| `manual` | Operação cancelada manualmente |
| `disbursing_error` | Operação cancelada por erro durante o desembolso |

---

## Webhook de Liquidação de Estorno (Transaction Reversal)

Para estornos processados via o endpoint de `transaction_reversal`, o webhook de confirmação segue o formato abaixo:

WEBHOOK_TYPE transaction_reversal.transaction_reversal_status_change
STATUS paid

Webhook Body

```json
{
    "data": {
        "transaction_reversal_key": "b6da1a84-5bb3-4d71-9912-cbbcfe7189c1",
        "amount": 123.45,
        "status": "paid",
        "description": "Valor de liquidação indevido",
        "reference_date": "2025-03-23",
        "fund_class_document_number": "12.345.678/0009-10",
        "fund_class_key": "0619574f-2815-419d-8208-630b0dc30487",
        "source_account": {
            "account_digit": "7",
            "account_branch": "0001",
            "account_number": "0099999",
            "owner": {
                "name": "FUNDO DE INVESTIMENTO",
                "document_number": "12.345.678/0009-10"
            },
            "financial_institution": {
                "code": "329",
                "ispb": "32402502",
                "name": "QI Sociedade de Crédito Direto"
            }
        },
        "target_account": {
            "owner": {
                "name": "Nome fictício",
                "document_number": "111.202.188-99"
            },
            "account_digit": "0",
            "account_branch": "0001",
            "account_number": "1029490",
            "target_pix_key": "1232221",
            "financial_institution": {
                "code": "033",
                "ispb": "90400888",
                "name": "BCO SANTANDER (BRASIL) S.A."
            }
        },
        "external_key": "40054daa-c3c5-49cd-add7-858b576c5887"
    },
    "webhook_type": "transaction_reversal.transaction_reversal_status_change",
    "webhook_datetime": "2025-03-23T15:08:30Z"
}
```

### Campos do Webhook de Transaction Reversal

| Campo | Tipo | Descrição |
|---|---|---|
| **webhook_type** | string | Tipo do webhook: `transaction_reversal.transaction_reversal_status_change` |
| **webhook_datetime** | string | Data e hora do envio do webhook |
| **data.transaction_reversal_key** | string | Chave única do estorno |
| **data.amount** | float | Valor estornado |
| **data.status** | string | Status do estorno: `paid` |
| **data.description** | string | Descrição do estorno |
| **data.reference_date** | string | Data de referência do processamento |
| **data.fund_class_key** | string | Chave do fundo |
| **data.source_account** | object | Dados da conta de origem do estorno |
| **data.target_account** | object | Dados da conta de destino do estorno |
| **data.external_key** | string | Chave externa da transação estornada |

---

## Webhook de Devolução de Indevido

Quando um valor indevido é identificado e a devolução é processada com sucesso, o sistema envia este webhook.

WEBHOOK_TYPE laas.devolution.refund_receipt
STATUS refunded

Webhook Body

```json
{
    "event_datetime": "2024-01-15T14:30:00.000Z",
    "key": "fb34e0ac-2c98-47e7-9040-406b8c3d80e7",
    "status": "refunded",
    "webhook_type": "laas.devolution.refund_receipt",
    "data": {
        "origin_key": "b41c63e4-6912-4217-9111-a47dd4da9588",
        "devolution_key": "336f0e15-e7b8-45a4-8986-5411434be76a",
        "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",
        "devolution_origin_type": "social_security"
    }
}
```

### Campos do Webhook de Devolução

| Campo | Tipo | Descrição |
|---|---|---|
| **webhook_type** | string | Tipo do webhook: `laas.devolution.refund_receipt` |
| **key** | string | Chave única da devolução |
| **event_datetime** | string | Data e hora do evento |
| **status** | string | Status: `refunded` |
| **data.origin_key** | string | Chave de referência do recurso devolvido |
| **data.devolution_key** | string | Chave única da devolução |
| **data.devolution_amount** | float | Valor da devolução em reais |
| **data.devolution_status** | string | Status da devolução |
| **data.devolution_reason_description** | string | Descrição do motivo da devolução |
| **data.receipt_url** | string | URL do comprovante da devolução |
| **data.document_key** | string | Chave do documento relacionado |
| **data.transacted_at** | string | Data e hora da transação (ISO 8601 UTC) |
| **data.devolution_origin_type** | string | Origem da devolução |

---

# Notificações - Crédito Clean

URL: /en/documentation/manual_credito_clean/notificacoes

## Resumo

O sistema de notificações permite consultar e reenviar webhooks de eventos do ciclo de vida da operação. Utilize estes endpoints para diagnosticar falhas de entrega e disparar retentativas.

:::danger Atenção!
Os webhooks não devem ser mapeados de forma estrita. Novos campos podem ser adicionados ao payload sem aviso prévio.
:::

## Webhooks do Crédito Clean

Os webhooks gerados pelo Crédito Clean são distribuídos pelas páginas de cada fluxo:

| Webhook Type | Status | Documentação |
|---|---|---|
| `debt` | `signature_finished` | [Emissão — Webhooks](./emissao/webhooks) |
| `debt` | `disbursed` | [Emissão — Webhooks](./emissao/webhooks) |
| `debt` | `canceled` | [Emissão — Webhooks](./emissao/webhooks) |
| `debt` | `settled` | [Emissão — Webhooks](./emissao/webhooks) |
| `debt` | `canceled_permanently` | [Emissão — Webhooks](./emissao/webhooks) |
| `installment.status_change` | — | [Emissão — Webhooks](./emissao/webhooks) |
| `debt` | `canceled` (estorno) | [Estorno — Webhooks](./estorno/webhooks) |
| `transaction_reversal.transaction_reversal_status_change` | `paid` | [Estorno — Webhooks](./estorno/webhooks) |
| `laas.devolution.refund_receipt` | `refunded` | [Estorno — Webhooks](./estorno/webhooks) |
| `renegotiation.proposal` | `paid` | [Renegociação — Webhooks](./renegociacao/webhooks) |
| `renegotiation.batch_proposal` | `paid` | [Renegociação — Webhooks](./renegociacao/webhooks) |
| `renegotiation.batch_proposal` | `rejected` | [Renegociação — Webhooks](./renegociacao/webhooks) |

---

## Consultando Eventos para Reenvio

ENDPOINT /notification/events
MÉTODO GET

### Query Parameters

| Parâmetro | Tipo | Descrição |
|---|---|---|
| **event_type** | string | Tipo do evento (ex: `debt_disbursed`) |
| **callback_status** | string | Status do callback (ex: `failed`, `sent`) |
| **origin_key** | uuid | Chave única do recurso de origem |
| **start_datetime** | string | Data/hora inicial (formato `YYYY-MM-DDTHH:mm:ssZ`, UTC) |
| **end_datetime** | string | Data/hora final (formato `YYYY-MM-DDTHH:mm:ssZ`, UTC) |

:::caution Limite de janela
A janela entre `start_datetime` e `end_datetime` deve ser de no máximo **14 dias**.
:::

Response Body (200)

```json
{
    "data": [
        {
            "event_key": "<UUID>",
            "event_type": "debt_disbursed",
            "status": "processed",
            "origin_enumerator": "account",
            "origin_key": "<UUID>",
            "callbacks": [
                {
                    "callback_key": "<UUID>",
                    "callback_status": "failed"
                }
            ]
        }
    ],
    "pagination": {
        "current_page": 1,
        "rows_per_page": 25
    }
}
```

---

## Reenviando um Callback

ENDPOINT /notification/event/{`{event_key}`}/callback/{`{callback_key}`}/retry
MÉTODO PATCH

### Path Parameters

| Parâmetro | Tipo | Descrição |
|---|---|---|
| **event_key** | uuid | Chave do evento (obtida na listagem) |
| **callback_key** | uuid | Chave do callback (obtida na listagem) |

Retorna `204 No Content` em caso de sucesso.

:::info Documentação completa
Instruções detalhadas e exemplos de troubleshooting estão em [Reenvio de Notificações](/documentation/notificacoes/reenvio_de_notificacoes).
:::

---

# Consulta de Valor Presente - Refinanciamento Crédito Clean

URL: /en/documentation/manual_credito_clean/refinanciamento/consulta_valor_presente

## Resumo

Para descobrir o valor presente que será utilizado no refinanciamento de uma operação, é possível utilizar o endpoint de consulta de dívidas indicando os query params listados abaixo.

## Request

ENDPOINT /debt
MÉTODO GET

### Query Params

| Campo | Tipo | Descrição |
|---|---|---|
| `key`* | string | Chave da dívida (DEBT-KEY) retornada no momento da criação da operação de crédito |
| `eval_present_value`* | string | Indica que o valor atual de cada parcela deve ser calculado e mostrado (`true`) |
| `calculate_delay`* | string | Indica que, se a parcela estiver vencida, os juros de mora e multa devem ser calculados com o valor presente (`true`) |
| `calculate_spread`* | string | Indica se o valor de spread da operação deve ser adicionado ao valor presente. Para operações de refinanciamento deve ser `false` |

### Exemplo de URL

```
/debt?key=72760166-4ddf-41fb-8a8c-605f8f4fc35c&eval_present_value=true&calculate_delay=true&calculate_spread=false
```

### Response

STATUS 200

Response Body

```json
{
    "webhook_type": "debt",
    "operation_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c",
    "status": "opened",
    "data": {
        "credit_operation_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c",
        "contract_number": "DWF1761222116",
        "annual_cet": 97.05,
        "cet": 5.82,
        "disbursed_issue_amount": 1000,
        "disbursement_date": "2026-04-07",
        "issue_amount": 1007.62,
        "final_disbursement_amount": 1000,
        "number_of_installments": 2,
        "total_iof": 7.62,
        "base_iof": 3.79,
        "additional_iof": 3.83,
        "assignment_amount": 1007.63,
        "issuer_name": "Dante Ferrarini",
        "issuer_document_number": "31057466093",
        "prefixed_interest_rate": {
            "annual_rate": 0.8373372409,
            "daily_rate": 0.0016911989,
            "interest_base": {
                "enumerator": "calendar_days",
                "year_days": 360
            },
            "monthly_rate": 0.052
        },
        "installments": [
            {
                "installment_key": "1dea396f-beb1-4df3-9822-35800b4c095a",
                "installment_number": 1,
                "due_date": "2026-05-07",
                "business_due_date": "2026-05-07",
                "calendar_days": 30,
                "total_amount": 543.89,
                "due_principal": 1007.62,
                "pre_fixed_amount": 52.3996159,
                "principal_amortization_amount": 491.4903841,
                "tax_amount": 1.20906634,
                "installment_status": {
                    "enumerator": "opened"
                },
                "paid_amount": 0,
                "present_amount": 517.01,
                "workdays": 20
            },
            {
                "installment_key": "370e73d1-55d8-431e-9b22-d08fb8297999",
                "installment_number": 2,
                "due_date": "2026-06-07",
                "business_due_date": "2026-06-08",
                "calendar_days": 31,
                "total_amount": 543.89,
                "due_principal": 516.1296159,
                "pre_fixed_amount": 27.7603841,
                "principal_amortization_amount": 516.1296159,
                "tax_amount": 2.58168034,
                "installment_status": {
                    "enumerator": "opened"
                },
                "paid_amount": 0,
                "present_amount": 490.62,
                "workdays": 20
            }
        ]
    }
}
```

:::tip Valor para Refinanciamento
O valor total a ser utilizado como `disbursed_amount` na simulação/criação do refinanciamento é a soma dos `present_amount` de todas as parcelas. Neste exemplo: 517.01 + 490.62 = **1007.63**.
:::

:::caution Atenção
Para operações de refinanciamento, o campo `calculate_spread` deve ser sempre `false`, pois o valor de spread não deve ser considerado no cálculo do valor presente para quitação.
:::

---

# Criação - Refinanciamento Crédito Clean

URL: /en/documentation/manual_credito_clean/refinanciamento/criacao

## Resumo

A criação de um refinanciamento utiliza o mesmo endpoint e payload da emissão (`/signed_debt`), com a adição do objeto `refinanced_credit_operations` contendo a lista de operações que serão quitadas. O somatório do valor presente dos contratos anteriores será retido e apenas o excedente será liberado na conta do tomador.

## Request

ENDPOINT /signed_debt
MÉTODO POST

Testar no Playground

Request Body

```json
{
    "borrower": {
        "name": "Dante Ferrarini",
        "email": "",
        "phone": {
            "number": "185633631",
            "area_code": "15",
            "country_code": "086"
        },
        "is_pep": false,
        "address": {
            "city": "São Paulo",
            "state": "SP",
            "number": "",
            "street": "Rua Gilberto Sabino",
            "postal_code": "05425020",
            "neighborhood": "Pinheiros",
            "complement": ""
        },
        "role_type": "issuer",
        "birth_date": "1993-09-10",
        "person_type": "natural",
        "attached_documents_list": [
            {
                "selfie": "250e7e95-57c8-40bd-a0cd-0be8eb172916"
            }
        ],
        "individual_document_number": "31057466093"
    },
    "financial": {
        "disbursed_amount": 1007.63,
        "interest_type": "pre_price_days",
        "credit_operation_type": "ccb",
        "annual_interest_rate": 2.32,
        "disbursement_date": "2026-04-07",
        "interest_grace_period": 0,
        "principal_grace_period": 0,
        "number_of_installments": 3,
        "fine_configuration": {
            "contract_fine_rate": 0.02,
            "interest_base": "calendar_days",
            "monthly_rate": 0.01
        }
    },
    "simplified": true,
    "additional_data": {
        "contract": {
            "contract_number": "DWFR00000012",
            "signatures": [
                {
                    "signer": {
                        "name": "Dante Ferrarini",
                        "email": "",
                        "phone": {
                            "number": "185633631",
                            "area_code": "15",
                            "country_code": "086"
                        },
                        "document_number": "31057466093"
                    },
                    "signature": {
                        "timestamp": "2026-04-08T00:40:30Z",
                        "ip_address": "192.168.1.1",
                        "signature_file": {
                            "file_url": "https://qitech.com.br/signature.pdf",
                            "file_type": "pdf"
                        }
                    }
                }
            ]
        }
    },
    "refinanced_credit_operations": [
        {
            "operation_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c"
        }
    ],
    "requester_identifier_key": "d2107ef5-19df-4183-bf0e-802b8229933c",
    "purchaser_document_number": "32402502000135",
    "disbursement_bank_accounts": [
        {
            "name": "company name",
            "ispb_number": "32402502",
            "account_digit": "5",
            "branch_number": "0001",
            "account_number": "7617846",
            "document_number": "32246162000281",
            "percentage_receivable": 100
        }
    ]
}
```

:::caution Atenção
O payload é **idêntico** ao da emissão (`/signed_debt`), com a adição do campo **`refinanced_credit_operations`** contendo a lista de operações a serem quitadas.
:::

### Detalhes do Request Body

O payload contém todos os campos da [Emissão Crédito Clean](../emissao/emissao), com a adição de:

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| **refinanced_credit_operations*** | array | Lista de operações a serem refinanciadas | **[Objeto Refinanced Credit Operations](#objeto-refinanced-credit-operations)** |

Todos os demais campos seguem a mesma especificação da emissão:
- **[Objeto Borrower](../emissao/emissao#objeto-borrower)**
- **[Objeto Additional Data](../emissao/emissao#objeto-additional-data)**
- **[Objeto Disbursement Bank Account](../emissao/emissao#objeto-disbursement-bank-account)**

:::info Diferença no Objeto Financial
No refinanciamento, o campo `financial` utiliza `annual_interest_rate` ao invés de `monthly_interest_rate`, e o `disbursed_amount` deve ser o valor presente total da operação a ser refinanciada (obtido na consulta de valor presente).
:::

### Objeto Refinanced Credit Operations

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `operation_key`* | string | Chave da operação a ser refinanciada (DEBT-KEY da operação original) | UUID |

## Response

A resposta segue o mesmo formato da emissão de dívida, retornando a **DEBT-KEY** do novo contrato.

STATUS 201

Response Body

```json
{
    "webhook_type": "debt",
    "key": "290f042f-eedd-4d9d-b621-3a81df0181b6",
    "status": "opened",
    "event_datetime": "2026-04-08 00:40:37",
    "data": {
        "borrower": {
            "name": "Dante Ferrarini",
            "document_number": "31057466093",
            "related_party_key": "3d62f3c6-1ae5-49f9-aa5d-21a08d95aad6"
        },
        "contract": {
            "document_key": null,
            "number": "DWFR00000012",
            "urls": [],
            "signature_information": [
                {
                    "signer_name": "Dante Ferrarini",
                    "signer_document_number": "31057466093",
                    "signer_role": "issuer",
                    "signer_email": null,
                    "signer_external_key": null,
                    "signature_url": null
                }
            ]
        },
        "requester_identifier_key": "d2107ef5-19df-4183-bf0e-802b8229933c",
        "iof_charge_method": "financed",
        "collaterals": [],
        "contract_fees": [
            {
                "fee_type": "spread",
                "fee_amount": 3.05
            },
            {
                "fee_type": "spread_refinancing",
                "fee_amount": 3.02
            }
        ],
        "external_contract_fees": [
            {
                "fee_type": "tac",
                "fee_amount": 0,
                "tax_amount": 0,
                "net_fee_amount": 0
            }
        ],
        "external_contract_fee_amount": 0,
        "net_external_contract_fee_amount": 0,
        "contract_fee_amount": 6.07,
        "issue_amount": 1016.72,
        "assignment_amount": 1022.79,
        "cet": "11,1900%",
        "annual_cet": "256,9982%",
        "number_of_installments": 3,
        "base_iof": 5.23,
        "additional_iof": 3.86,
        "total_iof": 9.09,
        "ipoc_code": "324025020203131057466093DWFR00000012",
        "prefixed_interest_rate": {
            "annual_rate": 2.32,
            "created_at": "2026-04-08T00:40:30",
            "daily_rate": 0.0033387969,
            "interest_base": "calendar_days",
            "monthly_rate": 0.1051676747
        },
        "installments": [
            {
                "accrual_reference_date": null,
                "additional_costs": [],
                "advanced_paid_amount": 0,
                "bank_slip_key": null,
                "business_due_date": "2026-05-07",
                "calendar_days": 30,
                "digitable_line": null,
                "due_date": "2026-05-07",
                "due_interest": 0,
                "due_principal": 1016.72,
                "fine_amount": null,
                "has_interest": true,
                "installment_history": [],
                "installment_key": "52810e9d-0815-4fd1-ab20-d8b37dcd936e",
                "installment_number": 1,
                "installment_payment": [],
                "installment_status": "created",
                "installment_type": "principal",
                "original_due_principal": 1016.72,
                "original_pre_fixed_amount": 106.92260459,
                "original_principal_amortization_amount": 306.50739541,
                "original_total_amount": 413.43,
                "paid_amount": 0,
                "paid_at": null,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 106.92260459,
                "principal_amortization_amount": 306.50739541,
                "qr_code_key": null,
                "qr_code_url": null,
                "renegotiation_proposal_key": null,
                "tax_amount": 0.75400819,
                "total_accrual_amount": null,
                "total_amount": 413.43,
                "total_paid_amount": 0,
                "workdays": 20
            },
            {
                "accrual_reference_date": null,
                "additional_costs": [],
                "advanced_paid_amount": 0,
                "bank_slip_key": null,
                "business_due_date": "2026-06-08",
                "calendar_days": 31,
                "digitable_line": null,
                "due_date": "2026-06-07",
                "due_interest": 0,
                "due_principal": 710.21260459,
                "fine_amount": null,
                "has_interest": true,
                "installment_history": [],
                "installment_key": "2bcfe19e-9847-4c8f-be80-17f646a897c4",
                "installment_number": 2,
                "installment_payment": [],
                "installment_status": "created",
                "installment_type": "principal",
                "original_due_principal": 710.21260459,
                "original_pre_fixed_amount": 77.30856978,
                "original_principal_amortization_amount": 336.12143022,
                "original_total_amount": 413.43,
                "paid_amount": 0,
                "paid_at": null,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 77.30856978,
                "principal_amortization_amount": 336.12143022,
                "qr_code_key": null,
                "qr_code_url": null,
                "renegotiation_proposal_key": null,
                "tax_amount": 1.68127939,
                "total_accrual_amount": null,
                "total_amount": 413.43,
                "total_paid_amount": 0,
                "workdays": 20
            },
            {
                "accrual_reference_date": null,
                "additional_costs": [],
                "advanced_paid_amount": 0,
                "bank_slip_key": null,
                "business_due_date": "2026-07-07",
                "calendar_days": 30,
                "digitable_line": null,
                "due_date": "2026-07-07",
                "due_interest": 0,
                "due_principal": 374.09117437,
                "fine_amount": null,
                "has_interest": true,
                "installment_history": [],
                "installment_key": "7cf785c9-b6cf-4e9b-9c09-61d917bc72b8",
                "installment_number": 3,
                "installment_payment": [],
                "installment_status": "created",
                "installment_type": "principal",
                "original_due_principal": 374.09117437,
                "original_pre_fixed_amount": 39.33882563,
                "original_principal_amortization_amount": 374.09117437,
                "original_total_amount": 413.43,
                "paid_amount": 0,
                "paid_at": null,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 39.33882563,
                "principal_amortization_amount": 374.09117437,
                "qr_code_key": null,
                "qr_code_url": null,
                "renegotiation_proposal_key": null,
                "tax_amount": 2.79146834,
                "total_accrual_amount": null,
                "total_amount": 413.43,
                "total_paid_amount": 0,
                "workdays": 22
            }
        ],
        "total_pre_fixed_amount": 223.57
    }
}
```

:::info Observação
- O valor presente das operações listadas em `refinanced_credit_operations` será automaticamente retido para quitação dos contratos anteriores
- Apenas o excedente (diferença entre o valor desembolsado e o valor retido) será liberado na conta do tomador
- Após a criação, os contratos refinanciados serão automaticamente liquidados
- Os webhooks de emissão (assinatura, desembolso, cancelamento) seguem o mesmo padrão descrito na seção de [Webhooks da Emissão](../emissao/webhooks)
:::

---

# Introdução - Refinanciamento Crédito Clean

URL: /en/documentation/manual_credito_clean/refinanciamento/introducao

## Resumo

Um refinanciamento consiste na geração de um novo contrato de crédito para a quitação de um anterior. O fluxo funciona da mesma forma que uma emissão de dívida simples, porém, quando informados os valores da operação, o somatório do valor presente dos contratos anteriores será retido e apenas o excedente, caso exista, será liberado na conta do tomador.

## Fluxo do Refinanciamento

1. **Consulta de valor presente**: Consultar o valor presente da operação original para saber o montante necessário para quitação
2. **Simulação**: Simular o refinanciamento com os dados da nova operação e a referência à operação original
3. **Criação**: Criar o refinanciamento informando a lista de operações a serem quitadas em `refinanced_credit_operations`

:::info Importante
O payload utilizado tanto na simulação quanto na criação de um refinanciamento é o mesmo de uma dívida simples, com a adição da lista de operações que serão quitadas em **`refinanced_credit_operations`**.
:::

---

# Simulação - Refinanciamento Crédito Clean

URL: /en/documentation/manual_credito_clean/refinanciamento/simulacao

## Resumo

Antes de criar um refinanciamento, é possível simular os valores da nova operação. A simulação utiliza o mesmo payload de uma simulação de dívida simples, com a adição do campo `refinanced_credit_operations`.

## Request

ENDPOINT /debt_simulation
MÉTODO POST

Request Body

```json
{
    "borrower": {
        "person_type": "natural"
    },
    "refinanced_credit_operations": [
        {
            "operation_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c"
        }
    ],
    "financial": {
        "disbursed_amount": 1007.63,
        "interest_type": "pre_price_days",
        "credit_operation_type": "ccb",
        "annual_interest_rate": 2.32,
        "disbursement_date": "2026-04-07",
        "interest_grace_period": 0,
        "principal_grace_period": 0,
        "number_of_installments": 3,
        "fine_configuration": {
            "contract_fine_rate": 0.02,
            "interest_base": "calendar_days",
            "monthly_rate": 0.01
        }
    }
}
```

### Body Params

| Campo | Tipo | Descrição |
|---|---|---|
| **borrower*** | object | Dados do tomador (mínimo: `person_type`) |
| **refinanced_credit_operations*** | array | Lista de operações a serem refinanciadas |
| **financial*** | object | Dados financeiros da nova operação |

### Objeto refinanced_credit_operations

| Campo | Tipo | Descrição |
|---|---|---|
| `operation_key`* | string | Chave da operação a ser refinanciada (DEBT-KEY) |

## Response

STATUS 200

Response Body

```json
{
    "type": "debt",
    "key": "daa5173d-ae44-44c5-87bc-f9115cfbcaa1",
    "status": "finished",
    "event_datetime": "2026-04-08 00:36:02",
    "data": {
        "interest_type": "pre_price_days",
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "interest_payment_month_period": 1,
        "principal_grace_period": 0,
        "principal_amortization_month_period": 1,
        "operation_type": "settlement_refinancing",
        "prefixed_interest_rate": {
            "interest_base": "calendar_days_365",
            "annual_rate": 2.32,
            "monthly_rate": 0.1051676747,
            "daily_rate": 0.0032929847
        },
        "issue_date": "2026-04-07",
        "number_of_installments": 3,
        "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
        "final_disbursement_amount": 0.01,
        "refinanced_credit_operations": [
            {
                "refinanced_credit_operation_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c",
                "refinanced_credit_operation_status": "pending_payment",
                "due_balance": 1007.62,
                "due_balance_reference_date": "2026-04-07",
                "original_deadline": 61
            }
        ],
        "total_pre_fixed_amount": 220.27,
        "iof_amount": 9.09,
        "cet": 0.1103,
        "annual_cet": 2.5111,
        "disbursement_date": "2026-04-07",
        "installments": [
            {
                "calendar_days": 30,
                "workdays": 20,
                "business_due_date": "2026-05-07",
                "due_date": "2026-05-07",
                "due_principal": 1016.72,
                "has_interest": true,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 105.38950323,
                "tax_amount": 0.75507362,
                "total_amount": 412.33,
                "principal_amortization_amount": 306.94049677,
                "installment_number": 1
            },
            {
                "calendar_days": 31,
                "workdays": 20,
                "business_due_date": "2026-06-08",
                "due_date": "2026-06-07",
                "due_principal": 709.77950323,
                "has_interest": true,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 76.15320432,
                "tax_amount": 1.68155633,
                "total_amount": 412.33,
                "principal_amortization_amount": 336.17679568,
                "installment_number": 2
            },
            {
                "calendar_days": 30,
                "workdays": 22,
                "business_due_date": "2026-07-07",
                "due_date": "2026-07-07",
                "due_principal": 373.60270755,
                "has_interest": true,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 38.72729245,
                "tax_amount": 2.7878234,
                "total_amount": 412.33,
                "principal_amortization_amount": 373.60270755,
                "installment_number": 3
            }
        ],
        "external_contract_fees": [
            {
                "fee_type": "tac",
                "amount_type": "absolute",
                "amount": 0,
                "fee_amount": 0,
                "tax_amount": 0,
                "net_fee_amount": 0
            }
        ],
        "contract_fee_amount": 3.05,
        "external_contract_fee_amount": 0,
        "net_external_contract_fee_amount": 0,
        "contract_fees": [
            {
                "fee_type": "spread",
                "amount_type": "percentage",
                "amount": 0.3,
                "fee_amount": 3.05
            }
        ],
        "issue_amount": 1016.72,
        "disbursed_issue_amount": 1007.63,
        "assignment_amount": 1019.77
    }
}
```

---

# Cenários - Renegociação em Lote Crédito Clean

URL: /en/documentation/manual_credito_clean/renegociacao/cenarios

## Resumo

Este documento apresenta os principais cenários de renegociação em lote para operações Crédito Clean. Todos os cenários utilizam o `amortization_type: "present_amount"` e permitem aplicar descontos individuais por parcela através do campo `discount_amount` no objeto de cada installment.

:::info Lógica de Desconto por Parcela
É possível aplicar descontos diferentes em cada parcela individualmente. Basta adicionar o campo `discount_amount` (valor absoluto em reais) dentro do objeto da parcela desejada. Parcelas sem o campo `discount_amount` serão cobradas pelo valor presente integral.
:::

---

## Cenário 1: Empréstimo de 1 Parcela - Pagamento Padrão

O tomador possui um empréstimo Crédito Clean de 1 parcela e deseja quitá-lo pelo valor presente.

### Exemplo de Payload

```json
{
    "payment_type": "pix",
    "amortization_type": "present_amount",
    "proposal_due_date": "2026-04-10",
    "discount_percentage": 0,
    "reference_date": "2026-04-10",
    "request_control_key": "3571e292-3a83-4011-904d-20ee963022ef",
    "operations": [
        {
            "debt_key": "bf1175f4-750d-42b9-b264-5e7cd8c1c189",
            "installments": [
                {
                    "installment_key": "0298c572-7b6b-4db0-88d6-4bf1622d3e2d"
                }
            ]
        }
    ]
}
```

---

## Cenário 2: Empréstimo de 1 Parcela - Pagamento Sem Juros (Interest Free)

O tomador possui um empréstimo Crédito Clean de 1 parcela e negocia o pagamento sem juros. O desconto aplicado corresponde ao valor dos juros da parcela.

### Exemplo de Payload

```json
{
    "payment_type": "pix",
    "amortization_type": "present_amount",
    "proposal_due_date": "2026-04-10",
    "discount_percentage": 0,
    "reference_date": "2026-04-10",
    "request_control_key": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "operations": [
        {
            "debt_key": "bf1175f4-750d-42b9-b264-5e7cd8c1c189",
            "installments": [
                {
                    "installment_key": "0298c572-7b6b-4db0-88d6-4bf1622d3e2d",
                    "discount_amount": 54.19
                }
            ]
        }
    ]
}
```

:::info Observação
O valor do `discount_amount` (54.19) corresponde ao valor dos juros (`pre_fixed_amount`) da parcela. Dessa forma, o tomador paga apenas o valor do principal.
:::

---

## Cenário 3: Empréstimo de 1 Parcela - Pagamento Sem Juros e Sem IOF (Interest + IOF Free)

O tomador possui um empréstimo Crédito Clean de 1 parcela e negocia o pagamento sem juros e sem IOF. O desconto aplicado corresponde à soma dos juros e do IOF da parcela.

### Exemplo de Payload

```json
{
    "payment_type": "pix",
    "amortization_type": "present_amount",
    "proposal_due_date": "2026-04-10",
    "discount_percentage": 0,
    "reference_date": "2026-04-10",
    "request_control_key": "c3d4e5f6-a7b8-9012-cdef-123456789012",
    "operations": [
        {
            "debt_key": "bf1175f4-750d-42b9-b264-5e7cd8c1c189",
            "installments": [
                {
                    "installment_key": "0298c572-7b6b-4db0-88d6-4bf1622d3e2d",
                    "discount_amount": 55.44
                }
            ]
        }
    ]
}
```

:::info Observação
O valor do `discount_amount` (55.44) corresponde à soma dos juros (`pre_fixed_amount`: 54.19) + IOF (`tax_amount`: 1.25) da parcela. Dessa forma, o tomador paga apenas o valor de amortização do principal.
:::

---

## Cenário 4: Empréstimo de Múltiplas Parcelas com Desconto Individual

O tomador possui um empréstimo Crédito Clean com várias parcelas e negocia descontos diferentes para parcelas específicas. Parcelas sem o campo `discount_amount` são cobradas pelo valor presente integral.

### Exemplo de Payload

```json
{
    "payment_type": "pix",
    "amortization_type": "present_amount",
    "proposal_due_date": "2026-04-10",
    "discount_percentage": 0,
    "reference_date": "2026-04-10",
    "request_control_key": "d4e5f6a7-b8c9-0123-defa-234567890123",
    "operations": [
        {
            "debt_key": "bf1175f4-750d-42b9-b264-5e7cd8c1c189",
            "installments": [
                {
                    "installment_key": "0298c572-7b6b-4db0-88d6-4bf1622d3e2d",
                    "discount_amount": 20
                },
                {
                    "installment_key": "5e267f58-0f55-4b12-9582-63e0e9e082a8"
                },
                {
                    "installment_key": "5be492bf-b637-4999-986d-ecf423cc5dd1"
                },
                {
                    "installment_key": "15abfbfd-8608-45e9-abbb-a04c021dcf7b",
                    "discount_amount": 10
                },
                {
                    "installment_key": "c8eb83b3-5b0d-4326-947c-79279cdce2d6"
                }
            ]
        }
    ]
}
```

:::info Observação
Neste exemplo:
- Parcela 1: desconto de R$ 20,00
- Parcela 2: sem desconto (valor presente integral)
- Parcela 3: sem desconto (valor presente integral)
- Parcela 4: desconto de R$ 10,00
- Parcela 5: sem desconto (valor presente integral)
:::

---

## Cenário 5: Pagamento de Parcelas em Atraso (Overdue)

O tomador possui parcelas vencidas e deseja quitá-las. As parcelas em atraso já incluem multa e juros de mora calculados automaticamente. É possível aplicar descontos individuais para reduzir o valor.

### Exemplo de Payload

```json
{
    "payment_type": "pix",
    "amortization_type": "present_amount",
    "proposal_due_date": "2026-04-10",
    "discount_percentage": 0,
    "reference_date": "2026-04-10",
    "request_control_key": "e5f6a7b8-c9d0-1234-efab-345678901234",
    "operations": [
        {
            "debt_key": "bf1175f4-750d-42b9-b264-5e7cd8c1c189",
            "installments": [
                {
                    "installment_key": "0298c572-7b6b-4db0-88d6-4bf1622d3e2d",
                    "discount_amount": 15
                },
                {
                    "installment_key": "5e267f58-0f55-4b12-9582-63e0e9e082a8",
                    "discount_amount": 15
                }
            ]
        }
    ]
}
```

:::caution Atenção
Para parcelas em atraso, o valor presente já inclui multa (`fine_amount`) e juros de mora calculados automaticamente com base na `fine_configuration` do contrato. O `discount_amount` é aplicado sobre esse valor total.
:::

---

## Cenário 6: Múltiplas Operações com Desconto Individual por Parcela

O tomador possui empréstimos Crédito Clean em diferentes operações e deseja quitar parcelas de todas em um único pagamento, com descontos individuais.

### Exemplo de Payload

```json
{
    "payment_type": "pix",
    "amortization_type": "present_amount",
    "proposal_due_date": "2026-04-10",
    "discount_percentage": 0,
    "reference_date": "2026-04-10",
    "request_control_key": "f6a7b8c9-d0e1-2345-fabc-456789012345",
    "operations": [
        {
            "debt_key": "bf1175f4-750d-42b9-b264-5e7cd8c1c189",
            "installments": [
                {
                    "installment_key": "0298c572-7b6b-4db0-88d6-4bf1622d3e2d",
                    "discount_amount": 20
                },
                {
                    "installment_key": "5e267f58-0f55-4b12-9582-63e0e9e082a8"
                }
            ]
        },
        {
            "debt_key": "a2c3d4e5-860f-4b7a-9c1d-2e3f4a5b6c7d",
            "installments": [
                {
                    "installment_key": "7b8c9d0e-1f2a-3b4c-5d6e-7f8a9b0c1d2e",
                    "discount_amount": 30
                }
            ]
        }
    ]
}
```

---

## Objeto Installments - Campo Discount

| Campo | Tipo | Descrição | Obrigatório |
|---|---|---|---|
| `installment_key`* | string | Chave da parcela a ser renegociada | Sim |
| `discount_amount` | float | Valor de desconto em reais (R$) aplicado individualmente na parcela | Não |

:::info Sobre o campo discount_amount
- O campo `discount_amount` é **opcional** e pode ser informado em qualquer parcela
- O valor é um **desconto absoluto em reais** (não percentual)
- Parcelas sem o campo `discount_amount` são cobradas pelo **valor presente integral**
- O desconto é aplicado sobre o valor presente da parcela na `reference_date`
:::

---

## Tabela Resumo dos Cenários

| Cenário | Descrição | Discount |
|---|---|---|
| 1 parcela - padrão | Pagamento pelo valor presente | Sem desconto |
| 1 parcela - interest free | Desconto = valor dos juros | `discount_amount` = `pre_fixed_amount` |
| 1 parcela - interest + IOF free | Desconto = juros + IOF | `discount_amount` = `pre_fixed_amount` + `tax_amount` |
| Múltiplas parcelas | Descontos individuais por parcela | `discount_amount` por parcela |
| Parcelas em atraso | Parcelas vencidas com multa/mora | `discount_amount` opcional |
| Múltiplas operações | Operações diferentes em um lote | `discount_amount` por parcela |

---

## Regras Importantes

:::caution Regras da Renegociação em Lote
- Todas as operações devem ser do **mesmo emitente** e mesma **chave de integração**
- Limite de **50 operações** por lote
- Um único meio de pagamento (boleto/Pix) é gerado para o valor total do lote
- Se uma parcela incluída no lote for paga por fora antes da confirmação, o lote é **rejeitado**
- Se o pagamento não for realizado até a `proposal_due_date`, o lote é **rejeitado**
- O `amortization_type` utilizado é sempre `present_amount`
- O campo `discount_amount` é aplicado **individualmente por parcela**
:::

---

# Consulta - Renegociação em Lote Crédito Clean

URL: /en/documentation/manual_credito_clean/renegociacao/consulta

## Resumo

É possível consultar o status e detalhes de uma proposta de renegociação em lote, utilizando a `batch_proposal_key` ou a `request_control_key`.

---

## Consultar por Batch Proposal Key

ENDPOINT /renegotiation/batch_proposal/ BATCH-PROPOSAL-KEY
MÉTODO GET

### Path Params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `batch_proposal_key`* | string | Chave da proposta de renegociação em lote | UUID |

### Response

STATUS 200

Response Body

```json
{
    "batch_proposal_key": "ff5ad6dd-2087-4850-a3e8-b37634448b4e",
    "discount_percentage": 0,
    "discount_amount": 0,
    "amortization_type": "installment_payment",
    "payment_amount": 517.88,
    "requester_name": "Dante Ltda",
    "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
    "issuer_name": "Dante Ferrarini",
    "reference_date": "2026-04-08",
    "issuer_document_number": "31057466093",
    "batch_proposal_status": "pending_payment",
    "proposal_due_date": "2026-04-15",
    "payment_type": "pix",
    "request_control_key": "94b31045-c8e7-45be-a88d-2ae25c5df5db",
    "origin_key": null,
    "operations": [
        {
            "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
            "contract_number": "DWF1761222116",
            "payment_amount": 517.88,
            "discount_amount": 0,
            "origin_key": null,
            "affected_installments": [
                {
                    "installment_key": "1dea396f-beb1-4df3-9822-35800b4c095a",
                    "due_date": "2026-05-07",
                    "principal_amount": 491.49,
                    "interest_amount": 52.4,
                    "fine_amount": 0,
                    "total_amount": 543.89,
                    "present_amount": 517.88,
                    "paid_amount": 517.88,
                    "principal_amortization_payment_amount": 491.49,
                    "prefixed_interest_payment_amount": 26.39,
                    "fine_payment_amount": 0,
                    "discount_amount": 0
                }
            ],
            "remaining_installments": [
                {
                    "installment_key": "370e73d1-55d8-431e-9b22-d08fb8297999",
                    "due_date": "2026-06-07",
                    "principal_amount": 516.13,
                    "interest_amount": 27.76,
                    "fine_amount": 0,
                    "total_amount": 543.89
                }
            ],
            "debt_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c"
        }
    ],
    "payment": {
        "digitable_line": null,
        "qr_code_url": "00020126930014br.gov.bcb.pix2571qrcode-h.sandbox.qitech.app/bacen/cobv/acaeb341e1264cde99b93e247e12b3725204000053039865802BR5925QISOCIEDADEDECREDITODIRET6008SaoPaulo61080145200062070503***63043AD0",
        "qr_code_key": "acaeb341-e126-4cde-99b9-3e247e12b372",
        "bank_slip_key": null,
        "paid_method_type": "pix",
        "source_account_key": null,
        "payment_data": {
            "creditor_bank_account_key": "6108dd45-580d-48c4-b3bb-74c1e843be49",
            "batch_renegotiation_proposal_key": "ff5ad6dd-2087-4850-a3e8-b37634448b4e"
        }
    }
}
```

---

## Consultar por Request Control Key

ENDPOINT /renegotiation/batch_proposal/request_control_key/ REQUEST-CONTROL-KEY
MÉTODO GET

### Path Params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `request_control_key`* | string | Chave de controle da requisição | UUID |

### Response

A resposta segue o mesmo formato da consulta por `batch_proposal_key`.

---

## Listar Renegociações em Lote

ENDPOINT /renegotiation/batch_proposal
MÉTODO GET

### Query Params

| Campo | Tipo | Descrição |
|---|---|---|
| `batch_proposal_status` | string | Filtrar por status da proposta em lote |
| `issuer_document_number` | string | Filtrar por CPF/CNPJ do emitente |
| `request_control_key` | string | Filtrar por chave de controle |

### Response

STATUS 200

Response Body

```json
{
    "data": [
        {
            "batch_proposal_key": "ff5ad6dd-2087-4850-a3e8-b37634448b4e",
            "discount_percentage": 0,
            "discount_amount": 0,
            "amortization_type": "installment_payment",
            "payment_amount": 517.88,
            "requester_name": "Dante Ltda",
            "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
            "issuer_name": "Dante Ferrarini",
            "reference_date": "2026-04-08",
            "issuer_document_number": "31057466093",
            "batch_proposal_status": "pending_payment",
            "proposal_due_date": "2026-04-15",
            "payment_type": "pix",
            "request_control_key": "94b31045-c8e7-45be-a88d-2ae25c5df5db",
            "origin_key": null
        }
    ],
    "pagination": {
        "current_page": 1,
        "next_page": 2,
        "rows_per_page": 10,
        "total_pages": 150,
        "total_rows": 1495
    }
}
```

---

## Cancelar uma Renegociação em Lote

ENDPOINT /renegotiation/batch_proposal/ BATCH-PROPOSAL-KEY
MÉTODO DELETE

### Path Params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `batch_proposal_key`* | string | Chave da proposta de renegociação em lote a ser cancelada | UUID |

### Response

STATUS 204

Response Body

```json
{}
```

:::caution Atenção
Somente propostas com status `pending_payment` podem ser canceladas.
:::

---

# Proposta de Renegociação em Lote - Crédito Clean

URL: /en/documentation/manual_credito_clean/renegociacao/proposta

## Resumo

Após simular os valores, é possível criar uma proposta de renegociação em lote para múltiplas operações Crédito Clean. A proposta gera um único meio de pagamento (boleto e/ou Pix) que cobre todas as operações incluídas no lote.

Para o tipo de amortização **`present_amount`**, cada parcela informada em `operations[].installments[]` deve incluir **`paid_amount`** (valor pago/alocado naquela parcela) e **`discount_amount`** (desconto em R$ aplicado na parcela), além de **`installment_key`**.

:::caution Atenção
A renegociação em lote só pode ser criada com operações de um mesmo emitente e mesma chave de integração. Há um limite de **50 operações** para cada renegociação em lote.
:::

## Request

ENDPOINT /renegotiation/batch_proposal
MÉTODO POST

:::warning Atenção
Os campos `discount_amount` e `discount_percentage` **NÃO** podem ser enviados juntos no mesmo payload (nível raiz).
:::

:::info Nota
Na raiz do body, `discount_amount` e `discount_percentage` são alternativas para desconto global sobre o valor presente. Já os campos **`paid_amount`** e **`discount_amount`** dentro de cada objeto em `operations[].installments[]` definem a composição por parcela quando `amortization_type` é **`present_amount`** (são obrigatórios nesse modo e não conflitam com a regra da raiz).
:::

Request Body

```json
{
    "amortization_type": "present_amount",
    "reference_date": "2026-04-08",
    "proposal_due_date": "2026-04-15",
    "discount_percentage": 0.0,
    "payment_type": "pix",
    "request_control_key": "94b31045-c8e7-45be-a88d-2ae25c5df5db",
    "operations": [
        {
            "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
            "installments": [
                {
                    "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88",
                    "paid_amount": 500,
                    "discount_amount": 50
                }
            ]
        },
        {
            "debt_key": "2cbfb9b1-1fdb-5f8d-9967-b338e5eb83f9",
            "installments": [
                {
                    "installment_key": "2ef25ed8-7124-44f5-9e3d-1d1a7196166e",
                    "paid_amount": 150,
                    "discount_amount": 10
                }
            ]
        }
    ]
}
```

### Body Params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `amortization_type`* | string | Tipo de amortização | **[Enumeradores Amortization Type](#enumeradores-amortization-type)** |
| `reference_date`* | string | Data de referência para cálculo do valor presente (D+1) | 10 |
| `proposal_due_date`* | string | Data de vencimento da proposta de renegociação | 10 |
| `payment_type`* | string | Tipo de pagamento | **[Enumeradores Payment Type](#enumeradores-payment-type)** |
| `request_control_key` | string | Chave de controle para rastreamento e identificação única (opcional) | UUID |
| `discount_percentage` | float | Percentual de desconto sobre o valor presente | 10 |
| `discount_amount` | float | Valor de desconto sobre o valor presente | 10 |
| `operations`* | array | Lista de operações a serem renegociadas | **[Objeto Operations](#objeto-operations)** |

### Objeto Operations

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `debt_key`* | string | Chave única da operação de crédito (DEBT-KEY) | UUID |
| `installments`* | array | Parcelas a serem renegociadas | **[Objeto Installments](#objeto-installments)** |

### Objeto Installments

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `installment_key`* | string | Chave da parcela a ser renegociada | UUID |
| `paid_amount` | float | Valor pago (ou alocado) na parcela, em reais (R$). Obrigatório quando `amortization_type` é **`present_amount`**. | 15,2 |
| `discount_amount` | float | Valor de desconto em reais (R$) aplicado na parcela. Obrigatório quando `amortization_type` é **`present_amount`** (use `0` se não houver desconto). Para outros tipos de amortização, permanece opcional por parcela. | 15,2 |

### Enumeradores Payment Type

| Campo | Descrição |
|---|---|
| `bank_slip` | Pagamento via boleto bancário (gera boleto e Pix) |
| `pix` | Pagamento via Pix (gera apenas Pix) |
| `internal` | Pagamento via transferência interna (processamento automático) |
| `manual` | Pagamento feito de forma manual (não gera forma de pagamento) |

### Enumeradores Amortization Type

| Campo | Descrição |
|---|---|
| **present_amount** | Renegociação com composição por valor presente por parcela. Em cada item de `installments[]` é obrigatório informar `installment_key`, **`paid_amount`** e **`discount_amount`**. |
| **installment_payment** | Renegociação para pagamento de parcelas específicas. Requer `installment_key` de cada parcela. |
| **overdue_installment_payment** | Renegociação direcionada para pagamento de parcelas em atraso. Requer `installment_key` de cada parcela. |

## Response

STATUS 201

Response Body

```json
{
    "batch_proposal_key": "ff5ad6dd-2087-4850-a3e8-b37634448b4e",
    "discount_percentage": 0,
    "discount_amount": 0,
    "amortization_type": "present_amount",
    "payment_amount": 517.88,
    "requester_name": "Dante Ltda",
    "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
    "issuer_name": "Dante Ferrarini",
    "reference_date": "2026-04-08",
    "issuer_document_number": "31057466093",
    "batch_proposal_status": "pending_payment",
    "proposal_due_date": "2026-04-15",
    "payment_type": "pix",
    "request_control_key": "94b31045-c8e7-45be-a88d-2ae25c5df5db",
    "origin_key": null,
    "operations": [
        {
            "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
            "contract_number": "DWF1761222116",
            "payment_amount": 517.88,
            "discount_amount": 0,
            "origin_key": null,
            "affected_installments": [
                {
                    "installment_key": "1dea396f-beb1-4df3-9822-35800b4c095a",
                    "due_date": "2026-05-07",
                    "principal_amount": 491.49,
                    "interest_amount": 52.4,
                    "fine_amount": 0,
                    "total_amount": 543.89,
                    "present_amount": 517.88,
                    "paid_amount": 517.88,
                    "principal_amortization_payment_amount": 491.49,
                    "prefixed_interest_payment_amount": 26.39,
                    "fine_payment_amount": 0,
                    "discount_amount": 0
                }
            ],
            "remaining_installments": [
                {
                    "installment_key": "370e73d1-55d8-431e-9b22-d08fb8297999",
                    "due_date": "2026-06-07",
                    "principal_amount": 516.13,
                    "interest_amount": 27.76,
                    "fine_amount": 0,
                    "total_amount": 543.89
                }
            ],
            "debt_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c"
        }
    ],
    "payment": {
        "digitable_line": null,
        "qr_code_url": "00020126930014br.gov.bcb.pix2571qrcode-h.sandbox.qitech.app/bacen/cobv/acaeb341e1264cde99b93e247e12b3725204000053039865802BR5925QISOCIEDADEDECREDITODIRET6008SaoPaulo61080145200062070503***63043AD0",
        "qr_code_key": "acaeb341-e126-4cde-99b9-3e247e12b372",
        "bank_slip_key": null,
        "paid_method_type": "pix",
        "source_account_key": null,
        "payment_data": {
            "creditor_bank_account_key": "6108dd45-580d-48c4-b3bb-74c1e843be49",
            "batch_renegotiation_proposal_key": "ff5ad6dd-2087-4850-a3e8-b37634448b4e"
        }
    }
}
```

:::info Importante
Salve a **batch_proposal_key** retornada na resposta. Ela será necessária para consultar o status da renegociação em lote e para receber os webhooks de pagamento.
:::

---

# Simulação - Renegociação em Lote Crédito Clean

URL: /en/documentation/manual_credito_clean/renegociacao/simulacao

## Resumo

Antes de criar uma proposta de renegociação, é possível simular os valores da renegociação em lote para operações Crédito Clean. A simulação permite visualizar as parcelas afetadas, valores de desconto e o montante final a ser pago para múltiplas operações simultaneamente.

Com **`amortization_type`** igual a **`present_amount`**, envie em cada parcela de `operations[].installments[]` os campos **`paid_amount`**, **`discount_amount`** e **`installment_key`**, como na proposta em lote.

:::caution Atenção
A renegociação em lote só pode ser criada com operações de um mesmo emitente e mesma chave de integração. Há um limite de **50 operações** para cada renegociação em lote.
:::

## Request

ENDPOINT /renegotiation/batch_proposal_simulation
MÉTODO POST

:::warning Atenção
Os campos `discount_amount` e `discount_percentage` **NÃO** podem ser enviados juntos no mesmo payload (nível raiz).
:::

:::info Nota
Na raiz, `discount_amount` e `discount_percentage` são alternativas para desconto global. Os campos **`paid_amount`** e **`discount_amount`** em `operations[].installments[]` são usados com **`present_amount`** por parcela e não substituem a regra da raiz.
:::

Request Body

```json
{
    "amortization_type": "present_amount",
    "reference_date": "2026-04-08",
    "discount_percentage": 0.0,
    "operations": [
        {
            "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
            "installments": [
                {
                    "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88",
                    "paid_amount": 500,
                    "discount_amount": 50
                }
            ]
        },
        {
            "debt_key": "2cbfb9b1-1fdb-5f8d-9967-b338e5eb83f9",
            "installments": [
                {
                    "installment_key": "2ef25ed8-7124-44f5-9e3d-1d1a7196166e",
                    "paid_amount": 150,
                    "discount_amount": 10
                }
            ]
        }
    ]
}
```

### Body Params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `amortization_type`* | string | Tipo de amortização | **[Enumeradores Amortization Type](#enumeradores-amortization-type)** |
| `reference_date`* | string | Data de referência para cálculo do valor presente (precisa ser D+1) | 10 |
| `discount_percentage` | float | Percentual de desconto sobre o valor presente ((1 - percentual) * Valor Presente) | 10 |
| `discount_amount` | float | Valor de desconto aplicado sobre o valor presente | 10 |
| `operations`* | array | Lista de operações a serem renegociadas | **[Objeto Operations](#objeto-operations)** |

### Objeto Operations

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `debt_key`* | string | Chave única da operação de crédito (DEBT-KEY) | UUID |
| `installments`* | array | Parcelas a serem renegociadas | **[Objeto Installments](#objeto-installments)** |

### Objeto Installments

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `installment_key`* | string | Chave da parcela a ser renegociada | UUID |
| `paid_amount` | float | Valor pago (ou alocado) na parcela, em reais (R$). Obrigatório quando `amortization_type` é **`present_amount`**. | 15,2 |
| `discount_amount` | float | Valor de desconto em reais (R$) na parcela. Obrigatório quando `amortization_type` é **`present_amount`** (use `0` se não houver desconto). Opcional nos demais tipos. | 15,2 |

### Enumeradores Amortization Type

| Campo | Descrição |
|---|---|
| **present_amount** | Simulação com valor presente por parcela. Em cada `installments[]` é obrigatório `installment_key`, **`paid_amount`** e **`discount_amount`**. |
| **installment_payment** | Renegociação para pagamento de parcelas específicas enviadas no payload. Requer `installment_key` de cada parcela. |
| **overdue_installment_payment** | Renegociação direcionada para pagamento de parcelas em atraso. Requer `installment_key` de cada parcela. |

## Response

STATUS 200

Response Body

```json
{
    "batch_proposal_key": "7423c701-3578-4733-8f30-81ab60afdb6d",
    "discount_percentage": 0,
    "discount_amount": 0,
    "amortization_type": "present_amount",
    "payment_amount": 517.88,
    "requester_name": "Dante Ltda",
    "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
    "issuer_name": "Dante Ferrarini",
    "reference_date": "2026-04-08",
    "issuer_document_number": "31057466093",
    "operations": [
        {
            "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
            "contract_number": "DWF1761222116",
            "payment_amount": 517.88,
            "discount_amount": 0,
            "origin_key": null,
            "affected_installments": [
                {
                    "installment_key": "1dea396f-beb1-4df3-9822-35800b4c095a",
                    "due_date": "2026-05-07",
                    "principal_amount": 491.4903841,
                    "interest_amount": 52.3996159,
                    "fine_amount": 0,
                    "total_amount": 543.89,
                    "present_amount": 517.88,
                    "paid_amount": 517.88,
                    "principal_amortization_payment_amount": 491.49,
                    "prefixed_interest_payment_amount": 26.39,
                    "fine_payment_amount": 0,
                    "discount_amount": 0
                }
            ],
            "remaining_installments": [
                {
                    "installment_key": "370e73d1-55d8-431e-9b22-d08fb8297999",
                    "due_date": "2026-06-07",
                    "principal_amount": 516.1296159,
                    "interest_amount": 27.7603841,
                    "fine_amount": 0,
                    "total_amount": 543.89
                }
            ],
            "debt_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c"
        }
    ]
}
```

### Campos de Desconto

Desconto percentual

```json
{
    "discount_percentage": 0.5
}
```

Desconto absoluto

```json
{
    "discount_amount": 200
}
```

---

# Webhooks - Renegociação em Lote Crédito Clean

URL: /en/documentation/manual_credito_clean/renegociacao/webhooks

## Resumo

Após a criação de uma proposta de renegociação, o sistema enviará webhooks para notificar sobre o pagamento ou rejeição da proposta. Esta página cobre tanto as propostas individuais (`renegotiation.proposal`) quanto as propostas em lote (`renegotiation.batch_proposal`).

---

## Webhook de Pagamento — Proposta Individual

Enviado quando uma proposta de renegociação individual é paga.

WEBHOOK_TYPE renegotiation.proposal
STATUS paid

Webhook Body

```json
{
    "webhook_type": "renegotiation.proposal",
    "key": "<PROPOSAL-KEY>",
    "event_datetime": "<DATA E HORA DO ENVIO DO WEBHOOK>",
    "status": "paid",
    "data": {
        "paid_method_type": "<METODO DE PAGAMENTO>",
        "paid_in": {
            "code_number": "<CODIGO DO BANCO LIQUIDANTE>",
            "ispb": "<ISPB DO BANCO LIQUIDANTE>",
            "name": "<NOME DO BANCO LIQUIDANTE>"
        }
    }
}
```

### Campos do Webhook de Proposta Individual

| Campo | Tipo | Descrição |
|---|---|---|
| **webhook_type** | string | Tipo do webhook: `renegotiation.proposal` |
| **key** | string | Chave da proposta de renegociação (PROPOSAL-KEY) |
| **event_datetime** | string | Data e hora do envio do webhook |
| **status** | string | Status do evento: `paid` |
| **data.paid_method_type** | string | Método de pagamento utilizado |
| **data.paid_in.code_number** | string | Código do banco liquidante |
| **data.paid_in.ispb** | string | ISPB do banco liquidante |
| **data.paid_in.name** | string | Nome do banco liquidante |

### Enumeradores paid_method_type

| Enumerador | Descrição |
|---|---|
| **bank_slip** | Pagamento realizado por boleto |
| **pix** | Pagamento realizado por Pix |

---

## Webhooks — Proposta em Lote

Após a criação de uma proposta de renegociação em lote, o sistema enviará webhooks para notificar sobre o pagamento ou rejeição da proposta.

:::danger Atenção!
Os webhooks não devem ser mapeados de forma estrita. Novos campos podem ser adicionados ao payload sem aviso prévio.
:::

## Webhook de Pagamento

Este webhook é enviado quando o pagamento da proposta de renegociação em lote é confirmado.

WEBHOOK_TYPE renegotiation.batch_proposal
STATUS paid

Webhook Body

```json
{
    "webhook_type": "renegotiation.batch_proposal",
    "key": "<BATCH-PROPOSAL-KEY>",
    "event_datetime": "<DATA E HORA DO ENVIO DO WEBHOOK>",
    "status": "paid",
    "data": {
        "paid_method_type": "<METODO DE PAGAMENTO>",
        "paid_in": {
            "code_number": "<CODIGO DO BANCO LIQUIDANTE>",
            "ispb": "<ISPB DO BANCO LIQUIDANTE>",
            "name": "<NOME DO BANCO LIQUIDANTE>"
        }
    }
}
```

### Campos do Webhook de Pagamento

| Campo | Tipo | Descrição |
|---|---|---|
| **webhook_type** | string | Tipo do webhook: `renegotiation.batch_proposal` |
| **key** | string | Chave da proposta de renegociação em lote (BATCH-PROPOSAL-KEY) |
| **event_datetime** | string | Data e hora do envio do webhook |
| **status** | string | Status do evento: `paid` |
| **data.paid_method_type** | string | Método de pagamento utilizado |
| **data.paid_in.code_number** | string | Código do banco liquidante |
| **data.paid_in.ispb** | string | ISPB do banco liquidante |
| **data.paid_in.name** | string | Nome do banco liquidante |

### Enumeradores paid_method_type

| Enumerador | Descrição |
|---|---|
| **bank_slip** | Pagamento realizado por boleto |
| **pix** | Pagamento realizado por Pix |

---

## Webhook de Rejeição

Uma renegociação em lote pode ser rejeitada pelo decurso de prazo do pagamento ou por um pagamento de parcela por fora da renegociação.

WEBHOOK_TYPE renegotiation.batch_proposal
STATUS rejected

Webhook Body

```json
{
    "webhook_type": "renegotiation.batch_proposal",
    "key": "<BATCH-PROPOSAL-KEY>",
    "event_datetime": "<DATA E HORA DO ENVIO DO WEBHOOK>",
    "status": "rejected",
    "data": {}
}
```

:::caution Atenção
Uma renegociação em lote pode ser rejeitada por:
- **Decurso de prazo**: o pagamento não foi realizado dentro da data de vencimento (`proposal_due_date`)
- **Pagamento externo**: uma parcela incluída na renegociação foi paga por fora antes da confirmação do pagamento do lote
:::

---

## Dados de Pagamento na Parcela

Quando uma parcela é paga através de uma renegociação em lote, os dados de pagamento são registrados na parcela:

Payment Data

```json
{
    "batch_renegotiation_proposal_key": "f9addba2-ec91-41bf-a150-c59eb1c3fbef",
    "paid_in": {
        "ispb": "18236120",
        "name": "NU PAGAMENTOS - IP",
        "code_number": 260
    },
    "resource_account_key": "ea44b9f2-ad00-4896-b8a3-b1a3da28a72f"
}
```

### Campos dos Dados de Pagamento

| Campo | Tipo | Descrição |
|---|---|---|
| **batch_renegotiation_proposal_key** | string | Chave da proposta de renegociação em lote que originou o pagamento |
| **paid_in.ispb** | string | ISPB do banco utilizado para o pagamento |
| **paid_in.name** | string | Nome do banco utilizado para o pagamento |
| **paid_in.code_number** | integer | Código do banco utilizado para o pagamento |
| **resource_account_key** | string | Chave da conta de recursos que recebeu o pagamento |

---

# Scripts de Integração - Crédito Clean

URL: /en/documentation/manual_credito_clean/scripts_integracao

## Resumo

Disponibilizamos scripts Python prontos para uso que demonstram o fluxo completo de integração Crédito Clean com a API Sandbox da QI Tech. Cada script corresponde a uma chamada de API testada e validada.

**Todos os payloads e respostas exibidos nesta documentação refletem as respostas reais da API Sandbox, obtidas através destes scripts.**

## Download

Os scripts estão disponíveis no repositório do projeto:

📦 Baixar pacote Python completo

## Pre-requisitos

- Python 3.8+
- Dependencias: `requests`, `python-jose`, `python-dotenv`
- Arquivo `_local.env` com suas credenciais Sandbox:
  - `API_KEY` - Sua chave de API
  - `QI_PUBLIC_KEY` - Chave publica da QI Tech
  - `CLIENT_PRIVATE_KEY` - Sua chave privada EC (PEM)

## Scripts Disponiveis

### Emissao

| # | Script | Endpoint | Metodo | Descricao |
|---|--------|----------|--------|-----------|
| 01 | `01_issuance_simulation.py` | `/v2/credit_operation/simulation` | POST | Simular uma operacao de credito antes da emissao |
| 02 | `02_issuance_issuance.py` | `/signed_debt` | POST | Emitir a divida com assinatura de contrato via opt-in |
| 03 | `03_issuance_query.py` | `/v2/credit_operation/requester_identifier_key/{key}` | GET | Consultar a operacao emitida |

### Estorno

| # | Script | Endpoint | Metodo | Descricao |
|---|--------|----------|--------|-----------|
| 04 | `04_reversal_cancel_before_disbursement.py` | `/debt/{debt_key}/cancel` | PATCH | Cancelar operacao antes do desembolso |
| 05 | `05_reversal_cancel_after_disbursement.py` | `/debt/reversal` | POST | Estornar operacao apos desembolso (gera Pix de devolucao) |

### Renegociacao

| # | Script | Endpoint | Metodo | Descricao |
|---|--------|----------|--------|-----------|
| 06 | `06_renegotiation_simulation.py` | `/renegotiation/batch_proposal_simulation` | POST | Simular renegociacao em lote |
| 07 | `07_renegotiation_proposal.py` | `/renegotiation/batch_proposal` | POST | Criar proposta de renegociacao em lote |
| 08 | `08_renegotiation_query.py` | `/renegotiation/batch_proposal/{key}` | GET | Consultar proposta por chave |
| 09 | `09_renegotiation_list.py` | `/renegotiation/batch_proposal` | GET | Listar todas as propostas |
| 10 | `10_renegotiation_cancel.py` | `/renegotiation/batch_proposal/{key}` | DELETE | Cancelar proposta pendente |

### Refinanciamento

| # | Script | Endpoint | Metodo | Descricao |
|---|--------|----------|--------|-----------|
| 11 | `11_refinancing_present_value.py` | `/debt` | GET | Consultar valor presente para calculo de refinanciamento |
| 12 | `12_refinancing_simulation.py` | `/debt_simulation` | POST | Simular operacao de refinanciamento |
| 13 | `13_refinancing_issuance.py` | `/signed_debt` | POST | Criar refinanciamento (emite nova divida, liquida a anterior) |

## Como Usar

1. Baixe os scripts do repositorio
2. Crie um arquivo `_local.env` com suas credenciais Sandbox
3. Execute os scripts em ordem numerica
4. Atualize as chaves (`DEBT_KEY`, `BATCH_PROPOSAL_KEY`, etc.) entre os scripts conforme necessario

:::info Sobre os exemplos da documentacao
Cada script inclui a resposta real da API como bloco de comentario no final do arquivo. Esses exemplos sao a fonte de verdade para os payloads exibidos nas paginas desta documentacao.
:::

---

# Emissão de Dívida PJ com Assinatura Imediata

URL: /en/documentation/manual_emissao_pj_signed_debt/emissao_signed_debt_pj

Este endpoint realiza a emissão da dívida para uma **pessoa jurídica** e processa a assinatura do contrato via opt-in em uma única chamada. O desembolso ocorre na data informada no campo `disbursement_date`, que pode ser diferente da data de emissão.

Não é necessário realizar o cadastro prévio do tomador: basta fornecer os dados cadastrais da empresa e de seus representantes legais no momento da requisição de emissão.

:::info Pré-requisito — upload de documentos
Os documentos da empresa e dos representantes (estatuto/contrato social, documentos de identificação, etc.) devem ser enviados previamente via [upload de documentos](../upload_de_documentos/upload_de_documentos). Cada upload retorna uma `document_key` (UUID), que deve ser referenciada nos campos correspondentes do request.
:::

:::danger Atenção — Onboarding e Antifraude
A QI Tech oferece uma solução de Onboarding de novos clientes e Antifraude.

[Confira aqui a documentação das APIs deste serviço.](https://www.zaig.com.br/en/devcenter.html)

Para receber uma cotação, entre em contato com nosso time comercial: comercial@qitech.com.br ou (11) 3522-1301
:::

O formato de assinatura do header e do body desta requisição é descrito em detalhes [aqui](../primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_v2).

## Simulação de dívida

Antes de emitir, é possível **simular** os valores da operação de crédito. A simulação segue o mesmo padrão da emissão, porém **não exige** os dados cadastrais do tomador nem a conta de desembolso — basta informar `borrower.person_type` (`legal` para PJ) e o objeto `financial`. O exemplo abaixo simula com base no **valor desembolsado** (`disbursed_amount` + `number_of_installments`).

ENDPOINT /debt_simulation
MÉTODO POST

### Request

Request Body

```json
{
    "borrower": {
        "person_type": "legal"
    },
    "financial": {
        "interest_type": "pre_price_days",
        "disbursement_date": "2026-04-07",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "disbursed_amount": 10000,
        "monthly_interest_rate": 0.03,
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "number_of_installments": 2,
        "principal_grace_period": 0
    }
}
```

#### Campos do Request

| Campo | Tipo | Descrição |
|---|---|---|
| borrower.person_type* | enum | Natureza jurídica do tomador — usar `legal` para PJ |
| financial.interest_type* | enum | Método de amortização — **[Enumerador Interest Type](#enumerador-interest-type)** |
| financial.credit_operation_type* | enum | Tipo do contrato de crédito — **[Enumerador Credit Operation Type](#enumerador-credit-operation-type)** |
| financial.disbursed_amount* | float | Valor desembolsado da operação |
| financial.monthly_interest_rate* | float | Taxa de juros mensal pré-fixada (em decimal) |
| financial.number_of_installments* | int | Número de parcelas |
| financial.disbursement_date | date | Data do desembolso (YYYY-MM-DD) |
| financial.interest_grace_period | int | Carência de juros (em meses) |
| financial.principal_grace_period | int | Carência do principal (em meses) |
| financial.fine_configuration | object | Configuração de multa e mora — **[Objeto Fine Configuration](#objeto-fine-configuration)** |

### Response

Response Body

```json
{
    "type": "debt",
    "key": "bf84379c-d4cf-4f16-a63c-865c129e6fce",
    "status": "finished",
    "event_datetime": "2026-04-07 23:59:28",
    "data": {
        "interest_type": "pre_price_days",
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "principal_grace_period": 0,
        "prefixed_interest_rate": {
            "interest_base": "calendar_days",
            "annual_rate": 0.42576089,
            "monthly_rate": 0.03,
            "daily_rate": 0.00097227
        },
        "issue_date": "2026-04-07",
        "number_of_installments": 2,
        "final_disbursement_amount": 10000,
        "total_pre_fixed_amount": 453.94,
        "iof_amount": 51.07,
        "cet": 0.0335,
        "annual_cet": 0.4851,
        "disbursement_date": "2026-04-07",
        "issue_amount": 10076.2,
        "disbursed_issue_amount": 10000,
        "assignment_amount": 10106.4,
        "installments": [
            {
                "calendar_days": 30,
                "workdays": 20,
                "business_due_date": "2026-05-07",
                "due_date": "2026-05-07",
                "due_principal": 10076.2,
                "has_interest": true,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 52.4,
                "tax_amount": 12.49,
                "total_amount": 5226.97,
                "principal_amortization_amount": 5174.57,
                "installment_number": 1
            },
            {
                "calendar_days": 31,
                "workdays": 20,
                "business_due_date": "2026-06-08",
                "due_date": "2026-06-07",
                "due_principal": 4901.63,
                "has_interest": true,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 27.76,
                "tax_amount": 26.09,
                "total_amount": 5226.97,
                "principal_amortization_amount": 4901.63,
                "installment_number": 2
            }
        ]
    }
}
```

#### Campos do Response

A simulação não gera dívida nem retorna **DEBT-KEY**: o campo `key` é apenas o identificador da simulação e o `status` é `finished`. Os valores ficam dentro de `data`.

| Campo | Tipo | Descrição |
|---|---|---|
| disbursed_issue_amount | float | Valor desembolsado informado na simulação |
| final_disbursement_amount | float | Valor efetivamente desembolsado para o tomador |
| issue_amount | float | Valor de emissão/nominal da operação |
| assignment_amount | float | Valor de aquisição (cessão) da operação |
| cet | float | Custo Efetivo Total mensal (em decimal) |
| annual_cet | float | Custo Efetivo Total anual (em decimal) |
| iof_amount | float | Valor total do IOF |
| total_pre_fixed_amount | float | Total de juros pré-fixados da operação |
| prefixed_interest_rate | object | Taxa de juros nominal (anual, diária, mensal e base de cálculo) |
| installments | array | Parcelas simuladas (data, valor, amortização, juros e IOF de cada parcela) |

## Emissão de dívida

ENDPOINT /signed_debt
MÉTODO POST

Testar no Playground

### Request

#### Payload recomendado (PJ + PIX)

Este é o corpo recomendado para emitir uma dívida de pessoa jurídica com desembolso via PIX. Além dos dados cadastrais, ele inclui a **evidência de assinatura (opt-in)** em `additional_data.contract.signatures`, que é necessária para a emissão ser concluída com sucesso.

```json
{
    "borrower": {
        "person_type": "legal",
        "name": "RAZAO SOCIAL EMPRESA",
        "phone": { "country_code": "055", "area_code": "11", "number": "991112222" },
        "address": {
            "street": "Rua Gilberto Sabino",
            "number": "215",
            "neighborhood": "Pinheiros",
            "city": "São Paulo",
            "state": "SP",
            "postal_code": "05425020"
        },
        "company_document_number": "80282008000127",
        "company_statute": "2d9b7271-8dfd-43d5-9aee-d2814b98cb9e",
        "company_representatives": [
            {
                "person_type": "natural",
                "name": "NOME DO REPRESENTANTE",
                "phone": { "country_code": "055", "area_code": "11", "number": "990121234" },
                "address": {
                    "street": "Rua Gilberto Sabino",
                    "number": "215",
                    "neighborhood": "Pinheiros",
                    "city": "São Paulo",
                    "state": "SP",
                    "postal_code": "05425020"
                },
                "is_pep": false,
                "individual_document_number": "31057466093"
            }
        ]
    },
    "financial": {
        "disbursed_amount": 10000,
        "interest_type": "pre_price_days",
        "credit_operation_type": "ccb",
        "number_of_installments": 1,
        "interest_grace_period": 0,
        "principal_grace_period": 0,
        "monthly_interest_rate": 0.03,
        "disbursement_date": "2026-06-23",
        "first_due_date": "2026-07-23",
        "fine_configuration": {
            "contract_fine_rate": 0.02,
            "monthly_rate": 0.01,
            "interest_base": "calendar_days_365"
        }
    },
    "additional_data": {
        "contract": {
            "contract_number": "STN92924220",
            "signatures": [
                {
                    "signer": {
                        "name": "NOME DO REPRESENTANTE",
                        "email": "representante@test.com",
                        "document_number": "32402502000135",
                        "phone": { "country_code": "011", "area_code": "55", "number": "991112222" }
                    },
                    "signature": {
                        "ip_address": "192.168.1.1",
                        "signature_file": {
                            "file_type": "pdf",
                            "file_url": "https://qitech.com.br/signature.pdf"
                        }
                    }
                }
            ]
        }
    },
    "disbursement_bank_accounts": [
        {
            "pix_key": "2f205c99-3161-4120-badd-854039d12de6",
            "pix_transfer_type": "key"
        }
    ],
    "purchaser_document_number": "32402502000135",
    "requester_identifier_key": "3eb8d228-ed17-4352-a081-1d1f3a35334c",
    "simplified": true
}
```

:::info Observações importantes
- O bloco `additional_data.contract.signatures` (opt-in) é **necessário** para a emissão. Enviar `additional_data` vazio (`{}`) faz a emissão falhar.
- Envie `simplified: true` para utilizar o fluxo simplificado de emissão.
- `monthly_interest_rate` e `disbursement_bank_accounts` são obrigatórios: sem a taxa o cálculo pré-fixado não é possível, e sem a conta não há desembolso.
- `financial.first_due_date` define a data de vencimento da primeira parcela; junto com `disbursement_date`, determina a agenda de pagamento.
- `postal_code` deve ter **8 dígitos, sem traço**.
- `company_representatives[].address` é **obrigatório**.
- `interest_grace_period` e `principal_grace_period` são **obrigatórios** neste modo (use `0` quando não houver carência).
:::

O exemplo completo abaixo inclui também os campos cadastrais adicionais da empresa (`company_type`, `cnae_code`, `foundation_date`, `trading_name`) e dos representantes.

Request Body

**Valor líquido**

```json
{
    "borrower": {
        "name": "RAZAO SOCIAL EMPRESA",
        "email": "emailempresa@email.com",
        "phone": {
            "number": "991112222",
            "area_code": "11",
            "country_code": "055"
        },
        "is_pep": false,
        "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": "single",
                "attached_documents_list": [],
                "individual_document_number": "31057466093",
                "document_identification_number": "20202020200"
            }
        ]
    },
    "financial": {
        "interest_type": "pre_price_days",
        "disbursement_date": "2026-04-07",
        "first_due_date": "2026-05-07",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "disbursed_amount": 10000,
        "monthly_interest_rate": 0.03,
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "number_of_installments": 2,
        "principal_grace_period": 0
    },
    "additional_data": {
        "contract": {
            "contract_number": "DWF1761222116",
            "signatures": [
                {
                    "signer": {
                        "name": "NOME DO REPRESENTANTE",
                        "email": "nomedorepresentante@email.com",
                        "phone": {
                            "number": "990121234",
                            "area_code": "11",
                            "country_code": "055"
                        },
                        "document_number": "31057466093"
                    },
                    "signature": {
                        "timestamp": "28-01-2026 06:36:35",
                        "ip_address": "192.168.1.1",
                        "signature_file": {
                            "file_url": "https://qitech.com.br/signature.pdf",
                            "file_type": "pdf"
                        }
                    }
                }
            ]
        }
    },
    "requester_identifier_key": "d1905ef5-19df-4183-bf0e-802b8229933c",
    "purchaser_document_number": "32402502000135",
    "disbursement_bank_accounts": [
        {
            "document_number": "31233261000185",
            "name": "Fornecedor",
            "pix_key": "2f205c99-3161-4120-badd-854039d12de6",
            "pix_transfer_type": "key"
        }
    ],
    "simplified": true
}
```

#### Detalhes do Request Body

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| **borrower*** | object | Objeto do tomador pessoa jurídica — a empresa devedora da operação de crédito | **[Objeto Borrower](#objeto-borrower)** |
| **financial*** | object | Contém todos os detalhes financeiros e parâmetros de cálculo da operação | **[Objeto Financial](#objeto-financial)** |
| **additional_data*** ⚠ | object | Dados adicionais do contrato. Deve conter `contract.signatures` (opt-in) para a emissão ser concluída — enviar vazio (`{}`) faz a emissão falhar | **[Objeto Additional Data](#objeto-additional-data)** |
| **disbursement_bank_accounts** ⚠ | array | Dados de desembolso via PIX. Não exigido pelo schema, mas **operacionalmente obrigatório** (sem ele não há desembolso) | **[Objeto Disbursement Bank Account](#objeto-disbursement-bank-account)** |
| **simplified** | boolean | Utiliza o fluxo simplificado de emissão. Envie `true` | - |
| **purchaser_document_number** | string | CNPJ do cessionário — o comprador da operação de crédito (FIDC) | 14 |
| **requester_identifier_key** | string | Chave identificadora única do solicitante | UUID |

:::note Legenda
**\*** campo obrigatório no schema · **⚠** exigido na prática para concluir a emissão · sem marcação: opcional.
:::

#### Objeto Borrower

O `borrower` representa a pessoa jurídica tomadora. Por isso o campo `person_type` deve conter **sempre** o valor `legal`.

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| name* | string | Razão social da empresa | 100 |
| trading_name* | string | Nome fantasia da empresa | 100 |
| email | string | E-mail institucional da empresa | 254 |
| phone* | object | Telefone da empresa | **[Objeto Phone](#objeto-phone)** |
| is_pep | boolean | Indicador de Pessoa Politicamente Exposta | - |
| address* | object | Endereço da empresa | **[Objeto Address](#objeto-address)** |
| role_type | string | Papel do tomador na operação — default: `issuer` | - |
| person_type* | string | Classificação da pessoa — deve ser sempre `legal` | 5 |
| company_type* | enum | Tipo da empresa | **[Enumerador Company Type](#enumerador-company-type)** |
| company_document_number* | string | CNPJ da empresa — somente números | 14 |
| cnae_code* | string | Classificação Nacional de Atividades Econômicas | - |
| foundation_date* | date | Data de abertura da empresa (Formato: "YYYY-MM-DD") | 10 |
| company_statute* | string | `document_key` do PDF do contrato social/estatuto da empresa (enviado previamente) | UUID |
| directors_election_minute | string | `document_key` do PDF da ata de eleição (recomendado para `company_type` igual a `sa`; não é forçado pelo schema) | UUID |
| attached_documents_list | array | Lista de documentos anexados da empresa | - |
| company_representatives* | array | Lista de representantes legais da empresa | **[Objeto Company Representatives](#objeto-company-representatives)** |

#### Objeto Company Representatives

Lista dos representantes legais da empresa. O representante que assina o contrato deve também constar no array `signatures` em [Objeto Contract](#objeto-contract).

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| person_type* | string | Identificador do tipo de pessoa — deve ser `natural` | 7 |
| name* | string | Nome completo do representante | 100 |
| birth_date* | date | Data de nascimento (Formato: "YYYY-MM-DD") | 10 |
| is_pep* | boolean | Declaração se o representante é PEP | - |
| individual_document_number* | string | CPF do representante — somente números | 11 |
| phone* | object | Telefone do representante | **[Objeto Phone](#objeto-phone)** |
| address* | object | Endereço do representante | **[Objeto Address](#objeto-address)** |
| mother_name | string | Nome da mãe do representante | 100 |
| profession | string | Profissão do representante | 64 |
| nationality | string | Nacionalidade do representante | 50 |
| marital_status | string | Estado civil do representante | - |
| property_system | string | Regime de bens (recomendado para `marital_status` igual a `married`; não é forçado pelo schema) | **[Enumerador Property System](#enumerador-property-system)** |
| wedding_certificate | string | `document_key` do PDF da certidão de casamento (`null` se solteiro) | UUID |
| spouse | object | Dados do cônjuge (`null` se solteiro; não é forçado pelo schema) | **[Objeto Spouse](#objeto-spouse)** |
| final_beneficiary | boolean | Declaração se o representante é beneficiário final da empresa | - |
| document_identification | string | `document_key` do PDF do documento de identificação com foto (RG ou CNH) | UUID |
| document_identification_back | string | `document_key` do PDF do verso do documento de identificação | UUID |
| document_identification_type | string | Tipo do documento de identificação enviado | - |
| document_identification_number | string | Número do documento de identificação enviado | 16 |
| email | string | E-mail do representante | 254 |
| role_type | string | Papel na operação — default: `company_representative` | - |
| proof_of_residence | string | `document_key` do PDF do comprovante de endereço (enviado previamente) | UUID |

#### Objeto Spouse

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| person_type* | string | Identificador do tipo de pessoa — deve ser `natural` | 7 |
| name* | string | Nome completo do cônjuge | 100 |
| mother_name* | string | Nome da mãe do cônjuge | 100 |
| birth_date* | date | Data de nascimento (Formato: "YYYY-MM-DD") | 10 |
| profession* | string | Profissão do cônjuge | 64 |
| is_pep* | boolean | Declaração se o cônjuge é PEP | - |
| individual_document_number* | string | CPF do cônjuge — somente números | 11 |
| document_identification_number* | string | Número do documento de identificação do cônjuge | 16 |
| email* | string | E-mail do cônjuge | 254 |
| phone* | object | Telefone do cônjuge | **[Objeto Phone](#objeto-phone)** |
| address | object | Endereço do cônjuge | **[Objeto Address](#objeto-address)** |

#### Objeto Address

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| city* | string | Nome da cidade | 100 |
| state* | string | Sigla do estado (duas letras maiúsculas) | 2 |
| number* | string | Número do logradouro | 10 |
| street* | string | Nome do logradouro | 100 |
| complement | string | Complemento do endereço (texto livre) | 100 |
| postal_code* | string | CEP — somente números | 8 |
| neighborhood* | string | Nome do bairro | 100 |

#### Objeto Phone

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| number* | string | Número do telefone | 10 |
| area_code* | string | Código de área (DDD) | 2 |
| country_code* | string | Código internacional (ex: "055") | 3 |

#### Objeto Financial

Nesta modalidade, o valor da operação é definido pelo **valor líquido** a ser desembolsado (`disbursed_amount`), em conjunto com a taxa de juros (`monthly_interest_rate`) e o número de parcelas (`number_of_installments`). A partir desses dados, o sistema calcula o valor de cada parcela.

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| interest_type* | string | Método de amortização | **[Enumerador Interest Type](#enumerador-interest-type)** |
| fine_configuration* | object | Configuração de multa e mora | **[Objeto Fine Configuration](#objeto-fine-configuration)** |
| disbursed_amount* | float | Valor líquido a ser desembolsado | 15,2 |
| credit_operation_type* | string | Tipo da operação de crédito | **[Enumerador Credit Operation Type](#enumerador-credit-operation-type)** |
| number_of_installments* | integer | Número de parcelas | 3 |
| interest_grace_period* | integer | Período de carência de juros (em meses) — use `0` quando não houver | 3 |
| principal_grace_period* | integer | Período de carência do principal (em meses) — use `0` quando não houver | 3 |
| monthly_interest_rate ⚠ | float | Taxa de juros mensal (em decimal). Não exigida pelo schema, mas **necessária** para o cálculo pré-fixado (`interest_type` `pre_*`) | 10,6 |
| disbursement_date | string | Data de desembolso (YYYY-MM-DD). Se omitida, assume a data de emissão | 10 |
| first_due_date | string | Data de vencimento da primeira parcela (YYYY-MM-DD) | 10 |

#### Objeto Fine Configuration

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| monthly_rate* | float | Taxa de mora mensal (alternativamente, informe `daily_rate` ou `annual_rate`) | 10,6 |
| interest_base* | string | Base de cálculo da mora | **[Enumerador Interest Base](#enumerador-interest-base)** |
| contract_fine_rate* | float | Taxa de multa contratual | 10,6 |

#### Objeto Disbursement Bank Account

O desembolso desta operação é realizado via **chave PIX**. Informe os dados do recebedor do desembolso no array `disbursement_bank_accounts`.

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| pix_key* | string | Chave PIX para a qual o desembolso será realizado | - |
| pix_transfer_type* | string | Tipo de transferência PIX — utilizar `key` para transferência via chave | - |
| document_number | string | CPF/CNPJ do titular da chave PIX. Obrigatório apenas quando há **mais de uma conta** de desembolso | 14 |
| name | string | Nome do titular da chave PIX. Obrigatório apenas quando há **mais de uma conta** de desembolso | 50 |
| percentage_receivable | float | Percentual do desembolso para esta conta. Obrigatório com **múltiplas contas** (a soma deve ser 100) | 3 |

#### Objeto Additional Data

A chave `additional_data` é obrigatória e deve conter o bloco `contract` com a evidência de assinatura (opt-in) em `signatures`. Enviar `additional_data` vazio (`{}`) faz a emissão **falhar**.

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| contract* | object | Dados do contrato | **[Objeto Contract](#objeto-contract)** |

#### Objeto Contract

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| contract_number* | string | Número identificador único do contrato | 20 |
| signatures* | array | Lista de objetos de evidência de assinatura digital (Opt-in) dos representantes legais | **[Objeto Signature](#objeto-signature)** |

#### Objeto Signature

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| signer* | object | Dados de identificação do assinante (representante legal) | **[Objeto Signer](#objeto-signer)** |
| signature* | object | Dados de evidência da assinatura digital | **[Objeto Signature Details](#objeto-signature-details)** |

#### Objeto Signer

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| name* | string | Nome completo do assinante | 255 |
| document_number* | string | CPF do assinante | 11 |
| email | string | E-mail do assinante | 100 |
| phone | object | Telefone do assinante | **[Objeto Phone](#objeto-phone)** |

#### Objeto Signature Details

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| ip_address* | string | Endereço IP utilizado na assinatura | 45 |
| timestamp* | string | Data e hora da assinatura | 24 |
| signature_file* | object | Arquivo da assinatura digital | **[Objeto Signature File](#objeto-signature-file)** |

#### Objeto Signature File

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| file_url* | string | Link direto para o documento do contrato assinado (PDF) | 2048 |
| file_type* | string | Formato do arquivo de assinatura (ex: "pdf") | 4 |

### Response

A resposta à requisição de emissão retornará o plano de pagamento e uma **DEBT-KEY**, que é o identificador da dívida na QI SCD.

STATUS 201

Response Body

```json
{
    "webhook_type": "debt",
    "key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c",
    "status": "issued",
    "event_datetime": "2026-04-07 23:59:28",
    "data": {
        "borrower": {
            "name": "RAZAO SOCIAL EMPRESA",
            "document_number": "80282008000127",
            "related_party_key": "24fac77e-7782-4f72-b31a-daee288e34ed"
        },
        "contract": {
            "document_key": null,
            "number": "DWF1761222116",
            "urls": [],
            "signature_information": [
                {
                    "signer_name": "NOME DO REPRESENTANTE",
                    "signer_document_number": "31057466093",
                    "signer_role": "issuer",
                    "signer_email": null,
                    "signer_external_key": null,
                    "signature_url": null
                }
            ]
        },
        "requester_identifier_key": "d1905ef5-19df-4183-bf0e-802b8229933c",
        "iof_charge_method": "financed",
        "collaterals": [],
        "contract_fees": [
            {
                "fee_type": "spread",
                "fee_amount": 30.2
            }
        ],
        "external_contract_fees": [
            {
                "fee_type": "tac",
                "fee_amount": 0,
                "tax_amount": 0,
                "net_fee_amount": 0
            }
        ],
        "external_contract_fee_amount": 0,
        "net_external_contract_fee_amount": 0,
        "contract_fee_amount": 30.2,
        "issue_amount": 10076.2,
        "assignment_amount": 10106.4,
        "cet": "3,3500%",
        "annual_cet": "48,5100%",
        "number_of_installments": 2,
        "base_iof": 12.49,
        "additional_iof": 38.58,
        "total_iof": 51.07,
        "ipoc_code": "324025020203180282008000127DWF1761222116",
        "prefixed_interest_rate": {
            "annual_rate": 0.42576089,
            "created_at": "2026-04-07T23:59:22",
            "daily_rate": 0.00097227,
            "interest_base": "calendar_days",
            "monthly_rate": 0.03
        },
        "installments": [
            {
                "accrual_reference_date": null,
                "additional_costs": [],
                "advanced_paid_amount": 0,
                "bank_slip_key": null,
                "business_due_date": "2026-05-07",
                "calendar_days": 30,
                "digitable_line": null,
                "due_date": "2026-05-07",
                "due_interest": 0,
                "due_principal": 10076.2,
                "fine_amount": null,
                "has_interest": true,
                "installment_history": [],
                "installment_key": "1dea396f-beb1-4df3-9822-35800b4c095a",
                "installment_number": 1,
                "installment_payment": [],
                "installment_status": "created",
                "installment_type": "principal",
                "paid_amount": 0,
                "paid_at": null,
                "post_fixed_amount": 0,
                "qr_code_key": null,
                "qr_code_url": null,
                "renegotiation_proposal_key": null,
                "total_amount": 5226.97,
                "total_paid_amount": 0,
                "workdays": 20
            },
            {
                "accrual_reference_date": null,
                "additional_costs": [],
                "advanced_paid_amount": 0,
                "bank_slip_key": null,
                "business_due_date": "2026-06-08",
                "calendar_days": 31,
                "digitable_line": null,
                "due_date": "2026-06-07",
                "due_interest": 0,
                "fine_amount": null,
                "has_interest": true,
                "installment_history": [],
                "installment_key": "370e73d1-55d8-431e-9b22-d08fb8297999",
                "installment_number": 2,
                "installment_payment": [],
                "installment_status": "created",
                "installment_type": "principal",
                "paid_amount": 0,
                "paid_at": null,
                "post_fixed_amount": 0,
                "qr_code_key": null,
                "qr_code_url": null,
                "renegotiation_proposal_key": null,
                "total_amount": 5226.97,
                "total_paid_amount": 0,
                "workdays": 20
            }
        ],
        "total_pre_fixed_amount": 453.94
    }
}
```

:::caution Atenção
Lembre-se de salvar a **DEBT-KEY** retornada, pois ela será necessária para consultas, renegociações e estornos da operação.
:::

#### Detalhes do Response Body

| Campo | Tipo | Descrição |
|---|---|---|
| **webhook_type** | string | Identificador do tipo de evento |
| **key** | string | DEBT-KEY — identificador único da dívida na QI SCD (UUID) |
| **status** | string | Status atual da dívida — veja os [status de uma dívida](../emissao_de_divida/status_de_uma_divida) |
| **event_datetime** | string | Data e hora do evento |
| **data** | object | **[Objeto Data](#objeto-data)** — Dados da operação |

#### Objeto Data

| Campo | Tipo | Descrição |
|---|---|---|
| **borrower** | object | Dados do tomador (razão social, CNPJ e `related_party_key`) |
| **contract** | object | Dados do contrato, incluindo informações de assinatura |
| **requester_identifier_key** | string | Chave identificadora do solicitante (UUID) |
| **iof_charge_method** | string | Método de cobrança do IOF — sempre "financed" |
| **collaterals** | array | Lista de garantias da operação |
| **contract_fees** | array | Taxas QI Tech cobradas na operação |
| **external_contract_fees** | array | Taxas externas cobradas na operação |
| **contract_fee_amount** | float | Valor total das taxas QI Tech |
| **issue_amount** | float | Valor nominal da operação de crédito |
| **assignment_amount** | float | Valor de cessão da operação de crédito |
| **cet** | string | Custo Efetivo Total mensal |
| **annual_cet** | string | Custo Efetivo Total anual |
| **number_of_installments** | integer | Número de parcelas |
| **base_iof** | float | Valor base do IOF |
| **additional_iof** | float | Valor adicional do IOF |
| **total_iof** | float | Valor total do IOF |
| **ipoc_code** | string | Código de registro de crédito brasileiro gerado pela QI Tech |
| **prefixed_interest_rate** | object | Taxa de juros nominal (anual, diária, mensal e base de cálculo) |
| **installments** | array | Parcelas da operação |
| **total_pre_fixed_amount** | float | Valor total dos juros pré-fixados de todas as parcelas |

## Webhooks

Durante o ciclo de vida da operação, a QI Tech envia webhooks para a URL configurada. Abaixo estão os eventos relevantes para este fluxo.

:::info Informação
O timeout para resposta dos nossos webhooks é de 5 segundos.
:::

:::danger Atenção!
Os webhooks da QI Tech não devem ser mapeados de forma restrita. Campos adicionais podem ser incluídos aos payloads retornados.
:::

### Webhook de documento gerado

Enviado quando o contrato da operação é gerado. Traz a `document_key` e as URLs do documento (incluindo a versão assinada).

Response Body

```json
{
    "key": "cc91aac2-8d15-4349-b155-7c23080c61e8",
    "data": {
      "contract": {
        "urls": [
          "https://storage.googleapis.com/live-doc-api/documents/50711223-dfe2-4ed6-9c41-42d68638cfff.pdf"
        ]
      },
      "document_key": "50711223-dfe2-4ed6-9c41-42d68638cfff",
      "signed_contract_url": "https://storage.googleapis.com/live-doc-api/documents/_signed.pdf"
    },
    "status": "generated_document",
    "webhook_type": "debt",
    "event_datetime": "2026-03-24 08:27:11"
}
```

### Webhook de desembolso

Enviado quando o desembolso da operação é realizado (`status: disbursed`). Traz a agenda de parcelas e os comprovantes de transferência (`ted_receipt_list`).

Response Body

```json
{
    "key": "bb81d525s-aa4b-4ddf-81d6-aa4b41fd04nb",
    "data": {
        "installments": [
        {
            "due_date": "2025-11-24",
            "total_amount": 8304.16,
            "installment_key": "7ec2f4d-b21e-4bd5-ahs6-60e998267249",
            "pre_fixed_amount": 2475.77421509,
            "installment_number": 1,
            "principal_amortization_amount": 5828.23857532
        },
        {
            "due_date": "2025-12-22",
            "total_amount": 8304.16,
            "installment_key": "54g37d78-a9a9-bf82-9f8e-fd3ba123797a",
            "pre_fixed_amount": 2001.06342502,
            "installment_number": 2,
            "principal_amortization_amount": 6303.43346322
        }
        ],
        "ted_receipt_list": [
        {
            "fee": 0,
            "url": "https://storage.storage.com/sandbox-doc-api/documents/f9as9329-22bd-4dbg-91a2-f2sdgeth4h04/fheth459-bhrf-4hrt-9hra-fdsfsgehth42.pdf",
            "amount": 123456.0,
            "origin": {
            "name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
            "type": "payment_account",
            "branch": "0001",
            "document": "32402502000777",
            "bank_code": "329",
            "account_key": "5d068423-7774-49e4-b15b-7741238df5a8",
            "branch_digit": null,
            "account_digit": "5",
            "account_branch": "0001",
            "account_number": "00002",
            "financial_institution_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A."
            },
            "timestamp": "2025-10-26T17:00:51",
            "description": "60701190 8615 22110-2 96969879003 - Fornecedor",
            "destination": {
            "name": "Fornecedor",
            "type": "checking_account",
            "branch": "8612",
            "purpose": "Crédito PIX em Conta",
            "document": "31233261000185",
            "bank_ispb": "60111190",
            "branch_digit": null,
            "account_digit": "2",
            "account_number": "44110",
            "financial_institution_name": "BANCO S.A."
            },
            "end_to_end_id": "E32402402200510221300gNgeefVNtVr",
            "transaction_key": "25044504-1902-412a-a445-23b813bee6c1",
            "origin_transaction_key": "542224ea-b5ea-49ff-b7b7-673b81af387b"
        }
        ],
        "requester_identifier_key": null
    },
    "status": "disbursed",
    "webhook_type": "debt",
    "event_datetime": "2025-10-26 17:00:52"
}
```

### Webhook de cancelamento

Enviado quando a operação é cancelada (`status: canceled`). O campo `cancel_reason_enumerator` indica o motivo.

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"
}
```

#### Motivos de cancelamento

| cancel_reason_enumerator | Descrição |
|---|---|
| disbursing_error | Operação cancelada por erro no momento do desembolso. |
| waiting_signature | Operação cancelada por falta de assinatura. |
| is_portability | A operação foi cancelada pois é uma portabilidade que não foi concluída. |
| not_collateral_constituted | A operação foi cancelada pois as garantias não foram constituídas. |
| entry_not_paid | A operação foi cancelada pois a entrada não foi paga. |
| not_assigned | Operação cancelada porque o processo de cessão não foi realizado. |
| pix_max_retry | Operação cancelada pois o banco recebedor não conseguiu receber o desembolso. |
| lack_of_resource | Operação cancelada por falta de recurso. |
| manual | Operação cancelada manualmente. |
| kyc_not_accepted | Operação cancelada pois não foi aprovada no compliance. |
| not_collateral_fgts | Operação cancelada por erro com FGTS. |
| agencia_conta_invalida | Agência ou conta destinatária do crédito inválida. |
| invalid_account | Número da conta de destino é inexistente ou inválido. |
| invalid_document_number | CPF/CNPJ da conta de destino está incorreto. |
| unsupported_transaction | A conta de destino não suporta este tipo de transação. |
| bank_slip_payment | Operação cancelada por erro no pagamento do boleto. |
| bank_slip_paid | Operação cancelada pois o boleto já está pago. |
| bank_slip_written_off | Operação cancelada pois o boleto já está baixado. |
| invalid_ispb | Número ISPB é inválido ou inexistente. |
| rejected_payment | Ordem de pagamento foi rejeitada pelo banco recebedor. |
| disbursed_amount_refunded | Operação cancelada devido à devolução do valor de desembolso. |

# Enumeradores

### Enumerador _Company Type_
| Enumerador | Descrição |
|---|---|
| **ltda** | Sociedade Limitada |
| **sa** | Sociedade Anônima |
| **micro_enterprise** | Microempresa |
| **freelancer** | Profissional autônomo |

### Enumerador _Property System_
| Enumerador | Descrição |
|---|---|
| **total_communion_of_goods** | Comunhão total de bens |
| **partial_communion_of_goods** | Comunhão parcial de bens |
| **final_participation_of_acquisitions** | Participação final nos aquestos |
| **compulsory_separation_of_goods** | Separação obrigatória de bens |

### Enumerador _Interest Type_
| Enumerador | Descrição |
|---|---|
| **pre_price_days** | Amortização Price (parcelas iguais) com juros pré-fixado ao dia |
| **pre_price** | Amortização Price (parcelas iguais) com juros pré-fixado em períodos fixos (30 dias) |
| **pre_sac** | Amortização SAC (amortização constante) com juros pré-fixado ao dia |
| **post_sac** | Amortização SAC com juros pré-fixado + indexador pós-fixado (cdi, ipca ou igpm) ao dia |
| **post_price** | Amortização Price com juros pré-fixado + indexador pós-fixado em períodos fixos (30 dias) |
| **post_price_days** | Amortização Price com juros pré-fixado + indexador pós-fixado ao dia |

### Enumerador _Credit Operation Type_
| Enumerador | Descrição |
|---|---|
| **ccb** | Cédula de Crédito Bancário |
| **cce** | Cédula de Crédito à Exportação |
| **cci** | Cédula de Crédito Imobiliário |
| **nce** | Nota de Crédito à Exportação |
| **ncom** | Nota Comercial |

### Enumerador _Interest Base_
| Enumerador | Descrição |
|---|---|
| **workdays** | Cálculo de juros em dias úteis considerando um ano de 252 dias |
| **calendar_days** | Cálculo de juros em dias corridos considerando um ano de 360 dias |
| **calendar_days_365** | Cálculo de juros em dias corridos considerando um ano de 365 dias |

## Decodificação de QR Code

### Request

ENDPOINT pix/decode_qrcode_payload
MÉTODO POST

Testar no Playground

Request Body

```json
{
   "qr_code_type": "dynamic_instant",
   "qr_code_payload": "00020101021226850014br.gov.bcb.pix2563qrcodepix.bb.com.br/pix/v2/d373e385-dfe7-49f6-b9ec-14ba60a9b8285204000053039865802BR5925TESTE62070503***63047B7D",
   "pix_key": "teste.cobrancapix@gmail.com.br",
   "receiver_conciliation_id": "fgnb4NTt7pOUBGfrcporERwVVqr0f8PWRfK",
   "amount": "9367.61",
   "status": "ATIVA"
}

```
### Response Body

| Campo | Tipo | Descrição | Disponível |
|-----------------------------|--------|-------------------------------------------------------------------------|--------------------|
| `qr_code_type` | string | Tipo do QR Code: static, dynamic_instant ou dynamic_term. | Todos |
| `qr_code_payload` | string | Payload EMV original recebido na requisição. | Todos |
| `pix_key` | string | Chave Pix do recebedor extraída do payload do QR Code. | Todos |
| `transfer_amount` | string | Valor da transferência, quando especificado no QR Code. | `static` |
| `additional_data` | string | Dados adicionais contidos no QR Code estático. | `static` |
| `receiver_conciliation_id` | string | Identificador de conciliação do recebedor (txid). | `dynamic_*` |
| `amount` | string | Valor original da cobrança. | `dynamic_*` |
| `status` | string | Status da cobrança dinâmica. | `dynamic_*` |

###  :::info Status
Para QR Codes dinâmicos, o status do QR Code é retornado de acordo com a tabela de enumeração abaixo.

### Erros

Response Body: QR Code estático
QR Code com formato inválido

```json
{
"data": "{\"title\": \"Invalid Qr Code Format\", \"description\": \"The Qr Code format is invalid, please enter a valid Qr Code\", \"translation\": \"O formato do Qr Code é inválido, por favor insira um Qr Code válido\", \"extra_fields\": {}, \"code\": \"PXT000070\"}"
}

```

Tipo de QR Code não identificado no payload

```json
{
 "data": "{\"title\": \"Invalid Qr Code Type\", \"description\": \"The Qr Code payload given did not provide a propper Qr Code type\", \"translation\": \"O payload de QR Code fornecido não contêm um tipo de Qr Code Válido\", \"extra_fields\": {}, \"code\": \"PXT000071\"}"
}
```

Response Body

```json
{
"data": "{\"title\": \"Error in Qr Code Payload Request\", \"description\": \"An error occurred while requesting the qr code payload to the registry institution\", \"translation\": \"Um erro ocorreu durante a requisição do payload do qr code para a instituição de registro\", \"extra_fields\": {}, \"code\": \"PXT000069\"}"
}
```

# O que é a Análise de Risco (LAaS)?

:::caution Versão preliminar
Esta é a primeira versão desta página conceitual e pode sofrer pequenas alterações.
:::

Antes de entrar nos campos, tipos e códigos de erro, vale entender **por que** a Análise de Risco existe e **o que** ela resolve. Esta seção é o "mapa mental" — a documentação técnica completa (com todos os campos de request/response) está logo abaixo, em **[Análise de Risco](#análise-de-risco)**.

## A ideia em uma frase

A Análise de Risco (também chamada de **LAaS**, *Lending Analysis as a Service*) é um único endpoint que **combina, em uma só chamada, as verificações necessárias para decidir se um tomador pode ou não receber crédito** — onboarding, análise de crédito e, quando aplicável, consulta de margem consignável — e entrega o resultado consolidado no final, sem que você precise orquestrar cada verificação separadamente.

## A analogia: um check-in de aeroporto

Pense no pedido de crédito como um passageiro tentando embarcar em um voo.

- **Você (cliente/parceiro) é o balcão de check-in.** É você quem recebe o passageiro (o tomador) e decide encaminhá-lo para o processo de embarque, enviando um único `POST /lending_analysis`.
- **A consulta prévia (`inquiry`) é a checagem de documentos antes mesmo da fila de segurança.** Se o produto é consignado privado, antes de qualquer outra coisa a QI Tech confere se o passageiro tem "passagem válida" — isto é, se ele tem margem consignável disponível com o empregador informado. Sem isso, não faz sentido nem seguir para as próximas etapas.
- **As etapas (`analysis_steps`) são os controles de segurança e imigração, em sequência.** Cada etapa é um checkpoint independente, executado **na ordem**:
  1. **Onboarding** (`onboarding_natural_person`) — o controle de identidade: "esse documento é válido? essa pessoa é quem diz ser?"
  2. **Análise de crédito** (`credit_analysis_natural_person`) — o controle de "bagagem": "essa pessoa pode embarcar com esse valor de crédito, dentro de que limites de taxa e parcelas?"

  Se um checkpoint reprova, o passageiro não segue para o próximo — a análise já fecha como `reproved` ali mesmo. E nem todo passageiro passa pelos dois controles: quais etapas se aplicam a cada tomador dependem da configuração do produto (`AnalysisConfiguration`) do lado da QI Tech — em alguns casos só o onboarding é executado.
- **A resposta síncrona é o seu tíquete de fila.** Ao enviar o `POST`, você recebe na hora um `lending_analysis_key` e o status `pending_inquiry` — como dizer "seu passageiro está na fila, aqui está o número dele". Ainda não é a decisão final.
- **O webhook é o alto-falante do aeroporto anunciando o embarque.** Quando todos os checkpoints terminam, a QI Tech **avisa você via webhook** (`laas.lending_analysis.status_change`) com o resultado consolidado — aprovado, reprovado ou falha técnica. Você não precisa ficar checando a toda hora (embora possa, via polling — ver abaixo).
- **A consulta de elegibilidade é a pergunta "esse passageiro já tem um embarque em andamento?"** Antes de criar uma nova análise, você pode perguntar via `GET /lending_analysis` se aquele CPF já possui uma análise ativa para aquele produto — evitando embarcar o mesmo passageiro duas vezes.

## Da analogia para a API

| No aeroporto | Na API |
|---|---|
| Balcão de check-in recebe o passageiro | `POST /lending_analysis` |
| Passageiro já tem embarque em andamento? | `GET /lending_analysis` (elegibilidade) |
| Número da fila | `lending_analysis_key` |
| Checagem prévia de documento de viagem | `inquiries` (ex: consulta de margem consignável) |
| Controle de identidade | Etapa `onboarding_natural_person` |
| Controle de bagagem/valor | Etapa `credit_analysis_natural_person` |
| Painel de embarque, consultável a qualquer momento | `GET /lending_analysis/{lending_analysis_key}` |
| Anúncio de embarque no alto-falante | Webhook `laas.lending_analysis.status_change` |

## O fluxo, passo a passo

1. Você envia `POST /lending_analysis` com o CPF do tomador, o tipo de produto (`lending_analysis_type`) e os dados necessários (ex: `private_payroll` para consignado privado, `authorization_term` com a autorização assinada pelo tomador).
2. A API responde **na hora** (síncrono) com `analysis_status: pending_inquiry` e o `lending_analysis_key`. Essa resposta só confirma que a análise foi criada — **não é o resultado**.
3. Nos bastidores (assíncrono), a QI Tech:
   - roda a consulta prévia necessária (ex: margem consignável), se o produto exigir;
   - executa a etapa de **onboarding**;
   - se aprovada e a etapa estiver configurada para o produto, executa a etapa de **análise de crédito**;
   - se qualquer etapa reprovar ou falhar, a análise encerra ali com esse resultado.
4. Ao chegar a um status final (`approved`, `reproved` ou `failed`), a QI Tech dispara o **webhook** `laas.lending_analysis.status_change` para a URL configurada no seu ambiente, com o detalhe de cada etapa e das consultas realizadas.
5. Alternativamente, você pode consultar o andamento a qualquer momento com `GET /lending_analysis/{lending_analysis_key}` (bom para telas de acompanhamento ou para reconciliar caso um webhook se perca).

:::tip Dica
Pense duas vezes antes de fazer polling agressivo no `GET` de status — o webhook já te avisa assim que o resultado sai. Use o `GET` para reconciliação, não como substituto do webhook.
:::

## Os "vistos" (status) explicados sem juridiquês

| Status da análise | O que realmente significa |
|---|---|
| `pending_inquiry` | "Chegou na fila, ainda estamos conferindo os documentos de viagem." Estado inicial. |
| `pending_analysis` | "Passou na checagem prévia, está andando pelos controles de segurança (onboarding / análise de crédito)." |
| `approved` | "Embarque liberado." Estado final. |
| `reproved` | "Não pode embarcar desta vez." Estado final — algum checkpoint reprovou. |
| `failed` | "Aeroporto com problema técnico" — falha da própria análise (indisponibilidade de algum provedor, erro técnico), não uma reprovação de mérito. Estado final. |

Cada etapa individual (`onboarding_natural_person`, `credit_analysis_natural_person`) tem seu próprio mini-status (`approved`/`reproved`/`failed`) e um `reason` explicando o motivo — é o "aqui está exatamente por que barramos você nesse checkpoint".

## Perguntas rápidas

**Preciso me preocupar com a ordem das etapas, ou com quais etapas vão rodar?**
Não — tanto a ordem (`onboarding` antes de `credit_analysis`) quanto quais etapas se aplicam a cada tomador são definidas pela configuração do produto (`AnalysisConfiguration`) do lado da QI Tech. Você só recebe o resultado consolidado, já na ordem certa.

**E se o passageiro já tiver um embarque em andamento?**
Use a consulta de elegibilidade (`GET /lending_analysis`) antes de criar uma nova análise para o mesmo CPF/produto, evitando duplicidade.

**O que acontece se eu perder o webhook?**
Consulte o status a qualquer momento com `GET /lending_analysis/{lending_analysis_key}` — ele traz o mesmo resultado, incluindo o histórico completo de eventos, etapas e consultas.

## Para ir além

- **[Análise de Risco](#análise-de-risco)** — campos de request/response, objetos, enumeradores e casos de teste em sandbox.
- **[Catálogo de Erros LaaS](../emissao_de_divida/catalogo_de_erros_laas)** — todos os códigos de erro possíveis.
- **[Webhooks — Notificações BaaS e LaaS](../webhooks/notificacoes_baas_e_laas)** — como configurar e validar o recebimento dos webhooks.

# Análise de Risco

:::caution Versão preliminar
Esta é a primeira versão da documentação do Análise de Risco e pode sofrer pequenas alterações. Recomendamos acompanhar esta página para futuras atualizações.
:::

O endpoint de **Análise de Risco** permite realizar uma análise de crédito completa para o tomador, combinando onboarding, análise de crédito e consulta de dados do trabalhador do consignado privado em uma única requisição.

A operação é **assíncrona**: ao enviar a requisição, a API retorna uma resposta síncrona com o status `pending_inquiry`. O resultado final da análise é entregue via **webhook** quando o processamento é concluído.

:::info Fluxo
1. O cliente envia um `POST` para `/lending_analysis` com os dados do tomador e as consultas desejadas.
2. A API retorna uma resposta síncrona com a `lending_analysis_key` e status `pending_inquiry`.
3. Ao finalizar o processamento, a API envia um webhook com o resultado completo da análise.
:::

:::info Endpoints disponíveis
Além do `POST /lending_analysis` descrito abaixo, a API expõe duas consultas auxiliares:

- [Consulta de elegibilidade](#consulta-de-elegibilidade) — `GET /lending_analysis` para verificar se o tomador já tem análise ativa antes de criar uma nova.
- [Consulta de status da análise](#consulta-de-status-da-análise) — `GET /lending_analysis/{lending_analysis_key}` para acompanhar o estado da análise via polling, como alternativa ao webhook.
:::

---

## Request

ENDPOINT /lending_analysis
MÉTODO POST

Request Body

```json
{
    "request_identifier_key": "12345678901",
    "document_number": "46276658812",
    "lending_analysis_type": "private_payroll",
    "purchaser_document_number": "12345678000199",
    "private_payroll": {
        "employer_document_number": "12345678000199",
        "registration_number": "12345678901"
    },
    "authorization_term": {
        "legal_representative_document_number": "98765432100",
        "signature": {
            "signer": {
                "document_number": "46276658812",
                "name": "João da Silva",
                "email": "joao.silva@email.com",
                "phone": {
                    "number": "912345678",
                    "area_code": "11",
                    "country_code": "55"
                }
            },
            "authentication_type": "opt_in",
            "authenticity": {
                "timestamp": "2026-03-12T10:00:00Z",
                "ip_address": "192.168.1.100",
                "fingerprint": {},
                "session_id": "3571e292-3a83-4011-904d-20ee963022ef"
            }
        }
    },
    "analysis_data": {
        "name": "João da Silva"
    }
}
```

### Body Params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `request_identifier_key` | string | Chave idempotente da requisição. Deve ser única por análise. | - |
| `document_number` | string | CPF do tomador (apenas dígitos). | 11 |
| `lending_analysis_type` | string | Tipo da análise de crédito. | **[Enumeradores Análise de Risco Type](#enumeradores-lending-analysis-type)** |
| `purchaser_document_number` | string | CNPJ do comprador/cessionário. (opcional) | 14 |
| `private_payroll` | object | Dados do consignado privado do tomador. | **[Private Payroll Object](#private-payroll-object)** |
| `authorization_term` | object | Termo de autorização do tomador. | **[Authorization Term Object](#authorization-term-object)** |
| `analysis_data` | object | Dados adicionais do tomador para a análise. | **[Analysis Data Object](#analysis-data-object)** |

### Private Payroll Object

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `employer_document_number` | string | CNPJ do empregador. | 14 |
| `registration_number` | string | Número de matrícula do trabalhador. | - |

### Authorization Term Object

:::caution Atenção
Nos casos em que houver representante legal, é necessário preencher o campo `legal_representative_document_number` com o CPF do representante legal, e os dados do objeto `signer` devem ser preenchidos com os dados do representante.
:::

> Para mais informações sobre o objeto `authorization_term`, consulte a documentação oficial:
> [Consultas do Trabalhador - Consulta de Dados do Trabalhador](https://docs.qitech.com.br/documentation/manual_consignado_privado/manual_consultas_trabalhador)

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `legal_representative_document_number` | string | CPF do representante legal (obrigatório apenas quando houver representante legal). | 11 |
| `signature.signer.document_number` | string | CPF do assinante. | 11 |
| `signature.signer.name` | string | Nome do assinante. | - |
| `signature.signer.email` | string | Email do assinante. (opcional) | - |
| `signature.signer.phone.number` | string | Número de telefone do assinante. (opcional) | - |
| `signature.signer.phone.area_code` | string | DDD do assinante. (opcional) | 2 |
| `signature.signer.phone.country_code` | string | Código do país (ex: `"55"`). (opcional) | 3 |
| `signature.authentication_type` | string | Tipo de autenticação. Deve ser `"opt_in"`. | - |
| `signature.authenticity.timestamp` | string | Data e hora do aceite (formato ISO 8601: `2026-03-12T10:00:00Z`). | - |
| `signature.authenticity.ip_address` | string | IP da sessão do usuário (IPv4 ou IPv6). | - |
| `signature.authenticity.fingerprint` | object | Evidências adicionais de rastreabilidade (pode ser objeto vazio `{}`). | - |
| `signature.authenticity.session_id` | string | Identificador da sessão do usuário (min. 10, máx. 50 caracteres). | 50 |

### Analysis Data Object

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `name` | string | Nome do tomador. (opcional) | - |

---

## Response

STATUS 202

Response Body

```json
{
    "analysis_status": "pending_inquiry",
    "lending_analysis_key": "06666318-c9e9-416b-ae2f-460355a3d8e8"
}
```

| Campo | Tipo | Descrição |
|---|---|---|
| `analysis_status` | string | Status atual da análise. Retorna `pending_inquiry` na resposta síncrona. |
| `lending_analysis_key` | string | Chave UUID da análise, utilizada para correlacionar com o webhook. |

---

STATUS 400

Response Body

```json
{
    "title": "Bad Request",
    "description": "Invalid or missing required fields in the request body. Check 'document_number', 'lending_analysis_type', 'private_payroll', and 'authorization_term'.",
    "translation": "Campos obrigatórios ausentes ou inválidos no corpo da requisição. Verifique 'document_number', 'lending_analysis_type', 'private_payroll' e 'authorization_term'.",
    "extra_fields": {},
    "code": "LAS000001"
}
```

---

STATUS 409

Retornado quando o campo `request_identifier_key` já foi utilizado em uma requisição anterior.

Response Body

```json
{
    "title": "Conflict",
    "description": "A lending analysis with the provided 'request_identifier_key' already exists. Each analysis must use a unique identifier.",
    "translation": "Já existe uma análise de crédito com o 'request_identifier_key' informado. Cada análise deve utilizar um identificador único.",
    "extra_fields": {
        "existing_lending_analysis_key": "06666318-c9e9-416b-ae2f-460355a3d8e8"
    },
    "code": "LAS000002"
}
```

---

## Consulta de elegibilidade

Verifica se o tomador possui uma análise ativa (não expirada) para um determinado produto. Se não houver, indica que uma nova análise pode ser criada com `POST /lending_analysis`.

ENDPOINT /lending_analysis
MÉTODO GET

### Query Params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `document_number` | string | CPF do tomador (apenas dígitos). | 11 |
| `product_name` | string | Nome do produto. Atualmente o único valor aceito é `private_payroll`. | - |
| `purchaser_document_number` | string | CNPJ do comprador/cessionário. (opcional) | 14 |

### Exemplo de chamada

```
GET /lending_analysis?document_number=46276658812&product_name=private_payroll
```

---

### Response — Tomador com análise ativa

STATUS 200

Response Body

```json
{
    "lending_analysis_key": "06666318-c9e9-416b-ae2f-460355a3d8e8",
    "analysis_status": "approved",
    "expires_at": "2026-03-17T10:00:00Z"
}
```

| Campo | Tipo | Descrição |
|---|---|---|
| `lending_analysis_key` | string | Chave UUID da análise ativa do tomador. |
| `analysis_status` | string | Status atual da análise. Veja **[Status da análise](#status-da-análise)**. |
| `expires_at` | string | Data e hora (ISO 8601) em que a análise expira. Após essa data, o tomador volta a ser elegível para uma nova análise. |

---

### Response — Tomador sem análise ativa

STATUS 404

Retornado quando não existe análise ativa para o tomador na combinação informada. O cliente pode prosseguir com `POST /lending_analysis` para iniciar uma nova análise (desde que exista uma `AnalysisConfiguration` ativa para o mesmo `requester_key`, produto e `purchaser_document_number`).

Response Body

```json
{
    "code": "LAS000009",
    "title": "No active lending analysis found",
    "description": "No active lending analysis found for product_name=<X>, purchaser_document_number=<Y>. The borrower has no active analysis for the given product.",
    "translation": "Nenhuma analise de credito ativa encontrada para product_name=<X>, purchaser_document_number=<Y>. O tomador nao possui analise ativa para o produto informado."
}
```

Disparado quando não existe nenhuma `Analysis` para a tupla (`requester_key`, `product_name`, `document_number`, `purchaser_document_number`) que esteja em status diferente de `failed` e ainda dentro do prazo de validade (`expires_at` no futuro).

---

## Consulta de status da análise

Retorna o estado completo de uma análise específica, incluindo o histórico de transições de status, etapas individuais executadas e dados das consultas realizadas (`inquiries`). Útil quando o cliente prefere fazer polling em vez de aguardar exclusivamente o webhook de conclusão.

ENDPOINT /lending_analysis/{lending_analysis_key}
MÉTODO GET

### Path Params

| Campo | Tipo | Descrição |
|---|---|---|
| `lending_analysis_key` | string | UUID da análise, retornado pelo `POST /lending_analysis` na criação. |

### Exemplo de chamada

```
GET /lending_analysis/06666318-c9e9-416b-ae2f-460355a3d8e8
```

---

### Response

STATUS 200

Response Body

```json
{
    "lending_analysis_key": "06666318-c9e9-416b-ae2f-460355a3d8e8",
    "analysis_status": "approved",
    "expires_at": "2026-03-17T10:00:00Z",
    "request_identifier_key": "12345678901",
    "document_number": "46276658812",
    "additional_data": {
        "private_payroll": {
            "employer_document_number": "12345678000199",
            "registration_number": "12345678901"
        },
        "analysis_data": {
            "name": "João da Silva"
        }
    },
    "status_events": [
        {
            "status": "pending_inquiry",
            "created_at": "2026-03-12T10:00:00Z"
        },
        {
            "status": "approved",
            "created_at": "2026-03-12T10:05:00Z"
        }
    ],
    "inquiries": [
        {
            "inquiry_key": "0a1b2c3d-e5f6-7890-abcd-ef1234567890",
            "inquiry_type": "private_payroll",
            "inquiry_status": "success",
            "inquiry_data": {}
        }
    ],
    "steps": [
        {
            "analysis_step_key": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
            "order": 1,
            "step_type": "onboarding_natural_person",
            "step_status": "approved"
        },
        {
            "analysis_step_key": "a9b8c7d6-e5f4-3210-abcd-ef1234567890",
            "order": 2,
            "step_type": "credit_analysis_natural_person",
            "step_status": "approved"
        }
    ]
}
```

#### Campos principais

| Campo | Tipo | Descrição |
|---|---|---|
| `lending_analysis_key` | string | UUID da análise. |
| `analysis_status` | string | Status atual da análise. Veja **[Status da análise](#status-da-análise)**. |
| `expires_at` | string | Data e hora de expiração da análise (ISO 8601). |
| `request_identifier_key` | string | Chave idempotente informada na requisição original. |
| `document_number` | string | CPF do tomador. |
| `additional_data` | object | Dados originais enviados em `POST /lending_analysis` (`private_payroll`, `authorization_term`, `analysis_data`). |
| `status_events` | array | Histórico de transições de status. **[Status Events Object](#status-events-object)** |
| `inquiries` | array | Consultas realizadas durante a análise. **[Inquiries Object (consulta)](#inquiries-object-consulta)** |
| `steps` | array | Etapas individuais executadas. **[Steps Object](#steps-object)** |

#### Status Events Object

Cada item registra uma transição de status com seu carimbo de tempo, em ordem cronológica.

| Campo | Tipo | Descrição |
|---|---|---|
| `status` | string | Status assumido pela análise. Veja **[Status da análise](#status-da-análise)**. |
| `created_at` | string | Data e hora da transição (ISO 8601). |

#### Inquiries Object (consulta)

| Campo | Tipo | Descrição |
|---|---|---|
| `inquiry_key` | string | UUID da consulta. |
| `inquiry_type` | string | Tipo da consulta. Atualmente o único valor é `private_payroll`. |
| `inquiry_status` | string | Status da consulta: `pending`, `success` ou `failed`. |
| `inquiry_data` | object | Dados retornados pela consulta. Para `private_payroll`, segue o mesmo formato exibido no webhook — consulte **[Dados de inquiry (`inquiry_data`)](#dados-de-inquiry-inquiry_data)**. |
| `failure_reason` | string | Motivo da falha quando `inquiry_status` é `failed`. (opcional) |

#### Steps Object

Cada etapa representa uma análise individual executada (onboarding, análise de crédito) durante o processamento.

| Campo | Tipo | Descrição |
|---|---|---|
| `analysis_step_key` | string | UUID da etapa. |
| `order` | integer | Ordem de execução da etapa (1, 2, ...). |
| `step_type` | string | Tipo da etapa: `onboarding_natural_person` ou `credit_analysis_natural_person`. |
| `step_status` | string | Status atual da etapa: `created`, `pending`, `approved`, `reproved` ou `failed`. |

---

STATUS 404

Retornado quando a `lending_analysis_key` informada não corresponde a nenhuma análise existente.

Response Body

```json
{
    "title": "Not Found",
    "description": "Lending analysis with the provided key was not found.",
    "translation": "Não foi encontrada uma análise de crédito com a chave informada.",
    "extra_fields": {},
    "code": "LAS000005"
}
```

---

## Webhooks

:::danger Atenção!
Os webhooks da QI Tech não devem ser mapeados de forma estrita.
Campos adicionais podem ser incluídos aos payloads dos webhooks retornados em nossas APIs.
:::

**Webhook type:** `laas.lending_analysis.status_change`

O webhook é enviado para a URL configurada no ambiente do cliente quando a análise é concluída.

## Webhook de análise concluída

Response Body

```json
{
    "key": "06666318-c9e9-416b-ae2f-460355a3d8e8",
    "status": "completed",
    "webhook_type": "laas.lending_analysis.status_change",
    "event_datetime": "2026-03-12T10:05:00Z",
    "data": {
        "request_identifier_key": "12345678901",
        "analysis_status": "reproved",
        "analysis_steps": [
            {
                "analysis_step_type": "onboarding_natural_person",
                "analysis_step_status": "approved",
                "reason": "Passou nas validações",
                "output_data": {}
            },
            {
                "analysis_step_type": "credit_analysis_natural_person",
                "analysis_step_status": "reproved",
                "reason": "Score do Serasa menor que 500",
                "output_data": {
                    "analysis_score": 100,
                    "credit_model_score": 100,
                    "maximum_monthly_interest_rate": 0.00,
                    "minimum_monthly_interest_rate": 0.00,
                    "maximum_installments_number": 10,
                    "minimum_installments_number": 1,
                    "maximum_disbursed_issue_amount": 4500.00,
                    "minimum_disbursed_issue_amount": 0.00
                }
            }
        ],
        "inquiries": [
            {
                "inquiry_type": "private_payroll",
                "inquiry_data": {
                    "document_number": "99999999999",
                    "registration_number": "99999999999-A",
                    "employer_document_number": "99999999999962",
                    "name": "JOÃO SILVA",
                    "gender": "male",
                    "birth_date": "1985-07-20",
                    "worker_category_code": 101,
                    "eligible": true,
                    "available_margin_amount": 5000.00,
                    "base_margin_amount": 4500.00,
                    "total_due_amount": 8207.54,
                    "admission_date": "2020-03-15",
                    "termination_date": null,
                    "termination_reason_code": null,
                    "political_exposition": "not_exposed",
                    "employer_name": "EMPRESA XYZ LTDA",
                    "mother_name": "MARIA DA SILVA",
                    "nationality": {
                        "code": 76,
                        "description": "BRASIL"
                    },
                    "occupation": {
                        "code": 724325,
                        "description": "SOLDADOR ELETRICO"
                    },
                    "economic_activity": {
                        "code": 2833000,
                        "description": "FABRICACAO DE MAQUINAS E EQUIPAMENTOS PARA A AGRICULTURA E PECUARIA"
                    },
                    "ineligibility_reason": "not_informed",
                    "employer_activity_start_date": "2010-05-12",
                    "legacy_loans": [],
                    "alerts": [
                        {
                            "alert_type": "leave",
                            "reference_date": "2025-02-11",
                            "event_id": 123456,
                            "leave_reason_code": 3,
                            "leave_start_date": "2025-02-11",
                            "leave_end_date": "2025-03-11"
                        },
                        {
                            "alert_type": "termination",
                            "reference_date": "2025-02-11",
                            "event_id": 789012,
                            "termination_reason_code": 1,
                            "termination_date": "2025-02-11",
                            "notice_period_start_date": "2025-01-11",
                            "notice_period_end_date": "2025-02-11"
                        }
                    ]
                }
            }
        ]
    }
}
```

### Descrição dos campos do webhook

| Campo | Tipo | Descrição |
|---|---|---|
| `key` | string | `lending_analysis_key` retornada na resposta síncrona. |
| `status` | string | Status do webhook. |
| `webhook_type` | string | Tipo do webhook. |
| `event_datetime` | string | Data e hora do evento (ISO 8601). |
| `data.request_identifier_key` | string | Chave idempotente informada na requisição original. |
| `data.analysis_status` | string | Status final da análise. **[Status da análise](#status-da-análise)** |
| `data.analysis_steps` | array | Lista de etapas da análise realizadas. **[Analysis Steps Object](#analysis-steps-object)** |
| `data.inquiries` | array | Dados retornados das consultas realizadas. Consulte a seção **[Dados de inquiry (inquiry_data)](#dados-de-inquiry-inquiry_data)**. |

### Analysis Steps Object

| Campo | Tipo | Descrição |
|---|---|---|
| `analysis_step_type` | string | Tipo da etapa. **[Tipos de análise individual](#tipos-de-análise-individual)** |
| `analysis_step_status` | string | Status da etapa individual (`approved` ou `reproved`). |
| `reason` | string | Razão da aprovação ou reprovação, definida em regra pelo cliente. |
| `output_data` | object | Dados de saída específicos da etapa. |

### `output_data` para `credit_analysis`

:::info Importante
Todos os campos do `output_data` são configuráveis nas regras de análise. Caso a regra não esteja configurada para retornar um determinado campo, ele será retornado vazio ou não estará presente no payload.
:::

| Campo | Tipo | Descrição |
|---|---|---|
| `analysis_score` | number | Score da análise de crédito. |
| `credit_model_score` | number | Score do modelo de crédito. |
| `maximum_monthly_interest_rate` | number | Taxa de juros mensal máxima. |
| `minimum_monthly_interest_rate` | number | Taxa de juros mensal mínima. |
| `maximum_installments_number` | number | Número máximo de parcelas. |
| `minimum_installments_number` | number | Número mínimo de parcelas. |
| `maximum_disbursed_issue_amount` | number | Valor máximo de desembolso. |
| `minimum_disbursed_issue_amount` | number | Valor mínimo de desembolso. |

### Dados de inquiry (`inquiry_data`)

O array `inquiries` no webhook contém os dados retornados das consultas realizadas durante a análise. Cada item possui os campos `inquiry_type` (tipo da consulta) e `inquiry_data` (dados retornados).

Para o tipo `private_payroll`, o objeto `inquiry_data` segue o mesmo padrão de resposta da **Consulta de dados do trabalhador** do consignado privado, incluindo dados pessoais, margem consignável, histórico do vínculo, empréstimos ativos e alertas.

A documentação completa dos campos, enumeradores e exemplos de resposta do `inquiry_data` está disponível em:

> **[Consultas do Trabalhador — 2. Consulta de dados do trabalhador](/documentation/manual_consignado_privado/manual_consultas_trabalhador#consulta-de-dados)**

---

## Enumeradores

### Enumeradores Lending Analysis Type

| Campo | Descrição |
|---|---|
| `private_payroll` | Análise de crédito consignado privado |

### Status da análise

> `analysis_status` (POST 202, GET de elegibilidade, GET de status e webhook `data.analysis_status`)

| Status | Descrição |
|---|---|
| `pending_inquiry` | A análise foi criada e aguarda a consulta inicial (estado inicial). |
| `pending_analysis` | A consulta inicial foi concluída e as etapas de análise (onboarding, análise de crédito) estão em execução. |
| `approved` | A análise foi aprovada (terminal). |
| `reproved` | A análise foi reprovada (terminal). |
| `failed` | A análise falhou por erro técnico ou indisponibilidade de provedor externo (terminal). |

> O webhook `data.analysis_status` é emitido apenas com valores terminais (`approved`, `reproved`, `failed`).

### Status do webhook

> `status` (campo raiz do webhook)

| Status | Descrição |
|---|---|
| `completed` | O processamento foi concluído |
| `failed` | O processamento falhou |

### Tipos de análise individual

> `analysis_step_type` (dentro do array `analysis_steps`)

| Enumerador | Descrição |
|---|---|
| `onboarding_natural_person` | Análise de onboarding/cadastro do tomador. |
| `credit_analysis_natural_person` | Análise de crédito do tomador. |

### Status da análise individual

> `analysis_step_status` (dentro do array `analysis_steps`)

| Status | Descrição |
|---|---|
| `approved` | Análise individual aprovada. |
| `reproved` | Análise individual reprovada. |
| `failed` | Análise individual falhou por erro técnico ou indisponibilidade de provedor externo. |

---

## Sandbox — Casos de teste

:::danger Aviso Importante!
Não utilize dados pessoais reais (CPF, CNPJ, etc.) em ambientes de sandbox.
:::

No ambiente de sandbox, o resultado da análise é determinado pelo valor do campo `analysis_data.name` no body da requisição. Utilize os nomes abaixo para simular diferentes cenários:

| Nome (`analysis_data.name`) | Resultado do onboarding | Resultado da credit_analysis | Status final (`analysis_status`) |
|---|---|---|---|
| `Ana Santos` | `approved` | `approved` | `approved` |
| `Carlos Oliveira` | `approved` | `reproved` | `reproved` |
| `Mariana Costa` | `reproved` | — | `reproved` |
| `Pedro Almeida` | `approved` | — | `approved` |
| `Fernanda Lima` | `reproved` | — | `reproved` |

:::info Como funciona
- **Onboarding approved + Credit analysis approved** (`Ana Santos`): a análise completa é aprovada. O webhook retorna `analysis_status: "approved"` com ambas as etapas aprovadas.
- **Onboarding approved + Credit analysis reproved** (`Carlos Oliveira`): o onboarding é aprovado mas a análise de crédito reprova. O webhook retorna `analysis_status: "reproved"`.
- **Onboarding reproved** (`Mariana Costa`, `Fernanda Lima`): o onboarding reprova e a análise de crédito não é executada. O webhook retorna `analysis_status: "reproved"` com apenas a etapa de onboarding.
- **Only onboarding approved** (`Pedro Almeida`): apenas o onboarding é executado e aprovado, sem análise de crédito. O webhook retorna `analysis_status: "approved"` com apenas a etapa de onboarding.
:::

Webhook — Sandbox com nome "Ana Santos"

```json
{
    "key": "3571e292-3a83-4011-904d-20ee963022ef",
    "status": "completed",
    "webhook_type": "laas.lending_analysis.status_change",
    "event_datetime": "2026-03-12T10:05:00Z",
    "data": {
        "request_identifier_key": "sandbox-test-001",
        "analysis_status": "approved",
        "analysis_steps": [
            {
                "analysis_step_type": "onboarding_natural_person",
                "analysis_step_status": "approved",
                "reason": "Passou nas validações",
                "output_data": {}
            },
            {
                "analysis_step_type": "credit_analysis_natural_person",
                "analysis_step_status": "approved",
                "reason": "Score acima do mínimo",
                "output_data": {
                    "analysis_score": 750,
                    "credit_model_score": 720,
                    "maximum_monthly_interest_rate": 0.0449,
                    "minimum_monthly_interest_rate": 0.0199,
                    "maximum_installments_number": 24,
                    "minimum_installments_number": 3,
                    "maximum_disbursed_issue_amount": 15000.00,
                    "minimum_disbursed_issue_amount": 500.00
                }
            }
        ],
        "inquiries": [
            {
                "inquiry_type": "private_payroll",
                "inquiry_data": {
                    "document_number": "99999999999",
                    "registration_number": "99999999999-A",
                    "employer_document_number": "99999999999962",
                    "name": "ANA SANTOS",
                    "gender": "female",
                    "birth_date": "1990-05-15",
                    "worker_category_code": 101,
                    "eligible": true,
                    "available_margin_amount": 8000.00,
                    "base_margin_amount": 6500.00,
                    "total_due_amount": 3200.00,
                    "admission_date": "2018-09-01",
                    "termination_date": null,
                    "termination_reason_code": null,
                    "political_exposition": "not_exposed",
                    "employer_name": "EMPRESA XYZ LTDA",
                    "mother_name": "LUCIA SANTOS",
                    "nationality": {
                        "code": 76,
                        "description": "BRASIL"
                    },
                    "occupation": {
                        "code": 411010,
                        "description": "AUXILIAR DE ESCRITORIO"
                    },
                    "economic_activity": {
                        "code": 6499999,
                        "description": "OUTRAS ATIVIDADES DE SERVICOS FINANCEIROS"
                    },
                    "ineligibility_reason": "not_informed",
                    "employer_activity_start_date": "2005-01-10",
                    "legacy_loans": [],
                    "alerts": []
                }
            }
        ]
    }
}
```

Webhook — Sandbox com nome "Carlos Oliveira" (credit_analysis reproved)

```json
{
    "key": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "status": "completed",
    "webhook_type": "laas.lending_analysis.status_change",
    "event_datetime": "2026-03-12T10:05:00Z",
    "data": {
        "request_identifier_key": "sandbox-test-002",
        "analysis_status": "reproved",
        "analysis_steps": [
            {
                "analysis_step_type": "onboarding_natural_person",
                "analysis_step_status": "approved",
                "reason": "Passou nas validações",
                "output_data": {}
            },
            {
                "analysis_step_type": "credit_analysis_natural_person",
                "analysis_step_status": "reproved",
                "reason": "Score do Serasa menor que 500",
                "output_data": {
                    "analysis_score": 100,
                    "credit_model_score": 100,
                    "maximum_monthly_interest_rate": 0.00,
                    "minimum_monthly_interest_rate": 0.00,
                    "maximum_installments_number": 10,
                    "minimum_installments_number": 1,
                    "maximum_disbursed_issue_amount": 4500.00,
                    "minimum_disbursed_issue_amount": 0.00
                }
            }
        ],
        "inquiries": [
            {
                "inquiry_type": "private_payroll",
                "inquiry_data": {
                    "document_number": "99999999999",
                    "registration_number": "99999999999-A",
                    "employer_document_number": "99999999999962",
                    "name": "CARLOS OLIVEIRA",
                    "gender": "male",
                    "birth_date": "1988-11-22",
                    "worker_category_code": 101,
                    "eligible": true,
                    "available_margin_amount": 3500.00,
                    "base_margin_amount": 3000.00,
                    "total_due_amount": 12500.00,
                    "admission_date": "2019-06-10",
                    "termination_date": null,
                    "termination_reason_code": null,
                    "political_exposition": "not_exposed",
                    "employer_name": "EMPRESA XYZ LTDA",
                    "mother_name": "ROSA OLIVEIRA",
                    "nationality": {
                        "code": 76,
                        "description": "BRASIL"
                    },
                    "occupation": {
                        "code": 724325,
                        "description": "SOLDADOR ELETRICO"
                    },
                    "economic_activity": {
                        "code": 2833000,
                        "description": "FABRICACAO DE MAQUINAS E EQUIPAMENTOS PARA A AGRICULTURA E PECUARIA"
                    },
                    "ineligibility_reason": "not_informed",
                    "employer_activity_start_date": "2010-05-12",
                    "legacy_loans": [],
                    "alerts": []
                }
            }
        ]
    }
}
```

Webhook — Sandbox com nome "Mariana Costa" (onboarding reproved)

```json
{
    "key": "c3d4e5f6-a7b8-9012-cdef-123456789012",
    "status": "completed",
    "webhook_type": "laas.lending_analysis.status_change",
    "event_datetime": "2026-03-12T10:05:00Z",
    "data": {
        "request_identifier_key": "sandbox-test-003",
        "analysis_status": "reproved",
        "analysis_steps": [
            {
                "analysis_step_type": "onboarding_natural_person",
                "analysis_step_status": "reproved",
                "reason": "Documentação inválida",
                "output_data": {}
            }
        ],
        "inquiries": [
            {
                "inquiry_type": "private_payroll",
                "inquiry_data": {
                    "document_number": "99999999999",
                    "registration_number": "99999999999-A",
                    "employer_document_number": "99999999999962",
                    "name": "MARIANA COSTA",
                    "gender": "female",
                    "birth_date": "1992-03-08",
                    "worker_category_code": 101,
                    "eligible": true,
                    "available_margin_amount": 6000.00,
                    "base_margin_amount": 5000.00,
                    "total_due_amount": 2100.00,
                    "admission_date": "2021-01-15",
                    "termination_date": null,
                    "termination_reason_code": null,
                    "political_exposition": "not_exposed",
                    "employer_name": "EMPRESA XYZ LTDA",
                    "mother_name": "PAULA COSTA",
                    "nationality": {
                        "code": 76,
                        "description": "BRASIL"
                    },
                    "occupation": {
                        "code": 252305,
                        "description": "ANALISTA DE SISTEMAS"
                    },
                    "economic_activity": {
                        "code": 6201500,
                        "description": "DESENVOLVIMENTO DE PROGRAMAS DE COMPUTADOR SOB ENCOMENDA"
                    },
                    "ineligibility_reason": "not_informed",
                    "employer_activity_start_date": "2015-08-20",
                    "legacy_loans": [],
                    "alerts": []
                }
            }
        ]
    }
}
```

---

## Referências

- [Consultas do Trabalhador — Consignado Privado](https://docs.qitech.com.br/documentation/manual_consignado_privado/manual_consultas_trabalhador) — Documentação completa sobre consulta de vínculos e consulta de dados do trabalhador, incluindo detalhamento do `authorization_term`.

---

# Assinatura em Lote

URL: /en/documentation/manual_exercito/assinatura-em-lote

Agrupa **várias operações do consignado militar** em **um único envelope** de assinatura do QI Sign. Você abre o lote, cria as operações referenciando o `document_batch_key`, confere (opcionalmente limpa) e dispara o envio para assinatura.

Fluxo recomendado para [compra de dívida](./04-portabilidade-refin.md) — onde N duplas `debt_purchase` + `refinancing` + 1 refin/refin consolidador podem ser assinadas num único envelope (militar assina uma vez só).

:::caution Regras do lote
**Mesma titularidade:** todas as operações do lote devem ser do **CPF** (ou do **mesmo representante legal**) do militar. Incluir CPF "A" e CPF "B" no mesmo lote gera **erro síncrono** no `POST /debt`.

**Tipos permitidos:** o lote do Exército aceita apenas `POST /debt` com `collateral_type: military_payroll`.
:::

## 1. Abrir o lote

ENDPOINT /document/document_batch
MÉTODO POST

**Request Body**

```json
{
  "type": "military_payroll_external_batch",
  "certifier_type": "qi_sign",
  "batch_name": "Lote EB compra-divida - 5ed20003-0610-46d2-88cc-a5d0de640696",
  "request_control_key": "5ed20003-0610-46d2-88cc-a5d0de640696"
}
```

### Campos chave

| Campo | Tipo | Descrição |
|---|---|---|
| `type` | string | Fixo: **`military_payroll_external_batch`** |
| `certifier_type` | string | Fixo: **`qi_sign`** |
| `batch_name` | string | Nome identificador do lote (**máximo 100 caracteres**) |
| `request_control_key` | string (UUIDv4) | **Idempotência** — não reutilize entre lotes |

**Response Body**

```json
{
  "document_batch_key": "17f35e19-a039-468f-aaa7-84aa8edec3dc"
}
```

Guarde o `document_batch_key` retornado — ele é referenciado em todas as próximas chamadas.

## 2. Incluir operações no lote

Ao criar cada operação militar, envie **`document_batch_key` na raiz** do payload do `POST /debt` (mesmo nível dos demais campos principais).

ENDPOINT /debt
MÉTODO POST

```json
{
  "document_batch_key": "17f35e19-a039-468f-aaa7-84aa8edec3dc",
  "borrower": { "...": "demais campos do borrower" },
  "financial": { "...": "demais campos financeiros" },
  "operation_type": "refinancing",
  "collaterals": [
    {
      "collateral_type": "military_payroll",
      "collateral_data": {
        "reservation_type": "refinancing",
        "registration_code": "146254221",
        "token": "12345678"
      }
    }
  ],
  "modality": { "code": "0202" },
  "refinanced_credit_operations": [
    { "...": "operation_key + contrato externo (ver Portabilidade + Refin)" }
  ]
}
```

O restante do body segue o contrato do `POST /debt`. Consulte os roteiros da [Margem Livre](./03-margem-livre.md) ou [Portabilidade + Refinanciamento](./04-portabilidade-refin.md) conforme a modalidade.

:::tip Compra de dívida cabe num lote só
Pra [compra de dívida](./04-portabilidade-refin.md) (`debt_purchase` + `refinancing` port-enrustido), todas as duplas Op A + Op B + o refin/refin consolidador podem entrar no mesmo lote.
:::

## 3. Consultar documentos do lote

Recomendado **antes de fechar o lote** para conferir os documentos agrupados.

ENDPOINT /document/document_batch/DOCUMENT_BATCH_KEY
MÉTODO GET

**Response Body**

```json
{
  "document_batch_key": "1eee4ec2-05f5-45ef-aa64-38bb3d9de02f",
  "documents": [
    {
      "document_key": "5cca1dad-28fe-4f19-8bbb-0edd6f042384",
      "document_type": "ccb_pre_price_days"
    },
    {
      "document_key": "c109d589-ae18-4f4f-ad31-2879bf714c71",
      "document_type": "ccb_pre_price_days"
    }
  ]
}
```

## 4. Limpar documentos do lote (opcional)

Remove **todos os documentos** vinculados ao lote — útil pra reagrupar do zero se identificar inconsistência antes do envio.

ENDPOINT /document/document_batch/DOCUMENT_BATCH_KEY/documents
MÉTODO DELETE

Body vazio. Response: HTTP 200.

## 5. Enviar para assinatura

Fecha o lote e dispara os documentos pro QI Sign. **Antes desse PUT, os documentos não vão pro militar.** É o gatilho final.

ENDPOINT /document/document_batch/DOCUMENT_BATCH_KEY/send_to_signature
MÉTODO PUT

Body: `{}`. Response: HTTP 200.

## Erros comuns

| HTTP | Código | Endpoint | Quando ocorre |
|---|---|---|---|
| 404 | `DOC000007` | `GET /document/document_batch/DOCUMENT_BATCH_KEY` | `document_batch_key` inexistente |
| 409 | `DOC000103` | `POST /document/document_batch` | `request_control_key` duplicado (idempotência violada) |

**Exemplo — DOC000103 (idempotência)**

```json
{
  "code": "DOC000103",
  "title": "Bad Request",
  "description": "request_control_key already exists",
  "translation": "Chave de controle da request já existe.",
  "http_status": 409
}
```

:::info Conflito de titularidade
Validação de **mesmo CPF/representante** no lote retorna erro no `POST /debt` (não no endpoint do lote). O corpo de erro segue o catálogo do `/debt`.
:::

---

# Cancelamento, Desaverbação e Reversal

URL: /en/documentation/manual_exercito/cancelamento

Cancelar uma operação militar tem dois eixos independentes:
1. **Cancelamento da CCB** — estado da operação no LaaS, e eventual estorno do dinheiro desembolsado.
2. **Desaverbação no Zetra** — liberação da margem em folha de pagamento.

Os dois acontecem de forma assíncrona e nem sempre simultâneos. Cancelar a operação NÃO libera a margem instantaneamente; pagar de volta o dinheiro desembolsado também é um passo separado.

## 1. Pré-desembolso — Cancelamento Imediato

Antes do desembolso (operação em `waiting_signature`, `signature_finished` ou `waiting_disbursement`):

```http
PATCH /debt/{DEBT_KEY}/cancel
```

Sem body. Resposta imediata: operação vai pra `canceled`. Não há reversal financeiro (dinheiro nem saiu).

Webhook: `debt` com `status: canceled` + `cancel_reason_enumerator` indicando o motivo (`manual`, `waiting_signature`, `not_collateral_constituted`, etc.).

A QI dispara em seguida a desaverbação no Zetra (ver seção 4).

## 2. Pós-desembolso — Janela de Desistência (7 dias úteis)

**A janela legal de desistência é de 7 dias úteis** após o desembolso. Dentro dela:

```http
PATCH /debt/{DEBT_KEY}/cancel
```

A response **NÃO é instantânea como o pré-desembolso** — retorna um **PIX QR Code** que o borrower deve pagar pra devolver o dinheiro desembolsado. O parceiro repassa o QR pro cliente.

| Campo na response | Significado |
|---|---|
| `cancel_qr_code.qr_code_url` / `digitable_line` | PIX copia-e-cola ou QR pra pagamento |
| `cancel_qr_code.amount` | Valor a devolver (igual ao desembolsado) |
| `cancel_qr_code.expiration` | Prazo pro pagamento (15 dias úteis após desembolso) |

Quando o borrower paga o PIX:
1. QI confirma o pagamento.
2. Dispara o **reversal financeiro automático** — desfaz o desembolso, devolve pro fundo.
3. Webhook `reversal` chega:
   ```json
   {
     "webhook_type": "reversal",
     "credit_operation_key": "<uuid>",
     "contract_number": "<...>",
     "reversal": {
       "status": "pending_fund",
       "amount": 2026.93,
       "amount_to_send": 2026.93,
       "is_total": true,
       "is_operation_canceled": true,
       "reversal_key": "<uuid>",
       "date": "2026-09-06"
     }
   }
   ```
4. QI dispara a desaverbação no Zetra.
5. Operação vai pra `canceled`.

> [!warning] Prazo de pagamento do QR
> O QR tem validade de **15 dias úteis após o desembolso** (não após emissão do QR). Se o borrower não pagar dentro desse prazo, o cancelamento expira e a operação volta a ser ativa — vira inadimplência normal (cobrança de parcelas segue o curso).

Restrições pós-desembolso:
- Operação precisa estar em status `open` (sem parcelas pagas).
- Pagamento parcial de qualquer parcela bloqueia o cancelamento.
- Não há cancelamento parcial — só total.

## 3. Cancelamento Permanente

```http
PATCH /debt/{DEBT_KEY}/cancel/permanent
```

Marca como `canceled_permanently` — não há volta. Útil pra:
- Cliente desistiu e não vai pagar o QR (vira inadimplência → permanent depois)
- Operação que ficou pendente além do prazo (auto-cancel já faz isso em 7 dias, mas pode forçar)

Sem reversal automático — usar apenas se o dinheiro já foi resolvido por fora ou nunca saiu.

## 4. Desaverbação no Zetra

Independente do cancelamento financeiro, a desaverbação é processada pelo Zetra de forma assíncrona:

![Fluxo de cancelamento Exército](/img/diagrams/exercito-cancelamento.svg)

| Status no `credit_operation.collateral` | Significado |
|---|---|
| `waiting_confirmation` | Zetra ainda processando a desaverbação |
| `successfully_deleted` | Margem liberada |
| `communication_error` | Zetra indisponível (cod 241) — QI retenta automaticamente |

> [!warning]
> **Não considere a margem liberada até `successfully_deleted` chegar.** Emitir nova operação no mesmo militar antes da desaverbação confirmada retorna `consignable_margin_exceeded`.

Pra consultar o estado:

```http
GET /debt/{DEBT_KEY}/collateral
```

Retorna `last_response` + `reservation_status` atual.

## 5. Auto-cancelamento (7 dias)

Operações em status `canceled` (não-permanente) por mais de **7 dias** são automaticamente convertidas em `canceled_permanently` pelo sistema. Aplica-se a:
- Operação cuja averbação foi recusada (`consent_refused`)
- Operação cuja averbação expirou (`consent_expired`)
- Operação pendente de assinatura além do prazo
- Operação com cancelamento solicitado mas QR não pago dentro de 15 dias úteis

Não precisa fazer nada — o sistema cancela e desaverba sozinho.

## Resumo dos Endpoints

| Endpoint | Quando usar | Reversal automático? |
|---|---|---|
| `PATCH /debt/{KEY}/cancel` (pré-desembolso) | Antes do desembolso | Não aplica (dinheiro não saiu) |
| `PATCH /debt/{KEY}/cancel` (pós-desembolso) | Dentro de 7 dias úteis após desembolso | Sim — após borrower pagar o PIX QR retornado |
| `PATCH /debt/{KEY}/cancel/permanent` | Cancelamento definitivo (sem volta) | Não — uso administrativo |

## Cancel reasons no webhook `debt` (`status: canceled`)

Os principais `cancel_reason_enumerator` que aparecem:

| Enumerador | Significado |
|---|---|
| `manual` | Cancelado via API ou portal |
| `waiting_signature` | Não assinou no prazo |
| `not_collateral_constituted` | Averbação falhou |
| `is_portability` | Portabilidade falhou |
| `pix_max_retry` | Muitas falhas no desembolso PIX |
| `lack_of_resource` | Sem recurso pra desembolsar |
| `kyc_not_accepted` | KYC reprovado |

→ [Lista completa de enumeradores em Mapa de Status](./08-mapa-de-status.md)

---

# Consulta de Margem Consignável

URL: /en/documentation/manual_exercito/consulta-margem

Endpoint que consulta a margem disponível do militar no Zetra (eConsig). É o **primeiro passo operacional** depois do upload da autorização — sem o `balance_key` desse passo, não dá pra simular nem emitir.

## Pré-requisitos

1. **Upload do consentimento** feito (`POST /upload` → `document_key`). → [Upload de Documentos](../upload_de_documentos/)
2. **Token Zetra** do militar em mãos (senha do sistema militar).

## Endpoint

```http
POST /military_payroll/balance
```

| Campo | Tipo | Descrição |
|---|---|---|
| `document_number` | string | CPF do militar — 11 dígitos, sem `.` e sem `-`, zero-padded |
| `registration_code` | string | Matrícula do militar |
| `authorization_document_key` | uuid | `document_key` retornado no upload |
| `token` | string | Token de autenticação Zetra (senha) |

Resposta síncrona:

```json
{
  "balance_key": "81da8afb-e1b2-4215-8093-c4b5feab8a9f",
  "status": "pending_search"
}
```

## Webhook de resultado

Tipo: `military_payroll.balance.status_change`

Campos no payload de **sucesso**:
- `balance` — margem disponível (Decimal)
- `allowed_installment_numbers` — array de prazos válidos (ex: `[24, 36, 48]`)
- `military_unit` — unidade do militar
- `military_branch` — força (string longa, dezenas de valores possíveis: `AMAN`, `Sistema de Retribuição do Exterior`, etc.)
- `category` — `ATIVO`, `INATIVO`, `PENSIONISTA`
- `name`, `document_number`, `registration_code`, `birth_date`, `grant_date`

## Enumeradores de falha

| Enumerador | Zetra code | Significado | Ação |
|---|---|---|---|
| `invalid_registration_code` | 210 | Matrícula inválida ou inexistente | Verificar matrícula |
| `military_not_found` | 293 | Militar não encontrado pelo CPF+matrícula | Verificar dados |
| `military_blocked` | 352 | Militar com bloqueio em folha | Não há ação imediata |
| `communication_error` | 241 | Zetra indisponível | QI retenta automaticamente |

## Sandbox

A sandbox militar **conecta na Zetra real de homologação** (`central_homologa.econsig.com.br`) — não há whitelist local de CPFs no `military-payroll-api`. Os dados de teste (CPFs, matrículas, tokens) são fornecidos pela Zetra.

Solicite ao time de Integrações QI Tech a lista de servidores fictícios disponíveis. CPFs fora dessa lista retornam `military_not_found` (Zetra 293) ou `invalid_registration_code` (Zetra 210).

→ [Mocks (Sandbox) — detalhes completos](./09-mocks-sandbox.md)

## Próximo passo

Após o webhook `succeeded` com `balance` retornado, escolha a modalidade:

- [Margem Livre](./03-margem-livre.md) — crédito novo com margem disponível
- [Portabilidade + Refinanciamento](./04-portabilidade-refin.md) — refin de operação QI ou compra de dívida externa

---

# Conta Interna para Desembolso

URL: /en/documentation/manual_exercito/conta-interna-desembolso

Em **compra de dívida**, **portabilidade** e **refinanciamento** do consignado militar (Exército), o desembolso da operação **não vai direto para a conta externa do tomador**: ele cai numa conta interna **em nome do tomador** (aberta pelo parceiro via `POST /account`). É a partir dessa conta que a QI executa as ações pós-desembolso — **quitação do contrato externo**, **repasse de troco**, **conciliação**.

:::tip Por que conta interna?
Concentrar o desembolso numa conta operacional dá controle do fluxo: a QI consegue orquestrar quitação externa + averbação + repasse de troco sem depender de SLA de banco terceiro no meio do processo.
:::

## Quando usar conta interna vs externa

| Cenário | `disbursement_bank_account` |
|---|---|
| [Margem Livre](./03-margem-livre.md) (crédito novo direto) | Conta **externa** do tomador |
| [Refinanciamento puro](./04-portabilidade-refin.md) (renegocia CO QI ativa) | Conta **interna** em nome do tomador |
| [Portabilidade](./04-portabilidade-refin.md) (com ou sem troco) | Conta **interna** em nome do tomador |
| [Compra de dívida](./04-portabilidade-refin.md) (`debt_purchase` + `refinancing` port-enrustido) | Conta **interna** em nome do tomador **nas duas operações da dupla** |
| Refin/refin consolidador (opcional, fecha várias port/refins) | Conta **interna** em nome do tomador |

## 1. Abrir a conta interna em nome do tomador

ENDPOINT /account
MÉTODO POST

A conta é aberta pelo **parceiro** (autenticado com seus `client_integration_key`), com o `owner_document_number` apontando para o **CPF do militar tomador**. Reutilize a conta existente — uma por tomador (não abrir nova a cada operação).

**Request Body**

```json
{
  "owner_document_number": "<CPF DO MILITAR>",
  "owner_person_key": "<PERSON_KEY DO MILITAR>",
  "requester_key": "<REQUESTER_KEY DO PARCEIRO>",
  "webhook_enabled": true
}
```

:::info Pré-requisito
O militar precisa estar **onboarded** previamente (ter `person_key`) — o parceiro envia esse `person_key` no `owner_person_key`. Caso contrário, o `/account` falha com `ACC000xxx` por validation.
:::

**Response Body**

```json
{
  "account_key": "1167955-...",
  "account_branch": "0001",
  "account_number": "1167955",
  "account_digit": "1",
  "owner_document_number": "<CPF DO MILITAR>",
  "owner_name": "<NOME DO MILITAR>",
  "bank_code": "329",
  "account_status": "active",
  "webhook_enabled": true
}
```

:::tip Idempotência por tomador
Se já existe conta ativa para esse `owner_document_number` no parceiro, evite chamar `POST /account` de novo — consulte `GET /accounts?owner_document_number= ` antes e reaproveite o `account_key` retornado.
:::

## 2. Usar a conta no `/debt`

Use os dados retornados em `disbursement_bank_account` no payload do `POST /debt`. **A mesma conta vai nas DUAS operações da dupla `debt_purchase` + `refinancing`** (e no `refinancing` consolidador, se houver).

```json
{
  "disbursement_bank_account": {
    "name": "<NOME DO MILITAR>",
    "bank_code": "329",
    "account_type": "checking_account",
    "account_branch": "0001",
    "account_number": "1167955",
    "account_digit": "1",
    "document_number": "<CPF DO MILITAR>",
    "transfer_method": "ted"
  }
}
```

| Campo | Valor (conta interna QI Tech) |
|---|---|
| `bank_code` | `"329"` (QI Tech S.A. — SCD) |
| `account_branch` | `"0001"` |
| `account_number` / `account_digit` | retornados no `POST /account` |
| `document_number` | **CPF do militar** (mesmo do `owner_document_number`) |
| `transfer_method` | `"ted"` (recomendado para `payment_type_id: 10`) |

Exemplo completo: ver [Portabilidade + Refinanciamento — Compra de dívida](./04-portabilidade-refin.md).

## 3. Ações pós-desembolso

A QI dispara as ações abaixo automaticamente conforme os webhooks confirmam cada etapa.

### 3.1 Conferir saldo

ENDPOINT /account/ACCOUNT_KEY/balance
MÉTODO GET

### 3.2 Quitação do contrato externo (port)

Disparada pela QI ao receber `credit_operation.collateral` (`reservation_status: deleted`) na operação antiga: saldo da conta interna é enviado ao banco origem via **PIX** ou **TED** para liquidar o contrato externo.

### 3.3 Repasse de troco pro tomador (se houver)

Se `final_disbursement_amount > 0` na simulação, o saldo residual é transferido da conta interna para a **conta externa do militar** (informada no onboarding ou no payload da operação).

### 3.4 Conciliação

ENDPOINT /account/ACCOUNT_KEY/statement
MÉTODO GET

Query params `from_date` e `to_date` no formato `YYYY-MM-DD`.

### 3.5 Webhooks relevantes

| Webhook | Quando dispara |
|---|---|
| `account.balance_change` | Crédito recebido na conta interna (desembolso da CO) |
| `pix_transfer.status_change` | Quitação externa OU repasse de troco confirmados |
| `ted.status_change` | Quitação externa OU repasse via TED confirmados |

## Referências

- [Conta de pagamento — fluxo completo](/documentation/contas/abertura_de_conta/fluxo_de_abertura_de_conta) — referência do `POST /account` em detalhes
- [Portabilidade + Refinanciamento](./04-portabilidade-refin.md) — usa essa conta em compra de dívida (`debt_purchase` + `refinancing`)
- [Webhooks](./07-webhooks.md) — eventos assíncronos da operação

---

# Modelos de Formalização

URL: /en/documentation/manual_exercito/formalizacao

A QI Tech suporta **5 modelos** de formalização da operação militar — escolha conforme a infraestrutura do parceiro (se já tem signature provider, se quer usar QI Sign, se vai usar biometria). Adicionalmente, pra agrupar várias operações num único envelope (recomendado em [compra de dívida](./04-portabilidade-refin.md)), use [Assinatura em Lote](./11-assinatura-em-lote.md).

:::tip Várias operações no mesmo envelope
Em compra de dívida com N duplas `debt_purchase` + `refinancing` (+ refin/refin consolidador), use [Assinatura em Lote](./11-assinatura-em-lote.md) (`POST /document/document_batch` com `type: military_payroll_external_batch`) — o militar assina tudo de uma vez só.
:::

## Modelos disponíveis

| Modelo | Quando usar |
|---|---|
| **QI Sign automático** (default) | Não precisa configurar nada — QI envia link de assinatura por email/SMS pro borrower |
| **QI Sign em lote** | Várias operações num único envelope; ver [Assinatura em Lote](./11-assinatura-em-lote.md) |
| **PDF assinado externamente** | Parceiro tem signature provider próprio; faz upload do PDF assinado |
| **Data-signature: opt-in** | Borrower clica "concordo" em um portal do parceiro; parceiro envia evidência |
| **Data-signature: zip** | Parceiro envia zip com evidências (logs, IPs, timestamps) |
| **Data-signature: selfie** | Biometria via CaaS (face match + liveness) |

## QI Sign Automático

Não requer chamada adicional após `/debt`. QI envia URL de assinatura pro borrower (email/SMS). Quando o borrower assina, webhook `debt` fires com `status: signature_finished` e a esteira segue.

Pré-requisito: o RequesterConfiguration tem `default_signature_method` apontando pra QI Sign.

## PDF assinado externamente

```http
POST /debt/{DEBT_KEY}/signed
```

```json
{
  "signed_document_key": "<uuid retornado pelo upload do PDF assinado>"
}
```

Pré-requisito: fazer upload do PDF assinado via `POST /upload` antes de chamar `/signed`.

## Data-signature: opt-in

```json
{
  "data_signature": {
    "type": "opt_in",
    "evidence": {
      "ip_address": "200.123.45.67",
      "user_agent": "Mozilla/5.0 ...",
      "timestamp": "2026-05-17T14:30:00Z"
    }
  }
}
```

## Data-signature: zip

Parceiro empacota evidências em `.zip` e envia via upload. O `signed_document_key` aponta pro zip.

## Data-signature: selfie

Requer integração com CaaS (face recognition + liveness). O `signed_document_key` aponta pra um `image_key` retornado pelo CaaS.

## Webhook após formalização

`debt` com `status: signature_finished` → indica que QI aceitou a formalização. Em seguida, a averbação é confirmada (se `reservation_method: issuing`) e o desembolso entra na fila.

## Próximo passo

Após o `signature_finished`, a operação segue automaticamente: averbação confirmada (se `issuing`) → desembolso PIX/TED → webhook `debt` (`disbursed`).

Para acompanhar via webhooks: [Webhooks](./07-webhooks.md). Para cancelar a qualquer momento: [Cancelamento](./06-cancelamento.md).

---

# Consignado do Exército — Introdução

URL: /en/documentation/manual_exercito/introducao

API para originação de **CCB consignado** para militares do Exército Brasileiro (ativos, inativos e pensionistas). A reserva de margem é feita via **Zetra (eConsig)** e o ciclo todo — consulta de margem, emissão, averbação, desembolso e cancelamento — passa por essa plataforma.

| Item | Valor |
|---|---|
| Autoridade pagadora | Exército Brasileiro / **Zetra (eConsig)** |
| Tipo de garantia (`collateral_type`) | `military_payroll` |
| Modelo de reserva | Averbação (assíncrona, consentida via documento de autorização) |
| Funcionamento | **24h por dia, todos os dias, inclusive feriados** |
| Modalidades suportadas | [Margem Livre (Crédito Novo)](./03-margem-livre.md) e [Portabilidade + Refinanciamento](./04-portabilidade-refin.md) |
| Token | **Obrigatório** na consulta de margem (senha do sistema militar) |
| Instrumento | CCB (via `POST /debt`) |

:::danger Atenção!
Os webhooks da QI Tech não devem ser mapeados de forma restrita.
Campos adicionais podem ser incluídos aos payloads dos webhooks retornados em nossas APIs.
:::

:::info Reenvio de Webhooks
Você pode consultar e reenviar webhooks seguindo as instruções detalhadas na documentação: [Reenvio de Webhooks](/documentation/notificacoes/reenvio_de_notificacoes).
:::

## Fluxo End-to-End

Em **margem livre** o desembolso vai direto pra conta externa do militar. Em **refinanciamento, portabilidade e compra de dívida** o desembolso vai pra uma **conta interna em nome do militar** (aberta pelo parceiro via `POST /account`) — daí a QI quita o contrato externo, repassa o troco e faz a conciliação. Ver [Conta Interna para Desembolso](./10-conta-interna-desembolso.md).

![Fluxo end-to-end Exército](/img/diagrams/exercito-introducao.svg)

## Modalidades

A operação se divide em quatro modalidades, escolhidas no `operation_type` e `collateral_data`:

| Modalidade | `operation_type` / `reservation_type` | Quando usar | Doc |
|---|---|---|---|
| **Margem Livre** (Crédito Novo) | `operation_type: structured_operation` / `reservation_type: new_credit` | Militar com margem disponível; sem dívida externa nem refin de operação ativa | [→ Margem Livre](./03-margem-livre.md) |
| **Refinanciamento** | `operation_type: refinancing` / `reservation_type: refinancing` + `operation_key` | Renegociar operação QI ativa (prazo/taxa), eventualmente liberando troco | [→ Port + Refin](./04-portabilidade-refin.md) |
| **Portabilidade** (com ou sem troco) | `operation_type: refinancing` / `reservation_type: refinancing` + `original_contract_number` | Trazer dívida de outro banco; pode incluir troco | [→ Port + Refin](./04-portabilidade-refin.md) |
| **Compra de dívida** (port enrustida) | `operation_type: debt_purchase` + `operation_type: refinancing` (dupla) | Trazer N dívidas externas; QI emite uma dupla `debt_purchase` + `refinancing` por contrato externo, com desembolso em [conta interna em nome do militar](./10-conta-interna-desembolso.md) | [→ Port + Refin](./04-portabilidade-refin.md) |

## Pré-requisitos

Antes de qualquer requisição (Consulta, Emissão, etc):
1. Upload do consentimento do militar via `POST /upload` → retorna `document_key`. Ver [Upload de Documentos](../upload_de_documentos/).
2. Conhecer o **token** (senha do sistema militar Zetra) do borrower — é obrigatório no payload de `POST /military_payroll/balance`.

## Referência por área

- [Consulta de Margem](./02-consulta-margem.md) — endpoint `/military_payroll/balance` + token Zetra
- [Margem Livre](./03-margem-livre.md) — Simulação + Emissão para `new_credit`
- [Portabilidade + Refinanciamento](./04-portabilidade-refin.md) — Simulação + Emissão para `refinancing` + payloads de compra de dívida (`debt_purchase` + `refinancing` port-enrustido)
- [Formalização](./05-formalizacao.md) — 5 modelos: QI Sign, PDF, opt-in, zip, selfie
- [Conta Interna para Desembolso](./10-conta-interna-desembolso.md) — POST `/account` em nome do militar + uso em compra de dívida + ações pós-desembolso
- [Assinatura em Lote](./11-assinatura-em-lote.md) — agrupar várias operações num único envelope QI Sign (`POST /document/document_batch`)
- [Cancelamento, Desaverbação e Reversal](./06-cancelamento.md) — pré + pós-desembolso + reversal automático
- [Webhooks](./07-webhooks.md) — todos os eventos assíncronos + payloads
- [Mapa de Status](./08-mapa-de-status.md) — enumeradores consolidados
- [Mocks (Sandbox)](./09-mocks-sandbox.md) — dados de teste e cenários end-to-end

---

# Mapa de Status

URL: /en/documentation/manual_exercito/mapa-de-status

Referência consolidada de todos os enumeradores que podem aparecer nas respostas síncronas e webhooks do produto consignado militar.

## Consulta de Margem (`military_payroll.balance.status_change`)

| Status | Significado |
|---|---|
| `pending_search` | Resposta síncrona — consulta enfileirada no Zetra |
| `succeeded` | Webhook — margem retornada com sucesso |
| `failed` | Webhook — falha (ver `failure_reason`) |

### Failure reasons

| Enumerador | Zetra code | Significado |
|---|---|---|
| `invalid_registration_code` | 210 | Matrícula inválida |
| `military_not_found` | 293 | CPF/matrícula sem registro |
| `military_blocked` | 352 | Militar com bloqueio em folha |
| `communication_error` | 241 | Zetra indisponível |
| `invalid_document_number` | — | CPF malformado |

## Averbação / Desaverbação (`credit_operation.collateral`)

| Enumerador | `reservation_status` | Significado |
|---|---|---|
| `successfully_accepted` | `pending_confirmation` | Zetra aceitou a requisição, aguardando confirmação |
| `successfully_reserved` | `reserved` | Margem reservada com sucesso |
| `successfully_deleted` | `deleted` | Margem desaverbada com sucesso |
| `waiting_confirmation` | — | Aguardando Zetra |
| `communication_error` | — | Erro de comunicação (cod 241) |
| `consignable_margin_exceeded` | — | Margem insuficiente (cod 359) |
| `consent_refused` | — | Militar recusou o consentimento |
| `consent_expired` | — | Janela de consentimento expirou |
| `expired_portability` | — | Janela de port expirou |
| `origin_contract_not_found` | — | Contrato origem (port/refin) não existe |
| `waiting_for_origin_contract_closure` | — | Aguardando quitação externa |

## Operação (`debt`)

| Status | Significado |
|---|---|
| `waiting_signature` | Aguardando assinatura |
| `signature_finished` | Assinatura concluída |
| `waiting_disbursement` | Aguardando desembolso |
| `disbursed` | Desembolsado |
| `canceled` | Cancelada (não-permanente, ainda recuperável) |
| `canceled_permanently` | Cancelada definitivamente |
| `settled` | Liquidada (todas as parcelas pagas) |

### Cancel reasons (`cancel_reason_enumerator`)

| Enumerador | Significado |
|---|---|
| `manual` | Cancelado via API ou portal |
| `waiting_signature` | Não assinou no prazo |
| `not_collateral_constituted` | Averbação falhou |
| `is_portability` | Portabilidade falhou |
| `pix_max_retry` | Muitas falhas no desembolso PIX |
| `lack_of_resource` | Sem recurso pra desembolsar |
| `kyc_not_accepted` | KYC reprovado |
| `agencia_conta_invalida` | Erro em dados bancários |
| `invalid_account` | Conta inválida |
| `rejected_payment` | Pagamento recusado pelo banco destino |
| `disbursing_error` | Erro genérico no desembolso |
| `entry_not_paid` | Entrada não paga (refin com troco negativo) |
| `bank_slip_paid` | Boleto já foi pago |
| `unsupported_transaction` | Tipo de conta não suporta a transação |

## Reversal (cancelamento pós-desembolso)

| Status | Significado |
|---|---|
| `pending_fund` | Reversal iniciado, aguardando devolução pro fundo |
| `completed` | Reversal completo |
| `failed` | Reversal falhou (raro — investigação manual) |

## Parcelas (`installment.status_change`)

| Status | Significado |
|---|---|
| `opened` | Aberta, ainda não venceu |
| `waiting_payment` | Aberta, na data de vencimento |
| `paid` | Paga em dia |
| `paid_early` | Paga antes do vencimento |
| `paid_partial` | Paga parcialmente |
| `paid_overdue` | Paga após o vencimento |
| `paid_partial_overdue` | Paga parcialmente após o vencimento |
| `overdue` | Em atraso |
| `canceled` | Cancelada |

## Recuperar último estado

Pra consultar o estado atual de uma operação a qualquer momento:

```http
GET /debt/{DEBT_KEY}/collateral
```

Retorna `last_response` (último enumerador) + `reservation_status` + timestamp da última atualização.

---

# Margem Livre (Crédito Novo)

URL: /en/documentation/manual_exercito/margem-livre

Esteira de **originação direta** quando o militar tem margem consignável disponível e não está trazendo dívida externa nem refinanciando operação ativa. Cobre simulação e emissão para `reservation_type: new_credit`.

Para refinanciar uma operação QI ativa ou trazer dívida de outro banco, ver [Portabilidade + Refinanciamento](./04-portabilidade-refin.md).

## Pré-requisitos

- `balance_key` recebido na [Consulta de Margem](./02-consulta-margem.md), com webhook `military_payroll.balance.status_change` em `status: succeeded`.
- `balance` retornado > parcela desejada × prazo.
- `token` Zetra do militar disponível.

## 1. Simulação

Antes de emitir, simule as condições para validar margem, prazo e cronograma.

### Request

ENDPOINT /debt_simulation
MÉTODO POST

**Request Body**

```json
{
  "borrower": {
    "person_type": "natural",
    "individual_document_number": "45507529710"
  },
  "financial": {
    "first_due_date": "2026-07-01",
    "installment_face_value": 500.00,
    "disbursement_date": "2026-06-01",
    "number_of_installments": 24,
    "monthly_interest_rate": 0.0205,
    "interest_type": "pre_price_days",
    "credit_operation_type": "ccb",
    "interest_grace_period": 0,
    "principal_grace_period": 0,
    "fine_configuration": {
      "monthly_rate": 0.01,
      "interest_base": "calendar_days",
      "contract_fine_rate": 0.02
    }
  },
  "collaterals": [
    {
      "collateral_type": "military_payroll",
      "percentage": 1,
      "collateral_data": {
        "reservation_type": "new_credit",
        "registration_code": "146254221"
      }
    }
  ]
}
```

#### Campos chave

| Campo | Descrição |
|---|---|
| `collaterals[].collateral_type` | **`military_payroll`** (obrigatório) |
| `collaterals[].collateral_data.reservation_type` | **`new_credit`** — sempre pra margem livre |
| `collaterals[].collateral_data.registration_code` | Matrícula do militar |
| `financial.installment_face_value` | Parcela — ≤ `balance` retornado na consulta de margem |
| `financial.number_of_installments` | Prazo — ∈ `allowed_installment_numbers` |
| `financial.monthly_interest_rate` | Taxa mensal (ex: `0.0205` = 2,05% a.m.) |

`modality.code` **NÃO** é obrigatório em margem livre — só em refinanciamento.

### Response

Síncrona — retorna o cronograma completo (`disbursement_options[]` com parcelas, IOF, CET).

## 2. Emissão

Cria a CCB e dispara a esteira de averbação → formalização → desembolso.

### Request

ENDPOINT /debt
MÉTODO POST

**Request Body**

```json
{
  "borrower": {
    "name": "JOÃO DA SILVA",
    "email": "joao@email.com",
    "phone": { "number": "900000000", "area_code": "11", "country_code": "+55" },
    "address": {
      "city": "São Paulo", "state": "SP", "number": "215",
      "street": "Gilberto Sabino", "complement": "",
      "postal_code": "12345012", "neighborhood": "Pinheiros"
    },
    "role_type": "issuer",
    "birth_date": "1985-03-12",
    "mother_name": "MARIA DA SILVA",
    "person_type": "natural",
    "individual_document_number": "45507529710",
    "gender": "male",
    "nationality": "brasileiro",
    "is_pep": false,
    "marital_status": "single"
  },
  "financial": {
    "first_due_date": "2026-07-01",
    "installment_face_value": 500.00,
    "disbursement_date": "2026-06-01",
    "number_of_installments": 24,
    "monthly_interest_rate": 0.0205,
    "interest_type": "pre_price_days",
    "credit_operation_type": "ccb",
    "interest_grace_period": 0,
    "principal_grace_period": 0,
    "fine_configuration": {
      "monthly_rate": 0.01,
      "interest_base": "calendar_days",
      "contract_fine_rate": 0.02
    }
  },
  "simplified": true,
  "collaterals": [
    {
      "collateral_type": "military_payroll",
      "percentage": 1,
      "collateral_data": {
        "reservation_type": "new_credit",
        "reservation_method": "creation",
        "registration_code": "146254221",
        "token": "12345678"
      }
    }
  ],
  "disbursement_bank_account": {
    "name": "JOÃO DA SILVA",
    "bank_code": "104",
    "account_type": "checking_account",
    "account_digit": "1",
    "branch_number": "3880",
    "account_number": "000736703806",
    "document_number": "45507529710",
    "transfer_method": "pix"
  },
  "purchaser_document_number": "32402502000135"
}
```

#### `reservation_method` — quando a averbação dispara

**creation (averbação imediata)**

Averbação no Zetra dispara **junto com a criação do `/debt`**. Feedback rápido de margem antes da assinatura — ideal pra fluxos onde o operador quer saber logo se a margem reserva.

**issuing (averbação após formalização)**

Averbação só dispara **após a formalização** (`POST /debt/{KEY}/signed`). Usado quando a assinatura é coletada offline ou em fluxos onde o contrato chega já assinado.

#### Webhooks pós `/debt`

| Webhook | Status | Quando |
|---|---|---|
| `debt` | `waiting_signature` | Operação criada, aguardando assinatura |
| `credit_operation.collateral` | `successfully_accepted` → `successfully_reserved` | Averbação aceita pelo Zetra |
| `debt` | `disbursed` | Desembolso PIX/TED enviado |

→ Próximo passo: [Formalização](./05-formalizacao.md)

## Falhas comuns

| Webhook / Erro | Enumerador | Significado | Ação |
|---|---|---|---|
| Simulação | `INSUFFICIENT_MARGIN` | parcela × prazo > balance | Reduzir parcela ou prazo |
| Simulação | `INVALID_INSTALLMENT_NUMBER` | prazo fora de `allowed_installment_numbers` | Usar um dos prazos permitidos |
| `credit_operation.collateral` | `consignable_margin_exceeded` | margem insuficiente no momento da averbação (Zetra 359) | Reduzir parcela ou aguardar liberação |
| `credit_operation.collateral` | `military_blocked` | Militar com bloqueio em folha (Zetra 352) | Militar precisa resolver com Zetra |
| `credit_operation.collateral` | `communication_error` | Zetra indisponível (cod 241) | QI **retenta automaticamente** |

→ [Lista completa de enumeradores](./08-mapa-de-status.md)

## Sandbox

A sandbox militar **conecta na Zetra real de homologação** — não há whitelist local. Os exemplos de CPF/matrícula/token nesta página (`45507529710`, `146254221`, etc.) são apenas placeholders ilustrativos. Solicite ao time de Integrações QI Tech os dados reais cadastrados em `central_homologa.econsig.com.br`.

→ [Mocks (Sandbox)](./09-mocks-sandbox.md)

---

# Mocks (Sandbox)

URL: /en/documentation/manual_exercito/mocks-sandbox

:::caution Sandbox militar usa Zetra real de homologação
Ao contrário do SIAPE, o `military-payroll-api` em sandbox **NÃO usa mocks locais**. Em sandbox a integração aponta para o endpoint Host-a-Host de homologação da Zetra (eConsig):

- Sandbox: `https://www.econsig.com.br/central_homologa/services/HostaHostService-v8_0?wsdl`
- Produção: `https://api.econsig.com.br/central/services/HostaHostService`

Os dados de teste (CPFs, matrículas, tokens) são fornecidos **pela própria Zetra** via planilha de homologação oficial. **Suporte Zetra:** suporte@econsig.com.br.
:::

## Convênio QI Sociedade — Exército Brasileiro

| Item | Valor |
|---|---|
| **Cliente** | `QI_SOCIEDADE` |
| **Convênio** | `QI_SOCIEDADE-EB` |
| **Usuário API** | `qi_sociedade_xml` |
| **Senha API** | `qi12345` |
| **Código Serviço** | `001` |
| **Descrição Serviço** | `EMPRÉSTIMO` |
| **Código Verba** | `ZQD` |

## Servidores de Teste

Servidores fictícios cadastrados na Zetra homologação. Todos com **senha do servidor** = `abc123`.

### Cenário: Margem Negativa

Servidor sem margem disponível — toda tentativa de reserva retorna falha.

| # | Matrícula | CPF | Data Nascimento |
|---|---|---|---|
| 1 | `132722899` | `279.315.128-98` | 1983-04-01 |
| 2 | `143320397` | `213.628.178-05` | 1978-02-17 |

### Cenário: Margem Limite R$ 500,00

Margem reduzida — útil para testar limites e validação `INSUFFICIENT_MARGIN`.

| # | Matrícula | CPF | Data Nascimento |
|---|---|---|---|
| 3 | `346578694` | `432.108.069-00` | 1997-04-21 |
| 4 | `982435311` | `432.108.069-00` | 1993-03-20 |

> [!info]
> Matrículas 3 e 4 compartilham o mesmo CPF — útil para testar cenário "mesmo militar, múltiplas matrículas/órgãos".

### Cenário: Margem Limite R$ 10.000,00

Margem confortável — usar para testar fluxos completos de margem livre, refinanciamento e portabilidade.

| # | Matrícula | CPF | Data Nascimento |
|---|---|---|---|
| 5 | `346578694` | `540.770.447-15` | 1997-04-21 |
| 6 | `961683333` | `734.119.817-68` | 1963-04-09 |

### Cenário: BLOQUEADO

Servidor com bloqueio em folha — Zetra retorna `military_blocked` (código 352).

| # | Matrícula | CPF | Data Nascimento |
|---|---|---|---|
| 7 | `234674321` | `045.672.387-02` | 1975-01-01 |
| 8 | `342542124` | `472.635.472-87` | 1964-03-06 |

## Como mapear nos payloads QI

Quando construir o payload de `POST /military_payroll/balance`:

```json
{
  "document_number": "27931512898",
  "registration_code": "132722899",
  "authorization_document_key": "<document_key do POST /upload>",
  "token": "abc123"
}
```

- `document_number` — CPF sem máscara (remova `.` e `-` da tabela acima).
- `registration_code` — matrícula direto da tabela.
- `token` — senha do servidor (`abc123` para todos os testes).
- `authorization_document_key` — upload de qualquer PDF/PNG; em sandbox a Zetra não valida o conteúdo do termo.

## Webhook esperado por cenário

| Cenário | Webhook `military_payroll.balance.status_change` |
|---|---|
| Margem Negativa (1, 2) | `status: failed`, `failure_reason: invalid_balance` ou `consignable_margin_exceeded` |
| Margem Limite R$ 500 (3, 4) | `status: succeeded`, `balance: 500.00`, `allowed_installment_numbers: [...]` |
| Margem Limite R$ 10.000 (5, 6) | `status: succeeded`, `balance: 10000.00`, `allowed_installment_numbers: [...]` |
| BLOQUEADO (7, 8) | `status: failed`, `failure_reason: military_blocked` (Zetra 352) |
| CPF/matrícula fora da tabela | `status: failed`, `failure_reason: military_not_found` (Zetra 293) ou `invalid_registration_code` (Zetra 210) |

## Fluxo end-to-end recomendado

Para validar margem livre, use **teste 5** ou **teste 6** (margem alta):

1. `POST /upload` com PDF qualquer → `document_key`.
2. `POST /military_payroll/balance` com `27931512898` (margem negativa, pra testar failure) ou `54077044715` (margem 10k).
3. Aguardar webhook `military_payroll.balance.status_change`.
4. Em caso de sucesso, `POST /debt_simulation` com `installment_face_value` ≤ `balance` retornado.
5. `POST /debt` com `reservation_method: creation` (margem livre) ou `refinancing` (port/refin).
6. Aguardar webhook `credit_operation.collateral` (`successfully_accepted` → `successfully_reserved`).
7. `POST /debt/{KEY}/signed` com QI Sign ou data-signature opt-in.
8. Aguardar webhook `debt` (`disbursed`).
9. (opcional cancelamento) `PATCH /debt/{KEY}/cancel` dentro de 7 dias úteis → recebe PIX QR → simular pagamento → webhook `reversal`.

Para testar **portabilidade** com contrato externo, combine teste 5 ou 6 com um `original_contract_number` fictício (Zetra homologação aceita strings arbitrárias nesse campo durante port em sandbox).

## Códigos Zetra observados em sandbox

| Código | Mensagem | Mapeamento na QI |
|---|---|---|
| `000` | Operação realizada com sucesso | `succeeded` |
| `210` | Matrícula inválida | `invalid_registration_code` |
| `241` | Erro de comunicação | `communication_error` (QI retenta automaticamente) |
| `293` | Militar não encontrado | `military_not_found` |
| `352` | Militar bloqueado em folha | `military_blocked` |
| `359` | Margem consignável excedida | `consignable_margin_exceeded` |
| `360` | Margem disponível verificada | retorno de `consultarMargem` |

## Operação 24/7 em sandbox

A Zetra em homologação opera **24h/dia, todos os dias** — sem janela operacional restrita (mesmo comportamento da produção).

## Reset de reservas

Reservas Zetra em homologação **persistem indefinidamente** salvo cancelamento explícito. Limpe seu ambiente cancelando as reservas que não forem necessárias (`PATCH /debt/{KEY}/cancel`).

## Não há mocks locais ativos

O arquivo `src/connectors/zetra_mocker.py` no repo `military-payroll-api` existe mas **não é invocado** no fluxo de runtime — `EconsigConnector` chama diretamente o `ECONSIG_SERVICE_ADDRESS` configurado por ambiente. Se algum dia for necessário introduzir mocks locais (ex: Zetra fora do ar bloqueando QA), o `ZetraMocker` está disponível para ser ativado, mas hoje **toda integração de teste passa pela Zetra real de homologação**.

---

# Portabilidade + Refinanciamento

URL: /en/documentation/manual_exercito/portabilidade-refin

Fluxo de **compra de dívida de consignado militar** (Exército) via assinatura em lote. A QI Tech emite uma CCB de quitação (`debt_purchase`) que paga o banco vendedor, uma CCB de portabilidade (`portability`) que porta o contrato, e um `refinancing` consolidador **sempre obrigatório** que carrega seguro e troco. Tudo assinado uma única vez via QI Sign.

:::info Contas por operação
Cada operação do fluxo exige uma conta de desembolso distinta:

- **`debt_purchase`** → **conta interna QI** em nome do tomador. O desembolso cai nessa conta e quita a dívida origem no banco vendedor via `after_disbursement_actions` (boleto/PIX).
- **`refinancing`** → **conta externa do tomador**. O troco do refinanciamento é desembolsado nessa conta.

O parceiro abre a conta interna via `POST /account` antes da emissão. Ver [Conta Interna para Desembolso](./10-conta-interna-desembolso.md).
:::

## Cenários

O `refinancing` consolidador é **sempre obrigatório** no batch militar — é ele quem carrega seguro e troco.

| Cenário | Composição | Quando usar |
|---|---|---|
| **α** | 1× `debt_purchase` + 1× `portability` + 1× `refinancing` | Porta **uma** dívida externa |
| **β** | N× `debt_purchase` + N× `portability` + 1× `refinancing` | Porta **N dívidas** externas num único envelope |
| **γ** | α ou β + `financial.rebates` no `refinancing` | Qualquer composição acima com prêmio de seguro — gera `insurance_premium_term` automaticamente |

:::caution Regra do seguro e do troco
Seguro (`financial.rebates` com `fee_type: "insurance_premium_qi"`) e troco só podem ser enviados no `refinancing` consolidador (Passo 6).

- **`debt_purchase`** — `rebates` proibido (CCB de quitação não carrega seguro).
- **`portability`** — `rebates` proibido **e** `final_disbursement_amount` deve ser `0`.
:::

## Sequência de chamadas

```
0.  POST /debt_simulation  (opcional — condições do refinanciamento consolidado)

1.  POST /upload   (documentos do tomador)

2.  POST /account  (conta interna QI p/ debt_purchase)

3.  POST /document/document_batch      → criar envelope de assinatura

4.  POST /debt  (debt_purchase)        → desembolso em conta interna QI

5.  POST /debt  (portability)          → sem troco, sem seguro

6.  POST /debt  (refinancing)          → seguro + troco em conta externa

7.  PUT  /document/document_batch/{key}/send_to_signature
```

:::caution Ordem obrigatória de inserção no batch
`debt_purchase` deve ser inserido **antes** da `portability` que o referencia, e a `portability` **antes** do `refinancing` consolidador. Inverter a ordem dispara:

- **`DOC000110`** (HTTP 422) — `portability` cujo `refinanced_credit_operations[].operation_key` não casa com nenhum `debt_purchase` já inserido no batch.
- **`DOC000112`** (HTTP 422) — `refinancing` cujo `refinanced_credit_operations[].operation_key` não casa com nenhuma `portability` já inserida no batch.
:::

---

## 0. Simulação (opcional)

Antes de abrir o lote é possível simular as condições da operação consolidada — parcela, prazo, IOF, CET e troco — sem criar nada. A simulação é **uma só**, feita sobre o `refinancing` consolidador: as dívidas portadas entram como itens de `refinanced_credit_operations`. Não se simula `debt_purchase` nem `portability` separadamente.

ENDPOINT /debt_simulation
MÉTODO POST

:::info Como a dívida portada entra na simulação
Cada item de `refinanced_credit_operations` pode ser informado de duas formas:

- **Dívida externa** (ainda não existe na QI Tech) — informe `due_balance` com o saldo devedor do contrato no banco vendedor. Opcionalmente envie também `monthly_interest_rate` e `disbursement_date` da operação de origem: com esses dois campos a QI Tech **corrige o saldo** até a data de desembolso da nova operação; sem eles, o `due_balance` é usado exatamente como enviado.
- **Operação QI ativa** (refinanciamento puro) — informe `credit_operation_key`. O saldo devedor é calculado pela QI Tech.
:::

**Request Body**

**Dívida externa (port + refin)**

```json
{
  "borrower": {
    "person_type": "natural",
    "individual_document_number": "45507529710"
  },
  "financial": {
    "first_due_date": "2026-07-01",
    "installment_face_value": 500.00,
    "disbursement_date": "2026-06-01",
    "number_of_installments": 24,
    "monthly_interest_rate": 0.0185,
    "interest_type": "pre_price_days",
    "credit_operation_type": "ccb",
    "interest_grace_period": 0,
    "principal_grace_period": 0,
    "fine_configuration": {
      "monthly_rate": 0.01,
      "interest_base": "calendar_days",
      "contract_fine_rate": 0.02
    }
  },
  "collaterals": [
    {
      "collateral_type": "military_payroll",
      "percentage": 1,
      "collateral_data": {
        "reservation_type": "refinancing",
        "registration_code": "146254221"
      }
    }
  ],
  "refinanced_credit_operations": [
    {
      "due_balance": 8500.00,
      "monthly_interest_rate": 0.0225,
      "disbursement_date": "2024-03-15",
      "original_deadline": 60
    }
  ]
}
```

**Operação QI ativa (refin puro)**

```json
{
  "borrower": {
    "person_type": "natural",
    "individual_document_number": "45507529710"
  },
  "financial": {
    "first_due_date": "2026-07-01",
    "installment_face_value": 500.00,
    "disbursement_date": "2026-06-01",
    "number_of_installments": 24,
    "monthly_interest_rate": 0.0185,
    "interest_type": "pre_price_days",
    "credit_operation_type": "ccb",
    "interest_grace_period": 0,
    "principal_grace_period": 0,
    "fine_configuration": {
      "monthly_rate": 0.01,
      "interest_base": "calendar_days",
      "contract_fine_rate": 0.02
    }
  },
  "collaterals": [
    {
      "collateral_type": "military_payroll",
      "percentage": 1,
      "collateral_data": {
        "reservation_type": "refinancing",
        "registration_code": "146254221"
      }
    }
  ],
  "refinanced_credit_operations": [
    { "credit_operation_key": "<key da operação QI a refinanciar>" }
  ]
}
```

**Simulando pelo troco desejado**

```json
{
  "borrower": {
    "person_type": "natural",
    "individual_document_number": "45507529710"
  },
  "financial": {
    "first_due_date": "2026-07-01",
    "final_disbursement_amount": 2000.00,
    "disbursement_date": "2026-06-01",
    "number_of_installments": 24,
    "monthly_interest_rate": 0.0185,
    "interest_type": "pre_price_days",
    "credit_operation_type": "ccb",
    "interest_grace_period": 0,
    "principal_grace_period": 0,
    "fine_configuration": {
      "monthly_rate": 0.01,
      "interest_base": "calendar_days",
      "contract_fine_rate": 0.02
    }
  },
  "collaterals": [
    {
      "collateral_type": "military_payroll",
      "percentage": 1,
      "collateral_data": {
        "reservation_type": "refinancing",
        "registration_code": "146254221"
      }
    }
  ],
  "refinanced_credit_operations": [
    {
      "due_balance": 8500.00,
      "monthly_interest_rate": 0.0225,
      "disbursement_date": "2024-03-15"
    }
  ]
}
```

### Campos chave

| Campo | Descrição |
|---|---|
| `collaterals[].collateral_type` | **`military_payroll`** (obrigatório) |
| `collaterals[].collateral_data.reservation_type` | **`refinancing`** — a simulação representa o consolidador, mesmo quando há portabilidade de dívida externa |
| `collaterals[].collateral_data.registration_code` | Matrícula do militar no Zetra |
| `refinanced_credit_operations[].due_balance` | Saldo devedor da dívida portada. Obrigatório quando a dívida é **externa** (não existe `credit_operation_key`) |
| `refinanced_credit_operations[].monthly_interest_rate` | Taxa mensal do contrato de origem — usada, junto com `disbursement_date`, para corrigir o `due_balance` até o desembolso da nova operação |
| `refinanced_credit_operations[].disbursement_date` | Data de desembolso do contrato de origem |
| `refinanced_credit_operations[].original_deadline` | Prazo original do contrato de origem (informativo) |
| `refinanced_credit_operations[].credit_operation_key` | Chave da operação QI a refinanciar — alternativa ao `due_balance` |
| `financial.installment_face_value` | Parcela desejada — ≤ `balance` retornado na [Consulta de Margem](./02-consulta-margem.md) |
| `financial.final_disbursement_amount` | Troco desejado. Alternativa ao `installment_face_value`: o valor financiado vira `soma dos due_balance + troco` |
| `financial.number_of_installments` | Prazo — ∈ `allowed_installment_numbers` |

:::tip Cenário β (N dívidas portadas)
Para simular a portabilidade de **N** dívidas externas num único envelope, envie **N itens** em `refinanced_credit_operations`, cada um com seu `due_balance`. A simulação devolve as condições do consolidador que quita todas elas.
:::

:::note Diferenças em relação à emissão
- `modality.code` **não** é necessário na simulação — só na emissão (`POST /debt`) da `portability` e do `refinancing`.
- Não é preciso enviar `document_batch_key`, `disbursement_bank_account`, `purchaser_document_number` nem os dados cadastrais completos do tomador: na simulação o `borrower` se resume a `person_type` + `individual_document_number`.
- `portability_data` (com `origin_econsig_id` e `token`) também não entra na simulação — é exigido só na emissão da `portability`.
:::

### Response

Síncrona — retorna `disbursement_options[]` com cronograma de parcelas, IOF, CET e, quando há refinanciamento, o `due_balance` corrigido de cada dívida portada.

---

## 1. Upload dos documentos

Antes de abrir a conta e o lote, faça o **upload dos documentos** exigidos na operação via `POST /upload`. Cada chamada retorna um `document_key`, identificador do documento referenciado nas etapas seguintes.

ENDPOINT /upload
MÉTODO POST

→ Autenticação, headers, FormData e exemplos de código (Python / Node.js) em [Upload de Documentos](../upload_de_documentos/upload_de_documentos.md) .

:::caution Atenção
Salve o `document_key` retornado — ele é necessário para a consulta e o uso futuro do documento.
:::

---

## 2. Abrir a conta interna em nome do tomador

Em **compra de dívida**, **portabilidade** e **refinanciamento** do consignado militar (Exército), o desembolso da operação **não vai direto para a conta externa do tomador**: ele cai numa conta interna **em nome do tomador** (aberta pelo parceiro via `POST /account`). É a partir dessa conta que a QI executa as ações pós-desembolso — **quitação do contrato externo**, **repasse de troco**, **conciliação**.

ENDPOINT /account
MÉTODO POST

A conta é aberta pelo **parceiro** (autenticado com seus `client_integration_key`), com `account_owner.individual_document_number` apontando para o **CPF do militar tomador**. Reutilize a conta existente — uma por tomador (não abra uma nova a cada operação).

O campo `account_owner.document_identification` recebe o `document_key` retornado no **Passo 1** (upload do documento de identificação do tomador).

**Request Body**

```json
{
  "account_owner": {
    "person_type": "natural",
    "name": "JOÃO DA SILVA",
    "email": "joao@email.com",
    "individual_document_number": "<CPF DO MILITAR>",
    "mother_name": "MARIA DA SILVA",
    "birth_date": "1985-03-12",
    "is_pep": false,
    "document_identification": "<document_key DO PASSO 1>",
    "phone": {
      "country_code": "055",
      "area_code": "11",
      "number": "900000000"
    },
    "address": {
      "street": "Eixo Monumental",
      "state": "DF",
      "city": "Brasília",
      "neighborhood": "Asa Sul",
      "number": "215",
      "postal_code": "70000000"
    }
  }
}
```

### Campos chave

| Campo | Tipo | Descrição |
|---|---|---|
| `account_owner.person_type` | string | Fixo: **`natural`** (pessoa física) |
| `account_owner.individual_document_number` | string | **CPF do militar tomador** |
| `account_owner.document_identification` | string (UUID) | `document_key` do documento enviado no **Passo 1** |
| `account_owner.is_pep` | boolean | Indica se o tomador é pessoa politicamente exposta |

**Response Body**

```json
{
  "account_key": "1167955-...",
  "account_branch": "0001",
  "account_number": "1167955",
  "account_digit": "1",
  "owner_document_number": "<CPF DO MILITAR>",
  "owner_name": "<NOME DO MILITAR>",
  "bank_code": "329",
  "account_status": "active"
}
```

:::tip Idempotência por tomador
Se já existe conta ativa para esse `owner_document_number` no parceiro, evite chamar `POST /account` de novo — consulte `GET /accounts?owner_document_number= ` antes e reaproveite o `account_key` retornado.
:::

---

## 3. Abrir o lote

ENDPOINT /document/document_batch
MÉTODO POST

**Request Body**

```json
{
  "type": "military_payroll_external_batch",
  "certifier_type": "qi_sign",
  "batch_name": "Lote EB portabilidade - <UUID_UNICO>",
  "request_control_key": "<UUID_UNICO_2>"
}
```

### Campos chave

| Campo | Tipo | Descrição |
|---|---|---|
| `type` | string | Fixo: **`military_payroll_external_batch`** |
| `certifier_type` | string | Fixo: **`qi_sign`** |
| `batch_name` | string | Nome identificador do lote — **único** (não reutilize entre lotes) e **máximo 100 caracteres** |
| `request_control_key` | string (UUIDv4) | **Idempotência** — não reutilize entre lotes |

**Response Body**

```json
{
  "document_batch_key": "17f35e19-a039-468f-aaa7-84aa8edec3dc"
}
```

Guarde o `document_batch_key` retornado — ele é referenciado em todas as chamadas seguintes.

→ Para consultar, limpar documentos ou conferir o batch antes do envio, ver [Assinatura em Lote](./11-assinatura-em-lote.md).

---

## 4. Emitir `debt_purchase`

CCB de **quitação da dívida original**. A QI Tech vai pagar o banco vendedor.

ENDPOINT /debt
MÉTODO POST

:::info Particularidades do `debt_purchase`
- `document_batch_key` incluído na **raiz** do payload (mesmo nível de `borrower`, `financial`).
- `disbursement_bank_account` aponta para a **conta interna QI** do tomador (criada no Passo 2).
- `collaterals` vazio — o `debt_purchase` é a operação-ponte que carrega o saldo externo; **não** leva colateral.
- `after_disbursement_actions` na raiz define a quitação automática da dívida origem após o desembolso (boleto ou PIX do banco vendedor).
:::

**Request Body**

```json
{
  "borrower": {
    "name": "JOÃO DA SILVA",
    "email": "joao@email.com",
    "phone": { "number": "900000000", "area_code": "11", "country_code": "055" },
    "is_pep": false,
    "address": {
      "city": "Brasília",
      "state": "DF",
      "number": "215",
      "street": "Eixo Monumental",
      "complement": "",
      "postal_code": "70000000",
      "neighborhood": "Asa Sul"
    },
    "role_type": "issuer",
    "birth_date": "1985-03-12",
    "mother_name": "MARIA DA SILVA",
    "nationality": "Brasileiro",
    "person_type": "natural",
    "marital_status": "single",
    "individual_document_number": "45507529710",
    "gender": "male",
    "document_identification_type": "rg",
    "document_identification_number": "1234567",
    "document_identification_date": "2015-01-01"
  },
  "financial": {
    "first_due_date": "2026-07-01",
    "installment_face_value": 100,
    "disbursement_date": "2026-06-01",
    "limit_days_to_disburse": 5,
    "number_of_installments": 20,
    "monthly_interest_rate": 0.0185,
    "interest_type": "pre_price_days",
    "fine_configuration": {
      "monthly_rate": 0.01,
      "interest_base": "calendar_days",
      "contract_fine_rate": 0.02
    },
    "credit_operation_type": "ccb",
    "interest_grace_period": 0,
    "principal_grace_period": 0
  },
  "simplified": true,
  "collaterals": [],
  "requester_identifier_key": "<UUIDv4 gerado por request>",
  "disbursement_bank_account": {
    "bank_code": "329",
    "account_digit": "1",
    "branch_number": "0001",
    "account_number": "1167955",
    "document_number": "45507529710",
    "name": "JOÃO DA SILVA"
  },
  "purchaser_document_number": "<CNPJ do comprador>",
  "document_batch_key": "<document_batch_key DO PASSO 3>",
  "after_disbursement_actions": [
    {
      "action_type": "bankslip_payment",
      "action_data": {
        "qr_code": null,
        "destination": null,
        "digitable_line": "03399199530490000005237385601010297590005474921",
        "pix_transfer_type": null,
        "transaction_amount": 0
      }
    }
  ]
}
```

### Campos que devem ser alterados

| Campo | Obrigatório alterar? | Observação |
|---|---|---|
| `document_batch_key` | ✅ Sim | Valor retornado no Passo 3 |
| `borrower.*` | ✅ Sim | Dados reais do tomador |
| `financial.first_due_date` / `disbursement_date` | ✅ Sim | Conforme calendário da operação |
| `financial.installment_face_value` / `number_of_installments` / `monthly_interest_rate` | ✅ Sim | Conforme condições comerciais |
| `purchaser_document_number` | ✅ Sim | CNPJ do comprador (via variável de ambiente) |
| `requester_identifier_key` | ✅ Sim | UUIDv4 único por requisição |
| `disbursement_bank_account` | ✅ Sim | **Conta interna QI em nome do tomador** (Passo 2). O `account_branch` da resposta do `POST /account` vai no campo `branch_number` |
| `after_disbursement_actions` | ✅ Sim | Quitação da dívida origem. `action_type`: `bankslip_payment` (boleto) ou PIX. Preencha `digitable_line` (boleto) ou `qr_code` (PIX) do banco vendedor |

**Response Body**

```json
{
  "proposal_id": "<id interno>",
  "status": 200,
  "key": "<key da operação debt_purchase>",
  "data": {
    "credit_operation_key": "<mesmo valor de key>",
    "status": "waiting_signature"
  }
}
```

**Guarde a `key` retornada** — ela é passada em `refinanced_credit_operations[].operation_key` da `portability` correspondente.

---

## 5. Emitir `portability`

CCB de **portabilidade da dívida**. Cada portabilidade referencia **exatamente um** `debt_purchase` via `refinanced_credit_operations`. **Não carrega seguro nem troco** — ambos vão no `refinancing` consolidador.

ENDPOINT /debt
MÉTODO POST

:::info Particularidades da `portability`
- `collaterals[0].collateral_type` é **`military_payroll`** com `reservation_type: "portability"`.
- `collaterals[0].collateral_data.portability_data` é **obrigatório** — contém o `origin_econsig_id` (contrato de origem no Zetra) e o `token` do militar.
- `refinanced_credit_operations` carrega a `key` do `debt_purchase` correspondente.
- `modality.code` **`"0202"`** é obrigatório em portabilidade/refinanciamento do Exército.
:::

:::caution Portabilidade sem seguro e sem troco
Em batch militar, a `portability` **não pode** carregar `financial.rebates` (seguro). O seguro é enviado exclusivamente no `refinancing` consolidador. A QI Tech rejeita o `POST /debt` que violar essa regra.
:::

**Request Body**

```json
{
  "borrower": { "...": "mesmo borrower do Passo 4" },
  "financial": {
    "first_due_date": "2026-07-01",
    "disbursement_date": "2026-06-01",
    "limit_days_to_disburse": 5,
    "number_of_installments": 20,
    "monthly_interest_rate": 0.0185,
    "interest_type": "pre_price_days",
    "final_disbursement_amount": 0,
    "fine_configuration": {
      "monthly_rate": 0.01,
      "interest_base": "calendar_days",
      "contract_fine_rate": 0.02
    },
    "credit_operation_type": "ccb",
    "interest_grace_period": 0,
    "principal_grace_period": 0
  },
  "simplified": true,
  "collaterals": [
    {
      "percentage": 1,
      "collateral_type": "military_payroll",
      "collateral_data": {
        "reservation_type": "portability",
        "reservation_method": "issuing",
        "registration_code": "146254221",
        "token": "12345678",
        "portability_data": {
          "origin_econsig_id": "2016587",
          "token": "12345678"
        }
      }
    }
  ],
  "modality": { "code": "0202" },
  "requester_identifier_key": "<UUIDv4>",
  "disbursement_bank_account": { "...": "mesma conta interna do Passo 4" },
  "purchaser_document_number": "<CNPJ do comprador>",
  "document_batch_key": "<document_batch_key DO PASSO 3>",
  "refinanced_credit_operations": [
    { "operation_key": "<key DO PASSO 4>" }
  ]
}
```

### Campos que devem ser alterados

| Campo | Obrigatório alterar? | Observação |
|---|---|---|
| `document_batch_key` | ✅ Sim | Valor retornado no Passo 3 |
| `refinanced_credit_operations[0].operation_key` | ✅ Sim | `key` do `debt_purchase` referenciado (Passo 4) |
| `collaterals[0].collateral_data.registration_code` | ✅ Sim | Matrícula do militar no Zetra |
| `collaterals[0].collateral_data.token` | ✅ Sim | Token Zetra do militar |
| `collaterals[0].collateral_data.portability_data.origin_econsig_id` | ✅ Sim | ID do contrato de origem no Zetra (e-consignado da instituição vendedora) |
| `collaterals[0].collateral_data.portability_data.token` | ✅ Sim | Token Zetra do militar |
| `modality.code` | 🚫 Fixo | Sempre `"0202"` em portabilidade/refinanciamento do Exército |
| `financial.installment_face_value` | 🚫 Não enviar | Valor da parcela (auto calculado) |
| `financial.rebates` | 🚫 Proibido | Seguro não é aceito em portabilidade — só no `refinancing` |

**Response Body**

```json
{
  "proposal_id": "<id interno>",
  "status": 200,
  "key": "<key da operação portability>",
  "data": {
    "credit_operation_key": "<mesmo valor de key>",
    "status": "waiting_signature"
  }
}
```

**Guarde a `key` desta portabilidade** — usada em `refinanced_credit_operations` do `refinancing` consolidador (Passo 6).

### Erros possíveis na criação

| Código | HTTP | Quando |
|---|---|---|
| `DOC000110` | 422 | `refinanced_credit_operations[].operation_key` não casa com nenhum `credit_operation_key` de `debt_purchase` já inserido no batch |
| `DOC000114` | 422 | `refinanced_credit_operations[].operation_key` já está em outra portabilidade do mesmo batch (duplicidade) |
| `COP000515` | 400 | `final_disbursement_amount` ≠ `0` — portabilidade não carrega troco |
| `COP000516` | 400 | `financial.rebates` presente — portabilidade não aceita seguro |
| `INVALID_MODALITY_CODE` | 400 | portabilidade sem `modality.code: "0202"` |

---

## 6. Emitir `refinancing` consolidador

CCB **mãe** que consolida as portabilidades num único instrumento. **Sempre obrigatória** no batch militar — tanto no cenário α (1 portabilidade) quanto no β (N portabilidades). É a única operação do fluxo que carrega **seguro** e **troco**.

ENDPOINT /debt
MÉTODO POST

:::info Particularidades do `refinancing` consolidador
- `collaterals[0].collateral_type` é **`military_payroll`** com `reservation_type: "refinancing"`.
- `refinanced_credit_operations` lista as `key` de **todas** as portabilidades do batch.
- `disbursement_bank_account` aponta para a **conta externa do tomador** — destino do troco.
- `modality.code` **`"0202"`** é obrigatório.
- `financial.rebates` é **opcional** — único lugar do fluxo que aceita seguro.
- `after_disbursement_actions` só é enviado **quando há seguro** — liquida o prêmio após o desembolso.
:::

:::caution `after_disbursement_actions` exige seguro
`after_disbursement_actions` só pode ser enviado no `refinancing` **quando a operação tem seguro** (`financial.rebates` presente). Enviar `after_disbursement_actions` sem `rebates` faz a QI Tech rejeitar o `POST /debt`.
:::

**Request Body**

**Sem seguro**

```json
{
  "borrower": { "...": "mesmo borrower" },
  "financial": {
    "first_due_date": "2026-07-01",
    "installment_face_value": 1000,
    "disbursement_date": "2026-06-01",
    "limit_days_to_disburse": 5,
    "number_of_installments": 20,
    "monthly_interest_rate": 0.0185,
    "interest_type": "pre_price_days",
    "fine_configuration": {
      "monthly_rate": 0.01,
      "interest_base": "calendar_days",
      "contract_fine_rate": 0.02
    },
    "credit_operation_type": "ccb",
    "interest_grace_period": 0,
    "principal_grace_period": 0
  },
  "simplified": true,
  "collaterals": [
    {
      "percentage": 1,
      "collateral_type": "military_payroll",
      "collateral_data": {
        "reservation_type": "refinancing",
        "reservation_method": "issuing",
        "registration_code": "146254221",
        "token": "12345678"
      }
    }
  ],
  "modality": { "code": "0202" },
  "requester_identifier_key": "<UUIDv4>",
  "disbursement_bank_account": { "...": "conta externa do tomador" },
  "purchaser_document_number": "<CNPJ do comprador>",
  "document_batch_key": "<document_batch_key DO PASSO 3>",
  "refinanced_credit_operations": [
    { "operation_key": "<key da portabilidade 1>" },
    { "operation_key": "<key da portabilidade 2>" }
  ]
}
```

**Com seguro + troco (Cenário γ)**

```json
{
  "borrower": { "...": "mesmo borrower" },
  "financial": {
    "first_due_date": "2026-07-01",
    "installment_face_value": 1500,
    "disbursement_date": "2026-06-01",
    "limit_days_to_disburse": 5,
    "number_of_installments": 20,
    "monthly_interest_rate": 0.0185,
    "interest_type": "pre_price_days",
    "fine_configuration": {
      "monthly_rate": 0.01,
      "interest_base": "calendar_days",
      "contract_fine_rate": 0.02
    },
    "credit_operation_type": "ccb",
    "interest_grace_period": 0,
    "principal_grace_period": 0,
    "rebates": [
      {
        "fee_type": "insurance_premium_qi",
        "description": "credit_insurance_blindado"
      }
    ]
  },
  "simplified": true,
  "collaterals": [
    {
      "percentage": 1,
      "collateral_type": "military_payroll",
      "collateral_data": {
        "reservation_type": "refinancing",
        "reservation_method": "issuing",
        "registration_code": "146254221",
        "token": "12345678"
      }
    }
  ],
  "modality": { "code": "0202" },
  "requester_identifier_key": "<UUIDv4>",
  "disbursement_bank_account": { "...": "conta externa do tomador" },
  "purchaser_document_number": "<CNPJ do comprador>",
  "document_batch_key": "<document_batch_key DO PASSO 3>",
  "refinanced_credit_operations": [
    { "operation_key": "<key da portabilidade 1>" },
    { "operation_key": "<key da portabilidade 2>" }
  ],
  "after_disbursement_actions": [
    {
      "action_type": "bankslip_payment",
      "action_data": {
        "qr_code": null,
        "destination": null,
        "digitable_line": "03399199530490000005237385601010297590005474921",
        "pix_transfer_type": null,
        "transaction_amount": 0
      }
    }
  ]
}
```

### Campos que devem ser alterados

| Campo | Obrigatório alterar? | Observação |
|---|---|---|
| `document_batch_key` | ✅ Sim | Valor retornado no Passo 3 |
| `refinanced_credit_operations` | ✅ Sim | **Todas** as `key` das portabilidades emitidas no Passo 5 |
| `collaterals[0].collateral_data.registration_code` | ✅ Sim | Matrícula do militar no Zetra |
| `collaterals[0].collateral_data.token` | ✅ Sim | Token Zetra do militar |
| `reservation_method` | ✅ Sim | Sempre `"issuing"` para o consolidador |
| `modality.code` | 🚫 Fixo | Sempre `"0202"` |
| `disbursement_bank_account` | ✅ Sim | **Conta externa do tomador** — destino do troco |
| `financial.rebates` | ⚠️ Opcional | Único lugar do fluxo que aceita seguro. Incluir `[{ "fee_type": "insurance_premium_qi", ... }]` apenas se a operação tem seguro |
| `financial.final_disbursement_amount` | 🚫 Não enviar | Valor final do desembolso (troco) calculado automaticamente baseado no valor da parcela |
| `after_disbursement_actions` | ⚠️ Só com seguro | Liquida o prêmio do seguro após desembolso. **Só envie quando `rebates` está presente** — caso contrário a QI Tech rejeita o `POST /debt` |

### Erros possíveis na criação

| Código | HTTP | Quando |
|---|---|---|
| `DOC000109` | 422 | Batch já contém outro `refinancing` — só 1 por batch |
| `DOC000112` | 422 | `refinanced_credit_operations[].operation_key` não casa com nenhum `credit_operation_key` de portabilidade no batch |
| `COP000517` | 400 | `refinancing` **com** seguro (`rebates`) sem nenhuma `after_disbursement_actions` — seguro exige ao menos uma ação pós-desembolso |
| `COP000518` | 400 | `refinancing` **sem** seguro carregando `after_disbursement_actions` — só permitido quando há `rebates` |
| `INVALID_MODALITY_CODE` | 400 | refinanciamento sem `modality.code: "0202"` |

---

## 7. Enviar para assinatura

Fecha o lote e dispara os documentos para o QI Sign. **Antes desse PUT, nada é enviado ao militar.**

ENDPOINT /document/document_batch/DOCUMENT_BATCH_KEY/send_to_signature
MÉTODO PUT

Body: `{}`. Response: **HTTP 200**.

### Erros possíveis no envio

| Código | HTTP | Quando |
|---|---|---|
| `DOC000108` | 422 | Batch contém mais de 1 `insurance_premium_term` |
| `DOC000109` | 422 | Batch contém mais de 1 `refinancing` |
| `DOC000110` | 422 | `portability` cujo `refinanced_op` não casa com nenhum `debt_purchase` no batch |
| `DOC000111` | 422 | Batch **sem** `refinancing` consolidador |
| `DOC000114` | 422 | `debt_purchase` referenciado por 0 ou mais de 1 portabilidade |

:::tip Conferir antes de enviar
Use `GET /document/document_batch/DOCUMENT_BATCH_KEY` para listar os documentos agrupados e confirmar a composição antes do `send_to_signature`. Ver [Assinatura em Lote](./11-assinatura-em-lote.md).
:::

→ Próximo passo: [Formalização](./05-formalizacao.md)

---

## Mapa consolidado de erros

| Código | HTTP | Ponto de disparo | Quando |
|---|---|---|---|
| `DOC000108` | 422 | criação + envio | Mais de 1 `insurance_premium_term` no batch |
| `DOC000109` | 422 | criação + envio | Mais de 1 `refinancing` no batch |
| `DOC000110` | 422 | criação + envio | `portability` com `refinanced_op` sem `debt_purchase` casado no batch |
| `DOC000111` | 422 | envio | Batch sem `refinancing` consolidador |
| `DOC000112` | 422 | criação | `refinancing` com `refinanced_op` sem portabilidade casada no batch |
| `DOC000114` | 422 | criação + envio | `debt_purchase` referenciado por ≠ 1 portabilidade (0 órfão ou ≥ 2 duplicado) |
| `COP000515` | 400 | criação (`portability`) | `final_disbursement_amount` ≠ `0` na portabilidade |
| `COP000516` | 400 | criação (`portability`) | `financial.rebates` enviado na portabilidade |
| `COP000517` | 400 | criação (`refinancing`) | `refinancing` com seguro sem nenhuma `after_disbursement_actions` |
| `COP000518` | 400 | criação (`refinancing`) | `refinancing` sem seguro carregando `after_disbursement_actions` |
| `INVALID_MODALITY_CODE` | 400 | criação (`portability`/`refinancing`) | operação sem `modality.code: "0202"` |

:::info Notas sobre erros recorrentes
- `DOC000110` dispara em **dois momentos**: na criação da portabilidade (validação imediata) e no envio (cobertura defensiva).
- `DOC000114` dispara em **dois momentos**: na criação da segunda portabilidade duplicada e no envio (cobre o `debt_purchase` órfão, i.e. `count = 0`).
- `DOC000111` dispara **apenas no envio** — não há validação na criação.
- Batches que **não** são `military_payroll_external_batch` não disparam nenhuma das validações acima.
:::

---

## Glossário

| Termo | Significado |
|---|---|
| **CCB** | Cédula de Crédito Bancário — instrumento de dívida emitido pelo banco |
| **Zetra** | Sistema de gestão do e-consignado militar (Exército) — onde a reserva de margem é averbada |
| **matrícula militar** | `registration_code` — identificador do militar no Zetra |
| **token** | Token Zetra do militar — autoriza a operação de consignado (6 a 8 caracteres) |
| **portability_data** | Dados do contrato de origem no Zetra (`origin_econsig_id`, `token`) da instituição vendedora |
| **origin_econsig_id** | ID do e-consignado de origem no Zetra — o contrato externo que está sendo portado |
| **modality.code** | Código de modalidade do consignado militar — **`"0202"`** para portabilidade/refinanciamento |
| **credit_operation_key** | Chave única da operação retornada por `POST /debt` — também chamada `key` |
| **insurance_premium_term** | Documento extra gerado automaticamente no batch quando uma `portability` ou `refinancing` carrega `financial.rebates` com `fee_type: "insurance_premium_qi"`. **Nunca** originado de `debt_purchase` |
| **QI Sign** | Provedor de assinatura digital QI Tech (configurado via `certifier_type: "qi_sign"`) |

---

# Webhooks

URL: /en/documentation/manual_exercito/webhooks

Eventos assíncronos emitidos pela QI Tech durante o ciclo de vida da operação consignada militar. Todos seguem o protocolo unificado de [Webhooks QI](/documentation/webhooks/notificacoes_baas_e_laas) — 5 segundos pra resposta HTTP 200 com `encoded_body` assinado, 3 retries de 5 minutos em caso de falha.

:::danger Atenção!
Os webhooks da QI Tech **não devem ser mapeados de forma restrita**. Campos adicionais podem ser incluídos aos payloads a qualquer momento. Use desserialização permissiva.
:::

## Webhooks específicos do produto militar

| Webhook | Quando dispara | Origem |
|---|---|---|
| `military_payroll.balance.status_change` | Resultado da consulta de margem (`succeeded` ou `failed`) | military-payroll-api |
| `military_payroll.due_balance.status_change` | Saldo devedor (usado em refin/port) | military-payroll-api |
| `military_payroll.portability_contracts_report.status_change` | Relatório de contratos pra portabilidade | military-payroll-api |
| `credit_operation.collateral` | Averbação ou desaverbação no Zetra | credit-operation-api |

## Webhooks comuns LaaS

| Webhook | Status | Quando dispara |
|---|---|---|
| `debt` | `waiting_signature` | Operação criada, aguardando assinatura |
| `debt` | `signature_finished` | Assinatura concluída |
| `debt` | `disbursed` | Desembolso PIX/TED enviado |
| `debt` | `canceled` | Operação cancelada (ver `cancel_reason_enumerator`) |
| `debt` | `canceled_permanently` | Cancelamento definitivo |
| `debt` | `settled` | Operação liquidada (parcelas pagas) |
| `reversal` | `pending_fund` | Borrower pagou PIX QR de cancelamento — reversal iniciado |
| `credit_transfer.received_portability` | — | Portabilidade externa recebida (banco origem aceitou) |
| `credit_transfer_status_change` | — | Atualização do credit-transfer |
| `installment.status_change` | `paid` / `overdue` / etc | Mudança de status de parcela individual |
| `laas.devolution.refund_receipt` | `refunded` | Devolução de overpayment via PIX |

## Estrutura padrão do payload

Todos os webhooks LaaS seguem essa forma básica:

```json
{
  "key": "<UUID da operação>",
  "data": ,
  "status": "<status>",
  "webhook_type": "<tipo>",
  "event_datetime": "2026-06-01 14:30:00"
}
```

## Exemplos

### `military_payroll.balance.status_change` (sucesso)

```json
{
  "webhook_type": "military_payroll.balance.status_change",
  "key": "81da8afb-e1b2-4215-8093-c4b5feab8a9f",
  "status": "succeeded",
  "data": {
    "balance": 3500.00,
    "allowed_installment_numbers": [24, 36, 48, 60],
    "military_unit": "AMAN",
    "military_branch": "Sistema de Retribuição do Exterior",
    "category": "ATIVO",
    "name": "JOÃO DA SILVA",
    "document_number": "45507529710",
    "registration_code": "146254221",
    "birth_date": "1985-03-12",
    "grant_date": "2010-05-15"
  },
  "event_datetime": "2026-06-01 14:30:00"
}
```

### `credit_operation.collateral` (averbação reservada)

```json
{
  "webhook_type": "credit_operation.collateral",
  "key": "27a099df-4688-43cb-87fa-515b1cf343a5",
  "status": "success",
  "data": {
    "collateral_constituted": true,
    "enumerator": "successfully_reserved",
    "reservation_status": "reserved"
  },
  "event_datetime": "2026-06-01 15:00:00"
}
```

### `debt` (cancelado)

```json
{
  "webhook_type": "debt",
  "key": "27a099df-4688-43cb-87fa-515b1cf343a5",
  "status": "canceled",
  "data": {
    "cancel_reason": "Operação cancelada manualmente",
    "cancel_reason_enumerator": "manual"
  },
  "event_datetime": "2026-06-01 16:00:00"
}
```

### `reversal` (cancelamento pós-desembolso)

```json
{
  "webhook_type": "reversal",
  "credit_operation_key": "2893b8bd-8f4e-4e45-9325-fc7003beb869",
  "contract_number": "0000049333/TW",
  "reversal": {
    "status": "pending_fund",
    "amount": 2026.93,
    "amount_to_send": 2026.93,
    "is_total": true,
    "is_operation_canceled": true,
    "reversal_key": "eb0bbd1d-111d-4a61-bb65-c1f66a005ea2",
    "date": "2026-09-06"
  }
}
```

## Cancel reasons (`cancel_reason_enumerator`)

| Enumerador | Significado |
|---|---|
| `manual` | Cancelado via API ou portal |
| `waiting_signature` | Não assinou no prazo |
| `not_collateral_constituted` | Averbação falhou (consent_refused, consent_expired, etc.) |
| `is_portability` | Portabilidade falhou |
| `pix_max_retry` | Muitas falhas no desembolso PIX |
| `lack_of_resource` | Sem recurso pra desembolsar |
| `kyc_not_accepted` | KYC reprovado |
| `agencia_conta_invalida` | Erro em dados bancários do desembolso |
| `invalid_account` | Conta inválida |
| `rejected_payment` | Pagamento recusado pelo banco destino |

→ Lista completa em [Mapa de Status](./08-mapa-de-status.md)

## Reenvio Manual

Webhooks podem ser consultados e reenviados via portal seguindo [Reenvio de Webhooks](/documentation/notificacoes/reenvio_de_notificacoes).

---

# Manual Saque Aniversário - FGTS v2

URL: /en/documentation/manual_FGTS/

:::danger Atenção!
Os webhooks da QI Tech não devem ser mapeadas de forma restrita. 
Campos adicionais podem ser incluídos aos payloads dos webhooks retornados em nossas APIs.
:::

:::info Reenvio de Webhooks
Você pode consultar e reenviar webhooks seguindo as instruções detalhadas na documentação: [Reenvio de Webhooks](/documentation/notificacoes/reenvio_de_notificacoes).
:::

Este manual descreve o passo a passo envolvido na consulta, simulação, emissão,  desembolso e demais ações de uma operação de Adiantamento do Saque Aniversário FGTS (Crédito pessoal com cessão do Saque Aniversário FGTS).

## Pré-requisitos
1 - Tomador deve ser optante pelo saque aniversario FGTS;

2 - Tomador deve autorizar a QI a consultar seu saldo de FGTS no aplicativo da CEF (Caixa Econômica Federal);

 

## 1 - Consultar saldo disponível
**1.1.** Realização da consulta de saldo:

        **Request**

ENDPOINT /baas/v2/fgts/available_balance
METHOD POST

Request Body

```json
{
	"document_number": "06568225037"
}

```

Em caso de sucesso na consulta do saldo disponível, é retornado principalmente o número de contratos ativos e se o beneficiário tem saldo disponível em seu FGTS.

        **Response**

ENDPOINT /baas/v2/fgts/available_balance
METHOD POST

Response Body

```json
{
	"available_balance_key": "7521981f-0b06-43d2-9a75-d3a1f215fbbf",
	"document_number": "06568225037",
	"status": "pending",
	"status_events": [{
		"event_datetime": "2022-12-26T13:36:16",
		"status": "pending"
	}]
}

```
 

**1.1.1.** No caso de sucesso na consulta de saldo na CEF, o parceiro receberá o seguinte webhook:

        **Webhooks**

WEBHOOK_TYPE available_balance
STATUS Success

Body

```json
{
	"webhook_type": "available_balance",
	"event_datetime": "2022-12-26T13:36:16",
	"key": "7521981f-0b06-43d2-9a75-d3a1f215fbbf",
	"status": "success",
	"data": {
		"reference_date": "2022-07-28",
		"periods": [{
				"due_date": "2022-08-01",
				"amount": 500.1
			},
			{
				"due_date": "2023-08-01",
				"amount": 400.2
			}
		]
	}
}
```
 

**1.1.2.** No caso de falha na consulta de saldo na CEF, o parceiro receberá o seguinte webhook:

WEBHOOK_TYPE available_balance
STATUS Failed

Body

```json
{
	"webhook_type": "available_balance",
	"event_datetime": "2022-12-26T13:36:16",
	"key": "7521981f-0b06-43d2-9a75-d3a1f215fbbf",
	"status": "failed",
	"data": {
		"error_description": "Client does not have membership for anniversary withdraw on current date",
		"error_enumerator": "inexistent_anniversary_membership"
	}
}
```

**1.1.3.** No caso de falha na consulta de saldo na CEF por data da operação não permitida, o parceiro receberá um webhook com uma informação adicional no campo "data":

WEBHOOK_TYPE available_balance
STATUS Failed

Body

```json
{
	"webhook_type": "available_balance",
	"event_datetime": "2022-12-26T13:36:16",
	"key": "7521981f-0b06-43d2-9a75-d3a1f215fbbf",
	"status": "failed",
	"data": {
		"error_description": "Not permitted action on current date",
		"error_enumerator": "on_locked_date_range",
		"error_data": {
			"operation_not_allowed_until_date": "2023-01-03"
		}
	}
}
```

Os possíveis enumeradores de falha na consulta de saldo são listados na seção **2**.

## 2 - Simulando cenários de sucesso e insucesso na consulta de saldo em Sandbox:

**2.1.** Para CPFs iniciados com os números 0, 1, 2, 3, 4, 5, 6 e 7, retornarão uma resposta assíncrona de sucesso através do Webhook (**1.1.1.**).

**2.2.** Para CPF’s iniciandos com o número 8, a consulta de saldo retornará uma resposta assíncrona de sucesso (**1.1.1.**) com períodos zerados que podem ser usados para teste.

**2.3.** Simulando casos de falha na consulta de saldo disponível:

Todas as consultas realizadas para CPFs incitados com 9, retornarão uma resposta assíncrona de erro através do webhook (**1.1.2. ou 1.1.3.**) com um dos erros listados abaixo.

Temos um mock de casos de insucesso para serem testados, eles usam uma lógica aplicada aos primeiros números do documento do tomador em sandbox.

| Início do CPF  |  error_enumerator                                                 | 	error_description     |    
|----------------|-------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------| 
| 90             | ongoing_operation	                                             | There's an ongoing operation                                                                                                     |
| 91	         | unauthorized_institution	                                         | Institution isn't authorized by the client                                                                                       |
| 92, 920        | inexistent_anniversary_membership                            	 | 	Client does not have membership for anniversary withdraw on current date                                                        |
| 93	         | on_locked_date_range                                              | 	Not permitted action on current date                                                                                            |
| 94             |anniversary_membership_egress                                      | Client moving away from anniversary membership. It need to be canceled before requesting a reserve                               |
| 95, 950	     | processing_pending_changes	                                     | Changes on profile info happened on client's FGTS account                                                                        |
| 96, 97, 98, 99 | caixa_error	                                                     | Request wasn't able to process due to an error on CEF                                                                            |
 

## 3 - Acompanhamento e ações em relação a consulta de saldo

A resposta da consulta deve desencadear uma ação por parte do correspondente, de forma a orientar o cliente assertivamente e evitar o acúmulo de requsições perdidas em nossas filas.

| Enumerador                        | error_description | Descrição   |  Ação da QI  | Ação do Cliente |
|-----------------------------------|--------------------- |-------------|-----------| -----------|
|ongoing_operation                  | There's an ongoing operation   | Existe uma operação em andamento na Caixa em relação à esse CPF que implica na alteração do saldo do cliente. Isso impede que valores exatos de parcelas sejam disponibilizados| Envio webhook com o correspondente enumerador e descrição   | Recomenda-se aguardar e fazer uma nova tentativa |
|unauthorized_institution			| Institution isn't authorized by the client  | Instituição não autorizada pelo cliente | Envio webhook com o correspondente enumerador e descrição |  Orientar o cliente a realizar a autorização da "**QI SOCIEDADE DE CREDITO S.A**" para operar o Adiantamento do Saque Aniversário FGTS |
|inexistent_anniversary_membership	| Client does not have membership for anniversary withdraw on current date           |  Trabalhador não possui adesão ao saque aniversário na data vigente | Envio webhook com o correspondente enumerador e descrição |  Necessário orientar o cliente a aderir a modalidade de Saque Aniversário no aplicativo do FGTS|
|on_locked_date_range				| Not permitted action on current date     | A Operação não é permitida na data atual |  Envio webhook com o correspondente enumerador e descrição| A operação é permitida no segundo dia útil do próximo mês. Fazer a devida comunicação com o cliente, visto que ele não conseguirá fazer a operação no momento em nenhuma outra instituição financeira |
|anniversary_membership_egress		|  Client moving away from anniversary membership. It need to be canceled before requesting a reserve | Trabalhador com solicitação de retorno para saque rescisão, que deve ser cancelada pelo mesmo para possibilitar a solicitação de garantia. |  Envio webhook com o correspondente enumerador e descrição | Orientar cliente que ele solicitou o egresso da modalidade de Saque Aniversário, isso  impede que ele faça o adiantamento de seus saques
|processing_pending_changes			| Changes on profile info happened on client's FGTS account | Operação não permitida por pendência no processo de pagamento de Saque Aniversário| Envio webhook com o correspondente enumerador e descrição |  Orientar cliente a aguardar a regularização |
|caixa_error						|  Request wasn't able to process due to an error on CEF | A requisição não foi completada devido a um erro retornado pela Caixa | Envio webhook com o correspondente enumerador e descrição | Recomenda-se aguardar e fazer uma nova tentativa |

:::info
No ambiente produtivo, a consulta de saldo possui uma rotina de retentativas que depende do erro retornado pela CEF no momento da consulta. 
Alguns erros são passíveis de retentativa, já os erros listados acima, são erros definitivos, que não retornam a consulta assíncrona para a fila de retentativa.
:::

## 4 - Simulação do valor máximo
Em posse dos valores disponíveis para saque em cada período (ano), retornados na consulta de saldo (**1.**), é possível realizar a simulação de uma operação de adiantamento do Saque Aniversário FGTS.

A forma de simulação demonstrada nessa seção, mostra qual é o valor máximo que pode ser contratado pelo tomador adiantando 100% dos valores das parcelas disponíveis.

        **Request**

ENDPOINT /baas/fgts_simulation
METHOD POST

Request Body

```json
{
        "borrower": {
            "person_type": "natural",
			"individual_document_number": "46338864879"
        },
        "financial": {
            "desired_installments": [{
                    "total_amount": 5448.42,
                    "due_date": "2023-10-01"
                },
                {
                    "total_amount": 2811.86,
                    "due_date": "2024-10-01"
                }
            ],
            "interest_type": "pre_price_days",
            "disbursement_date": "2023-06-30",
            "fine_configuration": {
                "monthly_rate": 0,
                "interest_base": "calendar_days",
                "contract_fine_rate": 0
            },
            "annual_interest_rate": 0.274223,
            "credit_operation_type": "ccb",
            "interest_grace_period": 0,
            "number_of_installments": 2,
            "principal_grace_period": 0
        }
}
```
 

        **Response**

METHOD POST
ENDPOINT /baas/fgts_simulation

Response Body

```json
{
    "data": {
        "annual_cet": 0.3339086001603759,
        "assignment_amount": 7195.39,
        "cet": 0.0243,
        "contract_fee_amount": 43.17,
        "contract_fees": [
            {
                "amount": 0.6,
                "amount_type": "percentage",
                "fee_amount": 43.17,
                "fee_type": "tac"
            }
        ],
        "credit_operation_type": "ccb",
        "disbursed_issue_amount": 7020.82,
        "disbursement_date": "2023-06-30",
        "disbursement_options": [
            {
                "annual_cet": 0.3339086001603759,
                "assignment_amount": 7195.39,
                "cet": 0.0243,
                "contract_fee_amount": 43.17,
                "contract_fees": [
                    {
                        "amount": 0.6,
                        "amount_type": "percentage",
                        "fee_amount": 43.17,
                        "fee_type": "tac"
                    }
                ],
                "disbursed_issue_amount": 7020.82,
                "disbursement_date": "2023-06-30",
                "external_contract_fee_amount": 0.0,
                "external_contract_fees": [
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "tac",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    },
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "spread",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    }
                ],
                "first_due_date": "2023-10-01",
                "installments": [
                    {
                        "business_due_date": "2023-10-02",
                        "calendar_days": 93,
                        "due_date": "2023-10-01",
                        "due_principal": 7195.39,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 458.290020805,
                        "principal_amortization_amount": 4990.129979195,
                        "tax_amount": 38.05473122134107,
                        "total_amount": 5448.42,
                        "workdays": 64.0
                    },
                    {
                        "business_due_date": "2024-10-01",
                        "calendar_days": 366,
                        "due_date": "2024-10-01",
                        "due_principal": 2205.260020805,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 606.5994412243,
                        "principal_amortization_amount": 2205.2605587757,
                        "tax_amount": 66.0034485241567,
                        "total_amount": 2811.86,
                        "workdays": 252.0
                    }
                ],
                "iof_amount": 131.4,
                "issue_amount": 7195.39,
                "net_external_contract_fee_amount": 0.0,
                "prefixed_interest_rate": {
                    "annual_rate": 0.274223,
                    "daily_rate": 0.00066416,
                    "interest_base": "calendar_days_365",
                    "monthly_rate": 0.02040001
                },
                "total_pre_fixed_amount": 1064.8894620293
            }
        ],
        "external_contract_fee_amount": 0.0,
        "external_contract_fees": [
            {
                "amount": 0.0,
                "amount_released": 0,
                "amount_type": "absolute",
                "cofins_amount": 0,
                "csll_amount": 0,
                "description": null,
                "fee_amount": 0.0,
                "fee_type": "tac",
                "irrf_amount": 0,
                "net_fee_amount": 0.0,
                "pis_amount": 0,
                "tax_amount": 0.0
            },
            {
                "amount": 0.0,
                "amount_released": 0,
                "amount_type": "absolute",
                "cofins_amount": 0,
                "csll_amount": 0,
                "description": null,
                "fee_amount": 0.0,
                "fee_type": "spread",
                "irrf_amount": 0,
                "net_fee_amount": 0.0,
                "pis_amount": 0,
                "tax_amount": 0.0
            }
        ],
        "final_disbursement_amount": 7020.82,
        "installments": [
            {
                "business_due_date": "2023-10-02",
                "calendar_days": 93,
                "due_date": "2023-10-01",
                "due_principal": 7195.39,
                "has_interest": true,
                "installment_number": 1,
                "post_fixed_amount": null,
                "pre_fixed_amount": 458.290020805,
                "principal_amortization_amount": 4990.129979195,
                "tax_amount": 38.05473122134107,
                "total_amount": 5448.42,
                "workdays": 64.0
            },
            {
                "business_due_date": "2024-10-01",
                "calendar_days": 366,
                "due_date": "2024-10-01",
                "due_principal": 2205.260020805,
                "has_interest": true,
                "installment_number": 2,
                "post_fixed_amount": null,
                "pre_fixed_amount": 606.5994412243,
                "principal_amortization_amount": 2205.2605587757,
                "tax_amount": 66.0034485241567,
                "total_amount": 2811.86,
                "workdays": 252.0
            }
        ],
        "interest_grace_period": 0,
        "interest_payment_month_period": 1,
        "interest_type": "pre_price_days",
        "iof_amount": 131.4,
        "issue_amount": 7195.39,
        "issue_date": "2023-06-30",
        "net_external_contract_fee_amount": 0.0,
        "number_of_installments": 2,
        "operation_type": "structured_operation",
        "post_fixed_interest_base": "workdays",
        "post_fixed_interest_rate": null,
        "prefixed_interest_rate": {
            "annual_rate": 0.274223,
            "daily_rate": 0.00066416,
            "interest_base": "calendar_days_365",
            "monthly_rate": 0.02040001
        },
        "principal_amortization_month_period": 1,
        "principal_grace_period": 0,
        "requester_key": "a5c043d3-dec3-4f8d-aa14-01dc9ba85783",
        "total_pre_fixed_amount": 1064.8894620293
    },
    "event_datetime": "2023-06-28 14:07:47",
    "key": "9e532b37-e301-4646-80b7-afd8a3d60f51",
    "status": "finished",
    "type": "debt"
}

```

## 5 - Simulação do valor desejado
A forma de simulação demonstrada nessa seção, mostra qual é o valor das parcelas do Saque Aniversário o tomador precisa adiantar para desembolsar um determinado valor.

        **Request**

ENDPOINT /baas/fgts_simulation_guess
METHOD POST

Request Body

```json
{
	"borrower": {
		"person_type": "natural",
		"individual_document_number": "46338864879"
	},
	"target_disbursed_amount": 4000,
	"financial": {
		"desired_installments": [{
			"total_amount": 5448.42,
			"due_date": "2023-10-01"
		}],
		"interest_type": "pre_price_days",
		"disbursement_date": "2023-06-30",
		"fine_configuration": {
			"monthly_rate": 0,
			"interest_base": "calendar_days",
			"contract_fine_rate": 0
		},
		"annual_interest_rate": 0.27422288066567435,
		"credit_operation_type": "ccb",
		"interest_grace_period": 0,
		"number_of_installments": 1,
		"principal_grace_period": 0
	}
}

```

:::info 
Os valores de parcela informados na lista de parcelas no objeto “***financial.desired_installments***” devem ser os valores retornados na consulta. Esses valores serão utilizados como valores máximos das parcelas na simulação.
:::

        **Response**

METHOD POST
ENDPOINT /baas/fgts_simulation_guess

Response Body

```json
{
    "data": {
        "annual_cet": 0.3655007620895273,
        "assignment_amount": 4070.94,
        "cet": 0.0263,
        "contract_fee_amount": 24.43,
        "contract_fees": [
            {
                "amount": 0.6,
                "amount_type": "percentage",
                "fee_amount": 24.43,
                "fee_type": "tac"
            }
        ],
        "credit_operation_type": "ccb",
        "disbursed_issue_amount": 4000.0,
        "disbursement_date": "2023-06-30",
        "disbursement_options": [
            {
                "annual_cet": 0.3655007620895273,
                "assignment_amount": 4070.94,
                "cet": 0.0263,
                "contract_fee_amount": 24.43,
                "contract_fees": [
                    {
                        "amount": 0.6,
                        "amount_type": "percentage",
                        "fee_amount": 24.43,
                        "fee_type": "tac"
                    }
                ],
                "disbursed_issue_amount": 4000.0,
                "disbursement_date": "2023-06-30",
                "external_contract_fee_amount": 0.0,
                "external_contract_fees": [
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "tac",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    },
                    {
                        "amount": 0.0,
                        "amount_released": 0,
                        "amount_type": "absolute",
                        "cofins_amount": 0,
                        "csll_amount": 0,
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "spread",
                        "irrf_amount": 0,
                        "net_fee_amount": 0.0,
                        "pis_amount": 0,
                        "tax_amount": 0.0
                    }
                ],
                "first_due_date": "2023-10-01",
                "installments": [
                    {
                        "business_due_date": "2023-10-02",
                        "calendar_days": 93,
                        "due_date": "2023-10-01",
                        "due_principal": 4070.94,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 259.2870755335,
                        "principal_amortization_amount": 4070.9429244665,
                        "tax_amount": 31.045010741981528,
                        "total_amount": 4330.23,
                        "workdays": 64.0
                    }
                ],
                "iof_amount": 46.51,
                "issue_amount": 4070.94,
                "net_external_contract_fee_amount": 0.0,
                "prefixed_interest_rate": {
                    "annual_rate": 0.27422288,
                    "daily_rate": 0.00066416,
                    "interest_base": "calendar_days_365",
                    "monthly_rate": 0.0204
                },
                "total_pre_fixed_amount": 259.2870755335
            }
        ],
        "external_contract_fee_amount": 0.0,
        "external_contract_fees": [
            {
                "amount": 0.0,
                "amount_released": 0,
                "amount_type": "absolute",
                "cofins_amount": 0,
                "csll_amount": 0,
                "description": null,
                "fee_amount": 0.0,
                "fee_type": "tac",
                "irrf_amount": 0,
                "net_fee_amount": 0.0,
                "pis_amount": 0,
                "tax_amount": 0.0
            },
            {
                "amount": 0.0,
                "amount_released": 0,
                "amount_type": "absolute",
                "cofins_amount": 0,
                "csll_amount": 0,
                "description": null,
                "fee_amount": 0.0,
                "fee_type": "spread",
                "irrf_amount": 0,
                "net_fee_amount": 0.0,
                "pis_amount": 0,
                "tax_amount": 0.0
            }
        ],
        "final_disbursement_amount": 4000.0,
        "installments": [
            {
                "business_due_date": "2023-10-02",
                "calendar_days": 93,
                "due_date": "2023-10-01",
                "due_principal": 4070.94,
                "has_interest": true,
                "installment_number": 1,
                "post_fixed_amount": null,
                "pre_fixed_amount": 259.2870755335,
                "principal_amortization_amount": 4070.9429244665,
                "tax_amount": 31.045010741981528,
                "total_amount": 4330.23,
                "workdays": 64.0
            }
        ],
        "interest_grace_period": 0,
        "interest_payment_month_period": 1,
        "interest_type": "pre_price_days",
        "iof_amount": 46.51,
        "issue_amount": 4070.94,
        "issue_date": "2023-06-30",
        "net_external_contract_fee_amount": 0.0,
        "number_of_installments": 1,
        "operation_type": "structured_operation",
        "post_fixed_interest_base": "workdays",
        "post_fixed_interest_rate": null,
        "prefixed_interest_rate": {
            "annual_rate": 0.27422288,
            "daily_rate": 0.00066416,
            "interest_base": "calendar_days_365",
            "monthly_rate": 0.0204
        },
        "principal_amortization_month_period": 1,
        "principal_grace_period": 0,
        "requester_key": "a5c043d3-dec3-4f8d-aa14-01dc9ba85783",
        "total_pre_fixed_amount": 259.2870755335
    },
    "event_datetime": "2023-06-28 14:11:15",
    "key": "aa0d581b-4332-40e1-adad-0c7724dc880a",
    "status": "finished",
    "type": "debt"
}
```

## 6 - Criação da Operação
Para realizar a criação de uma operação do Saque Aniversário FGTS, é necessário informar 4 objetos na requisição:

- borrower: tomador da dívida (**[Object Borrower](#object-borrower)**)

- collaterals: informações das parcelas de pagamento (objeto Collateral FGTS)

- financial: dados do fluxo financeiro da operação (Objeto Financeiro FGTS). É o mesmo objeto informado na simulação.

- disbursement_bank_account: informações bancárias para o desembolso (Objeto Conta Bancária)

O PDF do contrato da operação do Saque Aniversário FGTS será gerado pela QI neste momento e será retornado na resposta da requisição.

:::caution Atenção 
Para os valores de parcelas informados na lista de parcelas do objeto “***financial.desired_installments***” utilizamos o campo "***total_amount***", para os valores de parcelas no objeto “***collaterals.collateral_data.periods***” utilizamos o campo "***amount***".
:::

        **Request**

ENDPOINT baas/debt_fgts
METHOD POST

Request Body

```json
	{
    "borrower": {
        "person_type": "natural",
        "name": "PATRICIA APARECIDA DO NASCIMENTO PEREIRA DA SILVA",
        "mother_name": "HELENA DO NASCIMENTO PEREIRA DA SILVA",
        "birth_date": "1997-10-28",
        "profession": "Outros",
        "nationality": "brasileira",
        "marital_status": "married",
        "is_pep": false,
        "individual_document_number": "46338864879",
        "document_identification_number": "46338864879",
        "document_identification_type": "rg",
        "document_identification_date": "2023-12-29",
        "document_identification": "494598fd-c226-4332-a500-591ae3884673",
        "document_identification_back": "494598fd-c226-4332-a500-591ae3884673",
        "email": "naotem@gmail.com",
        "phone": {
            "country_code": "055",
            "area_code": "11",
            "number": "989073010"
        },
        "address": {
            "street": "Rua José Castrioto",
            "state": "SP",
            "city": "São José dos Campos",
            "neighborhood": "Parque Nova Esperança",
            "number": "147",
            "postal_code": "12226160",
            "complement": "CASA"
        }
    },
    "additional_data": null,
    "collaterals": [
        {
            "collateral_type": "fgts_balance",
            "collateral_data": {
                "periods": [
                    {
                        "due_date": "2024-05-02",
                        "amount": 1758.2
                    }
                ]
            },
            "percentage": 1
        }
    ],
    "financial": {
        "desired_installments": [
            {
                "due_date": "2024-05-02",
                "total_amount": 1758.2
            }
        ],
        "interest_type": "pre_price_days",
        "disbursement_start_date": "2024-01-17",
        "disbursement_end_date": "2024-01-22",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "contract_fine_rate": 0.01,
            "interest_base": "calendar_days"
        },
        "monthly_interest_rate": 0.018,
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "number_of_installments": 11,
        "principal_grace_period": 0,
        "issue_date": "2024-01-17"
    },
    "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
    }
}
```

        **Response**

METHOD POST
ENDPOINT /baas/debt_fgts

Response Body

```json
{
    "data": {
        "borrower": {
            "document_number": "46338864879",
            "name": "PATRICIA APARECIDA DO NASCIMENTO PEREIRA DA SILVA",
            "related_party_key": "824e4338-5b22-4e78-84db-94a23c56bf49"
        },
        "collaterals": [
            {
                "absolute_amount": null,
                "collateral_constituted": false,
                "collateral_data": {
                    "document_number": "46338864879",
                    "error_message": "None",
                    "periods": [
                        {
                            "amount": 1758.2,
                            "due_date": "2024-05-02"
                        }
                    ],
                    "protocol_number": null,
                    "reservation_request_closure_status": null,
                    "reservation_request_closure_status_translation": null,
                    "reservation_request_key": "1b6ce462-3a28-4601-bd27-ce8ce6b50781",
                    "reservation_request_status": "pending",
                    "reservation_request_status_translation": "Em Teimosinha"
                },
                "collateral_key": "01f511ee-3409-44f8-adb9-31fbeab87b27",
                "collateral_type": "fgts_balance",
                "created_at": "2024-01-17T14:59:35.434402",
                "external_key": "1b6ce462-3a28-4601-bd27-ce8ce6b50781",
                "percentage": 1,
                "updated_at": "2024-01-17T14:59:35.434387"
            }
        ],
        "contract": {
            "number": "0000083262/PAD",
            "signers": [
                {
                    "signature_url": null,
                    "signer_document_number": "46338864879",
                    "signer_email": "naotem@gmail.com",
                    "signer_external_key": null,
                    "signer_name": "PATRICIA APARECIDA DO NASCIMENTO PEREIRA DA SILVA",
                    "signer_role": "issuer"
                }
            ],
            "urls": [
                "https://storage.googleapis.com/sandbox-doc-api/documents/cb10aaac-a6da-4742-b86f-60726d9f6ce7/TESTEINSSS.A.-PATRICIA_APARECIDA_DO_NASCIMENTO_PEREIRA_DA_SILVA-CCB-0000083262-20240117145936.pdf"
            ]
        },
        "disbursement_options": [
            {
                "additional_iof": 6.278436,
                "annual_cet": "31,6323%",
                "assignment_amount": 1652.22,
                "base_iof": 14.361093768373301,
                "cet": "2,3200%",
                "contract_fee_amount": 8.26,
                "contract_fees": [
                    {
                        "fee_amount": 8.26,
                        "fee_type": "tac"
                    }
                ],
                "disbursed_issue_amount": 1623.32,
                "disbursement_date": "2024-01-17",
                "external_contract_fee_amount": 0.0,
                "external_contract_fees": [
                    {
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "spread",
                        "net_fee_amount": 0.0,
                        "rebate_bank_account": null,
                        "tax_amount": 0.0
                    },
                    {
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "tac",
                        "net_fee_amount": 0.0,
                        "rebate_bank_account": null,
                        "tax_amount": 0.0
                    },
                    {
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "insurance_premium",
                        "net_fee_amount": 0.0,
                        "rebate_bank_account": null,
                        "tax_amount": 0.0
                    }
                ],
                "first_due_date": "2024-05-02",
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2024-05-02",
                        "calendar_days": 106,
                        "due_date": "2024-05-02",
                        "due_interest": 0.0,
                        "due_principal": 1652.22,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "installment_status": null,
                        "installment_type": null,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 105.9802843565,
                        "principal_amortization_amount": 1652.2197156435,
                        "tax_amount": 14.361093768373301,
                        "total_amount": 1758.2,
                        "workdays": 72.0
                    }
                ],
                "issue_amount": 1652.22,
                "net_external_contract_fee_amount": 0.0,
                "number_of_installments": null,
                "pre_fixed_interest_rate": {
                    "annual_rate": 0.23872053,
                    "daily_rate": 0.00058669,
                    "interest_base": "calendar_days_365",
                    "monthly_rate": 0.018
                },
                "total_iof": 20.64,
                "total_pre_fixed_amount": 105.9802843565
            },
            {
                "additional_iof": 6.282122,
                "annual_cet": "31,6725%",
                "assignment_amount": 1653.19,
                "base_iof": 14.233957774255675,
                "cet": "2,3200%",
                "contract_fee_amount": 8.27,
                "contract_fees": [
                    {
                        "fee_amount": 8.27,
                        "fee_type": "tac"
                    }
                ],
                "disbursed_issue_amount": 1624.4,
                "disbursement_date": "2024-01-18",
                "external_contract_fee_amount": 0.0,
                "external_contract_fees": [
                    {
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "spread",
                        "net_fee_amount": 0.0,
                        "rebate_bank_account": null,
                        "tax_amount": 0.0
                    },
                    {
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "tac",
                        "net_fee_amount": 0.0,
                        "rebate_bank_account": null,
                        "tax_amount": 0.0
                    },
                    {
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "insurance_premium",
                        "net_fee_amount": 0.0,
                        "rebate_bank_account": null,
                        "tax_amount": 0.0
                    }
                ],
                "first_due_date": "2024-05-02",
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2024-05-02",
                        "calendar_days": 105,
                        "due_date": "2024-05-02",
                        "due_interest": 0.0,
                        "due_principal": 1653.19,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "installment_status": null,
                        "installment_type": null,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 105.0109437566,
                        "principal_amortization_amount": 1653.1890562434,
                        "tax_amount": 14.233957774255675,
                        "total_amount": 1758.2,
                        "workdays": 71.0
                    }
                ],
                "issue_amount": 1653.19,
                "net_external_contract_fee_amount": 0.0,
                "number_of_installments": null,
                "pre_fixed_interest_rate": {
                    "annual_rate": 0.23872053,
                    "daily_rate": 0.00058669,
                    "interest_base": "calendar_days_365",
                    "monthly_rate": 0.018
                },
                "total_iof": 20.52,
                "total_pre_fixed_amount": 105.0109437566
            },
            {
                "additional_iof": 6.285808,
                "annual_cet": "31,7080%",
                "assignment_amount": 1654.16,
                "base_iof": 14.10666765817373,
                "cet": "2,3200%",
                "contract_fee_amount": 8.27,
                "contract_fees": [
                    {
                        "fee_amount": 8.27,
                        "fee_type": "tac"
                    }
                ],
                "disbursed_issue_amount": 1625.5,
                "disbursement_date": "2024-01-19",
                "external_contract_fee_amount": 0.0,
                "external_contract_fees": [
                    {
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "spread",
                        "net_fee_amount": 0.0,
                        "rebate_bank_account": null,
                        "tax_amount": 0.0
                    },
                    {
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "tac",
                        "net_fee_amount": 0.0,
                        "rebate_bank_account": null,
                        "tax_amount": 0.0
                    },
                    {
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "insurance_premium",
                        "net_fee_amount": 0.0,
                        "rebate_bank_account": null,
                        "tax_amount": 0.0
                    }
                ],
                "first_due_date": "2024-05-02",
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2024-05-02",
                        "calendar_days": 104,
                        "due_date": "2024-05-02",
                        "due_interest": 0.0,
                        "due_principal": 1654.16,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "installment_status": null,
                        "installment_type": null,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 104.0410344543,
                        "principal_amortization_amount": 1654.1589655457,
                        "tax_amount": 14.10666765817373,
                        "total_amount": 1758.2,
                        "workdays": 70.0
                    }
                ],
                "issue_amount": 1654.16,
                "net_external_contract_fee_amount": 0.0,
                "number_of_installments": null,
                "pre_fixed_interest_rate": {
                    "annual_rate": 0.23872053,
                    "daily_rate": 0.00058669,
                    "interest_base": "calendar_days_365",
                    "monthly_rate": 0.018
                },
                "total_iof": 20.39,
                "total_pre_fixed_amount": 104.0410344543
            },
            {
                "additional_iof": 6.289494,
                "annual_cet": "31,7502%",
                "assignment_amount": 1655.13,
                "base_iof": 13.979223283044265,
                "cet": "2,3200%",
                "contract_fee_amount": 8.28,
                "contract_fees": [
                    {
                        "fee_amount": 8.28,
                        "fee_type": "tac"
                    }
                ],
                "disbursed_issue_amount": 1626.58,
                "disbursement_date": "2024-01-20",
                "external_contract_fee_amount": 0.0,
                "external_contract_fees": [
                    {
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "spread",
                        "net_fee_amount": 0.0,
                        "rebate_bank_account": null,
                        "tax_amount": 0.0
                    },
                    {
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "tac",
                        "net_fee_amount": 0.0,
                        "rebate_bank_account": null,
                        "tax_amount": 0.0
                    },
                    {
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "insurance_premium",
                        "net_fee_amount": 0.0,
                        "rebate_bank_account": null,
                        "tax_amount": 0.0
                    }
                ],
                "first_due_date": "2024-05-02",
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2024-05-02",
                        "calendar_days": 103,
                        "due_date": "2024-05-02",
                        "due_interest": 0.0,
                        "due_principal": 1655.13,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "installment_status": null,
                        "installment_type": null,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 103.070556116,
                        "principal_amortization_amount": 1655.129443884,
                        "tax_amount": 13.979223283044265,
                        "total_amount": 1758.2,
                        "workdays": 70.0
                    }
                ],
                "issue_amount": 1655.13,
                "net_external_contract_fee_amount": 0.0,
                "number_of_installments": null,
                "pre_fixed_interest_rate": {
                    "annual_rate": 0.23872053,
                    "daily_rate": 0.00058669,
                    "interest_base": "calendar_days_365",
                    "monthly_rate": 0.018
                },
                "total_iof": 20.27,
                "total_pre_fixed_amount": 103.070556116
            },
            {
                "additional_iof": 6.29318,
                "annual_cet": "31,7877%",
                "assignment_amount": 1656.1,
                "base_iof": 13.851624511675489,
                "cet": "2,3300%",
                "contract_fee_amount": 8.28,
                "contract_fees": [
                    {
                        "fee_amount": 8.28,
                        "fee_type": "tac"
                    }
                ],
                "disbursed_issue_amount": 1627.68,
                "disbursement_date": "2024-01-21",
                "external_contract_fee_amount": 0.0,
                "external_contract_fees": [
                    {
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "spread",
                        "net_fee_amount": 0.0,
                        "rebate_bank_account": null,
                        "tax_amount": 0.0
                    },
                    {
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "tac",
                        "net_fee_amount": 0.0,
                        "rebate_bank_account": null,
                        "tax_amount": 0.0
                    },
                    {
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "insurance_premium",
                        "net_fee_amount": 0.0,
                        "rebate_bank_account": null,
                        "tax_amount": 0.0
                    }
                ],
                "first_due_date": "2024-05-02",
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2024-05-02",
                        "calendar_days": 102,
                        "due_date": "2024-05-02",
                        "due_interest": 0.0,
                        "due_principal": 1656.1,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "installment_status": null,
                        "installment_type": null,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 102.099508408,
                        "principal_amortization_amount": 1656.100491592,
                        "tax_amount": 13.851624511675489,
                        "total_amount": 1758.2,
                        "workdays": 70.0
                    }
                ],
                "issue_amount": 1656.1,
                "net_external_contract_fee_amount": 0.0,
                "number_of_installments": null,
                "pre_fixed_interest_rate": {
                    "annual_rate": 0.23872053,
                    "daily_rate": 0.00058669,
                    "interest_base": "calendar_days_365",
                    "monthly_rate": 0.018
                },
                "total_iof": 20.14,
                "total_pre_fixed_amount": 102.099508408
            },
            {
                "additional_iof": 6.296866,
                "annual_cet": "31,8319%",
                "assignment_amount": 1657.07,
                "base_iof": 13.723871206771127,
                "cet": "2,3300%",
                "contract_fee_amount": 8.29,
                "contract_fees": [
                    {
                        "fee_amount": 8.29,
                        "fee_type": "tac"
                    }
                ],
                "disbursed_issue_amount": 1628.76,
                "disbursement_date": "2024-01-22",
                "external_contract_fee_amount": 0.0,
                "external_contract_fees": [
                    {
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "spread",
                        "net_fee_amount": 0.0,
                        "rebate_bank_account": null,
                        "tax_amount": 0.0
                    },
                    {
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "tac",
                        "net_fee_amount": 0.0,
                        "rebate_bank_account": null,
                        "tax_amount": 0.0
                    },
                    {
                        "description": null,
                        "fee_amount": 0.0,
                        "fee_type": "insurance_premium",
                        "net_fee_amount": 0.0,
                        "rebate_bank_account": null,
                        "tax_amount": 0.0
                    }
                ],
                "first_due_date": "2024-05-02",
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2024-05-02",
                        "calendar_days": 101,
                        "due_date": "2024-05-02",
                        "due_interest": 0.0,
                        "due_principal": 1657.07,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "installment_status": null,
                        "installment_type": null,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 101.127890996,
                        "principal_amortization_amount": 1657.072109004,
                        "tax_amount": 13.723871206771127,
                        "total_amount": 1758.2,
                        "workdays": 69.0
                    }
                ],
                "issue_amount": 1657.07,
                "net_external_contract_fee_amount": 0.0,
                "number_of_installments": null,
                "pre_fixed_interest_rate": {
                    "annual_rate": 0.23872053,
                    "daily_rate": 0.00058669,
                    "interest_base": "calendar_days_365",
                    "monthly_rate": 0.018
                },
                "total_iof": 20.02,
                "total_pre_fixed_amount": 101.127890996
            }
        ],
        "entry": null,
        "iof_charge_method": "financed",
        "prefixed_interest_rate": {
            "annual_rate": 0.23872053,
            "created_at": "2024-01-17T14:59:35",
            "daily_rate": 0.00058669,
            "interest_base": "calendar_days_365",
            "monthly_rate": 0.018
        },
        "requester_identifier_key": "2fedb18e-207b-4bb5-954a-0e6e19bb6e50"
    },
    "event_datetime": "2024-01-17 14:59:40",
    "key": "2fedb18e-207b-4bb5-954a-0e6e19bb6e50",
    "status": "waiting_signature",
    "webhook_type": "debt"
}

```
 

## 7 - Formalização da operação
Por padrão a QI Tech realiza a coleta de assinaturas através da QI Sign e o contrato é enviado para os assinantes no momento da emissão, porém ainda existe a possibilidade de o parceiro realizar a coleta de assinaturas de forma independente e enviar o documento assinado ou as evidencias de assinatura para a QI Tech para seguir com a operação.

**Tipos de assinatura aceitos**

**QI Sign**

A assinatura através da QI Sign ocorre de forma automática na plataforma QI Tech, uma vez que a operação é criada o documento é disparado pela QI Sign para coleta de assinaturas, após assinado a operação automaticamente muda de status aguardando o desembolso.

**pdf-signature**

Esse tipo indica que o PDF emitido através da "/debt" será assinado e link com o PDF assinado será enviado através da API 4.1 como forma de autenticação.

        **Request**

ENDPOINT debt/[DEBT_KEY]/signed
METHOD POST

Request Body

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

        **Response**

METHOD POST
ENDPOINT debt/[DEBT_KEY]/signed

Response Body

```json
{
  "data": {},
  "event_datetime": "2023-01-17 17:17:28",
  "key": "4630cd58-ab00-49b3-b8cb-cb0f4a5af7a4",
  "status": "signature_received",
  "webhook_type": "debt"
}
```

**data-signature**

Esse tipo indica que o PDF emitido através da "/debt" será assinado através de um hash anexado em sua ultima pagina.

A autenticação através de dados pode ter 3 tipos:

- **Opt-in**

A assinatura através de opt-in significa que o cliente vai dar o aceite do contrato através do front.

Para que essa assinatura seja valida, alguns dados devem ser enviados obrigatoriamente.

        **Request**

ENDPOINT debt/[DEBT_KEY]/signed
METHOD POST

Request Body

```json
{
	"type": "data-signature",
	"signatures": [{
		"signed_object": {
			"document_key": "095bd363-a5be-4561-955d-f199bf664972",
            "document_md5": "06d19d6664f20a73158d277d41c8c7d3",
			"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-4430-af9c-3316e9142ff3",
            "fingerprint": {
				"lat": -7.205088,
				"long": -48.2414106,
				"name": "SM-A015M",
				"model": "SM-A015M",
				"calendar": "AM",
				"regionCode": "BR",
				"systemName": "Android",
				"orientation": "Portrait",
				"currencyCode": "BRL",
				"languageCode": "pt",
				"systemVersion": "11",
				"userinterface": "Android",
				"localizedModel": "SM-A015M",
				"decimalSeparator": ",",
				"usesMetricSystem": "true",
				"preferredLanguages": "pt-BR,en-BR",
				"supportsMultiTasking": "true"
			}
		},
		"signer": {
			"name": "VITOR",
			"email": "vitor.castello@qitech.com.br",
			"phone": {
				"country_code": "055",
				"area_code": "11",
				"number": "999999999"
			},
			"document_number": "645236363652"
		},
		"authentication_type": "opt_in"
	}]
}
```

- **Zip**

A assinatura através de zip contempla o envio de um arquivo de comprovação, como uma ligação gravada.

        **Request**

ENDPOINT debt/[DEBT_KEY]/signed
METHOD POST

Request Body

```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": "7521bd5621d97af26b2c1721fc4023a8"
            },
            "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"
        }
    ]
}
```

- **Selfie**

A autenticação através de selfie é disponibilizada para os parceiros que utilizam os serviços de CaaS QI Tech, onde a autenticação através de selfie é validada e um id de comprovação é gerado.

        **Request**

ENDPOINT debt/[DEBT_KEY]/signed
METHOD POST

Request Body

```json
{
    "type": "data-signature",
    "signatures": [
        {
            "signed_object": {
                "raw_text": "Lorem ipsum dolor sit amet, consectetur a...."
            },
            "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": "selfie"
        }
    ]
}
```

        **Response**
METHOD POST
ENDPOINT debt/[DEBT_KEY]/signed

Response Body

```json
{
  "data": {},
  "event_datetime": "2023-01-17 17:17:28",
  "key": "4630cd58-ab00-49b3-b8cb-cb0f4a5af7a4",
  "status": "signature_received",
  "webhook_type": "debt"
}
```

:::info
O Response é o mesmo para todas as operações realizadas através do endpoint debt/\{DEBT_KEY\}/signed.
:::

## 8 - Máquina de estados e webhooks
Após a criação de uma dívida dentro do nosso sistema, são possíveis os seguintes status:

| Status | Tradução  |  
| -- | -- | 
| waiting_signature | Aguardando assinatura |
| signature_finished | Assinatura finalizada |  
| disbursed | Operação desembolsada (paga) |  
| canceled | Operação cancelada |  
| cancel_permanently | Operação cancelada permanentemente |  

**8.1. signature_finished:** Informa que a operação está assinada e fornece o url com o documento assinado.

        **Webhook**

WEBHOOK_TYPE debt
STATUS signature_finished
STATUS Waiting_signature

Body

```json
{
	"data": {
		"borrower": {
			"document_number": "46338864879",
			"name": "PATRICIA APARECIDA DO NASCIMENTO PEREIRA DA SILVA",
			"related_party_key": "9878573b-4ccf-4f72-be82-5ba70d25d5a7"
		},
		"collaterals": [{
			"absolute_amount": null,
			"collateral_constituted": false,
			"collateral_data": {
				"document_number": "46338864879",
				"error_message": "None",
				"periods": [{
						"amount": 222.21,
						"due_date": "2024-01-01"
					},
					{
						"amount": 382.14,
						"due_date": "2025-01-01"
					},
					{
						"amount": 311.43,
						"due_date": "2026-01-01"
					},
					{
						"amount": 342.38,
						"due_date": "2027-01-01"
					},
					{
						"amount": 194.29,
						"due_date": "2028-01-01"
					},
					{
						"amount": 97.15,
						"due_date": "2029-01-01"
					},
					{
						"amount": 48.57,
						"due_date": "2030-01-01"
					},
					{
						"amount": 24.29,
						"due_date": "2031-01-01"
					},
					{
						"amount": 12.14,
						"due_date": "2032-01-01"
					},
					{
						"amount": 6.07,
						"due_date": "2033-01-01"
					}
				],
				"protocol_number": null,
				"reservation_request_closure_status": null,
				"reservation_request_closure_status_translation": null,
				"reservation_request_key": "e2edaa95-69b8-47d3-8ca7-5e48fd3440c5",
				"reservation_request_status": "pending",
				"reservation_request_status_translation": "Em Teimosinha"
			},
			"collateral_key": "e9cf1551-5b95-4edf-827f-29bd4d4f0b2f",
			"collateral_type": "fgts_balance",
			"created_at": "2023-05-26T14:55:25.335308",
			"external_key": "977075c1-d529-4cc2-931c-188cab4aa761",
			"percentage": 1,
			"updated_at": "2023-05-26T14:55:25.335291"
		}],
		"contract": {
			"number": "0000064547/PAD",
			"signers": [{
				"signature_url": null,
				"signer_document_number": "46338864879",
				"signer_email": "naotem@gmail.com",
				"signer_external_key": null,
				"signer_name": "PATRICIA APARECIDA DO NASCIMENTO PEREIRA DA SILVA",
				"signer_role": "issuer"
			}],
			"urls": [
				"https://storage.googleapis.com/sandbox-doc-api/documents/8a370979-727b-4865-a03a-27f8d6208f57/SYNGENTASANDBOX-PATRICIA_APARECIDA_DO_NASCIMENTO_PEREIRA_DA_SILVA-CCB-0000070572-20230526145531.pdf"
			]
		},
		"disbursement_options": [{
				"additional_iof": 3.282668,
				"annual_cet": "29,8407%",
				"assignment_amount": 872.5,
				"base_iof": 24.828504537437023,
				"cet": "2,2000%",
				"contract_fee_amount": 8.64,
				"contract_fees": [{
					"fee_amount": 8.64,
					"fee_type": "tac"
				}],
				"disbursed_issue_amount": 827.11,
				"disbursement_date": "2023-05-26",
				"external_contract_fee_amount": 8.64,
				"external_contract_fees": [{
						"description": null,
						"fee_amount": 8.64,
						"fee_type": "spread",
						"net_fee_amount": 7.84,
						"rebate_bank_account": null,
						"tax_amount": 0.8
					},
					{
						"description": null,
						"fee_amount": 0,
						"fee_type": "tac",
						"net_fee_amount": 0,
						"rebate_bank_account": null,
						"tax_amount": 0
					}
				],
				"first_due_date": "2024-01-01",
				"installments": [{
						"additional_costs": [],
						"business_due_date": "2024-01-02",
						"calendar_days": 220,
						"due_date": "2024-01-01",
						"due_interest": 0,
						"due_principal": 863.86,
						"fine_amount": null,
						"has_interest": true,
						"installment_number": 1,
						"installment_status": null,
						"installment_type": null,
						"post_fixed_amount": null,
						"pre_fixed_amount": 135.8606707299,
						"principal_amortization_amount": 86.3493292701,
						"tax_amount": 1.557741900032604,
						"total_amount": 222.21,
						"workdays": 149
					},
 					...
				],
				"issue_amount": 863.86,
				"net_external_contract_fee_amount": 7.84,
				"number_of_installments": null,
				"pre_fixed_interest_rate": {
					"annual_rate": 0.274223,
					"daily_rate": 0.00066416,
					"interest_base": "calendar_days_365",
					"monthly_rate": 0.02040001
				},
				"total_iof": 28.11,
				"total_pre_fixed_amount": 776.8144015216
			},
			...
		],
		"entry": null,
		"iof_charge_method": "financed",
		"prefixed_interest_rate": {
			"annual_rate": 0.274223,
			"created_at": "2023-05-26T14:55:31",
			"daily_rate": 0.00066416,
			"interest_base": "calendar_days_365",
			"monthly_rate": 0.02040001
		},
		"requester_identifier_key": "e99ed7c8-ecb3-441d-9130-45feb0ad9c36"
	},
	"event_datetime": "2023-05-26 14:55:38",
	"key": "e99ed7c8-ecb3-441d-9130-45feb0ad9c36",
	"status": "waiting_signature",
	"webhook_type": "debt"
}
```

 

**8.2. signature_finished:** Informa que a operação está assinada e fornece o url com o documento assinado.

        **Webhook**

WEBHOOK_TYPE debt
STATUS Signature_finished

Body

```json
{
     "webhook_type": "debt",
     "key":"57f8e1ce-1080-4d0d-a195-89709b961561",
     "event_datetime": "2022-09-29 20:00:54",
     "status":"signature_finished",
  }

```

 

**8.2. disbursed:** Indica que o recurso foi enviado para a conta do cliente. 
Além de dispor dos dados de transferência do pagamento e um comprovante em pdf do desembolso realizado.

        **Webhook**

WEBHOOK_TYPE debt
STATUS disbursed

Body

```json
{
    "webhook": {
        "key": "4475d350-a63f-4d93-8e76-40386ce942b0",
        "data": {
            "installments": [
                {
                    "due_date": "2024-08-01",
                    "total_amount": 1264.12,
                    "installment_key": "526ca3da-d669-4db5-a16c-67a687c4a755",
                    "pre_fixed_amount": 141.15866647,
                    "principal_amortization_amount": 1122.96133353
                }
            ],
            "ted_receipt_list": [
                {
                    "fee": 0,
                    "url": "https://storage.googleapis.com/sandbox-doc-api/documents/099e04d7-3fe5-41ba-bef3-4165d0a09a99/099e04d7-3fe5-41ba-bef3-4165d0a09a99.pdf",
                    "amount": 1100,
                    "origin": {
                        "name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
                        "type": "payment_account",
                        "branch": "0001",
                        "document": "32402502000135",
                        "bank_code": "329",
                        "account_key": "5d068423-6094-49e4-b15b-7740038295a8",
                        "branch_digit": null,
                        "account_digit": "5",
                        "account_branch": "0001",
                        "account_number": "00002",
                        "financial_institution_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A."
                    },
                    "timestamp": "2024-01-11T13:28:45",
                    "description": "00360305 0465 100071066-1 24182533410 - Mock Person Name",
                    "destination": {
                        "name": "Mock Person Name",
                        "type": "checking_account",
                        "branch": "0465",
                        "purpose": "Crédito PIX em Conta",
                        "document": "24182533410",
                        "bank_ispb": "00360305",
                        "branch_digit": null,
                        "account_digit": "1",
                        "account_number": "100071066",
                        "financial_institution_name": "CAIXA ECONOMICA FEDERAL"
                    },
                    "end_to_end_id": "E32402502202401111328RqgXuWz64uU",
                    "transaction_key": "cffe9c42-fec0-49fc-b9f6-7a5b431f8374",
                    "origin_transaction_key": "e8ef9c9f-b813-418a-b19c-8fab0dfcb67e"
                }
            ],
            "requester_identifier_key": null
        },
        "status": "disbursed",
        "webhook_type": "debt",
        "event_datetime": "2024-01-11 13:28:46"
    }
}
```
 

**8.3. canceled:** Indica o cancelamento da operação. Isso pode ser causado por dados bancários incorretos na tentativa de pagamento, falta de assinatura, limite da data de desembolso excedido ou alguma questão em relação à averbação do saldo.

:::warning Atenção
O cancelamento da operação não indica que a operação será desaverbada na Caixa. Para que seja disparado a solicitação de desaverbação do saldo do cliente deve-se obrigatoriamente cancelar permanentemente a operação.
:::

Nessa lista de enumeradores, você encontra todos os possíveis motivos de cancelamento de uma operação, por erro na averbação.

        **Webhook**

WEBHOOK_TYPE debt
STATUS canceled

Body

```json
{
	"key": "6613ebf5-b41d-4257-b2f9-89ce261c5041",
	"data": {
		"cancel_reason": "Available Balance is not sufficient for given periods amount",
		"cancel_reason_enumerator": "fgts_insufficient_balance"
	},
	"status": "canceled",
	"webhook_type": "debt",
	"event_datetime": "2022-12-22 21:27:41"
}

```
 
**8.5. Colateral constituído:**

        **Webhook**

WEBHOOK_TYPE credit_operation.collateral
STATUS NA

Body

```json
{
	"key": "767b4ca4-0afc-4e28-a7d7-645bef1873c2",
	"data": {
		"collateral_type": "fgts",
		"collateral_constituted": true
	},
	"event_time": "2022-12-09 19:02:32",
	"webhook_type": "credit_operation.collateral"
}
```

 
## 9 - Simulando cenários de sucesso e insucesso na averbação em Sandbox:
**9.1.** O cenário ideal é simulado para os CPFs iniciados com 0, 1, 2 ou 3.

|Início do CPF	| Ação	|
|---|---|
|0, 1, 2 ou 3| Operação segue com sucesso até o desembolso  |

**9.2.** Simulando casos de falha na averbação:

Todas as averbações com CPFs que começam com 9 terão erros. Alguns tratáveis, outros que disparam retentativa e outros inesperados.

Todas as averbações com CPFs que começam com 8 terão erros por falta de saldo.

:::caution 
Alguns erros na averbação, mesmo disparando um webhook de cancelamento, são passíveis de rententativa de averbação. Então, é necessário  
:::
 
### Enumeradores webhook de cancelamento por erro na averbação   
|cancel_reason_enumerator	|cancel_reason|  Descrição| Ação QI | 
| -- | -- |   -- | -- | 
|fgts_invalid_given_period	| Given periods date does not match with CEF system |  Uma ou mais datas de previsão do saque informadas não conferem com as datas previstas no sistema da Caixa ou os valores enviados para as parcelas são maiores do que o disponível | Operação é cancelada e não retentamos averbação | 
|fgts_unauthorized_institution	| Institution isn't authorized by the client  | Instituição não autorizada pelo cliente | Operação é cancelada e retentamos a averbação 
|fgts_processing_pending_changes | 	Changes on profile info happened on client's FGTS account |  Operação não permitida por mudanças nas informações do perfil na conta do FGTS do cliente | Operação é cancelada e não retentamos averbação | 
|fgts_on_locked_date_range |	Not permitted action on current date  | A Operação não é permitida na data atual | Operação é cancelada e retentamos a averbação na data pemitida  |
|fgts_insufficient_balance |	Available Balance is not sufficient for given periods amount | Trabalhador não possui saldo disponível para a Operação Fiduciária  |  Operação é cancelada e não retentamos averbação | 
|fgts_inexistent_anniversary_membership | 	Client does not have membership for anniversary withdraw on current date |  Trabalhador não possui adesão ao saque aniversário na data vigente |  Operação é cancelada e não retentamos averbação | 
|fgts_period_rejected |	Reservation period not accepted |  Protocolo recusado pela CEF |  Operação é cancelada e não retentamos averbação
|fgts_deletion_request | Deletion request was before the reservation was completed |  A solicitação de desaverbação foi realizada antes da conclusão da reserva |   Operação é cancelada e não retentamos averbação | 
|fgts_protocol_removed | Protocol was removed |  Protocolo removido na CEF  |  Operação é cancelada e não retentamos averbação |
|fgts_insufficient_balance_available |	The indicated value is not available for contracting | O valor indicado não está disponível para a contratação  | Operação é cancelada e não retentamos averbação
|fgts_insufficient_balance_for_guarantee |	Available balance is not sufficient for the required guarantee |   O saldo disponível não é suficiente para a garantia requerida   | Operação é cancelada e não retentamos averbação
|fgts_fgts_accounts_not_found |	The informed worker does not have FGTS accounts |  O Trabalhador informado não possui contas de FGTS | Operação é cancelada e não retentamos averbação

## 10 - Reapresentação de Operações
Existem casos onde a data de desembolso selecionada para a operação pode passar com pendências no contrato, o que faz com que o mesmo seja cancelado.

Para que seja possível reiniciar o processo de um contrato já cancelado, é necessário recalcular a operação. Temos duas formas para o envio: alterar a data de desembolso ou alterar os dados da conta bancária de desembolso.

### 10.1 - Mudança da data de desembolso:

        **Request**

ENDPOINT /debt/ DEBT-KEY /disbursement_option
METHOD PATCH

Request Body

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

STATUS 200

**Response Body**

```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": [
				"https://storage.googleapis.com/dev-doc-api/documents/a715175f-8d29-4929-9576-4b692d1e9610/BEATRIZCOUTODECARVALHO-TESTE-CCB-0000051370-20230707151409.pdf"
			]
		},
		"contract_fee_amount": 0.5,
		"contract_fees": [{
			"fee_amount": 0.5,
			"fee_type": "spread"
		}],
		"disbursed_issue_amount": 4530.98,
		"entry": null,
		"external_contract_fee_amount": 0.0,
		"external_contract_fees": [{
			"description": null,
			"fee_amount": 0.0,
			"fee_type": "spread",
			"net_fee_amount": 0.0,
			"rebate_bank_account": null,
			"tax_amount": 0.0
		}],
		"installments": [{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2023-08-29",
				"calendar_days": 50,
				"digitable_line": null,
				"due_date": "2023-08-28",
				"due_interest": 0.0,
				"due_principal": 4676.47,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "29c6e226-b710-4e3b-a5d6-62119b9d9547",
				"installment_number": 1,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 4676.47,
				"original_pre_fixed_amount": 164.86042852,
				"original_principal_amortization_amount": 25.13957148,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 164.86042852,
				"principal_amortization_amount": 25.13957148,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 0.10307224,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 36
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2023-09-29",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2023-09-28",
				"due_interest": 0.0,
				"due_principal": 4651.33042852,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "322d7973-4d2a-41a6-ad1b-2fef59c551b7",
				"installment_number": 2,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 4651.33042852,
				"original_pre_fixed_amount": 100.99385125,
				"original_principal_amortization_amount": 89.00614875,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 100.99385125,
				"principal_amortization_amount": 89.00614875,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 0.59117884,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 22
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2023-10-31",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2023-10-28",
				"due_interest": 0.0,
				"due_principal": 4562.32427977,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "a2d43778-0342-48f7-a0d2-c385773fa545",
				"installment_number": 3,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 4562.32427977,
				"original_pre_fixed_amount": 95.83242026,
				"original_principal_amortization_amount": 94.16757974,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 95.83242026,
				"principal_amortization_amount": 94.16757974,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 0.85711331,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 20
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2023-11-29",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2023-11-28",
				"due_interest": 0.0,
				"due_principal": 4468.15670003,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "9126aa9a-6bb0-44c6-8ea4-61fd68fcd936",
				"installment_number": 4,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 4468.15670003,
				"original_pre_fixed_amount": 97.01661904,
				"original_principal_amortization_amount": 92.98338096,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 97.01661904,
				"principal_amortization_amount": 92.98338096,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 1.08269849,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 20
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2023-12-29",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2023-12-28",
				"due_interest": 0.0,
				"due_principal": 4375.17331907,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "f0b363f9-0aca-4154-b14a-2c7933374abc",
				"installment_number": 5,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 4375.17331907,
				"original_pre_fixed_amount": 91.90128137,
				"original_principal_amortization_amount": 98.09871863,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 91.90128137,
				"principal_amortization_amount": 98.09871863,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 1.38358433,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 21
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-01-30",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2024-01-28",
				"due_interest": 0.0,
				"due_principal": 4277.07460043,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "c7c41dee-28a3-4b37-b2de-256fa0c9a0a9",
				"installment_number": 6,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 4277.07460043,
				"original_pre_fixed_amount": 92.86767319,
				"original_principal_amortization_amount": 97.13232681,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 92.86767319,
				"principal_amortization_amount": 97.13232681,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 1.61686471,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 20
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-02-29",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2024-02-28",
				"due_interest": 0.0,
				"due_principal": 4179.94227362,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "ee5d7b27-5160-49d3-9eb0-ec5a2f20e50d",
				"installment_number": 7,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 4179.94227362,
				"original_pre_fixed_amount": 90.75864903,
				"original_principal_amortization_amount": 99.24135097,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 90.75864903,
				"principal_amortization_amount": 99.24135097,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 1.90424304,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 21
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-04-01",
				"calendar_days": 29,
				"digitable_line": null,
				"due_date": "2024-03-28",
				"due_interest": 0.0,
				"due_principal": 4080.70092265,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "a9ec8c98-0061-4956-8af8-93d5742f6c1f",
				"installment_number": 8,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 4080.70092265,
				"original_pre_fixed_amount": 82.82984224,
				"original_principal_amortization_amount": 107.17015776,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 82.82984224,
				"principal_amortization_amount": 107.17015776,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 2.31123162,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 21
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-04-30",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2024-04-28",
				"due_interest": 0.0,
				"due_principal": 3973.53076489,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "bfd2ceab-74d4-4ff4-b099-c6ab986b7acb",
				"installment_number": 9,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 3973.53076489,
				"original_pre_fixed_amount": 86.2768573,
				"original_principal_amortization_amount": 103.7231427,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 86.2768573,
				"principal_amortization_amount": 103.7231427,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 2.50055752,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 20
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-05-29",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2024-05-28",
				"due_interest": 0.0,
				"due_principal": 3869.80762219,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "eb41f47f-ffcd-4d4d-8834-600cfe95b2a4",
				"installment_number": 10,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 3869.80762219,
				"original_pre_fixed_amount": 81.2859859,
				"original_principal_amortization_amount": 108.7140141,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 81.2859859,
				"principal_amortization_amount": 108.7140141,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 2.88831393,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 21
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-07-01",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2024-06-28",
				"due_interest": 0.0,
				"due_principal": 3761.09360809,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "13183e83-70cf-4990-a3cc-c979e43015b9",
				"installment_number": 11,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 3761.09360809,
				"original_pre_fixed_amount": 81.6642313,
				"original_principal_amortization_amount": 108.3357687,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 81.6642313,
				"principal_amortization_amount": 108.3357687,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 3.15365423,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 22
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-07-30",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2024-07-28",
				"due_interest": 0.0,
				"due_principal": 3652.75783939,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "a2ed3748-8567-4cab-a1ff-0cf6b2698d15",
				"installment_number": 12,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 3652.75783939,
				"original_pre_fixed_amount": 76.72681698,
				"original_principal_amortization_amount": 113.27318302,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 76.72681698,
				"principal_amortization_amount": 113.27318302,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 3.39026637,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 20
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-08-29",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2024-08-28",
				"due_interest": 0.0,
				"due_principal": 3539.48465638,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "1e009f23-2044-40ba-8249-a9077a2391b9",
				"installment_number": 13,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 3539.48465638,
				"original_pre_fixed_amount": 76.85245907,
				"original_principal_amortization_amount": 113.14754093,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 76.85245907,
				"principal_amortization_amount": 113.14754093,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 3.3865059,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 23
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-10-01",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2024-09-28",
				"due_interest": 0.0,
				"due_principal": 3426.33711545,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "e475d886-a596-4541-bcae-4986bf7c3609",
				"installment_number": 14,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 3426.33711545,
				"original_pre_fixed_amount": 74.39569823,
				"original_principal_amortization_amount": 115.60430177,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 74.39569823,
				"principal_amortization_amount": 115.60430177,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 3.46003675,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 22
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-10-29",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2024-10-28",
				"due_interest": 0.0,
				"due_principal": 3310.73281367,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "5584643d-4e65-4e99-9483-b3c1b051fd63",
				"installment_number": 15,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 3310.73281367,
				"original_pre_fixed_amount": 69.54252108,
				"original_principal_amortization_amount": 120.45747892,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 69.54252108,
				"principal_amortization_amount": 120.45747892,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 3.60529234,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 21
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-11-29",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2024-11-28",
				"due_interest": 0.0,
				"due_principal": 3190.27533475,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "23a0002c-49bf-4c22-a506-d89ae4372249",
				"installment_number": 16,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 3190.27533475,
				"original_pre_fixed_amount": 69.27011321,
				"original_principal_amortization_amount": 120.72988679,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 69.27011321,
				"principal_amortization_amount": 120.72988679,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 3.61344551,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 22
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2024-12-31",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2024-12-28",
				"due_interest": 0.0,
				"due_principal": 3069.54544796,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "5efbf6d0-84bc-4041-8a33-e9ab1bf82969",
				"installment_number": 17,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 3069.54544796,
				"original_pre_fixed_amount": 64.47633798,
				"original_principal_amortization_amount": 125.52366202,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 64.47633798,
				"principal_amortization_amount": 125.52366202,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 3.7569232,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 20
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-01-29",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2025-01-28",
				"due_interest": 0.0,
				"due_principal": 2944.02178595,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "e9bb5d68-8c93-43a4-b240-d68b0d1d6d08",
				"installment_number": 18,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 2944.02178595,
				"original_pre_fixed_amount": 63.9232354,
				"original_principal_amortization_amount": 126.0767646,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 63.9232354,
				"principal_amortization_amount": 126.0767646,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 3.77347756,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 21
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-03-05",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2025-02-28",
				"due_interest": 0.0,
				"due_principal": 2817.94502134,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "d6c34059-ba9b-4345-b937-35293f34a3dd",
				"installment_number": 19,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 2817.94502134,
				"original_pre_fixed_amount": 61.18574366,
				"original_principal_amortization_amount": 128.81425634,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 61.18574366,
				"principal_amortization_amount": 128.81425634,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 3.85541069,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 23
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-03-31",
				"calendar_days": 28,
				"digitable_line": null,
				"due_date": "2025-03-28",
				"due_interest": 0.0,
				"due_principal": 2689.130765,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "63fa4169-f1a9-43f0-a059-70e2df35ac7e",
				"installment_number": 20,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 2689.130765,
				"original_pre_fixed_amount": 52.68330953,
				"original_principal_amortization_amount": 137.31669047,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 52.68330953,
				"principal_amortization_amount": 137.31669047,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.10988855,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 18
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-04-29",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2025-04-28",
				"due_interest": 0.0,
				"due_principal": 2551.81407453,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "859ee4fa-f781-419b-8888-731b0f8fc01b",
				"installment_number": 21,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 2551.81407453,
				"original_pre_fixed_amount": 55.40726995,
				"original_principal_amortization_amount": 134.59273005,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 55.40726995,
				"principal_amortization_amount": 134.59273005,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.02836041,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 19
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-05-29",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2025-05-28",
				"due_interest": 0.0,
				"due_principal": 2417.22134448,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "d6e25388-d54d-42ca-8b46-ac70fa7aeb23",
				"installment_number": 22,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 2417.22134448,
				"original_pre_fixed_amount": 50.7741553,
				"original_principal_amortization_amount": 139.2258447,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 50.7741553,
				"principal_amortization_amount": 139.2258447,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.16702953,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 21
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-07-01",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2025-06-28",
				"due_interest": 0.0,
				"due_principal": 2277.99549978,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "d92f0e38-fa48-48c2-a79e-e8316fe5c870",
				"installment_number": 23,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 2277.99549978,
				"original_pre_fixed_amount": 49.46187558,
				"original_principal_amortization_amount": 140.53812442,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 49.46187558,
				"principal_amortization_amount": 140.53812442,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.20630606,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 21
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-07-29",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2025-07-28",
				"due_interest": 0.0,
				"due_principal": 2137.45737535,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "04aa2658-8fbe-4147-8a14-03c7bba13577",
				"installment_number": 24,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 2137.45737535,
				"original_pre_fixed_amount": 44.89766385,
				"original_principal_amortization_amount": 145.10233615,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 44.89766385,
				"principal_amortization_amount": 145.10233615,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.34291292,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 21
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-08-29",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2025-08-28",
				"due_interest": 0.0,
				"due_principal": 1992.35503921,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "af5b3343-7d91-46cf-a908-bf24e4e79907",
				"installment_number": 25,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 1992.35503921,
				"original_pre_fixed_amount": 43.25979382,
				"original_principal_amortization_amount": 146.74020618,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 43.25979382,
				"principal_amortization_amount": 146.74020618,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.39193437,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 23
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-09-30",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2025-09-28",
				"due_interest": 0.0,
				"due_principal": 1845.61483303,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "1e7981d6-4274-49f1-ab6e-a98d97485e78",
				"installment_number": 26,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 1845.61483303,
				"original_pre_fixed_amount": 40.07363891,
				"original_principal_amortization_amount": 149.92636109,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 40.07363891,
				"principal_amortization_amount": 149.92636109,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.48729599,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 21
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-10-29",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2025-10-28",
				"due_interest": 0.0,
				"due_principal": 1695.68847194,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "a07e171b-e2a6-49b4-9d6d-8124fff9d736",
				"installment_number": 27,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 1695.68847194,
				"original_pre_fixed_amount": 35.61823023,
				"original_principal_amortization_amount": 154.38176977,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 35.61823023,
				"principal_amortization_amount": 154.38176977,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.62064637,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 22
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-12-01",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2025-11-28",
				"due_interest": 0.0,
				"due_principal": 1541.30670217,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "0cd84cc5-0dd0-4318-99f9-178843d3d5b5",
				"installment_number": 28,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 1541.30670217,
				"original_pre_fixed_amount": 33.46622796,
				"original_principal_amortization_amount": 156.53377204,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 33.46622796,
				"principal_amortization_amount": 156.53377204,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.6850558,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 23
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2025-12-30",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2025-12-28",
				"due_interest": 0.0,
				"due_principal": 1384.77293013,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "24dc3c8b-ac3a-496e-8646-a1e66051090b",
				"installment_number": 29,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 1384.77293013,
				"original_pre_fixed_amount": 29.08739451,
				"original_principal_amortization_amount": 160.91260549,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 29.08739451,
				"principal_amortization_amount": 160.91260549,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.81611428,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 19
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2026-01-29",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2026-01-28",
				"due_interest": 0.0,
				"due_principal": 1223.86032464,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "bba128ee-b195-4a65-9caf-3ebe452d9d10",
				"installment_number": 30,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 1223.86032464,
				"original_pre_fixed_amount": 26.57354762,
				"original_principal_amortization_amount": 163.42645238,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 26.57354762,
				"principal_amortization_amount": 163.42645238,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.89135372,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 22
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2026-03-03",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2026-02-28",
				"due_interest": 0.0,
				"due_principal": 1060.43387227,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "35a03898-607a-4194-804c-bfd375c3ea45",
				"installment_number": 31,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 1060.43387227,
				"original_pre_fixed_amount": 23.02508598,
				"original_principal_amortization_amount": 166.97491402,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 23.02508598,
				"principal_amortization_amount": 166.97491402,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 4.99755918,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 20
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2026-03-31",
				"calendar_days": 28,
				"digitable_line": null,
				"due_date": "2026-03-28",
				"due_interest": 0.0,
				"due_principal": 893.45895824,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "0a8a83db-835d-46bc-8e24-c542c44d6e68",
				"installment_number": 32,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 893.45895824,
				"original_pre_fixed_amount": 17.50393379,
				"original_principal_amortization_amount": 172.49606621,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 17.50393379,
				"principal_amortization_amount": 172.49606621,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 5.16280726,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 20
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2026-04-29",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2026-04-28",
				"due_interest": 0.0,
				"due_principal": 720.96289203,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "07e3155c-30b5-4d13-8a31-0af4c7d5c9c5",
				"installment_number": 33,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 720.96289203,
				"original_pre_fixed_amount": 15.65418772,
				"original_principal_amortization_amount": 174.34581228,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 15.65418772,
				"principal_amortization_amount": 174.34581228,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 5.21817016,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 20
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2026-05-29",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2026-05-28",
				"due_interest": 0.0,
				"due_principal": 546.61707975,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "d1badc80-d7a2-4428-abf6-4877ac9f4497",
				"installment_number": 34,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 546.61707975,
				"original_pre_fixed_amount": 11.48178326,
				"original_principal_amortization_amount": 178.51821674,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 11.48178326,
				"principal_amortization_amount": 178.51821674,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 5.34305023,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 21
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2026-06-30",
				"calendar_days": 31,
				"digitable_line": null,
				"due_date": "2026-06-28",
				"due_interest": 0.0,
				"due_principal": 368.098863,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "4b466830-c432-4478-a1b9-bff6562834ee",
				"installment_number": 35,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 368.098863,
				"original_pre_fixed_amount": 7.99248758,
				"original_principal_amortization_amount": 182.00751242,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 7.99248758,
				"principal_amortization_amount": 182.00751242,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 5.44748485,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 20
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0.0,
				"bank_slip_key": null,
				"business_due_date": "2026-07-29",
				"calendar_days": 30,
				"digitable_line": null,
				"due_date": "2026-07-28",
				"due_interest": 0.0,
				"due_principal": 186.09135058,
				"fine_amount": null,
				"has_interest": true,
				"installment_history": [],
				"installment_key": "0e8843ff-1339-40ab-a0b5-c450eca68e44",
				"installment_number": 36,
				"installment_payment": [],
				"installment_status": "created",
				"installment_type": "principal",
				"original_due_principal": 186.09135058,
				"original_pre_fixed_amount": 3.90887682,
				"original_principal_amortization_amount": 186.09112318,
				"original_total_amount": 190.0,
				"paid_amount": 0.0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 3.90887682,
				"principal_amortization_amount": 186.09112318,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 5.56970732,
				"total_accrual_amount": null,
				"total_amount": 190.0,
				"total_paid_amount": 0.0,
				"workdays": 22
			}
		],
		"iof_charge_method": "financed",
		"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"
}
```

### 10.2 - Mudança dos dados bancários:

        **Request**

ENDPOINT /debt/ DEBT-KEY /disbursement_bank_accounts
METHOD PUT

**Request Body**

```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
	}]
}
```

        **Response**

STATUS 200

**Response Body**

```json
{}
```

:::info 
**Quando uma operação é cancelada e pode ser reapresentada:**

- Caso a data de desembolso enviada seja ultrapassada ainda com pendências nas assinaturas do contrato;

- Caso a averbação não seja concluída até a data de desembolso;

- Caso exista algum problema com os dados bancários para o pagamento da operação;
:::

## 11 - Cancelamento da operação
**Permite a Instituição Fiduciária realizar, junto ao Agente Operador do FGTS, o cancelamento de uma reserva de valores de saque aniversário do Trabalhador utilizados como garantia para uma operação fiduciária**

**ATENÇÃO: A operação só poderá ser desaverbada se ela já tiver sido cancelada.**

        **Request**

ENDPOINT /debt/[debt_key]/cancel_permanently
METHOD /POST
PARAMETERS debt_key

        **Payload**

|Key | Value | Description|
|--|--|--|
|debt_key| 95ba572e-b8d2-43db-94b9-8c4a0405e3bc |Debt key da operação que esta sendo cancelada.|

        **Response**

STATUS 200
ENDPOINT /debt/[debt_key]/cancel_permanently
METHOD POST

Request Body

```json
{
	"data": {
		"additional_iof": 0.956498,
		"annual_cet": 41.5826,
		"assignment_amount": 251.71,
		"base_iof": 5.38721386,
		"borrower": {
			"document_number": "0000000000",
			"name": "Andre Luis Souto de Souza"
		},
		"cet": 2.94,
		"collaterals": [{
			"collateral_constituted": false,
			"collateral_data": {
				"document_number": "00000000000",
				"error_message": "None",
				"periods": [{
						"amount": 116.48,
						"due_date": "2023-04-01"
					},
					{
						"amount": 81.53,
						"due_date": "2024-04-01"
					},
					{
						"amount": 57.07,
						"due_date": "2025-04-01"
					},
					{
						"amount": 39.95,
						"due_date": "2026-04-01"
					},
					{
						"amount": 37.29,
						"due_date": "2027-04-01"
					},
					{
						"amount": 27.96,
						"due_date": "2028-04-01"
					},
					{
						"amount": 13.99,
						"due_date": "2029-04-01"
					},
					{
						"amount": 6.99,
						"due_date": "2030-04-01"
					},
					{
						"amount": 3.49,
						"due_date": "2031-04-01"
					},
					{
						"amount": 3.6,
						"due_date": "2032-04-01"
					}
				],
				"protocol_number": null,
				"reservation_request_closure_status": null,
				"reservation_request_closure_status_translation": null,
				"reservation_request_key": "11e904ad-1e7c-46c7-9e15-16d3650670bd",
				"reservation_request_status": "pending",
				"reservation_request_status_translation": "Em Teimosinha"
			},
			"collateral_key": "7686f240-329b-4ef5-8956-914c05cbd445",
			"collateral_type": "fgts_balance",
			"created_at": "2022-12-19T15:52:32",
			"external_key": "11e904ad-1e7c-46c7-9e15-16d3650670bd",
			"percentage": 1,
			"updated_at": "2022-12-20T21:09:27.573223"
		}],
		"contract": {
			"number": "0003296996/ALS-R",
			"urls": [
				"https://storage.googleapis.com/live-doc-api/documents/0e2d7181-799c-4134-af18-2a9ffb14da57/HUBCREDFINTECHLTDA-ANDRE_LUIS_SOUTO_DE_SOUZA-CCB-0003296996-20221219155233.pdf"
			]
		},
		"contract_fee_amount": 2.46,
		"contract_fees": [{
				"fee_amount": 1.26,
				"fee_type": "tac"
			},
			{
				"fee_amount": 1.2,
				"fee_type": "ted_fee"
			}
		],
		"disbursed_issue_amount": 211.45,
		"entry": null,
		"external_contract_fee_amount": 31.46,
		"external_contract_fees": [{
				"description": null,
				"fee_amount": 15.1,
				"fee_type": "tac",
				"net_fee_amount": 12.95,
				"rebate_bank_account": {
					"account_branch": "1",
					"account_digit": "5",
					"account_number": "1000398",
					"created_at": "2022-12-19T15:52:32",
					"document_number": "000000000000",
					"financial_institutions": {
						"code_number": 329,
						"is_active": true,
						"is_pix_participant": true,
						"ispb": 32402502,
						"name": "QI SCD S.A."
					},
					"financial_institutions_code_number": 329,
					"name": "QI SOCIEDADE DE CREDITO DIRETO SA"
				},
				"tax_amount": 2.15
			},
			{
				"description": null,
				"fee_amount": 16.36,
				"fee_type": "tac",
				"net_fee_amount": 14.03,
				"rebate_bank_account": {
					"account_branch": "1",
					"account_digit": "1",
					"account_number": "1000418",
					"created_at": "2022-12-19T15:52:32",
					"document_number": "000000000000",
					"financial_institutions": {
						"code_number": 329,
						"is_active": true,
						"is_pix_participant": true,
						"ispb": 32402502,
						"name": "QI SCD S.A."
					},
					"financial_institutions_code_number": 329,
					"name": "QI SOCIEDADE DE CREDITO DIRETO SA"
				},
				"tax_amount": 2.33
			},
			{
				"description": null,
				"fee_amount": 0,
				"fee_type": "spread",
				"net_fee_amount": 0,
				"rebate_bank_account": null,
				"tax_amount": 0
			}
		],
		"installments": [{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0,
				"bank_slip_key": null,
				"business_due_date": "2023-04-03",
				"calendar_days": 103,
				"digitable_line": null,
				"due_date": "2023-04-01",
				"due_interest": 0,
				"due_principal": 251.71,
				"fine_amount": null,
				"has_interest": true,
				"installment_key": "9badede6-9db0-45d9-9797-9b1459eb4a38",
				"installment_number": 1,
				"installment_payment": [],
				"installment_status": "canceled",
				"installment_type": "principal",
				"original_due_principal": 251.71,
				"original_pre_fixed_amount": 16.57,
				"original_principal_amortization_amount": 99.91,
				"original_total_amount": 116.48,
				"paid_amount": 0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 16.57,
				"principal_amortization_amount": 99.91,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 0.84383986,
				"total_accrual_amount": null,
				"total_amount": 116.48,
				"total_paid_amount": 0,
				"workdays": 72
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0,
				"bank_slip_key": null,
				"business_due_date": "2024-04-01",
				"calendar_days": 366,
				"digitable_line": null,
				"due_date": "2024-04-01",
				"due_interest": 0,
				"due_principal": 151.8,
				"fine_amount": null,
				"has_interest": true,
				"installment_key": "c3c86b8b-5af8-47de-a77a-ef8622955219",
				"installment_number": 2,
				"installment_payment": [],
				"installment_status": "canceled",
				"installment_type": "principal",
				"original_due_principal": 151.8,
				"original_pre_fixed_amount": 38.58,
				"original_principal_amortization_amount": 42.95,
				"original_total_amount": 81.53,
				"paid_amount": 0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 38.58,
				"principal_amortization_amount": 42.95,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 1.2854935,
				"total_accrual_amount": null,
				"total_amount": 81.53,
				"total_paid_amount": 0,
				"workdays": 248
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0,
				"bank_slip_key": null,
				"business_due_date": "2025-04-01",
				"calendar_days": 365,
				"digitable_line": null,
				"due_date": "2025-04-01",
				"due_interest": 0,
				"due_principal": 108.85,
				"fine_amount": null,
				"has_interest": true,
				"installment_key": "5c3aa86f-bb17-4e60-85d0-64cfc8082332",
				"installment_number": 3,
				"installment_payment": [],
				"installment_status": "canceled",
				"installment_type": "principal",
				"original_due_principal": 108.85,
				"original_pre_fixed_amount": 27.58,
				"original_principal_amortization_amount": 29.49,
				"original_total_amount": 57.07,
				"paid_amount": 0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 27.58,
				"principal_amortization_amount": 29.49,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 0.8826357,
				"total_accrual_amount": null,
				"total_amount": 57.07,
				"total_paid_amount": 0,
				"workdays": 254
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0,
				"bank_slip_key": null,
				"business_due_date": "2026-04-01",
				"calendar_days": 365,
				"digitable_line": null,
				"due_date": "2026-04-01",
				"due_interest": 0,
				"due_principal": 79.36,
				"fine_amount": null,
				"has_interest": true,
				"installment_key": "e3e01865-bd87-4934-bce4-52fcae82c30e",
				"installment_number": 4,
				"installment_payment": [],
				"installment_status": "canceled",
				"installment_type": "principal",
				"original_due_principal": 79.36,
				"original_pre_fixed_amount": 20.11,
				"original_principal_amortization_amount": 19.84,
				"original_total_amount": 39.95,
				"paid_amount": 0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 20.11,
				"principal_amortization_amount": 19.84,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 0.5938112,
				"total_accrual_amount": null,
				"total_amount": 39.95,
				"total_paid_amount": 0,
				"workdays": 253
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0,
				"bank_slip_key": null,
				"business_due_date": "2027-04-01",
				"calendar_days": 365,
				"digitable_line": null,
				"due_date": "2027-04-01",
				"due_interest": 0,
				"due_principal": 59.52,
				"fine_amount": null,
				"has_interest": true,
				"installment_key": "a0f2a23f-0766-4912-a0de-7b84c1df1c9e",
				"installment_number": 5,
				"installment_payment": [],
				"installment_status": "canceled",
				"installment_type": "principal",
				"original_due_principal": 59.52,
				"original_pre_fixed_amount": 15.08,
				"original_principal_amortization_amount": 22.21,
				"original_total_amount": 37.29,
				"paid_amount": 0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 15.08,
				"principal_amortization_amount": 22.21,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 0.6647453,
				"total_accrual_amount": null,
				"total_amount": 37.29,
				"total_paid_amount": 0,
				"workdays": 249
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0,
				"bank_slip_key": null,
				"business_due_date": "2028-04-03",
				"calendar_days": 366,
				"digitable_line": null,
				"due_date": "2028-04-01",
				"due_interest": 0,
				"due_principal": 37.31,
				"fine_amount": null,
				"has_interest": true,
				"installment_key": "a0916b23-c193-4a61-8850-1fbae73440d5",
				"installment_number": 6,
				"installment_payment": [],
				"installment_status": "canceled",
				"installment_type": "principal",
				"original_due_principal": 37.31,
				"original_pre_fixed_amount": 9.48,
				"original_principal_amortization_amount": 18.48,
				"original_total_amount": 27.96,
				"paid_amount": 0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 9.48,
				"principal_amortization_amount": 18.48,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 0.5531064,
				"total_accrual_amount": null,
				"total_amount": 27.96,
				"total_paid_amount": 0,
				"workdays": 253
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0,
				"bank_slip_key": null,
				"business_due_date": "2029-04-02",
				"calendar_days": 365,
				"digitable_line": null,
				"due_date": "2029-04-01",
				"due_interest": 0,
				"due_principal": 18.83,
				"fine_amount": null,
				"has_interest": true,
				"installment_key": "aeda565d-e743-408d-bbff-32374eadd02d",
				"installment_number": 7,
				"installment_payment": [],
				"installment_status": "canceled",
				"installment_type": "principal",
				"original_due_principal": 18.83,
				"original_pre_fixed_amount": 4.77,
				"original_principal_amortization_amount": 9.22,
				"original_total_amount": 13.99,
				"paid_amount": 0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 4.77,
				"principal_amortization_amount": 9.22,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 0.2759546,
				"total_accrual_amount": null,
				"total_amount": 13.99,
				"total_paid_amount": 0,
				"workdays": 247
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0,
				"bank_slip_key": null,
				"business_due_date": "2030-04-01",
				"calendar_days": 365,
				"digitable_line": null,
				"due_date": "2030-04-01",
				"due_interest": 0,
				"due_principal": 9.61,
				"fine_amount": null,
				"has_interest": true,
				"installment_key": "8a8dcf1a-40fb-4526-b7ab-ae133c12b388",
				"installment_number": 8,
				"installment_payment": [],
				"installment_status": "canceled",
				"installment_type": "principal",
				"original_due_principal": 9.61,
				"original_pre_fixed_amount": 2.44,
				"original_principal_amortization_amount": 4.55,
				"original_total_amount": 6.99,
				"paid_amount": 0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 2.44,
				"principal_amortization_amount": 4.55,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 0.1361815,
				"total_accrual_amount": null,
				"total_amount": 6.99,
				"total_paid_amount": 0,
				"workdays": 251
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0,
				"bank_slip_key": null,
				"business_due_date": "2031-04-01",
				"calendar_days": 365,
				"digitable_line": null,
				"due_date": "2031-04-01",
				"due_interest": 0,
				"due_principal": 5.06,
				"fine_amount": null,
				"has_interest": true,
				"installment_key": "10c9b5d0-0401-4e7c-b58e-635de70434c7",
				"installment_number": 9,
				"installment_payment": [],
				"installment_status": "canceled",
				"installment_type": "principal",
				"original_due_principal": 5.06,
				"original_pre_fixed_amount": 1.28,
				"original_principal_amortization_amount": 2.21,
				"original_total_amount": 3.49,
				"paid_amount": 0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 1.28,
				"principal_amortization_amount": 2.21,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 0.0661453,
				"total_accrual_amount": null,
				"total_amount": 3.49,
				"total_paid_amount": 0,
				"workdays": 253
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0,
				"bank_slip_key": null,
				"business_due_date": "2032-04-01",
				"calendar_days": 366,
				"digitable_line": null,
				"due_date": "2032-04-01",
				"due_interest": 0,
				"due_principal": 2.85,
				"fine_amount": null,
				"has_interest": true,
				"installment_key": "663f8109-cca3-469a-855a-4f0294fb77ba",
				"installment_number": 10,
				"installment_payment": [],
				"installment_status": "canceled",
				"installment_type": "principal",
				"original_due_principal": 2.85,
				"original_pre_fixed_amount": 0.75,
				"original_principal_amortization_amount": 2.85,
				"original_total_amount": 3.6,
				"paid_amount": 0,
				"paid_at": null,
				"post_fixed_amount": null,
				"pre_fixed_amount": 0.75,
				"principal_amortization_amount": 2.85,
				"qr_code_key": null,
				"qr_code_url": null,
				"renegotiation_proposal_key": null,
				"tax_amount": 0.0853005,
				"total_accrual_amount": null,
				"total_amount": 3.6,
				"total_paid_amount": 0,
				"workdays": 253
			}
		],
		"iof_charge_method": "financed",
		"issue_amount": 251.71,
		"net_external_contract_fee_amount": 26.98,
		"number_of_installments": 10,
		"prefixed_interest_rate": {
			"annual_rate": 0.25340149,
			"created_at": "2022-12-19T15:52:32",
			"daily_rate": 0.00061899,
			"interest_base": "calendar_days_365",
			"monthly_rate": 0.019
		},
		"requester_identifier_key": "93a47fc5-5969-42ff-bdbb-3c9e8ec58d35",
		"total_iof": 6.34,
		"total_pre_fixed_amount": 136.64
	},
	"event_datetime": "2022-12-20 21:09:28",
	"key": "93a47fc5-5969-42ff-bdbb-3c9e8ec58d35",
	"status": "canceled_permanently",
	"webhook_type": "debt"
}
```

Quando todas as reversões são executadas com sucesso, uma rotina é executada uma vez por dia, coletando o valor adequado e enviando para o fundo.

        **Response**

STATUS 400
ENDPOINT /debt/[debt_key]/cancel_permanently
METHOD POST

Request Body

```json
{
  "data": "{\"title\": \"Bad Request\", \"description\": \"Operation with status \{status\} cannot be cancelled.\", \"translation\": \"Essa operação com \{status\} não permite cancelamento.\", \"extra_fields\": {}, \"code\": \"COP000245\"}"
}
 ```

## 12 - Acompanhamento e mapeamento dos status das reservas
O objeto "last_response" traz os dados da última tentativa de reserva ou liberação (averbação ou desaverbação) realizada pela QI na Caixa.

O campo "last_response.success.enumerator" será retornado caso a reserva/liberação (averbação/desaverbação) tenha sido finalizada com sucesso.

O campo "last_response.errors.enumerator" traz a mensagem de erro retornada pela Caixa na última tentativa de reserva/liberação (averbação/desaverbação).

O campo "last_response_event_datetime" traz a data e horário da última tentativa de reserva/liberação (averbação/desaverbação)

### 12.1 - Casos de sucesso

#### Request

ENDPOINT /debt/[debt_key]/collateral
METHOD GET

        **Response**

Response Body

```json
{
  "collateral_constituted": true,
  "collateral_type": "fgts_balance",
  "updated_at": "2023-05-24 19:13:02",
  "collateral_data": {
    "periods": [
      {
        "amount": 77.86,
        "due_date": "2023-12-01"
      },
      {
        "amount": 54.51,
        "due_date": "2024-12-01"
      },
      {
        "amount": 38.83,
        "due_date": "2025-12-01"
      },
      {
        "amount": 35.34,
        "due_date": "2026-12-01"
      }
    ],
    "document_number": "73422975004",
    "status": "waiting_protocol_activation",
    "last_response": {
      "success": [
        {
          "enumerator": "protocol_created"
        }
      ]
    },
    "last_response_event_datetime": "2023-05-22T19:13:02Z"
  }
}
```

| Enumerador | Descrição   | Ação da QI   | Ação do cliente 
|------------------------------|------------------------------|  ------------------------------|  ------------------------------| 
| `protocol_created` | Protocolo criado com sucesso | Início da etapa de ativação de protocolo | Aguardar a ativação de protocolo
| `successfully_reserved` | Protocolo ativado com sucesso. Saldo está reservado  |Envio do webhook de colateral constituído | Aguardar o cumprimento de todos os requsitos de desembolso e o pagamento da operação de crédito

### 12.2 - Casos de erro

        **Request**

ENDPOINT /debt/[debt_key]/collateral
METHOD GET

        **Response**

Response Body

```json
{
  "collateral_constituted": false,
  "collateral_type": "fgts_balance",
  "updated_at": "2023-05-24 19:13:02",
  "collateral_data": {
    "periods": [
      {
        "amount": 77.86,
        "due_date": "2023-12-01"
      },
      {
        "amount": 54.51,
        "due_date": "2024-12-01"
      },
      {
        "amount": 38.83,
        "due_date": "2025-12-01"
      },
      {
        "amount": 35.34,
        "due_date": "2026-12-01"
      }
    ],
    "document_number": "73422975004",
    "status": "pending_protocol",
    "last_response": {
      "errors": [
        {
          "enumerator": "on_locked_date_range"
        }
      ]
    },
    "last_response_event_datetime": "2023-05-22T19:13:02Z"
  }
}
```

| Enumerador                           | Descrição<br/>   |  Ação da QI  | Ação do Cliente |
|--------------------------------------|-----------------------------------------------------------------------------|-------------|-----------|
| `unauthorized_institution`           | Instituição não autorizada pelo cliente                                           | Cancelamento da operação, porém continuamos rententando a averbação | Orientar o cliente a realizar a autorização da "**QI SOCIEDADE DE CREDITO S.A**" para operar o Adiantamento do Saque Aniversário FGTS |
| `inexistent_anniversary_membership ` | Trabalhador não possui adesão ao saque aniversário na data vigente   | Cancelamento da operação, saldo do cliente não é averbado (retirada da nossa fila de retentativas)| Necessário orientar o cliente a aderir a modalidade de Saque Aniversário no aplicativo do FGTS | 
| `on_locked_date_range `              | A Operação não é permitida na data atual | Retentativa de averbação apenas na data em que a operação passa a ser permitida | A operação é permitida no segundo dia útil do próximo mês. Como a operação fica travada até esse período, recomenda-se o envio cancelamento permanente e a devida comunicação com o cliente, visto que ele não conseguirá fazer a operação no momento em nenhuma outra instituição financeira |
| `insufficient_balance `              | Trabalhador não possui saldo disponível para a Operação Fiduciária  | Cancelamento da operação, saldo do cliente não é averbado (retirada da nossa fila de retentativas) | Recomenda-se reduzir valor da operação ou cancelar a operação, caso o saldo seja zerado.|
| `processing_pending_changes `        | Operação não permitida por pendência no processo de pagamento de Saque Aniversário | Cancelamento da operação, saldo do cliente não é averbado (retirada da nossa fila de retentativas)| Orientar cliente a aguardar a regularização |
| `invalid_given_period `              | Uma ou mais datas de previsão do saque informadas não conferem com as datas previstas no sistema da Caixa ou os valores enviados para as parcelas são maiores do que o disponível   | Recomenda-se reduzir valor da operação ou cancelar caso saldo seja zerado Cancelamento da operação, saldo do cliente não é averbado (retirada da nossa fila de retentativas) | Necessário a digitação de uma nova operação |
| `operation_in_process`               | Reserva pendente de protocolo | Retentativa de averbação do saldo do cliente  | A Caixa tem uma rotina que destrava essas reservas a cada um ou dois dias. Sendo assim, é necessário orientar o cliente que a reserva está presa na Caixa e será liberada em breve |
| `not_found_operation`                | Status só é retornado para reservas em processo de desaverbação   | Encaminhamos a reserva para nossa fila de deleção para garantir que não existe saldo do cliente bloqueado conosco, então mudamos o status da reserva para cancelado | Necessário a digitação de uma nova operação |
| `anniversary_membership_egress `     | Trabalhador com solicitação de retorno para saque rescisão |  Cancelamento da operação, saldo do cliente não é averbado (retirada da nossa fila de retentativas) | Orientar cliente que ele solicitou o egresso da modalidade de Saque Aniversário, isso  impede que ele faça o adiantamento de seus saques
| `protocol_removed`                   | Protocolo removido na CEF   | Cancelamento da operação, saldo do cliente não é averbado (retirada da nossa fila de retentativas) | Necessário a digitação de uma nova operação |
| `protocol_rejected`                  | Protocolo recusado pela CEF  | Cancelamento da operação, saldo do cliente não é averbado (retirada da nossa fila de retentativas)|  Necessário a digitação de uma nova operação
| `protocol_in_process`                | Protocolo está em processamento na CEF     | Retentativa de averbação do saldo do cliente |  A Caixa tem uma rotina que destrava essas reservas a cada um ou dois dias. Sendo assim, é necessário orientar o cliente que a reserva está presa na Caixa e será liberada em breve
| `timeout`                            | A CEF retornou erro de timeout     | Retentativa de averbação do saldo do cliente | Necessário acompanhar os próximos retornos da Caixa e aguardar a averbação do saldo do cliente. Esse erro é normal quando temos períodos de instabilidade na Caixa 
| `unexpected_error`                   | A CEF retornou erro inesperado     | Retentativa de averbação do saldo do cliente | Necessário acompanhar os próximos retornos da Caixa e aguardar a averbação do saldo do cliente.
| `period_rejected`                    | Período da reserva recusado pela CEF    | Cancelamento da operação, saldo do cliente não é averbado (retirada da nossa fila de retentativas)| Necessário a digitação de uma nova operação para que sejam enviados períodos atualizados
| `deletion_request`                   | A solicitação de desaverbação foi realizada antes da conclusão da reserva   | Cancelamento da operação, saldo do cliente não é averbado (retirada da nossa fila de retentativas) |  Necessário a digitação de uma nova operação para que seja feito uma nova tentativa de averbação  |  
| `rate_limit_exceeded`                | Número máximo de requisições por segundo na CEF foi excedido   | Retentativa de averbação do saldo do cliente  | Acompanhar os próximos retornos da Caixa e aguardar a averbação do saldo do cliente 
| `misformatted_error `                | A CEF retornou um erro mal formatado   |  Retentativa de averbação do saldo do cliente |  Acompanhar os próximos retornos da Caixa e aguardar a averbação do saldo do cliente    |
| `unlisted_error     `                | A CEF retornou um erro que não está listado  |   Retentativa de averbação do saldo do cliente | Acompanhar os próximos retornos da Caixa e aguardar a averbação do saldo do cliente 
| `registration_changes_or_debit_transactions     `                | Foram feitas alterações cadastrais ou movimentações de débito na conta do FGTS, impossibilitando o processo de contratação.  |   Retentativa de averbação do saldo do cliente | Necessário a reapresentação da operação, após a regularização das pendências, se ainda houver opções de desembolso
| `fgts_accounts_not_found     `                | O trabalhador informado não tem contas do FGTS  |   Cancelamento da operação, saldo do cliente não é averbado (retirada da nossa fila de retentativas) |Necessário a digitação de uma nova operação para que seja feito uma nova tentativa de averbação, assim que o processo de pagamento pendente for resolvido
| `inexistent_anniversary_membership_on_period`                | A CEF retornou um erro que não está listado  |   Retentativa de averbação do saldo do cliente | Acompanhar os próximos retornos da Caixa e aguardar a averbação do saldo do cliente 
| `insufficient_balance_available`                | O valor indicado não está disponível para contratação |   Cancelamento da operação, saldo do cliente não é averbado (retirada da nossa fila de retentativas)| Recomenda-se reduzir o valor da operação para fazer uma nova tentativa, se houver saldo disponível. Ou cancelar a operação, redigitando a operação para conseguir um saldo atualizado.
| `insufficient_balance_for_guarantee`                | O saldo disponível não é suficiente para a garantia requerida |   Cancelamento da operação, saldo do cliente não é averbado (retirada da nossa fila de retentativas) | Recomenda-se reduzir o valor da operação para fazer uma nova tentativa, se houver saldo disponível. Ou cancelar a operação, redigitando a operação para conseguir um saldo atualizado.

---

# Vehicle Collateral Manual

URL: /en/documentation/manual_garantia_veicular/

:::caution API under development
The API is still in development phase, therefore, this manual is subject to changes.
:::

:::danger Warning!
QI Tech webhooks should not be mapped restrictively. 
Additional fields may be included in the webhook payloads returned by our APIs.
:::

:::info Webhook Resend
Webhooks can be queried and resent following the detailed instructions in the documentation: [Webhook Resend](/documentation/notificacoes/reenvio_de_notificacoes).
:::

This manual describes the complete flow of a credit operation with vehicle collateral (lien). Lien registration at SNG/B3, contract registration at DETRAN/Registrar, image submission, and cancellation are all handled internally by QI Tech. The process is tracked via consultation (GET) endpoints and webhooks.

## Prerequisites

1. Have access credentials for the QI Tech API (see [Getting Started](/documentation/primeiros_passos/inicio));
2. Have completed sandbox environment homologation;
3. The vehicle must have valid chassis, RENAVAM (when already licensed), and licensing state information.

## Flow Overview

```mermaid
sequenceDiagram
    participant Partner
    participant QITech as QI Tech
    participant SNG as SNG/B3
    participant DETRAN as DETRAN/Registrar

    Partner->>QITech: 1. POST /debt_simulation (vehicle)
    QITech-->>Partner: Financial conditions (fees per Detran region)
    Partner->>QITech: 2. POST /debt (with collateral_data)
    QITech-->>Partner: 201 Created (waiting_signature)
    Note over Partner: Signs the contract
    Partner->>QITech: 3. Contract signature
    QITech-->>Partner: Webhook (signature_finished)
    QITech->>SNG: 4. Register lien (automatic)
    QITech-->>Partner: Webhook (pending_reservation_confirmation)
    SNG-->>QITech: Lien registered
    QITech-->>Partner: Webhook (reserved)
    QITech-->>Partner: 5. Disbursement (funds transfer)
    QITech->>DETRAN: 6. Register contract (automatic)
    QITech-->>Partner: Webhook (pending_registration_confirmation)
    DETRAN-->>QITech: Contract registered
    QITech-->>Partner: Webhook (registered)
    QITech->>DETRAN: 7. Submit contract image (automatic)
    Partner->>QITech: 8. GET /debt/{debt_key}/vehicle_collateral/reservation
    Partner->>QITech: 9. GET /debt/{debt_key}/vehicle_collateral/register
```

1. **Simulate** — Send `POST /debt_simulation` with `collateral_type: "vehicle"` (see [Simulation and Issuance](/documentation/garantia_veicular/simulacao_e_emissao));
2. **Create the operation** — Send `POST /debt` including vehicle data in the `collaterals` object (see [Simulation and Issuance](/documentation/garantia_veicular/simulacao_e_emissao));
3. **Signature receipt** — The partner signs the contract and QI Tech receives the signature confirmation. Webhook sent: `signature_finished`;
4. **QI Tech registers the lien** — After signing, QI Tech automatically submits lien registration to SNG/B3. Webhooks are sent: `pending_reservation_confirmation` → `reserved`;
5. **Disbursement** — After lien confirmation (`reserved`), QI Tech disburses funds to the specified bank account;
6. **QI Tech registers the contract** — QI Tech automatically submits contract registration to DETRAN/Registrar. Webhooks are sent: `pending_registration_confirmation` → `registered`;
7. **QI Tech submits the contract image** — QI Tech handles image submission to DETRAN/Registrar;
8. **Track progress** — Query the reservation (lien) and registration (contract) at any time via GET endpoints (see [Queries](/documentation/garantia_veicular/consultas));
9. **Receive notifications** — Lien webhooks use type `laas.vehicle_collateral.reservation_status_change` (SNG/B3) and contract webhooks use `laas.vehicle_collateral.register_status_change` (DETRAN) (see [Webhooks](/documentation/garantia_veicular/webhooks)).

:::info Base URLs
**Staging:** Provided by QI Tech during onboarding.  
**Production:** Provided by QI Tech after homologation.
:::

:::info HTTP Codes
200 = Success · 201 = Created · 400 = Validation failure (see body) · 401 = Unauthorized · 403 = Forbidden · 404 = Not found · 500 = Internal error
:::

---

# My INSS Proposal Auction Manual

URL: /en/documentation/manual_leilao_meu_inss/

:::danger Warning!
QI Tech webhooks should not be mapped restrictively.
Additional fields may be included in webhook payloads returned by our APIs.
:::

## Introduction

### Welcome to the My INSS Proposal Auction API. 

The **My INSS Proposal Auction** is a service that allows querying *Proposal Requests*, created by beneficiaries, and the inclusion of *Proposals*, by consigners, to offer Credit opportunities to retirees/pensioners. 

The API allows creating, updating, querying and canceling proposals within the Auction. ***May the best proposal win!!!***

### Problems?

If you have any issues, please contact our support (suporte@qitech.com.br) and we will respond as quickly as possible.

### Environments

We have two environments for our customers. The base URLs for the APIs are:

- Production - `https://api-auth.qitech.app/`
- Sandbox - `https://api-auth.sandbox.qitech.app/`

## HTTPS Only

For security reasons, all communication with QI Tech APIs must be performed using HTTPS communication. To prevent HTTP calls from being made inadvertently or for other reasons, this server only makes available port 443 with TLS 1.2 communication. Calls made using other protocols will be automatically denied.

## ProposalRequest: Credit Proposal Request

The `ProposalRequest` is the object that represents the **Credit Proposal Request** made by the beneficiary. For a pensioner or retiree to make a request, it is necessary that they have available balance, are eligible, and have an active and unblocked benefit.

When QI Tech receives a new **Credit Proposal Request**, we will send a Webhook to the configured endpoint. 

Below is an example of the payload sent:

```json
{
    "expiration_datetime": "2024-09-22T10:22:10Z",
    "status": "ongoing",
    "inclusion_limit_datetime": "2024-09-02T14:22:15Z",
    "proposal_request_key": "24e9625a-e264-4d33-8b59-a5238001b12f",
    "proposal_request_data": {
        "consigned_credit": {
            "balance": 432
        }
    }
}
```

:::warning Warning
This is the initial data of the proposal request. To view **ALL INFORMATION** about beneficiaries, it is necessary to create a **Proposal** accepting the respective **ProposalRequest**. The remaining data consists of **CPF**, **Name**, **Birth date**, **benefit number**, **benefit type**, among others...
:::

## ProposalRequest Object Definition

All information exchanges of a ProposalRequest use the following definition for this object. In some cases, to facilitate implementation and reduce data flow between parties, some information may be omitted.

| Name            | Type   | Description                                                                          |
| --------------- | ------ | ---------------------------------------------------------------------------------- |
| proposal_request_key        | string  | Unique identifier of the **Proposal Request** |
| proposal_request_data       | object  | Object that describes the data of the **Proposal Request** |
| status                      | string  | Status of the **Proposal Request** (`ongoing`, `finished`, `expired`)|
| expiration_datetime         | string  | Expiration date of the **Proposal Request** in `YYYY-MM-DDTHH:MM:SSZ` format |
| inclusion_limit_datetime    | string  | Deadline for including **Proposals** in the auction in `YYYY-MM-DDTHH:MM:SSZ` format |

### ProposalRequestData Object Definition

| Name            | Type   | Description                                                                          |
| --------------- | ------ | ---------------------------------------------------------------------------------- |
| name                        |string | Full name of the Beneficiary |
| state                       |string | State of the Beneficiary |
| document_number             |string | CPF of the Beneficiary |
| birth_date                  |string | Birth date of the Beneficiary in `DDMMYYYY` format |
| benefit_number              |integer| Benefit number of the Retiree/Pensioner |
| benefit_status              |string | Enumerator that describes the benefit situation |
| assistance_type             |string | Enumerator of the benefit **Type** |
| benefit_situation           |string | Enumerator that describes the benefit situation |
| max_total_balance           |float  | Possible committed value for the respective benefit species |
| used_total_balance          |float  | Total value committed in loan endorsements, reserved for portability, refinancing, changes, RMC and RCC |
| requested_disbursed_amount  |float  | Disbursement amount requested by the beneficiary |
| number_of_installments      |integer| Number of installments requested by the beneficiary |
| has_legal_representative    |boolean| Indicates if the beneficiary has a legal representative |
| has_power_of_attorney       |boolean| Indicates if the beneficiary has a power of attorney |
| has_entity_representation   |boolean| Indicates if the beneficiary has entity representation |
| consigned_credit.balance    |float  | Available balance amount of the beneficiary |

### Proposal Request Status Details

The status of the **Proposal Request** can be:

| Status  | Description                                                                 |
| ------- | ------------------------------------------------------------------------- |
| ongoing | **Proposal Request** ongoing, the auction continues active.  |
| finished| **Proposal Request** finished, the auction has ended and a sent **Proposal** was accepted and included. |
| expired | **Proposal Request** expired, the auction has ended without including any **Proposal** in due time.  |

## Querying a Proposal Request after Webhook delivery

If desired, it is still possible to query the **Proposal Request** made by the beneficiary again (even after sending the **automatic Webhook**). Make a call via **API** using the ***ID*** of the **Proposal Request** sent via automatic Webhook.

:::warning Warning
The complete consultation of beneficiary data will also only be allowed if the Partner Accepts the **Proposal Request** and Creates a **Proposal**.
:::

ENDPOINT - `/social_security_auction/proposal_request/{proposal_request_key}`
METHOD - `GET`

### Path Params

| Field         | Type   | Description                              | Characters | Required |
|---------------|--------|----------------------------------------|------------| ----------- |
| `proposal_request_key` | uuidv4 | Unique identification key of the **ProposalRequest** used in uuid v4 format. | 36         | Yes         |

### Response - Partial Query

STATUS - 200

Response Body: Partial query of ProposalRequest

```json
{
    "proposal_request_data": {
        "consigned_credit": {
            "balance": 750.00
        }
    },
    "proposal_request_key": "94340718-e90b-4641-b34b-7966297e49c4",
    "status": "ongoing",
    "inclusion_limit_datetime": "YYYY-MM-DDTHH:MM:SSZ",
    "expiration_datetime": "YYYY-MM-DDTHH:MM:SSZ"
}
```

Response Body: Complete query of ProposalRequest

```json
{
    "proposal_request_data": {
        "name": "João Silva",
        "state": "SP",
        "birth_date": "14031992",
        "benefit_number": 8784006178,
        "benefit_status": "elegible",
        "assistance_type": "retirement_by_age",
        "document_number": 71881324451,
        "consigned_credit": {
            "balance": 750.00
        },
        "benefit_situation": "active",
        "max_total_balance": 1800.00,
        "used_total_balance": 1400.00,
        "has_power_of_attorney": false,
        "number_of_installments": 48,
        "has_legal_representative": false,
        "has_entity_representation": false,
        "requested_disbursed_amount": 15000.00,
        "social_benefit_max_balance": 1800.00,
        "social_benefit_used_balance": 1400.00,
        "dataprev_proposal_request_id": 41
    },
    "proposal_request_key": "94340718-e90b-4641-b34b-7966297e49c4",
    "status": "ongoing",
    "inclusion_limit_datetime": "YYYY-MM-DDTHH:MM:SSZ",
    "expiration_datetime": "YYYY-MM-DDTHH:MM:SSZ"
}
```

*NOTE: The field details of the `Response Body` are described in the ProposalRequest Object definition above.*

## Proposal: Credit Proposal to Beneficiary

The `Proposal` is the object that represents the **Credit Proposal** made by the consigner to the beneficiary. For QI Tech to include a new **Proposal** for the retiree/pensioner, given a specific **Proposal Request**, an Auction will be held where the best Credit Offer will be taken forward. 

:::warning Warning
Only one **Proposal** per **Proposal Request** will be accepted - allowing only modification of the same, according to partner interest.
:::

## Proposal Object Definition

All information exchanges of a **Proposal** use the following definition for this object. In some cases, to facilitate implementation and reduce data flow between parties, some information may be omitted.

| Name                        | Type    | Description                                                                          |
| --------------------------- | ------- | ---------------------------------------------------------------------------------- |
| proposal_request_key        | string  | Unique identifier of the **Proposal Request**. |
| request_control_key         | string  | Unique identification key of the **Proposal** included in uuid v4 format. |
| proposal_data               | object  | Object that describes the **Proposal** data sent by the partner. |
| status                      | string  | Status of the **Proposal** (`created`, `bid`, `lost`, `won`, `cancelled`).|
| cet                         | float   | CET value calculated for the proposal **included** in the Auction (calculated later).|
| updated_at                  | string  | Date of inclusion or update of the **Proposal** in `YYYY-MM-DDTHH:MM:SSZ` format.|
| rank_position               | integer | Current position of the **Proposal** in the Auction ranking for its respective equivalent **Proposal Request**.|

*NOTE: The content of the `proposal_data` object is composed of information sent by the Participant in a request described later.*

### Proposal Request Status Details

The status of the **Proposal** can be:

| Status   | Description                                                                 |
|----------| ------------------------------------------------------------------------- |
| created  | **Proposal** was created, but was not included in the Auction of its respective **Proposal Request** in progress.  |
| bid      | **Proposal** was included in the auction with its conditions - still subject to changes. |
| lost     | **Proposal** lost the Auction of that **Proposal Request**. The Auction ended without including this **Proposal**.  |
| won      | **Proposal** won the Auction of that **Proposal Request**. The Auction ended with the inclusion of this **Proposal**.  |
| cancelled| **Proposal** cancelled by the participant.  |

## Accepting a Proposal Request and Creating a Proposal

To accept the **Proposal Request** created by the beneficiary and be able to query their complete data, make a call via **API** with the ***ID*** received from the **Proposal Request** via automatic Webhook or subsequent query, as shown in the example below:

ENDPOINT - `/social_security_auction/proposal_request/{proposal_request_key}/proposal`
METHOD - `POST`

### Path Params

| Field         | Type   | Description                              | Characters | Required |
|---------------|--------|----------------------------------------|------------| ----------- |
| `proposal_request_key` | uuidv4 | Unique identification key of the **ProposalRequest** used in uuid v4 format. | 36         | Yes         |

### Response

STATUS - 201 (Created)

Response Body: Proposal created

```json
{"request_control_key": "814e7ed3-4080-4cae-a853-8e12812817ea"}
```

### Response Body Params 

| Field         | Type   | Description                              | Characters | Required |
|---------------|--------|----------------------------------------|------------| ----------- |
| `request_control_key` | uuidv4 | Unique identification key of the **Proposal** included in uuid v4 format. | 36         | Yes         |

## Including a Proposal in the auction

To effectively **include** or **update** your proposal in the **Credit Auction**, make a call via **API** with the relevant **Proposal** data as shown in the example below:

ENDPOINT - `/social_security_auction/proposal_request/{proposal_request_key}/proposal/{request_control_key}`
METHOD - `PATCH`

Request Body: Including a Proposal in the auction

```json
{
    "disbursed_issue_amount": 15000,
    "monthly_interest_rate": 0.04252764,
    "installment_face_value": 400.00,
    "number_of_installments": 48,
    "contacts": [
        {
            "contact_type": "email",
            "contact": "exemplo@qitech.com.br"
        },
        {
            "contact_type": "phone",
            "contact": "5511999999999"
        }
    ],
    "expiration_datetime": "YYYY-MM-DDTHH:MM:SSZ"
}
```

:::warning Warning
For the **monthly_interest_rate** and **installment_face_value** fields, ONLY 1 of these 2 fields should be informed in the request. The other does not need to be included in the sent Payload, if it is, a null value should be provided.
:::

### Body Params

| Field         | Type   | Description                              | Required |
|---------------|--------|----------------------------------------|------------|
| `disbursed_issue_amount`| float  | Disbursement amount intended by the **Proposal**.                                                           | Yes         |
| `monthly_interest_rate` | float  | Monthly interest rate of the **Proposal** in the range from 0 to 1 (0% to 100%, respectively).                    | No         |
| `installment_face_value`| float  | Installment amount intended by the **Proposal**.                                                              | No         |
| `number_of_installments`| integer| Number of installments of the proposal.                                                                             | Yes         |
| `contacts`              | array  | List of contacts of the **Proposal** that will be sent to the beneficiary                                          | Yes         |
| `contacts.contact_type` | string | Type of contact channel registered in the **Proposal**. Possible values are `email`, `phone` and `website`. | Yes         |
| `contacts.contact`      | string | Partner contact, which will be sent to the beneficiary.                                                  | Yes         |
| `expiration_datetime`   | string | Expiration date of the **Proposal** sent to the beneficiary, in `YYYY-MM-DDTHH:MM:SSZ` format                | Yes         |

### Response

STATUS - 202 (Accepted)

Response Body: Proposal created

```json
{
  "request_control_key": "814e7ed3-4080-4cae-a853-8e12812817ea",
  "status": "bid",
  "rank_position": 2
}
```

### Response Body Params

|         Field         |  Type   | Description| 
|-----------------------|---------|----------|
| `request_control_key` | string  | Unique identification key of the **Proposal** included in uuid v4 format. | 
| `status`              | string  | Status of the **proposal** |
| `rank_position`       | integer | Position of the proposal in the Auction Ranking for its respective **Proposal Request** |

## Canceling the Proposal

If you want to delete a Proposal created or included in the Auction, simply make a call via **API**, with the relevant **Proposal** data:

:::danger Warning!
It is only possible to Create/Include ONE **Proposal** per **Proposal Request**. Given the dynamic nature of the Auction, if you cancel your **Proposal** it is not possible to go back and/or include a new one for this same **Proposal Request**.
:::

ENDPOINT - `/social_security_auction/proposal_request/{proposal_request_key}/proposal/{request_control_key}/cancel`
METHOD - `PUT`

| Field         | Type   | Description                              | Characters | Required |
|---------------|--------|----------------------------------------|------------| ----------- |
| `proposal_request_key` | uuidv4 | Unique identification key of the **ProposalRequest** used in uuid v4 format. | 36         | Yes         |
| `request_control_key`  | uuidv4 | Unique identification key of the **Proposal** included in uuid v4 format.         | 36         | Yes         |

### Response

STATUS - 202 (Accepted)

Response Body: Proposal cancelled

```json
{
  "request_control_key": "814e7ed3-4080-4cae-a853-8e12812817ea",
  "status": "cancelled"
}
```

### Response Body Params

|         Field         |  Type   | Description| 
|-----------------------|---------|----------|
| `request_control_key` | string  | Unique identification key of the **Proposal** included in uuid v4 format. | 
| `status`              | string  | Status of the **proposal** |

## Querying the Proposal

If you want to query your **Proposal**, simply make a call via **API** using the ***ID*** returned when creating the Proposal:

ENDPOINT - `/social_security_auction/proposal/{request_control_key}`
METHOD - `GET`

### Path Params

| Field         | Type   | Description                              | Characters | Required |
|---------------|--------|----------------------------------------|------------| ----------- |
| `request_control_key`  | uuidv4 | Unique identification key of the **Proposal** included in uuid v4 format. | 36         | Yes         |

### Response

STATUS - 200

Response Body: Query of Proposal Included in Auction

```json
{
    "proposal_request_key": "94340718-e90b-4641-b34b-7966297e49c4",
    "status": "bid",
    "request_control_key": "814e7ed3-4080-4cae-a853-8e12812817ea",
    "proposal_data": {
        "contacts": [
            {
                "contact": "exemplo@qitech.com.br",
                "contact_type": "email"
            },
            {
                "contact": "5511999999999",
                "contact_type": "phone"
            }
        ],
        "simulation": {
            "cet": 0.0019,
            "annual_cet": 0.023647,
            "iof_amount": 462.04,
            "issue_amount": 15539.74,
            "disbursed_issue_amount": 15000,
            "prefixed_interest_rate": {
                "daily_rate": 0.00001417,
                "annual_rate": 0.00511527,
                "monthly_rate": 0.00042528,
                "interest_base": "calendar_days"
            },
            "installments_face_value": 327.04
        },
        "expiration_datetime": "YYYY-MM-DDTHH:MM:SSZ",
        "monthly_interest_rate": 0.04252764,
        "disbursed_issue_amount": 15000,
        "number_of_installments": 48
    },
    "cet": 0.0019,
    "updated_at": "YYYY-MM-DDTHH:MM:SSZ",
    "rank_position": 1
}
```

Response Body: Query of Proposal Created and not included in Auction

```json
{
    "proposal_request_key": "94340718-e90b-4641-b34b-7966297e49c4",
    "status": "created",
    "request_control_key": "01a7a1bf-b75b-4526-bbc3-a27e85e14325"
}
```

*NOTE: The field details returned in the `Response Body` are described in the Proposal Object definition above.*

## HTTP Status

The signature API uses the following standardization in HTTP return statuses, according to RFC 7231 :

| HTTP Status | Meaning           | Description                                                                                                                                                                       |
| ----------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 400         | Bad Request           | The sent request has some formatting error. In most cases, we return an explanation of where the error is in the message body.                                 |
| 401         | Unauthorized          | There was some problem with authentication, check if the API Key is correct and in the correct header, according to the <a href='#autenticacao'>Authentication</a> section.                  |
| 403         | Forbidden             | The accessed endpoint is for internal use and is not available for this API Key.                                                                                                   |
| 404         | Not Found             | The requested data was not found using the key used. This status is also returned when an invalid endpoint is requested.                                       |
| 405         | Method Not Allowed    | The HTTP method used does not apply to the endpoint used.                                                                                                                    |
| 406         | Not Acceptable        | The data sent in the request body is invalid. Generally, this means the sent data is not valid JSON.                                                  |
| 409         | Conflict              | The request id corresponds to an id already processed previously. This status is returned in case of duplicate requests sent to the server.                             |
| 500         | Internal Server Error | We had a problem processing this request, when we encounter this error our specialists are automatically notified and begin analysis and solution immediately. |
| 503         | Service Unavailable   | You encountered an unavailability, planned or not, of our server infrastructure.                                                                           |

---

# Portability Out - Retention Evidence

URL: /en/documentation/manual_portabilidade/evidencias_de_retencao

# Retention Evidence

:::info Objective
To finalize the retention of a contract attacked by portability, it is **mandatory** to send evidence that proves:
1. Contact was made with the borrower;
2. The borrower's explicit acceptance of the retention.
:::

## 1. Evidence Collection

Evidence can be collected via message (WhatsApp, Chat), email, or recorded call. Regardless of the channel, the interaction must strictly follow the service scripts listed below for each retention reason.

### 1.1 If there is refinancing

Use this script when retention is performed through a refinancing offer for the current contract.

```text title="Script - Retention with Refinancing"

Sr. (a) XXXXX, com final de CPF XXX-XX, conforme sua aprovação, na data de hoje XX/XX/XXXX,
estamos cancelando a sua solicitação(ões) de portabilidade de número(s) final(is) XXXX, efetuada pelo Banco XX, 
referente ao(s) contratos finais XXXX  mediante a oferta de refinanciamento.
O Sr.(a) confirma? 

SIM / OK / CONFIRMO
```

### 1.2 If there is NO refinancing
Use this script when retention is performed maintaining the original conditions, without refinancing.

```text title="Script - Retention without Refinancing"

Sr. (a) XXXXX, com final de CPF XXX-XX, conforme sua aprovação, na data de hoje XX/XX/XXXX,
estamos cancelando a sua solicitação(ões) de portabilidade de número(s) final(is) XXXX, efetuada pelo Banco XX, 
referente ao(s) contratos finais XXXX  mantendo-o junto ao [NOME DA IF].
O Sr.(a) confirma? 

SIM / OK / CONFIRMO
```

### 1.3 When the customer DID NOT REQUEST portability
Use this script when the customer reports they do not recognize the portability request.

```text title="Script - Undue attack"

Sr. (a) XXXXX, com final de CPF XXX-XX, conforme sua aprovação, na data de hoje XX/XX/XXXX, 
estamos cancelando a sua solicitação(ões) de portabilidade de número(s) final(is) XXXX, 
efetuada pelo Banco XX  sem o seu consentimento, referente ao(s) contratos finais XXXX  mantendo-o junto ao [NOME DA IF]. 
O Sr.(a) confirma? 

SIM / OK / CONFIRMO
```

---

# Out Portability

URL: /en/documentation/manual_portabilidade/portabilidade_out

:::danger Attention!
QI Tech webhooks should not be mapped restrictively. 
Additional fields may be included in the webhook payloads returned by our APIs.
:::

:::info Webhook Resend
You can consult and resend webhooks following the detailed instructions in the documentation: [Webhook Resend](/documentation/notificacoes/reenvio_de_notificacoes).
:::

## 1. Out portability receipt notification

As soon as a portability request is received by QI SCD via CTC (Credit Transfer Center), the partner will be notified through the following webhook:

WEBHOOK_TYPE credit_transfer.received_portability
STATUS Received

Webhook Body

```json
{
    "webhook_type": "credit_transfer.received_portability",
    "received_portability_status": "received", 
    "key": "673d2872-c6c9-4075-b9ab-4525bcbe4aa1",
    "event_datetime": "2022-07-24T18:29:45",  
    "data": {
        "annual_interest_rate": "20.27",
        "annual_effective_interest_rate": "20.27",
        "number_of_installments": "6",
        "installment_face_value": "201.71",
        "phone_number": "(05)541997558",
        "address": {
            "street": "Rua Longe de Casa",
            "city": "Rio de Janeiro",
            "state": "RJ",
            "number": "112",
            "postal_code": "38300569"
        },
        "due_balance": "1000",
        "due_balance_date": "2022-07-29",
        "issuer_name": "A Random Name",
        "issuer_document_number": "37197645832",
        "reference_date": "2022-08-01",
        "contract_number": "0000049045/UO",
        "origin_credit_operation_key": "7daef1ad-5497-4ec3-92f4-26f8d63bcd80",
        "retention_limit_date": "2022-08-03", 
        "due_balance_limit_date": "2022-08-08", 
        "portability_number": "202207150000001642808",
        "corban_document_number": "08289470514408",
        "source_ispb_number": "0"
    }
}
```

Check the field descriptions in the table [received_portability webhook details](#received_portability)

## 2. Response to portability attack

### 2.1. Contract retention

:::warning Webhook Resend
To retain the client, the partner must **[upload](../upload_de_documentos)** the **[retention evidence](./evidencias_de_retencao)** and attach them to the operation by 6:00 PM on the 4th business day after receiving the attack event (_**credit_transfer.received_portability**_).
:::

ENDPOINT /credit_transfer/received_portability/ [received_portability_key]
METHOD PATCH

Test in Playground

```json title='Request Body
{
  "received_portability_status": "retained",
  "retention_reason": "issuer_retention",
  "document_type": "received_portability_retention_proof",
  "documents": [
    {
      "file_type": "jpeg",
      "document_key": "3d6fbbbf-55e9-4275-8050-b83b33fdefa6",
    }
  ]
}

```
:::danger Attention
**COMPRESSED files will NOT be accepted.**
:::

Check the request field descriptions in the Table

### 2.2 Out portability approval

If the client is not retained, the partner must inform about the non-retention by 10:00 AM on the 4th business day after receiving the portability attack notification (_**credit_transfer.received_portability**_).

:::danger Attention
**If the portability request is not responded to within 4 business days, QI Tech will return the operation's outstanding balance to the proposer (portability requester).**
:::

ENDPOINT /credit_transfer/received_portability/ [received_portability_key]
METHOD PATCH

Test in Playground

```json title='Request Body'
{
	"received_portability_status": "accepted_by_creditor"
}
```

## 3. Querying out portability requests

### 3.1. Portability request query

To check the possible statuses of the 

ENDPOINT /credit_transfer/received_portability/ [received_portability_key]
METHOD GET

Test in Playground

Response Body

```json
{
	"received_portability_key": "e3bedf31-1e87-4ba4-a36c-d52f7f5c9036",
	"received_portability_status": "accepted",
	"annual_interest_rate": "20.27",
	"annual_effective_interest_rate": "20.27",
	"number_of_installments": "6",
	"installment_face_value": "201.71",
	"phone_number": "(05)541997558",
	"address": {
		"street": "Rua Longe de Casa",
		"city": "Rio de Janeiro",
		"state": "RJ",
		"number": "112",
		"postal_code": "38300569"
	},
	"due_balance": 1000,
	"due_balance_date": "2022-07-29",
	"issuer_name": "A Random Name",
	"issuer_document_number": "37197645832",
	"reference_date": "2022-08-01",
	"contract_number": "0000049045/UO",
	"origin_credit_operation_key": "key",
	"retention_limit_date": "2022-08-03",
	"due_balance_limit_date": "2022-08-08",
	"portability_number": "202207150000001642808",
	"retention_reason": null,
	"canceled_reason": null,
  "corban_document_number": "08289470514408",
  "attached_documents": [
    ],
  "financial_institution_code_number": "001",
  "financial_institution_name": "Banco do Brasil",
  "ispb": "00000000",
  "requester_key": "8511012c-3a3c-4f4d-9f23-dbe437211a8e",
  "requester_name": "Corban LTDA",
  "response_date": null,
  "settlement_date": null,
  "settlement_due_balance": null
}
```

### 3.2. List portability request

ENDPOINT /credit_transfer/received_portability
METHOD GET
PARAMETERS settlement_date, max_portability_date, due_balance_limit_date, received_portability_status, portability_number, contract_number, credit_operation_key

Test in Playground

Response Body

```json
{
	"data": [{
		"received_portability_key": "e3bedf31-1e87-4ba4-a36c-d52f7f5c9036",
		"received_portability_status": "accepted",
		"annual_interest_rate": 1,
		"annual_effective_interest_rate": 1,
		"number_of_installments": 6,
		"installment_face_value": 201.71,
		"phone_number": "(05)541997558",
		"address": {
			"street": "Rua Longe de Casa",
			"city": "Rio de Janeiro",
			"state": "RJ",
			"number": "112",
			"postal_code": "38300569"
		},
		"due_balance": 1000,
		"due_balance_date": "2022-07-29",
		"issuer_name": "A Random Name",
		"issuer_document_number": "37197645832",
		"reference_date": "2022-08-01",
		"contract_number": "0000049045/UO",
		"origin_credit_operation_key": "key",
		"retention_limit_date": "2022-08-03",
		"due_balance_limit_date": "2022-08-08",
		"portability_number": "202207150000001642808",
		"retention_reason": null,
		"canceled_reason": null
	}],
	"pagination": {
		"next_page": null,
		"current_page": 1,
		"total_rows": 0,
		"rows_per_page": 1,
		"total_pages": 0
	}
}
```

## 4. Webhooks

Below are the possible webhooks received during the flow, the [state machine](#state-machine) can be consulted to check possible status changes (the canceled_by_proponent status can be reached from any non-final status)

### 4.1. Waiting for outstanding balance payment

WEBHOOK_TYPE credit_transfer.received_portability
STATUS waiting_settlement

```json title='Webhook Body'
{
  "webhook_type": "credit_transfer.received_portability",

  "received_portability_key": "673d2872-c6c9-4075-b9ab-4525bcbe4aa1",
  "received_portability_status": "waiting_settlement",
  "event_datetime": "2022-07-24T18:29:45",
  "data": {
    "settlement_due_balance": 120.00,
    "settlement_date": "2022-08-02"
  }
}
```

### 4.2. Proposal canceled by proposer

WEBHOOK_TYPE credit_transfer.received_portability
STATUS canceled_by_proponent

```json title='Webhook Body'
{
  "webhook_type": "credit_transfer.received_portability",
  "received_portability_key": "673d2872-c6c9-4075-b9ab-4525bcbe4aa1",
  "received_portability_status": "canceled_by_proponent",
  "event_datetime": "2022-07-24T18:29:45",
  "data": {}
}
```

### 4.3. Portability settled

WEBHOOK_TYPE credit_transfer.received_portability
STATUS settled

```json title='Webhook Body'
{
  "webhook_type": "credit_transfer.received_portability",
  "received_portability_key": "673d2872-c6c9-4075-b9ab-4525bcbe4aa1",
  "received_portability_status": "settled",
  "event_datetime": "2022-07-24T18:29:45Z",
  "data": {}
}
```

### 4.4. Portability not settled

If the proposer does not make payment of the outstanding balance returned in the out portability response (portability attack), the proposal will be canceled for lack of payment within the deadline.

WEBHOOK_TYPE credit_transfer.received_portability
STATUS canceled_by_creditor

```json title='Webhook Body'
{
  "webhook_type": "credit_transfer.received_portability",
  "received_portability_key": "673d2872-c6c9-4075-b9ab-4525bcbe4aa1",
  "received_portability_status": "canceled_by_creditor",
  "event_datetime": "2022-07-24T18:29:45",
  "data": {
   "canceled_reason": {
    "enumerator": "not_paid",
    "description": "Decurso de prazo por STR não paga dentro do prazo"
   }
  }
}
```
## 5. Sandbox validation mocks

:::info Sandbox Environment
Use these endpoints to simulate the out portability flow in sandbox without relying on real CTC/STR events.
:::

:::danger Important Notice!
Do not use real personal data (CPF, CNPJ, etc.) in sandbox environments.
:::

### 5.1. Simulate received portability

Calling this endpoint will trigger the `credit_transfer.received_portability` webhook (described in [section 1](#1-out-portability-receipt-notification)) with data computed from the provided credit operation.

ENDPOINT /mock/credit_transfer/received_portability
METHOD POST

#### Attributes

credit_operation_key
string (UUID)
required
Key of the credit operation to port.

reference_date
string
required
Reference date for the portability (format `YYYY-MM-DD`).

ispb_number
string
required
ISPB number of the origin institution (max 8 chars).

origin_contract_type
string
optional
Type of the origin contract. Allowed values: `payroll`, `public_agency`. Default: `payroll`.

proposal_type
string
optional
Proposal type. Allowed values: `inss`. Default: `inss`.

```json title='Request Body'
{
  "credit_operation_key": "3571e292-3a83-4011-904d-20ee963022ef",
  "reference_date": "2026-04-13",
  "ispb_number": "00000000",
  "origin_contract_type": "payroll",
  "proposal_type": "inss"
}
```

```json title='Response — 202 Accepted'
{}
```

### 5.2. Simulate STR settlement

After approving the portability ([section 2.2](#22-out-portability-approval)) and receiving the `waiting_settlement` webhook ([section 4.1](#41-waiting-for-outstanding-balance-payment)), use this endpoint to simulate the settlement or payment rejection via STR. The corresponding webhook (`settled` or `canceled_by_creditor`) will be triggered according to the chosen `event_type`.

ENDPOINT /mock/credit_transfer/str
METHOD POST

#### Attributes

proposal_key
string (UUID)
required
Key of the proposal (returned in the `waiting_settlement` webhook).

event_type
string
required
Event type. Allowed values: `settlement`, `payment_rejected`.

source_branch
string
optional
Source branch code. Default: `"0001"`.

target_branch
string
optional
Target branch code. Default: `"0001"`.

provider_ispb
string
optional
Provider ISPB number. Default: `"99999999"`.

```json title='Request Body (settlement)'
{
  "proposal_key": "9ff557c3-b640-4862-b2c1-ef6f7d9a6a61",
  "event_type": "settlement",
  "source_branch": "0001",
  "target_branch": "0001",
  "provider_ispb": "99999999"
}
```

```json title='Response — 202 Accepted'
{}
```

## Annexes
---

### received_portability webhook details {#received_portability}
| Field                         | Description                          | 
|-------------------------      |------------------------------------|
|key                            |Attack key (received_portability_key)                 |
|webhook_type                   |Event type                                             |
|received_portability_status    |Attack status                                           |
|event_datetime                 |Event date                                             |
|annual_interest_rate           |Rate informed in the attack                                   |
|annual_effective_interest_rate |CET informed in the attack                                    |
|number_of_installments         |Number of installments informed in the attack                |
|installment_face_value         |Installment amount informed in the attack                       |
|phone_number                   |Phone number informed in the attack                     |
|address                        |Address informed in the attack                               |
|due_balance                    |Outstanding balance informed in the attack|
|due_balance_date               |Outstanding balance reference date informed in the attack|
|issuer_name                    |Borrower name informed in the attack|
|issuer_document_number         |Borrower document number informed in the attack|
|reference_date                 |informed in the attack|
|contract_number                |Contract number informed in the attack|
|origin_credit_operation_key    |Credit operation key (DEBT_KEY/CREDIT_OPERATION_KEY)|
|retention_limit_date           |Retention deadline|
|due_balance_limit_date         |Outstanding balance information deadline|
|portability_number             |Portability number (NU)|
|corban_document_number         |informed in the attack|
|source_ispb_number             |informed in the attack|

### authorization_term object details {#authorization_term}
| Field                       | Requirement                     | Description                          | 
|-------------------------    |-----------------                    |------------------------------------|
|received_portability_status  |Required                          |Balance release or not           |
|retention_reason             |Required in case of retention      |Retention reason, check possible enumerators in the [Retention reason](#retention_reason) table|
|document_type                |Required in case of retention      |Necessarily "received_portability_retention_proof"|
|documents                    |Required in case of retention      |Retention evidence|
|file_type                    |Required in case of retention      |Document type, check possible enumerators in the [Document type](document_type) table|
|document_key                 |Required in case of retention      |Document key returned after [upload](../upload_de_documentos)|

### Retention reason {#retention_reason}

| Enumerator                               | Description                                              |
|------------------------------------------|--------------------------------------------------------|
| **issuer_retention**                     | Client Retention                                    |
| **portability_not_requested**            | Client did not request portability                |

### Document type {#document_type}

|enumerator  |
|------------|
| **pdf**    |
| **jpeg**   |
| **jpg**    |
| **png**    |
| **mp3**    |
| **wav**    |

:::note
For retention evidence (`retention_type`), only **jpg**, **jpeg**, **png** and **pdf** formats are accepted.
:::

### Attack status {#received_portability_status}

| Enumerator                   | Description                                                |
|------------------------------|----------------------------------------------------------|
| **received**                 | Received                                                 |
| **waiting_validation**       | Waiting for Retention Proof Document validation|
| **canceled_by_proponent**    | Canceled by Proposer                                |
| **canceled_by_creditor**     | Canceled by Original Creditor                           |
| **retained**                 | Retained                                                   | 
| **waiting_settlement**       | Portability approved awaiting settlement              | 
| **settled**                  | Settled                                                |

### Attack state machine {#state-machine}

```mermaid
stateDiagram-v2
    [*] --> received
    received --> waiting_validation : PATCH "retained"
    waiting_validation --> waiting_settlement : Evidências não validadas
    waiting_validation --> retained : Evidências validadas
    received --> waiting_settlement : PATCH "accepted_by_creditor"
    waiting_settlement --> settled : Saldo pago
    waiting_settlement --> canceled_by_creditor : Saldo não pago
```

---

# QI Cartões - Pré-pago

URL: /en/documentation/manual_pre_pago/casos_uso

## Casos de Uso

:::danger Atenção!
Os webhooks da QI Tech não devem ser mapeadas de forma restrita. 
Campos adicionais podem ser incluídos aos payloads dos webhooks retornados em nossas APIs.
:::

:::info Reenvio de Webhooks
Você pode consultar e reenviar webhooks seguindo as instruções detalhadas na documentação: [Reenvio de Webhooks](/documentation/notificacoes/reenvio_de_notificacoes).
:::

---

Para facilitar o entendimento, o cliente de BaaS que irá emitir e fornece o serviço de cartões para seus clientes será tratado como "Cliente". O cliente final portador do cartão emitido será tratado com "Portador".

## 1. Autorização e confirmação completa de uma transação

Este é o caminho mais comum para as transações de cartão, o Portador passa seu cartão para uma transação de valor financeiro X e a adquirente captura exatamente este valor do emissor do cartão. O processo inicia com o Portador utilizando seu cartão em um POS. A autorização será recebida pela QI e uma autorização será solicitada ao cliente conforme descrito na [Requisição de Autorização](https://docs.qitech.com.br/documentation/cards/autorizacao/). O cliente então, faz suas validações e opta por responder a requisção informando um parecer *autorization_request_response* = authorized.

O [Objeto Autorização](https://docs.qitech.com.br/documentation/cards/search/buscar_autorizacao) pode ser detalhado [nesta](https://docs.qitech.com.br/documentation/cards/search/buscar_autorizacao) referência.

A QI irá responder a autorização para a rede de cartões e o Portador irá ter seu saldo em conta descontado do valor da transação.

Neste momento, será enviado um webhook referenciando a autorização que acaba de ser aprovada.

Webhook de autorização autorizada

```json
{
	"key": "cccbd9e9-863f-44b5-aa05-f6afa555bb74",
	"data": {
		"merchant_currency_code": "BRL",
		"merchant_amount": 25,
		"billing_currency_code": "BRL",
		"billing_amount": 25,
		"processing_datetime": "2023-07-24T12:00:00.000Z",
		"authorization_event_type": "authorization",
		"authorization": {Objeto da Autorização}
	},
	"webhook_type": "prepaid_card.authorization_event",
	"event_datetime": "2023-07-24T12:00:00.000Z"
}
```

A adquirente, após ter uma transação autorizada, realiza a captura deste valor. Essa captura é processada pela QI e um webhook de atualização de estado da autorização é enviado passando essa transação para o estado *completed*. O valor capturado pode ser consultado na variável *captured_amount* do objeto `Authorization`.

Webhook de autorização confirmada

```json
{
	"key": "cccbd9e9-863f-44b5-aa05-f6afa555bb74",
	"data": {
		"merchant_currency_code": "BRL",
		"merchant_amount": 25,
		"billing_currency_code": "BRL",
		"billing_amount": 25,
		"processing_datetime": "2023-07-24T12:00:00.000Z",
		"authorization_event_type": "capture",
		"authorization": {Objeto da Autorização}
	},
	"webhook_type": "prepaid_card.authorization_event",
	"event_datetime": "2023-07-24T12:00:00.000Z"
}
```

## 2. Autorização e confirmação a menor de uma transação

Neste caso, a adquirente captura um valor menor do que o valor estipulado na autorização. O processo inicia com o Portador utilizando seu cartão em um POS. A autorização será recebida pela QI e uma autorização será solicitada ao cliente conforme descrito na [Requisição de Autorização](https://docs.qitech.com.br/documentation/cards/autorizacao/). O cliente então, faz suas validações e opta por responder a requisição informando um parecer *autorization_request_response* = authorized.

A QI irá responder a autorização para a rede de cartões e o Portador irá ter seu saldo em conta descontado do valor da transação.

Neste momento, será enviado um webhook referenciando a autorização que acaba de ser aprovada.

Webhook de autorização autorizada

```json
{
	"key": "cccbd9e9-863f-44b5-aa05-f6afa555bb74",
	"data": {
		"merchant_currency_code": "BRL",
		"merchant_amount": 25,
		"billing_currency_code": "BRL",
		"billing_amount": 25,
		"processing_datetime": "2023-07-24T12:00:00.000Z",
		"authorization_event_type": "authorization",
		"authorization": {Objeto da Autorização}
	},
	"webhook_type": "prepaid_card.authorization_event",
	"event_datetime": "2023-07-24T12:00:00.000Z"
}
```

A adquirente, após ter uma transação autorizada, realiza a captura deste valor. Essa captura é processada pela QI e um webhook de atualização de estado da autorização é enviado passando essa autorização para o estado *completed*. O valor capturado pode ser consultado na variável *captured_amount* do objeto `Authorization`. 

Webhook de autorização confirmada a menor

```json
{
	"key": "cccbd9e9-863f-44b5-aa05-f6afa555bb74",
	"data": {
		"merchant_currency_code": "BRL",
		"merchant_amount": 23,
		"billing_currency_code": "BRL",
		"billing_amount": 23,
		"processing_datetime": "2023-07-24T12:00:00.000Z",
		"authorization_event_type": "capture",
		"authorization": {Objeto da Autorização}
	},
	"webhook_type": "prepaid_card.authorization_event",
	"event_datetime": "2023-07-24T12:00:00.000Z"
}
```

Caso a autorização expire sem ter seu valor total capturado, o excedente será creditado em conta para o Portador no valor da diferença pendente.

## 3. Autorização e confirmação a maior de uma transação

Neste caso, a adquirente captura um valor maior do que o valor estipulado na autorização. O processo inicia com o Portador utilizando seu cartão em um POS. A autorização será recebida pela QI e uma autorização será solicitada ao cliente conforme descrito na [Requisição de Autorização](https://docs.qitech.com.br/documentation/cards/autorizacao/). O cliente então, faz suas validações e opta por responder a requisção informando um parecer *autorization_request_response* = authorized.

A QI irá responder a autorização para a rede de cartões e o Portador irá ter seu saldo em conta descontado do valor da transação.

Neste momento, será enviado um webhook referenciando a transação que acaba de ser autorizada.

Webhook de autorização autorizada

```json
{
	"key": "cccbd9e9-863f-44b5-aa05-f6afa555bb74",
	"data": {
		"merchant_currency_code": "BRL",
		"merchant_amount": 25,
		"billing_currency_code": "BRL",
		"billing_amount": 25,
		"processing_datetime": "2023-07-24T12:00:00.000Z",
		"authorization_event_type": "authorization",
		"authorization": {Objeto da Autorização}
	},
	"webhook_type": "prepaid_card.authorization_event",
	"event_datetime": "2023-07-24T12:00:00.000Z"
}
```

A adquirente, após ter uma transação autorizada, realiza a captura deste valor. Essa captura é processada pela QI e um webhook de atualização de estado da autorização é enviado passando essa autorização para o estado *completed*. O valor capturado pode ser consultado na variável *captured_amount* do objeto `Authorization`. Neste caso de uso, o valor capturado será maior do que o valor original autorizado.

Webhook de autorização confirmada a maior

```json
{
	"key": "cccbd9e9-863f-44b5-aa05-f6afa555bb74",
	"data": {
		"merchant_currency_code": "BRL",
		"merchant_amount": 27,
		"billing_currency_code": "BRL",
		"billing_amount": 27,
		"processing_datetime": "2023-07-24T12:00:00.000Z",
		"authorization_event_type": "capture",
		"authorization": {Objeto da Autorização}
	},
	"webhook_type": "prepaid_card.authorization_event",
	"event_datetime": "2023-07-24T12:00:00.000Z"
}
```

Esta situação produzirá um débito em conta para o Portador no valor da diferença a maior, neste exemplo seria debitado R$ 2,00 na QI Conta do Portador. Caso não seja possível realizar esse débito em nenhuma instância a QI irá tratar particularmente esses casos junto ao cliente (Cliente de BaaS utilizando serviço de cartões da QI).

### Cancelamento parcial

Ainda nesta situação de confirmação a maior, a adquirente pode decidir corrigir o eventual engano enviano o reembolso total `refund` ou parcial `partial_refund` que serão representados na forma de eventos de autorização. Abaixo um exemplo de reembolso parcial dos R$2,00 cobrados indevidamente.

Webhook de autorização com reembolso parcial

```json
{
	"key": "cccbd9e9-863f-44b5-aa05-f6afa555bb74",
	"data": {
		"merchant_currency_code": "BRL",
		"merchant_amount": 2,
		"billing_currency_code": "BRL",
		"billing_amount": 2,
		"processing_datetime": "2023-07-24T12:00:00.000Z",
		"authorization_event_type": "partial_refund",
		"authorization": {Objeto da Autorização}
	},
	"webhook_type": "prepaid_card.authorization_event",
	"event_datetime": "2023-07-24T12:00:00.000Z"
}
```

## 4. Autorização e cancelamento de uma transação

Neste caso, a transação é autorizada mas por algum motivo o vendedor decide cancelar essa transação no POS antes que ela seja capturada. O processo inicia com o Portador utilizando seu cartão em um POS. A autorização será recebida pela QI e uma autorização será solicitada ao cliente conforme descrito na [Requisição de Autorização](https://docs.qitech.com.br/documentation/cards/autorizacao/). O cliente então, faz suas validações e opta por responder a requisção informando um parecer *approve* = true.

A QI irá responder a autorização para a rede de cartões e o Portador irá ter seu saldo em conta descontado do valor da transação.

Neste momento, será enviado um webhook referenciando a transação que acaba de ser autorizada

Webhook de transação autorizada

```json
{
	"key": "cccbd9e9-863f-44b5-aa05-f6afa555bb74",
	"data": {
		"merchant_currency_code": "BRL",
		"merchant_amount": 25,
		"billing_currency_code": "BRL",
		"billing_amount": 25,
		"processing_datetime": "2023-07-24T12:00:00.000Z",
		"authorization_event_type": "authorization",
		"authorization": {Objeto da Autorização}
	},
	"webhook_type": "prepaid_card.authorization_event",
	"event_datetime": "2023-07-24T12:00:00.000Z"
}
```

A vendedor, após ter uma transação autorizada, decide cancelar essa transação por algum motivo, um erro de digitação por exemplo. Esse mensagem de cancelamento é processada pela QI e um webhook de atualização de estado da transação é enviado passando essa transação para o estado de estornada *reversed*. Nesta situação, o valor total da autorização foi cancelado.

Webhook de autorização estornada

```json
{
	"key": "cccbd9e9-863f-44b5-aa05-f6afa555bb74",
	"data": {
		"merchant_currency_code": "BRL",
		"merchant_amount": 27,
		"billing_currency_code": "BRL",
		"billing_amount": 27,
		"processing_datetime": "2023-07-24T12:00:00.000Z",
		"authorization_event_type": "authorization_reversal",
		"authorization": {Objeto da Autorização}
	},
	"webhook_type": "prepaid_card.authorization_event",
	"event_datetime": "2023-07-24T12:00:00.000Z"
}
```

Nesta situação um crédito no valor total cancelado é feito na Qi Conta do Portador.

### Autorização expirada

Pode ocorrer que uma autorização seja aprovada, mas não seja capturada dentro dos prazos estipulados pela bandeira do cartão. Nesta situação, será enviado um webhook de autorização expirada e o um crédito no valor não capturado será feito na Qi Conta do portador.

Webhook de autorização expirada

```json
{
	"key": "cccbd9e9-863f-44b5-aa05-f6afa555bb74",
	"data": {
		"merchant_currency_code": "BRL",
		"merchant_amount": 25,
		"billing_currency_code": "BRL",
		"billing_amount": 25,
		"processing_datetime": "2023-07-24T12:00:00.000Z",
		"authorization_event_type": "authorization_expiration",
		"authorization": {Objeto da Autorização}
	},
	"webhook_type": "prepaid_card.authorization_event",
	"event_datetime": "2023-07-24T12:00:00.000Z"
}
```

---

# Private Pension Manual - Collateral Registration and Disbursement

URL: /en/documentation/manual_previdencia_privada/manual_previdencia_privada_averbacao_desembolso

:::info Navigation
- [New Credit](/documentation/manual_previdencia_privada/manual_previdencia_privada_credito_novo) (previous)
:::

:::caution API under development
The API is still in development phase, therefore, this manual is subject to changes.
:::

:::danger Attention!
QI Tech webhooks should not be mapped strictly. 
Additional fields may be included in the webhook payloads returned by our APIs.
:::

:::info Webhook Resending
You can consult and resend webhooks following the detailed instructions in the documentation: [Webhook Resending](/documentation/notificacoes/reenvio_de_notificacoes).
:::

## 1 - Collateral Registration

### Webhooks

In case of successful collateral registration, the partner will receive the following webhook:

WEBHOOK TYPE
credit_operation.collateral

STATUS
Opened

**Webhook Body**

```json
{
  "webhook": {
    "key": "<Debt Key>",
    "data": {
      "collateral_data": "collateral_data": {
            "total_gross_amount_lock": 1500,
            "investment_funds": [
                {
                    "susep_process_number": "111111111111",
                    "certificate": "12345678",   
                    "name": "QI Fund Alpha",
                    "document_number": "32402502000135",
                    "class": "",
                    "subclass": "",
                    "lock_gross_amount": 500,
                },
                {
                    "susep_process_number": "222222222222",
                    "certificate": "87654321",
                    "name": "QI Fund Beta",
                    "document_number": "32402502000135",
                    "class": "",
                    "subclass": "",
                    "lock_gross_amount": 500,
                },
                {
                    "susep_process_number": "333333333333",
                    "certificate": "56781234",  
                    "name": "QI Fund Gama",
                    "document_number": "32402502000135",
                    "class": "",
                    "subclass": "",
                    "lock_gross_amount": 500,
                }
            ]
        },
      "collateral_type": "private_pension",
      "collateral_constituted": true
    },
    "event_time": "2025-07-10 02:15:01",
    "webhook_type": "credit_operation.collateral"
  }
}
```

### Collateral Registration Failure
If a reservation fails, a webhook will be sent in the following format to inform the occurrence:

WEBHOOK TYPE
private_pension_failed_reservation

STATUS
Failed

**Webhook Body**

```json title="Webhook Body"
{
    "key": "<Debt Key>",
    "status": "failed",
    "webhook_type": "private_pension_failed_reservation",
    "event_datetime": "2025-10-26 16:41:28",
    "data": {
        "enumerator": "Fail enumerator.",
        "description": "Descrição da falha.",
    }
}
```

## 2 - Collateral Deregistration

Deregistration of a contract is performed through the permanent cancellation route. This route puts a final status
on the contract, which is not subject to retry and triggers the deregistration of the registered collateral.

To perform permanent cancellation, the following endpoint should be used:

**POST**
/debt/ DEBT-KEY /cancel_permanently

### Webhooks

WEBHOOK TYPE
debt

STATUS
canceled_permanently

**Webhook Body**

```json
{
    "key": "<Debt Key>",
    "status": "canceled_permanently",
    "webhook_type": "debt",
    "event_datetime": "2025-03-18 16:41:28",
    "data": {}
}
```

## 3 - Disbursement Failure

### TED
In case of disbursement failure via TED

WEBHOOK TYPE
debt

STATUS
canceled

**Webhook Body**

```json
 {
     "key": "<Debt Key>",
     "status": "canceled",
     "webhook_type": "debt",
     "event_datetime": "2025-03-18 16:41:28",
     "data": {
         "ted_refusal": {
             "transaction_key": "16faabfc-3876-437d-a4f6-aae17a1d68c9",
             "description": "341 0000 000000-7 12345678900 - NOME DO EMPREGADO",
             "origin": {
                 "account_key": "a1d2dea5-fa90-4676-a125-da355fdc3ed0",
                 "account_number": "00086",
                 "bank_code": "329",
                 "name": "ACCOUNT TRANSITORY",
                 "type": "payment_account",
                 "document": "32402502000135",
                 "branch_digit": null,
                 "account_digit": "8",
                 "branch": "0001"
             },
             "fee": 0,
             "reason_enumerator": "agencia_conta_invalida",
             "timestamp": "2022-11-07T14:36:05",
             "amount": 483.6,
             "reason": "Agência ou Conta Destinatária do Crédito Inválida",
             "destination": {
                 "branch": "0000",
                 "account_number": "000000",
                 "name": "NOME DO EMPREGADO",
                 "purpose": "Crédito em Conta",
                 "type": "checking_account",
                 "branch_digit": null,
                 "document": "12345678900",
                 "bank_code": "341",
                 "account_digit": "7"
             }
         },
         "cancel_reason": "ted_refusal"
     }
 }
```

### PIX
In case of disbursement failure via PIX

WEBHOOK TYPE
debt

STATUS
canceled

**Webhook Body**

```json
{
    "key": "<Debt Key>",
    "status": "canceled",
    "webhook_type": "debt",
    "event_datetime": "2025-03-18 16:41:28",
    "data": {
        "cancel_reason": "pix_refusal",
        "pix_refusal": {
            "reason_enumerator": "invalid_document_number",
            "reason": "CPF/CNPJ do usuário recebedor não é compatível com o titular da conta de destino."
        }
    }
}
```

## 4 - Payment Resubmission
Changes the disbursement date without affecting the financial values of the operation.

**POST**
/debt/ DEBT-KEY /change_disbursement_date

### Request

**Request Body**

```json
{
    "disbursement_date": "2025-03-19",
    "disbursement_bank_accounts": [
        {
            "branch_number": "1232",
            "account_digit": "4",
            "account_number": "412412412",
            "account_type": "checking_account",
            "document_number": "<CPF DO TRABALHADOR>",
            "bank_code": 184,
            "ispb_number": "17298092",
            "name": "<NOME DO TRABALHADOR>",
            "percentage_receivable": 100
        }
    ]
}
```

 
### Response

STATUS
**200** OK

**Response Body**

```json
{
    "disbursement_date": "2025-03-19",
    "disbursement_accounts": [
        {
            "account_branch": "1232",
            "account_digit": "4",
            "account_number": "412412412",
            "account_type": "checking_account",
            "amount_receivable": null,
            "created_at": "2022-05-24T14:51:46",
            "digitable_line": null,
            "disbursement_type": "ted",
            "document_number": "37197645832",
            "financial_institutions": {
                "code_number": 184,
                "ispb": 17298092,
                "name": "BCO ITAÚ BBA S.A."
            },
            "financial_institutions_code_number": 184,
            "is_pix_disbursement": false,
            "ispb": "17298092",
            "name": "Márcio e Catarina Gráfica Ltda",
            "percentage_receivable": 50.0,
            "pix_key": null,
            "pix_transfer_key": null,
            "pix_type": null,
            "qr_code_key": null,
            "retry_counter": 0,
            "retry_vector": null,
            "transaction_key": null,
            "webhook_key": null
        }
    ]
}
```

---

# Manual Previdência Privada - Consulta

URL: /en/documentation/manual_previdencia_privada/manual_previdencia_privada_consulta

:::info Próximo passo
- [Crédito Novo](/documentation/manual_previdencia_privada/manual_previdencia_privada_credito_novo)
:::

:::caution API em desenvolvimento 
A API ainda está em fase de desenvolvimento, sendo assim, este manual está sujeito a alterações.
:::

---

## 1. Consulta de garantias

A consulta de garantias permite verificar as informações referentes aos produtos de previdência. Esta operação é assíncrona, o pedido de consulta é enviado para uma de nossas filas e processado posteriormente. A requisição retorna de imediato o identificador único referente ao pedido de consulta e seu status de processamento.

### Request

**POST**
/private_pension/inquiry

**Payload**

```json
{
    "document_number": "\<CPF DO ASSINANTE\>",
    "operating_entity": "\<CNPJ ENTIDADE OPERADORA\>",
    "investment_funds": [
        {
            "susep_process_number": "",
            "certificate": "",   
            "name": "",
            "document_number": "",
            "class": "",
            "subclass": "",
        },
        {
            "susep_process_number": "",
            "certificate": "",
            "name": "",
            "document_number": "",
            "class": "",
            "subclass": "",
        },
        {
            "susep_process_number": "",
            "certificate": "",  
            "name": "",
            "document_number": "",
            "class": "",
            "subclass": "",
        },
    ],
    "authorization_term": {
        "signature": {
            "signer": {
                "name": "\<NOME DO ASSINANTE\>",
                "birth_date": "\<DATA DE NASCIMENTO DO ASSINANTE\>",
                "address": {
                    "street": "",
                    "neighborhood": "",
                    "city": "",
                    "state": "",
                    "postal_code": "",
                },
                "email": "\<EMAIL ASSINANTE\>",
                "phone": {
                    "number": "\<NUMERO ASSINANTE\>",
                    "area_code": "\<DDD ASSINANTE\>",
                    "country_code": "55"
                },
            }
        },
        "authentication_type": "opt_in",
        "authenticity": {
            "timestamp": "\<DATA E HORA DA ASSINATURA\>",
            "ip_address": "\<IP DO ASSINANTE\>",
            "city": "\<CIDADE DA ASSINATURA\>",
            "session_id": "\<ID DA SESSÃO DO ASSINANTE\>",
        },
    }
}
```

**Body Details**

| Campo              | Tipo   | Descrição                        |
|--------------------|--------|----------------------------------|
| document_number    | string | CPF do tomador                   |
| operating_entity   | string | Enumerador da entidade operadora |
| investment_funds   | objeto | Dados de fundos de investimento  |
| authorization_term | objeto | Dados de autorização             |

#### Objeto investment_funds

| Campo                 | Tipo   | Descrição                             |
|-----------------------|--------|---------------------------------------|
| susep_process_number  | string | Número do processo SUSEP              |
| certificate           | string | Certificado do produto de previdência |
| name                  | string | Nome do fundo                         |
| document_number       | string | CNPJ do fundo                         |
| class                 | string | Classe do fundo                       |
| subclass              | string | Subclasse do fundo                    |

#### Objeto authorization_term

| Campo               | Tipo   | Descrição                        |
|---------------------|--------|----------------------------------|
| signature           | objeto | Dados de assinatura              |
| authentication_type | string | Tipo de autenticação (opt_in)    |
| authenticity        | objeto | Dados de autenticidade           |

#### Objeto signature

| Campo              | Tipo   | Descrição                        |
|--------------------|--------|----------------------------------|
| signer             | objeto | Dados do assinante               |

#### Objeto signer

| Campo              | Tipo   | Descrição                        |
|--------------------|--------|----------------------------------|
| name               | string | Nome do assinante                |
| birth_date         | string | Data de nascimento do assinante  |
| address            | objeto | Endereço do assinante            |
| email              | objeto | Endereço de email do assinante   |
| phone              | objeto | Telefone do assinate             |

#### Objeto address

| Campo              | Tipo   | Descrição                        |
|--------------------|--------|----------------------------------|
| street             | string | Logradouro                       |
| neighborhood       | string | Bairro                           |
| city               | string | Cidade                           |
| state              | string | Estado                           |
| postal_code        | string | CEP                              |

#### Objeto phone

| Campo              | Tipo   | Descrição                        |
|--------------------|--------|----------------------------------|
| number             | string | Número de telefone               |
| area_code          | string | DDD                              |
| country_code       | string | Código de telefone do país       |

#### Objeto authenticity

| Campo              | Tipo   | Descrição                        |
|--------------------|--------|----------------------------------|
| timestamp          | string | Timestamp do aceite do tomador   |
| ip_address         | string | IP da sessão do usuário          |
| city               | string | Cidade de assinatura             |
| session_id         | string | Chave identificadora interna da sessão do usuário |

### Response

STATUS
**201** (CREATED)

**Payload**

```json
{
    "inquiry_key": "69aac130-35cb-4bdd-80e9-ba01d18002bd",
    "inquiry_status": "pending_inquiry"
}
```

**Response Body Details**

| Campo                     | Tipo    | Descrição                                                           |
|---------------------------|---------|---------------------------------------------------------------------|
| inquiry_key       | string  | Identificador única para a consulta da garantia                     |
| inquiry_status    | string  | Status da requisição de consulta (pending_inquiry/success/rejected) |

---

## 2. Consulta do processamento de garantias

**GET**
/private_pension/inquiry/[inquiry_key]

### Response

**Response Body**

```json
{
    "inquiry_key": "69aac130-35cb-4bdd-80e9-ba01d18002bd",
    "inquiry_status": "pending_inquiry"
}
```

---

## 3. Webhook de consulta de garantias

Após o processamento do pedido de consulta, o cliente receberá um webhook com as informações das garantias.

:::caution Atenção
O cliente deve implementar o tratamento deste webhook para capturar as informações do pedido de consulta das garantias.
:::

WEBHOOK TYPE
laas.private_pension.inquiry.status_change

STATUS
sucess

**Webhook Body**

```json
{
  "key": "69aac130-35cb-4bdd-80e9-ba01d18002bd",
  "status": "success",
  "webhook_type": "laas.private_pension.inquiry.status_change",
  "event_datetime": "2025-10-08T01:00:00Z",
  "data": {
    "guarantees": [
        {
            "contract_id": "851cf2e4-524b-48d7-a133-fd10bb0a7313",
            "product": "PGBL",
            "operation_type": "PREVIDENCIA",
            "operating_entity": {
                "document_number": "42283770000139",
                "operating_entity_name": "Icatu seguros",
                "street": "Avenida Ibirapuera",
                "neighborhood": "Moema",
                "city": "São Paulo",
                "state": "SP",
                "postal_code": "04028002",
                "authenticity": {
                    "timestamp": "\<DATA E HORA DA ASSINATURA DA ENTIDADE OPERADORA\>",
                    "city": "\<CIDADE DA ASSINATURA DA ENTIDADE OPERADORA\>",
                    "session_id": "\<ID DA SESSÃO DA ENTIDADE OPERADORA\>"
                }
            },
            "guarantor": {
                "contract_code": "48334488-ecf1-4b84-a352-b3eb57dca066",
                "person_type": "natural_person",
                "document_number": "75020251038",
                "name": "Nome garantidor",
                "social_name": "Nome social garantidor",
                "second_document_number": "126979364",
                "birth_date": "1983-12-01",
                "street": "Rua Maria Carolina",
                "neighborhood": "Jardim Paulistano",
                "city": "São Paulo",
                "state": "SP",
                "postal_code": "01445000",
                "phone": "11911111111",
                "email": "exemplo@gmail.com",
                "movement_type": "supply",
                "consent_term_code": "6bb8b263-c5ed-4406-bfd2-44f314038784",
                "consent_file_url": null,
                "consent_file_hash": null,
                "legal_representatives": [],
            },
            "plan_type": "PGBL",
            "initial_grace": true,
            "accumulation_period_end_date": "2050-01-01",
            "tax_regime": "indefinite",
            "remaining_grace_period": 15,
            "load_percentage": 99.50,
            "investment_funds": [
                {
                    "susep_process_number": "111111111111111111111111",
                    "certificate": "12345678QI",
                    "name": "Fundo QI Tech",
                    "document_number": "32402502000135",
                    "class": "Renda Fixa",
                    "subclass": "Crédito Privado",
                    "inquiry_id": "fcfb01b5-5c08-4cdb-9915-aaf16d457803",
                    "response_within_deadline": null,
                    "inquiry_processing_status": "inquiry_nuclea_register",
                    "inquiry_status": "pending",
                    "rejection_reason": null,
                    "rejection_reason_description": null,
                    "remuneration_criteria": null,
                    "available_gross_amount": 500,
                    "elegible_gross_amount": 250,
                    "lock_gross_amount": 200
                }
            ]
        },
        {
            "contract_id": "733cf2e4-908b-48d7-a222-fd10bb0a1323",
            "product": "VGBL",
            "operation_type": "PREVIDENCIA",
            "operating_entity": {
                "document_number": "42283770000139",
                "operating_entity_name": "Icatu seguros",
                "street": "Avenida Ibirapuera",
                "neighborhood": "Moema",
                "city": "São Paulo",
                "state": "SP",
                "postal_code": "04028002",
                "authenticity": {
                    "timestamp": "\<DATA E HORA DA ASSINATURA DA ENTIDADE OPERADORA\>",
                    "city": "\<CIDADE DA ASSINATURA DA ENTIDADE OPERADORA\>",
                    "session_id": "\<ID DA SESSÃO DA ENTIDADE OPERADORA\>"
                }
            },
            "guarantor": {
                "contract_code": "48334488-ecf1-4b84-a352-b3eb57dca066",
                "person_type": "natural_person",
                "document_number": "75020251038",
                "name": "Nome garantidor",
                "social_name": "Nome social garantidor",
                "second_document_number": "126979364",
                "birth_date": "1983-12-01",
                "street": "Rua Maria Carolina",
                "neighborhood": "Jardim Paulistano",
                "city": "São Paulo",
                "state": "SP",
                "postal_code": "01445000",
                "phone": "11911111111",
                "email": "exemplo@gmail.com",
                "movement_type": "supply",
                "consent_term_code": "6bb8b263-c5ed-4406-bfd2-44f314038784",
                "consent_file_url": null,
                "consent_file_hash": null,
                "legal_representatives": [],
            },
            "plan_type": "VGBL",
            "initial_grace": true,
            "accumulation_period_end_date": "2050-01-01",
            "tax_regime": "indefinite",
            "remaining_grace_period": 15,
            "load_percentage": 99.50,
            "investment_funds": [
                {
                    "susep_process_number": "222222222222222222222222",
                    "certificate": "87654321QI",
                    "name": "Fundo QI Tech",
                    "document_number": "32402502000135",
                    "class": "Renda Fixa",
                    "subclass": "Crédito Privado",
                    "inquiry_id": "fcfb01b5-5c08-4cdb-9915-aaf16d457803",
                    "response_within_deadline": null,
                    "inquiry_processing_status": "inquiry_nuclea_register",
                    "inquiry_status": "pending",
                    "rejection_reason": null,
                    "rejection_reason_description": null,
                    "remuneration_criteria": null,
                    "available_gross_amount": 500,
                    "elegible_gross_amount": 250,
                    "lock_gross_amount": 200
                }
            ]
        },
        {
            "contract_id": "733cf2e4-908b-48d7-a222-fd10bb0a1323",
            "product": "PGBL",
            "operation_type": "PREVIDENCIA",
            "operating_entity": {
                "document_number": "42283770000139",
                "operating_entity_name": "Icatu seguros",
                "street": "Avenida Ibirapuera",
                "neighborhood": "Moema",
                "city": "São Paulo",
                "state": "SP",
                "postal_code": "04028002",
                "authenticity": {
                    "timestamp": "\<DATA E HORA DA ASSINATURA DA ENTIDADE OPERADORA\>",
                    "city": "\<CIDADE DA ASSINATURA DA ENTIDADE OPERADORA\>",
                    "session_id": "\<ID DA SESSÃO DA ENTIDADE OPERADORA\>"
                }
            },
            "guarantor": {
                "contract_code": "94039572-ecf1-4h84-h929-q3eb51gea231",
                "person_type": "natural_person",
                "document_number": "75020251038",
                "name": "Nome garantidor",
                "social_name": "Nome social garantidor",
                "second_document_number": "126979364",
                "birth_date": "1983-12-01",
                "street": "Rua Maria Carolina",
                "neighborhood": "Jardim Paulistano",
                "city": "São Paulo",
                "state": "SP",
                "postal_code": "01445000",
                "phone": "11911111111",
                "email": "exemplo@gmail.com",
                "movement_type": "supply",
                "consent_term_code": "6bb8b263-c5ed-4406-bfd2-44f314038784",
                "consent_file_url": null,
                "consent_file_hash": null,
                "legal_representatives": [],
            },
            "plan_type": "PGBL",
            "initial_grace": true,
            "accumulation_period_end_date": "2050-01-01",
            "tax_regime": "indefinite",
            "remaining_grace_period": 15,
            "load_percentage": 99.50,
            "investment_funds": [
                {
                    "susep_process_number": "333333333333333333333333",
                    "certificate": "56781234QI",
                    "name": "Fundo QI Tech",
                    "document_number": "32402502000135",
                    "class": "Renda Fixa",
                    "subclass": "Crédito Privado",
                    "inquiry_id": "fcfb01b5-5c08-4cdb-9915-aaf16d457803",
                    "response_within_deadline": null,
                    "inquiry_processing_status": "inquiry_nuclea_register",
                    "inquiry_status": "pending",
                    "rejection_reason": null,
                    "rejection_reason_description": null,
                    "remuneration_criteria": null,
                    "available_gross_amount": 500,
                    "elegible_gross_amount": 250,
                    "lock_gross_amount": 200
                }
            ]
        }
    ]
  }
}
```

**Webhook Body Details**

| Campo               | Tipo   | Descrição                            |
|---------------------|--------|--------------------------------------|
| key | string | Chave do pedido de consulta          |
| status              | string | Status do documento (success)        |
| webhook_type        | string | Tipo do webhook                      |
| event_datetime      | string | Data e hora do evento                |
| data                | object | Dados do webhook                     |

#### Payload data

| Campo                        | Tipo   | Descrição                |
|------------------------------|--------|--------------------------|
| guarantees                   | objeto | Dados de garantia        |

#### Objeto guarantees

| Campo                         | Tipo   | Descrição                        |
|-------------------------------|--------|----------------------------------|
| contract_id                   | string | Código do anexo IV modelo de termo acessório ao instrumento contratual de garantia           |
| product                       | string | Denominação do produto na entidade operadora  |
| operation_type                | string | Tipo do produto (previdencia)    |
| operating_entity              | objeto | Dados da entidade operadora      |
| guarantor                     | objeto | Dados do garantidor              |
| plan_type                     | objeto | Tipo do plano de previdência     |
| initial_grace                 | bool   | Existência de período de carência inicial |
| accumulation_period_end_date  | objeto | Data final do período de acumulação |
| tax_regime                    | enum   | Regime tributário                |
| remaining_grace_period        | int    | Prazo remanescente do período de carência (em dias)           |
| load_percentage               | number | Percentual de carregamento       |
| investment_funds              | objeto | Dados de fundo de investimento   |

#### Objeto operating_entity

| Campo                 | Tipo   | Descrição                        |
|-----------------------|--------|----------------------------------|
| document_number       | string | Cnpj da entidade operadora       |
| operating_entity_name | string | Nome da entidade operadora       |
| street                | string | Logradouro                       |
| neighborhood          | string | Bairro                           |
| city                  | string | Cidade                           |
| state                 | string | Estado                           |
| postal_code           | string | CEP                              |
| authenticity          | object | Dados de autenticidade           |

#### Objeto authenticity

| Campo              | Tipo   | Descrição                                 |
|--------------------|--------|-------------------------------------------|
| timestamp          | string | Timestamp do aceite da entidade operadora |
| city               | string | Cidade de assinatura                      |
| session_id         | string | Chave identificadora interna da sessão    |

#### Objeto guarantor

| Campo                  | Tipo   | Descrição                                 |
|------------------------|--------|-------------------------------------------|
| contract_code          | string | Código contratual                         |
| person_type            | enum   | Tipo de pessoa (PF, PJ)                   |
| document_number        | string | Cpf/cnpj do garantidor                    |
| name                   | string | Nome do garantidor                        |
| social_name            | string | Nome social do garantidor                 |
| second_document_number | string | Rg do garantidor                          |
| birth_date             | string | Data de nascimento do garantidor          |
| street                 | string | Logradouro                                |
| neighborhood           | string | Bairro                                    |
| city                   | string | Cidade                                    |
| state                  | string | Estado                                    |
| postal_code            | string | CEP                                       |
| phone                  | string | Número de telefone do garantidor          |
| email                  | string | Endereço de email do garantidor           |
| movement_type          | enum   | Tipo de operação realizada                |
| consent_term_code      | string | Código do termo de consentimento          |
| consent_file_url       | object | Dados da url do arquivo de consentimento  |
| consent_file_hash      | string | Hash do arquivo de consentimento          |
| legal_representatives  | object | Representantes legais                     |

#### Objeto investment_funds

| Campo                         | Tipo   | Descrição                                      |
|-------------------------------|--------|------------------------------------------------|
| susep_process_number          | string | Número do processo SUSEP                       |
| certificate                   | string | Certificado do produto de previdência          |
| name                          | string | Nome do fundo                                  |
| document_number               | string | CNPJ do fundo                                  |
| class                         | string | Classe do fundo                                |
| subclass                      | string | Subclasse do fundo                             |
| inquiry_id                    | string | Identificador da garantia                      |
| response_within_deadline      | bool   | Resposta realizada dentro do prazo             |
| inquiry_processing_status     | enum   | Status do processamento do pedido de consulta  |
| inquiry_status                | enum   | Status do pedido                               |
| rejection_reason              | enum   | Motivo de recusa da consulta                   |
| rejection_reason_description  | string | Descrição do motivo de recusa da consulta      |
| remuneration_criteria         | string | Critério de remuneração                        |
| available_gross_amount        | number | Valor bruto disponível                         |
| elegible_gross_amount         | number | Valor bruto elegível                           |
| lock_gross_amount             | number | Valor bruto para bloquear                      |

#### Objeto consent_file_url

| Campo              | Tipo   | Descrição                                 |
|--------------------|--------|-------------------------------------------|
| url                | string | Url do arquivo de consentimento           |
| duration           | string | Duração de validade de acesso da url      |

#### Objeto legal_representatives

| Campo              | Tipo   | Descrição                                 |
|--------------------|--------|-------------------------------------------|
| person_type        | enum   | Tipo de pessoa                            |
| document_number    | string | Cpf/cnpj do representante legal           |
| name               | string | Nome do representante legal               |
| social_name        | string | Nome social do representante legal        |

#### Enumerador tax_regime

| Enumerador                | Descrição                     |
|---------------------------|-------------------------------|
| indefinite                | Regime tributário indefinido  |
| progressive               | Regime tributário progressivo |
| regressive                | Regime tributário regressivo  |

#### Enumerador person_type

| Enumerador                | Descrição                    |
|---------------------------|------------------------------|
| natural_person            | Pessoa Física                |
| legal_person              | Pessoa Jurídica              |

#### Enumerador movement_type

| Enumerador                | Descrição                          |
|---------------------------|------------------------------------|
| supply                    | Consentimento para a trava         |
| renegotiate               | Consentimento para a repactuação   |

#### Enumerador inquiry_processing_status

| Enumerador                        | Descrição                                 |
|-----------------------------------|-------------------------------------------|
| inquiry_nuclea_register           | Pedido cadastrado pela Núclea             |
| inquiry_sent_operating_entity     | Pedido recebido pela entidade operadora   |
| inquiry_returned_operating_entity | Pedido retornado pela entidade operadora  |

#### Enumerador inquiry_status

| Enumerador                | Descrição                          |
|---------------------------|------------------------------------|
| success                   | Sucesso no pedido de consulta      |
| failed                    | Falha no pedido de consulta        |
| pending                   | Pedido de consulta pendente        |

#### Enumerador rejection_reason

| Enumerador                    | Descrição                          |
|-------------------------------|------------------------------------|
| invalid_signature             | Assinatura inválida                |
| invalid_client_information    | Informações do cliente inválidas   |
| invalid_plan_information      | Informações do plano inválidas     |
| incomplete_information        | Informações incompletas            |
| others                        | Outros motivos de rejeição         |

WEBHOOK TYPE
laas.private_pension.inquiry.status_change

STATUS
failed

**Webhook Body**

```json
{
  "key": "69aac130-35cb-4bdd-80e9-ba01d18002bd",
  "status": "failed",
  "webhook_type": "laas.private_pension.inquiry.status_change",
  "event_datetime": "2025-10-08T01:00:00Z",
  "data": {
    "guarantees": [
        {
            "contract_id": "851cf2e4-524b-48d7-a133-fd10bb0a7313",
            "product": "PGBL",
            "operation_type": "PREVIDENCIA",
            "operating_entity": {
                "document_number": "42283770000139",
                "operating_entity_name": "Icatu seguros",
                "street": "Avenida Ibirapuera",
                "neighborhood": "Moema",
                "city": "São Paulo",
                "state": "SP",
                "postal_code": "04028002",
                "authenticity": {
                    "timestamp": "\<DATA E HORA DA ASSINATURA DA ENTIDADE OPERADORA\>",
                    "city": "\<CIDADE DA ASSINATURA DA ENTIDADE OPERADORA\>",
                    "session_id": "\<ID DA SESSÃO DA ENTIDADE OPERADORA\>"
                }
            },
            "guarantor": {
                "contract_code": "48334488-ecf1-4b84-a352-b3eb57dca066",
                "person_type": "natural_person",
                "document_number": "75020251038",
                "name": "Nome garantidor",
                "social_name": "Nome social garantidor",
                "second_document_number": "126979364",
                "birth_date": "1983-12-01",
                "street": "Rua Maria Carolina",
                "neighborhood": "Jardim Paulistano",
                "city": "São Paulo",
                "state": "SP",
                "postal_code": "01445000",
                "phone": "11911111111",
                "email": "exemplo@gmail.com",
                "movement_type": "supply",
                "consent_term_code": "6bb8b263-c5ed-4406-bfd2-44f314038784",
                "consent_file_url": null,
                "consent_file_hash": null,
                "legal_representatives": [],
            },
            "plan_type": "PGBL",
            "initial_grace": true,
            "accumulation_period_end_date": "2050-01-01",
            "tax_regime": "indefinite",
            "remaining_grace_period": 15,
            "load_percentage": 99.50,
            "investment_funds": [
                {
                    "susep_process_number": "111111111111111111111111",
                    "certificate": "12345678QI",
                    "name": "Fundo QI Tech",
                    "document_number": "32402502000135",
                    "class": "Renda Fixa",
                    "subclass": "Crédito Privado",
                    "inquiry_id": "fcfb01b5-5c08-4cdb-9915-aaf16d457803",
                    "response_within_deadline": null,
                    "inquiry_processing_status": "inquiry_nuclea_register",
                    "inquiry_status": "failed",
                    "rejection_reason": "invalid_plan_information",
                    "rejection_reason_description": null,
                    "remuneration_criteria": null,
                    "available_gross_amount": null,
                    "elegible_gross_amount": null,
                    "lock_gross_amount": null
                }
            ]
        },
        {
            "contract_id": "733cf2e4-908b-48d7-a222-fd10bb0a1323",
            "product": "VGBL",
            "operation_type": "PREVIDENCIA",
            "operating_entity": {
                "document_number": "42283770000139",
                "operating_entity_name": "Icatu seguros",
                "street": "Avenida Ibirapuera",
                "neighborhood": "Moema",
                "city": "São Paulo",
                "state": "SP",
                "postal_code": "04028002",
                "authenticity": {
                    "timestamp": "\<DATA E HORA DA ASSINATURA DA ENTIDADE OPERADORA\>",
                    "city": "\<CIDADE DA ASSINATURA DA ENTIDADE OPERADORA\>",
                    "session_id": "\<ID DA SESSÃO DA ENTIDADE OPERADORA\>"
                }
            },
            "guarantor": {
                "contract_code": "48334488-ecf1-4b84-a352-b3eb57dca066",
                "person_type": "natural_person",
                "document_number": "75020251038",
                "name": "Nome garantidor",
                "social_name": "Nome social garantidor",
                "second_document_number": "126979364",
                "birth_date": "1983-12-01",
                "street": "Rua Maria Carolina",
                "neighborhood": "Jardim Paulistano",
                "city": "São Paulo",
                "state": "SP",
                "postal_code": "01445000",
                "phone": "11911111111",
                "email": "exemplo@gmail.com",
                "movement_type": "supply",
                "consent_term_code": "6bb8b263-c5ed-4406-bfd2-44f314038784",
                "consent_file_url": null,
                "consent_file_hash": null,
                "legal_representatives": [],
            },
            "plan_type": "VGBL",
            "initial_grace": true,
            "accumulation_period_end_date": "2050-01-01",
            "tax_regime": "indefinite",
            "remaining_grace_period": 15,
            "load_percentage": 99.50,
            "investment_funds": [
                {
                    "susep_process_number": "222222222222222222222222",
                    "certificate": "87654321QI",
                    "name": "Fundo QI Tech",
                    "document_number": "32402502000135",
                    "class": "Renda Fixa",
                    "subclass": "Crédito Privado",
                    "inquiry_id": "fcfb01b5-5c08-4cdb-9915-aaf16d457803",
                    "response_within_deadline": null,
                    "inquiry_processing_status": "inquiry_nuclea_register",
                    "inquiry_status": "failed",
                    "rejection_reason": "others",
                    "rejection_reason_description": "O numero do processo susep nao se refere a esse produto",
                    "remuneration_criteria": null,
                    "available_gross_amount": 500,
                    "elegible_gross_amount": 250,
                    "lock_gross_amount": 200
                }
            ]
        },
        {
            "contract_id": "733cf2e4-908b-48d7-a222-fd10bb0a1323",
            "product": "PGBL",
            "operation_type": "PREVIDENCIA",
            "operating_entity": {
                "document_number": "42283770000139",
                "operating_entity_name": "Icatu seguros",
                "street": "Avenida Ibirapuera",
                "neighborhood": "Moema",
                "city": "São Paulo",
                "state": "SP",
                "postal_code": "04028002",
                "authenticity": {
                    "timestamp": "\<DATA E HORA DA ASSINATURA DA ENTIDADE OPERADORA\>",
                    "city": "\<CIDADE DA ASSINATURA DA ENTIDADE OPERADORA\>",
                    "session_id": "\<ID DA SESSÃO DA ENTIDADE OPERADORA\>"
                }
            },
            "guarantor": {
                "contract_code": "94039572-ecf1-4h84-h929-q3eb51gea231",
                "person_type": "natural_person",
                "document_number": "75020251038",
                "name": "Nome garantidor",
                "social_name": "Nome social garantidor",
                "second_document_number": "126979364",
                "birth_date": "1983-12-01",
                "street": "Rua Maria Carolina",
                "neighborhood": "Jardim Paulistano",
                "city": "São Paulo",
                "state": "SP",
                "postal_code": "01445000",
                "phone": "11911111111",
                "email": "exemplo@gmail.com",
                "movement_type": "supply",
                "consent_term_code": "6bb8b263-c5ed-4406-bfd2-44f314038784",
                "consent_file_url": null,
                "consent_file_hash": null,
                "legal_representatives": [],
            },
            "plan_type": "PGBL",
            "initial_grace": true,
            "accumulation_period_end_date": "2050-01-01",
            "tax_regime": "indefinite",
            "remaining_grace_period": 15,
            "load_percentage": 99.50,
            "investment_funds": [
                {
                    "susep_process_number": "333333333333333333333333",
                    "certificate": "56781234QI",
                    "name": "Fundo QI Tech",
                    "document_number": "32402502000135",
                    "class": "Renda Fixa",
                    "subclass": "Crédito Privado",
                    "inquiry_id": "fcfb01b5-5c08-4cdb-9915-aaf16d457803",
                    "response_within_deadline": null,
                    "inquiry_processing_status": "inquiry_nuclea_register",
                    "inquiry_status": "success",
                    "rejection_reason": null,
                    "rejection_reason_description": null,
                    "remuneration_criteria": null,
                    "available_gross_amount": 500,
                    "elegible_gross_amount": 250,
                    "lock_gross_amount": 200
                }
            ]
        }
    ]
  }
}
```

---

---

# Manual Previdência Privada - Crédito Novo

URL: /en/documentation/manual_previdencia_privada/manual_previdencia_privada_credito_novo

:::info Navegação
- [Consulta](/documentation/manual_previdencia_privada/manual_previdencia_privada_consulta) (anterior)
- [Averbação e Desembolso](/documentation/manual_previdencia_privada/manual_previdencia_privada_averbacao_desembolso) (próximo)
:::

:::caution API em desenvolvimento
A API ainda está em fase de desenvolvimento, sendo assim, este manual está sujeito a alterações.
:::

:::danger Atenção!
Os webhooks da QI Tech não devem ser mapeados de forma estrita. 
Campos adicionais podem ser incluídos aos payloads dos webhooks retornados em nossas APIs.
:::

:::info Reenvio de Webhooks
Você pode consultar e reenviar webhooks seguindo as instruções detalhadas na documentação: [Reenvio de Webhooks](/documentation/notificacoes/reenvio_de_notificacoes).
:::

## 1 - Simulação da dívida:
CRÉDITO NOVO

### Request

**POST**
/debt_simulation

**Valor de parcela**

```json title='Request Body'
{
    "borrower": {
        "person_type": "natural"
    },
    "financial": {
        "first_due_date": "2024-12-07",
        "installment_face_value": 100,
        "disbursement_date": "2024-11-05",
        "limit_days_to_disburse": 3,
        "number_of_installments": 4,
        "monthly_interest_rate": 0.018,
        "interest_type": "pre_price_days",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "principal_grace_period": 0
    },
    "collaterals": [
        {
            "collateral_type": "private_pension"
        }
    ]
}
```

**Valor desembolsado**

```json title='Request Body'
{
    "borrower": {
        "person_type": "natural"
    },
    "financial": {
        "first_due_date": "2024-12-07",
        "disbursed_amount": 1000,
        "disbursement_date": "2024-11-05",
        "limit_days_to_disburse": 3,
        "number_of_installments": 4,
        "monthly_interest_rate": 0.018,
        "interest_type": "pre_price_days",
        "fine_configuration": {
            "monthly_rate": 0.01,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.02
        },
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "principal_grace_period": 0
    },
    "collaterals": [
        {
            "collateral_type": "private_pension"
        }
    ]
}
```

:::info
Na request acima existem 2 simulações sendo realizadas. A primeira está fixando o valor de parcela ao cliente
(varia o valor desembolsado) e a segunda está fixando o valor desembolsado (varia o valor de parcela).
::: 

### Response

STATUS
**200** (OK)

**Response Body**

```json
{
    "type": "debt",
    "key": "<Debt Key>",
    "status": "finished",
    "event_datetime": "2024-11-05 16:50:00",
    "data": {
        "interest_type": "pre_price_days",
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "interest_payment_month_period": 1,
        "principal_grace_period": 0,
        "principal_amortization_month_period": 1,
        "operation_type": "structured_operation",
        "post_fixed_interest_base": "workdays",
        "post_fixed_interest_rate": null,
        "prefixed_interest_rate": {
            "interest_base": "calendar_days_365",
            "annual_rate": 0.23872053,
            "monthly_rate": 0.018,
            "daily_rate": 0.00058669
        },
        "issue_date": "2024-11-05",
        "number_of_installments": 4,
        "requester_key": "e5eb6a0a-e003-4cbd-b702-5a25bf71af0a",
        "final_disbursement_amount": 0.0,
        "disbursement_options": [
            {
                "iof_amount": 3.93,
                "total_pre_fixed_amount": 17.8715883143,
                "cet": 0.0257,
                "annual_cet": 0.355163,
                "contract_fees": [
                    {
                        "fee_type": "tac",
                        "amount_type": "percentage",
                        "amount": 0.6,
                        "fee_amount": 2.29
                    },
                    {
                        "fee_type": "ted_fee",
                        "amount_type": "absolute",
                        "amount": 1.0,
                        "fee_amount": 1.0
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "insurance_premium",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "tac",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    }
                ],
                "contract_fee_amount": 2.29,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "disbursement_date": "2024-11-05",
                "first_due_date": "2024-12-21",
                "installments": [
                    {
                        "calendar_days": 34,
                        "workdays": 23.0,
                        "business_due_date": "2024-12-21",
                        "due_date": "2024-12-21",
                        "due_principal": 382.13,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 7.6967422515,
                        "tax_amount": 0.257341482602818,
                        "total_amount": 100,
                        "principal_amortization_amount": 92.3032577485,
                        "installment_number": 1
                    },
                    {
                        "calendar_days": 29,
                        "workdays": 19.0,
                        "business_due_date": "2025-01-21",
                        "due_date": "2025-01-21",
                        "due_principal": 289.8267422515,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.9718040699,
                        "tax_amount": 0.4909156601748966,
                        "total_amount": 100,
                        "principal_amortization_amount": 95.0281959301,
                        "installment_number": 2
                    },
                    {
                        "calendar_days": 31,
                        "workdays": 23.0,
                        "business_due_date": "2025-02-21",
                        "due_date": "2025-02-21",
                        "due_principal": 194.7985463214,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5742034136,
                        "tax_amount": 0.7432500400879712,
                        "total_amount": 100,
                        "principal_amortization_amount": 96.4257965864,
                        "installment_number": 3
                    },
                    {
                        "calendar_days": 28,
                        "workdays": 18.0,
                        "business_due_date": "2025-03-21",
                        "due_date": "2025-03-21",
                        "due_principal": 98.372749735,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.6288385793,
                        "tax_amount": 0.9841050988526828,
                        "total_amount": 100,
                        "principal_amortization_amount": 98.3711614207,
                        "installment_number": 4
                    }
                ],
                "issue_amount": 382.13,
                "disbursed_issue_amount": 374.91,
                "assignment_amount": 382.13,
                "final_disbursement_amount": 374.91,
                "prefixed_interest_rate": {
                    "interest_base": "calendar_days_365",
                    "annual_rate": 0.23872053,
                    "monthly_rate": 0.018,
                    "daily_rate": 0.00058669
                }
            },
            {
                "iof_amount": 4.77,
                "total_pre_fixed_amount": 24.2597288075,
                "cet": 0.0243,
                "annual_cet": 0.334037,
                "contract_fees": [
                    {
                        "fee_type": "tac",
                        "amount_type": "percentage",
                        "amount": 0.6,
                        "fee_amount": 2.25
                    },
                    {
                        "fee_type": "ted_fee",
                        "amount_type": "absolute",
                        "amount": 1.0,
                        "fee_amount": 1.0
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "insurance_premium",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "tac",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    }
                ],
                "contract_fee_amount": 2.25,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "disbursement_date": "2024-11-06",
                "first_due_date": "2025-01-21",
                "installments": [
                    {
                        "calendar_days": 62,
                        "workdays": 41.0,
                        "business_due_date": "2025-01-21",
                        "due_date": "2025-01-21",
                        "due_principal": 375.74,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 13.9149280115,
                        "tax_amount": 0.437656505989534,
                        "total_amount": 100,
                        "principal_amortization_amount": 86.0850719885,
                        "installment_number": 1
                    },
                    {
                        "calendar_days": 31,
                        "workdays": 23.0,
                        "business_due_date": "2025-02-21",
                        "due_date": "2025-02-21",
                        "due_principal": 289.6549280115,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 5.3146959395,
                        "tax_amount": 0.722070128765373,
                        "total_amount": 100,
                        "principal_amortization_amount": 94.6853040605,
                        "installment_number": 2
                    },
                    {
                        "calendar_days": 28,
                        "workdays": 18.0,
                        "business_due_date": "2025-03-21",
                        "due_date": "2025-03-21",
                        "due_principal": 194.969623951,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.2283291407,
                        "tax_amount": 0.9601685182659746,
                        "total_amount": 100,
                        "principal_amortization_amount": 96.7716708593,
                        "installment_number": 3
                    },
                    {
                        "calendar_days": 31,
                        "workdays": 21.0,
                        "business_due_date": "2025-04-07",
                        "due_date": "2025-04-07",
                        "due_principal": 98.1979530917,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.8017757158,
                        "tax_amount": 1.2239426674782687,
                        "total_amount": 100,
                        "principal_amortization_amount": 98.1982242842,
                        "installment_number": 4
                    }
                ],
                "issue_amount": 375.74,
                "disbursed_issue_amount": 367.72,
                "assignment_amount": 375.74,
                "final_disbursement_amount": 367.72,
                "prefixed_interest_rate": {
                    "interest_base": "calendar_days_365",
                    "annual_rate": 0.23872053,
                    "monthly_rate": 0.018,
                    "daily_rate": 0.00058669
                }
            },
            {
                "iof_amount": 4.74,
                "total_pre_fixed_amount": 24.0392857898,
                "cet": 0.0243,
                "annual_cet": 0.334673,
                "contract_fees": [
                    {
                        "fee_type": "tac",
                        "amount_type": "percentage",
                        "amount": 0.6,
                        "fee_amount": 2.26
                    },
                    {
                        "fee_type": "ted_fee",
                        "amount_type": "absolute",
                        "amount": 1.0,
                        "fee_amount": 1.0
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "insurance_premium",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "tac",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    }
                ],
                "contract_fee_amount": 2.26,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "disbursement_date": "2024-11-07",
                "first_due_date": "2025-01-21",
                "installments": [
                    {
                        "calendar_days": 61,
                        "workdays": 40.0,
                        "business_due_date": "2025-01-21",
                        "due_date": "2025-01-21",
                        "due_principal": 375.96,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 13.6944849939,
                        "tax_amount": 0.4317001860605122,
                        "total_amount": 100,
                        "principal_amortization_amount": 86.3055150061,
                        "installment_number": 1
                    },
                    {
                        "calendar_days": 31,
                        "workdays": 23.0,
                        "business_due_date": "2025-02-21",
                        "due_date": "2025-02-21",
                        "due_principal": 289.6544849939,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 5.3146959395,
                        "tax_amount": 0.714305933832412,
                        "total_amount": 100,
                        "principal_amortization_amount": 94.6853040605,
                        "installment_number": 2
                    },
                    {
                        "calendar_days": 28,
                        "workdays": 18.0,
                        "business_due_date": "2025-03-21",
                        "due_date": "2025-03-21",
                        "due_principal": 194.9691809334,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.2283291407,
                        "tax_amount": 0.952233241255512,
                        "total_amount": 100,
                        "principal_amortization_amount": 96.7716708593,
                        "installment_number": 3
                    },
                    {
                        "calendar_days": 31,
                        "workdays": 21.0,
                        "business_due_date": "2025-04-07",
                        "due_date": "2025-04-07",
                        "due_principal": 98.1975100741,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.8017757157,
                        "tax_amount": 1.2158904130882027,
                        "total_amount": 100,
                        "principal_amortization_amount": 98.1982242843,
                        "installment_number": 4
                    }
                ],
                "issue_amount": 375.96,
                "disbursed_issue_amount": 367.96,
                "assignment_amount": 375.96,
                "final_disbursement_amount": 367.96,
                "prefixed_interest_rate": {
                    "interest_base": "calendar_days_365",
                    "annual_rate": 0.23872053,
                    "monthly_rate": 0.018,
                    "daily_rate": 0.00058669
                }
            },
            {
                "iof_amount": 4.71,
                "total_pre_fixed_amount": 23.8187134405,
                "cet": 0.0244,
                "annual_cet": 0.335196,
                "contract_fees": [
                    {
                        "fee_type": "tac",
                        "amount_type": "percentage",
                        "amount": 0.6,
                        "fee_amount": 2.26
                    },
                    {
                        "fee_type": "ted_fee",
                        "amount_type": "absolute",
                        "amount": 1.0,
                        "fee_amount": 1.0
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "insurance_premium",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    },
                    {
                        "fee_type": "tac",
                        "amount_type": "absolute",
                        "amount": 0.0,
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0,
                        "csll_amount": 0,
                        "irrf_amount": 0,
                        "pis_amount": 0,
                        "cofins_amount": 0,
                        "amount_released": 0,
                        "description": null
                    }
                ],
                "contract_fee_amount": 2.26,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "disbursement_date": "2024-11-08",
                "first_due_date": "2025-01-21",
                "installments": [
                    {
                        "calendar_days": 60,
                        "workdays": 39.0,
                        "business_due_date": "2025-01-21",
                        "due_date": "2025-01-21",
                        "due_principal": 376.18,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 13.4739126445,
                        "tax_amount": 0.42570834978906,
                        "total_amount": 100,
                        "principal_amortization_amount": 86.5260873555,
                        "installment_number": 1
                    },
                    {
                        "calendar_days": 31,
                        "workdays": 23.0,
                        "business_due_date": "2025-02-21",
                        "due_date": "2025-02-21",
                        "due_principal": 289.6539126445,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 5.3146959395,
                        "tax_amount": 0.706541738899451,
                        "total_amount": 100,
                        "principal_amortization_amount": 94.6853040605,
                        "installment_number": 2
                    },
                    {
                        "calendar_days": 28,
                        "workdays": 18.0,
                        "business_due_date": "2025-03-21",
                        "due_date": "2025-03-21",
                        "due_principal": 194.968608584,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.2283291407,
                        "tax_amount": 0.9442979642450494,
                        "total_amount": 100,
                        "principal_amortization_amount": 96.7716708593,
                        "installment_number": 3
                    },
                    {
                        "calendar_days": 31,
                        "workdays": 21.0,
                        "business_due_date": "2025-04-21",
                        "due_date": "2025-04-21",
                        "due_principal": 98.1969377247,
                        "has_interest": true,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.8017757158,
                        "tax_amount": 1.20783815869566,
                        "total_amount": 100,
                        "principal_amortization_amount": 98.1982242842,
                        "installment_number": 4
                    }
                ],
                "issue_amount": 376.18,
                "disbursed_issue_amount": 368.21,
                "assignment_amount": 376.18,
                "final_disbursement_amount": 368.21,
                "prefixed_interest_rate": {
                    "interest_base": "calendar_days_365",
                    "annual_rate": 0.23872053,
                    "monthly_rate": 0.018,
                    "daily_rate": 0.00058669
                }
            }
        ]
    }
}
```

---

## 2 - Emissão da operação:

CRÉDITO NOVO

### Request

**POST**
/debt

**Sem representante legal**

```json title='Request Body'
{
    "borrower": {
        "name": "Nome devedor",
        "email":"email.devedor@gmail.com",
        "phone": {
            "number": "999538380",
            "area_code": "84",
            "country_code": "055"
        },
        "is_pep": false,
        "address": {
            "city": "Natal",
            "state": "RN",
            "number": "1984",
            "street": "Rua",
            "postal_code": "59065720",
            "neighborhood": "bairro"
        },
        "birth_date": "1959-07-08",
        "person_type": "natural",
        "individual_document_number": "14471835092",
        "marital_status": "single",
        "profession": "",
        "document_identification": "494598fd-c226-4332-a500-591ae3884673",
        "document_identification_back": "a194d9a3-6790-449b-a429-f450cf904777",
        "proof_of_residence": "ec838feb-642b-4c58-81d8-f113b607da08",
    },
    "financial": {
        "interest_type": "pre_price_days",
        "first_due_date": "2023-09-21",
        "disbursement_start_date": "2024-11-07",
        "disbursement_end_date": "2024-11-07",
        "fine_configuration": {
            "monthly_rate": 0.0166,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0
        },
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "annual_interest_rate": 0.0166,
        "disbursed_amount": 1234.56,
        "issue_date": "2024-11-07",
        "number_of_installments": 10,
        "principal_grace_period": 0,
        "rebates": [ // Opcional
            {
                "amount": 20,
                "rebate_bank_account": {
                    "name": "Teste Ltda",
                    "document_number": "18533555000164",
                    "account_digit": "0",
                    "account_number": "4290001",
                    "branch_number": "0001",
                    "bank_code": "329"
                },
                "amount_type": "percentage",
                "fee_type": "spread"
            }
        ]
    },
    "simplified": true,
    "collaterals": [
        {
            "percentage": 1,
            "collateral_type": "private_pension",
            "collateral_data": {
                "total_gross_amount_lock": 1500,
                "investment_funds": [
                    {
                        "susep_process_number": "",
                        "certificate": "",
                        "operating_entity_document_number": "",
                        "plan_type": "",
                        "initial_grace": false,   
                        "grace_days": 0,   
                        "accumulation_end_date": "2050-01-01",   
                        "tax_regime": "progressive",   
                        "load_percentage": 0.0,   
                        "name": "",
                        "document_number": "",
                        "class": "",
                        "subclass": "",
                        "lock_gross_amount": 500,
                    },
                    {
                        "susep_process_number": "",
                        "certificate": "",
                        "operating_entity_document_number": "",
                        "plan_type": "",
                        "initial_grace": false,   
                        "grace_days": 0,   
                        "accumulation_end_date": "2050-01-01",   
                        "tax_regime": "progressive",   
                        "load_percentage": 0.0,   
                        "name": "",
                        "document_number": "",
                        "class": "",
                        "subclass": "",
                        "lock_gross_amount": 500,
                    },
                    {
                        "susep_process_number": "",
                        "certificate": "",
                        "operating_entity_document_number": "",
                        "plan_type": "",
                        "initial_grace": false,   
                        "grace_days": 0,   
                        "accumulation_end_date": "2050-01-01",   
                        "tax_regime": "progressive",   
                        "load_percentage": 0.0,   
                        "name": "",
                        "document_number": "",
                        "class": "",
                        "subclass": "",
                        "lock_gross_amount": 500,
                    }
                ]
            }
        }
    ],
    "purchaser_document_number": "32402502000135",
    "disbursement_bank_accounts": [
        {
            "name": "NOME DEVEDOR",
            "bank_code": "001",
            "account_digit": "0",
            "branch_number": "2874",
            "account_number": "000057555",
            "document_number": "14471835092",
            "transfer_method": "pix",
            "percentage_receivable": 100
        }
    ]
}
```

### Response

STATUS
**201** (Created)

**Response Body**

```json title="Response Body"
{
    "webhook_type": "debt",
    "key": "<Debt Key>",
    "status": "waiting_signature",
    "event_datetime": "2024-11-07 23:19:22",
    "data": {
        "borrower": {
            "name": "Nome devedor",
            "document_number": "14471835092",
            "related_party_key": "28b7fc16-6d1f-467d-9667-62a8c13daea6"
        },
        "contract": {
            "number": "TST0000644710",
            "urls": [
                "https://storage.googleapis.com/sandbox-doc-api/documents/a2e9c83a-3666-4def-8b27-e96fabb8705c/NOME_DEVEDOR-CCB-TST0000644710-20241107231916.pdf"
            ],
            "signature_information": [
                {
                    "signer_name": "Nome devedor",
                    "signer_document_number": "14471835092",
                    "signer_role": "issuer",
                    "signer_email": null,
                    "signer_external_key": null,
                    "signature_url": null
                }
            ]
        },
        "requester_identifier_key": "eb859ebe-3a41-49bf-a6c3-d6902039ec00",
        "iof_charge_method": "financed",
        "collaterals": [
            {
                "absolute_amount": null,
                "collateral_constituted": false,
                "collateral_data": {
                    "operating_entity_document_number": "",
                    "total_gross_amount_lock": 1500,
                    "investment_funds": [
                        {
                            "susep_process_number": "",
                            "certificate": "",
                            "plan_type": "", // opcional
                            "initial_grace": false,   
                            "grace_days": 0,   
                            "accumulation_end_date": "2050-01-01",   
                            "tax_regime": "progressive",   
                            "load_percentage": 0.0,   
                            "name": "",
                            "document_number": "",
                            "class": "", // opcional
                            "subclass": "", // opcional
                            "lock_gross_amount": 500,
                        },
                        {
                            "susep_process_number": "",
                            "certificate": "",
                            "plan_type": "",
                            "initial_grace": false,   
                            "grace_days": 0,   
                            "accumulation_end_date": "2050-01-01",   
                            "tax_regime": "progressive",   
                            "load_percentage": 0.0,   
                            "name": "",
                            "document_number": "",
                            "class": "",
                            "subclass": "",
                            "lock_gross_amount": 500,
                        },
                        {
                            "susep_process_number": "",
                            "certificate": "",
                            "plan_type": "",
                            "initial_grace": false,   
                            "grace_days": 0,   
                            "accumulation_end_date": "2050-01-01",   
                            "tax_regime": "progressive",   
                            "load_percentage": 0.0,   
                            "name": "",
                            "document_number": "",
                            "class": "",
                            "subclass": "",
                            "lock_gross_amount": 500,
                        }
                    ]
                },
                "collateral_key": "26c7f4f4-51f3-41fa-b880-9691211136aa",
                "collateral_type": "private_pension",
                "created_at": "2024-11-07T23:19:16.413448",
                "external_key": null,
                "percentage": 1,
                "updated_at": "2024-11-07T23:19:16.413441"
            }
        ],
        "disbursement_options": [
            {
                "disbursement_date": "2024-11-07",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.55
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.05,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 914.3,
                "issue_amount": 909.75,
                "cet": "2,0100%",
                "annual_cet": "27,0481%",
                "base_iof": 16.259002146803677,
                "additional_iof": 3.45705,
                "total_iof": 19.72,
                "total_pre_fixed_amount": 108.6508885851,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 74,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 909.75,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 37.1789024864,
                        "principal_amortization_amount": 64.6610975136,
                        "tax_amount": 0.3923635397125248,
                        "total_amount": 101.84,
                        "workdays": 49.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0889024864,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.753721435360089,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5486660915,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.9845001990781314,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2772376046,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.222548377175604,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4632222376,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.4797864582180404,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.4416948163,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.72770892770474,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.7989345071,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.999011328473856,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5716418016,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.274874127227187,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.570357168,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.570318634292211,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.3090744135,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141716,
                        "principal_amortization_amount": 100.3081858284,
                        "tax_amount": 2.8541691195612935,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            },
            {
                "disbursement_date": "2024-11-08",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.55
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.05,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 914.79,
                "issue_amount": 910.24,
                "cet": "2,0200%",
                "annual_cet": "27,0539%",
                "base_iof": 16.187351160427028,
                "additional_iof": 3.458912,
                "total_iof": 19.65,
                "total_pre_fixed_amount": 108.1583324947,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 73,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 910.24,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 36.6863463961,
                        "principal_amortization_amount": 65.1536536039,
                        "tax_amount": 0.3900097704729454,
                        "total_amount": 101.84,
                        "workdays": 48.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0863463961,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.7465431359757072,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5461100012,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.9770979419422056,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2746815143,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.21518362791551,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4606661473,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.4721586929694939,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.439138726,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.7200302213593857,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.7963784168,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.991202690472005,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5690857113,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.266920021887232,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.5678010777,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.562261209106342,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.3065183232,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141715,
                        "principal_amortization_amount": 100.3081858285,
                        "tax_amount": 2.845943848326202,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            },
            {
                "disbursement_date": "2024-11-09",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.55
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.05,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 915.28,
                "issue_amount": 910.73,
                "cet": "2,0200%",
                "annual_cet": "27,0599%",
                "base_iof": 16.115620969325082,
                "additional_iof": 3.460774,
                "total_iof": 19.58,
                "total_pre_fixed_amount": 107.6655097248,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 72,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 910.73,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 36.1935236262,
                        "principal_amortization_amount": 65.6464763738,
                        "tax_amount": 0.3875767965109152,
                        "total_amount": 101.84,
                        "workdays": 48.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0835236262,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.7393648365913253,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5432872313,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.9696956848062798,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2718587444,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.207818878655416,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4578433774,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.4645309277209473,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.4363159561,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.7123515150140312,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.7935556469,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.983394052470154,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5662629414,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.2589659165472766,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.5649783078,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.554203783920473,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.3036955533,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141715,
                        "principal_amortization_amount": 100.3081858285,
                        "tax_amount": 2.837718577088265,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            },
            {
                "disbursement_date": "2024-11-10",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.56
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.06,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 915.79,
                "issue_amount": 911.23,
                "cet": "2,0200%",
                "annual_cet": "27,0635%",
                "base_iof": 16.0438115087348,
                "additional_iof": 3.462674,
                "total_iof": 19.51,
                "total_pre_fixed_amount": 107.1724201311,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 71,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 911.23,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 35.7004340324,
                        "principal_amortization_amount": 66.1395659676,
                        "tax_amount": 0.3850645530633672,
                        "total_amount": 101.84,
                        "workdays": 48.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0904340324,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.7321865372069436,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5501976375,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.962293427670354,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2787691506,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.200454129395322,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4647537836,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.4569031624724007,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.4432263623,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.7046728086686769,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.8004660531,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.975585414468303,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5731733476,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.2510118112073214,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.571888714,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.546146358734604,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.3106059595,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141716,
                        "principal_amortization_amount": 100.3081858284,
                        "tax_amount": 2.829493305847507,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            },
            {
                "disbursement_date": "2024-11-11",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.56
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.06,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 916.28,
                "issue_amount": 911.72,
                "cet": "2,0200%",
                "annual_cet": "27,0698%",
                "base_iof": 15.971922713858204,
                "additional_iof": 3.464536,
                "total_iof": 19.44,
                "total_pre_fixed_amount": 106.6790635687,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 70,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 911.72,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 35.2070774702,
                        "principal_amortization_amount": 66.6329225298,
                        "tax_amount": 0.382472975321052,
                        "total_amount": 101.84,
                        "workdays": 47.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0870774702,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.7250082378225619,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5468410753,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.9548911705344282,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2754125884,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.193089380135228,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4613972214,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.449275397223854,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.4398698001,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.6969941023233224,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.7971094909,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.967776776466452,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5698167854,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.243057705867366,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.5685321518,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.538088933548735,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.3072493973,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141714,
                        "principal_amortization_amount": 100.3081858286,
                        "tax_amount": 2.8212680346152035,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            },
            {
                "disbursement_date": "2024-11-12",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.56
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.06,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 916.77,
                "issue_amount": 912.21,
                "cet": "2,0200%",
                "annual_cet": "27,0762%",
                "base_iof": 15.899954519820076,
                "additional_iof": 3.466398,
                "total_iof": 19.37,
                "total_pre_fixed_amount": 106.1854398936,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 69,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 912.21,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 34.7134537949,
                        "principal_amortization_amount": 67.1265462051,
                        "tax_amount": 0.3798019984284558,
                        "total_amount": 101.84,
                        "workdays": 46.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0834537949,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.71782993843818,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5432174,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.9474889133985024,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2717889131,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.185724630875134,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4577735461,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.4416476319753073,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.4362461248,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.689315395977968,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.7934858156,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.959968138464601,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5661931101,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.2351036005274114,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.5649084765,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.530031508362866,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.303625722,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141716,
                        "principal_amortization_amount": 100.3081858284,
                        "tax_amount": 2.8130427633716497,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            },
            {
                "disbursement_date": "2024-11-13",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.56
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.06,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 917.27,
                "issue_amount": 912.71,
                "cet": "2,0200%",
                "annual_cet": "27,0802%",
                "base_iof": 15.827906861727051,
                "additional_iof": 3.468298,
                "total_iof": 19.3,
                "total_pre_fixed_amount": 105.691548961,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 68,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 912.71,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 34.2195628621,
                        "principal_amortization_amount": 67.6204371379,
                        "tax_amount": 0.3770515574809304,
                        "total_amount": 101.84,
                        "workdays": 45.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0895628621,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.7106516390537982,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5493264672,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.9400866562625766,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2778979803,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.17835988161504,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4638826133,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.4340198667267607,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.442355192,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.6816366896326136,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.7995948828,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.95215950046275,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5723021773,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.227149495187456,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.5710175437,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.521974083176997,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.3097347892,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141718,
                        "principal_amortization_amount": 100.3081858282,
                        "tax_amount": 2.8048174921281284,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            },
            {
                "disbursement_date": "2024-11-14",
                "contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 4.57
                    },
                    {
                        "fee_type": "ted_fee",
                        "fee_amount": 1.5
                    }
                ],
                "external_contract_fees": [
                    {
                        "fee_type": "spread",
                        "fee_amount": 0.0,
                        "tax_amount": 0.0,
                        "net_fee_amount": 0.0
                    }
                ],
                "contract_fee_amount": 6.07,
                "external_contract_fee_amount": 0.0,
                "net_external_contract_fee_amount": 0.0,
                "assignment_amount": 917.77,
                "issue_amount": 913.2,
                "cet": "2,0200%",
                "annual_cet": "27,0870%",
                "base_iof": 15.755779674642707,
                "additional_iof": 3.47016,
                "total_iof": 19.23,
                "total_pre_fixed_amount": 105.1973906257,
                "installments": [
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-01-21",
                        "calendar_days": 67,
                        "due_date": "2025-01-21",
                        "due_interest": 0.0,
                        "due_principal": 913.2,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 1,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 33.7254045271,
                        "principal_amortization_amount": 68.1145954729,
                        "tax_amount": 0.3742215875281126,
                        "total_amount": 101.84,
                        "workdays": 44.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-02-21",
                        "calendar_days": 31,
                        "due_date": "2025-02-21",
                        "due_interest": 0.0,
                        "due_principal": 845.0854045271,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 2,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 14.2997636051,
                        "principal_amortization_amount": 87.5402363949,
                        "tax_amount": 0.7034733396694164,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-03-21",
                        "calendar_days": 28,
                        "due_date": "2025-03-21",
                        "due_interest": 0.0,
                        "due_principal": 757.5451681322,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 3,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 11.5685715131,
                        "principal_amortization_amount": 90.2714284869,
                        "tax_amount": 0.9326843991266508,
                        "total_amount": 101.84,
                        "workdays": 18.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-04-21",
                        "calendar_days": 33,
                        "due_date": "2025-04-21",
                        "due_interest": 0.0,
                        "due_principal": 667.2737396453,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 4,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 12.025984633,
                        "principal_amortization_amount": 89.814015367,
                        "tax_amount": 1.170995132354946,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-05-21",
                        "calendar_days": 28,
                        "due_date": "2025-05-21",
                        "due_interest": 0.0,
                        "due_principal": 577.4597242783,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 5,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.8184725787,
                        "principal_amortization_amount": 93.0215274213,
                        "tax_amount": 1.4263921014782142,
                        "total_amount": 101.84,
                        "workdays": 19.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-06-21",
                        "calendar_days": 31,
                        "due_date": "2025-06-21",
                        "due_interest": 0.0,
                        "due_principal": 484.438196857,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 6,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 8.1972396908,
                        "principal_amortization_amount": 93.6427603092,
                        "tax_amount": 1.6739579832872593,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-07-21",
                        "calendar_days": 31,
                        "due_date": "2025-07-21",
                        "due_interest": 0.0,
                        "due_principal": 390.7954365478,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 7,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 6.6127072945,
                        "principal_amortization_amount": 95.2272927055,
                        "tax_amount": 1.944350862460899,
                        "total_amount": 101.84,
                        "workdays": 21.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-08-21",
                        "calendar_days": 30,
                        "due_date": "2025-08-21",
                        "due_interest": 0.0,
                        "due_principal": 295.5681438423,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 8,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 4.8387153664,
                        "principal_amortization_amount": 97.0012846336,
                        "tax_amount": 2.219195389847501,
                        "total_amount": 101.84,
                        "workdays": 22.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-09-21",
                        "calendar_days": 33,
                        "due_date": "2025-09-21",
                        "due_interest": 0.0,
                        "due_principal": 198.5668592087,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 9,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 3.5787172455,
                        "principal_amortization_amount": 98.2612827545,
                        "tax_amount": 2.513916657991128,
                        "total_amount": 101.84,
                        "workdays": 23.0,
                        "installment_status": null,
                        "installment_type": null
                    },
                    {
                        "additional_costs": [],
                        "business_due_date": "2025-10-21",
                        "calendar_days": 28,
                        "due_date": "2025-10-21",
                        "due_interest": 0.0,
                        "due_principal": 100.3055764542,
                        "fine_amount": null,
                        "has_interest": true,
                        "installment_number": 10,
                        "post_fixed_amount": null,
                        "pre_fixed_amount": 1.5318141715,
                        "principal_amortization_amount": 100.3081858285,
                        "tax_amount": 2.79659222089858,
                        "total_amount": 101.84,
                        "workdays": 20.0,
                        "installment_status": null,
                        "installment_type": null
                    }
                ],
                "first_due_date": "2025-01-21",
                "prefixed_interest_rate": {
                    "monthly_rate": 0.0166,
                    "daily_rate": 0.00054142,
                    "annual_rate": 0.21843191,
                    "interest_base": "calendar_days_365"
                }
            }
        ]
    }
} 
```

### Objeto Installments

| Campo | Descrição |
|-------|-----------|
| additional_costs | Custos adicionais |
| business_due_date | Data de vencimento em dia útil |
| calendar_days | Dias corridos |
| due_date | Data de vencimento |
| due_interest | Juros do vencimento |
| due_principal | Principal do vencimento |
| fine_amount | Multa do vencimento |
| has_interest | Indica se o vencimento possui juros |
| installment_number | Número da parcela |
| installment_status | Status da parcela |
| installment_type | Tipo de parcela |
| post_fixed_amount | Valor da parcela após juros |
| pre_fixed_amount | Valor da parcela antes de juros |
| principal_amortization_amount | Valor da amortização do principal da parcela |
| tax_amount | Valor dos juros da parcela |
| total_amount | Valor total da parcela |
| workdays | Dias úteis |

### Objeto Prefixed Interest Rate

| Campo | Descrição |
|-------|-----------|
| monthly_rate | Taxa mensal |
| daily_rate | Taxa diária |
| annual_rate | Taxa anual |
| interest_base | Base de cálculo da taxa de juros |

### Webhooks

Caso a operação não seja assinada ou averbada até a última opção de data de desembolso o parceiro receberá um webhook
informando a respeito do cancelamento da operação:

WEBHOOK TYPE
debt

STATUS
Canceled

**Webhook Body**

```json title="Webhook Body"
{
    "key": "<Debt Key>",
    "status": "canceled",
    "webhook_type": "debt",
    "event_datetime": "2025-03-18 13:46:31",
    "data": {
        "cancel_reason": "<CANCEL_REASON>",
        "cancel_reason_enumerator": "<CANCEL_REASON_ENUMERATOR>"
    }
}
```

### Objeto Data

| Campo | Descrição |
|-------|-----------|
| cancel_reason | Motivo do cancelamento |
| cancel_reason_enumerator | Enumerador do motivo do cancelamento |

## Webhooks

Após a assinatura do contrato, o parceiro receberá um webhook informando a respeito da assinatura do contrato. Com o seguinte body:

```json
{
    "key": "<Debt Key>",
    "status": "signed",
    "signers": [
        {
            "id": "3271efd3-89ba-43aa-b032-af9a459e6096",
            "images": {
                "face_image_url": "https://qisign-face-images-bucket-sandbox.s3.amazonaws.com/fad7f924-d210-4ec4-9565-a57662a0a65a.jpeg",
                "document_back_url": "https://qisign-personal-documents-bucket-sandbox.s3.amazonaws.com/8c7b68ba-07ad-4188-82ae-679833b2843b.jpeg",
                "document_front_url": "https://qisign-personal-documents-bucket-sandbox.s3.amazonaws.com/f63cd291-5668-4926-be5d-9290aeda3f6e.jpeg",
                "document_back_template": "cnh_back",
                "document_front_template": "cnh_front"
            },
            "biometry": {
                "face_validation": {
                    "score": 80,
                    "provider": "qitech",
                    "available": true
                },
                "fraud_base_flag": false
            },
            "document": {
                "template": "cnh_front",
                "face_match_score": 100
            },
            "liveness": {
                "result": "live"
            },
            "signed_at": "2025-04-09T19:59:39Z",
            "ip_address": "182.224.219.198",
            "signer_data": {
                "name": "Nome Trabalhador",
                "email": "exemplo@qitech.com.br",
                "phone": {
                    "number": "829549234",
                    "area_code": "11",
                    "international_dial_code": "55"
                },
                "address": {
                    "uf": "SP",
                    "city": "Sao Paulo",
                    "number": "123",
                    "street": "Rua tal do sal",
                    "complement": "Ap 23",
                    "postal_code": "00000-000",
                    "neighborhood": "Pinheiros"
                },
                "pix_key": "pix03@pix03.com",
                "birthdate": "1996-03-13",
                "document_number": "504.856.400-66",
                "document_submission_method": "email",
                "authentication_submission_method": "sms"
            }
        }
    ],
    "webhook_type": "laas.credit_operation.status_change",
    "event_datetime": "2025-04-09 20:00:19",
    "signed_contract_url": "https://storage.googleapis.com/sandbox-doc-api/documents/9b55450e-fca5-44f2-9118-5851ed4bd92e/CCB-0000195364-2230409195718_signed.pdf"
}
```

### Objeto Signers

| Campo | Descrição |
|-------|-----------|
| id | ID do signatário |
| images | Imagens do signatário |

### Objeto Images

| Campo | Descrição |
|-------|-----------|
| face_image_url | URL da imagem da face do signatário |
| document_back_url | URL da imagem do verso do documento do signatário |
| document_front_url | URL da imagem do documento do signatário |
| document_back_template | Template do verso do documento do signatário |
| document_front_template | Template do documento do signatário |

### Objeto Biometry

| Campo | Descrição |
|-------|-----------|
| face_validation | Validação da rosto do signatário (true ou false) |
| face_validation.score | Pontuação da rosto do signatário (0 a 100) |
| face_validation.available | Disponibilidade da validação da rosto do signatário (true ou false) |
| face_validation.provider | Provedor da validação da rosto do signatário (qitech ou external) |
| fraud_base_flag | Flag de fraude base (true ou false) |

### Objeto Document

| Campo | Descrição |
|-------|-----------|
| template | Template do documento (cnh_front, cnh_back, rg_front, rg_back) |
| face_match_score | Pontuação da rosto do signatário (0 a 100) |

### Objeto Liveness

| Campo | Descrição |
|-------|-----------|
| result | Resultado da liveness (live ou spoof) |

### Objeto Signer Data

| Campo | Descrição |
|-------|-----------|
| name | Nome do signatário |
| email | Email do signatário |
| phone | Telefone do signatário |

### Objeto Address

| Campo | Descrição |
|-------|-----------|
| uf | Unidade Federativa |
| city | Cidade |
| number | Número |
| street | Rua |
| complement | Complemento |
| postal_code | CEP |
| neighborhood | Bairro |

## Enumeradores

### Status da reserva {#status-da-reserva}

ENUMERADOR
reservation_status

| Status                        | Descrição                                                                 |
| ----------------------------- | ------------------------------------------------------------------------- |
| pending_reservation           | A reserva foi criada e está pendente de averbação.                                      |
| pending_documents_submission  | A reserva já foi averbada e está pendente de envio de documentos. |
| reserved                      | A reserva foi averbada com sucesso. Fluxo de averbação concluído. |
| canceled                      | Em caso de envio de documentos inválidos, a reserva é cancelada. |
| settled                       | A reserva foi liquidada com sucesso. |
| pending_deletion              | A reserva está averbada e foi solicitada a exclusão. |
| deleted                       | A reserva foi excluída com sucesso. |

---

# Card Invoice

URL: /en/documentation/manual_qi_fatura/pix_parcelado

## Card experience with PIX in installments

---

:::caution API under development 
The API is still in the final stages of development, so this manual is subject to change.
:::

:::danger Attention!
QI Tech webhooks should not be mapped in a restrictive manner.
Additional fields may be included in the payloads of webhooks returned by our APIs.
:::

## 1. Create a Digital Wallet

In order to post items to the invoice (PIX entries backed by CCB), it is first necessary to create a digital wallet for each customer.

### Request

ENDPOINT /card_invoice/wallet
METHOD POST

Request Body

```json
{
    "owner": {
        "person_type": "natural",
        "name": "\<WALLET HOLDER'S NAME\>",
        "document_number": "\<WALLET HOLDER'S CPF\>",
        "address": {
            "street": "\<WALLET HOLDER'S STREET\>",
            "state": "\<WALLET HOLDER'S STATE\>",
            "city": "\<WALLET HOLDER'S CITY\>",
            "neighborhood": "\<WALLET HOLDER'S NEIGHBORHOOD\>",
            "number": "\<WALLET HOLDER'S NUMBER\>",
            "postal_code": "\<WALLET HOLDER'S POSTAL CODE\>",
            "complement": "\<WALLET HOLDER'S ADDRESS COMPLEMENT\>"
        },
        "phone": {
            "number": "\<WALLET HOLDER'S MOBILE NUMBER\>",
            "area_code": "\<WALLET HOLDER'S AREA CODE\>",
            "country_code": "55",
            },
        "email": "\<WALLET HOLDER'S EMAIL\>",
        "document_identification_number":"\<WALLET HOLDER'S IDENTIFICATION DOCUMENT NUMBER\>",
        "document_identification":"\<WALLET HOLDER'S IDENTIFICATION DOCUMENT KEY\>",
        "document_identification_back":"\<WALLET HOLDER'S IDENTIFICATION DOCUMENT BACK KEY\>",
        "selfie":"\<WALLET HOLDER'S SELFIE KEY\>",
        "document_identification_type": "\<WALLET HOLDER'S IDENTIFICATION DOCUMENT TYPE\>"

    },
    "invoice_configuration":{
        "closing_day": "\<INVOICE CLOSING DATE\>", 
        "due_day": "\<INVOICE DUE DATE\>", 
        "grace_months": "\<DIFFERENCE, IN MONTHS, BETWEEN closing_day AND due_day\>", 
        "issuing_and_due_day_difference": "\<DAYS BEFORE DUE DATE THAT THE INVOICE SHOULD BE ISSUED\>", 
        "invoice_payment_type": "bankslip", 
        "delay_fine_percentage": "\<LATE PAYMENT CONFIGURATION - PENALTY AMOUNT\>", 
        "delay_monthly_interest_rate": "\<LATE PAYMENT CONFIGURATION - DAILY INTEREST RATE\>"
    },
    "invoice_authorization": {
        "signature": {
            "signer": {
                "name": "\<SIGNER'S NAME\>",
                "email": "\<SIGNER'S EMAIL\>",
                "phone": {
                    "number": "\<SIGNER'S MOBILE NUMBER\>",
                    "area_code": "\<SIGNER'S AREA CODE\>",
                    "country_code": "55",
                },
                "document_number": "SIGNER'S CPF"
                },
            "authentication_type": "opt_in",
            "authenticity": {
                "timestamp": "\<SIGNATURE DATE AND TIME\>",
                "ip_address": "\<SIGNER'S IP ADDRESS\>",
                "fingerprint": {},
                "third_party_additional_data": {},
                "session_id": "\<SIGNER'S SESSION ID\>"
                },
            "signed_object": {
                "document_key": "\<DOCUMENT KEY IN QI\>"
                }
            }
        },
    "limit": "\<WALLET LIMIT VALUE\>",
    "default_monthly_interest_rate": "\<DEFAULT MONTHLY INTEREST RATE FOR THE WALLET, APPLIED TO EACH ENTRY (PIX)\>"
  }
```

### Request body details
#### Payload wallet

| Field | Type | Description | Characters |
|---|---| ---|---|
| `owner` | object  | Wallet Owner Object |**[Object owner](#object-owner)**  |
| `invoice_configuration` | object  | Invoice Configuration Object for Each Wallet |**[Object invoicer_configuration](#object-invoicer_configuration)**  |
| `invoice_authorization` | object  | Authorization Object |**[Object invoice_authorization](#object-invoice_authorization)**  |
| `limit` | number  | Wallet Limit | |
| `default_monthly_interest_rate` | number  | Default Interest Rate of the Wallet | |

#### Object owner

| Field | Type | Description | Characters |
|---| ---| ---| ---| 
| `person_type` | string | Identifier of whether the sent object is an individual or a legal entity.|  |
| `name` | string |  Corporate name in the case of legal entity operations or the person's name in the case of individual operations. | 100 |
| `document_number` | string | Person's CPF (numbers only). Limited to 11 characters. |  |
| `address` | string | Customer's Address. | **[Object adress](#object-address)** |  |
| `phone` | string | Object with phone details | **[Object phone](#object-phone)**|
| `email` | string |  Customer's Email. |  |

#### Object address 

| Field | Description | Example |  Max. Characters | 
|---|---|---|---| 
| `street` | string | Street of the address  | 100 |
| `state` | string | State of the address (with two uppercase characters) | 2 |
| `city` | string | City of the address | 100 |
| `neighborhood` | string |Neighborhood of the address | 100 |
| `number` | string | Street number | 10 |
| `postal_code` | string |Postal code of the address (http://www.buscacep.correios.com.br/sistemas/buscacep/) (numbers only) |  8 |
| `complement` | string |Address complement (free text) | 100 |

#### Object phone 

| Field | Description | Example |  Max. Characters | 
| --- | --- | --- | --- | 
|`country_code` | string | DDI code of the phone (https://ddi.guiamais.com.br/) | 3 | 
| `area_code` | string | DDD code of the phone (https://ddd.guiamais.com.br/) | 2 |
| `number` | string |Phone number (numbers only) |  10 |

#### Object invoice_configuration

| Field | Description | Example |  Max. Characters | 
| --- | --- | --- | --- | 
| `closing_day` | number |  Invoice closing day (cut-off date for registering entries in an invoice).| |
| `due_day` | number |  Invoice due date. Options: 1,5,10 | |
| `grace_months` | number |  Difference in months between the closing date and due date.| |
| `delay_fine_percentage` | number |  Late payment penalty amount, in case of invoice payment delay.| |
| `delay_monthly_interest_rate` | number |  Interest amount, per month, in case of invoice payment delay.| |
| `issuing_and_due_day_difference` | number | Number of days between invoice issuance and due date, for calculating the invoice issuance date| |
| `invoice_payment_type` | string |  Invoice payment method. Options: 'bankslip'| |

:::info INVOICE CONFIGURATION 
In the invoice configuration (invoice_configuration), fixed data such as “delay_fine_percentage”, “grace_months”, “delay_monthly_interest_rate”, “invoice_payment_type”, “issuing_and_due_day_difference” can be directly configured in the partner's initial setup in the API, simplifying the wallet creation payload. The information configured in the partner's initial setup in the API will be fixed for all customers. 
:::

:::caution 
The number of days between the invoice due date “invoice_configuration.due_day” and the closing date “invoice_configuration.closing_day” must be greater than or equal to 8 days and less than or equal to 10 days.
:::

### Response

ENDPOINT /card_invoice/wallet
METHOD POST
HTTP STATUS 201

Response Body

```json
{
    "wallet_key": "0f4581d6-f4a4-4430-b94e-5db700e4baed",
    "status": "active"
}
```

### Response body details

| Field | Type | Description | Characters |
|---|---| ---|---|
| `wallet_key` | string  |  Unique wallet identifier (uuid) | |
| `status` | string  |  Wallet status | |

## 1.1. Consult existing wallets: 

#### QUERY PARAMETERS

| Enumerator                   | Description                                                   |
|------------------------------|-------------------------------------------------------------|
| **owner_document_number**    |  Wallet holder's CPF (Individual Taxpayer Registry)                                 |
| **page**                     |  Page number of the query                               |
| **page_size**                |  Requested page size in the query                  |

### Request

ENDPOINT /card_invoice/wallets
METHOD GET

### Response

ENDPOINT /card_invoice/wallets
METHOD GET
HTTP STATUS 200

Response Body

```json
{
    "page": 1,
    "last_page": true,
    "data": [
        {
            "wallet_key": "0f4581d6-f4a4-4430-b94e-5db700e4baed",
            "owner": {
                "person_type": "natural",
                "name": "First name Last name",
                "document_number": "12345678911",
                "address": {
                    "street": "RUA DEZENOVE",
                    "state": "SP",
                    "city": "JARDINÓPOLIS",
                    "neighborhood": "JARDINS DO IMPÉRIO",
                    "number": "19",
                    "postal_code": "13348719",
                    "complement": ""
                },
                "phone": {
                            "number": "912345678",
                            "area_code": "21",
                            "country_code": "55"
                        },
                "email": "test@test.com.br"
            },
            "collaterals": [],
            "cards": [
                {"card_key":"067cba94-4d57-4a75-9766-7e5b95c87367"}
            ],
            "invoice_authorization": {
                "signature": {
                    "signer": {
                        "name": "First Name Last Name",
                        "document_number": "12345678911",
                        "email": "test@test.com.br",
                        "phone": {
                            "number": "912345678",
                            "area_code": "21",
                            "country_code": "55"
                        }
                    },
                    "authentication_type": "opt_in",
                    "authenticity": {
                        "timestamp": "2022-11-18T11:17:46",
                        "ip_address": "104.101.21.0",
                        "fingerprint": {
                            "browser": "Mozila"
                        },
                        "third_party_additional_data": {},
                        "session_id": "8df91773-c537-4662-b08b-025f03bf79dc"
                    },
                    "signed_object": {
                        "document_key": "27A0BA3D-A89D-4218-AB06-BC39B94CE23C"
                    }
                }
            },
            "interest_base": "calendar_days_365",
            "default_monthly_interest_rate": 0.035,
            "invoice_configuration": {
                "due_day": 10,
                "closing_day": 1,
                "grace_months": 1,
                "invoice_payment_type": "bankslip",
                "delay_fine_percentage": 0,
                "delay_monthly_interest_rate": 0,
                "issuing_and_due_day_difference": 9
            },
            "status": "active",
            "limit": 800,
            "current_limit": 800
}
    ]
}
```

## 1.2. Consult specific wallet: 
### Request

ENDPOINT /card_invoice/wallet/[WALLET-KEY]
METHOD GET

### Response

ENDPOINT /card_invoice/wallet/[WALLET-KEY]
METHOD GET
HTTP STATUS 200

Response Body

```json
        {
            "wallet_key": "0f4581d6-f4a4-4430-b94e-5db700e4baed",
            "owner": {
                "person_type": "natural",
                "name": "First Name Last Name",
                "document_number": "12345678911",
                "address": {
                    "street": "RUA DEZENOVE",
                    "state": "SP",
                    "city": "JARDINÓPOLIS",
                    "neighborhood": "JARDINS DO IMPÉRIO",
                    "number": "19",
                    "postal_code": "13348719",
                    "complement": ""
                },
                "phone": {
                            "number": "912345678",
                            "area_code": "21",
                            "country_code": "55"
                        },
                "email": "test@test.com.br"
            },
            "collaterals": [],
            "cards": [
                {"card_key":"067cba94-4d57-4a75-9766-7e5b95c87367"}
            ],
            "invoice_authorization": {
                "signature": {
                    "signer": {
                        "name": "First Name Last Name",
                        "document_number": "12345678911",
                        "email": "test@test.com.br",
                        "phone": {
                            "number": "912345678",
                            "area_code": "21",
                            "country_code": "55"
                        }
                    },
                    "authentication_type": "opt_in",
                    "authenticity": {
                        "timestamp": "2022-11-18T11:17:46",
                        "ip_address": "104.101.21.0",
                        "fingerprint": {
                            "browser": "Mozila"
                        },
                        "third_party_additional_data": {},
                        "session_id": "8df91773-c537-4662-b08b-025f03bf79dc"
                    },
                    "signed_object": {
                        "document_key": "27A0BA3D-A89D-4218-AB06-BC39B94CE23C"
                    }
                }
            },
            "interest_base": "calendar_days_365",
            "default_monthly_interest_rate": 0.035,
            "invoice_configuration": {
                "due_day": 10,
                "closing_day": 1,
                "grace_months": 1,
                "invoice_payment_type": "bankslip",
                "delay_fine_percentage": 0,
                "delay_monthly_interest_rate": 0,
                "issuing_and_due_day_difference": 9
            },
            "status": "active",
            "limit": 800,
            "current_limit": 800
}
```

## 1.3. Change wallet limit: 

### Request

ENDPOINT /card_invoice/wallet/[WALLET-KEY]
METHOD PATCH

Request Body

```json
{
    "limit": 123
}
```

### Response

ENDPOINT /card_invoice/wallet/[WALLET-KEY]
METHOD PATCH
HTTP STATUS 200

Response Body

```json
        {
            "wallet_key": "0f4581d6-f4a4-4430-b94e-5db700e4baed",
            "owner": {
                "person_type": "natural",
                "name": "First Name Last Name",
                "document_number": "12345678911",
                "address": {
                    "street": "RUA DEZENOVE",
                    "state": "SP",
                    "city": "JARDINÓPOLIS",
                    "neighborhood": "JARDINS DO IMPÉRIO",
                    "number": "19",
                    "postal_code": "13348719",
                    "complement": ""
                },
                "phone": {
                            "number": "912345678",
                            "area_code": "21",
                            "country_code": "55"
                        },
                "email": "test@test.com.br"
            },
            "collaterals": [],
            "invoice_authorization": {
                "signature": {
                    "signer": {
                        "name": "First Name Last Name",
                        "document_number": "12345678911",
                        "email": "test@test.com.br",
                        "phone": {
                            "number": "912345678",
                            "area_code": "21",
                            "country_code": "55"
                        }
                    },
                    "authentication_type": "opt_in",
                    "authenticity": {
                        "timestamp": "2022-11-18T11:17:46",
                        "ip_address": "104.101.21.0",
                        "fingerprint": {
                            "browser": "Mozila"
                        },
                        "third_party_additional_data": {},
                        "session_id": "8df91773-c537-4662-b08b-025f03bf79dc"
                    },
                    "signed_object": {
                        "document_key": "27A0BA3D-A89D-4218-AB06-BC39B94CE23C"
                    }
                }
            },
            "interest_base": "calendar_days_365",
            "default_monthly_interest_rate": 0.035,
            "invoice_configuration": {
                "due_day": 10,
                "closing_day": 1,
                "grace_months": 1,
                "invoice_payment_type": "bankslip",
                "delay_fine_percentage": 0,
                "delay_monthly_interest_rate": 0,
                "issuing_and_due_day_difference": 9
            },
            "status": "active",
            "limit": 123,
            "current_limit": 1000
}
```

## 2. Add cards to an existing digital wallet:
After creating the digital wallet for the customer, it is necessary to create a card linked to this wallet.

### Request

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/card
METHOD POST

Request Body

```json
{
    "settlement_method": "credit_operation"
}
```

### Request body details
#### Payload card

| Field | Type | Description | Characters |
|---|---| ---|---|
| `settlement_method` | string  |  Type of ballast. In other words, how the transactions will be backed. Options: “credit_operation” | |

### Response

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/card
METHOD POST
HTTP STATUS 201

Response Body

```json
{
    "card_key": "dabd10b6-80a8-4c9c-8a8e-e25a56668525"
}
```

### Response body details

| Field | Type | Description | Characters |
|---|---| ---|---|
| `card_key` | string  |  Unique card identifier (uuid)  | |

## 3. Simulate operation:

Simulate transactions (PIX). 
### Request

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/card/[CARD-KEY]/card_entry/simulation
METHOD POST

Request Body

```json
{
  "amount": 200,
  "number_of_installments": 4,
  "monthly_interest_rate": 0.035
}
```

:::note ATTENTION
It is not necessary to provide the "monthly_interest_rate" field; when not provided, the transaction will assume the wallet's default.
:::

### Response

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/card/[CARD-KEY]/card_entry/simulation
METHOD POST
HTTP STATUS 201

Response Body

```json
{
    "amount": 200,
    "final_amount": 221.16,
    "number_of_installments": 4,
    "monthly_interest_rate": 0.035,
    "cet": 0.03,
    "annual_cet": 0.5040,
    "total_iof": 100.44,
    "items": [
        {
            "amount": 55.29,
            "used_limit":50,
            "installment_number": 1,
            "invoice": {
                "due_date": "2023-09-10"
            }
        },
        {
            "amount": 55.29,
            "used_limit":50,
            "installment_number": 2,
            "invoice": {
                "due_date": "2023-10-10"
            }
        },
        {
            "amount": 55.29,
            "used_limit":50,
            "installment_number": 3,
            "invoice": {
                "due_date": "2023-11-10"
            }
        },
        {
            "amount": 55.29,
            "used_limit":50,
            "installment_number": 4,
            "invoice": {
                "due_date": "2023-12-10"
            }
        }
    ]
}
```

## 4. Include transactions in a card:

Include transactions (PIX). This is the stage where the CCB (Promissory Note) is generated, and it is verified whether there is available credit to complete the transaction. The settlement of the transaction is processed synchronously.

### Request

:::note ATTENTION
It is not necessary to provide the "monthly_interest_rate" field; when not provided, the transaction will assume the wallet's default.
:::

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/card/[CARD-KEY]/card_entry
METHOD POST

Request Body

```json
{
  "disbursement": {
    "method": "pix",
    "data": {
      "pix_key": "\<PIX KEY\>",
      "end_to_end_id": "\<PIX End-to-End Key\>"
    }
  },
  "description": "Purchase João's Bakery",
  "amount": 200,
  "request_control_key": "275619e6-23d1-485e-81ca-5552aa235761",
  "number_of_installments": 4,
  "monthly_interest_rate": 0.027,
  "authorization": {
    "document_number": "01975273702",
    "signature": {
      "signed_object": {
        "document_key": "6254c56e-c980-4b38-ad99-ac5ec7535d68"
      },
      "authenticity": {
        "ip_address": "192.168.0.0",
        "third_party_additional_data": {
          "hash": "23A2581A8D524035FEB2950D28727CF5 | 192.168.0.0 | 23/02/2023 17:38:45"
        },
        "timestamp": "2023-02-23T17:38:45.610458300"
      },
      "authentication_type": "opt_in",
      "signer": {
        "document_number": "01975273702",
        "phone": {
          "number": "986243444",
          "country_code": "55",
          "area_code": "21"
        },
        "name": "Master Tester",
        "email": "mail@mail.com"
      }
    }
  }
}
```

Disburse with Pix Key
```json
{
    "disbursement": {
    "method": "pix",
    "data": {
      "pix_key": "\<PIX KEY\>",
      "end_to_end_id": "\<PIX END TO END KEY\>"
    }
  }
}
```

Disburse with Pix QR Code
```json
{
    "disbursement": {
    "method": "pix_qrcode",
    "data": {
      "qr_code_url": "\<PIX URL\>",
      "end_to_end_id": "\<PIX QR Code End-to-End Key\>"
    }
  }
}
```

Disburse with Manual Pix
```json
{
    "disbursement": {
    "method": "pix_manual",
    "data": {
        "ispb": "\<BANK'S CNPJ BASE\>",
        "branch_number": "\<DISBURSEMENT ACCOUNT AGENCY\>",
        "account_number": "\<ACCOUNT NUMBER WITHOUT THE DIGIT\>",
        "account_digit": "\<DISBURSEMENT ACCOUNT DIGIT\>",
        "document_number": "\<CPF/ CNPJ OF THE ACCOUNT HOLDER\>",
        "name": "\<ACCOUNT HOLDER'S NAME\>"
    }
  }
}
```

### Response

In case of successful transaction disbursement:

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/card/[CARD-KEY]/card_entry
METHOD POST
HTTP STATUS 201

Response Body

```json
{
    "card_entry_key": "ad8e073a-2159-479b-b141-cd5d8ceb8567",
    "status": "active",
    "signed_url":"https://storage.googleapis.com/live-doc-api/documents/XXXXXXXXXXXXXXX.pdf"
}
```

:::caution ATTENTION
Due to instability from Bacen or the destination bank of the transaction, there may be a delay in the contract transaction. In this case, it will assume the status "pending_activation" and will be updated when the transaction is successfully completed or the contract is canceled. Therefore, the flow will migrate from synchronous to asynchronous and must wait for the webhook of the transaction success or failure .
:::

In case of failure in the transaction disbursement:

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/card/[CARD-KEY]/card_entry
METHOD POST
HTTP STATUS 201

Response Body

```json
{
    "card_entry_key": "ad8e073a-2159-479b-b141-cd5d8ceb8567",
    "status": "rejected",
    "cancel_reason": "pix_refusal",
    "cancel_reason_description": "Invalid Credit Recipient Agency or Account"
}
```

## 4.1 Consult a specific transaction (card entry): 
### Request

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/card/[CARD-KEY]/card_entry/[CARD-ENTRY-KEY]
METHOD GET

### Response

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/card/[CARD-KEY]/card_entry/[CARD-ENTRY-KEY]
METHOD GET
HTTP STATUS 200

Response Manual Pix Transaction

```json
{
    "transaction_key": "75b800f3-12ba-41b3-a7d5-cbb3ae2199f2",
    "end_to_end_id": "E324025022023082120064RNfdmEDTxV", 
    "transacted_at": "2023-08-21T20:07:46",
    "amount": 2242.8,
    "number_of_installments": 2,
    "monthly_interest_rate": 0.027,
    "final_amount":2250,
    "cet": 0.03,
    "annual_cet": 0.5040,
    "total_iof": 100.44,
    "description":"Purchase João's Bakery",
    "disbursement": {
        "method": "pix_manual",
        "data": {
            "ispb": 32402502,
            "branch_number": 1,
            "account_number": 15570,
            "account_digit": 1,
            "document_number": "12345678911",
            "name": "XXXXX XXXX XXXX"
        }
    },
    "card_entry_datetime": "2023-06-07T10:29:49Z",
    "signed_url":"https://storage.googleapis.com/live-doc-api/documents/XXXXXXXXXXXXXXX.pdf",
    "items": [
        {
            "item_key":"37ebad25-7eef-4a46-b497-ce46c2c04f68",
            "amount": 1125,
            "used_limit":1121.4,
            "status":"active",
            "installment_number": 1,
            "invoice": {
                "invoice_key": "b32e7eae-eaab-4402-9126-9fcf42741c24",
                "due_date": "2023-07-10",
                "status": "opened"
                },
        },
        {
            "item_key":"60e4801f-75ce-411e-aaf0-99b951c05308",
            "amount": 1125,
            "used_limit":1121.4,
            "installment_number": 2,
            "status":"active",
            "invoice": {
                "invoice_key": "2af90944-1377-447c-aa70-0efd24c17d6f",
                "due_date": "2023-08-10",
                "status": "opened"
                },
        }
	], 
    "status": "active"
}
```

Response Pix Key Transaction

```json
{
    "transaction_key": "75b800f3-12ba-41b3-a7d5-cbb3ae2199f2",
    "end_to_end_id": "E324025022023082120064RNfdmEDTxV", 
    "transacted_at": "2023-08-21T20:07:46",
    "amount": 2242.8,
    "final_amount":2250,
    "number_of_installments": 2,
    "monthly_interest_rate": 0.027,
    "cet": 0.03,
    "annual_cet": 0.5040,
    "total_iof": 100.44,
    "description":"Purchase João's Bakery",
    "disbursement": {
 		"data": {
 			"end_to_end_id": "E3240250220210928212926341670923",
 			"pix_key": "+5516983068432"
 		},
 		"method": "pix"
    },
    "card_entry_datetime": "2023-06-07T10:29:49Z",
    "signed_url":"https://storage.googleapis.com/live-doc-api/documents/XXXXXXXXXXXXXXX.pdf",
    "items": [
        {
            "item_key":"37ebad25-7eef-4a46-b497-ce46c2c04f68",
            "amount": 1125,
            "used_limit":1121.4,
            "installment_number": 1,
            "status":"active",
            "invoice": {
                "invoice_key": "b32e7eae-eaab-4402-9126-9fcf42741c24",
                "due_date": "2023-07-10",
                "status": "opened"
                },
        },
        {
            "item_key":"60e4801f-75ce-411e-aaf0-99b951c05308",
            "amount": 1125,
            "used_limit":1121.4,
            "status":"active",
            "installment_number": 2,
            "invoice": {
                "invoice_key": "2af90944-1377-447c-aa70-0efd24c17d6f",
                "due_date": "2023-08-10",
                "status": "opened"
                },
        }
	], 
    "status": "active"
}
```

Response Pix QR Code Transaction

```json
{
    "transaction_key": "75b800f3-12ba-41b3-a7d5-cbb3ae2199f2",
    "end_to_end_id": "E324025022023082120064RNfdmEDTxV", 
    "transacted_at": "2023-08-21T20:07:46",
    "amount": 2242.8,
    "final_amount":2250,
    "number_of_installments": 2,
    "monthly_interest_rate": 0.027,
    "cet": 0.03,
    "annual_cet": 0.5040,
    "total_iof": 100.44,
    "description":"Purchase João's Bakery",
    "disbursement": {
 		"method": "pix_qrcode",
        "data": {
            "qr_code_url": "00020126970014br.gov.bcb.pix2575qrcode-h.sandbox.qitech.app/bacen/cobv/a1908d67-bcc8-40cd-a63d-6b6fb510b35c5204000053039865802BR5925QI SOCIEDADE DE CREDITO D6009Sao Paulo61080145200062070503***63042184",
            "end_to_end_id": "E3240250220220822211350711639780"
        }
    },
    "card_entry_datetime": "2023-06-07T10:29:49Z",
    "signed_url":"https://storage.googleapis.com/live-doc-api/documents/XXXXXXXXXXXXXXX.pdf",
    "items": [
        {
            "item_key":"37ebad25-7eef-4a46-b497-ce46c2c04f68",
            "amount": 1125,
            "used_limit":1121.4,
            "installment_number": 1,
            "status":"active",
            "invoice": {
                "invoice_key": "b32e7eae-eaab-4402-9126-9fcf42741c24",
                "due_date": "2023-07-10",
                "status": "opened"
                },
        },
        {
            "item_key":"60e4801f-75ce-411e-aaf0-99b951c05308",
            "amount": 1125,
            "used_limit":1121.4,
            "installment_number": 2,
            "status":"active",
            "invoice": {
                "invoice_key": "2af90944-1377-447c-aa70-0efd24c17d6f",
                "due_date": "2023-08-10",
                "status": "opened"
                },
        }
	], 
    "status": "active"
}
```

#### Enumeradores Card Entry status

| Enumerators Card Entry status                   | Descrição                                            |
|------------------------------|------------------------------------------------------|
| **active**                   | Active and disbursed contract                        |
| **pending_activation**       | Contract awaiting disbursement                       |
| **canceled**                 | Cancelled contract                                   |
| **paid**                     | Settled contract                                   |

## 4.2 Generate transaction receipt:
### Request

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/card/[CARD-KEY]/card_entry/[CARD-ENTRY-KEY]/receipt
METHOD GET

### Response

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/card/[CARD-KEY]/card_entry/[CARD-ENTRY-KEY]/receipt
METHOD GET
HTTP STATUS 200

Response Body

```json
    {
        "base64_receipt": ""
    }
```

## 5. List invoices of a digital wallet:

### Request

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/invoices
METHOD GET
<div className='badge
badge--primary'>PARAMETERS page, page_size

### Response

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/invoices
METHOD GET
HTTP STATUS 200
Limit of items returned per page: 100
Response Body

```json
{
    "wallet_key": "9798d733-7f68-4929-8877-a00bfda9735e",
    "invoice_closing_day": 2,
    "invoice_due_day": 10,
    "page": "1",
	"last_page": "False",
    "invoices": [
        {
            "invoice_key": "b32e7eae-eaab-4402-9126-9fcf42741c24",
            "due_date": "2023-04-10",
            "closing_date": "2023-04-02",
            "status": "opened",
            "number_of_items": 2
        },
        {
            "invoice_key": "2af90944-1377-447c-aa70-0efd24c17d6f",
            "due_date": "2023-05-10",
            "closing_date": "2023-05-02",
            "status": "opened",
            "number_of_items": 12
        },
        {
            "invoice_key": "26e18c39-8f67-4399-9a42-8d18bc175da2",
            "due_date": "2023-04-10",
            "closing_date": "2023-04-02",
            "status": "opened",
            "number_of_items": 1
        },
        {
            "invoice_key": "6991f8e6-7b1d-4496-a08f-8a9eef263f07",
            "due_date": "2023-06-10",
            "closing_date": "2023-06-02",
            "status": "opened",
            "number_of_items": 12
        }
    ]
    
}
```

## 6. List transactions of an invoice:
### Request

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/invoice/[INVOICE-KEY]
METHOD GET

### Response

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/invoice/[INVOICE-KEY]
METHOD GET
HTTP STATUS 200

Response Body

```json
{
    "due_date": "2023-06-10",
    "closing_date": "2023-06-02",
    "status": "closed",
    "amount": 12345.67,
    "paid_amount": 0,
    "delay_interest_total_amount": 0,
    "delay_fine_total_amount": 0,
    "number_of_items": 1,
    "invoice_payments": [
        {
            "invoice_payment_key": "63a7c7a2-9e13-48cf-aea2-3b494125d14b",
            "invoice_payment_type": "bankslip",
            "charge_type": "ordinary",
            "data": {
                "digitable_line": "32990001039000000000104620768103992260000004183",
                "qr_code_url": "00020126970014br.gov.bcb.pix2575qrcode-h.sandbox.qitech.app/bacen/cobv/881979cb-1c15-4dea-a05e-316caae22f5e5204000053039865802BR5925LOTEAMENTO RESIDENCIAL PO6014PORTO NACIONAL61087750000062070503***630414B8"
            },
            "expiration": "2023-07-10",
            "status": "opened",
            "total_amount": 0,
            "paid_amount": 0,
            "chargeback_amount": 50
        }
    ],
    "items": [
        {
            "item_key": "37ebad25-7eef-4a46-b497-ce46c2c04f68",
            "amount": 12345.67,
            "used_limit": 12300,
            "status": "active",
            "card_entry": {
                "card_entry_key": "ad8e073a-2159-479b-b141-cd5d8ceb8567",
                "card_entry_datetime": "2022-11-13T10:29:49",
                "description": "Purchase João's Bakery",
                "final_amount": 12345.67,
                "number_of_installments": 2,
                "card": {
                    "card_key": "d41bd53e-eedc-4d62-97dd-26bbaefadb20"
                }
            },
            "installment_number": 1
        }
    ]
}
```

#### Enumerators Item status

| Enumerator                   | Description                                                                                   |
|------------------------------|---------------------------------------------------------------------------------------------|
| **pending_activation**       | Item awaiting activation, the item's value contributes to the invoice amount                          |
| **active**                   | Active item, the value of the item makes up the invoice value                                        |
| **canceled**                 | Item canceled, the value of the item is removed from the invoice value                               |
| **paid**                     | Item paid in the month's invoice, the value of the item makes up the invoice value                        |
| **paid_early**               | Item paid in advance, the value of the item no longer makes up the invoice value                      |

## 7. Boleto Generation:

The ordinary boleto will be generated automatically on the day the invoice is closed and can be redeemed via the invoice payment get. The query parameter “shorten_url” is a flag to request a shortened boleto URL.

:::caution ATTENTION
The boleto can be paid within 30 days of the invoice due date.
:::

:::danger ATTENTION
URL shortening is limited to 60 requests per minute.
:::

### Request

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/invoice/[INVOICE-KEY]/invoice_payment/[INVOICE-PAYMENT-KEY]
METHOD GET
<div className='badge
badge--primary'>PARAMETER shorten_url

### Response

#### Parameter shorten_url=False

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/invoice/[INVOICE-KEY]/invoice_payment/[INVOICE-PAYMENT-KEY]?shorten_url=False
METHOD GET
HTTP STATUS 200

Response Body

```json
    {
        "invoice_payment_key": "63a7c7a2-9e13-48cf-aea2-3b494125d14b",
        "invoice_payment_type": "bankslip",
        "charge_type": "ordinary",
        "data": {
            "bank_slip_key": "dc4a27db-2fe1-474d-aa02-88d6fffb8d0d",
            "digitable_line": 32990001039000000000104620768103992260000004183,
            "qr_code_url": "00020126970014br.gov.bcb.pix2575qrcode-h.sandbox.qitech.app/bacen/cobv/881979cb-1c15-4dea-a05e-316caae22f5e5204000053039865802BR5925LOTEAMENTO RESIDENCIAL PO6014PORTO NACIONAL61087750000062070503***630414B8",
            "bank_slip_url": "\<URL BOLETO IN PDF\>"
        },
        "expiration": "2023-07-10",
        "status": "issued",
        "total_amount": 0,
        "paid_amount": 0,
        "chargeback_amount": 50,
    }
```

#### Parameter shorten_url=True

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/invoice/[INVOICE-KEY]/invoice_payment/[INVOICE-PAYMENT-KEY]?shorten_url=True
METHOD GET
HTTP STATUS 200

Response Body

```json
    {
        "invoice_payment_key": "63a7c7a2-9e13-48cf-aea2-3b494125d14b",
        "invoice_payment_type": "bankslip",
        "charge_type": "ordinary",
        "data": {
            "bank_slip_key": "dc4a27db-2fe1-474d-aa02-88d6fffb8d0d",
            "digitable_line": 32990001039000000000104620768103992260000004183,
            "qr_code_url": "00020126970014br.gov.bcb.pix2575qrcode-h.sandbox.qitech.app/bacen/cobv/881979cb-1c15-4dea-a05e-316caae22f5e5204000053039865802BR5925LOTEAMENTO RESIDENCIAL PO6014PORTO NACIONAL61087750000062070503***630414B8",
            "bank_slip_url": "\<URL BOLETO IN PDF\>",
            "short_bank_slip_url": "\<SHORTENED BOLETO PDF URL\>"
        },
        "expiration": "2023-07-10",
        "status": "issued",
        "total_amount": 0,
        "paid_amount": 0
    }
```

## 7.1 Generation of extraordinary advance payment slips:

### Request

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/invoice/[INVOICE-KEY]/invoice_payment
METHOD POST

Request Body

```json
{
    "invoice_payment_type": "bankslip",
    "charge_type": "early",
    "expiration": "2023-08-15",
    "invoice_items": [
	    "key_1",
	    "key_2"
    ]
}
```

:::note ATTENTION
Condition: “expiration” must be two working days less than the invoice closing date to ensure that payment will not interfere
in this routine.
:::

### Response

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/invoice/[INVOICE-KEY]/invoice_payment
METHOD POST
HTTP STATUS 200

Response Body

```json
     {
        "invoice_payment_key": "63a7c7a2-9e13-48cf-aea2-3b494125d14b",
        "invoice_payment_type": "bankslip",
        "charge_type": "early",
        "data": {
            "digitable_line": 32990001039000000000104620768103992260000004183,
            "qr_code_url": "00020126970014br.gov.bcb.pix2575qrcode-h.sandbox.qitech.app/bacen/cobv/881979cb-1c15-4dea-a05e-316caae22f5e5204000053039865802BR5925LOTEAMENTO RESIDENCIAL PO6014PORTO NACIONAL61087750000062070503***630414B8",
        },
        "expiration": "2023-08-15",
        "status": "issued",
        "total_amount": 200,
        "paid_amount": 0
 }
```

## 7.2 Simulation of extraordinary overdue boleto:

:::caution ATTENTION
The simulation can only be requested after the payment deadline for the regular boleto has passed.
:::

### Request

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/invoice/[INVOICE-KEY]/invoice_payment/simulation
METHOD POST

Request Body

```json
    {
        "invoice_payment_type": "bankslip",
        "charge_type": "delay",
        "expiration": "2023-08-15"
    }
```

### Request com desconto

Request Body

```json
    {
        "invoice_payment_type": "bankslip",
        "charge_type": "delay",
        "expiration": "2023-08-15",
        "discount_amount": 50
    }
```

### Response

Response Body

```json
    {
        "invoice_payment_type": "bankslip",
        "charge_type": "delay",
        "total_amount": 150,
        "discount_amount": 50
    }
```

## 7.3 Extraordinary overdue payment slip generation:

:::caution ATTENTION
The late payment slip can only be generated after the payment deadline for the regular slip has passed.
:::

### Request

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/invoice/[INVOICE-KEY]/invoice_payment
METHOD POST

Request Body

```json
    {
        "invoice_payment_type": "bankslip",
        "charge_type": "delay",
        "expiration": "2023-08-15"
    }
```

### Request with discount

Request Body

```json
    {
        "invoice_payment_type": "bankslip",
        "charge_type": "delay",
        "expiration": "2023-08-15",
        "discount_amount": 50
    }
```

### Response

Response Body

```json
    {
        "invoice_payment_key": "63a7c7a2-9e13-48cf-aea2-3b494125d14b",
        "invoice_payment_type": "bankslip",
        "charge_type": "delay",
        "data": {
            "digitable_line": 32990001039000000000104620768103992260000004183,
            "qr_code_url": "00020126970014br.gov.bcb.pix2575qrcode-h.sandbox.qitech.app/bacen/cobv/881979cb-1c15-4dea-a05e-316caae22f5e5204000053039865802BR5925LOTEAMENTO RESIDENCIAL PO6014PORTO NACIONAL61087750000062070503***630414B8",
        },
        "expiration": "2023-07-10",
        "status": "issued",
        "total_amount": 0,
        "paid_amount": 0,
        "discount_amount": 50
    }
```

## 7.4 Cancellation of invoice payment slip

### Request

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/invoice/[INVOICE-KEY]/invoice_payment/[INVOICE-PAYMENT-KEY]
METHOD DELETE

### Response

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/invoice/[INVOICE-KEY]/invoice_payment/[INVOICE-PAYMENT-KEY]
METHOD DELETE
HTTP STATUS 204

Response Body

```json
    {}
```

## 8. Chargeback:

## 8.1. Consult Chargebacks:

### Request

ENDPOINT
        /card_invoice/wallet/[WALLET-KEY]/chargebacks
MÉTODO
        GET

#### PATH PARAMETERS

| Enumerator                  | Description                                                   |
|------------------------------|-------------------------------------------------------------|
| **status**                   | Chargeback status('active'/'used'/'pending_payment')        |

### Response

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/chargebacks
METHOD GET
HTTP STATUS 200

Response Body

```json
    {
        "page": 1,
        "last_page": true,
        "data": [
            {
                "charge_back_key": "key",
                "amount": 100,
                "used_amount": 0,
                "status": "active",
                "reference_card_entry_key": "key",
                "reference_item_key": "key"
            }
        ]
    }

```

## 9. Webhooks:

## 9.1. Change of invoice status:
### Webhook

WEBHOOK_TYPE card_invoice.invoice.status_change
STATUS opened

Webhook Body

```json
{
	"webhook_type": "card_invoice.invoice.status_change",
	"key": "\<INVOICE-KEY\>",
	"event_datetime": "\<DATA E HORA DO ENVIO DO WEBHOOK\>",
	"status": "opened",
    "data": {
        "wallet_key":"\<WALLET KEY\>",
        "due_date": "2023-07-10",
        "closing_date": "2023-07-02"
    }
}
```

:::note ATTENTION
The content of the “date” field remains the same for all statuses
:::

#### Enumerators Invoice status

| Enumerator                   | Description                                            |
|------------------------------|------------------------------------------------------|
| **opened**                   | Open invoice                                        |
| **closed**                   | Invoice closed                                       |
| **paid**                     | Invoice paid on due date             |
| **paid_overdue**             | Invoice paid late                                |

## 9.2. Change of transaction status:
### Webhook

WEBHOOK_TYPE card_invoice.card_entry.status_change
STATUS active

Webhook Body

```json
{
	"webhook_type": "card_invoice.card_entry.status_change",
	"key": "\<CARD-ENTRY-KEY\>",
	"event_datetime": "\<DATE AND TIME THE WEBHOOK WAS SENT\>",
	"status": "active",
    "data": {
        "wallet_key":"\<WALLET KEY\>"
    }
}
```

#### Enumeradores Card Entry status

| Enumerator                   | Description                                            |
|------------------------------|------------------------------------------------------|
| **active**                   | Contract active and disbursed                        |
| **canceled**                 | Contract canceled                                   |

:::caution ATTENTION
This webhook will only be sent when the transaction is in “pending_activation” status
:::

## 9.3. Bill of exchange creation after invoice closing:
### Webhook

WEBHOOK_TYPE card_invoice.invoice_payment.status_change
STATUS issued

Webhook Body

```json
{
	"webhook_type": "card_invoice.invoice_payment.status_change",
	"key": "\<INVOICE-PAYMENT-KEY\>",
	"event_datetime": "\<DATE AND TIME THE WEBHOOK WAS SENT\>",
	"status": "issued",
    "data": {
        "charge_type": "ordinary",
        "wallet_key":"\<WALLET KEY\>",
        "invoice_key":"\<INVOICE KEY\>",
        "digitable_line":"\<BOLETO DIGITISABLE LINE\>",
        "qr_code_url":"\<BOLETO QR CODE URL\>"
    }
}
```

#### Enumerators Charge type

| Enumerator                   | Description                                           |
|------------------------------|------------------------------------------------------|
| **ordinary**                 | Ordinary payment                                  |
| **early**                    | Extraordinary advance payment             |
| **delay**                    | Extraordinary late payment                   |

## 9.4. Change of invoice payment status:
### Webhook

WEBHOOK_TYPE card_invoice.invoice_payment.status_change
STATUS paid

Webhook Body

```json
{
	"webhook_type": "card_invoice.invoice_payment.status_change",
	"key": "\<INVOICE-PAYMENT-KEY\>",
	"event_datetime": "\<DATE AND TIME THE WEBHOOK WAS SENT\>",
	"status": "paid",
    "data": {
        "wallet_key":"\<WALLET KEY\>",
        "charge_type": "ordinary",
        "invoice_key":"\<INVOICE KEY\>",
        "paid_amount": 150.0
    }
}
```

#### Enumerators Invoice Payment status

| Enumerator                   | Description                                          |
|------------------------------|------------------------------------------------------|
| **issued**                   | Issuing the invoice for payment           |
| **paid**                     | Boleto paid                                          |
| **canceled**                 | Payment of canceled boleto                        |

## 9.5. Change of chargeback status:

### Webhook

WEBHOOK_TYPE card_invoice.chargeback.status_change
STATUS active

Webhook Body

```json
{
	"webhook_type": "card_invoice.chargeback.status_change",
	"key": "\<CHARGEBACK-KEY\>",
	"event_datetime": "\<DATE AND TIME THE WEBHOOK WAS SENT\>",
	"status": "active",
    "data": {
        "wallet_key":"\<WALLET KEY\>",
        "chargeback_amount":150.00,
        "reference_card_entry_key":"\<KEY OF THE REVERSAL REFERENCE TRANSACTION\>",
        "reference_item_key" :"\<KEY OF THE REVERSAL REFERENCE ITEM\>"
    }
}
```

#### Reversal status enumerators

| Enumerator                   | Description                                                  |
|------------------------------|-------------------------------------------------------------|
| **active**                   | Active reversal to be used in an invoice payment  |
| **used**                     | Reversal already used to pay an invoice             |
| **pending_payment**          | Chargeback awaiting payment to be activated               |

:::caution Status 'pending_payment' 
The pending_payment status represents the reversal of an item that belongs to a closed invoice that has not yet been paid; the reversal amount can only be used once the invoice has been paid.
:::

## 9.6.1 Rejection of transaction renegotiation:
### Webhook

WEBHOOK_TYPE card_invoice.card_entry_renegotiation.status_change
STATUS rejected

Webhook Body

```json
{
    "webhook_type": "card_invoice.renegotiation.status_change",
    "key": "\\<RENEGOTIATION-KEY\\>",
    "event_datetime": "\\<DATE AND TIME THE WEBHOOK WAS SENT\\>",
    "status": "rejected",
    "data": {
        "wallet_key": "\\<WALLET KEY\\>"
    }
}

```

## 9.6.2 Transaction renegotiation payment:
### Webhook

WEBHOOK_TYPE card_invoice.renegotiation.status_change
STATUS paid

Webhook Body

```json
{
    "webhook_type": "card_invoice.renegotiation.status_change",
    "key": "\\<RENEGOTIATION-KEY\\>",
    "event_datetime": "\\<DATE AND TIME THE WEBHOOK WAS SENT\\>",
    "status": "paid",
    "data": {
        "wallet_key": "\\<WALLET KEY\\>",
        "paid_method_type": "<PAYMENT METHOD>",
        "paid_in": {
            "code_number": "<CODE OF THE LIQUIDATING BANK>", 
            "ispb": "<ISPB OF THE LIQUIDATING BANK>", 
            "name": "<NAME OF THE LIQUIDATING BANK>"
        }
    }
}
```

#### Enumerators renegotiation status

| Enumerator                   | Description                                                                                                         |
|------------------------------|--------------------------------------------------------------------------------------------------------------------|
| **pending_payment**          | Renegotiation of advance payment awaiting payment                                                     |
| **paid**                     | Renegotiation of advance payment paid                                                                     |
| **canceled**                 | Renegotiation of advance payment canceled                                                                |
| **rejected**                 | Advance payment renegotiation rejected due to payment of installment outside the renegotiation or expiry of deadline              |

## 10. Cancellation of purchase within 7 days:

## 10.1. Request to cancel a purchase:

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/card/[CARD-KEY]/card_entry/[CARD-ENTRY-KEY]/reversal
METHOD POST

### Request

Request Body

```json
{}
```

### Response

Response Body

```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"
    }
```

## 10.2. Active purchase cancellation inquiry:

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/card/[CARD-KEY]/card_entry/[CARD-ENTRY-KEY]/reversal
METHOD GET

### Response

Response Body

```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"
    }
```

## 11. Renegotiation of purchases:

## 11.1. Simulate renegotiation of purchases:

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/renegotiation/simulation
METHOD POST

### Request

Request Body

```json
{
    "reference_date": "2024-07-20",
    "card_entries": [
        {
            "card_entry_key": "817dced9-3216-410b-a51c-645019ab320b",
            "items": [
                {
                    "item_key": "04318ab7-7b3c-4558-ad7b-4e9e2d9e0e6e"
                }
            ]
        },
        {
            "card_entry_key": "3a3d8bbb-be30-41b0-b5be-8d358dc059ea"
        }
    ]
}
```

### Request body details

| Field | Type | Description | Characters |
|---| ---| ---| ---| 
| `reference_date` | string | Renegotiation reference date.|  |

### Response

Response Body

```json
    {
    "renegotiation_payment_amount": 350,
    "reference_date": "2022-07-20",
    "discount_percentage": 0,
    "discount_amount": 0,
    "card_entries": [
        {
            "card_entry_key": "817dced9-3216-410b-a51c-645019ab320b",
            "payment_amount": 125,
            "discount_amount": 0,
            "affected_items": [
                {
                    "item_key": "04318ab7-7b3c-4558-ad7b-4e9e2d9e0e6e",
                    "due_date": "2022-07-15",
                    "principal_amount": 100,
                    "interest_amount": 20,
                    "fine_amount": 5,
                    "total_amount": 125,
                    "present_amount": 100
                }
            ]
        },
        {
            "card_entry_key": "3a3d8bbb-be30-41b0-b5be-8d358dc059ea",
            "payment_amount": 225,
            "discount_amount": 0,
            "affected_items": [
                {
                    "item_key": "1249249c-95b5-45aa-81f1-967abf5e6eef",
                    "due_date": "2022-07-15",
                    "principal_amount": 100,
                    "interest_amount": 20,
                    "fine_amount": 5,
                    "total_amount": 125,
                    "present_amount": 100
                },
                {
                    "item_key": "c66dad81-ecb4-4afa-8713-a85ee8e721ec",
                    "due_date": "2022-08-15",
                    "principal_amount": 100,
                    "interest_amount": 20,
                    "fine_amount": 5,
                    "total_amount": 100,
                    "present_amount": 120
                }
            ]
        }
    ]
}
```

## 11.2. Create a purchase renegotiation:

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/renegotiation
METHOD POST

:::caution Object 'items' 
When the “items” object is not entered, all available items in the transaction will be considered to be included in the renegotiation, i.e. items with a status other than “active” will be ignored. 

In addition, if any item is part of an active invoice slip, the slip must be canceled before proceeding with the renegotiation.
:::

### Request

Request Body

```json
{
    "reference_date": "2024-07-20",
    "proposal_due_date": "2024-07-27",
    "card_entries": [
        {
            "card_entry_key": "817dced9-3216-410b-a51c-645019ab320b",
            "items": [
                {
                    "item_key": "04318ab7-7b3c-4558-ad7b-4e9e2d9e0e6e"
                }
            ]
        },
        {
            "card_entry_key": "3a3d8bbb-be30-41b0-b5be-8d358dc059ea"
        }
    ]
}
```

### Discount fields

Adding one of these fields to the request allows you to define a percentage or absolute discount value when creating or simulating the renegotiation proposal.

Percentage discount

```json
{
  "discount_percentage": 0.5
}
```

Absolute discount

```json
{
  "discount_amount": 200
}
```

### Request body details

| Field | Type | Description | Characters |
|---| ---| ---| ---| 
| `reference_date` | string | Renegotiation reference date.|  |
| `proposal_due_date` | string | Due date of renegotiation proposal.|  |

### Response

Response Body

```json
{
    "renegotiation_key": "2af29916-582b-4ce7-8440-352a0d9543f7",
    "renegotiation_payment_amount": 350,
    "reference_date": "2022-07-20",
    "renegotiation_status": "pending_payment",
    "proposal_due_date": "2022-07-27",
    "discount_percentage": 0,
    "discount_amount": 0,
    "payment": {
        "digitable_line": "",
        "qr_code_url": "",
        "qr_code_key": "",
        "bank_slip_key": "",
        "paid_method_type": null
    },
    "card_entries": [
        {
            "card_entry_key": "817dced9-3216-410b-a51c-645019ab320b",
            "payment_amount": 125,
            "discount_amount": 0,
            "affected_items": [
                {
                    "item_key": "04318ab7-7b3c-4558-ad7b-4e9e2d9e0e6e",
                    "due_date": "2022-07-15",
                    "principal_amount": 100,
                    "interest_amount": 20,
                    "fine_amount": 5,
                    "total_amount": 125,
                    "present_amount": 100
                }
            ]
        },
        {
            "card_entry_key": "3a3d8bbb-be30-41b0-b5be-8d358dc059ea",
            "payment_amount": 225,
            "discount_amount": 0,
            "affected_items": [
                {
                    "item_key": "1249249c-95b5-45aa-81f1-967abf5e6eef",
                    "due_date": "2022-07-15",
                    "principal_amount": 100,
                    "interest_amount": 20,
                    "fine_amount": 5,
                    "total_amount": 125,
                    "present_amount": 100
                },
                {
                    "item_key": "c66dad81-ecb4-4afa-8713-a85ee8e721ec",
                    "due_date": "2022-08-15",
                    "principal_amount": 100,
                    "interest_amount": 20,
                    "fine_amount": 5,
                    "total_amount": 100,
                    "present_amount": 120
                }
            ]
        }
    ]
}
```

### Response body details

| Field | Type | Description | Characters |
|---| ---| ---| ---| 
| `reference_date` | string | Renegotiation reference date.|  |
| `proposal_due_date` | string | Due date of renegotiation proposal.|  |
| `renegotiation_key` | string | Unique renegotiation identifier (uuid).|  |
| `renegotiation_payment_amount` | number | Total value of the renegotiation.|  |
| `discount_percentage` | number | Amount of the percentage discount to be applied in the renegotiation.|  |
| `discount_amount` | number | Absolute discount amount to be applied in the renegotiation.|  |
| `payment` | object | Object containing the renegotiation payment information.|  |
| `card_entries` | list | List of transactions and their respective installments to be renegotiated.|  |

## 11.3. Consult an existing purchase renegotiation:

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/renegotiation/[RENEGOTIATION-KEY]
METHOD GET

#### QUERY PARAMETERS

| Enumerator                   | Description                                        |
|------------------------------|----------------------------------------------------|
| **shorten_url**              |  Parameter used to request a shortened boleto url  |

### Response

Response Body

```json
{
    "renegotiation_key": "2af29916-582b-4ce7-8440-352a0d9543f7",
    "renegotiation_payment_amount": 350,
    "reference_date": "2022-07-20",
    "renegotiation_status": "pending_payment",
    "proposal_due_date": "2022-07-27",
    "discount_percentage": 0,
    "discount_amount": 0,
    "payment": {
        "digitable_line": "",
        "qr_code_url": "",
        "qr_code_key": "",
        "bank_slip_key": "",
        "paid_method_type": null,
        "bank_slip_url": "\<URL BOLETO IN PDF\>",
        "short_bank_slip_url": "\<SHORTENED BOLETO PDF URL\>"
    },
    "card_entries": [
        {
            "card_entry_key": "817dced9-3216-410b-a51c-645019ab320b",
            "payment_amount": 125,
            "discount_amount": 0,
            "affected_items": [
                {
                    "item_key": "04318ab7-7b3c-4558-ad7b-4e9e2d9e0e6e",
                    "due_date": "2022-07-15",
                    "principal_amount": 100,
                    "interest_amount": 20,
                    "fine_amount": 5,
                    "total_amount": 125,
                    "present_amount": 100
                }
            ]
        },
        {
            "card_entry_key": "3a3d8bbb-be30-41b0-b5be-8d358dc059ea",
            "payment_amount": 225,
            "discount_amount": 0,
            "affected_items": [
                {
                    "item_key": "1249249c-95b5-45aa-81f1-967abf5e6eef",
                    "due_date": "2022-07-15",
                    "principal_amount": 100,
                    "interest_amount": 20,
                    "fine_amount": 5,
                    "total_amount": 125,
                    "present_amount": 100
                },
                {
                    "item_key": "c66dad81-ecb4-4afa-8713-a85ee8e721ec",
                    "due_date": "2022-08-15",
                    "principal_amount": 100,
                    "interest_amount": 20,
                    "fine_amount": 5,
                    "total_amount": 100,
                    "present_amount": 120
                }
            ]
        }
    ]
}
```

## 11.4. Manually canceling a renegotiation:

ENDPOINT /card_invoice/wallet/[WALLET-KEY]/renegotiation/[RENEGOTIATION-KEY]
METHOD DELETE

### Response

Response Body

```json
{
    "renegotiation_key": "2af29916-582b-4ce7-8440-352a0d9543f7",
    "renegotiation_status": "canceled"
}

```

---

# Manual QI Sign

URL: /en/documentation/manual_qi_sign/

:::danger Attention! 
QI Tech webhooks should not be mapped strictly.
Additional fields may be included in the webhook payloads returned by our APIs. 
:::

## Introduction

Welcome to the QiTech Signatures API! This API provides access to the electronic document signature service.

### Problems?

If you encounter any issues, please contact our support team (suporte@qitech.com.br), and we will respond as quickly as possible.

### Environments

We provide two environments for our clients. The base API URLs are:

- Production - `https://api.sign.qitech.com.br/`
- Sandbox - `https://api.sandbox.sign.qitech.com.br/`

## HTTPS Only

For security reasons, all communication with QI Tech APIs must be conducted via HTTPS. To prevent HTTP calls—whether due to oversight or other reasons—this server only provides port 443 with TLS 1.2 communication. Calls made using other protocols will be automatically denied.

## Authentication

> To authenticate a request, use the following code:

```shell
# In the shell, you only need to add the appropriate header to each request
curl "api_endpoint_here"
  -H "Authorization: EXAMPLE_API_KEY"
```

> Replace the API key 'EXAMPLE_API_KEY' with your key acquired from our support.

We use an API Key to allow access to our API. It has likely already been sent to you via email. If you haven't received your key yet, send an email to suporte@qitech.com.br .

Our API expects to receive the API Key in all requests to our server in a header like the one below:

`Authorization: EXAMPLE_API_KEY`

You must replace EXAMPLE_API_KEY with the API Key received from support.

Envelopes are the objects containing documents to be electronically signed. They are created from one or more files and can be sent for signature via email, SMS, or WhatsApp. To create an envelope, you must send a file or a set of files to the API. The envelope will be created, and you will receive a unique identifier for it.

## Creating an Envelope

To create an Envelope, make a POST call to the /sign/envelope endpoint with the signer(s) data..

```bash
curl -X POST \
  https://api.sign.qitech.com.br/sign/envelope \
  -H 'Content-Type: application/json' \
  -H "Authorization: EXAMPLE_API_KEY" \
  -d '{
    "id": "814e7ed3-4080-4cae-a853-8e12812817ea",
    "subject": "CCB QiTech",
    "expiration_date": "2023-09-20",
    "signers": [
      {
        "id": "1",
        "name": "John Sample",
        "email": "johnsample@test.com",
        "birthdate": "1992-09-15",
        "document_number": "111.111.111-11",
        "phone": {
              "international_dial_code": "55",
              "area_code": "11",
              "number": "988878722"
          },
        "document_submission_method": "email",
        "authentication_submission_method": "sms"
      }
    ]
  }'

```

## Envelope Object Definition

All information exchanges for an envelope use the following definition for this object. In some cases, to facilitate implementation and reduce data flow between parties, some information may be omitted.

| Name            | Type   | Description                                                                          |
| --------------- | ------ | ---------------------------------------------------------------------------------- |
| id              | string | Unique identifier for the envelope. <br /> **It is essential that this number is unique** |
| subject         | string | Envelope title. Appears in the email subject.                                   |
| expiration_date | string | Envelope expiration date in `YYYY-MM-DD` format.                             |
| signers         | list   | List of Signer-type objects describing the envelope's signers.            |

### Signer Object Definition

|               Name               |  Type  | Description                                                                                                          |
| :------------------------------: | :----: | ------------------------------------------------------------------------------------------------------------------ |
|                id                | string | Signer transaction identifier. <br /> **It is essential that this number is unique per envelope**            |
|              email               | string | Signer's email address.                                                                                   |
|               name               | string | Signer's full name.                                                                                        |
|            birthdate             | string | Signer's birthdate in `YYYY-MM-DD` format.                                                           |
|         document_number          | string | Signer's document number.                                                                                  |
|              phone               | object | Object describing the signer's phone..                                                                       |
|  phone.international_dial_code   | string | Country code for the signer's phone.                                                                           |
|         phone.area_code          | string | Area code for the signer's phone.                                                                          |
|           phone.number           | string | Signer's phone number.                                                                                   |
|    document_submission_method    |  enum  | Method for sending documents for signature. <br /> Available methods: **_email, sms e whatsapp _**           |
| authentication_submission_method |  enum  | Method for sending the authentication token for signature. <br /> Available methods: **_email, sms e whatsapp _** |

- The email and phone fields can be sent together or separately, but at least one must be provided.
- All fields are mandatory.

### Envelope Creation Response

After successful envelope creation, the response will be a JSON containing the envelope's id and status, as shown in the example:

> Example response

```json
{
  "id": "814e7ed3-4080-4cae-a853-8e12812817ea",
  "status": "created"
}
```

## Adding Identification Documents to the Signer

To add identification documents to a signer, make a `POST` call to the `/sign/envelope/\{envelope_id\}/signer/\{signer_id\}/personal_document` endpoint for each document to be added. The file must be sent in the request body following this format:

```json
{
  "document_b64": "Q5YACgAAAABDlgAbAAAAAEOWAC0AAAAAQ5YAPwAAAABDlgdN...",
  "template": "cnh_front",
  "file_type": "jpeg"
}
```

### Available Templates

For each type of identification document, the corresponding template must be informed. The available templates are:

| Template  | Description                                                                |
| --------- | ------------------------------------------------------------------------ |
| cnh_front | Brazilian National Driver's License (CNH) front (photo side).       |
| cnh_back  | Brazilian National Driver's License (CNH) back (signature side). |
| rg_front  | Brazilian ID Card (RG) front (photo side).                |
| rg_back   | Brazilian ID Card (RG) back (data side).                |

### Submission Attribute Description

| Attribute     | Description                                                                                          |
| ------------ | -------------------------------------------------------------------------------------------------- |
| document_b64 | Base64 encoded identification document.                                                  |
| template     | Declares the template to be applied for image analysis.                                   |
| file_type    | Identifies the format of the sent file, `jpeg`. If not sent, `jpeg` is assumed. |

- The maximum size for the identification document is 10 MB
- All fields are mandatory except for `file_type`.

### Identification Document Addition Response
After successfully adding identification documents, the response will be a JSON containing the `created_at` timestamp, as shown in the example:

> Example response

```json
{
  "created_at": "2023-01-01T00:00:00.000Z"
}
```

### Identification Document Collection

If an identification document is not sent for the signer, it will be requested for collection at the time of signature.

## Adding Documents to the Envelope

To add documents for signature to an envelope, make a `POST` call to the `/sign/envelope/\{envelope_id\}/document` endpoint for each document to be added. The file must be sent in the request body following this format:

```json
{
  "id": "3dfc5526-ee47-4b63-ad97-ddaf5b1c9110",
  "document_b64": "Q5YACgAAAABDlgAbAAAAAEOWAC0AAAAAQ5YAPwAAAABDlgdN...",
  "name": "Laudo de vistoria de entrada",
  "document_type": "pdf"
}
```

- The maximum document size is 10 MB

### Document Object Definition

|     Name      |  Type  | Description                                                                                                                                                                                          |
| :-----------: | :----: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|      id       | string | Document identifier. <br /> **It is essential that this number is unique within the envelope** <br /> **Optional** CIf not provided, we will generate a 36-character UUID4 standard GUID. |
| document_b64  | string | Documento codificado em base64.                                                                                                                                                                    |
|     Name      | string | Document name.                                                                                                                                                                             |
| document_type |  enum  | Document type. <br /> Available type: **_pdf_**                                                                                                                                               |

### Document Addition Response

After successfully adding documents to the envelope, the response will be a JSON containing the document identifier and the creation date, as shown in the example below:

> Example response

```json
{
  "id": "3dfc5526-ee47-4b63-ad97-ddaf5b1c9110",
  "created_at": "2023-01-01T00:00:00.000Z"
}
```

## Sending the Envelope for Signature

To send the envelope for signature, make a `PATCH` call to the `/sign/envelope/\{envelope_id\}` endpoint.

```bash

  curl -X PATCH \
    https://api.sign.qitech.com.br/sign/envelope/\{envelope_id\} \
    -H "Authorization: EXAMPLE_API_KEY" \
    -d '{
      "status": "submitted"
    }'

```

### Envelope Submission Response

After successfully sending the envelope for signature, the response will be a JSON containing the envelope status, as shown in the example below:

> Example response

```json
{
  "status": "submitted"
}
```

After sending the envelope for signature, signers will receive an email or a message with the link to sign the documents.

Upon accessing the link, the signer must fill in their CPF, sign the document, and undergo the facial and/or document validation flow depending on the partner's workflow. After signing, the signer will be redirected to the success page.

## Querying Envelope Data

To check envelope data, such as status and signers, make a GET call to the `/sign/envelope/\{envelope_id\}` endpoint.

```bash

  curl -X GET \
    https://api.sign.qitech.com.br/sign/envelope/\{envelope_id\} \
    -H "Authorization: EXAMPLE_API_KEY"

```

If the request is successful, the response will be a JSON containing the envelope status and information about the signers, as shown in the example below:

> Example response

```json
{
  "id": "814e7ed3-4080-4cae-a853-8e12812817ea",
  "subject": "Laudo de vistoria de entrada",
  "expiration_date": "2023-09-20T02:59:59Z",
  "status": "completed",
  "signers": [
    {
      "id": "1",
      "name": "John Sample",
      "email": "johnsample@test.com",
      "birthdate": "1992-09-15",
      "document_number": "111.111.111-11",
      "phone": {
        "international_dial_code": "55",
        "area_code": "11",
        "number": "988878722"
      },
      "document_submission_method": "email",
      "authentication_submission_method": "email",
      "status": "signed",
      "signed_at": "2023-03-21T15:30:00.000Z",
      "signature_url": "https://sign.qitech.com.br/s/s2S33dD",
      "documents": [
        {
          "id": "8d3c3f1a-1a1a-1a1a-1a1a-1a1a1a1a1a1a",
          "name": "Laudo de vistoria de entrada",
          "document_type": "pdf"
        }
      ]
    }
  ]
}
```

- The envelope status can be `created`, `submitted`, `completed`, `canceled` ou `expired`.

| Enumerators | Description                                                            |
| :----------: | -------------------------------------------------------------------- |
|   created    | Envelope created                                                     |
|  submitted   | Envelope sent for signature                                     |
|  completed   | When all signatures for the envelope have been successfully completed |
|   canceled   | Envelope canceled at the partner's request                       |
|   expired    | Envelope expired due to signature time limit                            |

|      Name       |   Type   | Description                                                                 |
| :-------------: | :------: | ------------------------------------------------------------------------- |
|       id        |  string  | Unique identifier for the envelope.                                          |
|     status      |  string  | Envelope status.                                                     |
| expiration_date |  string  | Envelope expiration date.                                            |
|     signers     |  Signer  | List of Signer-type objects describing the envelope's signers.   |
|    documents    | Document | List of Document-type objects describing the envelope's documents. |

## Webhook

When all signers finish signing and the dossier is generated, a Webhook call will be triggered. To enable this, it is necessary to configure—via the support team (suporte@qitech.com.br)—an endpoint address where we will notify updates, as well as a signature_key that will be used to sign the request.

Clients may also—though it is not recommended—use the [polling]( ) technique. In this case, simply do not configure the webhook endpoint and use the registration recovery endpoints to proceed with polling.

## Signature

> Example of signature calculation in Python

```python
    hmac_obj = hmac.new(signature_key.encode('utf-8'), (endpoint + method + payload).encode('utf-8'), hashlib.sha1)
    return hmac_obj.hexdigest()
```

To ensure that the request received at the webhook endpoint originates from our servers, an HMAC signature is sent in the Signature Header, similar to the authentication process.

After calculating the expected signature value on the server side, you must compare the calculated signature with the sent one. If the signatures match, it means the request originated from our servers and is trustworthy.

Example webhook call:

```json
{
  "id": "479f8e5a-75e1-4a33-9d75-e0083e3c8e9c",
  "status": "completed",
  "webhook_type": "envelope_completed",
  "signers": [
    {
      "id": "c15392dd-7859-4eae-a2b6-bf0f760a6d9b",
      "biometry": {
        "face_validation_available": true,
        "fraud_base_flag": false,
        "face_validation_score": 90
      },
      "liveness": {
        "result": "live"
      },
      "document": {
        "face_match_score": 85
      }
    }
  ]
}
```

|                   Name                    |  Type   | Description                                                                      |
| :---------------------------------------: | :-----: | -------------------------------------------------------------------------------- |
|                    id                     | string  | Unique identifier for the envelope.                                                |
|                  status                   | string  | Envelope status.                                                              |
|                 signer.id                 | string  | Unique identifier for the signer.                                                |
| signer.biometry.face_validation_available | boolean | Indicates if the face was found and validated.                                     |
|      signer.biometry.fraud_base_flag      | boolean | Indicates if the signer's face was found in the fraud database.                 |
|   signer.biometry.face_validation_score   | integer | Indicates the facial validation score.                                              |
|          signer.liveness.result           | string  | Indicates the result of the liveness validation. Possible values: `live` or `spoof` |
|     signer.document.face_match_score      | integer | Indicates the face match validation score.                                       |

## Downloading Signed Dossiers

If all signers have signed all documents in the envelope, the envelope status will be `completed`, and a dossier for each document, with signatures and signer data, will be available for download. To do this, make a `GET` call to the `/sign/envelope/\{envelope_id\}/report` endpoint.

```bash
  curl -X GET \
    https://api.sign.qitech.com.br/sign/envelope/\{envelope_id\}/report \
    -H "Authorization: EXAMPLE_API_KEY"

```

If the request is successful, the response will be a JSON containing the envelope id and status, plus a list with the document id and the generated dossier URL, as shown in the example below:

> Example response

```json
{
  "id": "479f8e5a-75e1-4a33-9d75-e0083e3c8e9c",
  "status": "available",
  "documents_reports": [
    {
      "id": "a50ef632-842e-4622-8075-684b8c83a99e",
      "url": "https://qisign-dossiers.com/06abda52-5bd1-46a1-8fa2-f616ba44b395.pdf"
    }
  ]
}
```

- The report link for each document will be valid for 24 hours.
- The status of reports for the envelope can be `available` or `unavailable`.
- The property `documents_reports` contains the list of envelope documents, identified by document id and their report link.

## Downloading Dossier by Signed Document

If all signers have signed all documents in the envelope, the envelope status will be `completed` and a dossier for each signed document, with signatures and signer data, will be available for download. To do this, make a `GET` to the endpoint `/sign/envelope/\{envelope_id\}/document/{document_id}/report`

```bash
  curl -X GET \
    https://api.sign.qitech.com.br/sign/envelope/\{envelope_id\}/document/{document_id}/report \
    -H "Authorization: EXAMPLE_API_KEY"

```

If the request is successful, the response will be a JSON containing the id, status, url, and the base64 of the document dossier, as shown in the example below:

> Example response

```json
{
  "id": "5b930d3d-3713-4c42-85d5-f8e9e44e30ce",
  "status": "available",
  "document_report_url": "https://qisign-dossiers.com/7bcf5868-784a-4356-85fb-dd72fd53cd4a.pdf",
  "document_report": "vAsXDdsaGUsdIMIGxhIG1GU=..."
}
```

- The link for the document report will be valid for 24 hours.
- The status for the document report can be `available` or `unavailable`.
- The property `document_report` is the document report in PDF format encoded in base64.

## Downloading Signer Face Photos

It is possible to retrieve images of the signers' faces. To do this, simply make a `GET` call to the endpoint `/sign/envelope/\{envelope_id\}/signer/\{signer_id\}/face`

```bash
  curl -X GET \
    https://api.sign.qitech.com.br/sign/envelope/\{envelope_id\}/signer/\{signer_id\}/face \
    -H "Authorization: EXAMPLE_API_KEY"

```

If the request is successful, the response will be a JSON containing the base64 encoded image, as shown in the example below:

> Example response

```json
{
  "face_image_url": "https://qisign-face-image.com/4fd09dab-6f3e-4ff5-bfed-6f7debfcde71.jpeg"
}
```

## Canceling an Envelope

To cancel an envelope, make a `PATCH` call to the endpoint `/sign/envelope/\{envelope_id\}`

```bash

  curl -X PATCH \
    https://api.sign.qitech.com.br/sign/envelope/\{envelope_id\} \
    -H "Authorization: EXAMPLE_API_KEY" \
    -d '{
      "status": "canceled"
    }'

```

If the request is successful, the response will be a JSON containing the envelope status, as shown in the example below:

> Example response

```json
{
  "status": "canceled"
}
```

## Downloading Signer Document Photos

It is possible to retrieve images of the signers' documents. To do this, simply make a `GET` call to the endpoint `/sign/envelope/\{envelope_id\}/signer/\{signer_id\}/personal_document`

```bash
  curl -X GET \
    https://api.sign.qitech.com.br/sign/envelope/\{envelope_id\}/signer/\{signer_id\}/personal_document \
    -H "Authorization: EXAMPLE_API_KEY"

```

If the request is successful, the response will be a JSON containing the base64 encoded image, as shown in the example below:

> Example response

```json
{
  "document_front_url": "https://qisign-personal-documents.com/bee17d70-b029-41e2-b76b-86f64a8f9213.jpeg",
  "document_back_url": "https://qisign-personal-documents.com/faf38378-daa2-47b2-9d87-0bbc1f7c744c.jpeg"
}
```

## Checking Signer Status

To check a signer's status, make a GET call to the endpoint `/sign/envelope/\{envelope_id\}/signer/\{signer_id\}`

```bash

  curl -X GET \
    https://api.sign.qitech.com.br/sign/envelope/\{envelope_id\}/signer/\{signer_id\} \
    -H "Authorization: EXAMPLE_API_KEY"

```

If the request is successful, the response will be a JSON containing the signer's status, as shown in the example below:

> Example response

```json
{
  "name": "John Sample",
  "email": "johnsample@test.com",
  "status": "signed",
  "signed_at": "2023-03-21T15:30:00.000Z"
}
```

|   Name    |  Type  | Description                                                             |
| :-------: | :----: | ----------------------------------------------------------------------- |
|   name    | string | Signer's name.                                                      |
|   email   | string | Signer's email.                                                    |
|  status   | string | Signer's signature status.                                         |
| signed_at | string | Date and time of the last signature in `YYYY-MM-DDTHH:MM:SS.000Z` format. |

## HTTP Status Codes

A API de assinatura utilizam a seguinte padronização nos status HTTP de retorno, de acordo com o RFC 7231 :

| Status HTTP | Significado           | Descrição                                                                                                                                                                       |
| ----------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 400         | Bad Request           | The sent request has a formatting error. In most cases, we return an explanation of where the error is in the message body.                                |
| 401         | Unauthorized          | There was an issue with authentication; verify if the API Key is correct and in the proper header, as per the <a href='#autenticacao'>Authentication</a>.                  |
| 403         | Forbidden             | The accessed endpoint is for internal use and is not available for this API Key.                                                                                                   |
| 404         | Not Found             | The requested data was not found using the provided key. This status is also returned when an invalid endpoint is requested.                              |
| 405         | Method Not Allowed    | The HTTP method used does not apply to the used endpoint.                                                                                                      |
| 406         | Not Acceptable        | The data sent in the request body is invalid. Generally, this means the data sent is not valid JSON.                            |
| 409         | Conflict              | The request ID corresponds to an ID already processed. This status is returned for duplicate requests sent to the server.                             |
| 500         | Internal Server Error | We encountered an issue processing this request; when this error occurs, our specialists are automatically notified and immediately begin analysis and resolution. |
| 503         | Service Unavailable   | You have encountered an infrastructure unavailability—planned or unplanned—of our servers.                                                                           |

---

# Aprovar transferência

URL: /en/documentation/movimentacao_de_contas/aprovar_transferencia

## Request

ENDPOINT /wire_transfer_approval
METHOD POST

**Request Body**

```json
{
    "operation_key_list": ["0e241203-8c6b-4e0a-ac42-e0d2a2fc2d37"],
    "feedback": true
}

```

### BODY PARAMS

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `operation_key_list` *|  array of strings | Lista de chaves entregues na criação das tranferências (parâmetro key da resposta). | uuid | |
| `feedback` * |  boolean | Booleano de aprovação ou rejeição das transferências: "true" ou "false". | true/false |

---

# Transaction Receipt

URL: /en/documentation/movimentacao_de_contas/comprovante_de_transferencia

## Request

ENDPOINT /transaction_receipt/ TRANSACTION_KEY
METHOD GET

:::info Information
The response of this request will bring the data related to that consulted transaction, and if the PDF parameter is true, the field "pdf_encoded_string" will be available with the PDF string encoded in base-64.
:::

### Path  params

| Field              | Type   | Description                                      | Characters |
|--------------------|--------|--------------------------------------------------|------------|
| `TRANSACTION_KEY` *| uuidv4 | Key of the consulted transaction.                | 36         |

### Query Params

| Field | Type    | Description                                         | Characters |
|-------|---------|-----------------------------------------------------|------------|
| `PDF` *| boolean | Boolean that defines whether the response should generate a PDF or not. | -          |

## Response

STATUS 200

**Response Body**

```json
{
  "origin_key": "f17c219a-e11d-4b5c-b00a-8ee2135f581a",
  "pdf_encoded_string": "JVBERi0xLjUKJbXtrvsKNCAwIG9iago8PCAvTGVuZ3RoIDUgMCBSCiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCj4+CnN0cmVhbQp4nN1YS28bNxC+76/goYdVEVFDcvgKDAOO3BYJ0LSuhfYQ97Bar+wtJG0iy0V+fof71sO2LDsoEBhacZbkNzPfDIcjCwb0NxT0cChYuoi+RBfsS2Qkl5pVTzSOa1RMWa7ZKmN/sWUzb9iiXmQU96p5NpPVIGVaWg7YTMxJ9lyIWo6YVsBtu7uVTNhZC96EbY3gONgWxHtudaMiqsU0bK+G8xq3kioTKoR6HPQEn4B78A6Q0UBq9OHbloPVDRslwG7uosCW9roki6iYlWQBl7Q2rIQwUELRtt6md5NIKOKuojqMrA2anebGCkdWTRbRaDaEITDBJrPoUzwuFp9XAynj4t9kuc4GQ2V9fB2+RczoCfFkINDGq2R5l1wptPRRxeDvyYfop0kvgkJKjtIw1KqMIaIkz10TRsHC3xPubSIpJpEj6g4CuK7pUhQT7OMZ3d+6YFq4MoLNm3n3Bg13VoRoVXta+XbLgANR5FMosx/73hlRLmx4EkJ3yf5UfB9jbRuXH0hcvVtxRbuDy7pysH4zb99Iqzdc7uTbLRv6KKJe06HYGrdBaeRdlA3iGnXfrYNI6jQVhcZBCFXkcA+ll1seNm8620oVrWWNdPssBFNV1gaiFncxat8OKVmyLliSWUVOKw+GCUUsGIM0rGqW2KpZbb3Csk7pqmhVAoaiBX67aFXToXT5SqPvK0Tk+wok2BG4kQQJbwZDNAGfnkK8Rf1WCxJ0jUnlsK1y5FWrIiSAsd44xyQ4oqJUt6Pnz4F1cTIvVh3Yvphv8iUplUo8GtItBUIbuceHP37o8eTVG4e7BVwB8HBDCEcJ2p2tEEFb3SjQXWvVYoNCh5u8CiUbfXXsvIguStBHM3bTCbqdRHU7qVBdUQqiaivo8W+r/CZbDCb/NFZLR/5Kdajd1XJhND5kvD/KeCUE93Rky+GD1p9nd+t8WdTmA0e6/lVA14YuydAIGAxHYzt3araV5NYQR347tPHHYpG1qA+ctGAwtF1BGNWwlPGGeNmXjRfvKVd8mewQX47PG4mel/xsIGzMmxQ63Js6ZKjc67vUx37Qr/iXfJocGwQ6amI/6nmR3i+y5bo4OhJWcu8NeNzBJp4QJF0McgQAgg7ws+3vU/NNnOgreNgTaouFp0YUfOWJhGMjQepwr45P8fslHbT1fd4r+m3N/nlgVZwvk2Wa5aukS99nBgtBcBXaaffUsSnSPLtOynupOTydQAvGZeN9pbS4ztdFt4qCkZdTWXhLC7uD1yFdUWr4q0E9/6Kz+H/x2bPh+yC1ThBhudvrS3x2Q4bJZZonx5YKpGveEmW7rUocTtVLisM3sruv4ZWNrymh315yP+q4WK6Pp1o7LsqWap+1Ug7Vi9h+dav74I+Ybp3CYVl7O7MUcq0xtKhIZdoAjcuLmXrtK2XUdX7TP/jhvJVtbxDO7td0a+Tp7j8HDqdFeMstNexkuSZXwElQYsfyaZpNg9mjy8/Jkp2csNFZur5P5pPs65qdzLLZDMCY8Dllp6fs3fm42i+q/SchxU4Dq7+ON4ETMZwmU00+TWE4hUQOnccZ6lmaAuABgeiIBMulQIfItAzxhZrI3YrWstmraC2ppdAs2K5ozcRWRWv2bvRn1Dl4iegoRbgIv6YoIa5DWD/+/qGnYk+X0fxAiP4DLOUwNwplbmRzdHJlYW0KZW5kb2JqCjUgMCBvYmoKICAgMTI0NwplbmRvYmoKMyAwIG9iago8PAogICAvRXh0R1N0YXRlIDw8CiAgICAgIC9hMCA8PCAvQ0EgMSAvY2EgMSA+PgogICA+PgogICAvWE9iamVjdCA8PCAveDggOCAwIFIgL3g5IDkgMCBSID4+CiAgIC9Gb250IDw8CiAgICAgIC9mLTAtMCA2IDAgUgogICAgICAvZi0xLTAgNyAwIFIKICAgICAgL2YtMC0xIDEwIDAgUgogICA+Pgo+PgplbmRvYmoKMiAwIG9iago8PCAvVHlwZSAvUGFnZSAlIDEKICAgL1BhcmVudCAxIDAgUgogICAvTWVkaWFCb3ggWyAwIDAgNTk1IDg0MSBdCiAgIC9Db250ZW50cyA0IDAgUgogICAvR3JvdXAgPDwKICAgICAgL1R5cGUgL0dyb3VwCiAgICAgIC9TIC9UcmFuc3BhcmVuY3kKICAgICAgL0kgdHJ1ZQogICAgICAvQ1MgL0RldmljZVJHQgogICA+PgogICAvUmVzb3VyY2VzIDMgMCBSCj4+CmVuZG9iago4IDAgb2JqCjw8IC9MZW5ndGggMTIgMCBSCiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCiAgIC9UeXBlIC9YT2JqZWN0CiAgIC9TdWJ0eXBlIC9Gb3JtCiAgIC9CQm94IFsgMCAwIDI0IDIyIF0KICAgL1Jlc291cmNlcyAxMSAwIFIKPj4Kc3RyZWFtCnicbZVNjhQxDIX3OUWdIMSJHTvH4AioJWDRLID7S7znpKbVwKanvir72fFP5meRq1VrFtHxMGbM7tevb9enL+369rvIrMPX1euwdf24equtxcHnjVJlgo7tOzU+jmpLC7747K9PeEv6XrpeWqULA0jtsl4BNh5Lcei8g1aXl2H5iy+r4StjCCRdmIpMRSAwI+LPavMSqSGdNIOguggaej3ILfJjD8MpUC8PYpvzWnWNdIkxYbtqX06crV9RQ5UwzADpBa0VMIw62koxOkYVnwSNeEHDAR8HV7qnF4M0P4JRF3ItNAtjyLmEBj0NUO5Vvd3PD6oKDDbmSRTgmhCGjFaV1vepRSmlUwg9CMvGDacOj6xp6zc/D1NpNmOdYg6mh7FgF4LZdJEdA8l4FouqqKTnr3AUHSAyyk6bbFXdEWFlE9/Js7DPLBE1ZS0qy8Cvobd4w4JHbTqgOE+HWACMo7FQ3c4ja++aVok88AKsoTkGbVAoD43Tdc0u5cyM2qRnU3LWulh2js86Yp8E7uRp2eRpKBUwx7DV1SGKbYjTAtQHqJZDNXqQgmU9ZGj12LbgwhfTc6AhgUVrY2VrY+TayRkCi0m2yMOKpi1XZ8/ZhpLnWmveH1Eu9fTTbGJqchYfKO8SZXQ226tbAtc8oTBvN57KUMabnoesOqozcVxLeUwvIg4uObeU8p0DCy2xbCJjx9nAxsnaa/K4EcMHx2fWG7P2D8N8olzPrNTYYp7LGlhWBvKcVk/oSmk2m/1Aaj1bKhwO1Fi9fKDds31Y89LjYLDkuhV7bi1oDyOFJY1cpOQ11HN+VOJ6v7keuMvQo8F7kAP/A1cet3FTQ6Ewo41OZkyj5VmQwTbrnHN64wGXRg5TvkWB8pLbxjfdKochPubttCOmWjnwSg7/GWjD7HjSg7Jrv1f1wEeIxDgOynu0nFwTrsyWrdoIlXA6nIeX0OETJX3KncFbdv9J92v5XP4AkddargplbmRzdHJlYW0KZW5kb2JqCjEyIDAgb2JqCiAgIDczOAplbmRvYmoKMTEgMCBvYmoKPDwKICAgL0V4dEdTdGF0ZSA8PAogICAgICAvYTAgPDwgL0NBIDEgL2NhIDEgPj4KICAgPj4KPj4KZW5kb2JqCjkgMCBvYmoKPDwgL0xlbmd0aCAxNCAwIFIKICAgL0ZpbHRlciAvRmxhdGVEZWNvZGUKICAgL1R5cGUgL1hPYmplY3QKICAgL1N1YnR5cGUgL0Zvcm0KICAgL0JCb3ggWyAwIDAgMjQgMjIgXQogICAvUmVzb3VyY2VzIDEzIDAgUgo+PgpzdHJlYW0KeJxtlU2OFDEMhfc5RZ0gxIkdO8fgCKglYNEsgPtLvOekptXApqe+KvvZ8U/mZ5GrVWsW0fEwZszu169v16cv7fr2u8isw9fV67B1/bh6q63FweeNUmWCju07NT6OaksLvvjsr094S/peul5apQsDSO2yXgE2Hktx6LyDVpeXYfmLL6vhK2MIJF2YikxFIDAj4s9q8xKpIZ00g6C6CBp6Pcgt8mMPwylQLw9im/NadY10iTFhu2pfTpytX1FDlTDMAOkFrRUwjDraSjE6RhWfBI14QcMBHwdXuqcXgzQ/glEXci00C2PIuYQGPQ1Q7lW93c8PqgoMNuZJFOCaEIaMVpXW96lFKaVTCD0Iy8YNpw6PrGnrNz8PU2k2Y51iDqaHsWAXgtl0kR0DyXgWi6qopOevcBQdIDLKTptsVd0RYWUT38mzsM8sETVlLSrLwK+ht3jDgkdtOqA4T4dYAIyjsVDdziNr75pWiTzwAqyhOQZtUCgPjdN1zS7lzIzapGdTcta6WHaOzzpinwTu5GnZ5GkoFTDHsNXVIYptiNMC1AeolkM1epCCZT1kaPXYtuDCF9NzoCGBRWtjZWtj5NrJGQKLSbbIw4qmLVdnz9mGkudaa94fUS719NNsYmpyFh8o7xJldDbbq1sC1zyhMG83nspQxpueh6w6qjNxXEt5TC8iDi45t5TynQMLLbFsImPH2cDGydpr8rgRwwfHZ9Ybs/YPw3yiXM+s1NhinssaWFYG8pxWT+hKaTab/UBqPVsqHA7UWL18oN2zfVjz0uNgsOS6FXtuLWgPI4UljVyk5DXUc35U4nq/uR64y9CjwXuQA/8DVx63cVNDoTCjjU5mTKPlWZDBNuucc3rjAZdGDlO+RYHyktvGN90qhyE+5u20I6ZaOfBKDv8ZaMPseNKDsmu/V/XAR4jEOA7Ke7ScXBOuzJat2giVcDqch5fQ4RMlfcqdwVt2/0n3a/lc/gCR11quCmVuZHN0cmVhbQplbmRvYmoKMTQgMCBvYmoKICAgNzM4CmVuZG9iagoxMyAwIG9iago8PAogICAvRXh0R1N0YXRlIDw8CiAgICAgIC9hMCA8PCAvQ0EgMSAvY2EgMSA+PgogICA+Pgo+PgplbmRvYmoKMTUgMCBvYmoKPDwgL0xlbmd0aCAxNiAwIFIKICAgL0ZpbHRlciAvRmxhdGVEZWNvZGUKICAgL0xlbmd0aDEgMTIyOTYKPj4Kc3RyZWFtCnic1Xp7fBRV8m+dru6e90zPZCbPycwkk0kIARITQghEGVGQlxoBEVAwQIzIqoAICAHDY0lAUEBMUEQYFRAjYkQWE0REiTwEXJXgb1lxfRBF14isP1zdkJz86vQkiO7vd+9f93Pvnc6Znn6dU6dO1be+VR1gAGCGRYAQmHLfpBl/i4tMBwjmAEjjp8x5MAD3JBcChFYBMF424+77ZvaeMw0gg47hpbvvnVf2zLNJx+n3DoDUP069a1KpLWZ/H4Bufelcn6l0wrbZUEvHM+g4bep9Dz7kPJwirj9BxxfvnT5lEsgzPwfIXE7Hv9w36aEZcq06E6D7IjoOzHjgrhn9Df+gn90jAMpUkKCM18hlyhaS1gCJYat8CdRLzKhUSDJkNza1XAVaU0tTS06MM8UZSnGmlMnQNguT2r7iNQb7Lz8+oGYCg1kdZ5UM5QIkQJ9wou1Z+05ztZM9Czvl6ri1zlWJhgQb5Li1RK2tJVd02Hyx5WKLdv6f53N2O5L8SRKbwDy9WDAATg1ScvsUeOyXD2KVjLJzSzqAX2AagyXnyqZ9/0f+Mp/PKtmoyu+VyafunMgP87/w0/zwxDtPDhnCNrO72VS2+QaaogQzO87Ks+VysEAcDAvHqA0uaLDWu1bFm1yOW9DlGRRPIl3sFEk7nxMODkgoh3K1wlBhrDBVmCss5dYKW4W9wlGhVTjLXZGECwlOkjZV9bhj83L75PdOz8gVggZTxbc064kdL1Wv27Fj3QXm4ucv/IP/wJz42bmjR899c+Twtxv5Ed7Cv+eHWSGLYW4mVpTBXgBDMsmYCuPD6arLFO8ANdngsVYlB7A+aV+CZgCnw2hUi51GR7E33pg4OCj02NbW1uJ0FV4F2UVFzReLGltyna64wpxwTE5acdqMtDVpEdreSvssrSPNRBJfw/JyYz3OoLN3epCkv/JHnke/KGcOOrDklf0ND8xeva3hgbmPbmtoGFA3b/5LuGLBnJ++bL9D2vTsxv1b2qukTc89/dbz7VVyyc67Jy8AXc97+Rh5C81BAy9cE05KbAC7u0Ex1ttXsTdxX7LTZbkhTgajNDhZiJ4b1Xhz88XGFq2RtG4q8S3yRXyf+2Q2IXRZItKoFExNZ1FBdX2zWQ0N/V4tPw4dHcfLX5X6vvD44y+Itr19p2quLZ3E9/FfaNs3iX137Ny5Y9SgS8c4jORzQk7YrVpIoxassteb9hnMqhGMg11aGymQdElm0Nh0nPSas7s4ZnOMsEwyzN/oKQ6H+Yf22PgCSbJ3WUwvL+52OY/tb99F+iiboij6eFcDyBVyCahwKZyBTlmRJSeTFLFDSQWVOQHUgRLCW4qqoMQUGQxa0/A68+ixDdRBuO+44XXu0cPrPKNvFyc6DvQd1xgn1roltzBn+KixBk353qAZO5vy/bhUFn5siDRNKpcqpEppkbRW2iIZxUAmNMke8LBETJTTIZ1lYqYcMOZDPuuH/eQc42AYzIbiUHmwMkQNG8fAGDYOx8nFxjIoY/fgPfLdylS1xDgbHmTlWC7PVuary2AZW4Er5BVKpVoDNWy9tAGflJ9U1qvblRfUOuMB42fGDuM1E2BCTJ6J5bHg1QfZRDbxIL+jVS5pG407LkV0mykn3+xJa2KGEOwLZyT4LXEmO7wYpzbYnYFK/15vQ7DeuSrOCnEYbzMZLX40ugelk/0cbyITchYKdTQ2X2wjxz10XjvvLHQW0rKF789JzvHl+HMCOSk5qQMywslhX9gfDoRTwqnFycW+Yn9xoDilOLU4Y0bGsuQqX5W/KlCVsix1TUYk40KGr+vRroe6HijxlfhLAiUpM3wz/DMCM1IW+Rb5FwUWpcRPuAINrmYFzmA+YVdqen7vPnkp+brlGvJ1s5H2f7Zj8fSnGurrB+xbvuNY+yUmvbC+ZM/ou/aP/88LUl5Z+eRZp3dnjmhfXFs26e3n3jzgqljZq1dtRkZbp/3KpaSrGMLXBDQB2plaZXfWW/eZmWSEm4R+BruFbwnXyi4SnqXDwe4Sz589wor/O4cvrV+woHpHQ8PA12a/fUjaIlx88ybh4mTKd5X+QOMW0EL9qGyicfuGE+yK0YEvgpPtM1aZLUYTBQij5rKLcYsa6S9XX5KWKBYVFubsesXDxMgpnhSnO7Y/8wi9kILynGwuK+fLhs96881Tz1VVKZv4O6vbIytu2rD5I6lkNbsGLmN3Bc3ZDUkwI5xGNmyqNC5XPC8ypcHK3ohvcNVbV3mTPJLRY4ThkssxyKuDeaOOigLQmzWyC+3ieeHO4cwByTOSI8kfJF9IVgbAADZAGuAZkKT0MGQbs009zNNhOpsuTfdMTzJNmCniUYqPdHRFKCI8MuhQYJAr2nZZT7w+7fDkKR/8gV8kOM9s+5IZ6qWtyzc02KWJ4/cf7t17Z/cerC8zE85fxz9tXL9756auOY1X3TpOkka7cHKVvZ6tRx0hbyCsHJSsTyRXAFJLF0juiWIkCo3mdZqZpMsVy7piEUmHz9XX93t1wbEO6Di24NX2w4SO27cTQuIeaeK/WraXTmLXMyNt10/ini6IZB2tZF/fKqeIAQwL21WpGhbLLIxeCCtGram5rZkEIXlymI5Qb4IRwmQcBJwETM6CvuPCMWDyg8Y0yW/QTGHTDNNmk2kCioUPOlNU+Yf288fazyunaltPKVnCnqd3nMXDtLYZcC5cZLNKdssov48symAe5ff7BpotPj+hViVbIbsrPSviG5xyQ4jAoJvPbPEnGWBkktFuMLpTB3UTuN3U0kwrXFjYueoa/+m89tN5Yf06Utq/d8YVGvTvcam7IINsMnyf1+y1eK29aOF7WHpY+5v6m/tb+lstAQiwNKmbuZule0y2O9vTPbabr5s/M5CZkpZRaa60VForbS6B8JKkmlULWtGGdnSghgmYiEnolZNNGdmZAzLvzKzIXJS5JjOSeSEznqBwpk5wdKDwMx/zuFVyhox83cZo4bIpygjIyI3FlTdtH79ixeQnBjRu/fkv4w/eW3Zo0pJVd70UfunJz98v2y0P2Nmt2+jR4aEp9u5Prdi4Jxjcn58/7pbhxSFHWvWSTTt8JFxHB8zks/GcXO5KB1I3EYhCWK2f1zFXLaDzBgCnCv1GArh3u3sVWQxZYVOgV3aR1stfJE+4imy1iu5dTZxOcKcgcaeICyLWtYI7eR0+9HqSfsedmDBHV16ui8L2b0jRyo3PPEN/zzxziZn4z5cu8Z+ZSSnmJ/hxaicoQuSx3iwvwmfxSl7FZ7FH2Tw2nz0q7GQ72eVUsksVpoTjFaeEkh5MByoRWIwKMpmBatDajjdGw8HFll+Dox4Uh9fFCns16PZqAEOXvbrGSkzFRKVQGaLcjXVQpxpEvErxsCBL2Y4H2r88yXh7nnJqTOtiYbFCFugYKO0iWRB6ht2QyCQmJSLgQGkzeYsEDLMbdRP8NyEoBErG2vZfapVT/7pP9IWwknS7UtdtELLhunAo3gqRDDXi6xlxrfWtyng+J96a1t3rSfM6TKRpUrcjJSlHGLtAAz3aiaFadM1r5wlsr6SkIWFMaYLvuVWDMDY5mJpG5hVzBU5IK9ds3bpmzbatfOuStdDxt8/42sWPP89//vln/vOWIWuXLlm3bsnStdK7G6qqNjxdWbVhTGDXotc++OC1RbsCqYdWn/7mm9OrD7FJDy5Z8iA1XT81tFbDaE5e2ETRPDEJ471O4jVOYj0DtWedT9gi7rUyRCTQzBIze+M0VAnnBMcRq3S7IDyC7KBOdppaDhyIslsR0q5QqfI9q/Nqui+zcO6t8hhljGG+PF+Zk1SVYJBBTpAT5STF+yDMUWcnzkp60LsEKhOWJC5JWuLdDtuTnLTMIcKl/D5QcA27MkDLQlkqsBXS220jyAjzJt34QuWdJx+a3zT2G+YedHsCv1hbWzuXre133/qhc2sGXnf8qtxv3rlj64xk/p0+/00dLnYQOCiQELbiJliqoswSIF4lN2k6TqvV1pJTkOfBYMyFk1sWj+Q7+AEmzPIL0tt4siszhMOegRiRpYiy2AARk9GvehH8zCKYoUMwQyaYYUtjW0unXpp0vZAmdjvQIUsTClKcSn4oT0Rczobxp9hd77FhbVtq5VlD6oe0nqrV4+oFEvagHNTzPS+h/VJ5GyyVFIYyxBsplOs8WKichBVcIXjhJH04l4Ncf76U5N1C8kpgg8XhZGZDGyDaBgJaDBHqZrGJWc3gVY2y1a6dGV5nofW16UtrFUvbFKUHgms30ViuTpSWj9LyHhWL2t0C3WEIjIN7YC48AoZYlkW8NQv7sJvYzdabbWNYGZvN5uMyZqPFNLEUzBNSikiTjyqXGM/np04dbZ+ohNrO4om2vO08wkoOdq7RWbmUZE+GieGgnGhwVmrJiRGDO6KtsEmEKbZVhi2+OC8zU+wza6pPa9MhpMs2NTGBzrXQxFqQnVJs1pMZ8sSvz2u8UdPpRoyIfXoS43FDypVQLwzuU0xoj/QY26OVpfEm/sPEg1PHH/jDy++99/Itz46mKMkfdzj4+b//g/8UCBy7KmfPxo170tJ1+TWRs+t4+Ho4Q3aK5IFAURU7Gek6ZRkMBpLdvQKqjBIoCqO84n+TOuwqNoqYOBmwO94g36CMx4W4FMkXDJJRNqke5pYS5USlO61CupQpZyohNWDsC4TbUpFcpBSoQ2AQGyQNlYcqN6jjYIxaJt0j36PMhzlsjjRPnqfMVhcZn4T1aiatVwrTkwJpWPuhk+w0++tH7YeVU5fi5G9bs0j+t2mS84gfIaS+DuslZoTBshY195ywTVPCSrFSosxQLigqo/TCGXy7vl51/6tF2OVR0g1pj7iqF14N55uMBjSrTpRRccoyDlRl8KDsqTa5q22LLbKiotME3li7Yk5IkJ0D3GavVdazUwJZghenzieyi4STuQrFdiWqR7lE2Cf0NnB+DFNAYYqkokHPtdxSLJG5EIRYSErHDDXdkG5MNwV8fVgfaTAbLE1VZlMmNTdmubrc8KT6pMFPeiFSEBcTxF4sS1D1lIDAbiJ6UZPBR68tv+bE6beGrXzozHvsCIO2pe0r+OPV1Y9L+2LXPMynsoqaye0rlFMf/+XRvdLN7eerli5dJuJMLT8p30f6TIFuFGfeDN+aKpkt5gyW3k2yWMzJzOeVsjOzk6TMzOyBMU4t1ZyUKceppu4pihRXGatWKs5g4iOxKzTo/oiyQuppjDX7DJmJLgRTqmZCRvOyKWqOQHGT8Akl6h9WchhNILpD9xpFeEpRy8W4ora4oovNYjWbKctubslt1EOZi5QtkhXnZSz4vou1de1kEUeFdoQfxTl1slSQn+ehA+JVGU6dURnQaad9bJxTR3Zpdym756NpZR9O//ToX4+XTtg5atQrd5z9+OzHpQ/On/lFxeJyfpL1lHr23B2+lrEjaTtqnt9n/+4b2Z/0SvdeMr81uHvjiwcd5FQbbNPGjik5xW923j9+7NRobrKYcKSKYl08pMHYcNDgT2CVkBAxb5UjsCLWH9HWxq4KGbzelBgfpKZ6bUkhsiyCiC629LXgqNG8JLYx4Z3EA0kHvAeS3/E1+g21rn2ub11IeWWBjhmuGMH0Ib835EVLYqnprAtIaLJfjNg4/MhJR79d937OLzHtS4bMyV/lX43YyK5Zvnnzcmr++rR0ZmOuMXcwx3dfs1idaG3mt/uk9Xufe/aNN559bq/Alo00p1k0p26UbfUCT4y50uSvDMREPLaIaZ3qjQTWBdeqqzzPZ8Z6YwDdCd70gOZFt9+kZgoD+BUlTXoEJ2i8KBypk6c06/B4vnPBc1jYVOqb5J8UKE2RdeMnkvIbmMxi+b/i5eUAjQPWPs8/4N9MPDxt9JH79h9u2LpzT/Wm558ctf+BWUfHfc2sj2HI37jm0x9DoYNX5das/mP1trkzZpWnpe8OBD7cteAlMU+BE8TswATzwj6DU/A4J0X+gQYJ4RUjAYtB8sp9DF6QzbRobS1RakmhqvAK8xQGuctvEf6f00fqaxgi3WC4RyozLJIMKhOYmagOZkPV29hY9S52jzpPXcYeUavZBnWzRdOZpkji6Ct4lJKmmkZ+oX1aI+GgX/6iNUv+4pKfbGwW/0U5rXPEZBgZ7k6s2sGsNqud2WzWgQ6fVa12QXU8EXKbz5bksKIpISkPEzyar0tqEWS1Rp0i/g6+dPaU2pnV0ncMC2ZcLrmKbwkzzvB2hmfOMMY7BjDzxU9Tghp/l1cRN+/P+rGHPlRG8Hr+Ff+a17MhLJElsSGtf+af/iBJbCubxCazrfx2vom38cc6dc7W6dy51+vwisRIubIwGu1yvSuK8Sxsy+kE+dXKZkXVMf7oe+8pp1r1vFHkJM+RTjLg4c68UfJ1Jo7Sr4kjA8+z7ifiq51yNTwRWvtr3pialGDvaUhwp3bTzjSSkq7MG5v1grR2yPnbvFHrShwdmbTYe/yZ2Zk3Z+KE36dzvzXeaDonGLg8ZNbxO7e+Nnfb/C//g3/Kz037YVF5ywMv76vaUP7leyzup3v+qmx5t6DPojlT7vInZJ3ec/rznOwPBg1e/vD9C/zxPQ+8dKg5vSu21ZH+jOCEXmEPVJsWs2rNKGlmUBJsueA1yS49G3NG56Pzt10lMXr9pRM3QvrKAk1j3UWWz/z8C36MD2Sb2S5Ww6fyYj5Jyb40l8WT7D1Y3Da+ni/iD/ManXd8Ql87idsiOF8nsiho7eW4LGjiJ4Igkpxd/EQiNvtO+FpwMtBrn5QDMKcZzeCUiCuaDZQYqOKkyYlmo7hA7NFQLbijQnFbUBcGJsVs6eIuRc0iCl+RBFzeRUlMF6mhdQpY9aDsYA7JYXAYHTAW5sAMWAUmAzNSiDbJsSxBGsPGSsXWu9lU6SEiKQvwAXmu4SFjFVsuLbI+KT2FNXJclFyK7A1TMCjt4+elEC//Sir8aHn7nctPKfb2BNzZmsUq+GJdR+IdiMjpkqEwHAAliVVjUrXR9axzp6favta4yieB19lbzotPsER9tLmt8fK7EN4kUrqcEHHYFKcqd739kOOufC8iH+R7JNds/nWEP8dns5Vs4uPMMH1G20p+nn/PYpjrD9tPsbXb2itG3cqeYvex+9lTQwb/x50l/H3+If+Ivx/SY9evHMsAWcT/98uvwj7i/0YZBl/m/82UrIQtopZTbCoxzTApUboliDZRrvp6ueRSRHV/q9f+ySe3UH+WaE0LG6wOU0O8Z5WjPml9ArhcN8RbVWPiFZX/zprWod/UtK4s8l9R/M8QKQh+1VXnb3/s1+p/v4YGKbuzhCWNvKL2X7qdpGGi1iZqIJAAA8JJUMmWy/ZK23KzqCXF1YuXUi4bDHEPStTamrteSmn8oigd0cwdSVrSoqQ1SZEkhV3h7F0VwdTOl1N47qZnil87dOi14mduunHrhHb+MevJ1Fufk/N3ZGWdPXHibFZWbVoaTcjOXKxfUNf/TtLXWL2W64b+Ye+v1dxVZrbPXW+1mYxuy00SUV+PcOnC6Ho0514u6U73HBAl3RiKINGE/nI9MJ3tFCXdl+vrr3t19ttH2J/ZXmlb+6TNm/dvkcovRXaUTbmA24WtlrLPpAppqfDnPbBRkslNtTPH9Vd9eupSKiW1fyUt3SLkXU3y1uhxSHCdtBgVbJVWiMSqEW/sVi1iXZG61rsqZE01eRN8MV5M8etkh4y6OYqrbc2/hv2w+xgcYyekE3hCPqYcUynb2uWTJvz2jVpU3RJ2pU+XXwVKWzoZDTONeHoEsZ7+u/7wBVP4hS95Oz/PilnSiKexfxenkeYR7+E/8h9um8B/+O5r/ne9sESByRet5xCmykGdB2SGXWq1rFc9XzZSxoSdsT+3qTEKpdr5nF0OEez1tE4vax7F8e0zpOL2uvdEwjaktr1Ar7uJmrVa5kon/BN1t/6wUh+rjv8olasuypgLwg6VciG7zQDoUiHGrOfIMSIOmq/ILs0iJpJdRus85IxMlTxuV1wwXcrv7SqQyiuXLF0Wqal+Yr3q+ppfc+4c7//Vd+zQ55+xxhYabwuNN10fzx92GMR4BgYWlxxjBBqv6OKv/cbkxbo8bskQ7OPK7y1toS6rayLLli5VXS286LPPeb/vvmLvnjvH3onW5PkYebz+PrUbDAsHE6zJJldlTGyDAxvSg/UZ+0wNjjcTk9MTwGi9QXW5AoMy9ZpVtJTd2Bx1fH5K2EIheX/3Rd0j3X/n/XGa9GssvZp1lrld4sVbfh4+t7X6ia1bn6jeWs9566Qdt9yyaeSfdhfuWvB+W9v7C3YV1ktXHzlz5sjhM2e+41/yb5N9r/Xo/uZbt0+ZTJRFVAv7TZ5S+2/r5DRAkb5Oxt0eX2qSIesq6Lpntn6PRGupQv9ZUbvJJkX8QggTA+PCXkVjVuOLKqsiFav7zFKMAQwmxWhzWEa4BcHRX+hZoi/07Ppvscj665JGlx6pm3PbyL5yhULYnrCn2BPxCHpB+khm0QJ6MD9P1IalX+qm3Miy+YcNdXU731TdTxVPnbK6LRs/XH3TGy9FOYL8qM4RYqBfOJ74gaAJLs1slGTBEgY4BU3QXxK1CWKu10ubBMw7PH7PAM+dnlc8is4Xorw7lCIotyzyUbaOP7phw6O8LztySRDCS/w9Jbv9z49XVT6+7ewnn37Zvh1YRw0v0zmeBQaGYywSGKqVOlhsVYxqoeB71t/xveYo79KZqs77bGFbsa3Ettq22abzPk3tzAGOvnfi7I0DKu8nEriO/3ixtkbYImNBPluiWEaz9YftJtVs+09yJ9Ay0OTWzjTpJbfspjbSck7KvxfcM6TRBX0emtPrtqzUYdn9i7J6XnNPzrjbrdalTkdOL99tV9M671GScZhaAEkwJZwGLoPdIjOXwWGRXQcTDPJBj+V7r4PZweAZEzvXMMY4x6tdjPLuqGsVtTUViRf0l/9yQGTJIju+feyb4O04QGN4aQvrJWmWEX25FNRfzQlSKWJNXhTV2wpjU2zpadJCqez29HDoN0fK+AJ3zNCRVeu8KV0/dDtls+TzOFItI4y/KmySdsNrMl7PZE3/jw5ih53S2HVpZF0ambZOaUTNeuVhvvcptYwvj9r929TfAOpPJQyzyoro0SBLs1WDdqYlWvfOLfxtrwa9V4Mov3f2GhPMMATZnid+Wrl790rR9U8/QbR3Ub0CsIIs3UR7HzFJBDtUQAcbRenEQ+xh9rh0SDoTSA/kBPoFdqSkkocCBCDCRrISur6w83oMXS+8fP1//jAa4wzbwDayTbRFOrdDtB1hR3RJoh9f5/4qyNX3sdAT0snOnBAHHho/ARKhF7golvsh/jcjZOijCM6VTWgJEIS+nVdSqBVAKjHFNEJoIAv77z4G6A5Z5E1m6AN5dJypn/WSXozk7TL9VkhDJuhBK/L/6kfr3Duo5UDvf7ue/39aAJYP9UCcg1hvLWxk2+iojE7PpDMRaRcsg9l05iA7xlZIPencNrgAJ+nOKjiGtTKwYaT5Y3T/aUWCi2w07KY+CpmbFVKOAvJN8m55pFwvn5NPQIE8Sz4hl8izGAUpZYyyjVohviu5CJf9UM8+g1mwF7/FPNwnXy/b4TM8gbXwFY0iVvIYrIYtUE6yuNl0qJDKpZF05rByAjbQNp2unyArPUnS7WVL4RQ8ibI0BDaxUzSvY/BPWIqjpQoAzJPKSP7D1NcJen4DzCLkP8XMwKUsOkfS01iT9e9k7Kmc0rcL5GXlMBq2qPWqm7zzpK6xbewga1HXQQRO4h04Ez9hy+SgvF0eAqujGsASWE19bxDPqGVsHs1dbOWid2muXMJq4Vu5xDCZ+n5XzIjG3C2NpBmVwT5qc1WN5tSfLcMVJKm4mgwnDMPkbHqeejAspFkDTMd8mEa/ymEn7IKeWAOrqSd9vmqB8k96cqP8Bc15NXtU+iecwOvJS8rk86RrckjxRup1g6ro2WSPgFYnhYaW1oVvGRs4Mi6lZ4/fHQY0Q6AOiuts8wL1HR3FY+UkZVyd4q3DkLFODgW/+J8uftGzx/DisYG69kHXd/Y6qOR6OjdqLP0UR3Sazg+6Xr8mBq1TQvQ3tKQuMGVq4BHtkWC/R7S7+vXU3zGCNLH+69HPL7nTUfQT+I26DZ88be7Rtf/547YR9nGmM3QoLrKokZO+7uPJAHb+88ett9jHdZ7/9XM1WWiZUkP28BXMNByDvYqbrHEY7JX30bVzUK646DhIVtwCM+naTIn4kHy2o1XOgulyGczU74mDKmrbyW+A9iup1dB9m2j/BZ27QPtSapuUeaBJhfC2shqO0nEttcXUNiptcFQdAbOkO+i8G6rUTDhKz38i7lfz6Lx4huQS45E8O6Wzen+r5Q1wVMiFfqijtkXIJ47FXKQPIVs+Sf3c0VFD/hokZ9pDe7J7kefqn+upkb7YIlIu/ZaayU9G0+weollQgqNSuCRGDoZ7SaVyZ3sQwNRErQXATKhuJou0EIZb6Lx1CIBNNOrPdoF0nkON7nPsILhbRY2ih5PGiyG0c9MauekeD/UfW0qN7omjMePTqI0ASKB+Euh6YpjaXygQzKB2kUA+QO0Xcgm6J5meSyZZfGQDPrrmJ3n8NKafxgnQ84F6Cih0LoWeT+0m/mdUX/2raY5ZMJXimKjKPCWsRfZIsbSX66VFYaJw2OrGf4Xwl1z8uQb/acefOF7k+J8h/NGO/6jBCyH84ZFrlR84nq/B72uwpRW/a8W/c/y2H34zEM9x/DoXv2oepXxVg810Y/MoPPtltnK2Fb/Mxi84fs7xs1z8mxs/rcEzHD9x4V8X4uk38C8cP6bbP16Ip5puUE4txKYb8ORHScpJjh8l4YccP+D4Z47vczxRg8eP+ZTjHI/58L1cPMrx0DKncsiL78ZiI8eDHN/h+DbHAxzf4rif45sc93F8g+NeJzZUhpQGjvWvv6HUc3x9zwTl9Tfw9UXynj+FlD0Twh24Jyz/KYS7Ob5Wg7s4vsqxjuMrHHeW4st23PFSSNlRii/VupSXQljrwhdJ6BdbcTvHFzhu47jVhVs4Pv+cXXk+F5+z47OlGKFbIjW4meOmZ6zKJo7PWHHj0wnKxlJ8eoOmPJ2AGzR8yoxPclxfY1PWc6yxYTU9VF2DT6yzK090w3V2fLwV1655Q1nLcc3qCcqaN3DNInn1YyFl9QRcHZYfC+GjHFet7KWs4riyFz5C03zkWlyx3KKscONyC1bRiapSrCRNVYZwmRP/yHHpEqeylOMSJy7muIhjBcdwx8MLFyoPc1y4EBeUYvloj1Iewvkc53F8yI5zrTjHjLM5PtiKs1rxgVac2YozOE7neD/He1PwDxynOQcq00bhPRynLsS76aCM410cSzlO4TiZ46R+WNKKE604gePtHMdzHDfWrIxrxbFmvC02QbktF8dwvJVGvnUgjvbgKKYpo+JxpBtvGRaj3MKx2II3c7zpRk25ieONGo7gOJyuDOc4bKimDIvBock2ZaiGQ2x4A8fBNTioBq/neJ3UU7muFQe+gdcOxzDHARyvudqlXOPGq4scytUuLOpvU4rCHQ7sb8N+HAs59i1wK31bsaCPphS4sU++RemjYb4Fe/swz4a5V1mUXI5XWTAn26Lk2DDbgr16mpReGvY0YY9czOoeUrJKsXumS+kewkwXdssIKd2uxYwQpocsSroDQxZM4xjkmOrAFJpnigsDpehvRR9NwVeKyTb0kga9HJNaMXEgJtBBAsf4UowjTcVxjKWHYhPQw9HNMYaji25wcXTSXJ0DUVuIjlK0c7RZYxUbRyvdbY1FC0ezhiaORrrNyNHgRrUUZbookwV4kM4ip+ioKVJPZBoCR1bPSpc9yrL+f/jA/20B/pef5P8CaAoQZwplbmRzdHJlYW0KZW5kb2JqCjE2IDAgb2JqCiAgIDg4NjIKZW5kb2JqCjE3IDAgb2JqCjw8IC9MZW5ndGggMTggMCBSCiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCj4+CnN0cmVhbQp4nF1Ty27bMBC86yt4TA+BZL6UAIKBIrn40Afq9gNkcukIiCWBlg/++3I4QQr0YHO0mhnNLsn25fB6mKdNtT/zEo6yqTTNMct1ueUg6iTnaW52WsUpbB9P9T9cxrVpi/h4v25yOcxpaYZBtb/Ky+uW7+rha1xO8qVRSrU/cpQ8zWf18OflyNLxtq7vcpF5U12z36soqdh9G9fv40VUW8WPh1jeT9v9scj+MX7fV1G6Pu8YKSxRrusYJI/zWZqh6/ZqSGnfyBz/e+c8JacU3sbcDNYUateVpRl8qrgsBUfiWHDfVVyWgjWxBvbEHvwd+TtgIRZwLDkWdce6A2bdo67pr+HvWHeo98zWI5v0FZelYNYFdUOtgdaQY8DR7EWjF/PE+hMw8xvk14GcgDrzG+Q3I/EIzDwGeQzzG+R37N3V3unj4ePo76o/tbpqn6l9BmZ+g/yWs7KYlWMGhwyWfAu+I99VPj1tnRu1GlpLra1azsFiDp4+Hj6e2TyyeXp6ePbsq0dfmvuuse+GPRr0aIktsNBT4Kk5W43ZatZ1/RYz+LpfnKdgnonfTfW80dPD03EfHfbRkl8WHOCPk4qjjDv3eUfCLedyPerFrPcCN2Ka5fPurssKVf39BcVs9IoKZW5kc3RyZWFtCmVuZG9iagoxOCAwIG9iagogICA0NzcKZW5kb2JqCjE5IDAgb2JqCjw8IC9UeXBlIC9Gb250RGVzY3JpcHRvcgogICAvRm9udE5hbWUgL09aQ1FLWCtEZWphVnVTYW5zCiAgIC9Gb250RmFtaWx5IChEZWphVnUgU2FucykKICAgL0ZsYWdzIDMyCiAgIC9Gb250QkJveCBbIC0xMDIwIC00NjIgMTc5MyAxMjMyIF0KICAgL0l0YWxpY0FuZ2xlIDAKICAgL0FzY2VudCA5MjgKICAgL0Rlc2NlbnQgLTIzNQogICAvQ2FwSGVpZ2h0IDEyMzIKICAgL1N0ZW1WIDgwCiAgIC9TdGVtSCA4MAogICAvRm9udEZpbGUyIDE1IDAgUgo+PgplbmRvYmoKNiAwIG9iago8PCAvVHlwZSAvRm9udAogICAvU3VidHlwZSAvVHJ1ZVR5cGUKICAgL0Jhc2VGb250IC9PWkNRS1grRGVqYVZ1U2FucwogICAvRmlyc3RDaGFyIDMyCiAgIC9MYXN0Q2hhciAyNDMKICAgL0ZvbnREZXNjcmlwdG9yIDE5IDAgUgogICAvRW5jb2RpbmcgL1dpbkFuc2lFbmNvZGluZwogICAvV2lkdGhzIFsgMzE3IDAgMCAwIDYzNiAwIDAgMCAzOTAgMzkwIDAgMCAzMTcgMzYwIDMxNyAzMzYgNjM2IDYzNiA2MzYgNjM2IDYzNiA2MzYgNjM2IDYzNiA2MzYgNjM2IDMzNiAwIDAgMCAwIDAgMCA2ODQgMCA2OTggNzcwIDAgNTc1IDc3NCAwIDI5NCAyOTQgMCAwIDAgNzQ4IDAgNjAzIDc4NyA2OTQgNjM0IDYxMCAwIDY4NCAwIDAgMCAwIDAgMCAwIDAgMCAwIDYxMiA2MzQgNTQ5IDYzNCA2MTUgMzUyIDYzNCAwIDI3NyAwIDAgMjc3IDk3NCA2MzMgNjExIDYzNCAwIDQxMSA1MjAgMzkyIDYzMyA1OTEgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgNjEyIDAgMCAwIDU0OSAwIDYxNSA2MTUgMCAwIDAgMCAwIDAgMCAwIDYxMSBdCiAgICAvVG9Vbmljb2RlIDE3IDAgUgo+PgplbmRvYmoKMjAgMCBvYmoKPDwgL0xlbmd0aCAyMSAwIFIKICAgL0ZpbHRlciAvRmxhdGVEZWNvZGUKICAgL0xlbmd0aDEgMjYxMgo+PgpzdHJlYW0KeJzVVGtUVNcV3vd+98wA8+DOMBBRUQhe34gOgi+SIsH6tigkQltTlHEkVoOK8VFKtLFoJDGYGsdnjFVrI1o7tUZRNG0qJk2RtgZx1SatNdGkttaY1Ggy2k32YLq6Vtdq/3b1nHvOPd+333ude0kjolhaSSCzfMniVHosZQSRtl4WBxfMmb9w6JK5RBBM++fMWx7cPd0aJ+ftsm5WzJ4ZcCW8mkNk5ArOqRDC9ZK9UvBiwb0q5i9eFldIGwVvFhwzr7J8pvgdLninYOf8mcsWGJW2hYIPCE5dsGj2glH2j+RonCFSFaRTkENGUO2R7OzUNc9p3CHbHS1GrdANymw+d20Imeeunbs2OMGT5rHSPGlBg+5WodvdKxyyuz/9eJGtH2mUKb4abD7qRePyEnqTPVbFONO6uHrEeJxppm+SZd7NbfY3y2bmytbcPITyPLEuzz6v3nUNddlk6+k94YjPzH3f7+fc637zut8/WEtMv9+WoqUlpnnSPdGVnp2VPTRnVJS3RwUCslRDuHyylslnj7H9WDh88OTBcHmf3tpnB0/afFsKK8rr72bibHTVT2nav6Vv34pyeWvZ1EgtMl+jBtqu7RUUlIYsFGanfohq6QlhTmkt2lo9Q7i9dIPaRHMNtaDBIG0CZQlLdEHpdFMrpsPiY4Tm00bYbQYZU4zDxjSj0fjAaKVhRpXRapQZVVoWdqlH1F5ZI3Ba99Kb1JMatYtURcdxFVk4YRQYbrqIVjTQFYliiP8Wqqc9VC25+LRKWqFX69OEeUO10laZlSJv1XZobZLdcW0VtdNmGPo42qG1S10tdItWoVhfIfcqSw9K/m+Ir1ax30pVBql2LY5YHyDc4c57NqtzT0GGau+cN2iFRC6mPbZGm8+eLlGiHdurndKu2TbQTmrD17EQb2u1RrrxsjGO6u91AGVUL763Rm1sQW251B6d1VHv+lKjTGugq0aZfZb4Ph2tSGIe1qdJRUE6IWupzZSaRmm1WCuZRqUp1GqfYGSKvXiw10jVRJXIprlyqqaDdIgyEKJ68dRZr22YuiWW241LUnO9tk6/Ra0ooH4UNK5Lr8lHFCI6arcpA7pGA1PNsG6ND4Tzppak/rI0LWPgv8FU054apsKwa3lqY0dHYYnRTZWGVfcwrJiwYaVf+k/CSxkDJxaWpIb/MabgC69jygqEKyqRYxQJLfyYgk5ZNGhYWfKMLwunllek1pl16SPrzNkjM+RTlor1Rxtjb556/BvxuZ9QzxiKjrYLcQP/+b59/u4kd2nsO9Hvn+5ZdO72+ZxC5Obb5yNT3aVf8P8autzQoFoV/XY7R0H0f3MvHoppAFWQU/4OJm2JejUS9SR5G436yryOO4yID59Z+NSP2yHccuMTxk3G3y187MZHIdyw8GHdaPUh43oIfwvhWgR/jeAvjKsj8ed8fMB4348rl4vUlRAui+LlIrz3bqZ6L4J3M3GJ8SfGRT/+6MMfQniH8bYXv6/BhSb8jnFe1M/XoP3cWNVeg3Nj0fZWN9XGeKsbzjJ+y/gN49eM1hDOtPRQZxgtPfArP95kvF7rUa93x+kkNDNOMX7BeI3xc8bPGK8yTjJOMJoYxz04ttpSxxiNR5tUI+PokRnqaBOOrjSOvGKpIzPyOnAkz3jFwmHGT0M4xPgJI8z4MeNgAD9y48B+Sx0IYH+DV+230ODFPkl6XwQvM37I2Mv4gRd7GLt3udVuP3a58f0AdorKzhBeYux40al2MF50Yvu2ZLU9gG1bTbUtGVtNbInDZsamkEttYoRc2ChGG0N4YYNbvdAXG9z4XgTPr29SzzPW189Q65uwfqVR/5yl6megPs94zsI6xrPPDFLPMp4ZhDops2401j7tUGt9eNqBNUKsCWC1dGq1hVoPvstY9ZRHrWI85cF3GCsZKxh5HU/W1KgnGTU1+HYA1cWJqtrCtxjLGcvcWOrEkjg8wVgcQVUEiyJYGMECRiXjcca8NHyTMdeTr+YW4TFGRQ3mCAgyZjMCjHLGLMbMkSiL4FEnZjC+xvgqo7QkTpVGUBKH6UnJarofjzAelsgP56M4EUWaqYq6YJoPUyckqKmMQge+wpgy2VRTGJNNTGJMFMlExoTxppqQgPEpLjXexDgXxjK+HMKYEAoYD+kZ6qEI8psweiLyGF9iPPiAVz3owwO58eoBL3JHuVRuXkc8RrkwkjGCMXyYTw2PYFiOqYb5kJPtUDkmsh0Y2gNZLviHOJSfMcSBwZkONdiFTAcGZcSqQSYyYjHQjwH9LTUggP79vKq/hX5e9O1jqb6j0cdCb8uhesfDcqAXI51xfzzSpM40L1ID6BlBDymhRwApLnSXDnZndIugaz6SBSQzugRwn3TqPkaSGCUlI5HhYyQwvKLgZXikVk8+zBrEB+BmuJxJysVwirYzCQ5GnIlYRoyoxTDsPtgCMERoyA1IhLBg+YuaSs+AZoIYWqMWqF2nDfh/GPS/TuC/jpTPAddlx60KZW5kc3RyZWFtCmVuZG9iagoyMSAwIG9iagogICAxODYyCmVuZG9iagoyMiAwIG9iago8PCAvTGVuZ3RoIDIzIDAgUgogICAvRmlsdGVyIC9GbGF0ZURlY29kZQo+PgpzdHJlYW0KeJxdkM9qwzAMxu9+Ch3bQ3HTcwiM7pLD/tBsD+DYcmZoZKM4h7z9ZDd0MIEN0vf9zGfpa//aU8igPznaATP4QI5xiStbhBGnQKq5gAs271297WyS0gIP25Jx7slH1bagbyIumTc4vLg44lEBgP5ghxxogsP3dXiMhjWlO85IGc6q68Chl+feTHo3M4Ku8Kl3ooe8nQT7c3xtCeFS++YRyUaHSzIW2dCEqj1LddB6qU4huX/6To3e/hiu7qa4R4GKe58XrnzyGcquzJKnbqIGKREC4XNZKaZC1fMLU0ZwxwplbmRzdHJlYW0KZW5kb2JqCjIzIDAgb2JqCiAgIDIyMwplbmRvYmoKMjQgMCBvYmoKPDwgL1R5cGUgL0ZvbnREZXNjcmlwdG9yCiAgIC9Gb250TmFtZSAvU1NDR0haK0RlamFWdVNhbnMKICAgL0ZvbnRGYW1pbHkgKERlamFWdSBTYW5zKQogICAvRmxhZ3MgNAogICAvRm9udEJCb3ggWyAtMTAyMCAtNDYyIDE3OTMgMTIzMiBdCiAgIC9JdGFsaWNBbmdsZSAwCiAgIC9Bc2NlbnQgOTI4CiAgIC9EZXNjZW50IC0yMzUKICAgL0NhcEhlaWdodCAxMjMyCiAgIC9TdGVtViA4MAogICAvU3RlbUggODAKICAgL0ZvbnRGaWxlMiAyMCAwIFIKPj4KZW5kb2JqCjI1IDAgb2JqCjw8IC9UeXBlIC9Gb250CiAgIC9TdWJ0eXBlIC9DSURGb250VHlwZTIKICAgL0Jhc2VGb250IC9TU0NHSForRGVqYVZ1U2FucwogICAvQ0lEU3lzdGVtSW5mbwogICA8PCAvUmVnaXN0cnkgKEFkb2JlKQogICAgICAvT3JkZXJpbmcgKElkZW50aXR5KQogICAgICAvU3VwcGxlbWVudCAwCiAgID4+CiAgIC9Gb250RGVzY3JpcHRvciAyNCAwIFIKICAgL1cgWzAgWyA2MDAgNjg4IF1dCj4+CmVuZG9iagoxMCAwIG9iago8PCAvVHlwZSAvRm9udAogICAvU3VidHlwZSAvVHlwZTAKICAgL0Jhc2VGb250IC9TU0NHSForRGVqYVZ1U2FucwogICAvRW5jb2RpbmcgL0lkZW50aXR5LUgKICAgL0Rlc2NlbmRhbnRGb250cyBbIDI1IDAgUl0KICAgL1RvVW5pY29kZSAyMiAwIFIKPj4KZW5kb2JqCjI2IDAgb2JqCjw8IC9MZW5ndGggMjcgMCBSCiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCiAgIC9MZW5ndGgxIDc1MDAKPj4Kc3RyZWFtCnic3Vh7eFRFlq+651a/b/ftTj/S3Uk/0nQCAknIg5AESPNQHkGMwDBBiAQIzWuAaGCAhUgYx1FRRx00xgiGYAZRXjFkFcNjIkblKTAGHQV1WPExY8OwLiK2obLn3gR1/Hb223/2m/22K1W36lTVvafO43dOhVBCiIHUECCBOYtnVZ4t3HSeEIuOEOGOOb9cFhj+6iDsWytwPCVaOW/xdGHRZUIS9uKuHfN+sSo6aPLYbUqfEPOM+XNnVZj7HNQTYsf1ZPB8JJh3ax/E8UYc95m/eNnK1SMN83HcjuPyXyydM4uQPc2EOAI4rlg8a2WlpkwzEMe/xnGg8u65lWtmbfkcx02EaJ8nAonyWjHKmpBbLfHvJyJNxYUamvoy1bEHBZFkdHTGBhG5M9YZy0ywBq3hoDUYFUlXFXi7PuW1WvO1r+7W9MM9hJJo9ydsBrtM3KQw4jHJeuIESXY7d4G8S78R6jwJA01E098jd3VkKe+8cCUm8w75DastH/8yWzO8M70CLQubaShArDIJZjld1nQaShEcdlt21uA8NmPhZ9X8IT6BttLl1Z8tXHSq6u1Y7O2qU4sm5Q2hjXQujdLGIXn82LjR/NoXn/Nro8chXwIpRb7SxNXESFxkYCRB02gjjaajtrpE/UjLBBjpKEyUu2JdN1i6lPlyXkKRe0wC0DKaonHYnfjt3JxU6GFKbYXXVlRXr1i+Zs1yGqQ38338Y/4Rf5WOgdXbGxu3K5USfpjHsBymQ6gdy5AeGb2Icm9FXsJkQaSf12HTi1oS0GgTLWcDp0Jw1LcnKUFL7DaTTtKMtUu2sX6vlCynyl3FzZYppa+SZBIZMq1rqMKuIrRBJGPo0AtXhl6IZVnzsbjyM2nE4k/LTCtJq0yrSXssbXeatowOp9lZTgdqbzjFg4RSNFrsqx2FGHSo82Lb6H2Vrx3ldZTeMjG6VOB1kUnzKnE4f+T2ectaYOv8xZc+uT5VGCsleVYs2tZw/QNhbNuiFzZdf18sb5pZXklUWe/gU9mdeD6ZJKEVJLsaySmztZGd0h0119GPYE+yZ6QxYheJJMjJKPWsrCuq3C9cuHIhJl+4lNl6m6/cp1jB94wp8g6lpCb8SBWCjdfT6PjW5SepgV89uby1qWr16qqqVau2XG/VGJpml/FX+HUsr5RB3gsNDS9s27x5G8oefQpiyJuV5EWcVrNeoyXQbnzCfFS/R2vQSEQn2xRBJyiC1nW3D5nWEctCCSNrXR1W1UapYo4/FpoLYhllGeufVPi5eU+17aa+kOF0vPT7611i+d4lc4EpOvcTwtxiOdGQdyJpkCwyUUimAlMeIGjQ25LR5cICkI+ZhoFAmUi0cmdrA24UyjpcipZjWfmZxZNLtTK7qJV1vZVdnJZCI2tQ6oKMJSBkChFhqhAVaoTHhM1Cc29px3IKy5/VchmLmxGBSmAQHSSBJoFHTCV9aH/oJw4mOTQf8sVM3S3kFjoOxonlupWa++kDcD97QFNLaunT8LT4JKvXbIOX6avQp4yUJQT16ARBPzqfizrpPD6GrxDLu+Kg+W4zueF/4hsodwNa/abITXoNcfuN5I+uk5oG8ylr4Lj/WFJD6Ki1zkRCLkiU9JJxmB8keyGafazjCtqINT8/X1VEF/rnZ5euXsrvgYzIhIy0YYFhwaK0WwO3BssCZcElgSXBewL3BCvTHg48HNwU2BTcGdgZPBA4EHRk+TL9o3wR/2RfiX+Or9x/n6/Gv8H3mH+Lb7O/xdfsl8t+5O/DKBpgLiJRSmpuTp9g9g23QaUHRGFL5V3Tb5+7ni7gT41tXbfrfWqhKe/85rdVb/6s6otlNINK9NqE8aNvfXxxv/uvr9saLTu25Y29ST+7LT2dWpOS/6biANois6FMXCQ3kiiJhBrO2k45jsp7zFSQyBirJFlkBZZU/8gYqriHIoXM1nJ3jRv9gyJ76MJpPzVIZuN1kuwYm15Zo9jk7S8vOXREePH61KX0mceXeEJpO59W/XV22aUePPKiTzSxZ0kCWRzxmJnOAo1WukfXSAw6o17Qo6PKNvMUew8AFTfLU6YXN1uVxjZlOrqJWcGjoR1dQzs6bKqOOmJXhipgpABRYhEpSkDjJGCRLdYSoQRKHOVCOejRaqjCstXuLMQOytgasmZbhWx6F390+Iy9/ETnSy0t7Fl+qJvw8MS8bvJSJz1LCR3+PZ4bUHZ25H5UJEgcf6L647pO1mCi7yU22I6a6pK8DkHnkMhoQbIUJqEYr8Q6VLhUEP6CzK9cki8pESe5KFmRpSPoo0qAsX4fegKE9WicGbr2SRsfvuti9Vq+lp/iu2kxTaE6Oow/tqJ8/q9kITt6zz2jRvNY5iCaiw5gowX80IZo9fIlPbY/A3k1a+wqHg6JeH/AwzrzUfocqEgYQUwsTFa5zFIAJ/ZTMFSFpVqjwhxqGVQYDKnWClvpfF43vmX5SX6VGk4u27MFgbDq7lWrYL9Q+m1sy5wZdBwFLOPKuo4oSKiioaJ7A9rgQnYGI392xKwR2skjIh0CTjKE6eTO4mYD6tusapkpWlYjZAaymElbInqKfq+qMGhg5dyKspHZGf7hdxPFFvXdC9HnZ6OO0si5SEQyCWbjYJ/fxzRanZ6JhsF+vy9sMPr8iEDHaadoP+7oTGywig1hhIG+PoPR79WSyd5JZru2JOXWvgoOdMYuoAZVIOjJHL6+JH99yebqxUXzRQx+vY9pKS06I6VlkTv1er1BbzSajJLewkIek0fymBMtA3Tp+nRDujHdlC71C+TrCvWFhkJjgalAKtaPN4w3jjeNlVaYVkhtujZ9m6HN2GZqk8JmjVlr1pn1ZoNkzJOK+s3s12PGPQ5od/qp6HTYRTTmNKtqTaigDIwXuTmDleDqqnp3ZnRO8awimnCQX+PxpRerF51ftmDhuMVFf2u/0jXnA3EYv5yZmZ3bP92oD23evqc1FKJyTk5BfmaGpPNt+X3LDh/p7ialfKmYK662pRIHIbKWOAlmjgpdwVhNPtK1mF1qEVfaUA+6VmNRpl/bf5Bqi5ifaaKYnyl5UBbmQbtsZJdpo5IHDbTkwUBH/5/kQREjcbsSZHeGu8jNFHDsScRsuTnCj5MhiDYfOtT80qFDL9H5tI6jMfKn+Tz6tPg+74p9ybuo+GWMitTFK/iTvJZX0I10IV1EN/bkC9jY0D+U/LMfWuGHZI/4nMAoQqKsk7uGqhEYHSMzoi/Rl+sr9TV68Qfb20GjCsrxerH8u80aOz/X43P8FmYWV6HH9SXFkdQkCxDHcWenu8GW3Gg6pT8q7Qk12j4gpyDVRCRzxBEYqSnsdyPWKHHmQo8HookpJodueFP5Tb2ZaQrJzVE80JUbVATwg7bhx6niVnTHE/wKNZ1Y3jIe3XM737+gY86drdObm2JL16ysqlyz5uDsGXRU/Ds6YsacrV1W/hX/JBCkrsG59U2gaaqtb2h6srYJz7IfU4N89FEd6iw94iDt+kdou1MnOA2EDZTTiVMPPVqz9viGKquWEjdVUKOHmxANBkSX0+awC1qN2I8Kw9bHvr128frXtJZOobeuWBCNLljJm7EsFFu67vrrxx99QUOzls3l155/gX8zd9ksxZ8V+0K7w9w+L+JRfdZ8XOo0NFrFRhf6rEc7UiL2wr/P7a8oHprZOtO71quC2A1X+XuoRefIHbfhttrnn6+d8lRkys6f89P8RTqVZpRuR584l5W5e9Om3VmD+Fm/n+ZRB5Y8vxq7qIYvFY5hLwFjqMmglzQkQU9k0Nvlzs7jmA6jNDqPdx7PpAqWlR4g9u52PIkdS2SINW/INER9h12DIT6D3vDYNOGOgrzVazOjOTRrcrBgRP+BwxdmzJwuSXWyJb2vZ9JQRRZNzAszNPnER45E7C6rDHZJRwkkMXeiXTLomX0/TSJJ1EsYTYpYpDf8VioTnavGrasx+NWrVK+y5CuoOLQwq1pdas0kxc36XuQ9QPwqy34sPSxHpuiJnmJgBpPJJJnMJotJNllNNlOCyW5yWJwWlyXR4rZ49D4P8VCP4IEe0PNavLLX6rV5E7x2r8Pv9Lv8iX633+Px9XUYqZL5pKWmKQElmYZUwPL3iGQYzVYlJAh5oibD3Sf1oXllfcb1G+YMW/r0Vfqj2JSwIPqHF+oeeMLr62+RI/nYSyQ92QUQ5TZsIqIwEZ8+jIKAKcNa0k0n01l0Jb2H/k54UzgXSA1kBgoCO4IpiGR4TyWb6SRajvPVvfMJOJ///fw//lH8xjlajwjzLJbNveVNLIfpYZw3/re7/6c/xYb+q5/1+570D/dq1dakxF60W0JsvXRADxeIiD2GEsIbP94W/q/+5N6n5Z/FAF41smkUsfEv2B9GtpA4+JVbEIkiVXnuoFNIDOdn48p14n0Ic1G6WEQ8xfm14gl8hUCzyWxyF/bCYhPdj9HyU9y9jj7CxrI7lNXqh5R3XWWv08ssX8gnpeJicZjYIq4TW3DFcjEqriPN2OYLp8WN4mrxJOJjqcIZnaBUNbrV0/E0ROqFejqauulo4QR5TeW/CK20kB1jx8gZcoaW4ModZIVgoG/Rr/ACUUpbcNdVcpX6cZQr5NJL9HPkuI6chlJmIPXkUWrD0X5yAvn+lHxFqvAKESWPsjNCf4wWr5Pz5D2kE7KQCtgmw0B2Bstlso0sRMmcx+vnGY1dGxSjwjUSo/cKW4VrNEQFLDbqR2neCSfEcvEt8UGcRelQAbLBDyOxnaGsYGdoPXJxXhOlq3CdUlbjd2LC68JePONB8iGeC78uzBBWC/XkQ7qLtlHF1u+ju8Ry7WzRS+o19WIpuaTIhpwWTqA8SlR5PEQe0gwiV0UNuQwTaLm4TZEYCbPXMP8PasdrbHgLHa+9F09CII+sVn3xCCXstZ6Cq3SaZFIrpsGzyLsgVN+QG11FTgj5MJtsVMsGupdswOypiuArIPUVrYaJePkmAwJysxAeV9Ecub00cHhacOCAnwwDsjbQTEqapVWBvd3dJaWil01rZknNENY1i+HQ+X80eX7ggOKS0sBe2vfm0b2vvbl8NBInl2JXGSEZ6TePVueUrzazMP6NK28OzJkfWC+vDxWsl+cWDFRRVbhzrys0YexMy9CviV+nmus77xsCN57f3N21y3JCPxfXKpO0x3EQgBbzZHTh4Dd3f5tlOdFL/+GXiN4RZR9jXUtKdVPJi6yN7ICvyA6WR/wsSkpZC47fIV62mJQKRxCu2sgMtpwYxNfJQvEgzuMaDb5DOIh7cE7TRPYrdLRPDcJbU+93JmC9gAxV4kFKsMZQmxWEiFjZyh7w07Qit+W9tQuT2VJC9M1YEcn1uN5Qg7UTQX0zAmpfrJgrSTnK/03VUyXCRNKfrESsFRCxIooU2EUhiE9xxK+FGppKOAEaRtQG2ocGSQGG6z4kjqMQZtWAt7weWoq6TukDDajzfrIPWx+pwDZZnU3CvAgw4Puw9agUt9omqq1LbZ1q66B2xHdGHepI6QNNUPs2tbVQM6nGeYs6UvpAJWoiDyNNUmkSaSciNVEjmYY0ZQawrUGakRpIKtKUGcA2gjSFAlSv7tSprRYlorTKDk3LU+lsRALVqOdiaiuqq0A9kaBSqNqSSHc1dA8HzqHruwGsi8N3AyDO4dtrY9i31XBtDHwTh6scvuZwhcN/7IOvOPw7h8sc/uaDSxwuxgzsIoeYAWIR8cu/GtiXWfBXA/wlDl887mRfcPg8Dp/F4VMcfMrhAodPOPwbh/Mc/szhYw4fxeHDc4nswwo4lwhnN/vY2Qr44P0w+yAO74fhT6fD7E9xeO9dO3vPCe+ekdm7djgjQ+c7RtYZgHeM8Edc8cc4nMb3nw7DqSdM7FQITr5tZydT4e0TNva2HU7Y4DhOH0+GY3Y4emQfO8rhyOEydmQfHKkRD0e63wqzw2VwOCK+FYY3ObxRAR2PyayDw+tJcIjDaxza/1DA2uPwh51e9ocCOHjAww5mwYH9VnbAA/v3Wdh+K+xrM7F9Fmgzwav4sVc57OXwigNetsG/cmjlsIdDiwteckOzE3bje3bHYRc+dsVhJ67f6YUd+NhRDds5vJgKL3DYxuF5Dls5/N4ATRye22Jmz3HYYoYtEbERBdUYh824ZbMPGvDREIdn8fDPJsEmDhuf2cc2cnimvow9sw+eqRHrHw2z+jKoj4hPc6hD66jj8FQ61OLGWl+kG57ErU8G4AkTbEDShmL4HT5+x+FxlMPjTnhMhkfD8FsOj3B4mMNDHNZzeJDDA/eH2QMc7g/Dbzjcx+HXWXBvLfyKwzoONW5Ya4B7OFRzWMNhdRz+JQ6rOKz45Va2gsMvt8LyZV62PA7LvFAVh7ur4S4OlUsHsKUDYEkcFsfhF3FYxGEhhwUc5s8xsflZMI9DNAvmVhjYXA4VBqiIiHNmG9gcE8w2wKxyB5tVC+XUysodMNMAd3Io4xjZrGwGh+l3eNl0Dnfg6A4vTONQGoefc5iK40j3VA4/4zDFB5PtMOl2N5sUh9tx4nY3lNzmZiVxuG2ild3mholWuNUHE4rtbIIDisdbWbEdxo8zs/FWGGeGsXEYc4udjXHALXa4OQ6jR5nZaAuMMsPIEWE2Mg4j8J0jwhApsrAIh6LhZlZkgeFmGDZUYsOcMFSCwgoo4JBvhyEc8hJgcK6HDQ5Dbo6d5Xogt13MMUgsxw45NWJ2loll2yE7ImaZYFDmVjaIQya+P3MrZJggPQEGDihgA+MwwBFmAwqgfwXcVAH9OPR1QJrLytJ8kBqAsA/6hFAA/fv4IGSFFCKxlDgELRCMiAE7+A3g80FykpslhyHJksCS3JC0FzHjcdErgcddzDzV4MaPuoshkYPLCk78mjMODqQ5wmCvgAQr2DhYcWzlIFeAxSwzSwJY2kWzDOYaUcIZKQ6mLDDi0YxOMNaIBgkMEVHPQcdBy0HDDEzDgRmARUQxDlCBAd3KBI7oJTFqBSIB3Usr7nuE9v//8SP/bAb+F3/J5D8BQW8xlQplbmRzdHJlYW0KZW5kb2JqCjI3IDAgb2JqCiAgIDUyMzIKZW5kb2JqCjI4IDAgb2JqCjw8IC9MZW5ndGggMjkgMCBSCiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCj4+CnN0cmVhbQp4nF2Sy26EMAxF9/kKL6eLEY/y0EgIqZpuWPSh0n4AkxgaqYQoMAv+vnY8mkpdgE/sa8vckJy7587ZDZL3sOgeNxitMwHX5Ro0wgUn61SWg7F6u53iW8+DVwk19/u64dy5cVFNA8kHFdct7HB4MssFHxQAJG/BYLBugsPXuZdUf/X+B2d0G6SqbcHgSONeBv86zAhJbD52hup224/U9qf43D1CHs+ZrKQXg6sfNIbBTaiaNG2hGcdWoTP/ankqLZdRfw9BNcUjSdOUgmqqMTIFYiNsiOs0MgXiXDhnroQr1meiz5hRGFlTiKbgfCn5kjiXmTnPrERTsaYULplr2a3m3bCOTIFY8sj5QnYu4s4nmXNiFn3F+kJmUmBDbl/O1vAd3j3X1xDI7njR0Wd22Dq8/wt+8dwVn18CZZ1jCmVuZHN0cmVhbQplbmRvYmoKMjkgMCBvYmoKICAgMzE2CmVuZG9iagozMCAwIG9iago8PCAvVHlwZSAvRm9udERlc2NyaXB0b3IKICAgL0ZvbnROYW1lIC9CTE5BUlErRGVqYVZ1U2Fucy1Cb2xkCiAgIC9Gb250RmFtaWx5IChEZWphVnUgU2FucykKICAgL0ZsYWdzIDMyCiAgIC9Gb250QkJveCBbIC0xMDY5IC00MTUgMTk3NSAxMTc0IF0KICAgL0l0YWxpY0FuZ2xlIDAKICAgL0FzY2VudCA5MjgKICAgL0Rlc2NlbnQgLTIzNQogICAvQ2FwSGVpZ2h0IDExNzQKICAgL1N0ZW1WIDgwCiAgIC9TdGVtSCA4MAogICAvRm9udEZpbGUyIDI2IDAgUgo+PgplbmRvYmoKNyAwIG9iago8PCAvVHlwZSAvRm9udAogICAvU3VidHlwZSAvVHJ1ZVR5cGUKICAgL0Jhc2VGb250IC9CTE5BUlErRGVqYVZ1U2Fucy1Cb2xkCiAgIC9GaXJzdENoYXIgMzIKICAgL0xhc3RDaGFyIDIzMQogICAvRm9udERlc2NyaXB0b3IgMzAgMCBSCiAgIC9FbmNvZGluZyAvV2luQW5zaUVuY29kaW5nCiAgIC9XaWR0aHMgWyAzNDggMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCA3MzMgODMwIDAgMCAwIDAgMCAwIDAgMCAwIDAgODUwIDAgMCAwIDAgNjgyIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDY3NCAwIDAgNzE1IDY3OCAwIDcxNSAwIDM0MiAwIDAgMCAxMDQxIDcxMSA2ODcgNzE1IDAgNDkzIDU5NSA0NzggMCA2NTEgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgNjc0IDAgMCAwIDU5MiBdCiAgICAvVG9Vbmljb2RlIDI4IDAgUgo+PgplbmRvYmoKMSAwIG9iago8PCAvVHlwZSAvUGFnZXMKICAgL0tpZHMgWyAyIDAgUiBdCiAgIC9Db3VudCAxCj4+CmVuZG9iagozMSAwIG9iago8PCAvUHJvZHVjZXIgKGNhaXJvIDEuMTYuMCAoaHR0cHM6Ly9jYWlyb2dyYXBoaWNzLm9yZykpCiAgIC9BdXRob3IgKCkKICAgL0tleXdvcmRzICgpCiAgIC9DcmVhdGlvbkRhdGUgKEQ6MjAyMDA4MTAxMjE5MDlaKQo+PgplbmRvYmoKMzIgMCBvYmoKPDwgL1R5cGUgL0NhdGFsb2cKICAgL1BhZ2VzIDEgMCBSCj4+CmVuZG9iagp4cmVmCjAgMzMKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDI0MDE1IDAwMDAwIG4gCjAwMDAwMDE1NDggMDAwMDAgbiAKMDAwMDAwMTM2MiAwMDAwMCBuIAowMDAwMDAwMDE1IDAwMDAwIG4gCjAwMDAwMDEzMzkgMDAwMDAgbiAKMDAwMDAxMzU4NCAwMDAwMCBuIAowMDAwMDIzMzU1IDAwMDAwIG4gCjAwMDAwMDE3NjYgMDAwMDAgbiAKMDAwMDAwMjc1OCAwMDAwMCBuIAowMDAwMDE3MTQ3IDAwMDAwIG4gCjAwMDAwMDI2ODUgMDAwMDAgbiAKMDAwMDAwMjY2MiAwMDAwMCBuIAowMDAwMDAzNjc3IDAwMDAwIG4gCjAwMDAwMDM2NTQgMDAwMDAgbiAKMDAwMDAwMzc1MCAwMDAwMCBuIAowMDAwMDEyNzA5IDAwMDAwIG4gCjAwMDAwMTI3MzMgMDAwMDAgbiAKMDAwMDAxMzI4OSAwMDAwMCBuIAowMDAwMDEzMzEyIDAwMDAwIG4gCjAwMDAwMTQzMzQgMDAwMDAgbiAKMDAwMDAxNjI5MiAwMDAwMCBuIAowMDAwMDE2MzE2IDAwMDAwIG4gCjAwMDAwMTY2MTggMDAwMDAgbiAKMDAwMDAxNjY0MSAwMDAwMCBuIAowMDAwMDE2OTEyIDAwMDAwIG4gCjAwMDAwMTczMDggMDAwMDAgbiAKMDAwMDAyMjYzNiAwMDAwMCBuIAowMDAwMDIyNjYwIDAwMDAwIG4gCjAwMDAwMjMwNTUgMDAwMDAgbiAKMDAwMDAyMzA3OCAwMDAwMCBuIAowMDAwMDI0MDgwIDAwMDAwIG4gCjAwMDAwMjQyMjIgMDAwMDAgbiAKdHJhaWxlcgo8PCAvU2l6ZSAzMwogICAvUm9vdCAzMiAwIFIKICAgL0luZm8gMzEgMCBSCj4+CnN0YXJ0eHJlZgoyNDI3NQolJUVPRgo=",
  "source_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "00022",
    "financial_institution_compe_number": 329,
    "financial_institution_name": "QI Sociedade de Crédito Direto S.A",
    "owner_document_number": "32402502000135",
    "owner_document_number_formatted": "32.402.502/0001-35",
    "owner_name": "QI SCD S.A."
  },
  "source_subtype": "incoming_credit_card_settlement",
  "target_account": {
    "account_branch": "0001",
    "account_digit": "0",
    "account_number": "07834",
    "financial_institution_compe_number": 329,
    "financial_institution_name": "QI Sociedade de Crédito Direto S.A",
    "owner_document_number": "99195609000120",
    "owner_document_number_formatted": "99.195.609/0001-20",
    "owner_name": "Giba"
  },
  "transacted_at": "2020-08-07 14:45:51",
  "transacted_at_br": "2020-08-07 11:45:51",
  "transacted_at_br_formatted": "07/08/2020, 11:45:51",
  "transacted_at_formatted": "07/08/2020, 14:45:51",
  "transaction_amount": 93.84,
  "transaction_amount_formatted": "R$ 93,84",
  "transaction_key": "bcebffa1-bab5-45b0-b0a2-894f45fcc004"
}
```

STATUS 400

Response Body

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

```

---

# Consult Transactions (Statement)

URL: /en/documentation/movimentacao_de_contas/consulta_de_transacoes

## Request

ENDPOINT /account/ ACCOUNT_KEY /transaction
METHOD GET

### Request Path Params

| Field          | Type   | Description                          |
|----------------|--------|--------------------------------------|
| `account_key` *| string | Unique key for identifying the QI account |

### Query Params

| Field      | Type    | Description                                                     |
|------------|---------|-----------------------------------------------------------------|
| `date_from`| string  | Start date. Format "YYYY-MM-DD"                                 |
| `date_to`  | string  | End date. Format "YYYY-MM-DD"                                   |
| `order_by` | string  | "asc" for ascending order or "desc" for descending order. "desc" by default |
| `page`     | integer | Requested page number. 1 by default                             |
| `page_size`| integer | Requested page size in the query. 4000 by default               |

## Response

STATUS 200

:::info About the Transaction Details field
This field is an object with specific information regarding the type of transaction performed (bank slip payment, TED, or Pix).
:::

Response Body: Pix Transactions

```json
{
    "data": [
        {
            "account_balance": 22403.11,
            "agent_person_key": null,
            "created_at": "2023-11-24 19:10:54",
            "description": "329 0001 000002-5 32.402.502/0001-35 QI SOCIEDADE DE CR\u00c9DITO DIRETO S.A.",
            "origin_key": "4983e0ad-2212-44f9-8ab9-c243f72f90a8",
            "source_subtype": {
                "enumerator": "internal_pix_transfer",
                "translation_ptbr": "Transfer\u00eancia de PIX"
            },
            "transacted_at": "2023-11-24 19:10:54",
            "transaction_amount": 1,
            "transaction_details": {
                "payer_account_branch": "0001",
                "payer_account_digit": "7",
                "payer_account_number": "5267641",
                "payer_document_number": "98765432100",
                "payer_ispb": "32402502",
                "payer_name": "Eduardo Spada",
                "receiver_account_branch": "0001",
                "receiver_account_digit": "5",
                "receiver_account_number": "000002",
                "receiver_conciliation_id": null,
                "receiver_document_number": "32402502000135",
                "receiver_ispb": "32402502",
                "receiver_name": "QI SCD S.A."
            },
            "transaction_key": "b71ea9a3-e012-4761-bea6-e65c6bfc228f"
        }
    ],
    "pagination": {
        "current_page": 1,
        "next_page": null,
        "rows_per_page": 30,
        "total_pages": "unavailable",
        "total_rows": null
    }
}
```

Response Body: TED Transactions

```json
{
    "data": [
        {
            "account_balance": 22403.11,
            "agent_person_key": null,
            "created_at": "2023-11-24 19:10:54",
            "description": "329 0001 000002-5 32.402.502/0001-35 QI SOCIEDADE DE CR\u00c9DITO DIRETO S.A.",
            "origin_key": "4983e0ad-2212-44f9-8ab9-c243f72f90a8",
            "source_subtype": {
                "enumerator": "incoming_funds_transfer",
                "translation_ptbr": "Transferência de Entrada"
            },
            "transacted_at": "2023-11-24 19:10:54",
            "transaction_amount": 1,
            "transaction_details": {
                "receiver_account_number": "7212399",
                "payer_account_branch": "120",
                "payer_account_number": "84598",
                "receiver_name": "QI SCD S.A.",
                "receiver_account_branch": "2",
                "payer_document_number": "23846749289329",
                "payer_account_digit": "4",
                "payer_ispb": "61231190",
                "receiver_ispb": "32402502",
                "receiver_document_number": "02983510938761",
                "payer_name": "ASICS BRASIL DISTRIBUICAO E CO",
                "receiver_account_digit": "3"
            },
            "transaction_key": "b71ea9a3-e012-4761-bea6-e65c6bfc228f"
        }
    ],
    "pagination": {
        "current_page": 1,
        "next_page": null,
        "rows_per_page": 30,
        "total_pages": "unavailable",
        "total_rows": null
    }
}
```

Response Body: Pix Payment Transactions

```json
{
    "data": [
        {
            "account_balance": 22403.11,
            "agent_person_key": null,
            "created_at": "2023-11-24 19:10:54",
            "description": "329 0001 000002-5 32.402.502/0001-35 QI SOCIEDADE DE CR\u00c9DITO DIRETO S.A.",
            "origin_key": "4983e0ad-2212-44f9-8ab9-c243f72f90a8",
            "source_subtype": {
                "enumerator": "bank_slip_payment",
                "translation_ptbr": "Pagamento de Boleto"
            },
            "transacted_at": "2023-11-24 19:10:54",
            "transaction_amount": 1,
            "transaction_details": {
                "beneficiary_legal_name": "COATIOSUERRA LTDA",
                "barcode": "34191954500001165778979877821520910001098000",
                "digitable_line": "34312123124532455091500010980001195450000116579",
                "beneficiary_document_number": "61148052000102"
            },
            "transaction_key": "b71ea9a3-e012-4761-bea6-e65c6bfc228f"
        }
    ],
    "pagination": {
        "current_page": 1,
        "next_page": null,
        "rows_per_page": 30,
        "total_pages": "unavailable",
        "total_rows": null
    }
}
```

Response Body: Card Settlement Transactions

```json
{
    "data": [
        {
            "account_balance": 22403.11,
            "agent_person_key": null,
            "created_at": "2023-11-24 19:10:54",
            "description": "Nome da Credenciadora 12345678000195 - Elo Débito - Liquidação",
            "origin_key": "4983e0ad-2212-44f9-8ab9-c243f72f90a8",
            "source_subtype": {
                "enumerator": "incoming_debit_card_settlement",
                "translation_ptbr": "Liquidação de cartão de débito"
            },
            "transacted_at": "2023-11-24 19:10:54",
            "transaction_amount": 1,
            "transaction_details": {
                "merchant_name": "Nome do Merchant",
                "merchant_document_number": "87654321000198",
                "acquirer_name": "Nome da Credenciadora",
                "acquirer_document_number": "12345678000195",
                "product_type": "ECD",
                "product_description": "Elo Débito"
            },
            "transaction_key": "b71ea9a3-e012-4761-bea6-e65c6bfc228f"
        }
    ],
    "pagination": {
        "current_page": 1,
        "next_page": null,
        "rows_per_page": 30,
        "total_pages": "unavailable",
        "total_rows": null
    }
}
```

Response Body: Card Purchase Transactions

```json
{
    "data": [
        {
            "account_balance": 20003.01,
            "agent_person_key": null,
            "created_at": "2023-11-24 19:10:54",
            "description": "Cartão físico | Nome do Estabelecimento | SAO PAULO - BR | U3UUUU",
            "origin_key": "c9f31beb-dafa-42c2-9a16-0854c523eabd",
            "source_subtype": {
                "enumerator": "card_purchase",
                "translation_ptbr": "Compra com Cartão"
            },
            "transacted_at": "2023-11-24 19:10:54",
            "transaction_amount": 17,
            "transaction_details": {
                "acquirer_code": "000000",
                "merchant_mcc": "0000",
                "merchant_name": "Nome do Estabelecimento",
                "authorization_code": "U3UUUU",
                "merchant_address": {
                    "postal_code": "00000123",
                    "city": "SAO PAULO",
                    "country": "BR"
                },
                "merchant_currency": "BRL",
                "merchant_amount": "17.00",
                "card_transaction_type": "purchase",
                "card_type": "plastic"
            },
            "transaction_key": "b71ea9a3-e012-4761-bea6-e65c6bfc228f"
        }
    ],
    "pagination": {
        "current_page": 1,
        "next_page": null,
        "rows_per_page": 30,
        "total_pages": "unavailable",
        "total_rows": null
    }
}
```

:::info About the next_page field
The `next_page` field within the `pagination` object indicates the next page available for querying. If there are no more pages available, the returned value will be `null`.
:::

:::caution Attention!
The field `product_type` contained in the `transaction_details` object of Credit Card Settlement Transactions is a field informed by the Card Settlement System and may be returned with the value `null`.
For these cases, the `product_description` field should be read to identify the settlement `product_type`. 
:::

### Enumerators product_type
| Enumerator                    | Description                                               |
|-------------------------------|-----------------------------------------------------------|
| ACC                           | American Express Crédito                                  |
| BCC                           | Banescard Crédito                                         |
| BCD                           | Banescard Débito                                          |
| BVV                           | Ben Visa Vale Pré-pago                                    |
| CAC                           | Cielo Amex Crédito                                        |
| CBC                           | Cabal Crédito                                             |
| CBD                           | Cabal Débito                                              |
| CBP                           | Cabal Pré-pago                                            |
| CC3                           | Central de Cessões de Crédito                             |
| CDC                           | Cielo Diners Cartão de Crédito                            |
| CEC                           | Cielo Elo Cartão de Crédito                               |
| CED                           | Cielo Elo Cartão de Débito                                |
| CHC                           | Cielo Hipercard Crédito                                   |
| CMC                           | Cielo Mastercard Crédito                                  |
| CMD                           | Cielo Mastercard Débito                                   |
| COP                           | COPASA - Companhia de Saneamento de Minas Gerais          |
| CUP                           | Cup Crédito                                               |
| CZC                           | Credz Crédito                                             |
| DCC                           | Liquidações Transfronteiriças Diners Crédito              |
| ECB                           | Elo PAT - Cartão de Benefícios                            |
| ECC                           | Elo Crédito                                               |
| ECD                           | Elo Débito                                                |
| GCC                           | Goodcard Crédito                                          |
| GDC                           | Global Payments Diners Crédito                            |
| GMC                           | Global Payments MasterCard Crédito                        |
| GMD                           | Global Payments MasterCard Débito                         |
| GVC                           | Global Payments VISA Crédito                              |
| GVD                           | Global Payments VISA Débito                               |
| HCC                           | Hipercard Crédito                                         |
| HCD                           | Hiper Débito                                              |
| JCC                           | JCB Crédito                                               |
| MAC                           | Mais Cartão de Crédito                                    |
| MCA                           | MasterCard Cartão ATM                                     |
| MCC                           | Mastercard Crédito                                        |
| MCD                           | Maestro Débito                                            |
| MCP                           | Mastercard Pré-pago                                       |
| NBA                           | Neoenergia - Companhia de Eletricidade do Estado da Bahia |
| NBR                           | Neoenergia - Distribuição Brasília S.A                    |
| NEK                           | Neoenergia - Elektro Redes S/A                            |
| NPE                           | Neoenergia - Companhia Energética de Pernambuco           |
| NRN                           | Neoenergia - Companhia Energética do Rio Grande do Norte  |
| OCD                           | Ourocard Débito                                           |
| OT                            | Produto Liquidação Outras Transferências                  |
| PCA                           | Plataforma Centralizada de Arrecadação                    |
| SCC                           | Sorocred Crédito                                          |
| SCD                           | Sorocred Débito                                           |
| SLC                           | Serviço de Liquidação Centralizada                        |
| STC                           | SELTEC                                                    |
| TCB                           | Tecban                                                    |
| TED                           | Produto Liquidação TED                                    |
| VCA                           | Visa Cartão ATM                                           |
| VCC                           | Visa Crédito                                              |
| VCD                           | Visa Electron Débito                                      |
| VCP                           | Visa Pré-pago                                             |
| VDC                           | Verdecard Crédito                                         |
| VDP                           | Verdecard Pré-pago                                        |
| VIA                           | Visa Internacional Saque ATM                              |
| VIC                           | Visa Internacional Compra Crédito                         |
| VID                           | Visa Internacional Compra Débito                          |
|| Alelo Pré-pago                |
|| Agiplan Crédito               |
|| Aura Crédito                  |
|| Calcard Crédito               |
|| Credsystem Crédito            |
|| Redesplan Crédito             |
|| Sicred Crédito                |
|| Avista Crédito                |
|| Discover Crédito              |
|| Sicredi Débito                |
|| Hiper Crédito                 |
|| Ticket Pré-pago               |
|| Sodexo Pré-pago               |
|| VR Pré-pago                   |
|| Policard Pré-pago             |
|| Valecard Pré-pago             |
|| Greencard Pré-pago            |
|| Coopercard Pré-pago           |
|| Verocheque Pré-pago           |
|| Nutricash Pré-pago            |
|| Banricard Pré-pago            |
|| Socored Pré-pago              |
|| Cielo Arranjo Fechado Crédito |
|| Cielo Arranjo Fechado Débito  |

### Enumerators for source_sub_type

| Enum                                       | Description                                     |
|--------------------------------------------|-------------------------------------------------|
| operation_disbursement                     | Operation Disbursement                          |
| protest_expense                            | Protest Expenses                                |
| automatic_integrated_payment               | Automatic Integrated Payment                    |
| tax                                        | Taxes                                           |
| electronic_funds_fee                       | TED Fee                                         |
| credit_operation_fee                       | Credit Opening Fee                              |
| internal_funds_transfer                    | Internal Transfer                               |
| incoming_funds_transfer                    | Incoming Transfer                               |
| outgoing_funds_transfer                    | TED                                             |
| deposit                                    | Deposit                                         |
| withdrawal                                 | Withdrawal                                      |
| withdrawal_reversal                        | Withdrawal Reversal                             |
| trade_funds_transfer                       | Assignment Payment Transfer                     |
| settlement_funds_transfer                  | Settlement Transfer                             |
| bank_slip_fee                              | Bank Slip Fee                                   |
| bank_slip_settlement                       | Bank Slip Settlement                            |
| outgoing_funds_transfer_reversal           | TED Reversal                                    |
| incoming_funds_transfer_refusal            | Transfer Refused                                |
| electronic_funds_fee_reversal              | TED Fee Reversal                                |
| monthly_account_fee_reversal               | Account Maintenance Fee Reversal                |
| bank_slip_fee_reversal                     | Bank Slip Fee Reversal                          |
| correspondent_bank_transfer                | Correspondent Bank Transfer                     |
| credit_analysis_fee                        | Credit Analysis Fee                             |
| credit_operation_fee_reversal              | Credit Opening Fee Reversal                     |
| financial_investments_income               | Financial Application Income                    |
| bank_slip_settlement_reversal              | Bank Slip Settlement Reversal                   |
| bank_slip_settlement_expense_reversal      | Bank Slip Settlement Fee Reversal               |
| bank_slip_settlement_incoming_reversal     | Bank Slip Settlement Incoming Reversal          |
| correspondent_bank_transfer_reversal       | Correspondent Bank Transfer Reversal            |
| credit_analysis_fee_reversal               | Credit Analysis Fee Reversal                    |
| doc_expense_reversal                       | DOC Fee Reversal                                |
| incoming_doc_reversal                      | DOC Incoming Reversal                           |
| operation_disbursement_reversal            | Operation Disbursement Reversal                 |
| operation_settling_reversal                | Operation Payment Reversal                      |
| outgoing_doc_reversal                      | DOC Outgoing Reversal                           |
| rebate_reversal                            | Rebate Reversal                                 |
| settlement_funds_transfer_reversal         | Settlement Transfer Reversal                    |
| tax_reversal                               | Tax Reversal                                    |
| trade_funds_transfer_reversal              | Assignment Payment Transfer Reversal            |
| bank_slip_permanency_fee                   | Title Permanence Fee                            |
| bank_slip_cancel_protest_fee               | Title Permanence Fee                            |
| bank_slip_protest_fee                      | Protest Request Fee                             |
| bank_slip_notary_office_fee                | Protest Costs                                   |
| bank_slip_registration_fee                 | Registration Fee                                |
| bank_slip_extension_fee                    | Extension Fee                                   |
| bank_slip_rebate_fee                       | Rebate Fee                                      |
| bank_slip_discount_fee                     | Discount Fee                                    |
| bank_slip_settlement_fee                   | Settlement Fee                                  |
| bank_slip_write_off_term_fee               | Write-off Due Date Fee                          |
| bank_slip_write_off_fee                    | Write-off Fee                                   |
| bank_slip_cancel_protest_write_off_fee     | Protest Sustenance with Write-off Fee           |
| bank_slip_notary_office_settlement_fee     | Notarial Office Settlement Fee                  |
| rebate_tax_free                            | Pass-through Settlement                         |
| rebate_tax_free_reversal                   | Pass-through Settlement Reversal                |
| incoming_funds_transfer_reversal           | Internal Transfer Reversal                      |
| bank_slip_payment                          | Bank Slip Payment                               |
| bank_slip_payment_reversal                 | Bank Slip Payment Reversal                      |
| warranty_analysis_fee                      | Guarantee Analysis Fee                          |
| bank_slip_settlement_deposit               | Bank Slip Settlement                            |
| bank_slip_payment_withdrawal               | Bank Slip Payment                               |
| account_setup_fee                          | Account Opening Fee                             |
| account_setup_fee_reversal                 | Account Opening Fee Reversal                    |
| bank_slip_payment_withdrawal_reversal      | Bank Slip Payment Reversal                      |
| incoming_anticipation_of_receivable        | -                                               |
| incoming_credit_card_settlement            | Credit Card Settlement                          |
| incoming_debit_card_settlement             | Debit Card Settlement                           |
| assignment_automatic_transfer              | Automatic Assignment Debit                      |
| assignment_automatic_transfer_reversal     | Automatic Assignment Debit Reversal             |
| pix_fee                                    | PIX Fee                                         |
| pix_fee_reversal                           | PIX Fee Reversal                                |
| pix_deposit                                | PIX Deposit                                     |
| pix_withdrawal                             | PIX Transfer                                    |
| pix_withdrawal_reversal                    | PIX Transfer Reversal                           |
| pix_chargeback_withdrawal                  | PIX Chargeback Sending                          |
| outgoing_pix_chargeback                    | PIX Chargeback Outgoing                         |
| incoming_pix_chargeback                    | PIX Chargeback Incoming                         |
| pix_chargeback_deposit                     | PIX Chargeback Deposit                          |
| pix_chargeback_withdrawal_reversal         | PIX Chargeback Sending Reversal                 |
| outgoing_pix_chargeback_reversal           | PIX Chargeback Outgoing Reversal                |
| incoming_pix_chargeback_reversal           | PIX Chargeback Incoming Reversal                |
| operation_pix_disbursement                 | PIX Operation Disbursement                      |
| operation_pix_disbursement_reversal        | PIX Operation Disbursement Reversal             |
| receivables_inquiry_fee                    | Receivables Agenda Inquiry Fee                  |
| pix_deposit_reversal                       | PIX Deposit Reversal                            |
| internal_pix_transfer                      | PIX Transfer                                    |
| automatic_integrated_payment_reversal      | Automatic Integrated Payment Reversal           |
| operation_dibursement_reversal             | Operation Disbursement Reversal                 |
| available_yield                            | Net Investment Deposit                          |
| bank_slip_convenant_payment                | Agreement Bank Slip Payment                     |

### Enumerators prepaid_card_transaction_type
| Enum                  | Description                                         |
|-----------------------|-----------------------------------------------------|
| purchase              | Purchase on card                                    |
| international_purchase| International purchase on card                      |
| withdrawal            | ATM withdrawal on card                              |

### Enumerators card_type
| Enum    | Description     |
|---------|-----------------|
| plastic | Physical card   |
| virtual | Virtual card    |

---

# Query pending transactions

URL: /en/documentation/movimentacao_de_contas/consulta_de_transacoes_pendentes

## Request

ENDPOINT /pending_movement
METHOD GET

## Response

STATUS 200

**Response Body**

```json
{
  "data": {
    "movement_request_list": [
      {
        "account_key": "003307e9-d4fd-487d-a07b-84ceab4ad4a9",
        "approval_feedback": null,
        "movement_amount": 1013,
        "movement_data": {
          "agent_person_key": "0bb61530-7f2e-4fe8-819d-8dcfde478a4c",
          "origin_key": "0cc9efd2-5d53-4ac7-8ab3-a2f65c0c5e3b",
          "origin_type": "movement_request",
          "source_account_key": "003307e9-d4fd-487d-a07b-84ceab4ad4a9",
          "source_subtype": "internal_funds_transfer",
          "target_account_key": "ec87ea6c-31f4-47f1-b16a-11fc39572cb5",
          "transaction_amount": 1013
        },
        "movement_date": "2020-08-04",
        "movement_info": null,
        "movement_request_key": "0cc9efd2-5d53-4ac7-8ab3-a2f65c0c5e3b",
        "movement_status": "submitted",
        "movement_type": "transaction",
        "requester_key": "ba99b7f1-3db6-4a63-a386-ba2c7f31e784"
      },
      {
        "account_key": "21af482f-b8ac-48dd-8f9a-ea23429d28be",
        "approval_feedback": null,
        "movement_amount": 10,
        "movement_data": {
          "digitable_line": "65590000020048550000321310771007283400000001000",
          "resource_account_key": "21af482f-b8ac-48dd-8f9a-ea23429d28be"
        },
        "movement_date": "2020-08-05",
        "movement_info": null,
        "movement_request_key": "09729b67-8853-4688-ae16-1b878b6629f8",
        "movement_status": "submitted",
        "movement_type": "bank_slip_payment",
        "requester_key": "ba99b7f1-3db6-4a63-a386-ba2c7f31e784"
      }
    ]
  },
  "status": "waiting_approval",
  "webhook_type": "pending_movement"
}
```

STATUS 400

Response Body

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

```

---

# Consulta de extrato

URL: /en/documentation/movimentacao_de_contas/consulta_de_transferencias_realizadas

## Request

ENDPOINT /account_statement
MÉTODO GET
PARÂMETROS account_key, document_number, date_from, date_to, page, page_size

## QUERY PARAMS

| Campo | Tipo | Descrição | Máx. de caracteres | Exemplo |
|---|---| ---| ---| ---|
| `account_key` * | string |  Chave uuid da conta. | chave uuid ||
| `date_from` * | date |  Data de início do intervalo consultado. | 10 | 2023-10-10 |
| `date_to` * | date |  Data final do intervalo consultado. | 10 | 2023-10-10 |
| `page` | string |  Índice da página retornado | 2 | 1 |
| `page_size` | string |  Quantidade de transações a ser retornada (Máximo 4000) | 4 | 3999 |
| `order_by` | string |  Data final do intervalo consultado. | 3 | asc |

## Response

STATUS 200

Response Body

```json
{
  "data": {
    "account_info": {
      "account_block_reason": null,
      "account_branch": "0001",
      "account_credentials": [],
      "account_digit": "0",
      "account_key": "22189d43-4503-47c6-a05b-be29a534b2ac",
      "account_name": "Default",
      "account_number": "1467576",
      "account_status": "opened",
      "account_type": "checking",
      "automatic_transfers": [],
      "balance": 88637.41,
      "blocked_balance": 0,
      "destinations": [],
      "fee": 0.1,
      "internal_webhooks": [],
      "owner_document_number": "555555555",
      "owner_name": "Teste da Silva Testado",
      "owner_person_key": "f580d89d-217c-4244-ac88-5f4ec6861a5e",
      "permitted_person_keys": [
        "f580d89d-217c-4244-ac88-5f4ec6861a5e"
      ],
      "requester_key": "f580d89d-217c-4244-ac88-5f4ec6861a5e",
      "requester_name": "Teste da Silva Testado",
      "setup_fee": null,
      "transactional_limit": null,
      "webhook_enabled": true
    },
    "transaction_list": [
      {
        "account_balance": 88637.41,
        "description": "JORGE DA SILVA TESTE - 555555555",
        "source_subtype": "bank_slip_payment",
        "transacted_at": "2022-06-22 15:39:39",
        "transaction_amount": -1.5,
        "transaction_key": "D2Bb0f4e-cbb6-4f6a-8ea6-b66710d3dde8"
      },
      {
        "account_balance": 88638.91,
        "description": " 0001 52260-6 01.871.112/0001-80 ",
        "source_subtype": "pix_withdrawal_reversal",
        "transacted_at": "2022-06-20 19:28:16",
        "transaction_amount": 0.72,
        "transaction_key": "55c68b62-0288-4481-a6c2-44e9386e5d3f"
      }
    ]
  },
  "event_datetime": "2022-06-23 16:21:15",
  "key": "000fa133-2f45-4c39-ae76-c87cccb2c034",
  "pagination": {
    "current_page": 1,
    "next_page": null,
    "rows_per_page": 10,
    "total_pages": "unavailable",
    "total_rows": null
  },
  "status": "success",
  "webhook_type": "account_statement"
}
```

:::info Dica de Paginação
O page_size é o indicador da quantidade de transações.

Se o número de transações retornadas é igual ao `page_size` informado, podem existir mais transações e a próxima página deve ser consultada.

Caso o número de itens contidos na lista "transaction_list" seja menor que o `page_size` ou igual zero, significa que não existem mais resultados e a página atual é a última da listagem.
:::

STATUS 400

Response Body

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

```

---

# Realizar transferência

URL: /en/documentation/movimentacao_de_contas/realizar_transferencia

## Request

ENDPOINT /wire_transfer
MÉTODO POST

Request Body

```json
{
    "source_account": {
        "account_branch": "0001",
        "account_number": "9477323",
        "account_digit": "0",
        "owner_document_number": "38299588000107"
    },
    "target_account": {
        "financial_institution_code": "341",
        "account_branch": "0001",
        "account_number": "92796",
        "account_digit": "1",
        "owner_document_number": "23599885000192",
        "owner_name": "Titular da Conta"
    },
    "transaction_amount": 8.86
}
```

### Body Params

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `source_account` * | object | Conta de origem. | **[Objeto source_account](#objeto-source_account)** | 
| `target_account` * |  object | Conta de destino. | **[Objeto target_account](#objeto-target_account)** | 
| `transaction_amount` * | double | Valor da transferência. | 10 |
| `schedule_date` * | date |  Data de agendamento da transação, se não especificado a transação será realizada no momento do envio ou assim que aprovada. | 10 |

### Objeto source_account

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `account_branch` * |  string | Agência. | 10 |
| `account_digit` * |  string | Dígito da conta | 10 |
| `account_number` * | string | Número da conta. | 10 |
| `owner_document_number` * | string | CPF ou CNPJ (apenas números) do titular da conta. | 10 |
| `target_account_type` * |  string | Tipo da conta destino |  **[Enumeradores](#enumeradores-ted_account_type)** |

### Objeto target_account

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `account_branch` * | string | Agência. | 10 |
| `account_digit` * | string | Dígito da conta | 10 |
| `account_number` * | string | Número da conta. | 10 |
| `owner_document_number` * | string | CPF ou CNPJ (apenas números) do titular da conta. | 10 |
| `owner_name` * | string | Nome do titular da conta. | 10 |

### Enumeradores target_account_type

| Enumerador | Tradução |
|---|---|
|  checking_account  | conta corrente |
|  deposit_account  |  conta depósito  |
|  guaranteed_account  |  conta de garantia  |
|  investment_account  |  conta de investimento |
|  payment_account  | conta de pagamento |
|  saving_account  | conta poupança  |

## Response

STATUS 200

Response Body

```json
{
  "data": {
    "source_account": {
      "account_branch": "0001",
      "account_digit": "3",
      "account_number": "24339",
      "owner_document_number": "32402502000135"
    },
    "target_account": {
      "account_branch": "0001",
      "account_digit": "6",
      "account_number": "78340",
      "financial_institution_code": "329",
      "owner_document_number": "32402502000135",
      "owner_name": "QI Tech"
    },
    "transaction_key": "7986dcc7-4331-478f-af47-adfbdf7f4a36",
    "transaction_amount": 1891268.97,
    "outgoing_ted_key": "bc90744e-4f9a-42b1-9410-d5fa3c183fa8",
  },
  "event_datetime": "2019-11-28 19:22:04",
  "key": "fa80723e-4f9a-42b1-9410-d5fa3c183fa8",
  "status": "success",
  "webhook_type": "wire_transfer"
}

```

STATUS 400

Response Body

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

```

STATUS 400 - Fora do horário de TED

Response Body

```json
{
  	"data": "{ \"code\": \"TED000011\", \"title\": \"Bad Request\", \"http_status\": 400, \"description\": \"Wrong day/time for TED\", \"translation\": \"Dia/hora incorretos para a TED\", \"extra_fields\": { \"next_available_datetime\": \"2023-08-13T18:00:00.000Z\"} }",
	"code": "TED000011",
	"title": "Bad Request",
	"http_status": 400,
	"description": "Wrong day/time for TED",
	"translation": "Dia/hora incorretos para a TED",
	"extra_fields": {
		"next_available_datetime": "2023-08-13T18:00:00.000Z"
	}
}
```

---

# Test Scenarios

URL: /en/documentation/movimentacao_de_contas/transacao

Step-by-step to simulate the execution of actions performed by external agents. This simulation aims to execute internal transactions.

:::info Information
There is no payload (response body) in these requests.
:::

## 1 - Simulate a Internal Transaction

### Request

ENDPOINT /mock/account/transaction
METHOD POST

Request Body

```json
{
  "target_account_key": "c2aa26d5-d6fc-42cf-b9a0-e26f69d85c7d",
  "amount": 100
}
```

## 2 - Simulate an Incoming TED

### Request

ENDPOINT /mock/ted/incoming_ted
METHOD POST

Request Body

```json
{
  "target_account_key": "c2aa26d5-d6fc-42cf-b9a0-e26f69d85c7d",
  "amount": 100
}
```

## 3 - Simulate an Incoming TED Refund

### Request

ENDPOINT /mock/ted/ted_refusal
METHOD POST

**Request Body**

```json
{
  "transaction_key": "17cb43aa-0939-4513-b199-dbff3f092a2e"
}
```

**Request Body**

```json
{
  "ted_key": "c3a18c53-0e78-4a54-aa7b-2388050f9c15"
}
```

### Object Request Body

| Field                | Type   | Description                          | Characters |
|----------------------|--------|--------------------------------------|------------|
| **target_account_key** | string | Unique key of the destination account | 36         |
| **amount**           | number | Transaction amount                   | 6          |
| **transaction_key**  | string | Unique key of the transaction        | 36         |
| **ted_key**          | string | Unique key of the TED transfer       | 36         |

---

# Webhooks

URL: /en/documentation/movimentacao_de_contas/webhook_movimentacoes

Para toda e qualquer movimentação será enviado um webhook de “***account_transaction***“.

Cada transação possui um tipo de classificação (**Source Sub Type**). Essa classificação é utilizada para categorizar cada movimentação na conta. A lista de Source Sub Types pode ser visualizada abaixo.

# Crédito em Conta
Os créditos em conta resultarão em um webhook com “***data.amount***” positivo, “***data.origin***“ sendo a conta de origem dos recursos e a “***data.destination***“ sendo a conta de destino dos recursos:

WEBHOOK_TYPE account_transaction

Response Body: Pix

```json
{
    "key": "\<ACCOUNT-KEY\>",
	"data": {
		"amount": 1000000,
		"origin": {
			"name": "Treasury Account",
			"branch": "0001",
			"document": "32402502000135",
			"account_key": "5d068423-6094-49e4-b15b-7740038295a8",
			"account_digit": "5",
			"account_number": "00002"
		},
		"timestamp": "2022-09-02T21:36:33.446120",
		"description": "329 0001 00002-5 32.402.502/0001-35 - QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"destination": {
			"name": "Default",
			"branch": "0001",
			"document": "09080702000105",
			"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
			"account_digit": "2",
			"account_number": "2359934"
		},
		"reference_key": "983b4a28-7de6-4e71-97ef-60fb50c7b013",
		"reference_type": "movement_request",
		"account_balance": 1000000,
		"source_sub_type": "internal_funds_transfer",
		"transaction_key": "67a62397-2c32-4768-8485-ec9129a46654",
		"source_sub_type_str": "Transferência Interna",
		"transaction_details": {
			"payer_name": "0001",
			"receiver_name": "Default",
			"payer_account_digit": "5",
			"payer_account_branch": "",
			"payer_account_number": "1111111",
			"payer_document_number": "66681638999999",
			"receiver_account_digit": "6",
			"receiver_account_branch": "0000",
			"receiver_account_number": "34256449809",
			"receiver_conciliation_id": null,
			"receiver_document_number": "00809641658"
		}
	},
	"datetime": "2022-09-02T21:36:33.446120",
	"webhook_type": "account_transaction"
}
```

Response Body: Outras transações

```json
{
    "key": "\<ACCOUNT-KEY\>",
	"data": {
		"amount": 1000000,
		"origin": {
			"name": "Treasury Account",
			"branch": "0001",
			"document": "32402502000135",
			"account_key": "5d068423-6094-49e4-b15b-7740038295a8",
			"account_digit": "5",
			"account_number": "00002"
		},
		"timestamp": "2022-09-02T21:36:33.446120",
		"description": "329 0001 00002-5 32.402.502/0001-35 - QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"destination": {
			"name": "Default",
			"branch": "0001",
			"document": "09080702000105",
			"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
			"account_digit": "2",
			"account_number": "2359934"
		},
		"reference_key": "983b4a28-7de6-4e71-97ef-60fb50c7b013",
		"reference_type": "movement_request",
		"account_balance": 1000000,
		"source_sub_type": "internal_funds_transfer",
		"transaction_key": "67a62397-2c32-4768-8485-ec9129a46654",
		"source_sub_type_str": "Transferência Interna",
	},
	"datetime": "2022-09-02T21:36:33.446120",
	"webhook_type": "account_transaction"
}
```

## Débito em Conta
Os débitos em conta resultarão em um webhook com “***data.amount***” negativo, “***data.origin***“ sendo a conta destinatária dos recursos e a “***data.destination***“ sendo a conta de origem dos recursos:

WEBHOOK_TYPE account_transaction

Response Body

```json
{
	"key": "\<ACCOUNT-KEY\>",
	"data": {
		"amount": -45,
		"origin": {
			"name": "PIX",
			"branch": "0001",
			"document": "32402502000135",
			"account_key": "3d0e7d50-e898-49f3-b23b-05353c8a3c72",
			"account_digit": "3",
			"account_number": "00003"
		},
		"timestamp": "2022-09-02T23:00:05.326738",
		"description": "212 0001 1017372-2 ***.221.81*-** BANCO ORIGINAL S.A.",
		"destination": {
			"name": "Default",
			"branch": "0001",
			"document": "09080702000105",
			"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
			"account_digit": "2",
			"account_number": "2359934"
		},
		"reference_key": "cea836b5-b02e-4f94-b1e2-4d575671c33d",
		"reference_type": "pix_outgoing",
		"account_balance": 999955,
		"source_sub_type": "pix_withdrawal",
		"transaction_key": "d2ba3817-26d7-4957-ab82-24f78d910a8a",
		"source_sub_type_str": "Transferência de PIX"
	},
	"datetime": "2022-09-02T23:00:05.326738",
	"webhook_type": "account_transaction"
}
```
 

**Lista de source_sub_types’s:**

| Enum                                    | Descrição                                       |
|-----------------------------------------|-------------------------------------------------|
| operation_disbursement                  | Desembolso da Operação                          |
| protest_expense                         | Despesas de Protesto                            |
| automatic_integrated_payment            | Pagamento Automático Integrado                  |
| tax                                     | Impostos                                        |
| electronic_funds_fee                    | Tarifa de TED                                   |
| credit_operation_fee                    | Tarifa de Abertura de Crédito                   |
| internal_funds_transfer                 | Transferência Interna                           |
| incoming_funds_transfer                 | Transferência de Entrada                        |
| outgoing_funds_transfer                 | TED                                             |
| deposit                                 | Depósito                                        |
| withdrawal                              | Transferência                                   |
| withdrawal_reversal                     | Estorno de Transferência                        |
| trade_funds_transfer                    | Transferência de Pagamento de Cessão            |
| settlement_funds_transfer               | Transferência para Liquidação                   |
| bank_slip_fee                           | Tarifa de Boleto                                |
| bank_slip_settlement                    | Liquidação de Boleto                            |
| outgoing_funds_transfer_reversal        | Estorno de TED                                  |
| incoming_funds_transfer_refusal         | Transferência Negada                            |
| electronic_funds_fee_reversal           | Estorno de Tarifa de TED                        |
| monthly_account_fee_reversal            | Estorno de Tarifa de Manutenção de Conta        |
| bank_slip_fee_reversal                  | Estorno de Tarifa de Boleto                     |
| correspondent_bank_transfer             | Repasse de Correspondente Bancário              |
| credit_analysis_fee                     | Tarifa de Análise de Crédito                    |
| credit_operation_fee_reversal           | Estorno de Tarifa de Abertura de Crédito        |
| financial_investments_income            | Renda de Aplicação Financeira                   |
| bank_slip_settlement_reversal           | Estorno de Liquidação de Boleto                 |
| bank_slip_settlement_expense_reversal   | Estorno de Tarifa de liquidação de Boleto       |
| bank_slip_settlement_incoming_reversal  | Estorno de Recebimento de Liquidação de Boleto  |
| correspondent_bank_transfer_reversal    | Estrono de Repasse de Correspondente Bancário   |
| credit_analysis_fee_reversal            | Estorno de Tarifa de Análise de Crédito         |
| doc_expense_reversal                    | Estorno de Tarifa de DOC                        |
| incoming_doc_reversal                   | Estorno de Entrada de DOC                       |
| operation_disbursement_reversal         | Estorno de Desembolso da Operação               |
| operation_settling_reversal             | Estorno de Pagamento de Operação                |
| outgoing_doc_reversal                   | Estorno de Saída de DOC                         |
| rebate_reversal                         | Estorno de Rebate                               |
| settlement_funds_transfer_reversal      | Estorno de Transferência para Liquidação        |
| tax_reversal                            | Estorno de Impostos                             |
| trade_funds_transfer_reversal           | Estorno de Transferência de Pagamento de Cessão |
| bank_slip_permanency_fee                | Tarifa de Permanência do Título                 |
| bank_slip_cancel_protest_fee            | Tarifa de Permanência do Título                 |
| bank_slip_protest_fee                   | Tarifa de Pedido de Protesto                    |
| bank_slip_notary_office_fee             | Custas de Protesto                              |
| bank_slip_registration_fee              | Tarifa de Registro                              |
| bank_slip_extension_fee                 | Tarifa de Prorrogação                           |
| bank_slip_rebate_fee                    | Tarifa de Abatimento                            |
| bank_slip_discount_fee                  | Tarifa de Desconto                              |
| bank_slip_settlement_fee                | Tarifa de Liquidação                            |
| bank_slip_write_off_term_fee            | Tarifa de Baixa por Decurso de Prazo            |
| bank_slip_write_off_fee                 | Tarifa de Baixa                                 |
| bank_slip_cancel_protest_write_off_fee  | Tarifa de Sustação de Protesto com Baixa        |
| bank_slip_notary_office_settlement_fee  | Tarifa de Liquidação em Cartório                |
| rebate_tax_free                         | Repasse por Conta e Ordem                       |
| rebate_tax_free_reversal                | Estorno de Repasse por Conta e Ordem            |
| incoming_funds_transfer_reversal        | Estorno de Transferência Interna                |
| bank_slip_payment                       | Pagamento de Boleto                             |
| bank_slip_payment_reversal              | Estorno de Pagamento de Boleto                  |
| warranty_analysis_fee                   | Tarifa de Análise de Garantia                   |
| bank_slip_settlement_deposit            | Liquidação de Boleto                            |
| bank_slip_payment_withdrawal            | Pagamento de Boleto                             |
| account_setup_fee                       | Tarifa de Abertura de Conta                     |
| account_setup_fee_reversal              | Estorno de Tarifa de Abertura de Conta          |
| bank_slip_payment_withdrawal_reversal   | Estorno de Pagamento de Boleto                  |
| incoming_anticipation_of_receivable     | -                                               |
| incoming_credit_card_settlement         | Liquidação de cartão de crédito                 |
| incoming_debit_card_settlement          | Liquidação de cartão de débito                  |
| assignment_automatic_transfer           | Débito de Cessão Automática                     |
| assignment_automatic_transfer_reversal  | Estorno de Débito de Cessão Automática          |
| pix_fee                                 | Tarifa de PIX                                   |
| incoming_pix_transfer                   | Entrada de PIX                                  |
| outgoing_pix_transfer                   | Saída de PIX                                    |
| pix_fee_reversal                        | Estorno de Tarifa de PIX                        |
| incoming_pix_transfer_reversal          | Estorno de entrada de PIX                       |
| outgoing_pix_transfer_reversal          | Estorno de saída de PIX                         |
| pix_deposit                             | Depósito de PIX                                 |
| pix_withdrawal                          | Transferência de PIX                            |
| pix_withdrawal_reversal                 | Estorno de transferência de PIX                 |
| pix_chargeback_withdrawal               | Envio de devolução PIX                          |
| outgoing_pix_chargeback                 | Saída de PIX por devolução                      |
| incoming_pix_chargeback                 | Recebimento de devolução PIX                    |
| pix_chargeback_deposit                  | Entrada de PIX por devolução                    |
| pix_chargeback_withdrawal_reversal      | Estorno de envio de devolução PIX               |
| outgoing_pix_chargeback_reversal        | Estorno de saída de PIX por devolução           |
| incoming_pix_chargeback_reversal        | Estorno de recebimento de devolução PIX         |
| operation_pix_disbursement              | Desembolso PIX da Operação                      |
| operation_pix_disbursement_reversal     | Estorno de Desembolso PIX da Operação           |
| receivables_inquiry_fee                 | Tarifa de Consulta de Agenda de Recebíveis      |
| pix_deposit_reversal                    | Estorno de Depósito de PIX                      |
| internal_pix_transfer                   | Transferência de PIX                            |
| automatic_integrated_payment_reversal   | Estorno de Pagamento Automático Integrado       |
| operation_dibursement_reversal          | Estorno de Desembolso da Operação               |
| available_yield                         | Depósito de Investimento Liquido                |
| bank_slip_convenant_payment             | Pagamento de Boleto de Convênio                 |

---

# Notification Configuration

URL: /en/documentation/notificacoes/configuracao_de_notificacao

Here we will demonstrate how you can choose which types of events will be notified and by which means the notification will occur.

:::warning Warning
If there is no notification configuration for an event, you will not receive notifications for it.
:::

## Creating a Notification Configuration

## Request

ENDPOINT /notification/notification_configuration
METHOD POST

Request Body

```json
{
    "callback": true,
    "email": true,
    "event_type": "account_transaction",
    "sms": true
}
```

## Response

STATUS 201

Response Body

```json
{"notification_configuration_key":  "69850ae3-28bc-4779-a871-e73e1e883413"}
```

## Listing Notifications Configurations

## Request

ENDPOINT /notification/notification_configurations
METHOD GET

## Response

STATUS 200

Response Body

```json
{
  "data": [{
    "event_type": "account_request",
    "sms_template": "b35ed5fc-fdda-4618-84e6-b49876dabf23",
    "template_configuration_key": "480521cc-b0c9-4938-bd11-0000be11c66b"
  }],
  "pagination": {
        "current_page": 1,
        "next_page": null,
        "rows_per_page": 1
    }
}
```

## Update Notifications configuration

## Request

ENDPOINT /notification/notification_configuration/ NOTIFICATION_CONFIGURATION_KEY
METHOD PUT

Request Body

```json
{
    "callback": true,
    "email": true,
    "event_type": "account_transaction",
    "sms": false
}
```

## Response

STATUS 200

Response Body

```json
{}
```

STATUS 4XX

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`                    | Description (eng)<br/>`Description`               | Description (ptbr)<br/>`translation`                                   |
|-------------|----------------------|---------------------------------------|-------------------------------------------------|----------------------------------------------------------------------|
| 400         | PMB000026            | Invalid notification for event type   | Invalid notification method for event type      | Método de notificação inválido para tipo de evento                   |

---

# Template Configuration

URL: /en/documentation/notificacoes/configuracao_template

This configuration allows you to set SMS and email templates for an event.

## Creating template configuration

## Request

ENDPOINT /notification/template_configuration
METHOD POST

Request Body

```json
{
    "event_type": "bank_slip",
    "email_template_key": "e5c337db-dacc-4f1d-8a3e-919628640dd5"
}
``` 

## Response

STATUS 201

Response Body

```json
{"template_configuration_key": "e5c337db-dacc-4f1d-8a3e-919628640d51"}
```

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in portuguese",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title` | Description (eng)<br/>`Description`                                       | Description (ptbr)<br/>`translation`                                 |
|-------------|----------------------|--------------------|-------------------------------------------------------------------------|--------------------------------------------------------------------|
| 400         | PMB000023            | Bad Request        | Already exists an template configuration to this person and event type  | Já existe um template configuration para essa pessoa e event type  |

## Listing template configuration

## Request

ENDPOINT /notification/template_configurations
METHOD GET

## Response

STATUS 200

Response Body

```json
{
    "data": [
        {
            "event_type": "bank_slip",
            "sms_template": null,
            "template_configuration_key": "e5c337db-dacc-4f1d-8a3e-919628640d51",
            "email_template": "e5c337db-dacc-4f1d-8a3e-919628640dd5"
        },
        {
            "event_type": "account_transaction",
            "sms_template": null,
            "template_configuration_key": "e5c337db-dacc-4f1d-8a3e-919628640ds1",
            "email_template": "e5c337db-dacc-4f1d-8a3e-919628640dd5"
        }
    ],
    "pagination": {
        "current_page": 0,
        "next_page": null,
        "rows_per_page": 10
    }
}
```

## Updating template configuration

## Request

ENDPOINT /notification/template_configuration/ TEMPLATE_CONFIGURATION_KEY
METHOD PUT

Request Body

```json
{
    "event_type": "bank_slip",
    "email_template_key": "e5c337db-dacc-4f1d-8a3e-919628640dd5"
}
``` 

## Response

STATUS 201

Response Body

```json
{}
```

STATUS 4XX

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in portuguese",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title` | Description (eng)<br/>`Description`        | Description (ptbr)<br/>`translation`                     |
|-------------|----------------------|--------------------|------------------------------------------|--------------------------------------------------------|
| 400         | PMB000022            | Bad Request        | The event type (event type) is not valid | O tipo de evento (tipo de evento) enviado não é válido |
| 404         | PMB000024            | Not Found          | Template configuration not found         | Configuração de template não encontrada                |

---

# Custom Notification Management

URL: /en/documentation/notificacoes/introducao

Our platform offers a comprehensive range of notification options, including emails, SMS messages, and webhooks, allowing users to select the channel that best suits their needs and preferences. Additionally, we provide customization capabilities through templates for emails and SMS, ensuring that notifications align with the user's identity and communication style.

One of the most notable aspects of our system is the ability for users to define when they wish to receive notifications for specific events. This flexibility allows for more efficient management of the information flow, ensuring that users receive only the most relevant notifications at the most opportune time.

In this section of the documentation, we will detail the various aspects of Custom Notification Management, from initial setup to advanced customization, providing users with a comprehensive understanding of how to make the most of this essential feature on our platform.

---

# Resending notifications

URL: /en/documentation/notificacoes/reenvio_de_notificacoes

This guide is aimed at presenting how to resend a webhook through our systems' endpoints. Resending webhooks may be done to any existing callback, regardless of its current status.

## Notification flow
1. It is necessary to first consult pre-existing events in order to gather data to resend notifications, listed in **[Request](#request)**
2. Once gathering the desired webhooks' information using the GET method, you will need to pass the event_key and callback_key inside your PATCH request, presented in **[Resending a callback](#resending-a-callback)**

## Listing eligible events

## Request

ENDPOINT /notification/events
METHOD GET

### Query Parameters

| Parameter       | Type   | Description                                                       |
|-----------------|--------|-------------------------------------------------------------------|
| event_type      | string | Event Type (ex: "debt_disbursed")                                 |
| callback_status | string | Callback Status (ex: "failed", "sent", etc.)                      |
| origin_key      | uuid   | Unique event key                                                  |
| start_datetime  | string | Starting date/time of event "YYYY-MM-DDTHH:mm:ssZ" (UTC timezone) |
| end_datetime    | string | End date/time of event "YYYY-MM-DDTHH:mm:ssZ" (UTC timezone)      |

> **Observation:**
> The time window between `start_datetime` and `end_datetime` must be at most 14 days, or else an error will be returned.

## Response

STATUS 200

Response Body

```json
{
  "data": [
    {
      "event_key": "<UUID>",
      "event_type": "debt_disbursed",
      "status": "processed",
      "origin_enumerator": "account",
      "origin_key": "<UUID>",
      "callbacks": [
        {
          "callback_key": "<UUID>",
          "callback_status": "failed"
        }
      ],
    }
  ],
  "pagination": {
    "current_page": 1,
    "rows_per_page": 25,
  }
}
```

### Response Parameters

| Parameters        | Type   | Description                         |
|-------------------|--------|-------------------------------------|
| event_key         | uuid   | Event unique key                    |
| event_type        | string | Event type (ex: "debt_disbursed")   |
| status            | string | Event Status (ex: "processed")      |
| origin_enumerator | string | API origin enumeratior (ex: "lego") |
| origin_key        | uuid   | Origin unique key                   |
| callbacks         | list   | Callback object list                |
| pagination        | object | Object Pagination                   |

### Callback Object

| Parameters      | Type   | Description                                  |
|-----------------|--------|----------------------------------------------|
| callback_key    | uuid   | Calback unique key                           |
| callback_status | string | Callback Status (ex: "failed", "sent", etc.) |

### Pagination Object

| Parameter     | Type    | Description             |
|---------------|---------|-------------------------|
| current_page  | integer | Current page number     |
| rows_per_page | integer | Number of rows per page |

STATUS 400

Response Body: Error

```json
{
  "code": "PMB000032",
  "title": "Bad Request",
  "description": "Selected timeframe should have a maximum of 14 days",
  "translation": "O intervalo de tempo selecionado deve ter no máximo 14 dias",
}
```

## Resending a callback

## Request

:::important Time limit
The window for searches is limited to 14 days.
:::

:::warning Observations
Please check you are utilizing the event_key and callback_key fields gathered in the previous request.
:::

ENDPOINT `/notification/event/{event_key}/callback/{callback_key}/retry`
METHOD PATCH

### Path Parameters

| Parameter    | Type | Description                               |
|--------------|------|-------------------------------------------|
| event_key    | uuid | Event unique key (obtained in GET method) |
| callback_key | uuid | Callback unique key (obtained in GET method)  |

**Example usage**

```bash
curl -X PATCH "https://api-auth.sandbox.qitech.app/notification/event/123e4567-e89b-12d3-a456-426614174000/callback/987fcdeb-51a2-43d7-9012-345678901234/retry"
```

## Response

STATUS 204

Response Body

```json
{}
```

## Troubleshooting

When facing errors:
1. Verify the `event_key` and `callback_key` are correct.
2. Confirm the callback exists.
3. Verify the time window is within 14 days.
4. In case you are experiencing continuous errors, please contact the support team.

---

# Templates

URL: /en/documentation/notificacoes/template

Here we will see how to create email and SMS templates. These templates will allow you to customize the text and email messages sent for each type of event.

If not configured and the configuration is enabled, the default template from our platform will be sent.

Note: To insert a custom variable in the text, simply add '[variable_name]'.

## Creation of SMS template

## Request

ENDPOINT /notification/template
METHOD POST

Request Body

```json
{
    "template_type": "sms",
    "template": "Olá seu token e [name]"
}
```

## BODY PARAMS

| Field          | Type   | Description                  | Characters |
|----------------|--------|------------------------------|------------|
| `template_type` * | string | Type of template -> Default value `sms` | -        |
| `template` *   | string | SMS text                      | 160        |

## Response

STATUS 201

Response Body

```json
{
    "template_key": "17f49953-29a1-439c-a6be-db37a32e2746"
}
```

## Creation of e-mail template

:::warning Warning
The email template is an HTML document compatible with email HTML formatting.
It must be encoded in base64.
:::

## Request

ENDPOINT /notification/template
METHOD POST

Request Body

```json
{
    "template_type": "email",
    "subject": "Título do email",
    "template": "PCFET0NUWVBFIGh0bWw+CjxodG1sIHhtbG5zOnY9InVybjpzY2hlbWFzLW1pY3Jvc29mdC1jb206dm1sIiB4bWxuczpvPSJ1cm46c2NoZW1hcy1taWNyb3NvZnQtY29tOm9mZmljZTpvZmZpY2UiIGxhbmc9ImVuIj4KICA8aGVhZD4KICAgIDx0aXRsZT48L3RpdGxlPgogICAgPG1ldGEgY2hhcnNldD0iVVRGLTgiPgogICAgPG1ldGEgbmFtZT0idmlld3BvcnQiIGNvbnRlbnQ9IndpZHRoPWRldmljZS13aWR0aCwgaW5pdGlhbC1zY2FsZT0xLjAiPgogICAgPCEtLVtpZiBtc29dPgoJCQkJPHhtbD4KCQkJCQk8bzpPZmZpY2VEb2N1bWVudFNldHRpbmdzPgoJCQkJCQk8bzpQaXhlbHNQZXJJbmNoPjk2PC9vOlBpeGVsc1BlckluY2g+CgkJCQkJCTxvOkFsbG93UE5HLz4KCQkJCQk8L286T2ZmaWNlRG9jdW1lbnRTZXR0aW5ncz4KCQkJCTwveG1sPgoJCQkJPCFbZW5kaWZdLS0+CiAgICA8IS0tW2lmICFtc29dPgoJCQkJPCEtLT4KICAgIDxsaW5rIGhyZWY9Imh0dHBzOi8vZm9udHMuZ29vZ2xlYXBpcy5jb20vY3NzP2ZhbWlseT1Nb250c2VycmF0IiByZWw9InN0eWxlc2hlZXQiIHR5cGU9InRleHQvY3NzIj4KICAgIDwhLS0KCQkJCQk8IVtlbmRpZl0tLT4KICAgIDxzdHlsZT4KICAgICAgKiB7CiAgICAgICAgYm94LXNpemluZzogYm9yZGVyLWJveDsKICAgICAgfQoKICAgICAgYm9keSB7CiAgICAgICAgbWFyZ2luOiAwOwogICAgICAgIHBhZGRpbmc6IDA7CiAgICAgIH0KCiAgICAgIGFbeC1hcHBsZS1kYXRhLWRldGVjdG9yc10gewogICAgICAgIGNvbG9yOiBpbmhlcml0ICFpbXBvcnRhbnQ7CiAgICAgICAgdGV4dC1kZWNvcmF0aW9uOiBpbmhlcml0ICFpbXBvcnRhbnQ7CiAgICAgIH0KCiAgICAgICNNZXNzYWdlVmlld0JvZHkgYSB7CiAgICAgICAgY29sb3I6IGluaGVyaXQ7CiAgICAgICAgdGV4dC1kZWNvcmF0aW9uOiBub25lOwogICAgICB9CgogICAgICBwIHsKICAgICAgICBsaW5lLWhlaWdodDogaW5oZXJpdAogICAgICB9CgogICAgICBAbWVkaWEgKG1heC13aWR0aDo2MjBweCkgewogICAgICAgIC5yb3ctY29udGVudCB7CiAgICAgICAgICB3aWR0aDogMTAwJSAhaW1wb3J0YW50OwogICAgICAgIH0KCiAgICAgICAgLnN0YWNrIC5jb2x1bW4gewogICAgICAgICAgd2lkdGg6IDEwMCU7CiAgICAgICAgICBkaXNwbGF5OiB3aXRoOwogICAgICAgIH0KICAgICAgfQogICAgPC9zdHlsZT4KICA8L2hlYWQ+CiAgPGJvZHkgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IG1hcmdpbjogMDsgcGFkZGluZzogMDsgLXdlYmtpdC10ZXh0LXNpemUtYWRqdXN0OiBub25lOyB0ZXh0LXNpemUtYWRqdXN0OiBub25lOyI+CiAgICA8dGFibGUgY2xhc3M9Im5sLWNvbnRhaW5lciIgd2lkdGg9IjEwMCUiIGJvcmRlcj0iMCIgY2VsbHBhZGRpbmc9IjAiIGNlbGxzcGFjaW5nPSIwIiByb2xlPSJwcmVzZW50YXRpb24iIHN0eWxlPSJtc28tdGFibGUtbHNwYWNlOiAwcHQ7IG1zby10YWJsZS1yc3BhY2U6IDBwdDsgYmFja2dyb3VuZC1jb2xvcjogI2ZmZjsiPgogICAgICA8dGJvZHk+CiAgICAgICAgPHRyPgogICAgICAgICAgPHRkPgogICAgICAgICAgICA8dGFibGUgY2xhc3M9InJvdyByb3ctMSIgYWxpZ249ImNlbnRlciIgd2lkdGg9IjEwMCUiIGJvcmRlcj0iMCIgY2VsbHBhZGRpbmc9IjAiIGNlbGxzcGFjaW5nPSIwIiByb2xlPSJwcmVzZW50YXRpb24iIHN0eWxlPSJtc28tdGFibGUtbHNwYWNlOiAwcHQ7IG1zby10YWJsZS1yc3BhY2U6IDBwdDsiPgogICAgICAgICAgICAgIDx0Ym9keT4KICAgICAgICAgICAgICAgIDx0cj4KICAgICAgICAgICAgICAgICAgPHRkPgogICAgICAgICAgICAgICAgICAgIDx0YWJsZSBjbGFzcz0icm93LWNvbnRlbnQgc3RhY2siIGFsaWduPSJjZW50ZXIiIGJvcmRlcj0iMCIgY2VsbHBhZGRpbmc9IjAiIGNlbGxzcGFjaW5nPSIwIiByb2xlPSJwcmVzZW50YXRpb24iIHN0eWxlPSJtc28tdGFibGUtbHNwYWNlOiAwcHQ7IG1zby10YWJsZS1yc3BhY2U6IDBwdDsgY29sb3I6ICMwMDAwMDA7IHdpZHRoOiA2MDBweDsiIHdpZHRoPSI2MDAiPgogICAgICAgICAgICAgICAgICAgICAgPHRib2R5PgogICAgICAgICAgICAgICAgICAgICAgICA8dHI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkIGNsYXNzPSJjb2x1bW4iIHdpZHRoPSIxMDAlIiBzdHlsZT0ibXNvLXRhYmxlLWxzcGFjZTogMHB0OyBtc28tdGFibGUtcnNwYWNlOiAwcHQ7IGZvbnQtd2VpZ2h0OiA0MDA7IHRleHQtYWxpZ246IGxlZnQ7IHZlcnRpY2FsLWFsaWduOiB0b3A7IHBhZGRpbmctdG9wOiA1cHg7IHBhZGRpbmctYm90dG9tOiA1cHg7IGJvcmRlci10b3A6IDBweDsgYm9yZGVyLXJpZ2h0OiAwcHg7IGJvcmRlci1ib3R0b206IDBweDsgYm9yZGVyLWxlZnQ6IDBweDsiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRhYmxlIGNsYXNzPSJpbWFnZV9ibG9jayIgd2lkdGg9IjEwMCUiIGJvcmRlcj0iMCIgY2VsbHBhZGRpbmc9IjIwIiBjZWxsc3BhY2luZz0iMCIgcm9sZT0icHJlc2VudGF0aW9uIiBzdHlsZT0ibXNvLXRhYmxlLWxzcGFjZTogMHB0OyBtc28tdGFibGUtcnNwYWNlOiAwcHQ7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRyPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgYWxpZ249ImNlbnRlciIgc3R5bGU9ImxpbmUtaGVpZ2h0OjEwcHgiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aW1nIHNyYz0iaHR0cHM6Ly85bzM3Lm1qdC5sdS90cGxpbWcvOW8zNy9iLzF5ejdpL2hrM3NwLnBuZyIgc3R5bGU9ImRpc3BsYXk6IGJsb2NrOyBoZWlnaHQ6IGF1dG87IGJvcmRlcjogMDsgd2lkdGg6IDEyMHB4OyBtYXgtd2lkdGg6IDEwMCU7IiB3aWR0aD0iMTIwIiBhbHQ9InBsYWNlaG9sZGVyIGxvZ28iIHRpdGxlPSJwbGFjZWhvbGRlciBsb2dvIj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvdHI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RhYmxlPgogICAgICAgICAgICAgICAgICAgICAgICAgIDwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgIDwvdHI+CiAgICAgICAgICAgICAgICAgICAgICA8L3Rib2R5PgogICAgICAgICAgICAgICAgICAgIDwvdGFibGU+CiAgICAgICAgICAgICAgICAgIDwvdGQ+CiAgICAgICAgICAgICAgICA8L3RyPgogICAgICAgICAgICAgIDwvdGJvZHk+CiAgICAgICAgICAgIDwvdGFibGU+CiAgICAgICAgICAgIDx0YWJsZSBjbGFzcz0icm93IHJvdy0yIiBhbGlnbj0iY2VudGVyIiB3aWR0aD0iMTAwJSIgYm9yZGVyPSIwIiBjZWxscGFkZGluZz0iMCIgY2VsbHNwYWNpbmc9IjAiIHJvbGU9InByZXNlbnRhdGlvbiIgc3R5bGU9Im1zby10YWJsZS1sc3BhY2U6IDBwdDsgbXNvLXRhYmxlLXJzcGFjZTogMHB0OyI+CiAgICAgICAgICAgICAgPHRib2R5PgogICAgICAgICAgICAgICAgPHRyPgogICAgICAgICAgICAgICAgICA8dGQ+CiAgICAgICAgICAgICAgICAgICAgPHRhYmxlIGNsYXNzPSJyb3ctY29udGVudCBzdGFjayIgYWxpZ249ImNlbnRlciIgYm9yZGVyPSIwIiBjZWxscGFkZGluZz0iMCIgY2VsbHNwYWNpbmc9IjAiIHJvbGU9InByZXNlbnRhdGlvbiIgc3R5bGU9Im1zby10YWJsZS1sc3BhY2U6IDBwdDsgbXNvLXRhYmxlLXJzcGFjZTogMHB0OyBjb2xvcjogIzAwMDAwMDsgd2lkdGg6IDYwMHB4OyIgd2lkdGg9IjYwMCI+CiAgICAgICAgICAgICAgICAgICAgICA8dGJvZHk+CiAgICAgICAgICAgICAgICAgICAgICAgIDx0cj4KICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQgY2xhc3M9ImNvbHVtbiIgd2lkdGg9IjEwMCUiIHN0eWxlPSJtc28tdGFibGUtbHNwYWNlOiAwcHQ7IG1zby10YWJsZS1yc3BhY2U6IDBwdDsgZm9udC13ZWlnaHQ6IDQwMDsgdGV4dC1hbGlnbjogbGVmdDsgdmVydGljYWwtYWxpZ246IHRvcDsgcGFkZGluZy10b3A6IDVweDsgcGFkZGluZy1ib3R0b206IDVweDsgYm9yZGVyLXRvcDogMHB4OyBib3JkZXItcmlnaHQ6IDBweDsgYm9yZGVyLWJvdHRvbTogMHB4OyBib3JkZXItbGVmdDogMHB4OyI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGFibGUgY2xhc3M9ImhlYWRpbmdfYmxvY2siIHdpZHRoPSIxMDAlIiBib3JkZXI9IjAiIGNlbGxwYWRkaW5nPSIwIiBjZWxsc3BhY2luZz0iMCIgcm9sZT0icHJlc2VudGF0aW9uIiBzdHlsZT0ibXNvLXRhYmxlLWxzcGFjZTogMHB0OyBtc28tdGFibGUtcnNwYWNlOiAwcHQ7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRyPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBzdHlsZT0icGFkZGluZy1ib3R0b206MjBweDtwYWRkaW5nLWxlZnQ6MjBweDtwYWRkaW5nLXJpZ2h0OjIwcHg7cGFkZGluZy10b3A6NjBweDt0ZXh0LWFsaWduOmNlbnRlcjt3aWR0aDoxMDAlOyI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aDEgc3R5bGU9Im1hcmdpbjogMDsgY29sb3I6ICMwMDAwMDA7IGRpcmVjdGlvbjogbHRyOyBmb250LWZhbWlseTogTW9udHNlcnJhdCwgVHJlYnVjaGV0IE1TLCBMdWNpZGEgR3JhbmRlLCBMdWNpZGEgU2FucyBVbmljb2RlLCBMdWNpZGEgU2FucywgVGFob21hLCBzYW5zLXNlcmlmOyBmb250LXNpemU6IDI1cHg7IGZvbnQtd2VpZ2h0OiBub3JtYWw7IGxldHRlci1zcGFjaW5nOiBub3JtYWw7IGxpbmUtaGVpZ2h0OiAxMjAlOyB0ZXh0LWFsaWduOiBjZW50ZXI7IG1hcmdpbi10b3A6IDA7IG1hcmdpbi1ib3R0b206IDA7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHN0cm9uZz5NQU5VVEVOw4fDg08gUFJPR1JBTUFEQTwvc3Ryb25nPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2gxPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvdHI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RhYmxlPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRhYmxlIGNsYXNzPSJ0ZXh0X2Jsb2NrIiB3aWR0aD0iMTAwJSIgYm9yZGVyPSIwIiBjZWxscGFkZGluZz0iMCIgY2VsbHNwYWNpbmc9IjAiIHJvbGU9InByZXNlbnRhdGlvbiIgc3R5bGU9Im1zby10YWJsZS1sc3BhY2U6IDBwdDsgbXNvLXRhYmxlLXJzcGFjZTogMHB0OyB3b3JkLWJyZWFrOiBicmVhay13b3JkOyI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0cj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQgc3R5bGU9InBhZGRpbmctYm90dG9tOjgwcHg7cGFkZGluZy1sZWZ0OjIwcHg7cGFkZGluZy1yaWdodDoyMHB4O3BhZGRpbmctdG9wOjYwcHg7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgc3R5bGU9ImZvbnQtZmFtaWx5OiBzYW5zLXNlcmlmIj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBzdHlsZT0iZm9udC1zaXplOiAxNnB4OyBtc28tbGluZS1oZWlnaHQtYWx0OiAxNi44cHg7IGNvbG9yOiAjMDAwMDAwOyBsaW5lLWhlaWdodDogMS4yOyBmb250LWZhbWlseTogTW9udHNlcnJhdCwgVHJlYnVjaGV0IE1TLCBMdWNpZGEgR3JhbmRlLCBMdWNpZGEgU2FucyBVbmljb2RlLCBMdWNpZGEgU2FucywgVGFob21hLCBzYW5zLXNlcmlmOyI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHAgc3R5bGU9Im1hcmdpbjogMDsgZm9udC1zaXplOiAxOHB4OyB0ZXh0LWFsaWduOiBsZWZ0OyI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnI+SW5mb3JtYW1vcyBxdWUgbm8gZGlhIDxiPjE4IGRlIGZldmVyZWlybyAoZG9taW5nbyk8L2I+LCBhIFFJIFRlY2ggcmVhbGl6YXLDoSB1bWEgbWFudXRlbsOnw6NvIGdlcmFsIGVtIHRvZG9zIG9zIHNldXMgc2lzdGVtYXMgZSBzZXJ2acOnb3MuIEVzdGEgbWFudXRlbsOnw6NvIHRlcsOhIHVtYSBkdXJhw6fDo28gZGUgdHLDqnMgaG9yYXMsIHRlbmRvIHNldSA8c3Ryb25nPmluw61jaW8gw6BzIDAyOjAwICgyQU0pPC9zdHJvbmc+IGUgc2V1IDxzdHJvbmc+dMOpcm1pbm8gw6BzIDA1OjAwICg1QU0pPC9zdHJvbmc+LgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvcD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cCBzdHlsZT0ibWFyZ2luOiAwOyBmb250LXNpemU6IDE4cHg7IHRleHQtYWxpZ246IGxlZnQ7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxicj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3A+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+IFNlcnZpw6dvcyA8c3Ryb25nPmluZGlzcG9uw612ZWlzPC9zdHJvbmc+IGR1cmFudGUgYSBtYW5udXRlbsOnw6NvOiA8L3A+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9wPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx1bD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGxpPlRvZG9zIHNlcnZpw6dvcyByZWxhY2lvbmFkb3MgYW8gUGl4W25hbWVdPC9saT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxsaT5QbGF0YWZvcm1hIDxzdHJvbmc+cWl0ZWNoLmFwcDwvc3Ryb25nPjwvbGk+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8bGk+VG9kYXMgYXMgQVBJczwvbGk+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8bGk+QVBQIFFpIENvbnRhPC9saT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3VsPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwIHN0eWxlPSJtYXJnaW46IDA7IGZvbnQtc2l6ZTogMTZweDsgdGV4dC1hbGlnbjogbGVmdDsgbXNvLWxpbmUtaGVpZ2h0LWFsdDogMTYuOHB4OyI+Jm5ic3A7PC9wPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwIHN0eWxlPSJtYXJnaW46IDA7IGZvbnQtc2l6ZTogMTZweDsgdGV4dC1hbGlnbjogbGVmdDsiPkF0ZW5jaW9zYW1lbnRlLDwvcD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RkPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RyPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90YWJsZT4KICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RkPgogICAgICAgICAgICAgICAgICAgICAgICA8L3RyPgogICAgICAgICAgICAgICAgICAgICAgPC90Ym9keT4KICAgICAgICAgICAgICAgICAgICA8L3RhYmxlPgogICAgICAgICAgICAgICAgICA8L3RkPgogICAgICAgICAgICAgICAgPC90cj4KICAgICAgICAgICAgICA8L3Rib2R5PgogICAgICAgICAgICA8L3RhYmxlPgogICAgICAgICAgICA8dGFibGUgY2xhc3M9InJvdyByb3ctMyIgYWxpZ249ImNlbnRlciIgd2lkdGg9IjEwMCUiIGJvcmRlcj0iMCIgY2VsbHBhZGRpbmc9IjAiIGNlbGxzcGFjaW5nPSIwIiByb2xlPSJwcmVzZW50YXRpb24iIHN0eWxlPSJtc28tdGFibGUtbHNwYWNlOiAwcHQ7IG1zby10YWJsZS1yc3BhY2U6IDBwdDsgYmFja2dyb3VuZC1jb2xvcjogI2ZmZjsiPgogICAgICAgICAgICAgIDx0Ym9keT4KICAgICAgICAgICAgICAgIDx0cj4KICAgICAgICAgICAgICAgICAgPHRkPgogICAgICAgICAgICAgICAgICAgIDx0YWJsZSBjbGFzcz0icm93LWNvbnRlbnQgc3RhY2siIGFsaWduPSJjZW50ZXIiIGJvcmRlcj0iMCIgY2VsbHBhZGRpbmc9IjAiIGNlbGxzcGFjaW5nPSIwIiByb2xlPSJwcmVzZW50YXRpb24iIHN0eWxlPSJtc28tdGFibGUtbHNwYWNlOiAwcHQ7IG1zby10YWJsZS1yc3BhY2U6IDBwdDsgY29sb3I6ICNmZmY7IHdpZHRoOiA2MDBweDsiIHdpZHRoPSI2MDAiPgogICAgICAgICAgICAgICAgICAgICAgPHRib2R5PgogICAgICAgICAgICAgICAgICAgICAgICA8dHI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkIGNsYXNzPSJjb2x1bW4iIHdpZHRoPSIxMDAlIiBzdHlsZT0ibXNvLXRhYmxlLWxzcGFjZTogMHB0OyBtc28tdGFibGUtcnNwYWNlOiAwcHQ7IGZvbnQtd2VpZ2h0OiA0MDA7IHRleHQtYWxpZ246IGxlZnQ7IHZlcnRpY2FsLWFsaWduOiB0b3A7IHBhZGRpbmctbGVmdDogMjBweDsgcGFkZGluZy1yaWdodDogMjBweDsgcGFkZGluZy10b3A6IDBweDsgcGFkZGluZy1ib3R0b206IDEwcHg7IGJvcmRlci10b3A6IDBweDsgYm9yZGVyLXJpZ2h0OiAwcHg7IGJvcmRlci1ib3R0b206IDBweDsgYm9yZGVyLWxlZnQ6IDBweDsiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRhYmxlIGNsYXNzPSJpbWFnZV9ibG9jayIgd2lkdGg9IjEwMCUiIGJvcmRlcj0iMCIgY2VsbHBhZGRpbmc9IjAiIGNlbGxzcGFjaW5nPSIwIiByb2xlPSJwcmVzZW50YXRpb24iIHN0eWxlPSJtc28tdGFibGUtbHNwYWNlOiAwcHQ7IG1zby10YWJsZS1yc3BhY2U6IDBwdDsiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dHI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkIHN0eWxlPSJ3aWR0aDoxMDAlO3BhZGRpbmctcmlnaHQ6MHB4O3BhZGRpbmctbGVmdDowcHg7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgYWxpZ249ImNlbnRlciIgc3R5bGU9ImxpbmUtaGVpZ2h0OjEwcHgiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aW1nIHNyYz0iaHR0cHM6Ly85bzM3Lm1qdC5sdS90cGxpbWcvOW8zNy9iLzF5ejdpL2hrM3NwLnBuZyIgc3R5bGU9ImRpc3BsYXk6IGJsb2NrOyBoZWlnaHQ6IGF1dG87IGJvcmRlcjogMDsgd2lkdGg6IDEyNnB4OyBtYXgtd2lkdGg6IDEwMCU7IiB3aWR0aD0iMTI2Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvdHI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RhYmxlPgogICAgICAgICAgICAgICAgICAgICAgICAgIDwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgIDwvdHI+CiAgICAgICAgICAgICAgICAgICAgICA8L3Rib2R5PgogICAgICAgICAgICAgICAgICAgIDwvdGFibGU+CiAgICAgICAgICAgICAgICAgIDwvdGQ+CiAgICAgICAgICAgICAgICA8L3RyPgogICAgICAgICAgICAgIDwvdGJvZHk+CiAgICAgICAgICAgIDwvdGFibGU+CiAgICAgICAgICAgIDx0YWJsZSBjbGFzcz0icm93IHJvdy00IiBhbGlnbj0iY2VudGVyIiB3aWR0aD0iMTAwJSIgYm9yZGVyPSIwIiBjZWxscGFkZGluZz0iMCIgY2VsbHNwYWNpbmc9IjAiIHJvbGU9InByZXNlbnRhdGlvbiIgc3R5bGU9Im1zby10YWJsZS1sc3BhY2U6IDBwdDsgbXNvLXRhYmxlLXJzcGFjZTogMHB0OyI+CiAgICAgICAgICAgICAgPHRib2R5PgogICAgICAgICAgICAgICAgPHRyPgogICAgICAgICAgICAgICAgICA8dGQ+CiAgICAgICAgICAgICAgICAgICAgPHRhYmxlIGNsYXNzPSJyb3ctY29udGVudCBzdGFjayIgYWxpZ249ImNlbnRlciIgYm9yZGVyPSIwIiBjZWxscGFkZGluZz0iMCIgY2VsbHNwYWNpbmc9IjAiIHJvbGU9InByZXNlbnRhdGlvbiIgc3R5bGU9Im1zby10YWJsZS1sc3BhY2U6IDBwdDsgbXNvLXRhYmxlLXJzcGFjZTogMHB0OyBjb2xvcjogI2ZmZjsgd2lkdGg6IDYwMHB4OyIgd2lkdGg9IjYwMCI+CiAgICAgICAgICAgICAgICAgICAgICA8dGJvZHk+CiAgICAgICAgICAgICAgICAgICAgICAgIDx0cj4KICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQgY2xhc3M9ImNvbHVtbiIgd2lkdGg9IjEwMCUiIHN0eWxlPSJtc28tdGFibGUtbHNwYWNlOiAwcHQ7IG1zby10YWJsZS1yc3BhY2U6IDBwdDsgZm9udC13ZWlnaHQ6IDQwMDsgdGV4dC1hbGlnbjogbGVmdDsgdmVydGljYWwtYWxpZ246IHRvcDsgcGFkZGluZy10b3A6IDVweDsgcGFkZGluZy1ib3R0b206IDVweDsgYm9yZGVyLXRvcDogMHB4OyBib3JkZXItcmlnaHQ6IDBweDsgYm9yZGVyLWJvdHRvbTogMHB4OyBib3JkZXItbGVmdDogMHB4OyI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGFibGUgY2xhc3M9Imh0bWxfYmxvY2siIHdpZHRoPSIxMDAlIiBib3JkZXI9IjAiIGNlbGxwYWRkaW5nPSIwIiBjZWxsc3BhY2luZz0iMCIgcm9sZT0icHJlc2VudGF0aW9uIiBzdHlsZT0ibXNvLXRhYmxlLWxzcGFjZTogMHB0OyBtc28tdGFibGUtcnNwYWNlOiAwcHQ7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRyPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgc3R5bGU9ImZvbnQtZmFtaWx5Ok1vbnRzZXJyYXQsIFRyZWJ1Y2hldCBNUywgTHVjaWRhIEdyYW5kZSwgTHVjaWRhIFNhbnMgVW5pY29kZSwgTHVjaWRhIFNhbnMsIFRhaG9tYSwgc2Fucy1zZXJpZjt0ZXh0LWFsaWduOmNlbnRlcjsiIGFsaWduPSJjZW50ZXIiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IHN0eWxlPSJoZWlnaHQ6MzBweDsiPiZuYnNwOzwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90ZD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90cj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvdGFibGU+CiAgICAgICAgICAgICAgICAgICAgICAgICAgPC90ZD4KICAgICAgICAgICAgICAgICAgICAgICAgPC90cj4KICAgICAgICAgICAgICAgICAgICAgIDwvdGJvZHk+CiAgICAgICAgICAgICAgICAgICAgPC90YWJsZT4KICAgICAgICAgICAgICAgICAgPC90ZD4KICAgICAgICAgICAgICAgIDwvdHI+CiAgICAgICAgICAgICAgPC90Ym9keT4KICAgICAgICAgICAgPC90YWJsZT4KICAgICAgICAgIDwvdGQ+CiAgICAgICAgPC90cj4KICAgICAgPC90Ym9keT4KICAgIDwvdGFibGU+CiAgICA8IS0tIEVuZCAtLT4KICAgIDxkaXYgc3R5bGU9ImJhY2tncm91bmQ6I2ZmZmZmZjtiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmY7bWFyZ2luOjBweCBhdXRvO21heC13aWR0aDo2MDBweDsiPgogICAgICA8dGFibGUgYWxpZ249ImNlbnRlciIgYm9yZGVyPSIwIiBjZWxscGFkZGluZz0iMCIgY2VsbHNwYWNpbmc9IjAiIHJvbGU9InByZXNlbnRhdGlvbiIgc3R5bGU9ImJhY2tncm91bmQ6I2ZmZmZmZjtiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmY7d2lkdGg6MTAwJTsiPgogICAgICAgIDx0Ym9keT4KICAgICAgICAgIDx0cj4KICAgICAgICAgICAgPHRkIHN0eWxlPSJib3JkZXI6MHB4IHNvbGlkICNmZmZmZmY7ZGlyZWN0aW9uOmx0cjtmb250LXNpemU6MHB4O3BhZGRpbmc6MHB4IDMwcHggMjVweCAzMHB4O3BhZGRpbmctYm90dG9tOjI1cHg7cGFkZGluZy1sZWZ0OjMwcHg7cGFkZGluZy1yaWdodDozMHB4O3BhZGRpbmctdG9wOjBweDt0ZXh0LWFsaWduOmNlbnRlcjsiPgogICAgICAgICAgICAgIDwhLS1baWYgbXNvIHwgSUVdPgoJCQkJCQkJCQkJCQkJCQk8dGFibGUgcm9sZT0icHJlc2VudGF0aW9uIiBib3JkZXI9IjAiIGNlbGxwYWRkaW5nPSIwIiBjZWxsc3BhY2luZz0iMCI+CgkJCQkJCQkJCQkJCQkJCQk8dHI+CgkJCQkJCQkJCQkJCQkJCQkJPHRkIGNsYXNzPSIiIHN0eWxlPSJ2ZXJ0aWNhbC1hbGlnbjp0b3A7d2lkdGg6NTQwcHg7IiA+CgkJCQkJCQkJCQkJCQkJCQkJCTwhW2VuZGlmXS0tPgogICAgICAgICAgICAgIDxkaXYgY2xhc3M9Im1qLWNvbHVtbi1wZXItMTAwIG1qLW91dGxvb2stZ3JvdXAtZml4IiBzdHlsZT0iZm9udC1zaXplOjBweDt0ZXh0LWFsaWduOmxlZnQ7ZGlyZWN0aW9uOmx0cjtkaXNwbGF5OmlubGluZS1ibG9jazt2ZXJ0aWNhbC1hbGlnbjp0b3A7d2lkdGg6MTAwJTsiPgogICAgICAgICAgICAgICAgPHRhYmxlIGJvcmRlcj0iMCIgY2VsbHBhZGRpbmc9IjAiIGNlbGxzcGFjaW5nPSIwIiByb2xlPSJwcmVzZW50YXRpb24iIHN0eWxlPSJ2ZXJ0aWNhbC1hbGlnbjp0b3A7IiB3aWR0aD0iMTAwJSI+CiAgICAgICAgICAgICAgICAgIDx0cj4KICAgICAgICAgICAgICAgICAgICA8dGQgYWxpZ249ImxlZnQiIHN0eWxlPSJmb250LXNpemU6MHB4O3BhZGRpbmc6MTBweCAyNXB4O3BhZGRpbmctdG9wOjBweDtwYWRkaW5nLWJvdHRvbTowcHg7d29yZC1icmVhazpicmVhay13b3JkOyI+CiAgICAgICAgICAgICAgICAgICAgICA8ZGl2IHN0eWxlPSJmb250LWZhbWlseTpBcmlhbCwgc2Fucy1zZXJpZjtmb250LXNpemU6MTRweDtsZXR0ZXItc3BhY2luZzpub3JtYWw7bGluZS1oZWlnaHQ6MTt0ZXh0LWFsaWduOmxlZnQ7Y29sb3I6IzAwMDAwMDsiPgogICAgICAgICAgICAgICAgICAgICAgICA8cCBjbGFzcz0idGV4dC1idWlsZC1jb250ZW50IiBzdHlsZT0idGV4dC1hbGlnbjogY2VudGVyOyBtYXJnaW46IDEwcHggMDsgbWFyZ2luLXRvcDogMTBweDsiIGRhdGEtdGVzdGlkPSIyNFlfYk1SSW9JIj4KICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBzdHlsZT0iY29sb3I6IzE5MjQ3RTtmb250LWZhbWlseTpSb2JvdG87Zm9udC1zaXplOjE0cHg7Ij48L3NwYW4+CiAgICAgICAgICAgICAgICAgICAgICAgIDwvcD4KICAgICAgICAgICAgICAgICAgICAgICAgPHAgY2xhc3M9InRleHQtYnVpbGQtY29udGVudCIgc3R5bGU9InRleHQtYWxpZ246IGNlbnRlcjsgbWFyZ2luOiAxMHB4IDA7IG1hcmdpbi1ib3R0b206IDEwcHg7IiBkYXRhLXRlc3RpZD0iMjRZX2JNUklvSSI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gc3R5bGU9ImNvbG9yOiMxOTI0N0U7Zm9udC1mYW1pbHk6Um9ib3RvO2ZvbnQtc2l6ZToxNHB4OyI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YSBocmVmPSJbW1VOU1VCX0xJTktfRU5dXSI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxiciAvPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnIgLz4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYT4KICAgICAgICAgICAgICAgICAgICAgICAgICA8L3NwYW4+CiAgICAgICAgICAgICAgICAgICAgICAgIDwvcD4KICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgICAgICAgIDwvdGQ+CiAgICAgICAgICAgICAgICAgIDwvdHI+CiAgICAgICAgICAgICAgICA8L3RhYmxlPgogICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgIDwhLS1baWYgbXNvIHwgSUVdPgoJCQkJCQkJCQkJCQkJCQkJCTwvdGQ+CgkJCQkJCQkJCQkJCQkJCQk8L3RyPgoJCQkJCQkJCQkJCQkJCQk8L3RhYmxlPgoJCQkJCQkJCQkJCQkJCQk8IVtlbmRpZl0tLT4KICAgICAgICAgICAgPC90ZD4KICAgICAgICAgIDwvdHI+CiAgICAgICAgPC90Ym9keT4KICAgICAgPC90YWJsZT4KICAgIDwvZGl2PgogICAgPCEtLVtpZiBtc28gfCBJRV0+CgkJCQkJCQkJCTwvdGQ+CgkJCQkJCQkJPC90cj4KCQkJCQkJCTwvdGFibGU+CgkJCQkJCQk8IVtlbmRpZl0tLT4KICA8L2JvZHk+CjwvaHRtbD4="
}
```

## BODY PARAMS

| Field          | Type   | Description                         | Characters |
|----------------|--------|-------------------------------------|------------|
| `template_type` * | string | Type of template -> Default value `email` | -          |
| `template` *   | string | Base64 encoded template             | -          |
| `subject` *    | string | Email subject                       | 80         |

## Response

STATUS 201

Response Body

```json
{
    "template_key": "17f49953-29a1-439c-a6be-db37a32e2746"
}
```

## Templates listing

## Request

ENDPOINT /notification/templates
METHOD GET

## Response

STATUS 200

Response Body

```json
{
  "data": [{
    "template_key": "b35ed5fc-fdda-4618-84e6-b49876dabf24",
    "template_type": "sms",
    "template_status": "480521cc-b0c9-4938-bd11-0000be11c66b",
    "template": "Seu código é [code]"
  }],
  "pagination": {
        "current_page": 1,
        "next_page": null,
        "rows_per_page": 1
    }
}
```

---

# Events

URL: /en/documentation/notificacoes/tipos_de_evento

Events trigger notifications. By reviewing the event list, you can gain understanding of the types of notifications you can receive and the means through which they are delivered (webhook, email, and SMS).

Events have the attributes `allowed_sms`, `allowed_email`, and `allowed_callback` that indicate the possibility of sending SMS, emails, or callbacks respectively. Additionally, in cases where email and SMS sending is possible, they may contain `allowed_custom_vars` that indicate the variables that can be replaced in the template using the format `[allowed_custom_var]`, which will be replaced by its corresponding value during delivery.
## Events consult

## Request

ENDPOINT /notification/event_types
METHOD GET

### Query Params

| Field      | Type   | Description                              |
|------------|--------|------------------------------------------|
| `page`     | number | Page to be retrieved, default value is 0  |
| `page_size`| number | Number of items to be retrieved, default is 10 |

## Response

STATUS 200

Response Body: Event types list

```json
{
    "data": [
        {
            "event_type": "incoming_ted",
            "allow_sms": false,
            "allow_email": true,
            "allow_callback": true,
            "allowed_custom_vars": ["total_amount", "target_account_number", "target_document_number"]
        },
        {
            "event_type": "outgoing_ted",
            "allow_sms": true,
            "allow_email": true,
            "allow_callback": false,
            "allowed_custom_vars": null
        }
    ],
    "pagination": {
        "current_page": 1,
        "next_page": 2,
        "rows_per_page": 2
    }
}

```

---

# Address Object

URL: /en/documentation/objetos_compartilhados/address

The `address` object is used in various APIs to represent an address. The structure is standardized across all endpoints.

## Structure

| Field | Type | Required | Description |
|-|-|-|-|
| `street` | string | Yes | Street address. |
| `number` | string | Yes | Address number. |
| `complement` | string | No | Complement. |
| `neighborhood` | string | Yes | Neighborhood. |
| `city` | string | Yes | City. |
| `state` | string | Yes | State (2-character abbreviation). |
| `postal_code` | string | Yes | Postal code (format `XXXXXXXX`, without hyphen). |

## Example

```json
{
  "street": "Rua Example",
  "number": "123",
  "complement": "Sala 1",
  "neighborhood": "Centro",
  "city": "São Paulo",
  "state": "SP",
  "postal_code": "01001000"
}
```

## Endpoints that use this object

- [Individual account opening (BaaS)](/documentation/baas/escrow/abrir_conta_pf)
- [Corporate account opening (BaaS)](/documentation/baas/escrow/abrir_conta_pj)
- [Investor registration (IaaS)](/documentation/iaas/investidor/cadastro/criar_investidor)
- [Debt issuance](/documentation/emissao_de_divida/simulacao_de_divida/simulacao_de_divida)

---

# Borrower Object

URL: /en/documentation/objetos_compartilhados/borrower

The `borrower` object represents the credit borrower in debt operations. It is used in various Lending-as-a-Service endpoints.

## Structure — Individual (natural_person)

| Field | Type | Required | Description |
|-|-|-|-|
| `person_type` | string | Yes | Person type. Values: `natural` or `legal`. |
| `name` | string | Yes | Full name of the borrower. |
| `document_number` | string | Yes | CPF (11 digits, without punctuation). |
| `mother_name` | string | No | Mother's name. |
| `birth_date` | string | No | Birth date (`YYYY-MM-DD` format). |
| `nationality` | string | No | Nationality. |
| `gender` | string | No | Gender. Values: `male`, `female`. |
| `email` | string | No | Borrower's email. |
| `phone` | object | No | [phone](#phone) object. |
| `address` | object | No | [address](/documentation/objetos_compartilhados/address) object. |

## Structure — Legal Entity (legal_person)

| Field | Type | Required | Description |
|-|-|-|-|
| `person_type` | string | Yes | Value: `legal`. |
| `company_name` | string | Yes | Corporate name. |
| `trading_name` | string | No | Trade name. |
| `document_number` | string | Yes | CNPJ (14 digits, without punctuation). |
| `foundation_date` | string | No | Foundation date (`YYYY-MM-DD` format). |
| `email` | string | No | Corporate email. |
| `phone` | object | No | [phone](#phone) object. |
| `address` | object | No | [address](/documentation/objetos_compartilhados/address) object. |

## Phone

| Field | Type | Required | Description |
|-|-|-|-|
| `country_code` | string | Yes | Country code (e.g.: `"55"`). |
| `area_code` | string | Yes | Area code (e.g.: `"11"`). |
| `number` | string | Yes | Phone number. |

## Example

```json
{
  "person_type": "natural",
  "name": "João da Silva",
  "document_number": "12345678901",
  "mother_name": "Maria da Silva",
  "birth_date": "1990-01-01",
  "phone": {
    "country_code": "55",
    "area_code": "11",
    "number": "999999999"
  },
  "address": {
    "street": "Rua Example",
    "number": "123",
    "neighborhood": "Centro",
    "city": "São Paulo",
    "state": "SP",
    "postal_code": "01001000"
  }
}
```

---

# Disbursement Account Object

URL: /en/documentation/objetos_compartilhados/disbursement_account

The `disbursement_account` object represents the bank account used for resource disbursement in credit operations.

## Structure

| Field | Type | Required | Description |
|-|-|-|-|
| `account_branch` | string | Yes | Bank branch (without check digit). |
| `account_digit` | string | Yes | Account check digit. |
| `account_number` | string | Yes | Account number (without digit). |
| `document_number` | string | Yes | CPF/CNPJ of the account holder. |
| `financial_institution_code` | string | Yes | ISPB or COMPE code of the financial institution. |
| `name` | string | Yes | Account holder's name. |
| `account_type` | string | Yes | Account type. Values: `checking_account`, `savings_account`, `payment_account`. |

## Example

```json
{
  "account_branch": "0001",
  "account_digit": "2",
  "account_number": "12345",
  "document_number": "12345678901",
  "financial_institution_code": "329",
  "name": "João da Silva",
  "account_type": "checking_account"
}
```

## Endpoints that use this object

- [Debt simulation](/documentation/emissao_de_divida/simulacao_de_divida/simulacao_de_divida)
- [Authorize disbursement](/documentation/emissao_de_divida/autorizar_desembolso)
- [Private payroll loan](/documentation/manual_consignado_privado/criacao_da_operacao)

---

# Financial Institution Object

URL: /en/documentation/objetos_compartilhados/financial_institution

The `financial_institution` object identifies a financial institution participating in an operation.

## Structure

| Field | Type | Required | Description |
|-|-|-|-|
| `ispb_code` | string | Yes | ISPB code (8 digits) of the financial institution. |
| `compe_code` | string | No | COMPE code (3 digits) of the financial institution. |
| `name` | string | No | Name of the financial institution. |

## Example

```json
{
  "ispb_code": "32402502",
  "compe_code": "329",
  "name": "QI Sociedade de Crédito Direto S.A."
}
```

## Reference

For the complete list of financial institutions and their codes, see the [Financial Institutions List](/documentation/lista_de_instituicoes_financeiras).

---

# Manual Operacional de Boletos

URL: /en/documentation/operational_guide/boletos

## Tipos de cobrança

### Boletos bancários

São instrumentos de cobrança emitidos por uma instituição financeira a pedido de uma pessoa física ou jurídica que possua
uma conta bancária nesta instituição.

Esses instrumentos de cobrança são registrados pela instituição financeira na base centralizada de boletos do Brasil
([PCR - Nuclea](https://www.nuclea.com.br/plataforma-centralizada-de-recebiveis/)).

### Faturas de recolhimento e tributos

São instrumentos de cobrança utilizados para arrecadação/recebimento de tributos/taxas estaduais, municipais, federais e 
contas de concessionárias de serviços públicos como energia, água, telefonia e gás.

Cada convênio/órgão de arrecadação possuas suas próprias regras de horário/data de pagamento. Você pode conferir a lista de
convênios e horários através deste [link](https://storage.googleapis.com/live-doc-api/public_samples/active_covenants.xlsx).

:::caution Atenção!
A QI Tech só realiza o pagamento de faturas de recolhimento que possuem linha digitável ou código de barras.
:::

## Pagamento

Para realizar o pagamento de um boleto ou fatura de recolhimento, basta informar a conta de origem do pagamento, a linha digitável 
do boleto/fatura que será pago e a data em que o pagamento deve ser realizado.

Abaixo são listados os horários para pagamento de boletos bancários, faturas de recolhimento e tributos dentro da QI Tech.

| Valor do Boleto        | Horário        | Disponibilidade   |
|------------------------|----------------|-------------------|
| até R$ 249.999,99      | 06:00 às 22:00 | apenas dias úteis |
| acima de R$ 250.000,00 | 07:00 às 17:00 | apenas dias úteis |

:::caution Atenção!
Alguns tipos específicos de fatura de recolhimento e tributos, possuem horários diferentes da tabela acima, devido a 
particularidades relacionadas ao emissor/recebedor da cobrança. Para mais informações, confira nossa
tabela de horários para esses tipos de cobrança através deste [link](https://storage.googleapis.com/live-doc-api/public_samples/active_covenants.xlsx).
:::

### Limites de pagamento

O valor para pagamento de boletos bancários esta limitado ao saldo em conta do pagador.

### Liquidação financeira dos pagamentos

#### Boleto bancário

Quando um boleto bancário é pago em qualquer instituição financeira oferecedora desse meio de pagamento, o valor do boleto pago será recebido pelo
emissor da cobrança no próximo dia útil da data do pagamento (ex: um boleto pago na quinta-feira, será liquidado na sexta-feira. 
Um boleto pago em um sábado, será liquidado na segunda-feira).

Ou seja, caso um cliente da QI Tech tenha registrado um boleto em sua conta, ele só receberá o valor do boleto, um dia útil após seu pagamento (mesmo que esse pagamento
seja executado pela própria QI Tech).

#### Fatura de recolhimento e tributos

A liquidação de faturas do recolhimento e tributos, depende das regras e aspectos operacionais de cada órgão/agente que a emitiu.

---

# Realizando uma transação Peer To Peer

URL: /en/documentation/peer_to_peer

:::danger Atenção
Este método só pode ser utilizado para transações entre contas QI e de mesmo parceiro integrador.
:::

## Request

ENDPOINT /account/ SOURCE_ACCOUNT_KEY /transaction/peer_to_peer
MÉTODO POST

### Path params

| Atributo                | Tipo   | Descrição                                                                    | Caracteres                 |
|-------------------------|--------|------------------------------------------------------------------------------|----------------------------|
| `source_account_key` *  | uuidv4 | Chave única de identificação que indica a conta de origem da transferência.  | 36                         |

Request Body

```json
{
    "transaction_amount": 15,
    "request_control_key": "540ca9f6-7ccf-42a8-92d2-eafa6c8ac152",
    "target_account_key": "f8b5d8cf-23d3-47eb-8f2d-c97278372ecf",
    "description": "Compra com autorização externa"
}
```

### Body Atributes

| Atributo                | Tipo   | Descrição                                                                    | Caracteres                 |
|-------------------------|--------|------------------------------------------------------------------------------|----------------------------|
| `transaction_amount` *  | float  | Valor a ser transferido da source account para target account.               | float com 2 casas decimais |
| `request_control_key` * | uuidv4 | Chave única de identificação destinado a manter a idepotência de transações. | 36                         |
| `target_account_key` *  | uuidv4 | Chave única de identificação que indica a conta de destino da transferência. | 36                         |
| `description` *         | string | Descrição da transação utilizada para identificação no extrato das contas.   | 36                         |

## Response

STATUS 201

Response Body

```json
{
    "peer_to_peer_transaction_key": "c102f984-d93c-4d74-aca1-bbf83310c835",
    "request_control_key": "540ca9f6-7ccf-42a8-92d2-eafa6c8ac152",
    "transactions": [
        {
            "account_balance": 15.0,
            "account_branch": "0001",
            "account_number": "7107708",
            "description": "Compra com autorização externa",
            "document_number": "30461737337",
            "source_account_key": "cf069da7-5f3e-4808-9cfa-ac49a3928b70",
            "target_account_key": "f8b5d8cf-23d3-47eb-8f2d-c97278372ecf",
            "transacted_at": "2020-08-06 19:22:06",
            "transaction_amount": 15,
            "transaction_key": "848d3ff7-4e98-4911-8773-f1d1b48c3068"
        },
        {
            "account_balance": 35.0,
            "account_branch": "0001",
            "account_number": "9629460",
            "description": "Compra com autorização externa",
            "document_number": "74106519461",
            "source_account_key": "f8b5d8cf-23d3-47eb-8f2d-c97278372ecf",
            "target_account_key": "cf069da7-5f3e-4808-9cfa-ac49a3928b70",
            "transacted_at": "2020-08-06 19:22:06",
            "transaction_amount": -15,
            "transaction_key": "848d3ff7-4e98-4911-8773-f1d1b48c3068"
        }
    ]
}

```
STATUS 4XX

Response Body

```json
{
    "title": "titulo",
    "description": "description in English",
    "translation": "descrição em portugues",
    "code": "codigo"
}
```

| Código HTTP | Código QI<br/>`code` | Título<br/>`title`           | Descrição (eng)<br/>`Description`                                    | Descrição (ptbr)<br/>`translation`                                               |
|-------------|-------------------|------------------------------|----------------------------------------------------------------------|----------------------------------------------------------------------------------|
| 404         | ACC000208         | Account not found            | Account not found.                                                   | Conta não encontrada.                                                            |
| 405         | ACC000209         | Method not allowe            | you are not allowed to call this method.                             | Você não tem permissão para este método.                                         |
| 403         | ACC000210         | Forbidden                    | Escrow account are not allowed to call this method.                  | Método não permitido para contas escrow.                                         |
| 409         | ACC000211         | Conflict                     | Duplicated request control key <strong>request_control_key</strong>. | Entrada duplicada para request control key <strong>request_control_key</strong>. |
| 402         | ACC000027         | Account Balance Error        | Account balance must not be negative after the transaction.          | Saldo da conta não pode ser negativo após a transação.                           |

---

# Creating a PIX key for an Alias

URL: /en/documentation/pix_indireto/chaves_pix/criacao_de_chaves

## Request

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY /pix_key
METHOD POST

**Request Body - 'random_key' type key**

```json
{
  "request_control_key": "3d3d0083-ac71-46f0-8a90-c00a157a4893",
  "pix_key_type": "random_key"
}
```

**Request Body - CPF type key**

```json
{
  "request_control_key": "3d3d0083-ac71-46f0-8a90-c00a157a4893",
  "pix_key_type": "cpf",
  "pix_key": "67824450007"
}
```

### Request Path Params

| Field         | Type   | Description           | Characters |
|---------------|--------|-----------------------|------------|
| `account_key` | uuidv4 | Unique account key.   | 36         |
| `alias_key`   | uuidv4 | Unique alias key.     | 36         |

### Request Body Params

| Field                   | Type   | Description                                                                     | Max. Characters |
|-------------------------|--------|---------------------------------------------------------------------------------|-----------------|
| `request_control_key` * | string | UUID4 for querying purposes about the made request.                            | 36              |
| `pix_key_type` *        | string | Definition of the type of key to be created. Possible values: 'cpf', 'cnpj', 'email', 'phone_number', 'random_key'  | 10              |
| `pix_key`         | string | PIX key value to be created. Should not be sent for 'random_key' type cases.  | 10              |

:::info PIX Key Types
The `pix_key` sent in the request can be a CPF, CNPJ, email or mobile phone, following these formats:

**CPF**: Integer number with 11 digits.

**CNPJ**: Integer number with 14 digits.

**Email**: Text containing at least one "@".

**Mobile phone**: Text containing the following values: "+55" + "mobile area code" + "Mobile phone integer number with minimum 8
and maximum 9 digits". Ex: "+5511987654321".

:::

## Response

STATUS 200

Response Body

```json

{
  "pix_key": "asra-4cd6-4c04-9651-1c0a2c30d7dd",
  "pix_key_status": "active",
  "created_at": "2021-12-06T21:16:11.001Z",
  "pix_key_type": "random_key"
}

```

### Response Body Params

| Field                   | Type   | Description                                                                     | Max. Characters |
|-------------------------|--------|---------------------------------------------------------------------------------|-----------------|
| `pix_key`         | string | Created PIX key value. | 200              |
| `pix_key_status`         | string | PIX key activation status. Can be "active","inactive" or "pending" | 8              |
| `created_at`            | datetime Zulu | Request creation date. | 20 |

:::info PIX Key Types
The `pix_key` sent in the request response can be a CPF, CNPJ, email, mobile phone or random key, following these formats:

**CPF**: Integer number with 11 digits.

**CNPJ**: Integer number with 14 digits.

**Email**: Text containing at least one "@".

**Mobile phone**: Text containing the following values: "+55" + "mobile area code" + "Mobile phone integer number with minimum 8
and maximum 9 digits". Ex: "+5511987654321".

**Random key**: UUIDV4.
:::

STATUS 4XX

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`    | Description (eng)<br/>`Description`                               | Description (ptbr)<br/>`translation`                           |
|-------------|----------------------|-----------------------|-----------------------------------------------------------------|--------------------------------------------------------------|
| 403         | PIX000080            | Not enough permission | The selected agent is not an Pix Indirect Participant           | O agente selecionado não é um Participante Indireto do Pix   |
| 404         | PIX000082            | Alias not found       | Alias \{alias_key\} not found                                     | Alias \{alias_key\} não encontrado                             |

---

# Pix Key deletion for an Alias

URL: /en/documentation/pix_indireto/chaves_pix/deletar_chaves

## Request

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY /pix_key/ PIX_KEY
METHOD DELETE

Request Body

```json

{}

```

### Path Params

| Field        | Type   | Description                  | Characters |
|--------------|--------|------------------------------|------------|
| `account_key`| uuidv4 | Unique account key.          | 36         |
| `alias_key`  | uuidv4 | Unique alias key.            | 36         |
| `pix_key`    | string | PIX key to be deleted.        | 200        |

## Response

STATUS 200

Response Body

```json
{}
```

STATUS 4XX

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in portuguese",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`    | Description (eng)<br/>`Description`                               | Description (ptbr)<br/>`translation`                           |
|-------------|----------------------|-----------------------|-----------------------------------------------------------------|--------------------------------------------------------------|
| 403         | PIX000080            | Not enough permission | The selected agent is not an Pix Indirect Participant           | O agente selecionado não é um Participante Indireto do Pix   |
| 404         | PIX000082            | Alias not found       | Alias \{alias_key\} not found                                     | Alias \{alias_key\} não encontrado                             |
| 400         | PIX000087            | Pix key type          | Only pix key type random_key is currently implemented for alias | Random_key é o único tipo atualmente implementado para alias |
| 404         | PIX000083            | Pix Key not found     | Pix Key \{pix_key\} not found for Alias \{alias_key\}               | Chave Pix \{pix_key\} não encontrada para o Alias \{alias_key\}  |

---

# Introduction to PIX key management for an Alias

URL: /en/documentation/pix_indireto/chaves_pix/introducao_chaves_pix

After the Indirect Participant has registered an Alias for their account opened at QI Tech, they can register a PIX key for this Alias which, in practice, represents the Indirect Participant's client.

Since the Indirect Participant has already registered the Alias, they simply need to indicate to QI Tech that they wish to open a PIX key for a specific Alias, which has a unique key that is provided when the Indirect Participant registers an Alias.

:::info Information

Everything described in this introduction section is also detailed in the following sections regarding how the Indirect Participant should handle it via API.

:::

---

# Pix Keys listing for an Alias

URL: /en/documentation/pix_indireto/chaves_pix/listar_chaves

## Request

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY /pix_key
METHOD GET

### Path Params
| Field        | Type   | Description          | Characters |
|--------------|--------|----------------------|------------|
| `account_key`| string | Unique account key.  | 36         |
| `alias_key`  | string | Unique alias key.    | 36         |

:::info Pix Key Types
The “pix_key” is of the type Random Key (UUID4), following this format:
Random Key: UUID4.
:::

### Query Params
| Field         | Type    | Description                           | Characters |
|---------------|---------|---------------------------------------|------------|
| `page_number` | integer | Current page being queried.           | -          |
| `page_size`   | integer | Number of results per page.           | -          |

## Response

STATUS 200

Response Body: Key active

```json
{
  "data": [
    {
      "pix_key": "ecdb1790-667f-42ab-b319-fbc838a04672",
      "pix_key_type": "random_key",
      "pix_key_status": "active",
      "created_at": "2021-10-22T20:30:23.459Z"
    },
    {
      "pix_key": "f5eb52c1-5247-4de3-9982-f4f0ee9edad4",
      "pix_key_type": "random_key",
      "pix_key_status": "active",
      "created_at": "2021-12-06T21:16:12.123Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "next_page": null,
    "rows_per_page": 10
  }
}
```

### Response Body Params

| Field            | Type          | Description                                            | Max. Characters |
|------------------|---------------|--------------------------------------------------------|-----------------|
| `pix_key`        | string        | PIX key.                                               | 77              |
| `pix_key_type`   | string        | Type of the PIX key. Can be "random_key"               | 10              |
| `pix_key_status` | string        | Activation status of the PIX key. Can be "active", "inactive" or "pending" | 8  |
| `created_at`     | datetime Zulu | Date of creation of the request.                       | 20              |

STATUS 4XX

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in portuguese",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`       | Description (eng)<br/>`Description`                     | Description (ptbr)<br/>`translation`                             |
|-------------|----------------------|--------------------------|-------------------------------------------------------|----------------------------------------------------------------|
| 403         | PIX000080            | Not enough permission    | The selected agent is not an Pix Indirect Participant | O agente selecionado não é um Participante Indireto do Pix     |
| 404         | PIX000082            | Alias not found          | Alias \{alias_key\} not found                           | Alias \{alias_key\} não encontrado                               |
| 400         | PIX000088            | Page size too large      | Requested page size above limit of \{max_page_size\}    | Tamanho de página requerido acima do limite de \{max_page_size\} |
| 400         | PIX000089            | Invalid value for params | Page Size and Page Number must be integers            | age Size e Page Number devem ser números inteiros              |

---

# Cancel Refund Request

URL: /en/documentation/pix_indireto/devolucao/cancelar_devolucao

The Indirect Participant can cancel a refund request if necessary.

Only the Participant (Direct or Indirect) who created the refund request can cancel it.

To cancel, the status must be OPEN
:::danger IMPORTANT
The Central Bank of Brazil requires that, within a period of 1 day from the receipt of the Refund Request by the Indirect Participant, the Refund must be closed .
If there is a delay on the part of the Indirect Participant, QI Tech will close the Refund Request with the status of totally_accepted to ensure the institution is not penalized by the Central Bank of Brazil.
:::

## Request

ENDPOINT /pix/refund_request/ REFUND_REQUEST_KEY
METHOD PATCH

**Request Body**

```json
{
    "refund_request_status": "cancelled",
    "request_control_key": "e09aba97-0051-4c18-b645-1cb3c2581c34"
}

```

### Path Params
| Field                | Type   | Description              | Characters |
|----------------------|--------|--------------------------|------------|
| `refund_request_key` * | string | UUID4 of the already created refund. | 36         |

### Body Params
| Field                     | Type   | Description                                              | Characters |
|---------------------------|--------|----------------------------------------------------------|------------|
| `refund_request_status` * | string | Status of the refund update.                             | 36         |
| `request_control_key` *   | uuidv4 | UUID4 for querying about the made request.               | 36         |

## Response

STATUS 200

**Response Body**

```json
{
  "refund_request_key": "47633091-7d44-4d10-9d00-1f937104e537",
  "pix_transfer_key": "2bcbfd65-8660-4cb0-8ae4-4c4b327b32be",
  "end_to_end_id": "E73856642202407011350E8cnA3Ae7r3",
  "requested_amount": 10,
  "refund_request_status": "cancelled",
  "refund_request_type": "operational_flaw",
  "infraction_report_key": null,
  "refund_request_details": "Foi identificada uma fraude na transação.",
  "requesting_participant": "73856642",
  "contested_participant": "99999999",
  "analysis_result": null,
  "analysis_details": null,
  "reject_reason": null,
  "refund_transfer_key": null,
  "refunded_amount": 0.00,
  "refund_request_direction": "outgoing",
  "created_at": "2024-07-01T13:50:30Z"
}
```

### Body Params
| Field                       | Type   | Description                                                               | Characters |
|-----------------------------|--------|---------------------------------------------------------------------------|------------|
| `pix_transfer_key`*         | string | Unique identifier of the PIX transaction.                                 | 36         |
| `refund_request_key`*       | string | Unique identifier of the refund request.                                  | 36         |
| `infraction_report_key`*    | string | Unique identifier of the infraction related to the refund. Only when the type is FRAUD | 36  |
| `refund_request_type`       | enum   | Type of refund request.                                                   | **[Enumerators refund_request_type](#enumeradores-refund_request_type)** |
| `requested_amount`*         | float  | Refund amount                                                             | -          |
| `refund_request_status`*    | enum   | Status.                                                                   | **[Enumerators refund_request_status](#enumeradores-refund_request_status)** |
| `contested_participant`*    | string | ISPB of the Credited Participant (Contested).                             | 8          |
| `requesting_participant`*   | string | ISPB of the Debited Participant (Requesting, who is requesting the refund).| 8          |
| `refund_request_details`*   | string | Details about the refund request.                                         | -          |
| `analysis_result`*          | enum   | Result of the refund closure analysis.                                    | **[Enumerators analysis_result](#enumeradores-analysis_result)** |
| `analysis_details`*         | string | Details of the refund closure analysis.                                   | -          |
| `reject_reason`*            | string | Reason for rejecting the refund, if it is closed with REJECTED.           | **[Enumerators reject_reason](#enumeradores-reject_reason)** |
| `refund_transfer_key`*      | string | pix_transfer_key of the refund transaction, if it is closed with acceptance.   | -    |
| `refunded_amount`*          | float  | Amount refunded in the refund transaction.                                | -          |
| `refund_request_direction`* | string | Direction of the refund request.                                          | **[Enumerators refund_request_direction](#enumeradores-refund_request_direction)** |
| `created_at` *              | string | Refund Request creation date                                              | 24         |

### Enumerators refund_request_status
| Field       | Description                                                                 |
|-------------|-----------------------------------------------------------------------------|
| `open`      | Refund Request was <strong>created</strong> and is open at BACEN.           |
| `cancelled` | Refund Request is <strong>cancelled</strong> at BACEN                       |
| `closed`    | Refund Request is <strong>closed</strong> at BACEN                          |

### Enumerators refund_request_type
| Field             | Description                                               |
|-------------------|-----------------------------------------------------------|
| `fraud`           | Refund Request originating from fraud.                    |
| `operational_flaw`| Refund Request originating from an internal error.        |

### Enumerators analysis_result
| Field              | Description                                                |
|--------------------|------------------------------------------------------------|
| `totally_accepted` | Refund Request was fully accepted.                         |
| `partially_accepted` | Refund Request was partially accepted.                   |
| `rejected`         | Refund Request was rejected.                               |

### Enumerators reject_reason
| Field           | Description                                                  |
|-----------------|--------------------------------------------------------------|
| `no_balance`    | Account does not have sufficient balance for the refund.     |
| `account_closure` | Account is closed, so the refund cannot be processed       |
| `other`         | Other reason                                                 |

### Enumerators refund_request_direction
| Field       | Description                                                |
|-------------|------------------------------------------------------------|
| `outgoing`  | Participant is the originator of the refund request.       |
| `incoming`  | Participant is the target of the refund request.           |

---

# Consult Return Request

URL: /en/documentation/pix_indireto/devolucao/consultar_devolucao

If the Indirect Participant wishes to query the information of a Refund Request, the route below allows it.

:::danger IMPORTANT
The Central Bank of Brazil requires that, within a period of 1 day from the receipt of the Refund Request by the Indirect Participant, the Refund must be closed .
If there is a delay on the part of the Indirect Participant, QI Tech will close the Refund Request with the status of totally_accepted to ensure the institution is not penalized by the Central Bank of Brazil.
:::

## Request

ENDPOINT /pix/refund_request/ REFUND_REQUEST_KEY
METHOD GET

### Path Params
| Field                | Type   | Description           | Characters |
|----------------------|--------|-----------------------|------------|
| `refund_request_key` | string | UUID4 of the refund.  | 36         |

## Response

STATUS 200

**Response Body**

```json
{
  "refund_request_key": "47633091-7d44-4d10-9d00-1f937104e537",
  "pix_transfer_key": "2bcbfd65-8660-4cb0-8ae4-4c4b327b32be",
  "end_to_end_id": "E73856642202407011350E8cnA3Ae7r3",
  "requested_amount": 10,
  "refund_request_status": "closed",
  "refund_request_type": "operational_flaw",
  "infraction_report_key": null,
  "refund_request_details": "Foi identificada uma fraude na transação.",
  "requesting_participant": "73856642",
  "contested_participant": "99999999",
  "analysis_result": "rejected",
  "analysis_details": null,
  "reject_reason": "account_closure",
  "refund_transfer_key": null,
  "refunded_amount": 0.00,
  "refund_request_direction": "outgoing",
  "created_at": "2024-07-01T13:50:30Z",
  "refund_events": [
    {
      "event_type": "open",
      "event_details": "Solicitação de Devolução criada pelo participante indireto",
      "created_at": "2024-07-01T13:50:30Z"
    },
    {
      "event_type": "closed",
      "event_details": "Requisição de devolução fechado pela outra instituição financeira, com status REJEITADO",
      "created_at": "2024-07-01T14:02:55Z"
    }
  ]
}
```

### Body Params
| Field                       | Type   | Description                                                               | Characters |
|-----------------------------|--------|---------------------------------------------------------------------------|------------|
| `pix_transfer_key`*         | string | Unique identifier of the PIX transaction.                                 | 36         |
| `refund_request_key`*       | string | Unique identifier of the refund request.                                  | 36         |
| `infraction_report_key`*    | string | Unique identifier of the infraction related to the refund. Only when the type is FRAUD | 36  |
| `refund_request_type`       | enum   | Type of refund request.                                                   | **[Enumerators refund_request_type](#enumeradores-refund_request_type)** |
| `requested_amount`*         | float  | Refund amount                                                             | -          |
| `refund_request_status`*    | enum   | Status.                                                                   | **[Enumerators refund_request_status](#enumeradores-refund_request_status)** |
| `contested_participant`*    | string | ISPB of the Credited Participant (Contested).                             | 8          |
| `requesting_participant`*   | string | ISPB of the Debited Participant (Requesting, who is requesting the refund).    | 8    |
| `refund_request_details`*   | string | Details about the refund request.                                         | -          |
| `analysis_result`*          | enum   | Result of the refund closure analysis.                                    | **[Enumerators analysis_result](#enumeradores-analysis_result)** |
| `analysis_details`*         | string | Details of the refund closure analysis.                                   | -          |
| `reject_reason`*            | string | Reason for rejecting the refund, if it is closed with REJECTED.           | **[Enumerators reject_reason](#enumeradores-reject_reason)** |
| `refund_transfer_key`*      | string | pix_transfer_key of the refund transaction, if it is closed with acceptance.   | -    |
| `refunded_amount`*          | float  | Amount refunded in the refund transaction.                                | -          |
| `refund_events`*            | object | Object for refund request events.                                         | **[Objects refund_events](#objects-refund-events)** |
| `refund_request_direction`* | string | Direction of the refund request.                                          | **[Enumerators refund_request_direction](#enumeradores-refund_request_direction)** |
| `created_at` *              | string | Refund Request creation date                                              | 24         |

### Enumerators refund_request_status
| Field       | Description                                                                 |
|-------------|-----------------------------------------------------------------------------|
| `open`      | Refund Request was <strong>created</strong> and is open at BACEN.           |
| `cancelled` | Refund Request is <strong>cancelled</strong> at BACEN                       |
| `closed`    | Refund Request is <strong>closed</strong> at BACEN                          |

### Enumerators refund_request_type
| Field             | Description                                               |
|-------------------|-----------------------------------------------------------|
| `fraud`           | Refund Request originating from fraud.                    |
| `operational_flaw`| Refund Request originating from an internal error.        |

### Enumerators analysis_result
| Field              | Description                                                |
|--------------------|------------------------------------------------------------|
| `totally_accepted` | Refund Request was fully accepted.                         |
| `partially_accepted` | Refund Request was partially accepted.                   |
| `rejected`         | Refund Request was rejected.                               |

### Enumerators reject_reason
| Field           | Description                                                  |
|-----------------|--------------------------------------------------------------|
| `no_balance`    | Account does not have sufficient balance for the refund.     |
| `account_closure` | Account is closed, so the refund cannot be processed       |
| `other`         | Other reason.                                                |

### Enumerators refund_request_direction
| Field       | Description                                                |
|-------------|------------------------------------------------------------|
| `outgoing`  | Participant is the originator of the refund request.       |
| `incoming`  | Participant is the target of the refund request.           |

### Objects refund_events
| Field             | Description                                                                       |
|-------------------|-----------------------------------------------------------------------------------|
| `event_type`      | Type of the refund event. **[Enumerators refund_request_status](#enumeradores-refund_request_status)** |
| `event_details`   | Details about the event.                                                          |
| `created_at`      | Event creation date.                                                              |

---

# Open Refund Request

URL: /en/documentation/pix_indireto/devolucao/criar_devolucao

The Refund Request is another functionality present in the MED, defined by BACEN.
The main objective is to facilitate the refund of a PIX transaction made. The Refund Request can be generated either by an operational error or by an infraction . In the latter case, there is an Infraction Report for a PIX transaction that is already closed and accepted .
:::caution **Attention**
To understand the Refund Request flow, it is necessary to know which ENDPOINTS the Indirect Participant who created the refund can use.
When the Indirect Participant creates a Refund Request, they can (if necessary) cancel the request if it was generated improperly.
When the Indirect Participant receives a Refund Request, they must respond by informing the result of the request analysis.
Both cited flows will be described in the following sections.
It is noted that if the Indirect Participant opens the request, they are contesting another Participant. In the opposite flow, the Indirect Participant is the contested .
:::
:::danger IMPORTANT
The Central Bank of Brazil requires that, within a period of 1 day from the receipt of the Refund Request by the Indirect Participant, the Refund must be closed .
If there is a delay on the part of the Indirect Participant, QI Tech will close the Refund Request with the status of totally_accepted to ensure the institution is not penalized by the Central Bank of Brazil.
:::
## Request

ENDPOINT /pix/refund_request
METHOD POST

**Request Body**

```json
{
    "pix_transfer_key": "a39mn71j-1dc7-4df0-8472-233624706e08",
    "request_control_key":"df3ae07e-1dc7-4df0-8472-233624706e08",
    "amount": 200.00,
    "refund_request_details": "transação fraudada",
    "refund_request_type": "fraud"
}

```

### Body Params
| Field                   | Type   | Description                                                                       | Characters |
|-------------------------|--------|-----------------------------------------------------------------------------------|------------|
| `pix_transfer_key` *    | string | Unique identifier of the PIX transaction.                                         | 36         |
| `request_control_key` * | uuidv4 | UUID4 for querying about the made request.                                        | 36         |
| `amount`                | float  | Refund amount. If not provided, the original transaction amount will be used.     | 19         |
| `refund_request_details`| string | Details about the refund request to be created                                    | Less or equal 2000    |
| `refund_request_type` * | enum   | Can be (fraud/operational_flaw)                                                   | **[Enumerators refund_request_type](#enumeradores-refund_request_type)** |

### Enumerators refund_request_type
| Field                | Type   | Description                                                          |
|----------------------|--------|----------------------------------------------------------------------|
| **fraud**            | enum   | Refund request due to fraud                                          |
| **operational_flaw** | enum   | Refund request due to operational error                              |

## Response

STATUS
        200

**Response Body**

```json
{
  "refund_request_key": "47633091-7d44-4d10-9d00-1f937104e537",
  "pix_transfer_key": "2bcbfd65-8660-4cb0-8ae4-4c4b327b32be",
  "end_to_end_id": "E73856642202407011350E8cnA3Ae7r3",
  "requested_amount": 200.00,
  "refund_request_status": "open",
  "refund_request_type": "operational_flaw",
  "infraction_report_key": null,
  "refund_request_details": "Foi identificada uma fraude na transação.",
  "requesting_participant": "73856642",
  "contested_participant": "99999999",
  "analysis_result": null,
  "analysis_details": null,
  "reject_reason": null,
  "refund_transfer_key": null,
  "refunded_amount": 0.00,
  "refund_request_direction": "outgoing",
  "created_at": "2024-07-01T13:50:30Z"
}
```
:::info Information
If the "refund_request_type" field is "fraud", QI Tech will provide, in the response, the infraction_report_key that has already been closed and accepted.
:::

### Body Params

| Field                       | Type   | Description                                                               | Characters |
|-----------------------------|--------|---------------------------------------------------------------------------|------------|
| `pix_transfer_key`*         | string | Unique identifier of the PIX transaction.                                 | 36         |
| `refund_request_key`*       | string | Unique identifier of the refund request.                                  | 36         |
| `infraction_report_key`*    | string | Unique identifier of the infraction related to the refund. Only when the type is FRAUD | 36  |
| `refund_request_type`       | enum   | Type of refund request.                                                   | **[Enumerators refund_request_type](#enumeradores-refund_request_type)** |
| `requested_amount`*         | float  | Refund amount                                                             | -          |
| `refund_request_status`*    | enum   | Status.                                                                   | **[Enumerators refund_request_status](#enumeradores-refund_request_status)** |
| `contested_participant`*    | string | ISPB of the Credited Participant (Contested).                             | 8          |
| `requesting_participant`*   | string | ISPB of the Debited Participant (Requesting, who is requesting the refund).    | 8    |
| `refund_request_details`*   | string | Details about the refund request.                                         | -          |
| `analysis_result`*          | enum   | Result of the refund closure analysis.                                    | **[Enumerators analysis_result](#enumeradores-analysis_result)** |
| `analysis_details`*         | string | Details of the refund closure analysis.                                   | -          |
| `reject_reason`*            | string | Reason for rejecting the refund, if it is closed with REJECTED.           | **[Enumerators reject_reason](#enumeradores-reject_reason)** |
| `refund_transfer_key`*      | string | pix_transfer_key of the refund transaction, if it is closed with acceptance.   | -    |
| `refunded_amount`*          | float  | Amount refunded in the refund transaction.                                | -          |
| `refund_request_direction`* | string | Direction of the refund request.                                          | **[Enumerators refund_request_direction](#enumeradores-refund_request_direction)** |
| `created_at` *              | string | Refund Request creation date                                              | 24         |

### Enumerators refund_request_status
| Field       | Description                                                      |
|-------------|------------------------------------------------------------------|
| `open`      | Refund Request was <strong>created</strong> and is open at BACEN.|
| `cancelled` | Refund Request is <strong>cancelled</strong> at BACEN            |
| `closed`    | Refund Request is <strong>closed</strong> at BACEN               |

### Enumerators refund_request_type
| Field             | Description                                               |
|-------------------|-----------------------------------------------------------|
| `fraud`           | Refund Request originating from fraud.                    |
| `operational_flaw`| Refund Request originating from an internal error.        |

### Enumerators analysis_result
| Field              | Description                                                      |
|--------------------|------------------------------------------------------------------|
| `totally_accepted` | Refund Request was fully accepted.                              |
| `partially_accepted` | Refund Request was partially accepted.                        |
| `rejected`         | Refund Request was rejected.                                     |

### Enumerators reject_reason
| Field           | Description                                                  |
|-----------------|--------------------------------------------------------------|
| `no_balance`    | Account does not have sufficient balance for the refund.     |
| `account_closure` | Account is closed, so the refund cannot be processed       |
| `other`         | Other reason.                                                |

### Enumerators refund_request_direction
| Field       | Description                                                |
|-------------|------------------------------------------------------------|
| `outgoing`  | Participant is the originator of the refund request.       |
| `incoming`  | Participant is the target of the refund request.           |

---

# Close Refund Request

URL: /en/documentation/pix_indireto/devolucao/fechar_devolucao

The Indirect Participant can close a refund request if the Participant is the Contested Participant.
To close the request, the status must be OPEN .

:::danger IMPORTANT
The Central Bank of Brazil requires that, within a period of 1 day from the receipt of the Refund Request by the Indirect Participant, the Refund must be closed .

If there is a delay on the part of the Indirect Participant, QI Tech will close the Refund Request with the status of totally_accepted to ensure the institution is not penalized by the Central Bank of Brazil.
:::

## Request

ENDPOINT /pix/refund_request/ REFUND_REQUEST_KEY
METHOD PATCH

**Request Body**

```json
{
    "request_control_key":"xpjae07e-1dc7-4df0-8472-233624706e08",
    "refund_request_status": "closed",
    "analysis_result": "totally_accepted",
    "analysis_details": "Valor bloqueado. Para mais informações, contatar central antifraude em 11 3000-45012, informando ID 0000.",
    "refund_transfer_key": "cdcf0d25-08a1-46e3-902a-6d7ca75e6c48"
}

```

### Path Params
| Field                | Type   | Description                      | Characters |
|----------------------|--------|----------------------------------|------------|
| `refund_request_key` *| string | UUID4 of the already created refund. | 36         |

### Body Params
| Field                  | Type   | Description                      | Characters |
|------------------------|--------|----------------------------------|------------|
| `request_control_key` * | uuidv4 | UUID4 for querying about the made request. | 36         |
| `request_request_status` * | enum | Status                          | **[Enumerators refund_request_status](#enumeradores-refund_request_status)** |
| `analysis_result` *    | enum   | Result of the analysis           | **[Enumerators analysis_result](#enumeradores-analysis_result)** |
| `analysis_details`     | string | Comment on the analysis          | Less or 2000    |
| `refund_transfer_key`  | string | UUID4 of the refund transaction sent via the "reversal" route. Should be used when the "analysis_result" is acceptance. | 36  |
| `reject_reason`        | enum   | Reason for rejecting the refund. Should be used when the 'analysis_result' is 'rejected'. | **[Enumerators reject_reason](#enumeradores-reject_reason)** |

## Response

STATUS 200

**Response Body - Rejected**

```json
{
  "refund_request_key": "2e42116f-4bdb-4f07-931f-c4dc7a78ed99",
  "pix_transfer_key": "d5856a5f-378f-43ed-818b-df33b9fae703",
  "end_to_end_id": "E60701190202406281828JCBxFsqssCf",
  "requested_amount": 10,
  "refund_request_status": "closed",
  "refund_request_type": "operational_flaw",
  "infraction_report_key": null,
  "refund_request_details": "Foi identificada uma fraude na transação.",
  "requesting_participant": "99999999",
  "contested_participant": "73856642",
  "analysis_result": "rejected",
  "analysis_details": "Conta sem saldo.",
  "reject_reason": "no_balance",
  "refund_transfer_key": null,
  "refunded_amount": 0.00,
  "refund_request_direction": "incoming",
  "created_at": "2024-07-01T15:46:18Z"
}
```

**Response Body - Agreed**

```json
{
  "refund_request_key": "2e42116f-4bdb-4f07-931f-c4dc7a78ed99",
  "pix_transfer_key": "d5856a5f-378f-43ed-818b-df33b9fae703",
  "end_to_end_id": "E60701190202406281828JCBxFsqssCf",
  "requested_amount": 10,
  "refund_request_status": "closed",
  "refund_request_type": "operational_flaw",
  "infraction_report_key": null,
  "refund_request_details": "Foi identificada uma fraude na transação.",
  "requesting_participant": "99999999",
  "contested_participant": "73856642",
  "analysis_result": "totally_accepted",
  "analysis_details": "Valor devolvido.",
  "reject_reason": null,
  "refund_transfer_key": "ab1189d8-5a87-4e5b-b49c-d05776bd8efe",
  "refunded_amount": 10.00,
  "refund_request_direction": "incoming",
  "created_at": "2024-07-01T15:46:18Z"
}
```

### Body Params
| Field                       | Type   | Description                                                               | Characters |
|-----------------------------|--------|---------------------------------------------------------------------------|------------|
| `pix_transfer_key`*         | string | Unique identifier of the PIX transaction.                                 | 36         |
| `refund_request_key`*       | string | Unique identifier of the refund request.                                  | 36         |
| `infraction_report_key`*    | string | Unique identifier of the infraction related to the refund. Only when the type is FRAUD | 36  |
| `refund_request_type`       | enum   | Type of refund request.                                                   | **[Enumerators refund_request_type](#enumeradores-refund_request_type)** |
| `requested_amount`*         | float  | Refund amount                                                             | -          |
| `refund_request_status`*    | enum   | Status.                                                                   | **[Enumerators refund_request_status](#enumeradores-refund_request_status)** |
| `contested_participant`*    | string | ISPB of the Credited Participant (Contested).                             | 8          |
| `requesting_participant`*   | string | ISPB of the Debited Participant (Requesting, who is requesting the refund).| 8          |
| `refund_request_details`*   | string | Details about the refund request.                                         | -          |
| `analysis_result`*          | enum   | Result of the refund closure analysis.                                    | **[Enumerators analysis_result](#enumeradores-analysis_result)** |
| `analysis_details`*         | string | Details of the refund closure analysis.                                   | -          |
| `reject_reason`*            | string | Reason for rejecting the refund, if it is closed with REJECTED.           | **[Enumerators reject_reason](#enumeradores-reject_reason)** |
| `refund_transfer_key`*      | string | pix_transfer_key of the refund transaction, if it is closed with acceptance. | -    |
| `refunded_amount`*          | float  | Amount refunded in the refund transaction.                                | -          |
| `refund_request_direction`* | string | Direction of the refund request.                                          | **[Enumerators refund_request_direction](#enumeradores-refund_request_direction)** |
| `created_at` *              | string | Refund Request creation date                                              | 24         |

### Enumerators refund_request_status
| Field       | Description                                                                 |
|-------------|-----------------------------------------------------------------------------|
| `open`      | Refund Request was <strong>created</strong> and is open at BACEN.           |
| `cancelled` | Refund Request is <strong>cancelled</strong> at BACEN                       |
| `closed`    | Refund Request is <strong>closed</strong> at BACEN                          |

### Enumerators refund_request_type
| Field             | Description                                               |
|-------------------|-----------------------------------------------------------|
| `fraud`           | Refund Request originating from fraud.                    |
| `operational_flaw`| Refund Request originating from an internal error.        |

### Enumerators analysis_result
| Field              | Description                                                |
|--------------------|------------------------------------------------------------|
| `totally_accepted` | Refund Request was fully accepted.                         |
| `partially_accepted` | Refund Request was partially accepted.                   |
| `rejected`         | Refund Request was rejected.                               |

### Enumerators reject_reason
| Field           | Description                                                  |
|-----------------|--------------------------------------------------------------|
| `no_balance`    | Account does not have sufficient balance for the refund.     |
| `account_closure` | Account is closed, so the refund cannot be processed       |
| `other`         | Other reason                                                 |

### Enumerators refund_request_direction
| Field       | Description                                                |
|-------------|------------------------------------------------------------|
| `outgoing`  | Participant is the originator of the refund request.       |
| `incoming`  | Participant is the target of the refund request.           |

---

# List Refund Requests

URL: /en/documentation/pix_indireto/devolucao/listar_solicitacoes

If the Indirect Participant requests a listing of Refund Requests, they can do so through the route below.

:::danger IMPORTANT
The Central Bank of Brazil requires that, within a period of 1 day from the receipt of the Refund Request by the Indirect Participant, the Refund must be closed .

If there is a delay on the part of the Indirect Participant, QI Tech will close the Refund Request with the status of totally_accepted to ensure the institution is not penalized by the Central Bank of Brazil.
:::

## Request

ENDPOINT /pix/refund_requests
METHOD GET

### Query Params
| Field                   | Type    | Description                       | Characters |
|-------------------------|---------|-----------------------------------|------------|
| `refund_request_status` | enum    | Status of the Infraction Report.  | **[Enumerators refund_request_status](#enumeradores-refund_request_status)** |
| `refund_request_type`   | enum    | Type of the Infraction Report.    | **[Enumerators refund_request_type](#enumeradores-refund_request_type)** |
| `initial_date`          | string  | Start search date.                | **[Date format](#formato-de-data)** |
| `final_date`            | string  | End search date.                  | **[Date format](#formato-de-data)** |
| `page_number`           | integer | Current page being queried.       | -          |
| `page_size`             | integer | Number of results per page.       | -          |

### Enumerators refund_request_status

| Field       | Type   | Description                                                                 | Characters |
|-------------|--------|-----------------------------------------------------------------------------|------------|
| `open`      | string | Refund Request was <strong>created</strong> and is open at BACEN.            | 4          |
| `cancelled` | string | Refund Request is <strong>cancelled</strong> at BACEN.                       | 9          |
| `closed`    | string | Refund Request is <strong>closed</strong> at BACEN.                          | 6          |

### Enumerators refund_request_type

| Field             | Type   | Description                                               | Characters |
|-------------------|--------|-----------------------------------------------------------|------------|
| `fraud`           | string | Refund Request originating from fraud.                    | 5          |
| `operational_flaw`| string | Refund Request originating from an internal error.        | 16         |

### Date format

| Field        | Type   | Description                                                              | Characters |
|--------------|--------|--------------------------------------------------------------------------|------------|
| `initial_date` | string | Start search date, in the format "%Y-%m-%d". Example: "2023-10-09".        | 10         |
| `final_date`   | string | End search date, in the format "%Y-%m-%d". Example: "2023-10-11".          | 10         |

## Response

STATUS 200

**Response Body**

```json
{
  "data": [
    {
      "refund_request_key": "817c9331-fe1d-4178-aff2-8bed87ce3099",
      "pix_transfer_key": "029efb4e-ad3b-4ba5-a73c-c724f0d9c02b",
      "end_to_end_id": "E73856642202406282112pEBgwN7kkqD",
      "requested_amount": 10,
      "refund_request_status": "cancelled",
      "refund_request_type": "operational_flaw",
      "infraction_report_key": null,
      "refund_request_details": "Foi identificada uma fraude na transação.",
      "requesting_participant": "73856642",
      "contested_participant": "99999999",
      "analysis_result": null,
      "analysis_details": null,
      "reject_reason": null,
      "refund_transfer_key": null,
      "refunded_amount": 0.00,
      "refund_request_direction": "outgoing",
      "created_at": "2024-06-28T21:25:20Z",
      "refund_events": [
        {
          "event_type": "open",
          "event_details": "Solicitação de Devolução criada pelo participante indireto",
          "created_at": "2024-06-28T21:25:20Z"
        },
        {
          "event_type": "cancelled",
          "event_details": "Solicitação de Devolução cancelada pelo participante indireto",
          "created_at": "2024-06-28T21:27:19Z"
        }
      ]
    },
    {
      "refund_request_key": "5d174097-3d5c-41a2-a548-b24c41eecfb4",
      "pix_transfer_key": "d5856a5f-378f-43ed-818b-df33b9fae703",
      "end_to_end_id": "E60701190202406281828JCBxFsqssCf",
      "requested_amount": 10,
      "refund_request_status": "closed",
      "refund_request_type": "operational_flaw",
      "infraction_report_key": null,
      "refund_request_details": "Foi identificada uma fraude na transação.",
      "requesting_participant": "99999999",
      "contested_participant": "73856642",
      "analysis_result": "rejected",
      "analysis_details": null,
      "reject_reason": "no_balance",
      "refund_transfer_key": null,
      "refunded_amount": 0.00,
      "refund_request_direction": "incoming",
      "created_at": "2024-07-01T12:47:41Z",
      "refund_events": [
        {
          "event_type": "open",
          "event_details": "Solicitação de Devolução criada por outra instituição financeira",
          "created_at": "2024-07-01T12:47:41Z"
        }
      ]
    }
  ]
}
```

### Body Params
| Field                       | Type   | Description                                                               | Characters |
|-----------------------------|--------|---------------------------------------------------------------------------|------------|
| `pix_transfer_key`*         | string | Unique identifier of the PIX transaction.                                 | 36         |
| `refund_request_key`*       | string | Unique identifier of the refund request.                                  | 36         |
| `infraction_report_key`*    | string | Unique identifier of the infraction related to the refund. Only when the type is FRAUD | 36  |
| `refund_request_type`       | enum   | Type of refund request.                                                   | **[Enumerators refund_request_type](#enumeradores-refund_request_type)** |
| `requested_amount`*         | float  | Refund amount                                                             | -          |
| `refund_request_status`*    | enum   | Status.                                                                   | **[Enumerators refund_request_status](#enumeradores-refund_request_status)** |
| `contested_participant`*    | string | ISPB of the Credited Participant (Contested).                             | 8          |
| `requesting_participant`*   | string | ISPB of the Debited Participant (Requesting, who is requesting the refund).| 8          |
| `refund_request_details`*   | string | Details about the refund request.                                         | -          |
| `analysis_result`*          | enum   | Result of the refund closure analysis.                                    | **[Enumerators analysis_result](#enumeradores-analysis_result)** |
| `analysis_details`*         | string | Details of the refund closure analysis.                                   | -          |
| `reject_reason`*            | string | Reason for rejecting the refund, if it is closed with REJECTED.           | **[Enumerators reject_reason](#enumeradores-reject_reason)** |
| `refund_transfer_key`*      | string | pix_transfer_key of the refund transaction, if it is closed with acceptance. | -    |
| `refunded_amount`*          | float  | Amount refunded in the refund transaction.                                | -          |
| `refund_events`*            | object | Object for refund request events.                                         | **[Objects refund_events](#objects-refund-events)** |
| `refund_request_direction`* | string | Direction of the refund request.                                          | **[Enumerators refund_request_direction](#enumeradores-refund_request_direction)** |
| `created_at` *              | string | Refund Request creation date                                              | 24         |

### Enumerators refund_request_status
| Field       | Description                                                                  |
|-------------|------------------------------------------------------------------------------|
| `open`      | Refund Request was <strong>created</strong> and is open at BACEN.            |
| `cancelled` | Refund Request is <strong>cancelled</strong> at BACEN                        |
| `closed`    | Refund Request is <strong>closed</strong> at BACEN                           |

### Enumerators refund_request_type
| Field             | Description                                               |
|-------------------|-----------------------------------------------------------|
| `fraud`           | Refund Request originating from fraud.                    |
| `operational_flaw`| Refund Request originating from an internal error.        |

### Enumerators analysis_result
| Field              | Description                                              |
|--------------------|----------------------------------------------------------|
| `totally_accepted` | Refund Request was fully accepted.                       |
| `partially_accepted` | Refund Request was partially accepted.                 |
| `rejected`         | Refund Request was rejected.                             |

### Enumerators reject_reason
| Field           | Description                                                 |
|-----------------|-------------------------------------------------------------|
| `no_balance`    | Account does not have sufficient balance for the refund.    |
| `account_closure` | Account is closed, so the refund cannot be processed      |
| `other`         | Other reason                                                |

### Enumerators refund_request_direction
| Field       | Description                                                     |
|-------------|-----------------------------------------------------------------|
| `outgoing`  | Participant is the originator of the refund request.            |
| `incoming`  | Participant is the target of the refund request                 |

### Objects refund_events
| Field          | Description                                                                       |
|----------------|-----------------------------------------------------------------------------------|
| `event_type`   | Type of the refund event change. **[Enumerators refund_request_status](#enumeradores-refund_request_status)**   |
| `event_details`| Details about the event.                                                          |
| `created_at`   | Event creation date.                                                              |

---

# Introduction to the Refund Flow

URL: /en/documentation/pix_indireto/devolucao/maquina_estados

## Introduction
The Central Bank of Brazil allows that if the Indirect Participant wishes to request back to the account a debited amount in a transaction made via PIX, they can open a Refund Request.
:::info
It is emphasized that only the debited Participant can open a Refund Request. Formally, the Participant who opens a Refund Request is called the requesting_participant .
:::
| Enumerator  | Translation   | Description|
|-------------|---------------|---|
| open        | open          | After processing the <strong>creation</strong> of the Refund Request, it remains open at BACEN.
| cancelled   | cancelled     | The cancellation of the Refund Request was processed by QI Tech and is <strong>cancelled</strong> at BACEN.
| closed      | closed        | The closure of the Refund Request was processed by QI Tech and is <strong>closed</strong> at BACEN.

## State Machine Control
Even though the flow is synchronous , it is necessary to know the possible statuses a Refund Request can have. Below, it is described what the Indirect Participant can expect after opening, cancelling, completing, and receiving a Refund Request.
### Participant Opens Refund Request
The Indirect Participant can request the opening of a refund in two ways:
Due to operational error (operational_flaw).
Due to an already closed and accepted infraction report (refund_request)
After opening, the refund status will be open
### Participant Cancels Refund Request
After the Participant has opened a Refund Request, it is possible to cancel it if requested.
The Indirect Participant will receive a response with the status of cancelled .
### Participant Receives Refund Request
Since other Participants can open a Refund Request, it is necessary that the other party involved in the flow can receive it in order to close it .
Unlike the Infraction Report, which has an intermediate status of acknowledged , the Indirect Participant will receive, via webhook , a request indicating that there is a Refund Request with the status open .
The difference is that, for this request, the Contested Participant is the Indirect Participant.
### Participant Closes Refund Request
After QI Tech, via webhook , informs the Indirect Participant that there is an available Refund Request, they can close the report.
When the Indirect Participant executes this flow, they will send the closure request to QI Tech and will receive a status of closed .

---

# Scenario Simulation

URL: /en/documentation/pix_indireto/devolucao/simulacao_de_cenarios

Step-by-step guide to simulate the completion of actions performed by external agents. These simulations include receiving and updating refund requests.

:::info Information
There is no payload response (response body) for these requests, only a response status of 201.
:::
## 1 - Simulating the Receipt of a Refund Request

Simulates the receipt of a refund request opened by another institution.

:::info IMPORTANT
It is essential to have a valid pix_transfer_key to send the request, regardless of the information from the other party of the transfer, as all information from the second participant will be replaced in the mock process.
:::
### Request

ENDPOINT /mock/pix/refund_request
METHOD POST

Request Body

:::info IMPORTANT
If the refund type is FRAUD, there must be a closed infraction report for the same pix_transfer_key.
:::

```json
{
    "pix_transfer_key": "d5856a5f-378f-43ed-818b-df33b9fae703",
    "refund_request_type": "fraud",
    "refund_request_details": "Foi identificada uma fraude na transação.",
    "refund_request_status": "open",
}
```

### Object Request Body
| Field                | Type   | Description                                                               | Max. Characters |
|----------------------|--------|---------------------------------------------------------------------------|-----------------|
| `pix_transfer_key` * | string | Unique identifier of the Pix transfer in the QI system (UUIDv4)            | 36              |
| `refund_request_type` * | enum | Type of refund request.                                                   | **[Enumerators refund_request_type](#enumeradores-refund_request_type)** |
| `refund_request_status` * | string | Initial status of the refund request. "open"                         | 36              |
| `refund_request_details` | string | Details of the refund request                                            | 2000            |

### Enumerators refund_request_type
| Field             | Type   | Description                                               |
|-------------------|--------|-----------------------------------------------------------|
| `fraud`           | string | Refund Request originating from fraud.                    | 5          |
| `operational_flaw`| string | Refund Request originating from an internal error.        | 16         |

## 2 - Simulating the Update of a Refund Request
Simulates the status update of a refund request opened by the indirect participant.

The simulation options for updating a refund request are:
1 - Cancellation: Simulates the cancellation (cancel), made by a "target" participant, of a refund request previously opened by them.

2 - Closure: Simulates the closure (close), made by a "target" participant, of a refund request opened by the indirect participant. It is important that this report has already been acknowledged as open.

### Request

ENDPOINT /mock/pix/refund_request
METHOD PATCH

Request Body - Cancelled

:::info IMPORTANT
The Refund Request identified by the refund_request_key must have been previously created in the simulation of creating a refund request.
:::

```json
{
    "refund_request_status": "cancelled",
    "refund_request_key": "c3e5664f-04bb-4625-9ef3-c8555d210c71"
}
```

Request Body - Total Acceptance Closure

:::info IMPORTANT
The Refund Request identified by the refund_request_key must have been previously created by the indirect participant.
:::
:::info IMPORTANT
The refund transfer key must have been previously created by the refund receipt mock with a value EQUAL to the original transaction.
:::

```json
{
    "refund_request_key": "42035bdd-0551-41c5-aaae-cb27d108160a",
    "refund_request_status": "closed",
    "analysis_result": "totally_accepted",
    "analysis_details": "Teste",
    "refund_transfer_key": "6f421127-892f-415f-8efc-4e20cf5d622d"
}
```

Request Body - Partial Acceptance Closure

:::info IMPORTANT
The Refund Request identified by the refund_request_key must have been previously created by the indirect participant. Additionally, the refunded amount must not be equal to or greater than the total amount of the original transaction.
:::
:::info IMPORTANT
The refund transfer key must have been previously created by the refund receipt mock with a value LESS than the original transaction.
:::

```json
{
    "refund_request_key": "42035bdd-0551-41c5-aaae-cb27d108160a",
    "refund_request_status": "closed",
    "analysis_result": "partially_accepted",
    "analysis_details": "Teste",
    "refund_transfer_key": "6f421127-892f-415f-8efc-4e20cf5d622d"
}
```

Request Body - Rejection Closure

:::info IMPORTANT
The Refund Request identified by the refund_request_key must have been previously created by the indirect participant.
:::

```json
{
    "refund_request_key": "47633091-7d44-4d10-9d00-1f937104e537",
    "refund_request_status": "closed",
    "analysis_result": "rejected",
    "analysis_details": "Teste",
    "reject_reason": "no_balance"
}
```

### Object Request Body
| Field                   | Type   | Description                                                                                  | Max. Characters |
|-------------------------|--------|----------------------------------------------------------------------------------------------|-----------------|
| `refund_request_status` * | string | Initial status of the refund request. "cancelled", "closed"                                    | 36              |
| `refund_request_key` *  | string | Unique key of the refund request                                                              | 36              |
| `analysis_result` *     | string | Result of the refund request analysis. "totally_accepted", "partially_accepted", "rejected"    | 36              |
| `analysis_details`      | string | Details of the refund request analysis                                                        | 2000            |
| `refund_transfer_key`   | float  | Identifier of the refund transfer, mandatory in case of acceptance                            | 20              |
| `reject_reason`         | string | Reason for rejecting a refund (only if analysis_result is rejected). "no_balance", "account_closure", or "other" | 15              |

---

# Receive Refund Request

URL: /en/documentation/pix_indireto/devolucao/webhooks_devolucao

:::danger Attention!
QI Tech's webhooks should not be strictly mapped.
Additional fields may be included in the payloads of the webhooks returned by our APIs.

:::
Since another Participant may open a Refund Request targeting the Indirect Participant, QI Tech needs to notify the Indirect Participant about the Refund Request opened by the other Participant.
QI Tech will notify the Indirect Participant via webhook .

:::danger IMPORTANT
The Central Bank of Brazil requires that, within a period of 1 day from the receipt of the Refund Request by the Indirect Participant, the Refund must be closed .

If there is a delay on the part of the Indirect Participant, QI Tech will close the Refund Request with the status of totally_accepted to ensure the institution is not penalized by the Central Bank of Brazil.
:::

## Webhook for Receiving Refund Request (Operational Flaw)
**Request Body**

```json
{
  "requesting_participant": "99999999",
  "requested_amount": 10,
  "refund_request_key": "2e42116f-4bdb-4f07-931f-c4dc7a78ed99",
  "infraction_report_key": null,
  "end_to_end_id": "E60701190202406281828JCBxFsqssCf",
  "contested_participant": "73856642",
  "refund_request_details": "Foi identificada uma fraude na transação.",
  "pix_transfer_key": "d5856a5f-378f-43ed-818b-df33b9fae703",
  "refund_request_type": "operational_flaw",
  "refund_request_status": "open",
  "refunded_amount": 0.00,
  "analysis_result": null,
  "analysis_details": null,
  "refund_transfer_key": null,
  "reject_reason": null,
  "refund_request_direction": "incoming",
  "created_at": "2024-07-01T15:46:18Z"
}
```

## Webhook for Receiving Refund Request (Fraud)
**Request Body**

```json
{
  "requesting_participant": "99999999",
  "requested_amount": 10,
  "refund_request_key": "2e42116f-4bdb-4f07-931f-c4dc7a78ed99",
  "infraction_report_key": "9b36f112-ee56-4b26-9ba5-fde7b68b2d3b",
  "end_to_end_id": "E60701190202406281828JCBxFsqssCf",
  "contested_participant": "73856642",
  "refund_request_details": "Foi identificada uma fraude na transação.",
  "pix_transfer_key": "d5856a5f-378f-43ed-818b-df33b9fae703",
  "refund_request_type": "fraud",
  "refund_request_status": "open",
  "refunded_amount": 0.00,
  "analysis_result": null,
  "analysis_details": null,
  "refund_transfer_key": null,
  "reject_reason": null,
  "refund_request_direction": "incoming",
  "created_at": "2024-07-01T15:46:18Z"
}
```

---

# Consult an Alias Entity

URL: /en/documentation/pix_indireto/gerenciamento_de_alias/consultar_alias

Consult an Alias entity that is already registered to an existing account.

## Request

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY
METHOD GET

### Path Params

| Field        | Type   | Description          | Characters |
|--------------|--------|----------------------|------------|
| `account_key`| uuidv4 | Unique account key.  | 36         |
| `alias_key`  | uuidv4 | Unique alias key.    | 36         |

## Response

STATUS 200

**Response Body**

```json
{
  "alias_key": "c446e513-131c-4741-bbc2-b7e6b6282899",
  "ispb": "12345678",
  "account_branch": "0001",
  "account_number": "4968688",
  "account_digit": "3",
  "account_type": "checking_account",
  "account_created_at": "2021-10-22T20:30:23.459Z",
  "owner_person_type": "legal",
  "owner_document_number": "89248771384257",
  "owner_name": " Vinicius De Oliveira",
  "owner_trading_name": "Pix Ltda",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

### Response Body Params
| Field                      | Type      | Description                                                   | Max. Characters |
|----------------------------|-----------|---------------------------------------------------------------|-----------------|
| `alias_key`                | string    | Unique alias key                                              | 36              |
| `ispb`                     | string    | ISPB of the financial institution linked to the Alias         | 36              |
| `account_branch`           | string    | Branch, without the check digit                               | 4               |
| `account_number`           | string    | Account number, without the check digit                       | 20              |
| `account_digit`            | string    | Account check digit                                           | 1               |
| `account_type`             | enumerator| Account type                                                  | **[Enumerator account_type](#enumerator-account_type)** |
| `account_created_at`       | string    | Account creation date                                         | 20              |
| `owner_document_number`    | string    | CPF or CNPJ number                                            | 14              |
| `owner_name`               | string    | Account owner's name                                          | 120             |
| `owner_trading_name`       | string    | Account owner's trade name (only for CNPJ)                    | 100             |
| `created_at`               | string    | Date the request was made                                     | 20              |

### Enumerator account_type
| Enumerator             | Description               |
|------------------------|---------------------------|
| **checking_account**   | Conta Corrente            |
| **salary_account**     | Conta Salário             |
| **saving_account**     | Conta Poupança            |
| **payment_account**    | Conta de Pagamentos       |

STATUS 404

Response Body: Not Found

```json

{
  "title": "Not Found", 
  "description": "Account not found for the given key \{account_key\}", 
  "translation": "A account_key \{account_key\} não foi encontrada",
  "extra_fields": {}, 
  "code": "ACC000006"
}
```

Response Body: Not found

```json

{
  "title": "Not found", 
  "description": "Alias \{alias_key\} not found", 
  "translation": "Alias \{alias_key\} n\u00e3o encontrado",
  "extra_fields": {}, 
  "code": "ACC000181"
}
```

---

# Consult Alias by Request Control Key

URL: /en/documentation/pix_indireto/gerenciamento_de_alias/consultar_request_control_key

Return of the alias_key obtained in the creation of an Alias, using the request_control_key originally assigned to it in the body of the original request.

## Request

ENDPOINT /account/ ACCOUNT_KEY /alias
METHOD GET

### Path Params

| Field         | Type   | Description           | Characters |
|---------------|--------|-----------------------|------------|
| `account_key` | uuidv4 | Unique account key.   | 36         |

### Query Params

| Field                  | Type   | Description                                             | Characters |
|------------------------|--------|---------------------------------------------------------|------------|
| `request_control_key` *| uuidv4 | UUID4 for querying about the made request.              | 36         |

## Response

STATUS 200

**Response Body**

```json
{
  "alias_key": "c446e513-131c-4741-bbc2-b7e6b6282899",
  "ispb": "12345678",
  "account_branch": "0001",
  "account_number": "4968688",
  "account_digit": "3",
  "account_type": "checking_account",
  "account_created_at": "2021-10-22T20:30:23.459Z",
  "owner_person_type": "legal",
  "owner_document_number": "89248771384257",
  "owner_name": " Vinicius De Oliveira",
  "owner_trading_name": "Pix Ltda",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

### Response Body Params

| Field                      | Type      | Description                                                   | Max. Characters |
|----------------------------|-----------|---------------------------------------------------------------|-----------------|
| `alias_key`                | string    | Unique alias key                                              | 36              |
| `ispb`                     | string    | ISPB of the financial institution linked to the Alias         | 36              |
| `account_branch`           | string    | Branch, without the check digit                               | 4               |
| `account_number`           | string    | Account number, without the check digit                       | 20              |
| `account_digit`            | string    | Account check digit                                           | 1               |
| `account_type`             | enumerator| Account type                                                  | **[Enumerator account_type](#enumerator-account_type)** |
| `account_created_at`       | string    | Account creation date                                         | 20              |
| `owner_document_number`    | string    | CPF or CNPJ number                                            | 14              |
| `owner_name`               | string    | Account owner's name                                          | 120             |
| `owner_trading_name`       | string    | Account owner's trade name (only for CNPJ)                    | 100             |
| `created_at`               | string    | Date the request was made                                     | 20              |

### Enumerator account_type

| Enumerator             | Description       |
|------------------------|-------------------|
| **checking_account**   | Checking Account  |
| **salary_account**     | Salary Account    |
| **saving_account**     | Savings Account   |
| **payment_account**    | Payment Account   |

STATUS 404

Response Body: Not Found

```json
  {
  "title": "Not Found",
  "description": "Account not found for the given key \{account_key\}",
  "translation": "A account_key \{account_key\} não foi encontrada",
  "extra_fields": {},
  "code": "ACC000006"
}
```

STATUS 404

Response Body: Request Control Key Not found

```json
{
  "title": "Request Control Key Not found",
  "description": "The informed request_control_key \{request_control_key\} has no original registered entry associated",
  "translation": "A request_control_key informada \{request_control_key\} n\u00e3o possui entrada original associada",
  "extra_fields": {},
  "code": "ACC000186"
}
```

---

# Creating an Alias Entity

URL: /en/documentation/pix_indireto/gerenciamento_de_alias/criacao_de_alias

This is the flow responsible for creating Alias entities, linked to an existing account.

## Request

ENDPOINT /account/ ACCOUNT_KEY /alias
METHOD POST

**Request Body**

```json
{
    "request_control_key":"5b4259a4-dc4a-489f-a050-3391e13d9850",
    "account_branch": "0001",
    "account_number": "4968698",
    "account_digit": "3",
    "account_type": "checking_account",
    "account_created_at": "2022-09-24T19:46:43.001Z",
    "owner_person_type": "legal",
    "owner_document_number": "89248771384257",
    "owner_name": "Vinicius De Oliveira",
    "owner_trading_name": "Pix Ltda"
}

```

### Path Params

| Field         | Type   | Description           | Characters |
|---------------|--------|-----------------------|------------|
| `account_key` | uuidv4 | Unique account key.   | 36         |

### Request Body Params

| Field                     | Type       | Description                                                                      | Max. Characters                                          |
|---------------------------|------------|----------------------------------------------------------------------------------|---------------------------------------------------------|
| `request_control_key` *   | string     | Unique request identification key used by the client in uuidv4 format           | 36                                                      |
| `account_branch` *        | string     | Branch, without the check digit                                                  | 4                                                       |
| `account_number` *        | string     | Account number, without the check digit                                          | 20                                                      |
| `account_digit` *         | string     | Account check digit                                                              | 1                                                       |
| `account_type`*           | enumerator | Account type                                                                     | **[account_type Enumerator](#account_type-enumerator)** |
| `account_created_at` *    | string     | Account creation date. Ex: "2022-09-24T19:46:43.001Z"                          | 20                                                      |
| `owner_document_number` * | string     | CPF or CNPJ number                                                               | 11(CPF) or 14(CNPJ)                                     |
| `owner_person_type` *     | string     | Account owner type. Can be **legal** or **natural**                             | 7                                                       |
| `owner_name` *            | string     | Account owner name                                                               | 120                                                     |
| `owner_trading_name`      | string     | Account owner trading name (optional, and only for CNPJ)                        | 100                                                     |

### account_type Enumerator

| Enumerator           | Description         |
|----------------------|---------------------|
| **checking_account** | Checking Account    |
| **salary_account**   | Salary Account      |
| **saving_account**   | Savings Account     |
| **payment_account**  | Payment Account     |

## Response

STATUS 201 created

**Response Body**

```json
{
  "alias_key": "e04f496b-47be-4762-a6e2-8f2b05b46780",
  "created_at": "2022-09-24T19:46:43.001Z"
}
```

### Response Body Params

| Field        | Type          | Description                      | Max. Characters |
|--------------|---------------|----------------------------------|-----------------|
| `alias_key`  | uuidv4        | Unique alias key                 | 36              |
| `created_at` | datetime Zulu | Request execution date           | 20              |

STATUS 404

Response Body: Not Found

```json

  {
    "title": "Not Found", 
  "description": "Account not found for the given key \{account_key\}", 
  "translation": "A account_key \{account_key\} não foi encontrada",
  "extra_fields": {}, 
  "code": "ACC000006"
}
```

STATUS 400

Response Body: Repeted Request Control Key

```json

  {
  "title": "Repeated Request Control Key", 
  "description": "The request_control_key sent \{request_control_key\}, was already been used in other requisition", 
  "translation": "A request_control_key enviada \{request_control_key\}, já foi utilizada em outra requisição",
  "extra_fields": {}, 
  "code": "ACC000179"
}
```

Response Body: Invalid owner trading name

```json

  {
  "title": "Bad Request", 
  "description": "The owner_trading_name can only be sent by a legal person type", 
  "translation": "O owner_trading_name s\u00f3 pode ser utilizado por uma pessoa jur\u00eddica",
  "extra_fields": {}, 
  "code": "ACC000180"
}
```

---

# Deletion of an Alias Entity

URL: /en/documentation/pix_indireto/gerenciamento_de_alias/deletar_alias

Deletion of an Alias entity that is already registered to an existing account.

## Request

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY
METHOD DELETE

### Path Params

| Field        | Type   | Description          | Characters |
|--------------|--------|----------------------|------------|
| `account_key`| uuidv4 | Unique account key.  | 36         |
| `alias_key`  | uuidv4 | Unique alias key.    | 36         |

## Response

STATUS 200

**Response Body**

```json
{}
```

STATUS 404

Response Body: Not Found

```json

  {
  "data": "{\"title\": \"Not Found\", \"description\": \"Account not found for the given key \{account_key\}\", \"translation\": \"A account_key \{account_key\} não foi encontrada\", \"extra_fields\": {}, \"code\": \"ACC000006\"}",
  "title": "Not Found", 
  "description": "Account not found for the given key \{account_key\}", 
  "translation": "A account_key \{account_key\} não foi encontrada",
  "extra_fields": {}, 
  "code": "ACC000006"
}
```

STATUS 404

Response Body: Not found

```json

  {
  "data": "{\"title\": \"Not found\", \"description\": \"Alias \{alias_key\} not found\", \"translation\": \"Alias \{alias_key\} n\u00e3o encontrado\", \"extra_fields\": {}, \"code\": \"ACC000181\"}",
  "title": "Not found", 
  "description": "Alias \{alias_key\} not found", 
  "translation": "Alias \{alias_key\} n\u00e3o encontrado",
  "extra_fields": {}, 
  "code": "ACC000181"
}
```

STATUS 400

Response Body: Alias Key Don't Match with Account Key

```json

  {
  "data": "{\"title\": \"Alias Key Dont Match with Account Key\", \"description\": \"The alias_key \{alias_key\} Dont Match with the account_key \{account_key\}\", \"translation\": \"AA alias_key \{alias_key\} não combina com a account_key \{account_key\}\", \"extra_fields\": {}, \"code\": \"ACC000181\"}",
  "title": "Alias Key Dont Match with Account Key", 
  "description": "The alias_key \{alias_key\} Dont Match with the account_key \{account_key\}", 
  "translation": "A alias_key \{alias_key\} não combina com a account_key \{account_key\}",
  "extra_fields": {}, 
  "code": "ACC000181"
}
```

---

# Introduction to Alias Entity

URL: /en/documentation/pix_indireto/gerenciamento_de_alias/introducao_alias

In order to maintain and align data regarding PIX key registration, as required by the Central Bank of Brazil, the Indirect Participant must register an Alias with QI Tech.

Every Alias is necessarily linked to an account that the Indirect Participant has with QI Tech.

:::info Information

Everything described in this introduction section is also detailed, regarding how the Indirect Participant should handle it via API, in the following sections.

:::

## What does the Alias entity represent?

The Alias entity is a 'mask' of the account data that the Indirect Participant's client has registered with the Indirect Participant itself. It should be noted that QI Tech will only perform formatting validations on the data sent by the Indirect Participant to us.

For example: CPF validation, CNPJ validation, maximum character length for a trade name, etc.

The data that QI Tech requests the Indirect Participant to send, regarding their client's account, is only what is necessary for PIX functionality purposes.

## Alias in practice

In practice, the Alias entity represents the Indirect Participant's client.

An example regarding the need to create an Alias would be:
Indirect Participant has an account with account_key a520b977-d6b2-4f27-bef5-29760ebfd6a7 registered with QI Tech,
Indirect Participant wants to link their own client to this account registered with QI Tech,
Indirect Participant sends the client's data (account number, branch, name, trade name, etc) to link to this account registered with QI Tech,
QITech links the Indirect Participant's client to the Indirect Participant's registered account.
Indirect Participant receives a unique identification key for the registered Alias.

This way, the Indirect Participant can request the creation of a PIX key and QI Tech will be able to effectively communicate with the Central Bank of Brazil with the necessary data for registration.

##### Representation of Alias usage with 1:N relationship:
```mermaid
graph LR;
    Account_A-->Alias_A1;
    Account_A-->Alias_A2;
    Account_A-->Alias_A3;
    Account_A-->Alias_A4;
```

##### Representation of Alias usage with 1:1 relationship:

```mermaid
graph LR;
    Account_A-->Alias_A;
    Account_B-->Alias_B;
    Account_C-->Alias_C;
    Account_D-->Alias_D;
```

---

# Alias Listing

URL: /en/documentation/pix_indireto/gerenciamento_de_alias/listagem_de_alias

Listing of the Aliases of an account

## Request

ENDPOINT /account/ ACCOUNT_KEY /alias
METHOD GET

### Path Params

| Field        | Type   | Description          | Characters |
|--------------|--------|----------------------|------------|
| `account_key`| uuidv4 | Unique account key.  | 36         |

### Query Params

| Field         | Type    | Description                           | Max Value |
|---------------|---------|---------------------------------------|-----------|
| `page_number` | integer | Current page being queried.           | -         |
| `page_size`   | integer | Number of results per page.           | 100       |

## Response

STATUS 200

**Response Body**

```json
{
  "data": [
    {
      "alias_key": "a446e513-131c-4741-bbc2-b7e6b6282899",
      "ispb": "12345678",
      "account_type": "checking_account",
      "account_branch": "0001",
      "account_number": "4968688",
      "account_digit": "3",
      "account_created_at": "2021-10-22T20:30:23.459Z",
      "owner_person_type": "legal",
      "owner_document_number": "89248771384257",
      "owner_name": " Vinicius De Oliveira",
      "owner_trading_name": "Pix Ltda",
      "created_at": "2021-10-22T20:30:23.459Z"
    },
    {
      "alias_key": "c246a573-131c-4741-bbc2-b7e6b6282424",
      "ispb": "12345678",
      "account_type": "checking_account",
      "account_branch": "0001",
      "account_number": "2987685",
      "account_digit": "1",
      "account_created_at": "2021-10-22T20:30:23.459Z",
      "owner_person_type": "legal",
      "owner_document_number": "23448771384689",
      "owner_name": " Roberto Moraes",
      "owner_trading_name": "Pix Ltda",
      "created_at": "2021-10-22T20:30:23.459Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "next_page": null,
    "rows_per_page": 10
  }
}
```

### Response Body Params
| Field                      | Type      | Description                                                   | Max. Characters |
|----------------------------|-----------|---------------------------------------------------------------|-----------------|
| `alias_key`                | string    | Unique alias key                                              | 36              |
| `ispb`                     | string    | ISPB of the financial institution linked to the Alias         | 36              |
| `account_branch`           | string    | Branch, without the check digit                               | 4               |
| `account_number`           | string    | Account number, without the check digit                       | 20              |
| `account_digit`            | string    | Account check digit                                           | 1               |
| `account_type`             | enumerator| Account type                                                  | **[Enumerator account_type](#enumerator-account_type)** |
| `account_created_at`       | string    | Account creation date                                         | 20              |
| `owner_document_number`    | string    | CPF or CNPJ number                                            | 14              |
| `owner_name`               | string    | Account owner's name                                          | 120             |
| `owner_trading_name`       | string    | Account owner's trade name (only for CNPJ)                    | 100             |
| `created_at`               | string    | Date the request was made                                     | 20              |

### Enumerator account_type

| Enumerator             | Description               |
|------------------------|---------------------------|
| **checking_account**   | Checking Account          |
| **salary_account**     | Salary Account            |
| **saving_account**     | Savings Account           |
| **payment_account**    | Payment Account           |

STATUS 404

Response Body: Not Found

```json

  {
  "title": "Not Found", 
  "description": "Account not found for the given key \{account_key\}", 
  "translation": "A account_key \{account_key\} não foi encontrada",
  "extra_fields": {}, 
  "code": "ACC000006"
}
```

STATUS 400

Response Body: Wrong Pagination Query Parameter Set

```json
{
  "title": "Wrong Pagination Query Parameter Set",
  "description": "If page_number was informed, the page_size should also be informed",
  "translation": "Se o page_number foi informado, o page_size deve ser informado tambem",
  "extra_fields": {},
  "code": "ACC000183"
}
```

STATUS 400

Response Body: Wrong Pagination Query Parameter Format

```json
{
  "title": "Wrong Pagination Query Parameter Format",
  "description": "The page_number and page_formar should be formatad as an integer",
  "translation": "O page_number e o page_size devem ter formato de integer",
  "extra_fields": {},
  "code": "ACC000184"
}
```

---

# Introduction

URL: /en/documentation/pix_indireto/introducao

At QI Tech, we are proud to expand our services through the PIX Indirect service. We recognize the challenges some institutions may face when trying to integrate with PIX, and we are committed to making this a smooth and accessible reality for everyone.

As a direct participant of PIX, operating with efficiency and security, we have implemented a high-tech solution that allows banks, payment institutions, and fintechs of all sizes to become indirect participants, ensuring everyone enjoys the benefits of PIX without the burden of operational and technical costs.

Our PIX Indirect service provides simplified integration and hassle-free operation, with reduced costs and regulatory compliance. Furthermore, you won't have to worry about the complex technical processes; we will handle everything, allowing you to focus on what matters most - your customers.

With QI Tech, you will be equipped to provide your customers with a fast, secure, and always-available payment experience, 24/7. Our goal is to facilitate your transition to PIX, enabling you to offer the best customer service.
The following sections describe the functionalities that an Indirect Participant can perform, via API, within the scope of PIX Indirect.

---

# Mocked Pix keys in the sandbox environment

URL: /en/documentation/pix_indireto/movimentacoes/chaves_pix_mockadas

## 104 - CAIXA ECONOMICA FEDERAL

| Chave Pix | Tipo | Nome do titular | Documento do titular | Número da conta | Agencia da conta | ISPB |
|---|---|---|---|---|---|---|
| +5568970000000 | phone_number | Vivo Test | 65322181032 | 21837-5 | 4458 | 360305 | 
| d6e2d611-6c68-4f84-9be5-962ad2f2bcb6 | random_key | Vivo Test | 61295118092 | 100091086-1 | 465 | 360305 | 
| 61295118092 | cpf | Vivo Test | 61295118092 | 1300005670-8 | 4289 | 360305 | 
| pix03@pix03.com | email | Vivo Test | 96969879003 | 363214578-8 | 8615 | 360305 | 
| +5568911106520 | phone_number | Vivo Test | 66702118805 | 100071086-1 | 465 | 360305 | 
| 5e6ce02a-e0da-4d56-73b8-84f118b4f371 | random_key | Vivo Test | 52720072800 | 100061086-1 | 465 | 360305 | 
| 52720072800 | cpf | Vivo Test | 52720072800 | 100071076-1 | 465 | 360305 | 
| pix10@pix10.com | email | Vivo Test | 24182533410 | 100071066-1 | 465 | 360305 | 
| pix33@pix33.com | email | Vivo Test | 56151446887 | 96764-6 | 919 | 360305 | 
| 88253032978 | cpf | Vivo Test | 88253032978 | 96764-6 | 919 | 360305 | 

## 341 - ITAÚ UNIBANCO S.A.

| Chave Pix | Tipo | Nome do titular | Documento do titular | Número da conta | Agencia da conta | ISPB |
|---|---|---|---|---|---|---|
| 22156083070 | cpf | Vivo Test | 22156083070 | 19413-2 | 8534 | 60701190 | 
| 96969879003 | cpf | Vivo Test | 96969879003 | 22110-1 | 8615 | 60701190 | 
| 5e6ce06a-e0da-4d56-93b8-84f118b4f371 | random_key | Vivo Test | 43135154025 | 57980-4 | 5067 | 60701190 | 
| pix11@pix11.com | email | Vivo Test | 66702118805 | 86091-8 | 3101 | 60701190 | 
| 24182533410 | cpf | Vivo Test | 24182533410 | 20467-1 | 5807 | 60701190 | 
| pix07@pix07.com | email | Vivo Test | 11646288874 | 33087-6 | 8872 | 60701190 | 

## 237 - BCO BRADESCO S.A.

| Chave Pix | Tipo | Nome do titular | Documento do titular | Número da conta       | Agencia da conta | ISPB |
|---|---|---|----------------------|-----------------------|---|---|
| 65322181032 | cpf | Vivo Test | 65322181032          | 1017372-2             | 1 | 60746948 | 
| b9380607-dac6-4e17-8ca7-eb761e3aa1dd | random_key | José Alves | 24080025327          | 0001000000000022279-9 | 1 | 08744817 | 
| b9380607-dac6-4e17-8ca7-eb761e3aa1dd | random_key | José Alves | 24080025327          | 0003000000000000288-9 | 1 | 08744817 | 
| b9380607-dac6-4e17-8ca7-eb761e3aa1dd | random_key | José Alves | 24080025327          | 0013000000000013609-9 | 1 | 08744817 | 
| b9380607-dac6-4e17-8ca7-eb761e3aa1dd | random_key | José Alves | 24080025327          | 1288000000884535174-9 | 1 | 08744817 | 
| b9380607-dac6-4e17-8ca7-eb761e3aa1dd | random_key | José Alves | 24080025327          | 3701000000593070593-9 | 1 | 08744817 | 
| pix01@pix01.com | email | Vivo Test | 65322181032          | 1017372-2             | 1 | 60746948 | 
| pix01@pix01.com | email | Vivo Test | 65322181032          | 1925255-8             | 3952 | 60746948 | 
| pix12@pix12.com | email | Vivo Test | 11085087824          | 1071659-4             | 427 | 60746948 | 
| 5e6ce08a-e0da-4d56-93b8-84f118b4f371 | random_key | Vivo Test | 66702118805          | 1751795-3             | 6162 | 60746948 | 
| +5568911137576 | phone_number | Vivo Test | 82104056080          | 1587784-7             | 1340 | 60746948 | 

## 33 - BCO SANTANDER (BRASIL) S.A.

| Chave Pix | Tipo | Nome do titular | Documento do titular | Número da conta | Agencia da conta | ISPB |
|---|---|---|---|---|---|---|
| 5e6ce05a-e0da-4d56-93b8-84f118b4f371 | random_key | Vivo Test | 42759960030 | 9206744-2 | 4187 | 90400888 | 
| 34175131205 | cpf | Vivo Test | 34175131205 | 9206744-2 | 4187 | 90400888 | 
| 5e6ce05a-e0da-4d56-53b8-74f118b4f371 | random_key | Vivo Test | 11646288874 | 9206744-2 | 4187 | 90400888 | 
| 82104056080 | cpf | Vivo Test | 82104056080 | 2850903-2 | 214 | 90400888 | 

## 77 - BANCO INTER
ISPB: 416968

| Chave Pix | Tipo | Nome do titular | Documento do titular | Número da conta | Agencia da conta | ISPB |
|---|---|---|---|---|---|---|
| 22156083070 | cpf | Vivo Test | 22156083070 | 4810813-8 | 1 | 416968 | 
| pix13@pix13.com | email | Vivo Test | 43135154025 | 4830813-8 | 1 | 416968 | 
| 66702118805 | cpf | Vivo Test | 66702118805 | 4820813-8 | 1 | 416968 | 
| 5e6ce05a-e0da-4d56-93b7-84f118b4f371 | random_key | Vivo Test | 24182533410 | 4850813-8 | 1 | 416968 | 
| +5568911168384 | phone_number | Vivo Test | 17413005255 | 4850813-8 | 1 | 416968 | 
| pix06@pix06.com | email | Vivo Test | 81035632691 | 4750813-8 | 1 | 416968 | 
| pix31@pix31.com | email | Vivo Test | 55125236780 | 1768538-4 | 2960 | 416968 | 

## 260 - NU PAGAMENTOS - IP

| Chave Pix | Tipo | Nome do titular | Documento do titular | Número da conta | Agencia da conta | ISPB |
|---|---|---|---|---|---|---|
| pix04@pix04.com | email | Vivo Test | 69017362073 | 81648459-8 | 1 | 18236120 | 
| pix09@pix09.com | email | Vivo Test | 34175131205 | 81538459-8 | 1 | 18236120 | 
| 5e6ce01a-e0da-4d56-93b8-44f118b4f371 | random_key | Vivo Test | 17413005255 | 81548459-8 | 1 | 18236120 | 
| +5568911186420 | phone_number | Vivo Test | 81035632691 | 81538459-8 | 1 | 18236120 | 
| pix32@pix32.com | email | Vivo Test | 56151446887 | 293201-6 | 2811 | 18236120 | 

## 336 - BCO C6 S.A.

| Chave Pix | Tipo | Nome do titular | Documento do titular | Número da conta | Agencia da conta | ISPB |
|---|---|---|---|---|---|---|
| dbbf965d-677c-49ff-b9da-5131da1505f3 | random_key | Vivo Test | 65322181032 | 1019902-6 | 1 | 31872495 | 
| 5e6ce07a-e0da-4d56-93b8-84f118b4f371 | random_key | Vivo Test | 11085087824 | 1018902-6 | 1 | 31872495 | 
| 11646288874 | cpf | Vivo Test | 11646288874 | 1017902-6 | 1 | 31872495 | 

## 403 - CORA SCD S.A.

| Chave Pix | Tipo | Nome do titular | Documento do titular | Número da conta | Agencia da conta | ISPB |
|---|---|---|---|---|---|---|
| 39284100000000 | cnpj | Parcela Mais | 39284100000000 | 1708315-8 | 1 | 37880206 | 

## 422 - BCO SAFRA S.A.

| Chave Pix | Tipo | Nome do titular | Documento do titular | Número da conta | Agencia da conta | ISPB |
|---|---|---|---|---|---|---|
| pix02@pix02.com | email | Vivo Test | 69017362073 | 364522-5 | 284 | 58160789 | 
| pix08@pix08.com | email | Vivo Test | 34175131205 | 264522-5 | 284 | 58160789 | 
| +5568911106070 | phone_number | Vivo Test | 11646288874 | 354522-5 | 284 | 58160789 | 
| 53465252110 | cpf | Vivo Test | 53465252110 | 364422-5 | 284 | 58160789 | 
| +5568911122488 | phone_number | Vivo Test | 10632271 | 1558321-5 | 907 | 58160789 | 

## 655 - BCO VOTORANTIM S.A.

| Chave Pix | Tipo | Nome do titular | Documento do titular | Número da conta | Agencia da conta | ISPB |
|---|---|---|---|---|---|---|
| 5301321099 | cpf | Vivo Test | 5301321099 | 622660113-8 | 1111 | 59588111 | 

## DOCK SOLUCOES EM MEIOS DE PAGAMENTO S A

| Chave Pix | Tipo | Nome do titular | Documento do titular | Número da conta | Agencia da conta | ISPB |
|---|---|---|---|---|---|---|
| +5568911165580 | phone_number | Vivo Test | 53465252110 | 622470112-8 | 1111 | 8744817 | 
| 17413005255 | cpf | Vivo Test | 17413005255 | 622450112-8 | 1111 | 8744817 | 
| 81035632691 | cpf | Vivo Test | 81035632691 | 622450113-8 | 1111 | 8744817 | 
| 5e6ce05a-e0da-4d56-93b8-64f118b4f371 | random_key | Vivo Test | 81035632691 | 622650113-8 | 1111 | 8744817 | 

## COMPANHIA GLOBAL DE SOLUCOES E SERVICOS DE PAGAMENTOS S.A.

| Chave Pix | Tipo | Nome do titular | Documento do titular | Número da conta | Agencia da conta | ISPB |
|---|---|---|---|---|---|---|
| 96755229091 | cpf | Teste sem Compe | 96755229091 | 1444301-8 | 1 | 32024691 |

---

# Pix Key Lookup

URL: /en/documentation/pix_indireto/movimentacoes/consultar_chave_pix

## Request

ENDPOINT /pix_key/ PIX_KEY
METHOD GET

### Request Path Params
| Field         | Type   | Description                        | Characters |
|---------------|--------|------------------------------------|------------|
| `pix_key` *   | string | PIX key to be queried.             | 77         |
:::info Pix Key Types
The “pix_key” can be a CPF, CNPJ, Email, Phone, or a Random Key (UUID), following these formats:
**CPF**: Integer with 11 digits.

**CNPJ**: Integer with 14 digits.

**Email**: Text containing at least one “@”.

**Phone**: Text containing the following values: “+55” + “Mobile DDD“ + “Complete Mobile Number with a minimum of 8 and a maximum of 9 digits”. E.g., “+5511987654321“.

**Random Key**: UUID4.
:::

### Request Query Params
| Field        | Type   | Description          | Characters |
|--------------|--------|----------------------|------------|
| `alias_key` *| uuidv4 | Unique alias key.    | 36         |
:::info Usage of Query Tokens
To ensure the correct person is charged for the PIX key query token, it is mandatory to send the `alias_key`.
:::

## Response

STATUS 200

Response Body: Key active

```json
{
  "account_branch": "0001",
  "account_created_at": "2023-09-06T22:03:34.000Z",
  "account_digit": "8",
  "account_number": "2897775",
  "account_type": "checking",
  "bank_code": null,
  "end_to_end_id": "E73856642202309201429bZKfklNlbwu",
  "financial_institution": "BANCO INDIRETO PRUPRU",
  "ispb": "32402502",
  "owner_masked_document_number": "**.458.****/0001-**",
  "owner_name": "Empresa teste 01",
  "owner_person_type": "legal",
  "owner_trading_name": null,
  "pix_key": "0f723f66-b333-4187-be16-97fc37c86052"
}

```

| Field                        | Type   | Description                                            | Max. Characters |
|------------------------------|--------|--------------------------------------------------------|-----------------|
| `pix_key`                    | string | PIX key of the query                                   | 4               |
| `account_branch`             | string | Branch, without the check digit                        | 4               |
| `account_digit`              | string | Account check digit                                    | 1               |
| `account_number`             | string | Account number, without the check digit                | 20              |
| `account_type`               | string | Definition of account type                             | 20              |
| `owner_person_type`          | string | Type of account owner. Can be "legal" or "natural"     | 7               |
| `owner_masked_document_number` | string | CPF or CNPJ number                                     | 14              |
| `end_to_end_id`              | string | Unit key of the PIX transaction                        | 32              |
| `owner_name`                 | string | Account owner's name                                   | 120             |
| `owner_trading_name`         | string | Account owner's trade name (only for CNPJ)             | 100             |
| `ispb`                       | string | ISPB of the Participant holding the key                | 8               |
| `bank_code`                  | string | COMPE code of the financial institution                | 3               |
| `financial_institution`      | string | Name of the financial institution holding the key      | 100             |
| `account_created_at`         | string | Account creation date                                  | 20              |

STATUS 4XX

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`               | Description (eng)<br/>`Description`                                             | Description (ptbr)<br/>`translation`                                               |
|-------------|----------------------|----------------------------------|-------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
| 400         | PIX000086            | Invalid Query Params Combination | Account_key and Alias_key are mutually exclusive query parameters. Choose one | Account_key e Alias_key são parâmetros mutualmente exclusivos. Escolha apenas um |
| 403         | PIX000080            | Not enough permission            | The selected agent is not an Pix Indirect Participant                         | O agente selecionado não é um Participante Indireto do Pix                       |
| 404         | PIX000082            | Alias not found                  | Alias \{alias_key\} not found                                                   | Alias \{alias_key\} não encontrado                                                 |
| 404         | PIX000017            | Pix Key is Unregistered          | Pix key \{pix_key\} is not currently used                                       | A chave pix \{pix_key\} não está sendo utilizada                                   |
| 400         | PIX000081            | Rate Limit Exceeded              | Rate Limit Exceeded                                                           | Limite de requisições excedido                                                   |

---

# Consult Pix transaction

URL: /en/documentation/pix_indireto/movimentacoes/consultar_pix

## Request

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY /pix_transfer/ PIX_TRANSFER_KEY / PIX_TRANSFER_DIRECTION
METHOD GET

### Request Path Params
| Field                    | Type   | Description                                                                                      |
|--------------------------|--------|--------------------------------------------------------------------------------------------------|
| `pix_transfer_direction` * | string | Filter to indicate if a transaction is incoming or outgoing. Values: **incoming** and **outgoing** |
| `account_key` *          | string | Unique identification key for the QI account |
| `alias_key` *            | string | Unique key for the Alias |
| `pix_transfer_key` *     | string | Unique identification key for the Pix transfer |

:::caution Attention
Viewing a transfer will only be allowed if the requester has permissions on the outgoing alias of the transaction. Otherwise, a not found error will be returned.
:::
## Response

STATUS 201

Response Body: Transfer sent (outgoing)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_message": "Bom dia",
  "pix_transfer_type": "manual",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "alias_key": "c4332971-7cff-42eb-a117-7e6f0cd74db2",
  "updated_at": "2021-10-22T20:30:23.459Z",
  "created_at": "2021-10-22T20:30:23.459Z",
  "target_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "12345678",
    "owner_document_number": "***02502000***",
    "owner_person_type": "legal",
    "owner_name": "Qi Tech",
    "account_type": "checking_account",
    "ispb": "32402502",
    "pix_key": null
  },
  "receiver_conciliation_id": null,
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "end_to_end_id": "E3240250220211022203051750897529",
  "pix_transfer_status": "sent",
  "transfer_amount": 126.97,
  "fee_amount": 0.0,
  "rejection_reason": null,
  "reversals": [
    {
      "end_to_end_id": "D35713491202309182058jlqdBkkHSWU",
      "transfer_amount": 0.01,
      "reversal_reason": "client_request",
      "pix_transfer_status": "received",
      "pix_transfer_key": "423866cd-0f3f-4cdd-904b-0d2e33273afd",
      "request_control_key": "7c5a1425-73eb-420e-b4fb-0ce3386c7d0a",
      "created_at": "2021-10-23T20:30.459Z"
    }
  ]
}

```

Response Body: Transfer rejected (outgoing)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_message": "Bom dia",
  "pix_transfer_type": "manual",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "alias_key": "c4332971-7cff-42eb-a117-7e6f0cd74db2",
  "updated_at": "2021-10-22T20:30:23.459Z",
  "created_at": "2021-10-22T20:30:23.459Z",
  "target_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "12345678",
    "owner_document_number": "***02502000***",
    "owner_person_type": "legal",
    "owner_name": "Qi Tech",
    "account_type": "checking_account",
    "ispb": "32402502",
    "pix_key": null
  },
  "receiver_conciliation_id": null,
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "end_to_end_id": "E3240250220211022203051750897529",
  "pix_transfer_status": "rejected",
  "transfer_amount": 126.97,
  "fee_amount": 0.0,
  "error_code": "PXT000132",
  "error_description": "Target account number is invalid.",
  "error_translation": "Número da conta de destino é inexistente ou inválido.",
  "reversals": []
}

```

Response Body: Refund sent (outgoing)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_message": "Bom dia",
  "pix_transfer_type": "reversal",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "alias_key": "c4332971-7cff-42eb-a117-7e6f0cd74db2",
  "updated_at": "2021-10-22T20:30:23.459Z",
  "created_at": "2021-10-22T20:30:23.459Z",
  "target_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "12345678",
    "owner_document_number": "***02502000***",
    "owner_person_type": "legal",
    "owner_name": "Qi Tech",
    "account_type": "checking_account",
    "ispb": "32402502",
    "pix_key": null
  },
  "receiver_conciliation_id": null,
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "end_to_end_id": "E3240250220211022203051750897529",
  "pix_transfer_status": "sent",
  "transfer_amount": 126.97,
  "fee_amount": 0.0,
  "rejection_reason": null,
  "reversals": [],
  "original_incoming_pix_transfer": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3"
}

```

Response Body: Transfer received (incoming)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "alias_key": "c4332971-7cff-42eb-a117-7e6f0cd74db2",
  "end_to_end_id": "E18236120202308111235s14fddf2801",
  "pix_transfer_status": "received",
  "receiver_conciliation_id": "745c28c780bc4822bbade86dd875d10b",
  "transfer_amount": 126.97,
  "fee_amount": 0.0,
  "source_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "12345678",
    "owner_document_number": "***02502000***",
    "owner_person_type": "legal",
    "owner_name": "Qi Tech",
    "account_type": "checking_account",
    "ispb": "32402502"
  },
  "pix_transfer_type": "dynamic_qr_code",
  "reversals": []
}
```

Response Body: Refund Received (incoming)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "alias_key": "c4332971-7cff-42eb-a117-7e6f0cd74db2",
  "end_to_end_id": "E18236120202308111235s14fddf2801",
  "pix_transfer_status": "received",
  "receiver_conciliation_id": "745c28c780bc4822bbade86dd875d10b",
  "transfer_amount": 126.97,
  "fee_amount": 0.0,
  "source_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "12345678",
    "owner_document_number": "***02502000***",
    "owner_person_type": "legal",
    "owner_name": "Qi Tech",
    "account_type": "checking_account",
    "ispb": "32402502"
  },
  "pix_transfer_type": "reversal",
  "reversals": [],
  "original_outgoing_pix_transfer": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3"
}
```

Response Body: Transfer rejected (incoming)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "alias_key": "c4332971-7cff-42eb-a117-7e6f0cd74db2",
  "end_to_end_id": "E18236120202308111235s14fddf2801",
  "pix_transfer_status": "rejected",
  "receiver_conciliation_id": "745c28c780bc4822bbade86dd875d10b",
  "transfer_amount": 126.97,
  "fee_amount": 0.0,
  "source_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "12345678",
    "owner_document_number": "***02502000***",
    "owner_person_type": "legal",
    "owner_name": "Qi Tech",
    "account_type": "checking_account",
    "ispb": "32402502"
  },
  "pix_transfer_type": "dynamic_qr_code",
  "reversals": []
}
```

STATUS 4XX

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`                          | Description (eng)<br/>`Description`                 | Description (ptbr)<br/>`translation`                                          |
|-------------|----------------------|---------------------------------------------|---------------------------------------------------|-----------------------------------------------------------------------------|
| 400         | PXT000075            | Pix Transfer Key or End To End Not Provided | No pix transfer key or end to end id provided.    | Não foram fornecidos uma pix transfer key ou end to end id.                 |
| 404         | PXT000023            | Outgoing PIX Transfer Not Found             | Pix transfer key \{pix_transfer_key\} was not found | Transferência PIX de saída com chave \{pix_transfer_key\} não foi encontrada. |
| 403         | PIT000001            | User is not allowed to do this transaction  | User is not allowed to do this transaction        | Usuário não tem autorização para fazer essa transação                       |

---

# Pix Refund

URL: /en/documentation/pix_indireto/movimentacoes/devolucao_pix

A Pix refund can be made up to 90 days from its receipt.

## Request

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY /pix_transfer/ PIX_TRANSFER_KEY /reversal
METHOD POST

### Request Path Params
| Field             | Type   | Description                                                       | Characters |
|-------------------|--------|-------------------------------------------------------------------|------------|
| `account_key`     | string | Unique account key (UUIDv4)                                        | 36         |
| `alias_key`       | string | Unique alias key (UUIDv4)                                          | 36         |
| `pix_transfer_key`| string | Unique identification key of the Pix transfer in the QI system (UUIDv4) | 36         |
Request Body

```json
{
  "request_control_key": "303393bf-8f2e-4ff0-b326-ee7ad612e8ca",
  "reversal_amount": 147.00,
  "reversal_reason": "client_request",
  "reversal_message": "Mensagem Pix da Devolução"
}
```

### Request Body
| Field                  | Type   | Description                                            | Characters |
|------------------------|--------|--------------------------------------------------------|------------|
| `request_control_key` *| string | Uniqueness key for the request (UUIDv4)                | 36         |
| `reversal_amount` *    | number | Refund amount                                          | 11         |
| `reversal_reason` *    | string | Reason for the refund                                  | **[Enumerator reversal_reason](#enumerator-reversal_reason)** |
| `reversal_message`     | string | Refund message                                         | 140        |

### Enumerator reversal_reason
| Enumerator         | Description                                    |
|--------------------|------------------------------------------------|
| **client_request** | If requested by the account owner              |
| **reconciliation** | For reconciliation due to operational error    |

## Response

### Response Body
| Field                  | Type   | Description                                             | Characters |
|------------------------|--------|---------------------------------------------------------|------------|
| `reversal_status`      | string | Enumerator for the reversal transaction status. Can be 'pending', 'sent', or 'rejected' | 36         |
| `transfer_amount`      | number | Refund transfer amount                                  | 11         |
| `pix_transfer_key`     | string | Key of the executed Pix transaction for the refund (UUIDv4) | 36         |
| `end_to_end_id`        | string | Idempotency key of a Pix transaction within the SPI (Instant Payment System) | 32         |
| `request_control_key`  | string | Unique identification key for the client's request (UUIDv4) | 36         |
| `created_at`           | string | Date and time of the refund                             | ---        |

STATUS 201 created

Response Body: Reversão Enviada

```json
{
  "reversal_status": "sent",
  "transfer_amount": 147.00,
  "pix_transfer_key": "cdcf0d25-08a1-46e3-902a-6d7ca75e6c48",
  "end_to_end_id": "E32402502202407112211Id9JbxoaiTf",
  "request_control_key": "7c5a1425-73eb-420e-b4fb-0ce3386c7d0c",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

STATUS 202
:::info Information
If a `pix_transfer_status` is returned in the **pending** state, the Pix request should not be retried.
This transfer will be reprocessed. It is necessary to check the transfer status through the pix transfer query.
:::

Response Body: Reversal pending

```json
{
  "reversal_status": "pending",
  "transfer_amount": 147.00,
  "pix_transfer_key": "cdcf0d25-08a1-46e3-902a-6d7ca75e6c48",
  "end_to_end_id": "E32402502202407112211Id9JbxoaiTf",
  "request_control_key": "7c5a1425-73eb-420e-b4fb-0ce3386c7d0c",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

STATUS 4XX

Response Body: Reversal rejected

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in portuguese",
  "code": "codigo",
  "extra_fields": {
    "pix_transfer_data": {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "end_to_end_id": "E32402502202407112211Id9JbxoaiTf",
      "pix_transfer_status": "rejected",
      "created_at": "2021-10-22T20:30:23.459Z"
    }
  }
}
```

STATUS 400

:::info Information
In addition to the errors listed below, the Pix refund may encounter other errors established in [Pix Transaction](./transacao/transacao_pix_manual_sync).
:::

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`                   | Description (eng)<br/>`Description`                                      | Description (ptbr)<br/>`translation`                                                        |
|-------------|----------------------|--------------------------------------|------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|
| 400         | QIT000001            | Bad Request                          | Schema Error                                                           | Erro de Schema                                                                            |
| 404         | PXT000018            | Reversal Original Transfer not Found | Reversal original pix transfer not found.                              | Transferência original da devolução não foi encontrada.                                   |
| 400         | PXT000017            | Reversal Too Great                   | Reversal transfers sum amount surpasses that of original pix transfer. | A soma das transferências de devolução ultrapassam o valor da transferência pix original. |
| 400         | PXT000015            | Reversal date expired                | Reversal original transaction is older than 90 days                    | A data de criação da transação original é mais antiga que 90 dias                         |
| 400         | PXT0000127           | Invalid Reversal Reason              | Reversal reason \{reversal_reason\} is not valid                       | Razão de reversão \{reversal_reason\} não é válida                                        |

---

# Introduction to PIX Transactions

URL: /en/documentation/pix_indireto/movimentacoes/introducao_movimentacoes

The Indirect Participant (Alias) client can request various functionalities related to PIX transactions. Among them are:

Manual PIX transaction
PIX transaction by key
PIX QR Code transaction
PIX reversal

### Pix Transfer Types (pix_transfer_type)

| Enumerator          | Description                                                                                                                                                                                                                 |
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **manual**          | Pix using destination account data. Required to send `target_account`                                                                                                                                             |
| **key**             | Pix using a pix key. Required to send `target_pix_key`. Recommended to send `end_to_end_id` from the [pix key query](/documentation/pix_indireto/movimentacoes/consultar_chave_pix) if it has been performed |
| **static_qr_code**  | Pix using a static QR code. Required to send the `end_to_end_id` returned in the [QR code decoding](/documentation/pix/decodificar_qr_code)                                                                  |
| **dynamic_qr_code** | Pix using a dynamic QR code. Required to send the `end_to_end_id` returned in the [QR code decoding](/documentation/pix/decodificar_qr_code)                                                                  |
| **reversal**        | PIX reversal                                                                                                                                                                                                       |

Among these functionalities, there is the type of transaction 'synchronicity' that an Indirect Participant can choose to use, according to their needs.

:::info Information

Everything described in this introduction section is also detailed, including how the Indirect Participant should handle it via API, in the following sections.

:::

## End to end ID

Every pix transaction has a unique identifier in the central bank. End to End ID is the end-to-end identifier of a pix transfer. It is used for rate-limiting control in the Central Bank.

```mermaid
sequenceDiagram
    Participante Indireto->>+Banco Central: Consulta de Chave Pix
    Banco Central-->>-Participante Indireto: Chave Pix + End to End ID da consulta <br> Token consumida do bucket
    Participante Indireto->>+Banco Central: Transferência com End to End ID
    Banco Central-->>-Participante Indireto: Sucesso na transação com chave pix <br> Token devolvido ao bucket
```

Each individual or legal entity registration has a bucket with the Central Bank. PIX key query requests consume tokens from this bucket, which are recovered when making a pix transaction linked to a query. The link between a pix key query and a transaction is made through the End to End ID.

## Transaction Synchronicity

The Indirect Participant can choose to perform a PIX transaction synchronously or asynchronously. In both modes, the PIX transaction will be executed within the time established by the Central Bank of Brazil.

:::info Information

Our team will configure the synchronicity regime to be used as agreed with the client.

:::

:::info Information

The endpoints, methods, payloads and other request components are identical for the synchronous and asynchronous regime. The difference would only be that for the asynchronous regime, the response will always be a `pix_transfer` with **pending** status if it has been approved in the initial validations. Subsequently a webhook will be sent informing the final status of the transaction (**sent** or **rejected**).

:::

## Transaction Retry

Due to possible delays in the Central Bank of Brazil's messaging system regarding PIX transactions, QITech has a retry mechanism for PIX transactions, both for the synchronous and asynchronous model.

If this scenario occurs, the Indirect Participant will receive an HTTP 202 status, indicating that the transaction was sent to QITech and is pending confirmation from the Central Bank of Brazil. Once this is retried, the Indirect Participant will be informed via webhook about the transaction completion.

---

# Scenario Simulation

URL: /en/documentation/pix_indireto/movimentacoes/simulacao

Step-by-step guide to simulate the completion of actions performed by external agents. These simulations include incoming transactions and refunds.
:::info Information
There is no payload response (response body) for these requests.
:::

## 1 - Simulating an Incoming PIX
### Request

ENDPOINT /mock/pix_transfer/incoming_pix_transfer
METHOD POST

Request Body

```json
{
  "target_account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "target_alias_key": "c4332971-7cff-42eb-a117-7e6f0cd74db2",
  "amount": 100.01
}

```

### Object Request Body

| Field                | Type   | Description                           | Max. Characters |
|----------------------|--------|---------------------------------------|-----------------|
| **target_account_key*** | string | Unique key of the destination account | 36              |
| **target_alias_key** | string | Unique key of the destination alias   | 36              |
| **amount***         | number  | Transaction amount                    | 6               |

## 2 - Simulation a QR Code Pix payment

### Request

ENDPOINT /mock/pix_transfer/incoming_pix_qrcode
METHOD POST

Request Body

```json
{
  "target_alias_key": "\<Chave única do alias de destino\>",
  "amount": "\<Valor da transação\>",
  "receiver_conciliation_id": "\<id do receiver conciliation do qr code\>"
}

```

### Object Request Body
| Field                        | Type    | Description                              | Max. Characters | Example                               | Note                    |
|------------------------------|---------|------------------------------------------|-----------------|---------------------------------------|-------------------------|
| **target_alias_key***        | string  | Unique key of the destination alias      | 36              | "41112f46-0034-4007-85687-5e592173db2"|                         |
| **amount***                  | decimal | Transaction amount                       | 6               | 1000.00                               | Maximum value of 100,000|
| **receiver_conciliation_id***| string  | Reconciliation ID of the receiver of the QR code | 36      | 1000                                  |                         |

## 3 - Simulating a PIX Refund

Simulates the refund of an outgoing Pix transfer. The total value of the refunds must not exceed the value of the original transfer. To identify the target transaction, send the `end_to_end_id` of the original transfer.
### Request

ENDPOINT /mock/pix_transfer/reversal
METHOD POST

Request Body

```json
{
  "end_to_end_id": "E35713491202309182110sSCNh25ooX2",
  "amount": 100.00
}

```

### Object Request Body
| Field                | Type   | Description                                   | Max. Characters |
|----------------------|--------|-----------------------------------------------|-----------------|
| **end_to_end_id***   | string | Unit key of the transaction to be refunded    | 32              |
| **amount***          | number | Amount to be refunded                         | 6               |

## 4 - Simulating a Transaction in Pending Confirmation State
Pix transactions can enter the **pending_confirmation** status when there is a delay in receiving the Pix transaction response from the Central Bank. To simulate this scenario, make a transaction with the pix key `"target_pix_key": "0476f803-0129-430a-a66c-d2f0d7cf4aaa"` or, for **manual** pix transfers, use `"owner_document_number": "35586870002"` as the document number of the destination account owner.
To update the transaction status, make the request below with `transaction_status` set to **sent** to approve the transaction, or **rejected** to reject it.
### Request

ENDPOINT /mock/pix_transfer/pending_confirmation
METHOD POST

Request Body

```json
{
  "end_to_end_id": "E32402502202308181802vSHbiqNCk9i",
  "transaction_status": "rejected",
  "status_reason_information": {
    "error_description": "description",
    "error_translation": "translation",
    "error_short_description": "short_description"
  },
  "error_code": "test_error"
}
```

### Body Parameters
| Field                         | Type   | Description                                                    | Max. Characters |
|-------------------------------|--------|----------------------------------------------------------------|-----------------|
| `end_to_end_id` *             | string | Unit key of the PIX transaction                                | 36              |
| `transaction_status` *        | enum   | [Enumerator Transaction Status](#enumerator-transaction-status)|
| `status_reason_information`   | object | [Object Status Reason Information](#object-status-reason-information) |
| `error_code`                  | string | Error code                                                     |

### Enumerator Transaction Status
| Enumerator | Description |
|------------|-------------|
| **sent**   | Completed   |
| **rejected** | Rejected   |

### Object Status Reason Information
| Field                   | Type   | Description                               | Max. Characters |
|-------------------------|--------|-------------------------------------------|-----------------|
| `error_description`     | string | Description of the error in English       | 100             |
| `error_translation`     | string | Description of the error in Portuguese    | 100             |
| `error_short_description` | string | Short description of the error in English | 100             |

## 5 - Simulating a Rejected Transaction
Pix transactions can enter the **rejected** status when there is an expected return of refusal from the Central Bank or the recipient PSP. To simulate this scenario, make a transaction with the pix key `"target_pix_key": "b9380607-dac6-4e17-8ca7-eb761e3aa1dc"` or, for **manual** pix transfers, use `"owner_document_number": "66972913039"` or `"owner_document_number": "50305556000164"` as the document number of the destination account owner.

---

# Execute Asynchronous Transfer to Manual Pix

URL: /en/documentation/pix_indireto/movimentacoes/transacao_async/transacao_pix_manual

## Manual Request

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY /pix_transfer
METHOD POST

Request Body

```json

{
    "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
    "pix_transfer_type": "manual",
    "target_account": {
      "account_branch": "0001",
      "account_digit": "1",
      "account_number": "2983779",
      "account_type": "checking_account",
      "ispb": "99999004",
      "owner_document_number": "36188081866",
      "owner_name": "USER PF LIMIT LEDGER",
      "owner_person_type": "natural"
    },
    "pix_message": "Bom dia", 
    "transaction_amount": 500.00,
    "schedule_date": "2021-08-04"
}

```

### Body Param

| Field | Type | Description | Characters |
|-------|------|-------------|------------|
| `request_control_key` *| uuidv4 | UUID4 for querying purposes about the made request. | 36 |
| `pix_transfer_type` * | string | Pix has different initiation types, "manual" where the user must send the destination and source account fields and "key" where the user must send the recipient's Pix key fields (destination account) and the source account data. | 6 |
| `target_account` *| Object | Destination account - Should only be sent in "manual" type transactions. | **[target_account Object](#target_account-object)** |
| `pix_message`  | string | Optional message that will accompany the Pix | 140 |
| `transaction_amount` * | float | Transaction amount | 20 |
| `schedule_date` | date | Transaction scheduling date (if not sent, the transfer is executed at the moment of approval). | 10 |

### target_account Object

| Field | Type | Description | Characters |
|-------|------|-------------|------------|
| `account_branch` * | string | Branch.   | 4 |
| `account_digit` * | string | Account digit  | 1 |
| `account_number` *  | string | Account number.  | 8 |
| `owner_document_number` * | string | CPF or CNPJ (numbers only) of the account holder.| 14 |
| `owner_name` * | string | Account holder name. | 120 |
| `account_type` * | string | Account type, which can be `checking_account`, `deposit_account`, `guaranteed_account`, `investment_account`, `saving_account` | 20 |
| `owner_trading_name` | string | Trading name for legal entities. Used only for CNPJ| 10 |
| `ispb` *| string | Eight-digit code that identifies banks in the Central Bank's reserve transfer system. | 8 |

:::info HTTP Status 202 Accepted
In asynchronous pix, every transaction returns **http status 202 Accepted**, the Pix request **should not be retried**. In this scenario, the transaction will be executed opportunely and will be updated through the [Transaction Update Webhook](/documentation/pix_indireto/movimentacoes/webhook/webhook_transacao).
It is also possible to check the transaction status through the endpoint [/account/ACCOUNT_KEY/alias/ALIAS_KEY/pix_transfer/PIX_TRANSFER_KEY](/documentation/pix_indireto/movimentacoes/consultar_pix).
:::

## Response

STATUS 202 Accepted

Response Body: Manual transfer

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "pix_transfer_status": "pending_confirmation",
  "created_at": "2021-10-22T20:30:23.459Z"
}

```

STATUS 400

Response Body

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

```

---

# Execute Asynchronous Transfer via Pix Key

URL: /en/documentation/pix_indireto/movimentacoes/transacao_async/transacao_pix_normal

## Normal Request

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY /pix_transfer
METHOD POST

Request Body

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_transfer_type": "key",
  "target_pix_key": "pix@qitech.com.br",
  "pix_message": "Bom dia", 
  "transaction_amount": 500.00,
  "end_to_end_id": "E3240250220211022203051750897529",
  "schedule_date": "2021-08-04"
}

```

### Request Path Params

| Field               | Type   | Description             | Characters |
|---------------------|--------|-----------------------|------------|
| `account_key`       | uuidv4 | Unique account key. | 36         |
| `alias_key` | uuidv4 | Unique alias key. | 36         |

### Body Param

|  Field  | Type | Description | Max. Characters |
|---------|------|-----------|------------|
| `request_control_key` *| uuidv4 | UUID4 for query purposes about the request made. | 36 |
| `pix_transfer_type` * | string | Pix has different initiation types, "manual" where the user must send the destination and source account fields, and "key" where the user must send the receiver's Pix key fields (destination account) and source account data. | 6 |
| `transfer_time` * | string | Transaction synchronicity information, used to define when the transaction will be processed. If "synchronous", the transaction will be executed immediately, but respecting a maximum limit of transactions per minute. If "asynchronous", the transaction will be processed in a | 200 |
| `target_pix_key` * | string | Pix key that will receive the transaction. | 200 |
| `pix_message` *  | string | Optional message that will accompany the Pix | 140 |
| `transaction_amount` * | float | Transaction amount | 20 |
| `end_to_end_id` | string | unique identification key for a transaction or query at the Central Bank. Example: E3240250220210615135810450327042 | 32 |
| `schedule_date` | date | Transaction scheduling date (if not sent, the transfer is executed at the moment of approval). | 10 |

:::info HTTP Status 202 Accepted
In asynchronous pix, every transaction returns **http status 202 Accepted**, the Pix request **should not be retried**. In this scenario, the transaction will be executed opportunely and will be updated through the [Transaction Update Webhook](/documentation/pix_indireto/movimentacoes/webhook/webhook_transacao).
It is also possible to check the transaction status through the endpoint [/account/ACCOUNT_KEY/alias/ALIAS_KEY/pix_transfer/PIX_TRANSFER_KEY](/documentation/pix_indireto/movimentacoes/consultar_pix).
:::
## Response

STATUS 202 Accepted

Response Body

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "pix_transfer_status": "pending_confirmation",
  "created_at": "2021-10-22T20:30:23.459Z"
}

```

STATUS 400

Response Body: Invalid Request Body

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

```

---

# Perform Asynchronous Transfer to Pix QR Code

URL: /en/documentation/pix_indireto/movimentacoes/transacao_async/transacao_pix_qr_code

## QR Code Request 

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY /pix_transfer
METHOD POST

Request Body

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_transfer_type": "qr_code",
  "target_pix_key": "pix@qitech.com.br",
  "pix_message": "Bom dia", 
  "transaction_amount": 500.00,
  "end_to_end_id": "E3240250220211022203051750897529",
  "schedule_date": "2021-08-04",
  "receiver_conciliation_id": "REC00000000000000000000009459463343"
}
```

### Body Param

|  Field  | Type | Description | Max. Characters |
|---------|------|-----------|------------|
| `request_control_key` *| uuidv4 | UUID4 for query purposes regarding the request made. | 36 |
| `pix_transfer_type` * | string | Pix has different initiation types, "manual" where the user must send the destination and source account fields and "key" where the user must send the receiver's Pix key fields (destination account) and the source account data. | 6 |
| `target_pix_key` * | string | Pix key that will receive the transaction. | 200 |
| `pix_message`  | string | Optional message that will accompany the Pix | 140 |
| `transaction_amount` * | float | Transaction amount | 20 |
| `end_to_end_id` | string | unique identification key for a transaction or query in the Central Bank. Example: E3240250220210615135810450327042 | 32 |
| `schedule_date` | date | Transaction scheduling date (if not sent, the transfer is performed upon approval). | 10 |
| `receiver_conciliation_id` * | string | Receiver conciliation identification. Generated when decoding a QR Code  | 10 |

:::info HTTP Status 202 Accepted
In asynchronous pix, every transaction returns **http status 202 Accepted**, the Pix request **should not be retried**. In this scenario, the transaction will be processed opportunely and will be updated through the [Transaction Update Webhook](/documentation/pix_indireto/movimentacoes/webhook/webhook_transacao).
It is also possible to check the transaction status through the endpoint [/account/ACCOUNT_KEY/alias/ALIAS_KEY/pix_transfer/PIX_TRANSFER_KEY](/documentation/pix_indireto/movimentacoes/consultar_pix).
:::

## Response

STATUS 202 Accepted

Response Body

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "pix_transfer_status": "pending_confirmation",
  "created_at": "2021-10-22T20:30:23.459Z"
}

```

STATUS 400

Response Body: Invalid Request Body

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

```

STATUS 202

Response Body: Pending Transfer

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "pix_transfer_status": "pending_confirmation",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

:::danger HTTP Status 202
If **http status 202** is returned, the Pix request **should not be retried**. You need to check the status of the Pix transfer request through a GET on the route [/baas/pix/pix_transfer](/documentation/pix/pesquisar_por_transferencia_pix_de_saida).
:::

---

# Transaction by Pix Key

URL: /en/documentation/pix_indireto/movimentacoes/transacao/transacao_pix_chave_sync

## Request Manual

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY /pix_transfer
METHOD POST

Request Body

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_type": "key",
  "target_pix_key": "target_pix_key@email.com",
  "transaction_amount": 500.65,
  "end_to_end_id": "E73856642202309201429bZKfklNlbwu",
  "pix_message": "Ola Mundo"
}

```

### Body Params
| Field                  | Type      | Description                                                                                      | Characters |
|------------------------|-----------|--------------------------------------------------------------------------------------------------|------------|
| `request_control_key` * | string    | Unique identification key for the request used by the client in uuid v4 format                    | 36         |
| `pix_transfer_type` *  | enumerator| Type of the pix to be performed. For key transfer, it should be **key**                           | "key"      |
| `target_pix_key` *     | string    | Pix key of the account to which the transaction will be sent                                      | 100        |
| `transaction_amount` * | number    | Transfer amount                                                                                   | 10         |
| `end_to_end_id` *      | string    | Idempotency key of a Pix transaction - should only be sent if the transfer type is "key"          | 32         |
| `pix_message`          | string    | Message to be sent along with the Pix transfer                                                    | 140        |
:::info Warning
An `end_to_end_id` must be sent referring to the [key query](/documentation/pix_indireto/movimentacoes/consultar_chave_pix).
:::
:::danger Warning
The `end_to_end_id` from the query must be made in the name of the alias that will request the transaction!
:::
:::danger Warning
An `end_to_end_id` can only be used for a single transfer, regardless of whether it was successful or not.
:::

## Response

STATUS 201

Response Body: Transfer sent

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "alias_key": "68908c98-59cb-4fbf-9321-5d223ec78376",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "pix_transfer_status": "sent",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

STATUS 202
:::info Information

If a `pix_transfer_status` is returned in the **pending** state, the Pix request should not be retried.
This transfer will be reprocessed. It is necessary to check the transfer status through the pix transfer query.
:::

Response Body: Transfer pending

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "alias_key": "68908c98-59cb-4fbf-9321-5d223ec78376",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "pix_transfer_status": "pending",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

STATUS 4XX

Response Body: Transfer rejected

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {
    "pix_transfer_data": {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "alias_key": "68908c98-59cb-4fbf-9321-5d223ec78376",
      "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "pix_transfer_status": "rejected",
      "created_at": "2021-10-22T20:30:23.459Z"
    }
  }
}
```

STATUS 4XX

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`Description`                                                                                       | Description (ptbr)<br/>`translation`                                                                                     |
|-------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400         | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Erro de Schema                                                                                                         |
| 406         | PXT000103            | request_control_key must be a valid uuid v4 string | request_control_key was not accepted for not being a valid uuid v4 string                                               | request_control_key não foi aceito por não ser uma palavra uuid v4 válida                                              |
| 400         | PXT000048            | Bad Request                                        | Emoji not allowed in pix message.                                                                                       | Emoji não é permitido na mensagem pix.                                                                                 |
| 400         | PXT000104            | Invalid Transaction Amount                         | Transaction amount of \{transaction_amount\} is not valid. It must be a positive value with at maximum 2 decimal places | O valor de transação \{transaction_amount\} não é válido. Deve ser um valor positivo com no máximo duas casas decimais |
| 404         | PXT000004            | Account not found                                  | Account not found for: \{account_datum\}                                                                                | Conta não encontrada para: \{account_datum\}                                                                           |
| 400         | PXT000003            | Account is Closed                                  | Account \{account_key\} is closed.                                                                                      | Conta \{account_key\} está fechada.                                                                                    |
| 422         | PXT000092            | Invalid Account Type                               | Pix is not yet implemented for non-checking or non-escrow account types                                                 | Transações Pix não estão implementadas para conta que não sejam escrow ou livres                                       |
| 403         | PIT000001            | User is not allowed to do this transaction         |                                                                                                                         | Usuário não tem autorização para fazer essa transação                                                                  |
| 400         | PXT000010            | Account is Blocked                                 | Account \{account_key\} is blocked.                                                                                     | Conta \{account_key\} está bloqueada.                                                                                  |
| 400         | PXT000003            | Account is Closed                                  | Account \{account_key\} is closed.                                                                                      | Conta \{account_key\} está fechada.                                                                                    |
| 400         | PIT000003            | Bad Request                                        | Insufficient account balance for transfer and fee amount.                                                               | Saldo de conta insuficiente para a transferência e a taxa.                                                             |
| 400         | PXT000118            | Requester is not Pix Participant                   | The requester sent an alias key but is not a indirect pix participant                                                   | O requisitante enviou uma alias key no entanto não é um participante do pix indireto                                   |
| 404         | PXT000120            | Alias sent not found                               | Alias key attached to this account not found                                                                            | Alias key vinculada à conta não encontrada                                                                             |
| 406         | PXT000105            | Invalid end_to_end_id                              | The end_to_end_id sent \{end_to_end_id\} is not valid.                                                                  | O end_to_end_id enviado \{end_to_end_id\} não é válido.                                                                |
| 400         | PXT000108            | Bad Request                                        | Billing account closed or blocked                                                                                       | Conta de cobrança encerrada ou bloqueada                                                                               |
| 400         | PXT000079            | Bad Request                                        | Insufficient billing account balance for fee.                                                                           | Saldo de conta de cobrança insuficiente para a taxa.                                                                   |
| 400         | PIT000004            | Bad Request                                        | Transaction amount is over limit.                                                                                       | O total da transferência é superior ao limite.                                                                         |
| 404         | PIX000056            | Not Found                                          | Pix key inquiry not found                                                                                               | Consulta de chave pix não encontrada                                                                                   |
| 404         | PXT000041            | Not Found                                          | Qr Code not found                                                                                                       | Qr Code não encontrado                                                                                                 |
| 400         | PXT000053            | Bad Request                                        | QrCode already paid                                                                                                     | Qr Code já Pago                                                                                                        |
| 400         | PXT000118            | Requester is not Pix Participant                   | The requester sent an alias key but is not a indirect pix participant                                                   | O requisitante enviou uma alias key no entanto não é um participante do pix indireto                                   |
| 404         | PXT000120            | Alias sent not found                               | Alias key attached to this account not found                                                                            | Alias key vinculada à conta não encontrada                                                                             |
| 400         | PXT000115            | Bad Request                                        | Insufficient account balance for transfer and fee amount.                                                               | Saldo de conta insuficiente para a transferência e a taxa                                                              |
| 400         | PXT000128            | Bad Request                                        | Pix key \{pix_key\} sent does match inquiry pix key. Verify if end_to_end_id sent is correct                            | Chave Pix \{pix_key\} enviada não condiz com consulta. Verifique se end_to_end_id enviado está correto                 |
| 400         | PXT000109            | Bad Request                                        | request_control_key \{request_control_key\} already in use                                                              | request_control_key \{request_control_key\} já utilizada                                                               |
| 400         | PXT000061            | Bad Request                                        | End to end id invalid. A pix transfer with the end to end id \{end_to_end\} has already been registered!                | End to end id inválido. Uma transação pix com o identificador único \{end_to_end\} já foi registrada!                  |
| 400         | PXT000129            | SPI Error message                                  | Message rejected by SPI-ICOM                                                                                            | Mensagem rejeitada pela SPI-ICOM                                                                                       |
| 408         | PXT000130            | SPI Timeout Control                                | SPI Timeout Control                                                                                                     | Controle de timeout no SPI                                                                                             |
| 400         | PXT000131            | Receiver Internal Error                            | Cancelled transaction due to receiver's internal error                                                                  | Transação interrompida devido a erro no PSP do Recebedor                                                               |
| 400         | PXT000132            | Invalid Target Account Number                      | Target account number is invalid                                                                                        | Número da conta de destino é inexistente ou inválido                                                                   |
| 400         | PXT000133            | Blocked Target Account                             | Target account is blocked.                                                                                              | A conta de destino encontra-se bloqueada.                                                                              |
| 400         | PXT000134            | Closed Target Account                              | Target account is closed.                                                                                               | A conta de destino encontra-se encerrada.                                                                              |
| 400         | PXT000135            | Unsupported Transaction                            | Unsupported transaction for given target account.                                                                       | A conta de destino não suporta este tipo de transação.                                                                 |
| 400         | PXT000136            | Invalid Participant                                | SPI participant is not PSP settler agent of payer nor receiver.                                                         | Participante direto do SPI não é liquidante do PSP do Pagador / Recebedor.                                             |
| 400         | PXT000137            | Zero Value Payment Order                           | Zero value payment order.                                                                                               | Ordem de pagamento com valor zero.                                                                                     |
| 400         | PXT000138            | Insufficient Funds                                 | Insufficient funds in PI account from payer.                                                                            | Saldo insuficiente na conta PI do pagador.                                                                             |
| 400         | PXT000139            | Return Value Too Great                             | Return value greater than corresponding payment order.                                                                  | Valor de devolução acima do valor de pagamento correspondente.                                                         |
| 400         | PXT000140            | Invalid Transactions Number                        | Invalid transactions number.                                                                                            | Quantidade de transações inválida.                                                                                     |
| 400         | PXT000141            | Unrelated Beneficiary Document Number              | Beneficiary document number is not that of target account owner.                                                        | CPF/CNPJ do usuário recebedor não é compatível com o titular da conta de destino.                                      |
| 400         | PXT000142            | Invalid Beneficiary Document Number                | Invalid beneficiary document number                                                                                     | CPF/CNPJ da conta de destino está incorreto.                                                                           |
| 400         | PXT000143            | Incorrect Message Element                          | Incorrect message element.                                                                                              | Elemento da mensagem incorreto.                                                                                        |
| 403         | PXT000144            | Rejected Payment Order                             | Beneficiary's PSP has rejected payment order.                                                                           | Ordem de pagamento foi rejeitada pelo banco recebedor.                                                                 |
| 403         | PXT000145            | Unauthorized Payer                                 | Signing participant is unauthorized to make a payment order for paying account.                                         | Participante que assinou a mensagem não é autorizado a realizar a operação na conta PI debitada.                       |
| 400         | PXT000146            | Invalid Datetime                                   | Invalid datetime for message delivery.                                                                                  | Data e Hora do envio da mensagem inválida.                                                                             |
| 400         | PXT000147            | Generic Error                                      | Error while processing payment (generic error).                                                                         | Erro no processamento do pagamento (erro genérico).                                                                    |
| 400         | PXT000148            | Bad Format Operation Identifier                    | Badly formatted operation's identifier.                                                                                 | Identificador da operação mal formatado.                                                                               |
| 400         | PXT000149            | Invalid Payer ISPB                                 | Invalid or non-existent payer's PSP ISPB number.                                                                        | Número ISPB do PSP do Pagador é inválido ou inexistente.                                                               |
| 400         | PXT000150            | Invalid Beneficiary ISPB                           | Invalid or non-existent beneficiary's PSP ISPB number.                                                                  | Número ISPB do banco recebedor é inválido ou inexistente.                                                              |
| 400         | PXT000151            | Incorrect Type                                     | Incorrect type for target account.                                                                                      | Tipo incorreto para a conta transacional especificada.                                                                 |
| 400         | PXT000152            | Repeated End-to-End ID Error                       | The end_to_end_id was already used                                                                                      | O end_to_end_id já foi utilizado                                                                                       |
| 400         | PXT000153            | Invalid Target Account Type                        | The target account type cannot receive PIX transactions                                                                 | O tipo de conta destino não pode receber transações PIX                                                                |
| 400         | PXT000154            | Invalid ISPB                                       | Invalid or non-existent ISPB number.                                                                                    | Número ISPB é inválido ou inexistente.                                                                                 |
| 400         | PXT000155            | Amount too Great                                   | Amount too great for credited account.                                                                                  | Valor de pagamento/devolução acima do permitido para a conta de destino creditada.                                     |
| 400         | PXT000156            | QR Code Rejected                                   | QR Code rejected by beneficiary's PSP.                                                                                  | QR Code rejeitado pelo PSP do usuário recebedor.                                                                       |
| 503         | PXT000157            | Bacen Service Unavailable Error                    | Could not send the message to ICOM after 3 retries                                                                      | Não pode enviar a mensagem para a ICOM depois de 3 tentativas                                                          |
| 400         | PXT000158            | Invalid Amount                                     | Paid amount diverges from expected amount of \{expected_amount\}                                                        | O valor do pagamento diverge do valor esperado de \{expected_amount\}                                                  |
| 400         | PXT000159            | QR code inactive                                   | QR code is not active at the time of payment                                                                            | QR code não está ativo no instante do pagamento                                                                        |

---

# Manual Transaction

URL: /en/documentation/pix_indireto/movimentacoes/transacao/transacao_pix_manual_sync

## Request Manual

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY /pix_transfer
METHOD POST

Request Body

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_type": "manual",
  "target_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "12345678",
    "owner_document_number": "32402502000135",
    "owner_name": "Qi Tech",
    "account_type": "checking_account",
    "ispb": "32402502"
  },
  "transaction_amount": 500.65,
  "pix_message": "Ola Mundo"
}

```

### Body Params
| Field                  | Type      | Description                                                                                             | Characters |
|------------------------|-----------|---------------------------------------------------------------------------------------------------------|------------|
| `request_control_key` * | string    | Unique identification key for the request used by the client in uuid v4 format                           | 36         |
| `pix_transfer_type` *  | enumerator| Type of the pix to be performed. For manual transfer, it should be **manual**                            | "manual"   |
| `target_account` *     | Object    | Destination account - Should only be sent for "manual" type transactions                                 | **[Object target_account](#object-target_account)** |
| `transaction_amount` * | number    | Transfer amount                                                                                          | 10         |
| `pix_message`          | string    | Message to be sent along with the Pix transfer                                                           | 140        |
:::warning Warning
An `end_to_end_id` can only be used for a single transfer, regardless of whether it was successful or not.
:::

### Object target_account
| Field                   | Type      | Description                                                                                                             | Characters |
|-------------------------|-----------|-------------------------------------------------------------------------------------------------------------------------|------------|
| `account_branch` *      | string    | Account branch                                                                                                           | 6          |
| `account_digit` *       | string    | Account digit                                                                                                            | 1          |
| `account_number` *      | string    | Account number                                                                                                           | 20         |
| `owner_document_number` * | string | CPF or CNPJ (numbers only) of the account holder                                                                         | 14         |
| `owner_name` *          | string    | Account holder's name                                                                                                    | 150        |
| `account_type` *        | enumerator| Account type                                                                                                             | **[Enumerator account_type](#enumerator-account_type)** |
| `ispb` *                | string    | Eight-digit code that identifies banks in the Central Bank's reserve transfer system                                     | 8          |

### Enumerator account_type
| Enumerator             | Description               |
|------------------------|---------------------------|
| **checking_account**   | Checking Account          |
| **salary_account**     | Salary Account            |
| **saving_account**     | Savings Account           |
| **payment_account**    | Payment Account           |

## Response

STATUS 201

Response Body: Transfer sent

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "alias_key": "68908c98-59cb-4fbf-9321-5d223ec78376",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "pix_transfer_status": "sent",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

STATUS 202

:::info Information
If a `pix_transfer_status` is returned in the **pending** state, the Pix request should not be retried.
This transfer will be reprocessed. It is necessary to check the transfer status through the pix transfer query.
:::

Response Body: Transfer pending

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "alias_key": "68908c98-59cb-4fbf-9321-5d223ec78376",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "pix_transfer_status": "pending",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

STATUS 4XX

Response Body: Transfer rejected

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {
    "pix_transfer_data": {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "alias_key": "68908c98-59cb-4fbf-9321-5d223ec78376",
      "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "pix_transfer_status": "rejected",
      "created_at": "2021-10-22T20:30:23.459Z"
    }
  }
}
```

STATUS 4XX

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`Description`                                                                                       | Description (ptbr)<br/>`translation`                                                                                     |
|-------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400         | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Erro de Schema                                                                                                         |
| 406         | PXT000103            | request_control_key must be a valid uuid v4 string | request_control_key was not accepted for not being a valid uuid v4 string                                               | request_control_key não foi aceito por não ser uma palavra uuid v4 válida                                              |
| 400         | PXT000048            | Bad Request                                        | Emoji not allowed in pix message.                                                                                       | Emoji não é permitido na mensagem pix.                                                                                 |
| 400         | PXT000104            | Invalid Transaction Amount                         | Transaction amount of \{transaction_amount\} is not valid. It must be a positive value with at maximum 2 decimal places | O valor de transação \{transaction_amount\} não é válido. Deve ser um valor positivo com no máximo duas casas decimais |
| 404         | PXT000004            | Account not found                                  | Account not found for: \{account_datum\}                                                                                | Conta não encontrada para: \{account_datum\}                                                                           |
| 400         | PXT000003            | Account is Closed                                  | Account \{account_key\} is closed.                                                                                      | Conta \{account_key\} está fechada.                                                                                    |
| 422         | PXT000092            | Invalid Account Type                               | Pix is not yet implemented for non-checking or non-escrow account types                                                 | Transações Pix não estão implementadas para conta que não sejam escrow ou livres                                       |
| 403         | PIT000001            | User is not allowed to do this transaction         |                                                                                                                         | Usuário não tem autorização para fazer essa transação                                                                  |
| 400         | PXT000010            | Account is Blocked                                 | Account \{account_key\} is blocked.                                                                                     | Conta \{account_key\} está bloqueada.                                                                                  |
| 400         | PXT000003            | Account is Closed                                  | Account \{account_key\} is closed.                                                                                      | Conta \{account_key\} está fechada.                                                                                    |
| 400         | PIT000003            | Bad Request                                        | Insufficient account balance for transfer and fee amount.                                                               | Saldo de conta insuficiente para a transferência e a taxa.                                                             |
| 400         | PXT000118            | Requester is not Pix Participant                   | The requester sent an alias key but is not a indirect pix participant                                                   | O requisitante enviou uma alias key no entanto não é um participante do pix indireto                                   |
| 404         | PXT000120            | Alias sent not found                               | Alias key attached to this account not found                                                                            | Alias key vinculada à conta não encontrada                                                                             |
| 406         | PXT000105            | Invalid end_to_end_id                              | The end_to_end_id sent \{end_to_end_id\} is not valid.                                                                  | O end_to_end_id enviado \{end_to_end_id\} não é válido.                                                                |
| 400         | PXT000108            | Bad Request                                        | Billing account closed or blocked                                                                                       | Conta de cobrança encerrada ou bloqueada                                                                               |
| 400         | PXT000079            | Bad Request                                        | Insufficient billing account balance for fee.                                                                           | Saldo de conta de cobrança insuficiente para a taxa.                                                                   |
| 400         | PIT000004            | Bad Request                                        | Transaction amount is over limit.                                                                                       | O total da transferência é superior ao limite.                                                                         |
| 404         | PIX000056            | Not Found                                          | Pix key inquiry not found                                                                                               | Consulta de chave pix não encontrada                                                                                   |
| 404         | PXT000041            | Not Found                                          | Qr Code not found                                                                                                       | Qr Code não encontrado                                                                                                 |
| 400         | PXT000053            | Bad Request                                        | QrCode already paid                                                                                                     | Qr Code já Pago                                                                                                        |
| 400         | PXT000118            | Requester is not Pix Participant                   | The requester sent an alias key but is not a indirect pix participant                                                   | O requisitante enviou uma alias key no entanto não é um participante do pix indireto                                   |
| 404         | PXT000120            | Alias sent not found                               | Alias key attached to this account not found                                                                            | Alias key vinculada à conta não encontrada                                                                             |
| 400         | PXT000115            | Bad Request                                        | Insufficient account balance for transfer and fee amount.                                                               | Saldo de conta insuficiente para a transferência e a taxa                                                              |
| 400         | PXT000128            | Bad Request                                        | Pix key \{pix_key\} sent does match inquiry pix key. Verify if end_to_end_id sent is correct                            | Chave Pix \{pix_key\} enviada não condiz com consulta. Verifique se end_to_end_id enviado está correto                 |
| 400         | PXT000109            | Bad Request                                        | request_control_key \{request_control_key\} already in use                                                              | request_control_key \{request_control_key\} já utilizada                                                               |
| 400         | PXT000061            | Bad Request                                        | End to end id invalid. A pix transfer with the end to end id \{end_to_end\} has already been registered!                | End to end id inválido. Uma transação pix com o identificador único \{end_to_end\} já foi registrada!                  |
| 400         | PXT000129            | SPI Error message                                  | Message rejected by SPI-ICOM                                                                                            | Mensagem rejeitada pela SPI-ICOM                                                                                       |
| 408         | PXT000130            | SPI Timeout Control                                | SPI Timeout Control                                                                                                     | Controle de timeout no SPI                                                                                             |
| 400         | PXT000131            | Receiver Internal Error                            | Cancelled transaction due to receiver's internal error                                                                  | Transação interrompida devido a erro no PSP do Recebedor                                                               |
| 400         | PXT000132            | Invalid Target Account Number                      | Target account number is invalid                                                                                        | Número da conta de destino é inexistente ou inválido                                                                   |
| 400         | PXT000133            | Blocked Target Account                             | Target account is blocked.                                                                                              | A conta de destino encontra-se bloqueada.                                                                              |
| 400         | PXT000134            | Closed Target Account                              | Target account is closed.                                                                                               | A conta de destino encontra-se encerrada.                                                                              |
| 400         | PXT000135            | Unsupported Transaction                            | Unsupported transaction for given target account.                                                                       | A conta de destino não suporta este tipo de transação.                                                                 |
| 400         | PXT000136            | Invalid Participant                                | SPI participant is not PSP settler agent of payer nor receiver.                                                         | Participante direto do SPI não é liquidante do PSP do Pagador / Recebedor.                                             |
| 400         | PXT000137            | Zero Value Payment Order                           | Zero value payment order.                                                                                               | Ordem de pagamento com valor zero.                                                                                     |
| 400         | PXT000138            | Insufficient Funds                                 | Insufficient funds in PI account from payer.                                                                            | Saldo insuficiente na conta PI do pagador.                                                                             |
| 400         | PXT000139            | Return Value Too Great                             | Return value greater than corresponding payment order.                                                                  | Valor de devolução acima do valor de pagamento correspondente.                                                         |
| 400         | PXT000140            | Invalid Transactions Number                        | Invalid transactions number.                                                                                            | Quantidade de transações inválida.                                                                                     |
| 400         | PXT000141            | Unrelated Beneficiary Document Number              | Beneficiary document number is not that of target account owner.                                                        | CPF/CNPJ do usuário recebedor não é compatível com o titular da conta de destino.                                      |
| 400         | PXT000142            | Invalid Beneficiary Document Number                | Invalid beneficiary document number                                                                                     | CPF/CNPJ da conta de destino está incorreto.                                                                           |
| 400         | PXT000143            | Incorrect Message Element                          | Incorrect message element.                                                                                              | Elemento da mensagem incorreto.                                                                                        |
| 403         | PXT000144            | Rejected Payment Order                             | Beneficiary's PSP has rejected payment order.                                                                           | Ordem de pagamento foi rejeitada pelo banco recebedor.                                                                 |
| 403         | PXT000145            | Unauthorized Payer                                 | Signing participant is unauthorized to make a payment order for paying account.                                         | Participante que assinou a mensagem não é autorizado a realizar a operação na conta PI debitada.                       |
| 400         | PXT000146            | Invalid Datetime                                   | Invalid datetime for message delivery.                                                                                  | Data e Hora do envio da mensagem inválida.                                                                             |
| 400         | PXT000147            | Generic Error                                      | Error while processing payment (generic error).                                                                         | Erro no processamento do pagamento (erro genérico).                                                                    |
| 400         | PXT000148            | Bad Format Operation Identifier                    | Badly formatted operation's identifier.                                                                                 | Identificador da operação mal formatado.                                                                               |
| 400         | PXT000149            | Invalid Payer ISPB                                 | Invalid or non-existent payer's PSP ISPB number.                                                                        | Número ISPB do PSP do Pagador é inválido ou inexistente.                                                               |
| 400         | PXT000150            | Invalid Beneficiary ISPB                           | Invalid or non-existent beneficiary's PSP ISPB number.                                                                  | Número ISPB do banco recebedor é inválido ou inexistente.                                                              |
| 400         | PXT000151            | Incorrect Type                                     | Incorrect type for target account.                                                                                      | Tipo incorreto para a conta transacional especificada.                                                                 |
| 400         | PXT000152            | Repeated End-to-End ID Error                       | The end_to_end_id was already used                                                                                      | O end_to_end_id já foi utilizado                                                                                       |
| 400         | PXT000153            | Invalid Target Account Type                        | The target account type cannot receive PIX transactions                                                                 | O tipo de conta destino não pode receber transações PIX                                                                |
| 400         | PXT000154            | Invalid ISPB                                       | Invalid or non-existent ISPB number.                                                                                    | Número ISPB é inválido ou inexistente.                                                                                 |
| 400         | PXT000155            | Amount too Great                                   | Amount too great for credited account.                                                                                  | Valor de pagamento/devolução acima do permitido para a conta de destino creditada.                                     |
| 400         | PXT000156            | QR Code Rejected                                   | QR Code rejected by beneficiary's PSP.                                                                                  | QR Code rejeitado pelo PSP do usuário recebedor.                                                                       |
| 503         | PXT000157            | Bacen Service Unavailable Error                    | Could not send the message to ICOM after 3 retries                                                                      | Não pode enviar a mensagem para a ICOM depois de 3 tentativas                                                          |
| 400         | PXT000158            | Invalid Amount                                     | Paid amount diverges from expected amount of \{expected_amount\}                                                        | O valor do pagamento diverge do valor esperado de \{expected_amount\}                                                  |
| 400         | PXT000159            | QR code inactive                                   | QR code is not active at the time of payment                                                                            | QR code não está ativo no instante do pagamento                                                                        |

---

# Transaction by QR Code

URL: /en/documentation/pix_indireto/movimentacoes/transacao/transacao_pix_qr_code_sync

## Manual Request

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY /pix_transfer
METHOD POST

Request Body

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_type": "static_qr_code",
  "transaction_amount": 500.65,
  "end_to_end_id": "E73856642202309201429bZKfklNlbwu",
  "receiver_conciliation_id": "REC00000000000000000000009459463343",
  "target_pix_key": "target_pix_key@email.com",
  "pix_message": "Ola Mundo"
}

```

### Body Params
| Field                  | Type      | Description                                                                                             | Characters |
|------------------------|-----------|---------------------------------------------------------------------------------------------------------|------------|
| `request_control_key` * | string    | Unique identification key for the request used by the client in uuid v4 format                           | 36         |
| `pix_transfer_type` *  | enumerator| Type of the pix to be performed. For QR code transfer, it should be **static_qr_code** or **dynamic_qr_code**   | "static_qr_code" or "dynamic_qr_code" |
| `target_pix_key` *     | string    | Pix key of the account to which the transaction will be sent                                             | 100        |
| `receiver_conciliation_id` | string | Reconciliation ID of the receiver                                                                        | 35         |
| `transaction_amount` * | number    | Transfer amount                                                                                          | 10         |
| `end_to_end_id` *      | string    | Idempotency key of a Pix transaction - should only be sent if the transfer type is "key"                 | 32         |
| `pix_message`          | string    | Message to be sent along with the Pix transfer                                                           | 140        |
:::info Warning
An `end_to_end_id` must be sent referring to the [QR code decoding](/documentation/pix/decodificar_qr_code).
:::
:::danger Warning
The `end_to_end_id` from the query must be made in the name of the alias that will request the transaction!
:::
:::danger Warning
An `end_to_end_id` can only be used for a single transfer, regardless of whether it was successful or not.
:::

## Response

STATUS 201

Response Body: Transfer sent

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "alias_key": "68908c98-59cb-4fbf-9321-5d223ec78376",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "pix_transfer_status": "sent",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

STATUS 202

:::info Information
If a `pix_transfer_status` is returned in the **pending** state, the Pix request should not be retried.
This transfer will be reprocessed. It is necessary to check the transfer status through the pix transfer query.
:::

Response Body: Transfer pending

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "alias_key": "68908c98-59cb-4fbf-9321-5d223ec78376",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "pix_transfer_status": "pending",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

STATUS 4XX

Response Body: Transfer rejected

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {
    "pix_transfer_data": {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "alias_key": "68908c98-59cb-4fbf-9321-5d223ec78376",
      "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "pix_transfer_status": "rejected",
      "created_at": "2021-10-22T20:30:23.459Z"
    }
  }
}
```

STATUS 4XX

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`                                 | Description (eng)<br/>`Description`                                                                                       | Description (ptbr)<br/>`translation`                                                                                     |
|-------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400         | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Erro de Schema                                                                                                         |
| 406         | PXT000103            | request_control_key must be a valid uuid v4 string | request_control_key was not accepted for not being a valid uuid v4 string                                               | request_control_key não foi aceito por não ser uma palavra uuid v4 válida                                              |
| 400         | PXT000048            | Bad Request                                        | Emoji not allowed in pix message.                                                                                       | Emoji não é permitido na mensagem pix.                                                                                 |
| 400         | PXT000104            | Invalid Transaction Amount                         | Transaction amount of \{transaction_amount\} is not valid. It must be a positive value with at maximum 2 decimal places | O valor de transação \{transaction_amount\} não é válido. Deve ser um valor positivo com no máximo duas casas decimais |
| 404         | PXT000004            | Account not found                                  | Account not found for: \{account_datum\}                                                                                | Conta não encontrada para: \{account_datum\}                                                                           |
| 400         | PXT000003            | Account is Closed                                  | Account \{account_key\} is closed.                                                                                      | Conta \{account_key\} está fechada.                                                                                    |
| 422         | PXT000092            | Invalid Account Type                               | Pix is not yet implemented for non-checking or non-escrow account types                                                 | Transações Pix não estão implementadas para conta que não sejam escrow ou livres                                       |
| 403         | PIT000001            | User is not allowed to do this transaction         |                                                                                                                         | Usuário não tem autorização para fazer essa transação                                                                  |
| 400         | PXT000010            | Account is Blocked                                 | Account \{account_key\} is blocked.                                                                                     | Conta \{account_key\} está bloqueada.                                                                                  |
| 400         | PXT000003            | Account is Closed                                  | Account \{account_key\} is closed.                                                                                      | Conta \{account_key\} está fechada.                                                                                    |
| 400         | PIT000003            | Bad Request                                        | Insufficient account balance for transfer and fee amount.                                                               | Saldo de conta insuficiente para a transferência e a taxa.                                                             |
| 400         | PXT000118            | Requester is not Pix Participant                   | The requester sent an alias key but is not a indirect pix participant                                                   | O requisitante enviou uma alias key no entanto não é um participante do pix indireto                                   |
| 404         | PXT000120            | Alias sent not found                               | Alias key attached to this account not found                                                                            | Alias key vinculada à conta não encontrada                                                                             |
| 406         | PXT000105            | Invalid end_to_end_id                              | The end_to_end_id sent \{end_to_end_id\} is not valid.                                                                  | O end_to_end_id enviado \{end_to_end_id\} não é válido.                                                                |
| 400         | PXT000108            | Bad Request                                        | Billing account closed or blocked                                                                                       | Conta de cobrança encerrada ou bloqueada                                                                               |
| 400         | PXT000079            | Bad Request                                        | Insufficient billing account balance for fee.                                                                           | Saldo de conta de cobrança insuficiente para a taxa.                                                                   |
| 400         | PIT000004            | Bad Request                                        | Transaction amount is over limit.                                                                                       | O total da transferência é superior ao limite.                                                                         |
| 404         | PIX000056            | Not Found                                          | Pix key inquiry not found                                                                                               | Consulta de chave pix não encontrada                                                                                   |
| 404         | PXT000041            | Not Found                                          | Qr Code not found                                                                                                       | Qr Code não encontrado                                                                                                 |
| 400         | PXT000053            | Bad Request                                        | QrCode already paid                                                                                                     | Qr Code já Pago                                                                                                        |
| 400         | PXT000118            | Requester is not Pix Participant                   | The requester sent an alias key but is not a indirect pix participant                                                   | O requisitante enviou uma alias key no entanto não é um participante do pix indireto                                   |
| 404         | PXT000120            | Alias sent not found                               | Alias key attached to this account not found                                                                            | Alias key vinculada à conta não encontrada                                                                             |
| 400         | PXT000115            | Bad Request                                        | Insufficient account balance for transfer and fee amount.                                                               | Saldo de conta insuficiente para a transferência e a taxa                                                              |
| 400         | PXT000128            | Bad Request                                        | Pix key \{pix_key\} sent does match inquiry pix key. Verify if end_to_end_id sent is correct                            | Chave Pix \{pix_key\} enviada não condiz com consulta. Verifique se end_to_end_id enviado está correto                 |
| 400         | PXT000109            | Bad Request                                        | request_control_key \{request_control_key\} already in use                                                              | request_control_key \{request_control_key\} já utilizada                                                               |
| 400         | PXT000061            | Bad Request                                        | End to end id invalid. A pix transfer with the end to end id \{end_to_end\} has already been registered!                | End to end id inválido. Uma transação pix com o identificador único \{end_to_end\} já foi registrada!                  |
| 400         | PXT000129            | SPI Error message                                  | Message rejected by SPI-ICOM                                                                                            | Mensagem rejeitada pela SPI-ICOM                                                                                       |
| 408         | PXT000130            | SPI Timeout Control                                | SPI Timeout Control                                                                                                     | Controle de timeout no SPI                                                                                             |
| 400         | PXT000131            | Receiver Internal Error                            | Cancelled transaction due to receiver's internal error                                                                  | Transação interrompida devido a erro no PSP do Recebedor                                                               |
| 400         | PXT000132            | Invalid Target Account Number                      | Target account number is invalid                                                                                        | Número da conta de destino é inexistente ou inválido                                                                   |
| 400         | PXT000133            | Blocked Target Account                             | Target account is blocked.                                                                                              | A conta de destino encontra-se bloqueada.                                                                              |
| 400         | PXT000134            | Closed Target Account                              | Target account is closed.                                                                                               | A conta de destino encontra-se encerrada.                                                                              |
| 400         | PXT000135            | Unsupported Transaction                            | Unsupported transaction for given target account.                                                                       | A conta de destino não suporta este tipo de transação.                                                                 |
| 400         | PXT000136            | Invalid Participant                                | SPI participant is not PSP settler agent of payer nor receiver.                                                         | Participante direto do SPI não é liquidante do PSP do Pagador / Recebedor.                                             |
| 400         | PXT000137            | Zero Value Payment Order                           | Zero value payment order.                                                                                               | Ordem de pagamento com valor zero.                                                                                     |
| 400         | PXT000138            | Insufficient Funds                                 | Insufficient funds in PI account from payer.                                                                            | Saldo insuficiente na conta PI do pagador.                                                                             |
| 400         | PXT000139            | Return Value Too Great                             | Return value greater than corresponding payment order.                                                                  | Valor de devolução acima do valor de pagamento correspondente.                                                         |
| 400         | PXT000140            | Invalid Transactions Number                        | Invalid transactions number.                                                                                            | Quantidade de transações inválida.                                                                                     |
| 400         | PXT000141            | Unrelated Beneficiary Document Number              | Beneficiary document number is not that of target account owner.                                                        | CPF/CNPJ do usuário recebedor não é compatível com o titular da conta de destino.                                      |
| 400         | PXT000142            | Invalid Beneficiary Document Number                | Invalid beneficiary document number                                                                                     | CPF/CNPJ da conta de destino está incorreto.                                                                           |
| 400         | PXT000143            | Incorrect Message Element                          | Incorrect message element.                                                                                              | Elemento da mensagem incorreto.                                                                                        |
| 403         | PXT000144            | Rejected Payment Order                             | Beneficiary's PSP has rejected payment order.                                                                           | Ordem de pagamento foi rejeitada pelo banco recebedor.                                                                 |
| 403         | PXT000145            | Unauthorized Payer                                 | Signing participant is unauthorized to make a payment order for paying account.                                         | Participante que assinou a mensagem não é autorizado a realizar a operação na conta PI debitada.                       |
| 400         | PXT000146            | Invalid Datetime                                   | Invalid datetime for message delivery.                                                                                  | Data e Hora do envio da mensagem inválida.                                                                             |
| 400         | PXT000147            | Generic Error                                      | Error while processing payment (generic error).                                                                         | Erro no processamento do pagamento (erro genérico).                                                                    |
| 400         | PXT000148            | Bad Format Operation Identifier                    | Badly formatted operation's identifier.                                                                                 | Identificador da operação mal formatado.                                                                               |
| 400         | PXT000149            | Invalid Payer ISPB                                 | Invalid or non-existent payer's PSP ISPB number.                                                                        | Número ISPB do PSP do Pagador é inválido ou inexistente.                                                               |
| 400         | PXT000150            | Invalid Beneficiary ISPB                           | Invalid or non-existent beneficiary's PSP ISPB number.                                                                  | Número ISPB do banco recebedor é inválido ou inexistente.                                                              |
| 400         | PXT000151            | Incorrect Type                                     | Incorrect type for target account.                                                                                      | Tipo incorreto para a conta transacional especificada.                                                                 |
| 400         | PXT000152            | Repeated End-to-End ID Error                       | The end_to_end_id was already used                                                                                      | O end_to_end_id já foi utilizado                                                                                       |
| 400         | PXT000153            | Invalid Target Account Type                        | The target account type cannot receive PIX transactions                                                                 | O tipo de conta destino não pode receber transações PIX                                                                |
| 400         | PXT000154            | Invalid ISPB                                       | Invalid or non-existent ISPB number.                                                                                    | Número ISPB é inválido ou inexistente.                                                                                 |
| 400         | PXT000155            | Amount too Great                                   | Amount too great for credited account.                                                                                  | Valor de pagamento/devolução acima do permitido para a conta de destino creditada.                                     |
| 400         | PXT000156            | QR Code Rejected                                   | QR Code rejected by beneficiary's PSP.                                                                                  | QR Code rejeitado pelo PSP do usuário recebedor.                                                                       |
| 503         | PXT000157            | Bacen Service Unavailable Error                    | Could not send the message to ICOM after 3 retries                                                                      | Não pode enviar a mensagem para a ICOM depois de 3 tentativas                                                          |
| 400         | PXT000158            | Invalid Amount                                     | Paid amount diverges from expected amount of \{expected_amount\}                                                        | O valor do pagamento diverge do valor esperado de \{expected_amount\}                                                  |
| 400         | PXT000159            | QR code inactive                                   | QR code is not active at the time of payment                                                                            | QR code não está ativo no instante do pagamento                                                                        |

---

# Webhook for Pix Refunds

URL: /en/documentation/pix_indireto/movimentacoes/webhook/webhook_devolucao_outgoing_pix

Webhook to notify about Pix refunds received for an Alias.

## Webhook Request Body

**Request Body: Pix received**

```json
{
  "webhook_type": "baas.pix_transfer.incoming_pix",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
    "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "end_to_end_id": "E18236120202308111235s14fddf2801",
    "pix_transfer_status": "received",
    "account_key": "7c5a1425-73eb-420e-b4fb-0ce3386c7d0c",
    "alias_key": "fc6862c4-2b20-4057-8063-b8809866e494",
    "receiver_conciliation_id": "745c28c780bc4822bbade86dd875d10b",
    "transfer_amount": 126.97,
    "fee_amount": 0.0,
    "source_account": {
      "account_branch": "0001",
      "account_digit": "3",
      "account_number": "12345678",
      "owner_document_number": "***02502000***",
      "owner_person_type": "legal",
      "owner_name": "Qi Tech",
      "account_type": "checking_account",
      "ispb": "32402502"
    },
    "pix_transfer_type": "reversal",
    "pix_message": "pix message received",
    "created_at": "2021-10-22T20:30:23.459Z",
    "reversals": [],
    "original_outgoing_pix_transfer": "b56862c4-2b20-4057-8063-b8809866e494"
  }
}
```

### Webhook Body Param
| Field                         | Type      | Description                                                                                             | Max. Characters |
|-------------------------------|-----------|---------------------------------------------------------------------------------------------------------|-----------------|
| `webhook_type`                | string    | An enumerator that defines the type of event being reported                                             | 23              |
| `webhook_datetime`            | string    | Date and time the webhook was sent                                                                      | 20              |
| `pix_transfer_type`           | enumerator| Type of the pix transaction performed                                                                   | **[Enumerator pix_transfer_type](#enumerator-pix_transfer_type)** |
| `target_pix_key`              | string    | Pix key of the account to which the transaction was sent                                                | 100             |
| `source_account`              | Object    | Source account - Should only be sent for "manual" type transactions                                     | **[Object source_account](#object-source_account)** |
| `transfer_amount`             | number    | Transfer amount                                                                                          | 10              |
| `receiver_conciliation_id`    | string    | Reconciliation ID of the receiver                                                                        | 35              |
| `end_to_end_id`               | string    | Idempotency key of a Pix transaction - should only be sent if the transfer type is "key"                | 32              |
| `pix_message`                 | string    | Message to be sent along with the Pix transfer                                                           | 140             |
| `fee_amount`                  | number    | Transfer amount                                                                                          | 10              |
| `pix_transfer_status`         | string    | Status of the pix transaction                                                                            | 10              |
| `account_key`                 | string    | Unique identification key for the QI account                                                            | 36              |
| `alias_key`                   | string    | Unique alias key                                                                                        | 36              |
| `pix_transfer_key`            | string    | Unique identification key for the Pix transfer                                                          | 36              |
| `original_outgoing_pix_transfer` | string | Unique identification key for the original outgoing Pix transfer                                        | 36              |

### Enumerator pix_transfer_type
| Enumerator           | Description                                 |
|----------------------|---------------------------------------------|
| **manual**           | Pix using destination account details       |
| **key**              | Pix using a PIX key                         |
| **static_qr_code**   | Pix using a static QR code                  |
| **dynamic_qr_code**  | Pix using a dynamic QR code                 |
| **reversal**         | Pix refund                                  |

### Object source_account
| Field                     | Type      | Description                                          | Characters |
|---------------------------|-----------|------------------------------------------------------|------------|
| `account_branch`          | string    | Account branch                                       | 6          |
| `account_digit`           | string    | Account digit                                        | 1          |
| `account_number`          | string    | Account number                                       | 20         |
| `owner_document_number`   | string    | CPF or CNPJ (numbers only) of the account holder     | 14         |
| `owner_name`              | string    | Account holder's name                                | 150        |
| `account_type`            | enumerator| Account type                                         | **[Enumerator account_type](#enumerator-account_type)** |
| `ispb`                    | string    | Eight-digit code that identifies banks in the Central Bank's reserve transfer system       | 8          |

### Enumerator account_type
| Enumerator             | Description         |
|------------------------|---------------------|
| **checking_account**   | Checking Account    |
| **salary_account**     | Salary Account      |
| **saving_account**     | Savings Account     |
| **payment_account**    | Payment Account     |

---

# Webhook for Incoming Pix

URL: /en/documentation/pix_indireto/movimentacoes/webhook/webhook_incoming_pix

Webhook to notify about Pix transactions received for an Alias.

## Webhook Request Body

**Request Body: Pix Received**

```json
{
  "webhook_type": "baas.pix_transfer.incoming_pix",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
    "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "end_to_end_id": "E18236120202308111235s14fddf2801",
    "pix_transfer_status": "received",
    "account_key": "7c5a1425-73eb-420e-b4fb-0ce3386c7d0c",
    "alias_key": "fc6862c4-2b20-4057-8063-b8809866e494",
    "receiver_conciliation_id": "745c28c780bc4822bbade86dd875d10b",
    "transfer_amount": 126.97,
    "fee_amount": 0.0,
    "source_account": {
      "account_branch": "0001",
      "account_digit": "3",
      "account_number": "12345678",
      "owner_document_number": "***02502000***",
      "owner_person_type": "legal",
      "owner_name": "Qi Tech",
      "account_type": "checking_account",
      "ispb": "32402502"
    },
    "pix_transfer_type": "dynamic_qr_code",
    "pix_message": "pix message received",
    "created_at": "2021-10-22T20:30:23.459Z",
    "reversals": []
  }
}
```

### Webhook Body Param
| Field                 | Type           | Description                                                                                             | Max. Characters |
|-----------------------|----------------|---------------------------------------------------------------------------------------------------------|-----------------|
| `webhook_type`        | string         | An enumerator that defines the type of event being reported                                             | 23              |
| `webhook_datetime`    | string         | Date and time the webhook was sent                                                                      | 20              |
| `pix_transfer_type`   | enumerator     | Type of the pix transaction performed                                                                   | **[Enumerator pix_transfer_type](#enumerator-pix_transfer_type)** |
| `target_pix_key`      | string         | Pix key of the account to which the transaction was sent                                                | 100             |
| `source_account`      | Object         | Source account - Should only be sent for "manual" type transactions                                     | **[Object source_account](#object-source_account)** |
| `transfer_amount`     | number         | Transfer amount                                                                                          | 10              |
| `receiver_conciliation_id` | string   | Reconciliation ID of the receiver                                                                        | 35              |
| `end_to_end_id`       | string         | Idempotency key of a Pix transaction - should only be sent if the transfer type is "key"                | 32              |
| `pix_message`         | string         | Message to be sent along with the Pix transfer                                                           | 140             |
| `fee_amount`          | number         | Transfer amount                                                                                          | 10              |
| `pix_transfer_status` | string         | Status of the pix transaction                                                                            | 10              |
| `account_key`         | string         | Unique identification key for the QI account                                                            | 36              |
| `alias_key`           | string         | Unique alias key                                                                                        | 36              |
| `pix_transfer_key`    | string         | Unique identification key for the Pix transfer                                                          | 36              |

### Enumerator pix_transfer_type
| Enumerator           | Description                                 |
|----------------------|---------------------------------------------|
| **manual**           | Pix using destination account details       |
| **key**              | Pix using a PIX key                         |
| **static_qr_code**   | Pix using a static QR code                  |
| **dynamic_qr_code**  | Pix using a dynamic QR code                 |
| **reversal**         | Pix refund                                  |

### Object source_account
| Field                     | Type      | Description                                          | Characters |
|---------------------------|-----------|------------------------------------------------------|------------|
| `account_branch` *        | string    | Account branch                                       | 6          |
| `account_digit` *         | string    | Account digit                                        | 1          |
| `account_number` *        | string    | Account number                                       | 20         |
| `owner_document_number` * | string    | CPF or CNPJ (numbers only) of the account holder     | 14         |
| `owner_name`              | string    | Account holder's name                                | 150        |
| `account_type` *          | enumerator| Account type                                         | **[Enumerator account_type](#enumerator-account_type)** |
| `ispb` *                  | string    | Eight-digit code that identifies banks in the Central Bank's reserve transfer system       | 8          |

### Enumerator account_type
| Enumerator             | Description               |
|------------------------|---------------------------|
| **checking_account**   | Checking Account          |
| **salary_account**     | Salary Account            |
| **saving_account**     | Savings Account           |
| **payment_account**    | Payment Account           |

---

# Webhook for Pending Transactions

URL: /en/documentation/pix_indireto/movimentacoes/webhook/webhook_transacao

Webhook to notify about the completion of transactions that were originally responded to as pending (returned with http status 202).

## Webhook Request Body
**Request Body: Transaction sent**

```json
{
  "webhook_type": "baas.pix_transfer.outgoing_pix",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
    "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
    "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "pix_transfer_status": "sent",
    "created_at": "2021-10-22T20:30:23.459Z"
  }
}
```

**Request Body: Transaction rejected**

```json
{
  "webhook_type": "baas.pix_transfer.outgoing_pix",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
    "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
    "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "pix_transfer_status": "rejected",
    "created_at": "2021-10-22T20:30:23.459Z",
    "error_code": "PXT000132",
    "error_description": "Target account number is invalid.",
    "error_translation": "Número da conta de destino é inexistente ou inválido.",
    "error_short_description": null
  }
}
```

### Webhook Body Param

| Field                 | Type   | Description                                                 | Max. Characters |
|-----------------------|--------|-------------------------------------------------------------|-----------------|
| `webhook_type`        | string | An enumerator that defines the type of event being reported | 23              |
| `webhook_datetime`    | string | Date and time the webhook was sent                          | 20              |
| `request_control_key` | string | UUID4 for querying about the made request                   | 36              |
| `pix_transfer_key`    | string | Identification key of the Pix transfer in the QI system     | 36              |
| `pix_transfer_status` | string | Transaction status                                          | 200             |
| `created_at`          | string | Date and time of the transaction's creation                 | 20              |

---

# Cancel a Portability Request

URL: /en/documentation/pix_indireto/portabilidade/cancelar_pedido_de_portabilidade

:::info
Portability Request cancellations can be made under the following conditions:
Status must be `waiting resolution`.
If the cancellation reason is `default`, the deadline defined by the `max_resolution_date` field must have passed.
:::
The table below defines, depending on the reason, who can cancel a portability.
| Reason           | Donor | Claimer |
|------------------|-------|---------|
| `client_request` | ✓     | ✓       |
| `account_closure`| ✓     |         |
| `default`        |       | ✓       |
| `fraud`          | ✓     | ✓       |

## Request

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY /claim/ CLAIM_REQUEST_KEY
METHOD PATCH

**Request Body**

```json
{
    "request_control_key": "8a923886-afce-4116-ac1f-69bdffcf8da9",
    "claim_request_status": "cancelled",
    "cancellation_reason": "client_request",
}
```

| cancellation_reason | Description |
| ------------------- |---------------------------------------------------------------------------|
| `client_request`    | The claimer user requested the cancellation of the portability request       |
| `account_closure`   | The account was closed during the portability process                        |
| `default`           | The validation period for the claimer's key ownership expired                |
| `fraud`             | There was fraud in the opening of the portability request                    |

## Response

STATUS 200

**Response Body**

```json
{
	"request_control_key": "95968498-5ad0-465a-9174-969d0bd1e84a",
	"claim_request_status": "cancelled",
    "created_at": "2024-05-25T12:13:25"
}
```

| Value                 | Description                                             | type          |
|-----------------------|---------------------------------------------------------|---------------|
| `claim_request_status`| Status of the portability request.                      | string        |
| `created_at`          | Date of creation of the portability request.            | datetime string |
| `request_control_key` | Unique UUID4 identifier of the request.                 | uuid4 string  |

### claim_request_status
| Value               | Description                                                                         |
|---------------------|-------------------------------------------------------------------------------------|
| `waiting_resolution`| The notification was received by the counterparty                                   |
| `confirmed`         | The donor confirmed the claim. It is waiting for the claimer to complete the process.|
| `cancelled`         | The donor or claimer canceled the portability request                                |
| `completed`         | Both the DICT and the claimer updated their records with the new linkage             |

---

# Complete a Portability Request

URL: /en/documentation/pix_indireto/portabilidade/completar_pedido_de_portabilidade

:::info
Completes the claim operation. As a result, the link with the key is created.
:::

## Request

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY /claim/ CLAIM_REQUEST_KEY
METHOD PATCH

**Request Body**

```json
{
    "request_control_key": "8a923886-afce-4116-ac1f-69bdffcf8da9",
    "claim_request_status": "completed",
}
```

## Response

STATUS 200

**Response Body**

```json
{
	"request_control_key": "95968498-5ad0-465a-9174-969d0bd1e84a",
	"claim_request_status": "completed",
    "created_at": "2024-05-25T12:13:25"
}
```

| Value                 | Description                                             | type          |
|-----------------------|---------------------------------------------------------|---------------|
| `claim_request_status`| Status of the portability request.                      | string        |
| `created_at`          | Date of creation of the portability request.            | datetime string |
| `request_control_key` | Unique UUID4 identifier of the request.                 | uuid4 string  |

### claim_request_status
| Value               | Description                                                                         |
|---------------------|-------------------------------------------------------------------------------------|
| `waiting_resolution`| The notification was received by the counterparty                                   |
| `confirmed`         | The donor confirmed the claim. It is waiting for the claimer to complete the process.|
| `cancelled`         | The donor or claimer canceled the portability request                                |
| `completed`         | Both the DICT and the claimer updated their records with the new linkage             |

---

# Confirm a Portability Request

URL: /en/documentation/pix_indireto/portabilidade/confirmar_pedido_de_portabilidade

Confirms the claim operation. As a result, the key's link with the donor participant is removed.
Status must be `waiting_resolution`.
For possession claim, if the reason is `default`, the resolution deadline (`max_resolution_date`) must have passed. If the reason provided is `client_request`, the closure deadline (`max_conclusion_date`) will be brought forward to allow immediate closure by the claimer.
The tables below define, depending on the reason and type, who can confirm.

| Ownership            | Donor | Claimer      |
|----------------------|-------|--------------|
| `client_request`     | ✓     |              |
| `account_closure`    |       |              |
| `default`            | ✓     |              |

| Portability          | Donor | Claimer      |
|----------------------|-------|--------------|
| `client_request`     | ✓     |              |
| `account_closure`    | ✓     |              |
| `default`            |       |              |

## Request

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY /claim/ CLAIM_REQUEST_KEY
METHOD PATCH

**Request Body**

```json
{
    "request_control_key": "8a923886-afce-4116-ac1f-69bdffcf8da9",
    "claim_request_status": "confirmed",
    "confirmation_reason": "client_request",
}

```

## Response

STATUS 200

**Response Body**

```json
{
	"request_control_key": "95968498-5ad0-465a-9174-969d0bd1e84a",
	"claim_request_status": "confirmed",
    "created_at": "2024-05-25T12:13:25"
}
```

| Value                 | Description                                | type          |
|-----------------------|--------------------------------------------|---------------|
| `claim_request_status`| Status of the portability request.         | string        |
| `created_at`          | Date of creation of the portability request | datetime string |
| `request_control_key` | Unique UUID4 identifier of the request.    | uuid4 string  |

---

# Consult Portability Requests

URL: /en/documentation/pix_indireto/portabilidade/consultar_pedido_de_portabilidade

## Request

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY /claim_request/ CLAIM_REQUEST_KEY
METHOD GET

## Response

STATUS 200

**Response Body**

```json
{
  {
    "request_control_key": "be0884bc-44a4-4907-8627-ef976e477aef",
    "claim_request_status": "pending",
    "claim_request_direction": "incoming",
    "claim_request_key": "fe3ab7c5-e907-4a66-b9c5-7ea156429f83",
    "pix_key": "12345678000190",
    "claim_request_type": "ownership",
    "pix_key_type": "cnpj",
    "cancellation_reason": null,
    "cancelled_by": "donor",
    "confirmation_reason": null,
    "created_at": "2024-05-25T12:13:25",
    "max_resolution_date": "2023-11-13T17:29:00",
    "claim_request_events": [
      {
       "event_type": "waiting_resolution",
       "event_details": "Relato de Infração recebido e em análise",
       "created_at": "2023-03-03T12:04:06.179Z"
      },
     {
       "event_type": "cancelled",
       "event_details": "Relato de Infração cancelado",
       "created_at": "2023-03-03T12:04:06.179Z"
     },
    ],
  }
} 
```
| Value                   | Description                                                                                               | type   |
|-------------------------|-----------------------------------------------------------------------------------------------------------|--------|
| `cancellation_reason`   | Reason for cancellation. "client_request", "account_closure", "fraud", "default", "reconciliation"        | string |
| `cancelled_by`          | Agent who canceled the portability request. "donor", "claimer"                                            | string |
| `claim_request_direction` | Indicates whether the portability request was received or sent. "incoming" or "outgoing"                | string |
| `claim_request_key`     | Unique identification key of the claim.                                                                   | string |
| `claim_request_status`  | Status of the portability request.                                                                        | string |
| `claim_request_type`    | Type of portability request. "ownership" or "portability"                                                 | string |
| `confirmation_reason`   | Reason for confirmation. "client_request", "account_closure", "fraud", "default", "reconciliation"        | string |
| `created_at`            | Date of creation of the portability request.                                                              | datetime string |
| `max_conclusion_date`   | Deadline to close the portability request. Only for "ownership" type portabilities.                       | string |
| `max_resolution_date`   | Deadline for the resolution of the portability request.                                                   | string |
| `pix_key`               | PIX key of the portability request.                                                                       | string |
| `pix_key_type`          | Type of PIX key of the portability request.                                                               | string |
| `request_control_key`   | Unique UUID4 identifier of the request.                                                                   | uuid4 string |
| `claim_request_events`  | Group of events related to the portability request.                                                       | uuid4 string |

### claim_request_status
| Value                   | Description                                                                         |
|-------------------------|-------------------------------------------------------------------------------------|
| `waiting_resolution`    | The notification was received by the counterparty.                                  |
| `confirmed`             | The donor confirmed the claim. It is waiting for the claimer to complete the process.|
| `cancelled`             | The donor or claimer canceled the portability request.                               |
| `completed`             | Both the DICT and the claimer updated their records with the new linkage.            |

---

# Portability Request creation

URL: /en/documentation/pix_indireto/portabilidade/criar_pedido_de_portabilidade

## Request

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY /claim_request
METHOD POST

**Request Body**

```json
{
  "request_control_key": "4b61f25d-b8b5-49cb-a391-e4878091ac3f",
  "pix_key": "12345678000190",
  "claim_request_type": "ownership",
  "pix_key_type": "cnpj"
}
```

| Field                   | Type   | Description                                                             | Max. Characters |
|-------------------------|--------|-------------------------------------------------------------------------|-----------------|
| `request_control_key` * | string | UUID4 for querying about the made request.                              | 36              |
| `pix_key` *             | string | PIX key related to the portability request                              | 36              |
| `claim_request_type` *  | string | Type of portability. "ownership" for claim and "portability" for portability | 36              |
| `pix_key_type` *        | string | Definition of key type. Can be "cpf", "cnpj", "email", "phone_number".      | 10              |

## Response

STATUS 201 created

**Response Body**

```json
{
    "request_control_key": "8a923886-afce-4116-ac1f-69bdffcf8da9",
    "claim_request_status": "pending",
    "claim_request_key": "fe3ab7c5-e907-4a66-b9c5-7ea156429f83",
    "max_conclusion_date": "2024-05-26T12:13:25",
    "created_at": "2024-05-25T12:13:25"
}
```

---

# Introduction to Portability Requests

URL: /en/documentation/pix_indireto/portabilidade/introducao_portabilidade

PIX key claims and portability are special mechanisms provided by the central bank for potential changes in PIX key ownership.

- Claims are used in cases where there is a change in ownership of a key (**phone** or **email**), and the new owner wishes to create a link for their account, but the previous owner (former holder of the **phone** or **email**) already has a record in the DICT with this key.

- Portabilities are used when the key owner wishes to change its linkage to another account, which is domiciled in a different participant from the current one.
For each type of ownership change resource, there are only a few types of keys enabled, which are:

| Compatible | Claim       | Portability |
|------------|-------------|-------------|
| cpf        | ✓           |             |
| cnpj       | ✓           |             |
| phone_number | ✓         | ✓           |
| email      | ✓           | ✓           |
| random_key |             |             |

In the scope of indirect PIX, the ownership change mechanisms will work with the same premises, with special routes provided in the QI Tech infrastructure so that accounts enabled to use indirect PIX can make requests and receive responses from the flows presented above.

### 1. Claimant Flow
:::info
The flowcharts below represent the behaviors pertinent to the **claim flow** of PIX key
:::
##### 1.1. QI Tech Indirect Participant requests opening a portability request
```mermaid
flowchart LR
    PARTICIPANT(Indirect Participant\n QiTech);
    WAITING_RESOLUTION{{Portability \n'waiting_resolution'}};
    
    PARTICIPANT -. portability\n request.-> WAITING_RESOLUTION 
```
##### 1.2. Donor Bank confirms receipt of portability request
```mermaid
flowchart RL
    OTHER_BANK(Donor Bank);
    QI_PARTICIPANT(Indirect Participant\n QiTech);
    CONFIRMED{{Portability \n 'confirmed'}};
    
    OTHER_BANK-. Confirm portability\n request.->CONFIRMED -- Webhook Update --> QI_PARTICIPANT;
```
##### 1.3. QI Tech Indirect Participant completes the portability request and the PIX key link is created
```mermaid
flowchart LR
    BACEN(Banco Central \n do Brasil);
    QI_PARTICIPANT(Indirect Participant\n QiTech);
    COMPLETED{{Portability \n 'completed'}};
    
    QI_PARTICIPANT-. Completes portability\n request.->COMPLETED -- Pix key link \n creation--> BACEN;
```
##### 1.4. QI Tech Indirect Participant completes the portability request and the PIX key link is created
:::warning Important
Portability Requests with **confirmed** status can only be canceled if they are of type **"fraud"**
:::
```mermaid
flowchart LR
    BACEN(Banco Central \n do Brasil);
    QI_PARTICIPANT(Indirect Participant\n QiTech);
    PORTABILITY{{Portability \n 'waiting_resolution' ou 'confirmed'}};
    
    QI_PARTICIPANT-. Cancel portability \n request.->PORTABILITY -- Pix key link creation --> BACEN;
```
### 2. Donor Flow
:::info
The flowcharts below represent the behaviors pertinent to the **donation flow** of PIX key
:::
#### 2.1. Claimant Bank opens a portability request
```mermaid
flowchart RL
    OTHER_BANK(Claimant Bank);
    QI_PARTICIPANT(Indirect Participant\n QiTech);
    CONFIRMED{{Portability \n 'waiting_resolution'}};
    
    OTHER_BANK-. Confirm portability \n request.->CONFIRMED -- Portability Request Receipt \n Webhook --> QI_PARTICIPANT;
```

#### 2.2. QI Tech Indirect Participant confirms receipt of portability request
```mermaid
flowchart LR
    PARTICIPANT(Indirect Participant\n QiTech);
    CONFIRMED{{Portability \n'confirmed'}};
    
    PARTICIPANT -. Confirms receipt \n and removes link .-> CONFIRMED
```

#### 2.3. Claimant Bank completes a portability request
```mermaid
flowchart RL
    OTHER_BANK(Claimant Bank);
    QI_PARTICIPANT(Indirect Participant\n QiTech);
    CONFIRMED{{Portability \n 'completed'}};
    
    OTHER_BANK-. Completes portability\n request.->CONFIRMED -- Webhook Update --> QI_PARTICIPANT;
```

#### 2.4. Claimant Bank cancels a portability request
:::warning Important
Portability Requests with **confirmed** status can only be canceled if they are of type **"fraud"**
:::
```mermaid
flowchart RL
    OTHER_BANK(Claimant Bank);
    QI_PARTICIPANT(Indirect Participant\n QiTech);
    PORTABILITY{{Portability \n 'waiting_resolution' ou 'confirmed'}};
    
    OTHER_BANK-. Cancels portability\n request.->PORTABILITY -- Webhook Update --> QI_PARTICIPANT;
```

---

# Consult Portability Requests for an Alias

URL: /en/documentation/pix_indireto/portabilidade/listar_pedidos_de_portabilidade_de_um_alias

## Request

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY /claim_requests
METHOD GET

## Response

STATUS 200

**Response Body**

```json
{
  "data": [
    {
        "cancellation_reason": null,
        "cancelled_by": null,
        "claim_request_flow_type": "donator",
        "claim_request_key": "be0884bc-44a4-4907-8627-ef976e477aef",
        "claim_request_status": "pending_confirmation",
        "claim_request_type": "portability",
        "confirmation_reason": null,
        "created_at": "2023-11-06T17:30:11",
        "donator_ispb": 32402502,
        "limit_conclusion_date": null,
        "limit_resolve_date": "2023-11-13T17:29:00",
        "max_conclusion_date": null,
        "max_resolution_date": "2023-11-13T17:29:00",
        "pix_key": "45574823098",
        "pix_key_claim_id": "205c72ab-c03e-43b7-a43d-2409e21fa5be",
        "pix_key_type": "cpf",
        "request_control_key": "be0884bc-44a4-4907-8627-ef976e477aef"
    },
    {
        "cancellation_reason": null,
        "cancelled_by": null,
        "claim_request_flow_type": "donator",
        "claim_request_key": "852d0192-68a7-4bad-bc22-0002f9c5cb1c",
        "claim_request_status": "concluded",
        "claim_request_type": "portability",
        "confirmation_reason": null,
        "created_at": "2023-11-05T17:30:11",
        "donator_ispb": 32402502,
        "limit_conclusion_date": null,
        "limit_resolve_date": "2023-11-12T17:29:00",
        "max_conclusion_date": null,
        "max_resolution_date": "2023-11-12T17:29:00",
        "pix_key": "93109309009",
        "pix_key_claim_id": "089db155-59cf-4a19-881b-22ca932a4612",
        "pix_key_type": "cpf",
        "request_control_key": "9a4336be-a729-4245-9b90-72bbeb04f13c"
    }
  ],
  "pagination": {
    "current_page": 1,
    "rows_per_page": 10
  }
} 
```

---

# Portability Update Webhook

URL: /en/documentation/pix_indireto/portabilidade/webhook/webhook_atualizacao_do_pedido_de_portabilidade

**Request Body: Update a Portability Request**

```json
{
  "webhook_type": "baas.pix_keys.claim_request",
  "webhook_datetime": "2024-05-27T12:13:24",
  "data": {
    "claim_request_status": "pending",
    "claim_request_direction": "incoming",
    "claim_request_key": "fe3ab7c5-e907-4a66-b9c5-7ea156429f83",
    "pix_key": "12345678000190",
    "claim_request_type": "ownership",
    "pix_key_type": "cnpj",
    "cancellation_reason": null,
    "cancelled_by": "donor",
    "confirmation_reason": null,
    "max_resolution_date": "2023-11-13T17:29:00",
    "updated_at": "2024-05-25T12:13:25",
  }
}
```

### Webhook Body Param
| Field                  | Type     | Description                                                 | Characters |
|------------------------|----------|-------------------------------------------------------------|------------|
| `claim_request_status` * | string | PIX key representing the destination account of the transaction. | -          |
| `claim_request_key` *  | string   | UUID4 key identifying the QR Code.                          | -          |
| `updated_at` *         | datetime | Date and time of QR Code payment.                           | -          |

### claim_request_status
| Value                 | Description                                                                         |
|-----------------------|-------------------------------------------------------------------------------------|
| `waiting_resolution`  | The notification was received by the counterparty                                   |
| `confirmed`           | The donor confirmed the claim. It is waiting for the claimer to complete the process.|
| `cancelled`           | The donor or claimer canceled the portability request                                |
| `completed`           | Both the DICT and the claimer updated their records with the new linkage             |

---

# Portability Request Received Webhook

URL: /en/documentation/pix_indireto/portabilidade/webhook/webhook_receber_registro_externo_de_portabilidade

**Request Body: Receiving a Portability Request**

```json
{
  "webhook_type": "baas.pix_keys.claim_request",
  "webhook_datetime": "2024-05-27T12:13:24",
  "data": {
    "claim_request_status": "pending",
    "claim_request_direction": "incoming",
    "claim_request_key": "fe3ab7c5-e907-4a66-b9c5-7ea156429f83",
    "pix_key": "12345678000190",
    "claim_request_type": "ownership",
    "pix_key_type": "cnpj",
    "cancellation_reason": null,
    "cancelled_by": "donor",
    "confirmation_reason": null,
    "max_resolution_date": "2023-11-13T17:29:00",
    "created_at": "2024-05-25T12:13:25",
  }
}
```

### Webhook Body Param
| Field                  | Type     | Description                                                 | Characters |
|------------------------|----------|-------------------------------------------------------------|------------|
| `claim_request_status` * | string | PIX key representing the destination account of the transaction. | -          |
| `claim_request_key` *  | string   | UUID4 key identifying the QR Code.                          | -          |
| `updated_at` *         | datetime | Date and time of QR Code payment.                           | -          |

### claim_request_status
| Value                 | Description             | Characters |
|-----------------------|-------------------------|------------|
| `waiting_resolution`  | Description               | -          |
| `confirmed`           | Description               | -          |
| `cancelled`           | Description               | -          |
| `completed`           | Description               | -          |

---

# Consult QR Code

URL: /en/documentation/pix_indireto/qr_code/consultar_qr_code

It is possible to search for a specific QR Code of the Alias by the qr_code_key generated during its creation. This endpoint will return all its information, such as status, payment, and events.

## Request

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY /qrcode/ QR_CODE_KEY
METHOD GET

## Response

STATUS 200 Ok

Response Body: Geral

```json
{
  "request_control_key": "037b46b1-0c67-4c0d-aac3-1e395dfdcb10",
  "pix_key": "3d7d6a2b-f72f-44z7-bb20-79a94dff5645",
  "receiver_conciliation_id": "01GVGV9NXBCY287Z6CJ4S0ENW9",
  "qr_code_key": "d74bf12a-9243-4bfa-9b00-6b63755b6555",
  "qr_code_status": "active",
  "qr_code_type": "dynamic_instant",
  "amount": 22.34,
  "expiration_seconds": 864000,
  "expiration_date": null,
  "max_payment_days": null,
  "payer_name": "João da Silva",
  "payer_document_number": "00000000000000",
  "payer_person_type": "legal",
  "payer_request": "Payment for order XXXXXXXXXXXX",
  "rebate_amount": 1,
  "interest_amount": 2,
  "fine_amount": 3,
  "discounts": [],
  "additional_data": [
    {
      "key_name": "Juros e Multa",
      "value": "Juros 2 ao mes e multa de 1%"
    }
  ],
  "pix_transfer_key": null,
  "paid_amount": null,
  "base_64_payload": "<BASE64 DA URI DO PIX COPIA E COLA>",
  "qr_code_events": [
    {
      "request_control_key": "037b46b1-0c67-4c0d-aac3-1e395dfdcb10",
      "event_type": "registration",
      "created_at": "2023-03-03T12:04:06.179Z"
    },
    {
      "request_control_key": "cae915c8-1940-43ec-890b-ba1a3a66354c",
      "event_type": "payment",
      "created_at": "2023-03-03T12:04:06.179Z"
    }
  ],
  "created_at": "2023-03-03T12:04:06.179Z"
}
```

| Field                       | Type   | Description                                                             | Characters |
|-----------------------------|--------|-------------------------------------------------------------------------|------------|
| `request_control_key` *     | string | Unique UUID4 identifier of the request that originated the QR Code.      | -          |
| `pix_key` *                 | string | PIX key representing the destination account of the transaction.         | -          |
| `receiver_conciliation_id` *| string | QR Code identifier for reconciliation after payment.                    | -          |
| `qr_code_key` *             | string | UUID4 key identifying the QR Code.                                       | -          |
| `qr_code_status` *          | string | QR Code status.                                                          | -          |
| `qr_code_type` *            | string | QR Code type.                                                            | "dynamic_term" or "dynamic_instant" |
| `amount` *                  | float  | QR Code amount before calculating discounts or interest and fines.       | -          |
| `expiration_seconds`        | string | Indicates the validity time of the QR Code in seconds, default is 1 day  | -          |
| `expiration_date`           | date   | Due date of the charge (in the format "YYYY-MM-DD").                     | -          |
| `max_payment_days`          | int32  | Maximum days for paying the charge after due date.                       | -          |
| `payer_name` *              | string | Payer's name.                                                            | -          |
| `payer_document_number` *   | string | Payer's CPF/ CNPJ.                                                       | -          |
| `payer_request` *           | string | Message to the payer.                                                    | -          |
| `rebate_amount`             | float  | Absolute rebate amount before payment.                                   | -          |
| `interest_amount`           | float  | Absolute value per day of delay after the due date.                      | -          |
| `fine_amount`               | float  | Absolute fine amount after the due date.                                 | -          |
| `discounts`                 | array of objects | Discount settings.                                                      | -          |
| `additional_data`           | array of objects | Information to be presented to the payer.                                | -          |
| `pix_transfer_key`          | string | UUID4 key identifying the PIX transaction corresponding to the QR Code settlement. | -  |
| `paid_amount`               | float  | Amount of the payment made, considering fines, discounts, and others.   | -          |
| `base_64_payload`           | string | URL of the QR Code for payment in base64.                               | -          |
| `qr_code_events`            | array of objects | List of status changes the QR Code has undergone.                      | -          |
| `created_at`                | datetime | Date and time the QR Code was created in the system.                    | -          |

### Object qr_code_status
| Field           | Type   | Description                                         | Characters |
|-----------------|--------|-----------------------------------------------------|------------|
| `active`        | string | QR Code is active and available for payment.        | -          |
| `finished`      | string | QR Code has been paid.                              | -          |
| `written_off`   | string | QR Code has been canceled by the client.            | -          |
| `bank_written_off` | string | QR Code was automatically canceled due to expiration. | -       |

### Object discount
| Field               | Type   | Description              | Characters |
|---------------------|--------|--------------------------|------------|
| `discount_value` *  | float  | Discount amount.         | -          |
| `discount_number`   | int32  | Order in which the discount should be applied. | -  |
| `discount_limit_date` | string | Discount limit date.    | -          |

### Object additional_data
| Field              | Type   | Description               | Characters |
|--------------------|--------|---------------------------|------------|
| `key_name` *       | string | Name of the field         | -          |
| `value`            | string | Value of the field        | -          |

### Object qr_code_events
| Field                   | Type     | Description                                              | Characters |
|-------------------------|----------|----------------------------------------------------------|------------|
| `request_control_key` * | string   | Unique UUID4 identifier of the request that originated the event.                | -          |
| `event_type` *          | string   | Event type                                               | "registration", "write_off", "payment" |
| `created_at` *          | datetime | Date and time the event was created.                     | -          |
STATUS 400

Response Body

```json
{
    "title": "Bad Request",
    "description": "Invalid payload for QR Code creation.",
    "translation": "Payload inválido para a criação de QR Code.",
    "code": "QRI000003"
}

```

STATUS 404

Response Body: QR Code key not found

```json
{
    "title": "Not found",
    "description": "No Pix QR Code found for qr_code_key {qr_code_key}.",
    "translation": "Não foi encontrado nenhum QR Code com a qr_code_key {qr_code_key}.",
    "code": "QRI000005"
}
```

---

# Create Dynamic PIX QR Code with Due Date

URL: /en/documentation/pix_indireto/qr_code/Criar QR Code/criar_qr_code_dinamico_com_vencimento

The dynamic QR Code with a due date is used for payments where the originator is known and it is desirable to facilitate payment, allowing the addition of deadlines, discounts, fines, and interest. This QR Code is typically used as a replacement for bank slips.

## Request

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY /qrcode
METHOD POST

Request Body: Dynamic QR Code with Due Date

```json
{
  "request_control_key": "8a923886-afce-4116-ac1f-69bdffcf8da9",
  "qr_code_type": "dynamic_term",
  "amount": 10.25,
  "receiver_conciliation_id": "01GVGV9NXBCY287Z6CJ4S0ENW9",
  "payer_document_number": "00000000000000",
  "payer_name": "Random",
  "payer_request": "Payment for order XXXXXXXXXX",
  "pix_key": "3d7d6a2b-f72f-44c7-bb20-79a94dff5954",
  "expiration_date": "2023-03-25",
  "max_payment_days": 128,
  "fine_amount": 3,
  "interest_amount": 2,
  "rebate_amount": 1,
  "discounts": [],
  "additional_data": [
    {
      "key_name": "merchant_name",
      "value": "Lojas Costa S.A."
    }
  ],
}
```

### Body Params
| Field                       | Type   | Description                                                                          | Characters |
|-----------------------------|--------|--------------------------------------------------------------------------------------|------------|
| `request_control_key` *     | string | Unique UUID4 identifier of the request.                                              | -          |
| `qr_code_type` *            | string | Type of the dynamic QR Code. `"dynamic_term"` or `"dynamic_instant"`                  | -          |
| `amount` *                  | float  | QR Code amount before calculating discounts or interest and fines.                    | -          |
| `receiver_conciliation_id` * | string | QR Code identifier for reconciliation after payment.                                 | -          |
| `payer_document_number` *   | string | Payer's CPF/ CNPJ.                                                                   | -          |
| `payer_name` *              | string | Payer's name.                                                                         | -          |
| `payer_request` *           | string | Message to the payer.                                                                 | -          |
| `pix_key` *                 | string | PIX key representing the destination account of the transaction.                      | -          |
| `expiration_date` *         | date   | Due date of the charge (in the format "YYYY-MM-DD").                                  | -          |
| `max_payment_days` *        | int32  | Maximum days for paying the charge.                                                   | -          |
| `fine_amount` *             | float  | Absolute fine amount after the due date.                                              | -          |
| `interest_amount` *         | float  | Absolute value per day of delay after the due date. If paid one day after the due date, the total amount will be the original value + fine. | -          |
| `rebate_amount` *           | float  | Absolute rebate amount before payment.                                                | -          |
| `discounts`                 | array of objects | Discount settings.                                                                   | -          |
| `additional_data`           | array of objects | Extra information for the QR Code used for reconciliations.                          | -          |

### Object additional_data
| Field                       | Type   | Description               | Characters |
|-----------------------------|--------|---------------------------|------------|
| `key_name` *                | string | Name of the field         | -          |
| `value` *                   | string | Value of the field        | -          |

### Object discount
| Field                       | Type   | Description              | Characters |
|-----------------------------|--------|--------------------------|------------|
| `discount_value` *          | float  | Discount amount.         | -          |
| `discount_number`           | int32  | Order in which the discount should be applied. | -  |
| `discount_limit_date` *     | string | Discount limit date.     | -          |
## Response

STATUS 201 Created

Response Body: Create dynamic QR Code with Due Date

```json
{
  "request_control_key": "037b46b1-0c67-4c0d-aac3-1e395dfdcb10",
  "qr_code_key": "d74bf12a-9243-4bfa-9b00-6b63755b6555",
  "qr_code_status": "active",
  "base_64_payload": "<BASE64 DA URI DO PIX COPIA E COLA>",
  "created_at": "2023-03-03T12:04:06.179Z",
}
```
| Field                   | Type     | Description                                          | Characters |
|-------------------------|----------|------------------------------------------------------|------------|
| `request_control_key` * | string   | Unique UUID4 identifier of the request.              | -          |
| `qr_code_key` *         | string   | QR Code identifier for future requests.              | -          |
| `qr_code_status` *      | string   | QR Code status in the system.                        | "active": default for creation. |
| `base_64_payload` *     | string   | URL of the QR Code for payment in base64.            | -          |
| `created_at` *          | datetime | Date and time the QR Code was created in the system. | -          |

### Object qr_code_status
| Field           | Type   | Description                                         | Characters |
|-----------------|--------|-----------------------------------------------------|------------|
| `active`        | string | QR Code is active and available for payment.        | -          |
| `finished`      | string | QR Code has been paid.                              | -          |
| `written_off`   | string | QR Code has been canceled by the client.            | -          |
| `bank_written_off` | string | QR Code was automatically canceled due to expiration. | -       |

STATUS 400

Response Body

```json
{
    "title": "Bad Request",
    "description": "Invalid payload for QR Code creation.",
    "translation": "Payload inválido para a criação de QR Code.",
    "code": "QRI000003"
}

```

---

# Create Dynamic PIX QR Code for Immediate Payment

URL: /en/documentation/pix_indireto/qr_code/Criar QR Code/criar_qr_code_dinamico_imediato

The dynamic QR Code for immediate payment is used for payments with a short payment term, usually processed in seconds, for routine payment collection operations.

## Request

Request Body: Dynamic PIX QR Code for Immediate Payment

```json
{
  "request_control_key": "8a923886-afce-4116-ac1f-69bdffcf8da9",
  "qr_code_type": "dynamic_instant",
  "amount": 22.34,
  "receiver_conciliation_id": "01GVGV9NXBCY287Z6CJ4S0ENW9",
  "payer_document_number": "00000000000000",
  "payer_name": "Random",
  "payer_request": "Payment for order XXXXXXXXXX",
  "pix_key": "3d7d6a2b-f72f-44z7-bb20-79a94dff5645",
  "expiration_seconds": 864000,
  "additional_data": [
    {
      "key_name": "identificacao_venda",
      "value": "Venda número 123 na plataforma"
    }
  ],
}
```

### Body Params
| Field                       | Type   | Description                                                                          | Characters |
|-----------------------------|--------|--------------------------------------------------------------------------------------|------------|
| `request_control_key` *     | string | Unique UUID4 identifier of the request.                                              | -          |
| `qr_code_type` *            | string | Type of the dynamic QR Code. `"dynamic_term"` or `"dynamic_instant"`                  | -          |
| `amount` *                  | float  | QR Code amount before calculating discounts or interest and fines.                    | -          |
| `receiver_conciliation_id` *| string | QR Code identifier for reconciliation after payment.                                 | -          |
| `payer_document_number` *   | string | Payer's CPF/ CNPJ.                                                                   | -          |
| `payer_name` *              | string | Payer's name.                                                                        | -          |
| `payer_request` *           | string | Message to the payer.                                                                | -          |
| `pix_key` *                 | string | PIX key representing the destination account of the transaction.                     | -          |
| `expiration_seconds`        | string | Indicates the validity time of the QR Code in seconds, default is 1 day              | -          |
| `additional_data`           | array of objects | Information to be presented to the payer.                                            | -          |

### Object additional_data
| Field              | Type   | Description               | Characters |
|--------------------|--------|---------------------------|------------|
| `key_name` *       | string | Name of the field         | -          |
| `value`            | string | Value of the field        | -          |

## Response

STATUS 201 Created

Response Body: Create Dynamic PIX QR Code for Immediate Payment

```json
{
  "request_control_key": "037b46b1-0c67-4c0d-aac3-1e395dfdcb10",
  "qr_code_key": "d74bf12a-9243-4bfa-9b00-6b63755b6555",
  "qr_code_status": "active",
  "base_64_payload": "<BASE64 DA URI DO PIX COPIA E COLA>",
  "created_at": "2023-03-03T12:04:06.179Z",
}
```
| Field                   | Type     | Description                                          | Characters |
|-------------------------|----------|------------------------------------------------------|------------|
| `request_control_key` * | string   | Unique UUID4 identifier of the request.              | -          |
| `qr_code_key` *         | string   | QR Code identifier for future requests.              | -          |
| `qr_code_status` *      | string   | QR Code status in the system.                        | "active": default for creation. |
| `base_64_payload` *     | string   | URL of the QR Code for payment in base64.            | -          |
| `created_at` *          | datetime | Date and time the QR Code was created in the system. | -          |

### Object qr_code_status

| Field           | Type   | Description                                         | Characters |
|-----------------|--------|-----------------------------------------------------|------------|
| `active`        | string | QR Code is active and available for payment.        | -          |
| `finished`      | string | QR Code has been paid.                              | -          |
| `written_off`   | string | QR Code has been canceled by the client.            | -          |
| `bank_written_off` | string | QR Code was automatically canceled due to expiration. | -       |
STATUS 400

Response Body

```json
{
    "title": "Bad Request",
    "description": "Invalid payload for QR Code creation.",
    "translation": "Payload inválido para a criação de QR Code.",
    "code": "QRI000003"
}

```

---

# Create Static PIX QR Code

URL: /en/documentation/pix_indireto/qr_code/Criar QR Code/criar_qr_code_estatico

The static QR Code is used for payments where the identity of the payer is unknown, as well as when and how many payers there will be. Basically, it consists of a key, and optionally a value, encoded, and can be paid multiple times, as it only references the key.

## Request

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY /qrcode
METHOD POST

Request Body: Static QR Code

```json
{
    "request_control_key": "8a923886-afce-4116-ac1f-69bdffcf8da9",
    "qr_code_type": "static",
    "pix_key": "joaosilva@gmail.com",
    "amount": 10.25,
}
```

### Body Params

| Field                  | Type   | Description                                   | Characters |
|------------------------|--------|-----------------------------------------------|------------|
| `request_control_key` * | string | Unique UUID4 identifier of the request.       | -          |
| `qr_code_type` *       | string | Type of the QR Code.                          | "static"   |
| `pix_key` *            | string | PIX key representing the destination account of the transaction. | -  |
| `amount`               | float  | QR Code value.                                | If not provided, it will be entered by the payer. |

## Response

STATUS 201 Created

Response Body: Create Static QR Code

```json
{
  "request_control_key": "037b46b1-0c67-4c0d-aac3-1e395dfdcb10",
  "base_64_payload": "<BASE64 DA URI DO PIX COPIA E COLA>"
}
```

| Field                  | Type   | Description                             | Characters |
|------------------------|--------|-----------------------------------------|------------|
| `request_control_key` * | string | Unique UUID4 identifier of the request. | -          |
| `base_64_payload` *    | string | URL of the QR Code for payment, in base64. | -       |

STATUS 400

Response Body

```json
{
    "title": "Bad Request",
    "description": "Invalid payload for QR Code creation.",
    "translation": "Payload inválido para a criação de QR Code.",
    "code": "QRI000003"
}

```

---

# List QR Codes of an alias

URL: /en/documentation/pix_indireto/qr_code/decodificar_qr_code

PIX QR Codes, used in image or URL format, follow a standard and must be decoded using logic to extract the payment information. With the URL of the QR Code, it is possible to decode all the information that originated it. The decoding generates an `end_to_end_id`, which must be used in the QR Code payment along with the receiver_conciliation_id to identify the QR Code payment.

## Request

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY /qrcode/decode
METHOD POST

Request Body: Decode QR Code

```json
{
   "qr_code_payload": "00020126580014br.gov.bcb.pix0136a23bf0e9-5175-4829-bf89-e8fe6ac09aa1520400005303986540530.005802BR5914TywinLannister6008saopaulo62070503***6304D4FD",
}
```

| Field             | Type   | Description                           | Characters |
|-------------------|--------|---------------------------------------|------------|
| `qr_code_payload` | string | URL of the QR Code for payment (PIX copy and paste). | -          |

## Response

STATUS 200 Ok

Response Body: Static QR Code

```json
{
  "end_to_end_id": "E32402502202303131806WTFZTGAOWiq",
  "qr_code_data": {
    "additional_data": null,
    "amount": null,
    "ispb_number": "90400888",
    "receiver_conciliation_id": "01GVGV9NXBCY287Z6CJ4S0ENW9",
    "target_account_branch": "2980",
    "target_account_digit": "5",
    "target_account_number": "0000000000022039741",
    "target_account_type": "checking_account",
    "target_bank_code": 33,
    "target_bank_name": "BCO SANTANDER (BRASIL) S.A.",
    "target_document_number": "00000000000000",
    "target_name": "JOSE RONALDO",
    "target_pix_key": "00000000000000"
  },
  "qr_code_key": "e54671f5-3eda-4180-8539-0ac6271fe185",
  "qr_code_payload": "00020126360032br.gov.bcb.pix0111234590280001665204000051234565802BR5925JOSE RONALDO BERNARDINO 26008BRASILIA62070503***63044293",
  "qr_code_type": "static"
}
```

STATUS 200 Ok

Response Body: Dynamic QR Code with due date

```json
{
  "request_control_key": "037b46b1-0c67-4c0d-aac3-1e395dfdcb10",
  "end_to_end_id": "E32402502202303101532yCipbxgUnUj",
  "qr_code_data": {
    "account_type": "payment_account",
    "additional_data": [],
    "amount": "55.59",
    "category_code": "0000",
    "max_payment_days": 16,
    "discount_amount": null,
    "expiration_date": "2023-03-27",
    "fee_amount": null,
    "fine_amount": null,
    "ispb_number": "20018183",
    "original_amount": "55.59",
    "payer_document_number": "00000000000",
    "payer_name": "Willian Rocha",
    "payer_request": null,
    "receiver_conciliation_id": "8b434df48c30482a81f7c936ae35cc87",
    "receiver_url": "invoice.starkbank.com/v2/cobv/8b434df48c30482a81f7c936ae351234",
    "reduction_amount": null,
    "qr_code_status": "active",
    "target_account_branch": "0001",
    "target_account_digit": "8",
    "target_account_number": "589575519784140",
    "target_bank_code": null,
    "target_bank_name": "Stark Bank S.A.",
    "target_document_number": "00000000000000",
    "target_name": "TESTE LTDA.",
    "target_pix_key": "e623e7b0-d00a-400e-aee6-79632430e817",
    "target_trading_name": null,
    "presented_at": "2023-03-10T15:32:15.87Z",
    "created_at": "2023-01-10T19:49:58.30Z",
  },
  "qr_code_key": "8c2c19bd-f260-4714-955c-956f3eaa30ca",
  "qr_code_payload": "00020101021226840014br.gov.bcb.pix2562invoice.starkbank.com/v2/cobv/8b434df48c30482a81f7c936ae35cc123456000053039865802BR5925Oncred Sociedade de Credi6015TESTE 62070503***6304D008",
  "qr_code_type": "dynamic_term"
}

```

STATUS 200 Ok

Response Body: QR Code with due date

```json
{
  "request_control_key": "037b46b1-0c67-4c0d-aac3-1e395dfdcb10",
  "end_to_end_id": "E32402502202303141907qlBAF1evdJ2",
  "qr_code_data": {
    "account_type": "checking_account",
    "additional_data": [],
    "amount": "9367.61",
    "category_code": "0000",
    "expiration_seconds": 201574,
    "ispb_number": "00000000",
    "payer_document_number": "10003550206",
    "payer_name": "ISMAEL FATIMA AMARAL",
    "payer_request": "Liquidacao de Parcelas",
    "receiver_conciliation_id": "fgnb4NTt7pOUBGfrcporERwVVqr0f8PWRfK",
    "receiver_url": "qrcodepix.bb.com.br/pix/v2/d373e385-dfe7-49f6-b9ec-14ba60a90000",
    "qr_code_status": "active",
    "target_account_branch": "1253",
    "target_account_digit": "8",
    "target_account_number": "107260",
    "target_bank_code": 1,
    "target_bank_name": "BCO DO BRASIL S.A.",
    "target_document_number": "0000000000000",
    "target_name": "TESTE LTDA.",
    "target_pix_key": "teste.cobrancapix@gmail.com.br",
    "presented_at": "2023-03-14T19:07:48.729Z",
    "created_at": "2023-03-13T19:00:28.440Z",
  },
  "qr_code_key": "ffd7d60a-0f2d-4b29-9ae2-7f2b919fa65e",
  "qr_code_payload": "00020101021226850014br.gov.bcb.pix2563qrcodepix.bb.com.br/pix/v2/d373e385-dfe7-49f6-b9ec-14ba60a9b8285204001234567895802BR5925TESTE DE JANEIRO62070503***63047B7D",
  "qr_code_type": "dynamic_instant"
}
```

### Response Body

| Field                       | Type   | Description                                                             | Characters |
|-----------------------------|--------|-------------------------------------------------------------------------|------------|
| `request_control_key` *     | string | Unique UUID4 identifier of the request that originated the QR Code.      | -          |
| `end_to_end_id` *           | string | Unique identifier of the Pix transaction, end-to-end.                    | -          |
| `account_type` *            | string | Type of origin account.                                                  | -          |
| `amount` *                  | float  | QR Code amount currently.                                                | -          |
| `category_code` *           | string | QR Code identifier for reconciliation after payment.                     | -          |
| `expiration_seconds`        | string | Indicates the validity time of the QR Code in seconds, default is 1 day  | -          |
| `ispb_number` *             | string | Bank identifier.                                                         | -          |
| `payer_document_number` *   | string | Payer's CPF/ CNPJ.                                                       | -          |
| `payer_name` *              | string | Payer's name.                                                            | -          |
| `payer_request` *           | string | Message to the payer.                                                    | -          |
| `receiver_conciliation_id` * | string | QR Code identifier for reconciliation after payment.                    | -          |
| `receiver_url` *            | string | URL for querying the dynamic QR Code data.                               | -          |
| `qr_code_status` *          | string | QR Code status.                                                          | -          |
| `target_account_branch` *   | string | Destination account branch.                                              | -          |
| `target_account_digit` *    | string | Destination account check digit.                                         | -          |
| `target_account_number` *   | string | Destination account number.                                              | -          |
| `target_bank_code` *        | string | Destination bank code.                                                   | -          |
| `target_bank_name` *        | string | Destination bank name.                                                   | -          |
| `target_document_number` *  | string | Collector's CPF/ CNPJ.                                                   | -          |
| `target_name` *             | string | Collector's name.                                                        | -          |
| `target_trading_name` *     | string | Collector's trade name - only for CNPJ.                                  | -          |
| `target_pix_key` *          | string | Collector's PIX key.                                                     | -          |
| `qr_code_key` *             | string | UUID4 key identifying the QR Code.                                       | -          |
| `qr_code_payload` *         | string | QR Code copy and paste URL.                                              | -          |
| `qr_code_type` *            | string | Type of the QR Code.                                                     | "static", "dynamic_term", or "dynamic_instant" |
| `max_payment_days`          | int32  | Maximum days for paying the charge after due date.                       | -          |
| `expiration_date`           | date   | Due date of the charge (in the format "YYYY-MM-DD").                     | -          |
| `fine_amount`               | float  | Absolute fine amount after the due date.                                 | -          |
| `interest_amount`           | float  | Absolute value per day of delay after the due date.                      | -          |
| `discount_amount`           | float  | Discount amount.                                                         | -          |
| `original_amount`           | float  | Original QR Code amount.                                                 | -          |
| `additional_data`           | array of objects | Information to be presented to the payer.                                | -          |
| `presented_at` *            | datetime | Date and time the QR Code was decoded.                                   | -          |
| `created_at` *              | datetime | Date and time the QR Code was created in the system.                     | -          |
| `rebate_amount`             | float  | Absolute rebate amount before payment.                                   | -          |

### Object qr_code_status
| Field           | Type   | Description                                         | Characters |
|-----------------|--------|-----------------------------------------------------|------------|
| `active`        | string | QR Code is active and available for payment.        | -          |
| `finished`      | string | QR Code has been paid.                              | -          |
| `written_off`   | string | QR Code has been canceled by the client.            | -          |
| `bank_written_off` | string | QR Code was automatically canceled due to expiration. | -       |

### Object additional_data
| Field              | Type   | Description               | Characters |
|--------------------|--------|---------------------------|------------|
| `key_name` *       | string | Name of the field         | -          |
| `value`            | string | Value of the field        | -          |

STATUS 400

Response Body: Impossible to decode QR Code

```json
{
    "title": "Bad Request",
    "description": "Could not decode QR Code.",
    "translation": "Não foi possível decodificar o QR Code.",
    "code": "QRI000001"
}
```

STATUS 404

Response Body: QR Code not found

```json
{
    "title": "Not found",
    "description": "Could not find the queried QR Code.",
    "translation": "Não possível encontrar o QR Code buscado.",
    "code": "QRI000002"
}
```

---

# Update/Deactivate a PIX QR Code

URL: /en/documentation/pix_indireto/qr_code/desativar_qr_code

Only dynamic-type PIX QR Codes can be updated. Upon updating, identified by the qr_code_key generated when creating the QR Code, it becomes invalid for subsequent payments. There are several reasons to request an update of a PIX QR Code, but in the internal system, the deactivation can be performed by a request from the alias (write_off).

## Request

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY /qrcode/ QR_CODE_KEY
METHOD PATCH

Request Body: Write off QR Code

```json
{
  "request_control_key": "76d4506d-31a4-48db-bc71-61068b138ffd",
  "qr_code_status": "written_off",
}
```

| Field                   | Type   | Description                             | Characters |
|-------------------------|--------|-----------------------------------------|------------|
| `request_control_key` * | string | Unique UUID4 identifier of the request. | -          |
| `qr_code_status` *      | string | QR Code status                          | -          |

### Object qr_code_status
| Field           | Type   | Description                                         | Characters |
|-----------------|--------|-----------------------------------------------------|------------|
| `active`        | string | QR Code is active and available for payment.        | -          |
| `finished`      | string | QR Code has been paid.                              | -          |
| `written_off`   | string | QR Code has been canceled by the client.            | -          |
| `bank_written_off` | string | QR Code was automatically canceled due to expiration. | -       |

## Response

STATUS 204 No content

Response Body

```json
{}
```

STATUS 404

Response Body

```json
{
    "title": "Not found",
    "description": "Could not find the queried QR Code.",
    "translation": "Não possível encontrar o QR Code buscado.",
    "code": "QRI000002"
}

```

---

# Introduction to PIX QR Code

URL: /en/documentation/pix_indireto/qr_code/introducao_qr_code

Any Indirect Participant (Alias) customer can perform operations for creating, querying, and canceling PIX QR Codes.
- Creation: Static or dynamic QR Codes can be generated. With dynamic QR Codes, it is possible to generate one for instant payment or with a long-term due date. The types will be further explained in the creation process.
- Querying: With a QR Code or the URL of the QR Code (PIX copy and paste), it is possible to query its information for subsequent payment. The query is called QR Code decoding and generates an `end_to_end_id` for subsequent payment.
- Canceling: Canceling a QR Code makes it invalid for payment. The main causes of cancellation are: expired term, QR Code cancellation by alias, or payment.
## Types of QR Codes
The type of QR Code is defined during creation by the `qr_code_type` field.
| Name                                 | Enumerator          | Description |
|--------------------------------------|---------------------|---|
| Static                               | `static`            | Contains destination PIX key and may contain value. Can be paid at any time, as long as the key is active. No validity period. Reusable. |
| Dynamic for Instant Payment          | `dynamic_instant`   | Contains payment information, with defined payer, value, and reconciliation key. Payment term in seconds. Single use. |
| Dynamic with Due Date                | `dynamic_term`      | Contains payment information, with defined payer, value, and reconciliation key. Payment term in days, with fine and interest information. Single use. |
## Payment of a QR Code
After decoding a QR Code and querying the key, an `end_to_end_id` is generated, which is used in the payment order to finalize the transaction. Additionally, for Dynamic QR Codes, the `receiver_conciliation_id` field is used to identify the specific QR Code being paid, used by the receiver to continue the operation after payment.
When decoding a QR Code, you must send a PIX payment order with the `end_to_end_id` and `receiver_conciliation_id`, and the receiving bank will know how to proceed. Similarly, when receiving a PIX payment of the type `static_qr_code` or `dynamic_qr_code`, a webhook will be sent, also handled at the end of this QR Code section.

---

# List QR Codes of an alias

URL: /en/documentation/pix_indireto/qr_code/listar_alias_qr_codes

The search for QR Codes is used to manage the status of dynamic QR Codes, verify payments, cancellations, etc.

## Request

ENDPOINT /account/ ACCOUNT_KEY /alias/ ALIAS_KEY /qrcodes
METHOD GET

### Path params
| Field                | Type    | Description                               | Characters |
|----------------------|---------|-------------------------------------------|------------|
| `page`               | integer | Page number being searched (default = 0)  | -          |
| `page_size`          | integer | Number of items per page (default = 15)   | -          |
| `qr_code_status`     | string  | Status of the searched QR codes           | -          |
| `qr_code_type`       | string  | Type of the searched QR codes             | -          |
| `request_control_key`| string  | Request control key that originated the QR code | -          |

## Response

STATUS 200 Ok

Response Body: General

```json
{
   "data":[
      {
         "request_control_key":"037b46b1-0c67-4c0d-aac3-1e395dfdcb10",
         "pix_key":"3d7d6a2b-f72f-44z7-bb20-79a94dff5645",
         "receiver_conciliation_id":"01GVGV9NXBCY287Z6CJ4S0ENW9",
         "qr_code_key":"d74bf12a-9243-4bfa-9b00-6b63755b6555",
         "qr_code_status":"active",
         "qr_code_type":"dynamic_instant",
         "amount":22.34,
         "expiration_seconds":864000,
         "expiration_date":null,
         "max_payment_days":null,
         "payer_name":"João da Silva",
         "payer_document_number":"00000000000000",
         "payer_request":"Payment for order XXXXXXXXXXXX",
         "rebate_amount":1,
         "interest_amount":2,
         "fine_amount":3,
         "discounts":[
            
         ],
         "additional_data":[
            {
               "key_name":"Juros e Multa",
               "value":"Juros 2 ao mes e multa de 1%"
            },
         ],
         "pix_transfer_key":null,
         "paid_amount":null,
         "base_64_payload":"<BASE64 DA URI DO PIX COPIA E COLA>",
         "qr_code_events":[
            {
               "request_control_key":"037b46b1-0c67-4c0d-aac3-1e395dfdcb10",
               "event_type":"registration",
               "created_at":"2023-03-03T12:04:06.179Z"
            },
            {
               "request_control_key":"cae915c8-1940-43ec-890b-ba1a3a66354c",
               "event_type":"payment",
               "created_at":"2023-03-03T12:04:06.179Z"
            },
         ],
         "created_at":"2023-03-03T12:04:06.179Z"
      },
   ],
   "pagination":{
      "current_page":1,
      "rows_per_page":30
   },
},
```
| Field                       | Type   | Description                                                             | Characters |
|-----------------------------|--------|-------------------------------------------------------------------------|------------|
| `request_control_key` *     | string | Unique UUID4 identifier of the request that originated the QR Code.      | -          |
| `pix_key` *                 | string | PIX key representing the destination account of the transaction.         | -          |
| `receiver_conciliation_id` *| string | QR Code identifier for reconciliation after payment.                    | -          |
| `qr_code_key` *             | string | UUID4 key identifying the QR Code.                                       | -          |
| `qr_code_status` *          | string | QR Code status.                                                          | -          |
| `qr_code_type` *            | string | QR Code type.                                                            | "dynamic_term" or "dynamic_instant" |
| `amount` *                  | float  | QR Code amount before calculating discounts or interest and fines.       | -          |
| `expiration_seconds`        | string | Indicates the validity time of the QR Code in seconds, default is 1 day  | -          |
| `expiration_date`           | date   | Due date of the charge (in the format "YYYY-MM-DD").                     | -          |
| `max_payment_days`          | int32  | Maximum days for paying the charge after due date.                       | -          |
| `payer_name` *              | string | Payer's name.                                                            | -          |
| `payer_document_number` *   | string | Payer's CPF/ CNPJ.                                                       | -          |
| `payer_request` *           | string | Message to the payer.                                                    | -          |
| `rebate_amount`             | float  | Absolute rebate amount before payment.                                   | -          |
| `interest_amount`           | float  | Absolute value per day of delay after the due date.                      | -          |
| `fine_amount`               | float  | Absolute fine amount after the due date.                                 | -          |
| `discounts`                 | array of objects | Discount settings.                                                      | -          |
| `additional_data`           | array of objects | Information to be presented to the payer.                                | -          |
| `pix_transfer_key`          | string | UUID4 key identifying the PIX transaction corresponding to the QR Code settlement. | -  |
| `paid_amount`               | float  | Amount of the payment made, considering fines, discounts, and others.   | -          |
| `base_64_payload`           | string | URL of the QR Code for payment in base64.                               | -          |
| `qr_code_events`            | array of objects | List of status changes the QR Code has undergone.                      | -          |
| `created_at`                | datetime | Date and time the QR Code was created in the system.                    | -          |

### Object qr_code_status
| Field           | Type   | Description                                         | Characters |
|-----------------|--------|-----------------------------------------------------|------------|
| `active`        | string | QR Code is active and available for payment.        | -          |
| `finished`      | string | QR Code has been paid.                              | -          |
| `written_off`   | string | QR Code has been canceled by the client.            | -          |
| `bank_written_off` | string | QR Code was automatically canceled due to expiration. | -       |

### Object discount
| Field               | Type   | Description              | Characters |
|---------------------|--------|--------------------------|------------|
| `discount_value` *  | float  | Discount amount.         | -          |
| `discount_number`   | int32  | Order in which the discount should be applied. | -  |
| `discount_limit_date` * | string | Discount limit date.    | -          |

### Object additional_data
| Field              | Type   | Description               | Characters |
|--------------------|--------|---------------------------|------------|
| `key_name` *       | string | Name of the field         | -          |
| `value`            | string | Value of the field        | -          |

### Object qr_code_events
| Field                   | Type     | Description                                              | Characters |
|-------------------------|----------|----------------------------------------------------------|------------|
| `request_control_key` * | string   | Unique UUID4 identifier of the request that originated the event.                | -          |
| `event_type` *          | string   | Event type                                               | "registration", "write_off", "payment" |
| `created_at` *          | datetime | Date and time the event was created.                     | -          |

STATUS 404

Response Body

```json
{
    "title": "Not found",
    "description": "Could not find the queried QR Code.",
    "translation": "Não possível encontrar o QR Code buscado.",
    "code": "QRI000002"
}

```

---

# Webhook for Incoming PIX Payment of QR Code

URL: /en/documentation/pix_indireto/qr_code/webhook_incoming_pix

Webhook to notify about PIX transactions received for an Alias linked to a QR Code payment.

## Webhook Request Body

**Request Body: Received QR Code payment**

```json
{
  "webhook_type": "baas.pix_qr_code.payment",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
    "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
    "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "qr_code_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "qr_code_type": "dynamic_instant",
    "receiver_conciliation_id": "faf1ef5b-e0a9-4430-8aa4-367b4825854c",
    "amount": 10.63,
    "updated_at": "2021-10-22T20:30:23.459Z"
  }
}
```

### Webhook Body Param

| Field                       | Type     | Description                                                | Characters |
|-----------------------------|----------|------------------------------------------------------------|------------|
| `request_control_key` *     | string   | Unique UUID4 identifier of the request that originated the QR Code. | -          |
| `pix_transfer_key` *        | string   | PIX key representing the destination account of the transaction. | -    |
| `qr_code_key` *             | string   | UUID4 key identifying the QR Code.                             | -          |
| `qr_code_type` *            | string   | Type of the QR Code.                                           | "static", "dynamic_term", or "dynamic_instant" |
| `receiver_conciliation_id` *| string   | QR Code identifier for reconciliation after payment.           | -          |
| `amount` *                  | string   | Payment amount.                                               | -          |
| `updated_at` *              | datetime | Date and time the QR Code payment was made.                   | -          |

---

# Cancel Infraction Report

URL: /en/documentation/pix_indireto/relato_de_infracao/cancelar_relato_infracao

If an Infraction Report request was generated erroneously and the Indirect Participant wishes to cancel it, this can be done using the endpoint mentioned below.

:::danger IMPORTANT
It is emphasized that only the Participant who CREATED the Infraction Report can cancel it, and the cancellation can be made even if the infraction status is closed.
:::

:::info IMPORTANT
Canceled infraction reports can be listed using the endpoint [List Infraction Reports](#list-infraction-reports).
:::

## Request

ENDPOINT /pix/infraction_report/ INFRACTION_REPORT_KEY
METHOD PATCH

**Request Body**

```json
{
    "infraction_report_status": "cancelled",
    "request_control_key": "750cbfa0-f628-4944-a76c-9053bf1ebc87",
}
```

### Path Params
| Field                   | Type   | Description                                                      | Characters |
|-------------------------|--------|------------------------------------------------------------------|------------|
| `infraction_report_key` | string | UUID4 of the Infraction Report created that is to be canceled.   | 36         |

### Body Params
| Field                    | Type   | Description                                                      | Characters |
|--------------------------|--------|------------------------------------------------------------------|------------|
| `infraction_report_status` * | string | Status to which the Infraction Report should be updated         | 36         |
| `request_control_key` *   | string    | Unique identification key for the request used by the client in uuid v4 format   | 36         |

## Response

STATUS 200

**Response Body**

```json
{
   "infraction_report_key":"d7820e2f-1c23-4610-83d6-d9aad1845075",
   "pix_transfer_key":"cdcf0d25-08a1-46e3-902a-6d7ca75e6c48",
   "end_to_end_id":"E99999011202406251332F8n7dMUwOLE",
   "infraction_report_status":"cancelled",
   "infraction_report_situation":"scam",
   "infraction_report_type":"refund_request",
   "infraction_report_details":"usuario caiu em golpe…",
   "debited_participant":"99999010",
   "credited_participant":"99999011",
   "infraction_report_direction": "outgoing",
   "created_at": "2023-03-03T12:04:06.179Z",
   "updated_at": "2023-03-03T12:05:03.421Z"
}
```

### Body Params| Field                         | Type   | Description                                                              | Characters |
|-------------------------------|--------|--------------------------------------------------------------------------|------------|
| `infraction_report_key` *     | string | Unique identifier of the infraction report.                              | 36         |
| `pix_transfer_key` *          | string | Unique identifier of the PIX transaction.                                | 36         |
| `end_to_end_id` *             | string | Unique identifier of the PIX transaction at BACEN.                       | 36         |
| `infraction_report_status` *  | enum   | Status of the Infraction Report                                          | **[Enumerators infraction_report_status](#enumerators-infraction_report_status)** |
| `infraction_report_situation` *| enum   | Situation in which the infraction occurred.                              | **[Enumerators infraction_report_situation](#enumerators-infraction_report_situation)** |
| `infraction_report_type` *    | enum   | Type of Infraction Report.                                               | **[Enumerators infraction_report_type](#enumerators-infraction_report_type)** |
| `infraction_report_details`   | string | Details about the created Infraction Report.                             | Less or equal 2000    |
| `credited_participant` *      | string | ISPB of the Credited Participant.                                        | 8          |
| `debited_participant` *       | string | ISPB of the Debited Participant.                                         | 8          |
| `infraction_report_direction` * | enum | Enumerator on whether the report was opened by the Indirect Participant or another Participant | **[Enumerators infraction_report_direction](#enumerators-infraction_report_direction)** |
| `created_at` *                | string | Infraction Report creation date.                                         | 24         |
| `updated_at`                  | string | Infraction Report update date.                                           | 24         |

### Enumerators infraction_report_status
| Field          | Type   | Description                                                                    | Characters |
| -------------- | ------ | ------------------------------------------------------------------------------ |------------|
| `open`         | string | Infraction report was <strong>created</strong> and is open at BACEN.            | -          |
| `acknowledged` | string | Infraction report was <strong>received</strong> by the contested participant.   | -          |
| `cancelled`    | string | Infraction report is <strong>cancelled</strong> at BACEN.                       | -          |
| `closed`       | string | Infraction report is <strong>closed</strong> at BACEN.                          | -          |

### Enumerators infraction_report_situation
| Field                | Type   | Description                                                            | Characters |
|----------------------|--------|----------------------------------------------------------------------- |------------|
| `scam`               | string | Cause of scam or fraud.                                                | -          |
| `account_takeover`   | string | Cause of unauthorized transaction from the origin account.             | -          |
| `coercion`           | string | Cause of coercion crime.                                               | -          |
| `fraudulent_access`  | string | Cause of fraudulent access to the origin account.                      | -          |
| `other`              | string | Any causes not applicable to those listed above.                       | -          |

### Enumerators infraction_report_type
| Field              | Type   | Description                                                        | Characters |
|--------------------|--------|--------------------------------------------------------------------|------------|
| `refund_request`   | string | Infraction report will be generated to request a refund.           | -          |
| `refund_cancelled` | string | Infraction report will be generated due to a cancelled refund.     | -          |

### Enumerators infraction_report_direction
| Field       | Type   | Description                                                  | Characters |
| ----------- | ------ | ------------------------------------------------------------ |------------|
| `incoming`  | string | Infraction report with the indirect participant as the target.| -          |
| `outgoing`  | string | Infraction report with the indirect participant as the originator.| -       |

---

# Consult Infraction Report

URL: /en/documentation/pix_indireto/relato_de_infracao/consultar_relato_infracao

The Indirect Participant can query data about an Infraction Report, including all changes that have occurred to it.

## Request

ENDPOINT /pix/infraction_report/ INFRACTION_REPORT_KEY
METHOD GET

### Path Params
| Field                   | Type   | Description                              | Characters |
|-------------------------|--------|------------------------------------------|------------|
| `infraction_report_key` | string | UUID4 of the Infraction Report.          | 36         |

## Response

STATUS 200

**Response Body**

```json
{
   "infraction_report_key":"d7820e2f-1c23-4610-83d6-d9aad1845075",
   "pix_transfer_key":"cdcf0d25-08a1-46e3-902a-6d7ca75e6c48",
   "end_to_end_id":"E99999010202406251332F8n7dMUwOLE",
   "infraction_report_status":"cancelled",
   "infraction_report_situation":"scam",
   "infraction_report_type":"refund_request",
   "report_details":"usuario caiu em golpe…",
   "debited_participant":"99999011",
   "credited_participant":"99999010",
   "infraction_report_direction": "incoming",
   "infraction_report_events": [
     {
       "event_type": "acknowledged",
       "event_details": "Relato de Infração recebido e em análise",
       "created_at": "2023-03-03T12:04:06.179Z"
     },
     {
       "event_type": "cancelled",
       "event_details": "Relato de Infração cancelado",
       "created_at": "2023-03-03T12:04:06.179Z"
     }
   ],
  "created_at": "2023-03-03T12:04:06.179Z",
  "updated_at": "2023-03-03T12:04:06.179Z"
}
```

### Body Params
| Field                         | Type   | Description                                                              | Characters |
|-------------------------------|--------|--------------------------------------------------------------------------|------------|
| `infraction_report_key` *     | string | Unique identifier of the infraction report.                              | 36         |
| `pix_transfer_key` *          | string | Unique identifier of the PIX transaction.                                | 36         |
| `end_to_end_id` *             | string | Unique identifier of the PIX transaction at BACEN.                       | 36         |
| `infraction_report_status` *  | enum   | Status.                                                                  | **[Enumerators infraction_report_status](#enumerators-infraction_report_status)** |
| `infraction_report_situation` *| enum   | Situation in which the infraction occurred.                              | **[Enumerators infraction_report_situation](#enumerators-infraction_report_situation)** |
| `infraction_report_type` *    | enum   | Type of Infraction Report.                                               | **[Enumerators infraction_report_type](#enumerators-infraction_report_type)** |
| `infraction_report_details`   | string | Details about the created Infraction Report.                             | Less or equal 2000    |
| `credited_participant` *      | string | ISPB of the Credited Participant.                                        | 8          |
| `debited_participant` *       | string | ISPB of the Debited Participant.                                         | 8          |
| `infraction_report_direction` * | enum | Enumerator on whether the report was opened by the Indirect Participant or another Participant | **[Enumerators infraction_report_direction](#enumerators-infraction_report_direction)** |
| `infraction_report_events` *  | object | Events related to the Infraction Report.                                 | **[Objects infraction_report_events](#objects-infraction_report_events)** |
| `created_at` *                | string | Infraction Report creation time.                                         | 24         |
| `updated_at`                  | string | Infraction Report update time.                                           | 24         |

### Enumerators infraction_report_status
| Field          | Type   | Description                                                                    | Characters |
| -------------- | ------ | ------------------------------------------------------------------------------ |------------|
| `open`         | string | Infraction report was <strong>created</strong> and is open at BACEN.            | 4          |
| `acknowledged` | string | Infraction report was <strong>received</strong> by the contested participant.   | 12         |
| `cancelled`    | string | Infraction report is <strong>cancelled</strong> at BACEN.                       | 9          |
| `closed`       | string | Infraction report is <strong>closed</strong> at BACEN.                          | 6          |

### Enumerators infraction_report_situation
| Field                | Type   | Description                               | Characters |
|----------------------|--------|-------------------------------------------|------------|
| `scam`               | string | Cause of scam or fraud.                   | -          |
| `account_takeover`   | string | Cause of unauthorized transaction from the origin account. | -   |
| `coercion`           | string | Cause of coercion crime.                  | -          |
| `fraudulent_access`  | string | Cause of fraudulent access to the origin account.            | -   |
| `other`              | string | Any causes not applicable to those listed above.             | -   |

### Enumerators infraction_report_type
| Field              | Type   | Description                                                        | Characters |
|--------------------|--------|--------------------------------------------------------------------|------------|
| `refund_request`   | string | Infraction report will be generated to request a refund.           | -          |
| `refund_cancelled` | string | Infraction report will be generated due to a cancelled refund.     | -          |

### Enumerators infraction_report_direction
| Field       | Type   | Description                                                  | Characters |
| ----------- | ------ | ------------------------------------------------------------ |------------|
| `incoming`  | string | Infraction report with the indirect participant as the target.| -          |
| `outgoing`  | string | Infraction report with the indirect participant as the originator.| -       |

### Objects infraction_report_events
| Field              | Type   | Description                                   | Characters |
|------------------- |--------|-----------------------------------------------|------------|
| `event_type`       | enum   | Status change related to the event.           | **[Enumerators infraction_report_status](#enumerators-infraction_report_status)** |
| `event_details`    | string | Description of the event.                     | -          |
| `created_at` *     | string | Event creation time.                          | 24         |

---

# Open Infraction Report

URL: /en/documentation/pix_indireto/relato_de_infracao/criar_relato_infracao

The Infraction Report is one of the services that composes the Special Refund Mechanism (MED) as defined by the Central Bank of Brazil.
When there is an indication of a fraudulent transaction, refund request, or refund cancellation request, it is possible to create an infraction report to inform BACEN and the other Participant that there is an irregularity in one of these operations mentioned.
Both the debited Participant and the credited Participant can create an Infraction Report.
:::caution **Attention**
To understand the Infraction Report flow, it is necessary to know which ENDPOINTS the Indirect Participant who created the report can use.
When the Indirect Participant opens an Infraction Report, they can (if necessary) cancel the report if it was generated improperly.
When the Indirect Participant receives an Infraction Report, they must close it by informing the result of the report analysis.
Both cited flows will be described in the following sections.
:::
:::danger IMPORTANT
The Central Bank of Brazil requires that, within a period of 7 days from receiving the Infraction Report by the Indirect Participant, the Report must be closed .
If there is a delay on the part of the Indirect Participant, QI Tech will close the Infraction Report with the status of agreed , to ensure the institution is not penalized by the Central Bank of Brazil.
:::
:::info IMPORTANT
Only the originator of the transfer can create an infraction report about it.
:::
## Request

ENDPOINT /pix/infraction_report
METHOD POST

**Request Body**

```json
{
    "pix_transfer_key": "c09fef15-ab30-469c-a1d4-4e9dd479943a",
    "request_control_key": "c09fef15-ab30-469c-a1d4-4e9dd479943a",
    "infraction_report_type": "refund_request",
    "infraction_report_details": "Foi identificado uma fraude na transação",
    "infraction_report_situation": "scam"
}
```

### Body Params
| Field                      | Type   | Description                                        | Characters |
|----------------------------|--------|----------------------------------------------------|------------|
| `request_control_key` *    | uuidv4 | UUID4 for querying about the made request.         | 36         |
| `pix_transfer_key` *       | uuidv4 | Unique identifier of the PIX transaction.          | 36         |
| `infraction_report_type` * | enum   | Type of infraction report to be created.           | **[Enumerators infraction_report_type](#enumerators-infraction_report_type)** |
| `infraction_report_details`| string | Details about the infraction report to be created. | 10         |
| `infraction_report_situation` | string | Situation in which the infraction occurred.            | **[Enumerators infraction_report_situation](#enumerators-infraction_report_situation)** |

### Enumerators infraction_report_type
| Field              | Type   | Description                                                                 | Characters |
|--------------------|--------|----------------------------------------------------------------------------- |------------|
| `refund_cancelled` | string | Infraction report will be generated due to a cancelled refund                | 16         |
| `refund_request`   | string | Infraction report will be generated to request a refund                      | 14         |

### Enumerators infraction_report_situation
| Field                | Type   | Description                                                            | Characters |
|----------------------|--------|----------------------------------------------------------------------- |------------|
| `scam`               | string | Cause of scam or fraud.                                                | -          |
| `account_takeover`   | string | Cause of unauthorized transaction from the origin account.             | -          |
| `coercion`           | string | Cause of coercion crime.                                               | -          |
| `fraudulent_access`  | string | Cause of fraudulent access to the origin account.                      | -          |
| `other`              | string | Any causes not applicable to those listed above.                       | -          |
## Response

STATUS 200

**Response Body**

```json
{
    "infraction_report_key":"d7820e2f-1c23-4610-83d6-d9aad1845075",
    "pix_transfer_key":"cdcf0d25-08a1-46e3-902a-6d7ca75e6c48",
    "end_to_end_id":"E99999010202406251332F8n7dMUwOLE",
    "infraction_report_status":"acknowledged",
    "infraction_report_situation":"scam",
    "infraction_report_type":"refund_request",
    "report_details":"usuario caiu em golpe…",
    "debited_participant":"99999011",
    "credited_participant":"99999010",
    "infraction_report_direction": "outgoing",
    "created_at": "2023-03-03T12:04:06.179Z",
    "updated_at": "2023-03-03T12:04:06.179Z"
}
```

### Body Params

| Field                          | Type   | Description                                                              | Characters |
| -------------------------------| ------ | ------------------------------------------------------------------------ |------------|
| `infraction_report_key` *      | string | Unique identifier of the infraction report.                              | 36         |
| `pix_transfer_key` *           | string | Unique identifier of the PIX transaction.                                | 36         |
| `end_to_end_id` *              | string | Unique identifier of the PIX transaction at BACEN.                       | 36         |
| `infraction_report_status` *   | enum   | Status.                                                                  | **[Enumerators infraction_report_status](#enumeradores-infraction_report_status)** |
| `infraction_report_situation` *| enum   | Situation in which the infraction occurred.                              | **[Enumerators infraction_report_situation](#enumeradores-infraction_report_situation)** |
| `infraction_report_type` *     | enum   | Type of Infraction Report.                                               | **[Enumerators infraction_report_type](#enumeradores-infraction_report_type)** |
| `infraction_report_details`     | string | Details about the created Infraction Report.                                                 | \<\= 2000                                                                                 |
| `credited_participant` *       | string | ISPB of the Credited Participant.                                        | 8          |
| `debited_participant` *        | string | ISPB of the Debited Participant.                                         | 8          |
| `infraction_report_direction` *| enum   | Enumerator on whether the report was opened by the Indirect Participant or another Participant | **[Enumerators infraction_report_direction](#enumeradores-infraction_report_direction)** |
| `created_at` *                 | string | Infraction Report creation time.                                         | 24         |
| `updated_at`                   | string | Infraction Report update time.                                           | 24         |

### Enumerators infraction_report_status
| Field          | Type   | Description                                                                    | Characters |
| -------------- | ------ | ------------------------------------------------------------------------------ |------------|
| `open`         | string | Infraction report was <strong>created</strong> and is open at BACEN.            | -          |
| `acknowledged` | string | Infraction report was <strong>received</strong> by the contested participant.   | -          |
| `cancelled`    | string | Infraction report is <strong>cancelled</strong> at BACEN.                       | -          |
| `closed`       | string | Infraction report is <strong>closed</strong> at BACEN.                          | -          |

### Enumerators infraction_report_direction
| Field       | Type   | Description                                                  | Characters |
| ----------- | ------ | ------------------------------------------------------------ |------------|
| `incoming`  | string | Infraction report with the indirect participant as the target.| -          |
| `outgoing`  | string | Infraction report with the indirect participant as the originator.| -       |

---

# Close Infraction Report

URL: /en/documentation/pix_indireto/relato_de_infracao/fechar_relato_infracao

QI Tech will be responsible for conducting a polling with the Central Bank of Brazil to check if there are any Infraction Reports created by other Participants for the Indirect Participant, and will send the receipt webhook with the status acknowledged .
To inform the Indirect Participant that there is an Infraction Report to be responded to, QI Tech will send a receipt webhook .
:::danger IMPORTANT
It is emphasized that only the Participant who RECEIVED the Infraction Report can close it.
:::
:::danger IMPORTANT
The Central Bank of Brazil defines that within a period of 7 days from receiving the Infraction Report by the Indirect Participant, the Report must be closed .
If there is a delay on the part of the Indirect Participant, QI Tech will close the Infraction Report with the status of agreed, 6 calendar days after sending the receipt of infraction webhook, to ensure the institution is not penalized by the Central Bank of Brazil.
:::
To close the infraction report, the status must be acknowledged .

## Request

ENDPOINT /pix/infraction_report/ INFRACTION_REPORT_KEY
METHOD PATCH

**Request Body - Agreed**

```json
{
    "infraction_report_status": "closed",
    "request_control_key": "feb59932-be7a-4584-9830-02ed8bc0aa77",
    "analysis_result": "agreed",
    "fraud_type": "application_fraud",
    "analysis_details": "Valor bloqueado. Para mais informações ligue para (11) 98871-1385.",
}
```

**Request Body - Disagreed**

```json
{
    "infraction_report_status": "closed",
    "request_control_key": "feb59932-be7a-4584-9830-02ed8bc0aa77",
    "analysis_result": "disagreed",
    "analysis_details": "Valor bloqueado. Para mais informações ligue para (11) 98871-1385.",
}
```

### Path Params
| Field                   | Type   | Description                                                      | Characters |
|-------------------------|--------|------------------------------------------------------------------|------------|
| `infraction_report_key` | string | UUID4 of the created Infraction Report to be closed.             | 36         |

### Body Params
| Field                    | Type   | Description                                                      | Characters |
|--------------------------|--------|------------------------------------------------------------------|------------|
| `analysis_result` *      | enum   | Result of the analysis.                                          | **[Enumerators analysis_result](#enumeradores-analysis_result)** |
| `request_control_key` *  | uuidv4 | UUID4 for querying about the made request.                        | 36         |
| `infraction_report_status` * | enum | Status to be set for the infraction report.                     | **[Enumerators infraction_report_status](#enumeradores-infraction_report_status)** |
| `fraud_type`             | enum   | Type of fraud detected. Not part of the infraction report entity but necessary for closure. | **[Enumerators fraud_type](#enumeradores-fraud_type)** |
| `analysis_details`       | string | Description of the analysis result                               | 250        |

### Enumerators analysis_result
| Field       | Type   | Description                                                                          | Characters |
|-------------|--------|--------------------------------------------------------------------------------------|------------|
| `agreed`    | string | The Indirect Participant <strong>agrees</strong> with the Infraction Report created by the other Participant. | -          |
| `disagreed` | string | The Indirect Participant <strong>disagrees</strong> with the Infraction Report created by the other Participant. | -          |

### Enumerators infraction_report_status
| Field           | Type   | Description                                                                 | Characters |
|-----------------|--------|-----------------------------------------------------------------------------|------------|
| `open`          | string | Infraction report was <strong>created</strong> and is open at BACEN.         | -          |
| `acknowledged`  | string | Infraction report was <strong>received</strong> by the participant           | -          |
| `cancelled`     | string | Infraction report is <strong>cancelled</strong> at BACEN                     | -          |
| `closed`        | string | Infraction report is <strong>closed</strong> at BACEN                        | -          |

### Enumerators fraud_type
| Field              | Type   | Description                                                           | Characters |
|--------------------|--------|-----------------------------------------------------------------------|------------|
| `application_fraud`| string | Fraud by identity theft, with documents of another person.            | -          |
| `mule_account`     | string | Fraud through mule account, opened legitimately.                      | -          |
| `scammer_account`  | string | Fraud in which the destination account is in the name of the real fraudster. | -          |
| `other`            | string | Fraud of a different nature, not fitting the above enumerators.       | -          |
## Response

STATUS 200

**Response Body**

```json
{
   "infraction_report_key":"d7820e2f-1c23-4610-83d6-d9aad1845075",
   "pix_transfer_key":"cdcf0d25-08a1-46e3-902a-6d7ca75e6c48",
   "end_to_end_id":"E99999011202406251332F8n7dMUwOLE",
   "infraction_report_status":"cancelled",
   "infraction_report_situation":"scam",
   "infraction_report_type":"refund_request",
   "infraction_report_details":"usuario caiu em golpe…",
   "debited_participant":"99999010",
   "credited_participant":"99999011",
   "analysis_result": "agreed",
   "analysis_details": "Valor bloqueado. Para mais informações ligue para (11) 98871-1385.",
   "infraction_report_direction": "incoming",
   "created_at": "2023-03-03T12:04:06.179Z",
   "updated_at": "2023-03-03T12:05:03.421Z",
}
```

### Body Params
| Field                     | Type   | Description                                                      | Characters |
|---------------------------|--------|-------------------------------------------------------------------|------------|
| `infraction_report_key` * | string | Unique identifier of the infraction report.                      | 36         |
| `pix_transfer_key` *      | string | Unique identifier of the PIX transaction.                        | 36         |
| `end_to_end_id` *         | string | Unique identifier of the PIX transaction at BACEN.               | 36         |
| `infraction_report_status` * | enum | Status of the Infraction Report                                   | **[Enumerators infraction_report_status](#enumeradores-infraction_report_status)** |
| `infraction_report_situation` * | enum | Situation in which the infraction occurred.                        | **[Enumerators infraction_report_situation](#enumeradores-infraction_report_situation)** |
| `infraction_report_type` * | enum | Type of Infraction Report                                          | **[Enumerators infraction_report_type](#enumeradores-infraction_report_type)** |
| `infraction_report_details` | string | Details about the created Infraction Report                          | Less or equal 2000 |
| `credited_participant` *  | string | ISPB of the Credited Participant                                    | 8       |
| `debited_participant` *   | string | ISPB of the Debited Participant                                     | 8       |
| `analysis_result` *       | string | Result of the analysis                                              | **[Enumerators analysis_result](#enumeradores-analysis_result)** |
| `analysis_details` *      | string | Description of the analysis result                                  | 250      |
| `infraction_report_direction` * | enum | Enumerator on whether the report was opened by the Indirect Participant or another Participant | **[Enumerators infraction_report_direction](#enumeradores-infraction_report_direction)** |
| `created_at` *            | string | Infraction Report creation date                                      | 24       |
| `updated_at`              | string | Infraction Report update date                                        | 24       |

### Enumerators infraction_report_situation
| Field               | Type   | Description                                           | Characters |
|---------------------|--------|-------------------------------------------------------|------------|
| `scam`              | string | Cause of scam or fraud.                               | -          |
| `account_takeover`  | string | Cause of unauthorized transaction from the origin account.                                        | -   |
| `coercion`          | string | Cause of coercion crime.                              | -          |
| `fraudulent_access` | string | Cause of fraudulent access to the origin account. | -   |
| `other`             | string | Any causes not applicable to those listed above.     | -          |

### Enumerators infraction_report_type
| Field              | Type   | Description                                        | Characters |
|--------------------|--------|---------------------------------------------------|------------|
| `refund_request`   | string | Infraction report will be generated to request a refund                                                       | -          |
| `refund_cancelled` | string | Infraction report will be generated due to a cancelled refund   | -          |

### Enumerators infraction_report_direction
| Field       | Type   | Description                                                             | Characters |
| ----------- | ------ | ------------------------------------------------------------------------|------------|
| `incoming`  | string | Infraction report with the indirect participant as the target.    | -          |
| `outgoing`  | string | Infraction report with the indirect participant as the originator.| -          |

### Enumerators analysis_result
| Field       | Type   | Description                                                              | Characters |
| ----------- | ------ | ------------------------------------------------------------------------ |------------|
| `agreed`    | string | The Indirect Participant <strong>agrees</strong> with the Infraction Report created by the other Participant.       | -          |
| `disagreed` | string | The Indirect Participant <strong>disagrees</strong> with the Infraction Report created by the other Participant. | -          |

### Enumerators infraction_report_status
| Field           | Type   | Description                                                                 | Characters |
|-----------------|--------|-----------------------------------------------------------------------------|------------|
| `open`          | string | Infraction report was <strong>created</strong> and is open at BACEN.         | -          |
| `acknowledged`  | string | Infraction report was <strong>received</strong> by the participant           | -          |
| `cancelled`     | string | Infraction report is <strong>cancelled</strong> at BACEN                     | -          |
| `closed`        | string | Infraction report is <strong>closed</strong> at BACEN                        | -          |

---

# List Infraction Reports

URL: /en/documentation/pix_indireto/relato_de_infracao/listar_relatos

If the Indirect Participant requests a listing of Infraction Reports, they can do so through the route below.
## Request

ENDPOINT /pix/infraction_reports
METHOD GET

### Query Params
| Field                   | Type    | Description                       | Characters |
|-------------------------|---------|-----------------------------------|------------|
| `infraction_report_status` | enum | Status of the Infraction Report.  | **[Enumerators infraction_report_status](#enumeradores-infraction_report_status)** |
| `infraction_report_type`   | enum | Type of the Infraction Report.    | **[Enumerators infraction_report_type](#enumeradores-infraction_report_type)** |
| `initial_date`             | string | Start search date.                | **[Date format](#date-format)** |
| `final_date`               | string | End search date.                  | **[Date format](#date-format)** |
| `page_number`              | integer | Current page being queried.       | -          |
| `page_size`                | integer | Number of results per page.       | -          |

### Date format
| Field        | Type   | Description                                                              | Characters |
|--------------|--------|--------------------------------------------------------------------------|------------|
| `initial_date` | string | Start search date, in the format "%Y-%m-%d". Example: "2023-10-09".        | 10         |
| `final_date`   | string | End search date, in the format "%Y-%m-%d". Example: "2023-10-11".          | 10         |

## Response

STATUS 200

**Response Body**

```json
{
    "data": [
        {
            "infraction_report_key":"2b4b262d-fa31-4bb5-87f9-52ef1d243275",
            "pix_transfer_key":"16125a82-1842-4f29-a895-c80e14c70e44",
            "end_to_end_id":"E99999010202406251332F8n7dMUwOLE",
            "infraction_report_status":"cancelled",
            "infraction_report_situation":"scam",
            "infraction_report_type":"refund_request",
            "report_details":"usuario caiu em golpe…",
            "debited_participant":"99999011",
            "credited_participant":"99999010",
            "infraction_report_direction": "incoming",
            "infraction_report_events": [
                {
                "event_type": "acknowledged",
                "event_details": "Relato de Infração recebido e em análise",
                "created_at": "2023-03-03T12:04:06.179Z"
                },
                {
                "event_type": "cancelled",
                "event_details": "Relato de Infração cancelado",
                "created_at": "2023-03-03T12:04:06.179Z"
                }
            ],
            "created_at": "2023-03-03T12:04:06.179Z",
            "updated_at": "2023-03-03T12:04:06.179Z"
        },
        {
            "infraction_report_key":"facb89f7-49bb-41fd-8a4d-98792880a6f2",
            "pix_transfer_key":"a913cfb4-0c4a-4069-99f2-7ab34b6a4bf9",
            "end_to_end_id":"E99999010202406251332F8n7dMUwOLA",
            "infraction_report_status":"acknowledged",
            "infraction_report_situation":"scam",
            "infraction_report_type":"refund_request",
            "report_details":"usuario caiu em golpe de novo…",
            "debited_participant":"99999011",
            "credited_participant":"99999010",
            "infraction_report_direction": "incoming",
            "infraction_report_events": [
                {
                "event_type": "acknowledged",
                "event_details": "Relato de Infração recebido e em análise",
                "created_at": "2023-03-03T12:04:06.179Z"
                },
            ],
            "created_at": "2023-03-03T12:04:06.179Z",
            "updated_at": "2023-03-03T12:04:06.179Z"
        },
    ],
    "pagination": {
        "current_page": 1,
        "next_page": null,
        "rows_per_page": 10
    }
}
```

### Body Params
| Field                         | Type   | Description                                                              | Characters |
|-------------------------------|--------|--------------------------------------------------------------------------|------------|
| `infraction_report_key` *     | string | Unique identifier of the infraction report.                              | 36         |
| `pix_transfer_key` *          | string | Unique identifier of the PIX transaction.                                | 36         |
| `end_to_end_id` *             | string | Unique identifier of the PIX transaction at BACEN.                       | 36         |
| `infraction_report_status` *  | enum   | Status.                                                                  | **[Enumerators infraction_report_status](#enumeradores-infraction_report_status)** |
| `infraction_report_situation` *| enum   | Situation in which the infraction occurred.                              | **[Enumerators infraction_report_situation](#enumeradores-infraction_report_situation)** |
| `infraction_report_type` *    | enum   | Type of Infraction Report.                                               | **[Enumerators infraction_report_type](#enumeradores-infraction_report_type)** |
| `infraction_report_details`   | string | Details about the created Infraction Report.                             | Less or equal 2000    |
| `credited_participant` *      | string | ISPB of the Credited Participant.                                        | 8          |
| `debited_participant` *       | string | ISPB of the Debited Participant.                                         | 8          |
| `infraction_report_direction` * | enum | Enumerator on whether the report was opened by the Indirect Participant or another Participant | **[Enumerators infraction_report_direction](#enumeradores-infraction_report_direction)** |
| `infraction_report_events` *  | object | Events related to the Infraction Report.                                 | **[Objects infraction_report_events](#objetos-infraction_report_events)** |
| `created_at` *                | string | Infraction Report creation time.                                         | 24         |
| `updated_at`                  | string | Infraction Report update time.                                           | 24         |

### Enumerators infraction_report_status
| Field          | Type   | Description                                                                     | Characters |
| -------------- | ------ | ------------------------------------------------------------------------------- |------------|
| `open`         | string | Infraction report was <strong>created</strong> and is open at BACEN.            | 4          |
| `acknowledged` | string | Infraction report was <strong>received</strong> by the contested participant.   | 12         |
| `cancelled`    | string | Infraction report is <strong>cancelled</strong> at BACEN.                       | 9          |
| `closed`       | string | Infraction report is <strong>closed</strong> at BACEN.                          | 6          |

### Enumerators infraction_report_situation
| Field                | Type   | Description                                           | Characters |
| -------------------  | ------ | ------------------------------------------------------|------------|
| `scam`               | string | Cause of scam or fraud.                               | -          |
| `account_takeover`   | string | Cause of unauthorized transaction from the origin account.          | -    |
| `coercion`           | string | Cause of coercion crime.                              | -          |
| `fraudulent_access`  | string | Cause of fraudulent access to the origin account.     | -          |
| `other`              | string | Any causes not applicable to those listed above.      | -          |

### Enumerators infraction_report_type
| Field              | Type   | Description                                        | Characters |
| ------------------ | ------ | -------------------------------------------------- |------------|
| `refund_request`   | string | Infraction report will be generated to request a refund               | -          |
| `refund_cancelled` | string | Infraction report will be generated due to a cancelled refund                  | -          |

### Enumerators infraction_report_direction
| Field       | Type   | Description                                                             | Characters |
| ----------- | ------ | ------------------------------------------------------------------------|------------|
| `incoming`  | string | Infraction report with the indirect participant as the target.    | -          |
| `outgoing`  | string | Infraction report with the indirect participant as the originator.| -          |

### Objects infraction_report_events
| Field        | Type   | Description                                   | Characters |
| -------------|--------|-----------------------------------------------|------------|
| `event_type` | enum   | Status change related to the event.           | **[Enumerators infraction_report_status](#enumeradores-infraction_report_status)** |
| `event_details` | string | Description of the event.                     | -          |
| `created_at`   | string | Event creation time.                          | 24         |

---

# Introduction to the Infraction Report Flow

URL: /en/documentation/pix_indireto/relato_de_infracao/maquina_estados

## Introduction
The Central Bank of Brazil allows that if there is an infraction in a PIX transaction, whether a common transaction or a refund, the Indirect Participant can inform the other Participant involved in the flow that there is an irregularity.
:::info
It is emphasized that, for a PIX transaction, only the credited Participant can open an Infraction Report.
:::
:::danger IMPORTANT
The Central Bank of Brazil defines that within a period of 7 days from receiving the Infraction Report by the Indirect Participant, the Report must be closed .
If there is a delay on the part of the Indirect Participant, QI Tech will close the Infraction Report with the status of agreed, 6 calendar days after sending the receipt of infraction webhook, to ensure the institution is not penalized by the Central Bank of Brazil.
:::
## Infraction_Report_Status State Machine
| Enumerator | Translation | Description|
|---|---|---|
| open | open | After processing the <strong>creation</strong> of the Infraction Report, it remains open at BACEN.
| acknowledged | received | QI Tech received an Infraction Report targeting the Indirect Participant and will forward it (report) via webhook.
| cancelled | cancelled | The Participant who opened the report sent the cancellation, and it is <strong>cancelled</strong> at BACEN.
| closed | closed | The closure of the Infraction Report was processed by QI Tech and is <strong>closed</strong> at BACEN.
## Infraction_Report_Status State Machine Control
Even though the flow is synchronous, it is necessary for the Indirect Participant to know the statuses an Infraction Report can have. Below, we describe what the Participant can expect after opening, cancelling, completing, and receiving an Infraction Report.
### Participant Opens Infraction Report
The Indirect Participant can open an Infraction Report at the Central Bank. The only requirement for opening the Report is that a transaction was made through PIX.
The Indirect Participant cannot open a second Infraction Report for the same transaction, even if the first Report is already closed.
### Participant Cancels Infraction Report
After the Indirect Participant opens an Infraction Report, the Participant can request its cancellation , if necessary, regardless of its status.
### Participant Receives Infraction Report
In the incoming infraction flow, the receipt (status acknowledged) is done automatically by QI Tech, and the webhook will be sent to the Indirect Participant with the received infraction.
In the outgoing flow, the receipt of a report by the counterparty does not result in an internal status update, as this action does not result in an Infraction entity change.
The Indirect Participant will receive the Infraction Report with the status of acknowledged
### Participant Closes Infraction Report
After the Indirect Participant is informed that there is an Infraction Report with the status of acknowledged , they must close it.
The Indirect Participant must inform, upon closure, the result of the analysis, being able to reject the Infraction Report or accept it within 6 calendar days from the receipt webhook. After this period, if there is no response, it will be automatically accepted by QI Tech to maintain commitment with BACEN and SPI response times.
## Infraction_Report_Direction State Machine Control
| Enumerator | Translation | Description|
|---|---|---|
| incoming | incoming | The Indirect Participant received the Infraction Report from another Participant.
| outgoing | outgoing | The Indirect Participant sent the Infraction Report to another Participant.
## Indirect Participant Receives/Closes Infraction Report
In this case, the "infraction_report_direction" field will be "incoming".
## Indirect Participant Sends/Cancels Infraction Report
In this case, the "infraction_report_direction" field will be "outgoing".
It is emphasized that none of these fields will be sent by the Indirect Participant. They are only contained in the request response.

---

# Scenario Simulation

URL: /en/documentation/pix_indireto/relato_de_infracao/simulacao_de_cenarios

Step-by-step guide to simulate the completion of actions performed by external agents. These simulations include the receipt and updates of infraction reports.
:::info Information
There is no payload response (response body) for these requests, only a response status of 204. The content generated by the mock should be received via webhook.
:::
## 1 - Simulating the Receipt of an Infraction Report
Simulates the receipt of an infraction report opened by another institution.

:::info IMPORTANT
It is essential to have a valid pix_transfer_key to send the request, regardless of the information from the other party of the transfer, as all information from the second participant will be replaced in the mock process.
:::

### Request

ENDPOINT /mock/pix/infraction_report
METHOD POST

Request Body

```json
{
  "infraction_report_status": "acknowledged",
  "pix_transfer_key": "28290ff2-2ba7-4e85-9a5e-862c92259b33",
  "infraction_report_type": "refund_request",
  "infraction_report_situation": "scam",
  "infraction_report_details": "Transação com suspeita de fraude.",
}
```

### Object Request Body
| Field                           | Type   | Description                                                            | Max. Characters |
|---------------------------------|--------|------------------------------------------------------------------------|-----------------|
| **infraction_report_status***   | string | Status of receipt of the infraction report. "acknowledged".            | **[Enumerators infraction_report_status](#enumeradores-infraction_report_status)** |
| **pix_transfer_key***           | string | UUID4, unique key identifying the related transaction.                 | 36              |
| **infraction_report_type***     | string | Type of Infraction Report                                              | **[Enumerators infraction_report_type](#enumeradores-infraction_report_type)** |
| **infraction_report_situation***| string | Situation in which the infraction occurred                             | **[Enumerators infraction_report_situation](#enumeradores-infraction_report_situation)** |
| **infraction_report_details***  | string | Details of the infraction report                                       | 2000            |

### Enumerators infraction_report_status
| Field         | Type   | Description                                                                 | Characters |
| --------------|--------|---------------------------------------------------------------------------- |------------|
| `open`        | string | Infraction report was <strong>created</strong> and is open at BACEN.         | -          |
| `acknowledged`| string | Infraction report was <strong>received</strong> by the participant           | -          |
| `cancelled`   | string | Infraction report is <strong>cancelled</strong> at BACEN                     | -          |
| `closed`      | string | Infraction report is <strong>closed</strong> at BACEN                        | -          |

### Enumerators infraction_report_type
| Field              | Type   | Description                                                             | Characters |
| ------------------ |--------|-------------------------------------------------------------------------|------------|
| `refund_request`   | string | Infraction report will be generated to request a refund.                | -          |
| `refund_cancelled` | string | Infraction report will be generated due to a cancelled refund.          | -          |

### Enumerators infraction_report_situation
| Field             | Type   | Description                                               | Characters |
| ------------------- |--------|-------------------------------------------------------|------------|
| `scam`             | string | Cause of scam or fraud.                                  | -          |
| `account_takeover` | string | Cause of unauthorized transaction from the origin account. | -    |
| `coercion`         | string | Cause of coercion crime.                                  | -          |
| `fraudulent_access`| string | Cause of fraudulent access to the origin account.     | -          |
| `other`            | string | Any causes not applicable to those listed above.     | -          |

## 2 - Simulating the Update of an Infraction Report
Simulates the status update of an infraction report opened by the indirect participant.
The simulation options for updating an infraction report are:
1 - Cancellation: Simulates the cancellation (cancel), made by the other participant, of an infraction report previously opened by themselves.

2 - Closure: Simulates the closure (close), made by the other participant, of an infraction report opened by the indirect participant.

### Request

ENDPOINT /mock/pix/infraction_report
METHOD PATCH

Request Body - Cancel

:::info IMPORTANT
The Infraction Report identified by the infraction_report_key must have been previously created in the simulation of receiving an infraction report.
:::

```json
{
  "infraction_report_status": "cancelled",
  "infraction_report_key": "28290ff2-2ba7-4e85-9a5e-862c92259b34"
}
```

Request Body - Closing

:::info IMPORTANT
The Infraction Report identified by the infraction_report_key must have been previously created by the indirect participant and acknowledged in the simulation of updating an infraction report.
:::

```json
{
  "infraction_report_status": "closed",
  "infraction_report_key": "28290ff2-2ba7-4e85-9a5e-862c92259b34",
  "analysis_result": "agreed",
  "analysis_details": "Valor bloqueado. Para mais informações ligue para (99) 99999-9999."
}
```

### Object Request Body
| Field                        | Type   | Description                                                          | Max. Characters | Information                          |
|------------------------------|--------|----------------------------------------------------------------------|-----------------|---------------------------------------|
| **infraction_report_status***| string | New status of the infraction report. "cancelled", "closed"           | **[Enumerators infraction_report_status](#enumeradores-infraction_report_status)** | ---- |
| **infraction_report_key***   | string | Unique key of the infraction report                                  | 36              | ----                                  |
| **analysis_result***         | string | Result of the infraction report analysis. "agreed" or "disagreed"    | **[Enumerators analysis_result](#enumeradores-analysis_result)** | Mandatory for status "closed" |
| **analysis_details***        | string | Details of the infraction report analysis.                           | 2000            | Mandatory for status "closed"         |

### Enumerators analysis_result
| Field       | Type   | Description                                                                          | Characters |
| ----------- | ------ |--------------------------------------------------------------------------------------|------------|
| `agreed`    | string | The Indirect Participant <strong>agrees</strong> with the Infraction Report created by the other Participant. | -          |
| `disagreed` | string | The Indirect Participant <strong>disagrees</strong> with the Infraction Report created by the other Participant. | -          |

---

# Receive Infraction Report

URL: /en/documentation/pix_indireto/relato_de_infracao/webhooks_relato_infracao

Since another Participant may open an Infraction Report targeting the Indirect Participant, it is necessary for QI Tech to notify the Indirect Participant about the report opened by the other Participant.

QI Tech will periodically poll for new reports opened to the Indirect Participants it manages and will notify the corresponding participant via webhook , already with the status acknowledged.
:::danger IMPORTANT
The Central Bank of Brazil requires that, within a period of 7 days from the receipt of the Infraction Report by the Indirect Participant, the Report must be closed .
If there is a delay on the part of the Indirect Participant, QI Tech will close the Infraction Report with the status of agreed, 6 calendar days after sending the receipt of infraction webhook, to ensure the institution is not penalized by the Central Bank of Brazil.
:::
The status of the Infraction Report will always be acknowledged , meaning that QI Tech has received the Report and will forward it to the Indirect Participant.
:::info Information
Everything described in this introduction section is also detailed in the sections related to Infraction Notifications on how the Indirect Participant should handle it via API.
:::
## Webhook for Receiving Infraction Report
**Request Body**

```json
{
    "infraction_report_key":"d7820e2f-1c23-4610-83d6-d9aad1845075",
    "pix_transfer_key":"cdcf0d25-08a1-46e3-902a-6d7ca75e6c48",
    "end_to_end_id":"E99999010202406251332F8n7dMUwOLE",
    "infraction_report_status":"acknowledged",
    "infraction_report_situation":"scam",
    "infraction_report_type":"refund_request",
    "report_details":"usuario caiu em golpe…",
    "debited_participant":"99999011",
    "credited_participant":"99999010",
    "infraction_report_direction": "incoming",
    "created_at": "2023-03-03T12:04:06.179Z",
    "updated_at": "2023-03-03T12:04:06.179Z"
}
```

### Body Params
| Field                         | Type   | Description                                                              | Characters |
|-------------------------------|--------|--------------------------------------------------------------------------|------------|
| `infraction_report_key` *     | string | Unique identifier of the infraction report.                              | 36         |
| `pix_transfer_key` *          | string | Unique identifier of the PIX transaction.                                | 36         |
| `end_to_end_id` *             | string | Unique identifier of the PIX transaction at BACEN.                       | 36         |
| `infraction_report_status` *  | enum   | Status.                                                                  | **[Enumerators infraction_report_status](#enumeradores-infraction_report_status)** |
| `infraction_report_situation` *| enum   | Situation in which the infraction occurred.                              | **[Enumerators infraction_report_situation](#enumeradores-infraction_report_situation)** |
| `infraction_report_type` *    | enum   | Type of Infraction Report.                                               | **[Enumerators infraction_report_type](#enumeradores-infraction_report_type)** |
| `infraction_report_details`   | string | Details about the created Infraction Report.                             | Less or equal 2000    |
| `credited_participant` *      | string | ISPB of the Credited Participant.                                        | 8          |
| `debited_participant` *       | string | ISPB of the Debited Participant.                                         | 8          |
| `infraction_report_direction` * | enum | Enumerator on whether the report was opened by the Indirect Participant or another Participant | **[Enumerators infraction_report_direction](#enumeradores-infraction_report_direction)** |
| `created_at` *                | string | Infraction Report creation time.                                         | 24         |
| `updated_at`                  | string | Infraction Report update time.                                           | 24         |

### Enumerators infraction_report_status
| Field          | Type   | Description                                                                     | Characters |
| -------------- | ------ | ------------------------------------------------------------------------------- |------------|
| `open`         | string | Infraction report was <strong>created</strong> and is open at BACEN.            | -          |
| `acknowledged` | string | Infraction report was <strong>received</strong> by the contested participant.   | -          |
| `cancelled`    | string | Infraction report is <strong>cancelled</strong> at BACEN.                       | -          |
| `closed`       | string | Infraction report is <strong>closed</strong> at BACEN.                          | -          |

### Enumerators infraction_report_type
| Field              | Type   | Description                                                                 | Characters |
| ------------------ | ------ | --------------------------------------------------------------------------- |------------|
| `refund_cancelled` | string | Infraction report will be generated due to a cancelled refund               | 16         |
| `refund_request`   | string | Infraction report will be generated to request a refund                     | 14         |

### Enumerators infraction_report_situation
| Field                | Type   | Description                                           | Characters |
| -------------------  | ------ | ------------------------------------------------------|------------|
| `scam`               | string | Cause of scam or fraud.                               | -          |
| `account_takeover`   | string | Cause of unauthorized transaction from the origin account. | -    |
| `coercion`           | string | Cause of coercion crime.                              | -          |
| `fraudulent_access`  | string | Cause of fraudulent access to the origin account.     | -          |
| `other`              | string | Any causes not applicable to those listed above.      | -          |

### Enumerators infraction_report_direction
| Field       | Type   | Description                                                  | Characters |
|-------------|--------|--------------------------------------------------------------|------------|
| `incoming`  | string | Infraction report with the indirect participant as the target.| -          |
| `outgoing`  | string | Infraction report with the indirect participant as the originator.| -       |

## Webhook recebimento de alteração de Relato de Infração
**Request Body**

```json
{
    "infraction_report_key":"d7820e2f-1c23-4610-83d6-d9aad1845075",
    "pix_transfer_key":"cdcf0d25-08a1-46e3-902a-6d7ca75e6c48",
    "end_to_end_id":"E99999010202406251332F8n7dMUwOLE",
    "infraction_report_status":"closed",
    "infraction_report_situation":"scam",
    "infraction_report_type":"refund_request",
    "report_details":"usuario caiu em golpe…",
    "debited_participant":"99999011",
    "credited_participant":"99999010",
    "analysis_result": "agreed",
    "analysis_details": "Valor bloqueado. Para mais informações ligue para (11) 98871-1385.",
    "infraction_report_direction": "outgoing",
    "created_at": "2023-03-03T12:04:06.179Z",
    "updated_at": "2023-03-03T12:04:06.179Z"
}
```

### Body Params
| Field                         | Type   | Description                                                              | Characters |
|-------------------------------|--------|--------------------------------------------------------------------------|------------|
| `infraction_report_key` *     | string | Unique identifier of the infraction report.                              | 36         |
| `pix_transfer_key` *          | string | Unique identifier of the PIX transaction.                                | 36         |
| `end_to_end_id` *             | string | Unique identifier of the PIX transaction at BACEN.                       | 36         |
| `infraction_report_status` *  | enum   | Status.                                                                  | **[Enumerators infraction_report_status](#enumeradores-infraction_report_status)** |
| `infraction_report_situation` *| enum   | Situation in which the infraction occurred.                              | **[Enumerators infraction_report_situation](#enumeradores-infraction_report_situation)** |
| `infraction_report_type` *    | enum   | Type of Infraction Report.                                               | **[Enumerators infraction_report_type](#enumeradores-infraction_report_type)** |
| `infraction_report_details`   | string | Details about the created Infraction Report.                             | Less or equal 2000    |
| `credited_participant` *      | string | ISPB of the Credited Participant.                                        | 8          |
| `debited_participant` *       | string | ISPB of the Debited Participant.                                         | 8          |
| `analysis_result` *           | string | Result of the analysis.                                                  | **[Enumerators analysis_result](#enumeradores-analysis_result)** |
| `analysis_details` *          | string | Description of the analysis result                                       | 250        |
| `infraction_report_direction` * | enum | Enumerator on whether the report was opened by the Indirect Participant or another Participant | **[Enumerators infraction_report_direction](#enumeradores-infraction_report_direction)** |
| `created_at` *                | string | Infraction Report creation time.                                         | 24         |
| `updated_at`                  | string | Infraction Report update time.                                           | 24         |

### Enumerators analysis_result
| Field       | Type   | Description                                                              | Characters |
| ----------- | ------ | ------------------------------------------------------------------------ |------------|
| `agreed`    | string | The Indirect Participant <strong>agrees</strong> with the Infraction Report created by the other Participant. | -          |
| `disagreed` | string | The Indirect Participant <strong>disagrees</strong> with the Infraction Report created by the other Participant. | -          |

---

# Pix

URL: /en/documentation/pix_v2

## Realização de Transação Pix

### Request

ENDPOINT /account/ ACCOUNT_KEY /pix_transfer
MÉTODO POST

### Path Params

| Campo         | Tipo   | Descrição                              | Caracteres |
|---------------|--------|----------------------------------------|------------|
| `account_key` | uuidv4 | Chave única de identificação da conta. | 36         |

**Chave**

Request Body: Transferência por Chave Pix

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_type": "key",
  "target_pix_key": "target_pix_key@email.com",
  "transaction_amount": 500.65,
  "end_to_end_id": "E73856642202309201429bZKfklNlbwu",
  "pix_message": "Ola Mundo"
}
```

### Body Params

| Campo                   | Tipo       | Descrição                                                                                                                                                                                                                                        | Caracteres |
|-------------------------|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|
| `request_control_key` * | uuidv4     | Chave única de identificação da request utilizada pelo cliente no formato uuid v4.                                                                                                                                                               | 36         | 
| `pix_transfer_type` *   | enumerator | Tipo do pix a ser realizado. Para o caso de transferência por chave deve ser **key**.                                                                                                                                                            | "key"      |
| `target_pix_key` *      | string     | Chave pix da conta a ser enviada a transação.                                                                                                                                                                                                    | 100        |
| `transaction_amount` *  | number     | Valor da transferência.                                                                                                                                                                                                                          | 10         |
| `end_to_end_id` *       | string     | Chave de idempotência de uma transação Pix dentro do SPI (Sistema de Pagamento Instantâneo). Esta chave é retornada na consulta de chave Pix. Só deve ser enviado se o `pix_transfer_type` for **key**, **static_qr_code** ou **dynamic_qr_code** | 32         |
| `pix_message`           | string     | Mensagem a ser enviada junto à transferência Pix.                                                                                                                                                                                                | 140        |

**Manual**
Request Body: Transferência Manual

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_type": "manual",
  "target_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "12345678",
    "owner_document_number": "32402502000135",
    "owner_name": "Qi Tech",
    "account_type": "checking_account",
    "ispb": "32402502"
  },
  "transaction_amount": 500.65,
  "pix_message": "Ola Mundo"
}
```

### Body Params

| Campo                   | Tipo       | Descrição                                                                                         | Caracteres                                          |
|-------------------------|------------|---------------------------------------------------------------------------------------------------|-----------------------------------------------------|
| `request_control_key` * | uuidv4     | Chave única de identificação da request utilizada pelo cliente no formato uuid v4.                | 36                                                  | 
| `pix_transfer_type` *   | enumerator | Tipo de transferência Pix.                                                                        | **manual**                                          |
| `target_account` *      | Object     | Conta destino - Só deve ser enviada em transferências com `pix_transfer_type` do tipo **manual**. | **[Objeto target_account](#objeto-target_account)** | 10 |
| `transaction_amount` *  | number     | Valor da transferência.                                                                           | 10                                                  |
| `pix_message`           | string     | Mensagem a ser enviada junto à transferência Pix.                                                 | 140                                                 |

### Objeto target_account

| Campo                     | Tipo       | Descrição                                           | Caracteres                                              |
|---------------------------|------------|-----------------------------------------------------|---------------------------------------------------------|
| `account_branch` *        | string     | Agência da conta.                                   | 6                                                       |
| `account_digit` *         | string     | Dígito da conta.                                    | 1                                                       |
| `account_number` *        | string     | Número da conta.                                    | 20                                                      |
| `owner_document_number` * | string     | CPF ou CNPJ (apenas números) do titular da conta.   | 14                                                      |
| `owner_name` *            | string     | Nome do titular da conta.                           | 150                                                     |
| `account_type`*           | enumerator | Tipo da conta.                                      | **[Enumerador account_type](#enumerador-account_type)** |
| `ispb` *                  | string     | Base no CNPJ da instituição financeira (8 dígitos). | 8                                                       |

### Enumerador account_type

| Enumerador           | Descrição           |
|----------------------|---------------------|
| **checking_account** | Conta Corrente      |
| **salary_account**   | Conta Salário       |
| **saving_account**   | Conta Poupança      |
| **payment_account**  | Conta de Pagamentos |

**Qr Code**

Request Body: Transferência por Qr Code

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_type": "static_qr_code",
  "transaction_amount": 500.65,
  "end_to_end_id": "E73856642202309201429bZKfklNlbwu",
  "receiver_conciliation_id": "REC00000000000000000000009459463343",
  "target_pix_key": "target_pix_key@email.com",
  "pix_message": "Ola Mundo"
}
```

### Body Params

| Campo                      | Tipo       | Descrição                                                                                                                                                                                                                                         | Caracteres                                |
|----------------------------|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------|
| `request_control_key` *    | uuidv4     | Chave única de identificação da request utilizada pelo cliente no formato uuid v4.                                                                                                                                                                | 36                                        | 
| `pix_transfer_type` *      | enumerator | Tipo de transferência Pix.                                                                                                                                                                                                                        | **static_qr_code** ou **dynamic_qr_code** |
| `target_pix_key` *         | string     | Chave pix da conta a ser enviada a transação.                                                                                                                                                                                                     | 100                                       |
| `receiver_conciliation_id` | string     | Identicação de conciliação do recebedor.                                                                                                                                                                                                          | 35                                        |
| `transaction_amount` *     | number     | Valor da transferência.                                                                                                                                                                                                                           | 10                                        |
| `end_to_end_id` *          | string     | Chave de idempotência de uma transação Pix dentro do SPI (Sistema de Pagamento Instantâneo). Esta chave é retornada na consulta de chave Pix. Só deve ser enviado se o `pix_transfer_type` for **key**, **static_qr_code** ou **static_qr_code**. | 32                                        |
| `pix_message`              | string     | Mensagem a ser enviada junto à transferência Pix.                                                                                                                                                                                                 | 140                                       |

:::info Aviso
O `end_to_end_id` é retornado ao [decodificar o QR Code Pix](/documentation/pix/decodificar_qr_code), utilizando a URI
do Pix Copia e Cola.
:::

:::danger Aviso
O `end_to_end_id` da consulta deve ter sido feito em nome da conta que solicitará a movimentação!
:::

:::danger Aviso
Um `end_to_end_id` só pode ser utilizado para uma única transferência, não importando, se a transferência tenha sido bem
sucedida ou não.
:::

### Response

STATUS 201

Response Body: Transferência Enviada

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "pix_transfer_status": "sent",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

STATUS 202

Response Body: Transferência Pendente

```json
{
  "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "pix_transfer_status": "pending",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

:::info Informação
Caso seja retornado **HTTP Status 202** com o campo `pix_transfer_status` com valor **pending**, a solicitação de Pix
não deve ser retentada.

Esta transferência será reprocessada. É necessário verificar o status da transferência por meio
da [Consulta de Transferência Pix](#consultar-transação-pix).
:::

STATUS 4xx

Response Body: Transferência Rejeitada

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {
    "pix_transfer_data": {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "pix_transfer_status": "rejected",
      "created_at": "2021-10-22T20:30:23.459Z"
    }
  }
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| Código HTTP<br/>`status` | Código QI<br/>`code` | Título<br/>`title`                                 | Descrição (eng)<br/>`description`                                                                                       | Descrição (ptbr)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Erro de Schema                                                                                                         |
| 406                      | PXT000103            | request_control_key must be a valid uuid v4 string | request_control_key was not accepted for not being a valid uuid v4 string                                               | request_control_key não foi aceito por não ser uma palavra uuid v4 válida                                              |
| 400                      | PXT000048            | Bad Request                                        | Emoji not allowed in pix message.                                                                                       | Emoji não é permitido na mensagem pix.                                                                                 |
| 400                      | PXT000104            | Invalid Transaction Amount                         | Transaction amount of \{transaction_amount\} is not valid. It must be a positive value with at maximum 2 decimal places | O valor de transação \{transaction_amount\} não é válido. Deve ser um valor positivo com no máximo duas casas decimais |
| 404                      | PXT000004            | Account not found                                  | Account not found for: \{account_datum\}                                                                                | Conta não encontrada para: \{account_datum\}                                                                           |
| 400                      | PXT000003            | Account is Closed                                  | Account \{account_key\} is closed.                                                                                      | Conta \{account_key\} está fechada.                                                                                    |
| 422                      | PXT000092            | Invalid Account Type                               | Pix is not yet implemented for non-checking or non-escrow account types                                                 | Transações Pix não estão implementadas para conta que não sejam escrow ou livres                                       |
| 403                      | PIT000001            | User is not allowed to do this transaction         |                                                                                                                         | Usuário não tem autorização para fazer essa transação                                                                  |
| 400                      | PXT000010            | Account is Blocked                                 | Account \{account_key\} is blocked.                                                                                     | Conta \{account_key\} está bloqueada.                                                                                  |
| 400                      | PXT000003            | Account is Closed                                  | Account \{account_key\} is closed.                                                                                      | Conta \{account_key\} está fechada.                                                                                    |
| 400                      | PIT000003            | Bad Request                                        | Insufficient account balance for transfer and fee amount.                                                               | Saldo de conta insuficiente para a transferência e a taxa.                                                             |
| 400                      | PXT000118            | Requester is not Pix Participant                   | The requester sent an alias key but is not a indirect pix participant                                                   | O requisitante enviou uma alias key no entanto não é um participante do pix indireto                                   |
| 404                      | PXT000120            | Alias sent not found                               | Alias key attached to this account not found                                                                            | Alias key vinculada à conta não encontrada                                                                             |
| 406                      | PXT000105            | Invalid end_to_end_id                              | The end_to_end_id sent \{end_to_end_id\} is not valid.                                                                  | O end_to_end_id enviado \{end_to_end_id\} não é válido.                                                                |
| 400                      | PXT000108            | Bad Request                                        | Billing account closed or blocked                                                                                       | Conta de cobrança encerrada ou bloqueada                                                                               |
| 400                      | PXT000079            | Bad Request                                        | Insufficient billing account balance for fee.                                                                           | Saldo de conta de cobrança insuficiente para a taxa.                                                                   |
| 400                      | PIT000004            | Bad Request                                        | Transaction amount is over limit.                                                                                       | O total da transferência é superior ao limite.                                                                         |
| 404                      | PIX000056            | Not Found                                          | Pix key inquiry not found                                                                                               | Consulta de chave pix não encontrada                                                                                   |
| 404                      | PXT000041            | Not Found                                          | Qr Code not found                                                                                                       | Qr Code não encontrado                                                                                                 |
| 400                      | PXT000053            | Bad Request                                        | QrCode already paid                                                                                                     | Qr Code já Pago                                                                                                        |
| 400                      | PXT000118            | Requester is not Pix Participant                   | The requester sent an alias key but is not a indirect pix participant                                                   | O requisitante enviou uma alias key no entanto não é um participante do pix indireto                                   |
| 404                      | PXT000120            | Alias sent not found                               | Alias key attached to this account not found                                                                            | Alias key vinculada à conta não encontrada                                                                             |
| 400                      | PXT000115            | Bad Request                                        | Insufficient account balance for transfer and fee amount.                                                               | Saldo de conta insuficiente para a transferência e a taxa                                                              |
| 400                      | PXT000128            | Bad Request                                        | Pix key \{pix_key\} sent does match inquiry pix key. Verify if end_to_end_id sent is correct                            | Chave Pix \{pix_key\} enviada não condiz com consulta. Verifique se end_to_end_id enviado está correto                 |
| 409                      | PXT000109            | Bad Request                                        | request_control_key \{request_control_key\} already in use                                                              | request_control_key \{request_control_key\} já utilizada                                                               |
| 400                      | PXT000061            | Bad Request                                        | End to end id invalid. A pix transfer with the end to end id \{end_to_end\} has already been registered!                | End to end id inválido. Uma transação pix com o identificador único \{end_to_end\} já foi registrada!                  |
| 400                      | PXT000129            | SPI Error message                                  | Message rejected by SPI-ICOM                                                                                            | Mensagem rejeitada pela SPI-ICOM                                                                                       |
| 408                      | PXT000130            | SPI Timeout Control                                | SPI Timeout Control                                                                                                     | Controle de timeout no SPI                                                                                             |
| 400                      | PXT000131            | Receiver Internal Error                            | Cancelled transaction due to receiver's internal error                                                                  | Transação interrompida devido a erro no PSP do Recebedor                                                               |
| 400                      | PXT000132            | Invalid Target Account Number                      | Target account number is invalid                                                                                        | Número da conta de destino é inexistente ou inválido                                                                   |
| 400                      | PXT000133            | Blocked Target Account                             | Target account is blocked.                                                                                              | A conta de destino encontra-se bloqueada.                                                                              |
| 400                      | PXT000134            | Closed Target Account                              | Target account is closed.                                                                                               | A conta de destino encontra-se encerrada.                                                                              |
| 400                      | PXT000135            | Unsupported Transaction                            | Unsupported transaction for given target account.                                                                       | A conta de destino não suporta este tipo de transação.                                                                 |
| 400                      | PXT000136            | Invalid Participant                                | SPI participant is not PSP settler agent of payer nor receiver.                                                         | Participante direto do SPI não é liquidante do PSP do Pagador / Recebedor.                                             |
| 400                      | PXT000137            | Zero Value Payment Order                           | Zero value payment order.                                                                                               | Ordem de pagamento com valor zero.                                                                                     |
| 400                      | PXT000138            | Insufficient Funds                                 | Insufficient funds in PI account from payer.                                                                            | Saldo insuficiente na conta PI do pagador.                                                                             |
| 400                      | PXT000139            | Return Value Too Great                             | Return value greater than corresponding payment order.                                                                  | Valor de devolução acima do valor de pagamento correspondente.                                                         |
| 400                      | PXT000140            | Invalid Transactions Number                        | Invalid transactions number.                                                                                            | Quantidade de transações inválida.                                                                                     |
| 400                      | PXT000141            | Unrelated Beneficiary Document Number              | Beneficiary document number is not that of target account owner.                                                        | CPF/CNPJ do usuário recebedor não é compatível com o titular da conta de destino.                                      |
| 400                      | PXT000142            | Invalid Beneficiary Document Number                | Invalid beneficiary document number                                                                                     | CPF/CNPJ da conta de destino está incorreto.                                                                           |
| 400                      | PXT000143            | Incorrect Message Element                          | Incorrect message element.                                                                                              | Elemento da mensagem incorreto.                                                                                        |
| 403                      | PXT000144            | Rejected Payment Order                             | Beneficiary's PSP has rejected payment order.                                                                           | Ordem de pagamento foi rejeitada pelo banco recebedor.                                                                 |
| 403                      | PXT000145            | Unauthorized Payer                                 | Signing participant is unauthorized to make a payment order for paying account.                                         | Participante que assinou a mensagem não é autorizado a realizar a operação na conta PI debitada.                       |
| 400                      | PXT000146            | Invalid Datetime                                   | Invalid datetime for message delivery.                                                                                  | Data e Hora do envio da mensagem inválida.                                                                             |
| 400                      | PXT000147            | Generic Error                                      | Error while processing payment (generic error).                                                                         | Erro no processamento do pagamento (erro genérico).                                                                    |
| 400                      | PXT000148            | Bad Format Operation Identifier                    | Badly formatted operation's identifier.                                                                                 | Identificador da operação mal formatado.                                                                               |
| 400                      | PXT000149            | Invalid Payer ISPB                                 | Invalid or non-existent payer's PSP ISPB number.                                                                        | Número ISPB do PSP do Pagador é inválido ou inexistente.                                                               |
| 400                      | PXT000150            | Invalid Beneficiary ISPB                           | Invalid or non-existent beneficiary's PSP ISPB number.                                                                  | Número ISPB do banco recebedor é inválido ou inexistente.                                                              |
| 400                      | PXT000151            | Incorrect Type                                     | Incorrect type for target account.                                                                                      | Tipo incorreto para a conta transacional especificada.                                                                 |
| 400                      | PXT000152            | Repeated End-to-End ID Error                       | The end_to_end_id was already used                                                                                      | O end_to_end_id já foi utilizado                                                                                       |
| 400                      | PXT000153            | Invalid Target Account Type                        | The target account type cannot receive PIX transactions                                                                 | O tipo de conta destino não pode receber transações PIX                                                                |
| 400                      | PXT000154            | Invalid ISPB                                       | Invalid or non-existent ISPB number.                                                                                    | Número ISPB é inválido ou inexistente.                                                                                 |
| 400                      | PXT000155            | Amount too Great                                   | Amount too great for credited account.                                                                                  | Valor de pagamento/devolução acima do permitido para a conta de destino creditada.                                     |
| 400                      | PXT000156            | QR Code Rejected                                   | QR Code rejected by beneficiary's PSP.                                                                                  | QR Code rejeitado pelo PSP do usuário recebedor.                                                                       |
| 503                      | PXT000157            | Bacen Service Unavailable Error                    | Could not send the message to ICOM after 3 retries                                                                      | Não pode enviar a mensagem para a ICOM depois de 3 tentativas                                                          |
| 400                      | PXT000158            | Invalid Amount                                     | Paid amount diverges from expected amount of \{expected_amount\}                                                        | O valor do pagamento diverge do valor esperado de \{expected_amount\}                                                  |
| 400                      | PXT000159            | QR code inactive                                   | QR code is not active at the time of payment                                                                            | QR code não está ativo no instante do pagamento                                                                        |

[//]: # (Break here for new page -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------)

## Consulta de Chave Pix no Banco Central

### Request

ENDPOINT /pix_key/ PIX_KEY ?account_key= ACCOUNT_KEY
MÉTODO GET

### Path Params

| Campo       | Tipo   | Descrição                      | Caracteres |
|-------------|--------|--------------------------------|------------|
| `pix_key` * | string | Chave Pix que será consultada. | 77         |

:::info Tipos de Chave Pix
A `pix_key` pode ser um CPF, CNPJ, E-mail, Celular ou uma Chave Aleatória (UUID), seguindo as seguintes formatações:

**CPF**: Número inteiro com 11 dígitos.

**CNPJ**: Número inteiro com 14 dígitos.

**E-mail**: Texto contendo ao menos um “@”.

**Celular**: Texto contendo os seguintes valores: “+55” + “DDD do celular“ + “Número Inteiro do Celular com no mínimo 8
e no máximo 9 dígitos”. Ex: “+5511987654321“.

**Chave Aleatória**: UUID4.
:::

### Query Params

| Campo           | Tipo   | Descrição                              | Caracteres |
|-----------------|--------|----------------------------------------|------------|
| `account_key` * | uuidv4 | Chave única de identificação da conta. | 36         |

:::info Utilização de tokens de consulta
Para que o token de consulta de chave pix seja cobrado da pessoa correta, é obrigatório que o `account_key` seja
enviado.
:::

### Response

STATUS 200

Response Body: Chave Ativa

```json
{
  "account_branch": "0001",
  "account_created_at": "2023-09-06T22:03:34.000Z",
  "account_digit": "8",
  "account_number": "2897775",
  "account_type": "checking",
  "bank_code": null,
  "end_to_end_id": "E73856642202309201429bZKfklNlbwu",
  "financial_institution": "BANCO INDIRETO PRUPRU",
  "ispb": "32402502",
  "owner_masked_document_number": "**.458.****/0001-**",
  "owner_name": "Empresa teste 01",
  "owner_person_type": "legal",
  "owner_trading_name": null,
  "pix_key": "0f723f66-b333-4187-be16-97fc37c86052"
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| Código HTTP<br/>`status` | Código QI<br/>`code` | Título<br/>`title`      | Descrição (eng)<br/>`description`         | Descrição (ptbr)<br/>`translation`               |
|--------------------------|----------------------|-------------------------|-------------------------------------------|--------------------------------------------------|
| 404                      | PIX000017            | Pix Key is Unregistered | Pix key \{pix_key\} is not currently used | A chave pix \{pix_key\} não está sendo utilizada |
| 400                      | PIX000081            | Rate Limit Exceeded     | Rate Limit Exceeded                       | Limite de requisições excedido                   |

[//]: # (Break here for new page -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------)

## Efetuar devolução de um Pix

A devolução de um Pix pode ser efetuada em até 90 dias a partir de seu recebimento.

### Request

ENDPOINT /account/ ACCOUNT_KEY /pix_transfer/ PIX_TRANSFER_KEY /reversal
MÉTODO POST

### Path Params

| Campo                | Tipo   | Descrição                                                        | Caracteres |
|----------------------|--------|------------------------------------------------------------------|------------|
| `account_key` *      | uuidv4 | Chave única de identificação da conta.                           | 36         |
| `pix_transfer_key` * | uuidv4 | Chave única de identificação da transferência Pix no sistema QI. | 36         |

Request Body

```json
{
  "request_control_key": "303393bf-8f2e-4ff0-b326-ee7ad612e8ca",
  "reversal_amount": 147,
  "reversal_reason": "client_request",
  "reversal_message": "Mensagem Pix da Devolução"
}
```

### Request Body

| Campo                   | Tipo   | Descrição                         | Caracteres                                                    |
|-------------------------|--------|-----------------------------------|---------------------------------------------------------------|
| `request_control_key` * | uuidv4 | Chave de unicidade da requisição. | 36                                                            |
| `reversal_amount` *     | number | Valor da devolução.               | 11                                                            |
| `reversal_reason` *     | string | Motivo da devolução.              | **[Enumerador reversal_reason](#enumerador-reversal_reason)** |
| `reversal_message`      | string | Mensagem da devolução.            | 140                                                           |

### Enumerador reversal_reason

| Enumerador         | Descrição                                     |
|--------------------|-----------------------------------------------|
| **client_request** | Caso tenha sido requerido pelo dono da conta. |
| **reconciliation** | Para reconciliação devido a erro operacional. |

### Response

STATUS 201

Response Body: Reversão Enviada

```json
{
  "reversal_status": "sent",
  "transfer_amount": 147,
  "pix_transfer_key": "cdcf0d25-08a1-46e3-902a-6d7ca75e6c48",
  "end_to_end_id": "E32402502202407112211Id9JbxoaiTf",
  "request_control_key": "7c5a1425-73eb-420e-b4fb-0ce3386c7d0c",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

STATUS 202

Response Body: Reversão Pendente

```json
{
  "reversal_status": "pending",
  "transfer_amount": 147,
  "pix_transfer_key": "cdcf0d25-08a1-46e3-902a-6d7ca75e6c48",
  "end_to_end_id": "E32402502202407112211Id9JbxoaiTf",
  "request_control_key": "7c5a1425-73eb-420e-b4fb-0ce3386c7d0c",
  "created_at": "2021-10-22T20:30:23.459Z"
}
```

:::info Informação
Caso seja retornado **HTTP Status 202** com o campo `pix_transfer_status` com valor **pending**, a solicitação de Pix
não deve ser retentada.

Esta transferência será reprocessada. É necessário verificar o status da transferência por meio
da [Consulta de Transferência Pix](#consultar-transação-pix).
:::

### Response Body

| Campo                 | Tipo       | Descrição                                                                                   | Caracteres                                                |
|-----------------------|------------|---------------------------------------------------------------------------------------------|-----------------------------------------------------------|
| `reversal_status`     | enumerator | Enumerador de status da transação de devolução.                                             | [Enumerador reversal_status](#enumerador-reversal_status) |
| `transfer_amount`     | number     | Valor da transferência de devolução.                                                        | 11                                                        |
| `pix_transfer_key`    | uuidv4     | Chave da transação pix executada na devolução.                                              | 36                                                        |
| `end_to_end_id`       | string     | Chave de idempotência de uma transação Pix dentro do SPI (Sistema de Pagamento Instantâneo) | 32                                                        |
| `request_control_key` | uuidv4     | Chave única de identificação da request utilizada pelo cliente.                             | 36                                                        |
| `created_at`          | string     | Data e hora da devolução.                                                                   | 10                                                        |

### Enumerador reversal_status

| Enumerador   | Descrição                                |
|--------------|------------------------------------------|
| **sent**     | Transferência Pix realizada com sucesso. |
| **pending**  | Transferência Pix pendente.              |
| **rejected** | Transferência Pix rejeitada.             |

STATUS 4xx

Response Body: Reversão Rejeitada

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {
    "pix_transfer_data": {
      "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
      "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "pix_transfer_status": "rejected",
      "created_at": "2021-10-22T20:30:23.459Z"
    }
  }
}
```

:::info Informação
Além dos erros anteriormente listados para transferências Pix, a devolução de um Pix também pode retornar os erros
listados abaixo.
:::

| Código HTTP<br/>`status` | Código QI<br/>`code` | Título<br/>`title`                   | Descrição (eng)<br/>`description`                                      | Descrição (ptbr)<br/>`translation`                                                        |
|--------------------------|----------------------|--------------------------------------|------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                          | Schema Error                                                           | Erro de Schema                                                                            |
| 404                      | PXT000018            | Reversal Original Transfer not Found | Reversal original pix transfer not found.                              | Transferência original da devolução não foi encontrada.                                   |
| 400                      | PXT000017            | Reversal Too Great                   | Reversal transfers sum amount surpasses that of original pix transfer. | A soma das transferências de devolução ultrapassam o valor da transferência pix original. |
| 400                      | PXT000015            | Reversal date expired                | Reversal original transaction is older than 90 days                    | A data de criação da transação original é mais antiga que 90 dias                         |
| 400                      | PXT0000127           | Invalid Reversal Reason              | Reversal reason \{reversal_reason\} is not valid                       | Razão de reversão \{reversal_reason\} não é válida                                        |

[//]: # (Break here for new page -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------)

## Consultar Transação Pix por pix_transfer_key

### Request

ENDPOINT /account/ ACCOUNT_KEY /pix_transfer/ PIX_TRANSFER_KEY / PIX_TRANSFER_DIRECTION
MÉTODO GET

### Path Params

| Campo                      | Tipo       | Descrição                                             | Caracteres                                                                  |
|----------------------------|------------|-------------------------------------------------------|-----------------------------------------------------------------------------|
| `pix_transfer_direction` * | enumerator | Indicador do sentido da transação (entrada ou saída). | [Enumeradores pix_transfer_direction](#enumeradores-pix_transfer_direction) |
| `account_key` *            | uuidv4     | Chave única de identificação da conta QI.             | 36                                                                          |
| `pix_transfer_key` *       | uuidv4     | Chave única de identificação da transferência Pix.    | 36                                                                          |

### Enumeradores pix_transfer_direction

| Enumerador   | Descrição                                |
|--------------|------------------------------------------|
| **incoming** | Transferência Pix realizada com sucesso. |
| **outgoing** | Transferência Pix realizada com sucesso. |

### Response

STATUS 201

Response Body: Transferência Enviada (outgoing)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_message": "Bom dia",
  "pix_transfer_type": "manual",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "updated_at": "2021-10-22T20:30:23.459Z",
  "created_at": "2021-10-22T20:30:23.459Z",
  "target_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "12345678",
    "owner_document_number": "***02502000***",
    "owner_person_type": "legal",
    "owner_name": "Qi Tech",
    "account_type": "checking_account",
    "ispb": "32402502",
    "pix_key": null
  },
  "receiver_conciliation_id": null,
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "end_to_end_id": "E3240250220211022203051750897529",
  "pix_transfer_status": "sent",
  "transfer_amount": 126.97,
  "fee_amount": 0.0,
  "rejection_reason": null,
  "reversals": [
    {
      "end_to_end_id": "D35713491202309182058jlqdBkkHSWU",
      "transfer_amount": 0.01,
      "reversal_reason": "client_request",
      "pix_transfer_status": "received",
      "pix_transfer_key": "423866cd-0f3f-4cdd-904b-0d2e33273afd",
      "request_control_key": "7c5a1425-73eb-420e-b4fb-0ce3386c7d0a",
      "created_at": "2021-10-23T20:30.459Z"
    }
  ]
}

```

Response Body: Transferência Rejeitada (outgoing)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_message": "Bom dia",
  "pix_transfer_type": "manual",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "updated_at": "2021-10-22T20:30:23.459Z",
  "created_at": "2021-10-22T20:30:23.459Z",
  "target_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "12345678",
    "owner_document_number": "***02502000***",
    "owner_person_type": "legal",
    "owner_name": "Qi Tech",
    "account_type": "checking_account",
    "ispb": "32402502",
    "pix_key": null
  },
  "receiver_conciliation_id": null,
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "end_to_end_id": "E3240250220211022203051750897529",
  "pix_transfer_status": "rejected",
  "transfer_amount": 126.97,
  "fee_amount": 0.0,
  "error_code": "PXT000132",
  "error_description": "Target account number is invalid.",
  "error_translation": "Número da conta de destino é inexistente ou inválido.",
  "reversals": []
}

```

Response Body: Devolução Enviada (outgoing)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_message": "Bom dia",
  "pix_transfer_type": "reversal",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "updated_at": "2021-10-22T20:30:23.459Z",
  "created_at": "2021-10-22T20:30:23.459Z",
  "target_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "12345678",
    "owner_document_number": "***02502000***",
    "owner_person_type": "legal",
    "owner_name": "Qi Tech",
    "account_type": "checking_account",
    "ispb": "32402502",
    "pix_key": null
  },
  "receiver_conciliation_id": null,
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "end_to_end_id": "E3240250220211022203051750897529",
  "pix_transfer_status": "sent",
  "transfer_amount": 126.97,
  "fee_amount": 0.0,
  "rejection_reason": null,
  "reversals": [],
  "original_incoming_pix_transfer": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3"
}

```

Response Body: Transferência Recebida (incoming)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "end_to_end_id": "E18236120202308111235s14fddf2801",
  "pix_transfer_status": "received",
  "receiver_conciliation_id": "745c28c780bc4822bbade86dd875d10b",
  "transfer_amount": 126.97,
  "fee_amount": 0.0,
  "source_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "12345678",
    "owner_document_number": "***02502000***",
    "owner_person_type": "legal",
    "owner_name": "Qi Tech",
    "account_type": "checking_account",
    "ispb": "32402502"
  },
  "pix_transfer_type": "dynamic_qr_code",
  "reversals": []
}
```

Response Body: Devolução Recebida (incoming)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "end_to_end_id": "E18236120202308111235s14fddf2801",
  "pix_transfer_status": "received",
  "receiver_conciliation_id": "745c28c780bc4822bbade86dd875d10b",
  "transfer_amount": 126.97,
  "fee_amount": 0.0,
  "source_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "12345678",
    "owner_document_number": "***02502000***",
    "owner_person_type": "legal",
    "owner_name": "Qi Tech",
    "account_type": "checking_account",
    "ispb": "32402502"
  },
  "pix_transfer_type": "reversal",
  "reversals": [],
  "original_outgoing_pix_transfer": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3"
}
```

Response Body: Transferência Rejeitada (incoming)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "end_to_end_id": "E18236120202308111235s14fddf2801",
  "pix_transfer_status": "rejected",
  "receiver_conciliation_id": "745c28c780bc4822bbade86dd875d10b",
  "transfer_amount": 126.97,
  "fee_amount": 0.0,
  "source_account": {
    "account_branch": "0001",
    "account_digit": "3",
    "account_number": "12345678",
    "owner_document_number": "***02502000***",
    "owner_person_type": "legal",
    "owner_name": "Qi Tech",
    "account_type": "checking_account",
    "ispb": "32402502"
  },
  "pix_transfer_type": "dynamic_qr_code",
  "reversals": []
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| Código HTTP | Código QI<br/>`code` | Título<br/>`title`                          | Descrição (eng)<br/>`Description`                   | Descrição (ptbr)<br/>`translation`                                            |
|-------------|----------------------|---------------------------------------------|-----------------------------------------------------|-------------------------------------------------------------------------------|
| 400         | PXT000075            | Pix Transfer Key or End To End Not Provided | No pix transfer key or end to end id provided.      | Não foram fornecidos uma pix transfer key ou end to end id.                   |
| 404         | PXT000023            | Outgoing PIX Transfer Not Found             | Pix transfer key \{pix_transfer_key\} was not found | Transferência PIX de saída com chave \{pix_transfer_key\} não foi encontrada. |
| 403         | PIT000001            | User is not allowed to do this transaction  | User is not allowed to do this transaction          | Usuário não tem autorização para fazer essa transação                         |

[//]: # (Break here for new page -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------)

## Consultar Transações Pix

### Request

ENDPOINT /account/ ACCOUNT_KEY /pix_transfers
MÉTODO GET

### Path Params

| Campo           | Tipo   | Descrição                                | Caracteres |
|-----------------|--------|------------------------------------------|------------|
| `account_key` * | uuidv4 | Chave única de identificação da conta QI | 36         |

### Query Params

| Campo                    | Tipo       | Descrição                                                                                                  | Caracteres                                                                  |
|--------------------------|------------|------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| `pix_transfer_direction` | enumerator | Indicador do sentido da transação (entrada ou saída). Caso não seja enviado, **outgoing** será considerado | [Enumeradores pix_transfer_direction](#enumeradores-pix_transfer_direction) |
| `request_control_key`    | uuidv4     | Chave única de identificação da request utilizada pelo cliente.                                            | 36                                                                          |
| `end_to_end_id`          | string     | Chave de idempotência de uma transação Pix                                                                 | 32                                                                          |
| `transaction_key`        | uuidv4     | Chave de identificação da movimentação na conta                                                            | 36                                                                          |
| `date_from`              | string     | Data inicial. Formato "YYYY-MM-DD"                                                                         |                                                                             |
| `date_to`                | string     | Data final. Formato "YYYY-MM-DD"                                                                           |                                                                             |
| `page`                   | integer    | Número da página requisitada. 1 por padrão                                                                 |                                                                             |
| `page_size`              | integer    | Tamanho da página requisitada na consulta. 30 por padrão e valor máximo                                    | Valor máximo de 30                                                          |

### Enumeradores pix_transfer_direction

| Enumerador   | Descrição                    |
|--------------|------------------------------|
| **incoming** | Transferência Pix de entrada |
| **outgoing** | Transferência Pix de saída   |

### Response

STATUS 201

Response Body

```json
{
  "data": [
    {
      "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
      "pix_message": "Bom dia",
      "pix_transfer_type": "manual",
      "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
      "updated_at": "2021-10-22T20:30:23.459Z",
      "created_at": "2021-10-22T20:30:23.459Z",
      "target_account": {
        "account_branch": "0001",
        "account_digit": "3",
        "account_number": "12345678",
        "owner_document_number": "***02502000***",
        "owner_person_type": "legal",
        "owner_name": "Qi Tech",
        "account_type": "checking_account",
        "ispb": "32402502",
        "pix_key": null
      },
      "receiver_conciliation_id": null,
      "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "end_to_end_id": "E3240250220211022203051750897529",
      "pix_transfer_status": "sent",
      "transfer_amount": 126.97,
      "fee_amount": 0.0,
      "rejection_reason": null,
      "reversals": [
        {
          "end_to_end_id": "D35713491202309182058jlqdBkkHSWU",
          "transfer_amount": 0.01,
          "reversal_reason": "client_request",
          "pix_transfer_status": "received",
          "pix_transfer_key": "423866cd-0f3f-4cdd-904b-0d2e33273afd",
          "request_control_key": "7c5a1425-73eb-420e-b4fb-0ce3386c7d0a",
          "created_at": "2021-10-23T20:30.459Z"
        }
      ]
    }
  ],
  "pagination": {
    "current_page": 1,
    "rows_per_page": 30
  }
}

```

[//]: # (Break here for new page -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------)

## Webhook para Transações Pendentes

Webhook que servirá para avisar sobre conclusão de transações que foram originalmente respondidas como pendentes (
retornaram com http status 202).

### Webhook Request Body

Request Body: Transação Enviada

```json
{
  "webhook_type": "baas.pix_transfer.outgoing_pix",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
    "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
    "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "pix_transfer_status": "sent",
    "created_at": "2021-10-22T20:30:23.459Z"
  }
}
```

Request Body: Transação Rejeitada

```json
{
  "webhook_type": "baas.pix_transfer.outgoing_pix",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
    "request_control_key": "b6804f32-101e-4702-8fbc-c2dbc4c2caec",
    "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "pix_transfer_status": "rejected",
    "created_at": "2021-10-22T20:30:23.459Z",
    "error_code": "PXT000132",
    "error_description": "Target account number is invalid.",
    "error_translation": "Número da conta de destino é inexistente ou inválido.",
    "error_short_description": null
  }
}
```

### Webhook Body Param

| Campo                 | Tipo   | Descrição                                                 | Max. Caracteres |
|-----------------------|--------|-----------------------------------------------------------|-----------------|
| `webhook_type`        | string | Um enumerador que define o tipo de evento sendo reportado | 23              |
| `webhook_datetime`    | string | Data e hora do envio do webhook                           | 20              |
| `request_control_key` | string | UUID4 para fins de consulta sobre a requisição feita.     | 36              |
| `pix_transfer_key`    | string | Chave de identificação da transferência Pix no sistema QI | 36              |
| `pix_transfer_status` | string | Status da transação.                                      | 200             |
| `created_at`          | string | Data e hora de criação da transação.                      | 20              |

[//]: # (Break here for new page -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------)

## Webhook para Pix de Entrada

Webhook que servirá para avisar sobre transações Pix que chegaram para uma conta.

### Webhook Request Body

Request Body: Pix Recebido

```json
{
  "webhook_type": "baas.pix_transfer.incoming_pix",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
    "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "end_to_end_id": "E18236120202308111235s14fddf2801",
    "pix_transfer_status": "received",
    "account_key": "7c5a1425-73eb-420e-b4fb-0ce3386c7d0c",
    "receiver_conciliation_id": "745c28c780bc4822bbade86dd875d10b",
    "transfer_amount": 126.97,
    "fee_amount": 0.0,
    "source_account": {
      "account_branch": "0001",
      "account_digit": "3",
      "account_number": "12345678",
      "owner_document_number": "***02502000***",
      "owner_person_type": "legal",
      "owner_name": "Qi Tech",
      "account_type": "checking_account",
      "ispb": "32402502"
    },
    "pix_transfer_type": "dynamic_qr_code",
    "pix_message": "pix message received",
    "created_at": "2021-10-22T20:30:23.459Z",
    "reversals": []
  }
}
```

### Webhook Body Param

| Campo                      | Tipo       | Descrição                                                                                             | Max. Caracteres                                                   |
|----------------------------|------------|-------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| `webhook_type`             | string     | Um enumerador que define o tipo de evento sendo reportado                                             | 23                                                                |
| `webhook_datetime`         | string     | Data e hora do envio do webhook                                                                       | 20                                                                |
| `pix_transfer_type`        | enumerator | Tipo do pix realizado                                                                                 | **[Enumerador pix_transfer_type](#enumerador-pix_transfer_type)** |
| `target_pix_key`           | string     | Chave pix da conta a ser enviada a transação                                                          | 100                                                               |
| `source_account`           | Object     | Conta destino - Só deve ser enviada em transações do tipo "manual"                                    | **[Objeto source_account](#objeto-source_account)**               |
| `transfer_amount`          | number     | Valor da transferencia                                                                                | 10                                                                |
| `receiver_conciliation_id` | string     | Identicação de conciliação do recebedor                                                               | 35                                                                |
| `end_to_end_id`            | string     | Chave de idempotência de uma transação Pix - só deve ser enviado se o tipo de transferência for "key" | 32                                                                |
| `pix_message`              | string     | Mensagem a ser enviada junto à transferência Pix                                                      | 140                                                               |
| `fee_amount`               | number     | Valor da transferencia                                                                                | 10                                                                |
| `pix_transfer_status`      | string     | Status da transação pix                                                                               | 10                                                                |
| `account_key`              | string     | Chave única de identificação da conta QI                                                              | 36                                                                |
| `pix_transfer_key`         | string     | Chave única de identificação da transferência Pix                                                     | 36                                                                |

### Enumerador pix_transfer_type

| Enumerador          | Descrição                                |
|---------------------|------------------------------------------|
| **manual**          | Pix utilizando os dados da conta destino |
| **key**             | Pix utilizando uma chave pix             |
| **static_qr_code**  | Pix utilizando um QR code estático       |
| **dynamic_qr_code** | Pix utilizando um QR code dinâmico       |
| **reversal**        | Devolução Pix                            |

### Objeto source_account

| Campo                     | Tipo       | Descrição                                                                                               | Caracteres                                              |
|---------------------------|------------|---------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
| `account_branch` *        | string     | Agência da conta                                                                                        | 6                                                       |
| `account_digit` *         | string     | Dígito da conta                                                                                         | 1                                                       |
| `account_number` *        | string     | Número da conta                                                                                         | 20                                                      |
| `owner_document_number` * | string     | CPF ou CNPJ (apenas números) do titular da conta                                                        | 14                                                      |
| `owner_name`              | string     | Nome do titular da conta                                                                                | 150                                                     |
| `account_type`*           | enumerator | Tipo da conta                                                                                           | **[Enumerador account_type](#enumerador-account_type)** |
| `ispb` *                  | string     | Código de oito dígitos que identifica os bancos no sistema de transferência de reserva do Banco Central | 8                                                       |

### Enumerador account_type

| Enumerador           | Descrição           |
|----------------------|---------------------|
| **checking_account** | Conta Corrente      |
| **salary_account**   | Conta Salário       |
| **saving_account**   | Conta Poupança      |
| **payment_account**  | Conta de Pagamentos |

[//]: # (Break here for new page -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------)

## Webhook para Devoluções de Pix

Webhook que servirá para avisar sobre devoluções Pix que chegaram para uma conta.

### Webhook Request Body

Request Body: Pix Recebido

```json
{
  "webhook_type": "baas.pix_transfer.incoming_pix",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
    "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "end_to_end_id": "E18236120202308111235s14fddf2801",
    "pix_transfer_status": "received",
    "account_key": "7c5a1425-73eb-420e-b4fb-0ce3386c7d0c",
    "receiver_conciliation_id": "745c28c780bc4822bbade86dd875d10b",
    "transfer_amount": 126.97,
    "fee_amount": 0.0,
    "source_account": {
      "account_branch": "0001",
      "account_digit": "3",
      "account_number": "12345678",
      "owner_document_number": "***02502000***",
      "owner_person_type": "legal",
      "owner_name": "Qi Tech",
      "account_type": "checking_account",
      "ispb": "32402502"
    },
    "pix_transfer_type": "reversal",
    "pix_message": "pix message received",
    "created_at": "2021-10-22T20:30:23.459Z",
    "reversals": [],
    "original_outgoing_pix_transfer": "b56862c4-2b20-4057-8063-b8809866e494"
  }
}
```

### Webhook Body Param

| Campo                            | Tipo       | Descrição                                                                                             | Max. Caracteres                                                   |
|----------------------------------|------------|-------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| `webhook_type`                   | string     | Um enumerador que define o tipo de evento sendo reportado                                             | 23                                                                |
| `webhook_datetime`               | string     | Data e hora do envio do webhook                                                                       | 20                                                                |
| `pix_transfer_type`              | enumerator | Tipo do pix realizado                                                                                 | **[Enumerador pix_transfer_type](#enumerador-pix_transfer_type)** |
| `target_pix_key`                 | string     | Chave pix da conta a ser enviada a transação                                                          | 100                                                               |
| `source_account`                 | Object     | Conta destino - Só deve ser enviada em transações do tipo "manual"                                    | **[Objeto source_account](#objeto-source_account)**               |
| `transfer_amount`                | number     | Valor da transferencia                                                                                | 10                                                                |
| `receiver_conciliation_id`       | string     | Identicação de conciliação do recebedor                                                               | 35                                                                |
| `end_to_end_id`                  | string     | Chave de idempotência de uma transação Pix - só deve ser enviado se o tipo de transferência for "key" | 32                                                                |
| `pix_message`                    | string     | Mensagem a ser enviada junto à transferência Pix                                                      | 140                                                               |
| `fee_amount`                     | number     | Valor da transferencia                                                                                | 10                                                                |
| `pix_transfer_status`            | string     | Status da transação pix                                                                               | 10                                                                |
| `account_key`                    | string     | Chave única de identificação da conta QI                                                              | 36                                                                |
| `pix_transfer_key`               | string     | Chave única de identificação da transferência Pix                                                     | 36                                                                |
| `original_outgoing_pix_transfer` | string     | Chave única de identificação da transferência Pix de saída Original                                   | 36                                                                |

### Enumerador pix_transfer_type

| Enumerador          | Descrição                                |
|---------------------|------------------------------------------|
| **manual**          | Pix utilizando os dados da conta destino |
| **key**             | Pix utilizando uma chave pix             |
| **static_qr_code**  | Pix utilizando um QR code estático       |
| **dynamic_qr_code** | Pix utilizando um QR code dinâmico       |
| **reversal**        | Devolução Pix                            |

### Objeto source_account

| Campo                   | Tipo       | Descrição                                                                                               | Caracteres                                              |
|-------------------------|------------|---------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
| `account_branch`        | string     | Agência da conta                                                                                        | 6                                                       |
| `account_digit`         | string     | Dígito da conta                                                                                         | 1                                                       |
| `account_number`        | string     | Número da conta                                                                                         | 20                                                      |
| `owner_document_number` | string     | CPF ou CNPJ (apenas números) do titular da conta                                                        | 14                                                      |
| `owner_name`            | string     | Nome do titular da conta                                                                                | 150                                                     |
| `account_type`          | enumerator | Tipo da conta                                                                                           | **[Enumerador account_type](#enumerador-account_type)** |
| `ispb`                  | string     | Código de oito dígitos que identifica os bancos no sistema de transferência de reserva do Banco Central | 8                                                       |

### Enumerador account_type

| Enumerador           | Descrição           |
|----------------------|---------------------|
| **checking_account** | Conta Corrente      |
| **salary_account**   | Conta Salário       |
| **saving_account**   | Conta Poupança      |
| **payment_account**  | Conta de Pagamentos |

---

# Aprovar transferência

URL: /en/documentation/pix/2fa/aprovar_solicitacao_de_transferencia

## Request

ENDPOINT /baas/token_request
METHOD POST

Request Body

```json
{
    "token": "329329",
    "agent_document_number": "97564480000",
    "movement_payload": {
        "pix_transfer_key": "cea836b5-b02e-4f94-b1e2-4d575671c33d",
        "approver_document_number": "97564480000"
    }
}

```

### Body Params

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `contact_type` * | string | Forma de envio do token de autenticação,  podendo ser via E-mail (“email”) ou SMS (“sms”)| 10 |
| `agent_document_number` * | Object | CPF do usuário que irá receber o token. | 11 | 
| `receiver_conciliation_id` | string | Identicação de conciliação do recebedor - Obrigatório para pagamento de QrCode . | 32 |
| `end_to_end_id` *| string | Chave de idempotência de uma transação Pix - | 32 |
| `movement_payload` *| Object | Payload contendo as informações da transferência | **[Object movement_payload](#object-movement_payload)** | - |

### Object movement_payload

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `pix_transfer_key` * | string | Chave única da transferência pix, retonada no endpoint de solicitação de transferência | 10 |
| `approver_document_number` * | Object | CPF do usuário que irá receber o token. | 11 | 

## Response

STATUS 201

Response Body
```json
{
    "pix_transaction": {
        "fee_amount": 0.0,
        "pix_message": null,
        "pix_transfer_type": "key",
        "end_to_end_id": "E32402502202404041622XydHD7dzD0s",
        "pix_transfer_key": "c7ad1951-96f7-4cd7-b15d-038512b26f4f",
        "transfer_amount": 45,
        "target_account": {
            "document_number": "***.698.79*-**",
            "financial_institution": "CAIXA ECONOMICA FEDERAL"
        },
        "source_account": {
            "account_digit": "0",
            "account_branch": "0001",
            "account_number": "9223675"
        },
        "pix_transfer_status": "sent",
        "transaction_key": "67d54c48-39a1-4c65-843c-ba9d876c3cff"
    },
    "operation_key": "08b9cc1a-3e24-4604-a080-e41ff782f19d",
    "status": "sent",
    "event_datetime": "2024-04-04 13:25:24",
    "authentication_code": "5dab74e796133f4039e437fb58b4a29b"
} 
```

---

# Solicitar devolução de um Pix

URL: /en/documentation/pix/2fa/solicitar_chargeback_pix

A devolução de um Pix pode ser solicitada em até 90 dias a partir de seu recebimento.

## Request

ENDPOINT /baas/pix_transfer
MÉTODO POST

:::info Informação
Após a solicitação da devolução é necessário realizar a [ solicitação do token de transferência Pix](../pix/2fa/aprovar_solicitacao_de_transferencia) 
:::

Request Body

```json
{
    "is_chargeback": true,
    "pix_transfer_key": "b91da9c7-72de-46dc-bb36-4b1407d1eb91",
    "chargeback_amount": 147,
    "chargeback_message": "Mensagem Pix da devolução"
}
```

## Response

STATUS 200

Response Body

```json
{
	"data": {
		"pix_transfer_key": "b3015cb5-862d-48aa-946d-c14afc8cdebb",
		"pix_transfer_status": "pending_approval",
		"pix_transfer_type": "chargeback",
		"target_account": {
			"document_number": "***02502000***",
			"financial_institution": "QI SOCIEDADE DE CRÉDITO DIRETO S.A."
		},
		"transfer_amount": 35
	},
	"event_datetime": "2023-03-21 11:52:11",
	"operation_key": "ec9b4741-7c7e-4429-9b10-3fc05045ebea",
	"status": "pending_approval"
}
```

STATUS 4xx

Response Body: Reversão Rejeitada

```json
{
    "title": "titulo",
    "description": "description in English",
    "translation": "descrição em portugues",
    "code": "codigo"
}
```

| Código HTTP<br/>`status` | Código QI<br/>`code` | Título<br/>`title`                  | Descrição (eng)<br/>`description`                                      | Descrição (ptbr)<br/>`translation`                                                        |
|--------------------------|----------------------|-------------------------------------|------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                         | Schema Error                                                           | Erro de Schema                                                                            |
| 404                      | PXT000084            | Original Pix Transfer Was Not Found | Original Pix Transfer Was Not Found.                                   | A transação PIX original não foi encontrada.                                              |
| 400                      | PXT000017            | Reversal Too Great                  | Reversal transfers sum amount surpasses that of original pix transfer. | A soma das transferências de devolução ultrapassam o valor da transferência pix original. |
| 400                      | PXT000015            | Reversal date expired               | Reversal original transaction is older than 90 days                    | A data de criação da transação original é mais antiga que 90 dias                         |

---

# Solicitar Token de Aprovação da Transferência

URL: /en/documentation/pix/2fa/solicitar_token_de_aprovacao

## Request

ENDPOINT /baas/token_request
MÉTODO POST

Request Body

```json
{
    "contact_type": "sms",
    "agent_document_number": "97564480000",
    "movement_payload": {
        "pix_transfer_key": "cea836b5-b02e-4f94-b1e2-4d575671c33d",
        "approver_document_number": "97564480000"
    }
}

```

### Body Params

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `contact_type` * | string | Forma de envio do token de autenticação,  podendo ser via E-mail (“email”) ou SMS (“sms”)| 10 |
| `agent_document_number` * | string | CPF do usuário que irá receber o token. | 11 | 
| `movement_payload` | Object | Payload contendo as informações da transferência | **[Objeto movement_payload](#objeto-movement_payload)** | 

### Objeto movement_payload

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `pix_transfer_key` * | string | Chave única da transferência pix, retonada no endpoint de solicitação de transferência | 10 |
| `approver_document_number` * | string | CPF do usuário que irá receber o token. | 11 | 

### Response

STATUS 201

Response Body
```json
{} 
```

---

# Solicitar Transferência Pix

URL: /en/documentation/pix/2fa/solicitar_transferencia

## Request

ENDPOINT /baas/pix_transfer
MÉTODO POST

## Pix Manual - Transferência utilizando dados bancários

Request Body

```json

{
    "pix_transfer_type": "manual",
    "source_account": {
        "account_branch": "0001",
        "account_digit": "2",
        "account_number": "2359934",
        "owner_document_number": "09080702000105"
    },
    "target_account": {
          "account_branch": "0001",
          "account_digit": "3",
          "account_number": "12345678",
          "owner_document_number": "32402502000135",
          "owner_name": "Qi Tech",
          "account_type": "checking_account",
          "ispb": "32402502"
     },
    "transaction_amount": 45,
    "message": "Mensagem pix"
}

```

### Body Params

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `pix_transfer_type` * | string | O Pix possui diferentes tipos de iniciação, o "manual" onde o usuário deve enviar os campos da conta de destino e conta de origem e o "key" onde o usuário deve enviar os campos da chave Pix do recebedor (conta de destino) e os dados da conta de origem. | 10 |
| `source_account` * | Object | Conta de origem. | **[Objeto source_account](#objeto-source_account)** | 
| `target_account` | Object | Conta destino - Só deve ser enviada em transações do tipo "manual". | **[Objeto target_account](#objeto-target_account)** | 10 |
| `transaction_amount` * | string | Valor da transferencia. | 10 |

### Objeto source_account

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `account_branch` * | string | Número Agência. | 0 |
| `branch_digit` |string | Dígito da Agência.| 0 |
| `account_digit` * | string | Dígito da conta.| 0 |
| `account_number` * | string | Número da conta.| 0 | 
| `owner_document_number` * | string | CPF ou CNPJ (apenas números) do titular da conta.| 0 |

### Objeto target_account

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `account_branch` * | string | Agência. | 10 |
| `account_digit` * | string | Dígito da conta | 10 |
| `account_number` * | string | Número da conta. | 10 |
| `owner_document_number` * | string | CPF ou CNPJ (apenas números) do titular da conta. | 10 |
| `owner_name` * | string | Nome do titular da conta. | 10 |
| `account_type` * |string |  CPF ou CNPJ (apenas números) do titular da conta.| 10 |
| `ispb` | string |  Código de oito dígitos que identifica os bancos no sistema de transferência de reserva do Banco Central.| 10 |

### Response

STATUS 200

Response Body: Transferência manual

```json
{
    "data": {
        "fee_amount": 5.0,
        "pix_message": "",
        "pix_transfer_key": "fde0f4b4-8a8a-4ae2-a179-2398f434881a",
        "transfer_purpose": "transfer",
        "transaction_amount": 15.0,
        "end_to_end_id": "E324025022024040400378WsKzFgIuUg",
        "target_account": {
            "document_number": "***.698.79*-**",
            "financial_institution": "CAIXA ECONOMICA FEDERAL"
        },
        "source_account": {
            "account_number": "1314358",
            "account_digit": "0",
            "account_brach": "0001",
            "account_type": "checking",
            "owner_name": "Bem demais",
            "owner_document_number": "90477655000148"
        }
    },
    "operation_key": "06426df6-fe8e-4fe0-84b7-75d7199c3a34",
    "status": "pending_approval",
    "event_datetime": "2024-04-03 21:37:06"
}

``` 

## Transferência Pix utilizando Chave Pix

Request Body

```json

{
    "pix_transfer_type": "key",
    "source_account": {
        "account_branch": "0001",
        "account_digit": "2",
        "account_number": "2359934",
        "owner_document_number": "09080702000105"
    },
    "pix_key": "teste@pix.com",
    "transaction_amount": 45,
    "end_to_end_id": "E32402502202404040038Cs4oXRAOe98",
    "message": "olá, mundo!"
}

```

### Body Params

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `pix_transfer_type` * | string | Tipo de transferência Pix (key) | - |
| `source_account` * | Object | Conta de origem. | **[Objeto source_account](#objeto-source_account)** | 
| `pix_key` | Object | Chave pix | - |
| `transaction_amount` * | string | Valor da transferencia. | 10 |
| `end_to_end_id` | string | Chave de idempotência de uma transação Pix - é retornada na consulta de chave pix. | 32 |

 
### Objeto source_account

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `account_branch` * | string | Número Agência. | 0 |
| `branch_digit` |string | Dígito da Agência.| 0 |
| `account_digit` * | string | Dígito da conta.| 0 |
| `account_number` * | string | Número da conta.| 0 | 
| `owner_document_number` * | string | CPF ou CNPJ (apenas números) do titular da conta.| 0 |

### Response

STATUS 200

Response Body: Transferência por chave Pix

```json
{
  "operation_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "status": "pending",
  "event_datetime": "2021-08-04 20:05:54",
  "pix_transaction": {
    "pix_message": "",
    "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "transaction_amount": 1891268.97,
    "source_account": {
      "account_branch": "0001",
      "account_digit": "3",
      "account_number": "24339",
      "owner_document_number": "32402502000135",
      "owner_name": "Qi Tech",
      "account_type": "checking"
    },
    "target_account": {
      "target_account": "78340-6",
      "financial_institution_code": "329",
      "owner_document_number": "32402502000135",
      "owner_name": "QI Tech",
      "target_account_type": "checking_account",
      "owner_person_type": "legal",
      "trading_name": "QITech"
    },
    "fee_amount": 0
  }
}

``` 

## Transferência Pix QRCode

Os dados utilizados para realizção de uma transação de pagamento de um QR Code Pix devem ser obtidos através da [decodificação do QR Code Pix](/documentation/pix/decodificar_qr_code), utilizando a URI do Pix Copia e Cola.
I - O campo “end_to_end_id” deve ser o mesmo valor retornado da decodificação do QR Code Dinâmico.
II - Informar no campo “transaction_amount“ o mesmo valor retornado no campo “qr_code_data.amount” da decodificação do QR Code Dinâmico;
III - Alterar o campo “pix_transfer_type” para o enumerador correspondente (**static_qr_code** ou **dynamic_qr_code** ), para solicitação do pagamento.
  IV - O campo “receiver_conciliation_id” deve ser o mesmo valor retornado da decodificação do QR Code Dinâmico.

Request Body

```json
{
    "pix_transfer_type": "dynamic_term",
    "source_account": {
        "account_branch": "0001",
        "account_digit": "2",
        "account_number": "2359934",
        "owner_document_number": "09080702000105"
    },
    "pix_key": "chave_pix_retornada",
    "receiver_conciliation_id": "27f6e293-7794-40a7-84e8-c5bf97ece57a",
    "end_to_end_id": "E32402502202304031417pknxDsRrUqM",
    "transaction_amount": 45
}

```

### Body Params

| Campo | Tipo | Descrição                                                                                              | Caracteres |
|---|---|--------------------------------------------------------------------------------------------------------| ---|
| `pix_transfer_type` * | string | Indicador do tipo de transferência (qrcode)                                                            | 10 |
| `source_account` * | Object | Conta de origem.                                                                                       | **[Objeto source_account](#objeto-source_account)** | 
| `pix_key` | Object | Chave pix                                                                                              | - |
| `transaction_amount` * | string | Valor da transferencia.                                                                                | 10 |
| `receiver_conciliation_id` | string | Identicação de conciliação do recebedor - Obtido através do decode do QrCode .                         | 32 |
| `end_to_end_id` | string | Chave de idempotência de uma transação Pix - é retornada na decodificação do QrCode.                   | 32 |
|`pix_transfer_key` | string | Chave de idempotência de uma transação Pix - só deve ser enviado se o tipo de transferência for "key". | 10 |

 
### Objeto source_account

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `account_branch` * | string | Número Agência. | 0 |
| `branch_digit` |string | Dígito da Agência.| 0 |
| `account_digit` * | string | Dígito da conta.| 0 |
| `account_number` * | string | Número da conta.| 0 | 
| `owner_document_number` * | string | CPF ou CNPJ (apenas números) do titular da conta.| 0 |

### Response

STATUS 200

Response Body: Transferência por QrCode

```json
{
  "operation_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "status": "pending",
  "event_datetime": "2021-08-04 20:05:54",
  "pix_transaction": {
    "pix_message": "",
    "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "transaction_amount": 1891268.97,
    "source_account": {
      "account_branch": "0001",
      "account_digit": "3",
      "account_number": "24339",
      "owner_document_number": "32402502000135",
      "owner_name": "Qi Tech",
      "account_type": "checking"
    },
    "target_account": {
      "target_account": "78340-6",
      "financial_institution_code": "329",
      "owner_document_number": "32402502000135",
      "owner_name": "QI Tech",
      "target_account_type": "checking_account",
      "owner_person_type": "legal",
      "trading_name": "QITech"
    },
    "fee_amount": 0
  }
}

```

---

# Aprovar solicitação de transferência

URL: /en/documentation/pix/aprovar_solicitacao_de_transferencia

## Request

ENDPOINT /baas/pix_transfer_approval
MÉTODO POST

Request Body

```json
{
    "pix_transfer_key": "0e241203-8c6b-4e0a-ac42-e0d2a2fc2d37",
    "approver_document_number": "11111111111"
}

```

### Body params

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `pix_transfer_type` * | string | chave de identificação da transação, recebida no momento da solicitação de transferência. | chave uuid |
| `approver_document_number` * | string | CPF do usuário quem está autorizando a transferência. | string |

## Response

STATUS 200

Response Body: Aprovação de uma transferência manual

```json
{
  "operation_key": "ea2fc82c-ad32-4c08-a341-527b09883da3",
  "status": "pending",
  "event_datetime": "2021-08-04 20:05:54",
  "pix_transaction": {
    "pix_message": "",
    "pix_transfer_type": "manual",
    "created_at": "2021-10-22T20:30:50",
    "sent_at": "2021-10-22T20:30:53",
    "source_account_key": "a1d2dea5-fa90-4676-a125-da355fdc3ed0",
    "update_at": "2021-10-22T20:30:53",
    "fee_amount": 0,
    "receiver_conciliation_id": null,
    "transaction_key": "2e9f50cf-da59-4418-96a6-e7073a06f660",
    "target_account": {
      "target_account": "78340-6",
      "financial_institution_code": "329",
      "owner_document_number": "32402502000135",
      "owner_name": "QI Tech",
      "target_account_type": "checking_account",
      "owner_person_type": "legal",
      "trading_name": "QITech"
    },
    "source_account": {
      "account_branch": "0001",
      "account_digit": "9",
      "account_number": "09661"
    },
    "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "end_to_end_id": "E3240250220211022203051750897529",
    "pix_transfer_status": "sent",
    "transfer_amount": 1891268.97
  }
}

```

STATUS 200

Response Body: Aprovação de uma transferência por chave

```json
{
  "event_datetime": "2021-10-28 15:06:04",
  "operation_key": "ea2fc82c-ad32-4c08-a341-527b09883da3",
  "pix_transaction": {
    "end_to_end_id": "E3210272497339911957760452404275",
    "fee_amount": 0,
    "pix_message": null,
    "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "pix_transfer_status": "scheduled",
    "pix_transfer_type": "key",
    "schedule_date": "2021-10-28",
    "schedule_key": "9dee3e8f-2765-4b7a-8bb6-22557b0a4204",
    "source_account": {
      "account_branch": "0001",
      "account_digit": "9",
      "account_number": "09661"
    },
    "target_account": {
      "document_number": "***.221.81*-**",
      "financial_institution": "BANCO BRADESCO S.A.",
      "target_account": "1925255-8"
    },
    "transfer_amount": 1891268.97
  },
  "status": "sent"
}

```

STATUS 400

Response Body

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

```

STATUS 422

Response Body

```json
{
  "data": "{\"title\": \"Pending Transfer\", \"description\": \"The transaction (<END TO END ID DO PIX>) could not be completed and is pending confirmation.\", \"translation\": \"Não foi possível concluir a transação (<END TO END ID DO PIX>) e ela está pendente de confirmação\", \"code\": \"PXT000072\"}"
}

```

:::danger HTTP Error 422
Caso seja retornado **http error 422**, a solicitação de Pix **não deve ser retentada**. É preciso checar o status da solicitação de transferência Pix através de um GET na rota [/baas/pix/pix_transfer](/documentation/pix/pesquisar_por_transferencia_pix_de_saida).
:::

---

# Consulta de Dados de Chave Pix no Banco Central

URL: /en/documentation/pix/baas_v2/consultar_chave_pix

## Request

ENDPOINT /pix_key/ PIX_KEY
MÉTODO GET

### Request Path Params

| Campo               | Tipo   | Descrição                      | Caracteres |
|---------------------|--------|--------------------------------|------------|
| `pix_key` * | string | Chave PIX que será consultada. | 77 |

:::info Tipos de Chave Pix
A “pix_key” pode ser um CPF, CNPJ, E-mail, Celular ou uma Chave Aleatória (UUID), seguindo as seguintes formatações:

**CPF**: Número inteiro com 11 dígitos.

**CNPJ**: Número inteiro com 14 dígitos.

**E-mail**: Texto contendo ao menos um “@”.

**Celular**: Texto contendo os seguintes valores: “+55” + “DDD do celular“ + “Número Inteiro do Celular com no mínimo 8 e no máximo 9 dígitos”. Ex: “+5511987654321“.

**Chave Aleatória**: UUID4.
:::

### Request Query Params

| Campo              | Tipo   | Descrição                                                                                                                                                                                            | Caracteres |
|--------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|
| `account_key` *    | uuidv4 | Chave única do alias.                                                                                                                                                                                | 36         |
| `document_number`  | int    | CPF/CNPJ do titular da Chave Pix. Ao passar este parâmetro o campo `is_pix_key_owner` será retornado com um valor booleano identificando se o CPF/CNPJ informado é igual ao do titular da Chave Pix. | 14         |

:::info Utilização de tokens de consulta
Para que o token de consulta de chave pix seja cobrado da pessoa titular da conta, é obrigatório que o `account_key` seja enviado.
Caso não seja enviado o account_key, o token será cobrado do número de documento do parceiro. 
:::

## Response

STATUS 200

Response Body: Chave Ativa

```json
{
    "account_branch": "452",
    "account_created_at": "2021-10-22T20:30.459Z",
    "account_digit": "1",
    "account_number": "370158",
    "account_type": "checking_account",
    "bank_code": "237",
    "end_to_end_id": "E3240250220230404185631R0kjZnC6G",
    "financial_institution": "BCO BRADESCO S.A.",
    "is_pix_key_owner": false,
    "ispb": "60746948",
    "owner_masked_document_number": "***.141.857-**",
    "owner_name": "Teste teste",
    "owner_person_type": "legal",
    "owner_trading_name": "Teste LTDA.",
    "pix_key": "teste@gmail.com"
}
```

| Campo                          | Tipo    | Descrição                                                                                                                                                                                                                                                                                     | Max. Caracteres                                                   |
|--------------------------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| `account_branch`               | string  | Agência da conta vinculada a Chave Pix, sem o dígito verificador.                                                                                                                                                                                                                             | 4                                                                 |
| `account_created_at`           | string  | Data de abertura da conta vinculada a Chave Pix, informada pela instituição custodiante da conta.                                                                                                                                                                                             | 21                                                                |
| `account_digit`                | string  | Dígito verificador da conta vinculada a Chave Pix.                                                                                                                                                                                                                                            | 1                                                                 |
| `account_number`               | string  | Número de conta vinculada a Chave Pix sem o dígito verificador.                                                                                                                                                                                                                               | 20                                                                |
| `account_type`                 | enum    | Definição do tipo de conta da Chave Pix.                                                                                                                                                                                                                                                      | [Enumeradores Account Type](#enumeradores-account_type)           |
| `bank_code`                    | string  | Código do banco registrador da Chave Pix. Pode ser retornado como nulo, para instituições que não possuem código de banco                                                                                                                                                                     | 3                                                                 |
| `end_to_end_id`                | string  | Indentificador único da consulta da chave Pix no Bacen. Deve ser enviado na transferência Pix para que o token consumido na consulta seja recuperado.                                                                                                                                         | 32                                                                |
| `financial_institution`        | string  | Nome da instituição financeira registradora da Chave Pix.                                                                                                                                                                                                                                     | 200                                                               |
| `is_pix_key_owner`             | boolean | Será retornado um valor boleano, caso o parâmetro `document_number` seja passado na request. Este campo informa se o CPF/CNPJ informado no parâmetro `document_number` é o mesmo do titular da Chave Pix. Será retornado um valor nulo caso o parâmetro `document_number` não seja informado. | -                                                                 |
| `ispb`                         | string  | ISPB do Participate detentor da Chave Pix.                                                                                                                                                                                                                                                    | 8                                                                 |
| `owner_masked_document_number` | string  | Número de CPF ou CNPJ do titular da Chave Pix.                                                                                                                                                                                                                                                | 14                                                                |
| `owner_name`                   | string  | Nome do titular da Chave Pix.                                                                                                                                                                                                                                                                 | 120                                                               |
| `owner_person_type`            | enum    | Natureza jurídica do titular da Chave Pix.                                                                                                                                                                                                                                                    | [Enumeradores Owner Person Type](#enumeradores-owner_person_type) |
| `owner_trading_name`           | string  | Nome fantasia do titular da Chave Pix (somente para `owner_person_type=legal`).                                                                                                                                                                                                               | 100                                                               |
| `pix_key`                      | string  | Chave Pix.                                                                                                                                                                                                                                                                                    | -                                                                 |

### Enumeradores account_type
| Enumerador       | Descrição          |
|------------------|--------------------|
| `payment` | Conta de pagamento |
| `checking` | Conta de corrente  |
| `savings` | Conta poupança     |
| `saving` | Conta poupança     |
| `salary` | Conta salário      |
| `saving_account` | Conta poupança     |
| `payment_account` | Conta de pagamento |
| `checking_account` | Conta de corrente  |
| `salary_account` | Conta salário      |
| `escrow` | Conta Vinculada    |

:::info
Diferentes enumeradores podem significar o mesmo tipo de conta devido a informação retornada por diferentes instituições.
:::

### Enumeradroes owner_person_type
| Enumerador | Descrição |
|------------|-----------|
| `natural`  | string    |
| `legal`    | string    |

STATUS 4XX

Response Body

```json
{
    "title": "titulo",
    "description": "description in English",
    "translation": "descrição em portugues",
    "code": "codigo"
}
```

|Código HTTP | Código QI<br/>`code` | Título<br/>`title` | Descrição (eng)<br/>`Description` | Descrição (ptbr)<br/>`translation` |
|------------|-------------------|----------------|------------------------------|-----------------------------|
| 404        | PIX000017         | Pix Key Not Found | Pix key \{pix_key\} not found. | A chave pix \{pix_key\} não foi encontrada. |
| 403        | PIX000080         | Not enough permission | The selected agent doesn't have permission to access this resource. | O agente selecionado não tem permissão para acessar este recurso. |
| 429        | PIX000081         | Rate Limit Exceeded | Rate Limit Exceeded | Limite de requisições excedido |
| 404        | PIX000082         | Alias not found | Alias \{alias_key\} not found | Alias \{alias_key\} não encontrado |
| 404        | PIX000083         | Pix Key not found | Pix Key \{pix_key\} not found for Alias \{alias_key\} | Chave Pix \{pix_key\} não encontrada para o Alias \{alias_key\} |
| 400        | PIX000084         | Only one query param allowed | Only one query param allowed | Somente um parâmetro de consulta é permitido |

---

# Write off dynamic QR Code

URL: /en/documentation/pix/baixar_qr_code_dinamico

## Request

ENDPOINT /baas/qrcode/dynamic
METHOD POST

Request Body

```json
{
  "occurrence_type": "write_off",
  "qr_code_key": "461d29e6-d2ed-48f7-bc7b-c3143a1e43d2",
  "qr_code_type": "dynamic_term"
}

```

### Body Params

| Field | Type | Description | Characters |
|---|---|---|---|
| `occurrence_type` * | string |Type of occurrence. payment: Payment occurrence, registration: Registration occurrence, write_off: Generator cancellation occurrence, bank_written_off: Bank cancellation occurrence. | - |
| `qr_code_type` * | string | Type of dynamic QR Code | - |
| `qr_code_key` * | string | QR Code key returned at the time of generation. | uuid |

## Response

STATUS 200

Response Body

```json
{
  "qr_code_type": "dynamic_instant",
  "amount": null,
  "expiration_seconds": null,
  "max_payment_days": 180,
  "receiver_conciliation_id": "461d29e6d2ed48f7bc7bc3143a1e43d2",
  "payer_name": null,
  "payer_document_number": null,
  "payer_person_type": "natural",
  "payer_request": null,
  "pix_message": null,
  "modality_alteration": false,
  "expiration_date": null,
  "rebate_amount": null,
  "interest_amount": null,
  "fine_amount": null,
  "paid_amount": null,
  "discounts": [],
  "additional_data": [],
  "origin": "system",
  "origin_key": null,
  "pix_key": "9de04466-0b02-4263-9c28-9cdc0fb638bb",
  "qr_code_key": "461d29e6-d2ed-48f7-bc7b-c3143a1e43d2",
  "occurrence_type": "write_off",
  "end_to_end_id": null,
  "source_account_branch": null,
  "source_account_financial_institution": null,
  "source_account_ispb": null,
  "source_account_number": null,
  "source_account_digit": null,
  "disable": null,
  "qr_code_occurrence_key": "32ec9e60-b630-45fa-a0c7-653fbb30a32a",
  "base_64": null,
  "image": null
}

```

STATUS 400

Response Body

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

```

---

# Search for Pix limit change request

URL: /en/documentation/pix/busca_por_solicitacao_de_limite_pix

## Request

ENDPOINT /baas/pix/limits_request
METHOD GET

### Query String

| Field | Type | Description | Characters |
|-------------|--------|--------------------------------|---------|
| `account_key` | string | Identification key of the QIAccount | 36 |
| `request_status` | string | Status of the limit request. Valid statuses: **"pending_approval"**, **"approved"**, **"rejected"**, **"executed"**. Can be sent as a list, for example: **"pending_approval,approved"** |
| `page` | integer | Page number being searched | - |
| `page_size` | integer | Number of items per page | - |

## Response

STATUS 200

Response Body

```json
{
   "pagination": {
      "current_page": 0,
      "next_page": 1,
      "rows_per_page": 15,
      "total_pages": 1,
      "total_rows": 4
   },
   "data": [
      {
         "account_key": "dc94d45c-11a1-46f1-b19a-a1af9884a3c5",
         "amount_limit": 2000,
         "created_at": "2023-05-29T11:50:03",
         "limit_type": "daily",
         "request_key": "155afa76-4e80-4a11-917a-34d48e39325c",
         "request_status": "pending_approval",
         "routine_key": null
      },
      {
         "account_key": "dc94d45c-11a1-46f1-b19a-a1af9884a3c5",
         "amount_limit": 1000,
         "created_at": "2023-05-29T11:50:03",
         "limit_type": "nightly",
         "request_key": "805a457d-307d-46c5-8dce-e98e309a3380",
         "request_status": "pending_approval",
         "routine_key": null
      },
      {
         "account_key": "dc94d45c-11a1-46f1-b19a-a1af9884a3c5",
         "amount_limit": 1500,
         "created_at": "2023-05-29T11:50:03",
         "limit_type": "self_daily",
         "request_key": "7cd413ab-fc78-41e6-ab27-206f69e2e294",
         "request_status": "pending_approval",
         "routine_key": null
      },
      {
         "account_key": "dc94d45c-11a1-46f1-b19a-a1af9884a3c5",
         "amount_limit": 500,
         "created_at": "2023-05-29T11:50:03",
         "limit_type": "self_nightly",
         "request_key": "febe9087-1eba-4169-a63e-29e546aaf874",
         "request_status": "pending_approval",
         "routine_key": null
      }
   ]
}
```

STATUS 403

Response Body: User does not have credentials

```json
{
    "title": "Unauthorized",
    "description": "User is not allowed to do this transaction",
    "translation": "Usuário não tem autorização para fazer essa transação",
    "code": "PIT000001"
}
```

---

# Search for Pix limit usage

URL: /en/documentation/pix/busca_por_uso_de_limite_pix

## Request

ENDPOINT /baas/pix/limits/ ACCOUNT_KEY /usage
METHOD GET

### Path Params

| Field | Type | Description | Characters |
|-------------|--------|--------------------------------|---------|
| `account_key` | string | Identification key of the QI Account | 36 |

## Response

STATUS 200

Response Body

```json
{
	"daily_amount_limit": "800012.67",
	"daily_amount_percentage": null,
	"daily_amount_used": "0",
	"nightly_amount_limit": "100000.00",
	"nightly_amount_percentage": null,
	"nightly_amount_used": "0",
	"self_daily_amount_limit": "500.03",
	"self_daily_amount_percentage": null,
	"self_daily_amount_used": "0",
	"self_nightly_amount_limit": "100000.00",
	"self_nightly_amount_percentage": null,
	"self_nightly_amount_used": "0"
}
```

STATUS 403

Response Body: User does not have credentials

```json
{
    "title": "Unauthorized",
    "description": "User is not allowed to do this transaction",
    "translation": "Usuário não tem autorização para fazer essa transação",
    "code": "PIT000001"
}
```

---

# Sandbox Mock Pix Keys

URL: /en/documentation/pix/chaves_pix_mockadas

## 104 - CAIXA ECONOMICA FEDERAL

| Pix Key                            | Type         | Owner name  | Owner document number | Account number | Account agency | ISPB   |
|--------------------------------------|--------------|------------------|----------------------|-----------------|------------------|--------|
| +5568970000000                       | phone_number | Mock Person Name | 65322181032          | 21837-5         | 4458             | 360305 | 
| d6e2d611-6c68-4f84-9be5-962ad2f2bcb6 | random_key   | Mock Person Name | 61295118092          | 100091086-1     | 465              | 360305 | 
| 61295118092                          | cpf          | Mock Person Name | 61295118092          | 1300005670-8    | 4289             | 360305 | 
| pix03@pix03.com                      | email        | Mock Person Name | 96969879003          | 363214578-8     | 8615             | 360305 | 
| +5568911106520                       | phone_number | Mock Person Name | 66702118805          | 100071086-1     | 465              | 360305 | 
| 5e6ce02a-e0da-4d56-73b8-84f118b4f371 | random_key   | Mock Person Name | 52720072800          | 100061086-1     | 465              | 360305 | 
| 52720072800                          | cpf          | Mock Person Name | 52720072800          | 100071076-1     | 465              | 360305 | 
| pix10@pix10.com                      | email        | Mock Person Name | 24182533410          | 100071066-1     | 465              | 360305 | 
| pix33@pix33.com                      | email        | Mock Person Name | 56151446887          | 96764-6         | 919              | 360305 | 
| 88253032978                          | cpf          | Mock Person Name | 88253032978          | 96764-6         | 919              | 360305 | 

## 341 - ITAÚ UNIBANCO S.A.

| Pix Key                            | Type         | Owner name  | Owner document number | Account number | Account agency | ISPB   
|--------------------------------------|------------|------------------|----------------------|-----------------|------------------|----------|
| 22156083070                          | cpf        | Mock Person Name | 22156083070          | 19413-2         | 8534             | 60701190 | 
| 96969879003                          | cpf        | Mock Person Name | 96969879003          | 22110-1         | 8615             | 60701190 | 
| 5e6ce06a-e0da-4d56-93b8-84f118b4f371 | random_key | Mock Person Name | 43135154025          | 57980-4         | 5067             | 60701190 | 
| pix11@pix11.com                      | email      | Mock Person Name | 66702118805          | 86091-8         | 3101             | 60701190 | 
| 24182533410                          | cpf        | Mock Person Name | 24182533410          | 20467-1         | 5807             | 60701190 | 
| pix07@pix07.com                      | email      | Mock Person Name | 11646288874          | 33087-6         | 8872             | 60701190 | 

## 237 - BCO BRADESCO S.A.

| Pix Key                            | Type         | Owner name  | Owner document number | Account number | Account agency | ISPB   
|--------------------------------------|--------------|------------------|----------------------|-----------------------|------------------|----------|
| 65322181032                          | cpf          | Mock Person Name | 65322181032          | 1017372-2             | 1                | 60746948 | 
| b9380607-dac6-4e17-8ca7-eb761e3aa1dd | random_key   | José Alves       | 24080025327          | 0001000000000022279-9 | 1                | 08744817 | 
| b9380607-dac6-4e17-8ca7-eb761e3aa1dd | random_key   | José Alves       | 24080025327          | 0003000000000000288-9 | 1                | 08744817 | 
| b9380607-dac6-4e17-8ca7-eb761e3aa1dd | random_key   | José Alves       | 24080025327          | 0013000000000013609-9 | 1                | 08744817 | 
| b9380607-dac6-4e17-8ca7-eb761e3aa1dd | random_key   | José Alves       | 24080025327          | 1288000000884535174-9 | 1                | 08744817 | 
| b9380607-dac6-4e17-8ca7-eb761e3aa1dd | random_key   | José Alves       | 24080025327          | 3701000000593070593-9 | 1                | 08744817 | 
| pix01@pix01.com                      | email        | Mock Person Name | 65322181032          | 1017372-2             | 1                | 60746948 | 
| pix01@pix01.com                      | email        | Mock Person Name | 65322181032          | 1925255-8             | 3952             | 60746948 | 
| pix12@pix12.com                      | email        | Mock Person Name | 11085087824          | 1071659-4             | 427              | 60746948 | 
| 5e6ce08a-e0da-4d56-93b8-84f118b4f371 | random_key   | Mock Person Name | 66702118805          | 1751795-3             | 6162             | 60746948 | 
| +5568911137576                       | phone_number | Mock Person Name | 82104056080          | 1587784-7             | 1340             | 60746948 | 

## 33 - BCO SANTANDER (BRASIL) S.A.

| Pix Key                            | Type         | Owner name  | Owner document number | Account number | Account agency | ISPB   
|--------------------------------------|------------|------------------|----------------------|-----------------|------------------|----------|
| 5e6ce05a-e0da-4d56-93b8-84f118b4f371 | random_key | Mock Person Name | 42759960030          | 9206744-2       | 4187             | 90400888 | 
| 34175131205                          | cpf        | Mock Person Name | 34175131205          | 9206744-2       | 4187             | 90400888 | 
| 5e6ce05a-e0da-4d56-53b8-74f118b4f371 | random_key | Mock Person Name | 11646288874          | 9206744-2       | 4187             | 90400888 | 
| 82104056080                          | cpf        | Mock Person Name | 82104056080          | 2850903-2       | 214              | 90400888 | 

## 77 - BANCO INTER

ISPB: 416968

| Pix Key                            | Type         | Owner name  | Owner document number | Account number | Account agency | ISPB   
|--------------------------------------|--------------|-----------------------|----------------------|-----------------|------------------|--------|
| 22156083070                          | cpf          | Mock Person Name      | 22156083070          | 4810813-8       | 1                | 416968 | 
| pix13@pix13.com                      | email        | Mock Person Name      | 43135154025          | 4830813-8       | 1                | 416968 | 
| 66702118805                          | cpf          | Mock Person Name      | 66702118805          | 4820813-8       | 1                | 416968 | 
| 5e6ce05a-e0da-4d56-93b7-84f118b4f371 | random_key   | Mock Person Name      | 24182533410          | 4850813-8       | 1                | 416968 | 
| +5568911168384                       | phone_number | Mock Person Name      | 17413005255          | 4850813-8       | 1                | 416968 | 
| pix06@pix06.com                      | email        | Mock Person Name      | 81035632691          | 4750813-8       | 1                | 416968 | 
| pix31@pix31.com                      | email        | Mock Person Name      | 55125236780          | 1768538-4       | 2960             | 416968 |
| 8501216b-d676-4927-be65-060d3d4394fb | random_key   | Mocked Enterprise S.A | 40008675000100       | 1049122-2       | 1                | 416968 |
| pix_key@mockenterprise.com.br        | email        | Mocked Enterprise S.A | 40008675000100       | 1049122-2       | 1                | 416968 |
| 40008675000100                       | cnpj         | Mocked Enterprise S.A | 40008675000100       | 1049122-2       | 1                | 416968 |
| +5568956720123                       | phone_number | Mocked Enterprise S.A | 40008675000100       | 1049122-2       | 1                | 416968 |

## 260 - NU PAGAMENTOS - IP

| Pix Key                            | Type         | Owner name  | Owner document number | Account number | Account agency | ISPB   
|--------------------------------------|--------------|------------------|----------------------|-----------------|------------------|----------|
| pix04@pix04.com                      | email        | Mock Person Name | 69017362073          | 81648459-8      | 1                | 18236120 | 
| pix09@pix09.com                      | email        | Mock Person Name | 34175131205          | 81538459-8      | 1                | 18236120 | 
| 5e6ce01a-e0da-4d56-93b8-44f118b4f371 | random_key   | Mock Person Name | 17413005255          | 81548459-8      | 1                | 18236120 | 
| +5568911186420                       | phone_number | Mock Person Name | 81035632691          | 81538459-8      | 1                | 18236120 | 
| pix32@pix32.com                      | email        | Mock Person Name | 56151446887          | 293201-6        | 2811             | 18236120 | 

## 336 - BCO C6 S.A.

| Pix Key                            | Type         | Owner name  | Owner document number | Account number | Account agency | ISPB   
|--------------------------------------|------------|------------------|----------------------|-----------------|------------------|----------|
| dbbf965d-677c-49ff-b9da-5131da1505f3 | random_key | Mock Person Name | 65322181032          | 1019902-6       | 1                | 31872495 | 
| 5e6ce07a-e0da-4d56-93b8-84f118b4f371 | random_key | Mock Person Name | 11085087824          | 1018902-6       | 1                | 31872495 | 
| 11646288874                          | cpf        | Mock Person Name | 11646288874          | 1017902-6       | 1                | 31872495 | 

## 403 - CORA SCD S.A.

| Pix Key                            | Type         | Owner name  | Owner document number | Account number | Account agency | ISPB   
|----------------|------|-----------------|----------------------|-----------------|------------------|----------|
| 39284100000000 | cnpj | Parcela Mais    | 39284100000000       | 1708315-8       | 1                | 37880206 | 

## 422 - BCO SAFRA S.A.
| Pix Key                            | Type         | Owner name  | Owner document number | Account number | Account agency | ISPB   
|-----------------|--------------|------------------|----------------------|-----------------|------------------|----------|
| pix02@pix02.com | email        | Mock Person Name | 69017362073          | 364522-5        | 284              | 58160789 | 
| pix08@pix08.com | email        | Mock Person Name | 34175131205          | 264522-5        | 284              | 58160789 | 
| +5568911106070  | phone_number | Mock Person Name | 11646288874          | 354522-5        | 284              | 58160789 | 
| 53465252110     | cpf          | Mock Person Name | 53465252110          | 364422-5        | 284              | 58160789 | 
| +5568911122488  | phone_number | Mock Person Name | 10632271             | 1558321-5       | 907              | 58160789 | 

## 655 - BCO VOTORANTIM S.A.

| Pix Key                            | Type         | Owner name  | Owner document number | Account number | Account agency | ISPB   
|------------|------|------------------|----------------------|-----------------|------------------|----------|
| 5301321099 | cpf  | Mock Person Name | 5301321099           | 622660113-8     | 1111             | 59588111 | 

## DOCK SOLUCOES EM MEIOS DE PAGAMENTO S A

| Pix Key                            | Type         | Owner name  | Owner document number | Account number | Account agency | ISPB   
|--------------------------------------|--------------|------------------|----------------------|-----------------|------------------|---------|
| +5568911165580                       | phone_number | Mock Person Name | 53465252110          | 622470112-8     | 1111             | 8744817 | 
| 17413005255                          | cpf          | Mock Person Name | 17413005255          | 622450112-8     | 1111             | 8744817 | 
| 81035632691                          | cpf          | Mock Person Name | 81035632691          | 622450113-8     | 1111             | 8744817 | 
| 5e6ce05a-e0da-4d56-93b8-64f118b4f371 | random_key   | Mock Person Name | 81035632691          | 622650113-8     | 1111             | 8744817 | 

## COMPANHIA GLOBAL DE SOLUCOES E SERVICOS DE PAGAMENTOS S.A.

| Pix Key                            | Type         | Owner name  | Owner document number | Account number | Account agency | ISPB   
|-------------|------|-----------------|----------------------|-----------------|------------------|----------|
| 96755229091 | cpf  | Teste sem Compe | 96755229091          | 1444301-8       | 1                | 32024691 |

---

# Transfer receipt

URL: /en/documentation/pix/comprovante_de_transferencia

## Request

ENDPOINT /transaction_receipt/TRANSACTION_KEY
METHOD GET

:::info

The response of this request will provide the data related to the queried transaction and if the PDF parameter is true, the "pdf_encoded_string" field will be available with the PDF string encoded in base-64.
:::

### Path params

| Field | Type | Description | Characters |
|---|---|---|---|
| `TRANSACTION_KEY` * | string | Key of the queried transaction. | UUID key |

### Query params
| Field | Type | Description | Characters |
|---|---|---|---|
| `pdf` | boolean | Boolean that defines whether the response should generate a PDF or not. | true/false |

STATUS 200

Response Body: Transaction receipt with key

```json
{
  "is_schedule": true,
  "origin_key": "f7507645-534c-4790-a19c-b89763d42fe5",
  "schedule_date": "2021-11-06",
  "scheduled_for_br_formatted": "Agendado Para 06/11/2021",
  "source_account": {
    "account_branch": "0001",
    "account_digit": "9",
    "account_number": "09661",
    "financial_institution_compe_number": 329,
    "financial_institution_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
    "owner_document_number": "45783565660"
  },
  "source_subtype": "pix_withdrawal",
  "source_subtype_translation_ptbr": "Transferência de PIX",
  "target_account": {
    "account_branch": "3952",
    "account_digit": "8",
    "account_number": "1925255",
    "account_type": "checking_account",
    "account_type_str": "Conta Corrente",
    "financial_institution_compe_number": 237,
    "financial_institution_name": "BANCO BRADESCO S.A.",
    "owner_document_number": "***.221.81*-**",
    "owner_name": "Vivo Test",
    "pix_key": "pix01@pix01.com",
    "pix_transfer_type": "key"
  },
  "transaction_amount": 12.2,
  "transaction_key": "53301505-342a-4bf4-b7de-845e5c79ed02"
}
```

## Response

STATUS 200

Response Body: Manual transaction receipt

```json
{
  "chargeback_returned_amount": null,
  "end_to_end_id": "E3210272497339911957760452404275",
  "is_chargeback": false,
  "pix_message": null,
  "pix_transfer_key": "2c4d15c4-2a03-4979-813e-0ead374686d8",
  "source_account_key": "e10a6f94-facc-4392-9eba-d0d0b278bc5d",
  "receiver_conciliation_id": "REC00000000000000000000009459463343",
  "pix_transfer_type": "transfer",
  "target_account": {
    "account_branch": "3952",
    "account_digit": "8",
    "account_number": "1925255",
    "financial_institution_compe_number": 237,
    "financial_institution_name": "BANCO BRADESCO S.A.",
    "is_internal": false,
    "ispb_number": "60746948",
    "owner_document_number": "***22181***",
    "owner_name": "Vivo Test",
    "target_pix_key": "pix01@pix01.com"
  },
  "transfer_amount": 1891268.97
}
```

STATUS 400

Response Body

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

---

# Comprovante de transferência agendada

URL: /en/documentation/pix/comprovante_de_transferencia_agendada

## Request

ENDPOINT /schedule_receipt/SCHEDULE_KEY
MÉTODO GET

### Path params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---|
| `SCHEDULE_KEY` * | string | Chave da transação agendada. | chave uuid |

STATUS 200

Response Body: Recibo de transação com chave

```json
{
  "is_schedule": true,
  "origin_key": "f7507645-534c-4790-a19c-b89763d42fe5",
  "schedule_date": "2021-11-06",
  "scheduled_for_br_formatted": "Agendado Para 06/11/2021",
  "source_account": {
    "account_branch": "0001",
    "account_digit": "9",
    "account_number": "09661",
    "financial_institution_compe_number": 329,
    "financial_institution_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
    "owner_document_number": "45783565660"
  },
  "source_subtype": "pix_withdrawal",
  "source_subtype_translation_ptbr": "Transferência de PIX",
  "target_account": {
    "account_branch": "3952",
    "account_digit": "8",
    "account_number": "1925255",
    "account_type": "checking_account",
    "account_type_str": "Conta Corrente",
    "financial_institution_compe_number": 237,
    "financial_institution_name": "BANCO BRADESCO S.A.",
    "owner_document_number": "***.221.81*-**",
    "owner_name": "Vivo Test",
    "pix_key": "pix01@pix01.com",
    "pix_transfer_type": "key"
  },
  "transaction_amount": 12.2,
  "transaction_key": "53301505-342a-4bf4-b7de-845e5c79ed02"
}
```

## Response

STATUS 200

Response Body: Recibo de transação manual

```json
{
  "chargeback_returned_amount": null,
  "end_to_end_id": "E3210272497339911957760452404275",
  "is_chargeback": false,
  "pix_message": null,
  "pix_transfer_key": "2c4d15c4-2a03-4979-813e-0ead374686d8",
  "source_account_key": "e10a6f94-facc-4392-9eba-d0d0b278bc5d",
  "receiver_conciliation_id": "REC00000000000000000000009459463343",
  "pix_transfer_type": "transfer",
  "target_account": {
    "account_branch": "3952",
    "account_digit": "8",
    "account_number": "1925255",
    "financial_institution_compe_number": 237,
    "financial_institution_name": "BANCO BRADESCO S.A.",
    "is_internal": false,
    "ispb_number": "60746948",
    "owner_document_number": "***22181***",
    "owner_name": "Vivo Test",
    "target_pix_key": "pix01@pix01.com"
  },
  "transfer_amount": 1891268.97
}
```

STATUS 400

Response Body

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

---

# Consultar chaves Pix

URL: /en/documentation/pix/consultar_chave

## Request

ENDPOINT /baas/pix/keys/ PIX_KEY
MÉTODO GET

### Path params

| Campo       | Tipo   | Descrição                      |
|-------------|--------|--------------------------------|
| `pix_key` * | string | Chave PIX que será consultada. |

:::info Tipos de Chave Pix
A “pix_key” pode ser um CPF, CNPJ, E-mail, Celular ou uma Chave Aleatória (UUID), seguindo as seguintes formatações:

CPF: Número inteiro com 11 dígitos.

CNPJ: Número inteiro com 14 dígitos.

E-mail: Texto contendo ao menos um “@”.

Celular: Texto contendo os seguintes valores: “+55” + “DDD do celular“ + “Número Inteiro do Celular com no mínimo 8 e no máximo 9 dígitos”. Ex: “+5511987654321“.

Chave Aleatória: UUID.
:::

## Response

STATUS 200

Response Body: Chave Ativa

```json
{
  "account_branch": "452",
  "account_digit": "1",
  "account_number": "370158",
  "account_type": "checking_account",
  "bank_code": 237,
  "end_to_end_id": "E3240250220230404185631R0kjZnC6G",
  "exists": true,
  "financial_institution": "BCO BRADESCO S.A.",
  "ispb": "60746948",
  "masked_document_number": "***.141.85*-**",
  "name": "Teste teste",
  "pix_key": "teste@gmail.com",
  "valid": true
}

```

STATUS 200

Response Body: Chave Inativa

```json
{
  "exists": false,
  "pix_key": "teste@gmail.com"
}
```

STATUS 422
Response Body: Tempo limite de consulta de chave

```json
{
    "title": "Pix Key inquiry timeout",
    "description": "Pix key inquiry timeout. Please try again.",
    "translation": "Consulta de chave pix excedeu o tempo limite. Por favor tente novamente.",
    "code": "PIX000069"
}
```

STATUS 422

Response Body: Erro ao consultar chave pix

```json
{
    "title": "Unprocessable Entity",
    "description": "Error when querying pix key 12345678000190",
    "translation": "Erro ao consultar chave pix 12345678000190",
    "code": "PIX000077"
}
```

STATUS 429

Response Body: Limite de requisições atingido

```json
{
    "title": "Rate limit reached",
    "description": "Rate limit reached when checking key in Bacen",
    "translation": "Limite de requisições atingido ao consultar chave no Bacen",
    "code": "PIX000079"
}
```

---

# Consultar chaves Pix

URL: /en/documentation/pix/consultar_chave_v2

## Request

ENDPOINT /pix_key/ PIX_KEY ?authenticated_user_key= CPF/CNPJ
MÉTODO GET

### Request Path Params

| Campo               | Tipo   | Descrição                      | 
|---------------------|--------|--------------------------------|
| `pix_key` * | string | Chave PIX que será consultada. |

:::info Tipos de Chave Pix
A “pix_key” pode ser um CPF, CNPJ, E-mail, Celular ou uma Chave Aleatória (UUID), seguindo as seguintes formatações:

**CPF**: Número inteiro com 11 dígitos.

**CNPJ**: Número inteiro com 14 dígitos.

**E-mail**: Texto contendo ao menos um “@”.

**Celular**: Texto contendo os seguintes valores: “+55” + “DDD do celular“ + “Número Inteiro do Celular com no mínimo 8 e no máximo 9 dígitos”. Ex: “+5511987654321“.

**Chave Aleatória**: UUID4.
:::
### Request Query String Params

| Campo               | Tipo   | Descrição                      |
|---------------------|--------|--------------------------------|
| `authenticated_user_key` * | string | Documento do titular da conta  |

## Response

STATUS 200

Response Body: Chave Ativa

```json
{
  "account_branch": "452",
  "account_digit": "1",
  "account_number": "370158",
  "owner_person_type": "legal",
  "account_type": "checking_account",
  "account_created_at": "2021-10-22T20:30.459Z",
  "end_to_end_id": "E3240250220230404185631R0kjZnC6G",
  "financial_institution": "BCO BRADESCO S.A.",
  "ispb": "60746948",
  "owner_masked_document_number": "***.141.857-**",
  "owner_name": "Teste teste",
  "pix_key": "teste@gmail.com",
  "owner_trading_name": "Teste LTDA."
}

```

| Campo | Tipo | Descrição | Max. Caracteres |
|-------|------|-----------|-----------------|
| `account_branch` *| string | Agência, sem o dígito verificador. | 4 |
| `account_digit` *| string | Dígito verificador da conta. | 1 |
| `account_number` *| string | Número de conta, sem o dígito verificador. | 20 |
| `account_type` *| string | Definição do tipo de conta. | 20 |
| `owner_person_type` *| string | Tipo de dono da conta. Pode ser "legal" ou "natural" | 7 |
| `owner_masked_document_number`* | string | Numero de CPF ou CNPJ. | 14 |
| `owner_name` *| string | Nome do dono da conta. | 120 |
| `owner_trading_name` | string | Nome fantasia do dono da conta (somente para CNPJ). | 100 |
| `ispb` *| string | ISPB do Participate detentor da chave. | 8 |
| `financial_institution` *| string | Nome da instituição financeira detentora da chave. | 200 |
| `created_at` *| datetime Zulu | Data de criação da requisição. | 20 |

STATUS 404

Response Body: Chave Inativa

```json
{
  "title": "Pix Key Not Found",
  "description": "Pix key edd5d727-ddd6-4bbb-8463-2ff1bdb28c89 not found.", 
  "translation": "A chave pix edd5d727-ddd6-4bbb-8463-2ff1bdb28c89 não foi encontrada.",
  "code": "PIX000017"
}
```

STATUS 4XX

Response Body

```json
{
    "title": "titulo",
    "description": "description in English",
    "translation": "descrição em portugues",
    "code": "codigo"
}
```

|Código HTTP | Código QI<br/>`code` | Título<br/>`title` | Descrição (eng)<br/>`Description` | Descrição (ptbr)<br/>`translation` |
|------------|-------------------|----------------|------------------------------|-----------------------------|
| 403        | PIX000080         | Not enough permission | The selected agent doesn't have permission to access this resource. | O agente selecionado não tem permissão para acessar este recurso. |
| 429        | PIX000081         | Rate Limit Exceeded | Rate Limit Exceeded | Limite de requisições excedido |
| 404        | PIX000082         | Alias not found | Alias \{alias_key\} not found | Alias \{alias_key\} não encontrado |
| 404        | PIX000083         | Pix Key not found | Pix Key \{pix_key\} not found for Alias \{alias_key\} | Chave Pix \{pix_key\} não encontrada para o Alias \{alias_key\} |
| 400        | PIX000084         | Only one query param allowed | Only one query param allowed | Somente um parâmetro de consulta é permitido |

---

# Create Pix Key

URL: /en/documentation/pix/criar_chave

## Create Pix Key CPF, CNPJ or Random

### Request

- MÉTODO POST
- ENDPOINT /baas/pix/keys

Request Body

```json
{
    "account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
    "pix_key_type": "random_key"
}
```

Request Body

```json
{
    "account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
    "pix_key_type": "cnpj",
    "pix_key": "09080702000105"
}
```

Request Body

```json
{
    "account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
    "pix_key_type": "cpf",
    "pix_key": "03882617038"
}
```

:::info Types of Pix Key
The “pix_key” can be a CPF, CNPJ, Email, Mobile Number, or a Random Key (UUID), following these formats:
**CPF**: Integer number with 11 digits.
**CNPJ**: Integer number with 14 digits.
**Email**: Text containing at least one “@”.
**Mobile Number**: Text containing the following values: “+55” + “Cell Phone Area Code“ + “Cell Phone Number with a minimum of 8 and a maximum of 9 digits”. Example: “+5511987654321“.
**Random Key**: UUID.
:::

:::info CPF/CNPJ Rule on Sandbox Environment
To simulate approval and rejection scenarios, use the first digit of the CPF/CNPJ of the Pix key owner being created:

1, 2, 3, 4, 5 -> Automatically rejected
0, 6, 7, 8, 9 -> Automatically approved
:::

### Response

- MÉTODO POST
- ENDPOINT /baas/pix/keys

Response Body

```json
{
	"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
	"created_at": "2022-09-02T18:20:52",
	"pix_key": {
		"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
		"created_at": "2022-09-02T18:20:51",
		"pix_key": "09080702000105",
		"pix_key_status": "pending_confirmation",
		"pix_key_type": "cnpj",
		"updated_at": "2022-09-02T18:20:51"
	},
	"pix_key_request_key": "d60abf67-ad9c-42ee-9089-d26c8fc855b9",
	"request_data": {
		"account_created_at": "2022-09-02T22:44:36",
		"account_digit": "2",
		"account_number": "2359934",
		"account_type": "checking",
		"branch_number": "0001",
		"key": "09080702000105",
		"owner_document_number": "09080702000105",
		"owner_name": "VOVO LUCIA CONVENIENCIA LTDA",
		"owner_person_type": "legal",
		"trading_name": "VOVO LUCIA"
	},
	"request_failure_reason": null,
	"request_status": "pending",
	"request_type": "inclusion",
	"requester_key": "ef48fbe4-267b-45c1-9049-75345c075486",
	"updated_at": "2022-09-02T18:20:52"
}
```

STATUS 400

Response Body: Pix Key already exists.

  ```json
  {
    "title": "Bad Request",
    "description": "Pix key: \{pix_key\} already exists.",
    "translation": "A chave pix: \{pix_key\} já existe.",
    "code": "PIX000065"
  }
  ```

STATUS 404

Response Body: Account not found

    ```json
    {
        "title": "Account not found",
        "description": "Conta não encontrada para account_key: \{account_key\}",
        "translation": "Conta não encontrada para account_key: \{account_key\}",
        "code": "PIX000026"
    }
    ```

STATUS 400

Response Body: Person not found

    ```json
    {
        "title": "Person not found",
        "description": "Pessoa não encontrada para person_key: \{person_key\}",
        "translation": "Pessoa não encontrada para person_key: \{person_key\}",
        "code": "PIX000027"
    }
    ```

STATUS 400

Response Body: Pix Key Creation Non Finished

    ```json
    {
        "title": "Pix Key Creation Non Finished",
        "description": "A chave pix \{pix_key\} já possui um pedido de criação não finalizado.",
        "translation": "A chave pix \{pix_key\} já possui um pedido de criação não finalizado.",
        "code": "PIX000074"
    }
    ```

STATUS 400

Response Body: Maximum Number of Pix Keys in Use

    ```json
    {
        "title": "Maximum Number of Pix Keys in Use",
        "description": "A conta \{account_key\} já atingiu o número máximo de chaves pix.",
        "translation": "A conta \{account_key\} já atingiu o número máximo de chaves pix.",
        "code": "PIX000014"
    }
    ```

STATUS 400

Response Body: Account is not Opened

    ```json
    {
        "title": "Account is not Opened",
        "description": "A conta \{account_key\} não está aberta.",
        "translation": "A conta \{account_key\} não está aberta.",
        "code": "PIX000002"
    }
    ```

STATUS 403

Response Body: Invalid Permission

    ```json
    {
        "title": "Invalid Permission",
        "description": "A pessoa \{person_key\} não possui credenciais de administrador para a conta \{account_key\}.",
        "translation": "A pessoa \{person_key\} não possui credenciais de administrador para a conta \{account_key\}.",
        "code": "PIX000054"
    }
    ```

STATUS 422

Response Body: Attempted CPF Pix Key is Not that of Account Owner

    ```json
    {
        "title": "Attempted CPF Pix Key is Not that of Account Owner",
        "description": "A chave pix fornecida \{pix_key\} não corresponde ao CPF {document_number} do titular da conta.",
        "translation": "A chave pix fornecida \{pix_key\} não corresponde ao CPF {document_number} do titular da conta.",
        "code": "PIX000020"
    }
    ```

:::caution Attention
In the case of the Response for the creation of a **Random** Pix Key, the field “***pix_key***” will return a null value. To retrieve the value of the generated random key, it is necessary to perform a query to the list of keys registered in an account or through the activation webhook.
:::

:::caution Attention
The creation of keys is asynchronous, so the key will only be available for use after receiving the [pix key inclusion webhook.](#webhook-de-inclusao-de-chave-pix)
:::

## Create Pix Key for Email and Mobile

**To create the key:** POST to the endpoint “**/baas/pix/keys**”. At this moment, a token will be sent to the Email or Mobile number provided in the “***pix_key***” field.

### Request

- MÉTODO POST
- ENDPOINT /baas/pix/keys

Request Body

```json
{
    "account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
    "pix_key_type": "email",
    "pix_key": "vovo.lucia@gmail.com.br"
}
```

Request Body

```json
{
    "account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
    "pix_key_type": "phone_number",
    "pix_key": "+5511987654321"
}

```

### Response

- MÉTODO POST
- ENDPOINT /baas/pix/keys

Response Body

```json
{
	"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
	"created_at": "2022-09-02T17:41:55",
	"pix_key": {
		"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
		"created_at": "2022-09-02T17:41:54",
		"pix_key": "pedro.pinho@qitech.com.br",
		"pix_key_status": "pending_confirmation",
		"pix_key_type": "email",
		"updated_at": "2022-09-02T17:41:54"
	},
	"pix_key_request_key": "f6209b7e-82da-44a8-9cfa-6ad0a689adb2",
	"request_data": {
		"account_created_at": "2022-09-02T22:44:36",
		"account_digit": "2",
		"account_number": "2359934",
		"account_type": "checking",
		"branch_number": "0001",
		"key": "pedro.pinho@qitech.com.br",
		"owner_document_number": "09080702000105",
		"owner_name": "VOVO LUCIA CONVENIENCIA LTDA",
		"owner_person_type": "legal",
		"trading_name": "VOVO LUCIA"
	},
	"request_failure_reason": null,
	"request_status": "pending_validation",
	"request_type": "inclusion",
	"requester_key": "ef48fbe4-267b-45c1-9049-75345c075486",
	"updated_at": "2022-09-02T17:41:55"
}
```

STATUS 400

Response Body: Already exists.

  ```json
  {
    "title": "Bad Request",
    "description": "Pix key: \{pix_key\} already exists.",
    "translation": "A chave pix: \{pix_key\} já existe.",
    "code": "PIX000065"
  }
  ```

STATUS 404

Response Body: Account not found

    ```json
    {
        "title": "Account not found",
        "description": "Conta não encontrada para account_key: \{account_key\}",
        "translation": "Conta não encontrada para account_key: \{account_key\}",
        "code": "PIX000026"
    }
    ```

STATUS 400

Response Body: Person not found

    ```json
    {
        "title": "Person not found",
        "description": "Pessoa não encontrada para person_key: \{person_key\}",
        "translation": "Pessoa não encontrada para person_key: \{person_key\}",
        "code": "PIX000027"
    }
    ```

STATUS 400

Response Body: Pix Key Creation Non Finished

    ```json
    {
        "title": "Pix Key Creation Non Finished",
        "description": "A chave pix \{pix_key\} já possui um pedido de criação não finalizado.",
        "translation": "A chave pix \{pix_key\} já possui um pedido de criação não finalizado.",
        "code": "PIX000074"
    }
    ```

STATUS 400

Response Body: Maximum Number of Pix Keys in Use

    ```json
    {
        "title": "Maximum Number of Pix Keys in Use",
        "description": "A conta \{account_key\} já atingiu o número máximo de chaves pix.",
        "translation": "A conta \{account_key\} já atingiu o número máximo de chaves pix.",
        "code": "PIX000014"
    }
    ```

STATUS 400

Response Body: Account is not Opened

    ```json
    {
        "title": "Account is not Opened",
        "description": "A conta \{account_key\} não está aberta.",
        "translation": "A conta \{account_key\} não está aberta.",
        "code": "PIX000002"
    }
    ```

STATUS 403

Response Body: Invalid Permission

    ```json
    {
        "title": "Invalid Permission",
        "description": "A pessoa \{person_key\} não possui credenciais de administrador para a conta \{account_key\}.",
        "translation": "A pessoa \{person_key\} não possui credenciais de administrador para a conta \{account_key\}.",
        "code": "PIX000054"
    }
    ```

STATUS 422

Response Body: Attempted CPF Pix Key is Not that of Account Owner

    ```json
    {
        "title": "Attempted CPF Pix Key is Not that of Account Owner",
        "description": "A chave pix fornecida \{pix_key\} não corresponde ao CPF {document_number} do titular da conta.",
        "translation": "A chave pix fornecida \{pix_key\} não corresponde ao CPF {document_number} do titular da conta.",
        "code": "PIX000020"
    }
    ```

**IMPORTANT:** The value returned in the “pix_key_request_key” field must be used in the URL of the request to approve the creation of the Pix Key.

## Approval of Pix Key for Email or Mobile

### Request

- METHOD PATCH
- ENDPOINT /baas/pix/keys/ PIX_KEY_REQUEST_KEY /twofa_validation

Request Body

```json
{
    "verification_code": "756816"
}
```

### Response

Response Body

```json
{
	"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
	"created_at": "2022-09-02T17:41:55",
	"pix_key": {
		"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
		"created_at": "2022-09-02T17:41:54",
		"pix_key": "pedro.pinho@qitech.com.br",
		"pix_key_status": "pending_confirmation",
		"pix_key_type": "email",
		"updated_at": "2022-09-02T17:41:54"
	},
	"pix_key_request_key": "f6209b7e-82da-44a8-9cfa-6ad0a689adb2",
	"request_data": {
		"account_created_at": "2022-09-02T22:44:36",
		"account_digit": "2",
		"account_number": "2359934",
		"account_type": "checking",
		"branch_number": "0001",
		"key": "pedro.pinho@qitech.com.br",
		"owner_document_number": "09080702000105",
		"owner_name": "VOVO LUCIA CONVENIENCIA LTDA",
		"owner_person_type": "legal",
		"trading_name": "VOVO LUCIA"
	},
	"request_failure_reason": null,
	"request_status": "pending",
	"request_type": "inclusion",
	"requester_key": "ef48fbe4-267b-45c1-9049-75345c075486",
	"updated_at": "2022-09-02T17:41:55"
}
```

STATUS 404

Response Body: Pix Key Request not found

    ```json
    {
      "title": "Pix Key Request not found",
      "description": "Pix Key Request not found for key: {pix_key_request_key}.",
      "translation": "Pix Key Request não encontrada para a chave: {pix_key_request_key}.",
      "code": "PIX000008"
    }
    ```

STATUS 403

Response Body: Permission Validator Error

    ```json
    {
        "title": "Permission Validator Error",
        "description": "Selected agent do not own this item.",
        "translation": "O agente selecionado não é dono do item.",
        "code": "QIT000005"
    }
    ```

STATUS 400

Response Body: Key request does not have validation

    ```json
    {
        "title": "Key request does not have validation",
        "description": "Key request does not have two steps validation",
        "translation": "Pedido de criação não possui validação de duas etapas",
        "code": "PIX000075"
    }
    ```

STATUS 400

Response Body: Key Request Is Not Pending Validation

    ```json
    {
        "title": "Key Request Is Not Pending Validation",
        "description": "Key request {pix_key_request_key}, is not pending validation.",
        "translation": "Pedido de criação {pix_key_request_key}, não está pendente de validação.",
        "code": "PIX000076"
    }
    ```

STATUS 404

Response Body: Expired Token Code

    ```json
    {
        "title": "Gone",
        "description": {
            "description": "Expired Code.",
            "translation": "Código de verificação expirado."
        },
        "translation": {},
        "extra_fields": {},
        "code": "2FA000410"
    }
    ```

STATUS 403

Response Body: Token already verified

    ```json
    {
        "title": "Forbidden",
        "description": {
            "description": "Code already verified.",
            "translation": "Este código já foi utilizado."
        },
        "translation": {},
        "extra_fields": {},
        "code": "2FA000403"
    }
    ```

## Resend the approval token

### Request

- METHOD PATCH
- ENDPOINT /baas/pix/keys/ PIX_KEY_REQUEST_KEY /resend_twofa

Request Body

```json
{}
```

### Response

Response Body

```json
{
	"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
	"created_at": "2022-09-02T17:41:55",
	"pix_key": {
		"account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
		"created_at": "2022-09-02T17:41:54",
		"pix_key": "pedro.pinho@qitech.com.br",
		"pix_key_status": "pending_confirmation",
		"pix_key_type": "email",
		"updated_at": "2022-09-02T17:41:54"
	},
	"pix_key_request_key": "f6209b7e-82da-44a8-9cfa-6ad0a689adb2",
	"request_data": {
		"account_created_at": "2022-09-02T22:44:36",
		"account_digit": "2",
		"account_number": "2359934",
		"account_type": "checking",
		"branch_number": "0001",
		"key": "pedro.pinho@qitech.com.br",
		"owner_document_number": "09080702000105",
		"owner_name": "VOVO LUCIA CONVENIENCIA LTDA",
		"owner_person_type": "legal",
		"trading_name": "VOVO LUCIA"
	},
	"request_failure_reason": null,
	"request_status": "pending_validation",
	"request_type": "inclusion",
	"requester_key": "ef48fbe4-267b-45c1-9049-75345c075486",
	"updated_at": "2022-09-02T17:41:55"
}
```

STATUS 404

Response Body: Pix Key Request not found

    ```json
    {
      "title": "Pix Key Request not found",
      "description": "Pix Key Request not found for key: {pix_key_request_key}.",
      "translation": "Pix Key Request não encontrada para a chave: {pix_key_request_key}.",
      "code": "PIX000008"
    }
    ```

STATUS 403

Response Body: Permission Validator Error

    ```json
    {
        "title": "Permission Validator Error",
        "description": "Selected agent do not own this item.",
        "translation": "O agente selecionado não é dono do item.",
        "code": "QIT000005"
    }
    ```

STATUS 400

Response Body: Key request does not have validation

    ```json
    {
        "title": "Key request does not have validation",
        "description": "Key request does not have two steps validation",
        "translation": "Pedido de criação não possui validação de duas etapas",
        "code": "PIX000075"
    }
    ```

STATUS 400

Response Body: Key Request Is Not Pending Validation

    ```json
    {
        "title": "Key Request Is Not Pending Validation",
        "description": "Key request {pix_key_request_key}, is not pending validation.",
        "translation": "Pedido de criação {pix_key_request_key}, não está pendente de validação.",
        "code": "PIX000076"
    }
    ```

### Pix Key Inclusion Webhook

WEBHOOK_TYPE key_inclusion
STATUS approved

Webhook Body

```json
{
	"pix_key": "c232142c-ddbf-41d6-a54f-3b90c28b97dc",
	"account_key": "94945886-7a6f-43e6-a307-e36c959e4903",
	"webhook_type": "key_inclusion",
	"pix_key_status": "active",
	"pix_key_request_key": "e274eb13-40b3-4902-978e-8e5fa267af53",
	"pix_key_request_type": "inclusion",
	"pix_key_request_status": "approved"
}
```

WEBHOOK_TYPE key_inclusion
STATUS failed

Webhook Body

```json
{
	"pix_key": "03882617038",
	"account_key": "94945886-7a6f-43e6-a307-e36c959e4903",
	"webhook_type": "key_inclusion",
	"pix_key_status": "inactivated",
	"pix_key_request_key": "e274eb13-40b3-4902-978e-8e5fa267af53",
	"pix_key_request_type": "inclusion",
	"pix_key_request_status": "failed",
	"request_failure_reason": "DCT200016"
}
```

:::info Request Failure Reason Codes
- DCT200012: There is already a binding for this key, but it is owned by another person. A possession claim is recommended.
- DCT200013: There is already a binding for this key with the same owner, but it is associated with another participant. A portability claim is recommended.
- DCT200014: There is an ongoing claim with a status other than completed or canceled for the key binding. While in this state, the binding cannot be deleted.
- DCT200015: Validation of the parameters provided in the request failed.
- DCT200016: The key holder (CPF/CNPJ) has an irregular registration status. PIX key inclusion is not allowed until the registration is regularized.
:::

---

# Create dynamic QR Code

URL: /en/documentation/pix/criar_qr_code_dinamico

## Request

ENDPOINT /baas/qrcode/dynamic
METHOD POST

Request Body: With expiration date

```json
{
  "account_key": "f0d363be-fc49-4cfc-a1f8-c8d4d4195095",
  "amount": 22.34,
  "occurrence_type": "registration",
  "payer_document_number": "00000000000000",
  "payer_name": "Random",
  "payer_person_type": "legal",
  "payer_request": "Payment for order XXXXXXXXXX",
  "pix_key": "3d7d6a2b-f72f-44z7-bb20-79a94dff5645",
  "qr_code_type": "dynamic_term",
  "additional_data": [
    {
      "key_name": "Juros e Multa",
      "value": "Juros 2 ao mes e multa de 1%"
    }
  ],
  "fine_amount": 3,
  "interest_amount": 2,
  "expiration_date": "2023-03-25",
  "max_payment_days": 128,
  "rebate_amount": 1,
  "discounts": []
}

```

Request Body: Immediate payment

```json
{
  "account_key": "f0d363be-fc49-4cfc-a1f8-c8d4d4195095",
  "amount": 22.34,
  "expiration_seconds": 864000,
  "occurrence_type": "registration",
  "payer_document_number": "00000000000000",
  "payer_name": "Random",
  "payer_person_type": "legal",
  "payer_request": "Payment for order XXXXXXXXXX",
  "pix_key": "3d7d6a2b-f72f-44z7-bb20-79a94dff5645",
  "qr_code_type": "dynamic_instant",
  "additional_data": [
    {
      "key_name": "Juros e Multa",
      "value": "Juros 2 ao mes e multa de 1%"
    }
  ],
  "fine_amount": 3,
  "interest_amount": 2,
  "max_payment_days": 128,
  "rebate_amount": 1,
  "discounts": []
}

```

### Body Params
| Field | Type | Description | Characters |
|---|---|---|---|
| `amount` * | float | QR Code amount before calculating discounts or interest and fines. | - |
| `occurrence_type` * | string |Type of occurrence. payment: Payment occurrence, registration: Registration occurrence, write_off: Generator cancellation occurrence, bank_written_off: Bank cancellation occurrence. | - |
| `qr_code_type` * | string | Type of dynamic QR Code | - |
| `pix_key` * | string | Pix key representing the destination account of the transaction. | - |
| `expiration_date` | date | Due date of the charge (in the format "YYYY-MM-DD") | - |
| `expiration_seconds` | string | Indicates the validity time of the QR Code in seconds, default is 1 day. | - |
| `payer_name` * | string | Name of the payer. | - |
| `payer_document_number` * | string | Payer's CPF. | - |
| `payer_person_type` * | string | Type of person (natural = individual or legal = entity). | - |
| `payer_request` * | string | Message to the payer. | - |
| `additional_data` * | array of objects | Information that will be presented to the payer. | - |
| `max_payment_days` * | int32 | Maximum days for charge payment. | - |
| `rebate_amount` * | float | Absolute rebate amount before payment. | - |
| `interest_amount` * | float | Absolute amount per day of delay after the due date, if paid a day after the due date the total amount will be the ordinary amount + fine. | - |
| `fine_amount` * | float | Fine in absolute value after the due date. | - |
| `discounts` * | array of objects | Discount settings. | - |

### Object additional_data

| Field | Type | Description | Characters |
|---|---|---|---|
| `key_name` * | string | Field name | - |
| `value` | string | Field value | - |

### Object discount
| Field | Type | Description | Characters |
|---|---|---|---|
| `discount_value` * | float | Discount value. | - |
| `discount_number` | int32 | Order in which the discount should be applied. | - |
| `discount_limit_date` | string | Discount limit date. | - |

## Response

STATUS 200

Response Body: With expiration date

```json
{
  "qr_code_type": "dynamic_instant",
  "amount": 22.34,
  "expiration_seconds": null,
  "max_payment_days": null,
  "receiver_conciliation_id": "01GVGV9NXBCY287Z6CJ4S0ENW9",
  "payer_name": "Random",
  "payer_document_number": "00000000000000",
  "payer_person_type": "legal",
  "payer_request": "Payment for order XXXXXXXXXXXX",
  "pix_message": null,
  "modality_alteration": false,
  "expiration_date": "2023-03-25",
  "rebate_amount": 1,
  "interest_amount": 2,
  "fine_amount": 3,
  "paid_amount": null,
  "discounts": [],
  "additional_data": [],
  "origin": "system",
  "origin_key": null,
  "pix_key": "3d7d6a2b-f72f-44z7-bb20-79a94dff5645",
  "qr_code_key": "6fd14834-03e3-4777-b907-d2c43d4c2a1e",
  "occurrence_type": "registration",
  "end_to_end_id": null,
  "source_account_branch": null,
  "source_account_financial_institution": null,
  "source_account_ispb": null,
  "source_account_number": null,
  "source_account_digit": null,
  "disable": null,
  "qr_code_occurrence_key": "38c55754-2c26-4065-aa21-240c6b9a8ce7",
  "base_64": "\<URI from Pix copia e cola\>",
  "image": "\<BASE64 IMAGE\>"
}

```

STATUS 200

Response Body: Immediate payment

```json
{
  "qr_code_type": "dynamic_instant",
  "amount": 22.34,
  "expiration_seconds": 864000,
  "max_payment_days": null,
  "receiver_conciliation_id": "01GVGV9NXBCY287Z6CJ4S0ENW9",
  "payer_name": "Random",
  "payer_document_number": "00000000000000",
  "payer_person_type": "legal",
  "payer_request": "Payment for order XXXXXXXXXXXX",
  "pix_message": null,
  "modality_alteration": false,
  "expiration_date": null,
  "rebate_amount": 1,
  "interest_amount": 2,
  "fine_amount": 3,
  "paid_amount": null,
  "discounts": [],
  "additional_data": [],
  "origin": "system",
  "origin_key": null,
  "pix_key": "3d7d6a2b-f72f-44z7-bb20-79a94dff5645",
  "qr_code_key": "6fd14834-03e3-4777-b907-d2c43d4c2a1e",
  "occurrence_type": "registration",
  "end_to_end_id": null,
  "source_account_branch": null,
  "source_account_financial_institution": null,
  "source_account_ispb": null,
  "source_account_number": null,
  "source_account_digit": null,
  "disable": null,
  "qr_code_occurrence_key": "38c55754-2c26-4065-aa21-240c6b9a8ce7",
  "base_64": "\<URI from Pix copia e cola\>",
  "image": "\<BASE64 IMAGE\>"
}

```

STATUS 400

Response Body

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

```

---

# Create static QR Code

URL: /en/documentation/pix/criar_qr_code_estatico

## Request

ENDPOINT /baas/qrcode/static
METHOD POST

Request Body

```json
{
    "qr_code_format": "both",
    "pix_key": "3d7d6a2b-f72f-44c7-bb20-79a94dff5954",
    "receiver_name": "Tywin Lannister",
    "amount": 10.25
}

```

### Body params

| Field | Type | Description | Characters |
|---|---|---|---|
| `qrcode_format` | string | Indicates the type of return after the QR Code is generated (image, payload, both: default). | - |
| `pix_key` * | string | Pix key linked to the receiving account when executing the payment with the QR Code. | 10 |
| `receiver_name` * | string | Name of the account owner. | - |
| `amount` | float | QR Code amount. If not provided, the payer must enter the total during the transfer. | - |

## Response

STATUS 200

Response Body

```json
{
  "image": "\<IMAGE BASE64\>",
  "payload": "\<URI from Pix copia e cola\>"
}

```

STATUS 400

Response Body

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

```

---

# Decode Pix QR Code

URL: /en/documentation/pix/decodificar_qr_code

Decodes a Pix QR Code returning the data contained in the payload. It does not perform a DICT lookup on the destination account and does not persist the consulted QR Code — suitable for preview flows prior to a payment decision.

## Request

ENDPOINT /pix/decode_qrcode_payload
METHOD POST

Request Body

```json
{
   "qr_code_payload": "00020126580014br.gov.bcb.pix0136a23bf0e9-5175-4829-bf89-e8fe6ac09aa1520400005303986540530.005802BR5914TywinLannister6008saopaulo62070503***6304D4FD"
}
```

### Body Params

| Field               | Type   | Description             | Characters |
|---------------------|--------|-------------------------|------------|
| `qr_code_payload` * | string | Pix Copy and Paste      | -          |

## Response

STATUS 200

Response Body: Static QR Code

```json
{
  "qr_code_type": "static",
  "qr_code_payload": "00020126580014br.gov.bcb.pix0136a23bf0e9-5175-4829-bf89-e8fe6ac09aa1520400005303986540530.005802BR5914TywinLannister6008saopaulo62070503***6304D4FD",
  "pix_key": "a23bf0e9-5175-4829-bf89-e8fe6ac09aa1",
  "transfer_amount": "30.00",
  "additional_data": null,
  "qr_code_data": {
    "target_pix_key": "a23bf0e9-5175-4829-bf89-e8fe6ac09aa1",
    "amount": "30.00",
    "receiver_conciliation_id": "***",
    "additional_data": [],
    "category_code": "0000",
    "city": "saopaulo",
    "postal_code": null,
    "reusable_qrcode": "no"
  }
}
```

STATUS 200

Response Body: Dynamic QR Code — immediate payment

```json
{
  "qr_code_type": "dynamic_instant",
  "qr_code_payload": "00020101021226850014br.gov.bcb.pix2563qrcodepix.bb.com.br/pix/v2/d373e385-dfe7-49f6-b9ec-14ba60a9b8285204000053039865802BR5925TESTE62070503***63047B7D",
  "pix_key": "teste.cobrancapix@gmail.com.br",
  "receiver_conciliation_id": "fgnb4NTt7pOUBGfrcporERwVVqr0f8PWRfK",
  "amount": "9367.61",
  "status": "ATIVA",
  "qr_code_data": {
    "target_pix_key": "teste.cobrancapix@gmail.com.br",
    "receiver_conciliation_id": "fgnb4NTt7pOUBGfrcporERwVVqr0f8PWRfK",
    "amount": "9367.61",
    "can_change": "no",
    "expiration_seconds": 201574,
    "created_at": "2023-03-13T19:00:28.440Z",
    "presented_at": "2023-03-14T19:07:48.729Z",
    "question_to_payer": "Liquidacao de Parcelas",
    "status": "ATIVA",
    "revision": 0,
    "category_code": "0000",
    "city": "RIO DE JANEIRO",
    "postal_code": null,
    "reusable_qrcode": "no",
    "receiver_url": "qrcodepix.bb.com.br/pix/v2/d373e385-dfe7-49f6-b9ec-14ba60a90000",
    "additional_data": [],
    "payer_name": "ISMAEL FATIMA AMARAL",
    "payer_document_number": "10003550206",
    "payer_person_type": "natural",
    "target_name": "TESTE LTDA.",
    "target_trading_name": null,
    "address": "Rua Tapajos, 941",
    "state": "RJ"
  }
}
```

STATUS 200

Response Body: Dynamic QR Code — with due date

```json
{
  "qr_code_type": "dynamic_term",
  "qr_code_payload": "00020101021226840014br.gov.bcb.pix2562invoice.starkbank.com/v2/cobv/8b434df48c30482a81f7c936ae35cc123456000053039865802BR5925Oncred Sociedade de Credi6015TESTE 62070503***6304D008",
  "pix_key": "e623e7b0-d00a-400e-aee6-79632430e817",
  "receiver_conciliation_id": "8b434df48c30482a81f7c936ae35cc87",
  "amount": "55.59",
  "status": "ATIVA",
  "qr_code_data": {
    "target_pix_key": "e623e7b0-d00a-400e-aee6-79632430e817",
    "receiver_conciliation_id": "8b434df48c30482a81f7c936ae35cc87",
    "original_amount": "55.59",
    "reduction_amount": null,
    "discount_amount": null,
    "fee_amount": null,
    "fine_amount": null,
    "amount": "55.59",
    "due_date": "2023-03-27",
    "days_after_due_accepted": 16,
    "created_at": "2023-01-10T19:49:58.30Z",
    "presented_at": "2023-03-10T15:32:15.87Z",
    "question_to_payer": null,
    "status": "ATIVA",
    "revision": 0,
    "category_code": "0000",
    "reusable_qrcode": "no",
    "receiver_url": "invoice.starkbank.com/v2/cobv/8b434df48c30482a81f7c936ae351234",
    "additional_data": [],
    "payer_name": "Willian Rocha",
    "payer_document_number": "00000000000",
    "payer_person_type": "natural",
    "target_name": "TESTE LTDA.",
    "target_trading_name": null,
    "address": "Rua Tapajos, 941",
    "state": "SP",
    "city": "Sao Caetano do Sul",
    "postal_code": "09551230"
  }
}
```

### Response fields

| Field                              | Type            | Description                                                                                | Present in        |
|------------------------------------|-----------------|--------------------------------------------------------------------------------------------|-------------------|
| `qr_code_type`                     | string          | QR Code type: `static`, `dynamic_instant` or `dynamic_term`                                | All               |
| `qr_code_payload`                  | string          | Original EMV payload sent in the request                                                   | All               |
| `qr_code_data.target_pix_key`      | string          | Recipient's Pix key                                                                        | All               |
| `qr_code_data.amount`              | string/decimal  | Charge amount. For `dynamic_term`, represents the final amount (after fine/interest/discount) | All           |
| `qr_code_data.receiver_conciliation_id` | string     | Recipient's conciliation identifier (txid)                                                 | All               |
| `qr_code_data.additional_data`     | array           | List of additional info `{name, value}`                                                    | All               |
| `qr_code_data.category_code`       | string          | Merchant category code (MCC)                                                               | All               |
| `qr_code_data.city`                | string          | Recipient's city                                                                           | All               |
| `qr_code_data.postal_code`         | string          | Recipient's ZIP code                                                                       | All               |
| `qr_code_data.reusable_qrcode`     | string          | `yes` if the QR Code can be paid multiple times, `no` otherwise                            | All               |
| `qr_code_data.receiver_url`        | string          | Recipient PSP URL (`loc` field of BR Code)                                                 | `dynamic_*`       |
| `qr_code_data.status`              | string          | Charge status (see enumerators below)                                                      | `dynamic_*`       |
| `qr_code_data.revision`            | integer         | Current revision of the charge                                                             | `dynamic_*`       |
| `qr_code_data.created_at`          | string (ISO)    | Charge creation timestamp at the recipient's PSP                                           | `dynamic_*`       |
| `qr_code_data.presented_at`        | string (ISO)    | Timestamp when the charge was presented to the payer                                       | `dynamic_*`       |
| `qr_code_data.question_to_payer`   | string          | Message from the recipient to the payer (`solicitacaoPagador`)                             | `dynamic_*`       |
| `qr_code_data.payer_name`          | string          | Expected payer's name, when informed by the recipient                                      | `dynamic_*`       |
| `qr_code_data.payer_document_number` | string        | Expected payer's CPF/CNPJ                                                                  | `dynamic_*`       |
| `qr_code_data.payer_person_type`   | string          | `natural` or `legal`                                                                       | `dynamic_*`       |
| `qr_code_data.target_name`         | string          | Recipient's name                                                                           | `dynamic_*`       |
| `qr_code_data.expiration_seconds`  | integer         | Charge validity in seconds, counted from `created_at`                                      | `dynamic_instant` |
| `qr_code_data.can_change`          | string          | `yes` if the payer can change the amount, `no` otherwise                                   | `dynamic_instant` |
| `qr_code_data.original_amount`     | string/decimal  | Original charge amount before fine/interest/discount                                       | `dynamic_term`    |
| `qr_code_data.due_date`            | string (date)   | Charge due date                                                                            | `dynamic_term`    |
| `qr_code_data.days_after_due_accepted` | integer     | Days after the due date during which payment is still accepted                             | `dynamic_term`    |
| `qr_code_data.fine_amount`         | string/decimal  | Fine applied after the due date                                                            | `dynamic_term`    |
| `qr_code_data.fee_amount`          | string/decimal  | Interest applied after the due date                                                        | `dynamic_term`    |
| `qr_code_data.discount_amount`     | string/decimal  | Discount granted before the due date                                                       | `dynamic_term`    |
| `qr_code_data.reduction_amount`    | string/decimal  | Rebate applied to the charge                                                               | `dynamic_term`    |
| `qr_code_data.target_trading_name` | string          | Recipient's trading name                                                                   | `dynamic_*`       |
| `qr_code_data.address`             | string          | Recipient's street address                                                                 | `dynamic_*`       |
| `qr_code_data.state`               | string          | Recipient's state                                                                          | `dynamic_*`       |

:::caution Deprecated root-level fields
The fields below are returned at the root of the response for backward compatibility only and will be removed in a future version. Use the equivalents inside `qr_code_data`.

| Field                      | Equivalent                               | Present in   |
|----------------------------|------------------------------------------|--------------|
| `pix_key`                  | `qr_code_data.target_pix_key`            | All          |
| `transfer_amount`          | `qr_code_data.amount`                    | `static`     |
| `additional_data`          | `qr_code_data.additional_data`           | `static`     |
| `amount`                   | `qr_code_data.amount`                    | `dynamic_*`  |
| `receiver_conciliation_id` | `qr_code_data.receiver_conciliation_id`  | `dynamic_*`  |
| `status`                   | `qr_code_data.status`                    | `dynamic_*`  |
:::

:::info Static QR Code
By the BR Code specification, static QR Codes do not contain expected payer data, expiration date, fine, interest, discount nor rebate. Those fields only exist on dynamic QR Codes.
:::

:::info Status
For the dynamic QR Code type, the status of the QR Code is returned according to the enumerator table below.
:::

#### Dynamic QR Code Status Enumerators

| Enumerator                          | Description                                          |
|-------------------------------------|------------------------------------------------------|
| **ATIVA**                           | Charge available, no payment made                    |
| **CONCLUIDA**                       | Charge paid and finalized                            |
| **REMOVIDA_PELO_USUARIO_RECEBEDOR** | Receiving user requested the charge removal          |
| **REMOVIDA_PELO_PSP**               | Receiving bank requested the charge removal          |

## Errors

STATUS 400

Invalid QR Code format

```json
{
  "data": "{\"title\": \"Invalid Qr Code Format\", \"description\": \"The Qr Code format is invalid, please enter a valid Qr Code\", \"translation\": \"O formato do Qr Code é inválido, por favor insira um Qr Code válido\", \"extra_fields\": {}, \"code\": \"PXT000070\"}"
}

```

QR Code type not identified in payload

```json
{
  "data": "{\"title\": \"Invalid Qr Code Type\", \"description\": \"The Qr Code payload given did not provide a propper Qr Code type\", \"translation\": \"O payload de QR Code fornecido não contêm um tipo de Qr Code Válido\", \"extra_fields\": {}, \"code\": \"PXT000071\"}"
}

```

Error processing dynamic QR Code

```json
{
  "data": "{\"title\": \"Error in Qr Code Payload Request\", \"description\": \"An error occurred while requesting the qr code payload to the registry institution\", \"translation\": \"Um erro ocorreu durante a requisição do payload do qr code para a instituição de registro\", \"extra_fields\": {}, \"code\": \"PXT000069\"}"
}

```

---

# Delete Pix Key

URL: /en/documentation/pix/excluir_chave

## Request

ENDPOINT /baas/pix/keys/ PIX_KEY
METHOD DELETE

### Path params

| Field      | Type   | Description        | Characters |
|------------|--------|--------------------|------------|
| `pix_key` *| string | Pix Key to be deleted. | uuid key   |

## Response

STATUS 200

Response Body

```json
{
  "account_key": "9d3d0083-ac71-43f0-8a90-c00a157a4883",
  "created_at": "2021-12-06T21:16:11",
  "pix_key": {
    "account_key": "9d3d0083-ac71-43f0-8a90-c00a157a4883",
    "created_at": "2021-12-06T21:16:11",
    "pix_key": "b1afcafb-bd88-4958-b8ab-48c3a00044a0",
    "pix_key_status": "inactive",
    "pix_key_type": "random_key",
    "updated_at": "2021-12-06T21:16:22"
  },
  "pix_key_request_key": "ab816c64-bce9-42e9-be6f-9f690a1dccbc",
  "request_data": {},
  "request_failure_reason": null,
  "request_status": "approved",
  "request_type": "deletion",
  "requester_key": "62d1f47a-397d-4a46-bcf6-29e4a07d1375",
  "updated_at": "2021-12-06T21:16:22"
}

```

STATUS 400

Response Body

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

```

---

# Introduction

URL: /en/documentation/pix/introducao

Pix is the Brazilian instant payment system. It is a payment method created by the Central Bank (BACEN) where funds are transferred between accounts in a few seconds, at any time or day. It is convenient, fast, and secure.

As QI Tech is an institution accredited by the Central Bank, it is a member of the Brazilian Payment System (SPB), which allows it to offer this convenience to its clients.

## Advantages and Potential

In addition to increasing the speed at which payments or transfers are made and received, Pix has the potential to:
- Boost market competitiveness and efficiency;
- Lower costs, enhance security, and improve customer experience;
- Encourage the digitization of the retail payment market;
- Promote financial inclusion; and
- Fill various gaps in the current set of payment instruments available to the public.

## Errors

### Error reponse example:

**Response Body**

```json
{
  "title": "SPI Timeout Control",
  "description": "SPI Timeout Control.",
  "translation": "Controle de timeout no SPI.",
  "extra_fields": {
    "description": "SPI Timeout Control.",
    "translation": "Controle de timeout no SPI.",
    "external_title": "SPI Timeout Control",
    "external_code": "PXP000007"
  },
  "code": "PXP000007"
}
```

### Error Table

| Code | Message | HTTP Status | Description | Translated description |
|---|---|---|---|---|
| QIT000403 | Forbidden | 403 | Participant has not rights to this operation. | Participante não tem poderes para essa operação. |
| QIT000400 | BadRequest | 400 | The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, size too large, invalid request message framing, or deceptive request routing). | O servidor não pode ou não processará a request devido a um erro do cliente (por exemplo, sintaxe de request malformada, tamanho muito grande, enquadramento de mensagem de request inválida ou roteamento de request enganoso). |
| PXP000046 | Gone | 410 | Expired QR code. | QR Code expirado. |
| PXP000046 | Gone | 410 | Expired QR code. | QR Code expirado. |
| QIT000404 | NotFound | 404 | The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible. | O resource solicitado não pôde ser encontrado, mas pode estar disponível no futuro. Requests subsequentes do cliente são permitidos. |
| QIT000500 | InternalServerError | 500 | An internal error has occurred and its being investigated. | Um erro interno aconteceu e está sendo investigado. |
| PXP000040 | ClaimKeyNotFound | 408 | Claim Key Not Found. | Chave a ser reivindicada não encontrada. |
| QIT000403 | Forbidden | AB03 | Participant has not rights to this operation. | Participante não tem poderes para essa operação. |
| PXP000007 | AB03 | 408 | SPI Timeout Control. | Controle de timeout no SPI. |
| PXP000037 | AB09 | 502 | Cancelled transaction due to receiver's internal error. | Transação interrompida devido a erro no PSP do Recebedor. |
| PXP000037 | AB11 | 408 | Target PSP Timeout. | Timeout do participante emissor da ordem de pagamento. |
| PXP000009 | AC03 | 400 | Target account number is invalid. | Número da conta de destino é inexistente ou inválido. |
| PXP000010 | AC06 | 400 | Target account is blocked. | A conta de destino encontra-se bloqueada. |
| PXP000011 | AC07 | 400 | Target account is closed. | A conta de destino encontra-se encerrada. |
| PXP000032 | AC14 | 400 | Incorrect type for target account. | Tipo incorreto para a conta transacional especificada. |
| PXP000012 | AG03 | 400 | Unsupported transaction for given target account. | A conta de destino não suporta este tipo de transação. |
| PXP000013 | AGNT | 400 | SPI participant is not PSP settler agent of payer nor receiver. | Participante direto do SPI não é liquidante do PSP do Pagador / Recebedor. |
| PXP000014 | AM01 | 400 | Zero value payment order. | Ordem de pagamento com valor zero. |
| PXP000015 | AM04 | 400 | Insufficient funds in PI account from payer. | Saldo insuficiente na conta PI do pagador. |
| PXP000016 | AM09 | 400 | Return value greater than corresponding payment order. | Valor de devolução acima do valor de pagamento correspondente. |
| PXP000017 | AM18 | 400 | Invalid transactions number. | Quantidade de transações inválida. |
| PXP000018 | BE01 | 400 | Beneficiary document number is not that of target account owner. | CPF/CNPJ do usuário recebedor não é compatível com o titular da conta de destino. |
| PXP000019 | CH11 | 400 | Invalid beneficiary document number. | CPF/CNPJ da conta de destino está incorreto. |
| PXP000020 | CH16 | 400 | Incorrect message element. | Elemento da mensagem incorreto. |
| PXP000021 | DS04 | 400 | Beneficiary's PSP has rejected payment order. | Ordem de pagamento foi rejeitada pelo banco recebedor. |
| PXP000022 | DS0G | 403 | Signing participant is unauthorized to make a payment order for paying account. | Participante que assinou a mensagem não é autorizado a realizar a operação na conta PI debitada. |
| PXP000023 | DT02 | 400 | Invalid datetime for message delivery. | Data e Hora do envio da mensagem inválida. |
| PXP000024 | ED05 | 400 | Error while processing payment (generic error). | Erro no processamento do pagamento (erro genérico). |
| PXP000025 | FF08 | 400 | Badly formatted operation's identifier. | Identificador da operação mal formatado. |
| PXP000026 | RC09 | 400 | Invalid or non-existent payer's PSP ISPB number. | Número ISPB do PSP do Pagador é inválido ou inexistente. |
| PXP000027 | RC10 | 400 | Invalid or non-existent beneficiary's PSP ISPB number. | Número ISPB do banco recebedor é inválido ou inexistente. |
| PXP000043 | DS27 | 400 | Invalid or non-existent ISPB number. | Número ISPB é inválido ou inexistente. |
| PXP000044 | AM02 | 400 | Amount too great for credited account. | Valor de pagamento/devolução acima do permitido para a conta de destino creditada. |
| PXP000028 | JDPISPI001 | 500 | Insufficient funds on JDPI managed PI account. | Saldo insuficiente na conta PI gerenciada pelo JDPI. |
| PXP000029 | JDPISPI002 | 500 | SPI has returned admi.002 message. N/A. | SPI retornou mensagem admi.002. Erro retornado na mensagem: N/A. |
| PXP000030 | JDPISPI003 | 500 | Insufficient funds on PSP sub-account. | Saldo insuficiente na subconta do PSP. |
| PXP000031 | JDPISPI004 | 500 | General failure during debt on JDPI managed PI account. | Falha geral ao realizar o débito em conta PI gerenciada pelo JDPI. |
| PXP000001 | JDPICHV001 | 404 | Pix key not found. | Chave Pix não encontrada. |
| PXP000002 | JDPICHV002 | 404 | Account has no pix keys linked. | Conta não possui nenhuma chave pix. |
| PXP000003 | JDPICHV003 | 404 | CPF/CNPJ has no pix keys linked. | CPF/CNPJ informada não possui nenhuma chave pix vinculada. |
| PXP000004 | JDPICHV004 | 400 | Pix key already linked on DICT. | Chave pix já está vinculada. |
| PXP000005 | JDPICHV005 | 400 | Pix key is linked to another person. Claim recommended. | Chave pix existe mas está possuída por outra pessoa. Reivindicação de posse recomendada. |
| PXP000006 | JDPICHV006 | 400 | Pix key is linked on another account of the same owner. Key alteration recommended. | Chave pix está vinculada a outra conta com o mesmo dono. Alteração de chave recomendada. |
| PXP000033 | JDPICHV007 | 400 | Missing new account or client name on pix key alteration request. | Nova conta ou nome do cliente faltando no pedido de alteração de chave pix. |
| PXP000034 | JDPICHV008 | 400 | Wrong field for trading name on natural person pix key alteration. | Campo para nome fantasia incorreto para alteração de chave pix pessoa física.recomendada. |
| PXP000035 | JDPICHV009 | 400 | Missing account type, account number, account created at, name or trading name on key alteration request. | Dados incompletos para alteração de chave pix. Faltando tipo de conta, número da conta, data de abertura, nome ou nome fantasia. |
| PXP000042 | JDPIRVN011 | 400 | Claim current status does not allow conclusion. | A situação da sua Reivindicação não permite a sua conclusão. |
| PXP000041 | JDPIRVN014 | 400 | Claim Key Not Found. | Chave a ser reivindicada não encontrada. |
| PXP000046 | EntryKeyInCustodyOfDifferentParticipant | 400 | There is already a link for this key with the same owner, but it is associated with another participant. It is indicated that a portability claim be made. | Já existe vínculo para essa chave com o mesmo dono, mas ela encontra-se associada a outro participante. Indica-se que seja feita uma reivindicação de portabilidade. |
| PXP000047 | RateLimited | 429 | Connection was refused by BACEN. Max requests per minute has been exceeded. | A requisição foi recusada pelo BACEN. A quantidade máxima de requisições por minuto foi excedida. |

---

# List Pix Keys of an Account

URL: /en/documentation/pix/listar_chaves_pix

## Request

ENDPOINT /baas/pix/keys
METHOD GET

## Query Params
| Field           | Type   | Description                                                                                 | Characters |
|-----------------|--------|---------------------------------------------------------------------------------------------|------------|
| `account_key` * | string | Account uuid key.                                                                            | uuid key   |
| `pix_key_status`| enum   | **[Enumerator Pix Key Status](#Pix-Key-Status)** Enumerator indicating the status of the pix keys to be returned. | - |

### Enumerator _Pix Key Status_

| Enumerator                            | Description                                                        |
|---------------------------------------|--------------------------------------------------------------------|
| **pending_confirmation**              | Pending confirmation                                               |
| **active**                            | Active                                                             |
| **inactivated**                       | Inactive                                                           |
| **pending_claim_request_confirmation**| Pending confirmation of the Pix key portability request             |

## Response

STATUS 200

Response Body

```json
[
  {
    "account_key": "6d30a0b1-cb90-4ceb-b1ea-5bd600cdf3c8",
    "pix_key": "63927180432",
    "pix_key_status": "active",
    "pix_key_type": "cpf",
    "updated_at": "2022-09-02T20:00:36",
    "created_at": "2022-09-02T20:00:36"
  },
  {
    "account_key": "40cea00e-9d99-46f9-b55f-dbafa84553a9",
    "pix_key": "+5562985013819",
    "pix_key_status": "pending_confirmation",
    "pix_key_type": "phone_number",
    "updated_at": "2022-09-02T20:00:36",
    "created_at": "2022-09-02T20:00:36"
  },
  {
    "account_key": "0ebc3bfb-be25-4093-adf2-f0cdee6f5e69",
    "pix_key": "address@email.com",
    "pix_key_status": "pending_confirmation",
    "pix_key_type": "email",
    "updated_at": "2022-09-02T20:00:36",
    "created_at": "2022-09-02T20:00:36"
  }
]
```

STATUS 400

Response Body

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

```

---

# MED 2.0 — Querying Funds Recoveries

URL: /en/documentation/pix/med/consultar_recuperacao_de_valores

In addition to the follow-up webhooks, you can query the funds recoveries opened against your account: the listing returns all received funds recoveries, and the individual query returns the details of a funds recovery from its `funds_recovery_id` — the same identifier received in the webhook.

## List funds recoveries

ENDPOINT /internal/pix/funds_recovery/incoming
METHOD GET

### Query params

| Field                   | Type    | Description                                                                                            |
| ----------------------- | ------- | -------------------------------------------------------------------------------------------------------- |
| `funds_recovery_status` | string  | Filters by the funds recovery status: `awaiting_analysis`, `pending_approval`, `completed` or `cancelled`. |
| `initial_date`          | string  | Filters funds recoveries created from this date onwards. Format `YYYY-MM-DD`.                          |
| `final_date`            | string  | Filters funds recoveries created up to this date. Format `YYYY-MM-DD`.                                 |
| `page_number`           | integer | Listing page. Default: `1`.                                                                            |
| `page_size`             | integer | Items per page. Default: `10`, maximum: `30`.                                                          |

### Response

STATUS 200

Response Body

```json
{
  "data": [
    {
      "funds_recovery_key": "9eb5f452-81fd-4f67-9f2a-49e14e53ef64",
      "funds_recovery_id": "b8d19bd4-51dc-4784-a2ad-52807c6dfc80",
      "infraction_report_id": "3541127e-cbc9-44f6-bb0e-3e346ddaefb4",
      "pix_transfer_key": "957ef961-1824-47e6-90fd-f8b4775a1e1c",
      "target_account_key": "6711e3cf-fdf4-41b4-88e8-0a31cb83b9f4",
      "target_person_key": "4f6ea994-e53a-4ef8-b2b0-89d14c4667bc",
      "end_to_end_id": "E12345678202607161648s188f18bJty",
      "funds_recovery_status": "awaiting_analysis",
      "situation_type": "scam",
      "report_details": "Transaction reported as fraudulent by the originator.",
      "infraction_amount": 150.50,
      "credited_participant": "32402502",
      "debited_participant": "12345678",
      "analysis_result": null,
      "analysis_details": null,
      "blocked_balance_status": "completelly_blocked",
      "tracking_graph": null,
      "funds_recovery_status_events": [
        {
          "old_status": null,
          "new_status": "awaiting_analysis",
          "created_at": "2026-07-16T16:48:43Z"
        }
      ],
      "updated_at": "2026-07-16T16:48:43Z",
      "created_at": "2026-07-16T16:48:43Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "next_page": null,
    "rows_per_page": 10
  }
}
```

| Field    | Type  | Description                                                                                                                           |
| -------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `data` * | array | List of funds recoveries opened against your account, from the most recent to the oldest. **[funds_recovery object](./recebimento_recuperacao_de_valores.md#funds_recovery-object)** |
| `pagination` * | object | Pagination data: `current_page`, `next_page` (null on the last page) and `rows_per_page`. |

## Query a funds recovery

ENDPOINT /internal/pix/funds_recovery/incoming/ FUNDS_RECOVERY_ID
METHOD GET

### Path params

| Field                 | Type   | Description                                                          | Characters |
| --------------------- | ------ | ---------------------------------------------------------------------- | ---------- |
| `FUNDS_RECOVERY_ID` * | string | Identifier of the funds recovery at Bacen (`funds_recovery_id`).      | 32         |

### Response

STATUS 200

The response is the **[funds_recovery object](./recebimento_recuperacao_de_valores.md#funds_recovery-object)**, including the status event history (`funds_recovery_status_events`) and, when the funds recovery has already been responded to, the `client_awnser` field.

---

# PIX Special Return Mechanism (MED)

URL: /en/documentation/pix/med/introducao

The Central Bank developed an integration system between banks with the objective of reducing the occurrences and severity of frauds committed involving monetary transactions within the scope of PIX. The system consists of two entities: the infraction report and the return request, and for QI Tech's internal clients, for security reasons, their management is performed internally, avoiding possible frauds.

The flow normally followed is, when identifying a fraudulent transaction, the originating participant must open an infraction report, which the destination participant must investigate and, within a period of 7 days, respond accepting or not accepting it. If it is accepted, the originating participant can again open a return request related to the infraction, which must be accepted by the receiving participant.

---

# Receiving Refund Requests

URL: /en/documentation/pix/med/recebimento_pedidos_de_devolucao

Unlike infraction reports, refund requests, as long as they comply with certain guidelines, should, whenever possible, be closed with acceptance, unless the account is closed or has no balance. That said, the client will only receive webhooks for refund request status updates, as this is not something contestable, since the reasons for opening a refund request through MED are either due to an already accepted infraction report, or another participant opening one due to an operational failure.

## Webhook for an incoming refund request

An incoming refund request is a refund opened by another bank, where the account holder is the target of the contested transaction.

## Webhook request body

Webhook: incoming refund request

```json
{
  "event_datetime": "2024-07-16T16:48:43Z",
  "key": "0dedf537-a75e-4945-be1d-5d278c623022",
  "data": {
    "refund_request_key": "9eb5f452-81fd-4f67-9f2a-49e14e53ef64",
    "infraction_report_key": "3541127e-cbc9-44f6-bb0e-3e346ddaefb4",
    "target_account_key": "6711e3cf-fdf4-41b4-88e8-0a31cb83b9f4",
    "refund_request_type": "fraud",
    "blocked_balance_status": "completelly_blocked",
    "pix_transfer_key": "957ef961-1824-47e6-90fd-f8b4775a1e1c",
    "end_to_end_id": "E12345678202404302308s188f18bJty",
    "requesting_participant": "18236120",
    "contested_participant": "32402502",
    "refund_request_details": null,
    "refund_payment_event": null,
    "requested_amount": 40,
    "refunded_amount": 0,
    "refund_request_status": "open",
    "analysis_result": null,
    "analysis_details": null,
    "reject_reason": null,
    "updated_at": "2024-07-16T19:48:43Z",
    "created_at": "2024-07-16T19:48:43Z"
  },
  "status": "open",
  "webhook_type": "incoming.internal_refund_request"
}

```

| Field              | Type   | Description                                      | Characters                                                                    |
| ------------------ | ------ | ------------------------------------------------ | ----------------------------------------------------------------------------- |
| `event_datetime` * | string | Date and time of transaction creation.           | 20                                                                            |
| `key` *            | string | Unique identification key for the event sending. | 32                                                                            |
| `data` *           | string | Incoming refund request data object.             | **[Object incoming_refund_request](#objeto-incoming_refund_request)**         |
| `status` *         | string | Refund status.                                   | **[Enumerators refund_request_status](#enumeradores-refund_request_status)** |

### Enumerators refund_request_status
| Enumerator  | Description                            |
| ----------- | -------------------------------------- |
| `open`      | Request received and pending analysis. |
| `closed`    | Analysis completed and request closed. |
| `cancelled` | Request cancelled by the originator.   |

### Object incoming_refund_request
| Field                      | Type   | Description                                              | Characters                                                                                      |
| -------------------------- | ------ | -------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| `refund_request_key` *     | string | UUID4 identifier of the refund at Bacen.                | 32                                                                                              |
| `infraction_report_key`    | string | UUID4 identifier of the related infraction at Bacen.    | 32                                                                                              |
| `target_account_key` *     | string | Account key of the original transaction's target account. | 32                                                                                              |
| `refund_request_type` *    | string | Type of refund request.                                  | **[Enumerators refund_request_type](#enumeradores-refund_request_type)**                       |
| `pix_transfer_key` *       | string | Pix transfer key of the original transaction.            | 32                                                                                              |
| `end_to_end_id` *          | string | end_to_end_id of the original transaction.               | 32                                                                                              |
| `requesting_participant` * | string | Participant that originated the transaction.             | 8                                                                                               |
| `contested_participant` *  | string | Participant that received the transaction.               | 8                                                                                               |
| `refund_request_details`   | string | Refund details sent by the other participant.           | 2000                                                                                            |
| `refund_payment_event`     | string | Refund execution event.                                  | **[Object refund_payment_event](#objeto-refund_payment_event)**                                 |
| `requested_amount` *       | float  | Amount requested in the refund.                         | 2000                                                                                            |
| `refunded_amount` *        | float  | Total refunded amount.                                   | 2000                                                                                            |
| `refund_request_status` *  | string | Refund status.                                          | **[Enumerators refund_request_status](#enumeradores-refund_request_status)**                   |
| `analysis_result`          | string | Analysis result. Decided by QI Tech.                    | **[Enumerators refund_request_analysis_result](#enumeradores-refund_request_analysis_result)** |
| `analysis_details`         | string | Analysis result justification.                          | 200                                                                                             |
| `reject_reason`            | string | Request rejection reason.                               | **[Enumerators refund_request_reject_reason](#enumeradores-refund_request_reject_reason)**     |
| `blocked_balance_status` * | string | Target account balance blocking status.                  | **[Enumerators blocked_balance_status](#enumeradores-blocked_balance_status)**                 |
| `created_at` *             | string | Date and time of transaction modification.               | 20                                                                                              |
| `updated_at` *             | string | Date and time of transaction creation.                   | 20                                                                                              |

### Object refund_payment_event
| Field                  | Type   | Description                            | Characters |
| ---------------------- | ------ | -------------------------------------- | ---------- |
| `refund_end_to_end_id` | string | end_to_end_id of the refund transaction. | 32         |
| `refund_transfer_key`  | string | Pix transfer key of the refund transaction. | 32         |
| `refund_amount`        | string | Amount of the refund transaction.       |            |
| `created_at`           | string | Date and time of transaction creation.  | 20         |

### Enumerators refund_request_analysis_result
| Enumerator           | Description                                                                                            |
| -------------------- | ------------------------------------------------------------------------------------------------------ |
| `totally_accepted`   | Refund executed for all requested amounts.                                                             |
| `partially_accepted` | Partial refund due to insufficient balance. Monitoring account for subsequent refunds.                |
| `rejected`           | Refund rejected and no resources were returned. If reason is insufficient balance, account will be monitored. |

### Enumerators refund_request_type
| Enumerator         | Description                                                                            |
| ------------------ | -------------------------------------------------------------------------------------- |
| `fraud`            | Opened after accepting an infraction report.                                          |
| `operational_flaw` | Opened without an infraction report, used to correct operational failures of participants. |
| `refund_cancelled` | Correction of a refund executed erroneously.                                          |

### Enumerators blocked_balance_status
| Enumerator            | Description                                                                  |
| --------------------- | ---------------------------------------------------------------------------- |
| `no_balance`          | Customer account with no balance. Monitoring pending balance.                |
| `completelly_blocked` | Resources equivalent to the transaction completely blocked.                  |
| `partially_blocked`   | Resources equivalent to the transaction partially blocked. Monitoring balance. |
| `settled`             | Infraction accepted, and refund request payment executed.                    |
| `partially_settled`   | Infraction accepted, and refund request payment partially executed.          |
| `released`            | Resources released, either by infraction cancellation or disagreement closure. |

### Enumerators refund_request_reject_reason
| Enumerator        | Description                                                        |
| ----------------- | ------------------------------------------------------------------ |
| `no_balance`      | Customer account with no balance. Monitoring pending balance.      |
| `account_closure` | Customer relationship terminated. Impossible to execute refund.    |
| `other`           | Other reason, not applicable to those listed above.               |

:::info
Balance monitoring for an account with partial refund has a limit of 90 days after the original transaction occurs.
:::

## Webhook for an outgoing refund request

### An outgoing refund request is a refund request opened by QI Tech, targeting another participant.

## Webhook request body

Webhook: outgoing refund request

```json
{
  "event_datetime": "2024-07-22T10:31:09Z",
  "key": "15d91f4b-a55c-41a6-9c46-2704253a1cf7",
  "data": {
    "refund_request_key": "5f98671e-9ec0-4ed7-95a9-061861243efc",
    "pix_transfer_key": "d04e0858-ea91-4dab-8089-a27d6cc68235",
    "source_account_key": "134ad635-ce80-4c8c-bca0-9dd3e8251317",
    "end_to_end_id": "E32402502202404302308s188f18bJty",
    "requested_amount": 78.5,
    "refund_request_status": "open",
    "infraction_report_key": "3b727ade-a736-473e-91a6-07b841253f55",
    "refund_request_type": "fraud",
    "refund_request_details": "Infraction aceita, favor realizar devolução de recursos.",
    "requesting_participant": "32402502",
    "contested_participant": "12345678",
    "analysis_result": null,
    "analysis_details": null,
    "reject_reason": null,
    "refund_payment_event": null,
    "updated_at": "2024-07-16T19:48:43Z",
    "created_at": "2024-07-16T19:48:43Z",
  },
  "status": "open",
  "webhook_type": "outgoing.internal_refund_request"
}
```

| Field              | Type   | Description                                      | Characters                                                                    |
| ------------------ | ------ | ------------------------------------------------ | ----------------------------------------------------------------------------- |
| `event_datetime` * | string | Date and time of transaction creation.           | 20                                                                            |
| `key` *            | enum   | Unique identification key for the event sending. | 32                                                                            |
| `data` *           | string | Outgoing infraction report data object.          | **[Object outgoing_refund_request](#objeto-outgoing_refund_request)**         |
| `status` *         | string | Refund status.                                   | **[Enumerators refund_request_status](#enumeradores-refund_request_status)** |

### Object outgoing_refund_request
| Field                      | Type   | Description                                              | Characters                                                                                      |
| -------------------------- | ------ | -------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| `refund_request_key` *     | string | UUID4 identifier of the refund at Bacen.                | 32                                                                                              |
| `infraction_report_key`    | string | UUID4 identifier of the related infraction at Bacen.    | 32                                                                                              |
| `source_account_key` *     | string | Account key of the transaction's source account.         | 32                                                                                              |
| `refund_request_type` *    | string | Type of refund request.                                  | **[Enumerators refund_request_type](#enumeradores-refund_request_type)**                       |
| `pix_transfer_key` *       | string | Pix transfer key of the original transaction.            | 32                                                                                              |
| `end_to_end_id` *          | string | end_to_end_id of the original transaction.               | 32                                                                                              |
| `requesting_participant` * | string | Participant that originated the transaction.             | 8                                                                                               |
| `contested_participant` *  | string | Participant that received the transaction.               | 8                                                                                               |
| `refund_request_details`   | string | Refund details sent by the other participant.           | 2000                                                                                            |
| `refund_payment_event`     | string | Refund execution event.                                  | **[Object refund_payment_event](#objeto-refund_payment_event)**                                 |
| `requested_amount` *       | float  | Amount requested in the refund.                         | 2000                                                                                            |
| `refund_request_status` *  | string | Refund status.                                          | **[Enumerators refund_request_status](#enumeradores-refund_request_status)**                   |
| `analysis_result`          | string | Analysis result. Decided by QI Tech.                    | **[Enumerators refund_request_analysis_result](#enumeradores-refund_request_analysis_result)** |
| `analysis_details`         | string | Analysis result justification.                          | 200                                                                                             |
| `reject_reason`            | string | Request rejection reason.                               | **[Enumerators refund_request_reject_reason](#enumeradores-refund_request_reject_reason)**     |
| `created_at` *             | string | Date and time of transaction modification.               | 20                                                                                              |
| `updated_at` *             | string | Date and time of transaction creation.                   | 20                                                                                              |

---

# MED 2.0 — Receiving a Funds Recovery

URL: /en/documentation/pix/med/recebimento_recuperacao_de_valores

MED 2.0 introduces the **funds recovery**, which unifies the infraction report and the refund request of a contested PIX transaction into a single flow. When a funds recovery is received against an account, QI Tech automatically applies a precautionary block on the funds equivalent to the contested transaction and sends you a webhook notification, giving you the opportunity to justify the legitimacy of the transaction before the closing.

The lifecycle of a received funds recovery is:

1. **`awaiting_analysis`** — funds recovery received and balance blocked; awaiting your response, which must be sent within a maximum of **5 days**.
2. **`pending_approval`** — response sent (justification + evidence file); under analysis by QI Tech.
3. **`completed`** — closed by QI Tech, either accepting (`agreed`) or rejecting (`disagreed`) the funds recovery.
4. **`cancelled`** — cancelled by the originating participant.

All follow-up communication is performed via webhooks.

## Webhook of an incoming funds recovery

An incoming funds recovery is a funds recovery opened by another participant, where your account is the target of the contested transaction.

:::info Note
Funds recovery webhooks are sent with `webhook_type` **`incoming.internal_infraction_report`**. To distinguish them from infraction reports, check for the presence of the `funds_recovery_key` field in the `data` object.
:::

Webhook: incoming funds recovery

```json
{
  "event_datetime": "2026-07-16T16:48:43Z",
  "key": "0dedf537-a75e-4945-be1d-5d278c623022",
  "data": {
    "funds_recovery_key": "9eb5f452-81fd-4f67-9f2a-49e14e53ef64",
    "funds_recovery_id": "b8d19bd4-51dc-4784-a2ad-52807c6dfc80",
    "infraction_report_id": "3541127e-cbc9-44f6-bb0e-3e346ddaefb4",
    "pix_transfer_key": "957ef961-1824-47e6-90fd-f8b4775a1e1c",
    "target_account_key": "6711e3cf-fdf4-41b4-88e8-0a31cb83b9f4",
    "target_person_key": "4f6ea994-e53a-4ef8-b2b0-89d14c4667bc",
    "end_to_end_id": "E12345678202607161648s188f18bJty",
    "funds_recovery_status": "awaiting_analysis",
    "situation_type": "scam",
    "report_details": "Transaction reported as fraudulent by the originator.",
    "infraction_amount": 150.50,
    "contact_email": "contact@participant.com.br",
    "contact_phone_number": "+5511999999999",
    "credited_participant": "32402502",
    "debited_participant": "12345678",
    "client_details": null,
    "analysis_result": null,
    "analysis_details": null,
    "blocked_balance_status": "completelly_blocked",
    "tracking_graph": null,
    "updated_at": "2026-07-16T16:48:43Z",
    "created_at": "2026-07-16T16:48:43Z"
  },
  "status": "awaiting_analysis",
  "webhook_type": "incoming.internal_infraction_report"
}
```

### funds_recovery object

| Field                     | Type   | Description                                                               | Characters                                                                                  |
| ------------------------- | ------ | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| `funds_recovery_key` *    | string | UUID4 identifier of the funds recovery at QI Tech.                        | 32                                                                                          |
| `funds_recovery_id` *     | string | Identifier of the funds recovery at Bacen. Used in queries and in the response. | 32                                                                                          |
| `infraction_report_id` *  | string | Identifier of the infraction that originated the funds recovery at Bacen. | 32                                                                                          |
| `pix_transfer_key` *      | string | Pix transfer key of the original transaction.                             | 32                                                                                          |
| `target_account_key` *    | string | Account key of the destination account of the original transaction.      | 32                                                                                          |
| `target_person_key` *     | string | Person key of the funds recovery target.                                 | 32                                                                                          |
| `end_to_end_id` *         | string | end_to_end_id of the original transaction.                                | 32                                                                                          |
| `funds_recovery_status` * | string | Status of the funds recovery.                                             | **[funds_recovery_status enumerators](#funds_recovery_status-enumerators)**                 |
| `situation_type` *        | string | Situation reported by the originator.                                     | **[situation_type enumerators](#situation_type-enumerators)**                               |
| `report_details`          | string | Details sent by the originating participant.                              | 2000                                                                                        |
| `infraction_amount`       | number | Contested amount. When absent, the full transaction amount is considered. | -                                                                                           |
| `contact_email`           | string | Contact e-mail of the originating participant.                            | 255                                                                                         |
| `contact_phone_number`    | string | Contact phone of the originating participant.                             | 20                                                                                          |
| `credited_participant` *  | string | Participant that received the transaction.                                | 8                                                                                           |
| `debited_participant` *   | string | Participant that originated the transaction.                              | 8                                                                                           |
| `client_awnser`           | string | Justification sent in the response. Present after responding.             | 2000                                                                                        |
| `analysis_result`         | string | Analysis result. Decided by QI Tech.                                      | **[analysis_result enumerators](#analysis_result-enumerators)**                             |
| `analysis_details`        | string | Justification of the analysis result.                                     | 2000                                                                                        |
| `blocked_balance_status` * | string | Balance block status of the destination account.                          | **[blocked_balance_status enumerators](#blocked_balance_status-enumerators)**               |
| `tracking_graph`          | object | Tracking graph of the contested funds movements, when available.          | -                                                                                           |
| `created_at` *            | string | Creation date and time.                                                   | 20                                                                                          |
| `updated_at` *            | string | Update date and time.                                                     | 20                                                                                          |

### funds_recovery_status enumerators

| Enumerator          | Description                                                                |
| ------------------- | --------------------------------------------------------------------------- |
| `awaiting_analysis` | Funds recovery received and balance blocked, awaiting your response. |
| `pending_approval`  | Justification sent, awaiting QI Tech's internal analysis.                  |
| `completed`         | Closed by QI Tech after the analysis.                                      |
| `cancelled`         | Cancelled by the originating participant.                                  |

### situation_type enumerators

| Enumerator          | Description                                                |
| ------------------- | ----------------------------------------------------------- |
| `scam`              | Cause of scam or fraud.                                     |
| `account_takeover`  | Cause of a transaction not authorized by the source account. |
| `coercion`          | Cause of coercion crime.                                    |
| `fraudulent_access` | Cause of fraudulent access to the source account.           |
| `other`             | Any causes not applicable to the ones listed above.         |

### analysis_result enumerators

| Enumerator  | Description                                                       |
| ----------- | ------------------------------------------------------------------ |
| `agreed`    | The funds recovery is accepted and the blocked funds are returned. |
| `disagreed` | The funds recovery is rejected and the blocked funds are released. |

### blocked_balance_status enumerators

| Enumerator            | Description                                                                      |
| --------------------- | --------------------------------------------------------------------------------- |
| `completelly_blocked` | Funds equivalent to the contested amount completely blocked.                     |
| `partially_blocked`   | Funds equivalent to the contested amount partially blocked. Monitoring balance.  |
| `no_balance`          | Account without balance. Monitoring pending balance.                    |
| `account_closed`      | Account closed. No funds blocked.                                       |

---

# Receiving Infraction Reports

URL: /en/documentation/pix/med/recebimento_relatos_de_infracao

Upon receiving an infraction report, QI Tech will automatically block the account resource equivalent to the disputed transaction, and send follow-up notifications throughout the entire infraction cycle, including giving the client a chance to justify the transaction. However, it's worth noting that the final decision on whether to accept an infraction or not will come from QI Tech. All communication related to infractions is carried out via webhooks.

## Webhook for an incoming infraction report

An incoming infraction report is an infraction opened by another bank, where the account owner is the target of the disputed transaction.

## Webhook request body

Webhook: incoming infraction report

```json
{
  "event_datetime": "2024-07-22T10:31:09Z",
  "key": "15d91f4b-a55c-41a6-9c46-2704253a1cf7",
  "data": {
    "target_person_key": "4f6ea994-e53a-4ef8-b2b0-89d14c4667bc",
    "end_to_end_id": "E12345678202407171627342xlR8KpoD",
    "pix_transfer_key": "6cf241f8-328a-4813-90ab-2aef74d853ac",
    "target_account_key": "9d5b1a98-03ac-4202-91e8-29dbff3d1108",
    "infraction_report_status": "pending_client_awnser",
    "infraction_report_situation": "fraudulent_access",
    "analysis_result": null,
    "analysis_details": null,
    "infraction_report_type": "refund_request",
    "debited_participant": "12345678",
    "credited_participant": "32402502",
    "blocked_balance_status": "completelly_blocked",
    "infraction_report_key": "90b4e1bc-89bc-4df8-98a2-f912447b178f",
    "infraction_report_details": "Transação acusada como fraudulenta pelo originador.",
    "client_details": null,
    "created_at": "2024-07-22T13:31:09Z",
    "updated_at": "2024-07-22T13:31:09Z",
  },
  "status": "pending_client_awnser",
  "webhook_type": "incoming.internal_infraction_report"
}
```

| Field              | Type   | Description                                      | Characters                                                                                            |
| ------------------ | ------ | ------------------------------------------------ | ----------------------------------------------------------------------------------------------------- |
| `event_datetime` * | string | Transaction creation date and time.              | 20                                                                                                    |
| `key` *            | enum   | Unique identification key for the event sending. | 32                                                                                                    |
| `data` *           | string | Incoming infraction report data object.          | **[incoming_infraction_report Object](#incoming_infraction_report-object)**                           |
| `status` *         | string | Infraction status.                               | **[incoming_infraction_report_status Enumerators](#incoming_infraction_report_status-enumerators)** |

### incoming_infraction_report Object
| Field                           | Type   | Description                                                  | Characters                                                                                            |
| ------------------------------- | ------ | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------- |
| `target_person_key` *           | string | Person key of the infraction target.                        | 32                                                                                                    |
| `end_to_end_id` *               | string | end_to_end_id of the original transaction.                  | 32                                                                                                    |
| `pix_transfer_key` *            | string | Pix transfer key of the original transaction.               | 32                                                                                                    |
| `target_account_key` *          | string | Account key of the original transaction destination account. | 32                                                                                                    |
| `infraction_report_status` *    | string | Infraction status.                                           | **[incoming_infraction_report_status Enumerators](#incoming_infraction_report_status-enumerators)** |
| `infraction_report_situation` * | string | Infraction situation.                                        | **[infraction_report_situation Enumerators](#infraction_report_situation-enumerators)**             |
| `analysis_result`               | string | Analysis result. Decided by QI Tech.                        | **[infraction_report_analysis_result Enumerators](#infraction_report_analysis_result-enumerators)** |
| `analysis_details`              | string | Analysis result justification.                              | 200                                                                                                   |
| `infraction_report_type` *      | string | Type of infraction report.                                   | **[infraction_report_type Enumerators](#infraction_report_type-enumerators)**                       |
| `debited_participant` *         | string | Participant that originated the transaction.                 | 8                                                                                                     |
| `credited_participant` *        | string | Participant that received the transaction.                   | 8                                                                                                     |
| `blocked_balance_status` *      | string | Balance blocking status of the destination account.          | **[blocked_balance_status Enumerators](#blocked_balance_status-enumerators)**                       |
| `infraction_report_key` *       | string | UUID4 identifier of the transaction in Bacen.               | 32                                                                                                    |
| `infraction_report_details`     | string | Infraction details, sent by the other participant.          | 2000                                                                                                  |
| `client_details`                | string | Details provided by the client about the original transaction. | 2000                                                                                                  |
| `created_at` *                  | string | Transaction modification date and time.                      | 20                                                                                                    |
| `updated_at` *                  | string | Transaction creation date and time.                          | 20                                                                                                    |

### incoming_infraction_report_status Enumerators
| Enumerator              | Description                                                      |
| ----------------------- | ---------------------------------------------------------------- |
| `pending_client_awnser` | Infraction received, awaiting client justification.             |
| `pending_approval`      | Justification sent, awaiting internal approval.                 |
| `automatically_closed`  | Automatically closed due to lack of client response.            |
| `manually_closed`       | Closed by QI Tech after analyzing the client's response.        |
| `cancelled`             | Cancelled by the originator.                                    |

### infraction_report_situation Enumerators
| Enumerator          | Description                                              |
| ------------------- | -------------------------------------------------------- |
| `scam`              | Cause of scam or fraud.                                  |
| `account_takeover`  | Cause of unauthorized transaction from the origin account. |
| `coercion`          | Cause of coercion crime.                                 |
| `fraudulent_access` | Cause of fraudulent access to the origin account.        |
| `other`             | Any causes not applicable to those listed above.         |

### infraction_report_analysis_result Enumerators
| Enumerator  | Description                                                                                    |
| ----------- | ---------------------------------------------------------------------------------------------- |
| `agreed`    | The Indirect Participant agrees with the Infraction Report created by the other Participant.  |
| `disagreed` | The Indirect Participant disagrees with the Infraction Report created by the other Participant. |

### infraction_report_type Enumerators
| Enumerator         | Description                                                               |
| ------------------ | ------------------------------------------------------------------------- |
| `refund_cancelled` | Infraction report will be generated due to a cancelled refund.           |
| `refund_request`   | Infraction report will be generated to request a refund.                 |

### blocked_balance_status Enumerators
| Enumerator            | Description                                                                          |
| --------------------- | ------------------------------------------------------------------------------------ |
| `no_balance`          | Client account without balance. Monitoring pending balance.                          |
| `completelly_blocked` | Resources equivalent to the transaction completely blocked.                          |
| `partially_blocked`   | Resources equivalent to the transaction partially blocked. Monitoring balance.       |
| `settled`             | Infraction accepted, and refund request payment made.                               |
| `partially_settled`   | Infraction accepted, and refund request payment partially made.                     |
| `released`            | Resources released, either by infraction cancellation or closure in disagreement.   |

:::info
An infraction will be automatically closed accepting if the client does not respond to the infraction within 5 days.
:::

## Webhook for an outgoing infraction report

### An outgoing infraction report is an infraction opened by QI, targeting another participant.

## Webhook request body

Webhook: outgoing infraction report

```json
{
  "event_datetime": "2024-07-22T10:31:09Z",
  "key": "15d91f4b-a55c-41a6-9c46-2704253a1cf7",
  "data": {
    "infraction_report_key": "4f6ea994-e53a-4ef8-b2b0-89d14c4667bc",
    "pix_transfer_key": "6cf241f8-328a-4813-90ab-2aef74d853ac",
    "source_account_key": "9d5b1a98-03ac-4202-91e8-29dbff3d1108",
    "end_to_end_id": "E32402502202407171627342xlR8KpoD",
    "infraction_report_status": "open",
    "infraction_report_situation": "account_takeover",
    "infraction_report_type": "refund_request",
    "infraction_report_details": "Transação fraudulenta.",
    "debited_participant": "32402502",
    "credited_participant": "12345678",
    "analysis_result": null,
    "analysis_details": null,
    "updated_at": "2024-07-22T13:31:09Z",
    "created_at": "2024-07-22T13:31:09Z",
},
  "status": "open",
  "webhook_type": "outgoing.internal_infraction_report"
}
```

| Field              | Type   | Description                                      | Characters                                                                                   |
| ------------------ | ------ | ------------------------------------------------ | -------------------------------------------------------------------------------------------- |
| `event_datetime` * | string | Transaction creation date and time.              | 20                                                                                           |
| `key` *            | enum   | Unique identification key for the event sending. | 32                                                                                           |
| `data` *           | string | Outgoing infraction report data object.          | **[outgoing_infraction_report Object](#outgoing_infraction_report-object)**                  |
| `status` *         | string | Infraction status.                               | **[outgoing_infraction_report_status Enumerators](#outgoing_infraction_report_status-enumerators)** |

### outgoing_infraction_report Object
| Field                           | Type   | Description                                              | Characters                                                                                            |
| ------------------------------- | ------ | -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `infraction_report_key` *       | string | UUID4 identifier of the transaction in Bacen.           | 32                                                                                                    |
| `end_to_end_id` *               | string | end_to_end_id of the original transaction.              | 32                                                                                                    |
| `pix_transfer_key` *            | string | Pix transfer key of the original transaction.           | 32                                                                                                    |
| `source_account_key` *          | string | Account key of the original transaction source account.  | 32                                                                                                    |
| `infraction_report_status` *    | string | Infraction status.                                       | **[outgoing_infraction_report_status Enumerators](#outgoing_infraction_report_status-enumerators)** |
| `infraction_report_situation` * | string | Infraction situation.                                    | **[infraction_report_situation Enumerators](#infraction_report_situation-enumerators)**             |
| `infraction_report_type` *      | string | Type of infraction report.                               | **[infraction_report_type Enumerators](#infraction_report_type-enumerators)**                       |
| `infraction_report_details`     | string | Infraction details, sent by QI Tech.                    | 2000                                                                                                  |
| `debited_participant` *         | string | Participant that originated the transaction.             | 8                                                                                                     |
| `credited_participant` *        | string | Participant that received the transaction.               | 8                                                                                                     |
| `analysis_result`               | string | Analysis result. Decided by the other participant.       | **[infraction_report_analysis_result Enumerators](#infraction_report_analysis_result-enumerators)** |
| `analysis_details`              | string | Analysis result justification.                          | 200                                                                                                   |
| `created_at` *                  | string | Transaction modification date and time.                  | 20                                                                                                    |
| `updated_at` *                  | string | Transaction creation date and time.                      | 20                                                                                                    |

### outgoing_infraction_report_status Enumerators
| Enumerator  | Description                                       |
| ----------- | ------------------------------------------------- |
| `open`      | Infraction opened and sent to the other participant. |
| `closed`    | Infraction responded to by the other participant. |
| `cancelled` | Infraction cancelled by QI Tech.                  |

---

# MED 2.0 — Responding to a Funds Recovery

URL: /en/documentation/pix/med/responder_recuperacao_de_valores

While the funds recovery has the `awaiting_analysis` status, you can respond to it justifying the legitimacy of the transaction. The response is composed of a **text explanation** and a **.zip evidence file** (invoice, receipts, conversations, etc.), sent as **`multipart/form-data`**.

After the response, the funds recovery moves to the **`pending_approval`** status, proceeding to the analysis stage.

:::caution Warning
The maximum period to respond to a MED is **5 days**.
:::

## Funds recovery identifier

The identifier used in the route is the **`funds_recovery_id`** field, received in the **[incoming funds recovery webhook](./recebimento_recuperacao_de_valores.md#webhook-of-an-incoming-funds-recovery)** when the funds recovery is opened:

```json
{
  "event_datetime": "2026-07-16T16:48:43Z",
  "key": "0dedf537-a75e-4945-be1d-5d278c623022",
  "data": {
    "funds_recovery_id": "b8d19bd4-51dc-4784-a2ad-52807c6dfc80",
    "funds_recovery_status": "awaiting_analysis",
    "...": "..."
  },
  "status": "awaiting_analysis",
  "webhook_type": "incoming.internal_infraction_report"
}
```

The same identifier can also be obtained through the **[funds recoveries listing](./consultar_recuperacao_de_valores.md#list-funds-recoveries)**.

## Request

ENDPOINT /internal/pix/funds_recovery/incoming/ FUNDS_RECOVERY_ID
METHOD PATCH

### Path params

| Field                 | Type   | Description                                                          | Characters |
| --------------------- | ------ | ---------------------------------------------------------------------- | ---------- |
| `FUNDS_RECOVERY_ID` * | string | Identifier of the funds recovery at Bacen (`funds_recovery_id`).      | 32         |

### Form data

| Field             | Type   | Description                                                                          | Characters |
| ----------------- | ------ | -------------------------------------------------------------------------------------- | ---------- |
| `client_awnser` * | string | Your interpretation of the transaction reported as fraudulent.                    | 2000       |
| `file` *          | file   | **.zip** file with the evidence supporting the justification. Maximum size: **50MB**. | -          |

### Response

STATUS 200

Response Body

```json
{
  "funds_recovery_key": "9eb5f452-81fd-4f67-9f2a-49e14e53ef64",
  "funds_recovery_id": "b8d19bd4-51dc-4784-a2ad-52807c6dfc80",
  "infraction_report_id": "3541127e-cbc9-44f6-bb0e-3e346ddaefb4",
  "pix_transfer_key": "957ef961-1824-47e6-90fd-f8b4775a1e1c",
  "target_account_key": "6711e3cf-fdf4-41b4-88e8-0a31cb83b9f4",
  "target_person_key": "4f6ea994-e53a-4ef8-b2b0-89d14c4667bc",
  "end_to_end_id": "E12345678202607161648s188f18bJty",
  "funds_recovery_status": "pending_approval",
  "situation_type": "scam",
  "report_details": "Transaction reported as fraudulent by the originator.",
  "infraction_amount": 150.50,
  "credited_participant": "32402502",
  "debited_participant": "12345678",
  "client_awnser": "Legitimate transaction, as demonstrated by invoice XXXXXXXXXX confirming the sale of the product.",
  "analysis_result": null,
  "analysis_details": null,
  "blocked_balance_status": "completelly_blocked",
  "tracking_graph": null,
  "funds_recovery_status_events": [
    {
      "old_status": null,
      "new_status": "awaiting_analysis",
      "created_at": "2026-07-16T16:48:43Z"
    },
    {
      "old_status": "awaiting_analysis",
      "new_status": "pending_approval",
      "created_at": "2026-07-17T10:12:05Z"
    }
  ],
  "updated_at": "2026-07-17T10:12:05Z",
  "created_at": "2026-07-16T16:48:43Z"
}
```

The response is the updated **[funds_recovery object](./recebimento_recuperacao_de_valores.md#funds_recovery-object)**, with `funds_recovery_status` = `pending_approval` and the justification in `client_awnser`.

### Errors

| Code        | Status | Description                                                                 |
| ----------- | ------ | ----------------------------------------------------------------------------- |
| `QIT000001` | 400    | `client_awnser` or `file` missing from the request.                         |
| `MED000042` | 400    | The funds recovery does not have the `awaiting_analysis` status.            |
| `MED000043` | 400    | The sent file is not a **.zip** file.                                       |
| `MED000044` | 400    | The sent file exceeds the maximum size of **50MB**.                         |
| `MED000039` | 404    | Funds recovery not found for the given `FUNDS_RECOVERY_ID`.                 |

---

# Respond to Infraction Reports

URL: /en/documentation/pix/med/resposta_relatos_de_infracao

The Central Bank establishes a 7-day limit for analyzing infraction reports, with the objective of maintaining service quality and the return mechanism. QI Tech reserves up to 5 days for the client to respond to the received infraction justifying the legitimacy or not of the transaction, and 2 days for internal analysis and fact-finding. It's worth noting that the final word on accepting or not accepting a report belongs exclusively to QI Tech.

:::caution Warning
After 5 days have elapsed, the infraction will be automatically closed accepting it, if the client does not respond.
:::

## Request

ENDPOINT /internal/pix/infraction_report/incoming/ INFRACTION_REPORT_KEY
METHOD PATCH

Request Body

```json
{
    "client_awnser": "Transação legítma, conforme demonstrado na nota fiscal XXXXXXXXXX que confirma a venda do produto.",
}

```

### Body params

| Field             | Type   | Description                                                               | Characters |
| ----------------- | ------ | ----------------------------------------------------------------------- | ---------- |
| `client_awnser` * | string | Client's interpretation regarding the transaction flagged as fraudulent. | 2000       |

### Response

STATUS 200

Response Body

```json
{
    "target_person_key": "4f6ea994-e53a-4ef8-b2b0-89d14c4667bc",
    "end_to_end_id": "E12345678202407171627342xlR8KpoD",
    "pix_transfer_key": "6cf241f8-328a-4813-90ab-2aef74d853ac",
    "target_account_key": "9d5b1a98-03ac-4202-91e8-29dbff3d1108",
    "infraction_report_status": "pending_approval",
    "infraction_report_situation": "fraudulent_access",
    "analysis_result": null,
    "analysis_details": null,
    "infraction_report_type": "refund_request",
    "debited_participant": "12345678",
    "credited_participant": "32402502",
    "blocked_balance_status": "completelly_blocked",
    "infraction_report_key": "90b4e1bc-89bc-4df8-98a2-f912447b178f",
    "infraction_report_details": "Transação acusada como fraudulenta pelo originador.",
    "client_details": "Transação legítma, conforme demonstrado na nota fiscal XXXXXXXXXX que confirma a venda do produto.",
    "created_at": "2024-07-22T13:31:09Z",
    "updated_at": "2024-07-22T13:31:09Z",
}
```

| Field                          | Type   | Description                                                    | Characters                                                                                            |
| ------------------------------ | ------ | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------- |
| `target_person_key`*           | string | Person key of the infraction target.                        | 32                                                                                                    |
| `end_to_end_id`*               | string | end_to_end_id of the original transaction.                  | 32                                                                                                    |
| `pix_transfer_key`*            | string | Pix transfer key of the original transaction.               | 32                                                                                                    |
| `target_account_key`*          | string | Account key of the destination account of the original transaction. | 32                                                                                                    |
| `infraction_report_status`*    | string | Status of the infraction.                                    | **[Enumerators incoming_infraction_report_status](#enumeradores-incoming_infraction_report_status)** |
| `infraction_report_situation`* | string | Situation of the infraction.                                | **[Enumerators infraction_report_situation](#enumeradores-infraction_report_situation)**             |
| `analysis_result`              | string | Result of the analysis. Decided by QI Tech.                 | **[Enumerators infraction_report_analysis_result](#enumeradores-infraction_report_analysis_result)** |
| `analysis_details`             | string | Justification for the analysis result.                      | 200                                                                                                   |
| `infraction_report_type`*      | string | Type of infraction report.                                   | **[Enumerators infraction_report_type](#enumeradores-infraction_report_type)**                       |
| `debited_participant`*         | string | Participant that originated the transaction.                 | 8                                                                                                     |
| `credited_participant`*        | string | Participant that received the transaction.                   | 8                                                                                                     |
| `blocked_balance_status`*      | string | Status of the balance blocking of the destination account.   | **[Enumerators blocked_balance_status](#enumeradores-blocked_balance_status)**                       |
| `infraction_report_key`*       | string | UUID4 identifier of the transaction at Bacen.               | 32                                                                                                    |
| `infraction_report_details`    | string | Infraction details sent by the other participant.           | 2000                                                                                                  |
| `client_details`*              | string | Details provided by the client about the original transaction. | 2000                                                                                                  |
| `created_at`*                  | string | Date and time of transaction modification.                   | 20                                                                                                    |
| `updated_at`*                  | string | Date and time of transaction creation.                       | 20                                                                                                    |

### Enumerators incoming_infraction_report_status
| Enumerator              | Description                                                    |
| ----------------------- | -------------------------------------------------------------- |
| `pending_client_awnser` | Infraction received, awaiting client justification.           |
| `pending_approval`      | Justification sent, awaiting internal approval.               |
| `automatically_closed`  | Automatically closed due to lack of client response.          |
| `manually_closed`       | Closed by QI Tech after analyzing the client's response.      |
| `cancelled`             | Cancelled by the originator.                                  |

### Enumerators infraction_report_situation
| Enumerator          | Description                                         |
| ------------------- | --------------------------------------------------- |
| `scam`              | Cause of scam or fraud.                             |
| `account_takeover`  | Cause of unauthorized transaction by origin account. |
| `coercion`          | Cause of coercion crime.                            |
| `fraudulent_access` | Cause of fraudulent access to origin account.       |
| `other`             | Any causes not applicable to those listed above.    |

### Enumerators infraction_report_analysis_result
| Enumerator  | Description                                                                               |
| ----------- | ----------------------------------------------------------------------------------------- |
| `agreed`    | The Indirect Participant agrees with the Infraction Report created by the other Participant. |
| `disagreed` | The Indirect Participant disagrees with the Infraction Report created by the other Participant. |

### Enumerators infraction_report_type
| Enumerator         | Description                                                          |
| ------------------ | -------------------------------------------------------------------- |
| `refund_cancelled` | Infraction report will be generated due to a cancelled refund.      |
| `refund_request`   | Infraction report will be generated to request a refund.            |

### Enumerators blocked_balance_status
| Enumerator            | Description                                                                     |
| --------------------- | ------------------------------------------------------------------------------- |
| `no_balance`          | Client account with no balance. Monitoring pending balance.                    |
| `completelly_blocked` | Resources equivalent to the transaction completely blocked.                     |
| `partially_blocked`   | Resources equivalent to the transaction partially blocked. Monitoring balance. |
| `settled`             | Infraction accepted, and refund request payment made.                          |
| `partially_settled`   | Infraction accepted, and refund request payment partially made.                |
| `released`            | Resources released, either by infraction cancellation or disagreement closure. |

---

# Search for own dynamic Pix QR Code

URL: /en/documentation/pix/pesquisar_por_qr_code_dinamico

## Request

ENDPOINT /baas/qrcode/dynamic
METHOD GET

### Path params

| Field | Type | Description | Characters |
|----------------------------|---------|------------------------------------------------------------------|------------|
| `account_key` | string | QIAccount identification key linked to the Pix key (UUIDv4) | 36 |
| `pix_key` | string | PIX key linked to the QRCode | - |
| `receiver_conciliation_id` | string | Receiver's reconciliation ID | max_length = 35 |
| `page` | integer | Page number being searched (default = 0) | - |
| `page_size` | integer | Number of items per page (default = 15) | - |
| `first_result` | boolean | Return only the first result (default = desc) | - |
| `order_by` | string | Determines the order of return of results (default = desc) | asc, desc |

:::info
It is mandatory to send `account_key` or `pix_key`, only one of them is required.
:::
:::caution Attention
To query a specific QR Code, the parameters `receiver_conciliation_id` and `pix_key` should be used.
:::

## Response

STATUS 200

Response Body

```json
{
	"pagination": {
		"current_page": 0,
		"next_page": 1,
		"rows_per_page": 15,
		"total_pages": 1,
		"total_rows": 4
	},
	"data": [
		{
			"additional_data": [],
			"amount": 1.0,
			"discounts": [],
			"qr_code_type": "dynamic_term",
			"end_to_end_id": null,
			"base_64": "MDAwMjAxMjY4OTAwMTRici5nb3YuYmNiLnBpeDI1NjdxcmNvZGUtaC5kZXYucWl0ZWNoLmFwcC9iYWNlbi9jb2J2LzQ1NWQ4ZmY1NGE0ZDQ2Mzg4YmVhN2I4MmFhMDZiNzdmNTIwNDAwMDA1MzAzOTg2NTgwMkJSNTkxOVBydVBydXVDb211bmljYWNvZXM2MDA4i2FvUGF1bG82MTA4MDU0MjUwMjA2MjA3MDUwMyoqKjYzMDQyNkNF",
			"expiration_date": "2023-03-30",
			"expiration_seconds": null,
			"max_payment_days": 180,
			"rebate_amount": 0.0,
			"interest_amount": 0.0,
			"fine_amount": 0.0,
			"paid_amount": null,
			"payer_request": null,
			"pix_message": null,
			"modality_alteration": false,
			"payer_name": "Random",
			"payer_document_number": "00000000000000",
			"payer_person_type": "natural",
			"pix_key": {
				"account_key": "ce0db38f-a2ba-446f-bb1a-51d0bf3f40fc",
				"is_activated": true,
				"pix_key": "63602991000100",
				"created_at": "2023-02-14T23:26:52"
			},
			"qr_code_key": "455d8ff5-4a4d-4638-8bea-7b82aa06b77f",
			"qr_code_status": {
				"enumerator": "active"
			},
			"receiver_conciliation_id": "01234567891293134978",
			"created_at": "2023-03-29T15:26:50"
		}
	]
}

```

STATUS 400

Response Body: Missing Required Parameters

```json
{
    "title": "Bad Request",
    "description": "Must use pix key or account key to search for QR Codes",
    "translation": "Chave Pix ou Chave da Conta devem ser utilizados para realizar buscas por QR Codes",
    "code": "PQR000009"
}
```

STATUS 400

Response Body: User does not have credentials

```json
{
    "title": "Unauthorized",
    "description": "User is not allowed to do this transaction",
    "translation": "Usuário não tem autorização para fazer essa transação",
    "code": "PQR000004"
}
```

STATUS 400

Response Body: User is not the account owner

```json
{
    "title": "Unauthorized",
    "description": "Person is not account owner.",
    "translation": "A pessoa não é dona da conta.",
    "code": "PQR000005"
}
```

STATUS 404

Response Body: Pix Key not found

```json
{
    "title": "Not Found",
    "description": "No active Pix key found with key \{pix_key\}",
    "translation": "Não foi encontrada pix key ativa com a chave \{pix_key\}",
    "code": "PQR000007"
}
```

### Enumeradtors QR Code Status
| Enumerator | Description |
|--------------------|----------------------------------------------------------|
| `active` | Active QR Code |
| `finished` | Paid QR Code |
| `written_off` | QR Code deactivated at the request of the receiver/partner |
| `bank_written_off` | QR Code deactivated by QI |

---

# Pesquisar por transferência Pix de saída

URL: /en/documentation/pix/pesquisar_por_transferencia_pix_de_saida

## Request

ENDPOINT /baas/pix/pix_transfer
MÉTODO GET

### Path params

| Campo                      | Tipo    | Descrição                                                        | Caracteres |
|----------------------------|---------|------------------------------------------------------------------|------------|
| `end_to_end_id`            | string  | chave de identificação única de uma transação ou consulta no Banco Central. Exemplo: E3240250220210615135810450327042| 32         |
| `pix_transfer_key`         | string  | chave de identificação da transferência Pix no sistema QI (UUIDv4)  | 36         |

:::info
É obrigatório enviar `end_to_end_id` ou `pix_transfer_key`, sendo apenas um deles obrigatório.
::: 

:::caution Atenção
Será apenas permitida a visualização de uma transferência caso o requisitante tenha permissões na conta de saída da transação. Caso o contrário um erro será retornado.
:::

## Response

STATUS 200

Response Body

```json
{
	"billing_account_key": null,
	"created_at": "2021-03-12T20:39:06",
	"description": null,
	"end_to_end_id": "E3240250220210615135810450327042",
	"external_analysis": null,
	"fee_amount": 2.0,
	"initiator_document_number": null,
	"pix_message": null,
	"pix_transfer_key": "2c7e71f6-d2a3-4f2d-8243-9b28523e9c95",
	"pix_transfer_status": "rejected",
	"pix_transfer_type": "key",
	"receiver_conciliation_id": null,
	"sent_at": null,
	"source_account_key": "23a4a2c8-9d82-4ebe-a90d-44fe8d839ec0",
	"target_account": {
		"account_branch": "0001",
		"account_digit": "6",
		"account_number": "99031",
		"account_type": null,
		"financial_institution_compe_number": 341,
		"financial_institution_name": "ITAÚ UNIBANCO S.A.",
		"is_internal": false,
		"ispb_number": "60701190",
		"owner_document_number": "40569499801",
		"owner_name": "Nuno Reis",
		"target_pix_key": "rafaell@yopmail.com"
	},
	"transaction_key": "2ddc2843-5930-460f-9a3c-436f40ecc5f1",
	"transfer_amount": 10.0,
	"transfer_purpose": "transfer",
	"update_at": null
}

```

STATUS 400

Response Body: Parâmetros obrigatórios faltantes

```json
{
    "title": "Pix Transfer Key or End To End Not Provided",
    "description": "No pix transfer key or end to end id provided.",
    "translation": "Não foram fornecidos uma pix transfer key ou end to end id.",
    "code": "PXT000075"
}
```

STATUS 404

Response Body: Transferência Pix não encontrada por end_to_end_id

```json
{
    "title": "Outgoing PIX Transfer Not Found",
    "description": "Pix transfer end to end id \{end_to_end_id\} was not found",
    "translation": "Transferência PIX de saída com identificador único \{end_to_end_id\} não foi encontrada",
    "code": "PXT000073"
}
```

STATUS 404

Response Body: Transferência Pix não encontrada por pix_transfer_key

```json
{
    "title": "Outgoing PIX Transfer Not Found",
    "description": "Pix transfer key \{pix_transfer_key\} was not found",
    "translation": "Transferência PIX de saída com chave \{pix_transfer_key\} não foi encontrada.",
    "code": "PXT000023"
}
```

STATUS 403

Response Body: Usuário não possui credenciais

```json
{
    "title": "User is not allowed to do this transaction",
    "description": "User is not allowed to do this transaction",
    "translation": "Usuário não tem autorização para fazer essa transação",
    "code": "PIT000001"
}
```

### Enumeradores PixTransfer Status
| Enumerador         | Descrição                                                |
|--------------------|----------------------------------------------------------|
| `sent`           | Tranferência enviada                                            |
| `rejected`         | Tranferência rejeitada                             |
| `pending_confirmation`      | Tranferência pendente de confirmação|
| `pending_approval` | Tranferência pendente de aprovação                              |
| `error` | Tranferência com erro                              |

---

# Portability Completion

URL: /en/documentation/pix/portabilidade/conclusao_de_portabilidade

:::danger Warning!
QI Tech Webhooks should not be strictly mapped. Additional fields may be included in the webhook payloads returned by our APIs.
Campos adicionais podem ser incluídos aos payloads dos webhooks retornados em nossas APIs.
:::

After the portability is confirmed or denied, QI will continue with the key portability process. The user should receive updates about the portability in the destination bank within a few minutes. 

As soon as the portability request is completed or canceled, QI will inform the requester about the completion of the portability through the following webhook:

WEBHOOK_TYPE claim_request

Webhook Body

```json
{
  "account_key": "169010e3-6c1e-4521-9253-11cbbf36c59j",
  "pix_key": "12345678000190",
  "pix_key_type": "cnpj",
  "claim_request_type": "portability",
  "role": "claimant",
  "claim_request_key": "7f8b67d2-d8e4-4759-85eb-e4d0ac24708c",
  "claim_request_status": "concluded",
  "claimant_person_type": "natural",
  "claimant_document_number": "12345678000190",
  "claimant_account_branch": "0001",
  "claimant_account_number": "5050396",
  "claimant_account_digit": "1",
  "webhook_type": "claim_request"
}
```

#### Enumerators claim_request_status

| Enumerator           | Translation                |
|----------------------|-------------------------|
| **concluded**          | concluído               |
| **cancelled**            | cancelado               |
| **failed**               | falha                   |
| **pending_confirmation** | pendente de confirmação |

---

# Portability Inquiry by Account

URL: /en/documentation/pix/portabilidade/consulta_de_portabilidade_por_conta

## Request

ENDPOINT /baas/pix/key_claim_request/account/ ACCOUNT_KEY
METHOD GET

Request Body

### Path Params

| Field         | Type   | Description                          | Characters |
|---------------|--------|--------------------------------------|------------|
| `account_key` | string | identification key of the QIAccount. | 36         |

### Query Params
| Field          | Type    | Description                                                                                 | Characters                              |
|----------------|---------|---------------------------------------------------------------------------------------------|-----------------------------------------|
| `page_number`  | integer | Current page being queried.                                                                 | -                                       |
| `page_size`    | integer | Number of results per page.                                                                 | -                                       |
| `claim_status` | string  | Portability status. If not provided, all unfinished portabilities will be listed.           | **[Enumerators](#enumeradores-pix_key_type)** |

#### Enumerators pix_key_type
| Enumerator                  | Translation                      |
|-----------------------------|----------------------------------|
| **pending**                 | pending                           |
| **opened**                  | open                              |
| **pending_confirmation**    | pending confirmation              |
| **confirmed**               | confirmed                         |
| **cancelled**               | canceled                          |
| **concluded**               | concluded                         |
| **failed**                  | failed                            |
| **pending_donator_validation**  | pending donator validation  |
| **pending_claimer_validation** | pending claimer validation     |

## Response

STATUS 200

Response Body

```json
{
  "data": [
    {
        "account_key": "be0884bc-44a4-4907-8627-ef976e477aef",
        "cancellation_reason": null,
        "cancelled_by": null,
        "claim_flow_type": "donator",
        "claim_request_key": "be0884bc-44a4-4907-8627-ef976e477aef",
        "claim_status": "pending_confirmation",
        "claim_type": "portability",
        "claimant_account_branch": "9999",
        "claimant_account_number": "0",
        "claimant_document_number": "37059093800",
        "claimant_person_type": "natural",
        "confirmation_reason": null,
        "created_at": "2023-11-06T17:30:11",
        "donator_ispb": 32402502,
        "limit_conclusion_date": null,
        "limit_resolve_date": "2023-11-13T17:29:00",
        "max_conclusion_date": null,
        "max_resolution_date": "2023-11-13T17:29:00",
        "pix_key": "45574823098",
        "pix_key_claim_id": "205c72ab-c03e-43b7-a43d-2409e21fa5be",
        "pix_key_type": "cpf",
        "requester_key": "be0884bc-44a4-4907-8627-ef976e477aef"
    }
  ],
  "pagination": {
    "current_page": 1,
    "next_page": null,
    "rows_per_page": 10
  }
} 
```

STATUS 4XX

Response Body: Error

```json
{
  "title": "title",
  "description": "description in English",
  "translation": "description in Portuguese",
  "code": "code",
  "extra_fields": {}
}
```

| HTTP Code | QI Code<br/>`code`         | Title<br/>`title`                    | Description<br/>`Description`                                                              | Translation<br/>`translation`                                                                                 |
|-----------|----------------------------|--------------------------------------|--------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------|
| 400       | PIX000071                  | Unknown Claim Request Status         | Unknown claim_status \{claim_status\}.                                                     | claim_status \{claim_status\} não reconhecido.                                                               |
| 403       | PIX000054                  | Invalid Permission                   | Person \{person_key\} does not have administration roles for account \{account_key\}.       | Pessoa \{person_key\} não tem credencial de administrador para a conta \{account_key\}.                      |

---

# Creating a Portability Request

URL: /en/documentation/pix/portabilidade/criando_um_pedido_de_portabilidade

:::caution **Attention**
Two-factor authentication is required if the type of key for which portability is being requested is a phone number or email. The token will be sent to the requested number or email. If two-factor authentication is required, the "claim_request_status" will be "pending_claimer_validation".
Instructions for sending the token are in the section 2.5.3.5.2 Two-Factor Authentication
:::

:::danger **Attention!!**
The creation of the portability request must be done using one of the mock Pix keys provided for the sandbox environment.
[Mock Pix Keys](/documentation/pix/chaves_pix_mockadas)
:::

### Request

ENDPOINT /baas/pix/key_claim_request
METHOD POST

Request Body

```json
{
  "account_key": "169010e3-6c1e-4521-9253-11cbbf36c59j",
  "pix_key": "12345678000190",
  "pix_key_type": "cnpj"
}
```

#### Body Params

| Field          | Type   | Description                                | Characters                              |
|----------------|--------|--------------------------------------------|-----------------------------------------|
| `account_key`  | string | Identification key of the QI account.      | 36                                      |
| `pix_key`      | enum   | Key for which portability is being requested.  | -                                       |
| `pix_key_type` | enum   | Type of pix key for portability.           | **[Enumerators](#enumerators-pix_key_type)** |

#### Enumerators pix_key_type

| Enumerator         | Translation       |
|--------------------|-------------------|
| **random_key**     | aleatória         |
| **email**          | e-mail            |
| **phone_number**   | número de telefone |
| **cpf**            | cpf               |
| **cnpj**           | cnpj              |

:::info Types of Pix Key
The “pix_key” can be a CPF, CNPJ, Email, Mobile Number, or a Random Key (UUID), following these formats:
**CPF**: Integer number with 11 digits.
**CNPJ**: Integer number with 14 digits.
**Email**: Text containing at least one “@”.
**Mobile Number**: Text containing the following values: “+55” + “Cell Phone Area Code“ + “Cell Phone Number with a minimum of 8 and a maximum of 9 digits”. Example: “+5511987654321“.
**Random Key**: UUID.
:::

### Response

STATUS 200

Response Body

```json
{
  "max_conclusion_date": "2023-05-26T12:13:25",
  "claim_request_status": "pending",
  "claimant": {
    "document_number": "12345678000190",
    "claimant_key": "6aaadfbc-76ba-45d2-bb21-138bcb2baa62",
    "account_opened_at": "2023-01-17T12:28:37",
    "account_branch": "0001",
    "account_type": "escrow",
    "account_number": "7336349",
    "person_type": "legal",
    "account_digit": "0"
  },
  "max_resolution_date": "2023-05-19T12:13:25",
  "claimant_bank_name": "QI SCD S.A.",
  "pix_key": {
    "pix_key_type": "cnpj",
    "pix_key_status": "pending_confirmation",
    "created_at": "2023-05-12T12:13:24",
    "updated_at": "2023-05-12T12:13:24",
    "account_key": "169010e3-6c1e-4521-9253-11cbbf36c59j",
    "pix_key": "12345678000190"
  },
  "donator_ispb": null,
  "external_key": null,
  "claim_request_key": "7f8b67d2-d8e4-4759-85eb-e4d0ac24708c",
  "claim_request_type": "portability",
  "client_role": "claimant",
  "confirmation_reason": null,
  "requester_key": "e151044c-44d0-48b3-9df1-0b9475077fe5",
  "claimant_bank_code": "329",
  "cancelled_by": null,
  "request_failure_reason": null,
  "donator": null,
  "account_key": "169010e3-6c1e-4521-9253-11cbbf36c59j"
}
```

STATUS 4XX

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in Portuguese",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code   | QI Code<br/>`code`         | Title<br/>`title`                        | Description (eng)<br/>`Description`                                                       | Description (ptbr)<br/>`translation`                                                      |
|-------------|----------------------------|------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|
| 400         | PIX000022                  | Pix key already registered               | Pix key already registered for the account.                                               | Chave pix já cadastrada para a conta.                                                                                          |
| 400         | PIX000014                  | Maximum Number of Pix Keys in Use        | Maximum number of pix keys for account \{account_key\} has reached                        | A conta \{account_key\} já tem o número máximo de chaves pix.                                                                  |
| 400         | PIX000003                  | Account is not Opened                    | Account \{account_key\} is not opened                                                     | Conta \{account_key\} não está aberta                                                                                          |
| 400         | PIX000053                  | Invalid Portability Request              | Portability within same Financial Institution should follow key alteration flow instead   | Não é possível realizar portabilidade dentro da própria instituição financeira. Proceder com o fluxo de alteração              |
| 403         | PIX000054                  | Invalid Permission                       | Person 5dbd5598-6b42-4d80-8e5e-1c616cf8b9ab does not have administration roles for account 169010e3-6c1e-4521-9253-11cbbf36c59j. | Pessoa 5dbd5598-6b42-4d80-8e5e-1c616cf8b9ab não tem credencial de administrador para a conta 169010e3-6c1e-4521-9253-11cbbf36c59j. |
| 404         | PIX000017                  | Pix Key is Unregistered                  | Pix key 12345678000190 is not currently used.                                              | A chave pix 12345678000190 não está sendo utilizada.                                                                            |
| 422         | PIX000077                  | Error when querying pix key              | Error when querying pix key 12345678000190                                                 | Erro ao consultar chave pix 12345678000190                                                                                      |
| 400         | PIX000028                  | Key Type not allowed for portability or claim | Only cpf, cnpj, email and phone_number key_types can be portabilized or claim. Received key_type: random_key | Somente os key_types cpf, cnpj, email e phone_number podem ser portabilizados ou reivindicados. key_type recebido: random_key   |
| 400         | PIX000061                  | Invalid Document                         | Invalid document sent 12345678000190.                                                     | Documento enviado é inválido 12345678000190.                                                                                   |
| 404         | PIX000026                  | Account not found                        | Account not found for account_key: 6aaadfbc-76ba-45d2-bb21-138bcb2baa62                   | Conta não encontrada para account_key: 6aaadfbc-76ba-45d2-bb21-138bcb2baa62                                                   |
| 404         | PIX000027                  | Person not found                         | Person not found for person_key: \{person_key\}                                            | Pessoa não encontrada para person_key: \{person_key\}                                                                          |
| 422         | PIX000069                  | Pix Key inquiry timeout                  | Pix key inquiry timeout. Please try again.                                               | Consulta de chave pix excedeu o tempo limite. Por favor tente novamente.                                                       |
| 400         | PIX000072                  | Pix Key Claim Non Finished               | Pix key 12345678000190, already has a claim request non finished.                         | Chave pix 12345678000190, já possui um pedido de portabilidade não finalizado.                                                 |

---

# Deleting a Portability Request

URL: /en/documentation/pix/portabilidade/deletando_um_pedido_de_portabilidade

If the portability request is in the "pending_claimer_validation" status, it is possible to delete the portability.

### Request

ENDPOINT /baas/pix/key_claim_request/ CLAIM_REQUEST_KEY
METHOD DELETE

Request Body

```json
{}
```

### Response

STATUS 200

Response Body

```json
{
  "max_conclusion_date": "2023-05-26T12:13:25",
  "claim_request_status": "cancelled",
  "claimant": {
    "document_number": "12345678000190",
    "claimant_key": "6aaadfbc-76ba-45d2-bb21-138bcb2baa62",
    "account_opened_at": "2023-01-17T12:28:37",
    "account_branch": "0001",
    "account_type": "escrow",
    "account_number": "7336349",
    "person_type": "legal",
    "account_digit": "0"
  },
  "max_resolution_date": "2023-05-19T12:13:25",
  "claimant_bank_name": "QI SCD S.A.",
  "pix_key": {
    "pix_key_type": "email",
    "pix_key_status": "inactivated",
    "created_at": "2023-05-12T12:13:24",
    "updated_at": "2023-05-12T12:13:24",
    "account_key": "169010e3-6c1e-4521-9253-11cbbf36c59j",
    "pix_key": "example@gmail.com"
  },
  "donator_ispb": null,
  "external_key": null,
  "claim_request_key": "7f8b67d2-d8e4-4759-85eb-e4d0ac24708c",
  "claim_request_type": "portability",
  "client_role": "claimant",
  "confirmation_reason": null,
  "requester_key": "e151044c-44d0-48b3-9df1-0b9475077fe5",
  "claimant_bank_code": "329",
  "cancelled_by": null,
  "request_failure_reason": null,
  "donator": null,
  "account_key": "169010e3-6c1e-4521-9253-11cbbf36c59j"
}
```

STATUS 4XX

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description in Portuguese",
  "code": "code",
  "extra_fields": {}
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title` | Description<br/>`Description` | Translation<br/>`translation` |
|-----------|--------------------|-----------------------------------------------------------|--------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------|
| 404 | PIX000031 | Claim Request not found | Claim Request not found for key: 7f8b67d2-d8e4-4759-85eb-e4d0ac24708c. | Claim Request não encontrada para a chave: 7f8b67d2-d8e4-4759-85eb-e4d0ac24708c. |
| 403 | QIT000005 | Permission Validator Error. | Selected agent do not own this item. | O agente selecionado não é dono do item. |
| 400 | PIX000047 | Claim request does not have validation. | Claim request does not have two steps validation. | Pedido de reinvindicação não possui validação de duas etapas. |
| 400 | PIX000047 | Claim Request Is Not Pending Validation From The Claimer. | Claim request 7f8b67d2-d8e4-4759-85eb-e4d0ac24708c, is not pending validation from the claimer. | Pedido de portabilidade 7f8b67d2-d8e4-4759-85eb-e4d0ac24708c, não está pendente de validação do solicitante. |

---

# Portability

URL: /en/documentation/pix/portabilidade/recebendo_pedido_de_portabilidade

:::danger Warning!
QI Tech webhooks should not be strictly mapped.
Additional fields may be included in the webhook payloads returned by our APIs
:::

## Receiving a Portability Request

After the portability request is created in another bank, QI will inform the requester about the open portability request through the following webhook:

WEBHOOK_TYPE claim_request

Webhook Body

```json
{
  "account_key": "169010e3-6c1e-4521-9253-11cbbf36c59j",
  "pix_key": "12345678000190",
  "pix_key_type": "cnpj",
  "claim_request_type": "portability",
  "role": "donator",
  "claim_request_key": "7f8b67d2-d8e4-4759-85eb-e4d0ac24708c",
  "claim_request_status": "pending_confirmation",
  "claimant_person_type": "natural",
  "claimant_document_number": "12345678000190",
  "claimant_account_branch": "0001",
  "claimant_account_number": "5050396",
  "claimant_account_digit": "1",
  "webhook_type": "claim_request"
}
```

#### Enumerators claim_request_status

| Enumerator           | Translation                |
|----------------------|-------------------------|
| concluded            | concluído               |
| cancelled            | cancelado               |
| failed               | falha                   |
| pending_confirmation | pendente de confirmação |

---

# Resending Two-Factor Authentication

URL: /en/documentation/pix/portabilidade/reenviando_a_2fa

If the portability request is in the "pending_claimer_validation" status, it is possible to resend the two-factor authentication code.

### Request

ENDPOINT /baas/pix/key_claim_request/ CLAIM_REQUEST_KEY /resend_twofa
METHOD PATCH

Request Body

```json
{}
```

### Response

STATUS 205

Response Body

```json
{
  "max_conclusion_date": "2023-05-26T12:13:25",
  "claim_request_status": "pending_claimer_validation",
  "claimant": {
    "document_number": "12345678000190",
    "claimant_key": "6aaadfbc-76ba-45d2-bb21-138bcb2baa62",
    "account_opened_at": "2023-01-17T12:28:37",
    "account_branch": "0001",
    "account_type": "escrow",
    "account_number": "7336349",
    "person_type": "legal",
    "account_digit": "0"
  },
  "max_resolution_date": "2023-05-19T12:13:25",
  "claimant_bank_name": "QI SCD S.A.",
  "pix_key": {
    "pix_key_type": "email",
    "pix_key_status": "pending_confirmation",
    "created_at": "2023-05-12T12:13:24",
    "updated_at": "2023-05-12T12:13:24",
    "account_key": "169010e3-6c1e-4521-9253-11cbbf36c59j",
    "pix_key": "example@gmail.com"
  },
  "donator_ispb": null,
  "external_key": null,
  "claim_request_key": "7f8b67d2-d8e4-4759-85eb-e4d0ac24708c",
  "claim_request_type": "portability",
  "client_role": "claimant",
  "confirmation_reason": null,
  "requester_key": "e151044c-44d0-48b3-9df1-0b9475077fe5",
  "claimant_bank_code": "329",
  "cancelled_by": null,
  "request_failure_reason": null,
  "donator": null,
  "account_key": "169010e3-6c1e-4521-9253-11cbbf36c59j"
}

```

STATUS 4XX

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "description em Portuguese",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title` | Description<br/>`Description` | Translation<br/>`translation` |
|-----------|--------------------|-----------------------------------------------------------|---------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------|
| 404 | PIX000031 | Claim Request not found | Claim Request not found for key: 7f8b67d2-d8e4-4759-85eb-e4d0ac24708c. | Claim Request não encontrada para a chave: 7f8b67d2-d8e4-4759-85eb-e4d0ac24708c. |
| 403 | QIT000005 | Permission Validator Error. | Selected agent do not own this item. | O agente selecionado não é dono do item. |
| 400 | PIX000047 | Claim request does not have validation. | Claim request does not have two steps validation. | Pedido de reinvindicação não possui validação de duas etapas. |
| 400 | PIX000047 | Claim Request Is Not Pending Validation From The Claimer. | Claim request 7f8b67d2-d8e4-4759-85eb-e4d0ac24708c, is not pending validation from the claimer. | Pedido de portabilidade 7f8b67d2-d8e4-4759-85eb-e4d0ac24708c, não está pendente de validação do solicitante. |

---

# Portability

URL: /en/documentation/pix/portabilidade/respondendo_pedido_de_portabilidade

### Request

ENDPOINT /baas/pix/key_claim_request/ CLAIM_REQUEST_KEY/
CLAIM_ACTION
METHOD PATCH

#### Path params
| Field               | Type   | Description                              |
|---------------------|--------|------------------------------------------|
| `claim_request_key` | string | the key of the portability request.       |
| `claim_action`      | enum   | **[Enumerators](#enumeradores-claim_action)** |

#### Enumerators claim_action
| Enumerator                 | Translation | Description                                                                                   |
|----------------------------|-------------|-----------------------------------------------------------------------------------------------|
| confirmed                  | confirmed   | use this action to confirm the portability request.                                           |
| cancelled                  | canceled    | use this action to cancel the portability request.                                            |
| pending_donator_validation | pending_donator_validation | use this action to receive two-factor authentication.                                          |

:::caution **Warning**
Before canceling a claim with "claim_request_type" as "ownership", it is necessary to perform the "pending_donator_validation" action to receive two-factor authentication and send it in the payload. The only accepted "cancelation_reason" for canceling claims of this type are "ownership" and "fraud".
:::

:::caution **Warning**
After the cancellation action is executed, the claim request process is concluded, and there are no further hooks to be received.
:::

Request Body

```json title='Confirmation'
{
    "confirmation_reason": "client_request"
}
```
```json title='Cancellation'
{
    "cancellation_reason": "client_request"
}
```
```json title='Ownership cancellation'
{
    "cancellation_reason": "fraud",
    "verification_code": "432371"
}
```
```json title='Pending Donor Validation'
{}
```

#### Body Params

| Field                | Type   | Description                                 | Characters |
|----------------------|--------|---------------------------------------------|------------|
| `confirmation_reason`| enum   | **[Enumerators](#enumeradores-confirmation_reason)**. | 14         |
| `cancellation_reason`| enum   | **[Enumerators](#enumeradores-cancellation_reason)**. | 14         |
| `verification_code`  | string | token received on the phone number or email. | 6          |

#### Enumerators confirmation_reason
| Enumerator       | Translation           |
|------------------|-----------------------|
| client_request   | client request        |

#### Enumerators cancellation_reason
| Enumerator       | Translation           |
|------------------|-----------------------|
| **client_request** | client request      |
| **fraud**        | fraud                 |

:::caution **Warning**
When canceling a portability request of type "ownership", the "cancellation_reason" must always be "fraud".
:::

### Response

STATUS 200

Response Body

```json
{
    "max_conclusion_date": "2023-05-26T12:13:25",
    "claim_request_status": "confirmed",
    "claimant": {
        "document_number": "12345678000190",
        "claimant_key": "6aaadfbc-76ba-45d2-bb21-138bcb2baa62",
        "account_opened_at": "2023-01-17T12:28:37",
        "account_branch": "0001",
        "account_type": "checking",
        "account_number": "7336349",
        "person_type": "legal",
        "account_digit": "0"
    },
    "max_resolution_date": "2023-05-19T12:13:25",
    "claimant_bank_name": "QI SCD S.A.",
    "pix_key": {
        "pix_key_type": "cnpj",
        "pix_key_status": "active",
        "created_at": "2023-05-12T12:13:24",
        "updated_at": "2023-05-12T12:13:24",
        "account_key": "169010e3-6c1e-4521-9253-11cbbf36c59j",
        "pix_key": "12345678000190"
    },
    "donator_ispb": null,
    "external_key": null,
    "claim_request_key": "7f8b67d2-d8e4-4759-85eb-e4d0ac24708c",
    "claim_request_type": "portability",
    "client_role": "claimant",
    "confirmation_reason": null,
    "requester_key": "e151044c-44d0-48b3-9df1-0b9475077fe5",
    "claimant_bank_code": "329",
    "cancelled_by": null,
    "request_failure_reason": null,
    "donator": null,
    "account_key": "169010e3-6c1e-4521-9253-11cbbf36c59j"
}
```

| HTTP Code | QI Code<br/>`code`          | Title<br/>`title`                              | Description<br/>`Description`                                                                                                                                 | Translation<br/>`translation`                                                                                                                  |
|-----------|-----------------------------|------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 400       | PIX000043                   | Claim request action not allowed on current status | confirmed claim request action only allowed for pending_confirmation requests                                                                                 | Ação confirmed para claim request permitida somente para pedidos com status pending_confirmation.                                                               |
| 400       | PIX000036                   | Claim request action not allowed for claimant    | Claim request action not allowed for claimant. Only donator can perform this action                                                                            | Ação sobre claim request não permitida para reivindicador. Somente o doador pode executar esta ação                                                              |
| 400       | PIX000044                   | Claim request confirm action without reason      | confirmation_reason is required on action confirmed                                                                                                           | confirmation_reason é obrigatório na ação confirmed                                                                                                             |
| 400       | PIX000045                   | Confirmation reason not allowed                   | cancellation_reason: invalid not allowed for client_role: donator and claim_request_type: portability                                                           | cancellation_reason: invalid não permitida para client_role: donator and claim_request_type: portability                                                         |
| 400       | PIX000039                   | Claim request action not allowed on current status | Cancelled claim request action only allowed for non concluded requests                                                                                         | Ação cancelled para claim request permitida somente para pedidos com status diferente de concluded                                                               |
| 400       | PIX000040                   | Claim request cancel action without reason       | cancellation_reason is required on action cancelled                                                                                                            | cancellation_reason é obrigatório na ação cancelled                                                                                                              |
| 400       | PIX000042                   | Cancellation reason not allowed                  | cancellation_reason: client_request not allowed for client_role: donator and claim_request_type: ownership                                                      | cancellation_reason: client_request não permitida para client_role: donator and claim_request_type: ownership                                                    |
| 400       | PIX000051                   | Verification code required                       | 2FA verification code required.                                                                                                                                | Código de verificação 2FA necessário.                                                                                                                            |
| 400 | PIX000100 | External Claim Already Cancelled | The external claim request has already been cancelled | O pedido de portabilidade externo já foi cancelado |
| 404       | PIX000034                   | Claim Request not found                          | Claim Request not found. claim_request_key: 7f8b67d2-d8e4-4759-85eb-e4d0ac24708c external_key: b8e25f24-4051-4b13-90a7-76be7b6e96d2.                           | Claim Request não encontrada. claim_request_key: 7f8b67d2-d8e4-4759-85eb-e4d0ac24708c external_key: b8e25f24-4051-4b13-90a7-76be7b6e96d2.                     |
| 401       | 2FA000401                    | Unauthorized                                     | Invalid verification combination.                                                                                                                             | Código de verificação inválido.                                                                                                                                    |
| 403       | 2FA000403                    | Forbidden                                        | Code already verified.                                                                                                                                        | Este código já foi utilizado.                                                                                                                                    |
| 410       | 2FA000410                    | Gone                                             | Expired Code.                                                                                                                                                  | Código de verificação expirado.                                                                                                                                                                             |

---

# Simulate portability status change

URL: /en/documentation/pix/portabilidade/simular_alteracao_de_status_de_portabilidade

### Request

ENDPOINT /mock/pix_keys/key_claim_simulation/ CLAIM_REQUEST_KEY
/receive_response/ CLAIM_ACTION
METHOD PATCH

#### Path params

| Field               | Type   | Description                                              |
|---------------------|--------|----------------------------------------------------------|
| `claim_request_key` | uuidv4 | Unique identification key for the portability request.  |
| `claim_action`      | string | **[Enumerators](#enumerators-claim_action)**            |

#### Enumerators claim_action

| Enumerator    | Translation | Description                                                                                                                                 |
|---------------|-------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| **failed**    | failed      | The portability request failed                                                                                                              |
| **confirmed** | confirmed   | The portability request is confirmed, requires approval from the donor bank to be completed or rejection to be cancelled                   |
| **cancelled** | cancelled   | The portability request is cancelled, therefore, to make a claim on this key, a new portability request must be opened                     |
| **concluded** | concluded   | The portability request is concluded                                                                                                        |

Request Body

```json
{}
```

### Response

STATUS 204

Response Body

```json
{}
```

STATUS 4XX

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title`                           | Description (eng)<br/>`Description`                                                         | Description (ptbr)<br/>`translation`                                                                  |
|-----------|--------------------|--------------------------------------------|--------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
| 404       | PIX000034          | Claim Request not found                    | Claim Request not found. claim_request_key: claim_request_key external_key: external_key. | Claim Request não encontrada. claim_request_key: claim_request_key external_key: external_key.      |
| 400       | PIX000035          | Claim request action not allowed for donator | Claim request action not allowed for donator. Only claimant can perform this action     | Ação sobre claim request não permitida para doador. Somente o reinvidicador pode executar esta ação |

---

# Simulating the Completion of a Portability Request

URL: /en/documentation/pix/portabilidade/simular_webhook_de_conclusao

### Request

ENDPOINT /mock/pix_keys/key_claim_simulation/ CLAIM_REQUEST_KEY
/complete
METHOD PATCH

#### Path params

| Field               | Type   | Description                         |
|---------------------|--------|-------------------------------------|
| `claim_request_key` | string | the key of the portability request. |

Request Body

```json
{}
```

### Response

STATUS 204

Response Body

```json
{}
```

STATUS 4XX

Response Body: Error

```json
{
  "title": "title",
  "description": "description in English",
  "translation": "description in Portuguese",
  "code": "code",
  "extra_fields": {}
}
```

| HTTP Code | QI Code<br/>code      | Title<br/>title                                  | Description<br/>Description                                                                                                                 | Translation<br/>translation                           |
|-----------|-----------------------|-------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------|
| 404       | PIX000034             | Claim Request not found                         | Claim Request not found. claim_request_key: 7f8b67d2-d8e4-4759-85eb-e4d0ac24708c external_key: b8e25f24-4051-4b13-90a7-76be7b6e96d2.         | Pedido de portabilidade não encontrado.              |
| 400       | PIX000046             | Portability action not allowed in current status | Action concluded for claim request allowed only for status confirmed                                                                        | Ação de portabilidade não permitida no status atual. |
| 400       | PIX000036             | Action not allowed for claimer                  | Action on claim request not allowed for claimer. Only the donor can execute this action                                                     | Ação não permitida para requerente.                  |

---

# Simulating the Receipt Webhook for a Portability Request

URL: /en/documentation/pix/portabilidade/simular_webhook_recebimento

### Request

ENDPOINT
      /mock/pix_keys/key_claim_simulation/receive
MÉTODO
      POST

Request Body

```json
{
  "pix_key": "12345678000190",
  "pix_key_type": "cnpj"
}
```

#### Body Params

| Field        | Type | Description                                           | Characters                                            |
|--------------|------|-------------------------------------------------------|-------------------------------------------------------|
| `pix_key`    | enum | key to simulate the receipt of a portability request. | -                                                     |
| `pix_key_type` | enum | type of the pix key for portability.                    | **[Enumerators](#enumeradores-pix_key_type)**          |

#### Enumerators pix_key_type
| Enumerator     | Translation           |
|----------------|-----------------------|
| **random_key** | random                |
| **email**      | email                 |
| **phone_number** | phone number        |
| **cpf**        | cpf                   |
| **cnpj**       | cnpj                  |

:::info Pix Key Types
The pix key sent in the payload must be active in the sandbox environment and in an account you have created.
:::

### Response

STATUS 201

Response Body

```json
{}
```

STATUS 4XX

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| HTTP Code | QI Code<br/>`code`     | Title<br/>`title`          | Description<br/>`Description`                                              | Translation<br/>`translation`                                         |
|-----------|------------------------|----------------------------|-----------------------------------------------------------------------------|------------------------------------------------------------------------|
| 400       | PIX000072              | Pix Key Claim Non Finished | Pix key 12345678000190, already has a claim request non finished.            | Chave pix 12345678000190, já possui um pedido de portabilidade não finalizado. |
| 400       | PIX000026              | Account not found          | Account not found for account_key: 6aaadfbc-76ba-45d2-bb21-138bcb2baa62      | Conta não encontrada para account_key: 6aaadfbc-76ba-45d2-bb21-138bcb2baa62 |

---

# Two-Factor Authentication

URL: /en/documentation/pix/portabilidade/validacao_de_dois_fatores

:::info Token in Sandbox
To facilitate testing in the sandbox environment, the token will always have the value `329329`.
This behavior is exclusive to the sandbox environment.
:::

### Request

ENDPOINT /baas/pix/key_claim_request/ CLAIM_REQUEST_KEY /twofa_validation
METHOD PATCH

#### Path params

| Field               | Type   | Description                          |
|---------------------|--------|--------------------------------------|
| `claim_request_key` | string | The key of the portability request.  |

Request Body

```json
{
  "verification_code": "432371"
}
```

#### Body Params

| Field               | Type   | Description                                       | Characters |
|---------------------|--------|-------------------------------------------------|------------|
| `verification_code` | string | token received by email or cellphone number. | 6          |

### Response

STATUS 200

Response Body

```json
{
  "max_conclusion_date": "2023-05-26T12:13:25",
  "claim_request_status": "pending",
  "claimant": {
    "document_number": "12345678000190",
    "claimant_key": "6aaadfbc-76ba-45d2-bb21-138bcb2baa62",
    "account_opened_at": "2023-01-17T12:28:37",
    "account_branch": "0001",
    "account_type": "escrow",
    "account_number": "7336349",
    "person_type": "legal",
    "account_digit": "0"
  },
  "max_resolution_date": "2023-05-19T12:13:25",
  "claimant_bank_name": "QI SCD S.A.",
  "pix_key": {
    "pix_key_type": "cnpj",
    "pix_key_status": "pending_confirmation",
    "created_at": "2023-05-12T12:13:24",
    "updated_at": "2023-05-12T12:13:24",
    "account_key": "169010e3-6c1e-4521-9253-11cbbf36c59j",
    "pix_key": "12345678000190"
  },
  "donator_ispb": null,
  "external_key": null,
  "claim_request_key": "7f8b67d2-d8e4-4759-85eb-e4d0ac24708c",
  "claim_request_type": "portability",
  "client_role": "claimant",
  "confirmation_reason": null,
  "requester_key": "e151044c-44d0-48b3-9df1-0b9475077fe5",
  "claimant_bank_code": "329",
  "cancelled_by": null,
  "request_failure_reason": null,
  "donator": null,
  "account_key": "169010e3-6c1e-4521-9253-11cbbf36c59j"
}

```

STATUS 4XX

Response Body: Error

```json
{
  "title": "title",
  "description": "description in English",
  "translation": "description in Portuguese",
  "code": "code",
  "extra_fields": {}
}
```

| HTTP Code | QI Code<br/>`code` | Title<br/>`title` | Description (eng)<br/>`Description` | Description (ptbr)<br/>`translation` |
|-------------|----------------------|----------------------------------------------------|-----------------------------------------------------------------------------|-------------------------------------------------------------------------------------|
| 400 | PIX000047 | Claim request action not allowed on current status | Validate Claim request action only allowed for pending_validation requests. | Ação validate para claim request permitida somente para pedidos pending_validation. |
| 401 | 2FA000401 | Unauthorized | Invalid verification combination. | Código de verificação inválido. |
| 403 | 2FA000403 | Forbidden | Code already verified. | Este código já foi utilizado. |
| 403 | QIT000005 | Permission Validator Error. | Selected agent do not own this item. | O agente selecionado não é dono do item. |
| 410 | 2FA000410 | Gone | Expired Code. | Código de verificação expirado. |
| 404 | PIX000031 | Claim Request not found | Claim Request not found for key: 7f8b67d2-d8e4-4759-85eb-e4d0ac24708c. | Claim Request não encontrada para a chave: 7f8b67d2-d8e4-4759-85eb-e4d0ac24708c. |

---

# Scenario simulation

URL: /en/documentation/pix/simulacao

Step-by-step guide to simulate the execution of actions performed by external agents. These simulations include: deposit, refund, and IN portability of Pix key.

:::caution Information
**There is no payload return (response body) in these requests.**
:::

## 1 - PIX deposit simulation

### Request

ENDPOINT /mock/pix_transfer/incoming_pix_transfer
METHOD POST

Request Body

```json
{
    "target_account_key": "<Destination account's unique key>",
    "amount": "<Transaction amount>"
}
```

### Body Parameters

| Field | Type | Description | Max. Characters | Example | Note |
|----------------------|--------|------------------------------------|--------------|----------------------------------------|-------------------------|
| `target_account_key` | string | Destination account's unique key | 36 | "41112f46-0034-4007-85687-5e592173db2" | |
| `amount` | number | Transaction amount | 6 | 1000 | Maximum value of 100,000 | |

## 2 - Simulation of PIX QR Code payment

### Request

ENDPOINT /mock/pix_transfer/incoming_pix_qrcode
METHOD POST

Request Body

```json
{
  "qr_code_key": "41112f46-0034-4007-85687-5e592173db2"
}
```

### Body Parameters

| Field | Type | Description | Max. Characters | Example | Note |
|---------------|--------|--------------------------------------------|--------------|----------------------------------------|------------|
| `qr_code_key` | string | Unique identification key of the QR code | 36 | "41112f46-0034-4007-85687-5e592173db2" | |

## 3 - Simulation of PIX refund

### Request

ENDPOINT /mock/pix_transfer/chargeback
METHOD POST

Request Body

```json
{
    "end_to_end_id": "<Transaction's unique key>",
    "amount": "<Transaction amount>"
}
```

### Body Parameters

| Field | Type | Description | Max. Characters | Example | Note |
|-----------------|--------|---------------------------------|--------------|------------------------------------|-------------------------|
| `amount` | number | Transaction amount | 6 | 1000 | Maximum value of 100,000 | |
| `end_to_end_id` | string | Unique key of the PIX transaction | 32 | "E3240250220210723142712312751267" | |

## 4 - Simulation of IN portability webhook for PIX key

### Request

ENDPOINT /mock/pix_keys/key_claim_request/webhook
METHOD POST

Request Body

```json
{
    "claim_request_key": "<Requester's unique key>",
    "claim_request_status": "<Status enumerator>"
}
```

### Body Parameters

| Field | Type | Description | Max. Characters | Example | Note |
|------------------------|--------|---------------------------------------------------------------------|--------------|----------------------------------------|------------|
| `claim_request_key` | string | Requester's unique key | 36 | "ced00dc6-000a-0bd4-a111-85710a46ec05" | |
| `claim_request_status` | enum | [Claim Request Status Enumerator](#enumerador-claim-request-status) | | "concluded" | |

### Enumerator Claim Request Status
| Enumerator | Description |
|--------------------------|-------------------------|
| **concluded** | Concluded |
| **cancelled** | Cancelled |
| **failed** | Failed |
| **pending_confirmation** | Pending confirmation |

## 5 - Simulation of transaction pending confirmation status
Pix transactions can enter **pending_confirmation** status when there is a delay in the response from the Banco Central for the Pix transaction. 

To simulate this scenario, perform a transaction using the Pix key `"target_pix_key": "0476f803-0129-430a-a66c-d2f0d7cf4aaa"` or, for **manual** Pix transfers, use `"owner_document_number": "35586870002"` as the destination account owner's document number.

To update the transaction's status, perform the request below with `transaction_status` set to **sent** to approve the transaction, or **rejected** to deny it.

### Request

ENDPOINT /mock/pix_transfer/pending_confirmation
METHOD POST

Request Body

```json
{
  "end_to_end_id": "E32402502202308181802vSHbiqNCk9i",
  "transaction_status": "rejected",
  "status_reason_information": {
    "error_description": "description",
    "error_translation": "translation",
    "error_short_description": "short_description"
  },
  "error_code": "test_error"
}
```

### Body Parameters

| Field | Type | Description | Max. Characters |
|-----------------------------|--------|-----------------------------------------------------------------------|--------------|
| `end_to_end_id`* | string | Unique key of the PIX transaction | 36 |
| `transaction_status`* | enum | [Transaction Status Enumerator](#enumerador-transaction-status) |
| `status_reason_information` | object | [Status Reason Information Object](#object-status-reason-information) |
| `error_code` | string | Error code |

### Transaction Status Enumerator
| Enumerator | Description |
|--------------|-----------|
| **sent** | Concluded |
| **rejected** | Rejected |

### Object Status Reason Information

| Field | Type | Description | Max. Characters |
|---------------------------|--------|-----------------------------------|--------------|
| `error_description` | string | Error description in English | 100 |
| `error_translation` | string | Error description in Portuguese | 100 |
| `error_short_description` | string | Short error description in English | 100 |

## 6 - Simulation of rejected transaction
Pix transactions can enter **rejected** status when there is an expected return of the Pix transaction refusal by Banco Central or the receiving PSP. 

To simulate this scenario, perform a transaction using the Pix key `"target_pix_key": "b9380607-dac6-4e17-8ca7-eb761e3aa1dc"` or, for **manual** Pix transfers, use `"owner_document_number": "66972913039"` or `"owner_document_number": "50305556000164"` as the destination account owner's document number.

## 7 - Retrieve Token sent for Two-Factor Authentication
For individual and batch Pix transactions from integrator partners with two-factor authentication configuration, a `token` is sent to the account movement approver. Through this endpoint, it is possible to retrieve the sent token for integration testing purposes.

ENDPOINT /mock/2fa/transaction_request/ TRANSACTION_REQUEST_KEY
METHOD GET

## Path Params
| Field | Type | Description | Characters |
|---------------------------|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|
| `transaction_request_key` | uuid4 | Unique identification key of the transaction. For Pix transactions, it would be `pix_transfer_key`, and for batch Pix transactions, it would be `pix_transfer_batch_key` | 36 |

Response Body

```json
{
  "token": "1a2b3c"
}
```

---

# Request limit change for Pix

URL: /en/documentation/pix/solicitar_alteracao_de_limite_pix

## Request

ENDPOINT /baas/pix/limits/ ACCOUNT_KEY
METHOD POST

Request Body

```json
{
    "daily_amount_limit": 2000.00,
    "nightly_amount_limit": 1000.00,
    "self_daily_amount_limit": 1500.00,
    "self_nightly_amount_limit": 500.00
}
```

### Body Params

| Field | Type | Description |
|-----------------------------|-------|------------------------------------------------------------------------------------|
| `daily_amount_limit` | float | Limit during the daytime period for Pix transfers to different account holders |
| `nightly_amount_limit` | float | Limit during the nighttime period for Pix transfers to different account holders |
| `self_daily_amount_limit` | float | Limit during the daytime period for Pix transfers to the same account holder |
| `self_nightly_amount_limit` | float | Limit during the nighttime period for Pix transfers to the same account holder |

:::info Daytime period
For the **daytime** period, transfers made between **06:00** and **20:00** are counted.
:::
:::danger Attention
Requests for Pix limit increases have a SLA of **48 hours** for approval.
Requests for Pix limit reductions are approved and executed immediately.

If the **48-hour** SLA is reached without approval, the request is automatically rejected with the reason `Tempo de avaliação expirado.` (evaluation time expired) and a rejection webhook is sent to the requester (see [Webhook Request Rejected Body](#webhook-request-rejected-body)).
:::

## Response

STATUS 200

Response Body

```json
[
	{
		"account_digit": "5",
		"account_key": "467ce632-cc2c-412a-bc56-aa949bd8393d",
		"account_name": "Default",
		"account_number": "26709",
		"amount_limit": 2000.0,
		"event_type": "pix_limit_request",
		"limit_type": "daily",
		"owner_document_number": "63602991000100",
		"request_status": "pending_approval",
		"requester_document_number": "77669728833"
	},
	{
		"account_digit": "5",
		"account_key": "467ce632-cc2c-412a-bc56-aa949bd8393d",
		"account_name": "Default",
		"account_number": "26709",
		"amount_limit": 1000.0,
		"event_type": "pix_limit_request",
		"limit_type": "nightly",
		"owner_document_number": "63602991000100",
		"request_status": "pending_approval",
		"requester_document_number": "77669728833"
	},
	{
		"account_digit": "5",
		"account_key": "467ce632-cc2c-412a-bc56-aa949bd8393d",
		"account_name": "Default",
		"account_number": "26709",
		"amount_limit": 1500.0,
		"event_type": "pix_limit_request",
		"limit_type": "self_daily",
		"owner_document_number": "63602991000100",
		"request_status": "pending_approval",
		"requester_document_number": "53417895200"
	},
	{
		"account_digit": "5",
		"account_key": "467ce632-cc2c-412a-bc56-aa949bd8393d",
		"account_name": "Default",
		"account_number": "26709",
		"amount_limit": 500.0,
		"event_type": "pix_limit_request",
		"limit_type": "self_nightly",
		"owner_document_number": "63602991000100",
		"request_status": "pending_approval",
		"requester_document_number": "53417895200"
	}
]

```

STATUS 400

Response Body: Invalid number sent

```json
{
	"title": "Bad Request",
	"description": "Invalid decimal amount, sent 1500.001",
	"translation": "Valor decimal inválido, enviado 1500.001",
	"code": "PXT000043",
	"additional_data": {}
}
```

STATUS 403

Response Body: User does not have credentials

```json
{
    "title": "Unauthorized",
    "description": "User is not allowed to do this transaction",
    "translation": "Usuário não tem autorização para fazer essa transação",
    "code": "PIT000001"
}
```

### Webhook Response

:::info Webhook generating event
Webhooks are sent to the account requester when the limit request is executed.
:::

Webhook Request Accepted Body

```json
{
   "webhook_type": "baas.pix.limits.account_limit_config.updated",
   "webhook_datetime": "2023-08-05T19:54:01.514Z",
   "data": {
      "pix_transfer_limit_config": [
         {
            "period": "daily",
            "account_key": "467ce632-cc2c-412a-bc56-aa949bd8393d",
            "amount_limit": 800012.67,
            "self_amount_limit": 500.03
         },
         {
            "period": "nightly",
            "account_key": "467ce632-cc2c-412a-bc56-aa949bd8393d",
            "amount_limit": 100000.0,
            "self_amount_limit": 100000.0
         }
      ]
   }
}
```

Webhook Request Rejected Body

```json
{
   "webhook_type":"baas.pix.limits.account_limit_config.updated",
   "webhook_datetime": "2023-08-05T19:54:01.514Z",
   "data":{
     "message": "QI Tech informa que a solicitacao de limite PIX diário para terceiros da sua conta foi rejeitada. Motivo: limite reanalisado.",
     "account_key": "467ce632-cc2c-412a-bc56-aa949bd8393d",
     "request_status": "rejected",
     "limit_type": "daily"
   }
}
```

### Enumerators limit_type
| Enumerator | Description |
|-----------------------|------------------------------------------------------------------------------------|
| `daily` | Limit during the daytime period for Pix transfers to different account holders |
| `nightly` | Limit during the nighttime period for Pix transfers to different account holders |
| `self_daily` | Limit during the daytime period for Pix transfers to the same account holder |
| `self_nightly` | Limit during the nighttime period for Pix transfers to the same account holder |

---

# Solicitar devolução de um Pix

URL: /en/documentation/pix/solicitar_chargeback_pix

A devolução de um Pix pode ser solicitada em até 90 dias a partir de seu recebimento.

## Request

ENDPOINT /baas/pix_transfer
MÉTODO POST

:::info Informação
Após a solicitação da devolução é necessário realizar a [aprovação da solicitação de transferência Pix](../pix/aprovar_solicitacao_de_transferencia) 
:::

Request Body

```json
{
    "is_chargeback": true,
    "pix_transfer_key": "b91da9c7-72de-46dc-bb36-4b1407d1eb91",
    "chargeback_amount": 147,
    "chargeback_message": "Mensagem Pix da devolução"
}
```

## Response

STATUS 200

Response Body

```json
{
	"data": {
		"pix_transfer_key": "b3015cb5-862d-48aa-946d-c14afc8cdebb",
		"pix_transfer_status": "pending_approval",
		"pix_transfer_type": "chargeback",
		"target_account": {
			"document_number": "***02502000***",
			"financial_institution": "QI SOCIEDADE DE CRÉDITO DIRETO S.A."
		},
		"transfer_amount": 35
	},
	"event_datetime": "2023-03-21 11:52:11",
	"operation_key": "ec9b4741-7c7e-4429-9b10-3fc05045ebea",
	"status": "pending_approval"
}
```

STATUS 4xx

Response Body: Reversão Rejeitada

```json
{
    "title": "titulo",
    "description": "description in English",
    "translation": "descrição em portugues",
    "code": "codigo"
}
```

| Código HTTP<br/>`status` | Código QI<br/>`code` | Título<br/>`title`                  | Descrição (eng)<br/>`description`                                      | Descrição (ptbr)<br/>`translation`                                                        |
|--------------------------|----------------------|-------------------------------------|------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                         | Schema Error                                                           | Erro de Schema                                                                            |
| 404                      | PXT000084            | Original Pix Transfer Was Not Found | Original Pix Transfer Was Not Found.                                   | A transação PIX original não foi encontrada.                                              |
| 400                      | PXT000017            | Reversal Too Great                  | Reversal transfers sum amount surpasses that of original pix transfer. | A soma das transferências de devolução ultrapassam o valor da transferência pix original. |
| 400                      | PXT000015            | Reversal date expired               | Reversal original transaction is older than 90 days                    | A data de criação da transação original é mais antiga que 90 dias                         |

---

# solicitar_transferencia

URL: /en/documentation/pix/solicitar_transferencia

## Request

ENDPOINT /baas/pix_transfer
MÉTODO POST

Request Body

```json
{
    "pix_transfer_type": "manual",
    "source_account": {
        "account_branch": "0001",
        "branch_digit": "1",
        "account_digit": "3",
        "account_number": "12345678",
        "owner_document_number": "32402502000135"
    },
    "target_account": {
        "account_branch": "0001",
        "account_digit": "3",
        "account_number": "12345678",
        "financial_institution_code": "329",
        "owner_document_number": "32402502000135",
        "owner_name": "Qi Tech",
        "account_type": "checking_account",
        "ispb": "32402502"
    },
    "transaction_amount": 500,
    "receiver_conciliation_id": "REC00000000000000000000009459463343",
    "is_chargeback": false,
    "requester_document_identification": "11111111111",
    "pix_transfer_key": "b5904f04-101e-4602-8fbc-c5dcc4c2caec",
    "chargeback_amount": 500,
    "chargeback_other_reason": "Valor excedente ao combinado"
}

```

### Body Params

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `pix_transfer_type` * | string | O Pix possui diferentes tipos de iniciação, o "manual" onde o usuário deve enviar os campos da conta de destino e conta de origem e o "key" onde o usuário deve enviar os campos da chave Pix do recebedor (conta de destino) e os dados da conta de origem. | 10 |
| `source_account` * | Object | Conta de origem. | **[Objeto source_account](#objeto-source_account)** | 
| `target_account` | Object | Conta destino - Só deve ser enviada em transações do tipo "manual". | **[Objeto target_account](#objeto-target_account)** | 10 |
| `transaction_amount` * | string | Valor da transferencia. | 10 |
| `receiver_conciliation_id` | string | Identicação de conciliação do recebedor. | 10 |
| `is_chargeback` | string | Flag de identificação de uma devolução de transação Pix (booleano True ou False). | 10 |
| `requester_document_identification` * | string | CPF do usuário quem está solicitando a transferência. | 10 |
| `pix_transfer_key` | string | Chave de idempotência de uma transação Pix - só deve ser enviado se o tipo de transferência for "key". | 10 |
| `chargeback_amount` | string | Valor da devolução - Este campo deve ser enviado apenas em caso de chargeback e exclui a obrigatoriedade do campo "transaction_amount". |  10 |
| `chargeback_other_reason` | string | Motivo de devolução ( Este campo deve ser enviado apenas em caso de chargeback). | 10 |
| `chargeback_message` | string | Campo para usuário inserir mensagem durante a devolução ( Este campo deve ser enviado apenas em caso de chargeback). | 10 |
 
### Objeto source_account

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `account_branch` * | string | Número Agência. | 0 |
| `branch_digit` |string | Dígito da Agência.| 0 |
| `account_digit` * | string | Dígito da conta.| 0 |
| `account_number` * | string | Número da conta.| 0 | 
| `owner_document_number` * | string | CPF ou CNPJ (apenas números) do titular da conta.| 0 |

### Objeto target_account

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `account_branch` * | string | Agência. | 10 |
| `account_digit` * | string | Dígito da conta | 10 |
| `account_number` * | string | Número da conta. | 10 |
| `owner_document_number` * | string | CPF ou CNPJ (apenas números) do titular da conta. | 10 |
| `owner_name` * | string | Nome do titular da conta. | 10 |
| `account_type` * |string |  CPF ou CNPJ (apenas números) do titular da conta.| 10 |
| `ispb` | string |  Código de oito dígitos que identifica os bancos no sistema de transferência de reserva do Banco Central.| 10 |

## Response

STATUS 200

Response Body: Transferência manual

```json
{
  "operation_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "status": "pending",
  "event_datetime": "2021-08-04 20:05:54",
  "pix_transaction": {
    "pix_message": "",
    "pix_transfer_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "transaction_amount": 1891268.97,
    "source_account": {
      "account_branch": "0001",
      "account_digit": "3",
      "account_number": "24339",
      "owner_document_number": "32402502000135",
      "owner_name": "Qi Tech",
      "account_type": "checking"
    },
    "target_account": {
      "target_account": "78340-6",
      "financial_institution_code": "329",
      "owner_document_number": "32402502000135",
      "owner_name": "QI Tech",
      "target_account_type": "checking_account",
      "owner_person_type": "legal",
      "trading_name": "QITech"
    },
    "fee_amount": 0
  }
}

```

STATUS 400

Response Body

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

```

---

# Webhook for expired dynamic Pix QR Code

URL: /en/documentation/pix/webhook_por_qr_code_expirado

:::danger Attention!
QI Tech webhooks should not be strictly mapped.
Additional fields may be included in the payloads of webhooks returned by our APIs.
:::

## Webhook

:::info Webhook generating event
Webhooks are sent to the holder of the Pix key linked to the Dynamic QR Code. This event occurs only once after the QR Code expiration.
:::

Resquest Body

```json
{
   "event_type":"baas.pix_qr_code.occurrence.bank_write_off",
   "origin_key":"faf1ef5b-e0a9-4430-8aa4-367b4825854c",
   "data":{
      "pix_key":"c05b7c73-fb43-45c2-871d-8c890dbe5d85",
      "qr_code_key":"458b4a77-9cb2-4232-bae5-078150c4e93d",
      "qr_code_type":"dynamic_instant",
      "qr_code_status":"bank_written_off",
      "qr_code_occurrence_key":"faf1ef5b-e0a9-4430-8aa4-367b4825854c",
      "receiver_conciliation_id":"458b4a779cb24232bae5078150c4e93d"
   }
}
```

---

# Setting Up the Webhook Receiving URL

URL: /en/documentation/primeiros_passos/configurando_webhooks

To set up the receiving URL for notifications, log in to the QI Tech platform. Click on **My Profile** located in the left sidebar menu, then go to the Integration tab. After that, enter your URL in the **Webhook Settings** section of the page and click the **SAVE** button. If it is necessary to configure headers for the notifications sent, you can use the next field as shown in the image below.

:::danger Attention!
QI Tech webhooks should not be strictly mapped. 
Additional fields may be included in the payloads of the webhooks returned by our APIs.
:::

:::info Information
The timeout for our webhook response is 10 seconds.
:::

---

# Configuring Integration IP Allowlist

URL: /en/documentation/primeiros_passos/configurar_ip_de_integracao

:::info See also
- [Setting Up the Webhook Receiving URL](/documentation/primeiros_passos/configurando_webhooks)
- [Webhook Validation](/documentation/primeiros_passos/teste_de_autenticacao/webhook_v2)
:::

QI Tech lets you restrict calls to your integration to a list of pre-authorized **public IP addresses** (or CIDR ranges). This filter is applied before signature validation: requests originating from IPs outside your active list are rejected with `403 Forbidden` (`GDF000029`).

## How to configure

Log in to the QI Tech platform, click **My Profile** in the left sidebar, and open the **Integration** tab. Scroll to the "**Whitelist de IPs da API**" section and add one IP at a time in the "**IP / CIDR**" field, clicking "**ADICIONAR IP**" for each entry.

Accepted formats:

- Public IPv4 address (e.g.: `189.10.20.30`)
- IPv4 CIDR range with prefix `/24` or larger (e.g.: `200.100.50.0/24`)
- Public IPv6 address
- IPv6 CIDR range with prefix `/48` or larger

Private/reserved ranges (`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`, `127.0.0.0/8`, `169.254.0.0/16`) are not accepted.

## Activation window (48 hours)

:::warning Attention!
For security reasons, **every IP registered through the dashboard stays in `Pending` status for 48 hours** before being activated automatically. During this period the IP is registered but **does not authorize requests** — whatever is currently in your active allowlist keeps working.

You will receive an email confirming the registration and another when the IP transitions to `Active`.
:::

After 48 hours, the IP automatically moves to `Active` and starts being authorized to call the API.

## Emergency activation

:::info Immediate release
If you need to release an IP **before the 48-hour window** (e.g.: unplanned server migration, production incident), contact our support through the official channels and request manual activation with the following information:

- The registered `IP / CIDR`
- Your integration's `client_integration_key`
- The reason for urgency

Our operations team will perform the manual promotion and the IP will take effect immediately.
:::

## Common errors

| Code | Cause | Solution |
|---|---|---|
| `403` / `GDF000029` | The request came from an IP that is not in `Active` status in your allowlist | Check on the Integration screen which IPs are active. If the IP you just registered is still `Pending`, wait for the 48 hours or request manual activation. |
| IP registration rejected | Invalid IP/CIDR, private range, or range too broad (prefix smaller than `/24` for IPv4 or `/48` for IPv6) | Use public addresses only and respect the minimum prefix sizes. |

---

# Introduction

URL: /en/documentation/primeiros_passos/inicio

We are the first financial institution to create an exclusive Bank-as-a-Service (BaaS) model in Brazil. Our goal is to help any Fintech/Credit Manager or company to have access to fast, agile and secure financial services, the way they want. Learn more at https://qitech.com.br.

This documentation aims to describe the various endpoints of our APIs.

Note: In case of doubts at any stage of the process, please contact [api@qitech.com.br](mailto:api@qitech.com.br) detailing your problem/doubt and we will assist you.

## First steps

Before starting operations by sending API requests to consume QI Tech services, it is important that an operator representing the originator company performs the following steps **in sandbox environment**.

## Access Profile Creation

1. Send an access creation request to the email api@qitech.com.br providing the following information:
   1. Company CNPJ
   2. Full name of the Master user
   3. CPF of the Master user
   4. Email of the Master user
   5. Cell phone number of the Master user
2. After access creation by the QI Tech team, the Master user will receive an email with a link to access the QI Tech platform in sandbox and a temporary password.
3. When performing the first access to the platform, the Master user must reset the access password.

## Starting the integration journey

There are several combinations of endpoints that can be used according to the partner's needs, but the first three steps are universal regardless of the services used:

Step 1: Perform Token validation through the QI Tech portal
Step 2: [Perform key exchange and generate integration credentials](/documentation/primeiros_passos/troca_de_chaves)
Step 3: [Perform authentication test](/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_v2)
Step 4: [Configure webhook receiving URL](/documentation/primeiros_passos/configurando_webhooks)

## Important information

To use our API in production it is necessary to contact [comercial@qitech.com.br](mailto:comercial@qitech.com.br) for commercial contact and integration setup.

---

# Test Endpoints

URL: /en/documentation/primeiros_passos/teste_de_autenticacao/endpoints_de_teste

:::info See also
- [Authentication test](./teste_de_autenticacao_v2)
- [Complete authentication example](./teste_de_autenticacao_completo)
- [Possible errors](./possiveis_erros)
:::

## GET Method

### Request

ENDPOINT /test/ API_KEY
METHOD GET

### Path Params

| Field | Type | Description |
|-|-|-|
| `api_key` * | string | Partner's API_KEY. |

<CodeSample endpoint="GET /test/{api_key}" samples={{
  curl: `curl -X GET \\
  'https://api-auth.sandbox.qitech.app/test/{api_key}' \\
  -H 'AUTHORIZATION: {encoded_header_token}' \\
  -H 'API-CLIENT-KEY: {api_key}'`,
  python: `import requests

url = f"{base_url}/test/{api_key}"
response = requests.get(url=url, headers=signed_header)
print(response.json())`,
  javascript: `const url = \`\${base_url}/test/\${api_key}\`;
const response = await fetch(url, {
  method: 'GET',
  headers: {
    'AUTHORIZATION': encoded_header_token,
    'API-CLIENT-KEY': api_key,
  },
});
const data = await response.json();
console.log(data);`,
  java: `OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
    .url(requestUrl + "/" + api_key)
    .headers(Headers.of(headers))
    .get()
    .build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());`,
}} />

### Response

STATUS 200

Response Body

```json
{
  "test_key": "97ad0301-869c-4481-98b6-294b139e09ae",
  "success": "Congrats!"
}
```

## POST Method

### Request

ENDPOINT test/ API_KEY
METHOD POST

<CodeSample endpoint="POST /test/{api_key}" samples={{
  curl: `curl -X POST \\
  'https://api-auth.sandbox.qitech.app/test/{api_key}' \\
  -H 'AUTHORIZATION: {encoded_header_token}' \\
  -H 'API-CLIENT-KEY: {api_key}' \\
  -H 'Content-Type: application/json' \\
  -d '{"name": "QI Tech"}'`,
  python: `import requests

url = f"{base_url}/test/{api_key}"
body = {"name": "QI Tech"}
response = requests.post(url=url, headers=signed_header, json=body)
print(response.json())`,
  javascript: `const url = \`\${base_url}/test/\${api_key}\`;
const response = await fetch(url, {
  method: 'POST',
  headers: {
    'AUTHORIZATION': encoded_header_token,
    'API-CLIENT-KEY': api_key,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ name: 'QI Tech' }),
});
const data = await response.json();
console.log(data);`,
  java: `OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(
    mediaType, "{\\"name\\": \\"QI Tech\\"}");
Request request = new Request.Builder()
    .url(requestUrl + "/" + api_key)
    .headers(Headers.of(headers))
    .post(body)
    .build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());`,
}} />

Request Body

```json
{
  "name": "QI Tech"
}
```

### Path Params

| Field | Type | Description |
|-|-|-|
| `api_key` * | string | Partner's API_KEY. |

### Response

STATUS 201

Response Body

```json
{
  "name": "QI Tech",
  "success": "Congrats!"
}
```

---

# Possible errors:

URL: /en/documentation/primeiros_passos/teste_de_autenticacao/possiveis_erros

# Possible errors:

## Error in token

If the signature of the string_to_sign is incorrect, an error will be shown related to the encoded_header_token :

STATUS 401

Response Body

```json
{
	"title": "QI Unauthenticated",
	"description": "Please provide valid credentials as part of the request. (Documentation: https://qitech.com.br/documentation) Details: Failed while decoding the authentication token",
	"translation": "Por favor forneça credenciais válidas como parte da request. (Documentação: https://qitech.com.br/documentation) Detalhes: Falha ao decodificar o token de autenticação",
	"code": "GDF000014"
}
```

## Error in <strong>API_KEY</strong>

If the API_KEY is not sent in the header, the following error will be shown:

STATUS 400

Response Body

```json
{
	"title": "Bad Request",
	"description": "No API Client Key received",
	"translation": "Nenhuma chave de API do cliente recebida",
	"code": "GDF000003"
}
```
 
## Incorrect <strong>API_KEY</strong> 

If the API_KEY sent does not match the API_KEY displayed in the QI Tech front end after key registration, the following response will be returned:

STATUS 404

Response Body

```json
  {
  	"code": "GDF000018",
  	"title": "Not Found",
  	"description": "No ClientIntegration found for api_client_key: {api_client_key}.",
  	"translation": "Nenhuma ClientIntegration encontrada para api_client_key: {api_client_key}."
  }
```

## Unauthorized endpoint

If the accessed endpoint or method is unauthorized, the following error will be returned:

STATUS 401

Response Body

```json
{
	"title": "QI Unauthenticated",
	"description": "Please provide valid credentials as part of the request. (Documentation: https://qitech.com.br/documentation) Details: Endpoint or HTTP method not allowed for the given ClientIntegration (Action: POST /debt)",
	"translation": "Por favor forneça credenciais válidas como parte da request. (Documentação: https://qitech.com.br/documentation) Detalhes: Endpoint ou método HTTP não permitido para a ClientIntegration fornecida (Action: POST /debt)",
	"code": "GDF000014"
}
```

:::caution Attention!

To request access to the endpoint that returned the mentioned error, it is necessary to ask for authorization from the QI Tech support team.:::

---

# Authentication test

URL: /en/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_completo

### Overview
This documentation details the process of signing and encrypting headers for secure authentication in requests to our API. The process ensures that requests are reliable and secure, preventing unauthorized access and ensuring data integrity.

:::caution Atenção!

The GET and DELETE methods hash md5 must be generated with an empty payload
:::

**Python**

```python
#Here, we import the necessary libraries throughout the authentication process.
from jose import jwt
import json
from datetime import datetime
from hashlib import md5
import requests

def get_auth_header(endpoint, method, CLIENT_PRIVATE_KEY, API_KEY, request_body=None):

    if request_body is None:
        request_body = {}

    #The date and time object provided must be in UTC and must follow the ISO 8601 international standard ("2023-06-26T19:48:32.759844Z").
    timestamp = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S.%fZ")

    #We define the JWT encoding algorithm
    jwt_header = {
        "typ": "JWT",
        "alg": "ES512"
    }

    #Build MD5 hash for header signature using the payload
    json_body = json.dumps(request_body)
    md5_hash = md5(json_body.encode()).hexdigest()

    #Define the JWT body
    jwt_body = {
        "payload_md5": md5_hash,
        "timestamp": timestamp,
        "method": method,
        "uri": endpoint
    }

    #Build signed header
    encoded_header_token = jwt.encode(
        claims=jwt_body,
        key=CLIENT_PRIVATE_KEY,
        algorithm="ES512",
        headers=jwt_header
    )

    #Build signed header
    signed_header = {
        "AUTHORIZATION": encoded_header_token,
        "API-CLIENT-KEY": API_KEY
    }

    return signed_header

if __name__ == "__main__":

    #we will use the following variables base_url, endpoint, method and request_body. In this example, we will be conducting a POST in /test.
    #The following keys in this example are fake. Please use your own keys.
    CLIENT_PRIVATE_KEY = "Your Private Key Here"
    API_KEY = "Your API Key Here"

    BASE_URL = "https://api-auth.sandbox.qitech.app"
    METHOD = "POST" #GET ou POST
    REQUEST_BODY = {
        "name": "QI Tech"
    }

    #In order to conduct a GET requisition in /test, it is necessary to insert the API Key into the endpoint, while for a post requisition, it is not.
    if METHOD == 'GET':
        ENDPOINT = f"/test/{API_KEY}"
        signed_header = get_auth_header(ENDPOINT, METHOD, CLIENT_PRIVATE_KEY, API_KEY)
        response = requests.get(f"{BASE_URL}{ENDPOINT}", headers=signed_header)
    else:
        ENDPOINT = f"/test/"
        signed_header = get_auth_header(ENDPOINT, METHOD, CLIENT_PRIVATE_KEY, API_KEY, REQUEST_BODY)
        response = requests.post(f"{BASE_URL}{ENDPOINT}", json=REQUEST_BODY, headers=signed_header)

    print(response.status_code)
    print(response.json())
```

**PHP**

```php
<?php
require __DIR__ . '/vendor/autoload.php';

//Here, we import the necessary libraries throughout the authentication process
use Jose\Component\Core\AlgorithmManager;
use Jose\Component\Signature\JWSTokenSupport;
use Jose\Component\Signature\Algorithm\ES512;
use Jose\Component\Signature\Serializer\CompactSerializer;
use Jose\Component\KeyManagement\JWKFactory;
use Jose\Component\Signature\JWSBuilder;

function get_auth_header($endpoint, $method, $privateKeyString, $api_key, $request_body = null) {

    if ($request_body === null) {
        $request_body = (object)[];
    }

    //The date and time object provided must be in UTC and must follow the ISO 8601 international standard ("2023-06-26T19:48:32.759844Z").
    $microtime_float = microtime(true);
    $datetime = new DateTimeImmutable('@' . floor($microtime_float), new DateTimeZone('UTC'));
    $timestamp = $datetime->format('Y-m-d\TH:i:s.') . sprintf('%06d', ($microtime_float - floor($microtime_float)) * 1000000) . 'Z';

    //We define the JWT encoding algorithm
    $header = [
        "typ" => "JWT",
        "alg" => "ES512"
    ];

    //Build MD5 hash for header signature using the payload
    $request_body_json = json_encode($request_body);
    $md5_hash = md5($request_body_json);

    //These are the necessary pieces of information to sign the header
    $payload = [
        "payload_md5" => $md5_hash,
        "timestamp" => $timestamp,
        "method" => $method,
        "uri" => $endpoint
    ];

    // Initialize Algorithm Manager with ES512
    $algorithmManager = new AlgorithmManager([
        new ES512(),
    ]);

    // Inicializar JWS Builder
    $jwsBuilder = new JWSBuilder(
        $algorithmManager,
        new JWSTokenSupport()
    );

    $privateKey = JWKFactory::createFromKey($privateKeyString);

    //Encrypt the header
    $jws = $jwsBuilder
        ->create()
        ->withPayload(json_encode($payload))
        ->addSignature($privateKey, $header)
        ->build();

    $serializer = new CompactSerializer();
    $jwt = $serializer->serialize($jws, 0);

    //Build signed header
    $headers = [
        'Authorization' => $jwt,
        'API-CLIENT-KEY' => $api_key,
    ];

    return $headers;
}

if (php_sapi_name() == 'cli' || (isset($_SERVER['REQUEST_METHOD']) && realpath($_SERVER['SCRIPT_FILENAME']) === __FILE__)) {
    
    //we will use the following variables base_url, endpoint, method and request_body. In this example, we will be conducting a POST in /test.
    //The following keys in this example are fake. Please use your own keys.
    $base_url = "https://api-auth.sandbox.qitech.app";
    $method = "POST"; // HTTP method: "GET" or "POST"

    $request_body = ["name" => "QI Tech"];

    $api_key = "Your API Key Here";
    $privateKeyString = "Your Private Key Here";

    $response = null;

    //In order to conduct a GET requisition in /test, it is necessary to insert the API Key into the endpoint, while for a post requisition, it is not.
    if ($method == 'GET') {
        $endpoint = "/test/" . $api_key;
        $headers = get_auth_header($endpoint, $method, $privateKeyString, $api_key);
        $url = $base_url . $endpoint;
        $response = \WpOrg\Requests\Requests::get($url, $headers);
    } else {
        $endpoint = "/test";
        $headers = get_auth_header($endpoint, $method, $privateKeyString, $api_key, $request_body);
        $url = $base_url . $endpoint;
        $response = \WpOrg\Requests\Requests::post($url, $headers, json_encode($request_body));
    }

    if ($response) {
        echo "HTTP Status Code: " . $response->status_code . "\n";

        $json_response = json_decode($response->body, true);
        if (json_last_error() === JSON_ERROR_NONE) {
            echo "Response JSON:\n";
            print_r($json_response);
        } else {
            echo "Error decoding JSON. Raw Response Text:\n";
            echo $response->body . "\n";

    }
}
?>
```

**Node.js**

```js
//Here, we import the necessary libraries throughout the authentication process
const jwt = require('jsonwebtoken');
const crypto = require('crypto');
const axios = require('axios');

function getAuthHeader(endpoint, method, client_private_key, api_key, request_body = null) {
    if (request_body === null) {
        request_body = {};
    }

    //The date and time object provided must be in UTC and must follow the ISO 8601 international standard ("2023-06-26T19:48:32.759844Z").
    const now = new Date();
    const isoString = now.toISOString();
    const timestamp = isoString.slice(0, -1) + (now.getMilliseconds() * 1000).toString().padStart(6, '0').slice(0, 3) + 'Z';

    //We define the JWT encoding algorithm
    const jwt_header = {
        typ: 'JWT',
        alg: 'ES512'
    };

    //Build MD5 hash for header signature using the payload
    const str_body = JSON.stringify(request_body);
    const md5_hash = crypto.createHash('md5').update(str_body).digest('hex');

    //These are the necessary pieces of information to sign the header
    const jwt_body = {
        payload_md5: md5_hash,
        timestamp: timestamp,
        method: method,
        uri: endpoint
    };

    //Encrypt the header
    const encoded_header_token = jwt.sign(
        jwt_body,
        client_private_key,
        {
            algorithm: 'ES512',
            header: jwt_header
        }
    );

    //Build signed header
    const signed_header = {
        'AUTHORIZATION': encoded_header_token,
        'API-CLIENT-KEY': api_key
    };

    return signed_header;
}

    //we will use the following variables base_url, endpoint, method and request_body. In this example, we will be conducting a POST in /test.
    //The following keys in this example are fake. Please use your own keys.
async function main() {
    const BASE_URL = "https://api-auth.sandbox.qitech.app";
    const METHOD = "POST"; //"POST" ou "GET"

    const REQUEST_BODY = {
        name: "QI Tech"
    };

    const API_KEY = "Your API Key Here";
    const CLIENT_PRIVATE_KEY = "Your Private Key Here";

    let ENDPOINT;
    let url;
    let signed_header;

    try {
    //In order to conduct a GET requisition in /test, it is necessary to insert the API Key into the endpoint, while for a post requisition, it is not.
        if (METHOD === 'GET') {
            ENDPOINT = `/test/${API_KEY}`;
            url = `${BASE_URL}${ENDPOINT}`;
            signed_header = getAuthHeader(ENDPOINT, METHOD, CLIENT_PRIVATE_KEY, API_KEY);

            const response = await axios.get(url, { headers: signed_header });
            console.log("Status Code:", response.status);
            console.log("Response Body:", response.data);

        } else {
            ENDPOINT = "/test";
            url = `${BASE_URL}${ENDPOINT}`; // Corrected string interpolation
            signed_header = getAuthHeader(ENDPOINT, METHOD, CLIENT_PRIVATE_KEY, API_KEY, REQUEST_BODY);

            const response = await axios.post(url, REQUEST_BODY, { headers: signed_header });
            console.log("Status Code:", response.status);
            console.log("Response Body:", response.data);
        }
    } catch (error) {
        if (error.response) {
            console.error("API Error - Status Code:", error.response.status);
            console.error("API Error - Response Data:", error.response.data);
            console.error("API Error - Headers:", error.response.headers);
        } else if (error.request) {
            console.error("Network Error: No response received from server.");
            console.error("Request:", error.request);
        } else {
            console.error("Error setting up request:", error.message);
        }
        console.error("Full Error Object:", error);
    }
}

main();
```

**Java**

```java
// To utilize Java we must create a file called qitech-java-client
// Create a file called pom.xml and paste the end of the code inside
// It will be necessary to create a few folders - create the following path; src > main > java > com > qitech > api e insira seu arquivo java dentro com o nome de QItechApiClient.java
// Add your private key inside the root directory in the same project at your poms level
// To run the code, open your terminal or command prompt, search through your projects root and execute the following comand 
// mvn clean install exec:java

//Here, we import the necessary libraries throughout the authentication process
package com.qitech.api;

import com.google.gson.Gson;
import io.jsonwebtoken.JwtBuilder;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import org.bouncycastle.jce.provider.BouncyCastleProvider;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.KeyFactory;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.Security;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
import java.text.SimpleDateFormat;
import java.util.Base64;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.TimeZone;
import java.util.concurrent.TimeUnit;
import org.bouncycastle.jce.ECNamedCurveTable;
import org.bouncycastle.jce.spec.ECParameterSpec;
import org.bouncycastle.jce.spec.ECPrivateKeySpec;

public class QItechApiClient {

    public static Map<String, String> getAuthHeader(String endpoint, String method, PrivateKey privateKey, String apiKey, Map<String, Object> requestBody) throws NoSuchAlgorithmException {        
        //O objeto de data e hora informado deve estar em UTC e deve seguir o padrão da norma internacional ISO 8601 ("2023-06-26T19:48:32.759844Z")
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'");
        sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
        String timestamp = sdf.format(new Date());

        //Build MD5 hash for header signature using the payload
        String jsonBody = jsonToString(requestBody);
        String md5Hash = md5Hash(jsonBody);

        //These are the necessary pieces of information to sign the header
        Map<String, Object> jwtBody = new HashMap<>();
        jwtBody.put("payload_md5", md5Hash);
        jwtBody.put("timestamp", timestamp);
        jwtBody.put("method", method);
        jwtBody.put("uri", endpoint);

        //Encrypt the header
        JwtBuilder jwtBuilder = Jwts.builder()
                .setClaims(jwtBody)
                .signWith(privateKey, SignatureAlgorithm.ES512);
        String encodedHeaderToken = jwtBuilder.compact();

        //Build signed header
        Map<String, String> signedHeader = new HashMap<>();
        signedHeader.put("AUTHORIZATION", encodedHeaderToken);
        signedHeader.put("API-CLIENT-KEY", apiKey);

        return signedHeader;
    }

    public static void main(String[] args) {
        Security.addProvider(new BouncyCastleProvider());
        OkHttpClient client = null;

        try {

            //we will use the following variables base_url, endpoint, method and request_body. In this example, we will be conducting a POST in /test.
            //The following keys in this example are fake. Please use your own keys.
            final String BASE_URL = "https://api-auth.sandbox.qitech.app";
            final String PRIVATE_KEY_FILENAME = "private.key";

            final String API_CLIENT_KEY = "Your API Key Here";
            
            final String METHOD = "GET";  //GET ou POST
            final Map<String, Object> REQUEST_BODY = new HashMap<>();
            REQUEST_BODY.put("name", "QI Tech");

            
            String keyFromFile = readKeyFromFile(PRIVATE_KEY_FILENAME);
            PrivateKey privateKey = getPrivateKey(keyFromFile);

            String endpoint;
            Request request;

            //In order to conduct a GET requisition in /test, it is necessary to insert the API Key into the endpoint, while for a post requisition, it is not.

            if ("GET".equalsIgnoreCase(METHOD)) {
                endpoint = "/test/" + API_CLIENT_KEY;

                Map<String, String> headers = getAuthHeader(endpoint, "GET", privateKey, API_CLIENT_KEY, Collections.emptyMap());

                request = new Request.Builder()
                        .url(BASE_URL + endpoint)
                        .headers(okhttp3.Headers.of(headers))
                        .get()
                        .build();

            } else {
                endpoint = "/test";

                Map<String, String> headers = getAuthHeader(endpoint, "POST", privateKey, API_CLIENT_KEY, REQUEST_BODY);

                RequestBody body = RequestBody.create(
                    jsonToString(REQUEST_BODY),
                    MediaType.parse("application/json; charset=utf-8")
                );

                request = new Request.Builder()
                        .url(BASE_URL + endpoint)
                        .headers(okhttp3.Headers.of(headers))
                        .post(body)
                        .build();
            }

            client = new OkHttpClient.Builder()
                    .connectTimeout(30, TimeUnit.SECONDS)
                    .readTimeout(30, TimeUnit.SECONDS)
                    .build();

            System.out.println("--- Sending " + METHOD + " Request ---");
            System.out.println("URL: " + BASE_URL + endpoint);

            try (Response response = client.newCall(request).execute()) {
                System.out.println("\n--- Received Response ---");
                System.out.println("Status Code: " + response.code());
                if (response.body() != null) {
                    System.out.println("Response Body: " + response.body().string());
                }
            }

        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (client != null) {
                client.dispatcher().executorService().shutdown();
                client.connectionPool().evictAll();
            }
        }
    }

    // --- Helper Methods ---
    
    private static String readKeyFromFile(String filename) throws IOException {
        String key = new String(Files.readAllBytes(Paths.get(filename)));
        return key.replace("-----BEGIN EC PRIVATE KEY-----", "")
                  .replace("-----END EC PRIVATE KEY-----", "")
                  .replace("-----BEGIN PRIVATE KEY-----", "")
                  .replace("-----END PRIVATE KEY-----", "")
                  .replaceAll("\\s", "");
    }

    private static String jsonToString(Map<String, Object> jsonMap) { return new Gson().toJson(jsonMap); }

    private static String md5Hash(String text) throws NoSuchAlgorithmException {
        MessageDigest md = MessageDigest.getInstance("MD5");
        byte[] array = md.digest(text.getBytes());
        StringBuilder sb = new StringBuilder();
        for (byte b : array) { sb.append(String.format("%02x", b)); }
        return sb.toString();
    }

    private static PrivateKey getPrivateKey(final String encodedPvKey) throws IOException {
        try {
            byte[] derBytes = Base64.getDecoder().decode(encodedPvKey);
            KeyFactory keyFactory = KeyFactory.getInstance("EC", BouncyCastleProvider.PROVIDER_NAME);
            try {
                return keyFactory.generatePrivate(new PKCS8EncodedKeySpec(derBytes));
            } catch (InvalidKeySpecException e) {
                org.bouncycastle.asn1.sec.ECPrivateKey sec1Key = org.bouncycastle.asn1.sec.ECPrivateKey.getInstance(derBytes);
                ECParameterSpec ecParameterSpec = ECNamedCurveTable.getParameterSpec("secp521r1");
                ECPrivateKeySpec privateKeySpec = new ECPrivateKeySpec(sec1Key.getKey(), ecParameterSpec);
                return keyFactory.generatePrivate(privateKeySpec);
            }
        } catch (Exception e) {
            throw new IOException("Failed to parse private key. Key is corrupted or not a valid EC key.", e);
        }
    }
}

////POM File

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.qitech.api</groupId>
    <artifactId>qitech-api-client</artifactId>
    <version>1.0.0</version>

    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <!-- HTTP Client -->
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>okhttp</artifactId>
            <version>4.12.0</version>
        </dependency>

        <!-- JSON Web Token (JWT) Handling -->
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-api</artifactId>
            <version>0.12.5</version>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-impl</artifactId>
            <version>0.12.5</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-jackson</artifactId>
            <version>0.12.5</version>
            <scope>runtime</scope>
        </dependency>

        <!-- Cryptography Provider for ES512 -->
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk18on</artifactId>
            <version>1.78</version>
        </dependency>

        <!-- JSON Serialization -->
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.10.1</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.13.0</version>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <mainClass>com.qitech.api.QItechApiClient</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

```

**C#**

```c#
//Here, we import the necessary libraries throughout the authentication process.
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using Jose;
using Newtonsoft.Json;

public static class QiTechAuthGenerator {
    public static string GetAuthorizationHeader(
        string endpoint,
        string method,
        string clientPrivateKey,
        object requestBody)
    {
        string privateKeyBase64 = clientPrivateKey 
            .Replace("-----BEGIN EC PRIVATE KEY-----", "")
            .Replace("-----END EC PRIVATE KEY-----", "")
            .Replace("\n", "")
            .Replace("\r", "");

        using var privateKey = ECDsa.Create();
        privateKey.ImportECPrivateKey(Convert.FromBase64String(privateKeyBase64), out _);

        string payloadToHash;

        if (method.ToUpper() == "GET") {
            payloadToHash = "{}";
        }
        else {
            payloadToHash = JsonConvert.SerializeObject(requestBody);
        }
        
        //Calculate to md5hash
        var payloadMd5Hash = CalculateMd5Hash(payloadToHash);

        //These are the necessary pieces of information to sign the header
        var jwtBody = new Dictionary<string, object> {
            { "payload_md5", payloadMd5Hash },
            { "timestamp", timestamp },
            { "method", method },
            { "uri", endpoint }
        };

        //We define the JWT encoding algorithm
        var jwtHeader = new Dictionary<string, object> {
            { "typ", "JWT" },
            { "alg", "ES512" }
        };

        return JWT.Encode(jwtBody, privateKey, JwsAlgorithm.ES512, jwtHeader);
    }

    //Build MD5 hash for header signature using the payload
    private static string CalculateMd5Hash(string input) {
        using (var md5 = MD5.Create()) {
            byte[] inputBytes = Encoding.UTF8.GetBytes(input);
            byte[] hashBytes = md5.ComputeHash(inputBytes);

            var builder = new StringBuilder();
            foreach (var b in hashBytes) {
                builder.Append(b.ToString("x2"));
            }
            return builder.ToString();
        }
    }
}

public class QiTechApiClient {
    private readonly string _baseUrl;
    private readonly string _apiKey;
    private readonly string _clientPrivateKey;

    public QiTechApiClient(string baseUrl, string apiKey, string clientPrivateKey) {
        _baseUrl = baseUrl;
        _apiKey = apiKey;
        _clientPrivateKey = clientPrivateKey;
    }

    //Encrypt the header
    public async Task<string> CallEndpointAsync(string endpoint, string method, object requestBody) {
        var signedHeader = QiTechAuthGenerator.GetAuthorizationHeader(
            endpoint,
            method,
            _clientPrivateKey,
            requestBody
        );

        var url = $"{_baseUrl}{endpoint}";

        //Build signed header
        using (var client = new HttpClient()) {
            client.DefaultRequestHeaders.Add("AUTHORIZATION", signedHeader);
            client.DefaultRequestHeaders.Add("API-CLIENT-KEY", _apiKey);

            HttpResponseMessage httpResponse;

            if (method.ToUpper() == "GET") {
                httpResponse = await client.GetAsync(url);
            }
            else {
                var jsonBody = JsonConvert.SerializeObject(requestBody);
                var content = new StringContent(jsonBody, Encoding.UTF8, "application/json");
                httpResponse = await client.PostAsync(url, content);
            }

            httpResponse.EnsureSuccessStatusCode();

            var responseContent = await httpResponse.Content.ReadAsStringAsync();

            return responseContent;
        }
    }
}

public class Program {
    public static async Task Main() {
        string response = "";
        
        //we will use the following variables base_url, endpoint, method and request_body. In this example, we will be conducting a POST in /test.
        //The following keys in this example are fake. Please use your own keys.
        var baseUrl = "https://api-auth.sandbox.qitech.app";
        var method = "POST";
        var requestBody = new { name = "QI Tech" };
        
        var apiKey = "Your API Key Here";
        var clientPrivateKey = @"Your Private Key Here";

        try {
            var apiClient = new QiTechApiClient(baseUrl, apiKey, clientPrivateKey);

            //In order to conduct a GET requisition in /tst, it is necessary to insert the API Key into the endpoint, while for a post requisition, it is not.
            if (method.ToUpper() == "GET") {
                var endpoint = "/test/" + apiKey;
                response = await apiClient.CallEndpointAsync(endpoint, method, null);
            }
            else {
                var endpoint = "/test";
                response = await apiClient.CallEndpointAsync(endpoint, method, requestBody);
            }

            Console.WriteLine("\nAPI Response:");
            Console.WriteLine(response);
        }
        catch (HttpRequestException ex) {
            Console.WriteLine($"\nHTTP Error: {ex.Message}");
        }
        catch (Exception ex) {
            Console.WriteLine($"\nAn unexpected error occurred: {ex.Message}");
        }
    }
}
```

---

# Authentication test

URL: /en/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_v2

# Authentication test

## 1. Introduction and Initial Configuration

### Overview
This documentation details the process of signing and encrypting headers for secure authentication in requests to our API. The process ensures that requests are reliable and secure, preventing unauthorized access and ensuring data integrity.

### Import libraries
Here, we import the necessary libraries throughout the authentication process.


**Python**

```python
import json
import requests
from datetime import datetime, timezone
from hashlib import md5
from jose import jwt
```


**PHP**

```php
use Jose\Component\Core\AlgorithmManager;
use Jose\Component\Signature\JWSTokenSupport;
use Jose\Component\Signature\Algorithm\ES512;
use Jose\Component\Signature\Serializer\CompactSerializer;
use Jose\Component\Signature\JWSBuilder;
use Jose\Component\KeyManagement\JWKFactory;
```


**Node.js**

```js
const jose = require('jose');
const jwt = require('jsonwebtoken');
const crypto = require('crypto');
const axios = require('axios');
```


**Java**

```java
import io.jsonwebtoken.JwtBuilder;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;

import java.io.IOException;
import java.io.StringReader;
import java.security.KeyPair;
import java.security.PrivateKey;
import java.util.Base64;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import org.bouncycastle.openssl.PEMKeyPair;
import org.bouncycastle.openssl.PEMParser;
import org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter;
```


**C#**

```c#
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Security.Cryptography;
using System.Text;
using Jose;
using Newtonsoft.Json;
```




### Define variables

We will use the variables base_url, endpoint, method, and request_body. In this example, we will make a POST request to the "/test" endpoint.


**Python**

```python
base_url = "https://api-auth.sandbox.qitech.app"
endpoint = "/test"
method = "POST"
request_body = {"name": "QI Tech"}
```
  

**PHP**

```php
$base_url = "https://api-auth.sandbox.qitech.app";
$endpoint = "/test";
$method = "POST";
$request_body = ["name" => "QI Tech"];
```
  

**Node.js**

```js
const base_url = 'https://api-auth.sandbox.qitech.app';
const endpoint = '/test';
const method = 'POST';
const request_body = { name: 'QI Tech' };
```
  

**Java**

```java
private static final String base_url = "https://api-auth.sandbox.qitech.app";
private static final String endpoint = "/test";
private static final String method = "POST";
private static final Map<String, Object> request_body = new HashMap<>();
static {
    request_body.put("name", "QI Tech");
}
```
  

**C#**

```c#
var base_url = "https://api-auth.sandbox.qitech.app";
var endpoint = "/test";
var method = "POST";
var request_body = new { name = "QI Tech" };

```
  


## 2. Data Preparation for Signature

### Insert encryption data

The keys in this example are for demonstration purposes only. Please use your own keys.


**Python**

```python
api_key = "f19c6e62-bd82-4334-9839-020810550c44" 

client_private_key = '''-----BEGIN EC PRIVATE KEY-----
MIHbAgEBBEHh1hIeOPE5XNNhn6bxRAmVswsPZ0wZCmzVvP8Tl/LZK9ofVmRVGzll
srU1uezJEyHKYdOHrE2p52xUj+pHzjJvb6AHBgUrgQQAI6GBiQOBhgAEAAofUz1J
hBSOyGHLsnV9Sz0DSWmhl7U+ljqbfa8PKVFWSV3w16I1v2zME5/UzUhHn1gWsjnv
7/ekcLLAQbvqMPNXAfjIhFXLAPzqbB9iCuVua1v0Vgy52rBemOWrJka/Ws2bnKR8
h1N1OxOYeYr6C2jqMygBLktKMAs+282CEiEb4bIv
-----END EC PRIVATE KEY-----'''  
```
  

**PHP**

```php
$api_key = "f19c6e62-bd82-4334-9839-020810550c44"; 

$privateKeyString = "-----BEGIN EC PRIVATE KEY-----
MIHbAgEBBEHh1hIeOPE5XNNhn6bxRAmVswsPZ0wZCmzVvP8Tl/LZK9ofVmRVGzll
srU1uezJEyHKYdOHrE2p52xUj+pHzjJvb6AHBgUrgQQAI6GBiQOBhgAEAAofUz1J
hBSOyGHLsnV9Sz0DSWmhl7U+ljqbfa8PKVFWSV3w16I1v2zME5/UzUhHn1gWsjnv
7/ekcLLAQbvqMPNXAfjIhFXLAPzqbB9iCuVua1v0Vgy52rBemOWrJka/Ws2bnKR8
h1N1OxOYeYr6C2jqMygBLktKMAs+282CEiEb4bIv
-----END EC PRIVATE KEY-----"; 
```
  

**Node.js**

```js
const api_key = 'f19c6e62-bd82-4334-9839-020810550c44'; 

const client_private_key = `-----BEGIN EC PRIVATE KEY-----
MIHbAgEBBEHh1hIeOPE5XNNhn6bxRAmVswsPZ0wZCmzVvP8Tl/LZK9ofVmRVGzll
srU1uezJEyHKYdOHrE2p52xUj+pHzjJvb6AHBgUrgQQAI6GBiQOBhgAEAAofUz1J
hBSOyGHLsnV9Sz0DSWmhl7U+ljqbfa8PKVFWSV3w16I1v2zME5/UzUhHn1gWsjnv
7/ekcLLAQbvqMPNXAfjIhFXLAPzqbB9iCuVua1v0Vgy52rBemOWrJka/Ws2bnKR8
h1N1OxOYeYr6C2jqMygBLktKMAs+282CEiEb4bIv
-----END EC PRIVATE KEY-----`; 
```
  

**Java**

```java
private static final String clientPrivateKey = "MIHbAgEBBEHh1hIeOPE5XNNhn6bxRAmVswsPZ0wZCmzVvP8Tl/LZK9ofVmRVGzll
srU1uezJEyHKYdOHrE2p52xUj+pHzjJvb6AHBgUrgQQAI6GBiQOBhgAEAAofUz1J
hBSOyGHLsnV9Sz0DSWmhl7U+ljqbfa8PKVFWSV3w16I1v2zME5/UzUhHn1gWsjnv
7/ekcLLAQbvqMPNXAfjIhFXLAPzqbB9iCuVua1v0Vgy52rBemOWrJka/Ws2bnKR8
h1N1OxOYeYr6C2jqMygBLktKMAs+282CEiEb4bIv"; 
```
  

**C#**

```c#
var api_key = "f19c6e62-bd82-4334-9839-020810550c44"; 
var client_private_key = @"-----BEGIN EC PRIVATE KEY-----
MIHbAgEBBEHh1hIeOPE5XNNhn6bxRAmVswsPZ0wZCmzVvP8Tl/LZK9ofVmRVGzll
srU1uezJEyHKYdOHrE2p52xUj+pHzjJvb6AHBgUrgQQAI6GBiQOBhgAEAAofUz1J
hBSOyGHLsnV9Sz0DSWmhl7U+ljqbfa8PKVFWSV3w16I1v2zME5/UzUhHn1gWsjnv
7/ekcLLAQbvqMPNXAfjIhFXLAPzqbB9iCuVua1v0Vgy52rBemOWrJka/Ws2bnKR8
h1N1OxOYeYr6C2jqMygBLktKMAs+282CEiEb4bIv
-----END EC PRIVATE KEY-----"; 
```
  


### Format date
The date and time object provided must be in UTC and must follow the ISO 8601 international standard ("2023-06-26T19:48:32.759844Z").



**Python**

```python
timestamp = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S.%fZ")
```
  

**PHP**

```php
$timestamp = gmdate('Y-m-d\TH:i:s.u\Z');
```
  

**Node.js**

```js
const timestamp = new Date().toISOString();
```
  

**Java**

```java
Date now = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'");
String formattedDate = sdf.format(now);
```
  

**C#**

```c#
var timestamp = datetime.now.ToString("yyyy-MM-ddTHH:mm:ss.fffZ");
```
  


### Define JWT header
We define the JWT encoding algorithm


**Python**

```python
jwt_header = {
    "typ": "JWT",
    "alg": "ES512"
}
```
  

**PHP**

```php
$header = [
    "typ" => "JWT",
    "alg" => "ES512"
];
```
  

**Node.js**

```js
const jwt_header = {
  typ: 'JWT',
  alg: 'ES512'
};
```
  

**Java**

```java
// Não é necessário
```
  

**C#**

```c#
var jwt_header = new Dictionary<string, object>
{ 
  { "typ", "JWT" },
  { "alg", "ES512" }
};
```
  


### Build MD5 hash for JSON header signature

Build MD5 hash for header signature using the payload


**Python**

```python
json_body = json.dumps(request_body)
md5_hash = md5(json_body.encode()).hexdigest()
```
  

**PHP**

```php
$request_body_json = json_encode($request_body);
$md5_hash = md5($request_body_json);
```
  

**Node.js**

```js
const str_body = JSON.stringify(request_body);
const md5_hash = crypto.createHash('md5').update(str_body).digest('hex');
```
  

**Java**

```java
String payloadMd5 = md5Hash(jsonToString(request_body));

...

private static String jsonToString(Map<String, Object> jsonMap) {
    return new com.google.gson.Gson().toJson(jsonMap);
}

...

private static String md5Hash(String text) {
    try {
        java.security.MessageDigest md = java.security.MessageDigest.getInstance("MD5");
        byte[] array = md.digest(text.getBytes());
        StringBuilder sb = new StringBuilder();
        for (byte b : array) {
            sb.append(String.format("%02x", b));
        }
        return sb.toString();
    } catch (java.security.NoSuchAlgorithmException e) {
        return null;
    }
}
```
  

**C#**

```c#
var json_body = JsonConvert.SerializeObject(request_body);
var md5_hash = CalculateMD5Hash(json_body);


.

static string CalculateMD5Hash(string input)
{
    using (MD5 md5 = MD5.Create())
    {
        byte[] inputBytes = Encoding.UTF8.GetBytes(input);
        byte[] hashBytes = md5.ComputeHash(inputBytes);

        StringBuilder builder = new StringBuilder();

        for (int i = 0; i < hashBytes.Length; i++)
        {
            builder.Append(hashBytes[i].ToString("x2"));
        }

        return builder.ToString();
    }
}
```
  


:::caution Attention!

The MD5 hash for GET and DELETE requests must be generated with an empty payload
:::


### Build an MD5 hash for the header signature File

Build an MD5 hash for the header signature using a file


**Python**

```python
md5_instance = md5()
for chunk in iter(lambda: file.read(4096), b""):
    md5_instance.update(chunk)

file.seek(0)
md5_hash = md5_instance.hexdigest()
```


**PHP**

```php
$md5_instance = md5_file($file);
$md5_hash = hash_file('md5', $file);
```


**Node.js**

```js
const md5_instance = crypto.createHash('md5');
const readStream = fs.createReadStream(file);

readStream.on('data', (chunk) => {
  md5_instance.update(chunk);
});

readStream.on('end', () => {
  const md5_hash = md5_instance.digest('hex');
  file.seek(0);
```


**Java**

```java
MessageDigest md5_instance = MessageDigest.getInstance("MD5");
byte[] buffer = new byte[4096];
int bytesRead;

try (InputStream inputStream = new FileInputStream(file)) {
    while ((bytesRead = inputStream.read(buffer)) != -1) {
        md5_instance.update(buffer, 0, bytesRead);
    }
}

byte[] md5_hashBytes = md5_instance.digest();
StringBuilder md5_hashBuilder = new StringBuilder();

for (byte b : md5_hashBytes) {
    md5_hashBuilder.append(String.format("%02x", b));
}

String md5_hash = md5_hashBuilder.toString();
```


**C#**

```c#
using (var md5_instance = MD5.Create())
{
    using (var stream = File.OpenRead(file))
    {
        byte[] hash = md5_instance.ComputeHash(stream);
        string md5_hash = BitConverter.ToString(hash).Replace("-", "").ToLower();
        stream.Seek(0, SeekOrigin.Begin);
    }
}
```



### Define the JWT body

These are the necessary pieces of information to sign the header


**Python**

```python
jwt_body = {
    "payload_md5": md5_hash,
    "timestamp": timestamp,
    "method": method,
    "uri": endpoint
}
```
  

**PHP**

```php
$payload = [
    "payload_md5" => $md5_hash,
    "timestamp" => $timestamp,
    "method" => $method,
    "uri" => $endpoint
];
```
  

**Node.js**

```js
const jwt_body = {
  payload_md5: md5_hash,
  timestamp: timestamp,
  method: method,
  uri: endpoint
};
```
  

**Java**

```java
Map<String, Object> jwt_body = new HashMap<>();
jwt_body.put("payload_md5", payloadMd5);
jwt_body.put("timestamp", formattedDate);
jwt_body.put("method", method);
jwt_body.put("uri", endpoint);
```
  

**C#**

```c#
// Ajuste: Remover espaços e quebras de linha no meio da chave privada
client_private_key = client_private_key.Replace("-----BEGIN EC PRIVATE KEY-----", "")
                                       .Replace("-----END EC PRIVATE KEY-----", "")
                                       .Replace("\n", "")
                                       .Replace("\r", "");
// Converter a chave privada para ECDsa
using (ECDsa ecdsa = ECDsa.Create())
{
  ecdsa.ImportECPrivateKey(Convert.FromBase64String(client_private_key), out _);
  var jwt_body = new Dictionary<string, object>
    {
      { "payload_md5", md5_hash },
      { "timestamp", timestamp },
      { "method", method },
      { "uri", endpoint }
    };
```
  


### Encrypt the header


**Python**

```python
encoded_header_token = jwt.encode(
    claims=jwt_body,
    key=client_private_key,
    algorithm="ES512",
    headers=jwt_header
)
```
  

**PHP**

```php
$jws = $jwsBuilder
    ->create()
    ->withPayload(json_encode($payload))
    ->addSignature($privateKey, $header)
    ->build();
$serializer = new CompactSerializer();
$jwt = $serializer->serialize($jws, 0);
```
  

**Node.js**

```js
const encoded_header_token = jwt.sign(
  jwt_body,
  client_private_key,
  {
    algorithm: 'ES512',
    header: jwt_header
  }
);
```
  

**Java**

```java
PrivateKey privateKey = getPrivateKey(clientPrivateKey);
JwtBuilder jwtBuilder = Jwts.builder().setClaims(jwt_body).signWith(privateKey, SignatureAlgorithm.ES512);
String encodedHeaderToken = jwtBuilder.compact();

...

public static PrivateKey getPrivateKey(final String encodedPvKey) {
    try {
        final String pvKey = new String(Base64.getDecoder().decode(encodedPvKey));
        PEMParser pemParser = new PEMParser(new StringReader(pvKey));
        PEMKeyPair pemKeyPair = (PEMKeyPair) pemParser.readObject();

        JcaPEMKeyConverter converter = new JcaPEMKeyConverter();
        KeyPair kp = converter.getKeyPair(pemKeyPair);
        pemParser.close();

        return kp.getPrivate();
    } catch (IOException e) {
        throw new RuntimeException("Couldn't load private key");
    }
}
```
  

**C#**

```c#
var encoded_header_token = JWT.Encode(jwt_body, ecdsa, JwsAlgorithm.ES512, jwt_header);
```
  


### Build signed header


**Python**

```python
signed_header = {
    "AUTHORIZATION": encoded_header_token,
    "API-CLIENT-KEY": api_key
}
```
  

**PHP**

```php
$headers = [
    'Authorization' => $jwt,
    'API-CLIENT-KEY' => $api_key,
];
```
  

**Node.js**

```js
const signed_header = {
  AUTHORIZATION: encoded_header_token,
  'API-CLIENT-KEY': api_key
};
```
  

**Java**

```java
Map<String, String> headers = new HashMap<>();
headers.put("AUTHORIZATION", encodedHeaderToken);
headers.put("API-CLIENT-KEY", api_key);
```
  

**C#**

```c#
using (var client = new HttpClient())
    client.DefaultRequestHeaders.Clear();
    client.DefaultRequestHeaders.Add("AUTHORIZATION", encoded_header_token);
    client.DefaultRequestHeaders.Add("API-CLIENT-KEY", api_key);
```
  


### Build the request URL


**Python**

```python
url = f"{base_url}{endpoint}"
```
  

**PHP**

```php
$url = $base_url . $endpoint;
```
  

**Node.js**

```js
const url = `${base_url}${endpoint}`;
```
  

**Java**

```java
String requestUrl = base_url + endpoint;
```
  

**C#**

```c#
var url = $"{base_url}{endpoint}";
```
  


## 3. Make the Request


**Python**

```python
post_test_response = requests.post(url=url, headers=signed_header, json=request_body)
```
  

**PHP**

```php
$response = \WpOrg\Requests\Requests::post($url, $headers, json_encode($request_body));
```
  

**Node.js**

```js
axios
  .post(url, request_body, { headers: signed_header })
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.error(error);
  });
```
  

**Java**

```java
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
okhttp3.RequestBody requestBody = RequestBody.create(mediaType, jsonToString(request_body));
Request request = new Request.Builder().url(requestUrl).headers(okhttp3.Headers.of(headers))
        .method(method, requestBody).build();
Response response = client.newCall(request).execute();

System.out.println(response.body().string());
```
  

**C#**

```c#
var content = new StringContent(json_body, Encoding.UTF8, "application/json");
var post_test_response = client.PostAsync(url, content).Result;
```

---

# Webhook

URL: /en/documentation/primeiros_passos/teste_de_autenticacao/webhook_v2

# Webhook

## 1. Introduction and Preparation

### Overview and Importance
This section covers how QI Tech sends webhooks with signed headers, highlighting the importance of decrypting and validating these headers to ensure secure communication.

### Request Format
Webhook requests will be sent to the [ URL configured for receiving webhooks. ](/documentation/primeiros_passos/configurando_webhooks). They have a specific format for headers and body, which is detailed below.

ENDPOINT URL configurada para recebimento dos webhooks
METHOD POST

Request Headers

```json
{
    "AUTHORIZATION": "eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkX21kNSI6IjRhNjAzZjBmMGU3ZGRkZTlkYTJhMGFkM2QzNDFmNzRiIiwidGltZXN0YW1wIjoiMjAyMy0wNi0zMFQxODo1MjoyNy44ODU3MzFaIiwibWV0aG9kIjoiUE9TVCIsInVyaSI6Ii90ZXN0In0.AcNiJqXDdVmlXSbPI6bH41n0KXz9JwVVMgo4Ivqsq5UZjM2WBOTWw3aAvIMAAhjK5OdrURD4cX3dbbnRgzxspUckANRt0hVHRKSkhROHBfZxuTXVfv8oYzwghwiO2MatPBsroC9Vxbh-DEVQJIBigtN9_D5bg8p2-mlVvoxou2I-EwZs",
    "API-CLIENT-KEY": "20d6a816-9d21-4e29-bbe5-2ffb3baacfe9"
}
```

Request Body

```json
{
    "body_sample": "Exemplo de webhook"
}
```

## 2. Configuration and Decryption

### Import libraries

Before starting the decryption and validation of webhooks, it is essential to import the necessary libraries in your preferred programming language. These libraries will facilitate working with JWTs, encryption, and other related aspects.


**Python**

```python
import json
from datetime import datetime, timedelta
from hashlib import md5
from jose import jwt
```


**PHP**

```php
use Jose\Component\Core\AlgorithmManager;
use Jose\Component\Signature\Algorithm\ES512;
use Jose\Component\Signature\JWSVerifier;
use Jose\Component\KeyManagement\JWKFactory;
use Jose\Component\Signature\Serializer\JWSSerializerManager;
use Jose\Component\Signature\Serializer\CompactSerializer;
```


**Node.js**

```js
const jwt = require('jsonwebtoken');
const crypto = require('crypto');
```


**Java**

```java
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.util.io.pem.PemReader;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PublicKey;
import java.security.Security;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.X509EncodedKeySpec;
import java.util.Base64;
```


**C#**

```c#
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;
using Newtonsoft.Json;
using Jose;
```



### Define variables

Define the necessary variables to handle the headers and body of the webhook. This includes the public key provided by QI Tech, used to decrypt and validate the webhook.


**Python**

```python
headers = {
    "AUTHORIZATION": "eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkX21kNSI6IjRhNjAzZjBmMGU3ZGRkZTlkYTJhMGFkM2QzNDFmNzRiIiwidGltZXN0YW1wIjoiMjAyMy0wNi0zMFQxODo1MjoyNy44ODU3MzFaIiwibWV0aG9kIjoiUE9TVCIsInVyaSI6Ii90ZXN0In0.AcNiJqXDdVmlXSbPI6bH41n0KXz9JwVVMgo4Ivqsq5UZjM2WBOTWw3aAvIMAAhjK5OdrURD4cX3dbbnRgzxspUckANRt0hVHRKSkhROHBfZxuTXVfv8oYzwghwiO2MatPBsroC9Vxbh-DEVQJIBigtN9_D5bg8p2-mlVvoxou2I-EwZs",
    "API-CLIENT-KEY": "20d6a816-9d21-4e29-bbe5-2ffb3baacfe9",
}
body = {"body_sample": "Exemplo de webhook"}
authorization = headers.get("AUTHORIZATION")
```


**PHP**

```php
$headers = [
    "AUTHORIZATION" => "eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkX21kNSI6IjRhNjAzZjBmMGU3ZGRkZTlkYTJhMGFkM2QzNDFmNzRiIiwidGltZXN0YW1wIjoiMjAyMy0wNi0zMFQxODo1MjoyNy44ODU3MzFaIiwibWV0aG9kIjoiUE9TVCIsInVyaSI6Ii90ZXN0In0.AcNiJqXDdVmlXSbPI6bH41n0KXz9JwVVMgo4Ivqsq5UZjM2WBOTWw3aAvIMAAhjK5OdrURD4cX3dbbnRgzxspUckANRt0hVHRKSkhROHBfZxuTXVfv8oYzwghwiO2MatPBsroC9Vxbh-DEVQJIBigtN9_D5bg8p2-mlVvoxou2I-EwZs",
    "API-CLIENT-KEY" => "20d6a816-9d21-4e29-bbe5-2ffb3baacfe9",
];
$body = ["body_sample" => "Exemplo de webhook"];
$authorization = $headers["AUTHORIZATION"];
```


**Node.js**

```js
const headers = {
  AUTHORIZATION: 'eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkX21kNSI6IjRhNjAzZjBmMGU3ZGRkZTlkYTJhMGFkM2QzNDFmNzRiIiwidGltZXN0YW1wIjoiMjAyMy0wNi0zMFQxODo1MjoyNy44ODU3MzFaIiwibWV0aG9kIjoiUE9TVCIsInVyaSI6Ii90ZXN0In0.AcNiJqXDdVmlXSbPI6bH41n0KXz9JwVVMgo4Ivqsq5UZjM2WBOTWw3aAvIMAAhjK5OdrURD4cX3dbbnRgzxspUckANRt0hVHRKSkhROHBfZxuTXVfv8oYzwghwiO2MatPBsroC9Vxbh-DEVQJIBigtN9_D5bg8p2-mlVvoxou2I-EwZs',
  'API-CLIENT-KEY': '20d6a816-9d21-4e29-bbe5-2ffb3baacfe9'
};
const body = { body_sample: 'Exemplo de webhook' };
```


**Java**

```java
String authorization = "eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkX21kNSI6IjRhNjAzZjBmMGU3ZGRkZTlkYTJhMGFkM2QzNDFmNzRiIiwidGltZXN0YW1wIjoiMjAyMy0wNi0zMFQxODo1MjoyNy44ODU3MzFaIiwibWV0aG9kIjoiUE9TVCIsInVyaSI6Ii90ZXN0In0.AcNiJqXDdVmlXSbPI6bH41n0KXz9JwVVMgo4Ivqsq5UZjM2WBOTWw3aAvIMAAhjK5OdrURD4cX3dbbnRgzxspUckANRt0hVHRKSkhROHBfZxuTXVfv8oYzwghwiO2MatPBsroC9Vxbh-DEVQJIBigtN9_D5bg8p2-mlVvoxou2I-EwZs";
```


**C#**

```c#
var headers = new Dictionary<string, string>()
{
    { "AUTHORIZATION", "eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkX21kNSI6IjRhNjAzZjBmMGU3ZGRkZTlkYTJhMGFkM2QzNDFmNzRiIiwidGltZXN0YW1wIjoiMjAyMy0wNi0zMFQxODo1MjoyNy44ODU3MzFaIiwibWV0aG9kIjoiUE9TVCIsInVyaSI6Ii90ZXN0In0.AcNiJqXDdVmlXSbPI6bH41n0KXz9JwVVMgo4Ivqsq5UZjM2WBOTWw3aAvIMAAhjK5OdrURD4cX3dbbnRgzxspUckANRt0hVHRKSkhROHBfZxuTXVfv8oYzwghwiO2MatPBsroC9Vxbh-DEVQJIBigtN9_D5bg8p2-mlVvoxou2I-EwZs" },
    { "API-CLIENT-KEY", "20d6a816-9d21-4e29-bbe5-2ffb3baacfe9" }
};

var body = new Dictionary<string, string>()
{
    { "body_sample", "Exemplo de webhook" }
};
```




### 2. Insertion of Encryption Data and Performing Decryption
We insert the public key provided by QI Tech and perform the decryption of the webhook header. This key is crucial for decrypting the webhook headers.


**Python**

```python
qi_public_key = """-----BEGIN PUBLIC KEY-----
{QI_PUBLIC_KEY}
-----END PUBLIC KEY-----"""
```


**PHP**

```php
$qiPublicKey = "-----BEGIN PUBLIC KEY-----
{QI_PUBLIC_KEY}
-----END PUBLIC KEY-----";
```


**Node.js**

```js
const qiPublicKey = `-----BEGIN PUBLIC KEY-----
{QI_PUBLIC_KEY}
-----END PUBLIC KEY-----`;
```


**Java**

```java
String publicKeyStr = "{QI_PUBLIC_KEY}";
```


**C#**

```c#
var authorization = headers["AUTHORIZATION"];

var qiPublicKey = @"-----BEGIN PUBLIC KEY-----
{QI_PUBLIC_KEY}
-----END PUBLIC KEY-----";
```



### Decrypt the header

The decryption process is essential to verify the authenticity and integrity of the received webhook.


**Python**

```python
try:
    decoded_header = jwt.decode(token=authorization, key=qi_public_key)
except:
    raise Exception("Decodification failed.")
```


**PHP**

```php
$algorithmManager = new AlgorithmManager([new ES512()]);
$jwsVerifier = new JWSVerifier($algorithmManager);
$publicKey = JWKFactory::createFromKey($qiPublicKey, null, ['use' => 'sig']);
$serializerManager = new JWSSerializerManager([new CompactSerializer]);
$jws = $serializerManager->unserialize($authorization);
$decodedHeader = json_decode($jws->getPayload(), true);
```


**Node.js**

```js
const decodedHeader = jwt.verify(authorization, qiPublicKey);
```


**Java**

```java
private static Claims validate(final String encodedBody, String publicKeyStr){
    try {
        Security.addProvider(new BouncyCastleProvider());

        final String pbKey = new String(Base64.getDecoder().decode(publicKeyStr));
        Reader rdr = new StringReader(pbKey);
        PemReader pemParser = new PemReader(rdr);

        X509EncodedKeySpec spec = new X509EncodedKeySpec(pemParser.readPemObject().getContent());
        KeyFactory kf = KeyFactory.getInstance("EC");

        PublicKey publicKey = kf.generatePublic(spec);
        return Jwts.parser().setSigningKey(publicKey).parseClaimsJws(encodedBody).getBody();
    }  catch (IOException | NoSuchAlgorithmException | InvalidKeySpecException e) {
        throw new IllegalStateException(e);
    }
}
```


**C#**

```c#
var key = ECDsa.Create();
key.ImportFromPem(qiPublicKey);
var decodedHeader = JWT.Decode<IDictionary<string, string>>(authorization, key);
```



## 3. Validation and Conclusion

### Performing Validations

After decrypting the header, it is important to perform various validations to ensure that the webhook is valid and secure.


**Python**

```python
assert decoded_header.get("method") == "POST"
assert decoded_header.get("uri") == "/client_webhook_endpoint"
assert (
    decoded_header.get("payload_md5")
    == md5(json.dumps(body).encode()).hexdigest()
)
assert (
    (datetime.now() - timedelta(minutes=5))
    < datetime.strptime(decoded_header.get("timestamp"), "%Y-%m-%dT%H:%M:%S.%fZ")
    < (datetime.now() + timedelta(minutes=5))
)
```


**PHP**

```php
$method = $decodedHeader["method"];
$uri = $decodedHeader["uri"];
$payloadMd5 = $decodedHeader["payload_md5"];
$timestamp = $decodedHeader["timestamp"];

assert($method === "POST");
assert($uri === "/client_webhook_endpoint");
assert($payloadMd5 === md5(json_encode($body, JSON_UNESCAPED_SLASHES)));
assert(
    (new DateTime("now", new DateTimeZone("UTC")))->sub(new DateInterval("PT5M")) < DateTime::createFromFormat("Y-m-d\TH:i:s.u\Z", $timestamp) &&
    DateTime::createFromFormat("Y-m-d\TH:i:s.u\Z", $timestamp) < (new DateTime("now", new DateTimeZone("UTC")))->add(new DateInterval("PT5M"))
);
```


**Node.js**

```js
if (decodedHeader.method !== 'POST') {
    throw new Error('Invalid method');
  }
  
  if (decodedHeader.uri !== '/client_webhook_endpoint') {
    throw new Error('Invalid URI');
  }
  
  const payloadMd5 = crypto
    .createHash('md5')
    .update(JSON.stringify(body))
    .digest('hex');
    
  if (decodedHeader.payload_md5 !== payloadMd5) {
    throw new Error('Invalid payload MD5');
  }
  
  const timestamp = new Date(decodedHeader.timestamp);
  const currentDateTime = new Date();
  
  const fiveMinutesAgo = new Date(currentDateTime.getTime() - 5 * 60000);
  const fiveMinutesAhead = new Date(currentDateTime.getTime() + 5 * 60000);
  
  if (!(timestamp > fiveMinutesAgo && timestamp < fiveMinutesAhead)) {
    throw new Error('Invalid timestamp');
  }
```


**Java**

```java
Claims result = validate(authorization, publicKeyStr);
System.out.println(result);
System.out.println(result.get("method").equals("POST"));
System.out.println(result.get("uri").equals("/test"));
```


**C#**

```c#
var method = decodedHeader["method"];
var uri = decodedHeader["uri"];
var payloadMd5 = decodedHeader["payload_md5"];
var timestamp = DateTime.Parse(decodedHeader["timestamp"]);
timestamp = timestamp.ToUniversalTime();
var bodyJson = JsonConvert.SerializeObject(body, new JsonSerializerSettings
{
    NullValueHandling = NullValueHandling.Ignore,
    Formatting = Formatting.None
});

using (var md5Hash = MD5.Create())
{
    var calculatedMd5 = GetMd5Hash(md5Hash, bodyJson);
    if (payloadMd5 != calculatedMd5)
    {
        throw new Exception("Payload MD5 verification failed.");
    }
}

var currentTime = datetime.now;
var validTimeStart = currentTime.AddMinutes(-5);
var validTimeEnd = currentTime.AddMinutes(5);
if (timestamp < validTimeStart || timestamp > validTimeEnd)
{
    throw new Exception("Timestamp verification failed.");
}

...

static string GetMd5Hash(MD5 md5Hash, string input)
{
    byte[] data = md5Hash.ComputeHash(Encoding.UTF8.GetBytes(input));

    StringBuilder builder = new StringBuilder();
    for (int i = 0; i < data.Length; i++)
    {
        builder.Append(data[i].ToString("x2"));
    }

    return builder.ToString();
}
```

---

# Key Exchange

URL: /en/documentation/primeiros_passos/troca_de_chaves

## Key pair generation (public and private)

**Unix**

To generate your private key on a **Unix** computer, run in your terminal or command line:

```bash
$ ssh-keygen -t ecdsa -b 521 -m PEM -f jwtECDSASHA512.key
```

And from this private key, generate your public key.

```bash
$ openssl ec -in jwtECDSASHA512.key -pubout -outform PEM -out jwtECDSASHA512.key.pub
```

**Mac OS**

To generate your private key on a **Mac OS** computer, run in your terminal:

```bash
openssl ecparam -name secp521r1 -genkey -noout -out ec512-private.pem
```

And from this private key, generate your public key.

```bash
openssl ec -in ec512-private.pem -pubout -out ec512-public.pem
```

**Windows**

To generate your key pair (private and public) on a **Windows** computer, you will need the `ssh-keygen` and `openssl` tools in PowerShell or GitBash.

Run the command below to create your private key file (`jwtECDSASHA512.key`).

```bash
ssh-keygen -t ecdsa -b 521 -m PEM -f jwtECDSASHA512.key
```

And from this private key, generate your public key (`jwtECDSASHA512.key.pub`).

```bash
openssl ec -in jwtECDSASHA512.key -pubout -outform PEM -out jwtECDSASHA512.key.pub
```

To view the key in notepad:

```bash
notepad jwtECDSASHA512.key.pub
```

To view the key in the terminal:

```bash
cat jwtECDSASHA512.key.pub
```

If you add an encryption password to your private key and want to view it, you will need to decrypt it with the command below and your password:

```bash
openssl ec -in jwtECDSASHA512.key -out chave_descriptografada.pem
```

---

# Consulta de valor presente de uma operação

URL: /en/documentation/refinanciamento/consulta_de_valor_presente_de_uma_operacao

Para descobrir o valor presente que será utilizado no refinanciamento de uma operação, é possível utilizar o endpoint de consulta de dívidas indicando 4 query params chave listados abaixo.

## Request

ENDPOINT /debt
MÉTODO GET

## Query Params
| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `key` * | string | Chave da dívida devolvida no momento da criação da operação de crédito. | - |
| `eval_present_value` * | string | Indica que o valor atual de cada parcela deve ser calculado e mostrado. | - |
| `calculate_delay` * | string | Indica que, se a parcela estiver vencida, os juros de mora e multa devem ser calculados com o valor presente. | - |
| `calculate_spread` * | booleano | Indica se o valor de spread da operação deve ser adicionado ao valor presente (para operações de refinanciamento deve ser falso). | - |

## Response

STATUS 200

Response Body

```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": 360305,
				"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": [{
						"amount": null,
						"created_at": "2022-10-19T11:54:47",
						"event_date": "2022-10-19T11:54:47",
						"installment_event_type": {
							"enumerator": "open",
							"translation_path": "co.InstallmentEventType.open"
						},
						"installment_old_status": {
							"enumerator": "created",
							"translation_path": "co.InstallmentStatus.created"
						},
						"old_due_date": null
					},
					{
						"amount": null,
						"created_at": "2022-11-18T08:00:10",
						"event_date": "2022-11-18T08:00:10",
						"installment_event_type": {
							"enumerator": "maturity",
							"translation_path": "co.InstallmentEventType.maturity"
						},
						"installment_old_status": {
							"enumerator": "opened",
							"translation_path": "co.InstallmentStatus.opened"
						},
						"old_due_date": null
					},
					{
						"amount": 11.76,
						"created_at": "2022-11-22T08:00:14",
						"event_date": "2022-11-22T08:00:14",
						"installment_event_type": {
							"enumerator": "delay_fine",
							"translation_path": "co.InstallmentEventType.delay_fine"
						},
						"installment_old_status": {
							"enumerator": "waiting_payment",
							"translation_path": "co.InstallmentStatus.waiting_payment"
						},
						"old_due_date": null
					},
					{
						"amount": 11.94,
						"created_at": "2022-11-23T09:13:46",
						"event_date": "2022-11-23T09:13:46",
						"installment_event_type": {
							"enumerator": "delay_fine",
							"translation_path": "co.InstallmentEventType.delay_fine"
						},
						"installment_old_status": {
							"enumerator": "overdue",
							"translation_path": "co.InstallmentStatus.overdue"
						},
						"old_due_date": null
					},
					{
						"amount": 12.12,
						"created_at": "2022-11-24T09:15:55",
						"event_date": "2022-11-24T09:15:55",
						"installment_event_type": {
							"enumerator": "delay_fine",
							"translation_path": "co.InstallmentEventType.delay_fine"
						},
						"installment_old_status": {
							"enumerator": "overdue",
							"translation_path": "co.InstallmentStatus.overdue"
						},
						"old_due_date": null
					},
					{
						"amount": 12.3,
						"created_at": "2022-11-25T09:24:45",
						"event_date": "2022-11-25T09:24:44",
						"installment_event_type": {
							"enumerator": "delay_fine",
							"translation_path": "co.InstallmentEventType.delay_fine"
						},
						"installment_old_status": {
							"enumerator": "overdue",
							"translation_path": "co.InstallmentStatus.overdue"
						},
						"old_due_date": null
					},
					{
						"amount": 12.84,
						"created_at": "2022-11-28T09:37:41",
						"event_date": "2022-11-28T09:37:41",
						"installment_event_type": {
							"enumerator": "delay_fine",
							"translation_path": "co.InstallmentEventType.delay_fine"
						},
						"installment_old_status": {
							"enumerator": "overdue",
							"translation_path": "co.InstallmentStatus.overdue"
						},
						"old_due_date": null
					},
					{
						"amount": 13.02,
						"created_at": "2022-11-29T09:17:44",
						"event_date": "2022-11-29T09:17:44",
						"installment_event_type": {
							"enumerator": "delay_fine",
							"translation_path": "co.InstallmentEventType.delay_fine"
						},
						"installment_old_status": {
							"enumerator": "overdue",
							"translation_path": "co.InstallmentStatus.overdue"
						},
						"old_due_date": null
					}
				],
				"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,
				"present_amount": 1000.11
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0,
				"bank_slip_key": "527835e4-7b09-42f2-a7d0-befed3a326fd",
				"business_due_date": "2022-12-20",
				"calendar_days": 31,
				"cetip_settlements": [],
				"created_at": "2022-10-19T11:53:00",
				"digitable_line": "32990001031000699925349000000205492040000055231",
				"due_date": "2022-12-19",
				"due_interest": 0,
				"due_principal": 2562.07402982,
				"events": [{
					"amount": null,
					"created_at": "2022-10-19T11:54:47",
					"event_date": "2022-10-19T11:54:47",
					"installment_event_type": {
						"enumerator": "open",
						"translation_path": "co.InstallmentEventType.open"
					},
					"installment_old_status": {
						"enumerator": "created",
						"translation_path": "co.InstallmentStatus.created"
					},
					"old_due_date": null
				}],
				"fine_amount": null,
				"has_interest": true,
				"installment_key": "dde36938-8594-4507-a87d-cd2dd5309817",
				"installment_number": 2,
				"installment_payment": [],
				"installment_status": {
					"enumerator": "opened",
					"translation_path": "co.InstallmentStatus.opened"
				},
				"installment_type": {
					"enumerator": "principal",
					"translation_path": "co.InstallmentType.principal"
				},
				"original_due_principal": 2562.07402982,
				"original_pre_fixed_amount": 65.94922003,
				"original_principal_amortization_amount": 486.36077997,
				"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": 65.94922003,
				"principal_amortization_amount": 486.36077997,
				"qr_code_key": "9d2980e9-fa0c-4b21-a7c5-5ca266c9aba8",
				"qr_code_url": "00020126970014br.gov.bcb.pix2575qrcode-h.sandbox.qitech.app/bacen/cobv/9d2980e9-fa0c-4b21-a7c5-5ca266c9aba85204000053039865802BR5925QI SOCIEDADE DE CREDITO D6009Sao Paulo61080145200062070503***6304FBC3",
				"renegotiation_proposal_key": null,
				"tax_amount": 2.43277662,
				"total_accrual_amount": null,
				"total_amount": 552.31,
				"total_paid_amount": 0,
				"updated_at": "2022-10-19T11:56:43",
				"workdays": 21,
				"present_amount": 1000.11
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0,
				"bank_slip_key": "d69c9ab6-01f1-40bb-9519-a06ee2230c22",
				"business_due_date": "2023-01-19",
				"calendar_days": 30,
				"cetip_settlements": [],
				"created_at": "2022-10-19T11:53:00",
				"digitable_line": "32990001031000699925350000000203192340000055231",
				"due_date": "2023-01-18",
				"due_interest": 0,
				"due_principal": 2075.71324985,
				"events": [{
					"amount": null,
					"created_at": "2022-10-19T11:54:47",
					"event_date": "2022-10-19T11:54:47",
					"installment_event_type": {
						"enumerator": "open",
						"translation_path": "co.InstallmentEventType.open"
					},
					"installment_old_status": {
						"enumerator": "created",
						"translation_path": "co.InstallmentStatus.created"
					},
					"old_due_date": null
				}],
				"fine_amount": null,
				"has_interest": true,
				"installment_key": "93273ee0-71bd-46a6-b5e2-39e03a365b16",
				"installment_number": 3,
				"installment_payment": [],
				"installment_status": {
					"enumerator": "opened",
					"translation_path": "co.InstallmentStatus.opened"
				},
				"installment_type": {
					"enumerator": "principal",
					"translation_path": "co.InstallmentType.principal"
				},
				"original_due_principal": 2075.71324985,
				"original_pre_fixed_amount": 51.68519286,
				"original_principal_amortization_amount": 500.62480714,
				"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": 51.68519286,
				"principal_amortization_amount": 500.62480714,
				"qr_code_key": "d79eb27b-7a1e-4d4c-94a1-f20045c4904e",
				"qr_code_url": "00020126970014br.gov.bcb.pix2575qrcode-h.sandbox.qitech.app/bacen/cobv/d79eb27b-7a1e-4d4c-94a1-f20045c4904e5204000053039865802BR5925QI SOCIEDADE DE CREDITO D6009Sao Paulo61080145200062070503***6304E949",
				"renegotiation_proposal_key": null,
				"tax_amount": 3.73566231,
				"total_accrual_amount": null,
				"total_amount": 552.31,
				"total_paid_amount": 0,
				"updated_at": "2022-10-19T11:56:43",
				"workdays": 22,
				"present_amount": 1000.11
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0,
				"bank_slip_key": "5c62c50f-5326-4226-b154-a0cc6d2f62e7",
				"business_due_date": "2023-02-23",
				"calendar_days": 35,
				"cetip_settlements": [],
				"created_at": "2022-10-19T11:53:00",
				"digitable_line": "32990001031000699925351000000201192690000055231",
				"due_date": "2023-02-22",
				"due_interest": 0,
				"due_principal": 1575.08844271,
				"events": [{
					"amount": null,
					"created_at": "2022-10-19T11:54:47",
					"event_date": "2022-10-19T11:54:47",
					"installment_event_type": {
						"enumerator": "open",
						"translation_path": "co.InstallmentEventType.open"
					},
					"installment_old_status": {
						"enumerator": "created",
						"translation_path": "co.InstallmentStatus.created"
					},
					"old_due_date": null
				}],
				"fine_amount": null,
				"has_interest": true,
				"installment_key": "1f7b16fe-04b6-4f07-a807-eb3501e44e0d",
				"installment_number": 4,
				"installment_payment": [],
				"installment_status": {
					"enumerator": "opened",
					"translation_path": "co.InstallmentStatus.opened"
				},
				"installment_type": {
					"enumerator": "principal",
					"translation_path": "co.InstallmentType.principal"
				},
				"original_due_principal": 1575.08844271,
				"original_pre_fixed_amount": 45.8505547,
				"original_principal_amortization_amount": 506.4594453,
				"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": 45.8505547,
				"principal_amortization_amount": 506.4594453,
				"qr_code_key": "b55464c8-3764-4ee2-a814-ce22396aabe7",
				"qr_code_url": "00020126970014br.gov.bcb.pix2575qrcode-h.sandbox.qitech.app/bacen/cobv/b55464c8-3764-4ee2-a814-ce22396aabe75204000053039865802BR5925QI SOCIEDADE DE CREDITO D6009Sao Paulo61080145200062070503***63044215",
				"renegotiation_proposal_key": null,
				"tax_amount": 5.23273899,
				"total_accrual_amount": null,
				"total_amount": 552.31,
				"total_paid_amount": 0,
				"updated_at": "2022-10-19T11:56:43",
				"workdays": 23,
				"present_amount": 1000.11
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0,
				"bank_slip_key": "256be15f-dcc6-4775-8298-c3efde5a1147",
				"business_due_date": "2023-03-21",
				"calendar_days": 26,
				"cetip_settlements": [],
				"created_at": "2022-10-19T11:53:00",
				"digitable_line": "32990001031000699925352000000209192950000055231",
				"due_date": "2023-03-20",
				"due_interest": 0,
				"due_principal": 1068.62899741,
				"events": [{
					"amount": null,
					"created_at": "2022-10-19T11:54:47",
					"event_date": "2022-10-19T11:54:47",
					"installment_event_type": {
						"enumerator": "open",
						"translation_path": "co.InstallmentEventType.open"
					},
					"installment_old_status": {
						"enumerator": "created",
						"translation_path": "co.InstallmentStatus.created"
					},
					"old_due_date": null
				}],
				"fine_amount": null,
				"has_interest": true,
				"installment_key": "3ed37dc1-61f8-44f1-af21-a55f0cf0795d",
				"installment_number": 5,
				"installment_payment": [],
				"installment_status": {
					"enumerator": "opened",
					"translation_path": "co.InstallmentStatus.opened"
				},
				"installment_type": {
					"enumerator": "principal",
					"translation_path": "co.InstallmentType.principal"
				},
				"original_due_principal": 1068.62899741,
				"original_pre_fixed_amount": 23.02305805,
				"original_principal_amortization_amount": 529.28694195,
				"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": 23.02305805,
				"principal_amortization_amount": 529.28694195,
				"qr_code_key": "64e05528-83fb-432a-8af7-491ca4eb7b90",
				"qr_code_url": "00020126970014br.gov.bcb.pix2575qrcode-h.sandbox.qitech.app/bacen/cobv/64e05528-83fb-432a-8af7-491ca4eb7b905204000053039865802BR5925QI SOCIEDADE DE CREDITO D6009Sao Paulo61080145200062070503***630472F7",
				"renegotiation_proposal_key": null,
				"tax_amount": 6.59703244,
				"total_accrual_amount": null,
				"total_amount": 552.31,
				"total_paid_amount": 0,
				"updated_at": "2022-10-19T11:56:43",
				"workdays": 18,
				"present_amount": 1000.11
			},
			{
				"accrual_reference_date": null,
				"additional_costs": [],
				"advanced_paid_amount": 0,
				"bank_slip_key": "a8c2edaa-ed3d-4c5b-808e-b26947a5e79e",
				"business_due_date": "2023-04-19",
				"calendar_days": 29,
				"cetip_settlements": [],
				"created_at": "2022-10-19T11:53:01",
				"digitable_line": "32990001031000699925353000000207293240000055232",
				"due_date": "2023-04-18",
				"due_interest": 0,
				"due_principal": 539.34205545,
				"events": [{
					"amount": null,
					"created_at": "2022-10-19T11:54:47",
					"event_date": "2022-10-19T11:54:47",
					"installment_event_type": {
						"enumerator": "open",
						"translation_path": "co.InstallmentEventType.open"
					},
					"installment_old_status": {
						"enumerator": "created",
						"translation_path": "co.InstallmentStatus.created"
					},
					"old_due_date": null
				}],
				"fine_amount": null,
				"has_interest": true,
				"installment_key": "2b58b2be-89cd-4710-a6a5-81180938b501",
				"installment_number": 6,
				"installment_payment": [],
				"installment_status": {
					"enumerator": "opened",
					"translation_path": "co.InstallmentStatus.opened"
				},
				"installment_type": {
					"enumerator": "principal",
					"translation_path": "co.InstallmentType.principal"
				},
				"original_due_principal": 539.34205545,
				"original_pre_fixed_amount": 12.97660456,
				"original_principal_amortization_amount": 539.34339544,
				"original_total_amount": 552.32,
				"paid_amount": 0,
				"paid_at": null,
				"payment_type": {
					"enumerator": "bankslip",
					"translation_path": "co.PaymentType.bankslip"
				},
				"post_fixed_amount": 0,
				"pre_fixed_amount": 12.97660456,
				"principal_amortization_amount": 539.34339544,
				"qr_code_key": "dcc7d257-e6a1-4d0a-88f7-1acf662482b5",
				"qr_code_url": "00020126970014br.gov.bcb.pix2575qrcode-h.sandbox.qitech.app/bacen/cobv/dcc7d257-e6a1-4d0a-88f7-1acf662482b55204000053039865802BR5925QI SOCIEDADE DE CREDITO D6009Sao Paulo61080145200062070503***6304C9A1",
				"renegotiation_proposal_key": null,
				"tax_amount": 8.00493468,
				"total_accrual_amount": null,
				"total_amount": 552.32,
				"total_paid_amount": 0,
				"updated_at": "2022-10-19T11:56:43",
				"workdays": 20,
				"present_amount": 1000.11
			}
		],
		"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": [{
				"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
			}],
			"birth_date": "1997-10-19",
			"birth_place": null,
			"cnae_code": null,
			"company_document_number": null,
			"created_at": "2022-10-19T11:53:01",
			"document_identification_date": null,
			"document_identification_number": "",
			"document_identification_type": null,
			"email": "wxr@ff.com",
			"foundation_date": null,
			"gender": null,
			"income": 0.01,
			"individual_document_number": "92147661180",
			"is_pep": false,
			"marital_status": {
				"enumerator": "single",
				"translation_path": "co.MaritalStatus.single"
			},
			"mother_name": null,
			"name": "Wxy  Wsx",
			"nationality": "nationality",
			"person_type": "natural",
			"phone": {
				"area_code": "00",
				"country_code": "055",
				"created_at": "2022-10-19T11:53:00",
				"number": "016048311",
				"phone_key": "341d7c67-963c-49a5-b585-265425d71f52",
				"phone_type": null
			},
			"profession": null,
			"property_system": null,
			"related_party_key": "203b2ada-ff3e-44a6-a843-f244aa1afbc9",
			"revenue": null,
			"role_type": {
				"enumerator": "issuer",
				"translation_path": "co.RoleType.issuer"
			},
			"simples_nacional_participant": null,
			"spouse_document_number": null,
			"trading_name": null
		}],
		"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"
}
```

:::caution Atenção!

Dentro do array de parcelas será retornado o valor presente calculado de cada parcela em **"present_amount"**, seu somatório será o valor presente considerado para o contrato no momento da solicitação do refinanciamento.
:::

STATUS 400

Response Body

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

```

---

# introducao

URL: /en/documentation/refinanciamento/introducao

Um refinanciamento consiste na geração de um novo contrato de crédito para a quitação de um anterior, neste sentido, seu fluxo funciona da mesma forma de uma emissão de dividas simples, porém quando informados os valores da operação, o somatorio do valor presente dos contratos anteriores será retido e apenas o excedente, caso exista, será liberado na conta do tomador.

---

# Refinancing Simulation

URL: /en/documentation/refinanciamento/simulando_refinanciamento

## Requesting a simulation for a non existing operation

ENDPOINT /debt_simulation
METHOD POST

Request Body

```json
{
  "complex_operation": true,
  "operation_batch": [
    {
      "borrower": {
        "person_type": "natural"
      },
     "refinanced_credit_operations": [
            {
                "original_deadline": 5,
                "monthly_interest_rate": "0.0133",
                "disbursement_date": "2024-06-30",
                "due_balance": 1050,
            }
    ],
      "financial": {
        "amount": 1900.83,
        "disbursement_amount": 800,
        "interest_type": "pre_price_days",
        "credit_operation_type": "ccb",
        "annual_interest_rate": 2.32,
        "disbursement_date": "2023-04-01",
        "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
        }
      }
    }
  ]
}
```
:::caution Atenção!

The **"disbursement_date"** and **"monthly_interest_rate"** within **"refinanced_credit_operations"** are required only when attempting to calculate operation settlement values for multiple disbursement option operations.
:::

## Requesting a simulation for an existing operation

ENDPOINT /debt_simulation
METHOD POST

Request Body

```json
{
  "complex_operation": true,
  "operation_batch": [
    {
      "borrower": {
        "person_type": "natural"
      },
     "refinanced_credit_operations": [
            {
                "operation_key": "a9630d51-f08f-4763-b269-c1947e97c260"
            }
    ],
      "financial": {
        "amount": 1900.83,
        "disbursement_amount": 800,
        "interest_type": "pre_price_days",
        "credit_operation_type": "ccb",
        "annual_interest_rate": 2.32,
        "disbursement_date": "2023-04-01",
        "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
        }
      }
    }
  ]
}

```

:::caution Atenção!
The utilized payloads are the same utilized in the simple debt simulation, in addition to the operation list that will be settled in the **"refinanced_credit_operations"** with their settlement debt values.
:::

## Response

STATUS 200

Response Body

```json
[
    {
        "data": {
            "annual_cet": 0.6252134981759837,
            "assignment_amount": 1919.84,
            "cet": 0.0413,
            "contract_fee_amount": -179.13,
            "contract_fees": [
                {
                    "amount": 1.0,
                    "amount_type": "percentage",
                    "fee_amount": -179.13,
                    "fee_type": "tac"
                }
            ],
            "credit_operation_type": "ccb",
            "disbursed_issue_amount": 2079.96,
            "disbursement_date": "2023-04-01",
            "disbursement_options": [
                {
                    "annual_cet": 0.6252134981759837,
                    "assignment_amount": 1919.84,
                    "cet": 0.0413,
                    "contract_fee_amount": -179.13,
                    "contract_fees": [
                        {
                            "amount": 1.0,
                            "amount_type": "percentage",
                            "fee_amount": -179.13,
                            "fee_type": "tac"
                        }
                    ],
                    "disbursed_issue_amount": 2079.96,
                    "disbursement_date": "2023-04-01",
                    "external_contract_fee_amount": 19.01,
                    "external_contract_fees": [
                        {
                            "amount": 1.0,
                            "amount_released": 17.25,
                            "amount_type": "percentage",
                            "cofins_amount": 0,
                            "csll_amount": 0,
                            "description": null,
                            "fee_amount": 19.01,
                            "fee_type": "spread",
                            "irrf_amount": 0,
                            "net_fee_amount": 17.25,
                            "pis_amount": 0,
                            "tax_amount": 1.76
                        }
                    ],
                    "first_due_date": "2023-05-01",
                    "installments": [
                        {
                            "business_due_date": "2023-05-02",
                            "calendar_days": 30,
                            "due_date": "2023-05-01",
                            "due_principal": 1900.83,
                            "has_interest": true,
                            "installment_number": 1,
                            "post_fixed_amount": 0,
                            "pre_fixed_amount": 199.90606482231624,
                            "principal_amortization_amount": 904.6839351776838,
                            "tax_amount": 0.0,
                            "total_amount": 1104.59,
                            "workdays": 18.0
                        },
                        {
                            "business_due_date": "2023-06-01",
                            "calendar_days": 31,
                            "due_date": "2023-06-01",
                            "due_principal": 996.1460648223162,
                            "has_interest": true,
                            "installment_number": 2,
                            "post_fixed_amount": 0,
                            "pre_fixed_amount": 108.43818022618876,
                            "principal_amortization_amount": 996.1418197738112,
                            "tax_amount": 0.0,
                            "total_amount": 1104.58,
                            "workdays": 23.0
                        }
                    ],
                    "iof_amount": 0.0,
                    "issue_amount": 1900.83,
                    "net_external_contract_fee_amount": 17.25,
                    "prefixed_interest_rate": {
                        "annual_rate": 2.32,
                        "daily_rate": 0.0033388,
                        "interest_base": "calendar_days",
                        "monthly_rate": 0.10516767
                    },
                    "total_pre_fixed_amount": 308.344245048505
                }
            ],
            "external_contract_fee_amount": 19.01,
            "external_contract_fees": [
                {
                    "amount": 1.0,
                    "amount_released": 17.25,
                    "amount_type": "percentage",
                    "cofins_amount": 0,
                    "csll_amount": 0,
                    "description": null,
                    "fee_amount": 19.01,
                    "fee_type": "spread",
                    "irrf_amount": 0,
                    "net_fee_amount": 17.25,
                    "pis_amount": 0,
                    "tax_amount": 1.76
                }
            ],
            "final_disbursement_amount": -17733.89,
            "installments": [
                {
                    "business_due_date": "2023-05-02",
                    "calendar_days": 30,
                    "due_date": "2023-05-01",
                    "due_principal": 1900.83,
                    "has_interest": true,
                    "installment_number": 1,
                    "post_fixed_amount": 0,
                    "pre_fixed_amount": 199.90606482231624,
                    "principal_amortization_amount": 904.6839351776838,
                    "tax_amount": 0.0,
                    "total_amount": 1104.59,
                    "workdays": 18.0
                },
                {
                    "business_due_date": "2023-06-01",
                    "calendar_days": 31,
                    "due_date": "2023-06-01",
                    "due_principal": 996.1460648223162,
                    "has_interest": true,
                    "installment_number": 2,
                    "post_fixed_amount": 0,
                    "pre_fixed_amount": 108.43818022618876,
                    "principal_amortization_amount": 996.1418197738112,
                    "tax_amount": 0.0,
                    "total_amount": 1104.58,
                    "workdays": 23.0
                }
            ],
            "interest_grace_period": 0,
            "interest_payment_month_period": 1,
            "interest_type": "pre_price_days",
            "iof_amount": 0.0,
            "issue_amount": 1900.83,
            "issue_date": "2023-04-01",
            "net_external_contract_fee_amount": 17.25,
            "number_of_installments": 2,
            "operation_type": "refinancing",
            "post_fixed_interest_base": "workdays",
            "post_fixed_interest_rate": null,
            "prefixed_interest_rate": {
                "annual_rate": 2.32,
                "daily_rate": 0.0033388,
                "interest_base": "calendar_days",
                "monthly_rate": 0.10516767
            },
            "principal_amortization_month_period": 1,
            "principal_grace_period": 0,
            "refinanced_credit_operations": [
                {
                    "due_balance": 19813.85,
                    "due_balance_reference_date": "2023-03-29",
                    "original_deadline": 1084,
                    "refinanced_credit_operation_key": "a9630d51-f08f-4763-b269-c1947e97c260",
                    "refinanced_credit_operation_status": null
                }
            ],
            "requester_key": "ef48fbe4-267b-45c1-9049-75345c075486",
            "total_pre_fixed_amount": 308.344245048505
        },
        "event_datetime": "2023-03-29 19:19:28",
        "key": "0fc07785-7f74-45b0-a8ca-8ca48f8c17ed",
        "status": "finished",
        "type": "debt"
    }
]
```

STATUS 400

Response Body

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

## Definitions

### Request Body
| Field                 | Type    | Description                                                                                     | 
|-----------------------|---------|-------------------------------------------------------------------------------------------------|
| **complex_operation** | boolean | _true_ - indicates multiple operations may be realized for the same request                     |
| **operation_batch**   | object  | Lists operation batches - **[Lista Operation Batch Objects](#object-da-lista-operation_batch)** |

### Lista Operation Batch Objects
| Field         | Type   | Description                                                                    | 
|---------------|--------|--------------------------------------------------------------------------------|
| **borrower**  | object | **[Object Borrower](#object-borrower)** - Credit Operation borrowers objects|
| **financial** | object | **[Object Financial](#object-financial)** - Credit operation financial objects |

### Object Borrower
| Field           | Type   | Description                                                                            |
|-----------------|--------|----------------------------------------------------------------------------------------|
| **person_type** | object | **[Enumerador Person Type](#enumerador-person_type)** - Creditors' natural person type |

### Object Financial
| Field                            | Type             | Description                                                                                                 |
|----------------------------------|------------------|-------------------------------------------------------------------------------------------------------------|
| **amout**                        | float            | Credit operation issue amount                                                                               |
| **interest_type**                | object           | **[Enumerador Interest Type](#enumerador-interest-type)** -Amortization method and interest calculation type |
| **credit_operation_type**        | object           | **[Enumerador Credit Operation Type](#enumerador-credit-operation-type)** - Contract type                   |
| **annual_interest_rate**         | float            | Pre-fixed anual interest rate                                                                               |
| **disbursement_date**            | date             | Operation disbursement date                                                                                 |
| **interest_grace_period**        | int              | Interest grace period (in months)                                                                           |
| **principal_grace_period**       | int              | Principal grace period (in months)                                                                          |
| **number_of_installments**       | int              | Number of credit operation installments                                                                     |
| **fine_configuration**           | object           | **[Object fine_configuration](#object-fine-configuration)** - Fine configuration type                       |
| **refinanced_credit_operations** | array of objects | Lists all refinanced credit operations                                                                      |

### Object Refinanced Credit Operations

#### Existing refinanced operation fields
| Field                     | Type   | Description                                    |
|---------------------------|--------|------------------------------------------------|
| **due_balance**           | number | Refinanced operation due balance               |
| **original_deadline**     | int    | Refinanced operation original payment deadline |
| **monthly_interest_rate** | float  | Refinanced operation monthly interest rate     |
| **disbursement_date**     | date   | Refinanced operation due date                  |

#### Existing refinanced operation fields
| Field             | Type        | Description               |
|-------------------|-------------|---------------------------|
| **operation_key** | string uuid | Refinanced operation uuid |

### Object Fine Configuration
| Field                  | Type  | Description                                                                           | 
|------------------------|-------|---------------------------------------------------------------------------------------|
| **contract_fine_rate** | float | Fine percentage (decimals)                                                            |
| **interest_base**      | enum  | **[Enumerador Interest Base](#enumerador-interest-base)** - Interest base calculation |
| **monthly_rate**       | float | Monthly interest rate (decimals)                                                      |

---

# Refinancing Creation

URL: /en/documentation/refinanciamento/solicitando_refinanciamento

## Request

ENDPOINT /debt
METHOD POST

Request Body

```json
{
    "borrower": {
        "address": {
            "city": "Bauru",
            "neighborhood": "Centro",
            "number": "343",
            "postal_code": "17057770",
            "state": "SP",
            "street": "Av Um"
        },
        "birth_date": "1998-03-21",
        "document_identification": "2f7bfc50-d7c0-4d4e-a5ce-d8bba2aeb348",
        "document_identification_number": "432202821",
        "email": "victor.moura@qitech.com.br",
        "individual_document_number": "37197645832",
        "name": "Urich Oliveira",
        "person_type": "natural",
        "phone": {
            "area_code": "14",
            "country_code": "055",
            "number": "936180265"
        }
    },
    "disbursement_bank_account": {
        "account_digit": "2",
        "account_number": "63755",
        "bank_code": "329",
        "branch_number": "0001"
    },
    "financial": {
        "disbursed_amount": 5000.0
        "monthly_interest_rate": 0.0175,
        "credit_operation_type": "ccb",
        "disbursement_date": "2022-04-25",
        "fine_configuration": {
            "contract_fine_rate": 0.02,
            "interest_base": "calendar_days",
            "monthly_rate": 0.01
        },
        "first_due_date": "2022-06-07",
        "interest_grace_period": 0,
        "interest_subsidy_percentage": 0,
        "interest_type": "pre_price_days",
        "issue_date": "2022-04-25",
        "number_of_installments": 84,
        "principal_grace_period": 0,
        "payment_type": "bankslip"
    },
    "simplified": true,
    "refinanced_credit_operations": [
            {
                "operation_key": "d897f8fa-30d0-4a25-b7e5-5daa61c7480d"
            },
            {
                "operation_key": "f8f0d7a9-4f0c-426c-ac50-33a09d4a0d78"
            }
    ],
  "purchaser_document_number": "32402502000135"
}

```

:::caution Attention!
The payload used in a refinancing operation is the same used in a simple debt emission, in addition to the operation list which will be settled in the **"refinanced_credit_operations"**

:::

### Body Params

| Field                              | Type             | Description                                                                                                        | Máx. Caract. | 
|------------------------------------|------------------|--------------------------------------------------------------------------------------------------------------------|--------------|
| **borrower** *                     | object           | **[Object Borrower](#object-borrower)** - Credit Operation borrower information                                    | -            | 
| **disbursement_bank_account** *    | object           | **[Object Disbursement Bank Account](#object-disbursement_bank_accounts)** - Disbursement bank account information | -            |
| **financial** *                    | object           | **[Object Financial](#object-financial)** - Financial information                                                  | -            |
| **purchaser_document_number** *    | string           | Purchaser document number                                                                                          | -            |
| **refinanced_credit_operations** * | array of objects | **[Objects Refinanced Credit Operations](#object-refinanced_credit_operations)** Refinanced operations list        | -            |

## Definitions

### Object Request Body
| Field                           | Type   | Description                                                                                                       | Máx. Caract. | 
|---------------------------------|--------|-------------------------------------------------------------------------------------------------------------------|--------------|
| **borrower** *                  | object | **[Object Borrower](#object-borrower)** - Credit operation borrower information                                   | -            | 
| **disbursement_bank_account** * | object | **[Object Disbursement Bank Account](#object-disbursement_bank_accounts)** - Disbursement bank account information | -            |
| **financial** *                 | object | **[Object Financial](#object-financial)** - Financial information                                                 | -            |
| **purchaser_document_number** * | string |  Purchaser document number                                                             | -            |

### Object Borrower
| Campo                            | Tipo    | Description                                                                                    | Máx. Caract. | 
|----------------------------------|---------|----------------------------------------------------------------------------------------------|--------------|
| **name** *                       | string  | Creditors name                                                                               | 100          |
| **email**                        | string  | Creditors email                                                                              | 254          |
| **phone**                        | object  | **[Object Phone](#object-phone)** - Creditors Telefphone                                     | -            | 
| **is_pep** *                     | boolean | Indicador de PEP (http://www.portaldatransparencia.gov.br/download-de-dados/pep)             | -            |
| **address** *                    | object  | **[Object Address](#object-address)** - Creditors Address                                    | -            | 
| **role_type** *                  | enum    | default: _issuer_                                                                            | -            |
| **birth_date** *                 | date    | Creditors birth date ("AAAA-MM-DD" format)                                                   | -            |
| **mother_name** *                | string  | Creditors monthers name                                                                      | 100          |
| **nationality**                  | string  | Creditors nationality                                                                        | 50           |
| **person_type** *                | string  | Natural person indicator - default: _natural_                                                | -            |
| **individual_document_number** * | string  | Creditors document number (apenas números)                                                   | 11           |
| **document_identification**     * | string  | Creditors **DOCUMENT_KEY** in PDF format (RG ou CNH)                                         | -            |
| **document_identification_back** |string | Creditors **DOCUMENT_KEY** (BACK)                                                            | 11 |
| **wedding_certificate** | string | Creditors wedding **DOCUMENT_KEY**. In the case their marital satus is "Single" must be null | 11 |
| **proof_of_residence** * |string | Creditors address **DOCUMENT_KEY**                                                           | 11 |

### Object Address
| Field              | Type   | Description                                                          | Mx. Charact. | 
|--------------------|--------|----------------------------------------------------------------------|--------------| 
| **city** *         | string | Address city                                                         | 100          |
| **state** *        | string | Address state (2 upper-case letters)                                 | 2            |
| **number** *       | string | Address number                                                       | 10           |
| **street** *       | string | Address street                                                       | 100          |
| **complement** *   | string | Address complement (free text)                                       | 100          |
| **postal_code** *  | string | Address CEP (http://www.buscacep.correios.com.br/sistemas/buscacep/) | 8            |
| **neighborhood** * | string | Address neighborhood                                                 | 100          |

### Object Phone
| Field              | Description | Example                                               | Max. Charact. | 
|--------------------|-------------|-------------------------------------------------------|---------------| 
| **number** *       | string      | Telephone number                                      | 10            |
| **area_code** *    | string      | Telefone DDD area code (https://ddd.guiamais.com.br/) | 2             |
| **country_code** * | string      | Telefone country code (https://ddi.guiamais.com.br/)  | 3             |

### Object Disbursement Bank Account

A debt emission must contain disbursement bank account informations in the same titularity as the creditor

| Field            | Type   | Description                                                             | Max. Charact. | 
|------------------|--------|-------------------------------------------------------------------------|---------------|
| name             | string | Creditor name                                                           | 50            |
| document_number  | string | Creditor document number                                                | 11            |
| bank_code *      | string | Bank Code (https://www.bcb.gov.br/pom/spb/estatistica/port/ASTR003.pdf) | 3             |
| branch_number *  | string | Branch number - Do NOT send the verification number                     | 4             |
| account_number * | string | Account number - Do NOT send the verification number                    | 10            |
| account_digit *  | string | Account verification number                                             | 1             |
| account_type     | enum   | [Enumerator Account Type](#enumerador-account-type) Account Type        | 1             |

### Object Financial

The financial object describes the credit operations financial information 

| Field                      | Type  | Description                                                                                      | Max. Charact. |
|----------------------------|-------|--------------------------------------------------------------------------------------------------|---------------|
| **amout**                  | float | Credit issue amount                                                                              | -             |
| **interest_type**          | object | **[Enumerator Interest Type](#enumerador-interest-type)** - Interest calculation enumerator      | -             |
| **credit_operation_type**  | object | **[Enumerator Credit Operation Type](#enumerador-credit-operation-type)** - credit operation type | -             |
| **annual_interest_rate**   | float | Pre-fixed anual interest rate                                                                    | -             |
| **disbursement_date**      | date  | Operation disbursement date                                                                      | -             |
| **interest_grace_period**  | int   | Interest grace period (in months)                                                                | -             |
| **principal_grace_period** | int   | Principal grace period                                                                           | -             |
| **number_of_installments** | int   | Credit operation installment number                                                              | -             |
| **fine_configuration**     | object | **[Object Fine Configuration](#object-fine-configuration)** - Fine configuration                 | -             |

### Object Fine Configuration

In the object fine configuration, the interest and fine values are set for this operation

| Field                  | Type  | Description                                                                           | Max. Charact. |
|------------------------|-------|---------------------------------------------------------------------------------------|---------------|
| **contract_fine_rate** | float | Default fine configuration                                                            | -             |
| **interest_base**      | enum  | **[Enumerator Interest Base](#enumerador-interest-base)** - Interest calculation base | -             |
| **monthly_rate**       | float | Monthly default rate                                                                  | -             |

### Object Refinanced Credit Operations 

| Field           | Type   | Description              | Characters |
|-----------------|--------|--------------------------|------------|
| `operation_key` | string | Refinanced operation key | uuid key   |

# Enumerators

### Enumerator _Person Type_
| Enumerator  | Description    |
|-------------|----------------|
| **legal**   | Legal person   |
| **natural** | Natural person |

### Enumerator _Account Type_
| Enumerator             | Description        |
|------------------------|--------------------|
| **checking_account**   | Checking account   |
| **deposit_account**    | Deposit account    |
| **guaranteed_account** | guaranteed account |
| **investment_account** | Investment account |
| **payment_account**    | Payment account    |
| **saving_account**     | Savings account    |
| **salary_account**     | Salary account            |

### Enumerator _Interest Type_
| Enumerator           | Description                                                                                                                                                            |
|----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **pre_price_days**   | Amortization method: Fixed installments with interest calculated daily                                                                                                 | 
| **pre_price**        | Amortization method: Fixed installments with fixed period calculations (30 days)                                                                                       |
| **pre_sac**          | Amortization method: Constant amortization with pre-fixed daily interest rate                                                                                          |
| **post_sac**         | Amortization method: Constant amortization with pre-fixed daily interest rate + post-fixed integrated benchmark (IPCA, CBD, ETC) calculated daily                      |
| **post_price**       | Amortization method: Fixed installments with pre-fixed daily interest rate + post-fixed integrated benchmark (IPCA, CBD, ETC) with fixed period calculations (30 days) |                                                                 |
| **post_price_days**  | Amortization method: Fixed installments with pre-fixed daily interest rate + post-fixed integrated benchmark (IPCA, CBD, ETC) calculated daily                         |

### Enumerator _Credit Operation Type_
| Enumerator    | Description                      |
|---------------|--------------------------------|
| **ccb**       | Cédula de Crédito Bancário     |
| **cce**       | Cédula de Crédito à Exportação |
| **cci**       | Cédula de Crédito Imobiliário  |
| **nce**       | Nota de Crédito à Exportação   |

### Enumerator _Interest Base_
| Enumerator            | Description              |
|-----------------------|--------------------------|
| **workdays**          | Interest basis: 252 days |
| **calendar_days**     | Interest basis: 360 days |
| **calendar_days_365** | Interest basis: 365 days |

### Enumerator _Fee Type_
Each enumerator type must be previously set and configured by QI Tech

| Enumerator            | Description                                    |
|-----------------------|------------------------------------------------|
| **tac**               | Opening fee                                    |
| **spread**            | Additional fee charged on credit operation     |
| **warranty_analysis** | Warranty analysis fee                          |
| **ted_fee**           | TED fee                                        |
| **spread_ted_fee**    | TED additional fee charged on credit operation |

## Response

STATUS 200

Response Body

```json
{
  "data": {
    "additional_iof": 469.1328,
    "annual_cet": "283,3821%",
    "assignment_amount": 124690.56,
    "base_iof": 473.6829374063069,
    "borrower": {
      "document_number": "96969879003",
      "name": "Alan Mathison Turing"
    },
    "cet": "11,8500%",
    "collaterals": [],
    "contract": {
      "number": "0000067563/AMT",
      "signature_information": [
        {
          "signature_url": null,
          "signer_document_number": "15627918004",
          "signer_email": "alan.turing@email.com",
          "signer_external_key": null,
          "signer_name": "Alan Mathison Turing",
          "signer_role": "issuer"
        }
      ],
      "urls": [
        "https://storage.googleapis.com/sandbox-doc-api/documents/5af36fcd-8e4c-4421-ad45-7bcba899c0d3/SYNGENTASANDBOX-ALAN_MATHISON_TURING-CCB-0000067563-20230302234816.pdf"
      ]
    },
    "contract_fee_amount": 1234.56,
    "contract_fees": [
      {
        "fee_amount": 1234.56,
        "fee_type": "tac"
      }
    ],
    "external_contract_fee_amount": 1234.56,
    "external_contract_fees": [
      {
        "fee_amount": 1234.56,
        "fee_type": "spread",
        "net_fee_amount": 1120.36,
        "tax_amount": 114.2
      }
    ],
    "installments": [
      {
        "accrual_reference_date": null,
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2023-04-03",
        "calendar_days": 31,
        "digitable_line": null,
        "due_date": "2023-04-02",
        "due_interest": 0,
        "due_principal": 123456,
        "fine_amount": null,
        "has_interest": true,
        "installment_history": [],
        "installment_key": "da264e95-2bbd-47de-876b-bfea7d25e266",
        "installment_number": 1,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 123456,
        "original_pre_fixed_amount": 13245.468714162304,
        "original_principal_amortization_amount": 58473.151285837695,
        "original_total_amount": 71718.62,
        "paid_amount": 0,
        "paid_at": null,
        "post_fixed_amount": 0,
        "pre_fixed_amount": 13245.468714162304,
        "principal_amortization_amount": 58473.151285837695,
        "qr_code_key": null,
        "qr_code_url": null,
        "renegotiation_proposal_key": null,
        "tax_amount": 148.63875056859942,
        "total_accrual_amount": null,
        "total_amount": 71718.62,
        "total_paid_amount": 0,
        "workdays": 21
      },
      {
        "accrual_reference_date": null,
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": null,
        "business_due_date": "2023-05-02",
        "calendar_days": 30,
        "digitable_line": null,
        "due_date": "2023-05-02",
        "due_interest": 0,
        "due_principal": 64982.848714162305,
        "fine_amount": null,
        "has_interest": true,
        "installment_history": [],
        "installment_key": "cac7064b-2310-45e1-a91f-5e8f39f0f0ea",
        "installment_number": 2,
        "installment_payment": [],
        "installment_status": "created",
        "installment_type": "principal",
        "original_due_principal": 64982.848714162305,
        "original_pre_fixed_amount": 6735.77577015044,
        "original_principal_amortization_amount": 64982.84422984956,
        "original_total_amount": 71718.62,
        "paid_amount": 0,
        "paid_at": null,
        "post_fixed_amount": 0,
        "pre_fixed_amount": 6735.77577015044,
        "principal_amortization_amount": 64982.84422984956,
        "qr_code_key": null,
        "qr_code_url": null,
        "renegotiation_proposal_key": null,
        "tax_amount": 325.0441868377075,
        "total_accrual_amount": null,
        "total_amount": 71718.62,
        "total_paid_amount": 0,
        "workdays": 19
      }
    ],
    "iof_charge_method": "financed",
    "issue_amount": 123456,
    "net_external_contract_fee_amount": 1120.36,
    "number_of_installments": 2,
    "prefixed_interest_rate": {
      "annual_rate": 2.32,
      "created_at": "2023-03-02T23:48:15",
      "daily_rate": 0.00329298,
      "interest_base": "calendar_days_365",
      "monthly_rate": 0.10516767
    },
    "requester_identifier_key": "1c2ca4dc-2a20-4dd4-bd5f-af143fadadf4",
    "total_iof": 942.82,
    "total_pre_fixed_amount": 19981.244484312745
  },
  "event_datetime": "2023-03-02 23:48:20",
  "key": "1c2ca4dc-2a20-4dd4-bd5f-af143fadadf4",
  "status": "waiting_signature",
  "webhook_type": "debt"
}
```

STATUS 400

Response Body

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

---

# Atualizar regra de movimentação automática

URL: /en/documentation/regras_de_movimentacao/atualizar_regra_movimentacao

## Request

ENDPOINT /baas/automatic_transfer/transfer_configuration
MÉTODO PUT

:::danger Desativar transferência automática:
- Para desativar uma transferência automática basta enviar o parâmetro 'is_active' com valor false
:::

**REGRA DIVISÃO PERCENTUAL**

**Request Body**
    

```json
{
        "transfer_cronstring": "*/5 * * * *",
        "automatic_transfer_key": "967c40ea-ba35-4445-89b1-fa35bd0749a4",
        "rule_configuration": {
          "destinations": [
            {
              "account_digit": "9",
              "financial_institutions_code_number": "063",
              "document_number": "48504807000198",
              "account_number": "1232046",
              "percentage": 100,
              "name": "Mateus Fonseca",
              "account_branch": "0931",
              "is_pix_transfer": false
            }
          ],
          "remaining_balance": 0
        },
        "is_active": false,
        "rule": "split_percentage"
}
```

### Body Params

| Campo                           | Tipo   | Descrição                                                                                 | Caracteres                                                  |
|---------------------------------|--------|-------------------------------------------------------------------------------------------|-------------------------------------------------------------|
| `transfer_cronstring`*          | string | Frequência de transferência do dinheiro em CRON, padrão que permite expressar recorrência. | **[CRON Guru](https://crontab.guru/#0_9_*_*_*)**            |
| `rule`*                         | enum   | Regra a ser seguida. (split_equal ou split_percentage).                                    | **[Enumeradores](#enumeradores-rule)**                      
| `rule_configuration`*           | object | Objeto de configuração da regra escolhida.                                                 | **[Objeto rule_configuration](#objeto-rule_configuration)** |
| `account_key`*                  | uuid   | Key da conta origem das transferências.                                                    | -                                                           |
| `automatic_transfer_key`*       | uuid   | Key da configuração a ser alterada.                                                        | -                                                           |

### Obejto rule_configuration

| Campo          | Tipo | Descrição | Caracteres                                       |
|----------------|---| ---|--------------------------------------------------|
| `destinations` | object | Contas destino e outros dados. | **[Array of destination](#objeto-destinations)** |
| `remaining_balance` | float  | Valor de saldo que irá permanecer na conta.                                               | -                                                           |

### Objeto destinations

| Campo | Tipo    | Descrição                                                                                            | Caracteres |
|---|---------|------------------------------------------------------------------------------------------------------|------------|
| `account_branch`* | string  | Agência da conta destino.                                                                            | 3          |
| `account_number`* | string  | Número da conta destino.                                                                             | 3          |
| `account_digit`* | string  | Dígito da conta destino.                                                                             | 3          |
| `document_number`* | string  | Número do documento do dono da conta.                                                                | 3          |
| `name`* | string  | Nome da pessoa física ou razão social da pessoa jurídica.                                            | 3          |
| `financial_institutions_code_number`* | string  | Código COMPE da instituição financeira (https://www.bcb.gov.br/pom/spb/estatistica/port/ASTR003.pdf) | 3          |
| `financial_institutions_ispb`* | string  | Número ISPB da instituição financeira.                                                               | 8          |
| `is_pix_transfer`* | boolean | Define se a transferência será va pix.                                                               | -          |
| `percentage`* | float   | Porcentagem a ser destinada a essa conta.                                                            | -          |

### Enumeradores rule 

| Enumerador         | Tradução                                  |
|--------------------|-------------------------------------------|
| **split_percentage**   | [divisão percentual](./regras_de_movimentacao.md) |
| **split_equal**        | [divisão igual](./regras_de_movimentacao.md) |
| **single_beneficiary** | [beneficiário único](./regras_de_movimentacao.md) |

## Response

STATUS 200

**Response Body**

```json
{
  "automatic_transfer_key": "967c40ea-ba35-4445-89b1-fa35bd0749a4",
  "is_active": false,
  "rule": "split_percentage",
  "rule_configuration": {
    "destinations": [
      {
        "account_branch": "0931",
        "account_digit": "9",
        "account_number": "1232046",
        "document_number": "48504807000198",
        "financial_institutions_code_number": "063",
        "is_pix_transfer": false,
        "name": "Mateus Fonseca",
        "percentage": 100
      }
    ],
    "remaining_balance": 0
  },
  "transfer_cronstring": "*/5 * * * *"
}

```

**REGRA DIVISÃO IGUALITÁRIA**

**Request Body**
    

```json
{
        "transfer_cronstring": "*/5 * * * *",
        "automatic_transfer_key": "967c40ea-ba35-4445-89b1-fa35bd0749a4",
        "rule_configuration": {
          "destinations": [
            {
              "account_digit": "9",
              "financial_institutions_code_number": "063",
              "document_number": "48504807000198",
              "account_number": "1232046",
              "name": "Mateus Fonseca",
              "account_branch": "0931"
            }
          ],
          "remaining_balance": 0
        },
        "is_active": false,
        "rule": "split_equal"
}
```

### Body Params

| Campo | Tipo   | Descrição                                                                              | Caracteres                                                  |
|---|--------|----------------------------------------------------------------------------------------|-------------------------------------------------------------|
| `transfer_cronstring`* | string | Frequência de transferência do dinheiro em CRON, padrão que permite expressar recorrência. | **[CRON Guru](https://crontab.guru/#0_9_*_*_*)**            |
| `rule`* | enum   | Regra a ser seguida. (split_equal ou split_percentage).                                | **[Enumeradores](#enumeradores-rule)**                      
| `rule_configuration`*| object | Objeto de configuração da regra escolhida.                                             | **[Objeto rule_configuration](#objeto-rule_configuration)** |
| `account_key`*| uuid   | Key da conta origem das transferências.                                               | -                                                           |
| `automatic_transfer_key`*| uuid   | Key da configuração a ser alterada.                                                   | -                                                           |

### Obejto rule_configuration

| Campo          | Tipo | Descrição | Caracteres                                       |
|----------------|---| ---|--------------------------------------------------|
| `destinations` | object | Contas destino e outros dados. | **[Array of destination](#objeto-destinations)** |
| `remaining_balance` | float  | Valor de saldo que irá permanecer na conta.                                                | -                                                           |

### Objeto destinations

| Campo | Tipo   | Descrição | Caracteres |
|---|--------| ---|------------|
| `account_branch`* | string |  Agência da conta destino. | 3          |
| `account_number`* | string | Número da conta destino. | -          |
| `account_digit`* | string | Dígito da conta destino. | 3          |
| `document_number`* | string | Número do documento do dono da conta. | -          |
| `name`* | string | Nome da pessoa física ou razão social da pessoa jurídica. | 3          |
| `financial_institutions_code_number`* | string | Código COMPE da instituição financeira (https://www.bcb.gov.br/pom/spb/estatistica/port/ASTR003.pdf) | 3          |
| `financial_institutions_ispb`* | string | Número ISPB da instituição financeira. | 8          |

### Enumeradores rule 

| Enumerador         | Tradução                                  |
|--------------------|-------------------------------------------|
| **split_percentage**   | [divisão percentual](./regras_de_movimentacao.md) |
| **split_equal**        | [divisão igual](./regras_de_movimentacao.md) |
| **single_beneficiary** | [beneficiário único](./regras_de_movimentacao.md) |

## Response

STATUS 200

**Response Body**

```json
{
  "automatic_transfer_key": "967c40ea-ba35-4445-89b1-fa35bd0749a4",
  "is_active": false,
  "rule": "split_equal",
  "rule_configuration": {
    "destinations": [
      {
        "account_branch": "0931",
        "account_digit": "9",
        "account_number": "1232046",
        "document_number": "48504807000198",
        "financial_institutions_code_number": "063",
        "name": "Mateus Fonseca"
      }
    ],
    "remaining_balance": 0
  },
  "transfer_cronstring": "*/5 * * * *"
}

```

**REGRA BENEFICIÁRIO ÚNICO**

**Request Body**
    

```json
{
        "transfer_cronstring": "*/5 * * * *",
        "automatic_transfer_key": "967c40ea-ba35-4445-89b1-fa35bd0749a4",
        "rule_configuration": {
          "destination": 
            {
              "account_digit": "9",
              "financial_institutions_code_number": "063",
              "document_number": "48504807000198",
              "account_number": "1232046",
              "name": "Mateus Fonseca",
              "account_branch": "0931"
            },
          "remaining_balance": 0
        },
        "is_active": false,
        "rule": "single_beneficiary"
}
```

### Body Params

| Campo | Tipo   | Descrição                                                                                  | Caracteres                                                  |
|---|--------|--------------------------------------------------------------------------------------------|-------------------------------------------------------------|
| `transfer_cronstring`* | string | Frequência de transferência do dinheiro em CRON, padrão que permite expressar recorrência. | **[CRON Guru](https://crontab.guru/#0_9_*_*_*)**            |
| `rule`* | enum   | Regra a ser seguida. (split_equal ou split_percentage).                                    | **[Enumeradores](#enumeradores-rule)**                      
| `rule_configuration`*| object | Objeto de configuração da regra escolhida.                                                 | **[Objeto rule_configuration](#objeto-rule_configuration)** |
| `account_key`*| uuid   | Key da conta origem das transferências.                                                   | -                                                           |
| `automatic_transfer_key`*| uuid   | Key da configuração a ser alterada.                                                   | -                                                           |

### Obejto rule_configuration

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `destination` | object | Contas destino e outros dados. | **[destination](#objeto-destinations)**  |
| `remaining_balance` | float  | Valor de saldo que irá permanecer na conta.                                                | -                                                           |

### Objeto destination

| Campo | Tipo   | Descrição | Caracteres |
|---|--------| ---| ---|
| `account_branch`* | string |  Agência da conta destino. | 3 |
| `account_number`* | string | Número da conta destino. | 3 |
| `account_digit`* | string | Dígito da conta destino. | 3 |
| `document_number`* | string | Número do documento do dono da conta. | 3 |
| `name`* | string | Nome da pessoa física ou razão social da pessoa jurídica. | 3 |
| `financial_institutions_code_number`* | string | Código COMPE da instituição financeira (https://www.bcb.gov.br/pom/spb/estatistica/port/ASTR003.pdf) | 3 |
| `financial_institutions_ispb`* | string | Número ISPB da instituição financeira. | 8 |

### Enumeradores rule 

| Enumerador         | Tradução                                  |
|--------------------|-------------------------------------------|
| **split_percentage**   | [divisão percentual](./regras_de_movimentacao.md) |
| **split_equal**        | [divisão igual](./regras_de_movimentacao.md) |
| **single_beneficiary** | [beneficiário único](./regras_de_movimentacao.md) |

## Response

STATUS 200
**Response Body**

```json
{
  "automatic_transfer_key": "967c40ea-ba35-4445-89b1-fa35bd0749a4",
  "is_active": false,
  "rule": "single_beneficiary",
  "rule_configuration": {
    "destination": {
      "account_branch": "0931",
      "account_digit": "9",
      "account_number": "1232046",
      "document_number": "48504807000198",
      "financial_institutions_code_number": "063",
      "name": "Mateus Fonseca"
    },
    "remaining_balance": 0
  },
  "transfer_cronstring": "*/5 * * * *"
}

```

STATUS 400
**Response Body**

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

---

# Criar regra de movimentação automática

URL: /en/documentation/regras_de_movimentacao/criar_regra_de_movimentacao

## Request

ENDPOINT /baas/automatic_transfer/transfer_configuration
MÉTODO POST
**REGRA DIVISÃO PERCENTUAL**

**Request Body**
    

```json
{
        "transfer_cronstring": "*/5 * * * *",
        "account_key": "6203037b-4405-4602-b7ce-ff99806d9cb0",
        "rule_configuration": {
          "destinations": [
            {
              "account_digit": "9",
              "financial_institutions_code_number": "063",
              "document_number": "48504807000198",
              "account_number": "1232046",
              "percentage": 100,
              "name": "Mateus Fonseca",
              "account_branch": "0931",
              "is_pix_transfer": false
            }
          ],
          "remaining_balance": 0
        },
        "is_active": true,
        "rule": "split_percentage"
}
```

### Body Params

| Campo                | Tipo   | Descrição                                                                                 | Caracteres                                                  |
|----------------------|--------|-------------------------------------------------------------------------------------------|-------------------------------------------------------------|
| `transfer_cronstring`* | string | Frequência de transferência do dinheiro em CRON, padrão que permite expressar recorrência. | **[CRON Guru](https://crontab.guru/#0_9_*_*_*)**            |
| `rule`*              | enum   | Regra a ser seguida. (split_equal ou split_percentage).                                    | **[Enumeradores](#enumeradores-rule)**                      
| `rule_configuration`* | object | Objeto de configuração da regra escolhida.                                                 | **[Objeto rule_configuration](#objeto-rule_configuration)** |
| `account_key`*       | uuid   | Key da conta origem das transferências.                                                    | -                                                           |

### Obejto rule_configuration

| Campo          | Tipo | Descrição | Caracteres                                       |
|----------------|---| ---|--------------------------------------------------|
| `destinations` | object | Contas destino e outros dados. | **[Array of destination](#objeto-destinations)** |
| `remaining_balance` | float  | Valor de saldo que irá permanecer na conta.                                               | -                                                           |

### Objeto destinations

| Campo | Tipo    | Descrição                                                                                            | Caracteres |
|---|---------|------------------------------------------------------------------------------------------------------|------------|
| `account_branch`* | string  | Agência da conta destino.                                                                            | 3          |
| `account_number`* | string  | Número da conta destino.                                                                             | 3          |
| `account_digit`* | string  | Dígito da conta destino.                                                                             | 3          |
| `document_number`* | string  | Número do documento do dono da conta.                                                                | 3          |
| `name`* | string  | Nome da pessoa física ou razão social da pessoa jurídica.                                            | 3          |
| `financial_institutions_code_number`* | string  | Código COMPE da instituição financeira (https://www.bcb.gov.br/pom/spb/estatistica/port/ASTR003.pdf) | 3          |
| `financial_institutions_ispb`* | string  | Número ISPB da instituição financeira.                                                               | 8          |
| `is_pix_transfer`* | boolean | Define se a transferência será va pix.                                                               | -          |
| `percentage`* | float   | Porcentagem a ser destinada a essa conta.                                                            | -          |

### Enumeradores rule 

| Enumerador         | Tradução                                  |
|--------------------|-------------------------------------------|
| **split_percentage**   | [divisão percentual](./regras_de_movimentacao.md) |
| **split_equal**        | [divisão igual](./regras_de_movimentacao.md) |
| **single_beneficiary** | [beneficiário único](./regras_de_movimentacao.md) |

## Response

STATUS 200

**Response Body**

```json

{
  "account_key": "6203037b-4405-4602-b7ce-ff99806d9cb0",
  "automatic_transfer_key": "9284ef1d-3689-4bb0-8543-89fffab790a1",
  "rule": "split_percentage",
  "rule_configuration": {
    "destinations": [
      {
        "account_branch": "0931",
        "account_digit": "9",
        "account_number": "1232046",
        "document_number": "48504807000198",
        "financial_institutions_code_number": "063",
        "is_pix_transfer": false,
        "name": "Mateus Fonseca",
        "percentage": 100
      }
    ],
    "remaining_balance": 0
  },
  "status": "active",
  "transfer_cronstring": "*/5 * * * *"
}

```

**REGRA DIVISÃO IGUALITÁRIA**

**Request Body**
    

```json
{
        "transfer_cronstring": "*/5 * * * *",
        "account_key": "6203037b-4405-4602-b7ce-ff99806d9cb0",
         "rule_configuration": {
          "destinations": [
            {
              "account_digit": "9",
              "financial_institutions_code_number": "063",
              "document_number": "48504807000198",
              "account_number": "1232046",
              "name": "Mateus Fonseca",
              "account_branch": "0931"
            }
          ],
          "remaining_balance": 0
        },
        "is_active": true,
        "rule": "split_equal"
}
```

### Body Params

| Campo | Tipo   | Descrição                                                                                  | Caracteres                                                  |
|---|--------|--------------------------------------------------------------------------------------------|-------------------------------------------------------------|
| `transfer_cronstring`* | string | Frequência de transferência do dinheiro em CRON, padrão que permite expressar recorrência. | **[CRON Guru](https://crontab.guru/#0_9_*_*_*)**            |
| `rule`* | enum   | Regra a ser seguida. (split_equal ou split_percentage).                                    | **[Enumeradores](#enumeradores-rule)**                      
| `rule_configuration`*| object | Objeto de configuração da regra escolhida.                                                 | **[Objeto rule_configuration](#objeto-rule_configuration)** |
| `account_key`*| uuid   | Key da conta origem das transferências.                                                   | -                                                           |

### Obejto rule_configuration

| Campo          | Tipo | Descrição | Caracteres                                       |
|----------------|---| ---|--------------------------------------------------|
| `destinations` | object | Contas destino e outros dados. | **[Array of destination](#objeto-destinations)** |
| `remaining_balance` | float  | Valor de saldo que irá permanecer na conta.                                                | -                                                           |

### Objeto destinations

| Campo | Tipo   | Descrição | Caracteres |
|---|--------| ---|------------|
| `account_branch` * | string |  Agência da conta destino. | 3          |
| `account_number` * | string | Número da conta destino. | -          |
| `account_digit` * | string | Dígito da conta destino. | 3          |
| `document_number` * | string | Número do documento do dono da conta. | -          |
| `name` * | string | Nome da pessoa física ou razão social da pessoa jurídica. | 3          |
| `financial_institutions_code_number` * | string | Código COMPE da instituição financeira (https://www.bcb.gov.br/pom/spb/estatistica/port/ASTR003.pdf) | 3          |
| `financial_institutions_ispb` * | string | Número ISPB da instituição financeira. | 8          |

### Enumeradores rule 

| Enumerador         | Tradução                                  |
|--------------------|-------------------------------------------|
| **split_percentage**   | [divisão percentual](./regras_de_movimentacao.md) |
| **split_equal**        | [divisão igual](./regras_de_movimentacao.md) |
| **single_beneficiary** | [beneficiário único](./regras_de_movimentacao.md) |

## Response

STATUS 200

**Response Body**

```json
{
  "account_key": "6203037b-4405-4602-b7ce-ff99806d9cb0",
  "automatic_transfer_key": "d39fba5b-dec7-4773-9bba-120e9f61ffa0",
  "rule": "split_equal",
  "rule_configuration": {
    "destinations": [
      {
        "account_branch": "0931",
        "account_digit": "9",
        "account_number": "1232046",
        "document_number": "48504807000198",
        "financial_institutions_code_number": "063",
        "name": "Mateus Fonseca"
      }
    ],
    "remaining_balance": 0
  },
  "status": "active",
  "transfer_cronstring": "*/5 * * * *"
}

```

**REGRA BENEFICIÁRIO ÚNICO**

**Request Body**
    

```json
{
        "transfer_cronstring": "*/5 * * * *",
        "rule_configuration": {
          "destination": 
            {
              "account_digit": "9",
              "financial_institutions_code_number": "063",
              "document_number": "48504807000198",
              "account_number": "1232046",
              "name": "Mateus Fonseca",
              "account_branch": "0931"
            },
          "remaining_balance": 0
        },
        "is_active": false,
        "rule": "single_beneficiary"
}
```

### Body Params

| Campo | Tipo   | Descrição                                                                                  | Caracteres                                                  |
|---|--------|--------------------------------------------------------------------------------------------|-------------------------------------------------------------|
| `transfer_cronstring`* | string | Frequência de transferência do dinheiro em CRON, padrão que permite expressar recorrência. | **[CRON Guru](https://crontab.guru/#0_9_*_*_*)**            |
| `rule`* | enum   | Regra a ser seguida. (split_equal ou split_percentage).                                    | **[Enumeradores](#enumeradores-rule)**                      
| `rule_configuration`*| object | Objeto de configuração da regra escolhida.                                                 | **[Objeto rule_configuration](#objeto-rule_configuration)** |
| `account_key`*| uuid   | Key da conta origem das transferências.                                                   | -                                                           |

### Obejto rule_configuration

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `destination` | object | Contas destino e outros dados. | **[destination](#objeto-destinations)**  |
| `remaining_balance` | float  | Valor de saldo que irá permanecer na conta.                                                | -                                                           |

### Objeto destination

| Campo | Tipo   | Descrição | Caracteres |
|---|--------| ---| ---|
| `account_branch`* | string |  Agência da conta destino. | 3 |
| `account_number`* | string | Número da conta destino. | 3 |
| `account_digit`* | string | Dígito da conta destino. | 3 |
| `document_number`* | string | Número do documento do dono da conta. | 3 |
| `name`* | string | Nome da pessoa física ou razão social da pessoa jurídica. | 3 |
| `financial_institutions_code_number`* | string | Código COMPE da instituição financeira (https://www.bcb.gov.br/pom/spb/estatistica/port/ASTR003.pdf) | 3 |
| `financial_institutions_ispb`* | string | Número ISPB da instituição financeira. | 8 |

### Enumeradores rule 

| Enumerador         | Tradução                                  |
|--------------------|-------------------------------------------|
| **split_percentage**   | [divisão percentual](./regras_de_movimentacao.md) |
| **split_equal**        | [divisão igual](./regras_de_movimentacao.md) |
| **single_beneficiary** | [beneficiário único](./regras_de_movimentacao.md) |

## Response

STATUS 200

**Response Body**

```json
{
  "is_active": false,
  "rule": "single_beneficiary",
  "rule_configuration": {
    "destination": {
      "account_branch": "0931",
      "account_digit": "9",
      "account_number": "1232046",
      "document_number": "48504807000198",
      "financial_institutions_code_number": "063",
      "name": "Mateus Fonseca"
    },
    "remaining_balance": 0
  },
  "transfer_cronstring": "*/5 * * * *"
}

```

STATUS 400
**Response Body**

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

---

# Regras de movimentação

URL: /en/documentation/regras_de_movimentacao/

No momento da abertura de uma conta QI Tech, disponibilizamos aos nossos clientes a possibilidade de criar regras de movimentação para a conta. Estas regras visam facilitar operações repetivias, por exemplo, a transferência de todo ou parte do saldo da conta ao final do dia. Aqui iremos exemplificar as diferenças entre as principais regras presentes em nosso sistema: "split_equal", "split_percentage". Caso o cliente tenha uma regra que não se enquadre nestas duas ele pode solicitar ao nosso time durante sua integração a criação de uma regra em nosso sistema que atenda suas necessidades.

### REGRA DIVISÃO PERCENTUAL (SPLIT_PERCENTAGE)

A regra de divisão percentual divide o saldo disponível em conta percentualmente para as contas destino, na periocidade escolhida em "transfer_cronstring". A soma dos percentuais de cada conta destino pode ser menor ou igual a 100. Caso a soma das porcentagens seja menor que 100, a porcentagem faltante ficará como saldo na conta. Assim, o cliente pode escolher transferir, por exemplo, 80% do dinheiro entre contas e deixar sempre 20% de saldo.

### REGRA DIVISÃO IGUALITÁRIA (SPLIT_EQUAL)

A regra de divisão igualitária divide igualmente o saldo disponível em conta para as contas destino, na periocidade escolhida em "transfer_cronstring", deixando apenas o valor definido em "remaining_balance" como saldo. Caso o campo "remaining_balance" não seja preenchido, 100% do saldo da conta é transferido. Caso o saldo disponível em conta seja igual ou menor do que "remaining_balance", a transação não ocorre.

### REGRA BENEFICIÁRIO ÚNICO (SINGLE_BENEFICIARY)

A regra de divisão para beneficiário único permite a transferência para um único beneficiário, na periocidade escolhida em "transfer_cronstring".

---

# Cancelar uma renegociação

URL: /en/documentation/renegociacao/cancelar_uma_renegociacao

## Request

ENDPOINT /renegotiation/proposal/ PROPOSAL-KEY
METHOD DELETE

### Path Params

| Field            | Type   | Description                | Characters |
|------------------|--------|----------------------------|------------|
| `proposal_key` * | string | Renegotiation proposal key | uuid key   |  

## Response

STATUS 200

Response Body

```json
{

}
```

STATUS 400

Response Body

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

---

# Consult a renegotiation

URL: /en/documentation/renegociacao/consultar_uma_renegociacao

## Request

ENDPOINT /renegotiation/proposal/ PROPOSAL-KEY
METHOD GET

### Path params

| Field            | Type   | Description                | Characters |
|------------------|--------|----------------------------|------------|   
| `proposal_key` * | string | Renegotiation proposal key | uuid key   |
 

 ## Response

STATUS 200

Response Body

```json
{
  "proposal_key": "bcc16a6d-ce21-4cd4-8d8c-d26f89ccc685",
  "contract_number": "ABCD/1",
  "proposal_status": "pending_payment",
  "amortization_type": "installment_payment",
  "discount_percentage": 0.2,
  "payment_amount": 240,
  "requester_name": "Requester",
  "requester_key": "bcc16a6d-ce21-4cd4-8d8c-d26f89ccc685",
  "issuer_name": "issuer",
  "reference_date": "2022-07-20",
  "proposal_due_date": "2022-07-20",
  "issuer_document_number": "98765432100",
  "payment_type": "bank_slip",
  "payment": {
    "digitable_line": "",
    "qr_code_url": {},
    "qr_code_key": "",
    "bank_slip_key": "",
    "paid_method_type": null
  },
  "affected_installments": [
    {
      "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88",
      "due_date": "2022-05-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125,
      "present_amount": 100,
      "paid_amount": 80
    },
    {
      "installment_key": "6597a073-ea7a-4447-b250-f4d3f07b0b74",
      "due_date": "2022-06-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125,
      "present_amount": 100,
      "paid_amount": 80
    },
    {
      "installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18900",
      "due_date": "2022-07-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125,
      "present_amount": 100,
      "paid_amount": 80
    }
  ],
  "remaining_installments": [
    {
      "installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18903",
      "due_date": "2022-08-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125
    },
    {
      "installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18904",
      "due_date": "2022-09-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125
    },
    {
      "installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18905",
      "due_date": "2022-10-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125
    }
  ]
}
```

STATUS 400

Response Body

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

---

# Renegotiation Creation

URL: /en/documentation/renegociacao/criacao_de_uma_renegociacao

## Request

ENDPOINT /renegotiation/proposal
METHOD POST

Request Body

**Using installment keys**

```json
{
  "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
  "payment_type": "bank_slip",
  "amortization_type": "installment_payment",
  "reference_date": "2022-07-20",
  "proposal_due_date": "2022-07-20",
  "discount_percentage": 0.2,
  "discount_amount": 100,
  "request_control_key": "3571e292-3a83-4011-904d-20ee963022ef",
  "installments": [
    {
      "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88"
    },
    {
      "installment_key": "0ff87136-b084-44fb-8fc2-d2e3beed483b"
    },
    {
      "installment_key": "e4101c6a-51b3-435f-a2b7-4a65a005cc15"
    }
  ]
}
```

**Using number of installments**

```json
{ 
  "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
  "payment_type": "bank_slip",
  "amortization_type": "first_installments",
  "reference_date": "2022-07-20",
  "proposal_due_date": "2022-07-20",
  "discount_percentage": 0.2,
  "discount_amount": 100,
  "request_control_key": "3571e292-3a83-4011-904d-20ee963022ef",
  "number_of_installments": 4
}
```

**Using final value**

```json
{ 
  "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
  "payment_type": "bank_slip",
  "amortization_type": "first_installments",
  "reference_date": "2022-07-20",
  "proposal_due_date": "2022-07-20",
  "discount_percentage": 0.2,
  "discount_amount": 100,
  "request_control_key": "3571e292-3a83-4011-904d-20ee963022ef",
  "payment_amount": 900
}
```

:::warning Warning
 The `discount_amount` and `discount_percentage` may **NOT** be used simultaneously.
:::

### Body Params

| Field                 | Type             | Description                                         | Characters                                        |
|-----------------------|------------------|-----------------------------------------------------|---------------------------------------------------|  
| `contract_number`     | string           | Contract Number                                     | 10                                                |
| `amortization_type`   | string           | Amortization Type                                   | **[Enumerators](#enumerators amortization_type)** |
| `reference_date`      | string           | Renegotiation reference date                        | 10                                                |
| `proposal_due_date`   | string           | Renegotiation proposal due date                     | 10                                                |
| `discount_percentage` | string           | Percentual discount added on installment face value | 10                                                |
| `payment_type`        | string           | Payment type                                        | **[Enumerators](#enumeradores-payment_type)**     |
| `installments`        | array of objects | Renegotiated installments                           | **[Installments Object](#installments-object)**   |

### Installments Object

| Field             | Type   | Description                  | Characters |
|-------------------|--------|------------------------------|------------|
| `installment_key` | string | Renegotiated installment key | uuid key   |

### Enumerators amortization_type

| Field               | Description                    | 
|---------------------|--------------------------------|
| installment_payment | Installment payment enumerator | 

### Enumeradores payment_type

| Field    | Description      | 
|----------|------------------|
| banklisp | Bankslip Payment | 
| manual   | Manual payment   | 
| pix      | Pix Payment      | 

## Response

STATUS 200

Response Body

```json
{
  "proposal_key": "bcc16a6d-ce21-4cd4-8d8c-d26f89ccc685",
  "contract_number": "ABCD/1",
  "proposal_status": "pending_payment",
  "amortization_type": "installment_payment",
  "discount_percentage": 0.2,
  "payment_amount": 240,
  "requester_name": "Requester",
  "requester_key": "bcc16a6d-ce21-4cd4-8d8c-d26f89ccc685",
  "issuer_name": "issuer",
  "reference_date": "2022-07-20",
  "proposal_due_date": "2022-07-20",
  "issuer_document_number": "98765432100",
  "payment_type": "bank_slip",
  "payment": {
    "digitable_line": "",
    "qr_code_url": {},
    "qr_code_key": "",
    "bank_slip_key": "",
    "paid_method_type": null
  },
  "affected_installments": [
    {
      "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88",
      "due_date": "2022-05-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125,
      "present_amount": 100,
      "paid_amount": 80
    },
    {
      "installment_key": "6597a073-ea7a-4447-b250-f4d3f07b0b74",
      "due_date": "2022-06-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125,
      "present_amount": 100,
      "paid_amount": 80
    },
    {
      "installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18900",
      "due_date": "2022-07-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125,
      "present_amount": 100,
      "paid_amount": 80
    }
  ],
  "remaining_installments": [
    {
      "installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18903",
      "due_date": "2022-08-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125
    },
    {
      "installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18904",
      "due_date": "2022-09-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125
    },
    {
      "installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18905",
      "due_date": "2022-10-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125
    }
  ]
}
```

STATUS 400

Response Body

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

---

# Renegociação internal e external

URL: /en/documentation/renegociacao/criacao_renegociacao_internal

## Request 

ENDPOINT /renegotiation/proposal
MÉTODO POST

Request Body

**Usando valor de amortização**

```json
{
  "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
  "payment_type": "bank_slip",
  "amortization_type": "last_installments",
  "request_control_key": "e5f6c3d4-e5f6-7890-abcd-ef1234567890",
  "reference_date": "2022-07-20",
  "proposal_due_date":"2022-07-22",
  "payment_amount":500.00,
  "include_maturity_installment": true
}
```

**Usando método external e last_installments**

```json
{
  "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
  "payment_type": "external",
  "amortization_type": "last_installments",
  "request_control_key": "e5f6c3d4-e5f6-7890-abcd-ef1234567890",
  "reference_date": "2022-07-20",
  "transaction_key":"a1b2c3d4-7890-e5f6-abcd-ef17890a7890",
  "bank_slip_key":"a1b2c3d4-7890-e5f6-abcd-ef17890a7890",
  "include_maturity_installment": true
}
```

**Usando método external e first_installments**

```json
{
  "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
  "payment_type": "external",
  "amortization_type": "overdue_installments",
  "request_control_key": "e5f6c3d4-e5f6-7890-abcd-ef1234567890",
  "reference_date": "2022-07-20",
  "transaction_key":"a1b2c3d4-7890-e5f6-abcd-ef17890a7890",
  "bank_slip_key":"a1b2c3d4-7890-e5f6-abcd-ef17890a7890",
  "include_maturity_installment": true
}
```

**Usando método internal e installment_payment**

```json
{
  "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
  "payment_type": "internal",
  "amortization_type": "installment_payment",
  "request_control_key": "e5f6c3d4-e5f6-7890-abcd-ef1234567890",
  "reference_date": "2022-07-20",
  "account_key": "5ae72355-1e47-4624-9915-ceb93d872194",
  "installments": [
    {
      "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88"
    },
    {
      "installment_key": "0ff87136-b084-44fb-8fc2-d2e3beed483b"
    },
    {
      "installment_key": "e4101c6a-51b3-435f-a2b7-4a65a005cc15"
    }
  ]
}
```

## Amortization_type last_installments

Este tipo de amortização pode ser utilizado com o payment_type bank_slip junto à um valor de saldo a ser amortizado, ou junto ao método external adicionando as informações da transação.

O método irá utilizar o saldo do pagamento para amortizar as parcelas na seguinte ordem:

#### 1. Parcelas vencidas
#### 2. Primeira parcela não vencida em aberto (caso seja enviada a flag include_maturity_installment)
#### 3. Últimas parcelas em aberto

Todas as parcelas serão calculadas na data de referência enviada no campo reference_date.

## payment_type external

Este método de pagamento deve sempre vir acompanhado do campo transaction_key e caso a transação seja referente à um pagamento de boleto, deve vir acompanhada da chave bank_slip_key.

Este método de pagamento deve vir acompanhado dos seguintes amortization_types:

#### 1. overdue_installments
#### 2. last_installments

Caso seja utilizado o método overdue_installments e o valor de amortização seja maior do que o valor de quitação das parcelas vencidas, o valor remanescente será enviado ao fundo como devolução.

Caso seja utilizado o método last_installments e o valor de amortização seja maior do que o valor de quitação de toda a operação, o valor remanescente será enviado ao fundo como devolução.

## payment_type internal

Este tipo de pagamento pode ser utilizado com qualquer tipo de amortização, ao invés de ser gerado um boleto ou um pix, o pagamento movimentará o valor financeiro da amortização (calculado ou informado, dependendo do tipo de amortização) da conta informada pelo parâmetro source_account_key. 

A movimentação enviará o financeiro para conta de conciliação das baixas de renegociação de titularidade QI, ou para conta de titularidade do credor da dívida. 

As configurações da conta de origem e destino da movimentação devem ser alinhadas com o time de operações.

### Body Params

| Campo | Tipo | Descrição                                                                                                                         | Caracteres                                                            |
|---    |---   |-----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|  
| `debt_key`                        | string | Chave única da operação de crédito dentro da QI.                                                                                  | UUID                                                                  |
| `payment_type`                    | string | Tipo de pagamento.                                                                                                                | Enumeradores Payment Type           |
| `amortization_type`               | string | Tipo de amortização.                                                                                                              | Enumeradores Amortization Type |
| `reference_date`                  | string | Data referencia a qual valor presente será calculado da renegociação (precisa ser D+1).                                           | 10                                                                    |
| `proposal_due_date`               | string | Data referencia a qual valor presente será calculado da renegociação (precisa ser D+1).                                           | 10                                                                    |
| `request_control_key`             | string | Chave de controle da requisição para rastreamento e identificação única.                                                          | UUID                                                                  |
| `transaction_key`                 | string | Chave de controle da transação referente à liquidação na conta do fundo.                                                          | UUID                                                                  |
| `bank_slip_key`                   | string | Chave de controle da transação referente à liquidação na conta do fundo.                                                          | UUID                                                                  |
| `include_maturity_installment`    | boolean| Flag que indica se deve ser adicionada a primeira parcela não vencida no cálculo da amortização                                   | true ou false                                                         |

## Response

STATUS 201

Response Body

```json
{
  "contract_number": "0001232093/ABC",
  "proposal_key": "bcc16a6d-ce21-4cd4-8d8c-d26f89ccc685",
  "request_control_key": "3571e292-3a83-4011-904d-20ee963022ef",
  "proposal_status": "pending_payment",
  "amortization_type": "installment_payment",
  "discount_percentage": 0.2,
  "payment_amount": 300,
  "requester_name": "Requester",
  "requester_key": "bcc16a6d-ce21-4cd4-8d8c-d26f89ccc685",
  "issuer_name": "issuer",
  "reference_date": "2022-07-20",
  "proposal_due_date": "2022-07-20",
  "issuer_document_number": "98765432100",
  "payment_type": "bank_slip",
  "origin_key": "76912b4b-508a-4b10-9485-0e87f1316b35",
  "payment": {
    "digitable_line": "32990001031000700298993000000203110340000004618",
    "qr_code_url": "mockurl.com.br",
    "qr_code_key": "f02c201d-314e-42be-968c-a48776d98fbf",
    "bank_slip_key": "931a989d-66e9-4631-abaa-b413610afb85",
    "paid_method_type": "bank_slip"
  },
  "affected_installments": [
    {
      "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88",
      "due_date": "2023-01-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125,
      "present_amount": 100,
      "paid_amount": 80
    },
    {
      "installment_key": "0ff87136-b084-44fb-8fc2-d2e3beed483b",
      "due_date": "2022-12-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125,
      "present_amount": 100,
      "paid_amount": 80
    },
    {
      "installment_key": "e4101c6a-51b3-435f-a2b7-4a65a005cc15",
      "due_date": "2022-11-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125,
      "present_amount": 100,
      "paid_amount": 80
    }
  ],
  "remaining_installments": [
    {
      "installment_key": "03b4d86a-9dba-40fc-a4db-33e8772b7be8",
      "due_date": "2022-08-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125
    },
    {
      "installment_key": "c622efa6-8731-464b-a563-a7a26c19279d",
      "due_date": "2022-09-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125
    },
    {
      "installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18905",
      "due_date": "2022-10-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125
    }
  ]
}
```

STATUS 400

Response Body

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

---

# List renegotiations

URL: /en/documentation/renegociacao/listar_renegociacoes

## Request

ENDPOINT /renegotiation/proposal
METHOD GET

### Query Params

| Field                    | Type   | Description             | Characters |
|--------------------------|--------|-------------------------|------------|   
| `proposal_status`        | string | Proposal current status | 10         |
| `contract_number`        | string | Contract Number         | 10         |
| `issuer_document_number` | string | Issuer document number  | 10         |

 ## Response

STATUS 200

Response Body

```json
{
  "data": [],
  "pagination": {
    "current_page": 1,
    "next_page": 2,
    "rows_per_page": 30,
    "total_pages": 5,
    "total_rows": 140
  }
}
```

STATUS 400

Response Body

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

---

# Renegotiation Payment

URL: /en/documentation/renegociacao/pagamento_renegociacao

## Webhooks:

WEBHOOK_TYPE renegotiation.proposal
STATUS paid

#### paid_method_type Enumerators

| Enumerator                   | Description                                   |
|------------------------------|-----------------------------------------------|
| **bank_slip**                | Bank slip payment                             |
| **pix**                      | PIX payment                                   |

#### Renegotiation payment webhook example

Webhook Body

```json
{
	"webhook_type": "renegotiation.proposal",
	"key": "\<PROPOSAL-KEY\>",
	"event_datetime": "\<DATA E HORA DO ENVIO DO WEBHOOK\>",
	"status": "paid",
    "data": {
        "paid_method_type": "<METODO DE PAGAMENTO>",
        "paid_in": {
            "code_number": "<CODIGO DO BANCO LIQUIDANTE>", 
            "ispb": "<ISPB DO BANCO LIQUIDANTE>", 
            "name": "<NOME DO BANCO LIQUIDANTE>"
        }
    }
}
```

#### Payment data of installment paid through renegotiation

Webhook Body

```json
{
    "renegotiation_proposal_key": "806fa827-d1c4-4e5d-bf24-7b317fbbff15",
    "paid_in": {
        "ispb": "18236120",
        "name": "NU PAGAMENTOS - IP",
        "code_number": 260
    },
    "resource_account_key": "8517eb4e-ddce-457b-9e39-194213e53691"
}
```

---

# Batch Renegotiation

URL: /en/documentation/renegociacao/renegociacao_em_lote

:::caution ATTENTION
Batch renegotiation can only be created with operations from the same issuer and same integration key.
:::

:::caution ATTENTION
There is a limit of 50 operations for each batch renegotiation.
:::

## 1. Simulate a batch renegotiation

### Request

ENDPOINT /renegotiation/batch_proposal_simulation
METHOD POST

Request Body

```json
{
    "amortization_type": "installment_payment",
    "reference_date": "2022-07-20",
    "discount_percentage": 0.0,
    "operations": [
      {
        "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
        "installments": [{
          "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88"
        }]
      },
      {
        "debt_key": "2cbfb9b1-1gdb-5g8d-9967-b338e5eb83g9",
        "installments": [{
          "installment_key": "2ef25ed8-7124-44f5-9e3d-1d1a7196166e"
        }]
      }
  ]
}
```

### Response

Response Body

```json
{
  "amortization_type": "installment_payment",
  "discount_percentage": 0.0,
  "discount_amount": 0.0,
  "payment_amount": 240,
  "requester_name": "Requester",
  "requester_key": "bcc16a6d-ce21-4cd4-8d8c-d26f89ccc685",
  "issuer_name": "issuer",
  "reference_date": "2022-07-20",
  "issuer_document_number": "98765432100",
  "operations": [
    {
      "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
      "payment_amount": 100,
      "discount_amount": 0,
      "affected_installments": [
        {
          "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88",
          "due_date": "2022-05-01",
          "principal_amount": 100,
          "interest_amount": 20,
          "fine_amount": 5,
          "total_amount": 125,
          "present_amount": 100,
          "paid_amount": 100
        }
      ],
      "remaining_installments": [
        {
          "installment_key": "7ac54a3e-fd11-46b2-b811-4c7d6d158fd5",
          "due_date": "2022-08-01",
          "principal_amount": 100,
          "interest_amount": 20,
          "fine_amount": 5,
          "total_amount": 125
        }
      ]
    },
     {
      "debt_key": "2cbfb9b1-1gdb-5g8d-9967-b338e5eb83g9",
      "payment_amount": 140,
      "discount_amount": 0,
      "affected_installments": [
        {
          "installment_key": "2ef25ed8-7124-44f5-9e3d-1d1a7196166e",
          "due_date": "2022-05-01",
          "principal_amount": 100,
          "interest_amount": 20,
          "fine_amount": 5,
          "total_amount": 200,
          "present_amount": 140,
          "paid_amount": 140
        }
      ],
      "remaining_installments": [
        {
          "installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18907",
          "due_date": "2022-08-01",
          "principal_amount": 100,
          "interest_amount": 20,
          "fine_amount": 5,
          "total_amount": 125
        }
      ]
    }
  ]
}
```

### Discount fields

Adding one of these fields to the request allows you to define a percentage or absolute discount value when creating or simulating the renegotiation proposal.

Percentage discount

```json
{
  "discount_percentage": 0.5
}
```

Absolute discount

```json
{
  "discount_amount": 200
}
```

## 2. Create a batch renegotiation

:::caution ATTENTION
The field 'request_control_key' is free and optional and is intended to ensure request uniqueness.
:::

### Request

ENDPOINT /renegotiation/batch_proposal
METHOD POST

Request Body

```json
{
    "amortization_type": "installment_payment",
    "reference_date": "2022-07-20",
    "proposal_due_date": "2022-07-20",
    "discount_percentage": 0.0,
    "payment_type": "bank_slip",
    "request_control_key": "4f75374c-e02f-4459-bddc-b9a7a0c9b0f3",
    "operations": [
      {
        "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
        "installments": [{
          "installment_key": "767f6ce0-add7-4334-a843-0e82cd1e7360"
        }]
      },
      {
        "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
        "installments": [{
          "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e89"
        }]
      }
  ]
}
```

:::warning Attention
The fields `discount_amount` and `discount_percentage` **CANNOT** be sent together in the same payload.
:::

### Body Params

| Field                 | Type | Description                                                                                                                         | Characters                                                            |
|-----------------------|---|-----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|  
| `debt_key`            | string | Unique key of the credit operation within QI Tech.                                                                                  | UUID                                                                  |
| `amortization_type`   | string | Amortization type.                                                                                                              | **[Amortization Type Enumerators](#amortization-type-enumerators)** |
| `reference_date`      | string | Reference date to which the present value of the renegotiation will be calculated (must be D+1).                                           | 10                                                                    |
| `proposal_due_date`   | string | Due date of the renegotiation proposal.                                                                                   | 10                                                                    |
| `payment_type`        | string | Payment type.                                                                                                                | **[Payment Type Enumerators](#payment-type-enumerators)**           |
| `discount_percentage` | float | Discount percentage that will be calculated on the present value of the renegotiation ((1 - discount percentage) * Present Value). | 10                                                                    |
| `discount_amount`     | float | Discount amount that will be applied to the present value of the renegotiation (Present Value - Gross Discounted Value).             | 10                                                                    |
| `installments`        | array of objects | Renegotiated installments.                                                                                                            | **[Installments Object](#installments-object)**                       |

### Amortization Type Enumerators

| Field                           | Description                                                                                |
|---------------------------------|------------------------------------------------------------------------------------------| 
| **installment_payment**         | A renegotiation will be created for the payment of distinct installments sent in the payload. <br/><br/> To use this amortization type, it is necessary to pass the `installment_key` of the installment. |
| **overdue_installment_payment** | A renegotiation will be created directed to the payment of overdue installments.<br/><br/> To use this amortization type, it is necessary to pass the `installment_key` of the installment.          |

### Payment Type Enumerators

| Field    | Description                                                     | 
|----------|---------------------------------------------------------------|
| bankslip | Payment via bank slip (generates bank slip payment and PIX) | 
| pix      | Payment via PIX (generates only PIX)     |
| manual   | Payment made manually (does not generate payment method) | 

### Installments Object

| Field | Type | Description | Characters |
|---|---|---|---|
| `installment_key` | string | key of the installment to be renegotiated | uuid key |

### Response

Response Body

```json
{
  "batch_proposal_key": "bcc16a6d-ce21-4cd4-8d8c-d26f89ccc685",
  "batch_proposal_status": "pending_payment",
  "amortization_type": "installment_payment",
  "discount_percentage": 0.0,
  "discount_amount": 0.0,
  "payment_amount": 240,
  "requester_name": "Requester",
  "requester_key": "0193d113-9abd-4a13-8edb-2d94c2fdb70b",
  "issuer_name": "issuer",
  "reference_date": "2022-07-20",
  "proposal_due_date": "2022-07-20",
  "issuer_document_number": "98765432100",
  "payment_type": "bank_slip",
  "request_control_key": "4f75374c-e02f-4459-bddc-b9a7a0c9b0f3",
  "payment": {
    "digitable_line": "",
    "qr_code_url": "",
    "qr_code_key": "",
    "bank_slip_key": "",
    "paid_method_type": null
  },
  "operations": [
    {
      "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
      "payment_amount": 100,
      "discount_amount": 0,
      "affected_installments": [
        {
          "installment_key": "767f6ce0-add7-4334-a843-0e82cd1e7360",
          "due_date": "2022-05-01",
          "principal_amount": 100,
          "interest_amount": 20,
          "fine_amount": 5,
          "total_amount": 125,
          "present_amount": 100,
          "paid_amount": 100
        }
      ],
      "remaining_installments": [
        {
          "installment_key": "6807c8ee-8deb-40da-9b39-653d64ee8db7",
          "due_date": "2022-08-01",
          "principal_amount": 100,
          "interest_amount": 20,
          "fine_amount": 5,
          "total_amount": 125
        }
      ]
    },
     {
      "debt_key": "2cbfb9b1-1gdb-5g8d-9967-b338e5eb83g9",
      "payment_amount": 140,
      "discount_amount": 0,
      "affected_installments": [
        {
          "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e89",
          "due_date": "2022-05-01",
          "principal_amount": 100,
          "interest_amount": 20,
          "fine_amount": 5,
          "total_amount": 200,
          "present_amount": 140,
          "paid_amount": 140
        }
      ],
      "remaining_installments": [
        {
          "installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18907",
          "due_date": "2022-08-01",
          "principal_amount": 100,
          "interest_amount": 20,
          "fine_amount": 5,
          "total_amount": 125
        }
      ]
    }
  ]
}
```

## 3. List batch renegotiations

### Path params

| Field | Type | Description | Characters |
|---|---|---|---|   
| `batch_proposal_status` * | string |  Batch renegotiation proposal status. | - |
| `issuer_document_number` * | string |  Issuer document number | - |
| `request_control_key` * | string |  Requester identification key | - |
 

### Request

ENDPOINT /renegotiation/batch_proposal
METHOD GET

Response Body

```json
{
    "data": [
        {
            "batch_proposal_key": "7eba74fb-e893-40ac-91bb-9a9d8f8108d7",
            "request_control_key": "cb55f099-d7cf-4b0a-9ddb-8e3ac3fefe8e",
            "batch_proposal_status": "pending_payment",
            "amortization_type": "installment_payment",
            "discount_percentage": 0,
            "discount_amount": 0.0,
            "payment_amount": 240,
            "requester_name": "Requester",
            "requester_key": "bcc16a6d-ce21-4cd4-8d8c-d26f89ccc685",
            "issuer_name": "issuer",
            "reference_date": "2022-07-25",
            "proposal_due_date": "2022-07-25",
            "issuer_document_number": "98765432100",
            "payment_type": "bank_slip"
        },
        {
            "batch_proposal_key": "272d1b0f-c06d-47c0-943b-812609ff2e6f",
            "request_control_key": "2ef25ed8-7124-44f5-9e3d-1d1a7196166e",
            "batch_proposal_status": "pending_payment",
            "amortization_type": "installment_payment",
            "discount_percentage": 0,
            "discount_amount": 0.0,
            "payment_amount": 240,
            "requester_name": "Requester",
            "requester_key": "bcc16a6d-ce21-4cd4-8d8c-d26f89ccc685",
            "issuer_name": "issuer",
            "reference_date": "2022-07-20",
            "proposal_due_date": "2022-07-20",
            "issuer_document_number": "98765432100",
            "payment_type": "bank_slip"
        }
    ],
    "pagination": {
        "current_page": 1,
        "next_page": 2,
        "rows_per_page": 2,
        "total_pages": 5,
        "total_rows": 140
    }
}
```

## 4. Query a batch renegotiation

### Request

ENDPOINT /renegotiation/batch_proposal/BATCH-PROPOSAL-KEY
METHOD GET

Response Body

```json
{
  "batch_proposal_key": "7ac54a3e-fd11-46b2-b811-4c7d6d158fd5",
  "request_control_key": "61905b8b-3ed2-46bc-8e9c-a5e99ceaea37",
  "batch_proposal_status": "pending_payment",
  "amortization_type": "installment_payment",
  "discount_percentage": 0.0,
  "discount_amount": 0.0,
  "payment_amount": 240,
  "requester_name": "Requester",
  "requester_key": "bcc16a6d-ce21-4cd4-8d8c-d26f89ccc685",
  "issuer_name": "issuer",
  "reference_date": "2022-07-20",
  "proposal_due_date": "2022-07-20",
  "issuer_document_number": "98765432100",
  "payment_type": "bank_slip",
  "payment": {
    "digitable_line": "",
    "qr_code_url": "",
    "qr_code_key": "",
    "bank_slip_key": "",
    "paid_method_type": null
  },
  "operations": [
    {
      "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
      "payment_amount": 100,
      "discount_amount": 0,
      "affected_installments": [
        {
          "installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18903",
          "due_date": "2022-05-01",
          "principal_amount": 100,
          "interest_amount": 20,
          "fine_amount": 5,
          "total_amount": 125,
          "present_amount": 100,
          "paid_amount": 100
        }
      ],
      "remaining_installments": [
        {
          "installment_key": "34f81236-e24a-4788-88e0-86cd697c36b7",
          "due_date": "2022-08-01",
          "principal_amount": 100,
          "interest_amount": 20,
          "fine_amount": 5,
          "total_amount": 125
        }
      ]
    },
     {
      "debt_key": "2cbfb9b1-1gdb-5g8d-9967-b338e5eb83g9",
      "payment_amount": 140,
      "discount_amount": 0,
      "affected_installments": [
        {
          "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e89",
          "due_date": "2022-05-01",
          "principal_amount": 100,
          "interest_amount": 20,
          "fine_amount": 5,
          "total_amount": 200,
          "present_amount": 140,
          "paid_amount": 140
        }
      ],
      "remaining_installments": [
        {
          "installment_key": "44cad2ae-60e9-4eb8-bb2a-b37e9557873f",
          "due_date": "2022-08-01",
          "principal_amount": 100,
          "interest_amount": 20,
          "fine_amount": 5,
          "total_amount": 125
        }
      ]
    }
  ]
}
```

### Request

ENDPOINT /renegotiation/batch_proposal/request_control_key/REQUEST-CONTROL-KEY
METHOD GET

Response Body

```json
{
  "batch_proposal_key": "7ac54a3e-fd11-46b2-b811-4c7d6d158fd5",
  "request_control_key": "61905b8b-3ed2-46bc-8e9c-a5e99ceaea37",
  "batch_proposal_status": "pending_payment",
  "amortization_type": "installment_payment",
  "discount_percentage": 0.0,
  "discount_amount": 0.0,
  "payment_amount": 240,
  "requester_name": "Requester",
  "requester_key": "bcc16a6d-ce21-4cd4-8d8c-d26f89ccc685",
  "issuer_name": "issuer",
  "reference_date": "2022-07-20",
  "proposal_due_date": "2022-07-20",
  "issuer_document_number": "98765432100",
  "payment_type": "bank_slip",
  "payment": {
    "digitable_line": "",
    "qr_code_url": "",
    "qr_code_key": "",
    "bank_slip_key": "",
    "paid_method_type": null
  },
  "operations": [
    {
      "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
      "payment_amount": 100,
      "discount_amount": 0,
      "affected_installments": [
        {
          "installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18903",
          "due_date": "2022-05-01",
          "principal_amount": 100,
          "interest_amount": 20,
          "fine_amount": 5,
          "total_amount": 125,
          "present_amount": 100,
          "paid_amount": 100
        }
      ],
      "remaining_installments": [
        {
          "installment_key": "34f81236-e24a-4788-88e0-86cd697c36b7",
          "due_date": "2022-08-01",
          "principal_amount": 100,
          "interest_amount": 20,
          "fine_amount": 5,
          "total_amount": 125
        }
      ]
    },
     {
      "debt_key": "2cbfb9b1-1gdb-5g8d-9967-b338e5eb83g9",
      "payment_amount": 140,
      "discount_amount": 0,
      "affected_installments": [
        {
          "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e89",
          "due_date": "2022-05-01",
          "principal_amount": 100,
          "interest_amount": 20,
          "fine_amount": 5,
          "total_amount": 200,
          "present_amount": 140,
          "paid_amount": 140
        }
      ],
      "remaining_installments": [
        {
          "installment_key": "44cad2ae-60e9-4eb8-bb2a-b37e9557873f",
          "due_date": "2022-08-01",
          "principal_amount": 100,
          "interest_amount": 20,
          "fine_amount": 5,
          "total_amount": 125
        }
      ]
    }
  ]
}
```

## 5. Cancel a batch renegotiation

ENDPOINT /renegotiation/batch_proposal/BATCH-PROPOSAL-KEY
METHOD DELETE

### Response

ENDPOINT /renegotiation/batch_proposal/BATCH-PROPOSAL-KEY
METHOD DELETE
HTTP STATUS 204

Response Body

```json
    {}
```

## 6. Webhooks

## 6.1. Batch renegotiation payment webhook

Webhook Body

```json
{
    "webhook_type": "renegotiation.batch_proposal",
    "key": "\<BATCH-PROPOSAL-KEY\>",
    "event_datetime": "\<DATA E HORA DO ENVIO DO WEBHOOK\>",
    "status": "paid",
    "data": {
        "paid_method_type": "<METODO DE PAGAMENTO>",
        "paid_in": {
            "code_number": "<CODIGO DO BANCO LIQUIDANTE>",
            "ispb": "<ISPB DO BANCO LIQUIDANTE>",
            "name": "<NOME DO BANCO LIQUIDANTE>"
        }
    }
}
```

## 6.2. Batch renegotiation rejection webhook

:::caution ATTENTION
A batch renegotiation can be rejected due to payment deadline expiration or by payment of an installment outside the renegotiation.
:::

Webhook Body

```json
{
    "webhook_type": "renegotiation.batch_proposal",
    "key": "\<BATCH-PROPOSAL-KEY\>",
    "event_datetime": "\<DATA E HORA DO ENVIO DO WEBHOOK\>",
    "status": "rejected",
    "data": {}
}
```

## 6.3. Example of payment data for installment paid through batch renegotiation

Webhook Body

```json
{
    "batch_renegotiation_proposal_key": "f9addba2-ec91-41bf-a150-c59eb1c3fbef",
    "paid_in": {
        "ispb": "18236120",
        "name": "NU PAGAMENTOS - IP",
        "code_number": 260
    },
    "resource_account_key": "ea44b9f2-ad00-4896-b8a3-b1a3da28a72f"
}
```

---

# Simulação com valor por parcela

URL: /en/documentation/renegociacao/simulacao_com_valor_por_parcela

## Request

ENDPOINT /renegotiation/simulation
MÉTODO POST

Request Body

```json
{
    "contract_number": "ABCD/1",
    "amortization_type": "installment_payment",
    "reference_date": "2022-07-20",
    "installments": [
        {
            "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88",
            "paid_amount": 150
        }
    ]
}

```

### Body params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---| 
| `contract_number` | string | Numero do contrato. | 10 |
| `amortization_type` | string | Tipo de amortização. | 10 |
| `reference_date` | date | Data de referencia da renegociação. | 10 |
| `installments` | array of objects | Parcelas renegociadas. | **[Installments Object](#installments-object)**  |
 
### Installments Object

| Campo | Descrição |
|---|---|
| `installment_key` * | string | key da parcela a ser renegociada | 10 |
| `paid_amount` * | float | Valor a ser pago da parcela renegociada. | 10 |

## Response

STATUS 200

Response Body

```json
{
  "contract_number": "ABCD/1",
  "discount_percentage": 0.2,
  "payment_amount": 240,
  "reference_date": "2022-07-20",
  "proposal_due_date": "2022-07-20",
  "requester_name": "Requester",
  "amortization_type": "installment_payment",
  "requester_key": "bcc16a6d-ce21-4cd4-8d8c-d26f89ccc685",
  "issuer_name": "issuer",
  "issuer_document_number": "98765432100",
  "affected_installments": [
    {
      "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88",
      "due_date": "2022-05-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125,
      "present_amount": 100,
      "paid_amount": 80
    },
    {
      "installment_key": "6597a073-ea7a-4447-b250-f4d3f07b0b74",
      "due_date": "2022-06-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125,
      "present_amount": 100,
      "paid_amount": 80
    },
    {
      "installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18900",
      "due_date": "2022-07-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125,
      "present_amount": 100,
      "paid_amount": 80
    }
  ],
  "remaining_installments": [
    {
      "installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18903",
      "due_date": "2022-08-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125
    },
    {
      "installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18904",
      "due_date": "2022-09-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125
    },
    {
      "installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18905",
      "due_date": "2022-10-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125
    }
  ]
}
```

STATUS 400

Response Body

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

---

# Renegotiation simulation

URL: /en/documentation/renegociacao/simulacao_de_uma_renegociacao

## Request

ENDPOINT /renegotiation/simulation
METHOD POST

Request Body

```json
{
	"contract_number": "ABCD/1",
	"amortization_type": "installment_payment",
	"reference_date": "2022-07-20",
	"installments": [{
		"installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88"
	}],
	"discount_percentage": 0.2,
	"amount_percentage": 100
}

```

### Body Params 

| Field                 | Type             | Description                                             | Characters                                                          |
|-----------------------|------------------|---------------------------------------------------------|---------------------------------------------------------------------|
| `contract_number`     | string           | Contract number                                         | 10                                                                  |
| `amortization_type`   | enum             | Amortization Type                                       | **[Enumerators](#enumeradores-amortization_type)**                  |
| `reference_date`      | date             | Reference date                                          | 10                                                                  |
| `installments`        | array of objects | Renegotiated installments                               | **[Installments array of objects](#installments-array-of-objects)** |
| `discount_percentage` | float            | Percentual discount added on installment present values | 10                                                                  |
| `amount_percentage`   | float            | Monetary discount added on installment present values   | 10                                                                  |

### Installments array of objects

| Field             | Type   | Description                  | Characters |
|-------------------|--------|------------------------------|------------| 
| `installment_key` | string | renegociated installment key | uuid key   |

## Response

STATUS 200

Response Body

```json
{
  "contract_number": "ABCD/1",
  "discount_percentage": 0.2,
  "payment_amount": 240,
  "reference_date": "2022-07-20",
  "proposal_due_date": "2022-07-20",
  "requester_name": "Requester",
  "amortization_type": "installment_payment",
  "requester_key": "bcc16a6d-ce21-4cd4-8d8c-d26f89ccc685",
  "issuer_name": "issuer",
  "issuer_document_number": "98765432100",
  "affected_installments": [
    {
      "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88",
      "due_date": "2022-05-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125,
      "present_amount": 100,
      "paid_amount": 80
    },
    {
      "installment_key": "6597a073-ea7a-4447-b250-f4d3f07b0b74",
      "due_date": "2022-06-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125,
      "present_amount": 100,
      "paid_amount": 80
    },
    {
      "installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18900",
      "due_date": "2022-07-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125,
      "present_amount": 100,
      "paid_amount": 80
    }
  ],
  "remaining_installments": [
    {
      "installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18903",
      "due_date": "2022-08-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125
    },
    {
      "installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18904",
      "due_date": "2022-09-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125
    },
    {
      "installment_key": "3da60b56-17fb-4b32-a1e4-1f0c28d18905",
      "due_date": "2022-10-01",
      "principal_amount": 100,
      "interest_amount": 20,
      "fine_amount": 5,
      "total_amount": 125
    }
  ]
}
```

STATUS 400

Response Body

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

---

# Update de um pagamento manual

URL: /en/documentation/renegociacao/update_de_um_pagamento_manual

## Request

- ENDPOINT /renegotiation/proposal/proposal_key}/payment
- MÉTODO PATCH

Body.json

```json
{
   "paid_method_type": "bank_slip"
}

```

### Query params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---| 
| `proposal_status` |  Tipo |  Chave da proposta de renegociação. | 10 |

### Body params

| Campo | Tipo | Descrição | Caracteres |
|---|---|---|---| 
| `paid_method_type` | Tipo |  Meio de pagamento. | **[Enumeradores](#enumeradores-paid_method_type)**  |

### Enumeradores paid_method_type
| Campo |  Descrição | 
|---|---|
| banklisp | Pagamento via boleto bancário | 
| manual | Pagamento feito de forma manual | 
| pix | Pagamento via pix | 

## Response

STATUS 200

Response Body

```json
{

}
```

STATUS 400

Response Body

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

---

# Roteiro de Homologação - Circuito de Compras

URL: /en/documentation/roteiros_de_homologacao/circuito_dd46f8d3-f078-41ba-a311-55be848f1c69

O roteiro de homologação descreve todos os recursos e funcionalidades que precisam
ser testados pelo parceiro integrador no ambiente de sandbox da QI Tech (ambiente de testes), 
antes da entrada em ambiente de produção do produto.

Este roteiro descreve todos os recursos e funcionalidades envolvidos no produto. 
:::info ATENÇÃO
As etapas sinalizadas com * são obrigatórias para a entrada em produção
:::

⚠️ **Todos os testes devem ser obrigatoriamente realizados no ambiente de Sandbox da QI Tech (ambiente de testes).
As movimentações realizadas em ambiente de Sandbox são movimentações financeiras fictícias, servindo apenas para teste de funcionalidade das APIs.**

## Cadastro e Autenticação API BaaS
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| CAB0001* | Cadastro no ambiente de Sandbox | Realizar o cadastro na plataforma da QI Tech no ambiente de Sandbox (sandbox.qitech.app) | [Link documentação](https://docs.qitech.com.br/documentation/primeiros_passos/inicio) 
| CAB0002* | Validação de token em Sandbox | Realizar a validação do QI Token em Sandbox | [Download Manual de Inclusão do Token](https://docs.qitech.com.br/assets/pdfs/QI%20Tech%20Manual%20Inclus%C3%A3o%20de%20Token.pdf) | CAB0001 |
| CAB0003* | Troca de chaves públicas | Realizar a troca de chaves públicas dentro da plataforma da QI Tech em sandbox (sandbox.qitech.app) | [Link Documentação](https://docs.qitech.com.br/documentation/primeiros_passos/troca_de_chaves) | CAB0001 e CAB0002 |
| CAB0004* | Teste de autenticação de chamadas | Finalizar teste de autenticação de chamadas | [Passo a Passo](https://docs.qitech.com.br/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_v2) <br/><br/> [Link Documentação](https://docs.qitech.com.br/documentation/primeiros_passos/teste_de_autenticacao/endpoints_de_teste) | CAB0003 |
| CAB0005* | Configuração de webhooks | Realizar a configuração da url para envio dos webhooks por parte da QI, através da plataforma da QI Tech em sandbox (sandbox.qitech.app) | [Link Documentação](https://docs.qitech.com.br/documentation/primeiros_passos/configurando_webhooks) | CAB0001 e CAB0002 |

## Movimentações
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
|---------|--|---|---|---|
| QIC0008* | Consulta de Transações | Realizar a consulta das transações de uma conta | [Consulta de Transações](https://docs.qitech.com.br/documentation/movimentacao_de_contas/consulta_de_transacoes) ||
| QIC0009 | Solicitação de comprovante de transferência | Solicitação de comprovante de transferência | [Solicitar comprovante de transferência](https://docs.qitech.com.br/documentation/movimentacao_de_contas/comprovante_de_transferencia) | PIX0002 |
| QIC0010* | Leitura de webhooks de transação | Recepcionar com sucesso todos os webhooks de transação | [Webhook account_transaction](https://docs.qitech.com.br/documentation/movimentacao_de_contas/webhook_movimentacoes) | CAB0005 e PIX0002 |
| QIC0011 | Consulta de lista de instituições financeiras | Consultar lista de instituições financeiras habiliatadas para recebimento de TED e Pix | [Consulta de Instituições Financeiras](https://docs.qitech.com.br/documentation/lista_de_instituicoes_financeiras/consulta_de_instituicoes_financeiras) ||

# TED

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| TED0001* | Transferência TED Out | Realizar transferência TED para outra instituição financeira | [Link Documentação](https://docs.qitech.com.br/documentation/baas/ted/realizar_transferencia) | CAB0002 ou CAB0003 |
| TED0002* | Simulação de estorno de uma TED Out | Simular o estorno de uma TED Out enviada a partira de uma QI Conta | Item 3: <br/>[Link Documentação](https://docs.qitech.com.br/documentation/movimentacao_de_contas/transacao#3---simula%C3%A7%C3%A3o-de-devolu%C3%A7%C3%A3o-de-ted) | TED0001 |
| TED0003* | Simulação de TED In | Simular a entrada de uma TED In em uma QI conta | Item 2: <br/>[Link Documentação](https://docs.qitech.com.br/documentation/movimentacao_de_contas/transacao#2---simula%C3%A7%C3%A3o-de-entrada-de-ted) | CAB0002 ou CAB0003 |
| TED0004* | Consulta de transações TED| Realizar a consulta de uma transação TED  | [Link Documentação](https://docs.qitech.com.br/documentation/movimentacao_de_contas/consulta_de_transacoes) | CAB0002 ou CAB0003 |
| TED000* | Leitura de webhooks de TED| Recepcionar com sucesso um webhook de TED | [Link Documentação](https://docs.qitech.com.br/documentation/baas/ted/webhooks) | CAB0002 ou CAB0003 |

---

# Boletos

## Gestão de Boletos

| Nº | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| BOL0002* | Registro de boleto de cobrança | Realizar o registro de um boleto de cobrança enviando uma ocorrência de registro | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/emissao/emissao_via_json) | CAB0002 ou CAB0003, |
| BOL0003 | Consultar carteira de cobrança de boletos | Consultar as carteiras de cobrança disponíveis para registro de boletos | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/consultar/consulta_de_carteira) | CAB0002 ou CAB0003 |
| BOL0004* | Instrução de boleto de cobrança | Comandar uma instrução para um boleto registrado | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/enviar_instrucao_de_boleto) | BOL0002 |
| BOL0005 | Simulação de liquidação de boleto | Simular a liquidação de um boleto | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/pagamento/liquidacao) | BOL0002 |
| BOL0006* | Leitura de webhooks de boletos | Recepcionar com sucesso todos os webhooks relacionados às alterações de status de um boleto | [Link Documentação](https://docs.qitech.com.br/documentation/webhooks/boletos) | BOL0004 |

## Pagamento de Boletos

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| BOL0009* | Consulta de linha digitável | Realizar a consulta de uma linha digitável de um boleto bancário ou boleto convênio. | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/pagamento/consulta_linha_digitavel) |  |
| BOL0010* | Pagamento de um boleto | Realizar o pagamento de um boleto bancário ou de boleto de convênio | Item 7.5 <br/>[Link Documentação](https://docs.qitech.com.br/documentation/boletos/pagamento/realizar_pagamento) | CAB0002 ou CAB0003 |

---

## Pix

## Transferência Pix 
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
|---------|--|---|---|---|
| PIX0002* | Transferência Pix Out | Realizar uma transferência Pix a partir de uma QI Conta utilizando dados bancários (pix manual) ou chave Pix | [Realização de Transação Pix](https://docs.qitech.com.br/documentation/baas/pix/realizar_transferencia)||
| PIX0035 | Consulta de transferência pix | Recuperar os dados de uma transferência | [Consulta de transferência Pix](https://docs.qitech.com.br/documentation/baas/pix/consultar_transferencias) | PIX0002 |
| PIX0003* | Simulação de reembolso de Pix Out | Simular o reembolso de um Pix Out. | [Simulação reembolso Pix Out -> Item 2](https://docs.qitech.com.br/documentation/pix/simulacao)| PIX0002 |
| PIX0004* | Simulação de Pix In | Simular o crédito de um Pix In em uma QI Conta. | [Simulação Pix In -> Item 1](https://docs.qitech.com.br/documentation/pix/simulacao)||
| PIX0005* | Reembolso de Pix In | Realizar o reembolso de um Pix In a partir de uma QI Conta. | [Reembolso Pix In](https://docs.qitech.com.br/documentation/baas/pix/solicitar_devolucao)| PIX0004 |
| PIX0037* | Leitura de webhook de transação pendente | Recepcionar com sucesso um webhook de transação pendente | [Webhook de transação pendente](https://docs.qitech.com.br/documentation/baas/pix/webhooks/index.html#webhook-para-transa%C3%A7%C3%B5es-pendentes) | PIX0002 |
| PIX0038* | Leitura de webhook de Pix de In | Recepcionar com sucesso um webhook de transferência Pix de entrada | [Webhook Pix In](https://docs.qitech.com.br/documentation/baas/pix/webhooks/index.html#webhook-para-pix-de-entrada) | PIX0004 |
| PIX0039 | Leitura de webhook de Devolução Pix | Recepcionar com sucesso um webhook de devolução de um Pix | [Webhook Devolução Pix](https://docs.qitech.com.br/documentation/baas/pix/webhooks/index.html#webhook-para-devolu%C3%A7%C3%B5es-de-pix) | PIX0003 |

## Pagamento de QR Code Pix

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| PIX0029* | Pagamento de QR Code Pix Estático | Realizar o pagamento de um QR Code Pix Estático | Item 4.1: [Link Documentação](https://docs.qitech.com.br/documentation/baas/pix/realizar_transferencia#transfer%C3%AAncia-por-qr-code-pix) | PIX0022 |
| PIX0030* | Pagamento de QR Code Pix Dinâmico | Realizar o pagamento de um QR Code Pix Dinâmico | Item 4.2: [Link Documentação](https://docs.qitech.com.br/documentation/baas/pix/realizar_transferencia#transfer%C3%AAncia-por-qr-code-pix) | PIX0022 |

---

# Homologation Roadmap - BaaS Digital Account

URL: /en/documentation/roteiros_de_homologacao/conta_digital

The homologation roadmap describes all the resources and functionalities that need
to be tested by the integrating partner in QI Tech's sandbox environment (testing environment),
before entering the production environment for the product.

This roadmap describes all the resources and functionalities involved in the product.

⚠️ **All tests must be mandatory performed in QI Tech's Sandbox environment (testing environment).
Transactions performed in the Sandbox environment are fictitious financial transactions, serving only to test API functionality.**

## BaaS API Registration and Authentication
| Code  | Stage | Description | Documentation Link | Prerequisites |
| --- | --- | --- | --- | --- |
| CAB0001* | Sandbox environment registration | Perform registration on QI Tech's platform in the Sandbox environment (sandbox.qitech.app) | cs@qitech.com.br |
| CAB0002* | Sandbox token validation | Perform QI Token validation in Sandbox | [Documentation Link](https://docs.qitech.com.br/assets/pdfs/QI%20Tech%20Manual%20Inclus%C3%A3o%20de%20Token.pdf) | CAB0001 |
| CAB0003* | Public key exchange | Perform public key exchange within QI Tech's platform in sandbox (sandbox.qitech.app) | [Documentation Link](/documentation/primeiros_passos/troca_de_chaves) | CAB0001 and CAB0002 |
| CAB0004* | Call authentication testing | Complete call authentication testing |[Documentation Link](/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_v2) <br/><br/> [Documentation Link](/documentation/primeiros_passos/teste_de_autenticacao/endpoints_de_teste) | CAB0003 |
| CAB0005* | Webhook configuration | Configure URL for webhook sending by QI, through QI Tech's platform in sandbox (sandbox.qitech.app) | [Documentation Link](/documentation/primeiros_passos/configurando_webhooks) | CAB0001 and CAB0002 |

## Anti-fraud

## Registration and Authentication

| Code | Stage | Description | Documentation Link | Prerequisites |
| --- | --- | --- | --- | --- |
| ATF0002* | Obtaining onboarding API-key | Obtain from QI Tech's integration team the API key for using the /onboarding API | suporte.caas@qitech.com.br |  
| ATF0003* | Obtaining OCR mobile-token | Obtain from QI Tech's integration team the Mobile Token for using the OCR SDK | suporte.caas@qitech.com.br |  
| ATF0004* | Obtaining Face Recognition mobile-token | Obtain from QI Tech's integration team the Mobile Token for using the Face Recognition SDK | suporte.caas@qitech.com.br |  
| ATF0005* | Obtaining Device scan mobile-token | Obtain from QI Tech's integration team the Mobile Token for using the Device scan SDK | suporte.caas@qitech.com.br |  

## OCR SDK

| Code | Stage | Description | Documentation Link | Prerequisites |
| --- | --- | --- | --- | --- |
| ATF0007* | SDK build | Define template and customizations for document collection and successfully build the SDK within your application (QI Tech client application) | Android: [Documentation Link](/documentation/caas/ocr/android/introduction) <br/> iOS:[ Documentation Link](/documentation/caas/ocr/ios/introduction) |  |
| ATF0008* | Document sending | Perform document collection using the SDK within your application (QI Tech client application) |  | ATF0003 and ATF0007 |
| ATF0009* | ocr_key storage | Store keys returned by the SDK, identifying the nature of the collected document (ex: cnh_front, cnh_back, etc) | Android: [Documentation Link](/documentation/caas/ocr/android/collecting_response) <br/>iOS:[ Documentation Link](/documentation/caas/ocr/ios/collecting_response)| ATF0008 |

## Face Recognition SDK

| Code | Stage | Description | Documentation Link | Prerequisites |
| --- | --- | --- | --- | --- |
| ATF0011* | SDK build | Define customizations and successfully build the SDK within your application (QI Tech client application) |Android: [Documentation Link](/documentation/caas/face_recognition/android/introduction) <br/>iOS:[ Documentation Link](/documentation/caas/face_recognition/ios/introduction)  |  |
| ATF0012* | Liveness flow | Perform liveness flow using the SDK within your application (QI Tech client application) | | ATF0004 and ATF0011* |
| ATF0013* | Image key storage | Store the image_key returned by the SDK after completing the liveness flow | Android: [Documentation Link](/documentation/caas/face_recognition/android/collecting_response) iOS:[ Documentation Link](/documentation/caas/face_recognition/ios/collecting_response) | ATF0012 |

## Device Scan SDK

| Code | Stage | Description | Documentation Link | Prerequisites |
| --- | --- | --- | --- | --- |
| ATF0015* | SDK build | Define permissions to be requested from the user by your application (QI Tech client application) and successfully build the SDK within your application (QI Tech client application) | Android: [Documentation Link](/documentation/caas/device_scan/android/introduction)<br/>iOS:[ Documentation Link](/documentation/caas/device_scan/ios/introduction)|  
| ATF0016* | User session storage | Store user session (sessionId) that will have the device scanned | Android: [Documentation Link](/documentation/caas/device_scan/android/example)<br/>iOS:[ Documentation Link](/documentation/caas/device_scan/ios/example) | ATF0015 and ATF0017 |
| ATF0017* | Information collection | Instantiate the SDK with the stored sessionId and call the information collection method within your application (QI Tech client application) | Android: [Documentation Link](/documentation/caas/face_recognition/android/collecting_response)<br/>iOS:[ Documentation Link](/documentation/caas/face_recognition/ios/collecting_response) | ATF0005 and ATF0015 |

## Anti-fraud

| Code | Stage | Description | Documentation Link | Prerequisites |
| --- | --- | --- | --- | --- |
| ATF0019* | Individual Person (PF) anti-fraud | Successfully perform anti-fraud for an individual person client | [Documentation Link](/documentation/caas/onboarding/natural_person) | ATF0002 |
| ATF0020* | Legal Entity (PJ) anti-fraud | Successfully perform anti-fraud for a legal entity client | [Documentation Link](/documentation/caas/onboarding/legal_person) | ATF0002 |
| ATF0021* | Reading derived analysis webhooks for asynchronous flow | Successfully receive derived analysis webhook for asynchronous response flow |[Documentation Link](/documentation/caas/onboarding/webhook) | ATF0019 or ATF0020 |

## Platform Registration

| Code | Stage | Description | Documentation Link | Prerequisites |
| --- | --- | --- | --- | --- |
| ATF0022* | Master user registration | Register a Master user on the CaaS platform, for resolving requests derived to "Manual analysis"  | suporte.caas@qitech.com.br | ATF0019 or ATF0020 |

---

# **QI Account**

## Account Opening

| Code | Stage | Description | Documentation Link | Prerequisites |
| --- | --- | --- | --- | --- |
| QIC0002* | Individual Person (PF) account reservation | Request account reservation for an individual person holder | [Documentation Link](/documentation/baas/account/reservar_conta_pf) | CAB0005 and CAB0006 |
| QIC0003* | Individual Person (PF) account opening | Perform account opening for an individual person holder | [Documentation Link](/documentation/baas/account/abrir_conta_pf) | QIC0002 |
| QIC0004* | Legal Entity (PJ) account reservation | Request account reservation for a legal entity holder | [Documentation Link](/documentation/baas/account/reservar_conta_pj) | CAB0005 and CAB0006 |
| QIC0005* | Legal Entity (PJ) account opening | Perform account opening for a legal entity holder | [Documentation Link](/documentation/baas/account/abrir_conta_pj) | QIC0004 |
| QIC0006* | Reading account opening webhooks | Correctly read account opening webhooks | Item 1.2. or 1.3:<br/>[Documentation Link](/documentation/baas/account/webhooks) |  QIC0002 or QIC0002  |
| QIC0007* | List accounts | List opened accounts| [Documentation Link](/documentation/contas/consultar_conta) |  QIC0002 or QIC0002  |
| QIC0008* | Query account data | Query data such as balance, holder data, opening date, among others | [Documentation Link](/documentation/contas/consultar_conta) |  QIC0002 or QIC0002  |

## Transactions

| Code | Stage | Description | Link | Prerequisites |
| --- | --- | --- | --- | --- |
| QIC0008* | Statement Query | Perform statement query for an account | [Documentation Link](/documentation/movimentacao_de_contas/consulta_de_transacoes) |  QIC0002 or QIC0002  |
| QIC0009* | Transfer receipt request | Request a transfer receipt | [Documentation Link](/documentation/movimentacao_de_contas/comprovante_de_transferencia)|  |
| QIC0010* | Reading transaction webhooks | Successfully receive all transaction webhooks |  [Documentation Link](/documentation/movimentacao_de_contas/webhook_movimentacoes/index.html) |  QIC0002 or QIC0002  |
| QIC0011* | Financial institutions list query | Query list of financial institutions enabled to receive TED and Pix |  [Documentation Link](/documentation/lista_de_instituicoes_financeiras/consulta_de_instituicoes_financeiras) |  QIC0002 or QIC0002  |

---

# Document Upload

| Code | Stage | Description | Link | Prerequisites |
| --- | --- | --- | --- | --- |
| UDD0001* | Document upload | Perform document upload through our documents API |  [Documentation Link](/documentation/upload_de_documentos/) |  |

---

# TED

| Code | Stage | Description | Link                                                                                                        | Prerequisites |
| --- | --- | --- |-------------------------------------------------------------------------------------------------------------| --- |
| TED0001* | TED Out transfer | Perform TED transfer  | [Documentation Link](/documentation/baas/ted/realizar_transferencia) | QIC0002 or QIC0002 |
| TED0002* | TED Out reversal simulation | Simulate reversal of a TED Out sent from a QI Account | Item 3: <br/>[Documentation Link](/documentation/movimentacao_de_contas/transacao) |  |
| TED0003* | TED In simulation | Simulate TED In entry to a QI account | Item 2: <br/>[Documentation Link](/documentation/movimentacao_de_contas/transacao) | QIC0002 or QIC0002 |
| TED0004* | List TED transactions| List inbound/outbound TED transactions  | [Documentation Link](/documentation/baas/ted/listar_teds)  | QIC0002 or QIC0002 |
| TED0004* | Query TED transaction| Perform TED transaction query  | [Documentation Link](/documentation/baas/ted/consultar_ted)           | QIC0002 or QIC0002 |
| TED0006* | Reading TED webhooks| Successfully receive a TED webhook | [Documentation Link](/documentation/baas/ted/webhooks/index.html)| QIC0002 or QIC0002 |
---

# Internal Transfer

| No | Stage | Description | Link | Prerequisites |
| --- | --- | --- | --- | --- |
| TFI0001 | Internal transfer with account debit | Execute a transfer from a QI Account, with destination being another QI Account | [Documentation Link](/documentation/baas/ted/realizar_transferencia) |  QIC0002 or QIC0002  |
| TFI0002 | Internal transfer simulation with account credit | Simulate resource receipt in the target QI Account, with source being another QI Account | Item 1: <br/> [Documentation Link](/documentation/movimentacao_de_contas/transacao) |  QIC0002 or QIC0002  |

---

# Bank Slips

## Bank Slip Management

| No | Stage | Description | Link | Prerequisites |
| --- | --- | --- | --- | --- |
| No      | Stage | Description | Link  | Prerequisites |
|---|---|---|---|---|
| BOL0001 | Single standard collection bank slip registration    | Perform registration of a collection bank slip | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_padrao/index.html) | CAB0002 or CAB0003   |
| BOL0002 | Single instant collection bank slip registration | Perform registration of a collection bank slip | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_instantanea) | CAB0002 or CAB0003   |
| BOL0003 | Batch bank slip registration  | Perform batch collection bank slip registration | [Documentation Link](/documentation/boletos/v2/emissao/emissao_em_lote) | CAB0002 or CAB0003   |
| BOL0004 | Single Standard Bank Slip Issuance        | Issue a single standard bank slip    | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_padrao)  | CAB0002 or CAB0003   |
| BOL0005 | Single Instant Bank Slip Issuance   | Issue a single instant bank slip | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_instantanea) | CAB0002 or CAB0003   |
| BOL0006 | Batch Issuance   | Issue bank slips in batch | [Documentation Link](/documentation/boletos/v2/emissao/emissao_em_lote)| CAB0002 or CAB0003   |
| BOL0007 | Perform discount on bank slip amount | Perform discount on bank slip amount | [Documentation Link](/documentation/boletos/v2/instrucoes/abatimento/criar_abatimento) | BOL0001, BOL0002 or BOL0003 |
| BOL0008 | Cancel Discount     | Cancel discount on a bank slip | [Documentation Link](/documentation/boletos/v2/instrucoes/abatimento/cancelar_abatimento) | BOL0001, BOL0002 or BOL0003  |
| BOL0009 | Extend bank slip due date               | Send bank slip due date extension | [Documentation Link](/documentation/boletos/v2/instrucoes/extensao)     | BOL0001, BOL0002 or BOL0003   |
| BOL0010 | Include discount on bank slip               | Include discount on a bank slip    | [Documentation Link](/documentation/boletos/v2/instrucoes/desconto)     | BOL0001, BOL0002 or BOL0003   |
| BOL0011 | Include interest on bank slip                   | Include interest on a bank slip       | [Documentation Link](/documentation/boletos/v2/instrucoes/juros)        | BOL0001, BOL0002 or BOL0003   |
| BOL0012 | Include fine on bank slip                   | Include fine on a bank slip       | [Documentation Link](/documentation/boletos/v2/instrucoes/multa)        | BOL0001, BOL0002 or BOL0003   |
| BOL0013 | Perform bank slip write-off                   | Write off a bank slip                 | [Documentation Link](/documentation/boletos/v2/instrucoes/baixa)        | BOL0001, BOL0002 or BOL0003   |
| BOL0014 | Query bank slips by key      | Query bank slips by key      | [Documentation Link](/documentation/boletos/v2/consulta/consulta_por_chave) | BOL0001, BOL0002 or BOL0003   |
| BOL0015 | List Bank Slips          | List bank slips     | [Documentation Link](/documentation/boletos/v2/consulta/listar_boletos) | BOL0001, BOL0002 or BOL0003   |
| BOL0016 | Collection wallet query      | Query a collection wallet | [Documentation Link](/documentation/boletos/v2/carteira/listar_carteiras/index.html) | BOL0001, BOL0002 or BOL0003   |
| BOL0017 | Bank Slip Webhooks      | Read webhook for bank slip | [Documentation Link](/documentation/boletos/v2/webhooks/boleto) | BOL0001, BOL0002 or BOL0003   |

## Bank Slip Payment

| Code | Stage | Description | Link | Prerequisites |
| --- | --- | --- | --- | --- |
| BOL0009* | Digitable line or Barcode query | Perform query of a bank slip digitable line | [Documentation Link](/documentation/baas/cobranca/consultar_boleto_bancario) |  |
| BOL0010* | Perform bank slip payment | Perform payment of a bank slip | [Documentation Link](/documentation/baas/cobranca/2fa_v2/solicitacao_de_pagamento_de_boleto_bancario) |  QIC0002 or QIC0002  |
| BOL0012* | Digitable line or Barcode query for service agreement slip | Perform query of a service agreement slip digitable line. | [Documentation Link](/documentation/baas/cobranca/consultar_fatura_de_recolhimento) |  |
| BOL0013* | Perform service agreement slip payment | Perform payment of a service agreement slip | [Documentation Link](/documentation/baas/cobranca/2fa_v2/solicitacao_de_pagamento_de_fatura_de_recolhimento) |  QIC0002 or QIC0002  |

---

## Pix

## Pix Transfer 
| Code  | Stage | Description | Documentation Link | Prerequisites |
|---------|--|---|---|---|
| PIX0002* | Pix Out Transfer | Perform a Pix transfer from a QI Account using bank data (manual pix) or Pix key | [Documentation Link](/documentation/baas/pix/realizar_transferencia) | CAB0001 |
| PIX0035 | Query pix transfer | Retrieve transfer data | [Documentation Link](/documentation/baas/pix/consultar_transferencias) | PIX0002 |
| PIX0003* | Pix Out refund simulation | Simulate Pix Out refund. | [Documentation Link - Item 2](/documentation/pix/simulacao)| PIX0002 |
| PIX0004* | Pix In simulation | Simulate Pix In credit to a QI Account. | [Documentation Link -> Item 1](/documentation/pix/simulacao)||
| PIX0037* | Reading pending transaction webhook | Successfully receive a pending transaction webhook | [Documentation Link][(/documentation/baas/pix/webhooks) | PIX0002 |
| PIX0038* | Reading Pix In webhook | Successfully receive an inbound Pix transfer webhook | [Documentation Link](/documentation/baas/pix/webhooks#webhook-para-pix-de-entrada)| PIX0004 |
| PIX0039 | Reading Pix Refund webhook | Successfully receive a Pix refund webhook | [Documentation Link](/documentation/baas/pix/webhooks#webhook-para-devolu%C3%A7%C3%B5es-de-pix) | PIX0003 |
| PIX0040 | Request refund of received Pix | Request refund of a received Pix | [Documentation Link](/documentation/baas/pix/solicitar_devolucao) | PIX0003 |
| PIX0041 | List Pix transfers from an account | List Pix transfers from an account | [Documentation Link](/documentation/baas/pix/listar_transferencias) | PIX0003 |

## Pix Key Management

### Pix Key Creation and Deletion

| Code | Stage | Description | Link | Prerequisites |
| --- | --- | --- | --- | --- |
| PIX0008* | Pix key creation | Perform creation of Pix key of types cpf, cnpj, random, e-mail and phone | [Documentation Link](/documentation/pix/criar_chave) | 
|QIC0002 or QIC0002  |](/documentation/baas/pix/consultar_chave_pix)
| PIX0009 | Pix key deletion | Perform deletion of a Pix key | [Documentation Link](/documentation/pix/excluir_chave) | PIX0008 |
| PIX0010* | List Pix keys of a QI Account | List Pix keys linked to a QI Account | [Documentation Link](/documentation/pix/listar_chaves_pix) | PIX0008 |

### Pix Key Portability

| Code | Stage | Description | Link | Prerequisites |
| --- | --- | --- | --- | --- |
| PIX0013* | Creating Pix Key Portability In Request | Create a Pix Key Portability In request of types CPF, CNPJ, E-mail, Phone and Random | [Documentation Link](/documentation/pix/portabilidade#criando-um-pedido-de-portabilidade) |  QIC0002 or QIC0002  |
| PIX0014* | Resend 2fa for Pix Key Portability In Request of E-mail or Phone type | Request resend of SMS (Phone type Pix Key) or E-mail (E-mail type Pix Key) for a pending Pix Key Portability In Request (pending_claimer_validation) | [Documentation Link](/documentation/pix/portabilidade#reenviando-a-valida%C3%A7%C3%A3o-de-dois-fatores) | PIX0013 |
| PIX0015* | Delete Pix Key Portability In Request | Delete a pending Pix Key Portability In Request | [Documentation Link](/documentation/pix/portabilidade#deletando-um-pedido-de-portabilidade) | PIX0013 |
| PIX0016* | Reading Pix Key Portability In completion webhook | Correctly read completion webhook for a Pix Key Portability In Request. Testing all possible completion statuses (concluded, cancelled and failed) | Webhook: <br/> [Documentation Link](/documentation/pix/portabilidade#conclus%C3%A3o-da-portabilidade) |PIX0013 |
| PIX0017* | Pix Key Portability Out Request simulation | Simulate the arrival of a Pix Key Portability Out Request | Item 5:<br/> [Documentation Link](/documentation/pix/simulacao/index.html) | PIX0013 |
| PIX0018* | Approval and Rejection of Pix Key Portability Out Request | Perform approval of a Pix Key Portability Out Request | [Documentation Link](/documentation/pix/portabilidade#request-4) | PIX0017 |
| PIX0019* | Resend 2fa for Pix Key Portability Out Request | Request 2fa resend for a Pix Key Portability Out Request | Enum "pending_donator_validation"  <br/> [Documentation Link](/documentation/pix/portabilidade#request-4) | PIX0018 |
| PIX0020* | Reading Pix Key Portability Out completion webhook | Correctly read completion webhook for a Pix Key Portability Out Request. Testing all possible completion statuses (concluded, cancelled and failed) | [Documentation Link](D/documentation/pix/portabilidade#conclus%C3%A3o-da-portabilidade-1) | PIX0018 |

## Pix QR Code Management

| Code | Stage | Description | Link | Prerequisites |
| --- | --- | --- | --- | --- |
| PIX0022* | Static Pix QR Code creation | Generate Static QR Code | [Documentation Link](/documentation/pix/criar_qr_code_estatico) | PIX0008 |
| PIX0023 | Dynamic Pix QR Code creation | Generate Dynamic QR Code with expiration (expiration day) and generate Instant Dynamic QR Code (with expiration seconds). | [Documentation Link](/documentation/pix/criar_qr_code_dinamico) | PIX0008 |
| PIX0024 | Dynamic Pix QR Code deletion | Delete Pix QR Code | [Documentation Link](/documentation/pix/baixar_qr_code_dinamico) | PIX0023 |
| PIX0025 | List Dynamic Pix QR Codes | List Dynamic Pix QR Codes | [Documentation Link](/documentation/pix/pesquisar_por_qr_code_dinamico) | PIX0023 |
| PIX0026 | Reading Instant Dynamic Pix QR Code expiration webhook | Successfully receive an Instant Dynamic Pix QR Code expiration webhook | [Documentation Link](/documentation/pix/webhook_por_qr_code_expirado) | PIX0023 |

## Pix QR Code Payment

| Code | Stage | Description | Link | Prerequisites |
| --- | --- | --- | --- | --- |

| PIX0029* | Static Pix QR Code payment | Perform payment of a Static Pix QR Code | [Documentation Link](/documentation/baas/pix/realizar_transferencia#transfer%C3%AAncia-por-qr-code-pix) | PIX0022 |
| PIX0030* | Dynamic Pix QR Code payment | Perform payment of a Dynamic Pix QR Code |  [Documentation Link](/documentation/baas/pix/realizar_transferencia#transfer%C3%AAncia-por-qr-code-pix) | PIX0022 |
| PIX0027* | Pix QR Code decoding | Decode a Static, Dynamic with expiration, and Instant Dynamic Pix QR Code | [Documentation Link](/documentation/pix/decodificar_qr_code) | PIX0022 and PIX0023 |

## Pix Limit Management

| Code | Stage | Description | Link | Prerequisites |
| --- | --- | --- | --- | --- |
| PIX0032* | Pix limit change request | Make Pix limit change request for a QI Account | [Documentation Link](/documentation/pix/solicitar_alteracao_de_limite_pix) |  QIC0002 or QIC0002  |
| PIX0033 | List Pix limit change requests | List Pix limit change requests for a QI Account | [Documentation Link](/documentation/pix/busca_por_solicitacao_de_limite_pix) | PIX0032 |
| PIX0034* | Query consumed Pix limit | Query consumed Pix limit for a QI Account | [Documentation Link](/documentation/pix/busca_por_uso_de_limite_pix) |  QIC0002 or QIC0002  |

---

# Fee Management
| Code | Stage | Description | Link | Prerequisites |
| --- | --- | --- | --- | --- |
| GTF0001* | Fee change request | Perform fee change for an account| [Documentation Link](/documentation/contas/gestao_de_tarifas) |  QIC0002 or QIC0002  |
| GTF0002* | Fee query  | Query fees registered for an account | [Documentation Link](/documentation/contas/consulta_de_tarifas) |  QIC0002 or QIC0002  |

# Card Management

## Card Creation
| Code | Stage | Description | Link | Prerequisites |
| --- | --- | --- | --- | --- |
| GDC0001* | Virtual card creation  | Perform creation of a virtual card| [Documentation Link](/documentation/cards/create/gerar_cartao_virtual) |  QIC0002 or QIC0002  |
| GDC0002* | Physical card creation  | Perform creation of a physical card| [Documentation Link](/documentation/cards/create/gerar_cartao_fisico) |  QIC0002 or QIC0002  |

## Card Query
| Code | Stage | Description | Link | Prerequisites |
| --- | --- | --- | --- | --- |
| GDC0003* | Query card by key  | Perform card query | [Documentation Link](/documentation/cards/search/buscar_cartao_by_key) | GDC0001 or GDC0002 |
| GDC0004* | List cards  | Perform card listing| [Documentation Link](/documentation/cards/search/listar_cartoes) | GDC0001 or GDC0002 |
| GDC0005* | Search card data | Search card data| [Documentation Link](/documentation/cards/search/buscar_dados_pci) | GDC0001 or GDC0002 |
| GDC0006* | Search PCI Password | Search PCI Password| [Documentation Link](/documentation/cards/search/buscar_senha) | GDC0001 or GDC0002 |
| GDC0007* | Query delivery data | Query delivery data| [Documentation Link](/documentation/cards/search/buscar_entrega_by_key) | GDC0001 or GDC0002 |

## Update card data
| Code | Stage | Description | Link | Prerequisites |
| --- | --- | --- | --- | --- |
| GDC0008* | Update card status  | Update card status| [Documentation Link](/documentation/cards/status/update_status_cartao) | GDC0001 or GDC0002 |
| GDC0009* | Activate physical card  | Perform activation of a physical card| [Documentation Link](/documentation/cards/status/ativar_cartao) | GDC0001 or GDC0002 |
| GDC0010* | Change Password   | Perform password change for a card | [Documentation Link](/documentation/cards/update/password_cartao) | GDC0001 or GDC0002 |
| GDC0011* | Configure card contactless  | Configure card contactless  | [Documentation Link](/documentation/cards/update/contactless_cartao) | GDC0002 |

---

# Certification Roadmap - BaaS Digital Account with Two-Factor Authentication

URL: /en/documentation/roteiros_de_homologacao/conta_digital_2fa

The certification roadmap describes all the features and functionalities that need
to be tested by the integrating partner in QI Tech's sandbox environment (test environment),
before moving to production environment of the product.

This roadmap describes all the features and functionalities involved in the product.

⚠️ **All tests must be mandatory performed in QI Tech's Sandbox environment (test environment).
The movements performed in the Sandbox environment are fictitious financial movements, serving only for functionality testing of the APIs.**

## Registration and Authentication BaaS API
| Code  | Step | Description | Documentation Link | Prerequisite |
| --- | --- | --- | --- | --- |
| CAB0001* | Registration in Sandbox environment | Perform registration on QI Tech platform in Sandbox environment (sandbox.qitech.app) | cs@qitech.com.br |
| CAB0002* | Token validation in Sandbox | Perform QI Token validation in Sandbox | [Documentation Link](https://docs.qitech.com.br/assets/pdfs/QI%20Tech%20Manual%20Inclus%C3%A3o%20de%20Token.pdf) | CAB0001 |
| CAB0003* | Public key exchange | Perform public key exchange within QI Tech platform in sandbox (sandbox.qitech.app) | [Documentation Link](/documentation/primeiros_passos/troca_de_chaves) | CAB0001 and CAB0002 |
| CAB0004* | Call authentication test | Complete call authentication test |[Documentation Link](/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_v2) <br/><br/> [Documentation Link](/documentation/primeiros_passos/teste_de_autenticacao/endpoints_de_teste) | CAB0003 |
| CAB0005* | Webhook configuration | Configure the URL for webhook delivery by QI, through QI Tech platform in sandbox (sandbox.qitech.app) | [Documentation Link](/documentation/primeiros_passos/configurando_webhooks) | CAB0001 and CAB0002 |

## Antifraud

## Registration and Authentication

| Code | Step | Description | Documentation Link | Prerequisite |
| --- | --- | --- | --- | --- |
| ATF0002* | Obtaining onboarding API-key | Obtain from QI Tech integration team the API key for using the /onboarding API | suporte.caas@qitech.com.br |  
| ATF0003* | Obtaining OCR mobile-token | Obtain from QI Tech integration team the Mobile Token for using the OCR SDK | suporte.caas@qitech.com.br |  
| ATF0004* | Obtaining Face Recognition mobile-token | Obtain from QI Tech integration team the Mobile Token for using the Face Recognition SDK | suporte.caas@qitech.com.br |  
| ATF0005* | Obtaining Device scan mobile-token | Obtain from QI Tech integration team the Mobile Token for using the Device scan SDK | suporte.caas@qitech.com.br |  

## SDK OCR

| Code | Step | Description | Documentation Link | Prerequisite |
| --- | --- | --- | --- | --- |
| ATF0007* | SDK Build | Define template and customizations for document collection and successfully build the SDK within your application (QI Tech client application) | Android: [Documentation Link](/documentation/caas/ocr/android/introduction) <br/> iOS:[ Documentation Link](/documentation/caas/ocr/ios/introduction) |  |
| ATF0008* | Document submission | Perform document collection using the SDK within your application (QI Tech client application) |  | ATF0003 and ATF0007 |
| ATF0009* | ocr_key storage | Store keys returned by the SDK, identifying the nature of the collected document (e.g.: cnh_front, cnh_back, etc.) | Android: [Documentation Link](/documentation/caas/ocr/android/collecting_response) <br/>iOS:[ Documentation Link](/documentation/caas/ocr/ios/collecting_response)| ATF0008 |

## SDK Face Recognition

| Code | Step | Description | Documentation Link | Prerequisite |
| --- | --- | --- | --- | --- |
| ATF0011* | SDK Build | Define customizations and successfully build the SDK within your application (QI Tech client application) |Android: [Documentation Link](/documentation/caas/face_recognition/android/introduction) <br/>iOS:[ Documentation Link](/documentation/caas/face_recognition/ios/introduction)  |  |
| ATF0012* | Proof of life flow | Perform the proof of life flow using the SDK within your application (QI Tech client application) | | ATF0004 and ATF0011* |
| ATF0013* | Image key storage | Store the image_key returned by the SDK after completion of the proof of life flow | Android: [Documentation Link](/documentation/caas/face_recognition/android/collecting_response) iOS:[ Documentation Link](/documentation/caas/face_recognition/ios/collecting_response) | ATF0012 |

## SDK Device Scan

| Code | Step | Description | Documentation Link | Prerequisite |
| --- | --- | --- | --- | --- |
| ATF0015* | SDK Build | Definition of permissions to be requested from the user by your application (QI Tech client application) and successfully build the SDK within your application (QI Tech client application) | Android: [Documentation Link](/documentation/caas/device_scan/android/introduction)<br/>iOS:[ Documentation Link](/documentation/caas/device_scan/ios/introduction)|  
| ATF0016* | User session storage | Store the user session (sessionId) that will have the device scanned | Android: [Documentation Link](/documentation/caas/device_scan/android/example)<br/>iOS:[ Documentation Link](/documentation/caas/device_scan/ios/example) | ATF0015 and ATF0017 |
| ATF0017* | Information collection | Instantiate the SDK with the stored sessionId and call the information collection method within your application (QI Tech client application) | Android: [Documentation Link](/documentation/caas/face_recognition/android/collecting_response)<br/>iOS:[ Documentation Link](/documentation/caas/face_recognition/ios/collecting_response) | ATF0005 and ATF0015 |

## Antifraud

| Code | Step | Description | Documentation Link | Prerequisite |
| --- | --- | --- | --- | --- |
| ATF0019* | Antifraud Individual | Successfully perform antifraud for an individual client | [Documentation Link](/documentation/caas/onboarding/natural_person) | ATF0002 |
| ATF0020* | Antifraud Legal Entity | Successfully perform antifraud for a legal entity client | [Documentation Link](/documentation/caas/onboarding/legal_person) | ATF0002 |
| ATF0021* | Reading derived analysis webhooks for asynchronous flow | Successfully receive derived analysis webhook for asynchronous response flow |[Documentation Link](/documentation/caas/onboarding/webhook) | ATF0019 or ATF0020 |

## Platform Registration

| Code | Step | Description | Documentation Link | Prerequisite |
| --- | --- | --- | --- | --- |
| ATF0022* | Master user registration | Perform registration of a Master user on the CaaS platform, for resolution of derived requests for "Manual analysis"  | suporte.caas@qitech.com.br | ATF0019 or ATF0020 |

---

# **QI Account**

## Account Opening

| Code | Step | Description | Documentation Link | Prerequisite |
| --- | --- | --- | --- | --- |
| QIC0002* | Individual account reservation | Request reservation of an account whose holder is an individual | [Documentation Link](/documentation/baas/account/reservar_conta_pf) | CAB0005 and CAB0006 |
| QIC0003* | Individual account opening | Perform opening of an account whose holder is an individual | [Documentation Link](/documentation/baas/account/abrir_conta_pf) | QIC0002 |
| QIC0004* | Legal entity account reservation | Request reservation of an account whose holder is a legal entity | [Documentation Link](/documentation/baas/account/reservar_conta_pj) | CAB0005 and CAB0006 |
| QIC0005* | Legal entity account opening | Perform opening of an account whose holder is a legal entity | [Documentation Link](/documentation/baas/account/abrir_conta_pj) | QIC0004 |
| QIC0006* | Reading account opening webhooks | Read account opening webhooks correctly | Item 1.2. or 1.3:<br/>[Documentation Link](/documentation/baas/account/webhooks) |  QIC0004 or QIC0005  |
| QIC0007* | List accounts | List opened accounts| [Documentation Link](/documentation/contas/consultar_conta) |  QIC0004 or QIC0005  |
| QIC0008* | Query account data | Query data such as balance, holder data, opening date, among others | [Documentation Link](/documentation/contas/consultar_conta) |  QIC0004 or QIC0005  |

## Transactions

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| QIC0008* | Statement query | Perform account statement query | [Documentation Link](/documentation/movimentacao_de_contas/consulta_de_transacoes) |  QIC0004 or QIC0005  |
| QIC0009* | Transfer receipt request | Request a transfer receipt | [Documentation Link](/documentation/movimentacao_de_contas/comprovante_de_transferencia)|  |
| QIC0010* | Reading transaction webhooks | Successfully receive all transaction webhooks |  [Documentation Link](/documentation/movimentacao_de_contas/webhook_movimentacoes/index.html) |  QIC0004 or QIC0005  |
| QIC0011* | Financial institutions list query | Query list of financial institutions enabled to receive TED and Pix |  [Documentation Link](/documentation/lista_de_instituicoes_financeiras/consulta_de_instituicoes_financeiras) |  QIC0004 or QIC0005  |

---

# Document Upload

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| UDD0001* | Document upload | Upload a document through our documents API |  [Documentation Link](/documentation/upload_de_documentos/) |  |

---

# TED

| Code | Step | Description | Link                                                                                                        | Prerequisite |
| --- | --- | --- |-------------------------------------------------------------------------------------------------------------| --- |
| TED0001* | TED Out transfer | Perform TED transfer  | 1 . Create transfer request: [Documentation Link](/documentation/baas/ted/realizar_transferencia_2fa) <br/>   2 . Approve transfer: [Documentation Link](/documentation/baas/ted/realizar_transferencia_2fa) <br/>           | QIC0004 or QIC0005 |
| TED0006* | Request token resend| Resend TED transfer approval token | [Documentation Link](/documentation/baas/ted/2fa/solicitacao_de_reenvio_de_token) | TED0001 |
| TED0002* | TED Out reversal simulation | Simulate reversal of a TED Out sent from a QI Account | Item 3: <br/>[Documentation Link](/documentation/movimentacao_de_contas/transacao) |  |
| TED0003* | TED In simulation | Simulate TED In entry to a QI account | Item 2: <br/>[Documentation Link](/documentation/movimentacao_de_contas/transacao) | QIC0004 or QIC0005 |
| TED0004* | List TED transactions| List incoming/outgoing TED transactions  | [Documentation Link](/documentation/baas/ted/listar_teds)  | QIC0004 or QIC0005 |
| TED0004* | Query TED transaction| Perform query of a TED transaction  | [Documentation Link](/documentation/baas/ted/consultar_ted)           | QIC0004 or QIC0005 |
| TED0006* | Reading TED webhooks| Successfully receive a TED webhook | [Documentation Link](/documentation/baas/ted/webhooks/index.html)| QIC0004 or QIC0005 |
---

# Internal Transfer

| No | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| TFI0001 | Internal transfer with account debit | Command a transfer from a QI Account, with the transfer destination being another QI Account |  1 . Create transfer request: [Documentation Link](/documentation/baas/ted/realizar_transferencia_2fa) <br/>   2 . Approve transfer: [Documentation Link](/documentation/baas/ted/realizar_transferencia_2fa) <br/> |  QIC0004 or QIC0005  |
| TFI0002 | Internal transfer simulation with account credit | Simulate resource receipt in target QI Account, originating from another QI Account | Item 1: <br/> [Documentation Link](/documentation/movimentacao_de_contas/transacao) |  QIC0004 or QIC0005  |

---

# Boletos

## Boleto Management

| No | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| No      | Step | Description | Link  | Prerequisite |
|---|---|---|---|---|
| BOL0001 | Single collection boleto registration    | Perform registration of a collection boleto | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_padrao/index.html) |QIC0004 or QIC0005   |
| BOL0002 | Single instant collection boleto registration | Perform registration of a collection boleto | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_instantanea) |QIC0004 or QIC0005   |
| BOL0003 | Batch boleto registration  | Perform registration of collection boletos in batch | [Documentation Link](/documentation/boletos/v2/emissao/emissao_em_lote) |QIC0004 or QIC0005   |
| BOL0004 | Standard Single Boleto Issuance        | Issue a single standard boleto    | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_padrao)  |QIC0004 or QIC0005   |
| BOL0005 | Instant Single Boleto Issuance   | Issue a single instant boleto | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_instantanea) |QIC0004 or QIC0005   |
| BOL0006 | Batch Issuance   | Issue boletos in batch | [Documentation Link](/documentation/boletos/v2/emissao/emissao_em_lote)|QIC0004 or QIC0005   |
| BOL0007 | Perform discount on boleto amount | Perform discount on boleto amount | [Documentation Link](/documentation/boletos/v2/instrucoes/abatimento/criar_abatimento) | BOL0001, BOL0002 or BOL0003 |
| BOL0008 | Cancel discount     | Cancel discount on a boleto | [Documentation Link](/documentation/boletos/v2/instrucoes/abatimento/cancelar_abatimento) | BOL0001, BOL0002 or BOL0003  |
| BOL0009 | Extend boleto due date               | Send due date extension for a boleto | [Documentation Link](/documentation/boletos/v2/instrucoes/extensao)     | BOL0001, BOL0002 or BOL0003   |
| BOL0010 | Include discount on a boleto               | Include discount on a boleto    | [Documentation Link](/documentation/boletos/v2/instrucoes/desconto)     | BOL0001, BOL0002 or BOL0003   |
| BOL0011 | Include interest on a boleto                   | Include interest on a boleto       | [Documentation Link](/documentation/boletos/v2/instrucoes/juros)        | BOL0001, BOL0002 or BOL0003   |
| BOL0012 | Include penalty on a boleto                   | Include penalty on a boleto       | [Documentation Link](/documentation/boletos/v2/instrucoes/multa)        | BOL0001, BOL0002 or BOL0003   |
| BOL0013 | Perform boleto write-off                   | Write-off a boleto                 | [Documentation Link](/documentation/boletos/v2/instrucoes/baixa)        | BOL0001, BOL0002 or BOL0003   |
| BOL0014 | Query boletos by key      | Query boletos by key      | [Documentation Link](/documentation/boletos/v2/consulta/consulta_por_chave) | BOL0001, BOL0002 or BOL0003   |
| BOL0015 | List boletos          | List boletos     | [Documentation Link](/documentation/boletos/v2/consulta/listar_boletos) | BOL0001, BOL0002 or BOL0003   |
| BOL0016 | Query collection wallet      | Query a collection wallet | [Documentation Link](/documentation/boletos/v2/carteira/listar_carteiras/index.html) | BOL0001, BOL0002 or BOL0003   |
| BOL0017 | Boleto webhooks      | Read webhook for boleto | [Documentation Link](/documentation/boletos/v2/webhooks/boleto) | BOL0001, BOL0002 or BOL0003   |

## Boleto Payment

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| BOL0009* | Query typeable line or barcode | Query a typeable line of a bank boleto | [Documentation Link](/documentation/baas/cobranca/consultar_boleto_bancario) |  |
| BOL0010* | Request token for boleto payment | Request token for bank boleto payment | [Documentation Link](/documentation/baas/cobranca/2fa_v2/solicitacao_de_pagamento_de_boleto_bancario) |  QIC0004 or QIC0005  |
| BOL0011* | Approve boleto payment | Request token for bank boleto payment  | [Documentation Link](/documentation/baas/cobranca/2fa_v2/confirmacao_de_pagamento_de_boleto_bancario) |  QIC0004 or QIC0005  |
| BOL0012* | Query typeable line or barcode of a service boleto | Query a typeable line of a service boleto. | [Documentation Link](/documentation/baas/cobranca/consultar_fatura_de_recolhimento) |  |
| BOL0013* | Request token for service boleto payment | Request token for service boleto payment | [Documentation Link](/documentation/baas/cobranca/2fa_v2/solicitacao_de_pagamento_de_fatura_de_recolhimento) |  QIC0004 or QIC0005  |
| BOL0014* | Approve service boleto payment| Request token for service boleto payment  | [Documentation Link](/documentation/baas/cobranca/2fa_v2/confirmacao_de_pagamento_de_fatura_de_recolhimento) |  QIC0004 or QIC0005  |

---

## Pix

## Pix Transfer 
| Code  | Step | Description | Documentation Link | Prerequisite |
|---------|--|---|---|---|
| PIX0002* | Pix Out transfer | Perform a Pix transfer from a QI Account using bank data (manual pix) or Pix key | [1. Request transfer](/documentation/baas/pix/2fa_v2/solicitacao_de_transacao_pix_2fa) <br></br> [2. Approve transfer](/documentation/baas/pix/2fa_v2/aprovar_transacao_pix_2fa) | CAB0001 |
| PIX0035 | Query pix transfer | Retrieve transfer data | [Documentation Link](/documentation/baas/pix/consultar_transferencias) | PIX0002 |
| PIX0003* | Pix Out refund simulation | Simulate Pix Out refund. | [Documentation Link - Item 2](/documentation/pix/simulacao)| PIX0002 |
| PIX0004* | Pix In simulation | Simulate Pix In credit to a QI Account. | [Documentation Link -> Item 1](/documentation/pix/simulacao)||
| PIX0037* | Reading pending transaction webhook | Successfully receive a pending transaction webhook | [Documentation Link][(/documentation/baas/pix/webhooks) | PIX0002 |
| PIX0038* | Reading Pix In webhook | Successfully receive an incoming Pix transfer webhook | [Documentation Link](/documentation/baas/pix/webhooks#webhook-para-pix-de-entrada)| PIX0004 |
| PIX0039 | Reading Pix refund webhook | Successfully receive a Pix refund webhook | [Documentation Link](/documentation/baas/pix/webhooks#webhook-para-devolu%C3%A7%C3%B5es-de-pix) | PIX0003 |
| PIX0040 | Request refund of received Pix | Request refund of a received Pix | [1. Request refund](/documentation/baas/pix/2fa_v2/solicitacao_de_devolucao_pix) <br></br> [2. Approve refund](/documentation/baas/pix/2fa_v2/aprovar_transacao_pix_2fa) | PIX0003 |
| PIX0041 | List Pix transfers of an account | List Pix transfers of an account | [Documentation Link](/documentation/baas/pix/listar_transferencias) | PIX0003 |

## Pix Key Management

### Pix Key Creation and Deletion

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PIX0008* | Pix key creation | Create Pix key of type cpf, cnpj, random, email and phone | [Documentation Link](/documentation/pix/criar_chave) | 
|QIC0004 or QIC0005  |](/documentation/baas/pix/consultar_chave_pix)
| PIX0009 | Pix key deletion | Delete a Pix key | [Documentation Link](/documentation/pix/excluir_chave) | PIX0008 |
| PIX0010* | List Pix keys of a QI Account | List Pix keys linked to a QI Account | [Documentation Link](/documentation/pix/listar_chaves_pix) | PIX0008 |

### Pix Key Portability

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PIX0013* | Create Pix Key Portability In request | Create a Pix Key Portability In request for CPF, CNPJ, Email, Phone and Random key types | [Documentation Link](/documentation/pix/portabilidade#criando-um-pedido-de-portabilidade) |  QIC0004 or QIC0005  |
| PIX0014* | Resend 2fa for Email or Phone Pix Key Portability In request | Request SMS resend (Phone type Pix Key) or Email (Email type Pix Key) for a pending Pix Key Portability In request (pending_claimer_validation) | [Documentation Link](/documentation/pix/portabilidade#reenviando-a-valida%C3%A7%C3%A3o-de-dois-fatores) | PIX0013 |
| PIX0015* | Delete Pix Key Portability In request | Delete a pending Pix Key Portability In request | [Documentation Link](/documentation/pix/portabilidade#deletando-um-pedido-de-portabilidade) | PIX0013 |
| PIX0016* | Reading Pix Key Portability In completion webhook | Read correctly the completion webhook for a Pix Key Portability In request. Testing all possible completion statuses (concluded, cancelled and failed) | Webhook: <br/> [Documentation Link](/documentation/pix/portabilidade#conclus%C3%A3o-da-portabilidade) |PIX0013 |
| PIX0017* | Pix Key Portability Out request simulation | Simulate the arrival of a Pix Key Portability Out request | Item 5:<br/> [Documentation Link](/documentation/pix/simulacao/index.html) | PIX0013 |
| PIX0018* | Approval and rejection of Pix Key Portability Out request | Perform approval of a Pix Key Portability Out request | [Documentation Link](/documentation/pix/portabilidade#request-4) | PIX0017 |
| PIX0019* | Resend 2fa for Pix Key Portability Out request | Request 2fa resend for a Pix Key Portability Out request | Enum "pending_donator_validation"  <br/> [Documentation Link](/documentation/pix/portabilidade#request-4) | PIX0018 |
| PIX0020* | Reading Pix Key Portability Out completion webhook | Read correctly the completion webhook for a Pix Key Portability Out request. Testing all possible completion statuses (concluded, cancelled and failed) | [Documentation Link](D/documentation/pix/portabilidade#conclus%C3%A3o-da-portabilidade-1) | PIX0018 |

## Pix QR Code Management

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PIX0022* | Static Pix QR Code creation | Generate Static QR Code | [Documentation Link](/documentation/pix/criar_qr_code_estatico) | PIX0008 |
| PIX0023 | Dynamic Pix QR Code creation | Generate Dynamic QR Code with due date (due day) and generate Instant Dynamic QR Code (with seconds of expiration). | [Documentation Link](/documentation/pix/criar_qr_code_dinamico) | PIX0008 |
| PIX0024 | Dynamic Pix QR Code deletion | Delete Pix QR Code | [Documentation Link](/documentation/pix/baixar_qr_code_dinamico) | PIX0023 |
| PIX0025 | List Dynamic Pix QR Codes | List Dynamic Pix QR Codes | [Documentation Link](/documentation/pix/pesquisar_por_qr_code_dinamico) | PIX0023 |
| PIX0026 | Reading Instant Dynamic Pix QR Code expiration webhook | Successfully receive an Instant Dynamic Pix QR Code expiration webhook | [Documentation Link](/documentation/pix/webhook_por_qr_code_expirado) | PIX0023 |

## Pix QR Code Payment

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PIX0029* | Static Pix QR Code payment | Perform payment of a Static Pix QR Code | [1. Request transfer](/documentation/baas/pix/2fa_v2/solicitacao_de_transacao_pix_2fa) <br></br> [2. Approve transfer](/documentation/baas/pix/2fa_v2/aprovar_transacao_pix_2fa) | PIX0022 |
| PIX0030* | Dynamic Pix QR Code payment | Perform payment of a Dynamic Pix QR Code |  [1. Request transfer](/documentation/baas/pix/2fa_v2/solicitacao_de_transacao_pix_2fa) <br></br> [2. Approve transfer](/documentation/baas/pix/2fa_v2/aprovar_transacao_pix_2fa) | PIX0022 |
| PIX0027* | Pix QR Code decoding | Decode a Static Pix QR Code, Dynamic with due date and Instant Dynamic | [Documentation Link](/documentation/pix/decodificar_qr_code) | PIX0022 and PIX0023 |

## Pix Limit Management

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PIX0032* | Pix limit change request | Perform Pix limit change request for a QI Account | [Documentation Link](/documentation/pix/solicitar_alteracao_de_limite_pix) |  QIC0004 or QIC0005  |
| PIX0033 | List Pix limit change requests | List Pix limit change requests for a QI Account | [Documentation Link](/documentation/pix/busca_por_solicitacao_de_limite_pix) | PIX0032 |
| PIX0034* | Query consumed Pix limit | Query consumed Pix limit for a QI Account | [Documentation Link](/documentation/pix/busca_por_uso_de_limite_pix) |  QIC0004 or QIC0005  |

---

# Fee Management
| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| GTF0001* | Fee change request | Perform fee change for an account| [Documentation Link](/documentation/contas/gestao_de_tarifas) |  QIC0004 or QIC0005  |
| GTF0002* | Fee query  | Query fees registered for an account | [Documentation Link](/documentation/contas/consulta_de_tarifas) |  QIC0004 or QIC0005  |

## Administrator User Management
| GUA0001* | Add administrator user | Create and link an administrator user to a QI Account. | Intro: [Documentation](/documentation/gestao_de_usuarios/tfa_introducao)<br/>1. Creation: [Documentation](/documentation/gestao_de_usuarios/criacao_de_pessoa)<br/>2. Addition: [Documentation](/documentation/gestao_de_usuarios/inclusao_de_vinculo) |QIC0004 or QIC0005 |
| GUA0002* | Change administrator user contact data | Perform change of contact data (Email and phone) for an administrator user | [Documentation Link](/documentation/gestao_de_usuarios/alteracao_de_contato_de_vinculo) |  |
| GUA0003* | Delete administrator user | Delete link between an administrator user and a QI Account | [Documentation Link](/documentation/gestao_de_usuarios/exclusao_de_vinculo) |  |

# Card Management

## Card Creation
| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| GDC0001* | Virtual card creation  | Create a virtual card| [Documentation Link](/documentation/cards/create/gerar_cartao_virtual) |  QIC0004 or QIC0005  |
| GDC0002* | Physical card creation  | Create a physical card| [Documentation Link](/documentation/cards/create/gerar_cartao_fisico) |  QIC0004 or QIC0005  |

## Card Query
| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| GDC0003* | Query card by key  | Query a card | [Documentation Link](/documentation/cards/search/buscar_cartao_by_key) | GDC0001 or GDC0002 |
| GDC0004* | List cards  | List cards| [Documentation Link](/documentation/cards/search/listar_cartoes) | GDC0001 or GDC0002 |
| GDC0005* | Search card data | Search card data| [Documentation Link](/documentation/cards/search/buscar_dados_pci) | GDC0001 or GDC0002 |
| GDC0006* | Search PCI password | Search PCI password| [Documentation Link](/documentation/cards/search/buscar_senha) | GDC0001 or GDC0002 |
| GDC0007* | Query delivery data | Query delivery data| [Documentation Link](/documentation/cards/search/buscar_entrega_by_key) | GDC0001 or GDC0002 |

## Update card data
| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| GDC0008* | Update card status  | Update card status| [Documentation Link](/documentation/cards/status/update_status_cartao) | GDC0001 or GDC0002 |
| GDC0009* | Activate physical card  | Activate a physical card| [Documentation Link](/documentation/cards/status/ativar_cartao

---

# Homologation Roadmap - BaaS Digital Account with Dual Authentication

URL: /en/documentation/roteiros_de_homologacao/conta_digital_2fa_baas

The homologation roadmap describes all the features and functionalities that need
to be tested by the integrating partner in QI Tech's sandbox environment (test environment), 
before going into production environment of the product.

This roadmap describes all the features and functionalities involved in the product. 

⚠️ **All tests must be mandatory performed in QI Tech's Sandbox environment (test environment).
The transactions carried out in Sandbox environment are fictitious financial transactions, serving only to test API functionalities.**

## Registration and Authentication API BaaS
| Code  | Step | Description | Documentation Link | Prerequisite |
| --- | --- | --- | --- | --- |
| CAB0001* | Registration in Sandbox environment | Perform registration on QI Tech's platform in Sandbox environment (sandbox.qitech.app) | cs@qitech.com.br |
| CAB0002* | Token validation in Sandbox | Perform QI Token validation in Sandbox | [Documentation Link](https://docs.qitech.com.br/assets/pdfs/QI%20Tech%20Manual%20Inclus%C3%A3o%20de%20Token.pdf) | CAB0001 |
| CAB0003* | Public key exchange | Perform public key exchange within QI Tech's platform in sandbox (sandbox.qitech.app) | [Documentation Link](/documentation/primeiros_passos/troca_de_chaves) | CAB0001 and CAB0002 |
| CAB0004* | API call authentication test | Complete API call authentication test |[Documentation Link](/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_v2) <br/><br/> [Documentation Link](/documentation/primeiros_passos/teste_de_autenticacao/endpoints_de_teste) | CAB0003 |
| CAB0005* | Webhook configuration | Perform URL configuration for webhook sending by QI, through QI Tech's platform in sandbox (sandbox.qitech.app) | [Documentation Link](/documentation/primeiros_passos/configurando_webhooks) | CAB0001 and CAB0002 |

# **QI Account**

## Account Opening

| Code | Step | Description | Documentation Link | Prerequisite |
| --- | --- | --- | --- | --- |
| QIC0002* | Individual account reservation | Request reservation of an account whose holder is an individual | [Documentation Link](/documentation/baas/account/reservar_conta_pf) | CAB0005 and CAB0006 |
| QIC0003* | Individual account opening | Perform opening of an account whose holder is an individual | [Documentation Link](/documentation/baas/account/abrir_conta_pf) | QIC0002 |
| QIC0004* | Legal entity account reservation | Request reservation of an account whose holder is a legal entity | [Documentation Link](/documentation/baas/account/reservar_conta_pj) | CAB0005 and CAB0006 |
| QIC0005* | Legal entity account opening | Perform opening of an account whose holder is a legal entity | [Documentation Link](/documentation/baas/account/abrir_conta_pj) | QIC0004 |
| QIC0006* | Reading account opening webhooks | Correctly read account opening webhooks | Item 1.2. or 1.3:<br/>[Documentation Link](/documentation/baas/account/webhooks) |  QIC0004 or QIC0005  |
| QIC0007* | List accounts | List opened accounts| [Documentation Link](/documentation/contas/consultar_conta) |  QIC0004 or QIC0005  |
| QIC0008* | Query account data | Query data such as balance, holder data, opening date, among others | [Documentation Link](/documentation/contas/consultar_conta) |  QIC0004 or QIC0005  |

## Transactions

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| QIC0008* | Statement Query | Perform statement query of an account | [Documentation Link](/documentation/movimentacao_de_contas/consulta_de_transacoes) |  QIC0004 or QIC0005  |
| QIC0009* | Transfer receipt request | Request a transfer receipt | [Documentation Link](/documentation/movimentacao_de_contas/comprovante_de_transferencia)|  |
| QIC0010* | Reading transaction webhooks | Successfully receive all transaction webhooks |  [Documentation Link](/documentation/movimentacao_de_contas/webhook_movimentacoes/index.html) |  QIC0004 or QIC0005  |
| QIC0011* | Financial institutions list query | Query list of financial institutions enabled for TED and Pix receiving |  [Documentation Link](/documentation/lista_de_instituicoes_financeiras/consulta_de_instituicoes_financeiras) |  QIC0004 or QIC0005  |

---

# Document Upload

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| UDD0001* | Document upload | Upload a document through our document API |  [Documentation Link](/documentation/upload_de_documentos/) |  |

---

# TED

| Code | Step | Description | Link                                                                                                        | Prerequisite |
| --- | --- | --- |-------------------------------------------------------------------------------------------------------------| --- |
| TED0001* | TED Out Transfer | Perform TED transfer  | 1 . Create transfer request: [Documentation Link](/documentation/baas/ted/realizar_transferencia_2fa) <br/>   2 . Approve transfer: [Documentation Link](/documentation/baas/ted/realizar_transferencia_2fa) <br/>           | QIC0004 or QIC0005 |
| TED0006* | Request token resend| Resend TED transfer approval token | [Documentation Link](/documentation/baas/ted/2fa/solicitacao_de_reenvio_de_token) | TED0001 |
| TED0002* | TED Out reversal simulation | Simulate reversal of a TED Out sent from a QI Account | Item 3: <br/>[Documentation Link](/documentation/movimentacao_de_contas/transacao) |  |
| TED0003* | TED In simulation | Simulate entry of a TED In into a QI account | Item 2: <br/>[Documentation Link](/documentation/movimentacao_de_contas/transacao) | QIC0004 or QIC0005 |
| TED0004* | List TED transactions| List inbound/outbound TED transactions  | [Documentation Link](/documentation/baas/ted/listar_teds)  | QIC0004 or QIC0005 |
| TED0004* | Query TED transaction| Perform query of a TED transaction  | [Documentation Link](/documentation/baas/ted/consultar_ted)           | QIC0004 or QIC0005 |
| TED0006* | Reading TED webhooks| Successfully receive a TED webhook | [Documentation Link](/documentation/baas/ted/webhooks/index.html)| QIC0004 or QIC0005 |
---

# Internal Transfer

| No. | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| TFI0001 | Internal Transfer with account debit | Command a transfer from a QI Account, having another QI Account as the transfer destination |  1 . Create transfer request: [Documentation Link](/documentation/baas/ted/realizar_transferencia_2fa) <br/>   2 . Approve transfer: [Documentation Link](/documentation/baas/ted/realizar_transferencia_2fa) <br/> |  QIC0004 or QIC0005  |
| TFI0002 | Internal transfer simulation with account credit | Simulate receiving funds in the target QI Account, having another QI Account as origin | Item 1: <br/> [Documentation Link](/documentation/movimentacao_de_contas/transacao) |  QIC0004 or QIC0005  |

---

# Boletos

## Boleto Management

| No. | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| No.      | Step | Description | Link  | Prerequisite |
|---|---|---|---|---|
| BOL0001 | Single charge boleto registration    | Perform registration of a charge boleto | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_padrao/index.html) |QIC0004 or QIC0005   |
| BOL0002 | Single instant charge boleto registration | Perform registration of a charge boleto | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_instantanea) |QIC0004 or QIC0005   |
| BOL0003 | Batch boleto registration  | Perform batch charge boleto registration | [Documentation Link](/documentation/boletos/v2/emissao/emissao_em_lote) |QIC0004 or QIC0005   |
| BOL0004 | Standard Single Boleto Issuance        | Issue a standard single boleto    | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_padrao)  |QIC0004 or QIC0005   |
| BOL0005 | Instant Single Boleto Issuance   | Issue an instant single boleto | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_instantanea) |QIC0004 or QIC0005   |
| BOL0006 | Batch Issuance   | Issue boletos in batch | [Documentation Link](/documentation/boletos/v2/emissao/emissao_em_lote)|QIC0004 or QIC0005   |
| BOL0007 | Perform discount on boleto amount | Perform discount on boleto amount | [Documentation Link](/documentation/boletos/v2/instrucoes/abatimento/criar_abatimento) | BOL0001, BOL0002 or BOL0003 |
| BOL0008 | Cancel Discount     | Cancel discount on a boleto | [Documentation Link](/documentation/boletos/v2/instrucoes/abatimento/cancelar_abatimento) | BOL0001, BOL0002 or BOL0003  |
| BOL0009 | Extend boleto due date               | Send due date extension of a boleto | [Documentation Link](/documentation/boletos/v2/instrucoes/extensao)     | BOL0001, BOL0002 or BOL0003   |
| BOL0010 | Include discount on a boleto               | Include discount on a boleto    | [Documentation Link](/documentation/boletos/v2/instrucoes/desconto)     | BOL0001, BOL0002 or BOL0003   |
| BOL0011 | Include interest on a boleto                   | Include interest on a boleto       | [Documentation Link](/documentation/boletos/v2/instrucoes/juros)        | BOL0001, BOL0002 or BOL0003   |
| BOL0012 | Include penalty on a boleto                   | Include penalty on a boleto       | [Documentation Link](/documentation/boletos/v2/instrucoes/multa)        | BOL0001, BOL0002 or BOL0003   |
| BOL0013 | Perform boleto settlement                   | Settle a boleto                 | [Documentation Link](/documentation/boletos/v2/instrucoes/baixa)        | BOL0001, BOL0002 or BOL0003   |
| BOL0014 | Query boletos by key      | Query boletos by key      | [Documentation Link](/documentation/boletos/v2/consulta/consulta_por_chave) | BOL0001, BOL0002 or BOL0003   |
| BOL0015 | List Boletos          | List boletos     | [Documentation Link](/documentation/boletos/v2/consulta/listar_boletos) | BOL0001, BOL0002 or BOL0003   |
| BOL0016 | Charge portfolio query      | Query a charge portfolio | [Documentation Link](/documentation/boletos/v2/carteira/listar_carteiras/index.html) | BOL0001, BOL0002 or BOL0003   |
| BOL0017 | Boleto Webhooks      | Read webhook for boleto | [Documentation Link](/documentation/boletos/v2/webhooks/boleto) | BOL0001, BOL0002 or BOL0003   |

## Boleto Payment

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| BOL0009* | Typeable line or Barcode query | Perform query of a bank boleto typeable line | [Documentation Link](/documentation/baas/cobranca/consultar_boleto_bancario) |  |
| BOL0010* | Request Token for boleto payment | Request token for bank boleto payment | [Documentation Link](/documentation/baas/cobranca/2fa_v2/solicitacao_de_pagamento_de_boleto_bancario) |  QIC0004 or QIC0005  |
| BOL0011* | Approve boleto payment | Request token for bank boleto payment  | [Documentation Link](/documentation/baas/cobranca/2fa_v2/confirmacao_de_pagamento_de_boleto_bancario) |  QIC0004 or QIC0005  |
| BOL0012* | Query typeable line or Barcode of a service boleto | Perform query of a service boleto typeable line. | [Documentation Link](/documentation/baas/cobranca/consultar_fatura_de_recolhimento) |  |
| BOL0013* | Request Token for service boleto payment | Request token for service boleto payment | [Documentation Link](/documentation/baas/cobranca/2fa_v2/solicitacao_de_pagamento_de_fatura_de_recolhimento) |  QIC0004 or QIC0005  |
| BOL0014* | Approve service boleto payment| Request token for service boleto payment  | [Documentation Link](/documentation/baas/cobranca/2fa_v2/confirmacao_de_pagamento_de_fatura_de_recolhimento) |  QIC0004 or QIC0005  |

---

## Pix

## Pix Transfer 
| Code  | Step | Description | Documentation Link | Prerequisite |
|---------|--|---|---|---|
| PIX0002* | Pix Out Transfer | Perform a Pix transfer from a QI Account using bank data (manual pix) or Pix key | [1. Request transfer](/documentation/baas/pix/2fa_v2/solicitacao_de_transacao_pix_2fa) <br></br> [2. Approve transfer](/documentation/baas/pix/2fa_v2/aprovar_transacao_pix_2fa) | CAB0001 |
| PIX0035 | Pix transfer query | Retrieve transfer data | [Documentation Link](/documentation/baas/pix/consultar_transferencias) | PIX0002 |
| PIX0003* | Pix Out refund simulation | Simulate Pix Out refund. | [Documentation Link - Item 2](/documentation/pix/simulacao)| PIX0002 |
| PIX0004* | Pix In simulation | Simulate Pix In credit in a QI Account. | [Documentation Link -> Item 1](/documentation/pix/simulacao)||
| PIX0037* | Reading pending transaction webhook | Successfully receive a pending transaction webhook | [Documentation Link][(/documentation/baas/pix/webhooks) | PIX0002 |
| PIX0038* | Reading Pix In webhook | Successfully receive an inbound Pix transfer webhook | [Documentation Link](/documentation/baas/pix/webhooks#webhook-para-pix-de-entrada)| PIX0004 |
| PIX0039 | Reading Pix Reversal webhook | Successfully receive a Pix reversal webhook | [Documentation Link](/documentation/baas/pix/webhooks#webhook-para-devolu%C3%A7%C3%B5es-de-pix) | PIX0003 |
| PIX0040 | Request reversal of a received Pix | Request reversal of a received Pix | [1. Request reversal](/documentation/baas/pix/2fa_v2/solicitacao_de_devolucao_pix) <br></br> [2. Approve reversal](/documentation/baas/pix/2fa_v2/aprovar_transacao_pix_2fa) | PIX0003 |
| PIX0041 | List account Pix transfers | List account Pix transfers | [Documentation Link](/documentation/baas/pix/listar_transferencias) | PIX0003 |

## Pix Key Management

### Pix Key Creation and Deletion

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PIX0008* | Pix key creation | Perform Pix key creation of cpf, cnpj, random, email and phone types | [Documentation Link](/documentation/pix/criar_chave) | 
|QIC0004 or QIC0005  |](/documentation/baas/pix/consultar_chave_pix)
| PIX0009 | Pix key deletion | Perform Pix key deletion | [Documentation Link](/documentation/pix/excluir_chave) | PIX0008 |
| PIX0010* | List Pix keys of a QI Account | List Pix keys linked to a QI Account | [Documentation Link](/documentation/pix/listar_chaves_pix) | PIX0008 |

### Pix Key Portability

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PIX0013* | Create Pix Key Portability In Request | Create a Pix Key Portability In request of CPF, CNPJ, Email, Phone and Random types | [Documentation Link](/documentation/pix/portabilidade#criando-um-pedido-de-portabilidade) |  QIC0004 or QIC0005  |
| PIX0014* | Resend 2fa of a Pix Key Portability In Request of Email or Phone type | Request SMS (Phone type Pix Key) or Email (Email type Pix Key) resend of a pending Pix Key Portability In Request (pending_claimer_validation) | [Documentation Link](/documentation/pix/portabilidade#reenviando-a-valida%C3%A7%C3%A3o-de-dois-fatores) | PIX0013 |
| PIX0015* | Delete Pix Key Portability In Request | Delete a pending Pix Key Portability In Request | [Documentation Link](/documentation/pix/portabilidade#deletando-um-pedido-de-portabilidade) | PIX0013 |
| PIX0016* | Reading Pix Key Portability In Request completion webhook | Correctly read the completion webhook of a Pix Key Portability In Request. Testing all possible completion statuses (concluded, cancelled and failed) | Webhook: <br/> [Documentation Link](/documentation/pix/portabilidade#conclus%C3%A3o-da-portabilidade) |PIX0013 |
| PIX0017* | Simulate Pix Key Portability Out Request | Simulate arrival of a Pix Key Portability Out Request | Item 5:<br/> [Documentation Link](/documentation/pix/simulacao/index.html) | PIX0013 |
| PIX0018* | Approve and Reject Pix Key Portability Out Request | Perform approval of a Pix Key Portability Out Request | [Documentation Link](/documentation/pix/portabilidade#request-4) | PIX0017 |
| PIX0019* | Resend 2fa of a Pix Key Portability Out Request | Request 2fa resend of a Pix Key Portability Out Request | Enum "pending_donator_validation"  <br/> [Documentation Link](/documentation/pix/portabilidade#request-4) | PIX0018 |
| PIX0020* | Reading Pix Key Portability Out Request completion webhook | Correctly read the completion webhook of a Pix Key Portability Out Request. Testing all possible completion statuses (concluded, cancelled and failed) | [Documentation Link](D/documentation/pix/portabilidade#conclus%C3%A3o-da-portabilidade-1) | PIX0018 |

## Pix QR Code Management

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PIX0022* | Static Pix QR Code creation | Generate Static QR Code | [Documentation Link](/documentation/pix/criar_qr_code_estatico) | PIX0008 |
| PIX0023 | Dynamic Pix QR Code creation | Generate Dynamic QR Code with expiry (due date) and generate Instant Dynamic QR Code (with expiration seconds). | [Documentation Link](/documentation/pix/criar_qr_code_dinamico) | PIX0008 |
| PIX0024 | Dynamic Pix QR Code deletion | Delete Pix QR Code | [Documentation Link](/documentation/pix/baixar_qr_code_dinamico) | PIX0023 |
| PIX0025 | List Dynamic Pix QR Codes | List Dynamic Pix QR Codes | [Documentation Link](/documentation/pix/pesquisar_por_qr_code_dinamico) | PIX0023 |
| PIX0026 | Reading Instant Dynamic Pix QR Code expiry webhook | Successfully receive an Instant Dynamic Pix QR Code expiry webhook | [Documentation Link](/documentation/pix/webhook_por_qr_code_expirado) | PIX0023 |

## Pix QR Code Payment

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PIX0029* | Static Pix QR Code payment | Perform Static Pix QR Code payment | [1. Request transfer](/documentation/baas/pix/2fa_v2/solicitacao_de_transacao_pix_2fa) <br></br> [2. Approve transfer](/documentation/baas/pix/2fa_v2/aprovar_transacao_pix_2fa) | PIX0022 |
| PIX0030* | Dynamic Pix QR Code payment | Perform Dynamic Pix QR Code payment |  [1. Request transfer](/documentation/baas/pix/2fa_v2/solicitacao_de_transacao_pix_2fa) <br></br> [2. Approve transfer](/documentation/baas/pix/2fa_v2/aprovar_transacao_pix_2fa) | PIX0022 |
| PIX0027* | Pix QR Code decoding | Decode a Static, Dynamic with expiry and Instant Dynamic Pix QR Code | [Documentation Link](/documentation/pix/decodificar_qr_code) | PIX0022 and PIX0023 |

## Pix Limit Management

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PIX0032* | Request Pix limit change | Request Pix limit change for a QI Account | [Documentation Link](/documentation/pix/solicitar_alteracao_de_limite_pix) |  QIC0004 or QIC0005  |
| PIX0033 | List Pix limit change requests | List Pix limit change requests for a QI Account | [Documentation Link](/documentation/pix/busca_por_solicitacao_de_limite_pix) | PIX0032 |
| PIX0034* | Query consumed Pix limit | Query consumed Pix limit for a QI Account | [Documentation Link](/documentation/pix/busca_por_uso_de_limite_pix) |  QIC0004 or QIC0005  |

---

# Fee Management
| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| GTF0001* | Request fee change | Perform fee change for an account| [Documentation Link](/documentation/contas/gestao_de_tarifas) |  QIC0004 or QIC0005  |
| GTF0002* | Fee query  | Query fees registered for an account | [Documentation Link](/documentation/contas/consulta_de_tarifas) |  QIC0004 or QIC0005  |

## Administrator Users Management
| GUA0001* | Add administrator user | Perform creation and linking of an administrator user to a QI Account. | Intro: [Documentation](/documentation/gestao_de_usuarios/tfa_introducao)<br/>1. Creation: [Documentation](/documentation/gestao_de_usuarios/criacao_de_pessoa)<br/>2. Addition: [Documentation](/documentation/gestao_de_usuarios/inclusao_de_vinculo) |QIC0004 or QIC0005 |
| GUA0002* | Change administrator user contact data | Perform contact data change (Email and phone) of an administrator user | [Documentation Link](/documentation/gestao_de_usuarios/alteracao_de_contato_de_vinculo) |  |
| GUA0003* | Delete administrator user | Perform deletion of link between an administrator user and a QI Account | [Documentation Link](/documentation/gestao_de_usuarios/exclusao_de_vinculo) |  |

# Card Management

## Card Creation
| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| GDC0001* | Virtual card creation  | Perform virtual card creation| [Documentation Link](/documentation/cards/create/gerar_cartao_virtual) |  QIC0004 or QIC0005  |
| GDC0002* | Physical card creation  | Perform physical card creation| [Documentation Link](/documentation/cards/create/gerar_cartao_fisico) |  QIC0004 or QIC0005  |

## Card Query
| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| GDC0003* | Query card by key  | Perform card query | [Documentation Link](/documentation/cards/search/buscar_cartao_by_key) | GDC0001 or GDC0002 |
| GDC0004* | List cards  | Perform card listing| [Documentation Link](/documentation/cards/search/listar_cartoes) | GDC0001 or GDC0002 |
| GDC0005* | Search card data | Search card data| [Documentation Link](/documentation/cards/search/buscar_dados_pci) | GDC0001 or GDC0002 |
| GDC0006* | Search PCI Password | Search PCI Password| [Documentation Link](/documentation/cards/search/buscar_senha) | GDC0001 or GDC0002 |
| GDC0007* | Query delivery data | Query delivery data| [Documentation Link](/documentation/cards/search/buscar_entrega_by_key) | GDC0001 or GDC0002 |

## Update card data
| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| GDC0008* | Update card status  | Update card status| [Documentation Link](/documentation/cards/status/update_status_cartao) | GDC0001 or GDC0002 |
| GDC0009* | Activate physical card  | Perform physical card activation| [Documentation Link](/documentation/cards/status/ativar_cartao) | GDC0001 or GDC0002 |
| GDC0010* | Change Password   | Perform card password change | [Documentation Link](/documentation/cards/update/password_cartao) | GDC0001 or GDC0002 |
| GDC0011* | Configure card contactless  | Configure card contactless  | [Documentation Link](/documentation/cards/update/contactless_cartao) | GDC0002 |

---

# Homologation Roadmap - BaaS Digital Account

URL: /en/documentation/roteiros_de_homologacao/conta_digital_baas

The homologation roadmap describes all the resources and functionalities that need
to be tested by the integrator partner in QI Tech's sandbox environment (test environment), 
before entering the product's production environment.

This roadmap describes all the resources and functionalities involved in the product. 

⚠️ **All tests must be mandatorily performed in QI Tech's Sandbox environment (test environment).
Transactions performed in the Sandbox environment are fictitious financial transactions, serving only to test API functionality.**

## BaaS API Registration and Authentication
| Code  | Step | Description | Documentation Link | Pre-requisite |
| --- | --- | --- | --- | --- |
| CAB0001* | Registration in Sandbox environment | Register on QI Tech's platform in the Sandbox environment (sandbox.qitech.app) | cs@qitech.com.br |
| CAB0002* | Token validation in Sandbox | Perform QI Token validation in Sandbox | [Documentation Link](https://docs.qitech.com.br/assets/pdfs/QI%20Tech%20Manual%20Inclus%C3%A3o%20de%20Token.pdf) | CAB0001 |
| CAB0003* | Public key exchange | Perform public key exchange within QI Tech's platform in sandbox (sandbox.qitech.app) | [Documentation Link](/documentation/primeiros_passos/troca_de_chaves) | CAB0001 and CAB0002 |
| CAB0004* | Call authentication test | Complete call authentication test |[Documentation Link](/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_v2) <br/><br/> [Documentation Link](/documentation/primeiros_passos/teste_de_autenticacao/endpoints_de_teste) | CAB0003 |
| CAB0005* | Webhook configuration | Configure the URL for sending webhooks from QI, through QI Tech's platform in sandbox (sandbox.qitech.app) | [Documentation Link](/documentation/primeiros_passos/configurando_webhooks) | CAB0001 and CAB0002 |

# **QI Account**

## Account Opening

| Code | Step | Description | Documentation Link | Pre-requisite |
| --- | --- | --- | --- | --- |
| QIC0002* | Individual account reservation | Request reservation of an account whose holder is an individual | [Documentation Link](/documentation/baas/account/reservar_conta_pf) | CAB0005 and CAB0006 |
| QIC0003* | Individual account opening | Open an account whose holder is an individual | [Documentation Link](/documentation/baas/account/abrir_conta_pf) | CAB0005 and CAB0006 |
| QIC0004* | Corporate account reservation | Request reservation of an account whose holder is a legal entity | [Documentation Link](/documentation/baas/account/reservar_conta_pj) | CAB0005 and CAB0006 |
| QIC0005* | Corporate account opening | Open an account whose holder is a legal entity | [Documentation Link](/documentation/baas/account/abrir_conta_pj) | CAB0005 and CAB0006 |
| QIC0006* | Reading account opening webhooks | Correctly read account opening webhooks | Item 1.2. or 1.3:<br/>[Documentation Link](/documentation/baas/account/webhooks) |  QIC0003 or QIC0005  |
| QIC0007* | List accounts | List open accounts| [Documentation Link](/documentation/contas/consultar_conta) |  QIC0003 or QIC0005  |
| QIC0008* | Query account data | Query data such as balance, holder data, opening date, among others | [Documentation Link](/documentation/contas/consultar_conta) |  QIC0003 or QIC0005  |

## Transactions

| Code | Step | Description | Link | Pre-requisite |
| --- | --- | --- | --- | --- |
| QIC0008* | Statement Query | Query an account's statement | [Documentation Link](/documentation/movimentacao_de_contas/consulta_de_transacoes) |  QIC0003 or QIC0005  |
| QIC0009* | Transfer receipt request | Request a transfer receipt | [Documentation Link](/documentation/movimentacao_de_contas/comprovante_de_transferencia)|  |
| QIC0010* | Reading transaction webhooks | Successfully receive all transaction webhooks |  [Documentation Link](/documentation/movimentacao_de_contas/webhook_movimentacoes/index.html) |  QIC0003 or QIC0005  |
| QIC0011* | Query list of financial institutions | Query list of financial institutions enabled to receive TED and Pix |  [Documentation Link](/documentation/lista_de_instituicoes_financeiras/consulta_de_instituicoes_financeiras) |  QIC0003 or QIC0005  |

---

# Document Upload

| Code | Step | Description | Link | Pre-requisite |
| --- | --- | --- | --- | --- |
| UDD0001* | Document upload | Upload a document through our document API |  [Documentation Link](/documentation/upload_de_documentos/) |  |

---

# TED

| Code | Step | Description | Link                                                                                                        | Pre-requisite |
| --- | --- | --- |-------------------------------------------------------------------------------------------------------------| --- |
| TED0001* | TED Out Transfer | Perform TED transfer  | [Documentation Link](/documentation/baas/ted/realizar_transferencia) | QIC0003 or QIC0005 |
| TED0002* | TED Out reversal simulation | Simulate the reversal of a TED Out sent from a QI Account | Item 3: <br/>[Documentation Link](/documentation/movimentacao_de_contas/transacao) | TED0003 |
| TED0003* | TED In simulation | Simulate the entry of a TED In into a QI account | Item 2: <br/>[Documentation Link](/documentation/movimentacao_de_contas/transacao) | QIC0003 or QIC0005 |
| TED0004* | List TED transactions| List incoming/outgoing TED transactions  | [Documentation Link](/documentation/baas/ted/listar_teds)  | QIC0003 or QIC0005 |
| TED0004* | TED transaction query| Query a TED transaction  | [Documentation Link](/documentation/baas/ted/consultar_ted)           | QIC0003 or QIC0005 |
| TED0006* | Reading TED webhooks| Successfully receive a TED webhook | [Documentation Link](/documentation/baas/ted/webhooks/index.html)| QIC0003 or QIC0005 |
---

# Internal Transfer

| No. | Step | Description | Link | Pre-requisite |
| --- | --- | --- | --- | --- |
| TFI0001 | Internal Transfer with account debit | Command a transfer from a QI Account, with another QI Account as the transfer destination | [Documentation Link](/documentation/baas/ted/realizar_transferencia) |  QIC0003 or QIC0005  |
| TFI0002 | Internal transfer simulation with account credit | Simulate receiving funds in the target QI Account, originating from another QI Account | Item 1: <br/> [Documentation Link](/documentation/movimentacao_de_contas/transacao) |  QIC0003 or QIC0005  |

---

# Bank Slips

## Bank Slip Management

| No. | Step | Description | Link | Pre-requisite |
| --- | --- | --- | --- | --- |
| No.      | Step | Description | Link  | Pre-requisite |
|---|---|---|---|---|
| BOL0001 | Registration of a single collection bank slip    | Register a collection bank slip | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_padrao/index.html) | CAB0002 or CAB0003   |
| BOL0002 | Registration of a single instant collection bank slip | Register a collection bank slip | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_instantanea) | CAB0002 or CAB0003   |
| BOL0003 | Batch bank slip registration  | Register collection bank slips in batch | [Documentation Link](/documentation/boletos/v2/emissao/emissao_em_lote) | CAB0002 or CAB0003   |
| BOL0004 | Standard Single Bank Slip Issuance        | Issue a standard single bank slip    | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_padrao)  | CAB0002 or CAB0003   |
| BOL0005 | Instant Single Bank Slip Issuance   | Issue an instant single bank slip | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_instantanea) | CAB0002 or CAB0003   |
| BOL0006 | Batch Issuance   | Issue bank slips in batch | [Documentation Link](/documentation/boletos/v2/emissao/emissao_em_lote)| CAB0002 or CAB0003   |
| BOL0007 | Apply discount to bank slip amount | Apply discount to bank slip amount | [Documentation Link](/documentation/boletos/v2/instrucoes/abatimento/criar_abatimento) | BOL0001, BOL0002 or BOL0003 |
| BOL0008 | Cancel Discount     | Cancel discount on a bank slip | [Documentation Link](/documentation/boletos/v2/instrucoes/abatimento/cancelar_abatimento) | BOL0001, BOL0002 or BOL0003  |
| BOL0009 | Extend bank slip due date               | Send bank slip due date extension | [Documentation Link](/documentation/boletos/v2/instrucoes/extensao)     | BOL0001, BOL0002 or BOL0003   |
| BOL0010 | Include discount on bank slip               | Include discount on bank slip    | [Documentation Link](/documentation/boletos/v2/instrucoes/desconto)     | BOL0001, BOL0002 or BOL0003   |
| BOL0011 | Include interest on bank slip                   | Include interest on bank slip       | [Documentation Link](/documentation/boletos/v2/instrucoes/juros)        | BOL0001, BOL0002 or BOL0003   |
| BOL0012 | Include penalty on bank slip                   | Include penalty on bank slip       | [Documentation Link](/documentation/boletos/v2/instrucoes/multa)        | BOL0001, BOL0002 or BOL0003   |
| BOL0013 | Write off a bank slip                   | Write off a bank slip                 | [Documentation Link](/documentation/boletos/v2/instrucoes/baixa)        | BOL0001, BOL0002 or BOL0003   |
| BOL0014 | Query bank slips by key      | Query bank slips by key      | [Documentation Link](/documentation/boletos/v2/consulta/consulta_por_chave) | BOL0001, BOL0002 or BOL0003   |
| BOL0015 | List Bank Slips          | List bank slips     | [Documentation Link](/documentation/boletos/v2/consulta/listar_boletos) | BOL0001, BOL0002 or BOL0003   |
| BOL0016 | Collection portfolio query      | Query a collection portfolio | [Documentation Link](/documentation/boletos/v2/carteira/listar_carteiras/index.html) | BOL0001, BOL0002 or BOL0003   |
| BOL0017 | Bank Slip Webhooks      | Read webhook for bank slip | [Documentation Link](/documentation/boletos/v2/webhooks/boleto) | BOL0001, BOL0002 or BOL0003   |

## Bank Slip Payment

| Code | Step | Description | Link | Pre-requisite |
| --- | --- | --- | --- | --- |
| BOL0009* | Query barcode or typeable line | Query a typeable line of a bank slip | [Documentation Link](/documentation/baas/cobranca/consultar_boleto_bancario) |  |
| BOL0010* | Make bank slip payment | Make a bank slip payment | [Documentation Link](/documentation/baas/cobranca/2fa_v2/solicitacao_de_pagamento_de_boleto_bancario) |  QIC0003 or QIC0005  |
| BOL0012* | Query barcode or typeable line of a government slip | Query a typeable line of a government slip. | [Documentation Link](/documentation/baas/cobranca/consultar_fatura_de_recolhimento) |  |
| BOL0013* | Make government slip payment | Make a government slip payment | [Documentation Link](/documentation/baas/cobranca/2fa_v2/solicitacao_de_pagamento_de_fatura_de_recolhimento) |  QIC0003 or QIC0005  |

---

## Pix

## Pix Transfer 
| Code  | Step | Description | Documentation Link | Pre-requisite |
|---------|--|---|---|---|
| PIX0002* | Pix Out Transfer | Perform a Pix transfer from a QI Account using banking data (manual pix) or Pix key | [Documentation Link](/documentation/baas/pix/realizar_transferencia) | CAB0001 |
| PIX0035 | Pix transfer query | Retrieve transfer data | [Documentation Link](/documentation/baas/pix/consultar_transferencias) | PIX0002 |
| PIX0003* | Pix Out refund simulation | Simulate the refund of a Pix Out. | [Documentation Link - Item 2](/documentation/pix/simulacao)| PIX0002 |
| PIX0004* | Pix In simulation | Simulate the credit of a Pix In to a QI Account. | [Documentation Link -> Item 1](/documentation/pix/simulacao)||
| PIX0037* | Reading pending transaction webhook | Successfully receive a pending transaction webhook | [Documentation Link][(/documentation/baas/pix/webhooks) | PIX0002 |
| PIX0038* | Reading Pix In webhook | Successfully receive an incoming Pix transfer webhook | [Documentation Link](/documentation/baas/pix/webhooks#webhook-para-pix-de-entrada)| PIX0004 |
| PIX0039 | Reading Pix refund webhook | Successfully receive a Pix refund webhook | [Documentation Link](/documentation/baas/pix/webhooks#webhook-para-devolu%C3%A7%C3%B5es-de-pix) | PIX0003 |
| PIX0040 | Request refund of a received Pix | Request refund of a received Pix | [Documentation Link](/documentation/baas/pix/solicitar_devolucao) | PIX0003 |
| PIX0041 | List account Pix transfers | List Pix transfers for an account | [Documentation Link](/documentation/baas/pix/listar_transferencias) | PIX0003 |

## Pix Key Management

### Pix Key Creation and Deletion

| Code | Step | Description | Link | Pre-requisite |
| --- | --- | --- | --- | --- |
| PIX0008* | Pix key creation | Create Pix keys of type cpf, cnpj, random, email and phone | [Documentation Link](/documentation/pix/criar_chave) | 
|QIC0003 or QIC0005  |](/documentation/baas/pix/consultar_chave_pix)
| PIX0009 | Pix key deletion | Delete a Pix key | [Documentation Link](/documentation/pix/excluir_chave) | PIX0008 |
| PIX0010* | List Pix keys of a QI Account | List Pix keys linked to a QI Account | [Documentation Link](/documentation/pix/listar_chaves_pix) | PIX0008 |

### Pix Key Portability

| Code | Step | Description | Link | Pre-requisite |
| --- | --- | --- | --- | --- |
| PIX0013* | Creating Pix Key Portability In Request | Create a Portability In request for a Pix Key of type CPF, CNPJ, Email, Phone and Random | [Documentation Link](/documentation/pix/portabilidade#criando-um-pedido-de-portabilidade) |  QIC0003 or QIC0005  |
| PIX0014* | Resend 2fa for Email or Phone Pix Key Portability In Request | Request resend of SMS (Phone Pix Key) or Email (Email Pix Key) for a pending Pix Key Portability In Request (pending_claimer_validation) | [Documentation Link](/documentation/pix/portabilidade#reenviando-a-valida%C3%A7%C3%A3o-de-dois-fatores) | PIX0013 |
| PIX0015* | Delete Pix Key Portability In Request | Delete a pending Pix Key Portability In Request | [Documentation Link](/documentation/pix/portabilidade#deletando-um-pedido-de-portabilidade) | PIX0013 |
| PIX0016* | Reading Pix Key Portability In completion webhook | Correctly read the completion webhook of a Pix Key Portability In Request. Testing all possible completion statuses (concluded, cancelled and failed) | Webhook: <br/> [Documentation Link](/documentation/pix/portabilidade#conclus%C3%A3o-da-portabilidade) |PIX0013 |
| PIX0017* | Pix Key Portability Out Request simulation | Simulate the arrival of a Pix Key Portability Out request | Item 5:<br/> [Documentation Link](/documentation/pix/simulacao/index.html) | PIX0013 |
| PIX0018* | Approval and Rejection of Pix Key Portability Out Request | Approve a Pix Key Portability Out Request | [Documentation Link](/documentation/pix/portabilidade#request-4) | PIX0017 |
| PIX0019* | Resend 2fa for Pix Key Portability Out Request | Request 2fa resend for a Pix Key Portability Out Request | Enum "pending_donator_validation"  <br/> [Documentation Link](/documentation/pix/portabilidade#request-4) | PIX0018 |
| PIX0020* | Reading Pix Key Portability Out completion webhook | Correctly read the completion webhook of a Pix Key Portability Out Request. Testing all possible completion statuses (concluded, cancelled and failed) | [Documentation Link](D/documentation/pix/portabilidade#conclus%C3%A3o-da-portabilidade-1) | PIX0018 |

## Pix QR Code Management

| Code | Step | Description | Link | Pre-requisite |
| --- | --- | --- | --- | --- |
| PIX0022* | Static Pix QR Code creation | Generate Static QR Code | [Documentation Link](/documentation/pix/criar_qr_code_estatico) | PIX0008 |
| PIX0023 | Dynamic Pix QR Code creation | Generate Dynamic QR Code with due date (due date) and generate Instant Dynamic QR Code (with expiration seconds). | [Documentation Link](/documentation/pix/criar_qr_code_dinamico) | PIX0008 |
| PIX0024 | Dynamic Pix QR Code deletion | Delete Pix QR Code | [Documentation Link](/documentation/pix/baixar_qr_code_dinamico) | PIX0023 |
| PIX0025 | List Dynamic Pix QR Codes | List Dynamic Pix QR Codes | [Documentation Link](/documentation/pix/pesquisar_por_qr_code_dinamico) | PIX0023 |
| PIX0026 | Reading Instant Dynamic Pix QR Code expiration webhook | Successfully receive an Instant Dynamic Pix QR Code expiration webhook | [Documentation Link](/documentation/pix/webhook_por_qr_code_expirado) | PIX0023 |

## Pix QR Code Payment

| Code | Step | Description | Link | Pre-requisite |
| --- | --- | --- | --- | --- |

| PIX0029* | Static Pix QR Code payment | Make payment of a Static Pix QR Code | [Documentation Link](/documentation/baas/pix/realizar_transferencia#transfer%C3%AAncia-por-qr-code-pix) | PIX0022 |
| PIX0030* | Dynamic Pix QR Code payment | Make payment of a Dynamic Pix QR Code |  [Documentation Link](/documentation/baas/pix/realizar_transferencia#transfer%C3%AAncia-por-qr-code-pix) | PIX0022 |
| PIX0027* | Pix QR Code decoding | Decode a Static, Dynamic with due date and Instant Dynamic Pix QR Code | [Documentation Link](/documentation/pix/decodificar_qr_code) | PIX0022 and PIX0023 |

## Pix Limit Management

| Code | Step | Description | Link | Pre-requisite |
| --- | --- | --- | --- | --- |
| PIX0032* | Pix limit change request | Request Pix limit change for a QI Account | [Documentation Link](/documentation/pix/solicitar_alteracao_de_limite_pix) |  QIC0003 or QIC0005  |
| PIX0033 | List Pix limit change requests | List Pix limit change requests for a QI Account | [Documentation Link](/documentation/pix/busca_por_solicitacao_de_limite_pix) | PIX0032 |
| PIX0034* | Query consumed Pix limit | Query consumed Pix limit for a QI Account | [Documentation Link](/documentation/pix/busca_por_uso_de_limite_pix) |  QIC0003 or QIC0005  |

---

# Fee Management
| Code | Step | Description | Link | Pre-requisite |
| --- | --- | --- | --- | --- |
| GTF0001* | Fee change request | Change account fees| [Documentation Link](/documentation/contas/gestao_de_tarifas) |  QIC0003 or QIC0005  |
| GTF0002* | Fee query  | Query fees registered in an account | [Documentation Link](/documentation/contas/consulta_de_tarifas) |  QIC0003 or QIC0005  |

# Card Management

## Card Creation
| Code | Step | Description | Link | Pre-requisite |
| --- | --- | --- | --- | --- |
| GDC0001* | Virtual card creation  | Create a virtual card| [Documentation Link](/documentation/cards/create/gerar_cartao_virtual) |  QIC0003 or QIC0005  |
| GDC0002* | Physical card creation  | Create a physical card| [Documentation Link](/documentation/cards/create/gerar_cartao_fisico) |  QIC0003 or QIC0005  |

## Card Query
| Code | Step | Description | Link | Pre-requisite |
| --- | --- | --- | --- | --- |
| GDC0003* | Query card by key  | Query a card | [Documentation Link](/documentation/cards/search/buscar_cartao_by_key) | GDC0001 or GDC0002 |
| GDC0004* | List cards  | List cards| [Documentation Link](/documentation/cards/search/listar_cartoes) | GDC0001 or GDC0002 |
| GDC0005* | Search card data | Search card data| [Documentation Link](/documentation/cards/search/buscar_dados_pci) | GDC0001 or GDC0002 |
| GDC0006* | Search PCI Password | Search PCI Password| [Documentation Link](/documentation/cards/search/buscar_senha) | GDC0001 or GDC0002 |
| GDC0007* | Query delivery data | Query delivery data| [Documentation Link](/documentation/cards/search/buscar_entrega_by_key) | GDC0001 or GDC0002 |

## Update card data
| Code | Step | Description | Link | Pre-requisite |
| --- | --- | --- | --- | --- |
| GDC0008* | Update card status  | Update card status| [Documentation Link](/documentation/cards/status/update_status_cartao) | GDC0001 or GDC0002 |
| GDC0009* | Activate physical card  | Activate a physical card| [Documentation Link](/documentation/cards/status/ativar_cartao) | GDC0001 or GDC0002 |
| GDC0010* | Change Password   | Change card password | [Documentation Link](/documentation/cards/update/password_cartao) | GDC0001 or GDC0002 |
| GDC0011* | Configure card contactless  | Configure card contactless  | [Documentation Link](/documentation/cards/update/contactless_cartao) | GDC0002 |

---

# Homologation Roadmap - BaaS Digital Escrow Account

URL: /en/documentation/roteiros_de_homologacao/conta_digital_escrow

The homologation roadmap describes all the resources and functionalities that need
to be tested by the integrating partner in QI Tech's sandbox environment (testing environment), 
before entering the product's production environment.

This roadmap describes all the resources and functionalities involved in the product. 

⚠️ **All tests must be mandatory performed in QI Tech's Sandbox environment (testing environment).
The transactions performed in the Sandbox environment are fictitious financial transactions, serving only to test API functionality.**

## BaaS API Registration and Authentication
| Code  | Step | Description | Documentation Link | Prerequisite |
| --- | --- | --- | --- | --- |
| CAB0001* | Sandbox environment registration | Register on the QI Tech platform in the Sandbox environment (sandbox.qitech.app) | cs@qitech.com.br |
| CAB0002* | Token validation in Sandbox | Validate the QI Token in Sandbox | [Documentation Link](https://docs.qitech.com.br/assets/pdfs/QI%20Tech%20Manual%20Inclus%C3%A3o%20de%20Token.pdf) | CAB0001 |
| CAB0003* | Public key exchange | Exchange public keys within the QI Tech platform in sandbox (sandbox.qitech.app) | [Documentation Link](/documentation/primeiros_passos/troca_de_chaves) | CAB0001 and CAB0002 |
| CAB0004* | Call authentication test | Complete call authentication test |[Documentation Link](/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_v2) <br/><br/> [Documentation Link](/documentation/primeiros_passos/teste_de_autenticacao/endpoints_de_teste) | CAB0003 |
| CAB0005* | Webhook configuration | Configure the URL for webhook delivery by QI, through the QI Tech platform in sandbox (sandbox.qitech.app) | [Documentation Link](/documentation/primeiros_passos/configurando_webhooks) | CAB0001 and CAB0002 |

# **QI Account**

## Account Opening

| Code | Step | Description | Documentation Link | Prerequisite |
| --- | --- | --- | --- | --- |
| QIC0002* | Individual account reservation | Request the reservation of an account whose holder is an individual | [Documentation Link](/documentation/baas/account/reservar_conta_pf) | CAB0005 and CAB0006 |
| QIC0003* | Individual account opening | Perform the opening of an account whose holder is an individual | [Documentation Link](/documentation/baas/account/abrir_conta_pf) | QIC0002 |
| QIC0004* | Legal entity account reservation | Request the reservation of an account whose holder is a legal entity | [Documentation Link](/documentation/baas/account/reservar_conta_pj) | CAB0005 and CAB0006 |
| QIC0005* | Legal entity account opening | Perform the opening of an account whose holder is a legal entity | [Documentation Link](/documentation/baas/account/abrir_conta_pj) | QIC0004 |
| QIC0009* | Individual escrow account reservation | Request the reservation of an escrow account whose holder is an individual | [Documentation Link](/documentation/baas/escrow/reservar_conta_pf) | CAB0005 and CAB0006 |
| QIC0010* | Individual escrow account opening | Perform the opening of an escrow account whose holder is an individual | [Documentation Link](/documentation/baas/escrow/abrir_conta_pf) | CAB0005 and CAB0006 |
| QIC0011* | Legal entity escrow account reservation | Request the reservation of an escrow account whose holder is a legal entity | [Documentation Link](/documentation/baas/escrow/reservar_conta_pj) | CAB0005 and CAB0006 |
| QIC0012* | Legal entity escrow account opening | Perform the opening of an escrow account whose holder is a legal entity | [Documentation Link](/documentation/baas/escrow/abrir_conta_pj) | CAB0005 and CAB0006 |
| QIC0006* | Account opening webhook reading | Read account opening webhooks correctly | Item 1.2. or 1.3:<br/>[Documentation Link](/documentation/baas/account/webhooks) |  QIC0003 or QIC0005  |
| QIC0007* | List accounts | List open accounts| [Documentation Link](/documentation/contas/consultar_conta) |  QIC0003 or QIC0005  |
| QIC0008* | Query account data | Query data such as balance, holder data, opening date, among others | [Documentation Link](/documentation/contas/consultar_conta) |  QIC0003 or QIC0005  |

## Transactions

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| QIC0008* | Statement Query | Perform account statement query | [Documentation Link](/documentation/movimentacao_de_contas/consulta_de_transacoes) |  QIC0003 or QIC0005  |
| QIC0009* | Transfer receipt request | Request a transfer receipt | [Documentation Link](/documentation/movimentacao_de_contas/comprovante_de_transferencia)|  |
| QIC0010* | Transaction webhook reading | Successfully receive all transaction webhooks |  [Documentation Link](/documentation/movimentacao_de_contas/webhook_movimentacoes/index.html) |  QIC0003 or QIC0005  |
| QIC0011* | Financial institutions list query | Query the list of financial institutions enabled to receive TED and Pix |  [Documentation Link](/documentation/lista_de_instituicoes_financeiras/consulta_de_instituicoes_financeiras) |  QIC0003 or QIC0005  |

---

# Document Upload

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| UDD0001* | Document upload | Upload a document through our document API |  [Documentation Link](/documentation/upload_de_documentos/) |  |

---

# TED

| Code | Step | Description | Link                                                                                                        | Prerequisite |
| --- | --- | --- |-------------------------------------------------------------------------------------------------------------| --- |
| TED0001* | TED Out Transfer | Perform TED transfer  | [Documentation Link](/documentation/baas/ted/realizar_transferencia) | QIC0003 or QIC0005 |
| TED0002* | TED Out chargeback simulation | Simulate the chargeback of a TED Out sent from a QI Account | Item 3: <br/>[Documentation Link](/documentation/movimentacao_de_contas/transacao) | TED0003 |
| TED0003* | TED In simulation | Simulate a TED In entry to a QI account | Item 2: <br/>[Documentation Link](/documentation/movimentacao_de_contas/transacao) | QIC0003 or QIC0005 |
| TED0004* | List TED transactions| List incoming/outgoing TED transactions  | [Documentation Link](/documentation/baas/ted/listar_teds)  | QIC0003 or QIC0005 |
| TED0004* | TED transaction query| Query a TED transaction  | [Documentation Link](/documentation/baas/ted/consultar_ted)           | QIC0003 or QIC0005 |
| TED0006* | TED webhook reading| Successfully receive a TED webhook | [Documentation Link](/documentation/baas/ted/webhooks/index.html)| QIC0003 or QIC0005 |
---

# Internal Transfer

| No | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| TFI0001 | Internal Transfer with account debit | Command a transfer from a QI Account, with the transfer destination being another QI Account | [Documentation Link](/documentation/baas/ted/realizar_transferencia) |  QIC0003 or QIC0005  |
| TFI0002 | Internal Transfer simulation with account credit | Simulate receiving funds in the target QI Account, originating from another QI Account | Item 1: <br/> [Documentation Link](/documentation/movimentacao_de_contas/transacao) |  QIC0003 or QIC0005  |

---

# Boletos

## Boleto Management

| No | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| No      | Step | Description | Link  | Prerequisite |
|---|---|---|---|---|
| BOL0001 | Single collection boleto registration    | Register a collection boleto | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_padrao/index.html) | CAB0002 or CAB0003   |
| BOL0002 | Single instant collection boleto registration | Register an instant collection boleto | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_instantanea) | CAB0002 or CAB0003   |
| BOL0003 | Batch boleto registration  | Register collection boleto in batch | [Documentation Link](/documentation/boletos/v2/emissao/emissao_em_lote) | CAB0002 or CAB0003   |
| BOL0004 | Standard Single Boleto Issuance        | Issue a standard single boleto    | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_padrao)  | CAB0002 or CAB0003   |
| BOL0005 | Instant Single Boleto Issuance   | Issue an instant single boleto | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_instantanea) | CAB0002 or CAB0003   |
| BOL0006 | Batch Issuance   | Issue boletos in batch | [Documentation Link](/documentation/boletos/v2/emissao/emissao_em_lote)| CAB0002 or CAB0003   |
| BOL0007 | Perform discount on boleto amount | Perform discount on boleto amount | [Documentation Link](/documentation/boletos/v2/instrucoes/abatimento/criar_abatimento) | BOL0001, BOL0002 or BOL0003 |
| BOL0008 | Cancel Discount     | Cancel discount on a boleto | [Documentation Link](/documentation/boletos/v2/instrucoes/abatimento/cancelar_abatimento) | BOL0001, BOL0002 or BOL0003  |
| BOL0009 | Extend boleto due date               | Send due date extension for a boleto | [Documentation Link](/documentation/boletos/v2/instrucoes/extensao)     | BOL0001, BOL0002 or BOL0003   |
| BOL0010 | Include discount on a boleto               | Include discount on a boleto    | [Documentation Link](/documentation/boletos/v2/instrucoes/desconto)     | BOL0001, BOL0002 or BOL0003   |
| BOL0011 | Include interest on a boleto                   | Include interest on a boleto       | [Documentation Link](/documentation/boletos/v2/instrucoes/juros)        | BOL0001, BOL0002 or BOL0003   |
| BOL0012 | Include fine on a boleto                   | Include fine on a boleto       | [Documentation Link](/documentation/boletos/v2/instrucoes/multa)        | BOL0001, BOL0002 or BOL0003   |
| BOL0013 | Perform boleto write-off                   | Write off a boleto                 | [Documentation Link](/documentation/boletos/v2/instrucoes/baixa)        | BOL0001, BOL0002 or BOL0003   |
| BOL0014 | Query boletos by key      | Query boletos by key      | [Documentation Link](/documentation/boletos/v2/consulta/consulta_por_chave) | BOL0001, BOL0002 or BOL0003   |
| BOL0015 | List Boletos          | List boletos     | [Documentation Link](/documentation/boletos/v2/consulta/listar_boletos) | BOL0001, BOL0002 or BOL0003   |
| BOL0016 | Collection portfolio query      | Query a collection portfolio | [Documentation Link](/documentation/boletos/v2/carteira/listar_carteiras/index.html) | BOL0001, BOL0002 or BOL0003   |
| BOL0017 | Boleto Webhooks      | Read boleto webhook | [Documentation Link](/documentation/boletos/v2/webhooks/boleto) | BOL0001, BOL0002 or BOL0003   |

## Boleto Payment

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| BOL0009* | Typeable line or Bar Code query | Query a typeable line of a bank boleto | [Documentation Link](/documentation/baas/cobranca/consultar_boleto_bancario) |  |
| BOL0010* | Perform boleto payment | Pay a bank boleto | [Documentation Link](/documentation/baas/cobranca/pagar_boleto_bancario) |  QIC0003 or QIC0005  |
| BOL0012* | Typeable line or Bar Code query for agreement boleto | Query a typeable line of an agreement boleto. | [Documentation Link](/documentation/baas/cobranca/consultar_fatura_de_recolhimento) |  |
| BOL0013* | Perform agreement boleto payment | Pay an agreement boleto | [Documentation Link](/documentation/baas/cobranca/2fa_v2/solicitacao_de_pagamento_de_fatura_de_recolhimento) |  QIC0003 or QIC0005  |

---

## Pix

## Pix Transfer 
| Code  | Step | Description | Documentation Link | Prerequisite |
|---------|--|---|---|---|
| PIX0002* | Pix Out Transfer | Perform a Pix transfer from a QI Account using bank data (manual pix) or Pix key | [Documentation Link](/documentation/baas/pix/realizar_transferencia) | CAB0001 |
| PIX0035 | Pix transfer query | Retrieve transfer data | [Documentation Link](/documentation/baas/pix/consultar_transferencias) | PIX0002 |
| PIX0003* | Pix Out refund simulation | Simulate a Pix Out refund. | [Documentation Link - Item 2](/documentation/pix/simulacao)| PIX0002 |
| PIX0004* | Pix In simulation | Simulate a Pix In credit to a QI Account. | [Documentation Link -> Item 1](/documentation/pix/simulacao)||
| PIX0037* | Pending transaction webhook reading | Successfully receive a pending transaction webhook | [Link Documentação][(/documentation/baas/pix/webhooks) | PIX0002 |
| PIX0038* | Pix In webhook reading | Successfully receive an incoming Pix transfer webhook | [Documentation Link](/documentation/baas/pix/webhooks#webhook-para-pix-de-entrada)| PIX0004 |
| PIX0039 | Pix Chargeback webhook reading | Successfully receive a Pix chargeback webhook | [Documentation Link](/documentation/baas/pix/webhooks#webhook-para-devolu%C3%A7%C3%B5es-de-pix) | PIX0003 |
| PIX0040 | Request chargeback of a received Pix | Request chargeback of a received Pix | [Documentation Link](/documentation/baas/pix/solicitar_devolucao) | PIX0003 |
| PIX0041 | List account Pix transfers | List account Pix transfers | [Documentation Link](/documentation/baas/pix/listar_transferencias) | PIX0003 |

## Pix Key Management

### Pix Key Creation and Deletion

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PIX0008* | Pix key creation | Create Pix key of type cpf, cnpj, random, email and phone | [Documentation Link](/documentation/pix/criar_chave) | 
|QIC0003 or QIC0005  |](/documentation/baas/pix/consultar_chave_pix)
| PIX0009 | Pix key deletion | Delete a Pix key | [Documentation Link](/documentation/pix/excluir_chave) | PIX0008 |
| PIX0010* | List Pix keys of a QI Account | List Pix keys linked to a QI Account | [Documentation Link](/documentation/pix/listar_chaves_pix) | PIX0008 |

### Pix Key Portability

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PIX0013* | Creating Pix Key Portability In Request | Create a Pix Key Portability In request for CPF, CNPJ, Email, Phone and Random type keys | [Documentation Link](/documentation/pix/portabilidade#criando-um-pedido-de-portabilidade) |  QIC0003 or QIC0005  |
| PIX0014* | 2fa resend for Email or Phone type Pix Key Portability In Request | Request SMS resend (Phone type Pix Key) or Email (Email type Pix Key) for a pending Pix Key Portability In Request (pending_claimer_validation) | [Documentation Link](/documentation/pix/portabilidade#reenviando-a-valida%C3%A7%C3%A3o-de-dois-fatores) | PIX0013 |
| PIX0015* | Pix Key Portability In Request deletion | Delete a pending Pix Key Portability In Request | [Documentation Link](/documentation/pix/portabilidade#deletando-um-pedido-de-portabilidade) | PIX0013 |
| PIX0016* | Pix Key Portability In completion webhook reading | Correctly read the completion webhook of a Pix Key Portability In Request. Testing all possible completion statuses (concluded, cancelled and failed) | Webhook: <br/> [Documentation Link](/documentation/pix/portabilidade#conclus%C3%A3o-da-portabilidade) |PIX0013 |
| PIX0017* | Pix Key Portability Out Request simulation | Simulate the arrival of a Pix Key Portability Out Request | Item 5:<br/> [Documentation Link](/documentation/pix/simulacao/index.html) | PIX0013 |
| PIX0018* | Pix Key Portability Out Request approval and rejection | Approve a Pix Key Portability Out Request | [Documentation Link](/documentation/pix/portabilidade#request-4) | PIX0017 |
| PIX0019* | 2fa resend for Pix Key Portability Out Request | Request 2fa resend for a Pix Key Portability Out Request | Enum "pending_donator_validation"  <br/> [Documentation Link](/documentation/pix/portabilidade#request-4) | PIX0018 |
| PIX0020* | Pix Key Portability Out completion webhook reading | Correctly read the completion webhook of a Pix Key Portability Out Request. Testing all possible completion statuses (concluded, cancelled and failed) | [Documentation Link](D/documentation/pix/portabilidade#conclus%C3%A3o-da-portabilidade-1) | PIX0018 |

## Pix QR Code Management

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PIX0022* | Static Pix QR Code creation | Generate Static QR Code | [Documentation Link](/documentation/pix/criar_qr_code_estatico) | PIX0008 |
| PIX0023 | Dynamic Pix QR Code creation | Generate Dynamic QR Code with expiration (expiration date) and generate Instant Dynamic QR Code (with expiration seconds). | [Documentation Link](/documentation/pix/criar_qr_code_dinamico) | PIX0008 |
| PIX0024 | Dynamic Pix QR Code deletion | Delete Pix QR Code | [Documentation Link](/documentation/pix/baixar_qr_code_dinamico) | PIX0023 |
| PIX0025 | List Dynamic Pix QR Codes | List Dynamic Pix QR Codes | [Documentation Link](/documentation/pix/pesquisar_por_qr_code_dinamico) | PIX0023 |
| PIX0026 | Instant Dynamic Pix QR Code expiration webhook reading | Successfully receive an Instant Dynamic Pix QR Code expiration webhook | [Documentation Link](/documentation/pix/webhook_por_qr_code_expirado) | PIX0023 |

## Pix QR Code Payment

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |

| PIX0029* | Static Pix QR Code payment | Pay a Static Pix QR Code | [Documentation Link](/documentation/baas/pix/realizar_transferencia#transfer%C3%AAncia-por-qr-code-pix) | PIX0022 |
| PIX0030* | Dynamic Pix QR Code payment | Pay a Dynamic Pix QR Code |  [Documentation Link](/documentation/baas/pix/realizar_transferencia#transfer%C3%AAncia-por-qr-code-pix) | PIX0022 |
| PIX0027* | Pix QR Code decoding | Decode a Static, Dynamic with expiration and Instant Dynamic Pix QR Code | [Documentation Link](/documentation/pix/decodificar_qr_code) | PIX0022 and PIX0023 |

## Pix Limit Management

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PIX0032* | Pix limit change request | Request Pix limit change for a QI Account | [Documentation Link](/documentation/pix/solicitar_alteracao_de_limite_pix) |  QIC0003 or QIC0005  |
| PIX0033 | List Pix limit change requests | List Pix limit change requests for a QI Account | [Documentation Link](/documentation/pix/busca_por_solicitacao_de_limite_pix) | PIX0032 |
| PIX0034* | Consumed Pix limit query | Query consumed Pix limit for a QI Account | [Documentation Link](/documentation/pix/busca_por_uso_de_limite_pix) |  QIC0003 or QIC0005  |

---

# Fee Management
| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| GTF0001* | Fee change request | Change account fees| [Documentation Link](/documentation/contas/gestao_de_tarifas) |  QIC0003 or QIC0005  |
| GTF0002* | Fee query  | Query fees registered on an account | [Documentation Link](/documentation/contas/consulta_de_tarifas) |  QIC0003 or QIC0005  |

# Card Management

## Card Creation
| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| GDC0001* | Virtual Card creation  | Create a virtual card| [Documentation Link](/documentation/cards/create/gerar_cartao_virtual) |  QIC0003 or QIC0005  |
| GDC0002* | Physical Card creation  | Create a physical card| [Documentation Link](/documentation/cards/create/gerar_cartao_fisico) |  QIC0003 or QIC0005  |

## Card Query
| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| GDC0003* | Query card by key  | Query a card | [Documentation Link](/documentation/cards/search/buscar_cartao_by_key) | GDC0001 or GDC0002 |
| GDC0004* | List cards  | List cards| [Documentation Link](/documentation/cards/search/listar_cartoes) | GDC0001 or GDC0002 |
| GDC0005* | Search card data | Search card data| [Documentation Link](/documentation/cards/search/buscar_dados_pci) | GDC0001 or GDC0002 |
| GDC0006* | Search PCI Password | Search PCI Password| [Documentation Link](/documentation/cards/search/buscar_senha) | GDC0001 or GDC0002 |
| GDC0007* | Query delivery data | Query delivery data| [Documentation Link](/documentation/cards/search/buscar_entrega_by_key) | GDC0001 or GDC0002 |

## Update card data
| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| GDC0008* | Update card status  | Update card status| [Documentation Link](/documentation/cards/status/update_status_cartao) | GDC0001 or GDC0002 |
| GDC0009* | Activate physical card  | Activate a physical card| [Documentation Link](/documentation/cards/status/ativar_cartao) | GDC0001 or GDC0002 |
| GDC0010* | Change Password   | Change card password | [Documentation Link](/documentation/cards/update/password_cartao) | GDC0001 or GDC0002 |
| GDC0011* | Configure card contactless  | Configure card contactless  | [Documentation Link](/documentation/cards/update/contactless_cartao) | GDC0002 |

---

# Certification Roadmap - BaaS Escrow Digital Account

URL: /en/documentation/roteiros_de_homologacao/conta_digital_escrow_caas

The certification roadmap describes all resources and functionalities that need
to be tested by the integrator partner in the QI Tech sandbox environment (test environment), 
before entering the production environment for the product.

This roadmap describes all resources and functionalities involved in the product. 

⚠️ **All tests must be mandatorily performed in the QI Tech Sandbox environment (test environment).
Transactions made in the Sandbox environment are fictional financial transactions, serving only to test API functionality.**

## BaaS API Registration and Authentication
| Code  | Step | Description | Documentation Link | Prerequisite |
| --- | --- | --- | --- | --- |
| CAB0001* | Sandbox environment registration | Register on the QI Tech platform in the Sandbox environment (sandbox.qitech.app) | cs@qitech.com.br |
| CAB0002* | Token validation in Sandbox | Validate the QI Token in Sandbox | [Documentation Link](https://docs.qitech.com.br/assets/pdfs/QI%20Tech%20Manual%20Inclus%C3%A3o%20de%20Token.pdf) | CAB0001 |
| CAB0003* | Public key exchange | Exchange public keys within the QI Tech platform in sandbox (sandbox.qitech.app) | [Documentation Link](/documentation/primeiros_passos/troca_de_chaves) | CAB0001 and CAB0002 |
| CAB0004* | Call authentication test | Complete call authentication test |[Documentation Link](/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_v2) <br/><br/> [Documentation Link](/documentation/primeiros_passos/teste_de_autenticacao/endpoints_de_teste) | CAB0003 |
| CAB0005* | Webhook configuration | Configure the URL for webhook sending by QI, through the QI Tech platform in sandbox (sandbox.qitech.app) | [Documentation Link](/documentation/primeiros_passos/configurando_webhooks) | CAB0001 and CAB0002 |

## Anti-fraud

## Registration and Authentication

| Code | Step | Description | Documentation Link | Prerequisite |
| --- | --- | --- | --- | --- |
| ATF0002* | Obtaining onboarding API-key | Obtain the API key for using the /onboarding API from the QI Tech integration team | suporte.caas@qitech.com.br |  
| ATF0003* | Obtaining OCR mobile-token | Obtain the Mobile Token for using the OCR SDK from the QI Tech integration team | suporte.caas@qitech.com.br |  
| ATF0004* | Obtaining Face Recognition mobile-token | Obtain the Mobile Token for using the Face Recognition SDK from the QI Tech integration team | suporte.caas@qitech.com.br |  
| ATF0005* | Obtaining Device scan mobile-token | Obtain the Mobile Token for using the Device scan SDK from the QI Tech integration team | suporte.caas@qitech.com.br |  

## OCR SDK

| Code | Step | Description | Documentation Link | Prerequisite |
| --- | --- | --- | --- | --- |
| ATF0007* | SDK build | Define template and customizations for document collection and successfully build the SDK within your application (QI Tech client application) | Android: [Documentation Link](/documentation/caas/ocr/android/introduction) <br/> iOS:[ Documentation Link](/documentation/caas/ocr/ios/introduction) |  |
| ATF0008* | Document submission | Collect documents using the SDK within your application (QI Tech client application) |  | ATF0003 and ATF0007 |
| ATF0009* | Storing ocr_key | Store the keys returned by the SDK, identifying the nature of the collected document (e.g.: cnh_front, cnh_back, etc) | Android: [Documentation Link](/documentation/caas/ocr/android/collecting_response) <br/>iOS:[ Documentation Link](/documentation/caas/ocr/ios/collecting_response)| ATF0008 |

## Face Recognition SDK

| Code | Step | Description | Documentation Link | Prerequisite |
| --- | --- | --- | --- | --- |
| ATF0011* | SDK build | Define customizations and successfully build the SDK within your application (QI Tech client application) |Android: [Documentation Link](/documentation/caas/face_recognition/android/introduction) <br/>iOS:[ Documentation Link](/documentation/caas/face_recognition/ios/introduction)  |  |
| ATF0012* | Liveness flow | Perform the liveness flow using the SDK within your application (QI Tech client application) | | ATF0004 and ATF0011* |
| ATF0013* | Storing image key | Store the image_key returned by the SDK after completing the liveness flow | Android: [Documentation Link](/documentation/caas/face_recognition/android/collecting_response) iOS:[ Documentation Link](/documentation/caas/face_recognition/ios/collecting_response) | ATF0012 |

## Device Scan SDK

| Code | Step | Description | Documentation Link | Prerequisite |
| --- | --- | --- | --- | --- |
| ATF0015* | SDK build | Define permissions to be requested from the user by your application (QI Tech client application) and successfully build the SDK within your application (QI Tech client application) | Android: [Documentation Link](/documentation/caas/device_scan/android/introduction)<br/>iOS:[ Documentation Link](/documentation/caas/device_scan/ios/introduction)|  
| ATF0016* | Storing user session | Store the user session (sessionId) that will have the device scanned | Android: [Documentation Link](/documentation/caas/device_scan/android/example)<br/>iOS:[ Documentation Link](/documentation/caas/device_scan/ios/example) | ATF0015 and ATF0017 |
| ATF0017* | Information collection | Instantiate the SDK with the stored sessionId and call the information collection method within your application (QI Tech client application) | Android: [Documentation Link](/documentation/caas/face_recognition/android/collecting_response)<br/>iOS:[ Documentation Link](/documentation/caas/face_recognition/ios/collecting_response) | ATF0005 and ATF0015 |

## Anti-fraud

| Code | Step | Description | Documentation Link | Prerequisite |
| --- | --- | --- | --- | --- |
| ATF0019* | Individual anti-fraud | Successfully perform anti-fraud on an individual client | [Documentation Link](/documentation/caas/onboarding/natural_person) | ATF0002 |
| ATF0020* | Corporate anti-fraud | Successfully perform anti-fraud on a corporate client | [Documentation Link](/documentation/caas/onboarding/legal_person) | ATF0002 |
| ATF0021* | Reading derived analysis webhooks for asynchronous flow | Successfully receive derived analysis webhook for asynchronous response flow |[Documentation Link](/documentation/caas/onboarding/webhook) | ATF0019 or ATF0020 |

## Platform Registration

| Code | Step | Description | Documentation Link | Prerequisite |
| --- | --- | --- | --- | --- |
| ATF0022* | Master user registration | Register a Master user on the CaaS platform, to resolve requests derived for "Manual analysis"  | suporte.caas@qitech.com.br | ATF0019 or ATF0020 |

---

# **QI Account**

## Account Opening

| Code | Step | Description | Documentation Link | Prerequisite |
| --- | --- | --- | --- | --- |
| QIC0002* | Individual account reservation | Request account reservation for an individual holder | [Documentation Link](/documentation/baas/account/reservar_conta_pf) | CAB0005 and CAB0006 |
| QIC0003* | Individual account opening | Open an account for an individual holder | [Documentation Link](/documentation/baas/account/abrir_conta_pf) | QIC0002 |
| QIC0004* | Corporate account reservation | Request account reservation for a corporate holder | [Documentation Link](/documentation/baas/account/reservar_conta_pj) | CAB0005 and CAB0006 |
| QIC0005* | Corporate account opening | Open an account for a corporate holder | [Documentation Link](/documentation/baas/account/abrir_conta_pj) | QIC0004 |
| QIC0009* | Individual escrow account reservation | Request escrow account reservation for an individual holder | [Documentation Link](/documentation/baas/escrow/reservar_conta_pf) | CAB0005 and CAB0006 |
| QIC0010* | Individual escrow account opening | Open an escrow account for an individual holder | [Documentation Link](/documentation/baas/escrow/abrir_conta_pf) | CAB0005 and CAB0006 |
| QIC0011* | Corporate escrow account reservation | Request escrow account reservation for a corporate holder | [Documentation Link](/documentation/baas/escrow/reservar_conta_pj) | CAB0005 and CAB0006 |
| QIC0012* | Corporate escrow account opening | Open an escrow account for a corporate holder | [Documentation Link](/documentation/baas/escrow/abrir_conta_pj) | CAB0005 and CAB0006 |
| QIC0006* | Reading account opening webhooks | Correctly read account opening webhooks | Item 1.2. or 1.3:<br/>[Documentation Link](/documentation/baas/account/webhooks) |  QIC0003 or QIC0005  |
| QIC0007* | List accounts | List opened accounts| [Documentation Link](/documentation/contas/consultar_conta) |  QIC0003 or QIC0005  |
| QIC0008* | Query account data | Query data such as balance, holder data, opening date, among others | [Documentation Link](/documentation/contas/consultar_conta) |  QIC0003 or QIC0005  |

## Transactions

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| QIC0008* | Statement query | Query an account statement | [Documentation Link](/documentation/movimentacao_de_contas/consulta_de_transacoes) |  QIC0003 or QIC0005  |
| QIC0009* | Transfer proof request | Request a transfer proof | [Documentation Link](/documentation/movimentacao_de_contas/comprovante_de_transferencia)|  |
| QIC0010* | Reading transaction webhooks | Successfully receive all transaction webhooks |  [Documentation Link](/documentation/movimentacao_de_contas/webhook_movimentacoes/index.html) |  QIC0003 or QIC0005  |
| QIC0011* | Financial institutions list query | Query list of financial institutions enabled for TED and Pix receipt |  [Documentation Link](/documentation/lista_de_instituicoes_financeiras/consulta_de_instituicoes_financeiras) |  QIC0003 or QIC0005  |

---

# Document Upload

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| UDD0001* | Document upload | Upload a document through our documents API |  [Documentation Link](/documentation/upload_de_documentos/) |  |

---

# TED

| Code | Step | Description | Link                                                                                                        | Prerequisite |
| --- | --- | --- |-------------------------------------------------------------------------------------------------------------| --- |
| TED0001* | TED Out transfer | Perform TED transfer  | [Documentation Link](/documentation/baas/ted/realizar_transferencia) | QIC0003 or QIC0005 |
| TED0002* | TED Out reversal simulation | Simulate the reversal of a TED Out sent from a QI Account | Item 3: <br/>[Documentation Link](/documentation/movimentacao_de_contas/transacao) | TED0003 |
| TED0003* | TED In simulation | Simulate TED In entry into a QI account | Item 2: <br/>[Documentation Link](/documentation/movimentacao_de_contas/transacao) | QIC0003 or QIC0005 |
| TED0004* | List TED transactions| List incoming/outgoing TED transactions  | [Documentation Link](/documentation/baas/ted/listar_teds)  | QIC0003 or QIC0005 |
| TED0004* | TED transaction query| Query a TED transaction  | [Documentation Link](/documentation/baas/ted/consultar_ted)           | QIC0003 or QIC0005 |
| TED0006* | Reading TED webhooks| Successfully receive a TED webhook | [Documentation Link](/documentation/baas/ted/webhooks/index.html)| QIC0003 or QIC0005 |
---

# Internal Transfer

| No | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| TFI0001 | Internal transfer with account debit | Command a transfer from a QI Account, with another QI Account as the transfer destination | [Documentation Link](/documentation/baas/ted/realizar_transferencia) |  QIC0003 or QIC0005  |
| TFI0002 | Internal transfer simulation with account credit | Simulate receiving funds in the target QI Account, originating from another QI Account | Item 1: <br/> [Documentation Link](/documentation/movimentacao_de_contas/transacao) |  QIC0003 or QIC0005  |

---

# Bank Slips

## Bank Slip Management

| No | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| No      | Step | Description | Link  | Prerequisite |
|---|---|---|---|---|
| BOL0001 | Single standard billing slip registration    | Register a billing slip | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_padrao/index.html) | CAB0002 or CAB0003   |
| BOL0002 | Single instant billing slip registration | Register an instant billing slip | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_instantanea) | CAB0002 or CAB0003   |
| BOL0003 | Batch billing slip registration  | Register billing slips in batch | [Documentation Link](/documentation/boletos/v2/emissao/emissao_em_lote) | CAB0002 or CAB0003   |
| BOL0004 | Single Standard Bank Slip Issuance        | Issue a single standard bank slip    | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_padrao)  | CAB0002 or CAB0003   |
| BOL0005 | Single Instant Bank Slip Issuance   | Issue a single instant bank slip | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_instantanea) | CAB0002 or CAB0003   |
| BOL0006 | Batch Issuance   | Issue bank slips in batch | [Documentation Link](/documentation/boletos/v2/emissao/emissao_em_lote)| CAB0002 or CAB0003   |
| BOL0007 | Apply discount to a bank slip value | Apply discount to a bank slip value | [Documentation Link](/documentation/boletos/v2/instrucoes/abatimento/criar_abatimento) | BOL0001, BOL0002 or BOL0003 |
| BOL0008 | Cancel Discount     | Cancel discount on a bank slip | [Documentation Link](/documentation/boletos/v2/instrucoes/abatimento/cancelar_abatimento) | BOL0001, BOL0002 or BOL0003  |
| BOL0009 | Extend bank slip due date               | Send deadline extension for a bank slip | [Documentation Link](/documentation/boletos/v2/instrucoes/extensao)     | BOL0001, BOL0002 or BOL0003   |
| BOL0010 | Include discount on a bank slip               | Include discount on a bank slip    | [Documentation Link](/documentation/boletos/v2/instrucoes/desconto)     | BOL0001, BOL0002 or BOL0003   |
| BOL0011 | Include interest on a bank slip                   | Include interest on a bank slip       | [Documentation Link](/documentation/boletos/v2/instrucoes/juros)        | BOL0001, BOL0002 or BOL0003   |
| BOL0012 | Include penalty on a bank slip                   | Include penalty on a bank slip       | [Documentation Link](/documentation/boletos/v2/instrucoes/multa)        | BOL0001, BOL0002 or BOL0003   |
| BOL0013 | Write off a bank slip                   | Write off a bank slip                 | [Documentation Link](/documentation/boletos/v2/instrucoes/baixa)        | BOL0001, BOL0002 or BOL0003   |
| BOL0014 | Query bank slips by key      | Query bank slips by key      | [Documentation Link](/documentation/boletos/v2/consulta/consulta_por_chave) | BOL0001, BOL0002 or BOL0003   |
| BOL0015 | List Bank Slips          | List bank slips     | [Documentation Link](/documentation/boletos/v2/consulta/listar_boletos) | BOL0001, BOL0002 or BOL0003   |
| BOL0016 | Collection wallet query      | Query a collection wallet | [Documentation Link](/documentation/boletos/v2/carteira/listar_carteiras/index.html) | BOL0001, BOL0002 or BOL0003   |
| BOL0017 | Bank Slip Webhooks      | Read webhook for bank slip | [Documentation Link](/documentation/boletos/v2/webhooks/boleto) | BOL0001, BOL0002 or BOL0003   |

## Bank Slip Payment

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| BOL0009* | Typeable line or Bar Code query | Query a typeable line from a bank slip | [Documentation Link](/documentation/baas/cobranca/consultar_boleto_bancario) |  |
| BOL0010* | Pay a bank slip | Pay a bank slip | [Documentation Link](/documentation/baas/cobranca/pagar_boleto_bancario) |  QIC0003 or QIC0005  |
| BOL0012* | Typeable line or Bar Code query for a service slip | Query a typeable line from a service slip. | [Documentation Link](/documentation/baas/cobranca/consultar_fatura_de_recolhimento) |  |
| BOL0013* | Pay a service slip | Pay a service slip | [Documentation Link](/documentation/baas/cobranca/2fa_v2/solicitacao_de_pagamento_de_fatura_de_recolhimento) |  QIC0003 or QIC0005  |

---

## Pix

## Pix Transfer 
| Code  | Step | Description | Documentation Link | Prerequisite |
|---------|--|---|---|---|
| PIX0002* | Pix Out Transfer | Perform a Pix transfer from a QI Account using bank data (manual pix) or Pix key | [Documentation Link](/documentation/baas/pix/realizar_transferencia) | CAB0001 |
| PIX0035 | Pix transfer query | Retrieve transfer data | [Documentation Link](/documentation/baas/pix/consultar_transferencias) | PIX0002 |
| PIX0003* | Pix Out refund simulation | Simulate a Pix Out refund. | [Documentation Link - Item 2](/documentation/pix/simulacao)| PIX0002 |
| PIX0004* | Pix In simulation | Simulate Pix In credit to a QI Account. | [Documentation Link -> Item 1](/documentation/pix/simulacao)||
| PIX0037* | Reading pending transaction webhook | Successfully receive a pending transaction webhook | [Documentation Link][(/documentation/baas/pix/webhooks) | PIX0002 |
| PIX0038* | Reading Pix In webhook | Successfully receive an incoming Pix transfer webhook | [Documentation Link](/documentation/baas/pix/webhooks#webhook-para-pix-de-entrada)| PIX0004 |
| PIX0039 | Reading Pix refund webhook | Successfully receive a Pix refund webhook | [Documentation Link](/documentation/baas/pix/webhooks#webhook-para-devolu%C3%A7%C3%B5es-de-pix) | PIX0003 |
| PIX0040 | Request refund for a received Pix | Request refund for a received Pix | [Documentation Link](/documentation/baas/pix/solicitar_devolucao) | PIX0003 |
| PIX0041 | List account Pix transfers | List account Pix transfers | [Documentation Link](/documentation/baas/pix/listar_transferencias) | PIX0003 |

## Pix Key Management

### Pix Key Creation and Deletion

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PIX0008* | Pix key creation | Create Pix keys of type cpf, cnpj, random, email and phone | [Documentation Link](/documentation/pix/criar_chave) | 
|QIC0003 or QIC0005  |](/documentation/baas/pix/consultar_chave_pix)
| PIX0009 | Pix key deletion | Delete a Pix key | [Documentation Link](/documentation/pix/excluir_chave) | PIX0008 |
| PIX0010* | List Pix keys for a QI Account | List Pix keys linked to a QI Account | [Documentation Link](/documentation/pix/listar_chaves_pix) | PIX0008 |

### Pix Key Portability

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PIX0013* | Create Pix Key Portability In Request | Create a Pix Key Portability In request for CPF, CNPJ, Email, Phone and Random type keys | [Documentation Link](/documentation/pix/portabilidade#criando-um-pedido-de-portabilidade) |  QIC0003 or QIC0005  |
| PIX0014* | Resend 2fa for Pix Key Portability In Request for Email or Phone type | Request resending of SMS (Phone type Pix Key) or Email (Email type Pix Key) for a pending Pix Key Portability In Request (pending_claimer_validation) | [Documentation Link](/documentation/pix/portabilidade#reenviando-a-valida%C3%A7%C3%A3o-de-dois-fatores) | PIX0013 |
| PIX0015* | Delete Pix Key Portability In Request | Delete a pending Pix Key Portability In Request | [Documentation Link](/documentation/pix/portabilidade#deletando-um-pedido-de-portabilidade) | PIX0013 |
| PIX0016* | Read Pix Key Portability In completion webhook | Correctly read the completion webhook for a Pix Key Portability In Request. Testing all possible completion statuses (concluded, cancelled and failed) | Webhook: <br/> [Documentation Link](/documentation/pix/portabilidade#conclus%C3%A3o-da-portabilidade) |PIX0013 |
| PIX0017* | Simulate Pix Key Portability Out Request | Simulate the arrival of a Pix Key Portability Out Request | Item 5:<br/> [Documentation Link](/documentation/pix/simulacao/index.html) | PIX0013 |
| PIX0018* | Approval and Rejection of Pix Key Portability Out Request | Approve a Pix Key Portability Out Request | [Documentation Link](/documentation/pix/portabilidade#request-4) | PIX0017 |
| PIX0019* | Resend 2fa for Pix Key Portability Out Request | Request 2fa resending for a Pix Key Portability Out Request | Enum "pending_donator_validation"  <br/> [Documentation Link](/documentation/pix/portabilidade#request-4) | PIX0018 |
| PIX0020* | Read Pix Key Portability Out completion webhook | Correctly read the completion webhook for a Pix Key Portability Out Request. Testing all possible completion statuses (concluded, cancelled and failed) | [Documentation Link](D/documentation/pix/portabilidade#conclus%C3%A3o-da-portabilidade-1) | PIX0018 |

## Pix QR Code Management

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PIX0022* | Static Pix QR Code creation | Generate Static QR Code | [Documentation Link](/documentation/pix/criar_qr_code_estatico) | PIX0008 |
| PIX0023 | Dynamic Pix QR Code creation | Generate Dynamic QR Code with expiration (due date) and generate Instant Dynamic QR Code (with expiration seconds). | [Documentation Link](/documentation/pix/criar_qr_code_dinamico) | PIX0008 |
| PIX0024 | Dynamic Pix QR Code deletion | Delete Pix QR Code | [Documentation Link](/documentation/pix/baixar_qr_code_dinamico) | PIX0023 |
| PIX0025 | List Dynamic Pix QR Codes | List Dynamic Pix QR Codes | [Documentation Link](/documentation/pix/pesquisar_por_qr_code_dinamico) | PIX0023 |
| PIX0026 | Read Instant Dynamic Pix QR Code expiration webhook | Successfully receive an Instant Dynamic Pix QR Code expiration webhook | [Documentation Link](/documentation/pix/webhook_por_qr_code_expirado) | PIX0023 |

## Pix QR Code Payment

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |

| PIX0029* | Static Pix QR Code payment | Pay a Static Pix QR Code | [Documentation Link](/documentation/baas/pix/realizar_transferencia#transfer%C3%AAncia-por-qr-code-pix) | PIX0022 |
| PIX0030* | Dynamic Pix QR Code payment | Pay a Dynamic Pix QR Code |  [Documentation Link](/documentation/baas/pix/realizar_transferencia#transfer%C3%AAncia-por-qr-code-pix) | PIX0022 |
| PIX0027* | Pix QR Code decoding | Decode a Static, Dynamic with expiration and Instant Dynamic Pix QR Code | [Documentation Link](/documentation/pix/decodificar_qr_code) | PIX0022 and PIX0023 |

## Pix Limit Management

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PIX0032* | Pix limit change request | Request Pix limit change for a QI Account | [Documentation Link](/documentation/pix/solicitar_alteracao_de_limite_pix) |  QIC0003 or QIC0005  |
| PIX0033 | List Pix limit change requests | List Pix limit change requests for a QI Account | [Documentation Link](/documentation/pix/busca_por_solicitacao_de_limite_pix) | PIX0032 |
| PIX0034* | Query consumed Pix limit | Query consumed Pix limit for a QI Account | [Documentation Link](/documentation/pix/busca_por_uso_de_limite_pix) |  QIC0003 or QIC0005  |

---

# Fee Management
| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| GTF0001* | Fee change request | Request account fee changes| [Documentation Link](/documentation/contas/gestao_de_tarifas) |  QIC0003 or QIC0005  |
| GTF0002* | Fee query  | Query registered fees on an account | [Documentation Link](/documentation/contas/consulta_de_tarifas) |  QIC0003 or QIC0005  |

# Card Management

## Card Creation
| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| GDC0001* | Virtual card creation  | Create a virtual card| [Documentation Link](/documentation/cards/create/gerar_cartao_virtual) |  QIC0003 or QIC0005  |
| GDC0002* | Physical card creation  | Create a physical card| [Documentation Link](/documentation/cards/create/gerar_cartao_fisico) |  QIC0003 or QIC0005  |

## Card Query
| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| GDC0003* | Query card by key  | Query a card | [Documentation Link](/documentation/cards/search/buscar_cartao_by_key) | GDC0001 or GDC0002 |
| GDC0004* | List cards  | List cards| [Documentation Link](/documentation/cards/search/listar_cartoes) | GDC0001 or GDC0002 |
| GDC0005* | Search card data | Search card data| [Documentation Link](/documentation/cards/search/buscar_dados_pci) | GDC0001 or GDC0002 |
| GDC0006* | Search PCI Password | Search PCI Password| [Documentation Link](/documentation/cards/search/buscar_senha) | GDC0001 or GDC0002 |
| GDC0007* | Query delivery data | Query delivery data| [Documentation Link](/documentation/cards/search/buscar_entrega_by_key) | GDC0001 or GDC0002 |

## Update card data
| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| GDC0008* | Update card status  | Update card status| [Documentation Link](/documentation/cards/status/update_status_cartao) | GDC0001 or GDC0002 |
| GDC0009* | Activate physical card  | Activate a physical card| [Documentation Link](/documentation/cards/status/ativar_cartao) | GDC0001 or GDC0002 |
| GDC0010* | Change Password   | Change a card password | [Documentation Link](/documentation/cards/update/password_cartao) | GDC0001 or GDC0002 |
| GDC0011* | Configure card contactless  | Configure card contactless  | [Documentation Link](/documentation/cards/update/contactless_cartao) | GDC0002 |

---

# Roteiro de Homologação - BaaS Cobrança

URL: /en/documentation/roteiros_de_homologacao/roteiro_cobranca

O roteiro de homolgoação descreve todos os recursos e funcionalidades que precisam
ser testados pelo parceiro integrador no ambiente de sandbox da QI Tech (ambiente de testes), 
antes da entrada em ambiente de produção do produto.

Este roteiro descreve todos os recursos e funcionalidades envolvidos no produto.

:::info ATENÇÃO
As etapas sinalizadas com * são obrigatórias para a entrada em produção
:::

:::info ATENÇÃO
⚠️ **Todos os testes devem ser obrigatoriamente realizados no ambiente de Sandbox da QI Tech (ambiente de testes).
As movimentações realizadas em ambiente de Sandbox são movimentações financeiras fictícias, servindo apenas para teste de funcionalidade das APIs.**
:::

## Cadastro e Autenticação API BaaS
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| CAB0001* | Cadastro no ambiente de Sandbox | Realizar o cadastro na plataforma da QI Tech no ambiente de Sandbox (sandbox.qitech.app) | cs@qitech.com.br |
| CAB0002* | Validação de token em Sandbox | Realizar a validação do QI Token em Sandbox | [Download Manual de Inclusão do Token](https://docs.qitech.com.br/assets/pdfs/QI%20Tech%20Manual%20Inclus%C3%A3o%20de%20Token.pdf) | CAB0001 |
| CAB0003* | Troca de chaves públicas | Realizar a troca de chaves públicas dentro da plataforma da QI Tech em sandbox (sandbox.qitech.app) | [Link Documentação](https://docs.qitech.com.br/documentation/primeiros_passos/troca_de_chaves) | CAB0001 e CAB0002 |
| CAB0004* | Teste de autenticação de chamadas | Finalizar teste de autenticação de chamadas | [Passo a Passo](https://docs.qitech.com.br/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_v2) <br/><br/> [Link Documentação](https://docs.qitech.com.br/documentation/primeiros_passos/teste_de_autenticacao/endpoints_de_teste) | CAB0003 |
| CAB0005* | Configuração de webhooks | Realizar a configuração da url para envio dos webhooks por parte da QI, através da plataforma da QI Tech em sandbox (sandbox.qitech.app) | [Link Documentação](https://docs.qitech.com.br/documentation/primeiros_passos/configurando_webhooks) | CAB0001 e CAB0002 |

## Boletos

## Gestão de Boletos
| Nº      | Etapa | Descrição | Link  | Pré-requisito |
|---|---|---|---|---|
| BOL0001 | Registro de boleto de um único boleto cobrança    | Realizar o registro de um boleto de cobrança | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/emissao/emissao_boleto_unico_padrao/index.html) | CAB0002 ou CAB0003   |
| BOL0002 | Registro de boleto de um único boleto de cobrança instantâneo | Realizar o registro de um boleto de cobrança | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/emissao/emissao_boleto_unico_instantanea) | CAB0002 ou CAB0003   |
| BOL0003 | Registro de boleto de boleto em lote  | Realizar o registro de boleto de cobrança em lote | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/emissao/emissao_em_lote) | CAB0002 ou CAB0003   |
| BOL0004 | Emissão de Boleto Único Padrão        | Emitir um boleto único padrão    | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/emissao/emissao_boleto_unico_padrao)  | CAB0002 ou CAB0003   |
| BOL0005 | Emissão de Boleto Único Instantâneo   | Emitir um boleto único instantân | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/emissao/emissao_boleto_unico_instantanea) | CAB0002 ou CAB0003   |
| BOL0006 | Emissão em Lote   | Emitir boletos em lote | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/emissao/emissao_em_lote)| CAB0002 ou CAB0003   |
| BOL0007 | Realizar abatimento no valor de um boleto | Realizar abatimento no valor de um boleto | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/instrucoes/abatimento/criar_abatimento) | BOL0001, BOL0002 ou BOL0003 |
| BOL0008 | Cancelar Abatimento     | Cancelar abatimento em um boleto | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/instrucoes/abatimento/cancelar_abatimento) | BOL0001, BOL0002 ou BOL0003  |
| BOL0009 | Estender vencimento de um boleto               | Enviar extensão de prazo de um boleto | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/instrucoes/extensao)     | BOL0001, BOL0002 ou BOL0003   |
| BOL0010 | Incluir desconto em um boleto               | Incluir desconto em um boleto    | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/instrucoes/desconto)     | BOL0001, BOL0002 ou BOL0003   |
| BOL0011 | Incluir juros em um boleto                   | Incluir juros em um boleto       | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/instrucoes/juros)        | BOL0001, BOL0002 ou BOL0003   |
| BOL0012 | Incluir multa em um boleto                   | Incluir multa em um boleto       | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/instrucoes/multa)        | BOL0001, BOL0002 ou BOL0003   |
| BOL0013 | Realizar baixa de um boleto                   | Baixar um boleto                 | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/instrucoes/baixa)        | BOL0001, BOL0002 ou BOL0003   |
| BOL0014 | Consultar boletos por chave      | Consultar boletos por chave      | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/consulta/consulta_por_chave) | BOL0001, BOL0002 ou BOL0003   |
| BOL0015 | Listar Boletos          | Listar boletos     | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/consulta/listar_boletos) | BOL0001, BOL0002 ou BOL0003   |
| BOL0016 | Webhooks de Boleto      | Realizar a leitura de webhook para boleto | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/webhooks/boleto) | BOL0001, BOL0002 ou BOL0003   |

---

# Roteiro de Homologação - BaaS Conta Digital

URL: /en/documentation/roteiros_de_homologacao/roteiro_conta_digital

O roteiro de homolgoação descreve todos os recursos e funcionalidades que precisam
ser testados pelo parceiro integrador no ambiente de sandbox da QI Tech (ambiente de testes), 
antes da entrada em ambiente de produção do produto.

Este roteiro descreve todos os recursos e funcionalidades envolvidos no produto. 

⚠️ **Todos os testes devem ser obrigatoriamente realizados no ambiente de Sandbox da QI Tech (ambiente de testes).
As movimentações realizadas em ambiente de Sandbox são movimentações financeiras fictícias, servindo apenas para teste de funcionalidade das APIs.**

## Cadastro e Autenticação API BaaS
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| CAB0001* | Cadastro no ambiente de Sandbox | Realizar o cadastro na plataforma da QI Tech no ambiente de Sandbox (sandbox.qitech.app) | cs@qitech.com.br |
| CAB0002* | Validação de token em Sandbox | Realizar a validação do QI Token em Sandbox | [Link Documentação](https://docs.qitech.com.br/assets/pdfs/QI%20Tech%20Manual%20Inclus%C3%A3o%20de%20Token.pdf) | CAB0001 |
| CAB0003* | Troca de chaves públicas | Realizar a troca de chaves públicas dentro da plataforma da QI Tech em sandbox (sandbox.qitech.app) | [Link Documentação](https://docs.qitech.com.br/documentation/primeiros_passos/troca_de_chaves) | CAB0001 e CAB0002 |
| CAB0004* | Teste de autenticação de chamadas | Finalizar teste de autenticação de chamadas |[Link Documentação](https://docs.qitech.com.br/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_v2) <br/><br/> [Link Documentação](https://docs.qitech.com.br/documentation/primeiros_passos/teste_de_autenticacao/endpoints_de_teste) | CAB0003 |
| CAB0005* | Configuração de webhooks | Realizar a configuração da url para envio dos webhooks por parte da QI, através da plataforma da QI Tech em sandbox (sandbox.qitech.app) | [Link Documentação](https://docs.qitech.com.br/documentation/primeiros_passos/configurando_webhooks) | CAB0001 e CAB0002 |

## Antifraude

## Cadastro e Autenticação

| Código | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| ATF0002* | Obtenção de API-key de onboarding | Obter junto ao time de integração da QI Tech a chave de API para uso da API de /onboarding | suporte.caas@qitech.com.br |  
| ATF0003* | Obtenção de mobile-token de OCR | Obter junto ao time de integração da QI Tech o Mobile Token  para uso do SDK de OCR | suporte.caas@qitech.com.br |  
| ATF0004* | Obtenção de mobile-token de Face Recognition | Obter junto ao time de integração da QI Tech o Mobile Token  para uso do SDK de Face Recognition | suporte.caas@qitech.com.br |  
| ATF0005* | Obtenção de mobile-token de Device scan | Obter junto ao time de integração da QI Tech o Mobile Token  para uso do SDK de Device scan | suporte.caas@qitech.com.br |  

## SDK OCR

| Código | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| ATF0007* | Build do SDK | Definir o template e customizações para coleta dos documentos e buildar o SDK com sucesso dentro da sua aplicação (aplicação do cliente QI Tech) | Android: [Link Documentação](https://docs.qitech.com.br/documentation/caas/ocr/android/introduction) <br/> iOS:[ Link Documentação](https://docs.qitech.com.br/documentation/caas/ocr/ios/introduction) |  |
| ATF0008* | Envio de documentos | Realizar a coleta de documentos utilizando o SDK dentro da sua aplicação (aplicação cliente QI Tech) |  | ATF0003 e ATF0007 |
| ATF0009* | Armazenamento de ocr_key | Armazenar as chaves retornadas pelo SDK, identificando a natureza do documento coletado (ex: cnh_front, cnh_back, etc) | Android: [Link Documentação](https://docs.qitech.com.br/documentation/caas/ocr/android/collecting_response) <br/>iOS:[ Link Documentação](https://docs.qitech.com.br/documentation/caas/ocr/ios/collecting_response)| ATF0008 |

## SDK Face Recognition

| Código | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| ATF0011* | Build do SDK | Definir customizações e buildar o SDK com sucesso dentro da sua aplicação (aplicação do cliente QI Tech) |Android: [Link Documentação](https://docs.qitech.com.br/documentation/caas/face_recognition/android/introduction) <br/>iOS:[ Link Documentação](https://docs.qitech.com.br/documentation/caas/face_recognition/ios/introduction)  |  |
| ATF0012* | Fluxo de prova de vida | Realizar o fluxo de prova de vida utilizando o SDK dentro da sua aplicação (aplicação cliente QI Tech) | | ATF0004 e ATF0011* |
| ATF0013* | Armazenamento de chave de imagem | Armazenar a image_key retornada pelo SDK após finalização do fluxo de prova de vida | Android: [Link Documentação](https://docs.qitech.com.br/documentation/caas/face_recognition/android/collecting_response) iOS:[ Link Documentação](https://docs.qitech.com.br/documentation/caas/face_recognition/ios/collecting_response) | ATF0012 |

## SDK Device Scan

| Código | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| ATF0015* | Build do SDK | Definição das permissões a serem solicitadas ao usuário por sua aplicação (aplicação do cliente QI Tech) e buildar o SDK com sucesso dentro da sua aplicação (aplicação do cliente QI Tech) | Android: [Link Documentação](https://docs.qitech.com.br/documentation/caas/device_scan/android/introduction)<br/>iOS:[ Link Documentação](https://docs.qitech.com.br/documentation/caas/device_scan/ios/introduction)|  
| ATF0016* | Armazenamento da sessão do usuário | Realizar o armazenamento da sessão do usuário (sessionId) que terá o dispositivo escaneado | Android: [Link Documentação](https://docs.qitech.com.br/documentation/caas/device_scan/android/example)<br/>iOS:[ Link Documentação](https://docs.qitech.com.br/documentation/caas/device_scan/ios/example) | ATF0015 e ATF0017 |
| ATF0017* | Coleta de informações | Instanciar o SDK com o sessionId armazenado e chamar o método de coleta de informações dentro de sua aplicação (aplicação do cliente QI Tech) | Android: [Link Documentação](https://docs.qitech.com.br/documentation/caas/face_recognition/android/collecting_response)<br/>iOS:[ Link Documentação](https://docs.qitech.com.br/documentation/caas/face_recognition/ios/collecting_response) | ATF0005 e ATF0015 |

## Antifraude

| Código | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| ATF0019* | Antifraude PF | Realizar com sucesso o antifraude de uma cliente pessoa física | [Link Documentação](https://docs.qitech.com.br/documentation/caas/onboarding/natural_person) | ATF0002 |
| ATF0020* | Antifraude PJ | Realizar com sucesso o antifraude de uma cliente pessoa jurídica | [Link Documentação](https://docs.qitech.com.br/documentation/caas/onboarding/legal_person) | ATF0002 |
| ATF0021* | Leitura de webhooks de analises derivadas para fluxo assíncrono | Recepcionar com sucesso o webhook de análise derivada para o fluxo de resposta assíncrona |[Link Documentação](https://docs.qitech.com.br/documentation/caas/onboarding/webhook) | ATF0019 ou ATF0020 |

## Cadastro Plataforma

| Código | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| ATF0022* | Cadastro de usuário Master | Realizar o cadastro de um usuário Master na plataforma do CaaS, para resolução de solicitações derivadas para “Análise manual”  | suporte.caas@qitech.com.br | ATF0019 ou ATF0020 |

---

# **QI Conta**

## Abertura de Conta

| Código | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| QIC0002* | Abertura de conta PF | Realizar a abertura de uma conta cujo titular seja uma pessoa física | [Link Documentação](https://docs.qitech.com.br/documentation/contas/abertura_de_conta/abertura_de_conta_pf) |  |
| QIC0002* | Abertura de conta PJ | Realizar a abertura de uma conta cujo titular seja uma pessoa jurídica | [Link Documentação](https://docs.qitech.com.br/documentation/contas/abertura_de_conta/abertura_de_conta_pf) | CAB0005 e CAB0006 |
| QIC0004* | Leitura de webhooks de abertura de conta | Ler corretamente os webhooks de abertura de conta | Item 1.2. ou 1.3:<br/>[Link Documentação](https://docs.qitech.com.br/documentation/contas/abertura_de_conta/webhooks_contas) |  QIC0002 ou QIC0002  |
| QIC0005* | Consulta de dados de uma conta | Consultar dados como saldo, dados do titular, data de abertura, dentre outros | [Link Documentação](https://docs.qitech.com.br/documentation/contas/consultar_conta) |  QIC0002 ou QIC0002  |

## Movimentações

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| QIC0008* | Consulta de Extrato | Realizar a consulta do extrato de uma conta | [Link Documentação](https://docs.qitech.com.br/documentation/movimentacao_de_contas/consulta_de_transferencias_realizadas) |  QIC0002 ou QIC0002  |
| QIC0009* | Solicitação de comprovante de transferência | Solicitar um comprovante de transferência | [Link Documentação](https://docs.qitech.com.br/documentation/movimentacao_de_contas/comprovante_de_transferencia)|  |
| QIC0010* | Leitura de webhooks de transação | Recepcionar com sucesso todos os webhooks de transação |  [Link Documentação](https://docs.qitech.com.br/documentation/movimentacao_de_contas/webhook_movimentacoes/index.html) |  QIC0002 ou QIC0002  |
| QIC0011* | Consulta de lista de instituições financeiras | Consultar lista de instituições financeiras habiliatadas para recebimento de TED e Pix |  [Link Documentação](https://docs.qitech.com.br/documentation/lista_de_instituicoes_financeiras/consulta_de_instituicoes_financeiras) |  QIC0002 ou QIC0002  |

---

# Upload de Documentos

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| UDD0001* | Upload de documento | Realizar o upload de um documento através da nossa API de documentos |  [Link Documentação](https://docs.qitech.com.br/documentation/upload_de_documentos/) |  |

---

# TED

| Código | Etapa | Descrição | Link                                                                                                        | Pré-requisito |
| --- | --- | --- |-------------------------------------------------------------------------------------------------------------| --- |
| TED0001* | Transferência TED Out | Realizar transferência TED para outra instituição financeira | [Link Documentação](https://docs.qitech.com.br/documentation/baas/ted/realizar_transferencia_2fa)               | QIC0002 ou QIC0002 |
| TED0002* | Simulação de estorno de uma TED Out | Simular o estorno de uma TED Out enviada a partira de uma QI Conta | Item 3: <br/>[Link Documentação](https://docs.qitech.com.br/documentation/movimentacao_de_contas/transacao) | TED0001 |
| TED0003* | Simulação de TED In | Simular a entrada de uma TED In em uma QI conta | Item 2: <br/>[Link Documentação](https://docs.qitech.com.br/documentation/movimentacao_de_contas/transacao) | QIC0002 ou QIC0002 |
| TED0004* | Consulta de transações TED| Listar transações TED  | [Link Documentação](https://docs.qitech.com.br/documentation/baas/ted/listar_transacao/index.html)             | QIC0002 ou QIC0002 |
| TED0004* | Consulta de transação  TED| Realizar a consulta de uma transação TED  | [Link Documentação](https://docs.qitech.com.br/documentation/baas/ted/consultar_transacao/index.html)           | QIC0002 ou QIC0002 |
| TED0006* | Leitura de webhooks de TED| Recepcionar com sucesso um webhook de TED | [Link Documentação](https://docs.qitech.com.br/documentation/baas/ted/webhooks/index.html)| QIC0002 ou QIC0002 |
---

# Transferência Interna

| Nº | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| TFI0001 | Transferência Interna com débito em conta | Comandar uma transferência a partir de uma QI Conta, tendo como destino da transferência, outra QI Conta | [Link Documentação](https://docs.qitech.com.br/documentation/baas/ted/realizar_transferencia_2fa) |  QIC0002 ou QIC0002  |
| TFI0002 | Simulação de transferência Interna com crédito em conta | Simular o recebimento de recursos na QI Conta alvo, tendo como origem, outra QI Conta | Item 1: <br/> [Link Documentação](https://docs.qitech.com.br/documentation/movimentacao_de_contas/transacao) |  QIC0002 ou QIC0002  |

---

# Boletos

## Gestão de Boletos

| Nº | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| BOL0002* | Registro de boleto de cobrança | Realizar o registro de um boleto de cobrança enviando uma ocorrência de registro | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/emissao/emissao_via_json) |  QIC0002 ou QIC0002 , |
| BOL0003 | Consultar carteira de cobrança de boletos | Consultar as carteiras de cobrança disponíveis para registro de boletos | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/consultar/consulta_de_carteira) |  QIC0002 ou QIC0002  |
| BOL0004* | Instrução de boleto de cobrança | Comandar uma instrução para um boleto registrado | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/enviar_instrucao_de_boleto) | BOL0002 |
| BOL0005 | Simulação de liquidação de boleto | Simular a liquidação de um boleto | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/pagamento/liquidacao) | BOL0002 |
| BOL0006* | Leitura de webhooks de boletos | Recepcionar com sucesso todos os webhooks relacionados às alterações de status de um boleto | [Link Documentação](https://docs.qitech.com.br/documentation/webhooks/boletos) | BOL0004 |
| BOL0007 | Registro de um bolepix | Realizar o registro de um bolepix | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/emissao/emissao_de_um_bolepix) |  |

## Pagamento de Boletos

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| BOL0009* | Consulta de linha digitável ou Código de Barras | Realizar a consulta de uma linha digitável de um boleto bancário | [Link Documentação](https://docs.qitech.com.br/documentation/baas/cobranca/consultar_boleto_bancario) |  |
| BOL0010* | Solicitar Token para pagamento de um boleto | Solicitar o token o pagamento de um boleto bancário | [Link Documentação](https://docs.qitech.com.br/documentation/baas/cobranca/2fa_v2/solicitacao_de_pagamento_de_boleto_bancario) |  QIC0002 ou QIC0002  |
| BOL0011* | Aprovar o pagamento de um boleto | Solicitar o token o pagamento de um boleto bancário  | [Link Documentação](https://docs.qitech.com.br/documentation/baas/cobranca/2fa_v2/confirmacao_de_pagamento_de_boleto_bancario) |  QIC0002 ou QIC0002  |
| BOL0012* | Consulta de linha digitável ou Código de Barras de um boleto de convênio | Realizar a consulta de uma linha digitável de um  boleto convênio. | [Link Documentação](https://docs.qitech.com.br/documentation/baas/cobranca/consultar_fatura_de_recolhimento) |  |
| BOL0013* | Solicitar Token para pagamento de um boleto de convênio | Solicitar o token o pagamento de um boleto convênio | [Link Documentação](https://docs.qitech.com.br/documentation/baas/cobranca/2fa_v2/solicitacao_de_pagamento_de_fatura_de_recolhimento) |  QIC0002 ou QIC0002  |
| BOL0014* | Aprovar o pagamento de um boleto de convênio| Solicitar o token o pagamento de um boleto de convênio  | [Link Documentação](https://docs.qitech.com.br/documentation/baas/cobranca/2fa_v2/confirmacao_de_pagamento_de_fatura_de_recolhimento) |  QIC0002 ou QIC0002  |

---

## Pix

## Transferência Pix 
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
|---------|--|---|---|---|
| PIX0002* | Transferência Pix Out | Realizar uma transferência Pix a partir de uma QI Conta utilizando dados bancários (pix manual) ou chave Pix | [1. Solicitar transferência](https://docs.qitech.com.br/documentation/baas/pix/2fa_v2/solicitacao_de_transacao_pix_2fa) <br></br> [2. Aprovar transferência](https://docs.qitech.com.br/documentation/baas/pix/2fa_v2/aprovar_transacao_pix_2fa) | CAB0001 |
| PIX0035 | Consulta de transferência pix | Recuperar os dados de uma transferência | [Link Documentação](https://docs.qitech.com.br/documentation/baas/pix/consultar_transferencias) | PIX0002 |
| PIX0003* | Simulação de reembolso de Pix Out | Simular o reembolso de um Pix Out. | [Link Documentação - Item 2](https://docs.qitech.com.br/documentation/pix/simulacao)| PIX0002 |
| PIX0004* | Simulação de Pix In | Simular o crédito de um Pix In em uma QI Conta. | [Link Documentação -> Item 1](https://docs.qitech.com.br/documentation/pix/simulacao)||
| PIX0037* | Leitura de webhook de transação pendente | Recepcionar com sucesso um webhook de transação pendente | [Link Documentação][(https://docs.qitech.com.br/documentation/baas/pix/webhooks) | PIX0002 |
| PIX0038* | Leitura de webhook de Pix de In | Recepcionar com sucesso um webhook de transferência Pix de entrada | [Link Documentação](https://docs.qitech.com.br/documentation/baas/pix/webhooks#webhook-para-pix-de-entrada)| PIX0004 |
| PIX0039 | Leitura de webhook de Devolução Pix | Recepcionar com sucesso um webhook de devolução de um Pix | [Link Documentação](https://docs.qitech.com.br/documentation/baas/pix/webhooks#webhook-para-devolu%C3%A7%C3%B5es-de-pix) | PIX0003 |
| PIX0040 | Solicitar a devolução de um Pix recebido | Solicitar a devolução de um Pix recebido | [Link Documentação](https://docs.qitech.com.br/documentation/baas/pix/2fa_v2/solicitacao_de_devolucao_pix) | PIX0003 |
| PIX0041 | Listar transferências Pix de uma conta | Listar transferências Pix de uma conta | [Link Documentação](https://docs.qitech.com.br/documentation/baas/pix/listar_transferencias) | PIX0003 |

## Gestão de Chave Pix

### Criação e Exclusão de Chave pix

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| PIX0008* | Criação de chave Pix | Realizar a criação de chave Pix do tipo cpf, cnpj, aleatória, e-mail e telefone | Item 5.1. e 5.2:<br/>[Link Documentação](https://docs.qitech.com.br/documentation/baas/manual_baas#5---gerenciar-chaves-pix) |  QIC0002 ou QIC0002  |](https://docs.qitech.com.br/documentation/pix_v2/index.html#consulta-de-chave-pix-no-banco-central)
| PIX0009 | Exclusão de chave Pix | Realizar a exclusão de uma chave Pix | [Link Documentação](https://docs.qitech.com.br/documentation/pix/excluir_chave) | PIX0008 |
| PIX0010* | Listagem de chaves Pix de uma QI Conta | Listar chaves Pix vinculadas a uma QI Conta | [Link Documentação](https://docs.qitech.com.br/documentation/pix/listar_chaves_pix) | PIX0008 |
| PIX0011* | Leitura de webhook de ativação de chave Pix aleatória | Recepcionar com suacesso webhook de criação de chave aleatória | Item 5.1:  <br/> [Link Documentação](https://docs.qitech.com.br/documentation/baas/manual_baas#51-criar-chave-pix-cpf-cnpj-ou-aleat%C3%B3ria) | PIX0008 |

### Portabilidade de Chave Pix

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| PIX0013* | Criação de Solicitação de Portabilidade In de uma Chave Pix | Criar um pedido de Portabilidade In de uma Chave Pix do tipo CPF, CNPJ, E-mail, Telefone e Aleatória | [Link Documentação](https://docs.qitech.com.br/documentation/pix/portabilidade#criando-um-pedido-de-portabilidade) |  QIC0002 ou QIC0002  |
| PIX0014* | Reenvio de 2fa de uma Solicitação de Portabilidade In de uma Chave Pix do tipo E-mail ou Telefone | Solicitar o reenvio do SMS (Chave Pix do tipo Telefone) ou E-mail (Chave Pix do tipo E-mail) de uma Solicitação de Portabilidade In de uma Chave Pix pendente (pending_claimer_validation) | [Link Documentação](https://docs.qitech.com.br/documentation/pix/portabilidade#reenviando-a-valida%C3%A7%C3%A3o-de-dois-fatores) | PIX0013 |
| PIX0015* | Exclusão de Solicitação de Portabilidade In de uma Chave Pix | Excluir uma Solicitação de Portabilidade In de uma Chave Pix pendente | [Link Documentação](https://docs.qitech.com.br/documentation/pix/portabilidade#deletando-um-pedido-de-portabilidade) | PIX0013 |
| PIX0016* | Leitura de webhook de conclusão de Solicitação de Portabilidade In de Chave Pix | Ler corretamente o webhook de conclusão de uma Solicitação de Portabilidade In de uma Chave Pix. Testando todos os possíveis status de conclusão (concluded, cancelled e failed) | Webhook: <br/> [Link Documentação](https://docs.qitech.com.br/documentation/pix/portabilidade#conclus%C3%A3o-da-portabilidade) |PIX0013 |
| PIX0017* | Simulação de Solicitação de Portabilidade Out de uma Chave Pix | Simular a chegada de uma solicitação de Solicitação de Portabilidade Out de uma Chave Pix | Item 5:<br/> [Link Documentação](https://docs.qitech.com.br/documentation/pix/simulacao/index.html) | PIX0013 |
| PIX0018* | Aprovação e Reprovação de Solicitação de Portabilidade Out de uma Chave Pix | Realizar a aprovação de uma Solicitação de Portabilidade Out de uma Chave Pix | [Link Documentação](https://docs.qitech.com.br/documentation/pix/portabilidade#request-4) | PIX0017 |
| PIX0019* | Reenvio de 2fa de uma Solicitação de Portabilidade Out de uma Chave Pix | Solicitar reenvio de 2fa de uma Solicitação de Portabilidade Out de uma Chave Pix | Enum “pending_donator_validation”  <br/> [Link Documentação](https://docs.qitech.com.br/documentation/pix/portabilidade#request-4) | PIX0018 |
| PIX0020* | Leitura de webhook de conclusão de Solicitação de Portabilidade Out de Chave Pix | Ler corretamente o webhook de conclusão de uma Solicitação de Portabilidade Out de uma Chave Pix. Testando todos os possíveis status de conclusão (concluded, cancelled e failed) | [Link Documentação](Dhttps://docs.qitech.com.br/documentation/pix/portabilidade#conclus%C3%A3o-da-portabilidade-1) | PIX0018 |

## Gestão de QR Code Pix

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| PIX0022* | Criação de QR Code Pix Estático | Gerar QR Code Estático | [Link Documentação](https://docs.qitech.com.br/documentation/pix/criar_qr_code_estatico) | PIX0008 |
| PIX0023 | Criação de QR Code Pix Dinâmico | Gerar QR Code Dinâmico com vencimento (dia de vencimento) e gerar QR Code Dinâmico Instantâneo (com segundos de expiração). | [Link Documentação](https://docs.qitech.com.br/documentation/pix/criar_qr_code_dinamico) | PIX0008 |
| PIX0024 | Exclusão de QR Code Pix Dinâmico | Excluir QR Code Pix | [Link Documentação](https://docs.qitech.com.br/documentation/pix/baixar_qr_code_dinamico) | PIX0023 |
| PIX0025 | Listar QR Codes Pix Dinâmicos | Listar QR Codes Pix Dinâmicos | [Link Documentação](https://docs.qitech.com.br/documentation/pix/pesquisar_por_qr_code_dinamico) | PIX0023 |
| PIX0026 | Leitura de webhook de expiração de QR Code Pix Dinâmico Instantâneo | Recepcionar com sucesso um webhook de expiração de QR Code Pix Dinâmico Instantâneo | [Link Documentação](https://docs.qitech.com.br/documentation/pix/webhook_por_qr_code_expirado) | PIX0023 |
| PIX0027* | Decodificação de QR Code Pix | Decodificar um QR Code Pix Estático, Dinâmico com vencimento e Dinâmico Instantâneo | [Link Documentação](https://docs.qitech.com.br/documentation/pix/decodificar_qr_code) | PIX0022 e PIX0023 |

## Pagamento de QR Code Pix

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |

| PIX0029* | Pagamento de QR Code Pix Estático | Realizar o pagamento de um QR Code Pix Estático | [Link Documentação](https://docs.qitech.com.br/documentation/baas/pix/realizar_transferencia#transfer%C3%AAncia-por-qr-code-pix) | PIX0022 |
| PIX0030* | Pagamento de QR Code Pix Dinâmico | Realizar o pagamento de um QR Code Pix Dinâmico |  [Link Documentação](https://docs.qitech.com.br/documentation/baas/pix/realizar_transferencia#transfer%C3%AAncia-por-qr-code-pix) | PIX0022 |

## Gestão de Limite Pix

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| PIX0032* | Solicitação de alteração de limite Pix | Realizar solicitação de alteração de limite Pix de uma QI Conte | [Link Documentação](https://docs.qitech.com.br/documentation/pix/solicitar_alteracao_de_limite_pix) |  QIC0002 ou QIC0002  |
| PIX0033 | Listagem de solicitações de alteração de limite Pix | Listar as solicitações de alteração de limite Pix para uma QI Conta | [Link Documentação](https://docs.qitech.com.br/documentation/pix/busca_por_solicitacao_de_limite_pix) | PIX0032 |
| PIX0034* | Consulta de limite Pix consumido | Consultar o limite Pix consumido para uma QI Conta | [Link Documentação](https://docs.qitech.com.br/documentation/pix/busca_por_uso_de_limite_pix) |  QIC0002 ou QIC0002  |

---

# Gestão de Tarifas
| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| GTF0001* | Solicitação de alteração de tarifas | Realizar a alteração de tarifas de uma conta| [Link Documentação](https://docs.qitech.com.br/documentation/contas/gestao_de_tarifas) |  QIC0002 ou QIC0002  |
| GTF0002* | Consulta de tarifas  | Consultar tarifas cadastradas em uma conta | [Link Documentação](https://docs.qitech.com.br/documentation/contas/consulta_de_tarifas) |  QIC0002 ou QIC0002  |

# Gestão de Cartoẽs

## Criação de Cartão
| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| GDC0001* | Criação de Cartão virtual  | Realizar a criação de um cartão virtual| [Link Documentação](https://docs.qitech.com.br/documentation/cards/create/gerar_cartao_virtual) |  QIC0002 ou QIC0002  |
| GDC0002* | Criação de Cartão físico  | Realizar a criação de um cartão físico| [Link Documentação](https://docs.qitech.com.br/documentation/cards/create/gerar_cartao_fisico) |  QIC0002 ou QIC0002  |

## Consulta de Cartões
| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| GDC0003* | Consulta cartão por chave  | Realizar a consulta de um cartão | [Link Documentação](https://docs.qitech.com.br/documentation/cards/search/buscar_cartao_by_key) | GDC0001 ou GDC0002 |
| GDC0004* | Listar cartões  | Realizar a listagem de cartões| [Link Documentação](https://docs.qitech.com.br/documentation/cards/search/listar_cartoes) | GDC0001 ou GDC0002 |
| GDC0005* | Buscar dados de um cartão | Buscar dados de um cartão| [Link Documentação](https://docs.qitech.com.br/documentation/cards/search/buscar_dados_pci) | GDC0001 ou GDC0002 |
| GDC0006* | Buscar Senha PCI | Buscar Senha PCI| [Link Documentação](https://docs.qitech.com.br/documentation/cards/search/buscar_senha) | GDC0001 ou GDC0002 |
| GDC0007* | Consultar dados da entrega | Consultar dados da entrega| [Link Documentação](https://docs.qitech.com.br/documentation/cards/search/buscar_entrega_by_key) | GDC0001 ou GDC0002 |

## Atualizar dados de um cartão
| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| GDC0008* | Atualizar status de um cartão  | Atualizar status de um cartão| [Link Documentação](https://docs.qitech.com.br/documentation/cards/status/update_status_cartao) | GDC0001 ou GDC0002 |
| GDC0009* | Ativar cartão físico  | Realizar a ativação de um cartão físico| [Link Documentação](https://docs.qitech.com.br/documentation/cards/status/ativar_cartao) | GDC0001 ou GDC0002 |
| GDC0010* | Alterar Senha   | Realizar a alteração de senha de um cartão | [Link Documentação](https://docs.qitech.com.br/documentation/cards/update/password_cartao) | GDC0001 ou GDC0002 |
| GDC0011* | Configurar contactless de um cartão  | Configurar contactless de um cartão  | [Link Documentação](https://docs.qitech.com.br/documentation/cards/update/contactless_cartao) | GDC0002 |

---

# Roteiro de Homologação - BaaS Conta Digital

URL: /en/documentation/roteiros_de_homologacao/roteiro_conta_digital_d795dc71-05b2-4476-bfbc-07ef247abd90

O roteiro de homolgoação descreve todos os recursos e funcionalidades que precisam
ser testados pelo parceiro integrador no ambiente de sandbox da QI Tech (ambiente de testes), 
antes da entrada em ambiente de produção do produto.

Este roteiro descreve todos os recursos e funcionalidades envolvidos no produto. 
:::info ATENÇÃO
As etapas sinalizadas com * são obrigatórias para a entrada em produção
:::

⚠️ **Todos os testes devem ser obrigatoriamente realizados no ambiente de Sandbox da QI Tech (ambiente de testes).
As movimentações realizadas em ambiente de Sandbox são movimentações financeiras fictícias, servindo apenas para teste de funcionalidade das APIs.**

## Cadastro e Autenticação API BaaS
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| CAB0001* | Cadastro no ambiente de Sandbox | Realizar o cadastro na plataforma da QI Tech no ambiente de Sandbox (sandbox.qitech.app) | cs@qitech.com.br |
| CAB0002* | Validação de token em Sandbox | Realizar a validação do QI Token em Sandbox | [Download Manual de Inclusão do Token](https://docs.qitech.com.br/assets/pdfs/QI%20Tech%20Manual%20Inclus%C3%A3o%20de%20Token.pdf) | CAB0001 |
| CAB0003* | Troca de chaves públicas | Realizar a troca de chaves públicas dentro da plataforma da QI Tech em sandbox (sandbox.qitech.app) | [Link Documentação](https://docs.qitech.com.br/documentation/primeiros_passos/troca_de_chaves) | CAB0001 e CAB0002 |
| CAB0004* | Teste de autenticação de chamadas | Finalizar teste de autenticação de chamadas | [Passo a Passo](https://docs.qitech.com.br/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_v2) <br/><br/> [Link Documentação](https://docs.qitech.com.br/documentation/primeiros_passos/teste_de_autenticacao/endpoints_de_teste) | CAB0003 |
| CAB0005* | Configuração de webhooks | Realizar a configuração da url para envio dos webhooks por parte da QI, através da plataforma da QI Tech em sandbox (sandbox.qitech.app) | [Link Documentação](https://docs.qitech.com.br/documentation/primeiros_passos/configurando_webhooks) | CAB0001 e CAB0002 |

## Antifraude

## Cadastro e Autenticação

| Código | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| ATF0002* | Obtenção de API-key de onboarding | Obter junto ao time de integração da QI Tech a chave de API para uso da API de /onboarding | suporte.caas@qitech.com.br |  
| ATF0003* | Obtenção de mobile-token de OCR | Obter junto ao time de integração da QI Tech o Mobile Token  para uso do SDK de OCR | suporte.caas@qitech.com.br |  
| ATF0004* | Obtenção de mobile-token de Face Recognition | Obter junto ao time de integração da QI Tech o Mobile Token  para uso do SDK de Face Recognition | suporte.caas@qitech.com.br |  
| ATF0005* | Obtenção de mobile-token de Device scan | Obter junto ao time de integração da QI Tech o Mobile Token  para uso do SDK de Device scan | suporte.caas@qitech.com.br |  

## SDK OCR

| Código | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| ATF0007* | Build do SDK | Definir o template e customizações para coleta dos documentos e buildar o SDK com sucesso dentro da sua aplicação (aplicação do cliente QI Tech) | Android: [Link Documentação](https://docs.qitech.com.br/documentation/caas/ocr/android/introduction) <br/> iOS:[ Link Documentação](https://docs.qitech.com.br/documentation/caas/ocr/ios/introduction) |  |
| ATF0008* | Envio de documentos | Realizar a coleta de documentos utilizando o SDK dentro da sua aplicação (aplicação cliente QI Tech) |  | ATF0003 e ATF0007 |
| ATF0009* | Armazenamento de ocr_key | Armazenar as chaves retornadas pelo SDK, identificando a natureza do documento coletado (ex: cnh_front, cnh_back, etc) | Android: [Link Documentação](https://docs.qitech.com.br/documentation/caas/ocr/android/collecting_response) <br/>iOS:[ Link Documentação](https://docs.qitech.com.br/documentation/caas/ocr/ios/collecting_response)| ATF0008 |

## SDK Face Recognition

| Código | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| ATF0011* | Build do SDK | Definir customizações e buildar o SDK com sucesso dentro da sua aplicação (aplicação do cliente QI Tech) |Android: [Link Documentação](https://docs.qitech.com.br/documentation/caas/face_recognition/android/introduction) <br/>iOS:[ Link Documentação](https://docs.qitech.com.br/documentation/caas/face_recognition/ios/introduction)  |  |
| ATF0012* | Fluxo de prova de vida | Realizar o fluxo de prova de vida utilizando o SDK dentro da sua aplicação (aplicação cliente QI Tech) | | ATF0004 e ATF0011* |
| ATF0013* | Armazenamento de chave de imagem | Armazenar a image_key retornada pelo SDK após finalização do fluxo de prova de vida | Android: [Link Documentação](https://docs.qitech.com.br/documentation/caas/face_recognition/android/collecting_response) iOS:[ Link Documentação](https://docs.qitech.com.br/documentation/caas/face_recognition/ios/collecting_response) | ATF0012 |

## SDK Device Scan

| Código | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| ATF0015* | Build do SDK | Definição das permissões a serem solicitadas ao usuário por sua aplicação (aplicação do cliente QI Tech) e buildar o SDK com sucesso dentro da sua aplicação (aplicação do cliente QI Tech) | Android: [Link Documentação](https://docs.qitech.com.br/documentation/caas/device_scan/android/introduction)<br/>iOS:[ Link Documentação](https://docs.qitech.com.br/documentation/caas/device_scan/ios/introduction)|  
| ATF0016* | Armazenamento da sessão do usuário | Realizar o armazenamento da sessão do usuário (sessionId) que terá o dispositivo escaneado | Android: [Link Documentação](https://docs.qitech.com.br/documentation/caas/device_scan/android/example)<br/>iOS:[ Link Documentação](https://docs.qitech.com.br/documentation/caas/device_scan/ios/example) | ATF0015 e ATF0017 |
| ATF0017* | Coleta de informações | Instanciar o SDK com o sessionId armazenado e chamar o método de coleta de informações dentro de sua aplicação (aplicação do cliente QI Tech) | Android: [Link Documentação](https://docs.qitech.com.br/documentation/caas/face_recognition/android/collecting_response)<br/>iOS:[ Link Documentação](https://docs.qitech.com.br/documentation/caas/face_recognition/ios/collecting_response) | ATF0005 e ATF0015 |

## Antifraude

| Código | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| ATF0019* | Antifraude PF | Realizar com sucesso o antifraude de uma cliente pessoa física | [Link Documentação](https://docs.qitech.com.br/documentation/caas/onboarding/natural_person) | ATF0002 |
| ATF0020* | Antifraude PJ | Realizar com sucesso o antifraude de uma cliente pessoa jurídica | [Link Documentação](https://docs.qitech.com.br/documentation/caas/onboarding/legal_person) | ATF0002 |
| ATF0021* | Leitura de webhooks de analises derivadas para fluxo assíncrono | Recepcionar com sucesso o webhook de análise derivada para o fluxo de resposta assíncrona |[Link Documentação](https://docs.qitech.com.br/documentation/caas/onboarding/webhook) | ATF0019 ou ATF0020 |

## Cadastro Plataforma

| Código | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| ATF0022* | Cadastro de usuário Master | Realizar o cadastro de um usuário Master na plataforma do CaaS, para resolução de solicitações derivadas para “Análise manual”  | suporte.caas@qitech.com.br | ATF0019 ou ATF0020 |

---

# **QI Conta**

## Abertura de Conta

| Código | Etapa | Descrição | Link Documentação | Pré-requisito |
| --- | --- | --- | --- | --- |
| QIC0002* | Abertura de conta PF | Realizar a abertura de uma conta cujo titular seja uma pessoa física | [Link Documentação](https://docs.qitech.com.br/documentation/baas/manual_baas#13-cria%C3%A7%C3%A3o-da-conta-pf) |  |
| QIC0002* | Abertura de conta PJ | Realizar a abertura de uma conta cujo titular seja uma pessoa jurídica | [Link Documentação](https://docs.qitech.com.br/documentation/baas/manual_baas#12-cria%C3%A7%C3%A3o-da-conta-pj) | CAB0005 e CAB0006 |
| QIC0004* | Leitura de webhooks de abertura de conta | Ler corretamente os webhooks de abertura de conta | Item 1.2. ou 1.3:<br/>[Link Documentação](https://docs.qitech.com.br/documentation/baas/manual_baas#12-cria%C3%A7%C3%A3o-da-conta-pj) |  QIC0002 ou QIC0002  |
| QIC0005* | Consulta de dados de uma conta | Consultar dados como saldo, dados do titular, data de abertura, dentre outros | [Link Documentação](https://docs.qitech.com.br/documentation/contas/consultar_contas) |  QIC0002 ou QIC0002  |

## Movimentações

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| QIC0008* | Consulta de Extrato | Realizar a consulta do extrato de uma conta | [Link Documentação](https://docs.qitech.com.br/documentation/movimentacao_de_contas/consulta_de_transacoes) |  QIC0002 ou QIC0002  |
| QIC0009* | Solicitação de comprovante de transferência | Solicitar um comprovante de transferência | [Link Documentação](https://docs.qitech.com.br/documentation/movimentacao_de_contas/consulta_de_transacoes)|  |
| QIC0010* | Leitura de webhooks de transação | Recepcionar com sucesso todos os webhooks de transação |  [Link Documentação](https://docs.qitech.com.br/documentation/movimentacao_de_contas/comprovante_de_transferencia) |  QIC0002 ou QIC0002  |
| QIC0011* | Consulta de lista de instituições financeiras | Consultar lista de instituições financeiras habiliatadas para recebimento de TED e Pix |  [Link Documentação](https://docs.qitech.com.br/documentation/lista_de_instituicoes_financeiras/consulta_de_instituicoes_financeiras) |  QIC0002 ou QIC0002  |

---

# Upload de Documentos

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| UDD0001* | Upload de documento | Realizar o upload de um documento através da nossa API de documentos |  [Link Documentação](https://docs.qitech.com.br/documentation/upload_de_documentos/) |  |

---

# TED

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| TED0001* | Transferência TED Out | Realizar transferência TED para outra instituição financeira | [Link Documentação](https://docs.qitech.com.br/documentation/baas/ted/realizar_transferencia) | QIC0002 ou QIC0002 |
| TED0002* | Simulação de estorno de uma TED Out | Simular o estorno de uma TED Out enviada a partira de uma QI Conta | Item 3: <br/>[Link Documentação](https://docs.qitech.com.br/documentation/movimentacao_de_contas/transacao) | TED0001 |
| TED0003* | Simulação de TED In | Simular a entrada de uma TED In em uma QI conta | Item 2: <br/>[Link Documentação](https://docs.qitech.com.br/documentation/movimentacao_de_contas/transacao) | QIC0002 ou QIC0002 |
| TED0004* | Consulta de transações TED| Listar transações TED  | [Link Documentação](https://docs.qitech.com.br/documentation/baas/ted/listar_transferencias) | QIC0002 ou QIC0002 |
| TED0004* | Consulta de transação  TED| Realizar a consulta de uma transação TED  | [Link Documentação](https://docs.qitech.com.br/documentation/baas/ted/consultar_transferencia) | QIC0002 ou QIC0002 |
| TED0006* | Leitura de webhooks de TED| Recepcionar com sucesso um webhook de TED | [Link Documentação](https://docs.qitech.com.br/documentation/baas/ted/webhooks) | QIC0002 ou QIC0002 |
---

# Transferência Interna

| Nº | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| TFI0001 | Transferência Interna com débito em conta | Comandar uma transferência a partir de uma QI Conta, tendo como destino da transferência, outra QI Conta | [Link Documentação](https://docs.qitech.com.br/documentation/baas/ted/realizar_transferencia) |  QIC0002 ou QIC0002  |
| TFI0002 | Simulação de transferência Interna com crédito em conta | Simular o recebimento de recursos na QI Conta alvo, tendo como origem, outra QI Conta | Item 1: <br/> [Link Documentação](https://docs.qitech.com.br/documentation/movimentacao_de_contas/transacao) |  QIC0002 ou QIC0002  |

---

# Boletos

## Gestão de Boletos

| Nº | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| BOL0002* | Registro de boleto de cobrança | Realizar o registro de um boleto de cobrança enviando uma ocorrência de registro | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/emissao/emissao_via_json) |  QIC0002 ou QIC0002 , |
| BOL0003 | Consultar carteira de cobrança de boletos | Consultar as carteiras de cobrança disponíveis para registro de boletos | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/consultar/consulta_de_carteira) |  QIC0002 ou QIC0002  |
| BOL0004* | Instrução de boleto de cobrança | Comandar uma instrução para um boleto registrado | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/enviar_instrucao_de_boleto) | BOL0002 |
| BOL0005 | Simulação de liquidação de boleto | Simular a liquidação de um boleto | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/pagamento/liquidacao) | BOL0002 |
| BOL0006* | Leitura de webhooks de boletos | Recepcionar com sucesso todos os webhooks relacionados às alterações de status de um boleto | [Link Documentação](https://docs.qitech.com.br/documentation/webhooks/boletos) | BOL0004 |
| BOL0007 | Registro de um bolepix | Realizar o registro de um bolepix | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/emissao/emissao_de_um_bolepix) |  |

## Pagamento de Boletos

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| BOL0009* | Consulta de linha digitável | Realizar a consulta de uma linha digitável de um boleto bancário ou boleto convênio. | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/pagamento/consulta_linha_digitavel) |  |
| BOL0010* | Pagamento de um boleto | Realizar o pagamento de um boleto bancário ou de boleto de convênio | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/pagamento/realizar_pagamento) |  QIC0002 ou QIC0002  |
| BOL0011* | Consulta de linha digitável | Realizar a consulta de uma linha digitável de um  boleto convênio. | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/pagamento/consulta_linha_digitavel) |  |
| BOL0013* | Pagamento de um boleto | Realizar o pagamento de um boleto de convênio | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/pagamento/realizar_pagamento) |  QIC0002 ou QIC0002  |

---

## Pix

## Transferência Pix 
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
|---------|--|---|---|---|
| PIX0002* | Transferência Pix Out | Realizar uma transferência Pix a partir de uma QI Conta utilizando dados bancários (pix manual) ou chave Pix | [Link Documentação](https://docs.qitech.com.br/documentation/baas/pix/realizar_transferencia)| CAB0001 |
| PIX0035 | Consulta de transferência pix | Recuperar os dados de uma transferência | [Link Documentação](https://docs.qitech.com.br/documentation/baas/pix/consultar_transferencias) | PIX0002 |
| PIX0003* | Simulação de reembolso de Pix Out | Simular o reembolso de um Pix Out. | [Link Documentação - Item 2](https://docs.qitech.com.br/documentation/pix/simulacao)| PIX0002 |
| PIX0004* | Simulação de Pix In | Simular o crédito de um Pix In em uma QI Conta. | [Link Documentação -> Item 1](https://docs.qitech.com.br/documentation/pix/simulacao)||
| PIX0037* | Leitura de webhook de transação pendente | Recepcionar com sucesso um webhook de transação pendente | [Link Documentação][(https://docs.qitech.com.br/documentation/baas/pix/webhooks) | PIX0002 |
| PIX0038* | Leitura de webhook de Pix de In | Recepcionar com sucesso um webhook de transferência Pix de entrada | [Link Documentação](https://docs.qitech.com.br/documentation/baas/pix/webhooks)| PIX0004 |
| PIX0039 | Leitura de webhook de Devolução Pix | Recepcionar com sucesso um webhook de devolução de um Pix | [Link Documentação](https://docs.qitech.com.br/documentation/baas/pix/webhooks#webhook-para-devolu%C3%A7%C3%B5es-de-pix) | PIX0003 |

## Gestão de Chave Pix

### Criação e Exclusão de Chave pix

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| PIX0008* | Criação de chave Pix | Realizar a criação de chave Pix do tipo cpf, cnpj, aleatória, e-mail e telefone | Item 5.1. e 5.2:<br/>[Link Documentação](https://docs.qitech.com.br/documentation/baas/manual_baas#5---gerenciar-chaves-pix) |  QIC0002 ou QIC0002  |](https://docs.qitech.com.br/documentation/pix_v2/index.html#consulta-de-chave-pix-no-banco-central)
| PIX0009 | Exclusão de chave Pix | Realizar a exclusão de uma chave Pix | [Link Documentação](https://docs.qitech.com.br/documentation/pix/excluir_chave) | PIX0008 |
| PIX0010* | Listagem de chaves Pix de uma QI Conta | Listar chaves Pix vinculadas a uma QI Conta | [Link Documentação](https://docs.qitech.com.br/documentation/pix/listar_chaves_pix) | PIX0008 |
| PIX0011* | Leitura de webhook de ativação de chave Pix aleatória | Recepcionar com suacesso webhook de criação de chave aleatória | Item 5.1:  <br/> [Link Documentação](https://docs.qitech.com.br/documentation/baas/manual_baas#51-criar-chave-pix-cpf-cnpj-ou-aleat%C3%B3ria) | PIX0008 |

### Portabilidade de Chave Pix

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| PIX0013* | Criação de Solicitação de Portabilidade In de uma Chave Pix | Criar um pedido de Portabilidade In de uma Chave Pix do tipo CPF, CNPJ, E-mail, Telefone e Aleatória | [Link Documentação](https://docs.qitech.com.br/documentation/pix/portabilidade#criando-um-pedido-de-portabilidade) |  QIC0002 ou QIC0002  |
| PIX0014* | Reenvio de 2fa de uma Solicitação de Portabilidade In de uma Chave Pix do tipo E-mail ou Telefone | Solicitar o reenvio do SMS (Chave Pix do tipo Telefone) ou E-mail (Chave Pix do tipo E-mail) de uma Solicitação de Portabilidade In de uma Chave Pix pendente (pending_claimer_validation) | [Link Documentação](https://docs.qitech.com.br/documentation/pix/portabilidade#reenviando-a-valida%C3%A7%C3%A3o-de-dois-fatores) | PIX0013 |
| PIX0015* | Exclusão de Solicitação de Portabilidade In de uma Chave Pix | Excluir uma Solicitação de Portabilidade In de uma Chave Pix pendente | [Link Documentação](https://docs.qitech.com.br/documentation/pix/portabilidade#deletando-um-pedido-de-portabilidade) | PIX0013 |
| PIX0016* | Leitura de webhook de conclusão de Solicitação de Portabilidade In de Chave Pix | Ler corretamente o webhook de conclusão de uma Solicitação de Portabilidade In de uma Chave Pix. Testando todos os possíveis status de conclusão (concluded, cancelled e failed) | Webhook: <br/> [Link Documentação](https://docs.qitech.com.br/documentation/pix/portabilidade#conclus%C3%A3o-da-portabilidade) |PIX0013 |
| PIX0017* | Simulação de Solicitação de Portabilidade Out de uma Chave Pix | Simular a chegada de uma solicitação de Solicitação de Portabilidade Out de uma Chave Pix | Item 5:<br/> [Link Documentação](https://docs.qitech.com.br/documentation/pix/simulacao/index.html) | PIX0013 |
| PIX0018* | Aprovação e Reprovação de Solicitação de Portabilidade Out de uma Chave Pix | Realizar a aprovação de uma Solicitação de Portabilidade Out de uma Chave Pix | [Link Documentação](https://docs.qitech.com.br/documentation/pix/portabilidade#request-4) | PIX0017 |
| PIX0019* | Reenvio de 2fa de uma Solicitação de Portabilidade Out de uma Chave Pix | Solicitar reenvio de 2fa de uma Solicitação de Portabilidade Out de uma Chave Pix | Enum “pending_donator_validation”  <br/> [Link Documentação](https://docs.qitech.com.br/documentation/pix/portabilidade#request-4) | PIX0018 |
| PIX0020* | Leitura de webhook de conclusão de Solicitação de Portabilidade Out de Chave Pix | Ler corretamente o webhook de conclusão de uma Solicitação de Portabilidade Out de uma Chave Pix. Testando todos os possíveis status de conclusão (concluded, cancelled e failed) | [Link Documentação](Dhttps://docs.qitech.com.br/documentation/pix/portabilidade#conclus%C3%A3o-da-portabilidade-1) | PIX0018 |

## Gestão de QR Code Pix

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| PIX0022* | Criação de QR Code Pix Estático | Gerar QR Code Estático | [Link Documentação](https://docs.qitech.com.br/documentation/pix/criar_qr_code_estatico) | PIX0008 |
| PIX0023 | Criação de QR Code Pix Dinâmico | Gerar QR Code Dinâmico com vencimento (dia de vencimento) e gerar QR Code Dinâmico Instantâneo (com segundos de expiração). | [Link Documentação](https://docs.qitech.com.br/documentation/pix/criar_qr_code_dinamico) | PIX0008 |
| PIX0024 | Exclusão de QR Code Pix Dinâmico | Excluir QR Code Pix | [Link Documentação](https://docs.qitech.com.br/documentation/pix/baixar_qr_code_dinamico) | PIX0023 |
| PIX0025 | Listar QR Codes Pix Dinâmicos | Listar QR Codes Pix Dinâmicos | [Link Documentação](https://docs.qitech.com.br/documentation/pix/pesquisar_por_qr_code_dinamico) | PIX0023 |
| PIX0026 | Leitura de webhook de expiração de QR Code Pix Dinâmico Instantâneo | Recepcionar com sucesso um webhook de expiração de QR Code Pix Dinâmico Instantâneo | [Link Documentação](https://docs.qitech.com.br/documentation/pix/webhook_por_qr_code_expirado) | PIX0023 |
| PIX0027* | Decodificação de QR Code Pix | Decodificar um QR Code Pix Estático, Dinâmico com vencimento e Dinâmico Instantâneo | [Link Documentação](https://docs.qitech.com.br/documentation/pix/decodificar_qr_code) | PIX0022 e PIX0023 |

## Pagamento de QR Code Pix

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| PIX0029* | Pagamento de QR Code Pix Estático | Realizar o pagamento de um QR Code Pix Estático | Item 4.1: [Link Documentação](https://docs.qitech.com.br/documentation/baas/manual_baas#41-pagando-um-qr-code-pix-est%C3%A1tico) | PIX0022 |
| PIX0030* | Pagamento de QR Code Pix Dinâmico | Realizar o pagamento de um QR Code Pix Dinâmico | Item 4.2: [Link Documentação](https://docs.qitech.com.br/documentation/baas/manual_baas#42-pagando-um-qr-code-pix-din%C3%A2mico) | PIX0022 |

## Gestão de Limite Pix

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| PIX0032* | Solicitação de alteração de limite Pix | Realizar solicitação de alteração de limite Pix de uma QI Conte | [Link Documentação](https://docs.qitech.com.br/documentation/pix/solicitar_alteracao_de_limite_pix) |  QIC0002 ou QIC0002  |
| PIX0033 | Listagem de solicitações de alteração de limite Pix | Listar as solicitações de alteração de limite Pix para uma QI Conta | [Link Documentação](https://docs.qitech.com.br/documentation/pix/busca_por_solicitacao_de_limite_pix) | PIX0032 |
| PIX0034* | Consulta de limite Pix consumido | Consultar o limite Pix consumido para uma QI Conta | [Link Documentação](https://docs.qitech.com.br/documentation/pix/busca_por_uso_de_limite_pix) |  QIC0002 ou QIC0002  |

---

# Gestão de Tarifas
| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| GTF0001* | Solicitação de alteração de tarifas | Realizar a alteração de tarifas de uma conta| [Link Documentação](https://docs.qitech.com.br/documentation/contas/gestao_de_tarifas) |  QIC0002 ou QIC0002  |
| GTF0002* | Consulta de tarifas  | Consultar tarifas cadastradas em uma conta | [Link Documentação](https://docs.qitech.com.br/documentation/contas/consulta_de_tarifas) |  QIC0002 ou QIC0002  |

# Gestão de Cartoẽs

## Criação de Cartão
| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| GDC0001* | Criação de Cartão virtual  | Realizar a criação de um cartão virtual| [Link Documentação](https://docs.qitech.com.br/documentation/cards/create/gerar_cartao_virtual) |  QIC0002 ou QIC0002  |
| GDC0002* | Criação de Cartão físico  | Realizar a criação de um cartão físico| [Link Documentação](https://docs.qitech.com.br/documentation/cards/create/gerar_cartao_fisico) |  QIC0002 ou QIC0002  |

## Consulta de Cartões
| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| GDC0003* | Consulta cartão por chave  | Realizar a consulta de um cartão | [Link Documentação](https://docs.qitech.com.br/documentation/cards/search/buscar_cartao_by_key) | GDC0001 ou GDC0002 |
| GDC0004* | Listar cartões  | Realizar a listagem de cartões| [Link Documentação](https://docs.qitech.com.br/documentation/cards/search/listar_cartoes) | GDC0001 ou GDC0002 |
| GDC0005* | Buscar dados de um cartão | Buscar dados de um cartão| [Link Documentação](https://docs.qitech.com.br/documentation/cards/search/buscar_dados_pci) | GDC0001 ou GDC0002 |
| GDC0006* | Buscar Senha PCI | Buscar Senha PCI| [Link Documentação](https://docs.qitech.com.br/documentation/cards/search/buscar_senha) | GDC0001 ou GDC0002 |
| GDC0007* | Consultar dados da entrega | Consultar dados da entrega| [Link Documentação](https://docs.qitech.com.br/documentation/cards/search/buscar_entrega_by_key) | GDC0001 ou GDC0002 |

## Atualizar dados de um cartão
| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| GDC0008* | Atualizar status de um cartão  | Atualizar status de um cartão| [Link Documentação](https://docs.qitech.com.br/documentation/cards/status/update_status_cartao) | GDC0001 ou GDC0002 |
| GDC0009* | Ativar cartão físico  | Realizar a ativação de um cartão físico| [Link Documentação](https://docs.qitech.com.br/documentation/cards/status/ativar_cartao) | GDC0001 ou GDC0002 |
| GDC0010* | Alterar Senha   | Realizar a alteração de senha de um cartão | [Link Documentação](https://docs.qitech.com.br/documentation/cards/update/password_cartao) | GDC0001 ou GDC0002 |
| GDC0011* | Configurar contactless de um cartão  | Configurar contactless de um cartão  | [Link Documentação](https://docs.qitech.com.br/documentation/cards/update/contactless_cartao) | GDC0002 |

---

# Roteiro de Homologação - Conta Integrada

URL: /en/documentation/roteiros_de_homologacao/roteiro_conta_integrada

O roteiro de homolgoação descreve todos os recursos e funcionalidades que precisam
ser testados pelo parceiro integrador no ambiente de sandbox da QI Tech (ambiente de testes), 
antes da entrada em ambiente de produção do produto.

Este roteiro descreve todos os recursos e funcionalidades envolvidos no produto. 

`*: etapas obrigatórias para entrada em produção`

## Cadastro e Autenticação API BaaS
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
|---------|--|---|---|---|
| CAB0001* | Cadastro no ambiente de Sandbox | Realizar o cadastro na plataforma da QI Tech no ambiente de Sandbox (sandbox.qitech.app) | [Link documentação](https://docs.qitech.com.br/documentation/primeiros_passos/inicio) 
| CAB0002* | Validação de token em Sandbox | Realizar a validação do QI Token em Sandbox | [Manual de Inclusão do Token](https://docs.qitech.com.br/assets/pdfs/QI%20Tech%20Manual%20Inclus%C3%A3o%20de%20Token.pdf) | CAB0001 |
| CAB0003* | Troca de chaves públicas | Realizar a troca de chaves públicas dentro da plataforma da QI Tech em sandbox (sandbox.qitech.app) | [Troca de chaves](https://docs.qitech.com.br/documentation/primeiros_passos/troca_de_chaves) | CAB0001 e CAB0002 |
| CAB0004* | Teste de autenticação de chamadas | Finalizar teste de autenticação de chamadas | [Teste de Autenticação](https://docs.qitech.com.br/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_v2) <br/><br/> [Endpoints de teste da autenticação](https://docs.qitech.com.br/documentation/primeiros_passos/teste_de_autenticacao/endpoints_de_teste) | CAB0003 |
| CAB0005* | Configuração de webhooks | Realizar a configuração da url para envio dos webhooks por parte da QI, através da plataforma da QI Tech em sandbox (sandbox.qitech.app) | [Configuração de webhooks](https://docs.qitech.com.br/documentation/primeiros_passos/configurando_webhooks) | CAB0001 e CAB0002 |

## QI Conta
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
|---------|--|---|---|---|
| QIC0005 | Consulta de dados de uma conta | Recuperar os dados de uma QI Conta com sucesso | [Consultar Conta](https://docs.qitech.com.br/documentation/contas/consultar_conta) ||

## Transferência Pix 
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
|---------|--|---|---|---|
| PIX0002* | Transferência Pix Out | Realizar uma transferência Pix a partir de uma QI Conta utilizando dados bancários (pix manual) ou chave Pix | [Realização de Transação Pix](https://docs.qitech.com.br/documentation/baas/pix/realizar_transferencia)||
| PIX0035 | Consulta de transferência pix | Recuperar os dados de uma transferência | [Consulta de transferência Pix](https://docs.qitech.com.br/documentation/baas/pix/consultar_transferencias) | PIX0002 |
| PIX0003* | Simulação de reembolso de Pix Out | Simular o reembolso de um Pix Out. | [Simulação reembolso Pix Out -> Item 2](https://docs.qitech.com.br/documentation/pix/simulacao)| PIX0002 |
| PIX0004* | Simulação de Pix In | Simular o crédito de um Pix In em uma QI Conta. | [Simulação Pix In -> Item 1](https://docs.qitech.com.br/documentation/pix/simulacao)||
| PIX0005* | Reembolso de Pix In | Realizar o reembolso de um Pix In a partir de uma QI Conta. | [Reembolso Pix In](https://docs.qitech.com.br/documentation/baas/pix/solicitar_devolucao)| PIX0004 |
| PIX0037* | Leitura de webhook de transação pendente | Recepcionar com sucesso um webhook de transação pendente | [Webhook de transação pendente](https://docs.qitech.com.br/documentation/baas/pix/webhooks#webhook-para-transa%C3%A7%C3%B5es-pendentes) | PIX0002 |
| PIX0038* | Leitura de webhook de Pix de In | Recepcionar com sucesso um webhook de transferência Pix de entrada | [Webhook Pix In](https://docs.qitech.com.br/documentation/baas/pix/webhooks#webhook-para-pix-de-entrada) | PIX0004 |
| PIX0039 | Leitura de webhook de Devolução Pix | Recepcionar com sucesso um webhook de devolução de um Pix | [Webhook Devolução Pix](https://docs.qitech.com.br/documentation/baas/pix/webhooks#webhook-para-devolu%C3%A7%C3%B5es-de-pix) | PIX0003 |

## Movimentações
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
|---------|--|---|---|---|
| QIC0008* | Consulta de Transações | Realizar a consulta das transações de uma conta | [Consulta de Transações](https://docs.qitech.com.br/documentation/movimentacao_de_contas/consulta_de_transacoes) ||
| QIC0009 | Solicitação de comprovante de transferência | Solicitação de comprovante de transferência | [Solicitar comprovante de transferência](https://docs.qitech.com.br/documentation/movimentacao_de_contas/comprovante_de_transferencia) | PIX0002 |
| QIC0010* | Leitura de webhooks de transação | Recepcionar com sucesso todos os webhooks de transação | [Webhook account_transaction](https://docs.qitech.com.br/documentation/movimentacao_de_contas/webhook_movimentacoes) | CAB0005 e PIX0002 |
| QIC0011 | Consulta de lista de instituições financeiras | Consultar lista de instituições financeiras habiliatadas para recebimento de TED e Pix | [Consulta de Instituições Financeiras](https://docs.qitech.com.br/documentation/lista_de_instituicoes_financeiras/consulta_de_instituicoes_financeiras) ||

## Consulta de Chave Pix
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
|---------|--|---|---|---|
| PIX0008* | Criação de Chave Pix Aleatória | Criar uma chave pix aleatória | [Link Documentação](https://docs.qitech.com.br/documentation/pix/criar_chave#criar-chave-pix-cpf-cnpj-ou-aleat%C3%B3ria) | PIX008 |
| PIX0036* | Consulta de dados de uma chave Pix | Realizar com sucesso a consulta de uma chave Pix no Bacen. | [Consulta de chave Pix](https://docs.qitech.com.br/documentation/baas/pix/consultar_chave_pix) ||

## Gestão de QR Code Pix

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| PIX0022* | Criação de QR Code Pix Estático | Gerar QR Code Estático | [Link Documentação](https://docs.qitech.com.br/documentation/pix/criar_qr_code_estatico) | PIX0008 |
| PIX0023 | Criação de QR Code Pix Dinâmico | Gerar QR Code Dinâmico com vencimento (dia de vencimento) e gerar QR Code Dinâmico Instantâneo (com segundos de expiração). | [Link Documentação](https://docs.qitech.com.br/documentation/pix/criar_qr_code_dinamico) | PIX0008 |
| PIX0024 | Exclusão de QR Code Pix Dinâmico | Excluir QR Code Pix | [Link Documentação](https://docs.qitech.com.br/documentation/pix/baixar_qr_code_dinamico) | PIX0023 |
| PIX0025 | Listar QR Codes Pix Dinâmicos | Listar QR Codes Pix Dinâmicos | [Link Documentação](https://docs.qitech.com.br/documentation/pix/pesquisar_por_qr_code_dinamico) | PIX0023 |
| PIX0026* | Leitura de webhook de expiração de QR Code Pix Dinâmico Instantâneo | Recepcionar com sucesso um webhook de expiração de QR Code Pix Dinâmico Instantâneo | [Link Documentação](https://docs.qitech.com.br/documentation/pix/webhook_por_qr_code_expirado) | PIX0023 |
| PIX0027* | Decodificação de QR Code Pix | Decodificar um QR Code Pix Estático, Dinâmico com vencimento e Dinâmico Instantâneo | [Link Documentação](https://docs.qitech.com.br/documentation/pix/decodificar_qr_code) | PIX0022 e PIX0023 |

## Decodificar QR Code Pix
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
|---------|--|---|---|---|
| PIX0027* | Decodificação de QR Code Pix | Consultar os dados de um QR Code Pix (decodificar) utilizando a url do pix copia e cola | [Decodificação de QR Code Pix](https://docs.qitech.com.br/documentation/pix/decodificar_qr_code)||

## Boletos

## Gestão de Boletos
| Nº      | Etapa | Descrição | Link  | Pré-requisito |
|---|---|---|---|---|
| BOL0001 | Registro de boleto de um único boleto cobrança    | Realizar o registro de um boleto de cobrança | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/emissao/emissao_boleto_unico_padrao/index.html) | CAB0002 ou CAB0003   |
| BOL0002 | Registro de boleto de um único boleto de cobrança instantâneo | Realizar o registro de um boleto de cobrança | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/emissao/emissao_boleto_unico_instantanea) | CAB0002 ou CAB0003   |
| BOL0003 | Registro de boleto de boleto em lote  | Realizar o registro de boleto de cobrança em lote | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/emissao/emissao_em_lote) | CAB0002 ou CAB0003   |
| BOL0004 | Emissão de Boleto Único Padrão        | Emitir um boleto único padrão    | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/emissao/emissao_boleto_unico_padrao)  | CAB0002 ou CAB0003   |
| BOL0005 | Emissão de Boleto Único Instantâneo   | Emitir um boleto único instantân | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/emissao/emissao_boleto_unico_instantanea) | CAB0002 ou CAB0003   |
| BOL0006 | Emissão em Lote   | Emitir boletos em lote | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/emissao/emissao_em_lote)| CAB0002 ou CAB0003   |
| BOL0007 | Realizar abatimento no valor de um boleto | Realizar abatimento no valor de um boleto | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/instrucoes/abatimento/criar_abatimento) | BOL0001, BOL0002 ou BOL0003 |
| BOL0008 | Cancelar Abatimento     | Cancelar abatimento em um boleto | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/instrucoes/abatimento/cancelar_abatimento) | BOL0001, BOL0002 ou BOL0003  |
| BOL0009 | Estender vencimento de um boleto               | Enviar extensão de prazo de um boleto | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/instrucoes/extensao)     | BOL0001, BOL0002 ou BOL0003   |
| BOL0010 | Incluir desconto em um boleto               | Incluir desconto em um boleto    | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/instrucoes/desconto)     | BOL0001, BOL0002 ou BOL0003   |
| BOL0011 | Incluir juros em um boleto                   | Incluir juros em um boleto       | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/instrucoes/juros)        | BOL0001, BOL0002 ou BOL0003   |
| BOL0012 | Incluir multa em um boleto                   | Incluir multa em um boleto       | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/instrucoes/multa)        | BOL0001, BOL0002 ou BOL0003   |
| BOL0013 | Realizar baixa de um boleto                   | Baixar um boleto                 | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/instrucoes/baixa)        | BOL0001, BOL0002 ou BOL0003   |
| BOL0014 | Consultar boletos por chave      | Consultar boletos por chave      | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/consulta/consulta_por_chave) | BOL0001, BOL0002 ou BOL0003   |
| BOL0015 | Listar Boletos          | Listar boletos     | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/consulta/listar_boletos) | BOL0001, BOL0002 ou BOL0003   |
| BOL0016 | Webhooks de Boleto      | Realizar a leitura de webhook para boleto | [Link Documentação](https://docs.qitech.com.br/documentation/boletos/v2/webhooks/boleto) | BOL0001, BOL0002 ou BOL0003   |

---

# Roadmap for Backoffice Development

URL: /en/documentation/roteiros_de_homologacao/roteiro_criacao_backoffice_cliente

# **QI Conta**

### Account

| Code | Step | Description | Documentation Link | Prerequisites |
| --- | --- | --- | --- | --- |
| QIC0001 | List accounts | List opened accounts | [Documentation Link](/documentation/contas/consultar_conta) |  QIC0003 or QIC0005  |
| QIC0002 | Query account data | Query data such as balance, account holder data, opening date, among others | [Documentation Link](/documentation/contas/consultar_conta) |  QIC0003 or QIC0005  |
| QIC0003 | PIX Limit | Search for PIX Limit request | [Documentation Link](/documentation/pix/busca_por_solicitacao_de_limite_pix)
| QIC0004 | Account closure | Closure of a specific account | [Documentation Link](/documentation/contas/encerramento_de_conta)

### Transactions

| Code | Step | Description | Link | Prerequisites |
| --- | --- | --- | --- | --- |
| QIC0005 | Statement Query | Perform statement query for an account | [Documentation Link](/documentation/movimentacao_de_contas/consulta_de_transacoes) |  QIC0003 or QIC0005  |
| QIC0006 | Transfer receipt request | Request a transfer receipt | [Documentation Link](/documentation/movimentacao_de_contas/comprovante_de_transferencia)|  |
| QIC0007 | Income statement | Income statement for a specific account | [Documentation Link](/documentation/contas/informe_rendimentos)
| QIC0008 | List TED Transfers | Check TED transactions for a specific account | [Documentation Link](/documentation/baas/ted/listar_teds) | 
| QIC0009 | List PIX Transfers | Check PIX transactions for a specific account | [Documentation Link](/documentation/baas/pix/listar_transferencias)

## Fee Management
| Code | Step | Description | Link | Prerequisites |
| --- | --- | --- | --- | --- |
| GTF0001* | Fee change request | Perform fee changes for an account | [Documentation Link](/documentation/contas/gestao_de_tarifas) |  QIC0003 or QIC0005  |
| GTF0002* | Fee query | Query registered fees for an account | [Documentation Link](/documentation/contas/consulta_de_tarifas) |  QIC0003 or QIC0005  |

## Bank Slip

| No.      | Step | Description | Link  | Prerequisites |
|---|---|---|---|---|
| BOL0004 | Standard Single Bank Slip Issuance        | Issue a standard single bank slip    | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_padrao)  | CAB0002 or CAB0003   |
| BOL0007 | Apply discount to bank slip amount | Apply discount to bank slip amount | [Documentation Link](/documentation/boletos/v2/instrucoes/abatimento/criar_abatimento) | BOL0001, BOL0002 or BOL0003 |
| BOL0008 | Cancel Discount     | Cancel discount on a bank slip | [Documentation Link](/documentation/boletos/v2/instrucoes/abatimento/cancelar_abatimento) | BOL0001, BOL0002 or BOL0003  |
| BOL0009 | Extend bank slip due date               | Send due date extension for a bank slip | [Documentation Link](/documentation/boletos/v2/instrucoes/extensao)     | BOL0001, BOL0002 or BOL0003   |
| BOL0010 | Include discount on a bank slip               | Include discount on a bank slip    | [Documentation Link](/documentation/boletos/v2/instrucoes/desconto)     | BOL0001, BOL0002 or BOL0003   |
| BOL0011 | Include interest on a bank slip                   | Include interest on a bank slip       | [Documentation Link](/documentation/boletos/v2/instrucoes/juros)        | BOL0001, BOL0002 or BOL0003   |
| BOL0012 | Include penalty on a bank slip                   | Include penalty on a bank slip       | [Documentation Link](/documentation/boletos/v2/instrucoes/multa)        | BOL0001, BOL0002 or BOL0003   |
| BOL0013 | Perform bank slip write-off                   | Write off a bank slip                 | [Documentation Link](/documentation/boletos/v2/instrucoes/baixa)        | BOL0001, BOL0002 or BOL0003   |
| BOL0014 | Query bank slips by key      | Query bank slips by key      | [Documentation Link](/documentation/boletos/v2/consulta/consulta_por_chave) | BOL0001, BOL0002 or BOL0003   |
| BOL0015 | List Bank Slips          | List bank slips     | [Documentation Link](/documentation/boletos/v2/consulta/listar_boletos) | BOL0001, BOL0002 or BOL0003   |
| BOL0016 | Collection portfolio query      | Query a collection portfolio | [Documentation Link](/documentation/boletos/v2/carteira/listar_carteiras/index.html) | BOL0001, BOL0002 or BOL0003   |
| BOL0017 | Request duplicate bank slip | Generate pdf with duplicate bank slip | [Documentation Link](/documentation/boletos/consultar_v1/segunda_via_de_boleto)
| BOL0018 | List settlements | Settlement listing will return all settlements from the settlement group sent in the request | [Documentation Link](/documentation/boletos/liquidacao/listar_liquidacoes)

---

# Certification Roadmap - BaaS Conta Payments

URL: /en/documentation/roteiros_de_homologacao/roteiro_payments

The certification roadmap describes all the resources and functionalities that need
to be tested by the integrating partner in QI Tech's sandbox environment (test environment), 
before entering the production environment of the product.

This roadmap describes all the resources and functionalities involved in the product.

⚠️ **All tests must be mandatorily performed in QI Tech's Sandbox environment (test environment).
The transactions performed in the Sandbox environment are fictitious financial transactions, serving only to test API functionality.**

## BaaS API Registration and Authentication
| Code  | Step | Description | Documentation Link | Prerequisite |
| --- | --- | --- | --- | --- |
| CAB0001* | Sandbox environment registration | Register on QI Tech's platform in the Sandbox environment (sandbox.qitech.app) | cs@qitech.com.br |
| CAB0002* | Token validation in Sandbox | Perform QI Token validation in Sandbox | [Documentation Link](https://docs.qitech.com.br/assets/pdfs/QI%20Tech%20Manual%20Inclus%C3%A3o%20de%20Token.pdf) | CAB0001 |
| CAB0003* | Public key exchange | Perform public key exchange within QI Tech's platform in sandbox (sandbox.qitech.app) | [Documentation Link](/documentation/primeiros_passos/troca_de_chaves) | CAB0001 and CAB0002 |
| CAB0004* | API call authentication test | Complete API call authentication test |[Documentation Link](/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_v2) <br/><br/> [Documentation Link](/documentation/primeiros_passos/teste_de_autenticacao/endpoints_de_teste) | CAB0003 |
| CAB0005* | Webhook configuration | Configure the URL for webhook sending by QI, through QI Tech's platform in sandbox (sandbox.qitech.app) | [Documentation Link](/documentation/primeiros_passos/configurando_webhooks) | CAB0001 and CAB0002 |

# **QI Conta**

## Account Opening

| Code | Step | Description | Documentation Link | Prerequisite |
| --- | --- | --- | --- | --- |
| QIC0002* | Individual account reservation | Request the reservation of an account whose holder is an individual | [Documentation Link](/documentation/baas/account/reservar_conta_pf) | CAB0005 and CAB0006 |
| QIC0003* | Individual account opening | Open an account whose holder is an individual | [Documentation Link](/documentation/baas/account/abrir_conta_pf) | CAB0005 and CAB0006 |
| QIC0004* | Corporate account reservation | Request the reservation of an account whose holder is a legal entity | [Documentation Link](/documentation/baas/account/reservar_conta_pj) | CAB0005 and CAB0006 |
| QIC0005* | Corporate account opening | Open an account whose holder is a legal entity | [Documentation Link](/documentation/baas/account/abrir_conta_pj) | CAB0005 and CAB0006 |
| QIC0006* | Account opening webhook reading | Correctly read account opening webhooks | Item 1.2. or 1.3:<br/>[Documentation Link](/documentation/baas/account/webhooks) |  QIC0003 or QIC0005  |
| QIC0007* | List accounts | List opened accounts| [Documentation Link](/documentation/contas/consultar_conta) |  QIC0003 or QIC0005  |
| QIC0008* | Account data query | Query data such as balance, holder data, opening date, among others | [Documentation Link](/documentation/contas/consultar_conta) |  QIC0003 or QIC0005  |

## Transactions

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| QIC0008* | Statement Query | Query an account's statement | [Documentation Link](/documentation/movimentacao_de_contas/consulta_de_transacoes) |  QIC0003 or QIC0005  |
| QIC0009* | Transfer receipt request | Request a transfer receipt | [Documentation Link](/documentation/movimentacao_de_contas/comprovante_de_transferencia)|  |
| QIC0010* | Transaction webhook reading | Successfully receive all transaction webhooks |  [Documentation Link](/documentation/movimentacao_de_contas/webhook_movimentacoes/index.html) |  QIC0003 or QIC0005  |
| QIC0011* | Financial institutions list query | Query the list of financial institutions enabled to receive TED and Pix |  [Documentation Link](/documentation/lista_de_instituicoes_financeiras/consulta_de_instituicoes_financeiras) |  QIC0003 or QIC0005  |

---

# Document Upload

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| UDD0001* | Document upload | Upload a document through our documents API |  [Documentation Link](/documentation/upload_de_documentos/) |  |

---

# TED

| Code | Step | Description | Link                                                                                                        | Prerequisite |
| --- | --- | --- |-------------------------------------------------------------------------------------------------------------| --- |
| TED0001* | TED Out transfer | Perform TED transfer  | [Documentation Link](/documentation/baas/ted/realizar_transferencia) | QIC0003 or QIC0005 |
| TED0002* | TED Out reversal simulation | Simulate the reversal of a TED Out sent from a QI Conta | Item 3: <br/>[Documentation Link](/documentation/movimentacao_de_contas/transacao) | TED0003 |
| TED0003* | TED In simulation | Simulate the entry of a TED In into a QI conta | Item 2: <br/>[Documentation Link](/documentation/movimentacao_de_contas/transacao) | QIC0003 or QIC0005 |
| TED0004* | List TED transactions| List incoming/outgoing TED transactions  | [Documentation Link](/documentation/baas/ted/listar_teds)  | QIC0003 or QIC0005 |
| TED0004* | TED transaction query| Query a TED transaction  | [Documentation Link](/documentation/baas/ted/consultar_ted)           | QIC0003 or QIC0005 |
| TED0006* | TED webhook reading| Successfully receive a TED webhook | [Documentation Link](/documentation/baas/ted/webhooks/index.html)| QIC0003 or QIC0005 |
---

# Internal Transfer

| No. | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| TFI0001 | Internal transfer with account debit | Execute a transfer from a QI Conta, with another QI Conta as the transfer destination | [Documentation Link](/documentation/baas/ted/realizar_transferencia) |  QIC0003 or QIC0005  |
| TFI0002 | Internal transfer simulation with account credit | Simulate the receipt of funds in the target QI Conta, having another QI Conta as origin | Item 1: <br/> [Documentation Link](/documentation/movimentacao_de_contas/transacao) |  QIC0003 or QIC0005  |

---

# Boletos

## Boleto Management

| No. | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| No.      | Step | Description | Link  | Prerequisite |
|---|---|---|---|---|
| BOL0001 | Single collection boleto registration    | Register a collection boleto | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_padrao/index.html) | CAB0002 or CAB0003   |
| BOL0002 | Single instant collection boleto registration | Register a collection boleto | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_instantanea) | CAB0002 or CAB0003   |
| BOL0003 | Batch boleto registration  | Register collection boletos in batch | [Documentation Link](/documentation/boletos/v2/emissao/emissao_em_lote) | CAB0002 or CAB0003   |
| BOL0004 | Standard Single Boleto Issuance        | Issue a standard single boleto    | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_padrao)  | CAB0002 or CAB0003   |
| BOL0005 | Instant Single Boleto Issuance   | Issue an instant single boleto | [Documentation Link](/documentation/boletos/v2/emissao/emissao_boleto_unico_instantanea) | CAB0002 or CAB0003   |
| BOL0006 | Batch Issuance   | Issue boletos in batch | [Documentation Link](/documentation/boletos/v2/emissao/emissao_em_lote)| CAB0002 or CAB0003   |
| BOL0007 | Create discount on boleto amount | Create discount on boleto amount | [Documentation Link](/documentation/boletos/v2/instrucoes/abatimento/criar_abatimento) | BOL0001, BOL0002 or BOL0003 |
| BOL0008 | Cancel Discount     | Cancel discount on a boleto | [Documentation Link](/documentation/boletos/v2/instrucoes/abatimento/cancelar_abatimento) | BOL0001, BOL0002 or BOL0003  |
| BOL0009 | Extend boleto due date               | Send due date extension for a boleto | [Documentation Link](/documentation/boletos/v2/instrucoes/extensao)     | BOL0001, BOL0002 or BOL0003   |
| BOL0010 | Include discount on a boleto               | Include discount on a boleto    | [Documentation Link](/documentation/boletos/v2/instrucoes/desconto)     | BOL0001, BOL0002 or BOL0003   |
| BOL0011 | Include interest on a boleto                   | Include interest on a boleto       | [Documentation Link](/documentation/boletos/v2/instrucoes/juros)        | BOL0001, BOL0002 or BOL0003   |
| BOL0012 | Include late fee on a boleto                   | Include late fee on a boleto       | [Documentation Link](/documentation/boletos/v2/instrucoes/multa)        | BOL0001, BOL0002 or BOL0003   |
| BOL0013 | Write off a boleto                   | Write off a boleto                 | [Documentation Link](/documentation/boletos/v2/instrucoes/baixa)        | BOL0001, BOL0002 or BOL0003   |
| BOL0014 | Query boletos by key      | Query boletos by key      | [Documentation Link](/documentation/boletos/v2/consulta/consulta_por_chave) | BOL0001, BOL0002 or BOL0003   |
| BOL0015 | List Boletos          | List boletos     | [Documentation Link](/documentation/boletos/v2/consulta/listar_boletos) | BOL0001, BOL0002 or BOL0003   |
| BOL0016 | Collection portfolio query      | Query a collection portfolio | [Documentation Link](/documentation/boletos/v2/carteira/listar_carteiras/index.html) | BOL0001, BOL0002 or BOL0003   |
| BOL0017 | Boleto Webhooks      | Read webhook for boleto | [Documentation Link](/documentation/boletos/v2/webhooks/boleto) | BOL0001, BOL0002 or BOL0003   |

## Boleto Payment

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| BOL0009* | Digitable line or Barcode query | Query a digitable line of a bank boleto | [Documentation Link](/documentation/baas/cobranca/consultar_boleto_bancario) |  |
| BOL0010* | Make a boleto payment | Make a bank boleto payment | [Documentation Link](/documentation/baas/cobranca/2fa_v2/solicitacao_de_pagamento_de_boleto_bancario) |  QIC0003 or QIC0005  |
| BOL0012* | Agreement boleto digitable line or Barcode query | Query a digitable line of an agreement boleto. | [Documentation Link](/documentation/baas/cobranca/consultar_fatura_de_recolhimento) |  |
| BOL0013* | Make an agreement boleto payment | Make an agreement boleto payment | [Documentation Link](/documentation/baas/cobranca/2fa_v2/solicitacao_de_pagamento_de_fatura_de_recolhimento) |  QIC0003 or QIC0005  |

---

## Pix

## Pix Transfer 
| Code  | Step | Description | Documentation Link | Prerequisite |
|---------|--|---|---|---|
| PIX0002* | Pix Out transfer | Perform a Pix transfer from a QI Conta using banking data (manual pix) or Pix key | [Documentation Link](/documentation/baas/pix/realizar_transferencia) | CAB0001 |
| PIX0035 | Pix transfer query | Retrieve transfer data | [Documentation Link](/documentation/baas/pix/consultar_transferencias) | PIX0002 |
| PIX0003* | Pix Out refund simulation | Simulate the refund of a Pix Out. | [Documentation Link - Item 2](/documentation/pix/simulacao)| PIX0002 |
| PIX0004* | Pix In simulation | Simulate the credit of a Pix In to a QI Conta. | [Documentation Link -> Item 1](/documentation/pix/simulacao)||
| PIX0037* | Pending transaction webhook reading | Successfully receive a pending transaction webhook | [Documentation Link](/documentation/baas/pix/webhooks) | PIX0002 |
| PIX0038* | Pix In webhook reading | Successfully receive an incoming Pix transfer webhook | [Documentation Link](/documentation/baas/pix/webhooks#webhook-para-pix-de-entrada)| PIX0004 |
| PIX0039 | Pix refund webhook reading | Successfully receive a Pix refund webhook | [Documentation Link](/documentation/baas/pix/webhooks#webhook-para-devolu%C3%A7%C3%B5es-de-pix) | PIX0003 |
| PIX0040 | Request refund of a received Pix | Request the refund of a received Pix | [Documentation Link](/documentation/baas/pix/solicitar_devolucao) | PIX0003 |
| PIX0041 | List account Pix transfers | List Pix transfers from an account | [Documentation Link](/documentation/baas/pix/listar_transferencias) | PIX0003 |

## Pix Key Management

### Pix Key Creation and Deletion

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PIX0008* | Pix key creation | Create Pix keys of type cpf, cnpj, random, email and phone | [Documentation Link](/documentation/pix/criar_chave) | 
| PIX0010* | List Pix keys of a QI Conta | List Pix keys linked to a QI Conta | [Documentation Link](/documentation/pix/listar_chaves_pix) | PIX0008 |

## Pix QR Code Management

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PIX0022* | Static Pix QR Code creation | Generate Static QR Code | [Documentation Link](/documentation/pix/criar_qr_code_estatico) | PIX0008 |
| PIX0023 | Dynamic Pix QR Code creation | Generate Dynamic QR Code with expiration (expiration day) and generate Instant Dynamic QR Code (with expiration in seconds). | [Documentation Link](/documentation/pix/criar_qr_code_dinamico) | PIX0008 |
| PIX0024 | Dynamic Pix QR Code deletion | Delete Pix QR Code | [Documentation Link](/documentation/pix/baixar_qr_code_dinamico) | PIX0023 |
| PIX0025 | List Dynamic Pix QR Codes | List Dynamic Pix QR Codes | [Documentation Link](/documentation/pix/pesquisar_por_qr_code_dinamico) | PIX0023 |
| PIX0026 | Instant Dynamic Pix QR Code expiration webhook reading | Successfully receive an Instant Dynamic Pix QR Code expiration webhook | [Documentation Link](/documentation/pix/webhook_por_qr_code_expirado) | PIX0023 |

## Pix QR Code Payment

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PIX0029* | Static Pix QR Code payment | Make payment of a Static Pix QR Code | [Documentation Link](/documentation/baas/pix/realizar_transferencia#transfer%C3%AAncia-por-qr-code-pix) | PIX0022 |
| PIX0030* | Dynamic Pix QR Code payment | Make payment of a Dynamic Pix QR Code |  [Documentation Link](/documentation/baas/pix/realizar_transferencia#transfer%C3%AAncia-por-qr-code-pix) | PIX0022 |
| PIX0027* | Pix QR Code decoding | Decode a Static, Dynamic with expiration and Instant Dynamic Pix QR Code | [Documentation Link](/documentation/pix/decodificar_qr_code) | PIX0022 and PIX0023 |

## Pix Limit Management

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PIX0032* | Pix limit change request | Request Pix limit change for a QI Conte | [Documentation Link](/documentation/pix/solicitar_alteracao_de_limite_pix) |  QIC0003 or QIC0005  |
| PIX0033 | List Pix limit change requests | List Pix limit change requests for a QI Conta | [Documentation Link](/documentation/pix/busca_por_solicitacao_de_limite_pix) | PIX0032 |
| PIX0034* | Used Pix limit query | Query the used Pix limit for a QI Conta | [Documentation Link](/documentation/pix/busca_por_uso_de_limite_pix) |  QIC0003 or QIC0005  |

---

# Fee Management
| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| GTF0001* | Fee change request | Request fee changes for an account| [Documentation Link](/documentation/contas/gestao_de_tarifas) |  QIC0003 or QIC0005  |
| GTF0002* | Fee query  | Query fees registered on an account | [Documentation Link](/documentation/contas/consulta_de_tarifas) |  QIC0003 or QIC0005  |

---

# Roteiro de Homologação - Pix Conta Integrada

URL: /en/documentation/roteiros_de_homologacao/roteiro_pix_conta_integrada

O roteiro de homolgoação descreve todos os recursos e funcionalidades que precisam
ser testados pelo parceiro integrador no ambiente de sandbox da QI Tech (ambiente de testes), 
antes da entrada em ambiente de produção do produto.

Este roteiro descreve todos os recursos e funcionalidades envolvidos no produto. 

`*: etapas obrigatórias para entrada em produção`

## Cadastro e Autenticação API BaaS
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
|---------|--|---|---|---|
| CAB0001* | Cadastro no ambiente de Sandbox | Realizar o cadastro na plataforma da QI Tech no ambiente de Sandbox (sandbox.qitech.app) | [Link documentação](https://docs.qitech.com.br/documentation/primeiros_passos/inicio) 
| CAB0002* | Validação de token em Sandbox | Realizar a validação do QI Token em Sandbox | [Manual de Inclusão do Token](https://docs.qitech.com.br/assets/pdfs/QI%20Tech%20Manual%20Inclus%C3%A3o%20de%20Token.pdf) | CAB0001 |
| CAB0003* | Troca de chaves públicas | Realizar a troca de chaves públicas dentro da plataforma da QI Tech em sandbox (sandbox.qitech.app) | [Troca de chaves](https://docs.qitech.com.br/documentation/primeiros_passos/troca_de_chaves) | CAB0001 e CAB0002 |
| CAB0004* | Teste de autenticação de chamadas | Finalizar teste de autenticação de chamadas | [Teste de Autenticação](https://docs.qitech.com.br/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_v2) <br/><br/> [Endpoints de teste da autenticação](https://docs.qitech.com.br/documentation/primeiros_passos/teste_de_autenticacao/endpoints_de_teste) | CAB0003 |
| CAB0005* | Configuração de webhooks | Realizar a configuração da url para envio dos webhooks por parte da QI, através da plataforma da QI Tech em sandbox (sandbox.qitech.app) | [Configuração de webhooks](https://docs.qitech.com.br/documentation/primeiros_passos/configurando_webhooks) | CAB0001 e CAB0002 |

## QI Conta
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
|---------|--|---|---|---|
| QIC0005 | Consulta de dados de uma conta | Recuperar os dados de uma QI Conta com sucesso | [Consultar Conta](https://docs.qitech.com.br/documentation/contas/consultar_conta) ||

## Transferência Pix 
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
|---------|--|---|---|---|
| PIX0002* | Transferência Pix Out | Realizar uma transferência Pix a partir de uma QI Conta utilizando dados bancários (pix manual) ou chave Pix | [Realização de Transação Pix](https://docs.qitech.com.br/documentation/baas/pix/realizar_transferencia)||
| PIX0035 | Consulta de transferência pix | Recuperar os dados de uma transferência | [Consulta de transferência Pix](https://docs.qitech.com.br/documentation/baas/pix/consultar_transferencias) | PIX0002 |
| PIX0003* | Simulação de reembolso de Pix Out | Simular o reembolso de um Pix Out. | [Simulação reembolso Pix Out -> Item 2](https://docs.qitech.com.br/documentation/pix/simulacao)| PIX0002 |
| PIX0004* | Simulação de Pix In | Simular o crédito de um Pix In em uma QI Conta. | [Simulação Pix In -> Item 1](https://docs.qitech.com.br/documentation/pix/simulacao)||
| PIX0005* | Reembolso de Pix In | Realizar o reembolso de um Pix In a partir de uma QI Conta. | [Reembolso Pix In](https://docs.qitech.com.br/documentation/baas/pix/solicitar_devolucao)| PIX0004 |
| PIX0037* | Leitura de webhook de transação pendente | Recepcionar com sucesso um webhook de transação pendente | [Webhook de transação pendente](https://docs.qitech.com.br/documentation/baas/pix/webhooks#webhook-para-transa%C3%A7%C3%B5es-pendentes) | PIX0002 |
| PIX0038* | Leitura de webhook de Pix de In | Recepcionar com sucesso um webhook de transferência Pix de entrada | [Webhook Pix In](https://docs.qitech.com.br/documentation/baas/pix/webhooks#webhook-para-pix-de-entrada) | PIX0004 |
| PIX0039 | Leitura de webhook de Devolução Pix | Recepcionar com sucesso um webhook de devolução de um Pix | [Webhook Devolução Pix](https://docs.qitech.com.br/documentation/baas/pix/webhooks#webhook-para-devolu%C3%A7%C3%B5es-de-pix) | PIX0003 |

## Movimentações
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
|---------|--|---|---|---|
| QIC0008* | Consulta de Transações | Realizar a consulta das transações de uma conta | [Consulta de Transações](https://docs.qitech.com.br/documentation/movimentacao_de_contas/consulta_de_transacoes) ||
| QIC0009 | Solicitação de comprovante de transferência | Solicitação de comprovante de transferência | [Solicitar comprovante de transferência](https://docs.qitech.com.br/documentation/movimentacao_de_contas/comprovante_de_transferencia) | PIX0002 |
| QIC0010* | Leitura de webhooks de transação | Recepcionar com sucesso todos os webhooks de transação | [Webhook account_transaction](https://docs.qitech.com.br/documentation/movimentacao_de_contas/webhook_movimentacoes) | CAB0005 e PIX0002 |
| QIC0011 | Consulta de lista de instituições financeiras | Consultar lista de instituições financeiras habiliatadas para recebimento de TED e Pix | [Consulta de Instituições Financeiras](https://docs.qitech.com.br/documentation/lista_de_instituicoes_financeiras/consulta_de_instituicoes_financeiras) ||

## Consulta de Chave Pix
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
|---------|--|---|---|---|
| PIX0036* | Consulta de dados de uma chave Pix | Realizar com sucesso a consulta de uma chave Pix no Bacen. | [Consulta de chave Pix](https://docs.qitech.com.br/documentation/baas/pix/consultar_chave_pix) ||

## Decodificar QR Code Pix
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
|---------|--|---|---|---|
| PIX0027* | Decodificação de QR Code Pix | Consultar os dados de um QR Code Pix (decodificar) utilizando a url do pix copia e cola | [Decodificação de QR Code Pix](https://docs.qitech.com.br/documentation/pix/decodificar_qr_code)||

---

# Roteiro de Homologação - Pix indireto

URL: /en/documentation/roteiros_de_homologacao/roteiro_pix_indireto

O roteiro de homologação descreve todos os recursos e funcionalidades que precisam
ser testadas pelo parceiro integrador no ambiente de sandbox da QI Tech (ambiente de testes), 
antes da entrada em ambiente de produção.

Este roteiro descreve todos os recursos e funcionalidades envolvidas no produto. 

## Cadastro e Autenticação API BaaS
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
|---------|--|---|---|---|
| CAB0001 | Cadastro no ambiente de Sandbox | Realizar o cadastro na plataforma da QI Tech no ambiente de Sandbox (sandbox.qitech.app) | [Link documentação](https://docs.qitech.com.br/documentation/primeiros_passos/inicio) 
| CAB0002 | Validação de token em Sandbox | Realizar a validação do QI Token em Sandbox | [Link documentação](https://docs.qitech.com.br/assets/pdfs/QI%20Tech%20Manual%20Inclus%C3%A3o%20de%20Token.pdf) | CAB0001 |
| CAB0003 | Troca de chaves públicas | Realizar a troca de chaves públicas dentro da plataforma da QI Tech em sandbox (sandbox.qitech.app) | [Link documentação](https://docs.qitech.com.br/documentation/primeiros_passos/troca_de_chaves) | CAB0001 e CAB0002 |
| CAB0004 | Teste de autenticação de chamadas | Finalizar teste de autenticação de chamadas | [Teste de Autenticação](https://docs.qitech.com.br/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_v2) <br/><br/> [Link documentação](https://docs.qitech.com.br/documentation/primeiros_passos/teste_de_autenticacao/endpoints_de_teste) | CAB0003 |
| CAB0005 | Configuração de webhooks | Realizar a configuração da url para envio dos webhooks por parte da QI, através da plataforma da QI Tech em sandbox (sandbox.qitech.app) | [Link documentação](https://docs.qitech.com.br/documentation/primeiros_passos/configurando_webhooks) | CAB0001 e CAB0002 |

## QI Conta
### Contas 
| Código  | Etapa | Descrição | Link Documentação                                                                                           | Pré-requisito |
|---------|--|---|-------------------------------------------------------------------------------------------------------------|---------------|
| QCI0012 | Abertura de conta de titularidade do participante indireto | Realizar a abertura de 4 contas de titularidade do participante indireto | [Link documentação](https://docs.qitech.com.br/documentation/contas/abertura_de_conta/abertura_de_conta_pj) | CAB0004 e CAB0005 |
| QIC0005 | Consulta de dados de uma conta | Recuperar os dados de uma conta previamente aberta pelo participante | [Link documentação](https://docs.qitech.com.br/documentation/contas/consultar_contas)                          |        QCI0012       |
| QIC0006 | Encerramento de uma conta | Encerrar uma conta de titularidade do participante indireto | [Link documentação](https://docs.qitech.com.br/documentation/contas/encerramento_de_conta)                          |        QCI0012       |

## Alias 
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
|---------|--|---|---|---|
| QCA0014 | Criação de alias de pessoa jurídica para conta de titularidade do participante indireto| Realizar a criação de 2 alias de uma ou mais pessoas jurídicas para uma conta de titularidade do participante indireto | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/gerenciamento_de_alias/criação_de_alias)|QCI0012|
| QCA0015 | Criação de alias de pessoa física para conta de titularidade do participante indireto | Realizar a criação de 2 alias de uma ou mais pessoas físicas para uma conta de titularidade do participante indireto | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/gerenciamento_de_alias/criação_de_alias) | QCI0012 |
| QCA0016 | Consulta de dados de um alias | Consulta os dados de um alias vinculado a uma conta de titularidade do participante indireto | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/gerenciamento_de_alias/consultar_alias)| QCA0014 ou QCA0015 |
| QCA0017 | Deleção de alias | Realizar a deleção de um alias vinculado a uma conta de titularidade do participante indireto | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/gerenciamento_de_alias/deletar_alias)|QCA0014 ou QCA0015|
| QCA0018 | Listagem de alias vinculados a uma QI Conta | Realizar a deleção de um alias vinculado a uma conta de titularidade do participante indireto | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/gerenciamento_de_alias/listagem_de_alias)| QCA0014 ou QCA0015 |

## Movimentações
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito                                                       |
|---------|--|---|---|---------------------------------------------------------------------|
| QIC0008 | Consulta de Extrato| Realizar a consulta do extrato de uma conta | [Link documentação](https://docs.qitech.com.br/documentation/movimentacao_de_contas/consulta_de_transacoes) | QCI0012 |
| QIC0009 | Solicitação de comprovante de transferência | Solicitação de comprovante de transferência | [Link documentação](https://docs.qitech.com.br/documentation/movimentacao_de_contas/comprovante_de_transferencia) | PXI0002, ou PXI0003, ou PXI0009, ou PXI0010, ou PXI0004, ou PXI0005 |
| QIC0010 | Leitura de webhooks de transação | Recepcionar com sucesso todos os webhooks de transação | [Link documentação](https://docs.qitech.com.br/documentation/movimentacao_de_contas/webhook_movimentacoes/index.html) | PXI0002, ou PXI0003, ou PXI0009, ou PXI0010, ou PXI0004, ou PXI0005 |
| QIC0011 | Consulta de lista de instituições financeiras | Consultar lista de instituições financeiras habiliatadas para recebimento de TED e Pix | [Link documentação](https://docs.qitech.com.br/documentation/lista_de_instituicoes_financeiras/consulta_de_instituicoes_financeiras) |                                                                     |

## Pix indireto
### Transferência Pix Out
| Código   | Etapa                                            | Descrição | Link Documentação | Pré-requisito                               |
|----------|--------------------------------------------------|---|---|---------------------------------------------|
| PXI0002  | Transferência Pix Out via Chave Pix - Síncrona	  | Realizar uma transferência Pix a partir de uma QI Conta utilizando dados bancários utilizando uma chave Pix, com fluxo síncrono de resposta da API | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/transacao/transacao_pix_chave_sync) | QCA0014 ou QCA0015                          |
| PXI0003  | Transferência Pix Out Manual - Síncrona	         | Realizar uma transferência Pix a partir de uma QI Conta utilizando dados bancários (pix manual), com fluxo síncrono de resposta da API | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/transacao/transacao_pix_manual_sync) | QCA0014 ou QCA0015                          |
| PXI0009  | Transferência Pix Out via Chave Pix - Assíncrona	 | Realizar uma transferência Pix a partir de uma QI Conta utilizando dados bancários utilizando uma chave Pix, com fluxo assíncrono de resposta da API | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/transacao_async/transação_pix_normal) | QCA0014 ou QCA0015                          |
| PXI0010  | Transferência Pix Out Manual - Assíncrona        | Realizar uma transferência Pix a partir de uma QI Conta utilizando dados bancários (pix manual), com fluxo assíncrono de resposta da API | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/transacao_async/transação_pix_manual) | QCA0014 ou QCA0015                          |
| PXI0004  | Simulação de reembolso de Pix Out                | Simular o reembolso de um Pix Out | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/simulacao#3---simulação-de-devolução-de-pix) | PXI0002, ou PXI0003, ou PXI0009, ou PXI0010 |
| PXI0005  | Simulação de Pix In                              | Simular o crédito de um Pix In em uma QI Conta. | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/simulacao#3---simulação-de-devolução-de-pix) | QCA0014 ou QCA0015                          |
| PXI0006  | Reembolso de Pix In                              | Realizar o reembolso de um Pix In a partir de uma QI Conta | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/devolucao_pix) | PXI0005                                     |
| PXI0007  | Simulação de Pix Out rejeitado                   | Realizar um pix out utilizando as chaves mockadas informadas na documentação da QI Tech para simular o cenário de um pix rejeitado. | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/simulacao/index.html#5---simulação-de-transação-rejeitada) |                                             |
| PXI0008  | Simulação de Pix Out pendente                    | Realizar um pix out utilizando as chaves mockadas informadas na documentação da QI Tech para simular o cenário de um pix pendente. | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/simulacao#4---simulação-de-transação-em-estado-pendente-de-confirmação) | PXI0003, ou PXI0010                         |

### Transferência Pix Interna
| Código   | Etapa                              | Descrição | Link Documentação | Pré-requisito                               |
|----------|------------------------------------|---|---|---------------------------------------------|
| PXI0012  | Transferência Pix Interna entre 2 alias via chave Pix - Síncrona	 | Realizar uma transferência Pix a partir de uma QI Conta utilizando uma chave Pix, com fluxo síncrono de resposta da API | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/transacao/transacao_pix_chave_sync) | QCA0014 ou QCA0015                          |
| PXI0013  | Transferência Pix Interna entre 2 alias via Manual - Síncrona | Realizar uma transferência Pix a partir de uma QI Conta utilizando dados bancários (pix manual), com fluxo síncrono de resposta da API| [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/transacao/transacao_pix_manual_sync) | QCA0014 ou QCA0015                          |
| PXI0015  | Transferência Pix Interna entre 2 alias via chave Pix - Assíncrona	 | Realizar uma transferência Pix a partir de uma QI Conta utilizando uma chave Pix, com fluxo assíncrono de resposta da API | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/transacao_async/transação_pix_normal) | QCA0014 ou QCA0015                          |
| PXI0016  | Transferência Pix Interna entre 2 alias via Manual - Assíncrona | Realizar uma transferência Pix a partir de uma QI Conta dados bancários (pix manual), com fluxo assíncrono de resposta da API | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/transacao_async/transação_pix_manual) | QCA0014 ou QCA0015                          |
| PXI0014  | Devolução de Pix Interno  | Realizar a devolução de um Pix Interno a partir de uma QI Conta | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/simulacao#3---simulação-de-devolução-de-pix) | PXI0012, ou PXI0013, ou PXI0015, ou PXI0016 |

### Consulta de Transferência Pix
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito                                                                                           |
|---------|--|---|---|---------------------------------------------------------------------------------------------------------|
| PXI0017 | Consulta transferência Pix | Recuperar os dados de uma transaferência Pix | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/consultar_pix)| PXI0002, ou PXI0003, ou PXI0009, ou PXI0010, ou PXI0005, ou PXI0012, ou PXI0013, ou PXI0015, ou PXI0016 |

### Movimentações Pix
| Código   | Etapa                              | Descrição | Link Documentação | Pré-requisito                               |
|----------|------------------------------------|---|---|---------------------------------------------|
| PXI0018  | Leitura de webhook de pix in	 | Realizar com sucesso, a leitura de um webhook de um Pix In. O webhook é gerado a partir da simulação de um Pix In| [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/webhook/webhook_incoming_pix) | PXI0005                         |
| PXI0019  | Leitura de webhook de pix interno | Realizar com sucesso, a leitura de um webhook de um pix interno. O webhook é gerado após realizar um Pix Interno| [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/webhook/webhook_incoming_pix) | PXI0012, ou PXI0013, ou PXI0015, ou PXI0016                          |
| PXI0020  | Leitura de webhook de transação pix pendente	 | Realizar com sucesso, a leitura de um webhook de uma transação pix pendente. O webhook é gerado a partir da simulação de uma transação Pix Pendente. | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/webhook/webhook_transacao) | PXI0008                         |
| PXI0021  |Leitura de webhook de reembolso de um pix out | Realizar com sucesso, a leitura de um webhook de reembolso de um pix out. O webhook é gerado a partir da simulação de um reembolso de um pix out | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/webhook/webhook_devolução_outgoing_pix) | PXI0004                          |

## Gestão de chave pix

### Criação e Exclusão de chave pix
| Código   | Etapa                                          | Descrição | Link Documentação | Pré-requisito |
|----------|------------------------------------------------|---|---|--------|
| PXI0022  | Criação de chave Pix aleatória **pessoa física**	  | Realizar a criação de **5** chaves aleatórios em um alias de pessoa física| [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/chaves_pix/criação_de_chaves) | QCA0014 ou QCA0015 |
| PXI0023  | Criação de chave Pix aleatória **pessoa jurídica** | Realizar a criação de **20** chaves aleatórios em um alias de pessoa jurídica| [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/chaves_pix/criação_de_chaves) | QCA0014 ou QCA0015 |
| PXI0024  | Exclusão de chave Pix **pessoa física**        | Realizar a exclusão de uma chave Pix de uma pessoa física | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/chaves_pix/deletar_chaves) | PXI0022 |
| PXI0025  | Exclusão de chave Pix **pessoa jurídica**          | Realizar a exclusão de uma chave Pix de uma pessoa jurídica| [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/chaves_pix/deletar_chaves) | PXI0025|
| PXI0026  | Listagem de chaves Pix de um alias | Listar chaves Pix vinculadas a um alias | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/chaves_pix/listar_chaves) | PXI0022, ou PXI0023 |

## Gestão de QR Code Pix
| Código   | Etapa                                                 | Descrição                                                                         | Link Documentação                                                                                                     | Pré-requisito       |
|----------|-------------------------------------------------------|-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|---------------------|
| PXI0027  | Introdução QR Code pix	                               | Introdução QR Code pix                                                            | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/qr_code/introducao_qr_code) | PXI0022, ou PXI0023 |
| PXI0027  | Criação de QR Code Pix Estático	                      | Gerar QR Code Estático                                                            | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/qr_code/Criar%20QR%20Code/criar_qr_code_estatico) | PXI0022, ou PXI0023 |
| PXI0028  | Criação de QR Code Pix Dinâmico com vencimento        | Gerar QR Code Dinâmico com vencimento                                             | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/qr_code/Criar%20QR%20Code/criar_qr_code_dinamico_com_vencimento) | PXI0022, ou PXI0023 |
| PXI0029  | Criação de QR Code Pix Dinâmico de pagamento imediato | Criar QR Code Pix Dinâmico pagamento imediato                                     | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/qr_code/Criar%20QR%20Code/criar_qr_code_dinamico_imediato) | PXI0028  |
| PXI0029  | Desativar de QR Code Pix Dinâmico                     | Desativar de QR Code Pix Dinâmico                                                            | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/qr_code/desativar_qr_code) | PXI0028  |
| PXI0030  | Listar QR Codes de um alias                           | Listar QR Codes de um alias                                                      | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/qr_code/listar_alias_qr_codes) | PXI0029  |
| PXI0030  | Consultar um QR Code Pix                              | Consultar um QR Code Pix                                                       | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/qr_code/consultar_qr_code) |   |
| PXI0031  | Webhook para Pix de Entrada de pagamento de QR Code   | Webhook para Pix de Entrada de pagamento de QR Code | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/qr_code/webhook_incoming_pix) | PXI0028 |
| PXI0032  | Decodificação de QR Code Pix                          | Decodificar um QR Code Pix Estático, Dinâmico com vencimento e Dinâmico Instantâneo | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/qr_code/decodificar_qr_code)                                 |   |

## Pagamento de QR code Pix
| Código   | Etapa                                          | Descrição                                                                            | Link Documentação                                                                                                     | Pré-requisito       |
|----------|------------------------------------------------|--------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|---------------------|
| PXI0033  | Pagamento de QR Code Pix Estático - Síncrono	  | Realizar o pagamento de um QR Code Pix Estático, com fluxo síncrono de resposta da API   | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/transacao/transacao_pix_qr_code_sync) | PXI0032 |
| PXI0028  | Pagamento de QR Code Pix Dinâmico - Síncrono	  | Realizar o pagamento de um QR Code Pix Dinâmico, com fluxo síncrono de resposta da API     | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/transacao/transacao_pix_qr_code_sync) | PXI0032 |
| PXI0035  | Pagamento de QR Code Pix Estático - Assíncrono  | Realizar o pagamento de um QR Code Pix Estático, com fluxo assíncrono de resposta da API    | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/transacao_async/transação_pix_qr_code) | PXI0032  |
| PXI0036  | Pagamento de QR Code Pix Dinâmico - Assíncrono  | Realizar o pagamento de um QR Code Pix Dinâmico, com fluxo assíncrono de resposta da API     | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/transacao_async/transação_pix_qr_code) | PXI0032  |

## Relato de Infração
| Código   | Etapa                                          | Descrição                                                                            | Link Documentação                                                                                                    | Pré-requisito                               |
|----------|------------------------------------------------|--------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|---------------------------------------------|
| PXI0037  | Relato de Infração (outgoing) de um Pix Out	  | Abrir um relato de infração para um Pix Out  | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/relato_de_infracao/criar_relato_infracao) | PXI0002, ou PXI0003, ou PXI0009, ou PXI0010 |
| PXI0038  | Relato de infração (outgoing) de um Pix In  | Abrir um relato de infração  para um Pix In     | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/relato_de_infracao/criar_relato_infracao) | PXI0005                                     |
| PXI0039  | Leitura de webhook de atualização de status de Relato de Infração (incoming e outgoing)  | Recepcionar com sucesso o webhook de atualização de status de um relato de infração anteriormente aberto pelo participante  | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/relato_de_infracao/webhooks_relato_infracao) | PXI0037, ou  PXI0038                        |
| PXI0040  | Consulta de Relato de Infração (incoming e outgoing)  | Recuperar os dados de um relato de infração para um Pix Out/In aberto pelo participante     | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/relato_de_infracao/consultar_relato_infracao) | PXI0037, ou  PXI0038                        |
| PXI0041  | Cancelamento de Relato de Infração (outgoing)	  | Cancelar um relato de infração anteriormente aberto pelo participante   | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/relato_de_infracao/cancelar_relato_infracao) | PXI0037, ou  PXI0038                        |
| PXI0042  | Simulação de resposta de aceite de Relato de Infração (outgoing)	  | Simular a resposta com aceite da contraparte para um relato de infração criado pelo participante (analysis_result=agreed)     | Contatar time técnico da QI para simulação deste cenário | PXI0037, ou  PXI0038                        |
| PXI0043  | Simulação de resposta de rejeição de Relato de Infração (outgoing)  | Simular a resposta com rejeição da contraparte para um relato de infração criado pelo participante (analysis_result=disagreed)  | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/relato_de_infracao/webhooks_relato_infracao) | PXI0037, ou  PXI0038                        |
| PXI0044  | Simulação de recebimento de um Relato de Infração (incoming) | Simular o recebimento de um relato de infração criado por outro PSP para um Pix In recebido pelo participante    | Contatar time técnico da QI para simulação deste cenário | PXI0005                                     |
| PXI0045  | Aceite de Relato de Infração (incoming)  | Fechar um Relato de Infração (incoming) informando o aceite do relato recebido.  | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/relato_de_infracao/fechar_relato_infracao) | PXI0044                                     |
| PXI0046  | Rejeição de Relato de Infração (incoming)	  | Fechar um Relato de Infração (incoming) informando a rejeição do Relato de Infração recebido.    | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/relato_de_infracao/fechar_relato_infracao) | PXI0044                                     |
| PXI0047  | Listagem de Relatos de Infração (incoming e outgoing) | Listar Relatos de Infração (incoming e outgoing) recebidos ou criados pelo participante | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/devolucao/listar_solicitacoes) | PXI0037, ou PXI0038, ou PXI0044             |

## Solicitação de Devolução
| Código   | Etapa                                                                   | Descrição                                                                                                                                           | Link Documentação                                                                               | Pré-requisito                               |
|----------|-------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|---------------------------------------------|
| PXI0048  | Solicitação de devolução por relato de infração                         | Abrir uma solictação de dovolução para um Relato de Infração (outgoing) aceito pela contraparte (PSP recebedor).                                   | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/devolucao/criar_devolucao) | PXI0042                                     |
| PXI0049  |Solicitação de devolução por erro operacional                            | Abrir uma solictação de dovolução para um Relato de Infração (outgoing) aceito pela contraparte (PSP recebedor).                                    | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/devolucao/criar_devolucao) | PXI0002, ou PXI0003, ou PXI0009, ou PXI0010 |
| PXI0050  |Consulta de Solicitação de Devolução (incoming e outgoing)               | Recuperar os dados de uma solicitação de devolução aberto pelo participante                          | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/devolucao/consultar_devolucao) | PXI0048, ou PXI0049                         |
| PXI0051  | Cancelamento de Solicitação de Devolução                                | Cancelar uma solicitação de devolução anteriormente aberto pelo participante                                                           | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/devolucao/cancelar_devolucao) | PXI0048, ou PXI0049                         |
| PXI0052  | Simulação de aceite de uma Solicitação de Devolução por relato de infração	 | Simular o aceite de uma solicitação de devolução por relato de infração aberta pelo participante.                                                                            | Contatar time técnico da QI para simulação deste cenário                                        | PXI0048                                     |
| PXI0053  | Simulação de aceite de uma Solicitação de Devolução por erro operacional | Simular o aceite de uma solicitação de devolução por erro operacional aberta pelo participante.                         | Contatar time técnico da QI para simulação deste cenário                                        | PXI0049                                     |
| PXI0054  | Simulação de rejeição de uma Solicitação de Devolução por relato de infração | Simular a rejeição de uma solicitação de devolução por relato de infração aberta pelo participante.                    | Contatar time técnico da QI para simulação deste cenário                                        | PXI0048                                     |
| PXI0055  | Simulação de rejeição de uma Solicitação de Devolução por erro operacional | Simular a rejeição de uma solicitação de devolução por erro operacional aberta pelo participante.                                      | Contatar time técnico da QI para simulação deste cenário                                        | PXI0049                                     |
| PXI0056  | Leitura de webhook de atualização de status da solicitação de devolução | Recepcionar com sucesso o webhooks de atualização de status da solicitação de devolução                                                                     | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/devolucao/webhooks_devolucao) | PXI0048, ou PXI0049                         |
| PXI0057  | Listagem de Solicitações de Devolução	                                  | Listar solicitações de devolução recebidos ou criados pelo participante                                                       | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/devolucao/listar_solicitacoes) | PXI0048, ou PXI0049, ou PXI0058             |
| PXI0058  | Simulação de recebimento de uma Solicitação de Devolução por relato de infração | Simular o recebimento de uma solicitação de devolução por relato de infração                                                                        | Contatar time técnico da QI para simulação deste cenário                      | PXI0038, ou PXI0044                         |
| PXI0059  | Simulação de recebimento de uma Solicitação de Devolução por erro operacional | Simular o recebimento de uma solicitação de devolução por erro operacional                                                                          | Contatar time técnico da QI para simulação deste cenário                     | PXI0005                                     |
| PXI0060  | Reembolso de Pix In de uma Solicitação de Devolução recebida            | Realizar o reembolso de uma Pix In informado na Solicitação de Devolução recebida pelo participante                                                 | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/movimentacoes/devolucao_pix) | PXI0058, ou PXI0059                         |
| PXI0061  | Fechar Solicitação de Devolução	                                        | Fechar uma Solicitação de Devolução, informando a pix_transfer_key do Reembolso Pix realizado em resposta a esta Solicitação de Devolução recebida. | [Link documentação](https://docs.qitech.com.br/documentation/pix_indireto/devolucao/fechar_devolucao) | PXI0060                                     |

## Gestão de Tarifas
| Código   | Etapa                                          | Descrição                                                                            | Link Documentação                                                                                                     | Pré-requisito       |
|----------|------------------------------------------------|--------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|---------------------|
| GDT0001  | Alteração de configuração de tarifas de uma QI Conta  | Alterar a configuração de tarifas de uma QI Conta   | [Link documentação](https://docs.qitech.com.br/documentation/contas/gestao_de_tarifas) | QCI0012 |

---

# Roteiro de Homologação - Emissão de dívida PF com desembolso pagando QR Code

URL: /en/documentation/roteiros_laas/roteiro_00f2a5d3-39c2-4f3d-9234-7d1525daaaf2

`*: etapas obrigatórias para entrada em produção`

## 1 - Cadastro e Autenticação APIs LaaS
| Código  | Etapa | Descrição | Link Documentação | Pré-requisito |
|---------|--|---|---|---|
| CAB0001* | Cadastro no ambiente de Sandbox | Realizar o cadastro na plataforma da QI Tech no ambiente de Sandbox (sandbox.qitech.app) | https://sandbox.qitech.com.br/register| |
| CAB0002* | Validação de token em Sandbox | Realizar a validação do QI Token em Sandbox | [Download Manual de Inclusão do Token](https://docs.qitech.com.br/assets/pdfs/QI%20Tech%20Manual%20Inclus%C3%A3o%20de%20Token.pdf) | CAB0001 |
| CAB0003* | Troca de chaves públicas | Realizar a troca de chaves públicas dentro da plataforma da QI Tech em sandbox (sandbox.qitech.app) | [Link Documentação](/documentation/primeiros_passos/troca_de_chaves) | CAB0001 e CAB0002 |
| CAB0004* | Teste de autenticação de chamadas | Finalizar teste de autenticação de chamadas | [Passo a Passo](/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_v2) <br/><br/> [Link Documentação](/documentation/primeiros_passos/teste_de_autenticacao/endpoints_de_teste) | CAB0003 |
| CAB0005* | Configuração de webhooks | Realizar a configuração da url para envio dos webhooks por parte da QI, através da plataforma da QI Tech em sandbox (sandbox.qitech.app) | [Link Documentação](/documentation/primeiros_passos/configurando_webhooks) | CAB0001 e CAB0002 |

## 2- Simulação da dívida

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| SID0001* | Simulação de dívida| Simulação das condições da dívida, utilizando variáveis previamente determinadas| [Link Documentação](/documentation/emissao_de_divida/simulacao_de_divida_novo) | **Item 1** |

## 3 - Emissão de dívida (PF)

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| EMD0001* | Emissão de dívida PF | Emissão da CCB PF. Formada por quatro objetos principais: dados cadastrais do devedor (objeto borrower), dados financeiros da operação (objeto financial), dados para desembolso via QR Code Pix e indicação do cessionário (purchaser_document_number)| [Link Documentação](/documentation/emissao_de_divida/emissao/emissao_de_divida_pf) | **Itens 1 e 2**  |
| EMD0002* | Implementação de dados adicionais | Dados para preenchimento da CCB gerada| Payload alinhado em paralelo | Obrigatório, se definido a utilização.  |

## 4 - Formalização de dívida 

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| FOR0001 | Formalização da dívida  | A assinatura da CCB será realizada via Opt-In após a emissão da dívida| -- |  **Item 3** |
| FOR0002* | Leitura do webhook de assinatura finalizada | Leitura da resposta assíncrona da formalização da operação. Webhook status signature_finished| [Link Documentação](/documentation/webhooks/dividas) | FOR0001 |

## 5 - Desembolso da dívida

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| DES0001* | Escolha da data de desembolso | Após o cumprimento de todos os requisitos para pagamento da operação (envio de documentos, assinatura e averbação), deve-se obrigatoriamente escolher uma data de desembolso para que a operação seja paga, dentro do range de desembolso.| [Link Documentação](/documentation/emissao_de_divida/reprocessar_multiplas_datas/trocar_data) |  **Item 4** |
| DES0002* | Autorização de desembolso | Flag de liberação do pagamento, impede que uma operação seja desembolsada ser estar previamente autorizada| [Link Documentação](/documentation/emissao_de_divida/autorizar_desembolso) |  DES0001 |
| DES0003* | Leitura do webhook de desembolso da operação | Leitura da resposta assíncrona que indica o sucesso no pagamento da operação. Webhook status: disbursed. Aqui teremos o comprovante de pagamento em PDF. Além do retorno das chaves identificadoras das parcelas e seus respectivos boletos| [Link Documentação](/documentation/webhooks/dividas) |  DES0001 e DES0002 |

## 6 -  Cancelamento da operação

| Código | Etapa | Descrição | Link | Pré-requisito |
| --- | --- | --- | --- | --- |
| CAN0002* | Cancelamento permanente da dívida antes do desembolso  |Permite o cancelamento definitivo (status final) da dívida antes do pagamento| [Link Documentação](/documentation/emissao_de_divida/cancelamento/cancelar_permanentemente) |  EMD0001 |
| CAN0003* | Leitura do webhook de cancelamento  |Leitura da resposta assíncrona do cancelamento da operação. Webhook status: canceled| [Link Documentação](/documentation/webhooks/dividas) |  CAN0002 |
| CAN0004 | Cancelamento de dívida em até sete dias após o desembolso  | Considerando que o tomador do crédito pode realizar o cancelamento da dívida em até 7 dias do desembolso, é possível que ele faça um chargeback do PIX recebido ou pagar um QR Code de devolução | [Link Documentação](/documentation/emissao_de_divida/cancelamento/desistencia/introducao) |  DES0002 |

---

# Homologation Roadmap - Individual Debt Issuance - Precatório Advance

URL: /en/documentation/roteiros_laas/roteiro_5d068423-6094-49e4-b15b-7740038295a8

`*: mandatory steps for production entry`

## 1 - Registration and LaaS API Authentication
| Code  | Step | Description | Documentation Link | Prerequisite |
|---------|--|---|---|---|
| CAB0001* | Sandbox environment registration | Register on the QI Tech platform in the Sandbox environment (sandbox.qitech.app) | https://sandbox.qitech.com.br/register| |
| CAB0002* | Sandbox token validation | Validate the QI Token in Sandbox | [Download Token Inclusion Manual](https://docs.qitech.com.br/assets/pdfs/QI%20Tech%20Manual%20Inclus%C3%A3o%20de%20Token.pdf) | CAB0001 |
| CAB0003* | Public key exchange | Exchange public keys within the QI Tech platform in sandbox (sandbox.qitech.app) | [Documentation Link](/documentation/primeiros_passos/troca_de_chaves) | CAB0001 and CAB0002 |
| CAB0004* | API call authentication test | Complete API call authentication test | [Step by Step](/documentation/primeiros_passos/teste_de_autenticacao/teste_de_autenticacao_v2) <br/><br/> [Documentation Link](/documentation/primeiros_passos/teste_de_autenticacao/endpoints_de_teste) | CAB0003 |
| CAB0005* | Webhook configuration | Configure the URL for webhook delivery from QI Tech through the QI Tech platform in sandbox (sandbox.qitech.app) | [Documentation Link](/documentation/primeiros_passos/configurando_webhooks) | CAB0001 and CAB0002 |

## 2- Debt Simulation

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| SID0001* | Debt simulation| Simulation of debt conditions, using previously determined variables| [Documentation Link](/documentation/emissao_de_divida/simulacao_de_divida_novo) | **Item 1** |

## 3 - Debt Issuance (Individual)

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| EMD0001* | Individual debt issuance | Individual CCB issuance. Composed of four main objects: borrower registration data (borrower object), operation financial data (financial object), banking data for payment (disbursement_bank_account) and assignee indication (purchaser_document_number)| [Documentation Link](/documentation/emissao_de_divida/emissao/emissao_de_divida_pf) | **Items 1 and 2**  |
| EMD0002* | Additional data implementation | Data for filling out the generated CCB| Payload aligned in parallel | Mandatory, if usage is defined.  |

## 4 - Debt Formalization 

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| FOR0001 | Debt formalization  | CCB signature will be automatically triggered from QI SCD via QI Sign, after debt issuance| -- |  **Item 3** |
| FOR0002* | Signature completion webhook reading | Reading the asynchronous response of operation formalization. Webhook status signature_finished| [Documentation Link](/documentation/webhooks/dividas) | FOR0001 |

## 5 - Debt Disbursement

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| DES0001* | Disbursement date selection | After fulfilling all requirements for operation payment (document submission, signature and registration), a disbursement date must be chosen for the operation to be paid, within the disbursement range.| [Documentation Link](/documentation/emissao_de_divida/reprocessar_multiplas_datas/trocar_data) |  **Item 4** |
| DES0002* | Disbursement authorization | Payment release flag, prevents an operation from being disbursed without prior authorization| [Documentation Link](/documentation/emissao_de_divida/autorizar_desembolso) |  DES0001 |
| DES0003* | Operation disbursement webhook reading | Reading the asynchronous response indicating successful operation payment. Webhook status: disbursed. Here we have the payment receipt in PDF. In addition to returning the identifying keys of installments and their respective bank slips| [Documentation Link](/documentation/webhooks/dividas) |  DES0001 and DES0002 |

## 6 - Debt Installments

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| INS0001* | Installment webhook reading | Reading the asynchronous response indicating debt installment status updates. Here we have webhook_type: installment.status_change. Webhook status: opened, paid, waiting_payment, paid_early, paid_partial, overdue, paid_partial_overdue and paid_overdue.| [Documentation Link](/documentation/webhooks/parcelas) |  DES0002 |

## 7 - Debt Resubmission

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PAG0001* | Disbursement date change/update| When an operation is canceled, updating the disbursement date makes the operation return to the status prior to cancellation.| [Documentation Link](/documentation/emissao_de_divida/reprocessar_multiplas_datas/trocar_data) | **Item 5**   |
| PAG0002 | Banking data change | Change of operation payment data, requiring an account with the same ownership as the borrower| [Documentation Link](/documentation/emissao_de_divida/reprocessar_multiplas_datas/trocar_conta) |  PAG0001. Mandatory, if retry exists  |

## 8 -  Operation Cancellation

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| CAN0002* | Permanent debt cancellation before disbursement  |Allows definitive cancellation (final status) of debt before payment| [Documentation Link](/documentation/emissao_de_divida/cancelamento/cancelar_permanentemente) |  EMD0001 |
| CAN0003* | Cancellation webhook reading  |Reading the asynchronous response of operation cancellation. Webhook status: canceled| [Documentation Link](/documentation/webhooks/dividas) |  CAN0002 |
| CAN0004 | Debt cancellation within seven days after disbursement  | Considering that the credit recipient can cancel the debt within 7 days of disbursement, it's possible for them to perform a chargeback on the received PIX or pay a return QR Code | [Documentation Link](/documentation/emissao_de_divida/cancelamento/desistencia/introducao) |  DES0002 |

## 9 - Debt Bank Slips

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| BKS0001 | Request duplicate bank slip | Duplicate bank slip issuance, through the bank slip identifier key (*bank_slip_key*), returned in the disbursement webhook | [Documentation Link](/documentation/boletos/consultar/segunda_via_de_boleto) |  DES0002 |

## 10 - Debt Renegotiation

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| REN0001 | Renegotiation simulation  | Allows partial or total renegotiation simulation  | [Documentation Link](/documentation/renegociacao/simulacao_de_uma_renegociacao) | DES0002 |
| REN0002 | Create a renegotiation  | Allows creation of partial or total renegotiation (generation of an advance bank slip for installment payments) | [Documentation Link](/documentation/renegociacao/criacao_de_uma_renegociacao) |  DES0002 |
| REN0003 | Query a renegotiation  | Check renegotiation conditions, affected installments, financial data, due date and payment type | [Documentation Link](/documentation/renegociacao/consultar_uma_renegociacao) | REN0002 |
| REN0004 | List Renegotiations | Check a listing of conditions for more than one renegotiation | [Documentation Link](/documentation/renegociacao/consultar_uma_renegociacao) | REN0002 |
| REN0005 | Cancel a renegotiation| Cancel a renegotiation | [Documentation Link](/documentation/renegociacao/cancelar_uma_renegociacao) | REN0002 |
| REN0006 | Renegotiation payment | Renegotiation status update webhooks. Webhook_type: renegotiation.proposal | [Documentation Link](/documentation/renegociacao/consultar_uma_renegociacao) | REN0002 |

## 11 - Payments and Transfers

| Code | Step | Description | Link | Prerequisite |
| --- | --- | --- | --- | --- |
| PGT0001 | Decode QR Code | Obtain payment data from the return QR Code, through the Pix Copy and Paste URI  | [Documentation Link](/documentation/pix/decodificar_qr_code/index.html) |  CAN0004 |
| PGT0002 | PIX QR Code Transfer |  QR Code payment, through information obtained by QR Code decoding for debt cancellation | [Documentation Link](/documentation/baas/pix/realizar_transferencia/index.html#transfer%C3%AAncia-por-qr-code-pix) |  PGT0001 |
| PGT0003 | PIX Transfer |  Perform a PIX to the recipient from the escrow account  | [Documentation Link](/documentation/baas/pix/realizar_transferencia/index.html#transfer%C3%AAncia-por-qr-code-pix) |  DES0003 |
| PGT0004 | Account limit increase |  Request PIX limit increase for escrow | [Documentation Link](/documentation/pix/solicitar_alteracao_de_limite_pix/index.html) |  DES0003 |
| PGT0005 | TED Transfer |  Perform a TED to the recipient from the escrow account  | [Documentation Link](/documentation/baas/ted/realizar_transferencia/index.html) |  DES0003 |

---

# Homologation Roadmap - Credit Pay

URL: /en/documentation/roteiros_laas/roteiro_cecdd0e2-081a-4590-b571-188c376a7c64

## Summary

## 1. Debt inquiry

You can query the debt later to retrieve information or track its current status:

### Request

ENDPOINT /v2/credit_operation/ REQUESTER-IDENTIFIER-KEY
METHOD GET

Test in Playground

### Path params

| Field  | Type   | Description | Max. Char. |
|---|---|---|---|   
| `requester_identifier_key` * | string |  Client tracking key for the request | UUID |

### Response

STATUS 200

Response Body

```json
{
   "credit_operation_key":"0773a1b1-675a-4a10-80a2-a10308c7281e",
   "issue_amount":15367.14,
   "origin_key":"0773a1b1-675a-4a10-80a2-a10308c7281e",
   "total_iof":367.14,
   "assigned_at":null,
   "disbursement_start_date":"2026-03-23",
   "disbursement_end_date":"2026-03-23",
   "issue_date":"2026-03-23",
   "requester_identifier_key":"494598fd200",
   "installments":[
      {
         "business_due_date":"2026-06-08",
         "due_date":"2026-06-06",
         "calendar_days":75,
         "due_interest":0,
         "due_principal":15367.14,
         "fine_amount":0,
         "has_interest":true,
         "post_fixed_amount":0,
         "pre_fixed_amount":2432.7,
         "principal_amortization_amount":0,
         "tax_amount":0,
         "total_amount":2432.7,
         "workdays":50,
         "accrual_reference_date":null,
         "advanced_paid_amount":0,
         "bank_slip_key":null,
         "digitable_line":null,
         "installment_key":"c0c716ca-1645-4cf6-bb6b-438a69693d79",
         "installment_status":"created",
         "installment_type":"principal",
         "original_due_principal":15367.14,
         "original_pre_fixed_amount":2432.7,
         "original_principal_amortization_amount":0,
         "paid_amount":0,
         "original_total_amount":2432.7,
         "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
      },
      {
         "business_due_date":"2026-07-06",
         "due_date":"2026-07-06",
         "calendar_days":30,
         "due_interest":399,
         "due_principal":15367.14,
         "fine_amount":0,
         "has_interest":true,
         "post_fixed_amount":0,
         "pre_fixed_amount":1503.02,
         "principal_amortization_amount":929.68,
         "tax_amount":8,
         "total_amount":2432.7,
         "workdays":21,
         "accrual_reference_date":null,
         "advanced_paid_amount":0,
         "bank_slip_key":null,
         "digitable_line":null,
         "installment_key":"46d7a106-004f-4f64-910c-bc9e2c010845",
         "installment_status":"created",
         "installment_type":"principal",
         "original_due_principal":15367.14,
         "original_pre_fixed_amount":1503.02,
         "original_principal_amortization_amount":929.68,
         "paid_amount":0,
         "original_total_amount":2432.7,
         "qr_code_key":null,
         "qr_code_url":null,
         "renegotiation_proposal_key":null,
         "total_accrual_amount":0,
         "total_paid_amount":0,
         "installment_number":2,
         "paid_at":null,
         "updated_at":null,
         "principal_amortization_payment_amount":0,
         "prefixed_interest_payment_amount":0
      },
      {
         "business_due_date":"2026-08-06",
         "due_date":"2026-08-06",
         "calendar_days":31,
         "due_interest":0,
         "due_principal":14437.46134964,
         "fine_amount":0,
         "has_interest":true,
         "post_fixed_amount":0,
         "pre_fixed_amount":1045.5,
         "principal_amortization_amount":1387.2,
         "tax_amount":15.47,
         "total_amount":2432.7,
         "workdays":23,
         "accrual_reference_date":null,
         "advanced_paid_amount":0,
         "bank_slip_key":null,
         "digitable_line":null,
         "installment_key":"af84c132-7311-412f-a5e4-a827047fda52",
         "installment_status":"created",
         "installment_type":"principal",
         "original_due_principal":14437.46,
         "original_pre_fixed_amount":1045.5,
         "original_principal_amortization_amount":1387.2,
         "paid_amount":0,
         "original_total_amount":2432.7,
         "qr_code_key":null,
         "qr_code_url":null,
         "renegotiation_proposal_key":null,
         "total_accrual_amount":0,
         "total_paid_amount":0,
         "installment_number":3,
         "paid_at":null,
         "updated_at":null,
         "principal_amortization_payment_amount":0,
         "prefixed_interest_payment_amount":0
      },
      {
         "business_due_date":"2026-09-08",
         "due_date":"2026-09-06",
         "calendar_days":31,
         "due_interest":0,
         "due_principal":13050.26167997,
         "fine_amount":0,
         "has_interest":true,
         "post_fixed_amount":0,
         "pre_fixed_amount":945.05,
         "principal_amortization_amount":1487.65,
         "tax_amount":20.37,
         "total_amount":2432.7,
         "workdays":21,
         "accrual_reference_date":null,
         "advanced_paid_amount":0,
         "bank_slip_key":null,
         "digitable_line":null,
         "installment_key":"8517161a-408a-400d-9a27-e4e54c87d9ec",
         "installment_status":"created",
         "installment_type":"principal",
         "original_due_principal":13050.26,
         "original_pre_fixed_amount":945.05,
         "original_principal_amortization_amount":1487.65,
         "paid_amount":0,
         "original_total_amount":2432.7,
         "qr_code_key":null,
         "qr_code_url":null,
         "renegotiation_proposal_key":null,
         "total_accrual_amount":0,
         "total_paid_amount":0,
         "installment_number":4,
         "paid_at":null,
         "updated_at":null,
         "principal_amortization_payment_amount":0,
         "prefixed_interest_payment_amount":0
      },
      {
         "business_due_date":"2026-10-06",
         "due_date":"2026-10-06",
         "calendar_days":30,
         "due_interest":0,
         "due_principal":11562.6067212,
         "fine_amount":0,
         "has_interest":true,
         "post_fixed_amount":0,
         "pre_fixed_amount":809.38,
         "principal_amortization_amount":1623.32,
         "tax_amount":26.22,
         "total_amount":2432.7,
         "workdays":21,
         "accrual_reference_date":null,
         "advanced_paid_amount":0,
         "bank_slip_key":null,
         "digitable_line":null,
         "installment_key":"8c14e19c-a70e-4b0b-b0b5-d655f6136537",
         "installment_status":"created",
         "installment_type":"principal",
         "original_due_principal":11562.61,
         "original_pre_fixed_amount":809.38,
         "original_principal_amortization_amount":1623.32,
         "paid_amount":0,
         "original_total_amount":2432.7,
         "qr_code_key":null,
         "qr_code_url":null,
         "renegotiation_proposal_key":null,
         "total_accrual_amount":0,
         "total_paid_amount":0,
         "installment_number":5,
         "paid_at":null,
         "updated_at":null,
         "principal_amortization_payment_amount":0,
         "prefixed_interest_payment_amount":0
      },
      {
         "business_due_date":"2026-11-06",
         "due_date":"2026-11-06",
         "calendar_days":31,
         "due_interest":0,
         "due_principal":9939.28802441,
         "fine_amount":0,
         "has_interest":true,
         "post_fixed_amount":0,
         "pre_fixed_amount":719.76,
         "principal_amortization_amount":1712.94,
         "tax_amount":32.03,
         "total_amount":2432.7,
         "workdays":21,
         "accrual_reference_date":null,
         "advanced_paid_amount":0,
         "bank_slip_key":null,
         "digitable_line":null,
         "installment_key":"4a880580-5873-4c12-8d32-3cf95b416417",
         "installment_status":"created",
         "installment_type":"principal",
         "original_due_principal":9939.29,
         "original_pre_fixed_amount":719.76,
         "original_principal_amortization_amount":1712.94,
         "paid_amount":0,
         "original_total_amount":2432.7,
         "qr_code_key":null,
         "qr_code_url":null,
         "renegotiation_proposal_key":null,
         "total_accrual_amount":0,
         "total_paid_amount":0,
         "installment_number":6,
         "paid_at":null,
         "updated_at":null,
         "principal_amortization_payment_amount":0,
         "prefixed_interest_payment_amount":0
      },
      {
         "business_due_date":"2026-12-07",
         "due_date":"2026-12-06",
         "calendar_days":30,
         "due_interest":0,
         "due_principal":8226.34916112,
         "fine_amount":0,
         "has_interest":true,
         "post_fixed_amount":0,
         "pre_fixed_amount":575.84,
         "principal_amortization_amount":1856.86,
         "tax_amount":39.28,
         "total_amount":2432.7,
         "workdays":19,
         "accrual_reference_date":null,
         "advanced_paid_amount":0,
         "bank_slip_key":null,
         "digitable_line":null,
         "installment_key":"94db881b-0054-4c73-b969-89c37c082f39",
         "installment_status":"created",
         "installment_type":"principal",
         "original_due_principal":8226.35,
         "original_pre_fixed_amount":575.84,
         "original_principal_amortization_amount":1856.86,
         "paid_amount":0,
         "original_total_amount":2432.7,
         "qr_code_key":null,
         "qr_code_url":null,
         "renegotiation_proposal_key":null,
         "total_accrual_amount":0,
         "total_paid_amount":0,
         "installment_number":7,
         "paid_at":null,
         "updated_at":null,
         "principal_amortization_payment_amount":0,
         "prefixed_interest_payment_amount":0
      },
      {
         "business_due_date":"2027-01-06",
         "due_date":"2027-01-06",
         "calendar_days":31,
         "due_interest":0,
         "due_principal":6369.49243064,
         "fine_amount":0,
         "has_interest":true,
         "post_fixed_amount":0,
         "pre_fixed_amount":461.25,
         "principal_amortization_amount":1971.45,
         "tax_amount":46.72,
         "total_amount":2432.7,
         "workdays":21,
         "accrual_reference_date":null,
         "advanced_paid_amount":0,
         "bank_slip_key":null,
         "digitable_line":null,
         "installment_key":"d32e9f02-426d-4861-ad5c-fe541d2a4b94",
         "installment_status":"created",
         "installment_type":"principal",
         "original_due_principal":6369.49,
         "original_pre_fixed_amount":461.25,
         "original_principal_amortization_amount":1971.45,
         "paid_amount":0,
         "original_total_amount":2432.7,
         "qr_code_key":null,
         "qr_code_url":null,
         "renegotiation_proposal_key":null,
         "total_accrual_amount":0,
         "total_paid_amount":0,
         "installment_number":8,
         "paid_at":null,
         "updated_at":null,
         "principal_amortization_payment_amount":0,
         "prefixed_interest_payment_amount":0
      },
      {
         "business_due_date":"2027-02-10",
         "due_date":"2027-02-06",
         "calendar_days":31,
         "due_interest":0,
         "due_principal":4398.04366699,
         "fine_amount":0,
         "has_interest":true,
         "post_fixed_amount":0,
         "pre_fixed_amount":318.49,
         "principal_amortization_amount":2114.21,
         "tax_amount":55.48,
         "total_amount":2432.7,
         "workdays":22,
         "accrual_reference_date":null,
         "advanced_paid_amount":0,
         "bank_slip_key":null,
         "digitable_line":null,
         "installment_key":"0c6ef3ba-6d82-45e4-9f3f-9f9a89207f68",
         "installment_status":"created",
         "installment_type":"principal",
         "original_due_principal":4398.04,
         "original_pre_fixed_amount":318.49,
         "original_principal_amortization_amount":2114.21,
         "paid_amount":0,
         "original_total_amount":2432.7,
         "qr_code_key":null,
         "qr_code_url":null,
         "renegotiation_proposal_key":null,
         "total_accrual_amount":0,
         "total_paid_amount":0,
         "installment_number":9,
         "paid_at":null,
         "updated_at":null,
         "principal_amortization_payment_amount":0,
         "prefixed_interest_payment_amount":0
      },
      {
         "business_due_date":"2027-03-08",
         "due_date":"2027-03-06",
         "calendar_days":28,
         "due_interest":0,
         "due_principal":2283.83070016,
         "fine_amount":0,
         "has_interest":true,
         "post_fixed_amount":0,
         "pre_fixed_amount":148.87,
         "principal_amortization_amount":2283.83,
         "tax_amount":65.17,
         "total_amount":2432.7,
         "workdays":18,
         "accrual_reference_date":null,
         "advanced_paid_amount":0,
         "bank_slip_key":null,
         "digitable_line":null,
         "installment_key":"470dd63a-89eb-4c6c-8cd6-f570d469aa35",
         "installment_status":"created",
         "installment_type":"principal",
         "original_due_principal":2283.83,
         "original_pre_fixed_amount":148.87,
         "original_principal_amortization_amount":2283.83,
         "paid_amount":0,
         "original_total_amount":2432.7,
         "qr_code_key":null,
         "qr_code_url":null,
         "renegotiation_proposal_key":null,
         "total_accrual_amount":0,
         "total_paid_amount":0,
         "installment_number":10,
         "paid_at":null,
         "updated_at":null,
         "principal_amortization_payment_amount":0,
         "prefixed_interest_payment_amount":0
      }
   ],
   "first_due_date":"2026-06-06",
   "requester_key":"3e69b448-9afb-4aef-9c0d-0a3059350d80",
   "original_total_iof":null,
   "contract_number":"ANT000000787",
   "credit_operation_status_enumerator":"waiting_signature",
   "operation_type_enumerator":"settlement_refinancing",
   "disbursement_date":"2026-03-23",
   "issuer_name":"Alan Mathison Turing",
   "issuer_document_number":"47003534819",
   "external_contract_fees":[
      {
         "amount_type":"absolute",
         "fee_amount":0,
         "tax_amount":0,
         "irrf_amount":0,
         "amount":0,
         "pis_amount":0,
         "amount_released":0,
         "fee_type":"tac",
         "cofins_amount":0,
         "csll_amount":0,
         "description":null,
         "net_fee_amount":0,
         "rebate_account":null
      }
   ],
   "cet":7.51,
   "annual_cet":138.34,
   "final_disbursement_amount":4885.12,
   "number_of_installments":10,
   "disbursement_issue_amount":15000,
   "prefixed_interest_rate":{
      "annual_rate":1.252191589,
      "daily_rate":0.0022578334,
      "interest_base":{
         "enumerator":"calendar_days",
         "year_days":360
      },
      "monthly_rate":0.07
   },
   "fine_configuration":{
      "contract_fine_rate":0.02,
      "fine_delay_rate":{
         "annual_rate":4.35025011,
         "daily_rate":0.0046696,
         "interest_base":{
            "enumerator":"calendar_days",
            "year_days":360
         },
         "monthly_rate":0.15
      }
   },
   "attached_documents":[
      {
         "document_key":"494598fd-c226-4332-a500-591ae3884673",
         "document_url":"https://storage.googleapis.com/sandbox-doc-api/documents/494598fd-c226-4332-a500-591ae3884673/3d684e68e7df4e557d0480d98e26be92.jpg",
         "signature_url":null,
         "document_type":"document_identification",
         "signature_required":false,
         "signed":false
      },
      {
         "document_key":"494598fd-c226-4332-a500-591ae3884673",
         "document_url":"https://storage.googleapis.com/sandbox-doc-api/documents/494598fd-c226-4332-a500-591ae3884673/3d684e68e7df4e557d0480d98e26be92.jpg",
         "signature_url":null,
         "document_type":"document_identification_back",
         "signature_required":false,
         "signed":false
      },
      {
         "document_key":"cb97f9f5-9b58-4a55-826f-8698f2b97230",
         "document_url":"https://storage.googleapis.com/sandbox-doc-api-private/documents/cb97f9f5-9b58-4a55-826f-8698f2b97230/CASTELLOBNPL-ALAN_MATHISON_TURING-CCB-ANT000000787-20260408055239.pdf",
         "signature_url":null,
         "document_type":"ccb_pre_price_days",
         "signature_required":true,
         "signed":false
      }
   ],
   "related_parties":[
      {
         "related_party_key":"70f0bc84-98e0-4d4c-9ea7-ed783746ba5c",
         "role_type":"issuer",
         "person_type":"natural",
         "name":"Alan Mathison Turing",
         "email":"",
         "individual_document_number":"47003534819"
      }
   ],
   "base_iof":308.75,
   "additional_iof":58.39,
   "assignment_amount":15444.19,
   "created_at":"2026-04-08T05:52:38Z",
   "total_prefixed_amount":8959.86
}
```

### Response example (refinancing — `refinanced_credit_operations`)

For a **refinancing** credit operation, the GET response includes **`operation_type_enumerator`**: **`settlement_refinancing`** and the array **`refinanced_credit_operations`**, which lists the prior operation(s) being settled by this new contract. The example below uses **`final_disbursement_amount`**: **`0`** (no cash payout to the borrower—the new operation is sized to settle the prior obligation); see the note on **`final_disbursement_amount`** in this section.

:::caution Homologation / sample data

The payload below is a **sandbox / homologation** sample. **UUIDs, contract numbers, monetary amounts, calendar dates, and document URLs** are **illustrative** only. In production, rely on the **field names and types**, not on these literal values.

:::

Response Body (refinancing)

```json
{
   "credit_operation_key":"7c106ebb-42b5-4f9d-afdb-d3cc7c7883d1",
   "issue_amount":101.81,
   "origin_key":"7c106ebb-42b5-4f9d-afdb-d3cc7c7883d1",
   "total_iof":0.91,
   "assigned_at":null,
   "disbursement_start_date":"2026-04-15",
   "disbursement_end_date":"2026-04-15",
   "issue_date":"2026-04-15",
   "requester_identifier_key":"7014211f-0d09-4db3-957a-c916903ec4d3",
   "installments":[
      {
         "business_due_date":"2026-05-15",
         "due_date":"2026-05-15",
         "calendar_days":30,
         "due_interest":0,
         "due_principal":101.81,
         "fine_amount":0,
         "has_interest":true,
         "post_fixed_amount":0,
         "pre_fixed_amount":8.14,
         "principal_amortization_amount":31.43,
         "tax_amount":0.08,
         "total_amount":39.57,
         "workdays":20,
         "accrual_reference_date":null,
         "advanced_paid_amount":0,
         "bank_slip_key":null,
         "digitable_line":null,
         "installment_key":"ffd81916-ce62-4b32-82b8-3c7cb7afde0a",
         "installment_status":"opened",
         "installment_type":"principal",
         "original_due_principal":101.81,
         "original_pre_fixed_amount":8.14,
         "original_principal_amortization_amount":31.43,
         "paid_amount":0,
         "original_total_amount":39.57,
         "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":"2026-04-16T01:30:36",
         "principal_amortization_payment_amount":0,
         "prefixed_interest_payment_amount":0
      },
      {
         "business_due_date":"2026-06-15",
         "due_date":"2026-06-15",
         "calendar_days":31,
         "due_interest":0,
         "due_principal":70.38415074,
         "fine_amount":0,
         "has_interest":true,
         "post_fixed_amount":0,
         "pre_fixed_amount":5.83,
         "principal_amortization_amount":33.74,
         "tax_amount":0.17,
         "total_amount":39.57,
         "workdays":20,
         "accrual_reference_date":null,
         "advanced_paid_amount":0,
         "bank_slip_key":null,
         "digitable_line":null,
         "installment_key":"4b41315b-d685-4646-b57f-107c00bf36e0",
         "installment_status":"opened",
         "installment_type":"principal",
         "original_due_principal":70.38,
         "original_pre_fixed_amount":5.83,
         "original_principal_amortization_amount":33.74,
         "paid_amount":0,
         "original_total_amount":39.57,
         "qr_code_key":null,
         "qr_code_url":null,
         "renegotiation_proposal_key":null,
         "total_accrual_amount":0,
         "total_paid_amount":0,
         "installment_number":2,
         "paid_at":null,
         "updated_at":"2026-04-16T01:30:36",
         "principal_amortization_payment_amount":0,
         "prefixed_interest_payment_amount":0
      },
      {
         "business_due_date":"2026-07-15",
         "due_date":"2026-07-15",
         "calendar_days":30,
         "due_interest":0,
         "due_principal":36.63949004,
         "fine_amount":0,
         "has_interest":true,
         "post_fixed_amount":0,
         "pre_fixed_amount":2.93,
         "principal_amortization_amount":36.64,
         "tax_amount":0.27,
         "total_amount":39.57,
         "workdays":22,
         "accrual_reference_date":null,
         "advanced_paid_amount":0,
         "bank_slip_key":null,
         "digitable_line":null,
         "installment_key":"920af811-9d4c-4886-9095-73cc6f546f02",
         "installment_status":"opened",
         "installment_type":"principal",
         "original_due_principal":36.64,
         "original_pre_fixed_amount":2.93,
         "original_principal_amortization_amount":36.64,
         "paid_amount":0,
         "original_total_amount":39.57,
         "qr_code_key":null,
         "qr_code_url":null,
         "renegotiation_proposal_key":null,
         "total_accrual_amount":0,
         "total_paid_amount":0,
         "installment_number":3,
         "paid_at":null,
         "updated_at":"2026-04-16T01:30:36",
         "principal_amortization_payment_amount":0,
         "prefixed_interest_payment_amount":0
      }
   ],
   "first_due_date":"2026-05-15",
   "requester_key":"3e69b448-9afb-4aef-9c0d-0a3059350d80",
   "original_total_iof":null,
   "contract_number":"0000667215/NDR",
   "credit_operation_status_enumerator":"opened",
   "operation_type_enumerator":"settlement_refinancing",
   "disbursement_date":"2026-04-15",
   "issuer_name":"NOME DO REPRESENTANTE",
   "issuer_document_number":"31057466093",
   "external_contract_fees":[
      {
         "amount_type":"absolute",
         "fee_amount":0,
         "tax_amount":0,
         "irrf_amount":0,
         "amount":0,
         "pis_amount":0,
         "amount_released":0,
         "fee_type":"tac",
         "cofins_amount":0,
         "csll_amount":0,
         "description":null,
         "net_fee_amount":0,
         "rebate_account":null
      }
   ],
   "cet":8.62,
   "annual_cet":169.6,
   "final_disbursement_amount":0,
   "number_of_installments":3,
   "disbursement_issue_amount":100.9,
   "prefixed_interest_rate":{
      "annual_rate":1.5181701168,
      "daily_rate":0.0025686614,
      "interest_base":{
         "enumerator":"calendar_days",
         "year_days":360
      },
      "monthly_rate":0.08
   },
   "fine_configuration":{
      "contract_fine_rate":0.02,
      "fine_delay_rate":{
         "annual_rate":0.12682503,
         "daily_rate":0.00032719,
         "interest_base":{
            "enumerator":"calendar_days_365",
            "year_days":365
         },
         "monthly_rate":0.01
      }
   },
   "attached_documents":[
      {
         "document_key":"a3749ce5-750a-4a1a-a22c-5966e9d13885",
         "document_url":"https://storage.googleapis.com/sandbox-doc-api-private/documents/a3749ce5-750a-4a1a-a22c-5966e9d13885/CASTELLOBNPL-NOME_DO_REPRESENTANTE-CCB-0000667215-20260416013033.pdf",
         "signature_url":"https://storage.googleapis.com/sandbox-doc-api-private/documents/a3749ce5-750a-4a1a-a22c-5966e9d13885/CASTELLOBNPL-NOME_DO_REPRESENTANTE-CCB-0000667215-20260416013033_signed.pdf",
         "document_type":"ccb_pre_price_days",
         "signature_required":true,
         "signed":true
      }
   ],
   "related_parties":[
      {
         "related_party_key":"bb7ab0e0-04f5-4814-901f-e44a6eb0b243",
         "role_type":"issuer",
         "person_type":"natural",
         "name":"NOME DO REPRESENTANTE",
         "email":"2210@test.com",
         "individual_document_number":"31057466093"
      }
   ],
   "base_iof":0.52,
   "additional_iof":0.39,
   "assignment_amount":102.42,
   "created_at":"2026-04-16T01:30:33Z",
   "total_prefixed_amount":16.9,
   "refinanced_credit_operations":[
      {
         "refinanced_credit_operation_key":"a0c66c34-404a-4391-b0d1-7c109329b808",
         "refinanced_contract_number":"0000667214/NDR",
         "due_balance":100.9,
         "due_balance_reference_date":"2026-04-15",
         "original_deadline":91,
         "refinanced_credit_operation_status_enumerator":"pending_payment",
         "updated_at":"2026-04-16T01:30:33",
         "created_at":"2026-04-16T01:30:33"
      }
   ]
}
```

:::info **`refinanced_credit_operations`**

Each object describes a **prior** credit operation included in this refinancing: **`refinanced_credit_operation_key`** and **`refinanced_contract_number`** identify it; **`due_balance`** and **`due_balance_reference_date`** are the payoff context used when structuring the new contract; **`refinanced_credit_operation_status_enumerator`** is the status of that **refinanced** operation at the time of the inquiry (not necessarily the new operation’s status). **`original_deadline`** refers to the prior operation’s term where applicable.

:::

:::info **`business_due_date`** (installments)

In each object under **`installments[]`**, pay attention to **`business_due_date`**: it is the installment due date on the **business-day** calendar (working / banking days). It may match **`due_date`** or differ when the natural calendar date falls on a non-business day—use both fields together when reconciling schedules and cut-offs.
:::

:::info **`operation_type_enumerator`**

When **`operation_type_enumerator`** is **`settlement_refinancing`**, the credit operation is a **refinancing** debt—that is, it is issued under the refinancing flow (settling prior credit operations). Use this field to distinguish refinancing debts from other operation types.
:::

:::info **`final_disbursement_amount`**

**`final_disbursement_amount`** is the effective disbursement of the new credit operation. When there is **no** net amount paid to the borrower (no cash payout from the new loan), the platform **does not** rely on a separately informed disbursement: it **computes the due balance** (payoff) of the refinanced loan(s), and **that amount is used as the disbursed amount of the new loan**—the new operation is sized to settle the prior obligation.
:::

## 2. Renegotiation — Batch simulation

### Overview

Before creating a proposal, you can simulate batch renegotiation values for operations. The simulation shows affected installments, discounts, and the total amount due across multiple operations.

When **`amortization_type`** is **`present_amount`**, send only **`installment_key`** on each installment in `operations[].installments[]` for simulation. Per-installment **`paid_amount`** and **`discount_amount`** are **not** used on **`batch_proposal_simulation`**—they are required on **`POST /renegotiation/batch_proposal`** (see §3).

:::caution Attention
Batch renegotiation can only include operations from the same issuer and the same integration key. There is a limit of **50 operations** per batch renegotiation.
:::

### Request

ENDPOINT /renegotiation/batch_proposal_simulation
METHOD POST

:::warning Warning
The `discount_amount` and `discount_percentage` fields must **not** be sent together in the same payload (root level).
:::

:::info Note
At the root, `discount_amount` and `discount_percentage` are mutually exclusive global discount options for the simulation payload. Per-installment **`paid_amount`** and **`discount_amount`** are documented under **`POST /renegotiation/batch_proposal`** only.
:::

Request Body

```json
{
    "amortization_type": "present_amount",
    "reference_date": "2026-04-08",
    "discount_percentage": 0.0,
    "operations": [
        {
            "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
            "installments": [
                {
                    "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88"
                }
            ]
        },
        {
            "debt_key": "2cbfb9b1-1fdb-5f8d-9967-b338e5eb83f9",
            "installments": [
                {
                    "installment_key": "2ef25ed8-7124-44f5-9e3d-1d1a7196166e"
                }
            ]
        }
    ]
}
```

### Response

Example response ( batch_proposal_simulation )

```json
{
    "batch_proposal_key": "429fd784-e13e-47a1-ad9f-291209e0e621",
    "discount_percentage": 0,
    "discount_amount": 20,
    "amortization_type": "present_amount",
    "payment_amount": 78389.55,
    "requester_name": "Castello  (BNPL)",
    "requester_key": "3e69b448-9afb-4aef-9c0d-0a3059350d80",
    "issuer_name": "Alan Mathison Turing",
    "reference_date": "2026-04-11",
    "issuer_document_number": "82744088021",
    "operations": [
        {
            "requester_key": "3e69b448-9afb-4aef-9c0d-0a3059350d80",
            "contract_number": "TEST00790",
            "payment_amount": 78389.55,
            "discount_amount": 20,
            "origin_key": null,
            "affected_installments": [
                {
                    "installment_key": "24b5deae-304e-4773-9b25-e42dbd450241",
                    "due_date": "2026-05-10",
                    "principal_amount": 73107.75725415,
                    "interest_amount": 10580.11274585,
                    "fine_amount": 0,
                    "total_amount": 83687.87,
                    "present_amount": 78389.55,
                    "paid_amount": 78389.55,
                    "principal_amortization_payment_amount": 78048.3,
                    "prefixed_interest_payment_amount": 341.25,
                    "fine_payment_amount": 0,
                    "discount_amount": 0
                }
            ],
            "remaining_installments": [
                {
                    "installment_key": "2b1d9423-4dab-44b3-bf8c-efc8433176dd",
                    "due_date": "2026-06-10",
                    "principal_amount": 73096.23,
                    "interest_amount": 10591.64,
                    "fine_amount": 0,
                    "total_amount": 83687.87
                }
            ],
            "debt_key": "388c47fa-6c6c-4d2b-8f00-ccc2d571fcb0"
        }
    ]
}
```

### Body parameters

| Field | Type | Description | Max length |
|---|---|---|---|
| `amortization_type`* | string | Amortization type | **[Amortization type values](#enumeradores-amortization-type)** |
| `reference_date`* | string | Reference date for present value (must be D+1) | 10 |
| `discount_percentage` | float | Discount percentage on present value ((1 − percentage) × present value) | 10 |
| `discount_amount` | float | Discount amount on present value | 10 |
| `force_due_date` | boolean | Optional. When `true`, installments whose `reference_date` falls within the shift window `[due_date, business_due_date]` (`business_due_date > due_date`, e.g. weekend/holiday rollover) are priced at face value using the installment's own `due_date` as reference — no accrued interest, no delay fine. Default `false`. See **[Force due date behavior](#force-due-date-behavior)**. | — |
| `operations`* | array | Operations to renegotiate | **[Operations object](#objeto-operations)** |

### Operations object

| Field | Type | Description | Max length |
|---|---|---|---|
| `debt_key`* | string | Unique credit operation key (DEBT-KEY) | UUID |
| `installments`* | array | Installments to renegotiate | **[Installments object](#objeto-installments)** |

### Installments object

| Field | Type | Description | Max length |
|---|---|---|---|
| `installment_key`* | string | Installment key | UUID |

### Amortization type values

| Value | Description |
|---|---|
| **present_amount** | Simulation with present value per installment: each `installments[]` entry includes **`installment_key`** only. **`paid_amount`** / **`discount_amount`** are not sent on this endpoint—use **`batch_proposal`** for those fields. |

### Force due date behavior {#force-due-date-behavior}

When `force_due_date` is `true`, the API applies a shift-window rule to each installment:

- If `business_due_date > due_date` (i.e. there is a weekend/holiday rollover) **and** `reference_date` falls within `[due_date, business_due_date]`, the installment is treated as **not yet due** and priced at face value using its own `due_date` as reference. Interest does not accrue for the days between `due_date` and `reference_date`, and no delay fine is charged.
- Otherwise (no shift, or `reference_date` outside the window) the installment behaves as usual (overdue or not overdue).

Typical use case: the client wants to pay on Sunday installments that fell on Saturday. Without the flag, one day of interest accrues; with the flag, only the face value is charged. The flag is opt-in and defaults to `false` — omitting it preserves the current behavior.

## 3. Renegotiation — Batch proposal

### Overview

After simulating values, you can create a batch renegotiation proposal for multiple operations. The proposal generates a single payment method (bank slip and/or Pix) covering all operations in the batch.

For amortization type **`present_amount`**, each installment listed under `operations[].installments[]` must include **`paid_amount`** (amount paid or allocated for that installment), **`discount_amount`** (discount in BRL applied to the installment), and **`installment_key`**.

:::caution Attention
Batch renegotiation can only include operations from the same issuer and the same integration key. There is a limit of **50 operations** per batch renegotiation.
:::

### Request

ENDPOINT /renegotiation/batch_proposal
METHOD POST

### Paid amount and discount amount (installments) {#installment-paid-discount-proposal}

For **`POST /renegotiation/batch_proposal`** only: when **`amortization_type`** is **`present_amount`**, each object in `operations[].installments[]` must include these fields (in addition to **`installment_key`**):

| Field | Type | Description | Max length |
|---|---|---|---|
| **`paid_amount`** | float | Amount paid or allocated on that installment (BRL). Required when **`amortization_type`** is **`present_amount`**. | 15,2 |
| **`discount_amount`** | float | Discount in BRL applied to that installment. Required when **`amortization_type`** is **`present_amount`**; use **`0`** if there is no discount. Optional per installment for other amortization types, when applicable. | 15,2 |

:::warning Warning
The `discount_amount` and `discount_percentage` fields must **not** be sent together in the same payload (root level).
:::

:::info Note
At the root of the body, `discount_amount` and `discount_percentage` are mutually exclusive options for a global discount on the present value. The **`paid_amount`** and **`discount_amount`** fields inside each object in `operations[].installments[]` define the per-installment composition when `amortization_type` is **`present_amount`** (they are required in this mode and do not conflict with the root-level rule).
:::

Request Body

```json
{
    "amortization_type": "present_amount",
    "reference_date": "2026-04-08",
    "proposal_due_date": "2026-04-15",
    "discount_percentage": 0.0,
    "payment_type": "pix",
    "request_control_key": "94b31045-c8e7-45be-a88d-2ae25c5df5db",
    "operations": [
        {
            "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
            "installments": [
                {
                    "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88",
                    "paid_amount": 500,
                    "discount_amount": 50
                }
            ]
        },
        {
            "debt_key": "2cbfb9b1-1fdb-5f8d-9967-b338e5eb83f9",
            "installments": [
                {
                    "installment_key": "2ef25ed8-7124-44f5-9e3d-1d1a7196166e",
                    "paid_amount": 150,
                    "discount_amount": 10
                }
            ]
        }
    ]
}
```

### Response

STATUS 200

Example response body ( batch_proposal )

```json
{
    "batch_proposal_key": "37879d40-c16e-4d7f-a16f-d79d20c50d42",
    "discount_percentage": 0,
    "discount_amount": 20,
    "amortization_type": "present_amount",
    "payment_amount": 78206.27,
    "requester_name": "Castello  (BNPL)",
    "requester_key": "3e69b448-9afb-4aef-9c0d-0a3059350d80",
    "issuer_name": "Alan Mathison Turing",
    "reference_date": "2026-04-11",
    "issuer_document_number": "82744088021",
    "batch_proposal_status": "pending_payment",
    "proposal_due_date": "2026-04-11",
    "payment_type": "pix",
    "request_control_key": "37879d40-c16e-4d7f-a16f-d79d20c50d42",
    "origin_key": null,
    "operations": [
        {
            "requester_key": "3e69b448-9afb-4aef-9c0d-0a3059350d80",
            "contract_number": "TEST1570594223",
            "payment_amount": 78206.27,
            "discount_amount": 20,
            "origin_key": null,
            "affected_installments": [
                {
                    "installment_key": "1162e382-8bd6-4c0b-9111-8390d9794102",
                    "due_date": "2026-05-10",
                    "principal_amount": 73277.29,
                    "interest_amount": 10214.91,
                    "fine_amount": 0,
                    "total_amount": 83492.2,
                    "present_amount": 78206.27,
                    "paid_amount": 78206.27,
                    "principal_amortization_payment_amount": 78206.27,
                    "prefixed_interest_payment_amount": 0,
                    "fine_payment_amount": 0,
                    "discount_amount": 0
                }
            ],
            "remaining_installments": [
                {
                    "installment_key": "58eea645-5682-440d-aa6b-a3b124253684",
                    "due_date": "2026-06-10",
                    "principal_amount": 72925.33,
                    "interest_amount": 10566.87,
                    "fine_amount": 0,
                    "total_amount": 83492.2
                }
            ],
            "debt_key": "6564493d-75c3-4efe-9f11-82fa5cff9a78"
        }
    ],
    "payment": {
        "digitable_line": null,
        "qr_code_url": "00020126930014br.gov.bcb.pix2571qrcode-h.sandbox.qitech.app/bacen/cobv/426661142f5d4cd9954dcae3725d020d5204000053039865802BR5925QISOCIEDADEDECREDITODIRET6008SaoPaulo61080145200062070503***6304B878",
        "qr_code_key": "42666114-2f5d-4cd9-954d-cae3725d020d",
        "bank_slip_key": null,
        "paid_method_type": "pix",
        "source_account_key": null,
        "payment_data": {
            "creditor_bank_account_key": "6108dd45-580d-48c4-b3bb-74c1e843be49",
            "batch_renegotiation_proposal_key": "37879d40-c16e-4d7f-a16f-d79d20c50d42"
        }
    }
}
```

### Body parameters

| Field | Type | Description | Max length |
|---|---|---|---|
| `amortization_type`* | string | Amortization type | **[Amortization type values](#enumeradores-amortization-type)** |
| `reference_date`* | string | Reference date for present value calculation (D+1) | 10 |
| `proposal_due_date`* | string | Renegotiation proposal due date | 10 |
| `payment_type`* | string | Payment type | **[Payment type values](#enumeradores-payment-type)** |
| `request_control_key` | string | Optional control key for tracking and unique identification | UUID |
| `discount_percentage` | float | Discount percentage on present value | 10 |
| `discount_amount` | float | Discount amount on present value | 10 |
| `force_due_date` | boolean | Optional. When `true`, installments in the shift window `[due_date, business_due_date]` (`business_due_date > due_date`) are charged at face value using their own `due_date` as reference — no accrued interest, no delay fine. Default `false`. See **[Force due date behavior](#force-due-date-behavior)**. | — |
| `operations`* | array | Operations to renegotiate | **[Operations object](#objeto-operations)** |

### Operations object {#objeto-operations}

| Field | Type | Description | Max length |
|---|---|---|---|
| `debt_key`* | string | Unique credit operation key (DEBT-KEY) | UUID |
| `installments`* | array | Installments to renegotiate | **[Installments object](#objeto-installments)** |

### Installments object {#objeto-installments}

| Field | Type | Description | Max length |
|---|---|---|---|
| `installment_key`* | string | Installment key | UUID |
| `paid_amount` | float | Required for **`present_amount`**. See **[Paid amount and discount amount](#installment-paid-discount-proposal)**. | 15,2 |
| `discount_amount` | float | Required for **`present_amount`**. See **[Paid amount and discount amount](#installment-paid-discount-proposal)**. | 15,2 |

### Payment type values {#enumeradores-payment-type}

| Value | Description |
|---|---|
| `bank_slip` | Bank slip (generates slip and Pix) |
| `pix` | Pix only |
| `internal` | Internal transfer (automatic processing) |
| `manual` | Manual payment (no payment method generated) |

### Amortization type values {#enumeradores-amortization-type}

| Value | Description |
|---|---|
| **present_amount** | Present value per installment. Each `installments[]` item must include `installment_key`, **`paid_amount`**, and **`discount_amount`**. |

## 4. Renegotiation — Delete batch proposal

### Overview

**`DELETE /renegotiation/batch_proposal/{request_control_key}`** cancels or deletes a **batch** renegotiation proposal that is **not** finalized or is still in a **cancellable** state. The proposal is marked canceled/deleted and any associated payment methods (bank slip, Pix, etc.) are invalidated.

Pass the same **`request_control_key`** you used when creating the batch with **`POST /renegotiation/batch_proposal`** (optional field on the create payload). If your integration maps this route to another identifier, follow your contract; the path parameter name in the API is **`request_control_key`**.

### Request

ENDPOINT /renegotiation/batch_proposal/{'{request_control_key}'}
METHOD DELETE

### Response

STATUS 200

Example response body

```json
{}
```

## 5. Refinancing simulation

### Request

ENDPOINT /debt_simulation
METHOD POST

Request Body

```json
{
  "borrower": {
    "person_type": "natural"
  },
  "refinanced_credit_operations": [
    {
      "operation_key": "89b5c27e-b291-4414-abb0-f5f15c06c82b"
    }
  ],
  "financial": {
    "final_disbursement_amount": 0,
    "disbursement_amount": 0,
    "interest_type": "pre_price_days",
    "credit_operation_type": "ccb",
    "annual_interest_rate": 2.32,
    "disbursement_date": "2023-04-01",
    "first_due_date": "2023-05-01",
    "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
    }
  }
}
```

:::info **`final_disbursement_amount`** (`financial`)

You may send **`final_disbursement_amount`** as **`0`** when you are **not** specifying a cash disbursement to the borrower. In that case, the simulation derives the **disbursed amount of the new loan** from the **due balance** (payoff) of the refinanced operation(s)—the same rule as in **[debt inquiry](#1-debt-inquiry)** for **`final_disbursement_amount`**: the new credit is sized from what is owed on the previous loan(s), not from a user-defined payout amount.
:::

:::caution Attention

Send **`borrower`**, **`financial`**, and **`refinanced_credit_operations`** with **`operation_key`** for each operation to refinance. See **[Definitions (refinancing simulation)](#definitions-refinancing-simulation)**.
:::

### Response

STATUS 200

Response Body

```json
{
   "type":"debt",
   "key":"938351f9-511c-4ccb-9e09-35ebc8f1af2f",
   "status":"finished",
   "event_datetime":"2026-04-09 03:21:09",
   "data":{
      "interest_type":"pre_price_days",
      "credit_operation_type":"ccb",
      "interest_grace_period":0,
      "interest_payment_month_period":1,
      "principal_grace_period":0,
      "principal_amortization_month_period":1,
      "operation_type":"settlement_refinancing",
      "post_fixed_interest_base":"workdays",
      "post_fixed_interest_rate":null,
      "prefixed_interest_rate":{
         "interest_base":"calendar_days_365",
         "annual_rate":2.32,
         "monthly_rate":0.1051676747,
         "daily_rate":0.0032929847
      },
      "issue_date":"2023-04-01",
      "number_of_installments":2,
      "requester_key":"3e69b448-9afb-4aef-9c0d-0a3059350d80",
      "final_disbursement_amount":0,
      "refinanced_credit_operations":[
         {
            "refinanced_credit_operation_key":"89b5c27e-b291-4414-abb0-f5f15c06c82b",
            "refinanced_credit_operation_status":"pending_payment",
            "due_balance":15114.45,
            "due_balance_reference_date":"2023-04-01",
            "original_deadline":61
         }
      ],
      "total_pre_fixed_amount":2434.45,
      "iof_amount":115.62,
      "cet":0.1109,
      "annual_cet":2.5332,
      "disbursement_date":"2023-04-01",
      "installments":[
         {
            "calendar_days":30,
            "workdays":18,
            "business_due_date":"2023-05-02",
            "due_date":"2023-05-01",
            "due_principal":15230.07,
            "has_interest":true,
            "post_fixed_amount":0,
            "pre_fixed_amount":1578.66550979,
            "tax_amount":17.84384245,
            "total_amount":8832.26,
            "principal_amortization_amount":7253.59449021,
            "installment_number":1
         },
         {
            "calendar_days":31,
            "workdays":23,
            "business_due_date":"2023-06-01",
            "due_date":"2023-06-01",
            "due_principal":7976.47550979,
            "has_interest":true,
            "post_fixed_amount":0,
            "pre_fixed_amount":855.78449021,
            "tax_amount":39.8983305,
            "total_amount":8832.26,
            "principal_amortization_amount":7976.47550979,
            "installment_number":2
         }
      ],
      "external_contract_fees":[
         {
            "fee_type":"tac",
            "amount_type":"absolute",
            "amount":0,
            "fee_amount":0,
            "tax_amount":0,
            "net_fee_amount":0,
            "csll_amount":0,
            "irrf_amount":0,
            "pis_amount":0,
            "cofins_amount":0,
            "amount_released":0,
            "description":null
         }
      ],
      "contract_fee_amount":45.69,
      "external_contract_fee_amount":0,
      "net_external_contract_fee_amount":0,
      "contract_fees":[
         {
            "fee_type":"spread",
            "amount_type":"percentage",
            "amount":0.3,
            "fee_amount":45.69
         }
      ],
      "issue_amount":15230.07,
      "disbursed_issue_amount":15114.45,
      "assignment_amount":15275.76,
      "disbursement_options":[
         {
            "iof_amount":115.62,
            "total_pre_fixed_amount":2434.45,
            "cet":0.1109,
            "annual_cet":2.5332,
            "contract_fees":[
               {
                  "fee_type":"spread",
                  "amount_type":"percentage",
                  "amount":0.3,
                  "fee_amount":45.69
               }
            ],
            "external_contract_fees":[
               {
                  "fee_type":"tac",
                  "amount_type":"absolute",
                  "amount":0,
                  "fee_amount":0,
                  "tax_amount":0,
                  "net_fee_amount":0,
                  "csll_amount":0,
                  "irrf_amount":0,
                  "pis_amount":0,
                  "cofins_amount":0,
                  "amount_released":0,
                  "description":null
               }
            ],
            "contract_fee_amount":45.69,
            "external_contract_fee_amount":0,
            "net_external_contract_fee_amount":0,
            "disbursement_date":"2023-04-01",
            "first_due_date":"2023-05-01",
            "installments":[
               {
                  "calendar_days":30,
                  "workdays":18,
                  "business_due_date":"2023-05-02",
                  "due_date":"2023-05-01",
                  "due_principal":15230.07,
                  "has_interest":true,
                  "post_fixed_amount":0,
                  "pre_fixed_amount":1578.66550979,
                  "tax_amount":17.84384245,
                  "total_amount":8832.26,
                  "principal_amortization_amount":7253.59449021,
                  "installment_number":1
               },
               {
                  "calendar_days":31,
                  "workdays":23,
                  "business_due_date":"2023-06-01",
                  "due_date":"2023-06-01",
                  "due_principal":7976.47550979,
                  "has_interest":true,
                  "post_fixed_amount":0,
                  "pre_fixed_amount":855.78449021,
                  "tax_amount":39.8983305,
                  "total_amount":8832.26,
                  "principal_amortization_amount":7976.47550979,
                  "installment_number":2
               }
            ],
            "issue_amount":15230.07,
            "disbursed_issue_amount":15114.45,
            "assignment_amount":15275.76,
            "final_disbursement_amount":0,
            "prefixed_interest_rate":{
               "interest_base":"calendar_days_365",
               "annual_rate":2.32,
               "monthly_rate":0.1051676747,
               "daily_rate":0.0032929847
            },
            "refinanced_credit_operations":[
               {
                  "refinanced_credit_operation_key":"89b5c27e-b291-4414-abb0-f5f15c06c82b",
                  "refinanced_credit_operation_status":"pending_payment",
                  "due_balance":15114.45,
                  "due_balance_reference_date":"2023-04-01",
                  "original_deadline":61
               }
            ]
         }
      ]
   }
}
```

## Definitions (refinancing simulation)

### Request body
| Field | Type | Description |
|-------|------|-------------|
| **borrower** * | object | **[Borrower object](#objeto-borrower)** — Borrower of the simulated operation |
| **refinanced_credit_operations** * | array | **[Refinanced credit operations](#refinanced-credit-operations-object)** — Operations to refinance |
| **financial** * | object | **[Financial object](#objeto-financial)** — Terms of the new operation |

### Borrower object {#objeto-borrower}
| Field | Type | Description |
|-------|------|-------------|
| **person_type** | string | **[Person type](#enumerador-person_type)** — `natural` or `legal` |

### Financial object {#objeto-financial}
| Field | Type | Description |
|-------|------|-------------|
| **final_disbursement_amount** | float | Effective disbursement of the new operation (when not a cash payout to the borrower, sizing follows due balance of refinanced loan(s)—see §1 and §5). |
| **interest_type** | enum | **[Interest type](#enumerador-interest-type)** — Amortization and interest calculation |
| **credit_operation_type** | enum | **[Credit operation type](#enumerador-credit-operation-type)** — Agreement type (e.g. CCB) |
| **annual_interest_rate** | float | Annual prefixed interest rate (decimal) |
| **disbursement_date** | date | Disbursement date (`YYYY-MM-DD`) |
| **interest_grace_period** | int | Interest grace period (months) |
| **principal_grace_period** | int | Principal grace period (months) |
| **number_of_installments** | int | Number of installments |
| **fine_configuration** | object | **[Fine configuration object](#objeto-fine-configuration)** — Late interest and penalty |

### Refinanced credit operations object {#refinanced-credit-operations-object}

| Field | Type | Description |
|-------|------|-------------|
| **operation_key** | string (UUID) | Credit operation key to settle with this refinancing |

### Fine configuration object {#objeto-fine-configuration}
| Field                  | Type  | Description                                                                            | 
|------------------------|-------|--------------------------------------------------------------------------------------|
| **contract_fine_rate** | float | Late penalty rate as a decimal                                   |
| **interest_base**      | enum  | **[Interest base](#enumerador-interest-base)** — Interest calculation basis |
| **monthly_rate**       | float | Monthly late interest rate as a decimal                             |

## 6. Standard loan (normal flow) — POST /signed_debt {#standard-loan-post-signed-debt}

Standard issuance uses **`POST /signed_debt`** **without** **`refinanced_credit_operations`**. The **`financial`** object carries the disbursed principal via **`disbursed_amount`** (cash payout to the borrower). Field shapes for **`borrower`**, **`additional_data.contract`** (opt-in signatures), **`disbursement_bank_accounts`**, and other objects follow the same definitions as in **[§7. Creating a refinancing](#creating-a-refinancing)**—omit **`refinanced_credit_operations`** and use **`disbursed_amount`** instead of sizing from refinanced operations.

### Request

ENDPOINT /signed_debt
METHOD POST

Test in Playground

Request Body

```json
{
    "additional_data": {
        "contract": {
            "contract_number": null,
            "signed": true,
            "signatures": [
                {
                    "signer": {
                        "name": "Alan Mathison Turing",
                        "phone": {
                            "number": "912345678",
                            "area_code": "11",
                            "country_code": "055"
                        },
                        "email": "alan.turing@email.com",
                        "document_number": "96969879003"
                    },
                    "signature": {
                        "ip_address": "168.211.22.84",
                        "timestamp": "27-10-2025 11:07:15",
                        "signature_file": {
                            "file_url": "http://qitech.com.br/signature.pdf",
                            "file_type": "pdf"
                        },
                        "geolocation": {
                            "long": "-46.63611",
                            "lat": "-23.5475"
                        },
                        "fingerprint_device": null
                    }
                }
            ]
        }
    },
    "financial": {
        "number_of_installments": 2,
        "credit_operation_type": "ccb",
        "interest_type": "pre_price_days",
        "monthly_interest_rate": 0.07,
        "disbursed_amount": 150000,
        "fine_configuration": {
            "contract_fine_rate": 0.02,
            "monthly_rate": 0.15,
            "interest_base": "calendar_days"
        },
        "interest_grace_period": 0,
        "disbursement_date": "2026-04-11",
        "first_due_date": "2026-05-10",
        "principal_grace_period": 0
    },
    "purchaser_document_number": "32402502000135",
    "requester_identifier_key": null,
    "document_template_key": "518a0b57-2ce3-4309-94e5-6a95bc056d12",
    "borrower": {
        "email": "",
        "document_identification": "494598fd-c226-4332-a500-591ae3884673",
        "document_identification_back": "494598fd-c226-4332-a500-591ae3884673",
        "birth_date": "1998-06-03",
        "person_type": "natural",
        "is_pep": false,
        "mother_name": "Mother's full name",
        "profession": "Public server",
        "individual_document_number": "82744088021",
        "address": {
            "city": "São Paulo",
            "neighborhood": "CENTRO",
            "street": "Avenida Feliz",
            "complement": "",
            "postal_code": "49026100",
            "state": "SP",
            "number": ""
        },
        "phone": {
            "country_code": "055",
            "number": "912345678",
            "area_code": "11"
        },
        "document_identification_number": "47003534819",
        "name": "Alan Mathison Turing"
    },
    "disbursement_bank_accounts": [
        {
            "name": "NOME DEVEDOR",
            "bank_code": "001",
            "account_digit": "0",
            "branch_number": "2874",
            "account_number": "000057555",
            "document_number": "82744088021",
            "transfer_method": "pix",
            "percentage_receivable": 100
        }
    ]
}
```

### Response (HTTP 200)

The synchronous response echoes the request body with fields completed by the platform (for example **`contract.contract_number`** and **`requester_identifier_key`**).

STATUS 200

Response Body

```json
{
    "additional_data": {
        "contract": {
            "contract_number": "TEST7886216399",
            "signed": true,
            "signatures": [
                {
                    "signer": {
                        "name": "Alan Mathison Turing",
                        "phone": {
                            "number": "912345678",
                            "area_code": "11",
                            "country_code": "055"
                        },
                        "email": "alan.turing@email.com",
                        "document_number": "96969879003"
                    },
                    "signature": {
                        "ip_address": "168.211.22.84",
                        "timestamp": "27-10-2025 11:07:15",
                        "signature_file": {
                            "file_url": "http://qitech.com.br/signature.pdf",
                            "file_type": "pdf"
                        },
                        "geolocation": {
                            "long": "-46.63611",
                            "lat": "-23.5475"
                        },
                        "fingerprint_device": null
                    }
                }
            ]
        }
    },
    "financial": {
        "number_of_installments": 2,
        "credit_operation_type": "ccb",
        "interest_type": "pre_price_days",
        "monthly_interest_rate": 0.07,
        "disbursed_amount": 150000,
        "fine_configuration": {
            "contract_fine_rate": 0.02,
            "monthly_rate": 0.15,
            "interest_base": "calendar_days"
        },
        "interest_grace_period": 0,
        "disbursement_date": "2026-04-11",
        "first_due_date": "2026-05-10",
        "principal_grace_period": 0
    },
    "purchaser_document_number": "32402502000135",
    "requester_identifier_key": "2a55c1a76af4",
    "document_template_key": "518a0b57-2ce3-4309-94e5-6a95bc056d12",
    "borrower": {
        "email": "",
        "document_identification": "494598fd-c226-4332-a500-591ae3884673",
        "document_identification_back": "494598fd-c226-4332-a500-591ae3884673",
        "birth_date": "1998-06-03",
        "person_type": "natural",
        "is_pep": false,
        "mother_name": "Mother's full name",
        "profession": "Public server",
        "individual_document_number": "82744088021",
        "address": {
            "city": "São Paulo",
            "neighborhood": "CENTRO",
            "street": "Avenida Feliz",
            "complement": "",
            "postal_code": "49026100",
            "state": "SP",
            "number": ""
        },
        "phone": {
            "country_code": "055",
            "number": "912345678",
            "area_code": "11"
        },
        "document_identification_number": "47003534819",
        "name": "Alan Mathison Turing"
    },
    "disbursement_bank_accounts": [
        {
            "name": "NOME DEVEDOR",
            "bank_code": "001",
            "account_digit": "0",
            "branch_number": "2874",
            "account_number": "000057555",
            "document_number": "82744088021",
            "transfer_method": "pix",
            "percentage_receivable": 100
        }
    ]
}
```

Webhook body

```json
{
    "webhook_type": "debt",
    "key": "4e1ed268-9f29-44ce-9991-3bdf036aeacd",
    "status": "waiting_disbursement",
    "event_datetime": "2026-04-14 03:38:14",
    "data": {
        "borrower": {
            "name": "Alan Mathison Turing",
            "document_number": "82744088021",
            "related_party_key": "71b28fde-5d75-48b4-9c3f-ee531dccac66"
        },
        "contract": {
            "document_key": null,
            "number": "TEST7886216399",
            "urls": [],
            "signature_information": [
                {
                    "signer_name": "Alan Mathison Turing",
                    "signer_document_number": "82744088021",
                    "signer_role": "issuer",
                    "signer_email": null,
                    "signer_external_key": null,
                    "signature_url": null
                }
            ]
        },
        "requester_identifier_key": "2a55c1a76af4",
        "iof_charge_method": "financed",
        "collaterals": [],
        "contract_fees": [
            {
                "fee_type": "spread",
                "fee_amount": 453.39
            }
        ],
        "external_contract_fees": [
            {
                "fee_type": "tac",
                "fee_amount": 0,
                "tax_amount": 0,
                "net_fee_amount": 0
            }
        ],
        "external_contract_fee_amount": 0,
        "net_external_contract_fee_amount": 0,
        "contract_fee_amount": 453.39,
        "issue_amount": 151131.6,
        "assignment_amount": 151584.99,
        "cet": "7,6600%",
        "annual_cet": "142,4473%",
        "number_of_installments": 2,
        "base_iof": 557.3,
        "additional_iof": 574.3,
        "total_iof": 1131.6,
        "ipoc_code": "324025020203182744088021TEST7886216399",
        "prefixed_interest_rate": {
            "annual_rate": 1.252191589,
            "created_at": "2026-04-14T03:38:10",
            "daily_rate": 0.0022578334,
            "interest_base": "calendar_days",
            "monthly_rate": 0.07
        },
        "installments": [
            {
                "accrual_reference_date": null,
                "additional_costs": [],
                "advanced_paid_amount": 0,
                "bank_slip_key": null,
                "business_due_date": "2026-05-11",
                "calendar_days": 29,
                "digitable_line": null,
                "due_date": "2026-05-10",
                "due_interest": 0,
                "due_principal": 151131.6,
                "fine_amount": null,
                "has_interest": true,
                "installment_history": [],
                "installment_key": "c00dbecc-efb9-4384-8db3-dadba82f2d70",
                "installment_number": 1,
                "installment_payment": [],
                "installment_status": "created",
                "installment_type": "principal",
                "original_due_principal": 151131.6,
                "original_pre_fixed_amount": 10214.91484159,
                "original_principal_amortization_amount": 73277.28515841,
                "original_total_amount": 83492.2,
                "paid_amount": 0,
                "paid_at": null,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 10214.91484159,
                "principal_amortization_amount": 73277.28515841,
                "qr_code_key": null,
                "qr_code_url": null,
                "renegotiation_proposal_key": null,
                "tax_amount": 174.25338411,
                "total_accrual_amount": null,
                "total_amount": 83492.2,
                "total_paid_amount": 0,
                "workdays": 18
            },
            {
                "accrual_reference_date": null,
                "additional_costs": [],
                "advanced_paid_amount": 0,
                "bank_slip_key": null,
                "business_due_date": "2026-06-10",
                "calendar_days": 31,
                "digitable_line": null,
                "due_date": "2026-06-10",
                "due_interest": 0,
                "due_principal": 77854.31484159,
                "fine_amount": null,
                "has_interest": true,
                "installment_history": [],
                "installment_key": "d3a2f42d-80cb-4891-b2be-ce80ffd383b2",
                "installment_number": 2,
                "installment_payment": [],
                "installment_status": "created",
                "installment_type": "principal",
                "original_due_principal": 77854.31484159,
                "original_pre_fixed_amount": 5637.88515841,
                "original_principal_amortization_amount": 77854.31484159,
                "original_total_amount": 83492.2,
                "paid_amount": 0,
                "paid_at": null,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 5637.88515841,
                "principal_amortization_amount": 77854.31484159,
                "qr_code_key": null,
                "qr_code_url": null,
                "renegotiation_proposal_key": null,
                "tax_amount": 383.04322902,
                "total_accrual_amount": null,
                "total_amount": 83492.2,
                "total_paid_amount": 0,
                "workdays": 22
            }
        ],
        "total_pre_fixed_amount": 15852.8
    }
}
```

## 7. Creating a refinancing {#creating-a-refinancing}

### Request

ENDPOINT /signed_debt
METHOD POST

Request Body

```json
{
    "additional_data": {
        "contract": {
            "contract_number": "TEST00007890",
            "signed": true,
            "signatures": [
                {
                    "signer": {
                        "name": "Alan Mathison Turing",
                        "phone": {
                            "number": "912345678",
                            "area_code": "11",
                            "country_code": "055"
                        },
                        "email": "alan.turing@email.com",
                        "document_number": "96969879003"
                    },
                    "signature": {
                        "ip_address": "168.211.22.84",
                        "timestamp": "27-10-2025 11:07:15",
                        "signature_file": {
                            "file_url": "http://qitech.com.br/signature.pdf",
                            "file_type": "pdf"
                        },
                        "geolocation": {
                            "long": "-46.63611",
                            "lat": "-23.5475"
                        },
                        "fingerprint_device": null
                    }
                }
            ]
        }
    },
    "financial": {
        "number_of_installments": 2,
        "credit_operation_type": "ccb",
        "interest_type": "pre_price_days",
        "monthly_interest_rate": 0.07,
        "final_disbursement_amount": 0,
        "fine_configuration": {
            "contract_fine_rate": 0.02,
            "monthly_rate": 0.15,
            "interest_base": "calendar_days"
        },
        "interest_grace_period": 0,
        "disbursement_date": "2026-04-08",
        "first_due_date": "2026-05-08",
        "principal_grace_period": 0
    },
    "disbursement_bank_accounts": [
        {
            "account_digit": "5",
            "document_number": "32402502000135",
            "bank_code": "341",
            "account_number": "00002",
            "percentage_receivable": 100,
            "branch_number": "0001",
            "name": "Accout Name"
        }
    ],
    "purchaser_document_number": "32402502000135",
    "requester_identifier_key": "494598fd2009078709098",
    "refinanced_credit_operations": [
        {
            "operation_key": "067c421d-9ba1-4d4f-bf98-eb39dd12a5a5",
            "due_balance": 1000
        }
    ],
    "document_template_key": "518a0b57-2ce3-4309-94e5-6a95bc056d12",
    "borrower": {
        "email": "",
        "document_identification": "494598fd-c226-4332-a500-591ae3884673",
        "document_identification_back": "494598fd-c226-4332-a500-591ae3884673",
        "birth_date": "1998-06-03",
        "person_type": "natural",
        "is_pep": false,
        "mother_name": "Mother's full name",
        "profession": "Public server",
        "individual_document_number": "47003534819",
        "address": {
            "city": "São Paulo",
            "neighborhood": "CENTRO",
            "street": "Avenida Feliz",
            "complement": "",
            "postal_code": "49026100",
            "state": "SP",
            "number": ""
        },
        "phone": {
            "country_code": "055",
            "number": "912345678",
            "area_code": "11"
        },
        "document_identification_number": "47003534819",
        "name": "Alan Mathison Turing"
    }
}
```

:::caution Attention

Refinancing creation uses the same **`POST /signed_debt`** endpoint as **[§6. Standard loan (normal flow)](#standard-loan-post-signed-debt)**, with **`refinanced_credit_operations`** listing operations to settle. The example below also includes **`additional_data.contract`** (opt-in signatures) and **`disbursement_bank_accounts`**.
:::

### Body parameters

| Field                           | Type   | Description                                                                                                                                                                                                        | Max. chars | 
|---------------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| **additional_data** *            | object | Contract metadata and **signature** evidence under `additional_data.contract` (contract number, signed flag, `signatures[]` with signer and evidence). | -            |
| **borrower** *                  | object | **[Borrower object](#objeto-borrower)** — Borrower of the credit operation.                                                                                                                                         | -            | 
| **disbursement_bank_accounts** * | array | **[Disbursement bank account](#objeto-disbursement_bank_accounts)** — Account for disbursement                                                                               | -            |
| **financial** *                 | object | **[Financial object](#objeto-financial)** — Financial terms; use `"natural"` for `person_type` when applicable. | -            |
| **purchaser_document_number** * | string | Assignee (purchaser) CNPJ (digits only, no formatting).                                                                                                                                                           | -            |
| **requester_identifier_key** | string | Client tracking key for the request.                                                                                                                                                           | -            |
| **refinanced_credit_operations** * | array of objects | **[Refinanced credit operations](#objeto-refinanced_credit_operations)** — Operations to settle with this refinancing.                                                                                                                                                           | -            |

### Borrower object
| Field                            | Type    | Description                                                                             | Max. chars | 
|----------------------------------|---------|---------------------------------------------------------------------------------------|--------------|
| **name** *                       | string  | Borrower full name                                                                       | 100          |
| **email**                        | string  | Borrower email                                                                      | 254          |
| **phone**                        | object  | **[Phone object](#objeto-phone)** — Contact phone                    | -            | 
| **is_pep** *                     | boolean | PEP indicator (http://www.portaldatransparencia.gov.br/download-de-dados/pep)      | -            |
| **address** *                    | object  | **[Address object](#objeto-address)** — Borrower address                           | -            | 
| **role_type** *                  | enum    | Default: _issuer_                                                                     | -            |
| **birth_date** *                 | date    | Borrower birth date (`YYYY-MM-DD`)                                  | -            |
| **mother_name** *                | string  | Mother’s full name                                                                | 100          |
| **nationality**                  | string  | Nationality                                                              | 50           |
| **person_type** *                | string  | **[Person type](#enumerador-person_type)** — `natural` or `legal` (default: `natural` for individuals) | -            |
| **individual_document_number** * | string  | Borrower CPF (digits only)                                                       | 11           |
| **document_identification**     * | string  | **DOCUMENT_KEY** of the borrower’s photo ID PDF (RG or CNH) | -            |
| **document_identification_back** |string | **DOCUMENT_KEY** of the back of the photo ID (uploaded beforehand). | 11 |

### Address object {#objeto-address}
| Field              | Type   | Description                                                                | Max. chars | 
|--------------------|--------|--------------------------------------------------------------------------|--------------| 
| **city** *         | string | City                                                       | 100          |
| **state** *        | string | State (two uppercase letters)                      | 2            |
| **number** *       | string | Street number                                                       | 10           |
| **street** *       | string | Street name                                                          | 100          |
| **complement** *   | string | Address complement (free text)                                    | 100          |
| **postal_code** *  | string | Postal code (https://www.buscacep.correios.com.br/) | 8            |
| **neighborhood** * | string | Neighborhood                                                       | 100          |

### Phone object {#objeto-phone}
| Field              | Description | Example                                               | Max. chars | 
|--------------------|-----------|-------------------------------------------------------|--------------| 
| **number** *       | string    | Phone number                                    | 10           |
| **area_code** *    | string    | Area code (https://ddd.guiamais.com.br/) | 2            |
| **country_code** * | string    | Country code (https://ddi.guiamais.com.br/) | 3            |

### Disbursement bank account {#objeto-disbursement_bank_accounts}

Debt issuance must include bank details for disbursement; by default this is an account in the borrower’s name.

| Field                 | Type   | Description                                                                                          | Max. chars | 
|-----------------------|--------|----------------------------------------------------------------------------------------------------|--------------|
| name                  | string | Account holder name                                                                           | 50           |
| document_number       | string | Account holder CPF                                                                            | 11           |
| bank_code *           | string | COMPE bank code (https://www.bcb.gov.br/pom/spb/estatistica/port/ASTR003.pdf) | 3            |
| branch_number *       | string | Branch number (do not include branch check digit)                                  | 4            |
| account_number *      | string | Account number (without account check digit)                                               | 10           |
| account_digit *       | string | Account check digit (use zero instead of letters)                                     | 1            |
| account_type          | enum   | [Account type](#enumerador-account-type)                                  | 1            |

### Financial object {#objeto-financial}

The `financial` object describes the credit operation’s financial terms.

| Field                      | Type   | Description                                                                                                     | Max. chars |
|----------------------------|--------|---------------------------------------------------------------------------------------------------------------|--------------|
| **final_disbursement_amount** *     | float  | Effective disbursement of the credit operation (when not a cash payout to the borrower, sizing follows due balance of refinanced loan(s)—see §1 and §5).                                                                 | -            |
| **interest_type**          | enum | **[Interest type](#enumerador-interest-type)** — Amortization and interest calculation | -            |
| **credit_operation_type**  | enum | **[Credit operation type](#enumerador-credit-operation-type)** — Agreement type       | -            |
| **annual_interest_rate**   | float  | Annual prefixed interest rate as a decimal                                                           | -            |
| **disbursement_date**      | date   | Disbursement date                                                                                | -            |
| **interest_grace_period**  | int    | Interest grace period (months)                                                                                  | -            |
| **principal_grace_period** | int    | Principal grace period                                                                                 | -            |
| **number_of_installments** | int    | Number of installments                                                                     | -            |
| **fine_configuration**     | object | **[Fine configuration](#objeto-fine-configuration)** — Late interest and penalty        | -            |

### Fine configuration object

Fine configuration defines late penalty and interest for the credit operation.

| Field                  | Type  | Description                                                                            | Max. chars |
|------------------------|-------|--------------------------------------------------------------------------------------|--------------|
| **contract_fine_rate** | float | Late penalty rate                                                       | -            |
| **interest_base**      | enum  | **[Interest base](#enumerador-interest-base)** — Interest calculation basis | -            |
| **monthly_rate**       | float | Monthly late interest rate                                                 | -            |

### Refinanced credit operations {#objeto-refinanced_credit_operations}

| Field | Type | Description | Max. chars |
|---|---|---|---|
| `operation_key` * | string | Key of the operation to refinance | UUID |
| `due_balance` | number | Payoff amount of the operation to settle (optional, ≥ 0) | -    |

### Enumerators

#### Person type {#enumerador-person_type}
| Value             | Description             |
|------------------------|-----------------------|
| **legal**   | Legal entity        |
| **natural**    | Natural person    |

#### Account type {#enumerador-account-type}
| Value             | Description             |
|------------------------|-----------------------|
| **checking_account**   | Checking account        |
| **deposit_account**    | Deposit account     |
| **guaranteed_account** | Guaranteed account     |
| **investment_account** | Investment account |
| **payment_account**    | Payment account    |
| **saving_account**     | Savings account        |
| **salary_account**     | Salary account         |

#### Interest type {#enumerador-interest-type}
| Value           | Description                                                                                                                                                                |
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **pre_price_days**   | Price method (equal installments) with daily prefixed interest                                                                                     |
| **pre_price**        | Price method (equal installments) with prefixed interest in fixed 30-day periods                                                                |
| **pre_sac**          | SAC (constant amortization) with daily prefixed interest                                                                                 |
| **post_sac**         | SAC with prefixed rate plus post-fixed index (CDI, IPCA, or IGP-M), daily                                                                                  |
| **post_price**       | Price method with prefixed rate plus post-fixed index in fixed 30-day periods |
| **post_price_days**  | Price method with prefixed rate plus post-fixed index, daily                      |

#### Credit operation type {#enumerador-credit-operation-type}
| Value    | Description                      |
|---------------|--------------------------------|
| **ccb**       | Bank credit note (Cédula de Crédito Bancário)     |
| **cce**       | Export credit note |
| **cci**       | Real estate credit note  |
| **nce**       | Export credit note (alternative)   |

#### Interest base {#enumerador-interest-base}
| Value            | Description                                                                 |
|-----------------------|---------------------------------------------------------------------------|
| **workdays**          | Business days, 252-day year    |
| **calendar_days**     | Calendar days, 360-day year |
| **calendar_days_365** | Calendar days, 365-day year |

#### Fee type {#enumerador-fee-type}
Each fee type must be enabled and configured by QI Tech in advance.

| Value            | Description                                                                  |
|-----------------------|----------------------------------------------------------------------------|
| **tac**               | Account opening fee                                             |
| **spread**            | Premium on the credit operation acquisition amount                  |
| **warranty_analysis** | Collateral analysis fee                                             |
| **ted_fee**           | TED transfer fee                                                              |
| **spread_ted_fee**    | Premium on TED fee in the acquisition amount |

### Response

STATUS 200

Response Body

```json
{
    "webhook_type": "debt",
    "key": "f6c9c359-217a-475b-b2bc-540402d0c720",
    "status": "waiting_signature",
    "event_datetime": "2026-04-09 03:14:55",
    "data": {
        "borrower": {
            "name": "Alan Mathison Turing",
            "document_number": "47003534819",
            "related_party_key": "f606243a-6d6b-4de8-984e-0364fffe50cc"
        },
        "contract": {
            "document_key": "6f8ecbba-c7ed-482e-81f7-717a91b8c5cb",
            "number": "TEST00007890",
            "urls": [
                "https://storage.googleapis.com/sandbox-doc-api-private/documents/6f8ecbba-c7ed-482e-81f7-717a91b8c5cb/CASTELLOBNPL-ALAN_MATHISON_TURING-CCB0260409031449.pdf"
            ],
            "signature_information": [
                {
                    "signer_name": "Alan Mathison Turing",
                    "signer_document_number": "47003534819",
                    "signer_role": "issuer",
                    "signer_email": null,
                    "signer_external_key": null,
                    "signature_url": null
                }
            ]
        },
        "requester_identifier_key": "494598fd2009078709098",
        "iof_charge_method": "financed",
        "collaterals": [],
        "contract_fees": [
            {
                "fee_type": "spread",
                "fee_amount": 30.46
            },
            {
                "fee_type": "spread_refinancing",
                "fee_amount": 30.23
            }
        ],
        "external_contract_fees": [
            {
                "fee_type": "tac",
                "fee_amount": 0,
                "tax_amount": 0,
                "net_fee_amount": 0
            }
        ],
        "external_contract_fee_amount": 0,
        "net_external_contract_fee_amount": 0,
        "contract_fee_amount": 60.69,
        "issue_amount": 10153.18,
        "assignment_amount": 10213.87,
        "cet": "7,6500%",
        "annual_cet": "142,2787%",
        "number_of_installments": 2,
        "base_iof": 38.3,
        "additional_iof": 38.58,
        "total_iof": 76.88,
        "ipoc_code": "324025020203147003534819TEST00007890",
        "prefixed_interest_rate": {
            "annual_rate": 1.252191589,
            "created_at": "2026-04-09T03:14:49",
            "daily_rate": 0.0022578334,
            "interest_base": "calendar_days",
            "monthly_rate": 0.07
        },
        "installments": [
            {
                "accrual_reference_date": null,
                "additional_costs": [],
                "advanced_paid_amount": 0,
                "bank_slip_key": null,
                "business_due_date": "2026-05-08",
                "calendar_days": 30,
                "digitable_line": null,
                "due_date": "2026-05-08",
                "due_interest": 0,
                "due_principal": 10153.18,
                "fine_amount": null,
                "has_interest": true,
                "installment_history": [],
                "installment_key": "5359d7b1-8952-42e4-89bd-7fc57ac304aa",
                "installment_number": 1,
                "installment_payment": [],
                "installment_status": "created",
                "installment_type": "principal",
                "original_due_principal": 10153.18,
                "original_pre_fixed_amount": 710.7240611,
                "original_principal_amortization_amount": 4911.0359389,
                "original_total_amount": 5621.76,
                "paid_amount": 0,
                "paid_at": null,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 710.7240611,
                "principal_amortization_amount": 4911.0359389,
                "qr_code_key": null,
                "qr_code_url": null,
                "renegotiation_proposal_key": null,
                "tax_amount": 12.08114841,
                "total_accrual_amount": null,
                "total_amount": 5621.76,
                "total_paid_amount": 0,
                "workdays": 20
            },
            {
                "accrual_reference_date": null,
                "additional_costs": [],
                "advanced_paid_amount": 0,
                "bank_slip_key": null,
                "business_due_date": "2026-06-08",
                "calendar_days": 31,
                "digitable_line": null,
                "due_date": "2026-06-08",
                "due_interest": 0,
                "due_principal": 5242.1440611,
                "fine_amount": null,
                "has_interest": true,
                "installment_history": [],
                "installment_key": "02ad962c-22b7-49ab-bdb3-99f30758a254",
                "installment_number": 2,
                "installment_payment": [],
                "installment_status": "created",
                "installment_type": "principal",
                "original_due_principal": 5242.1440611,
                "original_pre_fixed_amount": 379.6159389,
                "original_principal_amortization_amount": 5242.1440611,
                "original_total_amount": 5621.76,
                "paid_amount": 0,
                "paid_at": null,
                "post_fixed_amount": 0,
                "pre_fixed_amount": 379.6159389,
                "principal_amortization_amount": 5242.1440611,
                "qr_code_key": null,
                "qr_code_url": null,
                "renegotiation_proposal_key": null,
                "tax_amount": 26.22120459,
                "total_accrual_amount": null,
                "total_amount": 5621.76,
                "total_paid_amount": 0,
                "workdays": 20
            }
        ],
        "total_pre_fixed_amount": 1090.34
    }
}
```

STATUS 400

Response Body

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

## 8. Technical Specifications and Enums

### Fees Object
| Field           | Type  | Description                                                                                           |
|-----------------|-------|-----------------------------------------------------------------------------------------------------|
| **amount**      | float | Fee amount (in percentage or absolute value, depending on the value provided in the amount_type field)| -            |
| **amount_type** | enum  | Fee value unit                   |  **[Amount Type Enumerator](#amount-type-enumerator)**             |
| **fee_amount**  | float | Absolute value of the fee charged in the operation                                                           | -            |
| **fee_type**    | string  | Type of fee charged in the operation                   | **[Fee Type Enumerator](#fee-type-enumerator)**          |
| **type**        | string  |  Source of the fee charged in the operation                         | **[Origin Type Enumerator](#origin-type-enumerator)**          |

### Installments Object
| Field                             | Type    | Description                                                                      | 
|-----------------------------------|---------|--------------------------------------------------------------------------------|
| **calendar_days**                 | integer    | Number of calendar days between installments                                | -            |
| **due_date**                      | string    | Installment due date in calendar days                                   | -            |
| **due_principal**                 | float   | Remaining principal on the installment due date before its payment | -            |
| **has_interest**                  | boolean | _true_ - If true, interest applies to the installment                           | -            |
| **installment_number**            | integer    | Installment number                                                              | -            |
| **prefixed_amount**               | float   | Fixed interest amount paid on the installment                                      | -            |
| **principal_amortization_amount** | float   | Principal amount paid on the installment                                           | -            |
| **tax_amount**                    | float   | Base IOF amount of installment                                                            | -            |
| **amount**                        | float   | Installment total value                                                         | -            |
| **due_interest**                  | float     | Remaining interest after the installment due date before its payment                                   | -            |
| **period**                        | float     | Installment period | -            |
| **period_workdays**               | float     | Installment period in business days | -            |
| **period_to_disbursement**        | float     | Period until disbursement | -            |
| **period_workdays_to_disbursement**| float     | Business days until disbursement | -            |
| **calendar_days_to_disbursement** | integer    | Calendar days to disbursement | -            |
| **workdays**                      | integer    | Business days between installments | -            |
| **workdays_to_disbursement**      | integer    | Business days until disbursement | -            |

### Interest Rate Object
| Field             | Description                                                                             | 
|-------------------|---------------------------------------------------------------------------------------|
| **annual_rate**   | Annual fixed/floating interest rate expressed as a decimal                                      | -            |
| **daily_rate**    | Daily fixed/floating interest rate expressed as a decimal                                      | -            |
| **interest_base** | **[Interest Base Enumerator](#interest-base-enumerator)** - Interest calculation basis  | -            |
| **monthly_rate**  | Monthly fixed/floating interest rate expressed as a decimal                                      | -            |

### Tax Configuration Object
| Field                 | Description                                                                             | 
|-----------------------|---------------------------------------------------------------------------------------|
| **base_rate**         | Base IOF rate value                                                                | -            |
| **additional_rate**   | Additional IOF rate value                                                           | -            |

### Enumeratores

### Person Type Enumerator
| Enumerator             | Description             |
|------------------------|-----------------------|
| **legal**              | Legal person       |
| **natural**            | Natural person          |

### Account Type Enumerator
| Enumerator             | Description             |
|------------------------|-----------------------|
| **checking_account**   | Checking account        |

### Amount Type Enumerator
| Enumerator             | Description             |
|------------------------|-----------------------|
| **absolute**           | Absolute value        |
| **percentage**         | Percentage value      |

###  Interest Type Enumerator
| Enumerator           | Description                                                                                                                                                                |
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **pre_price_days**   | Price amortization method (equal installments) with daily fixed-rate interest calculation                                                                                     |
| **pre_price**        | Price amortization method (equal installments) with fixed-rate interest calculation over 30-day periods                                                                |

### Credit Operation Type Enumerator 
| Enumerator    | Description                      |
|---------------|--------------------------------|
| **ccb**       | Bank Credit Note    |

### Interest Base Enumerator 
| Enumerator            | Description                                                                 |
|-----------------------|---------------------------------------------------------------------------|
| **workdays**          | Interest calculation basis in business days, assuming a 252-day year    |
| **calendar_days**     | Interest calculation basis in calendar days, assuming a 360-day year |
| **calendar_days_365** | Interest calculation basis in calendar days, assuming a 365-day year |

###  Fee Type Enumerator
Each fee type must be previously enabled and configured by QI Tech

| Enumerator            | Description                                                                  |
|-----------------------|----------------------------------------------------------------------------|
| **spread**            | Premium included in the credit operation's acquisition value                  |
| **spread_ted_fee**    | Premium on the TED transfer fee |

### Origin Type Enumerator
Each fee type must be previously enabled and configured by QI Tech

| Enumerator            | Description                                                                  |
|-----------------------|----------------------------------------------------------------------------|
| **internal**          | Internal fee                                                   |
| **external**          | External fee                                                   |

## 9. Webhooks — batch renegotiation

These events notify your systems when a **batch** renegotiation proposal (created via **`POST /renegotiation/batch_proposal`**) reaches a relevant lifecycle state—for example after **payment** (`status`: **`paid`**) or when the proposal is **rejected** (`status`: **`rejected`**).

### `webhook_type`: `renegotiation.batch_proposal`

Use this payload to reconcile **`batch_proposal_status`**, payment method, and amounts with your internal records for the **`request_control_key`** / **`batch_proposal_key`** you track from creation.

:::caution Attention

A **batch** renegotiation proposal may move to **`rejected`** when the **payment window expires** without settlement, or when an **installment is paid outside** the batch renegotiation (invalidating the proposal). Treat **`status`** accordingly and use **`key`** as **`batch_proposal_key`**.

:::

Example payload (status: paid )

```json
{
    "key": "217bf9ba-65e0-4416-8f5e-ef423d72b23c",
    "data": {
        "paid_in": {
            "ispb": "32402502",
            "name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
            "code_number": 329
        },
        "paid_method_type": "pix"
    },
    "status": "paid",
    "webhook_type": "renegotiation.batch_proposal",
    "event_datetime": "2025-09-30 13:42:58"
}
```

Example payload (status: rejected )

```json
{
    "key": "217bf9ba-65e0-4416-8f5e-ef423d72b23c",
    "data": {},
    "status": "rejected",
    "webhook_type": "renegotiation.batch_proposal",
    "event_datetime": "2025-09-30 13:42:58"
}
```

## 10. API error codes — renegotiation (reference)

The following **`code`** values may appear in error responses from renegotiation-related endpoints (batch proposal, single proposal, etc.), aligned with the service exception classes below. **`title`** and **`http_status`** follow each class; **`description`** and **`translation`** are the English and Portuguese messages returned by the API.

### General (`QIT*`)

| Code | HTTP | Exception class | Description (EN) | Translation (PT) |
|---|---|---|---|---|
| `QIT000001` | 400 | `InvalidSchema` | Payload validation message (variable). | Payload Inválido |
| `QIT000002` | 403 | `ForbiddenNotMaster` | You are not allowed to perform this action at this endpoint. | Você não está autorizado a performar esta ação neste endpoint. |
| `QIT000003` | 403 | `ForbiddenInexistentRequester` | This service cannot process requests without a 'SELECTED-AGENT' | Esse serviço não pode processar requisições sem o Header 'SELECTED-AGENT' |
| `QIT000004` | 403 | `ForbiddenNotInternal` | Request must be internal | Requisição precisa ser interna |
| `QIT000005` | 403 | `ForbiddenSelectedAgentNotTheSameAsPersonKey` | Selected agent and person key are different. | Agente da operação é diferente da chave do usuário. |
| `QIT000404` | 404 | `NotFoundResource` | The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible. | O resource solicitado não podee ser encontrado, mas pode estar disponível no futuro. Requests subsequentes do cliente são permitidos. |

### Renegotiation (`RN*`)

| Code | HTTP | Exception class | Description (EN) | Translation (PT) |
|---|---|---|---|---|
| `RN0000001` | 400 | `InvalidOperationStatus` | Credit operation status is invalid for this request. Status: `{status}` | O status dessa operação de crédito é invalido para essa requisição. Status: `{status}` |
| `RN0000002` | 400 | `InvalidInstallmentStatus` | Installment status is invalid for this request. Installment key: `{installment_key}` | O status dessa parcela é invalido para essa requisição. Installment key: `{installment_key}` |
| `RN0000003` | 404 | `InstallmentNotFound` | No installment found for received installment keys. | Nenhuma parcela encontrada para as installment keys recebidas. |
| `RN0000004` | 400 | `PercentageDiscountField` | The percentage discount amount must be less than or equal to 1. | O valor do desconto percentual deve ser menor ou igual a 1. |
| `RN0000005` | 400 | `DiscountValue` | The discount amount cannot be greater than the the installments values. | O valor do desconto não pode ser maior do que o valor das parcelas. |
| `RN0000006` | 400 | `DuplicateInstallmentKey` | The same installment key was informed more than once. Installment Key: `{installment_key}` | A mesma installment_key foi informada mais de uma vez. Installment Key: `{installment_key}` |
| `RN0000007` | 400 | `PaidAmount` | Installment doesn't have paid_amount field. Installment_key: `{installment_key}` | Parcela não possui campo paid_amount. Installment_key: `{installment_key}` |
| `RN0000008` | 400 | `ProposalWithoutPayment` | Proposal must have a payment linked to it. | A proposta deve ter um pagamento vinculado a ela. |
| `RN0000009` | 403 | `ForbiddenInvalidRequester` | The requester informed is not the same as the credit operation. | O solicitante informado não é o mesmo da operação de crédito. |
| `RN0000010` | 404 | `ProposalNotFound` | Proposal not found. | Proposta não encontrada. |
| `RN0000011` | 400 | `ProposalNotCancelable` | Proposal cannot be canceled in current status. Status: `{status}` | Proposta não pode ser cancelada no status atual. Status: `{status}` |
| `RN0000012` | 404 | `NotFoundCreditOperation` | Credit Operation not found for sent contract number. | Operação de credito não encontrada pelo número de contrato enviado. |
| `RN0000013` | 404 | `NotFoundPaymentEngine` | The payment engine has not been found. | O mecanismo de pagamento não foi encontrado. |
| `RN0000014` | 404 | `NotFoundRequesterProfile` | The requester profile has not been found. | O perfil de solicitante não foi encontrado. |
| `RN0000015` | 400 | `InvalidDate` | Proposal due date or reference date cannot be in past. | A data de vencimento da renegociação ou a data de referência não podem estar no passado. |
| `RN0000016` | 404 | `NotFoundRequesterConfiguration` | The requester configuration has not been found. | A configuração de solicitante não foi encontrada. |
| `RN0000017` | 400 | `CannotBePaid` | The proposal cannot be paid in current status. Proposal Status: `{status}` | A renegociação não pode ser paga no status atual. Proposal Status: `{status}` |
| `RN0000018` | 400 | `BankSlipRegistrationRejected` | The bank slip registration has been rejected. | O registro do boleto bancário foi rejeitado. |
| `RN0000019` | 409 | `SimilarProposalExists` | This contract is already linked to another proposal in progress. | Esse contrato ja está vinculado a outra proposta em andamento. |
| `RN0000020` | 400 | `InvalidRenegotiation` | Renegotiation request invalid due to credit operation status. | A requisição de renegociação é inválida devido ao status da operação de crédito. |
| `RN0000021` | 400 | `RenegotiationOperationNumber` | Number of operations is greater than the maximum allowed. Maximum operations allowed: `{maximum_operations}` | Número de operações é maior que o máximo permitido. Máximo de operações permitidas: `{maximum_operations}` |
| `RN0000022` | 400 | `DifferentIssuersBatchRenegotiation` | It is not possible to carry out a batch renegotiation with different issuers. | Não é possível realizar uma renegociação em lote com emissores diferentes. |
| `RN0000024` | 404 | `BatchProposalNotFound` | Batch proposal not found. | Batch proposal não encontrada. |
| `RN0000025` | 400 | `BatchProposalNotCancelable` | Batch Proposal cannot be canceled in current status. Status: `{status}` | Proposta em lote não pode ser cancelada no status atual. Status: `{status}` |
| `RN0000026` | 400 | `DuplicatedBatchProposalRequesterIdentifierKey` | Requester identifier key is already been used for another batch proposal. | Requester identifier key ja está sendo utilizada para outra proposta em lote. |
| `RN0000027` | 400 | `DiscountValueBatchProposal` | The discount amount cannot be greater than the batch proposal payment amount: `{payment_amount}`. | O valor do desconto não pode ser maior do que o valor de pagamento da renegociação em lote: `{payment_amount}`. |
| `RN0000028` | 400 | `InvalidInstallmentsForCollateralRenegotiation` | Selected Installments for renegotiation must include the latest due dates. | As parcelas selecionadas para renegociação devem incluir as últimas datas de vencimento. |
| `RN0000029` | 400 | `InvalidAmortizationTypeForCollateralRenegotiation` | Amortization Type of collateral renegotiation must be Installment Payment. | O tipo de amortização para a renegociação com colateral deve ser pagamento de parcelas. |
| `RN0000030` | 400 | `InvalidDisbursementAmountPayload` | Discount amount field can't be informed for batch proposal and operations in same request. | O campo de valor de desconto não pode ser informado para a batch proposal e para as operações na mesma requisição. |
| `RN0000031` | 400 | `InstallmentAmountZero` | Installment payment amount can't be 0. Installment_key: `{installment_key}` | Valor de pagamento da parcela não pode ser 0. Installment_key: `{installment_key}` |
| `RN0000032` | 400 | `PaymentAmountGreaterThanDisbursement` | Payment amount cannot be greater than the disbursement amount. | O valor do pagamento não pode ser maior que o valor de desembolso. |
| `RN0000033` | 400 | `PaymentAmountNotRequired` | Payment amount is not required for present amount amortization type. | O valor do pagamento não é necessário para o tipo de amortização presente. |
| `RN0000034` | 400 | `DuplicatedProposalRequesterIdentifierKey` | Requester identifier key is already been used for another proposal. | Requester identifier key ja está sendo utilizada para outra proposta. |
| `RN0000035` | 400 | `InvalidDiscountAmountOnlyInterestDiscount` | Invalid discount amount. Discount amount must be only interest discount. | O valor do desconto é invalido. O valor do desconto deve ser apenas desconto de juros. |
| `RN0000036` | 500 | `MaxRetriesTooBig` | Max retries set is too big to be executable. | Número máximo de retentativas é muito grande. |
| `RN0000037` | 400 | `InvalidEmployerDocumentForCreditOperation` | The payer document number does not match the employer document for the credit operation. | O documento do pagador não corresponde ao documento do empregador para a operação de crédito. |
| `RN0000038` | 400 | `RenegotiationAmortizationErrors` | One or more operations failed. | Uma ou mais operacoes falharam. |

Placeholder tokens such as `{status}` or `{installment_key}` reflect dynamic segments in the actual **`description`** / **`translation`** strings returned by the API.

---

# APP Integration

URL: /en/documentation/roteiros_laas/roteiro_e7030e18-a9c7-452b-8236-1cf8edfb4de9

## Summary

This guide describes how to issue a debt (credit operation) for a natural person through the BNPL / e-commerce flow using the POST /signed_debt endpoint.

This flow supports QR Code payments, allowing you to collect the required disbursement information directly from the QR Code, including the beneficiary's document number, account number, account digit, branch number, and the disbursement amount.

A natural-person issuance represents a standard loan. In this scenario:

- The `financial.disbursed_amount` field specifies the principal amount to be disbursed to the borrower. It **must equal** the amount registered in the Pix QR Code informed in `disbursement_bank_accounts`.
- `borrower.person_type` must be set to `natural`.
- The `refinanced_credit_operations` field must not be provided.

The structure of the borrower, additional_data.contract (opt-in signatures), disbursement_bank_accounts, and the remaining request objects is described in the following sections.

:::caution disbursed_amount must equal the QR Code amount
The cash payout (`financial.disbursed_amount`) **must be equal to the amount registered in the Pix QR Code**. Decode the QR Code first using **`POST /pix/decode_qrcode_payload`** (step 1) to retrieve the amount, then use that value as `disbursed_amount` on the debt issuance.
:::

## 1. QR Code decoding

### Request

ENDPOINT pix/decode_qrcode_payload
METHOD POST

Test in Playground

### Request Body

```json
{
   "qr_code_payload": "00020101021226850014br.gov.bcb.pix2563qrcodepix.bb.com.br/pix/v2/d373e385-dfe7-49f6-b9ec-14ba60a9b8285204000053039865802BR5925TESTE62070503***63047B7D"
}
```

| Field | Type | Description | Max length |
|---|---|---|---|
| `qr_code_payload` * | string | EMV payload of the Pix QR Code (copy-and-paste). | 340 |

### Response Body

The response returns the decoded fields under a nested `qr_code_data` object. The content varies by QR Code type — select the matching tab.

**static**

```json
{
   "qr_code_type": "static",
   "qr_code_payload": "00020126580014br.gov.bcb.pix0136a23bf0e9-5175-4829-bf89-e8fe6ac09aa1520400005303986540530.005802BR5914TywinLannister6008saopaulo62070503***6304D4FD",
   "qr_code_data": {
      "target_pix_key": "a23bf0e9-5175-4829-bf89-e8fe6ac09aa1",
      "amount": "30.00",
      "receiver_conciliation_id": "***",
      "additional_data": [],
      "category_code": "0000",
      "city": "saopaulo",
      "postal_code": null,
      "reusable_qrcode": "no"
   }
}
```

:::info Static QR Code — unavailable fields
Per the BR Code specification, static QR Codes do **not** carry expected payer data, expiration date, fines, interest, discounts, or reductions. Those fields exist only on dynamic QR Codes.

Also, `qr_code_data.amount` may come as `null` on static QR Codes when the merchant issued an "open-amount" QR — the payer defines the value at payment time.
:::

**dynamic_instant**

```json
{
   "qr_code_type": "dynamic_instant",
   "qr_code_payload": "00020101021226850014br.gov.bcb.pix2563qrcodepix.bb.com.br/pix/v2/d373e385-dfe7-49f6-b9ec-14ba60a9b8285204000053039865802BR5925TESTE62070503***63047B7D",
   "qr_code_data": {
      "target_pix_key": "teste.cobrancapix@gmail.com.br",
      "receiver_conciliation_id": "fgnb4NTt7pOUBGfrcporERwVVqr0f8PWRfK",
      "amount": "9367.61",
      "can_change": "no",
      "expiration_seconds": 201574,
      "created_at": "2023-03-13T19:00:28.440Z",
      "presented_at": "2023-03-14T19:07:48.729Z",
      "question_to_payer": "Liquidacao de Parcelas",
      "status": "ATIVA",
      "revision": 0,
      "category_code": "0000",
      "city": "RIO DE JANEIRO",
      "postal_code": null,
      "reusable_qrcode": "no",
      "receiver_url": "qrcodepix.bb.com.br/pix/v2/d373e385-dfe7-49f6-b9ec-14ba60a90000",
      "additional_data": [],
      "payer_name": "ISMAEL FATIMA AMARAL",
      "payer_document_number": "10003550206",
      "payer_person_type": "natural",
      "target_name": "TESTE LTDA."
   }
}
```

:::info Expiration — `dynamic_instant`
Instant dynamic QR Codes expire `expiration_seconds` seconds after `created_at`. To obtain the exact expiration moment, compute it client-side: `created_at + expiration_seconds`.
:::

**dynamic_term**

```json
{
   "qr_code_type": "dynamic_term",
   "qr_code_payload": "00020101021226840014br.gov.bcb.pix2562invoice.starkbank.com/v2/cobv/8b434df48c30482a81f7c936ae35cc123456000053039865802BR5925Oncred Sociedade de Credi6015TESTE 62070503***6304D008",
   "qr_code_data": {
      "target_pix_key": "e623e7b0-d00a-400e-aee6-79632430e817",
      "receiver_conciliation_id": "8b434df48c30482a81f7c936ae35cc87",
      "original_amount": "55.59",
      "reduction_amount": null,
      "discount_amount": null,
      "fee_amount": null,
      "fine_amount": null,
      "amount": "55.59",
      "due_date": "2023-03-27",
      "days_after_due_accepted": 16,
      "created_at": "2023-01-10T19:49:58.30Z",
      "presented_at": "2023-03-10T15:32:15.87Z",
      "question_to_payer": null,
      "status": "ATIVA",
      "revision": 0,
      "category_code": "0000",
      "reusable_qrcode": "no",
      "receiver_url": "invoice.starkbank.com/v2/cobv/8b434df48c30482a81f7c936ae351234",
      "additional_data": [],
      "payer_name": "Willian Rocha",
      "payer_document_number": "00000000000",
      "payer_person_type": "natural",
      "target_name": "TESTE LTDA.",
      "target_trading_name": null,
      "address": "Rua Tapajos, 941",
      "state": "SP",
      "city": "Sao Caetano do Sul",
      "postal_code": "09551230"
   }
}
```

:::info Expiration — `dynamic_term`
Term-based charges accept payment until `due_date + days_after_due_accepted` calendar days. In the example above, with `due_date: 2023-03-27` and `days_after_due_accepted: 16`, payment is accepted until `2023-04-12`.

`amount` is the **final amount to be paid** (already including `fine_amount`, `fee_amount`, `discount_amount`, and `reduction_amount`). Use `original_amount` for the base value.
:::

#### Response fields

| Field | Type | Description | Present in |
|---|---|---|---|
| `qr_code_type` | string | QR Code type: `static`, `dynamic_instant`, or `dynamic_term`. | All |
| `qr_code_payload` | string | Original EMV payload sent in the request. | All |
| `qr_code_data.target_pix_key` | string | Recipient's Pix key. | All |
| `qr_code_data.amount` | string/decimal | Charge amount. In `dynamic_term`, the final amount (after fine/interest/discount/reduction). In `static`, may be `null`. | All |
| `qr_code_data.receiver_conciliation_id` | string | Recipient's reconciliation identifier (txid). | All |
| `qr_code_data.additional_data` | array | List of additional information `{name, value}`. | All |
| `qr_code_data.category_code` | string | Merchant category code (MCC). | All |
| `qr_code_data.city` | string | Recipient's city. | All |
| `qr_code_data.postal_code` | string | Recipient's postal code. | All |
| `qr_code_data.reusable_qrcode` | string | `yes` if the QR can be paid multiple times, `no` otherwise. | All |
| `qr_code_data.receiver_url` | string | Recipient PSP URL (`loc` field of the BR Code). | `dynamic_*` |
| `qr_code_data.status` | string | Charge status — see enumerators below. | `dynamic_*` |
| `qr_code_data.revision` | integer | Current charge version. | `dynamic_*` |
| `qr_code_data.created_at` | string ISO | Charge creation date at the recipient PSP. | `dynamic_*` |
| `qr_code_data.presented_at` | string ISO | Charge presentation date to the payer. | `dynamic_*` |
| `qr_code_data.question_to_payer` | string | Message from recipient to the payer (`solicitacaoPagador`). | `dynamic_*` |
| `qr_code_data.payer_name` | string | Expected payer's name, when informed by the recipient. | `dynamic_*` |
| `qr_code_data.payer_document_number` | string | Expected payer's CPF/CNPJ. | `dynamic_*` |
| `qr_code_data.payer_person_type` | string | `natural` or `legal`. | `dynamic_*` |
| `qr_code_data.target_name` | string | Recipient's name. | `dynamic_*` |
| `qr_code_data.expiration_seconds` | integer | QR validity in seconds from `created_at`. | `dynamic_instant` |
| `qr_code_data.can_change` | string | `yes` if the payer can change the amount, `no` otherwise. | `dynamic_instant` |
| `qr_code_data.original_amount` | string/decimal | Original charge amount before fine/interest/discount. | `dynamic_term` |
| `qr_code_data.due_date` | string (date) | Charge due date. | `dynamic_term` |
| `qr_code_data.days_after_due_accepted` | integer | Days after due date during which payment is still accepted. | `dynamic_term` |
| `qr_code_data.fine_amount` | string/decimal | Fine applied after the due date. | `dynamic_term` |
| `qr_code_data.fee_amount` | string/decimal | Interest applied after the due date. | `dynamic_term` |
| `qr_code_data.discount_amount` | string/decimal | Discount granted before the due date. | `dynamic_term` |
| `qr_code_data.reduction_amount` | string/decimal | Reduction applied to the charge. | `dynamic_term` |
| `qr_code_data.target_trading_name` | string | Recipient's trade name. | `dynamic_term` |
| `qr_code_data.address` | string | Recipient's street address. | `dynamic_term` |
| `qr_code_data.state` | string | Recipient's state. | `dynamic_term` |

#### Status enumerators (dynamic QR Code)

| Value | Description |
|---|---|
| `ATIVA` | Charge available, no payment yet. |
| `CONCLUIDA` | Charge paid and finalized. |
| `REMOVIDA_PELO_USUARIO_RECEBEDOR` | Removed by the recipient user. |
| `REMOVIDA_PELO_PSP` | Removed by the recipient bank. |

### Errors

QR Code with invalid format

```json
{
  "data": "{\"title\": \"Invalid Qr Code Format\", \"description\": \"The Qr Code format is invalid, please enter a valid Qr Code\", \"translation\": \"O formato do Qr Code é inválido, por favor insira um Qr Code válido\", \"extra_fields\": {}, \"code\": \"PXT000070\"}"
}
```

QR Code type not identified in payload

```json
{
  "data": "{\"title\": \"Invalid Qr Code Type\", \"description\": \"The Qr Code payload given did not provide a propper Qr Code type\", \"translation\": \"O payload de QR Code fornecido não contêm um tipo de Qr Code Válido\", \"extra_fields\": {}, \"code\": \"PXT000071\"}"
}
```

Error requesting QR Code payload from the registry institution

```json
{
  "data": "{\"title\": \"Error in Qr Code Payload Request\", \"description\": \"An error occurred while requesting the qr code payload to the registry institution\", \"translation\": \"Um erro ocorreu durante a requisição do payload do qr code para a instituição de registro\", \"extra_fields\": {}, \"code\": \"PXT000069\"}"
}
```

## 2. Debt issuance

### Request

ENDPOINT /signed_debt
METHOD POST

Test in Playground

### Request Body

```json
{
   "additional_data": {
      "contract": {
         "contract_number": null,
         "signed": true,
         "signatures": [
            {
               "signer": {
                  "name": "Alan Mathison Turing",
                  "phone": {
                     "number": "912345678",
                     "area_code": "11",
                     "country_code": "055"
                  },
                  "email": "alan.turing@email.com",
                  "document_number": "96969879003"
               },
               "signature": {
                  "ip_address": "168.211.22.84",
                  "timestamp": "27-10-2025 11:07:15",
                  "signature_file": {
                     "file_url": "http://qitech.com.br/signature.pdf",
                     "file_type": "pdf"
                  },
                  "geolocation": {
                     "long": "-46.63611",
                     "lat": "-23.5475"
                  },
                  "fingerprint_device": null
               }
            }
         ]
      }
   },
   "financial": {
      "number_of_installments": 2,
      "credit_operation_type": "ccb",
      "interest_type": "pre_price_days",
      "monthly_interest_rate": 0.07,
      "disbursed_amount": 150000,
      "fine_configuration": {
         "contract_fine_rate": 0.02,
         "monthly_rate": 0.15,
         "interest_base": "calendar_days"
      },
      "interest_grace_period": 0,
      "disbursement_date": "2026-04-11",
      "first_due_date": "2026-05-10",
      "principal_grace_period": 0
   },
   "purchaser_document_number": "32402502000135",
   "requester_identifier_key": "40822732-c4ce-41fb-9ee5-5e0304cd04a7",
   "document_template_key": "518a0b57-2ce3-4309-94e5-6a95bc056d12",
   "borrower": {
      "email": "alan.turing@email.com",
      "document_identification": "494598fd-c226-4332-a500-591ae3884673",
      "document_identification_back": "494598fd-c226-4332-a500-591ae3884673",
      "birth_date": "1998-06-03",
      "person_type": "natural",
      "is_pep": false,
      "mother_name": "Mother's full name",
      "profession": "Public server",
      "individual_document_number": "82744088021",
      "address": {
         "city": "São Paulo",
         "neighborhood": "CENTRO",
         "street": "Avenida Feliz",
         "complement": "",
         "postal_code": "49026100",
         "state": "SP",
         "number": ""
      },
      "phone": {
         "country_code": "055",
         "number": "912345678",
         "area_code": "11"
      },
      "document_identification_number": "47003534819",
      "name": "Alan Mathison Turing"
   },
   "disbursement_bank_accounts": [
      {
         "qr_code_url": "00020126930014br.gov.bcb.pix2571qrcode-h.sandbox.qitech.app/bacen/cobv/3fecc731adf542659b84be038ec4151e5204000053039865802BR5925LogcardMeiosDePagamentoLt6008SaoPaulo61080145200062070503***6304A936"
      }
   ]
}
```

:::caution Attention
Natural-person issuance uses `borrower.person_type: "natural"` and an `individual_document_number` (CPF). `financial.disbursed_amount` must equal the amount registered in the Pix QR Code sent inside `disbursement_bank_accounts` — decode the QR Code first via **`POST /pix/decode_qrcode_payload`**. Omit `refinanced_credit_operations` (those are only used when settling existing operations in a refinancing).
:::

### Body parameters

| Field | Type | Description | Max chars |
|---|---|---|---|
| `additional_data` * | object | Contract metadata and signature evidence under `additional_data.contract` (contract number, signed flag, signatures[] with signer and evidence). | - |
| `borrower` * | object | Borrower object — Natural person taking out the credit operation. | - |
| `disbursement_bank_accounts` * | array | Disbursement bank accounts — array containing the QR Code that receives the disbursement (single item in this flow). | - |
| `financial` * | object | Financial object — Financial terms; use `disbursed_amount` for the cash payout to the borrower. | - |
| `purchaser_document_number` * | string | Assignee (purchaser) CNPJ (digits only, no formatting). | - |
| `requester_identifier_key` | string | Client tracking key for the request. | 50 |
| `document_template_key` | string | Key of the contract template to be used for the operation. | UUID |

### Borrower object

| Field | Type | Description | Max chars |
|---|---|---|---|
| `name` * | string | Borrower full name | 100 |
| `email` | string | Borrower email | 254 |
| `phone` | object | Phone object — Contact phone | - |
| `is_pep` * | boolean | PEP indicator ([http://www.portaldatransparencia.gov.br/download-de-dados/pep](http://www.portaldatransparencia.gov.br/download-de-dados/pep)) | - |
| `address` * | object | Address object — Borrower address | - |
| `role_type` | enum | Borrower role in the contract. Default: `issuer`. | - |
| `birth_date` * | date | Borrower birth date (YYYY-MM-DD) | - |
| `mother_name` * | string | Mother's full name | 100 |
| `nationality` | string | Nationality | 50 |
| `profession` | string | Borrower profession | 100 |
| `person_type` * | string | Person type — must be `natural` for individuals | - |
| `individual_document_number` * | string | Borrower CPF (digits only) | 11 |
| `document_identification` * | string | DOCUMENT_KEY of the borrower's photo ID PDF (RG or CNH), uploaded beforehand | UUID |
| `document_identification_back` | string | DOCUMENT_KEY of the back of the photo ID (uploaded beforehand) | UUID |
| `document_identification_number` | string | Borrower ID document number (RG or CNH), digits only | 20 |

### Address object

| Field | Type | Description | Max chars |
|---|---|---|---|
| `city` * | string | City | 100 |
| `state` * | string | State (two uppercase letters) | 2 |
| `number` * | string | Street number | 10 |
| `street` * | string | Street name | 100 |
| `complement` * | string | Address complement (free text) | 100 |
| `postal_code` * | string | Postal code ([https://www.buscacep.correios.com.br/](https://www.buscacep.correios.com.br/)) | 8 |
| `neighborhood` * | string | Neighborhood | 100 |

### Phone object

| Field | Type | Description | Max chars |
|---|---|---|---|
| `number` * | string | Phone number | 10 |
| `area_code` * | string | Area code ([https://ddd.guiamais.com.br/](https://ddd.guiamais.com.br/)) | 2 |
| `country_code` * | string | Country code ([https://ddi.guiamais.com.br/](https://ddi.guiamais.com.br/)) | 3 |

### Disbursement bank accounts

In this flow, the disbursement is settled by paying the dynamic Pix QR Code provided by the merchant. Instead of sending the beneficiary bank coordinates, send the QR Code payload inside `disbursement_bank_accounts` — QI Tech decodes it and routes the disbursement to the QR Code owner.

`disbursement_bank_accounts` is an array with a single item containing only the QR Code payload:

| Field | Type | Description | Max chars |
|---|---|---|---|
| `qr_code_url` * | string | EMV payload of the dynamic Pix QR Code to be paid. | 250 |

:::caution Amount consistency
The amount registered in the QR Code **must match** `financial.disbursed_amount`. Decode the QR Code with **`POST /pix/decode_qrcode_payload`** (step 1) to retrieve the amount, then use that value as `disbursed_amount` on the debt issuance.
:::

:::info Recipient data filled in the response
When issuing with `qr_code_url`, QI Tech decodes the QR Code and automatically fills the recipient's data in the `disbursement_account` of the response/webhook:

- `name`: recipient's full name (always in clear text, no masking).
- `document_number`: recipient's document — **CPF (11 digits) is returned masked** as `***XXXXXX**`; **CNPJ (14 digits) is returned in full**, without masking.
- `ispb` / `financial_institutions` / `financial_institutions_code_number`: recipient's financial institution.
- `pix_key`, `receiver_conciliation_id`, `end_to_end_id`, `amount_receivable`: extracted from the decoded QR Code.

The `account_branch`, `account_number`, and `account_digit` fields remain `null` for dynamic QR Codes, since those values are not encoded in the EMV.
:::

### Financial object

The financial object describes the credit operation's financial terms.

| Field | Type | Description | Max chars |
|---|---|---|---|
| `disbursed_amount` * | float | Cash payout disbursed to the borrower (principal of the credit operation) | - |
| `interest_type` | enum | Interest type — Amortization and interest calculation | - |
| `credit_operation_type` | enum | Credit operation type — Agreement type | - |
| `monthly_interest_rate` | float | Monthly prefixed interest rate as a decimal | - |
| `disbursement_date` | date | Disbursement date (YYYY-MM-DD) | - |
| `first_due_date` | date | First installment due date (YYYY-MM-DD) | - |
| `interest_grace_period` | int | Interest grace period (months) | - |
| `principal_grace_period` | int | Principal grace period | - |
| `number_of_installments` | int | Number of installments | - |
| `fine_configuration` | object | Fine configuration — Late interest and penalty | - |

### Fine configuration object

Fine configuration defines late penalty and interest for the credit operation.

| Field | Type | Description | Max chars |
|---|---|---|---|
| `contract_fine_rate` | float | Late penalty rate | - |
| `interest_base` | enum | Interest base — Interest calculation basis | - |
| `monthly_rate` | float | Monthly late interest rate | - |

### Enumerators

#### Person type

| Value | Description |
|---|---|
| `natural` | Natural person |
| `legal` | Legal entity |

#### Account type

| Value | Description |
|---|---|
| `checking_account` | Checking account |
| `deposit_account` | Deposit account |
| `guaranteed_account` | Guaranteed account |
| `investment_account` | Investment account |
| `payment_account` | Payment account |
| `saving_account` | Savings account |
| `salary_account` | Salary account |

#### Interest type

| Value | Description |
|---|---|
| `pre_price_days` | Price method (equal installments) with daily prefixed interest |
| `pre_price` | Price method (equal installments) with prefixed interest in fixed 30-day periods |
| `pre_sac` | SAC (constant amortization) with daily prefixed interest |
| `post_sac` | SAC with prefixed rate plus post-fixed index (CDI, IPCA, or IGP-M), daily |
| `post_price` | Price method with prefixed rate plus post-fixed index in fixed 30-day periods |
| `post_price_days` | Price method with prefixed rate plus post-fixed index, daily |

#### Credit operation type

| Value | Description |
|---|---|
| `ccb` | Bank credit note (Cédula de Crédito Bancário) |
| `cce` | Export credit note (Cédula de Crédito à Exportação) |
| `nce` | Export credit note (Nota de Crédito à Exportação) |

:::info BNPL
For the BNPL / e-commerce flow, `ccb` is the value used in practice.
:::

#### Interest base

| Value | Description |
|---|---|
| `workdays` | Business days, 252-day year |
| `calendar_days` | Calendar days, 360-day year |
| `calendar_days_365` | Calendar days, 365-day year |

### Response (HTTP 200)

The synchronous response echoes the request body with fields completed by the platform (for example `contract.contract_number` and `requester_identifier_key`).

STATUS 200

Response Body

```json
{
   "webhook_type": "debt",
   "key": "4e1ed268-9f29-44ce-9991-3bdf036aeacd",
   "status": "issued",
   "event_datetime": "2026-04-14 03:38:14",
   "data": {
      "borrower": {
         "name": "Alan Mathison Turing",
         "document_number": "82744088021",
         "related_party_key": "71b28fde-5d75-48b4-9c3f-ee531dccac66"
      },
      "contract": {
         "document_key": null,
         "number": "TEST7886216399",
         "urls": [],
         "signature_information": [
            {
               "signer_name": "Alan Mathison Turing",
               "signer_document_number": "82744088021",
               "signer_role": "issuer",
               "signer_email": null,
               "signer_external_key": null,
               "signature_url": null
            }
         ]
      },
      "requester_identifier_key": "40822732-c4ce-41fb-9ee5-5e0304cd04a7",
      "iof_charge_method": "financed",
      "collaterals": [],
      "contract_fees": [ { "fee_type": "spread", "fee_amount": 453.39 } ],
      "external_contract_fees": [ { "fee_type": "tac", "fee_amount": 0, "tax_amount": 0, "net_fee_amount": 0 } ],
      "external_contract_fee_amount": 0,
      "net_external_contract_fee_amount": 0,
      "contract_fee_amount": 453.39,
      "issue_amount": 151131.6,
      "assignment_amount": 151584.99,
      "cet": "7,6600%",
      "annual_cet": "142,4473%",
      "number_of_installments": 2,
      "base_iof": 557.3,
      "additional_iof": 574.3,
      "total_iof": 1131.6,
      "ipoc_code": "324025020203182744088021TEST7886216399",
      "prefixed_interest_rate": {
         "annual_rate": 1.252191589,
         "created_at": "2026-04-14T03:38:10",
         "daily_rate": 0.0022578334,
         "interest_base": "calendar_days",
         "monthly_rate": 0.07
      },
      "installments": [
         {
            "due_date": "2026-05-10",
            "due_principal": 151131.6,
            "installment_key": "c00dbecc-efb9-4384-8db3-dadba82f2d70",
            "installment_number": 1,
            "installment_status": "created",
            "installment_type": "principal",
            "pre_fixed_amount": 10214.91484159,
            "principal_amortization_amount": 73277.28515841,
            "tax_amount": 174.25338411,
            "total_amount": 83492.2
         },
         {
            "due_date": "2026-06-10",
            "due_principal": 77854.31484159,
            "installment_key": "d3a2f42d-80cb-4891-b2be-ce80ffd383b2",
            "installment_number": 2,
            "installment_status": "created",
            "installment_type": "principal",
            "pre_fixed_amount": 5637.88515841,
            "principal_amortization_amount": 77854.31484159,
            "tax_amount": 383.04322902,
            "total_amount": 83492.2
         }
      ],
      "total_pre_fixed_amount": 15852.8,
      "disbursement_account": [
         {
            "name": "Logcard Meios De Pagamento Ltda",
            "document_number": "18236120000158",
            "pix_key": "d6e2d611-6c68-4f84-9be5-962ad2f2bcb6",
            "qr_code_key": null,
            "qr_code_url": "00020126930014br.gov.bcb.pix2571qrcode-h.sandbox.qitech.app/bacen/cobv/3fecc731adf542659b84be038ec4151e5204000053039865802BR5925LogcardMeiosDePagamentoLt6008SaoPaulo61080145200062070503***6304A936",
            "account_branch": null,
            "account_number": null,
            "account_digit": null,
            "account_type": "checking_account",
            "ispb": "18236120",
            "percentage_receivable": 100,
            "amount_receivable": 150000,
            "end_to_end_id": "E32402502202606270040dNdgaZPUHxT"
         }
      ]
   }
}
```

### Webhook (`webhook_type: debt`)

Once the operation is processed, QI Tech notifies your endpoint with the consolidated debt data, including the issued amount, IOF breakdown, prefixed interest rate, and installment schedule.

Webhook Body

```json
{
   "webhook_type": "debt",
   "key": "4e1ed268-9f29-44ce-9991-3bdf036aeacd",
   "status": "waiting_disbursement",
   "event_datetime": "2026-04-14 03:38:14",
   "data": {
      "borrower": {
         "name": "Alan Mathison Turing",
         "document_number": "82744088021",
         "related_party_key": "71b28fde-5d75-48b4-9c3f-ee531dccac66"
      },
      "contract": {
         "document_key": null,
         "number": "TEST7886216399",
         "urls": [],
         "signature_information": [
            {
               "signer_name": "Alan Mathison Turing",
               "signer_document_number": "82744088021",
               "signer_role": "issuer",
               "signer_email": null,
               "signer_external_key": null,
               "signature_url": null
            }
         ]
      },
      "requester_identifier_key": "40822732-c4ce-41fb-9ee5-5e0304cd04a7",
      "iof_charge_method": "financed",
      "collaterals": [],
      "contract_fees": [ { "fee_type": "spread", "fee_amount": 453.39 } ],
      "external_contract_fees": [ { "fee_type": "tac", "fee_amount": 0, "tax_amount": 0, "net_fee_amount": 0 } ],
      "external_contract_fee_amount": 0,
      "net_external_contract_fee_amount": 0,
      "contract_fee_amount": 453.39,
      "issue_amount": 151131.6,
      "assignment_amount": 151584.99,
      "cet": "7,6600%",
      "annual_cet": "142,4473%",
      "number_of_installments": 2,
      "base_iof": 557.3,
      "additional_iof": 574.3,
      "total_iof": 1131.6,
      "ipoc_code": "324025020203182744088021TEST7886216399",
      "prefixed_interest_rate": {
         "annual_rate": 1.252191589,
         "created_at": "2026-04-14T03:38:10",
         "daily_rate": 0.0022578334,
         "interest_base": "calendar_days",
         "monthly_rate": 0.07
      },
      "installments": [
         {
            "business_due_date": "2026-05-11",
            "calendar_days": 29,
            "due_date": "2026-05-10",
            "due_interest": 0,
            "due_principal": 151131.6,
            "has_interest": true,
            "installment_key": "c00dbecc-efb9-4384-8db3-dadba82f2d70",
            "installment_number": 1,
            "installment_status": "created",
            "installment_type": "principal",
            "pre_fixed_amount": 10214.91484159,
            "principal_amortization_amount": 73277.28515841,
            "tax_amount": 174.25338411,
            "total_amount": 83492.2,
            "workdays": 18
         },
         {
            "business_due_date": "2026-06-10",
            "calendar_days": 31,
            "due_date": "2026-06-10",
            "due_interest": 0,
            "due_principal": 77854.31484159,
            "has_interest": true,
            "installment_key": "d3a2f42d-80cb-4891-b2be-ce80ffd383b2",
            "installment_number": 2,
            "installment_status": "created",
            "installment_type": "principal",
            "pre_fixed_amount": 5637.88515841,
            "principal_amortization_amount": 77854.31484159,
            "tax_amount": 383.04322902,
            "total_amount": 83492.2,
            "workdays": 22
         }
      ],
      "total_pre_fixed_amount": 15852.8,
      "disbursement_account": [
         {
            "name": "Logcard Meios De Pagamento Ltda",
            "document_number": "18236120000158",
            "pix_key": "d6e2d611-6c68-4f84-9be5-962ad2f2bcb6",
            "qr_code_key": null,
            "qr_code_url": "00020126930014br.gov.bcb.pix2571qrcode-h.sandbox.qitech.app/bacen/cobv/3fecc731adf542659b84be038ec4151e5204000053039865802BR5925LogcardMeiosDePagamentoLt6008SaoPaulo61080145200062070503***6304A936",
            "account_branch": null,
            "account_number": null,
            "account_digit": null,
            "account_type": "checking_account",
            "ispb": "18236120",
            "percentage_receivable": 100,
            "amount_receivable": 150000,
            "end_to_end_id": "E32402502202606270040dNdgaZPUHxT"
         }
      ]
   }
}
```

## Cancellation Webhook

If the debt fails to disburse, or is returned, you will receive a cancellation webhook.

WEBHOOK_TYPE debt
STATUS canceled

Webhook Body

```json
{
    "webhook_type": "debt",
    "key": "1ebd4a90-2721-4c39-a399-427fa16bca65",
    "event_datetime": "2025-10-27T16:38:59Z",
    "data": {
        "cancel_reason": "Operacao cancelada manualmente",
        "cancel_reason_enumerator": "manual"
    },
    "status": "canceled"
}
```

### Cancellation Webhook Fields

| Field | Type | Description |
|---|---|---|
| **key** | string | Unique debt key (DEBT-KEY) |
| **status** | string | Event status: `canceled` |
| **webhook_type** | string | Webhook type: `debt` |
| **event_datetime** | string | Event date and time |
| **data.cancel_reason** | string | Textual description of the cancellation reason |
| **data.cancel_reason_enumerator** | string | Cancellation reason enumerator |

### Cancellation Enumerators

| Enumerator | Description |
|---|---|
| `disbursing_error` | Operation canceled due to an error during disbursement |
| `waiting_signature` | Operation canceled due to missing signature |
| `pix_max_retry` | Operation canceled because the receiving bank could not process the disbursement |
| `manual` | Operation canceled manually |
| `agencia_conta_invalida` | Invalid agency or recipient account number |
| `invalid_account` | The destination account number is nonexistent or invalid |
| `invalid_document_number` | The CPF/CNPJ of the destination account is incorrect |
| `unsupported_transaction` | The destination account does not support this type of transaction |
| `invalid_ispb` | The ISPB number is invalid or nonexistent |
| `rejected_payment` | Payment order was rejected by the receiving bank |
| `refund_after_payee_request` | Refund requested by the payee |
| `blocked_account` | The destination account is blocked |
| `amount_too_great` | Payment/refund amount exceeds the limit for the credited destination account |
| `receiver_error` | Transaction interrupted due to error on the receiver's PSP |
| `closed_account` | The destination account is closed |
| `disbursing_hour_closed` | Disbursement occurred outside of the allowed time frame |
| `unregistered_pix_key` | The Pix key is not registered |
| `spi_timeout` | Timeout control in SPI |

## 3. Debt inquiry

You can query the debt later to retrieve information or track its current status.

### Request

ENDPOINT /v2/credit_operation/requester_identifier_key/ REQUESTER-IDENTIFIER-KEY
METHOD GET

Test in Playground

### Path params

| Field | Type | Description | Max chars |
|---|---|---|---|
| `requester_identifier_key` * | string | Client tracking key sent on debt issuance | 50 |

:::info Alternative route
If you have the `credit_operation_key` (UUID) instead, use `GET /v2/credit_operation/{credit_operation_key}`.
:::

### Response

STATUS 200

Response Body

```json
{
   "credit_operation_key": "0773a1b1-675a-4a10-80a2-a10308c7281e",
   "issue_amount": 151131.6,
   "origin_key": "0773a1b1-675a-4a10-80a2-a10308c7281e",
   "total_iof": 1131.6,
   "assigned_at": null,
   "disbursement_start_date": "2026-04-11",
   "disbursement_end_date": "2026-04-11",
   "issue_date": "2026-04-11",
   "requester_identifier_key": "40822732-c4ce-41fb-9ee5-5e0304cd04a7",
   "installments": [
      {
         "due_date": "2026-05-10",
         "calendar_days": 29,
         "due_principal": 151131.6,
         "has_interest": true,
         "installment_key": "c00dbecc-efb9-4384-8db3-dadba82f2d70",
         "installment_number": 1,
         "installment_status": "created",
         "installment_type": "principal",
         "pre_fixed_amount": 10214.91484159,
         "principal_amortization_amount": 73277.28515841,
         "tax_amount": 174.25338411,
         "total_amount": 83492.2
      }
   ]
}
```

## 4. Technical specifications and enums

### Installments object

| Field | Type | Description |
|---|---|---|
| `calendar_days` | integer | Number of calendar days between installments |
| `due_date` | string | Installment due date in calendar days |
| `due_principal` | float | Remaining principal on the installment due date before its payment |
| `has_interest` | boolean | If true, interest applies to the installment |
| `installment_number` | integer | Installment number |
| `pre_fixed_amount` | float | Fixed interest amount paid on the installment |
| `principal_amortization_amount` | float | Principal amount paid on the installment |
| `tax_amount` | float | Base IOF amount of installment |
| `total_amount` | float | Installment total value |
| `due_interest` | float | Remaining interest after the installment due date before its payment |
| `workdays` | integer | Business days between installments |

### Interest rate object

| Field | Description |
|---|---|
| `annual_rate` | Annual fixed/floating interest rate expressed as a decimal |
| `daily_rate` | Daily fixed/floating interest rate expressed as a decimal |
| `interest_base` | Interest base — Interest calculation basis |
| `monthly_rate` | Monthly fixed/floating interest rate expressed as a decimal |

### Tax configuration object

| Field | Description |
|---|---|
| `base_rate` | Base IOF rate value |
| `additional_rate` | Additional IOF rate value |

---

# Refund Flow

This guide explains how to process full and partial refunds for credit operations originated through the BNPL / e-commerce flow using the POST /signed_debt endpoint.

The refund flow consists of two major steps:

1. **Chargeback notification** — a webhook is sent whenever a chargeback is processed, regardless of whether it represents a full or partial refund. The webhook contains all the information required to identify and process the chargeback.
2. **Renegotiation** — after successfully processing the webhook, you may initiate a renegotiation to generate a new installment schedule that reflects the refunded amount. The renegotiation terms are fully configurable and should follow your business rules and policies.

## Webhook — Refund received

### Overview

As soon as an identified refund is received, QI Tech will send a webhook containing the refund details, including whether it is a full or partial refund and the amount credited to the FIDC account.

Based on this information, you can apply your business policies and determine how to proceed with the refund requested by your customer.

Webhook Body

```json
{
   "origin_key": "d5c88545-4d17-4679-b262-ae170618078a",
   "refund_date": "2026-06-26",
   "webhook_type": "laas.transitory_conciliation.refund",
   "amount": "200.00",
   "event_datetime": "2026-06-12T11:52:22"
}
```

## Renegotiation — Simulation

### Overview

Before creating a proposal, you can simulate the refund values for the operation. The simulation returns the affected installments, the present value of the discount and the total amount.

The refund flow uses two amortization types:

- **`equal_amount`** — partial refund. Distributes `payment_amount` across the open installments, reducing the outstanding balance. The operation stays active with remaining installments still open.
- **`full_settle`** — full refund. Fully settles the operation on the `reference_date`. The operation moves to `settled` and no installments remain.

### Request

ENDPOINT /renegotiation/simulation
METHOD POST

Test in Playground

Request Body

**equal_amount (partial)**

```json
{
    "debt_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c",
    "amortization_type": "equal_amount",
    "reference_date": "2026-04-13",
    "payment_amount": 50.00
}
```

**full_settle (total)**

```json
{
    "debt_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c",
    "amortization_type": "full_settle",
    "reference_date": "2026-04-13",
    "payment_amount": 1043.55
}
```

### Body parameters

| Field | Type | Description | Max length |
|---|---|---|---|
| `debt_key` * | string | Unique credit operation key (DEBT-KEY) | UUID |
| `amortization_type` * | string | Refund modality | **[Amortization type values](#amortization-type-values)** |
| `payment_amount` * | float | Refund amount in BRL. In `equal_amount`, the partial amount to be amortized. In `full_settle`, must cover the total outstanding balance on the `reference_date`. | 15,2 |
| `reference_date` | string | Reference date used to compute the present value (YYYY-MM-DD). Cannot be earlier than the disbursement date. | 10 |
| `discount_percentage` | float | Optional discount percentage over the present value. Cannot be sent together with `discount_amount`. | - |
| `discount_amount` | float | Optional discount amount over the present value. Cannot be sent together with `discount_percentage`. | - |

### Amortization type values

| Value | Description |
|---|---|
| **`equal_amount`** | Partial refund. `payment_amount` is distributed proportionally across the open installments; the operation remains active with remaining installments open. |
| **`full_settle`** | Full refund. Fully settles the operation on the `reference_date`. The operation moves to `settled` and no installments remain. |

### Response

STATUS 200

Example response body

```json
{
    "amortization_type": "equal_amount",
    "payment_amount": 50.00,
    "discount_percentage": 0,
    "discount_amount": 0,
    "reference_date": "2026-04-13",
    "affected_installments": [
        {
            "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88",
            "due_date": "2026-05-07",
            "principal_amount": 15.71,
            "interest_amount": 4.07,
            "fine_amount": 0,
            "total_amount": 19.78,
            "present_amount": 18.00,
            "paid_amount": 18.00,
            "principal_amortization_payment_amount": 18.00,
            "prefixed_interest_payment_amount": 0,
            "fine_payment_amount": 0
        }
    ],
    "remaining_installments": [
        {
            "installment_key": "370e73d1-55d8-431e-9b22-d08fb8297999",
            "due_date": "2026-06-07",
            "principal_amount": 15.71,
            "interest_amount": 4.07,
            "fine_amount": 0,
            "total_amount": 19.78
        }
    ]
}
```

## Renegotiation — Proposal

### Overview

After validating the simulation, create a renegotiation proposal. For refund use cases, send `payment_type: "internal"` so the funds are debited directly from the `account_key` provided, with no bank slip or Pix generated.

:::caution Attention
- The operation must be active and already disbursed.
- `reference_date` cannot be earlier than the disbursement date.
- `request_control_key` is required for idempotency.
:::

### Request

ENDPOINT /renegotiation/proposal
METHOD POST

Test in Playground

Request Body

**equal_amount (partial)**

```json
{
    "debt_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c",
    "payment_type": "internal",
    "amortization_type": "equal_amount",
    "reference_date": "2026-04-13",
    "payment_amount": 50.00,
    "account_key": "5ae72355-1e47-4624-9915-ceb93d872194",
    "request_control_key": "94b31045-c8e7-45be-a88d-2ae25c5df5db"
}
```

**full_settle (total)**

```json
{
    "debt_key": "72760166-4ddf-41fb-8a8c-605f8f4fc35c",
    "payment_type": "internal",
    "amortization_type": "full_settle",
    "reference_date": "2026-04-13",
    "payment_amount": 1043.55,
    "account_key": "5ae72355-1e47-4624-9915-ceb93d872194",
    "request_control_key": "e5f6c3d4-e5f6-7890-abcd-ef1234567890"
}
```

### Body parameters

| Field | Type | Description | Max length |
|---|---|---|---|
| `debt_key` * | string | Unique credit operation key (DEBT-KEY) | UUID |
| `payment_type` * | string | For refund flows, use `internal`. | **[Payment type values](#payment-type-values)** |
| `amortization_type` * | string | Refund modality | **[Amortization type values](#amortization-type-values-1)** |
| `payment_amount` * | float | Refund amount in BRL. | 15,2 |
| `account_key` * | string | Internal account key from which the value is debited. | UUID |
| `request_control_key` * | string | Client-side idempotency key. Use a unique value per attempt. | 50 |
| `reference_date` | string | Reference date used to compute the present value (YYYY-MM-DD). Cannot be earlier than the disbursement date. | 10 |
| `discount_percentage` | float | Optional discount percentage over the present value. Cannot be sent together with `discount_amount`. | - |
| `discount_amount` | float | Optional discount amount over the present value. Cannot be sent together with `discount_percentage`. | - |

### Payment type values

| Value | Description |
|---|---|
| `internal` | Internal debit from `account_key` (automatic, no bank slip or Pix). Used for refund flows. |
| `bank_slip` | Generates bank slip and Pix. |
| `pix` | Pix only. |
| `manual` | Manual payment (no payment method generated). |

### Amortization type values {#amortization-type-values-1}

| Value | Description |
|---|---|
| **`equal_amount`** | Partial refund. `payment_amount` is distributed proportionally across the open installments; the operation remains active with remaining installments open. |
| **`full_settle`** | Full refund. Fully settles the operation on the `reference_date`. The operation moves to `settled` and no installments remain. |

### Response

STATUS 201

Example response body

```json
{
    "proposal_key": "bcc16a6d-ce21-4cd4-8d8c-d26f89ccc685",
    "contract_number": "DWF1761222116",
    "amortization_type": "equal_amount",
    "payment_amount": 50.00,
    "discount_percentage": 0,
    "discount_amount": 0,
    "requester_name": "Dante Ltda",
    "requester_key": "78287247-947d-4730-9bd1-7efb068175b6",
    "origin_key": null,
    "issuer_name": "Dante Ferrarini",
    "issuer_document_number": "31057466093",
    "affected_installments": [
        {
            "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88",
            "due_date": "2026-05-07",
            "principal_amount": 15.71,
            "interest_amount": 4.07,
            "fine_amount": 0,
            "total_amount": 19.78,
            "present_amount": 18.00,
            "paid_amount": 18.00,
            "principal_amortization_payment_amount": 18.00,
            "prefixed_interest_payment_amount": 0,
            "fine_payment_amount": 0
        }
    ],
    "remaining_installments": [
        {
            "installment_key": "370e73d1-55d8-431e-9b22-d08fb8297999",
            "due_date": "2026-06-07",
            "principal_amount": 15.71,
            "interest_amount": 4.07,
            "fine_amount": 0,
            "total_amount": 19.78
        }
    ],
    "proposal_status": "pending_payment",
    "payment_type": "internal",
    "payment": {
        "digitable_line": null,
        "qr_code_url": null,
        "qr_code_key": null,
        "bank_slip_key": null,
        "paid_method_type": "internal",
        "source_account_key": "5ae72355-1e47-4624-9915-ceb93d872194",
        "payment_data": {
            "target_account_key": "6108dd45-580d-48c4-b3bb-74c1e843be49",
            "transaction_amount": 50.00
        }
    },
    "proposal_due_date": "2026-04-13",
    "reference_date": "2026-04-13",
    "devolution_amount": 0,
    "request_control_key": "94b31045-c8e7-45be-a88d-2ae25c5df5db"
}
```

### Response details

| Field | Type | Description |
|---|---|---|
| `proposal_key` | string | Unique proposal key (UUID). Use it for queries and webhook correlation. |
| `proposal_status` | string | Proposal state. Starts at `pending_payment`; moves to `paid` once the internal debit settles. |
| `affected_installments` | array | Installments that received the refund. Shows the split of `paid_amount` across principal, interest and fine. |
| `remaining_installments` | array | Installments that remain open after the refund. Empty in `full_settle`. |
| `payment.payment_data.target_account_key` | string | Destination account of the internal debit. |
| `payment.payment_data.transaction_amount` | float | Amount actually debited from `account_key`. |
| `devolution_amount` | float | Overpayment returned to the fund. Non-zero only when a prior payment plus this refund exceeds the outstanding balance. |
| `request_control_key` | string | Echo of the idempotency key sent in the request. |

### Settlement webhook

When a refund settles the operation in full — typically `full_settle`, also possible when stacked `equal_amount` proposals zero the balance — QI Tech sends a `webhook_type: debt` with `status: settled`. Use it to confirm settlement asynchronously.

## Renegotiation — Cancel proposal

### Overview

`DELETE /renegotiation/proposal/{proposal_key}` cancels a proposal that has not been finalized. Only proposals with `proposal_status: "pending_payment"` are cancellable. Any associated payment method (bank slip, Pix) is invalidated.

### Request

ENDPOINT /renegotiation/proposal/{'{proposal_key}'}
METHOD DELETE

### Path params

| Field | Type | Description | Max length |
|---|---|---|---|
| `proposal_key` * | string | Proposal key returned on `POST /renegotiation/proposal`. | UUID |

### Response

STATUS 200

Example response body

```json
{
    "proposal_key": "bcc16a6d-ce21-4cd4-8d8c-d26f89ccc685",
    "proposal_status": "canceled",
    "request_control_key": "94b31045-c8e7-45be-a88d-2ae25c5df5db"
}
```

## Query proposal status

After creating the proposal, you can poll its status by `request_control_key`.

ENDPOINT /renegotiation/proposal/request_control_key/ REQUEST-CONTROL-KEY
METHOD GET

The response follows the same format as the `POST /renegotiation/proposal` body. `proposal_status` indicates the progress:

| Status | Description |
|---|---|
| `pending_payment` | Proposal created, awaiting internal debit processing. |
| `paid` | Debit processed. In `full_settle`, the operation is already `settled`. |
| `canceled` | Proposal canceled via `DELETE /renegotiation/proposal/{proposal_key}`. |

---

# Batch renegotiation

For scenarios where you need to renegotiate multiple operations of the same issuer in one shot — generating a single payment method (bank slip and/or Pix) covering the whole batch — use the **batch endpoints**.

:::caution Attention
- Batch renegotiation can only include operations from the same issuer and the same integration key.
- Limit of **50 operations** per batch.
- Batch endpoints support a different set of amortization types: `installment_payment`, `overdue_installment_payment`, `present_amount`. `equal_amount` and `full_settle` are **not** available on batch.
:::

## Renegotiation — Batch simulation

### Overview

Before creating a batch proposal, simulate the values. The simulation returns affected installments, discounts and the total amount due across all operations.

For `present_amount` on simulation, each `installments[]` entry contains only `installment_key`. Per-installment `paid_amount` and `discount_amount` are required only on the **batch proposal** endpoint.

### Request

ENDPOINT /renegotiation/batch_proposal_simulation
METHOD POST

Test in Playground

:::warning Warning
At the root, `discount_amount` and `discount_percentage` are mutually exclusive.
:::

Request Body

```json
{
   "amortization_type": "installment_payment",
   "reference_date": "2026-04-08",
   "operations": [
      {
         "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
         "installments": [
            { "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88" }
         ]
      },
      {
         "debt_key": "2cbfb9b1-1fdb-5f8d-9967-b338e5eb83f9",
         "installments": [
            { "installment_key": "2ef25ed8-7124-44f5-9e3d-1d1a7196166e" }
         ]
      }
   ]
}
```

### Body parameters

| Field | Type | Description | Max length |
|---|---|---|---|
| `amortization_type` * | string | Batch amortization type | **[Batch amortization type values](#batch-amortization-type-values)** |
| `operations` * | array | Operations to renegotiate | **[Operations object](#batch-operations-object)** |
| `reference_date` | string | Reference date for present-value calculation (YYYY-MM-DD). | 10 |
| `discount_percentage` | float | Optional discount percentage over present value (root level, global). | - |
| `discount_amount` | float | Optional discount amount over present value (root level, global). | - |

### Operations object {#batch-operations-object}

| Field | Type | Description | Max length |
|---|---|---|---|
| `debt_key` * | string | Unique credit operation key (DEBT-KEY) | UUID |
| `installments` * | array | Installments to renegotiate | **[Installments object](#batch-installments-object-simulation)** |

### Installments object {#batch-installments-object-simulation}

| Field | Type | Description | Max length |
|---|---|---|---|
| `installment_key` * | string | Installment key | UUID |

### Batch amortization type values

| Value | Description |
|---|---|
| `installment_payment` | Pay specific installments. Each `installments[]` entry contains only `installment_key`. |
| `overdue_installment_payment` | Pay overdue installments. Same shape as `installment_payment`. |
| `present_amount` | Present value per installment. On simulation, send only `installment_key`. On the proposal endpoint, also send `paid_amount` and `discount_amount`. |

### Response

STATUS 200

Example response body

```json
{
   "batch_proposal_key": "429fd784-e13e-47a1-ad9f-291209e0e621",
   "amortization_type": "installment_payment",
   "payment_amount": 78389.55,
   "discount_percentage": 0,
   "discount_amount": 0,
   "requester_name": "Castello (BNPL)",
   "requester_key": "3e69b448-9afb-4aef-9c0d-0a3059350d80",
   "issuer_name": "Alan Mathison Turing",
   "issuer_document_number": "82744088021",
   "reference_date": "2026-04-08",
   "operations": [
      {
         "requester_key": "3e69b448-9afb-4aef-9c0d-0a3059350d80",
         "contract_number": "TEST00790",
         "payment_amount": 78389.55,
         "discount_amount": 0,
         "affected_installments": [
            {
               "installment_key": "24b5deae-304e-4773-9b25-e42dbd450241",
               "due_date": "2026-05-10",
               "principal_amount": 73107.75,
               "interest_amount": 10580.11,
               "fine_amount": 0,
               "total_amount": 83687.87,
               "present_amount": 78389.55,
               "paid_amount": 78389.55,
               "principal_amortization_payment_amount": 78048.30,
               "prefixed_interest_payment_amount": 341.25,
               "fine_payment_amount": 0,
               "discount_amount": 0
            }
         ],
         "remaining_installments": [
            {
               "installment_key": "2b1d9423-4dab-44b3-bf8c-efc8433176dd",
               "due_date": "2026-06-10",
               "principal_amount": 73096.23,
               "interest_amount": 10591.64,
               "fine_amount": 0,
               "total_amount": 83687.87
            }
         ],
         "debt_key": "388c47fa-6c6c-4d2b-8f00-ccc2d571fcb0"
      }
   ]
}
```

## Renegotiation — Batch proposal

### Overview

After simulating the values, create the batch renegotiation proposal. The proposal generates a single payment method (bank slip and/or Pix) covering all operations in the batch.

For `amortization_type: present_amount`, each entry in `operations[].installments[]` must include `paid_amount` and `discount_amount` (in addition to `installment_key`). For `installment_payment` / `overdue_installment_payment`, only `installment_key` is required.

### Request

ENDPOINT /renegotiation/batch_proposal
METHOD POST

Test in Playground

Request Body

**installment_payment**

```json
{
   "amortization_type": "installment_payment",
   "reference_date": "2026-04-08",
   "proposal_due_date": "2026-04-15",
   "payment_type": "pix",
   "request_control_key": "94b31045-c8e7-45be-a88d-2ae25c5df5db",
   "operations": [
      {
         "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
         "installments": [
            { "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88" }
         ]
      },
      {
         "debt_key": "2cbfb9b1-1fdb-5f8d-9967-b338e5eb83f9",
         "installments": [
            { "installment_key": "2ef25ed8-7124-44f5-9e3d-1d1a7196166e" }
         ]
      }
   ]
}
```

**present_amount**

```json
{
   "amortization_type": "present_amount",
   "reference_date": "2026-04-08",
   "proposal_due_date": "2026-04-15",
   "payment_type": "pix",
   "request_control_key": "94b31045-c8e7-45be-a88d-2ae25c5df5db",
   "operations": [
      {
         "debt_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
         "installments": [
            { "installment_key": "ca5741c7-99a2-42e7-92a1-9328a36e4e88", "paid_amount": 500, "discount_amount": 50 }
         ]
      },
      {
         "debt_key": "2cbfb9b1-1fdb-5f8d-9967-b338e5eb83f9",
         "installments": [
            { "installment_key": "2ef25ed8-7124-44f5-9e3d-1d1a7196166e", "paid_amount": 150, "discount_amount": 10 }
         ]
      }
   ]
}
```

### Body parameters

| Field | Type | Description | Max length |
|---|---|---|---|
| `amortization_type` * | string | Batch amortization type | **[Batch amortization type values](#batch-amortization-type-values-1)** |
| `payment_type` * | string | Batch payment type | **[Batch payment type values](#batch-payment-type-values)** |
| `operations` * | array | Operations to renegotiate | **[Operations object](#batch-operations-object-1)** |
| `proposal_due_date` * | string | Proposal due date (YYYY-MM-DD) | 10 |
| `reference_date` * | string | Reference date (YYYY-MM-DD) | 10 |
| `request_control_key` | string | Client-side idempotency key for tracking and cancellation. Required for cancellation by `request_control_key`. | 50 |
| `discount_percentage` | float | Optional global discount percentage on present value. | - |
| `discount_amount` | float | Optional global discount amount on present value. | - |
| `payer_document_number` | string | Payer CNPJ (digits only). | 14 |
| `payer_name` | string | Payer name. Required when `payer_document_number` is sent. | 200 |

### Operations object {#batch-operations-object-1}

| Field | Type | Description | Max length |
|---|---|---|---|
| `debt_key` * | string | Unique credit operation key (DEBT-KEY) | UUID |
| `installments` * | array | Installments to renegotiate | **[Installments object](#batch-installments-object-proposal)** |

### Installments object {#batch-installments-object-proposal}

| Field | Type | Description | Max length |
|---|---|---|---|
| `installment_key` * | string | Installment key | UUID |
| `paid_amount` | float | Amount paid/allocated to the installment (BRL). Required when `amortization_type` is `present_amount`. | 15,2 |
| `discount_amount` | float | Discount in BRL applied to the installment. Required when `amortization_type` is `present_amount` (use `0` if none). | 15,2 |

### Batch payment type values

| Value | Description |
|---|---|
| `bank_slip` | Bank slip (also generates Pix). |
| `pix` | Pix only. |
| `manual` | Manual payment (no payment method generated). |

### Batch amortization type values {#batch-amortization-type-values-1}

| Value | Description |
|---|---|
| `installment_payment` | Pay specific installments — each entry under `operations[].installments[]` requires `installment_key` only. |
| `overdue_installment_payment` | Pay overdue installments — same shape as `installment_payment`. |
| `present_amount` | Present value per installment — each entry requires `installment_key`, `paid_amount`, `discount_amount`. |

### Response

STATUS 201

Example response body

```json
{
   "batch_proposal_key": "37879d40-c16e-4d7f-a16f-d79d20c50d42",
   "amortization_type": "installment_payment",
   "payment_amount": 78206.27,
   "discount_percentage": 0,
   "discount_amount": 0,
   "requester_name": "Castello (BNPL)",
   "requester_key": "3e69b448-9afb-4aef-9c0d-0a3059350d80",
   "issuer_name": "Alan Mathison Turing",
   "issuer_document_number": "82744088021",
   "reference_date": "2026-04-08",
   "proposal_due_date": "2026-04-15",
   "payment_type": "pix",
   "batch_proposal_status": "pending_payment",
   "request_control_key": "94b31045-c8e7-45be-a88d-2ae25c5df5db",
   "operations": [
      {
         "requester_key": "3e69b448-9afb-4aef-9c0d-0a3059350d80",
         "contract_number": "TEST1570594223",
         "payment_amount": 78206.27,
         "debt_key": "6564493d-75c3-4efe-9f11-82fa5cff9a78",
         "affected_installments": [
            {
               "installment_key": "1162e382-8bd6-4c0b-9111-8390d9794102",
               "due_date": "2026-05-10",
               "principal_amount": 73277.29,
               "interest_amount": 10214.91,
               "fine_amount": 0,
               "total_amount": 83492.20,
               "present_amount": 78206.27,
               "paid_amount": 78206.27,
               "principal_amortization_payment_amount": 78206.27,
               "prefixed_interest_payment_amount": 0,
               "fine_payment_amount": 0,
               "discount_amount": 0
            }
         ],
         "remaining_installments": [
            {
               "installment_key": "58eea645-5682-440d-aa6b-a3b124253684",
               "due_date": "2026-06-10",
               "principal_amount": 72925.33,
               "interest_amount": 10566.87,
               "fine_amount": 0,
               "total_amount": 83492.20
            }
         ]
      }
   ],
   "payment": {
      "digitable_line": null,
      "qr_code_url": "00020126930014br.gov.bcb.pix2571qrcode-h.sandbox.qitech.app/bacen/cobv/426661142f5d4cd9954dcae3725d020d5204000053039865802BR5925QISOCIEDADEDECREDITODIRET6008SaoPaulo61080145200062070503***6304B878",
      "qr_code_key": "42666114-2f5d-4cd9-954d-cae3725d020d",
      "bank_slip_key": null,
      "paid_method_type": "pix",
      "source_account_key": null,
      "payment_data": {
         "creditor_bank_account_key": "6108dd45-580d-48c4-b3bb-74c1e843be49",
         "batch_renegotiation_proposal_key": "37879d40-c16e-4d7f-a16f-d79d20c50d42"
      }
   }
}
```

## Renegotiation — Cancel batch proposal

### Overview

Cancels a batch proposal still in a cancellable state. Only proposals with `batch_proposal_status: "pending_payment"` are cancellable. Any associated payment method (bank slip, Pix) is invalidated.

Two routes are available:

- **By `batch_proposal_key`** (UUID returned on `POST /renegotiation/batch_proposal`)
- **By `request_control_key`** (idempotency key sent on creation) — useful when the client tracks operations by its own key

### Cancel by batch_proposal_key

ENDPOINT /renegotiation/batch_proposal/{'{batch_proposal_key}'}
METHOD DELETE

#### Path params

| Field | Type | Description | Max length |
|---|---|---|---|
| `batch_proposal_key` * | string | Batch proposal key returned on `POST /renegotiation/batch_proposal`. | UUID |

### Cancel by request_control_key

ENDPOINT /renegotiation/batch_proposal/request_control_key/{'{request_control_key}'}
METHOD DELETE

#### Path params

| Field | Type | Description | Max length |
|---|---|---|---|
| `request_control_key` * | string | Idempotency key sent on `POST /renegotiation/batch_proposal`. | 50 |

### Response

Both routes return the same response.

STATUS 204

# Simulate the PIX Chargeback (CNPJ) Flow — Sandbox Runbook

**Audience:** clients driving the full pix-parcelado merchant-chargeback flow end-to-end in
**sandbox**, through the gandalf gateway (`https://api-auth.sandbox.qitech.app`).

This is the hands-on companion to
[`client-chargeback-renegotiation.md`](./client-chargeback-renegotiation.md). That guide
explains the *semantics* (what each webhook and field means). This one is the *runbook*:
the exact calls you make, in order, to produce and settle a hold yourself.

You will:

1. Get your **opened credit operation (CO)** — the CNPJ disbursement you'll charge back.
2. **Trigger a chargeback**, which fires the refund webhook and parks a
   `pending_requester_action` hold.
3. Read the hold, then **call renegotiation** to act on it.
4. Confirm the hold settles.

All calls go through your gandalf integration (signed requests).

---

## 0. Before you start — prerequisites

QI configures these per-account; confirm they're in place before you begin (see
[`client-chargeback-renegotiation.md` §2](./client-chargeback-renegotiation.md)):

- Your transitory account is onboarded with a **chargeback account** and gated for
  issuer-document conciliation.
- Your callback endpoint is registered for **`laas.transitory_conciliation.refund`**.
  Without it, the webhook is silently dropped.

Reference keys used in the examples below (swap in your own):

```
account_key           (transitory)  1b50f04e-8f90-4b89-8604-22eee1b2755f
chargeback_account_key               6268e5a7-4998-44ed-b128-9639fef0c678
CNPJ (merchant / disbursement)       62244815000173
```

---

## Step 1 — Get your opened CO

Create (or reuse) a signed CNPJ consumer-loan disbursement. The disbursement PIX targets the
merchant CNPJ; its `credit_operation_key` is the CO you'll charge back.

```
POST /debt                       # disbursement_document_number = 62244815000173 (CNPJ)
POST /debt/{credit_operation_key}/signed
```

Disbursement is async — wait for the CO to reach `opened`. Record the
**`credit_operation_key`**; that's the only identifier the rest of the flow needs (the
chargeback resolves the outgoing PIX and the transitory account from it server-side).

---

## Step 2 — Trigger the chargeback (fires the refund webhook)

Mint a merchant chargeback against the original outgoing PIX. This credits the transitory
account and — because the account is gated — parks a `pending_requester_action` hold and
fires your `laas.transitory_conciliation.refund` webhook.

**Endpoint:**

```
POST /mock/transitory_conciliation/incoming_pix_chargeback
```

```bash
curl -X POST "https://api-auth.sandbox.qitech.app/mock/transitory_conciliation/incoming_pix_chargeback" \
  -H "Content-Type: application/json" \
  <your gandalf signed-request headers> \
  -d '{
    "credit_operation_key": "9aeaa029-eec8-4bea-bf81-367ad0dfd1ee",
    "amount": 50.0
  }'
```

Fields:

| Field | Required | Notes |
|---|---|---|
| `credit_operation_key` | yes | your opened CO (36 chars). The mock resolves the outgoing PIX `end_to_end_id` and the transitory account from it. |
| `amount` | yes | **must be `< disbursed amount`** (partial). A full-amount chargeback within 7 days auto-reverses instead of holding. |
| `payer_document_number` | no | the CNPJ — 14 digits. **Defaults to the merchant CNPJ on the CO** if omitted. |
| `pix_message` | no | free text. |

Response: `201`. Fails `400 MOC000008` if the CO has no settled PIX disbursement to charge back.

**Why partial matters:** the hold path triggers when the chargeback is *partial* **or**
lands *>7 calendar days* after the original disbursement. A same-amount chargeback ≤7 days
takes the auto-reversal path (`pending_reversal → finished`) and never becomes a
`pending_requester_action` hold — so there's nothing for renegotiation to act on.

---

## Step 3 — Read the hold

The webhook payload (`data.callback.data`) carries everything you need — the callback `key`
is the `transitory_conciliation_key`, and `origin_key` is the `credit_operation_key`. Take
both straight from the payload.

To poll instead of waiting on the webhook:

```
GET /transitory_conciliation/credit_operation_key/{credit_operation_key}?status=pending_requester_action
```

Returns the hold DTO (`transitory_conciliation_key`, `amount`, `credit_operation_key`,
`chargeback_account_key`, `document_number`, `transitory_conciliation_status`, …).

Record **`transitory_conciliation_key`** and **`credit_operation_key`** for Step 4.

---

## Step 4 — Act on the hold via renegotiation

Create a renegotiation proposal against the held CO. Reneg validates the keys against the
hold (source of truth), creates the proposal at `pending_payment`, then auto-liquidates by
moving the held funds from the chargeback account.

**Endpoint:**

```
POST /renegotiation/proposal
```

```json
{
  "transitory_conciliation_key": "<from Step 3>",
  "debt_key": "<credit_operation_key from Step 3>",
  "amortization_type": "full_settle",
  "reference_date": "2026-07-22",
  "request_control_key": "<your idempotency key>"
}
```

Rules (enforced server-side):

- **Only** these fields are accepted. Sending `payment_type` / `account_key` /
  `payment_amount` → `400 RN0000064`. Amount and source account come from the hold, not you.
- `amortization_type` must be `full_settle` or `equal_amount` → else `400 RN0000063`.
- `debt_key` must equal the hold's `credit_operation_key` → else `400 RN0000061`.
- One active proposal per hold → else `409 RN0000062`.

Success: `201`, `proposal_status = pending_payment`.

See [`client-chargeback-renegotiation.md` §3](./client-chargeback-renegotiation.md) for the
full error table and the migration-path (no-key) payload variant.

---

## Step 5 — Confirm settlement

Once the proposal pays, QI settles the hold: `pending_requester_action → finished`
(resolution `renegotiation`). Verify with the event history:

```
GET /transitory_conciliation/{transitory_conciliation_key}/events
```

You should see the finishing event with `resolution_type = renegotiation` and `external_key`
= the proposal key. If you consume proposal webhooks, you also receive the `paid` callback.

---

## Flow at a glance

```
Step 1  POST /debt (+ /signed)                  → opened CO (credit_operation_key)
Step 2  POST /mock/.../incoming_pix_chargeback  → {credit_operation_key, amount} → hold + refund webhook
Step 3  (webhook payload) or GET .../credit_operation_key/{k}?status=pending_requester_action
Step 4  POST /renegotiation/proposal            → proposal pending_payment → auto-liquidates
Step 5  hold → finished (resolution renegotiation)
```

> Validated end-to-end in sandbox (2026-07-22): CO `9aeaa029…` → chargeback `{credit_operation_key, amount:50}`
> → hold `d5e4d0a1…` `pending_requester_action` → proposal `ed30395e…` → hold `finished` (resolution `renegotiation`).

## Reference

| Thing | Value |
|---|---|
| Sandbox gateway (gandalf) | `https://api-auth.sandbox.qitech.app` |
| Chargeback trigger | `POST /mock/transitory_conciliation/incoming_pix_chargeback` |
| Refund webhook event | `laas.transitory_conciliation.refund` |
| Read hold | `GET /transitory_conciliation/credit_operation_key/{key}?status=pending_requester_action` |
| Renegotiation action | `POST /renegotiation/proposal` |
| Allowed amortizations | `full_settle`, `equal_amount` |
| Hold status enum | `pending_requester_action` → `finished` |

---

# Webhooks INSS

URL: /en/documentation/roteiros_laas/webhooks_inss

## Consultas (lista de benefícios e dados do benefício)

### 1. Consulta da lista de benefícios

- WEBHOOK_TYPE social_security_benefits_request
- STATUS success

        *Body:*

**body.json**

```json
{
    "key": "d6c193f9-ed5e-42cc-9480-e48338766eb7",
    "data": [
        {
            "grant_date": [
                "2015-05-07"
            ],
            "benefit_number": 7015686016,
            "benefit_status": "elegible"
        }
    ],
    "status": "success",
    "webhook_type": "social_security_benefits_request",
    "event_datetime": "2024-09-19T22:11:30"
}

```

- WEBHOOK_TYPE social_security_benefits_request
- STATUS failure

        *Body:*

**body.json**

```json
{
    "key": "e571385f-06e7-4277-b2e6-b1ee0522ae44",
    "data": {
        "enumerator": "not_found_legal_representative",
        "description": "beneficiary has a legal representative, but was not informed"
    },
    "status": "failure",
    "webhook_type": "social_security_benefits_request",
    "event_datetime": "2024-09-19T22:11:46"
}
```

### 2. Consulta de dados do benefício

- WEBHOOK_TYPE social_security_balance_request
- STATUS success

        *Body:*

**body.json**

```json
{
    "key": "720fc2b3-0fa7-4fb0-bea9-3c798ca8e595",
    "data": {
        "name": "NOME BENEFICIARIO",
        "state": "RS",
        "alimony": "not_payer",
        "birth_date": "18021978",
        "block_type": "not_blocked",
        "grant_date": "2006-05-22",
        "credit_type": "checking_account",
        "benefit_card": {
            "limit": 2259.2,
            "balance": 0
        },
        "benefit_number": "1377902789",
        "benefit_status": "elegible",
        "payroll_card": {
            "limit": 2259.2,
            "balance": 0
        },
        "assistance_type": "retirement_invalidity_social_security",
        "document_number": "81442882034",
        "benefit_end_date": null,
        "consigned_credit": {
            "balance": 0
        },
        "benefit_situation": "active",
        "last_inquiry_date": "2018-06-18",
        "max_total_balance": 635.4,
        "used_total_balance": 635.4,
        "politically_exposed": {
            "type": "not_politically_exposed",
            "is_politically_exposed": false
        },
        "has_power_of_attorney": false,
        "available_total_balance": 0,
        "has_judicial_concession": false,
        "number_of_portabilities": 0,
        "disbursement_bank_account": {
            "bank_code": "748",
            "account_digit": "4",
            "account_branch": "0155",
            "account_number": "000070963"
        },
        "has_entity_representation": false,
        "social_benefit_max_balance": 635.4,
        "social_benefit_used_balance": 635.4,
        "benefit_quota_expiration_date": null,
        "number_of_active_reservations": 3,
        "number_of_suspended_reservations": 0,
        "number_of_refinanced_reservations": 0,
        "number_of_active_suspended_reservations": 3
    },
    "status": "success",
    "webhook_type": "social_security_balance_request",
    "event_datetime": "2024-09-02T18:49:02"
}

```

- WEBHOOK_TYPE social_security_balance_request
- STATUS failure

        *Body:*

**body.json**

```json
{
    "key": "70130c68-7e91-41a9-8dc5-11ad876f36d2",
    "data": {
        "enumerator": "not_found_legal_representative",
        "description": "beneficiary has a legal representative, but was not informed"
    },
    "status": "failure",
    "webhook_type": "social_security_balance_request",
    "event_datetime": "2024-09-02T18:57:25"
}
```

## Portabilidade IN + Refinanciamento

### 1. Emissão de dívidas Port + Refin.

- WEBHOOK_TYPE credit_transfer.proposal.credit_operation
- CREDIT_OPERATION_TYPE portability
- CREDIT_OPERATION_STATUS issued

        *Body:*

**body.json**

```json
{
    "data": {
        "document_key": "91210cb0-2cd2-4508-98b5-ff16dbda27af",
        "signed_document_url": "https://storage.googleapis.com/live-doc-api/documents/91210cb0-2cd2-4508-98b5-ff16dbda27af/contrato_signed.pdf",
        "credit_operation_key": "6f71be3f-3814-4f1d-b015-c234755935f8",
        "credit_operation_type": "portability",
        "credit_operation_status": "issued"
    },
    "proposal_key": "22191e35-5d29-4d55-92db-0920f90b5747",
    "webhook_type": "credit_transfer.proposal.credit_operation",
    "event_datetime": "2024-10-01T10:10:32"
}

```

- WEBHOOK_TYPE credit_transfer.proposal.credit_operation
- CREDIT_OPERATION_TYPE refinancing
- CREDIT_OPERATION_STATUS issued

        *Body:*

**body.json**

```json
{
    "data": {
        "document_key": "91210cb0-2cd2-4508-98b5-ff16dbda27af",
        "signed_document_url": "https://storage.googleapis.com/live-doc-api/documents/91210cb0-2cd2-4508-98b5-ff16dbda27af/CONTRATO_signed.pdf",
        "credit_operation_key": "cbaaa1da-7610-4eba-9a48-8728b0be8f34",
        "credit_operation_type": "refinancing",
        "credit_operation_status": "issued"
    },
    "proposal_key": "91210cb0-2cd2-4508-98b5-ff16dbda27af",
    "webhook_type": "credit_transfer.proposal.credit_operation",
    "event_datetime": "2024-10-01T10:10:38"
}

```

### 2. Status Portabilidade

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS pending_acceptance

        *Body:*

**body.json**

```json
{
    "webhook_type": "credit_transfer.proposal",
    "proposal_key": "6bd4f3cc-5787-4e4c-a6ba-3748883394cd",
    "proposal_status": "pending_acceptance",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
        "portability_number": "202211230000246536429",
        "inclusion_date": "2022-11-24",
        "due_balance_expected_return_date": "2022-12-01"
    }
}

```

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS accepted

        *Body:*

**body.json**

```json
{
    "data": {
        "final_due_balance": 5558.4,
        "original_contract": {
            "cet": 26.11,
            "interest": 22.1311,
            "total_iof": 218.4,
            "contract_date": "2022-06-15",
            "last_due_date": "2029-07-07",
            "final_due_date": "2024-10-08",
            "first_due_date": "2024-11-07",
            "amortization_type": "pre_price",
            "final_due_balance": 5558.4,
            "effective_interest": 22.1311,
            "installment_number": 84,
            "origin_ispb_number": "00360305",
            "origin_operation_type": "payroll",
            "corban_document_number": null,
            "installment_face_value": 148.07,
            "origin_contract_number": "0000000000000000000000000000000001899642",
            "opened_installment_number": 57,
            "overdue_installment_number": 0
        },
        "portability_number": "202410010000341749111"
    },
    "proposal_key": "1860a994-a3aa-4456-9b14-3aa35c97797a",
    "webhook_type": "credit_transfer.proposal",
    "event_datetime": "2024-10-08T07:18:23",
    "proposal_status": "accepted"
}

```

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS canceled

        *Body:*

**body.json**

```json
{
    "webhook_type": "credit_transfer.proposal",
    "proposal_status": "canceled",
    "proposal_key": "3130d43f-4f60-49c6-806e-61b4c9cb3a14",
    "event_datetime": "2022-11-24T15:42:12"
}

```

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS retained

        *Body:*

**body.json**

```json
{
    "webhook_type": "credit_transfer.proposal",
    "proposal_key": "3130d43f-4f60-49c6-806e-61b4c9cb3a14",
    "proposal_status": "retained",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
        "retained_reason": {
            "reason": "issuer_retention",
            "description": "Retenção do Cliente"
        }
    }
}
```

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS rejected

        *Body:*

**body.json**

```json
{
  "webhook_type": "credit_transfer.proposal",
  "proposal_key": "91210cb0-2cd2-4508-98b5-ff16dbda27af",
  "proposal_status": "rejected",
  "event_datetime": "2022-11-24T15:42:12",
  "data": {
    "error": {
        "code": "ECTC0023",
        "reason": "Contrato com portabilidade em andamento"
    }
  }
}

```

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS settlement_sent

        *Body:*

**body.json**

```json
{
    "data": {
        "receipt": {
            "fee": 0,
            "amount": 5558.4,
            "origin": {
                "name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
                "type": "payment_account",
                "branch": "0001",
                "document": "32402502000135",
                "bank_code": "329",
                "account_key": "792e04a3-566d-489d-9c5a-8385f7dc76b0",
                "branch_digit": null,
                "account_digit": "6",
                "account_number": "1000111"
            },
            "timestamp": "2024-10-08T07:19:39",
            "description": "104 1620 - 00360305000104 - CAIXA ECONOMICA FEDERAL",
            "destination": {
                "name": "CAIXA ECONOMICA FEDERAL",
                "type": "checking_account",
                "branch": "1620",
                "purpose": "Saída Liquidação de Portabilidade",
                "document": "00360305000104",
                "bank_code": "104",
                "branch_digit": null,
                "account_digit": null,
                "account_number": null
            },
          "ted_receipt_url": "https://storage.googleapis.com/live-doc-api/documents/5aa5026.pdf",
            "transaction_key": "8a76b511-96c9-4b0f-a9b3-5405d400e00a",
            "ted_receipt_document_key": "5aa5026d-e78f-4781-9c4e-e2cf21425a3c"
        }
    },
    "proposal_key": "3130d43f-4f60-49c6-806e-61b4c9cb3a14",
    "webhook_type": "credit_transfer.proposal",
    "event_datetime": "2024-10-08T07:19:39",
    "proposal_status": "settlement_sent"
}

```

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS pending_settlement_confirmation

        *Body:*

**body.json**

```json
{
    "proposal_key": "3130d43f-4f60-49c6-806e-61b4c9cb3a14",
    "webhook_type": "credit_transfer.proposal",
    "event_datetime": "2024-10-08T07:20:18",
    "proposal_status": "pending_settlement_confirmation"
}

```

- WEBHOOK_TYPE credit_transfer.proposal
- STATUS paid

        *Body:*

**body.json**

```json
{
    "proposal_key": "1860a994-a3aa-4456-9b14-3aa35c97797a",
    "webhook_type": "credit_transfer.proposal",
    "event_datetime": "2024-10-09T09:14:19",
    "proposal_status": "paid"
}
```

### 3. Status Averbação (tentativas e sucesso)

        **Portabilidade**

- WEBHOOK_TYPE credit_transfer.proposal.collateral
- CREDIT_OPERATION_TYPE portability
- STATUS pending_reservation
- COLLATERAL_CONSTITUTED false
- RESERVATION_METHOD new_credit

        *Body:*

**body.json**

```json
{
    "data": {
        "collateral_data": {
            "status": "pending_reservation",
            "last_response": {
                "errors": [
                    {
                        "enumerator": "consignable_margin_excceded"
                    }
                ]
            },
            "reservation_method": "new_credit",
            "last_response_event_datetime": "2024-10-08T10:19:32Z"
        },
        "collateral_type": "social_security",
        "credit_operation_key": "6f71be3f-3814-4f1d-b015-c23475593987",
        "credit_operation_type": "portability",
        "collateral_constituted": false
    },
    "proposal_key": "6bd4f3cc-5787-4e4c-a6ba-3748883394cd",
    "webhook_type": "credit_transfer.proposal.collateral",
    "event_datetime": "2024-10-08T07:19:32"
}

```

- WEBHOOK_TYPE credit_transfer.proposal.collateral
- STATUS pending_reservation
- CREDIT_OPERATION_TYPE portability
- COLLATERAL_CONSTITUTED false
- RESERVATION_METHOD portability

        *Body:*

**body.json**

```json
{
    "data": {
        "collateral_data": {
            "status": "pending_reservation",
            "last_response": {
                "errors": [
                    {
                        "enumerator": "consignable_margin_excceded"
                    }
                ]
            },
            "reservation_method": "portability",
            "last_response_event_datetime": "2024-10-09T00:00:26Z"
        },
        "collateral_type": "social_security",
        "credit_operation_key": "6f71be3f-3814-4f1d-b015-c234755935f8",
        "credit_operation_type": "portability",
        "collateral_constituted": false
    },
    "proposal_key": "3130d43f-4f60-49c6-806e-61b4c9cb3a14",
    "webhook_type": "credit_transfer.proposal.collateral",
    "event_datetime": "2024-10-08T21:02:29"
}
```

- WEBHOOK_TYPE credit_transfer.proposal.collateral
- STATUS pending_reservation
- CREDIT_OPERATION_TYPE portability
- COLLATERAL_CONSTITUTED true
- RESERVATION_METHOD portability

        *Body:*

**body.json**

```json
{
    "data": {
        "collateral_data": {
            "reservation_method": "portability"
        },
        "collateral_type": "social_security",
        "credit_operation_key": "6f71be3f-3814-4f1d-b015-c234755935f8",
        "credit_operation_type": "portability",
        "collateral_constituted": true
    },
    "proposal_key": "3130d43f-4f60-49c6-806e-61b4c9cb3a14",
    "webhook_type": "credit_transfer.proposal.collateral",
    "event_datetime": "2024-10-09T16:49:50"
}
```

        **Refinancimamento**

- WEBHOOK_TYPE credit_transfer.proposal.collateral
- STATUS pending_reservation
- CREDIT_OPERATION_TYPE refinancing
- COLLATERAL_CONSTITUTED true
- RESERVATION_METHOD refinancing

        *Body:*

**body.json**

```json
{
    "data": {
        "collateral_data": {
            "reservation_method": "refinancing"
        },
        "collateral_type": "social_security",
        "credit_operation_key": "cbaaa1da-7610-4eba-9a48-8728b0be8f34",
        "credit_operation_type": "refinancing",
        "collateral_constituted": true
    },
    "proposal_key": "3130d43f-4f60-49c6-806e-61b4c9cb3a14",
    "webhook_type": "credit_transfer.proposal.collateral",
    "event_datetime": "2024-10-09T16:50:12"
}
```

### 4. Desembolso refinanciamento (Troco).

- WEBHOOK_TYPE credit_transfer.proposal.credit_operation
- CREDIT_OPERATION_TYPE refinancing
- CREDIT_OPERATION_STATUS disbursed

        *Body:*

**body.json**

```json
{
    "data": {
        "credit_operation_key": "cbaaa1da-7610-4eba-9a48-8728b0be8111",
        "transaction_receipts": [
            {
                "fee": 0,
                "url": "https://storage.googleapis.com/live-doc-api/documents/26ff118e-52c0-4092-bdbd-9d8253.pdf",
                "amount": 924.61,
                "origin": {
                    "name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
                    "type": "payment_account",
                    "branch": "0001",
                    "document": "32402502000135",
                    "bank_code": "329",
                    "account_key": "792e04a3-566d-489d-9c5a-8385f7dc76b0",
                    "branch_digit": null,
                    "account_digit": "6",
                    "account_branch": "0001",
                    "account_number": "1000789",
                    "financial_institution_name": "QI SCD S.A."
                },
                "timestamp": "2024-10-09T19:51:34",
                "description": "DESCRICAO",
                "destination": {
                    "name": "JOSE HENRIQUE DA SILVA",
                    "type": "checking_account",
                    "branch": "1621",
                    "purpose": "Crédito PIX em Conta",
                    "document": "79202603022",
                    "bank_ispb": "00360305",
                    "branch_digit": null,
                    "account_digit": "3",
                    "account_number": "763804111",
                    "financial_institution_name": "CAIXA ECONOMICA FEDERAL"
                },
                "end_to_end_id": "E32402502202410091950saI7VCHPrlB",
                "transaction_key": "2109e1d6-8c89-401b-9ff0-751d42b45e43",
                "origin_transaction_key": "d99f633b-1cec-4469-8ae6-61642931b475"
            }
        ],
        "credit_operation_type": "refinancing",
        "credit_operation_status": "disbursed"
    },
    "proposal_key": "3130d43f-4f60-49c6-806e-61b4c9cb3a14",
    "webhook_type": "credit_transfer.proposal.credit_operation",
    "event_datetime": "2024-10-09T16:51:34"
}

```

- WEBHOOK_TYPE credit_transfer.proposal.credit_operation
- CREDIT_OPERATION_TYPE refinancing
- CREDIT_OPERATION_STATUS canceled

        *Body:*

**body.json**

```json
{
    "webhook_type": "credit_transfer.proposal.credit_operation",
    "proposal_key": "3130d43f-4f60-49c6-806e-61b4c9cb3a14",
    "event_datetime": "2022-11-24T15:42:12",
    "data": {
        "credit_operation_status": "canceled",
        "credit_operation_type": "refinancing",
        "credit_operation_key": "1a1a44df-29b6-431c-89af-53657d906333",
        "pix_refusal": {
            "reason_enumerator": "invalid_document_number",
            "reason": "CPF/CNPJ do usuário recebedor não é compatível com o titular da conta de destino."
        },
        "cancel_reason": "pix_refusal"
    }
}

```

### 5. Consulta de portabilidade de origem

- WEBHOOK_TYPE social_security_portability_origin_contract_request
- status success

        *Body:*

**body.json**

```json
{
    "webhook": {
        "key": "25e93655-4713-488b-8800-7ac4fddf745f",
        "data": {
          "portability_number": 9223372036854776000,
          "portability_status": "open",
          "benefit_number": 1544326820,
          "portability_start_date": "2024-02-22",
          "deleted_contracts": [
            {
              "origin_bank": {
                "bank_code": 752,
                "name": "CETELEM-BNP"
              },
              "contract_number": "22-844817807/20",
              "last_installment_paid": 84,
              "exclusion_date": "22022024",
              "period_amount": 165.73
            }
          ]
        },
        "status": "success",
        "webhook_type": "social_security_portability_origin_contract_request",
        "event_datetime": "2024-02-26T21:36:22"
    }
}

```

- WEBHOOK_TYPE social_security_portability_origin_contract_request
- status failure

        *Body:*

**body.json**

```json
{
    "webhook": {
        "key": "522b5d7d-2dfc-4e92-99b7-d4df3d97edb2",
        "data": {
            "enumerator": "invalid_bank_code",
            "description": "Invalid bank code"
        },
        "status": "failure",
        "webhook_type": "social_security_portability_origin_contract_request",
        "event_datetime": "2024-02-26T21:36:22"
    }
}

```

## Crédito Novo

### 1. Status Dívida

- WEBHOOK_TYPE debt
- STATUS signature_finished

        *Body:*

**body.json**

```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_TYPE debt
- STATUS disbursed

        *Body:*

**body.json**

```json
{
    "key": "b91ee4cd-85fd-4548-b03f-31024fc5d285",
    "data": {
        "installments": [
            {
                "due_date": "2024-12-10",
                "total_amount": 116.76,
                "installment_key": "dc3a5877-6860-42cd-b885-c4ca84b69546",
                "pre_fixed_amount": 116.76,
                "principal_amortization_amount": 0
            },
            {
                "due_date": "2025-01-10",
                "total_amount": 116.76,
                "installment_key": "1ca2c016-1bc4-4f64-a681-17699a90e27d",
                "pre_fixed_amount": 79.96557434,
                "principal_amortization_amount": 36.79442566
            },
            {
                "due_date": "2025-02-10",
                "total_amount": 116.76,
                "installment_key": "9f11bd0e-60f1-4d0c-9882-e6196e279f7a",
                "pre_fixed_amount": 66.16762896,
                "principal_amortization_amount": 50.59237104
            },
            {
                "due_date": "2025-03-10",
                "total_amount": 116.76,
                "installment_key": "0ed43a28-9324-41d1-84b3-fb41940c02e2",
                "pre_fixed_amount": 57.20192546,
                "principal_amortization_amount": 59.55807454
            },
            {
                "due_date": "2025-04-10",
                "total_amount": 116.76,
                "installment_key": "1da0b291-9e15-41a5-8aa6-86d733af6195",
                "pre_fixed_amount": 60.33833893,
                "principal_amortization_amount": 56.42166107
            },
            {
                "due_date": "2025-05-10",
                "total_amount": 116.76,
                "installment_key": "e884d447-31ea-4847-b479-eac11baeac96",
                "pre_fixed_amount": 55.45582536,
                "principal_amortization_amount": 61.30417464
            },
            {
                "due_date": "2025-06-10",
                "total_amount": 116.76,
                "installment_key": "ab16369b-c551-4a0e-84e4-b5f2a6161c1d",
                "pre_fixed_amount": 54.10815043,
                "principal_amortization_amount": 62.65184957
            },
            {
                "due_date": "2025-07-10",
                "total_amount": 116.76,
                "installment_key": "64db51eb-47c9-4f44-86e0-35ca054fc2f8",
                "pre_fixed_amount": 49.1128602,
                "principal_amortization_amount": 67.6471398
            },
            {
                "due_date": "2025-08-10",
                "total_amount": 116.76,
                "installment_key": "5035ee8e-8462-4b54-9598-de7a269103a4",
                "pre_fixed_amount": 47.21257597,
                "principal_amortization_amount": 69.54742403
            },
            {
                "due_date": "2025-09-10",
                "total_amount": 116.76,
                "installment_key": "233da01d-8ec4-4c60-8096-01a702af9b71",
                "pre_fixed_amount": 43.53204519,
                "principal_amortization_amount": 73.22795481
            },
            {
                "due_date": "2025-10-10",
                "total_amount": 116.76,
                "installment_key": "1d4bf5b2-5ff1-49c3-8a4a-ddf90fe5c370",
                "pre_fixed_amount": 38.34531007,
                "principal_amortization_amount": 78.41468993
            },
            {
                "due_date": "2025-11-10",
                "total_amount": 116.76,
                "installment_key": "a5211802-15b6-4245-afe2-8e5dcfde2e96",
                "pre_fixed_amount": 35.5069396,
                "principal_amortization_amount": 81.2530604
            },
            {
                "due_date": "2025-12-10",
                "total_amount": 116.76,
                "installment_key": "886e7907-f46e-45c7-bb9c-c66dd87050e0",
                "pre_fixed_amount": 30.17493687,
                "principal_amortization_amount": 86.58506313
            },
            {
                "due_date": "2026-01-10",
                "total_amount": 116.76,
                "installment_key": "4e82409c-1769-4555-86bd-527d585d0f88",
                "pre_fixed_amount": 26.62475039,
                "principal_amortization_amount": 90.13524961
            },
            {
                "due_date": "2026-02-10",
                "total_amount": 116.76,
                "installment_key": "e226d32f-33ec-4a20-ad60-96a0ec3216d7",
                "pre_fixed_amount": 21.85468788,
                "principal_amortization_amount": 94.90531212
            },
            {
                "due_date": "2026-03-10",
                "total_amount": 116.76,
                "installment_key": "710e51e3-9720-4b6a-a383-569736781e28",
                "pre_fixed_amount": 15.16506862,
                "principal_amortization_amount": 101.59493138
            },
            {
                "due_date": "2026-04-10",
                "total_amount": 116.76,
                "installment_key": "88cba573-627d-4ca0-b39e-0fcc20f22422",
                "pre_fixed_amount": 11.45566586,
                "principal_amortization_amount": 105.30433414
            },
            {
                "due_date": "2026-05-10",
                "total_amount": 116.76,
                "installment_key": "0e51f217-21c8-4897-baee-2bd2aad43d22",
                "pre_fixed_amount": 5.59829551,
                "principal_amortization_amount": 111.16170449
            }
        ],
        "ted_receipt_list": [
            {
                "fee": 0,
                "url": "https://storage.googleapis.com/live-doc-api/documents/304b5b46-08e5-4.pdf",
                "amount": 1000,
                "origin": {
                    "name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
                    "type": "payment_account",
                    "branch": "0001",
                    "document": "32402502000135",
                    "bank_code": "329",
                    "account_key": "836ce4ef-855b-4672-bc52-36e32e22ec05",
                    "branch_digit": null,
                    "account_digit": "1",
                    "account_branch": "0001",
                    "account_number": "00852",
                    "financial_institution_name": "QI SCD S.A."
                },
                "timestamp": "2024-10-14T03:09:17",
                "description": "DESCRICAO",
                "destination": {
                    "name": "DEVEDOR",
                    "type": "checking_account",
                    "branch": "0648",
                    "purpose": "Crédito PIX em Conta",
                    "document": "04973666068",
                    "bank_ispb": "90400888",
                    "branch_digit": null,
                    "account_digit": "7",
                    "account_number": "25252",
                    "financial_institution_name": "BCO SANTANDER (BRASIL) S.A."
                },
                "end_to_end_id": "E3240250220241014030292IkYMOt523",
                "transaction_key": "797ab666-07c4-4702-a68b-1d67afb34534",
                "origin_transaction_key": "af8aa38f-8a49-45bd-9878-101cefe9bdd4"
            }
        ],
        "requester_identifier_key": "70675b9fe09da90c8b5c992"
    },
    "status": "disbursed",
    "webhook_type": "debt",
    "event_datetime": "2024-10-14 03:09:17"
}
```

- WEBHOOK_TYPE debt
- STATUS canceled

        *Body:*

**body.json**

```json
{
    "webhook": {
        "key": "dfdf8cde-eb49-437a-a798-bb90eec03af8",
        "data": {
            "cancel_reason": "Operacao cancelada manualmente",
            "cancel_reason_enumerator": "manual"
        },
        "status": "canceled",
        "webhook_type": "debt",
        "event_datetime": "2024-09-02 18:40:12"
    }
}
```

**body_pix_refusal.json**

```json
{
    "key": "3fee13aa-a193-4444-a39a-097de8f824bf",
    "data": {
        "pix_refusal": {
            "reason": "A conta de destino encontra-se bloqueada.",
            "reason_enumerator": "blocked_account",
            "cancel_reason_enumerator": "blocked_account"
        },
        "cancel_reason": "pix_refusal",
        "cancel_reason_enumerator": "pix_refusal"
    },
    "status": "canceled",
    "webhook_type": "debt",
    "event_datetime": "2024-09-02 18:40:40"
}
```

**body_ted_refusal.json**

```json
 {
 	"status": "canceled",
 	"key": "3fee13aa-a193-4444-a39a-097de8f824bf",
 	"data": {
 		"ted_refusal": {
 			"transaction_key": "16faabfc-3876-437d-a4f6-aae17a1d68c9",
 			"description": "341 0000 000000-7 12345678900 - NOME BENEFICIÁRIO",
 			"origin": {
 				"account_key": "a1d2dea5-fa90-4676-a125-da355fdc3ed0",
 				"account_number": "00086",
 				"bank_code": "329",
 				"name": "ACCOUNT TRANSITORY",
 				"type": "payment_account",
 				"document": "32402502000135",
 				"branch_digit": null,
 				"account_digit": "8",
 				"branch": "0001"
 			},
 			"fee": 0,
 			"reason_enumerator": "agencia_conta_invalida",
 			"timestamp": "2022-11-07T14:36:05",
 			"amount": 483.6,
 			"reason": "Agência ou Conta Destinatária do Crédito Inválida",
 			"destination": {
 				"branch": "0000",
 				"account_number": "000000",
 				"name": "NOME BENEFICIÁRIO",
 				"purpose": "Crédito em Conta",
 				"type": "checking_account",
 				"branch_digit": null,
 				"document": "12345678900",
 				"bank_code": "341",
 				"account_digit": "7"
 			}
 		},
 		"cancel_reason": "ted_refusal"
 	}
 }
```

- WEBHOOK_TYPE debt
- STATUS canceled_permanently

        *Body:*

**body.json**

```json
{
    "key": "cf416a66-8e4c-4ac9-a3ee-d529e49acaf4",
    "status": "canceled_permanently",
    "webhook_type": "debt",
    "event_datetime": "2024-09-02 18:39:56"
}
```

### 2. Status Averbação

- WEBHOOK_TYPE debt
- STATUS credit_operation.collateral
- COLLATERAL_CONSTITUTED true

        *Body:*

**body.json**

```json
{
    "key": "2dabec49-780d-4742-a81b-a5b40a837386",
    "data": {
        "collateral_data": {},
        "collateral_type": "social_security",
        "collateral_constituted": true
    },
    "event_time": "2024-10-14 02:46:01",
    "webhook_type": "credit_operation.collateral"
}
```

- WEBHOOK_TYPE debt
- STATUS credit_operation.collateral
- COLLATERAL_CONSTITUTED false

        *Body:*

**body.json**

```json
{
    "key": "2dabec49-780d-4742-a81b-a5b40a837386",
    "data": {
        "collateral_data": {},
        "collateral_type": "social_security",
        "collateral_constituted": false
    },
    "event_time": "2024-10-14 08:46:01",
    "webhook_type": "credit_operation.collateral"
}
```

## Portabilidade Out

### 1. Notificação de recebimento de ataque de portabilidade

- WEBHOOK_TYPE credit_transfer.received_portability
- RECEIVED_PORTABILITY_STATUS received

        *Body:*

**body.json**

```json
{
    "webhook_type": "credit_transfer.received_portability",
    "received_portability_status": "received", 
    "received_portability_key": "673d2872-c6c9-4075-b9ab-4525bcbe4aa1",
    "event_datetime": "2022-07-24T18:29:45",  
    "data": {
        "annual_interest_rate": 1,
        "annual_effective_interest_rate": 1,
        "number_of_installments": 6,
        "installment_face_value": 201.71,
        "phone_number": "(05)541997558",
        "address": {
            "street": "Rua Longe de Casa",
            "city": "Rio de Janeiro",
            "state": "RJ",
            "number": "112",
            "postal_code": "38300569"
        },
        "due_balance": 1000,
        "due_balance_date": "2022-07-29",
        "issuer_name": "A Random Name",
        "issuer_document_number": "37197645832",
        "reference_date": "2022-08-01",
        "contract_number": "0000049045/UO",
        "origin_credit_operation_key": "key",
        "retention_limit_date": "2022-08-03", 
        "due_balance_limit_date": "2022-08-08", 
        "portability_number": "202207150000001642808",
        "corban_document_number": "08289470514408",
        "source_ispb_number": "0"
    }
}
```

### 2. Status

- WEBHOOK_TYPE credit_transfer.received_portability
- RECEIVED_PORTABILITY_STATUS waiting_settlement

        *Body:*

**body.json**

```json
{
  "webhook_type": "credit_transfer.received_portability",
  "received_portability_key": "673d2872-c6c9-4075-b9ab-4525bcbe4aa1",
  "received_portability_status": "waiting_settlement",
  "event_datetime": "2022-07-24T18:29:45",
  "data": {
    "settlement_due_balance": 120.00,
    "settlement_date": "2022-08-02"
  }
}
```

- WEBHOOK_TYPE credit_transfer.received_portability
- RECEIVED_PORTABILITY_STATUS canceled_by_proponent

        *Body:*

**body.json**

```json
{
  "webhook_type": "credit_transfer.received_portability",
  "received_portability_key": "673d2872-c6c9-4075-b9ab-4525bcbe4aa1",
  "received_portability_status": "canceled_by_proponent",
  "event_datetime": "2022-07-24T18:29:45",
  "data": {}
}
```

- WEBHOOK_TYPE credit_transfer.received_portability
- RECEIVED_PORTABILITY_STATUS settled

        *Body:*

**body.json**

```json
{
  "webhook_type": "credit_transfer.received_portability",
  "received_portability_key": "673d2872-c6c9-4075-b9ab-4525bcbe4aa1",
  "received_portability_status": "settled",
  "event_datetime": "2022-07-24T18:29:45Z",
  "data": {}
}
```

- WEBHOOK_TYPE credit_transfer.received_portability
- RECEIVED_PORTABILITY_STATUS canceled_by_creditor

        *Body:*

**body.json**

```json
{
  "webhook_type": "credit_transfer.received_portability",
  "received_portability_key": "673d2872-c6c9-4075-b9ab-4525bcbe4aa1",
  "received_portability_status": "canceled_by_creditor",
  "event_datetime": "2022-07-24T18:29:45",
  "data": {
   "canceled_reason": {
    "enumerator": "not_paid",
    "description": "Decurso de prazo por STR não paga dentro do prazo"
   }
  }
}
```

---

# Consultar saldo disponível

URL: /en/documentation/saque_aniversario_fgts/consultar_saldo_disponivel

## Request

ENDPOINT /baas/v2/fgts/available_balance
METHOD POST

Esse serviço permite consultar o saldo disponível do trabalhador no FGTS. Como resultado, o cliente visualiza as parcelas futuras disponíveis para os seus saques-aniversário.

A consulta de saldo na V2 é assíncrona. Portanto é feita uma requisição, e a resposta será dada por Webhook.

Webhook de Consulta recebido.

YOUR REQUEST HISTORY

Request Body

```json
{
   "document_number": "639.092.770-39"
}

```

### BODY PARAMS

| Campo | Descrição |
|---|---|
| `document_number` | CPF (apenas números) do titular da conta |

---

# Criar operação de crédito

URL: /en/documentation/saque_aniversario_fgts/criacao_da_operacao

## Request

ENDPOINT /baas/debt_fgts
MÉTODO POST

Request Body

```json
{
    "borrower": {
        "person_type": "natural",
        "name": "Patrícia Tereza Bernardes",
        "mother_name": "Maria Mariane",
        "birth_date": "1990-05-06",
        "profession": "Deputada",
        "nationality": "nationality",
        "marital_status": "married",
        "property_system": "total_communion_of_goods",
        "wedding_certificate": "56ab7849-4d90-490b-b539-96ac3c5a619b",
        "spouse": {
            "person_type": "natural",
            "name": "Patrícia Tereza Bernardes",
            "mother_name": "Maria Mariane",
            "birth_date": "1990-05-06",
            "profession": "Deputada",
            "nationality": "nationality",
            "marital_status": "married",
            "property_system": "total_communion_of_goods",
            "wedding_certificate": "56ab7849-4d90-490b-b539-96ac3c5a619b",
            "is_pep": false,
            "individual_document_number": "34651104630",
            "document_identification": "3c24579b-9810-4fa6-9b08-fe67d237160a",
            "document_identification_back": "2f43456a-3664-4805-82b8-96a2ec72c04c",
            "document_identification_type": "cnh",
            "document_identification_number": "232479719",
            "email": "api@qitech.com.br",
            "Phone": {
                "country_code": "055",
                "area_code": "11",
                "number": "999999999"
            },
            "address": {
                "street": "Av. Brigadeiro Faria Lima",
                "state": "SP",
                "city": "São Paulo",
                "neighborhood": "Jardim Paulistano",
                "number": "2391",
                "postal_code": "01452905",
                "complement": "1o. Andar"
            },
            "proof_of_residence": "780456bd-1eec-4e5f-82c0-d8c3921497ea"
        },
        "is_pep": false,
        "individual_document_number": "34651104630",
        "document_identification": "3c24579b-9810-4fa6-9b08-fe67d237160a",
        "document_identification_back": "2f43456a-3664-4805-82b8-96a2ec72c04c",
        "document_identification_type": "cnh",
        "document_identification_number": "232479719",
        "email": "api@qitech.com.br",
        "Phone": {
            "country_code": "055",
            "area_code": "11",
            "number": "999999999"
        },
        "address": {
            "street": "Av. Brigadeiro Faria Lima",
            "state": "SP",
            "city": "São Paulo",
            "neighborhood": "Jardim Paulistano",
            "number": "2391",
            "postal_code": "01452905",
            "complement": "1o. Andar"
        },
        "proof_of_residence": "780456bd-1eec-4e5f-82c0-d8c3921497ea"
    },
    "financial": {
        "interest_type": "pre_price_days",
        "credit_operation_type": "ccb",
        "annual_interest_rate": 0.05,
        "disbursement_date": "2022-07-25",
        "disbursement_start_date": "2022-07-27",
        "disbursement_end_date": "2022-07-27",
        "issue_date": "2019-07-25",
        "interest_grace_period": 0,
        "principal_grace_period": 0,
        "number_of_installments": 2,
        "fine_configuration": {
            "contract_fine_rate": 0,
            "interest_base": "workdays",
            "monthly_rate": 0
        }
    },
    "disbursement_bank_accounts": {
        "bank_code": "329",
        "branch_number": "001",
        "account_number": "15570",
        "account_digit": "4",
        "document_number": "94632180173",
        "name": "Pedro Felipe Henrique Alves",
        "percentage_receivable": 100,
        "ispb_number": 92874270,
        "pix_key": "qitech@qitech.com.br",
        "qr_code_key": "00020126580014br.gov.bcb.pix01366214e102-494c-4cf7-a99c-fd903d9f4aab5204000053039865802BR5911QI SCD S.A.6009sao paulo610912345-78062070503***6304C32E",
        "digitable_line": "00190500954014481606906809350314337370000000100"
    }
}

```

A simulação da operação retornará uma série de informações, no entanto, a de maior importância é o disbursed_issue_amount, que representa o valor líquido presente possível de se desembolsar. A partir dele é possível realizar os cálculos e, por fim, montar a operação no formato desejado e enviar a requisição.

**ATRIBUTOS DE UMA EMISSÃO DO SAQUE-ANIVERSÁRIO FGTS**

A criação da operação consiste em 4 objetos:

- borrower: tomador da dívida (objeto PF)
- collaterals: informações das parcelas de pagamento (objeto Collateral FGTS)
- financial: dados do fluxo financeiro da operação (Objeto Financeiro FGTS)
- disbursement_bank_accounts: lista de informações bancárias para o desembolso (Objeto Conta Bancária)

### Body Params

| Campo | Descrição |
|---|---|
| `borrower` *(obrigatório)* | Identificador de que o objeto enviado é uma pessoa física. Deve conter SEMPRE o valor "natural" para Objeto PF |
| `collaterals` *(obrigatório)* | Informações das parcelas de pagamento. |
| `financial` *(obrigatório)* | Contém todas as informações de um objeto Financial, mas com a adição dos desired installments, que representam os valores de cada parcela simulada pelo cliente. |
| `disbursement_bank_accounts` *(obrigatório)* | Uma emissão de dívida deve conter as informações bancárias para desembolso, por padrão, uma conta do tomador. Este objeto deve ser uma lista com uma ou mais contas. O Objeto Conta Bancária deve conter: |

### BORROWER OBJECT

| Campo | Descrição |
|---|---|
| `person_type` *(obrigatório)* | Identificador de que o objeto enviado é uma pessoa física. Deve conter SEMPRE o valor "natural" para Objeto PF |
| `name` *(obrigatório)* | Nome da pessoa |
| `mother_name` *(obrigatório)* | mother_name |
| `birth_date` *(obrigatório)* | Data de nascimento da pessoa (formato "AAAA-MM-DD") |
| `profession` *(obrigatório)* | Profissão da pessoa |
| `nationality` *(obrigatório)* | Nacionalidade da pessoa |
| `marital_status` *(obrigatório)* | Estado civil da pessoa: "single", "married", "widower" ou "divorced" |
| `property_system` | Regime de separação de bens (obrigatório apenas para pessoas com marital_status "married"): "total_communion_of_goods", "partial_communion_of_goods", "total_separation_of_goods", "final_participation_of_acquisitions" ou "compulsory_separation_of_goods" |
| `wedding_certificate` *(obrigatório)* | DOCUMENT_KEY do PDF do certificado de casamento da pessoa (enviado previamente). No caso de marital_status ser "single", o valor deste campo deve ser null |
| `spouse` *(obrigatório)* | Objeto PF do esposo/esposa da pessoa (obrigatório apenas quando "compulsory_separation_of_goods" for "total_communion_of_goods", "partial_communion_of_goods", "final_participation_of_acquisitions" ou "compulsory_separation_of_goods"). No caso de marital_status ser "single", o valor deste campo deve ser null |
| `is_pep` *(obrigatório)* | Declaração se a pessoa é PEP (http://www.portaldatransparencia.gov.br/download-de-dados/pep) valor booleano |
| `individual_document_number` *(obrigatório)* | CPF da pessoa (apenas números) |
| `document_identification` *(obrigatório)* | DOCUMENT_KEY do PDF do documento de identificação da pessoa com foto (RG ou CNH) (enviado previamente) |
| `document_identification_back` | DOCUMENT_KEY do PDF da parte de trás do documento de identificação da pessoa com foto (RG ou CNH) (enviado previamente) |
| `document_identification_type` | Qual o tipo do documento de identificação. Um enumerador que aceita "rg" ou "cnh" |
| `document_identification_number` *(obrigatório)* | Número do documento de identificação da pessoa enviado em document_identification |
| `email` | Email da pessoa |
| `phone` | Telefone da pessoa |
| `address` | Endereço da pessoa |
| `proof_of_residence` *(obrigatório)* | DOCUMENT_KEY do PDF do comprovante de endereço do endereço enviado (enviado previamente) |
| `ocr` | Objeto para entrega das chaves geradas pelo SDK de OCR |

### SPOUSE OBJECT

| Campo | Descrição |
|---|---|
| `person_type` *(obrigatório)* | Identificador de que o objeto enviado é uma pessoa física. Deve conter SEMPRE o valor "natural" para Objeto PF |
| `name` *(obrigatório)* | Nome da pessoa |
| `mother_name` *(obrigatório)* | mother_name |
| `birth_date` *(obrigatório)* | Data de nascimento da pessoa (formato "AAAA-MM-DD") |
| `profession` *(obrigatório)* | Profissão da pessoa |
| `nationality` *(obrigatório)* | Nacionalidade da pessoa |
| `marital_status` *(obrigatório)* | Estado civil da pessoa: "single", "married", "widower" ou "divorced" |
| `property_system` | Regime de separação de bens (obrigatório apenas para pessoas com marital_status "married"): "total_communion_of_goods", "partial_communion_of_goods", "total_separation_of_goods", "final_participation_of_acquisitions" ou "compulsory_separation_of_goods" |
| `wedding_certificate` *(obrigatório)* | DOCUMENT_KEY do PDF do certificado de casamento da pessoa (enviado previamente). No caso de marital_status ser "single", o valor deste campo deve ser null |
| `spouse` *(obrigatório)* | Objeto PF do esposo/esposa da pessoa (obrigatório apenas quando "compulsory_separation_of_goods" for "total_communion_of_goods", "partial_communion_of_goods", "final_participation_of_acquisitions" ou "compulsory_separation_of_goods"). No caso de marital_status ser "single", o valor deste campo deve ser null |
| `is_pep` *(obrigatório)* | Declaração se a pessoa é PEP (http://www.portaldatransparencia.gov.br/download-de-dados/pep) valor booleano |
| `individual_document_number` *(obrigatório)* | CPF da pessoa (apenas números) |
| `document_identification` *(obrigatório)* | DOCUMENT_KEY do PDF do documento de identificação da pessoa com foto (RG ou CNH) (enviado previamente) |
| `document_identification_back` | DOCUMENT_KEY do PDF da parte de trás do documento de identificação da pessoa com foto (RG ou CNH) (enviado previamente) |
| `document_identification_type` | Qual o tipo do documento de identificação. Um enumerador que aceita "rg" ou "cnh" |
| `document_identification_number` *(obrigatório)* | Número do documento de identificação da pessoa enviado em document_identification |
| `email` | Email da pessoa |
| `phone` | Telefone da pessoa |
| `address` | Endereço da pessoa |
| `proof_of_residence` *(obrigatório)* | DOCUMENT_KEY do PDF do comprovante de endereço do endereço enviado (enviado previamente) |
| `ocr` | Objeto para entrega das chaves geradas pelo SDK de OCR |

### PHONE OBJECT

| Campo | Descrição |
|---|---|
| `country_code` *(obrigatório)* | Código DDI do telefone (https://ddi.guiamais.com.br/)(deve ter obrigatoriamente 3 dígitos). |
| `area_code` *(obrigatório)* | Código DDD do telefone (https://ddd.guiamais.com.br/).) |
| `number` *(obrigatório)* | Número de telefone (apenas números). |
| `document_number` *(obrigatório)* | Numero de documento do signatário. |

### ADDRESS OBJECT

| Campo | Descrição |
|---|---|
| `street` *(obrigatório)* | Rua do endereço. |
| `state` *(obrigatório)* | Estado do endereço (com dois caracteres maiúsculos). |
| `city` *(obrigatório)* | Cidade do endereço. |
| `neighborhood` *(obrigatório)* | Bairro do endereço. |
| `number` *(obrigatório)* | Número da rua. |
| `postal_code` *(obrigatório)* | CEP do endereço (http://www.buscacep.correios.com.br/sistemas/buscacep/) (apenas números). |
| `complement` *(obrigatório)* | Complemento do endereço (texto livre). |

### OCR OBJECT

| Campo | Descrição |
|---|---|
| `ocr` | Objeto para entrega das chaves geradas pelo SDK de OCR |

### COLLATERALS OBJECT

| Campo | Descrição |
|---|---|
| `percentage` | Porcentagem da garantia (vai de 0 a 1) |
| `collateral_type` *(obrigatório)* | Tipo de collateral. No caso do FGTS, precisa ser "fgts_balance" |
| `collateral_data` |  |

### COLLATERAL DATA OBJECT

| Campo | Descrição |
|---|---|
| `total_amount` *(obrigatório)* | Valor amortizado em determinada data |
| `due_date` | Data Hora do Pedido (formato "AAAA-MM-DD") |

### FINANCIAL OBJECT

| Campo | Descrição |
|---|---|
| `desired_installments` | Valor de desembolso para o cliente |
| `interest_type` *(obrigatório)* | Tipo de juros aplicado na dívida. |
| `credit_operation_type` *(obrigatório)* | Tipo de operação de crédito: "ccb", "cce", "cci", "nce" |
| `annual_interest_rate` *(obrigatório)* | Valor porcentual da parcela prefixada de juros (atenção: 1 = 100%) |
| `disbursement_date` | Data de desembolso (formato "AAAA-MM-DD") (excludente de disbursement_date) |
| `disbursement_start_date` | Data inicial do período de desembolso (formato "AAAA-MM-DD") (excludente de disbursement_date) |
| `disbursement_end_date` | Data final do período de desembolso (formato "AAAA-MM-DD") (excludente de disbursement_date) |
| `issue_date` | Data de emissão da CCB (formato "AAAA-MM-DD") |
| `interest_grace_period` | Carência de juros (em meses) |
| `principal_grace_period` | Carência do principal (em meses) |
| `number_of_installments` | Número de parcelas (anuais) |
| `fine_configuration` | configuração das multas |
| `rebates` | Lista de objetos de rebates. |

### REBATES OBJECT

| Campo | Descrição |
|---|---|
| `amount` | Valor do rebate. |
| `fee_type` | Tipo de fee |
| `amount_type` | Tipo do valor inserido (valor absoluto, valor em porcentagem) |
| `rebate_bank_account` | Objeto conta bancária de rebate. |

### FINE CONFIGURATION OBJECT

| Campo | Descrição |
|---|---|
| `contract_fine_rate` *(obrigatório)* | Valor porcentual fixo da multa |
| `interest_base` | Contagem do tempo para multa ("calendar_days" para dias corridos, "workdays" para dias úteis) |
| `monthly_rate` | Valor porcentual mensal da multa |

### DISBURSEMENT BANK ACCOUNT OBJECT

| Campo | Descrição |
|---|---|
| `bank_code` *(obrigatório)* | Identificador da instituição no Sistema de Pagamentos Brasileiro - Obrigatório apenas se o COMPE não for enviado. |
| `branch_number` *(obrigatório)* | Número da agência |
| `account_number` *(obrigatório)* | Número da conta |
| `account_digit` | Dígito verificador da conta (obrigatório caso haja) |
| `document_number`| CPF ou CNPJ do dono da conta para desembolso (obrigatório caso haja mais de uma conta para desembolso) |
| `name`  |Nome do dono da conta para desembolso (obrigatório caso haja mais de uma conta para desembolso) |
| `percentage_receivable` | Valor em porcentagem que a conta receberá no desembolso. Este campo é utilizado para definir a quantidade a ser dividida caso haja mais de uma conta para desembolso (no caso de ser somente uma conta, o valor integral será transferido). Caso a porcentagem não seja enviada (de uma, ou de todas as contas), a porcentagem restante será dividida igualmente entre as contas sem porcentagem definida. Caso todas as porcentagens sejam enviadas, a soma delas não pode passar de 100 |
| `ispb_number` | Identificador de Sistema de Pagamentos Brasileiro |
| `pix_key`  | Chave Pix |
| `qr_code_key` | Chave fornecida no momento da criação de um QR Code |
| `digitable_line` | Representação numérica do código de barras do boleto |

---

# Introdução ao Saque Aniversário FGTS

URL: /en/documentation/saque_aniversario_fgts/introducao

Conforme publicado pela lei 8.036 e regulamentado pela lei 13.932 de 2019, o trabalhador que possui conta vinculada do FGTS pode optar pela sistemática do Saque Aniversário, em alternativa à sistemática do Saque Rescisão do contrato de trabalho. A opção pelo Saque Aniversário permite a retirada de parte do saldo da(s) conta(s) vinculada(s) do FGTS, anualmente, no mês do seu aniversário.

### Pré requisitos para implementação

Para emitir operações de crédito FGTS é necessário primeiro realizar homologação de api na sandbox
Realizar roteiro de homologação

---

# roteiro_de_homologacao

URL: /en/documentation/saque_aniversario_fgts/roteiro_de_homologacao

## Roteiro de Homologação

Passo a passo para o consumo de serviços de antecipação do saque-aniversário FGTS em ambiente de homologação

Conforme publicado pela lei 8.036 e regulamentado pela lei 13.932 de 2019, o trabalhador que possui conta vinculada do FGTS pode optar pela sistemática do Saque Aniversário, em alternativa à sistemática do Saque Rescisão do contrato de trabalho. A opção pelo Saque Aniversário permite a retirada de parte do saldo da(s) conta(s) vinculada(s) do FGTS, anualmente, no mês do seu aniversário.

Por meio desta, é garantido a qualquer pessoa física receber nos próximos dias (a ser definido no momento de criação da operação) um montante cujo empréstimo terá como garantia até 7 anos das parcelas que originalmente tem o direito de resgatar no mês de seu aniversário.

## FGTS 

Fundo de Garantia do Tempo de Serviço (FGTS) é um fundo criado com o objetivo de proteger o trabalhador que for demitido sem justa causa. Mediante a abertura de uma conta vinculada ao contrato de trabalho, os empregadores depositam em contas abertas na Caixa Econômica Federal, no início de cada mês e em nome dos empregados, o valor correspondente a 8% do salário bruto de cada funcionário.

Nos próximos tópicos utilizaremos os termos:

- **Averbação**: Registro das parcelas do saque-aniversário FGTS como garantia da operação de crédito;
- **Desaverbação**: Liberação das parcelas devido ao cancelamento da operação ou quitação da dívida.

## Operação de Crédito

A QI Tech é uma Sociedade de Crédito Direto (SCD) com copetência de emitir operações de crédito com garantia nas parcelas do saque-aniversário FGTS por meio da emissão de Cédulas de Crédito Bancário (CCBs) cujo valor deve ser desembolsado na conta da pessoa que o contrata.

Nos próximos tópicos utilizaremos os termos:

- **SCD**: Conforme Art. 3o. da RESOLUÇÃO No. 4.656, DE 26 DE ABRIL DE 2018 a SCD é instituição financeira que tem por objeto a realização de operações de empréstimo, de financiamento e de aquisição de direitos creditórios exclusivamente por meio de plataforma eletrônica, com utilização de recursos financeiros que tenham como única origem capital próprio.
- **Tomador**: Pessoa física (detentora de CPF) que receberá o empréstimo
- **Credor**: Pessoa jurídica (detentora de CNPJ) a quem compete a capacidade de emitir operações de crédito, aqui representada pela QI Tech,
- **Originador**: Pessoa jurídica (detentora de CNPJ) que utilizará dos serviços da QI Tech para iniciar a operação de crédito a ser desembolsada para a conta do tomador
- **CCB**: Conforme Art. 1o. da MEDIDA PROVISÓRIA No 1.925-15, DE 14 DE DEZEMBRO DE 2000, a Cédula de Crédito Bancário é título de crédito emitido, por pessoa física ou jurídica, em favor de instituição financeira ou de entidade a esta equiparada, representando promessa de pagamento em dinheiro, decorrente de operação de crédito, de qualquer modalidade.
- **FIDC**: Fundo de Investimento em Direitos Creditórios são fundos responsáveis por converter uma dívida em título negociável, que pode ser vendido a uma investidora a preços reduzidos

## Serviços via API

Para que uma operação de antecipação de saque-aniversário FGTS seja completa em ambiente de homologação no nível de consumo de serviços via API os seguintes serviços devem ser utilizados com sucesso:

1. Consultar saldo disponível
2. Simulação do valor máximo
3. Simulação por valor desejado (opcional)
4. Envio de documentos
5. Criação de operação
6. Entrega de operação assinada pelo tomador
7. Recálculo de operação
8. Cancelamento de operação
9. Desaverbação

É importante mencionar que o originador esteja apto a receber webhooks (via método POST) em uma url cadastrada em nossa plataforma. Devido à assincronia no processo de assinatura da CCB pelo tomador, quando assinada, o documento resultante será enviado via webhook à url cadastrada pelo originador.

:::tip **A partir de quando começamos a operar em ambiente produtivo?**

Em conjunto com os setores comercial e jurídico entre as partes interessadas, ou seja:

- Credora (QiTech)
- Originadora
- FIDC
- Securitizadora (opcional)

A QI Tech identifica que uma integração está homologada quando estão concluídos:

1. Contrato de acordo de parceria
2. Acordo de correspondente bancário (CORBAN)
3. CCB emitida confere em cláusulas e valores (memória de cálculo)
4. Acordo de formas de cobrança de tarifas da QI e rebates
5. Formalização de veículos (QI, Fundo, Securitizadora) e minutas de cessão
6. Formalização de CNPJ e representantes da originadora que operarão em ambiente produtivo

:::

---

# Simulação do valor desejado

URL: /en/documentation/saque_aniversario_fgts/simulacao_do_valor_desejado

## Request
ENDPOINT /baas/fgts_simulation_guess
MÉTODO POST

Esse serviço mostra qual é o valor máximo que pode ser antecipado pelo tomador, de acordo com as parcelas informadas.

Como originador, é possível informar qual valor o tomador poderá desembolsar de cada parcela, sendo isso individual ou parcelas múltiplas.

Request Body

```json
{
    "target_disbursed_amount": 1000,
    "borrower": {
      "person_type": "natural"
    },
    "financial": {
        "interest_type": "pre_price_days",
        "credit_operation_type": "ccb",
        "annual_interest_rate": 0.05,
        "disbursement_date": "2022-07-25",
        "disbursement_start_date": "2022-07-27",
        "disbursement_end_date": "2022-07-27",
        "issue_date": "2019-07-25",
        "interest_grace_period": 0,
        "principal_grace_period": 0,
        "number_of_installments": 2,
        "fine_configuration": {
            "contract_fine_rate": 0,
            "interest_base": "workdays",
            "monthly_rate": 0
        }
    }
}

```

### Body Params

| Campo | Descrição                                                                         |
|---|-----------------------------------------------------------------------------------|
| `target_disbursed_amount` *(obrigatório)* | Valor de desembolso desejado para a operação de crédito                           |
| `borrower` *(obrigatório)* | Tomador da dívida, neste caso precisamos apenas do tipo de pessoa ("person_type") |
| `financial` | Objeto Financial (adaptado para o saque-aniversário FGTS)                         |

### BORROWER OBJECT

| Campo | Descrição |
|---|---|
| `person_type` *(obrigatório)* | Tomador da dívida, neste caso precisamos apenas do tipo de pessoa ("person_type") |

### FINANCIAL OBJECT

| Campo | Descrição |
|---|---|
| `desired_installments` | Valor de desembolso para o cliente |
| `interest_type` *(obrigatório)* | Tipo de juros aplicado na dívida. |
| `credit_operation_type` *(obrigatório)* | Tipo de operação de crédito: "ccb", "cce", "cci", "nce" |
| `annual_interest_rate` *(obrigatório)* | Valor porcentual da parcela prefixada de juros (atenção: 1 = 100%) |
| `disbursement_date`  | Data de desembolso (formato "AAAA-MM-DD") (excludente de disbursement_date) |
| `disbursement_start_date` *(obrigatório)* | Data inicial do período de desembolso (formato "AAAA-MM-DD") (excludente de disbursement_date) |
| `disbursement_end_date` *(obrigatório)* | Data final do período de desembolso (formato "AAAA-MM-DD") (excludente de disbursement_date) |
| `issue_date` *(obrigatório)* | Data de emissão da CCB (formato "AAAA-MM-DD") |
| `interest_grace_period` *(obrigatório)* | Carência de juros (em meses) |
| `principal_grace_period` *(obrigatório)* | Carência do principal (em meses) |
| `number_of_installments` *(obrigatório)* | Número de parcelas (anuais) |
| `fine_configuration` *(obrigatório)* | configuração das multas |
| `rebates` *(obrigatório)* | Lista de objetos de rebates. |

### DESIRED INSTALLMENTS OBJECT

| Campo | Descrição |
|---|---|
| `total_amount` *(obrigatório)* | Valor amortizado em determinada data |
| `due_date` | Data Hora do Pedido (formato "AAAA-MM-DD") |

### FINE CONFIGURATION OBJECT

| Campo | Descrição |
|---|---|
| `contract_fine_rate` *(obrigatório)* | Valor porcentual fixo da multa |
| `interest_base` | Contagem do tempo para multa ("calendar_days" para dias corridos, "workdays" para dias úteis) |
| `monthly_rate` | Valor porcentual mensal da multa |

### REBATES OBJECT

| Campo | Descrição |
|---|---|
| `amount` | Valor do rebate. |
| `fee_type` | Tipo de fee |
| `amount_type` | Tipo do valor inserido (valor absoluto, valor em porcentagem) |
| `rebate_bank_account` | Objeto conta bancária de rebate. |

### REBATES BANK ACCOUNT OBJECT

| Campo | Descrição |
|---|---|
| `name` | Nome da instituição financeira |
| `bank_code` | Código COMPE da instituição financeira (https://www.bcb.gov.br/pom/spb/estatistica/port/ASTR003.pdf) com 3 dígitos. |
| `ispb_number` | Identificador da instituição no Sistema de Pagamentos Brasileiro. |
| `account_digit` | Dígito da conta. |
| `branch_number` | Número da agência |
| `account_number` | Número da conta. |
| `document_number` | CPF ou CNPJ do dono da conta para o rebate. |

---

# Simulação do valor máximo

URL: /en/documentation/saque_aniversario_fgts/simulacao_do_valor_maximo

## Request

ENDPOINT /baas/fgts_simulation
MÉTODO POST

Esse serviço mostra qual é o valor máximo que pode ser antecipado pelo tomador, de acordo com as parcelas informadas.

Como originador, é possível informar qual valor o tomador poderá desembolsar de cada parcela, sendo isso individual ou parcelas múltiplas.

Request Body

```json
{
    "borrower": {
      "person_type": "natural"
    },
    "financial": {
        "interest_type": "pre_price_days",
        "credit_operation_type": "ccb",
        "annual_interest_rate": 0.05,
        "disbursement_date": "2022-07-25",
        "disbursement_start_date": "2022-07-27",
        "disbursement_end_date": "2022-07-27",
        "issue_date": "2019-07-25",
        "interest_grace_period": 0,
        "principal_grace_period": 0,
        "number_of_installments": 2,
        "fine_configuration": {
            "contract_fine_rate": 0,
            "interest_base": "workdays",
            "monthly_rate": 0
        }
    }
}

```

### Body Params

| Campo | Descrição |
|---|---|
| `borrower` *(obrigatório)* | Tomador da dívida, neste caso precisamos apenas do tipo de pessoa ("person_type") |
| `financial` | Objeto Financial (adaptado para o saque-aniversário FGTS) |

### BORROWER OBJECT

| Campo | Descrição |
|---|---|
| `person_type` *(obrigatório)* | Tomador da dívida, neste caso precisamos apenas do tipo de pessoa ("person_type") |

### FINANCIAL OBJECT

| Campo | Descrição |
|---|---|
| `desired_installments` | Valor de desembolso para o cliente |
| `interest_type` *(obrigatório)* | Tipo de juros aplicado na dívida. |
| `credit_operation_type` *(obrigatório)* | Tipo de operação de crédito: "ccb", "cce", "cci", "nce" |
| `annual_interest_rate` *(obrigatório)* | Valor porcentual da parcela prefixada de juros (atenção: 1 = 100%) |
| `disbursement_date`  | Data de desembolso (formato "AAAA-MM-DD") (excludente de disbursement_date) |
| `disbursement_start_date` *(obrigatório)* | Data inicial do período de desembolso (formato "AAAA-MM-DD") (excludente de disbursement_date) |
| `disbursement_end_date` *(obrigatório)* | Data final do período de desembolso (formato "AAAA-MM-DD") (excludente de disbursement_date) |
| `issue_date` *(obrigatório)* | Data de emissão da CCB (formato "AAAA-MM-DD") |
| `interest_grace_period` *(obrigatório)* | Carência de juros (em meses) |
| `principal_grace_period` *(obrigatório)* | Carência do principal (em meses) |
| `number_of_installments` *(obrigatório)* | Número de parcelas (anuais) |
| `fine_configuration` *(obrigatório)* | configuração das multas |
| `rebates` *(obrigatório)* | Lista de objetos de rebates. |

### DESIRED INSTALLMENTS OBJECT

| Campo | Descrição |
|---|---|
| `total_amount` *(obrigatório)* | Valor amortizado em determinada data |
| `due_date` | Data Hora do Pedido (formato "AAAA-MM-DD") |

### FINE CONFIGURATION OBJECT

| Campo | Descrição |
|---|---|
| `contract_fine_rate` *(obrigatório)* | Valor porcentual fixo da multa |
| `interest_base` | Contagem do tempo para multa ("calendar_days" para dias corridos, "workdays" para dias úteis) |
| `monthly_rate` | Valor porcentual mensal da multa |

### REBATES OBJECT

| Campo | Descrição |
|---|---|
| `amount` | Valor do rebate. |
| `fee_type` | Tipo de fee |
| `amount_type` | Tipo do valor inserido (valor absoluto, valor em porcentagem) |
| `rebate_bank_account` | Objeto conta bancária de rebate. |

### REBATES BANK ACCOUNT OBJECT

| Campo | Descrição |
|---|---|
| `name` | Nome da instituição financeira |
| `bank_code` | Código COMPE da instituição financeira (https://www.bcb.gov.br/pom/spb/estatistica/port/ASTR003.pdf) com 3 dígitos. |
| `ispb_number` | Identificador da instituição no Sistema de Pagamentos Brasileiro. |
| `account_digit` | Dígito da conta. |
| `branch_number` | Número da agência |
| `account_number` | Número da conta. |
| `document_number` | CPF ou CNPJ do dono da conta para o rebate. |

---

# Webhooks de Consulta de Saldo

URL: /en/documentation/saque_aniversario_fgts/webhooks_de_consulta_de_saldo

O webhook retornado terá duas opções. Ou ele retorna um sucesso, ou uma falha.

Em caso de sucesso:

Response Body

```json
{
    "key": "843ab07e-b16f-4dfa-b048-37c464483aa5",
    "status": "success",
    "webhook_type": "fgts_available_balance",
    "event_datetime": "2022-07-14T18:31:29",
    "data": {
        "reference_date": "2022-07-14",
        "periods": [{
                "amount": 776.41,
                "due_date": "2023-01-01"
            },
            {
                "amount": 508.25,
                "due_date": "2024-01-01"
            },
            {
                "amount": 286,
                "due_date": "2025-01-01"
            }
        ]
    }
}

```

Em caso de falha:

Request Body

```json
{
    "key": "843ab07e-b16f-4dfa-b048-37c464483aa5",
    "status": "failed",
    "webhook_type": "fgts_available_balance",
    "event_datetime": "2022-07-14T18:31:29",
    "data": {
        "enumerator": "unauthorized_institution",
        "description": "Institution isn’t authorized by the client"
    }
}

```

**Erros existentes na consulta:**

Os erros existentes são:

| Dígitos do CPF | Enumerador |Descrição |
|---|---|---|
| 90 | ongoing_operation | There's an ongoing operation |
| 91 | unauthorized_institution | Institution isn't authorized by the client |
| 92 | inexistent_anniversary_membership | Client does not have membership for anniversary withdraw on current date |
| 93 | on_locked_date_range | Not permitted action on current date |
| 94 | anniversary_membership_egress | Client moving away from anniversary membership. It needs to be canceled before requesting a reserve |
| 95 | processing_pending_changes | Changes on client's FGTS account are still being processed |
| 96, 97, 98 e 99 | caixa_error | Request wasn't able to process due to an error on CEF |

---

# Assinatura em Lote

URL: /en/documentation/siape/assinatura-em-lote

Agrupa **várias operações SIAPE** em **um único envelope** de assinatura do QI Sign. Você abre o lote, cria as operações referenciando o `document_batch_key`, confere (opcionalmente limpa) e dispara o envio para assinatura.

Fluxo recomendado para [compra de dívida](./04-portabilidade-refin.md) — onde N duplas `debt_purchase` + `refinancing` + 1 refin/refin consolidador podem ser assinadas num único envelope (servidor assina uma vez só).

:::caution Regras do lote
**Mesma titularidade:** todas as operações do lote devem ser do **CPF** (ou do **mesmo representante legal**) do servidor. Incluir CPF "A" e CPF "B" no mesmo lote gera **erro síncrono** no `POST /debt`.

**Tipos permitidos:** o lote SIAPE aceita apenas `POST /debt` com `collateral_type: federal_payroll`.
:::

## 1. Abrir o lote

ENDPOINT /document/document_batch
MÉTODO POST

**Request Body**

```json
{
  "type": "federal_payroll_external_batch",
  "certifier_type": "qi_sign",
  "batch_name": "Lote SIAPE compra-divida - 5ed20003-0610-46d2-88cc-a5d0de640696",
  "request_control_key": "5ed20003-0610-46d2-88cc-a5d0de640696"
}
```

### Campos chave

| Campo | Tipo | Descrição |
|---|---|---|
| `type` | string | Fixo: **`federal_payroll_external_batch`** |
| `certifier_type` | string | Fixo: **`qi_sign`** |
| `batch_name` | string | Nome identificador do lote (**máximo 100 caracteres**) |
| `request_control_key` | string (UUIDv4) | **Idempotência** — não reutilize entre lotes |

**Response Body**

```json
{
  "document_batch_key": "17f35e19-a039-468f-aaa7-84aa8edec3dc"
}
```

Guarde o `document_batch_key` retornado — ele é referenciado em todas as próximas chamadas.

## 2. Incluir operações no lote

Ao criar cada operação SIAPE, envie **`document_batch_key` na raiz** do payload do `POST /debt` (mesmo nível dos demais campos principais).

ENDPOINT /debt
MÉTODO POST

```json
{
  "document_batch_key": "17f35e19-a039-468f-aaa7-84aa8edec3dc",
  "borrower": { "...": "demais campos do borrower" },
  "financial": { "...": "demais campos financeiros" },
  "operation_type": "refinancing",
  "collaterals": [
    {
      "collateral_type": "federal_payroll",
      "collateral_data": {
        "reservation_type": "refinancing",
        "authority_code": "17000",
        "registration_code": "1354387"
      }
    }
  ],
  "modality": { "code": "0202" },
  "refinanced_credit_operations": [
    { "...": "operation_key + contrato externo (ver Portabilidade + Refin)" }
  ]
}
```

O restante do body segue o contrato do `POST /debt`. Consulte os roteiros da [Margem Livre](./03-margem-livre.md) ou [Portabilidade + Refinanciamento](./04-portabilidade-refin.md) conforme a modalidade.

:::tip Compra de dívida cabe num lote só
Pra [compra de dívida](./04-portabilidade-refin.md) (`debt_purchase` + `refinancing` port-enrustido), todas as duplas Op A + Op B + o refin/refin consolidador podem entrar no mesmo lote.
:::

## 3. Consultar documentos do lote

Recomendado **antes de fechar o lote** para conferir os documentos agrupados.

ENDPOINT /document/document_batch/DOCUMENT_BATCH_KEY
MÉTODO GET

**Response Body**

```json
{
  "document_batch_key": "1eee4ec2-05f5-45ef-aa64-38bb3d9de02f",
  "documents": [
    {
      "document_key": "5cca1dad-28fe-4f19-8bbb-0edd6f042384",
      "document_type": "ccb_pre_price_days"
    },
    {
      "document_key": "c109d589-ae18-4f4f-ad31-2879bf714c71",
      "document_type": "ccb_pre_price_days"
    }
  ]
}
```

## 4. Limpar documentos do lote (opcional)

Remove **todos os documentos** vinculados ao lote — útil pra reagrupar do zero se identificar inconsistência antes do envio.

ENDPOINT /document/document_batch/DOCUMENT_BATCH_KEY/documents
MÉTODO DELETE

Body vazio. Response: HTTP 200.

## 5. Enviar para assinatura

Fecha o lote e dispara os documentos pro QI Sign. **Antes desse PUT, os documentos não vão pro servidor.** É o gatilho final.

ENDPOINT /document/document_batch/DOCUMENT_BATCH_KEY/send_to_signature
MÉTODO PUT

Body: `{}`. Response: HTTP 200.

## Erros comuns

| HTTP | Código | Endpoint | Quando ocorre |
|---|---|---|---|
| 404 | `DOC000007` | `GET /document/document_batch/DOCUMENT_BATCH_KEY` | `document_batch_key` inexistente |
| 409 | `DOC000103` | `POST /document/document_batch` | `request_control_key` duplicado (idempotência violada) |

**Exemplo — DOC000103 (idempotência)**

```json
{
  "code": "DOC000103",
  "title": "Bad Request",
  "description": "request_control_key already exists",
  "translation": "Chave de controle da request já existe.",
  "http_status": 409
}
```

:::info Conflito de titularidade
Validação de **mesmo CPF/representante** no lote retorna erro no `POST /debt` (não no endpoint do lote). O corpo de erro segue o catálogo do `/debt`.
:::

---

# Cancelamento, Desaverbação e Reversal (SIAPE)

URL: /en/documentation/siape/cancelamento

Cancelar uma operação SIAPE tem dois eixos independentes:
1. **Cancelamento da CCB** — estado da operação no LaaS, e eventual estorno do dinheiro desembolsado.
2. **Desaverbação no SIGEPE** — liberação da margem em folha.

Os dois acontecem de forma assíncrona. Cancelar a operação NÃO libera a margem instantaneamente.

## 1. Pré-desembolso — Cancelamento Imediato

```http
PATCH /debt/{DEBT_KEY}/cancel
```

Operação imediatamente vai pra `canceled`. Sem reversal financeiro (dinheiro nem saiu). QI dispara em seguida a desaverbação no SIGEPE.

Webhook: `debt` com `status: canceled` + `cancel_reason_enumerator`.

## 2. Pós-desembolso — Janela de Desistência (7 dias úteis)

**Janela legal de 7 dias úteis** após desembolso. Dentro dela:

```http
PATCH /debt/{DEBT_KEY}/cancel
```

A response retorna um **PIX QR Code** pra borrower pagar de volta o dinheiro desembolsado:

| Campo na response | Significado |
|---|---|
| `cancel_qr_code.qr_code_url` / `digitable_line` | PIX copia-e-cola |
| `cancel_qr_code.amount` | Valor a devolver |
| `cancel_qr_code.expiration` | Prazo (15 dias úteis após desembolso) |

Quando o borrower paga:
1. QI confirma o pagamento.
2. Dispara o **reversal financeiro automático**.
3. Webhook `reversal`:
   ```json
   {
     "webhook_type": "reversal",
     "credit_operation_key": "<uuid>",
     "reversal": {
       "status": "pending_fund",
       "amount": 2026.93,
       "is_total": true,
       "is_operation_canceled": true,
       "reversal_key": "<uuid>"
     }
   }
   ```
4. QI dispara a desaverbação no SIGEPE.
5. Operação vai pra `canceled`.

> [!warning] Janela operacional do SIGEPE afeta desaverbação
> Como o SIAPE só processa 07:00-00:00 em dias úteis, a desaverbação pode demorar. Cancelamento de PIX QR funciona 24/7 (BaaS); só a parte do SIGEPE espera janela.

Restrições pós-desembolso:
- Status `open` (sem parcelas pagas).
- Pagamento parcial bloqueia o cancelamento.
- Sem cancelamento parcial.

## 3. Cancelamento Permanente

```http
PATCH /debt/{DEBT_KEY}/cancel/permanent
```

`canceled_permanently` — não há volta. Sem reversal automático.

## 4. Desaverbação no SIGEPE

![Fluxo de cancelamento SIAPE](/img/diagrams/siape-cancelamento.svg)

| Status | Significado |
|---|---|
| `waiting_confirmation` | SIGEPE ainda processando |
| `successfully_deleted` | Margem liberada |
| `communication_error` | SIGEPE indisponível — QI retenta |

Pra consultar:

```http
GET /debt/{DEBT_KEY}/collateral
```

## 5. Auto-cancelamento (7 dias)

Operações em `canceled` por mais de 7 dias viram automaticamente `canceled_permanently`. Aplica-se a:
- `consent_refused`
- `consent_expired`
- Pendente de assinatura além do prazo
- QR não pago dentro de 15 dias úteis

## Resumo dos Endpoints

| Endpoint | Quando usar | Reversal automático? |
|---|---|---|
| `PATCH /debt/{KEY}/cancel` (pré-desembolso) | Antes do desembolso | Não aplica |
| `PATCH /debt/{KEY}/cancel` (pós-desembolso) | Em até 7 dias úteis após desembolso | Sim — após borrower pagar o PIX QR |
| `PATCH /debt/{KEY}/cancel/permanent` | Definitivo (sem volta) | Não |

## Cancel reasons no webhook `debt` (`status: canceled`)

| Enumerador | Significado |
|---|---|
| `manual` | Cancelado via API ou portal |
| `waiting_signature` | Não assinou no prazo |
| `not_collateral_constituted` | Averbação falhou (consent_refused, consent_expired, etc.) |
| `is_portability` | Portabilidade falhou |
| `pix_max_retry` | Muitas falhas no desembolso PIX |
| `lack_of_resource` | Sem recurso pra desembolsar |
| `kyc_not_accepted` | KYC reprovado |

→ [Lista completa de enumeradores em Mapa de Status](./08-mapa-de-status.md)

---

# Consulta de Margem Consignável (SIAPE)

URL: /en/documentation/siape/consulta-margem

Endpoint que consulta a margem disponível do servidor federal no SIGEPE/SIAPE. Sem o `balance_key` desse passo, não dá pra simular nem emitir.

## Pré-requisitos

1. **Servidor pré-autorizou QI SCD** no Portal do Servidor (válida 30 dias).
2. `authority_code` (código UPAG) — recebido na fase comercial.

> [!warning]
> Diferente do Exército, **não há upload de documento de autorização**. Tudo é digital no portal.

## Endpoint

```http
POST /federal_payroll/balance
```

| Campo | Tipo | Descrição |
|---|---|---|
| `document_number` | string | CPF do servidor (11 dígitos) |
| `authority_code` | string | Código da Unidade Pagadora (UPAG) |
| `registration_code` | string | Matrícula SIAPE |

Resposta síncrona:

```json
{
  "balance_key": "...",
  "status": "pending_search"
}
```

## Webhook de resultado

Tipo: `federal_payroll.balance`

Estrutura do payload de **sucesso**:
```json
{
  "balance_query": [
    {
      "available_balance": 3500.00,
      "authority_code": "17000",
      "registration_code": "1354387",
      "employment_relationship": "active",
      "consigned_credit": 1200.00,
      "consigned_card": 300.00
    }
  ]
}
```

- `available_balance` — margem disponível
- `consigned_credit` — quanto já está consignado em crédito
- `consigned_card` — quanto está em cartão consignado

## Enumeradores de falha (balance)

| Enumerador | Significado | Ação |
|---|---|---|
| `unauthorized_institution` | Servidor não pré-autorizou QI SCD no portal | Pedir autorização |
| `inexistent_relationship` | Sem vínculo federal | Verificar dados |
| `invalid_document_number` | CPF malformado | Verificar CPF |
| `inactive_federal_employee` | Servidor inativo | Não há ação |
| `deceased_federal_employee` | Servidor falecido | Não há ação |

## Cenários de Sandbox

### Sucesso

| `document_number` | `authority_code` | `registration_code` |
|---|---|---|
| 25256363506 | 17000 | 1354387 |

### Falha

| `document_number` | `failure_reason` |
|---|---|
| 71987878353 | `unauthorized_institution` |

> [!info] Reset diário
> Reservas não-finalizadas no sandbox são **encerradas todo dia às 23:59h** pra manter o ambiente limpo.

## Próximo passo

Após o webhook `succeeded` com `available_balance` retornado, escolha a modalidade:

- [Margem Livre](./03-margem-livre.md) — crédito novo com margem disponível
- [Portabilidade + Refinanciamento](./04-portabilidade-refin.md) — refin de operação QI ou compra de dívida externa

---

# Conta Interna para Desembolso

URL: /en/documentation/siape/conta-interna-desembolso

Em **compra de dívida**, **portabilidade** e **refinanciamento** consignado, o desembolso da operação **não vai direto para a conta externa do tomador**: ele cai numa conta interna **em nome do tomador** (aberta pelo parceiro via `POST /account`). É a partir dessa conta que a QI executa as ações pós-desembolso — **quitação do contrato externo**, **repasse de troco**, **conciliação**.

:::tip Por que conta interna?
Concentrar o desembolso numa conta operacional dá controle do fluxo: a QI consegue orquestrar quitação externa + averbação + repasse de troco sem depender de SLA de banco terceiro no meio do processo.
:::

## Quando usar conta interna vs externa

| Cenário | `disbursement_bank_account` |
|---|---|
| [Margem Livre](./03-margem-livre.md) (crédito novo direto) | Conta **externa** do tomador |
| [Refinanciamento puro](./04-portabilidade-refin.md) (renegocia CO QI ativa) | Conta **interna** em nome do tomador |
| [Portabilidade](./04-portabilidade-refin.md) (com ou sem troco) | Conta **interna** em nome do tomador |
| [Compra de dívida](./04-portabilidade-refin.md) (`debt_purchase` + `refinancing` port-enrustido) | Conta **interna** em nome do tomador **nas duas operações da dupla** |
| Refin/refin consolidador (opcional, fecha várias port/refins) | Conta **interna** em nome do tomador |

## 1. Abrir a conta interna em nome do tomador

ENDPOINT /account
MÉTODO POST

A conta é aberta pelo **parceiro** (autenticado com seus `client_integration_key`), com o `owner_document_number` apontando para o **CPF do tomador**. Reutilize a conta existente — uma por tomador (não abrir nova a cada operação).

**Request Body**

```json
{
  "owner_document_number": "<CPF DO TOMADOR>",
  "owner_person_key": "<PERSON_KEY DO TOMADOR>",
  "requester_key": "<REQUESTER_KEY DO PARCEIRO>",
  "webhook_enabled": true
}
```

:::info Pré-requisito
O tomador precisa estar **onboarded** previamente (ter `person_key`) — o parceiro envia esse `person_key` no `owner_person_key`. Caso contrário, o `/account` falha com `ACC000xxx` por validation.
:::

**Response Body**

```json
{
  "account_key": "602de111-21e1-4c1e-8c5c-d60c032309ca",
  "account_branch": "0001",
  "account_number": "1431704",
  "account_digit": "3",
  "owner_document_number": "<CPF DO TOMADOR>",
  "owner_name": "<NOME DO TOMADOR>",
  "bank_code": "329",
  "account_status": "active",
  "webhook_enabled": true
}
```

:::tip Idempotência por tomador
Se já existe conta ativa para esse `owner_document_number` no parceiro, evite chamar `POST /account` de novo — consulte `GET /accounts?owner_document_number= ` antes e reaproveite o `account_key` retornado.
:::

## 2. Usar a conta no `/debt`

Use os dados retornados em `disbursement_bank_account` no payload do `POST /debt`. **A mesma conta vai nas DUAS operações da dupla `debt_purchase` + `refinancing`** (e no `refinancing` consolidador, se houver).

```json
{
  "disbursement_bank_account": {
    "name": "<NOME DO TOMADOR>",
    "bank_code": "329",
    "account_type": "checking_account",
    "account_branch": "0001",
    "account_number": "1431704",
    "account_digit": "3",
    "document_number": "<CPF DO TOMADOR>",
    "transfer_method": "ted"
  }
}
```

| Campo | Valor (conta interna QI Tech) |
|---|---|
| `bank_code` | `"329"` (QI Tech S.A. — SCD) |
| `account_branch` | `"0001"` |
| `account_number` / `account_digit` | retornados no `POST /account` |
| `document_number` | **CPF do tomador** (mesmo do `owner_document_number`) |
| `transfer_method` | `"ted"` (recomendado para `payment_type_id: 10`) |

Exemplo completo: ver [Portabilidade + Refinanciamento — Compra de dívida](./04-portabilidade-refin.md).

## 3. Ações pós-desembolso

A QI dispara as ações abaixo automaticamente conforme os webhooks confirmam cada etapa.

### 3.1 Conferir saldo

ENDPOINT /account/ACCOUNT_KEY/balance
MÉTODO GET

### 3.2 Quitação do contrato externo (port)

Disparada pela QI ao receber `credit_operation.collateral` (`reservation_status: deleted`) na operação antiga: saldo da conta interna é enviado ao banco origem via **PIX** ou **TED** para liquidar o contrato externo.

### 3.3 Repasse de troco pro tomador (se houver)

Se `final_disbursement_amount > 0` na simulação, o saldo residual é transferido da conta interna para a **conta externa do tomador** (informada no onboarding ou no payload da operação).

### 3.4 Conciliação

ENDPOINT /account/ACCOUNT_KEY/statement
MÉTODO GET

Query params `from_date` e `to_date` no formato `YYYY-MM-DD`.

### 3.5 Webhooks relevantes

| Webhook | Quando dispara |
|---|---|
| `account.balance_change` | Crédito recebido na conta interna (desembolso da CO) |
| `pix_transfer.status_change` | Quitação externa OU repasse de troco confirmados |
| `ted.status_change` | Quitação externa OU repasse via TED confirmados |

## Referências

- [Conta de pagamento — fluxo completo](/documentation/contas/abertura_de_conta/fluxo_de_abertura_de_conta) — referência do `POST /account` em detalhes
- [Portabilidade + Refinanciamento](./04-portabilidade-refin.md) — usa essa conta em compra de dívida (`debt_purchase` + `refinancing`)
- [Webhooks](./07-webhooks.md) — eventos assíncronos da operação

---

# Modelos de Formalização (SIAPE)

URL: /en/documentation/siape/formalizacao

A QI suporta **5 modelos de formalização** pra operações SIAPE — mesmo conjunto do Exército. Adicionalmente, pra agrupar várias operações num único envelope (recomendado em [compra de dívida](./04-portabilidade-refin.md)), use [Assinatura em Lote](./11-assinatura-em-lote.md).

:::tip Várias operações no mesmo envelope
Em compra de dívida com N duplas `debt_purchase` + `refinancing` (+ refin/refin consolidador), use [Assinatura em Lote](./11-assinatura-em-lote.md) (`POST /document/document_batch` com `type: federal_payroll_external_batch`) — o servidor assina tudo de uma vez só.
:::

## Modelos disponíveis

| Modelo | Quando usar |
|---|---|
| **QI Sign automático** (default) | QI envia link de assinatura ao borrower; nenhuma config extra |
| **QI Sign em lote** | Várias operações num único envelope; ver [Assinatura em Lote](./11-assinatura-em-lote.md) |
| **PDF assinado externamente** | Parceiro tem signature provider próprio |
| **Data-signature: opt-in** | Borrower clica "concordo" em portal do parceiro |
| **Data-signature: zip** | Parceiro envia zip de evidências |
| **Data-signature: selfie** | Biometria via CaaS |

## QI Sign Automático

Não requer chamada adicional após `/debt`. QI envia URL pro borrower. Webhook `debt` fires com `status: signature_finished`.

## PDF assinado externamente

```http
POST /debt/{DEBT_KEY}/signed
```

```json
{
  "signed_document_key": "<uuid retornado pelo upload do PDF>"
}
```

## Data-signature: opt-in

```json
{
  "data_signature": {
    "type": "opt_in",
    "evidence": { "ip_address": "...", "user_agent": "...", "timestamp": "..." }
  }
}
```

## Data-signature: zip

```json
{
  "data_signature": {
    "type": "zip",
    "signed_document_key": "<uuid do zip>"
  }
}
```

## Data-signature: selfie

Requer integração CaaS (face match + liveness):

```json
{
  "data_signature": {
    "type": "selfie",
    "signed_document_key": "<image_key do CaaS>"
  }
}
```

## Webhook após formalização

`debt` com `status: signature_finished` — assinatura aceita pela QI. Em seguida, se `reservation_method: issuing`, a averbação é disparada agora; se `creation`, já foi disparada antes e o desembolso entra na fila quando confirmada.

## Próximo passo

Após o `signature_finished`, a operação segue automaticamente: averbação confirmada (se `issuing`) → desembolso PIX/TED → webhook `debt` (`disbursed`).

Para acompanhar via webhooks: [Webhooks](./07-webhooks.md). Para cancelar a qualquer momento: [Cancelamento](./06-cancelamento.md).

---

# SIAPE-SIGEPE — Introdução

URL: /en/documentation/siape/introducao

API para originação de **CCB consignado** para **servidores públicos federais** (professores em universidades federais, funcionários em órgãos federais — **não inclui** militares). A reserva de margem é feita via **SIGEPE/SIAPE** e exige pré-autorização da QI SCD no **Portal do Servidor** pelo próprio servidor antes de qualquer operação.

| Item | Valor |
|---|---|
| Autoridade pagadora | Governo Federal / **SIGEPE-SIAPE** |
| Tipo de garantia (`collateral_type`) | `federal_payroll` |
| Modelo de reserva | Averbação (assíncrona, consentida no Portal do Servidor) |
| Funcionamento | **07:00–00:00, dias úteis, exceto feriados** |
| Modalidades suportadas | [Margem Livre (Crédito Novo)](./03-margem-livre.md) e [Portabilidade + Refinanciamento](./04-portabilidade-refin.md) |
| Pré-autorização do servidor | **30 dias** de validade — Portal do Servidor: *Consignações → Empréstimo Consignado → Autorizar Consignatário* |
| Instrumento | CCB (via `POST /debt`) |

:::danger Atenção!
Os webhooks da QI Tech não devem ser mapeados de forma restrita.
Campos adicionais podem ser incluídos aos payloads dos webhooks retornados em nossas APIs.
:::

:::info Reenvio de Webhooks
Você pode consultar e reenviar webhooks seguindo as instruções detalhadas na documentação: [Reenvio de Webhooks](/documentation/notificacoes/reenvio_de_notificacoes).
:::

:::caution Janela operacional
Diferente do Exército (24/7), o SIAPE só processa de **segunda a sexta, das 07:00 às 00:00**. Requisições de averbação fora dessa janela ficam em fila e são processadas no próximo dia útil. Planeje retries e SLA com isso em mente.
:::

## Fluxo End-to-End

Em **margem livre** o desembolso vai direto pra conta externa do servidor. Em **refinanciamento, portabilidade e compra de dívida** o desembolso vai pra uma **conta interna em nome do tomador** (aberta pelo parceiro via `POST /account`) — daí a QI quita o contrato externo, repassa o troco e faz a conciliação. Ver [Conta Interna para Desembolso](./10-conta-interna-desembolso.md).

![Fluxo end-to-end SIAPE](/img/diagrams/siape-introducao.svg)

## Modalidades

A operação se divide em quatro modalidades, escolhidas no `operation_type` e `collateral_data`:

| Modalidade | `operation_type` / `reservation_type` | Quando usar | Doc |
|---|---|---|---|
| **Margem Livre** (Crédito Novo) | `operation_type: structured_operation` / `reservation_type: new_credit` | Servidor com margem disponível; sem dívida externa nem refin de operação ativa | [→ Margem Livre](./03-margem-livre.md) |
| **Refinanciamento** | `operation_type: refinancing` / `reservation_type: refinancing` + `operation_key` | Renegociar operação QI ativa (prazo/taxa), eventualmente liberando troco | [→ Port + Refin](./04-portabilidade-refin.md) |
| **Portabilidade** (com ou sem troco) | `operation_type: refinancing` / `reservation_type: refinancing` + `original_contract_number` | Trazer dívida de outro banco; pode incluir troco | [→ Port + Refin](./04-portabilidade-refin.md) |
| **Compra de dívida** (port enrustida) | `operation_type: debt_purchase` + `operation_type: refinancing` (dupla) | Trazer N dívidas externas; QI emite uma dupla `debt_purchase` + `refinancing` por contrato externo, com desembolso em [conta interna em nome do tomador](./10-conta-interna-desembolso.md) | [→ Port + Refin](./04-portabilidade-refin.md) |

## Pré-requisitos

1. **Servidor pré-autorizou QI SCD no Portal do Servidor** — autorização válida 30 dias. Sem isso, `federal_payroll.balance` falha com `unauthorized_institution`. O parceiro deve orientar o servidor a entrar em `Consignações → Empréstimo Consignado → Autorizar Consignatário` antes de qualquer chamada.
2. **Não há upload de termo de autorização** — diferente do Exército, a autorização SIAPE é digital no portal (não há `authorization_document_key` no payload de balance).

## Referência por área

- [Consulta de Margem](./02-consulta-margem.md) — endpoint `/federal_payroll/balance` + UPAG
- [Margem Livre](./03-margem-livre.md) — Simulação + Emissão para `new_credit`
- [Portabilidade + Refinanciamento](./04-portabilidade-refin.md) — Simulação + Emissão para `refinancing` + payloads de compra de dívida (`debt_purchase` + `refinancing` port-enrustido)
- [Formalização](./05-formalizacao.md) — 5 modelos: QI Sign, PDF, opt-in, zip, selfie
- [Conta Interna para Desembolso](./10-conta-interna-desembolso.md) — POST `/account` em nome do tomador + uso em compra de dívida + ações pós-desembolso
- [Assinatura em Lote](./11-assinatura-em-lote.md) — agrupar várias operações num único envelope QI Sign (`POST /document/document_batch`)
- [Cancelamento, Desaverbação e Reversal](./06-cancelamento.md) — pré + pós-desembolso + reversal automático
- [Webhooks](./07-webhooks.md) — todos os eventos assíncronos + payloads
- [Mapa de Status](./08-mapa-de-status.md) — enumeradores consolidados
- [Mocks (Sandbox)](./09-mocks-sandbox.md) — dados de teste e cenários end-to-end

---

# Mapa de Status

URL: /en/documentation/siape/mapa-de-status

Referência consolidada de todos os enumeradores que podem aparecer nas respostas síncronas e webhooks do produto consignado SIAPE.

## Consulta de Margem (`federal_payroll.balance`)

| Status | Significado |
|---|---|
| `pending_search` | Resposta síncrona — consulta enfileirada |
| `succeeded` | Webhook — margem retornada |
| `failure` | Webhook — falha |

### Failure reasons

| Enumerador | Significado |
|---|---|
| `unauthorized_institution` | Servidor não pré-autorizou QI SCD no Portal |
| `inexistent_relationship` | Sem vínculo federal |
| `invalid_document_number` | CPF malformado |
| `inactive_federal_employee` | Servidor inativo |
| `deceased_federal_employee` | Servidor falecido |

## Averbação / Desaverbação (`credit_operation.collateral`)

| Status | Significado |
|---|---|
| `pending_consent` | SIGEPE aceitou; aguardando servidor confirmar no Portal |
| `success` | Averbação confirmada (`collateral_constituted: true`) |
| `failure` | Falha (ver enumerator) |

### Enumeradores de failure

| Enumerador | Ação |
|---|---|
| `consent_refused` | Servidor recusou no Portal — cancela operação |
| `consent_expired` | Janela de consentimento expirou — cancela |
| `invalid_balance` | Margem insuficiente — cancela |
| `unauthorized_institution` | Autorização QI SCD expirou no Portal — **retenta por até 7 dias** |
| `origin_contract_not_found` | Contrato origem (port/refin) não existe — cancela |
| `waiting_for_origin_contract_closure` | Aguardando quitação externa — permanece em retry |
| `expired_portability` | Janela de port no SIGEPE fechou |
| `successfully_deleted` | Margem desaverbada com sucesso |

## Operação (`debt`)

| Status | Significado |
|---|---|
| `waiting_signature` | Aguardando assinatura |
| `signature_finished` | Assinatura concluída |
| `waiting_disbursement` | Aguardando desembolso |
| `disbursed` | Desembolsado |
| `canceled` | Cancelada (não-permanente) |
| `canceled_permanently` | Cancelada definitivamente |
| `settled` | Liquidada |

### Cancel reasons

| Enumerador | Significado |
|---|---|
| `manual` | Cancelado via API ou portal |
| `waiting_signature` | Não assinou no prazo |
| `not_collateral_constituted` | Averbação falhou |
| `is_portability` | Portabilidade falhou |
| `pix_max_retry` | Muitas falhas no desembolso PIX |
| `lack_of_resource` | Sem recurso pra desembolsar |
| `kyc_not_accepted` | KYC reprovado |
| `agencia_conta_invalida` | Erro em dados bancários |
| `invalid_account` | Conta inválida |
| `rejected_payment` | Pagamento recusado pelo banco destino |

## Reversal (cancelamento pós-desembolso)

| Status | Significado |
|---|---|
| `pending_fund` | Reversal iniciado, aguardando devolução pro fundo |
| `completed` | Reversal completo |
| `failed` | Reversal falhou (raro — investigação manual) |

## Parcelas (`installment.status_change`)

| Status | Significado |
|---|---|
| `opened` | Aberta, ainda não venceu |
| `waiting_payment` | Aberta, na data de vencimento |
| `paid` | Paga em dia |
| `paid_early` | Paga antes do vencimento |
| `paid_partial` | Paga parcialmente |
| `paid_overdue` | Paga após o vencimento |
| `paid_partial_overdue` | Paga parcialmente após vencimento |
| `overdue` | Em atraso |
| `canceled` | Cancelada |

## Recuperar último estado

```http
GET /debt/{DEBT_KEY}/collateral
```

Retorna `last_response` + `reservation_status` + timestamp.

---

# Margem Livre (Crédito Novo)

URL: /en/documentation/siape/margem-livre

Esteira de **originação direta** quando o servidor federal tem margem consignável disponível no SIAPE/SIGEPE. Cobre simulação e emissão para `reservation_type: new_credit`.

Para refinanciar uma operação QI ativa ou trazer dívida de outro banco, ver [Portabilidade + Refinanciamento](./04-portabilidade-refin.md).

## Pré-requisitos

- Servidor **pré-autorizou QI SCD no Portal do Servidor** (válida 30 dias).
- `balance_key` recebido na [Consulta de Margem](./02-consulta-margem.md), com webhook `federal_payroll.balance` em `status: succeeded`.
- `available_balance` retornado > parcela desejada × prazo.

## 1. Simulação

ENDPOINT /debt_simulation
MÉTODO POST

**Request Body**

```json
{
  "borrower": {
    "person_type": "natural",
    "individual_document_number": "25256363506"
  },
  "financial": {
    "first_due_date": "2026-07-01",
    "installment_face_value": 500.00,
    "disbursement_date": "2026-06-02",
    "number_of_installments": 72,
    "monthly_interest_rate": 0.0185,
    "interest_type": "pre_price_days",
    "credit_operation_type": "ccb",
    "interest_grace_period": 0,
    "principal_grace_period": 0,
    "fine_configuration": {
      "monthly_rate": 0.01,
      "interest_base": "calendar_days",
      "contract_fine_rate": 0.02
    }
  },
  "collaterals": [
    {
      "collateral_type": "federal_payroll",
      "percentage": 1,
      "collateral_data": {
        "reservation_type": "new_credit",
        "authority_code": "17000",
        "registration_code": "1354387"
      }
    }
  ]
}
```

### Campos chave

| Campo | Descrição |
|---|---|
| `collaterals[].collateral_type` | **`federal_payroll`** (obrigatório) |
| `collaterals[].collateral_data.reservation_type` | **`new_credit`** — sempre pra margem livre |
| `collaterals[].collateral_data.authority_code` | Código da Unidade Pagadora (UPAG) |
| `collaterals[].collateral_data.registration_code` | Matrícula SIAPE |
| `financial.installment_face_value` | Parcela — ≤ `available_balance` |
| `financial.number_of_installments` | Prazo (geralmente até 96 meses pra SIAPE) |

`modality.code` **NÃO** é obrigatório em margem livre.

### Janela operacional

Pra `disbursement_date`, lembre que o SIAPE só processa em **dias úteis das 07:00 às 00:00**. Datas em fim de semana ou feriados são empurradas pro próximo dia útil.

## 2. Emissão

ENDPOINT /debt
MÉTODO POST

**Request Body**

```json
{
  "borrower": {
    "name": "MARIA DOS SANTOS",
    "email": "maria@email.com",
    "phone": { "number": "900000000", "area_code": "11", "country_code": "+55" },
    "address": {
      "city": "Brasília", "state": "DF", "number": "100",
      "street": "Esplanada", "complement": "",
      "postal_code": "70000000", "neighborhood": "Centro"
    },
    "role_type": "issuer",
    "birth_date": "1978-09-22",
    "mother_name": "JOSEFINA DOS SANTOS",
    "person_type": "natural",
    "individual_document_number": "25256363506",
    "gender": "female",
    "nationality": "brasileiro",
    "is_pep": false,
    "marital_status": "married"
  },
  "financial": ,
  "simplified": true,
  "collaterals": [
    {
      "collateral_type": "federal_payroll",
      "percentage": 1,
      "collateral_data": {
        "reservation_type": "new_credit",
        "reservation_method": "creation",
        "authority_code": "17000",
        "registration_code": "1354387"
      }
    }
  ],
  "disbursement_bank_account": {
    "name": "MARIA DOS SANTOS",
    "bank_code": "001",
    "account_type": "checking_account",
    "account_digit": "8",
    "branch_number": "1234",
    "account_number": "00098765",
    "document_number": "25256363506",
    "transfer_method": "ted"
  },
  "purchaser_document_number": "32402502000135"
}
```

### `reservation_method`

**creation (averbação imediata)**

Averbação no SIGEPE dispara junto com a criação do `/debt`.

**issuing (averbação após formalização)**

Averbação só dispara após a formalização (`POST /debt/{KEY}/signed`).

### Etapa-chave: confirmação do servidor no Portal

![Fluxo de margem livre SIAPE](/img/diagrams/siape-margem-livre.svg)

:::warning Servidor precisa confirmar
Após o `/debt`, o webhook chega com `status: pending_consent`. **O servidor precisa entrar no Portal do Servidor e confirmar a operação** dentro da janela do SIGEPE. Se não confirmar, expira com `consent_expired` e cancela. Comunique o servidor imediatamente após o `/debt`.
:::

### Webhooks pós `/debt`

| Webhook | Status | Quando |
|---|---|---|
| `debt` | `waiting_signature` | Operação criada |
| `credit_operation.collateral` | `pending_consent` | Aguardando servidor confirmar no Portal |
| `credit_operation.collateral` | `success` (`collateral_constituted: true`) | Servidor confirmou; averbação ativa |
| `debt` | `disbursed` | Desembolso PIX/TED enviado |

→ Próximo passo: [Formalização](./05-formalizacao.md)

## Falhas comuns

| Webhook / Erro | Enumerador | Significado | Ação |
|---|---|---|---|
| `federal_payroll.balance` | `unauthorized_institution` | Servidor não pré-autorizou QI SCD | Solicitar autorização |
| `federal_payroll.balance` | `inexistent_relationship` | Sem vínculo federal | Verificar dados |
| `credit_operation.collateral` | `invalid_balance` | Margem insuficiente | Reduzir parcela |
| `credit_operation.collateral` | `consent_refused` | Servidor recusou no Portal | Conversar com servidor |
| `credit_operation.collateral` | `consent_expired` | Janela do SIGEPE fechou | Re-emitir |

→ [Lista completa de enumeradores](./08-mapa-de-status.md)

## Sandbox

### Sucesso

| `document_number` | `authority_code` | `registration_code` |
|---|---|---|
| 25256363506 | 17000 | 1354387 |

### Falha

| `document_number` | `failure_reason` |
|---|---|
| 71987878353 | `unauthorized_institution` |

→ [Mocks completos](./09-mocks-sandbox.md)

---

# Mocks (Sandbox)

URL: /en/documentation/siape/mocks-sandbox

O `federal-payroll-api` da QI Tech intercepta as chamadas ao SIAPE/SIGEPE em sandbox e retorna respostas mockadas via [`siape_mocker.py`](https://gitlab.qitech.com.br/qilaas/federal-payroll-api/-/blob/master/src/connectors/siape_mocker.py). Apenas os CPFs listados abaixo são reconhecidos — qualquer outro retorna `cdRetCode 9999` ("O número do documento informado não é um mock válido no ambiente de teste").

## Sucesso completo (consulta + emissão + portabilidade)

CPFs que passam por **todos** os endpoints (`consultarAutorizacoesMargemConsignavelV2`, `incluirContratoV2`, `incluirContratoPortabilidade`, `renovarContratoV2`, etc.) com retorno OK:

| `document_number` (CPF) | `authority_code` | `registration_code` |
|---|---|---|
| 25256363506 | 17000 | 1354387 |
| 03137300088 | 17000 | 1354387 |
| 20472510010 | 17000 | 1354387 |
| 67050758051 | 17000 | 1354387 |
| 59669701066 | 17000 | 1354387 |

Resposta esperada no webhook `federal_payroll.balance` (`status: succeeded`):

```xml
nome: KAUAN RIBEIRO PEREIRA
codOrgao: 17000 (MINISTERIO DA ECONOMIA)
cdMatricula: 1354387
autorizacaoEmprestimo: S (válida até 09/10/2024)
autorizacaoPortabilidade: S (válida até 24/10/2024)
contratoPortado:
  nrCnpj: 00000000000191
  nrContrato: 526985/WU
vlMargemDisp: 100000 (geral), 50000 (portabilidade)
```

## Cenários especiais

### CPF sem autorização (`unauthorized_institution`)

| `document_number` | Comportamento |
|---|---|
| `71987878353` | Funciona apenas em `consultarAutorizacoesMargemConsignavelV2`. Retorna servidor "HELEN LUCIA REZENDE DE MORAES" com `autorizacaoEmprestimo: N` e `autorizacaoPortabilidade: N` |

Use este CPF pra testar a UX de "peça pro servidor autorizar QI SCD no Portal".

### CPF sem margem (`consignable_margin_exceeded`)

| `document_number` | Comportamento |
|---|---|
| `33673248090` | Funciona em `consultarAutorizacoes` (retorna `vlMargemDisp: 0`) E em `incluirContratoV2/incluirContratoPortabilidade/renovarContratoV2` (retorna `cdRetCode: 8058` "Funcionário não tem margem para essa solicitação") |

Use este CPF pra testar fluxo de margem insuficiente após autorização concedida.

## CPFs fora da whitelist

Qualquer outro CPF retorna:

```xml
cdRetCode: 9999
dsRetCode: O número do documento informado não é um mock válido no ambiente de teste
```

Webhook resultante: `federal_payroll.balance` com `status: failure` + `failure_reason: mock_error`.

## Token e Portal do Servidor em Sandbox

- **Não há autorização real no Portal do Servidor em sandbox.** Os mocks já trazem `autorizacaoEmprestimo: S` (ou N) baseado no CPF da whitelist.
- O endpoint `consultarAnuenciaContratos` retorna `void` (não há body) — significa que o mock pula o passo de consulta de anuência.

## Portabilidade — dados do contrato origem mockados

Quando você usa um CPF da whitelist e simula portabilidade, os mocks já têm:

| Campo | Valor mockado |
|---|---|
| `original_financial_institution_document_number` | `00000000000191` (Banco do Brasil) |
| `original_contract_number` | `526985/WU` |
| `due_balance` mockado | varia conforme `vlMargemDisp` da resposta |

Use estes valores ao montar o payload de `/debt` em portabilidade pra que o mock reconheça o contrato origem.

## Reset diário

Reservas que não atingiram estado terminal (`reserved`, `canceled`, `deleted`) são **encerradas automaticamente às 23:59h** pra manter o ambiente limpo.

## Cenário end-to-end completo

Sequência recomendada para validar a integração em sandbox:

1. `POST /federal_payroll/balance` com `25256363506` + `authority_code: 17000` + `registration_code: 1354387`
2. Aguardar webhook `federal_payroll.balance` (succeeded) com `available_balance` retornado
3. `POST /debt_simulation` com `installment_face_value` ≤ `available_balance` retornado
4. `POST /debt` com `reservation_method: creation` (margem livre) ou com `refinanced_credit_operations` (port com `original_contract_number: 526985/WU`)
5. Aguardar webhook `credit_operation.collateral` (`pending_consent` → `success`) — em sandbox o consent é automático após o `/debt`
6. `POST /debt/{KEY}/signed` com QI Sign ou data-signature opt-in
7. Aguardar webhook `debt` (`disbursed`)
8. (opcional cancelamento) `PATCH /debt/{KEY}/cancel` → recebe PIX QR → simular pagamento → webhook `reversal`

## Janela operacional sandbox

Diferente da produção, o sandbox SIAPE **não respeita a janela 07:00-00:00** dias úteis — você pode rodar a qualquer hora, qualquer dia da semana. Em prod a janela é estrita.

## Endpoints mockados (referência interna)

O `siape_mocker.py` cobre estes operation types do SIAPE (SOAP):

| Operation type | Comportamento mockado |
|---|---|
| `consultarAutorizacoesMargemConsignavelV2` | Retorna dados do servidor + autorização emprestimo/portabilidade |
| `incluirContratoV2` | Inclui novo contrato — sucesso pra CPFs whitelist |
| `incluirContratoPortabilidade` | Inclui contrato de portabilidade — sucesso pra whitelist |
| `renovarContratoV2` | Refinanciamento — sucesso pra whitelist |
| `alterarContrato` | Sucesso fixo `cdRetCode: 0000` |
| `consultarContrato` | Retorna situação `Ativo` ou `Aguardando Encerramento do Contrato` (port) |
| `encerrarContrato` | Sucesso fixo |
| `consultarAnuenciaContratos` | Void (pula passo) |

---

# Portabilidade + Refinanciamento

URL: /en/documentation/siape/portabilidade-refin

Fluxo de **compra de dívida consignada** SIAPE via assinatura em lote. A QI Tech emite uma CCB de quitação (`debt_purchase`) que paga o banco vendedor, uma CCB de portabilidade (`portability`) que porta o contrato, e um `refinancing` consolidador **sempre obrigatório** que carrega seguro e troco. Tudo assinado de uma única vez na QI Sign.

:::info Contas por operação
Cada operação do fluxo exige uma conta de desembolso distinta:

- **`debt_purchase`** → **conta interna QI** em nome do tomador. O desembolso cai nessa conta e quita a dívida origem no banco vendedor via `after_disbursement_actions` (boleto/PIX).
- **`refinancing`** → **conta externa do tomador**. O troco do refinanciamento é desembolsado nessa conta.

O parceiro abre a conta interna via `POST /account` antes da emissão. Ver [Conta Interna para Desembolso](./10-conta-interna-desembolso.md).
:::

## Cenários

O `refinancing` consolidador é **sempre obrigatório** no batch federal — é ele quem carrega seguro e troco.

| Cenário | Composição | Quando usar |
|---|---|---|
| **α** | 1× `debt_purchase` + 1× `portability` + 1× `refinancing` | Porta **uma** dívida externa |
| **β** | N× `debt_purchase` + N× `portability` + 1× `refinancing` | Porta **N dívidas** externas num único envelope |
| **γ** | α ou β + `financial.rebates` no `refinancing` | Qualquer composição acima com prêmio de seguro — gera `insurance_premium_term` automaticamente |

:::caution Regra do seguro e do troco
Seguro (`financial.rebates` com `fee_type: "insurance_premium_qi"`) e troco só podem ser enviados no `refinancing` consolidador (Passo 5).

- **`debt_purchase`** — `rebates` proibido (CCB de quitação não carrega seguro).
- **`portability`** — `rebates` proibido **e** `final_disbursement_amount` deve ser `0`.
:::

## Sequência de chamadas

```
1.  POST /upload   (documentos da operação)

2.  POST /account  (conta interna QI p/ debt_purchase)

3.  POST /document/document_batch

4.  POST /debt  (debt_purchase)        → desembolso em conta interna QI

5.  POST /debt  (portability)          → sem troco, sem seguro

6.  POST /debt  (refinancing)          → seguro + troco em conta externa

7.  PUT  /document/document_batch/{key}/send_to_signature
```

:::caution Ordem obrigatória de inserção no batch
`debt_purchase` deve ser inserido **antes** da `portability` que o referencia, e a `portability` **antes** do `refinancing` consolidador. Inverter a ordem dispara:

- **`DOC000110`** (HTTP 422) — `portability` cujo `refinanced_credit_operations[].operation_key` não casa com nenhum `debt_purchase` já inserido no batch.
- **`DOC000112`** (HTTP 422) — `refinancing` cujo `refinanced_credit_operations[].operation_key` não casa com nenhuma `portability` já inserida no batch.
:::

---

## 1. Upload dos documentos

Antes de abrir a conta e o lote, faça o **upload dos documentos** exigidos na operação via `POST /upload`. Cada chamada retorna um `document_key`, identificador do documento referenciado nas etapas seguintes.

ENDPOINT /upload
MÉTODO POST

→ Autenticação, headers, FormData e exemplos de código (Python / Node.js) em [Upload de Documentos](../upload_de_documentos/upload_de_documentos.md) .

:::caution Atenção
Salve o `document_key` retornado — ele é necessário para a consulta e o uso futuro do documento.
:::

---

## 2. Abrir a conta interna em nome do tomador

Em **compra de dívida**, **portabilidade** e **refinanciamento** do consignado federal (Siape), o desembolso da operação **não vai direto para a conta externa do tomador**: ele cai numa conta interna **em nome do tomador** (aberta pelo parceiro via `POST /account`). É a partir dessa conta que a QI executa as ações pós-desembolso — **quitação do contrato externo**, **repasse de troco**, **conciliação**.

ENDPOINT /account
MÉTODO POST

A conta é aberta pelo **parceiro** (autenticado com seus `client_integration_key`), com o `owner_document_number` apontando para o **CPF do tomador**. Reutilize a conta existente — uma por tomador (não abrir nova a cada operação).

**Request Body**

```json
{
  "owner_document_number": "<CPF DO TOMADOR>",
  "owner_person_key": "<PERSON_KEY DO TOMADOR>",
  "requester_key": "<REQUESTER_KEY DO PARCEIRO>",
  "webhook_enabled": true
}
```

**Response Body**

```json
{
  "account_key": "1167955-...",
  "account_branch": "0001",
  "account_number": "1167955",
  "account_digit": "1",
  "owner_document_number": "<CPF DO MILITAR>",
  "owner_name": "<NOME DO MILITAR>",
  "bank_code": "329",
  "account_status": "active",
  "webhook_enabled": true
}
```

:::tip Idempotência por tomador
Se já existe conta ativa para esse `owner_document_number` no parceiro, evite chamar `POST /account` de novo — consulte `GET /accounts?owner_document_number= ` antes e reaproveite o `account_key` retornado.
:::

---

## 3. Abrir o lote

ENDPOINT /document/document_batch
MÉTODO POST

**Request Body**

```json
{
  "type": "federal_payroll_external_batch",
  "certifier_type": "qi_sign",
  "batch_name": "Lote SIAPE portabilidade - <UUID_UNICO>",
  "request_control_key": "<UUID_UNICO_2>"
}
```

### Campos chave

| Campo | Tipo | Descrição |
|---|---|---|
| `type` | string | Fixo: **`federal_payroll_external_batch`** |
| `certifier_type` | string | Fixo: **`qi_sign`** |
| `batch_name` | string | Nome identificador do lote — **único** (não reutilize entre lotes) e **máximo 100 caracteres** |
| `request_control_key` | string (UUIDv4) | **Idempotência** — não reutilize entre lotes |

**Response Body**

```json
{
  "document_batch_key": "17f35e19-a039-468f-aaa7-84aa8edec3dc"
}
```

Guarde o `document_batch_key` retornado — ele é referenciado em todas as chamadas seguintes.

→ Para consultar, limpar documentos ou conferir o batch antes do envio, ver [Assinatura em Lote](./11-assinatura-em-lote.md).

---

## 4. Emitir `debt_purchase`

CCB de **quitação da dívida original**. A QI Tech vai pagar o banco vendedor.

ENDPOINT /debt
MÉTODO POST

:::info Particularidades do `debt_purchase`
- `document_batch_key` incluído na **raiz** do payload (mesmo nível de `borrower`, `financial`).
- `disbursement_bank_account` aponta para a **conta interna QI** do tomador (Criada no passo 2).
- `after_disbursement_actions` na raiz define a quitação automática da dívida origem após o desembolso (boleto ou PIX do banco vendedor).
:::

**Request Body**

```json
{
  "borrower": {
    "name": "MARIA DOS SANTOS",
    "email": "maria@email.com",
    "phone": { "number": "900000000", "area_code": "11", "country_code": "055" },
    "is_pep": false,
    "address": {
      "city": "Brasília",
      "state": "DF",
      "number": "100",
      "street": "Esplanada dos Ministérios",
      "complement": "",
      "postal_code": "70000000",
      "neighborhood": "Centro"
    },
    "role_type": "issuer",
    "birth_date": "1978-09-22",
    "mother_name": "JOSEFINA DOS SANTOS",
    "nationality": "Brasileiro",
    "person_type": "natural",
    "marital_status": "married",
    "individual_document_number": "25256363506",
    "gender": "female",
    "document_identification_type": "rg",
    "document_identification_number": "1234567",
    "document_identification_date": "2015-01-01"
  },
  "financial": {
    "first_due_date": "2026-06-10",
    "installment_face_value": 100,
    "disbursement_date": "2026-05-10",
    "limit_days_to_disburse": 5,
    "number_of_installments": 20,
    "monthly_interest_rate": 0.017,
    "interest_type": "pre_price_days",
    "fine_configuration": {
      "monthly_rate": 0.01,
      "interest_base": "calendar_days",
      "contract_fine_rate": 0.02
    },
    "credit_operation_type": "ccb",
    "interest_grace_period": 0,
    "principal_grace_period": 0
  },
  "simplified": true,
  "collaterals": [],
  "requester_identifier_key": "<UUIDv4 gerado por request>",
  "disbursement_bank_account": {
    "bank_code": "329",
    "account_digit": "7",
    "branch_number": "0001",
    "account_number": "4944068",
    "document_number": "25256363506",
    "name": "MARIA DOS SANTOS"
  },
  "purchaser_document_number": "<CNPJ do comprador>",
  "document_batch_key": "<document_batch_key DO PASSO 2>",
  "after_disbursement_actions": [
    {
      "action_type": "bankslip_payment",
      "action_data": {
        "qr_code": null,
        "destination": null,
        "digitable_line": "03399199530490000005237385601010297590005474921",
        "pix_transfer_type": null,
        "transaction_amount": 0
      }
    }
  ]
}
```

### Campos que devem ser alterados

| Campo | Obrigatório alterar? | Observação |
|---|---|---|
| `document_batch_key` | ✅ Sim | Valor retornado no Passo 2 |
| `borrower.*` | ✅ Sim | Dados reais do tomador |
| `financial.first_due_date` / `disbursement_date` | ✅ Sim | Conforme calendário da operação |
| `financial.installment_face_value` / `number_of_installments` / `monthly_interest_rate` | ✅ Sim | Conforme condições comerciais |
| `purchaser_document_number` | ✅ Sim | CNPJ do comprador (via variável de ambiente) |
| `requester_identifier_key` | ✅ Sim | UUIDv4 único por requisição |
| `disbursement_bank_account` | ✅ Sim | **Conta interna QI em nome do tomador** |
| `after_disbursement_actions` | ✅ Sim | Quitação da dívida origem. `action_type`: `bankslip_payment` (boleto) ou PIX. Preencha `digitable_line` (boleto) ou `qr_code` (PIX) do banco vendedor |

**Response Body**

```json
{
  "proposal_id": "<id interno>",
  "status": 200,
  "key": "<key da operação debt_purchase>",
  "data": {
    "credit_operation_key": "<mesmo valor de key>",
    "status": "waiting_signature"
  }
}
```

**Guarde a `key` retornada** — ela é passada em `refinanced_credit_operations[].operation_key` da `portability` correspondente.

---

## 5. Emitir `portability`

CCB de **portabilidade da dívida**. Cada portabilidade referencia **exatamente um** `debt_purchase` via `refinanced_credit_operations`. **Não carrega seguro nem troco** — ambos vão no `refinancing` consolidador.

ENDPOINT /debt
MÉTODO POST

:::info Particularidades da `portability`
- `collaterals[0].collateral_data.portability_data` é **obrigatório** — contém os dados do contrato de origem na instituição vendedora.
- `refinanced_credit_operations` carrega a `key` do `debt_purchase` correspondente.
:::

:::caution Portabilidade sem seguro e sem troco
Em batch federal, a `portability` **não pode** carregar `financial.rebates` (seguro). O seguro é enviado exclusivamente no `refinancing` consolidador. A QI Tech rejeita o `POST /debt` que violar essa regra.
:::

**Request Body**

```json
{
  "borrower": { "...": "mesmo borrower do Passo 4" },
  "financial": {
    "first_due_date": "2026-06-10",
    "disbursement_date": "2026-05-10",
    "limit_days_to_disburse": 5,
    "number_of_installments": 20,
    "monthly_interest_rate": 0.017,
    "interest_type": "pre_price_days",
    "final_disbursement_amount": 0,
    "fine_configuration": {
      "monthly_rate": 0.01,
      "interest_base": "calendar_days",
      "contract_fine_rate": 0.02
    },
    "credit_operation_type": "ccb",
    "interest_grace_period": 0,
    "principal_grace_period": 0
  },
  "simplified": true,
  "collaterals": [
    {
      "percentage": 1,
      "collateral_type": "federal_payroll",
      "collateral_data": {
        "authority": {
          "description": "GOVERNO DO DISTRITO FEDERAL",
          "authority_document_number": "00.394.601/0001-26"
        },
        "authority_code": "99072",
        "reservation_type": "portability",
        "registration_code": "1393831",
        "reservation_method": "issuing",
        "pensioner_registration_code": "",
        "portability_data": {
          "start_date": "2024-06-24",
          "control_number": "57309647149",
          "origin_contract": {
            "contract_number": "866415127",
            "financial_institution_document_number": "90400888000142"
          }
        }
      }
    }
  ],
  "requester_identifier_key": "<UUIDv4>",
  "disbursement_bank_account": { "...": "mesmo disbursement do Passo 4" },
  "purchaser_document_number": "<CNPJ do comprador>",
  "document_batch_key": "<document_batch_key DO PASSO 2>",
  "refinanced_credit_operations": [
    { "operation_key": "<key DO PASSO 4>" }
  ]
}
```

### Campos que devem ser alterados

| Campo | Obrigatório alterar? | Observação |
|---|---|---|
| `document_batch_key` | ✅ Sim | Valor retornado no Passo 2 |
| `refinanced_credit_operations[0].operation_key` | ✅ Sim | `key` do `debt_purchase` referenciado (Passo 4) |
| `collaterals[0].collateral_data.registration_code` | ✅ Sim | Matrícula SIAPE do servidor |
| `collaterals[0].collateral_data.authority_code` / `authority.description` / `authority.authority_document_number` | ✅ Sim | Órgão pagador (UPAG) |
| `portability_data.start_date` | ✅ Sim | Data de início do contrato de origem |
| `portability_data.control_number` | ✅ Sim | Número de controle no SIAPE |
| `portability_data.origin_contract.contract_number` | ✅ Sim | Nº do contrato na instituição vendedora |
| `portability_data.origin_contract.financial_institution_document_number` | ✅ Sim | CNPJ da instituição vendedora |
| `financial.installment_face_value` | 🚫 Não enviar | Valor da parcela (auto calculado) |
| `financial.rebates` | 🚫 Proibido | Seguro não é aceito em portabilidade — só no `refinancing` |

**Response Body**

```json
{
  "proposal_id": "<id interno>",
  "status": 200,
  "key": "<key da operação portability>",
  "data": {
    "credit_operation_key": "<mesmo valor de key>",
    "status": "waiting_signature"
  }
}
```

**Guarde a `key` desta portabilidade** — usada em `refinanced_credit_operations` do `refinancing` consolidador (Passo 5) no cenário β.

### Erros possíveis na criação

| Código | HTTP | Quando |
|---|---|---|
| `DOC000110` | 422 | `refinanced_credit_operations[].operation_key` não casa com nenhum `credit_operation_key` de `debt_purchase` já inserido no batch |
| `DOC000114` | 422 | `refinanced_credit_operations[].operation_key` já está em outra portabilidade do mesmo batch (duplicidade) |
| `COP000515` | 400 | `final_disbursement_amount` ≠ `0` — portabilidade não carrega troco |
| `COP000516` | 400 | `financial.rebates` presente — portabilidade federal não aceita seguro |

---

## 6. Emitir `refinancing` consolidador

CCB **mãe** que consolida as portabilidades num único instrumento. **Sempre obrigatória** no batch federal — tanto no cenário α (1 portabilidade) quanto no β (N portabilidades). É a única operação do fluxo que carrega **seguro** e **troco**.

ENDPOINT /debt
MÉTODO POST

:::info Particularidades do `refinancing` consolidador
- `reservation_type: "refinancing"` no `collateral_data`.
- `refinanced_credit_operations` lista as `key` de **todas** as portabilidades do batch.
- `disbursement_bank_account` aponta para a **conta externa do tomador** — destino do troco.
- `financial.rebates` é **opcional** — único lugar do fluxo que aceita seguro.
- `after_disbursement_actions` só é enviado **quando há seguro** — liquida o prêmio após o desembolso.
:::

:::caution `after_disbursement_actions` exige seguro
`after_disbursement_actions` só pode ser enviado no `refinancing` **quando a operação tem seguro** (`financial.rebates` presente). Enviar `after_disbursement_actions` sem `rebates` faz a QI Tech rejeitar o `POST /debt`.
:::

**Request Body**

**Sem seguro**

```json
{
  "borrower": { "...": "mesmo borrower" },
  "financial": {
    "first_due_date": "2026-06-10",
    "installment_face_value": 1000,
    "disbursement_date": "2026-05-10",
    "limit_days_to_disburse": 5,
    "number_of_installments": 20,
    "monthly_interest_rate": 0.017,
    "interest_type": "pre_price_days",
    "fine_configuration": {
      "monthly_rate": 0.01,
      "interest_base": "calendar_days",
      "contract_fine_rate": 0.02
    },
    "credit_operation_type": "ccb",
    "interest_grace_period": 0,
    "principal_grace_period": 0
  },
  "simplified": true,
  "collaterals": [
    {
      "percentage": 1,
      "collateral_type": "federal_payroll",
      "collateral_data": {
        "authority": {
          "description": "GOVERNO DO DISTRITO FEDERAL",
          "authority_document_number": "00.394.601/0001-26"
        },
        "authority_code": "99072",
        "reservation_type": "refinancing",
        "registration_code": "1393831",
        "reservation_method": "issuing",
        "pensioner_registration_code": ""
      }
    }
  ],
  "requester_identifier_key": "<UUIDv4>",
  "disbursement_bank_account": { "...": "conta externa do tomador" },
  "purchaser_document_number": "<CNPJ do comprador>",
  "document_batch_key": "<document_batch_key DO PASSO 2>",
  "refinanced_credit_operations": [
    { "operation_key": "<key da portabilidade 1>" },
    { "operation_key": "<key da portabilidade 2>" }
  ]
}
```

**Com seguro + troco (Cenário γ)**

```json
{
  "borrower": { "...": "mesmo borrower" },
  "financial": {
    "first_due_date": "2026-06-10",
    "installment_face_value": 1500,
    "disbursement_date": "2026-05-10",
    "limit_days_to_disburse": 5,
    "number_of_installments": 20,
    "monthly_interest_rate": 0.017,
    "interest_type": "pre_price_days",
    "fine_configuration": {
      "monthly_rate": 0.01,
      "interest_base": "calendar_days",
      "contract_fine_rate": 0.02
    },
    "credit_operation_type": "ccb",
    "interest_grace_period": 0,
    "principal_grace_period": 0,
    "rebates": [
      {
        "fee_type": "insurance_premium_qi",
        "description": "credit_insurance_blindado"
      }
    ]
  },
  "simplified": true,
  "collaterals": [
    {
      "percentage": 1,
      "collateral_type": "federal_payroll",
      "collateral_data": {
        "authority": {
          "description": "GOVERNO DO DISTRITO FEDERAL",
          "authority_document_number": "00.394.601/0001-26"
        },
        "authority_code": "99072",
        "reservation_type": "refinancing",
        "registration_code": "1393831",
        "reservation_method": "issuing",
        "pensioner_registration_code": ""
      }
    }
  ],
  "requester_identifier_key": "<UUIDv4>",
  "disbursement_bank_account": { "...": "conta externa do tomador" },
  "purchaser_document_number": "<CNPJ do comprador>",
  "document_batch_key": "<document_batch_key DO PASSO 2>",
  "refinanced_credit_operations": [
    { "operation_key": "<key da portabilidade 1>" },
    { "operation_key": "<key da portabilidade 2>" }
  ],
  "after_disbursement_actions": [
    {
      "action_type": "bankslip_payment",
      "action_data": {
        "qr_code": null,
        "destination": null,
        "digitable_line": "03399199530490000005237385601010297590005474921",
        "pix_transfer_type": null,
        "transaction_amount": 0
      }
    }
  ]
}
```

### Campos que devem ser alterados

| Campo | Obrigatório alterar? | Observação |
|---|---|---|
| `document_batch_key` | ✅ Sim | Valor retornado no Passo 2 |
| `refinanced_credit_operations` | ✅ Sim | **Todas** as `key` das portabilidades emitidas no Passo 5 |
| `collaterals[0].collateral_data.authority.*` / `authority_code` / `registration_code` | ✅ Sim | Conforme órgão e servidor |
| `reservation_method` | ✅ Sim | Sempre `"issuing"` para o consolidador |
| `disbursement_bank_account` | ✅ Sim | **Conta externa do tomador** — destino do troco |
| `financial.rebates` | ⚠️ Opcional | Único lugar do fluxo que aceita seguro. Incluir `[{ "fee_type": "insurance_premium_qi", ... }]` apenas se a operação tem seguro |
| `financial.final_disbursement_amount` | 🚫 Não enviar | Valor final do desembolso (troco) calculado automaticamente baseado no valor da parcela |
| `after_disbursement_actions` | ⚠️ Só com seguro | Liquida o prêmio do seguro após desembolso. **Só envie quando `rebates` está presente** — caso contrário a QI Tech rejeita o `POST /debt` |

### Erros possíveis na criação

| Código | HTTP | Quando |
|---|---|---|
| `DOC000109` | 422 | Batch já contém outro `refinancing` — só 1 por batch |
| `DOC000112` | 422 | `refinanced_credit_operations[].operation_key` não casa com nenhum `credit_operation_key` de portabilidade no batch |
| `COP000517` | 400 | `refinancing` **com** seguro (`rebates`) sem nenhuma `after_disbursement_actions` — seguro exige ao menos uma ação pós-desembolso |
| `COP000518` | 400 | `refinancing` **sem** seguro carregando `after_disbursement_actions` — só permitido quando há `rebates` |

---

## 7. Enviar para assinatura

Fecha o lote e dispara os documentos para o QI Sign. **Antes desse PUT, nada é enviado ao servidor.**

ENDPOINT /document/document_batch/DOCUMENT_BATCH_KEY/send_to_signature
MÉTODO PUT

Body: `{}`. Response: **HTTP 200**.

### Erros possíveis no envio

| Código | HTTP | Quando |
|---|---|---|
| `DOC000108` | 422 | Batch contém mais de 1 `insurance_premium_term` |
| `DOC000109` | 422 | Batch contém mais de 1 `refinancing` |
| `DOC000110` | 422 | `portability` cujo `refinanced_op` não casa com nenhum `debt_purchase` no batch |
| `DOC000111` | 422 | Batch **sem** `refinancing` consolidador |
| `DOC000114` | 422 | `debt_purchase` referenciado por 0 ou mais de 1 portabilidade |

:::tip Conferir antes de enviar
Use `GET /document/document_batch/DOCUMENT_BATCH_KEY` para listar os documentos agrupados e confirmar a composição antes do `send_to_signature`. Ver [Assinatura em Lote](./11-assinatura-em-lote.md).
:::

→ Próximo passo: [Formalização](./05-formalizacao.md)

---

## Mapa consolidado de erros

| Código | HTTP | Ponto de disparo | Quando |
|---|---|---|---|
| `DOC000108` | 422 | criação + envio | Mais de 1 `insurance_premium_term` no batch |
| `DOC000109` | 422 | criação + envio | Mais de 1 `refinancing` no batch |
| `DOC000110` | 422 | criação + envio | `portability` com `refinanced_op` sem `debt_purchase` casado no batch |
| `DOC000111` | 422 | envio | Batch sem `refinancing` consolidador |
| `DOC000112` | 422 | criação | `refinancing` com `refinanced_op` sem portabilidade casada no batch |
| `DOC000114` | 422 | criação + envio | `debt_purchase` referenciado por ≠ 1 portabilidade (0 órfão ou ≥ 2 duplicado) |
| `COP000515` | 400 | criação (`portability`) | `final_disbursement_amount` ≠ `0` na portabilidade |
| `COP000516` | 400 | criação (`portability`) | `financial.rebates` enviado na portabilidade federal |
| `COP000517` | 400 | criação (`refinancing`) | `refinancing` com seguro sem nenhuma `after_disbursement_actions` |
| `COP000518` | 400 | criação (`refinancing`) | `refinancing` sem seguro carregando `after_disbursement_actions` |

:::info Notas sobre erros recorrentes
- `DOC000110` dispara em **dois momentos**: na criação da portabilidade (validação imediata) e no envio (cobertura defensiva).
- `DOC000114` dispara em **dois momentos**: na criação da segunda portabilidade duplicada e no envio (cobre o `debt_purchase` órfão, i.e. `count = 0`).
- `DOC000111` dispara **apenas no envio** — não há validação na criação.
- Batches que **não** são `federal_payroll_external_batch` não disparam nenhuma das validações acima.
:::

---

## Glossário

| Termo | Significado |
|---|---|
| **CCB** | Cédula de Crédito Bancário — instrumento de dívida emitido pelo banco |
| **SIAPE** | Sistema Integrado de Administração de Recursos Humanos do Governo Federal — folha de pagamento dos servidores da União |
| **UPAG** | Unidade Pagadora — órgão da União que paga o salário do servidor (identificado por `authority_code` + `authority_document_number`) |
| **matrícula SIAPE** | `registration_code` — identificador do servidor na folha |
| **portability_data** | Dados do contrato de origem na instituição vendedora (`start_date`, `control_number`, `contract_number`, `financial_institution_document_number`) |
| **credit_operation_key** | Chave única da operação retornada por `POST /debt` — também chamada `key` |
| **insurance_premium_term** | Documento extra gerado automaticamente no batch quando uma `portability` ou `refinancing` carrega `financial.rebates` com `fee_type: "insurance_premium_qi"`. **Nunca** originado de `debt_purchase` |
| **QI Sign** | Provedor de assinatura digital QI Tech (configurado via `certifier_type: "qi_sign"`) |

---

# Webhooks

URL: /en/documentation/siape/webhooks

Eventos assíncronos emitidos pela QI Tech durante o ciclo de vida da operação consignada SIAPE. Todos seguem o protocolo unificado de [Webhooks QI](/documentation/webhooks/notificacoes_baas_e_laas) — 5 segundos pra resposta HTTP 200 com `encoded_body` assinado, 3 retries de 5 minutos em caso de falha.

:::danger Atenção!
Os webhooks da QI Tech **não devem ser mapeados de forma restrita**. Campos adicionais podem ser incluídos aos payloads a qualquer momento. Use desserialização permissiva.
:::

## Webhooks específicos do produto SIAPE

| Webhook | Quando dispara | Origem |
|---|---|---|
| `federal_payroll.balance` | Resultado da consulta de margem (`succeeded` ou `failure`) | federal-payroll-api |
| `credit_operation.collateral` | Averbação ou desaverbação no SIGEPE | credit-operation-api |
| `credit_transfer.received_portability` | Portabilidade externa recebida (banco origem aceitou) | credit-transfer-api |
| `credit_transfer_status_change` | Atualização do credit-transfer | credit-transfer-api |

## Webhooks comuns LaaS

| Webhook | Status | Quando dispara |
|---|---|---|
| `debt` | `waiting_signature` | Operação criada, aguardando assinatura |
| `debt` | `signature_finished` | Assinatura concluída |
| `debt` | `disbursed` | Desembolso PIX/TED enviado |
| `debt` | `canceled` | Operação cancelada |
| `debt` | `canceled_permanently` | Cancelamento definitivo |
| `debt` | `settled` | Operação liquidada |
| `reversal` | `pending_fund` | Borrower pagou PIX QR de cancelamento — reversal iniciado |
| `installment.status_change` | `paid` / `overdue` / etc | Mudança de status de parcela individual |
| `laas.devolution.refund_receipt` | `refunded` | Devolução de overpayment via PIX |

## Estrutura padrão

```json
{
  "key": "<UUID da operação>",
  "data": ,
  "status": "<status>",
  "webhook_type": "<tipo>",
  "event_datetime": "2026-06-02 14:30:00"
}
```

## Exemplos

### `federal_payroll.balance` (sucesso)

```json
{
  "webhook_type": "federal_payroll.balance",
  "key": "81da8afb-e1b2-4215-8093-c4b5feab8a9f",
  "status": "succeeded",
  "data": {
    "balance_query": [
      {
        "available_balance": 3500.00,
        "authority_code": "17000",
        "registration_code": "1354387",
        "employment_relationship": "active",
        "consigned_credit": 1200.00,
        "consigned_card": 300.00
      }
    ]
  },
  "event_datetime": "2026-06-02 14:30:00"
}
```

### `credit_operation.collateral` (pending_consent)

```json
{
  "webhook_type": "credit_operation.collateral",
  "key": "27a099df-4688-43cb-87fa-515b1cf343a5",
  "status": "pending_consent",
  "data": {
    "collateral_constituted": false,
    "enumerator": "waiting_borrower_consent"
  },
  "event_datetime": "2026-06-02 15:00:00"
}
```

### `credit_operation.collateral` (success)

```json
{
  "webhook_type": "credit_operation.collateral",
  "key": "27a099df-4688-43cb-87fa-515b1cf343a5",
  "status": "success",
  "data": {
    "collateral_constituted": true,
    "enumerator": "successfully_reserved",
    "reservation_status": "reserved"
  },
  "event_datetime": "2026-06-02 15:30:00"
}
```

### `debt` (disbursed)

```json
{
  "webhook_type": "debt",
  "key": "27a099df-4688-43cb-87fa-515b1cf343a5",
  "status": "disbursed",
  "data": {
    "ted_receipt_list": [{
      "amount": 12500.00,
      "transaction_key": "...",
      "destination": { "name": "MARIA DOS SANTOS", "bank_ispb": "60746948" }
    }]
  },
  "event_datetime": "2026-06-02 16:00:00"
}
```

### `reversal` (cancelamento pós-desembolso)

```json
{
  "webhook_type": "reversal",
  "credit_operation_key": "2893b8bd-...",
  "contract_number": "0000049333/TW",
  "reversal": {
    "status": "pending_fund",
    "amount": 12500.00,
    "is_total": true,
    "is_operation_canceled": true,
    "reversal_key": "...",
    "date": "2026-09-06"
  }
}
```

## Cancel reasons (`cancel_reason_enumerator`)

| Enumerador | Significado |
|---|---|
| `manual` | Cancelado via API ou portal |
| `waiting_signature` | Não assinou no prazo |
| `not_collateral_constituted` | Averbação falhou (`consent_refused`, `consent_expired`, etc.) |
| `is_portability` | Portabilidade falhou |
| `pix_max_retry` | Muitas falhas no desembolso PIX |
| `lack_of_resource` | Sem recurso pra desembolsar |
| `kyc_not_accepted` | KYC reprovado |

→ Lista completa em [Mapa de Status](./08-mapa-de-status.md)

## Reenvio Manual

Webhooks podem ser consultados e reenviados via portal seguindo [Reenvio de Webhooks](/documentation/notificacoes/reenvio_de_notificacoes).

---

# Aprovar Transferência

URL: /en/documentation/ted/2fa/aprovar_transferencia

Para realizar uma transferência via TED é necessário realizar a seguinte chamada:

1. [Solicitação de token de validação de transferência](/documentation/ted/2fa/solicitar_transferencia): /baas/token_request

2. Aprovação da transferência /baas/movement_validation

:::info
As transferências TED só podem ser realizadas em dias úteis das **7:00** às **17:00**.
:::

## Request

ENDPOINT /baas/token_request
MÉTODO POST

Request Body

```json
{
	"token": "329329",
	"agent_document_number": "99999999999",
	"movement_payload": {
		"source_account": {
			"account_branch": "0001",
			"account_number": "0000000",
			"account_digit": "0",
			"owner_document_number": "99999999000107"
		},
		"target_account": {
			"financial_institution_code": "341",
			"account_branch": "0001",
			"account_number": "0000000",
			"account_digit": "1",
			"owner_document_number": "999999999",
			"owner_name": "Nome do Titular da Conta Destino"
		},
		"transaction_amount": 8.86,
        "approver_document_number": "999999999"
	}
}

```

## Body Params
| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `token` * | string | Token de autenticação | 6 |
| `agent_document_number` * | string | CPF do usuário que irá receber o token. (Apenas números) | 11 | 
| `movement_payload` | Object | Payload contendo as informações da transferência | **[Objeto movement_payload](#objeto-movement_payload)** | 

### Objeto movement_payload

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `source_account` * | Object | Objeto contendo os dados da conta de origem | **[Objeto source_account](#objeto-source_account)** |
| `target_account` * | Object | Objeto contendo os dados da conta de destino | **[Objeto target_account](#objeto-target_account)** |
| `transaction_amount` * | float | Valor da transferência | - |
| `approver_document_number` * | string | CPF do usuário que irá receber o token. (Apenas números) | - |

### Objeto source_account

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `account_branch` * | string | Número Agência. | 0 |
| `branch_digit` |string | Dígito da Agência.| 0 |
| `account_digit` * | string | Dígito da conta.| 0 |
| `account_number` * | string | Número da conta.| 0 | 
| `owner_document_number` * | string | CPF ou CNPJ (apenas números) do titular da conta.| 0 |

### Objeto target_account

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `account_branch` * | string | Agência. | 10 |
| `account_digit` * | string | Dígito da conta | 10 |
| `account_number` * | string | Número da conta. | 10 |
| `owner_document_number` * | string | CPF ou CNPJ (apenas números) do titular da conta. | 10 |
| `owner_name` * | string | Nome do titular da conta. | 10 |
| `account_type` * |string |  CPF ou CNPJ (apenas números) do titular da conta.| 10 |
| `ispb` | string |  Código de oito dígitos que identifica os bancos no sistema de transferência de reserva do Banco Central.| 10 |

## Response

:::info
O campo de “***transacted_at***“ está em formato UTC.
:::

:::info
A “***transaction_key***“ será utilizada posteriormente para solicitação do comprovante de transferência.
:::

STATUS 200

Response Body

```json
{
	"authentication_code": "e8f0fffaeb4ebad2df0417194fe6a9e5",
	"origin_key": "d07f77f9-f157-4c35-a26b-567cba59e385",
	"pdf_encoded_string": "\<BASE 64 DO COMPROVANTE\>",
	"source_account": {
		"account_branch": "0001",
		"account_digit": "2",
		"account_number": "2359934",
		"financial_institution_compe_number": 329,
		"financial_institution_name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
		"owner_document_number": "09080702000105",
		"owner_document_number_formatted": "09.080.702/0001-05",
		"owner_name": "VOVO LUCIA CONVENIENCIA LTDA"
	},
	"source_subtype": "withdrawal",
	"source_subtype_translation_ptbr": "Transferência",
	"target_account": {
		"account_branch": "0001",
		"account_digit": "1",
		"account_number": "81156",
		"account_type": "checking_account",
		"account_type_str": "Conta Corrente",
		"financial_institution_compe_number": "001",
		"financial_institution_name": "Banco do Brasil S.A.",
		"owner_document_number": "10932327656",
		"owner_document_number_formatted": "109.323.276-56",
		"owner_name": "Lucas de Jesus Clarim"
	},
	"transacted_at": "2022-09-02 14:39:56",
	"transacted_at_br": "2022-09-02 11:39:56",
	"transacted_at_br_formatted": "21/11/2022, 11:39:56",
	"transacted_at_formatted": "21/11/2022, 14:39:56",
	"transaction_amount": 550,
	"transaction_amount_formatted": "R$ 550,00",
	"transaction_key": "32ac0781-f292-4172-b58f-3310102e6fb9"
}

```

STATUS 400

Response Body

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

---

# Solicitar Transferência

URL: /en/documentation/ted/2fa/solicitar_transferencia

Para realizar uma transferência via TED é necessário realizar a seguinte chamada:

1. Solicitação de token de validação de transferência: /baas/token_request

2. [Aprovação da transferência](/documentation/ted/2fa/aprovar_transferencia) /baas/movement_validation

:::info
As transferências TED só podem ser realizadas em dias úteis das **7:00** às **17:00**.
:::

## Request

ENDPOINT /baas/token_request
MÉTODO POST

Request Body

```json
{
	"contact_type": "sms",
	"agent_document_number": "99999999999",
	"movement_payload": {
		"source_account": {
			"account_branch": "0001",
			"account_number": "0000000",
			"account_digit": "0",
			"owner_document_number": "99999999000107"
		},
		"target_account": {
			"financial_institution_code": "341",
			"account_branch": "0001",
			"account_number": "0000000",
			"account_digit": "1",
			"owner_document_number": "999999999",
			"owner_name": "Nome do Titular da Conta Destino"
		},
		"transaction_amount": 8.86,
        "approver_document_number": "999999999"
	}
}

```

### Body Params
| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `contact_type` * | string | Forma de envio do token de autenticação,  podendo ser via E-mail (“email”) ou SMS (“sms”)| 10 |
| `agent_document_number` * | string | CPF do usuário que irá receber o token. (Apenas números) | 11 | 
| `movement_payload` | Object | Payload contendo as informações da transferência | **[Objeto movement_payload](#objeto-movement_payload)** | 

### Objeto movement_payload

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `source_account` * | Object | Objeto contendo os dados da conta de origem | **[Objeto source_account](#objeto-source_account)** |
| `target_account` * | Object | Objeto contendo os dados da conta de destino | **[Objeto target_account](#objeto-target_account)** |
| `transaction_amount` * | float | Valor da transferência | - |
| `approver_document_number` * | string | CPF do usuário que irá receber o token. (Apenas números) | - |

### Objeto source_account

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `account_branch` * | string | Número Agência. | 0 |
| `branch_digit` |string | Dígito da Agência.| 0 |
| `account_digit` * | string | Dígito da conta.| 0 |
| `account_number` * | string | Número da conta.| 0 | 
| `owner_document_number` * | string | CPF ou CNPJ (apenas números) do titular da conta.| 0 |

### Objeto target_account

| Campo | Tipo | Descrição | Caracteres |
|---|---| ---| ---|
| `account_branch` * | string | Agência. | 10 |
| `account_digit` * | string | Dígito da conta | 10 |
| `account_number` * | string | Número da conta. | 10 |
| `owner_document_number` * | string | CPF ou CNPJ (apenas números) do titular da conta. | 10 |
| `owner_name` * | string | Nome do titular da conta. | 10 |
| `account_type` * |string |  CPF ou CNPJ (apenas números) do titular da conta.| 10 |
| `ispb` | string |  Código de oito dígitos que identifica os bancos no sistema de transferência de reserva do Banco Central.| 10 |

## Response

STATUS 200

Response Body

```json
{}

```

STATUS 400

Response Body

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

```

---

# TED

URL: /en/documentation/ted/ted_v2

## Realizar TED

O recebimento de uma transação TED não é instantânea no sistema financeiro nacional. Ao realizar uma transação TED no
sistema QI uma resposta imediata será retornada informando erro, rejeição ou aceite da transferencia. Mesmo que uma
transferência tenha sido colocada em `sent`, a Instituição Financeira recebedora pode recusar a entrada de
recurso e
realizar a devolução do valor. Neste caso um novo webhook com status de `rejected` será enviado e o motivo da rejeição
retornado no campo `refusal_reason`.

Débitos na conta fonte da transação serão realizados imediatamente. Isso não significa que o valor foi creditado na
conta destino devido aos princípios de transações TED descritos acima. Caso ocorra a rejeição da transação enviada, o
valor da transação será creditado novamente à conta fonte.

### Request

ENDPOINT /account/ ACCOUNT_KEY /ted
MÉTODO POST

Request Body

```json
{
  "target_account": {
    "account_branch": "0001",
    "account_number": "92796",
    "account_digit": "1",
    "owner_document_number": "23599885000192",
    "owner_name": "Titular da Conta",
    "ispb": "12345678",
    "account_type": "checking_account"
  },
  "transaction_amount": 8.86,
  "request_control_key": "048c8ee5-1c91-46a6-952e-7e5c27c21f20"
}
```

### Body Params

| Campo                   | Tipo   | Descrição                                                                          | Caracteres                                          |
|-------------------------|--------|------------------------------------------------------------------------------------|-----------------------------------------------------|
| `request_control_key` * | string | Chave única de identificação da request utilizada pelo cliente no formato uuid v4. | 36                                                  |
| `target_account` *      | object | Conta de destino                                                                   | **[Objeto target_account](#objeto-target_account)** | 
| `transaction_amount` *  | float  | Valor da transferência                                                             | 10                                                  |

### Objeto target_account

| Campo                     | Tipo   | Descrição                                           | Caracteres                                                |
|---------------------------|--------|-----------------------------------------------------|-----------------------------------------------------------|
| `account_branch` *        | string | Agência.                                            | 4                                                         |
| `account_digit` *         | string | Dígito da conta                                     | 1                                                         |
| `account_number` *        | string | Número da conta.                                    | 20                                                        |
| `owner_document_number` * | string | CPF ou CNPJ (apenas números) do titular da conta.   | 14                                                        |
| `owner_name` *            | string | Nome do titular da conta.                           | 50                                                        |
| `account_type`*           | string | Tipo da conta.                                      | **[Enumerador account_type](#enumerador-account_type)** |
| `ispb` *                  | string | Base no CNPJ da instituição financeira (8 dígitos). | 8                                                         |

### Enumerador account_type

| Enumerador         | Tradução              |
|--------------------|-----------------------|
| checking_account   | conta corrente        |
| deposit_account    | conta depósito        |
| guaranteed_account | conta de garantia     |
| investment_account | conta de investimento |
| payment_account    | conta de pagamento    |
| saving_account     | conta poupança        |

### Response

STATUS 201

Response Body

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "ted_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "created_at": "2021-10-22T20:30:23.459Z",
  "ted_status": "sent",
  "transaction_amount": 126.97,
  "fee_amount": 0.0,
  "transaction_key": "8ea90347-330d-4b3a-8ebb-2ac217ad6eb3"
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| Código HTTP<br/>`status` | Código QI<br/>`code` | Título<br/>`title`                                 | Descrição (eng)<br/>`description`                                                                                       | Descrição (ptbr)<br/>`translation`                                                                                     |
|--------------------------|----------------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| 400                      | QIT000001            | Bad Request                                        | Schema Error                                                                                                            | Erro de Schema                                                                                                         |
| 400                      | TED000XXX            | request_control_key must be a valid uuid v4 string | request_control_key was not accepted for not being a valid uuid v4 string                                               | request_control_key não foi aceito por não ser uma palavra uuid v4 válida                                              |
| 400                      | TED000XXX            | Invalid Transaction Amount                         | Transaction amount of \{transaction_amount\} is not valid. It must be a positive value with at maximum 2 decimal places | O valor de transação \{transaction_amount\} não é válido. Deve ser um valor positivo com no máximo duas casas decimais |
| 404                      | TED000XXX            | Account not found                                  | Account not found for: \{account_datum\}                                                                                | Conta não encontrada para: \{account_datum\}                                                                           |
| 400                      | TED000XXX            | Account is Closed                                  | Account \{account_key\} is closed.                                                                                      | Conta \{account_key\} está fechada.                                                                                    |
| 400                      | TED000XXX            | Account is Blocked                                 | Account \{account_key\} is blocked.                                                                                     | Conta \{account_key\} está bloqueada.                                                                                  |
| 403                      | TED000XXX            | User is not allowed to do this transaction         |                                                                                                                         | Usuário não tem autorização para fazer essa transação                                                                  |
| 400                      | TED000XXX            | Target Account may not receive resources           | Target account is currently unavailable o receive resorses                                                              | Conta destino está impedida de receber recursos                                                                        |
| 400                      | TED000XXX            | Bad Request                                        | Insufficient account balance for transfer and fee amount.                                                               | Saldo de conta insuficiente para a transferência e a taxa.                                                             |
| 400                      | TED000XXX            | Bad Request                                        | Billing account closed or blocked                                                                                       | Conta de cobrança encerrada ou bloqueada                                                                               |
| 400                      | TED000XXX            | Bad Request                                        | Insufficient billing account balance for fee.                                                                           | Saldo de conta de cobrança insuficiente para a taxa.                                                                   |
| 400                      | TED000XXX            | Bad Request                                        | Transaction amount is over limit.                                                                                       | O total da transferência é superior ao limite.                                                                         |
| 400                      | TED000XXX            | Bad Request                                        | Insufficient account balance for transfer and fee amount.                                                               | Saldo de conta insuficiente para a transferência e a taxa                                                              |
| 400                      | TED000XXX            | Bad Request                                        | request_control_key \{request_control_key\} already in use                                                              | request_control_key \{request_control_key\} já utilizada                                                               |
| 400                      | TED000XXX            | Invalid Target Account Number                      | Target account number is invalid                                                                                        | Número da conta de destino é inexistente ou inválido                                                                   |
| 400                      | TED000XXX            | Invalid Target Account Document Number             | Target account document is invalid                                                                                      | Número de documento enviado é inválido                                                                                 |
| 400                      | TED000XXX            | Unrelated Beneficiary Document Number              | Target account document is not the same as sent                                                                         | Número de documento da conta de destino diferente do enviado                                                           |
| 400                      | TED000XXX            | Blocked Target Account                             | Target account is blocked.                                                                                              | A conta de destino encontra-se bloqueada.                                                                              |
| 400                      | TED000XXX            | Closed Target Account                              | Target account is closed.                                                                                               | A conta de destino encontra-se encerrada.                                                                              |
| 400                      | TED000XXX            | Rejected Payment Order                             | Transaction refused by target                                                                                           | Transação rejeitada por recebedor.                                                                                     |

[//]: # (Break here for new page -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------)

## Consultar Transação TED

### Request

ENDPOINT /account/ ACCOUNT_KEY /ted/ TED_KEY / TED_DIRECTION
MÉTODO GET

### Request Path Params

| Campo             | Tipo   | Descrição                                                   | Caracteres                                                  |
|-------------------|--------|-------------------------------------------------------------|-------------------------------------------------------------|
| `ted_direction` * | string | Filtro para indicar se uma transação é de entrada ou saída. | **[Enumerador ted_direction](#enumeradores-ted_direction)** |
| `account_key` *   | uuidv4 | Chave única de identificação da conta QI                    | 36                                                          |
| `ted_key` *       | uuidv4 | Chave única de identificação da transferência TED           | 36                                                          |

### Enumeradores ted_direction

| Enumerador | Tradução |
|------------|----------|
| incoming   | entrada  |
| outgoing   | saída    |

:::caution Atenção
Será apenas permitida a visualização de uma transferência caso o requisitante tenha permissões na conta de saída da
transação para o caso da ted_direction de outgoing ou tenha permissões na conta de entrada da
transação para o caso da ted_direction de incoming. Caso o contrário um erro de não encontrado será retornado.
:::

### Response

STATUS 200

Response Body: Transferência Rejeitada (outgoing)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "ted_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "created_at": "2021-10-22T20:30:23.459Z",
  "ted_status": "rejected",
  "transaction_amount": 126.97,
  "fee_amount": 0.0,
  "target_account": {
    "account_branch": "0001",
    "account_digit": "6",
    "account_number": "78340",
    "ispb": "12345678",
    "owner_document_number": "32402502000135",
    "owner_name": "QI Tech"
  },
  "refusal_reason": {
    "refusal_code": 1,
    "enumerator": "conta_destinatario_encerrada",
    "description": "Conta Destinatária do Crédito Encerrada"
  }
}
```

Response Body: Transferência Enviada (outgoing)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "ted_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "created_at": "2021-10-22T20:30:23.459Z",
  "ted_status": "sent",
  "transaction_amount": 126.97,
  "fee_amount": 0.0,
  "target_account": {
    "account_branch": "0001",
    "account_digit": "6",
    "account_number": "78340",
    "ispb": "12345678",
    "owner_document_number": "32402502000135",
    "owner_name": "QI Tech"
  },
  "refusal_reason": {}
}
```

Response Body: Transferência Recebida (incoming)

```json
{
  "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
  "ted_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
  "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
  "created_at": "2021-10-22T20:30:23.459Z",
  "ted_status": "received",
  "transaction_amount": 126.97,
  "fee_amount": 0.0,
  "source_account": {
    "account_branch": "0001",
    "account_digit": "6",
    "account_number": "78340",
    "ispb": "12345678",
    "owner_document_number": "32402502000135",
    "owner_name": "QI Tech"
  },
  "refusal_reason": {}
}
```

STATUS 4xx

Response Body: Error

```json
{
  "title": "titulo",
  "description": "description in English",
  "translation": "descrição em portugues",
  "code": "codigo",
  "extra_fields": {}
}
```

| Código HTTP<br/>`status` | Código QI<br/>`code` | Título<br/>`title`     | Descrição (eng)<br/>`description` | Descrição (ptbr)<br/>`translation`                                     |
|--------------------------|----------------------|------------------------|-----------------------------------|------------------------------------------------------------------------|
| 404                      | TED000XXX            | Outgoing TED Not Found | Ted key \{ted_key\} was not found | Transferência Ted de saída com chave \{ted_key\} não foi encontrada.   |
| 404                      | TED000XXX            | Incoming TED Not Found | Ted key \{ted_key\} was not found | Transferência Ted de entrada com chave \{ted_key\} não foi encontrada. |

[//]: # (Break here for new page -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------)

## Consultar Transações TED

### Request

ENDPOINT /account/ ACCOUNT_KEY /teds
MÉTODO GET

### Path Params

| Campo           | Tipo   | Descrição                                | Caracteres |
|-----------------|--------|------------------------------------------|------------|
| `account_key` * | uuidv4 | Chave única de identificação da conta QI | 36         |

### Query Params

| Campo                 | Tipo       | Descrição                                                                                                  | Caracteres                                                                  |
|-----------------------|------------|------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| `ted_direction`       | enumerator | Indicador do sentido da transação (entrada ou saída). Caso não seja enviado, **outgoing** será considerado | [Enumeradores ted_transfer_direction](#enumeradores-ted_transfer_direction) |
| `request_control_key` | uuidv4     | Chave única de identificação da request utilizada pelo cliente.                                            | 36                                                                          |
| `date_from`           | string     | Data inicial. Formato "YYYY-MM-DD"                                                                         |                                                                             |
| `date_to`             | string     | Data final. Formato "YYYY-MM-DD"                                                                           |                                                                             |
| `page`                | integer    | Número da página requisitada. 1 por padrão                                                                 |                                                                             |
| `page_size`           | integer    | Tamanho da página requisitada na consulta. 30 por padrão e valor máximo                                    | Valor máximo de 30                                                          |

### Enumeradores ted_transfer_direction

| Enumerador   | Descrição                    |
|--------------|------------------------------|
| **incoming** | Transferência TED de entrada |
| **outgoing** | Transferência TED de saída   |

### Response

STATUS 201

Response Body

```json
{
  "data": [
    {
      "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
      "ted_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
      "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
      "created_at": "2021-10-22T20:30:23.459Z",
      "ted_status": "sent",
      "transaction_amount": 126.97,
      "fee_amount": 0.0,
      "target_account": {
        "account_branch": "0001",
        "account_digit": "6",
        "account_number": "78340",
        "ispb": "12345678",
        "owner_document_number": "32402502000135",
        "owner_name": "QI Tech"
      },
      "refusal_reason": {}
    }
  ],
  "pagination": {
    "current_page": 1,
    "rows_per_page": 30
  }
}

```

[//]: # (Break here for new page -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------)

## Webhook após finalização de envio de TED

Webhook informará caso uma transação TED tenha sido devolvida.

### Webhook Request Body

**Webhook Body: TED Rejeitada**

```json
{
  "webhook_type": "baas.ted.outgoing_ted",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
    "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
    "ted_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
    "created_at": "2021-10-22T20:30:23.459Z",
    "ted_status": "sent",
    "transaction_amount": 126.97,
    "fee_amount": 0.0,
    "target_account": {
      "account_branch": "0001",
      "account_digit": "6",
      "account_number": "78340",
      "ispb": "12345678",
      "owner_document_number": "32402502000135",
      "owner_name": "QI Tech"
    },
    "refusal_reason": {
      "refusal_code": 1,
      "enumerator": "conta_destinatario_encerrada",
      "description": "Conta Destinatária do Crédito Encerrada"
    }
  }
}
```

### Webhook Body Param

| Campo                 | Tipo   | Descrição                                                                         | Max. Caracteres                                     |
|-----------------------|--------|-----------------------------------------------------------------------------------|-----------------------------------------------------|
| `webhook_type`        | string | Um enumerador que define o tipo de evento sendo reportado                         | 23                                                  |
| `webhook_datetime`    | string | Data e hora do envio do webhook                                                   | 20                                                  |
| `request_control_key` | string | Chave única de identificação da request utilizada pelo cliente no formato uuid v4 | 36                                                  | 
| `ted_key`             | string | Chave única de identificação da transferência TED                                 | 36                                                  |
| `created_at`          | string | Data e hora de criação da transação                                               | 24                                                  |
| `ted_status`          | string | Status da transação TED                                                           | **[Enumerador ted_status](#enumerador-ted_status)** |
| `transaction_amount`  | number | Valor da transferência                                                            | 10                                                  |
| `fee_amount`          | number | Valor da taxca cobrada pela transferencia                                         | 35                                                  |
| `target_account`      | Object | Conta destino - Só deve ser enviada em transações do tipo "manual"                | **[Objeto target_account](#objeto-target_account)** |
| `refusal_reason`      | Object | Motivo da recusa de acordo com o padrão do Banco Central                          | **[Objeto refusal_reason](#objeto-refusal_reason)** |

### Enumerador ted_status

| Enumerador   | Descrição                                |
|--------------|------------------------------------------|
| **sent**     | Transferência TED realizada com sucesso. |
| **pending**  | Transferência TED pendente.              |
| **rejected** | Transferência TED rejeitada.             |
| **returned** | Transferência TED devolvida.             |

### Objeto target_account

| Campo                     | Tipo   | Descrição                                           | Caracteres                                              |
|---------------------------|--------|-----------------------------------------------------|---------------------------------------------------------|
| `account_branch` *        | string | Agência.                                            | 4                                                       |
| `account_digit` *         | string | Dígito da conta                                     | 1                                                       |
| `account_number` *        | string | Número da conta.                                    | 20                                                      |
| `owner_document_number` * | string | CPF ou CNPJ (apenas números) do titular da conta.   | 14                                                      |
| `owner_name` *            | string | Nome do titular da conta.                           | 50                                                      |
| `account_type`*           | string | Tipo da conta.                                      | **[Enumerador account_type](#enumerador-account_type)** |
| `ispb` *                  | string | Base no CNPJ da instituição financeira (8 dígitos). | 8                                                       |

### Objeto refusal_reason

| Campo           | Tipo   | Descrição                  | Caracteres |
|-----------------|--------|----------------------------|------------|
| `bacen_code` *  | string | Código de recusa Bacen     | 3          |
| `enumerator` *  | string | Enumerador da recusa Bacen | 100        |
| `description` * | string | Descrição da recusa Bacen  | 100        |

### Enumerador account_type

| Enumerador         | Tradução              |
|--------------------|-----------------------|
| checking_account   | conta corrente        |
| deposit_account    | conta depósito        |
| guaranteed_account | conta de garantia     |
| investment_account | conta de investimento |
| payment_account    | conta de pagamento    |
| saving_account     | conta poupança        |

## Webhook após o recebimento de TED

Webhook informará sobre o status final da transação TED.

### Webhook Request Body

**Request Body: TED Recebida**

```json
{
  "webhook_type": "baas.ted.incoming_ted",
  "webhook_datetime": "2021-10-22T20:30:23.459Z",
  "data": {
    "request_control_key": "6e290347-330d-4b3a-8ebb-2ac217ad6eb3",
    "ted_key": "8cb70dea-9fb0-4a68-9572-99a72849c8d6",
    "account_key": "fc6862c4-2b20-4057-8063-b8809866e494",
    "created_at": "2021-10-22T20:30:23.459Z",
    "ted_status": "received",
    "transaction_amount": 126.97,
    "fee_amount": 0.0,
    "source_account": {
      "account_branch": "0001",
      "account_digit": "6",
      "account_number": "78340",
      "ispb": "12345678",
      "owner_document_number": "32402502000135",
      "owner_name": "QI Tech"
    },
    "refusal_reason": {}
  }
}
```

### Webhook Body Param

| Campo                 | Tipo   | Descrição                                                                         | Max. Caracteres                                     |
|-----------------------|--------|-----------------------------------------------------------------------------------|-----------------------------------------------------|
| `webhook_type`        | string | Um enumerador que define o tipo de evento sendo reportado                         | 23                                                  |
| `webhook_datetime`    | string | Data e hora do envio do webhook                                                   | 20                                                  |
| `ted_key`             | string | Chave única de identificação da transferência TED                                 | 36                                                  |
| `created_at`          | string | Data e hora de criação da transação                                               | 100                                                 |
| `ted_status`          | string | Status da transação TED                                                           | **[Enumerador ted_status](#enumerador-ted_status)** |
| `transaction_amount`  | number | Valor da transferência                                                            | 10                                                  |
| `fee_amount`          | number | Valor da taxca cobrada pela transferencia                                         | 35                                                  |
| `target_account`      | Object | Conta destino - Só deve ser enviada em transações do tipo "manual"                | **[Objeto target_account](#objeto-target_account)** |
| `refusal_reason`      | Object | Motivo da recusa de acordo com o padrão do Banco Central                          | **[Objeto refusal_reason](#objeto-refusal_reason)** |

### Enumerador ted_status

| Enumerador   | Descrição                                |
|--------------|------------------------------------------|
| **received** | Transferência TED realizada com sucesso. |
| **pending**  | Transferência TED pendente.              |
| **rejected** | Transferência TED rejeitada.             |

### Objeto target_account

| Campo                     | Tipo   | Descrição                                           | Caracteres                                              |
|---------------------------|--------|-----------------------------------------------------|---------------------------------------------------------|
| `account_branch` *        | string | Agência.                                            | 10                                                      |
| `account_digit` *         | string | Dígito da conta                                     | 10                                                      |
| `account_number` *        | string | Número da conta.                                    | 10                                                      |
| `owner_document_number` * | string | CPF ou CNPJ (apenas números) do titular da conta.   | 14                                                      |
| `owner_name` *            | string | Nome do titular da conta.                           | 50                                                      |
| `account_type`*           | string | Tipo da conta.                                      | **[Enumerador account_type](#enumerador-account_type)** |
| `ispb` *                  | string | Base no CNPJ da instituição financeira (8 dígitos). | 8                                                       |

### Objeto refusal_reason

| Campo           | Tipo   | Descrição                  | Caracteres |
|-----------------|--------|----------------------------|------------|
| `bacen_code` *  | string | Código de recusa Bacen     | 3          |
| `enumerator` *  | string | Enumerador da recusa Bacen | 100        |
| `description` * | string | Descrição da recusa Bacen  | 100        |

### Enumerador account_type

| Enumerador         | Tradução              |
|--------------------|-----------------------|
| checking_account   | conta corrente        |
| deposit_account    | conta depósito        |
| guaranteed_account | conta de garantia     |
| investment_account | conta de investimento |
| payment_account    | conta de pagamento    |
| saving_account     | conta poupança        |

---

# consulta_de_agenda_com_opt_in

URL: /en/documentation/trava_de_domicilio_bancario/consulta_de_agenda_com_opt_in

## Request

- ENDPOINT /receivables/inquiry
- MÉTODO POST
- BODY (antes de ser assinado):

:::caution **Atenção**

Essa request gera um documento de autorização para assinatura, ao ser assinada a agenda vai ser consultada e o resultado devolvido por webhook.

:::

YOUR REQUEST HISTORY

**body.json**

```json
{
    "notification_type": "webhook",
    "owner_person_type": "legal",
    "owner_person_name": "John Sample Inc",
    "owner_document_number": "86498542000151",
    "reference_code": "5830c2f9-fd17-4c9c-b30c-68ddd1a92751",
    "agenda": {
        "end_date": "2021-06-23",
        "start_date": "2021-06-23"
    }
}

```

### Body Params

| Campo | Descrição |
|---|---|
| `notification_type` *(obrigatório)* |  |
| `owner_person_type` *(obrigatório)* | Tipo de pessoa (natural ou juridica) objeto da consulta de agenda. |
| `owner_person_name` *(obrigatório)* | Nome do objeto da consulta de agenda. |
| `owner_document_number` *(obrigatório)* | Numero de documento do objeto da consulta de agenda. |
| `reference_code` *(obrigatório)* | Identificador único do opt-in. |
| `signature` *(obrigatório)* | Informações do opt-in. |
| `agenda` *(obrigatório)* | Parâmetros para a consulta de agenda. |

### SIGNATURE OBJECT

| Campo | Descrição |
|---|---|
| `signers` *(obrigatório)* | Lista de signatários. |

### AGENDA OBJECT

| Campo | Descrição |
|---|---|
| `acquirers` *(obrigatório)* | Lista de números de documentos da Credenciadoras. |
| `card_schemes` *(obrigatório)* | Lista de arranjos de pagamento. |
| `end_date` | Data de termino da consulta. |
| `start_date` *(obrigatório)* | Data de início da consulta. |

---

# consulta_de_agenda_sem_opt_in

URL: /en/documentation/trava_de_domicilio_bancario/consulta_de_agenda_sem_opt_in

## Request

- ENDPOINT /receivables/inquiry
- MÉTODO POST
- BODY (antes de ser assinado):

YOUR REQUEST HISTORY

**body.json**

```json
{
    "notification_type": "webhook",
    "owner_person_type": "legal",
    "owner_person_name": "John Sample Inc",
    "owner_document_number": "86498542000151",
    "reference_code": "5830c2f9-fd17-4c9c-b30c-68ddd1a92751",
    "agenda": {
        "end_date": "2021-06-23",
        "start_date": "2021-06-23"
    }
}

```

:::caution **Atenção**

A request com pré-autorização deverá ser usada, quando o solicitante da agenda já tem o consentimento do cliente. Dessa forma, deverá ser passado no campo authorization dentro de signatures, todas as informações referentes ao consentimento do cliente.

Essa request gerará uma consulta de agenda que será consultada assincronamente, o resultado virá via webhook.

:::

### Body Params

| Campo | Descrição |
|---|---|
| `notification_type` *(obrigatório)* |  |
| `owner_person_type` *(obrigatório)* | Tipo de pessoa (natural ou juridica) objeto da consulta de agenda. |
| `owner_person_name` *(obrigatório)* | Nome do objeto da consulta de agenda. |
| `owner_document_number` *(obrigatório)* | Numero de documento do objeto da consulta de agenda. |
| `reference_code` *(obrigatório)* | Identificador único do opt-in. |
| `signature` *(obrigatório)* | Informações do opt-in. |
| `agenda` *(obrigatório)* | Parâmetros para a consulta de agenda. |

### SIGNATURE OBJECT

| Campo | Descrição |
|---|---|
| `signers` *(obrigatório)* | Lista de signatários. |
| `authorization` *(obrigatório)* | |

### AGENDA OBJECT

| Campo | Descrição |
|---|---|
| `acquirers` *(obrigatório)* | Lista de números de documentos da Credenciadoras. |
| `card_schemes` *(obrigatório)* | Lista de arranjos de pagamento. |
| `end_date` | Data de termino da consulta. |
| `start_date` *(obrigatório)* | Data de início da consulta. |

---

# emissao_de_divida_com_trava_de_agenda

URL: /en/documentation/trava_de_domicilio_bancario/emissao_de_divida_com_trava_de_agenda

## Request

- ENDPOINT /baas/debt_receivables
- MÉTODO POST
- BODY (antes de ser assinado):

YOUR REQUEST HISTORY

:::info

A emissão de dividas com trava de agenda segue o mesmo forma de uma emissão de dividas simples apresentada no conjunto de APIs 3, com a adição do objeto "contract" conforme descrito aqui.

:::

**body.json**

```json
{"contract": {
        "payment_account": {
            "account_number": "48391",
            "account_branch": "0001",
            "account_digit": "6",
            "owner_document_number": "86498542000151"
        },
        "collateral_management": {
            "collateral_management_type": "absolute",
            "amount": 2000,
            "maximum_value": 2000,
            "maximum_daily_value": 200,
            "minimum_date": "2021-06-28",
            "contract_payment_type": "partial_payment"
        }
    }}

```

### Body Params

| Campo | Descrição |
|---|---|
| `contract` | Dados da garantia. |

### CONTRACT OBJECT

| Campo | Descrição |
|---|---|
| `payment_account` | Conta de pagamentos para os recebíveis |
| `collaterals` | Listas de garantias. |
| `collateral_management` | Configurações de garantia. |

### PAYMENT ACCOUNT OBJECT

| Campo | Descrição |
|---|---|
| `account_number` *(obrigatório)* | Número da conta onde vão cair os recebíveis de cartão. |
| `account_branch` *(obrigatório)* | Agência da conta. |
| `account_digit` *(obrigatório)* | Dígito da conta. |
| `owner_document_number` *(obrigatório)* | Número de documento do titular da conta (CPF ou CNPJ). |

### COLLATERALS OBJECT

| Campo | Descrição |
|---|---|
| `acquirer` *(obrigatório)* | Lista de números de documentos da Credenciadoras. |
| `card_scheme` *(obrigatório)* | Lista de arranjos de pagamento. |
| `initial_date` *(obrigatório)* | Data de início do contrato. |
| `final_date` *(obrigatório)* | Data de termino do contrato. |
| `division_rule` *(obrigatório)* | Tipo de distribuição dos ônus pré-definida de acordo com tabela fornecida pela QI Tech. 1- Comprometimento de valor definido 2- Comprometimento de percentual do valor que vier a ser constituído |
| `encumbered_amount` *(obrigatório)* | Valor a onerar conforme a regra de divisão. |

### COLLATERALS MANAGEMENT OBJECT

| Campo | Descrição |
|---|---|
| `collateral_management_type` *(obrigatório)* | Tipo de gestão a ser utilizada para amortizar a divida. |
| `amount` *(obrigatório)* | Valor a ser utilizado. |
| `maximum_value` | Valor máximo que será utilizado para pagamento da operação. |
| `maximum_daily_value` | Valor máximo que será utilizado por dia. |
| `minimum_date` | Data mínima para começar à utilizar os recebiveis. |
| `contract_payment_type` *(obrigatório)* | Tipo de pagamento para o contrato |

---

# introducao

URL: /en/documentation/trava_de_domicilio_bancario/introducao

## Trava de domicílio bancário

Caso o cliente deseje realizar uma operação de crédito com garantia em recebíveis, a QI Tech juntamente com a CERC, está preparada para criar essa operação de maneira muito semelhante ao fluxo de emissão de dívida comum.

---

# Open bank slip ownership exchange batch

URL: /en/documentation/troca_de_titularidade/abrir_lote

This endpoint will create a bank slip ownership exchange batch. 
The batch is created without any bank slips, and the bank slips will need to be inserted through the [bank slip inclusion endpoint](/incluir_boletos).

## Request

ENDPOINT /account/ ACCOUNT-KEY /requester_profile/ REQUESTER-PROFILE-KEY /bank_slip_ownership_exchange_batch/stream
METHOD POST

### Path parameters

| Field         | Type   | Description                                                                                                              | Characters |
|---------------|--------|------------------------------------------------------------------------------------------------------------------------|------------|
| `ACCOUNT-KEY` | uuidv4 | Unique identification key of the origin account, where the bank slips were originally registered.                      | 36         |
| `REQUESTER-PROFILE-KEY` | uuidv4 | Unique identification key of the origin billing portfolio, where the bank slips were originally registered. | 36         |

Request Body - Billing portfolio UUID key

```json
{
	"request_control_key": "66c9399a-1463-4e2b-acc0-7ee447f81bf0",
	"new_requester_profile_key": "e494067f-5bd4-4819-b64f-0687bd217f45",
	"new_pix_key": "2376da91-86ad-4a0b-a466-f0f5acf53e24"
}
```

Request Body - Billing portfolio code

```json
{
	"request_control_key": "66c9399a-1463-4e2b-acc0-7ee447f81bf0",
	"new_requester_profile_code": "329-09-0001-1234567",
	"new_pix_key": "2376da91-86ad-4a0b-a466-f0f5acf53e24"
}
```

:::info Bank slip billing portfolio code
The Billing Portfolio Code is a string that follows the following pattern:

[ Bank Number ] + [ Portfolio Code ] + [ Account Branch Number ] + [ Account Number with 7 characters and without check digit ]

By default, at QI Tech, the Bank Number, Portfolio Code and Branch will always be `329`, `09` and `0001`, respectively.

Therefore, the Billing Portfolio Code for account 5308318-3 will be: `329-09-0001-5308318`.
:::

## Body Params
| Field | Type | Description | Characters |
|---|------|-----------| --|
|`request_control_key`| uuidv4 | Unique identification key of the request on this endpoint. Used to avoid duplication in the API call. |36|
|`new_requester_profile_key`| uuidv4 | Unique identification key of the destination billing portfolio. It's the billing portfolio where the bank slips will be transferred. You can obtain this key through the [account billing portfolios query endpoint](../boletos/carteira/listar_carteiras) |36|
|`new_requester_profile_code`| string | Destination billing portfolio code. It's the billing portfolio where the bank slips will be transferred. |19|
|`new_pix_key` | string | PIX key of the destination account for the ownership exchange (for bolepix cases). | 255 |

## Response

STATUS 202

Response Body

```json
{
    "bank_slip_ownership_exchange_batch_key": "243c9369-ce8b-49df-969c-d891c2fc8c21",
    "request_control_key": "66c9399a-1463-4e2b-acc0-7ee447f81bf0",
    "bank_slip_ownership_exchange_batch_status": "open",
    "new_requester_profile_key": "e494067f-5bd4-4819-b64f-0687bd217f45",
    "new_requester_profile_code": "329-09-0001-8703524",
    "new_requester_profile_owner_name": "Fulano de Tal",
    "new_requester_profile_owner_document_number": "70896538000101",
    "new_requester_profile_account_number": "8703524",
    "new_requester_profile_account_digit": "1",
    "new_requester_profile_account_branch": "0001",
    "new_pix_key": "2376da91-86ad-4a0b-a466-f0f5acf53e24",
    "total_bank_slip_count": 0,
    "total_amount": 0
}
```

## Response Params
| Field                                         | Type  | Description                                                                                                                                                                                                                                                                   | Characters                                                                                                          |
|-----------------------------------------------|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| `bank_slip_ownership_exchange_batch_key`      | uuidv4 | Unique identification key of the ownership exchange batch.                                                                                                                                                                                                                        | 36                                                                                                                  |
| `request_control_key`                         | uuidv4 | Unique identification key of the request on this endpoint. Used to avoid duplication in the API call.                                                                                                                                                            | 36                                                                                                                  |
| `bank_slip_ownership_exchange_batch_status`   | enum  | Status of the ownership exchange batch.                                                                                                                                                                                                                                               | [Enumerators `bank_slip_ownership_exchange_batch_status`](#enumerators-bank_slip_ownership_exchange_batch_status) |
| `new_requester_profile_key`                   | uuidv4 | Unique identification key of the destination billing portfolio. It's the billing portfolio where the bank slips will be transferred. You can obtain this key through the [account billing portfolios query endpoint](../boletos/carteira/listar_carteiras) | 36                                                                                                                  |
| `new_requester_profile_code`                  | string | Destination billing portfolio code. It's the billing portfolio where the bank slips will be transferred.                                                                                                                                                                    | 19                                                                                                                  |
| `new_requester_profile_owner_name`            | string | Name of the destination account holder and beneficiary of the destination billing portfolio.                                                                                                                                                                                   | 255                                                                                                                 |
| `new_requester_profile_owner_document_number` | string | Document number (CPF/CNPJ) of the destination account holder and beneficiary of the destination billing portfolio.                                                                                                                                                         | 255                                                                                                                 |
| `new_requester_profile_account_number`        | string | Destination account number for the ownership exchange.                                                                                                                                                                                                                                   | 7                                                                                                                   |
| `new_requester_profile_account_digit`         | string | Check digit of the destination account for the ownership exchange.                                                                                                                                                                                                                       | 1                                                                                                                   |
| `new_requester_profile_account_branch`        | string | Branch number of the destination account for the ownership exchange.                                                                                                                                                                                                                        | 4                                                                                                                   |
| `new_pix_key`                                 | string | PIX key of the destination account for the ownership exchange (for bolepix cases).                                                                                                                                                                                                     | 255                                                                                                                 |
| `total_bank_slip_count`                       | float | Total number of bank slips in the ownership exchange batch.                                                                                                                                                                                                                                     | -                                                                                                                   |
| `total_amount`                                 | float | Sum of the face value of bank slips in the ownership exchange batch.                                                                                                                                                                                               | -                                                                                                                   |                                                                                                                                                                                                               

### Enumerators bank_slip_ownership_exchange_batch_status
| Enumerator | Description                                                                                              |
|------------|--------------------------------------------------------------------------------------------------------|
| open       | The batch was created and is still open for bank slip inclusion/exclusion.                               |
| sent     | Bank slip selection has been completed and the ownership exchange batch is pending approval. The approving party needs to perform the approval                  |
| processing | Bank slip selection has been completed and the ownership exchange of bank slips contained in the batch is being processed. |
| approved | Bank slips contained in the batch have already been transferred to the recipient |
| cancelled   | Ownership exchange batch cancelled. |
| rejected | Ownership exchange batch rejected. |

---

# Approve Bank Slip Ownership Exchange Batch

URL: /en/documentation/troca_de_titularidade/aprovar_lote

Once the ownership exchange batch has been sent through ```/send```, it is necessary to approve the ownership exchange.

The approval must be done by the destination account and requester, which will be the new owners responsible for the bank slips after the ownership exchange. If the ownership exchange is between accounts of the same requester, it's sufficient to change the account-key.

## Request

ENDPOINT /account/ ACCOUNT-KEY /requester_profile/ REQUESTER-PROFILE-KEY /bank_slip_ownership_exchange_batch/ BANK-SLIP-OWNERSHIP-EXCHANGE-BATCH-KEY /approve
METHOD PATCH

### Path parameters

| Field                                    | Type   | Description                                                                                                        | Characters |
|------------------------------------------|--------|--------------------------------------------------------------------------------------------------------------------|------------|
| `ACCOUNT-KEY`                            | uuidv4 | Unique identification key of the destination account where the bank slips will be sent.                | 36         |
| `REQUESTER-PROFILE-KEY`                  | uuidv4 | Unique identification key of the destination wallet where the bank slips will be transferred. | 36         |
| `BANK-SLIP-OWNERSHIP-EXCHANGE-BATCH-KEY` | uuidv4 | Unique identification key of the ownership exchange batch.                                                             | 36         |

Request Body

```json
{}
```

## Response

STATUS 200

Response Body

```json
{
    "bank_slip_ownership_exchange_batch_key": "243c9369-ce8b-49df-969c-d891c2fc8c21",
    "request_control_key": "66c9399a-1463-4e2b-acc0-7ee447f81bf0",
    "bank_slip_ownership_exchange_batch_status": "processing",
    "new_requester_profile_key": "e494067f-5bd4-4819-b64f-0687bd217f45",
    "new_requester_profile_code": "329-09-0001-8703524",
    "new_requester_profile_owner_name": "Fulano de Tal",
    "new_requester_profile_owner_document_number": "70896538000101",
    "new_requester_profile_account_number": "8703524",
    "new_requester_profile_account_digit": "1",
    "new_requester_profile_account_branch": "0001",
    "new_pix_key": "2376da91-86ad-4a0b-a466-f0f5acf53e24",
    "total_bank_slip_count": 3,
    "total_amount": 750.00
}
```

## Response Params
| Field | Type | Description | Characters                                                                                                          |
|---|------|-----------|---------------------------------------------------------------------------------------------------------------------|
| `bank_slip_ownership_exchange_batch_key`      | uuidv4 | Unique identification key of the ownership exchange batch.                                                                                                                                                                                                                        | 36                                                                                                                  |
| `request_control_key`                         | uuidv4 | Unique identification key of the request on this endpoint. Used to avoid duplication in API calls.                                                                                                                                                            | 36                                                                                                                  |
| `bank_slip_ownership_exchange_batch_status`   | enum  | Status of the ownership exchange batch.                                                                                                                                                                                                                                               | [Enumerators `bank_slip_ownership_exchange_batch_status`](#enumerators-bank_slip_ownership_exchange_batch_status) |
| `new_requester_profile_key`                   | uuidv4 | Unique identification key of the destination collection wallet. It is the collection wallet to which the bank slips will be transferred. You can obtain this key through the [account collection wallets query endpoint](../boletos/carteira/listar_carteiras) | 36                                                                                                                  |
| `new_requester_profile_code`                  | string | Code of the destination collection wallet. It is the collection wallet to which the bank slips will be transferred.                                                                                                                                                                    | 19                                                                                                                  |
| `new_requester_profile_owner_name`            | string | Name of the destination account holder and beneficiary of the destination collection wallet.                                                                                                                                                                                   | 255                                                                                                                 |
| `new_requester_profile_owner_document_number` | string | Document number (CPF/CNPJ) of the destination account holder and beneficiary of the destination collection wallet.                                                                                                                                                         | 255                                                                                                                 |
| `new_requester_profile_account_number`        | string | Destination account number for the ownership exchange.                                                                                                                                                                                                                                   | 7                                                                                                                   |
| `new_requester_profile_account_digit`         | string | Check digit of the destination account for the ownership exchange.                                                                                                                                                                                                                       | 1                                                                                                                   |
| `new_requester_profile_account_branch`        | string | Branch number of the destination account for the ownership exchange.                                                                                                                                                                                                                        | 4                                                                                                                   |
| `new_pix_key`                                 | string | PIX key of the destination account for the ownership exchange (for bolepix cases).                                                                                                                                                                                                     | 255                                                                                                                 |
| `total_bank_slip_count`                       | float | Total number of bank slips in the ownership exchange batch.                                                                                                                                                                                                                                     | -                                                                                                                   |
| `total_amount`                                | float | Sum of the face value of bank slips in the ownership exchange batch. | -                                                                                                                   |                                                                                                                                                                                                               

### Enumerators bank_slip_ownership_exchange_batch_status
| Enumerator | Description                                                                                              |
|------------|--------------------------------------------------------------------------------------------------------|
| open       | The batch has been created and is still open for adding/removing bank slips.                               |
| closed     | The batch is closed and the ownership exchange of the bank slips contained in the batch has been completed.                  |
| processing | Bank slip selection has been completed and the ownership exchange of bank slips contained in the batch is being processed. |
| pending_approval | Bank slip selection has been completed and the ownership exchange batch is pending approval. The approving party can remove bank slips from the batch. |
| canceled   | Ownership exchange batch canceled. |
| rejected | Ownership exchange batch rejected. |

---

# Cancel bank slip ownership exchange batch

URL: /en/documentation/troca_de_titularidade/cancelar_lote

## Request

ENDPOINT /bank_slip/account/ ACCOUNT-KEY /requester_profile/ REQUESTER-PROFILE-KEY /bank_slip_ownership_exchange_batch/ BANK-SLIP-OWNERSHIP-EXCHANGE-BATCH-KEY /cancel
METHOD PATCH

### Path parameters

| Field                                    | Type   | Description                                                                                                              | Characters |
|------------------------------------------|--------|------------------------------------------------------------------------------------------------------------------------|------------|
| `ACCOUNT-KEY`                            | uuidv4 | Unique identification key of the source account, where the bank slips were originally registered.                      | 36         |
| `REQUESTER-PROFILE-KEY`                  | uuidv4 | Unique identification key of the source billing portfolio, where the bank slips were originally registered. | 36         |
| `BANK-SLIP-OWNERSHIP-EXCHANGE-BATCH-KEY` | uuidv4 |Unique identification key of the ownership exchange batch.| 36         |

Request Body

```json
{}
```

## Response

STATUS 200

Response Body

```json
{
    "bank_slip_ownership_exchange_batch_key": "243c9369-ce8b-49df-969c-d891c2fc8c21",
    "request_control_key": "66c9399a-1463-4e2b-acc0-7ee447f81bf0",
    "bank_slip_ownership_exchange_batch_status": "canceled",
    "new_requester_profile_key": "e494067f-5bd4-4819-b64f-0687bd217f45",
    "new_requester_profile_code": "329-09-0001-8703524",
    "new_requester_profile_owner_name": "Fulano de Tal",
    "new_requester_profile_owner_document_number": "70896538000101",
    "new_requester_profile_account_number": "8703524",
    "new_requester_profile_account_digit": "1",
    "new_requester_profile_account_branch": "0001",
    "new_pix_key": "2376da91-86ad-4a0b-a466-f0f5acf53e24",
    "total_bank_slip_count": 3,
    "total_amount": 750.00
}
```

## Response Params
| Field | Type | Description | Characters                                                                                                          |
|---|------|-----------|---------------------------------------------------------------------------------------------------------------------|
| `bank_slip_ownership_exchange_batch_key`      | uuidv4 | Unique identification key of the ownership exchange batch.                                                                                                                                                                                                                        | 36                                                                                                                  |
| `request_control_key`                         | uuidv4 | Unique identification key of the request to this endpoint. Used to prevent duplicates in API calls.                                                                                                                                                            | 36                                                                                                                  |
| `bank_slip_ownership_exchange_batch_status`   | enum  | Status of the ownership exchange batch.                                                                                                                                                                                                                                               | [Enumerators `bank_slip_ownership_exchange_batch_status`](#enumerators-bank_slip_ownership_exchange_batch_status) |
| `new_requester_profile_key`                   | uuidv4 | Unique identification key of the destination billing portfolio. This is the billing portfolio to which the bank slips will be transferred. You can get this key through the [endpoint for querying billing portfolios of an account](../boletos/carteira/listar_carteiras) | 36                                                                                                                  |
| `new_requester_profile_code`                  | string | Code of the destination billing portfolio. This is the billing portfolio to which the bank slips will be transferred.                                                                                                                                                                    | 19                                                                                                                  |
| `new_requester_profile_owner_name`            | string | Name of the destination account holder and beneficiary of the destination billing portfolio.                                                                                                                                                                                   | 255                                                                                                                 |
| `new_requester_profile_owner_document_number` | string | Document number (CPF/CNPJ) of the destination account holder and beneficiary of the destination billing portfolio.                                                                                                                                                         | 255                                                                                                                 |
| `new_requester_profile_account_number`        | string | Destination account number for the ownership exchange.                                                                                                                                                                                                                                   | 7                                                                                                                   |
| `new_requester_profile_account_digit`         | string | Check digit of the destination account for the ownership exchange.                                                                                                                                                                                                                       | 1                                                                                                                   |
| `new_requester_profile_account_branch`        | string | Branch number of the destination account for the ownership exchange.                                                                                                                                                                                                                        | 4                                                                                                                   |
| `new_pix_key`                                 | string | PIX key of the destination account for the ownership exchange (for bolepix cases).                                                                                                                                                                                                     | 255                                                                                                                 |
| `total_bank_slip_count`                       | float | Total number of bank slips in the ownership exchange batch.                                                                                                                                                                                                                                     | -                                                                                                                   |
| `total_amount`                                | float | Sum of the face value of the bank slips in the ownership exchange batch. | -                                                                                                                   |                                                                                                                                                                                                               

### Enumerators bank_slip_ownership_exchange_batch_status
| Enumerator | Description                                                                                              |
|------------|--------------------------------------------------------------------------------------------------------|
| open       | The batch was created and is still open for inclusion/exclusion of bank slips.                               |
| closed     | The batch is closed and the ownership exchange of the bank slips contained in the batch has been completed.                  |
| processing | Bank slip selection has been completed and the ownership exchange of the bank slips contained in the batch is being processed. |
| pending_approval | Bank slip selection has been completed and the ownership exchange batch is pending approval. The approving party can remove bank slips from the batch. |
| canceled   | Ownership exchange batch canceled. |
| rejected | Ownership exchange batch rejected. |

---

# Create bank slip ownership exchange batch

URL: /en/documentation/troca_de_titularidade/criar_lote_batch

## Request

ENDPOINT /bank_slip/account/ ACCOUNT-KEY /requester_profile/ REQUESTER-PROFILE-KEY /bank_slip_ownership_exchange_batch
METHOD POST

### Path parameters

| Field         | Type   | Description                                                                                                              | Characters |
|---------------|--------|------------------------------------------------------------------------------------------------------------------------|------------|
| `ACCOUNT-KEY` | uuidv4 | Unique identification key of the source account where the bank slips were originally registered.                      | 36         |
| `REQUESTER-PROFILE-KEY` | uuidv4 | Unique identification key of the source billing profile where the bank slips were originally registered. | 36         |

Request Body - Billing profile key

```json
{
	"bank_slips": [
		"b21c5b5a-a71f-4672-9254-022401cd15f6",
		"8197e3d0-1500-439f-9f9d-d243115542fa",
		"8293b817-bed9-418a-8c1e-ec8ef5a31468"
	],
	"request_control_key": "66c9399a-1463-4e2b-acc0-7ee447f81bf0",
	"new_requester_profile_key": "e494067f-5bd4-4819-b64f-0687bd217f45",
	"new_pix_key": "2376da91-86ad-4a0b-a466-f0f5acf53e24"
}
```

Request Body - Billing profile code

```json
{
	"bank_slips": [
		"b21c5b5a-a71f-4672-9254-022401cd15f6",
		"8197e3d0-1500-439f-9f9d-d243115542fa",
		"8293b817-bed9-418a-8c1e-ec8ef5a31468"
	],
	"request_control_key": "66c9399a-1463-4e2b-acc0-7ee447f81bf0",
	"new_requester_profile_code": "329-09-0001-1234567",
	"new_pix_key": "2376da91-86ad-4a0b-a466-f0f5acf53e24"
}
```

## Body Params
| Field | Type | Description | Characters |
|---|------|-----------|------------|
|`bank_slips` | list | List of bank slips that will be included in the ownership exchange batch.         | 36         |
|`request_control_key`| uuidv4 | Unique request identification key for this endpoint. Used to avoid request duplication via API. | 36         |
|`new_requester_profile_key`| uuidv4 | Unique identification key of the destination billing profile. This is the billing profile where the bank slips will be transferred to. You can obtain this key through the [account billing profiles query endpoint](../boletos/carteira/listar_carteiras) | 36         |
|`new_requester_profile_code`| string | Destination billing profile code. This is the billing profile where the bank slips will be transferred to. | 19         |
|`new_pix_key` | uuidv4 | PIX key of the ownership exchange destination account (for bolepix cases). | 36         |

:::caution Attention!
The list of bank slips informed in the `bank_slips` object in the batch creation payload has a limitation of 10,000 bank slips per request.
:::

:::info Bank Slip Billing Profile Code
The Billing Profile Code is a string that follows the following pattern:

[ Bank Number ] + [ Profile Code ] + [ Account Branch Number ] + [ Account Number with 7 characters and no verification digit ]

By default, at QI Tech, the Bank Number, Profile Code and Branch will always be `329`, `09` and `0001`, respectively.

Therefore, the Billing Profile Code for account 5308318-3 will be: `329-09-0001-5308318`.
:::

## Response

STATUS 201 Created

Response Body

```json
{
    "bank_slip_ownership_exchange_batch_key": "243c9369-ce8b-49df-969c-d891c2fc8c21",
    "request_control_key": "66c9399a-1463-4e2b-acc0-7ee447f81bf0",
    "bank_slip_ownership_exchange_batch_status": "closed",
    "bank_slips": [
        "b21c5b5a-a71f-4672-9254-022401cd15f6",
        "8197e3d0-1500-439f-9f9d-d243115542fa",
        "8293b817-bed9-418a-8c1e-ec8ef5a31468"
    ],
    "new_requester_profile_key": "e494067f-5bd4-4819-b64f-0687bd217f45",
    "new_requester_profile_code": "329-09-0001-8703524",
    "new_requester_profile_owner_name": "Fulano de Tal",
    "new_requester_profile_owner_document_number": "70896538000101",
    "new_requester_profile_account_number": "8703524",
    "new_requester_profile_account_digit": "1",
    "new_requester_profile_account_branch": "0001",
    "pix_key": "2376da91-86ad-4a0b-a466-f0f5acf53e24",
    "total_bank_slip_count": 40,
    "total_amount": 67245.96
}
```

## Response Params
| Field | Type | Description | Characters                                                                                                          |
|---|------|-----------|---------------------------------------------------------------------------------------------------------------------|
| `bank_slip_ownership_exchange_batch_key`      | uuidv4 | Unique identification key of the ownership exchange batch.                                                                                                                                                                                                                        | 36                                                                                                                  |
| `request_control_key`                         | uuidv4 | Unique request identification key for this endpoint. Used to avoid request duplication via API.                                                                                                                                                            | 36                                                                                                                  |
| `bank_slip_ownership_exchange_batch_status`   | enum  | Status of the ownership exchange batch.                                                                                                                                                                                                                                               | [Enumerators `bank_slip_ownership_exchange_batch_status`](#enumerators-bank_slip_ownership_exchange_batch_status) |
|`bank_slips` | list | List of bank slips that will be included in the ownership exchange batch.         | 36                                                                                                                  |
| `new_requester_profile_key`                   | uuidv4 | Unique identification key of the destination billing profile. This is the billing profile where the bank slips will be transferred to. You can obtain this key through the [account billing profiles query endpoint](../boletos/carteira/listar_carteiras) | 36                                                                                                                  |
| `new_requester_profile_code`                  | string | Destination billing profile code. This is the billing profile where the bank slips will be transferred to.                                                                                                                                                                    | 19                                                                                                                  |
| `new_requester_profile_owner_name`            | string | Name of the destination account holder and beneficiary of the destination billing profile.                                                                                                                                                                                   | 255                                                                                                                 |
| `new_requester_profile_owner_document_number` | string | Document number (CPF/CNPJ) of the destination account holder and beneficiary of the destination billing profile.                                                                                                                                                         | 255                                                                                                                 |
| `new_requester_profile_account_number`        | string | Destination account number for the ownership exchange.                                                                                                                                                                                                                                   | 7                                                                                                                   |
| `new_requester_profile_account_digit`         | string | Verification digit of the destination account for the ownership exchange.                                                                                                                                                                                                                       | 1                                                                                                                   |
| `new_requester_profile_account_branch`        | string | Branch number of the destination account for the ownership exchange.                                                                                                                                                                                                                        | 4                                                                                                                   |
| `new_pix_key`                                 | string | PIX key of the ownership exchange destination account (for bolepix cases).                                                                                                                                                                                                     | 255                                                                                                                 |
| `total_bank_slip_count`                       | float | Total number of bank slips in the ownership exchange batch.                                                                                                                                                                                                                                     | -                                                                                                                   |
| `total_amount`                                 | float | Sum of the face value of bank slips in the ownership exchange batch. | -                                                                                                                   |                                                                                                                                                                                                               

### Enumerators bank_slip_ownership_exchange_batch_status
| Enumerator | Description                                                                                              |
|------------|--------------------------------------------------------------------------------------------------------|
| open       | The batch was created and is still open for inclusion/exclusion of bank slips.                               |
| closed     | The batch is closed and the ownership exchange of the bank slips contained in the batch has been completed.                  |
| processing | Bank slip selection has been completed and the ownership exchange of the bank slips contained in the batch is being processed. |
| canceled   | Ownership exchange batch canceled. |
| rejected | Ownership exchange batch rejected. |

---

# Include bank slips in an ownership exchange batch

URL: /en/documentation/troca_de_titularidade/incluir_boletos

This endpoint is used to include bank slips in a bank slip ownership exchange batch.

## Request

ENDPOINT /account/ ACCOUNT-KEY /requester_profile/ REQUESTER-PROFILE-KEY /bank_slip_ownership_exchange_batch/ BANK-SLIP-OWNERSHIP-EXCHANGE-BATCH-KEY /append
METHOD PATCH

### Path parameters

| Field                                    | Type   | Description                                                                                                              | Characters |
|------------------------------------------|--------|------------------------------------------------------------------------------------------------------------------------|------------|
| `ACCOUNT-KEY`                            | uuidv4 | Unique identification key for the source account where the bank slips were originally registered.                      | 36         |
| `REQUESTER-PROFILE-KEY`                  | uuidv4 | Unique identification key for the source billing portfolio where the bank slips were originally registered. | 36         |
| `BANK-SLIP-OWNERSHIP-EXCHANGE-BATCH-KEY` | uuidv4 |Unique identification key for the ownership exchange batch.| 36         |

Request Body

```json
{
	"bank_slips": [
		"b21c5b5a-a71f-4672-9254-022401cd15f6",
		"8197e3d0-1500-439f-9f9d-d243115542fa",
		"8293b817-bed9-418a-8c1e-ec8ef5a31468"
	]
}
```

:::caution Warning!
The list of bank slips provided in the `bank_slips` object in the payload has a limitation of 10,000 bank slips per request. 
:::

## Response

STATUS 200

Response Body

```json
{
    "bank_slip_ownership_exchange_batch_key": "243c9369-ce8b-49df-969c-d891c2fc8c21",
    "request_control_key": "66c9399a-1463-4e2b-acc0-7ee447f81bf0",
    "bank_slip_ownership_exchange_batch_status": "open",
    "new_requester_profile_key": "e494067f-5bd4-4819-b64f-0687bd217f45",
    "new_requester_profile_code": "329-09-0001-8703524",
    "new_requester_profile_owner_name": "Fulano de Tal",
    "new_requester_profile_owner_document_number": "70896538000101",
    "new_requester_profile_account_number": "8703524",
    "new_requester_profile_account_digit": "1",
    "new_requester_profile_account_branch": "0001",
    "new_pix_key": "2376da91-86ad-4a0b-a466-f0f5acf53e24",
    "total_bank_slip_count": 3,
    "total_amount": 750.00
}
```

## Response Params
| Field | Type | Description | Characters                                                                                                          |
|---|------|-----------|---------------------------------------------------------------------------------------------------------------------|
| `bank_slip_ownership_exchange_batch_key`      | uuidv4 | Unique identification key for the ownership exchange batch.                                                                                                                                                                                                                        | 36                                                                                                                  |
| `request_control_key`                         | uuidv4 | Unique identification key for the request to this endpoint. Used to avoid duplication in API calls.                                                                                                                                                            | 36                                                                                                                  |
| `bank_slip_ownership_exchange_batch_status`   | enum  | Status of the ownership exchange batch.                                                                                                                                                                                                                                               | [Enumerators `bank_slip_ownership_exchange_batch_status`](#enumerators-bank_slip_ownership_exchange_batch_status) |
| `new_requester_profile_key`                   | uuidv4 | Unique identification key for the destination billing portfolio. This is the billing portfolio where the bank slips will be transferred. You can obtain this key through the [endpoint for querying billing portfolios of an account](../boletos/carteira/listar_carteiras) | 36                                                                                                                  |
| `new_requester_profile_code`                  | string | Code for the destination billing portfolio. This is the billing portfolio where the bank slips will be transferred.                                                                                                                                                                    | 19                                                                                                                  |
| `new_requester_profile_owner_name`            | string | Name of the destination account holder and beneficiary of the destination billing portfolio.                                                                                                                                                                                   | 255                                                                                                                 |
| `new_requester_profile_owner_document_number` | string | Document number (CPF/CNPJ) of the destination account holder and beneficiary of the destination billing portfolio.                                                                                                                                                         | 255                                                                                                                 |
| `new_requester_profile_account_number`        | string | Destination account number for the ownership exchange.                                                                                                                                                                                                                                   | 7                                                                                                                   |
| `new_requester_profile_account_digit`         | string | Check digit for the destination account of the ownership exchange.                                                                                                                                                                                                                       | 1                                                                                                                   |
| `new_requester_profile_account_branch`        | string | Branch number for the destination account of the ownership exchange.                                                                                                                                                                                                                        | 4                                                                                                                   |
| `new_pix_key`                                 | string | PIX key for the destination account of the ownership exchange (for PIX bank slip cases).                                                                                                                                                                                                     | 255                                                                                                                 |
| `total_bank_slip_count`                       | float | Total number of bank slips in the ownership exchange batch.                                                                                                                                                                                                                                     | -                                                                                                                   |
| `total_amount`                                | float | Sum of the face value of the bank slips in the ownership exchange batch. | -                                                                                                                   |                                                                                                                                                                                                               

### Enumerators bank_slip_ownership_exchange_batch_status
| Enumerator | Description                                                                                              |
|------------|--------------------------------------------------------------------------------------------------------|
| open       | The batch was created and is still open for inclusion/exclusion of bank slips.                               |
| sent     | The bank slip selection was completed and the ownership exchange batch is pending approval. The approving party needs to perform the approval                  |
| processing | The bank slip selection was completed and the ownership exchange of the bank slips contained in the batch is being processed. |
| approved | The bank slips contained in the batch have already been transferred to the recipient |
| cancelled   | Ownership exchange batch cancelled. |
| rejected | Ownership exchange batch rejected. |

---

# Introduction

URL: /en/documentation/troca_de_titularidade/introducao

The transfer of ownership of bank slips **(tombamento)** consists of the process of changing the collection portfolio and settlement account associated with already registered bank slips.

In an ownership transfer, there will always be **an origin account and collection portfolio and a destination account and collection portfolio.**

- The **origin account and portfolio** are those where the bank slips were originally registered.

- The **destination account and portfolio** are those to which the bank slips will be transferred (tombado).

**What is changed?**
- Collection portfolio
- Settlement account

**What is NOT changed?**
- Billing beneficiary data
- Payment slip number for payment
- Pix QR Code for payment (in BolePix cases)

## Use Cases

### Collateral composition
Collection bank slips from a portfolio can be used in composing collateral for a credit operation.
In this scenario, the destination account holder tomba the bank slips from their simple collection portfolio to the collection portfolio linked to the operation's collateral account.

### Assignment of credit rights
In cases where the collection bank slip is linked to an anticipated credit right, it is possible — after completing the anticipation — to tombar the bank slips to the portfolio of the new creditor of the anticipated right.

:::caution Attention!
The bank slip ownership transfer API **does not formalize** the fiduciary assignment or the anticipation of credit rights.
It only reflects what should happen with the financial flow of the asset linked to the tombado collection bank slip.
:::

## Process Flow
Bank slip tombamento is the process of transferring ownership of registered bank slips from one portfolio to another.
This flow consists of four main stages, which must be executed in sequence through API calls.

Below, we describe how each of them works.

**1. Batch opening**

The first step consists of creating a tombamento batch, which will group all bank slips to be transferred.
As soon as the batch is created, it is returned with the initial status `opened`.
At this stage, the origin account keys, destination portfolio, and the new associated Pix key must be informed.

**2. Including bank slips in the batch**

With the batch open, it is possible to add the bank slips that will be included in the ownership transfer.
During this stage, the batch status remains `opened`, indicating that it is still in preparation and can receive new bank slips.

**3. Sending the bank slips**

After including all desired bank slips, it is necessary to send the batch for processing.
At the moment the sending is performed, the batch status is updated to `sent`, and a webhook is triggered to inform the status change.
This sending marks the beginning of the tombamento operational flow.

**4. Tombamento approval**

Finally, batch approval must be performed by the destination account, confirming the ownership transfer of the bank slips.
After approval, the batch status changes to `processing`, indicating that the tombamento is in progress.
When the process is completed successfully, the system sends a final webhook with status `approved`, confirming that the ownership transfer has been finalized.

We share below the link that presents an organizational chart of the complete flow, including the associated endpoints and respective status changes at each stage of the process:

---

# List bank slips from an ownership exchange batch

URL: /en/documentation/troca_de_titularidade/listar_boletos_lote

Use this endpoint to list all bank slips included in the queried ownership exchange batch.

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip_ownership_exchange_batch/ BANK_SLIP_OWNERSHIP_EXCHANGE_BATCH_KEY /bank_slips
METHOD GET

### Path parameters

| Field         | Type   | Description                                                                                                              | Characters |
|---------------|--------|--------------------------------------------------------------------------------------------------------------------------|------------|
| `account_key` | uuidv4 | Unique identification key of the source account, where the bank slips were originally registered.                      | 36         |
| `requester_profile_key` | uuidv4 | Unique identification key of the source billing portfolio, where the bank slips were originally registered. | 36         |
| `bank_slip_ownership_exchange_batch_key` | uuidv4 |Unique identification key of the ownership exchange batch.| 36         |

### Query parameters

| Field                | Description                                  |
|----------------------|--------------------------------------------|
| `page_number`        | Current page being queried     |
| `page_size`          | Number of results per page        |

## Response

STATUS 200

Response Body

```json
{
    "data": [
        {
            "bank_slip_key": "b58ce415-5428-45c4-8e33-b2df0d3ab6e8",
            "request_control_key": "53529224-330d-44b5-9f4d-59d55bc3cb8c",
            "our_number": 24384760943,
            "document_number": "DOC4561237",
            "amount": "8000.00",
            "rebate_amount": "200.00",
            "expiration": "2024-07-13",
            "barcode": "32994978900005000000001594438621284040114400",
            "digitable_line": "32990001529443862128940401144007497890000500000",
            "bank_teller_instructions": "Confirm payment",
            "protest_data": {
                "days_to_protest": 7
            },
            "bankruptcy_protest_data": {
                "days_to_bankruptcy_protest": 14
            },
            "max_payment_days": 45,
            "fine_data": {
                "fine_type": "absolute",
                "fine_amount": 100,
                "days_to_fine": 10
            },
            "interest_data": {
                "interest_type": "workdays_daily_amount",
                "interest_amount": 5,
                "days_to_interest": 10
            },
            "discounts_data": [
                {
                    "discount_type": "anticipation_workdays_daily_percentage",
                    "discount_number": 1,
                    "discount_limit_date": "2024-07-13",
                    "discount_percentage": 10
                }
            ],
            "payer_data": {
                "name": "Country Tech",
                "address": {
                    "city": "Innovation City",
                    "state": "RS",
                    "number": "202",
                    "street": "101 High St.",
                    "complement": "Building A",
                    "postal_code": "57099999",
                    "neighborhood": "Tech Park"
                },
                "person_type": "legal",
                "document_number": "12345678000195"
            },
            "guarantor_data": {
                "name": "Jamie Doe",
                "address": {
                    "city": "Peaceful Town",
                    "state": "MG",
                    "number": "303",
                    "street": "202 Elm St.",
                    "complement": "House 1",
                    "postal_code": "57099999",
                    "neighborhood": "Quiet Neighborhood"
                },
                "person_type": "natural",
                "document_number": "98765432100"
            },
            "bank_slip_status": "accepted"
        }
    ],
    "pagination": {
        "current_page": 1,
        "rows_per_page": 100
    }
}
```

## Response Params

[Bank slip listing object](../boletos/consulta/listar_boletos#response-body-params)

---

# List bank slip ownership exchange batches - destination

URL: /en/documentation/troca_de_titularidade/listar_lotes_destino

Use this endpoint to list bank slip ownership exchange batches from the destination account — that is, the account to which the bank slips were transferred.

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip_ownership_exchange_batches/incoming
METHOD GET

### Path parameters

| Field         | Type   | Description                                                                                             | Characters |
|---------------|--------|---------------------------------------------------------------------------------------------------------|------------|
| `account_key` | uuidv4 | Unique identification key of the destination account, to which the bank slips will be transferred.                | 36         |
| `requester_profile_key` | uuidv4 | Unique identification key of the destination collection portfolio, to which the bank slips will be transferred. | 36         |

### Query parameters

| Field                | Description                                  |
|----------------------|--------------------------------------------|
| `page_number`        | Current page being queried     |
| `page_size`          | Number of results per page        |

## Response

STATUS 200

Response Body

```json
{
	"data": [
        {
            "bank_slip_exchange_batch_key": "186e73f1-456f-4265-8cb0-b32722041580",
            "request_control_key": "fa7fa38c-0356-4345-98ef-21a089d9a39a",
            "bank_slip_ownership_exchange_batch_status": "processing",
            "old_requester_profile_key": "01a30518-0b2e-4dd1-a105-8f8bf31868a2",
            "old_requester_profile_code": "329-09-0001-5963550",
            "old_requester_profile_owner_document_number": "02602536000102",
            "old_requester_profile_owner_name": "Coca Cola",
            "old_requester_profile_account_number": "5963550",
            "old_requester_profile_account_digit": "7",
            "old_requester_profile_account_branch": "0001",
            "old_pix_key": "2376da91-86ad-4a0b-a466-f0f5acf53e24",
            "total_bank_slip_count": 200,
            "total_amount": 38145.58
        },
        {
            "bank_slip_exchange_batch_key": "8a5bbded-72ff-4642-8830-f2a5a73eb62c",
            "request_control_key": "d3725802-7e56-4196-8182-2747ea18e96a",
            "bank_slip_ownership_exchange_batch_status": "open",
            "old_requester_profile_key": "316052e8-a017-4fb9-9939-9ce0390fa053",
            "old_requester_profile_code": "329-09-0001-4743630",
            "old_requester_profile_owner_document_number": "40500359000142",
            "old_requester_profile_owner_name": "QI SCD",
            "old_requester_profile_account_number": "4743630",
            "old_requester_profile_account_digit": "1",
            "old_requester_profile_account_branch": "0001",
            "old_pix_key": "2376da91-86ad-4a0b-a466-f0f5acf53e24",
            "total_bank_slip_count": 450,
            "total_amount": 548682.19
        },
        {
            "bank_slip_exchange_batch_key": "6f749806-8768-44ab-b7de-1f0d94d0a61a",
            "request_control_key": "1c1551f2-c6e7-42d5-b78d-1f7662128a33",
            "bank_slip_ownership_exchange_batch_status": "closed",
            "old_requester_profile_key": "8bfdd50f-97fd-4f29-bc53-b542a914f2d6",
            "old_requester_profile_code": "329-09-0001-7390371",
            "old_requester_profile_owner_document_number": "56000040000198",
            "old_requester_profile_name": "Meta",
            "old_requester_profile_account_number": "7390371",
            "old_requester_profile_account_digit": "7",
            "old_requester_profile_account_branch": "0001",
            "old_pix_key": "2376da91-86ad-4a0b-a466-f0f5acf53e24",
            "total_bank_slip_count": 40,
            "total_amount": 67245.96
        }
	],
	"pagination": {
		"current_page": 1,
		"rows_per_page": 100
	}
}
```

## Response Params
| Field                                         | Type  | Description                                                                                                                                                                                                                                          | Characters                                                                                                          |
|-----------------------------------------------|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| `bank_slip_ownership_exchange_batch_key`      | uuidv4 | Unique identification key of the ownership exchange batch.                                                                                                                                                                                               | 36                                                                                                                  |
| `request_control_key`                         | uuidv4 | Unique identification key of the request to this endpoint. Used to prevent duplicate API calls.                                                                                                                                   | 36                                                                                                                  |
| `bank_slip_ownership_exchange_batch_status`   | enum  | Status of the ownership exchange batch.                                                                                                                                                                                                                      | [Enumerators `bank_slip_ownership_exchange_batch_status`](#enumerators-bank_slip_ownership_exchange_batch_status) |
| `old_requester_profile_key`                   | uuidv4 | Unique identification key of the destination collection portfolio, to which the bank slips will be transferred. You can obtain this key through the [endpoint to query collection portfolios of an account](../boletos/carteira/listar_carteiras) | 36                                                                                                                  |
| `old_requester_profile_code`                  | string | Code of the destination collection portfolio, to which the bank slips will be transferred.                                                                                                                                                                    | 19                                                                                                                  |
| `old_requester_profile_owner_name`            | string | Name of the destination account holder and beneficiary of the destination collection portfolio.                                                                                                                                                          | 255                                                                                                                 |
| `old_requester_profile_owner_document_number` | string | Document number (CPF/CNPJ) of the destination account holder and beneficiary of the destination collection portfolio.                                                                                                                                | 255                                                                                                                 |
| `old_requester_profile_account_number`        | string | Account number of the ownership transfer destination.                                                                                                                                                                                                          | 7                                                                                                                   |
| `old_requester_profile_account_digit`         | string | Check digit of the ownership transfer destination account.                                                                                                                                                                                              | 1                                                                                                                   |
| `old_requester_profile_account_branch`        | string | Branch number of the ownership transfer destination account.                                                                                                                                                                                               | 4                                                                                                                   |
| `old_pix_key`                                 | string | PIX key of the ownership transfer destination account (for bolepix cases).                                                                                                                                                                            | 255                                                                                                                 |
| `total_bank_slip_count`                       | float | Total number of bank slips in the ownership exchange batch.                                                                                                                                                                                                            | -                                                                                                                   |
| `total_amount`                                 | float | Sum of the face value of bank slips in the ownership exchange batch.                                                                                                                                                                                      | -                                                                                                                   |                                                                                                                                                                                                               

### Enumerators bank_slip_ownership_exchange_batch_status
| Enumerator | Description                                                                                              |
|------------|--------------------------------------------------------------------------------------------------------|
| open       | The batch was created and is still open for inclusion/exclusion of bank slips.                               |
| sent     | Bank slip selection has been completed and the ownership exchange batch is pending approval. The approving party needs to perform the approval.                  |
| processing | Bank slip selection has been completed and the ownership transfer of bank slips contained in the batch is being processed. |
| approved | The bank slips contained in the batch have already been transferred to the recipient. |
| cancelled   | Ownership exchange batch cancelled. |
| rejected | Ownership exchange batch rejected. |

---

# List bank slip ownership exchange batches - source

URL: /en/documentation/troca_de_titularidade/listar_lotes_origem

Use this endpoint to list bank slip ownership exchange batches from the source account, i.e., the account where the bank slips were originally registered.

## Request

ENDPOINT /account/ ACCOUNT_KEY /requester_profile/ REQUESTER_PROFILE_KEY /bank_slip_ownership_exchange_batches/outgoing
MÉTODO GET

### Path parameters

| Field         | Type   | Description                                                                                                              | Characters |
|---------------|--------|------------------------------------------------------------------------------------------------------------------------|------------|
| `ACCOUNT-KEY` | uuidv4 | Unique identification key of the source account where the bank slips were originally registered.                      | 36         |
| `REQUESTER-PROFILE-KEY` | uuidv4 | Unique identification key of the source collection wallet where the bank slips were originally registered. | 36         |

### Query parameters

| Field                | Description                                  |
|----------------------|--------------------------------------------|
| `page_number`        | Current page being queried     |
| `page_size`          | Number of results per page        |

## Response

STATUS 200

Response Body

```json
{
	"data": [
        {
            "bank_slip_exchange_batch_key": "186e73f1-456f-4265-8cb0-b32722041580",
            "request_control_key": "fa7fa38c-0356-4345-98ef-21a089d9a39a",
            "bank_slip_ownership_exchange_batch_status": "processing",
            "new_requester_profile_key": "01a30518-0b2e-4dd1-a105-8f8bf31868a2",
            "new_requester_profile_code": "329-09-0001-5963550",
            "new_requester_profile_owner_document_number": "02602536000102",
            "new_requester_profile_owner_name": "Coca Cola",
            "new_requester_profile_account_number": "5963550",
            "new_requester_profile_account_digit": "7",
            "new_requester_profile_account_branch": "0001",
            "new_pix_key": "2376da91-86ad-4a0b-a466-f0f5acf53e24",
            "total_bank_slip_count": 200,
            "total_amount": 38145.58
        },
        {
            "bank_slip_exchange_batch_key": "8a5bbded-72ff-4642-8830-f2a5a73eb62c",
            "request_control_key": "d3725802-7e56-4196-8182-2747ea18e96a",
            "bank_slip_ownership_exchange_batch_status": "open",
            "new_requester_profile_key": "316052e8-a017-4fb9-9939-9ce0390fa053",
            "new_requester_profile_code": "329-09-0001-4743630",
            "new_requester_profile_owner_document_number": "40500359000142",
            "new_requester_profile_owner_name": "QI SCD",
            "new_requester_profile_account_number": "4743630",
            "new_requester_profile_account_digit": "1",
            "new_requester_profile_account_branch": "0001",
            "new_pix_key": "2376da91-86ad-4a0b-a466-f0f5acf53e24",
            "total_bank_slip_count": 450,
            "total_amount": 548682.19
        },
        {
            "bank_slip_exchange_batch_key": "6f749806-8768-44ab-b7de-1f0d94d0a61a",
            "request_control_key": "1c1551f2-c6e7-42d5-b78d-1f7662128a33",
            "bank_slip_ownership_exchange_batch_status": "closed",
            "new_requester_profile_key": "8bfdd50f-97fd-4f29-bc53-b542a914f2d6",
            "new_requester_profile_code": "329-09-0001-7390371",
            "new_requester_profile_owner_document_number": "56000040000198",
            "new_requester_profile_name": "Meta",
            "new_requester_profile_account_number": "7390371",
            "new_requester_profile_account_digit": "7",
            "new_requester_profile_account_branch": "0001",
            "new_pix_key": "2376da91-86ad-4a0b-a466-f0f5acf53e24",
            "total_bank_slip_count": 40,
            "total_amount": 67245.96
        }
	],
	"pagination": {
		"current_page": 1,
		"rows_per_page": 100
	}
}
```

## Response Params
| Field                                         | Type  | Description                                                                                                                                                                                                                                                                   | Characters                                                                                                          |
|-----------------------------------------------|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| `bank_slip_ownership_exchange_batch_key`      | uuidv4 | Unique identification key of the ownership exchange batch.                                                                                                                                                                                                                        | 36                                                                                                                  |
| `request_control_key`                         | uuidv4 | Unique identification key of the request to this endpoint. Used to avoid duplication in API calls.                                                                                                                                                            | 36                                                                                                                  |
| `bank_slip_ownership_exchange_batch_status`   | enum  | Status of the ownership exchange batch.                                                                                                                                                                                                                                               | [Enumerators `bank_slip_ownership_exchange_batch_status`](#enumeradores-bank_slip_ownership_exchange_batch_status) |
| `new_requester_profile_key`                   | uuidv4 | Unique identification key of the destination collection wallet. This is the collection wallet where the bank slips will be transferred to. You can get this key through the [endpoint for querying collection wallets of an account](../boletos/carteira/listar_carteiras) | 36                                                                                                                  |
| `new_requester_profile_code`                  | string | Code of the destination collection wallet. This is the collection wallet where the bank slips will be transferred to.                                                                                                                                                                    | 19                                                                                                                  |
| `new_requester_profile_owner_name`            | string | Name of the destination account holder and beneficiary of the destination collection wallet.                                                                                                                                                                                   | 255                                                                                                                 |
| `new_requester_profile_owner_document_number` | string | Document number (CPF/CNPJ) of the destination account holder and beneficiary of the destination collection wallet.                                                                                                                                                         | 255                                                                                                                 |
| `new_requester_profile_account_number`        | string | Account number of the ownership exchange destination.                                                                                                                                                                                                                                   | 7                                                                                                                   |
| `new_requester_profile_account_digit`         | string | Check digit of the ownership exchange destination account.                                                                                                                                                                                                                       | 1                                                                                                                   |
| `new_requester_profile_account_branch`        | string | Branch number of the ownership exchange destination account.                                                                                                                                                                                                                        | 4                                                                                                                   |
| `new_pix_key`                                 | string | PIX key of the ownership exchange destination account (for bolepix cases).                                                                                                                                                                                                     | 255                                                                                                                 |
| `total_bank_slip_count`                       | float | Total number of bank slips in the ownership exchange batch.                                                                                                                                                                                                                                     | -                                                                                                                   |
| `total_amount`                                 | float | Sum of the face value of bank slips in the ownership exchange batch.                                                                                                                                                                                                               | -                                                                                                                   |                                                                                                                                                                                                               

### Enumerators bank_slip_ownership_exchange_batch_status
| Enumerator | Description                                                                                              |
|------------|--------------------------------------------------------------------------------------------------------|
| open       | The batch has been created and is still open for inclusion/exclusion of bank slips.                               |
| sent     | The selection of bank slips has been completed and the ownership exchange batch is pending approval. The approving party needs to perform the approval.                  |
| processing | The selection of bank slips has been completed and the ownership exchange of bank slips contained in the batch is being processed. |
| approved | The bank slips contained in the batch have already been transferred to the recipient. |
| cancelled   | Ownership exchange batch cancelled. |
| rejected | Ownership exchange batch rejected. |

---

# Bank Slip Transfer Webhooks

URL: /en/documentation/troca_de_titularidade/notificacoes_webhooks

In the transfer flow, webhooks are triggered at two moments: after sending the batch for processing and after the batch approval by the destination account.

These notifications allow tracking the transfer progress, ensuring that the partner is informed when the batch is sent for processing and when the transfer is completed.

## Transfer process status

### Sent

WEBHOOK_TYPE baas.bank_slip.bank_slip_ownership_exchange_batch
STATUS sent

Webhook Body

```json
{
  "data": {
    "bank_slip_ownership_exchange_batch_key": "3e8d08df-3585-476f-b464-0897ecf7467d",
    "bank_slip_ownership_exchange_batch_status": "sent"
  },
  "webhook_type": "baas.bank_slip.bank_slip_ownership_exchange_batch",
  "webhook_datetime": "2025-10-21T19:45:47.588Z"
}
```

### Approved

WEBHOOK_TYPE baas.bank_slip.bank_slip_ownership_exchange_batch
STATUS approved

Webhook Body

```json
{
  "data": {
    "bank_slip_ownership_exchange_batch_key": "3e8d08df-3585-476f-b464-0897ecf7467d",
    "bank_slip_ownership_exchange_batch_status": "approved"
  },
  "webhook_type": "baas.bank_slip.bank_slip_ownership_exchange_batch",
  "webhook_datetime": "2025-10-21T19:46:34.467Z"
}
```

---

# Remove boletos from an ownership exchange batch

URL: /en/documentation/troca_de_titularidade/remover_boletos

This endpoint is used to remove boletos from a boleto ownership exchange batch with status `open`.

## Request

ENDPOINT /account/ ACCOUNT-KEY /requester_profile/ REQUESTER-PROFILE-KEY /bank_slip_ownership_exchange_batch/ BANK-SLIP-OWNERSHIP-EXCHANGE-BATCH-KEY /remove
METHOD PATCH

### Path parameters

| Field                                    | Type   | Description                                                                                                              | Characters |
|------------------------------------------|--------|------------------------------------------------------------------------------------------------------------------------|------------|
| `ACCOUNT-KEY`                            | uuidv4 | Unique identification key of the origin account, where the boletos were originally registered.                      | 36         |
| `REQUESTER-PROFILE-KEY`                  | uuidv4 | Unique identification key of the origin billing profile, where the boletos were originally registered. | 36         |
| `BANK-SLIP-OWNERSHIP-EXCHANGE-BATCH-KEY` | uuidv4 |Unique identification key of the ownership exchange batch.| 36         |

Request Body

```json
{
	"bank_slips": [
		"b21c5b5a-a71f-4672-9254-022401cd15f6",
		"8197e3d0-1500-439f-9f9d-d243115542fa",
		"8293b817-bed9-418a-8c1e-ec8ef5a31468"
	]
}
```

:::caution Attention!
The list of boletos informed in the `bank_slips` object in the payload has a limitation of 10,000 boletos per request. 
:::

## Response

STATUS 200

Response Body

```json
{
    "bank_slip_ownership_exchange_batch_key": "243c9369-ce8b-49df-969c-d891c2fc8c21",
    "request_control_key": "66c9399a-1463-4e2b-acc0-7ee447f81bf0",
    "bank_slip_ownership_exchange_batch_status": "open",
    "new_requester_profile_key": "e494067f-5bd4-4819-b64f-0687bd217f45",
    "new_requester_profile_code": "329-09-0001-8703524",
    "new_requester_profile_owner_name": "Fulano de Tal",
    "new_requester_profile_owner_document_number": "70896538000101",
    "new_requester_profile_account_number": "8703524",
    "new_requester_profile_account_digit": "1",
    "new_requester_profile_account_branch": "0001",
    "new_pix_key": "2376da91-86ad-4a0b-a466-f0f5acf53e24",
    "total_bank_slip_count": 0,
    "total_amount": 0
}
```

## Response Params
| Field | Type | Description | Characters                                                                                                          |
|---|------|-----------|---------------------------------------------------------------------------------------------------------------------|
| `bank_slip_ownership_exchange_batch_key`      | uuidv4 | Unique identification key of the ownership exchange batch.                                                                                                                                                                                                                        | 36                                                                                                                  |
| `request_control_key`                         | uuidv4 | Unique identification key of the request to this endpoint. Used to prevent duplication in API calls.                                                                                                                                                            | 36                                                                                                                  |
| `bank_slip_ownership_exchange_batch_status`   | enum  | Status of the ownership exchange batch.                                                                                                                                                                                                                                               | [Enumerators `bank_slip_ownership_exchange_batch_status`](#enumerators-bank_slip_ownership_exchange_batch_status) |
| `new_requester_profile_key`                   | uuidv4 | Unique identification key of the destination billing profile. It is the billing profile to which the boletos will be transferred. You can obtain this key through the [endpoint for querying billing profiles of an account](../boletos/carteira/listar_carteiras) | 36                                                                                                                  |
| `new_requester_profile_code`                  | string | Code of the destination billing profile. It is the billing profile to which the boletos will be transferred.                                                                                                                                                                    | 19                                                                                                                  |
| `new_requester_profile_owner_name`            | string | Name of the destination account holder and beneficiary of the destination billing profile.                                                                                                                                                                                   | 255                                                                                                                 |
| `new_requester_profile_owner_document_number` | string | Document number (CPF/CNPJ) of the destination account holder and beneficiary of the destination billing profile.                                                                                                                                                         | 255                                                                                                                 |
| `new_requester_profile_account_number`        | string | Destination account number for the ownership exchange.                                                                                                                                                                                                                                   | 7                                                                                                                   |
| `new_requester_profile_account_digit`         | string | Check digit of the destination account for the ownership exchange.                                                                                                                                                                                                                       | 1                                                                                                                   |
| `new_requester_profile_account_branch`        | string | Branch number of the destination account for the ownership exchange.                                                                                                                                                                                                                        | 4                                                                                                                   |
| `new_pix_key`                                 | string | PIX key of the destination account for the ownership exchange (for bolepix cases).                                                                                                                                                                                                     | 255                                                                                                                 |
| `total_bank_slip_count`                       | float | Total number of boletos in the ownership exchange batch.                                                                                                                                                                                                                                     | -                                                                                                                   |
| `total_amount`                                | float | Sum of the face value of boletos in the ownership exchange batch. | -                                                                                                                   |                                                                                                                                                                                                               

### Enumerators bank_slip_ownership_exchange_batch_status
| Enumerator | Description                                                                                              |
|------------|--------------------------------------------------------------------------------------------------------|
| open       | The batch was created and is still open for inclusion/exclusion of boletos.                               |
| sent     | The boleto selection has been completed and the ownership exchange batch is pending approval. The approving party needs to perform the approval                  |
| processing | The boleto selection has been completed and the ownership exchange of boletos contained in the batch is being processed. |
| approved | The boletos contained in the batch have already been transferred to the recipient |
| cancelled   | Ownership exchange batch cancelled. |
| rejected | Ownership exchange batch rejected. |

---

# Send bank slip ownership exchange batch

URL: /en/documentation/troca_de_titularidade/validar_lote_e_enviar

This endpoint is used to close the batch and start processing the ownership transfer. When making the request, the batch will be validated and the status changed to sent, where both parties involved will receive a webhook related to the ownership exchange.

:::danger Attention!
This endpoint should only be triggered when the insertion of bank slips is completed and the proper formalizations between the origin and destination counterparts of the ownership exchange are concluded.
:::

## Request

ENDPOINT /account/ ACCOUNT-KEY /requester_profile/ REQUESTER-PROFILE-KEY /bank_slip_ownership_exchange_batch/ BANK-SLIP-OWNERSHIP-EXCHANGE-BATCH-KEY /send
METHOD PATCH

### Path parameters

| Field                                    | Type   | Description                                                                                                        | Characters |
|------------------------------------------|--------|------------------------------------------------------------------------------------------------------------------|------------|
| `ACCOUNT-KEY`                            | uuidv4 | Unique identification key of the origin account, where the bank slips were originally registered.                | 36         |
| `REQUESTER-PROFILE-KEY`                  | uuidv4 | Unique identification key of the origin billing portfolio, where the bank slips were originally registered. | 36         |
| `BANK-SLIP-OWNERSHIP-EXCHANGE-BATCH-KEY` | uuidv4 | Unique identification key of the ownership exchange batch.                                                             | 36         |

Request Body

```json
{}
```

## Response

STATUS 200

Response Body

```json
{
    "bank_slip_ownership_exchange_batch_key": "243c9369-ce8b-49df-969c-d891c2fc8c21",
    "request_control_key": "66c9399a-1463-4e2b-acc0-7ee447f81bf0",
    "bank_slip_ownership_exchange_batch_status": "processing",
    "new_requester_profile_key": "e494067f-5bd4-4819-b64f-0687bd217f45",
    "new_requester_profile_code": "329-09-0001-8703524",
    "new_requester_profile_owner_name": "Fulano de Tal",
    "new_requester_profile_owner_document_number": "70896538000101",
    "new_requester_profile_account_number": "8703524",
    "new_requester_profile_account_digit": "1",
    "new_requester_profile_account_branch": "0001",
    "new_pix_key": "2376da91-86ad-4a0b-a466-f0f5acf53e24",
    "total_bank_slip_count": 3,
    "total_amount": 750.00
}
```

## Response Params
| Field | Type | Description | Characters                                                                                                          |
|---|------|-----------|---------------------------------------------------------------------------------------------------------------------|
| `bank_slip_ownership_exchange_batch_key`      | uuidv4 | Unique identification key of the ownership exchange batch.                                                                                                                                                                                                                        | 36                                                                                                                  |
| `request_control_key`                         | uuidv4 | Unique identification key of the request in this endpoint. Used to avoid duplicity in API calls.                                                                                                                                                            | 36                                                                                                                  |
| `bank_slip_ownership_exchange_batch_status`   | enum  | Status of the ownership exchange batch.                                                                                                                                                                                                                                               | [Enumerators `bank_slip_ownership_exchange_batch_status`](#enumerators-bank_slip_ownership_exchange_batch_status) |
| `new_requester_profile_key`                   | uuidv4 | Unique identification key of the destination billing portfolio. This is the billing portfolio where the bank slips will be transferred to. You can obtain this key through the [billing portfolio query endpoint for an account](../boletos/carteira/listar_carteiras) | 36                                                                                                                  |
| `new_requester_profile_code`                  | string | Code of the destination billing portfolio. This is the billing portfolio where the bank slips will be transferred to.                                                                                                                                                                    | 19                                                                                                                  |
| `new_requester_profile_owner_name`            | string | Name of the destination account holder and beneficiary of the destination billing portfolio.                                                                                                                                                                                   | 255                                                                                                                 |
| `new_requester_profile_owner_document_number` | string | Document number (CPF/CNPJ) of the destination account holder and beneficiary of the destination billing portfolio.                                                                                                                                                         | 255                                                                                                                 |
| `new_requester_profile_account_number`        | string | Destination account number for the ownership exchange.                                                                                                                                                                                                                                   | 7                                                                                                                   |
| `new_requester_profile_account_digit`         | string | Check digit of the destination account for the ownership exchange.                                                                                                                                                                                                                       | 1                                                                                                                   |
| `new_requester_profile_account_branch`        | string | Branch number of the destination account for the ownership exchange.                                                                                                                                                                                                                        | 4                                                                                                                   |
| `new_pix_key`                                 | string | PIX key of the destination account for the ownership exchange (for bolepix cases).                                                                                                                                                                                                     | 255                                                                                                                 |
| `total_bank_slip_count`                       | float | Total number of bank slips in the ownership exchange batch.                                                                                                                                                                                                                                     | -                                                                                                                   |
| `total_amount`                                | float | Sum of the face value of the bank slips in the ownership exchange batch. | -                                                                                                                   |                                                                                                                                                                                                               

### Enumerators bank_slip_ownership_exchange_batch_status
| Enumerator | Description                                                                                              |
|------------|--------------------------------------------------------------------------------------------------------|
| open       | The batch was created and is still open for inclusion/exclusion of bank slips.                               |
| closed     | The batch is closed and the ownership exchange of the bank slips contained in the batch has been completed.                  |
| processing | The selection of bank slips has been completed and the ownership exchange of the bank slips contained in the batch is being processed. |
| pending_approval | The selection of bank slips has been completed and the ownership exchange batch is pending approval. The approving party can remove bank slips from the batch. |
| canceled   | Ownership exchange batch canceled. |
| rejected | Ownership exchange batch rejected. |

---

# Document inquiry

URL: /en/documentation/upload_de_documentos/consulta_documents

To query a document uploaded to QI Tech, you can make a request with the previously obtained DOCUMENT_KEY.

### Request

ENDPOINT /document/[document_key]/url
METHOD GET

### Path Params

| Field          | Description                            |
|--------------- |----------------------------------------|
| `document_key` | Unique document key                    |

:::caution Attention
The document URL will be generated with a 10-minute expiration period.
:::

### Response

STATUS 200

Response Body

```json
{
	"document_url": "url_expirável",
	"signed_document_url": "url_expirável",
	"expiration_datetime": "2024-05-01T01:00:00.000Z"
}
```

| Field 				| Type   | Description                                                                                               | 
|-----------------------|--------|---------------------------------------------------------------------------------------------------------|
| `document_url`* 		| string | Expirable document URL
 original.                                                                    |
| `signed_document_url` | string | Expirable URL of the signed document if it exists. If it does not exist, this field will not be returned..|
| `expiration_datetime`*| string | Date and time when the URLs will expire.                                            |

---

# Documents upload

URL: /en/documentation/upload_de_documentos/

---

The call must be authenticated following the pattern described in section [1.1.3. Authentication Test](../primeiros_passos/teste_de_autenticacao). Authentication Test. With the following caveats:

- The value of the md5_hash variable (md5_body for v1 of our authentication) sent in the header signature must be the MD5 of the binary file being sent.
- The binary file must be sent in the request body as FormData using the string "file" as the key and the file to be sent as the value. (This content is not encrypted)
- The response body of this call will return a GUID, which is the document identifier (referred to as DOCUMENT_KEY from now on) and must be stored for future use.

---

## Request

ENDPOINT /upload
METHOD POST

Response Body

```json
{
  "document_key": "cfbc8469-89ea-4a80-9f64-ba7b1566c68b",
  "document_md5": "cd451103fa512frc98ce684d3896698c"
}
```

:::caution Attention
It is crucial to save the **document_key**, obtained from the response. This key is necessary for retrieving or referencing the document in future interactions.
:::

## Call Example

Example 
Call for Uploading an Image from a URL

**Python**

```python

import jwt
import hashlib
import requests
from requests_toolbelt.multipart.encoder import MultipartEncoder
import json
from datetime import datetime

BASE_URL = "https://api-auth.sandbox.qitech.app"
API_KEY = "4c268c0a-53ff-429b-92b6-47ef98a6d89a" # This key is an example, please use your own
CLIENT_PRIVATE_KEY = ''''
-----BEGIN EC PRIVATE KEY-----
MIHbAgEBBEHh1hIeOPE5XNNhn6bxRAmVswsPZ0wZCmzVvP8Tl/LZK9ofVmRVGzll
srU1uezJEyHKYdOHrE2p52xUj+pHzjJvb6AHBgUrgQQAI6GBiQOBhgAEAAofUz1J
hBSOyGHLsnV9Sz0DSWmhl7U+ljqbfa8PKVFWSV3w16I1v2zME5/UzUhHn1gWsjnv
7/ekcLLAQbvqMPNXAfjIhFXLAPzqbB9iCuVua1v0Vgy52rBemOWrJka/Ws2bnKR8
h1N1OxOYeYr6C2jqMygBLktKMAs+282CEiEb4bIv
-----END EC PRIVATE KEY----- 
''' # This key is an example, please use your own

def get_document(url):
    try:
        response = requests.get(url)
        return response.content
    except Exception as error:
        print("Error fetching document:", error)
        raise

def upload_document(array_buffer):
    endpoint = "/upload"
    method = "POST"
    timestamp = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + "Z"
    md5_hash = hashlib.md5(array_buffer).hexdigest()

    jwt_header = {
        "typ": "JWT",
        "alg": "ES512",
    }

    jwt_body = {
        "payload_md5": md5_hash,
        "timestamp": timestamp,
        "method": method,
        "uri": endpoint,
    }

    encoded_header_token = jwt.encode(jwt_body, CLIENT_PRIVATE_KEY, algorithm="ES512", headers=jwt_header)

    signed_header = {
        "Authorization": encoded_header_token,
        "API-CLIENT-KEY": API_KEY,
        "Content-Type": "multipart/form-data",
    }

    url = f"{BASE_URL}{endpoint}"
    multipart_data = MultipartEncoder(
        fields={'file': ('image.jpeg', array_buffer, 'image/jpeg')}
    )
    signed_header['Content-Type'] = multipart_data.content_type

    try:
        response = requests.post(url, headers=signed_header, data=multipart_data)
        response_data = response.json()
        document_key = response_data.get('document_key')
        print(f'Response data is: {response_data} and document_key is: {document_key}')
        return document_key
    except Exception as error:
        print('Error:', error)
        raise

def main():
    file_url = "{FILE_URL}"

    document_buffer = get_document(file_url)

    document_key = upload_document(document_buffer)

    print("Document key is", document_key)

if __name__ == "__main__":
    main()

```
  

**Node.js**

```js
const jwt = require('jsonwebtoken')
const crypto = require('crypto')
const axios = require('axios')
const FormData = require('form-data')
const fs = require('fs')
const fetch = require('node-fetch')

async function getDocument(url) {
  try {
    const response = await axios.get(url, { responseType: 'arraybuffer' })
    return response.data
  } catch (error) {
    console.error('Error fetching document:', error)
    throw error
  }
}

async function uploadDocument(arrayBuffer) {
  const base_url = "[https://api-auth.sandbox.qitech.app](https://api-auth.sandbox.qitech.app)"
  const endpoint = '/upload'
  const method = 'POST'
  const timestamp = new Date().toISOString()
  const md5_hash = crypto.createHash('md5').update(arrayBuffer).digest('hex')
  const client_private_key = `-----BEGIN EC PRIVATE KEY-----
    MIHbAgEBBEHh1hIeOPE5XNNhn6bxRAmVswsPZ0wZCmzVvP8Tl/LZK9ofVmRVGzll
    srU1uezJEyHKYdOHrE2p52xUj+pHzjJvb6AHBgUrgQQAI6GBiQOBhgAEAAofUz1J
    hBSOyGHLsnV9Sz0DSWmhl7U+ljqbfa8PKVFWSV3w16I1v2zME5/UzUhHn1gWsjnv
    7/ekcLLAQbvqMPNXAfjIhFXLAPzqbB9iCuVua1v0Vgy52rBemOWrJka/Ws2bnKR8
    h1N1OxOYeYr6C2jqMygBLktKMAs+282CEiEb4bIv
    -----END EC PRIVATE KEY-----`; // This key is an example, please use your own
  const api_key = '4c268c0a-53ff-429b-92b6-47ef98a6d89a' // This key is an example, please use your own

  try {
    const jwt_header = {
      typ: 'JWT',
      alg: 'ES512',
    }

    const jwt_body = {
      payload_md5: md5_hash,
      timestamp: timestamp,
      method: method,
      uri: endpoint,
    }

    const encoded_header_token = jwt.sign(jwt_body, client_private_key, {
      algorithm: 'ES512',
      header: jwt_header,
    })

    const signed_header = {
      AUTHORIZATION: encoded_header_token,
      'API-CLIENT-KEY': api_key,
    }

    const url = `${base_url}${endpoint}`
    const formData = new FormData()
    formData.append('file', Buffer.from(arrayBuffer), {
      filename: 'image.jpeg',
    })

    const response = await fetch(url, {
      method: 'POST',
      headers: {
        ...signed_header,
        ...formData.getHeaders(),
      },
      body: formData,
    })

    if (!response.ok) {
      const errorText = await response.text()
      console.log(`Error: ${response.status} ${response.statusText}`, errorText)
      return
    }

    const data = await response.json()
    console.log('Response data is: ', data)
    return data.document_key
    
  } catch (error) {
    console.error('Error:', error)
  }
}

async function main() {
  const fileUrl = '<URL_LINK_TO_DOCUMENT_IMAGE>'
  const documentBuffer = await getDocument(fileUrl)
  const documentKey = await uploadDocument(documentBuffer)

  console.log('Document key is: ' + documentKey)
}

main()
```

- Note: The example above uses the [node-fetch](https://www.npmjs.com/package/node-fetch) library to make the call, but you can use the library of your choice. The important thing is that the call is made with the POST method, with the `Content-Type` header set to `multipart/form-data`, and the body is a FormData with the key `file` and the value as the binary of the file to be sent.

:::warning Warning

The 'Axios' library has a bug that causes the FormData to be sent empty. The issue can be seen in the [GitHub repository](https://github.com/axios/axios/issues/5986). If this problem has not yet been resolved at the time of your integration, we suggest using the 'node-fetch' library to make this call.
:::

---

# acg1

URL: /en/documentation/webhooks/acg1

Após o envio de uma solicitação de consulta o resto do fluxo fica a cargo da QI Tech. Será então enviado um webhook apresentando dois modelos distintos:

- Em caso de consulta encontrada com sucesso, receberá um campo "status" com o valor "completed", neste caso, o objeto "data" trará as demais informações da consulta.

- Em caso de documento não encontrado na base para o período consultado, receberá um campo "status" com o valor "not_found", informando que a consulta não trouxe nenhuma informação.

----

### Exemplo de sucesso

No webhook temos o objeto "data" com os campos:

**"valueless_months"**: Número de meses sem atividade.
**"card_schemes"**: São os arranjos de pagamentos que constituíram o valor total liquidado.
**"value"**: Valor total liquidado em cartões.

Body.json

```json
{
   "status": "completed",
   "webhook_type": "historic_card_settlement",
   "data": {
      "valueless_months": 0,
      "card_schemes": [
         {
            "code": "003",
            "enumerator": "credit_mastercard",
            "description": "Mastercard Crédito"
         }
      ],
      "value": 847.86
   },
   "event_datetime": "2022-05-18T20:57:00",
   "key": "38934f1b-204f-4fc4-844d-5ad562ff36f6"
}

```

### Em caso de consulta não encontrada 

Body.json

```json
{
   "status": "not_found",
   "webhook_type": "historic_card_settlement",
   "event_datetime": "2022-05-18T20:57:00",
   "key": "38934f1b-204f-4fc4-844d-5ad562ff36f6"
}

```

---

# agenda_de_recebiveis

URL: /en/documentation/webhooks/agenda_de_recebiveis

O webhook de consulta é divido em agendas que representam uma credenciadora e um arranjo de pagamento.

Em cada agenda, há uma lista de unidades de recebíveis que são divididas por data de liquidação.

Para cada unidade de recebível, existe uma liste de pagamentos aonde esse recebíveis serão depositados.

Body.json

```json
{
   "webhook_type":"cerc_inquiry",
   "inquiry_request_key":"624ca87e-71ec-4dc7-8bc1-823e61d172cb",
   "reference_code":"888888888889",
   "complete_data_url":"https://storage.googleapis.com/dev-cerc-api/inquiry_data/624ca87e-71ec-4dc7-8bc1-823e61d172cb.json",
   "agendas":[
      {
         "acquirer_document_number":"01425787003383",
         "receivable_units":[
            {
               "total_amount":628895.6,
               "total_constituted_amout":null,
               "settlement_date":"2021-08-06"
            },
            {
               "total_constituted_amout":null,
               "settlement_date":"2021-08-05",
               "total_amount":1167245.78
            },
            {
               "settlement_date":"2021-08-09",
               "total_constituted_amout":null,
               "total_amount":625828.02
            },
            {
               "total_amount":618395.21,
               "total_constituted_amout":null,
               "settlement_date":"2021-07-30"
            },
            {
               "total_constituted_amout":null,
               "settlement_date":"2021-08-04",
               "total_amount":587023.86
            },
            {
               "settlement_date":"2021-08-03",
               "total_constituted_amout":null,
               "total_amount":1091400.94
            },
            {
               "settlement_date":"2021-08-02",
               "total_constituted_amout":null,
               "total_amount":495907.37
            },
            {
               "total_constituted_amout":null,
               "total_amount":533202.88,
               "settlement_date":"2021-08-10"
            }
         ],
         "card_scheme_code":"MCC"
      }
   ]
}

```

---

# Boletos webhook

URL: /en/documentation/webhooks/boletos

:::danger Attention!
QI Tech webhooks should not be strictly mapped.
Additional fields may be included in the webhook payloads returned by our APIs.
:::
## Introduction
After the creation of a boleto within our system, webhooks with the following status will be sent:
| Enumerator | Translation | Description |
|---|---|---|
| registered | registered | boleto registered and available for payment.
| rejected | rejected | boleto issuance request rejected when the boleto registration request contains a semantic error that prevents registration.
| payment_notice | payment notice | boleto payment notice, this notification is sent when the boleto is paid, but financial settlement has not yet occurred.
| notary_office_payment_notice | notary office payment notice | boleto payment notice, this notification is sent when the boleto is paid at a notary office, but financial settlement has not yet occurred.
| paid | paid | boleto paid (settled with financial liquidation).
| written_off | written off | boleto written off without financial settlement.
:::info
The timeout for our webhook response is 10 seconds.
:::

## Examples
----

### Regiser

Webhook Body

```json
{
	"key": "11b13b2c-4204-41b3-8596-2ee7ecbde38c",
	"data": {
		"expiration": "2020-11-14",
		"our_number": 11,
		"bank_slip_key": "11b13b2c-4204-41b3-8596-2ee7ecbde38c",
		"rebate_amount": 0,
		"occurrence_type": "registration",
		"occurrence_feedback": "confirmed",
		"occurrence_sequence": 2,
		"requester_profile_code": "329-01-0001-0078570",
		"glados_occurrence_reasons": null,
		"cnab_file_occurrence_order": 1,
		"registration_institution_occurrence_date": "2020-11-11"
	},
	"status": "registered",
	"webhook_type": "bank_slip.status_change",
	"event_datetime": "2020-11-11 21:33:03"
}
```

### Payment notice

Webhook Body

```json
{
	"key": "03c38d18-d12f-4b5f-841c-afab52fe33c5",
	"data": {
		"our_number": 142,
		"paid_amount": 6676.38,
		"payment_bank": 104,
		"bank_slip_key": "03c38d18-d12f-4b5f-841c-afab52fe33c5",
		"payment_method": 2,
		"payment_origin": 3,
        "paid_in": {
            "name": "QI TECH",
            "code_number": "329",
            "ispb": "32402502"
        },
		"occurrence_type": "payment_notice",
		"occurrence_feedback": "confirmed",
		"occurrence_sequence": 0,
		"requester_profile_code": "329-09-0001-0082162",
		"registration_institution": "qi_scd",
		"cnab_file_occurrence_order": 1,
		"registration_institution_occurrence_date": "2021-04-19"
	},
	"status": "payment_notice",
	"webhook_type": "bank_slip.status_change",
	"event_datetime": "2021-04-19 20:04:06"
}

```

Translation of payment origin IDs:
| ID | Description |
|---|---|
| 1 | Traditional branches. |
| 2 | Self-service terminal. |
| 3 | Internet (home/office bank). |
| 5 | Banking correspondent. |
| 6 | Call center. |
| 7 | Electronic file. |
| 8 | DDA. |
| 9 | Digital Correspondent. |
| 901 | Payment via Pix QR Code. |

### Payment

Webhook Body: Payment via QR Code

```json
{
	"key": "505fd25f-89cf-40ca-927c-3800f207146a",
	"data": {
		"agent_type": "system",
		"our_number": 69993012,
		"origin_type": "qr_code",
		"paid_amount": 551.5,
		"payment_bank": "329",
		"bank_slip_key": "505fd25f-89cf-40ca-927c-3800f207146a",
		"payment_branch": "0001",
		"payment_method": "2",
		"payment_origin": "901",
		"discount_amount": 0.0,
		"occurrence_type": "payment",
		"payment_account": "1727560-2",
		"payment_bank_ispb": "32402502",
		"occurrence_reasons": [289],
		"occurrence_feedback": null,
		"occurrence_sequence": "0",
		"payment_credit_date": "2023-01-10",
		"selected_user_agent": null,
        "paid_in": {
            "name": "QI TECH",
            "code_number": "329",
            "ispb": "32402502"
        },
		"paid_interest_amount": 0.0,
		"requester_profile_code": "329-01-0001-0000002",
		"registration_institution": "qi_scd",
		"cnab_file_occurrence_order": 1,
		"registration_institution_occurrence_date": "2023-01-10"
	},
	"status": "paid",
	"webhook_type": "bank_slip.status_change",
	"event_datetime": "2023-01-10 14:08:46"
}

```

Webhook Body: Payment via digitable line

```json
{
	"key": "94cbc702-df42-4a84-bd03-d80728cde1e9",
	"data": {
		"our_number": 69993325,
		"paid_amount": 261.49,
		"payment_bank": 329,
		"protocol_date": null,
		"payment_branch": "0001",
		"discount_amount": 0.0,
		"occurrence_type": "payment",
        "paid_in": {
            "name": "QI TECH",
            "code_number": "329",
            "ispb": "32402502"
        },
		"paid_fine_amount": null,
		"occurrence_sequence": "2",
		"payment_credit_date": "2023-02-03",
		"notary_office_number": null,
		"paid_interest_amount": 0.0,
		"notary_office_protocol": null,
		"requester_profile_code": "329-01-0001-0000002",
		"cnab_file_occurrence_order": 1,
		"registration_institution_enumerator": "qi_scd",
		"registration_institution_occurrence_date": "2023-02-02"
	},
	"status": "paid",
	"webhook_type": "bank_slip.status_change",
	"event_datetime": "2023-02-03 07:00:27"
}

```

Translation of payment origin IDs:
| ID | Description |
|---|---|
| 1 | Traditional branches. |
| 2 | Self-service terminal. |
| 3 | Internet (home/office bank). |
| 5 | Banking correspondent. |
| 6 | Call center. |
| 7 | Electronic file. |
| 8 | DDA. |
| 9 | Digital correspondent. |
| 901 | Payment via Pix QR Code. |

### Baixa

Webhook Body

```json
{
	"key": "93e58a9a-287b-4bf2-9cdc-5467a9d3d9bf",
	"data": {
		"expiration": "2021-05-17",
		"our_number": 113,
		"bank_slip_key": "93e58a9a-287b-4bf2-9cdc-5467a9d3d9bf",
		"rebate_amount": 0,
		"occurrence_type": "write_off",
		"occurrence_reasons": [],
		"occurrence_feedback": "confirmed",
		"occurrence_sequence": 3,
		"requester_profile_code": "329-09-0001-0082162",
		"glados_occurrence_reasons": null,
		"cnab_file_occurrence_order": 1,
		"registration_institution_occurrence_date": "2021-04-20"
	},
	"occurrence_reason": {
		"bank_reason_code": "16",
		"bank_reason_name": "Título Baixado pelo Banco por decurso de Prazo"
	},
	"status": "written_off",
	"webhook_type": "bank_slip.status_change",
	"event_datetime": "2021-04-20 11:55:09"
}

```

Translation of write-off occurrence reasons:
| Code | Description |
|---|---|
| 00 | Occurrence Accepted. |
| 10 | Write-off Commanded by the client. |
| 14 | Protested Title. |
| 16 | Title Written Off by the Financial Institution due to Elapsed Time. |
| 20 | Title Written Off and Transferred for Discount. |

---

# Debt Webhooks

URL: /en/documentation/webhooks/dividas

:::info Information
Our webhook response timeout is 10 seconds.
:::

:::danger Attention!
QI Tech's webhooks must not be mapped in a restricted manner
Additional fields may be included in our API webhook payloads.
:::

:::info Reenvio de Webhooks
You may consult and resend webhooks following the detailed guide [Resending Webhooks](/documentation/notificacoes/reenvio_de_notificacoes)
:::

## Operation creation Webhook 

Response Body

```json
{
    "key": "871059bd-4014-41ad-82b4-28275ff0e67b",
    "data": {
        "entry": null,
        "borrower": {
            "name": "marcos antonio",
            "document_number": "33205493087"
        },
        "contract": {
            "urls": ["https://qitech.com.br/"],
            "number": "0000000000/SDM",
            "signers": [{
                "signer_name": "marcos antonio ",
                "signer_role": "issuer",
                "signer_email": "teste@teste.com",
                "signature_url": "https://qitech.com.br/",
                "signer_external_key": "c446eaa1-04ec-429c-97b0-2ef8ea583c44",
                "signer_document_number": "75305593972"
            }],
            "external_contract_key": "c446eaa1-04ec-429c-97b0-2ef8ea583c44"
        },
        "collaterals": [],
        "iof_charge_method": "financed",
        "disbursement_options": [{
            "cet": "0,6200%",
            "base_iof": 8.9496686,
            "total_iof": 10.09,
            "annual_cet": "7,6990%",
            "installments": [{
                "due_date": "2024-03-01",
                "workdays": 395,
                "tax_amount": 8.9496686,
                "fine_amount": null,
                "due_interest": 0,
                "has_interest": true,
                "total_amount": 323.12,
                "calendar_days": 580,
                "due_principal": 299.02,
                "additional_costs": [],
                "installment_type": null,
                "pre_fixed_amount": 24.1,
                "business_due_date": "2024-04-02",
                "post_fixed_amount": null,
                "installment_number": 1,
                "installment_status": null,
                "principal_amortization_amount": 299.02
            }],
            "issue_amount": 299.02,
            "contract_fees": [{
                "fee_type": "tac",
                "fee_amount": 1.5
            }],
            "additional_iof": 1.136276,
            "assignment_amount": 299.02,
            "disbursement_date": "2022-09-29",
            "contract_fee_amount": 1.5,
            "disbursed_issue_amount": 287.43,
            "external_contract_fees": [],
            "number_of_installments": null,
            "total_pre_fixed_amount": 24.1,
            "external_contract_fee_amount": 0,
            "net_external_contract_fee_amount": 0
        }, {
            "cet": "0,6200%",
            "base_iof": 8.9508658,
            "total_iof": 10.09,
            "annual_cet": "7,6990%",
            "installments": [{
                "due_date": "2024-05-01",
                "workdays": 394,
                "tax_amount": 8.9508658,
                "fine_amount": null,
                "due_interest": 0,
                "has_interest": true,
                "total_amount": 323.12,
                "calendar_days": 579,
                "due_principal": 299.06,
                "additional_costs": [],
                "installment_type": null,
                "pre_fixed_amount": 24.06,
                "business_due_date": "2024-05-02",
                "post_fixed_amount": null,
                "installment_number": 1,
                "installment_status": null,
                "principal_amortization_amount": 299.06
            }],
            "issue_amount": 299.06,
            "contract_fees": [{
                "fee_type": "tac",
                "fee_amount": 1.5
            }],
            "additional_iof": 1.136428,
            "assignment_amount": 299.06,
            "disbursement_date": "2022-09-30",
            "contract_fee_amount": 1.5,
            "disbursed_issue_amount": 287.47,
            "external_contract_fees": [],
            "number_of_installments": null,
            "total_pre_fixed_amount": 24.06,
            "external_contract_fee_amount": 0,
            "net_external_contract_fee_amount": 0
        }, {
            "cet": "0,6200%",
            "base_iof": 8.952063,
            "total_iof": 10.09,
            "annual_cet": "7,6990%",
            "installments": [{
                "due_date": "2024-05-01",
                "workdays": 394,
                "tax_amount": 8.952063,
                "fine_amount": null,
                "due_interest": 0,
                "has_interest": true,
                "total_amount": 323.12,
                "calendar_days": 578,
                "due_principal": 299.1,
                "additional_costs": [],
                "installment_type": null,
                "pre_fixed_amount": 24.02,
                "business_due_date": "2024-05-02",
                "post_fixed_amount": null,
                "installment_number": 1,
                "installment_status": null,
                "principal_amortization_amount": 299.1
            }],
            "issue_amount": 299.1,
            "contract_fees": [{
                "fee_type": "tac",
                "fee_amount": 1.5
            }],
            "additional_iof": 1.13658,
            "assignment_amount": 299.1,
            "disbursement_date": "2022-10-01",
            "contract_fee_amount": 1.5,
            "disbursed_issue_amount": 287.51,
            "external_contract_fees": [],
            "number_of_installments": null,
            "total_pre_fixed_amount": 24.02,
            "external_contract_fee_amount": 0,
            "net_external_contract_fee_amount": 0
        }, {
            "cet": "0,6200%",
            "base_iof": 8.9532602,
            "total_iof": 10.09,
            "annual_cet": "7,6990%",
            "installments": [{
                "due_date": "2024-05-01",
                "workdays": 394,
                "tax_amount": 8.9532602,
                "fine_amount": null,
                "due_interest": 0,
                "has_interest": true,
                "total_amount": 323.12,
                "calendar_days": 577,
                "due_principal": 299.14,
                "additional_costs": [],
                "installment_type": null,
                "pre_fixed_amount": 23.98,
                "business_due_date": "2024-05-02",
                "post_fixed_amount": null,
                "installment_number": 1,
                "installment_status": null,
                "principal_amortization_amount": 299.14
            }],
            "issue_amount": 299.14,
            "contract_fees": [{
                "fee_type": "tac",
                "fee_amount": 1.5
            }],
            "additional_iof": 1.136732,
            "assignment_amount": 299.14,
            "disbursement_date": "2022-10-02",
            "contract_fee_amount": 1.5,
            "disbursed_issue_amount": 287.55,
            "external_contract_fees": [],
            "number_of_installments": null,
            "total_pre_fixed_amount": 23.98,
            "external_contract_fee_amount": 0,
            "net_external_contract_fee_amount": 0
        }, {
            "cet": "0,6200%",
            "base_iof": 8.9544574,
            "total_iof": 10.09,
            "annual_cet": "7,6990%",
            "installments": [{
                "due_date": "2024-05-01",
                "workdays": 393,
                "tax_amount": 8.9544574,
                "fine_amount": null,
                "due_interest": 0,
                "has_interest": true,
                "total_amount": 323.12,
                "calendar_days": 576,
                "due_principal": 299.18,
                "additional_costs": [],
                "installment_type": null,
                "pre_fixed_amount": 23.94,
                "business_due_date": "2024-05-02",
                "post_fixed_amount": null,
                "installment_number": 1,
                "installment_status": null,
                "principal_amortization_amount": 299.18
            }],
            "issue_amount": 299.18,
            "contract_fees": [{
                "fee_type": "tac",
                "fee_amount": 1.5
            }],
            "additional_iof": 1.136884,
            "assignment_amount": 299.18,
            "disbursement_date": "2022-10-03",
            "contract_fee_amount": 1.5,
            "disbursed_issue_amount": 287.59,
            "external_contract_fees": [],
            "number_of_installments": null,
            "total_pre_fixed_amount": 23.94,
            "external_contract_fee_amount": 0,
            "net_external_contract_fee_amount": 0
        }, {
            "cet": "0,6200%",
            "base_iof": 8.9556546,
            "total_iof": 10.09,
            "annual_cet": "7,6990%",
            "installments": [{
                "due_date": "2024-05-01",
                "workdays": 392,
                "tax_amount": 8.9556546,
                "fine_amount": null,
                "due_interest": 0,
                "has_interest": true,
                "total_amount": 323.12,
                "calendar_days": 575,
                "due_principal": 299.22,
                "additional_costs": [],
                "installment_type": null,
                "pre_fixed_amount": 23.9,
                "business_due_date": "2024-05-02",
                "post_fixed_amount": null,
                "installment_number": 1,
                "installment_status": null,
                "principal_amortization_amount": 299.22
            }],
            "issue_amount": 299.22,
            "contract_fees": [{
                "fee_type": "tac",
                "fee_amount": 1.5
            }],
            "additional_iof": 1.137036,
            "assignment_amount": 299.22,
            "disbursement_date": "2022-10-04",
            "contract_fee_amount": 1.5,
            "disbursed_issue_amount": 287.63,
            "external_contract_fees": [],
            "number_of_installments": null,
            "total_pre_fixed_amount": 23.9,
            "external_contract_fee_amount": 0,
            "net_external_contract_fee_amount": 0
        }, {
            "cet": "0,6200%",
            "base_iof": 8.9568518,
            "total_iof": 10.09,
            "annual_cet": "7,6990%",
            "installments": [{
                "due_date": "2024-05-01",
                "workdays": 391,
                "tax_amount": 8.9568518,
                "fine_amount": null,
                "due_interest": 0,
                "has_interest": true,
                "total_amount": 323.12,
                "calendar_days": 574,
                "due_principal": 299.26,
                "additional_costs": [],
                "installment_type": null,
                "pre_fixed_amount": 23.86,
                "business_due_date": "2024-05-02",
                "post_fixed_amount": null,
                "installment_number": 1,
                "installment_status": null,
                "principal_amortization_amount": 299.26
            }],
            "issue_amount": 299.26,
            "contract_fees": [{
                "fee_type": "tac",
                "fee_amount": 1.5
            }],
            "additional_iof": 1.137188,
            "assignment_amount": 299.26,
            "disbursement_date": "2022-10-05",
            "contract_fee_amount": 1.5,
            "disbursed_issue_amount": 287.67,
            "external_contract_fees": [],
            "number_of_installments": null,
            "total_pre_fixed_amount": 23.86,
            "external_contract_fee_amount": 0,
            "net_external_contract_fee_amount": 0
        }, {
            "cet": "0,6200%",
            "base_iof": 8.958049,
            "total_iof": 10.1,
            "annual_cet": "7,6990%",
            "installments": [{
                "due_date": "2024-05-01",
                "workdays": 390,
                "tax_amount": 8.958049,
                "fine_amount": null,
                "due_interest": 0,
                "has_interest": true,
                "total_amount": 323.12,
                "calendar_days": 573,
                "due_principal": 299.3,
                "additional_costs": [],
                "installment_type": null,
                "pre_fixed_amount": 23.82,
                "business_due_date": "2024-05-02",
                "post_fixed_amount": null,
                "installment_number": 1,
                "installment_status": null,
                "principal_amortization_amount": 299.3
            }],
            "issue_amount": 299.3,
            "contract_fees": [{
                "fee_type": "tac",
                "fee_amount": 1.5
            }],
            "additional_iof": 1.13734,
            "assignment_amount": 299.3,
            "disbursement_date": "2022-10-06",
            "contract_fee_amount": 1.5,
            "disbursed_issue_amount": 287.7,
            "external_contract_fees": [],
            "number_of_installments": null,
            "total_pre_fixed_amount": 23.82,
            "external_contract_fee_amount": 0,
            "net_external_contract_fee_amount": 0
        }],
        "prefixed_interest_rate": {
            "created_at": null,
            "daily_rate": 0.00013368,
            "annual_rate": 0.05,
            "monthly_rate": 0.00407412,
            "interest_base": "calendar_days_365"
        },
        "post_fixed_interest_base": "workdays",
        "post_fixed_interest_rate": 1,
        "requester_identifier_key": "57f8e1ce-1080-4d0d-a195-89709b961561"
    },
    "status": "waiting_signature",
    "webhook_type": "debt",
    "event_datetime": "2022-09-29 20:00:54"
}

```

## Disbursement Webhook.

Response Body

```json
{
    "key": "871059bd-4014-41ad-82b4-28275ff0e67b",
    "data": {
        "installments": [{
            "due_date": "2022-09-29",
            "qr_code_key": "871059bd-4014-41ad-82b4-28275ff0e67b",
            "qr_code_url": "https://qitech.com.br/",
            "bank_slip_key": "871059bd-4014-41ad-82b4-28275ff0e67b",
            "digitable_line": "32990001031000699920446000000201991230000019896"
        }, {
            "due_date": "2022-10-31",
            "qr_code_key": "871059bd-4014-41ad-82b4-28275ff0e67b",
            "qr_code_url": "https://qitech.com.br/",
            "bank_slip_key": "243f9441-872a-4d64-886c-2f9724c36f2e",
            "digitable_line": "32990001031000699920447000000209191550000019896"
        }, {
            "due_date": "2022-11-29",
            "qr_code_key": "871059bd-4014-41ad-82b4-28275ff0e67b",
            "qr_code_url": "https://qitech.com.br/",
            "bank_slip_key": "871059bd-4014-41ad-82b4-28275ff0e67b",
            "digitable_line": "32990001031000699920448000000207891840000019896"
        }, {
            "due_date": "2022-12-29",
            "qr_code_key": "871059bd-4014-41ad-82b4-28275ff0e67b",
            "qr_code_url": "00020126970014br.gov.bcb.pix2575qrcode-h.sandbox.qitech.app/bacen/cobv/cf7d2d2e-003a-4296-9daf-350864d282245204000053039865802BR5925QI SOCIEDADE DE CREDITO D6009Sao Paulo61080145200062070503***63047335",
            "bank_slip_key": "871059bd-4014-41ad-82b4-28275ff0e67b",
            "digitable_line": "32990001031000699920449000000205892140000019896"
        }, {
            "due_date": "2023-01-30",
            "qr_code_key": "e809ffca-ac2f-4a51-9f4f-df7ffc4de8e3",
            "qr_code_url": "https://qitech.com.br/",
            "bank_slip_key": "871059bd-4014-41ad-82b4-28275ff0e67b",
            "digitable_line": "32990001031000699920450000000203792460000019892"
        }],
        "ted_receipt_list": [{
            "fee": 0,
            "url": "https://qitech.com.br/",
            "amount": 500,
            "origin": {
                "name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
                "type": "payment_account",
                "branch": "0001",
                "document": "0000000000000",
                "bank_code": "000",
                "account_key": "871059bd-4014-41ad-82b4-28275ff0e67b",
                "branch_digit": null,
                "account_digit": "5",
                "account_branch": "0001",
                "account_number": "00002"
            },
            "timestamp": "2022-09-28T13:00:47",
            "description": "DESCRIPTION",
            "destination": {
                "name": "QI TECH",
                "type": "checking_account",
                "branch": "0000",
                "purpose": "Crédito PIX em Conta",
                "document": "000000000000000",
                "bank_ispb": "00000000",
                "branch_digit": null,
                "account_digit": "0",
                "account_number": "00000000"
            },
            "end_to_end_id": null,
            "transaction_key": "871059bd-4014-41ad-82b4-28275ff0e67b",
            "origin_transaction_key": null
        }],
        "requester_identifier_key": "57f8e1ce-1080-4d0d-a195-89709b961561"
    },
    "status": "disbursed",
    "webhook_type": "debt",
    "event_datetime": "2022-09-28 13:01:23"
}

```

## Operation cancelled 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 "
  }

```

## Debt settled 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 reasons

| Enumerator                  | Description                                                                   | 
|-----------------------------|-------------------------------------------------------------------------------|
| disbursing_error            | Operation cancelled due to disbursement error                         
| waiting_signature           | Operation cancelled due to awaiting signature                           
| is_portability              | Operation cancelled due to failed portability      
| not_collateral_constituted	 | Operation cancelled due to inability to constitute collateral            
| entry_not_paid              | Operation cancelled due to entry not being paid                         
| not_assigned                | Operation cancelled due to inability to assign         
| pix_max_retry               | Operation cancelled due to too many disbursement errors 
| lack_of_resource            | Operation cancelled due to lack of resource for disbursement                                      
| manual                      | Operation cancelled manually                                               
| kyc_not_accepted            | Operation cancelled due to KYC error                      
| not_collateral_fgts         | Operation cancelled due inability to constitute FGTS collateral                                       
| agencia_conta_invalida	     | Operation cancelled due error in disbursement agency or bank account                            
| invalid_account             | 	Operation cancelled due invalid bank account                     
| invalid_document_number	    | Operation cancelled due to error in document number                                
| unsupported_transaction	    | Operation cancelled due unsuported transaction account type                        
| bank_slip_payment	          | Operation cancelled due to bankslip error                 
| bank_slip_paid	             | Operation cancelled due to bankslip already being paid                                
| bank_slip_written_off	      | Operation cancelled due to bankslip being written off                        
| invalid_ispb	               | Operation cancelled due to invalid bank ISPB                                         
| rejected_payment            | 	Operation cancelled due rejected payment by receiving bank

---

# Risk management webhooks

URL: /en/documentation/webhooks/gestao_de_risco

The `risk_amount` represents the outstanding balance of operations that have not yet been **assigned** — i.e., the open portfolio exposure that remains under risk and consumes the available limit (`limit_amount`) for new issuances. As operations are assigned or settled, they stop contributing to the `risk_amount` and free up limit for new disbursements.

:::danger Disbursement rule
If `risk_amount + issue_amount > limit_amount`, the operation will not be disbursed.
:::

:::tip Enablement
Reach out to the QI Tech team so we can configure the delivery for you!
:::

## Risk update webhook

Sent periodically, **every hour**, with the update of the customer's accumulated risk value.

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"
}
```

## Limit update webhook

Sent whenever the customer's debt issuance limit is updated.

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"
}
```

## Definitions

### Callback object

| Field | Type | Description | Required |
|-------|------|-------------|----------|
| **event_datetime** | string | Event date and time in ISO 8601 UTC format | Yes |
| **key** | string | Unique event key | Yes |
| **status** | string | Event status | Yes |
| **webhook_type** | string | Webhook type (`risk_management.risk_updated` or `risk_management.limit_updated`) | Yes |
| **data** | object | Risk management event-specific data | Yes |

### Data object

| Field | Type | Description | Required |
|-------|------|-------------|----------|
| **risk_amount** | number | Outstanding balance of non-assigned operations — open portfolio exposure consuming the available limit | Yes |
| **limit_amount** | number | Total limit available for issuing new debts | Yes |
| **reconciled_at** | string | Date and time of the last reconciliation in ISO 8601 format | Yes |

---

# Overpayment webhooks

URL: /en/documentation/webhooks/indevidos

:::info Information
The timeout for our webhooks response is 5 seconds.
:::

:::danger Attention!
QI Tech webhooks should not be mapped in a restrictive way. 
Additional fields may be included in webhook payloads returned by our APIs.
:::

:::info Webhook Resending
You can check and resend webhooks by following the detailed instructions in the documentation: [Webhook Resending](/documentation/notificacoes/reenvio_de_notificacoes).
:::

## Introduction

This webhook is automatically triggered when QI Tech identifies and processes the return of an overpayment amount. After validation, the system performs the transfer via PIX to the borrower, using the disbursement account registered in the system. The event is sent only when the return is successfully completed.

## Overpayment refund 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"
        }
    }
}
```

## Definitions

### Callback object

| Field | Type | Description | Required |
|-------|------|-------------|----------|
| **event_datetime** | string | Event date and time in ISO 8601 UTC format | Yes |
| **key** | string | Unique devolution key | Yes |
| **status** | string | Devolution status | Yes |
| **webhook_type** | string | Webhook type | Yes |
| **data** | object | Specific devolution data | Yes |

### Data object

| Field | Type | Description | Required |
|-------|------|-------------|----------|
| **devolution_key** | string | Unique devolution key | Yes |
| **devolution_amount** | number | Devolution amount in reais | Yes |
| **devolution_status** | string | Current devolution status | Yes |
| **devolution_reason_description** | string | Description of the devolution reason | Yes |
| **receipt_url** | string | Devolution receipt URL | Yes |
| **document_key** | string | Related document key | Yes |
| **transacted_at** | string | Transaction date and time in ISO 8601 UTC format | Yes |

## Possible statuses

| Status | Description |
|--------|-------------|
| **refunded** | Devolution processed successfully |

## Usage example

When you receive this webhook, it means that a PIX refund has been processed successfully. You can:

1. Check the devolution status through the `devolution_status` field
2. Access the receipt through the URL provided in `receipt_url`
3. Identify the refunded amount through the `devolution_amount` field
4. Check the reason for the devolution through the `devolution_reason_description` field

---

# notificacoes_baas_e_laas

URL: /en/documentation/webhooks/notificacoes_baas_e_laas

---- 

A QI Tech possui um sistema de webhooks para informar o status dos processos que ocorrem de forma assíncrona ou offline, eles estão divididos por categorias de acordo com as sessões que atendem.

:::caution Atenção!

Nossos webhooks podem ser enviados mais de uma vez (em casos de timeout, por exemplo), como também podem não ser enviados de forma ordenada.
:::

---- 

### Operações de crédito:
#### Contratos:
- Contrato aguardando assinatura;
- Contrato assinado;

#### Desembolso:
- Operação desembolsada;
- Operação cancelada;
- Contrato quitado (Configurada mediante a solicitação);
#### Parcelas (Configurada mediante a solicitação):
- Parcela em aberto
- Parcela Paga
- Parcela aguardando pagamento;
- Parcela paga antecipadamente;
- Parcela vencida;
- Parcela paga parcialmente após o vencimento;
- Parcela paga após o vencimento
#### Boletos:
- Solicitação de registro criada;
- Boleto registrado;
- Notificação de pagamento;
- Boleto pago;
- Boleto baixado;
- Boleto rejeitado;
- Boleto pago em cartório;
#### SCR:
- Resultado da consulta;

---- 

### Como confirmar o recebimento de uma notificação?

Para confirmar o sucesso no recebimento é necessário que o status da resposta seja 200 e que exista uma resposta assinada para a notificação semelhante a enviada em requisições.

Ou seja, deverá ter um response_body no formato **\{"encoded_body": "payloadEmJWT"\}** e um response header **Authorization**. Neste header a diferença única é que no path você deve colocar o endpoint de recebimento da notificação.

Caso não exista uma confirmação de recebimento o mecanismo de redundância dos webhooks será acionado.

---- 

### Redundância
Possuímos um mecanismo de redundância nas notificações enviadas que gera 3 retentivas, uma a cada 5 minutos.

---

# Installment payment webhooks

URL: /en/documentation/webhooks/pagamento_de_parcela

:::info Information
The timeout for our webhook responses is 10 seconds.
:::

:::danger Attention!
QI Tech webhooks should not be mapped in a restrictive manner. 
Additional fields may be included in the webhook payloads returned by our APIs.
:::

:::info Webhook Resending
You can check and resend webhooks by following the detailed instructions in the documentation: [Webhook Resending](/documentation/notificacoes/reenvio_de_notificacoes).
:::

----
### Example of paid installment 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
            }
    },
}
```

## Appendix

### Field descriptions {#paid_method}

|Field                                  | Type              | Description     |
|-------------------------------------- |------             |-----          |
|key                                    |UUID               |debt identifier key (credit_operation_key or DEBT_KEY)|
|installment_key                        |UUID               |installment identifier key|
|reference_date                         |Date               |Reference date for calculating the installment outstanding balance|            
|paid_at                                |DateTime           |Payment date|        
|paid_method_type                       |string             |Payment method, check the possible enumerators in the [Enumerators for paid_method_type](#paid_method) table|                
|installment_status                     |string             |Installment status, check the possible enumerators in the [Enumerators for installment_status](#installment_status) table|
|installment_payment_key                |UUID               |Unique payment key|                        
|paid_amount                            |decimal            |Amount paid|            
|total_amount                           |decimal            |Total installment amount, in case of partial payment it is updated with the outstanding amount|            
|present_total_amount                   |decimal            |Present value on the reference date (reference_date)|                    
|prefixed_interest_payment_amount       |decimal            |Payment amount referring to interest amortization|                    
|principal_amortization_payment_amount  |decimal            |Payment amount referring to principal amortization|                    
|resource_account_key                   |UUID               |Source account of the balance used in settlement|                    
|batch_renegotiation_proposal_key       |UUID               |Batch renegotiation key, if applicable|                                
|renegotiation_proposal_key             |UUID               |Renegotiation key, if applicable|                        
|refinancing_credit_operation_key       |UUID               |Refinancing operation key, if applicable|                        
|received_portability_key               |UUID               |Received portability key, if applicable|                        
|bank_slip_key                          |UUID               |Bank slip key registered with the installment, if applicable|                        
|pix_qrcode_key                         |UUID               |PIX QR code key registered with the installment, if applicable|                        
|paid_in                                |object             |Payer bank information, applicable in cases of PIX or bank slip payments|                        

:::warning Fine and late fee payment amount
The fine + late fee amount (fine_amount) of the payment can be identified through the formula:

fine_amount = paid_amount - prefixed_interest_payment_amount - principal_amortization_payment_amount.
:::

### Enumerators for paid_method_type {#paid_method}

| Enumerator            | Description       |
|-----------------------|--------           |
|bankslip               | Bank slip         |
|ted                    | TED               |
|pix                    | PIX               |
|refinancing            | refinancing       |
|portability            | portability       |
|unmonitored            | manual write-off  |
|collateral             | collateral        |

### Enumerators for installment_status {#installment_status}

| Enumerator                            | Description   |
|-----------------------                |--------     |
|created                                | open    |      
|opened                                 | open    |  
|waiting_payment                        | open waiting payment on due date |              
|paid_partial                           | partially paid |          
|paid                                   | paid |  
|paid_early                             | paid early |      
|overdue                                | overdue |      
|paid_partial_overdue                   | partially paid overdue |                  
|paid_overdue                           | paid overdue |          
|canceled                               | canceled |      
|unmonitored                            | open |          
|waiting_payment_confirmation           | waiting refinancing settlement |                          

:::warning Partially paid early
Note that there is no partially paid early status. In case of a partial write-off with a reference date prior to the installment due date, the previous status is maintained (unmonitored or opened).
:::

---

# Installment Webhooks

URL: /en/documentation/webhooks/parcelas

:::info Information
Our webhook response timeout is 10 seconds.
:::

:::danger Attention!
QI Tech's webhooks must not be mapped in a restricted manner
Additional fields may be included in our API webhook payloads.
:::

:::info Reenvio de Webhooks
You may consult and resend webhooks following the detailed guide [Resending Webhooks](/documentation/notificacoes/reenvio_de_notificacoes)
:::

This configuration may be enabled when QI Tech is the operation collection agent, with it you will receive status changes based for each installment.

The following status may be configured:
- **opened**
- **paid**
- **waiting_payment**
- **paid_early**
- **paid_partial**
- **overdue**
- **paid_partial_overdue**
- **paid_overdue**

----
### Example paid installment webhook

Body.json

```json
{
    "key": "92a05d9c-e457-4f28-9fa8-86be638ee2d0",
    "data": {
        "status": "paid",
        "installment": {
            "events": [{
                "amount": null,
                "created_at": "2022-08-27T10:55:41",
                "event_date": "2022-08-27T10:55:42",
                "old_due_date": null,
                "installment_event_type": {
                    "enumerator": "open",
                    "translation_path": "co.InstallmentEventType.open"
                },
                "installment_old_status": {
                    "enumerator": "created",
                    "translation_path": "co.InstallmentStatus.created"
                }
            }, {
                "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",
            "workdays": 21,
            "created_at": "2022-08-27T10:54:18",
            "tax_amount": 5.11785875,
            "updated_at": "2022-09-27T07:03:35",
            "fine_amount": null,
            "paid_amount": 1009.68,
            "qr_code_key": "92a05d9c-e457-4f28-9fa8-86be638ee2d0",
            "qr_code_url": "https://qitech.com.br/",
            "due_interest": 0,
            "has_interest": true,
            "payment_type": {
                "enumerator": "bankslip",
                "translation_path": "co.PaymentType.bankslip"
            },
            "total_amount": 1009.68,
            "bank_slip_key": "92a05d9c-e457-4f28-9fa8-86be638ee2d0",
            "calendar_days": 30,
            "due_principal": 1006.66428708,
            "digitable_line": "32990001031000699917042000000200291520000100968",
            "installment_key": "92a05d9c-e457-4f28-9fa8-86be638ee2d0",
            "additional_costs": [],
            "installment_type": {
                "enumerator": "principal",
                "translation_path": "co.InstallmentType.principal"
            },
            "pre_fixed_amount": 3.02013568,
            "business_due_date": "2022-10-31",
            "cetip_settlements": [],
            "post_fixed_amount": 0,
            "total_paid_amount": 0,
            "installment_number": 3,
            "installment_status": {
                "enumerator": "paid",
                "translation_path": "co.InstallmentStatus.paid"
            },
            "installment_payment": [{
                "created_at": "2022-09-27T07:03:35",
                "paid_amount": 1009.68,
                "total_amount": 1009.68,
                "due_principal": 1006.66428708,
                "reference_date": "2022-09-27",
                "paid_method_type": {
                    "enumerator": "pix",
                    "translation_path": "co.PaymentType.pix"
                },
                "payment_data":{
                    "paid_in":{
                        "name": "ITAÚ UNIBANCO S.A.",
                        "code_number": 341,
                        "ispb": 60701190
                    }
                },
                "pre_fixed_amount": 3.02013568,
                "advanced_paid_amount": 0,
                "present_total_amount": 1009.68,
                "renegotiation_proposal_key": null,
                "principal_amortization_amount": 1006.65986432,
                "prefixed_interest_payment_amount": 3.02013568,
                "principal_amortization_payment_amount": 1006.65986432
            }],
            "advanced_paid_amount": 0,
            "total_accrual_amount": 0,
            "original_total_amount": 1009.68,
            "accrual_reference_date": "2022-09-27",
            "original_due_principal": 1006.66428708,
            "original_pre_fixed_amount": 3.02013568,
            "renegotiation_proposal_key": null,
            "principal_amortization_amount": 1006.65986432,
            "original_principal_amortization_amount": 1006.65986432
        },
        "is_finished": true
    },
    "webhook_type": "installment.status_change"
}

```

### Exemplo created bankslip 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
            },
            {
                "principal_amortization_amount": 144.84483469,
                "pre_fixed_amount": 65.12516531,
                "due_date": "2024-08-19",
                "digitable_line": "32990001454000000000627007797908997530000500000",
                "installment_key": "be3f0fde-24ac-42d2-82e9-4b0aa15bf01e",
                "qr_code_key": "4d696847-73a2-4dba-be9f-218084dff8e7",
                "qr_code_url": "00020126580014br.gov.bcb.pix0136dc4a27db-2fe1-474d-aa02-88d6fffb8d0d5204000053039865802BR5921NeymarSportEMarketing6008saopaulo62070503***63040EB2",
                "total_amount": 216.97,
                "bank_slip_key": "bc1cc18f-2db5-470d-8541-b944e53cb699"
            },
            {
                "qr_code_url": "00020126580014br.gov.bcb.pix0136dc4a27db-2fe1-474d-aa02-88d6fffb8d0d5204000053039865802BR5921NeymarSportEMarketing6008saopaulo62070503***63040EB2",
                "digitable_line": "32990001454000000000623007797907697530000500000",
                "bank_slip_key": "8a00a520-7d49-4f51-9293-9ea26e241338",
                "principal_amortization_amount": 164.37001228,
                "installment_key": "3d4b5f21-c0a3-4075-bac2-9086cd90b77e",
                "due_date": "2024-09-17",
                "qr_code_key": "4d47528a-167d-41aa-b9da-246d2030af75",
                "total_amount": 216.97,
                "pre_fixed_amount": 52.59998772
            }
        ]
    }
}

```

## Definitions

### Object Request Body
| Field              | Type   | Description         | Max. Caract. | 
|--------------------|--------|---------------------|--------------|
| **key** *          | object | Installment DEBT-KEY | -            | 
| **data** *         | object | Webhook Data        | -            |
| **webhook_type** * | object | Webhook Type        | -            |

### Object data
| Field             | Type     | Description                                        | Max. Caract. | 
|-------------------|----------|----------------------------------------------------|--------------|
| **status** *      | object   | Installment Status                                 | -            | 
| **installment** * | object   | Installment Data                                   | -            |
| **is_finished** * | booleano | Boolean field to signal if installment is finished | -            |

### Object installment
| Field            | Type   | Description                           | Max. Caract. | 
|------------------|--------|---------------------------------------|--------------|
| **events** *     | object | Installment Status                    | -            | 
| **paid_at** *    | object | Paid installment date                 | -            |
| **due_date** *   | string | Installment due date                  | -            |
| **workdays** *   | Int    | Days between disbursement and due date | -            |
| **created_at** * | string   | Installment created date              | -            |
| **tax_amount** * | Float  | Installment tax amount                | -            |
| **updated_at** * | string   | Installment update date               | -            |